blokctl 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/create/project.d.ts +2 -0
- package/dist/commands/create/project.js +13 -10
- package/dist/commands/create/utils/Examples.d.ts +2 -2
- package/dist/commands/create/utils/Examples.js +69 -103
- package/dist/commands/create/workflow.js +8 -6
- package/dist/commands/dev/index.js +26 -0
- package/dist/commands/install/node.d.ts +1 -0
- package/dist/commands/install/node.js +3 -39
- package/dist/commands/migrate/index.js +25 -0
- package/dist/commands/migrate/nodesTs.d.ts +31 -0
- package/dist/commands/migrate/nodesTs.js +484 -0
- package/dist/commands/migrate/refs.d.ts +15 -0
- package/dist/commands/migrate/refs.js +706 -0
- package/dist/commands/nodes/index.js +10 -0
- package/dist/commands/nodes/listNodes.d.ts +2 -0
- package/dist/commands/nodes/listNodes.js +20 -15
- package/dist/commands/nodes/syncNodes.d.ts +7 -0
- package/dist/commands/nodes/syncNodes.js +138 -0
- package/dist/commands/nodes/syncNodes.test.d.ts +1 -0
- package/dist/commands/nodes/syncNodes.test.js +322 -0
- package/dist/commands/publish/workflow.d.ts +1 -0
- package/dist/commands/publish/workflow.js +9 -0
- package/dist/commands/publish/workflow.test.d.ts +1 -0
- package/dist/commands/publish/workflow.test.js +22 -0
- package/dist/services/observability-stack.real-prometheus.test.d.ts +1 -0
- package/dist/services/observability-stack.real-prometheus.test.js +95 -0
- package/dist/services/observability-stack.real-tempo.test.d.ts +1 -0
- package/dist/services/observability-stack.real-tempo.test.js +86 -0
- package/dist/studio-dist/assets/index-QEvKRE4T.js +42 -0
- package/dist/studio-dist/index.html +1 -1
- package/package.json +3 -2
- package/dist/studio-dist/assets/index-CnFqCRQe.js +0 -42
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var Gb=Object.defineProperty;var Qb=(s,c,o)=>c in s?Gb(s,c,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[c]=o;var im=(s,c,o)=>Qb(s,typeof c!="symbol"?c+"":c,o);import{a as Yb,j as l,R as Zi,r as A,u as qe,b as ht,d as Lt,g as Kb,Q as Xb,e as Vb}from"./tanstack-query-Day3Mt-4.js";import{r as Zb,a as $b,L as De,b as Rl,c as Jb,O as Fb,d as Et,e as Wb,f as Ib,R as Pb}from"./tanstack-router-BB95iErN.js";import{af as eg,ag as Ym,ah as Km,ai as Xm,aj as Vm,ak as Zm,al as $m,am as Oo,an as tg}from"./charts-Dh48HebV.js";import{C as Ns,a as va,L as ng,b as Jm,A as In,c as _o,F as lg,T as ag,G as El,d as Qo,W as zs,S as Yo,e as sg,B as cm,f as ig,X as Kt,I as cg,g as Fm,h as nc,i as rm,j as Oe,k as rg,l as ga,m as Ko,n as lc,R as Xo,P as zl,o as Wm,p as Vo,D as og,q as Zo,r as Na,M as ug,s as dg,t as fg,u as Im,v as mg,w as hg,x as xg,y as pg,E as bg,z as om,H as $o,Z as gg,J as yg,K as um,N as vg,O as ja,Q as Uo,U as vs,V as Lo,Y as jg,_ as Ng,$ as zg,a0 as Sg,a1 as Pm,a2 as wg,a3 as Eg,a4 as Tg,a5 as Cg,a6 as Rg,a7 as kg,a8 as Dg,a9 as Jo,aa as Ag,ab as Mg,ac as Eo,ad as Og,ae as _g,af as eh}from"./icons-D-BBts99.js";import{u as Ug,f as To,g as Lg,a as qg}from"./tanstack-table-Biem1hxK.js";import{r as Hg,i as th,B as nh,C as lh,M as ah,H as Tl,P as Cl}from"./graph-DWteCadQ.js";(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function o(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(d){if(d.ep)return;d.ep=!0;const h=o(d);fetch(d.href,h)}})();var Co={exports:{}},ps={},Ro={exports:{}},ko={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* scheduler.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var dm;function Bg(){return dm||(dm=1,(function(s){function c(U,V){var P=U.length;U.push(V);e:for(;0<P;){var me=P-1>>>1,ye=U[me];if(0<d(ye,V))U[me]=V,U[P]=ye,P=me;else break e}}function o(U){return U.length===0?null:U[0]}function u(U){if(U.length===0)return null;var V=U[0],P=U.pop();if(P!==V){U[0]=P;e:for(var me=0,ye=U.length,we=ye>>>1;me<we;){var ke=2*(me+1)-1,xe=U[ke],$e=ke+1,Vt=U[$e];if(0>d(xe,P))$e<ye&&0>d(Vt,xe)?(U[me]=Vt,U[$e]=P,me=$e):(U[me]=xe,U[ke]=P,me=ke);else if($e<ye&&0>d(Vt,P))U[me]=Vt,U[$e]=P,me=$e;else break e}}return V}function d(U,V){var P=U.sortIndex-V.sortIndex;return P!==0?P:U.id-V.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;s.unstable_now=function(){return h.now()}}else{var m=Date,x=m.now();s.unstable_now=function(){return m.now()-x}}var b=[],N=[],y=1,v=null,j=3,R=!1,T=!1,k=!1,M=!1,Y=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function B(U){for(var V=o(N);V!==null;){if(V.callback===null)u(N);else if(V.startTime<=U)u(N),V.sortIndex=V.expirationTime,c(b,V);else break;V=o(N)}}function X(U){if(k=!1,B(U),!T)if(o(b)!==null)T=!0,Q||(Q=!0,K());else{var V=o(N);V!==null&&it(X,V.startTime-U)}}var Q=!1,F=-1,Z=5,ae=-1;function _e(){return M?!0:!(s.unstable_now()-ae<Z)}function He(){if(M=!1,Q){var U=s.unstable_now();ae=U;var V=!0;try{e:{T=!1,k&&(k=!1,O(F),F=-1),R=!0;var P=j;try{t:{for(B(U),v=o(b);v!==null&&!(v.expirationTime>U&&_e());){var me=v.callback;if(typeof me=="function"){v.callback=null,j=v.priorityLevel;var ye=me(v.expirationTime<=U);if(U=s.unstable_now(),typeof ye=="function"){v.callback=ye,B(U),V=!0;break t}v===o(b)&&u(b),B(U)}else u(b);v=o(b)}if(v!==null)V=!0;else{var we=o(N);we!==null&&it(X,we.startTime-U),V=!1}}break e}finally{v=null,j=P,R=!1}V=void 0}}finally{V?K():Q=!1}}}var K;if(typeof G=="function")K=function(){G(He)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,Be=ee.port2;ee.port1.onmessage=He,K=function(){Be.postMessage(null)}}else K=function(){Y(He,0)};function it(U,V){F=Y(function(){U(s.unstable_now())},V)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(U){U.callback=null},s.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<U?Math.floor(1e3/U):5},s.unstable_getCurrentPriorityLevel=function(){return j},s.unstable_next=function(U){switch(j){case 1:case 2:case 3:var V=3;break;default:V=j}var P=j;j=V;try{return U()}finally{j=P}},s.unstable_requestPaint=function(){M=!0},s.unstable_runWithPriority=function(U,V){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var P=j;j=U;try{return V()}finally{j=P}},s.unstable_scheduleCallback=function(U,V,P){var me=s.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?me+P:me):P=me,U){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=P+ye,U={id:y++,callback:V,priorityLevel:U,startTime:P,expirationTime:ye,sortIndex:-1},P>me?(U.sortIndex=P,c(N,U),o(b)===null&&U===o(N)&&(k?(O(F),F=-1):k=!0,it(X,P-me))):(U.sortIndex=ye,c(b,U),T||R||(T=!0,Q||(Q=!0,K()))),U},s.unstable_shouldYield=_e,s.unstable_wrapCallback=function(U){var V=j;return function(){var P=j;j=V;try{return U.apply(this,arguments)}finally{j=P}}}})(ko)),ko}var fm;function Gg(){return fm||(fm=1,Ro.exports=Bg()),Ro.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-dom-client.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var mm;function Qg(){if(mm)return ps;mm=1;var s=Gg(),c=Yb(),o=Zb();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(h(e)!==e)throw Error(u(188))}function N(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,a=t;;){var i=n.return;if(i===null)break;var r=i.alternate;if(r===null){if(a=i.return,a!==null){n=a;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===n)return b(i),e;if(r===a)return b(i),t;r=r.sibling}throw Error(u(188))}if(n.return!==a.return)n=i,a=r;else{for(var f=!1,p=i.child;p;){if(p===n){f=!0,n=i,a=r;break}if(p===a){f=!0,a=i,n=r;break}p=p.sibling}if(!f){for(p=r.child;p;){if(p===n){f=!0,n=r,a=i;break}if(p===a){f=!0,a=r,n=i;break}p=p.sibling}if(!f)throw Error(u(189))}}if(n.alternate!==a)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,j=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),G=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),_e=Symbol.for("react.memo_cache_sentinel"),He=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=He&&e[He]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function Be(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case Y:return"Profiler";case M:return"StrictMode";case X:return"Suspense";case Q:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case G:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case B:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:Be(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return Be(e(t))}catch{}}return null}var it=Array.isArray,U=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},me=[],ye=-1;function we(e){return{current:e}}function ke(e){0>ye||(e.current=me[ye],me[ye]=null,ye--)}function xe(e,t){ye++,me[ye]=e.current,e.current=t}var $e=we(null),Vt=we(null),Nn=we(null),Ts=we(null);function Cs(e,t){switch(xe(Nn,t),xe(Vt,e),xe($e,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?R0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=R0(t),e=k0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ke($e),xe($e,e)}function kl(){ke($e),ke(Vt),ke(Nn)}function ic(e){e.memoizedState!==null&&xe(Ts,e);var t=$e.current,n=k0(t,e.type);t!==n&&(xe(Vt,e),xe($e,n))}function Rs(e){Vt.current===e&&(ke($e),ke(Vt)),Ts.current===e&&(ke(Ts),fs._currentValue=P)}var cc,au;function tl(e){if(cc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);cc=t&&t[1]||"",au=-1<n.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+cc+e+au}var rc=!1;function oc(e,t){if(!e||rc)return"";rc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(D){var C=D}Reflect.construct(e,[],H)}else{try{H.call()}catch(D){C=D}e.call(H.prototype)}}else{try{throw Error()}catch(D){C=D}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(D){if(D&&C&&typeof D.stack=="string")return[D.stack,C.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),f=r[0],p=r[1];if(f&&p){var g=f.split(`
|
|
20
|
+
`),E=p.split(`
|
|
21
|
+
`);for(i=a=0;a<g.length&&!g[a].includes("DetermineComponentFrameRoot");)a++;for(;i<E.length&&!E[i].includes("DetermineComponentFrameRoot");)i++;if(a===g.length||i===E.length)for(a=g.length-1,i=E.length-1;1<=a&&0<=i&&g[a]!==E[i];)i--;for(;1<=a&&0<=i;a--,i--)if(g[a]!==E[i]){if(a!==1||i!==1)do if(a--,i--,0>i||g[a]!==E[i]){var _=`
|
|
22
|
+
`+g[a].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),_}while(1<=a&&0<=i);break}}}finally{rc=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?tl(n):""}function gx(e,t){switch(e.tag){case 26:case 27:case 5:return tl(e.type);case 16:return tl("Lazy");case 13:return e.child!==t&&t!==null?tl("Suspense Fallback"):tl("Suspense");case 19:return tl("SuspenseList");case 0:case 15:return oc(e.type,!1);case 11:return oc(e.type.render,!1);case 1:return oc(e.type,!0);case 31:return tl("Activity");default:return""}}function su(e){try{var t="",n=null;do t+=gx(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
23
|
+
Error generating stack: `+a.message+`
|
|
24
|
+
`+a.stack}}var uc=Object.prototype.hasOwnProperty,dc=s.unstable_scheduleCallback,fc=s.unstable_cancelCallback,yx=s.unstable_shouldYield,vx=s.unstable_requestPaint,pt=s.unstable_now,jx=s.unstable_getCurrentPriorityLevel,iu=s.unstable_ImmediatePriority,cu=s.unstable_UserBlockingPriority,ks=s.unstable_NormalPriority,Nx=s.unstable_LowPriority,ru=s.unstable_IdlePriority,zx=s.log,Sx=s.unstable_setDisableYieldValue,Sa=null,bt=null;function zn(e){if(typeof zx=="function"&&Sx(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Sa,e)}catch{}}var gt=Math.clz32?Math.clz32:Tx,wx=Math.log,Ex=Math.LN2;function Tx(e){return e>>>=0,e===0?32:31-(wx(e)/Ex|0)|0}var Ds=256,As=262144,Ms=4194304;function nl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Os(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var i=0,r=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var p=a&134217727;return p!==0?(a=p&~r,a!==0?i=nl(a):(f&=p,f!==0?i=nl(f):n||(n=p&~e,n!==0&&(i=nl(n))))):(p=a&~r,p!==0?i=nl(p):f!==0?i=nl(f):n||(n=a&~e,n!==0&&(i=nl(n)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function wa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Cx(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ou(){var e=Ms;return Ms<<=1,(Ms&62914560)===0&&(Ms=4194304),e}function mc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ea(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Rx(e,t,n,a,i,r){var f=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var p=e.entanglements,g=e.expirationTimes,E=e.hiddenUpdates;for(n=f&~n;0<n;){var _=31-gt(n),H=1<<_;p[_]=0,g[_]=-1;var C=E[_];if(C!==null)for(E[_]=null,_=0;_<C.length;_++){var D=C[_];D!==null&&(D.lane&=-536870913)}n&=~H}a!==0&&uu(e,a,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(f&~t))}function uu(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-gt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function du(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-gt(n),i=1<<a;i&t|e[a]&t&&(e[a]|=t),n&=~i}}function fu(e,t){var n=t&-t;return n=(n&42)!==0?1:hc(n),(n&(e.suspendedLanes|t))!==0?0:n}function hc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function xc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function mu(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:P0(e.type))}function hu(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var Sn=Math.random().toString(36).slice(2),We="__reactFiber$"+Sn,ct="__reactProps$"+Sn,Dl="__reactContainer$"+Sn,pc="__reactEvents$"+Sn,kx="__reactListeners$"+Sn,Dx="__reactHandles$"+Sn,xu="__reactResources$"+Sn,Ta="__reactMarker$"+Sn;function bc(e){delete e[We],delete e[ct],delete e[pc],delete e[kx],delete e[Dx]}function Al(e){var t=e[We];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Dl]||n[We]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=L0(e);e!==null;){if(n=e[We])return n;e=L0(e)}return t}e=n,n=e.parentNode}return null}function Ml(e){if(e=e[We]||e[Dl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ca(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Ol(e){var t=e[xu];return t||(t=e[xu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Je(e){e[Ta]=!0}var pu=new Set,bu={};function ll(e,t){_l(e,t),_l(e+"Capture",t)}function _l(e,t){for(bu[e]=t,e=0;e<t.length;e++)pu.add(t[e])}var Ax=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),gu={},yu={};function Mx(e){return uc.call(yu,e)?!0:uc.call(gu,e)?!1:Ax.test(e)?yu[e]=!0:(gu[e]=!0,!1)}function _s(e,t,n){if(Mx(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Us(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function en(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function Tt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ox(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var i=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(f){n=""+f,r.call(this,f)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gc(e){if(!e._valueTracker){var t=vu(e)?"checked":"value";e._valueTracker=Ox(e,t,""+e[t])}}function ju(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=vu(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Ls(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var _x=/[\n"\\]/g;function Ct(e){return e.replace(_x,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function yc(e,t,n,a,i,r,f,p){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Tt(t)):e.value!==""+Tt(t)&&(e.value=""+Tt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?vc(e,f,Tt(t)):n!=null?vc(e,f,Tt(n)):a!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Tt(p):e.removeAttribute("name")}function Nu(e,t,n,a,i,r,f,p){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){gc(e);return}n=n!=null?""+Tt(n):"",t=t!=null?""+Tt(t):n,p||t===e.value||(e.value=t),e.defaultValue=t}a=a??i,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=p?e.checked:!!a,e.defaultChecked=!!a,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),gc(e)}function vc(e,t,n){t==="number"&&Ls(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ul(e,t,n,a){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Tt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,a&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function zu(e,t,n){if(t!=null&&(t=""+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Tt(n):""}function Su(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(u(92));if(it(a)){if(1<a.length)throw Error(u(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Tt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),gc(e)}function Ll(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ux=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function wu(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||Ux.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Eu(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var i in t)a=t[i],t.hasOwnProperty(i)&&n[i]!==a&&wu(e,i,a)}else for(var r in t)t.hasOwnProperty(r)&&wu(e,r,t[r])}function jc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Lx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),qx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qs(e){return qx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function tn(){}var Nc=null;function zc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ql=null,Hl=null;function Tu(e){var t=Ml(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(yc(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ct(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var i=a[ct]||null;if(!i)throw Error(u(90));yc(a,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&ju(a)}break e;case"textarea":zu(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ul(e,!!n.multiple,t,!1)}}}var Sc=!1;function Cu(e,t,n){if(Sc)return e(t,n);Sc=!0;try{var a=e(t);return a}finally{if(Sc=!1,(ql!==null||Hl!==null)&&(wi(),ql&&(t=ql,e=Hl,Hl=ql=null,Tu(t),e)))for(t=0;t<e.length;t++)Tu(e[t])}}function Ra(e,t){var n=e.stateNode;if(n===null)return null;var a=n[ct]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var nn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wc=!1;if(nn)try{var ka={};Object.defineProperty(ka,"passive",{get:function(){wc=!0}}),window.addEventListener("test",ka,ka),window.removeEventListener("test",ka,ka)}catch{wc=!1}var wn=null,Ec=null,Hs=null;function Ru(){if(Hs)return Hs;var e,t=Ec,n=t.length,a,i="value"in wn?wn.value:wn.textContent,r=i.length;for(e=0;e<n&&t[e]===i[e];e++);var f=n-e;for(a=1;a<=f&&t[n-a]===i[r-a];a++);return Hs=i.slice(e,1<a?1-a:void 0)}function Bs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Gs(){return!0}function ku(){return!1}function rt(e){function t(n,a,i,r,f){this._reactName=n,this._targetInst=i,this.type=a,this.nativeEvent=r,this.target=f,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(n=e[p],this[p]=n?n(r):r[p]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Gs:ku,this.isPropagationStopped=ku,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Gs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Gs)},persist:function(){},isPersistent:Gs}),t}var al={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qs=rt(al),Da=v({},al,{view:0,detail:0}),Hx=rt(Da),Tc,Cc,Aa,Ys=v({},Da,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Aa&&(Aa&&e.type==="mousemove"?(Tc=e.screenX-Aa.screenX,Cc=e.screenY-Aa.screenY):Cc=Tc=0,Aa=e),Tc)},movementY:function(e){return"movementY"in e?e.movementY:Cc}}),Du=rt(Ys),Bx=v({},Ys,{dataTransfer:0}),Gx=rt(Bx),Qx=v({},Da,{relatedTarget:0}),Rc=rt(Qx),Yx=v({},al,{animationName:0,elapsedTime:0,pseudoElement:0}),Kx=rt(Yx),Xx=v({},al,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vx=rt(Xx),Zx=v({},al,{data:0}),Au=rt(Zx),$x={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Fx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fx[e])?!!t[e]:!1}function kc(){return Wx}var Ix=v({},Da,{key:function(e){if(e.key){var t=$x[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Jx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kc,charCode:function(e){return e.type==="keypress"?Bs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Px=rt(Ix),ep=v({},Ys,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mu=rt(ep),tp=v({},Da,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kc}),np=rt(tp),lp=v({},al,{propertyName:0,elapsedTime:0,pseudoElement:0}),ap=rt(lp),sp=v({},Ys,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ip=rt(sp),cp=v({},al,{newState:0,oldState:0}),rp=rt(cp),op=[9,13,27,32],Dc=nn&&"CompositionEvent"in window,Ma=null;nn&&"documentMode"in document&&(Ma=document.documentMode);var up=nn&&"TextEvent"in window&&!Ma,Ou=nn&&(!Dc||Ma&&8<Ma&&11>=Ma),_u=" ",Uu=!1;function Lu(e,t){switch(e){case"keyup":return op.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bl=!1;function dp(e,t){switch(e){case"compositionend":return qu(t);case"keypress":return t.which!==32?null:(Uu=!0,_u);case"textInput":return e=t.data,e===_u&&Uu?null:e;default:return null}}function fp(e,t){if(Bl)return e==="compositionend"||!Dc&&Lu(e,t)?(e=Ru(),Hs=Ec=wn=null,Bl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ou&&t.locale!=="ko"?null:t.data;default:return null}}var mp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mp[e.type]:t==="textarea"}function Bu(e,t,n,a){ql?Hl?Hl.push(a):Hl=[a]:ql=a,t=Ai(t,"onChange"),0<t.length&&(n=new Qs("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Oa=null,_a=null;function hp(e){z0(e,0)}function Ks(e){var t=Ca(e);if(ju(t))return e}function Gu(e,t){if(e==="change")return t}var Qu=!1;if(nn){var Ac;if(nn){var Mc="oninput"in document;if(!Mc){var Yu=document.createElement("div");Yu.setAttribute("oninput","return;"),Mc=typeof Yu.oninput=="function"}Ac=Mc}else Ac=!1;Qu=Ac&&(!document.documentMode||9<document.documentMode)}function Ku(){Oa&&(Oa.detachEvent("onpropertychange",Xu),_a=Oa=null)}function Xu(e){if(e.propertyName==="value"&&Ks(_a)){var t=[];Bu(t,_a,e,zc(e)),Cu(hp,t)}}function xp(e,t,n){e==="focusin"?(Ku(),Oa=t,_a=n,Oa.attachEvent("onpropertychange",Xu)):e==="focusout"&&Ku()}function pp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ks(_a)}function bp(e,t){if(e==="click")return Ks(t)}function gp(e,t){if(e==="input"||e==="change")return Ks(t)}function yp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:yp;function Ua(e,t){if(yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var i=n[a];if(!uc.call(t,i)||!yt(e[i],t[i]))return!1}return!0}function Vu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zu(e,t){var n=Vu(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vu(n)}}function $u(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$u(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ju(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ls(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ls(e.document)}return t}function Oc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var vp=nn&&"documentMode"in document&&11>=document.documentMode,Gl=null,_c=null,La=null,Uc=!1;function Fu(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Uc||Gl==null||Gl!==Ls(a)||(a=Gl,"selectionStart"in a&&Oc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),La&&Ua(La,a)||(La=a,a=Ai(_c,"onSelect"),0<a.length&&(t=new Qs("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Gl)))}function sl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ql={animationend:sl("Animation","AnimationEnd"),animationiteration:sl("Animation","AnimationIteration"),animationstart:sl("Animation","AnimationStart"),transitionrun:sl("Transition","TransitionRun"),transitionstart:sl("Transition","TransitionStart"),transitioncancel:sl("Transition","TransitionCancel"),transitionend:sl("Transition","TransitionEnd")},Lc={},Wu={};nn&&(Wu=document.createElement("div").style,"AnimationEvent"in window||(delete Ql.animationend.animation,delete Ql.animationiteration.animation,delete Ql.animationstart.animation),"TransitionEvent"in window||delete Ql.transitionend.transition);function il(e){if(Lc[e])return Lc[e];if(!Ql[e])return e;var t=Ql[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Wu)return Lc[e]=t[n];return e}var Iu=il("animationend"),Pu=il("animationiteration"),ed=il("animationstart"),jp=il("transitionrun"),Np=il("transitionstart"),zp=il("transitioncancel"),td=il("transitionend"),nd=new Map,qc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");qc.push("scrollEnd");function Ht(e,t){nd.set(e,t),ll(t,[e])}var Xs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Rt=[],Yl=0,Hc=0;function Vs(){for(var e=Yl,t=Hc=Yl=0;t<e;){var n=Rt[t];Rt[t++]=null;var a=Rt[t];Rt[t++]=null;var i=Rt[t];Rt[t++]=null;var r=Rt[t];if(Rt[t++]=null,a!==null&&i!==null){var f=a.pending;f===null?i.next=i:(i.next=f.next,f.next=i),a.pending=i}r!==0&&ld(n,i,r)}}function Zs(e,t,n,a){Rt[Yl++]=e,Rt[Yl++]=t,Rt[Yl++]=n,Rt[Yl++]=a,Hc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Bc(e,t,n,a){return Zs(e,t,n,a),$s(e)}function cl(e,t){return Zs(e,null,null,t),$s(e)}function ld(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var i=!1,r=e.return;r!==null;)r.childLanes|=n,a=r.alternate,a!==null&&(a.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-gt(n),e=r.hiddenUpdates,a=e[i],a===null?e[i]=[t]:a.push(t),t.lane=n|536870912),r):null}function $s(e){if(50<ss)throw ss=0,Jr=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Kl={};function Sp(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,t,n,a){return new Sp(e,t,n,a)}function Gc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ln(e,t){var n=e.alternate;return n===null?(n=vt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ad(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Js(e,t,n,a,i,r){var f=0;if(a=e,typeof e=="function")Gc(e)&&(f=1);else if(typeof e=="string")f=Rb(e,n,$e.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ae:return e=vt(31,n,t,i),e.elementType=ae,e.lanes=r,e;case k:return rl(n.children,i,r,t);case M:f=8,i|=24;break;case Y:return e=vt(12,n,t,i|2),e.elementType=Y,e.lanes=r,e;case X:return e=vt(13,n,t,i),e.elementType=X,e.lanes=r,e;case Q:return e=vt(19,n,t,i),e.elementType=Q,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:f=10;break e;case O:f=9;break e;case B:f=11;break e;case F:f=14;break e;case Z:f=16,a=null;break e}f=29,n=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=vt(f,n,t,i),t.elementType=e,t.type=a,t.lanes=r,t}function rl(e,t,n,a){return e=vt(7,e,a,t),e.lanes=n,e}function Qc(e,t,n){return e=vt(6,e,null,t),e.lanes=n,e}function sd(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function Yc(e,t,n){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var id=new WeakMap;function kt(e,t){if(typeof e=="object"&&e!==null){var n=id.get(e);return n!==void 0?n:(t={value:e,source:t,stack:su(t)},id.set(e,t),t)}return{value:e,source:t,stack:su(t)}}var Xl=[],Vl=0,Fs=null,qa=0,Dt=[],At=0,En=null,Zt=1,$t="";function an(e,t){Xl[Vl++]=qa,Xl[Vl++]=Fs,Fs=e,qa=t}function cd(e,t,n){Dt[At++]=Zt,Dt[At++]=$t,Dt[At++]=En,En=e;var a=Zt;e=$t;var i=32-gt(a)-1;a&=~(1<<i),n+=1;var r=32-gt(t)+i;if(30<r){var f=i-i%5;r=(a&(1<<f)-1).toString(32),a>>=f,i-=f,Zt=1<<32-gt(t)+i|n<<i|a,$t=r+e}else Zt=1<<r|n<<i|a,$t=e}function Kc(e){e.return!==null&&(an(e,1),cd(e,1,0))}function Xc(e){for(;e===Fs;)Fs=Xl[--Vl],Xl[Vl]=null,qa=Xl[--Vl],Xl[Vl]=null;for(;e===En;)En=Dt[--At],Dt[At]=null,$t=Dt[--At],Dt[At]=null,Zt=Dt[--At],Dt[At]=null}function rd(e,t){Dt[At++]=Zt,Dt[At++]=$t,Dt[At++]=En,Zt=t.id,$t=t.overflow,En=e}var Ie=null,Ee=null,ue=!1,Tn=null,Mt=!1,Vc=Error(u(519));function Cn(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ha(kt(t,e)),Vc}function od(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[We]=e,t[ct]=a,n){case"dialog":ce("cancel",t),ce("close",t);break;case"iframe":case"object":case"embed":ce("load",t);break;case"video":case"audio":for(n=0;n<cs.length;n++)ce(cs[n],t);break;case"source":ce("error",t);break;case"img":case"image":case"link":ce("error",t),ce("load",t);break;case"details":ce("toggle",t);break;case"input":ce("invalid",t),Nu(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ce("invalid",t);break;case"textarea":ce("invalid",t),Su(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||T0(t.textContent,n)?(a.popover!=null&&(ce("beforetoggle",t),ce("toggle",t)),a.onScroll!=null&&ce("scroll",t),a.onScrollEnd!=null&&ce("scrollend",t),a.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||Cn(e,!0)}function ud(e){for(Ie=e.return;Ie;)switch(Ie.tag){case 5:case 31:case 13:Mt=!1;return;case 27:case 3:Mt=!0;return;default:Ie=Ie.return}}function Zl(e){if(e!==Ie)return!1;if(!ue)return ud(e),ue=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||uo(e.type,e.memoizedProps)),n=!n),n&&Ee&&Cn(e),ud(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ee=U0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ee=U0(e)}else t===27?(t=Ee,Qn(e.type)?(e=po,po=null,Ee=e):Ee=t):Ee=Ie?_t(e.stateNode.nextSibling):null;return!0}function ol(){Ee=Ie=null,ue=!1}function Zc(){var e=Tn;return e!==null&&(ft===null?ft=e:ft.push.apply(ft,e),Tn=null),e}function Ha(e){Tn===null?Tn=[e]:Tn.push(e)}var $c=we(null),ul=null,sn=null;function Rn(e,t,n){xe($c,t._currentValue),t._currentValue=n}function cn(e){e._currentValue=$c.current,ke($c)}function Jc(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Fc(e,t,n,a){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var f=i.child;r=r.firstContext;e:for(;r!==null;){var p=r;r=i;for(var g=0;g<t.length;g++)if(p.context===t[g]){r.lanes|=n,p=r.alternate,p!==null&&(p.lanes|=n),Jc(r.return,n,e),a||(f=null);break e}r=p.next}}else if(i.tag===18){if(f=i.return,f===null)throw Error(u(341));f.lanes|=n,r=f.alternate,r!==null&&(r.lanes|=n),Jc(f,n,e),f=null}else f=i.child;if(f!==null)f.return=i;else for(f=i;f!==null;){if(f===e){f=null;break}if(i=f.sibling,i!==null){i.return=f.return,f=i;break}f=f.return}i=f}}function $l(e,t,n,a){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var f=i.alternate;if(f===null)throw Error(u(387));if(f=f.memoizedProps,f!==null){var p=i.type;yt(i.pendingProps.value,f.value)||(e!==null?e.push(p):e=[p])}}else if(i===Ts.current){if(f=i.alternate,f===null)throw Error(u(387));f.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(fs):e=[fs])}i=i.return}e!==null&&Fc(t,e,n,a),t.flags|=262144}function Ws(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function dl(e){ul=e,sn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pe(e){return dd(ul,e)}function Is(e,t){return ul===null&&dl(e),dd(e,t)}function dd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sn===null){if(e===null)throw Error(u(308));sn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sn=sn.next=t;return n}var wp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Ep=s.unstable_scheduleCallback,Tp=s.unstable_NormalPriority,Ge={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wc(){return{controller:new wp,data:new Map,refCount:0}}function Ba(e){e.refCount--,e.refCount===0&&Ep(Tp,function(){e.controller.abort()})}var Ga=null,Ic=0,Jl=0,Fl=null;function Cp(e,t){if(Ga===null){var n=Ga=[];Ic=0,Jl=to(),Fl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Ic++,t.then(fd,fd),t}function fd(){if(--Ic===0&&Ga!==null){Fl!==null&&(Fl.status="fulfilled");var e=Ga;Ga=null,Jl=0,Fl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Rp(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(a.status="rejected",a.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),a}var md=U.S;U.S=function(e,t){Wf=pt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Cp(e,t),md!==null&&md(e,t)};var fl=we(null);function Pc(){var e=fl.current;return e!==null?e:ze.pooledCache}function Ps(e,t){t===null?xe(fl,fl.current):xe(fl,t.pool)}function hd(){var e=Pc();return e===null?null:{parent:Ge._currentValue,pool:e}}var Wl=Error(u(460)),er=Error(u(474)),ei=Error(u(542)),ti={then:function(){}};function xd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function pd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gd(e),e;default:if(typeof t.status=="string")t.then(tn,tn);else{if(e=ze,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=a}},function(a){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gd(e),e}throw hl=t,Wl}}function ml(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(hl=n,Wl):n}}var hl=null;function bd(){if(hl===null)throw Error(u(459));var e=hl;return hl=null,e}function gd(e){if(e===Wl||e===ei)throw Error(u(483))}var Il=null,Qa=0;function ni(e){var t=Qa;return Qa+=1,Il===null&&(Il=[]),pd(Il,e,t)}function Ya(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function li(e,t){throw t.$$typeof===j?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function yd(e){function t(S,z){if(e){var w=S.deletions;w===null?(S.deletions=[z],S.flags|=16):w.push(z)}}function n(S,z){if(!e)return null;for(;z!==null;)t(S,z),z=z.sibling;return null}function a(S){for(var z=new Map;S!==null;)S.key!==null?z.set(S.key,S):z.set(S.index,S),S=S.sibling;return z}function i(S,z){return S=ln(S,z),S.index=0,S.sibling=null,S}function r(S,z,w){return S.index=w,e?(w=S.alternate,w!==null?(w=w.index,w<z?(S.flags|=67108866,z):w):(S.flags|=67108866,z)):(S.flags|=1048576,z)}function f(S){return e&&S.alternate===null&&(S.flags|=67108866),S}function p(S,z,w,L){return z===null||z.tag!==6?(z=Qc(w,S.mode,L),z.return=S,z):(z=i(z,w),z.return=S,z)}function g(S,z,w,L){var W=w.type;return W===k?_(S,z,w.props.children,L,w.key):z!==null&&(z.elementType===W||typeof W=="object"&&W!==null&&W.$$typeof===Z&&ml(W)===z.type)?(z=i(z,w.props),Ya(z,w),z.return=S,z):(z=Js(w.type,w.key,w.props,null,S.mode,L),Ya(z,w),z.return=S,z)}function E(S,z,w,L){return z===null||z.tag!==4||z.stateNode.containerInfo!==w.containerInfo||z.stateNode.implementation!==w.implementation?(z=Yc(w,S.mode,L),z.return=S,z):(z=i(z,w.children||[]),z.return=S,z)}function _(S,z,w,L,W){return z===null||z.tag!==7?(z=rl(w,S.mode,L,W),z.return=S,z):(z=i(z,w),z.return=S,z)}function H(S,z,w){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Qc(""+z,S.mode,w),z.return=S,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case R:return w=Js(z.type,z.key,z.props,null,S.mode,w),Ya(w,z),w.return=S,w;case T:return z=Yc(z,S.mode,w),z.return=S,z;case Z:return z=ml(z),H(S,z,w)}if(it(z)||K(z))return z=rl(z,S.mode,w,null),z.return=S,z;if(typeof z.then=="function")return H(S,ni(z),w);if(z.$$typeof===G)return H(S,Is(S,z),w);li(S,z)}return null}function C(S,z,w,L){var W=z!==null?z.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return W!==null?null:p(S,z,""+w,L);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case R:return w.key===W?g(S,z,w,L):null;case T:return w.key===W?E(S,z,w,L):null;case Z:return w=ml(w),C(S,z,w,L)}if(it(w)||K(w))return W!==null?null:_(S,z,w,L,null);if(typeof w.then=="function")return C(S,z,ni(w),L);if(w.$$typeof===G)return C(S,z,Is(S,w),L);li(S,w)}return null}function D(S,z,w,L,W){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return S=S.get(w)||null,p(z,S,""+L,W);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case R:return S=S.get(L.key===null?w:L.key)||null,g(z,S,L,W);case T:return S=S.get(L.key===null?w:L.key)||null,E(z,S,L,W);case Z:return L=ml(L),D(S,z,w,L,W)}if(it(L)||K(L))return S=S.get(w)||null,_(z,S,L,W,null);if(typeof L.then=="function")return D(S,z,w,ni(L),W);if(L.$$typeof===G)return D(S,z,w,Is(z,L),W);li(z,L)}return null}function $(S,z,w,L){for(var W=null,de=null,J=z,ne=z=0,oe=null;J!==null&&ne<w.length;ne++){J.index>ne?(oe=J,J=null):oe=J.sibling;var fe=C(S,J,w[ne],L);if(fe===null){J===null&&(J=oe);break}e&&J&&fe.alternate===null&&t(S,J),z=r(fe,z,ne),de===null?W=fe:de.sibling=fe,de=fe,J=oe}if(ne===w.length)return n(S,J),ue&&an(S,ne),W;if(J===null){for(;ne<w.length;ne++)J=H(S,w[ne],L),J!==null&&(z=r(J,z,ne),de===null?W=J:de.sibling=J,de=J);return ue&&an(S,ne),W}for(J=a(J);ne<w.length;ne++)oe=D(J,S,ne,w[ne],L),oe!==null&&(e&&oe.alternate!==null&&J.delete(oe.key===null?ne:oe.key),z=r(oe,z,ne),de===null?W=oe:de.sibling=oe,de=oe);return e&&J.forEach(function(Zn){return t(S,Zn)}),ue&&an(S,ne),W}function I(S,z,w,L){if(w==null)throw Error(u(151));for(var W=null,de=null,J=z,ne=z=0,oe=null,fe=w.next();J!==null&&!fe.done;ne++,fe=w.next()){J.index>ne?(oe=J,J=null):oe=J.sibling;var Zn=C(S,J,fe.value,L);if(Zn===null){J===null&&(J=oe);break}e&&J&&Zn.alternate===null&&t(S,J),z=r(Zn,z,ne),de===null?W=Zn:de.sibling=Zn,de=Zn,J=oe}if(fe.done)return n(S,J),ue&&an(S,ne),W;if(J===null){for(;!fe.done;ne++,fe=w.next())fe=H(S,fe.value,L),fe!==null&&(z=r(fe,z,ne),de===null?W=fe:de.sibling=fe,de=fe);return ue&&an(S,ne),W}for(J=a(J);!fe.done;ne++,fe=w.next())fe=D(J,S,ne,fe.value,L),fe!==null&&(e&&fe.alternate!==null&&J.delete(fe.key===null?ne:fe.key),z=r(fe,z,ne),de===null?W=fe:de.sibling=fe,de=fe);return e&&J.forEach(function(Bb){return t(S,Bb)}),ue&&an(S,ne),W}function Ne(S,z,w,L){if(typeof w=="object"&&w!==null&&w.type===k&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case R:e:{for(var W=w.key;z!==null;){if(z.key===W){if(W=w.type,W===k){if(z.tag===7){n(S,z.sibling),L=i(z,w.props.children),L.return=S,S=L;break e}}else if(z.elementType===W||typeof W=="object"&&W!==null&&W.$$typeof===Z&&ml(W)===z.type){n(S,z.sibling),L=i(z,w.props),Ya(L,w),L.return=S,S=L;break e}n(S,z);break}else t(S,z);z=z.sibling}w.type===k?(L=rl(w.props.children,S.mode,L,w.key),L.return=S,S=L):(L=Js(w.type,w.key,w.props,null,S.mode,L),Ya(L,w),L.return=S,S=L)}return f(S);case T:e:{for(W=w.key;z!==null;){if(z.key===W)if(z.tag===4&&z.stateNode.containerInfo===w.containerInfo&&z.stateNode.implementation===w.implementation){n(S,z.sibling),L=i(z,w.children||[]),L.return=S,S=L;break e}else{n(S,z);break}else t(S,z);z=z.sibling}L=Yc(w,S.mode,L),L.return=S,S=L}return f(S);case Z:return w=ml(w),Ne(S,z,w,L)}if(it(w))return $(S,z,w,L);if(K(w)){if(W=K(w),typeof W!="function")throw Error(u(150));return w=W.call(w),I(S,z,w,L)}if(typeof w.then=="function")return Ne(S,z,ni(w),L);if(w.$$typeof===G)return Ne(S,z,Is(S,w),L);li(S,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,z!==null&&z.tag===6?(n(S,z.sibling),L=i(z,w),L.return=S,S=L):(n(S,z),L=Qc(w,S.mode,L),L.return=S,S=L),f(S)):n(S,z)}return function(S,z,w,L){try{Qa=0;var W=Ne(S,z,w,L);return Il=null,W}catch(J){if(J===Wl||J===ei)throw J;var de=vt(29,J,null,S.mode);return de.lanes=L,de.return=S,de}finally{}}}var xl=yd(!0),vd=yd(!1),kn=!1;function tr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Dn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function An(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(he&2)!==0){var i=a.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),a.pending=t,t=$s(e),ld(e,null,n),t}return Zs(e,a,t,n),$s(e)}function Ka(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,du(e,n)}}function lr(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=f:r=r.next=f,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:a.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ar=!1;function Xa(){if(ar){var e=Fl;if(e!==null)throw e}}function Va(e,t,n,a){ar=!1;var i=e.updateQueue;kn=!1;var r=i.firstBaseUpdate,f=i.lastBaseUpdate,p=i.shared.pending;if(p!==null){i.shared.pending=null;var g=p,E=g.next;g.next=null,f===null?r=E:f.next=E,f=g;var _=e.alternate;_!==null&&(_=_.updateQueue,p=_.lastBaseUpdate,p!==f&&(p===null?_.firstBaseUpdate=E:p.next=E,_.lastBaseUpdate=g))}if(r!==null){var H=i.baseState;f=0,_=E=g=null,p=r;do{var C=p.lane&-536870913,D=C!==p.lane;if(D?(re&C)===C:(a&C)===C){C!==0&&C===Jl&&(ar=!0),_!==null&&(_=_.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var $=e,I=p;C=t;var Ne=n;switch(I.tag){case 1:if($=I.payload,typeof $=="function"){H=$.call(Ne,H,C);break e}H=$;break e;case 3:$.flags=$.flags&-65537|128;case 0:if($=I.payload,C=typeof $=="function"?$.call(Ne,H,C):$,C==null)break e;H=v({},H,C);break e;case 2:kn=!0}}C=p.callback,C!==null&&(e.flags|=64,D&&(e.flags|=8192),D=i.callbacks,D===null?i.callbacks=[C]:D.push(C))}else D={lane:C,tag:p.tag,payload:p.payload,callback:p.callback,next:null},_===null?(E=_=D,g=H):_=_.next=D,f|=C;if(p=p.next,p===null){if(p=i.shared.pending,p===null)break;D=p,p=D.next,D.next=null,i.lastBaseUpdate=D,i.shared.pending=null}}while(!0);_===null&&(g=H),i.baseState=g,i.firstBaseUpdate=E,i.lastBaseUpdate=_,r===null&&(i.shared.lanes=0),Ln|=f,e.lanes=f,e.memoizedState=H}}function jd(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Nd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)jd(n[e],t)}var Pl=we(null),ai=we(0);function zd(e,t){e=pn,xe(ai,e),xe(Pl,t),pn=e|t.baseLanes}function sr(){xe(ai,pn),xe(Pl,Pl.current)}function ir(){pn=ai.current,ke(Pl),ke(ai)}var jt=we(null),Ot=null;function Mn(e){var t=e.alternate;xe(Ue,Ue.current&1),xe(jt,e),Ot===null&&(t===null||Pl.current!==null||t.memoizedState!==null)&&(Ot=e)}function cr(e){xe(Ue,Ue.current),xe(jt,e),Ot===null&&(Ot=e)}function Sd(e){e.tag===22?(xe(Ue,Ue.current),xe(jt,e),Ot===null&&(Ot=e)):On()}function On(){xe(Ue,Ue.current),xe(jt,jt.current)}function Nt(e){ke(jt),Ot===e&&(Ot=null),ke(Ue)}var Ue=we(0);function si(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ho(n)||xo(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rn=0,te=null,ve=null,Qe=null,ii=!1,ea=!1,pl=!1,ci=0,Za=0,ta=null,kp=0;function Ae(){throw Error(u(321))}function rr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yt(e[n],t[n]))return!1;return!0}function or(e,t,n,a,i,r){return rn=r,te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?rf:Sr,pl=!1,r=n(a,i),pl=!1,ea&&(r=Ed(t,n,a,i)),wd(e),r}function wd(e){U.H=Fa;var t=ve!==null&&ve.next!==null;if(rn=0,Qe=ve=te=null,ii=!1,Za=0,ta=null,t)throw Error(u(300));e===null||Ye||(e=e.dependencies,e!==null&&Ws(e)&&(Ye=!0))}function Ed(e,t,n,a){te=e;var i=0;do{if(ea&&(ta=null),Za=0,ea=!1,25<=i)throw Error(u(301));if(i+=1,Qe=ve=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}U.H=of,r=t(n,a)}while(ea);return r}function Dp(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?$a(t):t,e=e.useState()[0],(ve!==null?ve.memoizedState:null)!==e&&(te.flags|=1024),t}function ur(){var e=ci!==0;return ci=0,e}function dr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function fr(e){if(ii){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ii=!1}rn=0,Qe=ve=te=null,ea=!1,Za=ci=0,ta=null}function st(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?te.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Le(){if(ve===null){var e=te.alternate;e=e!==null?e.memoizedState:null}else e=ve.next;var t=Qe===null?te.memoizedState:Qe.next;if(t!==null)Qe=t,ve=e;else{if(e===null)throw te.alternate===null?Error(u(467)):Error(u(310));ve=e,e={memoizedState:ve.memoizedState,baseState:ve.baseState,baseQueue:ve.baseQueue,queue:ve.queue,next:null},Qe===null?te.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function ri(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $a(e){var t=Za;return Za+=1,ta===null&&(ta=[]),e=pd(ta,e,t),t=te,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?rf:Sr),e}function oi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return $a(e);if(e.$$typeof===G)return Pe(e)}throw Error(u(438,String(e)))}function mr(e){var t=null,n=te.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=te.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ri(),te.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=_e;return t.index++,n}function on(e,t){return typeof t=="function"?t(e):t}function ui(e){var t=Le();return hr(t,ve,e)}function hr(e,t,n){var a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=n;var i=e.baseQueue,r=a.pending;if(r!==null){if(i!==null){var f=i.next;i.next=r.next,r.next=f}t.baseQueue=i=r,a.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var p=f=null,g=null,E=t,_=!1;do{var H=E.lane&-536870913;if(H!==E.lane?(re&H)===H:(rn&H)===H){var C=E.revertLane;if(C===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null}),H===Jl&&(_=!0);else if((rn&C)===C){E=E.next,C===Jl&&(_=!0);continue}else H={lane:0,revertLane:E.revertLane,gesture:null,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null},g===null?(p=g=H,f=r):g=g.next=H,te.lanes|=C,Ln|=C;H=E.action,pl&&n(r,H),r=E.hasEagerState?E.eagerState:n(r,H)}else C={lane:H,revertLane:E.revertLane,gesture:E.gesture,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null},g===null?(p=g=C,f=r):g=g.next=C,te.lanes|=H,Ln|=H;E=E.next}while(E!==null&&E!==t);if(g===null?f=r:g.next=p,!yt(r,e.memoizedState)&&(Ye=!0,_&&(n=Fl,n!==null)))throw n;e.memoizedState=r,e.baseState=f,e.baseQueue=g,a.lastRenderedState=r}return i===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function xr(e){var t=Le(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var a=n.dispatch,i=n.pending,r=t.memoizedState;if(i!==null){n.pending=null;var f=i=i.next;do r=e(r,f.action),f=f.next;while(f!==i);yt(r,t.memoizedState)||(Ye=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,a]}function Td(e,t,n){var a=te,i=Le(),r=ue;if(r){if(n===void 0)throw Error(u(407));n=n()}else n=t();var f=!yt((ve||i).memoizedState,n);if(f&&(i.memoizedState=n,Ye=!0),i=i.queue,gr(kd.bind(null,a,i,e),[e]),i.getSnapshot!==t||f||Qe!==null&&Qe.memoizedState.tag&1){if(a.flags|=2048,na(9,{destroy:void 0},Rd.bind(null,a,i,n,t),null),ze===null)throw Error(u(349));r||(rn&127)!==0||Cd(a,t,n)}return n}function Cd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=te.updateQueue,t===null?(t=ri(),te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rd(e,t,n,a){t.value=n,t.getSnapshot=a,Dd(t)&&Ad(e)}function kd(e,t,n){return n(function(){Dd(t)&&Ad(e)})}function Dd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yt(e,n)}catch{return!0}}function Ad(e){var t=cl(e,2);t!==null&&mt(t,e,2)}function pr(e){var t=st();if(typeof e=="function"){var n=e;if(e=n(),pl){zn(!0);try{n()}finally{zn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:e},t}function Md(e,t,n,a){return e.baseState=n,hr(e,ve,typeof a=="function"?a:on)}function Ap(e,t,n,a,i){if(mi(e))throw Error(u(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){r.listeners.push(f)}};U.T!==null?n(!0):r.isTransition=!1,a(r),n=t.pending,n===null?(r.next=t.pending=r,Od(t,r)):(r.next=n.next,t.pending=n.next=r)}}function Od(e,t){var n=t.action,a=t.payload,i=e.state;if(t.isTransition){var r=U.T,f={};U.T=f;try{var p=n(i,a),g=U.S;g!==null&&g(f,p),_d(e,t,p)}catch(E){br(e,t,E)}finally{r!==null&&f.types!==null&&(r.types=f.types),U.T=r}}else try{r=n(i,a),_d(e,t,r)}catch(E){br(e,t,E)}}function _d(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Ud(e,t,a)},function(a){return br(e,t,a)}):Ud(e,t,n)}function Ud(e,t,n){t.status="fulfilled",t.value=n,Ld(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Od(e,n)))}function br(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Ld(t),t=t.next;while(t!==a)}e.action=null}function Ld(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qd(e,t){return t}function Hd(e,t){if(ue){var n=ze.formState;if(n!==null){e:{var a=te;if(ue){if(Ee){t:{for(var i=Ee,r=Mt;i.nodeType!==8;){if(!r){i=null;break t}if(i=_t(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){Ee=_t(i.nextSibling),a=i.data==="F!";break e}}Cn(a)}a=!1}a&&(t=n[0])}}return n=st(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qd,lastRenderedState:t},n.queue=a,n=af.bind(null,te,a),a.dispatch=n,a=pr(!1),r=zr.bind(null,te,!1,a.queue),a=st(),i={state:t,dispatch:null,action:e,pending:null},a.queue=i,n=Ap.bind(null,te,i,r,n),i.dispatch=n,a.memoizedState=e,[t,n,!1]}function Bd(e){var t=Le();return Gd(t,ve,e)}function Gd(e,t,n){if(t=hr(e,t,qd)[0],e=ui(on)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=$a(t)}catch(f){throw f===Wl?ei:f}else a=t;t=Le();var i=t.queue,r=i.dispatch;return n!==t.memoizedState&&(te.flags|=2048,na(9,{destroy:void 0},Mp.bind(null,i,n),null)),[a,r,e]}function Mp(e,t){e.action=t}function Qd(e){var t=Le(),n=ve;if(n!==null)return Gd(t,n,e);Le(),t=t.memoizedState,n=Le();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function na(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=te.updateQueue,t===null&&(t=ri(),te.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Yd(){return Le().memoizedState}function di(e,t,n,a){var i=st();te.flags|=e,i.memoizedState=na(1|t,{destroy:void 0},n,a===void 0?null:a)}function fi(e,t,n,a){var i=Le();a=a===void 0?null:a;var r=i.memoizedState.inst;ve!==null&&a!==null&&rr(a,ve.memoizedState.deps)?i.memoizedState=na(t,r,n,a):(te.flags|=e,i.memoizedState=na(1|t,r,n,a))}function Kd(e,t){di(8390656,8,e,t)}function gr(e,t){fi(2048,8,e,t)}function Op(e){te.flags|=4;var t=te.updateQueue;if(t===null)t=ri(),te.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Xd(e){var t=Le().memoizedState;return Op({ref:t,nextImpl:e}),function(){if((he&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Vd(e,t){return fi(4,2,e,t)}function Zd(e,t){return fi(4,4,e,t)}function $d(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Jd(e,t,n){n=n!=null?n.concat([e]):null,fi(4,4,$d.bind(null,t,e),n)}function yr(){}function Fd(e,t){var n=Le();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&rr(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Wd(e,t){var n=Le();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&rr(t,a[1]))return a[0];if(a=e(),pl){zn(!0);try{e()}finally{zn(!1)}}return n.memoizedState=[a,t],a}function vr(e,t,n){return n===void 0||(rn&1073741824)!==0&&(re&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Pf(),te.lanes|=e,Ln|=e,n)}function Id(e,t,n,a){return yt(n,t)?n:Pl.current!==null?(e=vr(e,n,a),yt(e,t)||(Ye=!0),e):(rn&42)===0||(rn&1073741824)!==0&&(re&261930)===0?(Ye=!0,e.memoizedState=n):(e=Pf(),te.lanes|=e,Ln|=e,t)}function Pd(e,t,n,a,i){var r=V.p;V.p=r!==0&&8>r?r:8;var f=U.T,p={};U.T=p,zr(e,!1,t,n);try{var g=i(),E=U.S;if(E!==null&&E(p,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var _=Rp(g,a);Ja(e,t,_,wt(e))}else Ja(e,t,a,wt(e))}catch(H){Ja(e,t,{then:function(){},status:"rejected",reason:H},wt())}finally{V.p=r,f!==null&&p.types!==null&&(f.types=p.types),U.T=f}}function _p(){}function jr(e,t,n,a){if(e.tag!==5)throw Error(u(476));var i=ef(e).queue;Pd(e,i,t,P,n===null?_p:function(){return tf(e),n(a)})}function ef(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tf(e){var t=ef(e);t.next===null&&(t=e.alternate.memoizedState),Ja(e,t.next.queue,{},wt())}function Nr(){return Pe(fs)}function nf(){return Le().memoizedState}function lf(){return Le().memoizedState}function Up(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wt();e=Dn(n);var a=An(t,e,n);a!==null&&(mt(a,t,n),Ka(a,t,n)),t={cache:Wc()},e.payload=t;return}t=t.return}}function Lp(e,t,n){var a=wt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mi(e)?sf(t,n):(n=Bc(e,t,n,a),n!==null&&(mt(n,e,a),cf(n,t,a)))}function af(e,t,n){var a=wt();Ja(e,t,n,a)}function Ja(e,t,n,a){var i={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mi(e))sf(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var f=t.lastRenderedState,p=r(f,n);if(i.hasEagerState=!0,i.eagerState=p,yt(p,f))return Zs(e,t,i,0),ze===null&&Vs(),!1}catch{}finally{}if(n=Bc(e,t,i,a),n!==null)return mt(n,e,a),cf(n,t,a),!0}return!1}function zr(e,t,n,a){if(a={lane:2,revertLane:to(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},mi(e)){if(t)throw Error(u(479))}else t=Bc(e,n,a,2),t!==null&&mt(t,e,2)}function mi(e){var t=e.alternate;return e===te||t!==null&&t===te}function sf(e,t){ea=ii=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cf(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,du(e,n)}}var Fa={readContext:Pe,use:oi,useCallback:Ae,useContext:Ae,useEffect:Ae,useImperativeHandle:Ae,useLayoutEffect:Ae,useInsertionEffect:Ae,useMemo:Ae,useReducer:Ae,useRef:Ae,useState:Ae,useDebugValue:Ae,useDeferredValue:Ae,useTransition:Ae,useSyncExternalStore:Ae,useId:Ae,useHostTransitionStatus:Ae,useFormState:Ae,useActionState:Ae,useOptimistic:Ae,useMemoCache:Ae,useCacheRefresh:Ae};Fa.useEffectEvent=Ae;var rf={readContext:Pe,use:oi,useCallback:function(e,t){return st().memoizedState=[e,t===void 0?null:t],e},useContext:Pe,useEffect:Kd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,di(4194308,4,$d.bind(null,t,e),n)},useLayoutEffect:function(e,t){return di(4194308,4,e,t)},useInsertionEffect:function(e,t){di(4,2,e,t)},useMemo:function(e,t){var n=st();t=t===void 0?null:t;var a=e();if(pl){zn(!0);try{e()}finally{zn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=st();if(n!==void 0){var i=n(t);if(pl){zn(!0);try{n(t)}finally{zn(!1)}}}else i=t;return a.memoizedState=a.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},a.queue=e,e=e.dispatch=Lp.bind(null,te,e),[a.memoizedState,e]},useRef:function(e){var t=st();return e={current:e},t.memoizedState=e},useState:function(e){e=pr(e);var t=e.queue,n=af.bind(null,te,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:yr,useDeferredValue:function(e,t){var n=st();return vr(n,e,t)},useTransition:function(){var e=pr(!1);return e=Pd.bind(null,te,e.queue,!0,!1),st().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=te,i=st();if(ue){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),ze===null)throw Error(u(349));(re&127)!==0||Cd(a,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,Kd(kd.bind(null,a,r,e),[e]),a.flags|=2048,na(9,{destroy:void 0},Rd.bind(null,a,r,n,t),null),n},useId:function(){var e=st(),t=ze.identifierPrefix;if(ue){var n=$t,a=Zt;n=(a&~(1<<32-gt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ci++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=kp++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Nr,useFormState:Hd,useActionState:Hd,useOptimistic:function(e){var t=st();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=zr.bind(null,te,!0,n),n.dispatch=t,[e,t]},useMemoCache:mr,useCacheRefresh:function(){return st().memoizedState=Up.bind(null,te)},useEffectEvent:function(e){var t=st(),n={impl:e};return t.memoizedState=n,function(){if((he&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},Sr={readContext:Pe,use:oi,useCallback:Fd,useContext:Pe,useEffect:gr,useImperativeHandle:Jd,useInsertionEffect:Vd,useLayoutEffect:Zd,useMemo:Wd,useReducer:ui,useRef:Yd,useState:function(){return ui(on)},useDebugValue:yr,useDeferredValue:function(e,t){var n=Le();return Id(n,ve.memoizedState,e,t)},useTransition:function(){var e=ui(on)[0],t=Le().memoizedState;return[typeof e=="boolean"?e:$a(e),t]},useSyncExternalStore:Td,useId:nf,useHostTransitionStatus:Nr,useFormState:Bd,useActionState:Bd,useOptimistic:function(e,t){var n=Le();return Md(n,ve,e,t)},useMemoCache:mr,useCacheRefresh:lf};Sr.useEffectEvent=Xd;var of={readContext:Pe,use:oi,useCallback:Fd,useContext:Pe,useEffect:gr,useImperativeHandle:Jd,useInsertionEffect:Vd,useLayoutEffect:Zd,useMemo:Wd,useReducer:xr,useRef:Yd,useState:function(){return xr(on)},useDebugValue:yr,useDeferredValue:function(e,t){var n=Le();return ve===null?vr(n,e,t):Id(n,ve.memoizedState,e,t)},useTransition:function(){var e=xr(on)[0],t=Le().memoizedState;return[typeof e=="boolean"?e:$a(e),t]},useSyncExternalStore:Td,useId:nf,useHostTransitionStatus:Nr,useFormState:Qd,useActionState:Qd,useOptimistic:function(e,t){var n=Le();return ve!==null?Md(n,ve,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:mr,useCacheRefresh:lf};of.useEffectEvent=Xd;function wr(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:v({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Er={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=wt(),i=Dn(a);i.payload=t,n!=null&&(i.callback=n),t=An(e,i,a),t!==null&&(mt(t,e,a),Ka(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=wt(),i=Dn(a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=An(e,i,a),t!==null&&(mt(t,e,a),Ka(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wt(),a=Dn(n);a.tag=2,t!=null&&(a.callback=t),t=An(e,a,n),t!==null&&(mt(t,e,n),Ka(t,e,n))}};function uf(e,t,n,a,i,r,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,f):t.prototype&&t.prototype.isPureReactComponent?!Ua(n,a)||!Ua(i,r):!0}function df(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Er.enqueueReplaceState(t,t.state,null)}function bl(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=v({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function ff(e){Xs(e)}function mf(e){console.error(e)}function hf(e){Xs(e)}function hi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function xf(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Tr(e,t,n){return n=Dn(n),n.tag=3,n.payload={element:null},n.callback=function(){hi(e,t)},n}function pf(e){return e=Dn(e),e.tag=3,e}function bf(e,t,n,a){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=a.value;e.payload=function(){return i(r)},e.callback=function(){xf(t,n,a)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){xf(t,n,a),typeof i!="function"&&(qn===null?qn=new Set([this]):qn.add(this));var p=a.stack;this.componentDidCatch(a.value,{componentStack:p!==null?p:""})})}function qp(e,t,n,a,i){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&$l(t,n,i,!0),n=jt.current,n!==null){switch(n.tag){case 31:case 13:return Ot===null?Ei():n.alternate===null&&Me===0&&(Me=3),n.flags&=-257,n.flags|=65536,n.lanes=i,a===ti?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Ir(e,a,i)),!1;case 22:return n.flags|=65536,a===ti?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),Ir(e,a,i)),!1}throw Error(u(435,n.tag))}return Ir(e,a,i),Ei(),!1}if(ue)return t=jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,a!==Vc&&(e=Error(u(422),{cause:a}),Ha(kt(e,n)))):(a!==Vc&&(t=Error(u(423),{cause:a}),Ha(kt(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,a=kt(a,n),i=Tr(e.stateNode,a,i),lr(e,i),Me!==4&&(Me=2)),!1;var r=Error(u(520),{cause:a});if(r=kt(r,n),as===null?as=[r]:as.push(r),Me!==4&&(Me=2),t===null)return!0;a=kt(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Tr(n.stateNode,a,e),lr(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(qn===null||!qn.has(r))))return n.flags|=65536,i&=-i,n.lanes|=i,i=pf(i),bf(i,e,n,a),lr(n,i),!1}n=n.return}while(n!==null);return!1}var Cr=Error(u(461)),Ye=!1;function et(e,t,n,a){t.child=e===null?vd(t,null,n,a):xl(t,e.child,n,a)}function gf(e,t,n,a,i){n=n.render;var r=t.ref;if("ref"in a){var f={};for(var p in a)p!=="ref"&&(f[p]=a[p])}else f=a;return dl(t),a=or(e,t,n,f,r,i),p=ur(),e!==null&&!Ye?(dr(e,t,i),un(e,t,i)):(ue&&p&&Kc(t),t.flags|=1,et(e,t,a,i),t.child)}function yf(e,t,n,a,i){if(e===null){var r=n.type;return typeof r=="function"&&!Gc(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,vf(e,t,r,a,i)):(e=Js(n.type,null,a,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Ur(e,i)){var f=r.memoizedProps;if(n=n.compare,n=n!==null?n:Ua,n(f,a)&&e.ref===t.ref)return un(e,t,i)}return t.flags|=1,e=ln(r,a),e.ref=t.ref,e.return=t,t.child=e}function vf(e,t,n,a,i){if(e!==null){var r=e.memoizedProps;if(Ua(r,a)&&e.ref===t.ref)if(Ye=!1,t.pendingProps=a=r,Ur(e,i))(e.flags&131072)!==0&&(Ye=!0);else return t.lanes=e.lanes,un(e,t,i)}return Rr(e,t,n,a,i)}function jf(e,t,n,a){var i=a.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(a=t.child=e.child,i=0;a!==null;)i=i|a.lanes|a.childLanes,a=a.sibling;a=i&~r}else a=0,t.child=null;return Nf(e,t,r,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ps(t,r!==null?r.cachePool:null),r!==null?zd(t,r):sr(),Sd(t);else return a=t.lanes=536870912,Nf(e,t,r!==null?r.baseLanes|n:n,n,a)}else r!==null?(Ps(t,r.cachePool),zd(t,r),On(),t.memoizedState=null):(e!==null&&Ps(t,null),sr(),On());return et(e,t,i,n),t.child}function Wa(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Nf(e,t,n,a,i){var r=Pc();return r=r===null?null:{parent:Ge._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Ps(t,null),sr(),Sd(t),e!==null&&$l(e,t,a,!0),t.childLanes=i,null}function xi(e,t){return t=bi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zf(e,t,n){return xl(t,e.child,null,n),e=xi(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function Hp(e,t,n){var a=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ue){if(a.mode==="hidden")return e=xi(t,a),t.lanes=536870912,Wa(null,e);if(cr(t),(e=Ee)?(e=_0(e,Mt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:En!==null?{id:Zt,overflow:$t}:null,retryLane:536870912,hydrationErrors:null},n=sd(e),n.return=t,t.child=n,Ie=t,Ee=null)):e=null,e===null)throw Cn(t);return t.lanes=536870912,null}return xi(t,a)}var r=e.memoizedState;if(r!==null){var f=r.dehydrated;if(cr(t),i)if(t.flags&256)t.flags&=-257,t=zf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(Ye||$l(e,t,n,!1),i=(n&e.childLanes)!==0,Ye||i){if(a=ze,a!==null&&(f=fu(a,n),f!==0&&f!==r.retryLane))throw r.retryLane=f,cl(e,f),mt(a,e,f),Cr;Ei(),t=zf(e,t,n)}else e=r.treeContext,Ee=_t(f.nextSibling),Ie=t,ue=!0,Tn=null,Mt=!1,e!==null&&rd(t,e),t=xi(t,a),t.flags|=4096;return t}return e=ln(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function pi(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Rr(e,t,n,a,i){return dl(t),n=or(e,t,n,a,void 0,i),a=ur(),e!==null&&!Ye?(dr(e,t,i),un(e,t,i)):(ue&&a&&Kc(t),t.flags|=1,et(e,t,n,i),t.child)}function Sf(e,t,n,a,i,r){return dl(t),t.updateQueue=null,n=Ed(t,a,n,i),wd(e),a=ur(),e!==null&&!Ye?(dr(e,t,r),un(e,t,r)):(ue&&a&&Kc(t),t.flags|=1,et(e,t,n,r),t.child)}function wf(e,t,n,a,i){if(dl(t),t.stateNode===null){var r=Kl,f=n.contextType;typeof f=="object"&&f!==null&&(r=Pe(f)),r=new n(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Er,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},tr(t),f=n.contextType,r.context=typeof f=="object"&&f!==null?Pe(f):Kl,r.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(wr(t,n,f,a),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(f=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),f!==r.state&&Er.enqueueReplaceState(r,r.state,null),Va(t,a,r,i),Xa(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var p=t.memoizedProps,g=bl(n,p);r.props=g;var E=r.context,_=n.contextType;f=Kl,typeof _=="object"&&_!==null&&(f=Pe(_));var H=n.getDerivedStateFromProps;_=typeof H=="function"||typeof r.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,_||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(p||E!==f)&&df(t,r,a,f),kn=!1;var C=t.memoizedState;r.state=C,Va(t,a,r,i),Xa(),E=t.memoizedState,p||C!==E||kn?(typeof H=="function"&&(wr(t,n,H,a),E=t.memoizedState),(g=kn||uf(t,n,g,a,C,E,f))?(_||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=E),r.props=a,r.state=E,r.context=f,a=g):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,nr(e,t),f=t.memoizedProps,_=bl(n,f),r.props=_,H=t.pendingProps,C=r.context,E=n.contextType,g=Kl,typeof E=="object"&&E!==null&&(g=Pe(E)),p=n.getDerivedStateFromProps,(E=typeof p=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f!==H||C!==g)&&df(t,r,a,g),kn=!1,C=t.memoizedState,r.state=C,Va(t,a,r,i),Xa();var D=t.memoizedState;f!==H||C!==D||kn||e!==null&&e.dependencies!==null&&Ws(e.dependencies)?(typeof p=="function"&&(wr(t,n,p,a),D=t.memoizedState),(_=kn||uf(t,n,_,a,C,D,g)||e!==null&&e.dependencies!==null&&Ws(e.dependencies))?(E||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,D,g),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,D,g)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&C===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&C===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=D),r.props=a,r.state=D,r.context=g,a=_):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&C===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&C===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,pi(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=xl(t,e.child,null,i),t.child=xl(t,null,n,i)):et(e,t,n,i),t.memoizedState=r.state,e=t.child):e=un(e,t,i),e}function Ef(e,t,n,a){return ol(),t.flags|=256,et(e,t,n,a),t.child}var kr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dr(e){return{baseLanes:e,cachePool:hd()}}function Ar(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=St),e}function Tf(e,t,n){var a=t.pendingProps,i=!1,r=(t.flags&128)!==0,f;if((f=r)||(f=e!==null&&e.memoizedState===null?!1:(Ue.current&2)!==0),f&&(i=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(ue){if(i?Mn(t):On(),(e=Ee)?(e=_0(e,Mt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:En!==null?{id:Zt,overflow:$t}:null,retryLane:536870912,hydrationErrors:null},n=sd(e),n.return=t,t.child=n,Ie=t,Ee=null)):e=null,e===null)throw Cn(t);return xo(e)?t.lanes=32:t.lanes=536870912,null}var p=a.children;return a=a.fallback,i?(On(),i=t.mode,p=bi({mode:"hidden",children:p},i),a=rl(a,i,n,null),p.return=t,a.return=t,p.sibling=a,t.child=p,a=t.child,a.memoizedState=Dr(n),a.childLanes=Ar(e,f,n),t.memoizedState=kr,Wa(null,a)):(Mn(t),Mr(t,p))}var g=e.memoizedState;if(g!==null&&(p=g.dehydrated,p!==null)){if(r)t.flags&256?(Mn(t),t.flags&=-257,t=Or(e,t,n)):t.memoizedState!==null?(On(),t.child=e.child,t.flags|=128,t=null):(On(),p=a.fallback,i=t.mode,a=bi({mode:"visible",children:a.children},i),p=rl(p,i,n,null),p.flags|=2,a.return=t,p.return=t,a.sibling=p,t.child=a,xl(t,e.child,null,n),a=t.child,a.memoizedState=Dr(n),a.childLanes=Ar(e,f,n),t.memoizedState=kr,t=Wa(null,a));else if(Mn(t),xo(p)){if(f=p.nextSibling&&p.nextSibling.dataset,f)var E=f.dgst;f=E,a=Error(u(419)),a.stack="",a.digest=f,Ha({value:a,source:null,stack:null}),t=Or(e,t,n)}else if(Ye||$l(e,t,n,!1),f=(n&e.childLanes)!==0,Ye||f){if(f=ze,f!==null&&(a=fu(f,n),a!==0&&a!==g.retryLane))throw g.retryLane=a,cl(e,a),mt(f,e,a),Cr;ho(p)||Ei(),t=Or(e,t,n)}else ho(p)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,Ee=_t(p.nextSibling),Ie=t,ue=!0,Tn=null,Mt=!1,e!==null&&rd(t,e),t=Mr(t,a.children),t.flags|=4096);return t}return i?(On(),p=a.fallback,i=t.mode,g=e.child,E=g.sibling,a=ln(g,{mode:"hidden",children:a.children}),a.subtreeFlags=g.subtreeFlags&65011712,E!==null?p=ln(E,p):(p=rl(p,i,n,null),p.flags|=2),p.return=t,a.return=t,a.sibling=p,t.child=a,Wa(null,a),a=t.child,p=e.child.memoizedState,p===null?p=Dr(n):(i=p.cachePool,i!==null?(g=Ge._currentValue,i=i.parent!==g?{parent:g,pool:g}:i):i=hd(),p={baseLanes:p.baseLanes|n,cachePool:i}),a.memoizedState=p,a.childLanes=Ar(e,f,n),t.memoizedState=kr,Wa(e.child,a)):(Mn(t),n=e.child,e=n.sibling,n=ln(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function Mr(e,t){return t=bi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function bi(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function Or(e,t,n){return xl(t,e.child,null,n),e=Mr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cf(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Jc(e.return,t,n)}function _r(e,t,n,a,i,r){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:i,treeForkCount:r}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=a,f.tail=n,f.tailMode=i,f.treeForkCount=r)}function Rf(e,t,n){var a=t.pendingProps,i=a.revealOrder,r=a.tail;a=a.children;var f=Ue.current,p=(f&2)!==0;if(p?(f=f&1|2,t.flags|=128):f&=1,xe(Ue,f),et(e,t,a,n),a=ue?qa:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cf(e,n,t);else if(e.tag===19)Cf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&si(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),_r(t,!1,i,n,r,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&si(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}_r(t,!0,n,null,r,a);break;case"together":_r(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function un(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ln|=t.lanes,(n&t.childLanes)===0)if(e!==null){if($l(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=ln(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ln(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ur(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ws(e)))}function Bp(e,t,n){switch(t.tag){case 3:Cs(t,t.stateNode.containerInfo),Rn(t,Ge,e.memoizedState.cache),ol();break;case 27:case 5:ic(t);break;case 4:Cs(t,t.stateNode.containerInfo);break;case 10:Rn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,cr(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Mn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Tf(e,t,n):(Mn(t),e=un(e,t,n),e!==null?e.sibling:null);Mn(t);break;case 19:var i=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||($l(e,t,n,!1),a=(n&t.childLanes)!==0),i){if(a)return Rf(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),xe(Ue,Ue.current),a)break;return null;case 22:return t.lanes=0,jf(e,t,n,t.pendingProps);case 24:Rn(t,Ge,e.memoizedState.cache)}return un(e,t,n)}function kf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ye=!0;else{if(!Ur(e,n)&&(t.flags&128)===0)return Ye=!1,Bp(e,t,n);Ye=(e.flags&131072)!==0}else Ye=!1,ue&&(t.flags&1048576)!==0&&cd(t,qa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ml(t.elementType),t.type=e,typeof e=="function")Gc(e)?(a=bl(e,a),t.tag=1,t=wf(null,t,e,a,n)):(t.tag=0,t=Rr(null,t,e,a,n));else{if(e!=null){var i=e.$$typeof;if(i===B){t.tag=11,t=gf(null,t,e,a,n);break e}else if(i===F){t.tag=14,t=yf(null,t,e,a,n);break e}}throw t=Be(e)||e,Error(u(306,t,""))}}return t;case 0:return Rr(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,i=bl(a,t.pendingProps),wf(e,t,a,i,n);case 3:e:{if(Cs(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var r=t.memoizedState;i=r.element,nr(e,t),Va(t,a,null,n);var f=t.memoizedState;if(a=f.cache,Rn(t,Ge,a),a!==r.cache&&Fc(t,[Ge],n,!0),Xa(),a=f.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Ef(e,t,a,n);break e}else if(a!==i){i=kt(Error(u(424)),t),Ha(i),t=Ef(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ee=_t(e.firstChild),Ie=t,ue=!0,Tn=null,Mt=!0,n=vd(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ol(),a===i){t=un(e,t,n);break e}et(e,t,a,n)}t=t.child}return t;case 26:return pi(e,t),e===null?(n=G0(t.type,null,t.pendingProps,null))?t.memoizedState=n:ue||(n=t.type,e=t.pendingProps,a=Mi(Nn.current).createElement(n),a[We]=t,a[ct]=e,tt(a,n,e),Je(a),t.stateNode=a):t.memoizedState=G0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ic(t),e===null&&ue&&(a=t.stateNode=q0(t.type,t.pendingProps,Nn.current),Ie=t,Mt=!0,i=Ee,Qn(t.type)?(po=i,Ee=_t(a.firstChild)):Ee=i),et(e,t,t.pendingProps.children,n),pi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ue&&((i=a=Ee)&&(a=pb(a,t.type,t.pendingProps,Mt),a!==null?(t.stateNode=a,Ie=t,Ee=_t(a.firstChild),Mt=!1,i=!0):i=!1),i||Cn(t)),ic(t),i=t.type,r=t.pendingProps,f=e!==null?e.memoizedProps:null,a=r.children,uo(i,r)?a=null:f!==null&&uo(i,f)&&(t.flags|=32),t.memoizedState!==null&&(i=or(e,t,Dp,null,null,n),fs._currentValue=i),pi(e,t),et(e,t,a,n),t.child;case 6:return e===null&&ue&&((e=n=Ee)&&(n=bb(n,t.pendingProps,Mt),n!==null?(t.stateNode=n,Ie=t,Ee=null,e=!0):e=!1),e||Cn(t)),null;case 13:return Tf(e,t,n);case 4:return Cs(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=xl(t,null,a,n):et(e,t,a,n),t.child;case 11:return gf(e,t,t.type,t.pendingProps,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Rn(t,t.type,a.value),et(e,t,a.children,n),t.child;case 9:return i=t.type._context,a=t.pendingProps.children,dl(t),i=Pe(i),a=a(i),t.flags|=1,et(e,t,a,n),t.child;case 14:return yf(e,t,t.type,t.pendingProps,n);case 15:return vf(e,t,t.type,t.pendingProps,n);case 19:return Rf(e,t,n);case 31:return Hp(e,t,n);case 22:return jf(e,t,n,t.pendingProps);case 24:return dl(t),a=Pe(Ge),e===null?(i=Pc(),i===null&&(i=ze,r=Wc(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=n),i=r),t.memoizedState={parent:a,cache:i},tr(t),Rn(t,Ge,i)):((e.lanes&n)!==0&&(nr(e,t),Va(t,null,null,n),Xa()),i=e.memoizedState,r=t.memoizedState,i.parent!==a?(i={parent:a,cache:a},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Rn(t,Ge,a)):(a=r.cache,Rn(t,Ge,a),a!==i.cache&&Fc(t,[Ge],n,!0))),et(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function dn(e){e.flags|=4}function Lr(e,t,n,a,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(l0())e.flags|=8192;else throw hl=ti,er}else e.flags&=-16777217}function Df(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!V0(t))if(l0())e.flags|=8192;else throw hl=ti,er}function gi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ou():536870912,e.lanes|=t,ia|=t)}function Ia(e,t){if(!ue)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Te(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags&65011712,a|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags,a|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function Gp(e,t,n){var a=t.pendingProps;switch(Xc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Te(t),null;case 1:return Te(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),cn(Ge),kl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Zl(t)?dn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zc())),Te(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(dn(t),r!==null?(Te(t),Df(t,r)):(Te(t),Lr(t,i,null,a,n))):r?r!==e.memoizedState?(dn(t),Te(t),Df(t,r)):(Te(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&dn(t),Te(t),Lr(t,i,e,a,n)),null;case 27:if(Rs(t),n=Nn.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dn(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Te(t),null}e=$e.current,Zl(t)?od(t):(e=q0(i,a,n),t.stateNode=e,dn(t))}return Te(t),null;case 5:if(Rs(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dn(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Te(t),null}if(r=$e.current,Zl(t))od(t);else{var f=Mi(Nn.current);switch(r){case 1:r=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=f.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?f.createElement("select",{is:a.is}):f.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?f.createElement(i,{is:a.is}):f.createElement(i)}}r[We]=t,r[ct]=a;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)r.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=r;e:switch(tt(r,i,a),i){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&dn(t)}}return Te(t),Lr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&dn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=Nn.current,Zl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,i=Ie,i!==null)switch(i.tag){case 27:case 5:a=i.memoizedProps}e[We]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||T0(e.nodeValue,n)),e||Cn(t,!0)}else e=Mi(e).createTextNode(a),e[We]=t,t.stateNode=e}return Te(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Zl(t),n!==null){if(e===null){if(!a)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[We]=t}else ol(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Te(t),e=!1}else n=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Nt(t),t):(Nt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Te(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Zl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!i)throw Error(u(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(u(317));i[We]=t}else ol(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Te(t),i=!1}else i=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Nt(t),t):(Nt(t),null)}return Nt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,i=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(i=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==i&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gi(t,t.updateQueue),Te(t),null);case 4:return kl(),e===null&&so(t.stateNode.containerInfo),Te(t),null;case 10:return cn(t.type),Te(t),null;case 19:if(ke(Ue),a=t.memoizedState,a===null)return Te(t),null;if(i=(t.flags&128)!==0,r=a.rendering,r===null)if(i)Ia(a,!1);else{if(Me!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=si(e),r!==null){for(t.flags|=128,Ia(a,!1),e=r.updateQueue,t.updateQueue=e,gi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ad(n,e),n=n.sibling;return xe(Ue,Ue.current&1|2),ue&&an(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&pt()>zi&&(t.flags|=128,i=!0,Ia(a,!1),t.lanes=4194304)}else{if(!i)if(e=si(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,gi(t,e),Ia(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!ue)return Te(t),null}else 2*pt()-a.renderingStartTime>zi&&n!==536870912&&(t.flags|=128,i=!0,Ia(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=pt(),e.sibling=null,n=Ue.current,xe(Ue,i?n&1|2:n&1),ue&&an(t,a.treeForkCount),e):(Te(t),null);case 22:case 23:return Nt(t),ir(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Te(t),t.subtreeFlags&6&&(t.flags|=8192)):Te(t),n=t.updateQueue,n!==null&&gi(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&ke(fl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),cn(Ge),Te(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Qp(e,t){switch(Xc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cn(Ge),kl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Rs(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(u(340));ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Ue),null;case 4:return kl(),null;case 10:return cn(t.type),null;case 22:case 23:return Nt(t),ir(),e!==null&&ke(fl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return cn(Ge),null;case 25:return null;default:return null}}function Af(e,t){switch(Xc(t),t.tag){case 3:cn(Ge),kl();break;case 26:case 27:case 5:Rs(t);break;case 4:kl();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:ke(Ue);break;case 10:cn(t.type);break;case 22:case 23:Nt(t),ir(),e!==null&&ke(fl);break;case 24:cn(Ge)}}function Pa(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&e)===e){a=void 0;var r=n.create,f=n.inst;a=r(),f.destroy=a}n=n.next}while(n!==i)}}catch(p){be(t,t.return,p)}}function _n(e,t,n){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var r=i.next;a=r;do{if((a.tag&e)===e){var f=a.inst,p=f.destroy;if(p!==void 0){f.destroy=void 0,i=t;var g=n,E=p;try{E()}catch(_){be(i,g,_)}}}a=a.next}while(a!==r)}}catch(_){be(t,t.return,_)}}function Mf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Nd(t,n)}catch(a){be(e,e.return,a)}}}function Of(e,t,n){n.props=bl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){be(e,t,a)}}function es(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(i){be(e,t,i)}}function Jt(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(i){be(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){be(e,t,i)}else n.current=null}function _f(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(i){be(e,e.return,i)}}function qr(e,t,n){try{var a=e.stateNode;ub(a,e.type,n,t),a[ct]=t}catch(i){be(e,e.return,i)}}function Uf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qn(e.type)||e.tag===4}function Hr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Br(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tn));else if(a!==4&&(a===27&&Qn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Br(e,t,n),e=e.sibling;e!==null;)Br(e,t,n),e=e.sibling}function yi(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Qn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(yi(e,t,n),e=e.sibling;e!==null;)yi(e,t,n),e=e.sibling}function Lf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);tt(t,a,n),t[We]=e,t[ct]=n}catch(r){be(e,e.return,r)}}var fn=!1,Ke=!1,Gr=!1,qf=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Yp(e,t){if(e=e.containerInfo,ro=Bi,e=Ju(e),Oc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var i=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var f=0,p=-1,g=-1,E=0,_=0,H=e,C=null;t:for(;;){for(var D;H!==n||i!==0&&H.nodeType!==3||(p=f+i),H!==r||a!==0&&H.nodeType!==3||(g=f+a),H.nodeType===3&&(f+=H.nodeValue.length),(D=H.firstChild)!==null;)C=H,H=D;for(;;){if(H===e)break t;if(C===n&&++E===i&&(p=f),C===r&&++_===a&&(g=f),(D=H.nextSibling)!==null)break;H=C,C=H.parentNode}H=D}n=p===-1||g===-1?null:{start:p,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(oo={focusedElem:e,selectionRange:n},Bi=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){switch(t=Fe,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,i=r.memoizedProps,r=r.memoizedState,a=n.stateNode;try{var $=bl(n.type,i);e=a.getSnapshotBeforeUpdate($,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(I){be(n,n.return,I)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)mo(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mo(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,Fe=e;break}Fe=t.return}}function Hf(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:hn(e,n),a&4&&Pa(5,n);break;case 1:if(hn(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){be(n,n.return,f)}else{var i=bl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){be(n,n.return,f)}}a&64&&Mf(n),a&512&&es(n,n.return);break;case 3:if(hn(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Nd(e,t)}catch(f){be(n,n.return,f)}}break;case 27:t===null&&a&4&&Lf(n);case 26:case 5:hn(e,n),t===null&&a&4&&_f(n),a&512&&es(n,n.return);break;case 12:hn(e,n);break;case 31:hn(e,n),a&4&&Qf(e,n);break;case 13:hn(e,n),a&4&&Yf(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ip.bind(null,n),gb(e,n))));break;case 22:if(a=n.memoizedState!==null||fn,!a){t=t!==null&&t.memoizedState!==null||Ke,i=fn;var r=Ke;fn=a,(Ke=t)&&!r?xn(e,n,(n.subtreeFlags&8772)!==0):hn(e,n),fn=i,Ke=r}break;case 30:break;default:hn(e,n)}}function Bf(e){var t=e.alternate;t!==null&&(e.alternate=null,Bf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Re=null,ot=!1;function mn(e,t,n){for(n=n.child;n!==null;)Gf(e,t,n),n=n.sibling}function Gf(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Sa,n)}catch{}switch(n.tag){case 26:Ke||Jt(n,t),mn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||Jt(n,t);var a=Re,i=ot;Qn(n.type)&&(Re=n.stateNode,ot=!1),mn(e,t,n),os(n.stateNode),Re=a,ot=i;break;case 5:Ke||Jt(n,t);case 6:if(a=Re,i=ot,Re=null,mn(e,t,n),Re=a,ot=i,Re!==null)if(ot)try{(Re.nodeType===9?Re.body:Re.nodeName==="HTML"?Re.ownerDocument.body:Re).removeChild(n.stateNode)}catch(r){be(n,t,r)}else try{Re.removeChild(n.stateNode)}catch(r){be(n,t,r)}break;case 18:Re!==null&&(ot?(e=Re,M0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ha(e)):M0(Re,n.stateNode));break;case 4:a=Re,i=ot,Re=n.stateNode.containerInfo,ot=!0,mn(e,t,n),Re=a,ot=i;break;case 0:case 11:case 14:case 15:_n(2,n,t),Ke||_n(4,n,t),mn(e,t,n);break;case 1:Ke||(Jt(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Of(n,t,a)),mn(e,t,n);break;case 21:mn(e,t,n);break;case 22:Ke=(a=Ke)||n.memoizedState!==null,mn(e,t,n),Ke=a;break;default:mn(e,t,n)}}function Qf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ha(e)}catch(n){be(t,t.return,n)}}}function Yf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ha(e)}catch(n){be(t,t.return,n)}}function Kp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new qf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new qf),t;default:throw Error(u(435,e.tag))}}function vi(e,t){var n=Kp(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var i=Pp.bind(null,e,a);a.then(i,i)}})}function ut(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var i=n[a],r=e,f=t,p=f;e:for(;p!==null;){switch(p.tag){case 27:if(Qn(p.type)){Re=p.stateNode,ot=!1;break e}break;case 5:Re=p.stateNode,ot=!1;break e;case 3:case 4:Re=p.stateNode.containerInfo,ot=!0;break e}p=p.return}if(Re===null)throw Error(u(160));Gf(r,f,i),Re=null,ot=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Kf(t,e),t=t.sibling}var Bt=null;function Kf(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ut(t,e),dt(e),a&4&&(_n(3,e,e.return),Pa(3,e),_n(5,e,e.return));break;case 1:ut(t,e),dt(e),a&512&&(Ke||n===null||Jt(n,n.return)),a&64&&fn&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var i=Bt;if(ut(t,e),dt(e),a&512&&(Ke||n===null||Jt(n,n.return)),a&4){var r=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(a){case"title":r=i.getElementsByTagName("title")[0],(!r||r[Ta]||r[We]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=i.createElement(a),i.head.insertBefore(r,i.querySelector("head > title"))),tt(r,a,n),r[We]=e,Je(r),a=r;break e;case"link":var f=K0("link","href",i).get(a+(n.href||""));if(f){for(var p=0;p<f.length;p++)if(r=f[p],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(p,1);break t}}r=i.createElement(a),tt(r,a,n),i.head.appendChild(r);break;case"meta":if(f=K0("meta","content",i).get(a+(n.content||""))){for(p=0;p<f.length;p++)if(r=f[p],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(p,1);break t}}r=i.createElement(a),tt(r,a,n),i.head.appendChild(r);break;default:throw Error(u(468,a))}r[We]=e,Je(r),a=r}e.stateNode=a}else X0(i,e.type,e.stateNode);else e.stateNode=Y0(i,a,e.memoizedProps);else r!==a?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,a===null?X0(i,e.type,e.stateNode):Y0(i,a,e.memoizedProps)):a===null&&e.stateNode!==null&&qr(e,e.memoizedProps,n.memoizedProps)}break;case 27:ut(t,e),dt(e),a&512&&(Ke||n===null||Jt(n,n.return)),n!==null&&a&4&&qr(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ut(t,e),dt(e),a&512&&(Ke||n===null||Jt(n,n.return)),e.flags&32){i=e.stateNode;try{Ll(i,"")}catch($){be(e,e.return,$)}}a&4&&e.stateNode!=null&&(i=e.memoizedProps,qr(e,i,n!==null?n.memoizedProps:i)),a&1024&&(Gr=!0);break;case 6:if(ut(t,e),dt(e),a&4){if(e.stateNode===null)throw Error(u(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch($){be(e,e.return,$)}}break;case 3:if(Ui=null,i=Bt,Bt=Oi(t.containerInfo),ut(t,e),Bt=i,dt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{ha(t.containerInfo)}catch($){be(e,e.return,$)}Gr&&(Gr=!1,Xf(e));break;case 4:a=Bt,Bt=Oi(e.stateNode.containerInfo),ut(t,e),dt(e),Bt=a;break;case 12:ut(t,e),dt(e);break;case 31:ut(t,e),dt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,vi(e,a)));break;case 13:ut(t,e),dt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ni=pt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,vi(e,a)));break;case 22:i=e.memoizedState!==null;var g=n!==null&&n.memoizedState!==null,E=fn,_=Ke;if(fn=E||i,Ke=_||g,ut(t,e),Ke=_,fn=E,dt(e),a&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||g||fn||Ke||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){g=n=t;try{if(r=g.stateNode,i)f=r.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{p=g.stateNode;var H=g.memoizedProps.style,C=H!=null&&H.hasOwnProperty("display")?H.display:null;p.style.display=C==null||typeof C=="boolean"?"":(""+C).trim()}}catch($){be(g,g.return,$)}}}else if(t.tag===6){if(n===null){g=t;try{g.stateNode.nodeValue=i?"":g.memoizedProps}catch($){be(g,g.return,$)}}}else if(t.tag===18){if(n===null){g=t;try{var D=g.stateNode;i?O0(D,!0):O0(g.stateNode,!1)}catch($){be(g,g.return,$)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,vi(e,n))));break;case 19:ut(t,e),dt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,vi(e,a)));break;case 30:break;case 21:break;default:ut(t,e),dt(e)}}function dt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Uf(a)){n=a;break}a=a.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var i=n.stateNode,r=Hr(e);yi(e,r,i);break;case 5:var f=n.stateNode;n.flags&32&&(Ll(f,""),n.flags&=-33);var p=Hr(e);yi(e,p,f);break;case 3:case 4:var g=n.stateNode.containerInfo,E=Hr(e);Br(e,E,g);break;default:throw Error(u(161))}}catch(_){be(e,e.return,_)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Xf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Xf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Hf(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_n(4,t,t.return),gl(t);break;case 1:Jt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Of(t,t.return,n),gl(t);break;case 27:os(t.stateNode);case 26:case 5:Jt(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function xn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,i=e,r=t,f=r.flags;switch(r.tag){case 0:case 11:case 15:xn(i,r,n),Pa(4,r);break;case 1:if(xn(i,r,n),a=r,i=a.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(E){be(a,a.return,E)}if(a=r,i=a.updateQueue,i!==null){var p=a.stateNode;try{var g=i.shared.hiddenCallbacks;if(g!==null)for(i.shared.hiddenCallbacks=null,i=0;i<g.length;i++)jd(g[i],p)}catch(E){be(a,a.return,E)}}n&&f&64&&Mf(r),es(r,r.return);break;case 27:Lf(r);case 26:case 5:xn(i,r,n),n&&a===null&&f&4&&_f(r),es(r,r.return);break;case 12:xn(i,r,n);break;case 31:xn(i,r,n),n&&f&4&&Qf(i,r);break;case 13:xn(i,r,n),n&&f&4&&Yf(i,r);break;case 22:r.memoizedState===null&&xn(i,r,n),es(r,r.return);break;case 30:break;default:xn(i,r,n)}t=t.sibling}}function Qr(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ba(n))}function Yr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ba(e))}function Gt(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Vf(e,t,n,a),t=t.sibling}function Vf(e,t,n,a){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Gt(e,t,n,a),i&2048&&Pa(9,t);break;case 1:Gt(e,t,n,a);break;case 3:Gt(e,t,n,a),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ba(e)));break;case 12:if(i&2048){Gt(e,t,n,a),e=t.stateNode;try{var r=t.memoizedProps,f=r.id,p=r.onPostCommit;typeof p=="function"&&p(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(g){be(t,t.return,g)}}else Gt(e,t,n,a);break;case 31:Gt(e,t,n,a);break;case 13:Gt(e,t,n,a);break;case 23:break;case 22:r=t.stateNode,f=t.alternate,t.memoizedState!==null?r._visibility&2?Gt(e,t,n,a):ts(e,t):r._visibility&2?Gt(e,t,n,a):(r._visibility|=2,la(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Qr(f,t);break;case 24:Gt(e,t,n,a),i&2048&&Yr(t.alternate,t);break;default:Gt(e,t,n,a)}}function la(e,t,n,a,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,f=t,p=n,g=a,E=f.flags;switch(f.tag){case 0:case 11:case 15:la(r,f,p,g,i),Pa(8,f);break;case 23:break;case 22:var _=f.stateNode;f.memoizedState!==null?_._visibility&2?la(r,f,p,g,i):ts(r,f):(_._visibility|=2,la(r,f,p,g,i)),i&&E&2048&&Qr(f.alternate,f);break;case 24:la(r,f,p,g,i),i&&E&2048&&Yr(f.alternate,f);break;default:la(r,f,p,g,i)}t=t.sibling}}function ts(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,i=a.flags;switch(a.tag){case 22:ts(n,a),i&2048&&Qr(a.alternate,a);break;case 24:ts(n,a),i&2048&&Yr(a.alternate,a);break;default:ts(n,a)}t=t.sibling}}var ns=8192;function aa(e,t,n){if(e.subtreeFlags&ns)for(e=e.child;e!==null;)Zf(e,t,n),e=e.sibling}function Zf(e,t,n){switch(e.tag){case 26:aa(e,t,n),e.flags&ns&&e.memoizedState!==null&&kb(n,Bt,e.memoizedState,e.memoizedProps);break;case 5:aa(e,t,n);break;case 3:case 4:var a=Bt;Bt=Oi(e.stateNode.containerInfo),aa(e,t,n),Bt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ns,ns=16777216,aa(e,t,n),ns=a):aa(e,t,n));break;default:aa(e,t,n)}}function $f(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ls(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Fe=a,Ff(a,e)}$f(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Jf(e),e=e.sibling}function Jf(e){switch(e.tag){case 0:case 11:case 15:ls(e),e.flags&2048&&_n(9,e,e.return);break;case 3:ls(e);break;case 12:ls(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ji(e)):ls(e);break;default:ls(e)}}function ji(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Fe=a,Ff(a,e)}$f(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_n(8,t,t.return),ji(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ji(t));break;default:ji(t)}e=e.sibling}}function Ff(e,t){for(;Fe!==null;){var n=Fe;switch(n.tag){case 0:case 11:case 15:_n(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ba(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Fe=a;else e:for(n=e;Fe!==null;){a=Fe;var i=a.sibling,r=a.return;if(Bf(a),a===n){Fe=null;break e}if(i!==null){i.return=r,Fe=i;break e}Fe=r}}}var Xp={getCacheForType:function(e){var t=Pe(Ge),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pe(Ge).controller.signal}},Vp=typeof WeakMap=="function"?WeakMap:Map,he=0,ze=null,ie=null,re=0,pe=0,zt=null,Un=!1,sa=!1,Kr=!1,pn=0,Me=0,Ln=0,yl=0,Xr=0,St=0,ia=0,as=null,ft=null,Vr=!1,Ni=0,Wf=0,zi=1/0,Si=null,qn=null,Ve=0,Hn=null,ca=null,bn=0,Zr=0,$r=null,If=null,ss=0,Jr=null;function wt(){return(he&2)!==0&&re!==0?re&-re:U.T!==null?to():mu()}function Pf(){if(St===0)if((re&536870912)===0||ue){var e=As;As<<=1,(As&3932160)===0&&(As=262144),St=e}else St=536870912;return e=jt.current,e!==null&&(e.flags|=32),St}function mt(e,t,n){(e===ze&&(pe===2||pe===9)||e.cancelPendingCommit!==null)&&(ra(e,0),Bn(e,re,St,!1)),Ea(e,n),((he&2)===0||e!==ze)&&(e===ze&&((he&2)===0&&(yl|=n),Me===4&&Bn(e,re,St,!1)),Ft(e))}function e0(e,t,n){if((he&6)!==0)throw Error(u(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||wa(e,t),i=a?Jp(e,t):Wr(e,t,!0),r=a;do{if(i===0){sa&&!a&&Bn(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!Zp(n)){i=Wr(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var p=e;i=as;var g=p.current.memoizedState.isDehydrated;if(g&&(ra(p,f).flags|=256),f=Wr(p,f,!1),f!==2){if(Kr&&!g){p.errorRecoveryDisabledLanes|=r,yl|=r,i=4;break e}r=ft,ft=i,r!==null&&(ft===null?ft=r:ft.push.apply(ft,r))}i=f}if(r=!1,i!==2)continue}}if(i===1){ra(e,0),Bn(e,t,0,!0);break}e:{switch(a=e,r=i,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Bn(a,t,St,!Un);break e;case 2:ft=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(i=Ni+300-pt(),10<i)){if(Bn(a,t,St,!Un),Os(a,0,!0)!==0)break e;bn=t,a.timeoutHandle=D0(t0.bind(null,a,n,ft,Si,Vr,t,St,yl,ia,Un,r,"Throttled",-0,0),i);break e}t0(a,n,ft,Si,Vr,t,St,yl,ia,Un,r,null,-0,0)}}break}while(!0);Ft(e)}function t0(e,t,n,a,i,r,f,p,g,E,_,H,C,D){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},Zf(t,r,H);var $=(r&62914560)===r?Ni-pt():(r&4194048)===r?Wf-pt():0;if($=Db(H,$),$!==null){bn=r,e.cancelPendingCommit=$(o0.bind(null,e,t,r,n,a,i,f,p,g,_,H,null,C,D)),Bn(e,r,f,!E);return}}o0(e,t,r,n,a,i,f,p,g)}function Zp(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var i=n[a],r=i.getSnapshot;i=i.value;try{if(!yt(r(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Bn(e,t,n,a){t&=~Xr,t&=~yl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var i=t;0<i;){var r=31-gt(i),f=1<<r;a[r]=-1,i&=~f}n!==0&&uu(e,n,t)}function wi(){return(he&6)===0?(is(0),!1):!0}function Fr(){if(ie!==null){if(pe===0)var e=ie.return;else e=ie,sn=ul=null,fr(e),Il=null,Qa=0,e=ie;for(;e!==null;)Af(e.alternate,e),e=e.return;ie=null}}function ra(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,mb(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bn=0,Fr(),ze=e,ie=n=ln(e.current,null),re=t,pe=0,zt=null,Un=!1,sa=wa(e,t),Kr=!1,ia=St=Xr=yl=Ln=Me=0,ft=as=null,Vr=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var i=31-gt(a),r=1<<i;t|=e[i],a&=~r}return pn=t,Vs(),n}function n0(e,t){te=null,U.H=Fa,t===Wl||t===ei?(t=bd(),pe=3):t===er?(t=bd(),pe=4):pe=t===Cr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,zt=t,ie===null&&(Me=1,hi(e,kt(t,e.current)))}function l0(){var e=jt.current;return e===null?!0:(re&4194048)===re?Ot===null:(re&62914560)===re||(re&536870912)!==0?e===Ot:!1}function a0(){var e=U.H;return U.H=Fa,e===null?Fa:e}function s0(){var e=U.A;return U.A=Xp,e}function Ei(){Me=4,Un||(re&4194048)!==re&&jt.current!==null||(sa=!0),(Ln&134217727)===0&&(yl&134217727)===0||ze===null||Bn(ze,re,St,!1)}function Wr(e,t,n){var a=he;he|=2;var i=a0(),r=s0();(ze!==e||re!==t)&&(Si=null,ra(e,t)),t=!1;var f=Me;e:do try{if(pe!==0&&ie!==null){var p=ie,g=zt;switch(pe){case 8:Fr(),f=6;break e;case 3:case 2:case 9:case 6:jt.current===null&&(t=!0);var E=pe;if(pe=0,zt=null,oa(e,p,g,E),n&&sa){f=0;break e}break;default:E=pe,pe=0,zt=null,oa(e,p,g,E)}}$p(),f=Me;break}catch(_){n0(e,_)}while(!0);return t&&e.shellSuspendCounter++,sn=ul=null,he=a,U.H=i,U.A=r,ie===null&&(ze=null,re=0,Vs()),f}function $p(){for(;ie!==null;)i0(ie)}function Jp(e,t){var n=he;he|=2;var a=a0(),i=s0();ze!==e||re!==t?(Si=null,zi=pt()+500,ra(e,t)):sa=wa(e,t);e:do try{if(pe!==0&&ie!==null){t=ie;var r=zt;t:switch(pe){case 1:pe=0,zt=null,oa(e,t,r,1);break;case 2:case 9:if(xd(r)){pe=0,zt=null,c0(t);break}t=function(){pe!==2&&pe!==9||ze!==e||(pe=7),Ft(e)},r.then(t,t);break e;case 3:pe=7;break e;case 4:pe=5;break e;case 7:xd(r)?(pe=0,zt=null,c0(t)):(pe=0,zt=null,oa(e,t,r,7));break;case 5:var f=null;switch(ie.tag){case 26:f=ie.memoizedState;case 5:case 27:var p=ie;if(f?V0(f):p.stateNode.complete){pe=0,zt=null;var g=p.sibling;if(g!==null)ie=g;else{var E=p.return;E!==null?(ie=E,Ti(E)):ie=null}break t}}pe=0,zt=null,oa(e,t,r,5);break;case 6:pe=0,zt=null,oa(e,t,r,6);break;case 8:Fr(),Me=6;break e;default:throw Error(u(462))}}Fp();break}catch(_){n0(e,_)}while(!0);return sn=ul=null,U.H=a,U.A=i,he=n,ie!==null?0:(ze=null,re=0,Vs(),Me)}function Fp(){for(;ie!==null&&!yx();)i0(ie)}function i0(e){var t=kf(e.alternate,e,pn);e.memoizedProps=e.pendingProps,t===null?Ti(e):ie=t}function c0(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Sf(n,t,t.pendingProps,t.type,void 0,re);break;case 11:t=Sf(n,t,t.pendingProps,t.type.render,t.ref,re);break;case 5:fr(t);default:Af(n,t),t=ie=ad(t,pn),t=kf(n,t,pn)}e.memoizedProps=e.pendingProps,t===null?Ti(e):ie=t}function oa(e,t,n,a){sn=ul=null,fr(t),Il=null,Qa=0;var i=t.return;try{if(qp(e,i,t,n,re)){Me=1,hi(e,kt(n,e.current)),ie=null;return}}catch(r){if(i!==null)throw ie=i,r;Me=1,hi(e,kt(n,e.current)),ie=null;return}t.flags&32768?(ue||a===1?e=!0:sa||(re&536870912)!==0?e=!1:(Un=e=!0,(a===2||a===9||a===3||a===6)&&(a=jt.current,a!==null&&a.tag===13&&(a.flags|=16384))),r0(t,e)):Ti(t)}function Ti(e){var t=e;do{if((t.flags&32768)!==0){r0(t,Un);return}e=t.return;var n=Gp(t.alternate,t,pn);if(n!==null){ie=n;return}if(t=t.sibling,t!==null){ie=t;return}ie=t=e}while(t!==null);Me===0&&(Me=5)}function r0(e,t){do{var n=Qp(e.alternate,e);if(n!==null){n.flags&=32767,ie=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ie=e;return}ie=e=n}while(e!==null);Me=6,ie=null}function o0(e,t,n,a,i,r,f,p,g){e.cancelPendingCommit=null;do Ci();while(Ve!==0);if((he&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(r=t.lanes|t.childLanes,r|=Hc,Rx(e,n,r,f,p,g),e===ze&&(ie=ze=null,re=0),ca=t,Hn=e,bn=n,Zr=r,$r=i,If=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,eb(ks,function(){return h0(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null,i=V.p,V.p=2,f=he,he|=4;try{Yp(e,t,n)}finally{he=f,V.p=i,U.T=a}}Ve=1,u0(),d0(),f0()}}function u0(){if(Ve===1){Ve=0;var e=Hn,t=ca,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=U.T,U.T=null;var a=V.p;V.p=2;var i=he;he|=4;try{Kf(t,e);var r=oo,f=Ju(e.containerInfo),p=r.focusedElem,g=r.selectionRange;if(f!==p&&p&&p.ownerDocument&&$u(p.ownerDocument.documentElement,p)){if(g!==null&&Oc(p)){var E=g.start,_=g.end;if(_===void 0&&(_=E),"selectionStart"in p)p.selectionStart=E,p.selectionEnd=Math.min(_,p.value.length);else{var H=p.ownerDocument||document,C=H&&H.defaultView||window;if(C.getSelection){var D=C.getSelection(),$=p.textContent.length,I=Math.min(g.start,$),Ne=g.end===void 0?I:Math.min(g.end,$);!D.extend&&I>Ne&&(f=Ne,Ne=I,I=f);var S=Zu(p,I),z=Zu(p,Ne);if(S&&z&&(D.rangeCount!==1||D.anchorNode!==S.node||D.anchorOffset!==S.offset||D.focusNode!==z.node||D.focusOffset!==z.offset)){var w=H.createRange();w.setStart(S.node,S.offset),D.removeAllRanges(),I>Ne?(D.addRange(w),D.extend(z.node,z.offset)):(w.setEnd(z.node,z.offset),D.addRange(w))}}}}for(H=[],D=p;D=D.parentNode;)D.nodeType===1&&H.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<H.length;p++){var L=H[p];L.element.scrollLeft=L.left,L.element.scrollTop=L.top}}Bi=!!ro,oo=ro=null}finally{he=i,V.p=a,U.T=n}}e.current=t,Ve=2}}function d0(){if(Ve===2){Ve=0;var e=Hn,t=ca,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var a=V.p;V.p=2;var i=he;he|=4;try{Hf(e,t.alternate,t)}finally{he=i,V.p=a,U.T=n}}Ve=3}}function f0(){if(Ve===4||Ve===3){Ve=0,vx();var e=Hn,t=ca,n=bn,a=If;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ve=5:(Ve=0,ca=Hn=null,m0(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(qn=null),xc(n),t=t.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Sa,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=U.T,i=V.p,V.p=2,U.T=null;try{for(var r=e.onRecoverableError,f=0;f<a.length;f++){var p=a[f];r(p.value,{componentStack:p.stack})}}finally{U.T=t,V.p=i}}(bn&3)!==0&&Ci(),Ft(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===Jr?ss++:(ss=0,Jr=e):ss=0,is(0)}}function m0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ba(t)))}function Ci(){return u0(),d0(),f0(),h0()}function h0(){if(Ve!==5)return!1;var e=Hn,t=Zr;Zr=0;var n=xc(bn),a=U.T,i=V.p;try{V.p=32>n?32:n,U.T=null,n=$r,$r=null;var r=Hn,f=bn;if(Ve=0,ca=Hn=null,bn=0,(he&6)!==0)throw Error(u(331));var p=he;if(he|=4,Jf(r.current),Vf(r,r.current,f,n),he=p,is(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Sa,r)}catch{}return!0}finally{V.p=i,U.T=a,m0(e,t)}}function x0(e,t,n){t=kt(n,t),t=Tr(e.stateNode,t,2),e=An(e,t,2),e!==null&&(Ea(e,2),Ft(e))}function be(e,t,n){if(e.tag===3)x0(e,e,n);else for(;t!==null;){if(t.tag===3){x0(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(qn===null||!qn.has(a))){e=kt(n,e),n=pf(2),a=An(t,n,2),a!==null&&(bf(n,a,t,e),Ea(a,2),Ft(a));break}}t=t.return}}function Ir(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Vp;var i=new Set;a.set(t,i)}else i=a.get(t),i===void 0&&(i=new Set,a.set(t,i));i.has(n)||(Kr=!0,i.add(n),e=Wp.bind(null,e,t,n),t.then(e,e))}function Wp(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ze===e&&(re&n)===n&&(Me===4||Me===3&&(re&62914560)===re&&300>pt()-Ni?(he&2)===0&&ra(e,0):Xr|=n,ia===re&&(ia=0)),Ft(e)}function p0(e,t){t===0&&(t=ou()),e=cl(e,t),e!==null&&(Ea(e,t),Ft(e))}function Ip(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),p0(e,n)}function Pp(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(u(314))}a!==null&&a.delete(t),p0(e,n)}function eb(e,t){return dc(e,t)}var Ri=null,ua=null,Pr=!1,ki=!1,eo=!1,Gn=0;function Ft(e){e!==ua&&e.next===null&&(ua===null?Ri=ua=e:ua=ua.next=e),ki=!0,Pr||(Pr=!0,nb())}function is(e,t){if(!eo&&ki){eo=!0;do for(var n=!1,a=Ri;a!==null;){if(e!==0){var i=a.pendingLanes;if(i===0)var r=0;else{var f=a.suspendedLanes,p=a.pingedLanes;r=(1<<31-gt(42|e)+1)-1,r&=i&~(f&~p),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,v0(a,r))}else r=re,r=Os(a,a===ze?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||wa(a,r)||(n=!0,v0(a,r));a=a.next}while(n);eo=!1}}function tb(){b0()}function b0(){ki=Pr=!1;var e=0;Gn!==0&&fb()&&(e=Gn);for(var t=pt(),n=null,a=Ri;a!==null;){var i=a.next,r=g0(a,t);r===0?(a.next=null,n===null?Ri=i:n.next=i,i===null&&(ua=n)):(n=a,(e!==0||(r&3)!==0)&&(ki=!0)),a=i}Ve!==0&&Ve!==5||is(e),Gn!==0&&(Gn=0)}function g0(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var f=31-gt(r),p=1<<f,g=i[f];g===-1?((p&n)===0||(p&a)!==0)&&(i[f]=Cx(p,t)):g<=t&&(e.expiredLanes|=p),r&=~p}if(t=ze,n=re,n=Os(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(pe===2||pe===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&fc(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||wa(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&fc(a),xc(n)){case 2:case 8:n=cu;break;case 32:n=ks;break;case 268435456:n=ru;break;default:n=ks}return a=y0.bind(null,e),n=dc(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&fc(a),e.callbackPriority=2,e.callbackNode=null,2}function y0(e,t){if(Ve!==0&&Ve!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ci()&&e.callbackNode!==n)return null;var a=re;return a=Os(e,e===ze?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(e0(e,a,t),g0(e,pt()),e.callbackNode!=null&&e.callbackNode===n?y0.bind(null,e):null)}function v0(e,t){if(Ci())return null;e0(e,t,!0)}function nb(){hb(function(){(he&6)!==0?dc(iu,tb):b0()})}function to(){if(Gn===0){var e=Jl;e===0&&(e=Ds,Ds<<=1,(Ds&261888)===0&&(Ds=256)),Gn=e}return Gn}function j0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qs(""+e)}function N0(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function lb(e,t,n,a,i){if(t==="submit"&&n&&n.stateNode===i){var r=j0((i[ct]||null).action),f=a.submitter;f&&(t=(t=f[ct]||null)?j0(t.formAction):f.getAttribute("formAction"),t!==null&&(r=t,f=null));var p=new Qs("action","action",null,a,i);e.push({event:p,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Gn!==0){var g=f?N0(i,f):new FormData(i);jr(n,{pending:!0,data:g,method:i.method,action:r},null,g)}}else typeof r=="function"&&(p.preventDefault(),g=f?N0(i,f):new FormData(i),jr(n,{pending:!0,data:g,method:i.method,action:r},r,g))},currentTarget:i}]})}}for(var no=0;no<qc.length;no++){var lo=qc[no],ab=lo.toLowerCase(),sb=lo[0].toUpperCase()+lo.slice(1);Ht(ab,"on"+sb)}Ht(Iu,"onAnimationEnd"),Ht(Pu,"onAnimationIteration"),Ht(ed,"onAnimationStart"),Ht("dblclick","onDoubleClick"),Ht("focusin","onFocus"),Ht("focusout","onBlur"),Ht(jp,"onTransitionRun"),Ht(Np,"onTransitionStart"),Ht(zp,"onTransitionCancel"),Ht(td,"onTransitionEnd"),_l("onMouseEnter",["mouseout","mouseover"]),_l("onMouseLeave",["mouseout","mouseover"]),_l("onPointerEnter",["pointerout","pointerover"]),_l("onPointerLeave",["pointerout","pointerover"]),ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ll("onBeforeInput",["compositionend","keypress","textInput","paste"]),ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ib=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cs));function z0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],i=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var f=a.length-1;0<=f;f--){var p=a[f],g=p.instance,E=p.currentTarget;if(p=p.listener,g!==r&&i.isPropagationStopped())break e;r=p,i.currentTarget=E;try{r(i)}catch(_){Xs(_)}i.currentTarget=null,r=g}else for(f=0;f<a.length;f++){if(p=a[f],g=p.instance,E=p.currentTarget,p=p.listener,g!==r&&i.isPropagationStopped())break e;r=p,i.currentTarget=E;try{r(i)}catch(_){Xs(_)}i.currentTarget=null,r=g}}}}function ce(e,t){var n=t[pc];n===void 0&&(n=t[pc]=new Set);var a=e+"__bubble";n.has(a)||(S0(t,e,2,!1),n.add(a))}function ao(e,t,n){var a=0;t&&(a|=4),S0(n,e,a,t)}var Di="_reactListening"+Math.random().toString(36).slice(2);function so(e){if(!e[Di]){e[Di]=!0,pu.forEach(function(n){n!=="selectionchange"&&(ib.has(n)||ao(n,!1,e),ao(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Di]||(t[Di]=!0,ao("selectionchange",!1,t))}}function S0(e,t,n,a){switch(P0(t)){case 2:var i=Ob;break;case 8:i=_b;break;default:i=jo}n=i.bind(null,t,n,e),i=void 0,!wc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),a?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function io(e,t,n,a,i){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var f=a.tag;if(f===3||f===4){var p=a.stateNode.containerInfo;if(p===i)break;if(f===4)for(f=a.return;f!==null;){var g=f.tag;if((g===3||g===4)&&f.stateNode.containerInfo===i)return;f=f.return}for(;p!==null;){if(f=Al(p),f===null)return;if(g=f.tag,g===5||g===6||g===26||g===27){a=r=f;continue e}p=p.parentNode}}a=a.return}Cu(function(){var E=r,_=zc(n),H=[];e:{var C=nd.get(e);if(C!==void 0){var D=Qs,$=e;switch(e){case"keypress":if(Bs(n)===0)break e;case"keydown":case"keyup":D=Px;break;case"focusin":$="focus",D=Rc;break;case"focusout":$="blur",D=Rc;break;case"beforeblur":case"afterblur":D=Rc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":D=Du;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":D=Gx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":D=np;break;case Iu:case Pu:case ed:D=Kx;break;case td:D=ap;break;case"scroll":case"scrollend":D=Hx;break;case"wheel":D=ip;break;case"copy":case"cut":case"paste":D=Vx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":D=Mu;break;case"toggle":case"beforetoggle":D=rp}var I=(t&4)!==0,Ne=!I&&(e==="scroll"||e==="scrollend"),S=I?C!==null?C+"Capture":null:C;I=[];for(var z=E,w;z!==null;){var L=z;if(w=L.stateNode,L=L.tag,L!==5&&L!==26&&L!==27||w===null||S===null||(L=Ra(z,S),L!=null&&I.push(rs(z,L,w))),Ne)break;z=z.return}0<I.length&&(C=new D(C,$,null,n,_),H.push({event:C,listeners:I}))}}if((t&7)===0){e:{if(C=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",C&&n!==Nc&&($=n.relatedTarget||n.fromElement)&&(Al($)||$[Dl]))break e;if((D||C)&&(C=_.window===_?_:(C=_.ownerDocument)?C.defaultView||C.parentWindow:window,D?($=n.relatedTarget||n.toElement,D=E,$=$?Al($):null,$!==null&&(Ne=h($),I=$.tag,$!==Ne||I!==5&&I!==27&&I!==6)&&($=null)):(D=null,$=E),D!==$)){if(I=Du,L="onMouseLeave",S="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(I=Mu,L="onPointerLeave",S="onPointerEnter",z="pointer"),Ne=D==null?C:Ca(D),w=$==null?C:Ca($),C=new I(L,z+"leave",D,n,_),C.target=Ne,C.relatedTarget=w,L=null,Al(_)===E&&(I=new I(S,z+"enter",$,n,_),I.target=w,I.relatedTarget=Ne,L=I),Ne=L,D&&$)t:{for(I=cb,S=D,z=$,w=0,L=S;L;L=I(L))w++;L=0;for(var W=z;W;W=I(W))L++;for(;0<w-L;)S=I(S),w--;for(;0<L-w;)z=I(z),L--;for(;w--;){if(S===z||z!==null&&S===z.alternate){I=S;break t}S=I(S),z=I(z)}I=null}else I=null;D!==null&&w0(H,C,D,I,!1),$!==null&&Ne!==null&&w0(H,Ne,$,I,!0)}}e:{if(C=E?Ca(E):window,D=C.nodeName&&C.nodeName.toLowerCase(),D==="select"||D==="input"&&C.type==="file")var de=Gu;else if(Hu(C))if(Qu)de=gp;else{de=pp;var J=xp}else D=C.nodeName,!D||D.toLowerCase()!=="input"||C.type!=="checkbox"&&C.type!=="radio"?E&&jc(E.elementType)&&(de=Gu):de=bp;if(de&&(de=de(e,E))){Bu(H,de,n,_);break e}J&&J(e,C,E),e==="focusout"&&E&&C.type==="number"&&E.memoizedProps.value!=null&&vc(C,"number",C.value)}switch(J=E?Ca(E):window,e){case"focusin":(Hu(J)||J.contentEditable==="true")&&(Gl=J,_c=E,La=null);break;case"focusout":La=_c=Gl=null;break;case"mousedown":Uc=!0;break;case"contextmenu":case"mouseup":case"dragend":Uc=!1,Fu(H,n,_);break;case"selectionchange":if(vp)break;case"keydown":case"keyup":Fu(H,n,_)}var ne;if(Dc)e:{switch(e){case"compositionstart":var oe="onCompositionStart";break e;case"compositionend":oe="onCompositionEnd";break e;case"compositionupdate":oe="onCompositionUpdate";break e}oe=void 0}else Bl?Lu(e,n)&&(oe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(oe="onCompositionStart");oe&&(Ou&&n.locale!=="ko"&&(Bl||oe!=="onCompositionStart"?oe==="onCompositionEnd"&&Bl&&(ne=Ru()):(wn=_,Ec="value"in wn?wn.value:wn.textContent,Bl=!0)),J=Ai(E,oe),0<J.length&&(oe=new Au(oe,e,null,n,_),H.push({event:oe,listeners:J}),ne?oe.data=ne:(ne=qu(n),ne!==null&&(oe.data=ne)))),(ne=up?dp(e,n):fp(e,n))&&(oe=Ai(E,"onBeforeInput"),0<oe.length&&(J=new Au("onBeforeInput","beforeinput",null,n,_),H.push({event:J,listeners:oe}),J.data=ne)),lb(H,e,E,n,_)}z0(H,t)})}function rs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ai(e,t){for(var n=t+"Capture",a=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=Ra(e,n),i!=null&&a.unshift(rs(e,i,r)),i=Ra(e,t),i!=null&&a.push(rs(e,i,r))),e.tag===3)return a;e=e.return}return[]}function cb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function w0(e,t,n,a,i){for(var r=t._reactName,f=[];n!==null&&n!==a;){var p=n,g=p.alternate,E=p.stateNode;if(p=p.tag,g!==null&&g===a)break;p!==5&&p!==26&&p!==27||E===null||(g=E,i?(E=Ra(n,r),E!=null&&f.unshift(rs(n,E,g))):i||(E=Ra(n,r),E!=null&&f.push(rs(n,E,g)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var rb=/\r\n?/g,ob=/\u0000|\uFFFD/g;function E0(e){return(typeof e=="string"?e:""+e).replace(rb,`
|
|
25
|
+
`).replace(ob,"")}function T0(e,t){return t=E0(t),E0(e)===t}function je(e,t,n,a,i,r){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ll(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ll(e,""+a);break;case"className":Us(e,"class",a);break;case"tabIndex":Us(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Us(e,n,a);break;case"style":Eu(e,a,r);break;case"data":if(t!=="object"){Us(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=qs(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(n==="formAction"?(t!=="input"&&je(e,t,"name",i.name,i,null),je(e,t,"formEncType",i.formEncType,i,null),je(e,t,"formMethod",i.formMethod,i,null),je(e,t,"formTarget",i.formTarget,i,null)):(je(e,t,"encType",i.encType,i,null),je(e,t,"method",i.method,i,null),je(e,t,"target",i.target,i,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=qs(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=tn);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=qs(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":ce("beforetoggle",e),ce("toggle",e),_s(e,"popover",a);break;case"xlinkActuate":en(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":en(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":en(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":en(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":en(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":en(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":en(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":en(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":en(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":_s(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Lx.get(n)||n,_s(e,n,a))}}function co(e,t,n,a,i,r){switch(n){case"style":Eu(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Ll(e,a):(typeof a=="number"||typeof a=="bigint")&&Ll(e,""+a);break;case"onScroll":a!=null&&ce("scroll",e);break;case"onScrollEnd":a!=null&&ce("scrollend",e);break;case"onClick":a!=null&&(e.onclick=tn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bu.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),r=e[ct]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,i),typeof a=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,i);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):_s(e,n,a)}}}function tt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ce("error",e),ce("load",e);var a=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"src":a=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:je(e,t,r,f,n,null)}}i&&je(e,t,"srcSet",n.srcSet,n,null),a&&je(e,t,"src",n.src,n,null);return;case"input":ce("invalid",e);var p=r=f=i=null,g=null,E=null;for(a in n)if(n.hasOwnProperty(a)){var _=n[a];if(_!=null)switch(a){case"name":i=_;break;case"type":f=_;break;case"checked":g=_;break;case"defaultChecked":E=_;break;case"value":r=_;break;case"defaultValue":p=_;break;case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(u(137,t));break;default:je(e,t,a,_,n,null)}}Nu(e,r,p,g,E,f,i,!1);return;case"select":ce("invalid",e),a=f=r=null;for(i in n)if(n.hasOwnProperty(i)&&(p=n[i],p!=null))switch(i){case"value":r=p;break;case"defaultValue":f=p;break;case"multiple":a=p;default:je(e,t,i,p,n,null)}t=r,n=f,e.multiple=!!a,t!=null?Ul(e,!!a,t,!1):n!=null&&Ul(e,!!a,n,!0);return;case"textarea":ce("invalid",e),r=i=a=null;for(f in n)if(n.hasOwnProperty(f)&&(p=n[f],p!=null))switch(f){case"value":a=p;break;case"defaultValue":i=p;break;case"children":r=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(u(91));break;default:je(e,t,f,p,n,null)}Su(e,a,i,r);return;case"option":for(g in n)if(n.hasOwnProperty(g)&&(a=n[g],a!=null))switch(g){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:je(e,t,g,a,n,null)}return;case"dialog":ce("beforetoggle",e),ce("toggle",e),ce("cancel",e),ce("close",e);break;case"iframe":case"object":ce("load",e);break;case"video":case"audio":for(a=0;a<cs.length;a++)ce(cs[a],e);break;case"image":ce("error",e),ce("load",e);break;case"details":ce("toggle",e);break;case"embed":case"source":case"link":ce("error",e),ce("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(E in n)if(n.hasOwnProperty(E)&&(a=n[E],a!=null))switch(E){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:je(e,t,E,a,n,null)}return;default:if(jc(t)){for(_ in n)n.hasOwnProperty(_)&&(a=n[_],a!==void 0&&co(e,t,_,a,n,void 0));return}}for(p in n)n.hasOwnProperty(p)&&(a=n[p],a!=null&&je(e,t,p,a,n,null))}function ub(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,f=null,p=null,g=null,E=null,_=null;for(D in n){var H=n[D];if(n.hasOwnProperty(D)&&H!=null)switch(D){case"checked":break;case"value":break;case"defaultValue":g=H;default:a.hasOwnProperty(D)||je(e,t,D,null,a,H)}}for(var C in a){var D=a[C];if(H=n[C],a.hasOwnProperty(C)&&(D!=null||H!=null))switch(C){case"type":r=D;break;case"name":i=D;break;case"checked":E=D;break;case"defaultChecked":_=D;break;case"value":f=D;break;case"defaultValue":p=D;break;case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:D!==H&&je(e,t,C,D,a,H)}}yc(e,f,p,g,E,_,r,i);return;case"select":D=f=p=C=null;for(r in n)if(g=n[r],n.hasOwnProperty(r)&&g!=null)switch(r){case"value":break;case"multiple":D=g;default:a.hasOwnProperty(r)||je(e,t,r,null,a,g)}for(i in a)if(r=a[i],g=n[i],a.hasOwnProperty(i)&&(r!=null||g!=null))switch(i){case"value":C=r;break;case"defaultValue":p=r;break;case"multiple":f=r;default:r!==g&&je(e,t,i,r,a,g)}t=p,n=f,a=D,C!=null?Ul(e,!!n,C,!1):!!a!=!!n&&(t!=null?Ul(e,!!n,t,!0):Ul(e,!!n,n?[]:"",!1));return;case"textarea":D=C=null;for(p in n)if(i=n[p],n.hasOwnProperty(p)&&i!=null&&!a.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:je(e,t,p,null,a,i)}for(f in a)if(i=a[f],r=n[f],a.hasOwnProperty(f)&&(i!=null||r!=null))switch(f){case"value":C=i;break;case"defaultValue":D=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(u(91));break;default:i!==r&&je(e,t,f,i,a,r)}zu(e,C,D);return;case"option":for(var $ in n)if(C=n[$],n.hasOwnProperty($)&&C!=null&&!a.hasOwnProperty($))switch($){case"selected":e.selected=!1;break;default:je(e,t,$,null,a,C)}for(g in a)if(C=a[g],D=n[g],a.hasOwnProperty(g)&&C!==D&&(C!=null||D!=null))switch(g){case"selected":e.selected=C&&typeof C!="function"&&typeof C!="symbol";break;default:je(e,t,g,C,a,D)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var I in n)C=n[I],n.hasOwnProperty(I)&&C!=null&&!a.hasOwnProperty(I)&&je(e,t,I,null,a,C);for(E in a)if(C=a[E],D=n[E],a.hasOwnProperty(E)&&C!==D&&(C!=null||D!=null))switch(E){case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(u(137,t));break;default:je(e,t,E,C,a,D)}return;default:if(jc(t)){for(var Ne in n)C=n[Ne],n.hasOwnProperty(Ne)&&C!==void 0&&!a.hasOwnProperty(Ne)&&co(e,t,Ne,void 0,a,C);for(_ in a)C=a[_],D=n[_],!a.hasOwnProperty(_)||C===D||C===void 0&&D===void 0||co(e,t,_,C,a,D);return}}for(var S in n)C=n[S],n.hasOwnProperty(S)&&C!=null&&!a.hasOwnProperty(S)&&je(e,t,S,null,a,C);for(H in a)C=a[H],D=n[H],!a.hasOwnProperty(H)||C===D||C==null&&D==null||je(e,t,H,C,a,D)}function C0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function db(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var i=n[a],r=i.transferSize,f=i.initiatorType,p=i.duration;if(r&&p&&C0(f)){for(f=0,p=i.responseEnd,a+=1;a<n.length;a++){var g=n[a],E=g.startTime;if(E>p)break;var _=g.transferSize,H=g.initiatorType;_&&C0(H)&&(g=g.responseEnd,f+=_*(g<p?1:(p-E)/(g-E)))}if(--a,t+=8*(r+f)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var ro=null,oo=null;function Mi(e){return e.nodeType===9?e:e.ownerDocument}function R0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function k0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function uo(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var fo=null;function fb(){var e=window.event;return e&&e.type==="popstate"?e===fo?!1:(fo=e,!0):(fo=null,!1)}var D0=typeof setTimeout=="function"?setTimeout:void 0,mb=typeof clearTimeout=="function"?clearTimeout:void 0,A0=typeof Promise=="function"?Promise:void 0,hb=typeof queueMicrotask=="function"?queueMicrotask:typeof A0<"u"?function(e){return A0.resolve(null).then(e).catch(xb)}:D0;function xb(e){setTimeout(function(){throw e})}function Qn(e){return e==="head"}function M0(e,t){var n=t,a=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(i),ha(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")os(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,os(n);for(var r=n.firstChild;r;){var f=r.nextSibling,p=r.nodeName;r[Ta]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=f}}else n==="body"&&os(e.ownerDocument.body);n=i}while(n);ha(t)}function O0(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function mo(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":mo(n),bc(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function pb(e,t,n,a){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Ta])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=_t(e.nextSibling),e===null)break}return null}function bb(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=_t(e.nextSibling),e===null))return null;return e}function _0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_t(e.nextSibling),e===null))return null;return e}function ho(e){return e.data==="$?"||e.data==="$~"}function xo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gb(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function _t(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var po=null;function U0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return _t(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function L0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function q0(e,t,n){switch(t=Mi(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function os(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bc(e)}var Ut=new Map,H0=new Set;function Oi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gn=V.d;V.d={f:yb,r:vb,D:jb,C:Nb,L:zb,m:Sb,X:Eb,S:wb,M:Tb};function yb(){var e=gn.f(),t=wi();return e||t}function vb(e){var t=Ml(e);t!==null&&t.tag===5&&t.type==="form"?tf(t):gn.r(e)}var da=typeof document>"u"?null:document;function B0(e,t,n){var a=da;if(a&&typeof t=="string"&&t){var i=Ct(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),H0.has(i)||(H0.add(i),e={rel:e,crossOrigin:n,href:t},a.querySelector(i)===null&&(t=a.createElement("link"),tt(t,"link",e),Je(t),a.head.appendChild(t)))}}function jb(e){gn.D(e),B0("dns-prefetch",e,null)}function Nb(e,t){gn.C(e,t),B0("preconnect",e,t)}function zb(e,t,n){gn.L(e,t,n);var a=da;if(a&&e&&t){var i='link[rel="preload"][as="'+Ct(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Ct(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Ct(n.imageSizes)+'"]')):i+='[href="'+Ct(e)+'"]';var r=i;switch(t){case"style":r=fa(e);break;case"script":r=ma(e)}Ut.has(r)||(e=v({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ut.set(r,e),a.querySelector(i)!==null||t==="style"&&a.querySelector(us(r))||t==="script"&&a.querySelector(ds(r))||(t=a.createElement("link"),tt(t,"link",e),Je(t),a.head.appendChild(t)))}}function Sb(e,t){gn.m(e,t);var n=da;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Ct(a)+'"][href="'+Ct(e)+'"]',r=i;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ma(e)}if(!Ut.has(r)&&(e=v({rel:"modulepreload",href:e},t),Ut.set(r,e),n.querySelector(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ds(r)))return}a=n.createElement("link"),tt(a,"link",e),Je(a),n.head.appendChild(a)}}}function wb(e,t,n){gn.S(e,t,n);var a=da;if(a&&e){var i=Ol(a).hoistableStyles,r=fa(e);t=t||"default";var f=i.get(r);if(!f){var p={loading:0,preload:null};if(f=a.querySelector(us(r)))p.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ut.get(r))&&bo(e,n);var g=f=a.createElement("link");Je(g),tt(g,"link",e),g._p=new Promise(function(E,_){g.onload=E,g.onerror=_}),g.addEventListener("load",function(){p.loading|=1}),g.addEventListener("error",function(){p.loading|=2}),p.loading|=4,_i(f,t,a)}f={type:"stylesheet",instance:f,count:1,state:p},i.set(r,f)}}}function Eb(e,t){gn.X(e,t);var n=da;if(n&&e){var a=Ol(n).hoistableScripts,i=ma(e),r=a.get(i);r||(r=n.querySelector(ds(i)),r||(e=v({src:e,async:!0},t),(t=Ut.get(i))&&go(e,t),r=n.createElement("script"),Je(r),tt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(i,r))}}function Tb(e,t){gn.M(e,t);var n=da;if(n&&e){var a=Ol(n).hoistableScripts,i=ma(e),r=a.get(i);r||(r=n.querySelector(ds(i)),r||(e=v({src:e,async:!0,type:"module"},t),(t=Ut.get(i))&&go(e,t),r=n.createElement("script"),Je(r),tt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(i,r))}}function G0(e,t,n,a){var i=(i=Nn.current)?Oi(i):null;if(!i)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=fa(n.href),n=Ol(i).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=fa(n.href);var r=Ol(i).hoistableStyles,f=r.get(e);if(f||(i=i.ownerDocument||i,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,f),(r=i.querySelector(us(e)))&&!r._p&&(f.instance=r,f.state.loading=5),Ut.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ut.set(e,n),r||Cb(i,e,n,f.state))),t&&a===null)throw Error(u(528,""));return f}if(t&&a!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ma(n),n=Ol(i).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function fa(e){return'href="'+Ct(e)+'"'}function us(e){return'link[rel="stylesheet"]['+e+"]"}function Q0(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function Cb(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),tt(t,"link",n),Je(t),e.head.appendChild(t))}function ma(e){return'[src="'+Ct(e)+'"]'}function ds(e){return"script[async]"+e}function Y0(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ct(n.href)+'"]');if(a)return t.instance=a,Je(a),a;var i=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Je(a),tt(a,"style",i),_i(a,n.precedence,e),t.instance=a;case"stylesheet":i=fa(n.href);var r=e.querySelector(us(i));if(r)return t.state.loading|=4,t.instance=r,Je(r),r;a=Q0(n),(i=Ut.get(i))&&bo(a,i),r=(e.ownerDocument||e).createElement("link"),Je(r);var f=r;return f._p=new Promise(function(p,g){f.onload=p,f.onerror=g}),tt(r,"link",a),t.state.loading|=4,_i(r,n.precedence,e),t.instance=r;case"script":return r=ma(n.src),(i=e.querySelector(ds(r)))?(t.instance=i,Je(i),i):(a=n,(i=Ut.get(r))&&(a=v({},n),go(a,i)),e=e.ownerDocument||e,i=e.createElement("script"),Je(i),tt(i,"link",a),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,_i(a,n.precedence,e));return t.instance}function _i(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=a.length?a[a.length-1]:null,r=i,f=0;f<a.length;f++){var p=a[f];if(p.dataset.precedence===t)r=p;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function bo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function go(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ui=null;function K0(e,t,n){if(Ui===null){var a=new Map,i=Ui=new Map;i.set(n,a)}else i=Ui,a=i.get(n),a||(a=new Map,i.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var r=n[i];if(!(r[Ta]||r[We]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var f=r.getAttribute(t)||"";f=e+f;var p=a.get(f);p?p.push(r):a.set(f,[r])}}return a}function X0(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Rb(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function V0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function kb(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=fa(a.href),r=t.querySelector(us(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Li.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,Je(r);return}r=t.ownerDocument||t,a=Q0(a),(i=Ut.get(i))&&bo(a,i),r=r.createElement("link"),Je(r);var f=r;f._p=new Promise(function(p,g){f.onload=p,f.onerror=g}),tt(r,"link",a),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Li.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var yo=0;function Db(e,t){return e.stylesheets&&e.count===0&&Hi(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Hi(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&yo===0&&(yo=62500*db());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Hi(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>yo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(i)}}:null}function Li(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var qi=null;function Hi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,qi=new Map,t.forEach(Ab,e),qi=null,Li.call(e))}function Ab(e,t){if(!(t.state.loading&4)){var n=qi.get(e);if(n)var a=n.get(null);else{n=new Map,qi.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var f=i[r];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),a=f)}a&&n.set(null,a)}i=t.instance,f=i.getAttribute("data-precedence"),r=n.get(f)||a,r===a&&n.set(null,i),n.set(f,i),this.count++,a=Li.bind(this),i.addEventListener("load",a),i.addEventListener("error",a),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var fs={$$typeof:G,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function Mb(e,t,n,a,i,r,f,p,g){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=mc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mc(0),this.hiddenUpdates=mc(null),this.identifierPrefix=a,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function Z0(e,t,n,a,i,r,f,p,g,E,_,H){return e=new Mb(e,t,n,f,g,E,_,H,p),t=1,r===!0&&(t|=24),r=vt(3,null,null,t),e.current=r,r.stateNode=e,t=Wc(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:n,cache:t},tr(r),e}function $0(e){return e?(e=Kl,e):Kl}function J0(e,t,n,a,i,r){i=$0(i),a.context===null?a.context=i:a.pendingContext=i,a=Dn(t),a.payload={element:n},r=r===void 0?null:r,r!==null&&(a.callback=r),n=An(e,a,t),n!==null&&(mt(n,e,t),Ka(n,e,t))}function F0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vo(e,t){F0(e,t),(e=e.alternate)&&F0(e,t)}function W0(e){if(e.tag===13||e.tag===31){var t=cl(e,67108864);t!==null&&mt(t,e,67108864),vo(e,67108864)}}function I0(e){if(e.tag===13||e.tag===31){var t=wt();t=hc(t);var n=cl(e,t);n!==null&&mt(n,e,t),vo(e,t)}}var Bi=!0;function Ob(e,t,n,a){var i=U.T;U.T=null;var r=V.p;try{V.p=2,jo(e,t,n,a)}finally{V.p=r,U.T=i}}function _b(e,t,n,a){var i=U.T;U.T=null;var r=V.p;try{V.p=8,jo(e,t,n,a)}finally{V.p=r,U.T=i}}function jo(e,t,n,a){if(Bi){var i=No(a);if(i===null)io(e,t,a,Gi,n),em(e,a);else if(Lb(i,e,t,n,a))a.stopPropagation();else if(em(e,a),t&4&&-1<Ub.indexOf(e)){for(;i!==null;){var r=Ml(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var f=nl(r.pendingLanes);if(f!==0){var p=r;for(p.pendingLanes|=2,p.entangledLanes|=2;f;){var g=1<<31-gt(f);p.entanglements[1]|=g,f&=~g}Ft(r),(he&6)===0&&(zi=pt()+500,is(0))}}break;case 31:case 13:p=cl(r,2),p!==null&&mt(p,r,2),wi(),vo(r,2)}if(r=No(a),r===null&&io(e,t,a,Gi,n),r===i)break;i=r}i!==null&&a.stopPropagation()}else io(e,t,a,null,n)}}function No(e){return e=zc(e),zo(e)}var Gi=null;function zo(e){if(Gi=null,e=Al(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=x(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Gi=e,null}function P0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(jx()){case iu:return 2;case cu:return 8;case ks:case Nx:return 32;case ru:return 268435456;default:return 32}default:return 32}}var So=!1,Yn=null,Kn=null,Xn=null,ms=new Map,hs=new Map,Vn=[],Ub="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function em(e,t){switch(e){case"focusin":case"focusout":Yn=null;break;case"dragenter":case"dragleave":Kn=null;break;case"mouseover":case"mouseout":Xn=null;break;case"pointerover":case"pointerout":ms.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hs.delete(t.pointerId)}}function xs(e,t,n,a,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Ml(t),t!==null&&W0(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lb(e,t,n,a,i){switch(t){case"focusin":return Yn=xs(Yn,e,t,n,a,i),!0;case"dragenter":return Kn=xs(Kn,e,t,n,a,i),!0;case"mouseover":return Xn=xs(Xn,e,t,n,a,i),!0;case"pointerover":var r=i.pointerId;return ms.set(r,xs(ms.get(r)||null,e,t,n,a,i)),!0;case"gotpointercapture":return r=i.pointerId,hs.set(r,xs(hs.get(r)||null,e,t,n,a,i)),!0}return!1}function tm(e){var t=Al(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,hu(e.priority,function(){I0(n)});return}}else if(t===31){if(t=x(n),t!==null){e.blockedOn=t,hu(e.priority,function(){I0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=No(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Nc=a,n.target.dispatchEvent(a),Nc=null}else return t=Ml(n),t!==null&&W0(t),e.blockedOn=n,!1;t.shift()}return!0}function nm(e,t,n){Qi(e)&&n.delete(t)}function qb(){So=!1,Yn!==null&&Qi(Yn)&&(Yn=null),Kn!==null&&Qi(Kn)&&(Kn=null),Xn!==null&&Qi(Xn)&&(Xn=null),ms.forEach(nm),hs.forEach(nm)}function Yi(e,t){e.blockedOn===t&&(e.blockedOn=null,So||(So=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,qb)))}var Ki=null;function lm(e){Ki!==e&&(Ki=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ki===e&&(Ki=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],i=e[t+2];if(typeof a!="function"){if(zo(a||n)===null)continue;break}var r=Ml(n);r!==null&&(e.splice(t,3),t-=3,jr(r,{pending:!0,data:i,method:n.method,action:a},a,i))}}))}function ha(e){function t(g){return Yi(g,e)}Yn!==null&&Yi(Yn,e),Kn!==null&&Yi(Kn,e),Xn!==null&&Yi(Xn,e),ms.forEach(t),hs.forEach(t);for(var n=0;n<Vn.length;n++){var a=Vn[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Vn.length&&(n=Vn[0],n.blockedOn===null);)tm(n),n.blockedOn===null&&Vn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var i=n[a],r=n[a+1],f=i[ct]||null;if(typeof r=="function")f||lm(n);else if(f){var p=null;if(r&&r.hasAttribute("formAction")){if(i=r,f=r[ct]||null)p=f.formAction;else if(zo(i)!==null)continue}else p=f.action;typeof p=="function"?n[a+1]=p:(n.splice(a,3),a-=3),lm(n)}}}function am(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(f){return i=f})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function wo(e){this._internalRoot=e}Xi.prototype.render=wo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,a=wt();J0(n,a,e,t,null,null)},Xi.prototype.unmount=wo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;J0(e.current,2,null,e,null,null),wi(),t[Dl]=null}};function Xi(e){this._internalRoot=e}Xi.prototype.unstable_scheduleHydration=function(e){if(e){var t=mu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vn.length&&t!==0&&t<Vn[n].priority;n++);Vn.splice(n,0,e),n===0&&tm(e)}};var sm=c.version;if(sm!=="19.2.4")throw Error(u(527,sm,"19.2.4"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=N(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Hb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vi.isDisabled&&Vi.supportsFiber)try{Sa=Vi.inject(Hb),bt=Vi}catch{}}return ps.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,a="",i=ff,r=mf,f=hf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=Z0(e,1,!1,null,null,n,a,null,i,r,f,am),e[Dl]=t.current,so(e),new wo(t)},ps.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var a=!1,i="",r=ff,f=mf,p=hf,g=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(p=n.onRecoverableError),n.formState!==void 0&&(g=n.formState)),t=Z0(e,1,!0,t,n??null,a,i,g,r,f,p,am),t.context=$0(null),n=t.current,a=wt(),a=hc(a),i=Dn(a),i.callback=null,An(n,i,a),n=a,t.current.lanes=n,Ea(t,n),Ft(t),e[Dl]=t.current,so(e),new Xi(t)},ps.version="19.2.4",ps}var hm;function Yg(){if(hm)return Co.exports;hm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(c){console.error(c)}}return s(),Co.exports=Qg(),Co.exports}var Kg=Yg();function Xg({className:s,title:c="Blok"}){return l.jsxs("svg",{viewBox:"0 0 40 32",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:s,role:"img","aria-label":c,children:[l.jsx("path",{d:"M4.58288 11.1045C4.86346 10.823 5.31836 10.823 5.59894 11.1045L9.97138 15.4904C10.252 15.7718 10.252 16.2282 9.97139 16.5096L5.59894 20.8955C5.31836 21.177 4.86346 21.177 4.58288 20.8955L0.210434 16.5096C-0.0701446 16.2282 -0.0701449 15.7718 0.210434 15.4904L4.58288 11.1045Z",fill:"#2BCD71"}),l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.7107 11.1972C20.2692 10.9492 19.7308 10.9492 19.2893 11.1972L15.9966 13.0468C15.5373 13.3048 15.2528 13.7917 15.2528 14.3198V17.6802C15.2528 18.2083 15.5373 18.6952 15.9966 18.9532L19.2893 20.8028C19.7308 21.0508 20.2692 21.0508 20.7107 20.8028L24.0034 18.9532C24.4627 18.6952 24.7472 18.2083 24.7472 17.6802V14.3198C24.7472 13.7917 24.4627 13.3048 24.0034 13.0468L20.7107 11.1972ZM29.0909 11.7486C29.0909 11.2205 28.8064 10.7336 28.3471 10.4756L20.7107 6.18602C20.2692 5.93799 19.7308 5.93799 19.2893 6.18602L11.6529 10.4756C11.1936 10.7336 10.9091 11.2205 10.9091 11.7486V20.2514C10.9091 20.7795 11.1936 21.2664 11.6529 21.5244L19.2893 25.814C19.7308 26.062 20.2692 26.062 20.7107 25.814L28.3471 21.5244C28.8064 21.2664 29.0909 20.7795 29.0909 20.2514V11.7486Z",fill:"#2BCD71"}),l.jsx("path",{d:"M34.4011 11.1045C34.6816 10.823 35.1365 10.823 35.4171 11.1045L39.7896 15.4904C40.0701 15.7718 40.0701 16.2282 39.7896 16.5096L35.4171 20.8955C35.1365 21.177 34.6816 21.177 34.4011 20.8955L30.0286 16.5096C29.748 16.2282 29.748 15.7718 30.0286 15.4904L34.4011 11.1045Z",fill:"#2BCD71"})]})}const Fo="-",Vg=s=>{const c=$g(s),{conflictingClassGroups:o,conflictingClassGroupModifiers:u}=s;return{getClassGroupId:m=>{const x=m.split(Fo);return x[0]===""&&x.length!==1&&x.shift(),sh(x,c)||Zg(m)},getConflictingClassGroupIds:(m,x)=>{const b=o[m]||[];return x&&u[m]?[...b,...u[m]]:b}}},sh=(s,c)=>{var m;if(s.length===0)return c.classGroupId;const o=s[0],u=c.nextPart.get(o),d=u?sh(s.slice(1),u):void 0;if(d)return d;if(c.validators.length===0)return;const h=s.join(Fo);return(m=c.validators.find(({validator:x})=>x(h)))==null?void 0:m.classGroupId},xm=/^\[(.+)\]$/,Zg=s=>{if(xm.test(s)){const c=xm.exec(s)[1],o=c==null?void 0:c.substring(0,c.indexOf(":"));if(o)return"arbitrary.."+o}},$g=s=>{const{theme:c,prefix:o}=s,u={nextPart:new Map,validators:[]};return Fg(Object.entries(s.classGroups),o).forEach(([h,m])=>{qo(m,u,h,c)}),u},qo=(s,c,o,u)=>{s.forEach(d=>{if(typeof d=="string"){const h=d===""?c:pm(c,d);h.classGroupId=o;return}if(typeof d=="function"){if(Jg(d)){qo(d(u),c,o,u);return}c.validators.push({validator:d,classGroupId:o});return}Object.entries(d).forEach(([h,m])=>{qo(m,pm(c,h),o,u)})})},pm=(s,c)=>{let o=s;return c.split(Fo).forEach(u=>{o.nextPart.has(u)||o.nextPart.set(u,{nextPart:new Map,validators:[]}),o=o.nextPart.get(u)}),o},Jg=s=>s.isThemeGetter,Fg=(s,c)=>c?s.map(([o,u])=>{const d=u.map(h=>typeof h=="string"?c+h:typeof h=="object"?Object.fromEntries(Object.entries(h).map(([m,x])=>[c+m,x])):h);return[o,d]}):s,Wg=s=>{if(s<1)return{get:()=>{},set:()=>{}};let c=0,o=new Map,u=new Map;const d=(h,m)=>{o.set(h,m),c++,c>s&&(c=0,u=o,o=new Map)};return{get(h){let m=o.get(h);if(m!==void 0)return m;if((m=u.get(h))!==void 0)return d(h,m),m},set(h,m){o.has(h)?o.set(h,m):d(h,m)}}},ih="!",Ig=s=>{const{separator:c,experimentalParseClassName:o}=s,u=c.length===1,d=c[0],h=c.length,m=x=>{const b=[];let N=0,y=0,v;for(let M=0;M<x.length;M++){let Y=x[M];if(N===0){if(Y===d&&(u||x.slice(M,M+h)===c)){b.push(x.slice(y,M)),y=M+h;continue}if(Y==="/"){v=M;continue}}Y==="["?N++:Y==="]"&&N--}const j=b.length===0?x:x.substring(y),R=j.startsWith(ih),T=R?j.substring(1):j,k=v&&v>y?v-y:void 0;return{modifiers:b,hasImportantModifier:R,baseClassName:T,maybePostfixModifierPosition:k}};return o?x=>o({className:x,parseClassName:m}):m},Pg=s=>{if(s.length<=1)return s;const c=[];let o=[];return s.forEach(u=>{u[0]==="["?(c.push(...o.sort(),u),o=[]):o.push(u)}),c.push(...o.sort()),c},ey=s=>({cache:Wg(s.cacheSize),parseClassName:Ig(s),...Vg(s)}),ty=/\s+/,ny=(s,c)=>{const{parseClassName:o,getClassGroupId:u,getConflictingClassGroupIds:d}=c,h=[],m=s.trim().split(ty);let x="";for(let b=m.length-1;b>=0;b-=1){const N=m[b],{modifiers:y,hasImportantModifier:v,baseClassName:j,maybePostfixModifierPosition:R}=o(N);let T=!!R,k=u(T?j.substring(0,R):j);if(!k){if(!T){x=N+(x.length>0?" "+x:x);continue}if(k=u(j),!k){x=N+(x.length>0?" "+x:x);continue}T=!1}const M=Pg(y).join(":"),Y=v?M+ih:M,O=Y+k;if(h.includes(O))continue;h.push(O);const G=d(k,T);for(let B=0;B<G.length;++B){const X=G[B];h.push(Y+X)}x=N+(x.length>0?" "+x:x)}return x};function ly(){let s=0,c,o,u="";for(;s<arguments.length;)(c=arguments[s++])&&(o=ch(c))&&(u&&(u+=" "),u+=o);return u}const ch=s=>{if(typeof s=="string")return s;let c,o="";for(let u=0;u<s.length;u++)s[u]&&(c=ch(s[u]))&&(o&&(o+=" "),o+=c);return o};function ay(s,...c){let o,u,d,h=m;function m(b){const N=c.reduce((y,v)=>v(y),s());return o=ey(N),u=o.cache.get,d=o.cache.set,h=x,x(b)}function x(b){const N=u(b);if(N)return N;const y=ny(b,o);return d(b,y),y}return function(){return h(ly.apply(null,arguments))}}const Ce=s=>{const c=o=>o[s]||[];return c.isThemeGetter=!0,c},rh=/^\[(?:([a-z-]+):)?(.+)\]$/i,sy=/^\d+\/\d+$/,iy=new Set(["px","full","screen"]),cy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ry=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,oy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yn=s=>ya(s)||iy.has(s)||sy.test(s),$n=s=>za(s,"length",yy),ya=s=>!!s&&!Number.isNaN(Number(s)),Do=s=>za(s,"number",ya),bs=s=>!!s&&Number.isInteger(Number(s)),fy=s=>s.endsWith("%")&&ya(s.slice(0,-1)),le=s=>rh.test(s),Jn=s=>cy.test(s),my=new Set(["length","size","percentage"]),hy=s=>za(s,my,oh),xy=s=>za(s,"position",oh),py=new Set(["image","url"]),by=s=>za(s,py,jy),gy=s=>za(s,"",vy),gs=()=>!0,za=(s,c,o)=>{const u=rh.exec(s);return u?u[1]?typeof c=="string"?u[1]===c:c.has(u[1]):o(u[2]):!1},yy=s=>ry.test(s)&&!oy.test(s),oh=()=>!1,vy=s=>uy.test(s),jy=s=>dy.test(s),Ny=()=>{const s=Ce("colors"),c=Ce("spacing"),o=Ce("blur"),u=Ce("brightness"),d=Ce("borderColor"),h=Ce("borderRadius"),m=Ce("borderSpacing"),x=Ce("borderWidth"),b=Ce("contrast"),N=Ce("grayscale"),y=Ce("hueRotate"),v=Ce("invert"),j=Ce("gap"),R=Ce("gradientColorStops"),T=Ce("gradientColorStopPositions"),k=Ce("inset"),M=Ce("margin"),Y=Ce("opacity"),O=Ce("padding"),G=Ce("saturate"),B=Ce("scale"),X=Ce("sepia"),Q=Ce("skew"),F=Ce("space"),Z=Ce("translate"),ae=()=>["auto","contain","none"],_e=()=>["auto","hidden","clip","visible","scroll"],He=()=>["auto",le,c],K=()=>[le,c],ee=()=>["",yn,$n],Be=()=>["auto",ya,le],it=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],me=()=>["","0",le],ye=()=>["auto","avoid","all","avoid-page","page","left","right","column"],we=()=>[ya,le];return{cacheSize:500,separator:":",theme:{colors:[gs],spacing:[yn,$n],blur:["none","",Jn,le],brightness:we(),borderColor:[s],borderRadius:["none","","full",Jn,le],borderSpacing:K(),borderWidth:ee(),contrast:we(),grayscale:me(),hueRotate:we(),invert:me(),gap:K(),gradientColorStops:[s],gradientColorStopPositions:[fy,$n],inset:He(),margin:He(),opacity:we(),padding:K(),saturate:we(),scale:we(),sepia:me(),skew:we(),space:K(),translate:K()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[Jn]}],"break-after":[{"break-after":ye()}],"break-before":[{"break-before":ye()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...it(),le]}],overflow:[{overflow:_e()}],"overflow-x":[{"overflow-x":_e()}],"overflow-y":[{"overflow-y":_e()}],overscroll:[{overscroll:ae()}],"overscroll-x":[{"overscroll-x":ae()}],"overscroll-y":[{"overscroll-y":ae()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bs,le]}],basis:[{basis:He()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:me()}],shrink:[{shrink:me()}],order:[{order:["first","last","none",bs,le]}],"grid-cols":[{"grid-cols":[gs]}],"col-start-end":[{col:["auto",{span:["full",bs,le]},le]}],"col-start":[{"col-start":Be()}],"col-end":[{"col-end":Be()}],"grid-rows":[{"grid-rows":[gs]}],"row-start-end":[{row:["auto",{span:[bs,le]},le]}],"row-start":[{"row-start":Be()}],"row-end":[{"row-end":Be()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[j]}],"gap-x":[{"gap-x":[j]}],"gap-y":[{"gap-y":[j]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],pr:[{pr:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[M]}],mx:[{mx:[M]}],my:[{my:[M]}],ms:[{ms:[M]}],me:[{me:[M]}],mt:[{mt:[M]}],mr:[{mr:[M]}],mb:[{mb:[M]}],ml:[{ml:[M]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,c]}],"min-w":[{"min-w":[le,c,"min","max","fit"]}],"max-w":[{"max-w":[le,c,"none","full","min","max","fit","prose",{screen:[Jn]},Jn]}],h:[{h:[le,c,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,c,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,c,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,c,"auto","min","max","fit"]}],"font-size":[{text:["base",Jn,$n]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Do]}],"font-family":[{font:[gs]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",le]}],"line-clamp":[{"line-clamp":["none",ya,Do]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",yn,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[s]}],"placeholder-opacity":[{"placeholder-opacity":[Y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[s]}],"text-opacity":[{"text-opacity":[Y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",yn,$n]}],"underline-offset":[{"underline-offset":["auto",yn,le]}],"text-decoration-color":[{decoration:[s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[Y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...it(),xy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},by]}],"bg-color":[{bg:[s]}],"gradient-from-pos":[{from:[T]}],"gradient-via-pos":[{via:[T]}],"gradient-to-pos":[{to:[T]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[h]}],"rounded-s":[{"rounded-s":[h]}],"rounded-e":[{"rounded-e":[h]}],"rounded-t":[{"rounded-t":[h]}],"rounded-r":[{"rounded-r":[h]}],"rounded-b":[{"rounded-b":[h]}],"rounded-l":[{"rounded-l":[h]}],"rounded-ss":[{"rounded-ss":[h]}],"rounded-se":[{"rounded-se":[h]}],"rounded-ee":[{"rounded-ee":[h]}],"rounded-es":[{"rounded-es":[h]}],"rounded-tl":[{"rounded-tl":[h]}],"rounded-tr":[{"rounded-tr":[h]}],"rounded-br":[{"rounded-br":[h]}],"rounded-bl":[{"rounded-bl":[h]}],"border-w":[{border:[x]}],"border-w-x":[{"border-x":[x]}],"border-w-y":[{"border-y":[x]}],"border-w-s":[{"border-s":[x]}],"border-w-e":[{"border-e":[x]}],"border-w-t":[{"border-t":[x]}],"border-w-r":[{"border-r":[x]}],"border-w-b":[{"border-b":[x]}],"border-w-l":[{"border-l":[x]}],"border-opacity":[{"border-opacity":[Y]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[x]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[x]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[Y]}],"divide-style":[{divide:U()}],"border-color":[{border:[d]}],"border-color-x":[{"border-x":[d]}],"border-color-y":[{"border-y":[d]}],"border-color-s":[{"border-s":[d]}],"border-color-e":[{"border-e":[d]}],"border-color-t":[{"border-t":[d]}],"border-color-r":[{"border-r":[d]}],"border-color-b":[{"border-b":[d]}],"border-color-l":[{"border-l":[d]}],"divide-color":[{divide:[d]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[yn,le]}],"outline-w":[{outline:[yn,$n]}],"outline-color":[{outline:[s]}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[s]}],"ring-opacity":[{"ring-opacity":[Y]}],"ring-offset-w":[{"ring-offset":[yn,$n]}],"ring-offset-color":[{"ring-offset":[s]}],shadow:[{shadow:["","inner","none",Jn,gy]}],"shadow-color":[{shadow:[gs]}],opacity:[{opacity:[Y]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[u]}],contrast:[{contrast:[b]}],"drop-shadow":[{"drop-shadow":["","none",Jn,le]}],grayscale:[{grayscale:[N]}],"hue-rotate":[{"hue-rotate":[y]}],invert:[{invert:[v]}],saturate:[{saturate:[G]}],sepia:[{sepia:[X]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[u]}],"backdrop-contrast":[{"backdrop-contrast":[b]}],"backdrop-grayscale":[{"backdrop-grayscale":[N]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[y]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[Y]}],"backdrop-saturate":[{"backdrop-saturate":[G]}],"backdrop-sepia":[{"backdrop-sepia":[X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",le]}],duration:[{duration:we()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:we()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[B]}],"scale-x":[{"scale-x":[B]}],"scale-y":[{"scale-y":[B]}],rotate:[{rotate:[bs,le]}],"translate-x":[{"translate-x":[Z]}],"translate-y":[{"translate-y":[Z]}],"skew-x":[{"skew-x":[Q]}],"skew-y":[{"skew-y":[Q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],accent:[{accent:["auto",s]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le]}],"caret-color":[{caret:[s]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-mr":[{"scroll-mr":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le]}],fill:[{fill:[s,"none"]}],"stroke-w":[{stroke:[yn,$n,Do]}],stroke:[{stroke:[s,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},zy=ay(Ny);function q(...s){return zy(eg(s))}const bm=s=>{let c;const o=new Set,u=(N,y)=>{const v=typeof N=="function"?N(c):N;if(!Object.is(v,c)){const j=c;c=y??(typeof v!="object"||v===null)?v:Object.assign({},c,v),o.forEach(R=>R(c,j))}},d=()=>c,x={setState:u,getState:d,getInitialState:()=>b,subscribe:N=>(o.add(N),()=>o.delete(N))},b=c=s(u,d,x);return x},Sy=(s=>s?bm(s):bm),wy=s=>s;function Ey(s,c=wy){const o=Zi.useSyncExternalStore(s.subscribe,Zi.useCallback(()=>c(s.getState()),[s,c]),Zi.useCallback(()=>c(s.getInitialState()),[s,c]));return Zi.useDebugValue(o),o}const gm=s=>{const c=Sy(s),o=u=>Ey(c,u);return Object.assign(o,c),o},ac=(s=>s?gm(s):gm);function Ty(s,c){let o;try{o=s()}catch{return}return{getItem:d=>{var h;const m=b=>b===null?null:JSON.parse(b,void 0),x=(h=o.getItem(d))!=null?h:null;return x instanceof Promise?x.then(m):m(x)},setItem:(d,h)=>o.setItem(d,JSON.stringify(h,void 0)),removeItem:d=>o.removeItem(d)}}const Ho=s=>c=>{try{const o=s(c);return o instanceof Promise?o:{then(u){return Ho(u)(o)},catch(u){return this}}}catch(o){return{then(u){return this},catch(u){return Ho(u)(o)}}}},Cy=(s,c)=>(o,u,d)=>{let h={storage:Ty(()=>localStorage),partialize:M=>M,version:0,merge:(M,Y)=>({...Y,...M}),...c},m=!1,x=0;const b=new Set,N=new Set;let y=h.storage;if(!y)return s((...M)=>{console.warn(`[zustand persist middleware] Unable to update item '${h.name}', the given storage is currently unavailable.`),o(...M)},u,d);const v=()=>{const M=h.partialize({...u()});return y.setItem(h.name,{state:M,version:h.version})},j=d.setState;d.setState=(M,Y)=>(j(M,Y),v());const R=s((...M)=>(o(...M),v()),u,d);d.getInitialState=()=>R;let T;const k=()=>{var M,Y;if(!y)return;const O=++x;m=!1,b.forEach(B=>{var X;return B((X=u())!=null?X:R)});const G=((Y=h.onRehydrateStorage)==null?void 0:Y.call(h,(M=u())!=null?M:R))||void 0;return Ho(y.getItem.bind(y))(h.name).then(B=>{if(B)if(typeof B.version=="number"&&B.version!==h.version){if(h.migrate){const X=h.migrate(B.state,B.version);return X instanceof Promise?X.then(Q=>[!0,Q]):[!0,X]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,B.state];return[!1,void 0]}).then(B=>{var X;if(O!==x)return;const[Q,F]=B;if(T=h.merge(F,(X=u())!=null?X:R),o(T,!0),Q)return v()}).then(()=>{O===x&&(G==null||G(T,void 0),T=u(),m=!0,N.forEach(B=>B(T)))}).catch(B=>{O===x&&(G==null||G(void 0,B))})};return d.persist={setOptions:M=>{h={...h,...M},M.storage&&(y=M.storage)},clearStorage:()=>{y==null||y.removeItem(h.name)},getOptions:()=>h,rehydrate:()=>k(),hasHydrated:()=>m,onHydrate:M=>(b.add(M),()=>{b.delete(M)}),onFinishHydration:M=>(N.add(M),()=>{N.delete(M)})},h.skipHydration||k(),T||R},Ry=Cy,ky=[{id:"production",name:"production",description:"live deployments"},{id:"staging",name:"staging",description:"pre-prod"},{id:"development",name:"development",description:"local + branch deploys"}],jn=ac()(Ry(s=>({current:"production",available:ky,setCurrent:c=>s({current:c})}),{name:"blok-studio:env-scope"}));function Dy(){const s=jn(x=>x.current),c=jn(x=>x.available),o=jn(x=>x.setCurrent),u=c.find(x=>x.id===s)??c[0],[d,h]=A.useState(!1),m=A.useRef(null);return A.useEffect(()=>{if(!d)return;const x=N=>{var y;(y=m.current)!=null&&y.contains(N.target)||h(!1)},b=N=>{N.key==="Escape"&&h(!1)};return window.addEventListener("mousedown",x),window.addEventListener("keydown",b),()=>{window.removeEventListener("mousedown",x),window.removeEventListener("keydown",b)}},[d]),u?l.jsxs("div",{ref:m,className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>h(x=>!x),className:q("flex items-center gap-1.5 rounded-md border border-zinc-800 bg-raised px-2 py-1 text-xs text-zinc-100 hover:bg-hover transition-colors",d&&"bg-hover"),"aria-haspopup":"listbox","aria-expanded":d,"aria-label":`Environment: ${u.name}`,children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blok-green-500",style:{boxShadow:"0 0 0 2px rgba(43, 205, 113, 0.18)"}}),l.jsx("span",{className:"font-medium",children:u.name}),l.jsx(Ns,{className:q("w-3 h-3 text-zinc-500 transition-transform",d&&"rotate-180")})]}),d&&l.jsxs("div",{role:"menu","aria-label":"Environment",className:"absolute left-0 top-full mt-1.5 z-50 w-56 rounded-md border border-zinc-800 bg-overlay shadow-xl py-1",children:[l.jsx("div",{className:"px-3 pt-1.5 pb-1 text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold",children:"Environment"}),c.map(x=>{const b=x.id===s;return l.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":b,onClick:()=>{o(x.id),h(!1)},className:q("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",b?"bg-blok-green-500/10 text-zinc-100":"text-zinc-300 hover:bg-hover hover:text-zinc-100"),children:[l.jsx("span",{className:q("h-1.5 w-1.5 rounded-full shrink-0",b?"bg-blok-green-500":"bg-zinc-700"),style:b?{boxShadow:"0 0 0 2px rgba(43, 205, 113, 0.18)"}:void 0}),l.jsx("span",{className:"font-medium",children:x.name}),x.description&&l.jsxs("span",{className:"text-[11px] text-zinc-500 truncate",children:["· ",x.description]}),b&&l.jsx(va,{className:"ml-auto w-3.5 h-3.5 text-blok-green-500 shrink-0"})]},x.id)}),l.jsxs("div",{className:"mt-1 px-3 py-1.5 text-[10.5px] font-mono text-zinc-600 border-t border-zinc-800",children:["Set ",l.jsx("span",{className:"text-zinc-400",children:"BLOK_ENV"})," on the trigger to scope new runs."]})]})]}):null}const uh="/__blok";async function se(s,c){const o=await fetch(`${uh}${s}`,{...c,headers:{Accept:"application/json",...c==null?void 0:c.headers}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Wo(o.status,u.error||o.statusText)}return o.json()}class Wo extends Error{constructor(c,o){super(o),this.status=c,this.name="ApiError"}}function dh(){return se("/health")}function fh(){return se("/config")}function mh(){return se("/workflows")}function hh(s){return se(`/workflows/${encodeURIComponent(s)}`)}function xh(s){return se(`/workflows/${encodeURIComponent(s)}/sample`,{method:"DELETE"})}function ph(s,c){const o=new URLSearchParams;c!=null&&c.status&&o.set("status",c.status),c!=null&&c.limit&&o.set("limit",String(c.limit)),c!=null&&c.offset&&o.set("offset",String(c.offset)),c!=null&&c.sort&&o.set("sort",c.sort),c!=null&&c.env&&o.set("env",c.env);const u=o.toString();return se(`/workflows/${encodeURIComponent(s)}/runs${u?`?${u}`:""}`)}function bh(s){const c=new URLSearchParams;if(s!=null&&s.workflow&&c.set("workflow",s.workflow),s!=null&&s.status&&c.set("status",s.status),s!=null&&s.limit&&c.set("limit",String(s.limit)),s!=null&&s.offset&&c.set("offset",String(s.offset)),s!=null&&s.sort&&c.set("sort",s.sort),s!=null&&s.env&&c.set("env",s.env),s!=null&&s.tags&&s.tags.length>0&&c.set("tags",s.tags.join(",")),s!=null&&s.metadata)if(Array.isArray(s.metadata))for(const u of s.metadata){const d=u.op==="eq"?"":`__${u.op}`,h=Array.isArray(u.value)?u.value.join(","):u.value;c.set(`metadata.${u.key}${d}`,h)}else for(const[u,d]of Object.entries(s.metadata))c.set(`metadata.${u}`,d);const o=c.toString();return se(`/runs${o?`?${o}`:""}`)}function gh(s){return se(`/runs/${encodeURIComponent(s)}`)}function yh(s,c){const o=c?`?since=${c}`:"";return se(`/runs/${encodeURIComponent(s)}/events${o}`)}function Ay(s){return se(`/runs/${encodeURIComponent(s)}/subruns`)}function vh(s){const c=s!=null&&s.env?`?env=${encodeURIComponent(s.env)}`:"";return se(`/queues${c}`)}function jh(s){const c=new URLSearchParams;s!=null&&s.env&&c.set("env",s.env),s!=null&&s.limit&&c.set("limit",String(s.limit));const o=c.toString();return se(`/deployments${o?`?${o}`:""}`)}function Nh(s){const c=new URLSearchParams;s!=null&&s.workflow&&c.set("workflow",s.workflow),s!=null&&s.level&&c.set("level",s.level),s!=null&&s.q&&c.set("q",s.q),(s==null?void 0:s.since)!==void 0&&c.set("since",String(s.since)),(s==null?void 0:s.limit)!==void 0&&c.set("limit",String(s.limit)),s!=null&&s.env&&c.set("env",s.env);const o=c.toString();return se(`/logs${o?`?${o}`:""}`)}function zh(){return se("/runs",{method:"DELETE"})}function Io(s,c){return se(`/runs/${encodeURIComponent(s)}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:c?JSON.stringify(c):void 0})}function Sh(s){return se(`/runs/${encodeURIComponent(s)}/cancel`,{method:"POST"})}function wh(s){const c=new URLSearchParams;s!=null&&s.status&&s.status.length>0&&c.set("status",s.status.join(",")),s!=null&&s.workflowName&&c.set("workflowName",s.workflowName),s!=null&&s.limit&&c.set("limit",String(s.limit)),s!=null&&s.offset&&c.set("offset",String(s.offset));const o=c.toString();return se(`/scheduled${o?`?${o}`:""}`)}function Eh(){return se("/routing")}function Th(){return se("/saved-filters")}function Ch(s){return se("/saved-filters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}function Rh(s){return se(`/saved-filters/${encodeURIComponent(s)}`,{method:"DELETE"})}function kh(s){return se(`/search?q=${encodeURIComponent(s)}`)}function Dh(s,c){return se(`/runs/diff?a=${encodeURIComponent(s)}&b=${encodeURIComponent(c)}`)}function My(){return se("/tags")}function Ah(s,c){return se(`/runs/${encodeURIComponent(s)}/tags`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:c})})}function Mh(s,c){return se(`/runs/${encodeURIComponent(s)}/tags/${encodeURIComponent(c)}`,{method:"DELETE"})}function Oh(s){const c=s?`?workflow=${encodeURIComponent(s)}`:"";return se(`/metrics${c}`)}async function _h(s){const c=await fetch(s.path,{method:s.method,headers:{"Content-Type":"application/json",...s.headers},body:s.method!=="GET"&&s.method!=="HEAD"?s.body:void 0}),o={};c.headers.forEach((d,h)=>{o[h]=d});const u=await c.text();return{status:c.status,headers:o,body:u}}function Ss(s,c){const o=document.createElement("a");o.href=`${uh}${s}`,o.download=c,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o)}function Po(s){Ss(`/runs/${encodeURIComponent(s)}/export?format=json`,`blok-run-${s}.json`)}function eu(s){Ss(`/runs/${encodeURIComponent(s)}/export?format=csv`,`blok-run-${s}.csv`)}function Uh(s){const c=new URLSearchParams;c.set("format","json"),s!=null&&s.workflow&&c.set("workflow",s.workflow),s!=null&&s.status&&c.set("status",s.status),Ss(`/runs/export?${c.toString()}`,`blok-runs-${Date.now()}.json`)}function Lh(s){const c=new URLSearchParams;c.set("format","csv"),s!=null&&s.workflow&&c.set("workflow",s.workflow),s!=null&&s.status&&c.set("status",s.status),Ss(`/runs/export?${c.toString()}`,`blok-runs-${Date.now()}.csv`)}function qh(){return se("/webhooks")}function Hh(s){return se("/webhooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}function Bh(s){return se(`/webhooks/${encodeURIComponent(s)}`,{method:"DELETE"})}function Gh(){return se("/dashboards")}function Oy(s){return se(`/dashboards/${encodeURIComponent(s)}`)}function Qh(s){return se("/dashboards",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}function Yh(s,c){return se(`/dashboards/${encodeURIComponent(s)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})}function Kh(s){return se(`/dashboards/${encodeURIComponent(s)}`,{method:"DELETE"})}function Xh(s){return se(`/dashboards/${encodeURIComponent(s)}/duplicate`,{method:"POST"})}function Vh(s,c){return se(`/runs/${encodeURIComponent(s)}/explain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c?{nodeId:c}:{})})}function Zh(){return se("/concurrency/health")}function $h(){return se("/concurrency/state")}const _y=Object.freeze(Object.defineProperty({__proto__:null,ApiError:Wo,addRunTags:Ah,cancelRun:Sh,clearRuns:zh,createDashboard:Qh,createWebhook:Hh,deleteDashboard:Kh,deleteSavedFilter:Rh,deleteWebhook:Bh,deleteWorkflowSample:xh,downloadExport:Ss,duplicateDashboard:Xh,explainRunError:Vh,exportRunCsv:eu,exportRunJson:Po,exportRunsCsv:Lh,exportRunsJson:Uh,fetchConcurrencyHealth:Zh,fetchConcurrencyState:$h,fetchConfig:fh,fetchDashboard:Oy,fetchDashboards:Gh,fetchDeployments:jh,fetchHealth:dh,fetchLogs:Nh,fetchMetrics:Oh,fetchQueues:vh,fetchRoutingDiagnostics:Eh,fetchRunDetail:gh,fetchRunDiff:Dh,fetchRunEvents:yh,fetchRuns:bh,fetchSavedFilters:Th,fetchScheduledDispatches:wh,fetchSubRuns:Ay,fetchTags:My,fetchWebhooks:qh,fetchWorkflowDetail:hh,fetchWorkflowRuns:ph,fetchWorkflows:mh,removeRunTag:Mh,replayRun:Io,searchTraces:kh,sendWorkflowRequest:_h,updateDashboard:Yh,upsertSavedFilter:Ch},Symbol.toStringTag,{value:"Module"}));function tu(){return qe({queryKey:["workflows"],queryFn:mh,refetchInterval:5e3})}function Uy(s){return qe({queryKey:["workflow",s],queryFn:()=>hh(s),enabled:!!s})}function Ly(s){const c=ht();return Lt({mutationFn:()=>xh(s),onSuccess:()=>{c.invalidateQueries({queryKey:["workflow",s]})}})}const qy={pending:"text-zinc-400 bg-zinc-400/10",running:"text-blue-400 bg-blue-400/10",completed:"text-green-400 bg-green-400/10",failed:"text-red-400 bg-red-400/10",cancelled:"text-purple-400 bg-purple-400/10",skipped:"text-zinc-500 bg-zinc-500/10",throttled:"text-amber-300 bg-amber-300/10",delayed:"text-yellow-400 bg-yellow-400/10",expired:"text-zinc-500 bg-zinc-500/10",debounced:"text-cyan-400 bg-cyan-400/10",queued:"text-lime-300 bg-lime-300/10",crashed:"text-red-500 bg-red-500/10",timedOut:"text-orange-400 bg-orange-400/10"},ws={pending:"bg-zinc-400",running:"bg-blue-400",completed:"bg-green-400",failed:"bg-red-400",cancelled:"bg-purple-400",skipped:"bg-zinc-500",throttled:"bg-amber-300",delayed:"bg-yellow-400",expired:"bg-zinc-500",debounced:"bg-cyan-400",queued:"bg-lime-300",crashed:"bg-red-500",timedOut:"bg-orange-400"},Hy={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled",skipped:"Skipped",throttled:"Throttled",delayed:"Delayed",expired:"Expired",debounced:"Debounced",queued:"Queued",crashed:"Crashed",timedOut:"Timed Out"},Jh={RUN_STARTED:"Run Started",RUN_COMPLETED:"Run Completed",RUN_FAILED:"Run Failed",NODE_STARTED:"Node Started",NODE_COMPLETED:"Node Completed",NODE_FAILED:"Node Failed",NODE_SKIPPED:"Node Skipped",VARS_UPDATED:"Vars Updated",LOG_ENTRY:"Log Entry",NODE_PROGRESS:"Node Progress",NODE_PARTIAL_RESULT:"Node Partial Result",NODE_CACHED:"Node Cached",NODE_ATTEMPT_FAILED:"Attempt Failed",RUN_THROTTLED:"Run Throttled",RUN_DELAYED:"Run Delayed",RUN_EXPIRED:"Run Expired",RUN_DEBOUNCED:"Run Debounced",RUN_QUEUED:"Run Queued",RUN_CANCELLED:"Run Cancelled",RUN_CRASHED:"Run Crashed",RUN_TIMED_OUT:"Run Timed Out"},Fh={RUN_STARTED:"text-blue-400 bg-blue-400/10",RUN_COMPLETED:"text-green-400 bg-green-400/10",RUN_FAILED:"text-red-400 bg-red-400/10",NODE_STARTED:"text-blue-300 bg-blue-300/10",NODE_COMPLETED:"text-green-300 bg-green-300/10",NODE_FAILED:"text-red-300 bg-red-300/10",NODE_SKIPPED:"text-zinc-400 bg-zinc-400/10",VARS_UPDATED:"text-yellow-400 bg-yellow-400/10",LOG_ENTRY:"text-zinc-300 bg-zinc-300/10",NODE_PROGRESS:"text-cyan-400 bg-cyan-400/10",NODE_PARTIAL_RESULT:"text-cyan-300 bg-cyan-300/10",NODE_CACHED:"text-emerald-400 bg-emerald-400/10",NODE_ATTEMPT_FAILED:"text-amber-400 bg-amber-400/10",RUN_THROTTLED:"text-amber-300 bg-amber-300/10",RUN_DELAYED:"text-yellow-400 bg-yellow-400/10",RUN_EXPIRED:"text-zinc-500 bg-zinc-500/10",RUN_DEBOUNCED:"text-cyan-400 bg-cyan-400/10",RUN_QUEUED:"text-lime-300 bg-lime-300/10",RUN_CANCELLED:"text-purple-400 bg-purple-400/10",RUN_CRASHED:"text-red-500 bg-red-500/10",RUN_TIMED_OUT:"text-orange-400 bg-orange-400/10"},By={debug:"text-zinc-400",info:"text-blue-400",warn:"text-amber-400",error:"text-red-400"};function Gy(){const s=$b(),{data:c}=tu(),o=[{to:"/",label:"Overview",icon:ng},{to:"/dashboards",label:"Dashboards",icon:Jm},{to:"/runs",label:"All Runs",icon:In},{to:"/scheduled",label:"Scheduled",icon:_o},{to:"/logs",label:"Logs",icon:lg},{to:"/queues",label:"Queues",icon:ag},{to:"/deployments",label:"Deployments",icon:El},{to:"/metrics",label:"Metrics",icon:Qo},{to:"/webhooks",label:"Webhooks",icon:zs}];return l.jsxs("aside",{className:"w-56 border-r border-zinc-800 bg-canvas flex flex-col h-full",children:[l.jsxs("div",{className:"px-3 pt-3 pb-2 border-b border-zinc-800 space-y-2",children:[l.jsxs(De,{to:"/",className:"flex items-center gap-2 px-1.5 py-1 rounded",children:[l.jsx(Xg,{className:"h-4 w-auto shrink-0"}),l.jsx("span",{className:"text-zinc-100 font-semibold text-sm tracking-tight",children:"blok"})]}),l.jsx(Dy,{})]}),l.jsxs("nav",{className:"flex-1 overflow-y-auto py-2 px-2",children:[l.jsx("div",{className:"space-y-0.5",children:o.map(({to:u,label:d,icon:h})=>{const m=s({to:u,fuzzy:u!=="/"})||u==="/"&&location.pathname==="/";return l.jsxs(De,{to:u,className:q("relative flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm transition-colors",m?"bg-blok-green-500/10 text-zinc-100 before:content-[''] before:absolute before:left-0 before:top-2 before:bottom-2 before:w-0.5 before:bg-blok-green-500 before:rounded-r":"text-zinc-400 hover:text-zinc-200 hover:bg-hover"),children:[l.jsx(h,{className:q("w-4 h-4",m?"text-zinc-100":"text-zinc-500")}),d]},u)})}),c&&c.length>0&&l.jsxs("div",{className:"mt-6",children:[l.jsx("h3",{className:"px-2.5 mb-1 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Workflows"}),l.jsx("div",{className:"space-y-0.5",children:c.map(u=>{const d=!!s({to:"/workflows/$name",params:{name:u.name},fuzzy:!0});return l.jsxs(De,{to:"/workflows/$name",params:{name:u.name},className:q("relative flex items-center justify-between rounded-md px-2.5 py-1.5 text-sm transition-colors",d?"bg-blok-green-500/10 text-zinc-100 before:content-[''] before:absolute before:left-0 before:top-2 before:bottom-2 before:w-0.5 before:bg-blok-green-500 before:rounded-r":"text-zinc-400 hover:text-zinc-200 hover:bg-hover"),children:[l.jsx("span",{className:"truncate",children:u.name}),u.lastRunStatus&&l.jsx("span",{className:q("w-2 h-2 rounded-full shrink-0",ws[u.lastRunStatus],u.lastRunStatus==="running"&&"animate-pulse-dot")})]},u.name)})})]})]}),l.jsxs("div",{className:"border-t border-zinc-800 p-2 space-y-0.5",children:[l.jsxs("button",{type:"button",onClick:()=>window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0})),className:"w-full flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm text-zinc-500 hover:text-zinc-300 hover:bg-hover transition-colors",children:[l.jsx(Yo,{className:"w-4 h-4"}),l.jsx("span",{className:"flex-1 text-left",children:"Search"}),l.jsxs("kbd",{className:"text-[10px] px-1 py-0.5 rounded bg-raised border border-zinc-800 text-zinc-500",children:["⌘","K"]})]}),l.jsxs(De,{to:"/settings",className:"flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm text-zinc-500 hover:text-zinc-300 hover:bg-hover transition-colors [&.active]:bg-blok-green-500/10 [&.active]:text-zinc-100",activeProps:{className:"active"},children:[l.jsx(sg,{className:"w-4 h-4"}),"Settings"]})]})]})}function ge(s){if(s==null)return"—";if(s<1)return"<1ms";if(s<1e3)return`${Math.round(s)}ms`;if(s<6e4)return`${(s/1e3).toFixed(1)}s`;const c=Math.floor(s/6e4),o=Math.round(s%6e4/1e3);return`${c}m ${o}s`}function el(s){const c=Date.now()-s;return c<1e3?"just now":c<6e4?`${Math.floor(c/1e3)}s ago`:c<36e5?`${Math.floor(c/6e4)}m ago`:c<864e5?`${Math.floor(c/36e5)}h ago`:`${Math.floor(c/864e5)}d ago`}function sc(s){return new Date(s).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Pn(s){return s===0?"0%":s<.01?"<1%":`${(s*100).toFixed(1)}%`}let Qy=0;const js=ac((s,c)=>({notifications:[],enabled:!0,desktopEnabled:!1,addNotification:o=>{const u={...o,id:`notif_${++Qy}`,timestamp:Date.now(),read:!1};if(s(d=>({notifications:[u,...d.notifications].slice(0,100)})),c().desktopEnabled&&document.hidden)try{new window.Notification(u.title,{body:u.message,icon:"/favicon.svg",tag:u.runId||u.id})}catch{}},markRead:o=>s(u=>({notifications:u.notifications.map(d=>d.id===o?{...d,read:!0}:d)})),markAllRead:()=>s(o=>({notifications:o.notifications.map(u=>({...u,read:!0}))})),clearAll:()=>s({notifications:[]}),setEnabled:o=>s({enabled:o}),setDesktopEnabled:o=>s({desktopEnabled:o})}));async function Yy(){return"Notification"in window?Notification.permission==="granted"?!0:Notification.permission==="denied"?!1:await Notification.requestPermission()==="granted":!1}function Ky(){const{notifications:s}=js(),[c,o]=A.useState([]);A.useEffect(()=>{const d=s[0];if(!d||d.read||Date.now()-d.timestamp>5e3)return;o(m=>m.some(x=>x.id===d.id)?m:[d,...m].slice(0,3));const h=setTimeout(()=>{o(m=>m.filter(x=>x.id!==d.id))},5e3);return()=>clearTimeout(h)},[s]);const u=d=>{o(h=>h.filter(m=>m.id!==d))};return c.length===0?null:l.jsx("div",{className:"fixed bottom-8 right-4 z-50 flex flex-col gap-2 w-80",children:c.map(d=>l.jsx(Xy,{toast:d,onDismiss:u},d.id))})}function Xy({toast:s,onDismiss:c}){const o=Rl(),u={success:l.jsx(nc,{className:"w-4 h-4 text-green-400 shrink-0"}),error:l.jsx(Fm,{className:"w-4 h-4 text-red-400 shrink-0"}),info:l.jsx(cg,{className:"w-4 h-4 text-blue-400 shrink-0"})};return l.jsx("div",{className:q("bg-overlay border border-zinc-800 rounded-lg shadow-lg p-3","animate-slide-in cursor-pointer hover:bg-hover/80 transition-colors"),role:"presentation",onClick:()=>{s.runId&&o({to:"/runs/$runId",params:{runId:s.runId}}),c(s.id)},children:l.jsxs("div",{className:"flex items-start gap-2",children:[u[s.type],l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:s.title}),s.message&&l.jsx("p",{className:"text-xs text-zinc-400 mt-0.5 truncate",children:s.message})]}),l.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),c(s.id)},className:"p-0.5 text-zinc-500 hover:text-zinc-300 transition-colors","aria-label":"Dismiss",children:l.jsx(Kt,{className:"w-3 h-3"})})]})})}function Vy(){const{notifications:s,enabled:c,desktopEnabled:o,setEnabled:u,setDesktopEnabled:d,markAllRead:h,clearAll:m}=js(),[x,b]=A.useState(!1),N=Rl(),y=s.filter(j=>!j.read).length,v=async()=>{if(o)d(!1);else{const j=await Yy();d(j)}};return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>b(!x),className:"relative flex items-center gap-1 text-zinc-500 hover:text-zinc-300 transition-colors","aria-label":"Notifications",children:[l.jsx(cm,{className:"w-3 h-3"}),y>0&&l.jsx("span",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 rounded-full text-[8px] text-white flex items-center justify-center",children:y>9?"9+":y})]}),x&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",role:"presentation",onClick:()=>b(!1)}),l.jsxs("div",{className:"absolute bottom-6 right-0 z-50 w-72 bg-overlay border border-zinc-800 rounded-lg shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-zinc-800",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-300",children:"Notifications"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:()=>u(!c),className:"text-xs text-zinc-500 hover:text-zinc-300",title:c?"Mute notifications":"Enable notifications",children:c?l.jsx(cm,{className:"w-3 h-3"}):l.jsx(ig,{className:"w-3 h-3"})}),l.jsxs("button",{type:"button",onClick:v,className:q("text-[10px] px-1.5 py-0.5 rounded",o?"bg-blue-500/20 text-blue-400":"bg-zinc-800 text-zinc-500 hover:text-zinc-300"),children:["Desktop ",o?"ON":"OFF"]})]})]}),l.jsx("div",{className:"max-h-64 overflow-y-auto",children:s.length===0?l.jsx("div",{className:"px-3 py-6 text-center text-xs text-zinc-600",children:"No notifications"}):s.slice(0,20).map(j=>l.jsxs("button",{type:"button",onClick:()=>{j.runId&&(N({to:"/runs/$runId",params:{runId:j.runId}}),b(!1))},className:q("w-full text-left px-3 py-2 hover:bg-zinc-800/50 transition-colors border-b border-zinc-800/50",!j.read&&"bg-zinc-800/30"),children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[!j.read&&l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 shrink-0"}),l.jsx("span",{className:"text-xs text-zinc-300 truncate",children:j.title}),l.jsx("span",{className:"text-[10px] text-zinc-600 ml-auto shrink-0",children:el(j.timestamp)})]}),j.message&&l.jsx("p",{className:"text-[10px] text-zinc-500 mt-0.5 truncate",children:j.message})]},j.id))}),s.length>0&&l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-t border-zinc-800",children:[l.jsx("button",{type:"button",onClick:h,className:"text-[10px] text-zinc-500 hover:text-zinc-300",children:"Mark all read"}),l.jsx("button",{type:"button",onClick:m,className:"text-[10px] text-zinc-500 hover:text-zinc-300",children:"Clear all"})]})]})]})]})}const Sl=ac(s=>({status:"disconnected",activeStreams:0,setStatus:c=>s({status:c}),incrementStreams:()=>s(c=>({activeStreams:c.activeStreams+1})),decrementStreams:()=>s(c=>({activeStreams:Math.max(0,c.activeStreams-1)}))}));function Zy(){const{status:s,activeStreams:c}=Sl(),o={connected:{icon:rg,label:"Connected",className:"text-blok-green-500"},connecting:{icon:Oe,label:"Connecting...",className:"text-yellow-400 animate-spin"},disconnected:{icon:rm,label:"Disconnected",className:"text-zinc-500"},error:{icon:rm,label:"Connection error",className:"text-red-400"}},{icon:u,label:d,className:h}=o[s];return l.jsxs("div",{className:"h-6 border-t border-zinc-800 bg-canvas flex items-center px-3 text-[11px]",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(u,{className:q("w-3 h-3",h)}),l.jsx("span",{className:"text-zinc-500",children:d})]}),c>0&&l.jsxs("span",{className:"ml-3 text-zinc-600",children:[c," active stream",c>1?"s":""]}),l.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[l.jsx(Vy,{}),l.jsx("span",{className:"text-zinc-600",children:"Blok Studio v0.1.0"})]})]})}function $y(){const[s,c]=A.useState(!1),[o,u]=A.useState(""),[d,h]=A.useState({workflows:[],runs:[]}),[m,x]=A.useState(0),[b,N]=A.useState(!1),y=A.useRef(null),v=Rl(),j=d.workflows.length+d.runs.length;A.useEffect(()=>{const k=M=>{(M.metaKey||M.ctrlKey)&&M.key==="k"&&(M.preventDefault(),c(Y=>!Y)),M.key==="Escape"&&s&&c(!1)};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[s]),A.useEffect(()=>{s&&(u(""),h({workflows:[],runs:[]}),x(0),requestAnimationFrame(()=>{var k;return(k=y.current)==null?void 0:k.focus()}))},[s]),A.useEffect(()=>{if(!o.trim()){h({workflows:[],runs:[]}),x(0);return}const k=setTimeout(async()=>{N(!0);try{const M=await kh(o);h(M),x(0)}catch{h({workflows:[],runs:[]})}finally{N(!1)}},200);return()=>clearTimeout(k)},[o]);const R=A.useCallback(k=>{const M=d.workflows.length;if(k<M){const Y=d.workflows[k];Y&&v({to:"/workflows/$name",params:{name:Y.name}})}else{const Y=d.runs[k-M];Y&&v({to:"/runs/$runId",params:{runId:Y.id}})}c(!1)},[d,v]),T=k=>{switch(k.key){case"ArrowDown":k.preventDefault(),x(M=>(M+1)%Math.max(j,1));break;case"ArrowUp":k.preventDefault(),x(M=>(M-1+Math.max(j,1))%Math.max(j,1));break;case"Enter":k.preventDefault(),j>0&&R(m);break}};return s?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",role:"presentation",onClick:()=>c(!1)}),l.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh] pointer-events-none",children:l.jsxs("dialog",{open:!0,className:"relative w-full max-w-lg bg-overlay border border-zinc-800 rounded-xl shadow-2xl overflow-hidden pointer-events-auto","aria-label":"Search",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-zinc-800",children:[l.jsx(Yo,{className:"w-4 h-4 text-zinc-500 shrink-0"}),l.jsx("input",{ref:y,value:o,onChange:k=>u(k.target.value),onKeyDown:T,placeholder:"Search workflows, runs, errors...",className:"flex-1 bg-transparent text-sm text-zinc-200 placeholder-zinc-500 outline-none"}),l.jsx("kbd",{className:"hidden sm:inline-flex items-center gap-0.5 rounded bg-zinc-800 px-1.5 py-0.5 text-[10px] text-zinc-500 border border-zinc-700",children:"ESC"})]}),l.jsxs("div",{className:"max-h-80 overflow-y-auto",children:[b&&o&&l.jsx("div",{className:"px-4 py-6 text-center text-xs text-zinc-500",children:"Searching..."}),!b&&o&&j===0&&l.jsxs("div",{className:"px-4 py-6 text-center text-xs text-zinc-500",children:['No results for "',o,'"']}),!b&&!o&&l.jsx("div",{className:"px-4 py-6 text-center text-xs text-zinc-500",children:"Type to search workflows, runs, and errors"}),d.workflows.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-zinc-600 bg-zinc-900/50",children:"Workflows"}),d.workflows.map((k,M)=>l.jsx(Jy,{workflow:k,selected:m===M,onClick:()=>R(M)},k.name))]}),d.runs.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-zinc-600 bg-zinc-900/50",children:"Runs"}),d.runs.map((k,M)=>{const Y=d.workflows.length+M;return l.jsx(Fy,{run:k,selected:m===Y,onClick:()=>R(Y)},k.id)})]})]}),l.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 border-t border-zinc-800 text-[10px] text-zinc-600",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"px-1 py-0.5 rounded bg-zinc-800 border border-zinc-700",children:"↑↓"})," Navigate"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"px-1 py-0.5 rounded bg-zinc-800 border border-zinc-700",children:"↵"})," Open"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"px-1 py-0.5 rounded bg-zinc-800 border border-zinc-700",children:"esc"})," Close"]})]})]})})]}):null}function Jy({workflow:s,selected:c,onClick:o}){return l.jsxs("button",{type:"button",onClick:o,className:q("w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors",c?"bg-zinc-800":"hover:bg-zinc-800/50"),children:[l.jsx(ga,{className:"w-4 h-4 text-zinc-500 shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm text-zinc-200",children:s.name}),l.jsxs("div",{className:"text-[11px] text-zinc-500",children:[s.triggerTypes.join(", ")," · ",s.totalRuns," runs · avg ",ge(s.avgDurationMs)]})]}),c&&l.jsx(Ko,{className:"w-3 h-3 text-zinc-500 shrink-0"})]})}function Fy({run:s,selected:c,onClick:o}){return l.jsxs("button",{type:"button",onClick:o,className:q("w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors",c?"bg-zinc-800":"hover:bg-zinc-800/50"),children:[l.jsx(In,{className:"w-4 h-4 text-zinc-500 shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-zinc-200",children:s.workflowName}),l.jsx("span",{className:"text-[11px] text-zinc-500 font-mono",children:s.id.slice(0,12)}),l.jsx("span",{className:q("w-2 h-2 rounded-full shrink-0",ws[s.status])})]}),l.jsxs("div",{className:"text-[11px] text-zinc-500",children:[s.triggerSummary," · ",ge(s.durationMs)," · ",el(s.startedAt),s.error&&l.jsxs("span",{className:"text-red-400",children:[" · ",s.error.message.slice(0,60)]})]})]}),c&&l.jsx(Ko,{className:"w-3 h-3 text-zinc-500 shrink-0"})]})}class Wy extends A.Component{constructor(o){super(o);im(this,"handleRetry",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}componentDidCatch(o,u){console.error("[ErrorBoundary]",o,u)}render(){var o;return this.state.hasError?this.props.fallback?this.props.fallback:l.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[200px] gap-4 p-8",children:[l.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[l.jsx(lc,{className:"w-6 h-6"}),l.jsx("h2",{className:"text-lg font-semibold",children:"Something went wrong"})]}),l.jsx("p",{className:"text-sm text-zinc-400 text-center max-w-md",children:((o=this.state.error)==null?void 0:o.message)||"An unexpected error occurred while rendering this component."}),l.jsxs("button",{type:"button",onClick:this.handleRetry,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium bg-zinc-800 text-zinc-200 hover:bg-zinc-700 transition-colors border border-zinc-700",children:[l.jsx(Xo,{className:"w-3.5 h-3.5"}),"Retry"]})]}):this.props.children}}const Iy={RUN_COMPLETED:"completed",RUN_FAILED:"failed",RUN_CRASHED:"crashed",RUN_TIMED_OUT:"timedOut",RUN_THROTTLED:"throttled",RUN_CANCELLED:"cancelled",RUN_EXPIRED:"expired"},Py={RUN_QUEUED:"queued",RUN_DELAYED:"delayed"};function ev(s){return s<1e3?`${Math.round(s)}ms`:`${(s/1e3).toFixed(1)}s`}function tv(s){var d;const c=s.workflowName,o=s.payload,u=(d=o==null?void 0:o.error)==null?void 0:d.message;switch(s.type){case"RUN_COMPLETED":return{type:"success",title:`${c} completed`,message:o!=null&&o.durationMs?`Finished in ${ev(o.durationMs)}`:"Run completed successfully"};case"RUN_FAILED":return{type:"error",title:`${c} failed`,message:u||"Run failed with an error"};case"RUN_CRASHED":return{type:"error",title:`${c} crashed`,message:u||"Process crashed (uncaught error / OOM / signal)"};case"RUN_TIMED_OUT":return{type:"error",title:`${c} timed out`,message:"A step exceeded its maxDuration"};case"RUN_CANCELLED":return{type:"info",title:`${c} cancelled`,message:"Run was cancelled"};default:return null}}const Wh="/__blok";function nv(s,c){const o=`${Wh}/runs/${encodeURIComponent(s)}/stream`;return Ih(o,c)}function lv(s,c){let o=`${Wh}/stream`;return Ih(o,s)}const av=["RUN_STARTED","RUN_COMPLETED","RUN_FAILED","RUN_THROTTLED","RUN_DELAYED","RUN_EXPIRED","RUN_DEBOUNCED","RUN_QUEUED","RUN_CANCELLED","RUN_CRASHED","RUN_TIMED_OUT","NODE_STARTED","NODE_COMPLETED","NODE_FAILED","NODE_SKIPPED","NODE_CACHED","NODE_ATTEMPT_FAILED","NODE_PROGRESS","NODE_PARTIAL_RESULT","VARS_UPDATED","LOG_ENTRY"],sv=10,iv=1e3,cv=3e4;function Ih(s,c){let o=null,u=!1,d=0,h=null,m=null,x=!1;const b=c.timeout??1e4;function N(){if(x)return;o=new EventSource(s),u=!1,m=setTimeout(()=>{var T;!u&&!x&&(o==null||o.close(),(T=c.onError)==null||T.call(c,new Event("timeout")),y())},b);const j=()=>{var T;u||(u=!0,d=0,m&&(clearTimeout(m),m=null),(T=c.onOpen)==null||T.call(c))};o.onopen=j,o.addEventListener("connected",j),o.onerror=()=>{var T;x||(o==null||o.close(),m&&(clearTimeout(m),m=null),(T=c.onError)==null||T.call(c,new Event("error")),y())};const R=T=>{try{const k=JSON.parse(T.data);c.onEvent(k)}catch{}};for(const T of av)o.addEventListener(T,R);o.addEventListener("stream-end",()=>{var T;(T=c.onEnd)==null||T.call(c),v()})}function y(){if(x||d>=sv)return;const j=Math.min(iv*2**d,cv);d++,h=setTimeout(N,j)}function v(){x=!0,o==null||o.close(),o=null,h&&(clearTimeout(h),h=null),m&&(clearTimeout(m),m=null)}return N(),v}const Ph=ac(s=>({events:[],maxEvents:50,pushEvent:c=>s(o=>{const u=[c,...o.events];return{events:u.length>o.maxEvents?u.slice(0,o.maxEvents):u}})}));function rv(s=!0){const c=ht(),o=Sl(N=>N.setStatus),u=Sl(N=>N.incrementStreams),d=Sl(N=>N.decrementStreams),h=js(N=>N.addNotification),m=Ph(N=>N.pushEvent),x=A.useRef(js.getState().enabled);A.useEffect(()=>js.subscribe(N=>{x.current=N.enabled}),[]);const b=A.useRef(null);A.useEffect(()=>{if(!s)return;u(),o("connecting");const N=()=>{b.current||(b.current=setTimeout(()=>{b.current=null,c.invalidateQueries({queryKey:["workflows"]}),c.invalidateQueries({queryKey:["runs"]})},500))},y=lv({onEvent:v=>{if(N(),m(v),x.current){const j=tv(v);j&&h({...j,runId:v.runId,workflowName:v.workflowName})}},onOpen:()=>o("connected"),onError:()=>o("error")});return()=>{y(),d(),o("disconnected"),b.current&&(clearTimeout(b.current),b.current=null)}},[s,c,o,u,d,h,m])}const xt=Jb()({component:ov});function ov(){return rv(),l.jsxs("div",{className:"h-screen flex flex-col bg-canvas",children:[l.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[l.jsx(Gy,{}),l.jsx("main",{className:"flex-1 overflow-y-auto bg-raised",children:l.jsx(Wy,{children:l.jsx(Fb,{})})})]}),l.jsx(Zy,{}),l.jsx($y,{}),l.jsx(Ky,{})]})}function Xe({icon:s,title:c,description:o,action:u,className:d,snippets:h,docLink:m,align:x="center"}){const b=q("flex flex-col py-12 px-4 max-w-2xl",x==="center"?"items-center text-center mx-auto":"items-start",d);return l.jsxs("div",{className:b,children:[l.jsx("div",{className:q("mb-4 text-zinc-600",x==="center"&&"opacity-60"),children:s}),l.jsx("h3",{className:"text-lg font-medium text-zinc-100 mb-1.5 font-display italic tracking-tight",children:c}),l.jsx("div",{className:"text-sm text-zinc-400 leading-relaxed mb-5",children:o}),h&&h.length>0&&l.jsx("div",{className:q("w-full space-y-2.5 mb-5",x==="center"&&"text-left"),children:h.map(N=>l.jsx(uv,{snippet:N},N.lang))}),(u||m)&&l.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[u,m&&l.jsxs("a",{href:m.href,target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1.5 text-[12px] text-blok-green-500 hover:text-blok-green-600 hover:underline font-mono font-medium",children:["↗ ",m.label]})]})]})}function uv({snippet:s}){const[c,o]=A.useState(!1),u=async()=>{try{await navigator.clipboard.writeText(s.code),o(!0),setTimeout(()=>o(!1),1500)}catch{}};return l.jsxs("div",{className:"rounded-md border border-zinc-800 bg-overlay overflow-hidden text-left",children:[l.jsxs("div",{className:"px-3 py-1.5 bg-canvas/40 border-b border-zinc-800 flex items-center gap-2",children:[l.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.08em] text-zinc-500",children:s.lang}),l.jsx("button",{type:"button",onClick:u,className:q("ml-auto text-[10.5px] font-mono px-2 py-0.5 rounded border transition-colors",c?"bg-blok-green-500/15 text-blok-green-500 border-blok-green-500/30":"border-zinc-800 text-zinc-400 hover:bg-hover hover:text-zinc-100"),children:c?"copied":"copy"})]}),l.jsx("pre",{className:"px-4 py-3 font-mono text-[11.5px] leading-relaxed text-zinc-100 overflow-x-auto whitespace-pre",children:s.code})]})}const dv=Et("/webhooks")({component:mv}),fv=[{value:"run.started",label:"Run Started"},{value:"run.completed",label:"Run Completed"},{value:"run.failed",label:"Run Failed"}];function mv(){const s=ht(),[c,o]=A.useState(!1),[u,d]=A.useState(""),[h,m]=A.useState(""),[x,b]=A.useState(["run.completed","run.failed"]),[N,y]=A.useState(null),{data:v,isLoading:j}=qe({queryKey:["webhooks"],queryFn:qh,refetchInterval:1e4}),R=Lt({mutationFn:Hh,onSuccess:()=>{s.invalidateQueries({queryKey:["webhooks"]}),o(!1),d(""),m(""),b(["run.completed","run.failed"]),y(null)},onError:O=>{y(O instanceof Error?O.message:"Failed to create webhook")}}),T=Lt({mutationFn:Bh,onSuccess:()=>{s.invalidateQueries({queryKey:["webhooks"]})}}),k=O=>{if(O.preventDefault(),y(null),!u.trim()){y("URL is required");return}try{new URL(u)}catch{y("Invalid URL format");return}if(x.length===0){y("Select at least one event");return}R.mutate({url:u.trim(),events:x,secret:h.trim()||void 0})},M=O=>{b(G=>G.includes(O)?G.filter(B=>B!==O):[...G,O])},Y=(v==null?void 0:v.webhooks)??[];return l.jsxs("div",{className:"p-6 max-w-4xl mx-auto space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-medium font-display italic tracking-tight text-zinc-100",children:"Webhooks"}),l.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:"Get notified when workflow runs complete or fail."})]}),l.jsxs("button",{type:"button",onClick:()=>o(!c),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium bg-blok-green-500 text-[#00231b] hover:bg-blok-green-600 transition-colors",children:[l.jsx(zl,{className:"w-4 h-4"}),"Add Webhook"]})]}),c&&l.jsxs("form",{onSubmit:k,className:"rounded-lg border border-zinc-800 bg-overlay p-4 space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"webhook-url",className:"block text-xs font-medium text-zinc-400 mb-1",children:"Endpoint URL"}),l.jsx("input",{id:"webhook-url",type:"url",value:u,onChange:O=>d(O.target.value),placeholder:"https://example.com/webhook",className:"w-full px-3 py-2 rounded-md bg-raised border border-zinc-800 text-sm text-zinc-100 placeholder-zinc-600 focus:outline-none focus:border-blok-green-500"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"webhook-secret",className:"block text-xs font-medium text-zinc-400 mb-1",children:"Secret (optional)"}),l.jsx("input",{id:"webhook-secret",type:"text",value:h,onChange:O=>m(O.target.value),placeholder:"Used for HMAC-SHA256 signature verification",className:"w-full px-3 py-2 rounded-md bg-raised border border-zinc-800 text-sm text-zinc-100 placeholder-zinc-600 focus:outline-none focus:border-blok-green-500"}),l.jsx("p",{className:"text-[11px] text-zinc-600 mt-1",children:"If set, requests include an X-Blok-Signature header."})]}),l.jsxs("fieldset",{className:"border-0 p-0 m-0",children:[l.jsx("legend",{className:"block text-xs font-medium text-zinc-400 mb-2",children:"Events"}),l.jsx("div",{className:"flex gap-2",children:fv.map(O=>l.jsx("button",{type:"button",onClick:()=>M(O.value),className:q("px-3 py-1.5 rounded-md text-xs font-medium border transition-colors",x.includes(O.value)?"border-blok-green-500 bg-blok-green-500/10 text-blok-green-500":"border-zinc-800 bg-raised text-zinc-400 hover:border-zinc-700"),children:O.label},O.value))})]}),N&&l.jsx("p",{className:"text-sm text-red-400",children:N}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{type:"submit",disabled:R.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium bg-blok-green-500 text-[#00231b] hover:bg-blok-green-600 transition-colors disabled:opacity-50",children:[R.isPending&&l.jsx(Oe,{className:"w-3 h-3 animate-spin"}),"Create Webhook"]}),l.jsx("button",{type:"button",onClick:()=>{o(!1),y(null)},className:"px-3 py-1.5 rounded-md text-sm font-medium text-zinc-400 hover:text-zinc-200 transition-colors",children:"Cancel"})]})]}),j?l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(Oe,{className:"w-5 h-5 text-zinc-500 animate-spin"})}):Y.length===0?l.jsx(Xe,{icon:l.jsx(zs,{className:"w-10 h-10"}),title:"No webhooks yet",description:l.jsxs(l.Fragment,{children:["Webhooks fire when a run completes, fails, or is cancelled. Each request is signed with HMAC-SHA256 if you set a secret — the receiver verifies via the",l.jsx("code",{className:"font-mono text-[12px] bg-raised border border-zinc-800 rounded px-1.5 py-0.5 mx-1 text-zinc-100",children:"X-Blok-Signature"}),"header."]}),action:l.jsxs("button",{type:"button",onClick:()=>o(!0),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold bg-blok-green-500 text-[#00231b] hover:bg-blok-green-600 transition-colors",children:[l.jsx(zl,{className:"w-3.5 h-3.5"}),"Add webhook"]}),docLink:{href:"https://docs.blok.io/studio/webhooks",label:"docs.blok.io/studio/webhooks"}}):l.jsx("div",{className:"space-y-2",children:Y.map(O=>l.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-zinc-800 bg-overlay px-4 py-3",children:[l.jsx("div",{className:q("w-2 h-2 rounded-full shrink-0",O.active?"bg-green-500":"bg-red-500")}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm text-zinc-200 font-mono truncate",children:O.url}),l.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[l.jsx("span",{className:"text-[11px] text-zinc-500",children:O.events.join(", ")}),O.lastTriggeredAt&&l.jsxs("span",{className:"text-[11px] text-zinc-600 flex items-center gap-1",children:[O.lastStatus&&O.lastStatus<400?l.jsx(nc,{className:"w-3 h-3 text-green-500"}):l.jsx(Wm,{className:"w-3 h-3 text-red-500"}),"Last fired ",el(O.lastTriggeredAt),O.lastStatus&&l.jsxs("span",{children:["(HTTP ",O.lastStatus,")"]})]}),!O.active&&l.jsxs("span",{className:"text-[11px] text-red-400",children:["Disabled after ",O.failCount," failures"]})]})]}),l.jsx("button",{type:"button",onClick:()=>T.mutate(O.id),disabled:T.isPending,className:"p-1.5 rounded hover:bg-zinc-800 text-zinc-500 hover:text-red-400 transition-colors",title:"Delete webhook",children:l.jsx(Vo,{className:"w-4 h-4"})})]},O.id))})]})}const hv=Et("/settings")({component:xv});function xv(){const s=jn(R=>R.current),c=Rl(),o=ht(),{data:u}=qe({queryKey:["health"],queryFn:dh,retry:1}),{data:d}=qe({queryKey:["config"],queryFn:fh,retry:1}),[h,m]=A.useState(""),[x,b]=A.useState(!1),[N,y]=A.useState(null),v=h.trim().toLowerCase()==="delete"&&!x;async function j(){if(v){b(!0),y(null);try{const R=await zh();y(R),m(""),o.invalidateQueries()}catch(R){y({error:R instanceof Error?R.message:String(R)})}finally{b(!1)}}}return l.jsxs("div",{className:"p-6 max-w-3xl mx-auto space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-medium font-display italic tracking-tight text-zinc-100",children:"Settings"}),l.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:"Studio configuration, storage, and destructive actions."})]}),l.jsxs(ym,{icon:l.jsx(og,{className:"w-4 h-4 text-zinc-500"}),title:"Storage",subtitle:"Where Studio's run history is persisted.",children:[l.jsx(vn,{label:"Backend",value:pv()}),l.jsx(vn,{label:"Inferred path",value:l.jsx("span",{className:"font-mono",children:bv()})}),l.jsx(vn,{label:"Trigger version",value:(u==null?void 0:u.version)??"—"}),l.jsx(vn,{label:"Trigger uptime",value:u?gv(u.uptime):"—"}),l.jsx(vn,{label:"Active runs",value:String((u==null?void 0:u.activeRuns)??0)}),l.jsx(vn,{label:"Workflows registered",value:String((d==null?void 0:d.workflows.length)??0)}),l.jsx(vn,{label:"Trigger types",value:((d==null?void 0:d.triggers)??[]).join(", ")||"—"})]}),l.jsxs(ym,{icon:l.jsx("span",{className:"block w-2 h-2 rounded-full bg-blok-green-500",style:{boxShadow:"0 0 0 3px rgba(43, 205, 113, 0.18)"}}),title:"Environment scope",subtitle:l.jsxs(l.Fragment,{children:["List views are scoped to ",l.jsx("code",{className:"font-mono",children:s}),". Switch via the env chip in the sidebar. To register additional environments, set",l.jsx("code",{className:"font-mono mx-1",children:"BLOK_ENV"}),"on the trigger before starting it."]}),children:[l.jsx(vn,{label:"Current scope",value:l.jsx("span",{className:"font-mono text-blok-green-500",children:s})}),l.jsx(vn,{label:"Backend filter",value:"?env=… (Phase 2.1)"})]}),l.jsxs("section",{className:"rounded-lg border border-status-failed/30 bg-status-failed/5 overflow-hidden",children:[l.jsxs("header",{className:"px-5 py-3 border-b border-status-failed/30 flex items-center gap-2",children:[l.jsx(lc,{className:"w-4 h-4 text-status-failed"}),l.jsx("h2",{className:"text-[12px] font-semibold uppercase tracking-[0.08em] text-status-failed",children:"Danger zone"})]}),l.jsxs("div",{className:"p-5 space-y-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Clear all data"}),l.jsxs("p",{className:"text-[13px] text-zinc-400 mt-1 leading-relaxed",children:["Removes every run, node, log line, event, and tag from the persistence store backing this trigger. This is the equivalent of ",l.jsx("code",{className:"font-mono",children:"DELETE /__blok/runs"}),". ",l.jsx("b",{children:"Cannot be undone."})," If you're using SQLite, the underlying ",l.jsx("code",{className:"font-mono",children:".db"})," file stays — only its contents are wiped — so the file watcher on your trigger doesn't lose its handle."]})]}),l.jsxs("label",{className:"flex flex-col gap-1.5 max-w-md",children:[l.jsxs("span",{className:"text-[11px] uppercase tracking-[0.08em] text-zinc-500 font-semibold",children:["Type ",l.jsx("code",{className:"font-mono normal-case tracking-normal text-zinc-300",children:"delete"})," to enable the button"]}),l.jsx("input",{type:"text",value:h,onChange:R=>m(R.target.value),placeholder:"delete",className:q("px-3 py-2 rounded-md bg-raised border text-sm text-zinc-100 font-mono","focus:outline-none transition-colors",v?"border-status-failed":"border-zinc-800 focus:border-zinc-600"),spellCheck:!1,autoComplete:"off"})]}),l.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[l.jsxs("button",{type:"button",onClick:j,disabled:!v,className:q("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-colors",v?"bg-status-failed text-white hover:opacity-90":"bg-raised border border-zinc-800 text-zinc-600 cursor-not-allowed"),children:[x?l.jsx(Oe,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Vo,{className:"w-3.5 h-3.5"}),x?"Clearing…":"Clear all data"]}),N&&"deleted"in N&&l.jsxs("span",{className:"text-[12px] text-blok-green-500 font-mono",children:["✓ ",N.deleted.toLocaleString()," record",N.deleted===1?"":"s"," removed"]}),N&&"error"in N&&l.jsxs("span",{className:"text-[12px] text-status-failed font-mono break-all",children:["Failed: ",N.error]}),l.jsx("button",{type:"button",onClick:()=>c({to:"/"}),className:"text-[12px] text-zinc-500 hover:text-zinc-300 ml-auto",children:"Back to overview"})]})]})]}),l.jsxs("p",{className:"text-[11px] font-mono text-zinc-600 pt-2 border-t border-zinc-800",children:["Blok Studio · ships with ",l.jsx("code",{children:"blokctl studio"})," · persistence: SQLite by default in dev, configurable via"," ",l.jsx("code",{children:"BLOK_TRACE_STORE"}),"."]})]})}function ym({icon:s,title:c,subtitle:o,children:u}){return l.jsxs("section",{className:"rounded-lg border border-zinc-800 bg-overlay overflow-hidden",children:[l.jsxs("header",{className:"px-5 py-3 border-b border-zinc-800 flex items-start gap-2",children:[s&&l.jsx("span",{className:"mt-0.5 shrink-0",children:s}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold text-zinc-100",children:c}),l.jsx("p",{className:"text-[12.5px] text-zinc-500 mt-0.5 leading-relaxed",children:o})]})]}),l.jsx("dl",{className:"px-5 py-3 space-y-2",children:u})]})}function vn({label:s,value:c}){return l.jsxs("div",{className:"grid grid-cols-[180px_1fr] gap-3 text-[12.5px]",children:[l.jsx("dt",{className:"text-zinc-500 font-mono",children:s}),l.jsx("dd",{className:"text-zinc-200 break-all",children:c})]})}function pv(s){return l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"font-mono",children:"SQLite"}),l.jsx("span",{className:"text-zinc-500",children:" · default for "}),l.jsx("code",{className:"font-mono",children:"blokctl dev"}),l.jsx("span",{className:"text-zinc-500",children:" projects"})]})}function bv(){return".blok/trace.db"}function gv(s){if(s<60)return`${Math.round(s)}s`;if(s<3600)return`${Math.round(s/60)}m ${Math.round(s%60)}s`;const c=Math.floor(s/3600),o=Math.round(s%3600/60);return`${c}h ${o}m`}function yv(s){return qe({queryKey:["scheduled-dispatches",s],queryFn:()=>wh(s),refetchInterval:3e3})}function vv(){const s=ht();return Lt({mutationFn:c=>Sh(c),onSuccess:()=>{s.invalidateQueries({queryKey:["scheduled-dispatches"]}),s.invalidateQueries({queryKey:["runs"]})}})}const jv=Et("/scheduled")({component:zv}),ex={delayed:"Delayed",queued:"Queued",debounced:"Debounced"},Nv={delayed:"bg-amber-500/10 text-amber-300 ring-amber-500/20",queued:"bg-indigo-500/10 text-indigo-300 ring-indigo-500/20",debounced:"bg-violet-500/10 text-violet-300 ring-violet-500/20"};function zv(){const[s,c]=A.useState(""),{data:o,isLoading:u}=yv({status:s?[s]:void 0,limit:200}),d=vv(),[,h]=A.useState(0);A.useEffect(()=>{const N=setInterval(()=>h(y=>y+1),1e3);return()=>clearInterval(N)},[]);const m=(o==null?void 0:o.rows)??[],x=(o==null?void 0:o.now)??Date.now(),b=Date.now();return l.jsxs("div",{className:"p-6 max-w-7xl mx-auto space-y-5",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-medium font-display italic tracking-tight text-zinc-100",children:"Scheduled"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Pending dispatches waiting on `delay`, `debounce`, or `concurrencyKey` queue mode. Already-fired and expired runs live in"," ",l.jsx(De,{to:"/runs",className:"text-zinc-300 hover:text-zinc-100 underline",children:"All Runs"}),"."]})]}),l.jsx(Sv,{value:s,onChange:c}),u?l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(Oe,{className:"w-5 h-5 text-zinc-500 animate-spin"})}):m.length>0?l.jsx(wv,{rows:m,serverNow:x,localNow:b,onCancel:N=>d.mutate(N),cancellingRunId:d.isPending?d.variables??null:null}):s?l.jsx(Xe,{icon:l.jsx(_o,{className:"w-10 h-10"}),title:`No ${ex[s].toLowerCase()} dispatches`,description:`Nothing is currently in the "${s}" state.`,action:l.jsx("button",{type:"button",onClick:()=>c(""),className:"px-3 py-1.5 rounded-md text-xs font-semibold bg-blok-green-500 text-[#00231b] hover:bg-blok-green-600 transition-colors",children:"Show all"})}):l.jsx(Xe,{icon:l.jsx(_o,{className:"w-10 h-10"}),title:"No scheduled dispatches",description:l.jsxs(l.Fragment,{children:["Configure a trigger with ",l.jsx("code",{className:"text-zinc-300",children:"delay"}),","," ",l.jsx("code",{className:"text-zinc-300",children:"debounce"}),", or"," ",l.jsx("code",{className:"text-zinc-300",children:'onLimit: "queue"'})," to see pending dispatches land here before they fire."]}),docLink:{href:"https://docs.blok.io/d/reliability/delay-ttl-debounce",label:"Scheduling docs"}})]})}function Sv({value:s,onChange:c}){const o=[{label:"All",value:""},{label:"Delayed",value:"delayed"},{label:"Queued",value:"queued"},{label:"Debounced",value:"debounced"}];return l.jsx("div",{className:"flex gap-1.5",children:o.map(u=>l.jsx("button",{type:"button",onClick:()=>c(u.value),className:q("px-2.5 py-1 rounded-md text-xs font-medium transition-colors",s===u.value?"bg-blok-green-500/10 text-blok-green-300 ring-1 ring-inset ring-blok-green-500/30":"bg-hover text-zinc-400 hover:text-zinc-200 hover:bg-raised"),children:u.label},u.value||"all"))})}function wv({rows:s,serverNow:c,localNow:o,onCancel:u,cancellingRunId:d}){const h=c+(Date.now()-o);return l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-raised text-zinc-400 text-xs uppercase tracking-wide",children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left px-4 py-2.5 font-medium",children:"Status"}),l.jsx("th",{className:"text-left px-4 py-2.5 font-medium",children:"Workflow"}),l.jsx("th",{className:"text-left px-4 py-2.5 font-medium",children:"Fires in"}),l.jsx("th",{className:"text-left px-4 py-2.5 font-medium",children:"Expires"}),l.jsx("th",{className:"text-left px-4 py-2.5 font-medium",children:"Run ID"}),l.jsx("th",{className:"text-right px-4 py-2.5 font-medium",children:"Action"})]})}),l.jsx("tbody",{children:s.map(m=>{const x=m.scheduledAt-h,b=m.expiresAt?m.expiresAt-h:null;return l.jsxs("tr",{className:"border-t border-zinc-800 hover:bg-hover",children:[l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:q("inline-flex items-center px-2 py-0.5 rounded-full text-[11px] font-medium ring-1 ring-inset",Nv[m.dispatchStatus]),children:ex[m.dispatchStatus]})}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:l.jsx(De,{to:"/workflows/$name",params:{name:m.workflowName},className:"hover:text-zinc-100 hover:underline",children:m.workflowName})}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-300 tabular-nums",children:vm(x)}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 tabular-nums",children:b===null?"—":vm(b)}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-mono text-xs",children:l.jsxs(De,{to:"/runs/$runId",params:{runId:m.runId},className:"hover:text-zinc-300",children:[m.runId.slice(0,12),"…"]})}),l.jsx("td",{className:"px-4 py-2.5 text-right",children:l.jsxs("button",{type:"button",onClick:()=>u(m.runId),disabled:d===m.runId,className:q("inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors",d===m.runId?"bg-hover text-zinc-500 cursor-not-allowed":"bg-hover text-zinc-300 hover:bg-raised hover:text-zinc-100"),children:[d===m.runId?l.jsx(Oe,{className:"w-3 h-3 animate-spin"}):l.jsx(Kt,{className:"w-3 h-3"}),"Cancel"]})})]},m.runId)})})]})})}function vm(s){if(s<=0){const u=Math.abs(s);return u<1e3?"now":u<6e4?`${Math.floor(u/1e3)}s ago`:`${Math.floor(u/6e4)}m ago`}if(s<1e3)return"<1s";if(s<6e4)return`${Math.floor(s/1e3)}s`;if(s<36e5){const u=Math.floor(s/6e4),d=Math.floor(s%6e4/1e3);return`${u}m ${d}s`}const c=Math.floor(s/36e5),o=Math.floor(s%36e5/6e4);return`${c}h ${o}m`}const Ev=Et("/queues")({component:Tv});function Tv(){const s=jn(h=>h.current),{data:c,isLoading:o,error:u}=qe({queryKey:["queues",s],queryFn:()=>vh({env:s}),refetchInterval:5e3});if(o)return l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Oe,{className:"w-6 h-6 text-zinc-500 animate-spin"})});if(u)return l.jsx("div",{className:"p-8",children:l.jsx(Xe,{icon:l.jsx(In,{className:"w-10 h-10"}),title:"Couldn't load queues",description:l.jsxs(l.Fragment,{children:["The runner's ",l.jsx("code",{className:"font-mono",children:"/__blok/queues"})," endpoint didn't respond. Restart the trigger to pick up the new endpoint if you just rebuilt the runner."]})})});const d=(c==null?void 0:c.queues)??[];return d.length===0?l.jsx("div",{className:"p-8",children:l.jsx(Xe,{icon:l.jsx(zs,{className:"w-10 h-10"}),title:"No queues yet",description:l.jsxs(l.Fragment,{children:["No workflows are registered to receive work in",l.jsx("code",{className:"font-mono text-[12px] bg-raised border border-zinc-800 rounded px-1.5 py-0.5 mx-1 text-zinc-100",children:s}),". Once a workflow's trigger config is loaded by the trigger server, it'll appear here."]}),docLink:{href:"https://docs.blok.io/triggers",label:"docs.blok.io/triggers"}})}):l.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-5",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-medium font-display italic tracking-tight text-zinc-100",children:"Queues"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Triggers configured to receive work in ",s,". ",d.length," ",d.length===1?"queue":"queues"," ","loaded."]})]}),l.jsx("div",{className:"rounded-lg border border-zinc-800 bg-overlay overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-canvas/60",children:l.jsxs("tr",{children:[l.jsx(vl,{children:"Workflow"}),l.jsx(vl,{className:"w-[140px]",children:"Trigger"}),l.jsx(vl,{className:"w-[80px]",children:"Depth"}),l.jsx(vl,{className:"w-[110px] text-right",children:"Runs · 24h"}),l.jsx(vl,{className:"w-[120px] text-right",children:"Avg"}),l.jsx(vl,{className:"w-[100px] text-right",children:"Errors"}),l.jsx(vl,{className:"w-[140px] text-right",children:"Last run"})]})}),l.jsx("tbody",{children:d.map(h=>l.jsx(Cv,{queue:h},h.id))})]})}),l.jsx("p",{className:"text-[11px] font-mono text-zinc-600",children:`Stateless HTTP triggers don't have queue depth — depth is "—" until JetStream-backed worker queues land.`})]})}function Cv({queue:s}){const c=s.triggerType==="http"?Zo:s.triggerType==="cron"?Na:s.triggerType==="email"?ug:zs;return l.jsxs("tr",{className:"border-t border-zinc-800 hover:bg-hover transition-colors",children:[l.jsx("td",{className:"px-3 py-2.5",children:l.jsx(De,{to:"/workflows/$name",params:{name:s.name},className:"text-zinc-100 hover:text-blok-green-500 hover:underline font-medium",children:s.name})}),l.jsx("td",{className:"px-3 py-2.5",children:l.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] text-zinc-300",children:[l.jsx(c,{className:"w-3 h-3 text-zinc-500"}),s.triggerType]})}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-[12px] text-zinc-500",children:s.depth??"—"}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-[12px] text-zinc-100 text-right",children:s.runs24h}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-[12px] text-zinc-300 text-right",children:ge(s.avgDurationMs)}),l.jsx("td",{className:q("px-3 py-2.5 font-mono text-[12px] text-right",s.errorRate>0?"text-status-failed":"text-zinc-600"),children:s.errorRate>0?`${(s.errorRate*100).toFixed(1)}%`:"—"}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-[11px] text-zinc-500 text-right",children:s.lastRunAt?el(s.lastRunAt):"—"})]})}function vl({children:s,className:c}){return l.jsx("th",{className:q("text-left text-[10px] uppercase tracking-[0.06em] text-zinc-500 font-semibold px-3 py-2",c),children:s})}function tx({data:s}){return s.some(o=>o.count>0)?l.jsx(Ym,{width:"100%",height:220,children:l.jsxs(Km,{data:s,margin:{top:0,right:0,left:-20,bottom:0},children:[l.jsx(Xm,{strokeDasharray:"3 3",stroke:"#27272a"}),l.jsx(Vm,{dataKey:"range",tick:{fill:"#71717a",fontSize:10},tickLine:!1,axisLine:{stroke:"#3f3f46"}}),l.jsx(Zm,{tick:{fill:"#71717a",fontSize:10},tickLine:!1,axisLine:{stroke:"#3f3f46"},allowDecimals:!1}),l.jsx($m,{contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#a1a1aa"},itemStyle:{color:"#d4d4d8"},formatter:o=>[`${o} runs`,"Count"]}),l.jsx(Oo,{dataKey:"count",fill:"#3b82f6",opacity:.7,radius:[4,4,0,0]})]})}):l.jsx("div",{className:"flex items-center justify-center h-48 text-zinc-600 text-sm",children:"No duration data available"})}function nx({data:s}){const c=s.map(u=>({...u,time:new Date(u.bucket).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}));return s.some(u=>u.total>0)?l.jsx(Ym,{width:"100%",height:220,children:l.jsxs(Km,{data:c,margin:{top:0,right:0,left:-20,bottom:0},children:[l.jsx(Xm,{strokeDasharray:"3 3",stroke:"#27272a"}),l.jsx(Vm,{dataKey:"time",tick:{fill:"#71717a",fontSize:10},tickLine:!1,axisLine:{stroke:"#3f3f46"},interval:"preserveStartEnd"}),l.jsx(Zm,{tick:{fill:"#71717a",fontSize:10},tickLine:!1,axisLine:{stroke:"#3f3f46"},allowDecimals:!1}),l.jsx($m,{contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#a1a1aa"},itemStyle:{color:"#d4d4d8"}}),l.jsx(tg,{wrapperStyle:{fontSize:"11px",color:"#71717a"}}),l.jsx(Oo,{dataKey:"completed",name:"Completed",fill:"#22c55e",opacity:.7,radius:[2,2,0,0],stackId:"status"}),l.jsx(Oo,{dataKey:"failed",name:"Failed",fill:"#ef4444",opacity:.7,radius:[2,2,0,0],stackId:"status"})]})}):l.jsx("div",{className:"flex items-center justify-center h-48 text-zinc-600 text-sm",children:"No executions in the last 24 hours"})}function lx({data:s}){const c=Math.max(...s.map(o=>o.avgDurationMs),1);return l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Node"}),l.jsx("th",{className:"text-left px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Avg Duration"}),l.jsx("th",{className:"text-left px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Max"}),l.jsx("th",{className:"text-left px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Runs"}),l.jsx("th",{className:"text-left px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:"Error Rate"})]})}),l.jsx("tbody",{children:s.sort((o,u)=>u.avgDurationMs-o.avgDurationMs).map(o=>l.jsxs("tr",{className:"border-b border-zinc-800/50 hover:bg-zinc-800/30",children:[l.jsxs("td",{className:"px-2 py-2",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx("span",{className:"text-xs font-medium text-zinc-300",children:o.nodeName})}),l.jsx("div",{className:"h-1 bg-zinc-800 rounded-full overflow-hidden mt-1 max-w-32",children:l.jsx("div",{className:"h-full bg-blue-500/60 rounded-full",style:{width:`${o.avgDurationMs/c*100}%`}})})]}),l.jsx("td",{className:"px-2 py-2",children:l.jsx("span",{className:"text-xs font-mono text-zinc-400",children:ge(o.avgDurationMs)})}),l.jsx("td",{className:"px-2 py-2",children:l.jsx("span",{className:"text-xs font-mono text-zinc-500",children:ge(o.maxDurationMs)})}),l.jsx("td",{className:"px-2 py-2",children:l.jsx("span",{className:"text-xs font-mono text-zinc-500",children:o.executionCount})}),l.jsx("td",{className:"px-2 py-2",children:l.jsx("span",{className:q("text-xs font-mono",o.errorRate>.1?"text-red-400":o.errorRate>0?"text-amber-400":"text-green-500"),children:Pn(o.errorRate)})})]},o.nodeName))})]})})}function ax({data:s}){const c=Math.max(...s.map(o=>o.totalRuns),1);return l.jsx("div",{className:"space-y-2",children:s.sort((o,u)=>u.totalRuns-o.totalRuns).map(o=>l.jsxs(De,{to:"/workflows/$name",params:{name:o.name},className:"flex items-center gap-3 p-2 rounded-md hover:bg-zinc-800/50 transition-colors group",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-300 truncate group-hover:text-zinc-100",children:o.name}),l.jsxs("span",{className:"text-[10px] font-mono text-zinc-500 shrink-0 ml-2",children:[o.totalRuns," runs"]})]}),l.jsx("div",{className:"h-2 bg-zinc-800 rounded-full overflow-hidden",children:l.jsx("div",{className:q("h-full rounded-full transition-all",o.errorRate>.1?"bg-red-500/60":o.errorRate>0?"bg-amber-500/60":"bg-green-500/60"),style:{width:`${o.totalRuns/c*100}%`}})})]}),l.jsxs("div",{className:"shrink-0 text-right",children:[l.jsx("div",{className:"text-[10px] font-mono text-zinc-500",children:ge(o.avgDurationMs)}),l.jsxs("div",{className:q("text-[10px] font-mono",o.errorRate>.1?"text-red-400":o.errorRate>0?"text-amber-400":"text-green-400"),children:[Pn(o.errorRate)," err"]})]})]},o.name))})}function sx(s){return qe({queryKey:["metrics",s],queryFn:()=>Oh(s),refetchInterval:1e4})}function Rv(s,c){return qe({queryKey:["diff",s,c],queryFn:()=>Dh(s,c),enabled:!!s&&!!c})}function kv(s){const c=ht();return Lt({mutationFn:o=>Ah(s,o),onSuccess:()=>{c.invalidateQueries({queryKey:["run",s]}),c.invalidateQueries({queryKey:["tags"]}),c.invalidateQueries({queryKey:["runs"]})}})}function Dv(s){const c=ht();return Lt({mutationFn:o=>Mh(s,o),onSuccess:()=>{c.invalidateQueries({queryKey:["run",s]}),c.invalidateQueries({queryKey:["tags"]}),c.invalidateQueries({queryKey:["runs"]})}})}const Av=Et("/metrics")({component:Mv});function Mv(){const{data:s}=tu(),[c,o]=A.useState(void 0),{data:u,isLoading:d}=sx(c);return d?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Oe,{className:"w-6 h-6 text-zinc-500 animate-spin"})}):!u||u.totalRuns===0?l.jsx("div",{className:"p-8",children:l.jsx(Xe,{icon:l.jsx(Qo,{className:"w-10 h-10"}),title:"No metrics yet",description:"Once workflows run, this page aggregates duration histograms, p50/p95 latency, success rate per workflow, and node-level performance breakdowns.",snippets:[{lang:"curl · http",code:`curl -X POST http://localhost:4000/cross-runtime-chain \\
|
|
26
|
+
-H 'content-type: application/json' \\
|
|
27
|
+
-d '{}'`}],docLink:{href:"https://docs.blok.io/studio/metrics",label:"docs.blok.io/studio/metrics"}})}):l.jsxs("div",{className:"p-6 max-w-7xl mx-auto space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-medium font-display italic tracking-tight text-zinc-100",children:"Metrics"}),l.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:"Execution analytics and performance insights."})]}),s&&s.length>1&&l.jsxs("select",{value:c||"",onChange:h=>o(h.target.value||void 0),className:"text-sm bg-raised border border-zinc-800 rounded-md px-3 py-1.5 text-zinc-300 outline-none focus:border-blok-green-500",children:[l.jsx("option",{value:"",children:"All Workflows"}),s.map(h=>l.jsx("option",{value:h.name,children:h.name},h.name))]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 xl:grid-cols-7 gap-3",children:[l.jsx(jl,{label:"Total Runs",value:String(u.totalRuns)}),l.jsx(jl,{label:"Completed",value:String(u.completedRuns),color:"text-green-400"}),l.jsx(jl,{label:"Failed",value:String(u.failedRuns),color:u.failedRuns>0?"text-red-400":void 0}),l.jsx(jl,{label:"Error Rate",value:Pn(u.totalRuns>0?u.failedRuns/u.totalRuns:0),color:u.failedRuns>0?"text-red-400":void 0}),l.jsx(jl,{label:"Avg Duration",value:ge(u.avgDurationMs)}),l.jsx(jl,{label:"P95 Duration",value:ge(u.p95DurationMs)}),l.jsx(jl,{label:"P99 Duration",value:ge(u.p99DurationMs)})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-overlay p-4",children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-300 mb-4",children:"Execution Timeline (24h)"}),l.jsx(nx,{data:u.executionTimeline})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-overlay p-4",children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-300 mb-4",children:"Duration Distribution"}),l.jsx(tx,{data:u.durationDistribution})]})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[!c&&u.workflowBreakdown.length>0&&l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-overlay p-4",children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-300 mb-4",children:"Workflow Breakdown"}),l.jsx(ax,{data:u.workflowBreakdown})]}),u.nodePerformance.length>0&&l.jsxs("div",{className:q("rounded-lg border border-zinc-800 bg-overlay p-4",c?"lg:col-span-2":""),children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-300 mb-4",children:"Node Performance"}),l.jsx(lx,{data:u.nodePerformance})]})]})]})}function jl({label:s,value:c,color:o}){return l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-overlay p-3",children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-600 mb-1",children:s}),l.jsx("div",{className:q("text-lg font-semibold font-mono",o||"text-zinc-100"),children:c})]})}const Ov=Et("/logs")({component:_v});function _v(){const s=jn(G=>G.current),[c,o]=A.useState(new Set),[u,d]=A.useState(),[h,m]=A.useState(""),[x,b]=A.useState(!0),N=A.useRef(null),y=c.size>0?[...c].join(","):void 0,{data:v,isLoading:j,error:R}=qe({queryKey:["logs",s,y,u,h,x],queryFn:()=>Nh({workflow:u,level:y,q:h||void 0,env:s,limit:200}),refetchInterval:x?2e3:!1,placeholderData:G=>G}),T=A.useRef(new Set),[k,M]=A.useState(new Set);A.useEffect(()=>{if(!(v!=null&&v.logs))return;const G=v.logs.filter(Q=>!T.current.has(Q.id));for(const Q of G)T.current.add(Q.id);if(G.length===0)return;const B=new Set(G.map(Q=>Q.id));M(B);const X=setTimeout(()=>M(new Set),1200);return()=>clearTimeout(X)},[v]);const Y=A.useMemo(()=>{const G={error:0,warn:0,info:0,debug:0},B=new Set;for(const X of(v==null?void 0:v.logs)??[])G[X.level]=(G[X.level]??0)+1,B.add(X.workflowName);return{counts:G,workflowCount:B.size}},[v==null?void 0:v.logs]);A.useEffect(()=>{const G=B=>{var X;if(B.target instanceof HTMLInputElement||B.target instanceof HTMLTextAreaElement){B.key==="Escape"&&(m(""),B.target.blur());return}B.metaKey||B.ctrlKey||(B.key==="/"?(B.preventDefault(),(X=N.current)==null||X.focus()):B.key.toLowerCase()==="l"&&b(Q=>!Q))};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[]);const O=G=>{o(B=>{const X=new Set(B);return X.has(G)?X.delete(G):X.add(G),X})};return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsxs("header",{className:"px-6 pt-5 pb-3 border-b border-zinc-800 bg-canvas",children:[l.jsxs("div",{className:"flex items-baseline gap-3 mb-1",children:[l.jsx("h1",{className:"text-2xl font-medium font-display italic tracking-tight text-zinc-100",children:"Logs"}),l.jsxs("span",{className:"text-[12px] font-mono text-zinc-500",children:[s," · ",u??"all workflows"]}),l.jsxs("button",{type:"button",onClick:()=>b(G=>!G),className:q("ml-auto inline-flex items-center gap-2 px-3 py-1 rounded-md border text-xs font-medium transition-colors",x?"bg-blok-green-500/10 text-blok-green-500 border-blok-green-500/30":"bg-raised text-zinc-400 border-zinc-800 hover:bg-hover"),"aria-pressed":x,children:[l.jsx("span",{className:q("w-1.5 h-1.5 rounded-full bg-current",x&&"animate-pulse-dot")}),"Live tail",l.jsx("kbd",{className:"font-mono text-[10px] px-1 py-px rounded bg-canvas border border-zinc-800 text-zinc-500",children:"L"})]})]}),l.jsxs("div",{className:"mt-3 flex items-center gap-2 bg-raised border border-zinc-800 rounded-lg px-3 py-1.5 focus-within:border-blok-green-500 focus-within:shadow-[0_0_0_3px_rgba(43,205,113,0.12)] transition-all",children:[l.jsx(Yo,{className:"w-3.5 h-3.5 text-zinc-500 shrink-0"}),[...c].map(G=>l.jsx(jm,{k:"level:",v:G,onRemove:()=>O(G)},G)),u&&l.jsx(jm,{k:"workflow:",v:u,onRemove:()=>d(void 0)}),l.jsx("input",{ref:N,className:"flex-1 bg-transparent border-0 outline-none text-zinc-100 font-mono text-[12px] py-1 min-w-[120px]",placeholder:'message ~ "ConnectionRefused" · / to focus',value:h,onChange:G=>m(G.target.value)}),h&&l.jsx("button",{type:"button",onClick:()=>m(""),className:"text-zinc-500 hover:text-zinc-100 p-0.5","aria-label":"Clear search",children:l.jsx(Kt,{className:"w-3 h-3"})})]}),l.jsxs("div",{className:"flex items-center gap-4 mt-2.5 text-[11.5px] font-mono text-zinc-500",children:[l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-100 font-medium",children:(v==null?void 0:v.logs.length)??0})," matched",(v==null?void 0:v.truncated)&&l.jsx("span",{className:"text-amber-400 ml-1",children:"· truncated"})]}),l.jsx("span",{children:"·"}),l.jsx($i,{lvl:"error",active:c.has("error"),count:Y.counts.error,onClick:O}),l.jsx($i,{lvl:"warn",active:c.has("warn"),count:Y.counts.warn,onClick:O}),l.jsx($i,{lvl:"info",active:c.has("info"),count:Y.counts.info,onClick:O}),l.jsx($i,{lvl:"debug",active:c.has("debug"),count:Y.counts.debug,onClick:O}),l.jsxs("span",{className:"ml-auto",children:[l.jsx("span",{className:"text-zinc-100 font-medium",children:Y.workflowCount})," workflows"]})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto bg-canvas",children:[j&&!v&&l.jsx("div",{className:"p-8 text-sm text-zinc-500",children:"Loading logs…"}),R&&l.jsxs("div",{className:"p-8 text-sm text-red-400",children:["Failed to load logs. Is the runner trace API at ",l.jsx("code",{className:"font-mono",children:"/__blok/logs"})," running?"]}),v&&v.logs.length===0&&l.jsxs("div",{className:"p-8 text-sm text-zinc-500",children:["No logs match these filters."," ",x&&"Live tail is on — new matches will flash brand-green when they land."]}),v&&v.logs.length>0&&l.jsxs("table",{className:"w-full font-mono text-[12px]",children:[l.jsx("thead",{className:"sticky top-0 bg-overlay z-10",children:l.jsxs("tr",{children:[l.jsx(xa,{className:"w-[130px]",children:"Time"}),l.jsx(xa,{className:"w-[72px]",children:"Level"}),l.jsx(xa,{className:"w-[200px]",children:"Workflow"}),l.jsx(xa,{className:"w-[150px]",children:"Step"}),l.jsx(xa,{children:"Message"}),l.jsx(xa,{className:"w-[116px]",children:"Run"})]})}),l.jsx("tbody",{children:v.logs.map(G=>l.jsxs("tr",{className:q("border-b border-zinc-800 hover:bg-hover transition-colors",k.has(G.id)&&"row-flash"),children:[l.jsx("td",{className:"px-3 py-1.5 text-zinc-500 whitespace-nowrap",children:new Date(G.timestamp).toISOString().slice(11,23)}),l.jsx("td",{className:"px-3 py-1.5",children:l.jsx(Uv,{level:G.level})}),l.jsx("td",{className:"px-3 py-1.5 text-zinc-300",children:l.jsx("button",{type:"button",onClick:()=>d(G.workflowName===u?void 0:G.workflowName),className:q("hover:text-zinc-100 hover:underline truncate max-w-full text-left",u===G.workflowName&&"text-blok-green-500"),title:`Filter by ${G.workflowName}`,children:G.workflowName})}),l.jsx("td",{className:"px-3 py-1.5 text-zinc-400 truncate",children:G.nodeName??"—"}),l.jsx("td",{className:"px-3 py-1.5 text-zinc-100 break-words",children:G.message}),l.jsx("td",{className:"px-3 py-1.5 whitespace-nowrap",children:l.jsx(De,{to:"/runs/$runId",params:{runId:G.runId},className:"text-blok-green-500 hover:text-blok-green-600 hover:underline",children:G.runId.slice(0,12)})})]},G.id))})]})]}),l.jsxs("footer",{className:"px-6 py-2 bg-overlay border-t border-zinc-800 flex items-center gap-4 text-[11px] font-mono text-zinc-500",children:[x?l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-blok-green-500",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blok-green-500 animate-pulse-dot"}),"tailing"]}):l.jsx("span",{children:"paused"}),l.jsx("span",{children:"·"}),l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-100 font-medium",children:(v==null?void 0:v.logs.length)??0})," events shown"]}),(v==null?void 0:v.truncated)&&l.jsx("span",{className:"text-amber-400",children:"· capped at server limit (200)"}),l.jsx("span",{className:"ml-auto text-zinc-600",children:"/ to focus search · L toggle tail · Esc clear"})]}),l.jsx("style",{children:`@keyframes row-flash { 0% { background: rgba(43, 205, 113, 0.18); } 100% { background: transparent; } }
|
|
28
|
+
.row-flash { animation: row-flash 1.2s ease-out; }`})]})}function jm({k:s,v:c,onRemove:o}){return l.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-overlay border border-zinc-800 text-[11px] text-zinc-300",children:[l.jsx("span",{className:"text-zinc-500",children:s}),l.jsx("span",{children:c}),l.jsx("button",{type:"button",onClick:o,className:"text-zinc-500 hover:text-zinc-100 ml-0.5","aria-label":`Remove ${s}${c} filter`,children:l.jsx(Kt,{className:"w-2.5 h-2.5"})})]})}function $i({lvl:s,active:c,count:o,onClick:u}){const d={error:"text-log-error",warn:"text-log-warn",info:"text-log-info",debug:"text-log-debug"}[s];return l.jsxs("button",{type:"button",onClick:()=>u(s),className:q("inline-flex items-center gap-1.5 px-1.5 py-0.5 rounded transition-colors",c?"bg-hover text-zinc-100":"hover:bg-hover hover:text-zinc-300"),children:[l.jsx("span",{className:"text-zinc-500",children:s}),l.jsx("span",{className:q("font-medium",o>0?d:"text-zinc-600"),children:o})]})}function Uv({level:s}){const c={error:"bg-red-500/15 text-log-error",warn:"bg-amber-500/15 text-log-warn",info:"bg-blue-500/15 text-log-info",debug:"bg-zinc-700/40 text-log-debug"};return l.jsx("span",{className:q("inline-block px-1.5 py-0.5 rounded text-[9.5px] font-semibold uppercase tracking-[0.04em] min-w-[50px] text-center",c[s]),children:s})}function xa({children:s,className:c}){return l.jsx("th",{className:q("text-left text-[10px] uppercase tracking-[0.06em] text-zinc-500 font-semibold px-3 py-2 border-b border-zinc-800",c),children:s})}const Lv=Et("/deployments")({component:qv});function qv(){const s=jn(h=>h.current),{data:c,isLoading:o,error:u}=qe({queryKey:["deployments",s],queryFn:()=>jh({env:s,limit:500}),refetchInterval:1e4});if(o)return l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Oe,{className:"w-6 h-6 text-zinc-500 animate-spin"})});if(u)return l.jsx("div",{className:"p-8",children:l.jsx(Xe,{icon:l.jsx(El,{className:"w-10 h-10"}),title:"Couldn't load deployments",description:l.jsxs(l.Fragment,{children:["The runner's ",l.jsx("code",{className:"font-mono",children:"/__blok/deployments"})," endpoint didn't respond. Restart the trigger to pick up the new endpoint if you just rebuilt the runner."]})})});const d=(c==null?void 0:c.deployments)??[];return d.length===0?l.jsx("div",{className:"p-8",children:l.jsx(Xe,{icon:l.jsx(El,{className:"w-10 h-10"}),title:"No deployments seen",description:l.jsxs(l.Fragment,{children:["No runs in the last 500 carried a recognizable",l.jsx("code",{className:"font-mono text-[12px] bg-raised border border-zinc-800 rounded px-1.5 py-0.5 mx-1 text-zinc-100",children:"version"}),"field, or the env scope",l.jsx("code",{className:"font-mono text-[12px] bg-raised border border-zinc-800 rounded px-1.5 py-0.5 mx-1 text-zinc-100",children:s}),"hasn't seen any runs yet. Workflows declare their version in metadata via the trigger registry."]})})}):l.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-5",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-medium font-display italic tracking-tight text-zinc-100",children:"Deployments"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Workflow versions seen in the last 500 runs. ",d.length," ",d.length===1?"version":"versions"," active in ",s,"."]})]}),l.jsx("div",{className:"rounded-lg border border-zinc-800 bg-overlay overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-canvas/60",children:l.jsxs("tr",{children:[l.jsx(Nl,{children:"Workflow"}),l.jsx(Nl,{className:"w-[110px]",children:"Version"}),l.jsx(Nl,{className:"w-[110px]",children:"Environment"}),l.jsx(Nl,{className:"w-[80px] text-right",children:"Runs"}),l.jsx(Nl,{className:"w-[140px]",children:"Success rate"}),l.jsx(Nl,{className:"w-[110px] text-right",children:"Avg duration"}),l.jsx(Nl,{className:"w-[150px] text-right",children:"Last run"})]})}),l.jsx("tbody",{children:d.map(h=>l.jsx(Hv,{deployment:h},`${h.workflowName}-${h.version}-${h.environment}`))})]})})]})}function Hv({deployment:s}){const c=s.successRate*100;return l.jsxs("tr",{className:"border-t border-zinc-800 hover:bg-hover transition-colors",children:[l.jsx("td",{className:"px-3 py-2.5",children:l.jsx(De,{to:"/workflows/$name",params:{name:s.workflowName},className:"text-zinc-100 hover:text-blok-green-500 hover:underline font-medium",children:s.workflowName})}),l.jsx("td",{className:"px-3 py-2.5",children:l.jsx("span",{className:q("inline-block font-mono text-[11px] px-1.5 py-0.5 rounded border",s.version==="unknown"?"bg-raised border-zinc-800 text-zinc-500":"bg-blok-green-500/10 border-blok-green-500/30 text-blok-green-500"),children:s.version})}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-[11px] text-zinc-300",children:s.environment}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-[12px] text-zinc-100 text-right",children:s.runs}),l.jsx("td",{className:"px-3 py-2.5",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-zinc-800 overflow-hidden",children:l.jsx("div",{className:q("h-full transition-all",c>=99?"bg-blok-green-500":c>=90?"bg-status-running":"bg-status-failed"),style:{width:`${c}%`}})}),l.jsxs("span",{className:q("font-mono text-[11px] tabular-nums shrink-0",c>=99?"text-blok-green-500":c>=90?"text-zinc-300":"text-status-failed"),children:[c.toFixed(1),"%"]})]})}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-[12px] text-zinc-300 text-right",children:ge(s.avgDurationMs)}),l.jsx("td",{className:"px-3 py-2.5 font-mono text-[11px] text-zinc-500 text-right",children:el(s.lastRunAt)})]})}function Nl({children:s,className:c}){return l.jsx("th",{className:q("text-left text-[10px] uppercase tracking-[0.06em] text-zinc-500 font-semibold px-3 py-2",c),children:s})}const Nm=[{type:"stat-card",title:"Stat Card",description:"A single key metric value",icon:l.jsx(dg,{className:"w-5 h-5"}),defaultConfig:{metric:"totalRuns"},defaultSize:{w:3,h:1}},{type:"timeline",title:"Execution Timeline",description:"Hourly execution bar chart (24h)",icon:l.jsx(Qo,{className:"w-5 h-5"}),defaultConfig:{timeRange:"24h"},defaultSize:{w:6,h:2}},{type:"error-rate",title:"Error Rate",description:"Overall error rate gauge",icon:l.jsx(In,{className:"w-5 h-5"}),defaultConfig:{},defaultSize:{w:3,h:2}},{type:"duration-distribution",title:"Duration Distribution",description:"Histogram of execution durations",icon:l.jsx(Na,{className:"w-5 h-5"}),defaultConfig:{},defaultSize:{w:6,h:2}},{type:"workflow-breakdown",title:"Workflow Breakdown",description:"Runs per workflow with error rates",icon:l.jsx(fg,{className:"w-5 h-5"}),defaultConfig:{},defaultSize:{w:6,h:3}},{type:"node-performance",title:"Node Performance",description:"Average durations per node",icon:l.jsx(Im,{className:"w-5 h-5"}),defaultConfig:{},defaultSize:{w:6,h:3}},{type:"recent-runs",title:"Recent Runs",description:"Summary of recent run outcomes",icon:l.jsx(mg,{className:"w-5 h-5"}),defaultConfig:{},defaultSize:{w:4,h:2}},{type:"heatmap",title:"Activity Heatmap",description:"24-hour execution activity heatmap",icon:l.jsx(hg,{className:"w-5 h-5"}),defaultConfig:{},defaultSize:{w:6,h:2}}],Bv=[{value:"totalRuns",label:"Total Runs"},{value:"completedRuns",label:"Completed Runs"},{value:"failedRuns",label:"Failed Runs"},{value:"errorRate",label:"Error Rate"},{value:"avgDurationMs",label:"Avg Duration"},{value:"p50DurationMs",label:"P50 Duration"},{value:"p95DurationMs",label:"P95 Duration"},{value:"p99DurationMs",label:"P99 Duration"}];function Gv({open:s,onClose:c,onAdd:o}){const[u,d]=A.useState(null),[h,m]=A.useState(""),[x,b]=A.useState("totalRuns");if(!s)return null;const N=Nm.find(v=>v.type===u),y=()=>{if(!N)return;const v={id:`w_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`,type:N.type,title:h||N.title,config:{...N.defaultConfig,...N.type==="stat-card"?{metric:x}:{}},position:{x:0,y:100,w:N.defaultSize.w,h:N.defaultSize.h}};o(v),d(null),m(""),b("totalRuns"),c()};return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:l.jsxs("dialog",{open:!0,className:"w-full max-w-lg bg-zinc-900 rounded-lg border border-zinc-800 shadow-xl","aria-label":"Add Widget",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[l.jsx("h2",{className:"text-sm font-semibold text-zinc-100",children:"Add Widget"}),l.jsx("button",{type:"button",onClick:c,className:"p-1 text-zinc-500 hover:text-zinc-300 transition-colors",children:l.jsx(Kt,{className:"w-4 h-4"})})]}),l.jsx("div",{className:"p-4",children:u?l.jsxs("div",{className:"space-y-4",children:[l.jsx("button",{type:"button",onClick:()=>d(null),className:"text-xs text-blue-400 hover:text-blue-300",children:"← Back to widget types"}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"widget-title",className:"block text-xs font-medium text-zinc-400 mb-1",children:"Title"}),l.jsx("input",{id:"widget-title",type:"text",value:h,onChange:v=>m(v.target.value),className:"w-full px-3 py-1.5 text-sm bg-zinc-800 border border-zinc-700 rounded-md text-zinc-200 outline-none focus:border-blue-500",placeholder:N==null?void 0:N.title})]}),u==="stat-card"&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"widget-metric",className:"block text-xs font-medium text-zinc-400 mb-1",children:"Metric"}),l.jsx("select",{id:"widget-metric",value:x,onChange:v=>b(v.target.value),className:"w-full px-3 py-1.5 text-sm bg-zinc-800 border border-zinc-700 rounded-md text-zinc-200 outline-none focus:border-blue-500",children:Bv.map(v=>l.jsx("option",{value:v.value,children:v.label},v.value))})]})]}):l.jsx("div",{className:"grid grid-cols-2 gap-2",children:Nm.map(v=>l.jsxs("button",{type:"button",onClick:()=>{d(v.type),m(v.title)},className:"flex items-start gap-3 p-3 rounded-md border border-zinc-800 hover:border-blue-500/50 hover:bg-zinc-800/50 transition-colors text-left",children:[l.jsx("div",{className:"text-zinc-500 mt-0.5",children:v.icon}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-zinc-200",children:v.title}),l.jsx("div",{className:"text-xs text-zinc-500 mt-0.5",children:v.description})]})]},v.type))})}),u&&l.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-zinc-800",children:[l.jsx("button",{type:"button",onClick:c,className:"px-3 py-1.5 text-xs font-medium text-zinc-400 hover:text-zinc-200 transition-colors",children:"Cancel"}),l.jsxs("button",{type:"button",onClick:y,className:q("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors","bg-blue-600 text-white hover:bg-blue-500"),children:[l.jsx(zl,{className:"w-3 h-3"}),"Add Widget"]})]})]})})}function Qv({widget:s,metrics:c}){if(!c)return l.jsx("div",{className:"flex items-center justify-center h-full text-zinc-600 text-xs",children:"Loading..."});switch(s.type){case"stat-card":return l.jsx(Yv,{widget:s,metrics:c});case"timeline":return l.jsx(nx,{data:c.executionTimeline});case"error-rate":return l.jsx(Kv,{metrics:c});case"duration-distribution":return l.jsx(tx,{data:c.durationDistribution});case"workflow-breakdown":return l.jsx(ax,{data:c.workflowBreakdown});case"node-performance":return l.jsx(lx,{data:c.nodePerformance});case"recent-runs":return l.jsx(Xv,{metrics:c});case"heatmap":return l.jsx(Vv,{metrics:c});default:return l.jsx("div",{className:"flex items-center justify-center h-full text-zinc-600 text-xs",children:"Unknown widget type"})}}function Yv({widget:s,metrics:c}){const o=s.config.metric||"totalRuns",d={totalRuns:{value:String(c.totalRuns)},completedRuns:{value:String(c.completedRuns),color:"text-green-400"},failedRuns:{value:String(c.failedRuns),color:c.failedRuns>0?"text-red-400":void 0},errorRate:{value:Pn(c.totalRuns>0?c.failedRuns/c.totalRuns:0),color:c.failedRuns>0?"text-red-400":void 0},avgDurationMs:{value:ge(c.avgDurationMs)},p50DurationMs:{value:ge(c.p50DurationMs)},p95DurationMs:{value:ge(c.p95DurationMs)},p99DurationMs:{value:ge(c.p99DurationMs)}}[o]||{value:"N/A"};return l.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:l.jsx("div",{className:q("text-2xl font-bold font-mono",d.color||"text-zinc-100"),children:d.value})})}function Kv({metrics:s}){const c=s.totalRuns>0?s.failedRuns/s.totalRuns:0,o=(c*100).toFixed(1),u=c>.1;return l.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2",children:[l.jsxs("div",{className:q("text-3xl font-bold font-mono",u?"text-red-400":"text-green-400"),children:[o,"%"]}),l.jsxs("div",{className:"text-xs text-zinc-500",children:[s.failedRuns," / ",s.totalRuns," runs failed"]})]})}function Xv({metrics:s}){const c=s.totalRuns,o=s.completedRuns,u=s.failedRuns,d=c-o-u;return l.jsxs("div",{className:"flex flex-col justify-center h-full gap-2",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsx("span",{className:"text-zinc-500",children:"Completed"}),l.jsx("span",{className:"font-mono text-green-400",children:o})]}),l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsx("span",{className:"text-zinc-500",children:"Failed"}),l.jsx("span",{className:"font-mono text-red-400",children:u})]}),d>0&&l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsx("span",{className:"text-zinc-500",children:"In Progress"}),l.jsx("span",{className:"font-mono text-blue-400",children:d})]}),l.jsxs("div",{className:"h-2 rounded-full bg-zinc-800 overflow-hidden flex mt-1",children:[o>0&&l.jsx("div",{className:"bg-green-500/70 h-full",style:{width:`${o/Math.max(c,1)*100}%`}}),u>0&&l.jsx("div",{className:"bg-red-500/70 h-full",style:{width:`${u/Math.max(c,1)*100}%`}})]})]})}function Vv({metrics:s}){const c=s.executionTimeline,o=Math.max(...c.map(u=>u.total),1);return l.jsxs("div",{className:"flex flex-col justify-center h-full gap-1",children:[l.jsx("div",{className:"flex gap-0.5 flex-wrap",children:c.map(u=>{const d=u.total/o,h=u.failed>0;return l.jsx("div",{className:"w-4 h-4 rounded-sm",style:{backgroundColor:h?`rgba(239, 68, 68, ${Math.max(.15,d)})`:`rgba(34, 197, 94, ${Math.max(.08,d*.7)})`},title:`${new Date(u.bucket).toLocaleTimeString()}: ${u.total} runs (${u.failed} failed)`},u.bucket)})}),l.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-zinc-600 mt-1",children:[l.jsx("span",{children:"Less"}),l.jsx("div",{className:"flex gap-0.5",children:[.1,.3,.5,.7,1].map(u=>l.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:`rgba(34, 197, 94, ${u*.7})`}},u))}),l.jsx("span",{children:"More"})]})]})}function Zv({widgets:s,metrics:c,isEditing:o,onRemoveWidget:u,onConfigureWidget:d}){const h=A.useMemo(()=>[...s].sort((m,x)=>m.position.y-x.position.y||m.position.x-x.position.x),[s]);return s.length===0?l.jsx("div",{className:"flex items-center justify-center h-64 text-zinc-600 text-sm border border-dashed border-zinc-800 rounded-lg",children:'No widgets yet. Click "Add Widget" to get started.'}):l.jsx("div",{className:"grid grid-cols-12 gap-4 auto-rows-[120px]",children:h.map(m=>l.jsxs("div",{className:q("rounded-lg border bg-zinc-900/50 overflow-hidden flex flex-col",o?"border-blue-500/30":"border-zinc-800"),style:{gridColumn:`span ${m.position.w}`,gridRow:`span ${m.position.h}`},children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-zinc-800/50 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[o&&l.jsx(xg,{className:"w-3 h-3 text-zinc-600 cursor-grab shrink-0"}),l.jsx("span",{className:"text-xs font-medium text-zinc-400 truncate",children:m.title})]}),o&&l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsx("button",{type:"button",onClick:()=>d(m.id),className:"p-0.5 text-zinc-600 hover:text-zinc-300 transition-colors","aria-label":"Configure widget",children:l.jsx(pg,{className:"w-3 h-3"})}),l.jsx("button",{type:"button",onClick:()=>u(m.id),className:"p-0.5 text-zinc-600 hover:text-red-400 transition-colors","aria-label":"Remove widget",children:l.jsx(Kt,{className:"w-3 h-3"})})]})]}),l.jsx("div",{className:"flex-1 p-3 overflow-hidden",children:l.jsx(Qv,{widget:m,metrics:c})})]},m.id))})}function $v(){return qe({queryKey:["dashboards"],queryFn:()=>Gh().then(s=>s.dashboards)})}function Jv(){const s=ht();return Lt({mutationFn:c=>Qh(c),onSuccess:()=>{s.invalidateQueries({queryKey:["dashboards"]})}})}function Fv(){const s=ht();return Lt({mutationFn:({id:c,data:o})=>Yh(c,o),onSuccess:(c,o)=>{s.invalidateQueries({queryKey:["dashboards"]}),s.invalidateQueries({queryKey:["dashboard",o.id]})}})}function Wv(){const s=ht();return Lt({mutationFn:c=>Kh(c),onSuccess:()=>{s.invalidateQueries({queryKey:["dashboards"]})}})}function Iv(){const s=ht();return Lt({mutationFn:c=>Xh(c),onSuccess:()=>{s.invalidateQueries({queryKey:["dashboards"]})}})}const Pv=Et("/dashboards")({component:t1}),e1=[{id:"w_default_1",type:"stat-card",title:"Total Runs",config:{metric:"totalRuns"},position:{x:0,y:0,w:3,h:1}},{id:"w_default_2",type:"stat-card",title:"Completed",config:{metric:"completedRuns"},position:{x:3,y:0,w:3,h:1}},{id:"w_default_3",type:"stat-card",title:"Failed",config:{metric:"failedRuns"},position:{x:6,y:0,w:3,h:1}},{id:"w_default_4",type:"stat-card",title:"Error Rate",config:{metric:"errorRate"},position:{x:9,y:0,w:3,h:1}},{id:"w_default_5",type:"timeline",title:"Execution Timeline (24h)",config:{timeRange:"24h"},position:{x:0,y:1,w:6,h:2}},{id:"w_default_6",type:"error-rate",title:"Error Rate",config:{},position:{x:6,y:1,w:3,h:2}},{id:"w_default_7",type:"recent-runs",title:"Run Summary",config:{},position:{x:9,y:1,w:3,h:2}},{id:"w_default_8",type:"duration-distribution",title:"Duration Distribution",config:{},position:{x:0,y:3,w:6,h:2}},{id:"w_default_9",type:"heatmap",title:"Activity Heatmap",config:{},position:{x:6,y:3,w:6,h:2}}];function t1(){const{data:s,isLoading:c}=$v(),{data:o,isLoading:u}=sx(),d=Jv(),h=Fv(),m=Wv(),x=Iv(),[b,N]=A.useState(null),[y,v]=A.useState(!1),[j,R]=A.useState(!1),[T,k]=A.useState(null),[M,Y]=A.useState(null),[O,G]=A.useState(""),B=(s==null?void 0:s.find(K=>K.id===b))||(s==null?void 0:s.find(K=>K.isDefault))||(s==null?void 0:s[0])||null;A.useEffect(()=>{if(s&&s.length>0&&!b){const K=s.find(ee=>ee.isDefault)??s[0];K&&N(K.id)}},[s,b]);const X=A.useCallback(()=>{d.mutate({name:"New Dashboard",widgets:e1},{onSuccess:K=>{N(K.id)}})},[d]),Q=A.useCallback(K=>{if(!B)return;const ee=[...B.widgets,K];h.mutate({id:B.id,data:{widgets:ee}})},[B,h]),F=A.useCallback(K=>{if(!B)return;const ee=B.widgets.filter(Be=>Be.id!==K);h.mutate({id:B.id,data:{widgets:ee}})},[B,h]),Z=A.useCallback(K=>{},[]),ae=A.useCallback(K=>{m.mutate(K,{onSuccess:()=>{b===K&&N(null),k(null)}})},[m,b]),_e=A.useCallback(K=>{x.mutate(K,{onSuccess:ee=>{N(ee.id),k(null)}})},[x]),He=A.useCallback(K=>{O.trim()&&h.mutate({id:K,data:{name:O.trim()}},{onSuccess:()=>Y(null)})},[h,O]);return c||u?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Oe,{className:"w-6 h-6 text-zinc-500 animate-spin"})}):!s||s.length===0?l.jsx("div",{className:"p-8",children:l.jsx(Xe,{icon:l.jsx(Jm,{className:"w-10 h-10"}),title:"No dashboards yet",description:"Custom dashboards compose chart widgets — duration histograms, p95 latency, error rate, queue depth — into a single named view. Pin one per environment, share the URL with on-call.",action:l.jsxs("button",{type:"button",onClick:X,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold bg-blok-green-500 text-[#00231b] hover:bg-blok-green-600 transition-colors",children:[l.jsx(zl,{className:"w-3.5 h-3.5"}),"Create dashboard"]}),docLink:{href:"https://docs.blok.io/studio/dashboards",label:"docs.blok.io/studio/dashboards"}})}):l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"shrink-0 border-b border-zinc-800 bg-canvas/60 px-4 py-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-sm font-semibold text-zinc-100",children:"Dashboards"}),l.jsxs("div",{className:"flex items-center gap-1 ml-4",children:[s.map(K=>l.jsxs("div",{className:"relative flex items-center",children:[M===K.id?l.jsx("form",{onSubmit:ee=>{ee.preventDefault(),He(K.id)},className:"flex items-center gap-1",children:l.jsx("input",{type:"text",value:O,onChange:ee=>G(ee.target.value),className:"px-2 py-0.5 text-xs bg-raised border border-blok-green-500 rounded text-zinc-200 outline-none w-32",onBlur:()=>Y(null)})}):l.jsx("button",{type:"button",onClick:()=>N(K.id),className:q("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",K.id===(B==null?void 0:B.id)?"bg-zinc-800 text-zinc-100":"text-zinc-500 hover:text-zinc-300 hover:bg-zinc-800/50"),children:K.name}),K.id===(B==null?void 0:B.id)&&l.jsxs("div",{className:"relative",children:[l.jsx("button",{type:"button",onClick:()=>k(T===K.id?null:K.id),className:"p-0.5 text-zinc-600 hover:text-zinc-300 ml-0.5",children:l.jsx(bg,{className:"w-3.5 h-3.5"})}),T===K.id&&l.jsxs("div",{className:"absolute top-full left-0 mt-1 w-40 bg-overlay border border-zinc-800 rounded-md shadow-lg z-50 py-1",children:[l.jsxs("button",{type:"button",onClick:()=>{Y(K.id),G(K.name),k(null)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-zinc-300 hover:bg-zinc-800",children:[l.jsx(om,{className:"w-3 h-3"})," Rename"]}),l.jsxs("button",{type:"button",onClick:()=>_e(K.id),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-zinc-300 hover:bg-zinc-800",children:[l.jsx($o,{className:"w-3 h-3"})," Duplicate"]}),l.jsxs("button",{type:"button",onClick:()=>ae(K.id),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-zinc-800",children:[l.jsx(Vo,{className:"w-3 h-3"})," Delete"]})]})]})]},K.id)),l.jsx("button",{type:"button",onClick:X,className:"p-1 text-zinc-600 hover:text-zinc-300 transition-colors",title:"Create new dashboard",children:l.jsx(zl,{className:"w-3.5 h-3.5"})})]}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[y&&l.jsxs("button",{type:"button",onClick:()=>R(!0),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-zinc-800 text-zinc-300 hover:bg-zinc-700 transition-colors",children:[l.jsx(zl,{className:"w-3 h-3"}),"Add Widget"]}),l.jsx("button",{type:"button",onClick:()=>v(!y),className:q("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",y?"bg-blok-green-500 text-[#00231b] hover:bg-blok-green-600":"bg-zinc-800 text-zinc-300 hover:bg-zinc-700"),children:y?l.jsxs(l.Fragment,{children:[l.jsx(va,{className:"w-3 h-3"})," Done"]}):l.jsxs(l.Fragment,{children:[l.jsx(om,{className:"w-3 h-3"})," Edit"]})})]})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:B&&l.jsx(Zv,{widgets:B.widgets,metrics:o,isEditing:y,onRemoveWidget:F,onConfigureWidget:Z})}),l.jsx(Gv,{open:j,onClose:()=>R(!1),onAdd:Q})]})}function n1(){const s=Ph(o=>o.events),c=A.useRef(null);return s.length===0?l.jsx("div",{className:"text-center py-8 text-zinc-600 text-xs",children:"Waiting for events..."}):l.jsxs("div",{className:"space-y-0.5 max-h-64 overflow-y-auto",children:[s.map(o=>l.jsxs(De,{to:"/runs/$runId",params:{runId:o.runId},className:"flex items-center gap-2 rounded px-2 py-1 hover:bg-zinc-800/50 transition-colors group",children:[l.jsx("span",{className:q("w-1.5 h-1.5 rounded-full shrink-0",o.type.includes("FAIL")||o.type.includes("ERROR")?"bg-red-400":o.type.includes("COMPLETE")?"bg-green-400":o.type.includes("START")?"bg-blue-400":"bg-zinc-500",o.type.includes("RUNNING")&&"animate-pulse-dot")}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("span",{className:"text-[11px] text-zinc-300 truncate block",children:o.nodeName||o.workflowName})}),l.jsx("span",{className:q("text-[10px] px-1.5 py-0.5 rounded font-medium shrink-0",Fh[o.type]),children:Jh[o.type]}),l.jsx("span",{className:"text-[10px] text-zinc-600 shrink-0",children:el(o.timestamp)})]},o.id)),l.jsx("div",{ref:c})]})}function l1({workflows:s}){const c=s.reduce((m,x)=>m+x.totalRuns,0),o=s.reduce((m,x)=>m+x.recentRuns,0),u=c>0?s.reduce((m,x)=>m+x.errorRate*x.totalRuns,0)/c:0,d=c>0?s.reduce((m,x)=>m+x.avgDurationMs*x.totalRuns,0)/c:0,h=[{label:"Total Runs",value:c.toLocaleString(),icon:In,color:"text-blue-400",bgColor:"bg-blue-400/10"},{label:"Recent (24h)",value:o.toLocaleString(),icon:gg,color:"text-green-400",bgColor:"bg-green-400/10"},{label:"Error Rate",value:Pn(u),icon:lc,color:u>.05?"text-red-400":"text-zinc-400",bgColor:u>.05?"bg-red-400/10":"bg-zinc-400/10"},{label:"Avg Duration",value:ge(d),icon:yg,color:"text-purple-400",bgColor:"bg-purple-400/10"}];return l.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:h.map(m=>l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/50 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("div",{className:q("p-1.5 rounded-md",m.bgColor),children:l.jsx(m.icon,{className:q("w-3.5 h-3.5",m.color)})}),l.jsx("span",{className:"text-xs text-zinc-500",children:m.label})]}),l.jsx("div",{className:"text-xl font-semibold text-zinc-100 font-mono",children:m.value})]},m.label))})}function Es({status:s,className:c}){return l.jsxs("span",{className:q("inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",qy[s],c),children:[l.jsx("span",{className:q("w-1.5 h-1.5 rounded-full",ws[s],s==="running"&&"animate-pulse-dot"),"aria-hidden":"true"}),Hy[s]]})}const a1={http:Zo,cron:Na,queue:vg,worker:Im,websocket:um,sse:um,webhook:zs};function s1({workflow:s}){const c=a1[s.triggerTypes[0]||"http"]||Zo;return l.jsxs(De,{to:"/workflows/$name",params:{name:s.name},className:"group block rounded-lg border border-zinc-800 bg-zinc-900/50 p-4 hover:border-zinc-700 hover:bg-zinc-900 transition-all",children:[l.jsxs("div",{className:"flex items-start justify-between mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("div",{className:"p-1.5 rounded-md bg-zinc-800 text-zinc-400 group-hover:bg-zinc-700 transition-colors",children:l.jsx(c,{className:"w-4 h-4"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-100 group-hover:text-white transition-colors",children:s.name}),l.jsx("span",{className:"text-[11px] text-zinc-500 uppercase tracking-wide",children:s.triggerTypes.join(", ")})]})]}),l.jsx(ja,{className:"w-4 h-4 text-zinc-600 group-hover:text-zinc-400 transition-colors"})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-3 text-xs",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-zinc-500 mb-0.5",children:"Runs"}),l.jsx("div",{className:"font-mono text-zinc-300",children:s.totalRuns})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-zinc-500 mb-0.5",children:"Avg"}),l.jsx("div",{className:"font-mono text-zinc-300",children:ge(s.avgDurationMs)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-zinc-500 mb-0.5",children:"Errors"}),l.jsx("div",{className:q("font-mono",s.errorRate>.05?"text-red-400":"text-zinc-300"),children:Pn(s.errorRate)})]})]}),s.lastRunStatus&&l.jsxs("div",{className:"mt-3 pt-3 border-t border-zinc-800 flex items-center justify-between",children:[l.jsx(Es,{status:s.lastRunStatus}),s.lastRunAt&&l.jsx("span",{className:"text-[11px] text-zinc-500",children:el(s.lastRunAt)})]})]})}function i1(){return qe({queryKey:["routing-diagnostics"],queryFn:()=>Eh(),refetchInterval:3e4,staleTime:1e4})}function Bo(){const{data:s}=i1(),[c,o]=A.useState(!1);return!s||s.count===0?null:l.jsxs("div",{className:"rounded-lg border border-amber-500/40 bg-amber-500/5 px-4 py-3",children:[l.jsxs("button",{type:"button",onClick:()=>o(u=>!u),className:"flex items-start gap-3 w-full text-left","aria-expanded":c,children:[l.jsx(lc,{className:"w-4 h-4 text-amber-400 mt-0.5 shrink-0"}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"text-sm font-medium text-amber-200",children:[s.count," workflow",s.count===1?"":"s"," dropped due to routing problems"]}),l.jsx("div",{className:"text-xs text-amber-400/80 mt-0.5",children:c?"Click to collapse":"Click to see which workflows + why"})]})]}),c&&l.jsx("ul",{className:"mt-3 space-y-2 border-t border-amber-500/20 pt-3",children:s.diagnostics.map(u=>l.jsxs("li",{className:"text-xs text-amber-100/90 font-mono whitespace-pre-wrap leading-relaxed",children:[l.jsx("div",{className:"text-amber-300 font-semibold",children:u.method&&u.path?`${u.method} ${u.path}`:u.kind}),l.jsx("div",{className:"text-amber-200/80",children:u.message})]},`${u.kind}-${u.method??""}-${u.path??""}-${u.droppedSource??""}-${u.recordedAt}`))})]})}const c1=Et("/")({component:r1});function r1(){const{data:s,isLoading:c,error:o}=tu();return c?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Oe,{className:"w-6 h-6 text-zinc-500 animate-spin"})}):o?l.jsx("div",{className:"p-6",children:l.jsx(Xe,{icon:l.jsx(ga,{className:"w-12 h-12"}),title:"Connection Error",description:"Could not connect to Blok backend. Make sure your server is running and the trace API is enabled."})}):!s||s.length===0?l.jsxs("div",{className:"p-8 space-y-4",children:[l.jsx(Bo,{}),l.jsx(Xe,{icon:l.jsx(ga,{className:"w-10 h-10"}),title:"No workflows yet · production",description:l.jsxs(l.Fragment,{children:["Trigger your first run to see it stream in real time here. Once a workflow runs in",l.jsx("code",{className:"font-mono text-[12px] bg-raised border border-zinc-800 rounded px-1.5 py-0.5 mx-1 text-zinc-100",children:"production"}),"this page shows live success rate, p50 / p95 latency, and the last 50 events as they happen."]}),snippets:[{lang:"curl · http",code:`curl -X POST http://localhost:4000/cross-runtime-chain \\
|
|
29
|
+
-H 'content-type: application/json' \\
|
|
30
|
+
-d '{}'`},{lang:"typescript · sdk",code:`// triggers/http/src/workflows/cross-runtime-chain.ts
|
|
31
|
+
await blok.run("cross-runtime-chain", {
|
|
32
|
+
input: { },
|
|
33
|
+
});`}],docLink:{href:"https://docs.blok.io/quickstart",label:"docs.blok.io/quickstart"}})]}):l.jsxs("div",{className:"p-6 max-w-7xl mx-auto space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-medium font-display italic tracking-tight text-zinc-100",children:"Overview"}),l.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:"Live trace of every workflow execution."})]}),l.jsx(Bo,{}),l.jsx(l1,{workflows:s}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"lg:col-span-2 space-y-3",children:[l.jsx("h2",{className:"text-sm font-medium text-zinc-400",children:"Workflows"}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:s.map(u=>l.jsx(s1,{workflow:u},u.name))})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-medium text-zinc-400 mb-3",children:"Live Feed"}),l.jsx("div",{className:"rounded-lg border border-zinc-800 bg-overlay p-3",children:l.jsx(n1,{})})]})]})]})}function o1({className:s}){const{data:c}=qe({queryKey:["concurrency","state"],queryFn:$h,refetchInterval:5e3,retry:!1}),{data:o}=qe({queryKey:["concurrency","health"],queryFn:Zh,refetchInterval:3e4,retry:!1});if(!c||c.totalLeases===0)return null;const u=[...c.buckets].sort((d,h)=>h.inFlight-d.inFlight);return l.jsxs("div",{className:q("rounded-md border border-zinc-800 bg-canvas px-3 py-2 text-xs","flex flex-col gap-2 min-w-[260px]",s),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold",children:"In-flight slots"}),l.jsxs("span",{className:"text-[10px] text-zinc-500",children:[c.totalLeases," across ",c.totalBuckets," keys",o&&o.backend!=="in-process"?l.jsx("span",{className:"ml-2 px-1.5 py-0.5 rounded bg-emerald-400/10 text-emerald-400",children:o.backend}):null]})]}),l.jsx("ul",{className:"flex flex-col gap-1 max-h-40 overflow-y-auto",children:u.slice(0,10).map(d=>l.jsxs("li",{className:"flex items-center justify-between gap-2 text-zinc-300",children:[l.jsxs("span",{className:"truncate font-mono text-[11px]",title:`${d.workflowName} / ${d.concurrencyKey}`,children:[l.jsx("span",{className:"text-zinc-500",children:d.workflowName}),l.jsx("span",{className:"text-zinc-600",children:" / "}),l.jsx("span",{children:d.concurrencyKey})]}),l.jsx("span",{className:"font-semibold text-amber-300 shrink-0",children:d.inFlight})]},`${d.workflowName}__${d.concurrencyKey}`))}),u.length>10&&l.jsxs("span",{className:"text-[10px] text-zinc-500",children:["…and ",u.length-10," more"]})]})}const nu=["saved-filters"];function u1(){const{data:s}=qe({queryKey:nu,queryFn:()=>Th().then(c=>c.filters),refetchInterval:15e3,staleTime:5e3});return s??[]}function d1(){const s=ht();return Lt({mutationFn:c=>Ch(c),onSuccess:()=>s.invalidateQueries({queryKey:nu})})}function f1(){const s=ht();return Lt({mutationFn:c=>Rh(c),onSuccess:()=>s.invalidateQueries({queryKey:nu})})}const m1=[{value:"",label:"All"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"},{value:"throttled",label:"Throttled"},{value:"delayed",label:"Delayed"},{value:"expired",label:"Expired"},{value:"debounced",label:"Debounced"},{value:"crashed",label:"Crashed"},{value:"timedOut",label:"Timed Out"}];function ix({status:s,onStatusChange:c,tagsInput:o,onTagsChange:u,metadataInput:d,onMetadataChange:h,className:m}){const[x,b]=A.useState(""),[N,y]=A.useState(""),v=o??x,j=d??N,R=u??b,T=h??y,k=u1(),M=d1(),Y=f1(),[O,G]=A.useState(""),B=F=>{if(G(F),!F)return;const Z=k.find(ae=>ae.name===F);Z&&(c(Z.status),R(Z.tagsInput),T(Z.metadataInput))},X=()=>{var Z;const F=(Z=typeof window<"u"?window.prompt("Name this filter:","My filter"):null)==null?void 0:Z.trim();F&&M.mutate({name:F,status:s,tagsInput:v,metadataInput:j},{onSuccess:()=>G(F)})},Q=()=>{O&&(typeof window<"u"&&!window.confirm(`Delete saved filter "${O}"?`)||Y.mutate(O,{onSuccess:()=>G("")}))};return l.jsxs("div",{className:q("flex flex-wrap items-center gap-3",m),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold mr-1",children:"Status"}),l.jsx("select",{value:s,onChange:F=>c(F.target.value),className:q("px-2 py-1 text-xs font-medium rounded-md border border-zinc-800 bg-canvas","text-zinc-100 focus:outline-none focus:ring-1 focus:ring-blok-green-500"),children:m1.map(F=>l.jsx("option",{value:F.value,children:F.label},F.value))})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold mr-1",children:"Tags"}),l.jsx("input",{type:"text",value:v,onChange:F=>R(F.target.value),placeholder:"user-123, premium",className:q("px-2 py-1 text-xs font-medium rounded-md border border-zinc-800 bg-canvas","text-zinc-100 placeholder:text-zinc-600 w-40","focus:outline-none focus:ring-1 focus:ring-blok-green-500")})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold mr-1",children:"Metadata"}),l.jsx("input",{type:"text",value:j,onChange:F=>T(F.target.value),placeholder:"tier=premium, plan=pro",className:q("px-2 py-1 text-xs font-medium rounded-md border border-zinc-800 bg-canvas","text-zinc-100 placeholder:text-zinc-600 w-48","focus:outline-none focus:ring-1 focus:ring-blok-green-500")})]}),l.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold mr-1",children:"Saved"}),l.jsxs("select",{value:O,onChange:F=>B(F.target.value),className:q("px-2 py-1 text-xs font-medium rounded-md border border-zinc-800 bg-canvas","text-zinc-100 focus:outline-none focus:ring-1 focus:ring-blok-green-500"),"aria-label":"Apply saved filter",children:[l.jsx("option",{value:"",children:"— Select —"}),k.map(F=>l.jsx("option",{value:F.name,children:F.name},F.name))]}),l.jsx("button",{type:"button",onClick:X,className:q("px-2 py-1 text-xs font-medium rounded-md border border-zinc-800 bg-canvas","text-zinc-100 hover:bg-zinc-800 focus:outline-none focus:ring-1 focus:ring-blok-green-500"),title:"Save current filter as a preset",children:"Save"}),O&&l.jsx("button",{type:"button",onClick:Q,className:q("px-2 py-1 text-xs font-medium rounded-md border border-zinc-800 bg-canvas","text-zinc-400 hover:bg-zinc-800 hover:text-red-400 focus:outline-none focus:ring-1 focus:ring-red-500"),title:`Delete "${O}"`,"aria-label":`Delete saved filter ${O}`,children:"✕"})]})]})}function h1({selectedIds:s,runs:c,onClear:o}){const u=Rl(),[d,h]=A.useState("idle"),[m,x]=A.useState(null),[b,N]=A.useState(null);if(s.size===0)return null;const v=c.filter(Y=>s.has(Y.id)).filter(Y=>Y.triggerType==="http"),j=v.length>0&&d==="idle",R=s.size===2;async function T(){if(!j)return;h("running"),N(null),x({done:0,total:v.length});const Y=[];for(const B of v){try{const X=await Io(B.id);Y.push({ok:!0,newRunId:X.newRunId})}catch(X){Y.push({ok:!1,err:X instanceof Error?X.message:String(X)})}x({done:Y.length,total:v.length})}const O=Y.find(B=>B.ok&&B.newRunId),G=Y.filter(B=>!B.ok).length;h("idle"),x(null),G>0&&N(`${G} of ${v.length} replays failed.`),O!=null&&O.newRunId&&(o(),u({to:"/runs/$runId",params:{runId:O.newRunId}}))}function k(){if(!R)return;const[Y,O]=[...s];Y&&O&&u({to:"/runs/diff",search:{a:Y,b:O}})}function M(Y){const O=[...s].slice(0,20);for(const G of O)Y==="json"?Po(G):eu(G)}return l.jsxs("div",{className:"rounded-lg border border-blok-green-500/30 bg-blok-green-500/10 px-3 py-2 flex items-center gap-3 mb-4",children:[l.jsxs("span",{className:"font-mono text-[11px] text-blok-green-500 font-semibold",children:[s.size," selected"]}),v.length<s.size&&l.jsxs("span",{className:"font-mono text-[10.5px] text-zinc-500",children:["· ",s.size-v.length," non-HTTP, replay-skip"]}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[m&&l.jsxs("span",{className:"font-mono text-[11px] text-zinc-400",children:[m.done," / ",m.total," replayed"]}),b&&l.jsx("span",{className:"font-mono text-[11px] text-status-failed",children:b}),l.jsxs(Ji,{onClick:T,disabled:!j,title:j?`Replay ${v.length} HTTP-triggered runs`:d==="running"?"Replay in progress…":"No HTTP-triggered runs in selection",children:[d==="running"?l.jsx(Oe,{className:"w-3 h-3 animate-spin"}):l.jsx(Uo,{className:"w-3 h-3"}),"Replay ",v.length>0&&v.length]}),R&&l.jsxs(Ji,{onClick:k,title:"Compare the two selected runs side-by-side",children:[l.jsx(vs,{className:"w-3 h-3"}),"Compare"]}),l.jsxs(Ji,{onClick:()=>M("json"),title:"Download a JSON file per selected run (up to 20)",children:[l.jsx(Lo,{className:"w-3 h-3"}),"JSON"]}),l.jsxs(Ji,{onClick:()=>M("csv"),title:"Download a CSV file per selected run (up to 20)",children:[l.jsx(Lo,{className:"w-3 h-3"}),"CSV"]}),l.jsx("button",{type:"button",onClick:o,className:"p-1 rounded text-zinc-500 hover:text-zinc-100 hover:bg-hover transition-colors",title:"Clear selection · Esc","aria-label":"Clear selection",children:l.jsx(Kt,{className:"w-3.5 h-3.5"})})]})]})}function Ji({children:s,onClick:c,disabled:o,title:u}){return l.jsx("button",{type:"button",onClick:c,disabled:o,title:u,className:q("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11.5px] font-medium border transition-colors",o?"bg-raised border-zinc-800 text-zinc-600 cursor-not-allowed":"bg-raised border-zinc-800 text-zinc-200 hover:bg-hover hover:text-zinc-100"),children:s})}function cx({runs:s,total:c,page:o,limit:u,onPageChange:d,showWorkflow:h=!1,enableCompare:m=!1,enableBulk:x=!1}){const b=Rl(),[N,y]=A.useState([]),[v,j]=A.useState([]),[R,T]=A.useState(()=>new Set);A.useEffect(()=>{if(!x)return;const X=Q=>{Q.target instanceof HTMLInputElement||Q.target instanceof HTMLTextAreaElement||Q.key==="Escape"&&R.size>0&&T(new Set)};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[x,R.size]);const k=X=>{T(Q=>{const F=new Set(Q);return F.has(X)?F.delete(X):F.add(X),F})},M=()=>{T(X=>X.size===s.length?new Set:new Set(s.map(Q=>Q.id)))},Y=()=>{v.length===2&&b({to:"/runs/diff",search:{a:v[0],b:v[1]}})},O=A.useMemo(()=>{const X=[];return x&&X.push({id:"bulk",header:()=>l.jsxs("button",{type:"button",onClick:Q=>{Q.preventDefault(),Q.stopPropagation(),M()},className:q("w-4 h-4 rounded-sm border flex items-center justify-center transition-colors shrink-0",R.size===s.length&&s.length>0?"bg-blok-green-500 border-blok-green-500":R.size>0?"bg-blok-green-500/40 border-blok-green-500/60":"border-zinc-700 hover:border-zinc-500"),title:R.size===s.length?"Deselect all":"Select all",children:[R.size===s.length&&s.length>0&&l.jsx(va,{className:"w-3 h-3 text-[#00231b]",strokeWidth:3}),R.size>0&&R.size<s.length&&l.jsx("span",{className:"w-1.5 h-0.5 bg-zinc-100 rounded-full"})]}),cell:({row:Q})=>{const F=R.has(Q.original.id);return l.jsx("button",{type:"button",onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),k(Q.original.id)},className:q("w-4 h-4 rounded-sm border flex items-center justify-center transition-colors shrink-0",F?"bg-blok-green-500 border-blok-green-500":"border-zinc-700 hover:border-zinc-500"),title:"Select",children:F&&l.jsx(va,{className:"w-3 h-3 text-[#00231b]",strokeWidth:3})})},size:36}),m&&!x&&X.push({id:"compare",header:"",cell:({row:Q})=>{const F=v.includes(Q.original.id);return l.jsx("button",{type:"button",onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),j(ae=>ae.includes(Q.original.id)?ae.filter(_e=>_e!==Q.original.id):ae.length>=2?[ae[1]??ae[0],Q.original.id].filter(Boolean):[...ae,Q.original.id])},className:q("w-4 h-4 rounded border transition-colors shrink-0",F?"bg-blue-500 border-blue-500":"border-zinc-600 hover:border-zinc-400"),title:"Select for comparison"})},size:40}),h&&X.push({accessorKey:"workflowName",header:"Workflow",cell:({row:Q})=>l.jsx(De,{to:"/workflows/$name",params:{name:Q.original.workflowName},className:"text-zinc-200 hover:text-white font-medium",onClick:F=>F.stopPropagation(),children:Q.original.workflowName})}),X.push({accessorKey:"status",header:"Status",cell:({row:Q})=>l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Es,{status:Q.original.status}),Q.original.tags&&Q.original.tags.length>0&&l.jsxs("div",{className:"flex gap-1",children:[Q.original.tags.slice(0,2).map(F=>l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-zinc-700/50 text-zinc-400",children:F},F)),Q.original.tags.length>2&&l.jsxs("span",{className:"text-[10px] text-zinc-600",children:["+",Q.original.tags.length-2]})]})]}),size:160},{accessorKey:"triggerSummary",header:"Trigger",cell:({row:Q})=>l.jsx("span",{className:"text-xs text-zinc-400 font-mono",children:Q.original.triggerSummary})},{accessorKey:"durationMs",header:"Duration",cell:({row:Q})=>l.jsx("span",{className:"text-xs font-mono text-zinc-300",children:Q.original.status==="running"?l.jsx("span",{className:"text-blue-400",children:"running..."}):ge(Q.original.durationMs)}),size:100},{accessorKey:"startedAt",header:"Started",cell:({row:Q})=>l.jsx("span",{className:"text-xs text-zinc-500",children:el(Q.original.startedAt)}),size:100},{id:"progress",header:"Nodes",cell:({row:Q})=>l.jsxs("span",{className:"text-xs font-mono text-zinc-400",children:[Q.original.completedNodes,"/",Q.original.nodeCount]}),size:80}),X},[h,m,x,v,R,s.length]),G=Ug({data:s,columns:O,state:{sorting:N},onSortingChange:y,getCoreRowModel:qg(),getSortedRowModel:Lg()}),B=Math.ceil(c/u);return l.jsxs("div",{children:[x&&l.jsx(h1,{selectedIds:R,runs:s,onClear:()=>T(new Set)}),m&&!x&&v.length>0&&l.jsxs("div",{className:"mb-3 flex items-center gap-3 rounded-lg border border-zinc-800 bg-zinc-900/50 px-3 py-2",children:[l.jsx(vs,{className:"w-4 h-4 text-zinc-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:[v.length,"/2 runs selected"]}),v.length===2&&l.jsx("button",{type:"button",onClick:Y,className:"ml-auto text-xs font-medium px-2.5 py-1 rounded-md bg-blue-600 text-white hover:bg-blue-500 transition-colors",children:"Compare"}),l.jsx("button",{type:"button",onClick:()=>j([]),className:q("text-xs text-zinc-500 hover:text-zinc-300 transition-colors",v.length===2?"":"ml-auto"),children:"Clear"})]}),l.jsx("div",{className:"rounded-lg border border-zinc-800 overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:G.getHeaderGroups().map(X=>l.jsx("tr",{className:"border-b border-zinc-800 bg-zinc-900/50",children:X.headers.map(Q=>l.jsx("th",{className:"text-left px-3 py-2 text-xs font-medium text-zinc-500 uppercase tracking-wider",style:{width:Q.getSize()!==150?Q.getSize():void 0},children:Q.isPlaceholder?null:l.jsxs("button",{type:"button",className:"flex items-center gap-1 hover:text-zinc-300 transition-colors",onClick:Q.column.getToggleSortingHandler(),children:[To(Q.column.columnDef.header,Q.getContext()),l.jsx(jg,{className:"w-3 h-3"})]})},Q.id))},X.id))}),l.jsx("tbody",{children:G.getRowModel().rows.map(X=>l.jsx("tr",{className:q("border-b border-zinc-800/50 hover:bg-zinc-800/30 transition-colors cursor-pointer",v.includes(X.original.id)&&"bg-blue-500/5",R.has(X.original.id)&&"bg-blok-green-500/5"),children:X.getVisibleCells().map(Q=>l.jsx("td",{className:"px-3 py-2.5",children:Q.column.id==="compare"||Q.column.id==="bulk"?To(Q.column.columnDef.cell,Q.getContext()):l.jsx(De,{to:"/runs/$runId",params:{runId:X.original.id},className:"block",children:To(Q.column.columnDef.cell,Q.getContext())})},Q.id))},X.id))})]})}),B>1&&l.jsxs("div",{className:"flex items-center justify-between mt-3 text-sm",children:[l.jsxs("span",{className:"text-zinc-500 text-xs",children:[c," total run",c!==1?"s":""]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:()=>d(o-1),disabled:o<=1,className:q("p-1 rounded hover:bg-zinc-800 transition-colors",o<=1?"text-zinc-700 cursor-not-allowed":"text-zinc-400"),children:l.jsx(Ng,{className:"w-4 h-4"})}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Page ",o," of ",B]}),l.jsx("button",{type:"button",onClick:()=>d(o+1),disabled:o>=B,className:q("p-1 rounded hover:bg-zinc-800 transition-colors",o>=B?"text-zinc-700 cursor-not-allowed":"text-zinc-400"),children:l.jsx(ja,{className:"w-4 h-4"})})]})]})]})}function x1(s){const c=jn(o=>o.current);return qe({queryKey:["runs",c,s],queryFn:()=>bh({...s,env:c}),refetchInterval:3e3})}function p1(s,c){const o=jn(u=>u.current);return qe({queryKey:["workflow-runs",o,s,c],queryFn:()=>ph(s,{...c,env:o}),enabled:!!s,refetchInterval:3e3})}const b1=Et("/runs/")({component:g1});function g1(){const[s,c]=A.useState(""),[o,u]=A.useState(1),d=50,{data:h,isLoading:m}=x1({status:s||void 0,limit:d,offset:(o-1)*d});return l.jsxs("div",{className:"p-6 max-w-7xl mx-auto space-y-5",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-medium font-display italic tracking-tight text-zinc-100",children:"All Runs"}),l.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:"Every workflow execution across every trigger."})]}),l.jsx(o1,{})]}),l.jsx(ix,{status:s,onStatusChange:c}),m?l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(Oe,{className:"w-5 h-5 text-zinc-500 animate-spin"})}):h&&h.runs.length>0?l.jsx(cx,{runs:h.runs,total:h.total,page:o,limit:d,onPageChange:u,showWorkflow:!0,enableBulk:!0}):s?l.jsx(Xe,{icon:l.jsx(In,{className:"w-10 h-10"}),title:`No ${s} runs match`,description:`Across the latest 50 runs, none have status "${s}". Either workflows have been quiet or the filter is too tight.`,action:l.jsx("button",{type:"button",onClick:()=>c(""),className:"px-3 py-1.5 rounded-md text-xs font-semibold bg-blok-green-500 text-[#00231b] hover:bg-blok-green-600 transition-colors",children:"Clear filter"})}):l.jsx(Xe,{icon:l.jsx(In,{className:"w-10 h-10"}),title:"No runs yet",description:l.jsx(l.Fragment,{children:"Trigger your first workflow to see it stream in real time. The chain test below exercises every SDK at once — useful for proving end-to-end connectivity before opening custom workflows."}),snippets:[{lang:"curl · http",code:`curl -X POST http://localhost:4000/cross-runtime-chain \\
|
|
34
|
+
-H 'content-type: application/json' \\
|
|
35
|
+
-d '{}'`}],docLink:{href:"https://docs.blok.io/quickstart",label:"docs.blok.io/quickstart"}})]})}function rx({onExportJson:s,onExportCsv:c,label:o="Export",size:u="sm"}){const[d,h]=A.useState(!1),m=A.useRef(null);return A.useEffect(()=>{const x=b=>{m.current&&!m.current.contains(b.target)&&h(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]),l.jsxs("div",{ref:m,className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>h(!d),className:q("flex items-center gap-1.5 rounded-md font-medium transition-colors bg-zinc-800 text-zinc-300 hover:bg-zinc-700 hover:text-zinc-100",u==="sm"?"px-2.5 py-1 text-xs":"px-3 py-1.5 text-sm"),children:[l.jsx(Lo,{className:u==="sm"?"w-3 h-3":"w-4 h-4"}),o,l.jsx(Ns,{className:q("transition-transform",u==="sm"?"w-3 h-3":"w-3.5 h-3.5",d&&"rotate-180")})]}),d&&l.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 w-44 rounded-lg border border-zinc-800 bg-overlay shadow-xl overflow-hidden",children:[l.jsxs("button",{type:"button",onClick:()=>{s(),h(!1)},className:"flex items-center gap-2 w-full px-3 py-2 text-sm text-zinc-300 hover:bg-zinc-800 hover:text-zinc-100 transition-colors",children:[l.jsx(zg,{className:"w-4 h-4 text-blue-400"}),"Export as JSON"]}),l.jsxs("button",{type:"button",onClick:()=>{c(),h(!1)},className:"flex items-center gap-2 w-full px-3 py-2 text-sm text-zinc-300 hover:bg-zinc-800 hover:text-zinc-100 transition-colors",children:[l.jsx(Sg,{className:"w-4 h-4 text-green-400"}),"Export as CSV"]})]})]})}function Qt({data:s,defaultExpanded:c=!0,maxDepth:o=5,className:u}){const d=A.useMemo(()=>s,[s]);return s==null?l.jsx("span",{className:"text-zinc-500 italic text-sm",children:"null"}):l.jsxs("div",{className:q("font-mono text-xs",u),children:[l.jsx("div",{className:"flex items-center justify-end mb-1",children:l.jsx(y1,{text:JSON.stringify(s,null,2)})}),l.jsx(Go,{value:d,depth:0,expanded:c,maxDepth:o})]})}function y1({text:s}){const[c,o]=A.useState(!1),u=()=>{navigator.clipboard.writeText(s),o(!0),setTimeout(()=>o(!1),2e3)};return l.jsx("button",{type:"button",onClick:u,className:"p-1 rounded hover:bg-zinc-800 text-zinc-500 hover:text-zinc-300 transition-colors",title:"Copy to clipboard","aria-label":"Copy to clipboard",children:c?l.jsx(va,{className:"w-3.5 h-3.5 text-green-400"}):l.jsx($o,{className:"w-3.5 h-3.5"})})}function Go({value:s,depth:c,expanded:o,maxDepth:u,keyName:d}){const[h,m]=A.useState(o&&c<u);if(s===null)return l.jsx(Fn,{keyName:d,value:"null",className:"text-zinc-500"});if(s===void 0)return l.jsx(Fn,{keyName:d,value:"undefined",className:"text-zinc-500"});if(typeof s=="string"){const x=s.length>200?`${s.slice(0,200)}…`:s;return l.jsx(Fn,{keyName:d,value:`"${x}"`,className:"text-green-400"})}if(typeof s=="number")return l.jsx(Fn,{keyName:d,value:String(s),className:"text-blue-400"});if(typeof s=="boolean")return l.jsx(Fn,{keyName:d,value:String(s),className:"text-amber-400"});if(Array.isArray(s))return s.length===0?l.jsx(Fn,{keyName:d,value:"[]",className:"text-zinc-400"}):l.jsx(zm,{keyName:d,expanded:h,onToggle:()=>m(!h),bracket:["[","]"],count:s.length,children:s.map((x,b)=>l.jsxs("div",{className:"ml-4",children:[l.jsx(Go,{value:x,depth:c+1,expanded:o,maxDepth:u}),b<s.length-1&&l.jsx("span",{className:"text-zinc-600",children:","})]},`idx-${b}`))});if(typeof s=="object"){const x=Object.entries(s);return x.length===0?l.jsx(Fn,{keyName:d,value:"{}",className:"text-zinc-400"}):l.jsx(zm,{keyName:d,expanded:h,onToggle:()=>m(!h),bracket:["{","}"],count:x.length,children:x.map(([b,N],y)=>l.jsxs("div",{className:"ml-4",children:[l.jsx(Go,{value:N,depth:c+1,expanded:o,maxDepth:u,keyName:b}),y<x.length-1&&l.jsx("span",{className:"text-zinc-600",children:","})]},b))})}return l.jsx(Fn,{keyName:d,value:String(s),className:"text-zinc-400"})}function Fn({keyName:s,value:c,className:o}){return l.jsxs("span",{children:[s!==void 0&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-purple-400",children:['"',s,'"']}),l.jsx("span",{className:"text-zinc-500",children:": "})]}),l.jsx("span",{className:o,children:c})]})}function zm({keyName:s,expanded:c,onToggle:o,bracket:u,count:d,children:h}){return l.jsxs("span",{children:[s!==void 0&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-purple-400",children:['"',s,'"']}),l.jsx("span",{className:"text-zinc-500",children:": "})]}),l.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center hover:text-zinc-300 text-zinc-500","aria-expanded":c,children:[c?l.jsx(Ns,{className:"w-3 h-3"}):l.jsx(ja,{className:"w-3 h-3"}),l.jsx("span",{className:"text-zinc-400",children:u[0]})]}),c?l.jsxs(l.Fragment,{children:[l.jsx("div",{children:h}),l.jsx("span",{className:"text-zinc-400",children:u[1]})]}):l.jsxs("span",{className:"text-zinc-600 text-xs",children:[" ",d," items ",u[1]]})]})}function Ze(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function Yt(s){return Array.isArray(s)?s:[]}function Se(s){return typeof s=="string"?s:void 0}function v1(s){return typeof s=="boolean"?s:void 0}function ox(s){return typeof s=="number"&&Number.isFinite(s)?s:void 0}function j1(s){return Ze(s)?Ze(s.branch)?"branch":typeof s.subworkflow=="string"?"subworkflow":Ze(s.wait)?"wait":Ze(s.forEach)?"forEach":Ze(s.loop)?"loop":Ze(s.switch)?"switch":Ze(s.tryCatch)?"tryCatch":"regular":"regular"}function N1(){return{nodes:[],edges:[],path:[],usedIds:new Set}}function ec(s){return s.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"x"}function z1(s,c){return Ze(s)&&typeof s.id=="string"?`id-${ec(s.id)}`:`at-${c}`}function lu(s,c,o){const u=Se(c.id);return ec(u??s.path.join("-")??o)}function nt(s,c,o=s.path.join("-")||c){const u=`${c}-${ec(o)}`;if(!s.usedIds.has(u))return s.usedIds.add(u),u;const d=`${u}-${ec(s.path.join("-"))}`;let h=d,m=2;for(;s.usedIds.has(h);)h=`${d}-${m}`,m+=1;return s.usedIds.add(h),h}function Wt(s,c,o){s.path.push(c);try{return o()}finally{s.path.pop()}}function lt(s,c,o){s.nodes.push({id:c,data:o})}function at(s,c,o,u){const d=`${c}__${o}__${s.edges.length}`;s.edges.push({id:d,source:c,target:o,...u})}function S1(s){if(!Ze(s))return{label:"Trigger"};for(const[c,o]of Object.entries(s))if(Ze(o))switch(c){case"http":{const u=Se(o.method)??"ANY",d=Se(o.path);return{label:`HTTP · ${u}`,sublabel:d}}case"worker":return{label:"Worker",sublabel:Se(o.queue)};case"cron":return{label:"Cron",sublabel:Se(o.schedule)};case"webhook":return{label:"Webhook",sublabel:Se(o.path)};case"grpc":return{label:"gRPC",sublabel:[Se(o.service),Se(o.method)].filter(Boolean).join(".")};default:return{label:c}}return{label:"Trigger"}}function ux(s,c=40){const o=Se(s);if(o!==void 0)return o.length<=c?o:`${o.slice(0,c-1)}…`}function wl(s){const c=Se(s);if(c!==void 0)return c;if(s==null)return"—";try{const o=JSON.stringify(s);return o.length>40?`${o.slice(0,39)}…`:o}catch{return String(s)}}function w1(s,c){const o=Se(s.id),u=nt(c,"step",o??c.path.join("-")),d=Se(s.use),h=Se(s.runtime)??Se(s.type);return lt(c,u,{kind:"regular",label:o??d??"step",sublabel:d,meta:{stepId:o,nodeRef:d,runtime:h,raw:s}}),{entry:u,exit:u}}function E1(s,c){const o=Se(s.id),u=nt(c,"subworkflow",o??c.path.join("-")),d=Se(s.subworkflow)??"?",h=v1(s.wait),m=Array.isArray(s.allowList)?s.allowList.filter(x=>typeof x=="string"):void 0;return lt(c,u,{kind:"subworkflow",label:o??`↳ ${d}`,sublabel:`↳ ${d}${h===!1?" (async)":""}`,meta:{stepId:o,expression:d,wait:h,allowList:m,raw:s}}),{entry:u,exit:u}}function T1(s,c){const o=Se(s.id),u=nt(c,"wait",o??c.path.join("-")),d=Ze(s.wait)?s.wait:{},h=d.for,m=d.until;let x="wait";return h!==void 0?x=`wait ${wl(h)}`:m!==void 0&&(x=`wait until ${wl(m)}`),lt(c,u,{kind:"wait",label:o??x,sublabel:o?x:void 0,meta:{stepId:o,raw:s}}),{entry:u,exit:u}}function C1(s,c){const o=Ze(s.branch)?s.branch:{},u=Se(s.id),d=lu(c,s,"branch"),h=nt(c,"branch",d),m=nt(c,"merge",`${d}-branch`),x=Se(o.when);lt(c,h,{kind:"branch",label:u??"branch",sublabel:x?`when ${ux(x)}`:"when ?",meta:{stepId:u,expression:x,raw:s}}),lt(c,m,{kind:"merge",label:""});const b=Yt(o.then),N=Yt(o.else),y=Wt(c,"then",()=>It(b,h,c,{entryLabel:"then"}));if(at(c,y,m),N.length>0){const v=Wt(c,"else",()=>It(N,h,c,{entryLabel:"else",entryStyle:"dashed"}));at(c,v,m,{style:"dashed"})}else at(c,h,m,{label:"else",style:"dashed"});return{entry:h,exit:m}}function R1(s,c){const o=Ze(s.switch)?s.switch:{},u=Se(s.id),d=lu(c,s,"switch"),h=nt(c,"switch",d),m=nt(c,"merge",`${d}-switch`),x=o.on;lt(c,h,{kind:"switch",label:u??"switch",sublabel:`on ${wl(x)}`,meta:{stepId:u,expression:wl(x),raw:s}}),lt(c,m,{kind:"merge",label:""});const b=Yt(o.cases);for(const[y,v]of b.entries()){if(!Ze(v))continue;const j=`when ${wl(v.when)}`,R=Wt(c,`case-${y}`,()=>It(Yt(v.do),h,c,{entryLabel:j}));at(c,R,m)}const N=Yt(o.default);if(N.length>0){const y=Wt(c,"default",()=>It(N,h,c,{entryLabel:"default",entryStyle:"dashed"}));at(c,y,m,{style:"dashed"})}else b.length>0?at(c,h,m,{label:"default",style:"dashed"}):at(c,h,m);return{entry:h,exit:m}}function k1(s,c){const o=Ze(s.forEach)?s.forEach:{},u=Se(s.id),d=nt(c,"forEach",u??c.path.join("-")),h=Se(o.as),m=wl(o.in),x=Se(o.mode),b=ox(o.concurrency);lt(c,d,{kind:"forEach",label:u??"forEach",sublabel:h?`for each ${h} in ${m}`:`for each in ${m}`,meta:{stepId:u,expression:m,mode:x,concurrency:b,raw:s}});const N=Yt(o.do);if(N.length>0){const y=Wt(c,"do",()=>It(N,d,c,{entryLabel:"do"}));at(c,y,d,{style:"dotted",backEdge:!0,label:"next"})}return{entry:d,exit:d}}function D1(s,c){const o=Ze(s.loop)?s.loop:{},u=Se(s.id),d=nt(c,"loop",u??c.path.join("-")),h=Se(o.while)??wl(o.while),m=ox(o.maxIterations);lt(c,d,{kind:"loop",label:u??"loop",sublabel:`while ${ux(h)}`,meta:{stepId:u,expression:h,maxIterations:m,raw:s}});const x=Yt(o.do);if(x.length>0){const b=Wt(c,"do",()=>It(x,d,c,{entryLabel:"do"}));at(c,b,d,{style:"dotted",backEdge:!0,label:"loop"})}return{entry:d,exit:d}}function A1(s,c){const o=Ze(s.tryCatch)?s.tryCatch:{},u=Se(s.id),d=lu(c,s,"tryCatch"),h=nt(c,"tryEnter",d),m=nt(c,"catchEnter",d),x=nt(c,"merge",`${d}-tryCatch`);lt(c,h,{kind:"tryEnter",label:u??"try",meta:{stepId:u,raw:s}}),lt(c,m,{kind:"catchEnter",label:"catch",sublabel:"on error"}),lt(c,x,{kind:"merge",label:""});const b=Yt(o.try),N=b.length>0?Wt(c,"try",()=>It(b,h,c)):h;at(c,N,x),at(c,h,m,{style:"dashed",label:"throws"});const y=Yt(o.catch),v=y.length>0?Wt(c,"catch",()=>It(y,m,c)):m;at(c,v,x,{style:"dashed"});const j=Yt(o.finally);if(j.length>0){const R=nt(c,"finallyEnter",d);lt(c,R,{kind:"finallyEnter",label:"finally"}),at(c,x,R);const T=Wt(c,"finally",()=>It(j,R,c));return{entry:h,exit:T}}return{entry:h,exit:x}}function M1(s,c){if(!Ze(s)){const u=nt(c,"unknown");return lt(c,u,{kind:"regular",label:"(invalid step)"}),{entry:u,exit:u}}switch(j1(s)){case"branch":return C1(s,c);case"subworkflow":return E1(s,c);case"wait":return T1(s,c);case"forEach":return k1(s,c);case"loop":return D1(s,c);case"switch":return R1(s,c);case"tryCatch":return A1(s,c);default:return w1(s,c)}}function It(s,c,o,u){let d=c,h=!0;for(const[m,x]of s.entries()){const{entry:b,exit:N}=Wt(o,z1(x,m),()=>M1(x,o));h&&u?at(o,d,b,{label:u.entryLabel,style:u.entryStyle}):at(o,d,b),h=!1,d=N}return d}function O1(s){const c=N1(),o=Ze(s)?s:{},u=nt(c,"trigger","workflow"),d=S1(o.trigger);lt(c,u,{kind:"trigger",label:d.label,sublabel:d.sublabel,meta:{raw:o.trigger}});const h=Yt(o.steps),m=It(h,u,c),x=nt(c,"end","workflow");return lt(c,x,{kind:"end",label:"End"}),at(c,m,x),{nodes:c.nodes,edges:c.edges}}var _1=Hg();const tc=Kb(_1),U1=200,L1=60,Sm=14,q1=80;function H1({definition:s}){const{nodes:c,edges:o}=A.useMemo(()=>Q1(s),[s]),u=A.useMemo(()=>({trigger:K1,end:X1,regular:V1,subworkflow:Z1,wait:$1,branch:J1,switch:F1,forEach:W1,loop:I1,tryEnter:P1,catchEnter:ej,finallyEnter:tj,merge:nj}),[]);return c.length===0?null:l.jsx("div",{className:"h-[600px] rounded-lg border border-zinc-800 overflow-hidden bg-canvas",children:l.jsxs(th,{nodes:c,edges:o,nodeTypes:u,fitView:!0,fitViewOptions:{padding:.25},proOptions:{hideAttribution:!0},minZoom:.25,maxZoom:2,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,children:[l.jsx(nh,{color:"#27272a",gap:16,size:1}),l.jsx(lh,{showInteractive:!1,className:"bg-zinc-900! border-zinc-700! rounded-md! [&>button]:bg-zinc-800! [&>button]:border-zinc-700! [&>button]:text-zinc-400! [&>button:hover]:bg-zinc-700!"}),l.jsx(ah,{nodeStrokeColor:"#3f3f46",nodeColor:d=>B1[d.data.kind]??"#52525b",maskColor:"rgba(0,0,0,0.6)",className:"bg-zinc-900! border-zinc-700! rounded-md!"})]})})}const B1={trigger:"#22c55e",end:"#71717a",regular:"#94a3b8",subworkflow:"#818cf8",wait:"#fbbf24",branch:"#fbbf24",switch:"#fb923c",forEach:"#a78bfa",loop:"#a78bfa",tryEnter:"#f87171",catchEnter:"#ef4444",finallyEnter:"#fb923c",merge:"#52525b"};function wm(s){return s==="merge"?{width:Sm,height:Sm}:s==="trigger"||s==="end"?{width:q1,height:40}:{width:U1,height:L1}}function G1(s){var h;if(typeof((h=s.data.meta)==null?void 0:h.stepId)!="string")return;const c=s.data.meta.raw;if(typeof c!="object"||c===null)return;const o=c.ui;if(typeof o!="object"||o===null)return;const{x:u,y:d}=o;if(!(typeof u!="number"||typeof d!="number"||!Number.isFinite(u)||!Number.isFinite(d)))return{x:u,y:d}}function Q1(s){const c=O1(s),o=new tc.graphlib.Graph;o.setDefaultEdgeLabel(()=>({})),o.setGraph({rankdir:"TB",nodesep:40,ranksep:60,acyclicer:"greedy"});const u=new Map;for(const m of c.nodes){const{width:x,height:b}=wm(m.data.kind),N=G1(m);N?(u.set(m.id,N),o.setNode(m.id,{width:x,height:b,x:N.x+x/2,y:N.y+b/2})):o.setNode(m.id,{width:x,height:b})}for(const m of c.edges)o.setEdge(m.source,m.target,{weight:m.backEdge?0:1});tc.layout(o);const d=c.nodes.map(m=>{const{width:x,height:b}=wm(m.data.kind),N=u.get(m.id),y=N??o.node(m.id)??{x:0,y:0};return{id:m.id,type:m.data.kind,position:N?{x:N.x,y:N.y}:{x:y.x-x/2,y:y.y-b/2},data:m.data,draggable:!1}}),h=c.edges.map(m=>Y1(m));return{nodes:d,edges:h}}function Y1(s){const c=s.style==="dashed"||s.style==="dotted";return{id:s.id,source:s.source,target:s.target,label:s.label,labelStyle:{fill:"#a1a1aa",fontSize:10},labelBgStyle:{fill:"#18181b"},labelBgPadding:[4,2],labelBgBorderRadius:4,style:{stroke:s.backEdge?"#a78bfa":"#3f3f46",strokeWidth:1.5,strokeDasharray:c?"4 4":void 0},type:s.backEdge?"default":"smoothstep"}}function Pt({icon:s,iconClass:c,title:o,subtitle:u,accent:d}){return l.jsxs("div",{className:q("rounded-md border bg-zinc-900 px-3 py-2 min-w-[180px] max-w-[220px] transition-colors hover:border-zinc-600",d),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(s,{className:q("w-3.5 h-3.5 shrink-0",c)}),l.jsx("span",{className:"text-xs font-medium text-zinc-100 truncate",children:o})]}),u&&l.jsx("div",{className:"text-[10px] text-zinc-500 mt-1 truncate font-mono",children:u})]})}function Xt(s){return l.jsxs(l.Fragment,{children:[l.jsx(Tl,{type:"target",position:Cl.Top,className:"bg-zinc-600! w-2! h-2! border-0!"}),s,l.jsx(Tl,{type:"source",position:Cl.Bottom,className:"bg-zinc-600! w-2! h-2! border-0!"})]})}function qt(s){return s.data}function K1(s){const c=qt(s);return Xt(l.jsxs("div",{className:"rounded-full border border-emerald-500/40 bg-emerald-500/10 px-3 py-1.5 min-w-[120px] text-center",children:[l.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[l.jsx(Dg,{className:"w-3 h-3 text-emerald-400"}),l.jsx("span",{className:"text-[11px] font-semibold text-emerald-200 truncate",children:c.label})]}),c.sublabel&&l.jsx("div",{className:"text-[10px] text-emerald-400/70 mt-0.5 truncate font-mono",children:c.sublabel})]}))}function X1(s){const c=qt(s);return l.jsxs(l.Fragment,{children:[l.jsx(Tl,{type:"target",position:Cl.Top,className:"bg-zinc-600! w-2! h-2! border-0!"}),l.jsx("div",{className:"rounded-full border border-zinc-700 bg-zinc-900 px-3 py-1.5 min-w-[80px] text-center",children:l.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[l.jsx(nc,{className:"w-3 h-3 text-zinc-400"}),l.jsx("span",{className:"text-[11px] font-semibold text-zinc-300",children:c.label})]})})]})}function V1(s){const c=qt(s);return Xt(l.jsx(Pt,{icon:kg,iconClass:"text-zinc-400",title:c.label,subtitle:c.sublabel,accent:"border-zinc-700"}))}function Z1(s){var h;const c=qt(s),o=(h=c.meta)==null?void 0:h.expression,u=typeof o=="string"&&!o.startsWith("$.")&&!o.startsWith("js/")&&!o.startsWith("{")&&o.length>0,d=l.jsx(Pt,{icon:Rg,iconClass:"text-indigo-400",title:c.label,subtitle:c.sublabel,accent:"border-indigo-500/40"});return Xt(u&&o?l.jsx(De,{to:"/workflows/$name",params:{name:o},className:"block",children:d}):d)}function $1(s){const c=qt(s);return Xt(l.jsx(Pt,{icon:Na,iconClass:"text-amber-300",title:c.label,subtitle:c.sublabel,accent:"border-amber-500/40"}))}function J1(s){const c=qt(s);return Xt(l.jsx(Pt,{icon:El,iconClass:"text-yellow-300",title:c.label,subtitle:c.sublabel,accent:"border-yellow-500/50"}))}function F1(s){const c=qt(s);return Xt(l.jsx(Pt,{icon:Cg,iconClass:"text-orange-300",title:c.label,subtitle:c.sublabel,accent:"border-orange-500/50"}))}function W1(s){const c=qt(s);return Xt(l.jsx(Pt,{icon:Tg,iconClass:"text-violet-300",title:c.label,subtitle:c.sublabel,accent:"border-violet-500/50"}))}function I1(s){const c=qt(s);return Xt(l.jsx(Pt,{icon:Eg,iconClass:"text-violet-300",title:c.label,subtitle:c.sublabel,accent:"border-violet-500/50"}))}function P1(s){const c=qt(s);return Xt(l.jsx(Pt,{icon:Pm,iconClass:"text-red-300",title:c.label,subtitle:c.sublabel,accent:"border-red-500/40"}))}function ej(s){const c=qt(s);return Xt(l.jsx(Pt,{icon:wg,iconClass:"text-red-400",title:c.label,subtitle:c.sublabel,accent:"border-red-500/60"}))}function tj(s){const c=qt(s);return Xt(l.jsx(Pt,{icon:Pm,iconClass:"text-orange-300",title:c.label,subtitle:c.sublabel,accent:"border-orange-500/40"}))}function nj(s){return l.jsxs(l.Fragment,{children:[l.jsx(Tl,{type:"target",position:Cl.Top,className:"bg-zinc-600! w-1.5! h-1.5! border-0!"}),l.jsx("div",{className:"w-3 h-3 rounded-full bg-zinc-600 border border-zinc-500"}),l.jsx(Tl,{type:"source",position:Cl.Bottom,className:"bg-zinc-600! w-1.5! h-1.5! border-0!"})]})}const dx=Et("/workflows/$name")({component:lj});function lj(){var T,k;const{name:s}=dx.useParams(),[c,o]=A.useState(""),[u,d]=A.useState(1),[h,m]=A.useState("runs"),x=25,{data:b,isLoading:N}=Uy(s),y=Ly(s),{data:v,isLoading:j}=p1(s,{status:c||void 0,limit:x,offset:(u-1)*x});if(N)return l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Oe,{className:"w-6 h-6 text-zinc-500 animate-spin"})});if(!b)return l.jsx("div",{className:"p-8",children:l.jsx(Xe,{icon:l.jsx(ga,{className:"w-10 h-10"}),title:"Workflow not found",description:l.jsxs(l.Fragment,{children:["No workflow named",l.jsx("code",{className:"font-mono text-[12px] bg-raised border border-zinc-800 rounded px-1.5 py-0.5 mx-1 text-zinc-100",children:s}),"is registered. Workflows live in",l.jsx("code",{className:"font-mono text-[12px] bg-raised border border-zinc-800 rounded px-1.5 py-0.5 mx-1 text-zinc-100",children:"triggers/http/src/workflows/"}),"and are discovered on trigger startup. Did you commit the file but forget to restart the dev orchestrator?"]})})});const R=[{key:"runs",label:"Runs"},{key:"graph",label:"Graph"},{key:"definition",label:"Definition"},{key:"metrics",label:"Metrics"}];return l.jsxs("div",{className:"p-6 max-w-7xl mx-auto space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(De,{to:"/",className:"p-1 rounded hover:bg-zinc-800 text-zinc-500 hover:text-zinc-300 transition-colors",children:l.jsx(Jo,{className:"w-4 h-4"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("h1",{className:"text-lg font-semibold text-zinc-100",children:s}),l.jsxs("p",{className:"text-sm text-zinc-500",children:[b.triggerTypes.join(", ")," · ",b.totalRuns," runs · avg"," ",ge(b.avgDurationMs)," · ",Pn(b.errorRate)," errors"]})]}),l.jsx(aj,{source:(T=b.examples)==null?void 0:T.source,onRerecord:()=>y.mutate(),pending:y.isPending,error:y.error})]}),l.jsx(Bo,{}),l.jsx("div",{className:"flex gap-0 border-b border-zinc-800",children:R.map(M=>l.jsx("button",{type:"button",onClick:()=>m(M.key),className:q("px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px",h===M.key?"border-blok-green-500 text-zinc-100":"border-transparent text-zinc-500 hover:text-zinc-300"),children:M.label},M.key))}),h==="runs"&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex-1",children:l.jsx(ix,{status:c,onStatusChange:o})}),l.jsx(rx,{onExportJson:()=>Uh({workflow:s,status:c||void 0}),onExportCsv:()=>Lh({workflow:s,status:c||void 0}),label:"Export All"})]}),j?l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(Oe,{className:"w-5 h-5 text-zinc-500 animate-spin"})}):v&&v.runs.length>0?l.jsx(cx,{runs:v.runs,total:v.total,page:u,limit:x,onPageChange:d,enableCompare:!0}):c?l.jsx(Xe,{icon:l.jsx(ga,{className:"w-10 h-10"}),title:`No ${c} runs match`,description:`Across the loaded window, none of ${b.name}'s runs have status "${c}". Either it's been quiet or the filter is too tight.`,action:l.jsx("button",{type:"button",onClick:()=>o(""),className:"px-3 py-1.5 rounded-md text-xs font-semibold bg-blok-green-500 text-[#00231b] hover:bg-blok-green-600 transition-colors",children:"Clear filter"})}):l.jsx(Xe,{icon:l.jsx(ga,{className:"w-10 h-10"}),title:"No runs yet",description:l.jsxs(l.Fragment,{children:["This workflow exists but hasn't been triggered. Try the curl below — it'll exercise the",l.jsx("code",{className:"font-mono text-[12px] bg-raised border border-zinc-800 rounded px-1.5 py-0.5 mx-1 text-zinc-100",children:b.name}),"path end-to-end."]}),snippets:[{lang:sj((k=b.examples)==null?void 0:k.source),code:ij(b)}]})]}),h==="graph"&&(b.definition?l.jsx(H1,{definition:b.definition}):l.jsx(Xe,{icon:l.jsx(El,{className:"w-10 h-10"}),title:"Definition unavailable",description:l.jsxs(l.Fragment,{children:["Studio reads the workflow structure from the runner's in-process registry. Either the runner hasn't registered this workflow yet (restart the trigger to rescan) or it's an older deployment that predates the",l.jsx("code",{className:"font-mono text-[12px] bg-raised border border-zinc-800 rounded px-1.5 py-0.5 mx-1 text-zinc-100",children:"GET /__blok/workflows/:name → definition"}),'surface. The "Definition" tab still shows what we know.']})})),h==="definition"&&l.jsx("div",{className:"rounded-lg border border-zinc-800 bg-overlay p-4",children:l.jsx(Qt,{data:b.definition||{nodeNames:b.nodeNames,runtimes:b.runtimes}})}),h==="metrics"&&l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[l.jsx(Wn,{label:"Total Runs",value:String(b.totalRuns)}),l.jsx(Wn,{label:"Recent (24h)",value:String(b.recentRuns)}),l.jsx(Wn,{label:"Avg Duration",value:ge(b.avgDurationMs)}),l.jsx(Wn,{label:"P95 Duration",value:ge(b.p95DurationMs)}),l.jsx(Wn,{label:"Error Rate",value:Pn(b.errorRate)}),l.jsx(Wn,{label:"Runtimes",value:b.runtimes.join(", ")||"—"}),l.jsx(Wn,{label:"Nodes",value:String(b.nodeNames.length)}),l.jsx(Wn,{label:"Triggers",value:b.triggerTypes.join(", ")})]})]})}function Wn({label:s,value:c}){return l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-overlay p-4",children:[l.jsx("div",{className:"text-xs text-zinc-500 mb-1",children:s}),l.jsx("div",{className:"text-lg font-semibold text-zinc-100 font-mono",children:c})]})}function aj({source:s,onRerecord:c,pending:o,error:u}){if(!s)return null;const h={author:"Sample: author-declared",recorded:"Sample: recorded from a real run",inferred:"Sample: inferred from step inputs",empty:"Sample: none"}[s]??"Sample: ?",m=u instanceof Wo||u instanceof Error?u.message:null;return l.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[l.jsx("span",{className:"hidden sm:inline",title:"The provenance of the curl example body shown in the empty-state.",children:h}),s==="recorded"&&l.jsxs("button",{type:"button",onClick:c,disabled:o,className:"inline-flex items-center gap-1 px-2 py-1 rounded-md border border-zinc-800 bg-overlay text-zinc-300 hover:text-zinc-100 hover:border-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:"Delete the recorded sample so the next successful run captures a fresh body. Requires `recordSample: true` on the workflow's HTTP trigger to actually re-record.",children:[o?l.jsx(Oe,{className:"w-3 h-3 animate-spin"}):l.jsx(Xo,{className:"w-3 h-3"}),l.jsx("span",{children:o?"Clearing…":"Re-record"})]}),m&&l.jsx("span",{className:"text-status-failed text-[11px]",title:m,children:m})]})}function sj(s){return s==="author"?"curl · http (example body)":s==="recorded"?"curl · http (recorded body)":"curl · http"}function ij(s){var m;const c=cj(s.definition),o=((c==null?void 0:c.method)??"POST").toUpperCase(),u=(c==null?void 0:c.path)??s.path??`/${s.name}`,d=`http://localhost:4000${u.startsWith("/")?u:`/${u}`}`;if(o==="GET"||o==="HEAD"||o==="DELETE")return`curl -X ${o} ${d}`;const h=JSON.stringify(((m=s.examples)==null?void 0:m.body)??{},null,2);return`curl -X ${o} ${d} \\
|
|
36
|
+
-H 'content-type: application/json' \\
|
|
37
|
+
-d '${h}'`}function cj(s){if(!s||typeof s!="object")return null;const c=s.trigger;if(!c||typeof c!="object")return null;const o=c.http;if(!o||typeof o!="object")return null;const u=o;return{method:typeof u.method=="string"?u.method:void 0,path:typeof u.path=="string"?u.path:void 0}}function fx({ms:s,running:c,className:o}){return l.jsxs("span",{className:q("inline-flex items-center gap-1 text-xs font-mono",c?"text-blue-400":"text-zinc-400",o),children:[l.jsx(Na,{className:"w-3 h-3"}),c?l.jsx(rj,{startedAt:s||Date.now()}):ge(s)]})}function rj({startedAt:s}){const[c,o]=A.useState(Date.now()-s);return A.useEffect(()=>{const u=setInterval(()=>o(Date.now()-s),100);return()=>clearInterval(u)},[s]),l.jsx(l.Fragment,{children:ge(c)})}function oj({runA:s,runB:c}){const[o,u]=A.useState("overview"),[d,h]=A.useState(null),m=[{key:"overview",label:"Overview"},{key:"nodes",label:"Node Comparison"},{key:"outputs",label:"Output Diff"}],x=A.useMemo(()=>{const b=new Map,N=new Map;for(const v of s.nodes)b.set(v.nodeName,v);for(const v of c.nodes)N.set(v.nodeName,v);const y=new Set([...b.keys(),...N.keys()]);return Array.from(y).map(v=>({name:v,nodeA:b.get(v),nodeB:N.get(v)}))},[s.nodes,c.nodes]);return l.jsxs("div",{className:"p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(Em,{run:s,label:"Run A"}),l.jsx(Em,{run:c,label:"Run B"})]}),l.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[l.jsx(Fi,{label:"Duration",valueA:ge(s.run.durationMs),valueB:ge(c.run.durationMs),comparison:mj(s.run.durationMs,c.run.durationMs)}),l.jsx(Fi,{label:"Status",valueA:s.run.status,valueB:c.run.status,comparison:s.run.status===c.run.status?"same":"different"}),l.jsx(Fi,{label:"Nodes",valueA:`${s.run.completedNodes}/${s.run.nodeCount}`,valueB:`${c.run.completedNodes}/${c.run.nodeCount}`,comparison:s.run.completedNodes===c.run.completedNodes?"same":"different"}),l.jsx(Fi,{label:"Errors",valueA:s.run.error?"Yes":"No",valueB:c.run.error?"Yes":"No",comparison:!s.run.error&&!c.run.error||s.run.error&&c.run.error?"same":"different"})]}),l.jsx("div",{className:"flex gap-0 border-b border-zinc-800",children:m.map(b=>l.jsx("button",{type:"button",onClick:()=>u(b.key),className:q("px-3 py-2 text-sm font-medium transition-colors border-b-2 -mb-px",o===b.key?"border-blue-500 text-zinc-100":"border-transparent text-zinc-500 hover:text-zinc-300"),children:b.label},b.key))}),o==="overview"&&l.jsx(uj,{runA:s,runB:c,nodeComparison:x}),o==="nodes"&&l.jsx(dj,{nodeComparison:x,selectedNode:d,onSelectNode:h,runA:s,runB:c}),o==="outputs"&&l.jsx(fj,{nodeComparison:x})]})}function Em({run:s,label:c}){return l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/50 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:c}),l.jsx(Es,{status:s.run.status})]}),l.jsx(De,{to:"/runs/$runId",params:{runId:s.run.id},className:"text-sm font-mono text-blue-400 hover:text-blue-300",children:s.run.id.slice(0,16)}),l.jsxs("div",{className:"mt-2 space-y-1 text-xs text-zinc-500",children:[l.jsxs("div",{children:["Trigger: ",l.jsx("span",{className:"text-zinc-400 font-mono",children:s.run.triggerSummary})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Na,{className:"w-3 h-3"}),l.jsx("span",{className:"text-zinc-400",children:sc(s.run.startedAt)})]}),l.jsxs("div",{children:["Duration: ",l.jsx(fx,{ms:s.run.durationMs})]}),l.jsxs("div",{children:["Nodes:"," ",l.jsxs("span",{className:"text-zinc-400",children:[s.run.completedNodes,"/",s.run.nodeCount]})]})]})]})}function Fi({label:s,valueA:c,valueB:o,comparison:u}){return l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/50 p-3",children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-600 mb-1",children:s}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-mono text-zinc-300",children:c}),l.jsx(Ko,{className:"w-3 h-3 text-zinc-600"}),l.jsx("span",{className:q("text-sm font-mono",u==="same"&&"text-zinc-300",u==="better"&&"text-green-400",u==="worse"&&"text-red-400",u==="different"&&"text-amber-400"),children:o})]})]})}function uj({runA:s,runB:c,nodeComparison:o}){const u=Math.max(...[...s.nodes,...c.nodes].map(d=>d.durationMs||0).filter(d=>d>0),1);return l.jsxs("div",{className:"space-y-4",children:[l.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-zinc-600",children:"Timeline Comparison"}),l.jsx("div",{className:"space-y-2",children:o.map(({name:d,nodeA:h,nodeB:m})=>l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/50 p-3",children:[l.jsx("div",{className:"text-xs font-medium text-zinc-300 mb-2",children:d}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] text-zinc-600 w-6",children:"A"}),h?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex-1 h-4 bg-zinc-800 rounded overflow-hidden",children:l.jsx("div",{className:q("h-full rounded transition-all",h.status==="completed"&&"bg-green-500/60",h.status==="failed"&&"bg-red-500/60",h.status==="running"&&"bg-blue-500/60",h.status==="skipped"&&"bg-zinc-600"),style:{width:`${Math.max((h.durationMs||0)/u*100,2)}%`}})}),l.jsx("span",{className:"text-[10px] font-mono text-zinc-500 w-16 text-right",children:ge(h.durationMs)})]}):l.jsx("span",{className:"text-[10px] text-zinc-600 italic",children:"not present"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] text-zinc-600 w-6",children:"B"}),m?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex-1 h-4 bg-zinc-800 rounded overflow-hidden",children:l.jsx("div",{className:q("h-full rounded transition-all",m.status==="completed"&&"bg-blue-500/60",m.status==="failed"&&"bg-red-500/60",m.status==="running"&&"bg-blue-500/60",m.status==="skipped"&&"bg-zinc-600"),style:{width:`${Math.max((m.durationMs||0)/u*100,2)}%`}})}),l.jsx("span",{className:"text-[10px] font-mono text-zinc-500 w-16 text-right",children:ge(m.durationMs)})]}):l.jsx("span",{className:"text-[10px] text-zinc-600 italic",children:"not present"})]})]})]},d))})]})}function dj({nodeComparison:s,selectedNode:c,onSelectNode:o,runA:u,runB:d}){const h=s.find(m=>m.name===c);return l.jsxs("div",{className:"flex gap-4",children:[l.jsx("div",{className:"w-64 space-y-1",children:s.map(({name:m,nodeA:x,nodeB:b})=>{const N=(x==null?void 0:x.status)===(b==null?void 0:b.status),y=(x==null?void 0:x.durationMs)!==void 0&&(b==null?void 0:b.durationMs)!==void 0?b.durationMs-x.durationMs:null;return l.jsxs("button",{type:"button",onClick:()=>o(c===m?null:m),className:q("w-full text-left rounded-md px-3 py-2 text-sm transition-colors",c===m?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:bg-zinc-800/50 hover:text-zinc-200"),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[N?l.jsx(nc,{className:"w-3 h-3 text-green-500 shrink-0"}):x&&b?l.jsx(Ag,{className:"w-3 h-3 text-amber-500 shrink-0"}):l.jsx(Fm,{className:"w-3 h-3 text-red-500 shrink-0"}),l.jsx("span",{className:"truncate",children:m})]}),y!==null&&l.jsx("div",{className:"text-[10px] mt-0.5 ml-5",children:l.jsxs("span",{className:q("font-mono",y>0?"text-red-400":y<0?"text-green-400":"text-zinc-600"),children:[y>0?"+":"",ge(Math.abs(y))]})})]},m)})}),l.jsx("div",{className:"flex-1",children:h?l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(Tm,{node:h.nodeA,label:"Run A",logs:u.logs.filter(m=>m.nodeName===h.name)}),l.jsx(Tm,{node:h.nodeB,label:"Run B",logs:d.logs.filter(m=>m.nodeName===h.name)})]}):l.jsx("div",{className:"flex items-center justify-center h-48 text-zinc-600 text-sm",children:"Select a node to compare details"})})]})}function Tm({node:s,label:c,logs:o}){return s?l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/50 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-600",children:c}),l.jsx(Es,{status:s.status})]}),l.jsxs("div",{className:"space-y-1 text-xs text-zinc-500",children:[l.jsxs("div",{children:["Duration: ",l.jsx("span",{className:"text-zinc-300 font-mono",children:ge(s.durationMs)})]}),l.jsxs("div",{children:["Type: ",l.jsx("span",{className:"text-zinc-400",children:s.nodeType})]}),s.runtimeKind&&l.jsxs("div",{children:["Runtime: ",l.jsx("span",{className:"text-zinc-400",children:s.runtimeKind})]})]}),s.error&&l.jsx("div",{className:"bg-red-500/10 border border-red-500/20 rounded p-2 text-xs text-red-400",children:s.error.message}),s.inputs!==void 0&&l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-600 mb-1",children:"Input"}),l.jsx("div",{className:"max-h-32 overflow-y-auto",children:l.jsx(Qt,{data:s.inputs})})]}),s.outputs!==void 0&&l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-600 mb-1",children:"Output"}),l.jsx("div",{className:"max-h-32 overflow-y-auto",children:l.jsx(Qt,{data:s.outputs})})]}),o.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-600 mb-1",children:["Logs (",o.length,")"]}),l.jsx("div",{className:"max-h-24 overflow-y-auto space-y-0.5",children:o.map(u=>l.jsxs("div",{className:"text-[10px] font-mono text-zinc-500 truncate",children:[l.jsxs("span",{className:q(u.level==="error"&&"text-red-400",u.level==="warn"&&"text-amber-400",u.level==="info"&&"text-blue-400"),children:["[",u.level,"]"]})," ",u.message]},u.id))})]})]}):l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/50 p-4 text-center text-zinc-600 text-sm",children:[c,": Not present in this run"]})}function fj({nodeComparison:s}){const c=s.filter(({nodeA:o,nodeB:u})=>(o==null?void 0:o.outputs)!==void 0||(u==null?void 0:u.outputs)!==void 0);return c.length===0?l.jsx("div",{className:"flex items-center justify-center h-48 text-zinc-600 text-sm",children:"No node outputs to compare"}):l.jsx("div",{className:"space-y-4",children:c.map(({name:o,nodeA:u,nodeB:d})=>{const h=JSON.stringify(u==null?void 0:u.outputs)===JSON.stringify(d==null?void 0:d.outputs);return l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/50 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx("span",{className:"text-sm font-medium text-zinc-300",children:o}),h?l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-green-500/10 text-green-400",children:"Identical"}):l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-400",children:"Different"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-600 mb-1",children:"Run A Output"}),l.jsx("div",{className:"max-h-48 overflow-y-auto rounded bg-zinc-950 p-2",children:(u==null?void 0:u.outputs)!==void 0?l.jsx(Qt,{data:u.outputs}):l.jsx("span",{className:"text-xs text-zinc-600",children:"No output"})})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-600 mb-1",children:"Run B Output"}),l.jsx("div",{className:"max-h-48 overflow-y-auto rounded bg-zinc-950 p-2",children:(d==null?void 0:d.outputs)!==void 0?l.jsx(Qt,{data:d.outputs}):l.jsx("span",{className:"text-xs text-zinc-600",children:"No output"})})]})]})]},o)})})}function mj(s,c){if(s===void 0||c===void 0)return"different";if(s===c)return"same";const o=Math.abs(c-s),u=Math.max(s,c)*.1;return o<u?"same":c<s?"better":"worse"}const mx=Et("/runs/diff")({validateSearch:s=>({a:s.a,b:s.b}),component:hj});function hj(){const{a:s,b:c}=mx.useSearch(),{data:o,isLoading:u,error:d}=Rv(s||"",c||"");return!s||!c?l.jsx("div",{className:"p-6",children:l.jsx(Xe,{icon:l.jsx(vs,{className:"w-12 h-12"}),title:"Select two runs to compare",description:"Use the compare button on the workflow runs table to select two runs for side-by-side comparison."})}):u?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Oe,{className:"w-6 h-6 text-zinc-500 animate-spin"})}):d||!o?l.jsx("div",{className:"p-6",children:l.jsx(Xe,{icon:l.jsx(vs,{className:"w-12 h-12"}),title:"Comparison failed",description:d instanceof Error?d.message:"Could not load the runs for comparison."})}):l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"shrink-0 border-b border-zinc-800 bg-canvas/60 px-4 py-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(De,{to:"/runs",className:"p-1 rounded hover:bg-zinc-800 text-zinc-500 hover:text-zinc-300 transition-colors",children:l.jsx(Jo,{className:"w-4 h-4"})}),l.jsx(vs,{className:"w-4 h-4 text-zinc-500"}),l.jsx("h1",{className:"text-sm font-medium text-zinc-200",children:"Run Comparison"}),l.jsx("span",{className:"text-xs text-zinc-600",children:o.runA.run.workflowName})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsx(oj,{runA:o.runA,runB:o.runB})})]})}function xj({runId:s,tags:c}){const[o,u]=A.useState(!1),[d,h]=A.useState(""),m=kv(s),x=Dv(s),b=()=>{const y=d.trim();if(!y||c.includes(y)){h("");return}m.mutate([y],{onSuccess:()=>{h(""),u(!1)}})},N=y=>{y.key==="Enter"?(y.preventDefault(),b()):y.key==="Escape"&&(u(!1),h(""))};return l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[l.jsx(Mg,{className:"w-3 h-3 text-zinc-600 shrink-0"}),c.map(y=>l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded bg-zinc-700/50 text-zinc-400 group",children:[y,l.jsx("button",{type:"button",onClick:()=>x.mutate(y),className:"opacity-0 group-hover:opacity-100 transition-opacity hover:text-zinc-200",title:`Remove tag "${y}"`,children:l.jsx(Kt,{className:"w-2.5 h-2.5"})})]},y)),o?l.jsx("input",{type:"text",value:d,onChange:y=>h(y.target.value),onKeyDown:N,onBlur:()=>{d.trim()||u(!1)},placeholder:"tag name",className:"text-[10px] px-1.5 py-0.5 rounded bg-raised border border-zinc-800 text-zinc-300 outline-none focus:border-blok-green-500 w-20"}):l.jsxs("button",{type:"button",onClick:()=>u(!0),className:q("inline-flex items-center gap-0.5 text-[10px] px-1.5 py-0.5 rounded","text-zinc-600 hover:text-zinc-400 hover:bg-zinc-800 transition-colors"),title:"Add tag",children:[l.jsx(zl,{className:"w-2.5 h-2.5"}),"tag"]})]})}function hx({runId:s,nodeId:c,compact:o}){const[u,d]=A.useState("idle"),[h,m]=A.useState(""),[x,b]=A.useState(""),[N,y]=A.useState(""),v=async()=>{d("loading"),y("");try{const R=await Vh(s,c);m(R.explanation),b(R.model),d("done")}catch(R){y(R instanceof Error?R.message:"Failed to get explanation"),d("error")}},j=()=>{d("idle"),m(""),b(""),y("")};return u==="idle"?l.jsxs("button",{type:"button",onClick:v,className:q("flex items-center gap-1.5 rounded-md text-xs font-medium transition-colors",o?"px-2 py-1 bg-purple-600/20 text-purple-400 hover:bg-purple-600/30":"px-2.5 py-1 bg-zinc-800 text-purple-400 hover:bg-zinc-700 hover:text-purple-300"),title:"Explain this error using AI",children:[l.jsx(Eo,{className:"w-3 h-3"}),"Explain Error"]}):u==="loading"?l.jsxs("div",{className:q("flex items-center gap-2 text-xs text-purple-400",o?"px-2 py-1":"px-2.5 py-1"),children:[l.jsx(Oe,{className:"w-3 h-3 animate-spin"}),l.jsx("span",{children:"Analyzing error..."})]}):u==="error"?l.jsxs("div",{className:q("space-y-2",o?"":"mt-2"),children:[l.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-900/50 bg-amber-950/30 px-3 py-2",children:[l.jsx(Wm,{className:"w-3.5 h-3.5 text-amber-400 shrink-0"}),l.jsx("span",{className:"text-xs text-amber-300",children:N}),l.jsx("button",{type:"button",onClick:j,className:"ml-auto p-0.5 text-amber-500 hover:text-amber-300",children:l.jsx(Kt,{className:"w-3 h-3"})})]}),l.jsxs("button",{type:"button",onClick:v,className:"flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-purple-600/20 text-purple-400 hover:bg-purple-600/30 transition-colors",children:[l.jsx(Eo,{className:"w-3 h-3"}),"Try Again"]})]}):l.jsxs("div",{className:q("rounded-md border border-purple-900/50 bg-purple-950/20",o?"mt-2":"mt-3"),children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-purple-900/30",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Eo,{className:"w-3 h-3 text-purple-400"}),l.jsx("span",{className:"text-xs font-medium text-purple-300",children:"AI Explanation"}),l.jsxs("span",{className:"text-[10px] text-purple-500",children:["(",x,")"]})]}),l.jsx("button",{type:"button",onClick:j,className:"p-0.5 text-purple-500 hover:text-purple-300 transition-colors",children:l.jsx(Kt,{className:"w-3 h-3"})})]}),l.jsx("div",{className:"p-3 text-xs text-zinc-300 leading-relaxed prose-invert max-h-80 overflow-y-auto",children:l.jsx(pj,{content:h})})]})}function pj({content:s}){var u;const c=s.split(`
|
|
38
|
+
`),o=[];for(let d=0;d<c.length;d++){const h=c[d]??"";if(h.startsWith("### "))o.push(l.jsx("h4",{className:"text-sm font-semibold text-zinc-200 mt-3 mb-1",children:h.slice(4)},d));else if(h.startsWith("## "))o.push(l.jsx("h3",{className:"text-sm font-bold text-zinc-100 mt-3 mb-1",children:h.slice(3)},d));else if(h.startsWith("# "))o.push(l.jsx("h2",{className:"text-base font-bold text-zinc-100 mt-3 mb-1",children:h.slice(2)},d));else if(h.startsWith("- ")||h.startsWith("* "))o.push(l.jsx("li",{className:"ml-4 list-disc text-zinc-300",children:l.jsx(Ao,{text:h.slice(2)})},d));else if(/^\d+\.\s/.test(h)){const m=h.replace(/^\d+\.\s/,"");o.push(l.jsx("li",{className:"ml-4 list-decimal text-zinc-300",children:l.jsx(Ao,{text:m})},d))}else if(h.startsWith("```")){const m=[];for(d++;d<c.length&&!((u=c[d])!=null&&u.startsWith("```"));)m.push(c[d]??""),d++;o.push(l.jsx("pre",{className:"bg-zinc-900 rounded p-2 my-1 text-[11px] font-mono text-zinc-300 overflow-x-auto",children:m.join(`
|
|
39
|
+
`)},d))}else h.trim()===""?o.push(l.jsx("br",{},d)):o.push(l.jsx("p",{className:"text-zinc-300 my-0.5",children:l.jsx(Ao,{text:h})},d))}return l.jsx(l.Fragment,{children:o})}function Ao({text:s}){const c=s.split(/(\*\*.*?\*\*|`[^`]+`)/g);return l.jsx(l.Fragment,{children:c.map((o,u)=>o.startsWith("**")&&o.endsWith("**")?l.jsx("strong",{className:"font-semibold text-zinc-200",children:o.slice(2,-2)},`strong-${u}`):o.startsWith("`")&&o.endsWith("`")?l.jsx("code",{className:"bg-zinc-800 rounded px-1 py-0.5 text-[11px] font-mono text-purple-300",children:o.slice(1,-1)},`code-${u}`):l.jsx("span",{children:o},`span-${u}`))})}function bj({error:s,stepName:c,stepIndex:o,totalSteps:u,runtimeKind:d,transport:h,finishedAt:m,runId:x,nodeId:b}){const N=!!s.category||!!s.severity||typeof s.retryable=="boolean"||!!s.remediation||!!s.docUrl||s.causes&&s.causes.length>0;return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs("section",{className:"bg-red-950/30 border-b border-red-900/50 px-8 py-6",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4 font-mono text-[11px]",children:[l.jsx(Rm,{category:s.category}),l.jsx(zj,{severity:s.severity}),typeof s.retryable=="boolean"&&s.retryable&&l.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full font-semibold uppercase tracking-[0.06em] text-[10px] bg-blue-500/15 text-blue-400 border border-blue-500/30",children:[l.jsx(Xo,{className:"w-2.5 h-2.5"}),"retryable",typeof s.retryAfterMs=="number"&&s.retryAfterMs>0&&l.jsxs("span",{className:"opacity-70",children:["· ",jj(s.retryAfterMs)]})]}),l.jsxs("span",{className:"ml-auto text-zinc-500 truncate",children:["step ",l.jsx("span",{className:"text-zinc-200 font-medium",children:c}),d&&l.jsxs("span",{className:"text-zinc-600",children:[" · ",d]}),h&&l.jsxs("span",{className:"text-zinc-600",children:[" · ",h]}),m&&l.jsxs("span",{className:"text-zinc-600",children:[" · ",new Date(m).toISOString().slice(11,19)]})]})]}),l.jsx("h2",{className:"font-mono text-lg leading-snug font-medium text-zinc-100 mb-3 break-words",children:l.jsx(gj,{code:s.code,message:s.message})}),(s.description||N)&&l.jsx("p",{className:"text-[13px] text-zinc-300 leading-relaxed font-mono whitespace-pre-wrap max-w-3xl",children:s.description??yj(s)})]}),l.jsxs("section",{className:"px-8 py-6 space-y-6",children:[s.remediation&&l.jsxs("div",{children:[l.jsx(ys,{children:"Remediation"}),l.jsxs("div",{className:"rounded-r-md border-l-[3px] border-blok-green-500 bg-overlay px-4 py-3",children:[l.jsx("p",{className:"text-[13px] text-zinc-100 leading-relaxed whitespace-pre-wrap",children:s.remediation}),s.docUrl&&l.jsxs("a",{href:s.docUrl,target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1.5 mt-2.5 font-mono text-[12px] text-blok-green-500 hover:text-blok-green-600 hover:underline font-medium",children:[l.jsx(Og,{className:"w-3.5 h-3.5"}),vj(s.docUrl)]})]})]}),l.jsxs("div",{children:[l.jsx(ys,{children:"AI explain"}),l.jsx("div",{className:"rounded-md bg-overlay border border-zinc-800 px-4 py-3",children:l.jsx(hx,{runId:x,nodeId:b,compact:!0})})]}),s.details!==void 0&&s.details!==null&&l.jsxs("div",{children:[l.jsx(ys,{children:"Details"}),l.jsx(Cm,{snapshot:s.details})]}),s.causes&&s.causes.length>0&&l.jsxs("div",{children:[l.jsxs(ys,{children:["Causes"," ",l.jsxs("span",{className:"text-zinc-600 font-normal normal-case tracking-normal",children:["· ",s.causes.length]})]}),l.jsxs("div",{className:"rounded-md border border-zinc-800 bg-overlay overflow-hidden",children:[l.jsxs("div",{className:"grid grid-cols-[100px_1fr_auto] gap-3 px-4 py-2 text-[10px] uppercase tracking-[0.06em] text-zinc-500 border-b border-zinc-800 bg-canvas/40 font-semibold",children:[l.jsx("span",{children:"category"}),l.jsx("span",{children:"code · message"}),l.jsx("span",{children:"idx"})]}),s.causes.map((y,v)=>{const j=y.code??"uncoded",R=y.message??"",T=y.category,k=j==="uncoded"&&!R?`uncoded-${v}`:`${j}::${R.slice(0,32)}`;return l.jsxs("div",{className:"grid grid-cols-[100px_1fr_auto] gap-3 px-4 py-2.5 border-b border-zinc-800 last:border-b-0 font-mono text-[12px] items-baseline",children:[l.jsx("span",{className:"text-[10px]",children:l.jsx(Rm,{category:T,compact:!0})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-zinc-100 truncate",children:j}),R&&l.jsx("div",{className:"text-zinc-400 text-[11.5px] mt-0.5 break-words",children:R})]}),l.jsxs("span",{className:"text-zinc-600 text-[11px]",children:["#",v+1]})]},k)})]})]}),s.contextSnapshot!==void 0&&s.contextSnapshot!==null&&l.jsxs("div",{children:[l.jsx(ys,{children:"Context snapshot"}),l.jsx(Cm,{snapshot:s.contextSnapshot})]}),s.stack&&l.jsxs("details",{children:[l.jsx("summary",{className:"cursor-pointer text-[11px] uppercase tracking-[0.08em] text-zinc-500 font-semibold hover:text-zinc-300 select-none mb-2",children:"Stack trace"}),l.jsx("pre",{className:"rounded-md border border-zinc-800 bg-overlay px-4 py-3 font-mono text-[11px] leading-relaxed text-zinc-400 whitespace-pre-wrap break-all max-h-72 overflow-y-auto",children:s.stack})]}),!N&&l.jsx("p",{className:"text-[11px] text-zinc-500 italic",children:"Untyped error — adopt `BlokError` to surface category, remediation, and causes here."}),l.jsxs("p",{className:"text-[11px] font-mono text-zinc-600 pt-2 border-t border-zinc-800",children:["Failed at step ",l.jsx("span",{className:"text-zinc-300",children:o+1})," of ",u,"."," ",l.jsx("span",{className:"text-zinc-500",children:"Subsequent steps were skipped."})]})]})]})}function ys({children:s}){return l.jsx("h3",{className:"text-[11px] uppercase tracking-[0.08em] text-zinc-500 font-semibold mb-2",children:s})}function gj({code:s,message:c}){const o=/\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+|localhost:\d+)\b/,u=c.match(o),d=u?c.slice(0,u.index):c,h=u?u[0]:"",m=u?c.slice((u.index??0)+h.length):"";return l.jsxs(l.Fragment,{children:[s&&l.jsx("span",{className:"text-amber-400/95",children:s}),s&&l.jsx("span",{className:"text-zinc-500",children:": "}),l.jsx("span",{className:"text-zinc-300",children:d}),h&&l.jsx("span",{className:"text-blok-green-500",children:h}),l.jsx("span",{className:"text-zinc-300",children:m})]})}function yj(s){const c=s.category;return c==="DEPENDENCY"?"An upstream service the step depends on is unavailable. The runner will retry per the policy below; if retries exhaust the breaker opens for 30 s.":c==="TIMEOUT"?"The step exceeded its allowed runtime. This is usually a downstream slowness signal, not a bug in the node itself.":c==="VALIDATION"?"The step's input failed schema validation. Inputs are checked against the node's Zod schema before `execute()` is called.":c==="RATE_LIMIT"?"The step was rate-limited by a downstream service. Backoff is applied per the retry-after hint below.":"The step did not complete. Inspect the cause chain and context snapshot below for the operative state at the moment of failure."}function vj(s){try{const c=new URL(s);return`${c.host}${c.pathname}`.replace(/\/+$/,"")}catch{return s}}function jj(s){if(s<1e3)return`${s}ms`;const c=Math.round(s/1e3);return c<90?`${c}s`:`${Math.round(c/60)}m`}function Cm({snapshot:s}){if(!s||typeof s!="object"||Array.isArray(s))return l.jsx("div",{className:"rounded-md border border-zinc-800 bg-overlay px-4 py-3",children:l.jsx(Qt,{data:s,defaultExpanded:!1})});const c=Object.entries(s),o=c.filter(([,d])=>d==null||typeof d!="object"),u=c.filter(([,d])=>d!=null&&typeof d=="object");return l.jsxs("div",{className:"rounded-md border border-zinc-800 bg-overlay overflow-hidden",children:[l.jsx("div",{className:"grid grid-cols-2",children:o.map(([d,h],m)=>l.jsxs("div",{className:q("px-4 py-2.5 font-mono text-[11.5px]","border-zinc-800",m%2===0?"border-r":"",m<o.length-2?"border-b":"",o.length%2===1&&m===o.length-1?"col-span-2":""),children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.06em] text-zinc-500 mb-1",children:d}),l.jsx("div",{className:"text-zinc-100 break-all",children:Nj(h)})]},d))}),u.length>0&&l.jsxs("details",{className:"border-t border-zinc-800 px-4 py-2",children:[l.jsxs("summary",{className:"cursor-pointer text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold hover:text-zinc-300 select-none",children:["nested (",u.length,")"]}),l.jsx("div",{className:"mt-2",children:l.jsx(Qt,{data:Object.fromEntries(u),defaultExpanded:!1})})]})]})}function Nj(s){return s==null?"—":typeof s=="string"?s:typeof s=="number"?String(s):typeof s=="boolean"?s?"true":"false":JSON.stringify(s)}function Rm({category:s,compact:c}){if(!s)return null;const o={VALIDATION:"bg-blue-500/15 text-blue-300 border-blue-500/30",CONFIGURATION:"bg-zinc-700/40 text-zinc-300 border-zinc-600/40",DEPENDENCY:"bg-orange-500/15 text-orange-300 border-orange-500/30",TIMEOUT:"bg-amber-500/15 text-amber-300 border-amber-500/30",PERMISSION:"bg-violet-500/15 text-violet-300 border-violet-500/30",RATE_LIMIT:"bg-rose-500/15 text-rose-300 border-rose-500/30",NOT_FOUND:"bg-sky-500/15 text-sky-300 border-sky-500/30",CONFLICT:"bg-purple-500/15 text-purple-300 border-purple-500/30",CANCELLED:"bg-zinc-700/40 text-zinc-400 border-zinc-600/40",INTERNAL:"bg-red-500/15 text-red-300 border-red-500/30",PROTOCOL:"bg-fuchsia-500/15 text-fuchsia-300 border-fuchsia-500/30",DATA:"bg-cyan-500/15 text-cyan-300 border-cyan-500/30"},u=o[s]??o.INTERNAL;return l.jsx("span",{className:q("font-mono uppercase tracking-[0.06em] font-semibold rounded-full border",c?"text-[10px] px-2 py-0.5":"text-[10px] px-2.5 py-0.5",u),children:s})}function zj({severity:s}){if(!s)return null;const c={INFO:"bg-blue-500/15 text-blue-300 border-blue-500/30",WARN:"bg-amber-500/15 text-amber-300 border-amber-500/30",ERROR:"bg-red-500/15 text-red-300 border-red-500/30",FATAL:"bg-red-500/25 text-red-200 border-red-500/40 ring-1 ring-red-500/40"};return l.jsx("span",{className:q("font-mono text-[10px] uppercase tracking-[0.06em] font-semibold rounded-full border px-2.5 py-0.5",c[s]??c.ERROR),children:s})}function Sj({node:s,logs:c,totalSteps:o,transport:u}){var N;const[d,h]=A.useState({input:!0,output:!0,logs:!1,live:!0});A.useEffect(()=>{h({input:!0,output:!0,logs:!1,live:!0})},[s.id]);const m=c.filter(y=>y.nodeId===s.id||y.nodeName===s.nodeName),x=!!s.error,b=u??Ej(s);return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsxs("header",{className:"px-8 pt-5 pb-3 border-b border-zinc-800 bg-canvas",children:[l.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[l.jsx(wj,{status:s.status}),l.jsx("h2",{className:"font-mono text-[18px] font-medium text-zinc-100 tracking-tight truncate",children:s.nodeName}),l.jsxs("span",{className:"font-mono text-[11.5px] text-zinc-500 shrink-0",children:["step ",s.stepIndex+1," / ",o,s.depth>0&&l.jsxs("span",{className:"text-zinc-600",children:[" · depth ",s.depth]})]})]}),l.jsxs("div",{className:"flex items-center flex-wrap gap-1.5 ml-5",children:[l.jsx(Ii,{children:s.nodeType}),b&&l.jsx(Ii,{accent:!0,children:b}),s.runtimeKind&&l.jsx(Ii,{children:s.runtimeKind}),((N=s.metrics)==null?void 0:N.request_bytes)!=null&&l.jsxs(Ii,{children:[l.jsx("span",{className:"text-zinc-500",children:"req"})," ",Tj(s.metrics.request_bytes)]})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[s.cached&&l.jsx("div",{className:"px-8 pt-5",children:l.jsxs("div",{className:"flex items-start gap-3 rounded-md border border-blok-green-500/30 bg-blok-green-500/5 px-4 py-3",children:[l.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded bg-blok-green-500/15 text-blok-green-500 shrink-0 mt-0.5",children:"cached"}),l.jsxs("div",{className:"text-[12px] text-zinc-300 leading-relaxed",children:["This step short-circuited via the idempotency cache.",l.jsxs("div",{className:"mt-1 text-zinc-500 font-mono text-[11px]",children:["source run"," ",l.jsx("a",{href:`/runs/${s.cached.sourceRunId}`,className:"text-zinc-300 hover:text-blok-green-500 underline decoration-zinc-700 hover:decoration-blok-green-500",children:s.cached.sourceRunId})," ","· cached ",Math.max(0,Math.floor((Date.now()-s.cached.cachedAt)/1e3)),"s ago"]})]})]})}),s.attempts&&s.attempts.length>0&&l.jsx("div",{className:"px-8 pt-5",children:l.jsxs("details",{className:"rounded-md border border-status-warning/30 bg-status-warning/5 px-4 py-3",children:[l.jsxs("summary",{className:"cursor-pointer text-[12px] text-zinc-200 font-medium select-none",children:[l.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded bg-status-warning/15 text-status-warning mr-2",children:"retry"}),s.attempts.length," failed attempt",s.attempts.length===1?"":"s"," before outcome"]}),l.jsx("ul",{className:"mt-3 space-y-2 text-[11.5px]",children:s.attempts.map(y=>l.jsxs("li",{className:"flex items-start gap-3 font-mono",children:[l.jsxs("span",{className:"text-zinc-500 shrink-0",children:["#",y.attempt]}),l.jsx("span",{className:"text-zinc-500 shrink-0",children:new Date(y.timestamp).toISOString().slice(11,23)}),l.jsx("span",{className:"text-status-failed wrap-break-word",children:y.error.message})]},y.timestamp))})]})}),s.progress&&l.jsx("div",{className:"px-8 pt-5",children:l.jsx(Cj,{percent:s.progress.percent,phase:s.progress.phase})}),s.partialResult&&l.jsx("div",{className:"px-8 pt-5",children:l.jsx(Wi,{title:"Partial result",subtitle:"live",open:d.live,onToggle:()=>h(y=>({...y,live:!y.live})),children:l.jsx(Qt,{data:s.partialResult.snapshot,defaultExpanded:!1})})}),x&&s.error&&l.jsx(bj,{error:s.error,stepName:s.nodeName,stepIndex:s.stepIndex,totalSteps:o,runtimeKind:s.runtimeKind,transport:b,finishedAt:s.finishedAt,runId:s.runId,nodeId:s.id}),!x&&l.jsxs("div",{className:"px-8 py-5 space-y-5",children:[s.inputs!==void 0&&s.inputs!==null&&l.jsx(Wi,{title:"Input",subtitle:km(s.inputs),open:d.input,onToggle:()=>h(y=>({...y,input:!y.input})),children:l.jsx(Qt,{data:s.inputs,defaultExpanded:!1})}),s.outputs!==void 0&&s.outputs!==null&&l.jsx(Wi,{title:"Output",subtitle:km(s.outputs),open:d.output,onToggle:()=>h(y=>({...y,output:!y.output})),children:l.jsx(Qt,{data:s.outputs,defaultExpanded:!1})}),m.length>0&&l.jsx(Wi,{title:"Logs",subtitle:`${m.length} ${m.length===1?"entry":"entries"}`,open:d.logs,onToggle:()=>h(y=>({...y,logs:!y.logs})),children:l.jsx("div",{className:"font-mono text-[11.5px] leading-relaxed max-h-72 overflow-y-auto",children:m.map(y=>l.jsxs("div",{className:"grid grid-cols-[88px_56px_1fr] gap-3 py-1 border-b border-zinc-800 last:border-b-0",children:[l.jsx("span",{className:"text-zinc-500",children:new Date(y.timestamp).toISOString().slice(11,23)}),l.jsx("span",{className:q("uppercase text-[10px] tracking-[0.05em] font-semibold",y.level==="info"&&"text-log-info",y.level==="warn"&&"text-log-warn",y.level==="error"&&"text-log-error",y.level==="debug"&&"text-log-debug"),children:y.level}),l.jsx("span",{className:"text-zinc-200 wrap-break-word",children:y.message})]},y.id))})}),(s.inputs==null||s.inputs===void 0)&&(s.outputs==null||s.outputs===void 0)&&m.length===0&&l.jsx("p",{className:"text-[12px] text-zinc-500 py-8 text-center",children:"This step ran cleanly with no captured inputs, outputs, or logs."})]})]})]})}function Wi({title:s,subtitle:c,open:o,onToggle:u,children:d}){return l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:u,className:"w-full flex items-center gap-2 py-1.5 text-[11px] uppercase tracking-[0.08em] text-zinc-500 hover:text-zinc-300 font-semibold transition-colors",children:[l.jsx(ja,{className:q("w-3 h-3 transition-transform shrink-0",o&&"rotate-90")}),l.jsx("span",{children:s}),c&&l.jsx("span",{className:"text-[11px] normal-case tracking-normal text-zinc-600 font-normal ml-auto",children:c})]}),o&&l.jsx("div",{className:"mt-1.5 rounded-md border border-zinc-800 bg-overlay px-4 py-3",children:d})]})}function Ii({children:s,accent:c}){return l.jsx("span",{className:q("font-mono text-[11px] px-2 py-0.5 rounded-full border",c?"bg-blok-green-500/10 text-blok-green-500 border-blok-green-500/25":"bg-raised text-zinc-400 border-zinc-800"),children:s})}function wj({status:s}){const c={pending:"bg-status-pending",running:"bg-status-running animate-pulse-dot",completed:"bg-status-completed",failed:"bg-status-failed",skipped:"bg-status-skipped"};return l.jsx("span",{className:q("w-2 h-2 rounded-full shrink-0 translate-y-px",c[s])})}function Ej(s){var c;if(s.nodeType==="module"||s.nodeType==="local")return"module";if((c=s.nodeType)!=null&&c.startsWith("runtime."))return"grpc"}function km(s){if(s==null)return"null";if(typeof s!="object")return typeof s;if(Array.isArray(s))return`${s.length} ${s.length===1?"item":"items"}`;const c=Object.keys(s);return`${c.length} ${c.length===1?"key":"keys"}`}function Tj(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}function Cj({percent:s,phase:c}){const o=Math.max(0,Math.min(100,s));return l.jsxs("div",{className:"rounded-md border border-blok-green-500/20 bg-blok-green-500/5 px-3 py-2 mb-1",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5 text-[10px]",children:[l.jsx("span",{className:"font-medium uppercase tracking-[0.08em] text-blok-green-500",children:"Progress"}),l.jsxs("span",{className:"font-mono text-zinc-300",children:[o,"%",c?` · ${c}`:""]})]}),l.jsx("div",{className:"h-1 rounded-full overflow-hidden bg-zinc-800",children:l.jsx("div",{className:"h-full bg-blok-green-500 transition-all duration-200",style:{width:`${o}%`}})})]})}function Rj({runId:s}){const{data:c,isLoading:o}=qe({queryKey:["run-events",s],queryFn:()=>yh(s),refetchInterval:3e3});return o?l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(Oe,{className:"w-5 h-5 text-zinc-500 animate-spin"})}):!c||c.length===0?l.jsx("div",{className:"text-center py-8 text-zinc-600 text-xs",children:"No events recorded"}):l.jsx("div",{className:"space-y-0.5 font-mono text-xs",children:c.map(u=>l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 hover:bg-zinc-800/30 rounded",children:[l.jsx("span",{className:"text-[10px] text-zinc-600 shrink-0 w-20",children:sc(u.timestamp).split(", ")[1]}),l.jsx("span",{className:q("text-[10px] px-1.5 py-0.5 rounded font-medium shrink-0",Fh[u.type]),children:Jh[u.type]}),u.nodeName&&l.jsx("span",{className:"text-zinc-400 shrink-0",children:u.nodeName}),l.jsx("span",{className:"text-zinc-600 truncate flex-1",children:u.workflowName}),l.jsx("span",{className:"text-[10px] text-zinc-700 shrink-0",children:u.id.slice(0,8)})]},u.id))})}function Mo(s){return s==null?"—":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}function Dm(s){return s==null?"—":s<1?`${s.toFixed(2)} ms`:s<1e3?`${s.toFixed(1)} ms`:`${(s/1e3).toFixed(2)} s`}function kj({node:s,logs:c}){if(!s)return l.jsxs("aside",{className:"h-full bg-overlay border-l border-zinc-800 p-5 flex flex-col",children:[l.jsx("h4",{className:"text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold mb-3",children:"Inspector"}),l.jsx("p",{className:"text-xs text-zinc-500 leading-relaxed",children:"Select a step from the rail to see its metrics, wire bytes, and live log tail."}),l.jsx(Am,{})]});const o=s.metrics??{},u=c.filter(d=>d.nodeId===s.id||d.nodeName===s.nodeName);return l.jsxs("aside",{className:"h-full bg-overlay border-l border-zinc-800 p-5 overflow-y-auto flex flex-col",children:[l.jsx("h4",{className:"text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold mb-2",children:"Metrics"}),l.jsxs("div",{className:"grid grid-cols-2 border border-zinc-800 rounded-lg overflow-hidden mb-5",children:[l.jsx(pa,{label:"Wall",value:Dm(s.durationMs)}),l.jsx(pa,{label:"Wire",value:o.request_bytes!=null||o.response_bytes!=null?`${Mo(o.request_bytes)} → ${Mo(o.response_bytes)}`:"—",dim:o.request_bytes==null&&o.response_bytes==null}),l.jsx(pa,{label:"CPU",value:Dm(o.cpu_ms),dim:!o.cpu_ms}),l.jsx(pa,{label:"Memory",value:Mo(o.memory_bytes),dim:!o.memory_bytes}),l.jsx(pa,{label:"Depth",value:String(s.depth)}),l.jsx(pa,{label:"Step",value:`${s.stepIndex+1}`})]}),l.jsx("h4",{className:"text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold mb-2",children:"Live tail · this step"}),l.jsxs("div",{className:"bg-canvas border border-zinc-800 rounded-lg flex-1 min-h-0 flex flex-col overflow-hidden",children:[l.jsxs("div",{className:"px-3 py-1.5 border-b border-zinc-800 text-[11px] text-zinc-400 flex items-center gap-2 font-mono",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blok-green-500 animate-pulse-dot"}),"tailing",l.jsx("span",{className:"ml-auto text-zinc-600",children:"SSE"})]}),l.jsx("div",{className:"overflow-y-auto flex-1 px-3 py-2 font-mono text-[11px] leading-snug",children:u.length===0?l.jsx("p",{className:"text-zinc-600 text-[11px]",children:"no logs from this step yet"}):u.slice(-30).map(d=>l.jsxs("div",{className:"text-zinc-300 py-0.5",children:[l.jsx("span",{className:"text-zinc-600 mr-2",children:new Date(d.timestamp).toISOString().slice(11,23)}),l.jsx("span",{className:q("inline-block w-9 mr-1 text-[9px] uppercase tracking-[0.04em] font-semibold",d.level==="info"&&"text-log-info",d.level==="warn"&&"text-log-warn",d.level==="error"&&"text-log-error",d.level==="debug"&&"text-log-debug"),children:d.level}),l.jsx("span",{className:"text-zinc-200",children:d.message})]},d.id))})]}),l.jsx(Am,{})]})}function pa({label:s,value:c,dim:o}){return l.jsxs("div",{className:"p-3 border-r border-b border-zinc-800 last-of-type:border-r-0 [&:nth-child(2n)]:border-r-0 [&:nth-last-child(-n+2)]:border-b-0",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.06em] text-zinc-500 mb-1",children:s}),l.jsx("div",{className:q("font-mono text-sm font-medium",o?"text-zinc-600":"text-zinc-100"),children:c})]})}function Am(){return l.jsxs("div",{className:"mt-5 pt-3 border-t border-zinc-800 flex flex-wrap gap-x-3 gap-y-1.5 text-[11px] text-zinc-600",children:[l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(Pi,{children:"j"}),l.jsx(Pi,{children:"k"})," step"]}),l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(Pi,{children:"1-5"})," mode"]}),l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(Pi,{children:"Esc"})," deselect"]})]})}function Pi({children:s}){return l.jsx("kbd",{className:"font-mono text-[9px] px-1 py-px rounded bg-raised border border-zinc-800 text-zinc-400",children:s})}function Dj({logs:s,nodeNames:c}){const[o,u]=A.useState(""),[d,h]=A.useState(""),[m,x]=A.useState(!0),b=A.useRef(null),N=A.useMemo(()=>s.filter(y=>!(o&&y.level!==o||d&&y.nodeName!==d)),[s,o,d]);return A.useEffect(()=>{m&&b.current&&(b.current.scrollTop=b.current.scrollHeight)},[N.length,m]),l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-zinc-800 shrink-0",children:[l.jsxs("select",{value:o,onChange:y=>u(y.target.value),className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 outline-none focus:border-zinc-600",children:[l.jsx("option",{value:"",children:"All levels"}),l.jsx("option",{value:"debug",children:"Debug"}),l.jsx("option",{value:"info",children:"Info"}),l.jsx("option",{value:"warn",children:"Warn"}),l.jsx("option",{value:"error",children:"Error"})]}),c.length>0&&l.jsxs("select",{value:d,onChange:y=>h(y.target.value),className:"bg-zinc-800 border border-zinc-700 rounded px-2 py-1 text-xs text-zinc-300 outline-none focus:border-zinc-600",children:[l.jsx("option",{value:"",children:"All nodes"}),c.map(y=>l.jsx("option",{value:y,children:y},y))]}),l.jsx("div",{className:"ml-auto",children:l.jsxs("button",{type:"button",onClick:()=>x(!m),className:q("flex items-center gap-1 px-2 py-1 rounded text-xs transition-colors",m?"bg-blue-600/20 text-blue-400":"text-zinc-500 hover:text-zinc-300"),children:[l.jsx(_g,{className:"w-3 h-3"}),"Auto-scroll"]})})]}),l.jsx("div",{ref:b,className:"flex-1 overflow-y-auto font-mono text-xs",children:N.length===0?l.jsx("div",{className:"text-center py-8 text-zinc-600 text-xs",children:"No log entries"}):N.map(y=>l.jsxs("div",{className:"flex items-start gap-2 px-3 py-1 hover:bg-zinc-800/30 border-b border-zinc-800/30",children:[l.jsx("span",{className:"text-[10px] text-zinc-600 shrink-0 pt-0.5 w-20",children:sc(y.timestamp).split(", ")[1]}),l.jsx("span",{className:q("text-[10px] uppercase font-bold shrink-0 w-10 pt-0.5",By[y.level]),children:y.level}),y.nodeName&&l.jsx("span",{className:"text-[10px] text-zinc-600 shrink-0 truncate w-20 pt-0.5",children:y.nodeName}),l.jsx("span",{className:"text-zinc-300 break-all flex-1",children:y.message})]},y.id))})]})}const Aj=["GET","POST","PUT","PATCH","DELETE"],Mj={GET:"text-green-400",POST:"text-blue-400",PUT:"text-amber-400",PATCH:"text-orange-400",DELETE:"text-red-400"};function Oj({defaultMethod:s="GET",defaultPath:c="/",defaultBody:o="",defaultHeaders:u,onClose:d,onRequestSent:h}){const[m,x]=A.useState(s.toUpperCase()),[b,N]=A.useState(c),[y,v]=A.useState(o),[j,R]=A.useState(u?JSON.stringify(u,null,2):"{}"),[T,k]=A.useState(!1),[M,Y]=A.useState(null),[O,G]=A.useState(null),[B,X]=A.useState(!1),[Q,F]=A.useState(!1),[Z,ae]=A.useState(!1),_e=async()=>{k(!0),G(null),Y(null);try{let ee={};try{ee=JSON.parse(j)}catch{}const Be=await _h({method:m,path:b,headers:ee,body:m!=="GET"&&m!=="HEAD"?y:void 0});Y(Be),h==null||h()}catch(ee){G(ee instanceof Error?ee.message:"Request failed")}finally{k(!1)}},He=()=>{M&&(navigator.clipboard.writeText(M.body),ae(!0),setTimeout(()=>ae(!1),2e3))},K=M&&M.status>=200&&M.status<300?"text-green-400":M&&M.status>=400?"text-red-400":"text-amber-400";return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-zinc-800",children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-200",children:"Request Builder"}),l.jsx("button",{type:"button",onClick:d,className:"p-1 text-zinc-500 hover:text-zinc-300 transition-colors","aria-label":"Close",children:l.jsx(Kt,{className:"w-4 h-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("select",{value:m,onChange:ee=>x(ee.target.value),className:q("bg-zinc-800 border border-zinc-700 rounded-md px-2 py-1.5 text-sm font-mono outline-none",Mj[m]||"text-zinc-300"),children:Aj.map(ee=>l.jsx("option",{value:ee,children:ee},ee))}),l.jsx("input",{value:b,onChange:ee=>N(ee.target.value),placeholder:"/api/endpoint",className:"flex-1 bg-zinc-800 border border-zinc-700 rounded-md px-3 py-1.5 text-sm font-mono text-zinc-200 placeholder-zinc-500 outline-none focus:border-zinc-600"}),l.jsxs("button",{type:"button",onClick:_e,disabled:T||!b,className:q("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",T?"bg-zinc-700 text-zinc-400 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-500"),children:[T?l.jsx(Oe,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(eh,{className:"w-3.5 h-3.5"}),"Send"]})]}),l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>X(!B),className:"flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-300 transition-colors","aria-expanded":B,children:[B?l.jsx(Ns,{className:"w-3 h-3"}):l.jsx(ja,{className:"w-3 h-3"}),"Headers (JSON)"]}),B&&l.jsx("textarea",{value:j,onChange:ee=>R(ee.target.value),rows:4,className:"mt-1 w-full bg-zinc-800 border border-zinc-700 rounded-md px-3 py-2 text-xs font-mono text-zinc-300 placeholder-zinc-500 outline-none focus:border-zinc-600 resize-y",placeholder:'{"Authorization": "Bearer ..."}'})]}),m!=="GET"&&m!=="HEAD"&&l.jsxs("div",{children:[l.jsx("label",{htmlFor:"request-body",className:"text-xs text-zinc-400 mb-1 block",children:"Body (JSON)"}),l.jsx("textarea",{id:"request-body",value:y,onChange:ee=>v(ee.target.value),rows:6,className:"w-full bg-zinc-800 border border-zinc-700 rounded-md px-3 py-2 text-xs font-mono text-zinc-300 placeholder-zinc-500 outline-none focus:border-zinc-600 resize-y",placeholder:'{"key": "value"}'})]}),O&&l.jsx("div",{className:"bg-red-500/10 border border-red-500/20 rounded-md px-3 py-2 text-xs text-red-400",children:O}),M&&l.jsxs("div",{className:"border border-zinc-700 rounded-md overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-800/50 border-b border-zinc-700",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-zinc-400",children:"Response"}),l.jsx("span",{className:q("text-sm font-mono font-medium",K),children:M.status})]}),l.jsx("button",{type:"button",onClick:He,className:"p-1 text-zinc-500 hover:text-zinc-300 transition-colors",title:"Copy response body","aria-label":"Copy response body",children:Z?l.jsx(va,{className:"w-3 h-3 text-green-400"}):l.jsx($o,{className:"w-3 h-3"})})]}),l.jsxs("div",{className:"border-b border-zinc-800",children:[l.jsxs("button",{type:"button",onClick:()=>F(!Q),className:"flex items-center gap-1 px-3 py-1.5 text-[10px] text-zinc-500 hover:text-zinc-400 w-full text-left","aria-expanded":Q,children:[Q?l.jsx(Ns,{className:"w-3 h-3"}):l.jsx(ja,{className:"w-3 h-3"}),"Headers (",Object.keys(M.headers).length,")"]}),Q&&l.jsx("div",{className:"px-3 pb-2",children:Object.entries(M.headers).map(([ee,Be])=>l.jsxs("div",{className:"text-[10px] font-mono",children:[l.jsxs("span",{className:"text-zinc-500",children:[ee,": "]}),l.jsx("span",{className:"text-zinc-400",children:Be})]},ee))})]}),l.jsx("div",{className:"p-3 max-h-64 overflow-y-auto",children:Mm(M.body)?l.jsx(Qt,{data:Mm(M.body),maxDepth:6}):l.jsx("pre",{className:"text-xs font-mono text-zinc-300 whitespace-pre-wrap break-all",children:M.body})})]})]})]})}function Mm(s){try{return JSON.parse(s)}catch{return null}}function ba(s,c,o){let u=o.initialDeps??[],d,h=!0;function m(){var x,b,N;let y;o.key&&((x=o.debug)!=null&&x.call(o))&&(y=Date.now());const v=s();if(!(v.length!==u.length||v.some((T,k)=>u[k]!==T)))return d;u=v;let R;if(o.key&&((b=o.debug)!=null&&b.call(o))&&(R=Date.now()),d=c(...v),o.key&&((N=o.debug)!=null&&N.call(o))){const T=Math.round((Date.now()-y)*100)/100,k=Math.round((Date.now()-R)*100)/100,M=k/16,Y=(O,G)=>{for(O=String(O);O.length<G;)O=" "+O;return O};console.info(`%c⏱ ${Y(k,5)} /${Y(T,5)} ms`,`
|
|
40
|
+
font-size: .6rem;
|
|
41
|
+
font-weight: bold;
|
|
42
|
+
color: hsl(${Math.max(0,Math.min(120-120*M,120))}deg 100% 31%);`,o==null?void 0:o.key)}return o!=null&&o.onChange&&!(h&&o.skipInitialOnChange)&&o.onChange(d),h=!1,d}return m.updateDeps=x=>{u=x},m}function Om(s,c){if(s===void 0)throw new Error("Unexpected undefined");return s}const _j=(s,c)=>Math.abs(s-c)<1.01,Uj=(s,c,o)=>{let u;return function(...d){s.clearTimeout(u),u=s.setTimeout(()=>c.apply(this,d),o)}},_m=s=>{const{offsetWidth:c,offsetHeight:o}=s;return{width:c,height:o}},Lj=s=>s,qj=s=>{const c=Math.max(s.startIndex-s.overscan,0),o=Math.min(s.endIndex+s.overscan,s.count-1),u=[];for(let d=c;d<=o;d++)u.push(d);return u},Hj=(s,c)=>{const o=s.scrollElement;if(!o)return;const u=s.targetWindow;if(!u)return;const d=m=>{const{width:x,height:b}=m;c({width:Math.round(x),height:Math.round(b)})};if(d(_m(o)),!u.ResizeObserver)return()=>{};const h=new u.ResizeObserver(m=>{const x=()=>{const b=m[0];if(b!=null&&b.borderBoxSize){const N=b.borderBoxSize[0];if(N){d({width:N.inlineSize,height:N.blockSize});return}}d(_m(o))};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(x):x()});return h.observe(o,{box:"border-box"}),()=>{h.unobserve(o)}},Um={passive:!0},Lm=typeof window>"u"?!0:"onscrollend"in window,Bj=(s,c)=>{const o=s.scrollElement;if(!o)return;const u=s.targetWindow;if(!u)return;let d=0;const h=s.options.useScrollendEvent&&Lm?()=>{}:Uj(u,()=>{c(d,!1)},s.options.isScrollingResetDelay),m=y=>()=>{const{horizontal:v,isRtl:j}=s.options;d=v?o.scrollLeft*(j&&-1||1):o.scrollTop,h(),c(d,y)},x=m(!0),b=m(!1);o.addEventListener("scroll",x,Um);const N=s.options.useScrollendEvent&&Lm;return N&&o.addEventListener("scrollend",b,Um),()=>{o.removeEventListener("scroll",x),N&&o.removeEventListener("scrollend",b)}},Gj=(s,c,o)=>{if(c!=null&&c.borderBoxSize){const u=c.borderBoxSize[0];if(u)return Math.round(u[o.options.horizontal?"inlineSize":"blockSize"])}return s[o.options.horizontal?"offsetWidth":"offsetHeight"]},Qj=(s,{adjustments:c=0,behavior:o},u)=>{var d,h;const m=s+c;(h=(d=u.scrollElement)==null?void 0:d.scrollTo)==null||h.call(d,{[u.options.horizontal?"left":"top"]:m,behavior:o})};class Yj{constructor(c){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let o=null;const u=()=>o||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:o=new this.targetWindow.ResizeObserver(d=>{d.forEach(h=>{const m=()=>{this._measureElement(h.target,h)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(m):m()})}));return{disconnect:()=>{var d;(d=u())==null||d.disconnect(),o=null},observe:d=>{var h;return(h=u())==null?void 0:h.observe(d,{box:"border-box"})},unobserve:d=>{var h;return(h=u())==null?void 0:h.unobserve(d)}}})(),this.range=null,this.setOptions=o=>{Object.entries(o).forEach(([u,d])=>{typeof d>"u"&&delete o[u]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Lj,rangeExtractor:qj,onChange:()=>{},measureElement:Gj,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...o}},this.notify=o=>{var u,d;(d=(u=this.options).onChange)==null||d.call(u,this,o)},this.maybeNotify=ba(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),o=>{this.notify(o)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(o=>o()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var o;const u=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==u){if(this.cleanup(),!u){this.maybeNotify();return}this.scrollElement=u,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((o=this.scrollElement)==null?void 0:o.window)??null,this.elementsCache.forEach(d=>{this.observer.observe(d)}),this.unsubs.push(this.options.observeElementRect(this,d=>{this.scrollRect=d,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(d,h)=>{this.scrollAdjustments=0,this.scrollDirection=h?this.getScrollOffset()<d?"forward":"backward":null,this.scrollOffset=d,this.isScrolling=h,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(o,u)=>{const d=new Map,h=new Map;for(let m=u-1;m>=0;m--){const x=o[m];if(d.has(x.lane))continue;const b=h.get(x.lane);if(b==null||x.end>b.end?h.set(x.lane,x):x.end<b.end&&d.set(x.lane,!0),d.size===this.options.lanes)break}return h.size===this.options.lanes?Array.from(h.values()).sort((m,x)=>m.end===x.end?m.index-x.index:m.end-x.end)[0]:void 0},this.getMeasurementOptions=ba(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(o,u,d,h,m,x)=>(this.prevLanes!==void 0&&this.prevLanes!==x&&(this.lanesChangedFlag=!0),this.prevLanes=x,this.pendingMeasuredCacheIndexes=[],{count:o,paddingStart:u,scrollMargin:d,getItemKey:h,enabled:m,lanes:x}),{key:!1}),this.getMeasurements=ba(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:o,paddingStart:u,scrollMargin:d,getItemKey:h,enabled:m,lanes:x},b)=>{if(!m)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>o)for(const j of this.laneAssignments.keys())j>=o&&this.laneAssignments.delete(j);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(j=>{this.itemSizeCache.set(j.key,j.size)}));const N=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===o&&(this.lanesSettling=!1);const y=this.measurementsCache.slice(0,N),v=new Array(x).fill(void 0);for(let j=0;j<N;j++){const R=y[j];R&&(v[R.lane]=j)}for(let j=N;j<o;j++){const R=h(j),T=this.laneAssignments.get(j);let k,M;if(T!==void 0&&this.options.lanes>1){k=T;const B=v[k],X=B!==void 0?y[B]:void 0;M=X?X.end+this.options.gap:u+d}else{const B=this.options.lanes===1?y[j-1]:this.getFurthestMeasurement(y,j);M=B?B.end+this.options.gap:u+d,k=B?B.lane:j%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(j,k)}const Y=b.get(R),O=typeof Y=="number"?Y:this.options.estimateSize(j),G=M+O;y[j]={index:j,start:M,size:O,end:G,key:R,lane:k},v[k]=j}return this.measurementsCache=y,y},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ba(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(o,u,d,h)=>this.range=o.length>0&&u>0?Kj({measurements:o,outerSize:u,scrollOffset:d,lanes:h}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ba(()=>{let o=null,u=null;const d=this.calculateRange();return d&&(o=d.startIndex,u=d.endIndex),this.maybeNotify.updateDeps([this.isScrolling,o,u]),[this.options.rangeExtractor,this.options.overscan,this.options.count,o,u]},(o,u,d,h,m)=>h===null||m===null?[]:o({startIndex:h,endIndex:m,overscan:u,count:d}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=o=>{const u=this.options.indexAttribute,d=o.getAttribute(u);return d?parseInt(d,10):(console.warn(`Missing attribute name '${u}={index}' on measured element.`),-1)},this._measureElement=(o,u)=>{const d=this.indexFromElement(o),h=this.measurementsCache[d];if(!h)return;const m=h.key,x=this.elementsCache.get(m);x!==o&&(x&&this.observer.unobserve(x),this.observer.observe(o),this.elementsCache.set(m,o)),o.isConnected&&this.resizeItem(d,this.options.measureElement(o,u,this))},this.resizeItem=(o,u)=>{const d=this.measurementsCache[o];if(!d)return;const h=this.itemSizeCache.get(d.key)??d.size,m=u-h;m!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(d,m,this):d.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=m,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(d.index),this.itemSizeCache=new Map(this.itemSizeCache.set(d.key,u)),this.notify(!1))},this.measureElement=o=>{if(!o){this.elementsCache.forEach((u,d)=>{u.isConnected||(this.observer.unobserve(u),this.elementsCache.delete(d))});return}this._measureElement(o,void 0)},this.getVirtualItems=ba(()=>[this.getVirtualIndexes(),this.getMeasurements()],(o,u)=>{const d=[];for(let h=0,m=o.length;h<m;h++){const x=o[h],b=u[x];d.push(b)}return d},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=o=>{const u=this.getMeasurements();if(u.length!==0)return Om(u[xx(0,u.length-1,d=>Om(u[d]).start,o)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const o=this.scrollElement.document.documentElement;return this.options.horizontal?o.scrollWidth-this.scrollElement.innerWidth:o.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(o,u,d=0)=>{if(!this.scrollElement)return 0;const h=this.getSize(),m=this.getScrollOffset();u==="auto"&&(u=o>=m+h?"end":"start"),u==="center"?o+=(d-h)/2:u==="end"&&(o-=h);const x=this.getMaxScrollOffset();return Math.max(Math.min(x,o),0)},this.getOffsetForIndex=(o,u="auto")=>{o=Math.max(0,Math.min(o,this.options.count-1));const d=this.measurementsCache[o];if(!d)return;const h=this.getSize(),m=this.getScrollOffset();if(u==="auto")if(d.end>=m+h-this.options.scrollPaddingEnd)u="end";else if(d.start<=m+this.options.scrollPaddingStart)u="start";else return[m,u];if(u==="end"&&o===this.options.count-1)return[this.getMaxScrollOffset(),u];const x=u==="end"?d.end+this.options.scrollPaddingEnd:d.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(x,u,d.size),u]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(o,{align:u="start",behavior:d}={})=>{d==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(o,u),{adjustments:void 0,behavior:d})},this.scrollToIndex=(o,{align:u="auto",behavior:d}={})=>{d==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),o=Math.max(0,Math.min(o,this.options.count-1)),this.currentScrollToIndex=o;let h=0;const m=10,x=N=>{if(!this.targetWindow)return;const y=this.getOffsetForIndex(o,N);if(!y){console.warn("Failed to get offset for index:",o);return}const[v,j]=y;this._scrollToOffset(v,{adjustments:void 0,behavior:d}),this.targetWindow.requestAnimationFrame(()=>{const R=()=>{if(this.currentScrollToIndex!==o)return;const T=this.getScrollOffset(),k=this.getOffsetForIndex(o,j);if(!k){console.warn("Failed to get offset for index:",o);return}_j(k[0],T)||b(j)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(R):R()})},b=N=>{this.targetWindow&&this.currentScrollToIndex===o&&(h++,h<m?this.targetWindow.requestAnimationFrame(()=>x(N)):console.warn(`Failed to scroll to index ${o} after ${m} attempts.`))};x(u)},this.scrollBy=(o,{behavior:u}={})=>{u==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+o,{adjustments:void 0,behavior:u})},this.getTotalSize=()=>{var o;const u=this.getMeasurements();let d;if(u.length===0)d=this.options.paddingStart;else if(this.options.lanes===1)d=((o=u[u.length-1])==null?void 0:o.end)??0;else{const h=Array(this.options.lanes).fill(null);let m=u.length-1;for(;m>=0&&h.some(x=>x===null);){const x=u[m];h[x.lane]===null&&(h[x.lane]=x.end),m--}d=Math.max(...h.filter(x=>x!==null))}return Math.max(d-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(o,{adjustments:u,behavior:d})=>{this.options.scrollToFn(o,{behavior:d,adjustments:u},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(c)}}const xx=(s,c,o,u)=>{for(;s<=c;){const d=(s+c)/2|0,h=o(d);if(h<u)s=d+1;else if(h>u)c=d-1;else return d}return s>0?s-1:0};function Kj({measurements:s,outerSize:c,scrollOffset:o,lanes:u}){const d=s.length-1,h=b=>s[b].start;if(s.length<=u)return{startIndex:0,endIndex:d};let m=xx(0,d,h,o),x=m;if(u===1)for(;x<d&&s[x].end<o+c;)x++;else if(u>1){const b=Array(u).fill(0);for(;x<d&&b.some(y=>y<o+c);){const y=s[x];b[y.lane]=y.end,x++}const N=Array(u).fill(o+c);for(;m>=0&&N.some(y=>y>=o);){const y=s[m];N[y.lane]=y.start,m--}m=Math.max(0,m-m%u),x=Math.min(d,x+(u-1-x%u))}return{startIndex:m,endIndex:x}}const qm=typeof document<"u"?A.useLayoutEffect:A.useEffect;function Xj({useFlushSync:s=!0,...c}){const o=A.useReducer(()=>({}),{})[1],u={...c,onChange:(h,m)=>{var x;s&&m?Wb.flushSync(o):o(),(x=c.onChange)==null||x.call(c,h,m)}},[d]=A.useState(()=>new Yj(u));return d.setOptions(u),qm(()=>d._didMount(),[]),qm(()=>d._willUpdate()),d}function Vj(s){return Xj({observeElementRect:Hj,observeElementOffset:Bj,scrollToFn:Qj,...s})}const Zj=50,$j=30;function Jj(s){const c=[],o=[];let u=-1;for(const d of s){d.depth<u&&(o.length=d.depth+1);const h=d.iterationIndex;typeof h=="number"&&o[d.depth]!==h&&(c.push({kind:"iteration-header",key:`iter-${d.depth}-${h}-${d.id}`,iterIndex:h,depth:d.depth}),o[d.depth]=h),c.push({kind:"node",node:d}),u=d.depth}return c}function Hm({iterIndex:s,depth:c}){return l.jsxs("div",{style:{paddingLeft:`${16+c*12}px`},className:"w-full flex items-center gap-2 pl-4 pr-3 py-1.5 text-[11px] uppercase tracking-wide text-zinc-500 select-none","aria-hidden":"true",children:[l.jsx("span",{className:"font-mono text-[9px] text-zinc-700 w-3 shrink-0",children:"↳"}),l.jsxs("span",{className:"font-mono text-[10px] text-purple-300/80 shrink-0",children:["iteration ",s+1]}),l.jsx("span",{className:"flex-1 border-t border-zinc-800/60 ml-1"})]})}function Fj({nodes:s,activeStepId:c,onSelect:o}){const u=A.useMemo(()=>s.slice().sort((j,R)=>j.stepIndex-R.stepIndex),[s]),d=A.useMemo(()=>Jj(u),[u]),h=s.filter(j=>j.status==="completed").length,m=s.filter(j=>j.status==="failed").length,x=s.filter(j=>j.status==="running").length,b=A.useRef(null),N=d.length>=Zj,y=Vj({count:N?d.length:0,getScrollElement:()=>b.current,estimateSize:()=>$j,overscan:8}),v=(j,R)=>l.jsxs("button",{type:"button",onClick:()=>o(j.id),style:j.depth>0?{paddingLeft:`${16+j.depth*12}px`}:void 0,className:q("relative w-full flex items-center gap-2.5 pl-4 pr-3 py-1.5 text-[12.5px] cursor-pointer transition-colors text-left",R?"bg-blok-green-500/10 text-zinc-100 before:content-[''] before:absolute before:left-0 before:top-1.5 before:bottom-1.5 before:w-0.5 before:bg-blok-green-500 before:rounded-r":"text-zinc-400 hover:bg-hover hover:text-zinc-200"),children:[l.jsx("span",{className:"font-mono text-[10px] text-zinc-600 w-3 shrink-0",children:j.stepIndex+1}),l.jsx("span",{className:q("w-1.5 h-1.5 rounded-full shrink-0 transition-status",ws[j.status],j.status==="running"&&"animate-pulse-dot")}),l.jsx("span",{className:"flex-1 truncate",children:j.nodeName}),j.middleware&&l.jsxs("span",{className:"font-mono text-[9px] uppercase tracking-wide px-1 py-px rounded bg-emerald-300/15 text-emerald-300 shrink-0",title:`middleware origin — emitted by trigger.http.middleware: "${j.middleware}"`,children:["mw:",j.middleware]}),j.nodeType==="subworkflow"&&l.jsxs("span",{className:q("font-mono text-[9px] uppercase tracking-wide px-1 py-px rounded shrink-0",j.wait===!1?"bg-orange-300/15 text-orange-300":"bg-zinc-700/40 text-zinc-300"),title:(j.wait===!1?`Async sub-workflow (fire-and-forget) — child runs independently; parent does NOT block${j.subworkflowDepth&&j.subworkflowDepth>=2?` · nested at depth ${j.subworkflowDepth}`:""}`:`Sub-workflow invocation (synchronous) — see Sub-runs in the header${j.subworkflowDepth&&j.subworkflowDepth>=2?` · nested at depth ${j.subworkflowDepth}`:""}`)+(j.dispatch==="http-self"?" · dispatched via HTTP self-call to BLOK_SELF_BASE_URL":j.dispatch==="in-process"?" · dispatched in-process":""),children:[j.wait===!1?"↳ async":"↳ sub",j.subworkflowDepth&&j.subworkflowDepth>=2?` (${j.subworkflowDepth})`:""]}),j.nodeType==="subworkflow"&&j.dispatch==="http-self"&&l.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wide px-1 py-px rounded bg-sky-300/15 text-sky-300 shrink-0",title:"HTTP self-call dispatch — child ran as a fresh HTTP request to BLOK_SELF_BASE_URL (potentially on a different process).",children:"http"}),j.nodeType==="wait"&&l.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wide px-1 py-px rounded bg-cyan-300/15 text-cyan-300 shrink-0",title:"Wait step — workflow paused until the deadline fires",children:"↳ wait"}),j.nodeType==="forEach"&&l.jsxs("span",{className:"font-mono text-[9px] uppercase tracking-wide px-1 py-px rounded bg-purple-300/15 text-purple-300 shrink-0",title:Array.isArray(j.outputs)?`forEach — iterated ${j.outputs.length} item${j.outputs.length===1?"":"s"}`:"forEach — collection iteration; each child step rail row is one iteration's inner step",children:["↳ forEach",Array.isArray(j.outputs)?` (${j.outputs.length})`:""]}),j.nodeType==="loop"&&l.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wide px-1 py-px rounded bg-blue-300/15 text-blue-300 shrink-0",title:"loop — while-condition; runs until the expression goes falsy or maxIterations cap is hit",children:"↳ loop"}),j.nodeType==="switch"&&l.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wide px-1 py-px rounded bg-amber-300/15 text-amber-300 shrink-0",title:"switch — N-way branch; the matched case's inner steps appear indented below",children:"↳ switch"}),j.nodeType==="tryCatch"&&l.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wide px-1 py-px rounded bg-rose-300/15 text-rose-300 shrink-0",title:"tryCatch — try/catch/finally; failures in `try` jump to `catch`, finally always runs",children:"↳ try"}),j.cached&&l.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wide px-1 py-px rounded bg-blok-green-500/15 text-blok-green-500 shrink-0",title:`Reused result from run ${j.cached.sourceRunId}`,children:"cached"}),j.attempts&&j.attempts.length>0&&l.jsxs("span",{className:"font-mono text-[9px] px-1 py-px rounded bg-status-warning/15 text-status-warning shrink-0",title:`${j.attempts.length} failed attempt${j.attempts.length===1?"":"s"} before outcome`,children:["↻",j.attempts.length]}),j.durationMs!=null&&l.jsx("span",{className:q("font-mono text-[10.5px] shrink-0",j.status==="failed"?"text-status-failed":R?"text-zinc-300":"text-zinc-600"),children:j.durationMs<1e3?`${j.durationMs} ms`:`${(j.durationMs/1e3).toFixed(2)} s`})]});return l.jsxs("aside",{ref:b,className:"h-full bg-canvas border-r border-zinc-800 overflow-y-auto py-2",children:[l.jsxs("div",{className:"px-4 pt-2 pb-2 flex items-center justify-between text-[10px] uppercase tracking-[0.08em] text-zinc-500 font-semibold",children:[l.jsx("span",{children:"Steps"}),l.jsxs("span",{className:q("font-mono normal-case tracking-normal",m>0?"text-status-failed":"text-zinc-400"),children:[m>0?`${m} failed`:`${h} / ${s.length}`,x>0&&l.jsxs("span",{className:"text-status-running",children:[" · ",x," running"]})]})]}),N?l.jsx("ul",{className:"relative mt-1 list-none p-0 m-0",style:{height:`${y.getTotalSize()}px`},"aria-label":`${d.length} steps`,children:y.getVirtualItems().map(j=>{const R=d[j.index];if(!R)return null;const T=R.kind==="iteration-header"?R.key:R.node.id;return l.jsx("li",{className:"absolute left-0 right-0",style:{top:0,transform:`translateY(${j.start}px)`,height:`${j.size}px`},children:R.kind==="iteration-header"?l.jsx(Hm,{iterIndex:R.iterIndex,depth:R.depth}):v(R.node,R.node.id===c)},T)})}):l.jsx("ul",{className:"mt-1",children:d.map(j=>j.kind==="iteration-header"?l.jsx("li",{children:l.jsx(Hm,{iterIndex:j.iterIndex,depth:j.depth})},j.key):l.jsx("li",{children:v(j.node,j.node.id===c)},j.node.id))})]})}const Bm=180,Gm=50;function Wj({nodes:s,selectedNodeId:c,onSelectNode:o}){const{flowNodes:u,flowEdges:d}=A.useMemo(()=>{var j;const x=new tc.graphlib.Graph;x.setDefaultEdgeLabel(()=>({})),x.setGraph({rankdir:"TB",nodesep:30,ranksep:50});for(const R of s)x.setNode(R.id,{width:Bm,height:Gm});const b=[...s].sort((R,T)=>R.stepIndex-T.stepIndex);for(let R=1;R<b.length;R++){const T=b[R-1],k=b[R];if(!(!T||!k)){if(k.parentNodeId)x.setEdge(k.parentNodeId,k.id);else if(T.depth===k.depth)x.setEdge(T.id,k.id);else if(k.depth<T.depth)for(let M=R-1;M>=0;M--){const Y=b[M];if(Y&&Y.depth===k.depth){x.setEdge(Y.id,k.id);break}}}}tc.layout(x);const N=s.map(R=>{const T=x.node(R.id);return{id:R.id,type:"traceNode",position:{x:((T==null?void 0:T.x)||0)-Bm/2,y:((T==null?void 0:T.y)||0)-Gm/2},data:{node:R,selected:c===R.id}}}),y=[],v=x.edges();for(const R of v)y.push({id:`${R.v}-${R.w}`,source:R.v,target:R.w,animated:((j=s.find(T=>T.id===R.w))==null?void 0:j.status)==="running",style:{stroke:"#3f3f46",strokeWidth:1.5}});return{flowNodes:N,flowEdges:y}},[s,c]),h=A.useCallback((x,b)=>{o(b.id)},[o]),m=A.useMemo(()=>({traceNode:Ij}),[]);return l.jsx("div",{className:"h-[500px] rounded-lg border border-zinc-800 overflow-hidden",children:l.jsxs(th,{nodes:u,edges:d,nodeTypes:m,onNodeClick:h,fitView:!0,fitViewOptions:{padding:.2},proOptions:{hideAttribution:!0},minZoom:.3,maxZoom:2,children:[l.jsx(nh,{color:"#27272a",gap:16,size:1}),l.jsx(lh,{showInteractive:!1,className:"bg-zinc-900! border-zinc-700! rounded-md! [&>button]:bg-zinc-800! [&>button]:border-zinc-700! [&>button]:text-zinc-400! [&>button:hover]:bg-zinc-700!"}),l.jsx(ah,{nodeStrokeColor:"#3f3f46",nodeColor:x=>{const b=x.data.node.status;return b==="completed"?"#22c55e":b==="running"?"#3b82f6":b==="failed"?"#ef4444":"#52525b"},maskColor:"rgba(0,0,0,0.6)",className:"bg-zinc-900! border-zinc-700! rounded-md!"})]})})}function Ij({data:s}){const{node:c,selected:o}=s;return l.jsxs(l.Fragment,{children:[l.jsx(Tl,{type:"target",position:Cl.Top,className:"bg-zinc-600! w-2! h-2! border-0!"}),l.jsxs("div",{className:q("rounded-md border px-3 py-2 min-w-[160px] transition-all",o?"border-blue-500 bg-zinc-800 ring-1 ring-blue-500/30":"border-zinc-700 bg-zinc-900 hover:border-zinc-600"),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:q("w-2 h-2 rounded-full shrink-0",ws[c.status],c.status==="running"&&"animate-pulse-dot")}),l.jsx("span",{className:"text-xs font-medium text-zinc-200 truncate",children:c.nodeName})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.runtimeKind&&l.jsx("span",{className:"text-[10px] text-zinc-500",children:c.runtimeKind}),l.jsx("span",{className:"text-[10px] font-mono text-zinc-500 ml-auto",children:c.status==="running"?"...":ge(c.durationMs)})]})]}),l.jsx(Tl,{type:"source",position:Cl.Bottom,className:"bg-zinc-600! w-2! h-2! border-0!"})]})}const Pj="modulepreload",eN=function(s){return"/"+s},Qm={},tN=function(c,o,u){let d=Promise.resolve();if(o&&o.length>0){let m=function(N){return Promise.all(N.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const x=document.querySelector("meta[property=csp-nonce]"),b=(x==null?void 0:x.nonce)||(x==null?void 0:x.getAttribute("nonce"));d=m(o.map(N=>{if(N=eN(N),N in Qm)return;Qm[N]=!0;const y=N.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${N}"]${v}`))return;const j=document.createElement("link");if(j.rel=y?"stylesheet":Pj,y||(j.as="script"),j.crossOrigin="",j.href=N,b&&j.setAttribute("nonce",b),document.head.appendChild(j),y)return new Promise((R,T)=>{j.addEventListener("load",R),j.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${N}`)))})}))}function h(m){const x=new Event("vite:preloadError",{cancelable:!0});if(x.payload=m,window.dispatchEvent(x),!x.defaultPrevented)throw m}return d.then(m=>{for(const x of m||[])x.status==="rejected"&&h(x.reason);return c().catch(h)})};function nN(s){return qe({queryKey:["run",s],queryFn:()=>gh(s),enabled:!!s})}function lN(s){return qe({queryKey:["run",s,"subruns"],queryFn:()=>tN(()=>Promise.resolve().then(()=>_y),void 0).then(c=>c.fetchSubRuns(s)),enabled:!!s})}function aN(s){const c=ht(),o=Sl(m=>m.incrementStreams),u=Sl(m=>m.decrementStreams),d=Sl(m=>m.setStatus),h=A.useCallback(m=>{c.setQueryData(["run",s],x=>{var N,y,v,j,R;if(!x)return x;const b={...x};switch(m.type){case"RUN_COMPLETED":case"RUN_FAILED":case"RUN_CRASHED":case"RUN_TIMED_OUT":case"RUN_THROTTLED":case"RUN_CANCELLED":case"RUN_EXPIRED":{const T=Iy[m.type],k=m.type==="RUN_FAILED"||m.type==="RUN_CRASHED";b.run={...b.run,...T?{status:T}:{},finishedAt:m.timestamp,durationMs:m.timestamp-b.run.startedAt,...k&&m.payload?{error:m.payload}:{}};break}case"RUN_QUEUED":case"RUN_DELAYED":{const T=Py[m.type];T&&(b.run={...b.run,status:T});break}case"NODE_STARTED":{const T=m.nodeId||m.id;if(b.nodes.some(M=>M.id===T))break;const k={id:T,runId:s,nodeName:m.nodeName||"",nodeType:((N=m.payload)==null?void 0:N.nodeType)||"unknown",runtimeKind:(y=m.payload)==null?void 0:y.runtimeKind,status:"running",startedAt:m.timestamp,depth:((v=m.payload)==null?void 0:v.depth)||0,stepIndex:((j=m.payload)==null?void 0:j.stepIndex)||0};b.nodes=[...b.nodes,k],b.run={...b.run,status:"running"};break}case"NODE_COMPLETED":{b.nodes=b.nodes.map(T=>{var k,M;return T.id===m.nodeId||T.nodeName===m.nodeName?{...T,status:"completed",finishedAt:m.timestamp,durationMs:m.timestamp-T.startedAt,outputs:(k=m.payload)==null?void 0:k.outputs,metrics:(M=m.payload)==null?void 0:M.metrics}:T}),b.run={...b.run,completedNodes:b.run.completedNodes+1};break}case"NODE_FAILED":{b.nodes=b.nodes.map(T=>T.id===m.nodeId||T.nodeName===m.nodeName?{...T,status:"failed",finishedAt:m.timestamp,durationMs:m.timestamp-T.startedAt,error:m.payload}:T);break}case"NODE_SKIPPED":{b.nodes=b.nodes.map(T=>T.id===m.nodeId||T.nodeName===m.nodeName?{...T,status:"skipped"}:T);break}case"NODE_CACHED":{const T=(R=m.payload)==null?void 0:R.source;b.nodes=b.nodes.map(k=>k.id===m.nodeId||k.nodeName===m.nodeName?{...k,status:"completed",finishedAt:m.timestamp,cached:T??k.cached}:k);break}case"NODE_ATTEMPT_FAILED":{const T=m.payload;b.nodes=b.nodes.map(k=>{var M;return k.id===m.nodeId||k.nodeName===m.nodeName?{...k,attempts:[...k.attempts??[],{attempt:(T==null?void 0:T.attempt)??(((M=k.attempts)==null?void 0:M.length)??0)+1,error:(T==null?void 0:T.error)??{message:"attempt failed"},timestamp:m.timestamp}]}:k});break}case"LOG_ENTRY":{const T=m.payload;if(T){if(b.logs.some(M=>M.id===m.id))break;const k={id:m.id,runId:s,nodeId:m.nodeId,nodeName:m.nodeName,level:T.level||"info",message:T.message||"",timestamp:m.timestamp,data:T.data};b.logs=[...b.logs,k]}break}case"NODE_PROGRESS":{const T=m.payload;if(!T)break;b.nodes=b.nodes.map(k=>k.id===m.nodeId||k.nodeName===m.nodeName?{...k,progress:{percent:Math.max(0,Math.min(100,Number(T.percent??0))),phase:T.phase||"",updatedAt:m.timestamp}}:k);break}case"NODE_PARTIAL_RESULT":{const T=m.payload;if(!T)break;b.nodes=b.nodes.map(k=>k.id===m.nodeId||k.nodeName===m.nodeName?{...k,partialResult:{snapshot:T.snapshot,updatedAt:m.timestamp}}:k);break}}return b})},[c,s]);A.useEffect(()=>{if(!s)return;o(),d("connecting");const m=nv(s,{onEvent:h,onOpen:()=>d("connected"),onEnd:()=>{d("connected"),u(),c.invalidateQueries({queryKey:["run",s]}),c.invalidateQueries({queryKey:["runs"]}),c.invalidateQueries({queryKey:["workflows"]})},onError:()=>d("error")});return()=>{m(),u()}},[s,h,o,u,d,c])}const px=Et("/runs/$runId")({component:sN});function sN(){const{runId:s}=px.useParams(),c=Rl(),{data:o,isLoading:u,error:d}=nN(s),[h,m]=A.useState(null),[x,b]=A.useState("step"),[N,y]=A.useState(!1),[v,j]=A.useState(null);aN(s);const{data:R}=lN(s);A.useEffect(()=>{if(h||!o||o.nodes.length===0)return;const Z=o.nodes.find(K=>K.status==="failed"),ae=o.nodes.find(K=>K.status==="running"),_e=o.nodes.slice().sort((K,ee)=>K.stepIndex-ee.stepIndex)[0],He=Z??ae??_e;He&&m(He.id)},[o,h]),A.useEffect(()=>{const Z=ae=>{if(!(ae.target instanceof HTMLInputElement||ae.target instanceof HTMLSelectElement||ae.target instanceof HTMLTextAreaElement)&&!(ae.metaKey||ae.ctrlKey)){if((ae.key==="j"||ae.key==="k")&&o){ae.preventDefault();const _e=o.nodes.slice().sort((Be,it)=>Be.stepIndex-it.stepIndex);if(_e.length===0)return;const He=_e.findIndex(Be=>Be.id===h),K=ae.key==="j"?Math.min(He+1,_e.length-1):Math.max(He-1,0),ee=_e[K];ee&&m(ee.id);return}switch(ae.key){case"1":b("step");break;case"2":b("graph");break;case"3":b("logs");break;case"4":b("events");break;case"5":b("request");break;case"Escape":b("step");break}}};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[o,h]);const T=A.useMemo(()=>!o||!h?null:o.nodes.find(Z=>Z.id===h)||null,[o,h]),k=A.useMemo(()=>o?[...new Set(o.nodes.map(Z=>Z.nodeName))]:[],[o]),M=A.useMemo(()=>{if(!o)return{method:"GET",path:"/"};const Z=o.run.triggerSummary.split(" ");return{method:Z[0]||"GET",path:Z[1]||"/"}},[o]),Y=async()=>{if(!(!o||N)){y(!0),j(null);try{const Z=await Io(s);c({to:"/runs/$runId",params:{runId:Z.newRunId}})}catch(Z){j(Z instanceof Error?Z.message:"Replay failed")}finally{y(!1)}}};if(u)return l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(Oe,{className:"w-6 h-6 text-zinc-500 animate-spin"})});if(d||!o)return l.jsx("div",{className:"p-6",children:l.jsx(Xe,{icon:l.jsx(In,{className:"w-12 h-12"}),title:"Run not found",description:`No run with ID "${s}" was found.`})});const{run:O,nodes:G,logs:B}=o,X=O.triggerType==="http",Q=O.status==="completed"||O.status==="failed"||O.status==="cancelled",F=[{key:"step",label:"Active step",show:!0},{key:"graph",label:"Graph",show:!0},{key:"logs",label:"Logs",show:!0},{key:"events",label:"Events",show:!0},{key:"request",label:"Replay",show:X}];return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsxs("header",{className:"shrink-0 border-b border-zinc-800 bg-canvas/60 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[l.jsx(De,{to:"/workflows/$name",params:{name:O.workflowName},className:"p-1 rounded hover:bg-hover text-zinc-500 hover:text-zinc-300 transition-colors",children:l.jsx(Jo,{className:"w-4 h-4"})}),l.jsx("span",{className:"text-sm text-zinc-500",children:O.workflowName}),l.jsx("span",{className:"text-zinc-700",children:"/"}),l.jsx("span",{className:"text-sm font-mono text-zinc-400",children:O.id.slice(0,12)}),l.jsx(Es,{status:O.status}),l.jsx(fx,{ms:O.status==="running"?O.startedAt:O.durationMs,running:O.status==="running"}),O.replayOf&&l.jsxs(De,{to:"/runs/$runId",params:{runId:O.replayOf},className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono uppercase tracking-wide bg-raised text-zinc-400 hover:text-zinc-100 hover:bg-hover transition-colors",title:`Replay of run ${O.replayOf}`,children:[l.jsx(Uo,{className:"w-2.5 h-2.5"}),"replay of ",O.replayOf.slice(0,8)]}),O.parentRunId&&l.jsxs(De,{to:"/runs/$runId",params:{runId:O.parentRunId},className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono uppercase tracking-wide bg-raised text-zinc-400 hover:text-zinc-100 hover:bg-hover transition-colors",title:`Called from run ${O.parentRunId}`,children:[l.jsx(El,{className:"w-2.5 h-2.5"}),"called from ",O.parentRunId.slice(0,8)]}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[Q&&X&&l.jsxs("button",{type:"button",onClick:Y,disabled:N,className:q("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",N?"bg-raised text-zinc-500 cursor-not-allowed":"bg-raised text-zinc-300 hover:bg-hover hover:text-zinc-100"),title:"Replay this run with the same request",children:[N?l.jsx(Oe,{className:"w-3 h-3 animate-spin"}):l.jsx(Uo,{className:"w-3 h-3"}),"Replay"]}),X&&l.jsxs("button",{type:"button",onClick:()=>b("request"),className:q("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",x==="request"?"bg-blok-green-500/15 text-blok-green-500":"bg-raised text-zinc-300 hover:bg-hover hover:text-zinc-100"),title:"Open request builder",children:[l.jsx(eh,{className:"w-3 h-3"}),"Request"]}),O.status==="failed"&&O.error&&l.jsx(hx,{runId:s}),l.jsx(rx,{onExportJson:()=>Po(s),onExportCsv:()=>eu(s)})]})]}),l.jsxs("div",{className:"flex items-center gap-4 text-xs text-zinc-500 ml-9",children:[l.jsxs("span",{children:["Trigger: ",l.jsx("span",{className:"text-zinc-400 font-mono",children:O.triggerSummary})]}),l.jsxs("span",{children:["Started: ",l.jsx("span",{className:"text-zinc-400",children:sc(O.startedAt)})]}),l.jsxs("span",{children:["Nodes:"," ",l.jsxs("span",{className:"text-zinc-400",children:[O.completedNodes,"/",O.nodeCount]})]}),v&&l.jsx("span",{className:"text-red-400",children:v})]}),l.jsx("div",{className:"ml-9 mt-1",children:l.jsx(xj,{runId:O.id,tags:O.tags||[]})}),R&&R.length>0&&l.jsxs("div",{className:"ml-9 mt-2 flex items-center gap-2 text-[11px] text-zinc-500 flex-wrap",children:[l.jsxs("span",{className:"flex items-center gap-1 uppercase tracking-wide font-semibold text-zinc-500",children:[l.jsx(El,{className:"w-3 h-3"}),"sub-runs (",R.length,")"]}),R.map(Z=>l.jsxs(De,{to:"/runs/$runId",params:{runId:Z.id},className:"flex items-center gap-1.5 px-1.5 py-0.5 rounded font-mono bg-raised hover:bg-hover text-zinc-400 hover:text-zinc-100 transition-colors",title:`${Z.workflowName} · ${Z.status}`,children:[l.jsx("span",{className:q("w-1.5 h-1.5 rounded-full shrink-0",Z.status==="completed"&&"bg-green-500",Z.status==="failed"&&"bg-red-500",Z.status==="running"&&"bg-blue-500 animate-pulse",Z.status==="cancelled"&&"bg-zinc-500",Z.status==="pending"&&"bg-zinc-600")}),Z.workflowName,l.jsx("span",{className:"text-zinc-600",children:Z.id.slice(0,8)})]},Z.id))]})]}),l.jsxs("div",{className:"flex-1 grid grid-cols-[240px_minmax(0,1fr)_320px] overflow-hidden",children:[l.jsx(Fj,{nodes:G,activeStepId:h,onSelect:m}),l.jsxs("main",{className:"flex flex-col overflow-hidden bg-canvas",children:[l.jsx("nav",{className:"flex gap-0 border-b border-zinc-800 px-4 sticky top-0 bg-canvas z-10",children:F.filter(Z=>Z.show).map((Z,ae)=>l.jsxs("button",{type:"button",onClick:()=>b(Z.key),className:q("px-3 py-2 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5",x===Z.key?"border-blok-green-500 text-zinc-100":"border-transparent text-zinc-500 hover:text-zinc-300"),children:[Z.label,l.jsx("kbd",{className:"font-mono text-[9.5px] px-1 py-px rounded bg-raised border border-zinc-800 text-zinc-500",children:ae+1})]},Z.key))}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[x==="step"&&(T?l.jsx(Sj,{node:T,logs:B,totalSteps:G.length}):l.jsx("div",{className:"p-8 text-sm text-zinc-500",children:"No step selected."})),x==="graph"&&l.jsx("div",{className:"p-4 h-full",children:l.jsx(Wj,{run:O,nodes:G,selectedNodeId:h,onSelectNode:m})}),x==="logs"&&l.jsx("div",{className:"h-full",children:l.jsx(Dj,{logs:B,nodeNames:k})}),x==="events"&&l.jsx("div",{className:"p-4",children:l.jsx(Rj,{runId:s})}),x==="request"&&l.jsx(Oj,{defaultMethod:M.method,defaultPath:M.path,onClose:()=>b("step")})]})]}),l.jsx(kj,{node:T,logs:B})]})]})}const iN=dv.update({id:"/webhooks",path:"/webhooks",getParentRoute:()=>xt}),cN=hv.update({id:"/settings",path:"/settings",getParentRoute:()=>xt}),rN=jv.update({id:"/scheduled",path:"/scheduled",getParentRoute:()=>xt}),oN=Ev.update({id:"/queues",path:"/queues",getParentRoute:()=>xt}),uN=Av.update({id:"/metrics",path:"/metrics",getParentRoute:()=>xt}),dN=Ov.update({id:"/logs",path:"/logs",getParentRoute:()=>xt}),fN=Lv.update({id:"/deployments",path:"/deployments",getParentRoute:()=>xt}),mN=Pv.update({id:"/dashboards",path:"/dashboards",getParentRoute:()=>xt}),hN=c1.update({id:"/",path:"/",getParentRoute:()=>xt}),xN=b1.update({id:"/runs/",path:"/runs/",getParentRoute:()=>xt}),pN=dx.update({id:"/workflows/$name",path:"/workflows/$name",getParentRoute:()=>xt}),bN=mx.update({id:"/runs/diff",path:"/runs/diff",getParentRoute:()=>xt}),gN=px.update({id:"/runs/$runId",path:"/runs/$runId",getParentRoute:()=>xt}),yN={IndexRoute:hN,DashboardsRoute:mN,DeploymentsRoute:fN,LogsRoute:dN,MetricsRoute:uN,QueuesRoute:oN,ScheduledRoute:rN,SettingsRoute:cN,WebhooksRoute:iN,RunsRunIdRoute:gN,RunsDiffRoute:bN,WorkflowsNameRoute:pN,RunsIndexRoute:xN},vN=xt._addFileChildren(yN)._addFileTypes(),bx=new Xb({defaultOptions:{queries:{staleTime:2e3,retry:1,refetchOnWindowFocus:!0}}}),jN=Ib({routeTree:vN,context:{queryClient:bx},defaultPreload:"intent"}),NN=document.getElementById("root");Kg.createRoot(NN).render(l.jsx(A.StrictMode,{children:l.jsx(Vb,{client:bx,children:l.jsx(Pb,{router:jN})})}));
|