@volter/world-console 3.0.3 → 3.0.5
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/client/console.css +20 -0
- package/client/console.tsx +208 -65
- package/dist/client/console.bundle.js +13 -13
- package/dist/client/console.css +20 -0
- package/dist/client/console.tsx +208 -65
- package/dist/client/main.bundle.js +87 -87
- package/package.json +3 -3
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var
|
|
1
|
+
var xQ=Object.create;var{getPrototypeOf:mQ,defineProperty:K8,getOwnPropertyNames:gQ}=Object;var pQ=Object.prototype.hasOwnProperty;function cQ(_){return this[_]}var lQ,rQ,g1=(_,Q,J)=>{var q=_!=null&&typeof _==="object";if(q){var U=Q?lQ??=new WeakMap:rQ??=new WeakMap,G=U.get(_);if(G)return G}J=_!=null?xQ(mQ(_)):{};let Z=Q||!_||!_.__esModule?K8(J,"default",{value:_,enumerable:!0}):J;for(let F of gQ(_))if(!pQ.call(Z,F))K8(Z,F,{get:cQ.bind(_,F),enumerable:!0});if(q)U.set(_,Z);return Z};var a0=(_,Q)=>()=>(Q||_((Q={exports:{}}).exports,Q),Q.exports);var L0=a0((iQ,u5)=>{(function(){function _(M,x){Object.defineProperty(q.prototype,M,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",x[0],x[1])}})}function Q(M){if(M===null||typeof M!=="object")return null;return M=G1&&M[G1]||M["@@iterator"],typeof M==="function"?M:null}function J(M,x){M=(M=M.constructor)&&(M.displayName||M.name)||"ReactClass";var Q1=M+"."+x;F1[Q1]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",x,M),F1[Q1]=!0)}function q(M,x,Q1){this.props=M,this.context=x,this.refs=_1,this.updater=Q1||c}function U(){}function G(M,x,Q1){this.props=M,this.context=x,this.refs=_1,this.updater=Q1||c}function Z(){}function F(M){return""+M}function X(M){try{F(M);var x=!1}catch(H1){x=!0}if(x){x=console;var Q1=x.error,U1=typeof Symbol==="function"&&Symbol.toStringTag&&M[Symbol.toStringTag]||M.constructor.name||"Object";return Q1.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U1),F(M)}}function Y(M){if(M==null)return null;if(typeof M==="function")return M.$$typeof===K1?null:M.displayName||M.name||null;if(typeof M==="string")return M;switch(M){case h:return"Fragment";case v:return"Profiler";case I:return"StrictMode";case e:return"Suspense";case t:return"SuspenseList";case J1:return"Activity"}if(typeof M==="object")switch(typeof M.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),M.$$typeof){case V:return"Portal";case u:return M.displayName||"Context";case m:return(M._context.displayName||"Context")+".Consumer";case n:var x=M.render;return M=M.displayName,M||(M=x.displayName||x.name||"",M=M!==""?"ForwardRef("+M+")":"ForwardRef"),M;case a:return x=M.displayName||null,x!==null?x:Y(M.type)||"Memo";case g:x=M._payload,M=M._init;try{return Y(M(x))}catch(Q1){}}return null}function K(M){if(M===h)return"<>";if(typeof M==="object"&&M!==null&&M.$$typeof===g)return"<...>";try{var x=Y(M);return x?"<"+x+">":"<...>"}catch(Q1){return"<...>"}}function H(){var M=$1.A;return M===null?null:M.getOwner()}function L(){return Error("react-stack-top-frame")}function z(M){if(M1.call(M,"key")){var x=Object.getOwnPropertyDescriptor(M,"key").get;if(x&&x.isReactWarning)return!1}return M.key!==void 0}function W(M,x){function Q1(){x1||(x1=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}Q1.isReactWarning=!0,Object.defineProperty(M,"key",{get:Q1,configurable:!0})}function O(){var M=Y(this.type);return k1[M]||(k1[M]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),M=this.props.ref,M!==void 0?M:null}function R(M,x,Q1,U1,H1,W1){var z1=Q1.ref;return M={$$typeof:E,type:M,key:x,props:Q1,_owner:U1},(z1!==void 0?z1:null)!==null?Object.defineProperty(M,"ref",{enumerable:!1,get:O}):Object.defineProperty(M,"ref",{enumerable:!1,value:null}),M._store={},Object.defineProperty(M._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(M,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(M,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:H1}),Object.defineProperty(M,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W1}),Object.freeze&&(Object.freeze(M.props),Object.freeze(M)),M}function B(M,x){return x=R(M.type,x,M.props,M._owner,M._debugStack,M._debugTask),M._store&&(x._store.validated=M._store.validated),x}function P(M){A(M)?M._store&&(M._store.validated=1):typeof M==="object"&&M!==null&&M.$$typeof===g&&(M._payload.status==="fulfilled"?A(M._payload.value)&&M._payload.value._store&&(M._payload.value._store.validated=1):M._store&&(M._store.validated=1))}function A(M){return typeof M==="object"&&M!==null&&M.$$typeof===E}function T(M){var x={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Q1){return x[Q1]})}function f(M,x){return typeof M==="object"&&M!==null&&M.key!=null?(X(M.key),T(""+M.key)):x.toString(36)}function C(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status==="string"?M.then(Z,Z):(M.status="pending",M.then(function(x){M.status==="pending"&&(M.status="fulfilled",M.value=x)},function(x){M.status==="pending"&&(M.status="rejected",M.reason=x)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function w(M,x,Q1,U1,H1){var W1=typeof M;if(W1==="undefined"||W1==="boolean")M=null;var z1=!1;if(M===null)z1=!0;else switch(W1){case"bigint":case"string":case"number":z1=!0;break;case"object":switch(M.$$typeof){case E:case V:z1=!0;break;case g:return z1=M._init,w(z1(M._payload),x,Q1,U1,H1)}}if(z1){z1=M,H1=H1(z1);var P1=U1===""?"."+f(z1,0):U1;return o(H1)?(Q1="",P1!=null&&(Q1=P1.replace(_0,"$&/")+"/"),w(H1,x,Q1,"",function(Y0){return Y0})):H1!=null&&(A(H1)&&(H1.key!=null&&(z1&&z1.key===H1.key||X(H1.key)),Q1=B(H1,Q1+(H1.key==null||z1&&z1.key===H1.key?"":(""+H1.key).replace(_0,"$&/")+"/")+P1),U1!==""&&z1!=null&&A(z1)&&z1.key==null&&z1._store&&!z1._store.validated&&(Q1._store.validated=2),H1=Q1),x.push(H1)),1}if(z1=0,P1=U1===""?".":U1+":",o(M))for(var A1=0;A1<M.length;A1++)U1=M[A1],W1=P1+f(U1,A1),z1+=w(U1,x,Q1,W1,H1);else if(A1=Q(M),typeof A1==="function")for(A1===M.entries&&(e1||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),e1=!0),M=A1.call(M),A1=0;!(U1=M.next()).done;)U1=U1.value,W1=P1+f(U1,A1++),z1+=w(U1,x,Q1,W1,H1);else if(W1==="object"){if(typeof M.then==="function")return w(C(M),x,Q1,U1,H1);throw x=String(M),Error("Objects are not valid as a React child (found: "+(x==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":x)+"). If you meant to render a collection of children, use an array instead.")}return z1}function S(M,x,Q1){if(M==null)return M;var U1=[],H1=0;return w(M,U1,"","",function(W1){return x.call(Q1,W1,H1++)}),U1}function N(M){if(M._status===-1){var x=M._ioInfo;x!=null&&(x.start=x.end=performance.now()),x=M._result;var Q1=x();if(Q1.then(function(H1){if(M._status===0||M._status===-1){M._status=1,M._result=H1;var W1=M._ioInfo;W1!=null&&(W1.end=performance.now()),Q1.status===void 0&&(Q1.status="fulfilled",Q1.value=H1)}},function(H1){if(M._status===0||M._status===-1){M._status=2,M._result=H1;var W1=M._ioInfo;W1!=null&&(W1.end=performance.now()),Q1.status===void 0&&(Q1.status="rejected",Q1.reason=H1)}}),x=M._ioInfo,x!=null){x.value=Q1;var U1=Q1.displayName;typeof U1==="string"&&(x.name=U1)}M._status===-1&&(M._status=0,M._result=Q1)}if(M._status===1)return x=M._result,x===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
2
|
|
|
3
3
|
Your code should look like:
|
|
4
4
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
5
5
|
|
|
6
|
-
Did you accidentally put curly braces around the import?`,
|
|
6
|
+
Did you accidentally put curly braces around the import?`,x),"default"in x||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
7
|
|
|
8
8
|
Your code should look like:
|
|
9
|
-
const MyComponent = lazy(() => import('./MyComponent'))`,
|
|
9
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,x),x.default;throw M._result}function y(){var M=$1.H;return M===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
10
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
11
|
2. You might be breaking the Rules of Hooks
|
|
12
12
|
3. You might have more than one copy of React in the same app
|
|
13
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),M}function E(){q1.asyncTransitions--}function g(M){if(y0===null)try{var m=("require"+Math.random()).slice(0,7);y0=(k5&&k5[m]).call(k5,"timers").setImmediate}catch(n){y0=function(_1){B2===!1&&(B2=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var U1=new MessageChannel;U1.port1.onmessage=_1,U1.port2.postMessage(void 0)}}return y0(M)}function h(M){return 1<M.length&&typeof AggregateError==="function"?AggregateError(M):M[0]}function S(M,m){m!==M2-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),M2=m}function b(M,m,n){var _1=q1.actQueue;if(_1!==null)if(_1.length!==0)try{j(_1),g(function(){return b(M,m,n)});return}catch(U1){q1.thrownErrors.push(U1)}else q1.actQueue=null;0<q1.thrownErrors.length?(_1=h(q1.thrownErrors),q1.thrownErrors.length=0,n(_1)):m(M)}function j(M){if(!g2){g2=!0;var m=0;try{for(;m<M.length;m++){var n=M[m];do{q1.didUsePromise=!1;var _1=n(!1);if(_1!==null){if(q1.didUsePromise){M[m]=n,M.splice(0,m);return}n=_1}else break}while(1)}M.length=0}catch(U1){M.splice(0,m+1),q1.thrownErrors.push(U1)}finally{g2=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var x=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),t=Symbol.for("react.suspense"),a=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),e=Symbol.for("react.activity"),Q1=Symbol.iterator,G1={},$1={isMounted:function(){return!1},enqueueForceUpdate:function(M){J(M,"forceUpdate")},enqueueReplaceState:function(M){J(M,"replaceState")},enqueueSetState:function(M){J(M,"setState")}},Z1=Object.assign,Y1={};Object.freeze(Y1),q.prototype.isReactComponent={},q.prototype.setState=function(M,m){if(typeof M!=="object"&&typeof M!=="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,m,"setState")},q.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};var K1={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(r0 in K1)K1.hasOwnProperty(r0)&&_(r0,K1[r0]);U.prototype=q.prototype,K1=G.prototype=new U,K1.constructor=G,Z1(K1,q.prototype),K1.isPureReactComponent=!0;var o=Array.isArray,z1=Symbol.for("react.client.reference"),q1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},y1=Object.prototype.hasOwnProperty,c1=console.createTask?console.createTask:function(){return null};K1={react_stack_bottom_frame:function(M){return M()}};var l1,k0,F0={},M0=K1.react_stack_bottom_frame.bind(K1,L)(),a1=c1(X(L)),o1=!1,n1=/\/+/g,K0=typeof reportError==="function"?reportError:function(M){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var m=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M==="object"&&M!==null&&typeof M.message==="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(m))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",M);return}console.error(M)},B2=!1,y0=null,M2=0,T2=!1,g2=!1,S5=typeof queueMicrotask==="function"?function(M){queueMicrotask(function(){return queueMicrotask(M)})}:g;K1=Object.freeze({__proto__:null,c:function(M){return v().useMemoCache(M)}});var r0={map:k,forEach:function(M,m,n){k(M,function(){m.apply(this,arguments)},n)},count:function(M){var m=0;return k(M,function(){m++}),m},toArray:function(M){return k(M,function(m){return m})||[]},only:function(M){if(!A(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};pQ.Activity=e,pQ.Children=r0,pQ.Component=q,pQ.Fragment=D,pQ.Profiler=y,pQ.PureComponent=G,pQ.StrictMode=f,pQ.Suspense=t,pQ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q1,pQ.__COMPILER_RUNTIME=K1,pQ.act=function(M){var m=q1.actQueue,n=M2;M2++;var _1=q1.actQueue=m!==null?m:[],U1=!1;try{var W1=M()}catch(A1){q1.thrownErrors.push(A1)}if(0<q1.thrownErrors.length)throw S(m,n),M=h(q1.thrownErrors),q1.thrownErrors.length=0,M;if(W1!==null&&typeof W1==="object"&&typeof W1.then==="function"){var L1=W1;return S5(function(){U1||T2||(T2=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(A1,H0){U1=!0,L1.then(function(v0){if(S(m,n),n===0){try{j(_1),g(function(){return b(v0,A1,H0)})}catch(v4){q1.thrownErrors.push(v4)}if(0<q1.thrownErrors.length){var y4=h(q1.thrownErrors);q1.thrownErrors.length=0,H0(y4)}}else A1(v0)},function(v0){S(m,n),0<q1.thrownErrors.length?(v0=h(q1.thrownErrors),q1.thrownErrors.length=0,H0(v0)):H0(v0)})}}}var f1=W1;if(S(m,n),n===0&&(j(_1),_1.length!==0&&S5(function(){U1||T2||(T2=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),q1.actQueue=null),0<q1.thrownErrors.length)throw M=h(q1.thrownErrors),q1.thrownErrors.length=0,M;return{then:function(A1,H0){U1=!0,n===0?(q1.actQueue=_1,g(function(){return b(f1,A1,H0)})):A1(f1)}}},pQ.cache=function(M){return function(){return M.apply(null,arguments)}},pQ.cacheSignal=function(){return null},pQ.captureOwnerStack=function(){var M=q1.getCurrentStack;return M===null?null:M()},pQ.cloneElement=function(M,m,n){if(M===null||M===void 0)throw Error("The argument must be a React element, but you passed "+M+".");var _1=Z1({},M.props),U1=M.key,W1=M._owner;if(m!=null){var L1;_:{if(y1.call(m,"ref")&&(L1=Object.getOwnPropertyDescriptor(m,"ref").get)&&L1.isReactWarning){L1=!1;break _}L1=m.ref!==void 0}L1&&(W1=K()),z(m)&&(H(m.key),U1=""+m.key);for(f1 in m)!y1.call(m,f1)||f1==="key"||f1==="__self"||f1==="__source"||f1==="ref"&&m.ref===void 0||(_1[f1]=m[f1])}var f1=arguments.length-2;if(f1===1)_1.children=n;else if(1<f1){L1=Array(f1);for(var A1=0;A1<f1;A1++)L1[A1]=arguments[A1+2];_1.children=L1}_1=T(M.type,U1,_1,W1,M._debugStack,M._debugTask);for(U1=2;U1<arguments.length;U1++)w(arguments[U1]);return _1},pQ.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:p,_context:M},M._currentRenderer=null,M._currentRenderer2=null,M},pQ.createElement=function(M,m,n){for(var _1=2;_1<arguments.length;_1++)w(arguments[_1]);_1={};var U1=null;if(m!=null)for(A1 in k0||!("__self"in m)||"key"in m||(k0=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),z(m)&&(H(m.key),U1=""+m.key),m)y1.call(m,A1)&&A1!=="key"&&A1!=="__self"&&A1!=="__source"&&(_1[A1]=m[A1]);var W1=arguments.length-2;if(W1===1)_1.children=n;else if(1<W1){for(var L1=Array(W1),f1=0;f1<W1;f1++)L1[f1]=arguments[f1+2];Object.freeze&&Object.freeze(L1),_1.children=L1}if(M&&M.defaultProps)for(A1 in W1=M.defaultProps,W1)_1[A1]===void 0&&(_1[A1]=W1[A1]);U1&&W(_1,typeof M==="function"?M.displayName||M.name||"Unknown":M);var A1=1e4>q1.recentlyCreatedOwnerStacks++;return T(M,U1,_1,K(),A1?Error("react-stack-top-frame"):M0,A1?c1(X(M)):a1)},pQ.createRef=function(){var M={current:null};return Object.seal(M),M},pQ.forwardRef=function(M){M!=null&&M.$$typeof===d?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof M!=="function"?console.error("forwardRef requires a render function but was given %s.",M===null?"null":typeof M):M.length!==0&&M.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",M.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),M!=null&&M.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var m={$$typeof:s,render:M},n;return Object.defineProperty(m,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(_1){n=_1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:_1}),M.displayName=_1)}}),m},pQ.isValidElement=A,pQ.lazy=function(M){M={_status:-1,_result:M};var m={$$typeof:c,_payload:M,_init:N},n={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return M._ioInfo=n,m._debugInfo=[{awaited:n}],m},pQ.memo=function(M,m){M==null&&console.error("memo: The first argument must be a component. Instead received: %s",M===null?"null":typeof M),m={$$typeof:d,type:M,compare:m===void 0?null:m};var n;return Object.defineProperty(m,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(_1){n=_1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:_1}),M.displayName=_1)}}),m},pQ.startTransition=function(M){var m=q1.T,n={};n._updatedFibers=new Set,q1.T=n;try{var _1=M(),U1=q1.S;U1!==null&&U1(n,_1),typeof _1==="object"&&_1!==null&&typeof _1.then==="function"&&(q1.asyncTransitions++,_1.then(E,E),_1.then(Z,K0))}catch(W1){K0(W1)}finally{m===null&&n._updatedFibers&&(M=n._updatedFibers.size,n._updatedFibers.clear(),10<M&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),m!==null&&n.types!==null&&(m.types!==null&&m.types!==n.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),m.types=n.types),q1.T=m}},pQ.unstable_useCacheRefresh=function(){return v().useCacheRefresh()},pQ.use=function(M){return v().use(M)},pQ.useActionState=function(M,m,n){return v().useActionState(M,m,n)},pQ.useCallback=function(M,m){return v().useCallback(M,m)},pQ.useContext=function(M){var m=v();return M.$$typeof===p&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),m.useContext(M)},pQ.useDebugValue=function(M,m){return v().useDebugValue(M,m)},pQ.useDeferredValue=function(M,m){return v().useDeferredValue(M,m)},pQ.useEffect=function(M,m){return M==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),v().useEffect(M,m)},pQ.useEffectEvent=function(M){return v().useEffectEvent(M)},pQ.useId=function(){return v().useId()},pQ.useImperativeHandle=function(M,m,n){return v().useImperativeHandle(M,m,n)},pQ.useInsertionEffect=function(M,m){return M==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),v().useInsertionEffect(M,m)},pQ.useLayoutEffect=function(M,m){return M==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),v().useLayoutEffect(M,m)},pQ.useMemo=function(M,m){return v().useMemo(M,m)},pQ.useOptimistic=function(M,m){return v().useOptimistic(M,m)},pQ.useReducer=function(M,m,n){return v().useReducer(M,m,n)},pQ.useRef=function(M){return v().useRef(M)},pQ.useState=function(M){return v().useState(M)},pQ.useSyncExternalStore=function(M,m,n){return v().useSyncExternalStore(M,m,n)},pQ.useTransition=function(){return v().useTransition()},pQ.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var G8=i0((cQ)=>{var d0=h1(X0());(function(){function _(f){if(f==null)return null;if(typeof f==="function")return f.$$typeof===v?null:f.displayName||f.name||null;if(typeof f==="string")return f;switch(f){case O:return"Fragment";case B:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof f==="object")switch(typeof f.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case W:return"Portal";case A:return f.displayName||"Context";case w:return(f._context.displayName||"Context")+".Consumer";case R:var y=f.render;return f=f.displayName,f||(f=y.displayName||y.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case P:return y=f.displayName||null,y!==null?y:_(f.type)||"Memo";case k:y=f._payload,f=f._init;try{return _(f(y))}catch(p){}}return null}function Q(f){return""+f}function J(f){try{Q(f);var y=!1}catch(s){y=!0}if(y){y=console;var p=y.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return p.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(f)}}function q(f){if(f===O)return"<>";if(typeof f==="object"&&f!==null&&f.$$typeof===k)return"<...>";try{var y=_(f);return y?"<"+y+">":"<...>"}catch(p){return"<...>"}}function U(){var f=E.A;return f===null?null:f.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(f){if(g.call(f,"key")){var y=Object.getOwnPropertyDescriptor(f,"key").get;if(y&&y.isReactWarning)return!1}return f.key!==void 0}function F(f,y){function p(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}p.isReactWarning=!0,Object.defineProperty(f,"key",{get:p,configurable:!0})}function H(){var f=_(this.type);return j[f]||(j[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function Y(f,y,p,u,s,t){var a=p.ref;return f={$$typeof:z,type:f,key:y,props:p,_owner:u},(a!==void 0?a:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:H}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function X(f,y,p,u,s,t){var a=y.children;if(a!==void 0)if(u)if(h(a)){for(u=0;u<a.length;u++)K(a[u]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else K(a);if(g.call(y,"key")){a=_(f);var d=Object.keys(y).filter(function(e){return e!=="key"});u=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",D[a+u]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
13
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),M}function D(){$1.asyncTransitions--}function l(M){if(y0===null)try{var x=("require"+Math.random()).slice(0,7);y0=(u5&&u5[x]).call(u5,"timers").setImmediate}catch(Q1){y0=function(U1){T2===!1&&(T2=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var H1=new MessageChannel;H1.port1.onmessage=U1,H1.port2.postMessage(void 0)}}return y0(M)}function p(M){return 1<M.length&&typeof AggregateError==="function"?AggregateError(M):M[0]}function k(M,x){x!==R2-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),R2=x}function b(M,x,Q1){var U1=$1.actQueue;if(U1!==null)if(U1.length!==0)try{j(U1),l(function(){return b(M,x,Q1)});return}catch(H1){$1.thrownErrors.push(H1)}else $1.actQueue=null;0<$1.thrownErrors.length?(U1=p($1.thrownErrors),$1.thrownErrors.length=0,Q1(U1)):x(M)}function j(M){if(!r2){r2=!0;var x=0;try{for(;x<M.length;x++){var Q1=M[x];do{$1.didUsePromise=!1;var U1=Q1(!1);if(U1!==null){if($1.didUsePromise){M[x]=Q1,M.splice(0,x);return}Q1=U1}else break}while(1)}M.length=0}catch(H1){M.splice(0,x+1),$1.thrownErrors.push(H1)}finally{r2=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var E=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),u=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),e=Symbol.for("react.suspense"),t=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),J1=Symbol.for("react.activity"),G1=Symbol.iterator,F1={},c={isMounted:function(){return!1},enqueueForceUpdate:function(M){J(M,"forceUpdate")},enqueueReplaceState:function(M){J(M,"replaceState")},enqueueSetState:function(M){J(M,"setState")}},s=Object.assign,_1={};Object.freeze(_1),q.prototype.isReactComponent={},q.prototype.setState=function(M,x){if(typeof M!=="object"&&typeof M!=="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,x,"setState")},q.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};var q1={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(d0 in q1)q1.hasOwnProperty(d0)&&_(d0,q1[d0]);U.prototype=q.prototype,q1=G.prototype=new U,q1.constructor=G,s(q1,q.prototype),q1.isPureReactComponent=!0;var o=Array.isArray,K1=Symbol.for("react.client.reference"),$1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},M1=Object.prototype.hasOwnProperty,R1=console.createTask?console.createTask:function(){return null};q1={react_stack_bottom_frame:function(M){return M()}};var x1,U0,k1={},R0=q1.react_stack_bottom_frame.bind(q1,L)(),t1=R1(K(L)),e1=!1,_0=/\/+/g,X0=typeof reportError==="function"?reportError:function(M){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var x=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M==="object"&&M!==null&&typeof M.message==="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(x))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",M);return}console.error(M)},T2=!1,y0=null,R2=0,O2=!1,r2=!1,V5=typeof queueMicrotask==="function"?function(M){queueMicrotask(function(){return queueMicrotask(M)})}:l;q1=Object.freeze({__proto__:null,c:function(M){return y().useMemoCache(M)}});var d0={map:S,forEach:function(M,x,Q1){S(M,function(){x.apply(this,arguments)},Q1)},count:function(M){var x=0;return S(M,function(){x++}),x},toArray:function(M){return S(M,function(x){return x})||[]},only:function(M){if(!A(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};iQ.Activity=J1,iQ.Children=d0,iQ.Component=q,iQ.Fragment=h,iQ.Profiler=v,iQ.PureComponent=G,iQ.StrictMode=I,iQ.Suspense=e,iQ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$1,iQ.__COMPILER_RUNTIME=q1,iQ.act=function(M){var x=$1.actQueue,Q1=R2;R2++;var U1=$1.actQueue=x!==null?x:[],H1=!1;try{var W1=M()}catch(A1){$1.thrownErrors.push(A1)}if(0<$1.thrownErrors.length)throw k(x,Q1),M=p($1.thrownErrors),$1.thrownErrors.length=0,M;if(W1!==null&&typeof W1==="object"&&typeof W1.then==="function"){var z1=W1;return V5(function(){H1||O2||(O2=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(A1,Y0){H1=!0,z1.then(function(j0){if(k(x,Q1),Q1===0){try{j(U1),l(function(){return b(j0,A1,Y0)})}catch(b4){$1.thrownErrors.push(b4)}if(0<$1.thrownErrors.length){var u4=p($1.thrownErrors);$1.thrownErrors.length=0,Y0(u4)}}else A1(j0)},function(j0){k(x,Q1),0<$1.thrownErrors.length?(j0=p($1.thrownErrors),$1.thrownErrors.length=0,Y0(j0)):Y0(j0)})}}}var P1=W1;if(k(x,Q1),Q1===0&&(j(U1),U1.length!==0&&V5(function(){H1||O2||(O2=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),$1.actQueue=null),0<$1.thrownErrors.length)throw M=p($1.thrownErrors),$1.thrownErrors.length=0,M;return{then:function(A1,Y0){H1=!0,Q1===0?($1.actQueue=U1,l(function(){return b(P1,A1,Y0)})):A1(P1)}}},iQ.cache=function(M){return function(){return M.apply(null,arguments)}},iQ.cacheSignal=function(){return null},iQ.captureOwnerStack=function(){var M=$1.getCurrentStack;return M===null?null:M()},iQ.cloneElement=function(M,x,Q1){if(M===null||M===void 0)throw Error("The argument must be a React element, but you passed "+M+".");var U1=s({},M.props),H1=M.key,W1=M._owner;if(x!=null){var z1;_:{if(M1.call(x,"ref")&&(z1=Object.getOwnPropertyDescriptor(x,"ref").get)&&z1.isReactWarning){z1=!1;break _}z1=x.ref!==void 0}z1&&(W1=H()),z(x)&&(X(x.key),H1=""+x.key);for(P1 in x)!M1.call(x,P1)||P1==="key"||P1==="__self"||P1==="__source"||P1==="ref"&&x.ref===void 0||(U1[P1]=x[P1])}var P1=arguments.length-2;if(P1===1)U1.children=Q1;else if(1<P1){z1=Array(P1);for(var A1=0;A1<P1;A1++)z1[A1]=arguments[A1+2];U1.children=z1}U1=R(M.type,H1,U1,W1,M._debugStack,M._debugTask);for(H1=2;H1<arguments.length;H1++)P(arguments[H1]);return U1},iQ.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:m,_context:M},M._currentRenderer=null,M._currentRenderer2=null,M},iQ.createElement=function(M,x,Q1){for(var U1=2;U1<arguments.length;U1++)P(arguments[U1]);U1={};var H1=null;if(x!=null)for(A1 in U0||!("__self"in x)||"key"in x||(U0=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),z(x)&&(X(x.key),H1=""+x.key),x)M1.call(x,A1)&&A1!=="key"&&A1!=="__self"&&A1!=="__source"&&(U1[A1]=x[A1]);var W1=arguments.length-2;if(W1===1)U1.children=Q1;else if(1<W1){for(var z1=Array(W1),P1=0;P1<W1;P1++)z1[P1]=arguments[P1+2];Object.freeze&&Object.freeze(z1),U1.children=z1}if(M&&M.defaultProps)for(A1 in W1=M.defaultProps,W1)U1[A1]===void 0&&(U1[A1]=W1[A1]);H1&&W(U1,typeof M==="function"?M.displayName||M.name||"Unknown":M);var A1=1e4>$1.recentlyCreatedOwnerStacks++;return R(M,H1,U1,H(),A1?Error("react-stack-top-frame"):R0,A1?R1(K(M)):t1)},iQ.createRef=function(){var M={current:null};return Object.seal(M),M},iQ.forwardRef=function(M){M!=null&&M.$$typeof===a?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof M!=="function"?console.error("forwardRef requires a render function but was given %s.",M===null?"null":typeof M):M.length!==0&&M.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",M.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),M!=null&&M.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var x={$$typeof:n,render:M},Q1;return Object.defineProperty(x,"displayName",{enumerable:!1,configurable:!0,get:function(){return Q1},set:function(U1){Q1=U1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:U1}),M.displayName=U1)}}),x},iQ.isValidElement=A,iQ.lazy=function(M){M={_status:-1,_result:M};var x={$$typeof:g,_payload:M,_init:N},Q1={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return M._ioInfo=Q1,x._debugInfo=[{awaited:Q1}],x},iQ.memo=function(M,x){M==null&&console.error("memo: The first argument must be a component. Instead received: %s",M===null?"null":typeof M),x={$$typeof:a,type:M,compare:x===void 0?null:x};var Q1;return Object.defineProperty(x,"displayName",{enumerable:!1,configurable:!0,get:function(){return Q1},set:function(U1){Q1=U1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:U1}),M.displayName=U1)}}),x},iQ.startTransition=function(M){var x=$1.T,Q1={};Q1._updatedFibers=new Set,$1.T=Q1;try{var U1=M(),H1=$1.S;H1!==null&&H1(Q1,U1),typeof U1==="object"&&U1!==null&&typeof U1.then==="function"&&($1.asyncTransitions++,U1.then(D,D),U1.then(Z,X0))}catch(W1){X0(W1)}finally{x===null&&Q1._updatedFibers&&(M=Q1._updatedFibers.size,Q1._updatedFibers.clear(),10<M&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),x!==null&&Q1.types!==null&&(x.types!==null&&x.types!==Q1.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),x.types=Q1.types),$1.T=x}},iQ.unstable_useCacheRefresh=function(){return y().useCacheRefresh()},iQ.use=function(M){return y().use(M)},iQ.useActionState=function(M,x,Q1){return y().useActionState(M,x,Q1)},iQ.useCallback=function(M,x){return y().useCallback(M,x)},iQ.useContext=function(M){var x=y();return M.$$typeof===m&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),x.useContext(M)},iQ.useDebugValue=function(M,x){return y().useDebugValue(M,x)},iQ.useDeferredValue=function(M,x){return y().useDeferredValue(M,x)},iQ.useEffect=function(M,x){return M==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),y().useEffect(M,x)},iQ.useEffectEvent=function(M){return y().useEffectEvent(M)},iQ.useId=function(){return y().useId()},iQ.useImperativeHandle=function(M,x,Q1){return y().useImperativeHandle(M,x,Q1)},iQ.useInsertionEffect=function(M,x){return M==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),y().useInsertionEffect(M,x)},iQ.useLayoutEffect=function(M,x){return M==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),y().useLayoutEffect(M,x)},iQ.useMemo=function(M,x){return y().useMemo(M,x)},iQ.useOptimistic=function(M,x){return y().useOptimistic(M,x)},iQ.useReducer=function(M,x,Q1){return y().useReducer(M,x,Q1)},iQ.useRef=function(M){return y().useRef(M)},iQ.useState=function(M){return y().useState(M)},iQ.useSyncExternalStore=function(M,x,Q1){return y().useSyncExternalStore(M,x,Q1)},iQ.useTransition=function(){return y().useTransition()},iQ.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var X8=a0((dQ)=>{var s0=g1(L0());(function(){function _(I){if(I==null)return null;if(typeof I==="function")return I.$$typeof===y?null:I.displayName||I.name||null;if(typeof I==="string")return I;switch(I){case O:return"Fragment";case B:return"Profiler";case R:return"StrictMode";case f:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof I==="object")switch(typeof I.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case W:return"Portal";case A:return I.displayName||"Context";case P:return(I._context.displayName||"Context")+".Consumer";case T:var v=I.render;return I=I.displayName,I||(I=v.displayName||v.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case w:return v=I.displayName||null,v!==null?v:_(I.type)||"Memo";case S:v=I._payload,I=I._init;try{return _(I(v))}catch(m){}}return null}function Q(I){return""+I}function J(I){try{Q(I);var v=!1}catch(n){v=!0}if(v){v=console;var m=v.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return m.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(I)}}function q(I){if(I===O)return"<>";if(typeof I==="object"&&I!==null&&I.$$typeof===S)return"<...>";try{var v=_(I);return v?"<"+v+">":"<...>"}catch(m){return"<...>"}}function U(){var I=D.A;return I===null?null:I.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(I){if(l.call(I,"key")){var v=Object.getOwnPropertyDescriptor(I,"key").get;if(v&&v.isReactWarning)return!1}return I.key!==void 0}function F(I,v){function m(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}m.isReactWarning=!0,Object.defineProperty(I,"key",{get:m,configurable:!0})}function X(){var I=_(this.type);return j[I]||(j[I]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),I=this.props.ref,I!==void 0?I:null}function Y(I,v,m,u,n,e){var t=m.ref;return I={$$typeof:z,type:I,key:v,props:m,_owner:u},(t!==void 0?t:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:X}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:n}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:e}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function K(I,v,m,u,n,e){var t=v.children;if(t!==void 0)if(u)if(p(t)){for(u=0;u<t.length;u++)H(t[u]);Object.freeze&&Object.freeze(t)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else H(t);if(l.call(v,"key")){t=_(I);var a=Object.keys(v).filter(function(J1){return J1!=="key"});u=0<a.length?"{key: someKey, "+a.join(": ..., ")+": ...}":"{key: someKey}",h[t+u]||(a=0<a.length?"{"+a.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
14
14
|
let props = %s;
|
|
15
15
|
<%s {...props} />
|
|
16
16
|
React keys must be passed directly to JSX without using spread:
|
|
17
17
|
let props = %s;
|
|
18
|
-
<%s key={someKey} {...props} />`,u,a,
|
|
18
|
+
<%s key={someKey} {...props} />`,u,t,a,t),h[t+u]=!0)}if(t=null,m!==void 0&&(J(m),t=""+m),Z(v)&&(J(v.key),t=""+v.key),"key"in v){m={};for(var g in v)g!=="key"&&(m[g]=v[g])}else m=v;return t&&F(m,typeof I==="function"?I.displayName||I.name||"Unknown":I),Y(I,t,m,U(),n,e)}function H(I){L(I)?I._store&&(I._store.validated=1):typeof I==="object"&&I!==null&&I.$$typeof===S&&(I._payload.status==="fulfilled"?L(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function L(I){return typeof I==="object"&&I!==null&&I.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),A=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),y=Symbol.for("react.client.reference"),D=s0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,l=Object.prototype.hasOwnProperty,p=Array.isArray,k=console.createTask?console.createTask:function(){return null};s0={react_stack_bottom_frame:function(I){return I()}};var b,j={},E=s0.react_stack_bottom_frame.bind(s0,G)(),V=k(q(G)),h={};dQ.Fragment=O,dQ.jsx=function(I,v,m){var u=1e4>D.recentlyCreatedOwnerStacks++;return K(I,v,m,!1,u?Error("react-stack-top-frame"):E,u?k(q(I)):V)},dQ.jsxs=function(I,v,m){var u=1e4>D.recentlyCreatedOwnerStacks++;return K(I,v,m,!0,u?Error("react-stack-top-frame"):E,u?k(q(I)):V)}})()});var p7=a0((pq)=>{var o1=g1(L0());(function(){function _(L,z){return L===z&&(L!==0||1/L===1/z)||L!==L&&z!==z}function Q(L,z){Y||o1.startTransition===void 0||(Y=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var W=z();if(!K){var O=z();U(W,O)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),K=!0)}O=G({inst:{value:W,getSnapshot:z}});var R=O[0].inst,B=O[1];return F(function(){R.value=W,R.getSnapshot=z,J(R)&&B({inst:R})},[L,W,z]),Z(function(){return J(R)&&B({inst:R}),L(function(){J(R)&&B({inst:R})})},[L]),X(W),W}function J(L){var z=L.getSnapshot;L=L.value;try{var W=z();return!U(L,W)}catch(O){return!0}}function q(L,z){return z()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=typeof Object.is==="function"?Object.is:_,G=o1.useState,Z=o1.useEffect,F=o1.useLayoutEffect,X=o1.useDebugValue,Y=!1,K=!1,H=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?q:Q;pq.useSyncExternalStore=o1.useSyncExternalStore!==void 0?o1.useSyncExternalStore:H,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var c7=a0((cq)=>{var N0=g1(L0());(function(){function _(X,Y){return X===Y&&(X!==0||1/X===1/Y)||X!==X&&Y!==Y}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Q=p7(),J=typeof Object.is==="function"?Object.is:_,q=Q.useSyncExternalStore,U=N0.useRef,G=N0.useEffect,Z=N0.useMemo,F=N0.useDebugValue;cq.useSyncExternalStoreWithSelector=function(X,Y,K,H,L){var z=U(null);if(z.current===null){var W={hasValue:!1,value:null};z.current=W}else W=z.current;z=Z(function(){function R(f){if(!B){if(B=!0,P=f,f=H(f),L!==void 0&&W.hasValue){var C=W.value;if(L(C,f))return A=C}return A=f}if(C=A,J(P,f))return C;var w=H(f);if(L!==void 0&&L(C,w))return P=f,C;return P=f,A=w}var B=!1,P,A,T=K===void 0?null:K;return[function(){return R(Y())},T===null?void 0:function(){return R(T())}]},[Y,K,H,L]);var O=q(X,z[0],z[1]);return G(function(){W.hasValue=!0,W.value=O},[O]),F(O),O},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var t7=a0((dq)=>{var V6=g1(L0());(function(){function _(){}function Q(K){return""+K}function J(K,H,L){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Q(z);var W=!1}catch(O){W=!0}return W&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&z[Symbol.toStringTag]||z.constructor.name||"Object"),Q(z)),{$$typeof:X,key:z==null?null:""+z,children:K,containerInfo:H,implementation:L}}function q(K,H){if(K==="font")return"";if(typeof H==="string")return H==="use-credentials"?H:""}function U(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":'something with type "'+typeof K+'"'}function G(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":typeof K==="string"?JSON.stringify(K):typeof K==="number"?"`"+K+"`":'something with type "'+typeof K+'"'}function Z(){var K=Y.H;return K===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
19
19
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
20
20
|
2. You might be breaking the Rules of Hooks
|
|
21
21
|
3. You might have more than one copy of React in the same app
|
|
22
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),X}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var F={d:{f:_,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:_,C:_,L:_,m:_,X:_,S:_,M:_},p:0,findDOMNode:null},H=Symbol.for("react.portal"),Y=k6.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),cq.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,cq.createPortal=function(X,K){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!K||K.nodeType!==1&&K.nodeType!==9&&K.nodeType!==11)throw Error("Target container is not a DOM element.");return J(X,K,null,L)},cq.flushSync=function(X){var K=Y.T,L=F.p;try{if(Y.T=null,F.p=2,X)return X()}finally{Y.T=K,F.p=L,F.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},cq.preconnect=function(X,K){typeof X==="string"&&X?K!=null&&typeof K!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",G(K)):K!=null&&typeof K.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",U(K.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(X)),typeof X==="string"&&(K?(K=K.crossOrigin,K=typeof K==="string"?K==="use-credentials"?K:"":void 0):K=null,F.d.C(X,K))},cq.prefetchDNS=function(X){if(typeof X!=="string"||!X)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(X));else if(1<arguments.length){var K=arguments[1];typeof K==="object"&&K.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",G(K)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",G(K))}typeof X==="string"&&F.d.D(X)},cq.preinit=function(X,K){if(typeof X==="string"&&X?K==null||typeof K!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",G(K)):K.as!=="style"&&K.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',G(K.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(X)),typeof X==="string"&&K&&typeof K.as==="string"){var L=K.as,z=q(L,K.crossOrigin),W=typeof K.integrity==="string"?K.integrity:void 0,O=typeof K.fetchPriority==="string"?K.fetchPriority:void 0;L==="style"?F.d.S(X,typeof K.precedence==="string"?K.precedence:void 0,{crossOrigin:z,integrity:W,fetchPriority:O}):L==="script"&&F.d.X(X,{crossOrigin:z,integrity:W,fetchPriority:O,nonce:typeof K.nonce==="string"?K.nonce:void 0})}},cq.preinitModule=function(X,K){var L="";if(typeof X==="string"&&X||(L+=" The `href` argument encountered was "+U(X)+"."),K!==void 0&&typeof K!=="object"?L+=" The `options` argument encountered was "+U(K)+".":K&&("as"in K)&&K.as!=="script"&&(L+=" The `as` option encountered was "+G(K.as)+"."),L)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",L);else switch(L=K&&typeof K.as==="string"?K.as:"script",L){case"script":break;default:L=G(L),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',L,X)}if(typeof X==="string")if(typeof K==="object"&&K!==null){if(K.as==null||K.as==="script")L=q(K.as,K.crossOrigin),F.d.M(X,{crossOrigin:L,integrity:typeof K.integrity==="string"?K.integrity:void 0,nonce:typeof K.nonce==="string"?K.nonce:void 0})}else K==null&&F.d.M(X)},cq.preload=function(X,K){var L="";if(typeof X==="string"&&X||(L+=" The `href` argument encountered was "+U(X)+"."),K==null||typeof K!=="object"?L+=" The `options` argument encountered was "+U(K)+".":typeof K.as==="string"&&K.as||(L+=" The `as` option encountered was "+U(K.as)+"."),L&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',L),typeof X==="string"&&typeof K==="object"&&K!==null&&typeof K.as==="string"){L=K.as;var z=q(L,K.crossOrigin);F.d.L(X,L,{crossOrigin:z,integrity:typeof K.integrity==="string"?K.integrity:void 0,nonce:typeof K.nonce==="string"?K.nonce:void 0,type:typeof K.type==="string"?K.type:void 0,fetchPriority:typeof K.fetchPriority==="string"?K.fetchPriority:void 0,referrerPolicy:typeof K.referrerPolicy==="string"?K.referrerPolicy:void 0,imageSrcSet:typeof K.imageSrcSet==="string"?K.imageSrcSet:void 0,imageSizes:typeof K.imageSizes==="string"?K.imageSizes:void 0,media:typeof K.media==="string"?K.media:void 0})}},cq.preloadModule=function(X,K){var L="";typeof X==="string"&&X||(L+=" The `href` argument encountered was "+U(X)+"."),K!==void 0&&typeof K!=="object"?L+=" The `options` argument encountered was "+U(K)+".":K&&("as"in K)&&typeof K.as!=="string"&&(L+=" The `as` option encountered was "+U(K.as)+"."),L&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',L),typeof X==="string"&&(K?(L=q(K.as,K.crossOrigin),F.d.m(X,{as:typeof K.as==="string"&&K.as!=="script"?K.as:void 0,crossOrigin:L,integrity:typeof K.integrity==="string"?K.integrity:void 0})):F.d.m(X))},cq.requestFormReset=function(X){F.d.r(X)},cq.unstable_batchedUpdates=function(X,K){return X(K)},cq.useFormState=function(X,K,L){return Z().useFormState(X,K,L)},cq.useFormStatus=function(){return Z().useHostTransitionStatus()},cq.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var d7=i0((KB,i7)=>{var lq=h1(r7());i7.exports=lq});var O5=i0((XZ)=>{var H2=h1(X0());(function(){function _(f){if(f==null)return null;if(typeof f==="function")return f.$$typeof===v?null:f.displayName||f.name||null;if(typeof f==="string")return f;switch(f){case O:return"Fragment";case B:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof f==="object")switch(typeof f.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case W:return"Portal";case A:return f.displayName||"Context";case w:return(f._context.displayName||"Context")+".Consumer";case R:var y=f.render;return f=f.displayName,f||(f=y.displayName||y.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case P:return y=f.displayName||null,y!==null?y:_(f.type)||"Memo";case k:y=f._payload,f=f._init;try{return _(f(y))}catch(p){}}return null}function Q(f){return""+f}function J(f){try{Q(f);var y=!1}catch(s){y=!0}if(y){y=console;var p=y.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return p.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(f)}}function q(f){if(f===O)return"<>";if(typeof f==="object"&&f!==null&&f.$$typeof===k)return"<...>";try{var y=_(f);return y?"<"+y+">":"<...>"}catch(p){return"<...>"}}function U(){var f=E.A;return f===null?null:f.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(f){if(g.call(f,"key")){var y=Object.getOwnPropertyDescriptor(f,"key").get;if(y&&y.isReactWarning)return!1}return f.key!==void 0}function F(f,y){function p(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}p.isReactWarning=!0,Object.defineProperty(f,"key",{get:p,configurable:!0})}function H(){var f=_(this.type);return j[f]||(j[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function Y(f,y,p,u,s,t){var a=p.ref;return f={$$typeof:z,type:f,key:y,props:p,_owner:u},(a!==void 0?a:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:H}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function X(f,y,p,u,s,t){var a=y.children;if(a!==void 0)if(u)if(h(a)){for(u=0;u<a.length;u++)K(a[u]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else K(a);if(g.call(y,"key")){a=_(f);var d=Object.keys(y).filter(function(e){return e!=="key"});u=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",D[a+u]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
22
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),K}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var F={d:{f:_,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:_,C:_,L:_,m:_,X:_,S:_,M:_},p:0,findDOMNode:null},X=Symbol.for("react.portal"),Y=V6.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),dq.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,dq.createPortal=function(K,H){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!H||H.nodeType!==1&&H.nodeType!==9&&H.nodeType!==11)throw Error("Target container is not a DOM element.");return J(K,H,null,L)},dq.flushSync=function(K){var H=Y.T,L=F.p;try{if(Y.T=null,F.p=2,K)return K()}finally{Y.T=H,F.p=L,F.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},dq.preconnect=function(K,H){typeof K==="string"&&K?H!=null&&typeof H!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",G(H)):H!=null&&typeof H.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",U(H.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&(H?(H=H.crossOrigin,H=typeof H==="string"?H==="use-credentials"?H:"":void 0):H=null,F.d.C(K,H))},dq.prefetchDNS=function(K){if(typeof K!=="string"||!K)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K));else if(1<arguments.length){var H=arguments[1];typeof H==="object"&&H.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",G(H)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",G(H))}typeof K==="string"&&F.d.D(K)},dq.preinit=function(K,H){if(typeof K==="string"&&K?H==null||typeof H!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",G(H)):H.as!=="style"&&H.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',G(H.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&H&&typeof H.as==="string"){var L=H.as,z=q(L,H.crossOrigin),W=typeof H.integrity==="string"?H.integrity:void 0,O=typeof H.fetchPriority==="string"?H.fetchPriority:void 0;L==="style"?F.d.S(K,typeof H.precedence==="string"?H.precedence:void 0,{crossOrigin:z,integrity:W,fetchPriority:O}):L==="script"&&F.d.X(K,{crossOrigin:z,integrity:W,fetchPriority:O,nonce:typeof H.nonce==="string"?H.nonce:void 0})}},dq.preinitModule=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&H.as!=="script"&&(L+=" The `as` option encountered was "+G(H.as)+"."),L)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",L);else switch(L=H&&typeof H.as==="string"?H.as:"script",L){case"script":break;default:L=G(L),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',L,K)}if(typeof K==="string")if(typeof H==="object"&&H!==null){if(H.as==null||H.as==="script")L=q(H.as,H.crossOrigin),F.d.M(K,{crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0})}else H==null&&F.d.M(K)},dq.preload=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H==null||typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":typeof H.as==="string"&&H.as||(L+=" The `as` option encountered was "+U(H.as)+"."),L&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',L),typeof K==="string"&&typeof H==="object"&&H!==null&&typeof H.as==="string"){L=H.as;var z=q(L,H.crossOrigin);F.d.L(K,L,{crossOrigin:z,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0,type:typeof H.type==="string"?H.type:void 0,fetchPriority:typeof H.fetchPriority==="string"?H.fetchPriority:void 0,referrerPolicy:typeof H.referrerPolicy==="string"?H.referrerPolicy:void 0,imageSrcSet:typeof H.imageSrcSet==="string"?H.imageSrcSet:void 0,imageSizes:typeof H.imageSizes==="string"?H.imageSizes:void 0,media:typeof H.media==="string"?H.media:void 0})}},dq.preloadModule=function(K,H){var L="";typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&typeof H.as!=="string"&&(L+=" The `as` option encountered was "+U(H.as)+"."),L&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',L),typeof K==="string"&&(H?(L=q(H.as,H.crossOrigin),F.d.m(K,{as:typeof H.as==="string"&&H.as!=="script"?H.as:void 0,crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0})):F.d.m(K))},dq.requestFormReset=function(K){F.d.r(K)},dq.unstable_batchedUpdates=function(K,H){return K(H)},dq.useFormState=function(K,H,L){return Z().useFormState(K,H,L)},dq.useFormStatus=function(){return Z().useHostTransitionStatus()},dq.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var n7=a0((BB,o7)=>{var aq=g1(t7());o7.exports=aq});var P5=a0((WZ)=>{var Y2=g1(L0());(function(){function _(I){if(I==null)return null;if(typeof I==="function")return I.$$typeof===y?null:I.displayName||I.name||null;if(typeof I==="string")return I;switch(I){case O:return"Fragment";case B:return"Profiler";case R:return"StrictMode";case f:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof I==="object")switch(typeof I.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case W:return"Portal";case A:return I.displayName||"Context";case P:return(I._context.displayName||"Context")+".Consumer";case T:var v=I.render;return I=I.displayName,I||(I=v.displayName||v.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case w:return v=I.displayName||null,v!==null?v:_(I.type)||"Memo";case S:v=I._payload,I=I._init;try{return _(I(v))}catch(m){}}return null}function Q(I){return""+I}function J(I){try{Q(I);var v=!1}catch(n){v=!0}if(v){v=console;var m=v.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return m.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(I)}}function q(I){if(I===O)return"<>";if(typeof I==="object"&&I!==null&&I.$$typeof===S)return"<...>";try{var v=_(I);return v?"<"+v+">":"<...>"}catch(m){return"<...>"}}function U(){var I=D.A;return I===null?null:I.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(I){if(l.call(I,"key")){var v=Object.getOwnPropertyDescriptor(I,"key").get;if(v&&v.isReactWarning)return!1}return I.key!==void 0}function F(I,v){function m(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}m.isReactWarning=!0,Object.defineProperty(I,"key",{get:m,configurable:!0})}function X(){var I=_(this.type);return j[I]||(j[I]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),I=this.props.ref,I!==void 0?I:null}function Y(I,v,m,u,n,e){var t=m.ref;return I={$$typeof:z,type:I,key:v,props:m,_owner:u},(t!==void 0?t:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:X}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:n}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:e}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function K(I,v,m,u,n,e){var t=v.children;if(t!==void 0)if(u)if(p(t)){for(u=0;u<t.length;u++)H(t[u]);Object.freeze&&Object.freeze(t)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else H(t);if(l.call(v,"key")){t=_(I);var a=Object.keys(v).filter(function(J1){return J1!=="key"});u=0<a.length?"{key: someKey, "+a.join(": ..., ")+": ...}":"{key: someKey}",h[t+u]||(a=0<a.length?"{"+a.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
23
|
let props = %s;
|
|
24
24
|
<%s {...props} />
|
|
25
25
|
React keys must be passed directly to JSX without using spread:
|
|
26
26
|
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,u,a,d,a),D[a+u]=!0)}if(a=null,p!==void 0&&(J(p),a=""+p),Z(y)&&(J(y.key),a=""+y.key),"key"in y){p={};for(var c in y)c!=="key"&&(p[c]=y[c])}else p=y;return a&&F(p,typeof f==="function"?f.displayName||f.name||"Unknown":f),Y(f,a,p,U(),s,t)}function K(f){L(f)?f._store&&(f._store.validated=1):typeof f==="object"&&f!==null&&f.$$typeof===k&&(f._payload.status==="fulfilled"?L(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function L(f){return typeof f==="object"&&f!==null&&f.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),v=Symbol.for("react.client.reference"),E=H2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,g=Object.prototype.hasOwnProperty,h=Array.isArray,S=console.createTask?console.createTask:function(){return null};H2={react_stack_bottom_frame:function(f){return f()}};var b,j={},x=H2.react_stack_bottom_frame.bind(H2,G)(),V=S(q(G)),D={};XZ.Fragment=O,XZ.jsxDEV=function(f,y,p,u){var s=1e4>E.recentlyCreatedOwnerStacks++;return X(f,y,p,u,s?Error("react-stack-top-frame"):x,s?S(q(f)):V)}})()});var i=h1(X0(),1);var l=h1(G8(),1),r=h1(X0(),1);function C1(_){if(typeof _==="string"||typeof _==="number")return""+_;let Q="";if(Array.isArray(_)){for(let J=0,q;J<_.length;J++)if((q=C1(_[J]))!=="")Q+=(Q&&" ")+q}else for(let J in _)if(_[J])Q+=(Q&&" ")+J;return Q}var lQ={value:()=>{}};function F8(){for(var _=0,Q=arguments.length,J={},q;_<Q;++_){if(!(q=arguments[_]+"")||q in J||/[\s.]/.test(q))throw Error("illegal type: "+q);J[q]=[]}return new y5(J)}function y5(_){this._=_}function rQ(_,Q){return _.trim().split(/^|\s+/).map(function(J){var q="",U=J.indexOf(".");if(U>=0)q=J.slice(U+1),J=J.slice(0,U);if(J&&!Q.hasOwnProperty(J))throw Error("unknown type: "+J);return{type:J,name:q}})}y5.prototype=F8.prototype={constructor:y5,on:function(_,Q){var J=this._,q=rQ(_+"",J),U,G=-1,Z=q.length;if(arguments.length<2){while(++G<Z)if((U=(_=q[G]).type)&&(U=iQ(J[U],_.name)))return U;return}if(Q!=null&&typeof Q!=="function")throw Error("invalid callback: "+Q);while(++G<Z)if(U=(_=q[G]).type)J[U]=Z8(J[U],_.name,Q);else if(Q==null)for(U in J)J[U]=Z8(J[U],_.name,null);return this},copy:function(){var _={},Q=this._;for(var J in Q)_[J]=Q[J].slice();return new y5(_)},call:function(_,Q){if((U=arguments.length-2)>0)for(var J=Array(U),q=0,U,G;q<U;++q)J[q]=arguments[q+2];if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(G=this._[_],q=0,U=G.length;q<U;++q)G[q].value.apply(Q,J)},apply:function(_,Q,J){if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(var q=this._[_],U=0,G=q.length;U<G;++U)q[U].value.apply(Q,J)}};function iQ(_,Q){for(var J=0,q=_.length,U;J<q;++J)if((U=_[J]).name===Q)return U.value}function Z8(_,Q,J){for(var q=0,U=_.length;q<U;++q)if(_[q].name===Q){_[q]=lQ,_=_.slice(0,q).concat(_.slice(q+1));break}if(J!=null)_.push({name:Q,value:J});return _}var a0=F8;function R2(_){return function(){return this.matches(_)}}function v5(_){return function(Q){return Q.matches(_)}}var j5="http://www.w3.org/1999/xhtml",V4={svg:"http://www.w3.org/2000/svg",xhtml:j5,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Y0(_){var Q=_+="",J=Q.indexOf(":");if(J>=0&&(Q=_.slice(0,J))!=="xmlns")_=_.slice(J+1);return V4.hasOwnProperty(Q)?{space:V4[Q],local:_}:_}function u4(_){let Q;while(Q=_.sourceEvent)_=Q;return _}function x1(_,Q){if(_=u4(_),Q===void 0)Q=_.currentTarget;if(Q){var J=Q.ownerSVGElement||Q;if(J.createSVGPoint){var q=J.createSVGPoint();return q.x=_.clientX,q.y=_.clientY,q=q.matrixTransform(Q.getScreenCTM().inverse()),[q.x,q.y]}if(Q.getBoundingClientRect){var U=Q.getBoundingClientRect();return[_.clientX-U.left-Q.clientLeft,_.clientY-U.top-Q.clientTop]}}return[_.pageX,_.pageY]}function dQ(){}function j0(_){return _==null?dQ:function(){return this.querySelector(_)}}function b4(_){if(typeof _!=="function")_=j0(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=Array(Z),H,Y,X=0;X<Z;++X)if((H=G[X])&&(Y=_.call(H,H.__data__,X,G))){if("__data__"in H)Y.__data__=H.__data__;F[X]=Y}return new S1(q,this._parents)}function D4(_){return _==null?[]:Array.isArray(_)?_:Array.from(_)}function aQ(){return[]}function O2(_){return _==null?aQ:function(){return this.querySelectorAll(_)}}function sQ(_){return function(){return D4(_.apply(this,arguments))}}function h4(_){if(typeof _==="function")_=sQ(_);else _=O2(_);for(var Q=this._groups,J=Q.length,q=[],U=[],G=0;G<J;++G)for(var Z=Q[G],F=Z.length,H,Y=0;Y<F;++Y)if(H=Z[Y])q.push(_.call(H,H.__data__,Y,Z)),U.push(H);return new S1(q,U)}var tQ=Array.prototype.find;function oQ(_){return function(){return tQ.call(this.children,_)}}function nQ(){return this.firstElementChild}function E4(_){return this.select(_==null?nQ:oQ(typeof _==="function"?_:v5(_)))}var eQ=Array.prototype.filter;function _J(){return Array.from(this.children)}function QJ(_){return function(){return eQ.call(this.children,_)}}function x4(_){return this.selectAll(_==null?_J:QJ(typeof _==="function"?_:v5(_)))}function m4(_){if(typeof _!=="function")_=R2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],H,Y=0;Y<Z;++Y)if((H=G[Y])&&_.call(H,H.__data__,Y,G))F.push(H);return new S1(q,this._parents)}function p2(_){return Array(_.length)}function g4(){return new S1(this._enter||this._groups.map(p2),this._parents)}function c2(_,Q){this.ownerDocument=_.ownerDocument,this.namespaceURI=_.namespaceURI,this._next=null,this._parent=_,this.__data__=Q}c2.prototype={constructor:c2,appendChild:function(_){return this._parent.insertBefore(_,this._next)},insertBefore:function(_,Q){return this._parent.insertBefore(_,Q)},querySelector:function(_){return this._parent.querySelector(_)},querySelectorAll:function(_){return this._parent.querySelectorAll(_)}};function p4(_){return function(){return _}}function JJ(_,Q,J,q,U,G){var Z=0,F,H=Q.length,Y=G.length;for(;Z<Y;++Z)if(F=Q[Z])F.__data__=G[Z],q[Z]=F;else J[Z]=new c2(_,G[Z]);for(;Z<H;++Z)if(F=Q[Z])U[Z]=F}function $J(_,Q,J,q,U,G,Z){var F,H,Y=new Map,X=Q.length,K=G.length,L=Array(X),z;for(F=0;F<X;++F)if(H=Q[F])if(L[F]=z=Z.call(H,H.__data__,F,Q)+"",Y.has(z))U[F]=H;else Y.set(z,H);for(F=0;F<K;++F)if(z=Z.call(_,G[F],F,G)+"",H=Y.get(z))q[F]=H,H.__data__=G[F],Y.delete(z);else J[F]=new c2(_,G[F]);for(F=0;F<X;++F)if((H=Q[F])&&Y.get(L[F])===H)U[F]=H}function qJ(_){return _.__data__}function c4(_,Q){if(!arguments.length)return Array.from(this,qJ);var J=Q?$J:JJ,q=this._parents,U=this._groups;if(typeof _!=="function")_=p4(_);for(var G=U.length,Z=Array(G),F=Array(G),H=Array(G),Y=0;Y<G;++Y){var X=q[Y],K=U[Y],L=K.length,z=UJ(_.call(X,X&&X.__data__,Y,q)),W=z.length,O=F[Y]=Array(W),T=Z[Y]=Array(W),B=H[Y]=Array(L);J(X,K,O,T,B,z,Q);for(var w=0,A=0,R,I;w<W;++w)if(R=O[w]){if(w>=A)A=w+1;while(!(I=T[A])&&++A<W);R._next=I||null}}return Z=new S1(Z,q),Z._enter=F,Z._exit=H,Z}function UJ(_){return typeof _==="object"&&"length"in _?_:Array.from(_)}function l4(){return new S1(this._exit||this._groups.map(p2),this._parents)}function r4(_,Q,J){var q=this.enter(),U=this,G=this.exit();if(typeof _==="function"){if(q=_(q),q)q=q.selection()}else q=q.append(_+"");if(Q!=null){if(U=Q(U),U)U=U.selection()}if(J==null)G.remove();else J(G);return q&&U?q.merge(U).order():U}function i4(_){var Q=_.selection?_.selection():_;for(var J=this._groups,q=Q._groups,U=J.length,G=q.length,Z=Math.min(U,G),F=Array(U),H=0;H<Z;++H)for(var Y=J[H],X=q[H],K=Y.length,L=F[H]=Array(K),z,W=0;W<K;++W)if(z=Y[W]||X[W])L[W]=z;for(;H<U;++H)F[H]=J[H];return new S1(F,this._parents)}function d4(){for(var _=this._groups,Q=-1,J=_.length;++Q<J;)for(var q=_[Q],U=q.length-1,G=q[U],Z;--U>=0;)if(Z=q[U]){if(G&&Z.compareDocumentPosition(G)^4)G.parentNode.insertBefore(Z,G);G=Z}return this}function a4(_){if(!_)_=GJ;function Q(K,L){return K&&L?_(K.__data__,L.__data__):!K-!L}for(var J=this._groups,q=J.length,U=Array(q),G=0;G<q;++G){for(var Z=J[G],F=Z.length,H=U[G]=Array(F),Y,X=0;X<F;++X)if(Y=Z[X])H[X]=Y;H.sort(Q)}return new S1(U,this._parents).order()}function GJ(_,Q){return _<Q?-1:_>Q?1:_>=Q?0:NaN}function s4(){var _=arguments[0];return arguments[0]=this,_.apply(null,arguments),this}function t4(){return Array.from(this)}function o4(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length;U<G;++U){var Z=q[U];if(Z)return Z}return null}function n4(){let _=0;for(let Q of this)++_;return _}function e4(){return!this.node()}function _3(_){for(var Q=this._groups,J=0,q=Q.length;J<q;++J)for(var U=Q[J],G=0,Z=U.length,F;G<Z;++G)if(F=U[G])_.call(F,F.__data__,G,U);return this}function ZJ(_){return function(){this.removeAttribute(_)}}function FJ(_){return function(){this.removeAttributeNS(_.space,_.local)}}function KJ(_,Q){return function(){this.setAttribute(_,Q)}}function HJ(_,Q){return function(){this.setAttributeNS(_.space,_.local,Q)}}function XJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttribute(_);else this.setAttribute(_,J)}}function YJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttributeNS(_.space,_.local);else this.setAttributeNS(_.space,_.local,J)}}function Q3(_,Q){var J=Y0(_);if(arguments.length<2){var q=this.node();return J.local?q.getAttributeNS(J.space,J.local):q.getAttribute(J)}return this.each((Q==null?J.local?FJ:ZJ:typeof Q==="function"?J.local?YJ:XJ:J.local?HJ:KJ)(J,Q))}function l2(_){return _.ownerDocument&&_.ownerDocument.defaultView||_.document&&_||_.defaultView}function LJ(_){return function(){this.style.removeProperty(_)}}function zJ(_,Q,J){return function(){this.style.setProperty(_,Q,J)}}function WJ(_,Q,J){return function(){var q=Q.apply(this,arguments);if(q==null)this.style.removeProperty(_);else this.style.setProperty(_,q,J)}}function J3(_,Q,J){return arguments.length>1?this.each((Q==null?LJ:typeof Q==="function"?WJ:zJ)(_,Q,J==null?"":J)):V0(this.node(),_)}function V0(_,Q){return _.style.getPropertyValue(Q)||l2(_).getComputedStyle(_,null).getPropertyValue(Q)}function AJ(_){return function(){delete this[_]}}function BJ(_,Q){return function(){this[_]=Q}}function MJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)delete this[_];else this[_]=J}}function $3(_,Q){return arguments.length>1?this.each((Q==null?AJ:typeof Q==="function"?MJ:BJ)(_,Q)):this.node()[_]}function K8(_){return _.trim().split(/^|\s+/)}function q3(_){return _.classList||new H8(_)}function H8(_){this._node=_,this._names=K8(_.getAttribute("class")||"")}H8.prototype={add:function(_){var Q=this._names.indexOf(_);if(Q<0)this._names.push(_),this._node.setAttribute("class",this._names.join(" "))},remove:function(_){var Q=this._names.indexOf(_);if(Q>=0)this._names.splice(Q,1),this._node.setAttribute("class",this._names.join(" "))},contains:function(_){return this._names.indexOf(_)>=0}};function X8(_,Q){var J=q3(_),q=-1,U=Q.length;while(++q<U)J.add(Q[q])}function Y8(_,Q){var J=q3(_),q=-1,U=Q.length;while(++q<U)J.remove(Q[q])}function TJ(_){return function(){X8(this,_)}}function RJ(_){return function(){Y8(this,_)}}function OJ(_,Q){return function(){(Q.apply(this,arguments)?X8:Y8)(this,_)}}function U3(_,Q){var J=K8(_+"");if(arguments.length<2){var q=q3(this.node()),U=-1,G=J.length;while(++U<G)if(!q.contains(J[U]))return!1;return!0}return this.each((typeof Q==="function"?OJ:Q?TJ:RJ)(J,Q))}function fJ(){this.textContent=""}function IJ(_){return function(){this.textContent=_}}function wJ(_){return function(){var Q=_.apply(this,arguments);this.textContent=Q==null?"":Q}}function G3(_){return arguments.length?this.each(_==null?fJ:(typeof _==="function"?wJ:IJ)(_)):this.node().textContent}function PJ(){this.innerHTML=""}function NJ(_){return function(){this.innerHTML=_}}function CJ(_){return function(){var Q=_.apply(this,arguments);this.innerHTML=Q==null?"":Q}}function Z3(_){return arguments.length?this.each(_==null?PJ:(typeof _==="function"?CJ:NJ)(_)):this.node().innerHTML}function SJ(){if(this.nextSibling)this.parentNode.appendChild(this)}function F3(){return this.each(SJ)}function kJ(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function K3(){return this.each(kJ)}function yJ(_){return function(){var Q=this.ownerDocument,J=this.namespaceURI;return J===j5&&Q.documentElement.namespaceURI===j5?Q.createElement(_):Q.createElementNS(J,_)}}function vJ(_){return function(){return this.ownerDocument.createElementNS(_.space,_.local)}}function r2(_){var Q=Y0(_);return(Q.local?vJ:yJ)(Q)}function H3(_){var Q=typeof _==="function"?_:r2(_);return this.select(function(){return this.appendChild(Q.apply(this,arguments))})}function jJ(){return null}function X3(_,Q){var J=typeof _==="function"?_:r2(_),q=Q==null?jJ:typeof Q==="function"?Q:j0(Q);return this.select(function(){return this.insertBefore(J.apply(this,arguments),q.apply(this,arguments)||null)})}function VJ(){var _=this.parentNode;if(_)_.removeChild(this)}function Y3(){return this.each(VJ)}function uJ(){var _=this.cloneNode(!1),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function bJ(){var _=this.cloneNode(!0),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function L3(_){return this.select(_?bJ:uJ)}function z3(_){return arguments.length?this.property("__data__",_):this.node().__data__}function DJ(_){return function(Q){_.call(this,Q,this.__data__)}}function hJ(_){return _.trim().split(/^|\s+/).map(function(Q){var J="",q=Q.indexOf(".");if(q>=0)J=Q.slice(q+1),Q=Q.slice(0,q);return{type:Q,name:J}})}function EJ(_){return function(){var Q=this.__on;if(!Q)return;for(var J=0,q=-1,U=Q.length,G;J<U;++J)if(G=Q[J],(!_.type||G.type===_.type)&&G.name===_.name)this.removeEventListener(G.type,G.listener,G.options);else Q[++q]=G;if(++q)Q.length=q;else delete this.__on}}function xJ(_,Q,J){return function(){var q=this.__on,U,G=DJ(Q);if(q){for(var Z=0,F=q.length;Z<F;++Z)if((U=q[Z]).type===_.type&&U.name===_.name){this.removeEventListener(U.type,U.listener,U.options),this.addEventListener(U.type,U.listener=G,U.options=J),U.value=Q;return}}if(this.addEventListener(_.type,G,J),U={type:_.type,name:_.name,value:Q,listener:G,options:J},!q)this.__on=[U];else q.push(U)}}function W3(_,Q,J){var q=hJ(_+""),U,G=q.length,Z;if(arguments.length<2){var F=this.node().__on;if(F){for(var H=0,Y=F.length,X;H<Y;++H)for(U=0,X=F[H];U<G;++U)if((Z=q[U]).type===X.type&&Z.name===X.name)return X.value}return}F=Q?xJ:EJ;for(U=0;U<G;++U)this.each(F(q[U],Q,J));return this}function L8(_,Q,J){var q=l2(_),U=q.CustomEvent;if(typeof U==="function")U=new U(Q,J);else if(U=q.document.createEvent("Event"),J)U.initEvent(Q,J.bubbles,J.cancelable),U.detail=J.detail;else U.initEvent(Q,!1,!1);_.dispatchEvent(U)}function mJ(_,Q){return function(){return L8(this,_,Q)}}function gJ(_,Q){return function(){return L8(this,_,Q.apply(this,arguments))}}function A3(_,Q){return this.each((typeof Q==="function"?gJ:mJ)(_,Q))}function*B3(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length,Z;U<G;++U)if(Z=q[U])yield Z}var M3=[null];function S1(_,Q){this._groups=_,this._parents=Q}function z8(){return new S1([[document.documentElement]],M3)}function pJ(){return this}S1.prototype=z8.prototype={constructor:S1,select:b4,selectAll:h4,selectChild:E4,selectChildren:x4,filter:m4,data:c4,enter:g4,exit:l4,join:r4,merge:i4,selection:pJ,order:d4,sort:a4,call:s4,nodes:t4,node:o4,size:n4,empty:e4,each:_3,attr:Q3,style:J3,property:$3,classed:U3,text:G3,html:Z3,raise:F3,lower:K3,append:H3,insert:X3,remove:Y3,clone:L3,datum:z3,on:W3,dispatch:A3,[Symbol.iterator]:B3};var T0=z8;function j1(_){return typeof _==="string"?new S1([[document.querySelector(_)]],[document.documentElement]):new S1([[_]],M3)}var W8={passive:!1},s0={capture:!0,passive:!1};function V5(_){_.stopImmediatePropagation()}function R0(_){_.preventDefault(),_.stopImmediatePropagation()}function f2(_){var Q=_.document.documentElement,J=j1(_).on("dragstart.drag",R0,s0);if("onselectstart"in Q)J.on("selectstart.drag",R0,s0);else Q.__noselect=Q.style.MozUserSelect,Q.style.MozUserSelect="none"}function i2(_,Q){var J=_.document.documentElement,q=j1(_).on("dragstart.drag",null);if(Q)q.on("click.drag",R0,s0),setTimeout(function(){q.on("click.drag",null)},0);if("onselectstart"in J)q.on("selectstart.drag",null);else J.style.MozUserSelect=J.__noselect,delete J.__noselect}var d2=(_)=>()=>_;function a2(_,{sourceEvent:Q,subject:J,target:q,identifier:U,active:G,x:Z,y:F,dx:H,dy:Y,dispatch:X}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},subject:{value:J,enumerable:!0,configurable:!0},target:{value:q,enumerable:!0,configurable:!0},identifier:{value:U,enumerable:!0,configurable:!0},active:{value:G,enumerable:!0,configurable:!0},x:{value:Z,enumerable:!0,configurable:!0},y:{value:F,enumerable:!0,configurable:!0},dx:{value:H,enumerable:!0,configurable:!0},dy:{value:Y,enumerable:!0,configurable:!0},_:{value:X}})}a2.prototype.on=function(){var _=this._.on.apply(this._,arguments);return _===this._?this:_};function cJ(_){return!_.ctrlKey&&!_.button}function lJ(){return this.parentNode}function rJ(_,Q){return Q==null?{x:_.x,y:_.y}:Q}function iJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function s2(){var _=cJ,Q=lJ,J=rJ,q=iJ,U={},G=a0("start","drag","end"),Z=0,F,H,Y,X,K=0;function L(R){R.on("mousedown.drag",z).filter(q).on("touchstart.drag",T).on("touchmove.drag",B,W8).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function z(R,I){if(X||!_.call(this,R,I))return;var C=A(this,Q.call(this,R,I),R,I,"mouse");if(!C)return;j1(R.view).on("mousemove.drag",W,s0).on("mouseup.drag",O,s0),f2(R.view),V5(R),Y=!1,F=R.clientX,H=R.clientY,C("start",R)}function W(R){if(R0(R),!Y){var I=R.clientX-F,C=R.clientY-H;Y=I*I+C*C>K}U.mouse("drag",R)}function O(R){j1(R.view).on("mousemove.drag mouseup.drag",null),i2(R.view,Y),R0(R),U.mouse("end",R)}function T(R,I){if(!_.call(this,R,I))return;var C=R.changedTouches,P=Q.call(this,R,I),k=C.length,N,v;for(N=0;N<k;++N)if(v=A(this,P,R,I,C[N].identifier,C[N]))V5(R),v("start",R,C[N])}function B(R){var I=R.changedTouches,C=I.length,P,k;for(P=0;P<C;++P)if(k=U[I[P].identifier])R0(R),k("drag",R,I[P])}function w(R){var I=R.changedTouches,C=I.length,P,k;if(X)clearTimeout(X);X=setTimeout(function(){X=null},500);for(P=0;P<C;++P)if(k=U[I[P].identifier])V5(R),k("end",R,I[P])}function A(R,I,C,P,k,N){var v=G.copy(),E=x1(N||C,I),g,h,S;if((S=J.call(R,new a2("beforestart",{sourceEvent:C,target:L,identifier:k,active:Z,x:E[0],y:E[1],dx:0,dy:0,dispatch:v}),P))==null)return;return g=S.x-E[0]||0,h=S.y-E[1]||0,function b(j,x,V){var D=E,f;switch(j){case"start":U[k]=b,f=Z++;break;case"end":delete U[k],--Z;case"drag":E=x1(V||x,I),f=Z;break}v.call(j,R,new a2(j,{sourceEvent:x,subject:S,target:L,identifier:k,active:f,x:E[0]+g,y:E[1]+h,dx:E[0]-D[0],dy:E[1]-D[1],dispatch:v}),P)}}return L.filter=function(R){return arguments.length?(_=typeof R==="function"?R:d2(!!R),L):_},L.container=function(R){return arguments.length?(Q=typeof R==="function"?R:d2(R),L):Q},L.subject=function(R){return arguments.length?(J=typeof R==="function"?R:d2(R),L):J},L.touchable=function(R){return arguments.length?(q=typeof R==="function"?R:d2(!!R),L):q},L.on=function(){var R=G.on.apply(G,arguments);return R===G?L:R},L.clickDistance=function(R){return arguments.length?(K=(R=+R)*R,L):Math.sqrt(K)},L}function t2(_,Q,J){_.prototype=Q.prototype=J,J.constructor=_}function T3(_,Q){var J=Object.create(_.prototype);for(var q in Q)J[q]=Q[q];return J}function e2(){}var o2=0.7,D5=1/o2,I2="\\s*([+-]?\\d+)\\s*",n2="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",L0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dJ=/^#([0-9a-f]{3,8})$/,aJ=new RegExp(`^rgb\\(${I2},${I2},${I2}\\)$`),sJ=new RegExp(`^rgb\\(${L0},${L0},${L0}\\)$`),tJ=new RegExp(`^rgba\\(${I2},${I2},${I2},${n2}\\)$`),oJ=new RegExp(`^rgba\\(${L0},${L0},${L0},${n2}\\)$`),nJ=new RegExp(`^hsl\\(${n2},${L0},${L0}\\)$`),eJ=new RegExp(`^hsla\\(${n2},${L0},${L0},${n2}\\)$`),A8={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};t2(e2,q0,{copy(_){return Object.assign(new this.constructor,this,_)},displayable(){return this.rgb().displayable()},hex:B8,formatHex:B8,formatHex8:_$,formatHsl:Q$,formatRgb:M8,toString:M8});function B8(){return this.rgb().formatHex()}function _$(){return this.rgb().formatHex8()}function Q$(){return w8(this).formatHsl()}function M8(){return this.rgb().formatRgb()}function q0(_){var Q,J;return _=(_+"").trim().toLowerCase(),(Q=dJ.exec(_))?(J=Q[1].length,Q=parseInt(Q[1],16),J===6?T8(Q):J===3?new d1(Q>>8&15|Q>>4&240,Q>>4&15|Q&240,(Q&15)<<4|Q&15,1):J===8?u5(Q>>24&255,Q>>16&255,Q>>8&255,(Q&255)/255):J===4?u5(Q>>12&15|Q>>8&240,Q>>8&15|Q>>4&240,Q>>4&15|Q&240,((Q&15)<<4|Q&15)/255):null):(Q=aJ.exec(_))?new d1(Q[1],Q[2],Q[3],1):(Q=sJ.exec(_))?new d1(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,1):(Q=tJ.exec(_))?u5(Q[1],Q[2],Q[3],Q[4]):(Q=oJ.exec(_))?u5(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,Q[4]):(Q=nJ.exec(_))?f8(Q[1],Q[2]/100,Q[3]/100,1):(Q=eJ.exec(_))?f8(Q[1],Q[2]/100,Q[3]/100,Q[4]):A8.hasOwnProperty(_)?T8(A8[_]):_==="transparent"?new d1(NaN,NaN,NaN,0):null}function T8(_){return new d1(_>>16&255,_>>8&255,_&255,1)}function u5(_,Q,J,q){if(q<=0)_=Q=J=NaN;return new d1(_,Q,J,q)}function J$(_){if(!(_ instanceof e2))_=q0(_);if(!_)return new d1;return _=_.rgb(),new d1(_.r,_.g,_.b,_.opacity)}function w2(_,Q,J,q){return arguments.length===1?J$(_):new d1(_,Q,J,q==null?1:q)}function d1(_,Q,J,q){this.r=+_,this.g=+Q,this.b=+J,this.opacity=+q}t2(d1,w2,T3(e2,{brighter(_){return _=_==null?D5:Math.pow(D5,_),new d1(this.r*_,this.g*_,this.b*_,this.opacity)},darker(_){return _=_==null?o2:Math.pow(o2,_),new d1(this.r*_,this.g*_,this.b*_,this.opacity)},rgb(){return this},clamp(){return new d1(o0(this.r),o0(this.g),o0(this.b),h5(this.opacity))},displayable(){return-0.5<=this.r&&this.r<255.5&&(-0.5<=this.g&&this.g<255.5)&&(-0.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:R8,formatHex:R8,formatHex8:$$,formatRgb:O8,toString:O8}));function R8(){return`#${t0(this.r)}${t0(this.g)}${t0(this.b)}`}function $$(){return`#${t0(this.r)}${t0(this.g)}${t0(this.b)}${t0((isNaN(this.opacity)?1:this.opacity)*255)}`}function O8(){let _=h5(this.opacity);return`${_===1?"rgb(":"rgba("}${o0(this.r)}, ${o0(this.g)}, ${o0(this.b)}${_===1?")":`, ${_})`}`}function h5(_){return isNaN(_)?1:Math.max(0,Math.min(1,_))}function o0(_){return Math.max(0,Math.min(255,Math.round(_)||0))}function t0(_){return _=o0(_),(_<16?"0":"")+_.toString(16)}function f8(_,Q,J,q){if(q<=0)_=Q=J=NaN;else if(J<=0||J>=1)_=Q=NaN;else if(Q<=0)_=NaN;return new $0(_,Q,J,q)}function w8(_){if(_ instanceof $0)return new $0(_.h,_.s,_.l,_.opacity);if(!(_ instanceof e2))_=q0(_);if(!_)return new $0;if(_ instanceof $0)return _;_=_.rgb();var Q=_.r/255,J=_.g/255,q=_.b/255,U=Math.min(Q,J,q),G=Math.max(Q,J,q),Z=NaN,F=G-U,H=(G+U)/2;if(F){if(Q===G)Z=(J-q)/F+(J<q)*6;else if(J===G)Z=(q-Q)/F+2;else Z=(Q-J)/F+4;F/=H<0.5?G+U:2-G-U,Z*=60}else F=H>0&&H<1?0:Z;return new $0(Z,F,H,_.opacity)}function P8(_,Q,J,q){return arguments.length===1?w8(_):new $0(_,Q,J,q==null?1:q)}function $0(_,Q,J,q){this.h=+_,this.s=+Q,this.l=+J,this.opacity=+q}t2($0,P8,T3(e2,{brighter(_){return _=_==null?D5:Math.pow(D5,_),new $0(this.h,this.s,this.l*_,this.opacity)},darker(_){return _=_==null?o2:Math.pow(o2,_),new $0(this.h,this.s,this.l*_,this.opacity)},rgb(){var _=this.h%360+(this.h<0)*360,Q=isNaN(_)||isNaN(this.s)?0:this.s,J=this.l,q=J+(J<0.5?J:1-J)*Q,U=2*J-q;return new d1(R3(_>=240?_-240:_+120,U,q),R3(_,U,q),R3(_<120?_+240:_-120,U,q),this.opacity)},clamp(){return new $0(I8(this.h),b5(this.s),b5(this.l),h5(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(){let _=h5(this.opacity);return`${_===1?"hsl(":"hsla("}${I8(this.h)}, ${b5(this.s)*100}%, ${b5(this.l)*100}%${_===1?")":`, ${_})`}`}}));function I8(_){return _=(_||0)%360,_<0?_+360:_}function b5(_){return Math.max(0,Math.min(1,_||0))}function R3(_,Q,J){return(_<60?Q+(J-Q)*_/60:_<180?J:_<240?Q+(J-Q)*(240-_)/60:Q)*255}function O3(_,Q,J,q,U){var G=_*_,Z=G*_;return((1-3*_+3*G-Z)*Q+(4-6*G+3*Z)*J+(1+3*_+3*G-3*Z)*q+Z*U)/6}function f3(_){var Q=_.length-1;return function(J){var q=J<=0?J=0:J>=1?(J=1,Q-1):Math.floor(J*Q),U=_[q],G=_[q+1],Z=q>0?_[q-1]:2*U-G,F=q<Q-1?_[q+2]:2*G-U;return O3((J-q/Q)*Q,Z,U,G,F)}}function I3(_){var Q=_.length;return function(J){var q=Math.floor(((J%=1)<0?++J:J)*Q),U=_[(q+Q-1)%Q],G=_[q%Q],Z=_[(q+1)%Q],F=_[(q+2)%Q];return O3((J-q/Q)*Q,U,G,Z,F)}}var _5=(_)=>()=>_;function q$(_,Q){return function(J){return _+J*Q}}function U$(_,Q,J){return _=Math.pow(_,J),Q=Math.pow(Q,J)-_,J=1/J,function(q){return Math.pow(_+q*Q,J)}}function N8(_){return(_=+_)===1?E5:function(Q,J){return J-Q?U$(Q,J,_):_5(isNaN(Q)?J:Q)}}function E5(_,Q){var J=Q-_;return J?q$(_,J):_5(isNaN(_)?Q:_)}var n0=function _(Q){var J=N8(Q);function q(U,G){var Z=J((U=w2(U)).r,(G=w2(G)).r),F=J(U.g,G.g),H=J(U.b,G.b),Y=E5(U.opacity,G.opacity);return function(X){return U.r=Z(X),U.g=F(X),U.b=H(X),U.opacity=Y(X),U+""}}return q.gamma=_,q}(1);function C8(_){return function(Q){var J=Q.length,q=Array(J),U=Array(J),G=Array(J),Z,F;for(Z=0;Z<J;++Z)F=w2(Q[Z]),q[Z]=F.r||0,U[Z]=F.g||0,G[Z]=F.b||0;return q=_(q),U=_(U),G=_(G),F.opacity=1,function(H){return F.r=q(H),F.g=U(H),F.b=G(H),F+""}}}var G$=C8(f3),Z$=C8(I3);function w3(_,Q){if(!Q)Q=[];var J=_?Math.min(Q.length,_.length):0,q=Q.slice(),U;return function(G){for(U=0;U<J;++U)q[U]=_[U]*(1-G)+Q[U]*G;return q}}function S8(_){return ArrayBuffer.isView(_)&&!(_ instanceof DataView)}function k8(_,Q){var J=Q?Q.length:0,q=_?Math.min(J,_.length):0,U=Array(q),G=Array(J),Z;for(Z=0;Z<q;++Z)U[Z]=z0(_[Z],Q[Z]);for(;Z<J;++Z)G[Z]=Q[Z];return function(F){for(Z=0;Z<q;++Z)G[Z]=U[Z](F);return G}}function P3(_,Q){var J=new Date;return _=+_,Q=+Q,function(q){return J.setTime(_*(1-q)+Q*q),J}}function m1(_,Q){return _=+_,Q=+Q,function(J){return _*(1-J)+Q*J}}function N3(_,Q){var J={},q={},U;if(_===null||typeof _!=="object")_={};if(Q===null||typeof Q!=="object")Q={};for(U in Q)if(U in _)J[U]=z0(_[U],Q[U]);else q[U]=Q[U];return function(G){for(U in J)q[U]=J[U](G);return q}}var S3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,C3=new RegExp(S3.source,"g");function F$(_){return function(){return _}}function K$(_){return function(Q){return _(Q)+""}}function P2(_,Q){var J=S3.lastIndex=C3.lastIndex=0,q,U,G,Z=-1,F=[],H=[];_=_+"",Q=Q+"";while((q=S3.exec(_))&&(U=C3.exec(Q))){if((G=U.index)>J)if(G=Q.slice(J,G),F[Z])F[Z]+=G;else F[++Z]=G;if((q=q[0])===(U=U[0]))if(F[Z])F[Z]+=U;else F[++Z]=U;else F[++Z]=null,H.push({i:Z,x:m1(q,U)});J=C3.lastIndex}if(J<Q.length)if(G=Q.slice(J),F[Z])F[Z]+=G;else F[++Z]=G;return F.length<2?H[0]?K$(H[0].x):F$(Q):(Q=H.length,function(Y){for(var X=0,K;X<Q;++X)F[(K=H[X]).i]=K.x(Y);return F.join("")})}function z0(_,Q){var J=typeof Q,q;return Q==null||J==="boolean"?_5(Q):(J==="number"?m1:J==="string"?(q=q0(Q))?(Q=q,n0):P2:Q instanceof q0?n0:Q instanceof Date?P3:S8(Q)?w3:Array.isArray(Q)?k8:typeof Q.valueOf!=="function"&&typeof Q.toString!=="function"||isNaN(Q)?N3:m1)(_,Q)}var y8=180/Math.PI,x5={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function m5(_,Q,J,q,U,G){var Z,F,H;if(Z=Math.sqrt(_*_+Q*Q))_/=Z,Q/=Z;if(H=_*J+Q*q)J-=_*H,q-=Q*H;if(F=Math.sqrt(J*J+q*q))J/=F,q/=F,H/=F;if(_*q<Q*J)_=-_,Q=-Q,H=-H,Z=-Z;return{translateX:U,translateY:G,rotate:Math.atan2(Q,_)*y8,skewX:Math.atan(H)*y8,scaleX:Z,scaleY:F}}var g5;function v8(_){let Q=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(_+"");return Q.isIdentity?x5:m5(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function j8(_){if(_==null)return x5;if(!g5)g5=document.createElementNS("http://www.w3.org/2000/svg","g");if(g5.setAttribute("transform",_),!(_=g5.transform.baseVal.consolidate()))return x5;return _=_.matrix,m5(_.a,_.b,_.c,_.d,_.e,_.f)}function V8(_,Q,J,q){function U(Y){return Y.length?Y.pop()+" ":""}function G(Y,X,K,L,z,W){if(Y!==K||X!==L){var O=z.push("translate(",null,Q,null,J);W.push({i:O-4,x:m1(Y,K)},{i:O-2,x:m1(X,L)})}else if(K||L)z.push("translate("+K+Q+L+J)}function Z(Y,X,K,L){if(Y!==X){if(Y-X>180)X+=360;else if(X-Y>180)Y+=360;L.push({i:K.push(U(K)+"rotate(",null,q)-2,x:m1(Y,X)})}else if(X)K.push(U(K)+"rotate("+X+q)}function F(Y,X,K,L){if(Y!==X)L.push({i:K.push(U(K)+"skewX(",null,q)-2,x:m1(Y,X)});else if(X)K.push(U(K)+"skewX("+X+q)}function H(Y,X,K,L,z,W){if(Y!==K||X!==L){var O=z.push(U(z)+"scale(",null,",",null,")");W.push({i:O-4,x:m1(Y,K)},{i:O-2,x:m1(X,L)})}else if(K!==1||L!==1)z.push(U(z)+"scale("+K+","+L+")")}return function(Y,X){var K=[],L=[];return Y=_(Y),X=_(X),G(Y.translateX,Y.translateY,X.translateX,X.translateY,K,L),Z(Y.rotate,X.rotate,K,L),F(Y.skewX,X.skewX,K,L),H(Y.scaleX,Y.scaleY,X.scaleX,X.scaleY,K,L),Y=X=null,function(z){var W=-1,O=L.length,T;while(++W<O)K[(T=L[W]).i]=T.x(z);return K.join("")}}}var k3=V8(v8,"px, ","px)","deg)"),y3=V8(j8,", ",")",")");var H$=0.000000000001;function u8(_){return((_=Math.exp(_))+1/_)/2}function X$(_){return((_=Math.exp(_))-1/_)/2}function Y$(_){return((_=Math.exp(2*_))-1)/(_+1)}var e0=function _(Q,J,q){function U(G,Z){var F=G[0],H=G[1],Y=G[2],X=Z[0],K=Z[1],L=Z[2],z=X-F,W=K-H,O=z*z+W*W,T,B;if(O<H$)B=Math.log(L/Y)/Q,T=function(P){return[F+P*z,H+P*W,Y*Math.exp(Q*P*B)]};else{var w=Math.sqrt(O),A=(L*L-Y*Y+q*O)/(2*Y*J*w),R=(L*L-Y*Y-q*O)/(2*L*J*w),I=Math.log(Math.sqrt(A*A+1)-A),C=Math.log(Math.sqrt(R*R+1)-R);B=(C-I)/Q,T=function(P){var k=P*B,N=u8(I),v=Y/(J*w)*(N*Y$(Q*k+I)-X$(I));return[F+v*z,H+v*W,Y*N/u8(Q*k+I)]}}return T.duration=B*1000*Q/Math.SQRT2,T}return U.rho=function(G){var Z=Math.max(0.001,+G),F=Z*Z,H=F*F;return _(Z,F,H)},U}(Math.SQRT2,2,4);var N2=0,J5=0,Q5=0,D8=1000,p5,$5,c5=0,_2=0,l5=0,q5=typeof performance==="object"&&performance.now?performance:Date,h8=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_){setTimeout(_,17)};function G5(){return _2||(h8(L$),_2=q5.now()+l5)}function L$(){_2=0}function U5(){this._call=this._time=this._next=null}U5.prototype=r5.prototype={constructor:U5,restart:function(_,Q,J){if(typeof _!=="function")throw TypeError("callback is not a function");if(J=(J==null?G5():+J)+(Q==null?0:+Q),!this._next&&$5!==this){if($5)$5._next=this;else p5=this;$5=this}this._call=_,this._time=J,v3()},stop:function(){if(this._call)this._call=null,this._time=1/0,v3()}};function r5(_,Q,J){var q=new U5;return q.restart(_,Q,J),q}function E8(){G5(),++N2;var _=p5,Q;while(_){if((Q=_2-_._time)>=0)_._call.call(void 0,Q);_=_._next}--N2}function b8(){_2=(c5=q5.now())+l5,N2=J5=0;try{E8()}finally{N2=0,W$(),_2=0}}function z$(){var _=q5.now(),Q=_-c5;if(Q>D8)l5-=Q,c5=_}function W$(){var _,Q=p5,J,q=1/0;while(Q)if(Q._call){if(q>Q._time)q=Q._time;_=Q,Q=Q._next}else J=Q._next,Q._next=null,Q=_?_._next=J:p5=J;$5=_,v3(q)}function v3(_){if(N2)return;if(J5)J5=clearTimeout(J5);var Q=_-_2;if(Q>24){if(_<1/0)J5=setTimeout(b8,_-q5.now()-l5);if(Q5)Q5=clearInterval(Q5)}else{if(!Q5)c5=q5.now(),Q5=setInterval(z$,D8);N2=1,h8(b8)}}function Z5(_,Q,J){var q=new U5;return Q=Q==null?0:+Q,q.restart((U)=>{q.stop(),_(U+Q)},Q,J),q}var A$=a0("start","end","cancel","interrupt"),B$=[],g8=0,x8=1,d5=2,i5=3,m8=4,a5=5,F5=6;function O0(_,Q,J,q,U,G){var Z=_.__transition;if(!Z)_.__transition={};else if(J in Z)return;M$(_,J,{name:Q,index:q,group:U,on:A$,tween:B$,time:G.time,delay:G.delay,duration:G.duration,ease:G.ease,timer:null,state:g8})}function K5(_,Q){var J=V1(_,Q);if(J.state>g8)throw Error("too late; already scheduled");return J}function E1(_,Q){var J=V1(_,Q);if(J.state>i5)throw Error("too late; already running");return J}function V1(_,Q){var J=_.__transition;if(!J||!(J=J[Q]))throw Error("transition not found");return J}function M$(_,Q,J){var q=_.__transition,U;q[Q]=J,J.timer=r5(G,0,J.time);function G(Y){if(J.state=x8,J.timer.restart(Z,J.delay,J.time),J.delay<=Y)Z(Y-J.delay)}function Z(Y){var X,K,L,z;if(J.state!==x8)return H();for(X in q){if(z=q[X],z.name!==J.name)continue;if(z.state===i5)return Z5(Z);if(z.state===m8)z.state=F5,z.timer.stop(),z.on.call("interrupt",_,_.__data__,z.index,z.group),delete q[X];else if(+X<Q)z.state=F5,z.timer.stop(),z.on.call("cancel",_,_.__data__,z.index,z.group),delete q[X]}if(Z5(function(){if(J.state===i5)J.state=m8,J.timer.restart(F,J.delay,J.time),F(Y)}),J.state=d5,J.on.call("start",_,_.__data__,J.index,J.group),J.state!==d5)return;J.state=i5,U=Array(L=J.tween.length);for(X=0,K=-1;X<L;++X)if(z=J.tween[X].value.call(_,_.__data__,J.index,J.group))U[++K]=z;U.length=K+1}function F(Y){var X=Y<J.duration?J.ease.call(null,Y/J.duration):(J.timer.restart(H),J.state=a5,1),K=-1,L=U.length;while(++K<L)U[K].call(_,X);if(J.state===a5)J.on.call("end",_,_.__data__,J.index,J.group),H()}function H(){J.state=F5,J.timer.stop(),delete q[Q];for(var Y in q)return;delete _.__transition}}function u0(_,Q){var J=_.__transition,q,U,G=!0,Z;if(!J)return;Q=Q==null?null:Q+"";for(Z in J){if((q=J[Z]).name!==Q){G=!1;continue}U=q.state>d5&&q.state<a5,q.state=F5,q.timer.stop(),q.on.call(U?"interrupt":"cancel",_,_.__data__,q.index,q.group),delete J[Z]}if(G)delete _.__transition}function j3(_){return this.each(function(){u0(this,_)})}function T$(_,Q){var J,q;return function(){var U=E1(this,_),G=U.tween;if(G!==J){q=J=G;for(var Z=0,F=q.length;Z<F;++Z)if(q[Z].name===Q){q=q.slice(),q.splice(Z,1);break}}U.tween=q}}function R$(_,Q,J){var q,U;if(typeof J!=="function")throw Error();return function(){var G=E1(this,_),Z=G.tween;if(Z!==q){U=(q=Z).slice();for(var F={name:Q,value:J},H=0,Y=U.length;H<Y;++H)if(U[H].name===Q){U[H]=F;break}if(H===Y)U.push(F)}G.tween=U}}function V3(_,Q){var J=this._id;if(_+="",arguments.length<2){var q=V1(this.node(),J).tween;for(var U=0,G=q.length,Z;U<G;++U)if((Z=q[U]).name===_)return Z.value;return null}return this.each((Q==null?T$:R$)(J,_,Q))}function C2(_,Q,J){var q=_._id;return _.each(function(){var U=E1(this,q);(U.value||(U.value={}))[Q]=J.apply(this,arguments)}),function(U){return V1(U,q).value[Q]}}function H5(_,Q){var J;return(typeof Q==="number"?m1:Q instanceof q0?n0:(J=q0(Q))?(Q=J,n0):P2)(_,Q)}function O$(_){return function(){this.removeAttribute(_)}}function f$(_){return function(){this.removeAttributeNS(_.space,_.local)}}function I$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttribute(_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function w$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttributeNS(_.space,_.local);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function P$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),H;if(F==null)return void this.removeAttribute(_);return Z=this.getAttribute(_),H=F+"",Z===H?null:Z===q&&H===U?G:(U=H,G=Q(q=Z,F))}}function N$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),H;if(F==null)return void this.removeAttributeNS(_.space,_.local);return Z=this.getAttributeNS(_.space,_.local),H=F+"",Z===H?null:Z===q&&H===U?G:(U=H,G=Q(q=Z,F))}}function u3(_,Q){var J=Y0(_),q=J==="transform"?y3:H5;return this.attrTween(_,typeof Q==="function"?(J.local?N$:P$)(J,q,C2(this,"attr."+_,Q)):Q==null?(J.local?f$:O$)(J):(J.local?w$:I$)(J,q,Q))}function C$(_,Q){return function(J){this.setAttribute(_,Q.call(this,J))}}function S$(_,Q){return function(J){this.setAttributeNS(_.space,_.local,Q.call(this,J))}}function k$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&S$(_,G);return J}return U._value=Q,U}function y$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&C$(_,G);return J}return U._value=Q,U}function b3(_,Q){var J="attr."+_;if(arguments.length<2)return(J=this.tween(J))&&J._value;if(Q==null)return this.tween(J,null);if(typeof Q!=="function")throw Error();var q=Y0(_);return this.tween(J,(q.local?k$:y$)(q,Q))}function v$(_,Q){return function(){K5(this,_).delay=+Q.apply(this,arguments)}}function j$(_,Q){return Q=+Q,function(){K5(this,_).delay=Q}}function D3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?v$:j$)(Q,_)):V1(this.node(),Q).delay}function V$(_,Q){return function(){E1(this,_).duration=+Q.apply(this,arguments)}}function u$(_,Q){return Q=+Q,function(){E1(this,_).duration=Q}}function h3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?V$:u$)(Q,_)):V1(this.node(),Q).duration}function b$(_,Q){if(typeof Q!=="function")throw Error();return function(){E1(this,_).ease=Q}}function E3(_){var Q=this._id;return arguments.length?this.each(b$(Q,_)):V1(this.node(),Q).ease}function D$(_,Q){return function(){var J=Q.apply(this,arguments);if(typeof J!=="function")throw Error();E1(this,_).ease=J}}function x3(_){if(typeof _!=="function")throw Error();return this.each(D$(this._id,_))}function m3(_){if(typeof _!=="function")_=R2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],H,Y=0;Y<Z;++Y)if((H=G[Y])&&_.call(H,H.__data__,Y,G))F.push(H);return new r1(q,this._parents,this._name,this._id)}function g3(_){if(_._id!==this._id)throw Error();for(var Q=this._groups,J=_._groups,q=Q.length,U=J.length,G=Math.min(q,U),Z=Array(q),F=0;F<G;++F)for(var H=Q[F],Y=J[F],X=H.length,K=Z[F]=Array(X),L,z=0;z<X;++z)if(L=H[z]||Y[z])K[z]=L;for(;F<q;++F)Z[F]=Q[F];return new r1(Z,this._parents,this._name,this._id)}function h$(_){return(_+"").trim().split(/^|\s+/).every(function(Q){var J=Q.indexOf(".");if(J>=0)Q=Q.slice(0,J);return!Q||Q==="start"})}function E$(_,Q,J){var q,U,G=h$(Q)?K5:E1;return function(){var Z=G(this,_),F=Z.on;if(F!==q)(U=(q=F).copy()).on(Q,J);Z.on=U}}function p3(_,Q){var J=this._id;return arguments.length<2?V1(this.node(),J).on.on(_):this.each(E$(J,_,Q))}function x$(_){return function(){var Q=this.parentNode;for(var J in this.__transition)if(+J!==_)return;if(Q)Q.removeChild(this)}}function c3(){return this.on("end.remove",x$(this._id))}function l3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=j0(_);for(var q=this._groups,U=q.length,G=Array(U),Z=0;Z<U;++Z)for(var F=q[Z],H=F.length,Y=G[Z]=Array(H),X,K,L=0;L<H;++L)if((X=F[L])&&(K=_.call(X,X.__data__,L,F))){if("__data__"in X)K.__data__=X.__data__;Y[L]=K,O0(Y[L],Q,J,L,Y,V1(X,J))}return new r1(G,this._parents,Q,J)}function r3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=O2(_);for(var q=this._groups,U=q.length,G=[],Z=[],F=0;F<U;++F)for(var H=q[F],Y=H.length,X,K=0;K<Y;++K)if(X=H[K]){for(var L=_.call(X,X.__data__,K,H),z,W=V1(X,J),O=0,T=L.length;O<T;++O)if(z=L[O])O0(z,Q,J,O,L,W);G.push(L),Z.push(X)}return new r1(G,Z,Q,J)}var m$=T0.prototype.constructor;function i3(){return new m$(this._groups,this._parents)}function g$(_,Q){var J,q,U;return function(){var G=V0(this,_),Z=(this.style.removeProperty(_),V0(this,_));return G===Z?null:G===J&&Z===q?U:U=Q(J=G,q=Z)}}function p8(_){return function(){this.style.removeProperty(_)}}function p$(_,Q,J){var q,U=J+"",G;return function(){var Z=V0(this,_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function c$(_,Q,J){var q,U,G;return function(){var Z=V0(this,_),F=J(this),H=F+"";if(F==null)H=F=(this.style.removeProperty(_),V0(this,_));return Z===H?null:Z===q&&H===U?G:(U=H,G=Q(q=Z,F))}}function l$(_,Q){var J,q,U,G="style."+Q,Z="end."+G,F;return function(){var H=E1(this,_),Y=H.on,X=H.value[G]==null?F||(F=p8(Q)):void 0;if(Y!==J||U!==X)(q=(J=Y).copy()).on(Z,U=X);H.on=q}}function d3(_,Q,J){var q=(_+="")==="transform"?k3:H5;return Q==null?this.styleTween(_,g$(_,q)).on("end.style."+_,p8(_)):typeof Q==="function"?this.styleTween(_,c$(_,q,C2(this,"style."+_,Q))).each(l$(this._id,_)):this.styleTween(_,p$(_,q,Q),J).on("end.style."+_,null)}function r$(_,Q,J){return function(q){this.style.setProperty(_,Q.call(this,q),J)}}function i$(_,Q,J){var q,U;function G(){var Z=Q.apply(this,arguments);if(Z!==U)q=(U=Z)&&r$(_,Z,J);return q}return G._value=Q,G}function a3(_,Q,J){var q="style."+(_+="");if(arguments.length<2)return(q=this.tween(q))&&q._value;if(Q==null)return this.tween(q,null);if(typeof Q!=="function")throw Error();return this.tween(q,i$(_,Q,J==null?"":J))}function d$(_){return function(){this.textContent=_}}function a$(_){return function(){var Q=_(this);this.textContent=Q==null?"":Q}}function s3(_){return this.tween("text",typeof _==="function"?a$(C2(this,"text",_)):d$(_==null?"":_+""))}function s$(_){return function(Q){this.textContent=_.call(this,Q)}}function t$(_){var Q,J;function q(){var U=_.apply(this,arguments);if(U!==J)Q=(J=U)&&s$(U);return Q}return q._value=_,q}function t3(_){var Q="text";if(arguments.length<1)return(Q=this.tween(Q))&&Q._value;if(_==null)return this.tween(Q,null);if(typeof _!=="function")throw Error();return this.tween(Q,t$(_))}function o3(){var _=this._name,Q=this._id,J=s5();for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,H,Y=0;Y<F;++Y)if(H=Z[Y]){var X=V1(H,Q);O0(H,_,J,Y,Z,{time:X.time+X.delay+X.duration,delay:0,duration:X.duration,ease:X.ease})}return new r1(q,this._parents,_,J)}function n3(){var _,Q,J=this,q=J._id,U=J.size();return new Promise(function(G,Z){var F={value:Z},H={value:function(){if(--U===0)G()}};if(J.each(function(){var Y=E1(this,q),X=Y.on;if(X!==_)Q=(_=X).copy(),Q._.cancel.push(F),Q._.interrupt.push(F),Q._.end.push(H);Y.on=Q}),U===0)G()})}var o$=0;function r1(_,Q,J,q){this._groups=_,this._parents=Q,this._name=J,this._id=q}function c8(_){return T0().transition(_)}function s5(){return++o$}var f0=T0.prototype;r1.prototype=c8.prototype={constructor:r1,select:l3,selectAll:r3,selectChild:f0.selectChild,selectChildren:f0.selectChildren,filter:m3,merge:g3,selection:i3,transition:o3,call:f0.call,nodes:f0.nodes,node:f0.node,size:f0.size,empty:f0.empty,each:f0.each,on:p3,attr:u3,attrTween:b3,style:d3,styleTween:a3,text:s3,textTween:t3,remove:c3,tween:V3,delay:D3,duration:h3,ease:E3,easeVarying:x3,end:n3,[Symbol.iterator]:f0[Symbol.iterator]};function t5(_){return((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2}var n$={time:null,delay:0,duration:250,ease:t5};function e$(_,Q){var J;while(!(J=_.__transition)||!(J=J[Q]))if(!(_=_.parentNode))throw Error(`transition ${Q} not found`);return J}function e3(_){var Q,J;if(_ instanceof r1)Q=_._id,_=_._name;else Q=s5(),(J=n$).time=G5(),_=_==null?null:_+"";for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,H,Y=0;Y<F;++Y)if(H=Z[Y])O0(H,_,Q,Y,Z,J||e$(H,Q));return new r1(q,this._parents,_,Q)}T0.prototype.interrupt=j3;T0.prototype.transition=e3;var X5=(_)=>()=>_;function _6(_,{sourceEvent:Q,target:J,transform:q,dispatch:U}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},target:{value:J,enumerable:!0,configurable:!0},transform:{value:q,enumerable:!0,configurable:!0},_:{value:U}})}function U0(_,Q,J){this.k=_,this.x=Q,this.y=J}U0.prototype={constructor:U0,scale:function(_){return _===1?this:new U0(this.k*_,this.x,this.y)},translate:function(_,Q){return _===0&Q===0?this:new U0(this.k,this.x+this.k*_,this.y+this.k*Q)},apply:function(_){return[_[0]*this.k+this.x,_[1]*this.k+this.y]},applyX:function(_){return _*this.k+this.x},applyY:function(_){return _*this.k+this.y},invert:function(_){return[(_[0]-this.x)/this.k,(_[1]-this.y)/this.k]},invertX:function(_){return(_-this.x)/this.k},invertY:function(_){return(_-this.y)/this.k},rescaleX:function(_){return _.copy().domain(_.range().map(this.invertX,this).map(_.invert,_))},rescaleY:function(_){return _.copy().domain(_.range().map(this.invertY,this).map(_.invert,_))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Q2=new U0(1,0,0);Y5.prototype=U0.prototype;function Y5(_){while(!_.__zoom)if(!(_=_.parentNode))return Q2;return _.__zoom}function o5(_){_.stopImmediatePropagation()}function J2(_){_.preventDefault(),_.stopImmediatePropagation()}function _q(_){return(!_.ctrlKey||_.type==="wheel")&&!_.button}function Qq(){var _=this;if(_ instanceof SVGElement){if(_=_.ownerSVGElement||_,_.hasAttribute("viewBox"))return _=_.viewBox.baseVal,[[_.x,_.y],[_.x+_.width,_.y+_.height]];return[[0,0],[_.width.baseVal.value,_.height.baseVal.value]]}return[[0,0],[_.clientWidth,_.clientHeight]]}function l8(){return this.__zoom||Q2}function Jq(_){return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*(_.ctrlKey?10:1)}function $q(){return navigator.maxTouchPoints||"ontouchstart"in this}function qq(_,Q,J){var q=_.invertX(Q[0][0])-J[0][0],U=_.invertX(Q[1][0])-J[1][0],G=_.invertY(Q[0][1])-J[0][1],Z=_.invertY(Q[1][1])-J[1][1];return _.translate(U>q?(q+U)/2:Math.min(0,q)||Math.max(0,U),Z>G?(G+Z)/2:Math.min(0,G)||Math.max(0,Z))}function L5(){var _=_q,Q=Qq,J=qq,q=Jq,U=$q,G=[0,1/0],Z=[[-1/0,-1/0],[1/0,1/0]],F=250,H=e0,Y=a0("start","zoom","end"),X,K,L,z=500,W=150,O=0,T=10;function B(S){S.property("__zoom",l8).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",v).filter(U).on("touchstart.zoom",E).on("touchmove.zoom",g).on("touchend.zoom touchcancel.zoom",h).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}B.transform=function(S,b,j,x){var V=S.selection?S.selection():S;if(V.property("__zoom",l8),S!==V)I(S,b,j,x);else V.interrupt().each(function(){C(this,arguments).event(x).start().zoom(null,typeof b==="function"?b.apply(this,arguments):b).end()})},B.scaleBy=function(S,b,j,x){B.scaleTo(S,function(){var V=this.__zoom.k,D=typeof b==="function"?b.apply(this,arguments):b;return V*D},j,x)},B.scaleTo=function(S,b,j,x){B.transform(S,function(){var V=Q.apply(this,arguments),D=this.__zoom,f=j==null?R(V):typeof j==="function"?j.apply(this,arguments):j,y=D.invert(f),p=typeof b==="function"?b.apply(this,arguments):b;return J(A(w(D,p),f,y),V,Z)},j,x)},B.translateBy=function(S,b,j,x){B.transform(S,function(){return J(this.__zoom.translate(typeof b==="function"?b.apply(this,arguments):b,typeof j==="function"?j.apply(this,arguments):j),Q.apply(this,arguments),Z)},null,x)},B.translateTo=function(S,b,j,x,V){B.transform(S,function(){var D=Q.apply(this,arguments),f=this.__zoom,y=x==null?R(D):typeof x==="function"?x.apply(this,arguments):x;return J(Q2.translate(y[0],y[1]).scale(f.k).translate(typeof b==="function"?-b.apply(this,arguments):-b,typeof j==="function"?-j.apply(this,arguments):-j),D,Z)},x,V)};function w(S,b){return b=Math.max(G[0],Math.min(G[1],b)),b===S.k?S:new U0(b,S.x,S.y)}function A(S,b,j){var x=b[0]-j[0]*S.k,V=b[1]-j[1]*S.k;return x===S.x&&V===S.y?S:new U0(S.k,x,V)}function R(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function I(S,b,j,x){S.on("start.zoom",function(){C(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(x).end()}).tween("zoom",function(){var V=this,D=arguments,f=C(V,D).event(x),y=Q.apply(V,D),p=j==null?R(y):typeof j==="function"?j.apply(V,D):j,u=Math.max(y[1][0]-y[0][0],y[1][1]-y[0][1]),s=V.__zoom,t=typeof b==="function"?b.apply(V,D):b,a=H(s.invert(p).concat(u/s.k),t.invert(p).concat(u/t.k));return function(d){if(d===1)d=t;else{var c=a(d),e=u/c[2];d=new U0(e,p[0]-c[0]*e,p[1]-c[1]*e)}f.zoom(null,d)}})}function C(S,b,j){return!j&&S.__zooming||new P(S,b)}function P(S,b){this.that=S,this.args=b,this.active=0,this.sourceEvent=null,this.extent=Q.apply(S,b),this.taps=0}P.prototype={event:function(S){if(S)this.sourceEvent=S;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(S,b){if(this.mouse&&S!=="mouse")this.mouse[1]=b.invert(this.mouse[0]);if(this.touch0&&S!=="touch")this.touch0[1]=b.invert(this.touch0[0]);if(this.touch1&&S!=="touch")this.touch1[1]=b.invert(this.touch1[0]);return this.that.__zoom=b,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(S){var b=j1(this.that).datum();Y.call(S,this.that,new _6(S,{sourceEvent:this.sourceEvent,target:B,type:S,transform:this.that.__zoom,dispatch:Y}),b)}};function k(S,...b){if(!_.apply(this,arguments))return;var j=C(this,b).event(S),x=this.__zoom,V=Math.max(G[0],Math.min(G[1],x.k*Math.pow(2,q.apply(this,arguments)))),D=x1(S);if(j.wheel){if(j.mouse[0][0]!==D[0]||j.mouse[0][1]!==D[1])j.mouse[1]=x.invert(j.mouse[0]=D);clearTimeout(j.wheel)}else if(x.k===V)return;else j.mouse=[D,x.invert(D)],u0(this),j.start();J2(S),j.wheel=setTimeout(f,W),j.zoom("mouse",J(A(w(x,V),j.mouse[0],j.mouse[1]),j.extent,Z));function f(){j.wheel=null,j.end()}}function N(S,...b){if(L||!_.apply(this,arguments))return;var j=S.currentTarget,x=C(this,b,!0).event(S),V=j1(S.view).on("mousemove.zoom",p,!0).on("mouseup.zoom",u,!0),D=x1(S,j),f=S.clientX,y=S.clientY;f2(S.view),o5(S),x.mouse=[D,this.__zoom.invert(D)],u0(this),x.start();function p(s){if(J2(s),!x.moved){var t=s.clientX-f,a=s.clientY-y;x.moved=t*t+a*a>O}x.event(s).zoom("mouse",J(A(x.that.__zoom,x.mouse[0]=x1(s,j),x.mouse[1]),x.extent,Z))}function u(s){V.on("mousemove.zoom mouseup.zoom",null),i2(s.view,x.moved),J2(s),x.event(s).end()}}function v(S,...b){if(!_.apply(this,arguments))return;var j=this.__zoom,x=x1(S.changedTouches?S.changedTouches[0]:S,this),V=j.invert(x),D=j.k*(S.shiftKey?0.5:2),f=J(A(w(j,D),x,V),Q.apply(this,b),Z);if(J2(S),F>0)j1(this).transition().duration(F).call(I,f,x,S);else j1(this).call(B.transform,f,x,S)}function E(S,...b){if(!_.apply(this,arguments))return;var j=S.touches,x=j.length,V=C(this,b,S.changedTouches.length===x).event(S),D,f,y,p;o5(S);for(f=0;f<x;++f)if(y=j[f],p=x1(y,this),p=[p,this.__zoom.invert(p),y.identifier],!V.touch0)V.touch0=p,D=!0,V.taps=1+!!X;else if(!V.touch1&&V.touch0[2]!==p[2])V.touch1=p,V.taps=0;if(X)X=clearTimeout(X);if(D){if(V.taps<2)K=p[0],X=setTimeout(function(){X=null},z);u0(this),V.start()}}function g(S,...b){if(!this.__zooming)return;var j=C(this,b).event(S),x=S.changedTouches,V=x.length,D,f,y,p;J2(S);for(D=0;D<V;++D)if(f=x[D],y=x1(f,this),j.touch0&&j.touch0[2]===f.identifier)j.touch0[0]=y;else if(j.touch1&&j.touch1[2]===f.identifier)j.touch1[0]=y;if(f=j.that.__zoom,j.touch1){var u=j.touch0[0],s=j.touch0[1],t=j.touch1[0],a=j.touch1[1],d=(d=t[0]-u[0])*d+(d=t[1]-u[1])*d,c=(c=a[0]-s[0])*c+(c=a[1]-s[1])*c;f=w(f,Math.sqrt(d/c)),y=[(u[0]+t[0])/2,(u[1]+t[1])/2],p=[(s[0]+a[0])/2,(s[1]+a[1])/2]}else if(j.touch0)y=j.touch0[0],p=j.touch0[1];else return;j.zoom("touch",J(A(f,y,p),j.extent,Z))}function h(S,...b){if(!this.__zooming)return;var j=C(this,b).event(S),x=S.changedTouches,V=x.length,D,f;if(o5(S),L)clearTimeout(L);L=setTimeout(function(){L=null},z);for(D=0;D<V;++D)if(f=x[D],j.touch0&&j.touch0[2]===f.identifier)delete j.touch0;else if(j.touch1&&j.touch1[2]===f.identifier)delete j.touch1;if(j.touch1&&!j.touch0)j.touch0=j.touch1,delete j.touch1;if(j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2){if(f=x1(f,this),Math.hypot(K[0]-f[0],K[1]-f[1])<T){var y=j1(this).on("dblclick.zoom");if(y)y.apply(this,arguments)}}}return B.wheelDelta=function(S){return arguments.length?(q=typeof S==="function"?S:X5(+S),B):q},B.filter=function(S){return arguments.length?(_=typeof S==="function"?S:X5(!!S),B):_},B.touchable=function(S){return arguments.length?(U=typeof S==="function"?S:X5(!!S),B):U},B.extent=function(S){return arguments.length?(Q=typeof S==="function"?S:X5([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),B):Q},B.scaleExtent=function(S){return arguments.length?(G[0]=+S[0],G[1]=+S[1],B):[G[0],G[1]]},B.translateExtent=function(S){return arguments.length?(Z[0][0]=+S[0][0],Z[1][0]=+S[1][0],Z[0][1]=+S[0][1],Z[1][1]=+S[1][1],B):[[Z[0][0],Z[0][1]],[Z[1][0],Z[1][1]]]},B.constrain=function(S){return arguments.length?(J=S,B):J},B.duration=function(S){return arguments.length?(F=+S,B):F},B.interpolate=function(S){return arguments.length?(H=S,B):H},B.on=function(){var S=Y.on.apply(Y,arguments);return S===Y?B:S},B.clickDistance=function(S){return arguments.length?(O=(S=+S)*S,B):Math.sqrt(O)},B.tapDistance=function(S){return arguments.length?(T=+S,B):T},B}var i1={error001:(_="react")=>`Seems like you have not used ${_==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${_}flow.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:(_)=>`Node type "${_}" not found. Using fallback type "default".`,error004:()=>"The 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:(_)=>`The old edge with id=${_} does not exist.`,error009:(_)=>`Marker type "${_}" doesn't exist.`,error008:(_,{id:Q,sourceHandle:J,targetHandle:q})=>`Couldn't create edge for ${_} handle id: "${_==="source"?J:q}", edge id: ${Q}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:(_)=>`Edge type "${_}" not found. Using fallback type "default".`,error012:(_)=>`Node with id "${_}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(_="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${_}/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.",error016:(_)=>`Edge with id "${_}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},v2=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],U6=["Enter"," ","Escape"],G6={"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:_,x:Q,y:J})=>`Moved selected node ${_}. New position, x: ${Q}, y: ${J}`,"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"},E0;(function(_){_.Strict="strict",_.Loose="loose"})(E0||(E0={}));var I0;(function(_){_.Free="free",_.Vertical="vertical",_.Horizontal="horizontal"})(I0||(I0={}));var $2;(function(_){_.Partial="partial",_.Full="full"})($2||($2={}));var Z6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},W0;(function(_){_.Bezier="default",_.Straight="straight",_.Step="step",_.SmoothStep="smoothstep",_.SimpleBezier="simplebezier"})(W0||(W0={}));var k2;(function(_){_.Arrow="arrow",_.ArrowClosed="arrowclosed"})(k2||(k2={}));var J1;(function(_){_.Left="left",_.Top="top",_.Right="right",_.Bottom="bottom"})(J1||(J1={}));var r8={[J1.Left]:J1.Right,[J1.Right]:J1.Left,[J1.Top]:J1.Bottom,[J1.Bottom]:J1.Top},F6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("source"in _)&&("target"in _),U7=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("position"in _)&&!("source"in _)&&!("target"in _),K6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("internals"in _)&&!("source"in _)&&!("target"in _);var W5=(_,Q=[0,0])=>{let{width:J,height:q}=Q0(_),U=_.origin??Q,G=J*U[0],Z=q*U[1];return{x:_.position.x-G,y:_.position.y-Z}},H6=(_,Q={nodeOrigin:[0,0]})=>{if(!Q.nodeLookup)console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.");if(_.length===0)return{x:0,y:0,width:0,height:0};let J=!1,q=_.reduce((U,G)=>{let Z=typeof G==="string",F=!Q.nodeLookup&&!Z?G:void 0;if(Q.nodeLookup)F=Z?Q.nodeLookup.get(G):!K6(G)?Q.nodeLookup.get(G.id):G;if(!F)return U;return J=!0,$4(U,_4(F,Q.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return J?q4(q):{x:0,y:0,width:0,height:0}},Z2=(_,Q={})=>{let J={x:1/0,y:1/0,x2:-1/0,y2:-1/0},q=!1;return _.forEach((U)=>{if(Q.filter===void 0||Q.filter(U))J=$4(J,_4(U)),q=!0}),q?q4(J):{x:0,y:0,width:0,height:0}},Q4=(_,Q,[J,q,U]=[0,0,1],G=!1,Z=!1)=>{let F=(Q.x-J)/U,H=(Q.y-q)/U,Y=Q.width/U,X=Q.height/U,K=[];for(let L of _.values()){let{measured:z,selectable:W=!0,hidden:O=!1}=L;if(Z&&!W||O)continue;let T=z.width??L.width??L.initialWidth??0,B=z.height??L.height??L.initialHeight??0,{x:w,y:A}=L.internals.positionAbsolute,R=H7(F,H,Y,X,w,A,T,B),I=T*B,C=G&&R>0;if(!L.internals.handleBounds||C||R>=I||L.dragging)K.push(L)}return K},G7=(_,Q)=>{let J=new Set;return _.forEach((q)=>{J.add(q.id)}),Q.filter((q)=>J.has(q.source)||J.has(q.target))};function Uq(_,Q){let J=new Map,q=Q?.nodes?new Set(Q.nodes.map((U)=>U.id)):null;return _.forEach((U)=>{let G;if(Q?.includeHiddenNodes){let{width:Z,height:F}=Q0(U);G=Z>0&&F>0}else G=Boolean(U.measured.width&&U.measured.height&&!U.hidden);if(G&&(!q||q.has(U.id)))J.set(U.id,U)}),J}async function Z7({nodes:_,width:Q,height:J,panZoom:q,minZoom:U,maxZoom:G},Z){if(_.size===0)return!0;let F=Uq(_,Z),H=Z2(F),Y=B5(H,Q,J,Z?.minZoom??U,Z?.maxZoom??G,Z?.padding??0.1);return await q.setViewport(Y,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0}function X6({nodeId:_,nextPosition:Q,nodeLookup:J,nodeOrigin:q=[0,0],nodeExtent:U,onError:G}){let Z=J.get(_),F=Z.parentId?J.get(Z.parentId):void 0,{x:H,y:Y}=F?F.internals.positionAbsolute:{x:0,y:0},X=Z.origin??q,K=Z.extent||U;if(Z.extent==="parent"&&!Z.expandParent)if(!F)G?.("005",i1.error005());else{let{width:z,height:W}=Q0(F);if(z&&W)K=[[H,Y],[H+z,Y+W]]}else if(F&&G2(Z.extent))K=[[Z.extent[0][0]+H,Z.extent[0][1]+Y],[Z.extent[1][0]+H,Z.extent[1][1]+Y]];let L=G2(K)?q2(Q,K,Z.measured):Q;if(Z.measured.width===void 0||Z.measured.height===void 0)G?.("015",i1.error015());return{position:{x:L.x-H+(Z.measured.width??0)*X[0],y:L.y-Y+(Z.measured.height??0)*X[1]},positionAbsolute:L}}async function F7({nodesToRemove:_=[],edgesToRemove:Q=[],nodes:J,edges:q,onBeforeDelete:U}){let G=new Set(_.map((L)=>L.id)),Z=[];for(let L of J){if(L.deletable===!1)continue;let z=G.has(L.id),W=!z&&L.parentId&&Z.find((O)=>O.id===L.parentId);if(z||W)Z.push(L)}let F=new Set(Q.map((L)=>L.id)),H=q.filter((L)=>L.deletable!==!1),X=G7(Z,H);for(let L of H)if(F.has(L.id)&&!X.find((W)=>W.id===L.id))X.push(L);if(!U)return{edges:X,nodes:Z};let K=await U({nodes:Z,edges:X});if(typeof K==="boolean")return K?{edges:X,nodes:Z}:{edges:[],nodes:[]};return K}var y2=(_,Q=0,J=1)=>Math.min(Math.max(_,Q),J),q2=(_={x:0,y:0},Q,J)=>({x:y2(_.x,Q[0][0],Q[1][0]-(J?.width??0)),y:y2(_.y,Q[0][1],Q[1][1]-(J?.height??0))});function K7(_,Q,J){let{width:q,height:U}=Q0(J),{x:G,y:Z}=J.internals.positionAbsolute;return q2(_,[[G,Z],[G+q,Z+U]],Q)}var i8=(_,Q,J)=>{if(_<Q)return y2(Math.abs(_-Q),1,Q)/Q;else if(_>J)return-y2(Math.abs(_-J),1,Q)/Q;return 0},J4=(_,Q,J=15,q=40)=>{let U=i8(_.x,q,Q.width-q)*J,G=i8(_.y,q,Q.height-q)*J;return[U,G]},$4=(_,Q)=>({x:Math.min(_.x,Q.x),y:Math.min(_.y,Q.y),x2:Math.max(_.x2,Q.x2),y2:Math.max(_.y2,Q.y2)}),q6=({x:_,y:Q,width:J,height:q})=>({x:_,y:Q,x2:_+J,y2:Q+q}),q4=({x:_,y:Q,x2:J,y2:q})=>({x:_,y:Q,width:J-_,height:q-Q}),j2=(_,Q=[0,0])=>{let{x:J,y:q}=K6(_)?_.internals.positionAbsolute:W5(_,Q);return{x:J,y:q,width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}},_4=(_,Q=[0,0])=>{let{x:J,y:q}=K6(_)?_.internals.positionAbsolute:W5(_,Q);return{x:J,y:q,x2:J+(_.measured?.width??_.width??_.initialWidth??0),y2:q+(_.measured?.height??_.height??_.initialHeight??0)}},Y6=(_,Q)=>q4($4(q6(_),q6(Q))),H7=(_,Q,J,q,U,G,Z,F)=>{let H=Math.max(0,Math.min(_+J,U+Z)-Math.max(_,U)),Y=Math.max(0,Math.min(Q+q,G+F)-Math.max(Q,G));return Math.ceil(H*Y)},A5=(_,Q)=>H7(_.x,_.y,_.width,_.height,Q.x,Q.y,Q.width,Q.height),L6=(_)=>e1(_.width)&&e1(_.height)&&e1(_.x)&&e1(_.y),e1=(_)=>!isNaN(_)&&isFinite(_),z6=(_,Q)=>(J,q)=>{console.warn(`[${_}]: ${q} Help: ${Q}error#${J}`)},V2=(_,Q=[1,1])=>{return{x:Q[0]*Math.round(_.x/Q[0]),y:Q[1]*Math.round(_.y/Q[1])}},u2=({x:_,y:Q},[J,q,U],G=!1,Z=[1,1])=>{let F={x:(_-J)/U,y:(Q-q)/U};return G?V2(F,Z):F},U2=({x:_,y:Q},[J,q,U])=>{return{x:_*U+J,y:Q*U+q}};function S2(_,Q){if(typeof _==="number")return Math.floor((Q-Q/(1+_))*0.5);if(typeof _==="string"&&_.endsWith("px")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(J)}if(typeof _==="string"&&_.endsWith("%")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(Q*J*0.01)}return console.error(`The padding value "${_}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Gq(_,Q,J){if(typeof _==="string"||typeof _==="number"){let q=S2(_,J),U=S2(_,Q);return{top:q,right:U,bottom:q,left:U,x:U*2,y:q*2}}if(typeof _==="object"){let q=S2(_.top??_.y??0,J),U=S2(_.bottom??_.y??0,J),G=S2(_.left??_.x??0,Q),Z=S2(_.right??_.x??0,Q);return{top:q,right:Z,bottom:U,left:G,x:G+Z,y:q+U}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Zq(_,Q,J,q,U,G){let{x:Z,y:F}=U2(_,[Q,J,q]),{x:H,y:Y}=U2({x:_.x+_.width,y:_.y+_.height},[Q,J,q]),X=U-H,K=G-Y;return{left:Math.floor(Z),top:Math.floor(F),right:Math.floor(X),bottom:Math.floor(K)}}var B5=(_,Q,J,q,U,G)=>{let Z=Gq(G,Q,J),F=(Q-Z.x)/_.width,H=(J-Z.y)/_.height,Y=Math.min(F,H),X=y2(Y,q,U),K=_.x+_.width/2,L=_.y+_.height/2,z=Q/2-K*X,W=J/2-L*X,O=Zq(_,z,W,X,Q,J),T={left:Math.min(O.left-Z.left,0),top:Math.min(O.top-Z.top,0),right:Math.min(O.right-Z.right,0),bottom:Math.min(O.bottom-Z.bottom,0)};return{x:z-T.left+T.right,y:W-T.top+T.bottom,zoom:X}},b2=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function G2(_){return _!==void 0&&_!==null&&_!=="parent"}function Q0(_){return{width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}}function W6(_){return(_.measured?.width??_.width??_.initialWidth)!==void 0&&(_.measured?.height??_.height??_.initialHeight)!==void 0}function A6(_,Q={width:0,height:0},J,q,U){let G={..._},Z=q.get(J);if(Z){let F=Z.origin||U;G.x+=Z.internals.positionAbsolute.x-(Q.width??0)*F[0],G.y+=Z.internals.positionAbsolute.y-(Q.height??0)*F[1]}return G}function B6(_,Q){if(_.size!==Q.size)return!1;for(let J of _)if(!Q.has(J))return!1;return!0}function X7(){let _,Q;return{promise:new Promise((q,U)=>{_=q,Q=U}),resolve:_,reject:Q}}function Y7(_){return{...G6,..._||{}}}function Fq(_){if(typeof document>"u")return!0;let Q=document.querySelector(`.${_}-flow__pane`);if(!Q||!Q.isConnected)return!0;let J=getComputedStyle(Q);if(J.display==="none")return!0;if(J.visibility==="hidden"||J.visibility==="collapse")return!0;if(J.opacity==="0")return!0;if(J.width==="0"&&J.height==="0")return!0;let q=Q.getBoundingClientRect();if(q.width===0&&q.height===0)return!0;let U=document.querySelector(`.${_}-flow__attribution`);if(!U||!U.isConnected)return!1;let G=getComputedStyle(U);if(G.display==="none")return!1;if(G.visibility==="hidden"||G.visibility==="collapse")return!1;if(G.opacity==="0")return!1;let Z=U.getBoundingClientRect();if(Z.width===0&&Z.height===0)return!1;return!0}var d8=!1;function L7(_){if(d8)return;d8=!0;let Q=`${_.charAt(0).toUpperCase()+_.slice(1)} Flow`;setTimeout(()=>{if(!Fq(_))console.warn(`${Q}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${Q} Pro: https://${_}flow.dev/remove-attr
|
|
28
|
-
%cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function M6(_){return _===null?null:_?"valid":"invalid"}function z5(_,{snapGrid:Q=[0,0],snapToGrid:J=!1,transform:q,containerBounds:U}){let{x:G,y:Z}=_0(_),F=u2({x:G-(U?.left??0),y:Z-(U?.top??0)},q),{x:H,y:Y}=J?V2(F,Q):F;return{xSnapped:H,ySnapped:Y,...F}}var U4=(_)=>({width:_.offsetWidth,height:_.offsetHeight}),T6=(_)=>_?.getRootNode?.()||window?.document,Kq=["INPUT","SELECT","TEXTAREA"];function R6(_){let Q=_.composedPath?.()?.[0]||_.target;if(Q?.nodeType!==1)return!1;return Kq.includes(Q.nodeName)||Q.hasAttribute("contenteditable")||!!Q.closest(".nokey")}var O6=(_)=>("clientX"in _),_0=(_,Q)=>{let J=O6(_),q=J?_.clientX:_.touches?.[0].clientX,U=J?_.clientY:_.touches?.[0].clientY;return{x:q-(Q?.left??0),y:U-(Q?.top??0)}},a8=(_,Q,J,q,U)=>{let G=Q.querySelectorAll(`.${_}`);if(!G||!G.length)return null;return Array.from(G).map((Z)=>{let F=Z.getBoundingClientRect();return{id:Z.getAttribute("data-handleid"),type:_,nodeId:U,position:Z.getAttribute("data-handlepos"),x:(F.left-J.left)/q,y:(F.top-J.top)/q,...U4(Z)}})};function G4({sourceX:_,sourceY:Q,targetX:J,targetY:q,sourceControlX:U,sourceControlY:G,targetControlX:Z,targetControlY:F}){let H=_*0.125+U*0.375+Z*0.375+J*0.125,Y=Q*0.125+G*0.375+F*0.375+q*0.125,X=Math.abs(H-_),K=Math.abs(Y-Q);return[H,Y,X,K]}function n5(_,Q){if(_>=0)return 0.5*_;return Q*25*Math.sqrt(-_)}function s8({pos:_,x1:Q,y1:J,x2:q,y2:U,c:G}){switch(_){case J1.Left:return[Q-n5(Q-q,G),J];case J1.Right:return[Q+n5(q-Q,G),J];case J1.Top:return[Q,J-n5(J-U,G)];case J1.Bottom:return[Q,J+n5(U-J,G)]}}function Z4({sourceX:_,sourceY:Q,sourcePosition:J=J1.Bottom,targetX:q,targetY:U,targetPosition:G=J1.Top,curvature:Z=0.25}){let[F,H]=s8({pos:J,x1:_,y1:Q,x2:q,y2:U,c:Z}),[Y,X]=s8({pos:G,x1:q,y1:U,x2:_,y2:Q,c:Z}),[K,L,z,W]=G4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:F,sourceControlY:H,targetControlX:Y,targetControlY:X});return[`M${_},${Q} C${F},${H} ${Y},${X} ${q},${U}`,K,L,z,W]}function f6({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let U=Math.abs(J-_)/2,G=J<_?J+U:J-U,Z=Math.abs(q-Q)/2,F=q<Q?q+Z:q-Z;return[G,F,U,Z]}function z7({sourceNode:_,targetNode:Q,selected:J=!1,zIndex:q=0,elevateOnSelect:U=!1,zIndexMode:G="basic"}){if(G==="manual")return q;let Z=U&&J?q+1000:q,F=Math.max(_.parentId||U&&_.selected?_.internals.z:0,Q.parentId||U&&Q.selected?Q.internals.z:0);return Z+F}function W7({sourceNode:_,targetNode:Q,width:J,height:q,transform:U}){let G=$4(_4(_),_4(Q));if(G.x===G.x2)G.x2+=1;if(G.y===G.y2)G.y2+=1;let Z={x:-U[0]/U[2],y:-U[1]/U[2],width:J/U[2],height:q/U[2]};return A5(Z,q4(G))>0}var Hq=({source:_,sourceHandle:Q,target:J,targetHandle:q})=>`xy-edge__${_}${Q||""}-${J}${q||""}`,Xq=(_,Q)=>{return Q.some((J)=>J.source===_.source&&J.target===_.target&&(J.sourceHandle===_.sourceHandle||!J.sourceHandle&&!_.sourceHandle)&&(J.targetHandle===_.targetHandle||!J.targetHandle&&!_.targetHandle))},A7=(_,Q,J={})=>{if(!_.source||!_.target)return J.onError?.("006",i1.error006()),Q;let q=J.getEdgeId||Hq,U;if(F6(_))U={..._};else U={..._,id:q(_)};if(Xq(U,Q))return Q;if(U.sourceHandle===null)delete U.sourceHandle;if(U.targetHandle===null)delete U.targetHandle;return Q.concat(U)};function F4({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let[U,G,Z,F]=f6({sourceX:_,sourceY:Q,targetX:J,targetY:q});return[`M ${_},${Q}L ${J},${q}`,U,G,Z,F]}var t8={[J1.Left]:{x:-1,y:0},[J1.Right]:{x:1,y:0},[J1.Top]:{x:0,y:-1},[J1.Bottom]:{x:0,y:1}},Yq=({source:_,sourcePosition:Q=J1.Bottom,target:J})=>{if(Q===J1.Left||Q===J1.Right)return _.x<J.x?{x:1,y:0}:{x:-1,y:0};return _.y<J.y?{x:0,y:1}:{x:0,y:-1}},o8=(_,Q)=>Math.sqrt(Math.pow(Q.x-_.x,2)+Math.pow(Q.y-_.y,2));function Lq({source:_,sourcePosition:Q=J1.Bottom,target:J,targetPosition:q=J1.Top,center:U,offset:G,stepPosition:Z}){let F=t8[Q],H=t8[q],Y={x:_.x+F.x*G,y:_.y+F.y*G},X={x:J.x+H.x*G,y:J.y+H.y*G},K=Yq({source:Y,sourcePosition:Q,target:X}),L=K.x!==0?"x":"y",z=K[L],W=[],O,T,B={x:0,y:0},w={x:0,y:0},[,,A,R]=f6({sourceX:_.x,sourceY:_.y,targetX:J.x,targetY:J.y});if(F[L]*H[L]===-1){if(L==="x")O=U.x??Y.x+(X.x-Y.x)*Z,T=U.y??(Y.y+X.y)/2;else O=U.x??(Y.x+X.x)/2,T=U.y??Y.y+(X.y-Y.y)*Z;let k=[{x:O,y:Y.y},{x:O,y:X.y}],N=[{x:Y.x,y:T},{x:X.x,y:T}];if(F[L]===z)W=L==="x"?k:N;else W=L==="x"?N:k}else{let k=[{x:Y.x,y:X.y}],N=[{x:X.x,y:Y.y}];if(L==="x")W=F.x===z?N:k;else W=F.y===z?k:N;if(Q===q){let S=Math.abs(_[L]-J[L]);if(S<=G){let b=Math.min(G-1,G-S);if(F[L]===z)B[L]=(Y[L]>_[L]?-1:1)*b;else w[L]=(X[L]>J[L]?-1:1)*b}}if(Q!==q){let S=L==="x"?"y":"x",b=F[L]===H[S],j=Y[S]>X[S],x=Y[S]<X[S];if(F[L]===1&&(!b&&j||b&&x)||F[L]!==1&&(!b&&x||b&&j))W=L==="x"?k:N}let v={x:Y.x+B.x,y:Y.y+B.y},E={x:X.x+w.x,y:X.y+w.y},g=Math.max(Math.abs(v.x-W[0].x),Math.abs(E.x-W[0].x)),h=Math.max(Math.abs(v.y-W[0].y),Math.abs(E.y-W[0].y));if(g>=h)O=(v.x+E.x)/2,T=W[0].y;else O=W[0].x,T=(v.y+E.y)/2}let I={x:Y.x+B.x,y:Y.y+B.y},C={x:X.x+w.x,y:X.y+w.y};return[[_,...I.x!==W[0].x||I.y!==W[0].y?[I]:[],...W,...C.x!==W[W.length-1].x||C.y!==W[W.length-1].y?[C]:[],J],O,T,A,R]}function zq(_,Q,J,q){let U=Math.min(o8(_,Q)/2,o8(Q,J)/2,q),{x:G,y:Z}=Q;if(_.x===G&&G===J.x||_.y===Z&&Z===J.y)return`L${G} ${Z}`;if(_.y===Z){let Y=_.x<J.x?-1:1,X=_.y<J.y?1:-1;return`L ${G+U*Y},${Z}Q ${G},${Z} ${G},${Z+U*X}`}let F=_.x<J.x?1:-1,H=_.y<J.y?-1:1;return`L ${G},${Z+U*H}Q ${G},${Z} ${G+U*F},${Z}`}function M5({sourceX:_,sourceY:Q,sourcePosition:J=J1.Bottom,targetX:q,targetY:U,targetPosition:G=J1.Top,borderRadius:Z=5,centerX:F,centerY:H,offset:Y=20,stepPosition:X=0.5}){let[K,L,z,W,O]=Lq({source:{x:_,y:Q},sourcePosition:J,target:{x:q,y:U},targetPosition:G,center:{x:F,y:H},offset:Y,stepPosition:X}),T=`M${K[0].x} ${K[0].y}`;for(let B=1;B<K.length-1;B++)T+=zq(K[B-1],K[B],K[B+1],Z);return T+=`L${K[K.length-1].x} ${K[K.length-1].y}`,[T,L,z,W,O]}function n8(_){return _&&!!(_.internals.handleBounds||_.handles?.length)&&!!(_.measured.width||_.width||_.initialWidth)}function B7(_){let{sourceNode:Q,targetNode:J}=_;if(!n8(Q)||!n8(J))return null;let q=Q.internals.handleBounds||e8(Q.handles),U=J.internals.handleBounds||e8(J.handles),G=_7(q?.source??[],_.sourceHandle),Z=_7(_.connectionMode===E0.Strict?U?.target??[]:(U?.target??[]).concat(U?.source??[]),_.targetHandle);if(!G||!Z)return _.onError?.("008",i1.error008(!G?"source":"target",{id:_.id,sourceHandle:_.sourceHandle,targetHandle:_.targetHandle})),null;let F=G?.position||J1.Bottom,H=Z?.position||J1.Top,Y=x0(Q,G,F),X=x0(J,Z,H);return{sourceX:Y.x,sourceY:Y.y,targetX:X.x,targetY:X.y,sourcePosition:F,targetPosition:H}}function e8(_){if(!_)return null;let Q=[],J=[];for(let q of _)if(q.width=q.width??1,q.height=q.height??1,q.type==="source")Q.push(q);else if(q.type==="target")J.push(q);return{source:Q,target:J}}function x0(_,Q,J=J1.Left,q=!1){let U=(Q?.x??0)+_.internals.positionAbsolute.x,G=(Q?.y??0)+_.internals.positionAbsolute.y,{width:Z,height:F}=Q??Q0(_);if(q)return{x:U+Z/2,y:G+F/2};switch(Q?.position??J){case J1.Top:return{x:U+Z/2,y:G};case J1.Right:return{x:U+Z,y:G+F/2};case J1.Bottom:return{x:U+Z/2,y:G+F};case J1.Left:return{x:U,y:G+F/2}}}function _7(_,Q){if(!_)return null;return(!Q?_[0]:_.find((J)=>J.id===Q))||null}function K4(_,Q){if(!_)return"";if(typeof _==="string")return _;return`${Q?`${Q}__`:""}${Object.keys(_).sort().map((q)=>`${q}=${_[q]}`).join("&")}`}function M7(_,{id:Q,defaultColor:J,defaultMarkerStart:q,defaultMarkerEnd:U}){let G=new Set;return _.reduce((Z,F)=>{return[F.markerStart||q,F.markerEnd||U].forEach((H)=>{if(H&&typeof H==="object"){let Y=K4(H,Q);if(!G.has(Y))Z.push({id:Y,color:H.color||J,...H}),G.add(Y)}}),Z},[]).sort((Z,F)=>Z.id.localeCompare(F.id))}function T7(_,Q,J,q,U){let G=0.5;if(U==="start")G=0;else if(U==="end")G=1;let Z=[(_.x+_.width*G)*Q.zoom+Q.x,_.y*Q.zoom+Q.y-q],F=[-100*G,-100];switch(J){case J1.Right:Z=[(_.x+_.width)*Q.zoom+Q.x+q,(_.y+_.height*G)*Q.zoom+Q.y],F=[0,-100*G];break;case J1.Bottom:Z[1]=(_.y+_.height)*Q.zoom+Q.y+q,F[1]=0;break;case J1.Left:Z=[_.x*Q.zoom+Q.x-q,(_.y+_.height*G)*Q.zoom+Q.y],F=[-100,-100*G];break}return`translate(${Z[0]}px, ${Z[1]}px) translate(${F[0]}%, ${F[1]}%)`}var R7=1000,Wq=10,I6={nodeOrigin:[0,0],nodeExtent:v2,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Aq={...I6,checkEquality:!0};function w6(_,Q){let J={..._};for(let q in Q)if(Q[q]!==void 0)J[q]=Q[q];return J}function O7(_,Q,J){let q=w6(I6,J);for(let U of _.values())if(U.parentId)N6(U,_,Q,q);else{let G=W5(U,q.nodeOrigin),Z=G2(U.extent)?U.extent:q.nodeExtent,F=q2(G,Z,Q0(U));U.internals.positionAbsolute=F}}function Bq(_,Q){if(!_.handles)return!_.measured?void 0:Q?.internals.handleBounds;let J=[],q=[];for(let U of _.handles){let G={id:U.id,width:U.width??1,height:U.height??1,nodeId:_.id,x:U.x,y:U.y,position:U.position,type:U.type};if(U.type==="source")J.push(G);else if(U.type==="target")q.push(G)}return{source:J,target:q}}function P6(_){return _==="manual"}function H4(_,Q,J,q={}){let U=w6(Aq,q),G={i:0},Z=new Map(Q),F=U?.elevateNodesOnSelect&&!P6(U.zIndexMode)?R7:0,H=_.length>0,Y=!1;Q.clear(),J.clear();for(let X of _){let K=Z.get(X.id);if(U.checkEquality&&X===K?.internals.userNode)Q.set(X.id,K);else{let L=W5(X,U.nodeOrigin),z=G2(X.extent)?X.extent:U.nodeExtent,W=q2(L,z,Q0(X));K={...U.defaults,...X,measured:{width:X.measured?.width,height:X.measured?.height},internals:{positionAbsolute:W,handleBounds:Bq(X,K),z:f7(X,F,U.zIndexMode),userNode:X}},Q.set(X.id,K)}if((K.measured===void 0||K.measured.width===void 0||K.measured.height===void 0)&&!K.hidden)H=!1;if(X.parentId)N6(K,Q,J,q,G);Y||=X.selected??!1}return{nodesInitialized:H,hasSelectedNodes:Y}}function Mq(_,Q){if(!_.parentId)return;let J=Q.get(_.parentId);if(J)J.set(_.id,_);else Q.set(_.parentId,new Map([[_.id,_]]))}function N6(_,Q,J,q,U){let{elevateNodesOnSelect:G,nodeOrigin:Z,nodeExtent:F,zIndexMode:H}=w6(I6,q),Y=_.parentId,X=Q.get(Y);if(!X){console.warn(`Parent node ${Y} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if(Mq(_,J),U&&!X.parentId&&X.internals.rootParentIndex===void 0&&H==="auto")X.internals.rootParentIndex=++U.i,X.internals.z=X.internals.z+U.i*Wq;if(U&&X.internals.rootParentIndex!==void 0)U.i=X.internals.rootParentIndex;let K=G&&!P6(H)?R7:0,{x:L,y:z,z:W}=Tq(_,X,Z,F,K,H),{positionAbsolute:O}=_.internals,T=L!==O.x||z!==O.y;if(T||W!==_.internals.z)Q.set(_.id,{..._,internals:{..._.internals,positionAbsolute:T?{x:L,y:z}:O,z:W}})}function f7(_,Q,J){let q=e1(_.zIndex)?_.zIndex:0;if(P6(J))return q;return q+(_.selected?Q:0)}function Tq(_,Q,J,q,U,G){let{x:Z,y:F}=Q.internals.positionAbsolute,H=Q0(_),Y=W5(_,J),X=G2(_.extent)?q2(Y,_.extent,H):Y,K=q2({x:Z+X.x,y:F+X.y},q,H);if(_.extent==="parent")K=K7(K,H,Q);let L=f7(_,U,G),z=Q.internals.z??0;return{x:K.x,y:K.y,z:z>=L?z+1:L}}function X4(_,Q,J,q=[0,0]){let U=[],G=new Map;for(let Z of _){let F=Q.get(Z.parentId);if(!F)continue;let H=G.get(Z.parentId)?.expandedRect??j2(F),Y=Y6(H,Z.rect);G.set(Z.parentId,{expandedRect:Y,parent:F})}if(G.size>0)G.forEach(({expandedRect:Z,parent:F},H)=>{let Y=F.internals.positionAbsolute,X=Q0(F),K=F.origin??q,L=Z.x<Y.x?Math.round(Math.abs(Y.x-Z.x)):0,z=Z.y<Y.y?Math.round(Math.abs(Y.y-Z.y)):0,W=Math.max(X.width,Math.round(Z.width)),O=Math.max(X.height,Math.round(Z.height)),T=(W-X.width)*K[0],B=(O-X.height)*K[1];if(L>0||z>0||T||B)U.push({id:H,type:"position",position:{x:F.position.x-L+T,y:F.position.y-z+B}}),J.get(H)?.forEach((w)=>{if(!_.some((A)=>A.id===w.id))U.push({id:w.id,type:"position",position:{x:w.position.x+L,y:w.position.y+z}})});if(X.width<Z.width||X.height<Z.height||L||z)U.push({id:H,type:"dimensions",setAttributes:!0,dimensions:{width:W+(L?K[0]*L-T:0),height:O+(z?K[1]*z-B:0)}})});return U}function I7(_,Q,J,q,U,G,Z){let F=q?.querySelector(".xyflow__viewport"),H=!1;if(!F)return{changes:[],updatedInternals:H};let Y=[],X=window.getComputedStyle(F),{m22:K}=new window.DOMMatrixReadOnly(X.transform),L=[];for(let z of _.values()){let W=Q.get(z.id);if(!W)continue;if(W.hidden){Q.set(W.id,{...W,internals:{...W.internals,handleBounds:void 0}}),H=!0;continue}let O=U4(z.nodeElement),T=W.measured.width!==O.width||W.measured.height!==O.height;if(!!(O.width&&O.height&&(T||!W.internals.handleBounds||z.force))){let w=z.nodeElement.getBoundingClientRect(),A=G2(W.extent)?W.extent:G,{positionAbsolute:R}=W.internals;if(W.parentId&&W.extent==="parent"){let C=Q.get(W.parentId);if(C)R=K7(R,O,C)}else if(A)R=q2(R,A,O);let I={...W,measured:O,internals:{...W.internals,positionAbsolute:R,handleBounds:{source:a8("source",z.nodeElement,w,K,W.id),target:a8("target",z.nodeElement,w,K,W.id)}}};if(Q.set(W.id,I),W.parentId)N6(I,Q,J,{nodeOrigin:U,zIndexMode:Z});if(H=!0,T){if(Y.push({id:W.id,type:"dimensions",dimensions:O}),W.expandParent&&W.parentId)L.push({id:W.id,parentId:W.parentId,rect:j2(I,U)})}}}if(L.length>0){let z=X4(L,Q,J,U);Y.push(...z)}return{changes:Y,updatedInternals:H}}async function w7({delta:_,panZoom:Q,transform:J,translateExtent:q,width:U,height:G}){if(!Q||!_.x&&!_.y)return!1;let Z=await Q.setViewportConstrained({x:J[0]+_.x,y:J[1]+_.y,zoom:J[2]},[[0,0],[U,G]],q);return!!Z&&(Z.x!==J[0]||Z.y!==J[1]||Z.k!==J[2])}function Q7(_,Q,J,q,U,G){let Z=U,F=q.get(Z)||new Map;q.set(Z,F.set(J,Q)),Z=`${U}-${_}`;let H=q.get(Z)||new Map;if(q.set(Z,H.set(J,Q)),G){Z=`${U}-${_}-${G}`;let Y=q.get(Z)||new Map;q.set(Z,Y.set(J,Q))}}function C6(_,Q,J){_.clear(),Q.clear();for(let q of J){let{source:U,target:G,sourceHandle:Z=null,targetHandle:F=null}=q,H={edgeId:q.id,source:U,target:G,sourceHandle:Z,targetHandle:F},Y=`${U}-${Z}--${G}-${F}`,X=`${G}-${F}--${U}-${Z}`;Q7("source",H,X,_,U,Z),Q7("target",H,Y,_,G,F),Q.set(q.id,q)}}function P7(_,Q){if(!_.parentId)return!1;let J=Q.get(_.parentId);if(!J)return!1;if(J.selected)return!0;return P7(J,Q)}function J7(_,Q,J){let q=_;do{if(q?.matches?.(Q))return!0;if(q===J)return!1;q=q?.parentElement}while(q);return!1}function Rq(_,Q,J,q){let U=new Map;for(let[G,Z]of _)if((Z.selected||Z.id===q)&&(!Z.parentId||!P7(Z,_))&&(Z.draggable||Q&&typeof Z.draggable>"u")){let F=_.get(G);if(F)U.set(G,{id:G,position:F.position||{x:0,y:0},distance:{x:J.x-F.internals.positionAbsolute.x,y:J.y-F.internals.positionAbsolute.y},extent:F.extent,parentId:F.parentId,origin:F.origin,expandParent:F.expandParent,internals:{positionAbsolute:F.internals.positionAbsolute||{x:0,y:0}},measured:{width:F.measured.width??0,height:F.measured.height??0}})}return U}function Q6({nodeId:_,dragItems:Q,nodeLookup:J,dragging:q=!0}){let U=[];for(let[Z,F]of Q){let H=J.get(Z)?.internals.userNode;if(H)U.push({...H,position:F.position,dragging:q})}if(!_)return[U[0],U];let G=J.get(_)?.internals.userNode;return[!G?U[0]:{...G,position:Q.get(_)?.position||G.position,dragging:q},U]}function Oq({dragItems:_,snapGrid:Q,x:J,y:q}){let U=_.values().next().value;if(!U)return null;let G={x:J-U.distance.x,y:q-U.distance.y},Z=V2(G,Q);return{x:Z.x-G.x,y:Z.y-G.y}}function N7({onNodeMouseDown:_,getStoreItems:Q,onDragStart:J,onDrag:q,onDragStop:U}){let G={x:null,y:null},Z=0,F=new Map,H=!1,Y={x:0,y:0},X=null,K=!1,L=null,z=!1,W=!1,O=null;function T({noDragClassName:w,handleSelector:A,domNode:R,isSelectable:I,nodeId:C,nodeClickDistance:P=0}){L=j1(R);function k({x:g,y:h}){let{nodeLookup:S,nodeExtent:b,snapGrid:j,snapToGrid:x,nodeOrigin:V,onNodeDrag:D,onSelectionDrag:f,onError:y,updateNodePositions:p}=Q();G={x:g,y:h};let u=!1,s=F.size>1,t=s&&b?q6(Z2(F)):null,a=s&&x?Oq({dragItems:F,snapGrid:j,x:g,y:h}):null;for(let[d,c]of F){if(!S.has(d))continue;let e={x:g-c.distance.x,y:h-c.distance.y};if(x)e=a?{x:Math.round(e.x+a.x),y:Math.round(e.y+a.y)}:V2(e,j);let Q1=null;if(s&&b&&!c.extent&&t){let{positionAbsolute:Z1}=c.internals,Y1=Z1.x-t.x+b[0][0],K1=Z1.x+c.measured.width-t.x2+b[1][0],o=Z1.y-t.y+b[0][1],z1=Z1.y+c.measured.height-t.y2+b[1][1];Q1=[[Y1,o],[K1,z1]]}let{position:G1,positionAbsolute:$1}=X6({nodeId:d,nextPosition:e,nodeLookup:S,nodeExtent:Q1?Q1:b,nodeOrigin:V,onError:y});u=u||c.position.x!==G1.x||c.position.y!==G1.y,c.position=G1,c.internals.positionAbsolute=$1}if(W=W||u,!u)return;if(p(F,!0),O&&(q||D||!C&&f)){let[d,c]=Q6({nodeId:C,dragItems:F,nodeLookup:S});if(q?.(O,F,d,c),D?.(O,d,c),!C)f?.(O,c)}}async function N(){if(!X)return;let{transform:g,panBy:h,autoPanSpeed:S,autoPanOnNodeDrag:b}=Q();if(!b){H=!1,cancelAnimationFrame(Z);return}let[j,x]=J4(Y,X,S);if(j!==0||x!==0){if(G.x=(G.x??0)-j/g[2],G.y=(G.y??0)-x/g[2],await h({x:j,y:x}))k(G)}Z=requestAnimationFrame(N)}function v(g){let{nodeLookup:h,multiSelectionActive:S,nodesDraggable:b,transform:j,snapGrid:x,snapToGrid:V,selectNodesOnDrag:D,onNodeDragStart:f,onSelectionDragStart:y,unselectNodesAndEdges:p}=Q();if(K=!0,(!D||!I)&&!S&&C){if(!h.get(C)?.selected)p()}if(I&&D&&C)_?.(C);let u=z5(g.sourceEvent,{transform:j,snapGrid:x,snapToGrid:V,containerBounds:X});if(G=u,F=Rq(h,b,u,C),F.size>0&&(J||f||!C&&y)){let[s,t]=Q6({nodeId:C,dragItems:F,nodeLookup:h});if(J?.(g.sourceEvent,F,s,t),f?.(g.sourceEvent,s,t),!C)y?.(g.sourceEvent,t)}}let E=s2().clickDistance(P).on("start",(g)=>{let{domNode:h,nodeDragThreshold:S,transform:b,snapGrid:j,snapToGrid:x}=Q();if(X=h?.getBoundingClientRect()||null,z=!1,W=!1,O=g.sourceEvent,S===0)v(g);G=z5(g.sourceEvent,{transform:b,snapGrid:j,snapToGrid:x,containerBounds:X}),Y=_0(g.sourceEvent,X)}).on("drag",(g)=>{let{autoPanOnNodeDrag:h,transform:S,snapGrid:b,snapToGrid:j,nodeDragThreshold:x,nodeLookup:V}=Q(),D=z5(g.sourceEvent,{transform:S,snapGrid:b,snapToGrid:j,containerBounds:X});if(O=g.sourceEvent,g.sourceEvent.type==="touchmove"&&g.sourceEvent.touches.length>1||C&&!V.has(C))z=!0;if(z)return;if(!H&&h&&K)H=!0,N();if(!K){let f=_0(g.sourceEvent,X),y=f.x-Y.x,p=f.y-Y.y;if(Math.sqrt(y*y+p*p)>x)v(g)}if((G.x!==D.xSnapped||G.y!==D.ySnapped)&&F&&K)Y=_0(g.sourceEvent,X),k(D)}).on("end",(g)=>{if(!K||z){if(z&&F.size>0)Q().updateNodePositions(F,!1);return}if(H=!1,K=!1,cancelAnimationFrame(Z),F.size>0){let{nodeLookup:h,updateNodePositions:S,onNodeDragStop:b,onSelectionDragStop:j}=Q();if(W)S(F,!1),W=!1;if(U||b||!C&&j){let[x,V]=Q6({nodeId:C,dragItems:F,nodeLookup:h,dragging:!1});if(U?.(g.sourceEvent,F,x,V),b?.(g.sourceEvent,x,V),!C)j?.(g.sourceEvent,V)}}}).filter((g)=>{let h=g.target;return!g.button&&(!w||!J7(h,`.${w}`,R))&&(!A||J7(h,A,R))});L.call(E)}function B(){L?.on(".drag",null)}return{update:T,destroy:B}}function fq(_,Q,J){let q=[],U={x:_.x-J,y:_.y-J,width:J*2,height:J*2};for(let G of Q.values())if(A5(U,j2(G))>0)q.push(G);return q}var Iq=250;function wq(_,Q,J,q){let U=[],G=1/0,Z=fq(_,J,Q+Iq);for(let F of Z){let H=[...F.internals.handleBounds?.source??[],...F.internals.handleBounds?.target??[]];for(let Y of H){if(q.nodeId===Y.nodeId&&q.type===Y.type&&q.id===Y.id)continue;let{x:X,y:K}=x0(F,Y,Y.position,!0),L=Math.sqrt(Math.pow(X-_.x,2)+Math.pow(K-_.y,2));if(L>Q)continue;if(L<G)U=[{...Y,x:X,y:K}],G=L;else if(L===G)U.push({...Y,x:X,y:K})}}if(!U.length)return null;if(U.length>1){let F=q.type==="source"?"target":"source";return U.find((H)=>H.type===F)??U[0]}return U[0]}function C7(_,Q,J,q,U,G=!1){let Z=q.get(_);if(!Z)return null;let F=U==="strict"?Z.internals.handleBounds?.[Q]:[...Z.internals.handleBounds?.source??[],...Z.internals.handleBounds?.target??[]],H=(J?F?.find((Y)=>Y.id===J):F?.[0])??null;return H&&G?{...H,...x0(Z,H,H.position,!0)}:H}function S7(_,Q){if(_)return _;else if(Q?.classList.contains("target"))return"target";else if(Q?.classList.contains("source"))return"source";return null}function Pq(_,Q){let J=null;if(Q)J=!0;else if(_&&!Q)J=!1;return J}var k7=()=>!0;function Nq(_,{connectionMode:Q,connectionRadius:J,handleId:q,nodeId:U,edgeUpdaterType:G,isTarget:Z,domNode:F,nodeLookup:H,lib:Y,autoPanOnConnect:X,flowId:K,panBy:L,cancelConnection:z,onConnectStart:W,onConnect:O,onConnectEnd:T,isValidConnection:B=k7,onReconnectEnd:w,updateConnection:A,getTransform:R,getFromHandle:I,autoPanSpeed:C,dragThreshold:P=1,handleDomNode:k}){let N=T6(_.target),v=0,E,{x:g,y:h}=_0(_),S=S7(G,k),b=F?.getBoundingClientRect(),j=!1;if(!b||!S)return;let x=C7(U,S,q,H,Q);if(!x)return;let V=_0(_,b),D=!1,f=null,y=!1,p=null;function u(){if(!X||!b)return;let[G1,$1]=J4(V,b,C);L({x:G1,y:$1}),v=requestAnimationFrame(u)}let s={...x,nodeId:U,type:S,position:x.position},t=H.get(U),d={inProgress:!0,isValid:null,from:x0(t,s,J1.Left,!0),fromHandle:s,fromPosition:s.position,fromNode:t,to:V,toHandle:null,toPosition:r8[s.position],toNode:null,pointer:V};function c(){j=!0,A(d),W?.(_,{nodeId:U,handleId:q,handleType:S})}if(P===0)c();function e(G1){if(!j){let{x:z1,y:q1}=_0(G1),y1=z1-g,c1=q1-h;if(!(y1*y1+c1*c1>P*P))return;c()}if(!I()||!s){Q1(G1);return}let $1=R();if(V=_0(G1,b),E=wq(u2(V,$1,!1,[1,1]),J,H,s),!D)u(),D=!0;let Z1=y7(G1,{handle:E,connectionMode:Q,fromNodeId:U,fromHandleId:q,fromType:Z?"target":"source",isValidConnection:B,doc:N,lib:Y,flowId:K,nodeLookup:H});p=Z1.handleDomNode,f=Z1.connection,y=Pq(!!E,Z1.isValid);let Y1=H.get(U),K1=Y1?x0(Y1,s,J1.Left,!0):d.from,o={...d,from:K1,isValid:y,to:Z1.toHandle&&y?U2({x:Z1.toHandle.x,y:Z1.toHandle.y},$1):V,toHandle:Z1.toHandle,toPosition:y&&Z1.toHandle?Z1.toHandle.position:r8[s.position],toNode:Z1.toHandle?H.get(Z1.toHandle.nodeId):null,pointer:V};A(o),d=o}function Q1(G1){if("touches"in G1&&G1.touches.length>0)return;if(j){if((E||p)&&f&&y)O?.(f);let{inProgress:$1,...Z1}=d,Y1={...Z1,toPosition:d.toHandle?d.toPosition:null};if(T?.(G1,Y1),G)w?.(G1,Y1)}z(),cancelAnimationFrame(v),D=!1,y=!1,f=null,p=null,N.removeEventListener("mousemove",e),N.removeEventListener("mouseup",Q1),N.removeEventListener("touchmove",e),N.removeEventListener("touchend",Q1)}N.addEventListener("mousemove",e),N.addEventListener("mouseup",Q1),N.addEventListener("touchmove",e),N.addEventListener("touchend",Q1)}function y7(_,{handle:Q,connectionMode:J,fromNodeId:q,fromHandleId:U,fromType:G,doc:Z,lib:F,flowId:H,isValidConnection:Y=k7,nodeLookup:X}){let K=G==="target",L=Q?Z.querySelector(`.${F}-flow__handle[data-id="${H}-${Q?.nodeId}-${Q?.id}-${Q?.type}"]`):null,{x:z,y:W}=_0(_),O=Z.elementFromPoint(z,W),T=O?.classList.contains(`${F}-flow__handle`)?O:L,B={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){let w=S7(void 0,T),A=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),I=T.classList.contains("connectable"),C=T.classList.contains("connectableend");if(!A||!w)return B;let P={source:K?A:q,sourceHandle:K?R:U,target:K?q:A,targetHandle:K?U:R};B.connection=P;let N=I&&C&&(J===E0.Strict?K&&w==="source"||!K&&w==="target":A!==q||R!==U);B.isValid=N&&Y(P),B.toHandle=C7(A,w,R,X,J,!0)}return B}var Y4={onPointerDown:Nq,isValid:y7};function v7({domNode:_,panZoom:Q,getTransform:J,getViewScale:q}){let U=j1(_);function G({translateExtent:F,width:H,height:Y,zoomStep:X=1,pannable:K=!0,zoomable:L=!0,inversePan:z=!1}){let W=(A)=>{if(A.sourceEvent.type!=="wheel"||!Q)return;let R=J(),I=A.sourceEvent.ctrlKey&&b2()?10:1,C=-A.sourceEvent.deltaY*(A.sourceEvent.deltaMode===1?0.05:A.sourceEvent.deltaMode?1:0.002)*X,P=R[2]*Math.pow(2,C*I);Q.scaleTo(P)},O=[0,0],T=(A)=>{if(A.sourceEvent.type==="mousedown"||A.sourceEvent.type==="touchstart")O=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY]},B=(A)=>{let R=J();if(A.sourceEvent.type!=="mousemove"&&A.sourceEvent.type!=="touchmove"||!Q)return;let I=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY],C=[I[0]-O[0],I[1]-O[1]];O=I;let P=q()*Math.max(R[2],Math.log(R[2]))*(z?-1:1),k={x:R[0]-C[0]*P,y:R[1]-C[1]*P},N=[[0,0],[H,Y]];Q.setViewportConstrained({x:k.x,y:k.y,zoom:R[2]},N,F)},w=L5().on("start",T).on("zoom",K?B:null).on("zoom.wheel",L?W:null);U.call(w,{})}function Z(){U.on("zoom",null)}return{update:G,destroy:Z,pointer:x1}}var L4=(_)=>({x:_.x,y:_.y,zoom:_.k}),J6=({x:_,y:Q,zoom:J})=>Q2.translate(_,Q).scale(J),h0=(_,Q)=>_.target.closest(`.${Q}`),j7=(_,Q)=>Q===2&&Array.isArray(_)&&_.includes(2),Cq=(_)=>((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2,$6=(_,Q=0,J=Cq,q=()=>{})=>{let U=typeof Q==="number"&&Q>0;if(!U)q();return U?_.transition().duration(Q).ease(J).on("end",q):_},V7=(_)=>{let Q=_.ctrlKey&&b2()?10:1;return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*Q};function Sq({zoomPanValues:_,noWheelClassName:Q,d3Selection:J,d3Zoom:q,panOnScrollMode:U,panOnScrollSpeed:G,zoomOnPinch:Z,onPanZoomStart:F,onPanZoom:H,onPanZoomEnd:Y}){return(X)=>{if(h0(X,Q)){if(X.ctrlKey)X.preventDefault();return!1}X.preventDefault(),X.stopImmediatePropagation();let K=J.property("__zoom").k||1;if(X.ctrlKey&&Z){let T=x1(X),B=V7(X),w=K*Math.pow(2,B);q.scaleTo(J,w,T,X);return}let L=X.deltaMode===1?20:1,z=U===I0.Vertical?0:X.deltaX*L,W=U===I0.Horizontal?0:X.deltaY*L;if(!b2()&&X.shiftKey&&U!==I0.Vertical)z=X.deltaY*L,W=0;q.translateBy(J,-(z/K)*G,-(W/K)*G,{internal:!0});let O=L4(J.property("__zoom"));if(clearTimeout(_.panScrollTimeout),!_.isPanScrolling)_.isPanScrolling=!0,F?.(X,O);else H?.(X,O);_.panScrollTimeout=setTimeout(()=>{Y?.(X,O),_.isPanScrolling=!1},150)}}function kq({noWheelClassName:_,preventScrolling:Q,d3ZoomHandler:J}){return function(q,U){let G=q.type==="wheel",Z=!Q&&G&&!q.ctrlKey,F=h0(q,_);if(q.ctrlKey&&G&&F)q.preventDefault();if(Z||F)return null;q.preventDefault(),J.call(this,q,U)}}function yq({zoomPanValues:_,onDraggingChange:Q,onPanZoomStart:J}){return(q)=>{if(q.sourceEvent?.internal)return;let U=L4(q.transform);if(_.mouseButton=q.sourceEvent?.button||0,_.isZoomingOrPanning=!0,_.prevViewport=U,q.sourceEvent?.type==="mousedown")Q(!0);if(J)J?.(q.sourceEvent,U)}}function vq({zoomPanValues:_,panOnDrag:Q,onPaneContextMenu:J,onTransformChange:q,onPanZoom:U}){return(G)=>{if(_.usedRightMouseButton=!!(J&&j7(Q,_.mouseButton??0)),!G.sourceEvent?.sync)q([G.transform.x,G.transform.y,G.transform.k]);if(U&&!G.sourceEvent?.internal)U?.(G.sourceEvent,L4(G.transform))}}function jq({zoomPanValues:_,panOnDrag:Q,panOnScroll:J,onDraggingChange:q,onPanZoomEnd:U,onPaneContextMenu:G}){return(Z)=>{if(Z.sourceEvent?.internal)return;if(_.isZoomingOrPanning=!1,G&&j7(Q,_.mouseButton??0)&&!_.usedRightMouseButton&&Z.sourceEvent)G(Z.sourceEvent);if(_.usedRightMouseButton=!1,q(!1),U){let F=L4(Z.transform);_.prevViewport=F,clearTimeout(_.timerId),_.timerId=setTimeout(()=>{U?.(Z.sourceEvent,F)},J?150:0)}}}function Vq({panActivationKeyPressed:_,zoomActivationKeyPressed:Q,zoomOnScroll:J,zoomOnPinch:q,panOnDrag:U,panOnScroll:G,zoomOnDoubleClick:Z,userSelectionActive:F,noWheelClassName:H,noPanClassName:Y,lib:X,connectionInProgress:K}){return(L)=>{let z=Q||J,W=q&&L.ctrlKey,O=L.type==="wheel";if(L.button===1&&L.type==="mousedown"&&(h0(L,`${X}-flow__node`)||h0(L,`${X}-flow__edge`)||h0(L,`${X}-flow__selection`)||h0(L,`${X}-flow__nodesselection`)))return!0;if(!U&&!z&&!G&&!Z&&!q)return!1;if(F)return!1;if(K&&!O)return!1;if(h0(L,H)&&O)return!1;if(h0(L,Y)&&(!O||G&&O&&!Q))return!1;if(!q&&L.ctrlKey&&O)return!1;if(!q&&L.type==="touchstart"&&L.touches?.length>1)return L.preventDefault(),!1;if(!z&&!G&&!W&&O)return!1;if(!U&&(L.type==="mousedown"||L.type==="touchstart"))return!1;if(Array.isArray(U)&&!U.includes(L.button)&&L.type==="mousedown")return!1;let T=Array.isArray(U)&&U.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||O||_)&&T}}function u7({domNode:_,minZoom:Q,maxZoom:J,translateExtent:q,viewport:U,onPanZoom:G,onPanZoomStart:Z,onPanZoomEnd:F,onDraggingChange:H}){let Y={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},X=_.getBoundingClientRect(),K=[[0,0],[X.width,X.height]];(typeof ResizeObserver<"u"?new ResizeObserver((h)=>{let S=h[0];if(S)K=[[0,0],[S.contentRect.width,S.contentRect.height]]}):null)?.observe(_);let z=L5().extent(()=>K).scaleExtent([Q,J]).translateExtent(q),W=j1(_).call(z);R({x:U.x,y:U.y,zoom:y2(U.zoom,Q,J)},[[0,0],[X.width,X.height]],q);let O=W.on("wheel.zoom"),T=W.on("dblclick.zoom");z.wheelDelta(V7);async function B(h,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?z0:e0).transform($6(W,S?.duration,S?.ease,()=>b(!0)),h)});return!1}function w({noWheelClassName:h,noPanClassName:S,onPaneContextMenu:b,userSelectionActive:j,panOnScroll:x,panOnDrag:V,panOnScrollMode:D,panOnScrollSpeed:f,preventScrolling:y,zoomOnPinch:p,zoomOnScroll:u,zoomOnDoubleClick:s,panActivationKeyPressed:t=!1,zoomActivationKeyPressed:a,lib:d,onTransformChange:c,connectionInProgress:e,paneClickDistance:Q1,selectionOnDrag:G1}){if(j&&!Y.isZoomingOrPanning)A();let $1=x&&!a&&!j;z.clickDistance(G1?1/0:!e1(Q1)||Q1<0?0:Q1);let Z1=$1?Sq({zoomPanValues:Y,noWheelClassName:h,d3Selection:W,d3Zoom:z,panOnScrollMode:D,panOnScrollSpeed:f,zoomOnPinch:p,onPanZoomStart:Z,onPanZoom:G,onPanZoomEnd:F}):kq({noWheelClassName:h,preventScrolling:y,d3ZoomHandler:O});W.on("wheel.zoom",Z1,{passive:!1});let Y1=yq({zoomPanValues:Y,onDraggingChange:H,onPanZoomStart:Z});z.on("start",Y1);let K1=vq({zoomPanValues:Y,panOnDrag:V,onPaneContextMenu:!!b,onPanZoom:G,onTransformChange:c});z.on("zoom",K1);let o=jq({zoomPanValues:Y,panOnDrag:V,panOnScroll:x,onPaneContextMenu:b,onPanZoomEnd:F,onDraggingChange:H});z.on("end",o);let z1=Vq({panActivationKeyPressed:t,zoomActivationKeyPressed:a,panOnDrag:V,zoomOnScroll:u,panOnScroll:x,zoomOnDoubleClick:s,zoomOnPinch:p,userSelectionActive:j,noPanClassName:S,noWheelClassName:h,lib:d,connectionInProgress:e});if(z.filter(z1),s)W.on("dblclick.zoom",T);else W.on("dblclick.zoom",null)}function A(){z.on("zoom",null)}async function R(h,S,b){let j=J6(h),x=z?.constrain()(j,S,b);if(x)await B(x);return x}async function I(h,S){let b=J6(h);return await B(b,S),b}function C(h){if(W){let S=J6(h),b=W.property("__zoom");if(b.k!==h.zoom||b.x!==h.x||b.y!==h.y)z?.transform(W,S,null,{sync:!0})}}function P(){let h=W?Y5(W.node()):{x:0,y:0,k:1};return{x:h.x,y:h.y,zoom:h.k}}async function k(h,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?z0:e0).scaleTo($6(W,S?.duration,S?.ease,()=>b(!0)),h)});return!1}async function N(h,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?z0:e0).scaleBy($6(W,S?.duration,S?.ease,()=>b(!0)),h)});return!1}function v(h){z?.scaleExtent(h)}function E(h){z?.translateExtent(h)}function g(h){let S=!e1(h)||h<0?0:h;z?.clickDistance(S)}return{update:w,destroy:A,setViewport:I,setViewportConstrained:R,getViewport:P,scaleTo:k,scaleBy:N,setScaleExtent:v,setTranslateExtent:E,syncViewport:C,setClickDistance:g}}var m0;(function(_){_.Line="line",_.Handle="handle"})(m0||(m0={}));function uq({width:_,prevWidth:Q,height:J,prevHeight:q,affectsX:U,affectsY:G}){let Z=_-Q,F=J-q,H=[Z>0?1:Z<0?-1:0,F>0?1:F<0?-1:0];if(Z&&U)H[0]=H[0]*-1;if(F&&G)H[1]=H[1]*-1;return H}function $7(_){let Q=_.includes("right")||_.includes("left"),J=_.includes("bottom")||_.includes("top"),q=_.includes("left"),U=_.includes("top");return{isHorizontal:Q,isVertical:J,affectsX:q,affectsY:U}}function b0(_,Q){return Math.max(0,Q-_)}function D0(_,Q){return Math.max(0,_-Q)}function e5(_,Q,J){return Math.max(0,Q-_,_-J)}function q7(_,Q){return _?!Q:Q}function bq(_,Q,J,q,U,G,Z,F){let{affectsX:H,affectsY:Y}=Q,{isHorizontal:X,isVertical:K}=Q,L=X&&K,{xSnapped:z,ySnapped:W}=J,{minWidth:O,maxWidth:T,minHeight:B,maxHeight:w}=q,{x:A,y:R,width:I,height:C,aspectRatio:P}=_,k=Math.floor(X?z-_.pointerX:0),N=Math.floor(K?W-_.pointerY:0),v=I+(H?-k:k),E=C+(Y?-N:N),g=-G[0]*I,h=-G[1]*C,S=e5(v,O,T),b=e5(E,B,w);if(Z){let V=0,D=0;if(H&&k<0)V=b0(A+k+g,Z[0][0]);else if(!H&&k>0)V=D0(A+v+g,Z[1][0]);if(Y&&N<0)D=b0(R+N+h,Z[0][1]);else if(!Y&&N>0)D=D0(R+E+h,Z[1][1]);S=Math.max(S,V),b=Math.max(b,D)}if(F){let V=0,D=0;if(H&&k>0)V=D0(A+k,F[0][0]);else if(!H&&k<0)V=b0(A+v,F[1][0]);if(Y&&N>0)D=D0(R+N,F[0][1]);else if(!Y&&N<0)D=b0(R+E,F[1][1]);S=Math.max(S,V),b=Math.max(b,D)}if(U){if(X){let V=e5(v/P,B,w)*P;if(S=Math.max(S,V),Z){let D=0;if(!H&&!Y||H&&!Y&&L)D=D0(R+h+v/P,Z[1][1])*P;else D=b0(R+h+(H?k:-k)/P,Z[0][1])*P;S=Math.max(S,D)}if(F){let D=0;if(!H&&!Y||H&&!Y&&L)D=b0(R+v/P,F[1][1])*P;else D=D0(R+(H?k:-k)/P,F[0][1])*P;S=Math.max(S,D)}}if(K){let V=e5(E*P,O,T)/P;if(b=Math.max(b,V),Z){let D=0;if(!H&&!Y||Y&&!H&&L)D=D0(A+E*P+g,Z[1][0])/P;else D=b0(A+(Y?N:-N)*P+g,Z[0][0])/P;b=Math.max(b,D)}if(F){let D=0;if(!H&&!Y||Y&&!H&&L)D=b0(A+E*P,F[1][0])/P;else D=D0(A+(Y?N:-N)*P,F[0][0])/P;b=Math.max(b,D)}}}if(N=N+(N<0?b:-b),k=k+(k<0?S:-S),U)if(L)if(v>E*P)N=(q7(H,Y)?-k:k)/P;else k=(q7(H,Y)?-N:N)*P;else if(X)N=k/P,Y=H;else k=N*P,H=Y;let j=H?A+k:A,x=Y?R+N:R;return{width:I+(H?-k:k),height:C+(Y?-N:N),x:G[0]*k*(!H?1:-1)+j,y:G[1]*N*(!Y?1:-1)+x}}var b7={width:0,height:0,x:0,y:0},Dq={...b7,pointerX:0,pointerY:0,aspectRatio:1};function hq(_,Q,J){let q=Q.position.x+_.position.x,U=Q.position.y+_.position.y,G=_.measured.width??0,Z=_.measured.height??0,F=J[0]*G,H=J[1]*Z;return[[q-F,U-H],[q+G-F,U+Z-H]]}function D7({domNode:_,nodeId:Q,getStoreItems:J,onChange:q,onEnd:U}){let G=j1(_),Z={controlDirection:$7("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function F({controlPosition:Y,boundaries:X,keepAspectRatio:K,resizeDirection:L,onResizeStart:z,onResize:W,onResizeEnd:O,shouldResize:T}){let B={...b7},w={...Dq};Z={boundaries:X,resizeDirection:L,keepAspectRatio:K,controlDirection:$7(Y)};let A=void 0,R=null,I=[],C=void 0,P=void 0,k=void 0,N=s2().on("start",(v)=>{let{nodeLookup:E,transform:g,snapGrid:h,snapToGrid:S,nodeOrigin:b,paneDomNode:j}=J();if(A=E.get(Q),!A)return;R=j?.getBoundingClientRect()??null;let{xSnapped:x,ySnapped:V}=z5(v.sourceEvent,{transform:g,snapGrid:h,snapToGrid:S,containerBounds:R});if(B={width:A.measured.width??0,height:A.measured.height??0,x:A.position.x??0,y:A.position.y??0},w={...B,pointerX:x,pointerY:V,aspectRatio:B.width/B.height},C=void 0,P=G2(A.extent)?A.extent:void 0,A.parentId&&(A.extent==="parent"||A.expandParent))C=E.get(A.parentId);if(C&&A.extent==="parent")P=[[0,0],[C.measured.width,C.measured.height]];I=[],k=void 0;for(let[D,f]of E)if(f.parentId===Q){if(I.push({id:D,position:{...f.position},extent:f.extent}),f.extent==="parent"||f.expandParent){let y=hq(f,A,f.origin??b);if(k)k=[[Math.min(y[0][0],k[0][0]),Math.min(y[0][1],k[0][1])],[Math.max(y[1][0],k[1][0]),Math.max(y[1][1],k[1][1])]];else k=y}}z?.(v,{...B})}).on("drag",(v)=>{let{transform:E,snapGrid:g,snapToGrid:h,nodeOrigin:S}=J(),b=z5(v.sourceEvent,{transform:E,snapGrid:g,snapToGrid:h,containerBounds:R}),j=[];if(!A)return;let{x,y:V,width:D,height:f}=B,y={},p=A.origin??S,{width:u,height:s,x:t,y:a}=bq(w,Z.controlDirection,b,Z.boundaries,Z.keepAspectRatio,p,P,k),d=u!==D,c=s!==f,e=t!==x&&d,Q1=a!==V&&c;if(!e&&!Q1&&!d&&!c)return;let G1={prevValues:{...B},startX:w.x,startY:w.y,childNodes:I.map((K1)=>({...K1,position:{...K1.position}}))};if(e||Q1||p[0]===1||p[1]===1){if(y.x=e?t:B.x,y.y=Q1?a:B.y,B.x=y.x,B.y=y.y,I.length>0){let K1=t-x,o=a-V;for(let z1 of I)z1.position={x:z1.position.x-K1+p[0]*(u-D),y:z1.position.y-o+p[1]*(s-f)},j.push(z1)}}if(d||c)y.width=d&&(!Z.resizeDirection||Z.resizeDirection==="horizontal")?u:B.width,y.height=c&&(!Z.resizeDirection||Z.resizeDirection==="vertical")?s:B.height,B.width=y.width,B.height=y.height;if(C&&A.expandParent){let K1=p[0]*(y.width??0);if(y.x&&y.x<K1)B.x=K1,w.x=w.x-(y.x-K1);let o=p[1]*(y.height??0);if(y.y&&y.y<o)B.y=o,w.y=w.y-(y.y-o)}let $1=uq({width:B.width,prevWidth:D,height:B.height,prevHeight:f,affectsX:Z.controlDirection.affectsX,affectsY:Z.controlDirection.affectsY}),Z1={...B,direction:$1};if(T?.(v,Z1)===!1){B=G1.prevValues,w.x=G1.startX,w.y=G1.startY,I.forEach((K1,o)=>{K1.position=G1.childNodes[o].position});return}W?.(v,Z1),q(y,j)}).on("end",(v)=>{O?.(v,{...B}),U?.({...B})});G.call(N)}function H(){G.on(".drag",null)}return{update:F,destroy:H}}var p7=h1(X0(),1),c7=h1(E7(),1);var x7=(_)=>{let Q,J=new Set,q=(X,K)=>{let L=typeof X==="function"?X(Q):X;if(!Object.is(L,Q)){let z=Q;Q=(K!=null?K:typeof L!=="object"||L===null)?L:Object.assign({},Q,L),J.forEach((W)=>W(Q,z))}},U=()=>Q,H={setState:q,getState:U,getInitialState:()=>Y,subscribe:(X)=>{return J.add(X),()=>J.delete(X)},destroy:()=>{if((import.meta.env?import.meta.env.MODE: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.");J.clear()}},Y=Q=_(q,U,H);return H},m7=(_)=>_?x7(_):x7;var{useDebugValue:mq}=p7.default,{useSyncExternalStoreWithSelector:gq}=c7.default,pq=(_)=>_;function S6(_,Q=pq,J){let q=gq(_.subscribe,_.getState,_.getServerState||_.getInitialState,Q,J);return mq(q),q}var g7=(_,Q)=>{let J=m7(_),q=(U,G=Q)=>S6(J,U,G);return Object.assign(q,J),q},l7=(_,Q)=>_?g7(_,Q):g7;function P1(_,Q){if(Object.is(_,Q))return!0;if(typeof _!=="object"||_===null||typeof Q!=="object"||Q===null)return!1;if(_ instanceof Map&&Q instanceof Map){if(_.size!==Q.size)return!1;for(let[q,U]of _)if(!Object.is(U,Q.get(q)))return!1;return!0}if(_ instanceof Set&&Q instanceof Set){if(_.size!==Q.size)return!1;for(let q of _)if(!Q.has(q))return!1;return!0}let J=Object.keys(_);if(J.length!==Object.keys(Q).length)return!1;for(let q of J)if(!Object.prototype.hasOwnProperty.call(Q,q)||!Object.is(_[q],Q[q]))return!1;return!0}var R9=h1(d7(),1),M4=r.createContext(null),rq=M4.Provider,O9=i1.error001("react");function M1(_,Q){let J=r.useContext(M4);if(J===null)throw Error(O9);return S6(J,_,Q)}function N1(){let _=r.useContext(M4);if(_===null)throw Error(O9);return r.useMemo(()=>({getState:_.getState,setState:_.setState,subscribe:_.subscribe}),[_])}var a7={display:"none"},iq={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},f9="react-flow__node-desc",I9="react-flow__edge-desc",dq="react-flow__aria-live",aq=(_)=>_.ariaLiveMessage,sq=(_)=>_.ariaLabelConfig;function tq({rfId:_}){let Q=M1(aq);return l.jsx("div",{id:`${dq}-${_}`,"aria-live":"assertive","aria-atomic":"true",style:iq,children:Q})}function oq({rfId:_,disableKeyboardA11y:Q}){let J=M1(sq);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`${f9}-${_}`,style:a7,children:Q?J["node.a11yDescription.default"]:J["node.a11yDescription.keyboardDisabled"]}),l.jsx("div",{id:`${I9}-${_}`,style:a7,children:J["edge.a11yDescription.default"]}),!Q&&l.jsx(tq,{rfId:_})]})}var K2=r.forwardRef(({position:_="top-left",children:Q,className:J,style:q,...U},G)=>{let Z=`${_}`.split("-");return l.jsx("div",{className:C1(["react-flow__panel",J,...Z]),style:q,ref:G,...U,children:Q})});K2.displayName="Panel";var s7="https://reactflow.dev/attribution";function nq({proOptions:_,position:Q="bottom-right"}){if(r.useEffect(()=>{L7("react")},[]),_?.hideAttribution)return null;return l.jsx(K2,{position:Q,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${s7}`,children:l.jsx("a",{href:s7,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var eq=(_)=>{let Q=[],J=[];for(let[,q]of _.nodeLookup)if(q.selected)Q.push(q.internals.userNode);for(let[,q]of _.edgeLookup)if(q.selected)J.push(q);return{selectedNodes:Q,selectedEdges:J}},z4=(_)=>_.id;function _U(_,Q){return P1(_.selectedNodes.map(z4),Q.selectedNodes.map(z4))&&P1(_.selectedEdges.map(z4),Q.selectedEdges.map(z4))}function QU({onSelectionChange:_}){let Q=N1(),{selectedNodes:J,selectedEdges:q}=M1(eq,_U);return r.useEffect(()=>{let U={nodes:J,edges:q};_?.(U),Q.getState().onSelectionChangeHandlers.forEach((G)=>G(U))},[J,q,_]),null}var JU=(_)=>!!_.onSelectionChangeHandlers;function $U({onSelectionChange:_}){let Q=M1(JU);if(_||Q)return l.jsx(QU,{onSelectionChange:_});return null}var w9=[0,0],qU={x:0,y:0,zoom:1},UU=["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"],t7=[...UU,"rfId"],GU=(_)=>({setNodes:_.setNodes,setEdges:_.setEdges,setMinZoom:_.setMinZoom,setMaxZoom:_.setMaxZoom,setTranslateExtent:_.setTranslateExtent,setNodeExtent:_.setNodeExtent,reset:_.reset,setDefaultNodesAndEdges:_.setDefaultNodesAndEdges}),o7={translateExtent:v2,nodeOrigin:w9,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ZU(_){let{setNodes:Q,setEdges:J,setMinZoom:q,setMaxZoom:U,setTranslateExtent:G,setNodeExtent:Z,reset:F,setDefaultNodesAndEdges:H}=M1(GU,P1),Y=N1();r.useEffect(()=>{return H(_.defaultNodes,_.defaultEdges),()=>{X.current=o7,F()}},[]);let X=r.useRef(o7);return r.useEffect(()=>{for(let K of t7){let L=_[K],z=X.current[K];if(L===z)continue;if(typeof _[K]>"u")continue;if(K==="nodes")Q(L);else if(K==="edges")J(L);else if(K==="minZoom")q(L);else if(K==="maxZoom")U(L);else if(K==="translateExtent")G(L);else if(K==="nodeExtent")Z(L);else if(K==="ariaLabelConfig")Y.setState({ariaLabelConfig:Y7(L)});else if(K==="fitView")Y.setState({fitViewQueued:L});else if(K==="fitViewOptions")Y.setState({fitViewOptions:L});else Y.setState({[K]:L})}X.current=_},t7.map((K)=>_[K])),null}function n7(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function FU(_){let[Q,J]=r.useState(_==="system"?null:_);return r.useEffect(()=>{if(_!=="system"){J(_);return}let q=n7(),U=()=>J(q?.matches?"dark":"light");return U(),q?.addEventListener("change",U),()=>{q?.removeEventListener("change",U)}},[_]),Q!==null?Q:n7()?.matches?"dark":"light"}var e7=typeof document<"u"?document:null;function T5(_=null,Q={target:e7,actInsideInputWithModifier:!0}){let[J,q]=r.useState(!1),U=r.useRef(!1),G=r.useRef(new Set([])),[Z,F]=r.useMemo(()=>{if(_!==null){let Y=(Array.isArray(_)?_:[_]).filter((K)=>typeof K==="string").map((K)=>K.replace(/\+/g,`
|
|
27
|
+
<%s key={someKey} {...props} />`,u,t,a,t),h[t+u]=!0)}if(t=null,m!==void 0&&(J(m),t=""+m),Z(v)&&(J(v.key),t=""+v.key),"key"in v){m={};for(var g in v)g!=="key"&&(m[g]=v[g])}else m=v;return t&&F(m,typeof I==="function"?I.displayName||I.name||"Unknown":I),Y(I,t,m,U(),n,e)}function H(I){L(I)?I._store&&(I._store.validated=1):typeof I==="object"&&I!==null&&I.$$typeof===S&&(I._payload.status==="fulfilled"?L(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function L(I){return typeof I==="object"&&I!==null&&I.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),A=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),y=Symbol.for("react.client.reference"),D=Y2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,l=Object.prototype.hasOwnProperty,p=Array.isArray,k=console.createTask?console.createTask:function(){return null};Y2={react_stack_bottom_frame:function(I){return I()}};var b,j={},E=Y2.react_stack_bottom_frame.bind(Y2,G)(),V=k(q(G)),h={};WZ.Fragment=O,WZ.jsxDEV=function(I,v,m,u){var n=1e4>D.recentlyCreatedOwnerStacks++;return K(I,v,m,u,n?Error("react-stack-top-frame"):E,n?k(q(I)):V)}})()});var r=g1(L0(),1);var i=g1(X8(),1),d=g1(L0(),1);function v1(_){if(typeof _==="string"||typeof _==="number")return""+_;let Q="";if(Array.isArray(_)){for(let J=0,q;J<_.length;J++)if((q=v1(_[J]))!=="")Q+=(Q&&" ")+q}else for(let J in _)if(_[J])Q+=(Q&&" ")+J;return Q}var aQ={value:()=>{}};function L8(){for(var _=0,Q=arguments.length,J={},q;_<Q;++_){if(!(q=arguments[_]+"")||q in J||/[\s.]/.test(q))throw Error("illegal type: "+q);J[q]=[]}return new b5(J)}function b5(_){this._=_}function sQ(_,Q){return _.trim().split(/^|\s+/).map(function(J){var q="",U=J.indexOf(".");if(U>=0)q=J.slice(U+1),J=J.slice(0,U);if(J&&!Q.hasOwnProperty(J))throw Error("unknown type: "+J);return{type:J,name:q}})}b5.prototype=L8.prototype={constructor:b5,on:function(_,Q){var J=this._,q=sQ(_+"",J),U,G=-1,Z=q.length;if(arguments.length<2){while(++G<Z)if((U=(_=q[G]).type)&&(U=tQ(J[U],_.name)))return U;return}if(Q!=null&&typeof Q!=="function")throw Error("invalid callback: "+Q);while(++G<Z)if(U=(_=q[G]).type)J[U]=Y8(J[U],_.name,Q);else if(Q==null)for(U in J)J[U]=Y8(J[U],_.name,null);return this},copy:function(){var _={},Q=this._;for(var J in Q)_[J]=Q[J].slice();return new b5(_)},call:function(_,Q){if((U=arguments.length-2)>0)for(var J=Array(U),q=0,U,G;q<U;++q)J[q]=arguments[q+2];if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(G=this._[_],q=0,U=G.length;q<U;++q)G[q].value.apply(Q,J)},apply:function(_,Q,J){if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(var q=this._[_],U=0,G=q.length;U<G;++U)q[U].value.apply(Q,J)}};function tQ(_,Q){for(var J=0,q=_.length,U;J<q;++J)if((U=_[J]).name===Q)return U.value}function Y8(_,Q,J){for(var q=0,U=_.length;q<U;++q)if(_[q].name===Q){_[q]=aQ,_=_.slice(0,q).concat(_.slice(q+1));break}if(J!=null)_.push({name:Q,value:J});return _}var t0=L8;function I2(_){return function(){return this.matches(_)}}function D5(_){return function(Q){return Q.matches(_)}}var h5="http://www.w3.org/1999/xhtml",h4={svg:"http://www.w3.org/2000/svg",xhtml:h5,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function z0(_){var Q=_+="",J=Q.indexOf(":");if(J>=0&&(Q=_.slice(0,J))!=="xmlns")_=_.slice(J+1);return h4.hasOwnProperty(Q)?{space:h4[Q],local:_}:_}function E4(_){let Q;while(Q=_.sourceEvent)_=Q;return _}function c1(_,Q){if(_=E4(_),Q===void 0)Q=_.currentTarget;if(Q){var J=Q.ownerSVGElement||Q;if(J.createSVGPoint){var q=J.createSVGPoint();return q.x=_.clientX,q.y=_.clientY,q=q.matrixTransform(Q.getScreenCTM().inverse()),[q.x,q.y]}if(Q.getBoundingClientRect){var U=Q.getBoundingClientRect();return[_.clientX-U.left-Q.clientLeft,_.clientY-U.top-Q.clientTop]}}return[_.pageX,_.pageY]}function oQ(){}function V0(_){return _==null?oQ:function(){return this.querySelector(_)}}function x4(_){if(typeof _!=="function")_=V0(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=Array(Z),X,Y,K=0;K<Z;++K)if((X=G[K])&&(Y=_.call(X,X.__data__,K,G))){if("__data__"in X)Y.__data__=X.__data__;F[K]=Y}return new y1(q,this._parents)}function m4(_){return _==null?[]:Array.isArray(_)?_:Array.from(_)}function nQ(){return[]}function f2(_){return _==null?nQ:function(){return this.querySelectorAll(_)}}function eQ(_){return function(){return m4(_.apply(this,arguments))}}function g4(_){if(typeof _==="function")_=eQ(_);else _=f2(_);for(var Q=this._groups,J=Q.length,q=[],U=[],G=0;G<J;++G)for(var Z=Q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y])q.push(_.call(X,X.__data__,Y,Z)),U.push(X);return new y1(q,U)}var _J=Array.prototype.find;function QJ(_){return function(){return _J.call(this.children,_)}}function JJ(){return this.firstElementChild}function p4(_){return this.select(_==null?JJ:QJ(typeof _==="function"?_:D5(_)))}var $J=Array.prototype.filter;function qJ(){return Array.from(this.children)}function UJ(_){return function(){return $J.call(this.children,_)}}function c4(_){return this.selectAll(_==null?qJ:UJ(typeof _==="function"?_:D5(_)))}function l4(_){if(typeof _!=="function")_=I2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],X,Y=0;Y<Z;++Y)if((X=G[Y])&&_.call(X,X.__data__,Y,G))F.push(X);return new y1(q,this._parents)}function i2(_){return Array(_.length)}function r4(){return new y1(this._enter||this._groups.map(i2),this._parents)}function d2(_,Q){this.ownerDocument=_.ownerDocument,this.namespaceURI=_.namespaceURI,this._next=null,this._parent=_,this.__data__=Q}d2.prototype={constructor:d2,appendChild:function(_){return this._parent.insertBefore(_,this._next)},insertBefore:function(_,Q){return this._parent.insertBefore(_,Q)},querySelector:function(_){return this._parent.querySelector(_)},querySelectorAll:function(_){return this._parent.querySelectorAll(_)}};function i4(_){return function(){return _}}function GJ(_,Q,J,q,U,G){var Z=0,F,X=Q.length,Y=G.length;for(;Z<Y;++Z)if(F=Q[Z])F.__data__=G[Z],q[Z]=F;else J[Z]=new d2(_,G[Z]);for(;Z<X;++Z)if(F=Q[Z])U[Z]=F}function ZJ(_,Q,J,q,U,G,Z){var F,X,Y=new Map,K=Q.length,H=G.length,L=Array(K),z;for(F=0;F<K;++F)if(X=Q[F])if(L[F]=z=Z.call(X,X.__data__,F,Q)+"",Y.has(z))U[F]=X;else Y.set(z,X);for(F=0;F<H;++F)if(z=Z.call(_,G[F],F,G)+"",X=Y.get(z))q[F]=X,X.__data__=G[F],Y.delete(z);else J[F]=new d2(_,G[F]);for(F=0;F<K;++F)if((X=Q[F])&&Y.get(L[F])===X)U[F]=X}function FJ(_){return _.__data__}function d4(_,Q){if(!arguments.length)return Array.from(this,FJ);var J=Q?ZJ:GJ,q=this._parents,U=this._groups;if(typeof _!=="function")_=i4(_);for(var G=U.length,Z=Array(G),F=Array(G),X=Array(G),Y=0;Y<G;++Y){var K=q[Y],H=U[Y],L=H.length,z=HJ(_.call(K,K&&K.__data__,Y,q)),W=z.length,O=F[Y]=Array(W),R=Z[Y]=Array(W),B=X[Y]=Array(L);J(K,H,O,R,B,z,Q);for(var P=0,A=0,T,f;P<W;++P)if(T=O[P]){if(P>=A)A=P+1;while(!(f=R[A])&&++A<W);T._next=f||null}}return Z=new y1(Z,q),Z._enter=F,Z._exit=X,Z}function HJ(_){return typeof _==="object"&&"length"in _?_:Array.from(_)}function a4(){return new y1(this._exit||this._groups.map(i2),this._parents)}function s4(_,Q,J){var q=this.enter(),U=this,G=this.exit();if(typeof _==="function"){if(q=_(q),q)q=q.selection()}else q=q.append(_+"");if(Q!=null){if(U=Q(U),U)U=U.selection()}if(J==null)G.remove();else J(G);return q&&U?q.merge(U).order():U}function t4(_){var Q=_.selection?_.selection():_;for(var J=this._groups,q=Q._groups,U=J.length,G=q.length,Z=Math.min(U,G),F=Array(U),X=0;X<Z;++X)for(var Y=J[X],K=q[X],H=Y.length,L=F[X]=Array(H),z,W=0;W<H;++W)if(z=Y[W]||K[W])L[W]=z;for(;X<U;++X)F[X]=J[X];return new y1(F,this._parents)}function o4(){for(var _=this._groups,Q=-1,J=_.length;++Q<J;)for(var q=_[Q],U=q.length-1,G=q[U],Z;--U>=0;)if(Z=q[U]){if(G&&Z.compareDocumentPosition(G)^4)G.parentNode.insertBefore(Z,G);G=Z}return this}function n4(_){if(!_)_=KJ;function Q(H,L){return H&&L?_(H.__data__,L.__data__):!H-!L}for(var J=this._groups,q=J.length,U=Array(q),G=0;G<q;++G){for(var Z=J[G],F=Z.length,X=U[G]=Array(F),Y,K=0;K<F;++K)if(Y=Z[K])X[K]=Y;X.sort(Q)}return new y1(U,this._parents).order()}function KJ(_,Q){return _<Q?-1:_>Q?1:_>=Q?0:NaN}function e4(){var _=arguments[0];return arguments[0]=this,_.apply(null,arguments),this}function _3(){return Array.from(this)}function Q3(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length;U<G;++U){var Z=q[U];if(Z)return Z}return null}function J3(){let _=0;for(let Q of this)++_;return _}function $3(){return!this.node()}function q3(_){for(var Q=this._groups,J=0,q=Q.length;J<q;++J)for(var U=Q[J],G=0,Z=U.length,F;G<Z;++G)if(F=U[G])_.call(F,F.__data__,G,U);return this}function XJ(_){return function(){this.removeAttribute(_)}}function YJ(_){return function(){this.removeAttributeNS(_.space,_.local)}}function LJ(_,Q){return function(){this.setAttribute(_,Q)}}function zJ(_,Q){return function(){this.setAttributeNS(_.space,_.local,Q)}}function WJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttribute(_);else this.setAttribute(_,J)}}function AJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttributeNS(_.space,_.local);else this.setAttributeNS(_.space,_.local,J)}}function U3(_,Q){var J=z0(_);if(arguments.length<2){var q=this.node();return J.local?q.getAttributeNS(J.space,J.local):q.getAttribute(J)}return this.each((Q==null?J.local?YJ:XJ:typeof Q==="function"?J.local?AJ:WJ:J.local?zJ:LJ)(J,Q))}function a2(_){return _.ownerDocument&&_.ownerDocument.defaultView||_.document&&_||_.defaultView}function BJ(_){return function(){this.style.removeProperty(_)}}function MJ(_,Q,J){return function(){this.style.setProperty(_,Q,J)}}function TJ(_,Q,J){return function(){var q=Q.apply(this,arguments);if(q==null)this.style.removeProperty(_);else this.style.setProperty(_,q,J)}}function G3(_,Q,J){return arguments.length>1?this.each((Q==null?BJ:typeof Q==="function"?TJ:MJ)(_,Q,J==null?"":J)):u0(this.node(),_)}function u0(_,Q){return _.style.getPropertyValue(Q)||a2(_).getComputedStyle(_,null).getPropertyValue(Q)}function RJ(_){return function(){delete this[_]}}function OJ(_,Q){return function(){this[_]=Q}}function IJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)delete this[_];else this[_]=J}}function Z3(_,Q){return arguments.length>1?this.each((Q==null?RJ:typeof Q==="function"?IJ:OJ)(_,Q)):this.node()[_]}function z8(_){return _.trim().split(/^|\s+/)}function F3(_){return _.classList||new W8(_)}function W8(_){this._node=_,this._names=z8(_.getAttribute("class")||"")}W8.prototype={add:function(_){var Q=this._names.indexOf(_);if(Q<0)this._names.push(_),this._node.setAttribute("class",this._names.join(" "))},remove:function(_){var Q=this._names.indexOf(_);if(Q>=0)this._names.splice(Q,1),this._node.setAttribute("class",this._names.join(" "))},contains:function(_){return this._names.indexOf(_)>=0}};function A8(_,Q){var J=F3(_),q=-1,U=Q.length;while(++q<U)J.add(Q[q])}function B8(_,Q){var J=F3(_),q=-1,U=Q.length;while(++q<U)J.remove(Q[q])}function fJ(_){return function(){A8(this,_)}}function wJ(_){return function(){B8(this,_)}}function PJ(_,Q){return function(){(Q.apply(this,arguments)?A8:B8)(this,_)}}function H3(_,Q){var J=z8(_+"");if(arguments.length<2){var q=F3(this.node()),U=-1,G=J.length;while(++U<G)if(!q.contains(J[U]))return!1;return!0}return this.each((typeof Q==="function"?PJ:Q?fJ:wJ)(J,Q))}function NJ(){this.textContent=""}function CJ(_){return function(){this.textContent=_}}function SJ(_){return function(){var Q=_.apply(this,arguments);this.textContent=Q==null?"":Q}}function K3(_){return arguments.length?this.each(_==null?NJ:(typeof _==="function"?SJ:CJ)(_)):this.node().textContent}function kJ(){this.innerHTML=""}function vJ(_){return function(){this.innerHTML=_}}function yJ(_){return function(){var Q=_.apply(this,arguments);this.innerHTML=Q==null?"":Q}}function X3(_){return arguments.length?this.each(_==null?kJ:(typeof _==="function"?yJ:vJ)(_)):this.node().innerHTML}function jJ(){if(this.nextSibling)this.parentNode.appendChild(this)}function Y3(){return this.each(jJ)}function VJ(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function L3(){return this.each(VJ)}function uJ(_){return function(){var Q=this.ownerDocument,J=this.namespaceURI;return J===h5&&Q.documentElement.namespaceURI===h5?Q.createElement(_):Q.createElementNS(J,_)}}function bJ(_){return function(){return this.ownerDocument.createElementNS(_.space,_.local)}}function s2(_){var Q=z0(_);return(Q.local?bJ:uJ)(Q)}function z3(_){var Q=typeof _==="function"?_:s2(_);return this.select(function(){return this.appendChild(Q.apply(this,arguments))})}function DJ(){return null}function W3(_,Q){var J=typeof _==="function"?_:s2(_),q=Q==null?DJ:typeof Q==="function"?Q:V0(Q);return this.select(function(){return this.insertBefore(J.apply(this,arguments),q.apply(this,arguments)||null)})}function hJ(){var _=this.parentNode;if(_)_.removeChild(this)}function A3(){return this.each(hJ)}function EJ(){var _=this.cloneNode(!1),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function xJ(){var _=this.cloneNode(!0),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function B3(_){return this.select(_?xJ:EJ)}function M3(_){return arguments.length?this.property("__data__",_):this.node().__data__}function mJ(_){return function(Q){_.call(this,Q,this.__data__)}}function gJ(_){return _.trim().split(/^|\s+/).map(function(Q){var J="",q=Q.indexOf(".");if(q>=0)J=Q.slice(q+1),Q=Q.slice(0,q);return{type:Q,name:J}})}function pJ(_){return function(){var Q=this.__on;if(!Q)return;for(var J=0,q=-1,U=Q.length,G;J<U;++J)if(G=Q[J],(!_.type||G.type===_.type)&&G.name===_.name)this.removeEventListener(G.type,G.listener,G.options);else Q[++q]=G;if(++q)Q.length=q;else delete this.__on}}function cJ(_,Q,J){return function(){var q=this.__on,U,G=mJ(Q);if(q){for(var Z=0,F=q.length;Z<F;++Z)if((U=q[Z]).type===_.type&&U.name===_.name){this.removeEventListener(U.type,U.listener,U.options),this.addEventListener(U.type,U.listener=G,U.options=J),U.value=Q;return}}if(this.addEventListener(_.type,G,J),U={type:_.type,name:_.name,value:Q,listener:G,options:J},!q)this.__on=[U];else q.push(U)}}function T3(_,Q,J){var q=gJ(_+""),U,G=q.length,Z;if(arguments.length<2){var F=this.node().__on;if(F){for(var X=0,Y=F.length,K;X<Y;++X)for(U=0,K=F[X];U<G;++U)if((Z=q[U]).type===K.type&&Z.name===K.name)return K.value}return}F=Q?cJ:pJ;for(U=0;U<G;++U)this.each(F(q[U],Q,J));return this}function M8(_,Q,J){var q=a2(_),U=q.CustomEvent;if(typeof U==="function")U=new U(Q,J);else if(U=q.document.createEvent("Event"),J)U.initEvent(Q,J.bubbles,J.cancelable),U.detail=J.detail;else U.initEvent(Q,!1,!1);_.dispatchEvent(U)}function lJ(_,Q){return function(){return M8(this,_,Q)}}function rJ(_,Q){return function(){return M8(this,_,Q.apply(this,arguments))}}function R3(_,Q){return this.each((typeof Q==="function"?rJ:lJ)(_,Q))}function*O3(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length,Z;U<G;++U)if(Z=q[U])yield Z}var I3=[null];function y1(_,Q){this._groups=_,this._parents=Q}function T8(){return new y1([[document.documentElement]],I3)}function iJ(){return this}y1.prototype=T8.prototype={constructor:y1,select:x4,selectAll:g4,selectChild:p4,selectChildren:c4,filter:l4,data:d4,enter:r4,exit:a4,join:s4,merge:t4,selection:iJ,order:o4,sort:n4,call:e4,nodes:_3,node:Q3,size:J3,empty:$3,each:q3,attr:U3,style:G3,property:Z3,classed:H3,text:K3,html:X3,raise:Y3,lower:L3,append:z3,insert:W3,remove:A3,clone:B3,datum:M3,on:T3,dispatch:R3,[Symbol.iterator]:O3};var O0=T8;function D1(_){return typeof _==="string"?new y1([[document.querySelector(_)]],[document.documentElement]):new y1([[_]],I3)}var R8={passive:!1},o0={capture:!0,passive:!1};function E5(_){_.stopImmediatePropagation()}function I0(_){_.preventDefault(),_.stopImmediatePropagation()}function w2(_){var Q=_.document.documentElement,J=D1(_).on("dragstart.drag",I0,o0);if("onselectstart"in Q)J.on("selectstart.drag",I0,o0);else Q.__noselect=Q.style.MozUserSelect,Q.style.MozUserSelect="none"}function t2(_,Q){var J=_.document.documentElement,q=D1(_).on("dragstart.drag",null);if(Q)q.on("click.drag",I0,o0),setTimeout(function(){q.on("click.drag",null)},0);if("onselectstart"in J)q.on("selectstart.drag",null);else J.style.MozUserSelect=J.__noselect,delete J.__noselect}var o2=(_)=>()=>_;function n2(_,{sourceEvent:Q,subject:J,target:q,identifier:U,active:G,x:Z,y:F,dx:X,dy:Y,dispatch:K}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},subject:{value:J,enumerable:!0,configurable:!0},target:{value:q,enumerable:!0,configurable:!0},identifier:{value:U,enumerable:!0,configurable:!0},active:{value:G,enumerable:!0,configurable:!0},x:{value:Z,enumerable:!0,configurable:!0},y:{value:F,enumerable:!0,configurable:!0},dx:{value:X,enumerable:!0,configurable:!0},dy:{value:Y,enumerable:!0,configurable:!0},_:{value:K}})}n2.prototype.on=function(){var _=this._.on.apply(this._,arguments);return _===this._?this:_};function dJ(_){return!_.ctrlKey&&!_.button}function aJ(){return this.parentNode}function sJ(_,Q){return Q==null?{x:_.x,y:_.y}:Q}function tJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function e2(){var _=dJ,Q=aJ,J=sJ,q=tJ,U={},G=t0("start","drag","end"),Z=0,F,X,Y,K,H=0;function L(T){T.on("mousedown.drag",z).filter(q).on("touchstart.drag",R).on("touchmove.drag",B,R8).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function z(T,f){if(K||!_.call(this,T,f))return;var C=A(this,Q.call(this,T,f),T,f,"mouse");if(!C)return;D1(T.view).on("mousemove.drag",W,o0).on("mouseup.drag",O,o0),w2(T.view),E5(T),Y=!1,F=T.clientX,X=T.clientY,C("start",T)}function W(T){if(I0(T),!Y){var f=T.clientX-F,C=T.clientY-X;Y=f*f+C*C>H}U.mouse("drag",T)}function O(T){D1(T.view).on("mousemove.drag mouseup.drag",null),t2(T.view,Y),I0(T),U.mouse("end",T)}function R(T,f){if(!_.call(this,T,f))return;var C=T.changedTouches,w=Q.call(this,T,f),S=C.length,N,y;for(N=0;N<S;++N)if(y=A(this,w,T,f,C[N].identifier,C[N]))E5(T),y("start",T,C[N])}function B(T){var f=T.changedTouches,C=f.length,w,S;for(w=0;w<C;++w)if(S=U[f[w].identifier])I0(T),S("drag",T,f[w])}function P(T){var f=T.changedTouches,C=f.length,w,S;if(K)clearTimeout(K);K=setTimeout(function(){K=null},500);for(w=0;w<C;++w)if(S=U[f[w].identifier])E5(T),S("end",T,f[w])}function A(T,f,C,w,S,N){var y=G.copy(),D=c1(N||C,f),l,p,k;if((k=J.call(T,new n2("beforestart",{sourceEvent:C,target:L,identifier:S,active:Z,x:D[0],y:D[1],dx:0,dy:0,dispatch:y}),w))==null)return;return l=k.x-D[0]||0,p=k.y-D[1]||0,function b(j,E,V){var h=D,I;switch(j){case"start":U[S]=b,I=Z++;break;case"end":delete U[S],--Z;case"drag":D=c1(V||E,f),I=Z;break}y.call(j,T,new n2(j,{sourceEvent:E,subject:k,target:L,identifier:S,active:I,x:D[0]+l,y:D[1]+p,dx:D[0]-h[0],dy:D[1]-h[1],dispatch:y}),w)}}return L.filter=function(T){return arguments.length?(_=typeof T==="function"?T:o2(!!T),L):_},L.container=function(T){return arguments.length?(Q=typeof T==="function"?T:o2(T),L):Q},L.subject=function(T){return arguments.length?(J=typeof T==="function"?T:o2(T),L):J},L.touchable=function(T){return arguments.length?(q=typeof T==="function"?T:o2(!!T),L):q},L.on=function(){var T=G.on.apply(G,arguments);return T===G?L:T},L.clickDistance=function(T){return arguments.length?(H=(T=+T)*T,L):Math.sqrt(H)},L}function _5(_,Q,J){_.prototype=Q.prototype=J,J.constructor=_}function f3(_,Q){var J=Object.create(_.prototype);for(var q in Q)J[q]=Q[q];return J}function $5(){}var Q5=0.7,g5=1/Q5,P2="\\s*([+-]?\\d+)\\s*",J5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oJ=/^#([0-9a-f]{3,8})$/,nJ=new RegExp(`^rgb\\(${P2},${P2},${P2}\\)$`),eJ=new RegExp(`^rgb\\(${W0},${W0},${W0}\\)$`),_$=new RegExp(`^rgba\\(${P2},${P2},${P2},${J5}\\)$`),Q$=new RegExp(`^rgba\\(${W0},${W0},${W0},${J5}\\)$`),J$=new RegExp(`^hsl\\(${J5},${W0},${W0}\\)$`),$$=new RegExp(`^hsla\\(${J5},${W0},${W0},${J5}\\)$`),O8={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};_5($5,Z0,{copy(_){return Object.assign(new this.constructor,this,_)},displayable(){return this.rgb().displayable()},hex:I8,formatHex:I8,formatHex8:q$,formatHsl:U$,formatRgb:f8,toString:f8});function I8(){return this.rgb().formatHex()}function q$(){return this.rgb().formatHex8()}function U$(){return k8(this).formatHsl()}function f8(){return this.rgb().formatRgb()}function Z0(_){var Q,J;return _=(_+"").trim().toLowerCase(),(Q=oJ.exec(_))?(J=Q[1].length,Q=parseInt(Q[1],16),J===6?w8(Q):J===3?new s1(Q>>8&15|Q>>4&240,Q>>4&15|Q&240,(Q&15)<<4|Q&15,1):J===8?x5(Q>>24&255,Q>>16&255,Q>>8&255,(Q&255)/255):J===4?x5(Q>>12&15|Q>>8&240,Q>>8&15|Q>>4&240,Q>>4&15|Q&240,((Q&15)<<4|Q&15)/255):null):(Q=nJ.exec(_))?new s1(Q[1],Q[2],Q[3],1):(Q=eJ.exec(_))?new s1(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,1):(Q=_$.exec(_))?x5(Q[1],Q[2],Q[3],Q[4]):(Q=Q$.exec(_))?x5(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,Q[4]):(Q=J$.exec(_))?C8(Q[1],Q[2]/100,Q[3]/100,1):(Q=$$.exec(_))?C8(Q[1],Q[2]/100,Q[3]/100,Q[4]):O8.hasOwnProperty(_)?w8(O8[_]):_==="transparent"?new s1(NaN,NaN,NaN,0):null}function w8(_){return new s1(_>>16&255,_>>8&255,_&255,1)}function x5(_,Q,J,q){if(q<=0)_=Q=J=NaN;return new s1(_,Q,J,q)}function G$(_){if(!(_ instanceof $5))_=Z0(_);if(!_)return new s1;return _=_.rgb(),new s1(_.r,_.g,_.b,_.opacity)}function N2(_,Q,J,q){return arguments.length===1?G$(_):new s1(_,Q,J,q==null?1:q)}function s1(_,Q,J,q){this.r=+_,this.g=+Q,this.b=+J,this.opacity=+q}_5(s1,N2,f3($5,{brighter(_){return _=_==null?g5:Math.pow(g5,_),new s1(this.r*_,this.g*_,this.b*_,this.opacity)},darker(_){return _=_==null?Q5:Math.pow(Q5,_),new s1(this.r*_,this.g*_,this.b*_,this.opacity)},rgb(){return this},clamp(){return new s1(e0(this.r),e0(this.g),e0(this.b),p5(this.opacity))},displayable(){return-0.5<=this.r&&this.r<255.5&&(-0.5<=this.g&&this.g<255.5)&&(-0.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:P8,formatHex:P8,formatHex8:Z$,formatRgb:N8,toString:N8}));function P8(){return`#${n0(this.r)}${n0(this.g)}${n0(this.b)}`}function Z$(){return`#${n0(this.r)}${n0(this.g)}${n0(this.b)}${n0((isNaN(this.opacity)?1:this.opacity)*255)}`}function N8(){let _=p5(this.opacity);return`${_===1?"rgb(":"rgba("}${e0(this.r)}, ${e0(this.g)}, ${e0(this.b)}${_===1?")":`, ${_})`}`}function p5(_){return isNaN(_)?1:Math.max(0,Math.min(1,_))}function e0(_){return Math.max(0,Math.min(255,Math.round(_)||0))}function n0(_){return _=e0(_),(_<16?"0":"")+_.toString(16)}function C8(_,Q,J,q){if(q<=0)_=Q=J=NaN;else if(J<=0||J>=1)_=Q=NaN;else if(Q<=0)_=NaN;return new G0(_,Q,J,q)}function k8(_){if(_ instanceof G0)return new G0(_.h,_.s,_.l,_.opacity);if(!(_ instanceof $5))_=Z0(_);if(!_)return new G0;if(_ instanceof G0)return _;_=_.rgb();var Q=_.r/255,J=_.g/255,q=_.b/255,U=Math.min(Q,J,q),G=Math.max(Q,J,q),Z=NaN,F=G-U,X=(G+U)/2;if(F){if(Q===G)Z=(J-q)/F+(J<q)*6;else if(J===G)Z=(q-Q)/F+2;else Z=(Q-J)/F+4;F/=X<0.5?G+U:2-G-U,Z*=60}else F=X>0&&X<1?0:Z;return new G0(Z,F,X,_.opacity)}function v8(_,Q,J,q){return arguments.length===1?k8(_):new G0(_,Q,J,q==null?1:q)}function G0(_,Q,J,q){this.h=+_,this.s=+Q,this.l=+J,this.opacity=+q}_5(G0,v8,f3($5,{brighter(_){return _=_==null?g5:Math.pow(g5,_),new G0(this.h,this.s,this.l*_,this.opacity)},darker(_){return _=_==null?Q5:Math.pow(Q5,_),new G0(this.h,this.s,this.l*_,this.opacity)},rgb(){var _=this.h%360+(this.h<0)*360,Q=isNaN(_)||isNaN(this.s)?0:this.s,J=this.l,q=J+(J<0.5?J:1-J)*Q,U=2*J-q;return new s1(w3(_>=240?_-240:_+120,U,q),w3(_,U,q),w3(_<120?_+240:_-120,U,q),this.opacity)},clamp(){return new G0(S8(this.h),m5(this.s),m5(this.l),p5(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(){let _=p5(this.opacity);return`${_===1?"hsl(":"hsla("}${S8(this.h)}, ${m5(this.s)*100}%, ${m5(this.l)*100}%${_===1?")":`, ${_})`}`}}));function S8(_){return _=(_||0)%360,_<0?_+360:_}function m5(_){return Math.max(0,Math.min(1,_||0))}function w3(_,Q,J){return(_<60?Q+(J-Q)*_/60:_<180?J:_<240?Q+(J-Q)*(240-_)/60:Q)*255}function P3(_,Q,J,q,U){var G=_*_,Z=G*_;return((1-3*_+3*G-Z)*Q+(4-6*G+3*Z)*J+(1+3*_+3*G-3*Z)*q+Z*U)/6}function N3(_){var Q=_.length-1;return function(J){var q=J<=0?J=0:J>=1?(J=1,Q-1):Math.floor(J*Q),U=_[q],G=_[q+1],Z=q>0?_[q-1]:2*U-G,F=q<Q-1?_[q+2]:2*G-U;return P3((J-q/Q)*Q,Z,U,G,F)}}function C3(_){var Q=_.length;return function(J){var q=Math.floor(((J%=1)<0?++J:J)*Q),U=_[(q+Q-1)%Q],G=_[q%Q],Z=_[(q+1)%Q],F=_[(q+2)%Q];return P3((J-q/Q)*Q,U,G,Z,F)}}var q5=(_)=>()=>_;function F$(_,Q){return function(J){return _+J*Q}}function H$(_,Q,J){return _=Math.pow(_,J),Q=Math.pow(Q,J)-_,J=1/J,function(q){return Math.pow(_+q*Q,J)}}function y8(_){return(_=+_)===1?c5:function(Q,J){return J-Q?H$(Q,J,_):q5(isNaN(Q)?J:Q)}}function c5(_,Q){var J=Q-_;return J?F$(_,J):q5(isNaN(_)?Q:_)}var _2=function _(Q){var J=y8(Q);function q(U,G){var Z=J((U=N2(U)).r,(G=N2(G)).r),F=J(U.g,G.g),X=J(U.b,G.b),Y=c5(U.opacity,G.opacity);return function(K){return U.r=Z(K),U.g=F(K),U.b=X(K),U.opacity=Y(K),U+""}}return q.gamma=_,q}(1);function j8(_){return function(Q){var J=Q.length,q=Array(J),U=Array(J),G=Array(J),Z,F;for(Z=0;Z<J;++Z)F=N2(Q[Z]),q[Z]=F.r||0,U[Z]=F.g||0,G[Z]=F.b||0;return q=_(q),U=_(U),G=_(G),F.opacity=1,function(X){return F.r=q(X),F.g=U(X),F.b=G(X),F+""}}}var K$=j8(N3),X$=j8(C3);function S3(_,Q){if(!Q)Q=[];var J=_?Math.min(Q.length,_.length):0,q=Q.slice(),U;return function(G){for(U=0;U<J;++U)q[U]=_[U]*(1-G)+Q[U]*G;return q}}function V8(_){return ArrayBuffer.isView(_)&&!(_ instanceof DataView)}function u8(_,Q){var J=Q?Q.length:0,q=_?Math.min(J,_.length):0,U=Array(q),G=Array(J),Z;for(Z=0;Z<q;++Z)U[Z]=A0(_[Z],Q[Z]);for(;Z<J;++Z)G[Z]=Q[Z];return function(F){for(Z=0;Z<q;++Z)G[Z]=U[Z](F);return G}}function k3(_,Q){var J=new Date;return _=+_,Q=+Q,function(q){return J.setTime(_*(1-q)+Q*q),J}}function l1(_,Q){return _=+_,Q=+Q,function(J){return _*(1-J)+Q*J}}function v3(_,Q){var J={},q={},U;if(_===null||typeof _!=="object")_={};if(Q===null||typeof Q!=="object")Q={};for(U in Q)if(U in _)J[U]=A0(_[U],Q[U]);else q[U]=Q[U];return function(G){for(U in J)q[U]=J[U](G);return q}}var j3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,y3=new RegExp(j3.source,"g");function Y$(_){return function(){return _}}function L$(_){return function(Q){return _(Q)+""}}function C2(_,Q){var J=j3.lastIndex=y3.lastIndex=0,q,U,G,Z=-1,F=[],X=[];_=_+"",Q=Q+"";while((q=j3.exec(_))&&(U=y3.exec(Q))){if((G=U.index)>J)if(G=Q.slice(J,G),F[Z])F[Z]+=G;else F[++Z]=G;if((q=q[0])===(U=U[0]))if(F[Z])F[Z]+=U;else F[++Z]=U;else F[++Z]=null,X.push({i:Z,x:l1(q,U)});J=y3.lastIndex}if(J<Q.length)if(G=Q.slice(J),F[Z])F[Z]+=G;else F[++Z]=G;return F.length<2?X[0]?L$(X[0].x):Y$(Q):(Q=X.length,function(Y){for(var K=0,H;K<Q;++K)F[(H=X[K]).i]=H.x(Y);return F.join("")})}function A0(_,Q){var J=typeof Q,q;return Q==null||J==="boolean"?q5(Q):(J==="number"?l1:J==="string"?(q=Z0(Q))?(Q=q,_2):C2:Q instanceof Z0?_2:Q instanceof Date?k3:V8(Q)?S3:Array.isArray(Q)?u8:typeof Q.valueOf!=="function"&&typeof Q.toString!=="function"||isNaN(Q)?v3:l1)(_,Q)}var b8=180/Math.PI,l5={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function r5(_,Q,J,q,U,G){var Z,F,X;if(Z=Math.sqrt(_*_+Q*Q))_/=Z,Q/=Z;if(X=_*J+Q*q)J-=_*X,q-=Q*X;if(F=Math.sqrt(J*J+q*q))J/=F,q/=F,X/=F;if(_*q<Q*J)_=-_,Q=-Q,X=-X,Z=-Z;return{translateX:U,translateY:G,rotate:Math.atan2(Q,_)*b8,skewX:Math.atan(X)*b8,scaleX:Z,scaleY:F}}var i5;function D8(_){let Q=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(_+"");return Q.isIdentity?l5:r5(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function h8(_){if(_==null)return l5;if(!i5)i5=document.createElementNS("http://www.w3.org/2000/svg","g");if(i5.setAttribute("transform",_),!(_=i5.transform.baseVal.consolidate()))return l5;return _=_.matrix,r5(_.a,_.b,_.c,_.d,_.e,_.f)}function E8(_,Q,J,q){function U(Y){return Y.length?Y.pop()+" ":""}function G(Y,K,H,L,z,W){if(Y!==H||K!==L){var O=z.push("translate(",null,Q,null,J);W.push({i:O-4,x:l1(Y,H)},{i:O-2,x:l1(K,L)})}else if(H||L)z.push("translate("+H+Q+L+J)}function Z(Y,K,H,L){if(Y!==K){if(Y-K>180)K+=360;else if(K-Y>180)Y+=360;L.push({i:H.push(U(H)+"rotate(",null,q)-2,x:l1(Y,K)})}else if(K)H.push(U(H)+"rotate("+K+q)}function F(Y,K,H,L){if(Y!==K)L.push({i:H.push(U(H)+"skewX(",null,q)-2,x:l1(Y,K)});else if(K)H.push(U(H)+"skewX("+K+q)}function X(Y,K,H,L,z,W){if(Y!==H||K!==L){var O=z.push(U(z)+"scale(",null,",",null,")");W.push({i:O-4,x:l1(Y,H)},{i:O-2,x:l1(K,L)})}else if(H!==1||L!==1)z.push(U(z)+"scale("+H+","+L+")")}return function(Y,K){var H=[],L=[];return Y=_(Y),K=_(K),G(Y.translateX,Y.translateY,K.translateX,K.translateY,H,L),Z(Y.rotate,K.rotate,H,L),F(Y.skewX,K.skewX,H,L),X(Y.scaleX,Y.scaleY,K.scaleX,K.scaleY,H,L),Y=K=null,function(z){var W=-1,O=L.length,R;while(++W<O)H[(R=L[W]).i]=R.x(z);return H.join("")}}}var V3=E8(D8,"px, ","px)","deg)"),u3=E8(h8,", ",")",")");var z$=0.000000000001;function x8(_){return((_=Math.exp(_))+1/_)/2}function W$(_){return((_=Math.exp(_))-1/_)/2}function A$(_){return((_=Math.exp(2*_))-1)/(_+1)}var Q2=function _(Q,J,q){function U(G,Z){var F=G[0],X=G[1],Y=G[2],K=Z[0],H=Z[1],L=Z[2],z=K-F,W=H-X,O=z*z+W*W,R,B;if(O<z$)B=Math.log(L/Y)/Q,R=function(w){return[F+w*z,X+w*W,Y*Math.exp(Q*w*B)]};else{var P=Math.sqrt(O),A=(L*L-Y*Y+q*O)/(2*Y*J*P),T=(L*L-Y*Y-q*O)/(2*L*J*P),f=Math.log(Math.sqrt(A*A+1)-A),C=Math.log(Math.sqrt(T*T+1)-T);B=(C-f)/Q,R=function(w){var S=w*B,N=x8(f),y=Y/(J*P)*(N*A$(Q*S+f)-W$(f));return[F+y*z,X+y*W,Y*N/x8(Q*S+f)]}}return R.duration=B*1000*Q/Math.SQRT2,R}return U.rho=function(G){var Z=Math.max(0.001,+G),F=Z*Z,X=F*F;return _(Z,F,X)},U}(Math.SQRT2,2,4);var S2=0,G5=0,U5=0,g8=1000,d5,Z5,a5=0,J2=0,s5=0,F5=typeof performance==="object"&&performance.now?performance:Date,p8=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_){setTimeout(_,17)};function K5(){return J2||(p8(B$),J2=F5.now()+s5)}function B$(){J2=0}function H5(){this._call=this._time=this._next=null}H5.prototype=t5.prototype={constructor:H5,restart:function(_,Q,J){if(typeof _!=="function")throw TypeError("callback is not a function");if(J=(J==null?K5():+J)+(Q==null?0:+Q),!this._next&&Z5!==this){if(Z5)Z5._next=this;else d5=this;Z5=this}this._call=_,this._time=J,b3()},stop:function(){if(this._call)this._call=null,this._time=1/0,b3()}};function t5(_,Q,J){var q=new H5;return q.restart(_,Q,J),q}function c8(){K5(),++S2;var _=d5,Q;while(_){if((Q=J2-_._time)>=0)_._call.call(void 0,Q);_=_._next}--S2}function m8(){J2=(a5=F5.now())+s5,S2=G5=0;try{c8()}finally{S2=0,T$(),J2=0}}function M$(){var _=F5.now(),Q=_-a5;if(Q>g8)s5-=Q,a5=_}function T$(){var _,Q=d5,J,q=1/0;while(Q)if(Q._call){if(q>Q._time)q=Q._time;_=Q,Q=Q._next}else J=Q._next,Q._next=null,Q=_?_._next=J:d5=J;Z5=_,b3(q)}function b3(_){if(S2)return;if(G5)G5=clearTimeout(G5);var Q=_-J2;if(Q>24){if(_<1/0)G5=setTimeout(m8,_-F5.now()-s5);if(U5)U5=clearInterval(U5)}else{if(!U5)a5=F5.now(),U5=setInterval(M$,g8);S2=1,p8(m8)}}function X5(_,Q,J){var q=new H5;return Q=Q==null?0:+Q,q.restart((U)=>{q.stop(),_(U+Q)},Q,J),q}var R$=t0("start","end","cancel","interrupt"),O$=[],i8=0,l8=1,n5=2,o5=3,r8=4,e5=5,Y5=6;function f0(_,Q,J,q,U,G){var Z=_.__transition;if(!Z)_.__transition={};else if(J in Z)return;I$(_,J,{name:Q,index:q,group:U,on:R$,tween:O$,time:G.time,delay:G.delay,duration:G.duration,ease:G.ease,timer:null,state:i8})}function L5(_,Q){var J=h1(_,Q);if(J.state>i8)throw Error("too late; already scheduled");return J}function p1(_,Q){var J=h1(_,Q);if(J.state>o5)throw Error("too late; already running");return J}function h1(_,Q){var J=_.__transition;if(!J||!(J=J[Q]))throw Error("transition not found");return J}function I$(_,Q,J){var q=_.__transition,U;q[Q]=J,J.timer=t5(G,0,J.time);function G(Y){if(J.state=l8,J.timer.restart(Z,J.delay,J.time),J.delay<=Y)Z(Y-J.delay)}function Z(Y){var K,H,L,z;if(J.state!==l8)return X();for(K in q){if(z=q[K],z.name!==J.name)continue;if(z.state===o5)return X5(Z);if(z.state===r8)z.state=Y5,z.timer.stop(),z.on.call("interrupt",_,_.__data__,z.index,z.group),delete q[K];else if(+K<Q)z.state=Y5,z.timer.stop(),z.on.call("cancel",_,_.__data__,z.index,z.group),delete q[K]}if(X5(function(){if(J.state===o5)J.state=r8,J.timer.restart(F,J.delay,J.time),F(Y)}),J.state=n5,J.on.call("start",_,_.__data__,J.index,J.group),J.state!==n5)return;J.state=o5,U=Array(L=J.tween.length);for(K=0,H=-1;K<L;++K)if(z=J.tween[K].value.call(_,_.__data__,J.index,J.group))U[++H]=z;U.length=H+1}function F(Y){var K=Y<J.duration?J.ease.call(null,Y/J.duration):(J.timer.restart(X),J.state=e5,1),H=-1,L=U.length;while(++H<L)U[H].call(_,K);if(J.state===e5)J.on.call("end",_,_.__data__,J.index,J.group),X()}function X(){J.state=Y5,J.timer.stop(),delete q[Q];for(var Y in q)return;delete _.__transition}}function b0(_,Q){var J=_.__transition,q,U,G=!0,Z;if(!J)return;Q=Q==null?null:Q+"";for(Z in J){if((q=J[Z]).name!==Q){G=!1;continue}U=q.state>n5&&q.state<e5,q.state=Y5,q.timer.stop(),q.on.call(U?"interrupt":"cancel",_,_.__data__,q.index,q.group),delete J[Z]}if(G)delete _.__transition}function D3(_){return this.each(function(){b0(this,_)})}function f$(_,Q){var J,q;return function(){var U=p1(this,_),G=U.tween;if(G!==J){q=J=G;for(var Z=0,F=q.length;Z<F;++Z)if(q[Z].name===Q){q=q.slice(),q.splice(Z,1);break}}U.tween=q}}function w$(_,Q,J){var q,U;if(typeof J!=="function")throw Error();return function(){var G=p1(this,_),Z=G.tween;if(Z!==q){U=(q=Z).slice();for(var F={name:Q,value:J},X=0,Y=U.length;X<Y;++X)if(U[X].name===Q){U[X]=F;break}if(X===Y)U.push(F)}G.tween=U}}function h3(_,Q){var J=this._id;if(_+="",arguments.length<2){var q=h1(this.node(),J).tween;for(var U=0,G=q.length,Z;U<G;++U)if((Z=q[U]).name===_)return Z.value;return null}return this.each((Q==null?f$:w$)(J,_,Q))}function k2(_,Q,J){var q=_._id;return _.each(function(){var U=p1(this,q);(U.value||(U.value={}))[Q]=J.apply(this,arguments)}),function(U){return h1(U,q).value[Q]}}function z5(_,Q){var J;return(typeof Q==="number"?l1:Q instanceof Z0?_2:(J=Z0(Q))?(Q=J,_2):C2)(_,Q)}function P$(_){return function(){this.removeAttribute(_)}}function N$(_){return function(){this.removeAttributeNS(_.space,_.local)}}function C$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttribute(_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function S$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttributeNS(_.space,_.local);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function k$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),X;if(F==null)return void this.removeAttribute(_);return Z=this.getAttribute(_),X=F+"",Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function v$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),X;if(F==null)return void this.removeAttributeNS(_.space,_.local);return Z=this.getAttributeNS(_.space,_.local),X=F+"",Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function E3(_,Q){var J=z0(_),q=J==="transform"?u3:z5;return this.attrTween(_,typeof Q==="function"?(J.local?v$:k$)(J,q,k2(this,"attr."+_,Q)):Q==null?(J.local?N$:P$)(J):(J.local?S$:C$)(J,q,Q))}function y$(_,Q){return function(J){this.setAttribute(_,Q.call(this,J))}}function j$(_,Q){return function(J){this.setAttributeNS(_.space,_.local,Q.call(this,J))}}function V$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&j$(_,G);return J}return U._value=Q,U}function u$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&y$(_,G);return J}return U._value=Q,U}function x3(_,Q){var J="attr."+_;if(arguments.length<2)return(J=this.tween(J))&&J._value;if(Q==null)return this.tween(J,null);if(typeof Q!=="function")throw Error();var q=z0(_);return this.tween(J,(q.local?V$:u$)(q,Q))}function b$(_,Q){return function(){L5(this,_).delay=+Q.apply(this,arguments)}}function D$(_,Q){return Q=+Q,function(){L5(this,_).delay=Q}}function m3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?b$:D$)(Q,_)):h1(this.node(),Q).delay}function h$(_,Q){return function(){p1(this,_).duration=+Q.apply(this,arguments)}}function E$(_,Q){return Q=+Q,function(){p1(this,_).duration=Q}}function g3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?h$:E$)(Q,_)):h1(this.node(),Q).duration}function x$(_,Q){if(typeof Q!=="function")throw Error();return function(){p1(this,_).ease=Q}}function p3(_){var Q=this._id;return arguments.length?this.each(x$(Q,_)):h1(this.node(),Q).ease}function m$(_,Q){return function(){var J=Q.apply(this,arguments);if(typeof J!=="function")throw Error();p1(this,_).ease=J}}function c3(_){if(typeof _!=="function")throw Error();return this.each(m$(this._id,_))}function l3(_){if(typeof _!=="function")_=I2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],X,Y=0;Y<Z;++Y)if((X=G[Y])&&_.call(X,X.__data__,Y,G))F.push(X);return new d1(q,this._parents,this._name,this._id)}function r3(_){if(_._id!==this._id)throw Error();for(var Q=this._groups,J=_._groups,q=Q.length,U=J.length,G=Math.min(q,U),Z=Array(q),F=0;F<G;++F)for(var X=Q[F],Y=J[F],K=X.length,H=Z[F]=Array(K),L,z=0;z<K;++z)if(L=X[z]||Y[z])H[z]=L;for(;F<q;++F)Z[F]=Q[F];return new d1(Z,this._parents,this._name,this._id)}function g$(_){return(_+"").trim().split(/^|\s+/).every(function(Q){var J=Q.indexOf(".");if(J>=0)Q=Q.slice(0,J);return!Q||Q==="start"})}function p$(_,Q,J){var q,U,G=g$(Q)?L5:p1;return function(){var Z=G(this,_),F=Z.on;if(F!==q)(U=(q=F).copy()).on(Q,J);Z.on=U}}function i3(_,Q){var J=this._id;return arguments.length<2?h1(this.node(),J).on.on(_):this.each(p$(J,_,Q))}function c$(_){return function(){var Q=this.parentNode;for(var J in this.__transition)if(+J!==_)return;if(Q)Q.removeChild(this)}}function d3(){return this.on("end.remove",c$(this._id))}function a3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=V0(_);for(var q=this._groups,U=q.length,G=Array(U),Z=0;Z<U;++Z)for(var F=q[Z],X=F.length,Y=G[Z]=Array(X),K,H,L=0;L<X;++L)if((K=F[L])&&(H=_.call(K,K.__data__,L,F))){if("__data__"in K)H.__data__=K.__data__;Y[L]=H,f0(Y[L],Q,J,L,Y,h1(K,J))}return new d1(G,this._parents,Q,J)}function s3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=f2(_);for(var q=this._groups,U=q.length,G=[],Z=[],F=0;F<U;++F)for(var X=q[F],Y=X.length,K,H=0;H<Y;++H)if(K=X[H]){for(var L=_.call(K,K.__data__,H,X),z,W=h1(K,J),O=0,R=L.length;O<R;++O)if(z=L[O])f0(z,Q,J,O,L,W);G.push(L),Z.push(K)}return new d1(G,Z,Q,J)}var l$=O0.prototype.constructor;function t3(){return new l$(this._groups,this._parents)}function r$(_,Q){var J,q,U;return function(){var G=u0(this,_),Z=(this.style.removeProperty(_),u0(this,_));return G===Z?null:G===J&&Z===q?U:U=Q(J=G,q=Z)}}function d8(_){return function(){this.style.removeProperty(_)}}function i$(_,Q,J){var q,U=J+"",G;return function(){var Z=u0(this,_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function d$(_,Q,J){var q,U,G;return function(){var Z=u0(this,_),F=J(this),X=F+"";if(F==null)X=F=(this.style.removeProperty(_),u0(this,_));return Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function a$(_,Q){var J,q,U,G="style."+Q,Z="end."+G,F;return function(){var X=p1(this,_),Y=X.on,K=X.value[G]==null?F||(F=d8(Q)):void 0;if(Y!==J||U!==K)(q=(J=Y).copy()).on(Z,U=K);X.on=q}}function o3(_,Q,J){var q=(_+="")==="transform"?V3:z5;return Q==null?this.styleTween(_,r$(_,q)).on("end.style."+_,d8(_)):typeof Q==="function"?this.styleTween(_,d$(_,q,k2(this,"style."+_,Q))).each(a$(this._id,_)):this.styleTween(_,i$(_,q,Q),J).on("end.style."+_,null)}function s$(_,Q,J){return function(q){this.style.setProperty(_,Q.call(this,q),J)}}function t$(_,Q,J){var q,U;function G(){var Z=Q.apply(this,arguments);if(Z!==U)q=(U=Z)&&s$(_,Z,J);return q}return G._value=Q,G}function n3(_,Q,J){var q="style."+(_+="");if(arguments.length<2)return(q=this.tween(q))&&q._value;if(Q==null)return this.tween(q,null);if(typeof Q!=="function")throw Error();return this.tween(q,t$(_,Q,J==null?"":J))}function o$(_){return function(){this.textContent=_}}function n$(_){return function(){var Q=_(this);this.textContent=Q==null?"":Q}}function e3(_){return this.tween("text",typeof _==="function"?n$(k2(this,"text",_)):o$(_==null?"":_+""))}function e$(_){return function(Q){this.textContent=_.call(this,Q)}}function _q(_){var Q,J;function q(){var U=_.apply(this,arguments);if(U!==J)Q=(J=U)&&e$(U);return Q}return q._value=_,q}function _6(_){var Q="text";if(arguments.length<1)return(Q=this.tween(Q))&&Q._value;if(_==null)return this.tween(Q,null);if(typeof _!=="function")throw Error();return this.tween(Q,_q(_))}function Q6(){var _=this._name,Q=this._id,J=_4();for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y]){var K=h1(X,Q);f0(X,_,J,Y,Z,{time:K.time+K.delay+K.duration,delay:0,duration:K.duration,ease:K.ease})}return new d1(q,this._parents,_,J)}function J6(){var _,Q,J=this,q=J._id,U=J.size();return new Promise(function(G,Z){var F={value:Z},X={value:function(){if(--U===0)G()}};if(J.each(function(){var Y=p1(this,q),K=Y.on;if(K!==_)Q=(_=K).copy(),Q._.cancel.push(F),Q._.interrupt.push(F),Q._.end.push(X);Y.on=Q}),U===0)G()})}var Qq=0;function d1(_,Q,J,q){this._groups=_,this._parents=Q,this._name=J,this._id=q}function a8(_){return O0().transition(_)}function _4(){return++Qq}var w0=O0.prototype;d1.prototype=a8.prototype={constructor:d1,select:a3,selectAll:s3,selectChild:w0.selectChild,selectChildren:w0.selectChildren,filter:l3,merge:r3,selection:t3,transition:Q6,call:w0.call,nodes:w0.nodes,node:w0.node,size:w0.size,empty:w0.empty,each:w0.each,on:i3,attr:E3,attrTween:x3,style:o3,styleTween:n3,text:e3,textTween:_6,remove:d3,tween:h3,delay:m3,duration:g3,ease:p3,easeVarying:c3,end:J6,[Symbol.iterator]:w0[Symbol.iterator]};function Q4(_){return((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2}var Jq={time:null,delay:0,duration:250,ease:Q4};function $q(_,Q){var J;while(!(J=_.__transition)||!(J=J[Q]))if(!(_=_.parentNode))throw Error(`transition ${Q} not found`);return J}function $6(_){var Q,J;if(_ instanceof d1)Q=_._id,_=_._name;else Q=_4(),(J=Jq).time=K5(),_=_==null?null:_+"";for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y])f0(X,_,Q,Y,Z,J||$q(X,Q));return new d1(q,this._parents,_,Q)}O0.prototype.interrupt=D3;O0.prototype.transition=$6;var W5=(_)=>()=>_;function q6(_,{sourceEvent:Q,target:J,transform:q,dispatch:U}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},target:{value:J,enumerable:!0,configurable:!0},transform:{value:q,enumerable:!0,configurable:!0},_:{value:U}})}function F0(_,Q,J){this.k=_,this.x=Q,this.y=J}F0.prototype={constructor:F0,scale:function(_){return _===1?this:new F0(this.k*_,this.x,this.y)},translate:function(_,Q){return _===0&Q===0?this:new F0(this.k,this.x+this.k*_,this.y+this.k*Q)},apply:function(_){return[_[0]*this.k+this.x,_[1]*this.k+this.y]},applyX:function(_){return _*this.k+this.x},applyY:function(_){return _*this.k+this.y},invert:function(_){return[(_[0]-this.x)/this.k,(_[1]-this.y)/this.k]},invertX:function(_){return(_-this.x)/this.k},invertY:function(_){return(_-this.y)/this.k},rescaleX:function(_){return _.copy().domain(_.range().map(this.invertX,this).map(_.invert,_))},rescaleY:function(_){return _.copy().domain(_.range().map(this.invertY,this).map(_.invert,_))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $2=new F0(1,0,0);A5.prototype=F0.prototype;function A5(_){while(!_.__zoom)if(!(_=_.parentNode))return $2;return _.__zoom}function J4(_){_.stopImmediatePropagation()}function q2(_){_.preventDefault(),_.stopImmediatePropagation()}function qq(_){return(!_.ctrlKey||_.type==="wheel")&&!_.button}function Uq(){var _=this;if(_ instanceof SVGElement){if(_=_.ownerSVGElement||_,_.hasAttribute("viewBox"))return _=_.viewBox.baseVal,[[_.x,_.y],[_.x+_.width,_.y+_.height]];return[[0,0],[_.width.baseVal.value,_.height.baseVal.value]]}return[[0,0],[_.clientWidth,_.clientHeight]]}function s8(){return this.__zoom||$2}function Gq(_){return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*(_.ctrlKey?10:1)}function Zq(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fq(_,Q,J){var q=_.invertX(Q[0][0])-J[0][0],U=_.invertX(Q[1][0])-J[1][0],G=_.invertY(Q[0][1])-J[0][1],Z=_.invertY(Q[1][1])-J[1][1];return _.translate(U>q?(q+U)/2:Math.min(0,q)||Math.max(0,U),Z>G?(G+Z)/2:Math.min(0,G)||Math.max(0,Z))}function B5(){var _=qq,Q=Uq,J=Fq,q=Gq,U=Zq,G=[0,1/0],Z=[[-1/0,-1/0],[1/0,1/0]],F=250,X=Q2,Y=t0("start","zoom","end"),K,H,L,z=500,W=150,O=0,R=10;function B(k){k.property("__zoom",s8).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",y).filter(U).on("touchstart.zoom",D).on("touchmove.zoom",l).on("touchend.zoom touchcancel.zoom",p).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}B.transform=function(k,b,j,E){var V=k.selection?k.selection():k;if(V.property("__zoom",s8),k!==V)f(k,b,j,E);else V.interrupt().each(function(){C(this,arguments).event(E).start().zoom(null,typeof b==="function"?b.apply(this,arguments):b).end()})},B.scaleBy=function(k,b,j,E){B.scaleTo(k,function(){var V=this.__zoom.k,h=typeof b==="function"?b.apply(this,arguments):b;return V*h},j,E)},B.scaleTo=function(k,b,j,E){B.transform(k,function(){var V=Q.apply(this,arguments),h=this.__zoom,I=j==null?T(V):typeof j==="function"?j.apply(this,arguments):j,v=h.invert(I),m=typeof b==="function"?b.apply(this,arguments):b;return J(A(P(h,m),I,v),V,Z)},j,E)},B.translateBy=function(k,b,j,E){B.transform(k,function(){return J(this.__zoom.translate(typeof b==="function"?b.apply(this,arguments):b,typeof j==="function"?j.apply(this,arguments):j),Q.apply(this,arguments),Z)},null,E)},B.translateTo=function(k,b,j,E,V){B.transform(k,function(){var h=Q.apply(this,arguments),I=this.__zoom,v=E==null?T(h):typeof E==="function"?E.apply(this,arguments):E;return J($2.translate(v[0],v[1]).scale(I.k).translate(typeof b==="function"?-b.apply(this,arguments):-b,typeof j==="function"?-j.apply(this,arguments):-j),h,Z)},E,V)};function P(k,b){return b=Math.max(G[0],Math.min(G[1],b)),b===k.k?k:new F0(b,k.x,k.y)}function A(k,b,j){var E=b[0]-j[0]*k.k,V=b[1]-j[1]*k.k;return E===k.x&&V===k.y?k:new F0(k.k,E,V)}function T(k){return[(+k[0][0]+ +k[1][0])/2,(+k[0][1]+ +k[1][1])/2]}function f(k,b,j,E){k.on("start.zoom",function(){C(this,arguments).event(E).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(E).end()}).tween("zoom",function(){var V=this,h=arguments,I=C(V,h).event(E),v=Q.apply(V,h),m=j==null?T(v):typeof j==="function"?j.apply(V,h):j,u=Math.max(v[1][0]-v[0][0],v[1][1]-v[0][1]),n=V.__zoom,e=typeof b==="function"?b.apply(V,h):b,t=X(n.invert(m).concat(u/n.k),e.invert(m).concat(u/e.k));return function(a){if(a===1)a=e;else{var g=t(a),J1=u/g[2];a=new F0(J1,m[0]-g[0]*J1,m[1]-g[1]*J1)}I.zoom(null,a)}})}function C(k,b,j){return!j&&k.__zooming||new w(k,b)}function w(k,b){this.that=k,this.args=b,this.active=0,this.sourceEvent=null,this.extent=Q.apply(k,b),this.taps=0}w.prototype={event:function(k){if(k)this.sourceEvent=k;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(k,b){if(this.mouse&&k!=="mouse")this.mouse[1]=b.invert(this.mouse[0]);if(this.touch0&&k!=="touch")this.touch0[1]=b.invert(this.touch0[0]);if(this.touch1&&k!=="touch")this.touch1[1]=b.invert(this.touch1[0]);return this.that.__zoom=b,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(k){var b=D1(this.that).datum();Y.call(k,this.that,new q6(k,{sourceEvent:this.sourceEvent,target:B,type:k,transform:this.that.__zoom,dispatch:Y}),b)}};function S(k,...b){if(!_.apply(this,arguments))return;var j=C(this,b).event(k),E=this.__zoom,V=Math.max(G[0],Math.min(G[1],E.k*Math.pow(2,q.apply(this,arguments)))),h=c1(k);if(j.wheel){if(j.mouse[0][0]!==h[0]||j.mouse[0][1]!==h[1])j.mouse[1]=E.invert(j.mouse[0]=h);clearTimeout(j.wheel)}else if(E.k===V)return;else j.mouse=[h,E.invert(h)],b0(this),j.start();q2(k),j.wheel=setTimeout(I,W),j.zoom("mouse",J(A(P(E,V),j.mouse[0],j.mouse[1]),j.extent,Z));function I(){j.wheel=null,j.end()}}function N(k,...b){if(L||!_.apply(this,arguments))return;var j=k.currentTarget,E=C(this,b,!0).event(k),V=D1(k.view).on("mousemove.zoom",m,!0).on("mouseup.zoom",u,!0),h=c1(k,j),I=k.clientX,v=k.clientY;w2(k.view),J4(k),E.mouse=[h,this.__zoom.invert(h)],b0(this),E.start();function m(n){if(q2(n),!E.moved){var e=n.clientX-I,t=n.clientY-v;E.moved=e*e+t*t>O}E.event(n).zoom("mouse",J(A(E.that.__zoom,E.mouse[0]=c1(n,j),E.mouse[1]),E.extent,Z))}function u(n){V.on("mousemove.zoom mouseup.zoom",null),t2(n.view,E.moved),q2(n),E.event(n).end()}}function y(k,...b){if(!_.apply(this,arguments))return;var j=this.__zoom,E=c1(k.changedTouches?k.changedTouches[0]:k,this),V=j.invert(E),h=j.k*(k.shiftKey?0.5:2),I=J(A(P(j,h),E,V),Q.apply(this,b),Z);if(q2(k),F>0)D1(this).transition().duration(F).call(f,I,E,k);else D1(this).call(B.transform,I,E,k)}function D(k,...b){if(!_.apply(this,arguments))return;var j=k.touches,E=j.length,V=C(this,b,k.changedTouches.length===E).event(k),h,I,v,m;J4(k);for(I=0;I<E;++I)if(v=j[I],m=c1(v,this),m=[m,this.__zoom.invert(m),v.identifier],!V.touch0)V.touch0=m,h=!0,V.taps=1+!!K;else if(!V.touch1&&V.touch0[2]!==m[2])V.touch1=m,V.taps=0;if(K)K=clearTimeout(K);if(h){if(V.taps<2)H=m[0],K=setTimeout(function(){K=null},z);b0(this),V.start()}}function l(k,...b){if(!this.__zooming)return;var j=C(this,b).event(k),E=k.changedTouches,V=E.length,h,I,v,m;q2(k);for(h=0;h<V;++h)if(I=E[h],v=c1(I,this),j.touch0&&j.touch0[2]===I.identifier)j.touch0[0]=v;else if(j.touch1&&j.touch1[2]===I.identifier)j.touch1[0]=v;if(I=j.that.__zoom,j.touch1){var u=j.touch0[0],n=j.touch0[1],e=j.touch1[0],t=j.touch1[1],a=(a=e[0]-u[0])*a+(a=e[1]-u[1])*a,g=(g=t[0]-n[0])*g+(g=t[1]-n[1])*g;I=P(I,Math.sqrt(a/g)),v=[(u[0]+e[0])/2,(u[1]+e[1])/2],m=[(n[0]+t[0])/2,(n[1]+t[1])/2]}else if(j.touch0)v=j.touch0[0],m=j.touch0[1];else return;j.zoom("touch",J(A(I,v,m),j.extent,Z))}function p(k,...b){if(!this.__zooming)return;var j=C(this,b).event(k),E=k.changedTouches,V=E.length,h,I;if(J4(k),L)clearTimeout(L);L=setTimeout(function(){L=null},z);for(h=0;h<V;++h)if(I=E[h],j.touch0&&j.touch0[2]===I.identifier)delete j.touch0;else if(j.touch1&&j.touch1[2]===I.identifier)delete j.touch1;if(j.touch1&&!j.touch0)j.touch0=j.touch1,delete j.touch1;if(j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2){if(I=c1(I,this),Math.hypot(H[0]-I[0],H[1]-I[1])<R){var v=D1(this).on("dblclick.zoom");if(v)v.apply(this,arguments)}}}return B.wheelDelta=function(k){return arguments.length?(q=typeof k==="function"?k:W5(+k),B):q},B.filter=function(k){return arguments.length?(_=typeof k==="function"?k:W5(!!k),B):_},B.touchable=function(k){return arguments.length?(U=typeof k==="function"?k:W5(!!k),B):U},B.extent=function(k){return arguments.length?(Q=typeof k==="function"?k:W5([[+k[0][0],+k[0][1]],[+k[1][0],+k[1][1]]]),B):Q},B.scaleExtent=function(k){return arguments.length?(G[0]=+k[0],G[1]=+k[1],B):[G[0],G[1]]},B.translateExtent=function(k){return arguments.length?(Z[0][0]=+k[0][0],Z[1][0]=+k[1][0],Z[0][1]=+k[0][1],Z[1][1]=+k[1][1],B):[[Z[0][0],Z[0][1]],[Z[1][0],Z[1][1]]]},B.constrain=function(k){return arguments.length?(J=k,B):J},B.duration=function(k){return arguments.length?(F=+k,B):F},B.interpolate=function(k){return arguments.length?(X=k,B):X},B.on=function(){var k=Y.on.apply(Y,arguments);return k===Y?B:k},B.clickDistance=function(k){return arguments.length?(O=(k=+k)*k,B):Math.sqrt(O)},B.tapDistance=function(k){return arguments.length?(R=+k,B):R},B}var a1={error001:(_="react")=>`Seems like you have not used ${_==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${_}flow.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:(_)=>`Node type "${_}" not found. Using fallback type "default".`,error004:()=>"The 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:(_)=>`The old edge with id=${_} does not exist.`,error009:(_)=>`Marker type "${_}" doesn't exist.`,error008:(_,{id:Q,sourceHandle:J,targetHandle:q})=>`Couldn't create edge for ${_} handle id: "${_==="source"?J:q}", edge id: ${Q}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:(_)=>`Edge type "${_}" not found. Using fallback type "default".`,error012:(_)=>`Node with id "${_}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(_="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${_}/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.",error016:(_)=>`Edge with id "${_}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},V2=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],H6=["Enter"," ","Escape"],K6={"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:_,x:Q,y:J})=>`Moved selected node ${_}. New position, x: ${Q}, y: ${J}`,"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"},x0;(function(_){_.Strict="strict",_.Loose="loose"})(x0||(x0={}));var P0;(function(_){_.Free="free",_.Vertical="vertical",_.Horizontal="horizontal"})(P0||(P0={}));var U2;(function(_){_.Partial="partial",_.Full="full"})(U2||(U2={}));var X6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},B0;(function(_){_.Bezier="default",_.Straight="straight",_.Step="step",_.SmoothStep="smoothstep",_.SimpleBezier="simplebezier"})(B0||(B0={}));var y2;(function(_){_.Arrow="arrow",_.ArrowClosed="arrowclosed"})(y2||(y2={}));var Z1;(function(_){_.Left="left",_.Top="top",_.Right="right",_.Bottom="bottom"})(Z1||(Z1={}));var t8={[Z1.Left]:Z1.Right,[Z1.Right]:Z1.Left,[Z1.Top]:Z1.Bottom,[Z1.Bottom]:Z1.Top},Y6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("source"in _)&&("target"in _),K7=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("position"in _)&&!("source"in _)&&!("target"in _),L6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("internals"in _)&&!("source"in _)&&!("target"in _);var T5=(_,Q=[0,0])=>{let{width:J,height:q}=$0(_),U=_.origin??Q,G=J*U[0],Z=q*U[1];return{x:_.position.x-G,y:_.position.y-Z}},z6=(_,Q={nodeOrigin:[0,0]})=>{if(!Q.nodeLookup)console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.");if(_.length===0)return{x:0,y:0,width:0,height:0};let J=!1,q=_.reduce((U,G)=>{let Z=typeof G==="string",F=!Q.nodeLookup&&!Z?G:void 0;if(Q.nodeLookup)F=Z?Q.nodeLookup.get(G):!L6(G)?Q.nodeLookup.get(G.id):G;if(!F)return U;return J=!0,F4(U,U4(F,Q.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return J?H4(q):{x:0,y:0,width:0,height:0}},H2=(_,Q={})=>{let J={x:1/0,y:1/0,x2:-1/0,y2:-1/0},q=!1;return _.forEach((U)=>{if(Q.filter===void 0||Q.filter(U))J=F4(J,U4(U)),q=!0}),q?H4(J):{x:0,y:0,width:0,height:0}},G4=(_,Q,[J,q,U]=[0,0,1],G=!1,Z=!1)=>{let F=(Q.x-J)/U,X=(Q.y-q)/U,Y=Q.width/U,K=Q.height/U,H=[];for(let L of _.values()){let{measured:z,selectable:W=!0,hidden:O=!1}=L;if(Z&&!W||O)continue;let R=z.width??L.width??L.initialWidth??0,B=z.height??L.height??L.initialHeight??0,{x:P,y:A}=L.internals.positionAbsolute,T=W7(F,X,Y,K,P,A,R,B),f=R*B,C=G&&T>0;if(!L.internals.handleBounds||C||T>=f||L.dragging)H.push(L)}return H},X7=(_,Q)=>{let J=new Set;return _.forEach((q)=>{J.add(q.id)}),Q.filter((q)=>J.has(q.source)||J.has(q.target))};function Hq(_,Q){let J=new Map,q=Q?.nodes?new Set(Q.nodes.map((U)=>U.id)):null;return _.forEach((U)=>{let G;if(Q?.includeHiddenNodes){let{width:Z,height:F}=$0(U);G=Z>0&&F>0}else G=Boolean(U.measured.width&&U.measured.height&&!U.hidden);if(G&&(!q||q.has(U.id)))J.set(U.id,U)}),J}async function Y7({nodes:_,width:Q,height:J,panZoom:q,minZoom:U,maxZoom:G},Z){if(_.size===0)return!0;let F=Hq(_,Z),X=H2(F),Y=O5(X,Q,J,Z?.minZoom??U,Z?.maxZoom??G,Z?.padding??0.1);return await q.setViewport(Y,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0}function W6({nodeId:_,nextPosition:Q,nodeLookup:J,nodeOrigin:q=[0,0],nodeExtent:U,onError:G}){let Z=J.get(_),F=Z.parentId?J.get(Z.parentId):void 0,{x:X,y:Y}=F?F.internals.positionAbsolute:{x:0,y:0},K=Z.origin??q,H=Z.extent||U;if(Z.extent==="parent"&&!Z.expandParent)if(!F)G?.("005",a1.error005());else{let{width:z,height:W}=$0(F);if(z&&W)H=[[X,Y],[X+z,Y+W]]}else if(F&&F2(Z.extent))H=[[Z.extent[0][0]+X,Z.extent[0][1]+Y],[Z.extent[1][0]+X,Z.extent[1][1]+Y]];let L=F2(H)?G2(Q,H,Z.measured):Q;if(Z.measured.width===void 0||Z.measured.height===void 0)G?.("015",a1.error015());return{position:{x:L.x-X+(Z.measured.width??0)*K[0],y:L.y-Y+(Z.measured.height??0)*K[1]},positionAbsolute:L}}async function L7({nodesToRemove:_=[],edgesToRemove:Q=[],nodes:J,edges:q,onBeforeDelete:U}){let G=new Set(_.map((L)=>L.id)),Z=[];for(let L of J){if(L.deletable===!1)continue;let z=G.has(L.id),W=!z&&L.parentId&&Z.find((O)=>O.id===L.parentId);if(z||W)Z.push(L)}let F=new Set(Q.map((L)=>L.id)),X=q.filter((L)=>L.deletable!==!1),K=X7(Z,X);for(let L of X)if(F.has(L.id)&&!K.find((W)=>W.id===L.id))K.push(L);if(!U)return{edges:K,nodes:Z};let H=await U({nodes:Z,edges:K});if(typeof H==="boolean")return H?{edges:K,nodes:Z}:{edges:[],nodes:[]};return H}var j2=(_,Q=0,J=1)=>Math.min(Math.max(_,Q),J),G2=(_={x:0,y:0},Q,J)=>({x:j2(_.x,Q[0][0],Q[1][0]-(J?.width??0)),y:j2(_.y,Q[0][1],Q[1][1]-(J?.height??0))});function z7(_,Q,J){let{width:q,height:U}=$0(J),{x:G,y:Z}=J.internals.positionAbsolute;return G2(_,[[G,Z],[G+q,Z+U]],Q)}var o8=(_,Q,J)=>{if(_<Q)return j2(Math.abs(_-Q),1,Q)/Q;else if(_>J)return-j2(Math.abs(_-J),1,Q)/Q;return 0},Z4=(_,Q,J=15,q=40)=>{let U=o8(_.x,q,Q.width-q)*J,G=o8(_.y,q,Q.height-q)*J;return[U,G]},F4=(_,Q)=>({x:Math.min(_.x,Q.x),y:Math.min(_.y,Q.y),x2:Math.max(_.x2,Q.x2),y2:Math.max(_.y2,Q.y2)}),F6=({x:_,y:Q,width:J,height:q})=>({x:_,y:Q,x2:_+J,y2:Q+q}),H4=({x:_,y:Q,x2:J,y2:q})=>({x:_,y:Q,width:J-_,height:q-Q}),u2=(_,Q=[0,0])=>{let{x:J,y:q}=L6(_)?_.internals.positionAbsolute:T5(_,Q);return{x:J,y:q,width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}},U4=(_,Q=[0,0])=>{let{x:J,y:q}=L6(_)?_.internals.positionAbsolute:T5(_,Q);return{x:J,y:q,x2:J+(_.measured?.width??_.width??_.initialWidth??0),y2:q+(_.measured?.height??_.height??_.initialHeight??0)}},A6=(_,Q)=>H4(F4(F6(_),F6(Q))),W7=(_,Q,J,q,U,G,Z,F)=>{let X=Math.max(0,Math.min(_+J,U+Z)-Math.max(_,U)),Y=Math.max(0,Math.min(Q+q,G+F)-Math.max(Q,G));return Math.ceil(X*Y)},R5=(_,Q)=>W7(_.x,_.y,_.width,_.height,Q.x,Q.y,Q.width,Q.height),B6=(_)=>Q0(_.width)&&Q0(_.height)&&Q0(_.x)&&Q0(_.y),Q0=(_)=>!isNaN(_)&&isFinite(_),M6=(_,Q)=>(J,q)=>{console.warn(`[${_}]: ${q} Help: ${Q}error#${J}`)},b2=(_,Q=[1,1])=>{return{x:Q[0]*Math.round(_.x/Q[0]),y:Q[1]*Math.round(_.y/Q[1])}},D2=({x:_,y:Q},[J,q,U],G=!1,Z=[1,1])=>{let F={x:(_-J)/U,y:(Q-q)/U};return G?b2(F,Z):F},Z2=({x:_,y:Q},[J,q,U])=>{return{x:_*U+J,y:Q*U+q}};function v2(_,Q){if(typeof _==="number")return Math.floor((Q-Q/(1+_))*0.5);if(typeof _==="string"&&_.endsWith("px")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(J)}if(typeof _==="string"&&_.endsWith("%")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(Q*J*0.01)}return console.error(`The padding value "${_}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Kq(_,Q,J){if(typeof _==="string"||typeof _==="number"){let q=v2(_,J),U=v2(_,Q);return{top:q,right:U,bottom:q,left:U,x:U*2,y:q*2}}if(typeof _==="object"){let q=v2(_.top??_.y??0,J),U=v2(_.bottom??_.y??0,J),G=v2(_.left??_.x??0,Q),Z=v2(_.right??_.x??0,Q);return{top:q,right:Z,bottom:U,left:G,x:G+Z,y:q+U}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Xq(_,Q,J,q,U,G){let{x:Z,y:F}=Z2(_,[Q,J,q]),{x:X,y:Y}=Z2({x:_.x+_.width,y:_.y+_.height},[Q,J,q]),K=U-X,H=G-Y;return{left:Math.floor(Z),top:Math.floor(F),right:Math.floor(K),bottom:Math.floor(H)}}var O5=(_,Q,J,q,U,G)=>{let Z=Kq(G,Q,J),F=(Q-Z.x)/_.width,X=(J-Z.y)/_.height,Y=Math.min(F,X),K=j2(Y,q,U),H=_.x+_.width/2,L=_.y+_.height/2,z=Q/2-H*K,W=J/2-L*K,O=Xq(_,z,W,K,Q,J),R={left:Math.min(O.left-Z.left,0),top:Math.min(O.top-Z.top,0),right:Math.min(O.right-Z.right,0),bottom:Math.min(O.bottom-Z.bottom,0)};return{x:z-R.left+R.right,y:W-R.top+R.bottom,zoom:K}},h2=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function F2(_){return _!==void 0&&_!==null&&_!=="parent"}function $0(_){return{width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}}function T6(_){return(_.measured?.width??_.width??_.initialWidth)!==void 0&&(_.measured?.height??_.height??_.initialHeight)!==void 0}function R6(_,Q={width:0,height:0},J,q,U){let G={..._},Z=q.get(J);if(Z){let F=Z.origin||U;G.x+=Z.internals.positionAbsolute.x-(Q.width??0)*F[0],G.y+=Z.internals.positionAbsolute.y-(Q.height??0)*F[1]}return G}function O6(_,Q){if(_.size!==Q.size)return!1;for(let J of _)if(!Q.has(J))return!1;return!0}function A7(){let _,Q;return{promise:new Promise((q,U)=>{_=q,Q=U}),resolve:_,reject:Q}}function B7(_){return{...K6,..._||{}}}function Yq(_){if(typeof document>"u")return!0;let Q=document.querySelector(`.${_}-flow__pane`);if(!Q||!Q.isConnected)return!0;let J=getComputedStyle(Q);if(J.display==="none")return!0;if(J.visibility==="hidden"||J.visibility==="collapse")return!0;if(J.opacity==="0")return!0;if(J.width==="0"&&J.height==="0")return!0;let q=Q.getBoundingClientRect();if(q.width===0&&q.height===0)return!0;let U=document.querySelector(`.${_}-flow__attribution`);if(!U||!U.isConnected)return!1;let G=getComputedStyle(U);if(G.display==="none")return!1;if(G.visibility==="hidden"||G.visibility==="collapse")return!1;if(G.opacity==="0")return!1;let Z=U.getBoundingClientRect();if(Z.width===0&&Z.height===0)return!1;return!0}var n8=!1;function M7(_){if(n8)return;n8=!0;let Q=`${_.charAt(0).toUpperCase()+_.slice(1)} Flow`;setTimeout(()=>{if(!Yq(_))console.warn(`${Q}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${Q} Pro: https://${_}flow.dev/remove-attr
|
|
28
|
+
%cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function I6(_){return _===null?null:_?"valid":"invalid"}function M5(_,{snapGrid:Q=[0,0],snapToGrid:J=!1,transform:q,containerBounds:U}){let{x:G,y:Z}=J0(_),F=D2({x:G-(U?.left??0),y:Z-(U?.top??0)},q),{x:X,y:Y}=J?b2(F,Q):F;return{xSnapped:X,ySnapped:Y,...F}}var K4=(_)=>({width:_.offsetWidth,height:_.offsetHeight}),f6=(_)=>_?.getRootNode?.()||window?.document,Lq=["INPUT","SELECT","TEXTAREA"];function w6(_){let Q=_.composedPath?.()?.[0]||_.target;if(Q?.nodeType!==1)return!1;return Lq.includes(Q.nodeName)||Q.hasAttribute("contenteditable")||!!Q.closest(".nokey")}var P6=(_)=>("clientX"in _),J0=(_,Q)=>{let J=P6(_),q=J?_.clientX:_.touches?.[0].clientX,U=J?_.clientY:_.touches?.[0].clientY;return{x:q-(Q?.left??0),y:U-(Q?.top??0)}},e8=(_,Q,J,q,U)=>{let G=Q.querySelectorAll(`.${_}`);if(!G||!G.length)return null;return Array.from(G).map((Z)=>{let F=Z.getBoundingClientRect();return{id:Z.getAttribute("data-handleid"),type:_,nodeId:U,position:Z.getAttribute("data-handlepos"),x:(F.left-J.left)/q,y:(F.top-J.top)/q,...K4(Z)}})};function X4({sourceX:_,sourceY:Q,targetX:J,targetY:q,sourceControlX:U,sourceControlY:G,targetControlX:Z,targetControlY:F}){let X=_*0.125+U*0.375+Z*0.375+J*0.125,Y=Q*0.125+G*0.375+F*0.375+q*0.125,K=Math.abs(X-_),H=Math.abs(Y-Q);return[X,Y,K,H]}function $4(_,Q){if(_>=0)return 0.5*_;return Q*25*Math.sqrt(-_)}function _7({pos:_,x1:Q,y1:J,x2:q,y2:U,c:G}){switch(_){case Z1.Left:return[Q-$4(Q-q,G),J];case Z1.Right:return[Q+$4(q-Q,G),J];case Z1.Top:return[Q,J-$4(J-U,G)];case Z1.Bottom:return[Q,J+$4(U-J,G)]}}function Y4({sourceX:_,sourceY:Q,sourcePosition:J=Z1.Bottom,targetX:q,targetY:U,targetPosition:G=Z1.Top,curvature:Z=0.25}){let[F,X]=_7({pos:J,x1:_,y1:Q,x2:q,y2:U,c:Z}),[Y,K]=_7({pos:G,x1:q,y1:U,x2:_,y2:Q,c:Z}),[H,L,z,W]=X4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:F,sourceControlY:X,targetControlX:Y,targetControlY:K});return[`M${_},${Q} C${F},${X} ${Y},${K} ${q},${U}`,H,L,z,W]}function N6({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let U=Math.abs(J-_)/2,G=J<_?J+U:J-U,Z=Math.abs(q-Q)/2,F=q<Q?q+Z:q-Z;return[G,F,U,Z]}function T7({sourceNode:_,targetNode:Q,selected:J=!1,zIndex:q=0,elevateOnSelect:U=!1,zIndexMode:G="basic"}){if(G==="manual")return q;let Z=U&&J?q+1000:q,F=Math.max(_.parentId||U&&_.selected?_.internals.z:0,Q.parentId||U&&Q.selected?Q.internals.z:0);return Z+F}function R7({sourceNode:_,targetNode:Q,width:J,height:q,transform:U}){let G=F4(U4(_),U4(Q));if(G.x===G.x2)G.x2+=1;if(G.y===G.y2)G.y2+=1;let Z={x:-U[0]/U[2],y:-U[1]/U[2],width:J/U[2],height:q/U[2]};return R5(Z,H4(G))>0}var zq=({source:_,sourceHandle:Q,target:J,targetHandle:q})=>`xy-edge__${_}${Q||""}-${J}${q||""}`,Wq=(_,Q)=>{return Q.some((J)=>J.source===_.source&&J.target===_.target&&(J.sourceHandle===_.sourceHandle||!J.sourceHandle&&!_.sourceHandle)&&(J.targetHandle===_.targetHandle||!J.targetHandle&&!_.targetHandle))},O7=(_,Q,J={})=>{if(!_.source||!_.target)return J.onError?.("006",a1.error006()),Q;let q=J.getEdgeId||zq,U;if(Y6(_))U={..._};else U={..._,id:q(_)};if(Wq(U,Q))return Q;if(U.sourceHandle===null)delete U.sourceHandle;if(U.targetHandle===null)delete U.targetHandle;return Q.concat(U)};function L4({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let[U,G,Z,F]=N6({sourceX:_,sourceY:Q,targetX:J,targetY:q});return[`M ${_},${Q}L ${J},${q}`,U,G,Z,F]}var Q7={[Z1.Left]:{x:-1,y:0},[Z1.Right]:{x:1,y:0},[Z1.Top]:{x:0,y:-1},[Z1.Bottom]:{x:0,y:1}},Aq=({source:_,sourcePosition:Q=Z1.Bottom,target:J})=>{if(Q===Z1.Left||Q===Z1.Right)return _.x<J.x?{x:1,y:0}:{x:-1,y:0};return _.y<J.y?{x:0,y:1}:{x:0,y:-1}},J7=(_,Q)=>Math.sqrt(Math.pow(Q.x-_.x,2)+Math.pow(Q.y-_.y,2));function Bq({source:_,sourcePosition:Q=Z1.Bottom,target:J,targetPosition:q=Z1.Top,center:U,offset:G,stepPosition:Z}){let F=Q7[Q],X=Q7[q],Y={x:_.x+F.x*G,y:_.y+F.y*G},K={x:J.x+X.x*G,y:J.y+X.y*G},H=Aq({source:Y,sourcePosition:Q,target:K}),L=H.x!==0?"x":"y",z=H[L],W=[],O,R,B={x:0,y:0},P={x:0,y:0},[,,A,T]=N6({sourceX:_.x,sourceY:_.y,targetX:J.x,targetY:J.y});if(F[L]*X[L]===-1){if(L==="x")O=U.x??Y.x+(K.x-Y.x)*Z,R=U.y??(Y.y+K.y)/2;else O=U.x??(Y.x+K.x)/2,R=U.y??Y.y+(K.y-Y.y)*Z;let S=[{x:O,y:Y.y},{x:O,y:K.y}],N=[{x:Y.x,y:R},{x:K.x,y:R}];if(F[L]===z)W=L==="x"?S:N;else W=L==="x"?N:S}else{let S=[{x:Y.x,y:K.y}],N=[{x:K.x,y:Y.y}];if(L==="x")W=F.x===z?N:S;else W=F.y===z?S:N;if(Q===q){let k=Math.abs(_[L]-J[L]);if(k<=G){let b=Math.min(G-1,G-k);if(F[L]===z)B[L]=(Y[L]>_[L]?-1:1)*b;else P[L]=(K[L]>J[L]?-1:1)*b}}if(Q!==q){let k=L==="x"?"y":"x",b=F[L]===X[k],j=Y[k]>K[k],E=Y[k]<K[k];if(F[L]===1&&(!b&&j||b&&E)||F[L]!==1&&(!b&&E||b&&j))W=L==="x"?S:N}let y={x:Y.x+B.x,y:Y.y+B.y},D={x:K.x+P.x,y:K.y+P.y},l=Math.max(Math.abs(y.x-W[0].x),Math.abs(D.x-W[0].x)),p=Math.max(Math.abs(y.y-W[0].y),Math.abs(D.y-W[0].y));if(l>=p)O=(y.x+D.x)/2,R=W[0].y;else O=W[0].x,R=(y.y+D.y)/2}let f={x:Y.x+B.x,y:Y.y+B.y},C={x:K.x+P.x,y:K.y+P.y};return[[_,...f.x!==W[0].x||f.y!==W[0].y?[f]:[],...W,...C.x!==W[W.length-1].x||C.y!==W[W.length-1].y?[C]:[],J],O,R,A,T]}function Mq(_,Q,J,q){let U=Math.min(J7(_,Q)/2,J7(Q,J)/2,q),{x:G,y:Z}=Q;if(_.x===G&&G===J.x||_.y===Z&&Z===J.y)return`L${G} ${Z}`;if(_.y===Z){let Y=_.x<J.x?-1:1,K=_.y<J.y?1:-1;return`L ${G+U*Y},${Z}Q ${G},${Z} ${G},${Z+U*K}`}let F=_.x<J.x?1:-1,X=_.y<J.y?-1:1;return`L ${G},${Z+U*X}Q ${G},${Z} ${G+U*F},${Z}`}function I5({sourceX:_,sourceY:Q,sourcePosition:J=Z1.Bottom,targetX:q,targetY:U,targetPosition:G=Z1.Top,borderRadius:Z=5,centerX:F,centerY:X,offset:Y=20,stepPosition:K=0.5}){let[H,L,z,W,O]=Bq({source:{x:_,y:Q},sourcePosition:J,target:{x:q,y:U},targetPosition:G,center:{x:F,y:X},offset:Y,stepPosition:K}),R=`M${H[0].x} ${H[0].y}`;for(let B=1;B<H.length-1;B++)R+=Mq(H[B-1],H[B],H[B+1],Z);return R+=`L${H[H.length-1].x} ${H[H.length-1].y}`,[R,L,z,W,O]}function $7(_){return _&&!!(_.internals.handleBounds||_.handles?.length)&&!!(_.measured.width||_.width||_.initialWidth)}function I7(_){let{sourceNode:Q,targetNode:J}=_;if(!$7(Q)||!$7(J))return null;let q=Q.internals.handleBounds||q7(Q.handles),U=J.internals.handleBounds||q7(J.handles),G=U7(q?.source??[],_.sourceHandle),Z=U7(_.connectionMode===x0.Strict?U?.target??[]:(U?.target??[]).concat(U?.source??[]),_.targetHandle);if(!G||!Z)return _.onError?.("008",a1.error008(!G?"source":"target",{id:_.id,sourceHandle:_.sourceHandle,targetHandle:_.targetHandle})),null;let F=G?.position||Z1.Bottom,X=Z?.position||Z1.Top,Y=m0(Q,G,F),K=m0(J,Z,X);return{sourceX:Y.x,sourceY:Y.y,targetX:K.x,targetY:K.y,sourcePosition:F,targetPosition:X}}function q7(_){if(!_)return null;let Q=[],J=[];for(let q of _)if(q.width=q.width??1,q.height=q.height??1,q.type==="source")Q.push(q);else if(q.type==="target")J.push(q);return{source:Q,target:J}}function m0(_,Q,J=Z1.Left,q=!1){let U=(Q?.x??0)+_.internals.positionAbsolute.x,G=(Q?.y??0)+_.internals.positionAbsolute.y,{width:Z,height:F}=Q??$0(_);if(q)return{x:U+Z/2,y:G+F/2};switch(Q?.position??J){case Z1.Top:return{x:U+Z/2,y:G};case Z1.Right:return{x:U+Z,y:G+F/2};case Z1.Bottom:return{x:U+Z/2,y:G+F};case Z1.Left:return{x:U,y:G+F/2}}}function U7(_,Q){if(!_)return null;return(!Q?_[0]:_.find((J)=>J.id===Q))||null}function z4(_,Q){if(!_)return"";if(typeof _==="string")return _;return`${Q?`${Q}__`:""}${Object.keys(_).sort().map((q)=>`${q}=${_[q]}`).join("&")}`}function f7(_,{id:Q,defaultColor:J,defaultMarkerStart:q,defaultMarkerEnd:U}){let G=new Set;return _.reduce((Z,F)=>{return[F.markerStart||q,F.markerEnd||U].forEach((X)=>{if(X&&typeof X==="object"){let Y=z4(X,Q);if(!G.has(Y))Z.push({id:Y,color:X.color||J,...X}),G.add(Y)}}),Z},[]).sort((Z,F)=>Z.id.localeCompare(F.id))}function w7(_,Q,J,q,U){let G=0.5;if(U==="start")G=0;else if(U==="end")G=1;let Z=[(_.x+_.width*G)*Q.zoom+Q.x,_.y*Q.zoom+Q.y-q],F=[-100*G,-100];switch(J){case Z1.Right:Z=[(_.x+_.width)*Q.zoom+Q.x+q,(_.y+_.height*G)*Q.zoom+Q.y],F=[0,-100*G];break;case Z1.Bottom:Z[1]=(_.y+_.height)*Q.zoom+Q.y+q,F[1]=0;break;case Z1.Left:Z=[_.x*Q.zoom+Q.x-q,(_.y+_.height*G)*Q.zoom+Q.y],F=[-100,-100*G];break}return`translate(${Z[0]}px, ${Z[1]}px) translate(${F[0]}%, ${F[1]}%)`}var P7=1000,Tq=10,C6={nodeOrigin:[0,0],nodeExtent:V2,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Rq={...C6,checkEquality:!0};function S6(_,Q){let J={..._};for(let q in Q)if(Q[q]!==void 0)J[q]=Q[q];return J}function N7(_,Q,J){let q=S6(C6,J);for(let U of _.values())if(U.parentId)v6(U,_,Q,q);else{let G=T5(U,q.nodeOrigin),Z=F2(U.extent)?U.extent:q.nodeExtent,F=G2(G,Z,$0(U));U.internals.positionAbsolute=F}}function Oq(_,Q){if(!_.handles)return!_.measured?void 0:Q?.internals.handleBounds;let J=[],q=[];for(let U of _.handles){let G={id:U.id,width:U.width??1,height:U.height??1,nodeId:_.id,x:U.x,y:U.y,position:U.position,type:U.type};if(U.type==="source")J.push(G);else if(U.type==="target")q.push(G)}return{source:J,target:q}}function k6(_){return _==="manual"}function W4(_,Q,J,q={}){let U=S6(Rq,q),G={i:0},Z=new Map(Q),F=U?.elevateNodesOnSelect&&!k6(U.zIndexMode)?P7:0,X=_.length>0,Y=!1;Q.clear(),J.clear();for(let K of _){let H=Z.get(K.id);if(U.checkEquality&&K===H?.internals.userNode)Q.set(K.id,H);else{let L=T5(K,U.nodeOrigin),z=F2(K.extent)?K.extent:U.nodeExtent,W=G2(L,z,$0(K));H={...U.defaults,...K,measured:{width:K.measured?.width,height:K.measured?.height},internals:{positionAbsolute:W,handleBounds:Oq(K,H),z:C7(K,F,U.zIndexMode),userNode:K}},Q.set(K.id,H)}if((H.measured===void 0||H.measured.width===void 0||H.measured.height===void 0)&&!H.hidden)X=!1;if(K.parentId)v6(H,Q,J,q,G);Y||=K.selected??!1}return{nodesInitialized:X,hasSelectedNodes:Y}}function Iq(_,Q){if(!_.parentId)return;let J=Q.get(_.parentId);if(J)J.set(_.id,_);else Q.set(_.parentId,new Map([[_.id,_]]))}function v6(_,Q,J,q,U){let{elevateNodesOnSelect:G,nodeOrigin:Z,nodeExtent:F,zIndexMode:X}=S6(C6,q),Y=_.parentId,K=Q.get(Y);if(!K){console.warn(`Parent node ${Y} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if(Iq(_,J),U&&!K.parentId&&K.internals.rootParentIndex===void 0&&X==="auto")K.internals.rootParentIndex=++U.i,K.internals.z=K.internals.z+U.i*Tq;if(U&&K.internals.rootParentIndex!==void 0)U.i=K.internals.rootParentIndex;let H=G&&!k6(X)?P7:0,{x:L,y:z,z:W}=fq(_,K,Z,F,H,X),{positionAbsolute:O}=_.internals,R=L!==O.x||z!==O.y;if(R||W!==_.internals.z)Q.set(_.id,{..._,internals:{..._.internals,positionAbsolute:R?{x:L,y:z}:O,z:W}})}function C7(_,Q,J){let q=Q0(_.zIndex)?_.zIndex:0;if(k6(J))return q;return q+(_.selected?Q:0)}function fq(_,Q,J,q,U,G){let{x:Z,y:F}=Q.internals.positionAbsolute,X=$0(_),Y=T5(_,J),K=F2(_.extent)?G2(Y,_.extent,X):Y,H=G2({x:Z+K.x,y:F+K.y},q,X);if(_.extent==="parent")H=z7(H,X,Q);let L=C7(_,U,G),z=Q.internals.z??0;return{x:H.x,y:H.y,z:z>=L?z+1:L}}function A4(_,Q,J,q=[0,0]){let U=[],G=new Map;for(let Z of _){let F=Q.get(Z.parentId);if(!F)continue;let X=G.get(Z.parentId)?.expandedRect??u2(F),Y=A6(X,Z.rect);G.set(Z.parentId,{expandedRect:Y,parent:F})}if(G.size>0)G.forEach(({expandedRect:Z,parent:F},X)=>{let Y=F.internals.positionAbsolute,K=$0(F),H=F.origin??q,L=Z.x<Y.x?Math.round(Math.abs(Y.x-Z.x)):0,z=Z.y<Y.y?Math.round(Math.abs(Y.y-Z.y)):0,W=Math.max(K.width,Math.round(Z.width)),O=Math.max(K.height,Math.round(Z.height)),R=(W-K.width)*H[0],B=(O-K.height)*H[1];if(L>0||z>0||R||B)U.push({id:X,type:"position",position:{x:F.position.x-L+R,y:F.position.y-z+B}}),J.get(X)?.forEach((P)=>{if(!_.some((A)=>A.id===P.id))U.push({id:P.id,type:"position",position:{x:P.position.x+L,y:P.position.y+z}})});if(K.width<Z.width||K.height<Z.height||L||z)U.push({id:X,type:"dimensions",setAttributes:!0,dimensions:{width:W+(L?H[0]*L-R:0),height:O+(z?H[1]*z-B:0)}})});return U}function S7(_,Q,J,q,U,G,Z){let F=q?.querySelector(".xyflow__viewport"),X=!1;if(!F)return{changes:[],updatedInternals:X};let Y=[],K=window.getComputedStyle(F),{m22:H}=new window.DOMMatrixReadOnly(K.transform),L=[];for(let z of _.values()){let W=Q.get(z.id);if(!W)continue;if(W.hidden){Q.set(W.id,{...W,internals:{...W.internals,handleBounds:void 0}}),X=!0;continue}let O=K4(z.nodeElement),R=W.measured.width!==O.width||W.measured.height!==O.height;if(!!(O.width&&O.height&&(R||!W.internals.handleBounds||z.force))){let P=z.nodeElement.getBoundingClientRect(),A=F2(W.extent)?W.extent:G,{positionAbsolute:T}=W.internals;if(W.parentId&&W.extent==="parent"){let C=Q.get(W.parentId);if(C)T=z7(T,O,C)}else if(A)T=G2(T,A,O);let f={...W,measured:O,internals:{...W.internals,positionAbsolute:T,handleBounds:{source:e8("source",z.nodeElement,P,H,W.id),target:e8("target",z.nodeElement,P,H,W.id)}}};if(Q.set(W.id,f),W.parentId)v6(f,Q,J,{nodeOrigin:U,zIndexMode:Z});if(X=!0,R){if(Y.push({id:W.id,type:"dimensions",dimensions:O}),W.expandParent&&W.parentId)L.push({id:W.id,parentId:W.parentId,rect:u2(f,U)})}}}if(L.length>0){let z=A4(L,Q,J,U);Y.push(...z)}return{changes:Y,updatedInternals:X}}async function k7({delta:_,panZoom:Q,transform:J,translateExtent:q,width:U,height:G}){if(!Q||!_.x&&!_.y)return!1;let Z=await Q.setViewportConstrained({x:J[0]+_.x,y:J[1]+_.y,zoom:J[2]},[[0,0],[U,G]],q);return!!Z&&(Z.x!==J[0]||Z.y!==J[1]||Z.k!==J[2])}function G7(_,Q,J,q,U,G){let Z=U,F=q.get(Z)||new Map;q.set(Z,F.set(J,Q)),Z=`${U}-${_}`;let X=q.get(Z)||new Map;if(q.set(Z,X.set(J,Q)),G){Z=`${U}-${_}-${G}`;let Y=q.get(Z)||new Map;q.set(Z,Y.set(J,Q))}}function y6(_,Q,J){_.clear(),Q.clear();for(let q of J){let{source:U,target:G,sourceHandle:Z=null,targetHandle:F=null}=q,X={edgeId:q.id,source:U,target:G,sourceHandle:Z,targetHandle:F},Y=`${U}-${Z}--${G}-${F}`,K=`${G}-${F}--${U}-${Z}`;G7("source",X,K,_,U,Z),G7("target",X,Y,_,G,F),Q.set(q.id,q)}}function v7(_,Q){if(!_.parentId)return!1;let J=Q.get(_.parentId);if(!J)return!1;if(J.selected)return!0;return v7(J,Q)}function Z7(_,Q,J){let q=_;do{if(q?.matches?.(Q))return!0;if(q===J)return!1;q=q?.parentElement}while(q);return!1}function wq(_,Q,J,q){let U=new Map;for(let[G,Z]of _)if((Z.selected||Z.id===q)&&(!Z.parentId||!v7(Z,_))&&(Z.draggable||Q&&typeof Z.draggable>"u")){let F=_.get(G);if(F)U.set(G,{id:G,position:F.position||{x:0,y:0},distance:{x:J.x-F.internals.positionAbsolute.x,y:J.y-F.internals.positionAbsolute.y},extent:F.extent,parentId:F.parentId,origin:F.origin,expandParent:F.expandParent,internals:{positionAbsolute:F.internals.positionAbsolute||{x:0,y:0}},measured:{width:F.measured.width??0,height:F.measured.height??0}})}return U}function U6({nodeId:_,dragItems:Q,nodeLookup:J,dragging:q=!0}){let U=[];for(let[Z,F]of Q){let X=J.get(Z)?.internals.userNode;if(X)U.push({...X,position:F.position,dragging:q})}if(!_)return[U[0],U];let G=J.get(_)?.internals.userNode;return[!G?U[0]:{...G,position:Q.get(_)?.position||G.position,dragging:q},U]}function Pq({dragItems:_,snapGrid:Q,x:J,y:q}){let U=_.values().next().value;if(!U)return null;let G={x:J-U.distance.x,y:q-U.distance.y},Z=b2(G,Q);return{x:Z.x-G.x,y:Z.y-G.y}}function y7({onNodeMouseDown:_,getStoreItems:Q,onDragStart:J,onDrag:q,onDragStop:U}){let G={x:null,y:null},Z=0,F=new Map,X=!1,Y={x:0,y:0},K=null,H=!1,L=null,z=!1,W=!1,O=null;function R({noDragClassName:P,handleSelector:A,domNode:T,isSelectable:f,nodeId:C,nodeClickDistance:w=0}){L=D1(T);function S({x:l,y:p}){let{nodeLookup:k,nodeExtent:b,snapGrid:j,snapToGrid:E,nodeOrigin:V,onNodeDrag:h,onSelectionDrag:I,onError:v,updateNodePositions:m}=Q();G={x:l,y:p};let u=!1,n=F.size>1,e=n&&b?F6(H2(F)):null,t=n&&E?Pq({dragItems:F,snapGrid:j,x:l,y:p}):null;for(let[a,g]of F){if(!k.has(a))continue;let J1={x:l-g.distance.x,y:p-g.distance.y};if(E)J1=t?{x:Math.round(J1.x+t.x),y:Math.round(J1.y+t.y)}:b2(J1,j);let G1=null;if(n&&b&&!g.extent&&e){let{positionAbsolute:s}=g.internals,_1=s.x-e.x+b[0][0],q1=s.x+g.measured.width-e.x2+b[1][0],o=s.y-e.y+b[0][1],K1=s.y+g.measured.height-e.y2+b[1][1];G1=[[_1,o],[q1,K1]]}let{position:F1,positionAbsolute:c}=W6({nodeId:a,nextPosition:J1,nodeLookup:k,nodeExtent:G1?G1:b,nodeOrigin:V,onError:v});u=u||g.position.x!==F1.x||g.position.y!==F1.y,g.position=F1,g.internals.positionAbsolute=c}if(W=W||u,!u)return;if(m(F,!0),O&&(q||h||!C&&I)){let[a,g]=U6({nodeId:C,dragItems:F,nodeLookup:k});if(q?.(O,F,a,g),h?.(O,a,g),!C)I?.(O,g)}}async function N(){if(!K)return;let{transform:l,panBy:p,autoPanSpeed:k,autoPanOnNodeDrag:b}=Q();if(!b){X=!1,cancelAnimationFrame(Z);return}let[j,E]=Z4(Y,K,k);if(j!==0||E!==0){if(G.x=(G.x??0)-j/l[2],G.y=(G.y??0)-E/l[2],await p({x:j,y:E}))S(G)}Z=requestAnimationFrame(N)}function y(l){let{nodeLookup:p,multiSelectionActive:k,nodesDraggable:b,transform:j,snapGrid:E,snapToGrid:V,selectNodesOnDrag:h,onNodeDragStart:I,onSelectionDragStart:v,unselectNodesAndEdges:m}=Q();if(H=!0,(!h||!f)&&!k&&C){if(!p.get(C)?.selected)m()}if(f&&h&&C)_?.(C);let u=M5(l.sourceEvent,{transform:j,snapGrid:E,snapToGrid:V,containerBounds:K});if(G=u,F=wq(p,b,u,C),F.size>0&&(J||I||!C&&v)){let[n,e]=U6({nodeId:C,dragItems:F,nodeLookup:p});if(J?.(l.sourceEvent,F,n,e),I?.(l.sourceEvent,n,e),!C)v?.(l.sourceEvent,e)}}let D=e2().clickDistance(w).on("start",(l)=>{let{domNode:p,nodeDragThreshold:k,transform:b,snapGrid:j,snapToGrid:E}=Q();if(K=p?.getBoundingClientRect()||null,z=!1,W=!1,O=l.sourceEvent,k===0)y(l);G=M5(l.sourceEvent,{transform:b,snapGrid:j,snapToGrid:E,containerBounds:K}),Y=J0(l.sourceEvent,K)}).on("drag",(l)=>{let{autoPanOnNodeDrag:p,transform:k,snapGrid:b,snapToGrid:j,nodeDragThreshold:E,nodeLookup:V}=Q(),h=M5(l.sourceEvent,{transform:k,snapGrid:b,snapToGrid:j,containerBounds:K});if(O=l.sourceEvent,l.sourceEvent.type==="touchmove"&&l.sourceEvent.touches.length>1||C&&!V.has(C))z=!0;if(z)return;if(!X&&p&&H)X=!0,N();if(!H){let I=J0(l.sourceEvent,K),v=I.x-Y.x,m=I.y-Y.y;if(Math.sqrt(v*v+m*m)>E)y(l)}if((G.x!==h.xSnapped||G.y!==h.ySnapped)&&F&&H)Y=J0(l.sourceEvent,K),S(h)}).on("end",(l)=>{if(!H||z){if(z&&F.size>0)Q().updateNodePositions(F,!1);return}if(X=!1,H=!1,cancelAnimationFrame(Z),F.size>0){let{nodeLookup:p,updateNodePositions:k,onNodeDragStop:b,onSelectionDragStop:j}=Q();if(W)k(F,!1),W=!1;if(U||b||!C&&j){let[E,V]=U6({nodeId:C,dragItems:F,nodeLookup:p,dragging:!1});if(U?.(l.sourceEvent,F,E,V),b?.(l.sourceEvent,E,V),!C)j?.(l.sourceEvent,V)}}}).filter((l)=>{let p=l.target;return!l.button&&(!P||!Z7(p,`.${P}`,T))&&(!A||Z7(p,A,T))});L.call(D)}function B(){L?.on(".drag",null)}return{update:R,destroy:B}}function Nq(_,Q,J){let q=[],U={x:_.x-J,y:_.y-J,width:J*2,height:J*2};for(let G of Q.values())if(R5(U,u2(G))>0)q.push(G);return q}var Cq=250;function Sq(_,Q,J,q){let U=[],G=1/0,Z=Nq(_,J,Q+Cq);for(let F of Z){let X=[...F.internals.handleBounds?.source??[],...F.internals.handleBounds?.target??[]];for(let Y of X){if(q.nodeId===Y.nodeId&&q.type===Y.type&&q.id===Y.id)continue;let{x:K,y:H}=m0(F,Y,Y.position,!0),L=Math.sqrt(Math.pow(K-_.x,2)+Math.pow(H-_.y,2));if(L>Q)continue;if(L<G)U=[{...Y,x:K,y:H}],G=L;else if(L===G)U.push({...Y,x:K,y:H})}}if(!U.length)return null;if(U.length>1){let F=q.type==="source"?"target":"source";return U.find((X)=>X.type===F)??U[0]}return U[0]}function j7(_,Q,J,q,U,G=!1){let Z=q.get(_);if(!Z)return null;let F=U==="strict"?Z.internals.handleBounds?.[Q]:[...Z.internals.handleBounds?.source??[],...Z.internals.handleBounds?.target??[]],X=(J?F?.find((Y)=>Y.id===J):F?.[0])??null;return X&&G?{...X,...m0(Z,X,X.position,!0)}:X}function V7(_,Q){if(_)return _;else if(Q?.classList.contains("target"))return"target";else if(Q?.classList.contains("source"))return"source";return null}function kq(_,Q){let J=null;if(Q)J=!0;else if(_&&!Q)J=!1;return J}var u7=()=>!0;function vq(_,{connectionMode:Q,connectionRadius:J,handleId:q,nodeId:U,edgeUpdaterType:G,isTarget:Z,domNode:F,nodeLookup:X,lib:Y,autoPanOnConnect:K,flowId:H,panBy:L,cancelConnection:z,onConnectStart:W,onConnect:O,onConnectEnd:R,isValidConnection:B=u7,onReconnectEnd:P,updateConnection:A,getTransform:T,getFromHandle:f,autoPanSpeed:C,dragThreshold:w=1,handleDomNode:S}){let N=f6(_.target),y=0,D,{x:l,y:p}=J0(_),k=V7(G,S),b=F?.getBoundingClientRect(),j=!1;if(!b||!k)return;let E=j7(U,k,q,X,Q);if(!E)return;let V=J0(_,b),h=!1,I=null,v=!1,m=null;function u(){if(!K||!b)return;let[F1,c]=Z4(V,b,C);L({x:F1,y:c}),y=requestAnimationFrame(u)}let n={...E,nodeId:U,type:k,position:E.position},e=X.get(U),a={inProgress:!0,isValid:null,from:m0(e,n,Z1.Left,!0),fromHandle:n,fromPosition:n.position,fromNode:e,to:V,toHandle:null,toPosition:t8[n.position],toNode:null,pointer:V};function g(){j=!0,A(a),W?.(_,{nodeId:U,handleId:q,handleType:k})}if(w===0)g();function J1(F1){if(!j){let{x:K1,y:$1}=J0(F1),M1=K1-l,R1=$1-p;if(!(M1*M1+R1*R1>w*w))return;g()}if(!f()||!n){G1(F1);return}let c=T();if(V=J0(F1,b),D=Sq(D2(V,c,!1,[1,1]),J,X,n),!h)u(),h=!0;let s=b7(F1,{handle:D,connectionMode:Q,fromNodeId:U,fromHandleId:q,fromType:Z?"target":"source",isValidConnection:B,doc:N,lib:Y,flowId:H,nodeLookup:X});m=s.handleDomNode,I=s.connection,v=kq(!!D,s.isValid);let _1=X.get(U),q1=_1?m0(_1,n,Z1.Left,!0):a.from,o={...a,from:q1,isValid:v,to:s.toHandle&&v?Z2({x:s.toHandle.x,y:s.toHandle.y},c):V,toHandle:s.toHandle,toPosition:v&&s.toHandle?s.toHandle.position:t8[n.position],toNode:s.toHandle?X.get(s.toHandle.nodeId):null,pointer:V};A(o),a=o}function G1(F1){if("touches"in F1&&F1.touches.length>0)return;if(j){if((D||m)&&I&&v)O?.(I);let{inProgress:c,...s}=a,_1={...s,toPosition:a.toHandle?a.toPosition:null};if(R?.(F1,_1),G)P?.(F1,_1)}z(),cancelAnimationFrame(y),h=!1,v=!1,I=null,m=null,N.removeEventListener("mousemove",J1),N.removeEventListener("mouseup",G1),N.removeEventListener("touchmove",J1),N.removeEventListener("touchend",G1)}N.addEventListener("mousemove",J1),N.addEventListener("mouseup",G1),N.addEventListener("touchmove",J1),N.addEventListener("touchend",G1)}function b7(_,{handle:Q,connectionMode:J,fromNodeId:q,fromHandleId:U,fromType:G,doc:Z,lib:F,flowId:X,isValidConnection:Y=u7,nodeLookup:K}){let H=G==="target",L=Q?Z.querySelector(`.${F}-flow__handle[data-id="${X}-${Q?.nodeId}-${Q?.id}-${Q?.type}"]`):null,{x:z,y:W}=J0(_),O=Z.elementFromPoint(z,W),R=O?.classList.contains(`${F}-flow__handle`)?O:L,B={handleDomNode:R,isValid:!1,connection:null,toHandle:null};if(R){let P=V7(void 0,R),A=R.getAttribute("data-nodeid"),T=R.getAttribute("data-handleid"),f=R.classList.contains("connectable"),C=R.classList.contains("connectableend");if(!A||!P)return B;let w={source:H?A:q,sourceHandle:H?T:U,target:H?q:A,targetHandle:H?U:T};B.connection=w;let N=f&&C&&(J===x0.Strict?H&&P==="source"||!H&&P==="target":A!==q||T!==U);B.isValid=N&&Y(w),B.toHandle=j7(A,P,T,K,J,!0)}return B}var B4={onPointerDown:vq,isValid:b7};function D7({domNode:_,panZoom:Q,getTransform:J,getViewScale:q}){let U=D1(_);function G({translateExtent:F,width:X,height:Y,zoomStep:K=1,pannable:H=!0,zoomable:L=!0,inversePan:z=!1}){let W=(A)=>{if(A.sourceEvent.type!=="wheel"||!Q)return;let T=J(),f=A.sourceEvent.ctrlKey&&h2()?10:1,C=-A.sourceEvent.deltaY*(A.sourceEvent.deltaMode===1?0.05:A.sourceEvent.deltaMode?1:0.002)*K,w=T[2]*Math.pow(2,C*f);Q.scaleTo(w)},O=[0,0],R=(A)=>{if(A.sourceEvent.type==="mousedown"||A.sourceEvent.type==="touchstart")O=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY]},B=(A)=>{let T=J();if(A.sourceEvent.type!=="mousemove"&&A.sourceEvent.type!=="touchmove"||!Q)return;let f=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY],C=[f[0]-O[0],f[1]-O[1]];O=f;let w=q()*Math.max(T[2],Math.log(T[2]))*(z?-1:1),S={x:T[0]-C[0]*w,y:T[1]-C[1]*w},N=[[0,0],[X,Y]];Q.setViewportConstrained({x:S.x,y:S.y,zoom:T[2]},N,F)},P=B5().on("start",R).on("zoom",H?B:null).on("zoom.wheel",L?W:null);U.call(P,{})}function Z(){U.on("zoom",null)}return{update:G,destroy:Z,pointer:c1}}var M4=(_)=>({x:_.x,y:_.y,zoom:_.k}),G6=({x:_,y:Q,zoom:J})=>$2.translate(_,Q).scale(J),E0=(_,Q)=>_.target.closest(`.${Q}`),h7=(_,Q)=>Q===2&&Array.isArray(_)&&_.includes(2),yq=(_)=>((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2,Z6=(_,Q=0,J=yq,q=()=>{})=>{let U=typeof Q==="number"&&Q>0;if(!U)q();return U?_.transition().duration(Q).ease(J).on("end",q):_},E7=(_)=>{let Q=_.ctrlKey&&h2()?10:1;return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*Q};function jq({zoomPanValues:_,noWheelClassName:Q,d3Selection:J,d3Zoom:q,panOnScrollMode:U,panOnScrollSpeed:G,zoomOnPinch:Z,onPanZoomStart:F,onPanZoom:X,onPanZoomEnd:Y}){return(K)=>{if(E0(K,Q)){if(K.ctrlKey)K.preventDefault();return!1}K.preventDefault(),K.stopImmediatePropagation();let H=J.property("__zoom").k||1;if(K.ctrlKey&&Z){let R=c1(K),B=E7(K),P=H*Math.pow(2,B);q.scaleTo(J,P,R,K);return}let L=K.deltaMode===1?20:1,z=U===P0.Vertical?0:K.deltaX*L,W=U===P0.Horizontal?0:K.deltaY*L;if(!h2()&&K.shiftKey&&U!==P0.Vertical)z=K.deltaY*L,W=0;q.translateBy(J,-(z/H)*G,-(W/H)*G,{internal:!0});let O=M4(J.property("__zoom"));if(clearTimeout(_.panScrollTimeout),!_.isPanScrolling)_.isPanScrolling=!0,F?.(K,O);else X?.(K,O);_.panScrollTimeout=setTimeout(()=>{Y?.(K,O),_.isPanScrolling=!1},150)}}function Vq({noWheelClassName:_,preventScrolling:Q,d3ZoomHandler:J}){return function(q,U){let G=q.type==="wheel",Z=!Q&&G&&!q.ctrlKey,F=E0(q,_);if(q.ctrlKey&&G&&F)q.preventDefault();if(Z||F)return null;q.preventDefault(),J.call(this,q,U)}}function uq({zoomPanValues:_,onDraggingChange:Q,onPanZoomStart:J}){return(q)=>{if(q.sourceEvent?.internal)return;let U=M4(q.transform);if(_.mouseButton=q.sourceEvent?.button||0,_.isZoomingOrPanning=!0,_.prevViewport=U,q.sourceEvent?.type==="mousedown")Q(!0);if(J)J?.(q.sourceEvent,U)}}function bq({zoomPanValues:_,panOnDrag:Q,onPaneContextMenu:J,onTransformChange:q,onPanZoom:U}){return(G)=>{if(_.usedRightMouseButton=!!(J&&h7(Q,_.mouseButton??0)),!G.sourceEvent?.sync)q([G.transform.x,G.transform.y,G.transform.k]);if(U&&!G.sourceEvent?.internal)U?.(G.sourceEvent,M4(G.transform))}}function Dq({zoomPanValues:_,panOnDrag:Q,panOnScroll:J,onDraggingChange:q,onPanZoomEnd:U,onPaneContextMenu:G}){return(Z)=>{if(Z.sourceEvent?.internal)return;if(_.isZoomingOrPanning=!1,G&&h7(Q,_.mouseButton??0)&&!_.usedRightMouseButton&&Z.sourceEvent)G(Z.sourceEvent);if(_.usedRightMouseButton=!1,q(!1),U){let F=M4(Z.transform);_.prevViewport=F,clearTimeout(_.timerId),_.timerId=setTimeout(()=>{U?.(Z.sourceEvent,F)},J?150:0)}}}function hq({panActivationKeyPressed:_,zoomActivationKeyPressed:Q,zoomOnScroll:J,zoomOnPinch:q,panOnDrag:U,panOnScroll:G,zoomOnDoubleClick:Z,userSelectionActive:F,noWheelClassName:X,noPanClassName:Y,lib:K,connectionInProgress:H}){return(L)=>{let z=Q||J,W=q&&L.ctrlKey,O=L.type==="wheel";if(L.button===1&&L.type==="mousedown"&&(E0(L,`${K}-flow__node`)||E0(L,`${K}-flow__edge`)||E0(L,`${K}-flow__selection`)||E0(L,`${K}-flow__nodesselection`)))return!0;if(!U&&!z&&!G&&!Z&&!q)return!1;if(F)return!1;if(H&&!O)return!1;if(E0(L,X)&&O)return!1;if(E0(L,Y)&&(!O||G&&O&&!Q))return!1;if(!q&&L.ctrlKey&&O)return!1;if(!q&&L.type==="touchstart"&&L.touches?.length>1)return L.preventDefault(),!1;if(!z&&!G&&!W&&O)return!1;if(!U&&(L.type==="mousedown"||L.type==="touchstart"))return!1;if(Array.isArray(U)&&!U.includes(L.button)&&L.type==="mousedown")return!1;let R=Array.isArray(U)&&U.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||O||_)&&R}}function x7({domNode:_,minZoom:Q,maxZoom:J,translateExtent:q,viewport:U,onPanZoom:G,onPanZoomStart:Z,onPanZoomEnd:F,onDraggingChange:X}){let Y={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},K=_.getBoundingClientRect(),H=[[0,0],[K.width,K.height]];(typeof ResizeObserver<"u"?new ResizeObserver((p)=>{let k=p[0];if(k)H=[[0,0],[k.contentRect.width,k.contentRect.height]]}):null)?.observe(_);let z=B5().extent(()=>H).scaleExtent([Q,J]).translateExtent(q),W=D1(_).call(z);T({x:U.x,y:U.y,zoom:j2(U.zoom,Q,J)},[[0,0],[K.width,K.height]],q);let O=W.on("wheel.zoom"),R=W.on("dblclick.zoom");z.wheelDelta(E7);async function B(p,k){if(W)return new Promise((b)=>{z?.interpolate(k?.interpolate==="linear"?A0:Q2).transform(Z6(W,k?.duration,k?.ease,()=>b(!0)),p)});return!1}function P({noWheelClassName:p,noPanClassName:k,onPaneContextMenu:b,userSelectionActive:j,panOnScroll:E,panOnDrag:V,panOnScrollMode:h,panOnScrollSpeed:I,preventScrolling:v,zoomOnPinch:m,zoomOnScroll:u,zoomOnDoubleClick:n,panActivationKeyPressed:e=!1,zoomActivationKeyPressed:t,lib:a,onTransformChange:g,connectionInProgress:J1,paneClickDistance:G1,selectionOnDrag:F1}){if(j&&!Y.isZoomingOrPanning)A();let c=E&&!t&&!j;z.clickDistance(F1?1/0:!Q0(G1)||G1<0?0:G1);let s=c?jq({zoomPanValues:Y,noWheelClassName:p,d3Selection:W,d3Zoom:z,panOnScrollMode:h,panOnScrollSpeed:I,zoomOnPinch:m,onPanZoomStart:Z,onPanZoom:G,onPanZoomEnd:F}):Vq({noWheelClassName:p,preventScrolling:v,d3ZoomHandler:O});W.on("wheel.zoom",s,{passive:!1});let _1=uq({zoomPanValues:Y,onDraggingChange:X,onPanZoomStart:Z});z.on("start",_1);let q1=bq({zoomPanValues:Y,panOnDrag:V,onPaneContextMenu:!!b,onPanZoom:G,onTransformChange:g});z.on("zoom",q1);let o=Dq({zoomPanValues:Y,panOnDrag:V,panOnScroll:E,onPaneContextMenu:b,onPanZoomEnd:F,onDraggingChange:X});z.on("end",o);let K1=hq({panActivationKeyPressed:e,zoomActivationKeyPressed:t,panOnDrag:V,zoomOnScroll:u,panOnScroll:E,zoomOnDoubleClick:n,zoomOnPinch:m,userSelectionActive:j,noPanClassName:k,noWheelClassName:p,lib:a,connectionInProgress:J1});if(z.filter(K1),n)W.on("dblclick.zoom",R);else W.on("dblclick.zoom",null)}function A(){z.on("zoom",null)}async function T(p,k,b){let j=G6(p),E=z?.constrain()(j,k,b);if(E)await B(E);return E}async function f(p,k){let b=G6(p);return await B(b,k),b}function C(p){if(W){let k=G6(p),b=W.property("__zoom");if(b.k!==p.zoom||b.x!==p.x||b.y!==p.y)z?.transform(W,k,null,{sync:!0})}}function w(){let p=W?A5(W.node()):{x:0,y:0,k:1};return{x:p.x,y:p.y,zoom:p.k}}async function S(p,k){if(W)return new Promise((b)=>{z?.interpolate(k?.interpolate==="linear"?A0:Q2).scaleTo(Z6(W,k?.duration,k?.ease,()=>b(!0)),p)});return!1}async function N(p,k){if(W)return new Promise((b)=>{z?.interpolate(k?.interpolate==="linear"?A0:Q2).scaleBy(Z6(W,k?.duration,k?.ease,()=>b(!0)),p)});return!1}function y(p){z?.scaleExtent(p)}function D(p){z?.translateExtent(p)}function l(p){let k=!Q0(p)||p<0?0:p;z?.clickDistance(k)}return{update:P,destroy:A,setViewport:f,setViewportConstrained:T,getViewport:w,scaleTo:S,scaleBy:N,setScaleExtent:y,setTranslateExtent:D,syncViewport:C,setClickDistance:l}}var g0;(function(_){_.Line="line",_.Handle="handle"})(g0||(g0={}));function Eq({width:_,prevWidth:Q,height:J,prevHeight:q,affectsX:U,affectsY:G}){let Z=_-Q,F=J-q,X=[Z>0?1:Z<0?-1:0,F>0?1:F<0?-1:0];if(Z&&U)X[0]=X[0]*-1;if(F&&G)X[1]=X[1]*-1;return X}function F7(_){let Q=_.includes("right")||_.includes("left"),J=_.includes("bottom")||_.includes("top"),q=_.includes("left"),U=_.includes("top");return{isHorizontal:Q,isVertical:J,affectsX:q,affectsY:U}}function D0(_,Q){return Math.max(0,Q-_)}function h0(_,Q){return Math.max(0,_-Q)}function q4(_,Q,J){return Math.max(0,Q-_,_-J)}function H7(_,Q){return _?!Q:Q}function xq(_,Q,J,q,U,G,Z,F){let{affectsX:X,affectsY:Y}=Q,{isHorizontal:K,isVertical:H}=Q,L=K&&H,{xSnapped:z,ySnapped:W}=J,{minWidth:O,maxWidth:R,minHeight:B,maxHeight:P}=q,{x:A,y:T,width:f,height:C,aspectRatio:w}=_,S=Math.floor(K?z-_.pointerX:0),N=Math.floor(H?W-_.pointerY:0),y=f+(X?-S:S),D=C+(Y?-N:N),l=-G[0]*f,p=-G[1]*C,k=q4(y,O,R),b=q4(D,B,P);if(Z){let V=0,h=0;if(X&&S<0)V=D0(A+S+l,Z[0][0]);else if(!X&&S>0)V=h0(A+y+l,Z[1][0]);if(Y&&N<0)h=D0(T+N+p,Z[0][1]);else if(!Y&&N>0)h=h0(T+D+p,Z[1][1]);k=Math.max(k,V),b=Math.max(b,h)}if(F){let V=0,h=0;if(X&&S>0)V=h0(A+S,F[0][0]);else if(!X&&S<0)V=D0(A+y,F[1][0]);if(Y&&N>0)h=h0(T+N,F[0][1]);else if(!Y&&N<0)h=D0(T+D,F[1][1]);k=Math.max(k,V),b=Math.max(b,h)}if(U){if(K){let V=q4(y/w,B,P)*w;if(k=Math.max(k,V),Z){let h=0;if(!X&&!Y||X&&!Y&&L)h=h0(T+p+y/w,Z[1][1])*w;else h=D0(T+p+(X?S:-S)/w,Z[0][1])*w;k=Math.max(k,h)}if(F){let h=0;if(!X&&!Y||X&&!Y&&L)h=D0(T+y/w,F[1][1])*w;else h=h0(T+(X?S:-S)/w,F[0][1])*w;k=Math.max(k,h)}}if(H){let V=q4(D*w,O,R)/w;if(b=Math.max(b,V),Z){let h=0;if(!X&&!Y||Y&&!X&&L)h=h0(A+D*w+l,Z[1][0])/w;else h=D0(A+(Y?N:-N)*w+l,Z[0][0])/w;b=Math.max(b,h)}if(F){let h=0;if(!X&&!Y||Y&&!X&&L)h=D0(A+D*w,F[1][0])/w;else h=h0(A+(Y?N:-N)*w,F[0][0])/w;b=Math.max(b,h)}}}if(N=N+(N<0?b:-b),S=S+(S<0?k:-k),U)if(L)if(y>D*w)N=(H7(X,Y)?-S:S)/w;else S=(H7(X,Y)?-N:N)*w;else if(K)N=S/w,Y=X;else S=N*w,X=Y;let j=X?A+S:A,E=Y?T+N:T;return{width:f+(X?-S:S),height:C+(Y?-N:N),x:G[0]*S*(!X?1:-1)+j,y:G[1]*N*(!Y?1:-1)+E}}var m7={width:0,height:0,x:0,y:0},mq={...m7,pointerX:0,pointerY:0,aspectRatio:1};function gq(_,Q,J){let q=Q.position.x+_.position.x,U=Q.position.y+_.position.y,G=_.measured.width??0,Z=_.measured.height??0,F=J[0]*G,X=J[1]*Z;return[[q-F,U-X],[q+G-F,U+Z-X]]}function g7({domNode:_,nodeId:Q,getStoreItems:J,onChange:q,onEnd:U}){let G=D1(_),Z={controlDirection:F7("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function F({controlPosition:Y,boundaries:K,keepAspectRatio:H,resizeDirection:L,onResizeStart:z,onResize:W,onResizeEnd:O,shouldResize:R}){let B={...m7},P={...mq};Z={boundaries:K,resizeDirection:L,keepAspectRatio:H,controlDirection:F7(Y)};let A=void 0,T=null,f=[],C=void 0,w=void 0,S=void 0,N=e2().on("start",(y)=>{let{nodeLookup:D,transform:l,snapGrid:p,snapToGrid:k,nodeOrigin:b,paneDomNode:j}=J();if(A=D.get(Q),!A)return;T=j?.getBoundingClientRect()??null;let{xSnapped:E,ySnapped:V}=M5(y.sourceEvent,{transform:l,snapGrid:p,snapToGrid:k,containerBounds:T});if(B={width:A.measured.width??0,height:A.measured.height??0,x:A.position.x??0,y:A.position.y??0},P={...B,pointerX:E,pointerY:V,aspectRatio:B.width/B.height},C=void 0,w=F2(A.extent)?A.extent:void 0,A.parentId&&(A.extent==="parent"||A.expandParent))C=D.get(A.parentId);if(C&&A.extent==="parent")w=[[0,0],[C.measured.width,C.measured.height]];f=[],S=void 0;for(let[h,I]of D)if(I.parentId===Q){if(f.push({id:h,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent){let v=gq(I,A,I.origin??b);if(S)S=[[Math.min(v[0][0],S[0][0]),Math.min(v[0][1],S[0][1])],[Math.max(v[1][0],S[1][0]),Math.max(v[1][1],S[1][1])]];else S=v}}z?.(y,{...B})}).on("drag",(y)=>{let{transform:D,snapGrid:l,snapToGrid:p,nodeOrigin:k}=J(),b=M5(y.sourceEvent,{transform:D,snapGrid:l,snapToGrid:p,containerBounds:T}),j=[];if(!A)return;let{x:E,y:V,width:h,height:I}=B,v={},m=A.origin??k,{width:u,height:n,x:e,y:t}=xq(P,Z.controlDirection,b,Z.boundaries,Z.keepAspectRatio,m,w,S),a=u!==h,g=n!==I,J1=e!==E&&a,G1=t!==V&&g;if(!J1&&!G1&&!a&&!g)return;let F1={prevValues:{...B},startX:P.x,startY:P.y,childNodes:f.map((q1)=>({...q1,position:{...q1.position}}))};if(J1||G1||m[0]===1||m[1]===1){if(v.x=J1?e:B.x,v.y=G1?t:B.y,B.x=v.x,B.y=v.y,f.length>0){let q1=e-E,o=t-V;for(let K1 of f)K1.position={x:K1.position.x-q1+m[0]*(u-h),y:K1.position.y-o+m[1]*(n-I)},j.push(K1)}}if(a||g)v.width=a&&(!Z.resizeDirection||Z.resizeDirection==="horizontal")?u:B.width,v.height=g&&(!Z.resizeDirection||Z.resizeDirection==="vertical")?n:B.height,B.width=v.width,B.height=v.height;if(C&&A.expandParent){let q1=m[0]*(v.width??0);if(v.x&&v.x<q1)B.x=q1,P.x=P.x-(v.x-q1);let o=m[1]*(v.height??0);if(v.y&&v.y<o)B.y=o,P.y=P.y-(v.y-o)}let c=Eq({width:B.width,prevWidth:h,height:B.height,prevHeight:I,affectsX:Z.controlDirection.affectsX,affectsY:Z.controlDirection.affectsY}),s={...B,direction:c};if(R?.(y,s)===!1){B=F1.prevValues,P.x=F1.startX,P.y=F1.startY,f.forEach((q1,o)=>{q1.position=F1.childNodes[o].position});return}W?.(y,s),q(v,j)}).on("end",(y)=>{O?.(y,{...B}),U?.({...B})});G.call(N)}function X(){G.on(".drag",null)}return{update:F,destroy:X}}var d7=g1(L0(),1),a7=g1(c7(),1);var l7=(_)=>{let Q,J=new Set,q=(K,H)=>{let L=typeof K==="function"?K(Q):K;if(!Object.is(L,Q)){let z=Q;Q=(H!=null?H:typeof L!=="object"||L===null)?L:Object.assign({},Q,L),J.forEach((W)=>W(Q,z))}},U=()=>Q,X={setState:q,getState:U,getInitialState:()=>Y,subscribe:(K)=>{return J.add(K),()=>J.delete(K)},destroy:()=>{if((import.meta.env?import.meta.env.MODE: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.");J.clear()}},Y=Q=_(q,U,X);return X},r7=(_)=>_?l7(_):l7;var{useDebugValue:lq}=d7.default,{useSyncExternalStoreWithSelector:rq}=a7.default,iq=(_)=>_;function j6(_,Q=iq,J){let q=rq(_.subscribe,_.getState,_.getServerState||_.getInitialState,Q,J);return lq(q),q}var i7=(_,Q)=>{let J=r7(_),q=(U,G=Q)=>j6(J,U,G);return Object.assign(q,J),q},s7=(_,Q)=>_?i7(_,Q):i7;function C1(_,Q){if(Object.is(_,Q))return!0;if(typeof _!=="object"||_===null||typeof Q!=="object"||Q===null)return!1;if(_ instanceof Map&&Q instanceof Map){if(_.size!==Q.size)return!1;for(let[q,U]of _)if(!Object.is(U,Q.get(q)))return!1;return!0}if(_ instanceof Set&&Q instanceof Set){if(_.size!==Q.size)return!1;for(let q of _)if(!Q.has(q))return!1;return!0}let J=Object.keys(_);if(J.length!==Object.keys(Q).length)return!1;for(let q of J)if(!Object.prototype.hasOwnProperty.call(Q,q)||!Object.is(_[q],Q[q]))return!1;return!0}var P9=g1(n7(),1),f4=d.createContext(null),sq=f4.Provider,N9=a1.error001("react");function T1(_,Q){let J=d.useContext(f4);if(J===null)throw Error(N9);return j6(J,_,Q)}function S1(){let _=d.useContext(f4);if(_===null)throw Error(N9);return d.useMemo(()=>({getState:_.getState,setState:_.setState,subscribe:_.subscribe}),[_])}var e7={display:"none"},tq={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},C9="react-flow__node-desc",S9="react-flow__edge-desc",oq="react-flow__aria-live",nq=(_)=>_.ariaLiveMessage,eq=(_)=>_.ariaLabelConfig;function _U({rfId:_}){let Q=T1(nq);return i.jsx("div",{id:`${oq}-${_}`,"aria-live":"assertive","aria-atomic":"true",style:tq,children:Q})}function QU({rfId:_,disableKeyboardA11y:Q}){let J=T1(eq);return i.jsxs(i.Fragment,{children:[i.jsx("div",{id:`${C9}-${_}`,style:e7,children:Q?J["node.a11yDescription.default"]:J["node.a11yDescription.keyboardDisabled"]}),i.jsx("div",{id:`${S9}-${_}`,style:e7,children:J["edge.a11yDescription.default"]}),!Q&&i.jsx(_U,{rfId:_})]})}var X2=d.forwardRef(({position:_="top-left",children:Q,className:J,style:q,...U},G)=>{let Z=`${_}`.split("-");return i.jsx("div",{className:v1(["react-flow__panel",J,...Z]),style:q,ref:G,...U,children:Q})});X2.displayName="Panel";var _9="https://reactflow.dev/attribution";function JU({proOptions:_,position:Q="bottom-right"}){if(d.useEffect(()=>{M7("react")},[]),_?.hideAttribution)return null;return i.jsx(X2,{position:Q,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${_9}`,children:i.jsx("a",{href:_9,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var $U=(_)=>{let Q=[],J=[];for(let[,q]of _.nodeLookup)if(q.selected)Q.push(q.internals.userNode);for(let[,q]of _.edgeLookup)if(q.selected)J.push(q);return{selectedNodes:Q,selectedEdges:J}},T4=(_)=>_.id;function qU(_,Q){return C1(_.selectedNodes.map(T4),Q.selectedNodes.map(T4))&&C1(_.selectedEdges.map(T4),Q.selectedEdges.map(T4))}function UU({onSelectionChange:_}){let Q=S1(),{selectedNodes:J,selectedEdges:q}=T1($U,qU);return d.useEffect(()=>{let U={nodes:J,edges:q};_?.(U),Q.getState().onSelectionChangeHandlers.forEach((G)=>G(U))},[J,q,_]),null}var GU=(_)=>!!_.onSelectionChangeHandlers;function ZU({onSelectionChange:_}){let Q=T1(GU);if(_||Q)return i.jsx(UU,{onSelectionChange:_});return null}var k9=[0,0],FU={x:0,y:0,zoom:1},HU=["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"],Q9=[...HU,"rfId"],KU=(_)=>({setNodes:_.setNodes,setEdges:_.setEdges,setMinZoom:_.setMinZoom,setMaxZoom:_.setMaxZoom,setTranslateExtent:_.setTranslateExtent,setNodeExtent:_.setNodeExtent,reset:_.reset,setDefaultNodesAndEdges:_.setDefaultNodesAndEdges}),J9={translateExtent:V2,nodeOrigin:k9,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function XU(_){let{setNodes:Q,setEdges:J,setMinZoom:q,setMaxZoom:U,setTranslateExtent:G,setNodeExtent:Z,reset:F,setDefaultNodesAndEdges:X}=T1(KU,C1),Y=S1();d.useEffect(()=>{return X(_.defaultNodes,_.defaultEdges),()=>{K.current=J9,F()}},[]);let K=d.useRef(J9);return d.useEffect(()=>{for(let H of Q9){let L=_[H],z=K.current[H];if(L===z)continue;if(typeof _[H]>"u")continue;if(H==="nodes")Q(L);else if(H==="edges")J(L);else if(H==="minZoom")q(L);else if(H==="maxZoom")U(L);else if(H==="translateExtent")G(L);else if(H==="nodeExtent")Z(L);else if(H==="ariaLabelConfig")Y.setState({ariaLabelConfig:B7(L)});else if(H==="fitView")Y.setState({fitViewQueued:L});else if(H==="fitViewOptions")Y.setState({fitViewOptions:L});else Y.setState({[H]:L})}K.current=_},Q9.map((H)=>_[H])),null}function $9(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function YU(_){let[Q,J]=d.useState(_==="system"?null:_);return d.useEffect(()=>{if(_!=="system"){J(_);return}let q=$9(),U=()=>J(q?.matches?"dark":"light");return U(),q?.addEventListener("change",U),()=>{q?.removeEventListener("change",U)}},[_]),Q!==null?Q:$9()?.matches?"dark":"light"}var q9=typeof document<"u"?document:null;function f5(_=null,Q={target:q9,actInsideInputWithModifier:!0}){let[J,q]=d.useState(!1),U=d.useRef(!1),G=d.useRef(new Set([])),[Z,F]=d.useMemo(()=>{if(_!==null){let Y=(Array.isArray(_)?_:[_]).filter((H)=>typeof H==="string").map((H)=>H.replace(/\+/g,`
|
|
29
29
|
`).replace(`
|
|
30
30
|
|
|
31
31
|
`,`
|
|
32
32
|
+`).split(`
|
|
33
|
-
`)),X=Y.reduce((K,L)=>K.concat(...L),[]);return[Y,X]}return[[],[]]},[_]);return r.useEffect(()=>{let H=Q?.target??e7,Y=Q?.actInsideInputWithModifier??!0;if(_!==null){let X=(z)=>{if(U.current=z.ctrlKey||z.metaKey||z.shiftKey||z.altKey,(!U.current||U.current&&!Y)&&R6(z))return!1;let O=Q9(z.code,F);if(G.current.add(z[O]),_9(Z,G.current,!1)){let T=z.composedPath?.()?.[0]||z.target,B=T?.nodeName==="BUTTON"||T?.nodeName==="A";if(Q.preventDefault!==!1&&(U.current||!B))z.preventDefault();q(!0)}},K=(z)=>{let W=Q9(z.code,F);if(_9(Z,G.current,!0))q(!1),G.current.clear();else G.current.delete(z[W]);if(z.key==="Meta")G.current.clear();U.current=!1},L=()=>{G.current.clear(),q(!1)};return H?.addEventListener("keydown",X),H?.addEventListener("keyup",K),window.addEventListener("blur",L),window.addEventListener("contextmenu",L),()=>{H?.removeEventListener("keydown",X),H?.removeEventListener("keyup",K),window.removeEventListener("blur",L),window.removeEventListener("contextmenu",L)}}},[_,q]),J}function _9(_,Q,J){return _.filter((q)=>J||q.length===Q.size).some((q)=>q.every((U)=>Q.has(U)))}function Q9(_,Q){return Q.includes(_)?"code":"key"}var KU=()=>{let _=N1();return r.useMemo(()=>{return{zoomIn:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(1.2,Q):!1},zoomOut:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(0.8333333333333334,Q):!1},zoomTo:async(Q,J)=>{let{panZoom:q}=_.getState();return q?q.scaleTo(Q,J):!1},getZoom:()=>_.getState().transform[2],setViewport:async(Q,J)=>{let{transform:[q,U,G],panZoom:Z}=_.getState();if(!Z)return!1;return await Z.setViewport({x:Q.x??q,y:Q.y??U,zoom:Q.zoom??G},J),!0},getViewport:()=>{let[Q,J,q]=_.getState().transform;return{x:Q,y:J,zoom:q}},setCenter:async(Q,J,q)=>{return _.getState().setCenter(Q,J,q)},fitBounds:async(Q,J)=>{let{width:q,height:U,minZoom:G,maxZoom:Z,panZoom:F}=_.getState(),H=B5(Q,q,U,G,Z,J?.padding??0.1);if(!F)return!1;return await F.setViewport(H,{duration:J?.duration,ease:J?.ease,interpolate:J?.interpolate}),!0},screenToFlowPosition:(Q,J={})=>{let{transform:q,snapGrid:U,snapToGrid:G,domNode:Z}=_.getState();if(!Z)return Q;let{x:F,y:H}=Z.getBoundingClientRect(),Y={x:Q.x-F,y:Q.y-H},X=J.snapGrid??U,K=J.snapToGrid??G;return u2(Y,q,K,X)},flowToScreenPosition:(Q)=>{let{transform:J,domNode:q}=_.getState();if(!q)return Q;let{x:U,y:G}=q.getBoundingClientRect(),Z=U2(Q,J);return{x:Z.x+U,y:Z.y+G}}}},[])};function P9(_,Q){let J=[],q=new Map,U=[];for(let G of _)if(G.type==="add"){U.push(G);continue}else if(G.type==="remove"||G.type==="replace")q.set(G.id,[G]);else{let Z=q.get(G.id);if(Z)Z.push(G);else q.set(G.id,[G])}for(let G of Q){let Z=q.get(G.id);if(!Z){J.push(G);continue}if(Z[0].type==="remove")continue;if(Z[0].type==="replace"){J.push({...Z[0].item});continue}let F={...G};for(let H of Z)HU(H,F);J.push(F)}if(U.length)U.forEach((G)=>{if(G.index!==void 0)J.splice(G.index,0,{...G.item});else J.push({...G.item})});return J}function HU(_,Q){switch(_.type){case"select":{Q.selected=_.selected;break}case"position":{if(typeof _.position<"u")Q.position=_.position;if(typeof _.dragging<"u")Q.dragging=_.dragging;break}case"dimensions":{if(typeof _.dimensions<"u"){if(Q.measured={..._.dimensions},_.setAttributes){if(_.setAttributes===!0||_.setAttributes==="width")Q.width=_.dimensions.width;if(_.setAttributes===!0||_.setAttributes==="height")Q.height=_.dimensions.height}}if(typeof _.resizing==="boolean")Q.resizing=_.resizing;break}}}function N9(_,Q){return P9(_,Q)}function XU(_,Q){return P9(_,Q)}function F2(_,Q){return{id:_,type:"select",selected:Q}}function D2(_,Q=new Set,J=!1){let q=[];for(let[U,G]of _){let Z=Q.has(U);if(!(G.selected===void 0&&!Z)&&G.selected!==Z){if(J)G.selected=Z;q.push(F2(G.id,Z))}}return q}function J9({items:_=[],lookup:Q}){let J=[],q=new Map(_.map((U)=>[U.id,U]));for(let[U,G]of _.entries()){let Z=Q.get(G.id),F=Z?.internals?.userNode??Z;if(F!==void 0&&F!==G)J.push({id:G.id,item:G,type:"replace"});if(F===void 0)J.push({item:G,type:"add",index:U})}for(let[U]of Q)if(q.get(U)===void 0)J.push({id:U,type:"remove"});return J}function $9(_){return{id:_.id,type:"remove"}}var YU=z6("React Flow","https://reactflow.dev/");function LU(_,Q,J={}){return A7(_,Q,{...J,onError:J.onError??YU})}var q9=(_)=>U7(_),zU=(_)=>F6(_);function C9(_){return r.forwardRef(_)}var S9=typeof window<"u"?r.useLayoutEffect:r.useEffect;function U9(_){let[Q,J]=r.useState(BigInt(0)),[q]=r.useState(()=>WU(()=>J((U)=>U+BigInt(1))));return S9(()=>{let U=q.get();if(U.length)_(U),q.reset()},[Q]),q}function WU(_){let Q=[];return{get:()=>Q,reset:()=>{Q=[]},push:(J)=>{Q.push(J),_()}}}var k9=r.createContext(null);function AU({children:_}){let Q=N1(),J=r.useCallback((F)=>{let{nodes:H=[],setNodes:Y,hasDefaultNodes:X,onNodesChange:K,nodeLookup:L,fitViewQueued:z,onNodesChangeMiddlewareMap:W}=Q.getState(),O=H;for(let B of F)O=typeof B==="function"?B(O):B;let T=J9({items:O,lookup:L});for(let B of W.values())T=B(T);if(X)Y(O);if(T.length>0)K?.(T);else if(z)window.requestAnimationFrame(()=>{let{fitViewQueued:B,nodes:w,setNodes:A}=Q.getState();if(B)A(w)})},[]),q=U9(J),U=r.useCallback((F)=>{let{edges:H=[],setEdges:Y,hasDefaultEdges:X,onEdgesChange:K,edgeLookup:L}=Q.getState(),z=H;for(let W of F)z=typeof W==="function"?W(z):W;if(X)Y(z);else if(K)K(J9({items:z,lookup:L}))},[]),G=U9(U),Z=r.useMemo(()=>({nodeQueue:q,edgeQueue:G}),[]);return l.jsx(k9.Provider,{value:Z,children:_})}function BU(){let _=r.useContext(k9);if(!_)throw Error("useBatchContext must be used within a BatchProvider");return _}var MU=(_)=>!!_.panZoom;function R5(){let _=KU(),Q=N1(),J=BU(),q=M1(MU),U=r.useMemo(()=>{let G=(K)=>Q.getState().nodeLookup.get(K),Z=(K)=>{J.nodeQueue.push(K)},F=(K)=>{J.edgeQueue.push(K)},H=(K)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState(),W=q9(K)?K:L.get(K.id),O=W.parentId?A6(W.position,W.measured,W.parentId,L,z):W.position,T={...W,position:O,width:W.measured?.width??W.width,height:W.measured?.height??W.height};return j2(T)},Y=(K,L,z={replace:!1})=>{Z((W)=>W.map((O)=>{if(O.id===K){let T=typeof L==="function"?L(O):L;return z.replace&&q9(T)?T:{...O,...T}}return O}))},X=(K,L,z={replace:!1})=>{F((W)=>W.map((O)=>{if(O.id===K){let T=typeof L==="function"?L(O):L;return z.replace&&zU(T)?T:{...O,...T}}return O}))};return{getNodes:()=>Q.getState().nodes.map((K)=>({...K})),getNode:(K)=>G(K)?.internals.userNode,getInternalNode:G,getEdges:()=>{let{edges:K=[]}=Q.getState();return K.map((L)=>({...L}))},getEdge:(K)=>Q.getState().edgeLookup.get(K),setNodes:Z,setEdges:F,addNodes:(K)=>{let L=Array.isArray(K)?K:[K];J.nodeQueue.push((z)=>[...z,...L])},addEdges:(K)=>{let L=Array.isArray(K)?K:[K];J.edgeQueue.push((z)=>[...z,...L])},toObject:()=>{let{nodes:K=[],edges:L=[],transform:z}=Q.getState(),[W,O,T]=z;return{nodes:K.map((B)=>({...B})),edges:L.map((B)=>({...B})),viewport:{x:W,y:O,zoom:T}}},deleteElements:async({nodes:K=[],edges:L=[]})=>{let{nodes:z,edges:W,onNodesDelete:O,onEdgesDelete:T,triggerNodeChanges:B,triggerEdgeChanges:w,onDelete:A,onBeforeDelete:R}=Q.getState(),{nodes:I,edges:C}=await F7({nodesToRemove:K,edgesToRemove:L,nodes:z,edges:W,onBeforeDelete:R}),P=C.length>0,k=I.length>0;if(P){let N=C.map($9);T?.(C),w(N)}if(k){let N=I.map($9);O?.(I),B(N)}if(k||P)A?.({nodes:I,edges:C});return{deletedNodes:I,deletedEdges:C}},getIntersectingNodes:(K,L=!0,z)=>{let W=L6(K),O=W?K:H(K),T=z!==void 0;if(!O)return[];return(z||Q.getState().nodes).filter((B)=>{let w=Q.getState().nodeLookup.get(B.id);if(w&&!W&&(B.id===K.id||!w.internals.positionAbsolute))return!1;let A=j2(T?B:w),R=A5(A,O);return L&&R>0||R>=A.width*A.height||R>=O.width*O.height})},isNodeIntersecting:(K,L,z=!0)=>{let O=L6(K)?K:H(K);if(!O)return!1;let T=A5(O,L);return z&&T>0||T>=L.width*L.height||T>=O.width*O.height},updateNode:Y,updateNodeData:(K,L,z={replace:!1})=>{Y(K,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},updateEdge:X,updateEdgeData:(K,L,z={replace:!1})=>{X(K,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},getNodesBounds:(K)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState();return H6(K,{nodeLookup:L,nodeOrigin:z})},getHandleConnections:({type:K,id:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}-${K}${L?`-${L}`:""}`)?.values()??[]),getNodeConnections:({type:K,handleId:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}${K?L?`-${K}-${L}`:`-${K}`:""}`)?.values()??[]),fitView:async(K)=>{let L=Q.getState().fitViewResolver??X7();return Q.setState({fitViewQueued:!0,fitViewOptions:K,fitViewResolver:L}),J.nodeQueue.push((z)=>[...z]),L.promise}}},[]);return r.useMemo(()=>{return{...U,..._,viewportInitialized:q}},[q])}var G9=(_)=>_.selected,TU=typeof window<"u"?window:void 0;function RU({deleteKeyCode:_,multiSelectionKeyCode:Q}){let J=N1(),{deleteElements:q}=R5(),U=T5(_,{actInsideInputWithModifier:!1}),G=T5(Q,{target:TU});r.useEffect(()=>{if(U){let{edges:Z,nodes:F}=J.getState();q({nodes:F.filter(G9),edges:Z.filter(G9)}),J.setState({nodesSelectionActive:!1})}},[U]),r.useEffect(()=>{J.setState({multiSelectionActive:G})},[G])}function OU(_){let Q=N1();r.useEffect(()=>{let J=()=>{if(!_.current||!(_.current.checkVisibility?.()??!0))return!1;let q=U4(_.current);if(q.height===0||q.width===0)Q.getState().onError?.("004",i1.error004());Q.setState({width:q.width||500,height:q.height||500})};if(_.current){J(),window.addEventListener("resize",J);let q=new ResizeObserver(()=>J());return q.observe(_.current),()=>{if(window.removeEventListener("resize",J),q&&_.current)q.unobserve(_.current)}}},[])}var T4={position:"absolute",width:"100%",height:"100%",top:0,left:0},fU=(_)=>({userSelectionActive:_.userSelectionActive,lib:_.lib,connectionInProgress:_.connection.inProgress});function IU({onPaneContextMenu:_,zoomOnScroll:Q=!0,zoomOnPinch:J=!0,panOnScroll:q=!1,panActivationKeyPressed:U,panOnScrollSpeed:G=0.5,panOnScrollMode:Z=I0.Free,zoomOnDoubleClick:F=!0,panOnDrag:H=!0,defaultViewport:Y,translateExtent:X,minZoom:K,maxZoom:L,zoomActivationKeyCode:z,preventScrolling:W=!0,children:O,noWheelClassName:T,noPanClassName:B,onViewportChange:w,isControlledViewport:A,paneClickDistance:R,selectionOnDrag:I}){let C=N1(),P=r.useRef(null),{userSelectionActive:k,lib:N,connectionInProgress:v}=M1(fU,P1),E=T5(z),g=r.useRef();OU(P);let h=r.useCallback((S)=>{if(w?.({x:S[0],y:S[1],zoom:S[2]}),!A)C.setState({transform:S})},[w,A]);return r.useEffect(()=>{if(P.current){g.current=u7({domNode:P.current,minZoom:K,maxZoom:L,translateExtent:X,viewport:Y,onDraggingChange:(x)=>C.setState((V)=>V.paneDragging===x?V:{paneDragging:x}),onPanZoomStart:(x,V)=>{let{onViewportChangeStart:D,onMoveStart:f}=C.getState();f?.(x,V),D?.(V)},onPanZoom:(x,V)=>{let{onViewportChange:D,onMove:f}=C.getState();f?.(x,V),D?.(V)},onPanZoomEnd:(x,V)=>{let{onViewportChangeEnd:D,onMoveEnd:f}=C.getState();f?.(x,V),D?.(V)}});let{x:S,y:b,zoom:j}=g.current.getViewport();return C.setState({panZoom:g.current,transform:[S,b,j],domNode:P.current.closest(".react-flow")}),()=>{g.current?.destroy()}}},[]),r.useEffect(()=>{g.current?.update({onPaneContextMenu:_,zoomOnScroll:Q,zoomOnPinch:J,panOnScroll:q,panActivationKeyPressed:U,panOnScrollSpeed:G,panOnScrollMode:Z,zoomOnDoubleClick:F,panOnDrag:H,zoomActivationKeyPressed:E,preventScrolling:W,noPanClassName:B,userSelectionActive:k,noWheelClassName:T,lib:N,onTransformChange:h,connectionInProgress:v,selectionOnDrag:I,paneClickDistance:R})},[_,Q,J,q,U,G,Z,F,H,E,W,B,k,T,N,h,v,I,R]),l.jsx("div",{className:"react-flow__renderer",ref:P,style:T4,children:O})}var wU=(_)=>({userSelectionActive:_.userSelectionActive,userSelectionRect:_.userSelectionRect});function PU(){let{userSelectionActive:_,userSelectionRect:Q}=M1(wU,P1);if(!(_&&Q))return null;return l.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:Q.width,height:Q.height,transform:`translate(${Q.x}px, ${Q.y}px)`}})}var y6=(_,Q)=>{return(J)=>{if(J.target!==Q.current)return;_?.(J)}},NU=(_)=>({userSelectionActive:_.userSelectionActive,elementsSelectable:_.elementsSelectable,dragging:_.paneDragging,panBy:_.panBy,autoPanSpeed:_.autoPanSpeed});function CU({isSelecting:_,selectionKeyPressed:Q,selectionMode:J=$2.Full,panOnDrag:q,autoPanOnSelection:U,paneClickDistance:G,selectionOnDrag:Z,onSelectionStart:F,onSelectionEnd:H,onPaneClick:Y,onPaneContextMenu:X,onPaneScroll:K,onPaneMouseEnter:L,onPaneMouseMove:z,onPaneMouseLeave:W,children:O}){let T=r.useRef(0),B=N1(),{userSelectionActive:w,elementsSelectable:A,dragging:R,panBy:I,autoPanSpeed:C}=M1(NU,P1),P=A&&(_||w),k=r.useRef(null),N=r.useRef(),v=r.useRef(new Set),E=r.useRef(new Set),g=r.useRef(!1),h=r.useRef(!1),S=r.useRef({x:0,y:0}),b=r.useRef(!1),j=(c)=>{if(h.current||g.current||B.getState().connection.inProgress){h.current=!1,g.current=!1;return}Y?.(c),B.getState().resetSelectedElements(),B.setState({nodesSelectionActive:!1})},x=(c)=>{if(Array.isArray(q)&&q?.includes(2)){c.preventDefault();return}X?.(c)},V=K?(c)=>K(c):void 0,D=(c)=>{if(h.current)c.stopPropagation(),h.current=!1},f=(c)=>{if(c.pointerType==="touch"&&q!==!1&&!Q)return;let{domNode:e,transform:Q1}=B.getState();if(N.current=e?.getBoundingClientRect(),!N.current)return;let G1=c.target===k.current;if(!G1&&!!c.target.closest(".nokey")||!_||!(Z&&G1||Q)||c.button!==0||!c.isPrimary)return;c.target?.setPointerCapture?.(c.pointerId),h.current=!1;let{x:Y1,y:K1}=_0(c.nativeEvent,N.current),o=u2({x:Y1,y:K1},Q1);if(B.setState({userSelectionRect:{width:0,height:0,startX:o.x,startY:o.y,x:Y1,y:K1}}),!G1)c.stopPropagation(),c.preventDefault()};function y(c,e){let{userSelectionRect:Q1}=B.getState();if(!Q1)return;let{transform:G1,nodeLookup:$1,edgeLookup:Z1,connectionLookup:Y1,triggerNodeChanges:K1,triggerEdgeChanges:o,defaultEdgeOptions:z1}=B.getState(),q1={x:Q1.startX,y:Q1.startY},{x:y1,y:c1}=U2(q1,G1),l1={startX:q1.x,startY:q1.y,x:c<y1?c:y1,y:e<c1?e:c1,width:Math.abs(c-y1),height:Math.abs(e-c1)},k0=v.current,F0=E.current;v.current=new Set(Q4($1,l1,G1,J===$2.Partial,!0).map((a1)=>a1.id)),E.current=new Set;let M0=z1?.selectable??!0;for(let a1 of v.current){let o1=Y1.get(a1);if(!o1)continue;for(let{edgeId:n1}of o1.values()){let K0=Z1.get(n1);if(K0&&(K0.selectable??M0))E.current.add(n1)}}if(!B6(k0,v.current)){let a1=D2($1,v.current,!0);K1(a1)}if(!B6(F0,E.current)){let a1=D2(Z1,E.current);o(a1)}B.setState({userSelectionRect:l1,userSelectionActive:!0,nodesSelectionActive:!1})}function p(){if(!U||!N.current)return;let[c,e]=J4(S.current,N.current,C);I({x:c,y:e}).then((Q1)=>{if(!h.current||!Q1){T.current=requestAnimationFrame(p);return}let{x:G1,y:$1}=S.current;y(G1,$1),T.current=requestAnimationFrame(p)})}let u=()=>{cancelAnimationFrame(T.current),T.current=0,b.current=!1};r.useEffect(()=>{return()=>u()},[]);let s=(c)=>{let{userSelectionRect:e,transform:Q1,resetSelectedElements:G1}=B.getState();if(!N.current||!e)return;let{x:$1,y:Z1}=_0(c.nativeEvent,N.current);S.current={x:$1,y:Z1};let Y1=U2({x:e.startX,y:e.startY},Q1);if(!h.current){let K1=Q?0:G;if(Math.hypot($1-Y1.x,Z1-Y1.y)<=K1)return;G1(),F?.(c)}if(h.current=!0,!b.current)p(),b.current=!0;y($1,Z1)},t=(c)=>{if(!P){if(c.target===k.current&&B.getState().connection.inProgress)g.current=!0;return}if(c.button!==0)return;if(c.target?.releasePointerCapture?.(c.pointerId),!w&&c.target===k.current&&B.getState().userSelectionRect)j?.(c);if(B.setState({userSelectionActive:!1,userSelectionRect:null}),h.current)H?.(c),B.setState({nodesSelectionActive:v.current.size>0});u()},a=(c)=>{c.target?.releasePointerCapture?.(c.pointerId),u()},d=q===!0||Array.isArray(q)&&q.includes(0);return l.jsxs("div",{className:C1(["react-flow__pane",{draggable:d,dragging:R,selection:_}]),onClick:P?void 0:y6(j,k),onContextMenu:y6(x,k),onWheel:y6(V,k),onPointerEnter:P?void 0:L,onPointerMove:P?s:z,onPointerUp:t,onPointerCancel:P?a:void 0,onPointerDownCapture:P?f:void 0,onClickCapture:P?D:void 0,onPointerLeave:W,ref:k,style:T4,children:[O,l.jsx(PU,{})]})}function j6({id:_,store:Q,unselect:J=!1,nodeRef:q}){let{addSelectedNodes:U,unselectNodesAndEdges:G,multiSelectionActive:Z,nodeLookup:F,onError:H}=Q.getState(),Y=F.get(_);if(!Y){H?.("012",i1.error012(_));return}if(Q.setState({nodesSelectionActive:!1}),!Y.selected)U([_]);else if(J||Y.selected&&Z)G({nodes:[Y],edges:[]}),requestAnimationFrame(()=>q?.current?.blur())}function y9({nodeRef:_,disabled:Q=!1,noDragClassName:J,handleSelector:q,nodeId:U,isSelectable:G,nodeClickDistance:Z}){let F=N1(),[H,Y]=r.useState(!1),X=r.useRef();return r.useEffect(()=>{if(Q)return;return X.current=N7({getStoreItems:()=>F.getState(),onNodeMouseDown:(K)=>{j6({id:K,store:F,nodeRef:_})},onDragStart:()=>{Y(!0)},onDragStop:()=>{Y(!1)}}),()=>{X.current?.destroy(),X.current=void 0}},[Q,F,_]),r.useEffect(()=>{if(Q||!_.current||!X.current)return;X.current.update({noDragClassName:J,handleSelector:q,domNode:_.current,isSelectable:G,nodeId:U,nodeClickDistance:Z})},[J,q,Q,G,_,U,Z]),H}var SU=(_)=>(Q)=>Q.selected&&(Q.draggable||_&&typeof Q.draggable>"u");function v9(){let _=N1();return r.useCallback((J)=>{let{nodeExtent:q,snapToGrid:U,snapGrid:G,nodesDraggable:Z,onError:F,updateNodePositions:H,nodeLookup:Y,nodeOrigin:X}=_.getState(),K=new Map,L=SU(Z),z=U?G[0]:5,W=U?G[1]:5,O=J.direction.x*z*J.factor,T=J.direction.y*W*J.factor;for(let[,B]of Y){if(!L(B))continue;let w={x:B.internals.positionAbsolute.x+O,y:B.internals.positionAbsolute.y+T};if(U)w=V2(w,G);let{position:A,positionAbsolute:R}=X6({nodeId:B.id,nextPosition:w,nodeLookup:Y,nodeExtent:q,nodeOrigin:X,onError:F});B.position=A,B.internals.positionAbsolute=R,K.set(B.id,B)}H(K)},[])}var V6=r.createContext(null),kU=V6.Provider;V6.Consumer;var u6=()=>{return r.useContext(V6)},yU=(_)=>({connectOnClick:_.connectOnClick,noPanClassName:_.noPanClassName,rfId:_.rfId}),j9=r.createContext(null);function vU({children:_}){let Q=M1(yU,P1);return l.jsx(j9.Provider,{value:Q,children:_})}function jU(){let _=r.useContext(j9);if(!_)throw Error("useHandleConfig must be used within a HandleConfigProvider");return _}var VU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},uU=(_,Q,J)=>(q)=>{let{connectionClickStartHandle:U,connectionMode:G,connection:Z}=q,{fromHandle:F,toHandle:H,isValid:Y}=Z;if(!F&&!U)return VU;let X=H?.nodeId===_&&H?.id===Q&&H?.type===J;return{connectingFrom:F?.nodeId===_&&F?.id===Q&&F?.type===J,connectingTo:X,clickConnecting:U?.nodeId===_&&U?.id===Q&&U?.type===J,isPossibleEndHandle:G===E0.Strict?F?.type!==J:_!==F?.nodeId||Q!==F?.id,connectionInProcess:!!F,clickConnectionInProcess:!!U,valid:X&&Y}};function bU({type:_="source",position:Q=J1.Top,isValidConnection:J,isConnectable:q=!0,isConnectableStart:U=!0,isConnectableEnd:G=!0,id:Z,onConnect:F,children:H,className:Y,onMouseDown:X,onTouchStart:K,...L},z){let W=Z||null,O=_==="target",T=N1(),B=u6(),{connectOnClick:w,noPanClassName:A,rfId:R}=jU(),{connectingFrom:I,connectingTo:C,clickConnecting:P,isPossibleEndHandle:k,connectionInProcess:N,clickConnectionInProcess:v,valid:E}=M1(uU(B,W,_),P1);if(!B)T.getState().onError?.("010",i1.error010());let g=(b)=>{let{defaultEdgeOptions:j,onConnect:x,hasDefaultEdges:V}=T.getState(),D={...j,...b};if(V){let{edges:f,setEdges:y,onError:p}=T.getState();y(LU(D,f,{onError:p}))}x?.(D),F?.(D)},h=(b)=>{if(!B)return;let j=O6(b.nativeEvent);if(U&&(j&&b.button===0||!j)){let x=T.getState();Y4.onPointerDown(b.nativeEvent,{handleDomNode:b.currentTarget,autoPanOnConnect:x.autoPanOnConnect,connectionMode:x.connectionMode,connectionRadius:x.connectionRadius,domNode:x.domNode,nodeLookup:x.nodeLookup,lib:x.lib,isTarget:O,handleId:W,nodeId:B,flowId:x.rfId,panBy:x.panBy,cancelConnection:x.cancelConnection,onConnectStart:x.onConnectStart,onConnectEnd:(...V)=>T.getState().onConnectEnd?.(...V),updateConnection:x.updateConnection,onConnect:g,isValidConnection:J||((...V)=>T.getState().isValidConnection?.(...V)??!0),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:x.autoPanSpeed,dragThreshold:x.connectionDragThreshold})}if(j)X?.(b);else K?.(b)},S=(b)=>{let{onClickConnectStart:j,onClickConnectEnd:x,connectionClickStartHandle:V,connectionMode:D,isValidConnection:f,lib:y,rfId:p,nodeLookup:u,connection:s}=T.getState();if(!B||!V&&!U)return;if(!V){j?.(b.nativeEvent,{nodeId:B,handleId:W,handleType:_}),T.setState({connectionClickStartHandle:{nodeId:B,type:_,id:W}});return}let t=T6(b.target),a=J||f,{connection:d,isValid:c}=Y4.isValid(b.nativeEvent,{handle:{nodeId:B,id:W,type:_},connectionMode:D,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:a,flowId:p,doc:t,lib:y,nodeLookup:u});if(c&&d)g(d);let e=structuredClone(s);delete e.inProgress,e.toPosition=e.toHandle?e.toHandle.position:null,x?.(b,e),T.setState({connectionClickStartHandle:null})};return l.jsx("div",{"data-handleid":W,"data-nodeid":B,"data-handlepos":Q,"data-id":`${R}-${B}-${W}-${_}`,className:C1(["react-flow__handle",`react-flow__handle-${Q}`,"nodrag",A,Y,{source:!O,target:O,connectable:q,connectablestart:U,connectableend:G,clickconnecting:P,connectingfrom:I,connectingto:C,valid:E,connectionindicator:q&&(!N||k)&&(N||v?G:U)}]),onMouseDown:h,onTouchStart:h,onClick:w?S:void 0,ref:z,...L,children:H})}var A4=r.memo(C9(bU));function DU({data:_,isConnectable:Q,sourcePosition:J=J1.Bottom}){return l.jsxs(l.Fragment,{children:[_?.label,l.jsx(A4,{type:"source",position:J,isConnectable:Q})]})}function hU({data:_,isConnectable:Q,targetPosition:J=J1.Top,sourcePosition:q=J1.Bottom}){return l.jsxs(l.Fragment,{children:[l.jsx(A4,{type:"target",position:J,isConnectable:Q}),_?.label,l.jsx(A4,{type:"source",position:q,isConnectable:Q})]})}function EU(){return null}function xU({data:_,isConnectable:Q,targetPosition:J=J1.Top}){return l.jsxs(l.Fragment,{children:[l.jsx(A4,{type:"target",position:J,isConnectable:Q}),_?.label]})}var B4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Z9={input:DU,default:hU,output:xU,group:EU};function mU(_){if(_.internals.handleBounds===void 0)return{width:_.width??_.initialWidth??_.style?.width,height:_.height??_.initialHeight??_.style?.height};return{width:_.width??_.style?.width,height:_.height??_.style?.height}}var gU=(_)=>{let{width:Q,height:J,x:q,y:U}=Z2(_.nodeLookup,{filter:(G)=>!!G.selected});return{width:e1(Q)?Q:null,height:e1(J)?J:null,userSelectionActive:_.userSelectionActive,transformString:`translate(${_.transform[0]}px,${_.transform[1]}px) scale(${_.transform[2]}) translate(${q}px,${U}px)`}};function pU({onSelectionContextMenu:_,noPanClassName:Q,disableKeyboardA11y:J}){let q=N1(),{width:U,height:G,transformString:Z,userSelectionActive:F}=M1(gU,P1),H=v9(),Y=r.useRef(null);r.useEffect(()=>{if(!J)Y.current?.focus({preventScroll:!0})},[J]);let X=!F&&U!==null&&G!==null;if(y9({nodeRef:Y,disabled:!X}),!X)return null;let K=_?(z)=>{let W=q.getState().nodes.filter((O)=>O.selected);_(z,W)}:void 0,L=(z)=>{if(Object.prototype.hasOwnProperty.call(B4,z.key))z.preventDefault(),H({direction:B4[z.key],factor:z.shiftKey?4:1})};return l.jsx("div",{className:C1(["react-flow__nodesselection","react-flow__container",Q]),style:{transform:Z},children:l.jsx("div",{ref:Y,className:"react-flow__nodesselection-rect",onContextMenu:K,tabIndex:J?void 0:-1,onKeyDown:J?void 0:L,style:{width:U,height:G}})})}var F9=typeof window<"u"?window:void 0,cU=(_)=>{return{nodesSelectionActive:_.nodesSelectionActive,userSelectionActive:_.userSelectionActive}};function V9({children:_,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,paneClickDistance:F,deleteKeyCode:H,selectionKeyCode:Y,selectionOnDrag:X,selectionMode:K,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:W,panActivationKeyCode:O,zoomActivationKeyCode:T,elementsSelectable:B,zoomOnScroll:w,zoomOnPinch:A,panOnScroll:R,panOnScrollSpeed:I,panOnScrollMode:C,zoomOnDoubleClick:P,panOnDrag:k,autoPanOnSelection:N,defaultViewport:v,translateExtent:E,minZoom:g,maxZoom:h,preventScrolling:S,onSelectionContextMenu:b,noWheelClassName:j,noPanClassName:x,disableKeyboardA11y:V,onViewportChange:D,isControlledViewport:f}){let{nodesSelectionActive:y,userSelectionActive:p}=M1(cU,P1),u=T5(Y,{target:F9}),s=T5(O,{target:F9}),t=s||k,a=s||R,d=X&&t!==!0,c=u||p||d;return RU({deleteKeyCode:H,multiSelectionKeyCode:W}),l.jsx(IU,{onPaneContextMenu:G,elementsSelectable:B,zoomOnScroll:w,zoomOnPinch:A,panOnScroll:a,panActivationKeyPressed:s,panOnScrollSpeed:I,panOnScrollMode:C,zoomOnDoubleClick:P,panOnDrag:!u&&t,defaultViewport:v,translateExtent:E,minZoom:g,maxZoom:h,zoomActivationKeyCode:T,preventScrolling:S,noWheelClassName:j,noPanClassName:x,onViewportChange:D,isControlledViewport:f,paneClickDistance:F,selectionOnDrag:d,children:l.jsxs(CU,{onSelectionStart:L,onSelectionEnd:z,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,panOnDrag:t,autoPanOnSelection:N,isSelecting:!!c,selectionMode:K,selectionKeyPressed:u,paneClickDistance:F,selectionOnDrag:d,children:[_,y&&l.jsx(pU,{onSelectionContextMenu:b,noPanClassName:x,disableKeyboardA11y:V})]})})}V9.displayName="FlowRenderer";var lU=r.memo(V9),rU=(_)=>(Q)=>{return _?Q4(Q.nodeLookup,{x:0,y:0,width:Q.width,height:Q.height},Q.transform,!0).map((J)=>J.id):Array.from(Q.nodeLookup.keys())};function iU(_){return M1(r.useCallback(rU(_),[_]),P1)}var dU=(_)=>_.updateNodeInternals;function aU(){let _=M1(dU),[Q]=r.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((J)=>{let q=new Map;J.forEach((U)=>{let G=U.target.getAttribute("data-id");q.set(G,{id:G,nodeElement:U.target,force:!0})}),_(q)})});return r.useEffect(()=>{return()=>{Q?.disconnect()}},[Q]),Q}function sU({node:_,nodeType:Q,hasDimensions:J,resizeObserver:q}){let U=N1(),G=r.useRef(null),Z=r.useRef(null),F=r.useRef(_.sourcePosition),H=r.useRef(_.targetPosition),Y=r.useRef(Q),X=J&&!!_.internals.handleBounds;return r.useEffect(()=>{if(G.current&&!_.hidden&&(!X||Z.current!==G.current)){if(Z.current)q?.unobserve(Z.current);q?.observe(G.current),Z.current=G.current}},[X,_.hidden]),r.useEffect(()=>{return()=>{if(Z.current)q?.unobserve(Z.current),Z.current=null}},[]),r.useEffect(()=>{if(G.current){let K=Y.current!==Q,L=F.current!==_.sourcePosition,z=H.current!==_.targetPosition;if(K||L||z)Y.current=Q,F.current=_.sourcePosition,H.current=_.targetPosition,U.getState().updateNodeInternals(new Map([[_.id,{id:_.id,nodeElement:G.current,force:!0}]]))}},[_.id,Q,_.sourcePosition,_.targetPosition]),G}function tU({id:_,onClick:Q,onMouseEnter:J,onMouseMove:q,onMouseLeave:U,onContextMenu:G,onDoubleClick:Z,nodesDraggable:F,elementsSelectable:H,nodesConnectable:Y,nodesFocusable:X,resizeObserver:K,noDragClassName:L,noPanClassName:z,disableKeyboardA11y:W,rfId:O,nodeTypes:T,nodeClickDistance:B,onError:w}){let{node:A,internals:R,isParent:I}=M1((c)=>{let e=c.nodeLookup.get(_),Q1=c.parentLookup.has(_);return{node:e,internals:e.internals,isParent:Q1}},P1),C=A.type||"default",P=T?.[C]||Z9[C];if(P===void 0)w?.("003",i1.error003(C)),C="default",P=T?.default||Z9.default;let k=!!(A.draggable||F&&typeof A.draggable>"u"),N=!!(A.selectable||H&&typeof A.selectable>"u"),v=!!(A.connectable||Y&&typeof A.connectable>"u"),E=!!(A.focusable||X&&typeof A.focusable>"u"),g=N1(),h=W6(A),S=sU({node:A,nodeType:C,hasDimensions:h,resizeObserver:K}),b=y9({nodeRef:S,disabled:A.hidden||!k,noDragClassName:L,handleSelector:A.dragHandle,nodeId:_,isSelectable:N,nodeClickDistance:B}),j=v9();if(A.hidden)return null;let x=Q0(A),V=mU(A),D=N||k||Q||J||q||U,f=J?(c)=>J(c,{...R.userNode}):void 0,y=q?(c)=>q(c,{...R.userNode}):void 0,p=U?(c)=>U(c,{...R.userNode}):void 0,u=G?(c)=>G(c,{...R.userNode}):void 0,s=Z?(c)=>Z(c,{...R.userNode}):void 0,t=(c)=>{let{selectNodesOnDrag:e,nodeDragThreshold:Q1}=g.getState();if(N&&(!e||!k||Q1>0))j6({id:_,store:g,nodeRef:S});if(Q)Q(c,{...R.userNode})},a=(c)=>{if(R6(c.nativeEvent)||W)return;if(U6.includes(c.key)&&N){let e=c.key==="Escape";j6({id:_,store:g,unselect:e,nodeRef:S})}else if(k&&A.selected&&Object.prototype.hasOwnProperty.call(B4,c.key)){c.preventDefault();let{ariaLabelConfig:e}=g.getState();g.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:c.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),j({direction:B4[c.key],factor:c.shiftKey?4:1})}},d=()=>{if(W||!S.current?.matches(":focus-visible"))return;let{transform:c,width:e,height:Q1,autoPanOnNodeFocus:G1,setCenter:$1}=g.getState();if(!G1)return;if(!(Q4(new Map([[_,A]]),{x:0,y:0,width:e,height:Q1},c,!0).length>0))$1(A.position.x+x.width/2,A.position.y+x.height/2,{zoom:c[2]})};return l.jsx("div",{className:C1(["react-flow__node",`react-flow__node-${C}`,{[z]:k},A.className,{selected:A.selected,selectable:N,parent:I,draggable:k,dragging:b}]),ref:S,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:h?"visible":"hidden",...A.style,...V},"data-id":_,"data-testid":`rf__node-${_}`,onMouseEnter:f,onMouseMove:y,onMouseLeave:p,onContextMenu:u,onClick:t,onDoubleClick:s,onKeyDown:E?a:void 0,tabIndex:E?0:void 0,onFocus:E?d:void 0,role:A.ariaRole??(E?"group":void 0),"aria-roledescription":"node","aria-describedby":W?void 0:`${f9}-${O}`,"aria-label":A.ariaLabel,...A.domAttributes,children:l.jsx(kU,{value:_,children:l.jsx(P,{id:_,data:A.data,type:C,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:A.selected??!1,selectable:N,draggable:k,deletable:A.deletable??!0,isConnectable:v,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:b,dragHandle:A.dragHandle,zIndex:R.z,parentId:A.parentId,...x})})})}var oU=r.memo(tU),nU=(_)=>({nodesConnectable:_.nodesConnectable,nodesFocusable:_.nodesFocusable,elementsSelectable:_.elementsSelectable,onError:_.onError});function u9(_){let{nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,onError:U}=M1(nU,P1),G=iU(_.onlyRenderVisibleElements),Z=aU();return l.jsx("div",{className:"react-flow__nodes",style:T4,children:G.map((F)=>{return l.jsx(oU,{id:F,nodeTypes:_.nodeTypes,nodeExtent:_.nodeExtent,onClick:_.onNodeClick,onMouseEnter:_.onNodeMouseEnter,onMouseMove:_.onNodeMouseMove,onMouseLeave:_.onNodeMouseLeave,onContextMenu:_.onNodeContextMenu,onDoubleClick:_.onNodeDoubleClick,noDragClassName:_.noDragClassName,noPanClassName:_.noPanClassName,rfId:_.rfId,disableKeyboardA11y:_.disableKeyboardA11y,resizeObserver:Z,nodesDraggable:_.nodesDraggable??!0,nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,nodeClickDistance:_.nodeClickDistance,onError:U},F)})})}u9.displayName="NodeRenderer";var eU=r.memo(u9);function _G(_){return M1(r.useCallback((J)=>{if(!_)return J.edges.map((U)=>U.id);let q=[];if(J.width&&J.height)for(let U of J.edges){let G=J.nodeLookup.get(U.source),Z=J.nodeLookup.get(U.target);if(G&&Z&&W7({sourceNode:G,targetNode:Z,width:J.width,height:J.height,transform:J.transform}))q.push(U.id)}return q},[_]),P1)}var QG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_}};return l.jsx("polyline",{className:"arrow",style:J,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},JG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_,fill:_}};return l.jsx("polyline",{className:"arrowclosed",style:J,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},K9={[k2.Arrow]:QG,[k2.ArrowClosed]:JG};function $G(_){let Q=N1();return r.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(K9,_))return Q.getState().onError?.("009",i1.error009(_)),null;return K9[_]},[_])}var qG=({id:_,type:Q,color:J,width:q=12.5,height:U=12.5,markerUnits:G="strokeWidth",strokeWidth:Z,orient:F="auto-start-reverse"})=>{let H=$G(Q);if(!H)return null;return l.jsx("marker",{className:"react-flow__arrowhead",id:_,markerWidth:`${q}`,markerHeight:`${U}`,viewBox:"-10 -10 20 20",markerUnits:G,orient:F,refX:"0",refY:"0",children:l.jsx(H,{color:J,strokeWidth:Z})})},b9=({defaultColor:_,rfId:Q})=>{let J=M1((G)=>G.edges),q=M1((G)=>G.defaultEdgeOptions),U=r.useMemo(()=>{return M7(J,{id:Q,defaultColor:_,defaultMarkerStart:q?.markerStart,defaultMarkerEnd:q?.markerEnd})},[J,q,Q,_]);if(!U.length)return null;return l.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:l.jsx("defs",{children:U.map((G)=>l.jsx(qG,{id:G.id,type:G.type,color:G.color,width:G.width,height:G.height,markerUnits:G.markerUnits,strokeWidth:G.strokeWidth,orient:G.orient},G.id))})})};b9.displayName="MarkerDefinitions";var UG=r.memo(b9);function D9({x:_,y:Q,label:J,labelStyle:q,labelShowBg:U=!0,labelBgStyle:G,labelBgPadding:Z=[2,4],labelBgBorderRadius:F=2,children:H,className:Y,...X}){let[K,L]=r.useState({x:1,y:0,width:0,height:0}),z=C1(["react-flow__edge-textwrapper",Y]),W=r.useRef(null);if(r.useEffect(()=>{if(W.current){let O=W.current.getBBox();L({x:O.x,y:O.y,width:O.width,height:O.height})}},[J]),!J)return null;return l.jsxs("g",{transform:`translate(${_-K.width/2} ${Q-K.height/2})`,className:z,visibility:K.width?"visible":"hidden",...X,children:[U&&l.jsx("rect",{width:K.width+2*Z[0],x:-Z[0],y:-Z[1],height:K.height+2*Z[1],className:"react-flow__edge-textbg",style:G,rx:F,ry:F}),l.jsx("text",{className:"react-flow__edge-text",y:K.height/2,dy:"0.3em",ref:W,style:q,children:J}),H]})}D9.displayName="EdgeText";var GG=r.memo(D9);function R4({path:_,labelX:Q,labelY:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:H,interactionWidth:Y=20,...X}){return l.jsxs(l.Fragment,{children:[l.jsx("path",{...X,d:_,fill:"none",className:C1(["react-flow__edge-path",X.className])}),Y?l.jsx("path",{d:_,fill:"none",strokeOpacity:0,strokeWidth:Y,className:"react-flow__edge-interaction"}):null,q&&e1(Q)&&e1(J)?l.jsx(GG,{x:Q,y:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:H}):null]})}function H9({pos:_,x1:Q,y1:J,x2:q,y2:U}){if(_===J1.Left||_===J1.Right)return[0.5*(Q+q),J];return[Q,0.5*(J+U)]}function h9({sourceX:_,sourceY:Q,sourcePosition:J=J1.Bottom,targetX:q,targetY:U,targetPosition:G=J1.Top}){let[Z,F]=H9({pos:J,x1:_,y1:Q,x2:q,y2:U}),[H,Y]=H9({pos:G,x1:q,y1:U,x2:_,y2:Q}),[X,K,L,z]=G4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:Z,sourceControlY:F,targetControlX:H,targetControlY:Y});return[`M${_},${Q} C${Z},${F} ${H},${Y} ${q},${U}`,X,K,L,z]}function E9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z,targetPosition:F,label:H,labelStyle:Y,labelShowBg:X,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,interactionWidth:B})=>{let[w,A,R]=h9({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F}),I=_.isInternal?void 0:Q;return l.jsx(R4,{id:I,path:w,labelX:A,labelY:R,label:H,labelStyle:Y,labelShowBg:X,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,interactionWidth:B})})}var ZG=E9({isInternal:!1}),x9=E9({isInternal:!0});ZG.displayName="SimpleBezierEdge";x9.displayName="SimpleBezierEdgeInternal";function m9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:H,labelBgStyle:Y,labelBgPadding:X,labelBgBorderRadius:K,style:L,sourcePosition:z=J1.Bottom,targetPosition:W=J1.Top,markerEnd:O,markerStart:T,pathOptions:B,interactionWidth:w})=>{let[A,R,I]=M5({sourceX:J,sourceY:q,sourcePosition:z,targetX:U,targetY:G,targetPosition:W,borderRadius:B?.borderRadius,offset:B?.offset,stepPosition:B?.stepPosition}),C=_.isInternal?void 0:Q;return l.jsx(R4,{id:C,path:A,labelX:R,labelY:I,label:Z,labelStyle:F,labelShowBg:H,labelBgStyle:Y,labelBgPadding:X,labelBgBorderRadius:K,style:L,markerEnd:O,markerStart:T,interactionWidth:w})})}var g9=m9({isInternal:!1}),p9=m9({isInternal:!0});g9.displayName="SmoothStepEdge";p9.displayName="SmoothStepEdgeInternal";function c9(_){return r.memo(({id:Q,...J})=>{let q=_.isInternal?void 0:Q;return l.jsx(g9,{...J,id:q,pathOptions:r.useMemo(()=>({borderRadius:0,offset:J.pathOptions?.offset}),[J.pathOptions?.offset])})})}var FG=c9({isInternal:!1}),l9=c9({isInternal:!0});FG.displayName="StepEdge";l9.displayName="StepEdgeInternal";function r9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:H,labelBgStyle:Y,labelBgPadding:X,labelBgBorderRadius:K,style:L,markerEnd:z,markerStart:W,interactionWidth:O})=>{let[T,B,w]=F4({sourceX:J,sourceY:q,targetX:U,targetY:G}),A=_.isInternal?void 0:Q;return l.jsx(R4,{id:A,path:T,labelX:B,labelY:w,label:Z,labelStyle:F,labelShowBg:H,labelBgStyle:Y,labelBgPadding:X,labelBgBorderRadius:K,style:L,markerEnd:z,markerStart:W,interactionWidth:O})})}var KG=r9({isInternal:!1}),i9=r9({isInternal:!0});KG.displayName="StraightEdge";i9.displayName="StraightEdgeInternal";function d9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z=J1.Bottom,targetPosition:F=J1.Top,label:H,labelStyle:Y,labelShowBg:X,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,pathOptions:B,interactionWidth:w})=>{let[A,R,I]=Z4({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F,curvature:B?.curvature}),C=_.isInternal?void 0:Q;return l.jsx(R4,{id:C,path:A,labelX:R,labelY:I,label:H,labelStyle:Y,labelShowBg:X,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,interactionWidth:w})})}var HG=d9({isInternal:!1}),a9=d9({isInternal:!0});HG.displayName="BezierEdge";a9.displayName="BezierEdgeInternal";var X9={default:a9,straight:i9,step:l9,smoothstep:p9,simplebezier:x9},Y9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},XG=(_,Q,J)=>{if(J===J1.Left)return _-Q;if(J===J1.Right)return _+Q;return _},YG=(_,Q,J)=>{if(J===J1.Top)return _-Q;if(J===J1.Bottom)return _+Q;return _},L9="react-flow__edgeupdater";function z9({position:_,centerX:Q,centerY:J,radius:q=10,onMouseDown:U,onMouseEnter:G,onMouseOut:Z,type:F}){return l.jsx("circle",{onMouseDown:U,onMouseEnter:G,onMouseOut:Z,className:C1([L9,`${L9}-${F}`]),cx:XG(Q,q,_),cy:YG(J,q,_),r:q,stroke:"transparent",fill:"transparent"})}function LG({isReconnectable:_,reconnectRadius:Q,edge:J,sourceX:q,sourceY:U,targetX:G,targetY:Z,sourcePosition:F,targetPosition:H,onReconnect:Y,onReconnectStart:X,onReconnectEnd:K,setReconnecting:L,setUpdateHover:z}){let W=N1(),O=(R,I)=>{if(R.button!==0)return;let{autoPanOnConnect:C,domNode:P,connectionMode:k,connectionRadius:N,lib:v,onConnectStart:E,cancelConnection:g,nodeLookup:h,rfId:S,panBy:b,updateConnection:j}=W.getState(),x=I.type==="target",V=(y,p)=>{L(!1),K?.(y,J,I.type,p)},D=(y)=>Y?.(J,y),f=(y,p)=>{L(!0),X?.(R,J,I.type),E?.(y,p)};Y4.onPointerDown(R.nativeEvent,{autoPanOnConnect:C,connectionMode:k,connectionRadius:N,domNode:P,handleId:I.id,nodeId:I.nodeId,nodeLookup:h,isTarget:x,edgeUpdaterType:I.type,lib:v,flowId:S,cancelConnection:g,panBy:b,isValidConnection:(...y)=>W.getState().isValidConnection?.(...y)??!0,onConnect:D,onConnectStart:f,onConnectEnd:(...y)=>W.getState().onConnectEnd?.(...y),onReconnectEnd:V,updateConnection:j,getTransform:()=>W.getState().transform,getFromHandle:()=>W.getState().connection.fromHandle,dragThreshold:W.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=(R)=>O(R,{nodeId:J.target,id:J.targetHandle??null,type:"target"}),B=(R)=>O(R,{nodeId:J.source,id:J.sourceHandle??null,type:"source"}),w=()=>z(!0),A=()=>z(!1);return l.jsxs(l.Fragment,{children:[(_===!0||_==="source")&&l.jsx(z9,{position:F,centerX:q,centerY:U,radius:Q,onMouseDown:T,onMouseEnter:w,onMouseOut:A,type:"source"}),(_===!0||_==="target")&&l.jsx(z9,{position:H,centerX:G,centerY:Z,radius:Q,onMouseDown:B,onMouseEnter:w,onMouseOut:A,type:"target"})]})}function zG({id:_,edgesFocusable:Q,edgesReconnectable:J,elementsSelectable:q,onClick:U,onDoubleClick:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:H,onMouseLeave:Y,reconnectRadius:X,onReconnect:K,onReconnectStart:L,onReconnectEnd:z,rfId:W,edgeTypes:O,noPanClassName:T,onError:B,disableKeyboardA11y:w}){let A=M1(($1)=>$1.edgeLookup.get(_)),R=M1(($1)=>$1.defaultEdgeOptions);A=R?{...R,...A}:A;let I=A.type||"default",C=O?.[I]||X9[I];if(C===void 0)B?.("011",i1.error011(I)),I="default",C=O?.default||X9.default;let P=!!(A.focusable||Q&&typeof A.focusable>"u"),k=typeof K<"u"&&(A.reconnectable||J&&typeof A.reconnectable>"u"),N=!!(A.selectable||q&&typeof A.selectable>"u"),v=r.useRef(null),[E,g]=r.useState(!1),[h,S]=r.useState(!1),b=N1(),{zIndex:j=A.zIndex,sourceX:x,sourceY:V,targetX:D,targetY:f,sourcePosition:y,targetPosition:p}=M1(r.useCallback(($1)=>{let Z1=$1.nodeLookup.get(A.source),Y1=$1.nodeLookup.get(A.target);if(!Z1||!Y1)return Y9;let K1=B7({id:_,sourceNode:Z1,targetNode:Y1,sourceHandle:A.sourceHandle||null,targetHandle:A.targetHandle||null,connectionMode:$1.connectionMode,onError:B}),o=z7({selected:A.selected,zIndex:A.zIndex,sourceNode:Z1,targetNode:Y1,elevateOnSelect:$1.elevateEdgesOnSelect,zIndexMode:$1.zIndexMode});return{...K1||Y9,zIndex:o}},[A.source,A.target,A.sourceHandle,A.targetHandle,A.selected,A.zIndex,B]),P1),u=r.useMemo(()=>A.markerStart?`url('#${K4(A.markerStart,W)}')`:void 0,[A.markerStart,W]),s=r.useMemo(()=>A.markerEnd?`url('#${K4(A.markerEnd,W)}')`:void 0,[A.markerEnd,W]);if(A.hidden||x===null||V===null||D===null||f===null)return null;let t=($1)=>{let{addSelectedEdges:Z1,unselectNodesAndEdges:Y1,multiSelectionActive:K1}=b.getState();if(N)if(b.setState({nodesSelectionActive:!1}),A.selected&&K1)Y1({nodes:[],edges:[A]}),v.current?.blur();else Z1([_]);if(U)U($1,A)},a=G?($1)=>{G($1,{...A})}:void 0,d=Z?($1)=>{Z($1,{...A})}:void 0,c=F?($1)=>{F($1,{...A})}:void 0,e=H?($1)=>{H($1,{...A})}:void 0,Q1=Y?($1)=>{Y($1,{...A})}:void 0,G1=($1)=>{if(!w&&U6.includes($1.key)&&N){let{unselectNodesAndEdges:Z1,addSelectedEdges:Y1}=b.getState();if($1.key==="Escape")v.current?.blur(),Z1({edges:[A]});else Y1([_])}};return l.jsx("svg",{style:{zIndex:j},children:l.jsxs("g",{className:C1(["react-flow__edge",`react-flow__edge-${I}`,A.className,T,{selected:A.selected,animated:A.animated,inactive:!N&&!U,updating:E,selectable:N}]),onClick:t,onDoubleClick:a,onContextMenu:d,onMouseEnter:c,onMouseMove:e,onMouseLeave:Q1,onKeyDown:P?G1:void 0,tabIndex:P?0:void 0,role:A.ariaRole??(P?"group":"img"),"aria-roledescription":"edge","data-id":_,"data-testid":`rf__edge-${_}`,"aria-label":A.ariaLabel===null?void 0:A.ariaLabel||`Edge from ${A.source} to ${A.target}`,"aria-describedby":P?`${I9}-${W}`:void 0,ref:v,...A.domAttributes,children:[!h&&l.jsx(C,{id:_,source:A.source,target:A.target,type:A.type,selected:A.selected,animated:A.animated,selectable:N,deletable:A.deletable??!0,label:A.label,labelStyle:A.labelStyle,labelShowBg:A.labelShowBg,labelBgStyle:A.labelBgStyle,labelBgPadding:A.labelBgPadding,labelBgBorderRadius:A.labelBgBorderRadius,sourceX:x,sourceY:V,targetX:D,targetY:f,sourcePosition:y,targetPosition:p,data:A.data,style:A.style,sourceHandleId:A.sourceHandle,targetHandleId:A.targetHandle,markerStart:u,markerEnd:s,pathOptions:"pathOptions"in A?A.pathOptions:void 0,interactionWidth:A.interactionWidth}),k&&l.jsx(LG,{edge:A,isReconnectable:k,reconnectRadius:X,onReconnect:K,onReconnectStart:L,onReconnectEnd:z,sourceX:x,sourceY:V,targetX:D,targetY:f,sourcePosition:y,targetPosition:p,setUpdateHover:g,setReconnecting:S})]})})}var WG=r.memo(zG),AG=(_)=>({edgesFocusable:_.edgesFocusable,edgesReconnectable:_.edgesReconnectable,elementsSelectable:_.elementsSelectable,connectionMode:_.connectionMode,onError:_.onError});function s9({defaultMarkerColor:_,onlyRenderVisibleElements:Q,rfId:J,edgeTypes:q,noPanClassName:U,onReconnect:G,onEdgeContextMenu:Z,onEdgeMouseEnter:F,onEdgeMouseMove:H,onEdgeMouseLeave:Y,onEdgeClick:X,reconnectRadius:K,onEdgeDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,disableKeyboardA11y:O}){let{edgesFocusable:T,edgesReconnectable:B,elementsSelectable:w,onError:A}=M1(AG,P1),R=_G(Q);return l.jsxs("div",{className:"react-flow__edges",children:[l.jsx(UG,{defaultColor:_,rfId:J}),R.map((I)=>{return l.jsx(WG,{id:I,edgesFocusable:T,edgesReconnectable:B,elementsSelectable:w,noPanClassName:U,onReconnect:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:H,onMouseLeave:Y,onClick:X,reconnectRadius:K,onDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,rfId:J,onError:A,edgeTypes:q,disableKeyboardA11y:O},I)})]})}s9.displayName="EdgeRenderer";var BG=r.memo(s9),W9=(_)=>`translate(${_[0]}px,${_[1]}px) scale(${_[2]})`;function MG({children:_}){let Q=N1(),J=r.useRef(null),[q]=r.useState(()=>Q.getState().transform);return S9(()=>{let U=null,G=()=>{let Z=Q.getState().transform;if(U&&Z[0]===U[0]&&Z[1]===U[1]&&Z[2]===U[2])return;if(U=Z,J.current)J.current.style.transform=W9(Z)};return G(),Q.subscribe(G)},[Q]),l.jsx("div",{ref:J,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:W9(q)},children:_})}function TG(_){let Q=R5(),J=r.useRef(!1);r.useEffect(()=>{if(!J.current&&Q.viewportInitialized&&_)setTimeout(()=>_(Q),1),J.current=!0},[_,Q.viewportInitialized])}var RG=(_)=>_.panZoom?.syncViewport;function OG(_){let Q=M1(RG),J=N1();return r.useEffect(()=>{if(_)Q?.(_),J.setState({transform:[_.x,_.y,_.zoom]})},[_,Q]),null}function A9(_){return _.connection.inProgress?{..._.connection,to:u2(_.connection.to,_.transform)}:{..._.connection}}function fG(_){if(_)return(J)=>{let q=A9(J);return _(q)};return A9}function IG(_){let Q=fG(_);return M1(Q,P1)}var wG=(_)=>({nodesConnectable:_.nodesConnectable,isValid:_.connection.isValid,inProgress:_.connection.inProgress,width:_.width,height:_.height});function PG({containerStyle:_,style:Q,type:J,component:q}){let{nodesConnectable:U,width:G,height:Z,isValid:F,inProgress:H}=M1(wG,P1);if(!(G&&U&&H))return null;return l.jsx("svg",{style:_,width:G,height:Z,className:"react-flow__connectionline react-flow__container",children:l.jsx("g",{className:C1(["react-flow__connection",M6(F)]),children:l.jsx(t9,{style:Q,type:J,CustomComponent:q,isValid:F})})})}var t9=({style:_,type:Q=W0.Bezier,CustomComponent:J,isValid:q})=>{let{inProgress:U,from:G,fromNode:Z,fromHandle:F,fromPosition:H,to:Y,toNode:X,toHandle:K,toPosition:L,pointer:z}=IG();if(!U)return;if(J)return l.jsx(J,{connectionLineType:Q,connectionLineStyle:_,fromNode:Z,fromHandle:F,fromX:G.x,fromY:G.y,toX:Y.x,toY:Y.y,fromPosition:H,toPosition:L,connectionStatus:M6(q),toNode:X,toHandle:K,pointer:z});let W="",O={sourceX:G.x,sourceY:G.y,sourcePosition:H,targetX:Y.x,targetY:Y.y,targetPosition:L};switch(Q){case W0.Bezier:[W]=Z4(O);break;case W0.SimpleBezier:[W]=h9(O);break;case W0.Step:[W]=M5({...O,borderRadius:0});break;case W0.SmoothStep:[W]=M5(O);break;default:[W]=F4(O)}return l.jsx("path",{d:W,fill:"none",className:"react-flow__connection-path",style:_})};t9.displayName="ConnectionLine";var NG={};function B9(_=NG){let Q=r.useRef(_),J=N1();r.useEffect(()=>{{let q=new Set([...Object.keys(Q.current),...Object.keys(_)]);for(let U of q)if(Q.current[U]!==_[U]){J.getState().onError?.("002",i1.error002());break}Q.current=_}},[_])}function CG(){let _=N1(),Q=r.useRef(!1);r.useEffect(()=>{if(!Q.current){let J=document.querySelector(".react-flow__pane");if(J&&window.getComputedStyle(J).zIndex!=="1")_.getState().onError?.("013",i1.error013("react"));Q.current=!0}},[])}function o9({nodeTypes:_,edgeTypes:Q,onInit:J,onNodeClick:q,onEdgeClick:U,onNodeDoubleClick:G,onEdgeDoubleClick:Z,onNodeMouseEnter:F,onNodeMouseMove:H,onNodeMouseLeave:Y,onNodeContextMenu:X,onSelectionContextMenu:K,onSelectionStart:L,onSelectionEnd:z,connectionLineType:W,connectionLineStyle:O,connectionLineComponent:T,connectionLineContainerStyle:B,selectionKeyCode:w,selectionOnDrag:A,selectionMode:R,multiSelectionKeyCode:I,panActivationKeyCode:C,zoomActivationKeyCode:P,deleteKeyCode:k,onlyRenderVisibleElements:N,elementsSelectable:v,defaultViewport:E,translateExtent:g,minZoom:h,maxZoom:S,preventScrolling:b,defaultMarkerColor:j,zoomOnScroll:x,zoomOnPinch:V,panOnScroll:D,panOnScrollSpeed:f,panOnScrollMode:y,zoomOnDoubleClick:p,panOnDrag:u,autoPanOnSelection:s,onPaneClick:t,onPaneMouseEnter:a,onPaneMouseMove:d,onPaneMouseLeave:c,onPaneScroll:e,onPaneContextMenu:Q1,paneClickDistance:G1,nodeClickDistance:$1,onEdgeContextMenu:Z1,onEdgeMouseEnter:Y1,onEdgeMouseMove:K1,onEdgeMouseLeave:o,reconnectRadius:z1,onReconnect:q1,onReconnectStart:y1,onReconnectEnd:c1,noDragClassName:l1,noWheelClassName:k0,noPanClassName:F0,disableKeyboardA11y:M0,nodeExtent:a1,rfId:o1,viewport:n1,onViewportChange:K0,nodesDraggable:B2}){return B9(_),B9(Q),CG(),TG(J),OG(n1),l.jsx(lU,{onPaneClick:t,onPaneMouseEnter:a,onPaneMouseMove:d,onPaneMouseLeave:c,onPaneContextMenu:Q1,onPaneScroll:e,paneClickDistance:G1,deleteKeyCode:k,selectionKeyCode:w,selectionOnDrag:A,selectionMode:R,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:I,panActivationKeyCode:C,zoomActivationKeyCode:P,elementsSelectable:v,zoomOnScroll:x,zoomOnPinch:V,zoomOnDoubleClick:p,panOnScroll:D,panOnScrollSpeed:f,panOnScrollMode:y,panOnDrag:u,autoPanOnSelection:s,defaultViewport:E,translateExtent:g,minZoom:h,maxZoom:S,onSelectionContextMenu:K,preventScrolling:b,noDragClassName:l1,noWheelClassName:k0,noPanClassName:F0,disableKeyboardA11y:M0,onViewportChange:K0,isControlledViewport:!!n1,children:l.jsxs(MG,{children:[l.jsx(BG,{edgeTypes:Q,onEdgeClick:U,onEdgeDoubleClick:Z,onReconnect:q1,onReconnectStart:y1,onReconnectEnd:c1,onlyRenderVisibleElements:N,onEdgeContextMenu:Z1,onEdgeMouseEnter:Y1,onEdgeMouseMove:K1,onEdgeMouseLeave:o,reconnectRadius:z1,defaultMarkerColor:j,noPanClassName:F0,disableKeyboardA11y:M0,rfId:o1}),l.jsx(PG,{style:O,type:W,component:T,containerStyle:B}),l.jsx("div",{className:"react-flow__edgelabel-renderer"}),l.jsx(eU,{nodeTypes:_,onNodeClick:q,onNodeDoubleClick:G,onNodeMouseEnter:F,onNodeMouseMove:H,onNodeMouseLeave:Y,onNodeContextMenu:X,nodeClickDistance:$1,onlyRenderVisibleElements:N,noPanClassName:F0,noDragClassName:l1,disableKeyboardA11y:M0,nodeExtent:a1,rfId:o1,nodesDraggable:B2}),l.jsx("div",{className:"react-flow__viewport-portal"})]})})}o9.displayName="GraphView";var SG=r.memo(o9),kG=z6("React Flow","https://reactflow.dev/"),M9=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:H=0.5,maxZoom:Y=2,nodeOrigin:X,nodeExtent:K,zIndexMode:L="basic"}={})=>{let z=new Map,W=new Map,O=new Map,T=new Map,B=q??Q??[],w=J??_??[],A=X??[0,0],R=K??v2;C6(O,T,B);let{nodesInitialized:I}=H4(w,z,W,{nodeOrigin:A,nodeExtent:R,zIndexMode:L}),C=[0,0,1];if(Z&&U&&G){let P=Z2(z,{filter:(E)=>!!((E.width||E.initialWidth)&&(E.height||E.initialHeight))}),{x:k,y:N,zoom:v}=B5(P,U,G,H,Y,F?.padding??0.1);C=[k,N,v]}return{rfId:"1",width:U??0,height:G??0,transform:C,nodes:w,nodesInitialized:I,nodeLookup:z,parentLookup:W,edges:B,edgeLookup:T,connectionLookup:O,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:J!==void 0,hasDefaultEdges:q!==void 0,panZoom:null,minZoom:H,maxZoom:Y,translateExtent:v2,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:E0.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:A,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:Z??!1,fitViewOptions:F,fitViewResolver:null,connection:{...Z6},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:kG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:G6,zIndexMode:L,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},yG=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:H,maxZoom:Y,nodeOrigin:X,nodeExtent:K,zIndexMode:L})=>l7((z,W)=>{async function O(){let{nodeLookup:T,panZoom:B,fitViewOptions:w,fitViewResolver:A,width:R,height:I,minZoom:C,maxZoom:P}=W();if(!B)return;await Z7({nodes:T,width:R,height:I,panZoom:B,minZoom:C,maxZoom:P},w),A?.resolve(!0),z({fitViewResolver:null})}return{...M9({nodes:_,edges:Q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:H,maxZoom:Y,nodeOrigin:X,nodeExtent:K,defaultNodes:J,defaultEdges:q,zIndexMode:L}),setNodes:(T)=>{let{nodeLookup:B,parentLookup:w,nodeOrigin:A,nodeExtent:R,elevateNodesOnSelect:I,fitViewQueued:C,zIndexMode:P,nodesSelectionActive:k}=W(),{nodesInitialized:N,hasSelectedNodes:v}=H4(T,B,w,{nodeOrigin:A,nodeExtent:R,elevateNodesOnSelect:I,checkEquality:!0,zIndexMode:P}),E=k&&v;if(C&&N)O(),z({nodes:T,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:E});else z({nodes:T,nodesInitialized:N,nodesSelectionActive:E})},setEdges:(T)=>{let{connectionLookup:B,edgeLookup:w}=W();C6(B,w,T),z({edges:T})},setDefaultNodesAndEdges:(T,B)=>{if(T){let{setNodes:w}=W();w(T),z({hasDefaultNodes:!0})}if(B){let{setEdges:w}=W();w(B),z({hasDefaultEdges:!0})}},updateNodeInternals:(T)=>{let{triggerNodeChanges:B,nodeLookup:w,parentLookup:A,domNode:R,nodeOrigin:I,nodeExtent:C,debug:P,fitViewQueued:k,zIndexMode:N}=W(),{changes:v,updatedInternals:E}=I7(T,w,A,R,I,C,N);if(!E)return;if(O7(w,A,{nodeOrigin:I,nodeExtent:C,zIndexMode:N}),k)O(),z({fitViewQueued:!1,fitViewOptions:void 0});else z({});if(v?.length>0){if(P)console.log("React Flow: trigger node changes",v);B?.(v)}},updateNodePositions:(T,B=!1)=>{let w=[],A=[],{nodeLookup:R,triggerNodeChanges:I,connection:C,updateConnection:P,onNodesChangeMiddlewareMap:k}=W();for(let[N,v]of T){let E=R.get(N),g=!!(E?.expandParent&&E?.parentId&&v?.position),h={id:N,type:"position",position:g?{x:Math.max(0,v.position.x),y:Math.max(0,v.position.y)}:v.position,dragging:B};if(E&&C.inProgress&&C.fromNode.id===E.id){let S=x0(E,C.fromHandle,J1.Left,!0);P({...C,from:S})}if(g&&E.parentId)w.push({id:N,parentId:E.parentId,rect:{...v.internals.positionAbsolute,width:v.measured.width??0,height:v.measured.height??0}});A.push(h)}if(w.length>0){let{parentLookup:N,nodeOrigin:v}=W(),E=X4(w,R,N,v);A.push(...E)}for(let N of k.values())A=N(A);I(A)},triggerNodeChanges:(T)=>{let{onNodesChange:B,setNodes:w,nodes:A,hasDefaultNodes:R,debug:I}=W();if(T?.length){if(R){let C=N9(T,A);w(C)}if(I)console.log("React Flow: trigger node changes",T);B?.(T)}},triggerEdgeChanges:(T)=>{let{onEdgesChange:B,setEdges:w,edges:A,hasDefaultEdges:R,debug:I}=W();if(T?.length){if(R){let C=XU(T,A);w(C)}if(I)console.log("React Flow: trigger edge changes",T);B?.(T)}},addSelectedNodes:(T)=>{let{multiSelectionActive:B,edgeLookup:w,nodeLookup:A,triggerNodeChanges:R,triggerEdgeChanges:I}=W();if(B){let C=T.map((P)=>F2(P,!0));R(C);return}R(D2(A,new Set([...T]),!0)),I(D2(w))},addSelectedEdges:(T)=>{let{multiSelectionActive:B,edgeLookup:w,nodeLookup:A,triggerNodeChanges:R,triggerEdgeChanges:I}=W();if(B){let C=T.map((P)=>F2(P,!0));I(C);return}I(D2(w,new Set([...T]))),R(D2(A,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:B}={})=>{let{edges:w,nodes:A,nodeLookup:R,triggerNodeChanges:I,triggerEdgeChanges:C}=W(),P=T?T:A,k=B?B:w,N=[];for(let E of P){if(!E.selected)continue;let g=R.get(E.id);if(g)g.selected=!1;N.push(F2(E.id,!1))}let v=[];for(let E of k){if(!E.selected)continue;v.push(F2(E.id,!1))}I(N),C(v)},setMinZoom:(T)=>{let{panZoom:B,maxZoom:w}=W();B?.setScaleExtent([T,w]),z({minZoom:T})},setMaxZoom:(T)=>{let{panZoom:B,minZoom:w}=W();B?.setScaleExtent([w,T]),z({maxZoom:T})},setTranslateExtent:(T)=>{W().panZoom?.setTranslateExtent(T),z({translateExtent:T})},resetSelectedElements:()=>{let{edges:T,nodes:B,triggerNodeChanges:w,triggerEdgeChanges:A,elementsSelectable:R}=W();if(!R)return;let I=B.reduce((P,k)=>k.selected?[...P,F2(k.id,!1)]:P,[]),C=T.reduce((P,k)=>k.selected?[...P,F2(k.id,!1)]:P,[]);w(I),A(C)},setNodeExtent:(T)=>{let{nodes:B,nodeLookup:w,parentLookup:A,nodeOrigin:R,elevateNodesOnSelect:I,nodeExtent:C,zIndexMode:P}=W();if(T[0][0]===C[0][0]&&T[0][1]===C[0][1]&&T[1][0]===C[1][0]&&T[1][1]===C[1][1])return;H4(B,w,A,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:I,checkEquality:!1,zIndexMode:P}),z({nodeExtent:T})},panBy:(T)=>{let{transform:B,width:w,height:A,panZoom:R,translateExtent:I}=W();return w7({delta:T,panZoom:R,transform:B,translateExtent:I,width:w,height:A})},setCenter:async(T,B,w)=>{let{width:A,height:R,maxZoom:I,panZoom:C}=W();if(!C)return!1;let P=typeof w?.zoom<"u"?w.zoom:I;return await C.setViewport({x:A/2-T*P,y:R/2-B*P,zoom:P},{duration:w?.duration,ease:w?.ease,interpolate:w?.interpolate}),!0},cancelConnection:()=>{z({connection:{...Z6}})},updateConnection:(T)=>{z({connection:T})},reset:()=>z({...M9()})}},Object.is);function b6({initialNodes:_,initialEdges:Q,defaultNodes:J,defaultEdges:q,initialWidth:U,initialHeight:G,initialMinZoom:Z,initialMaxZoom:F,initialFitViewOptions:H,fitView:Y,nodeOrigin:X,nodeExtent:K,zIndexMode:L,children:z}){let[W]=r.useState(()=>yG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Y,minZoom:Z,maxZoom:F,fitViewOptions:H,nodeOrigin:X,nodeExtent:K,zIndexMode:L}));return l.jsx(rq,{value:W,children:l.jsx(AU,{children:l.jsx(vU,{children:z})})})}function vG({children:_,nodes:Q,edges:J,defaultNodes:q,defaultEdges:U,width:G,height:Z,fitView:F,fitViewOptions:H,minZoom:Y,maxZoom:X,nodeOrigin:K,nodeExtent:L,zIndexMode:z}){if(r.useContext(M4))return l.jsx(l.Fragment,{children:_});return l.jsx(b6,{initialNodes:Q,initialEdges:J,defaultNodes:q,defaultEdges:U,initialWidth:G,initialHeight:Z,fitView:F,initialFitViewOptions:H,initialMinZoom:Y,initialMaxZoom:X,nodeOrigin:K,nodeExtent:L,zIndexMode:z,children:_})}var jG={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function VG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,className:U,nodeTypes:G,edgeTypes:Z,onNodeClick:F,onEdgeClick:H,onInit:Y,onMove:X,onMoveStart:K,onMoveEnd:L,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:T,onClickConnectEnd:B,onNodeMouseEnter:w,onNodeMouseMove:A,onNodeMouseLeave:R,onNodeContextMenu:I,onNodeDoubleClick:C,onNodeDragStart:P,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:v,onEdgesDelete:E,onDelete:g,onSelectionChange:h,onSelectionDragStart:S,onSelectionDrag:b,onSelectionDragStop:j,onSelectionContextMenu:x,onSelectionStart:V,onSelectionEnd:D,onBeforeDelete:f,connectionMode:y,connectionLineType:p=W0.Bezier,connectionLineStyle:u,connectionLineComponent:s,connectionLineContainerStyle:t,deleteKeyCode:a="Backspace",selectionKeyCode:d="Shift",selectionOnDrag:c=!1,selectionMode:e=$2.Full,panActivationKeyCode:Q1="Space",multiSelectionKeyCode:G1=b2()?"Meta":"Control",zoomActivationKeyCode:$1=b2()?"Meta":"Control",snapToGrid:Z1,snapGrid:Y1,onlyRenderVisibleElements:K1=!1,selectNodesOnDrag:o,nodesDraggable:z1,autoPanOnNodeFocus:q1,nodesConnectable:y1,nodesFocusable:c1,nodeOrigin:l1=w9,edgesFocusable:k0,edgesReconnectable:F0,elementsSelectable:M0=!0,defaultViewport:a1=qU,minZoom:o1=0.5,maxZoom:n1=2,translateExtent:K0=v2,preventScrolling:B2=!0,nodeExtent:y0,defaultMarkerColor:M2="#b1b1b7",zoomOnScroll:T2=!0,zoomOnPinch:g2=!0,panOnScroll:S5=!1,panOnScrollSpeed:r0=0.5,panOnScrollMode:M=I0.Free,zoomOnDoubleClick:m=!0,panOnDrag:n=!0,onPaneClick:_1,onPaneMouseEnter:U1,onPaneMouseMove:W1,onPaneMouseLeave:L1,onPaneScroll:f1,onPaneContextMenu:A1,paneClickDistance:H0=1,nodeClickDistance:v0=0,children:y4,onReconnect:v4,onReconnectStart:t_,onReconnectEnd:o_,onEdgeContextMenu:n_,onEdgeDoubleClick:e_,onEdgeMouseEnter:_Q,onEdgeMouseMove:QQ,onEdgeMouseLeave:JQ,reconnectRadius:$Q=10,onNodesChange:qQ,onEdgesChange:UQ,noDragClassName:GQ="nodrag",noWheelClassName:ZQ="nowheel",noPanClassName:o6="nopan",fitView:n6,fitViewOptions:e6,connectOnClick:FQ,attributionPosition:KQ,proOptions:HQ,defaultEdgeOptions:XQ,elevateNodesOnSelect:YQ=!0,elevateEdgesOnSelect:LQ=!1,disableKeyboardA11y:_8=!1,autoPanOnConnect:zQ,autoPanOnNodeDrag:WQ,autoPanOnSelection:AQ=!0,autoPanSpeed:BQ,connectionRadius:MQ,isValidConnection:TQ,onError:RQ,style:OQ,id:Q8,nodeDragThreshold:fQ,connectionDragThreshold:IQ,viewport:wQ,onViewportChange:PQ,width:NQ,height:CQ,colorMode:SQ="light",debug:kQ,onScroll:J8,ariaLabelConfig:yQ,zIndexMode:$8="basic",...vQ},jQ){let j4=Q8||"1",VQ=FU(SQ),uQ=r.useCallback((q8)=>{q8.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),J8?.(q8)},[J8]);return l.jsx("div",{"data-testid":"rf__wrapper",...vQ,onScroll:uQ,style:{...OQ,...jG},ref:jQ,className:C1(["react-flow",U,VQ]),id:Q8,role:"application",children:l.jsxs(vG,{nodes:_,edges:Q,width:NQ,height:CQ,fitView:n6,fitViewOptions:e6,minZoom:o1,maxZoom:n1,nodeOrigin:l1,nodeExtent:y0,zIndexMode:$8,children:[l.jsx(ZU,{nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:T,onClickConnectEnd:B,nodesDraggable:z1,autoPanOnNodeFocus:q1,nodesConnectable:y1,nodesFocusable:c1,edgesFocusable:k0,edgesReconnectable:F0,elementsSelectable:M0,elevateNodesOnSelect:YQ,elevateEdgesOnSelect:LQ,minZoom:o1,maxZoom:n1,nodeExtent:y0,onNodesChange:qQ,onEdgesChange:UQ,snapToGrid:Z1,snapGrid:Y1,connectionMode:y,translateExtent:K0,connectOnClick:FQ,defaultEdgeOptions:XQ,fitView:n6,fitViewOptions:e6,onNodesDelete:v,onEdgesDelete:E,onDelete:g,onNodeDragStart:P,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:b,onSelectionDragStart:S,onSelectionDragStop:j,onMove:X,onMoveStart:K,onMoveEnd:L,noPanClassName:o6,nodeOrigin:l1,rfId:j4,autoPanOnConnect:zQ,autoPanOnNodeDrag:WQ,autoPanSpeed:BQ,onError:RQ,connectionRadius:MQ,isValidConnection:TQ,selectNodesOnDrag:o,nodeDragThreshold:fQ,connectionDragThreshold:IQ,onBeforeDelete:f,debug:kQ,ariaLabelConfig:yQ,zIndexMode:$8}),l.jsx(SG,{onInit:Y,onNodeClick:F,onEdgeClick:H,onNodeMouseEnter:w,onNodeMouseMove:A,onNodeMouseLeave:R,onNodeContextMenu:I,onNodeDoubleClick:C,nodeTypes:G,edgeTypes:Z,connectionLineType:p,connectionLineStyle:u,connectionLineComponent:s,connectionLineContainerStyle:t,selectionKeyCode:d,selectionOnDrag:c,selectionMode:e,deleteKeyCode:a,multiSelectionKeyCode:G1,panActivationKeyCode:Q1,zoomActivationKeyCode:$1,onlyRenderVisibleElements:K1,defaultViewport:a1,translateExtent:K0,minZoom:o1,maxZoom:n1,preventScrolling:B2,zoomOnScroll:T2,zoomOnPinch:g2,zoomOnDoubleClick:m,panOnScroll:S5,panOnScrollSpeed:r0,panOnScrollMode:M,panOnDrag:n,autoPanOnSelection:AQ,onPaneClick:_1,onPaneMouseEnter:U1,onPaneMouseMove:W1,onPaneMouseLeave:L1,onPaneScroll:f1,onPaneContextMenu:A1,paneClickDistance:H0,nodeClickDistance:v0,onSelectionContextMenu:x,onSelectionStart:V,onSelectionEnd:D,onReconnect:v4,onReconnectStart:t_,onReconnectEnd:o_,onEdgeContextMenu:n_,onEdgeDoubleClick:e_,onEdgeMouseEnter:_Q,onEdgeMouseMove:QQ,onEdgeMouseLeave:JQ,reconnectRadius:$Q,defaultMarkerColor:M2,noDragClassName:GQ,noWheelClassName:ZQ,noPanClassName:o6,rfId:j4,disableKeyboardA11y:_8,nodeExtent:y0,viewport:wQ,onViewportChange:PQ,nodesDraggable:z1}),l.jsx($U,{onSelectionChange:h}),y4,l.jsx(nq,{proOptions:HQ,position:KQ}),l.jsx(oq,{rfId:j4,disableKeyboardA11y:_8})]})})}var n9=C9(VG);function e9(_){let[Q,J]=r.useState(_),q=r.useCallback((U)=>J((G)=>N9(U,G)),[]);return[Q,J,q]}var IB=i1.error014();function uG({dimensions:_,lineWidth:Q,variant:J,className:q}){return l.jsx("path",{strokeWidth:Q,d:`M${_[0]/2} 0 V${_[1]} M0 ${_[1]/2} H${_[0]}`,className:C1(["react-flow__background-pattern",J,q])})}function bG({radius:_,className:Q}){return l.jsx("circle",{cx:_,cy:_,r:_,className:C1(["react-flow__background-pattern","dots",Q])})}var A0;(function(_){_.Lines="lines",_.Dots="dots",_.Cross="cross"})(A0||(A0={}));var DG={[A0.Dots]:1,[A0.Lines]:1,[A0.Cross]:6},hG=(_)=>({transform:_.transform,patternId:`pattern-${_.rfId}`});function __({id:_,variant:Q=A0.Dots,gap:J=20,size:q,lineWidth:U=1,offset:G=0,color:Z,bgColor:F,style:H,className:Y,patternClassName:X}){let K=r.useRef(null),{transform:L,patternId:z}=M1(hG,P1),W=q||DG[Q],O=Q===A0.Dots,T=Q===A0.Cross,B=Array.isArray(J)?J:[J,J],w=[B[0]*L[2]||1,B[1]*L[2]||1],A=W*L[2],R=Array.isArray(G)?G:[G,G],I=T?[A,A]:w,C=[R[0]*L[2]+I[0]/2,R[1]*L[2]+I[1]/2],P=`${z}${_?_:""}`;return l.jsxs("svg",{className:C1(["react-flow__background",Y]),style:{...H,...T4,"--xy-background-color-props":F,"--xy-background-pattern-color-props":Z},ref:K,"data-testid":"rf__background",children:[l.jsx("pattern",{id:P,x:L[0]%w[0],y:L[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:O?l.jsx(bG,{radius:A/2,className:X}):l.jsx(uG,{dimensions:I,lineWidth:U,variant:Q,className:X})}),l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}__.displayName="Background";var Q_=r.memo(__);function EG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:l.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function xG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:l.jsx("path",{d:"M0 0h32v4.2H0z"})})}function mG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:l.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 gG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 pG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.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 W4({children:_,className:Q,...J}){return l.jsx("button",{type:"button",className:C1(["react-flow__controls-button",Q]),...J,children:_})}var cG=(_)=>({isInteractive:_.nodesDraggable||_.nodesConnectable||_.elementsSelectable,minZoomReached:_.transform[2]<=_.minZoom,maxZoomReached:_.transform[2]>=_.maxZoom,ariaLabelConfig:_.ariaLabelConfig});function J_({style:_,showZoom:Q=!0,showFitView:J=!0,showInteractive:q=!0,fitViewOptions:U,onZoomIn:G,onZoomOut:Z,onFitView:F,onInteractiveChange:H,className:Y,children:X,position:K="bottom-left",orientation:L="vertical","aria-label":z}){let W=N1(),{isInteractive:O,minZoomReached:T,maxZoomReached:B,ariaLabelConfig:w}=M1(cG,P1),{zoomIn:A,zoomOut:R,fitView:I}=R5(),C=()=>{A(),G?.()},P=()=>{R(),Z?.()},k=()=>{I(U),F?.()},N=()=>{W.setState({nodesDraggable:!O,nodesConnectable:!O,elementsSelectable:!O}),H?.(!O)};return l.jsxs(K2,{className:C1(["react-flow__controls",L==="horizontal"?"horizontal":"vertical",Y]),position:K,style:_,"data-testid":"rf__controls","aria-label":z??w["controls.ariaLabel"],children:[Q&&l.jsxs(l.Fragment,{children:[l.jsx(W4,{onClick:C,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:B,children:l.jsx(EG,{})}),l.jsx(W4,{onClick:P,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:T,children:l.jsx(xG,{})})]}),J&&l.jsx(W4,{className:"react-flow__controls-fitview",onClick:k,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:l.jsx(mG,{})}),q&&l.jsx(W4,{className:"react-flow__controls-interactive",onClick:N,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:O?l.jsx(pG,{}):l.jsx(gG,{})}),X]})}J_.displayName="Controls";var $_=r.memo(J_);function lG({id:_,x:Q,y:J,width:q,height:U,style:G,color:Z,strokeColor:F,strokeWidth:H,className:Y,borderRadius:X,shapeRendering:K,selected:L,onClick:z}){let{background:W,backgroundColor:O}=G||{},T=Z||W||O;return l.jsx("rect",{className:C1(["react-flow__minimap-node",{selected:L},Y]),x:Q,y:J,rx:X,ry:X,width:q,height:U,style:{fill:T,stroke:F,strokeWidth:H},shapeRendering:K,onClick:z?(B)=>z(B,_):void 0})}var rG=r.memo(lG),iG=(_)=>_.nodes.map((Q)=>Q.id),v6=(_)=>_ instanceof Function?_:()=>_;function dG({nodeStrokeColor:_,nodeColor:Q,nodeClassName:J="",nodeBorderRadius:q=5,nodeStrokeWidth:U,nodeComponent:G=rG,onClick:Z}){let F=M1(iG,P1),H=v6(Q),Y=v6(_),X=v6(J),K=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return l.jsx(l.Fragment,{children:F.map((L)=>l.jsx(sG,{id:L,nodeColorFunc:H,nodeStrokeColorFunc:Y,nodeClassNameFunc:X,nodeBorderRadius:q,nodeStrokeWidth:U,NodeComponent:G,onClick:Z,shapeRendering:K},L))})}function aG({id:_,nodeColorFunc:Q,nodeStrokeColorFunc:J,nodeClassNameFunc:q,nodeBorderRadius:U,nodeStrokeWidth:G,shapeRendering:Z,NodeComponent:F,onClick:H}){let{node:Y,x:X,y:K,width:L,height:z}=M1((W)=>{let O=W.nodeLookup.get(_);if(!O)return{node:void 0,x:0,y:0,width:0,height:0};let T=O.internals.userNode,{x:B,y:w}=O.internals.positionAbsolute,{width:A,height:R}=Q0(T);return{node:T,x:B,y:w,width:A,height:R}},P1);if(!Y||Y.hidden||!W6(Y))return null;return l.jsx(F,{x:X,y:K,width:L,height:z,style:Y.style,selected:!!Y.selected,className:q(Y),color:Q(Y),borderRadius:U,strokeColor:J(Y),strokeWidth:G,shapeRendering:Z,onClick:H,id:Y.id})}var sG=r.memo(aG),tG=r.memo(dG),oG=200,nG=150,eG=(_)=>!_.hidden,_Z=(_)=>{let Q={x:-_.transform[0]/_.transform[2],y:-_.transform[1]/_.transform[2],width:_.width/_.transform[2],height:_.height/_.transform[2]},J=!1;for(let q of _.nodeLookup.values())if(!q.hidden){J=!0;break}return{viewBB:Q,boundingRect:J?Y6(Z2(_.nodeLookup,{filter:eG}),Q):Q,rfId:_.rfId,panZoom:_.panZoom,translateExtent:_.translateExtent,flowWidth:_.width,flowHeight:_.height,ariaLabelConfig:_.ariaLabelConfig}},T9=(_,Q)=>_.x===Q.x&&_.y===Q.y&&_.width===Q.width&&_.height===Q.height,QZ=(_,Q)=>T9(_.viewBB,Q.viewBB)&&T9(_.boundingRect,Q.boundingRect)&&_.rfId===Q.rfId&&_.panZoom===Q.panZoom&&_.translateExtent===Q.translateExtent&&_.flowWidth===Q.flowWidth&&_.flowHeight===Q.flowHeight&&_.ariaLabelConfig===Q.ariaLabelConfig,JZ="react-flow__minimap-desc";function q_({style:_,className:Q,nodeStrokeColor:J,nodeColor:q,nodeClassName:U="",nodeBorderRadius:G=5,nodeStrokeWidth:Z,nodeComponent:F,bgColor:H,maskColor:Y,maskStrokeColor:X,maskStrokeWidth:K,position:L="bottom-right",onClick:z,onNodeClick:W,pannable:O=!1,zoomable:T=!1,ariaLabel:B,inversePan:w,zoomStep:A=1,offsetScale:R=5}){let I=N1(),C=r.useRef(null),{boundingRect:P,panZoom:k,viewBB:N,rfId:v,translateExtent:E,flowWidth:g,flowHeight:h,ariaLabelConfig:S}=M1(_Z,QZ),b=_?.width??oG,j=_?.height??nG,x=P.width/b,V=P.height/j,D=Math.max(x,V),f=D*b,y=D*j,p=R*D,u=P.x-(f-P.width)/2-p,s=P.y-(y-P.height)/2-p,t=f+p*2,a=y+p*2,d=`${JZ}-${v}`,c=r.useRef(0),e=r.useRef();c.current=D,r.useEffect(()=>{let Y1=I.getState().panZoom;if(C.current&&Y1)return e.current=v7({domNode:C.current,panZoom:Y1,getTransform:()=>I.getState().transform,getViewScale:()=>c.current}),()=>{e.current?.destroy()}},[k]),r.useEffect(()=>{e.current?.update({translateExtent:E,width:g,height:h,inversePan:w,pannable:O,zoomStep:A,zoomable:T})},[O,T,w,A,E,g,h]);let Q1=z?(Y1)=>{let[K1,o]=e.current?.pointer(Y1)||[0,0];z(Y1,{x:K1,y:o})}:void 0,G1=r.useCallback((Y1,K1)=>{let o=I.getState().nodeLookup.get(K1).internals.userNode;W?.(Y1,o)},[W]),$1=W?G1:void 0,Z1=B??S["minimap.ariaLabel"];return l.jsx(K2,{position:L,style:{..._,"--xy-minimap-background-color-props":typeof H==="string"?H:void 0,"--xy-minimap-mask-background-color-props":typeof Y==="string"?Y:void 0,"--xy-minimap-mask-stroke-color-props":typeof X==="string"?X:void 0,"--xy-minimap-mask-stroke-width-props":typeof K==="number"?K*D:void 0,"--xy-minimap-node-background-color-props":typeof q==="string"?q:void 0,"--xy-minimap-node-stroke-color-props":typeof J==="string"?J:void 0,"--xy-minimap-node-stroke-width-props":typeof Z==="number"?Z:void 0},className:C1(["react-flow__minimap",Q]),"data-testid":"rf__minimap",children:l.jsxs("svg",{width:b,height:j,viewBox:`${u} ${s} ${t} ${a}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":d,ref:C,onClick:Q1,children:[Z1&&l.jsx("title",{id:d,children:Z1}),l.jsx(tG,{onClick:$1,nodeColor:q,nodeStrokeColor:J,nodeBorderRadius:G,nodeClassName:U,nodeStrokeWidth:Z,nodeComponent:F}),l.jsx("path",{className:"react-flow__minimap-mask",d:`M${u-p},${s-p}h${t+p*2}v${a+p*2}h${-t-p*2}z
|
|
34
|
-
M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}q_.displayName="MiniMap";var U_=r.memo(q_),$Z=(_)=>(Q)=>_?`${Math.max(1/Q.transform[2],1)}`:void 0,qZ={[m0.Line]:"right",[m0.Handle]:"bottom-right"};function UZ({nodeId:_,position:Q,variant:J=m0.Handle,className:q,style:U=void 0,children:G,color:Z,minWidth:F=10,minHeight:H=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:X=Number.MAX_VALUE,keepAspectRatio:K=!1,resizeDirection:L,autoScale:z=!0,shouldResize:W,onResizeStart:O,onResize:T,onResizeEnd:B}){let w=u6(),A=typeof _==="string"?_:w,R=N1(),I=r.useRef(null),C=J===m0.Handle,P=M1(r.useCallback($Z(C&&z),[C,z]),P1),k=r.useRef(null),N=Q??qZ[J];r.useEffect(()=>{if(!I.current||!A)return;if(!k.current)k.current=D7({domNode:I.current,nodeId:A,getStoreItems:()=>{let{nodeLookup:E,transform:g,snapGrid:h,snapToGrid:S,nodeOrigin:b,domNode:j}=R.getState();return{nodeLookup:E,transform:g,snapGrid:h,snapToGrid:S,nodeOrigin:b,paneDomNode:j}},onChange:(E,g)=>{let{triggerNodeChanges:h,nodeLookup:S,parentLookup:b,nodeOrigin:j}=R.getState(),x=[],V={x:E.x,y:E.y},D=S.get(A);if(D&&D.expandParent&&D.parentId){let f=D.origin??j,y=E.width??D.measured.width??0,p=E.height??D.measured.height??0,u={id:D.id,parentId:D.parentId,rect:{width:y,height:p,...A6({x:E.x??D.position.x,y:E.y??D.position.y},{width:y,height:p},D.parentId,S,f)}},s=X4([u],S,b,j);x.push(...s),V.x=E.x?Math.max(f[0]*y,E.x):void 0,V.y=E.y?Math.max(f[1]*p,E.y):void 0}if(V.x!==void 0&&V.y!==void 0){let f={id:A,type:"position",position:{...V}};x.push(f)}if(E.width!==void 0&&E.height!==void 0){let y={id:A,type:"dimensions",resizing:!0,setAttributes:!L?!0:L==="horizontal"?"width":"height",dimensions:{width:E.width,height:E.height}};x.push(y)}for(let f of g){let y={...f,type:"position"};x.push(y)}h(x)},onEnd:({width:E,height:g})=>{let h={id:A,type:"dimensions",resizing:!1,dimensions:{width:E,height:g}};R.getState().triggerNodeChanges([h])}});return k.current.update({controlPosition:N,boundaries:{minWidth:F,minHeight:H,maxWidth:Y,maxHeight:X},keepAspectRatio:K,resizeDirection:L,onResizeStart:O,onResize:T,onResizeEnd:B,shouldResize:W}),()=>{k.current?.destroy()}},[N,F,H,Y,X,K,O,T,B,W]);let v=N.split("-");return l.jsx("div",{className:C1(["react-flow__resize-control","nodrag",...v,J,q]),ref:I,style:{...U,scale:P,...Z&&{[C?"backgroundColor":"borderColor"]:Z}},children:G})}var wB=r.memo(UZ);var GZ=(_)=>_.domNode?.querySelector(".react-flow__renderer");function ZZ({children:_}){let Q=M1(GZ);if(!Q)return null;return R9.createPortal(_,Q)}var FZ=(_,Q)=>_?.internals.positionAbsolute.x!==Q?.internals.positionAbsolute.x||_?.internals.positionAbsolute.y!==Q?.internals.positionAbsolute.y||_?.measured.width!==Q?.measured.width||_?.measured.height!==Q?.measured.height||_?.selected!==Q?.selected||_?.internals.z!==Q?.internals.z,KZ=(_,Q)=>{if(_.size!==Q.size)return!1;for(let[J,q]of _)if(FZ(q,Q.get(J)))return!1;return!0},HZ=(_)=>({x:_.transform[0],y:_.transform[1],zoom:_.transform[2],selectedNodesCount:_.nodes.filter((Q)=>Q.selected).length});function G_({nodeId:_,children:Q,className:J,style:q,isVisible:U,position:G=J1.Top,offset:Z=10,align:F="center",...H}){let Y=u6(),X=r.useCallback((I)=>{return(Array.isArray(_)?_:[_||Y||""]).reduce((k,N)=>{let v=I.nodeLookup.get(N);if(v)k.set(v.id,v);return k},new Map)},[_,Y]),K=M1(X,KZ),{x:L,y:z,zoom:W,selectedNodesCount:O}=M1(HZ,P1);if(!(typeof U==="boolean"?U:K.size===1&&K.values().next().value?.selected&&O===1)||!K.size)return null;let B=Z2(K),w=Array.from(K.values()),A=Math.max(...w.map((I)=>I.internals.z+1)),R={position:"absolute",transform:T7(B,{x:L,y:z,zoom:W},G,Z,F),zIndex:A,...q};return l.jsx(ZZ,{children:l.jsx("div",{style:R,className:C1(["react-flow__node-toolbar",J]),...H,"data-id":w.reduce((I,C)=>`${I}${C.id} `,"").trim(),children:Q})})}var D1=h1(X0(),1);var Z_={x:{title:"X",fill:"currentColor",d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"},youtube:{title:"YouTube",fill:"#FF0000",d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},tiktok:{title:"TikTok",fill:"currentColor",d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"},discord:{title:"Discord",fill:"#5865F2",d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},resend:{title:"Resend",fill:"currentColor",d:"M2.023 0v24h5.553v-8.434h2.998L15.326 24h6.65l-5.372-9.258a7.652 7.652 0 0 0 3.316-3.016c.709-1.21 1.062-2.57 1.062-4.08 0-1.462-.353-2.767-1.062-3.91-.709-1.165-1.692-2.079-2.95-2.742C15.737.331 14.355 0 12.823 0Zm5.553 4.87h4.219c.731 0 1.349.125 1.851.376.526.252.925.618 1.2 1.098.274.457.412.994.412 1.611S15.132 9.12 14.88 9.6c-.229.48-.572.856-1.03 1.13-.434.252-.948.38-1.542.38H7.576Z"},linkedin:{title:"LinkedIn",fill:"#0A66C2",d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"},reddit:{title:"Reddit",fill:"#FF4500",d:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},bluesky:{title:"Bluesky",fill:"#0285FF",d:"M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479.815 2.736 3.713 3.66 6.383 3.364.136-.02.275-.039.415-.056-.138.022-.276.04-.415.056-3.912.58-7.387 2.005-2.83 7.078 5.013 5.19 6.87-1.113 7.823-4.308.953 3.195 2.05 9.271 7.733 4.308 4.267-4.308 1.172-6.498-2.74-7.078a8.741 8.741 0 0 1-.415-.056c.14.017.279.036.415.056 2.67.297 5.568-.628 6.383-3.364.246-.828.624-5.79.624-6.478 0-.69-.139-1.861-.902-2.206-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8Z"},instagram:{title:"Instagram",fill:"#FF0069",d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"},github:{title:"GitHub",fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},stripe:{title:"Stripe",fill:"#635BFF",d:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},slack:{title:"Slack",fill:"#4A154B",d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},openai:{title:"OpenAI",fill:"#412991",d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"},anthropic:{title:"Anthropic",fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"},twilio:{title:"Twilio",fill:"#F22F46",d:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},sendgrid:{title:"SendGrid",fill:"#51A9E3",d:"M.8 24h13.6c.88 0 1.6-.72 1.6-1.6v-4.8c0-.88-.72-1.6-1.6-1.6H9.6c-.88 0-1.6-.72-1.6-1.6V9.6C8 8.72 7.28 8 6.4 8H1.6C.72 8 0 8.72 0 9.6v13.6c0 .44.36.8.8.8zM23.2 0H9.6C8.72 0 8 .72 8 1.6v4.8C8 7.28 8.72 8 9.6 8h4.8c.88 0 1.6.72 1.6 1.6v4.8c0 .88.72 1.6 1.6 1.6h4.8c.88 0 1.6-.72 1.6-1.6V.8c0-.44-.36-.8-.8-.8Z"},mailgun:{title:"Mailgun",fill:"#F06B66",d:"M11.837 0c6.602 0 11.984 5.381 11.984 11.994-.017 2.99-3.264 4.84-5.844 3.331a3.805 3.805 0 0 1-.06-.035l-.055-.033-.022.055c-2.554 4.63-9.162 4.758-11.894.232-2.732-4.527.46-10.313 5.746-10.416a6.868 6.868 0 0 1 7.002 6.866 1.265 1.265 0 0 0 2.52 0c0-5.18-4.197-9.38-9.377-9.387C4.611 2.594.081 10.41 3.683 16.673c3.238 5.632 11.08 6.351 15.289 1.402l1.997 1.686A11.95 11.95 0 0 1 11.837 24C2.6 23.72-2.87 13.543 1.992 5.684A12.006 12.006 0 0 1 11.837 0Zm0 7.745c-3.276-.163-5.5 3.281-4.003 6.2a4.26 4.26 0 0 0 4.014 2.31c3.276-.171 5.137-3.824 3.35-6.575a4.26 4.26 0 0 0-3.36-1.935Zm0 2.53c1.324 0 2.152 1.433 1.49 2.58a1.72 1.72 0 0 1-1.49.86 1.72 1.72 0 1 1 0-3.44Z"},notion:{title:"Notion",fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},linear:{title:"Linear",fill:"#5E6AD2",d:"M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"},jira:{title:"Jira",fill:"#0052CC",d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"},hubspot:{title:"HubSpot",fill:"#FF7A59",d:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z"},paypal:{title:"PayPal",fill:"#003087",d:"M7.016 19.198h-4.2a.562.562 0 0 1-.555-.65L5.093.584A.692.692 0 0 1 5.776 0h7.222c3.417 0 5.904 2.488 5.846 5.5-.006.25-.027.5-.066.747A6.794 6.794 0 0 1 12.071 12H8.743a.69.69 0 0 0-.682.583l-.325 2.056-.013.083-.692 4.39-.015.087zM19.79 6.142c-.01.087-.01.175-.023.261a7.76 7.76 0 0 1-7.695 6.598H9.007l-.283 1.795-.013.083-.692 4.39-.134.843-.014.088H6.86l-.497 3.15a.562.562 0 0 0 .555.65h3.612c.34 0 .63-.249.683-.585l.952-6.031a.692.692 0 0 1 .683-.584h2.126a6.793 6.793 0 0 0 6.707-5.752c.306-1.95-.466-3.744-1.89-4.906z"},shopify:{title:"Shopify",fill:"#7AB55C",d:"M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z"},sentry:{title:"Sentry",fill:"#362D59",d:"M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z"},vercel:{title:"Vercel",fill:"currentColor",d:"M24 22.525H0l12-21.05 12 21.05z"},supabase:{title:"Supabase",fill:"#3FCF8E",d:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"},clerk:{title:"Clerk",fill:"#6C47FF",d:"m21.47 20.829-2.881-2.881a.572.572 0 0 0-.7-.084 6.854 6.854 0 0 1-7.081 0 .576.576 0 0 0-.7.084l-2.881 2.881a.576.576 0 0 0-.103.69.57.57 0 0 0 .166.186 12 12 0 0 0 14.113 0 .58.58 0 0 0 .239-.423.576.576 0 0 0-.172-.453Zm.002-17.668-2.88 2.88a.569.569 0 0 1-.701.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0-1.222 3.692 6.86 6.86 0 0 0 .978 3.764.573.573 0 0 1-.083.699l-2.881 2.88a.567.567 0 0 1-.864-.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637-.405.566.566 0 0 1 .232.418.57.57 0 0 1-.168.448Zm-7.118 12.261a3.427 3.427 0 1 0 0-6.854 3.427 3.427 0 0 0 0 6.854Z"},aws:{title:"Amazon Web Services",fill:"#232F3E",d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"},figma:{title:"Figma",fill:"#F24E1E",d:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},airtable:{title:"Airtable",fill:"#18BFFF",d:"M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z"},intercom:{title:"Intercom",fill:"#6AFDEF",d:"M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z"},posthog:{title:"PostHog",fill:"currentColor",d:"M9.854 14.5 5 9.647.854 5.5A.5.5 0 0 0 0 5.854V8.44a.5.5 0 0 0 .146.353L5 13.647l.147.146L9.854 18.5l.146.147v-.049c.065.03.134.049.207.049h2.586a.5.5 0 0 0 .353-.854L9.854 14.5zm0-5-4-4a.487.487 0 0 0-.409-.144.515.515 0 0 0-.356.21.493.493 0 0 0-.089.288V8.44a.5.5 0 0 0 .147.353l9 9a.5.5 0 0 0 .853-.354v-2.585a.5.5 0 0 0-.146-.354l-5-5zm1-4a.5.5 0 0 0-.854.354V8.44a.5.5 0 0 0 .147.353l4 4a.5.5 0 0 0 .853-.354V9.854a.5.5 0 0 0-.146-.354l-4-4zm12.647 11.515a3.863 3.863 0 0 1-2.232-1.1l-4.708-4.707a.5.5 0 0 0-.854.354v6.585a.5.5 0 0 0 .5.5H23.5a.5.5 0 0 0 .5-.5v-.6c0-.276-.225-.497-.499-.532zm-5.394.032a.8.8 0 1 1 0-1.6.8.8 0 0 1 0 1.6zM.854 15.5a.5.5 0 0 0-.854.354v2.293a.5.5 0 0 0 .5.5h2.293c.222 0 .39-.135.462-.309a.493.493 0 0 0-.109-.545L.854 15.501zM5 14.647.854 10.5a.5.5 0 0 0-.854.353v2.586a.5.5 0 0 0 .146.353L4.854 18.5l.146.147h2.793a.5.5 0 0 0 .353-.854L5 14.647z"},datadog:{title:"Datadog",fill:"#632CA6",d:"M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"},algolia:{title:"Algolia",fill:"#003DFF",d:"M12 0C5.445 0 .103 5.285.01 11.817c-.097 6.634 5.285 12.131 11.92 12.17a11.91 11.91 0 0 0 5.775-1.443.281.281 0 0 0 .052-.457l-1.122-.994a.79.79 0 0 0-.833-.14 9.693 9.693 0 0 1-3.923.77c-5.36-.067-9.692-4.527-9.607-9.888.084-5.293 4.417-9.573 9.73-9.573h9.73v17.296l-5.522-4.907a.407.407 0 0 0-.596.063 4.52 4.52 0 0 1-3.934 1.793 4.538 4.538 0 0 1-4.192-4.168 4.53 4.53 0 0 1 4.512-4.872 4.532 4.532 0 0 1 4.509 4.126c.018.205.11.397.265.533l1.438 1.275a.28.28 0 0 0 .462-.158 6.82 6.82 0 0 0 .099-1.725c-.232-3.376-2.966-6.092-6.345-6.3-3.873-.24-7.11 2.79-7.214 6.588-.1 3.7 2.933 6.892 6.634 6.974a6.75 6.75 0 0 0 4.136-1.294l7.212 6.394a.48.48 0 0 0 .797-.36V.456A.456.456 0 0 0 23.54 0Z"},cloudflare:{title:"Cloudflare",fill:"#F38020",d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"},upstash:{title:"Upstash",fill:"#00E9A3",d:"M13.8027 0C11.193 0 8.583.9952 6.5918 2.9863c-3.9823 3.9823-3.9823 10.4396 0 14.4219 1.9911 1.9911 5.2198 1.9911 7.211 0 1.991-1.9911 1.991-5.2198 0-7.211L12 12c.9956.9956.9956 2.6098 0 3.6055-.9956.9955-2.6099.9955-3.6055 0-2.9866-2.9868-2.9866-7.8297 0-10.8164 2.9868-2.9868 7.8297-2.9868 10.8164 0l1.8028-1.8028C19.0225.9952 16.4125 0 13.8027 0zM12 12c-.9956-.9956-.9956-2.6098 0-3.6055.9956-.9955 2.6098-.9955 3.6055 0 2.9867 2.9868 2.9867 7.8297 0 10.8164-2.9867 2.9868-7.8297 2.9868-10.8164 0l-1.8028 1.8028c3.9823 3.9822 10.4396 3.9822 14.4219 0 3.9823-3.9824 3.9823-10.4396 0-14.4219-.9956-.9956-2.3006-1.4922-3.6055-1.4922-1.3048 0-2.6099.4966-3.6054 1.4922-1.9912 1.9912-1.9912 5.2198 0 7.211z"},mixpanel:{title:"Mixpanel",fill:"#7856FF",d:"M6.967 9.996h3.053c-.763-.477-1.048-1.145-1.431-2.384L7.443 3.366C6.919 1.458 6.49.551 4.39.551H.004v1.145h.621c1.286 0 1.431.477 1.814 1.908L3.44 7.326c.524 1.814 1.337 2.67 3.53 2.67h-.003Zm7.06 0h3.053c2.194 0 2.956-.86 3.484-2.67l1.001-3.722c.382-1.431.57-1.908 1.814-1.908H24V.551h-4.34c-2.146 0-2.576.86-3.053 2.815l-1.145 4.246c-.384 1.286-.673 1.907-1.435 2.384Zm-4.007 4.008h4.007V9.996H10.02v4.008ZM0 23.449h4.39c2.1 0 2.529-.907 3.053-2.815l1.146-4.246c.383-1.239.668-1.907 1.431-2.384H6.967c-2.194 0-3.007.86-3.531 2.67l-1.001 3.722c-.383 1.431-.524 1.907-1.814 1.907H0v1.146Zm19.65 0h4.343v-1.146h-.622c-1.239 0-1.431-.476-1.814-1.907l-1.001-3.722c-.524-1.814-1.286-2.67-3.483-2.67h-3.046c.762.477 1.041 1.098 1.424 2.384l1.145 4.246c.477 1.955.907 2.815 3.054 2.815Z"},gemini:{title:"Google Gemini",fill:"#8E75B2",d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"}};var F1=h1(O5(),1),YZ="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function f5({href:_,onClick:Q}){return F1.jsxDEV("h1",{children:F1.jsxDEV("a",{href:_,onClick:Q,children:[F1.jsxDEV("img",{src:YZ,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),F1.jsxDEV("span",{className:"brand-name",children:" Volter World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}async function P0(_){return(await _.json().catch(()=>({}))).error??`answered ${_.status}`}function K_(_,Q,J=0,q=""){let[U,G]=D1.useState({state:"loading"});return D1.useEffect(()=>{G({state:"loading"})},[q,Q]),D1.useEffect(()=>{if(!Q)return;let Z=!0;return(async()=>{try{let F=await _(Q),H=F.ok?{state:"ok",data:await F.json()}:{state:"error",status:F.status,error:await P0(F)};if(Z)G(H)}catch(F){if(Z)G({state:"error",status:0,error:String(F)})}})(),()=>{Z=!1}},[q,Q,J]),U}function g1({load:_,what:Q,retry:J,lines:q=3}){if(_.state==="loading")return F1.jsxDEV(LZ,{lines:q,label:`Loading ${Q}…`},void 0,!1,void 0,this);if(_.state==="error")return F1.jsxDEV("div",{role:"alert",className:"error-state",children:[F1.jsxDEV("span",{children:["Could not read ",Q,": ",_.error]},void 0,!0,void 0,this),J?F1.jsxDEV("button",{type:"button",onClick:J,children:"Try again"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return null}function LZ({lines:_=3,label:Q="Loading…"}){return F1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":Q,children:Array.from({length:_},(J,q)=>F1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][q%5]}%`}},q,!1,void 0,this))},void 0,!1,void 0,this)}function O1({iso:_,time:Q}){if(!_)return F1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let J=new Date(_);return F1.jsxDEV("time",{dateTime:_,title:_,children:Number.isNaN(J.getTime())?_:Q?J.toLocaleTimeString():J.toLocaleString()},void 0,!1,void 0,this)}var E6=(_)=>_?new Date(_).toLocaleString():"—";function x6(_){let Q=_?Date.parse(_):Number.NaN;if(Number.isNaN(Q))return"—";let J=Math.max(0,Math.round((Date.now()-Q)/1000));return J<60?"just now":J<3600?`${Math.round(J/60)}m ago`:J<86400?`${Math.round(J/3600)}h ago`:`${Math.round(J/86400)}d ago`}function k1(_,Q){let J=Q.replace(/[_-]+/g," "),q=J.endsWith("s")?J:/[^aeiou]y$/.test(J)?`${J.slice(0,-1)}ies`:/(ch|sh|x)$/.test(J)?`${J}es`:`${J}s`;return`${_} ${_===1?J:q}`}var X2=(_)=>_.length<=1?_.join(""):`${_.slice(0,-1).join(", ")} and ${_[_.length-1]}`,zZ={github:"GitHub",openai:"OpenAI",aws:"AWS",hubspot:"HubSpot",paypal:"PayPal",youtube:"YouTube",tiktok:"TikTok",linkedin:"LinkedIn",xai:"xAI",sendgrid:"SendGrid",elevenlabs:"ElevenLabs",assemblyai:"AssemblyAI",planetscale:"PlanetScale",googleoauth:"Google sign-in",npm:"npm","npm-registry":"npm registry",posthog:"PostHog",mongodb:"MongoDB",pagerduty:"PagerDuty",mailgun:"Mailgun",turbopuffer:"turbopuffer"},H1=(_)=>zZ[_]??_.charAt(0).toUpperCase()+_.slice(1);function b1({vendor:_}){let Q=Z_[_];return F1.jsxDEV("span",{className:Q?"mark logo":"mark","aria-hidden":"true",children:Q?F1.jsxDEV("svg",{viewBox:"0 0 24 24",children:F1.jsxDEV("path",{d:Q.d,fill:Q.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):H1(_).charAt(0)},void 0,!1,void 0,this)}var F_=(_)=>{_.currentTarget.closest("details")?.removeAttribute("open")},WZ="volter.theme",m6=()=>{try{let _=localStorage.getItem(WZ);return _==="light"||_==="dark"?_:"system"}catch{return"system"}};function H_(_=m6()){let Q=document.documentElement;if(_==="system")Q.removeAttribute("data-theme");else Q.setAttribute("data-theme",_)}function X_(){return D1.useEffect(()=>{let _=()=>[...document.querySelectorAll("details.menu[open], details.clock-more[open]")],Q=(q)=>{if(q.key!=="Escape"||document.querySelector("dialog[open]"))return;let U=_();if(!U.length)return;for(let G of U)G.removeAttribute("open");U[U.length-1].querySelector("summary")?.focus()},J=(q)=>{let U=q.target;for(let G of _())if(!U||!G.contains(U))G.removeAttribute("open")};return document.addEventListener("keydown",Q),document.addEventListener("click",J),()=>{document.removeEventListener("keydown",Q),document.removeEventListener("click",J)}},[]),null}function t1({open:_,onClose:Q,title:J,children:q,footer:U,wide:G}){let Z=D1.useRef(null),F=D1.useId();return D1.useEffect(()=>{let H=Z.current;if(!H)return;if(_&&!H.open){H.showModal();let Y=H.querySelector(".dialog-body :is(input:not([type=hidden]):not([disabled]), select, textarea)");if(Y?.focus(),Y instanceof HTMLInputElement&&Y.value&&/^(text|search|email|url)$/.test(Y.type))Y.select()}if(!_&&H.open)H.close()},[_]),F1.jsxDEV("dialog",{ref:Z,className:G==="window"?"dialog window":G?"dialog wide":"dialog","aria-labelledby":F,onClose:Q,onCancel:(H)=>{H.preventDefault(),Q()},onMouseDown:(H)=>{if(H.target===Z.current)Q()},children:_?F1.jsxDEV(F1.Fragment,{children:[F1.jsxDEV("div",{className:"dialog-head",children:[F1.jsxDEV("h2",{id:F,children:J},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Close",onClick:Q,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F1.jsxDEV("div",{className:"dialog-body",children:q},void 0,!1,void 0,this),U?F1.jsxDEV("div",{className:"dialog-foot",children:U},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this)}var D6="volter:confirm";function B0(_){return new Promise((Q)=>{window.dispatchEvent(new CustomEvent(D6,{detail:{ask:_,resolve:Q}}))})}function Y_(){let[_,Q]=D1.useState(null),[J,q]=D1.useState("");D1.useEffect(()=>{let F=(H)=>{q(""),Q(H.detail)};return window.addEventListener(D6,F),()=>window.removeEventListener(D6,F)},[]);let U=(F)=>{_?.resolve(F),Q(null)},G=_?.ask,Z=!G?.typed||J===G.typed;return F1.jsxDEV(t1,{open:Boolean(_),onClose:()=>U(!1),title:G?.title??"",footer:F1.jsxDEV(F1.Fragment,{children:[F1.jsxDEV("button",{type:"button",onClick:()=>U(!1),children:"Cancel"},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",className:G?.danger?"danger-button":"primary",disabled:!Z,onClick:()=>U(!0),children:G?.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[G?.body?F1.jsxDEV("div",{className:"confirm-body",children:G.body},void 0,!1,void 0,this):null,G?.typed?F1.jsxDEV("div",{className:"typed-confirm",children:[F1.jsxDEV("p",{children:["Type ",F1.jsxDEV("code",{children:G.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),F1.jsxDEV("input",{autoFocus:!0,"aria-label":`Type ${G.typed} to confirm`,value:J,onChange:(F)=>q(F.target.value),onKeyDown:(F)=>{if(F.key==="Enter"&&Z)U(!0)},autoComplete:"off",spellCheck:!1},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}var h6="volter:toast";function u1(_,Q="ok"){window.dispatchEvent(new CustomEvent(h6,{detail:{text:_,kind:Q}}))}function L_(){let[_,Q]=D1.useState([]);return D1.useEffect(()=>{let J=0,q=(U)=>{let{text:G,kind:Z}=U.detail,F=++J;if(Q((H)=>[...H.slice(-3),{id:F,text:G,kind:Z}]),Z!=="error")setTimeout(()=>Q((H)=>H.filter((Y)=>Y.id!==F)),4500)};return window.addEventListener(h6,q),()=>window.removeEventListener(h6,q)},[]),F1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:_.map((J)=>F1.jsxDEV("div",{className:`toast ${J.kind}`,role:J.kind==="error"?"alert":"status",children:[F1.jsxDEV("span",{children:J.text},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Dismiss",onClick:()=>Q((q)=>q.filter((U)=>U.id!==J.id)),children:"✕"},void 0,!1,void 0,this)]},J.id,!0,void 0,this))},void 0,!1,void 0,this)}function g6({value:_,label:Q,secret:J}){let[q,U]=D1.useState(!1);return F1.jsxDEV("div",{className:"copy-field",children:[Q?F1.jsxDEV("span",{className:"copy-label",children:Q},void 0,!1,void 0,this):null,F1.jsxDEV("div",{className:"copy-row",children:[F1.jsxDEV("input",{readOnly:!0,value:_,"aria-label":Q??"Value",onFocus:(Z)=>Z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>{U(!0),setTimeout(()=>U(!1),1600),u1(J?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>u1("Your browser would not copy it: select it and copy","error"))},children:q?"Copied":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function z_({label:_,items:Q}){return F1.jsxDEV("details",{className:"menu row-menu",children:[F1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":_,title:_,children:"⋯"},void 0,!1,void 0,this),F1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:Q.filter((J)=>Boolean(J)).map((J)=>J.href?F1.jsxDEV("a",{role:"menuitem",href:J.href,className:J.danger?"danger-item":void 0,onClick:F_,children:J.label},J.label,!1,void 0,this):F1.jsxDEV("button",{type:"button",role:"menuitem",disabled:J.disabled,className:J.danger?"danger-item":void 0,onClick:(q)=>{F_(q),J.onSelect?.()},children:J.label},J.label,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function h2({title:_,children:Q,action:J}){return F1.jsxDEV("div",{className:"empty-state",children:[F1.jsxDEV("p",{className:"empty-title",children:_},void 0,!1,void 0,this),Q?F1.jsxDEV("div",{className:"empty-body",children:Q},void 0,!1,void 0,this):null,J?F1.jsxDEV("div",{className:"empty-action",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function W_(){return D1.useEffect(()=>{let _=(J)=>{let q=document.querySelector("main.app"),U=J.target;if(q?.hasAttribute("data-drawer")&&U&&!U.closest(".side")&&!U.closest(".drawer-button"))q.removeAttribute("data-drawer")},Q=(J)=>{if(J.key==="Escape")AZ()};return document.addEventListener("click",_),document.addEventListener("keydown",Q),()=>{document.removeEventListener("click",_),document.removeEventListener("keydown",Q)}},[]),F1.jsxDEV("button",{type:"button",className:"icon-button drawer-button","aria-label":"Menu",onClick:()=>{document.querySelector("main.app")?.toggleAttribute("data-drawer")},children:"☰"},void 0,!1,void 0,this)}var AZ=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};function O4(_={}){let Q=(q,U)=>_.tools?`${U} (\`${q}\`)`:`\`${q}\``,J=["Set up Volter World for this app, so its calls to Stripe, Slack, GitHub, OpenAI and the other services it uses go to local twins instead of the real APIs. The app keeps its real SDKs and code.","",_.tools?"1. You have the Volter World tools (volter mcp). If the `volter` command is missing, install it: `npm install -g @volter/world`.":"1. Install the command and your agent tooling: `npm install -g @volter/world`, then `volter agents install --yes`.",`2. In the app's folder, ${Q("volter world init --install","world_init")}: it detects the vendors the app calls and installs their twins. Show me the vendors it detected and why, before keeping them.`,`3. ${_.tools?"Start it with world_up":"Start it: `volter world up`"}, then run the tests inside it: ${Q("volter world run -- <the test command>","world_run")}. Fix anything that fails because a call went to the real service.`,`4. Tell me what the app did at each vendor (${Q("volter world log","world_log")}), and give me the dashboard link (${_.tools?"world_view":"`volter world view --no-open`, started in the background: it keeps running"}).`];if(_.platform){let q=_.world??"<org>/<world>";J.push(`5. Share it with my team on ${_.platform}: ${Q(`volter login ${_.platform}`,"platform_login")} gives a link and a code for me to approve in my browser. Once I have, link it with ${Q(`volter remote add origin ${q} --create`,"remote_link with create: true")}${_.world?"":" (ask me for <org>/<world>)"}, then send what the app did: ${Q('volter world changeset -m "<what and why>"',"world_changeset")} and ${Q("volter world push","world_push")}.`)}return J.push("","The guide: https://world.volter.ai/docs/guides/use-with-a-coding-agent.md"),J.join(`
|
|
35
|
-
`)}var A_={"git-commit-horizontal":[["rect",{x:"9",y:"9",width:"6",height:"6"}],["path",{d:"M3 12h6M15 12h6"}]],"arrow-down-to-line":[["path",{d:"M12 17V3"}],["path",{d:"m6 11 6 6 6-6"}],["path",{d:"M19 21H5"}]],"arrow-up-from-line":[["path",{d:"m18 9-6-6-6 6"}],["path",{d:"M12 3v14"}],["path",{d:"M5 21h14"}]],"git-branch":[["rect",{x:"4",y:"3",width:"4",height:"4"}],["rect",{x:"4",y:"17",width:"4",height:"4"}],["rect",{x:"16",y:"5",width:"4",height:"4"}],["path",{d:"M6 7v10M18 9v2a4 4 0 0 1-4 4H6"}]],monitor:[["rect",{x:"3",y:"4",width:"18",height:"13"}],["path",{d:"M8 21h8M12 17v4"}]],vault:[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"6.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 7.9 2.7 2.7"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 10.6 2.7-2.7"}],["rect",{x:"6.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 16.1 2.7-2.7"}],["rect",{x:"15.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 13.4 2.7 2.7"}],["circle",{cx:"12",cy:"12",r:"2"}]],settings:[["circle",{cx:"12",cy:"12",r:"3"}],["circle",{cx:"12",cy:"12",r:"7"}],["path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9L7 7M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1"}]],history:[["path",{d:"M3 12a9 9 0 1 0 3-6.7"}],["path",{d:"M3 4v5h5"}],["path",{d:"M12 7v5l3 3"}]],activity:[["path",{d:"M2 12h4l3-8 6 16 3-8h4"}]],"file-diff":[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M9 10h6"}],["path",{d:"M12 13V7"}],["path",{d:"M9 17h6"}]],"square-plus":[["rect",{x:"4",y:"4",width:"16",height:"16"}],["path",{d:"M12 8v8M8 12h8"}]],"square-minus":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["path",{d:"M8 12h8"}]],"square-dot":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"10.8",y:"10.8",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],cloud:[["path",{d:"M7 19a5 5 0 0 1-.5-10A6 6 0 0 1 18 8a4.5 4.5 0 0 1 .5 11z"}]],"refresh-cw":[["path",{d:"M20 12a8 8 0 0 1-14.3 4.9M4 12a8 8 0 0 1 14.3-4.9"}],["path",{d:"M19 3v5h-5M5 21v-5h5"}]],clock:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M12 7v5l3 3"}]],"key-round":[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],plug:[["path",{d:"M9 3v5M15 3v5M6 8h12v4a6 6 0 0 1-12 0zM12 18v3"}]],"list-checks":[["path",{d:"M11 6h9M11 12h9M11 18h9"}],["path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"}]],palette:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"}],["rect",{x:"12.3",y:"5.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"16.3",y:"9.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"5.3",y:"11.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"7.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],check:[["path",{d:"M4 12l5 5L20 6"}]],plus:[["path",{d:"M12 4v16M4 12h16"}]],"chevron-down":[["path",{d:"M5 9l7 7 7-7"}]],"external-link":[["path",{d:"M14 4h6v6M20 4l-9 9"}],["path",{d:"M18 14v6H4V6h6"}]],"table-2":[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18"}]],"scroll-text":[["path",{d:"M15 12h-5"}],["path",{d:"M15 8h-5"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"}]],"layout-grid":[["rect",{x:"4",y:"4",width:"7",height:"7"}],["rect",{x:"13",y:"4",width:"7",height:"7"}],["rect",{x:"4",y:"13",width:"7",height:"7"}],["rect",{x:"13",y:"13",width:"7",height:"7"}]],globe:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"}]],"arrow-left":[["path",{d:"M20 12H5M11 6l-6 6 6 6"}]],link:[["path",{d:"M9 15l6-6"}],["path",{d:"M11 6l2-2a4.2 4.2 0 0 1 6 6l-2 2M13 18l-2 2a4.2 4.2 0 0 1-6-6l2-2"}]],user:[["circle",{cx:"12",cy:"8",r:"4"}],["path",{d:"M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"}]],"log-out":[["path",{d:"M10 4H4v16h6M9 12h11M16 8l4 4-4 4"}]]};var $=h1(O5(),1),f4="volter.console.token",P5=document.getElementById("root"),X1=P5.dataset.base??"/-/console",T1=window.location.origin,W2=(P5.dataset.worlds??T1).replace(/\/+$/,""),P_=(P5.dataset.names??"").split(",").filter((_)=>_!==""),g0=P5.dataset.worldOrigin==="1",z2=window.fetch.bind(window),p0="(session)",N_="(pass)",I5=(_)=>{try{if(_&&!g0)sessionStorage.setItem(f4,_);else sessionStorage.removeItem(f4);localStorage.removeItem(f4)}catch{}},C_="volter.console.portal",S_=(_)=>{try{if(typeof _==="string"&&/^https?:$/.test(new URL(_).protocol))sessionStorage.setItem(C_,new URL(_).origin)}catch{}},BZ=()=>{return A2.get("token")??""},p1=()=>{try{let _=sessionStorage.getItem(C_)??"";return _&&/^https?:$/.test(new URL(_).protocol)?new URL(_).origin:""}catch{return""}},MZ=()=>{let _=BZ();if(g0){if(I5(""),A2.get("pass"))return N_;let Q=new URLSearchParams(window.location.search).has("signin");if(Q)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return _||(Q?"":p0)}if(_)return I5(_),_;try{return sessionStorage.getItem(f4)??""}catch{return""}};function v1(_){let Q=_.trim();if(/not ready/i.test(Q)&&/(never verified|not verified|no approvals)/i.test(Q)){let G=[],Z=[];if(/(never verified|not verified)/i.test(Q))G.push("it is not verified yet"),Z.push("verify");if(/no approvals/i.test(Q))G.push("no one has approved it"),Z.push("approve");return{text:`Not ready to deploy: ${X2(G)}.`,acts:Z}}let J=/no credential (?:is )?sealed for ([a-z0-9_-]+)/i.exec(Q);if(J)return{text:`No credential is sealed for ${H1(J[1])}: seal one in Settings › Vault.`,acts:["vault"]};if(/has no origin/i.test(Q))return{text:"This World has no remote: name one in Settings › Remote.",acts:["remote"]};let q=/the ([a-z0-9_-]+) twin has no root/i.exec(Q)??/:\s*([a-z0-9_, -]+?) (?:has|have) no root/i.exec(Q);if(q){let G=q[1].split(/,\s*/).filter(Boolean).map(H1);return{text:`${X2(G)} ${G.length===1?"is":"are"} not connected to ${G.length===1?"its":"their"} real service: Settings › Real services.`,acts:["settings"]}}if(/opening a seal is/i.test(Q))return{text:"A key cannot seal a credential: open the World as yourself.",acts:[]};if(/a key manages no keys/i.test(Q))return{text:"A key cannot manage keys: open the World as yourself.",acts:[]};if(/^PUT origin:/i.test(Q))return{text:"That is not a World's address: https://<host>/<org>/<world>",acts:[]};if(/^clock: \{/i.test(Q))return{text:"Pick a date and time.",acts:[]};if(/^advance: \{/i.test(Q))return{text:"Advance by a number and a unit: 90m, 12h, 3d.",acts:[]};if(/^branches: \{/i.test(Q))return{text:"That branch could not be made: pick now, or an instant before it.",acts:[]};if(/^approve: \{/i.test(Q))return{text:"Name who approves.",acts:[]};if(/a browser deploys only what it names/i.test(Q))return{text:"A deploy is confirmed by its name: use Deploy again.",acts:[]};if(/^no such door/i.test(Q))return{text:"This World does not answer that here.",acts:[]};return{text:Q.replace(/\s*[—–-]+\s*(?:run\s+)?`[^`]*`/g,"").replace(/\s*[—–-]+\s*(?:PUT|POST|GET|DELETE)\s+\/-\/\S+(?:\s*\{[^}]*\})?/g,"").replace(/\s*\(\s*`[^`]*`\s*\)/g,"").replace(/`(?:volter|printf|curl|npm|bun)[^`]*`/g,"").replace(/:\s*\{[^}]*\}/g,"").replace(/\(\s*\)/g,"").replace(/\s*;\s*(?=[;.]|$)/g,"").replace(/\s+([,.;:])/g,"$1").trim()||_,acts:[]}}var J0=async(_)=>v1(await P0(_)).text,TZ={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function k_({name:_,acts:Q}){let J=Q.map((q)=>TZ[q]).filter((q)=>Boolean(q));if(J.length===0)return null;return $.jsxDEV($.Fragment,{children:J.map(([q,U])=>$.jsxDEV(i.default.Fragment,{children:[" ",$.jsxDEV("a",{href:`${X1}/${_}/~/${q}`,onClick:(G)=>{G.preventDefault(),R1([..._.split("/"),"~",...q.split("/")])},children:U},void 0,!1,void 0,this)]},q,!0,void 0,this))},void 0,!1,void 0,this)}async function I1(_,Q,J={}){return z2(`${T1}${Q}`,{...J,headers:{...J.headers??{},..._===p0?{}:{"x-volter-token":_},...J.body&&!J.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function w1(_,Q,J=0){let q=K_((U)=>I1(_,U),Q,J,_);return q.state==="error"?{...q,error:v1(q.error).text}:q}var m2=(_)=>{let Q=new Date(_),J=(q)=>String(q).padStart(2,"0");return`${Q.getFullYear()}-${J(Q.getMonth()+1)}-${J(Q.getDate())}T${J(Q.getHours())}:${J(Q.getMinutes())}`},B_=(_)=>new Date(Math.ceil(Date.parse(_)/60000)*60000).toISOString(),y_=(_)=>_.operation==="observed"?`observed${_.provenance==="placeholder"?" (default data)":" (vendor)"}`:_.receipt?`${_.receipt.status??""} ${_.receipt.externalId??""} ${_.receipt.reason??""}`.trim():_.provenance==="placeholder"?"default data":"unpushed",RZ=(_)=>{let Q=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(_??"");return Q?{trace:Q[1],span:Q[2]}:null},r6="volter.console.snapshots",C0=()=>{try{return JSON.parse(sessionStorage.getItem(r6)??"{}")}catch{return{}}},v_=new Map,i6=(_)=>{if(g0){if(_.token||_.readToken)v_.set(_.name,{token:_.token,readToken:_.readToken});_={..._,token:"",readToken:""}}try{sessionStorage.setItem(r6,JSON.stringify({...C0(),[_.name]:_}))}catch{}},d6=(_)=>v_.get(_)?.readToken||C0()[_]?.readToken||"",I4=(_)=>{try{let Q=C0();delete Q[_],sessionStorage.setItem(r6,JSON.stringify(Q))}catch{}},A2=new URLSearchParams(window.location.hash.slice(1)),E2=A2.get("close")??"";function N5(_){if(typeof _!=="string")return null;let Q;try{Q=new URL(_)}catch{return null}return(Q.protocol==="http:"||Q.protocol==="https:")&&Q.origin===_.replace(/\/+$/,"")?Q:null}function a6(_){let Q=N5(_);if(!Q)return null;let J=new URL(T1);if(Q.protocol!==J.protocol||Q.port!==J.port)return null;if(Q.hostname===J.hostname)return Q.origin;let q=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!q.test(Q.hostname))return null;let U=Q.hostname.replace(q,"");return U===J.hostname||q.test(J.hostname)&&U===J.hostname.replace(q,"")?Q.origin:null}function OZ(_){let Q;try{Q=JSON.parse(_)}catch{return null}let J=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof Q.name!=="string"||!J.test(Q.name)||typeof Q.parent!=="string"||!J.test(Q.parent)||typeof Q.at!=="string")return null;let q=Q.parentOrigin===void 0?void 0:a6(Q.parentOrigin);return{name:Q.name,parent:Q.parent,token:typeof Q.token==="string"?Q.token:"",readToken:typeof Q.readToken==="string"?Q.readToken:"",at:Q.at,expiresAt:typeof Q.expiresAt==="string"?Q.expiresAt:null,...q?{parentOrigin:q}:{}}}{let _=A2.get("snapshot");if(_){let Q=OZ(_);if(Q&&!C0()[Q.name])i6(Q)}}var j_="volter.console.home",V_=(_)=>{let Q=N5(_);if(!Q)return null;let J=new URL(T1).hostname,q=J.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return Q.hostname===J||Q.hostname===q?Q.origin:null};{let _=V_(A2.get("home"));if(_)try{sessionStorage.setItem(j_,_)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((_)=>A2.has(_)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var G0=()=>{try{return V_(sessionStorage.getItem(j_))??""}catch{return""}};function s6(_,Q,J,q){let U=new URLSearchParams({token:Q,home:G0()||T1}),G=C0()[J];if(G)U.set("snapshot",JSON.stringify(G));window.location.replace(`${_}${q??`${window.location.pathname}${window.location.search}`}#${U.toString()}`)}var C4=P5.dataset.route==="memory"?"":null;function pB(_){C4=_,window.dispatchEvent(new PopStateEvent("popstate"))}function Y2(){return(C4??window.location.pathname.slice(X1.length)).split("/").filter(Boolean).map((_)=>{try{return decodeURIComponent(_)}catch{return""}})}var M_=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,N0=(_,Q)=>_&&Q&&M_.test(_)&&M_.test(Q)?`${_}/${Q}`:"";function R1(_){let Q=`/${_.map(encodeURIComponent).join("/")}`;if(C4!==null)C4=Q;else window.history.pushState(null,"",`${X1}${Q}`);window.dispatchEvent(new PopStateEvent("popstate"))}function u_(_,Q){let J=a6(C0()[_]?.origin);if(J&&J!==T1){s6(J,d6(_),_,`${X1}/${Q.map(encodeURIComponent).join("/")}`);return}R1(Q)}async function T_(){let[_,Q]=Y2(),J=N0(_,Q),q=J?[J]:P_;if(q.length===0){let U=await z2(`${T1}/-/ping`).catch(()=>null);q=U?.ok?(await U.json().catch(()=>({}))).worlds??[]:[]}q=q.filter((U)=>{let[G,Z,...F]=U.split("/");return F.length===0&&N0(G,Z)===U});for(let U of q){let G=await z2(`${T1}/-/${U}/session`,{method:"POST"}).catch(()=>null);if(!G)continue;let Z=await G.json().catch(()=>({})),F=N5(Z.origin)?.origin;if(G.status===409&&F&&F!==T1)return window.location.replace(`${F}${X1}/${U}`),"moved";if(G.ok&&Z.local)return{token:typeof Z.token==="string"&&Z.token?Z.token:p0}}return null}function fZ(){let[_,Q]=i.useState(m6),J=(q)=>()=>{try{if(q==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",q)}catch{}H_(q),Q(q)};return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Appearance",children:["system","light","dark"].map((q)=>$.jsxDEV("button",{type:"button",role:"radio","aria-checked":_===q,onClick:J(q),children:q==="system"?"System":q==="light"?"Light":"Dark"},q,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function IZ(){let[_,Q]=i.useState(MZ()),[J,q]=i.useState(!1),[U,G]=i.useState(!1),[Z,F]=i.useState(""),[H,Y]=i.useState(null),[X,K]=i.useState(null),[L,z]=i.useState(Y2());i.useEffect(()=>{let y=()=>z(Y2());return window.addEventListener("popstate",y),()=>window.removeEventListener("popstate",y)},[]),i.useEffect(()=>{let[y,p]=Y2(),u=N0(y,p),[s,t]=u?u.split("/"):[],a=C0()[E2];if(!E2||!_||!s||!t||!a?.made||a.parent!==`${s}/${t}`||N0(...E2.split("/"))!==E2)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}I1(_,`/-/${s}/${t}/branches/${E2}`,{method:"DELETE"}).catch(()=>null).then(()=>I4(E2))},[_]);let W=i.useCallback(async(y)=>{if(K(null),!y){let t=await T_();if(t==="moved")return;if(t){if(q(!0),t.token!==p0)I5(t.token);Q(t.token);return}Y(null),G(!0);return}if(g0&&y===p0){let t=await T_();if(t==="moved")return;if(t)q(!0)}if(g0&&y===N_){let[t,a]=Y2(),d=N0(t,a),[c,e]=d?d.split("/"):[],Q1=c&&e?await z2(`${T1}/-/${c}/${e}/session`,{method:"POST",headers:{"x-volter-pass":A2.get("pass")??""}}).catch(()=>null):null;if(!Q1){K(`${T1} did not answer: no session was opened`),Y(null);return}if(!Q1.ok){K(`${await J0(Q1)}. Open it again from the platform.`),Y(null);return}S_((await Q1.json().catch(()=>({}))).issuer),Q(p0);return}if(g0&&y!==p0){let[t,a]=Y2(),d=N0(t,a),[c,e]=d?d.split("/"):[],Q1=c&&e?await z2(`${T1}/-/${c}/${e}/session`,{method:"POST",headers:{"x-volter-token":y}}).catch(()=>null):null;if(!Q1){K(`${T1} did not answer: no session was opened`),Y(null);return}if(!Q1.ok){let G1=await J0(Q1);K(Q1.status===401||Q1.status===403?`That token does not open ${c}/${e}.`:Q1.status===409?`${c}/${e}'s session lives at another origin: ${G1}`:`The World could not open a session (${Q1.status}): ${G1}`),Y(null);return}Q(p0);return}let p=g0?new Response(null,{status:404}):await I1(y,"/-/worlds");if(p.ok){let{worlds:t}=await p.json();Y({kind:"admin",worlds:t});return}if(p.status===429){K("You are asking faster than the platform allows — wait a moment and reload."),Y(null);return}if(p.status>=500){let t=await p.json().catch(()=>({}));K(`The platform could not list your worlds${t.error?`: ${t.error}`:""}. Reload; if it stays, the status page says what is wrong.`),Y(null);return}let u=P_;if(u.length===0){let t=await z2(`${T1}/-/ping`);if(!t.ok){K(`${T1} does not answer as a host`),Y(null);return}if(u=(await t.json()).worlds??[],u.length===0){K(`${T1} does not list its Worlds: open a World at its own address, ${T1}${X1}/<org>/<world>`),Y(null);return}}let s=[];for(let t of u){let a=await I1(y,`/-/${t}/twins`);if(a.ok){let d=await a.json();s.push({name:t,base:`${W2}/${t}`,twins:(d.twins??[]).map((c)=>({vendor:c.twin,protocol:c.protocol??null,root:c.root??null}))})}}if(s.length===0){K("This link or key opens no World here: it was revoked, or it has ended."),Y(null);return}Y({kind:"world",worlds:s})},[]);i.useEffect(()=>{W(_)},[_,W]);let O=(y)=>H?.kind==="admin"?H.worlds.find((p)=>p.name===y)?.token??_:_,[T,B]=i.useState("");if(!_||!H&&!X)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(f5,{href:`${X1}/`},void 0,!1,void 0,this),_&&!H&&!X||!_&&!U?$.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):$.jsxDEV("form",{onSubmit:(y)=>{y.preventDefault(),I5(Z.trim()),Q(Z.trim())},className:"stack",children:[$.jsxDEV("h2",{children:"Open a World"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"A World's token opens that World. A host's admin token opens every World it serves."},void 0,!1,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Token"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"token",type:"password",value:Z,onChange:(y)=>F(y.target.value),autoFocus:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",children:"Open"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let w=()=>{if(J){window.location.reload();return}if(g0){let[y,p]=Y2(),u=N0(y,p),[s,t]=u?u.split("/"):[],a=()=>window.location.replace(p1()?`${p1()}/`:`${T1}${X1}/${s&&t?`${s}/${t}`:""}?signin`);if(setTimeout(a,2000),s&&t)z2(`${T1}/-/${s}/${t}/session/end`,{method:"POST"}).catch(()=>null).then(a);else a();return}if(H)for(let y of H.worlds)navigator.sendBeacon(`${y.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${y.name}/session/end`);I5(""),Q(""),F(""),Y(null),R1([])};if(X||!H)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(f5,{href:`${X1}/`},void 0,!1,void 0,this),$.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),$.jsxDEV("p",{role:"alert",children:X??"nothing answered"},void 0,!1,void 0,this),p1()?$.jsxDEV("a",{className:"button primary",href:`${p1()}/`,children:["Back to ",new URL(p1()).host]},void 0,!0,void 0,this):$.jsxDEV("button",{type:"button",className:"primary",onClick:w,children:J?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let[A,R,I,C,P,k,N]=L,v=I==="~",E=/^[A-Za-z0-9_-]+$/,g=/^[^\u0000-\u001f\u007f]{1,200}$/,h=v||!I||!E.test(I)?void 0:I,S=P&&E.test(P)?k!==void 0&&C!=="changes"&&C!=="screens"?N0(P,k)||void 0:P:void 0,b=C==="changes"&&P==="changesets"&&k&&E.test(k)?k:C==="screens"&&k&&N&&/^[A-Za-z0-9_.-]+$/.test(k)&&g.test(N)?`${k}:${N}`:void 0,j=N0(A,R),x=j?C0()[j]??null:null,V=(y)=>d6(y)||O(y),D=x?H.kind==="admin"?H.worlds.find((y)=>y.name===x.parent)?.token??null:H.worlds.some((y)=>y.name===x.parent)?_:null:null,f=async(y)=>{let p=a6(y.parentOrigin);if(p&&p!==T1){I4(y.name),window.location.assign(`${p}${X1}/${y.parent}#close=${encodeURIComponent(y.name)}`);return}if(y.made)await I1(O(y.parent),`/-/${y.parent}/branches/${y.name}`,{method:"DELETE"}).catch(()=>null),I4(y.name);R1(y.parent.split("/"))};return $.jsxDEV("main",{className:j?"app workspace":"app home",children:[j?null:$.jsxDEV("header",{children:[j?$.jsxDEV(W_,{},void 0,!1,void 0,this):null,$.jsxDEV(f5,{href:`${G0()&&G0()!==T1?G0():""}${X1}/`,onClick:(y)=>{if(G0()&&G0()!==T1)return;y.preventDefault(),R1([])}},void 0,!1,void 0,this),$.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[j?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("span",{children:j.split("/")[0]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${j}`,className:"crumb-world",onClick:(y)=>{y.preventDefault(),R1(j.split("/"))},children:j.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,h?$.jsxDEV("span",{children:[" / ",h]},void 0,!0,void 0,this):null,v&&C==="trace"?$.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),p1()?$.jsxDEV("a",{href:`${p1()}/${j?encodeURIComponent(j.split("/")[0]):""}`,title:`Back to the platform at ${new URL(p1()).host}`,className:"back-link",children:["← ",$.jsxDEV("span",{className:"back-text",children:j?`${j.split("/")[0]}'s Worlds`:new URL(p1()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,j?null:$.jsxDEV("span",{className:"mode",children:J?"on this machine":T?`signed in as ${T}`:H.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),j||J?null:$.jsxDEV("button",{onClick:w,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j?$.jsxDEV(NZ,{name:j,token:V(j),twin:h,tab:v?C??"overview":"overview",arg:v?S:void 0,...v&&b?{sub:b}:{},admin:x?null:H.kind==="admin"?_:null,snapshot:x,parentToken:D,who:{local:J,person:T||null,admin:H.kind==="admin"},onSignOut:w,onReturn:f,opens:(y)=>!!C0()[y]||H.kind==="admin"&&H.worlds.some((p)=>p.name===y),onRemoved:()=>{W(_),R1([])},onWho:B,worlds:H.worlds.map((y)=>y.name)},j,!1,void 0,this):$.jsxDEV(wZ,{mode:H,admin:H.kind==="admin"?_:null,reload:()=>W(_)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wZ({mode:_,admin:Q,reload:J}){let[q,U]=i.useState(""),[G,Z]=i.useState(""),[F,H]=i.useState(""),[Y,X]=i.useState(null),K=async(P)=>{if(!await B0({title:`Rotate the tokens of ${P}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let k=await I1(Q,`/-/worlds/${P}/rotate`,{method:"POST"}),N=await k.json().catch(()=>({}));X(k.ok?`rotated ${P}: the new tokens are shown once — token ${N.token} · read token ${N.readToken}`:N.error?v1(N.error).text:`answered ${k.status}`),await J()},L=async(P)=>{let k=await I1(Q,`/-/worlds/${P}`,{method:"DELETE"}),N=await k.json().catch(()=>({}));X(k.ok?`removed ${P}`:N.error?v1(N.error).text:`answered ${k.status}`),await J()},[z,W]=i.useState(!1),[O,T]=i.useState(!1),[B,w]=i.useState(""),A=async(P)=>{P.preventDefault(),X(null),W(!0);try{let k=await I1(Q,"/-/worlds",{method:"POST",body:JSON.stringify({org:q,world:G,vendors:F.split(",").map((v)=>v.trim()).filter(Boolean)})}),N=await k.json();if(!k.ok){X(N.error?v1(N.error).text:`the host answered ${k.status}`);return}X(`provisioned ${N.name}`),Z(""),H(""),T(!1),await J()}finally{W(!1)}},R=B.trim().toLowerCase(),I=_.worlds.filter((P)=>!R||P.name.toLowerCase().includes(R)||P.twins.some((k)=>k.vendor.includes(R))),C=[...new Set(I.map((P)=>P.name.split("/")[0]))];return $.jsxDEV("section",{className:"home-window","aria-labelledby":"worlds",children:[$.jsxDEV("div",{className:"home-head",children:[$.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[k1(_.worlds.length,"World")," ",Q?"this host serves":"this key opens"]},void 0,!0,void 0,this),Q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{X(null),T(!0)},children:[$.jsxDEV(B1,{name:"plus",size:16},void 0,!1,void 0,this),"New World"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"home-find",children:$.jsxDEV("input",{type:"search",placeholder:"Filter by World or vendor","aria-label":"Filter Worlds",value:B,onChange:(P)=>w(P.target.value)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&!O?$.jsxDEV("p",{role:"status",className:"home-note",children:Y},void 0,!1,void 0,this):null,C.map((P)=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("p",{className:"menu-label home-org",children:P},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"home-list",children:I.filter((k)=>k.name.split("/")[0]===P).map((k)=>$.jsxDEV("li",{children:[$.jsxDEV("a",{href:`${X1}/${k.name}`,onClick:(N)=>{N.preventDefault(),R1(k.name.split("/"))},children:[$.jsxDEV(B1,{name:"globe",size:20},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:k.name.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("small",{children:$.jsxDEV("code",{children:k.base},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"home-vendors",children:k.twins.map((N)=>$.jsxDEV("span",{title:H1(N.vendor),children:$.jsxDEV(b1,{vendor:N.vendor},void 0,!1,void 0,this)},N.vendor,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q?$.jsxDEV("details",{className:"menu home-more",children:[$.jsxDEV("summary",{"aria-label":`More for ${k.name}`,children:"⋯"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"popover menu-list",children:[$.jsxDEV("button",{type:"button",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),K(k.name)},children:"Rotate tokens…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"danger-item",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),B0({title:`Remove ${k.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:k.name}).then((v)=>{if(v)L(k.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},k.name,!0,void 0,this))},void 0,!1,void 0,this)]},P,!0,void 0,this)),I.length===0?$.jsxDEV("p",{className:"mode home-note",children:R?`No World matches ${B}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,$.jsxDEV(t1,{open:O,onClose:()=>{if(!z)T(!1)},title:"New World",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>T(!1),disabled:z,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"provision",className:"primary",disabled:z,children:z?"Making… (ten seconds or so)":"Make World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"provision",onSubmit:A,className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Org"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"org",value:q,onChange:(P)=>U(P.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"world",value:G,onChange:(P)=>Z(P.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Vendors"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"vendors",value:F,onChange:(P)=>H(P.target.value),placeholder:"stripe, slack",required:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"A twin of each, with its default data."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"status",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var PZ=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],b_=(_,Q)=>{let J=Q?.screens?.find((q)=>q.path.replace(/\/+$/,"")==="")??Q?.screens?.find((q)=>!/[{<]/.test(q.path));return Q&&J?`${W2}/${_}/${Q.twin}${J.path.startsWith("/")?J.path:`/${J.path}`}`:null},R_={verify:"verified",use:"used",issue:"issued",revoke:"revoked",rotate:"rotated",seed:"seeded",upsert:"saved",set:"set",start:"started",finish:"finished",fail:"failed",schedule:"scheduled",deliver:"delivered",like:"liked",follow:"followed",reply:"replied",create:"created",update:"updated",delete:"deleted",record:"recorded",remove:"removed",add:"added",send:"sent",post:"posted",postmessage:"posted",cancel:"canceled",close:"closed",open:"opened",publish:"published",upload:"uploaded",invite:"invited",archive:"archived",merge:"merged",refund:"refunded",capture:"captured",confirm:"confirmed",pay:"paid"};function Z0(_){let Q=_.operation??_.op,J=(Q.includes(".")?Q.slice(Q.lastIndexOf(".")+1):Q).toLowerCase(),q=_.subject.type.replace(/[_-]+/g," ").trim(),U=`${q.charAt(0).toUpperCase()}${q.slice(1)}`,G=/(^|\.)twin\./.test(Q)||/^seed_/.test(J),Z=Q.replace(/[._]+/g," ").trim(),F=G?`${U} seeded`:R_[J]?`${U} ${R_[J]}`:`${Z.charAt(0).toUpperCase()}${Z.slice(1)}`,H=_.fields??{},Y=["title","name","email","text","subject","summary","description"].map((K)=>H[K]).find((K)=>typeof K==="string"&&K.trim()!=="")??null,X=Y===null?null:Y.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(K,L,z)=>`${L==="!"?"@":L}${z}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:F,label:X===null?null:X.length>80?`${X.slice(0,79)}…`:X}}var c0=(_)=>/token|password|secret|key|credential/i.test(_.subject.type)&&_.subject.id.length>6?`••••${_.subject.id.slice(-4)}`:_.subject.id;function NZ({name:_,token:Q,twin:J,tab:q,arg:U,sub:G,admin:Z,snapshot:F,parentToken:H,who:Y,onSignOut:X,onReturn:K,opens:L,onRemoved:z,onWho:W,worlds:O=[]}){let[T,B]=i.useState("pending"),[w,A]=i.useState(null),[R,I]=i.useState(0),[C,P]=i.useState(null);i.useEffect(()=>{let d=!0;return A(null),I1(Q,`/-/${_}/session`,{method:"POST"}).then(async(c)=>{let e=await c.json().catch(()=>({}));if(S_(e.issuer),e.who)W?.(e.who);P(typeof e.signsAs==="string"?e.signsAs:null);let Q1=N5(e.origin)?.origin;if(c.status===409&&Q1&&Q1!==T1){s6(Q1,Q,_);return}if(!d)return;if(B(!c.ok?"unknown":e.scope==="read"?"read":e.scope==="write"?"write":"unknown"),!c.ok)A(e.error?v1(e.error).text:`answered ${c.status}`)}).catch((c)=>{if(d)B("unknown"),A(`the World did not answer: ${c instanceof Error?c.message:String(c)}`)}),()=>{d=!1}},[_,Q,R]);let k=w?{state:"error",error:w}:T==="pending"?{state:"pending"}:{state:"ok",scope:T},N=T==="write",v=(d)=>{if(d.status!==403)return;d.clone().json().then((c)=>{if(/read token|opens only reads|write access|reads only/i.test(c?.error??""))B("read")},()=>null)},[E,g]=i.useState(0);i.useEffect(()=>{let d=setInterval(()=>{if(!document.hidden)g((c)=>c+1)},5000);return()=>clearInterval(d)},[]);let[h,S]=i.useState(0),b=w1(Q,`/-/${_}/clock`,E+h),j=w1(Q,`/-/${_}/twins`),x=w1(Q,`/-/${_}/branches`,h),V=w1(Q,`/-/${_}/map`,Math.floor(E/2)),D=!(x.state==="error"&&(x.status===404||x.status===405)),f=PZ.includes(q)?q:"overview",y=j.state==="ok"?j.data.twins.map((d)=>d.twin):[];if(J&&j.state==="ok"&&!y.includes(J))return $.jsxDEV("main",{className:"center",children:$.jsxDEV(h2,{title:`${_} has no ${J}`,action:$.jsxDEV("a",{href:`${X1}/${_}`,onClick:(d)=>{d.preventDefault(),R1(_.split("/"))},children:["Open ",_]},void 0,!0,void 0,this),children:$.jsxDEV("p",{children:["No vendor of this World is called ",J,". Its changesets are under Changes › History."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);let p=f==="vendors"&&U?U:void 0,u=()=>{B("pending"),I((d)=>d+1)};if(f==="canvas"||f==="vendors"&&!p||q==="screens"&&!U)return $.jsxDEV(oZ,{name:_,token:Q,twins:j,session:k,retry:u,snapshot:F,back:()=>R1(_.split("/"))},void 0,!1,void 0,this);let t=q==="settings"?{kind:"settings",tab:((d)=>D_.find(([c])=>c===d)?.[0]??"account")(U)}:q==="remote"?{kind:"settings",tab:"remote"}:q==="vault"?{kind:"settings",tab:"vault"}:q==="branches"?{kind:"branches",...U?{open:U}:{}}:null,a=J?"vendor":q==="screens"&&U?"screen":f==="vendors"&&p?"vendor":q==="trace"?"trace":q==="events"?"events":q==="changes"&&U==="changesets"?"history":"changes";return $.jsxDEV(DZ,{name:_,token:Q,view:a,win:t,who:Y,snapshot:F,onReturn:K,onSignOut:X,worlds:O,session:k,retry:u,...a==="vendor"?{arg:J??p}:a==="events"||a==="trace"||a==="screen"?U?{arg:U}:{}:{},...G?{sub:G}:{},twins:j,map:V,branches:D?x:null,clock:b,canWrite:N&&!F,refused:v,signsAs:C,opens:L,tick:E,admin:Z,onRemoved:z,onClock:()=>S((d)=>d+1),scope:F?"read":T},void 0,!1,void 0,this)}function B1({name:_,size:Q=20}){return $.jsxDEV("svg",{className:"icon",viewBox:"0 0 24 24",width:Q,height:Q,fill:"none",stroke:"currentColor",strokeWidth:Q<=16?1.75:1.5,strokeLinecap:"square",strokeLinejoin:"miter","aria-hidden":"true",children:(A_[_]??[]).map(([J,q],U)=>i.default.createElement(J,{key:U,...q}))},void 0,!1,void 0,this)}function S4(_){let Q=(J)=>{let q=(J.operation??J.op).toLowerCase();return q.includes(".")?q.slice(q.lastIndexOf(".")+1):q};if(_.some((J)=>/^(delete|remove|archive|revoke)/.test(Q(J))||J.fields?.deleted===!0))return{icon:"square-minus",word:"removed",tone:"removed"};if(/^(create|add|insert|issue|send|post|upload|invite|record|seed)/.test(Q(_[0])))return{icon:"square-plus",word:"made",tone:"added"};return{icon:"square-dot",word:"changed",tone:"changed"}}var D_=[["account","Account","user"],["changesets","Changesets","git-commit-horizontal"],["remote","Remote","cloud"],["access","Access","key-round"],["services","Real services","plug"],["vault","Vault","vault"],["checks","Checks","list-checks"],["clock","Clock","clock"],["appearance","Appearance","palette"]],CZ=(_,Q)=>{let J=Q.split("/").pop()??Q,q=_.split("/").pop()??"";return J.startsWith(`${q}-`)?J.slice(q.length+1):J},L2=(_)=>_.replace(/^_+/,"").replace(/[_-]+/g," ");function h_({record:_,history:Q}){let J=_.writes[_.writes.length-1],q=Z0(J),U=S4(_.writes),G=new Set(_.writes.map((K)=>K.id)),Z=_.writes[0].occurredAt,F={};if(Q){for(let K of Q)if(!G.has(K.id)&&!K.landsId&&!K.aliasOf&&K.subject.type===J.subject.type&&K.subject.id===J.subject.id&&K.occurredAt<=Z)Object.assign(F,K.fields??{})}let H={...F};for(let K of _.writes)Object.assign(H,K.fields??{});let Y=U.tone==="added"&&Object.keys(F).length===0,X=[...new Set([...Object.keys(F),...Object.keys(H)])].filter((K)=>!a_(F[K],H[K]));return $.jsxDEV("div",{className:"ws-diff","aria-label":`${q.label??c0(J)}: its changes`,children:[$.jsxDEV("div",{className:"ws-diff-head",children:[$.jsxDEV("span",{className:`ws-kind ${U.tone}`,title:U.word,children:$.jsxDEV(B1,{name:U.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(b1,{vendor:_.twin},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:q.label??c0(J)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[H1(_.twin)," · ",J.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")," ",$.jsxDEV("code",{children:c0(J)},void 0,!1,void 0,this)," · ",U.word," here"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ol",{className:"ws-writes",children:_.writes.map((K)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:Z0(K).what},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(O1,{iso:K.occurredAt},void 0,!1,void 0,this)," · ",w5(K)]},void 0,!0,void 0,this)]},K.id,!0,void 0,this))},void 0,!1,void 0,this),Q===null?$.jsxDEV("p",{className:"mode pad",children:"Reading its history…"},void 0,!1,void 0,this):X.length===0?$.jsxDEV("p",{className:"mode pad",children:"No field holds a new value."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"ws-fields","aria-label":"Fields before and after",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Field"},void 0,!1,void 0,this),Y?null:$.jsxDEV("th",{children:"Before"},void 0,!1,void 0,this),$.jsxDEV("th",{children:U.tone==="removed"?"After":"Now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:X.map((K)=>$.jsxDEV("tr",{children:[$.jsxDEV("th",{scope:"row",children:$.jsxDEV("code",{children:K},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?null:$.jsxDEV("td",{className:K in F?"was":"none",children:K in F?$.jsxDEV(S0,{v:F[K]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:K in H?"now":"none",children:K in H?$.jsxDEV(S0,{v:H[K]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},K,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function E_({records:_,selected:Q,onPick:J,label:q}){let[U,G]=i.useState(()=>{try{return localStorage.getItem("volter.console.records")==="tree"}catch{return!1}}),Z=(Y)=>{G(Y);try{localStorage.setItem("volter.console.records",Y?"tree":"path")}catch{}},F=(Y,X)=>{let K=Y.writes[Y.writes.length-1],L=Z0(K),z=S4(Y.writes);return $.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:[Q===Y.key?"on":"",X?"nested":""].join(" ").trim()||void 0,"aria-pressed":Q===Y.key,onClick:()=>J(Y.key),children:[X?null:$.jsxDEV(b1,{vendor:Y.twin},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:L.label??c0(K)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[L2(K.subject.type)," · ",L.what.split(" ").slice(-1)[0],Y.writes.length>1?` · ${k1(Y.writes.length,"write")}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:`ws-kind ${z.tone}`,title:z.word,"aria-label":z.word,children:$.jsxDEV(B1,{name:z.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Y.key,!1,void 0,this)},H=[...new Set(_.map((Y)=>Y.twin))];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-view-switch",role:"group","aria-label":"List the records by",children:[$.jsxDEV("button",{type:"button","aria-pressed":!U,className:U?void 0:"on",onClick:()=>Z(!1),children:"Path"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button","aria-pressed":U,className:U?"on":void 0,onClick:()=>Z(!0),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"ws-list","aria-label":q,children:U?H.map((Y)=>{let X=_.filter((K)=>K.twin===Y);return $.jsxDEV("li",{className:"ws-group",children:[$.jsxDEV("p",{className:"ws-group-head",children:[$.jsxDEV(b1,{vendor:Y},void 0,!1,void 0,this),$.jsxDEV("b",{children:H1(Y)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:X.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:X.map((K)=>F(K,!0))},void 0,!1,void 0,this)]},Y,!0,void 0,this)}):_.map((Y)=>F(Y,!1))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function SZ({name:_,token:Q,branches:J,opens:q,refused:U,onChanged:G}){let[Z,F]=i.useState(""),[H,Y]=i.useState(!1),X=J?.state==="ok"&&J.data.checkedOut||_.split("/")[1],K=J?.state==="ok"&&J.data.named?.length?J.data.named:[{name:X,running:!0}],L=J?.state==="ok"?J.data.branches:[],z=Z.trim().toLowerCase(),W=(T)=>!z||T.toLowerCase().includes(z),O=(T)=>{T.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"The branch served here",children:[$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("b",{children:X},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover ws-branch-menu",children:[$.jsxDEV("div",{className:"ws-branch-find",children:[$.jsxDEV("input",{type:"search",placeholder:"Filter","aria-label":"Filter branches",value:Z,onChange:(T)=>F(T.target.value)},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:(T)=>{O(T),Y(!0)},disabled:!J,children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"This World"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-branch-list",children:K.filter((T)=>W(T.name)).map((T)=>$.jsxDEV("li",{className:T.name===X?"current":void 0,children:[$.jsxDEV("span",{className:"tick",children:T.name===X?$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:T.name},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:T.name===X?"served here":T.running?"running":"stopped"},void 0,!1,void 0,this)]},T.name,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Branches of it"},void 0,!1,void 0,this),L.length===0?$.jsxDEV("p",{className:"mode ws-branch-none",children:"None yet. New branch makes one, from now or as the World was."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"ws-branch-list",children:L.filter((T)=>W(T.name)).map((T)=>{let B=$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"tick",children:$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:CZ(_,T.name)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:T.at?.instant?$.jsxDEV($.Fragment,{children:["as of ",$.jsxDEV(O1,{iso:T.at.instant,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w=T.expiresAt?`Goes away ${new Date(T.expiresAt).toLocaleString()}`:"Kept";return $.jsxDEV("li",{children:q(T.name)?$.jsxDEV("a",{href:`${X1}/${T.name}`,title:w,onClick:(A)=>{A.preventDefault(),O(A),u_(T.name,T.name.split("/"))},children:B},void 0,!1,void 0,this):$.jsxDEV("span",{title:`${w}. Its tokens went to whoever made it; it opens from their page.`,children:B},void 0,!1,void 0,this)},T.name,!1,void 0,this)})},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-branch-foot",children:$.jsxDEV("a",{href:`${X1}/${_}/~/branches`,onClick:(T)=>{T.preventDefault(),O(T),R1([..._.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g_,{name:_,token:Q,open:H,onClose:()=>Y(!1),onMade:G,refused:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function x_({name:_,view:Q,changes:J,changesets:q}){let U=(G)=>(Z)=>{Z.preventDefault(),R1([..._.split("/"),"~",...G])};return $.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[$.jsxDEV("a",{href:`${X1}/${_}/~/changes`,className:Q==="changes"?"on":void 0,"aria-current":Q==="changes"?"page":void 0,onClick:U(["changes"]),children:["Changes",J?$.jsxDEV("span",{className:"count",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/changes/changesets`,className:Q==="history"?"on":void 0,"aria-current":Q==="history"?"page":void 0,onClick:U(["changes","changesets"]),children:["History",q?$.jsxDEV("span",{className:"count",children:q},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function kZ({name:_,token:Q,sets:J,sub:q,signsAs:U,canWrite:G,rooted:Z,refused:F,onChanged:H,changes:Y,withScreens:X,required:K}){let[L,z]=i.useState(null),[W,O]=i.useState(!1),T=J.state==="ok"?[...J.data.changesets].sort((k,N)=>N.createdAt.localeCompare(k.createdAt)):[],B=T.find((k)=>k.name===q)??T[0],w=i.useMemo(()=>{let k=new Map;for(let N of B?i_(B):[]){let v=`${N.twin}:${N.entry.subject.type}:${N.entry.subject.id}`,E=k.get(v)??{key:v,twin:N.twin,writes:[]};E.writes.push(N.entry),k.set(v,E)}return[...k.values()]},[B]),A=w.find((k)=>k.key===L)??w[0],R=w1(Q,A?`/-/${_}/log/${A.twin}`:null),I={added:0,removed:0,changed:0};for(let k of w)I[S4(k.writes).tone]=(I[S4(k.writes).tone]??0)+1;let C=B?k4(B):null,P=B?d_(B,K):null;return $.jsxDEV("div",{className:"ws-two",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(x_,{name:_,view:"history",changes:Y,changesets:T.length},void 0,!1,void 0,this),$.jsxDEV(g1,{load:J,what:"the changesets",lines:4},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-list ws-commits","aria-label":"Changesets",children:T.map((k)=>{let N=B?.name===k.name,v=k4(k).label==="Not sent";return $.jsxDEV("li",{children:$.jsxDEV("a",{href:`${X1}/${_}/~/changes/changesets/${k.name}`,className:N?"on":void 0,"aria-current":N?"true":void 0,onClick:(E)=>{E.preventDefault(),z(null),R1([..._.split("/"),"~","changes","changesets",k.name])},children:[$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:l6(k)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[k.owner??(k.cutBy?w4(k.cutBy):"unrecorded")," • ",$.jsxDEV(O1,{iso:k.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),v?$.jsxDEV("span",{className:"ws-unpushed",title:"Not pushed to the remote yet",children:$.jsxDEV(B1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},k.name,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-pane-right",children:[J.state==="ok"&&!B?$.jsxDEV(h2,{title:"No changesets yet",children:$.jsxDEV("p",{children:"Cut one from Changes: the cut box is at its foot."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,B&&C&&P?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-commit-head",children:[$.jsxDEV("div",{className:"ws-commit-title",children:[$.jsxDEV("h3",{children:l6(B)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-commit-stat",children:[$.jsxDEV(B1,{name:"file-diff",size:16},void 0,!1,void 0,this)," ",k1(w.length,"changed record"),I.added?$.jsxDEV("span",{className:"plus",children:[" +",I.added]},void 0,!0,void 0,this):null,I.removed?$.jsxDEV("span",{className:"minus",children:[" −",I.removed]},void 0,!0,void 0,this):null,I.changed?$.jsxDEV("span",{className:"dot",children:[" •",I.changed]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode ws-commit-meta",children:[$.jsxDEV("code",{children:B.name},void 0,!1,void 0,this)," · ",$.jsxDEV(O1,{iso:B.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"ws-commit-who",children:[["Owner",B.owner??(B.cutBy&&/^(token|token:read)$|^key:(?!.* for:)/.test(B.cutBy)?"no person: a service’s":"unrecorded")],["Cut by",B.cutBy?B.pushedBy&&B.applied===null&&B.cutBy==="machine"?"the machine it was cut on":w4(B.cutBy):"unrecorded"],...B.pushedBy?[["Pushed by",w4(B.pushedBy)]]:[]].map(([k,N])=>$.jsxDEV("span",{children:[$.jsxDEV("span",{className:"mode",children:k},void 0,!1,void 0,this)," ",N]},k,!0,void 0,this))},void 0,!1,void 0,this),B.pushedBy?$.jsxDEV("p",{className:"mode ws-commit-meta",children:B.applied===null?"Owner and cut by are as the World it was cut in recorded them; pushed by is this World's own record.":"Owner and cut by are this World’s record; pushed by is as the remote recorded it."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>O(!0),title:"Where it went, the checks, the approvals; Verify, Approve and Deploy",children:[$.jsxDEV("span",{className:`badge cs-${C.tone}`,children:C.label},void 0,!1,void 0,this),$.jsxDEV("span",{className:`badge cs-${P.tone}`,children:P.label},void 0,!1,void 0,this),"Review…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-two inner",children:[$.jsxDEV("div",{className:"ws-files",children:$.jsxDEV(E_,{records:w,...A?{selected:A.key}:{},onPick:z,label:"Records it changed"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:A?$.jsxDEV(h_,{record:A,history:R.state==="ok"?R.data.entries:R.state==="error"?[]:null},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"It changes nothing."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:W,onClose:()=>O(!1),title:`Review: ${l6(B)}`,wide:!0,children:[$.jsxDEV(w_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:H,part:"head",required:K},`h:${B.name}`,!1,void 0,this),$.jsxDEV(w_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:H,part:"review",required:K},`r:${B.name}`,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function yZ({name:_,token:Q,vendors:J,vendor:q,tick:U}){let[G,Z]=i.useState(O_*4),[F,H]=i.useState(""),[Y,X]=i.useState(null),K=w1(Q,`/-/${_}/timeline?limit=${G}${q?`&twin=${encodeURIComponent(q)}`:""}`,Math.floor(U/2)),L=K.state==="ok"?aZ(K.data.entries):[],z=[...new Set(L.map((I)=>Z0(I.entry).what))].sort(),W=L.filter((I)=>!F||Z0(I.entry).what===F),O=W.find((I)=>x2(I)===Y)??W[0],T=(I)=>(C)=>{C.preventDefault(),X(null),R1([..._.split("/"),"~","events",...I?[I]:[]])},B=O?.entry.input&&typeof O.entry.input==="object"?O.entry.input.body:void 0,w=O?RZ(O.entry.traceparent):null,A=O?f_(O):null,R=O?lZ(O.entry):[];return $.jsxDEV("div",{className:"ws-events",children:[$.jsxDEV("div",{className:"ws-filterbar",children:[$.jsxDEV("nav",{className:"ws-seg","aria-label":"Vendor",children:[$.jsxDEV("a",{href:`${X1}/${_}/~/events`,className:!q?"on":void 0,"aria-current":!q?"page":void 0,onClick:T(),children:"All"},void 0,!1,void 0,this),J.map((I)=>$.jsxDEV("a",{href:`${X1}/${_}/~/events/${I}`,className:q===I?"on":void 0,"aria-current":q===I?"page":void 0,onClick:T(I),children:[$.jsxDEV(b1,{vendor:I},void 0,!1,void 0,this),H1(I)]},I,!0,void 0,this))]},void 0,!0,void 0,this),$.jsxDEV("select",{"aria-label":"Operation",value:F,onChange:(I)=>{H(I.target.value),X(null)},children:[$.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),z.map((I)=>$.jsxDEV("option",{value:I,children:I},I,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[$.jsxDEV(g1,{load:K,what:"the events",lines:6},void 0,!1,void 0,this),$.jsxDEV("table",{className:"ws-grid","aria-label":"Events",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Time"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"What"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Record"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"By"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Receipt"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:W.map((I)=>{let C=Z0(I.entry),P=f_(I),k=O&&x2(I)===x2(O);return $.jsxDEV("tr",{className:k?"on":void 0,"aria-selected":k,onClick:()=>X(x2(I)),children:[$.jsxDEV("td",{className:"mono",children:$.jsxDEV(O1,{iso:I.entry.occurredAt,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:I.twin},void 0,!1,void 0,this),H1(I.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("b",{children:C.what},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"ws-cell-clip",children:C.label?`“${C.label}”`:$.jsxDEV("code",{children:c0(I.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:w5(I.entry,I.caller)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P?$.jsxDEV("span",{className:P.bad?"badge cs-bad":P.status==="deployed"?"badge cs-done":"badge",children:P.status},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:y_(I.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},x2(I),!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-detail",children:O?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-event-line",children:[$.jsxDEV("span",{className:"badge",children:c_(O.entry)},void 0,!1,void 0,this),A?$.jsxDEV("span",{className:A.bad?"badge cs-bad":"badge cs-good",children:A.status},void 0,!1,void 0,this):null,$.jsxDEV("code",{children:[O.entry.subject.type,":",c0(O.entry)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(O1,{iso:O.entry.occurredAt},void 0,!1,void 0,this)," · ",w5(O.entry,O.caller)]},void 0,!0,void 0,this),w?$.jsxDEV("a",{href:`${X1}/${_}/~/trace/${w.trace}`,onClick:(I)=>{I.preventDefault(),R1([..._.split("/"),"~","trace",w.trace])},children:"Its trace →"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-panes",children:[$.jsxDEV("div",{role:"region","aria-label":"The request",children:[$.jsxDEV("h4",{children:"Request"},void 0,!1,void 0,this),B!==void 0?$.jsxDEV(iZ,{body:B},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"No request body: the World or the vendor wrote it."},void 0,!1,void 0,this),R.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Usage"},void 0,!1,void 0,this),$.jsxDEV("dl",{className:"fields",children:R.map(([I,C])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:I},void 0,!1,void 0,this),$.jsxDEV("dd",{children:C},void 0,!1,void 0,this)]},I,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{role:"region","aria-label":"What it wrote",children:[$.jsxDEV("h4",{children:"Written"},void 0,!1,void 0,this),$.jsxDEV(r_,{fields:O.entry.fields},void 0,!1,void 0,this),$.jsxDEV("h4",{children:O.copies.length?"Receipts":"Receipt"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:O.copies.length?O.copies.map((I)=>I.entry.receipt?.status??"landed copy").join(" · "):dZ(O.entry)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"Nothing written here yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:[$.jsxDEV("span",{children:[O?`${W.indexOf(O)+1} of ${W.length}`:W.length," events",q?` at ${H1(q)}`:""]},void 0,!0,void 0,this),K.state==="ok"&&K.data.next?$.jsxDEV("button",{type:"button",onClick:()=>Z((I)=>I+O_*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function vZ({name:_,token:Q,id:J}){let q=/^[0-9a-f]{32}$/.test(J),U=w1(Q,q?`/-/${_}/timeline?trace=${J}&limit=500`:null),G=U.state==="ok"?[...U.data.entries].sort((K,L)=>-p_(K,L)):[],[Z,F]=i.useState(null),H=G[0]?Date.parse(G[0].entry.occurredAt):0,Y=G.length?Math.max(1,Date.parse(G[G.length-1].entry.occurredAt)-H):1,X=[...new Set(G.map((K)=>K.twin))];return $.jsxDEV("div",{className:"ws-sheet ws-trace",children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${X1}/${_}/~/events`,onClick:(K)=>{K.preventDefault(),R1([..._.split("/"),"~","events"])},children:[$.jsxDEV(B1,{name:"arrow-left",size:16},void 0,!1,void 0,this)," Events"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("h2",{children:[G[0]?`${Z0(G[0].entry).what} …`:"Trace"," ",$.jsxDEV("code",{className:"mode",children:J.slice(0,12)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!q?$.jsxDEV("p",{role:"alert",children:[J?`${J} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):$.jsxDEV(g1,{load:U,what:"the trace"},void 0,!1,void 0,this),G.length?$.jsxDEV("p",{className:"ws-trace-meta",children:["Started ",$.jsxDEV("b",{children:$.jsxDEV(O1,{iso:G[0].entry.occurredAt},void 0,!1,void 0,this)},void 0,!1,void 0,this)," · Took ",$.jsxDEV("b",{children:[Y," ms"]},void 0,!0,void 0,this)," · Vendors ",$.jsxDEV("b",{children:X.map(H1).join(", ")},void 0,!1,void 0,this)," · Writes ",$.jsxDEV("b",{children:G.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,U.state==="ok"&&G.length===0?$.jsxDEV(h2,{title:"Nothing in this World carries this trace",children:$.jsxDEV("p",{children:["An app instrumented with OpenTelemetry sends a ",$.jsxDEV("code",{children:"traceparent"},void 0,!1,void 0,this)," with each call, and every write that call makes keeps it, so one click reads across every vendor."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,G.length?$.jsxDEV("div",{className:"ws-spans",role:"table","aria-label":"The trace's writes",children:[$.jsxDEV("div",{className:"ws-span head",role:"row",children:[$.jsxDEV("span",{role:"columnheader",children:"Vendor and what"},void 0,!1,void 0,this),$.jsxDEV("span",{role:"columnheader",className:"ws-ticks",children:[$.jsxDEV("span",{children:"0 ms"},void 0,!1,void 0,this),$.jsxDEV("span",{children:[Math.round(Y/2)," ms"]},void 0,!0,void 0,this),$.jsxDEV("span",{children:[Y," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.map((K)=>{let L=Date.parse(K.entry.occurredAt)-H,z=x2(K),W=Z0(K.entry);return $.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("div",{className:Z===z?"ws-span on":"ws-span",role:"row",onClick:()=>F(Z===z?null:z),children:[$.jsxDEV("span",{role:"cell",className:"ws-span-name",children:[$.jsxDEV(b1,{vendor:K.twin},void 0,!1,void 0,this),$.jsxDEV("b",{children:H1(K.twin)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[W.what,W.label?` “${W.label}”`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{role:"cell",className:"ws-span-track",children:[$.jsxDEV("span",{className:"ws-span-dot",style:{left:`${L/Y*100}%`}},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-span-at mode",style:{left:`${L/Y*100}%`},children:["+",L," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z===z?$.jsxDEV("div",{className:"ws-span-detail",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:c_(K.entry)},void 0,!1,void 0,this)," on ",$.jsxDEV("code",{children:[K.entry.subject.type,":",c0(K.entry)]},void 0,!0,void 0,this)," · ",w5(K.entry,K.caller)," · ",y_(K.entry)]},void 0,!0,void 0,this),$.jsxDEV(r_,{fields:K.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},z,!0,void 0,this)})]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function jZ({name:_,token:Q,vendor:J,withScreens:q,tick:U}){let G=w1(Q,`/-/${_}/checkpoint/${J}`,Math.floor(U/6)),Z=G.state==="ok"?G.data.tree.filter((R)=>R.deleted!==!0):[],F=[...new Set(Z.map((R)=>R.type))].map((R)=>({type:R,count:Z.filter((I)=>I.type===R).length})).sort((R,I)=>Number(R.type.startsWith("_"))-Number(I.type.startsWith("_"))||L2(R.type).localeCompare(L2(I.type))),[H,Y]=i.useState(null),[X,K]=i.useState(null),L=F.some((R)=>R.type===H)?H:F[0]?.type,z=Z.filter((R)=>R.type===L),W=z.find((R)=>R.id===X)??z[0],O=["name","email","title","text","description","subject","amount","percent_off","unit_amount","currency","status","channel","customer","product"],T=new Set(["id","type","object","livemode","created","updated","updatedAt","deleted"]),B=(R)=>!T.has(R)&&z.some((I)=>I[R]!==void 0&&I[R]!==null&&typeof I[R]!=="object"),w=[...new Set(z.flatMap((R)=>Object.keys(R)))],A=[...O.filter(B),...w.filter((R)=>!O.includes(R)&&B(R))].slice(0,4);return $.jsxDEV("div",{className:"ws-table-app",children:[$.jsxDEV("nav",{className:"ws-tables","aria-label":`${H1(J)}'s records`,children:[$.jsxDEV("div",{className:"ws-list-head",children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:J},void 0,!1,void 0,this),H1(J)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(g1,{load:G,what:"what it stores",lines:4},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Stores"},void 0,!1,void 0,this),F.map((R)=>$.jsxDEV("a",{href:`#${R.type}`,className:L===R.type?"on":void 0,"aria-current":L===R.type?"true":void 0,onClick:(I)=>{I.preventDefault(),Y(R.type),K(null)},children:[$.jsxDEV(B1,{name:"table-2",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:L2(R.type)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"count",children:R.count},void 0,!1,void 0,this)]},R.type,!0,void 0,this)),$.jsxDEV("p",{className:"menu-label",children:"Also"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/events/${J}`,onClick:(R)=>{R.preventDefault(),R1([..._.split("/"),"~","events",J])},children:[$.jsxDEV(B1,{name:"activity",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its events"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q?$.jsxDEV("a",{href:`${X1}/${_}/~/screens/${J}`,onClick:(R)=>{R.preventDefault(),R1([..._.split("/"),"~","screens",J])},children:[$.jsxDEV(B1,{name:"monitor",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[G.state==="ok"&&F.length===0?$.jsxDEV(h2,{title:`${H1(J)} stores nothing yet`,children:$.jsxDEV("p",{children:"What your app makes there shows here, by type."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,z.length?$.jsxDEV("table",{className:"ws-grid","aria-label":`${L2(L??"")} records`,children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),A.map((R)=>$.jsxDEV("th",{children:R},R,!1,void 0,this)),$.jsxDEV("th",{children:"updated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:z.map((R)=>$.jsxDEV("tr",{className:W?.id===R.id?"on":void 0,"aria-selected":W?.id===R.id,onClick:()=>K(R.id),children:[$.jsxDEV("td",{children:$.jsxDEV("code",{children:R.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),A.map((I)=>$.jsxDEV("td",{className:"ws-cell-clip",children:R[I]===void 0||R[I]===null?$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(R[I])},I,!1,void 0,this)),$.jsxDEV("td",{className:"mode",children:typeof R.updatedAt==="string"?$.jsxDEV(O1,{iso:R.updatedAt},void 0,!1,void 0,this):"—"},void 0,!1,void 0,this)]},R.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("aside",{className:"ws-record","aria-label":"The selected record",children:W?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:L2(W.type)},void 0,!1,void 0,this),$.jsxDEV("code",{children:W.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("dl",{className:"ws-record-fields",children:Object.entries(W).filter(([R])=>R!=="type"&&R!=="id").map(([R,I])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:R},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(S0,{v:I},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},R,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:W?`${z.indexOf(W)+1} of ${k1(z.length,L2(L??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function VZ({name:_,vendor:Q,url:J,mapError:q,holding:U,session:G,retry:Z}){return $.jsxDEV("div",{className:"ws-screen",children:[$.jsxDEV("div",{className:"ws-screen-bar",children:[$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:Q},void 0,!1,void 0,this),$.jsxDEV("b",{children:H1(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:U},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/vendors/${Q}`,onClick:(F)=>{F.preventDefault(),R1([..._.split("/"),"~","vendors",Q])},children:[$.jsxDEV(B1,{name:"table-2",size:16},void 0,!1,void 0,this),"Its records"]},void 0,!0,void 0,this),J?$.jsxDEV("a",{href:J,target:"_blank",rel:"noopener noreferrer",children:[$.jsxDEV(B1,{name:"external-link",size:16},void 0,!1,void 0,this),"New tab"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),G.state==="ok"&&G.scope==="read"?$.jsxDEV("p",{className:"mode ws-screens-note",children:"You are looking read only: the screens browse, and refuse changes."},void 0,!1,void 0,this):null,q?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not say where its screens are: ",q]},void 0,!0,void 0,this):G.state==="pending"||J===void 0?$.jsxDEV("p",{className:"mode ws-screens-note",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,G.state==="error"?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not open its screens: ",G.error," ",$.jsxDEV("button",{type:"button",onClick:Z,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,G.state==="ok"&&J===null?$.jsxDEV("p",{className:"mode ws-screens-note",children:[H1(Q),"'s pack lists no screens."]},void 0,!0,void 0,this):null,G.state==="ok"&&J?$.jsxDEV("iframe",{title:`${H1(Q)}, as this World shows it`,src:J},Q,!1,void 0,this):null]},void 0,!0,void 0,this)}function uZ({name:_,token:Q,who:J,scope:q}){let[U,G]=i.useState(0),Z=w1(Q,`/-/${_}/twins`),F=w1(Q,`/-/${_}/rules`,U),H=F.state==="ok"?F.data.changesets:null,[Y,X]=i.useState(null),[K,L]=i.useState(null),[z,W]=i.useState(!1),[O,T]=i.useState([]),B=Y??H?.approvals??1,w=K??H?.summary??"required",A=H!==null&&(B!==(H.approvals??1)||w!==(H.summary??"required")),R=(v,E)=>{if(T((g)=>[{ok:v,text:E,at:new Date().toISOString(),n:++C5},...g].slice(0,3)),!v)u1(E,"error")},I=async(v)=>{v.preventDefault(),W(!0);try{let E=await I1(Q,`/-/${_}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:B,summary:w}})});if(!E.ok){R(!1,`Save: ${await J0(E)}`);return}R(!0,`Saved: ${B===0?"no approval":k1(B,"approval")} before a deploy; a summary ${w==="required"?"required":"generated when none is given"}.`),X(null),L(null),G((g)=>g+1)}finally{W(!1)}},C={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},P=J.person?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:J.person},void 0,!1,void 0,this),J.local?", signed in on this machine":""]},void 0,!0,void 0,this):J.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this machine"},void 0,!1,void 0,this),": no one is signed in here, so no person owns them until they are pushed by one"]},void 0,!0,void 0,this):J.admin?$.jsxDEV($.Fragment,{children:$.jsxDEV("b",{children:"the host's admin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this token"},void 0,!1,void 0,this),", a service"]},void 0,!0,void 0,this),k=Z.state==="ok"?Z.data.twins.filter((v)=>v.root?.url):[],N=q!=="write"?"This session reads the World; it changes no rules":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Changesets"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"This World's rules, kept with it and shared by everyone who works in it. A person or the World's token changes them; a key never does, so an agent cannot relax the review its own changes go through."},void 0,!1,void 0,this),$.jsxDEV(g1,{load:F,what:"the rules",lines:2},void 0,!1,void 0,this),$.jsxDEV("form",{className:"ws-rules",onSubmit:(v)=>void I(v),"aria-label":"Changeset rules",children:[$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Recorded as"},void 0,!1,void 0,this),$.jsxDEV("p",{children:["What you cut here is recorded as ",P,". An agent's or an app's key cuts as itself, for the person it was made for; a World's token cuts as a service."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"A cut's summary"},void 0,!1,void 0,this),$.jsxDEV("fieldset",{className:"choice",disabled:Boolean(N)||H===null,children:[$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:w==="required",onChange:()=>L("required")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Required: whoever cuts says what it does and why"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:w==="generated",onChange:()=>L("generated")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Generated from its changes when none is given"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Either way a cut takes every change not yet in a changeset: there is no staging."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Ready to deploy"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-rule-list",children:$.jsxDEV("li",{children:[$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this),"Verified: replayed in a throwaway World, the World's checks passing"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("label",{className:"ws-rule-row",children:[$.jsxDEV("span",{children:"Approved by"},void 0,!1,void 0,this),$.jsxDEV("select",{value:B,onChange:(v)=>X(Number(v.target.value)),disabled:Boolean(N)||H===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((v)=>$.jsxDEV("option",{value:v,children:v===0?"no one: verified is enough":v===1?"1 person":`${v} different people`},v,!1,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"for its contents as they stand"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Deploys to"},void 0,!1,void 0,this),Z.state==="ok"&&k.length===0?$.jsxDEV("p",{className:"mode",children:"No vendor here is connected to its real service, so nothing deploys from this World."},void 0,!1,void 0,this):null,k.length?$.jsxDEV("ul",{className:"ws-rule-list",children:k.map((v)=>$.jsxDEV("li",{children:[$.jsxDEV(b1,{vendor:v.twin},void 0,!1,void 0,this),H1(v.twin),": ",C[v.root.deploy??"gated"]??"gated"]},v.twin,!0,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("a",{href:`${X1}/${_}/~/settings/services`,onClick:(v)=>{v.preventDefault(),R1([..._.split("/"),"~","settings","services"])},children:"Real services"},void 0,!1,void 0,this)," sets each vendor's deploy policy."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(l0,{log:O,name:_},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(N)||z||!A,title:N??void 0,children:z?"Saving…":"Save"},void 0,!1,void 0,this),A?$.jsxDEV("button",{type:"button",onClick:()=>{X(null),L(null)},children:"Cancel"},void 0,!1,void 0,this):null,N?$.jsxDEV("span",{className:"mode",children:[N,"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function bZ({who:_,scope:Q,snapshot:J,portal:q,onSignOut:U}){let G=Q==="write"?"Reads and changes this World":Q==="read"?"Reads this World; changes nothing":"…",[Z,F]=J?["A snapshot",`of ${J.parent}, read only`]:_.local&&_.person?[_.person,"Signed in on this machine: this World is served here, and acts as you"]:_.local?["This machine","Served here, with no one signed in: what you do is recorded as this machine"]:_.person?[_.person,q?`Signed in through ${new URL(q).host}`:"Signed in"]:_.admin?["The host's admin","Opened with the host admin token: every World it serves"]:["A link or key","Opened with a token for this World"];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Account"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-account",children:[$.jsxDEV("span",{className:"ws-account-face","aria-hidden":"true",children:$.jsxDEV(B1,{name:_.person?"user":_.local?"monitor":J?"clock":"key-round",size:20},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:Z},void 0,!1,void 0,this),$.jsxDEV("small",{children:F},void 0,!1,void 0,this),$.jsxDEV("small",{children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_.local||J?null:$.jsxDEV("p",{children:$.jsxDEV("button",{type:"button",onClick:U,children:[$.jsxDEV(B1,{name:"log-out",size:16},void 0,!1,void 0,this),_.person?"Sign out":_.admin?"Sign out of the host":"Use another token"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&_.person?$.jsxDEV("p",{className:"mode",children:["Your profile, orgs and keys are on ",$.jsxDEV("a",{href:`${q}/`,children:new URL(q).host},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function DZ({name:_,token:Q,view:J,sub:q,arg:U,win:G,who:Z,snapshot:F,onReturn:H,onSignOut:Y,worlds:X,session:K,retry:L,twins:z,map:W,branches:O,clock:T,canWrite:B,refused:w,signsAs:A,opens:R,tick:I,admin:C,onRemoved:P,onClock:k,scope:N}){let v=s_(_,Q,I,w),[E,g]=i.useState(0),h=E*1e5+Math.floor(I/2),S=w1(Q,`/-/${_}/diff`,h),b=w1(Q,`/-/${_}/changesets`,h),j=w1(Q,`/-/${_}/rules`,h),[x,V]=i.useState(null),D=(o)=>(z1)=>{z1?.preventDefault(),R1([..._.split("/"),"~",...o])},f=z.state==="ok"?z.data.twins.map((o)=>o.twin):[],y=new Map((W.state==="ok"?W.data.twins:[]).flatMap((o)=>{let z1=b_(_,o);return z1?[[o.twin,z1]]:[]})),p=[...y.keys()],u=W.state==="ok"?W.data.twins.filter((o)=>o.root).map((o)=>o.twin):[],s=(o)=>W.state==="ok"?(W.data.twins.find((z1)=>z1.twin===o)?.resources??[]).reduce((z1,q1)=>z1+q1.count,0):0,t=O?.state==="ok"&&O.data.checkedOut||_.split("/")[1],a=i.useMemo(()=>{if(S.state!=="ok")return[];let o=new Map;for(let z1 of S.data.changes){let q1=`${z1.twin}:${z1.entry.subject.type}:${z1.entry.subject.id}`,y1=o.get(q1)??{key:q1,twin:z1.twin,writes:[]};y1.writes.push(z1.entry),o.set(q1,y1)}return[...o.values()]},[S]),d=a.find((o)=>o.key===x)??a[0],c=w1(Q,J==="changes"&&d?`/-/${_}/log/${d.twin}`:null,h),e=S.state==="ok"?S.data.changes.length:0,Q1=v.waiting.length,G1=v.there,$1=v.origin.state==="ok"?v.origin.data.origin:null,Z1=!B?"This session reads the World; it changes nothing":!G1?"No remote: name one in Settings › Remote":null,Y1=(o,z1,q1,y1,c1,l1)=>$.jsxDEV("a",{href:`${X1}/${_}/~/${y1}`,className:o?"on":void 0,"aria-current":o?"page":void 0,onClick:c1,children:[z1,$.jsxDEV("span",{children:q1},void 0,!1,void 0,this),l1?$.jsxDEV("span",{className:"count",children:l1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),K1=(o)=>{o.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("div",{className:"ws",children:[$.jsxDEV("div",{className:"ws-bar",role:"toolbar","aria-label":`${_} toolbar`,children:[$.jsxDEV("div",{className:"ws-left",children:[$.jsxDEV(f5,{href:`${X1}/${_}`,onClick:(o)=>{o.preventDefault(),D(["changes"])()}},void 0,!1,void 0,this),$.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"This World",children:[$.jsxDEV(B1,{name:"globe",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("b",{children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover menu-list ws-world-menu",children:[Z.local?null:$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Worlds"},void 0,!1,void 0,this),X.map((o)=>$.jsxDEV("a",{href:`${X1}/${o}`,className:o===_?"on":void 0,onClick:(z1)=>{z1.preventDefault(),K1(z1),R1(o.split("/"))},children:[o===_?$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(B1,{name:"globe",size:16},void 0,!1,void 0,this),o]},o,!0,void 0,this)),$.jsxDEV("a",{href:`${G0()&&G0()!==T1?G0():""}${X1}/`,onClick:(o)=>{if(G0()&&G0()!==T1)return;o.preventDefault(),K1(o),R1([])},children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",p1()?` on ${new URL(p1()).host}`:""]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Connect an app"},void 0,!1,void 0,this),p1()?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key made on the platform; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[W2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(p6,{text:O4({platform:p1(),world:_})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!Z.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key from Settings › Access; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[W2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(p6,{text:O4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Run it in this World; its calls to these vendors land here:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-menu-text mode",children:["Or point an SDK at ",$.jsxDEV("code",{children:[W2,"/",_,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",$.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),$.jsxDEV(p6,{text:O4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/settings`,onClick:(o)=>{K1(o),D(["settings"])(o)},children:[$.jsxDEV(B1,{name:"settings",size:16},void 0,!1,void 0,this),"Settings…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(SZ,{name:_,token:Q,branches:O,opens:R,refused:w,onChanged:k},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-where",title:"Where this is",children:[$.jsxDEV("span",{children:_},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("span",{children:t},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$1?$.jsxDEV("a",{href:`${X1}/${_}/~/remote`,onClick:D(["remote"]),children:["origin ",$1.namespace,Q1?$.jsxDEV("b",{children:[" ↑",Q1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("a",{href:`${X1}/${_}/~/remote`,onClick:D(["remote"]),children:"no remote"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/settings/clock`,onClick:D(["settings","clock"]),children:T.state==="ok"?$.jsxDEV($.Fragment,{children:[T.data.frozen?"stopped at ":"",$.jsxDEV(O1,{iso:T.data.at,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-right",children:[$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void v.pull(),disabled:Boolean(Z1)||v.busy!==null,title:Z1??`Fetch what ${G1} has and move this branch onto it`,children:[$.jsxDEV(B1,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),v.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void v.push(),disabled:Boolean(Z1)||v.busy!==null||Q1===0,title:Z1??(Q1?`Push ${k1(Q1,"changeset")} to ${G1}`:`Every changeset is at ${G1}`),children:[$.jsxDEV(B1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),v.busy==="Push"?"Pushing…":"Push",Q1?$.jsxDEV("span",{className:"ws-btn-count",children:Q1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn icon-only","aria-label":"Settings",title:"Settings",onClick:()=>D(["settings"])(),children:$.jsxDEV(B1,{name:"settings",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F?$.jsxDEV("div",{className:"ws-banner",role:"region","aria-label":"Snapshot",children:[$.jsxDEV(B1,{name:"clock",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:["You are looking at ",$.jsxDEV("b",{children:F.parent},void 0,!1,void 0,this)," as it was at ",$.jsxDEV(O1,{iso:F.at},void 0,!1,void 0,this),": a read-only snapshot",F.expiresAt?$.jsxDEV($.Fragment,{children:[", gone ",$.jsxDEV(O1,{iso:F.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void H(F),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,v.log.length?$.jsxDEV("div",{className:"ws-said",children:$.jsxDEV(l0,{log:v.log.slice(0,1),name:_},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV("div",{className:"ws-body",children:[$.jsxDEV("nav",{className:"ws-side","aria-label":`${_} places`,children:[p.length?$.jsxDEV("a",{href:`${X1}/${_}/~/screens`,className:J==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:D(["screens"]),title:`${k1(p.length,"screen")}: ${X2(p.map(H1))}`,children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Screens"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-screens-marks",children:[p.slice(0,3).map((o)=>$.jsxDEV(b1,{vendor:o},o,!1,void 0,this)),p.length>3?$.jsxDEV("span",{className:"more",children:["+",p.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"count",children:p.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),Y1(J==="changes"||J==="history",$.jsxDEV(B1,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",D(["changes"]),a.length?String(a.length):void 0),Y1(J==="events"&&!U||J==="trace",$.jsxDEV(B1,{name:"activity",size:16},void 0,!1,void 0,this),"Events","events",D(["events"])),$.jsxDEV("p",{className:"side-group",children:"Records"},void 0,!1,void 0,this),f.map((o)=>$.jsxDEV(i.default.Fragment,{children:Y1(J==="vendor"&&U===o,$.jsxDEV(b1,{vendor:o},void 0,!1,void 0,this),H1(o),`vendors/${o}`,D(["vendors",o]),s(o)?String(s(o)):void 0)},o,!1,void 0,this)),$.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),Y1(!1,$.jsxDEV(B1,{name:"cloud",size:16},void 0,!1,void 0,this),G1?"origin":"Name a remote…","remote",D(["remote"]),Q1?`↑${Q1}`:void 0)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-main",role:"main",children:[J==="changes"?$.jsxDEV("div",{className:"ws-status",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(x_,{name:_,view:"changes",changes:a.length,changesets:b.state==="ok"?b.data.changesets.length:0},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:"Not in a changeset"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:S.state==="ok"?`${k1(a.length,"record")} · ${k1(e,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:S,what:"the changes",lines:4},void 0,!1,void 0,this),$.jsxDEV(E_,{records:a,...d?{selected:d.key}:{},onPick:V,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:[S.state==="ok"&&!d?$.jsxDEV(h2,{title:"No changes on this branch",action:Q1>0&&G1?$.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(Z1)||v.busy!==null,onClick:()=>void v.push(),children:["Push ",k1(Q1,"changeset")," to origin"]},void 0,!0,void 0,this):void 0,children:$.jsxDEV("p",{children:["What your app writes to this World lands here, record by record, to cut into a changeset. Everything since ",S.data.base.at?$.jsxDEV(O1,{iso:S.data.base.at},void 0,!1,void 0,this):$.jsxDEV("code",{children:S.data.base.id},void 0,!1,void 0,this)," is in one already."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,d?$.jsxDEV(h_,{record:d,history:c.state==="ok"?c.data.entries:c.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(QF,{pinned:!0,generated:j.state==="ok"&&j.data.changesets.summary==="generated",author:{face:$.jsxDEV(B1,{name:Z.person?"user":Z.local?"monitor":"key-round",size:18},void 0,!1,void 0,this),who:Z.person??(Z.local?"This machine":Z.admin?"The host's admin":"A token"),account:`${X1}/${_}/~/settings/account`,branch:t},name:_,token:Q,changes:e,canWrite:B,refused:w,onCut:()=>{g((o)=>o+1),V(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,J==="history"?$.jsxDEV(kZ,{name:_,token:Q,sets:b,changes:a.length,withScreens:p,required:j.state==="ok"?j.data.changesets.approvals??1:1,...q?{sub:q}:{},signsAs:A,canWrite:B,rooted:u,refused:w,onChanged:()=>g((o)=>o+1)},void 0,!1,void 0,this):null,J==="events"?$.jsxDEV(yZ,{name:_,token:Q,vendors:f,...U&&f.includes(U)?{vendor:U}:{},tick:I},U??"",!1,void 0,this):null,J==="trace"?$.jsxDEV(vZ,{name:_,token:Q,id:U??""},void 0,!1,void 0,this):null,J==="vendor"&&U?$.jsxDEV(jZ,{name:_,token:Q,vendor:U,withScreens:p.includes(U),tick:I},U,!1,void 0,this):null,J==="screen"&&U?$.jsxDEV(VZ,{name:_,vendor:U,url:W.state==="ok"?y.get(U)??null:void 0,...W.state==="error"?{mapError:W.error}:{},holding:EZ(W.state==="ok"?W.data.twins.find((o)=>o.twin===U)?.resources??[]:[]),session:K,retry:L},U,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:G?.kind==="settings",onClose:()=>D(["changes"])(),title:"Settings",wide:"window",children:G?.kind==="settings"?$.jsxDEV("div",{className:"ws-settings",children:[$.jsxDEV("nav",{"aria-label":"Settings",children:D_.map(([o,z1,q1])=>$.jsxDEV("a",{href:`${X1}/${_}/~/settings/${o}`,className:G.tab===o?"on":void 0,"aria-current":G.tab===o?"page":void 0,onClick:D(["settings",o]),children:[$.jsxDEV(B1,{name:q1,size:16},void 0,!1,void 0,this),z1]},o,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-settings-pane",children:[N==="read"?$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"badge read-only",children:"Read only"},void 0,!1,void 0,this)," This session reads the World; it changes nothing."]},void 0,!0,void 0,this):null,G.tab==="account"?$.jsxDEV(bZ,{who:Z,scope:N,snapshot:F,portal:p1(),onSignOut:Y},void 0,!1,void 0,this):null,G.tab==="changesets"?$.jsxDEV(uZ,{name:_,token:Q,who:Z,scope:N},void 0,!1,void 0,this):null,G.tab==="remote"?$.jsxDEV($F,{name:_,token:Q,canWrite:B,tick:I,refused:w},void 0,!1,void 0,this):null,G.tab==="access"||G.tab==="services"||G.tab==="checks"||G.tab==="clock"?$.jsxDEV(UF,{name:_,token:Q,admin:C,canWrite:B,refused:w,onRemoved:P,only:G.tab},void 0,!1,void 0,this):null,G.tab==="vault"?$.jsxDEV(qF,{name:_,token:Q,canWrite:B,refused:w},void 0,!1,void 0,this):null,G.tab==="appearance"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV(fZ,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV(t1,{open:G?.kind==="branches",onClose:()=>D(["changes"])(),title:"Branches",wide:!0,children:G?.kind==="branches"?$.jsxDEV(gZ,{name:_,token:Q,canWrite:B,branches:O,opens:R,...G.open?{open:G.open}:{},onChanged:k,refused:w},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function p6({text:_}){return $.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>u1("Copied the prompt: paste it into your coding agent"),()=>u1("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var t6=(_)=>`${_.url.replace(/\/+$/,"")}/${_.namespace}`,hZ=(_)=>_.filter((Q)=>Q.applied===null||Q.applied.outcome==="refused"),EZ=(_,Q=4)=>{let J=[..._].filter((q)=>q.count>0).sort((q,U)=>U.count-q.count);return J.length?J.slice(0,Q).map((q)=>k1(q.count,q.type.replace(/^_+/,""))).join(" · ")+(J.length>Q?` · +${J.length-Q} more`:""):"nothing yet"},m_=$.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:$.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this);function xZ({name:_,token:Q,clock:J,canWrite:q,onChanged:U,refused:G,open:Z}){let[F,H]=i.useState(!1),[Y,X]=i.useState(""),[K,L]=i.useState(""),[z,W]=i.useState(null),[O,T]=i.useState(!1),B=J.state==="ok"?J.data:null,w=async(C,P,k)=>{T(!0),W(null);try{let N=await I1(Q,`/-/${_}/${P}`,{method:P==="clock"?"PUT":"POST",body:JSON.stringify(k)});if(!N.ok){G(N),W({ok:!1,text:await J0(N)});return}let v=await N.json();W({ok:!0,text:`${C} — the World is at ${new Date(v.at).toLocaleString()}`}),H(!1),U()}catch(N){W({ok:!1,text:`the World did not answer: ${N instanceof Error?N.message:String(N)}`})}finally{T(!1)}},A=(C)=>{C.preventDefault();let P=new Date(Y);if(Number.isNaN(P.getTime())){W({ok:!1,text:"Pick a date and time."});return}if(B&&P.getTime()<Date.parse(B.at)){W({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(B.at).toLocaleString()}.`});return}w("Clock set","clock",{at:P.toISOString()})},R=(C,P)=>{w(`Advanced ${P}`,"clock/advance",{by:C})},I=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return $.jsxDEV("div",{className:`clock${B?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[$.jsxDEV("p",{className:"clock-now",children:J.state==="loading"?$.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):J.state==="error"?$.jsxDEV("span",{className:"mode",children:["Clock: ",J.error]},void 0,!0,void 0,this):B.frozen?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",$.jsxDEV("strong",{children:$.jsxDEV(O1,{iso:B.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:["World time ",$.jsxDEV("strong",{children:$.jsxDEV(O1,{iso:B.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"· real time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&B?$.jsxDEV("details",{className:Z?"clock-more inline":"clock-more",open:Z||void 0,children:[$.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),$.jsxDEV("div",{className:Z?void 0:"popover",children:[$.jsxDEV("p",{className:"mode",children:"Move this World's clock forward to see what happens later: renewals, expiries, scheduled sends. Like a test clock, it only moves forward; to look back, the branch picker’s Manage branches… views an earlier moment."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"clock-controls",children:[$.jsxDEV("button",{type:"button","aria-expanded":F,onClick:()=>{H(!F),X(m2(B_(B.at))),W(null)},children:"Set time…"},void 0,!1,void 0,this),$.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[$.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),I.map(([C,P])=>$.jsxDEV("button",{type:"button","aria-label":`Advance ${P}`,disabled:O||!B.frozen,title:B.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>R(C,P),children:P},C,!1,void 0,this)),$.jsxDEV("form",{className:"inline",onSubmit:(C)=>{if(C.preventDefault(),!/^\d+[smhd]$/.test(K.trim())){W({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}R(K.trim(),`by ${K.trim()}`)},children:[$.jsxDEV("label",{className:"sr",children:["Advance by ",$.jsxDEV("input",{name:"advanceBy",value:K,onChange:(C)=>L(C.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!B.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:O||!B.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!B.frozen?$.jsxDEV("p",{className:"mode",children:"The World runs on real time. Set a time to start simulating; then advance it."},void 0,!1,void 0,this):null,F?$.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:A,noValidate:!0,children:[$.jsxDEV("label",{children:["World time ",$.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:Y,min:m2(B_(B.at)),onChange:(C)=>X(C.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",disabled:O,children:"Set time"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>H(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,z?$.jsxDEV("p",{role:z.ok?"status":"alert",children:z.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function mZ({name:_,token:Q,clock:J,refused:q}){let[U,G]=i.useState(!1),[Z,F]=i.useState(""),[H,Y]=i.useState(null),[X,K]=i.useState(!1),L=J.state==="ok"?J.data.at:new Date().toISOString(),z=i.useRef(null);return i.useEffect(()=>{if(!U)return;let O=(B)=>{if(B.key==="Escape"&&!document.querySelector("dialog[open]"))G(!1),z.current?.querySelector("button")?.focus()},T=(B)=>{if(!z.current?.contains(B.target))G(!1)};return document.addEventListener("keydown",O),document.addEventListener("click",T),()=>{document.removeEventListener("keydown",O),document.removeEventListener("click",T)}},[U]),$.jsxDEV("div",{className:"as-of",ref:z,children:[$.jsxDEV("button",{type:"button","aria-expanded":U,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{G(!U),F(m2(L)),Y(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),U?$.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(O)=>{O.preventDefault(),Y(null);let T=new Date(Z);if(Number.isNaN(T.getTime())){Y("Pick a date and time.");return}if(T.getTime()>Date.parse(L)){Y(`That is after the World's present (${new Date(L).toLocaleString()}); a snapshot looks back.`);return}K(!0);try{let B=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:T.toISOString()},ttl:3600})});if(!B.ok){q(B),Y(await J0(B));return}let w=await B.json();i6({name:w.name,parent:_,token:w.token,readToken:w.readToken,at:T.toISOString(),expiresAt:w.expiresAt??null,parentOrigin:T1,made:!0});let A=N5(w.origin)?.origin;if(A&&A!==T1){s6(A,w.readToken,w.name,`${X1}/${w.name}`);return}R1(w.name.split("/"))}catch(B){Y(`the World did not answer: ${B instanceof Error?B.message:String(B)}`)}finally{K(!1)}},noValidate:!0,children:[$.jsxDEV("label",{children:["As of ",$.jsxDEV("input",{name:"asOf",type:"datetime-local",value:Z,max:m2(L),onChange:(O)=>F(O.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:X,children:X?"Opening…":"Open snapshot"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Opens a read-only copy of this World as it was then; the copy goes away within the hour."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H?$.jsxDEV("p",{role:"alert",children:H},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function g_({name:_,token:Q,open:J,onClose:q,onMade:U,refused:G}){let Z=(P)=>P.split("/").pop()??P,[F,H]=i.useState(!1),[Y,X]=i.useState(null),[K,L]=i.useState(""),[z,W]=i.useState("now"),[O,T]=i.useState(""),[B,w]=i.useState("24"),[A,R]=i.useState(!0);i.useEffect(()=>{if(J)X(null),T(m2(new Date().toISOString()))},[J]);let I=async(P)=>{P.preventDefault(),X(null);let k=z==="at"?new Date(O):null;if(k&&Number.isNaN(k.getTime())){X("Pick a date and time, or make it as of now.");return}if(k&&k.getTime()>Date.now()){X("A branch is made as of now or a moment before it.");return}H(!0);let N=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({ttl:Math.round(Number(B)*3600),...k?{at:{instant:k.toISOString()}}:A?{live:!0}:{},...K.trim()?{label:K.trim()}:{}})}).catch(()=>null);if(H(!1),!N){X(`${T1} did not answer`);return}if(!N.ok){G(N),X(await J0(N));return}let v=await N.json();i6({name:v.name,parent:_,token:v.token??"",readToken:v.readToken,at:(k??new Date).toISOString(),expiresAt:v.expiresAt??null,parentOrigin:T1,...v.origin?{origin:v.origin}:{}}),q(),L(""),u1(`Made ${Z(v.name)}`),U()};return $.jsxDEV(t1,{open:J,onClose:()=>{if(!F)q()},title:`New branch of ${Z(_)}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>q(),disabled:F,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"new-branch",className:"primary",disabled:F,children:F?"Making…":"Make branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"new-branch",onSubmit:(P)=>void I(P),className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Label ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"branchLabel",value:K,onChange:(P)=>L(P.target.value.toLowerCase()),placeholder:"checkout-flow",pattern:"[a-z0-9][a-z0-9\\-]{0,23}",maxLength:24},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("fieldset",{className:"choice",children:[$.jsxDEV("legend",{children:"From"},void 0,!1,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="now",onChange:()=>W("now")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Now: the World as it is"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="now"?$.jsxDEV("label",{className:"check sub",children:[$.jsxDEV("input",{type:"checkbox",name:"branchLive",checked:A,onChange:(P)=>R(P.target.checked)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Live: its clock keeps this World's time, as a pull request's preview does (else it stops now)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="at",onChange:()=>W("at")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"An instant before now: the World as it was then, its clock stopped there"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="at"?$.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:O,max:m2(new Date().toISOString()),onChange:(P)=>T(P.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"branchLife",value:B,onChange:(P)=>w(P.target.value),children:[$.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"168",children:"7 days"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"alert",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function gZ({name:_,token:Q,canWrite:J,branches:q,opens:U,open:G,onChanged:Z,refused:F,snapshotOf:H}){let Y=w1(Q,`/-/${_}/clock`),X=(w)=>w.split("/").pop()??w,[K,L]=i.useState(!1),z=(w)=>(A)=>{A.preventDefault(),R1([..._.split("/"),"~","branches",...w?w.split("/"):[]])};if(!q)return $.jsxDEV("p",{className:"mode",children:"This host makes no branches of a World."},void 0,!1,void 0,this);let W=q.state==="ok"?q.data.branches:[],O=q.state==="ok"&&(q.data.named?.length??0)>0?q.data.named:[{name:X(_),running:!0}],T=q.state==="ok"?q.data.checkedOut??X(_):X(_),B=async(w)=>{if(!await B0({title:`Remove the branch ${X(w)}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Remove branch",danger:!0}))return;let A=await I1(Q,`/-/${_}/branches/${w}`,{method:"DELETE"}).catch((R)=>R);if(A instanceof Error){u1(`Remove ${X(w)}: the World did not answer (${A.message})`,"error");return}if(!A.ok){F(A),u1(`Remove ${X(w)}: ${await J0(A)}`,"error");return}I4(w),u1(`Removed ${X(w)}`),Z(),R1([..._.split("/"),"~","branches"])};if(G){let w=G.includes("/")?W.find((R)=>R.name===G):void 0,A=G.includes("/")?void 0:O.find((R)=>R.name===G);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${X1}/${_}/~/branches`,onClick:z(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(g1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"&&!w&&!A?$.jsxDEV("p",{className:"mode",children:["This World has no branch named ",G,"."]},void 0,!0,void 0,this):null,w?$.jsxDEV(pZ,{name:_,b:w,canWrite:J,opens:U(w.name),remove:()=>void B(w.name)},void 0,!1,void 0,this):null,A&&!w?$.jsxDEV(cZ,{name:_,token:Q,b:A,served:A.name===T,canWrite:J,canServe:q.state==="ok"&&Boolean(q.data.canServe)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}return $.jsxDEV("div",{"aria-labelledby":"branches",children:[$.jsxDEV("div",{className:"branches-head",children:[$.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",$.jsxDEV("b",{children:T},void 0,!1,void 0,this),". Each branch's name opens its page."]},void 0,!0,void 0,this),J?$.jsxDEV("div",{className:"head-actions",children:[H?null:$.jsxDEV(mZ,{name:_,token:Q,clock:Y,refused:F},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>L(!0),children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:[O.map((w)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:[$.jsxDEV("a",{href:`${X1}/${_}/~/branches/${w.name}`,onClick:z(w.name),children:$.jsxDEV("b",{children:w.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.name===T?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):w.running?null:$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge",children:"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this)]},`own:${w.name}`,!0,void 0,this)),W.map((w)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("a",{href:`${X1}/${_}/~/branches/${w.name}`,onClick:z(w.name),children:$.jsxDEV("b",{children:X(w.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:X(w.from??_)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w.at?.instant?$.jsxDEV(O1,{iso:w.at.instant},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV(O1,{iso:w.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w.expiresAt?$.jsxDEV(O1,{iso:w.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},w.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV(g_,{name:_,token:Q,open:K,onClose:()=>L(!1),onMade:Z,refused:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function pZ({name:_,b:Q,canWrite:J,opens:q,remove:U}){let G=(H)=>H.split("/").pop()??H,Z=d6(Q.name),F=w1(Z,Z?`/-/${Q.name}/diff`:null);return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[m_," ",G(Q.name)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>u_(Q.name,Q.name.split("/")),children:"Open"},void 0,!1,void 0,this):null,J?$.jsxDEV("button",{type:"button",className:"danger-button",onClick:U,children:"Remove…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:Q.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:G(Q.from??_)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.at?.instant?$.jsxDEV(O1,{iso:Q.at.instant},void 0,!1,void 0,this):"live: it keeps its parent's time"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(O1,{iso:Q.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Goes away"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.expiresAt?$.jsxDEV(O1,{iso:Q.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),!q?$.jsxDEV("p",{className:"mode",children:"Its tokens were handed to whoever made it: it opens, and shows its own changes, in their tab."},void 0,!1,void 0,this):null,F.state==="ok"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Its changes"},void 0,!1,void 0,this),F.data.changes.length===0?$.jsxDEV("p",{className:"mode",children:"Nothing written on it since it branched."},void 0,!1,void 0,this):$.jsxDEV(_F,{changes:F.data.changes,idPrefix:`branch-${G(Q.name)}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function cZ({name:_,token:Q,b:J,served:q,canWrite:U,canServe:G}){let[Z,F]=i.useState(!1),[H,Y]=i.useState(null),X=async()=>{F(!0),Y(null);let K=await I1(Q,`/-/${_}/branches/${encodeURIComponent(J.name)}/serve`,{method:"POST"}).catch(()=>null);if(K?.ok){location.reload();return}F(!1),Y(K?await J0(K):`${T1} did not answer`)};return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[m_," ",J.name," ",q?$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:U&&G&&!q?$.jsxDEV("button",{type:"button",className:"primary",disabled:Z,onClick:()=>void X(),children:Z?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:J.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Kind"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:"one of this World's own branches"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"State"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:J.running?"running":"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("p",{className:"mode",children:["This is the branch these pages show: its changes are on ",$.jsxDEV("a",{href:`${X1}/${_}/~/changes`,onClick:(K)=>{K.preventDefault(),R1([..._.split("/"),"~","changes"])},children:"Changes"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):G?$.jsxDEV("p",{className:"mode",children:["“Serve here” stops this one's twins and serves ",J.name," in its place."]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode",children:"This host serves one of the World's own branches at a time, and does not switch them from this page."},void 0,!1,void 0,this),H?$.jsxDEV("p",{role:"alert",children:H},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var O_=50,x2=(_)=>`${_.twin}:${_.position}`,p_=(_,Q)=>Date.parse(Q.entry.occurredAt)-Date.parse(_.entry.occurredAt)||_.twin.localeCompare(Q.twin)||Q.position-_.position,w4=(_)=>{if(!_)return"someone";if(_.startsWith("key:")){let[Q,J]=_.slice(4).split(" for:");return J?`${Q}, for ${J}`:Q||"a key"}if(_.startsWith("person:"))return _.slice(7);return _==="machine"?"this machine":_==="person"?"a session with no name":_==="token:read"?"the read-only token":_==="token"?"the World's token":_},w5=(_,Q)=>{let J=typeof Q==="string"?Q:typeof _.caller==="string"?_.caller:"";if(J.startsWith("key:")&&J.length>4)return`by ${w4(J)}`;if(J.startsWith("person:")&&J.length>7)return`by ${J.slice(7)}`;if(J==="machine")return"by this machine";if(J==="person")return"by a session with no name";if(J==="key")return"by a key";if(J==="token:read")return"by the read-only token";if(J==="token")return"by the World's token";return _.actor?.kind==="system"?"by the vendor":_.actor?.id?`by ${_.actor.id}`:"by an app"},c_=(_)=>_.operation??_.op;function lZ(_){let Q=_.fields??{},J=Q.usage!==null&&typeof Q.usage==="object"?Q.usage:Q,q=(...Y)=>Y.map((X)=>J[X]??Q[X]).find((X)=>typeof X==="number"),U=[],G=q("prompt_tokens","input_tokens"),Z=q("completion_tokens","output_tokens"),F=q("total_tokens");if(G!==void 0)U.push(["tokens in",G.toLocaleString()]);if(Z!==void 0)U.push(["tokens out",Z.toLocaleString()]);if(F!==void 0)U.push(["tokens in all",F.toLocaleString()]);let H=q("cost_usd","cost");if(H!==void 0)U.push(["cost",`$${H<0.01?H.toPrecision(2):H.toFixed(2)}`]);return U}function l_({text:_,at:Q=280}){if(_.length<=Q)return $.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this);return $.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:[$.jsxDEV("span",{className:"text",children:[_.slice(0,Q),"…"]},void 0,!0,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:["show all ",_.length.toLocaleString()," characters"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function S0({v:_}){if(typeof _==="string")return $.jsxDEV(l_,{text:_},void 0,!1,void 0,this);if(_===null||typeof _!=="object")return $.jsxDEV("code",{children:String(_)},void 0,!1,void 0,this);let Q=JSON.stringify(_,null,2);return Q.length<=160?$.jsxDEV("code",{children:JSON.stringify(_)},void 0,!1,void 0,this):$.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:$.jsxDEV("code",{children:[JSON.stringify(_).slice(0,120),"…"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("pre",{children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var rZ=(_)=>typeof _==="string"?_:Array.isArray(_)?_.map((Q)=>Q&&typeof Q==="object"&&typeof Q.text==="string"?Q.text:"").filter(Boolean).join(`
|
|
36
|
-
`):JSON.stringify(_??"");function iZ({body:_}){if(_===null||typeof _!=="object"||Array.isArray(_))return $.jsxDEV(S0,{v:_},void 0,!1,void 0,this);let Q=_,J=Array.isArray(Q.messages)?Q.messages:null,q=Object.entries(Q).filter(([U])=>!(J&&U==="messages"));return $.jsxDEV($.Fragment,{children:[q.length?$.jsxDEV("dl",{className:"fields",children:q.map(([U,G])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:U},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(S0,{v:G},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},U,!0,void 0,this))},void 0,!1,void 0,this):null,J?$.jsxDEV("ol",{className:"messages",children:J.map((U,G)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:"role",children:typeof U.role==="string"?U.role:"message"},void 0,!1,void 0,this),$.jsxDEV(l_,{text:rZ(U.content)},void 0,!1,void 0,this)]},G,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function r_({fields:_}){let Q=Object.entries(_??{});if(Q.length===0)return $.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return $.jsxDEV("dl",{className:"fields",children:Q.map(([J,q])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:J},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(S0,{v:q},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},J,!0,void 0,this))},void 0,!1,void 0,this)}var dZ=(_)=>_.receipt?`${_.receipt.status??""}${_.receipt.externalId?` · ${_.receipt.externalId}`:""}${_.receipt.reason?` · ${_.receipt.reason}`:""}`:_.operation==="observed"?"observed from the vendor":_.provenance==="placeholder"?"default data":"none: it has not left this World";function aZ(_){let Q=new Map,J=[],q=[],U=new Map;for(let G of _){if(G.entry.landsId||G.entry.aliasOf){q.push(G);continue}let Z={...G,copies:[]};if(J.push(Z),!Q.has(`${G.twin}:${G.entry.id}`))Q.set(`${G.twin}:${G.entry.id}`,Z);if(!U.has(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`))U.set(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`,Z)}for(let G of q){let Z=G.entry.landsId?Q.get(`${G.twin}:${G.entry.landsId}`):G.entry.aliasOf?U.get(`${G.twin}:${G.entry.subject.type}:${G.entry.aliasOf}`):void 0;if(Z)Z.copies.push(G);else J.push({...G,copies:[]})}return J.sort(p_)}var c6={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function f_(_){let Q=[_.entry.receipt,..._.copies.map((U)=>U.entry.receipt)].filter((U)=>Boolean(U?.status));if(Q.length===0)return null;let J=Q.find((U)=>U.status==="failed"||U.status==="refused"),q=[...Q].sort((U,G)=>(c6[G.status]??0)-(c6[U.status]??0))[0];return J&&!(c6[q.status]>=5)?{status:J.status,bad:!0}:{status:q.status,bad:!1}}var P4=1280,N4=820,I_=160;function sZ({data:_}){let{world:Q,vendor:J,url:q,active:U,open:G,changed:Z}=_;return $.jsxDEV($.Fragment,{children:[$.jsxDEV(G_,{isVisible:!0,position:J1.Top,align:"start",className:"frame-label",children:[$.jsxDEV(b1,{vendor:J},void 0,!1,void 0,this),$.jsxDEV("span",{children:H1(J)},void 0,!1,void 0,this),Z?$.jsxDEV("a",{className:"frame-changed nodrag",href:`${X1}/${Q}/~/changes`,onClick:(F)=>{F.preventDefault(),R1([...Q.split("/"),"~","changes"])},title:`${k1(Z,"record")} changed here, not in a changeset: see them in Changes`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),Z]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame on":"frame",style:{width:P4,height:N4},children:[$.jsxDEV("div",{className:"frame-bar",title:"Drag to move",children:[$.jsxDEV(b1,{vendor:J},void 0,!1,void 0,this),$.jsxDEV("strong",{children:H1(J)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"frame-url",children:q.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),$.jsxDEV("a",{className:"nodrag",href:`${X1}/${Q}/~/screens/${J}`,onClick:(F)=>{F.preventDefault(),G(J)},children:"Open"},void 0,!1,void 0,this),$.jsxDEV("a",{className:"nodrag",href:q,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${H1(J)} in a new tab`,children:"↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame-body nodrag nopan nowheel":"frame-body",children:$.jsxDEV("iframe",{title:`${J} screens`,src:q,loading:"lazy",style:{pointerEvents:U?"auto":"none"}},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var tZ={screen:sZ};function oZ(_){return $.jsxDEV(b6,{children:$.jsxDEV(nZ,{..._},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function nZ({name:_,token:Q,twins:J,session:q,retry:U,snapshot:G,back:Z}){let F=w1(Q,`/-/${_}/diff`),H=i.useMemo(()=>{let g={};if(F.state==="ok")for(let h of F.data.changes)(g[h.twin]??=new Set).add(`${h.entry.subject.type}:${h.entry.subject.id}`);return Object.fromEntries(Object.entries(g).map(([h,S])=>[h,S.size]))},[F]),Y=(g)=>H[g]??0,X=new Map((J.state==="ok"?J.data.twins:[]).flatMap((g)=>{let h=b_(_,g);return h?[[g.twin,h]]:[]})),K=[...X.keys()],L=`volter.canvas.${_}`,[z,W]=i.useState(null),[O,T]=i.useState(!0),B=R5(),w=i.useCallback((g)=>R1([..._.split("/"),"~","screens",g]),[_]),A=Math.max(1,Math.ceil(Math.sqrt(K.length))),R=i.useCallback(()=>{let g={};try{g=JSON.parse(localStorage.getItem(L)??"{}")}catch{}return K.map((h,S)=>({id:h,type:"screen",dragHandle:".frame-bar",position:g[h]??{x:S%A*(P4+I_),y:Math.floor(S/A)*(N4+I_)},data:{world:_,vendor:h,url:X.get(h),active:!1,open:w,changed:H[h]??0}}))},[K.join(","),_,A,w,H]),[I,C,P]=e9([]);i.useEffect(()=>{C(R())},[R,C]),i.useEffect(()=>{C((g)=>g.map((h)=>h.data.active===(h.id===z)?h:{...h,data:{...h.data,active:h.id===z}}))},[z,C]),i.useEffect(()=>{let g=(h)=>{if(h.key==="Escape")W(null)};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[]);let k=()=>{try{localStorage.setItem(L,JSON.stringify(Object.fromEntries(I.map((g)=>[g.id,g.position]))))}catch{}},N=(g)=>{W(g);let h=B.getNode(g);if(!h)return;let S=Math.min((window.innerWidth-300)/P4,(window.innerHeight-120)/N4,1);B.setCenter(h.position.x+P4/2-130/S,h.position.y+N4/2,{zoom:S,duration:400})},v=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,E=q.state==="ok"&&J.state==="ok";return $.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"Every vendor's screens",children:$.jsxDEV(n9,{nodes:E?I:[],onNodesChange:P,nodeTypes:tZ,onNodeDragStop:k,onNodeClick:(g,h)=>W(h.id),onPaneClick:()=>W(null),fitView:!0,fitViewOptions:{padding:{top:"64px",left:"272px",right:"32px",bottom:"32px"}},minZoom:0.05,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!1,zoomOnDoubleClick:!1,colorMode:v?"dark":"light",proOptions:{hideAttribution:!0},children:[$.jsxDEV(Q_,{variant:A0.Dots,gap:28,size:1.4},void 0,!1,void 0,this),$.jsxDEV(K2,{position:"top-left",className:"float layers",children:[$.jsxDEV("div",{className:"float-head",children:[$.jsxDEV("button",{type:"button",className:"back",onClick:Z,"aria-label":`Back to ${_}`,children:"←"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"float-title",children:[$.jsxDEV("strong",{children:_.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[_.split("/")[0],G?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ghost","aria-expanded":O,"aria-label":O?"Hide the screens list":"Show the screens list",onClick:()=>T(!O),children:O?"▾":"▸"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O?$.jsxDEV("ul",{className:"layer-list","aria-label":"Screens",children:K.map((g)=>$.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:z===g?"on":void 0,onClick:()=>N(g),children:[$.jsxDEV(b1,{vendor:g},void 0,!1,void 0,this),$.jsxDEV("span",{children:H1(g)},void 0,!1,void 0,this),Y(g)?$.jsxDEV("span",{className:"layer-changed",title:`${k1(Y(g),"record")} changed, not in a changeset`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),Y(g)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},g,!1,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV(g1,{load:J,what:"the vendors"},void 0,!1,void 0,this),q.state==="pending"?$.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,q.state==="error"?$.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",q.error," ",$.jsxDEV("button",{type:"button",onClick:U,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(K2,{position:"top-center",className:"float hint mode",children:z?`Using ${H1(z)} · Esc to leave`:"Drag to pan · scroll to zoom · click a screen to use it"},void 0,!1,void 0,this),$.jsxDEV($_,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),$.jsxDEV(U_,{pannable:!0,zoomable:!0,nodeBorderRadius:8,position:"bottom-right"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var i_=(_)=>_.actions.map((Q)=>({twin:Q.service,entry:{...Q.action,service:Q.service,op:Q.action.op??Q.action.operation??""}})),eZ=(_)=>{let Q=_.action.input??{};return!(typeof Q.operationId==="string"||Q.graphql!==void 0&&Q.graphql!==null)};function k4(_){let Q=_.actions.filter(eZ).length,J=_.actions.length-Q,q=_.applied?.receipts??[],U=_.deployed??[],G=new Set([...U.filter((H)=>H.status==="deployed"),...q.filter((H)=>H.status==="confirmed")].map((H)=>H.actionId)).size,Z=new Set([...U.filter((H)=>H.status==="refused"||H.status==="failed"),...q.filter((H)=>H.status==="failed")].map((H)=>H.actionId)).size,F={performed:G,failed:Z,total:J,own:Q};if(J>0&&G>=J)return{label:"Deployed",tone:"done",...F};if(G>0)return{label:`Partly deployed: ${G} of ${J}`,tone:"warn",...F};if(Z>0)return{label:`${Z} refused or failed`,tone:"bad",...F};if(q.some((H)=>H.status==="replayed")&&q.every((H)=>H.status==="replayed"||H.status==="skipped"))return{label:"Pushed",tone:"good",...F};return{label:"Not sent",tone:"plain",...F}}var l6=(_)=>_.message??_.narration?.split(`
|
|
37
|
-
`)[0]?.replace(/ setting .*$/,"")??_.name;function d_(_,Q=1){let J=_.currentHash??_.contentHash,q=_.readiness?.approvers??new Set(_.approvals.filter((G)=>G.contentHash===J).map((G)=>G.principal)).size,U=_.verification&&_.verification.contentHash===J?_.verification:null;if(U&&!U.passed)return{label:"Checks failed",tone:"bad"};if(q>0&&q<Q)return{label:`Approved by ${q} of ${Q}`,tone:"plain"};if(q>0)return{label:`Approved by ${q}`,tone:"good"};if(U)return{label:"Verified",tone:"good"};return{label:"Not verified",tone:"plain"}}function w_({name:_,token:Q,signsAs:J,c:q,canWrite:U,rooted:G,refused:Z,onChanged:F,part:H,required:Y}){let X=H==="head",K=H==="review",[L,z]=i.useState(null),[W,O]=i.useState(!1),[T,B]=i.useState(""),[w,A]=i.useState(""),[R,I]=i.useState(null),C=w1(Q,`/-/${_}/origin`),P=k4(q),k=d_(q,Y),N=i_(q),v=[...new Set(N.map((u)=>u.twin))],E=v.some((u)=>G.includes(u)),g=(u)=>u===(q.currentHash??q.contentHash),h=q.applied?.receipts??[],S=(q.deployed??[]).filter((u)=>u.status!=="landed"),b=h.filter((u)=>u.status==="confirmed").length,j=S.filter((u)=>u.status==="deployed"),x=async(u,s,t,a)=>{z(u),I(null);try{let d=await I1(Q,s,{method:"POST",...t===void 0?{}:{body:JSON.stringify(t)}});if(!d.ok)return Z(d),I({what:u,...v1(await P0(d))}),!1;if(a)u1(a);return F(),!0}catch(d){return I({what:u,text:`the World did not answer (${d instanceof Error?d.message:String(d)})`,acts:[]}),!1}finally{z(null)}},V=()=>{x("Verify",`/-/${_}/changesets/${q.name}/verify`,void 0,"Verified: the checks ran over it")},D=async(u)=>{if(u.preventDefault(),await x("Approve",`/-/${_}/changesets/${q.name}/approve`,{...T.trim()?{note:T.trim()}:{},...J===null&&w.trim()?{as:w.trim()}:{}},"Approved"))O(!1),B("")},f=async()=>{let u=v.filter((s)=>G.includes(s));if(!await B0({title:`Deploy ${q.name} to the real vendors?`,body:$.jsxDEV($.Fragment,{children:["It performs its ",q.actions.length," change",q.actions.length===1?"":"s"," against the real account",u.length===1?"":"s"," behind ",X2(u.map(H1)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:q.name}))return;z("Deploy"),I(null);try{let s=await I1(Q,`/-/${_}/deploy/${q.name}`,{method:"POST",body:JSON.stringify({confirm:q.name})});if(!s.ok){Z(s),I({what:"Deploy",...v1(await P0(s))});return}let t=await I1(Q,`/-/${_}/changesets/${q.name}`),a=t.ok?await t.json():null;if(!a){u1("Deploy: sent; reading its receipts failed","info"),F();return}let d=k4(a);u1(`Deploy: ${d.performed} of ${d.total} change${d.total===1?"":"s"} performed at the vendor${d.failed?`; ${d.failed} refused or failed`:""}`,d.failed?"error":d.performed?"ok":"info"),F()}catch(s){I({what:"Deploy",text:`the World did not answer (${s instanceof Error?s.message:String(s)})`,acts:[]})}finally{z(null)}},y=!U?"This session reads the World; it changes nothing":P.label==="Deployed"?"Already deployed: every change was performed at the vendor":null,p=C.state==="ok"&&C.data.origin?t6(C.data.origin):null;return $.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[X?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"changeset-title",children:[q.message??q.name," ",$.jsxDEV("span",{className:`badge cs-${P.tone}`,children:P.label},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:`badge cs-${k.tone}`,children:k.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:q.name},void 0,!1,void 0,this)," · made ",$.jsxDEV(O1,{iso:q.createdAt},void 0,!1,void 0,this)," · ",q.actions.length," change",q.actions.length===1?"":"s"," at ",X2(v.map(H1))||"no vendor"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[$.jsxDEV("button",{type:"button",onClick:V,disabled:Boolean(y)||L!==null,title:y??"Replay it in a throwaway World and run the World's checks",children:L==="Verify"?"Verifying…":"Verify"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>O(!0),disabled:Boolean(y)||L!==null,title:y??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),E?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void f(),disabled:Boolean(y)||L!==null,title:y??"Perform it against the real accounts behind this World",children:L==="Deploy"?"Deploying…":"Deploy…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),y&&P.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:[y,"."]},void 0,!0,void 0,this):null,R?$.jsxDEV("div",{role:"alert",className:"refusal",children:[$.jsxDEV("span",{children:[$.jsxDEV("b",{children:R.what},void 0,!1,void 0,this),": ",R.text]},void 0,!0,void 0,this),R.acts.includes("verify")&&U?$.jsxDEV("button",{type:"button",onClick:V,disabled:L!==null,children:"Verify"},void 0,!1,void 0,this):null,R.acts.includes("approve")&&U?$.jsxDEV("button",{type:"button",onClick:()=>O(!0),disabled:L!==null,children:"Approve…"},void 0,!1,void 0,this):null,$.jsxDEV(k_,{name:_,acts:R.acts},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):null,K?$.jsxDEV($.Fragment,{children:[q.narration?$.jsxDEV("p",{className:"narration",children:q.narration},void 0,!1,void 0,this):null,$.jsxDEV("h4",{children:"Where it went"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"block where",children:[P.performed>0?$.jsxDEV("p",{className:"pad",children:[P.performed>=P.total?"Deployed":"Partly deployed",": ",P.performed," of ",P.total," change",P.total===1?"":"s",P.own?` (and ${P.own} of the World's own, which stay in it)`:""," performed at ",X2([...new Set([...j.map((u)=>u.service),...h.filter((u)=>u.status==="confirmed").map((u)=>u.service)].map(H1))]),j.length?` (${j.length} from here`:" (",j.length&&b?", ":"",b?`${b} by the remote`:"",")."]},void 0,!0,void 0,this):P.label==="Pushed"?$.jsxDEV("p",{className:"pad",children:["Pushed to the remote",p?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:p},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,q.applied?$.jsxDEV($.Fragment,{children:[" · ",$.jsxDEV(O1,{iso:q.applied.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,": every change was replayed there. No vendor has performed any of it."]},void 0,!0,void 0,this):P.failed===0?$.jsxDEV("p",{className:"pad",children:["Not sent: it is only in this World.",q.applied?.outcome==="refused"?" A push was refused (below); Push sends it again.":$.jsxDEV($.Fragment,{children:[" Push sends it to the remote World",E?"; Deploy, to the real vendors behind it":"","."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,P.failed>0?$.jsxDEV("p",{className:"pad failed",role:"alert",children:[P.failed," change",P.failed===1?" was":"s were"," refused or failed at the vendor",[...S.filter((u)=>u.reason&&(u.status==="refused"||u.status==="failed")).map((u)=>u.reason),...h.filter((u)=>u.status==="failed"&&u.error).map((u)=>u.error)].slice(0,3).map((u)=>`: ${v1(u).text}`).join(""),"."]},void 0,!0,void 0,this):null,q.applied?.refusal?.length?$.jsxDEV("ul",{className:"checks pad",children:q.applied.refusal.map((u,s)=>$.jsxDEV("li",{className:"mode",children:v1(u).text},s,!1,void 0,this))},void 0,!1,void 0,this):null,S.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the vendor"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:S.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="refused"||u.status==="failed"?"badge cs-bad":u.status==="deployed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",H1(u.service)," ",u.status==="deployed"?u.url?$.jsxDEV("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",children:u.externalId??u.url},void 0,!1,void 0,this):u.externalId?$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this):null:null,u.reason?$.jsxDEV("span",{className:"mode",children:[" · ",v1(u.reason).text]},void 0,!0,void 0,this):null," ",$.jsxDEV("span",{className:"mode",children:["· ",$.jsxDEV(O1,{iso:u.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},`v:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,h.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the remote"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:h.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="failed"?"badge cs-bad":u.status==="confirmed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",H1(u.service)," ",$.jsxDEV("span",{className:"mode",children:u.status==="replayed"?"replayed at the remote World":u.status==="confirmed"?"performed at the vendor by the remote":""},void 0,!1,void 0,this),u.status==="confirmed"&&u.externalId?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,u.error?$.jsxDEV("span",{className:"mode",children:[" · ",v1(u.error).text]},void 0,!0,void 0,this):null]},`r:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),!E&&P.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:["No vendor it changes is connected to its real service here, so it does not deploy from this World. ",$.jsxDEV("a",{href:`${X1}/${_}/~/settings/services`,onClick:(u)=>{u.preventDefault(),R1([..._.split("/"),"~","settings","services"])},children:"Connect a vendor in Settings › Real services"},void 0,!1,void 0,this)," to deploy."]},void 0,!0,void 0,this):null,$.jsxDEV("h4",{children:"Checks"},void 0,!1,void 0,this),!q.verification?$.jsxDEV("p",{className:"mode",children:"Not verified yet. Verify replays it in a throwaway World and runs this World's checks over the result."},void 0,!1,void 0,this):$.jsxDEV("div",{className:g(q.verification.contentHash)?"":"stale",children:[$.jsxDEV("p",{children:[q.verification.passed?"✓ Passed":"✗ Failed"," · ",$.jsxDEV(O1,{iso:q.verification.at},void 0,!1,void 0,this),g(q.verification.contentHash)?null:$.jsxDEV("span",{className:"mode",children:" · on an earlier version of it: verify again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.verification.results.length?$.jsxDEV("ul",{className:"checks",children:q.verification.results.map((u)=>$.jsxDEV("li",{children:[u.passed?"✓":"✗"," ",$.jsxDEV("code",{children:u.id},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:H1(u.service)},void 0,!1,void 0,this)]},u.id,!0,void 0,this))},void 0,!1,void 0,this):null,q.verification.refusals?.length?$.jsxDEV("ul",{className:"checks",children:q.verification.refusals.map((u,s)=>$.jsxDEV("li",{children:["✗ ",$.jsxDEV("code",{children:u.check},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[H1(u.service),": ",u.reason]},void 0,!0,void 0,this)]},s,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("h4",{children:"Approvals"},void 0,!1,void 0,this),q.approvals.length===0?$.jsxDEV("p",{className:"mode",children:"No one has approved it."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"approvals",children:q.approvals.map((u,s)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:u.principal},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(O1,{iso:u.at},void 0,!1,void 0,this),g(u.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),u.note?$.jsxDEV("div",{className:"mode",children:["“",u.note,"”"]},void 0,!0,void 0,this):null]},s,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(t1,{open:W,onClose:()=>{if(!L)O(!1)},title:`Approve ${q.name}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>O(!1),disabled:L!==null,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"approve-changeset",className:"primary",disabled:L!==null,children:L==="Approve"?"Approving…":"Approve"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"approve-changeset",onSubmit:(u)=>void D(u),className:"stack",children:[$.jsxDEV("p",{className:"mode",children:["You sign its contents as they stand now",J?$.jsxDEV($.Fragment,{children:[", recorded as ",$.jsxDEV("b",{children:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,". A later change to it shows your approval as for an earlier version."]},void 0,!0,void 0,this),J===null?$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Approving as"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"approveAs",value:w,onChange:(u)=>A(u.target.value),maxLength:80,required:!0,placeholder:"your name or email",autoComplete:"off"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"This World was opened with its token, which names no person: the approval records the name you give."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Note ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("textarea",{name:"approveNote",value:T,onChange:(u)=>B(u.target.value),rows:3,maxLength:500},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var a_=(_,Q)=>JSON.stringify(_)===JSON.stringify(Q);function _F({changes:_,idPrefix:Q}){let J=[...new Set(_.map((q)=>q.twin))];return $.jsxDEV($.Fragment,{children:J.map((q)=>{let U=_.filter((Z)=>Z.twin===q).map((Z)=>Z.entry),G=[...new Set(U.map((Z)=>`${Z.subject.type}:${Z.subject.id}`))];return $.jsxDEV("div",{className:"compare",role:"group","aria-labelledby":`${Q}-${q}`,children:[$.jsxDEV("h3",{id:`${Q}-${q}`,className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:q},void 0,!1,void 0,this),H1(q)," ",$.jsxDEV("span",{className:"mode",children:["· ",k1(G.length,"record"),", ",k1(U.length,"write")]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:G.map((Z)=>{let F=U.filter((K)=>`${K.subject.type}:${K.subject.id}`===Z),H=F[F.length-1],Y=Z0(H),X={};return $.jsxDEV("li",{className:"record",children:[$.jsxDEV("p",{className:"record-head",children:[$.jsxDEV("span",{className:"kind",children:H.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")},void 0,!1,void 0,this)," ",Y.label?$.jsxDEV("span",{className:"label",children:["“",Y.label,"”"]},void 0,!0,void 0,this):null," ",$.jsxDEV("code",{children:c0(H)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.map((K)=>{let L=K.fields??{},z=Object.entries(L).filter(([O,T])=>!(O in X)||!a_(X[O],T)),W=X;return X={...X,...L},$.jsxDEV("div",{className:"write",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"op",children:Z0(K).what},void 0,!1,void 0,this)," · ",$.jsxDEV(O1,{iso:K.occurredAt},void 0,!1,void 0,this)," · ",w5(K)]},void 0,!0,void 0,this),z.length===0?$.jsxDEV("p",{className:"mode",children:"It set no field to a new value."},void 0,!1,void 0,this):$.jsxDEV("dl",{className:"fields field-diff","aria-label":`Fields ${Z0(K).what} set`,children:z.map(([O,T])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:O},void 0,!1,void 0,this),$.jsxDEV("dd",{children:O in W?$.jsxDEV("span",{className:"changed",children:[$.jsxDEV("del",{children:$.jsxDEV(S0,{v:W[O]},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"arrow","aria-label":"becomes",children:"→"},void 0,!1,void 0,this),$.jsxDEV("ins",{children:$.jsxDEV(S0,{v:T},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(S0,{v:T},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},O,!0,void 0,this))},void 0,!1,void 0,this)]},K.id,!0,void 0,this)})]},Z,!0,void 0,this)})},void 0,!1,void 0,this)]},q,!0,void 0,this)})},void 0,!1,void 0,this)}function QF({name:_,token:Q,changes:J,canWrite:q,refused:U,onCut:G,pinned:Z,generated:F,inputRef:H,author:Y}){let[X,K]=i.useState(""),[L,z]=i.useState(!1),[W,O]=i.useState([]),T=(w,A,R)=>{O((I)=>[{ok:w,text:A,at:new Date().toISOString(),n:++C5,...R?.length?{acts:R}:{}},...I].slice(0,4))},B=async(w)=>{w.preventDefault(),z(!0);try{let A=await I1(Q,`/-/${_}/changesets`,{method:"POST",body:JSON.stringify(X.trim()?{message:X.trim()}:{})});if(!A.ok){U(A);let I=v1(await P0(A));T(!1,`Cut a changeset: ${I.text}`,I.acts);return}let R=await A.json();T(!0,`Cut ${R.name??"a changeset"}: ${k1(R.actions?.length??0,"change")}, ready to review in History and push.`),K(""),G()}catch(A){T(!1,`Cut a changeset: the World did not answer (${A instanceof Error?A.message:String(A)})`)}finally{z(!1)}};if(Z){let w=!q?"This session reads the World; it changes nothing":J===0?"Nothing to cut: no change is outside a changeset":null;return $.jsxDEV("div",{className:"ws-cut",children:[$.jsxDEV(l0,{log:W,name:_},void 0,!1,void 0,this),$.jsxDEV("form",{onSubmit:(A)=>void B(A),"aria-label":"Cut a changeset",children:[Y?$.jsxDEV("a",{className:"ws-author",href:Y.account,title:`${Y.who}: your account`,onClick:(A)=>{A.preventDefault(),R1(Y.account.slice(X1.length+1).split("/"))},children:Y.face},void 0,!1,void 0,this):null,$.jsxDEV("input",{ref:H,name:"changesetMessage","aria-label":"Summary",value:X,onChange:(A)=>K(A.target.value),placeholder:J===0?"Nothing to cut":F?"Summary (optional)":"Summary (required)",required:!F,maxLength:200,disabled:Boolean(w),title:w??void 0},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(w)||L,title:w??void 0,children:L?"Cutting…":J===0?"Cut a changeset":$.jsxDEV($.Fragment,{children:["Cut ",k1(J,"change"),Y?$.jsxDEV($.Fragment,{children:[" on ",$.jsxDEV("b",{children:Y.branch},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}if(!q||J===0)return $.jsxDEV(l0,{log:W,name:_},void 0,!1,void 0,this);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("form",{className:"block cut pad",onSubmit:(w)=>void B(w),"aria-label":"Cut a changeset",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Cut ",J===1?"this change":`these ${J} changes`," into a changeset: what it does and why"]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"changesetMessage",value:X,onChange:(w)=>K(w.target.value),placeholder:"Welcome email for new sign-ups",required:!0,maxLength:200,disabled:J===0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:L||J===0,children:L?"Cutting…":"Cut a changeset"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(l0,{log:W,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JF({name:_,token:Q}){let[J,q]=i.useState(0),U=w1(Q,`/-/${_}/keys`,J),[G,Z]=i.useState(!1),[F,H]=i.useState(""),[Y,X]=i.useState("write"),[K,L]=i.useState(!1),[z,W]=i.useState(null),[O,T]=i.useState(null),[B,w]=i.useState(null),A=async()=>{let C=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,P=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:C,scope:"read"})}).catch(()=>null),k=P?await P.json().catch(()=>({})):{error:`${T1} did not answer`};if(!P?.ok||!k.key){u1(k.error?v1(k.error).text:"refused","error");return}w(`${window.location.origin}${X1}/${_}#${new URLSearchParams({token:k.key}).toString()}`),q((N)=>N+1)},R=async(C)=>{C.preventDefault(),L(!0),W(null);let P=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:F.trim(),scope:Y})}).catch(()=>null);L(!1);let k=P?await P.json().catch(()=>({})):{error:`${T1} did not answer`};if(!P?.ok||!k.key){W(k.error?v1(k.error).text:"refused");return}Z(!1),T({key:k.key,name:F.trim()}),H(""),q((N)=>N+1)},I=async(C)=>{if(!await B0({title:`Revoke ${C.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let P=await I1(Q,`/-/${_}/keys/${C.id}`,{method:"DELETE"});if(P.ok)u1(`Revoked ${C.name}`);else u1(await J0(P),"error");q((k)=>k+1)};return $.jsxDEV("section",{"aria-labelledby":"keys-head",className:"keys",children:[$.jsxDEV("div",{className:"keys-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"keys-head",children:"Keys"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"What an app, a script or a CI job holds to reach this World: each named for what holds it and revoked alone. People open the World as themselves; keys are for software."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p1()?$.jsxDEV("a",{className:"button primary",href:`${p1()}/${encodeURIComponent(_.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this):$.jsxDEV("div",{className:"head-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>void A(),children:"Share a read-only link"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{W(null),Z(!0)},children:"Make a key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:U,what:"the keys",retry:()=>q((C)=>C+1)},void 0,!1,void 0,this),U.state==="ok"?U.data.keys.length===0?$.jsxDEV("p",{className:"mode",children:"No keys yet. The World's own token opens it too."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"dense","aria-label":"Keys",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"For"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Access"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last used"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:U.data.keys.map((C)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:C.name},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.person??$.jsxDEV("span",{className:"mode",title:"It acts as itself: a service",children:"no one: a service"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.scope==="write"?"Read and write":"Read only"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:$.jsxDEV("span",{title:E6(C.createdAt),children:x6(C.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:C.lastUsedAt?x6(C.lastUsedAt):"never"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:$.jsxDEV(z_,{label:`More for ${C.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void I(C)}]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},C.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(t1,{open:G,onClose:()=>{if(!K)Z(!1)},title:"Make a key",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>Z(!1),disabled:K,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"make-key",disabled:K||!F.trim(),children:K?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"make-key",onSubmit:R,"aria-label":"Make a key",children:[$.jsxDEV("label",{children:["Name ",$.jsxDEV("input",{autoFocus:!0,name:"keyName",value:F,onChange:(C)=>H(C.target.value),placeholder:"ci, staging app…",maxLength:80,required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:["Access ",$.jsxDEV("select",{value:Y,onChange:(C)=>X(C.target.value==="read"?"read":"write"),children:[$.jsxDEV("option",{value:"write",children:"Read and write"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"read",children:"Read only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z?$.jsxDEV("p",{role:"alert",children:z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(t1,{open:Boolean(O),onClose:()=>T(null),title:`${O?.name??"The key"} is ready`,footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>T(null),children:"Done"},void 0,!1,void 0,this),children:[$.jsxDEV("p",{className:"mode",children:"Copy it now: it is shown this once. Put it where the app reads its secrets."},void 0,!1,void 0,this),O?$.jsxDEV(g6,{label:"Key",value:O.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:Boolean(B),onClose:()=>w(null),title:"A read-only link",footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>w(null),children:"Done"},void 0,!1,void 0,this),children:[$.jsxDEV("p",{className:"mode",children:"Whoever opens it sees this World's pages and changes nothing. Copy it now: it is shown this once. It is listed under Keys, where revoking it closes the link at once."},void 0,!1,void 0,this),B?$.jsxDEV(g6,{label:"Link",value:B,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var C5=0;function l0({log:_,name:Q}){if(_.length===0)return null;return $.jsxDEV("ul",{className:"narration-log",role:"status","aria-live":"polite",children:_.map((J)=>$.jsxDEV("li",{className:J.ok?"ok":"bad",children:[$.jsxDEV("span",{className:"mode",children:$.jsxDEV(O1,{iso:J.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",J.text,J.acts?$.jsxDEV(k_,{name:Q,acts:J.acts},void 0,!1,void 0,this):null]},J.n,!0,void 0,this))},void 0,!1,void 0,this)}function s_(_,Q,J,q){let[U,G]=i.useState(0),Z=U*1e5+Math.floor(J/2),F=w1(Q,`/-/${_}/origin`,Z),H=w1(Q,`/-/${_}/diff`,Z),Y=w1(Q,`/-/${_}/changesets`,Z),[X,K]=i.useState([]),[L,z]=i.useState(null),W=(I,C,P)=>{if(K((k)=>[{ok:I,text:C,at:new Date().toISOString(),n:++C5,...P?.length?{acts:P}:{}},...k].slice(0,8)),!I)u1(C,"error")},O=async(I,C,P)=>{z(I);try{let k=await I1(Q,`/-/${_}/${C}`,P);if(!k.ok){q(k);let N=v1(await P0(k));return W(!1,`${I}: ${N.text}`,N.acts),null}return await k.json()}catch(k){return W(!1,`${I}: the World did not answer (${k instanceof Error?k.message:String(k)})`),null}finally{z(null),G((k)=>k+1)}},T=F.state==="ok"&&F.data.origin?t6(F.data.origin):null,B=H.state==="ok"?H.data.changes.length:null,w=Y.state==="ok"&&T?hZ(Y.data.changesets.filter((I)=>!I.pushedBy)).sort((I,C)=>I.createdAt.localeCompare(C.createdAt)):[];return{origin:F,diff:H,sets:Y,there:T,changes:B,waiting:w,log:X,busy:L,say:W,send:O,push:async()=>{let I=await O("Push","origin/push",{method:"POST"});if(!I)return;if(I.pushed.length===0){W(!0,"Nothing to push: every changeset is already at the remote.");return}for(let C of I.pushed){let P=C.receipts??[],k=P.filter((h)=>h.status==="replayed").length,N=P.filter((h)=>h.status==="confirmed").length,v=P.filter((h)=>h.status==="failed").length,E=C.outcome==="applied"&&v===0;if(C.outcome==="refused"){W(!1,`Push of ${C.changeset} was refused${C.refusal?.length?`: ${C.refusal.map((h)=>v1(h).text).join("; ")}`:""}.`);continue}let g=[`${k} of ${k1(P.length,"change")} replayed there`,...N?[`${N} performed at the vendor by the remote`]:[],...v?[`${v} failed`]:[]];W(E,`${C.outcome==="partial"?"Partly pushed":"Pushed"} ${C.changeset} to ${T??"the remote"}: ${g.join("; ")}${C.refusal?.length?` (${C.refusal.map((h)=>v1(h).text).join("; ")})`:""}.`)}},pull:async()=>{let I=await O("Pull","origin/pull",{method:"POST"});if(!I)return;let C=Object.entries(I.appended).filter(([,k])=>k>0),P=I.rebased.flatMap((k)=>k.conflicts.map((N)=>`${H1(k.twin)} ${N.subject.type}:${N.subject.id} ${N.field}`));W(P.length===0,`Pulled from ${T??"the remote"}: ${C.length?C.map(([k,N])=>`${k1(N,"entry")} at ${H1(k)}`).join(", "):"nothing new"}${P.length?`; conflicts at ${P.join(", ")}`:""}.`)}}}function $F({name:_,token:Q,canWrite:J,tick:q,refused:U}){let{origin:G,there:Z,changes:F,log:H,busy:Y,say:X,send:K,push:L,pull:z}=s_(_,Q,q,U),[W,O]=i.useState(""),[T,B]=i.useState(""),[w,A]=i.useState(!1),R=async(C)=>{C.preventDefault();let P=await K("Name the remote","origin",{method:"PUT",body:JSON.stringify({url:W.trim(),token:T.trim()})});if(P){let k=Object.values(P.appended??{}).reduce((N,v)=>N+v,0);X(!0,`The remote is ${t6(P.origin)}: its history came in (${k1(k,"entry")}).`),B(""),A(!1)}},I=!J?"This session reads the World; it changes nothing":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"block remote",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{children:"Origin"},void 0,!1,void 0,this),J?$.jsxDEV("button",{type:"button",onClick:()=>{O(Z??""),A(!w)},"aria-expanded":w,children:Z?"Change the remote…":"Name a remote…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"pad",children:[G.state==="ok"?Z?$.jsxDEV("p",{children:[$.jsxDEV("code",{className:"big",children:Z},void 0,!1,void 0,this),G.data.origin?.fetchedAt?$.jsxDEV("span",{className:"mode",children:[" · last fetched ",$.jsxDEV(O1,{iso:G.data.origin.fetchedAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("p",{children:"No remote — this World keeps its default data. Name one to push its changesets to a shared World and pull what others pushed there."},void 0,!1,void 0,this):$.jsxDEV(g1,{load:G,what:"the remote",lines:1},void 0,!1,void 0,this),w?$.jsxDEV("form",{className:"stack origin-form",onSubmit:(C)=>void R(C),"aria-label":"Name the remote",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The World's address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originUrl",value:W,onChange:(C)=>O(C.target.value),placeholder:"https://worlds.example.com/acme/team",required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"A key or token that opens it"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originToken",type:"password",value:T,onChange:(C)=>B(C.target.value),required:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Naming it brings its history in. Your pushes are recorded there as whoever this key was made for, or as the key itself."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Y!==null,children:Y==="Name the remote"?"Bringing its history in…":"Save the remote"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>A(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(l0,{log:H,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function qF({name:_,token:Q,canWrite:J,refused:q}){let[U,G]=i.useState(0),Z=w1(Q,`/-/${_}/twins`,U),F=w1(Q,`/-/${_}/links`,U),H=w1(Q,`/-/${_}/requests?hours=24`,U),[Y,X]=i.useState({}),[K,L]=i.useState(null),[z,W]=i.useState(""),[O,T]=i.useState(!1),[B,w]=i.useState([]),A=(N,v,E)=>{if(w((g)=>[{ok:N,text:v,at:new Date().toISOString(),n:++C5,...E?.length?{acts:E}:{}},...g].slice(0,6)),!N)u1(v,"error")},R=F.state==="ok"?Object.keys(F.data.links).sort():[];i.useEffect(()=>{let N=!0;return Promise.all(R.map(async(v)=>{let E=await I1(Q,`/-/${_}/twins/${v}/credential`).catch(()=>null),g=E?.ok?await E.json():null;return[v,g?.credential??null]})).then((v)=>{if(N)X(Object.fromEntries(v))}),()=>{N=!1}},[_,Q,R.join(","),U]);let I=async(N)=>{if(N.preventDefault(),!K||!z)return;T(!0);let v=await I1(Q,`/-/${_}/twins/${K.vendor}/credential`,{method:"PUT",body:z,headers:{"content-type":"text/plain"}}).catch(()=>null);if(T(!1),!v){A(!1,`Seal ${K.vendor}: ${T1} did not answer`);return}if(!v.ok){q(v);let g=v1(await P0(v));A(!1,`Seal ${H1(K.vendor)}: ${g.text}`,g.acts);return}let E=await v.json().catch(()=>({}));A(!0,`Sealed a credential for ${H1(K.vendor)}${E.fingerprint?` (${E.fingerprint})`:""}: it opens for ${E.boundTo??K.to} only, and is never shown again.`),W(""),L(null),G((g)=>g+1)},C=async(N)=>{if(!await B0({title:`Remove the link ${N}?`,body:`Requests to ${W2}/${_}/${N}/… stop being forwarded to ${F.state==="ok"?F.data.links[N]?.origin:"its origin"}.`,action:"Remove link",danger:!0}))return;let v=await I1(Q,`/-/${_}/links/${N}`,{method:"DELETE"}).catch(()=>null);if(!v?.ok){if(v)q(v);A(!1,`Remove ${N}: ${v?await J0(v):"the World did not answer"}`);return}A(!0,`Removed the link ${N}.`),G((E)=>E+1)},P=(N)=>N?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge rooted",children:"sealed"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[N.fingerprint?$.jsxDEV("code",{children:N.fingerprint},void 0,!1,void 0,this):null," · ",$.jsxDEV(O1,{iso:N.placedAt},void 0,!1,void 0,this),N.sealedBy?` · by ${N.sealedBy==="vault"?"the vault":"the host's key"}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"mode",children:"none"},void 0,!1,void 0,this),k=Z.state==="ok"?Z.data.twins:[];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"lede",children:"A real vendor's credential lives in one place, sealed: beside this World, bound to where it goes. It is never readable back; this page says only that one is sealed, when, by what, and for where."},void 0,!1,void 0,this),$.jsxDEV(l0,{log:B,name:_},void 0,!1,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"creds-head",children:[$.jsxDEV("div",{className:"block-head",children:$.jsxDEV("h3",{id:"creds-head",children:"Vendors"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(g1,{load:Z,what:"the vendors"},void 0,!1,void 0,this),Z.state==="ok"?$.jsxDEV("table",{className:"dense","aria-label":"Credentials by vendor",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Bound to"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:k.map((N)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:N.twin},void 0,!1,void 0,this),H1(N.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P(N.credential)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.credential?.boundTo?$.jsxDEV("code",{children:N.credential.boundTo},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.root?.url?$.jsxDEV("code",{children:N.root.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"none: a stand-in"},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?$.jsxDEV("td",{className:"num",children:$.jsxDEV("button",{type:"button",disabled:!N.root?.url,title:N.root?.url?`Seal ${H1(N.twin)}'s real credential for ${N.root.url}`:"Connect it to its real service first (Settings › Real services): a credential is sealed for where it goes",onClick:()=>{W(""),L({vendor:N.twin,to:N.root.url})},children:N.credential?"Replace…":"Seal a credential…"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},N.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z.state==="ok"&&k.every((N)=>!N.root?.url)?$.jsxDEV("p",{className:"mode pad",children:"No vendor here has a real service behind it, so none holds a credential. Connect one in Settings › Real services; its credential is sealed here."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"links-head",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{id:"links-head",children:"Links"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"a vendor with no twin, forwarded with its sealed credential"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:F,what:"the links"},void 0,!1,void 0,this),H.state==="ok"&&(H.data.journalFailures??0)>0?$.jsxDEV("p",{className:"mode pad",role:"alert",children:[H.data.journalFailures," request ",H.data.journalFailures===1?"line was":"lines were"," not kept by this World's server since it started (its links, and the twins it runs in its own process): those requests are missing from what this page counts."]},void 0,!0,void 0,this):null,F.state==="ok"&&R.length===0?$.jsxDEV("p",{className:"mode pad",children:["No links. A link forwards requests for a vendor with no twin here, at ",$.jsxDEV("code",{children:[W2,"/",_,"/<link>/…"]},void 0,!0,void 0,this),", to that vendor's real API with the credential sealed for it."]},void 0,!0,void 0,this):null,R.length?$.jsxDEV("table",{className:"dense","aria-label":"Links",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Link"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Origin"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:"Requests, 24h"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:R.map((N)=>{let v=F.state==="ok"?F.data.links[N].origin:"",E=H.state==="ok"?H.data.twins.find((g)=>g.twin===N):void 0;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("b",{children:N},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("code",{children:v},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:E?$.jsxDEV("span",{title:Object.entries(E.byStatus).map(([g,h])=>`${g}: ${h}`).join(" · "),children:E.requests},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:[P(Y[N]??null),Y[N]?.boundTo?$.jsxDEV("div",{className:"mode",children:["bound to ",$.jsxDEV("code",{children:Y[N].boundTo},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),J?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{W(""),L({vendor:N,to:v})},children:Y[N]?"Replace…":"Seal a credential…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void C(N),children:"Remove…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},N,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:Boolean(K),onClose:()=>{if(!O)L(null)},title:`Seal ${K?H1(K.vendor):""}'s credential`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>L(null),disabled:O,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"seal-credential",className:"primary",disabled:O||!z,children:O?"Sealing…":"Seal it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"seal-credential",className:"stack",onSubmit:(N)=>void I(N),children:[$.jsxDEV("p",{className:"mode",children:["It is sealed for ",$.jsxDEV("code",{children:K?.to},void 0,!1,void 0,this)," and opens there only. It is never shown again, here or anywhere."]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real key"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"credential",type:"password",value:z,onChange:(N)=>W(N.target.value),autoComplete:"off",required:!0,autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function UF({name:_,token:Q,admin:J,canWrite:q,refused:U,onRemoved:G,only:Z}){let F=(V)=>!Z||Z===V,[H,Y]=i.useState(0),X=w1(Q,`/-/${_}/twins`,H),K=w1(Q,`/-/${_}/checks`,H),[L,z]=i.useState(0),W=w1(Q,`/-/${_}/clock`,L),[O,T]=i.useState([]),[B,w]=i.useState(null),[A,R]=i.useState(null),[I,C]=i.useState(""),[P,k]=i.useState("gated"),[N,v]=i.useState(!1),E=(V,D,f)=>{if(T((y)=>[{ok:V,text:D,at:new Date().toISOString(),n:++C5,...f?.length?{acts:f}:{}},...y].slice(0,6)),!V)u1(D,"error")},g=async(V,D,f)=>{let y=await I1(Q,D,f).catch(()=>null);if(!y)return E(!1,`${V}: the World did not answer`),!1;if(!y.ok){U(y);let p=v1(await P0(y));return E(!1,`${V}: ${p.text}`,p.acts),!1}return E(!0,`${V}: done.`),Y((p)=>p+1),!0},h=async(V)=>{if(V.preventDefault(),!A)return;v(!0);let D=A.root??{},f=await g(I.trim()?`Connect ${H1(A.twin)} to ${I.trim()}`:`Disconnect ${H1(A.twin)}`,`/-/${_}/twins/${A.twin}/root`,{method:"PUT",body:JSON.stringify(I.trim()?{...D,url:I.trim(),deploy:P}:null)});if(v(!1),f)R(null)},S=async()=>{if(!await B0({title:`Rotate the tokens of ${_}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let V=await I1(J,`/-/worlds/${_}/rotate`,{method:"POST"});if(V.ok)w(await V.json()),E(!0,"Rotated: the new tokens are shown once, below.");else E(!1,`Rotate: ${await J0(V)}`)},b=async()=>{if(!await B0({title:`Remove ${_}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:_}))return;let V=await I1(J,`/-/worlds/${_}`,{method:"DELETE"}).catch((D)=>D);if(V instanceof Error){E(!1,`Remove: the host did not answer (${V.message})`);return}if(V.ok)G();else E(!1,`Remove: ${await J0(V)}`)},j=X.state==="ok"?X.data.twins:[],x={gated:"gated: a person deploys an approved changeset",auto:"auto: a push deploys at once",hold:"hold: nothing deploys"};return $.jsxDEV($.Fragment,{children:[$.jsxDEV(l0,{log:O,name:_},void 0,!1,void 0,this),F("access")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Access"},void 0,!1,void 0,this),q?$.jsxDEV(JF,{name:_,token:Q},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"This session reads the World: its keys are managed by whoever holds its token."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("services")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Real services"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:[j.some((V)=>V.root?.url)?null:"Every vendor here is a stand-in. ","Connect a vendor to its real service to read the real state into this World; its real credential is sealed in the Vault, and an approved changeset deploys there by its policy."]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:X,what:"the vendors"},void 0,!1,void 0,this),X.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Real services",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last read from it"},void 0,!1,void 0,this),q?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:j.map((V)=>{let D=V.root;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:V.twin},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/${V.twin}`,title:`Its log and stored state · ${V.position??0} entries`,onClick:(f)=>{f.preventDefault(),R1([..._.split("/"),V.twin])},children:H1(V.twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:D?.url?$.jsxDEV("code",{children:D.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"not connected"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:D?.url?x[D.deploy??""]??D.deploy??"—":"—"},void 0,!1,void 0,this),$.jsxDEV("td",{children:V.refresh?.failed?$.jsxDEV("span",{role:"alert",children:["failed ×",V.refresh.failed.count??1,": ",V.refresh.failed.reason??""]},void 0,!0,void 0,this):D?.url?E6(V.refresh?.observedAt??V.refresh?.at):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{C(D?.url??""),k(D?.deploy==="auto"||D?.deploy==="hold"?D.deploy:"gated"),R(V)},children:D?.url?"Change…":"Connect…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",disabled:!D?.url,title:D?.url?"Read the real service's current state into this World":"Connect it first",onClick:()=>void B0({title:`Read ${H1(V.twin)} now?`,body:`The real ${H1(V.twin)}'s current state is read into this World. Nothing is written to ${H1(V.twin)}.`,action:"Read from it"}).then((f)=>{if(f)g(`Read from ${H1(V.twin)}`,`/-/${_}/twins/${V.twin}/refresh`,{method:"POST"})}),children:"Read from it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},V.twin,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,F("clock")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Clock"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"The instant every vendor here stamps from. Set it and move it forward to see what happens later: renewals, expiries, scheduled sends."},void 0,!1,void 0,this),$.jsxDEV(xZ,{name:_,token:Q,clock:W,canWrite:q,onChanged:()=>z((V)=>V+1),refused:U,open:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("checks")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Checks"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"JavaScript the World runs over every change before it is performed (a changeset's Verify runs them too)."},void 0,!1,void 0,this),$.jsxDEV(g1,{load:K,what:"the checks"},void 0,!1,void 0,this),K.state==="ok"?K.data.checks.length===0?$.jsxDEV("p",{className:"mode",children:"No checks: every change is performed as it comes."},void 0,!1,void 0,this):$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Checks",children:$.jsxDEV("tbody",{children:K.data.checks.map((V)=>$.jsxDEV("tr",{children:$.jsxDEV("td",{children:$.jsxDEV("code",{children:V},void 0,!1,void 0,this)},void 0,!1,void 0,this)},V,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,J&&!Z?$.jsxDEV("div",{className:"danger",role:"region","aria-label":"Danger zone",children:[$.jsxDEV("h3",{children:"Danger zone"},void 0,!1,void 0,this),B?$.jsxDEV("p",{role:"status",children:["token ",$.jsxDEV("code",{children:B.token},void 0,!1,void 0,this)," · read token ",$.jsxDEV("code",{children:B.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void S(),children:"Rotate tokens"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"New tokens for this World; every app, script and browser using the old ones is signed out."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void b(),children:"Remove world"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"Deletes this World and everything in it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(t1,{open:Boolean(A),onClose:()=>{if(!N)R(null)},title:`Connect ${A?H1(A.twin):""} to its real service`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>R(null),disabled:N,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"connect-root",className:"primary",disabled:N,children:N?"Saving…":I.trim()?"Connect":"Disconnect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"connect-root",className:"stack",onSubmit:(V)=>void h(V),children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real service's API address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"rootUrl",value:I,onChange:(V)=>C(V.target.value),placeholder:"https://api.openai.com",autoFocus:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Empty disconnects it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"rootDeploy",value:P,onChange:(V)=>k(V.target.value==="auto"?"auto":V.target.value==="hold"?"hold":"gated"),children:["gated","auto","hold"].map((V)=>$.jsxDEV("option",{value:V,children:x[V]},V,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function cB(){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(IZ,{},void 0,!1,void 0,this),$.jsxDEV(L_,{},void 0,!1,void 0,this),$.jsxDEV(Y_,{},void 0,!1,void 0,this),$.jsxDEV(X_,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{pB as openAt,P5 as ROOT,cB as ConsolePage};
|
|
33
|
+
`)),K=Y.reduce((H,L)=>H.concat(...L),[]);return[Y,K]}return[[],[]]},[_]);return d.useEffect(()=>{let X=Q?.target??q9,Y=Q?.actInsideInputWithModifier??!0;if(_!==null){let K=(z)=>{if(U.current=z.ctrlKey||z.metaKey||z.shiftKey||z.altKey,(!U.current||U.current&&!Y)&&w6(z))return!1;let O=G9(z.code,F);if(G.current.add(z[O]),U9(Z,G.current,!1)){let R=z.composedPath?.()?.[0]||z.target,B=R?.nodeName==="BUTTON"||R?.nodeName==="A";if(Q.preventDefault!==!1&&(U.current||!B))z.preventDefault();q(!0)}},H=(z)=>{let W=G9(z.code,F);if(U9(Z,G.current,!0))q(!1),G.current.clear();else G.current.delete(z[W]);if(z.key==="Meta")G.current.clear();U.current=!1},L=()=>{G.current.clear(),q(!1)};return X?.addEventListener("keydown",K),X?.addEventListener("keyup",H),window.addEventListener("blur",L),window.addEventListener("contextmenu",L),()=>{X?.removeEventListener("keydown",K),X?.removeEventListener("keyup",H),window.removeEventListener("blur",L),window.removeEventListener("contextmenu",L)}}},[_,q]),J}function U9(_,Q,J){return _.filter((q)=>J||q.length===Q.size).some((q)=>q.every((U)=>Q.has(U)))}function G9(_,Q){return Q.includes(_)?"code":"key"}var LU=()=>{let _=S1();return d.useMemo(()=>{return{zoomIn:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(1.2,Q):!1},zoomOut:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(0.8333333333333334,Q):!1},zoomTo:async(Q,J)=>{let{panZoom:q}=_.getState();return q?q.scaleTo(Q,J):!1},getZoom:()=>_.getState().transform[2],setViewport:async(Q,J)=>{let{transform:[q,U,G],panZoom:Z}=_.getState();if(!Z)return!1;return await Z.setViewport({x:Q.x??q,y:Q.y??U,zoom:Q.zoom??G},J),!0},getViewport:()=>{let[Q,J,q]=_.getState().transform;return{x:Q,y:J,zoom:q}},setCenter:async(Q,J,q)=>{return _.getState().setCenter(Q,J,q)},fitBounds:async(Q,J)=>{let{width:q,height:U,minZoom:G,maxZoom:Z,panZoom:F}=_.getState(),X=O5(Q,q,U,G,Z,J?.padding??0.1);if(!F)return!1;return await F.setViewport(X,{duration:J?.duration,ease:J?.ease,interpolate:J?.interpolate}),!0},screenToFlowPosition:(Q,J={})=>{let{transform:q,snapGrid:U,snapToGrid:G,domNode:Z}=_.getState();if(!Z)return Q;let{x:F,y:X}=Z.getBoundingClientRect(),Y={x:Q.x-F,y:Q.y-X},K=J.snapGrid??U,H=J.snapToGrid??G;return D2(Y,q,H,K)},flowToScreenPosition:(Q)=>{let{transform:J,domNode:q}=_.getState();if(!q)return Q;let{x:U,y:G}=q.getBoundingClientRect(),Z=Z2(Q,J);return{x:Z.x+U,y:Z.y+G}}}},[])};function v9(_,Q){let J=[],q=new Map,U=[];for(let G of _)if(G.type==="add"){U.push(G);continue}else if(G.type==="remove"||G.type==="replace")q.set(G.id,[G]);else{let Z=q.get(G.id);if(Z)Z.push(G);else q.set(G.id,[G])}for(let G of Q){let Z=q.get(G.id);if(!Z){J.push(G);continue}if(Z[0].type==="remove")continue;if(Z[0].type==="replace"){J.push({...Z[0].item});continue}let F={...G};for(let X of Z)zU(X,F);J.push(F)}if(U.length)U.forEach((G)=>{if(G.index!==void 0)J.splice(G.index,0,{...G.item});else J.push({...G.item})});return J}function zU(_,Q){switch(_.type){case"select":{Q.selected=_.selected;break}case"position":{if(typeof _.position<"u")Q.position=_.position;if(typeof _.dragging<"u")Q.dragging=_.dragging;break}case"dimensions":{if(typeof _.dimensions<"u"){if(Q.measured={..._.dimensions},_.setAttributes){if(_.setAttributes===!0||_.setAttributes==="width")Q.width=_.dimensions.width;if(_.setAttributes===!0||_.setAttributes==="height")Q.height=_.dimensions.height}}if(typeof _.resizing==="boolean")Q.resizing=_.resizing;break}}}function y9(_,Q){return v9(_,Q)}function WU(_,Q){return v9(_,Q)}function K2(_,Q){return{id:_,type:"select",selected:Q}}function E2(_,Q=new Set,J=!1){let q=[];for(let[U,G]of _){let Z=Q.has(U);if(!(G.selected===void 0&&!Z)&&G.selected!==Z){if(J)G.selected=Z;q.push(K2(G.id,Z))}}return q}function Z9({items:_=[],lookup:Q}){let J=[],q=new Map(_.map((U)=>[U.id,U]));for(let[U,G]of _.entries()){let Z=Q.get(G.id),F=Z?.internals?.userNode??Z;if(F!==void 0&&F!==G)J.push({id:G.id,item:G,type:"replace"});if(F===void 0)J.push({item:G,type:"add",index:U})}for(let[U]of Q)if(q.get(U)===void 0)J.push({id:U,type:"remove"});return J}function F9(_){return{id:_.id,type:"remove"}}var AU=M6("React Flow","https://reactflow.dev/");function BU(_,Q,J={}){return O7(_,Q,{...J,onError:J.onError??AU})}var H9=(_)=>K7(_),MU=(_)=>Y6(_);function j9(_){return d.forwardRef(_)}var V9=typeof window<"u"?d.useLayoutEffect:d.useEffect;function K9(_){let[Q,J]=d.useState(BigInt(0)),[q]=d.useState(()=>TU(()=>J((U)=>U+BigInt(1))));return V9(()=>{let U=q.get();if(U.length)_(U),q.reset()},[Q]),q}function TU(_){let Q=[];return{get:()=>Q,reset:()=>{Q=[]},push:(J)=>{Q.push(J),_()}}}var u9=d.createContext(null);function RU({children:_}){let Q=S1(),J=d.useCallback((F)=>{let{nodes:X=[],setNodes:Y,hasDefaultNodes:K,onNodesChange:H,nodeLookup:L,fitViewQueued:z,onNodesChangeMiddlewareMap:W}=Q.getState(),O=X;for(let B of F)O=typeof B==="function"?B(O):B;let R=Z9({items:O,lookup:L});for(let B of W.values())R=B(R);if(K)Y(O);if(R.length>0)H?.(R);else if(z)window.requestAnimationFrame(()=>{let{fitViewQueued:B,nodes:P,setNodes:A}=Q.getState();if(B)A(P)})},[]),q=K9(J),U=d.useCallback((F)=>{let{edges:X=[],setEdges:Y,hasDefaultEdges:K,onEdgesChange:H,edgeLookup:L}=Q.getState(),z=X;for(let W of F)z=typeof W==="function"?W(z):W;if(K)Y(z);else if(H)H(Z9({items:z,lookup:L}))},[]),G=K9(U),Z=d.useMemo(()=>({nodeQueue:q,edgeQueue:G}),[]);return i.jsx(u9.Provider,{value:Z,children:_})}function OU(){let _=d.useContext(u9);if(!_)throw Error("useBatchContext must be used within a BatchProvider");return _}var IU=(_)=>!!_.panZoom;function w5(){let _=LU(),Q=S1(),J=OU(),q=T1(IU),U=d.useMemo(()=>{let G=(H)=>Q.getState().nodeLookup.get(H),Z=(H)=>{J.nodeQueue.push(H)},F=(H)=>{J.edgeQueue.push(H)},X=(H)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState(),W=H9(H)?H:L.get(H.id),O=W.parentId?R6(W.position,W.measured,W.parentId,L,z):W.position,R={...W,position:O,width:W.measured?.width??W.width,height:W.measured?.height??W.height};return u2(R)},Y=(H,L,z={replace:!1})=>{Z((W)=>W.map((O)=>{if(O.id===H){let R=typeof L==="function"?L(O):L;return z.replace&&H9(R)?R:{...O,...R}}return O}))},K=(H,L,z={replace:!1})=>{F((W)=>W.map((O)=>{if(O.id===H){let R=typeof L==="function"?L(O):L;return z.replace&&MU(R)?R:{...O,...R}}return O}))};return{getNodes:()=>Q.getState().nodes.map((H)=>({...H})),getNode:(H)=>G(H)?.internals.userNode,getInternalNode:G,getEdges:()=>{let{edges:H=[]}=Q.getState();return H.map((L)=>({...L}))},getEdge:(H)=>Q.getState().edgeLookup.get(H),setNodes:Z,setEdges:F,addNodes:(H)=>{let L=Array.isArray(H)?H:[H];J.nodeQueue.push((z)=>[...z,...L])},addEdges:(H)=>{let L=Array.isArray(H)?H:[H];J.edgeQueue.push((z)=>[...z,...L])},toObject:()=>{let{nodes:H=[],edges:L=[],transform:z}=Q.getState(),[W,O,R]=z;return{nodes:H.map((B)=>({...B})),edges:L.map((B)=>({...B})),viewport:{x:W,y:O,zoom:R}}},deleteElements:async({nodes:H=[],edges:L=[]})=>{let{nodes:z,edges:W,onNodesDelete:O,onEdgesDelete:R,triggerNodeChanges:B,triggerEdgeChanges:P,onDelete:A,onBeforeDelete:T}=Q.getState(),{nodes:f,edges:C}=await L7({nodesToRemove:H,edgesToRemove:L,nodes:z,edges:W,onBeforeDelete:T}),w=C.length>0,S=f.length>0;if(w){let N=C.map(F9);R?.(C),P(N)}if(S){let N=f.map(F9);O?.(f),B(N)}if(S||w)A?.({nodes:f,edges:C});return{deletedNodes:f,deletedEdges:C}},getIntersectingNodes:(H,L=!0,z)=>{let W=B6(H),O=W?H:X(H),R=z!==void 0;if(!O)return[];return(z||Q.getState().nodes).filter((B)=>{let P=Q.getState().nodeLookup.get(B.id);if(P&&!W&&(B.id===H.id||!P.internals.positionAbsolute))return!1;let A=u2(R?B:P),T=R5(A,O);return L&&T>0||T>=A.width*A.height||T>=O.width*O.height})},isNodeIntersecting:(H,L,z=!0)=>{let O=B6(H)?H:X(H);if(!O)return!1;let R=R5(O,L);return z&&R>0||R>=L.width*L.height||R>=O.width*O.height},updateNode:Y,updateNodeData:(H,L,z={replace:!1})=>{Y(H,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},updateEdge:K,updateEdgeData:(H,L,z={replace:!1})=>{K(H,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},getNodesBounds:(H)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState();return z6(H,{nodeLookup:L,nodeOrigin:z})},getHandleConnections:({type:H,id:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}-${H}${L?`-${L}`:""}`)?.values()??[]),getNodeConnections:({type:H,handleId:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}${H?L?`-${H}-${L}`:`-${H}`:""}`)?.values()??[]),fitView:async(H)=>{let L=Q.getState().fitViewResolver??A7();return Q.setState({fitViewQueued:!0,fitViewOptions:H,fitViewResolver:L}),J.nodeQueue.push((z)=>[...z]),L.promise}}},[]);return d.useMemo(()=>{return{...U,..._,viewportInitialized:q}},[q])}var X9=(_)=>_.selected,fU=typeof window<"u"?window:void 0;function wU({deleteKeyCode:_,multiSelectionKeyCode:Q}){let J=S1(),{deleteElements:q}=w5(),U=f5(_,{actInsideInputWithModifier:!1}),G=f5(Q,{target:fU});d.useEffect(()=>{if(U){let{edges:Z,nodes:F}=J.getState();q({nodes:F.filter(X9),edges:Z.filter(X9)}),J.setState({nodesSelectionActive:!1})}},[U]),d.useEffect(()=>{J.setState({multiSelectionActive:G})},[G])}function PU(_){let Q=S1();d.useEffect(()=>{let J=()=>{if(!_.current||!(_.current.checkVisibility?.()??!0))return!1;let q=K4(_.current);if(q.height===0||q.width===0)Q.getState().onError?.("004",a1.error004());Q.setState({width:q.width||500,height:q.height||500})};if(_.current){J(),window.addEventListener("resize",J);let q=new ResizeObserver(()=>J());return q.observe(_.current),()=>{if(window.removeEventListener("resize",J),q&&_.current)q.unobserve(_.current)}}},[])}var w4={position:"absolute",width:"100%",height:"100%",top:0,left:0},NU=(_)=>({userSelectionActive:_.userSelectionActive,lib:_.lib,connectionInProgress:_.connection.inProgress});function CU({onPaneContextMenu:_,zoomOnScroll:Q=!0,zoomOnPinch:J=!0,panOnScroll:q=!1,panActivationKeyPressed:U,panOnScrollSpeed:G=0.5,panOnScrollMode:Z=P0.Free,zoomOnDoubleClick:F=!0,panOnDrag:X=!0,defaultViewport:Y,translateExtent:K,minZoom:H,maxZoom:L,zoomActivationKeyCode:z,preventScrolling:W=!0,children:O,noWheelClassName:R,noPanClassName:B,onViewportChange:P,isControlledViewport:A,paneClickDistance:T,selectionOnDrag:f}){let C=S1(),w=d.useRef(null),{userSelectionActive:S,lib:N,connectionInProgress:y}=T1(NU,C1),D=f5(z),l=d.useRef();PU(w);let p=d.useCallback((k)=>{if(P?.({x:k[0],y:k[1],zoom:k[2]}),!A)C.setState({transform:k})},[P,A]);return d.useEffect(()=>{if(w.current){l.current=x7({domNode:w.current,minZoom:H,maxZoom:L,translateExtent:K,viewport:Y,onDraggingChange:(E)=>C.setState((V)=>V.paneDragging===E?V:{paneDragging:E}),onPanZoomStart:(E,V)=>{let{onViewportChangeStart:h,onMoveStart:I}=C.getState();I?.(E,V),h?.(V)},onPanZoom:(E,V)=>{let{onViewportChange:h,onMove:I}=C.getState();I?.(E,V),h?.(V)},onPanZoomEnd:(E,V)=>{let{onViewportChangeEnd:h,onMoveEnd:I}=C.getState();I?.(E,V),h?.(V)}});let{x:k,y:b,zoom:j}=l.current.getViewport();return C.setState({panZoom:l.current,transform:[k,b,j],domNode:w.current.closest(".react-flow")}),()=>{l.current?.destroy()}}},[]),d.useEffect(()=>{l.current?.update({onPaneContextMenu:_,zoomOnScroll:Q,zoomOnPinch:J,panOnScroll:q,panActivationKeyPressed:U,panOnScrollSpeed:G,panOnScrollMode:Z,zoomOnDoubleClick:F,panOnDrag:X,zoomActivationKeyPressed:D,preventScrolling:W,noPanClassName:B,userSelectionActive:S,noWheelClassName:R,lib:N,onTransformChange:p,connectionInProgress:y,selectionOnDrag:f,paneClickDistance:T})},[_,Q,J,q,U,G,Z,F,X,D,W,B,S,R,N,p,y,f,T]),i.jsx("div",{className:"react-flow__renderer",ref:w,style:w4,children:O})}var SU=(_)=>({userSelectionActive:_.userSelectionActive,userSelectionRect:_.userSelectionRect});function kU(){let{userSelectionActive:_,userSelectionRect:Q}=T1(SU,C1);if(!(_&&Q))return null;return i.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:Q.width,height:Q.height,transform:`translate(${Q.x}px, ${Q.y}px)`}})}var u6=(_,Q)=>{return(J)=>{if(J.target!==Q.current)return;_?.(J)}},vU=(_)=>({userSelectionActive:_.userSelectionActive,elementsSelectable:_.elementsSelectable,dragging:_.paneDragging,panBy:_.panBy,autoPanSpeed:_.autoPanSpeed});function yU({isSelecting:_,selectionKeyPressed:Q,selectionMode:J=U2.Full,panOnDrag:q,autoPanOnSelection:U,paneClickDistance:G,selectionOnDrag:Z,onSelectionStart:F,onSelectionEnd:X,onPaneClick:Y,onPaneContextMenu:K,onPaneScroll:H,onPaneMouseEnter:L,onPaneMouseMove:z,onPaneMouseLeave:W,children:O}){let R=d.useRef(0),B=S1(),{userSelectionActive:P,elementsSelectable:A,dragging:T,panBy:f,autoPanSpeed:C}=T1(vU,C1),w=A&&(_||P),S=d.useRef(null),N=d.useRef(),y=d.useRef(new Set),D=d.useRef(new Set),l=d.useRef(!1),p=d.useRef(!1),k=d.useRef({x:0,y:0}),b=d.useRef(!1),j=(g)=>{if(p.current||l.current||B.getState().connection.inProgress){p.current=!1,l.current=!1;return}Y?.(g),B.getState().resetSelectedElements(),B.setState({nodesSelectionActive:!1})},E=(g)=>{if(Array.isArray(q)&&q?.includes(2)){g.preventDefault();return}K?.(g)},V=H?(g)=>H(g):void 0,h=(g)=>{if(p.current)g.stopPropagation(),p.current=!1},I=(g)=>{if(g.pointerType==="touch"&&q!==!1&&!Q)return;let{domNode:J1,transform:G1}=B.getState();if(N.current=J1?.getBoundingClientRect(),!N.current)return;let F1=g.target===S.current;if(!F1&&!!g.target.closest(".nokey")||!_||!(Z&&F1||Q)||g.button!==0||!g.isPrimary)return;g.target?.setPointerCapture?.(g.pointerId),p.current=!1;let{x:_1,y:q1}=J0(g.nativeEvent,N.current),o=D2({x:_1,y:q1},G1);if(B.setState({userSelectionRect:{width:0,height:0,startX:o.x,startY:o.y,x:_1,y:q1}}),!F1)g.stopPropagation(),g.preventDefault()};function v(g,J1){let{userSelectionRect:G1}=B.getState();if(!G1)return;let{transform:F1,nodeLookup:c,edgeLookup:s,connectionLookup:_1,triggerNodeChanges:q1,triggerEdgeChanges:o,defaultEdgeOptions:K1}=B.getState(),$1={x:G1.startX,y:G1.startY},{x:M1,y:R1}=Z2($1,F1),x1={startX:$1.x,startY:$1.y,x:g<M1?g:M1,y:J1<R1?J1:R1,width:Math.abs(g-M1),height:Math.abs(J1-R1)},U0=y.current,k1=D.current;y.current=new Set(G4(c,x1,F1,J===U2.Partial,!0).map((t1)=>t1.id)),D.current=new Set;let R0=K1?.selectable??!0;for(let t1 of y.current){let e1=_1.get(t1);if(!e1)continue;for(let{edgeId:_0}of e1.values()){let X0=s.get(_0);if(X0&&(X0.selectable??R0))D.current.add(_0)}}if(!O6(U0,y.current)){let t1=E2(c,y.current,!0);q1(t1)}if(!O6(k1,D.current)){let t1=E2(s,D.current);o(t1)}B.setState({userSelectionRect:x1,userSelectionActive:!0,nodesSelectionActive:!1})}function m(){if(!U||!N.current)return;let[g,J1]=Z4(k.current,N.current,C);f({x:g,y:J1}).then((G1)=>{if(!p.current||!G1){R.current=requestAnimationFrame(m);return}let{x:F1,y:c}=k.current;v(F1,c),R.current=requestAnimationFrame(m)})}let u=()=>{cancelAnimationFrame(R.current),R.current=0,b.current=!1};d.useEffect(()=>{return()=>u()},[]);let n=(g)=>{let{userSelectionRect:J1,transform:G1,resetSelectedElements:F1}=B.getState();if(!N.current||!J1)return;let{x:c,y:s}=J0(g.nativeEvent,N.current);k.current={x:c,y:s};let _1=Z2({x:J1.startX,y:J1.startY},G1);if(!p.current){let q1=Q?0:G;if(Math.hypot(c-_1.x,s-_1.y)<=q1)return;F1(),F?.(g)}if(p.current=!0,!b.current)m(),b.current=!0;v(c,s)},e=(g)=>{if(!w){if(g.target===S.current&&B.getState().connection.inProgress)l.current=!0;return}if(g.button!==0)return;if(g.target?.releasePointerCapture?.(g.pointerId),!P&&g.target===S.current&&B.getState().userSelectionRect)j?.(g);if(B.setState({userSelectionActive:!1,userSelectionRect:null}),p.current)X?.(g),B.setState({nodesSelectionActive:y.current.size>0});u()},t=(g)=>{g.target?.releasePointerCapture?.(g.pointerId),u()},a=q===!0||Array.isArray(q)&&q.includes(0);return i.jsxs("div",{className:v1(["react-flow__pane",{draggable:a,dragging:T,selection:_}]),onClick:w?void 0:u6(j,S),onContextMenu:u6(E,S),onWheel:u6(V,S),onPointerEnter:w?void 0:L,onPointerMove:w?n:z,onPointerUp:e,onPointerCancel:w?t:void 0,onPointerDownCapture:w?I:void 0,onClickCapture:w?h:void 0,onPointerLeave:W,ref:S,style:w4,children:[O,i.jsx(kU,{})]})}function D6({id:_,store:Q,unselect:J=!1,nodeRef:q}){let{addSelectedNodes:U,unselectNodesAndEdges:G,multiSelectionActive:Z,nodeLookup:F,onError:X}=Q.getState(),Y=F.get(_);if(!Y){X?.("012",a1.error012(_));return}if(Q.setState({nodesSelectionActive:!1}),!Y.selected)U([_]);else if(J||Y.selected&&Z)G({nodes:[Y],edges:[]}),requestAnimationFrame(()=>q?.current?.blur())}function b9({nodeRef:_,disabled:Q=!1,noDragClassName:J,handleSelector:q,nodeId:U,isSelectable:G,nodeClickDistance:Z}){let F=S1(),[X,Y]=d.useState(!1),K=d.useRef();return d.useEffect(()=>{if(Q)return;return K.current=y7({getStoreItems:()=>F.getState(),onNodeMouseDown:(H)=>{D6({id:H,store:F,nodeRef:_})},onDragStart:()=>{Y(!0)},onDragStop:()=>{Y(!1)}}),()=>{K.current?.destroy(),K.current=void 0}},[Q,F,_]),d.useEffect(()=>{if(Q||!_.current||!K.current)return;K.current.update({noDragClassName:J,handleSelector:q,domNode:_.current,isSelectable:G,nodeId:U,nodeClickDistance:Z})},[J,q,Q,G,_,U,Z]),X}var jU=(_)=>(Q)=>Q.selected&&(Q.draggable||_&&typeof Q.draggable>"u");function D9(){let _=S1();return d.useCallback((J)=>{let{nodeExtent:q,snapToGrid:U,snapGrid:G,nodesDraggable:Z,onError:F,updateNodePositions:X,nodeLookup:Y,nodeOrigin:K}=_.getState(),H=new Map,L=jU(Z),z=U?G[0]:5,W=U?G[1]:5,O=J.direction.x*z*J.factor,R=J.direction.y*W*J.factor;for(let[,B]of Y){if(!L(B))continue;let P={x:B.internals.positionAbsolute.x+O,y:B.internals.positionAbsolute.y+R};if(U)P=b2(P,G);let{position:A,positionAbsolute:T}=W6({nodeId:B.id,nextPosition:P,nodeLookup:Y,nodeExtent:q,nodeOrigin:K,onError:F});B.position=A,B.internals.positionAbsolute=T,H.set(B.id,B)}X(H)},[])}var h6=d.createContext(null),VU=h6.Provider;h6.Consumer;var E6=()=>{return d.useContext(h6)},uU=(_)=>({connectOnClick:_.connectOnClick,noPanClassName:_.noPanClassName,rfId:_.rfId}),h9=d.createContext(null);function bU({children:_}){let Q=T1(uU,C1);return i.jsx(h9.Provider,{value:Q,children:_})}function DU(){let _=d.useContext(h9);if(!_)throw Error("useHandleConfig must be used within a HandleConfigProvider");return _}var hU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},EU=(_,Q,J)=>(q)=>{let{connectionClickStartHandle:U,connectionMode:G,connection:Z}=q,{fromHandle:F,toHandle:X,isValid:Y}=Z;if(!F&&!U)return hU;let K=X?.nodeId===_&&X?.id===Q&&X?.type===J;return{connectingFrom:F?.nodeId===_&&F?.id===Q&&F?.type===J,connectingTo:K,clickConnecting:U?.nodeId===_&&U?.id===Q&&U?.type===J,isPossibleEndHandle:G===x0.Strict?F?.type!==J:_!==F?.nodeId||Q!==F?.id,connectionInProcess:!!F,clickConnectionInProcess:!!U,valid:K&&Y}};function xU({type:_="source",position:Q=Z1.Top,isValidConnection:J,isConnectable:q=!0,isConnectableStart:U=!0,isConnectableEnd:G=!0,id:Z,onConnect:F,children:X,className:Y,onMouseDown:K,onTouchStart:H,...L},z){let W=Z||null,O=_==="target",R=S1(),B=E6(),{connectOnClick:P,noPanClassName:A,rfId:T}=DU(),{connectingFrom:f,connectingTo:C,clickConnecting:w,isPossibleEndHandle:S,connectionInProcess:N,clickConnectionInProcess:y,valid:D}=T1(EU(B,W,_),C1);if(!B)R.getState().onError?.("010",a1.error010());let l=(b)=>{let{defaultEdgeOptions:j,onConnect:E,hasDefaultEdges:V}=R.getState(),h={...j,...b};if(V){let{edges:I,setEdges:v,onError:m}=R.getState();v(BU(h,I,{onError:m}))}E?.(h),F?.(h)},p=(b)=>{if(!B)return;let j=P6(b.nativeEvent);if(U&&(j&&b.button===0||!j)){let E=R.getState();B4.onPointerDown(b.nativeEvent,{handleDomNode:b.currentTarget,autoPanOnConnect:E.autoPanOnConnect,connectionMode:E.connectionMode,connectionRadius:E.connectionRadius,domNode:E.domNode,nodeLookup:E.nodeLookup,lib:E.lib,isTarget:O,handleId:W,nodeId:B,flowId:E.rfId,panBy:E.panBy,cancelConnection:E.cancelConnection,onConnectStart:E.onConnectStart,onConnectEnd:(...V)=>R.getState().onConnectEnd?.(...V),updateConnection:E.updateConnection,onConnect:l,isValidConnection:J||((...V)=>R.getState().isValidConnection?.(...V)??!0),getTransform:()=>R.getState().transform,getFromHandle:()=>R.getState().connection.fromHandle,autoPanSpeed:E.autoPanSpeed,dragThreshold:E.connectionDragThreshold})}if(j)K?.(b);else H?.(b)},k=(b)=>{let{onClickConnectStart:j,onClickConnectEnd:E,connectionClickStartHandle:V,connectionMode:h,isValidConnection:I,lib:v,rfId:m,nodeLookup:u,connection:n}=R.getState();if(!B||!V&&!U)return;if(!V){j?.(b.nativeEvent,{nodeId:B,handleId:W,handleType:_}),R.setState({connectionClickStartHandle:{nodeId:B,type:_,id:W}});return}let e=f6(b.target),t=J||I,{connection:a,isValid:g}=B4.isValid(b.nativeEvent,{handle:{nodeId:B,id:W,type:_},connectionMode:h,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:t,flowId:m,doc:e,lib:v,nodeLookup:u});if(g&&a)l(a);let J1=structuredClone(n);delete J1.inProgress,J1.toPosition=J1.toHandle?J1.toHandle.position:null,E?.(b,J1),R.setState({connectionClickStartHandle:null})};return i.jsx("div",{"data-handleid":W,"data-nodeid":B,"data-handlepos":Q,"data-id":`${T}-${B}-${W}-${_}`,className:v1(["react-flow__handle",`react-flow__handle-${Q}`,"nodrag",A,Y,{source:!O,target:O,connectable:q,connectablestart:U,connectableend:G,clickconnecting:w,connectingfrom:f,connectingto:C,valid:D,connectionindicator:q&&(!N||S)&&(N||y?G:U)}]),onMouseDown:p,onTouchStart:p,onClick:P?k:void 0,ref:z,...L,children:X})}var O4=d.memo(j9(xU));function mU({data:_,isConnectable:Q,sourcePosition:J=Z1.Bottom}){return i.jsxs(i.Fragment,{children:[_?.label,i.jsx(O4,{type:"source",position:J,isConnectable:Q})]})}function gU({data:_,isConnectable:Q,targetPosition:J=Z1.Top,sourcePosition:q=Z1.Bottom}){return i.jsxs(i.Fragment,{children:[i.jsx(O4,{type:"target",position:J,isConnectable:Q}),_?.label,i.jsx(O4,{type:"source",position:q,isConnectable:Q})]})}function pU(){return null}function cU({data:_,isConnectable:Q,targetPosition:J=Z1.Top}){return i.jsxs(i.Fragment,{children:[i.jsx(O4,{type:"target",position:J,isConnectable:Q}),_?.label]})}var I4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Y9={input:mU,default:gU,output:cU,group:pU};function lU(_){if(_.internals.handleBounds===void 0)return{width:_.width??_.initialWidth??_.style?.width,height:_.height??_.initialHeight??_.style?.height};return{width:_.width??_.style?.width,height:_.height??_.style?.height}}var rU=(_)=>{let{width:Q,height:J,x:q,y:U}=H2(_.nodeLookup,{filter:(G)=>!!G.selected});return{width:Q0(Q)?Q:null,height:Q0(J)?J:null,userSelectionActive:_.userSelectionActive,transformString:`translate(${_.transform[0]}px,${_.transform[1]}px) scale(${_.transform[2]}) translate(${q}px,${U}px)`}};function iU({onSelectionContextMenu:_,noPanClassName:Q,disableKeyboardA11y:J}){let q=S1(),{width:U,height:G,transformString:Z,userSelectionActive:F}=T1(rU,C1),X=D9(),Y=d.useRef(null);d.useEffect(()=>{if(!J)Y.current?.focus({preventScroll:!0})},[J]);let K=!F&&U!==null&&G!==null;if(b9({nodeRef:Y,disabled:!K}),!K)return null;let H=_?(z)=>{let W=q.getState().nodes.filter((O)=>O.selected);_(z,W)}:void 0,L=(z)=>{if(Object.prototype.hasOwnProperty.call(I4,z.key))z.preventDefault(),X({direction:I4[z.key],factor:z.shiftKey?4:1})};return i.jsx("div",{className:v1(["react-flow__nodesselection","react-flow__container",Q]),style:{transform:Z},children:i.jsx("div",{ref:Y,className:"react-flow__nodesselection-rect",onContextMenu:H,tabIndex:J?void 0:-1,onKeyDown:J?void 0:L,style:{width:U,height:G}})})}var L9=typeof window<"u"?window:void 0,dU=(_)=>{return{nodesSelectionActive:_.nodesSelectionActive,userSelectionActive:_.userSelectionActive}};function E9({children:_,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,paneClickDistance:F,deleteKeyCode:X,selectionKeyCode:Y,selectionOnDrag:K,selectionMode:H,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:W,panActivationKeyCode:O,zoomActivationKeyCode:R,elementsSelectable:B,zoomOnScroll:P,zoomOnPinch:A,panOnScroll:T,panOnScrollSpeed:f,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:S,autoPanOnSelection:N,defaultViewport:y,translateExtent:D,minZoom:l,maxZoom:p,preventScrolling:k,onSelectionContextMenu:b,noWheelClassName:j,noPanClassName:E,disableKeyboardA11y:V,onViewportChange:h,isControlledViewport:I}){let{nodesSelectionActive:v,userSelectionActive:m}=T1(dU,C1),u=f5(Y,{target:L9}),n=f5(O,{target:L9}),e=n||S,t=n||T,a=K&&e!==!0,g=u||m||a;return wU({deleteKeyCode:X,multiSelectionKeyCode:W}),i.jsx(CU,{onPaneContextMenu:G,elementsSelectable:B,zoomOnScroll:P,zoomOnPinch:A,panOnScroll:t,panActivationKeyPressed:n,panOnScrollSpeed:f,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:!u&&e,defaultViewport:y,translateExtent:D,minZoom:l,maxZoom:p,zoomActivationKeyCode:R,preventScrolling:k,noWheelClassName:j,noPanClassName:E,onViewportChange:h,isControlledViewport:I,paneClickDistance:F,selectionOnDrag:a,children:i.jsxs(yU,{onSelectionStart:L,onSelectionEnd:z,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,panOnDrag:e,autoPanOnSelection:N,isSelecting:!!g,selectionMode:H,selectionKeyPressed:u,paneClickDistance:F,selectionOnDrag:a,children:[_,v&&i.jsx(iU,{onSelectionContextMenu:b,noPanClassName:E,disableKeyboardA11y:V})]})})}E9.displayName="FlowRenderer";var aU=d.memo(E9),sU=(_)=>(Q)=>{return _?G4(Q.nodeLookup,{x:0,y:0,width:Q.width,height:Q.height},Q.transform,!0).map((J)=>J.id):Array.from(Q.nodeLookup.keys())};function tU(_){return T1(d.useCallback(sU(_),[_]),C1)}var oU=(_)=>_.updateNodeInternals;function nU(){let _=T1(oU),[Q]=d.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((J)=>{let q=new Map;J.forEach((U)=>{let G=U.target.getAttribute("data-id");q.set(G,{id:G,nodeElement:U.target,force:!0})}),_(q)})});return d.useEffect(()=>{return()=>{Q?.disconnect()}},[Q]),Q}function eU({node:_,nodeType:Q,hasDimensions:J,resizeObserver:q}){let U=S1(),G=d.useRef(null),Z=d.useRef(null),F=d.useRef(_.sourcePosition),X=d.useRef(_.targetPosition),Y=d.useRef(Q),K=J&&!!_.internals.handleBounds;return d.useEffect(()=>{if(G.current&&!_.hidden&&(!K||Z.current!==G.current)){if(Z.current)q?.unobserve(Z.current);q?.observe(G.current),Z.current=G.current}},[K,_.hidden]),d.useEffect(()=>{return()=>{if(Z.current)q?.unobserve(Z.current),Z.current=null}},[]),d.useEffect(()=>{if(G.current){let H=Y.current!==Q,L=F.current!==_.sourcePosition,z=X.current!==_.targetPosition;if(H||L||z)Y.current=Q,F.current=_.sourcePosition,X.current=_.targetPosition,U.getState().updateNodeInternals(new Map([[_.id,{id:_.id,nodeElement:G.current,force:!0}]]))}},[_.id,Q,_.sourcePosition,_.targetPosition]),G}function _G({id:_,onClick:Q,onMouseEnter:J,onMouseMove:q,onMouseLeave:U,onContextMenu:G,onDoubleClick:Z,nodesDraggable:F,elementsSelectable:X,nodesConnectable:Y,nodesFocusable:K,resizeObserver:H,noDragClassName:L,noPanClassName:z,disableKeyboardA11y:W,rfId:O,nodeTypes:R,nodeClickDistance:B,onError:P}){let{node:A,internals:T,isParent:f}=T1((g)=>{let J1=g.nodeLookup.get(_),G1=g.parentLookup.has(_);return{node:J1,internals:J1.internals,isParent:G1}},C1),C=A.type||"default",w=R?.[C]||Y9[C];if(w===void 0)P?.("003",a1.error003(C)),C="default",w=R?.default||Y9.default;let S=!!(A.draggable||F&&typeof A.draggable>"u"),N=!!(A.selectable||X&&typeof A.selectable>"u"),y=!!(A.connectable||Y&&typeof A.connectable>"u"),D=!!(A.focusable||K&&typeof A.focusable>"u"),l=S1(),p=T6(A),k=eU({node:A,nodeType:C,hasDimensions:p,resizeObserver:H}),b=b9({nodeRef:k,disabled:A.hidden||!S,noDragClassName:L,handleSelector:A.dragHandle,nodeId:_,isSelectable:N,nodeClickDistance:B}),j=D9();if(A.hidden)return null;let E=$0(A),V=lU(A),h=N||S||Q||J||q||U,I=J?(g)=>J(g,{...T.userNode}):void 0,v=q?(g)=>q(g,{...T.userNode}):void 0,m=U?(g)=>U(g,{...T.userNode}):void 0,u=G?(g)=>G(g,{...T.userNode}):void 0,n=Z?(g)=>Z(g,{...T.userNode}):void 0,e=(g)=>{let{selectNodesOnDrag:J1,nodeDragThreshold:G1}=l.getState();if(N&&(!J1||!S||G1>0))D6({id:_,store:l,nodeRef:k});if(Q)Q(g,{...T.userNode})},t=(g)=>{if(w6(g.nativeEvent)||W)return;if(H6.includes(g.key)&&N){let J1=g.key==="Escape";D6({id:_,store:l,unselect:J1,nodeRef:k})}else if(S&&A.selected&&Object.prototype.hasOwnProperty.call(I4,g.key)){g.preventDefault();let{ariaLabelConfig:J1}=l.getState();l.setState({ariaLiveMessage:J1["node.a11yDescription.ariaLiveMessage"]({direction:g.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),j({direction:I4[g.key],factor:g.shiftKey?4:1})}},a=()=>{if(W||!k.current?.matches(":focus-visible"))return;let{transform:g,width:J1,height:G1,autoPanOnNodeFocus:F1,setCenter:c}=l.getState();if(!F1)return;if(!(G4(new Map([[_,A]]),{x:0,y:0,width:J1,height:G1},g,!0).length>0))c(A.position.x+E.width/2,A.position.y+E.height/2,{zoom:g[2]})};return i.jsx("div",{className:v1(["react-flow__node",`react-flow__node-${C}`,{[z]:S},A.className,{selected:A.selected,selectable:N,parent:f,draggable:S,dragging:b}]),ref:k,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:h?"all":"none",visibility:p?"visible":"hidden",...A.style,...V},"data-id":_,"data-testid":`rf__node-${_}`,onMouseEnter:I,onMouseMove:v,onMouseLeave:m,onContextMenu:u,onClick:e,onDoubleClick:n,onKeyDown:D?t:void 0,tabIndex:D?0:void 0,onFocus:D?a:void 0,role:A.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":W?void 0:`${C9}-${O}`,"aria-label":A.ariaLabel,...A.domAttributes,children:i.jsx(VU,{value:_,children:i.jsx(w,{id:_,data:A.data,type:C,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:A.selected??!1,selectable:N,draggable:S,deletable:A.deletable??!0,isConnectable:y,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:b,dragHandle:A.dragHandle,zIndex:T.z,parentId:A.parentId,...E})})})}var QG=d.memo(_G),JG=(_)=>({nodesConnectable:_.nodesConnectable,nodesFocusable:_.nodesFocusable,elementsSelectable:_.elementsSelectable,onError:_.onError});function x9(_){let{nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,onError:U}=T1(JG,C1),G=tU(_.onlyRenderVisibleElements),Z=nU();return i.jsx("div",{className:"react-flow__nodes",style:w4,children:G.map((F)=>{return i.jsx(QG,{id:F,nodeTypes:_.nodeTypes,nodeExtent:_.nodeExtent,onClick:_.onNodeClick,onMouseEnter:_.onNodeMouseEnter,onMouseMove:_.onNodeMouseMove,onMouseLeave:_.onNodeMouseLeave,onContextMenu:_.onNodeContextMenu,onDoubleClick:_.onNodeDoubleClick,noDragClassName:_.noDragClassName,noPanClassName:_.noPanClassName,rfId:_.rfId,disableKeyboardA11y:_.disableKeyboardA11y,resizeObserver:Z,nodesDraggable:_.nodesDraggable??!0,nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,nodeClickDistance:_.nodeClickDistance,onError:U},F)})})}x9.displayName="NodeRenderer";var $G=d.memo(x9);function qG(_){return T1(d.useCallback((J)=>{if(!_)return J.edges.map((U)=>U.id);let q=[];if(J.width&&J.height)for(let U of J.edges){let G=J.nodeLookup.get(U.source),Z=J.nodeLookup.get(U.target);if(G&&Z&&R7({sourceNode:G,targetNode:Z,width:J.width,height:J.height,transform:J.transform}))q.push(U.id)}return q},[_]),C1)}var UG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_}};return i.jsx("polyline",{className:"arrow",style:J,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},GG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_,fill:_}};return i.jsx("polyline",{className:"arrowclosed",style:J,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},z9={[y2.Arrow]:UG,[y2.ArrowClosed]:GG};function ZG(_){let Q=S1();return d.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(z9,_))return Q.getState().onError?.("009",a1.error009(_)),null;return z9[_]},[_])}var FG=({id:_,type:Q,color:J,width:q=12.5,height:U=12.5,markerUnits:G="strokeWidth",strokeWidth:Z,orient:F="auto-start-reverse"})=>{let X=ZG(Q);if(!X)return null;return i.jsx("marker",{className:"react-flow__arrowhead",id:_,markerWidth:`${q}`,markerHeight:`${U}`,viewBox:"-10 -10 20 20",markerUnits:G,orient:F,refX:"0",refY:"0",children:i.jsx(X,{color:J,strokeWidth:Z})})},m9=({defaultColor:_,rfId:Q})=>{let J=T1((G)=>G.edges),q=T1((G)=>G.defaultEdgeOptions),U=d.useMemo(()=>{return f7(J,{id:Q,defaultColor:_,defaultMarkerStart:q?.markerStart,defaultMarkerEnd:q?.markerEnd})},[J,q,Q,_]);if(!U.length)return null;return i.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:i.jsx("defs",{children:U.map((G)=>i.jsx(FG,{id:G.id,type:G.type,color:G.color,width:G.width,height:G.height,markerUnits:G.markerUnits,strokeWidth:G.strokeWidth,orient:G.orient},G.id))})})};m9.displayName="MarkerDefinitions";var HG=d.memo(m9);function g9({x:_,y:Q,label:J,labelStyle:q,labelShowBg:U=!0,labelBgStyle:G,labelBgPadding:Z=[2,4],labelBgBorderRadius:F=2,children:X,className:Y,...K}){let[H,L]=d.useState({x:1,y:0,width:0,height:0}),z=v1(["react-flow__edge-textwrapper",Y]),W=d.useRef(null);if(d.useEffect(()=>{if(W.current){let O=W.current.getBBox();L({x:O.x,y:O.y,width:O.width,height:O.height})}},[J]),!J)return null;return i.jsxs("g",{transform:`translate(${_-H.width/2} ${Q-H.height/2})`,className:z,visibility:H.width?"visible":"hidden",...K,children:[U&&i.jsx("rect",{width:H.width+2*Z[0],x:-Z[0],y:-Z[1],height:H.height+2*Z[1],className:"react-flow__edge-textbg",style:G,rx:F,ry:F}),i.jsx("text",{className:"react-flow__edge-text",y:H.height/2,dy:"0.3em",ref:W,style:q,children:J}),X]})}g9.displayName="EdgeText";var KG=d.memo(g9);function P4({path:_,labelX:Q,labelY:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X,interactionWidth:Y=20,...K}){return i.jsxs(i.Fragment,{children:[i.jsx("path",{...K,d:_,fill:"none",className:v1(["react-flow__edge-path",K.className])}),Y?i.jsx("path",{d:_,fill:"none",strokeOpacity:0,strokeWidth:Y,className:"react-flow__edge-interaction"}):null,q&&Q0(Q)&&Q0(J)?i.jsx(KG,{x:Q,y:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X}):null]})}function W9({pos:_,x1:Q,y1:J,x2:q,y2:U}){if(_===Z1.Left||_===Z1.Right)return[0.5*(Q+q),J];return[Q,0.5*(J+U)]}function p9({sourceX:_,sourceY:Q,sourcePosition:J=Z1.Bottom,targetX:q,targetY:U,targetPosition:G=Z1.Top}){let[Z,F]=W9({pos:J,x1:_,y1:Q,x2:q,y2:U}),[X,Y]=W9({pos:G,x1:q,y1:U,x2:_,y2:Q}),[K,H,L,z]=X4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:Z,sourceControlY:F,targetControlX:X,targetControlY:Y});return[`M${_},${Q} C${Z},${F} ${X},${Y} ${q},${U}`,K,H,L,z]}function c9(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z,targetPosition:F,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:R,interactionWidth:B})=>{let[P,A,T]=p9({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F}),f=_.isInternal?void 0:Q;return i.jsx(P4,{id:f,path:P,labelX:A,labelY:T,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:R,interactionWidth:B})})}var XG=c9({isInternal:!1}),l9=c9({isInternal:!0});XG.displayName="SimpleBezierEdge";l9.displayName="SimpleBezierEdgeInternal";function r9(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,sourcePosition:z=Z1.Bottom,targetPosition:W=Z1.Top,markerEnd:O,markerStart:R,pathOptions:B,interactionWidth:P})=>{let[A,T,f]=I5({sourceX:J,sourceY:q,sourcePosition:z,targetX:U,targetY:G,targetPosition:W,borderRadius:B?.borderRadius,offset:B?.offset,stepPosition:B?.stepPosition}),C=_.isInternal?void 0:Q;return i.jsx(P4,{id:C,path:A,labelX:T,labelY:f,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:O,markerStart:R,interactionWidth:P})})}var i9=r9({isInternal:!1}),d9=r9({isInternal:!0});i9.displayName="SmoothStepEdge";d9.displayName="SmoothStepEdgeInternal";function a9(_){return d.memo(({id:Q,...J})=>{let q=_.isInternal?void 0:Q;return i.jsx(i9,{...J,id:q,pathOptions:d.useMemo(()=>({borderRadius:0,offset:J.pathOptions?.offset}),[J.pathOptions?.offset])})})}var YG=a9({isInternal:!1}),s9=a9({isInternal:!0});YG.displayName="StepEdge";s9.displayName="StepEdgeInternal";function t9(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:z,markerStart:W,interactionWidth:O})=>{let[R,B,P]=L4({sourceX:J,sourceY:q,targetX:U,targetY:G}),A=_.isInternal?void 0:Q;return i.jsx(P4,{id:A,path:R,labelX:B,labelY:P,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:z,markerStart:W,interactionWidth:O})})}var LG=t9({isInternal:!1}),o9=t9({isInternal:!0});LG.displayName="StraightEdge";o9.displayName="StraightEdgeInternal";function n9(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z=Z1.Bottom,targetPosition:F=Z1.Top,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:R,pathOptions:B,interactionWidth:P})=>{let[A,T,f]=Y4({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F,curvature:B?.curvature}),C=_.isInternal?void 0:Q;return i.jsx(P4,{id:C,path:A,labelX:T,labelY:f,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:R,interactionWidth:P})})}var zG=n9({isInternal:!1}),e9=n9({isInternal:!0});zG.displayName="BezierEdge";e9.displayName="BezierEdgeInternal";var A9={default:e9,straight:o9,step:s9,smoothstep:d9,simplebezier:l9},B9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},WG=(_,Q,J)=>{if(J===Z1.Left)return _-Q;if(J===Z1.Right)return _+Q;return _},AG=(_,Q,J)=>{if(J===Z1.Top)return _-Q;if(J===Z1.Bottom)return _+Q;return _},M9="react-flow__edgeupdater";function T9({position:_,centerX:Q,centerY:J,radius:q=10,onMouseDown:U,onMouseEnter:G,onMouseOut:Z,type:F}){return i.jsx("circle",{onMouseDown:U,onMouseEnter:G,onMouseOut:Z,className:v1([M9,`${M9}-${F}`]),cx:WG(Q,q,_),cy:AG(J,q,_),r:q,stroke:"transparent",fill:"transparent"})}function BG({isReconnectable:_,reconnectRadius:Q,edge:J,sourceX:q,sourceY:U,targetX:G,targetY:Z,sourcePosition:F,targetPosition:X,onReconnect:Y,onReconnectStart:K,onReconnectEnd:H,setReconnecting:L,setUpdateHover:z}){let W=S1(),O=(T,f)=>{if(T.button!==0)return;let{autoPanOnConnect:C,domNode:w,connectionMode:S,connectionRadius:N,lib:y,onConnectStart:D,cancelConnection:l,nodeLookup:p,rfId:k,panBy:b,updateConnection:j}=W.getState(),E=f.type==="target",V=(v,m)=>{L(!1),H?.(v,J,f.type,m)},h=(v)=>Y?.(J,v),I=(v,m)=>{L(!0),K?.(T,J,f.type),D?.(v,m)};B4.onPointerDown(T.nativeEvent,{autoPanOnConnect:C,connectionMode:S,connectionRadius:N,domNode:w,handleId:f.id,nodeId:f.nodeId,nodeLookup:p,isTarget:E,edgeUpdaterType:f.type,lib:y,flowId:k,cancelConnection:l,panBy:b,isValidConnection:(...v)=>W.getState().isValidConnection?.(...v)??!0,onConnect:h,onConnectStart:I,onConnectEnd:(...v)=>W.getState().onConnectEnd?.(...v),onReconnectEnd:V,updateConnection:j,getTransform:()=>W.getState().transform,getFromHandle:()=>W.getState().connection.fromHandle,dragThreshold:W.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},R=(T)=>O(T,{nodeId:J.target,id:J.targetHandle??null,type:"target"}),B=(T)=>O(T,{nodeId:J.source,id:J.sourceHandle??null,type:"source"}),P=()=>z(!0),A=()=>z(!1);return i.jsxs(i.Fragment,{children:[(_===!0||_==="source")&&i.jsx(T9,{position:F,centerX:q,centerY:U,radius:Q,onMouseDown:R,onMouseEnter:P,onMouseOut:A,type:"source"}),(_===!0||_==="target")&&i.jsx(T9,{position:X,centerX:G,centerY:Z,radius:Q,onMouseDown:B,onMouseEnter:P,onMouseOut:A,type:"target"})]})}function MG({id:_,edgesFocusable:Q,edgesReconnectable:J,elementsSelectable:q,onClick:U,onDoubleClick:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:z,rfId:W,edgeTypes:O,noPanClassName:R,onError:B,disableKeyboardA11y:P}){let A=T1((c)=>c.edgeLookup.get(_)),T=T1((c)=>c.defaultEdgeOptions);A=T?{...T,...A}:A;let f=A.type||"default",C=O?.[f]||A9[f];if(C===void 0)B?.("011",a1.error011(f)),f="default",C=O?.default||A9.default;let w=!!(A.focusable||Q&&typeof A.focusable>"u"),S=typeof H<"u"&&(A.reconnectable||J&&typeof A.reconnectable>"u"),N=!!(A.selectable||q&&typeof A.selectable>"u"),y=d.useRef(null),[D,l]=d.useState(!1),[p,k]=d.useState(!1),b=S1(),{zIndex:j=A.zIndex,sourceX:E,sourceY:V,targetX:h,targetY:I,sourcePosition:v,targetPosition:m}=T1(d.useCallback((c)=>{let s=c.nodeLookup.get(A.source),_1=c.nodeLookup.get(A.target);if(!s||!_1)return B9;let q1=I7({id:_,sourceNode:s,targetNode:_1,sourceHandle:A.sourceHandle||null,targetHandle:A.targetHandle||null,connectionMode:c.connectionMode,onError:B}),o=T7({selected:A.selected,zIndex:A.zIndex,sourceNode:s,targetNode:_1,elevateOnSelect:c.elevateEdgesOnSelect,zIndexMode:c.zIndexMode});return{...q1||B9,zIndex:o}},[A.source,A.target,A.sourceHandle,A.targetHandle,A.selected,A.zIndex,B]),C1),u=d.useMemo(()=>A.markerStart?`url('#${z4(A.markerStart,W)}')`:void 0,[A.markerStart,W]),n=d.useMemo(()=>A.markerEnd?`url('#${z4(A.markerEnd,W)}')`:void 0,[A.markerEnd,W]);if(A.hidden||E===null||V===null||h===null||I===null)return null;let e=(c)=>{let{addSelectedEdges:s,unselectNodesAndEdges:_1,multiSelectionActive:q1}=b.getState();if(N)if(b.setState({nodesSelectionActive:!1}),A.selected&&q1)_1({nodes:[],edges:[A]}),y.current?.blur();else s([_]);if(U)U(c,A)},t=G?(c)=>{G(c,{...A})}:void 0,a=Z?(c)=>{Z(c,{...A})}:void 0,g=F?(c)=>{F(c,{...A})}:void 0,J1=X?(c)=>{X(c,{...A})}:void 0,G1=Y?(c)=>{Y(c,{...A})}:void 0,F1=(c)=>{if(!P&&H6.includes(c.key)&&N){let{unselectNodesAndEdges:s,addSelectedEdges:_1}=b.getState();if(c.key==="Escape")y.current?.blur(),s({edges:[A]});else _1([_])}};return i.jsx("svg",{style:{zIndex:j},children:i.jsxs("g",{className:v1(["react-flow__edge",`react-flow__edge-${f}`,A.className,R,{selected:A.selected,animated:A.animated,inactive:!N&&!U,updating:D,selectable:N}]),onClick:e,onDoubleClick:t,onContextMenu:a,onMouseEnter:g,onMouseMove:J1,onMouseLeave:G1,onKeyDown:w?F1:void 0,tabIndex:w?0:void 0,role:A.ariaRole??(w?"group":"img"),"aria-roledescription":"edge","data-id":_,"data-testid":`rf__edge-${_}`,"aria-label":A.ariaLabel===null?void 0:A.ariaLabel||`Edge from ${A.source} to ${A.target}`,"aria-describedby":w?`${S9}-${W}`:void 0,ref:y,...A.domAttributes,children:[!p&&i.jsx(C,{id:_,source:A.source,target:A.target,type:A.type,selected:A.selected,animated:A.animated,selectable:N,deletable:A.deletable??!0,label:A.label,labelStyle:A.labelStyle,labelShowBg:A.labelShowBg,labelBgStyle:A.labelBgStyle,labelBgPadding:A.labelBgPadding,labelBgBorderRadius:A.labelBgBorderRadius,sourceX:E,sourceY:V,targetX:h,targetY:I,sourcePosition:v,targetPosition:m,data:A.data,style:A.style,sourceHandleId:A.sourceHandle,targetHandleId:A.targetHandle,markerStart:u,markerEnd:n,pathOptions:"pathOptions"in A?A.pathOptions:void 0,interactionWidth:A.interactionWidth}),S&&i.jsx(BG,{edge:A,isReconnectable:S,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:z,sourceX:E,sourceY:V,targetX:h,targetY:I,sourcePosition:v,targetPosition:m,setUpdateHover:l,setReconnecting:k})]})})}var TG=d.memo(MG),RG=(_)=>({edgesFocusable:_.edgesFocusable,edgesReconnectable:_.edgesReconnectable,elementsSelectable:_.elementsSelectable,connectionMode:_.connectionMode,onError:_.onError});function __({defaultMarkerColor:_,onlyRenderVisibleElements:Q,rfId:J,edgeTypes:q,noPanClassName:U,onReconnect:G,onEdgeContextMenu:Z,onEdgeMouseEnter:F,onEdgeMouseMove:X,onEdgeMouseLeave:Y,onEdgeClick:K,reconnectRadius:H,onEdgeDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,disableKeyboardA11y:O}){let{edgesFocusable:R,edgesReconnectable:B,elementsSelectable:P,onError:A}=T1(RG,C1),T=qG(Q);return i.jsxs("div",{className:"react-flow__edges",children:[i.jsx(HG,{defaultColor:_,rfId:J}),T.map((f)=>{return i.jsx(TG,{id:f,edgesFocusable:R,edgesReconnectable:B,elementsSelectable:P,noPanClassName:U,onReconnect:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,onClick:K,reconnectRadius:H,onDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,rfId:J,onError:A,edgeTypes:q,disableKeyboardA11y:O},f)})]})}__.displayName="EdgeRenderer";var OG=d.memo(__),R9=(_)=>`translate(${_[0]}px,${_[1]}px) scale(${_[2]})`;function IG({children:_}){let Q=S1(),J=d.useRef(null),[q]=d.useState(()=>Q.getState().transform);return V9(()=>{let U=null,G=()=>{let Z=Q.getState().transform;if(U&&Z[0]===U[0]&&Z[1]===U[1]&&Z[2]===U[2])return;if(U=Z,J.current)J.current.style.transform=R9(Z)};return G(),Q.subscribe(G)},[Q]),i.jsx("div",{ref:J,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:R9(q)},children:_})}function fG(_){let Q=w5(),J=d.useRef(!1);d.useEffect(()=>{if(!J.current&&Q.viewportInitialized&&_)setTimeout(()=>_(Q),1),J.current=!0},[_,Q.viewportInitialized])}var wG=(_)=>_.panZoom?.syncViewport;function PG(_){let Q=T1(wG),J=S1();return d.useEffect(()=>{if(_)Q?.(_),J.setState({transform:[_.x,_.y,_.zoom]})},[_,Q]),null}function O9(_){return _.connection.inProgress?{..._.connection,to:D2(_.connection.to,_.transform)}:{..._.connection}}function NG(_){if(_)return(J)=>{let q=O9(J);return _(q)};return O9}function CG(_){let Q=NG(_);return T1(Q,C1)}var SG=(_)=>({nodesConnectable:_.nodesConnectable,isValid:_.connection.isValid,inProgress:_.connection.inProgress,width:_.width,height:_.height});function kG({containerStyle:_,style:Q,type:J,component:q}){let{nodesConnectable:U,width:G,height:Z,isValid:F,inProgress:X}=T1(SG,C1);if(!(G&&U&&X))return null;return i.jsx("svg",{style:_,width:G,height:Z,className:"react-flow__connectionline react-flow__container",children:i.jsx("g",{className:v1(["react-flow__connection",I6(F)]),children:i.jsx(Q_,{style:Q,type:J,CustomComponent:q,isValid:F})})})}var Q_=({style:_,type:Q=B0.Bezier,CustomComponent:J,isValid:q})=>{let{inProgress:U,from:G,fromNode:Z,fromHandle:F,fromPosition:X,to:Y,toNode:K,toHandle:H,toPosition:L,pointer:z}=CG();if(!U)return;if(J)return i.jsx(J,{connectionLineType:Q,connectionLineStyle:_,fromNode:Z,fromHandle:F,fromX:G.x,fromY:G.y,toX:Y.x,toY:Y.y,fromPosition:X,toPosition:L,connectionStatus:I6(q),toNode:K,toHandle:H,pointer:z});let W="",O={sourceX:G.x,sourceY:G.y,sourcePosition:X,targetX:Y.x,targetY:Y.y,targetPosition:L};switch(Q){case B0.Bezier:[W]=Y4(O);break;case B0.SimpleBezier:[W]=p9(O);break;case B0.Step:[W]=I5({...O,borderRadius:0});break;case B0.SmoothStep:[W]=I5(O);break;default:[W]=L4(O)}return i.jsx("path",{d:W,fill:"none",className:"react-flow__connection-path",style:_})};Q_.displayName="ConnectionLine";var vG={};function I9(_=vG){let Q=d.useRef(_),J=S1();d.useEffect(()=>{{let q=new Set([...Object.keys(Q.current),...Object.keys(_)]);for(let U of q)if(Q.current[U]!==_[U]){J.getState().onError?.("002",a1.error002());break}Q.current=_}},[_])}function yG(){let _=S1(),Q=d.useRef(!1);d.useEffect(()=>{if(!Q.current){let J=document.querySelector(".react-flow__pane");if(J&&window.getComputedStyle(J).zIndex!=="1")_.getState().onError?.("013",a1.error013("react"));Q.current=!0}},[])}function J_({nodeTypes:_,edgeTypes:Q,onInit:J,onNodeClick:q,onEdgeClick:U,onNodeDoubleClick:G,onEdgeDoubleClick:Z,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,onSelectionContextMenu:H,onSelectionStart:L,onSelectionEnd:z,connectionLineType:W,connectionLineStyle:O,connectionLineComponent:R,connectionLineContainerStyle:B,selectionKeyCode:P,selectionOnDrag:A,selectionMode:T,multiSelectionKeyCode:f,panActivationKeyCode:C,zoomActivationKeyCode:w,deleteKeyCode:S,onlyRenderVisibleElements:N,elementsSelectable:y,defaultViewport:D,translateExtent:l,minZoom:p,maxZoom:k,preventScrolling:b,defaultMarkerColor:j,zoomOnScroll:E,zoomOnPinch:V,panOnScroll:h,panOnScrollSpeed:I,panOnScrollMode:v,zoomOnDoubleClick:m,panOnDrag:u,autoPanOnSelection:n,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:a,onPaneMouseLeave:g,onPaneScroll:J1,onPaneContextMenu:G1,paneClickDistance:F1,nodeClickDistance:c,onEdgeContextMenu:s,onEdgeMouseEnter:_1,onEdgeMouseMove:q1,onEdgeMouseLeave:o,reconnectRadius:K1,onReconnect:$1,onReconnectStart:M1,onReconnectEnd:R1,noDragClassName:x1,noWheelClassName:U0,noPanClassName:k1,disableKeyboardA11y:R0,nodeExtent:t1,rfId:e1,viewport:_0,onViewportChange:X0,nodesDraggable:T2}){return I9(_),I9(Q),yG(),fG(J),PG(_0),i.jsx(aU,{onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:a,onPaneMouseLeave:g,onPaneContextMenu:G1,onPaneScroll:J1,paneClickDistance:F1,deleteKeyCode:S,selectionKeyCode:P,selectionOnDrag:A,selectionMode:T,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:f,panActivationKeyCode:C,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:E,zoomOnPinch:V,zoomOnDoubleClick:m,panOnScroll:h,panOnScrollSpeed:I,panOnScrollMode:v,panOnDrag:u,autoPanOnSelection:n,defaultViewport:D,translateExtent:l,minZoom:p,maxZoom:k,onSelectionContextMenu:H,preventScrolling:b,noDragClassName:x1,noWheelClassName:U0,noPanClassName:k1,disableKeyboardA11y:R0,onViewportChange:X0,isControlledViewport:!!_0,children:i.jsxs(IG,{children:[i.jsx(OG,{edgeTypes:Q,onEdgeClick:U,onEdgeDoubleClick:Z,onReconnect:$1,onReconnectStart:M1,onReconnectEnd:R1,onlyRenderVisibleElements:N,onEdgeContextMenu:s,onEdgeMouseEnter:_1,onEdgeMouseMove:q1,onEdgeMouseLeave:o,reconnectRadius:K1,defaultMarkerColor:j,noPanClassName:k1,disableKeyboardA11y:R0,rfId:e1}),i.jsx(kG,{style:O,type:W,component:R,containerStyle:B}),i.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsx($G,{nodeTypes:_,onNodeClick:q,onNodeDoubleClick:G,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,nodeClickDistance:c,onlyRenderVisibleElements:N,noPanClassName:k1,noDragClassName:x1,disableKeyboardA11y:R0,nodeExtent:t1,rfId:e1,nodesDraggable:T2}),i.jsx("div",{className:"react-flow__viewport-portal"})]})})}J_.displayName="GraphView";var jG=d.memo(J_),VG=M6("React Flow","https://reactflow.dev/"),f9=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X=0.5,maxZoom:Y=2,nodeOrigin:K,nodeExtent:H,zIndexMode:L="basic"}={})=>{let z=new Map,W=new Map,O=new Map,R=new Map,B=q??Q??[],P=J??_??[],A=K??[0,0],T=H??V2;y6(O,R,B);let{nodesInitialized:f}=W4(P,z,W,{nodeOrigin:A,nodeExtent:T,zIndexMode:L}),C=[0,0,1];if(Z&&U&&G){let w=H2(z,{filter:(D)=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:S,y:N,zoom:y}=O5(w,U,G,X,Y,F?.padding??0.1);C=[S,N,y]}return{rfId:"1",width:U??0,height:G??0,transform:C,nodes:P,nodesInitialized:f,nodeLookup:z,parentLookup:W,edges:B,edgeLookup:R,connectionLookup:O,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:J!==void 0,hasDefaultEdges:q!==void 0,panZoom:null,minZoom:X,maxZoom:Y,translateExtent:V2,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:x0.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:A,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:Z??!1,fitViewOptions:F,fitViewResolver:null,connection:{...X6},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:VG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:K6,zIndexMode:L,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},uG=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L})=>s7((z,W)=>{async function O(){let{nodeLookup:R,panZoom:B,fitViewOptions:P,fitViewResolver:A,width:T,height:f,minZoom:C,maxZoom:w}=W();if(!B)return;await Y7({nodes:R,width:T,height:f,panZoom:B,minZoom:C,maxZoom:w},P),A?.resolve(!0),z({fitViewResolver:null})}return{...f9({nodes:_,edges:Q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,defaultNodes:J,defaultEdges:q,zIndexMode:L}),setNodes:(R)=>{let{nodeLookup:B,parentLookup:P,nodeOrigin:A,nodeExtent:T,elevateNodesOnSelect:f,fitViewQueued:C,zIndexMode:w,nodesSelectionActive:S}=W(),{nodesInitialized:N,hasSelectedNodes:y}=W4(R,B,P,{nodeOrigin:A,nodeExtent:T,elevateNodesOnSelect:f,checkEquality:!0,zIndexMode:w}),D=S&&y;if(C&&N)O(),z({nodes:R,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D});else z({nodes:R,nodesInitialized:N,nodesSelectionActive:D})},setEdges:(R)=>{let{connectionLookup:B,edgeLookup:P}=W();y6(B,P,R),z({edges:R})},setDefaultNodesAndEdges:(R,B)=>{if(R){let{setNodes:P}=W();P(R),z({hasDefaultNodes:!0})}if(B){let{setEdges:P}=W();P(B),z({hasDefaultEdges:!0})}},updateNodeInternals:(R)=>{let{triggerNodeChanges:B,nodeLookup:P,parentLookup:A,domNode:T,nodeOrigin:f,nodeExtent:C,debug:w,fitViewQueued:S,zIndexMode:N}=W(),{changes:y,updatedInternals:D}=S7(R,P,A,T,f,C,N);if(!D)return;if(N7(P,A,{nodeOrigin:f,nodeExtent:C,zIndexMode:N}),S)O(),z({fitViewQueued:!1,fitViewOptions:void 0});else z({});if(y?.length>0){if(w)console.log("React Flow: trigger node changes",y);B?.(y)}},updateNodePositions:(R,B=!1)=>{let P=[],A=[],{nodeLookup:T,triggerNodeChanges:f,connection:C,updateConnection:w,onNodesChangeMiddlewareMap:S}=W();for(let[N,y]of R){let D=T.get(N),l=!!(D?.expandParent&&D?.parentId&&y?.position),p={id:N,type:"position",position:l?{x:Math.max(0,y.position.x),y:Math.max(0,y.position.y)}:y.position,dragging:B};if(D&&C.inProgress&&C.fromNode.id===D.id){let k=m0(D,C.fromHandle,Z1.Left,!0);w({...C,from:k})}if(l&&D.parentId)P.push({id:N,parentId:D.parentId,rect:{...y.internals.positionAbsolute,width:y.measured.width??0,height:y.measured.height??0}});A.push(p)}if(P.length>0){let{parentLookup:N,nodeOrigin:y}=W(),D=A4(P,T,N,y);A.push(...D)}for(let N of S.values())A=N(A);f(A)},triggerNodeChanges:(R)=>{let{onNodesChange:B,setNodes:P,nodes:A,hasDefaultNodes:T,debug:f}=W();if(R?.length){if(T){let C=y9(R,A);P(C)}if(f)console.log("React Flow: trigger node changes",R);B?.(R)}},triggerEdgeChanges:(R)=>{let{onEdgesChange:B,setEdges:P,edges:A,hasDefaultEdges:T,debug:f}=W();if(R?.length){if(T){let C=WU(R,A);P(C)}if(f)console.log("React Flow: trigger edge changes",R);B?.(R)}},addSelectedNodes:(R)=>{let{multiSelectionActive:B,edgeLookup:P,nodeLookup:A,triggerNodeChanges:T,triggerEdgeChanges:f}=W();if(B){let C=R.map((w)=>K2(w,!0));T(C);return}T(E2(A,new Set([...R]),!0)),f(E2(P))},addSelectedEdges:(R)=>{let{multiSelectionActive:B,edgeLookup:P,nodeLookup:A,triggerNodeChanges:T,triggerEdgeChanges:f}=W();if(B){let C=R.map((w)=>K2(w,!0));f(C);return}f(E2(P,new Set([...R]))),T(E2(A,new Set,!0))},unselectNodesAndEdges:({nodes:R,edges:B}={})=>{let{edges:P,nodes:A,nodeLookup:T,triggerNodeChanges:f,triggerEdgeChanges:C}=W(),w=R?R:A,S=B?B:P,N=[];for(let D of w){if(!D.selected)continue;let l=T.get(D.id);if(l)l.selected=!1;N.push(K2(D.id,!1))}let y=[];for(let D of S){if(!D.selected)continue;y.push(K2(D.id,!1))}f(N),C(y)},setMinZoom:(R)=>{let{panZoom:B,maxZoom:P}=W();B?.setScaleExtent([R,P]),z({minZoom:R})},setMaxZoom:(R)=>{let{panZoom:B,minZoom:P}=W();B?.setScaleExtent([P,R]),z({maxZoom:R})},setTranslateExtent:(R)=>{W().panZoom?.setTranslateExtent(R),z({translateExtent:R})},resetSelectedElements:()=>{let{edges:R,nodes:B,triggerNodeChanges:P,triggerEdgeChanges:A,elementsSelectable:T}=W();if(!T)return;let f=B.reduce((w,S)=>S.selected?[...w,K2(S.id,!1)]:w,[]),C=R.reduce((w,S)=>S.selected?[...w,K2(S.id,!1)]:w,[]);P(f),A(C)},setNodeExtent:(R)=>{let{nodes:B,nodeLookup:P,parentLookup:A,nodeOrigin:T,elevateNodesOnSelect:f,nodeExtent:C,zIndexMode:w}=W();if(R[0][0]===C[0][0]&&R[0][1]===C[0][1]&&R[1][0]===C[1][0]&&R[1][1]===C[1][1])return;W4(B,P,A,{nodeOrigin:T,nodeExtent:R,elevateNodesOnSelect:f,checkEquality:!1,zIndexMode:w}),z({nodeExtent:R})},panBy:(R)=>{let{transform:B,width:P,height:A,panZoom:T,translateExtent:f}=W();return k7({delta:R,panZoom:T,transform:B,translateExtent:f,width:P,height:A})},setCenter:async(R,B,P)=>{let{width:A,height:T,maxZoom:f,panZoom:C}=W();if(!C)return!1;let w=typeof P?.zoom<"u"?P.zoom:f;return await C.setViewport({x:A/2-R*w,y:T/2-B*w,zoom:w},{duration:P?.duration,ease:P?.ease,interpolate:P?.interpolate}),!0},cancelConnection:()=>{z({connection:{...X6}})},updateConnection:(R)=>{z({connection:R})},reset:()=>z({...f9()})}},Object.is);function x6({initialNodes:_,initialEdges:Q,defaultNodes:J,defaultEdges:q,initialWidth:U,initialHeight:G,initialMinZoom:Z,initialMaxZoom:F,initialFitViewOptions:X,fitView:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L,children:z}){let[W]=d.useState(()=>uG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Y,minZoom:Z,maxZoom:F,fitViewOptions:X,nodeOrigin:K,nodeExtent:H,zIndexMode:L}));return i.jsx(sq,{value:W,children:i.jsx(RU,{children:i.jsx(bU,{children:z})})})}function bG({children:_,nodes:Q,edges:J,defaultNodes:q,defaultEdges:U,width:G,height:Z,fitView:F,fitViewOptions:X,minZoom:Y,maxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:z}){if(d.useContext(f4))return i.jsx(i.Fragment,{children:_});return i.jsx(x6,{initialNodes:Q,initialEdges:J,defaultNodes:q,defaultEdges:U,initialWidth:G,initialHeight:Z,fitView:F,initialFitViewOptions:X,initialMinZoom:Y,initialMaxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:z,children:_})}var DG={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function hG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,className:U,nodeTypes:G,edgeTypes:Z,onNodeClick:F,onEdgeClick:X,onInit:Y,onMove:K,onMoveStart:H,onMoveEnd:L,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:R,onClickConnectEnd:B,onNodeMouseEnter:P,onNodeMouseMove:A,onNodeMouseLeave:T,onNodeContextMenu:f,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:S,onNodeDragStop:N,onNodesDelete:y,onEdgesDelete:D,onDelete:l,onSelectionChange:p,onSelectionDragStart:k,onSelectionDrag:b,onSelectionDragStop:j,onSelectionContextMenu:E,onSelectionStart:V,onSelectionEnd:h,onBeforeDelete:I,connectionMode:v,connectionLineType:m=B0.Bezier,connectionLineStyle:u,connectionLineComponent:n,connectionLineContainerStyle:e,deleteKeyCode:t="Backspace",selectionKeyCode:a="Shift",selectionOnDrag:g=!1,selectionMode:J1=U2.Full,panActivationKeyCode:G1="Space",multiSelectionKeyCode:F1=h2()?"Meta":"Control",zoomActivationKeyCode:c=h2()?"Meta":"Control",snapToGrid:s,snapGrid:_1,onlyRenderVisibleElements:q1=!1,selectNodesOnDrag:o,nodesDraggable:K1,autoPanOnNodeFocus:$1,nodesConnectable:M1,nodesFocusable:R1,nodeOrigin:x1=k9,edgesFocusable:U0,edgesReconnectable:k1,elementsSelectable:R0=!0,defaultViewport:t1=FU,minZoom:e1=0.5,maxZoom:_0=2,translateExtent:X0=V2,preventScrolling:T2=!0,nodeExtent:y0,defaultMarkerColor:R2="#b1b1b7",zoomOnScroll:O2=!0,zoomOnPinch:r2=!0,panOnScroll:V5=!1,panOnScrollSpeed:d0=0.5,panOnScrollMode:M=P0.Free,zoomOnDoubleClick:x=!0,panOnDrag:Q1=!0,onPaneClick:U1,onPaneMouseEnter:H1,onPaneMouseMove:W1,onPaneMouseLeave:z1,onPaneScroll:P1,onPaneContextMenu:A1,paneClickDistance:Y0=1,nodeClickDistance:j0=0,children:u4,onReconnect:b4,onReconnectStart:_Q,onReconnectEnd:QQ,onEdgeContextMenu:JQ,onEdgeDoubleClick:$Q,onEdgeMouseEnter:qQ,onEdgeMouseMove:UQ,onEdgeMouseLeave:GQ,reconnectRadius:ZQ=10,onNodesChange:FQ,onEdgesChange:HQ,noDragClassName:KQ="nodrag",noWheelClassName:XQ="nowheel",noPanClassName:J8="nopan",fitView:$8,fitViewOptions:q8,connectOnClick:YQ,attributionPosition:LQ,proOptions:zQ,defaultEdgeOptions:WQ,elevateNodesOnSelect:AQ=!0,elevateEdgesOnSelect:BQ=!1,disableKeyboardA11y:U8=!1,autoPanOnConnect:MQ,autoPanOnNodeDrag:TQ,autoPanOnSelection:RQ=!0,autoPanSpeed:OQ,connectionRadius:IQ,isValidConnection:fQ,onError:wQ,style:PQ,id:G8,nodeDragThreshold:NQ,connectionDragThreshold:CQ,viewport:SQ,onViewportChange:kQ,width:vQ,height:yQ,colorMode:jQ="light",debug:VQ,onScroll:Z8,ariaLabelConfig:uQ,zIndexMode:F8="basic",...bQ},DQ){let D4=G8||"1",hQ=YU(jQ),EQ=d.useCallback((H8)=>{H8.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Z8?.(H8)},[Z8]);return i.jsx("div",{"data-testid":"rf__wrapper",...bQ,onScroll:EQ,style:{...PQ,...DG},ref:DQ,className:v1(["react-flow",U,hQ]),id:G8,role:"application",children:i.jsxs(bG,{nodes:_,edges:Q,width:vQ,height:yQ,fitView:$8,fitViewOptions:q8,minZoom:e1,maxZoom:_0,nodeOrigin:x1,nodeExtent:y0,zIndexMode:F8,children:[i.jsx(XU,{nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:R,onClickConnectEnd:B,nodesDraggable:K1,autoPanOnNodeFocus:$1,nodesConnectable:M1,nodesFocusable:R1,edgesFocusable:U0,edgesReconnectable:k1,elementsSelectable:R0,elevateNodesOnSelect:AQ,elevateEdgesOnSelect:BQ,minZoom:e1,maxZoom:_0,nodeExtent:y0,onNodesChange:FQ,onEdgesChange:HQ,snapToGrid:s,snapGrid:_1,connectionMode:v,translateExtent:X0,connectOnClick:YQ,defaultEdgeOptions:WQ,fitView:$8,fitViewOptions:q8,onNodesDelete:y,onEdgesDelete:D,onDelete:l,onNodeDragStart:w,onNodeDrag:S,onNodeDragStop:N,onSelectionDrag:b,onSelectionDragStart:k,onSelectionDragStop:j,onMove:K,onMoveStart:H,onMoveEnd:L,noPanClassName:J8,nodeOrigin:x1,rfId:D4,autoPanOnConnect:MQ,autoPanOnNodeDrag:TQ,autoPanSpeed:OQ,onError:wQ,connectionRadius:IQ,isValidConnection:fQ,selectNodesOnDrag:o,nodeDragThreshold:NQ,connectionDragThreshold:CQ,onBeforeDelete:I,debug:VQ,ariaLabelConfig:uQ,zIndexMode:F8}),i.jsx(jG,{onInit:Y,onNodeClick:F,onEdgeClick:X,onNodeMouseEnter:P,onNodeMouseMove:A,onNodeMouseLeave:T,onNodeContextMenu:f,onNodeDoubleClick:C,nodeTypes:G,edgeTypes:Z,connectionLineType:m,connectionLineStyle:u,connectionLineComponent:n,connectionLineContainerStyle:e,selectionKeyCode:a,selectionOnDrag:g,selectionMode:J1,deleteKeyCode:t,multiSelectionKeyCode:F1,panActivationKeyCode:G1,zoomActivationKeyCode:c,onlyRenderVisibleElements:q1,defaultViewport:t1,translateExtent:X0,minZoom:e1,maxZoom:_0,preventScrolling:T2,zoomOnScroll:O2,zoomOnPinch:r2,zoomOnDoubleClick:x,panOnScroll:V5,panOnScrollSpeed:d0,panOnScrollMode:M,panOnDrag:Q1,autoPanOnSelection:RQ,onPaneClick:U1,onPaneMouseEnter:H1,onPaneMouseMove:W1,onPaneMouseLeave:z1,onPaneScroll:P1,onPaneContextMenu:A1,paneClickDistance:Y0,nodeClickDistance:j0,onSelectionContextMenu:E,onSelectionStart:V,onSelectionEnd:h,onReconnect:b4,onReconnectStart:_Q,onReconnectEnd:QQ,onEdgeContextMenu:JQ,onEdgeDoubleClick:$Q,onEdgeMouseEnter:qQ,onEdgeMouseMove:UQ,onEdgeMouseLeave:GQ,reconnectRadius:ZQ,defaultMarkerColor:R2,noDragClassName:KQ,noWheelClassName:XQ,noPanClassName:J8,rfId:D4,disableKeyboardA11y:U8,nodeExtent:y0,viewport:SQ,onViewportChange:kQ,nodesDraggable:K1}),i.jsx(ZU,{onSelectionChange:p}),u4,i.jsx(JU,{proOptions:zQ,position:LQ}),i.jsx(QU,{rfId:D4,disableKeyboardA11y:U8})]})})}var $_=j9(hG);function q_(_){let[Q,J]=d.useState(_),q=d.useCallback((U)=>J((G)=>y9(U,G)),[]);return[Q,J,q]}var yB=a1.error014();function EG({dimensions:_,lineWidth:Q,variant:J,className:q}){return i.jsx("path",{strokeWidth:Q,d:`M${_[0]/2} 0 V${_[1]} M0 ${_[1]/2} H${_[0]}`,className:v1(["react-flow__background-pattern",J,q])})}function xG({radius:_,className:Q}){return i.jsx("circle",{cx:_,cy:_,r:_,className:v1(["react-flow__background-pattern","dots",Q])})}var M0;(function(_){_.Lines="lines",_.Dots="dots",_.Cross="cross"})(M0||(M0={}));var mG={[M0.Dots]:1,[M0.Lines]:1,[M0.Cross]:6},gG=(_)=>({transform:_.transform,patternId:`pattern-${_.rfId}`});function U_({id:_,variant:Q=M0.Dots,gap:J=20,size:q,lineWidth:U=1,offset:G=0,color:Z,bgColor:F,style:X,className:Y,patternClassName:K}){let H=d.useRef(null),{transform:L,patternId:z}=T1(gG,C1),W=q||mG[Q],O=Q===M0.Dots,R=Q===M0.Cross,B=Array.isArray(J)?J:[J,J],P=[B[0]*L[2]||1,B[1]*L[2]||1],A=W*L[2],T=Array.isArray(G)?G:[G,G],f=R?[A,A]:P,C=[T[0]*L[2]+f[0]/2,T[1]*L[2]+f[1]/2],w=`${z}${_?_:""}`;return i.jsxs("svg",{className:v1(["react-flow__background",Y]),style:{...X,...w4,"--xy-background-color-props":F,"--xy-background-pattern-color-props":Z},ref:H,"data-testid":"rf__background",children:[i.jsx("pattern",{id:w,x:L[0]%P[0],y:L[1]%P[1],width:P[0],height:P[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:O?i.jsx(xG,{radius:A/2,className:K}):i.jsx(EG,{dimensions:f,lineWidth:U,variant:Q,className:K})}),i.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${w})`})]})}U_.displayName="Background";var G_=d.memo(U_);function pG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:i.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function cG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:i.jsx("path",{d:"M0 0h32v4.2H0z"})})}function lG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:i.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 rG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.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 iG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.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 R4({children:_,className:Q,...J}){return i.jsx("button",{type:"button",className:v1(["react-flow__controls-button",Q]),...J,children:_})}var dG=(_)=>({isInteractive:_.nodesDraggable||_.nodesConnectable||_.elementsSelectable,minZoomReached:_.transform[2]<=_.minZoom,maxZoomReached:_.transform[2]>=_.maxZoom,ariaLabelConfig:_.ariaLabelConfig});function Z_({style:_,showZoom:Q=!0,showFitView:J=!0,showInteractive:q=!0,fitViewOptions:U,onZoomIn:G,onZoomOut:Z,onFitView:F,onInteractiveChange:X,className:Y,children:K,position:H="bottom-left",orientation:L="vertical","aria-label":z}){let W=S1(),{isInteractive:O,minZoomReached:R,maxZoomReached:B,ariaLabelConfig:P}=T1(dG,C1),{zoomIn:A,zoomOut:T,fitView:f}=w5(),C=()=>{A(),G?.()},w=()=>{T(),Z?.()},S=()=>{f(U),F?.()},N=()=>{W.setState({nodesDraggable:!O,nodesConnectable:!O,elementsSelectable:!O}),X?.(!O)};return i.jsxs(X2,{className:v1(["react-flow__controls",L==="horizontal"?"horizontal":"vertical",Y]),position:H,style:_,"data-testid":"rf__controls","aria-label":z??P["controls.ariaLabel"],children:[Q&&i.jsxs(i.Fragment,{children:[i.jsx(R4,{onClick:C,className:"react-flow__controls-zoomin",title:P["controls.zoomIn.ariaLabel"],"aria-label":P["controls.zoomIn.ariaLabel"],disabled:B,children:i.jsx(pG,{})}),i.jsx(R4,{onClick:w,className:"react-flow__controls-zoomout",title:P["controls.zoomOut.ariaLabel"],"aria-label":P["controls.zoomOut.ariaLabel"],disabled:R,children:i.jsx(cG,{})})]}),J&&i.jsx(R4,{className:"react-flow__controls-fitview",onClick:S,title:P["controls.fitView.ariaLabel"],"aria-label":P["controls.fitView.ariaLabel"],children:i.jsx(lG,{})}),q&&i.jsx(R4,{className:"react-flow__controls-interactive",onClick:N,title:P["controls.interactive.ariaLabel"],"aria-label":P["controls.interactive.ariaLabel"],children:O?i.jsx(iG,{}):i.jsx(rG,{})}),K]})}Z_.displayName="Controls";var F_=d.memo(Z_);function aG({id:_,x:Q,y:J,width:q,height:U,style:G,color:Z,strokeColor:F,strokeWidth:X,className:Y,borderRadius:K,shapeRendering:H,selected:L,onClick:z}){let{background:W,backgroundColor:O}=G||{},R=Z||W||O;return i.jsx("rect",{className:v1(["react-flow__minimap-node",{selected:L},Y]),x:Q,y:J,rx:K,ry:K,width:q,height:U,style:{fill:R,stroke:F,strokeWidth:X},shapeRendering:H,onClick:z?(B)=>z(B,_):void 0})}var sG=d.memo(aG),tG=(_)=>_.nodes.map((Q)=>Q.id),b6=(_)=>_ instanceof Function?_:()=>_;function oG({nodeStrokeColor:_,nodeColor:Q,nodeClassName:J="",nodeBorderRadius:q=5,nodeStrokeWidth:U,nodeComponent:G=sG,onClick:Z}){let F=T1(tG,C1),X=b6(Q),Y=b6(_),K=b6(J),H=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return i.jsx(i.Fragment,{children:F.map((L)=>i.jsx(eG,{id:L,nodeColorFunc:X,nodeStrokeColorFunc:Y,nodeClassNameFunc:K,nodeBorderRadius:q,nodeStrokeWidth:U,NodeComponent:G,onClick:Z,shapeRendering:H},L))})}function nG({id:_,nodeColorFunc:Q,nodeStrokeColorFunc:J,nodeClassNameFunc:q,nodeBorderRadius:U,nodeStrokeWidth:G,shapeRendering:Z,NodeComponent:F,onClick:X}){let{node:Y,x:K,y:H,width:L,height:z}=T1((W)=>{let O=W.nodeLookup.get(_);if(!O)return{node:void 0,x:0,y:0,width:0,height:0};let R=O.internals.userNode,{x:B,y:P}=O.internals.positionAbsolute,{width:A,height:T}=$0(R);return{node:R,x:B,y:P,width:A,height:T}},C1);if(!Y||Y.hidden||!T6(Y))return null;return i.jsx(F,{x:K,y:H,width:L,height:z,style:Y.style,selected:!!Y.selected,className:q(Y),color:Q(Y),borderRadius:U,strokeColor:J(Y),strokeWidth:G,shapeRendering:Z,onClick:X,id:Y.id})}var eG=d.memo(nG),_Z=d.memo(oG),QZ=200,JZ=150,$Z=(_)=>!_.hidden,qZ=(_)=>{let Q={x:-_.transform[0]/_.transform[2],y:-_.transform[1]/_.transform[2],width:_.width/_.transform[2],height:_.height/_.transform[2]},J=!1;for(let q of _.nodeLookup.values())if(!q.hidden){J=!0;break}return{viewBB:Q,boundingRect:J?A6(H2(_.nodeLookup,{filter:$Z}),Q):Q,rfId:_.rfId,panZoom:_.panZoom,translateExtent:_.translateExtent,flowWidth:_.width,flowHeight:_.height,ariaLabelConfig:_.ariaLabelConfig}},w9=(_,Q)=>_.x===Q.x&&_.y===Q.y&&_.width===Q.width&&_.height===Q.height,UZ=(_,Q)=>w9(_.viewBB,Q.viewBB)&&w9(_.boundingRect,Q.boundingRect)&&_.rfId===Q.rfId&&_.panZoom===Q.panZoom&&_.translateExtent===Q.translateExtent&&_.flowWidth===Q.flowWidth&&_.flowHeight===Q.flowHeight&&_.ariaLabelConfig===Q.ariaLabelConfig,GZ="react-flow__minimap-desc";function H_({style:_,className:Q,nodeStrokeColor:J,nodeColor:q,nodeClassName:U="",nodeBorderRadius:G=5,nodeStrokeWidth:Z,nodeComponent:F,bgColor:X,maskColor:Y,maskStrokeColor:K,maskStrokeWidth:H,position:L="bottom-right",onClick:z,onNodeClick:W,pannable:O=!1,zoomable:R=!1,ariaLabel:B,inversePan:P,zoomStep:A=1,offsetScale:T=5}){let f=S1(),C=d.useRef(null),{boundingRect:w,panZoom:S,viewBB:N,rfId:y,translateExtent:D,flowWidth:l,flowHeight:p,ariaLabelConfig:k}=T1(qZ,UZ),b=_?.width??QZ,j=_?.height??JZ,E=w.width/b,V=w.height/j,h=Math.max(E,V),I=h*b,v=h*j,m=T*h,u=w.x-(I-w.width)/2-m,n=w.y-(v-w.height)/2-m,e=I+m*2,t=v+m*2,a=`${GZ}-${y}`,g=d.useRef(0),J1=d.useRef();g.current=h,d.useEffect(()=>{let _1=f.getState().panZoom;if(C.current&&_1)return J1.current=D7({domNode:C.current,panZoom:_1,getTransform:()=>f.getState().transform,getViewScale:()=>g.current}),()=>{J1.current?.destroy()}},[S]),d.useEffect(()=>{J1.current?.update({translateExtent:D,width:l,height:p,inversePan:P,pannable:O,zoomStep:A,zoomable:R})},[O,R,P,A,D,l,p]);let G1=z?(_1)=>{let[q1,o]=J1.current?.pointer(_1)||[0,0];z(_1,{x:q1,y:o})}:void 0,F1=d.useCallback((_1,q1)=>{let o=f.getState().nodeLookup.get(q1).internals.userNode;W?.(_1,o)},[W]),c=W?F1:void 0,s=B??k["minimap.ariaLabel"];return i.jsx(X2,{position:L,style:{..._,"--xy-minimap-background-color-props":typeof X==="string"?X:void 0,"--xy-minimap-mask-background-color-props":typeof Y==="string"?Y:void 0,"--xy-minimap-mask-stroke-color-props":typeof K==="string"?K:void 0,"--xy-minimap-mask-stroke-width-props":typeof H==="number"?H*h:void 0,"--xy-minimap-node-background-color-props":typeof q==="string"?q:void 0,"--xy-minimap-node-stroke-color-props":typeof J==="string"?J:void 0,"--xy-minimap-node-stroke-width-props":typeof Z==="number"?Z:void 0},className:v1(["react-flow__minimap",Q]),"data-testid":"rf__minimap",children:i.jsxs("svg",{width:b,height:j,viewBox:`${u} ${n} ${e} ${t}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":a,ref:C,onClick:G1,children:[s&&i.jsx("title",{id:a,children:s}),i.jsx(_Z,{onClick:c,nodeColor:q,nodeStrokeColor:J,nodeBorderRadius:G,nodeClassName:U,nodeStrokeWidth:Z,nodeComponent:F}),i.jsx("path",{className:"react-flow__minimap-mask",d:`M${u-m},${n-m}h${e+m*2}v${t+m*2}h${-e-m*2}z
|
|
34
|
+
M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}H_.displayName="MiniMap";var K_=d.memo(H_),ZZ=(_)=>(Q)=>_?`${Math.max(1/Q.transform[2],1)}`:void 0,FZ={[g0.Line]:"right",[g0.Handle]:"bottom-right"};function HZ({nodeId:_,position:Q,variant:J=g0.Handle,className:q,style:U=void 0,children:G,color:Z,minWidth:F=10,minHeight:X=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:K=Number.MAX_VALUE,keepAspectRatio:H=!1,resizeDirection:L,autoScale:z=!0,shouldResize:W,onResizeStart:O,onResize:R,onResizeEnd:B}){let P=E6(),A=typeof _==="string"?_:P,T=S1(),f=d.useRef(null),C=J===g0.Handle,w=T1(d.useCallback(ZZ(C&&z),[C,z]),C1),S=d.useRef(null),N=Q??FZ[J];d.useEffect(()=>{if(!f.current||!A)return;if(!S.current)S.current=g7({domNode:f.current,nodeId:A,getStoreItems:()=>{let{nodeLookup:D,transform:l,snapGrid:p,snapToGrid:k,nodeOrigin:b,domNode:j}=T.getState();return{nodeLookup:D,transform:l,snapGrid:p,snapToGrid:k,nodeOrigin:b,paneDomNode:j}},onChange:(D,l)=>{let{triggerNodeChanges:p,nodeLookup:k,parentLookup:b,nodeOrigin:j}=T.getState(),E=[],V={x:D.x,y:D.y},h=k.get(A);if(h&&h.expandParent&&h.parentId){let I=h.origin??j,v=D.width??h.measured.width??0,m=D.height??h.measured.height??0,u={id:h.id,parentId:h.parentId,rect:{width:v,height:m,...R6({x:D.x??h.position.x,y:D.y??h.position.y},{width:v,height:m},h.parentId,k,I)}},n=A4([u],k,b,j);E.push(...n),V.x=D.x?Math.max(I[0]*v,D.x):void 0,V.y=D.y?Math.max(I[1]*m,D.y):void 0}if(V.x!==void 0&&V.y!==void 0){let I={id:A,type:"position",position:{...V}};E.push(I)}if(D.width!==void 0&&D.height!==void 0){let v={id:A,type:"dimensions",resizing:!0,setAttributes:!L?!0:L==="horizontal"?"width":"height",dimensions:{width:D.width,height:D.height}};E.push(v)}for(let I of l){let v={...I,type:"position"};E.push(v)}p(E)},onEnd:({width:D,height:l})=>{let p={id:A,type:"dimensions",resizing:!1,dimensions:{width:D,height:l}};T.getState().triggerNodeChanges([p])}});return S.current.update({controlPosition:N,boundaries:{minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K},keepAspectRatio:H,resizeDirection:L,onResizeStart:O,onResize:R,onResizeEnd:B,shouldResize:W}),()=>{S.current?.destroy()}},[N,F,X,Y,K,H,O,R,B,W]);let y=N.split("-");return i.jsx("div",{className:v1(["react-flow__resize-control","nodrag",...y,J,q]),ref:f,style:{...U,scale:w,...Z&&{[C?"backgroundColor":"borderColor"]:Z}},children:G})}var jB=d.memo(HZ);var KZ=(_)=>_.domNode?.querySelector(".react-flow__renderer");function XZ({children:_}){let Q=T1(KZ);if(!Q)return null;return P9.createPortal(_,Q)}var YZ=(_,Q)=>_?.internals.positionAbsolute.x!==Q?.internals.positionAbsolute.x||_?.internals.positionAbsolute.y!==Q?.internals.positionAbsolute.y||_?.measured.width!==Q?.measured.width||_?.measured.height!==Q?.measured.height||_?.selected!==Q?.selected||_?.internals.z!==Q?.internals.z,LZ=(_,Q)=>{if(_.size!==Q.size)return!1;for(let[J,q]of _)if(YZ(q,Q.get(J)))return!1;return!0},zZ=(_)=>({x:_.transform[0],y:_.transform[1],zoom:_.transform[2],selectedNodesCount:_.nodes.filter((Q)=>Q.selected).length});function X_({nodeId:_,children:Q,className:J,style:q,isVisible:U,position:G=Z1.Top,offset:Z=10,align:F="center",...X}){let Y=E6(),K=d.useCallback((f)=>{return(Array.isArray(_)?_:[_||Y||""]).reduce((S,N)=>{let y=f.nodeLookup.get(N);if(y)S.set(y.id,y);return S},new Map)},[_,Y]),H=T1(K,LZ),{x:L,y:z,zoom:W,selectedNodesCount:O}=T1(zZ,C1);if(!(typeof U==="boolean"?U:H.size===1&&H.values().next().value?.selected&&O===1)||!H.size)return null;let B=H2(H),P=Array.from(H.values()),A=Math.max(...P.map((f)=>f.internals.z+1)),T={position:"absolute",transform:w7(B,{x:L,y:z,zoom:W},G,Z,F),zIndex:A,...q};return i.jsx(XZ,{children:i.jsx("div",{style:T,className:v1(["react-flow__node-toolbar",J]),...X,"data-id":P.reduce((f,C)=>`${f}${C.id} `,"").trim(),children:Q})})}var m1=g1(L0(),1);var Y_={x:{title:"X",fill:"currentColor",d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"},youtube:{title:"YouTube",fill:"#FF0000",d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},tiktok:{title:"TikTok",fill:"currentColor",d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"},discord:{title:"Discord",fill:"#5865F2",d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},resend:{title:"Resend",fill:"currentColor",d:"M2.023 0v24h5.553v-8.434h2.998L15.326 24h6.65l-5.372-9.258a7.652 7.652 0 0 0 3.316-3.016c.709-1.21 1.062-2.57 1.062-4.08 0-1.462-.353-2.767-1.062-3.91-.709-1.165-1.692-2.079-2.95-2.742C15.737.331 14.355 0 12.823 0Zm5.553 4.87h4.219c.731 0 1.349.125 1.851.376.526.252.925.618 1.2 1.098.274.457.412.994.412 1.611S15.132 9.12 14.88 9.6c-.229.48-.572.856-1.03 1.13-.434.252-.948.38-1.542.38H7.576Z"},linkedin:{title:"LinkedIn",fill:"#0A66C2",d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"},reddit:{title:"Reddit",fill:"#FF4500",d:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},bluesky:{title:"Bluesky",fill:"#0285FF",d:"M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479.815 2.736 3.713 3.66 6.383 3.364.136-.02.275-.039.415-.056-.138.022-.276.04-.415.056-3.912.58-7.387 2.005-2.83 7.078 5.013 5.19 6.87-1.113 7.823-4.308.953 3.195 2.05 9.271 7.733 4.308 4.267-4.308 1.172-6.498-2.74-7.078a8.741 8.741 0 0 1-.415-.056c.14.017.279.036.415.056 2.67.297 5.568-.628 6.383-3.364.246-.828.624-5.79.624-6.478 0-.69-.139-1.861-.902-2.206-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8Z"},instagram:{title:"Instagram",fill:"#FF0069",d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"},github:{title:"GitHub",fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},stripe:{title:"Stripe",fill:"#635BFF",d:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},slack:{title:"Slack",fill:"#4A154B",d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},openai:{title:"OpenAI",fill:"#412991",d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"},anthropic:{title:"Anthropic",fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"},twilio:{title:"Twilio",fill:"#F22F46",d:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},sendgrid:{title:"SendGrid",fill:"#51A9E3",d:"M.8 24h13.6c.88 0 1.6-.72 1.6-1.6v-4.8c0-.88-.72-1.6-1.6-1.6H9.6c-.88 0-1.6-.72-1.6-1.6V9.6C8 8.72 7.28 8 6.4 8H1.6C.72 8 0 8.72 0 9.6v13.6c0 .44.36.8.8.8zM23.2 0H9.6C8.72 0 8 .72 8 1.6v4.8C8 7.28 8.72 8 9.6 8h4.8c.88 0 1.6.72 1.6 1.6v4.8c0 .88.72 1.6 1.6 1.6h4.8c.88 0 1.6-.72 1.6-1.6V.8c0-.44-.36-.8-.8-.8Z"},mailgun:{title:"Mailgun",fill:"#F06B66",d:"M11.837 0c6.602 0 11.984 5.381 11.984 11.994-.017 2.99-3.264 4.84-5.844 3.331a3.805 3.805 0 0 1-.06-.035l-.055-.033-.022.055c-2.554 4.63-9.162 4.758-11.894.232-2.732-4.527.46-10.313 5.746-10.416a6.868 6.868 0 0 1 7.002 6.866 1.265 1.265 0 0 0 2.52 0c0-5.18-4.197-9.38-9.377-9.387C4.611 2.594.081 10.41 3.683 16.673c3.238 5.632 11.08 6.351 15.289 1.402l1.997 1.686A11.95 11.95 0 0 1 11.837 24C2.6 23.72-2.87 13.543 1.992 5.684A12.006 12.006 0 0 1 11.837 0Zm0 7.745c-3.276-.163-5.5 3.281-4.003 6.2a4.26 4.26 0 0 0 4.014 2.31c3.276-.171 5.137-3.824 3.35-6.575a4.26 4.26 0 0 0-3.36-1.935Zm0 2.53c1.324 0 2.152 1.433 1.49 2.58a1.72 1.72 0 0 1-1.49.86 1.72 1.72 0 1 1 0-3.44Z"},notion:{title:"Notion",fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},linear:{title:"Linear",fill:"#5E6AD2",d:"M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"},jira:{title:"Jira",fill:"#0052CC",d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"},hubspot:{title:"HubSpot",fill:"#FF7A59",d:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z"},paypal:{title:"PayPal",fill:"#003087",d:"M7.016 19.198h-4.2a.562.562 0 0 1-.555-.65L5.093.584A.692.692 0 0 1 5.776 0h7.222c3.417 0 5.904 2.488 5.846 5.5-.006.25-.027.5-.066.747A6.794 6.794 0 0 1 12.071 12H8.743a.69.69 0 0 0-.682.583l-.325 2.056-.013.083-.692 4.39-.015.087zM19.79 6.142c-.01.087-.01.175-.023.261a7.76 7.76 0 0 1-7.695 6.598H9.007l-.283 1.795-.013.083-.692 4.39-.134.843-.014.088H6.86l-.497 3.15a.562.562 0 0 0 .555.65h3.612c.34 0 .63-.249.683-.585l.952-6.031a.692.692 0 0 1 .683-.584h2.126a6.793 6.793 0 0 0 6.707-5.752c.306-1.95-.466-3.744-1.89-4.906z"},shopify:{title:"Shopify",fill:"#7AB55C",d:"M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z"},sentry:{title:"Sentry",fill:"#362D59",d:"M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z"},vercel:{title:"Vercel",fill:"currentColor",d:"M24 22.525H0l12-21.05 12 21.05z"},supabase:{title:"Supabase",fill:"#3FCF8E",d:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"},clerk:{title:"Clerk",fill:"#6C47FF",d:"m21.47 20.829-2.881-2.881a.572.572 0 0 0-.7-.084 6.854 6.854 0 0 1-7.081 0 .576.576 0 0 0-.7.084l-2.881 2.881a.576.576 0 0 0-.103.69.57.57 0 0 0 .166.186 12 12 0 0 0 14.113 0 .58.58 0 0 0 .239-.423.576.576 0 0 0-.172-.453Zm.002-17.668-2.88 2.88a.569.569 0 0 1-.701.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0-1.222 3.692 6.86 6.86 0 0 0 .978 3.764.573.573 0 0 1-.083.699l-2.881 2.88a.567.567 0 0 1-.864-.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637-.405.566.566 0 0 1 .232.418.57.57 0 0 1-.168.448Zm-7.118 12.261a3.427 3.427 0 1 0 0-6.854 3.427 3.427 0 0 0 0 6.854Z"},aws:{title:"Amazon Web Services",fill:"#232F3E",d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"},figma:{title:"Figma",fill:"#F24E1E",d:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},airtable:{title:"Airtable",fill:"#18BFFF",d:"M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z"},intercom:{title:"Intercom",fill:"#6AFDEF",d:"M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z"},posthog:{title:"PostHog",fill:"currentColor",d:"M9.854 14.5 5 9.647.854 5.5A.5.5 0 0 0 0 5.854V8.44a.5.5 0 0 0 .146.353L5 13.647l.147.146L9.854 18.5l.146.147v-.049c.065.03.134.049.207.049h2.586a.5.5 0 0 0 .353-.854L9.854 14.5zm0-5-4-4a.487.487 0 0 0-.409-.144.515.515 0 0 0-.356.21.493.493 0 0 0-.089.288V8.44a.5.5 0 0 0 .147.353l9 9a.5.5 0 0 0 .853-.354v-2.585a.5.5 0 0 0-.146-.354l-5-5zm1-4a.5.5 0 0 0-.854.354V8.44a.5.5 0 0 0 .147.353l4 4a.5.5 0 0 0 .853-.354V9.854a.5.5 0 0 0-.146-.354l-4-4zm12.647 11.515a3.863 3.863 0 0 1-2.232-1.1l-4.708-4.707a.5.5 0 0 0-.854.354v6.585a.5.5 0 0 0 .5.5H23.5a.5.5 0 0 0 .5-.5v-.6c0-.276-.225-.497-.499-.532zm-5.394.032a.8.8 0 1 1 0-1.6.8.8 0 0 1 0 1.6zM.854 15.5a.5.5 0 0 0-.854.354v2.293a.5.5 0 0 0 .5.5h2.293c.222 0 .39-.135.462-.309a.493.493 0 0 0-.109-.545L.854 15.501zM5 14.647.854 10.5a.5.5 0 0 0-.854.353v2.586a.5.5 0 0 0 .146.353L4.854 18.5l.146.147h2.793a.5.5 0 0 0 .353-.854L5 14.647z"},datadog:{title:"Datadog",fill:"#632CA6",d:"M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"},algolia:{title:"Algolia",fill:"#003DFF",d:"M12 0C5.445 0 .103 5.285.01 11.817c-.097 6.634 5.285 12.131 11.92 12.17a11.91 11.91 0 0 0 5.775-1.443.281.281 0 0 0 .052-.457l-1.122-.994a.79.79 0 0 0-.833-.14 9.693 9.693 0 0 1-3.923.77c-5.36-.067-9.692-4.527-9.607-9.888.084-5.293 4.417-9.573 9.73-9.573h9.73v17.296l-5.522-4.907a.407.407 0 0 0-.596.063 4.52 4.52 0 0 1-3.934 1.793 4.538 4.538 0 0 1-4.192-4.168 4.53 4.53 0 0 1 4.512-4.872 4.532 4.532 0 0 1 4.509 4.126c.018.205.11.397.265.533l1.438 1.275a.28.28 0 0 0 .462-.158 6.82 6.82 0 0 0 .099-1.725c-.232-3.376-2.966-6.092-6.345-6.3-3.873-.24-7.11 2.79-7.214 6.588-.1 3.7 2.933 6.892 6.634 6.974a6.75 6.75 0 0 0 4.136-1.294l7.212 6.394a.48.48 0 0 0 .797-.36V.456A.456.456 0 0 0 23.54 0Z"},cloudflare:{title:"Cloudflare",fill:"#F38020",d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"},upstash:{title:"Upstash",fill:"#00E9A3",d:"M13.8027 0C11.193 0 8.583.9952 6.5918 2.9863c-3.9823 3.9823-3.9823 10.4396 0 14.4219 1.9911 1.9911 5.2198 1.9911 7.211 0 1.991-1.9911 1.991-5.2198 0-7.211L12 12c.9956.9956.9956 2.6098 0 3.6055-.9956.9955-2.6099.9955-3.6055 0-2.9866-2.9868-2.9866-7.8297 0-10.8164 2.9868-2.9868 7.8297-2.9868 10.8164 0l1.8028-1.8028C19.0225.9952 16.4125 0 13.8027 0zM12 12c-.9956-.9956-.9956-2.6098 0-3.6055.9956-.9955 2.6098-.9955 3.6055 0 2.9867 2.9868 2.9867 7.8297 0 10.8164-2.9867 2.9868-7.8297 2.9868-10.8164 0l-1.8028 1.8028c3.9823 3.9822 10.4396 3.9822 14.4219 0 3.9823-3.9824 3.9823-10.4396 0-14.4219-.9956-.9956-2.3006-1.4922-3.6055-1.4922-1.3048 0-2.6099.4966-3.6054 1.4922-1.9912 1.9912-1.9912 5.2198 0 7.211z"},mixpanel:{title:"Mixpanel",fill:"#7856FF",d:"M6.967 9.996h3.053c-.763-.477-1.048-1.145-1.431-2.384L7.443 3.366C6.919 1.458 6.49.551 4.39.551H.004v1.145h.621c1.286 0 1.431.477 1.814 1.908L3.44 7.326c.524 1.814 1.337 2.67 3.53 2.67h-.003Zm7.06 0h3.053c2.194 0 2.956-.86 3.484-2.67l1.001-3.722c.382-1.431.57-1.908 1.814-1.908H24V.551h-4.34c-2.146 0-2.576.86-3.053 2.815l-1.145 4.246c-.384 1.286-.673 1.907-1.435 2.384Zm-4.007 4.008h4.007V9.996H10.02v4.008ZM0 23.449h4.39c2.1 0 2.529-.907 3.053-2.815l1.146-4.246c.383-1.239.668-1.907 1.431-2.384H6.967c-2.194 0-3.007.86-3.531 2.67l-1.001 3.722c-.383 1.431-.524 1.907-1.814 1.907H0v1.146Zm19.65 0h4.343v-1.146h-.622c-1.239 0-1.431-.476-1.814-1.907l-1.001-3.722c-.524-1.814-1.286-2.67-3.483-2.67h-3.046c.762.477 1.041 1.098 1.424 2.384l1.145 4.246c.477 1.955.907 2.815 3.054 2.815Z"},gemini:{title:"Google Gemini",fill:"#8E75B2",d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"}};var X1=g1(P5(),1),AZ="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function N5({href:_,onClick:Q}){return X1.jsxDEV("h1",{children:X1.jsxDEV("a",{href:_,onClick:Q,children:[X1.jsxDEV("img",{src:AZ,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),X1.jsxDEV("span",{className:"brand-name",children:" Volter World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}async function C0(_){return(await _.json().catch(()=>({}))).error??`answered ${_.status}`}function z_(_,Q,J=0,q=""){let[U,G]=m1.useState({state:"loading"});return m1.useEffect(()=>{G({state:"loading"})},[q,Q]),m1.useEffect(()=>{if(!Q)return;let Z=!0;return(async()=>{try{let F=await _(Q),X=F.ok?{state:"ok",data:await F.json()}:{state:"error",status:F.status,error:await C0(F)};if(Z)G(X)}catch(F){if(Z)G({state:"error",status:0,error:String(F)})}})(),()=>{Z=!1}},[q,Q,J]),U}function r1({load:_,what:Q,retry:J,lines:q=3}){if(_.state==="loading")return X1.jsxDEV(BZ,{lines:q,label:`Loading ${Q}…`},void 0,!1,void 0,this);if(_.state==="error")return X1.jsxDEV("div",{role:"alert",className:"error-state",children:[X1.jsxDEV("span",{children:["Could not read ",Q,": ",_.error]},void 0,!0,void 0,this),J?X1.jsxDEV("button",{type:"button",onClick:J,children:"Try again"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return null}function BZ({lines:_=3,label:Q="Loading…"}){return X1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":Q,children:Array.from({length:_},(J,q)=>X1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][q%5]}%`}},q,!1,void 0,this))},void 0,!1,void 0,this)}function w1({iso:_,time:Q}){if(!_)return X1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let J=new Date(_);return X1.jsxDEV("time",{dateTime:_,title:_,children:Number.isNaN(J.getTime())?_:Q?J.toLocaleTimeString():J.toLocaleString()},void 0,!1,void 0,this)}var p6=(_)=>_?new Date(_).toLocaleString():"—";function c6(_){let Q=_?Date.parse(_):Number.NaN;if(Number.isNaN(Q))return"—";let J=Math.max(0,Math.round((Date.now()-Q)/1000));return J<60?"just now":J<3600?`${Math.round(J/60)}m ago`:J<86400?`${Math.round(J/3600)}h ago`:`${Math.round(J/86400)}d ago`}function V1(_,Q){let J=Q.replace(/[_-]+/g," "),q=J.endsWith("s")?J:/[^aeiou]y$/.test(J)?`${J.slice(0,-1)}ies`:/(ch|sh|x)$/.test(J)?`${J}es`:`${J}s`;return`${_} ${_===1?J:q}`}var L2=(_)=>_.length<=1?_.join(""):`${_.slice(0,-1).join(", ")} and ${_[_.length-1]}`,MZ={github:"GitHub",openai:"OpenAI",aws:"AWS",hubspot:"HubSpot",paypal:"PayPal",youtube:"YouTube",tiktok:"TikTok",linkedin:"LinkedIn",xai:"xAI",sendgrid:"SendGrid",elevenlabs:"ElevenLabs",assemblyai:"AssemblyAI",planetscale:"PlanetScale",googleoauth:"Google sign-in",npm:"npm","npm-registry":"npm registry",posthog:"PostHog",mongodb:"MongoDB",pagerduty:"PagerDuty",mailgun:"Mailgun",turbopuffer:"turbopuffer"},Y1=(_)=>MZ[_]??_.charAt(0).toUpperCase()+_.slice(1);function u1({vendor:_}){let Q=Y_[_];return X1.jsxDEV("span",{className:Q?"mark logo":"mark","aria-hidden":"true",children:Q?X1.jsxDEV("svg",{viewBox:"0 0 24 24",children:X1.jsxDEV("path",{d:Q.d,fill:Q.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):Y1(_).charAt(0)},void 0,!1,void 0,this)}var L_=(_)=>{_.currentTarget.closest("details")?.removeAttribute("open")},TZ="volter.theme",l6=()=>{try{let _=localStorage.getItem(TZ);return _==="light"||_==="dark"?_:"system"}catch{return"system"}};function W_(_=l6()){let Q=document.documentElement;if(_==="system")Q.removeAttribute("data-theme");else Q.setAttribute("data-theme",_)}function A_(){return m1.useEffect(()=>{let _=()=>[...document.querySelectorAll("details.menu[open], details.clock-more[open]")],Q=(q)=>{if(q.key!=="Escape"||document.querySelector("dialog[open]"))return;let U=_();if(!U.length)return;for(let G of U)G.removeAttribute("open");U[U.length-1].querySelector("summary")?.focus()},J=(q)=>{let U=q.target;for(let G of _())if(!U||!G.contains(U))G.removeAttribute("open")};return document.addEventListener("keydown",Q),document.addEventListener("click",J),()=>{document.removeEventListener("keydown",Q),document.removeEventListener("click",J)}},[]),null}function n1({open:_,onClose:Q,title:J,children:q,footer:U,wide:G}){let Z=m1.useRef(null),F=m1.useId();return m1.useEffect(()=>{let X=Z.current;if(!X)return;if(_&&!X.open){X.showModal();let Y=X.querySelector(".dialog-body :is(input:not([type=hidden]):not([disabled]), select, textarea)");if(Y?.focus(),Y instanceof HTMLInputElement&&Y.value&&/^(text|search|email|url)$/.test(Y.type))Y.select()}if(!_&&X.open)X.close()},[_]),X1.jsxDEV("dialog",{ref:Z,className:G==="window"?"dialog window":G?"dialog wide":"dialog","aria-labelledby":F,onClose:Q,onCancel:(X)=>{X.preventDefault(),Q()},onMouseDown:(X)=>{if(X.target===Z.current)Q()},children:_?X1.jsxDEV(X1.Fragment,{children:[X1.jsxDEV("div",{className:"dialog-head",children:[X1.jsxDEV("h2",{id:F,children:J},void 0,!1,void 0,this),X1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Close",onClick:Q,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X1.jsxDEV("div",{className:"dialog-body",children:q},void 0,!1,void 0,this),U?X1.jsxDEV("div",{className:"dialog-foot",children:U},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this)}var m6="volter:confirm";function T0(_){return new Promise((Q)=>{window.dispatchEvent(new CustomEvent(m6,{detail:{ask:_,resolve:Q}}))})}function B_(){let[_,Q]=m1.useState(null),[J,q]=m1.useState("");m1.useEffect(()=>{let F=(X)=>{q(""),Q(X.detail)};return window.addEventListener(m6,F),()=>window.removeEventListener(m6,F)},[]);let U=(F)=>{_?.resolve(F),Q(null)},G=_?.ask,Z=!G?.typed||J===G.typed;return X1.jsxDEV(n1,{open:Boolean(_),onClose:()=>U(!1),title:G?.title??"",footer:X1.jsxDEV(X1.Fragment,{children:[X1.jsxDEV("button",{type:"button",onClick:()=>U(!1),children:"Cancel"},void 0,!1,void 0,this),X1.jsxDEV("button",{type:"button",className:G?.danger?"danger-button":"primary",disabled:!Z,onClick:()=>U(!0),children:G?.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[G?.body?X1.jsxDEV("div",{className:"confirm-body",children:G.body},void 0,!1,void 0,this):null,G?.typed?X1.jsxDEV("div",{className:"typed-confirm",children:[X1.jsxDEV("p",{children:["Type ",X1.jsxDEV("code",{children:G.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),X1.jsxDEV("input",{autoFocus:!0,"aria-label":`Type ${G.typed} to confirm`,value:J,onChange:(F)=>q(F.target.value),onKeyDown:(F)=>{if(F.key==="Enter"&&Z)U(!0)},autoComplete:"off",spellCheck:!1},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}var g6="volter:toast";function j1(_,Q="ok"){window.dispatchEvent(new CustomEvent(g6,{detail:{text:_,kind:Q}}))}function M_(){let[_,Q]=m1.useState([]);return m1.useEffect(()=>{let J=0,q=(U)=>{let{text:G,kind:Z}=U.detail,F=++J;if(Q((X)=>[...X.slice(-3),{id:F,text:G,kind:Z}]),Z!=="error")setTimeout(()=>Q((X)=>X.filter((Y)=>Y.id!==F)),4500)};return window.addEventListener(g6,q),()=>window.removeEventListener(g6,q)},[]),X1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:_.map((J)=>X1.jsxDEV("div",{className:`toast ${J.kind}`,role:J.kind==="error"?"alert":"status",children:[X1.jsxDEV("span",{children:J.text},void 0,!1,void 0,this),X1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Dismiss",onClick:()=>Q((q)=>q.filter((U)=>U.id!==J.id)),children:"✕"},void 0,!1,void 0,this)]},J.id,!0,void 0,this))},void 0,!1,void 0,this)}function r6({value:_,label:Q,secret:J}){let[q,U]=m1.useState(!1);return X1.jsxDEV("div",{className:"copy-field",children:[Q?X1.jsxDEV("span",{className:"copy-label",children:Q},void 0,!1,void 0,this):null,X1.jsxDEV("div",{className:"copy-row",children:[X1.jsxDEV("input",{readOnly:!0,value:_,"aria-label":Q??"Value",onFocus:(Z)=>Z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),X1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>{U(!0),setTimeout(()=>U(!1),1600),j1(J?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>j1("Your browser would not copy it: select it and copy","error"))},children:q?"Copied":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function T_({label:_,items:Q}){return X1.jsxDEV("details",{className:"menu row-menu",children:[X1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":_,title:_,children:"⋯"},void 0,!1,void 0,this),X1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:Q.filter((J)=>Boolean(J)).map((J)=>J.href?X1.jsxDEV("a",{role:"menuitem",href:J.href,className:J.danger?"danger-item":void 0,onClick:L_,children:J.label},J.label,!1,void 0,this):X1.jsxDEV("button",{type:"button",role:"menuitem",disabled:J.disabled,className:J.danger?"danger-item":void 0,onClick:(q)=>{L_(q),J.onSelect?.()},children:J.label},J.label,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function x2({title:_,children:Q,action:J}){return X1.jsxDEV("div",{className:"empty-state",children:[X1.jsxDEV("p",{className:"empty-title",children:_},void 0,!1,void 0,this),Q?X1.jsxDEV("div",{className:"empty-body",children:Q},void 0,!1,void 0,this):null,J?X1.jsxDEV("div",{className:"empty-action",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function R_(){return m1.useEffect(()=>{let _=(J)=>{let q=document.querySelector("main.app"),U=J.target;if(q?.hasAttribute("data-drawer")&&U&&!U.closest(".side")&&!U.closest(".drawer-button"))q.removeAttribute("data-drawer")},Q=(J)=>{if(J.key==="Escape")RZ()};return document.addEventListener("click",_),document.addEventListener("keydown",Q),()=>{document.removeEventListener("click",_),document.removeEventListener("keydown",Q)}},[]),X1.jsxDEV("button",{type:"button",className:"icon-button drawer-button","aria-label":"Menu",onClick:()=>{document.querySelector("main.app")?.toggleAttribute("data-drawer")},children:"☰"},void 0,!1,void 0,this)}var RZ=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};function N4(_={}){let Q=(q,U)=>_.tools?`${U} (\`${q}\`)`:`\`${q}\``,J=["Set up Volter World for this app, so its calls to Stripe, Slack, GitHub, OpenAI and the other services it uses go to local twins instead of the real APIs. The app keeps its real SDKs and code.","",_.tools?"1. You have the Volter World tools (volter mcp). If the `volter` command is missing, install it: `npm install -g @volter/world`.":"1. Install the command and your agent tooling: `npm install -g @volter/world`, then `volter agents install --yes`.",`2. In the app's folder, ${Q("volter world init --install","world_init")}: it detects the vendors the app calls and installs their twins. Show me the vendors it detected and why, before keeping them.`,`3. ${_.tools?"Start it with world_up":"Start it: `volter world up`"}, then run the tests inside it: ${Q("volter world run -- <the test command>","world_run")}. Fix anything that fails because a call went to the real service.`,`4. Tell me what the app did at each vendor (${Q("volter world log","world_log")}), and give me the dashboard link (${_.tools?"world_view":"`volter world view --no-open`, started in the background: it keeps running"}).`];if(_.platform){let q=_.world??"<org>/<world>";J.push(`5. Share it with my team on ${_.platform}: ${Q(`volter login ${_.platform}`,"platform_login")} gives a link and a code for me to approve in my browser. Once I have, link it with ${Q(`volter remote add origin ${q} --create`,"remote_link with create: true")}${_.world?"":" (ask me for <org>/<world>)"}, then send what the app did: ${Q('volter world changeset -m "<what and why>"',"world_changeset")} and ${Q("volter world push","world_push")}.`)}return J.push("","The guide: https://world.volter.ai/docs/guides/use-with-a-coding-agent.md"),J.join(`
|
|
35
|
+
`)}var O_={"git-commit-horizontal":[["rect",{x:"9",y:"9",width:"6",height:"6"}],["path",{d:"M3 12h6M15 12h6"}]],"arrow-down-to-line":[["path",{d:"M12 17V3"}],["path",{d:"m6 11 6 6 6-6"}],["path",{d:"M19 21H5"}]],"arrow-up-from-line":[["path",{d:"m18 9-6-6-6 6"}],["path",{d:"M12 3v14"}],["path",{d:"M5 21h14"}]],"git-branch":[["rect",{x:"4",y:"3",width:"4",height:"4"}],["rect",{x:"4",y:"17",width:"4",height:"4"}],["rect",{x:"16",y:"5",width:"4",height:"4"}],["path",{d:"M6 7v10M18 9v2a4 4 0 0 1-4 4H6"}]],monitor:[["rect",{x:"3",y:"4",width:"18",height:"13"}],["path",{d:"M8 21h8M12 17v4"}]],vault:[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"6.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 7.9 2.7 2.7"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 10.6 2.7-2.7"}],["rect",{x:"6.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 16.1 2.7-2.7"}],["rect",{x:"15.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 13.4 2.7 2.7"}],["circle",{cx:"12",cy:"12",r:"2"}]],settings:[["circle",{cx:"12",cy:"12",r:"3"}],["circle",{cx:"12",cy:"12",r:"7"}],["path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9L7 7M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1"}]],history:[["path",{d:"M3 12a9 9 0 1 0 3-6.7"}],["path",{d:"M3 4v5h5"}],["path",{d:"M12 7v5l3 3"}]],activity:[["path",{d:"M2 12h4l3-8 6 16 3-8h4"}]],"file-diff":[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M9 10h6"}],["path",{d:"M12 13V7"}],["path",{d:"M9 17h6"}]],"square-plus":[["rect",{x:"4",y:"4",width:"16",height:"16"}],["path",{d:"M12 8v8M8 12h8"}]],"square-minus":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["path",{d:"M8 12h8"}]],"square-dot":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"10.8",y:"10.8",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],cloud:[["path",{d:"M7 19a5 5 0 0 1-.5-10A6 6 0 0 1 18 8a4.5 4.5 0 0 1 .5 11z"}]],"refresh-cw":[["path",{d:"M20 12a8 8 0 0 1-14.3 4.9M4 12a8 8 0 0 1 14.3-4.9"}],["path",{d:"M19 3v5h-5M5 21v-5h5"}]],clock:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M12 7v5l3 3"}]],"key-round":[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],plug:[["path",{d:"M9 3v5M15 3v5M6 8h12v4a6 6 0 0 1-12 0zM12 18v3"}]],"list-checks":[["path",{d:"M11 6h9M11 12h9M11 18h9"}],["path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"}]],palette:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"}],["rect",{x:"12.3",y:"5.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"16.3",y:"9.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"5.3",y:"11.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"7.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],check:[["path",{d:"M4 12l5 5L20 6"}]],plus:[["path",{d:"M12 4v16M4 12h16"}]],"chevron-down":[["path",{d:"M5 9l7 7 7-7"}]],"external-link":[["path",{d:"M14 4h6v6M20 4l-9 9"}],["path",{d:"M18 14v6H4V6h6"}]],"table-2":[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18"}]],"scroll-text":[["path",{d:"M15 12h-5"}],["path",{d:"M15 8h-5"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"}]],"layout-grid":[["rect",{x:"4",y:"4",width:"7",height:"7"}],["rect",{x:"13",y:"4",width:"7",height:"7"}],["rect",{x:"4",y:"13",width:"7",height:"7"}],["rect",{x:"13",y:"13",width:"7",height:"7"}]],globe:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"}]],"arrow-left":[["path",{d:"M20 12H5M11 6l-6 6 6 6"}]],link:[["path",{d:"M9 15l6-6"}],["path",{d:"M11 6l2-2a4.2 4.2 0 0 1 6 6l-2 2M13 18l-2 2a4.2 4.2 0 0 1-6-6l2-2"}]],user:[["circle",{cx:"12",cy:"8",r:"4"}],["path",{d:"M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"}]],"log-out":[["path",{d:"M10 4H4v16h6M9 12h11M16 8l4 4-4 4"}]]};var $=g1(P5(),1),S4="volter.console.token",v5=document.getElementById("root"),L1=v5.dataset.base??"/-/console",O1=window.location.origin,l0=(v5.dataset.worlds??O1).replace(/\/+$/,""),v_=(v5.dataset.names??"").split(",").filter((_)=>_!==""),p0=v5.dataset.worldOrigin==="1",B2=window.fetch.bind(window),c0="(session)",y_="(pass)",S5=(_)=>{try{if(_&&!p0)sessionStorage.setItem(S4,_);else sessionStorage.removeItem(S4);localStorage.removeItem(S4)}catch{}},j_="volter.console.portal",V_=(_)=>{try{if(typeof _==="string"&&/^https?:$/.test(new URL(_).protocol))sessionStorage.setItem(j_,new URL(_).origin)}catch{}},OZ=()=>{return M2.get("token")??""},i1=()=>{try{let _=sessionStorage.getItem(j_)??"";return _&&/^https?:$/.test(new URL(_).protocol)?new URL(_).origin:""}catch{return""}},IZ=()=>{let _=OZ();if(p0){if(S5(""),M2.get("pass"))return y_;let Q=new URLSearchParams(window.location.search).has("signin");if(Q)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return _||(Q?"":c0)}if(_)return S5(_),_;try{return sessionStorage.getItem(S4)??""}catch{return""}};function b1(_){let Q=_.trim();if(/not ready/i.test(Q)&&/(never verified|not verified|no approvals)/i.test(Q)){let G=[],Z=[];if(/(never verified|not verified)/i.test(Q))G.push("it is not verified yet"),Z.push("verify");if(/no approvals/i.test(Q))G.push("no one has approved it"),Z.push("approve");return{text:`Not ready to deploy: ${L2(G)}.`,acts:Z}}let J=/no credential (?:is )?sealed for ([a-z0-9_-]+)/i.exec(Q);if(J)return{text:`No credential is sealed for ${Y1(J[1])}: seal one in Settings › Vault.`,acts:["vault"]};if(/has no origin/i.test(Q))return{text:"This World has no remote: name one in Settings › Remote.",acts:["remote"]};let q=/the ([a-z0-9_-]+) twin has no root/i.exec(Q)??/:\s*([a-z0-9_, -]+?) (?:has|have) no root/i.exec(Q);if(q){let G=q[1].split(/,\s*/).filter(Boolean).map(Y1);return{text:`${L2(G)} ${G.length===1?"is":"are"} not connected to ${G.length===1?"its":"their"} real service: Settings › Real services.`,acts:["settings"]}}if(/opening a seal is/i.test(Q))return{text:"A key cannot seal a credential: open the World as yourself.",acts:[]};if(/a key manages no keys/i.test(Q))return{text:"A key cannot manage keys: open the World as yourself.",acts:[]};if(/^PUT origin:/i.test(Q))return{text:"That is not a World's address: https://<host>/<org>/<world>",acts:[]};if(/^clock: \{/i.test(Q))return{text:"Pick a date and time.",acts:[]};if(/^advance: \{/i.test(Q))return{text:"Advance by a number and a unit: 90m, 12h, 3d.",acts:[]};if(/^branches: \{/i.test(Q))return{text:"That branch could not be made: pick now, or an instant before it.",acts:[]};if(/^approve: \{/i.test(Q))return{text:"Name who approves.",acts:[]};if(/a browser deploys only what it names/i.test(Q))return{text:"A deploy is confirmed by its name: use Deploy again.",acts:[]};if(/^no such door/i.test(Q))return{text:"This World does not answer that here.",acts:[]};return{text:Q.replace(/\s*[—–-]+\s*(?:run\s+)?`[^`]*`/g,"").replace(/\s*[—–-]+\s*(?:PUT|POST|GET|DELETE)\s+\/-\/\S+(?:\s*\{[^}]*\})?/g,"").replace(/\s*\(\s*`[^`]*`\s*\)/g,"").replace(/`(?:volter|printf|curl|npm|bun)[^`]*`/g,"").replace(/:\s*\{[^}]*\}/g,"").replace(/\(\s*\)/g,"").replace(/\s*;\s*(?=[;.]|$)/g,"").replace(/\s+([,.;:])/g,"$1").trim()||_,acts:[]}}var q0=async(_)=>b1(await C0(_)).text,fZ={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function u_({name:_,acts:Q}){let J=Q.map((q)=>fZ[q]).filter((q)=>Boolean(q));if(J.length===0)return null;return $.jsxDEV($.Fragment,{children:J.map(([q,U])=>$.jsxDEV(r.default.Fragment,{children:[" ",$.jsxDEV("a",{href:`${L1}/${_}/~/${q}`,onClick:(G)=>{G.preventDefault(),f1([..._.split("/"),"~",...q.split("/")])},children:U},void 0,!1,void 0,this)]},q,!0,void 0,this))},void 0,!1,void 0,this)}async function I1(_,Q,J={}){return B2(`${O1}${Q}`,{...J,headers:{...J.headers??{},..._===c0?{}:{"x-volter-token":_},...J.body&&!J.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function N1(_,Q,J=0){let q=z_((U)=>I1(_,U),Q,J,_);return q.state==="error"?{...q,error:b1(q.error).text}:q}var l2=(_)=>{let Q=new Date(_),J=(q)=>String(q).padStart(2,"0");return`${Q.getFullYear()}-${J(Q.getMonth()+1)}-${J(Q.getDate())}T${J(Q.getHours())}:${J(Q.getMinutes())}`},I_=(_)=>new Date(Math.ceil(Date.parse(_)/60000)*60000).toISOString(),b_=(_)=>_.operation==="observed"?`observed${_.provenance==="placeholder"?" (default data)":" (vendor)"}`:_.receipt?`${_.receipt.status??""} ${_.receipt.externalId??""} ${_.receipt.reason??""}`.trim():_.provenance==="placeholder"?"default data":"unpushed",wZ=(_)=>{let Q=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(_??"");return Q?{trace:Q[1],span:Q[2]}:null},s6="volter.console.snapshots",k0=()=>{try{return JSON.parse(sessionStorage.getItem(s6)??"{}")}catch{return{}}},D_=new Map,t6=(_)=>{if(p0){if(_.token||_.readToken)D_.set(_.name,{token:_.token,readToken:_.readToken});_={..._,token:"",readToken:""}}try{sessionStorage.setItem(s6,JSON.stringify({...k0(),[_.name]:_}))}catch{}},o6=(_)=>D_.get(_)?.readToken||k0()[_]?.readToken||"",k4=(_)=>{try{let Q=k0();delete Q[_],sessionStorage.setItem(s6,JSON.stringify(Q))}catch{}},M2=new URLSearchParams(window.location.hash.slice(1)),m2=M2.get("close")??"";function y5(_){if(typeof _!=="string")return null;let Q;try{Q=new URL(_)}catch{return null}return(Q.protocol==="http:"||Q.protocol==="https:")&&Q.origin===_.replace(/\/+$/,"")?Q:null}function n6(_){let Q=y5(_);if(!Q)return null;let J=new URL(O1);if(Q.protocol!==J.protocol||Q.port!==J.port)return null;if(Q.hostname===J.hostname)return Q.origin;let q=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!q.test(Q.hostname))return null;let U=Q.hostname.replace(q,"");return U===J.hostname||q.test(J.hostname)&&U===J.hostname.replace(q,"")?Q.origin:null}function PZ(_){let Q;try{Q=JSON.parse(_)}catch{return null}let J=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof Q.name!=="string"||!J.test(Q.name)||typeof Q.parent!=="string"||!J.test(Q.parent)||typeof Q.at!=="string")return null;let q=Q.parentOrigin===void 0?void 0:n6(Q.parentOrigin);return{name:Q.name,parent:Q.parent,token:typeof Q.token==="string"?Q.token:"",readToken:typeof Q.readToken==="string"?Q.readToken:"",at:Q.at,expiresAt:typeof Q.expiresAt==="string"?Q.expiresAt:null,...q?{parentOrigin:q}:{}}}{let _=M2.get("snapshot");if(_){let Q=PZ(_);if(Q&&!k0()[Q.name])t6(Q)}}var h_="volter.console.home",E_=(_)=>{let Q=y5(_);if(!Q)return null;let J=new URL(O1).hostname,q=J.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return Q.hostname===J||Q.hostname===q?Q.origin:null};{let _=E_(M2.get("home"));if(_)try{sessionStorage.setItem(h_,_)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((_)=>M2.has(_)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var H0=()=>{try{return E_(sessionStorage.getItem(h_))??""}catch{return""}};function e6(_,Q,J,q){let U=new URLSearchParams({token:Q,home:H0()||O1}),G=k0()[J];if(G)U.set("snapshot",JSON.stringify(G));window.location.replace(`${_}${q??`${window.location.pathname}${window.location.search}`}#${U.toString()}`)}var y4=v5.dataset.route==="memory"?"":null;function tB(_){y4=_,window.dispatchEvent(new PopStateEvent("popstate"))}function W2(){return(y4??window.location.pathname.slice(L1.length)).split("/").filter(Boolean).map((_)=>{try{return decodeURIComponent(_)}catch{return""}})}var f_=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,S0=(_,Q)=>_&&Q&&f_.test(_)&&f_.test(Q)?`${_}/${Q}`:"";function f1(_){let Q=`/${_.map(encodeURIComponent).join("/")}`;if(y4!==null)y4=Q;else window.history.pushState(null,"",`${L1}${Q}`);window.dispatchEvent(new PopStateEvent("popstate"))}function x_(_,Q){let J=n6(k0()[_]?.origin);if(J&&J!==O1){e6(J,o6(_),_,`${L1}/${Q.map(encodeURIComponent).join("/")}`);return}f1(Q)}async function w_(){let[_,Q]=W2(),J=S0(_,Q),q=J?[J]:v_;if(q.length===0){let U=await B2(`${O1}/-/ping`).catch(()=>null);q=U?.ok?(await U.json().catch(()=>({}))).worlds??[]:[]}q=q.filter((U)=>{let[G,Z,...F]=U.split("/");return F.length===0&&S0(G,Z)===U});for(let U of q){let G=await B2(`${O1}/-/${U}/session`,{method:"POST"}).catch(()=>null);if(!G)continue;let Z=await G.json().catch(()=>({})),F=y5(Z.origin)?.origin;if(G.status===409&&F&&F!==O1)return window.location.replace(`${F}${L1}/${U}`),"moved";if(G.ok&&Z.local)return{token:typeof Z.token==="string"&&Z.token?Z.token:c0}}return null}function NZ(){let[_,Q]=r.useState(l6),J=(q)=>()=>{try{if(q==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",q)}catch{}W_(q),Q(q)};return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Appearance",children:["system","light","dark"].map((q)=>$.jsxDEV("button",{type:"button",role:"radio","aria-checked":_===q,onClick:J(q),children:q==="system"?"System":q==="light"?"Light":"Dark"},q,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function CZ(){let[_,Q]=r.useState(IZ()),[J,q]=r.useState(!1),[U,G]=r.useState(!1),[Z,F]=r.useState(""),[X,Y]=r.useState(null),[K,H]=r.useState(null),[L,z]=r.useState(W2());r.useEffect(()=>{let v=()=>z(W2());return window.addEventListener("popstate",v),()=>window.removeEventListener("popstate",v)},[]),r.useEffect(()=>{let[v,m]=W2(),u=S0(v,m),[n,e]=u?u.split("/"):[],t=k0()[m2];if(!m2||!_||!n||!e||!t?.made||t.parent!==`${n}/${e}`||S0(...m2.split("/"))!==m2)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}I1(_,`/-/${n}/${e}/branches/${m2}`,{method:"DELETE"}).catch(()=>null).then(()=>k4(m2))},[_]);let W=r.useCallback(async(v)=>{if(H(null),!v){let e=await w_();if(e==="moved")return;if(e){if(q(!0),e.token!==c0)S5(e.token);Q(e.token);return}Y(null),G(!0);return}if(p0&&v===c0){let e=await w_();if(e==="moved")return;if(e)q(!0)}if(p0&&v===y_){let[e,t]=W2(),a=S0(e,t),[g,J1]=a?a.split("/"):[],G1=g&&J1?await B2(`${O1}/-/${g}/${J1}/session`,{method:"POST",headers:{"x-volter-pass":M2.get("pass")??""}}).catch(()=>null):null;if(!G1){H(`${O1} did not answer: no session was opened`),Y(null);return}if(!G1.ok){H(`${await q0(G1)}. Open it again from the platform.`),Y(null);return}V_((await G1.json().catch(()=>({}))).issuer),Q(c0);return}if(p0&&v!==c0){let[e,t]=W2(),a=S0(e,t),[g,J1]=a?a.split("/"):[],G1=g&&J1?await B2(`${O1}/-/${g}/${J1}/session`,{method:"POST",headers:{"x-volter-token":v}}).catch(()=>null):null;if(!G1){H(`${O1} did not answer: no session was opened`),Y(null);return}if(!G1.ok){let F1=await q0(G1);H(G1.status===401||G1.status===403?`That token does not open ${g}/${J1}.`:G1.status===409?`${g}/${J1}'s session lives at another origin: ${F1}`:`The World could not open a session (${G1.status}): ${F1}`),Y(null);return}Q(c0);return}let m=p0?new Response(null,{status:404}):await I1(v,"/-/worlds");if(m.ok){let{worlds:e}=await m.json();Y({kind:"admin",worlds:e});return}if(m.status===429){H("You are asking faster than the platform allows — wait a moment and reload."),Y(null);return}if(m.status>=500){let e=await m.json().catch(()=>({}));H(`The platform could not list your worlds${e.error?`: ${e.error}`:""}. Reload; if it stays, the status page says what is wrong.`),Y(null);return}let u=v_;if(u.length===0){let e=await B2(`${O1}/-/ping`);if(!e.ok){H(`${O1} does not answer as a host`),Y(null);return}if(u=(await e.json()).worlds??[],u.length===0){H(`${O1} does not list its Worlds: open a World at its own address, ${O1}${L1}/<org>/<world>`),Y(null);return}}let n=[];for(let e of u){let t=await I1(v,`/-/${e}/twins`);if(t.ok){let a=await t.json();n.push({name:e,base:`${l0}/${e}`,twins:(a.twins??[]).map((g)=>({vendor:g.twin,protocol:g.protocol??null,root:g.root??null}))})}}if(n.length===0){H("This link or key opens no World here: it was revoked, or it has ended."),Y(null);return}Y({kind:"world",worlds:n})},[]);r.useEffect(()=>{W(_)},[_,W]);let O=(v)=>X?.kind==="admin"?X.worlds.find((m)=>m.name===v)?.token??_:_,[R,B]=r.useState("");if(!_||!X&&!K)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(N5,{href:`${L1}/`},void 0,!1,void 0,this),_&&!X&&!K||!_&&!U?$.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):$.jsxDEV("form",{onSubmit:(v)=>{v.preventDefault(),S5(Z.trim()),Q(Z.trim())},className:"stack",children:[$.jsxDEV("h2",{children:"Open a World"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"A World's token opens that World. A host's admin token opens every World it serves."},void 0,!1,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Token"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"token",type:"password",value:Z,onChange:(v)=>F(v.target.value),autoFocus:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",children:"Open"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let P=()=>{if(J){window.location.reload();return}if(p0){let[v,m]=W2(),u=S0(v,m),[n,e]=u?u.split("/"):[],t=()=>window.location.replace(i1()?`${i1()}/`:`${O1}${L1}/${n&&e?`${n}/${e}`:""}?signin`);if(setTimeout(t,2000),n&&e)B2(`${O1}/-/${n}/${e}/session/end`,{method:"POST"}).catch(()=>null).then(t);else t();return}if(X)for(let v of X.worlds)navigator.sendBeacon(`${v.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${v.name}/session/end`);S5(""),Q(""),F(""),Y(null),f1([])};if(K||!X)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(N5,{href:`${L1}/`},void 0,!1,void 0,this),$.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),$.jsxDEV("p",{role:"alert",children:K??"nothing answered"},void 0,!1,void 0,this),i1()?$.jsxDEV("a",{className:"button primary",href:`${i1()}/`,children:["Back to ",new URL(i1()).host]},void 0,!0,void 0,this):$.jsxDEV("button",{type:"button",className:"primary",onClick:P,children:J?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let[A,T,f,C,w,S,N]=L,y=f==="~",D=/^[A-Za-z0-9_-]+$/,l=/^[^\u0000-\u001f\u007f]{1,200}$/,p=y||!f||!D.test(f)?void 0:f,k=w&&D.test(w)?S!==void 0&&C!=="changes"&&C!=="screens"?S0(w,S)||void 0:w:void 0,b=C==="changes"&&w==="changesets"&&S&&D.test(S)?S:C==="screens"&&S&&N&&/^[A-Za-z0-9_.-]+$/.test(S)&&l.test(N)?`${S}:${N}`:void 0,j=S0(A,T),E=j?k0()[j]??null:null,V=(v)=>o6(v)||O(v),h=E?X.kind==="admin"?X.worlds.find((v)=>v.name===E.parent)?.token??null:X.worlds.some((v)=>v.name===E.parent)?_:null:null,I=async(v)=>{let m=n6(v.parentOrigin);if(m&&m!==O1){k4(v.name),window.location.assign(`${m}${L1}/${v.parent}#close=${encodeURIComponent(v.name)}`);return}if(v.made)await I1(O(v.parent),`/-/${v.parent}/branches/${v.name}`,{method:"DELETE"}).catch(()=>null),k4(v.name);f1(v.parent.split("/"))};return $.jsxDEV("main",{className:j?"app workspace":"app home",children:[j?null:$.jsxDEV("header",{children:[j?$.jsxDEV(R_,{},void 0,!1,void 0,this):null,$.jsxDEV(N5,{href:`${H0()&&H0()!==O1?H0():""}${L1}/`,onClick:(v)=>{if(H0()&&H0()!==O1)return;v.preventDefault(),f1([])}},void 0,!1,void 0,this),$.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[j?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("span",{children:j.split("/")[0]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${j}`,className:"crumb-world",onClick:(v)=>{v.preventDefault(),f1(j.split("/"))},children:j.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,p?$.jsxDEV("span",{children:[" / ",p]},void 0,!0,void 0,this):null,y&&C==="trace"?$.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),i1()?$.jsxDEV("a",{href:`${i1()}/${j?encodeURIComponent(j.split("/")[0]):""}`,title:`Back to the platform at ${new URL(i1()).host}`,className:"back-link",children:["← ",$.jsxDEV("span",{className:"back-text",children:j?`${j.split("/")[0]}'s Worlds`:new URL(i1()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,j?null:$.jsxDEV("span",{className:"mode",children:J?"on this machine":R?`signed in as ${R}`:X.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),j||J?null:$.jsxDEV("button",{onClick:P,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j?$.jsxDEV(yZ,{name:j,token:V(j),twin:p,tab:y?C??"overview":"overview",arg:y?k:void 0,...y&&b?{sub:b}:{},admin:E?null:X.kind==="admin"?_:null,snapshot:E,parentToken:h,who:{local:J,person:R||null,admin:X.kind==="admin"},onSignOut:P,onReturn:I,opens:(v)=>!!k0()[v]||X.kind==="admin"&&X.worlds.some((m)=>m.name===v),onRemoved:()=>{W(_),f1([])},onWho:B,worlds:X.worlds.map((v)=>v.name)},j,!1,void 0,this):$.jsxDEV(SZ,{mode:X,admin:X.kind==="admin"?_:null,reload:()=>W(_)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function SZ({mode:_,admin:Q,reload:J}){let[q,U]=r.useState(""),[G,Z]=r.useState(""),[F,X]=r.useState(""),[Y,K]=r.useState(null),H=async(w)=>{if(!await T0({title:`Rotate the tokens of ${w}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let S=await I1(Q,`/-/worlds/${w}/rotate`,{method:"POST"}),N=await S.json().catch(()=>({}));K(S.ok?`rotated ${w}: the new tokens are shown once — token ${N.token} · read token ${N.readToken}`:N.error?b1(N.error).text:`answered ${S.status}`),await J()},L=async(w)=>{let S=await I1(Q,`/-/worlds/${w}`,{method:"DELETE"}),N=await S.json().catch(()=>({}));K(S.ok?`removed ${w}`:N.error?b1(N.error).text:`answered ${S.status}`),await J()},[z,W]=r.useState(!1),[O,R]=r.useState(!1),[B,P]=r.useState(""),A=async(w)=>{w.preventDefault(),K(null),W(!0);try{let S=await I1(Q,"/-/worlds",{method:"POST",body:JSON.stringify({org:q,world:G,vendors:F.split(",").map((y)=>y.trim()).filter(Boolean)})}),N=await S.json();if(!S.ok){K(N.error?b1(N.error).text:`the host answered ${S.status}`);return}K(`provisioned ${N.name}`),Z(""),X(""),R(!1),await J()}finally{W(!1)}},T=B.trim().toLowerCase(),f=_.worlds.filter((w)=>!T||w.name.toLowerCase().includes(T)||w.twins.some((S)=>S.vendor.includes(T))),C=[...new Set(f.map((w)=>w.name.split("/")[0]))];return $.jsxDEV("section",{className:"home-window","aria-labelledby":"worlds",children:[$.jsxDEV("div",{className:"home-head",children:[$.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[V1(_.worlds.length,"World")," ",Q?"this host serves":"this key opens"]},void 0,!0,void 0,this),Q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{K(null),R(!0)},children:[$.jsxDEV(B1,{name:"plus",size:16},void 0,!1,void 0,this),"New World"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"home-find",children:$.jsxDEV("input",{type:"search",placeholder:"Filter by World or vendor","aria-label":"Filter Worlds",value:B,onChange:(w)=>P(w.target.value)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&!O?$.jsxDEV("p",{role:"status",className:"home-note",children:Y},void 0,!1,void 0,this):null,C.map((w)=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("p",{className:"menu-label home-org",children:w},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"home-list",children:f.filter((S)=>S.name.split("/")[0]===w).map((S)=>$.jsxDEV("li",{children:[$.jsxDEV("a",{href:`${L1}/${S.name}`,onClick:(N)=>{N.preventDefault(),f1(S.name.split("/"))},children:[$.jsxDEV(B1,{name:"globe",size:20},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:S.name.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("small",{children:$.jsxDEV("code",{children:S.base},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"home-vendors",children:S.twins.map((N)=>$.jsxDEV("span",{title:Y1(N.vendor),children:$.jsxDEV(u1,{vendor:N.vendor},void 0,!1,void 0,this)},N.vendor,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q?$.jsxDEV("details",{className:"menu home-more",children:[$.jsxDEV("summary",{"aria-label":`More for ${S.name}`,children:"⋯"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"popover menu-list",children:[$.jsxDEV("button",{type:"button",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),H(S.name)},children:"Rotate tokens…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"danger-item",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),T0({title:`Remove ${S.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:S.name}).then((y)=>{if(y)L(S.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},S.name,!0,void 0,this))},void 0,!1,void 0,this)]},w,!0,void 0,this)),f.length===0?$.jsxDEV("p",{className:"mode home-note",children:T?`No World matches ${B}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,$.jsxDEV(n1,{open:O,onClose:()=>{if(!z)R(!1)},title:"New World",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>R(!1),disabled:z,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"provision",className:"primary",disabled:z,children:z?"Making… (ten seconds or so)":"Make World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"provision",onSubmit:A,className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Org"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"org",value:q,onChange:(w)=>U(w.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"world",value:G,onChange:(w)=>Z(w.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Vendors"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"vendors",value:F,onChange:(w)=>X(w.target.value),placeholder:"stripe, slack",required:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"A twin of each, with its default data."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"status",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var kZ=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],vZ=(_,Q)=>{let J=Q?.screens?.find((q)=>q.path.replace(/\/+$/,"")==="")??Q?.screens?.find((q)=>!/[{<]/.test(q.path));return Q&&J?`${l0}/${_}/${Q.twin}${J.path.startsWith("/")?J.path:`/${J.path}`}`:null},P_={verify:"verified",use:"used",issue:"issued",revoke:"revoked",rotate:"rotated",seed:"seeded",upsert:"saved",set:"set",start:"started",finish:"finished",fail:"failed",schedule:"scheduled",deliver:"delivered",like:"liked",follow:"followed",reply:"replied",create:"created",update:"updated",delete:"deleted",record:"recorded",remove:"removed",add:"added",send:"sent",post:"posted",postmessage:"posted",cancel:"canceled",close:"closed",open:"opened",publish:"published",upload:"uploaded",invite:"invited",archive:"archived",merge:"merged",refund:"refunded",capture:"captured",confirm:"confirmed",pay:"paid"};function K0(_){let Q=_.operation??_.op,J=(Q.includes(".")?Q.slice(Q.lastIndexOf(".")+1):Q).toLowerCase(),q=_.subject.type.replace(/[_-]+/g," ").trim(),U=`${q.charAt(0).toUpperCase()}${q.slice(1)}`,G=/(^|\.)twin\./.test(Q)||/^seed_/.test(J),Z=Q.replace(/[._]+/g," ").trim(),F=G?`${U} seeded`:P_[J]?`${U} ${P_[J]}`:`${Z.charAt(0).toUpperCase()}${Z.slice(1)}`,X=_.fields??{},Y=["title","name","email","text","subject","summary","description"].map((H)=>X[H]).find((H)=>typeof H==="string"&&H.trim()!=="")??null,K=Y===null?null:Y.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(H,L,z)=>`${L==="!"?"@":L}${z}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:F,label:K===null?null:K.length>80?`${K.slice(0,79)}…`:K}}var r0=(_)=>/token|password|secret|key|credential/i.test(_.subject.type)&&_.subject.id.length>6?`••••${_.subject.id.slice(-4)}`:_.subject.id;function yZ({name:_,token:Q,twin:J,tab:q,arg:U,sub:G,admin:Z,snapshot:F,parentToken:X,who:Y,onSignOut:K,onReturn:H,opens:L,onRemoved:z,onWho:W,worlds:O=[]}){let[R,B]=r.useState("pending"),[P,A]=r.useState(null),[T,f]=r.useState(0),[C,w]=r.useState(null);r.useEffect(()=>{let a=!0;return A(null),I1(Q,`/-/${_}/session`,{method:"POST"}).then(async(g)=>{let J1=await g.json().catch(()=>({}));if(V_(J1.issuer),J1.who)W?.(J1.who);w(typeof J1.signsAs==="string"?J1.signsAs:null);let G1=y5(J1.origin)?.origin;if(g.status===409&&G1&&G1!==O1){e6(G1,Q,_);return}if(!a)return;if(B(!g.ok?"unknown":J1.scope==="read"?"read":J1.scope==="write"?"write":"unknown"),!g.ok)A(J1.error?b1(J1.error).text:`answered ${g.status}`)}).catch((g)=>{if(a)B("unknown"),A(`the World did not answer: ${g instanceof Error?g.message:String(g)}`)}),()=>{a=!1}},[_,Q,T]);let S=P?{state:"error",error:P}:R==="pending"?{state:"pending"}:{state:"ok",scope:R},N=R==="write",y=(a)=>{if(a.status!==403)return;a.clone().json().then((g)=>{if(/read token|opens only reads|write access|reads only/i.test(g?.error??""))B("read")},()=>null)},[D,l]=r.useState(0);r.useEffect(()=>{let a=setInterval(()=>{if(!document.hidden)l((g)=>g+1)},5000);return()=>clearInterval(a)},[]);let[p,k]=r.useState(0),b=N1(Q,`/-/${_}/clock`,D+p),j=N1(Q,`/-/${_}/twins`),E=N1(Q,`/-/${_}/branches`,p),V=N1(Q,`/-/${_}/map`,Math.floor(D/2)),h=!(E.state==="error"&&(E.status===404||E.status===405)),I=kZ.includes(q)?q:"overview",v=j.state==="ok"?j.data.twins.map((a)=>a.twin):[];if(J&&j.state==="ok"&&!v.includes(J))return $.jsxDEV("main",{className:"center",children:$.jsxDEV(x2,{title:`${_} has no ${J}`,action:$.jsxDEV("a",{href:`${L1}/${_}`,onClick:(a)=>{a.preventDefault(),f1(_.split("/"))},children:["Open ",_]},void 0,!0,void 0,this),children:$.jsxDEV("p",{children:["No vendor of this World is called ",J,". Its changesets are under Changes › History."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);let m=I==="vendors"&&U?U:void 0,u=()=>{B("pending"),f((a)=>a+1)};if(I==="canvas"||I==="vendors"&&!m||q==="screens"&&!U)return $.jsxDEV(UF,{name:_,token:Q,twins:j,session:S,retry:u,snapshot:F,back:()=>f1(_.split("/")),canWrite:N&&!F},void 0,!1,void 0,this);let e=q==="settings"?{kind:"settings",tab:((a)=>m_.find(([g])=>g===a)?.[0]??"account")(U)}:q==="remote"?{kind:"settings",tab:"remote"}:q==="vault"?{kind:"settings",tab:"vault"}:q==="branches"?{kind:"branches",...U?{open:U}:{}}:null,t=J?"vendor":q==="screens"&&U?"screen":I==="vendors"&&m?"vendor":q==="trace"?"trace":q==="events"?"events":q==="changes"&&U==="changesets"?"history":"changes";return $.jsxDEV(gZ,{name:_,token:Q,view:t,win:e,who:Y,snapshot:F,onReturn:H,onSignOut:K,worlds:O,session:S,retry:u,...t==="vendor"?{arg:J??m}:t==="events"||t==="trace"||t==="screen"?U?{arg:U}:{}:{},...G?{sub:G}:{},twins:j,map:V,branches:h?E:null,clock:b,canWrite:N&&!F,refused:y,signsAs:C,opens:L,tick:D,admin:Z,onRemoved:z,onClock:()=>k((a)=>a+1),scope:F?"read":R},void 0,!1,void 0,this)}function B1({name:_,size:Q=20}){return $.jsxDEV("svg",{className:"icon",viewBox:"0 0 24 24",width:Q,height:Q,fill:"none",stroke:"currentColor",strokeWidth:Q<=16?1.75:1.5,strokeLinecap:"square",strokeLinejoin:"miter","aria-hidden":"true",children:(O_[_]??[]).map(([J,q],U)=>r.default.createElement(J,{key:U,...q}))},void 0,!1,void 0,this)}function j4(_){let Q=(J)=>{let q=(J.operation??J.op).toLowerCase();return q.includes(".")?q.slice(q.lastIndexOf(".")+1):q};if(_.some((J)=>/^(delete|remove|archive|revoke)/.test(Q(J))||J.fields?.deleted===!0))return{icon:"square-minus",word:"removed",tone:"removed"};if(/^(create|add|insert|issue|send|post|upload|invite|record|seed)/.test(Q(_[0])))return{icon:"square-plus",word:"made",tone:"added"};return{icon:"square-dot",word:"changed",tone:"changed"}}var m_=[["account","Account","user"],["changesets","Changesets","git-commit-horizontal"],["remote","Remote","cloud"],["access","Access","key-round"],["services","Real services","plug"],["vault","Vault","vault"],["checks","Checks","list-checks"],["clock","Clock","clock"],["appearance","Appearance","palette"]],jZ=(_,Q)=>{let J=Q.split("/").pop()??Q,q=_.split("/").pop()??"";return J.startsWith(`${q}-`)?J.slice(q.length+1):J},A2=(_)=>_.replace(/^_+/,"").replace(/[_-]+/g," ");function g_({record:_,history:Q}){let J=_.writes[_.writes.length-1],q=K0(J),U=j4(_.writes),G=new Set(_.writes.map((H)=>H.id)),Z=_.writes[0].occurredAt,F={};if(Q){for(let H of Q)if(!G.has(H.id)&&!H.landsId&&!H.aliasOf&&H.subject.type===J.subject.type&&H.subject.id===J.subject.id&&H.occurredAt<=Z)Object.assign(F,H.fields??{})}let X={...F};for(let H of _.writes)Object.assign(X,H.fields??{});let Y=U.tone==="added"&&Object.keys(F).length===0,K=[...new Set([...Object.keys(F),...Object.keys(X)])].filter((H)=>!n_(F[H],X[H]));return $.jsxDEV("div",{className:"ws-diff","aria-label":`${q.label??r0(J)}: its changes`,children:[$.jsxDEV("div",{className:"ws-diff-head",children:[$.jsxDEV("span",{className:`ws-kind ${U.tone}`,title:U.word,children:$.jsxDEV(B1,{name:U.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(u1,{vendor:_.twin},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:q.label??r0(J)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[Y1(_.twin)," · ",J.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")," ",$.jsxDEV("code",{children:r0(J)},void 0,!1,void 0,this)," · ",U.word," here"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ol",{className:"ws-writes",children:_.writes.map((H)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:K0(H).what},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(w1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",k5(H)]},void 0,!0,void 0,this)]},H.id,!0,void 0,this))},void 0,!1,void 0,this),Q===null?$.jsxDEV("p",{className:"mode pad",children:"Reading its history…"},void 0,!1,void 0,this):K.length===0?$.jsxDEV("p",{className:"mode pad",children:"No field holds a new value."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"ws-fields","aria-label":"Fields before and after",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Field"},void 0,!1,void 0,this),Y?null:$.jsxDEV("th",{children:"Before"},void 0,!1,void 0,this),$.jsxDEV("th",{children:U.tone==="removed"?"After":"Now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:K.map((H)=>$.jsxDEV("tr",{children:[$.jsxDEV("th",{scope:"row",children:$.jsxDEV("code",{children:H},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?null:$.jsxDEV("td",{className:H in F?"was":"none",children:H in F?$.jsxDEV(v0,{v:F[H]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:H in X?"now":"none",children:H in X?$.jsxDEV(v0,{v:X[H]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function p_({records:_,selected:Q,onPick:J,label:q}){let[U,G]=r.useState(()=>{try{return localStorage.getItem("volter.console.records")==="tree"}catch{return!1}}),Z=(Y)=>{G(Y);try{localStorage.setItem("volter.console.records",Y?"tree":"path")}catch{}},F=(Y,K)=>{let H=Y.writes[Y.writes.length-1],L=K0(H),z=j4(Y.writes);return $.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:[Q===Y.key?"on":"",K?"nested":""].join(" ").trim()||void 0,"aria-pressed":Q===Y.key,onClick:()=>J(Y.key),children:[K?null:$.jsxDEV(u1,{vendor:Y.twin},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:L.label??r0(H)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[A2(H.subject.type)," · ",L.what.split(" ").slice(-1)[0],Y.writes.length>1?` · ${V1(Y.writes.length,"write")}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:`ws-kind ${z.tone}`,title:z.word,"aria-label":z.word,children:$.jsxDEV(B1,{name:z.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Y.key,!1,void 0,this)},X=[...new Set(_.map((Y)=>Y.twin))];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-view-switch",role:"group","aria-label":"List the records by",children:[$.jsxDEV("button",{type:"button","aria-pressed":!U,className:U?void 0:"on",onClick:()=>Z(!1),children:"Path"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button","aria-pressed":U,className:U?"on":void 0,onClick:()=>Z(!0),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"ws-list","aria-label":q,children:U?X.map((Y)=>{let K=_.filter((H)=>H.twin===Y);return $.jsxDEV("li",{className:"ws-group",children:[$.jsxDEV("p",{className:"ws-group-head",children:[$.jsxDEV(u1,{vendor:Y},void 0,!1,void 0,this),$.jsxDEV("b",{children:Y1(Y)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:K.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:K.map((H)=>F(H,!0))},void 0,!1,void 0,this)]},Y,!0,void 0,this)}):_.map((Y)=>F(Y,!1))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function VZ({name:_,token:Q,branches:J,opens:q,refused:U,onChanged:G}){let[Z,F]=r.useState(""),[X,Y]=r.useState(!1),K=J?.state==="ok"&&J.data.checkedOut||_.split("/")[1],H=J?.state==="ok"&&J.data.named?.length?J.data.named:[{name:K,running:!0}],L=J?.state==="ok"?J.data.branches:[],z=Z.trim().toLowerCase(),W=(R)=>!z||R.toLowerCase().includes(z),O=(R)=>{R.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"The branch served here",children:[$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("b",{children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover ws-branch-menu",children:[$.jsxDEV("div",{className:"ws-branch-find",children:[$.jsxDEV("input",{type:"search",placeholder:"Filter","aria-label":"Filter branches",value:Z,onChange:(R)=>F(R.target.value)},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:(R)=>{O(R),Y(!0)},disabled:!J,children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"This World"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-branch-list",children:H.filter((R)=>W(R.name)).map((R)=>$.jsxDEV("li",{className:R.name===K?"current":void 0,children:[$.jsxDEV("span",{className:"tick",children:R.name===K?$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:R.name},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:R.name===K?"served here":R.running?"running":"stopped"},void 0,!1,void 0,this)]},R.name,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Branches of it"},void 0,!1,void 0,this),L.length===0?$.jsxDEV("p",{className:"mode ws-branch-none",children:"None yet. New branch makes one, from now or as the World was."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"ws-branch-list",children:L.filter((R)=>W(R.name)).map((R)=>{let B=$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"tick",children:$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:jZ(_,R.name)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:R.at?.instant?$.jsxDEV($.Fragment,{children:["as of ",$.jsxDEV(w1,{iso:R.at.instant,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P=R.expiresAt?`Goes away ${new Date(R.expiresAt).toLocaleString()}`:"Kept";return $.jsxDEV("li",{children:q(R.name)?$.jsxDEV("a",{href:`${L1}/${R.name}`,title:P,onClick:(A)=>{A.preventDefault(),O(A),x_(R.name,R.name.split("/"))},children:B},void 0,!1,void 0,this):$.jsxDEV("span",{title:`${P}. Its tokens went to whoever made it; it opens from their page.`,children:B},void 0,!1,void 0,this)},R.name,!1,void 0,this)})},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-branch-foot",children:$.jsxDEV("a",{href:`${L1}/${_}/~/branches`,onClick:(R)=>{R.preventDefault(),O(R),f1([..._.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(r_,{name:_,token:Q,open:X,onClose:()=>Y(!1),onMade:G,refused:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function c_({name:_,view:Q,changes:J,changesets:q}){let U=(G)=>(Z)=>{Z.preventDefault(),f1([..._.split("/"),"~",...G])};return $.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[$.jsxDEV("a",{href:`${L1}/${_}/~/changes`,className:Q==="changes"?"on":void 0,"aria-current":Q==="changes"?"page":void 0,onClick:U(["changes"]),children:["Changes",J?$.jsxDEV("span",{className:"count",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/~/changes/changesets`,className:Q==="history"?"on":void 0,"aria-current":Q==="history"?"page":void 0,onClick:U(["changes","changesets"]),children:["History",q?$.jsxDEV("span",{className:"count",children:q},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function uZ({name:_,token:Q,sets:J,sub:q,signsAs:U,canWrite:G,rooted:Z,refused:F,onChanged:X,changes:Y,withScreens:K,required:H}){let[L,z]=r.useState(null),[W,O]=r.useState(!1),R=J.state==="ok"?[...J.data.changesets].sort((S,N)=>N.createdAt.localeCompare(S.createdAt)):[],B=R.find((S)=>S.name===q)??R[0],P=r.useMemo(()=>{let S=new Map;for(let N of B?t_(B):[]){let y=`${N.twin}:${N.entry.subject.type}:${N.entry.subject.id}`,D=S.get(y)??{key:y,twin:N.twin,writes:[]};D.writes.push(N.entry),S.set(y,D)}return[...S.values()]},[B]),A=P.find((S)=>S.key===L)??P[0],T=N1(Q,A?`/-/${_}/log/${A.twin}`:null),f={added:0,removed:0,changed:0};for(let S of P)f[j4(S.writes).tone]=(f[j4(S.writes).tone]??0)+1;let C=B?V4(B):null,w=B?o_(B,H):null;return $.jsxDEV("div",{className:"ws-two",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(c_,{name:_,view:"history",changes:Y,changesets:R.length},void 0,!1,void 0,this),$.jsxDEV(r1,{load:J,what:"the changesets",lines:4},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-list ws-commits","aria-label":"Changesets",children:R.map((S)=>{let N=B?.name===S.name,y=V4(S).label==="Not sent";return $.jsxDEV("li",{children:$.jsxDEV("a",{href:`${L1}/${_}/~/changes/changesets/${S.name}`,className:N?"on":void 0,"aria-current":N?"true":void 0,onClick:(D)=>{D.preventDefault(),z(null),f1([..._.split("/"),"~","changes","changesets",S.name])},children:[$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:a6(S)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[S.owner??(S.cutBy?v4(S.cutBy):"unrecorded")," • ",$.jsxDEV(w1,{iso:S.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),y?$.jsxDEV("span",{className:"ws-unpushed",title:"Not pushed to the remote yet",children:$.jsxDEV(B1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},S.name,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-pane-right",children:[J.state==="ok"&&!B?$.jsxDEV(x2,{title:"No changesets yet",children:$.jsxDEV("p",{children:"Cut one from Changes: the cut box is at its foot."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,B&&C&&w?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-commit-head",children:[$.jsxDEV("div",{className:"ws-commit-title",children:[$.jsxDEV("h3",{children:a6(B)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-commit-stat",children:[$.jsxDEV(B1,{name:"file-diff",size:16},void 0,!1,void 0,this)," ",V1(P.length,"changed record"),f.added?$.jsxDEV("span",{className:"plus",children:[" +",f.added]},void 0,!0,void 0,this):null,f.removed?$.jsxDEV("span",{className:"minus",children:[" −",f.removed]},void 0,!0,void 0,this):null,f.changed?$.jsxDEV("span",{className:"dot",children:[" •",f.changed]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode ws-commit-meta",children:[$.jsxDEV("code",{children:B.name},void 0,!1,void 0,this)," · ",$.jsxDEV(w1,{iso:B.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"ws-commit-who",children:[["Owner",B.owner??(B.cutBy&&/^(token|token:read)$|^key:(?!.* for:)/.test(B.cutBy)?"no person: a service’s":"unrecorded")],["Cut by",B.cutBy?B.pushedBy&&B.applied===null&&B.cutBy==="machine"?"the machine it was cut on":v4(B.cutBy):"unrecorded"],...B.pushedBy?[["Pushed by",v4(B.pushedBy)]]:[]].map(([S,N])=>$.jsxDEV("span",{children:[$.jsxDEV("span",{className:"mode",children:S},void 0,!1,void 0,this)," ",N]},S,!0,void 0,this))},void 0,!1,void 0,this),B.pushedBy?$.jsxDEV("p",{className:"mode ws-commit-meta",children:B.applied===null?"Owner and cut by are as the World it was cut in recorded them; pushed by is this World's own record.":"Owner and cut by are this World’s record; pushed by is as the remote recorded it."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>O(!0),title:"Where it went, the checks, the approvals; Verify, Approve and Deploy",children:[$.jsxDEV("span",{className:`badge cs-${C.tone}`,children:C.label},void 0,!1,void 0,this),$.jsxDEV("span",{className:`badge cs-${w.tone}`,children:w.label},void 0,!1,void 0,this),"Review…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-two inner",children:[$.jsxDEV("div",{className:"ws-files",children:$.jsxDEV(p_,{records:P,...A?{selected:A.key}:{},onPick:z,label:"Records it changed"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:A?$.jsxDEV(g_,{record:A,history:T.state==="ok"?T.data.entries:T.state==="error"?[]:null},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"It changes nothing."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(n1,{open:W,onClose:()=>O(!1),title:`Review: ${a6(B)}`,wide:!0,children:[$.jsxDEV(k_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"head",required:H},`h:${B.name}`,!1,void 0,this),$.jsxDEV(k_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"review",required:H},`r:${B.name}`,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function bZ({name:_,token:Q,vendors:J,vendor:q,tick:U}){let[G,Z]=r.useState(N_*4),[F,X]=r.useState(""),[Y,K]=r.useState(null),H=N1(Q,`/-/${_}/timeline?limit=${G}${q?`&twin=${encodeURIComponent(q)}`:""}`,Math.floor(U/2)),L=H.state==="ok"?eZ(H.data.entries):[],z=[...new Set(L.map((f)=>K0(f.entry).what))].sort(),W=L.filter((f)=>!F||K0(f.entry).what===F),O=W.find((f)=>g2(f)===Y)??W[0],R=(f)=>(C)=>{C.preventDefault(),K(null),f1([..._.split("/"),"~","events",...f?[f]:[]])},B=O?.entry.input&&typeof O.entry.input==="object"?O.entry.input.body:void 0,P=O?wZ(O.entry.traceparent):null,A=O?C_(O):null,T=O?sZ(O.entry):[];return $.jsxDEV("div",{className:"ws-events",children:[$.jsxDEV("div",{className:"ws-filterbar",children:[$.jsxDEV("nav",{className:"ws-seg","aria-label":"Vendor",children:[$.jsxDEV("a",{href:`${L1}/${_}/~/events`,className:!q?"on":void 0,"aria-current":!q?"page":void 0,onClick:R(),children:"All"},void 0,!1,void 0,this),J.map((f)=>$.jsxDEV("a",{href:`${L1}/${_}/~/events/${f}`,className:q===f?"on":void 0,"aria-current":q===f?"page":void 0,onClick:R(f),children:[$.jsxDEV(u1,{vendor:f},void 0,!1,void 0,this),Y1(f)]},f,!0,void 0,this))]},void 0,!0,void 0,this),$.jsxDEV("select",{"aria-label":"Operation",value:F,onChange:(f)=>{X(f.target.value),K(null)},children:[$.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),z.map((f)=>$.jsxDEV("option",{value:f,children:f},f,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[$.jsxDEV(r1,{load:H,what:"the events",lines:6},void 0,!1,void 0,this),$.jsxDEV("table",{className:"ws-grid","aria-label":"Events",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Time"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"What"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Record"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"By"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Receipt"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:W.map((f)=>{let C=K0(f.entry),w=C_(f),S=O&&g2(f)===g2(O);return $.jsxDEV("tr",{className:S?"on":void 0,"aria-selected":S,onClick:()=>K(g2(f)),children:[$.jsxDEV("td",{className:"mono",children:$.jsxDEV(w1,{iso:f.entry.occurredAt,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(u1,{vendor:f.twin},void 0,!1,void 0,this),Y1(f.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("b",{children:C.what},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"ws-cell-clip",children:C.label?`“${C.label}”`:$.jsxDEV("code",{children:r0(f.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:k5(f.entry,f.caller)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w?$.jsxDEV("span",{className:w.bad?"badge cs-bad":w.status==="deployed"?"badge cs-done":"badge",children:w.status},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:b_(f.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},g2(f),!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-detail",children:O?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-event-line",children:[$.jsxDEV("span",{className:"badge",children:d_(O.entry)},void 0,!1,void 0,this),A?$.jsxDEV("span",{className:A.bad?"badge cs-bad":"badge cs-good",children:A.status},void 0,!1,void 0,this):null,$.jsxDEV("code",{children:[O.entry.subject.type,":",r0(O.entry)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(w1,{iso:O.entry.occurredAt},void 0,!1,void 0,this)," · ",k5(O.entry,O.caller)]},void 0,!0,void 0,this),P?$.jsxDEV("a",{href:`${L1}/${_}/~/trace/${P.trace}`,onClick:(f)=>{f.preventDefault(),f1([..._.split("/"),"~","trace",P.trace])},children:"Its trace →"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-panes",children:[$.jsxDEV("div",{role:"region","aria-label":"The request",children:[$.jsxDEV("h4",{children:"Request"},void 0,!1,void 0,this),B!==void 0?$.jsxDEV(oZ,{body:B},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"No request body: the World or the vendor wrote it."},void 0,!1,void 0,this),T.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Usage"},void 0,!1,void 0,this),$.jsxDEV("dl",{className:"fields",children:T.map(([f,C])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:f},void 0,!1,void 0,this),$.jsxDEV("dd",{children:C},void 0,!1,void 0,this)]},f,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{role:"region","aria-label":"What it wrote",children:[$.jsxDEV("h4",{children:"Written"},void 0,!1,void 0,this),$.jsxDEV(s_,{fields:O.entry.fields},void 0,!1,void 0,this),$.jsxDEV("h4",{children:O.copies.length?"Receipts":"Receipt"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:O.copies.length?O.copies.map((f)=>f.entry.receipt?.status??"landed copy").join(" · "):nZ(O.entry)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"Nothing written here yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:[$.jsxDEV("span",{children:[O?`${W.indexOf(O)+1} of ${W.length}`:W.length," events",q?` at ${Y1(q)}`:""]},void 0,!0,void 0,this),H.state==="ok"&&H.data.next?$.jsxDEV("button",{type:"button",onClick:()=>Z((f)=>f+N_*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function DZ({name:_,token:Q,id:J}){let q=/^[0-9a-f]{32}$/.test(J),U=N1(Q,q?`/-/${_}/timeline?trace=${J}&limit=500`:null),G=U.state==="ok"?[...U.data.entries].sort((H,L)=>-i_(H,L)):[],[Z,F]=r.useState(null),X=G[0]?Date.parse(G[0].entry.occurredAt):0,Y=G.length?Math.max(1,Date.parse(G[G.length-1].entry.occurredAt)-X):1,K=[...new Set(G.map((H)=>H.twin))];return $.jsxDEV("div",{className:"ws-sheet ws-trace",children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${L1}/${_}/~/events`,onClick:(H)=>{H.preventDefault(),f1([..._.split("/"),"~","events"])},children:[$.jsxDEV(B1,{name:"arrow-left",size:16},void 0,!1,void 0,this)," Events"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("h2",{children:[G[0]?`${K0(G[0].entry).what} …`:"Trace"," ",$.jsxDEV("code",{className:"mode",children:J.slice(0,12)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!q?$.jsxDEV("p",{role:"alert",children:[J?`${J} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):$.jsxDEV(r1,{load:U,what:"the trace"},void 0,!1,void 0,this),G.length?$.jsxDEV("p",{className:"ws-trace-meta",children:["Started ",$.jsxDEV("b",{children:$.jsxDEV(w1,{iso:G[0].entry.occurredAt},void 0,!1,void 0,this)},void 0,!1,void 0,this)," · Took ",$.jsxDEV("b",{children:[Y," ms"]},void 0,!0,void 0,this)," · Vendors ",$.jsxDEV("b",{children:K.map(Y1).join(", ")},void 0,!1,void 0,this)," · Writes ",$.jsxDEV("b",{children:G.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,U.state==="ok"&&G.length===0?$.jsxDEV(x2,{title:"Nothing in this World carries this trace",children:$.jsxDEV("p",{children:["An app instrumented with OpenTelemetry sends a ",$.jsxDEV("code",{children:"traceparent"},void 0,!1,void 0,this)," with each call, and every write that call makes keeps it, so one click reads across every vendor."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,G.length?$.jsxDEV("div",{className:"ws-spans",role:"table","aria-label":"The trace's writes",children:[$.jsxDEV("div",{className:"ws-span head",role:"row",children:[$.jsxDEV("span",{role:"columnheader",children:"Vendor and what"},void 0,!1,void 0,this),$.jsxDEV("span",{role:"columnheader",className:"ws-ticks",children:[$.jsxDEV("span",{children:"0 ms"},void 0,!1,void 0,this),$.jsxDEV("span",{children:[Math.round(Y/2)," ms"]},void 0,!0,void 0,this),$.jsxDEV("span",{children:[Y," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.map((H)=>{let L=Date.parse(H.entry.occurredAt)-X,z=g2(H),W=K0(H.entry);return $.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("div",{className:Z===z?"ws-span on":"ws-span",role:"row",onClick:()=>F(Z===z?null:z),children:[$.jsxDEV("span",{role:"cell",className:"ws-span-name",children:[$.jsxDEV(u1,{vendor:H.twin},void 0,!1,void 0,this),$.jsxDEV("b",{children:Y1(H.twin)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[W.what,W.label?` “${W.label}”`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{role:"cell",className:"ws-span-track",children:[$.jsxDEV("span",{className:"ws-span-dot",style:{left:`${L/Y*100}%`}},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-span-at mode",style:{left:`${L/Y*100}%`},children:["+",L," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z===z?$.jsxDEV("div",{className:"ws-span-detail",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:d_(H.entry)},void 0,!1,void 0,this)," on ",$.jsxDEV("code",{children:[H.entry.subject.type,":",r0(H.entry)]},void 0,!0,void 0,this)," · ",k5(H.entry,H.caller)," · ",b_(H.entry)]},void 0,!0,void 0,this),$.jsxDEV(s_,{fields:H.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},z,!0,void 0,this)})]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function hZ({name:_,token:Q,vendor:J,withScreens:q,tick:U}){let G=N1(Q,`/-/${_}/checkpoint/${J}`,Math.floor(U/6)),Z=G.state==="ok"?G.data.tree.filter((T)=>T.deleted!==!0):[],F=[...new Set(Z.map((T)=>T.type))].map((T)=>({type:T,count:Z.filter((f)=>f.type===T).length})).sort((T,f)=>Number(T.type.startsWith("_"))-Number(f.type.startsWith("_"))||A2(T.type).localeCompare(A2(f.type))),[X,Y]=r.useState(null),[K,H]=r.useState(null),L=F.some((T)=>T.type===X)?X:F[0]?.type,z=Z.filter((T)=>T.type===L),W=z.find((T)=>T.id===K)??z[0],O=["name","email","title","text","description","subject","amount","percent_off","unit_amount","currency","status","channel","customer","product"],R=new Set(["id","type","object","livemode","created","updated","updatedAt","deleted"]),B=(T)=>!R.has(T)&&z.some((f)=>f[T]!==void 0&&f[T]!==null&&typeof f[T]!=="object"),P=[...new Set(z.flatMap((T)=>Object.keys(T)))],A=[...O.filter(B),...P.filter((T)=>!O.includes(T)&&B(T))].slice(0,4);return $.jsxDEV("div",{className:"ws-table-app",children:[$.jsxDEV("nav",{className:"ws-tables","aria-label":`${Y1(J)}'s records`,children:[$.jsxDEV("div",{className:"ws-list-head",children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(u1,{vendor:J},void 0,!1,void 0,this),Y1(J)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(r1,{load:G,what:"what it stores",lines:4},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Stores"},void 0,!1,void 0,this),F.map((T)=>$.jsxDEV("a",{href:`#${T.type}`,className:L===T.type?"on":void 0,"aria-current":L===T.type?"true":void 0,onClick:(f)=>{f.preventDefault(),Y(T.type),H(null)},children:[$.jsxDEV(B1,{name:"table-2",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:A2(T.type)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"count",children:T.count},void 0,!1,void 0,this)]},T.type,!0,void 0,this)),$.jsxDEV("p",{className:"menu-label",children:"Also"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/~/events/${J}`,onClick:(T)=>{T.preventDefault(),f1([..._.split("/"),"~","events",J])},children:[$.jsxDEV(B1,{name:"activity",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its events"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q?$.jsxDEV("a",{href:`${L1}/${_}/~/screens/${J}`,onClick:(T)=>{T.preventDefault(),f1([..._.split("/"),"~","screens",J])},children:[$.jsxDEV(B1,{name:"monitor",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[G.state==="ok"&&F.length===0?$.jsxDEV(x2,{title:`${Y1(J)} stores nothing yet`,children:$.jsxDEV("p",{children:"What your app makes there shows here, by type."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,z.length?$.jsxDEV("table",{className:"ws-grid","aria-label":`${A2(L??"")} records`,children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),A.map((T)=>$.jsxDEV("th",{children:T},T,!1,void 0,this)),$.jsxDEV("th",{children:"updated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:z.map((T)=>$.jsxDEV("tr",{className:W?.id===T.id?"on":void 0,"aria-selected":W?.id===T.id,onClick:()=>H(T.id),children:[$.jsxDEV("td",{children:$.jsxDEV("code",{children:T.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),A.map((f)=>$.jsxDEV("td",{className:"ws-cell-clip",children:T[f]===void 0||T[f]===null?$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(T[f])},f,!1,void 0,this)),$.jsxDEV("td",{className:"mode",children:typeof T.updatedAt==="string"?$.jsxDEV(w1,{iso:T.updatedAt},void 0,!1,void 0,this):"—"},void 0,!1,void 0,this)]},T.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("aside",{className:"ws-record","aria-label":"The selected record",children:W?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:A2(W.type)},void 0,!1,void 0,this),$.jsxDEV("code",{children:W.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("dl",{className:"ws-record-fields",children:Object.entries(W).filter(([T])=>T!=="type"&&T!=="id").map(([T,f])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:T},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(v0,{v:f},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},T,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:W?`${z.indexOf(W)+1} of ${V1(z.length,A2(L??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function EZ({name:_,vendor:Q,url:J,mapError:q,holding:U,session:G,retry:Z}){return $.jsxDEV("div",{className:"ws-screen",children:[$.jsxDEV("div",{className:"ws-screen-bar",children:[$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(u1,{vendor:Q},void 0,!1,void 0,this),$.jsxDEV("b",{children:Y1(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:U},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/~/vendors/${Q}`,onClick:(F)=>{F.preventDefault(),f1([..._.split("/"),"~","vendors",Q])},children:[$.jsxDEV(B1,{name:"table-2",size:16},void 0,!1,void 0,this),"Its records"]},void 0,!0,void 0,this),J?$.jsxDEV("a",{href:J,target:"_blank",rel:"noopener noreferrer",children:[$.jsxDEV(B1,{name:"external-link",size:16},void 0,!1,void 0,this),"New tab"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),G.state==="ok"&&G.scope==="read"?$.jsxDEV("p",{className:"mode ws-screens-note",children:"You are looking read only: the screens browse, and refuse changes."},void 0,!1,void 0,this):null,q?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not say where its screens are: ",q]},void 0,!0,void 0,this):G.state==="pending"||J===void 0?$.jsxDEV("p",{className:"mode ws-screens-note",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,G.state==="error"?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not open its screens: ",G.error," ",$.jsxDEV("button",{type:"button",onClick:Z,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,G.state==="ok"&&J===null?$.jsxDEV("p",{className:"mode ws-screens-note",children:[Y1(Q),"'s pack lists no screens."]},void 0,!0,void 0,this):null,G.state==="ok"&&J?$.jsxDEV("iframe",{title:`${Y1(Q)}, as this World shows it`,src:J},Q,!1,void 0,this):null]},void 0,!0,void 0,this)}function xZ({name:_,token:Q,who:J,scope:q}){let[U,G]=r.useState(0),Z=N1(Q,`/-/${_}/twins`),F=N1(Q,`/-/${_}/rules`,U),X=F.state==="ok"?F.data.changesets:null,[Y,K]=r.useState(null),[H,L]=r.useState(null),[z,W]=r.useState(!1),[O,R]=r.useState([]),B=Y??X?.approvals??1,P=H??X?.summary??"required",A=X!==null&&(B!==(X.approvals??1)||P!==(X.summary??"required")),T=(y,D)=>{if(R((l)=>[{ok:y,text:D,at:new Date().toISOString(),n:++j5},...l].slice(0,3)),!y)j1(D,"error")},f=async(y)=>{y.preventDefault(),W(!0);try{let D=await I1(Q,`/-/${_}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:B,summary:P}})});if(!D.ok){T(!1,`Save: ${await q0(D)}`);return}T(!0,`Saved: ${B===0?"no approval":V1(B,"approval")} before a deploy; a summary ${P==="required"?"required":"generated when none is given"}.`),K(null),L(null),G((l)=>l+1)}finally{W(!1)}},C={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},w=J.person?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:J.person},void 0,!1,void 0,this),J.local?", signed in on this machine":""]},void 0,!0,void 0,this):J.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this machine"},void 0,!1,void 0,this),": no one is signed in here, so no person owns them until they are pushed by one"]},void 0,!0,void 0,this):J.admin?$.jsxDEV($.Fragment,{children:$.jsxDEV("b",{children:"the host's admin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this token"},void 0,!1,void 0,this),", a service"]},void 0,!0,void 0,this),S=Z.state==="ok"?Z.data.twins.filter((y)=>y.root?.url):[],N=q!=="write"?"This session reads the World; it changes no rules":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Changesets"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"This World's rules, kept with it and shared by everyone who works in it. A person or the World's token changes them; a key never does, so an agent cannot relax the review its own changes go through."},void 0,!1,void 0,this),$.jsxDEV(r1,{load:F,what:"the rules",lines:2},void 0,!1,void 0,this),$.jsxDEV("form",{className:"ws-rules",onSubmit:(y)=>void f(y),"aria-label":"Changeset rules",children:[$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Recorded as"},void 0,!1,void 0,this),$.jsxDEV("p",{children:["What you cut here is recorded as ",w,". An agent's or an app's key cuts as itself, for the person it was made for; a World's token cuts as a service."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"A cut's summary"},void 0,!1,void 0,this),$.jsxDEV("fieldset",{className:"choice",disabled:Boolean(N)||X===null,children:[$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:P==="required",onChange:()=>L("required")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Required: whoever cuts says what it does and why"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:P==="generated",onChange:()=>L("generated")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Generated from its changes when none is given"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Either way a cut takes every change not yet in a changeset: there is no staging."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Ready to deploy"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-rule-list",children:$.jsxDEV("li",{children:[$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this),"Verified: replayed in a throwaway World, the World's checks passing"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("label",{className:"ws-rule-row",children:[$.jsxDEV("span",{children:"Approved by"},void 0,!1,void 0,this),$.jsxDEV("select",{value:B,onChange:(y)=>K(Number(y.target.value)),disabled:Boolean(N)||X===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((y)=>$.jsxDEV("option",{value:y,children:y===0?"no one: verified is enough":y===1?"1 person":`${y} different people`},y,!1,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"for its contents as they stand"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Deploys to"},void 0,!1,void 0,this),Z.state==="ok"&&S.length===0?$.jsxDEV("p",{className:"mode",children:"No vendor here is connected to its real service, so nothing deploys from this World."},void 0,!1,void 0,this):null,S.length?$.jsxDEV("ul",{className:"ws-rule-list",children:S.map((y)=>$.jsxDEV("li",{children:[$.jsxDEV(u1,{vendor:y.twin},void 0,!1,void 0,this),Y1(y.twin),": ",C[y.root.deploy??"gated"]??"gated"]},y.twin,!0,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("a",{href:`${L1}/${_}/~/settings/services`,onClick:(y)=>{y.preventDefault(),f1([..._.split("/"),"~","settings","services"])},children:"Real services"},void 0,!1,void 0,this)," sets each vendor's deploy policy."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(i0,{log:O,name:_},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(N)||z||!A,title:N??void 0,children:z?"Saving…":"Save"},void 0,!1,void 0,this),A?$.jsxDEV("button",{type:"button",onClick:()=>{K(null),L(null)},children:"Cancel"},void 0,!1,void 0,this):null,N?$.jsxDEV("span",{className:"mode",children:[N,"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function mZ({who:_,scope:Q,snapshot:J,portal:q,onSignOut:U}){let G=Q==="write"?"Reads and changes this World":Q==="read"?"Reads this World; changes nothing":"…",[Z,F]=J?["A snapshot",`of ${J.parent}, read only`]:_.local&&_.person?[_.person,"Signed in on this machine: this World is served here, and acts as you"]:_.local?["This machine","Served here, with no one signed in: what you do is recorded as this machine"]:_.person?[_.person,q?`Signed in through ${new URL(q).host}`:"Signed in"]:_.admin?["The host's admin","Opened with the host admin token: every World it serves"]:["A link or key","Opened with a token for this World"];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Account"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-account",children:[$.jsxDEV("span",{className:"ws-account-face","aria-hidden":"true",children:$.jsxDEV(B1,{name:_.person?"user":_.local?"monitor":J?"clock":"key-round",size:20},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:Z},void 0,!1,void 0,this),$.jsxDEV("small",{children:F},void 0,!1,void 0,this),$.jsxDEV("small",{children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_.local||J?null:$.jsxDEV("p",{children:$.jsxDEV("button",{type:"button",onClick:U,children:[$.jsxDEV(B1,{name:"log-out",size:16},void 0,!1,void 0,this),_.person?"Sign out":_.admin?"Sign out of the host":"Use another token"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&_.person?$.jsxDEV("p",{className:"mode",children:["Your profile, orgs and keys are on ",$.jsxDEV("a",{href:`${q}/`,children:new URL(q).host},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function gZ({name:_,token:Q,view:J,sub:q,arg:U,win:G,who:Z,snapshot:F,onReturn:X,onSignOut:Y,worlds:K,session:H,retry:L,twins:z,map:W,branches:O,clock:R,canWrite:B,refused:P,signsAs:A,opens:T,tick:f,admin:C,onRemoved:w,onClock:S,scope:N}){let y=e_(_,Q,f,P),[D,l]=r.useState(0),p=D*1e5+Math.floor(f/2),k=N1(Q,`/-/${_}/diff`,p),b=N1(Q,`/-/${_}/changesets`,p),j=N1(Q,`/-/${_}/rules`,p),[E,V]=r.useState(null),h=(o)=>(K1)=>{K1?.preventDefault(),f1([..._.split("/"),"~",...o])},I=z.state==="ok"?z.data.twins.map((o)=>o.twin):[],v=new Map((W.state==="ok"?W.data.twins:[]).flatMap((o)=>{let K1=vZ(_,o);return K1?[[o.twin,K1]]:[]})),m=[...v.keys()],u=W.state==="ok"?W.data.twins.filter((o)=>o.root).map((o)=>o.twin):[],n=(o)=>W.state==="ok"?(W.data.twins.find((K1)=>K1.twin===o)?.resources??[]).reduce((K1,$1)=>K1+$1.count,0):0,e=O?.state==="ok"&&O.data.checkedOut||_.split("/")[1],t=r.useMemo(()=>{if(k.state!=="ok")return[];let o=new Map;for(let K1 of k.data.changes){let $1=`${K1.twin}:${K1.entry.subject.type}:${K1.entry.subject.id}`,M1=o.get($1)??{key:$1,twin:K1.twin,writes:[]};M1.writes.push(K1.entry),o.set($1,M1)}return[...o.values()]},[k]),a=t.find((o)=>o.key===E)??t[0],g=N1(Q,J==="changes"&&a?`/-/${_}/log/${a.twin}`:null,p),J1=k.state==="ok"?k.data.changes.length:0,G1=y.waiting.length,F1=y.there,c=y.origin.state==="ok"?y.origin.data.origin:null,s=!B?"This session reads the World; it changes nothing":!F1?"No remote: name one in Settings › Remote":null,_1=(o,K1,$1,M1,R1,x1)=>$.jsxDEV("a",{href:`${L1}/${_}/~/${M1}`,className:o?"on":void 0,"aria-current":o?"page":void 0,onClick:R1,children:[K1,$.jsxDEV("span",{children:$1},void 0,!1,void 0,this),x1?$.jsxDEV("span",{className:"count",children:x1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),q1=(o)=>{o.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("div",{className:"ws",children:[$.jsxDEV("div",{className:"ws-bar",role:"toolbar","aria-label":`${_} toolbar`,children:[$.jsxDEV("div",{className:"ws-left",children:[$.jsxDEV(N5,{href:`${L1}/${_}`,onClick:(o)=>{o.preventDefault(),h(["changes"])()}},void 0,!1,void 0,this),$.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"This World",children:[$.jsxDEV(B1,{name:"globe",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("b",{children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover menu-list ws-world-menu",children:[Z.local?null:$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Worlds"},void 0,!1,void 0,this),K.map((o)=>$.jsxDEV("a",{href:`${L1}/${o}`,className:o===_?"on":void 0,onClick:(K1)=>{K1.preventDefault(),q1(K1),f1(o.split("/"))},children:[o===_?$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(B1,{name:"globe",size:16},void 0,!1,void 0,this),o]},o,!0,void 0,this)),$.jsxDEV("a",{href:`${H0()&&H0()!==O1?H0():""}${L1}/`,onClick:(o)=>{if(H0()&&H0()!==O1)return;o.preventDefault(),q1(o),f1([])},children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",i1()?` on ${new URL(i1()).host}`:""]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Connect an app"},void 0,!1,void 0,this),i1()?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key made on the platform; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[l0,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(i6,{text:N4({platform:i1(),world:_})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!Z.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key from Settings › Access; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[l0,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(i6,{text:N4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Run it in this World; its calls to these vendors land here:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-menu-text mode",children:["Or point an SDK at ",$.jsxDEV("code",{children:[l0,"/",_,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",$.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),$.jsxDEV(i6,{text:N4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/~/settings`,onClick:(o)=>{q1(o),h(["settings"])(o)},children:[$.jsxDEV(B1,{name:"settings",size:16},void 0,!1,void 0,this),"Settings…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(VZ,{name:_,token:Q,branches:O,opens:T,refused:P,onChanged:S},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-where",title:"Where this is",children:[$.jsxDEV("span",{children:_},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("span",{children:e},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),c?$.jsxDEV("a",{href:`${L1}/${_}/~/remote`,onClick:h(["remote"]),children:["origin ",c.namespace,G1?$.jsxDEV("b",{children:[" ↑",G1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("a",{href:`${L1}/${_}/~/remote`,onClick:h(["remote"]),children:"no remote"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/~/settings/clock`,onClick:h(["settings","clock"]),children:R.state==="ok"?$.jsxDEV($.Fragment,{children:[R.data.frozen?"stopped at ":"",$.jsxDEV(w1,{iso:R.data.at,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-right",children:[$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void y.pull(),disabled:Boolean(s)||y.busy!==null,title:s??`Fetch what ${F1} has and move this branch onto it`,children:[$.jsxDEV(B1,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),y.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void y.push(),disabled:Boolean(s)||y.busy!==null||G1===0,title:s??(G1?`Push ${V1(G1,"changeset")} to ${F1}`:`Every changeset is at ${F1}`),children:[$.jsxDEV(B1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),y.busy==="Push"?"Pushing…":"Push",G1?$.jsxDEV("span",{className:"ws-btn-count",children:G1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn icon-only","aria-label":"Settings",title:"Settings",onClick:()=>h(["settings"])(),children:$.jsxDEV(B1,{name:"settings",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F?$.jsxDEV("div",{className:"ws-banner",role:"region","aria-label":"Snapshot",children:[$.jsxDEV(B1,{name:"clock",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:["You are looking at ",$.jsxDEV("b",{children:F.parent},void 0,!1,void 0,this)," as it was at ",$.jsxDEV(w1,{iso:F.at},void 0,!1,void 0,this),": a read-only snapshot",F.expiresAt?$.jsxDEV($.Fragment,{children:[", gone ",$.jsxDEV(w1,{iso:F.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void X(F),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,y.log.length?$.jsxDEV("div",{className:"ws-said",children:$.jsxDEV(i0,{log:y.log.slice(0,1),name:_},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV("div",{className:"ws-body",children:[$.jsxDEV("nav",{className:"ws-side","aria-label":`${_} places`,children:[I.length?$.jsxDEV("a",{href:`${L1}/${_}/~/screens`,className:J==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:h(["screens"]),title:`The board: ${L2(I.map(Y1))}`,children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Board"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-screens-marks",children:[I.slice(0,3).map((o)=>$.jsxDEV(u1,{vendor:o},o,!1,void 0,this)),I.length>3?$.jsxDEV("span",{className:"more",children:["+",I.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),_1(J==="changes"||J==="history",$.jsxDEV(B1,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",h(["changes"]),t.length?String(t.length):void 0),_1(J==="events"&&!U||J==="trace",$.jsxDEV(B1,{name:"activity",size:16},void 0,!1,void 0,this),"Events","events",h(["events"])),$.jsxDEV("p",{className:"side-group",children:"Records"},void 0,!1,void 0,this),I.map((o)=>$.jsxDEV(r.default.Fragment,{children:_1(J==="vendor"&&U===o,$.jsxDEV(u1,{vendor:o},void 0,!1,void 0,this),Y1(o),`vendors/${o}`,h(["vendors",o]),n(o)?String(n(o)):void 0)},o,!1,void 0,this)),$.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),_1(!1,$.jsxDEV(B1,{name:"cloud",size:16},void 0,!1,void 0,this),F1?"origin":"Name a remote…","remote",h(["remote"]),G1?`↑${G1}`:void 0)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-main",role:"main",children:[J==="changes"?$.jsxDEV("div",{className:"ws-status",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(c_,{name:_,view:"changes",changes:t.length,changesets:b.state==="ok"?b.data.changesets.length:0},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:"Not in a changeset"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:k.state==="ok"?`${V1(t.length,"record")} · ${V1(J1,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(r1,{load:k,what:"the changes",lines:4},void 0,!1,void 0,this),$.jsxDEV(p_,{records:t,...a?{selected:a.key}:{},onPick:V,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:[k.state==="ok"&&!a?$.jsxDEV(x2,{title:"No changes on this branch",action:G1>0&&F1?$.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(s)||y.busy!==null,onClick:()=>void y.push(),children:["Push ",V1(G1,"changeset")," to origin"]},void 0,!0,void 0,this):void 0,children:$.jsxDEV("p",{children:["What your app writes to this World lands here, record by record, to cut into a changeset. Everything since ",k.data.base.at?$.jsxDEV(w1,{iso:k.data.base.at},void 0,!1,void 0,this):$.jsxDEV("code",{children:k.data.base.id},void 0,!1,void 0,this)," is in one already."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,a?$.jsxDEV(g_,{record:a,history:g.state==="ok"?g.data.entries:g.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(HF,{pinned:!0,generated:j.state==="ok"&&j.data.changesets.summary==="generated",author:{face:$.jsxDEV(B1,{name:Z.person?"user":Z.local?"monitor":"key-round",size:18},void 0,!1,void 0,this),who:Z.person??(Z.local?"This machine":Z.admin?"The host's admin":"A token"),account:`${L1}/${_}/~/settings/account`,branch:e},name:_,token:Q,changes:J1,canWrite:B,refused:P,onCut:()=>{l((o)=>o+1),V(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,J==="history"?$.jsxDEV(uZ,{name:_,token:Q,sets:b,changes:t.length,withScreens:m,required:j.state==="ok"?j.data.changesets.approvals??1:1,...q?{sub:q}:{},signsAs:A,canWrite:B,rooted:u,refused:P,onChanged:()=>l((o)=>o+1)},void 0,!1,void 0,this):null,J==="events"?$.jsxDEV(bZ,{name:_,token:Q,vendors:I,...U&&I.includes(U)?{vendor:U}:{},tick:f},U??"",!1,void 0,this):null,J==="trace"?$.jsxDEV(DZ,{name:_,token:Q,id:U??""},void 0,!1,void 0,this):null,J==="vendor"&&U?$.jsxDEV(hZ,{name:_,token:Q,vendor:U,withScreens:m.includes(U),tick:f},U,!1,void 0,this):null,J==="screen"&&U?$.jsxDEV(EZ,{name:_,vendor:U,url:W.state==="ok"?v.get(U)??null:void 0,...W.state==="error"?{mapError:W.error}:{},holding:cZ(W.state==="ok"?W.data.twins.find((o)=>o.twin===U)?.resources??[]:[]),session:H,retry:L},U,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(n1,{open:G?.kind==="settings",onClose:()=>h(["changes"])(),title:"Settings",wide:"window",children:G?.kind==="settings"?$.jsxDEV("div",{className:"ws-settings",children:[$.jsxDEV("nav",{"aria-label":"Settings",children:m_.map(([o,K1,$1])=>$.jsxDEV("a",{href:`${L1}/${_}/~/settings/${o}`,className:G.tab===o?"on":void 0,"aria-current":G.tab===o?"page":void 0,onClick:h(["settings",o]),children:[$.jsxDEV(B1,{name:$1,size:16},void 0,!1,void 0,this),K1]},o,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-settings-pane",children:[N==="read"?$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"badge read-only",children:"Read only"},void 0,!1,void 0,this)," This session reads the World; it changes nothing."]},void 0,!0,void 0,this):null,G.tab==="account"?$.jsxDEV(mZ,{who:Z,scope:N,snapshot:F,portal:i1(),onSignOut:Y},void 0,!1,void 0,this):null,G.tab==="changesets"?$.jsxDEV(xZ,{name:_,token:Q,who:Z,scope:N},void 0,!1,void 0,this):null,G.tab==="remote"?$.jsxDEV(XF,{name:_,token:Q,canWrite:B,tick:f,refused:P},void 0,!1,void 0,this):null,G.tab==="access"||G.tab==="services"||G.tab==="checks"||G.tab==="clock"?$.jsxDEV(LF,{name:_,token:Q,admin:C,canWrite:B,refused:P,onRemoved:w,only:G.tab},void 0,!1,void 0,this):null,G.tab==="vault"?$.jsxDEV(YF,{name:_,token:Q,canWrite:B,refused:P},void 0,!1,void 0,this):null,G.tab==="appearance"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV(NZ,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV(n1,{open:G?.kind==="branches",onClose:()=>h(["changes"])(),title:"Branches",wide:!0,children:G?.kind==="branches"?$.jsxDEV(iZ,{name:_,token:Q,canWrite:B,branches:O,opens:T,...G.open?{open:G.open}:{},onChanged:S,refused:P},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function i6({text:_}){return $.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>j1("Copied the prompt: paste it into your coding agent"),()=>j1("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var _8=(_)=>`${_.url.replace(/\/+$/,"")}/${_.namespace}`,pZ=(_)=>_.filter((Q)=>Q.applied===null||Q.applied.outcome==="refused"),cZ=(_,Q=4)=>{let J=[..._].filter((q)=>q.count>0).sort((q,U)=>U.count-q.count);return J.length?J.slice(0,Q).map((q)=>V1(q.count,q.type.replace(/^_+/,""))).join(" · ")+(J.length>Q?` · +${J.length-Q} more`:""):"nothing yet"},l_=$.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:$.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this);function lZ({name:_,token:Q,clock:J,canWrite:q,onChanged:U,refused:G,open:Z}){let[F,X]=r.useState(!1),[Y,K]=r.useState(""),[H,L]=r.useState(""),[z,W]=r.useState(null),[O,R]=r.useState(!1),B=J.state==="ok"?J.data:null,P=async(C,w,S)=>{R(!0),W(null);try{let N=await I1(Q,`/-/${_}/${w}`,{method:w==="clock"?"PUT":"POST",body:JSON.stringify(S)});if(!N.ok){G(N),W({ok:!1,text:await q0(N)});return}let y=await N.json();W({ok:!0,text:`${C} — the World is at ${new Date(y.at).toLocaleString()}`}),X(!1),U()}catch(N){W({ok:!1,text:`the World did not answer: ${N instanceof Error?N.message:String(N)}`})}finally{R(!1)}},A=(C)=>{C.preventDefault();let w=new Date(Y);if(Number.isNaN(w.getTime())){W({ok:!1,text:"Pick a date and time."});return}if(B&&w.getTime()<Date.parse(B.at)){W({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(B.at).toLocaleString()}.`});return}P("Clock set","clock",{at:w.toISOString()})},T=(C,w)=>{P(`Advanced ${w}`,"clock/advance",{by:C})},f=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return $.jsxDEV("div",{className:`clock${B?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[$.jsxDEV("p",{className:"clock-now",children:J.state==="loading"?$.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):J.state==="error"?$.jsxDEV("span",{className:"mode",children:["Clock: ",J.error]},void 0,!0,void 0,this):B.frozen?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",$.jsxDEV("strong",{children:$.jsxDEV(w1,{iso:B.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:["World time ",$.jsxDEV("strong",{children:$.jsxDEV(w1,{iso:B.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"· real time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&B?$.jsxDEV("details",{className:Z?"clock-more inline":"clock-more",open:Z||void 0,children:[$.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),$.jsxDEV("div",{className:Z?void 0:"popover",children:[$.jsxDEV("p",{className:"mode",children:"Move this World's clock forward to see what happens later: renewals, expiries, scheduled sends. Like a test clock, it only moves forward; to look back, the branch picker’s Manage branches… views an earlier moment."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"clock-controls",children:[$.jsxDEV("button",{type:"button","aria-expanded":F,onClick:()=>{X(!F),K(l2(I_(B.at))),W(null)},children:"Set time…"},void 0,!1,void 0,this),$.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[$.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),f.map(([C,w])=>$.jsxDEV("button",{type:"button","aria-label":`Advance ${w}`,disabled:O||!B.frozen,title:B.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>T(C,w),children:w},C,!1,void 0,this)),$.jsxDEV("form",{className:"inline",onSubmit:(C)=>{if(C.preventDefault(),!/^\d+[smhd]$/.test(H.trim())){W({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}T(H.trim(),`by ${H.trim()}`)},children:[$.jsxDEV("label",{className:"sr",children:["Advance by ",$.jsxDEV("input",{name:"advanceBy",value:H,onChange:(C)=>L(C.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!B.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:O||!B.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!B.frozen?$.jsxDEV("p",{className:"mode",children:"The World runs on real time. Set a time to start simulating; then advance it."},void 0,!1,void 0,this):null,F?$.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:A,noValidate:!0,children:[$.jsxDEV("label",{children:["World time ",$.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:Y,min:l2(I_(B.at)),onChange:(C)=>K(C.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",disabled:O,children:"Set time"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>X(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,z?$.jsxDEV("p",{role:z.ok?"status":"alert",children:z.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function rZ({name:_,token:Q,clock:J,refused:q}){let[U,G]=r.useState(!1),[Z,F]=r.useState(""),[X,Y]=r.useState(null),[K,H]=r.useState(!1),L=J.state==="ok"?J.data.at:new Date().toISOString(),z=r.useRef(null);return r.useEffect(()=>{if(!U)return;let O=(B)=>{if(B.key==="Escape"&&!document.querySelector("dialog[open]"))G(!1),z.current?.querySelector("button")?.focus()},R=(B)=>{if(!z.current?.contains(B.target))G(!1)};return document.addEventListener("keydown",O),document.addEventListener("click",R),()=>{document.removeEventListener("keydown",O),document.removeEventListener("click",R)}},[U]),$.jsxDEV("div",{className:"as-of",ref:z,children:[$.jsxDEV("button",{type:"button","aria-expanded":U,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{G(!U),F(l2(L)),Y(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),U?$.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(O)=>{O.preventDefault(),Y(null);let R=new Date(Z);if(Number.isNaN(R.getTime())){Y("Pick a date and time.");return}if(R.getTime()>Date.parse(L)){Y(`That is after the World's present (${new Date(L).toLocaleString()}); a snapshot looks back.`);return}H(!0);try{let B=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:R.toISOString()},ttl:3600})});if(!B.ok){q(B),Y(await q0(B));return}let P=await B.json();t6({name:P.name,parent:_,token:P.token,readToken:P.readToken,at:R.toISOString(),expiresAt:P.expiresAt??null,parentOrigin:O1,made:!0});let A=y5(P.origin)?.origin;if(A&&A!==O1){e6(A,P.readToken,P.name,`${L1}/${P.name}`);return}f1(P.name.split("/"))}catch(B){Y(`the World did not answer: ${B instanceof Error?B.message:String(B)}`)}finally{H(!1)}},noValidate:!0,children:[$.jsxDEV("label",{children:["As of ",$.jsxDEV("input",{name:"asOf",type:"datetime-local",value:Z,max:l2(L),onChange:(O)=>F(O.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:K,children:K?"Opening…":"Open snapshot"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Opens a read-only copy of this World as it was then; the copy goes away within the hour."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,X?$.jsxDEV("p",{role:"alert",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function r_({name:_,token:Q,open:J,onClose:q,onMade:U,refused:G}){let Z=(w)=>w.split("/").pop()??w,[F,X]=r.useState(!1),[Y,K]=r.useState(null),[H,L]=r.useState(""),[z,W]=r.useState("now"),[O,R]=r.useState(""),[B,P]=r.useState("24"),[A,T]=r.useState(!0);r.useEffect(()=>{if(J)K(null),R(l2(new Date().toISOString()))},[J]);let f=async(w)=>{w.preventDefault(),K(null);let S=z==="at"?new Date(O):null;if(S&&Number.isNaN(S.getTime())){K("Pick a date and time, or make it as of now.");return}if(S&&S.getTime()>Date.now()){K("A branch is made as of now or a moment before it.");return}X(!0);let N=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({ttl:Math.round(Number(B)*3600),...S?{at:{instant:S.toISOString()}}:A?{live:!0}:{},...H.trim()?{label:H.trim()}:{}})}).catch(()=>null);if(X(!1),!N){K(`${O1} did not answer`);return}if(!N.ok){G(N),K(await q0(N));return}let y=await N.json();t6({name:y.name,parent:_,token:y.token??"",readToken:y.readToken,at:(S??new Date).toISOString(),expiresAt:y.expiresAt??null,parentOrigin:O1,...y.origin?{origin:y.origin}:{}}),q(),L(""),j1(`Made ${Z(y.name)}`),U()};return $.jsxDEV(n1,{open:J,onClose:()=>{if(!F)q()},title:`New branch of ${Z(_)}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>q(),disabled:F,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"new-branch",className:"primary",disabled:F,children:F?"Making…":"Make branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"new-branch",onSubmit:(w)=>void f(w),className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Label ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"branchLabel",value:H,onChange:(w)=>L(w.target.value.toLowerCase()),placeholder:"checkout-flow",pattern:"[a-z0-9][a-z0-9\\-]{0,23}",maxLength:24},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("fieldset",{className:"choice",children:[$.jsxDEV("legend",{children:"From"},void 0,!1,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="now",onChange:()=>W("now")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Now: the World as it is"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="now"?$.jsxDEV("label",{className:"check sub",children:[$.jsxDEV("input",{type:"checkbox",name:"branchLive",checked:A,onChange:(w)=>T(w.target.checked)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Live: its clock keeps this World's time, as a pull request's preview does (else it stops now)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="at",onChange:()=>W("at")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"An instant before now: the World as it was then, its clock stopped there"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="at"?$.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:O,max:l2(new Date().toISOString()),onChange:(w)=>R(w.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"branchLife",value:B,onChange:(w)=>P(w.target.value),children:[$.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"168",children:"7 days"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"alert",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function iZ({name:_,token:Q,canWrite:J,branches:q,opens:U,open:G,onChanged:Z,refused:F,snapshotOf:X}){let Y=N1(Q,`/-/${_}/clock`),K=(P)=>P.split("/").pop()??P,[H,L]=r.useState(!1),z=(P)=>(A)=>{A.preventDefault(),f1([..._.split("/"),"~","branches",...P?P.split("/"):[]])};if(!q)return $.jsxDEV("p",{className:"mode",children:"This host makes no branches of a World."},void 0,!1,void 0,this);let W=q.state==="ok"?q.data.branches:[],O=q.state==="ok"&&(q.data.named?.length??0)>0?q.data.named:[{name:K(_),running:!0}],R=q.state==="ok"?q.data.checkedOut??K(_):K(_),B=async(P)=>{if(!await T0({title:`Remove the branch ${K(P)}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Remove branch",danger:!0}))return;let A=await I1(Q,`/-/${_}/branches/${P}`,{method:"DELETE"}).catch((T)=>T);if(A instanceof Error){j1(`Remove ${K(P)}: the World did not answer (${A.message})`,"error");return}if(!A.ok){F(A),j1(`Remove ${K(P)}: ${await q0(A)}`,"error");return}k4(P),j1(`Removed ${K(P)}`),Z(),f1([..._.split("/"),"~","branches"])};if(G){let P=G.includes("/")?W.find((T)=>T.name===G):void 0,A=G.includes("/")?void 0:O.find((T)=>T.name===G);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${L1}/${_}/~/branches`,onClick:z(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(r1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"&&!P&&!A?$.jsxDEV("p",{className:"mode",children:["This World has no branch named ",G,"."]},void 0,!0,void 0,this):null,P?$.jsxDEV(dZ,{name:_,b:P,canWrite:J,opens:U(P.name),remove:()=>void B(P.name)},void 0,!1,void 0,this):null,A&&!P?$.jsxDEV(aZ,{name:_,token:Q,b:A,served:A.name===R,canWrite:J,canServe:q.state==="ok"&&Boolean(q.data.canServe)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}return $.jsxDEV("div",{"aria-labelledby":"branches",children:[$.jsxDEV("div",{className:"branches-head",children:[$.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",$.jsxDEV("b",{children:R},void 0,!1,void 0,this),". Each branch's name opens its page."]},void 0,!0,void 0,this),J?$.jsxDEV("div",{className:"head-actions",children:[X?null:$.jsxDEV(rZ,{name:_,token:Q,clock:Y,refused:F},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>L(!0),children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(r1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:[O.map((P)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:[$.jsxDEV("a",{href:`${L1}/${_}/~/branches/${P.name}`,onClick:z(P.name),children:$.jsxDEV("b",{children:P.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),P.name===R?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):P.running?null:$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge",children:"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this)]},`own:${P.name}`,!0,void 0,this)),W.map((P)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("a",{href:`${L1}/${_}/~/branches/${P.name}`,onClick:z(P.name),children:$.jsxDEV("b",{children:K(P.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:K(P.from??_)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P.at?.instant?$.jsxDEV(w1,{iso:P.at.instant},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV(w1,{iso:P.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P.expiresAt?$.jsxDEV(w1,{iso:P.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},P.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV(r_,{name:_,token:Q,open:H,onClose:()=>L(!1),onMade:Z,refused:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function dZ({name:_,b:Q,canWrite:J,opens:q,remove:U}){let G=(X)=>X.split("/").pop()??X,Z=o6(Q.name),F=N1(Z,Z?`/-/${Q.name}/diff`:null);return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[l_," ",G(Q.name)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>x_(Q.name,Q.name.split("/")),children:"Open"},void 0,!1,void 0,this):null,J?$.jsxDEV("button",{type:"button",className:"danger-button",onClick:U,children:"Remove…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:Q.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:G(Q.from??_)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.at?.instant?$.jsxDEV(w1,{iso:Q.at.instant},void 0,!1,void 0,this):"live: it keeps its parent's time"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(w1,{iso:Q.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Goes away"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.expiresAt?$.jsxDEV(w1,{iso:Q.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),!q?$.jsxDEV("p",{className:"mode",children:"Its tokens were handed to whoever made it: it opens, and shows its own changes, in their tab."},void 0,!1,void 0,this):null,F.state==="ok"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Its changes"},void 0,!1,void 0,this),F.data.changes.length===0?$.jsxDEV("p",{className:"mode",children:"Nothing written on it since it branched."},void 0,!1,void 0,this):$.jsxDEV(FF,{changes:F.data.changes,idPrefix:`branch-${G(Q.name)}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function aZ({name:_,token:Q,b:J,served:q,canWrite:U,canServe:G}){let[Z,F]=r.useState(!1),[X,Y]=r.useState(null),K=async()=>{F(!0),Y(null);let H=await I1(Q,`/-/${_}/branches/${encodeURIComponent(J.name)}/serve`,{method:"POST"}).catch(()=>null);if(H?.ok){location.reload();return}F(!1),Y(H?await q0(H):`${O1} did not answer`)};return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[l_," ",J.name," ",q?$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:U&&G&&!q?$.jsxDEV("button",{type:"button",className:"primary",disabled:Z,onClick:()=>void K(),children:Z?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:J.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Kind"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:"one of this World's own branches"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"State"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:J.running?"running":"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("p",{className:"mode",children:["This is the branch these pages show: its changes are on ",$.jsxDEV("a",{href:`${L1}/${_}/~/changes`,onClick:(H)=>{H.preventDefault(),f1([..._.split("/"),"~","changes"])},children:"Changes"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):G?$.jsxDEV("p",{className:"mode",children:["“Serve here” stops this one's twins and serves ",J.name," in its place."]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode",children:"This host serves one of the World's own branches at a time, and does not switch them from this page."},void 0,!1,void 0,this),X?$.jsxDEV("p",{role:"alert",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var N_=50,g2=(_)=>`${_.twin}:${_.position}`,i_=(_,Q)=>Date.parse(Q.entry.occurredAt)-Date.parse(_.entry.occurredAt)||_.twin.localeCompare(Q.twin)||Q.position-_.position,v4=(_)=>{if(!_)return"someone";if(_.startsWith("key:")){let[Q,J]=_.slice(4).split(" for:");return J?`${Q}, for ${J}`:Q||"a key"}if(_.startsWith("person:"))return _.slice(7);return _==="machine"?"this machine":_==="person"?"a session with no name":_==="token:read"?"the read-only token":_==="token"?"the World's token":_},k5=(_,Q)=>{let J=typeof Q==="string"?Q:typeof _.caller==="string"?_.caller:"";if(J.startsWith("key:")&&J.length>4)return`by ${v4(J)}`;if(J.startsWith("person:")&&J.length>7)return`by ${J.slice(7)}`;if(J==="machine")return"by this machine";if(J==="person")return"by a session with no name";if(J==="key")return"by a key";if(J==="token:read")return"by the read-only token";if(J==="token")return"by the World's token";return _.actor?.kind==="system"?"by the vendor":_.actor?.id?`by ${_.actor.id}`:"by an app"},d_=(_)=>_.operation??_.op;function sZ(_){let Q=_.fields??{},J=Q.usage!==null&&typeof Q.usage==="object"?Q.usage:Q,q=(...Y)=>Y.map((K)=>J[K]??Q[K]).find((K)=>typeof K==="number"),U=[],G=q("prompt_tokens","input_tokens"),Z=q("completion_tokens","output_tokens"),F=q("total_tokens");if(G!==void 0)U.push(["tokens in",G.toLocaleString()]);if(Z!==void 0)U.push(["tokens out",Z.toLocaleString()]);if(F!==void 0)U.push(["tokens in all",F.toLocaleString()]);let X=q("cost_usd","cost");if(X!==void 0)U.push(["cost",`$${X<0.01?X.toPrecision(2):X.toFixed(2)}`]);return U}function a_({text:_,at:Q=280}){if(_.length<=Q)return $.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this);return $.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:[$.jsxDEV("span",{className:"text",children:[_.slice(0,Q),"…"]},void 0,!0,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:["show all ",_.length.toLocaleString()," characters"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function v0({v:_}){if(typeof _==="string")return $.jsxDEV(a_,{text:_},void 0,!1,void 0,this);if(_===null||typeof _!=="object")return $.jsxDEV("code",{children:String(_)},void 0,!1,void 0,this);let Q=JSON.stringify(_,null,2);return Q.length<=160?$.jsxDEV("code",{children:JSON.stringify(_)},void 0,!1,void 0,this):$.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:$.jsxDEV("code",{children:[JSON.stringify(_).slice(0,120),"…"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("pre",{children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var tZ=(_)=>typeof _==="string"?_:Array.isArray(_)?_.map((Q)=>Q&&typeof Q==="object"&&typeof Q.text==="string"?Q.text:"").filter(Boolean).join(`
|
|
36
|
+
`):JSON.stringify(_??"");function oZ({body:_}){if(_===null||typeof _!=="object"||Array.isArray(_))return $.jsxDEV(v0,{v:_},void 0,!1,void 0,this);let Q=_,J=Array.isArray(Q.messages)?Q.messages:null,q=Object.entries(Q).filter(([U])=>!(J&&U==="messages"));return $.jsxDEV($.Fragment,{children:[q.length?$.jsxDEV("dl",{className:"fields",children:q.map(([U,G])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:U},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(v0,{v:G},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},U,!0,void 0,this))},void 0,!1,void 0,this):null,J?$.jsxDEV("ol",{className:"messages",children:J.map((U,G)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:"role",children:typeof U.role==="string"?U.role:"message"},void 0,!1,void 0,this),$.jsxDEV(a_,{text:tZ(U.content)},void 0,!1,void 0,this)]},G,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function s_({fields:_}){let Q=Object.entries(_??{});if(Q.length===0)return $.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return $.jsxDEV("dl",{className:"fields",children:Q.map(([J,q])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:J},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(v0,{v:q},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},J,!0,void 0,this))},void 0,!1,void 0,this)}var nZ=(_)=>_.receipt?`${_.receipt.status??""}${_.receipt.externalId?` · ${_.receipt.externalId}`:""}${_.receipt.reason?` · ${_.receipt.reason}`:""}`:_.operation==="observed"?"observed from the vendor":_.provenance==="placeholder"?"default data":"none: it has not left this World";function eZ(_){let Q=new Map,J=[],q=[],U=new Map;for(let G of _){if(G.entry.landsId||G.entry.aliasOf){q.push(G);continue}let Z={...G,copies:[]};if(J.push(Z),!Q.has(`${G.twin}:${G.entry.id}`))Q.set(`${G.twin}:${G.entry.id}`,Z);if(!U.has(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`))U.set(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`,Z)}for(let G of q){let Z=G.entry.landsId?Q.get(`${G.twin}:${G.entry.landsId}`):G.entry.aliasOf?U.get(`${G.twin}:${G.entry.subject.type}:${G.entry.aliasOf}`):void 0;if(Z)Z.copies.push(G);else J.push({...G,copies:[]})}return J.sort(i_)}var d6={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function C_(_){let Q=[_.entry.receipt,..._.copies.map((U)=>U.entry.receipt)].filter((U)=>Boolean(U?.status));if(Q.length===0)return null;let J=Q.find((U)=>U.status==="failed"||U.status==="refused"),q=[...Q].sort((U,G)=>(d6[G.status]??0)-(d6[U.status]??0))[0];return J&&!(d6[q.status]>=5)?{status:J.status,bad:!0}:{status:q.status,bad:!1}}var p2=1280,c2=820,C4=160,C5=72,S_=72,E1=(_)=>`${_.vendor}:${_.id}`,z2=(_)=>`${_.vendor}:section:${_.section.id}`,Q8=(_)=>[_.section.id,..._.section.aka??[]].map((Q)=>`${_.vendor}:section:${Q}`),_F=(_,Q)=>Q.at&&("site"in Q.at)?Q.at.site:Q.at?`${l0}/${_}/${Q.vendor}${Q.at.screen}`:null,QF=(_,Q)=>_.include?Q.filter((J)=>_.include.includes(E1(J))||Q8(J).some((q)=>_.include.includes(q))):Q.filter((J)=>!(_.hidden??[]).includes(E1(J)));function JF({data:_}){let{world:Q,frame:J,url:q,active:U,boards:G,addTo:Z,remove:F}=_,X=E1(J),Y=G.filter((K)=>K.include&&!K.include.includes(X)&&!Q8(J).some((H)=>K.include.includes(H)));return $.jsxDEV($.Fragment,{children:[$.jsxDEV(X_,{isVisible:!0,position:Z1.Top,align:"start",className:"frame-label",children:[$.jsxDEV(u1,{vendor:J.vendor},void 0,!1,void 0,this),$.jsxDEV("span",{children:[Y1(J.vendor)," · ",J.kind]},void 0,!0,void 0,this),J.changes?$.jsxDEV("a",{className:"frame-changed nodrag",href:`${L1}/${Q}/~/changes`,onClick:(K)=>{K.preventDefault(),f1([...Q.split("/"),"~","changes"])},title:`${V1(J.changes,"change")} here, not in a changeset: see them in Changes`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),J.changes]},void 0,!0,void 0,this):null,Y.length?$.jsxDEV("select",{className:"nodrag frame-add",value:"","aria-label":`Add ${J.title} to a board`,onChange:(K)=>{if(K.target.value)Z(K.target.value,X)},children:[$.jsxDEV("option",{value:"",children:"Add to board…"},void 0,!1,void 0,this),Y.map((K)=>$.jsxDEV("option",{value:K.id,children:K.name},K.id,!1,void 0,this))]},void 0,!0,void 0,this):null,F?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>F.act(X),title:F.label,"aria-label":F.label,children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame on":"frame",style:{width:p2,height:c2},children:[$.jsxDEV("div",{className:"frame-bar",title:"Drag to move",children:[$.jsxDEV(u1,{vendor:J.vendor},void 0,!1,void 0,this),$.jsxDEV("strong",{children:J.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"frame-url",children:J.url.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),q?$.jsxDEV("a",{className:"nodrag",href:q,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${J.title} in a new tab`,children:"↗"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame-body nodrag nopan nowheel":"frame-body",children:q?$.jsxDEV("iframe",{title:J.title,src:q,loading:"lazy",style:{pointerEvents:U?"auto":"none"}},void 0,!1,void 0,this):$.jsxDEV("div",{className:"frame-none",children:[$.jsxDEV("p",{children:$.jsxDEV("strong",{children:J.unseen==="sites-not-routed"?`This World shows ${J.title} only at its own local address.`:`${Y1(J.vendor)}'s twin draws no page for this ${J.kind} yet.`},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:J.url},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function $F({data:_}){return $.jsxDEV("div",{className:"section-box",style:{width:_.width,height:_.height},children:$.jsxDEV("span",{className:"section-label",children:[$.jsxDEV(u1,{vendor:_.vendor},void 0,!1,void 0,this),_.label]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var qF={screen:JF,section:$F};function UF(_){return $.jsxDEV(x6,{children:$.jsxDEV(GF,{..._},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function GF({name:_,token:Q,session:J,retry:q,snapshot:U,back:G,canWrite:Z}){let F=r.useRef(null),X=r.useRef(0),Y=r.useRef(Promise.resolve()),K=r.useRef(0),[,H]=r.useState(0),[L,z]=r.useState({state:"loading"}),[W,O]=r.useState(null),R=r.useRef(0),B=r.useRef(0),P=r.useCallback(async()=>{let c=K.current,s=++R.current,_1=await I1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),q1=_1?.ok?await _1.json().catch(()=>null):null;if(s<B.current)return;if(B.current=s,!q1?.frames||!q1.boards||!q1.version){let o=_1?`the World answered ${_1.status}`:"the World did not answer";z((K1)=>K1.state==="ok"?K1:{state:"error",status:_1?.status??0,error:o}),O(o);return}if(O(null),c===K.current&&X.current===0)F.current={boards:q1.boards,version:q1.version};z({state:"ok",data:q1})},[Q,_]);r.useEffect(()=>{P();let c=setInterval(()=>{if(!document.hidden)P()},1e4);return()=>clearInterval(c)},[P]);let A=L.state==="ok"?L.data.frames:[],T=F.current?.boards??[{id:"everything",name:"Everything"}],[f,C]=r.useState("everything"),w=T.find((c)=>c.id===f)??T[0],S=Z&&!U,N=r.useCallback((c)=>{if(!F.current)return j1("The board is being read again: make that change once it shows","error"),Promise.resolve();F.current={...F.current,boards:c(F.current.boards)},X.current+=1,K.current+=1,H((_1)=>_1+1);let s=Y.current.then(async()=>{let _1=F.current;if(!_1)return;try{let q1=await I1(Q,`/-/${_}/board`,{method:"PUT",body:JSON.stringify({boards:_1.boards,version:_1.version}),signal:AbortSignal.timeout(15000)}),o=await q1.json().catch(()=>null);if(q1.ok&&o?.boards&&o.version)F.current={boards:X.current>1&&F.current?F.current.boards:o.boards,version:o.version};else if(q1.status===409&&o?.boards&&o.version)F.current={boards:o.boards,version:o.version},j1("Someone else changed the board first: it is shown as they left it","error");else throw Error(o?.error??`the World answered ${q1.status}`)}catch(q1){j1(`The board was not kept: ${q1 instanceof Error?q1.message:String(q1)}`,"error"),F.current=null;let o=await I1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),K1=o?.ok?await o.json().catch(()=>null):null;if(K1?.boards&&K1.version)F.current={boards:K1.boards,version:K1.version}}}).finally(()=>{if(X.current-=1,K.current+=1,H((_1)=>_1+1),X.current===0&&!F.current)P()});return Y.current=s,s},[Q,_,P]),y=(c,s)=>{N((_1)=>_1.map((q1)=>q1.id===c?s(q1):q1))},D=QF(w,A),l=A.filter((c)=>c.changes&&!D.includes(c)).reduce((c,s)=>c+s.changes,0),[p,k]=r.useState(null),b=w5(),j=r.useCallback(()=>{let c=new Map;for(let $1 of D){let M1=w.placed?.[E1($1)];if(M1)c.set(E1($1),M1)}let s=Math.max(-C4,...[...c.values()].map(($1)=>$1.y+c2)),_1=[...new Set(D.map(z2))];for(let $1 of _1){let M1=D.filter((k1)=>z2(k1)===$1),R1=M1.filter((k1)=>c.has(E1(k1))).map((k1)=>c.get(E1(k1))),x1=R1.length?Math.max(...R1.map((k1)=>k1.x))+p2+C4:0,U0=R1.length?Math.min(...R1.map((k1)=>k1.y)):s+C4+C5*2+S_;for(let k1 of M1)if(!c.has(E1(k1)))c.set(E1(k1),{x:x1,y:U0}),x1+=p2+C4;s=Math.max(s,U0+c2)}let q1=T.filter(($1)=>$1.include),o=($1,M1)=>y($1,(R1)=>({...R1,include:[...R1.include??[],M1]})),K1={label:w.include?"Take it off this board":"Hide it",act:($1)=>y(w.id,(M1)=>M1.include?{...M1,include:M1.include.filter((R1)=>R1!==$1)}:{...M1,hidden:[...M1.hidden??[],$1]})};return D.map(($1)=>({id:E1($1),type:"screen",dragHandle:".frame-bar",draggable:S,position:c.get(E1($1)),data:{world:_,frame:$1,url:_F(_,$1),active:!1,boards:S?q1:[],addTo:o,remove:!S||w.include&&!w.include.includes(E1($1))?null:K1}}))},[JSON.stringify(D),JSON.stringify(w),JSON.stringify(T.map((c)=>[c.id,c.name,c.include])),_,S]),[E,V,h]=q_([]),I=r.useRef("");r.useEffect(()=>{let c=j();if(V(c.map((s)=>({...s,data:{...s.data,active:s.id===p}}))),c.length&&I.current!==w.id)I.current=w.id,requestAnimationFrame(()=>{b.fitView({padding:0.08,duration:0})})},[j,V]),r.useEffect(()=>{V((c)=>c.map((s)=>s.data.active===(s.id===p)?s:{...s,data:{...s.data,active:s.id===p}}))},[p,V]),r.useEffect(()=>{let c=(s)=>{if(s.key==="Escape")k(null)};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]);let v=r.useMemo(()=>{let c=new Map;for(let s of E){let _1=z2(s.data.frame);c.set(_1,[...c.get(_1)??[],s])}return[...c].map(([s,_1])=>{let q1=Math.min(..._1.map((R1)=>R1.position.x))-C5,o=Math.min(..._1.map((R1)=>R1.position.y))-C5-S_,K1=_1[0].data.frame,$1=Math.max(..._1.map((R1)=>R1.position.x))+p2+C5-q1,M1=Math.max(..._1.map((R1)=>R1.position.y))+c2+C5-o;return{id:`box:${s}`,type:"section",position:{x:q1,y:o},width:$1,height:M1,zIndex:-1,draggable:!1,selectable:!1,data:{vendor:K1.vendor,label:`${Y1(K1.vendor)} · ${K1.section.title}`,width:$1,height:M1}}})},[E]),m=()=>y(w.id,(c)=>({...c,placed:{...c.placed??{},...Object.fromEntries(E.map((s)=>[s.id,{x:Math.round(s.position.x),y:Math.round(s.position.y)}]))}})),u=(c)=>{k(c);let s=b.getNode(c);if(!s)return;let _1=Math.min((window.innerWidth-300)/p2,(window.innerHeight-120)/c2,1);b.setCenter(s.position.x+p2/2-130/_1,s.position.y+c2/2,{zoom:_1,duration:400})},n=()=>{let c=`board-${Date.now().toString(36)}`;C(c),N((s)=>[...s,{id:c,name:`Board ${s.length}`,include:[]}])},e=()=>{let c=window.prompt("Name this board",w.name)?.trim();if(c)y(w.id,(s)=>({...s,name:c.slice(0,80)}))},t=()=>{let c=w.id;C("everything"),N((s)=>s.filter((_1)=>_1.id!==c))},a=[...new Map(A.map((c)=>[z2(c),c])).values()],g=w.include?[...a.filter((c)=>!Q8(c).some((s)=>w.include.includes(s))).map((c)=>({key:z2(c),label:`${Y1(c.vendor)} · ${c.section.title} (all)`})),...A.filter((c)=>!D.includes(c)).map((c)=>({key:E1(c),label:c.title}))]:[],J1=w.include?[]:A.filter((c)=>!D.includes(c)),G1=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,F1=J.state==="ok"&&L.state==="ok";return $.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"The World's board",children:$.jsxDEV($_,{nodes:F1?[...v,...E]:[],onNodesChange:(c)=>h(c.filter((s)=>!("id"in s)||!String(s.id).startsWith("box:"))),nodeTypes:qF,onNodeDragStop:m,onNodeClick:(c,s)=>{if(!s.id.startsWith("box:"))k(s.id)},onPaneClick:()=>k(null),minZoom:0.03,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!1,zoomOnDoubleClick:!1,colorMode:G1?"dark":"light",proOptions:{hideAttribution:!0},children:[$.jsxDEV(G_,{variant:M0.Dots,gap:28,size:1.4},void 0,!1,void 0,this),$.jsxDEV(X2,{position:"top-left",className:"float layers",children:[$.jsxDEV("div",{className:"float-head",children:[$.jsxDEV("button",{type:"button",className:"back",onClick:G,"aria-label":`Back to ${_}`,children:"←"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"float-title",children:[$.jsxDEV("strong",{children:_.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[_.split("/")[0],U?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"board-tabs",role:"tablist","aria-label":"Boards",children:[T.map((c)=>$.jsxDEV("button",{type:"button",role:"tab","aria-selected":c.id===w.id,className:c.id===w.id?"on":void 0,onClick:()=>C(c.id),onDoubleClick:S&&c.id===w.id&&c.include?e:void 0,children:c.name},c.id,!1,void 0,this)),S?$.jsxDEV("button",{type:"button",className:"ghost",onClick:n,"aria-label":"A new board",children:"+"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),w.include&&S?$.jsxDEV("div",{className:"board-acts",children:[$.jsxDEV("button",{type:"button",className:"ghost",onClick:e,children:"Rename"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"ghost",onClick:t,children:"Delete board"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("ul",{className:"layer-list","aria-label":"Frames",children:[...new Set(D.map(z2))].map((c)=>{let s=D.filter((_1)=>z2(_1)===c);return $.jsxDEV("li",{children:[$.jsxDEV("span",{className:"layer-section",children:[$.jsxDEV(u1,{vendor:s[0].vendor},void 0,!1,void 0,this),Y1(s[0].vendor)," · ",s[0].section.title]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list inner",children:s.map((_1)=>$.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:p===E1(_1)?"on":void 0,onClick:()=>u(E1(_1)),children:[$.jsxDEV("span",{children:_1.title},void 0,!1,void 0,this),_1.changes?$.jsxDEV("span",{className:"layer-changed",title:`${V1(_1.changes,"change")}, not in a changeset`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),_1.changes]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},E1(_1),!1,void 0,this))},void 0,!1,void 0,this)]},c,!0,void 0,this)})},void 0,!1,void 0,this),w.include&&!D.length?$.jsxDEV("p",{className:"mode pad-s",children:"An empty board: add frames from Everything, or below."},void 0,!1,void 0,this):null,g.length&&S?$.jsxDEV("select",{className:"board-add",value:"","aria-label":"Add to this board",onChange:(c)=>{let s=c.target.value;if(s)y(w.id,(_1)=>({..._1,include:[..._1.include??[],s]}))},children:[$.jsxDEV("option",{value:"",children:"Add to this board…"},void 0,!1,void 0,this),g.map((c)=>$.jsxDEV("option",{value:c.key,children:c.label},c.key,!1,void 0,this))]},void 0,!0,void 0,this):null,J1.length?$.jsxDEV("details",{className:"board-hidden",children:[$.jsxDEV("summary",{children:["Hidden (",J1.length,")"]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list",children:J1.map((c)=>$.jsxDEV("li",{children:S?$.jsxDEV("button",{type:"button",onClick:()=>y(w.id,(s)=>({...s,hidden:(s.hidden??[]).filter((_1)=>_1!==E1(c))})),children:[$.jsxDEV("span",{children:c.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"pad-s",children:c.title},void 0,!1,void 0,this)},E1(c),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,l?$.jsxDEV("button",{type:"button",className:"board-elsewhere",onClick:()=>C("everything"),children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),V1(l,"change")," not on this board"]},void 0,!0,void 0,this):null,$.jsxDEV(r1,{load:L,what:"the board"},void 0,!1,void 0,this),W&&L.state==="ok"?$.jsxDEV("p",{role:"alert",className:"pad-s",children:["The board could not be read again (",W,"): it shows what was last read."]},void 0,!0,void 0,this):null,J.state==="pending"?$.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,J.state==="error"?$.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",J.error," ",$.jsxDEV("button",{type:"button",onClick:q,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(X2,{position:"top-center",className:"float hint mode",children:p?`Using ${D.find((c)=>E1(c)===p)?.title??p} · Esc to leave`:"Drag to pan · scroll to zoom · click a frame to use it"},void 0,!1,void 0,this),$.jsxDEV(F_,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),$.jsxDEV(K_,{pannable:!0,zoomable:!0,nodeBorderRadius:8,position:"bottom-right"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var t_=(_)=>_.actions.map((Q)=>({twin:Q.service,entry:{...Q.action,service:Q.service,op:Q.action.op??Q.action.operation??""}})),ZF=(_)=>{let Q=_.action.input??{};return!(typeof Q.operationId==="string"||Q.graphql!==void 0&&Q.graphql!==null)};function V4(_){let Q=_.actions.filter(ZF).length,J=_.actions.length-Q,q=_.applied?.receipts??[],U=_.deployed??[],G=new Set([...U.filter((X)=>X.status==="deployed"),...q.filter((X)=>X.status==="confirmed")].map((X)=>X.actionId)).size,Z=new Set([...U.filter((X)=>X.status==="refused"||X.status==="failed"),...q.filter((X)=>X.status==="failed")].map((X)=>X.actionId)).size,F={performed:G,failed:Z,total:J,own:Q};if(J>0&&G>=J)return{label:"Deployed",tone:"done",...F};if(G>0)return{label:`Partly deployed: ${G} of ${J}`,tone:"warn",...F};if(Z>0)return{label:`${Z} refused or failed`,tone:"bad",...F};if(q.some((X)=>X.status==="replayed")&&q.every((X)=>X.status==="replayed"||X.status==="skipped"))return{label:"Pushed",tone:"good",...F};return{label:"Not sent",tone:"plain",...F}}var a6=(_)=>_.message??_.narration?.split(`
|
|
37
|
+
`)[0]?.replace(/ setting .*$/,"")??_.name;function o_(_,Q=1){let J=_.currentHash??_.contentHash,q=_.readiness?.approvers??new Set(_.approvals.filter((G)=>G.contentHash===J).map((G)=>G.principal)).size,U=_.verification&&_.verification.contentHash===J?_.verification:null;if(U&&!U.passed)return{label:"Checks failed",tone:"bad"};if(q>0&&q<Q)return{label:`Approved by ${q} of ${Q}`,tone:"plain"};if(q>0)return{label:`Approved by ${q}`,tone:"good"};if(U)return{label:"Verified",tone:"good"};return{label:"Not verified",tone:"plain"}}function k_({name:_,token:Q,signsAs:J,c:q,canWrite:U,rooted:G,refused:Z,onChanged:F,part:X,required:Y}){let K=X==="head",H=X==="review",[L,z]=r.useState(null),[W,O]=r.useState(!1),[R,B]=r.useState(""),[P,A]=r.useState(""),[T,f]=r.useState(null),C=N1(Q,`/-/${_}/origin`),w=V4(q),S=o_(q,Y),N=t_(q),y=[...new Set(N.map((u)=>u.twin))],D=y.some((u)=>G.includes(u)),l=(u)=>u===(q.currentHash??q.contentHash),p=q.applied?.receipts??[],k=(q.deployed??[]).filter((u)=>u.status!=="landed"),b=p.filter((u)=>u.status==="confirmed").length,j=k.filter((u)=>u.status==="deployed"),E=async(u,n,e,t)=>{z(u),f(null);try{let a=await I1(Q,n,{method:"POST",...e===void 0?{}:{body:JSON.stringify(e)}});if(!a.ok)return Z(a),f({what:u,...b1(await C0(a))}),!1;if(t)j1(t);return F(),!0}catch(a){return f({what:u,text:`the World did not answer (${a instanceof Error?a.message:String(a)})`,acts:[]}),!1}finally{z(null)}},V=()=>{E("Verify",`/-/${_}/changesets/${q.name}/verify`,void 0,"Verified: the checks ran over it")},h=async(u)=>{if(u.preventDefault(),await E("Approve",`/-/${_}/changesets/${q.name}/approve`,{...R.trim()?{note:R.trim()}:{},...J===null&&P.trim()?{as:P.trim()}:{}},"Approved"))O(!1),B("")},I=async()=>{let u=y.filter((n)=>G.includes(n));if(!await T0({title:`Deploy ${q.name} to the real vendors?`,body:$.jsxDEV($.Fragment,{children:["It performs its ",q.actions.length," change",q.actions.length===1?"":"s"," against the real account",u.length===1?"":"s"," behind ",L2(u.map(Y1)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:q.name}))return;z("Deploy"),f(null);try{let n=await I1(Q,`/-/${_}/deploy/${q.name}`,{method:"POST",body:JSON.stringify({confirm:q.name})});if(!n.ok){Z(n),f({what:"Deploy",...b1(await C0(n))});return}let e=await I1(Q,`/-/${_}/changesets/${q.name}`),t=e.ok?await e.json():null;if(!t){j1("Deploy: sent; reading its receipts failed","info"),F();return}let a=V4(t);j1(`Deploy: ${a.performed} of ${a.total} change${a.total===1?"":"s"} performed at the vendor${a.failed?`; ${a.failed} refused or failed`:""}`,a.failed?"error":a.performed?"ok":"info"),F()}catch(n){f({what:"Deploy",text:`the World did not answer (${n instanceof Error?n.message:String(n)})`,acts:[]})}finally{z(null)}},v=!U?"This session reads the World; it changes nothing":w.label==="Deployed"?"Already deployed: every change was performed at the vendor":null,m=C.state==="ok"&&C.data.origin?_8(C.data.origin):null;return $.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[K?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"changeset-title",children:[q.message??q.name," ",$.jsxDEV("span",{className:`badge cs-${w.tone}`,children:w.label},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:`badge cs-${S.tone}`,children:S.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:q.name},void 0,!1,void 0,this)," · made ",$.jsxDEV(w1,{iso:q.createdAt},void 0,!1,void 0,this)," · ",q.actions.length," change",q.actions.length===1?"":"s"," at ",L2(y.map(Y1))||"no vendor"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[$.jsxDEV("button",{type:"button",onClick:V,disabled:Boolean(v)||L!==null,title:v??"Replay it in a throwaway World and run the World's checks",children:L==="Verify"?"Verifying…":"Verify"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>O(!0),disabled:Boolean(v)||L!==null,title:v??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),D?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void I(),disabled:Boolean(v)||L!==null,title:v??"Perform it against the real accounts behind this World",children:L==="Deploy"?"Deploying…":"Deploy…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),v&&w.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:[v,"."]},void 0,!0,void 0,this):null,T?$.jsxDEV("div",{role:"alert",className:"refusal",children:[$.jsxDEV("span",{children:[$.jsxDEV("b",{children:T.what},void 0,!1,void 0,this),": ",T.text]},void 0,!0,void 0,this),T.acts.includes("verify")&&U?$.jsxDEV("button",{type:"button",onClick:V,disabled:L!==null,children:"Verify"},void 0,!1,void 0,this):null,T.acts.includes("approve")&&U?$.jsxDEV("button",{type:"button",onClick:()=>O(!0),disabled:L!==null,children:"Approve…"},void 0,!1,void 0,this):null,$.jsxDEV(u_,{name:_,acts:T.acts},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):null,H?$.jsxDEV($.Fragment,{children:[q.narration?$.jsxDEV("p",{className:"narration",children:q.narration},void 0,!1,void 0,this):null,$.jsxDEV("h4",{children:"Where it went"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"block where",children:[w.performed>0?$.jsxDEV("p",{className:"pad",children:[w.performed>=w.total?"Deployed":"Partly deployed",": ",w.performed," of ",w.total," change",w.total===1?"":"s",w.own?` (and ${w.own} of the World's own, which stay in it)`:""," performed at ",L2([...new Set([...j.map((u)=>u.service),...p.filter((u)=>u.status==="confirmed").map((u)=>u.service)].map(Y1))]),j.length?` (${j.length} from here`:" (",j.length&&b?", ":"",b?`${b} by the remote`:"",")."]},void 0,!0,void 0,this):w.label==="Pushed"?$.jsxDEV("p",{className:"pad",children:["Pushed to the remote",m?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:m},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,q.applied?$.jsxDEV($.Fragment,{children:[" · ",$.jsxDEV(w1,{iso:q.applied.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,": every change was replayed there. No vendor has performed any of it."]},void 0,!0,void 0,this):w.failed===0?$.jsxDEV("p",{className:"pad",children:["Not sent: it is only in this World.",q.applied?.outcome==="refused"?" A push was refused (below); Push sends it again.":$.jsxDEV($.Fragment,{children:[" Push sends it to the remote World",D?"; Deploy, to the real vendors behind it":"","."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,w.failed>0?$.jsxDEV("p",{className:"pad failed",role:"alert",children:[w.failed," change",w.failed===1?" was":"s were"," refused or failed at the vendor",[...k.filter((u)=>u.reason&&(u.status==="refused"||u.status==="failed")).map((u)=>u.reason),...p.filter((u)=>u.status==="failed"&&u.error).map((u)=>u.error)].slice(0,3).map((u)=>`: ${b1(u).text}`).join(""),"."]},void 0,!0,void 0,this):null,q.applied?.refusal?.length?$.jsxDEV("ul",{className:"checks pad",children:q.applied.refusal.map((u,n)=>$.jsxDEV("li",{className:"mode",children:b1(u).text},n,!1,void 0,this))},void 0,!1,void 0,this):null,k.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the vendor"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:k.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="refused"||u.status==="failed"?"badge cs-bad":u.status==="deployed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",Y1(u.service)," ",u.status==="deployed"?u.url?$.jsxDEV("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",children:u.externalId??u.url},void 0,!1,void 0,this):u.externalId?$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this):null:null,u.reason?$.jsxDEV("span",{className:"mode",children:[" · ",b1(u.reason).text]},void 0,!0,void 0,this):null," ",$.jsxDEV("span",{className:"mode",children:["· ",$.jsxDEV(w1,{iso:u.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},`v:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,p.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the remote"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:p.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="failed"?"badge cs-bad":u.status==="confirmed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",Y1(u.service)," ",$.jsxDEV("span",{className:"mode",children:u.status==="replayed"?"replayed at the remote World":u.status==="confirmed"?"performed at the vendor by the remote":""},void 0,!1,void 0,this),u.status==="confirmed"&&u.externalId?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,u.error?$.jsxDEV("span",{className:"mode",children:[" · ",b1(u.error).text]},void 0,!0,void 0,this):null]},`r:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),!D&&w.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:["No vendor it changes is connected to its real service here, so it does not deploy from this World. ",$.jsxDEV("a",{href:`${L1}/${_}/~/settings/services`,onClick:(u)=>{u.preventDefault(),f1([..._.split("/"),"~","settings","services"])},children:"Connect a vendor in Settings › Real services"},void 0,!1,void 0,this)," to deploy."]},void 0,!0,void 0,this):null,$.jsxDEV("h4",{children:"Checks"},void 0,!1,void 0,this),!q.verification?$.jsxDEV("p",{className:"mode",children:"Not verified yet. Verify replays it in a throwaway World and runs this World's checks over the result."},void 0,!1,void 0,this):$.jsxDEV("div",{className:l(q.verification.contentHash)?"":"stale",children:[$.jsxDEV("p",{children:[q.verification.passed?"✓ Passed":"✗ Failed"," · ",$.jsxDEV(w1,{iso:q.verification.at},void 0,!1,void 0,this),l(q.verification.contentHash)?null:$.jsxDEV("span",{className:"mode",children:" · on an earlier version of it: verify again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.verification.results.length?$.jsxDEV("ul",{className:"checks",children:q.verification.results.map((u)=>$.jsxDEV("li",{children:[u.passed?"✓":"✗"," ",$.jsxDEV("code",{children:u.id},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:Y1(u.service)},void 0,!1,void 0,this)]},u.id,!0,void 0,this))},void 0,!1,void 0,this):null,q.verification.refusals?.length?$.jsxDEV("ul",{className:"checks",children:q.verification.refusals.map((u,n)=>$.jsxDEV("li",{children:["✗ ",$.jsxDEV("code",{children:u.check},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[Y1(u.service),": ",u.reason]},void 0,!0,void 0,this)]},n,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("h4",{children:"Approvals"},void 0,!1,void 0,this),q.approvals.length===0?$.jsxDEV("p",{className:"mode",children:"No one has approved it."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"approvals",children:q.approvals.map((u,n)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:u.principal},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(w1,{iso:u.at},void 0,!1,void 0,this),l(u.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),u.note?$.jsxDEV("div",{className:"mode",children:["“",u.note,"”"]},void 0,!0,void 0,this):null]},n,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(n1,{open:W,onClose:()=>{if(!L)O(!1)},title:`Approve ${q.name}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>O(!1),disabled:L!==null,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"approve-changeset",className:"primary",disabled:L!==null,children:L==="Approve"?"Approving…":"Approve"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"approve-changeset",onSubmit:(u)=>void h(u),className:"stack",children:[$.jsxDEV("p",{className:"mode",children:["You sign its contents as they stand now",J?$.jsxDEV($.Fragment,{children:[", recorded as ",$.jsxDEV("b",{children:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,". A later change to it shows your approval as for an earlier version."]},void 0,!0,void 0,this),J===null?$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Approving as"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"approveAs",value:P,onChange:(u)=>A(u.target.value),maxLength:80,required:!0,placeholder:"your name or email",autoComplete:"off"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"This World was opened with its token, which names no person: the approval records the name you give."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Note ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("textarea",{name:"approveNote",value:R,onChange:(u)=>B(u.target.value),rows:3,maxLength:500},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var n_=(_,Q)=>JSON.stringify(_)===JSON.stringify(Q);function FF({changes:_,idPrefix:Q}){let J=[...new Set(_.map((q)=>q.twin))];return $.jsxDEV($.Fragment,{children:J.map((q)=>{let U=_.filter((Z)=>Z.twin===q).map((Z)=>Z.entry),G=[...new Set(U.map((Z)=>`${Z.subject.type}:${Z.subject.id}`))];return $.jsxDEV("div",{className:"compare",role:"group","aria-labelledby":`${Q}-${q}`,children:[$.jsxDEV("h3",{id:`${Q}-${q}`,className:"vendor-cell",children:[$.jsxDEV(u1,{vendor:q},void 0,!1,void 0,this),Y1(q)," ",$.jsxDEV("span",{className:"mode",children:["· ",V1(G.length,"record"),", ",V1(U.length,"write")]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:G.map((Z)=>{let F=U.filter((H)=>`${H.subject.type}:${H.subject.id}`===Z),X=F[F.length-1],Y=K0(X),K={};return $.jsxDEV("li",{className:"record",children:[$.jsxDEV("p",{className:"record-head",children:[$.jsxDEV("span",{className:"kind",children:X.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")},void 0,!1,void 0,this)," ",Y.label?$.jsxDEV("span",{className:"label",children:["“",Y.label,"”"]},void 0,!0,void 0,this):null," ",$.jsxDEV("code",{children:r0(X)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.map((H)=>{let L=H.fields??{},z=Object.entries(L).filter(([O,R])=>!(O in K)||!n_(K[O],R)),W=K;return K={...K,...L},$.jsxDEV("div",{className:"write",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"op",children:K0(H).what},void 0,!1,void 0,this)," · ",$.jsxDEV(w1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",k5(H)]},void 0,!0,void 0,this),z.length===0?$.jsxDEV("p",{className:"mode",children:"It set no field to a new value."},void 0,!1,void 0,this):$.jsxDEV("dl",{className:"fields field-diff","aria-label":`Fields ${K0(H).what} set`,children:z.map(([O,R])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:O},void 0,!1,void 0,this),$.jsxDEV("dd",{children:O in W?$.jsxDEV("span",{className:"changed",children:[$.jsxDEV("del",{children:$.jsxDEV(v0,{v:W[O]},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"arrow","aria-label":"becomes",children:"→"},void 0,!1,void 0,this),$.jsxDEV("ins",{children:$.jsxDEV(v0,{v:R},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(v0,{v:R},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},O,!0,void 0,this))},void 0,!1,void 0,this)]},H.id,!0,void 0,this)})]},Z,!0,void 0,this)})},void 0,!1,void 0,this)]},q,!0,void 0,this)})},void 0,!1,void 0,this)}function HF({name:_,token:Q,changes:J,canWrite:q,refused:U,onCut:G,pinned:Z,generated:F,inputRef:X,author:Y}){let[K,H]=r.useState(""),[L,z]=r.useState(!1),[W,O]=r.useState([]),R=(P,A,T)=>{O((f)=>[{ok:P,text:A,at:new Date().toISOString(),n:++j5,...T?.length?{acts:T}:{}},...f].slice(0,4))},B=async(P)=>{P.preventDefault(),z(!0);try{let A=await I1(Q,`/-/${_}/changesets`,{method:"POST",body:JSON.stringify(K.trim()?{message:K.trim()}:{})});if(!A.ok){U(A);let f=b1(await C0(A));R(!1,`Cut a changeset: ${f.text}`,f.acts);return}let T=await A.json();R(!0,`Cut ${T.name??"a changeset"}: ${V1(T.actions?.length??0,"change")}, ready to review in History and push.`),H(""),G()}catch(A){R(!1,`Cut a changeset: the World did not answer (${A instanceof Error?A.message:String(A)})`)}finally{z(!1)}};if(Z){let P=!q?"This session reads the World; it changes nothing":J===0?"Nothing to cut: no change is outside a changeset":null;return $.jsxDEV("div",{className:"ws-cut",children:[$.jsxDEV(i0,{log:W,name:_},void 0,!1,void 0,this),$.jsxDEV("form",{onSubmit:(A)=>void B(A),"aria-label":"Cut a changeset",children:[Y?$.jsxDEV("a",{className:"ws-author",href:Y.account,title:`${Y.who}: your account`,onClick:(A)=>{A.preventDefault(),f1(Y.account.slice(L1.length+1).split("/"))},children:Y.face},void 0,!1,void 0,this):null,$.jsxDEV("input",{ref:X,name:"changesetMessage","aria-label":"Summary",value:K,onChange:(A)=>H(A.target.value),placeholder:J===0?"Nothing to cut":F?"Summary (optional)":"Summary (required)",required:!F,maxLength:200,disabled:Boolean(P),title:P??void 0},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(P)||L,title:P??void 0,children:L?"Cutting…":J===0?"Cut a changeset":$.jsxDEV($.Fragment,{children:["Cut ",V1(J,"change"),Y?$.jsxDEV($.Fragment,{children:[" on ",$.jsxDEV("b",{children:Y.branch},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}if(!q||J===0)return $.jsxDEV(i0,{log:W,name:_},void 0,!1,void 0,this);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("form",{className:"block cut pad",onSubmit:(P)=>void B(P),"aria-label":"Cut a changeset",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Cut ",J===1?"this change":`these ${J} changes`," into a changeset: what it does and why"]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"changesetMessage",value:K,onChange:(P)=>H(P.target.value),placeholder:"Welcome email for new sign-ups",required:!0,maxLength:200,disabled:J===0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:L||J===0,children:L?"Cutting…":"Cut a changeset"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(i0,{log:W,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KF({name:_,token:Q}){let[J,q]=r.useState(0),U=N1(Q,`/-/${_}/keys`,J),[G,Z]=r.useState(!1),[F,X]=r.useState(""),[Y,K]=r.useState("write"),[H,L]=r.useState(!1),[z,W]=r.useState(null),[O,R]=r.useState(null),[B,P]=r.useState(null),A=async()=>{let C=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,w=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:C,scope:"read"})}).catch(()=>null),S=w?await w.json().catch(()=>({})):{error:`${O1} did not answer`};if(!w?.ok||!S.key){j1(S.error?b1(S.error).text:"refused","error");return}P(`${window.location.origin}${L1}/${_}#${new URLSearchParams({token:S.key}).toString()}`),q((N)=>N+1)},T=async(C)=>{C.preventDefault(),L(!0),W(null);let w=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:F.trim(),scope:Y})}).catch(()=>null);L(!1);let S=w?await w.json().catch(()=>({})):{error:`${O1} did not answer`};if(!w?.ok||!S.key){W(S.error?b1(S.error).text:"refused");return}Z(!1),R({key:S.key,name:F.trim()}),X(""),q((N)=>N+1)},f=async(C)=>{if(!await T0({title:`Revoke ${C.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let w=await I1(Q,`/-/${_}/keys/${C.id}`,{method:"DELETE"});if(w.ok)j1(`Revoked ${C.name}`);else j1(await q0(w),"error");q((S)=>S+1)};return $.jsxDEV("section",{"aria-labelledby":"keys-head",className:"keys",children:[$.jsxDEV("div",{className:"keys-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"keys-head",children:"Keys"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"What an app, a script or a CI job holds to reach this World: each named for what holds it and revoked alone. People open the World as themselves; keys are for software."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i1()?$.jsxDEV("a",{className:"button primary",href:`${i1()}/${encodeURIComponent(_.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this):$.jsxDEV("div",{className:"head-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>void A(),children:"Share a read-only link"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{W(null),Z(!0)},children:"Make a key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(r1,{load:U,what:"the keys",retry:()=>q((C)=>C+1)},void 0,!1,void 0,this),U.state==="ok"?U.data.keys.length===0?$.jsxDEV("p",{className:"mode",children:"No keys yet. The World's own token opens it too."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"dense","aria-label":"Keys",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"For"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Access"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last used"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:U.data.keys.map((C)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:C.name},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.person??$.jsxDEV("span",{className:"mode",title:"It acts as itself: a service",children:"no one: a service"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.scope==="write"?"Read and write":"Read only"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:$.jsxDEV("span",{title:p6(C.createdAt),children:c6(C.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:C.lastUsedAt?c6(C.lastUsedAt):"never"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:$.jsxDEV(T_,{label:`More for ${C.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void f(C)}]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},C.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(n1,{open:G,onClose:()=>{if(!H)Z(!1)},title:"Make a key",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>Z(!1),disabled:H,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"make-key",disabled:H||!F.trim(),children:H?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"make-key",onSubmit:T,"aria-label":"Make a key",children:[$.jsxDEV("label",{children:["Name ",$.jsxDEV("input",{autoFocus:!0,name:"keyName",value:F,onChange:(C)=>X(C.target.value),placeholder:"ci, staging app…",maxLength:80,required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:["Access ",$.jsxDEV("select",{value:Y,onChange:(C)=>K(C.target.value==="read"?"read":"write"),children:[$.jsxDEV("option",{value:"write",children:"Read and write"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"read",children:"Read only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z?$.jsxDEV("p",{role:"alert",children:z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(n1,{open:Boolean(O),onClose:()=>R(null),title:`${O?.name??"The key"} is ready`,footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>R(null),children:"Done"},void 0,!1,void 0,this),children:[$.jsxDEV("p",{className:"mode",children:"Copy it now: it is shown this once. Put it where the app reads its secrets."},void 0,!1,void 0,this),O?$.jsxDEV(r6,{label:"Key",value:O.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(n1,{open:Boolean(B),onClose:()=>P(null),title:"A read-only link",footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>P(null),children:"Done"},void 0,!1,void 0,this),children:[$.jsxDEV("p",{className:"mode",children:"Whoever opens it sees this World's pages and changes nothing. Copy it now: it is shown this once. It is listed under Keys, where revoking it closes the link at once."},void 0,!1,void 0,this),B?$.jsxDEV(r6,{label:"Link",value:B,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var j5=0;function i0({log:_,name:Q}){if(_.length===0)return null;return $.jsxDEV("ul",{className:"narration-log",role:"status","aria-live":"polite",children:_.map((J)=>$.jsxDEV("li",{className:J.ok?"ok":"bad",children:[$.jsxDEV("span",{className:"mode",children:$.jsxDEV(w1,{iso:J.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",J.text,J.acts?$.jsxDEV(u_,{name:Q,acts:J.acts},void 0,!1,void 0,this):null]},J.n,!0,void 0,this))},void 0,!1,void 0,this)}function e_(_,Q,J,q){let[U,G]=r.useState(0),Z=U*1e5+Math.floor(J/2),F=N1(Q,`/-/${_}/origin`,Z),X=N1(Q,`/-/${_}/diff`,Z),Y=N1(Q,`/-/${_}/changesets`,Z),[K,H]=r.useState([]),[L,z]=r.useState(null),W=(f,C,w)=>{if(H((S)=>[{ok:f,text:C,at:new Date().toISOString(),n:++j5,...w?.length?{acts:w}:{}},...S].slice(0,8)),!f)j1(C,"error")},O=async(f,C,w)=>{z(f);try{let S=await I1(Q,`/-/${_}/${C}`,w);if(!S.ok){q(S);let N=b1(await C0(S));return W(!1,`${f}: ${N.text}`,N.acts),null}return await S.json()}catch(S){return W(!1,`${f}: the World did not answer (${S instanceof Error?S.message:String(S)})`),null}finally{z(null),G((S)=>S+1)}},R=F.state==="ok"&&F.data.origin?_8(F.data.origin):null,B=X.state==="ok"?X.data.changes.length:null,P=Y.state==="ok"&&R?pZ(Y.data.changesets.filter((f)=>!f.pushedBy)).sort((f,C)=>f.createdAt.localeCompare(C.createdAt)):[];return{origin:F,diff:X,sets:Y,there:R,changes:B,waiting:P,log:K,busy:L,say:W,send:O,push:async()=>{let f=await O("Push","origin/push",{method:"POST"});if(!f)return;if(f.pushed.length===0){W(!0,"Nothing to push: every changeset is already at the remote.");return}for(let C of f.pushed){let w=C.receipts??[],S=w.filter((p)=>p.status==="replayed").length,N=w.filter((p)=>p.status==="confirmed").length,y=w.filter((p)=>p.status==="failed").length,D=C.outcome==="applied"&&y===0;if(C.outcome==="refused"){W(!1,`Push of ${C.changeset} was refused${C.refusal?.length?`: ${C.refusal.map((p)=>b1(p).text).join("; ")}`:""}.`);continue}let l=[`${S} of ${V1(w.length,"change")} replayed there`,...N?[`${N} performed at the vendor by the remote`]:[],...y?[`${y} failed`]:[]];W(D,`${C.outcome==="partial"?"Partly pushed":"Pushed"} ${C.changeset} to ${R??"the remote"}: ${l.join("; ")}${C.refusal?.length?` (${C.refusal.map((p)=>b1(p).text).join("; ")})`:""}.`)}},pull:async()=>{let f=await O("Pull","origin/pull",{method:"POST"});if(!f)return;let C=Object.entries(f.appended).filter(([,S])=>S>0),w=f.rebased.flatMap((S)=>S.conflicts.map((N)=>`${Y1(S.twin)} ${N.subject.type}:${N.subject.id} ${N.field}`));W(w.length===0,`Pulled from ${R??"the remote"}: ${C.length?C.map(([S,N])=>`${V1(N,"entry")} at ${Y1(S)}`).join(", "):"nothing new"}${w.length?`; conflicts at ${w.join(", ")}`:""}.`)}}}function XF({name:_,token:Q,canWrite:J,tick:q,refused:U}){let{origin:G,there:Z,changes:F,log:X,busy:Y,say:K,send:H,push:L,pull:z}=e_(_,Q,q,U),[W,O]=r.useState(""),[R,B]=r.useState(""),[P,A]=r.useState(!1),T=async(C)=>{C.preventDefault();let w=await H("Name the remote","origin",{method:"PUT",body:JSON.stringify({url:W.trim(),token:R.trim()})});if(w){let S=Object.values(w.appended??{}).reduce((N,y)=>N+y,0);K(!0,`The remote is ${_8(w.origin)}: its history came in (${V1(S,"entry")}).`),B(""),A(!1)}},f=!J?"This session reads the World; it changes nothing":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"block remote",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{children:"Origin"},void 0,!1,void 0,this),J?$.jsxDEV("button",{type:"button",onClick:()=>{O(Z??""),A(!P)},"aria-expanded":P,children:Z?"Change the remote…":"Name a remote…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"pad",children:[G.state==="ok"?Z?$.jsxDEV("p",{children:[$.jsxDEV("code",{className:"big",children:Z},void 0,!1,void 0,this),G.data.origin?.fetchedAt?$.jsxDEV("span",{className:"mode",children:[" · last fetched ",$.jsxDEV(w1,{iso:G.data.origin.fetchedAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("p",{children:"No remote — this World keeps its default data. Name one to push its changesets to a shared World and pull what others pushed there."},void 0,!1,void 0,this):$.jsxDEV(r1,{load:G,what:"the remote",lines:1},void 0,!1,void 0,this),P?$.jsxDEV("form",{className:"stack origin-form",onSubmit:(C)=>void T(C),"aria-label":"Name the remote",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The World's address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originUrl",value:W,onChange:(C)=>O(C.target.value),placeholder:"https://worlds.example.com/acme/team",required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"A key or token that opens it"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originToken",type:"password",value:R,onChange:(C)=>B(C.target.value),required:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Naming it brings its history in. Your pushes are recorded there as whoever this key was made for, or as the key itself."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Y!==null,children:Y==="Name the remote"?"Bringing its history in…":"Save the remote"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>A(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(i0,{log:X,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function YF({name:_,token:Q,canWrite:J,refused:q}){let[U,G]=r.useState(0),Z=N1(Q,`/-/${_}/twins`,U),F=N1(Q,`/-/${_}/links`,U),X=N1(Q,`/-/${_}/requests?hours=24`,U),[Y,K]=r.useState({}),[H,L]=r.useState(null),[z,W]=r.useState(""),[O,R]=r.useState(!1),[B,P]=r.useState([]),A=(N,y,D)=>{if(P((l)=>[{ok:N,text:y,at:new Date().toISOString(),n:++j5,...D?.length?{acts:D}:{}},...l].slice(0,6)),!N)j1(y,"error")},T=F.state==="ok"?Object.keys(F.data.links).sort():[];r.useEffect(()=>{let N=!0;return Promise.all(T.map(async(y)=>{let D=await I1(Q,`/-/${_}/twins/${y}/credential`).catch(()=>null),l=D?.ok?await D.json():null;return[y,l?.credential??null]})).then((y)=>{if(N)K(Object.fromEntries(y))}),()=>{N=!1}},[_,Q,T.join(","),U]);let f=async(N)=>{if(N.preventDefault(),!H||!z)return;R(!0);let y=await I1(Q,`/-/${_}/twins/${H.vendor}/credential`,{method:"PUT",body:z,headers:{"content-type":"text/plain"}}).catch(()=>null);if(R(!1),!y){A(!1,`Seal ${H.vendor}: ${O1} did not answer`);return}if(!y.ok){q(y);let l=b1(await C0(y));A(!1,`Seal ${Y1(H.vendor)}: ${l.text}`,l.acts);return}let D=await y.json().catch(()=>({}));A(!0,`Sealed a credential for ${Y1(H.vendor)}${D.fingerprint?` (${D.fingerprint})`:""}: it opens for ${D.boundTo??H.to} only, and is never shown again.`),W(""),L(null),G((l)=>l+1)},C=async(N)=>{if(!await T0({title:`Remove the link ${N}?`,body:`Requests to ${l0}/${_}/${N}/… stop being forwarded to ${F.state==="ok"?F.data.links[N]?.origin:"its origin"}.`,action:"Remove link",danger:!0}))return;let y=await I1(Q,`/-/${_}/links/${N}`,{method:"DELETE"}).catch(()=>null);if(!y?.ok){if(y)q(y);A(!1,`Remove ${N}: ${y?await q0(y):"the World did not answer"}`);return}A(!0,`Removed the link ${N}.`),G((D)=>D+1)},w=(N)=>N?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge rooted",children:"sealed"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[N.fingerprint?$.jsxDEV("code",{children:N.fingerprint},void 0,!1,void 0,this):null," · ",$.jsxDEV(w1,{iso:N.placedAt},void 0,!1,void 0,this),N.sealedBy?` · by ${N.sealedBy==="vault"?"the vault":"the host's key"}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"mode",children:"none"},void 0,!1,void 0,this),S=Z.state==="ok"?Z.data.twins:[];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"lede",children:"A real vendor's credential lives in one place, sealed: beside this World, bound to where it goes. It is never readable back; this page says only that one is sealed, when, by what, and for where."},void 0,!1,void 0,this),$.jsxDEV(i0,{log:B,name:_},void 0,!1,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"creds-head",children:[$.jsxDEV("div",{className:"block-head",children:$.jsxDEV("h3",{id:"creds-head",children:"Vendors"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(r1,{load:Z,what:"the vendors"},void 0,!1,void 0,this),Z.state==="ok"?$.jsxDEV("table",{className:"dense","aria-label":"Credentials by vendor",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Bound to"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:S.map((N)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(u1,{vendor:N.twin},void 0,!1,void 0,this),Y1(N.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w(N.credential)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.credential?.boundTo?$.jsxDEV("code",{children:N.credential.boundTo},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.root?.url?$.jsxDEV("code",{children:N.root.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"none: a stand-in"},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?$.jsxDEV("td",{className:"num",children:$.jsxDEV("button",{type:"button",disabled:!N.root?.url,title:N.root?.url?`Seal ${Y1(N.twin)}'s real credential for ${N.root.url}`:"Connect it to its real service first (Settings › Real services): a credential is sealed for where it goes",onClick:()=>{W(""),L({vendor:N.twin,to:N.root.url})},children:N.credential?"Replace…":"Seal a credential…"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},N.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z.state==="ok"&&S.every((N)=>!N.root?.url)?$.jsxDEV("p",{className:"mode pad",children:"No vendor here has a real service behind it, so none holds a credential. Connect one in Settings › Real services; its credential is sealed here."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"links-head",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{id:"links-head",children:"Links"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"a vendor with no twin, forwarded with its sealed credential"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(r1,{load:F,what:"the links"},void 0,!1,void 0,this),X.state==="ok"&&(X.data.journalFailures??0)>0?$.jsxDEV("p",{className:"mode pad",role:"alert",children:[X.data.journalFailures," request ",X.data.journalFailures===1?"line was":"lines were"," not kept by this World's server since it started (its links, and the twins it runs in its own process): those requests are missing from what this page counts."]},void 0,!0,void 0,this):null,F.state==="ok"&&T.length===0?$.jsxDEV("p",{className:"mode pad",children:["No links. A link forwards requests for a vendor with no twin here, at ",$.jsxDEV("code",{children:[l0,"/",_,"/<link>/…"]},void 0,!0,void 0,this),", to that vendor's real API with the credential sealed for it."]},void 0,!0,void 0,this):null,T.length?$.jsxDEV("table",{className:"dense","aria-label":"Links",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Link"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Origin"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:"Requests, 24h"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:T.map((N)=>{let y=F.state==="ok"?F.data.links[N].origin:"",D=X.state==="ok"?X.data.twins.find((l)=>l.twin===N):void 0;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("b",{children:N},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("code",{children:y},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:D?$.jsxDEV("span",{title:Object.entries(D.byStatus).map(([l,p])=>`${l}: ${p}`).join(" · "),children:D.requests},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:[w(Y[N]??null),Y[N]?.boundTo?$.jsxDEV("div",{className:"mode",children:["bound to ",$.jsxDEV("code",{children:Y[N].boundTo},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),J?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{W(""),L({vendor:N,to:y})},children:Y[N]?"Replace…":"Seal a credential…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void C(N),children:"Remove…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},N,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(n1,{open:Boolean(H),onClose:()=>{if(!O)L(null)},title:`Seal ${H?Y1(H.vendor):""}'s credential`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>L(null),disabled:O,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"seal-credential",className:"primary",disabled:O||!z,children:O?"Sealing…":"Seal it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"seal-credential",className:"stack",onSubmit:(N)=>void f(N),children:[$.jsxDEV("p",{className:"mode",children:["It is sealed for ",$.jsxDEV("code",{children:H?.to},void 0,!1,void 0,this)," and opens there only. It is never shown again, here or anywhere."]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real key"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"credential",type:"password",value:z,onChange:(N)=>W(N.target.value),autoComplete:"off",required:!0,autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function LF({name:_,token:Q,admin:J,canWrite:q,refused:U,onRemoved:G,only:Z}){let F=(V)=>!Z||Z===V,[X,Y]=r.useState(0),K=N1(Q,`/-/${_}/twins`,X),H=N1(Q,`/-/${_}/checks`,X),[L,z]=r.useState(0),W=N1(Q,`/-/${_}/clock`,L),[O,R]=r.useState([]),[B,P]=r.useState(null),[A,T]=r.useState(null),[f,C]=r.useState(""),[w,S]=r.useState("gated"),[N,y]=r.useState(!1),D=(V,h,I)=>{if(R((v)=>[{ok:V,text:h,at:new Date().toISOString(),n:++j5,...I?.length?{acts:I}:{}},...v].slice(0,6)),!V)j1(h,"error")},l=async(V,h,I)=>{let v=await I1(Q,h,I).catch(()=>null);if(!v)return D(!1,`${V}: the World did not answer`),!1;if(!v.ok){U(v);let m=b1(await C0(v));return D(!1,`${V}: ${m.text}`,m.acts),!1}return D(!0,`${V}: done.`),Y((m)=>m+1),!0},p=async(V)=>{if(V.preventDefault(),!A)return;y(!0);let h=A.root??{},I=await l(f.trim()?`Connect ${Y1(A.twin)} to ${f.trim()}`:`Disconnect ${Y1(A.twin)}`,`/-/${_}/twins/${A.twin}/root`,{method:"PUT",body:JSON.stringify(f.trim()?{...h,url:f.trim(),deploy:w}:null)});if(y(!1),I)T(null)},k=async()=>{if(!await T0({title:`Rotate the tokens of ${_}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let V=await I1(J,`/-/worlds/${_}/rotate`,{method:"POST"});if(V.ok)P(await V.json()),D(!0,"Rotated: the new tokens are shown once, below.");else D(!1,`Rotate: ${await q0(V)}`)},b=async()=>{if(!await T0({title:`Remove ${_}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:_}))return;let V=await I1(J,`/-/worlds/${_}`,{method:"DELETE"}).catch((h)=>h);if(V instanceof Error){D(!1,`Remove: the host did not answer (${V.message})`);return}if(V.ok)G();else D(!1,`Remove: ${await q0(V)}`)},j=K.state==="ok"?K.data.twins:[],E={gated:"gated: a person deploys an approved changeset",auto:"auto: a push deploys at once",hold:"hold: nothing deploys"};return $.jsxDEV($.Fragment,{children:[$.jsxDEV(i0,{log:O,name:_},void 0,!1,void 0,this),F("access")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Access"},void 0,!1,void 0,this),q?$.jsxDEV(KF,{name:_,token:Q},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"This session reads the World: its keys are managed by whoever holds its token."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("services")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Real services"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:[j.some((V)=>V.root?.url)?null:"Every vendor here is a stand-in. ","Connect a vendor to its real service to read the real state into this World; its real credential is sealed in the Vault, and an approved changeset deploys there by its policy."]},void 0,!0,void 0,this),$.jsxDEV(r1,{load:K,what:"the vendors"},void 0,!1,void 0,this),K.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Real services",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last read from it"},void 0,!1,void 0,this),q?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:j.map((V)=>{let h=V.root;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(u1,{vendor:V.twin},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/${V.twin}`,title:`Its log and stored state · ${V.position??0} entries`,onClick:(I)=>{I.preventDefault(),f1([..._.split("/"),V.twin])},children:Y1(V.twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:h?.url?$.jsxDEV("code",{children:h.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"not connected"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:h?.url?E[h.deploy??""]??h.deploy??"—":"—"},void 0,!1,void 0,this),$.jsxDEV("td",{children:V.refresh?.failed?$.jsxDEV("span",{role:"alert",children:["failed ×",V.refresh.failed.count??1,": ",V.refresh.failed.reason??""]},void 0,!0,void 0,this):h?.url?p6(V.refresh?.observedAt??V.refresh?.at):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{C(h?.url??""),S(h?.deploy==="auto"||h?.deploy==="hold"?h.deploy:"gated"),T(V)},children:h?.url?"Change…":"Connect…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",disabled:!h?.url,title:h?.url?"Read the real service's current state into this World":"Connect it first",onClick:()=>void T0({title:`Read ${Y1(V.twin)} now?`,body:`The real ${Y1(V.twin)}'s current state is read into this World. Nothing is written to ${Y1(V.twin)}.`,action:"Read from it"}).then((I)=>{if(I)l(`Read from ${Y1(V.twin)}`,`/-/${_}/twins/${V.twin}/refresh`,{method:"POST"})}),children:"Read from it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},V.twin,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,F("clock")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Clock"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"The instant every vendor here stamps from. Set it and move it forward to see what happens later: renewals, expiries, scheduled sends."},void 0,!1,void 0,this),$.jsxDEV(lZ,{name:_,token:Q,clock:W,canWrite:q,onChanged:()=>z((V)=>V+1),refused:U,open:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("checks")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Checks"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"JavaScript the World runs over every change before it is performed (a changeset's Verify runs them too)."},void 0,!1,void 0,this),$.jsxDEV(r1,{load:H,what:"the checks"},void 0,!1,void 0,this),H.state==="ok"?H.data.checks.length===0?$.jsxDEV("p",{className:"mode",children:"No checks: every change is performed as it comes."},void 0,!1,void 0,this):$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Checks",children:$.jsxDEV("tbody",{children:H.data.checks.map((V)=>$.jsxDEV("tr",{children:$.jsxDEV("td",{children:$.jsxDEV("code",{children:V},void 0,!1,void 0,this)},void 0,!1,void 0,this)},V,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,J&&!Z?$.jsxDEV("div",{className:"danger",role:"region","aria-label":"Danger zone",children:[$.jsxDEV("h3",{children:"Danger zone"},void 0,!1,void 0,this),B?$.jsxDEV("p",{role:"status",children:["token ",$.jsxDEV("code",{children:B.token},void 0,!1,void 0,this)," · read token ",$.jsxDEV("code",{children:B.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void k(),children:"Rotate tokens"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"New tokens for this World; every app, script and browser using the old ones is signed out."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void b(),children:"Remove world"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"Deletes this World and everything in it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(n1,{open:Boolean(A),onClose:()=>{if(!N)T(null)},title:`Connect ${A?Y1(A.twin):""} to its real service`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>T(null),disabled:N,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"connect-root",className:"primary",disabled:N,children:N?"Saving…":f.trim()?"Connect":"Disconnect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"connect-root",className:"stack",onSubmit:(V)=>void p(V),children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real service's API address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"rootUrl",value:f,onChange:(V)=>C(V.target.value),placeholder:"https://api.openai.com",autoFocus:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Empty disconnects it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"rootDeploy",value:w,onChange:(V)=>S(V.target.value==="auto"?"auto":V.target.value==="hold"?"hold":"gated"),children:["gated","auto","hold"].map((V)=>$.jsxDEV("option",{value:V,children:E[V]},V,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function oB(){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(CZ,{},void 0,!1,void 0,this),$.jsxDEV(M_,{},void 0,!1,void 0,this),$.jsxDEV(B_,{},void 0,!1,void 0,this),$.jsxDEV(A_,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{tB as openAt,v5 as ROOT,oB as ConsolePage};
|