blokctl 0.4.0 → 0.6.2
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/check/index.d.ts +2 -0
- package/dist/commands/check/index.js +39 -0
- package/dist/commands/create/project.js +32 -27
- package/dist/commands/create/utils/Examples.d.ts +2 -2
- package/dist/commands/create/utils/Examples.js +28 -31
- package/dist/commands/dev/index.js +40 -57
- package/dist/commands/generate/GenerationAnalytics.js +2 -1
- package/dist/commands/generate/e2e/NodeGenerator.e2e.test.js +1 -1
- package/dist/commands/generate/e2e/TriggerGenerator.e2e.test.js +1 -1
- package/dist/commands/generate/e2e/WorkflowGenerator.e2e.test.js +1 -1
- package/dist/index.js +14 -1
- package/dist/services/local-token-manager.js +1 -1
- package/dist/services/runtime-detector.d.ts +1 -0
- package/dist/services/runtime-detector.js +12 -0
- package/dist/services/runtime-setup.d.ts +12 -1
- package/dist/services/runtime-setup.js +28 -0
- package/dist/services/semver-utils.d.ts +18 -0
- package/dist/services/semver-utils.js +82 -0
- package/dist/services/semver-utils.test.d.ts +1 -0
- package/dist/services/semver-utils.test.js +233 -0
- package/dist/studio-dist/assets/{icons-N5J4OhGx.js → icons-D-BBts99.js} +110 -65
- package/dist/studio-dist/assets/index-BD8_9YPN.js +42 -0
- package/dist/studio-dist/assets/index-D4Bc9-mb.css +1 -0
- package/dist/studio-dist/index.html +3 -3
- package/package.json +2 -2
- package/dist/studio-dist/assets/index-D6hOoOID.css +0 -1
- package/dist/studio-dist/assets/index-D_CdNmTc.js +0 -42
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var qb=Object.defineProperty;var Hb=(s,r,o)=>r in s?qb(s,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[r]=o;var lm=(s,r,o)=>Hb(s,typeof r!="symbol"?r+"":r,o);import{a as Bb,j as l,R as Vi,r as R,u as qe,b as ht,d as Lt,g as Gb,Q as Qb,e as Yb}from"./tanstack-query-Day3Mt-4.js";import{r as Kb,a as Xb,L as De,b as Cl,c as Vb,O as Zb,d as Et,e as $b,f as Jb,R as Fb}from"./tanstack-router-BB95iErN.js";import{af as Wb,ag as Bm,ah as Gm,ai as Qm,aj as Ym,ak as Km,al as Xm,am as Mo,an as Ib}from"./charts-Dh48HebV.js";import{C as js,a as ya,L as Pb,b as Vm,A as Wn,c as Ao,F as eg,T as tg,G as wl,d as Bo,W as Ns,S as Go,e as ng,B as am,f as lg,X as Kt,I as ag,g as Zm,h as ec,i as sm,j as Oe,k as sg,l as ba,m as Qo,n as tc,R as Yo,P as Nl,o as $m,p as Ko,D as ig,q as Xo,r as ja,M as cg,s as rg,t as og,u as Jm,v as ug,w as dg,x as fg,y as mg,E as hg,z as im,H as Vo,Z as xg,J as pg,K as cm,N as bg,O as va,Q as Oo,U as ys,V as _o,Y as gg,_ as yg,$ as vg,a0 as jg,a1 as Fm,a2 as Ng,a3 as zg,a4 as Sg,a5 as wg,a6 as Eg,a7 as Tg,a8 as Cg,a9 as Zo,aa as kg,ab as Rg,ac as So,ad as Dg,ae as Mg,af as Wm}from"./icons-D-BBts99.js";import{u as Ag,f as wo,g as Og,a as _g}from"./tanstack-table-Biem1hxK.js";import{r as Ug,i as Im,B as Pm,C as eh,M as th,H as El,P as Tl}from"./graph-DWteCadQ.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function o(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function u(d){if(d.ep)return;d.ep=!0;const m=o(d);fetch(d.href,m)}})();var Eo={exports:{}},xs={},To={exports:{}},Co={};/**
|
|
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 rm;function Lg(){return rm||(rm=1,(function(s){function r(_,V){var P=_.length;_.push(V);e:for(;0<P;){var me=P-1>>>1,ye=_[me];if(0<d(ye,V))_[me]=V,_[P]=ye,P=me;else break e}}function o(_){return _.length===0?null:_[0]}function u(_){if(_.length===0)return null;var V=_[0],P=_.pop();if(P!==V){_[0]=P;e:for(var me=0,ye=_.length,Se=ye>>>1;me<Se;){var Re=2*(me+1)-1,xe=_[Re],Ze=Re+1,Vt=_[Ze];if(0>d(xe,P))Ze<ye&&0>d(Vt,xe)?(_[me]=Vt,_[Ze]=P,me=Ze):(_[me]=xe,_[Re]=P,me=Re);else if(Ze<ye&&0>d(Vt,P))_[me]=Vt,_[Ze]=P,me=Ze;else break e}}return V}function d(_,V){var P=_.sortIndex-V.sortIndex;return P!==0?P:_.id-V.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;s.unstable_now=function(){return m.now()}}else{var h=Date,p=h.now();s.unstable_now=function(){return h.now()-p}}var b=[],z=[],v=1,y=null,j=3,S=!1,D=!1,q=!1,O=!1,Y=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function B(_){for(var V=o(z);V!==null;){if(V.callback===null)u(z);else if(V.startTime<=_)u(z),V.sortIndex=V.expirationTime,r(b,V);else break;V=o(z)}}function X(_){if(q=!1,B(_),!D)if(o(b)!==null)D=!0,Q||(Q=!0,K());else{var V=o(z);V!==null&&it(X,V.startTime-_)}}var Q=!1,F=-1,Z=5,ae=-1;function _e(){return O?!0:!(s.unstable_now()-ae<Z)}function He(){if(O=!1,Q){var _=s.unstable_now();ae=_;var V=!0;try{e:{D=!1,q&&(q=!1,M(F),F=-1),S=!0;var P=j;try{t:{for(B(_),y=o(b);y!==null&&!(y.expirationTime>_&&_e());){var me=y.callback;if(typeof me=="function"){y.callback=null,j=y.priorityLevel;var ye=me(y.expirationTime<=_);if(_=s.unstable_now(),typeof ye=="function"){y.callback=ye,B(_),V=!0;break t}y===o(b)&&u(b),B(_)}else u(b);y=o(b)}if(y!==null)V=!0;else{var Se=o(z);Se!==null&&it(X,Se.startTime-_),V=!1}}break e}finally{y=null,j=P,S=!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(_,V){F=Y(function(){_(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(_){_.callback=null},s.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<_?Math.floor(1e3/_):5},s.unstable_getCurrentPriorityLevel=function(){return j},s.unstable_next=function(_){switch(j){case 1:case 2:case 3:var V=3;break;default:V=j}var P=j;j=V;try{return _()}finally{j=P}},s.unstable_requestPaint=function(){O=!0},s.unstable_runWithPriority=function(_,V){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var P=j;j=_;try{return V()}finally{j=P}},s.unstable_scheduleCallback=function(_,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,_){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,_={id:v++,callback:V,priorityLevel:_,startTime:P,expirationTime:ye,sortIndex:-1},P>me?(_.sortIndex=P,r(z,_),o(b)===null&&_===o(z)&&(q?(M(F),F=-1):q=!0,it(X,P-me))):(_.sortIndex=ye,r(b,_),D||S||(D=!0,Q||(Q=!0,K()))),_},s.unstable_shouldYield=_e,s.unstable_wrapCallback=function(_){var V=j;return function(){var P=j;j=V;try{return _.apply(this,arguments)}finally{j=P}}}})(Co)),Co}var om;function qg(){return om||(om=1,To.exports=Lg()),To.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 um;function Hg(){if(um)return xs;um=1;var s=qg(),r=Bb(),o=Kb();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 m(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 h(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 p(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(m(e)!==e)throw Error(u(188))}function z(e){var t=e.alternate;if(!t){if(t=m(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 c=i.alternate;if(c===null){if(a=i.return,a!==null){n=a;continue}break}if(i.child===c.child){for(c=i.child;c;){if(c===n)return b(i),e;if(c===a)return b(i),t;c=c.sibling}throw Error(u(188))}if(n.return!==a.return)n=i,a=c;else{for(var f=!1,x=i.child;x;){if(x===n){f=!0,n=i,a=c;break}if(x===a){f=!0,a=i,n=c;break}x=x.sibling}if(!f){for(x=c.child;x;){if(x===n){f=!0,n=c,a=i;break}if(x===a){f=!0,a=c,n=i;break}x=x.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 v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,j=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),M=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 q:return"Fragment";case Y:return"Profiler";case O:return"StrictMode";case X:return"Suspense";case Q:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case D:return"Portal";case G:return e.displayName||"Context";case M: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,_=r.__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 Se(e){return{current:e}}function Re(e){0>ye||(e.current=me[ye],me[ye]=null,ye--)}function xe(e,t){ye++,me[ye]=e.current,e.current=t}var Ze=Se(null),Vt=Se(null),jn=Se(null),Es=Se(null);function Ts(e,t){switch(xe(jn,t),xe(Vt,e),xe(Ze,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?E0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=E0(t),e=T0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Re(Ze),xe(Ze,e)}function kl(){Re(Ze),Re(Vt),Re(jn)}function ac(e){e.memoizedState!==null&&xe(Es,e);var t=Ze.current,n=T0(t,e.type);t!==n&&(xe(Vt,e),xe(Ze,n))}function Cs(e){Vt.current===e&&(Re(Ze),Re(Vt)),Es.current===e&&(Re(Es),ds._currentValue=P)}var sc,tu;function el(e){if(sc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);sc=t&&t[1]||"",tu=-1<n.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+sc+e+tu}var ic=!1;function cc(e,t){if(!e||ic)return"";ic=!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(k){var C=k}Reflect.construct(e,[],H)}else{try{H.call()}catch(k){C=k}e.call(H.prototype)}}else{try{throw Error()}catch(k){C=k}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(k){if(k&&C&&typeof k.stack=="string")return[k.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 c=a.DetermineComponentFrameRoot(),f=c[0],x=c[1];if(f&&x){var g=f.split(`
|
|
20
|
+
`),T=x.split(`
|
|
21
|
+
`);for(i=a=0;a<g.length&&!g[a].includes("DetermineComponentFrameRoot");)a++;for(;i<T.length&&!T[i].includes("DetermineComponentFrameRoot");)i++;if(a===g.length||i===T.length)for(a=g.length-1,i=T.length-1;1<=a&&0<=i&&g[a]!==T[i];)i--;for(;1<=a&&0<=i;a--,i--)if(g[a]!==T[i]){if(a!==1||i!==1)do if(a--,i--,0>i||g[a]!==T[i]){var A=`
|
|
22
|
+
`+g[a].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),A}while(1<=a&&0<=i);break}}}finally{ic=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?el(n):""}function xx(e,t){switch(e.tag){case 26:case 27:case 5:return el(e.type);case 16:return el("Lazy");case 13:return e.child!==t&&t!==null?el("Suspense Fallback"):el("Suspense");case 19:return el("SuspenseList");case 0:case 15:return cc(e.type,!1);case 11:return cc(e.type.render,!1);case 1:return cc(e.type,!0);case 31:return el("Activity");default:return""}}function nu(e){try{var t="",n=null;do t+=xx(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
23
|
+
Error generating stack: `+a.message+`
|
|
24
|
+
`+a.stack}}var rc=Object.prototype.hasOwnProperty,oc=s.unstable_scheduleCallback,uc=s.unstable_cancelCallback,px=s.unstable_shouldYield,bx=s.unstable_requestPaint,pt=s.unstable_now,gx=s.unstable_getCurrentPriorityLevel,lu=s.unstable_ImmediatePriority,au=s.unstable_UserBlockingPriority,ks=s.unstable_NormalPriority,yx=s.unstable_LowPriority,su=s.unstable_IdlePriority,vx=s.log,jx=s.unstable_setDisableYieldValue,za=null,bt=null;function Nn(e){if(typeof vx=="function"&&jx(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(za,e)}catch{}}var gt=Math.clz32?Math.clz32:Sx,Nx=Math.log,zx=Math.LN2;function Sx(e){return e>>>=0,e===0?32:31-(Nx(e)/zx|0)|0}var Rs=256,Ds=262144,Ms=4194304;function tl(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 As(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var i=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var x=a&134217727;return x!==0?(a=x&~c,a!==0?i=tl(a):(f&=x,f!==0?i=tl(f):n||(n=x&~e,n!==0&&(i=tl(n))))):(x=a&~c,x!==0?i=tl(x):f!==0?i=tl(f):n||(n=a&~e,n!==0&&(i=tl(n)))),i===0?0:t!==0&&t!==i&&(t&c)===0&&(c=i&-i,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:i}function Sa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function wx(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 iu(){var e=Ms;return Ms<<=1,(Ms&62914560)===0&&(Ms=4194304),e}function dc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function wa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ex(e,t,n,a,i,c){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 x=e.entanglements,g=e.expirationTimes,T=e.hiddenUpdates;for(n=f&~n;0<n;){var A=31-gt(n),H=1<<A;x[A]=0,g[A]=-1;var C=T[A];if(C!==null)for(T[A]=null,A=0;A<C.length;A++){var k=C[A];k!==null&&(k.lane&=-536870913)}n&=~H}a!==0&&cu(e,a,0),c!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=c&~(f&~t))}function cu(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 ru(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 ou(e,t){var n=t&-t;return n=(n&42)!==0?1:fc(n),(n&(e.suspendedLanes|t))!==0?0:n}function fc(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 mc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function uu(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:F0(e.type))}function du(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var zn=Math.random().toString(36).slice(2),We="__reactFiber$"+zn,ct="__reactProps$"+zn,Rl="__reactContainer$"+zn,hc="__reactEvents$"+zn,Tx="__reactListeners$"+zn,Cx="__reactHandles$"+zn,fu="__reactResources$"+zn,Ea="__reactMarker$"+zn;function xc(e){delete e[We],delete e[ct],delete e[hc],delete e[Tx],delete e[Cx]}function Dl(e){var t=e[We];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Rl]||n[We]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=O0(e);e!==null;){if(n=e[We])return n;e=O0(e)}return t}e=n,n=e.parentNode}return null}function Ml(e){if(e=e[We]||e[Rl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ta(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Al(e){var t=e[fu];return t||(t=e[fu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $e(e){e[Ea]=!0}var mu=new Set,hu={};function nl(e,t){Ol(e,t),Ol(e+"Capture",t)}function Ol(e,t){for(hu[e]=t,e=0;e<t.length;e++)mu.add(t[e])}var kx=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]*$"),xu={},pu={};function Rx(e){return rc.call(pu,e)?!0:rc.call(xu,e)?!1:kx.test(e)?pu[e]=!0:(xu[e]=!0,!1)}function Os(e,t,n){if(Rx(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 _s(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 Pt(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 bu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Dx(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,c=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(f){n=""+f,c.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 pc(e){if(!e._valueTracker){var t=bu(e)?"checked":"value";e._valueTracker=Dx(e,t,""+e[t])}}function gu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=bu(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Us(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 Mx=/[\n"\\]/g;function Ct(e){return e.replace(Mx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function bc(e,t,n,a,i,c,f,x){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?gc(e,f,Tt(t)):n!=null?gc(e,f,Tt(n)):a!=null&&e.removeAttribute("value"),i==null&&c!=null&&(e.defaultChecked=!!c),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+Tt(x):e.removeAttribute("name")}function yu(e,t,n,a,i,c,f,x){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){pc(e);return}n=n!=null?""+Tt(n):"",t=t!=null?""+Tt(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}a=a??i,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=x?e.checked:!!a,e.defaultChecked=!!a,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),pc(e)}function gc(e,t,n){t==="number"&&Us(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function _l(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 vu(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 ju(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),pc(e)}function Ul(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ax=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 Nu(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||Ax.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function zu(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&&Nu(e,i,a)}else for(var c in t)t.hasOwnProperty(c)&&Nu(e,c,t[c])}function yc(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 Ox=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"]]),_x=/^[\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 Ls(e){return _x.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function en(){}var vc=null;function jc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ll=null,ql=null;function Su(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(bc(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));bc(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&&gu(a)}break e;case"textarea":vu(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&_l(e,!!n.multiple,t,!1)}}}var Nc=!1;function wu(e,t,n){if(Nc)return e(t,n);Nc=!0;try{var a=e(t);return a}finally{if(Nc=!1,(Ll!==null||ql!==null)&&(Si(),Ll&&(t=Ll,e=ql,ql=Ll=null,Su(t),e)))for(t=0;t<e.length;t++)Su(e[t])}}function Ca(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 tn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zc=!1;if(tn)try{var ka={};Object.defineProperty(ka,"passive",{get:function(){zc=!0}}),window.addEventListener("test",ka,ka),window.removeEventListener("test",ka,ka)}catch{zc=!1}var Sn=null,Sc=null,qs=null;function Eu(){if(qs)return qs;var e,t=Sc,n=t.length,a,i="value"in Sn?Sn.value:Sn.textContent,c=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[c-a];a++);return qs=i.slice(e,1<a?1-a:void 0)}function Hs(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 Bs(){return!0}function Tu(){return!1}function rt(e){function t(n,a,i,c,f){this._reactName=n,this._targetInst=i,this.type=a,this.nativeEvent=c,this.target=f,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(n=e[x],this[x]=n?n(c):c[x]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Bs:Tu,this.isPropagationStopped=Tu,this}return y(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=Bs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Bs)},persist:function(){},isPersistent:Bs}),t}var ll={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gs=rt(ll),Ra=y({},ll,{view:0,detail:0}),Ux=rt(Ra),wc,Ec,Da,Qs=y({},Ra,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cc,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!==Da&&(Da&&e.type==="mousemove"?(wc=e.screenX-Da.screenX,Ec=e.screenY-Da.screenY):Ec=wc=0,Da=e),wc)},movementY:function(e){return"movementY"in e?e.movementY:Ec}}),Cu=rt(Qs),Lx=y({},Qs,{dataTransfer:0}),qx=rt(Lx),Hx=y({},Ra,{relatedTarget:0}),Tc=rt(Hx),Bx=y({},ll,{animationName:0,elapsedTime:0,pseudoElement:0}),Gx=rt(Bx),Qx=y({},ll,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yx=rt(Qx),Kx=y({},ll,{data:0}),ku=rt(Kx),Xx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vx={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"},Zx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $x(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zx[e])?!!t[e]:!1}function Cc(){return $x}var Jx=y({},Ra,{key:function(e){if(e.key){var t=Xx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cc,charCode:function(e){return e.type==="keypress"?Hs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fx=rt(Jx),Wx=y({},Qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ru=rt(Wx),Ix=y({},Ra,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cc}),Px=rt(Ix),ep=y({},ll,{propertyName:0,elapsedTime:0,pseudoElement:0}),tp=rt(ep),np=y({},Qs,{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}),lp=rt(np),ap=y({},ll,{newState:0,oldState:0}),sp=rt(ap),ip=[9,13,27,32],kc=tn&&"CompositionEvent"in window,Ma=null;tn&&"documentMode"in document&&(Ma=document.documentMode);var cp=tn&&"TextEvent"in window&&!Ma,Du=tn&&(!kc||Ma&&8<Ma&&11>=Ma),Mu=" ",Au=!1;function Ou(e,t){switch(e){case"keyup":return ip.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _u(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hl=!1;function rp(e,t){switch(e){case"compositionend":return _u(t);case"keypress":return t.which!==32?null:(Au=!0,Mu);case"textInput":return e=t.data,e===Mu&&Au?null:e;default:return null}}function op(e,t){if(Hl)return e==="compositionend"||!kc&&Ou(e,t)?(e=Eu(),qs=Sc=Sn=null,Hl=!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 Du&&t.locale!=="ko"?null:t.data;default:return null}}var up={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 Uu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!up[e.type]:t==="textarea"}function Lu(e,t,n,a){Ll?ql?ql.push(a):ql=[a]:Ll=a,t=Di(t,"onChange"),0<t.length&&(n=new Gs("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Aa=null,Oa=null;function dp(e){v0(e,0)}function Ys(e){var t=Ta(e);if(gu(t))return e}function qu(e,t){if(e==="change")return t}var Hu=!1;if(tn){var Rc;if(tn){var Dc="oninput"in document;if(!Dc){var Bu=document.createElement("div");Bu.setAttribute("oninput","return;"),Dc=typeof Bu.oninput=="function"}Rc=Dc}else Rc=!1;Hu=Rc&&(!document.documentMode||9<document.documentMode)}function Gu(){Aa&&(Aa.detachEvent("onpropertychange",Qu),Oa=Aa=null)}function Qu(e){if(e.propertyName==="value"&&Ys(Oa)){var t=[];Lu(t,Oa,e,jc(e)),wu(dp,t)}}function fp(e,t,n){e==="focusin"?(Gu(),Aa=t,Oa=n,Aa.attachEvent("onpropertychange",Qu)):e==="focusout"&&Gu()}function mp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ys(Oa)}function hp(e,t){if(e==="click")return Ys(t)}function xp(e,t){if(e==="input"||e==="change")return Ys(t)}function pp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:pp;function _a(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(!rc.call(t,i)||!yt(e[i],t[i]))return!1}return!0}function Yu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ku(e,t){var n=Yu(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=Yu(n)}}function Xu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Us(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=Us(e.document)}return t}function Mc(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 bp=tn&&"documentMode"in document&&11>=document.documentMode,Bl=null,Ac=null,Ua=null,Oc=!1;function Zu(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Oc||Bl==null||Bl!==Us(a)||(a=Bl,"selectionStart"in a&&Mc(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}),Ua&&_a(Ua,a)||(Ua=a,a=Di(Ac,"onSelect"),0<a.length&&(t=new Gs("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Bl)))}function al(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Gl={animationend:al("Animation","AnimationEnd"),animationiteration:al("Animation","AnimationIteration"),animationstart:al("Animation","AnimationStart"),transitionrun:al("Transition","TransitionRun"),transitionstart:al("Transition","TransitionStart"),transitioncancel:al("Transition","TransitionCancel"),transitionend:al("Transition","TransitionEnd")},_c={},$u={};tn&&($u=document.createElement("div").style,"AnimationEvent"in window||(delete Gl.animationend.animation,delete Gl.animationiteration.animation,delete Gl.animationstart.animation),"TransitionEvent"in window||delete Gl.transitionend.transition);function sl(e){if(_c[e])return _c[e];if(!Gl[e])return e;var t=Gl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $u)return _c[e]=t[n];return e}var Ju=sl("animationend"),Fu=sl("animationiteration"),Wu=sl("animationstart"),gp=sl("transitionrun"),yp=sl("transitionstart"),vp=sl("transitioncancel"),Iu=sl("transitionend"),Pu=new Map,Uc="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(" ");Uc.push("scrollEnd");function Ht(e,t){Pu.set(e,t),nl(t,[e])}var Ks=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)},kt=[],Ql=0,Lc=0;function Xs(){for(var e=Ql,t=Lc=Ql=0;t<e;){var n=kt[t];kt[t++]=null;var a=kt[t];kt[t++]=null;var i=kt[t];kt[t++]=null;var c=kt[t];if(kt[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}c!==0&&ed(n,i,c)}}function Vs(e,t,n,a){kt[Ql++]=e,kt[Ql++]=t,kt[Ql++]=n,kt[Ql++]=a,Lc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function qc(e,t,n,a){return Vs(e,t,n,a),Zs(e)}function il(e,t){return Vs(e,null,null,t),Zs(e)}function ed(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var i=!1,c=e.return;c!==null;)c.childLanes|=n,a=c.alternate,a!==null&&(a.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(i=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,i&&t!==null&&(i=31-gt(n),e=c.hiddenUpdates,a=e[i],a===null?e[i]=[t]:a.push(t),t.lane=n|536870912),c):null}function Zs(e){if(50<as)throw as=0,Zr=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Yl={};function jp(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 jp(e,t,n,a)}function Hc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nn(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 td(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 $s(e,t,n,a,i,c){var f=0;if(a=e,typeof e=="function")Hc(e)&&(f=1);else if(typeof e=="string")f=Eb(e,n,Ze.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=c,e;case q:return cl(n.children,i,c,t);case O:f=8,i|=24;break;case Y:return e=vt(12,n,t,i|2),e.elementType=Y,e.lanes=c,e;case X:return e=vt(13,n,t,i),e.elementType=X,e.lanes=c,e;case Q:return e=vt(19,n,t,i),e.elementType=Q,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:f=10;break e;case M: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=c,t}function cl(e,t,n,a){return e=vt(7,e,a,t),e.lanes=n,e}function Bc(e,t,n){return e=vt(6,e,null,t),e.lanes=n,e}function nd(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function Gc(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 ld=new WeakMap;function Rt(e,t){if(typeof e=="object"&&e!==null){var n=ld.get(e);return n!==void 0?n:(t={value:e,source:t,stack:nu(t)},ld.set(e,t),t)}return{value:e,source:t,stack:nu(t)}}var Kl=[],Xl=0,Js=null,La=0,Dt=[],Mt=0,wn=null,Zt=1,$t="";function ln(e,t){Kl[Xl++]=La,Kl[Xl++]=Js,Js=e,La=t}function ad(e,t,n){Dt[Mt++]=Zt,Dt[Mt++]=$t,Dt[Mt++]=wn,wn=e;var a=Zt;e=$t;var i=32-gt(a)-1;a&=~(1<<i),n+=1;var c=32-gt(t)+i;if(30<c){var f=i-i%5;c=(a&(1<<f)-1).toString(32),a>>=f,i-=f,Zt=1<<32-gt(t)+i|n<<i|a,$t=c+e}else Zt=1<<c|n<<i|a,$t=e}function Qc(e){e.return!==null&&(ln(e,1),ad(e,1,0))}function Yc(e){for(;e===Js;)Js=Kl[--Xl],Kl[Xl]=null,La=Kl[--Xl],Kl[Xl]=null;for(;e===wn;)wn=Dt[--Mt],Dt[Mt]=null,$t=Dt[--Mt],Dt[Mt]=null,Zt=Dt[--Mt],Dt[Mt]=null}function sd(e,t){Dt[Mt++]=Zt,Dt[Mt++]=$t,Dt[Mt++]=wn,Zt=t.id,$t=t.overflow,wn=e}var Ie=null,we=null,ue=!1,En=null,At=!1,Kc=Error(u(519));function Tn(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qa(Rt(t,e)),Kc}function id(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<is.length;n++)ce(is[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),yu(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),ju(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||S0(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=en),t=!0):t=!1,t||Tn(e,!0)}function cd(e){for(Ie=e.return;Ie;)switch(Ie.tag){case 5:case 31:case 13:At=!1;return;case 27:case 3:At=!0;return;default:Ie=Ie.return}}function Vl(e){if(e!==Ie)return!1;if(!ue)return cd(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")||ro(e.type,e.memoizedProps)),n=!n),n&&we&&Tn(e),cd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));we=A0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));we=A0(e)}else t===27?(t=we,Gn(e.type)?(e=ho,ho=null,we=e):we=t):we=Ie?_t(e.stateNode.nextSibling):null;return!0}function rl(){we=Ie=null,ue=!1}function Xc(){var e=En;return e!==null&&(ft===null?ft=e:ft.push.apply(ft,e),En=null),e}function qa(e){En===null?En=[e]:En.push(e)}var Vc=Se(null),ol=null,an=null;function Cn(e,t,n){xe(Vc,t._currentValue),t._currentValue=n}function sn(e){e._currentValue=Vc.current,Re(Vc)}function Zc(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 $c(e,t,n,a){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var c=i.dependencies;if(c!==null){var f=i.child;c=c.firstContext;e:for(;c!==null;){var x=c;c=i;for(var g=0;g<t.length;g++)if(x.context===t[g]){c.lanes|=n,x=c.alternate,x!==null&&(x.lanes|=n),Zc(c.return,n,e),a||(f=null);break e}c=x.next}}else if(i.tag===18){if(f=i.return,f===null)throw Error(u(341));f.lanes|=n,c=f.alternate,c!==null&&(c.lanes|=n),Zc(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 Zl(e,t,n,a){e=null;for(var i=t,c=!1;i!==null;){if(!c){if((i.flags&524288)!==0)c=!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 x=i.type;yt(i.pendingProps.value,f.value)||(e!==null?e.push(x):e=[x])}}else if(i===Es.current){if(f=i.alternate,f===null)throw Error(u(387));f.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(ds):e=[ds])}i=i.return}e!==null&&$c(t,e,n,a),t.flags|=262144}function Fs(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ul(e){ol=e,an=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pe(e){return rd(ol,e)}function Ws(e,t){return ol===null&&ul(e),rd(e,t)}function rd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},an===null){if(e===null)throw Error(u(308));an=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else an=an.next=t;return n}var Np=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()})}},zp=s.unstable_scheduleCallback,Sp=s.unstable_NormalPriority,Ge={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jc(){return{controller:new Np,data:new Map,refCount:0}}function Ha(e){e.refCount--,e.refCount===0&&zp(Sp,function(){e.controller.abort()})}var Ba=null,Fc=0,$l=0,Jl=null;function wp(e,t){if(Ba===null){var n=Ba=[];Fc=0,$l=Pr(),Jl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Fc++,t.then(od,od),t}function od(){if(--Fc===0&&Ba!==null){Jl!==null&&(Jl.status="fulfilled");var e=Ba;Ba=null,$l=0,Jl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ep(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 ud=_.S;_.S=function(e,t){$f=pt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wp(e,t),ud!==null&&ud(e,t)};var dl=Se(null);function Wc(){var e=dl.current;return e!==null?e:ze.pooledCache}function Is(e,t){t===null?xe(dl,dl.current):xe(dl,t.pool)}function dd(){var e=Wc();return e===null?null:{parent:Ge._currentValue,pool:e}}var Fl=Error(u(460)),Ic=Error(u(474)),Ps=Error(u(542)),ei={then:function(){}};function fd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function md(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xd(e),e;default:if(typeof t.status=="string")t.then(en,en);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,xd(e),e}throw ml=t,Fl}}function fl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ml=n,Fl):n}}var ml=null;function hd(){if(ml===null)throw Error(u(459));var e=ml;return ml=null,e}function xd(e){if(e===Fl||e===Ps)throw Error(u(483))}var Wl=null,Ga=0;function ti(e){var t=Ga;return Ga+=1,Wl===null&&(Wl=[]),md(Wl,e,t)}function Qa(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ni(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 pd(e){function t(w,N){if(e){var E=w.deletions;E===null?(w.deletions=[N],w.flags|=16):E.push(N)}}function n(w,N){if(!e)return null;for(;N!==null;)t(w,N),N=N.sibling;return null}function a(w){for(var N=new Map;w!==null;)w.key!==null?N.set(w.key,w):N.set(w.index,w),w=w.sibling;return N}function i(w,N){return w=nn(w,N),w.index=0,w.sibling=null,w}function c(w,N,E){return w.index=E,e?(E=w.alternate,E!==null?(E=E.index,E<N?(w.flags|=67108866,N):E):(w.flags|=67108866,N)):(w.flags|=1048576,N)}function f(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function x(w,N,E,U){return N===null||N.tag!==6?(N=Bc(E,w.mode,U),N.return=w,N):(N=i(N,E),N.return=w,N)}function g(w,N,E,U){var W=E.type;return W===q?A(w,N,E.props.children,U,E.key):N!==null&&(N.elementType===W||typeof W=="object"&&W!==null&&W.$$typeof===Z&&fl(W)===N.type)?(N=i(N,E.props),Qa(N,E),N.return=w,N):(N=$s(E.type,E.key,E.props,null,w.mode,U),Qa(N,E),N.return=w,N)}function T(w,N,E,U){return N===null||N.tag!==4||N.stateNode.containerInfo!==E.containerInfo||N.stateNode.implementation!==E.implementation?(N=Gc(E,w.mode,U),N.return=w,N):(N=i(N,E.children||[]),N.return=w,N)}function A(w,N,E,U,W){return N===null||N.tag!==7?(N=cl(E,w.mode,U,W),N.return=w,N):(N=i(N,E),N.return=w,N)}function H(w,N,E){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=Bc(""+N,w.mode,E),N.return=w,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case S:return E=$s(N.type,N.key,N.props,null,w.mode,E),Qa(E,N),E.return=w,E;case D:return N=Gc(N,w.mode,E),N.return=w,N;case Z:return N=fl(N),H(w,N,E)}if(it(N)||K(N))return N=cl(N,w.mode,E,null),N.return=w,N;if(typeof N.then=="function")return H(w,ti(N),E);if(N.$$typeof===G)return H(w,Ws(w,N),E);ni(w,N)}return null}function C(w,N,E,U){var W=N!==null?N.key:null;if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return W!==null?null:x(w,N,""+E,U);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case S:return E.key===W?g(w,N,E,U):null;case D:return E.key===W?T(w,N,E,U):null;case Z:return E=fl(E),C(w,N,E,U)}if(it(E)||K(E))return W!==null?null:A(w,N,E,U,null);if(typeof E.then=="function")return C(w,N,ti(E),U);if(E.$$typeof===G)return C(w,N,Ws(w,E),U);ni(w,E)}return null}function k(w,N,E,U,W){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return w=w.get(E)||null,x(N,w,""+U,W);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return w=w.get(U.key===null?E:U.key)||null,g(N,w,U,W);case D:return w=w.get(U.key===null?E:U.key)||null,T(N,w,U,W);case Z:return U=fl(U),k(w,N,E,U,W)}if(it(U)||K(U))return w=w.get(E)||null,A(N,w,U,W,null);if(typeof U.then=="function")return k(w,N,E,ti(U),W);if(U.$$typeof===G)return k(w,N,E,Ws(N,U),W);ni(N,U)}return null}function $(w,N,E,U){for(var W=null,de=null,J=N,ne=N=0,oe=null;J!==null&&ne<E.length;ne++){J.index>ne?(oe=J,J=null):oe=J.sibling;var fe=C(w,J,E[ne],U);if(fe===null){J===null&&(J=oe);break}e&&J&&fe.alternate===null&&t(w,J),N=c(fe,N,ne),de===null?W=fe:de.sibling=fe,de=fe,J=oe}if(ne===E.length)return n(w,J),ue&&ln(w,ne),W;if(J===null){for(;ne<E.length;ne++)J=H(w,E[ne],U),J!==null&&(N=c(J,N,ne),de===null?W=J:de.sibling=J,de=J);return ue&&ln(w,ne),W}for(J=a(J);ne<E.length;ne++)oe=k(J,w,ne,E[ne],U),oe!==null&&(e&&oe.alternate!==null&&J.delete(oe.key===null?ne:oe.key),N=c(oe,N,ne),de===null?W=oe:de.sibling=oe,de=oe);return e&&J.forEach(function(Vn){return t(w,Vn)}),ue&&ln(w,ne),W}function I(w,N,E,U){if(E==null)throw Error(u(151));for(var W=null,de=null,J=N,ne=N=0,oe=null,fe=E.next();J!==null&&!fe.done;ne++,fe=E.next()){J.index>ne?(oe=J,J=null):oe=J.sibling;var Vn=C(w,J,fe.value,U);if(Vn===null){J===null&&(J=oe);break}e&&J&&Vn.alternate===null&&t(w,J),N=c(Vn,N,ne),de===null?W=Vn:de.sibling=Vn,de=Vn,J=oe}if(fe.done)return n(w,J),ue&&ln(w,ne),W;if(J===null){for(;!fe.done;ne++,fe=E.next())fe=H(w,fe.value,U),fe!==null&&(N=c(fe,N,ne),de===null?W=fe:de.sibling=fe,de=fe);return ue&&ln(w,ne),W}for(J=a(J);!fe.done;ne++,fe=E.next())fe=k(J,w,ne,fe.value,U),fe!==null&&(e&&fe.alternate!==null&&J.delete(fe.key===null?ne:fe.key),N=c(fe,N,ne),de===null?W=fe:de.sibling=fe,de=fe);return e&&J.forEach(function(Lb){return t(w,Lb)}),ue&&ln(w,ne),W}function Ne(w,N,E,U){if(typeof E=="object"&&E!==null&&E.type===q&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case S:e:{for(var W=E.key;N!==null;){if(N.key===W){if(W=E.type,W===q){if(N.tag===7){n(w,N.sibling),U=i(N,E.props.children),U.return=w,w=U;break e}}else if(N.elementType===W||typeof W=="object"&&W!==null&&W.$$typeof===Z&&fl(W)===N.type){n(w,N.sibling),U=i(N,E.props),Qa(U,E),U.return=w,w=U;break e}n(w,N);break}else t(w,N);N=N.sibling}E.type===q?(U=cl(E.props.children,w.mode,U,E.key),U.return=w,w=U):(U=$s(E.type,E.key,E.props,null,w.mode,U),Qa(U,E),U.return=w,w=U)}return f(w);case D:e:{for(W=E.key;N!==null;){if(N.key===W)if(N.tag===4&&N.stateNode.containerInfo===E.containerInfo&&N.stateNode.implementation===E.implementation){n(w,N.sibling),U=i(N,E.children||[]),U.return=w,w=U;break e}else{n(w,N);break}else t(w,N);N=N.sibling}U=Gc(E,w.mode,U),U.return=w,w=U}return f(w);case Z:return E=fl(E),Ne(w,N,E,U)}if(it(E))return $(w,N,E,U);if(K(E)){if(W=K(E),typeof W!="function")throw Error(u(150));return E=W.call(E),I(w,N,E,U)}if(typeof E.then=="function")return Ne(w,N,ti(E),U);if(E.$$typeof===G)return Ne(w,N,Ws(w,E),U);ni(w,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,N!==null&&N.tag===6?(n(w,N.sibling),U=i(N,E),U.return=w,w=U):(n(w,N),U=Bc(E,w.mode,U),U.return=w,w=U),f(w)):n(w,N)}return function(w,N,E,U){try{Ga=0;var W=Ne(w,N,E,U);return Wl=null,W}catch(J){if(J===Fl||J===Ps)throw J;var de=vt(29,J,null,w.mode);return de.lanes=U,de.return=w,de}finally{}}}var hl=pd(!0),bd=pd(!1),kn=!1;function Pc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function er(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 Rn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Dn(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=Zs(e),ed(e,null,n),t}return Vs(e,a,t,n),Zs(e)}function Ya(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,ru(e,n)}}function tr(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var i=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?i=c=f:c=c.next=f,n=n.next}while(n!==null);c===null?i=c=t:c=c.next=t}else i=c=t;n={baseState:a.baseState,firstBaseUpdate:i,lastBaseUpdate:c,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 nr=!1;function Ka(){if(nr){var e=Jl;if(e!==null)throw e}}function Xa(e,t,n,a){nr=!1;var i=e.updateQueue;kn=!1;var c=i.firstBaseUpdate,f=i.lastBaseUpdate,x=i.shared.pending;if(x!==null){i.shared.pending=null;var g=x,T=g.next;g.next=null,f===null?c=T:f.next=T,f=g;var A=e.alternate;A!==null&&(A=A.updateQueue,x=A.lastBaseUpdate,x!==f&&(x===null?A.firstBaseUpdate=T:x.next=T,A.lastBaseUpdate=g))}if(c!==null){var H=i.baseState;f=0,A=T=g=null,x=c;do{var C=x.lane&-536870913,k=C!==x.lane;if(k?(re&C)===C:(a&C)===C){C!==0&&C===$l&&(nr=!0),A!==null&&(A=A.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var $=e,I=x;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=y({},H,C);break e;case 2:kn=!0}}C=x.callback,C!==null&&(e.flags|=64,k&&(e.flags|=8192),k=i.callbacks,k===null?i.callbacks=[C]:k.push(C))}else k={lane:C,tag:x.tag,payload:x.payload,callback:x.callback,next:null},A===null?(T=A=k,g=H):A=A.next=k,f|=C;if(x=x.next,x===null){if(x=i.shared.pending,x===null)break;k=x,x=k.next,k.next=null,i.lastBaseUpdate=k,i.shared.pending=null}}while(!0);A===null&&(g=H),i.baseState=g,i.firstBaseUpdate=T,i.lastBaseUpdate=A,c===null&&(i.shared.lanes=0),Un|=f,e.lanes=f,e.memoizedState=H}}function gd(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function yd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)gd(n[e],t)}var Il=Se(null),li=Se(0);function vd(e,t){e=xn,xe(li,e),xe(Il,t),xn=e|t.baseLanes}function lr(){xe(li,xn),xe(Il,Il.current)}function ar(){xn=li.current,Re(Il),Re(li)}var jt=Se(null),Ot=null;function Mn(e){var t=e.alternate;xe(Ue,Ue.current&1),xe(jt,e),Ot===null&&(t===null||Il.current!==null||t.memoizedState!==null)&&(Ot=e)}function sr(e){xe(Ue,Ue.current),xe(jt,e),Ot===null&&(Ot=e)}function jd(e){e.tag===22?(xe(Ue,Ue.current),xe(jt,e),Ot===null&&(Ot=e)):An()}function An(){xe(Ue,Ue.current),xe(jt,jt.current)}function Nt(e){Re(jt),Ot===e&&(Ot=null),Re(Ue)}var Ue=Se(0);function ai(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fo(n)||mo(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 cn=0,te=null,ve=null,Qe=null,si=!1,Pl=!1,xl=!1,ii=0,Va=0,ea=null,Tp=0;function Me(){throw Error(u(321))}function ir(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 cr(e,t,n,a,i,c){return cn=c,te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_.H=e===null||e.memoizedState===null?af:Nr,xl=!1,c=n(a,i),xl=!1,Pl&&(c=zd(t,n,a,i)),Nd(e),c}function Nd(e){_.H=Ja;var t=ve!==null&&ve.next!==null;if(cn=0,Qe=ve=te=null,si=!1,Va=0,ea=null,t)throw Error(u(300));e===null||Ye||(e=e.dependencies,e!==null&&Fs(e)&&(Ye=!0))}function zd(e,t,n,a){te=e;var i=0;do{if(Pl&&(ea=null),Va=0,Pl=!1,25<=i)throw Error(u(301));if(i+=1,Qe=ve=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}_.H=sf,c=t(n,a)}while(Pl);return c}function Cp(){var e=_.H,t=e.useState()[0];return t=typeof t.then=="function"?Za(t):t,e=e.useState()[0],(ve!==null?ve.memoizedState:null)!==e&&(te.flags|=1024),t}function rr(){var e=ii!==0;return ii=0,e}function or(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ur(e){if(si){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}si=!1}cn=0,Qe=ve=te=null,Pl=!1,Va=ii=0,ea=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 ci(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Za(e){var t=Va;return Va+=1,ea===null&&(ea=[]),e=md(ea,e,t),t=te,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,_.H=t===null||t.memoizedState===null?af:Nr),e}function ri(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Za(e);if(e.$$typeof===G)return Pe(e)}throw Error(u(438,String(e)))}function dr(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=ci(),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 rn(e,t){return typeof t=="function"?t(e):t}function oi(e){var t=Le();return fr(t,ve,e)}function fr(e,t,n){var a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=n;var i=e.baseQueue,c=a.pending;if(c!==null){if(i!==null){var f=i.next;i.next=c.next,c.next=f}t.baseQueue=i=c,a.pending=null}if(c=e.baseState,i===null)e.memoizedState=c;else{t=i.next;var x=f=null,g=null,T=t,A=!1;do{var H=T.lane&-536870913;if(H!==T.lane?(re&H)===H:(cn&H)===H){var C=T.revertLane;if(C===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),H===$l&&(A=!0);else if((cn&C)===C){T=T.next,C===$l&&(A=!0);continue}else H={lane:0,revertLane:T.revertLane,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},g===null?(x=g=H,f=c):g=g.next=H,te.lanes|=C,Un|=C;H=T.action,xl&&n(c,H),c=T.hasEagerState?T.eagerState:n(c,H)}else C={lane:H,revertLane:T.revertLane,gesture:T.gesture,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},g===null?(x=g=C,f=c):g=g.next=C,te.lanes|=H,Un|=H;T=T.next}while(T!==null&&T!==t);if(g===null?f=c:g.next=x,!yt(c,e.memoizedState)&&(Ye=!0,A&&(n=Jl,n!==null)))throw n;e.memoizedState=c,e.baseState=f,e.baseQueue=g,a.lastRenderedState=c}return i===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function mr(e){var t=Le(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var a=n.dispatch,i=n.pending,c=t.memoizedState;if(i!==null){n.pending=null;var f=i=i.next;do c=e(c,f.action),f=f.next;while(f!==i);yt(c,t.memoizedState)||(Ye=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,a]}function Sd(e,t,n){var a=te,i=Le(),c=ue;if(c){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,pr(Td.bind(null,a,i,e),[e]),i.getSnapshot!==t||f||Qe!==null&&Qe.memoizedState.tag&1){if(a.flags|=2048,ta(9,{destroy:void 0},Ed.bind(null,a,i,n,t),null),ze===null)throw Error(u(349));c||(cn&127)!==0||wd(a,t,n)}return n}function wd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=te.updateQueue,t===null?(t=ci(),te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ed(e,t,n,a){t.value=n,t.getSnapshot=a,Cd(t)&&kd(e)}function Td(e,t,n){return n(function(){Cd(t)&&kd(e)})}function Cd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yt(e,n)}catch{return!0}}function kd(e){var t=il(e,2);t!==null&&mt(t,e,2)}function hr(e){var t=st();if(typeof e=="function"){var n=e;if(e=n(),xl){Nn(!0);try{n()}finally{Nn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rn,lastRenderedState:e},t}function Rd(e,t,n,a){return e.baseState=n,fr(e,ve,typeof a=="function"?a:rn)}function kp(e,t,n,a,i){if(fi(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){c.listeners.push(f)}};_.T!==null?n(!0):c.isTransition=!1,a(c),n=t.pending,n===null?(c.next=t.pending=c,Dd(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Dd(e,t){var n=t.action,a=t.payload,i=e.state;if(t.isTransition){var c=_.T,f={};_.T=f;try{var x=n(i,a),g=_.S;g!==null&&g(f,x),Md(e,t,x)}catch(T){xr(e,t,T)}finally{c!==null&&f.types!==null&&(c.types=f.types),_.T=c}}else try{c=n(i,a),Md(e,t,c)}catch(T){xr(e,t,T)}}function Md(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Ad(e,t,a)},function(a){return xr(e,t,a)}):Ad(e,t,n)}function Ad(e,t,n){t.status="fulfilled",t.value=n,Od(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Dd(e,n)))}function xr(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Od(t),t=t.next;while(t!==a)}e.action=null}function Od(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _d(e,t){return t}function Ud(e,t){if(ue){var n=ze.formState;if(n!==null){e:{var a=te;if(ue){if(we){t:{for(var i=we,c=At;i.nodeType!==8;){if(!c){i=null;break t}if(i=_t(i.nextSibling),i===null){i=null;break t}}c=i.data,i=c==="F!"||c==="F"?i:null}if(i){we=_t(i.nextSibling),a=i.data==="F!";break e}}Tn(a)}a=!1}a&&(t=n[0])}}return n=st(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_d,lastRenderedState:t},n.queue=a,n=tf.bind(null,te,a),a.dispatch=n,a=hr(!1),c=jr.bind(null,te,!1,a.queue),a=st(),i={state:t,dispatch:null,action:e,pending:null},a.queue=i,n=kp.bind(null,te,i,c,n),i.dispatch=n,a.memoizedState=e,[t,n,!1]}function Ld(e){var t=Le();return qd(t,ve,e)}function qd(e,t,n){if(t=fr(e,t,_d)[0],e=oi(rn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Za(t)}catch(f){throw f===Fl?Ps:f}else a=t;t=Le();var i=t.queue,c=i.dispatch;return n!==t.memoizedState&&(te.flags|=2048,ta(9,{destroy:void 0},Rp.bind(null,i,n),null)),[a,c,e]}function Rp(e,t){e.action=t}function Hd(e){var t=Le(),n=ve;if(n!==null)return qd(t,n,e);Le(),t=t.memoizedState,n=Le();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function ta(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=te.updateQueue,t===null&&(t=ci(),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 Bd(){return Le().memoizedState}function ui(e,t,n,a){var i=st();te.flags|=e,i.memoizedState=ta(1|t,{destroy:void 0},n,a===void 0?null:a)}function di(e,t,n,a){var i=Le();a=a===void 0?null:a;var c=i.memoizedState.inst;ve!==null&&a!==null&&ir(a,ve.memoizedState.deps)?i.memoizedState=ta(t,c,n,a):(te.flags|=e,i.memoizedState=ta(1|t,c,n,a))}function Gd(e,t){ui(8390656,8,e,t)}function pr(e,t){di(2048,8,e,t)}function Dp(e){te.flags|=4;var t=te.updateQueue;if(t===null)t=ci(),te.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Qd(e){var t=Le().memoizedState;return Dp({ref:t,nextImpl:e}),function(){if((he&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Yd(e,t){return di(4,2,e,t)}function Kd(e,t){return di(4,4,e,t)}function Xd(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 Vd(e,t,n){n=n!=null?n.concat([e]):null,di(4,4,Xd.bind(null,t,e),n)}function br(){}function Zd(e,t){var n=Le();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&ir(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function $d(e,t){var n=Le();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&ir(t,a[1]))return a[0];if(a=e(),xl){Nn(!0);try{e()}finally{Nn(!1)}}return n.memoizedState=[a,t],a}function gr(e,t,n){return n===void 0||(cn&1073741824)!==0&&(re&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Ff(),te.lanes|=e,Un|=e,n)}function Jd(e,t,n,a){return yt(n,t)?n:Il.current!==null?(e=gr(e,n,a),yt(e,t)||(Ye=!0),e):(cn&42)===0||(cn&1073741824)!==0&&(re&261930)===0?(Ye=!0,e.memoizedState=n):(e=Ff(),te.lanes|=e,Un|=e,t)}function Fd(e,t,n,a,i){var c=V.p;V.p=c!==0&&8>c?c:8;var f=_.T,x={};_.T=x,jr(e,!1,t,n);try{var g=i(),T=_.S;if(T!==null&&T(x,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var A=Ep(g,a);$a(e,t,A,wt(e))}else $a(e,t,a,wt(e))}catch(H){$a(e,t,{then:function(){},status:"rejected",reason:H},wt())}finally{V.p=c,f!==null&&x.types!==null&&(f.types=x.types),_.T=f}}function Mp(){}function yr(e,t,n,a){if(e.tag!==5)throw Error(u(476));var i=Wd(e).queue;Fd(e,i,t,P,n===null?Mp:function(){return Id(e),n(a)})}function Wd(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:rn,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Id(e){var t=Wd(e);t.next===null&&(t=e.alternate.memoizedState),$a(e,t.next.queue,{},wt())}function vr(){return Pe(ds)}function Pd(){return Le().memoizedState}function ef(){return Le().memoizedState}function Ap(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wt();e=Rn(n);var a=Dn(t,e,n);a!==null&&(mt(a,t,n),Ya(a,t,n)),t={cache:Jc()},e.payload=t;return}t=t.return}}function Op(e,t,n){var a=wt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fi(e)?nf(t,n):(n=qc(e,t,n,a),n!==null&&(mt(n,e,a),lf(n,t,a)))}function tf(e,t,n){var a=wt();$a(e,t,n,a)}function $a(e,t,n,a){var i={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fi(e))nf(t,i);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,x=c(f,n);if(i.hasEagerState=!0,i.eagerState=x,yt(x,f))return Vs(e,t,i,0),ze===null&&Xs(),!1}catch{}finally{}if(n=qc(e,t,i,a),n!==null)return mt(n,e,a),lf(n,t,a),!0}return!1}function jr(e,t,n,a){if(a={lane:2,revertLane:Pr(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},fi(e)){if(t)throw Error(u(479))}else t=qc(e,n,a,2),t!==null&&mt(t,e,2)}function fi(e){var t=e.alternate;return e===te||t!==null&&t===te}function nf(e,t){Pl=si=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lf(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,ru(e,n)}}var Ja={readContext:Pe,use:ri,useCallback:Me,useContext:Me,useEffect:Me,useImperativeHandle:Me,useLayoutEffect:Me,useInsertionEffect:Me,useMemo:Me,useReducer:Me,useRef:Me,useState:Me,useDebugValue:Me,useDeferredValue:Me,useTransition:Me,useSyncExternalStore:Me,useId:Me,useHostTransitionStatus:Me,useFormState:Me,useActionState:Me,useOptimistic:Me,useMemoCache:Me,useCacheRefresh:Me};Ja.useEffectEvent=Me;var af={readContext:Pe,use:ri,useCallback:function(e,t){return st().memoizedState=[e,t===void 0?null:t],e},useContext:Pe,useEffect:Gd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ui(4194308,4,Xd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ui(4194308,4,e,t)},useInsertionEffect:function(e,t){ui(4,2,e,t)},useMemo:function(e,t){var n=st();t=t===void 0?null:t;var a=e();if(xl){Nn(!0);try{e()}finally{Nn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=st();if(n!==void 0){var i=n(t);if(xl){Nn(!0);try{n(t)}finally{Nn(!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=Op.bind(null,te,e),[a.memoizedState,e]},useRef:function(e){var t=st();return e={current:e},t.memoizedState=e},useState:function(e){e=hr(e);var t=e.queue,n=tf.bind(null,te,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:br,useDeferredValue:function(e,t){var n=st();return gr(n,e,t)},useTransition:function(){var e=hr(!1);return e=Fd.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||wd(a,t,n)}i.memoizedState=n;var c={value:n,getSnapshot:t};return i.queue=c,Gd(Td.bind(null,a,c,e),[e]),a.flags|=2048,ta(9,{destroy:void 0},Ed.bind(null,a,c,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=ii++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Tp++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:vr,useFormState:Ud,useActionState:Ud,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=jr.bind(null,te,!0,n),n.dispatch=t,[e,t]},useMemoCache:dr,useCacheRefresh:function(){return st().memoizedState=Ap.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)}}},Nr={readContext:Pe,use:ri,useCallback:Zd,useContext:Pe,useEffect:pr,useImperativeHandle:Vd,useInsertionEffect:Yd,useLayoutEffect:Kd,useMemo:$d,useReducer:oi,useRef:Bd,useState:function(){return oi(rn)},useDebugValue:br,useDeferredValue:function(e,t){var n=Le();return Jd(n,ve.memoizedState,e,t)},useTransition:function(){var e=oi(rn)[0],t=Le().memoizedState;return[typeof e=="boolean"?e:Za(e),t]},useSyncExternalStore:Sd,useId:Pd,useHostTransitionStatus:vr,useFormState:Ld,useActionState:Ld,useOptimistic:function(e,t){var n=Le();return Rd(n,ve,e,t)},useMemoCache:dr,useCacheRefresh:ef};Nr.useEffectEvent=Qd;var sf={readContext:Pe,use:ri,useCallback:Zd,useContext:Pe,useEffect:pr,useImperativeHandle:Vd,useInsertionEffect:Yd,useLayoutEffect:Kd,useMemo:$d,useReducer:mr,useRef:Bd,useState:function(){return mr(rn)},useDebugValue:br,useDeferredValue:function(e,t){var n=Le();return ve===null?gr(n,e,t):Jd(n,ve.memoizedState,e,t)},useTransition:function(){var e=mr(rn)[0],t=Le().memoizedState;return[typeof e=="boolean"?e:Za(e),t]},useSyncExternalStore:Sd,useId:Pd,useHostTransitionStatus:vr,useFormState:Hd,useActionState:Hd,useOptimistic:function(e,t){var n=Le();return ve!==null?Rd(n,ve,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:dr,useCacheRefresh:ef};sf.useEffectEvent=Qd;function zr(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:y({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Sr={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=wt(),i=Rn(a);i.payload=t,n!=null&&(i.callback=n),t=Dn(e,i,a),t!==null&&(mt(t,e,a),Ya(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=wt(),i=Rn(a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Dn(e,i,a),t!==null&&(mt(t,e,a),Ya(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wt(),a=Rn(n);a.tag=2,t!=null&&(a.callback=t),t=Dn(e,a,n),t!==null&&(mt(t,e,n),Ya(t,e,n))}};function cf(e,t,n,a,i,c,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,c,f):t.prototype&&t.prototype.isPureReactComponent?!_a(n,a)||!_a(i,c):!0}function rf(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&&Sr.enqueueReplaceState(t,t.state,null)}function pl(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=y({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function of(e){Ks(e)}function uf(e){console.error(e)}function df(e){Ks(e)}function mi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function ff(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 wr(e,t,n){return n=Rn(n),n.tag=3,n.payload={element:null},n.callback=function(){mi(e,t)},n}function mf(e){return e=Rn(e),e.tag=3,e}function hf(e,t,n,a){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var c=a.value;e.payload=function(){return i(c)},e.callback=function(){ff(t,n,a)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){ff(t,n,a),typeof i!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var x=a.stack;this.componentDidCatch(a.value,{componentStack:x!==null?x:""})})}function _p(e,t,n,a,i){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Zl(t,n,i,!0),n=jt.current,n!==null){switch(n.tag){case 31:case 13:return Ot===null?wi():n.alternate===null&&Ae===0&&(Ae=3),n.flags&=-257,n.flags|=65536,n.lanes=i,a===ei?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Fr(e,a,i)),!1;case 22:return n.flags|=65536,a===ei?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)),Fr(e,a,i)),!1}throw Error(u(435,n.tag))}return Fr(e,a,i),wi(),!1}if(ue)return t=jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,a!==Kc&&(e=Error(u(422),{cause:a}),qa(Rt(e,n)))):(a!==Kc&&(t=Error(u(423),{cause:a}),qa(Rt(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,a=Rt(a,n),i=wr(e.stateNode,a,i),tr(e,i),Ae!==4&&(Ae=2)),!1;var c=Error(u(520),{cause:a});if(c=Rt(c,n),ls===null?ls=[c]:ls.push(c),Ae!==4&&(Ae=2),t===null)return!0;a=Rt(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=wr(n.stateNode,a,e),tr(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Ln===null||!Ln.has(c))))return n.flags|=65536,i&=-i,n.lanes|=i,i=mf(i),hf(i,e,n,a),tr(n,i),!1}n=n.return}while(n!==null);return!1}var Er=Error(u(461)),Ye=!1;function et(e,t,n,a){t.child=e===null?bd(t,null,n,a):hl(t,e.child,n,a)}function xf(e,t,n,a,i){n=n.render;var c=t.ref;if("ref"in a){var f={};for(var x in a)x!=="ref"&&(f[x]=a[x])}else f=a;return ul(t),a=cr(e,t,n,f,c,i),x=rr(),e!==null&&!Ye?(or(e,t,i),on(e,t,i)):(ue&&x&&Qc(t),t.flags|=1,et(e,t,a,i),t.child)}function pf(e,t,n,a,i){if(e===null){var c=n.type;return typeof c=="function"&&!Hc(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,bf(e,t,c,a,i)):(e=$s(n.type,null,a,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Or(e,i)){var f=c.memoizedProps;if(n=n.compare,n=n!==null?n:_a,n(f,a)&&e.ref===t.ref)return on(e,t,i)}return t.flags|=1,e=nn(c,a),e.ref=t.ref,e.return=t,t.child=e}function bf(e,t,n,a,i){if(e!==null){var c=e.memoizedProps;if(_a(c,a)&&e.ref===t.ref)if(Ye=!1,t.pendingProps=a=c,Or(e,i))(e.flags&131072)!==0&&(Ye=!0);else return t.lanes=e.lanes,on(e,t,i)}return Tr(e,t,n,a,i)}function gf(e,t,n,a){var i=a.children,c=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(c=c!==null?c.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&~c}else a=0,t.child=null;return yf(e,t,c,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Is(t,c!==null?c.cachePool:null),c!==null?vd(t,c):lr(),jd(t);else return a=t.lanes=536870912,yf(e,t,c!==null?c.baseLanes|n:n,n,a)}else c!==null?(Is(t,c.cachePool),vd(t,c),An(),t.memoizedState=null):(e!==null&&Is(t,null),lr(),An());return et(e,t,i,n),t.child}function Fa(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function yf(e,t,n,a,i){var c=Wc();return c=c===null?null:{parent:Ge._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Is(t,null),lr(),jd(t),e!==null&&Zl(e,t,a,!0),t.childLanes=i,null}function hi(e,t){return t=pi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function vf(e,t,n){return hl(t,e.child,null,n),e=hi(t,t.pendingProps),e.flags|=2,Nt(t),t.memoizedState=null,e}function Up(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=hi(t,a),t.lanes=536870912,Fa(null,e);if(sr(t),(e=we)?(e=M0(e,At),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wn!==null?{id:Zt,overflow:$t}:null,retryLane:536870912,hydrationErrors:null},n=nd(e),n.return=t,t.child=n,Ie=t,we=null)):e=null,e===null)throw Tn(t);return t.lanes=536870912,null}return hi(t,a)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(sr(t),i)if(t.flags&256)t.flags&=-257,t=vf(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||Zl(e,t,n,!1),i=(n&e.childLanes)!==0,Ye||i){if(a=ze,a!==null&&(f=ou(a,n),f!==0&&f!==c.retryLane))throw c.retryLane=f,il(e,f),mt(a,e,f),Er;wi(),t=vf(e,t,n)}else e=c.treeContext,we=_t(f.nextSibling),Ie=t,ue=!0,En=null,At=!1,e!==null&&sd(t,e),t=hi(t,a),t.flags|=4096;return t}return e=nn(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xi(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 Tr(e,t,n,a,i){return ul(t),n=cr(e,t,n,a,void 0,i),a=rr(),e!==null&&!Ye?(or(e,t,i),on(e,t,i)):(ue&&a&&Qc(t),t.flags|=1,et(e,t,n,i),t.child)}function jf(e,t,n,a,i,c){return ul(t),t.updateQueue=null,n=zd(t,a,n,i),Nd(e),a=rr(),e!==null&&!Ye?(or(e,t,c),on(e,t,c)):(ue&&a&&Qc(t),t.flags|=1,et(e,t,n,c),t.child)}function Nf(e,t,n,a,i){if(ul(t),t.stateNode===null){var c=Yl,f=n.contextType;typeof f=="object"&&f!==null&&(c=Pe(f)),c=new n(a,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Sr,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=a,c.state=t.memoizedState,c.refs={},Pc(t),f=n.contextType,c.context=typeof f=="object"&&f!==null?Pe(f):Yl,c.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(zr(t,n,f,a),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(f=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),f!==c.state&&Sr.enqueueReplaceState(c,c.state,null),Xa(t,a,c,i),Ka(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){c=t.stateNode;var x=t.memoizedProps,g=pl(n,x);c.props=g;var T=c.context,A=n.contextType;f=Yl,typeof A=="object"&&A!==null&&(f=Pe(A));var H=n.getDerivedStateFromProps;A=typeof H=="function"||typeof c.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,A||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(x||T!==f)&&rf(t,c,a,f),kn=!1;var C=t.memoizedState;c.state=C,Xa(t,a,c,i),Ka(),T=t.memoizedState,x||C!==T||kn?(typeof H=="function"&&(zr(t,n,H,a),T=t.memoizedState),(g=kn||cf(t,n,g,a,C,T,f))?(A||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=T),c.props=a,c.state=T,c.context=f,a=g):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{c=t.stateNode,er(e,t),f=t.memoizedProps,A=pl(n,f),c.props=A,H=t.pendingProps,C=c.context,T=n.contextType,g=Yl,typeof T=="object"&&T!==null&&(g=Pe(T)),x=n.getDerivedStateFromProps,(T=typeof x=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==H||C!==g)&&rf(t,c,a,g),kn=!1,C=t.memoizedState,c.state=C,Xa(t,a,c,i),Ka();var k=t.memoizedState;f!==H||C!==k||kn||e!==null&&e.dependencies!==null&&Fs(e.dependencies)?(typeof x=="function"&&(zr(t,n,x,a),k=t.memoizedState),(A=kn||cf(t,n,A,a,C,k,g)||e!==null&&e.dependencies!==null&&Fs(e.dependencies))?(T||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(a,k,g),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(a,k,g)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&C===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&C===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=k),c.props=a,c.state=k,c.context=g,a=A):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&C===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&C===e.memoizedState||(t.flags|=1024),a=!1)}return c=a,xi(e,t),a=(t.flags&128)!==0,c||a?(c=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&a?(t.child=hl(t,e.child,null,i),t.child=hl(t,null,n,i)):et(e,t,n,i),t.memoizedState=c.state,e=t.child):e=on(e,t,i),e}function zf(e,t,n,a){return rl(),t.flags|=256,et(e,t,n,a),t.child}var Cr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kr(e){return{baseLanes:e,cachePool:dd()}}function Rr(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=St),e}function Sf(e,t,n){var a=t.pendingProps,i=!1,c=(t.flags&128)!==0,f;if((f=c)||(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):An(),(e=we)?(e=M0(e,At),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wn!==null?{id:Zt,overflow:$t}:null,retryLane:536870912,hydrationErrors:null},n=nd(e),n.return=t,t.child=n,Ie=t,we=null)):e=null,e===null)throw Tn(t);return mo(e)?t.lanes=32:t.lanes=536870912,null}var x=a.children;return a=a.fallback,i?(An(),i=t.mode,x=pi({mode:"hidden",children:x},i),a=cl(a,i,n,null),x.return=t,a.return=t,x.sibling=a,t.child=x,a=t.child,a.memoizedState=kr(n),a.childLanes=Rr(e,f,n),t.memoizedState=Cr,Fa(null,a)):(Mn(t),Dr(t,x))}var g=e.memoizedState;if(g!==null&&(x=g.dehydrated,x!==null)){if(c)t.flags&256?(Mn(t),t.flags&=-257,t=Mr(e,t,n)):t.memoizedState!==null?(An(),t.child=e.child,t.flags|=128,t=null):(An(),x=a.fallback,i=t.mode,a=pi({mode:"visible",children:a.children},i),x=cl(x,i,n,null),x.flags|=2,a.return=t,x.return=t,a.sibling=x,t.child=a,hl(t,e.child,null,n),a=t.child,a.memoizedState=kr(n),a.childLanes=Rr(e,f,n),t.memoizedState=Cr,t=Fa(null,a));else if(Mn(t),mo(x)){if(f=x.nextSibling&&x.nextSibling.dataset,f)var T=f.dgst;f=T,a=Error(u(419)),a.stack="",a.digest=f,qa({value:a,source:null,stack:null}),t=Mr(e,t,n)}else if(Ye||Zl(e,t,n,!1),f=(n&e.childLanes)!==0,Ye||f){if(f=ze,f!==null&&(a=ou(f,n),a!==0&&a!==g.retryLane))throw g.retryLane=a,il(e,a),mt(f,e,a),Er;fo(x)||wi(),t=Mr(e,t,n)}else fo(x)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,we=_t(x.nextSibling),Ie=t,ue=!0,En=null,At=!1,e!==null&&sd(t,e),t=Dr(t,a.children),t.flags|=4096);return t}return i?(An(),x=a.fallback,i=t.mode,g=e.child,T=g.sibling,a=nn(g,{mode:"hidden",children:a.children}),a.subtreeFlags=g.subtreeFlags&65011712,T!==null?x=nn(T,x):(x=cl(x,i,n,null),x.flags|=2),x.return=t,a.return=t,a.sibling=x,t.child=a,Fa(null,a),a=t.child,x=e.child.memoizedState,x===null?x=kr(n):(i=x.cachePool,i!==null?(g=Ge._currentValue,i=i.parent!==g?{parent:g,pool:g}:i):i=dd(),x={baseLanes:x.baseLanes|n,cachePool:i}),a.memoizedState=x,a.childLanes=Rr(e,f,n),t.memoizedState=Cr,Fa(e.child,a)):(Mn(t),n=e.child,e=n.sibling,n=nn(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 Dr(e,t){return t=pi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function pi(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function Mr(e,t,n){return hl(t,e.child,null,n),e=Dr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wf(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Zc(e.return,t,n)}function Ar(e,t,n,a,i,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:i,treeForkCount:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=a,f.tail=n,f.tailMode=i,f.treeForkCount=c)}function Ef(e,t,n){var a=t.pendingProps,i=a.revealOrder,c=a.tail;a=a.children;var f=Ue.current,x=(f&2)!==0;if(x?(f=f&1|2,t.flags|=128):f&=1,xe(Ue,f),et(e,t,a,n),a=ue?La:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wf(e,n,t);else if(e.tag===19)wf(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&&ai(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ar(t,!1,i,n,c,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&&ai(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ar(t,!0,n,null,c,a);break;case"together":Ar(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function on(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Un|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Zl(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=nn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=nn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Or(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fs(e)))}function Lp(e,t,n){switch(t.tag){case 3:Ts(t,t.stateNode.containerInfo),Cn(t,Ge,e.memoizedState.cache),rl();break;case 27:case 5:ac(t);break;case 4:Ts(t,t.stateNode.containerInfo);break;case 10:Cn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,sr(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?Sf(e,t,n):(Mn(t),e=on(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||(Zl(e,t,n,!1),a=(n&t.childLanes)!==0),i){if(a)return Ef(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,gf(e,t,n,t.pendingProps);case 24:Cn(t,Ge,e.memoizedState.cache)}return on(e,t,n)}function Tf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ye=!0;else{if(!Or(e,n)&&(t.flags&128)===0)return Ye=!1,Lp(e,t,n);Ye=(e.flags&131072)!==0}else Ye=!1,ue&&(t.flags&1048576)!==0&&ad(t,La,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=fl(t.elementType),t.type=e,typeof e=="function")Hc(e)?(a=pl(e,a),t.tag=1,t=Nf(null,t,e,a,n)):(t.tag=0,t=Tr(null,t,e,a,n));else{if(e!=null){var i=e.$$typeof;if(i===B){t.tag=11,t=xf(null,t,e,a,n);break e}else if(i===F){t.tag=14,t=pf(null,t,e,a,n);break e}}throw t=Be(e)||e,Error(u(306,t,""))}}return t;case 0:return Tr(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,i=pl(a,t.pendingProps),Nf(e,t,a,i,n);case 3:e:{if(Ts(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var c=t.memoizedState;i=c.element,er(e,t),Xa(t,a,null,n);var f=t.memoizedState;if(a=f.cache,Cn(t,Ge,a),a!==c.cache&&$c(t,[Ge],n,!0),Ka(),a=f.element,c.isDehydrated)if(c={element:a,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=zf(e,t,a,n);break e}else if(a!==i){i=Rt(Error(u(424)),t),qa(i),t=zf(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(we=_t(e.firstChild),Ie=t,ue=!0,En=null,At=!0,n=bd(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(rl(),a===i){t=on(e,t,n);break e}et(e,t,a,n)}t=t.child}return t;case 26:return xi(e,t),e===null?(n=q0(t.type,null,t.pendingProps,null))?t.memoizedState=n:ue||(n=t.type,e=t.pendingProps,a=Mi(jn.current).createElement(n),a[We]=t,a[ct]=e,tt(a,n,e),$e(a),t.stateNode=a):t.memoizedState=q0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ac(t),e===null&&ue&&(a=t.stateNode=_0(t.type,t.pendingProps,jn.current),Ie=t,At=!0,i=we,Gn(t.type)?(ho=i,we=_t(a.firstChild)):we=i),et(e,t,t.pendingProps.children,n),xi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ue&&((i=a=we)&&(a=mb(a,t.type,t.pendingProps,At),a!==null?(t.stateNode=a,Ie=t,we=_t(a.firstChild),At=!1,i=!0):i=!1),i||Tn(t)),ac(t),i=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,a=c.children,ro(i,c)?a=null:f!==null&&ro(i,f)&&(t.flags|=32),t.memoizedState!==null&&(i=cr(e,t,Cp,null,null,n),ds._currentValue=i),xi(e,t),et(e,t,a,n),t.child;case 6:return e===null&&ue&&((e=n=we)&&(n=hb(n,t.pendingProps,At),n!==null?(t.stateNode=n,Ie=t,we=null,e=!0):e=!1),e||Tn(t)),null;case 13:return Sf(e,t,n);case 4:return Ts(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=hl(t,null,a,n):et(e,t,a,n),t.child;case 11:return xf(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,Cn(t,t.type,a.value),et(e,t,a.children,n),t.child;case 9:return i=t.type._context,a=t.pendingProps.children,ul(t),i=Pe(i),a=a(i),t.flags|=1,et(e,t,a,n),t.child;case 14:return pf(e,t,t.type,t.pendingProps,n);case 15:return bf(e,t,t.type,t.pendingProps,n);case 19:return Ef(e,t,n);case 31:return Up(e,t,n);case 22:return gf(e,t,n,t.pendingProps);case 24:return ul(t),a=Pe(Ge),e===null?(i=Wc(),i===null&&(i=ze,c=Jc(),i.pooledCache=c,c.refCount++,c!==null&&(i.pooledCacheLanes|=n),i=c),t.memoizedState={parent:a,cache:i},Pc(t),Cn(t,Ge,i)):((e.lanes&n)!==0&&(er(e,t),Xa(t,null,null,n),Ka()),i=e.memoizedState,c=t.memoizedState,i.parent!==a?(i={parent:a,cache:a},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Cn(t,Ge,a)):(a=c.cache,Cn(t,Ge,a),a!==i.cache&&$c(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 un(e){e.flags|=4}function _r(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(e0())e.flags|=8192;else throw ml=ei,Ic}else e.flags&=-16777217}function Cf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Y0(t))if(e0())e.flags|=8192;else throw ml=ei,Ic}function bi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?iu():536870912,e.lanes|=t,sa|=t)}function Wa(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 Ee(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 qp(e,t,n){var a=t.pendingProps;switch(Yc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ee(t),null;case 1:return Ee(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),sn(Ge),kl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vl(t)?un(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Xc())),Ee(t),null;case 26:var i=t.type,c=t.memoizedState;return e===null?(un(t),c!==null?(Ee(t),Cf(t,c)):(Ee(t),_r(t,i,null,a,n))):c?c!==e.memoizedState?(un(t),Ee(t),Cf(t,c)):(Ee(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&un(t),Ee(t),_r(t,i,e,a,n)),null;case 27:if(Cs(t),n=jn.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&un(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Ee(t),null}e=Ze.current,Vl(t)?id(t):(e=_0(i,a,n),t.stateNode=e,un(t))}return Ee(t),null;case 5:if(Cs(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&un(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Ee(t),null}if(c=Ze.current,Vl(t))id(t);else{var f=Mi(jn.current);switch(c){case 1:c=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:c=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":c=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":c=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":c=f.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof a.is=="string"?f.createElement("select",{is:a.is}):f.createElement("select"),a.multiple?c.multiple=!0:a.size&&(c.size=a.size);break;default:c=typeof a.is=="string"?f.createElement(i,{is:a.is}):f.createElement(i)}}c[We]=t,c[ct]=a;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)c.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=c;e:switch(tt(c,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&&un(t)}}return Ee(t),_r(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&un(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=jn.current,Vl(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||S0(e.nodeValue,n)),e||Tn(t,!0)}else e=Mi(e).createTextNode(a),e[We]=t,t.stateNode=e}return Ee(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Vl(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 rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ee(t),e=!1}else n=Xc(),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 Ee(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Vl(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 rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ee(t),i=!1}else i=Xc(),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),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==i&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),bi(t,t.updateQueue),Ee(t),null);case 4:return kl(),e===null&&lo(t.stateNode.containerInfo),Ee(t),null;case 10:return sn(t.type),Ee(t),null;case 19:if(Re(Ue),a=t.memoizedState,a===null)return Ee(t),null;if(i=(t.flags&128)!==0,c=a.rendering,c===null)if(i)Wa(a,!1);else{if(Ae!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=ai(e),c!==null){for(t.flags|=128,Wa(a,!1),e=c.updateQueue,t.updateQueue=e,bi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)td(n,e),n=n.sibling;return xe(Ue,Ue.current&1|2),ue&&ln(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&pt()>Ni&&(t.flags|=128,i=!0,Wa(a,!1),t.lanes=4194304)}else{if(!i)if(e=ai(c),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,bi(t,e),Wa(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!ue)return Ee(t),null}else 2*pt()-a.renderingStartTime>Ni&&n!==536870912&&(t.flags|=128,i=!0,Wa(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(e=a.last,e!==null?e.sibling=c:t.child=c,a.last=c)}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&&ln(t,a.treeForkCount),e):(Ee(t),null);case 22:case 23:return Nt(t),ar(),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&&(Ee(t),t.subtreeFlags&6&&(t.flags|=8192)):Ee(t),n=t.updateQueue,n!==null&&bi(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&&Re(dl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),sn(Ge),Ee(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Hp(e,t){switch(Yc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sn(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 Cs(t),null;case 31:if(t.memoizedState!==null){if(Nt(t),t.alternate===null)throw Error(u(340));rl()}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));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Re(Ue),null;case 4:return kl(),null;case 10:return sn(t.type),null;case 22:case 23:return Nt(t),ar(),e!==null&&Re(dl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return sn(Ge),null;case 25:return null;default:return null}}function kf(e,t){switch(Yc(t),t.tag){case 3:sn(Ge),kl();break;case 26:case 27:case 5:Cs(t);break;case 4:kl();break;case 31:t.memoizedState!==null&&Nt(t);break;case 13:Nt(t);break;case 19:Re(Ue);break;case 10:sn(t.type);break;case 22:case 23:Nt(t),ar(),e!==null&&Re(dl);break;case 24:sn(Ge)}}function Ia(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 c=n.create,f=n.inst;a=c(),f.destroy=a}n=n.next}while(n!==i)}}catch(x){be(t,t.return,x)}}function On(e,t,n){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var c=i.next;a=c;do{if((a.tag&e)===e){var f=a.inst,x=f.destroy;if(x!==void 0){f.destroy=void 0,i=t;var g=n,T=x;try{T()}catch(A){be(i,g,A)}}}a=a.next}while(a!==c)}}catch(A){be(t,t.return,A)}}function Rf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{yd(t,n)}catch(a){be(e,e.return,a)}}}function Df(e,t,n){n.props=pl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){be(e,t,a)}}function Pa(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 Mf(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 Ur(e,t,n){try{var a=e.stateNode;cb(a,e.type,n,t),a[ct]=t}catch(i){be(e,e.return,i)}}function Af(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Gn(e.type)||e.tag===4}function Lr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Af(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&&Gn(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 qr(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=en));else if(a!==4&&(a===27&&Gn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qr(e,t,n),e=e.sibling;e!==null;)qr(e,t,n),e=e.sibling}function gi(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&&Gn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(gi(e,t,n),e=e.sibling;e!==null;)gi(e,t,n),e=e.sibling}function Of(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(c){be(e,e.return,c)}}var dn=!1,Ke=!1,Hr=!1,_f=typeof WeakSet=="function"?WeakSet:Set,Je=null;function Bp(e,t){if(e=e.containerInfo,io=Hi,e=Vu(e),Mc(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,c=a.focusNode;a=a.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var f=0,x=-1,g=-1,T=0,A=0,H=e,C=null;t:for(;;){for(var k;H!==n||i!==0&&H.nodeType!==3||(x=f+i),H!==c||a!==0&&H.nodeType!==3||(g=f+a),H.nodeType===3&&(f+=H.nodeValue.length),(k=H.firstChild)!==null;)C=H,H=k;for(;;){if(H===e)break t;if(C===n&&++T===i&&(x=f),C===c&&++A===a&&(g=f),(k=H.nextSibling)!==null)break;H=C,C=H.parentNode}H=k}n=x===-1||g===-1?null:{start:x,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(co={focusedElem:e,selectionRange:n},Hi=!1,Je=t;Je!==null;)if(t=Je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Je=e;else for(;Je!==null;){switch(t=Je,c=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&&c!==null){e=void 0,n=t,i=c.memoizedProps,c=c.memoizedState,a=n.stateNode;try{var $=pl(n.type,i);e=a.getSnapshotBeforeUpdate($,c),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)uo(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":uo(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,Je=e;break}Je=t.return}}function Uf(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:mn(e,n),a&4&&Ia(5,n);break;case 1:if(mn(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){be(n,n.return,f)}else{var i=pl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){be(n,n.return,f)}}a&64&&Rf(n),a&512&&Pa(n,n.return);break;case 3:if(mn(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{yd(e,t)}catch(f){be(n,n.return,f)}}break;case 27:t===null&&a&4&&Of(n);case 26:case 5:mn(e,n),t===null&&a&4&&Mf(n),a&512&&Pa(n,n.return);break;case 12:mn(e,n);break;case 31:mn(e,n),a&4&&Hf(e,n);break;case 13:mn(e,n),a&4&&Bf(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Jp.bind(null,n),xb(e,n))));break;case 22:if(a=n.memoizedState!==null||dn,!a){t=t!==null&&t.memoizedState!==null||Ke,i=dn;var c=Ke;dn=a,(Ke=t)&&!c?hn(e,n,(n.subtreeFlags&8772)!==0):mn(e,n),dn=i,Ke=c}break;case 30:break;default:mn(e,n)}}function Lf(e){var t=e.alternate;t!==null&&(e.alternate=null,Lf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xc(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 ke=null,ot=!1;function fn(e,t,n){for(n=n.child;n!==null;)qf(e,t,n),n=n.sibling}function qf(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(za,n)}catch{}switch(n.tag){case 26:Ke||Jt(n,t),fn(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=ke,i=ot;Gn(n.type)&&(ke=n.stateNode,ot=!1),fn(e,t,n),rs(n.stateNode),ke=a,ot=i;break;case 5:Ke||Jt(n,t);case 6:if(a=ke,i=ot,ke=null,fn(e,t,n),ke=a,ot=i,ke!==null)if(ot)try{(ke.nodeType===9?ke.body:ke.nodeName==="HTML"?ke.ownerDocument.body:ke).removeChild(n.stateNode)}catch(c){be(n,t,c)}else try{ke.removeChild(n.stateNode)}catch(c){be(n,t,c)}break;case 18:ke!==null&&(ot?(e=ke,R0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ma(e)):R0(ke,n.stateNode));break;case 4:a=ke,i=ot,ke=n.stateNode.containerInfo,ot=!0,fn(e,t,n),ke=a,ot=i;break;case 0:case 11:case 14:case 15:On(2,n,t),Ke||On(4,n,t),fn(e,t,n);break;case 1:Ke||(Jt(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Df(n,t,a)),fn(e,t,n);break;case 21:fn(e,t,n);break;case 22:Ke=(a=Ke)||n.memoizedState!==null,fn(e,t,n),Ke=a;break;default:fn(e,t,n)}}function Hf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ma(e)}catch(n){be(t,t.return,n)}}}function Bf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ma(e)}catch(n){be(t,t.return,n)}}function Gp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _f),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _f),t;default:throw Error(u(435,e.tag))}}function yi(e,t){var n=Gp(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var i=Fp.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],c=e,f=t,x=f;e:for(;x!==null;){switch(x.tag){case 27:if(Gn(x.type)){ke=x.stateNode,ot=!1;break e}break;case 5:ke=x.stateNode,ot=!1;break e;case 3:case 4:ke=x.stateNode.containerInfo,ot=!0;break e}x=x.return}if(ke===null)throw Error(u(160));qf(c,f,i),ke=null,ot=!1,c=i.alternate,c!==null&&(c.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Gf(t,e),t=t.sibling}var Bt=null;function Gf(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&&(On(3,e,e.return),Ia(3,e),On(5,e,e.return));break;case 1:ut(t,e),dt(e),a&512&&(Ke||n===null||Jt(n,n.return)),a&64&&dn&&(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 c=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":c=i.getElementsByTagName("title")[0],(!c||c[Ea]||c[We]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=i.createElement(a),i.head.insertBefore(c,i.querySelector("head > title"))),tt(c,a,n),c[We]=e,$e(c),a=c;break e;case"link":var f=G0("link","href",i).get(a+(n.href||""));if(f){for(var x=0;x<f.length;x++)if(c=f[x],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(x,1);break t}}c=i.createElement(a),tt(c,a,n),i.head.appendChild(c);break;case"meta":if(f=G0("meta","content",i).get(a+(n.content||""))){for(x=0;x<f.length;x++)if(c=f[x],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(x,1);break t}}c=i.createElement(a),tt(c,a,n),i.head.appendChild(c);break;default:throw Error(u(468,a))}c[We]=e,$e(c),a=c}e.stateNode=a}else Q0(i,e.type,e.stateNode);else e.stateNode=B0(i,a,e.memoizedProps);else c!==a?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,a===null?Q0(i,e.type,e.stateNode):B0(i,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Ur(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&&Ur(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{Ul(i,"")}catch($){be(e,e.return,$)}}a&4&&e.stateNode!=null&&(i=e.memoizedProps,Ur(e,i,n!==null?n.memoizedProps:i)),a&1024&&(Hr=!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(_i=null,i=Bt,Bt=Ai(t.containerInfo),ut(t,e),Bt=i,dt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{ma(t.containerInfo)}catch($){be(e,e.return,$)}Hr&&(Hr=!1,Qf(e));break;case 4:a=Bt,Bt=Ai(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,yi(e,a)));break;case 13:ut(t,e),dt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ji=pt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,yi(e,a)));break;case 22:i=e.memoizedState!==null;var g=n!==null&&n.memoizedState!==null,T=dn,A=Ke;if(dn=T||i,Ke=A||g,ut(t,e),Ke=A,dn=T,dt(e),a&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||g||dn||Ke||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){g=n=t;try{if(c=g.stateNode,i)f=c.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{x=g.stateNode;var H=g.memoizedProps.style,C=H!=null&&H.hasOwnProperty("display")?H.display:null;x.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 k=g.stateNode;i?D0(k,!0):D0(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,yi(e,n))));break;case 19:ut(t,e),dt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,yi(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(Af(a)){n=a;break}a=a.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var i=n.stateNode,c=Lr(e);gi(e,c,i);break;case 5:var f=n.stateNode;n.flags&32&&(Ul(f,""),n.flags&=-33);var x=Lr(e);gi(e,x,f);break;case 3:case 4:var g=n.stateNode.containerInfo,T=Lr(e);qr(e,T,g);break;default:throw Error(u(161))}}catch(A){be(e,e.return,A)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Qf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function mn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Uf(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:On(4,t,t.return),bl(t);break;case 1:Jt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Df(t,t.return,n),bl(t);break;case 27:rs(t.stateNode);case 26:case 5:Jt(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function hn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,i=e,c=t,f=c.flags;switch(c.tag){case 0:case 11:case 15:hn(i,c,n),Ia(4,c);break;case 1:if(hn(i,c,n),a=c,i=a.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(T){be(a,a.return,T)}if(a=c,i=a.updateQueue,i!==null){var x=a.stateNode;try{var g=i.shared.hiddenCallbacks;if(g!==null)for(i.shared.hiddenCallbacks=null,i=0;i<g.length;i++)gd(g[i],x)}catch(T){be(a,a.return,T)}}n&&f&64&&Rf(c),Pa(c,c.return);break;case 27:Of(c);case 26:case 5:hn(i,c,n),n&&a===null&&f&4&&Mf(c),Pa(c,c.return);break;case 12:hn(i,c,n);break;case 31:hn(i,c,n),n&&f&4&&Hf(i,c);break;case 13:hn(i,c,n),n&&f&4&&Bf(i,c);break;case 22:c.memoizedState===null&&hn(i,c,n),Pa(c,c.return);break;case 30:break;default:hn(i,c,n)}t=t.sibling}}function Br(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&&Ha(n))}function Gr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ha(e))}function Gt(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yf(e,t,n,a),t=t.sibling}function Yf(e,t,n,a){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Gt(e,t,n,a),i&2048&&Ia(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&&Ha(e)));break;case 12:if(i&2048){Gt(e,t,n,a),e=t.stateNode;try{var c=t.memoizedProps,f=c.id,x=c.onPostCommit;typeof x=="function"&&x(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:c=t.stateNode,f=t.alternate,t.memoizedState!==null?c._visibility&2?Gt(e,t,n,a):es(e,t):c._visibility&2?Gt(e,t,n,a):(c._visibility|=2,na(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Br(f,t);break;case 24:Gt(e,t,n,a),i&2048&&Gr(t.alternate,t);break;default:Gt(e,t,n,a)}}function na(e,t,n,a,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,f=t,x=n,g=a,T=f.flags;switch(f.tag){case 0:case 11:case 15:na(c,f,x,g,i),Ia(8,f);break;case 23:break;case 22:var A=f.stateNode;f.memoizedState!==null?A._visibility&2?na(c,f,x,g,i):es(c,f):(A._visibility|=2,na(c,f,x,g,i)),i&&T&2048&&Br(f.alternate,f);break;case 24:na(c,f,x,g,i),i&&T&2048&&Gr(f.alternate,f);break;default:na(c,f,x,g,i)}t=t.sibling}}function es(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:es(n,a),i&2048&&Br(a.alternate,a);break;case 24:es(n,a),i&2048&&Gr(a.alternate,a);break;default:es(n,a)}t=t.sibling}}var ts=8192;function la(e,t,n){if(e.subtreeFlags&ts)for(e=e.child;e!==null;)Kf(e,t,n),e=e.sibling}function Kf(e,t,n){switch(e.tag){case 26:la(e,t,n),e.flags&ts&&e.memoizedState!==null&&Tb(n,Bt,e.memoizedState,e.memoizedProps);break;case 5:la(e,t,n);break;case 3:case 4:var a=Bt;Bt=Ai(e.stateNode.containerInfo),la(e,t,n),Bt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ts,ts=16777216,la(e,t,n),ts=a):la(e,t,n));break;default:la(e,t,n)}}function Xf(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 ns(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];Je=a,Zf(a,e)}Xf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vf(e),e=e.sibling}function Vf(e){switch(e.tag){case 0:case 11:case 15:ns(e),e.flags&2048&&On(9,e,e.return);break;case 3:ns(e);break;case 12:ns(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vi(e)):ns(e);break;default:ns(e)}}function vi(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];Je=a,Zf(a,e)}Xf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:On(8,t,t.return),vi(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,vi(t));break;default:vi(t)}e=e.sibling}}function Zf(e,t){for(;Je!==null;){var n=Je;switch(n.tag){case 0:case 11:case 15:On(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:Ha(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Je=a;else e:for(n=e;Je!==null;){a=Je;var i=a.sibling,c=a.return;if(Lf(a),a===n){Je=null;break e}if(i!==null){i.return=c,Je=i;break e}Je=c}}}var Qp={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}},Yp=typeof WeakMap=="function"?WeakMap:Map,he=0,ze=null,ie=null,re=0,pe=0,zt=null,_n=!1,aa=!1,Qr=!1,xn=0,Ae=0,Un=0,gl=0,Yr=0,St=0,sa=0,ls=null,ft=null,Kr=!1,ji=0,$f=0,Ni=1/0,zi=null,Ln=null,Ve=0,qn=null,ia=null,pn=0,Xr=0,Vr=null,Jf=null,as=0,Zr=null;function wt(){return(he&2)!==0&&re!==0?re&-re:_.T!==null?Pr():uu()}function Ff(){if(St===0)if((re&536870912)===0||ue){var e=Ds;Ds<<=1,(Ds&3932160)===0&&(Ds=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)&&(ca(e,0),Hn(e,re,St,!1)),wa(e,n),((he&2)===0||e!==ze)&&(e===ze&&((he&2)===0&&(gl|=n),Ae===4&&Hn(e,re,St,!1)),Ft(e))}function Wf(e,t,n){if((he&6)!==0)throw Error(u(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Sa(e,t),i=a?Vp(e,t):Jr(e,t,!0),c=a;do{if(i===0){aa&&!a&&Hn(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Kp(n)){i=Jr(e,t,!1),c=!1;continue}if(i===2){if(c=t,e.errorRecoveryDisabledLanes&c)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var x=e;i=ls;var g=x.current.memoizedState.isDehydrated;if(g&&(ca(x,f).flags|=256),f=Jr(x,f,!1),f!==2){if(Qr&&!g){x.errorRecoveryDisabledLanes|=c,gl|=c,i=4;break e}c=ft,ft=i,c!==null&&(ft===null?ft=c:ft.push.apply(ft,c))}i=f}if(c=!1,i!==2)continue}}if(i===1){ca(e,0),Hn(e,t,0,!0);break}e:{switch(a=e,c=i,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Hn(a,t,St,!_n);break e;case 2:ft=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(i=ji+300-pt(),10<i)){if(Hn(a,t,St,!_n),As(a,0,!0)!==0)break e;pn=t,a.timeoutHandle=C0(If.bind(null,a,n,ft,zi,Kr,t,St,gl,sa,_n,c,"Throttled",-0,0),i);break e}If(a,n,ft,zi,Kr,t,St,gl,sa,_n,c,null,-0,0)}}break}while(!0);Ft(e)}function If(e,t,n,a,i,c,f,x,g,T,A,H,C,k){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:en},Kf(t,c,H);var $=(c&62914560)===c?ji-pt():(c&4194048)===c?$f-pt():0;if($=Cb(H,$),$!==null){pn=c,e.cancelPendingCommit=$(i0.bind(null,e,t,c,n,a,i,f,x,g,A,H,null,C,k)),Hn(e,c,f,!T);return}}i0(e,t,c,n,a,i,f,x,g)}function Kp(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],c=i.getSnapshot;i=i.value;try{if(!yt(c(),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 Hn(e,t,n,a){t&=~Yr,t&=~gl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var i=t;0<i;){var c=31-gt(i),f=1<<c;a[c]=-1,i&=~f}n!==0&&cu(e,n,t)}function Si(){return(he&6)===0?(ss(0),!1):!0}function $r(){if(ie!==null){if(pe===0)var e=ie.return;else e=ie,an=ol=null,ur(e),Wl=null,Ga=0,e=ie;for(;e!==null;)kf(e.alternate,e),e=e.return;ie=null}}function ca(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ub(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),pn=0,$r(),ze=e,ie=n=nn(e.current,null),re=t,pe=0,zt=null,_n=!1,aa=Sa(e,t),Qr=!1,sa=St=Yr=gl=Un=Ae=0,ft=ls=null,Kr=!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),c=1<<i;t|=e[i],a&=~c}return xn=t,Xs(),n}function Pf(e,t){te=null,_.H=Ja,t===Fl||t===Ps?(t=hd(),pe=3):t===Ic?(t=hd(),pe=4):pe=t===Er?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,zt=t,ie===null&&(Ae=1,mi(e,Rt(t,e.current)))}function e0(){var e=jt.current;return e===null?!0:(re&4194048)===re?Ot===null:(re&62914560)===re||(re&536870912)!==0?e===Ot:!1}function t0(){var e=_.H;return _.H=Ja,e===null?Ja:e}function n0(){var e=_.A;return _.A=Qp,e}function wi(){Ae=4,_n||(re&4194048)!==re&&jt.current!==null||(aa=!0),(Un&134217727)===0&&(gl&134217727)===0||ze===null||Hn(ze,re,St,!1)}function Jr(e,t,n){var a=he;he|=2;var i=t0(),c=n0();(ze!==e||re!==t)&&(zi=null,ca(e,t)),t=!1;var f=Ae;e:do try{if(pe!==0&&ie!==null){var x=ie,g=zt;switch(pe){case 8:$r(),f=6;break e;case 3:case 2:case 9:case 6:jt.current===null&&(t=!0);var T=pe;if(pe=0,zt=null,ra(e,x,g,T),n&&aa){f=0;break e}break;default:T=pe,pe=0,zt=null,ra(e,x,g,T)}}Xp(),f=Ae;break}catch(A){Pf(e,A)}while(!0);return t&&e.shellSuspendCounter++,an=ol=null,he=a,_.H=i,_.A=c,ie===null&&(ze=null,re=0,Xs()),f}function Xp(){for(;ie!==null;)l0(ie)}function Vp(e,t){var n=he;he|=2;var a=t0(),i=n0();ze!==e||re!==t?(zi=null,Ni=pt()+500,ca(e,t)):aa=Sa(e,t);e:do try{if(pe!==0&&ie!==null){t=ie;var c=zt;t:switch(pe){case 1:pe=0,zt=null,ra(e,t,c,1);break;case 2:case 9:if(fd(c)){pe=0,zt=null,a0(t);break}t=function(){pe!==2&&pe!==9||ze!==e||(pe=7),Ft(e)},c.then(t,t);break e;case 3:pe=7;break e;case 4:pe=5;break e;case 7:fd(c)?(pe=0,zt=null,a0(t)):(pe=0,zt=null,ra(e,t,c,7));break;case 5:var f=null;switch(ie.tag){case 26:f=ie.memoizedState;case 5:case 27:var x=ie;if(f?Y0(f):x.stateNode.complete){pe=0,zt=null;var g=x.sibling;if(g!==null)ie=g;else{var T=x.return;T!==null?(ie=T,Ei(T)):ie=null}break t}}pe=0,zt=null,ra(e,t,c,5);break;case 6:pe=0,zt=null,ra(e,t,c,6);break;case 8:$r(),Ae=6;break e;default:throw Error(u(462))}}Zp();break}catch(A){Pf(e,A)}while(!0);return an=ol=null,_.H=a,_.A=i,he=n,ie!==null?0:(ze=null,re=0,Xs(),Ae)}function Zp(){for(;ie!==null&&!px();)l0(ie)}function l0(e){var t=Tf(e.alternate,e,xn);e.memoizedProps=e.pendingProps,t===null?Ei(e):ie=t}function a0(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=jf(n,t,t.pendingProps,t.type,void 0,re);break;case 11:t=jf(n,t,t.pendingProps,t.type.render,t.ref,re);break;case 5:ur(t);default:kf(n,t),t=ie=td(t,xn),t=Tf(n,t,xn)}e.memoizedProps=e.pendingProps,t===null?Ei(e):ie=t}function ra(e,t,n,a){an=ol=null,ur(t),Wl=null,Ga=0;var i=t.return;try{if(_p(e,i,t,n,re)){Ae=1,mi(e,Rt(n,e.current)),ie=null;return}}catch(c){if(i!==null)throw ie=i,c;Ae=1,mi(e,Rt(n,e.current)),ie=null;return}t.flags&32768?(ue||a===1?e=!0:aa||(re&536870912)!==0?e=!1:(_n=e=!0,(a===2||a===9||a===3||a===6)&&(a=jt.current,a!==null&&a.tag===13&&(a.flags|=16384))),s0(t,e)):Ei(t)}function Ei(e){var t=e;do{if((t.flags&32768)!==0){s0(t,_n);return}e=t.return;var n=qp(t.alternate,t,xn);if(n!==null){ie=n;return}if(t=t.sibling,t!==null){ie=t;return}ie=t=e}while(t!==null);Ae===0&&(Ae=5)}function s0(e,t){do{var n=Hp(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);Ae=6,ie=null}function i0(e,t,n,a,i,c,f,x,g){e.cancelPendingCommit=null;do Ti();while(Ve!==0);if((he&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=Lc,Ex(e,n,c,f,x,g),e===ze&&(ie=ze=null,re=0),ia=t,qn=e,pn=n,Xr=c,Vr=i,Jf=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Wp(ks,function(){return d0(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=_.T,_.T=null,i=V.p,V.p=2,f=he,he|=4;try{Bp(e,t,n)}finally{he=f,V.p=i,_.T=a}}Ve=1,c0(),r0(),o0()}}function c0(){if(Ve===1){Ve=0;var e=qn,t=ia,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=_.T,_.T=null;var a=V.p;V.p=2;var i=he;he|=4;try{Gf(t,e);var c=co,f=Vu(e.containerInfo),x=c.focusedElem,g=c.selectionRange;if(f!==x&&x&&x.ownerDocument&&Xu(x.ownerDocument.documentElement,x)){if(g!==null&&Mc(x)){var T=g.start,A=g.end;if(A===void 0&&(A=T),"selectionStart"in x)x.selectionStart=T,x.selectionEnd=Math.min(A,x.value.length);else{var H=x.ownerDocument||document,C=H&&H.defaultView||window;if(C.getSelection){var k=C.getSelection(),$=x.textContent.length,I=Math.min(g.start,$),Ne=g.end===void 0?I:Math.min(g.end,$);!k.extend&&I>Ne&&(f=Ne,Ne=I,I=f);var w=Ku(x,I),N=Ku(x,Ne);if(w&&N&&(k.rangeCount!==1||k.anchorNode!==w.node||k.anchorOffset!==w.offset||k.focusNode!==N.node||k.focusOffset!==N.offset)){var E=H.createRange();E.setStart(w.node,w.offset),k.removeAllRanges(),I>Ne?(k.addRange(E),k.extend(N.node,N.offset)):(E.setEnd(N.node,N.offset),k.addRange(E))}}}}for(H=[],k=x;k=k.parentNode;)k.nodeType===1&&H.push({element:k,left:k.scrollLeft,top:k.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<H.length;x++){var U=H[x];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}Hi=!!io,co=io=null}finally{he=i,V.p=a,_.T=n}}e.current=t,Ve=2}}function r0(){if(Ve===2){Ve=0;var e=qn,t=ia,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=_.T,_.T=null;var a=V.p;V.p=2;var i=he;he|=4;try{Uf(e,t.alternate,t)}finally{he=i,V.p=a,_.T=n}}Ve=3}}function o0(){if(Ve===4||Ve===3){Ve=0,bx();var e=qn,t=ia,n=pn,a=Jf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ve=5:(Ve=0,ia=qn=null,u0(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ln=null),mc(n),t=t.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(za,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=_.T,i=V.p,V.p=2,_.T=null;try{for(var c=e.onRecoverableError,f=0;f<a.length;f++){var x=a[f];c(x.value,{componentStack:x.stack})}}finally{_.T=t,V.p=i}}(pn&3)!==0&&Ti(),Ft(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===Zr?as++:(as=0,Zr=e):as=0,ss(0)}}function u0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ha(t)))}function Ti(){return c0(),r0(),o0(),d0()}function d0(){if(Ve!==5)return!1;var e=qn,t=Xr;Xr=0;var n=mc(pn),a=_.T,i=V.p;try{V.p=32>n?32:n,_.T=null,n=Vr,Vr=null;var c=qn,f=pn;if(Ve=0,ia=qn=null,pn=0,(he&6)!==0)throw Error(u(331));var x=he;if(he|=4,Vf(c.current),Yf(c,c.current,f,n),he=x,ss(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(za,c)}catch{}return!0}finally{V.p=i,_.T=a,u0(e,t)}}function f0(e,t,n){t=Rt(n,t),t=wr(e.stateNode,t,2),e=Dn(e,t,2),e!==null&&(wa(e,2),Ft(e))}function be(e,t,n){if(e.tag===3)f0(e,e,n);else for(;t!==null;){if(t.tag===3){f0(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ln===null||!Ln.has(a))){e=Rt(n,e),n=mf(2),a=Dn(t,n,2),a!==null&&(hf(n,a,t,e),wa(a,2),Ft(a));break}}t=t.return}}function Fr(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Yp;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)||(Qr=!0,i.add(n),e=$p.bind(null,e,t,n),t.then(e,e))}function $p(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&&(Ae===4||Ae===3&&(re&62914560)===re&&300>pt()-ji?(he&2)===0&&ca(e,0):Yr|=n,sa===re&&(sa=0)),Ft(e)}function m0(e,t){t===0&&(t=iu()),e=il(e,t),e!==null&&(wa(e,t),Ft(e))}function Jp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),m0(e,n)}function Fp(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),m0(e,n)}function Wp(e,t){return oc(e,t)}var Ci=null,oa=null,Wr=!1,ki=!1,Ir=!1,Bn=0;function Ft(e){e!==oa&&e.next===null&&(oa===null?Ci=oa=e:oa=oa.next=e),ki=!0,Wr||(Wr=!0,Pp())}function ss(e,t){if(!Ir&&ki){Ir=!0;do for(var n=!1,a=Ci;a!==null;){if(e!==0){var i=a.pendingLanes;if(i===0)var c=0;else{var f=a.suspendedLanes,x=a.pingedLanes;c=(1<<31-gt(42|e)+1)-1,c&=i&~(f&~x),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,b0(a,c))}else c=re,c=As(a,a===ze?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||Sa(a,c)||(n=!0,b0(a,c));a=a.next}while(n);Ir=!1}}function Ip(){h0()}function h0(){ki=Wr=!1;var e=0;Bn!==0&&ob()&&(e=Bn);for(var t=pt(),n=null,a=Ci;a!==null;){var i=a.next,c=x0(a,t);c===0?(a.next=null,n===null?Ci=i:n.next=i,i===null&&(oa=n)):(n=a,(e!==0||(c&3)!==0)&&(ki=!0)),a=i}Ve!==0&&Ve!==5||ss(e),Bn!==0&&(Bn=0)}function x0(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var f=31-gt(c),x=1<<f,g=i[f];g===-1?((x&n)===0||(x&a)!==0)&&(i[f]=wx(x,t)):g<=t&&(e.expiredLanes|=x),c&=~x}if(t=ze,n=re,n=As(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&&uc(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Sa(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&uc(a),mc(n)){case 2:case 8:n=au;break;case 32:n=ks;break;case 268435456:n=su;break;default:n=ks}return a=p0.bind(null,e),n=oc(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&uc(a),e.callbackPriority=2,e.callbackNode=null,2}function p0(e,t){if(Ve!==0&&Ve!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ti()&&e.callbackNode!==n)return null;var a=re;return a=As(e,e===ze?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Wf(e,a,t),x0(e,pt()),e.callbackNode!=null&&e.callbackNode===n?p0.bind(null,e):null)}function b0(e,t){if(Ti())return null;Wf(e,t,!0)}function Pp(){db(function(){(he&6)!==0?oc(lu,Ip):h0()})}function Pr(){if(Bn===0){var e=$l;e===0&&(e=Rs,Rs<<=1,(Rs&261888)===0&&(Rs=256)),Bn=e}return Bn}function g0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ls(""+e)}function y0(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 eb(e,t,n,a,i){if(t==="submit"&&n&&n.stateNode===i){var c=g0((i[ct]||null).action),f=a.submitter;f&&(t=(t=f[ct]||null)?g0(t.formAction):f.getAttribute("formAction"),t!==null&&(c=t,f=null));var x=new Gs("action","action",null,a,i);e.push({event:x,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Bn!==0){var g=f?y0(i,f):new FormData(i);yr(n,{pending:!0,data:g,method:i.method,action:c},null,g)}}else typeof c=="function"&&(x.preventDefault(),g=f?y0(i,f):new FormData(i),yr(n,{pending:!0,data:g,method:i.method,action:c},c,g))},currentTarget:i}]})}}for(var eo=0;eo<Uc.length;eo++){var to=Uc[eo],tb=to.toLowerCase(),nb=to[0].toUpperCase()+to.slice(1);Ht(tb,"on"+nb)}Ht(Ju,"onAnimationEnd"),Ht(Fu,"onAnimationIteration"),Ht(Wu,"onAnimationStart"),Ht("dblclick","onDoubleClick"),Ht("focusin","onFocus"),Ht("focusout","onBlur"),Ht(gp,"onTransitionRun"),Ht(yp,"onTransitionStart"),Ht(vp,"onTransitionCancel"),Ht(Iu,"onTransitionEnd"),Ol("onMouseEnter",["mouseout","mouseover"]),Ol("onMouseLeave",["mouseout","mouseover"]),Ol("onPointerEnter",["pointerout","pointerover"]),Ol("onPointerLeave",["pointerout","pointerover"]),nl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nl("onBeforeInput",["compositionend","keypress","textInput","paste"]),nl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var is="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(" "),lb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(is));function v0(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 c=void 0;if(t)for(var f=a.length-1;0<=f;f--){var x=a[f],g=x.instance,T=x.currentTarget;if(x=x.listener,g!==c&&i.isPropagationStopped())break e;c=x,i.currentTarget=T;try{c(i)}catch(A){Ks(A)}i.currentTarget=null,c=g}else for(f=0;f<a.length;f++){if(x=a[f],g=x.instance,T=x.currentTarget,x=x.listener,g!==c&&i.isPropagationStopped())break e;c=x,i.currentTarget=T;try{c(i)}catch(A){Ks(A)}i.currentTarget=null,c=g}}}}function ce(e,t){var n=t[hc];n===void 0&&(n=t[hc]=new Set);var a=e+"__bubble";n.has(a)||(j0(t,e,2,!1),n.add(a))}function no(e,t,n){var a=0;t&&(a|=4),j0(n,e,a,t)}var Ri="_reactListening"+Math.random().toString(36).slice(2);function lo(e){if(!e[Ri]){e[Ri]=!0,mu.forEach(function(n){n!=="selectionchange"&&(lb.has(n)||no(n,!1,e),no(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ri]||(t[Ri]=!0,no("selectionchange",!1,t))}}function j0(e,t,n,a){switch(F0(t)){case 2:var i=Db;break;case 8:i=Mb;break;default:i=yo}n=i.bind(null,t,n,e),i=void 0,!zc||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 ao(e,t,n,a,i){var c=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 x=a.stateNode.containerInfo;if(x===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(;x!==null;){if(f=Dl(x),f===null)return;if(g=f.tag,g===5||g===6||g===26||g===27){a=c=f;continue e}x=x.parentNode}}a=a.return}wu(function(){var T=c,A=jc(n),H=[];e:{var C=Pu.get(e);if(C!==void 0){var k=Gs,$=e;switch(e){case"keypress":if(Hs(n)===0)break e;case"keydown":case"keyup":k=Fx;break;case"focusin":$="focus",k=Tc;break;case"focusout":$="blur",k=Tc;break;case"beforeblur":case"afterblur":k=Tc;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":k=Cu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":k=qx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":k=Px;break;case Ju:case Fu:case Wu:k=Gx;break;case Iu:k=tp;break;case"scroll":case"scrollend":k=Ux;break;case"wheel":k=lp;break;case"copy":case"cut":case"paste":k=Yx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":k=Ru;break;case"toggle":case"beforetoggle":k=sp}var I=(t&4)!==0,Ne=!I&&(e==="scroll"||e==="scrollend"),w=I?C!==null?C+"Capture":null:C;I=[];for(var N=T,E;N!==null;){var U=N;if(E=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||E===null||w===null||(U=Ca(N,w),U!=null&&I.push(cs(N,U,E))),Ne)break;N=N.return}0<I.length&&(C=new k(C,$,null,n,A),H.push({event:C,listeners:I}))}}if((t&7)===0){e:{if(C=e==="mouseover"||e==="pointerover",k=e==="mouseout"||e==="pointerout",C&&n!==vc&&($=n.relatedTarget||n.fromElement)&&(Dl($)||$[Rl]))break e;if((k||C)&&(C=A.window===A?A:(C=A.ownerDocument)?C.defaultView||C.parentWindow:window,k?($=n.relatedTarget||n.toElement,k=T,$=$?Dl($):null,$!==null&&(Ne=m($),I=$.tag,$!==Ne||I!==5&&I!==27&&I!==6)&&($=null)):(k=null,$=T),k!==$)){if(I=Cu,U="onMouseLeave",w="onMouseEnter",N="mouse",(e==="pointerout"||e==="pointerover")&&(I=Ru,U="onPointerLeave",w="onPointerEnter",N="pointer"),Ne=k==null?C:Ta(k),E=$==null?C:Ta($),C=new I(U,N+"leave",k,n,A),C.target=Ne,C.relatedTarget=E,U=null,Dl(A)===T&&(I=new I(w,N+"enter",$,n,A),I.target=E,I.relatedTarget=Ne,U=I),Ne=U,k&&$)t:{for(I=ab,w=k,N=$,E=0,U=w;U;U=I(U))E++;U=0;for(var W=N;W;W=I(W))U++;for(;0<E-U;)w=I(w),E--;for(;0<U-E;)N=I(N),U--;for(;E--;){if(w===N||N!==null&&w===N.alternate){I=w;break t}w=I(w),N=I(N)}I=null}else I=null;k!==null&&N0(H,C,k,I,!1),$!==null&&Ne!==null&&N0(H,Ne,$,I,!0)}}e:{if(C=T?Ta(T):window,k=C.nodeName&&C.nodeName.toLowerCase(),k==="select"||k==="input"&&C.type==="file")var de=qu;else if(Uu(C))if(Hu)de=xp;else{de=mp;var J=fp}else k=C.nodeName,!k||k.toLowerCase()!=="input"||C.type!=="checkbox"&&C.type!=="radio"?T&&yc(T.elementType)&&(de=qu):de=hp;if(de&&(de=de(e,T))){Lu(H,de,n,A);break e}J&&J(e,C,T),e==="focusout"&&T&&C.type==="number"&&T.memoizedProps.value!=null&&gc(C,"number",C.value)}switch(J=T?Ta(T):window,e){case"focusin":(Uu(J)||J.contentEditable==="true")&&(Bl=J,Ac=T,Ua=null);break;case"focusout":Ua=Ac=Bl=null;break;case"mousedown":Oc=!0;break;case"contextmenu":case"mouseup":case"dragend":Oc=!1,Zu(H,n,A);break;case"selectionchange":if(bp)break;case"keydown":case"keyup":Zu(H,n,A)}var ne;if(kc)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 Hl?Ou(e,n)&&(oe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(oe="onCompositionStart");oe&&(Du&&n.locale!=="ko"&&(Hl||oe!=="onCompositionStart"?oe==="onCompositionEnd"&&Hl&&(ne=Eu()):(Sn=A,Sc="value"in Sn?Sn.value:Sn.textContent,Hl=!0)),J=Di(T,oe),0<J.length&&(oe=new ku(oe,e,null,n,A),H.push({event:oe,listeners:J}),ne?oe.data=ne:(ne=_u(n),ne!==null&&(oe.data=ne)))),(ne=cp?rp(e,n):op(e,n))&&(oe=Di(T,"onBeforeInput"),0<oe.length&&(J=new ku("onBeforeInput","beforeinput",null,n,A),H.push({event:J,listeners:oe}),J.data=ne)),eb(H,e,T,n,A)}v0(H,t)})}function cs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Di(e,t){for(var n=t+"Capture",a=[];e!==null;){var i=e,c=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||c===null||(i=Ca(e,n),i!=null&&a.unshift(cs(e,i,c)),i=Ca(e,t),i!=null&&a.push(cs(e,i,c))),e.tag===3)return a;e=e.return}return[]}function ab(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function N0(e,t,n,a,i){for(var c=t._reactName,f=[];n!==null&&n!==a;){var x=n,g=x.alternate,T=x.stateNode;if(x=x.tag,g!==null&&g===a)break;x!==5&&x!==26&&x!==27||T===null||(g=T,i?(T=Ca(n,c),T!=null&&f.unshift(cs(n,T,g))):i||(T=Ca(n,c),T!=null&&f.push(cs(n,T,g)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var sb=/\r\n?/g,ib=/\u0000|\uFFFD/g;function z0(e){return(typeof e=="string"?e:""+e).replace(sb,`
|
|
25
|
+
`).replace(ib,"")}function S0(e,t){return t=z0(t),z0(e)===t}function je(e,t,n,a,i,c){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ul(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ul(e,""+a);break;case"className":_s(e,"class",a);break;case"tabIndex":_s(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":_s(e,n,a);break;case"style":zu(e,a,c);break;case"data":if(t!=="object"){_s(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=Ls(""+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 c=="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=Ls(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=en);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=Ls(""+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),Os(e,"popover",a);break;case"xlinkActuate":Pt(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Pt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Pt(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Pt(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Pt(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Pt(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Pt(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Pt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Pt(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Os(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=Ox.get(n)||n,Os(e,n,a))}}function so(e,t,n,a,i,c){switch(n){case"style":zu(e,a,c);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"?Ul(e,a):(typeof a=="number"||typeof a=="bigint")&&Ul(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=en);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hu.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),c=e[ct]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,i),typeof a=="function")){typeof c!="function"&&c!==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,""):Os(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,c;for(c in n)if(n.hasOwnProperty(c)){var f=n[c];if(f!=null)switch(c){case"src":a=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:je(e,t,c,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 x=c=f=i=null,g=null,T=null;for(a in n)if(n.hasOwnProperty(a)){var A=n[a];if(A!=null)switch(a){case"name":i=A;break;case"type":f=A;break;case"checked":g=A;break;case"defaultChecked":T=A;break;case"value":c=A;break;case"defaultValue":x=A;break;case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(u(137,t));break;default:je(e,t,a,A,n,null)}}yu(e,c,x,g,T,f,i,!1);return;case"select":ce("invalid",e),a=f=c=null;for(i in n)if(n.hasOwnProperty(i)&&(x=n[i],x!=null))switch(i){case"value":c=x;break;case"defaultValue":f=x;break;case"multiple":a=x;default:je(e,t,i,x,n,null)}t=c,n=f,e.multiple=!!a,t!=null?_l(e,!!a,t,!1):n!=null&&_l(e,!!a,n,!0);return;case"textarea":ce("invalid",e),c=i=a=null;for(f in n)if(n.hasOwnProperty(f)&&(x=n[f],x!=null))switch(f){case"value":a=x;break;case"defaultValue":i=x;break;case"children":c=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(u(91));break;default:je(e,t,f,x,n,null)}ju(e,a,i,c);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<is.length;a++)ce(is[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(T in n)if(n.hasOwnProperty(T)&&(a=n[T],a!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:je(e,t,T,a,n,null)}return;default:if(yc(t)){for(A in n)n.hasOwnProperty(A)&&(a=n[A],a!==void 0&&so(e,t,A,a,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(a=n[x],a!=null&&je(e,t,x,a,n,null))}function cb(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,c=null,f=null,x=null,g=null,T=null,A=null;for(k in n){var H=n[k];if(n.hasOwnProperty(k)&&H!=null)switch(k){case"checked":break;case"value":break;case"defaultValue":g=H;default:a.hasOwnProperty(k)||je(e,t,k,null,a,H)}}for(var C in a){var k=a[C];if(H=n[C],a.hasOwnProperty(C)&&(k!=null||H!=null))switch(C){case"type":c=k;break;case"name":i=k;break;case"checked":T=k;break;case"defaultChecked":A=k;break;case"value":f=k;break;case"defaultValue":x=k;break;case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(u(137,t));break;default:k!==H&&je(e,t,C,k,a,H)}}bc(e,f,x,g,T,A,c,i);return;case"select":k=f=x=C=null;for(c in n)if(g=n[c],n.hasOwnProperty(c)&&g!=null)switch(c){case"value":break;case"multiple":k=g;default:a.hasOwnProperty(c)||je(e,t,c,null,a,g)}for(i in a)if(c=a[i],g=n[i],a.hasOwnProperty(i)&&(c!=null||g!=null))switch(i){case"value":C=c;break;case"defaultValue":x=c;break;case"multiple":f=c;default:c!==g&&je(e,t,i,c,a,g)}t=x,n=f,a=k,C!=null?_l(e,!!n,C,!1):!!a!=!!n&&(t!=null?_l(e,!!n,t,!0):_l(e,!!n,n?[]:"",!1));return;case"textarea":k=C=null;for(x in n)if(i=n[x],n.hasOwnProperty(x)&&i!=null&&!a.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:je(e,t,x,null,a,i)}for(f in a)if(i=a[f],c=n[f],a.hasOwnProperty(f)&&(i!=null||c!=null))switch(f){case"value":C=i;break;case"defaultValue":k=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(u(91));break;default:i!==c&&je(e,t,f,i,a,c)}vu(e,C,k);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],k=n[g],a.hasOwnProperty(g)&&C!==k&&(C!=null||k!=null))switch(g){case"selected":e.selected=C&&typeof C!="function"&&typeof C!="symbol";break;default:je(e,t,g,C,a,k)}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(T in a)if(C=a[T],k=n[T],a.hasOwnProperty(T)&&C!==k&&(C!=null||k!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(u(137,t));break;default:je(e,t,T,C,a,k)}return;default:if(yc(t)){for(var Ne in n)C=n[Ne],n.hasOwnProperty(Ne)&&C!==void 0&&!a.hasOwnProperty(Ne)&&so(e,t,Ne,void 0,a,C);for(A in a)C=a[A],k=n[A],!a.hasOwnProperty(A)||C===k||C===void 0&&k===void 0||so(e,t,A,C,a,k);return}}for(var w in n)C=n[w],n.hasOwnProperty(w)&&C!=null&&!a.hasOwnProperty(w)&&je(e,t,w,null,a,C);for(H in a)C=a[H],k=n[H],!a.hasOwnProperty(H)||C===k||C==null&&k==null||je(e,t,H,C,a,k)}function w0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rb(){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],c=i.transferSize,f=i.initiatorType,x=i.duration;if(c&&x&&w0(f)){for(f=0,x=i.responseEnd,a+=1;a<n.length;a++){var g=n[a],T=g.startTime;if(T>x)break;var A=g.transferSize,H=g.initiatorType;A&&w0(H)&&(g=g.responseEnd,f+=A*(g<x?1:(x-T)/(g-T)))}if(--a,t+=8*(c+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 io=null,co=null;function Mi(e){return e.nodeType===9?e:e.ownerDocument}function E0(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 T0(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 ro(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 oo=null;function ob(){var e=window.event;return e&&e.type==="popstate"?e===oo?!1:(oo=e,!0):(oo=null,!1)}var C0=typeof setTimeout=="function"?setTimeout:void 0,ub=typeof clearTimeout=="function"?clearTimeout:void 0,k0=typeof Promise=="function"?Promise:void 0,db=typeof queueMicrotask=="function"?queueMicrotask:typeof k0<"u"?function(e){return k0.resolve(null).then(e).catch(fb)}:C0;function fb(e){setTimeout(function(){throw e})}function Gn(e){return e==="head"}function R0(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),ma(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")rs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,rs(n);for(var c=n.firstChild;c;){var f=c.nextSibling,x=c.nodeName;c[Ea]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=f}}else n==="body"&&rs(e.ownerDocument.body);n=i}while(n);ma(t)}function D0(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 uo(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":uo(n),xc(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function mb(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[Ea])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==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(c=e.getAttribute("src"),(c!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=_t(e.nextSibling),e===null)break}return null}function hb(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 M0(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 fo(e){return e.data==="$?"||e.data==="$~"}function mo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function xb(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 ho=null;function A0(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 O0(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 _0(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 rs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xc(e)}var Ut=new Map,U0=new Set;function Ai(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bn=V.d;V.d={f:pb,r:bb,D:gb,C:yb,L:vb,m:jb,X:zb,S:Nb,M:Sb};function pb(){var e=bn.f(),t=Si();return e||t}function bb(e){var t=Ml(e);t!==null&&t.tag===5&&t.type==="form"?Id(t):bn.r(e)}var ua=typeof document>"u"?null:document;function L0(e,t,n){var a=ua;if(a&&typeof t=="string"&&t){var i=Ct(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),U0.has(i)||(U0.add(i),e={rel:e,crossOrigin:n,href:t},a.querySelector(i)===null&&(t=a.createElement("link"),tt(t,"link",e),$e(t),a.head.appendChild(t)))}}function gb(e){bn.D(e),L0("dns-prefetch",e,null)}function yb(e,t){bn.C(e,t),L0("preconnect",e,t)}function vb(e,t,n){bn.L(e,t,n);var a=ua;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 c=i;switch(t){case"style":c=da(e);break;case"script":c=fa(e)}Ut.has(c)||(e=y({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ut.set(c,e),a.querySelector(i)!==null||t==="style"&&a.querySelector(os(c))||t==="script"&&a.querySelector(us(c))||(t=a.createElement("link"),tt(t,"link",e),$e(t),a.head.appendChild(t)))}}function jb(e,t){bn.m(e,t);var n=ua;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Ct(a)+'"][href="'+Ct(e)+'"]',c=i;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=fa(e)}if(!Ut.has(c)&&(e=y({rel:"modulepreload",href:e},t),Ut.set(c,e),n.querySelector(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(us(c)))return}a=n.createElement("link"),tt(a,"link",e),$e(a),n.head.appendChild(a)}}}function Nb(e,t,n){bn.S(e,t,n);var a=ua;if(a&&e){var i=Al(a).hoistableStyles,c=da(e);t=t||"default";var f=i.get(c);if(!f){var x={loading:0,preload:null};if(f=a.querySelector(os(c)))x.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ut.get(c))&&xo(e,n);var g=f=a.createElement("link");$e(g),tt(g,"link",e),g._p=new Promise(function(T,A){g.onload=T,g.onerror=A}),g.addEventListener("load",function(){x.loading|=1}),g.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Oi(f,t,a)}f={type:"stylesheet",instance:f,count:1,state:x},i.set(c,f)}}}function zb(e,t){bn.X(e,t);var n=ua;if(n&&e){var a=Al(n).hoistableScripts,i=fa(e),c=a.get(i);c||(c=n.querySelector(us(i)),c||(e=y({src:e,async:!0},t),(t=Ut.get(i))&&po(e,t),c=n.createElement("script"),$e(c),tt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(i,c))}}function Sb(e,t){bn.M(e,t);var n=ua;if(n&&e){var a=Al(n).hoistableScripts,i=fa(e),c=a.get(i);c||(c=n.querySelector(us(i)),c||(e=y({src:e,async:!0,type:"module"},t),(t=Ut.get(i))&&po(e,t),c=n.createElement("script"),$e(c),tt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(i,c))}}function q0(e,t,n,a){var i=(i=jn.current)?Ai(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=da(n.href),n=Al(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=da(n.href);var c=Al(i).hoistableStyles,f=c.get(e);if(f||(i=i.ownerDocument||i,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=i.querySelector(os(e)))&&!c._p&&(f.instance=c,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),c||wb(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=fa(n),n=Al(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 da(e){return'href="'+Ct(e)+'"'}function os(e){return'link[rel="stylesheet"]['+e+"]"}function H0(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function wb(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),$e(t),e.head.appendChild(t))}function fa(e){return'[src="'+Ct(e)+'"]'}function us(e){return"script[async]"+e}function B0(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,$e(a),a;var i=y({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),$e(a),tt(a,"style",i),Oi(a,n.precedence,e),t.instance=a;case"stylesheet":i=da(n.href);var c=e.querySelector(os(i));if(c)return t.state.loading|=4,t.instance=c,$e(c),c;a=H0(n),(i=Ut.get(i))&&xo(a,i),c=(e.ownerDocument||e).createElement("link"),$e(c);var f=c;return f._p=new Promise(function(x,g){f.onload=x,f.onerror=g}),tt(c,"link",a),t.state.loading|=4,Oi(c,n.precedence,e),t.instance=c;case"script":return c=fa(n.src),(i=e.querySelector(us(c)))?(t.instance=i,$e(i),i):(a=n,(i=Ut.get(c))&&(a=y({},n),po(a,i)),e=e.ownerDocument||e,i=e.createElement("script"),$e(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,Oi(a,n.precedence,e));return t.instance}function Oi(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=a.length?a[a.length-1]:null,c=i,f=0;f<a.length;f++){var x=a[f];if(x.dataset.precedence===t)c=x;else if(c!==i)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function xo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function po(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var _i=null;function G0(e,t,n){if(_i===null){var a=new Map,i=_i=new Map;i.set(n,a)}else i=_i,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 c=n[i];if(!(c[Ea]||c[We]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var f=c.getAttribute(t)||"";f=e+f;var x=a.get(f);x?x.push(c):a.set(f,[c])}}return a}function Q0(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Eb(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 Y0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Tb(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=da(a.href),c=t.querySelector(os(i));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ui.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,$e(c);return}c=t.ownerDocument||t,a=H0(a),(i=Ut.get(i))&&xo(a,i),c=c.createElement("link"),$e(c);var f=c;f._p=new Promise(function(x,g){f.onload=x,f.onerror=g}),tt(c,"link",a),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ui.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var bo=0;function Cb(e,t){return e.stylesheets&&e.count===0&&qi(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&qi(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&bo===0&&(bo=62500*rb());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&qi(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>bo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(i)}}:null}function Ui(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Li=null;function qi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Li=new Map,t.forEach(kb,e),Li=null,Ui.call(e))}function kb(e,t){if(!(t.state.loading&4)){var n=Li.get(e);if(n)var a=n.get(null);else{n=new Map,Li.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<i.length;c++){var f=i[c];(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"),c=n.get(f)||a,c===a&&n.set(null,i),n.set(f,i),this.count++,a=Ui.bind(this),i.addEventListener("load",a),i.addEventListener("error",a),c?c.parentNode.insertBefore(i,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ds={$$typeof:G,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function Rb(e,t,n,a,i,c,f,x,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=dc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dc(0),this.hiddenUpdates=dc(null),this.identifierPrefix=a,this.onUncaughtError=i,this.onCaughtError=c,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function K0(e,t,n,a,i,c,f,x,g,T,A,H){return e=new Rb(e,t,n,f,g,T,A,H,x),t=1,c===!0&&(t|=24),c=vt(3,null,null,t),e.current=c,c.stateNode=e,t=Jc(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:a,isDehydrated:n,cache:t},Pc(c),e}function X0(e){return e?(e=Yl,e):Yl}function V0(e,t,n,a,i,c){i=X0(i),a.context===null?a.context=i:a.pendingContext=i,a=Rn(t),a.payload={element:n},c=c===void 0?null:c,c!==null&&(a.callback=c),n=Dn(e,a,t),n!==null&&(mt(n,e,t),Ya(n,e,t))}function Z0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function go(e,t){Z0(e,t),(e=e.alternate)&&Z0(e,t)}function $0(e){if(e.tag===13||e.tag===31){var t=il(e,67108864);t!==null&&mt(t,e,67108864),go(e,67108864)}}function J0(e){if(e.tag===13||e.tag===31){var t=wt();t=fc(t);var n=il(e,t);n!==null&&mt(n,e,t),go(e,t)}}var Hi=!0;function Db(e,t,n,a){var i=_.T;_.T=null;var c=V.p;try{V.p=2,yo(e,t,n,a)}finally{V.p=c,_.T=i}}function Mb(e,t,n,a){var i=_.T;_.T=null;var c=V.p;try{V.p=8,yo(e,t,n,a)}finally{V.p=c,_.T=i}}function yo(e,t,n,a){if(Hi){var i=vo(a);if(i===null)ao(e,t,a,Bi,n),W0(e,a);else if(Ob(i,e,t,n,a))a.stopPropagation();else if(W0(e,a),t&4&&-1<Ab.indexOf(e)){for(;i!==null;){var c=Ml(i);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=tl(c.pendingLanes);if(f!==0){var x=c;for(x.pendingLanes|=2,x.entangledLanes|=2;f;){var g=1<<31-gt(f);x.entanglements[1]|=g,f&=~g}Ft(c),(he&6)===0&&(Ni=pt()+500,ss(0))}}break;case 31:case 13:x=il(c,2),x!==null&&mt(x,c,2),Si(),go(c,2)}if(c=vo(a),c===null&&ao(e,t,a,Bi,n),c===i)break;i=c}i!==null&&a.stopPropagation()}else ao(e,t,a,null,n)}}function vo(e){return e=jc(e),jo(e)}var Bi=null;function jo(e){if(Bi=null,e=Dl(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=p(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 Bi=e,null}function F0(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(gx()){case lu:return 2;case au:return 8;case ks:case yx:return 32;case su:return 268435456;default:return 32}default:return 32}}var No=!1,Qn=null,Yn=null,Kn=null,fs=new Map,ms=new Map,Xn=[],Ab="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 W0(e,t){switch(e){case"focusin":case"focusout":Qn=null;break;case"dragenter":case"dragleave":Yn=null;break;case"mouseover":case"mouseout":Kn=null;break;case"pointerover":case"pointerout":fs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ms.delete(t.pointerId)}}function hs(e,t,n,a,i,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:c,targetContainers:[i]},t!==null&&(t=Ml(t),t!==null&&$0(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ob(e,t,n,a,i){switch(t){case"focusin":return Qn=hs(Qn,e,t,n,a,i),!0;case"dragenter":return Yn=hs(Yn,e,t,n,a,i),!0;case"mouseover":return Kn=hs(Kn,e,t,n,a,i),!0;case"pointerover":var c=i.pointerId;return fs.set(c,hs(fs.get(c)||null,e,t,n,a,i)),!0;case"gotpointercapture":return c=i.pointerId,ms.set(c,hs(ms.get(c)||null,e,t,n,a,i)),!0}return!1}function I0(e){var t=Dl(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,du(e.priority,function(){J0(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,du(e.priority,function(){J0(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 Gi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vo(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);vc=a,n.target.dispatchEvent(a),vc=null}else return t=Ml(n),t!==null&&$0(t),e.blockedOn=n,!1;t.shift()}return!0}function P0(e,t,n){Gi(e)&&n.delete(t)}function _b(){No=!1,Qn!==null&&Gi(Qn)&&(Qn=null),Yn!==null&&Gi(Yn)&&(Yn=null),Kn!==null&&Gi(Kn)&&(Kn=null),fs.forEach(P0),ms.forEach(P0)}function Qi(e,t){e.blockedOn===t&&(e.blockedOn=null,No||(No=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,_b)))}var Yi=null;function em(e){Yi!==e&&(Yi=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Yi===e&&(Yi=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(jo(a||n)===null)continue;break}var c=Ml(n);c!==null&&(e.splice(t,3),t-=3,yr(c,{pending:!0,data:i,method:n.method,action:a},a,i))}}))}function ma(e){function t(g){return Qi(g,e)}Qn!==null&&Qi(Qn,e),Yn!==null&&Qi(Yn,e),Kn!==null&&Qi(Kn,e),fs.forEach(t),ms.forEach(t);for(var n=0;n<Xn.length;n++){var a=Xn[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Xn.length&&(n=Xn[0],n.blockedOn===null);)I0(n),n.blockedOn===null&&Xn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var i=n[a],c=n[a+1],f=i[ct]||null;if(typeof c=="function")f||em(n);else if(f){var x=null;if(c&&c.hasAttribute("formAction")){if(i=c,f=c[ct]||null)x=f.formAction;else if(jo(i)!==null)continue}else x=f.action;typeof x=="function"?n[a+1]=x:(n.splice(a,3),a-=3),em(n)}}}function tm(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.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 c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.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 zo(e){this._internalRoot=e}Ki.prototype.render=zo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,a=wt();V0(n,a,e,t,null,null)},Ki.prototype.unmount=zo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;V0(e.current,2,null,e,null,null),Si(),t[Rl]=null}};function Ki(e){this._internalRoot=e}Ki.prototype.unstable_scheduleHydration=function(e){if(e){var t=uu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Xn.length&&t!==0&&t<Xn[n].priority;n++);Xn.splice(n,0,e),n===0&&I0(e)}};var nm=r.version;if(nm!=="19.2.4")throw Error(u(527,nm,"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=z(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Ub={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xi.isDisabled&&Xi.supportsFiber)try{za=Xi.inject(Ub),bt=Xi}catch{}}return xs.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,a="",i=of,c=uf,f=df;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&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=K0(e,1,!1,null,null,n,a,null,i,c,f,tm),e[Rl]=t.current,lo(e),new zo(t)},xs.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var a=!1,i="",c=of,f=uf,x=df,g=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError),n.formState!==void 0&&(g=n.formState)),t=K0(e,1,!0,t,n??null,a,i,g,c,f,x,tm),t.context=X0(null),n=t.current,a=wt(),a=fc(a),i=Rn(a),i.callback=null,Dn(n,i,a),n=a,t.current.lanes=n,wa(t,n),Ft(t),e[Rl]=t.current,lo(e),new Ki(t)},xs.version="19.2.4",xs}var dm;function Bg(){if(dm)return Eo.exports;dm=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(r){console.error(r)}}return s(),Eo.exports=Hg(),Eo.exports}var Gg=Bg();function Qg({className:s,title:r="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":r,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 $o="-",Yg=s=>{const r=Xg(s),{conflictingClassGroups:o,conflictingClassGroupModifiers:u}=s;return{getClassGroupId:h=>{const p=h.split($o);return p[0]===""&&p.length!==1&&p.shift(),nh(p,r)||Kg(h)},getConflictingClassGroupIds:(h,p)=>{const b=o[h]||[];return p&&u[h]?[...b,...u[h]]:b}}},nh=(s,r)=>{var h;if(s.length===0)return r.classGroupId;const o=s[0],u=r.nextPart.get(o),d=u?nh(s.slice(1),u):void 0;if(d)return d;if(r.validators.length===0)return;const m=s.join($o);return(h=r.validators.find(({validator:p})=>p(m)))==null?void 0:h.classGroupId},fm=/^\[(.+)\]$/,Kg=s=>{if(fm.test(s)){const r=fm.exec(s)[1],o=r==null?void 0:r.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},Xg=s=>{const{theme:r,prefix:o}=s,u={nextPart:new Map,validators:[]};return Zg(Object.entries(s.classGroups),o).forEach(([m,h])=>{Uo(h,u,m,r)}),u},Uo=(s,r,o,u)=>{s.forEach(d=>{if(typeof d=="string"){const m=d===""?r:mm(r,d);m.classGroupId=o;return}if(typeof d=="function"){if(Vg(d)){Uo(d(u),r,o,u);return}r.validators.push({validator:d,classGroupId:o});return}Object.entries(d).forEach(([m,h])=>{Uo(h,mm(r,m),o,u)})})},mm=(s,r)=>{let o=s;return r.split($o).forEach(u=>{o.nextPart.has(u)||o.nextPart.set(u,{nextPart:new Map,validators:[]}),o=o.nextPart.get(u)}),o},Vg=s=>s.isThemeGetter,Zg=(s,r)=>r?s.map(([o,u])=>{const d=u.map(m=>typeof m=="string"?r+m:typeof m=="object"?Object.fromEntries(Object.entries(m).map(([h,p])=>[r+h,p])):m);return[o,d]}):s,$g=s=>{if(s<1)return{get:()=>{},set:()=>{}};let r=0,o=new Map,u=new Map;const d=(m,h)=>{o.set(m,h),r++,r>s&&(r=0,u=o,o=new Map)};return{get(m){let h=o.get(m);if(h!==void 0)return h;if((h=u.get(m))!==void 0)return d(m,h),h},set(m,h){o.has(m)?o.set(m,h):d(m,h)}}},lh="!",Jg=s=>{const{separator:r,experimentalParseClassName:o}=s,u=r.length===1,d=r[0],m=r.length,h=p=>{const b=[];let z=0,v=0,y;for(let O=0;O<p.length;O++){let Y=p[O];if(z===0){if(Y===d&&(u||p.slice(O,O+m)===r)){b.push(p.slice(v,O)),v=O+m;continue}if(Y==="/"){y=O;continue}}Y==="["?z++:Y==="]"&&z--}const j=b.length===0?p:p.substring(v),S=j.startsWith(lh),D=S?j.substring(1):j,q=y&&y>v?y-v:void 0;return{modifiers:b,hasImportantModifier:S,baseClassName:D,maybePostfixModifierPosition:q}};return o?p=>o({className:p,parseClassName:h}):h},Fg=s=>{if(s.length<=1)return s;const r=[];let o=[];return s.forEach(u=>{u[0]==="["?(r.push(...o.sort(),u),o=[]):o.push(u)}),r.push(...o.sort()),r},Wg=s=>({cache:$g(s.cacheSize),parseClassName:Jg(s),...Yg(s)}),Ig=/\s+/,Pg=(s,r)=>{const{parseClassName:o,getClassGroupId:u,getConflictingClassGroupIds:d}=r,m=[],h=s.trim().split(Ig);let p="";for(let b=h.length-1;b>=0;b-=1){const z=h[b],{modifiers:v,hasImportantModifier:y,baseClassName:j,maybePostfixModifierPosition:S}=o(z);let D=!!S,q=u(D?j.substring(0,S):j);if(!q){if(!D){p=z+(p.length>0?" "+p:p);continue}if(q=u(j),!q){p=z+(p.length>0?" "+p:p);continue}D=!1}const O=Fg(v).join(":"),Y=y?O+lh:O,M=Y+q;if(m.includes(M))continue;m.push(M);const G=d(q,D);for(let B=0;B<G.length;++B){const X=G[B];m.push(Y+X)}p=z+(p.length>0?" "+p:p)}return p};function ey(){let s=0,r,o,u="";for(;s<arguments.length;)(r=arguments[s++])&&(o=ah(r))&&(u&&(u+=" "),u+=o);return u}const ah=s=>{if(typeof s=="string")return s;let r,o="";for(let u=0;u<s.length;u++)s[u]&&(r=ah(s[u]))&&(o&&(o+=" "),o+=r);return o};function ty(s,...r){let o,u,d,m=h;function h(b){const z=r.reduce((v,y)=>y(v),s());return o=Wg(z),u=o.cache.get,d=o.cache.set,m=p,p(b)}function p(b){const z=u(b);if(z)return z;const v=Pg(b,o);return d(b,v),v}return function(){return m(ey.apply(null,arguments))}}const Te=s=>{const r=o=>o[s]||[];return r.isThemeGetter=!0,r},sh=/^\[(?:([a-z-]+):)?(.+)\]$/i,ny=/^\d+\/\d+$/,ly=new Set(["px","full","screen"]),ay=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sy=/\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$/,iy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ry=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gn=s=>ga(s)||ly.has(s)||ny.test(s),Zn=s=>Na(s,"length",py),ga=s=>!!s&&!Number.isNaN(Number(s)),ko=s=>Na(s,"number",ga),ps=s=>!!s&&Number.isInteger(Number(s)),oy=s=>s.endsWith("%")&&ga(s.slice(0,-1)),le=s=>sh.test(s),$n=s=>ay.test(s),uy=new Set(["length","size","percentage"]),dy=s=>Na(s,uy,ih),fy=s=>Na(s,"position",ih),my=new Set(["image","url"]),hy=s=>Na(s,my,gy),xy=s=>Na(s,"",by),bs=()=>!0,Na=(s,r,o)=>{const u=sh.exec(s);return u?u[1]?typeof r=="string"?u[1]===r:r.has(u[1]):o(u[2]):!1},py=s=>sy.test(s)&&!iy.test(s),ih=()=>!1,by=s=>cy.test(s),gy=s=>ry.test(s),yy=()=>{const s=Te("colors"),r=Te("spacing"),o=Te("blur"),u=Te("brightness"),d=Te("borderColor"),m=Te("borderRadius"),h=Te("borderSpacing"),p=Te("borderWidth"),b=Te("contrast"),z=Te("grayscale"),v=Te("hueRotate"),y=Te("invert"),j=Te("gap"),S=Te("gradientColorStops"),D=Te("gradientColorStopPositions"),q=Te("inset"),O=Te("margin"),Y=Te("opacity"),M=Te("padding"),G=Te("saturate"),B=Te("scale"),X=Te("sepia"),Q=Te("skew"),F=Te("space"),Z=Te("translate"),ae=()=>["auto","contain","none"],_e=()=>["auto","hidden","clip","visible","scroll"],He=()=>["auto",le,r],K=()=>[le,r],ee=()=>["",gn,Zn],Be=()=>["auto",ga,le],it=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["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"],Se=()=>[ga,le];return{cacheSize:500,separator:":",theme:{colors:[bs],spacing:[gn,Zn],blur:["none","",$n,le],brightness:Se(),borderColor:[s],borderRadius:["none","","full",$n,le],borderSpacing:K(),borderWidth:ee(),contrast:Se(),grayscale:me(),hueRotate:Se(),invert:me(),gap:K(),gradientColorStops:[s],gradientColorStopPositions:[oy,Zn],inset:He(),margin:He(),opacity:Se(),padding:K(),saturate:Se(),scale:Se(),sepia:me(),skew:Se(),space:K(),translate:K()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[$n]}],"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:[q]}],"inset-x":[{"inset-x":[q]}],"inset-y":[{"inset-y":[q]}],start:[{start:[q]}],end:[{end:[q]}],top:[{top:[q]}],right:[{right:[q]}],bottom:[{bottom:[q]}],left:[{left:[q]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ps,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",ps,le]}],"grid-cols":[{"grid-cols":[bs]}],"col-start-end":[{col:["auto",{span:["full",ps,le]},le]}],"col-start":[{"col-start":Be()}],"col-end":[{"col-end":Be()}],"grid-rows":[{"grid-rows":[bs]}],"row-start-end":[{row:["auto",{span:[ps,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:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[O]}],mx:[{mx:[O]}],my:[{my:[O]}],ms:[{ms:[O]}],me:[{me:[O]}],mt:[{mt:[O]}],mr:[{mr:[O]}],mb:[{mb:[O]}],ml:[{ml:[O]}],"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,r]}],"min-w":[{"min-w":[le,r,"min","max","fit"]}],"max-w":[{"max-w":[le,r,"none","full","min","max","fit","prose",{screen:[$n]},$n]}],h:[{h:[le,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,r,"auto","min","max","fit"]}],"font-size":[{text:["base",$n,Zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ko]}],"font-family":[{font:[bs]}],"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",ga,ko]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gn,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:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",gn,Zn]}],"underline-offset":[{"underline-offset":["auto",gn,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(),fy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",dy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hy]}],"bg-color":[{bg:[s]}],"gradient-from-pos":[{from:[D]}],"gradient-via-pos":[{via:[D]}],"gradient-to-pos":[{to:[D]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[m]}],"rounded-s":[{"rounded-s":[m]}],"rounded-e":[{"rounded-e":[m]}],"rounded-t":[{"rounded-t":[m]}],"rounded-r":[{"rounded-r":[m]}],"rounded-b":[{"rounded-b":[m]}],"rounded-l":[{"rounded-l":[m]}],"rounded-ss":[{"rounded-ss":[m]}],"rounded-se":[{"rounded-se":[m]}],"rounded-ee":[{"rounded-ee":[m]}],"rounded-es":[{"rounded-es":[m]}],"rounded-tl":[{"rounded-tl":[m]}],"rounded-tr":[{"rounded-tr":[m]}],"rounded-br":[{"rounded-br":[m]}],"rounded-bl":[{"rounded-bl":[m]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[Y]}],"border-style":[{border:[..._(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[Y]}],"divide-style":[{divide:_()}],"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:["",..._()]}],"outline-offset":[{"outline-offset":[gn,le]}],"outline-w":[{outline:[gn,Zn]}],"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":[gn,Zn]}],"ring-offset-color":[{"ring-offset":[s]}],shadow:[{shadow:["","inner","none",$n,xy]}],"shadow-color":[{shadow:[bs]}],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",$n,le]}],grayscale:[{grayscale:[z]}],"hue-rotate":[{"hue-rotate":[v]}],invert:[{invert:[y]}],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":[z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[Y]}],"backdrop-saturate":[{"backdrop-saturate":[G]}],"backdrop-sepia":[{"backdrop-sepia":[X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",le]}],duration:[{duration:Se()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:Se()}],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:[ps,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:[gn,Zn,ko]}],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"]}}},vy=ty(yy);function L(...s){return vy(Wb(s))}const hm=s=>{let r;const o=new Set,u=(z,v)=>{const y=typeof z=="function"?z(r):z;if(!Object.is(y,r)){const j=r;r=v??(typeof y!="object"||y===null)?y:Object.assign({},r,y),o.forEach(S=>S(r,j))}},d=()=>r,p={setState:u,getState:d,getInitialState:()=>b,subscribe:z=>(o.add(z),()=>o.delete(z))},b=r=s(u,d,p);return p},jy=(s=>s?hm(s):hm),Ny=s=>s;function zy(s,r=Ny){const o=Vi.useSyncExternalStore(s.subscribe,Vi.useCallback(()=>r(s.getState()),[s,r]),Vi.useCallback(()=>r(s.getInitialState()),[s,r]));return Vi.useDebugValue(o),o}const xm=s=>{const r=jy(s),o=u=>zy(r,u);return Object.assign(o,r),o},nc=(s=>s?xm(s):xm);function Sy(s,r){let o;try{o=s()}catch{return}return{getItem:d=>{var m;const h=b=>b===null?null:JSON.parse(b,void 0),p=(m=o.getItem(d))!=null?m:null;return p instanceof Promise?p.then(h):h(p)},setItem:(d,m)=>o.setItem(d,JSON.stringify(m,void 0)),removeItem:d=>o.removeItem(d)}}const Lo=s=>r=>{try{const o=s(r);return o instanceof Promise?o:{then(u){return Lo(u)(o)},catch(u){return this}}}catch(o){return{then(u){return this},catch(u){return Lo(u)(o)}}}},wy=(s,r)=>(o,u,d)=>{let m={storage:Sy(()=>localStorage),partialize:O=>O,version:0,merge:(O,Y)=>({...Y,...O}),...r},h=!1,p=0;const b=new Set,z=new Set;let v=m.storage;if(!v)return s((...O)=>{console.warn(`[zustand persist middleware] Unable to update item '${m.name}', the given storage is currently unavailable.`),o(...O)},u,d);const y=()=>{const O=m.partialize({...u()});return v.setItem(m.name,{state:O,version:m.version})},j=d.setState;d.setState=(O,Y)=>(j(O,Y),y());const S=s((...O)=>(o(...O),y()),u,d);d.getInitialState=()=>S;let D;const q=()=>{var O,Y;if(!v)return;const M=++p;h=!1,b.forEach(B=>{var X;return B((X=u())!=null?X:S)});const G=((Y=m.onRehydrateStorage)==null?void 0:Y.call(m,(O=u())!=null?O:S))||void 0;return Lo(v.getItem.bind(v))(m.name).then(B=>{if(B)if(typeof B.version=="number"&&B.version!==m.version){if(m.migrate){const X=m.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(M!==p)return;const[Q,F]=B;if(D=m.merge(F,(X=u())!=null?X:S),o(D,!0),Q)return y()}).then(()=>{M===p&&(G==null||G(D,void 0),D=u(),h=!0,z.forEach(B=>B(D)))}).catch(B=>{M===p&&(G==null||G(void 0,B))})};return d.persist={setOptions:O=>{m={...m,...O},O.storage&&(v=O.storage)},clearStorage:()=>{v==null||v.removeItem(m.name)},getOptions:()=>m,rehydrate:()=>q(),hasHydrated:()=>h,onHydrate:O=>(b.add(O),()=>{b.delete(O)}),onFinishHydration:O=>(z.add(O),()=>{z.delete(O)})},m.skipHydration||q(),D||S},Ey=wy,Ty=[{id:"production",name:"production",description:"live deployments"},{id:"staging",name:"staging",description:"pre-prod"},{id:"development",name:"development",description:"local + branch deploys"}],vn=nc()(Ey(s=>({current:"production",available:Ty,setCurrent:r=>s({current:r})}),{name:"blok-studio:env-scope"}));function Cy(){const s=vn(p=>p.current),r=vn(p=>p.available),o=vn(p=>p.setCurrent),u=r.find(p=>p.id===s)??r[0],[d,m]=R.useState(!1),h=R.useRef(null);return R.useEffect(()=>{if(!d)return;const p=z=>{var v;(v=h.current)!=null&&v.contains(z.target)||m(!1)},b=z=>{z.key==="Escape"&&m(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",b),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",b)}},[d]),u?l.jsxs("div",{ref:h,className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>m(p=>!p),className:L("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(js,{className:L("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"}),r.map(p=>{const b=p.id===s;return l.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":b,onClick:()=>{o(p.id),m(!1)},className:L("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:L("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:p.name}),p.description&&l.jsxs("span",{className:"text-[11px] text-zinc-500 truncate",children:["· ",p.description]}),b&&l.jsx(ya,{className:"ml-auto w-3.5 h-3.5 text-blok-green-500 shrink-0"})]},p.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 ch="/__blok";async function se(s,r){const o=await fetch(`${ch}${s}`,{...r,headers:{Accept:"application/json",...r==null?void 0:r.headers}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Jo(o.status,u.error||o.statusText)}return o.json()}class Jo extends Error{constructor(r,o){super(o),this.status=r,this.name="ApiError"}}function rh(){return se("/health")}function oh(){return se("/config")}function uh(){return se("/workflows")}function dh(s){return se(`/workflows/${encodeURIComponent(s)}`)}function fh(s){return se(`/workflows/${encodeURIComponent(s)}/sample`,{method:"DELETE"})}function mh(s,r){const o=new URLSearchParams;r!=null&&r.status&&o.set("status",r.status),r!=null&&r.limit&&o.set("limit",String(r.limit)),r!=null&&r.offset&&o.set("offset",String(r.offset)),r!=null&&r.sort&&o.set("sort",r.sort),r!=null&&r.env&&o.set("env",r.env);const u=o.toString();return se(`/workflows/${encodeURIComponent(s)}/runs${u?`?${u}`:""}`)}function hh(s){const r=new URLSearchParams;if(s!=null&&s.workflow&&r.set("workflow",s.workflow),s!=null&&s.status&&r.set("status",s.status),s!=null&&s.limit&&r.set("limit",String(s.limit)),s!=null&&s.offset&&r.set("offset",String(s.offset)),s!=null&&s.sort&&r.set("sort",s.sort),s!=null&&s.env&&r.set("env",s.env),s!=null&&s.tags&&s.tags.length>0&&r.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}`,m=Array.isArray(u.value)?u.value.join(","):u.value;r.set(`metadata.${u.key}${d}`,m)}else for(const[u,d]of Object.entries(s.metadata))r.set(`metadata.${u}`,d);const o=r.toString();return se(`/runs${o?`?${o}`:""}`)}function xh(s){return se(`/runs/${encodeURIComponent(s)}`)}function ph(s,r){const o=r?`?since=${r}`:"";return se(`/runs/${encodeURIComponent(s)}/events${o}`)}function ky(s){return se(`/runs/${encodeURIComponent(s)}/subruns`)}function bh(s){const r=s!=null&&s.env?`?env=${encodeURIComponent(s.env)}`:"";return se(`/queues${r}`)}function gh(s){const r=new URLSearchParams;s!=null&&s.env&&r.set("env",s.env),s!=null&&s.limit&&r.set("limit",String(s.limit));const o=r.toString();return se(`/deployments${o?`?${o}`:""}`)}function yh(s){const r=new URLSearchParams;s!=null&&s.workflow&&r.set("workflow",s.workflow),s!=null&&s.level&&r.set("level",s.level),s!=null&&s.q&&r.set("q",s.q),(s==null?void 0:s.since)!==void 0&&r.set("since",String(s.since)),(s==null?void 0:s.limit)!==void 0&&r.set("limit",String(s.limit)),s!=null&&s.env&&r.set("env",s.env);const o=r.toString();return se(`/logs${o?`?${o}`:""}`)}function vh(){return se("/runs",{method:"DELETE"})}function Fo(s,r){return se(`/runs/${encodeURIComponent(s)}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:r?JSON.stringify(r):void 0})}function jh(s){return se(`/runs/${encodeURIComponent(s)}/cancel`,{method:"POST"})}function Nh(s){const r=new URLSearchParams;s!=null&&s.status&&s.status.length>0&&r.set("status",s.status.join(",")),s!=null&&s.workflowName&&r.set("workflowName",s.workflowName),s!=null&&s.limit&&r.set("limit",String(s.limit)),s!=null&&s.offset&&r.set("offset",String(s.offset));const o=r.toString();return se(`/scheduled${o?`?${o}`:""}`)}function zh(){return se("/routing")}function Sh(){return se("/saved-filters")}function wh(s){return se("/saved-filters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}function Eh(s){return se(`/saved-filters/${encodeURIComponent(s)}`,{method:"DELETE"})}function Th(s){return se(`/search?q=${encodeURIComponent(s)}`)}function Ch(s,r){return se(`/runs/diff?a=${encodeURIComponent(s)}&b=${encodeURIComponent(r)}`)}function Ry(){return se("/tags")}function kh(s,r){return se(`/runs/${encodeURIComponent(s)}/tags`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:r})})}function Rh(s,r){return se(`/runs/${encodeURIComponent(s)}/tags/${encodeURIComponent(r)}`,{method:"DELETE"})}function Dh(s){const r=s?`?workflow=${encodeURIComponent(s)}`:"";return se(`/metrics${r}`)}async function Mh(s){const r=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={};r.headers.forEach((d,m)=>{o[m]=d});const u=await r.text();return{status:r.status,headers:o,body:u}}function zs(s,r){const o=document.createElement("a");o.href=`${ch}${s}`,o.download=r,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o)}function Wo(s){zs(`/runs/${encodeURIComponent(s)}/export?format=json`,`blok-run-${s}.json`)}function Io(s){zs(`/runs/${encodeURIComponent(s)}/export?format=csv`,`blok-run-${s}.csv`)}function Ah(s){const r=new URLSearchParams;r.set("format","json"),s!=null&&s.workflow&&r.set("workflow",s.workflow),s!=null&&s.status&&r.set("status",s.status),zs(`/runs/export?${r.toString()}`,`blok-runs-${Date.now()}.json`)}function Oh(s){const r=new URLSearchParams;r.set("format","csv"),s!=null&&s.workflow&&r.set("workflow",s.workflow),s!=null&&s.status&&r.set("status",s.status),zs(`/runs/export?${r.toString()}`,`blok-runs-${Date.now()}.csv`)}function _h(){return se("/webhooks")}function Uh(s){return se("/webhooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}function Lh(s){return se(`/webhooks/${encodeURIComponent(s)}`,{method:"DELETE"})}function qh(){return se("/dashboards")}function Dy(s){return se(`/dashboards/${encodeURIComponent(s)}`)}function Hh(s){return se("/dashboards",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}function Bh(s,r){return se(`/dashboards/${encodeURIComponent(s)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}function Gh(s){return se(`/dashboards/${encodeURIComponent(s)}`,{method:"DELETE"})}function Qh(s){return se(`/dashboards/${encodeURIComponent(s)}/duplicate`,{method:"POST"})}function Yh(s,r){return se(`/runs/${encodeURIComponent(s)}/explain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r?{nodeId:r}:{})})}function Kh(){return se("/concurrency/health")}function Xh(){return se("/concurrency/state")}const My=Object.freeze(Object.defineProperty({__proto__:null,ApiError:Jo,addRunTags:kh,cancelRun:jh,clearRuns:vh,createDashboard:Hh,createWebhook:Uh,deleteDashboard:Gh,deleteSavedFilter:Eh,deleteWebhook:Lh,deleteWorkflowSample:fh,downloadExport:zs,duplicateDashboard:Qh,explainRunError:Yh,exportRunCsv:Io,exportRunJson:Wo,exportRunsCsv:Oh,exportRunsJson:Ah,fetchConcurrencyHealth:Kh,fetchConcurrencyState:Xh,fetchConfig:oh,fetchDashboard:Dy,fetchDashboards:qh,fetchDeployments:gh,fetchHealth:rh,fetchLogs:yh,fetchMetrics:Dh,fetchQueues:bh,fetchRoutingDiagnostics:zh,fetchRunDetail:xh,fetchRunDiff:Ch,fetchRunEvents:ph,fetchRuns:hh,fetchSavedFilters:Sh,fetchScheduledDispatches:Nh,fetchSubRuns:ky,fetchTags:Ry,fetchWebhooks:_h,fetchWorkflowDetail:dh,fetchWorkflowRuns:mh,fetchWorkflows:uh,removeRunTag:Rh,replayRun:Fo,searchTraces:Th,sendWorkflowRequest:Mh,updateDashboard:Bh,upsertSavedFilter:wh},Symbol.toStringTag,{value:"Module"}));function Po(){return qe({queryKey:["workflows"],queryFn:uh,refetchInterval:5e3})}function Ay(s){return qe({queryKey:["workflow",s],queryFn:()=>dh(s),enabled:!!s})}function Oy(s){const r=ht();return Lt({mutationFn:()=>fh(s),onSuccess:()=>{r.invalidateQueries({queryKey:["workflow",s]})}})}const _y={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"},Ss={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"},Uy={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"},Vh={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"},Zh={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"},Ly={debug:"text-zinc-400",info:"text-blue-400",warn:"text-amber-400",error:"text-red-400"};function qy(){const s=Xb(),{data:r}=Po(),o=[{to:"/",label:"Overview",icon:Pb},{to:"/dashboards",label:"Dashboards",icon:Vm},{to:"/runs",label:"All Runs",icon:Wn},{to:"/scheduled",label:"Scheduled",icon:Ao},{to:"/logs",label:"Logs",icon:eg},{to:"/queues",label:"Queues",icon:tg},{to:"/deployments",label:"Deployments",icon:wl},{to:"/metrics",label:"Metrics",icon:Bo},{to:"/webhooks",label:"Webhooks",icon:Ns}];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(Qg,{className:"h-4 w-auto shrink-0"}),l.jsx("span",{className:"text-zinc-100 font-semibold text-sm tracking-tight",children:"blok"})]}),l.jsx(Cy,{})]}),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:m})=>{const h=s({to:u,fuzzy:u!=="/"})||u==="/"&&location.pathname==="/";return l.jsxs(De,{to:u,className:L("relative flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm transition-colors",h?"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(m,{className:L("w-4 h-4",h?"text-zinc-100":"text-zinc-500")}),d]},u)})}),r&&r.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:r.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:L("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:L("w-2 h-2 rounded-full shrink-0",Ss[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(Go,{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(ng,{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 r=Math.floor(s/6e4),o=Math.round(s%6e4/1e3);return`${r}m ${o}s`}function Pn(s){const r=Date.now()-s;return r<1e3?"just now":r<6e4?`${Math.floor(r/1e3)}s ago`:r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:`${Math.floor(r/864e5)}d ago`}function lc(s){return new Date(s).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function In(s){return s===0?"0%":s<.01?"<1%":`${(s*100).toFixed(1)}%`}let Hy=0;const vs=nc((s,r)=>({notifications:[],enabled:!0,desktopEnabled:!1,addNotification:o=>{const u={...o,id:`notif_${++Hy}`,timestamp:Date.now(),read:!1};if(s(d=>({notifications:[u,...d.notifications].slice(0,100)})),r().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 By(){return"Notification"in window?Notification.permission==="granted"?!0:Notification.permission==="denied"?!1:await Notification.requestPermission()==="granted":!1}function Gy(){const{notifications:s}=vs(),[r,o]=R.useState([]);R.useEffect(()=>{const d=s[0];if(!d||d.read||Date.now()-d.timestamp>5e3)return;o(h=>h.some(p=>p.id===d.id)?h:[d,...h].slice(0,3));const m=setTimeout(()=>{o(h=>h.filter(p=>p.id!==d.id))},5e3);return()=>clearTimeout(m)},[s]);const u=d=>{o(m=>m.filter(h=>h.id!==d))};return r.length===0?null:l.jsx("div",{className:"fixed bottom-8 right-4 z-50 flex flex-col gap-2 w-80",children:r.map(d=>l.jsx(Qy,{toast:d,onDismiss:u},d.id))})}function Qy({toast:s,onDismiss:r}){const o=Cl(),u={success:l.jsx(ec,{className:"w-4 h-4 text-green-400 shrink-0"}),error:l.jsx(Zm,{className:"w-4 h-4 text-red-400 shrink-0"}),info:l.jsx(ag,{className:"w-4 h-4 text-blue-400 shrink-0"})};return l.jsx("div",{className:L("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}}),r(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(),r(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 Yy(){const{notifications:s,enabled:r,desktopEnabled:o,setEnabled:u,setDesktopEnabled:d,markAllRead:m,clearAll:h}=vs(),[p,b]=R.useState(!1),z=Cl(),v=s.filter(j=>!j.read).length,y=async()=>{if(o)d(!1);else{const j=await By();d(j)}};return l.jsxs("div",{className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>b(!p),className:"relative flex items-center gap-1 text-zinc-500 hover:text-zinc-300 transition-colors","aria-label":"Notifications",children:[l.jsx(am,{className:"w-3 h-3"}),v>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:v>9?"9+":v})]}),p&&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(!r),className:"text-xs text-zinc-500 hover:text-zinc-300",title:r?"Mute notifications":"Enable notifications",children:r?l.jsx(am,{className:"w-3 h-3"}):l.jsx(lg,{className:"w-3 h-3"})}),l.jsxs("button",{type:"button",onClick:y,className:L("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&&(z({to:"/runs/$runId",params:{runId:j.runId}}),b(!1))},className:L("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:Pn(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:m,className:"text-[10px] text-zinc-500 hover:text-zinc-300",children:"Mark all read"}),l.jsx("button",{type:"button",onClick:h,className:"text-[10px] text-zinc-500 hover:text-zinc-300",children:"Clear all"})]})]})]})]})}const zl=nc(s=>({status:"disconnected",activeStreams:0,setStatus:r=>s({status:r}),incrementStreams:()=>s(r=>({activeStreams:r.activeStreams+1})),decrementStreams:()=>s(r=>({activeStreams:Math.max(0,r.activeStreams-1)}))}));function Ky(){const{status:s,activeStreams:r}=zl(),o={connected:{icon:sg,label:"Connected",className:"text-blok-green-500"},connecting:{icon:Oe,label:"Connecting...",className:"text-yellow-400 animate-spin"},disconnected:{icon:sm,label:"Disconnected",className:"text-zinc-500"},error:{icon:sm,label:"Connection error",className:"text-red-400"}},{icon:u,label:d,className:m}=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:L("w-3 h-3",m)}),l.jsx("span",{className:"text-zinc-500",children:d})]}),r>0&&l.jsxs("span",{className:"ml-3 text-zinc-600",children:[r," active stream",r>1?"s":""]}),l.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[l.jsx(Yy,{}),l.jsx("span",{className:"text-zinc-600",children:"Blok Studio v0.1.0"})]})]})}function Xy(){const[s,r]=R.useState(!1),[o,u]=R.useState(""),[d,m]=R.useState({workflows:[],runs:[]}),[h,p]=R.useState(0),[b,z]=R.useState(!1),v=R.useRef(null),y=Cl(),j=d.workflows.length+d.runs.length;R.useEffect(()=>{const q=O=>{(O.metaKey||O.ctrlKey)&&O.key==="k"&&(O.preventDefault(),r(Y=>!Y)),O.key==="Escape"&&s&&r(!1)};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[s]),R.useEffect(()=>{s&&(u(""),m({workflows:[],runs:[]}),p(0),requestAnimationFrame(()=>{var q;return(q=v.current)==null?void 0:q.focus()}))},[s]),R.useEffect(()=>{if(!o.trim()){m({workflows:[],runs:[]}),p(0);return}const q=setTimeout(async()=>{z(!0);try{const O=await Th(o);m(O),p(0)}catch{m({workflows:[],runs:[]})}finally{z(!1)}},200);return()=>clearTimeout(q)},[o]);const S=R.useCallback(q=>{const O=d.workflows.length;if(q<O){const Y=d.workflows[q];Y&&y({to:"/workflows/$name",params:{name:Y.name}})}else{const Y=d.runs[q-O];Y&&y({to:"/runs/$runId",params:{runId:Y.id}})}r(!1)},[d,y]),D=q=>{switch(q.key){case"ArrowDown":q.preventDefault(),p(O=>(O+1)%Math.max(j,1));break;case"ArrowUp":q.preventDefault(),p(O=>(O-1+Math.max(j,1))%Math.max(j,1));break;case"Enter":q.preventDefault(),j>0&&S(h);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:()=>r(!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(Go,{className:"w-4 h-4 text-zinc-500 shrink-0"}),l.jsx("input",{ref:v,value:o,onChange:q=>u(q.target.value),onKeyDown:D,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((q,O)=>l.jsx(Vy,{workflow:q,selected:h===O,onClick:()=>S(O)},q.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((q,O)=>{const Y=d.workflows.length+O;return l.jsx(Zy,{run:q,selected:h===Y,onClick:()=>S(Y)},q.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 Vy({workflow:s,selected:r,onClick:o}){return l.jsxs("button",{type:"button",onClick:o,className:L("w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors",r?"bg-zinc-800":"hover:bg-zinc-800/50"),children:[l.jsx(ba,{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)]})]}),r&&l.jsx(Qo,{className:"w-3 h-3 text-zinc-500 shrink-0"})]})}function Zy({run:s,selected:r,onClick:o}){return l.jsxs("button",{type:"button",onClick:o,className:L("w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors",r?"bg-zinc-800":"hover:bg-zinc-800/50"),children:[l.jsx(Wn,{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:L("w-2 h-2 rounded-full shrink-0",Ss[s.status])})]}),l.jsxs("div",{className:"text-[11px] text-zinc-500",children:[s.triggerSummary," · ",ge(s.durationMs)," · ",Pn(s.startedAt),s.error&&l.jsxs("span",{className:"text-red-400",children:[" · ",s.error.message.slice(0,60)]})]})]}),r&&l.jsx(Qo,{className:"w-3 h-3 text-zinc-500 shrink-0"})]})}class $y extends R.Component{constructor(o){super(o);lm(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(tc,{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(Yo,{className:"w-3.5 h-3.5"}),"Retry"]})]}):this.props.children}}const $h="/__blok";function Jy(s,r){const o=`${$h}/runs/${encodeURIComponent(s)}/stream`;return Jh(o,r)}function Fy(s,r){let o=`${$h}/stream`;return Jh(o,s)}const Wy=["RUN_STARTED","RUN_COMPLETED","RUN_FAILED","NODE_STARTED","NODE_COMPLETED","NODE_FAILED","NODE_SKIPPED","VARS_UPDATED","LOG_ENTRY"],Iy=10,Py=1e3,ev=3e4;function Jh(s,r){let o=null,u=!1,d=0,m=null,h=null,p=!1;const b=r.timeout??1e4;function z(){if(p)return;o=new EventSource(s),u=!1,h=setTimeout(()=>{var D;!u&&!p&&(o==null||o.close(),(D=r.onError)==null||D.call(r,new Event("timeout")),v())},b);const j=()=>{var D;u||(u=!0,d=0,h&&(clearTimeout(h),h=null),(D=r.onOpen)==null||D.call(r))};o.onopen=j,o.addEventListener("connected",j),o.onerror=()=>{var D;p||(o==null||o.close(),h&&(clearTimeout(h),h=null),(D=r.onError)==null||D.call(r,new Event("error")),v())};const S=D=>{try{const q=JSON.parse(D.data);r.onEvent(q)}catch{}};for(const D of Wy)o.addEventListener(D,S);o.addEventListener("stream-end",()=>{var D;(D=r.onEnd)==null||D.call(r),y()})}function v(){if(p||d>=Iy)return;const j=Math.min(Py*2**d,ev);d++,m=setTimeout(z,j)}function y(){p=!0,o==null||o.close(),o=null,m&&(clearTimeout(m),m=null),h&&(clearTimeout(h),h=null)}return z(),y}const Fh=nc(s=>({events:[],maxEvents:50,pushEvent:r=>s(o=>{const u=[r,...o.events];return{events:u.length>o.maxEvents?u.slice(0,o.maxEvents):u}})}));function tv(s=!0){const r=ht(),o=zl(z=>z.setStatus),u=zl(z=>z.incrementStreams),d=zl(z=>z.decrementStreams),m=vs(z=>z.addNotification),h=Fh(z=>z.pushEvent),p=R.useRef(vs.getState().enabled);R.useEffect(()=>vs.subscribe(z=>{p.current=z.enabled}),[]);const b=R.useRef(null);R.useEffect(()=>{if(!s)return;u(),o("connecting");const z=()=>{b.current||(b.current=setTimeout(()=>{b.current=null,r.invalidateQueries({queryKey:["workflows"]}),r.invalidateQueries({queryKey:["runs"]})},500))},v=Fy({onEvent:y=>{var j;if(z(),h(y),p.current){if(y.type==="RUN_COMPLETED"){const S=y.payload,D=S==null?void 0:S.durationMs;m({type:"success",title:`${y.workflowName} completed`,message:D?`Finished in ${nv(D)}`:"Run completed successfully",runId:y.runId,workflowName:y.workflowName})}else if(y.type==="RUN_FAILED"){const S=y.payload,D=(j=S==null?void 0:S.error)==null?void 0:j.message;m({type:"error",title:`${y.workflowName} failed`,message:D||"Run failed with an error",runId:y.runId,workflowName:y.workflowName})}}},onOpen:()=>o("connected"),onError:()=>o("error")});return()=>{v(),d(),o("disconnected"),b.current&&(clearTimeout(b.current),b.current=null)}},[s,r,o,u,d,m,h])}function nv(s){return s<1e3?`${Math.round(s)}ms`:`${(s/1e3).toFixed(1)}s`}const xt=Vb()({component:lv});function lv(){return tv(),l.jsxs("div",{className:"h-screen flex flex-col bg-canvas",children:[l.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[l.jsx(qy,{}),l.jsx("main",{className:"flex-1 overflow-y-auto bg-raised",children:l.jsx($y,{children:l.jsx(Zb,{})})})]}),l.jsx(Ky,{}),l.jsx(Xy,{}),l.jsx(Gy,{})]})}function Xe({icon:s,title:r,description:o,action:u,className:d,snippets:m,docLink:h,align:p="center"}){const b=L("flex flex-col py-12 px-4 max-w-2xl",p==="center"?"items-center text-center mx-auto":"items-start",d);return l.jsxs("div",{className:b,children:[l.jsx("div",{className:L("mb-4 text-zinc-600",p==="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:r}),l.jsx("div",{className:"text-sm text-zinc-400 leading-relaxed mb-5",children:o}),m&&m.length>0&&l.jsx("div",{className:L("w-full space-y-2.5 mb-5",p==="center"&&"text-left"),children:m.map(z=>l.jsx(av,{snippet:z},z.lang))}),(u||h)&&l.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[u,h&&l.jsxs("a",{href:h.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:["↗ ",h.label]})]})]})}function av({snippet:s}){const[r,o]=R.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:L("ml-auto text-[10.5px] font-mono px-2 py-0.5 rounded border transition-colors",r?"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:r?"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 sv=Et("/webhooks")({component:cv}),iv=[{value:"run.started",label:"Run Started"},{value:"run.completed",label:"Run Completed"},{value:"run.failed",label:"Run Failed"}];function cv(){const s=ht(),[r,o]=R.useState(!1),[u,d]=R.useState(""),[m,h]=R.useState(""),[p,b]=R.useState(["run.completed","run.failed"]),[z,v]=R.useState(null),{data:y,isLoading:j}=qe({queryKey:["webhooks"],queryFn:_h,refetchInterval:1e4}),S=Lt({mutationFn:Uh,onSuccess:()=>{s.invalidateQueries({queryKey:["webhooks"]}),o(!1),d(""),h(""),b(["run.completed","run.failed"]),v(null)},onError:M=>{v(M instanceof Error?M.message:"Failed to create webhook")}}),D=Lt({mutationFn:Lh,onSuccess:()=>{s.invalidateQueries({queryKey:["webhooks"]})}}),q=M=>{if(M.preventDefault(),v(null),!u.trim()){v("URL is required");return}try{new URL(u)}catch{v("Invalid URL format");return}if(p.length===0){v("Select at least one event");return}S.mutate({url:u.trim(),events:p,secret:m.trim()||void 0})},O=M=>{b(G=>G.includes(M)?G.filter(B=>B!==M):[...G,M])},Y=(y==null?void 0:y.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(!r),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(Nl,{className:"w-4 h-4"}),"Add Webhook"]})]}),r&&l.jsxs("form",{onSubmit:q,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:M=>d(M.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:m,onChange:M=>h(M.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:iv.map(M=>l.jsx("button",{type:"button",onClick:()=>O(M.value),className:L("px-3 py-1.5 rounded-md text-xs font-medium border transition-colors",p.includes(M.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:M.label},M.value))})]}),z&&l.jsx("p",{className:"text-sm text-red-400",children:z}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{type:"submit",disabled:S.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:[S.isPending&&l.jsx(Oe,{className:"w-3 h-3 animate-spin"}),"Create Webhook"]}),l.jsx("button",{type:"button",onClick:()=>{o(!1),v(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(Ns,{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(Nl,{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(M=>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:L("w-2 h-2 rounded-full shrink-0",M.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:M.url}),l.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[l.jsx("span",{className:"text-[11px] text-zinc-500",children:M.events.join(", ")}),M.lastTriggeredAt&&l.jsxs("span",{className:"text-[11px] text-zinc-600 flex items-center gap-1",children:[M.lastStatus&&M.lastStatus<400?l.jsx(ec,{className:"w-3 h-3 text-green-500"}):l.jsx($m,{className:"w-3 h-3 text-red-500"}),"Last fired ",Pn(M.lastTriggeredAt),M.lastStatus&&l.jsxs("span",{children:["(HTTP ",M.lastStatus,")"]})]}),!M.active&&l.jsxs("span",{className:"text-[11px] text-red-400",children:["Disabled after ",M.failCount," failures"]})]})]}),l.jsx("button",{type:"button",onClick:()=>D.mutate(M.id),disabled:D.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(Ko,{className:"w-4 h-4"})})]},M.id))})]})}const rv=Et("/settings")({component:ov});function ov(){const s=vn(S=>S.current),r=Cl(),o=ht(),{data:u}=qe({queryKey:["health"],queryFn:rh,retry:1}),{data:d}=qe({queryKey:["config"],queryFn:oh,retry:1}),[m,h]=R.useState(""),[p,b]=R.useState(!1),[z,v]=R.useState(null),y=m.trim().toLowerCase()==="delete"&&!p;async function j(){if(y){b(!0),v(null);try{const S=await vh();v(S),h(""),o.invalidateQueries()}catch(S){v({error:S instanceof Error?S.message:String(S)})}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(pm,{icon:l.jsx(ig,{className:"w-4 h-4 text-zinc-500"}),title:"Storage",subtitle:"Where Studio's run history is persisted.",children:[l.jsx(yn,{label:"Backend",value:uv()}),l.jsx(yn,{label:"Inferred path",value:l.jsx("span",{className:"font-mono",children:dv()})}),l.jsx(yn,{label:"Trigger version",value:(u==null?void 0:u.version)??"—"}),l.jsx(yn,{label:"Trigger uptime",value:u?fv(u.uptime):"—"}),l.jsx(yn,{label:"Active runs",value:String((u==null?void 0:u.activeRuns)??0)}),l.jsx(yn,{label:"Workflows registered",value:String((d==null?void 0:d.workflows.length)??0)}),l.jsx(yn,{label:"Trigger types",value:((d==null?void 0:d.triggers)??[]).join(", ")||"—"})]}),l.jsxs(pm,{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(yn,{label:"Current scope",value:l.jsx("span",{className:"font-mono text-blok-green-500",children:s})}),l.jsx(yn,{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(tc,{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:m,onChange:S=>h(S.target.value),placeholder:"delete",className:L("px-3 py-2 rounded-md bg-raised border text-sm text-zinc-100 font-mono","focus:outline-none transition-colors",y?"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:!y,className:L("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-colors",y?"bg-status-failed text-white hover:opacity-90":"bg-raised border border-zinc-800 text-zinc-600 cursor-not-allowed"),children:[p?l.jsx(Oe,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Ko,{className:"w-3.5 h-3.5"}),p?"Clearing…":"Clear all data"]}),z&&"deleted"in z&&l.jsxs("span",{className:"text-[12px] text-blok-green-500 font-mono",children:["✓ ",z.deleted.toLocaleString()," record",z.deleted===1?"":"s"," removed"]}),z&&"error"in z&&l.jsxs("span",{className:"text-[12px] text-status-failed font-mono break-all",children:["Failed: ",z.error]}),l.jsx("button",{type:"button",onClick:()=>r({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 pm({icon:s,title:r,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:r}),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 yn({label:s,value:r}){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:r})]})}function uv(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 dv(){return".blok/trace.db"}function fv(s){if(s<60)return`${Math.round(s)}s`;if(s<3600)return`${Math.round(s/60)}m ${Math.round(s%60)}s`;const r=Math.floor(s/3600),o=Math.round(s%3600/60);return`${r}h ${o}m`}function mv(s){return qe({queryKey:["scheduled-dispatches",s],queryFn:()=>Nh(s),refetchInterval:3e3})}function hv(){const s=ht();return Lt({mutationFn:r=>jh(r),onSuccess:()=>{s.invalidateQueries({queryKey:["scheduled-dispatches"]}),s.invalidateQueries({queryKey:["runs"]})}})}const xv=Et("/scheduled")({component:bv}),Wh={delayed:"Delayed",queued:"Queued",debounced:"Debounced"},pv={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 bv(){const[s,r]=R.useState(""),{data:o,isLoading:u}=mv({status:s?[s]:void 0,limit:200}),d=hv(),[,m]=R.useState(0);R.useEffect(()=>{const z=setInterval(()=>m(v=>v+1),1e3);return()=>clearInterval(z)},[]);const h=(o==null?void 0:o.rows)??[],p=(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(gv,{value:s,onChange:r}),u?l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(Oe,{className:"w-5 h-5 text-zinc-500 animate-spin"})}):h.length>0?l.jsx(yv,{rows:h,serverNow:p,localNow:b,onCancel:z=>d.mutate(z),cancellingRunId:d.isPending?d.variables??null:null}):s?l.jsx(Xe,{icon:l.jsx(Ao,{className:"w-10 h-10"}),title:`No ${Wh[s].toLowerCase()} dispatches`,description:`Nothing is currently in the "${s}" state.`,action:l.jsx("button",{type:"button",onClick:()=>r(""),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(Ao,{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 gv({value:s,onChange:r}){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:()=>r(u.value),className:L("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 yv({rows:s,serverNow:r,localNow:o,onCancel:u,cancellingRunId:d}){const m=r+(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(h=>{const p=h.scheduledAt-m,b=h.expiresAt?h.expiresAt-m: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:L("inline-flex items-center px-2 py-0.5 rounded-full text-[11px] font-medium ring-1 ring-inset",pv[h.dispatchStatus]),children:Wh[h.dispatchStatus]})}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:l.jsx(De,{to:"/workflows/$name",params:{name:h.workflowName},className:"hover:text-zinc-100 hover:underline",children:h.workflowName})}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-300 tabular-nums",children:bm(p)}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 tabular-nums",children:b===null?"—":bm(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:h.runId},className:"hover:text-zinc-300",children:[h.runId.slice(0,12),"…"]})}),l.jsx("td",{className:"px-4 py-2.5 text-right",children:l.jsxs("button",{type:"button",onClick:()=>u(h.runId),disabled:d===h.runId,className:L("inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors",d===h.runId?"bg-hover text-zinc-500 cursor-not-allowed":"bg-hover text-zinc-300 hover:bg-raised hover:text-zinc-100"),children:[d===h.runId?l.jsx(Oe,{className:"w-3 h-3 animate-spin"}):l.jsx(Kt,{className:"w-3 h-3"}),"Cancel"]})})]},h.runId)})})]})})}function bm(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 r=Math.floor(s/36e5),o=Math.floor(s%36e5/6e4);return`${r}h ${o}m`}const vv=Et("/queues")({component:jv});function jv(){const s=vn(m=>m.current),{data:r,isLoading:o,error:u}=qe({queryKey:["queues",s],queryFn:()=>bh({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(Wn,{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=(r==null?void 0:r.queues)??[];return d.length===0?l.jsx("div",{className:"p-8",children:l.jsx(Xe,{icon:l.jsx(Ns,{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(yl,{children:"Workflow"}),l.jsx(yl,{className:"w-[140px]",children:"Trigger"}),l.jsx(yl,{className:"w-[80px]",children:"Depth"}),l.jsx(yl,{className:"w-[110px] text-right",children:"Runs · 24h"}),l.jsx(yl,{className:"w-[120px] text-right",children:"Avg"}),l.jsx(yl,{className:"w-[100px] text-right",children:"Errors"}),l.jsx(yl,{className:"w-[140px] text-right",children:"Last run"})]})}),l.jsx("tbody",{children:d.map(m=>l.jsx(Nv,{queue:m},m.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 Nv({queue:s}){const r=s.triggerType==="http"?Xo:s.triggerType==="cron"?ja:s.triggerType==="email"?cg:Ns;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(r,{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:L("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?Pn(s.lastRunAt):"—"})]})}function yl({children:s,className:r}){return l.jsx("th",{className:L("text-left text-[10px] uppercase tracking-[0.06em] text-zinc-500 font-semibold px-3 py-2",r),children:s})}function Ih({data:s}){return s.some(o=>o.count>0)?l.jsx(Bm,{width:"100%",height:220,children:l.jsxs(Gm,{data:s,margin:{top:0,right:0,left:-20,bottom:0},children:[l.jsx(Qm,{strokeDasharray:"3 3",stroke:"#27272a"}),l.jsx(Ym,{dataKey:"range",tick:{fill:"#71717a",fontSize:10},tickLine:!1,axisLine:{stroke:"#3f3f46"}}),l.jsx(Km,{tick:{fill:"#71717a",fontSize:10},tickLine:!1,axisLine:{stroke:"#3f3f46"},allowDecimals:!1}),l.jsx(Xm,{contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#a1a1aa"},itemStyle:{color:"#d4d4d8"},formatter:o=>[`${o} runs`,"Count"]}),l.jsx(Mo,{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 Ph({data:s}){const r=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(Bm,{width:"100%",height:220,children:l.jsxs(Gm,{data:r,margin:{top:0,right:0,left:-20,bottom:0},children:[l.jsx(Qm,{strokeDasharray:"3 3",stroke:"#27272a"}),l.jsx(Ym,{dataKey:"time",tick:{fill:"#71717a",fontSize:10},tickLine:!1,axisLine:{stroke:"#3f3f46"},interval:"preserveStartEnd"}),l.jsx(Km,{tick:{fill:"#71717a",fontSize:10},tickLine:!1,axisLine:{stroke:"#3f3f46"},allowDecimals:!1}),l.jsx(Xm,{contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:"6px",fontSize:"12px"},labelStyle:{color:"#a1a1aa"},itemStyle:{color:"#d4d4d8"}}),l.jsx(Ib,{wrapperStyle:{fontSize:"11px",color:"#71717a"}}),l.jsx(Mo,{dataKey:"completed",name:"Completed",fill:"#22c55e",opacity:.7,radius:[2,2,0,0],stackId:"status"}),l.jsx(Mo,{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 ex({data:s}){const r=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/r*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:L("text-xs font-mono",o.errorRate>.1?"text-red-400":o.errorRate>0?"text-amber-400":"text-green-500"),children:In(o.errorRate)})})]},o.nodeName))})]})})}function tx({data:s}){const r=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:L("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/r*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:L("text-[10px] font-mono",o.errorRate>.1?"text-red-400":o.errorRate>0?"text-amber-400":"text-green-400"),children:[In(o.errorRate)," err"]})]})]},o.name))})}function nx(s){return qe({queryKey:["metrics",s],queryFn:()=>Dh(s),refetchInterval:1e4})}function zv(s,r){return qe({queryKey:["diff",s,r],queryFn:()=>Ch(s,r),enabled:!!s&&!!r})}function Sv(s){const r=ht();return Lt({mutationFn:o=>kh(s,o),onSuccess:()=>{r.invalidateQueries({queryKey:["run",s]}),r.invalidateQueries({queryKey:["tags"]}),r.invalidateQueries({queryKey:["runs"]})}})}function wv(s){const r=ht();return Lt({mutationFn:o=>Rh(s,o),onSuccess:()=>{r.invalidateQueries({queryKey:["run",s]}),r.invalidateQueries({queryKey:["tags"]}),r.invalidateQueries({queryKey:["runs"]})}})}const Ev=Et("/metrics")({component:Tv});function Tv(){const{data:s}=Po(),[r,o]=R.useState(void 0),{data:u,isLoading:d}=nx(r);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(Bo,{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:r||"",onChange:m=>o(m.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(m=>l.jsx("option",{value:m.name,children:m.name},m.name))]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 xl:grid-cols-7 gap-3",children:[l.jsx(vl,{label:"Total Runs",value:String(u.totalRuns)}),l.jsx(vl,{label:"Completed",value:String(u.completedRuns),color:"text-green-400"}),l.jsx(vl,{label:"Failed",value:String(u.failedRuns),color:u.failedRuns>0?"text-red-400":void 0}),l.jsx(vl,{label:"Error Rate",value:In(u.totalRuns>0?u.failedRuns/u.totalRuns:0),color:u.failedRuns>0?"text-red-400":void 0}),l.jsx(vl,{label:"Avg Duration",value:ge(u.avgDurationMs)}),l.jsx(vl,{label:"P95 Duration",value:ge(u.p95DurationMs)}),l.jsx(vl,{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(Ph,{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(Ih,{data:u.durationDistribution})]})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[!r&&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(tx,{data:u.workflowBreakdown})]}),u.nodePerformance.length>0&&l.jsxs("div",{className:L("rounded-lg border border-zinc-800 bg-overlay p-4",r?"lg:col-span-2":""),children:[l.jsx("h3",{className:"text-sm font-medium text-zinc-300 mb-4",children:"Node Performance"}),l.jsx(ex,{data:u.nodePerformance})]})]})]})}function vl({label:s,value:r,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:L("text-lg font-semibold font-mono",o||"text-zinc-100"),children:r})]})}const Cv=Et("/logs")({component:kv});function kv(){const s=vn(G=>G.current),[r,o]=R.useState(new Set),[u,d]=R.useState(),[m,h]=R.useState(""),[p,b]=R.useState(!0),z=R.useRef(null),v=r.size>0?[...r].join(","):void 0,{data:y,isLoading:j,error:S}=qe({queryKey:["logs",s,v,u,m,p],queryFn:()=>yh({workflow:u,level:v,q:m||void 0,env:s,limit:200}),refetchInterval:p?2e3:!1,placeholderData:G=>G}),D=R.useRef(new Set),[q,O]=R.useState(new Set);R.useEffect(()=>{if(!(y!=null&&y.logs))return;const G=y.logs.filter(Q=>!D.current.has(Q.id));for(const Q of G)D.current.add(Q.id);if(G.length===0)return;const B=new Set(G.map(Q=>Q.id));O(B);const X=setTimeout(()=>O(new Set),1200);return()=>clearTimeout(X)},[y]);const Y=R.useMemo(()=>{const G={error:0,warn:0,info:0,debug:0},B=new Set;for(const X of(y==null?void 0:y.logs)??[])G[X.level]=(G[X.level]??0)+1,B.add(X.workflowName);return{counts:G,workflowCount:B.size}},[y==null?void 0:y.logs]);R.useEffect(()=>{const G=B=>{var X;if(B.target instanceof HTMLInputElement||B.target instanceof HTMLTextAreaElement){B.key==="Escape"&&(h(""),B.target.blur());return}B.metaKey||B.ctrlKey||(B.key==="/"?(B.preventDefault(),(X=z.current)==null||X.focus()):B.key.toLowerCase()==="l"&&b(Q=>!Q))};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[]);const M=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:L("ml-auto inline-flex items-center gap-2 px-3 py-1 rounded-md border text-xs font-medium transition-colors",p?"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":p,children:[l.jsx("span",{className:L("w-1.5 h-1.5 rounded-full bg-current",p&&"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(Go,{className:"w-3.5 h-3.5 text-zinc-500 shrink-0"}),[...r].map(G=>l.jsx(gm,{k:"level:",v:G,onRemove:()=>M(G)},G)),u&&l.jsx(gm,{k:"workflow:",v:u,onRemove:()=>d(void 0)}),l.jsx("input",{ref:z,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:m,onChange:G=>h(G.target.value)}),m&&l.jsx("button",{type:"button",onClick:()=>h(""),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:(y==null?void 0:y.logs.length)??0})," matched",(y==null?void 0:y.truncated)&&l.jsx("span",{className:"text-amber-400 ml-1",children:"· truncated"})]}),l.jsx("span",{children:"·"}),l.jsx(Zi,{lvl:"error",active:r.has("error"),count:Y.counts.error,onClick:M}),l.jsx(Zi,{lvl:"warn",active:r.has("warn"),count:Y.counts.warn,onClick:M}),l.jsx(Zi,{lvl:"info",active:r.has("info"),count:Y.counts.info,onClick:M}),l.jsx(Zi,{lvl:"debug",active:r.has("debug"),count:Y.counts.debug,onClick:M}),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&&!y&&l.jsx("div",{className:"p-8 text-sm text-zinc-500",children:"Loading logs…"}),S&&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?"]}),y&&y.logs.length===0&&l.jsxs("div",{className:"p-8 text-sm text-zinc-500",children:["No logs match these filters."," ",p&&"Live tail is on — new matches will flash brand-green when they land."]}),y&&y.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(ha,{className:"w-[130px]",children:"Time"}),l.jsx(ha,{className:"w-[72px]",children:"Level"}),l.jsx(ha,{className:"w-[200px]",children:"Workflow"}),l.jsx(ha,{className:"w-[150px]",children:"Step"}),l.jsx(ha,{children:"Message"}),l.jsx(ha,{className:"w-[116px]",children:"Run"})]})}),l.jsx("tbody",{children:y.logs.map(G=>l.jsxs("tr",{className:L("border-b border-zinc-800 hover:bg-hover transition-colors",q.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(Rv,{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:L("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:[p?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:(y==null?void 0:y.logs.length)??0})," events shown"]}),(y==null?void 0:y.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 gm({k:s,v:r,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:r}),l.jsx("button",{type:"button",onClick:o,className:"text-zinc-500 hover:text-zinc-100 ml-0.5","aria-label":`Remove ${s}${r} filter`,children:l.jsx(Kt,{className:"w-2.5 h-2.5"})})]})}function Zi({lvl:s,active:r,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:L("inline-flex items-center gap-1.5 px-1.5 py-0.5 rounded transition-colors",r?"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:L("font-medium",o>0?d:"text-zinc-600"),children:o})]})}function Rv({level:s}){const r={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:L("inline-block px-1.5 py-0.5 rounded text-[9.5px] font-semibold uppercase tracking-[0.04em] min-w-[50px] text-center",r[s]),children:s})}function ha({children:s,className:r}){return l.jsx("th",{className:L("text-left text-[10px] uppercase tracking-[0.06em] text-zinc-500 font-semibold px-3 py-2 border-b border-zinc-800",r),children:s})}const Dv=Et("/deployments")({component:Mv});function Mv(){const s=vn(m=>m.current),{data:r,isLoading:o,error:u}=qe({queryKey:["deployments",s],queryFn:()=>gh({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(wl,{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=(r==null?void 0:r.deployments)??[];return d.length===0?l.jsx("div",{className:"p-8",children:l.jsx(Xe,{icon:l.jsx(wl,{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(jl,{children:"Workflow"}),l.jsx(jl,{className:"w-[110px]",children:"Version"}),l.jsx(jl,{className:"w-[110px]",children:"Environment"}),l.jsx(jl,{className:"w-[80px] text-right",children:"Runs"}),l.jsx(jl,{className:"w-[140px]",children:"Success rate"}),l.jsx(jl,{className:"w-[110px] text-right",children:"Avg duration"}),l.jsx(jl,{className:"w-[150px] text-right",children:"Last run"})]})}),l.jsx("tbody",{children:d.map(m=>l.jsx(Av,{deployment:m},`${m.workflowName}-${m.version}-${m.environment}`))})]})})]})}function Av({deployment:s}){const r=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:L("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:L("h-full transition-all",r>=99?"bg-blok-green-500":r>=90?"bg-status-running":"bg-status-failed"),style:{width:`${r}%`}})}),l.jsxs("span",{className:L("font-mono text-[11px] tabular-nums shrink-0",r>=99?"text-blok-green-500":r>=90?"text-zinc-300":"text-status-failed"),children:[r.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:Pn(s.lastRunAt)})]})}function jl({children:s,className:r}){return l.jsx("th",{className:L("text-left text-[10px] uppercase tracking-[0.06em] text-zinc-500 font-semibold px-3 py-2",r),children:s})}const ym=[{type:"stat-card",title:"Stat Card",description:"A single key metric value",icon:l.jsx(rg,{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(Bo,{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(Wn,{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(ja,{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(og,{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(Jm,{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(ug,{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(dg,{className:"w-5 h-5"}),defaultConfig:{},defaultSize:{w:6,h:2}}],Ov=[{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 _v({open:s,onClose:r,onAdd:o}){const[u,d]=R.useState(null),[m,h]=R.useState(""),[p,b]=R.useState("totalRuns");if(!s)return null;const z=ym.find(y=>y.type===u),v=()=>{if(!z)return;const y={id:`w_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`,type:z.type,title:m||z.title,config:{...z.defaultConfig,...z.type==="stat-card"?{metric:p}:{}},position:{x:0,y:100,w:z.defaultSize.w,h:z.defaultSize.h}};o(y),d(null),h(""),b("totalRuns"),r()};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:r,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:m,onChange:y=>h(y.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:z==null?void 0:z.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:p,onChange:y=>b(y.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:Ov.map(y=>l.jsx("option",{value:y.value,children:y.label},y.value))})]})]}):l.jsx("div",{className:"grid grid-cols-2 gap-2",children:ym.map(y=>l.jsxs("button",{type:"button",onClick:()=>{d(y.type),h(y.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:y.icon}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-zinc-200",children:y.title}),l.jsx("div",{className:"text-xs text-zinc-500 mt-0.5",children:y.description})]})]},y.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:r,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:v,className:L("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(Nl,{className:"w-3 h-3"}),"Add Widget"]})]})]})})}function Uv({widget:s,metrics:r}){if(!r)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(Lv,{widget:s,metrics:r});case"timeline":return l.jsx(Ph,{data:r.executionTimeline});case"error-rate":return l.jsx(qv,{metrics:r});case"duration-distribution":return l.jsx(Ih,{data:r.durationDistribution});case"workflow-breakdown":return l.jsx(tx,{data:r.workflowBreakdown});case"node-performance":return l.jsx(ex,{data:r.nodePerformance});case"recent-runs":return l.jsx(Hv,{metrics:r});case"heatmap":return l.jsx(Bv,{metrics:r});default:return l.jsx("div",{className:"flex items-center justify-center h-full text-zinc-600 text-xs",children:"Unknown widget type"})}}function Lv({widget:s,metrics:r}){const o=s.config.metric||"totalRuns",d={totalRuns:{value:String(r.totalRuns)},completedRuns:{value:String(r.completedRuns),color:"text-green-400"},failedRuns:{value:String(r.failedRuns),color:r.failedRuns>0?"text-red-400":void 0},errorRate:{value:In(r.totalRuns>0?r.failedRuns/r.totalRuns:0),color:r.failedRuns>0?"text-red-400":void 0},avgDurationMs:{value:ge(r.avgDurationMs)},p50DurationMs:{value:ge(r.p50DurationMs)},p95DurationMs:{value:ge(r.p95DurationMs)},p99DurationMs:{value:ge(r.p99DurationMs)}}[o]||{value:"N/A"};return l.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:l.jsx("div",{className:L("text-2xl font-bold font-mono",d.color||"text-zinc-100"),children:d.value})})}function qv({metrics:s}){const r=s.totalRuns>0?s.failedRuns/s.totalRuns:0,o=(r*100).toFixed(1),u=r>.1;return l.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2",children:[l.jsxs("div",{className:L("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 Hv({metrics:s}){const r=s.totalRuns,o=s.completedRuns,u=s.failedRuns,d=r-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(r,1)*100}%`}}),u>0&&l.jsx("div",{className:"bg-red-500/70 h-full",style:{width:`${u/Math.max(r,1)*100}%`}})]})]})}function Bv({metrics:s}){const r=s.executionTimeline,o=Math.max(...r.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:r.map(u=>{const d=u.total/o,m=u.failed>0;return l.jsx("div",{className:"w-4 h-4 rounded-sm",style:{backgroundColor:m?`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 Gv({widgets:s,metrics:r,isEditing:o,onRemoveWidget:u,onConfigureWidget:d}){const m=R.useMemo(()=>[...s].sort((h,p)=>h.position.y-p.position.y||h.position.x-p.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:m.map(h=>l.jsxs("div",{className:L("rounded-lg border bg-zinc-900/50 overflow-hidden flex flex-col",o?"border-blue-500/30":"border-zinc-800"),style:{gridColumn:`span ${h.position.w}`,gridRow:`span ${h.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(fg,{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:h.title})]}),o&&l.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[l.jsx("button",{type:"button",onClick:()=>d(h.id),className:"p-0.5 text-zinc-600 hover:text-zinc-300 transition-colors","aria-label":"Configure widget",children:l.jsx(mg,{className:"w-3 h-3"})}),l.jsx("button",{type:"button",onClick:()=>u(h.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(Uv,{widget:h,metrics:r})})]},h.id))})}function Qv(){return qe({queryKey:["dashboards"],queryFn:()=>qh().then(s=>s.dashboards)})}function Yv(){const s=ht();return Lt({mutationFn:r=>Hh(r),onSuccess:()=>{s.invalidateQueries({queryKey:["dashboards"]})}})}function Kv(){const s=ht();return Lt({mutationFn:({id:r,data:o})=>Bh(r,o),onSuccess:(r,o)=>{s.invalidateQueries({queryKey:["dashboards"]}),s.invalidateQueries({queryKey:["dashboard",o.id]})}})}function Xv(){const s=ht();return Lt({mutationFn:r=>Gh(r),onSuccess:()=>{s.invalidateQueries({queryKey:["dashboards"]})}})}function Vv(){const s=ht();return Lt({mutationFn:r=>Qh(r),onSuccess:()=>{s.invalidateQueries({queryKey:["dashboards"]})}})}const Zv=Et("/dashboards")({component:Jv}),$v=[{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 Jv(){const{data:s,isLoading:r}=Qv(),{data:o,isLoading:u}=nx(),d=Yv(),m=Kv(),h=Xv(),p=Vv(),[b,z]=R.useState(null),[v,y]=R.useState(!1),[j,S]=R.useState(!1),[D,q]=R.useState(null),[O,Y]=R.useState(null),[M,G]=R.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;R.useEffect(()=>{if(s&&s.length>0&&!b){const K=s.find(ee=>ee.isDefault)??s[0];K&&z(K.id)}},[s,b]);const X=R.useCallback(()=>{d.mutate({name:"New Dashboard",widgets:$v},{onSuccess:K=>{z(K.id)}})},[d]),Q=R.useCallback(K=>{if(!B)return;const ee=[...B.widgets,K];m.mutate({id:B.id,data:{widgets:ee}})},[B,m]),F=R.useCallback(K=>{if(!B)return;const ee=B.widgets.filter(Be=>Be.id!==K);m.mutate({id:B.id,data:{widgets:ee}})},[B,m]),Z=R.useCallback(K=>{},[]),ae=R.useCallback(K=>{h.mutate(K,{onSuccess:()=>{b===K&&z(null),q(null)}})},[h,b]),_e=R.useCallback(K=>{p.mutate(K,{onSuccess:ee=>{z(ee.id),q(null)}})},[p]),He=R.useCallback(K=>{M.trim()&&m.mutate({id:K,data:{name:M.trim()}},{onSuccess:()=>Y(null)})},[m,M]);return r||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(Vm,{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(Nl,{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:[O===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:M,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:()=>z(K.id),className:L("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:()=>q(D===K.id?null:K.id),className:"p-0.5 text-zinc-600 hover:text-zinc-300 ml-0.5",children:l.jsx(hg,{className:"w-3.5 h-3.5"})}),D===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),q(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(im,{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(Vo,{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(Ko,{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(Nl,{className:"w-3.5 h-3.5"})})]}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[v&&l.jsxs("button",{type:"button",onClick:()=>S(!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(Nl,{className:"w-3 h-3"}),"Add Widget"]}),l.jsx("button",{type:"button",onClick:()=>y(!v),className:L("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",v?"bg-blok-green-500 text-[#00231b] hover:bg-blok-green-600":"bg-zinc-800 text-zinc-300 hover:bg-zinc-700"),children:v?l.jsxs(l.Fragment,{children:[l.jsx(ya,{className:"w-3 h-3"})," Done"]}):l.jsxs(l.Fragment,{children:[l.jsx(im,{className:"w-3 h-3"})," Edit"]})})]})]})}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:B&&l.jsx(Gv,{widgets:B.widgets,metrics:o,isEditing:v,onRemoveWidget:F,onConfigureWidget:Z})}),l.jsx(_v,{open:j,onClose:()=>S(!1),onAdd:Q})]})}function Fv(){const s=Fh(o=>o.events),r=R.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:L("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:L("text-[10px] px-1.5 py-0.5 rounded font-medium shrink-0",Zh[o.type]),children:Vh[o.type]}),l.jsx("span",{className:"text-[10px] text-zinc-600 shrink-0",children:Pn(o.timestamp)})]},o.id)),l.jsx("div",{ref:r})]})}function Wv({workflows:s}){const r=s.reduce((h,p)=>h+p.totalRuns,0),o=s.reduce((h,p)=>h+p.recentRuns,0),u=r>0?s.reduce((h,p)=>h+p.errorRate*p.totalRuns,0)/r:0,d=r>0?s.reduce((h,p)=>h+p.avgDurationMs*p.totalRuns,0)/r:0,m=[{label:"Total Runs",value:r.toLocaleString(),icon:Wn,color:"text-blue-400",bgColor:"bg-blue-400/10"},{label:"Recent (24h)",value:o.toLocaleString(),icon:xg,color:"text-green-400",bgColor:"bg-green-400/10"},{label:"Error Rate",value:In(u),icon:tc,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:pg,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:m.map(h=>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:L("p-1.5 rounded-md",h.bgColor),children:l.jsx(h.icon,{className:L("w-3.5 h-3.5",h.color)})}),l.jsx("span",{className:"text-xs text-zinc-500",children:h.label})]}),l.jsx("div",{className:"text-xl font-semibold text-zinc-100 font-mono",children:h.value})]},h.label))})}function ws({status:s,className:r}){return l.jsxs("span",{className:L("inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",_y[s],r),children:[l.jsx("span",{className:L("w-1.5 h-1.5 rounded-full",Ss[s],s==="running"&&"animate-pulse-dot"),"aria-hidden":"true"}),Uy[s]]})}const Iv={http:Xo,cron:ja,queue:bg,worker:Jm,websocket:cm,sse:cm,webhook:Ns};function Pv({workflow:s}){const r=Iv[s.triggerTypes[0]||"http"]||Xo;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(r,{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(va,{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:L("font-mono",s.errorRate>.05?"text-red-400":"text-zinc-300"),children:In(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(ws,{status:s.lastRunStatus}),s.lastRunAt&&l.jsx("span",{className:"text-[11px] text-zinc-500",children:Pn(s.lastRunAt)})]})]})}function e1(){return qe({queryKey:["routing-diagnostics"],queryFn:()=>zh(),refetchInterval:3e4,staleTime:1e4})}function qo(){const{data:s}=e1(),[r,o]=R.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":r,children:[l.jsx(tc,{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:r?"Click to collapse":"Click to see which workflows + why"})]})]}),r&&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 t1=Et("/")({component:n1});function n1(){const{data:s,isLoading:r,error:o}=Po();return r?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(ba,{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(qo,{}),l.jsx(Xe,{icon:l.jsx(ba,{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(qo,{}),l.jsx(Wv,{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(Pv,{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(Fv,{})})]})]})]})}function l1({className:s}){const{data:r}=qe({queryKey:["concurrency","state"],queryFn:Xh,refetchInterval:5e3,retry:!1}),{data:o}=qe({queryKey:["concurrency","health"],queryFn:Kh,refetchInterval:3e4,retry:!1});if(!r||r.totalLeases===0)return null;const u=[...r.buckets].sort((d,m)=>m.inFlight-d.inFlight);return l.jsxs("div",{className:L("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:[r.totalLeases," across ",r.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 eu=["saved-filters"];function a1(){const{data:s}=qe({queryKey:eu,queryFn:()=>Sh().then(r=>r.filters),refetchInterval:15e3,staleTime:5e3});return s??[]}function s1(){const s=ht();return Lt({mutationFn:r=>wh(r),onSuccess:()=>s.invalidateQueries({queryKey:eu})})}function i1(){const s=ht();return Lt({mutationFn:r=>Eh(r),onSuccess:()=>s.invalidateQueries({queryKey:eu})})}const c1=[{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 lx({status:s,onStatusChange:r,tagsInput:o,onTagsChange:u,metadataInput:d,onMetadataChange:m,className:h}){const[p,b]=R.useState(""),[z,v]=R.useState(""),y=o??p,j=d??z,S=u??b,D=m??v,q=a1(),O=s1(),Y=i1(),[M,G]=R.useState(""),B=F=>{if(G(F),!F)return;const Z=q.find(ae=>ae.name===F);Z&&(r(Z.status),S(Z.tagsInput),D(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&&O.mutate({name:F,status:s,tagsInput:y,metadataInput:j},{onSuccess:()=>G(F)})},Q=()=>{M&&(typeof window<"u"&&!window.confirm(`Delete saved filter "${M}"?`)||Y.mutate(M,{onSuccess:()=>G("")}))};return l.jsxs("div",{className:L("flex flex-wrap items-center gap-3",h),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=>r(F.target.value),className:L("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:c1.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:y,onChange:F=>S(F.target.value),placeholder:"user-123, premium",className:L("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=>D(F.target.value),placeholder:"tier=premium, plan=pro",className:L("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:M,onChange:F=>B(F.target.value),className:L("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 —"}),q.map(F=>l.jsx("option",{value:F.name,children:F.name},F.name))]}),l.jsx("button",{type:"button",onClick:X,className:L("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"}),M&&l.jsx("button",{type:"button",onClick:Q,className:L("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 "${M}"`,"aria-label":`Delete saved filter ${M}`,children:"✕"})]})]})}function r1({selectedIds:s,runs:r,onClear:o}){const u=Cl(),[d,m]=R.useState("idle"),[h,p]=R.useState(null),[b,z]=R.useState(null);if(s.size===0)return null;const y=r.filter(Y=>s.has(Y.id)).filter(Y=>Y.triggerType==="http"),j=y.length>0&&d==="idle",S=s.size===2;async function D(){if(!j)return;m("running"),z(null),p({done:0,total:y.length});const Y=[];for(const B of y){try{const X=await Fo(B.id);Y.push({ok:!0,newRunId:X.newRunId})}catch(X){Y.push({ok:!1,err:X instanceof Error?X.message:String(X)})}p({done:Y.length,total:y.length})}const M=Y.find(B=>B.ok&&B.newRunId),G=Y.filter(B=>!B.ok).length;m("idle"),p(null),G>0&&z(`${G} of ${y.length} replays failed.`),M!=null&&M.newRunId&&(o(),u({to:"/runs/$runId",params:{runId:M.newRunId}}))}function q(){if(!S)return;const[Y,M]=[...s];Y&&M&&u({to:"/runs/diff",search:{a:Y,b:M}})}function O(Y){const M=[...s].slice(0,20);for(const G of M)Y==="json"?Wo(G):Io(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"]}),y.length<s.size&&l.jsxs("span",{className:"font-mono text-[10.5px] text-zinc-500",children:["· ",s.size-y.length," non-HTTP, replay-skip"]}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[h&&l.jsxs("span",{className:"font-mono text-[11px] text-zinc-400",children:[h.done," / ",h.total," replayed"]}),b&&l.jsx("span",{className:"font-mono text-[11px] text-status-failed",children:b}),l.jsxs($i,{onClick:D,disabled:!j,title:j?`Replay ${y.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(Oo,{className:"w-3 h-3"}),"Replay ",y.length>0&&y.length]}),S&&l.jsxs($i,{onClick:q,title:"Compare the two selected runs side-by-side",children:[l.jsx(ys,{className:"w-3 h-3"}),"Compare"]}),l.jsxs($i,{onClick:()=>O("json"),title:"Download a JSON file per selected run (up to 20)",children:[l.jsx(_o,{className:"w-3 h-3"}),"JSON"]}),l.jsxs($i,{onClick:()=>O("csv"),title:"Download a CSV file per selected run (up to 20)",children:[l.jsx(_o,{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 $i({children:s,onClick:r,disabled:o,title:u}){return l.jsx("button",{type:"button",onClick:r,disabled:o,title:u,className:L("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 ax({runs:s,total:r,page:o,limit:u,onPageChange:d,showWorkflow:m=!1,enableCompare:h=!1,enableBulk:p=!1}){const b=Cl(),[z,v]=R.useState([]),[y,j]=R.useState([]),[S,D]=R.useState(()=>new Set);R.useEffect(()=>{if(!p)return;const X=Q=>{Q.target instanceof HTMLInputElement||Q.target instanceof HTMLTextAreaElement||Q.key==="Escape"&&S.size>0&&D(new Set)};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[p,S.size]);const q=X=>{D(Q=>{const F=new Set(Q);return F.has(X)?F.delete(X):F.add(X),F})},O=()=>{D(X=>X.size===s.length?new Set:new Set(s.map(Q=>Q.id)))},Y=()=>{y.length===2&&b({to:"/runs/diff",search:{a:y[0],b:y[1]}})},M=R.useMemo(()=>{const X=[];return p&&X.push({id:"bulk",header:()=>l.jsxs("button",{type:"button",onClick:Q=>{Q.preventDefault(),Q.stopPropagation(),O()},className:L("w-4 h-4 rounded-sm border flex items-center justify-center transition-colors shrink-0",S.size===s.length&&s.length>0?"bg-blok-green-500 border-blok-green-500":S.size>0?"bg-blok-green-500/40 border-blok-green-500/60":"border-zinc-700 hover:border-zinc-500"),title:S.size===s.length?"Deselect all":"Select all",children:[S.size===s.length&&s.length>0&&l.jsx(ya,{className:"w-3 h-3 text-[#00231b]",strokeWidth:3}),S.size>0&&S.size<s.length&&l.jsx("span",{className:"w-1.5 h-0.5 bg-zinc-100 rounded-full"})]}),cell:({row:Q})=>{const F=S.has(Q.original.id);return l.jsx("button",{type:"button",onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),q(Q.original.id)},className:L("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(ya,{className:"w-3 h-3 text-[#00231b]",strokeWidth:3})})},size:36}),h&&!p&&X.push({id:"compare",header:"",cell:({row:Q})=>{const F=y.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:L("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}),m&&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(ws,{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:Pn(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},[m,h,p,y,S,s.length]),G=Ag({data:s,columns:M,state:{sorting:z},onSortingChange:v,getCoreRowModel:_g(),getSortedRowModel:Og()}),B=Math.ceil(r/u);return l.jsxs("div",{children:[p&&l.jsx(r1,{selectedIds:S,runs:s,onClear:()=>D(new Set)}),h&&!p&&y.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(ys,{className:"w-4 h-4 text-zinc-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:[y.length,"/2 runs selected"]}),y.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:L("text-xs text-zinc-500 hover:text-zinc-300 transition-colors",y.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:[wo(Q.column.columnDef.header,Q.getContext()),l.jsx(gg,{className:"w-3 h-3"})]})},Q.id))},X.id))}),l.jsx("tbody",{children:G.getRowModel().rows.map(X=>l.jsx("tr",{className:L("border-b border-zinc-800/50 hover:bg-zinc-800/30 transition-colors cursor-pointer",y.includes(X.original.id)&&"bg-blue-500/5",S.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"?wo(Q.column.columnDef.cell,Q.getContext()):l.jsx(De,{to:"/runs/$runId",params:{runId:X.original.id},className:"block",children:wo(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:[r," total run",r!==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:L("p-1 rounded hover:bg-zinc-800 transition-colors",o<=1?"text-zinc-700 cursor-not-allowed":"text-zinc-400"),children:l.jsx(yg,{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:L("p-1 rounded hover:bg-zinc-800 transition-colors",o>=B?"text-zinc-700 cursor-not-allowed":"text-zinc-400"),children:l.jsx(va,{className:"w-4 h-4"})})]})]})]})}function o1(s){const r=vn(o=>o.current);return qe({queryKey:["runs",r,s],queryFn:()=>hh({...s,env:r}),refetchInterval:3e3})}function u1(s,r){const o=vn(u=>u.current);return qe({queryKey:["workflow-runs",o,s,r],queryFn:()=>mh(s,{...r,env:o}),enabled:!!s,refetchInterval:3e3})}const d1=Et("/runs/")({component:f1});function f1(){const[s,r]=R.useState(""),[o,u]=R.useState(1),d=50,{data:m,isLoading:h}=o1({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(l1,{})]}),l.jsx(lx,{status:s,onStatusChange:r}),h?l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(Oe,{className:"w-5 h-5 text-zinc-500 animate-spin"})}):m&&m.runs.length>0?l.jsx(ax,{runs:m.runs,total:m.total,page:o,limit:d,onPageChange:u,showWorkflow:!0,enableBulk:!0}):s?l.jsx(Xe,{icon:l.jsx(Wn,{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:()=>r(""),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(Wn,{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 sx({onExportJson:s,onExportCsv:r,label:o="Export",size:u="sm"}){const[d,m]=R.useState(!1),h=R.useRef(null);return R.useEffect(()=>{const p=b=>{h.current&&!h.current.contains(b.target)&&m(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),l.jsxs("div",{ref:h,className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>m(!d),className:L("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(_o,{className:u==="sm"?"w-3 h-3":"w-4 h-4"}),o,l.jsx(js,{className:L("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(),m(!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(vg,{className:"w-4 h-4 text-blue-400"}),"Export as JSON"]}),l.jsxs("button",{type:"button",onClick:()=>{r(),m(!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(jg,{className:"w-4 h-4 text-green-400"}),"Export as CSV"]})]})]})}function Qt({data:s,defaultExpanded:r=!0,maxDepth:o=5,className:u}){const d=R.useMemo(()=>s,[s]);return s==null?l.jsx("span",{className:"text-zinc-500 italic text-sm",children:"null"}):l.jsxs("div",{className:L("font-mono text-xs",u),children:[l.jsx("div",{className:"flex items-center justify-end mb-1",children:l.jsx(m1,{text:JSON.stringify(s,null,2)})}),l.jsx(Ho,{value:d,depth:0,expanded:r,maxDepth:o})]})}function m1({text:s}){const[r,o]=R.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:r?l.jsx(ya,{className:"w-3.5 h-3.5 text-green-400"}):l.jsx(Vo,{className:"w-3.5 h-3.5"})})}function Ho({value:s,depth:r,expanded:o,maxDepth:u,keyName:d}){const[m,h]=R.useState(o&&r<u);if(s===null)return l.jsx(Jn,{keyName:d,value:"null",className:"text-zinc-500"});if(s===void 0)return l.jsx(Jn,{keyName:d,value:"undefined",className:"text-zinc-500"});if(typeof s=="string"){const p=s.length>200?`${s.slice(0,200)}…`:s;return l.jsx(Jn,{keyName:d,value:`"${p}"`,className:"text-green-400"})}if(typeof s=="number")return l.jsx(Jn,{keyName:d,value:String(s),className:"text-blue-400"});if(typeof s=="boolean")return l.jsx(Jn,{keyName:d,value:String(s),className:"text-amber-400"});if(Array.isArray(s))return s.length===0?l.jsx(Jn,{keyName:d,value:"[]",className:"text-zinc-400"}):l.jsx(vm,{keyName:d,expanded:m,onToggle:()=>h(!m),bracket:["[","]"],count:s.length,children:s.map((p,b)=>l.jsxs("div",{className:"ml-4",children:[l.jsx(Ho,{value:p,depth:r+1,expanded:o,maxDepth:u}),b<s.length-1&&l.jsx("span",{className:"text-zinc-600",children:","})]},`idx-${b}`))});if(typeof s=="object"){const p=Object.entries(s);return p.length===0?l.jsx(Jn,{keyName:d,value:"{}",className:"text-zinc-400"}):l.jsx(vm,{keyName:d,expanded:m,onToggle:()=>h(!m),bracket:["{","}"],count:p.length,children:p.map(([b,z],v)=>l.jsxs("div",{className:"ml-4",children:[l.jsx(Ho,{value:z,depth:r+1,expanded:o,maxDepth:u,keyName:b}),v<p.length-1&&l.jsx("span",{className:"text-zinc-600",children:","})]},b))})}return l.jsx(Jn,{keyName:d,value:String(s),className:"text-zinc-400"})}function Jn({keyName:s,value:r,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:r})]})}function vm({keyName:s,expanded:r,onToggle:o,bracket:u,count:d,children:m}){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":r,children:[r?l.jsx(js,{className:"w-3 h-3"}):l.jsx(va,{className:"w-3 h-3"}),l.jsx("span",{className:"text-zinc-400",children:u[0]})]}),r?l.jsxs(l.Fragment,{children:[l.jsx("div",{children:m}),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 Fe(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function Yt(s){return Array.isArray(s)?s:[]}function Ce(s){return typeof s=="string"?s:void 0}function h1(s){return typeof s=="boolean"?s:void 0}function ix(s){return typeof s=="number"&&Number.isFinite(s)?s:void 0}function x1(s){return Fe(s)?Fe(s.branch)?"branch":typeof s.subworkflow=="string"?"subworkflow":Fe(s.wait)?"wait":Fe(s.forEach)?"forEach":Fe(s.loop)?"loop":Fe(s.switch)?"switch":Fe(s.tryCatch)?"tryCatch":"regular":"regular"}function p1(){return{nodes:[],edges:[],idCounter:0}}function nt(s,r){return s.idCounter+=1,`${r}-${s.idCounter}`}function lt(s,r,o){s.nodes.push({id:r,data:o})}function at(s,r,o,u){const d=`${r}__${o}__${s.edges.length}`;s.edges.push({id:d,source:r,target:o,...u})}function b1(s){if(!Fe(s))return{label:"Trigger"};for(const[r,o]of Object.entries(s))if(Fe(o))switch(r){case"http":{const u=Ce(o.method)??"ANY",d=Ce(o.path);return{label:`HTTP · ${u}`,sublabel:d}}case"worker":return{label:"Worker",sublabel:Ce(o.queue)};case"cron":return{label:"Cron",sublabel:Ce(o.schedule)};case"webhook":return{label:"Webhook",sublabel:Ce(o.path)};case"grpc":return{label:"gRPC",sublabel:[Ce(o.service),Ce(o.method)].filter(Boolean).join(".")};default:return{label:r}}return{label:"Trigger"}}function cx(s,r=40){const o=Ce(s);if(o!==void 0)return o.length<=r?o:`${o.slice(0,r-1)}…`}function Sl(s){const r=Ce(s);if(r!==void 0)return r;if(s==null)return"—";try{const o=JSON.stringify(s);return o.length>40?`${o.slice(0,39)}…`:o}catch{return String(s)}}function g1(s,r){const o=nt(r,"step"),u=Ce(s.id),d=Ce(s.use),m=Ce(s.runtime)??Ce(s.type);return lt(r,o,{kind:"regular",label:u??d??"step",sublabel:d,meta:{stepId:u,nodeRef:d,runtime:m,raw:s}}),{entry:o,exit:o}}function y1(s,r){const o=nt(r,"subworkflow"),u=Ce(s.id),d=Ce(s.subworkflow)??"?",m=h1(s.wait),h=Array.isArray(s.allowList)?s.allowList.filter(p=>typeof p=="string"):void 0;return lt(r,o,{kind:"subworkflow",label:u??`↳ ${d}`,sublabel:`↳ ${d}${m===!1?" (async)":""}`,meta:{stepId:u,expression:d,wait:m,allowList:h,raw:s}}),{entry:o,exit:o}}function v1(s,r){const o=nt(r,"wait"),u=Ce(s.id),d=Fe(s.wait)?s.wait:{},m=d.for,h=d.until;let p="wait";return m!==void 0?p=`wait ${Sl(m)}`:h!==void 0&&(p=`wait until ${Sl(h)}`),lt(r,o,{kind:"wait",label:u??p,sublabel:u?p:void 0,meta:{stepId:u,raw:s}}),{entry:o,exit:o}}function j1(s,r){const o=Fe(s.branch)?s.branch:{},u=nt(r,"branch"),d=nt(r,"merge"),m=Ce(s.id),h=Ce(o.when);lt(r,u,{kind:"branch",label:m??"branch",sublabel:h?`when ${cx(h)}`:"when ?",meta:{stepId:m,expression:h,raw:s}}),lt(r,d,{kind:"merge",label:""});const p=Yt(o.then),b=Yt(o.else),z=Wt(p,u,r,{entryLabel:"then"});if(at(r,z,d),b.length>0){const v=Wt(b,u,r,{entryLabel:"else",entryStyle:"dashed"});at(r,v,d,{style:"dashed"})}else at(r,u,d,{label:"else",style:"dashed"});return{entry:u,exit:d}}function N1(s,r){const o=Fe(s.switch)?s.switch:{},u=nt(r,"switch"),d=nt(r,"merge"),m=Ce(s.id),h=o.on;lt(r,u,{kind:"switch",label:m??"switch",sublabel:`on ${Sl(h)}`,meta:{stepId:m,expression:Sl(h),raw:s}}),lt(r,d,{kind:"merge",label:""});const p=Yt(o.cases);for(const z of p){if(!Fe(z))continue;const v=`when ${Sl(z.when)}`,y=Wt(Yt(z.do),u,r,{entryLabel:v});at(r,y,d)}const b=Yt(o.default);if(b.length>0){const z=Wt(b,u,r,{entryLabel:"default",entryStyle:"dashed"});at(r,z,d,{style:"dashed"})}else p.length>0?at(r,u,d,{label:"default",style:"dashed"}):at(r,u,d);return{entry:u,exit:d}}function z1(s,r){const o=Fe(s.forEach)?s.forEach:{},u=nt(r,"forEach"),d=Ce(s.id),m=Ce(o.as),h=Sl(o.in),p=Ce(o.mode),b=ix(o.concurrency);lt(r,u,{kind:"forEach",label:d??"forEach",sublabel:m?`for each ${m} in ${h}`:`for each in ${h}`,meta:{stepId:d,expression:h,mode:p,concurrency:b,raw:s}});const z=Yt(o.do);if(z.length>0){const v=Wt(z,u,r,{entryLabel:"do"});at(r,v,u,{style:"dotted",backEdge:!0,label:"next"})}return{entry:u,exit:u}}function S1(s,r){const o=Fe(s.loop)?s.loop:{},u=nt(r,"loop"),d=Ce(s.id),m=Ce(o.while)??Sl(o.while),h=ix(o.maxIterations);lt(r,u,{kind:"loop",label:d??"loop",sublabel:`while ${cx(m)}`,meta:{stepId:d,expression:m,maxIterations:h,raw:s}});const p=Yt(o.do);if(p.length>0){const b=Wt(p,u,r,{entryLabel:"do"});at(r,b,u,{style:"dotted",backEdge:!0,label:"loop"})}return{entry:u,exit:u}}function w1(s,r){const o=Fe(s.tryCatch)?s.tryCatch:{},u=nt(r,"tryEnter"),d=nt(r,"catchEnter"),m=nt(r,"merge"),h=Ce(s.id);lt(r,u,{kind:"tryEnter",label:h??"try",meta:{stepId:h,raw:s}}),lt(r,d,{kind:"catchEnter",label:"catch",sublabel:"on error"}),lt(r,m,{kind:"merge",label:""});const p=Yt(o.try),b=p.length>0?Wt(p,u,r):u;at(r,b,m),at(r,u,d,{style:"dashed",label:"throws"});const z=Yt(o.catch),v=z.length>0?Wt(z,d,r):d;at(r,v,m,{style:"dashed"});const y=Yt(o.finally);if(y.length>0){const j=nt(r,"finallyEnter");lt(r,j,{kind:"finallyEnter",label:"finally"}),at(r,m,j);const S=Wt(y,j,r);return{entry:u,exit:S}}return{entry:u,exit:m}}function E1(s,r){if(!Fe(s)){const u=nt(r,"unknown");return lt(r,u,{kind:"regular",label:"(invalid step)"}),{entry:u,exit:u}}switch(x1(s)){case"branch":return j1(s,r);case"subworkflow":return y1(s,r);case"wait":return v1(s,r);case"forEach":return z1(s,r);case"loop":return S1(s,r);case"switch":return N1(s,r);case"tryCatch":return w1(s,r);default:return g1(s,r)}}function Wt(s,r,o,u){let d=r,m=!0;for(const h of s){const{entry:p,exit:b}=E1(h,o);m&&u?at(o,d,p,{label:u.entryLabel,style:u.entryStyle}):at(o,d,p),m=!1,d=b}return d}function T1(s){const r=p1(),o=Fe(s)?s:{},u=nt(r,"trigger"),d=b1(o.trigger);lt(r,u,{kind:"trigger",label:d.label,sublabel:d.sublabel,meta:{raw:o.trigger}});const m=Yt(o.steps),h=Wt(m,u,r),p=nt(r,"end");return lt(r,p,{kind:"end",label:"End"}),at(r,h,p),{nodes:r.nodes,edges:r.edges}}var C1=Ug();const Pi=Gb(C1),k1=200,R1=60,jm=14,D1=80;function M1({definition:s}){const{nodes:r,edges:o}=R.useMemo(()=>O1(s),[s]),u=R.useMemo(()=>({trigger:U1,end:L1,regular:q1,subworkflow:H1,wait:B1,branch:G1,switch:Q1,forEach:Y1,loop:K1,tryEnter:X1,catchEnter:V1,finallyEnter:Z1,merge:$1}),[]);return r.length===0?null:l.jsx("div",{className:"h-[600px] rounded-lg border border-zinc-800 overflow-hidden bg-canvas",children:l.jsxs(Im,{nodes:r,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(Pm,{color:"#27272a",gap:16,size:1}),l.jsx(eh,{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(th,{nodeStrokeColor:"#3f3f46",nodeColor:d=>A1[d.data.kind]??"#52525b",maskColor:"rgba(0,0,0,0.6)",className:"bg-zinc-900! border-zinc-700! rounded-md!"})]})})}const A1={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 Nm(s){return s==="merge"?{width:jm,height:jm}:s==="trigger"||s==="end"?{width:D1,height:40}:{width:k1,height:R1}}function O1(s){const r=T1(s),o=new Pi.graphlib.Graph;o.setDefaultEdgeLabel(()=>({})),o.setGraph({rankdir:"TB",nodesep:40,ranksep:60,acyclicer:"greedy"});for(const m of r.nodes){const{width:h,height:p}=Nm(m.data.kind);o.setNode(m.id,{width:h,height:p})}for(const m of r.edges)o.setEdge(m.source,m.target,{weight:m.backEdge?0:1});Pi.layout(o);const u=r.nodes.map(m=>{const h=o.node(m.id)??{x:0,y:0},{width:p,height:b}=Nm(m.data.kind);return{id:m.id,type:m.data.kind,position:{x:h.x-p/2,y:h.y-b/2},data:m.data,draggable:!1}}),d=r.edges.map(m=>_1(m));return{nodes:u,edges:d}}function _1(s){const r=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:r?"4 4":void 0},type:s.backEdge?"default":"smoothstep"}}function It({icon:s,iconClass:r,title:o,subtitle:u,accent:d}){return l.jsxs("div",{className:L("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:L("w-3.5 h-3.5 shrink-0",r)}),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(El,{type:"target",position:Tl.Top,className:"bg-zinc-600! w-2! h-2! border-0!"}),s,l.jsx(El,{type:"source",position:Tl.Bottom,className:"bg-zinc-600! w-2! h-2! border-0!"})]})}function qt(s){return s.data}function U1(s){const r=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(Cg,{className:"w-3 h-3 text-emerald-400"}),l.jsx("span",{className:"text-[11px] font-semibold text-emerald-200 truncate",children:r.label})]}),r.sublabel&&l.jsx("div",{className:"text-[10px] text-emerald-400/70 mt-0.5 truncate font-mono",children:r.sublabel})]}))}function L1(s){const r=qt(s);return l.jsxs(l.Fragment,{children:[l.jsx(El,{type:"target",position:Tl.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(ec,{className:"w-3 h-3 text-zinc-400"}),l.jsx("span",{className:"text-[11px] font-semibold text-zinc-300",children:r.label})]})})]})}function q1(s){const r=qt(s);return Xt(l.jsx(It,{icon:Tg,iconClass:"text-zinc-400",title:r.label,subtitle:r.sublabel,accent:"border-zinc-700"}))}function H1(s){var m;const r=qt(s),o=(m=r.meta)==null?void 0:m.expression,u=typeof o=="string"&&!o.startsWith("$.")&&!o.startsWith("js/")&&!o.startsWith("{")&&o.length>0,d=l.jsx(It,{icon:Eg,iconClass:"text-indigo-400",title:r.label,subtitle:r.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 B1(s){const r=qt(s);return Xt(l.jsx(It,{icon:ja,iconClass:"text-amber-300",title:r.label,subtitle:r.sublabel,accent:"border-amber-500/40"}))}function G1(s){const r=qt(s);return Xt(l.jsx(It,{icon:wl,iconClass:"text-yellow-300",title:r.label,subtitle:r.sublabel,accent:"border-yellow-500/50"}))}function Q1(s){const r=qt(s);return Xt(l.jsx(It,{icon:wg,iconClass:"text-orange-300",title:r.label,subtitle:r.sublabel,accent:"border-orange-500/50"}))}function Y1(s){const r=qt(s);return Xt(l.jsx(It,{icon:Sg,iconClass:"text-violet-300",title:r.label,subtitle:r.sublabel,accent:"border-violet-500/50"}))}function K1(s){const r=qt(s);return Xt(l.jsx(It,{icon:zg,iconClass:"text-violet-300",title:r.label,subtitle:r.sublabel,accent:"border-violet-500/50"}))}function X1(s){const r=qt(s);return Xt(l.jsx(It,{icon:Fm,iconClass:"text-red-300",title:r.label,subtitle:r.sublabel,accent:"border-red-500/40"}))}function V1(s){const r=qt(s);return Xt(l.jsx(It,{icon:Ng,iconClass:"text-red-400",title:r.label,subtitle:r.sublabel,accent:"border-red-500/60"}))}function Z1(s){const r=qt(s);return Xt(l.jsx(It,{icon:Fm,iconClass:"text-orange-300",title:r.label,subtitle:r.sublabel,accent:"border-orange-500/40"}))}function $1(s){return l.jsxs(l.Fragment,{children:[l.jsx(El,{type:"target",position:Tl.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(El,{type:"source",position:Tl.Bottom,className:"bg-zinc-600! w-1.5! h-1.5! border-0!"})]})}const rx=Et("/workflows/$name")({component:J1});function J1(){var D,q;const{name:s}=rx.useParams(),[r,o]=R.useState(""),[u,d]=R.useState(1),[m,h]=R.useState("runs"),p=25,{data:b,isLoading:z}=Ay(s),v=Oy(s),{data:y,isLoading:j}=u1(s,{status:r||void 0,limit:p,offset:(u-1)*p});if(z)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(ba,{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 S=[{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(Zo,{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)," · ",In(b.errorRate)," errors"]})]}),l.jsx(F1,{source:(D=b.examples)==null?void 0:D.source,onRerecord:()=>v.mutate(),pending:v.isPending,error:v.error})]}),l.jsx(qo,{}),l.jsx("div",{className:"flex gap-0 border-b border-zinc-800",children:S.map(O=>l.jsx("button",{type:"button",onClick:()=>h(O.key),className:L("px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px",m===O.key?"border-blok-green-500 text-zinc-100":"border-transparent text-zinc-500 hover:text-zinc-300"),children:O.label},O.key))}),m==="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(lx,{status:r,onStatusChange:o})}),l.jsx(sx,{onExportJson:()=>Ah({workflow:s,status:r||void 0}),onExportCsv:()=>Oh({workflow:s,status:r||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"})}):y&&y.runs.length>0?l.jsx(ax,{runs:y.runs,total:y.total,page:u,limit:p,onPageChange:d,enableCompare:!0}):r?l.jsx(Xe,{icon:l.jsx(ba,{className:"w-10 h-10"}),title:`No ${r} runs match`,description:`Across the loaded window, none of ${b.name}'s runs have status "${r}". 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(ba,{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:W1((q=b.examples)==null?void 0:q.source),code:I1(b)}]})]}),m==="graph"&&(b.definition?l.jsx(M1,{definition:b.definition}):l.jsx(Xe,{icon:l.jsx(wl,{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.']})})),m==="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}})}),m==="metrics"&&l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[l.jsx(Fn,{label:"Total Runs",value:String(b.totalRuns)}),l.jsx(Fn,{label:"Recent (24h)",value:String(b.recentRuns)}),l.jsx(Fn,{label:"Avg Duration",value:ge(b.avgDurationMs)}),l.jsx(Fn,{label:"P95 Duration",value:ge(b.p95DurationMs)}),l.jsx(Fn,{label:"Error Rate",value:In(b.errorRate)}),l.jsx(Fn,{label:"Runtimes",value:b.runtimes.join(", ")||"—"}),l.jsx(Fn,{label:"Nodes",value:String(b.nodeNames.length)}),l.jsx(Fn,{label:"Triggers",value:b.triggerTypes.join(", ")})]})]})}function Fn({label:s,value:r}){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:r})]})}function F1({source:s,onRerecord:r,pending:o,error:u}){if(!s)return null;const m={author:"Sample: author-declared",recorded:"Sample: recorded from a real run",inferred:"Sample: inferred from step inputs",empty:"Sample: none"}[s]??"Sample: ?",h=u instanceof Jo||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:m}),s==="recorded"&&l.jsxs("button",{type:"button",onClick:r,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(Yo,{className:"w-3 h-3"}),l.jsx("span",{children:o?"Clearing…":"Re-record"})]}),h&&l.jsx("span",{className:"text-status-failed text-[11px]",title:h,children:h})]})}function W1(s){return s==="author"?"curl · http (example body)":s==="recorded"?"curl · http (recorded body)":"curl · http"}function I1(s){var h;const r=P1(s.definition),o=((r==null?void 0:r.method)??"POST").toUpperCase(),u=(r==null?void 0:r.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 m=JSON.stringify(((h=s.examples)==null?void 0:h.body)??{},null,2);return`curl -X ${o} ${d} \\
|
|
36
|
+
-H 'content-type: application/json' \\
|
|
37
|
+
-d '${m}'`}function P1(s){if(!s||typeof s!="object")return null;const r=s.trigger;if(!r||typeof r!="object")return null;const o=r.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 ox({ms:s,running:r,className:o}){return l.jsxs("span",{className:L("inline-flex items-center gap-1 text-xs font-mono",r?"text-blue-400":"text-zinc-400",o),children:[l.jsx(ja,{className:"w-3 h-3"}),r?l.jsx(ej,{startedAt:s||Date.now()}):ge(s)]})}function ej({startedAt:s}){const[r,o]=R.useState(Date.now()-s);return R.useEffect(()=>{const u=setInterval(()=>o(Date.now()-s),100);return()=>clearInterval(u)},[s]),l.jsx(l.Fragment,{children:ge(r)})}function tj({runA:s,runB:r}){const[o,u]=R.useState("overview"),[d,m]=R.useState(null),h=[{key:"overview",label:"Overview"},{key:"nodes",label:"Node Comparison"},{key:"outputs",label:"Output Diff"}],p=R.useMemo(()=>{const b=new Map,z=new Map;for(const y of s.nodes)b.set(y.nodeName,y);for(const y of r.nodes)z.set(y.nodeName,y);const v=new Set([...b.keys(),...z.keys()]);return Array.from(v).map(y=>({name:y,nodeA:b.get(y),nodeB:z.get(y)}))},[s.nodes,r.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(zm,{run:s,label:"Run A"}),l.jsx(zm,{run:r,label:"Run B"})]}),l.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[l.jsx(Ji,{label:"Duration",valueA:ge(s.run.durationMs),valueB:ge(r.run.durationMs),comparison:sj(s.run.durationMs,r.run.durationMs)}),l.jsx(Ji,{label:"Status",valueA:s.run.status,valueB:r.run.status,comparison:s.run.status===r.run.status?"same":"different"}),l.jsx(Ji,{label:"Nodes",valueA:`${s.run.completedNodes}/${s.run.nodeCount}`,valueB:`${r.run.completedNodes}/${r.run.nodeCount}`,comparison:s.run.completedNodes===r.run.completedNodes?"same":"different"}),l.jsx(Ji,{label:"Errors",valueA:s.run.error?"Yes":"No",valueB:r.run.error?"Yes":"No",comparison:!s.run.error&&!r.run.error||s.run.error&&r.run.error?"same":"different"})]}),l.jsx("div",{className:"flex gap-0 border-b border-zinc-800",children:h.map(b=>l.jsx("button",{type:"button",onClick:()=>u(b.key),className:L("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(nj,{runA:s,runB:r,nodeComparison:p}),o==="nodes"&&l.jsx(lj,{nodeComparison:p,selectedNode:d,onSelectNode:m,runA:s,runB:r}),o==="outputs"&&l.jsx(aj,{nodeComparison:p})]})}function zm({run:s,label:r}){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:r}),l.jsx(ws,{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(ja,{className:"w-3 h-3"}),l.jsx("span",{className:"text-zinc-400",children:lc(s.run.startedAt)})]}),l.jsxs("div",{children:["Duration: ",l.jsx(ox,{ms:s.run.durationMs})]}),l.jsxs("div",{children:["Nodes:"," ",l.jsxs("span",{className:"text-zinc-400",children:[s.run.completedNodes,"/",s.run.nodeCount]})]})]})]})}function Ji({label:s,valueA:r,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:r}),l.jsx(Qo,{className:"w-3 h-3 text-zinc-600"}),l.jsx("span",{className:L("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 nj({runA:s,runB:r,nodeComparison:o}){const u=Math.max(...[...s.nodes,...r.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:m,nodeB:h})=>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"}),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:L("h-full rounded transition-all",m.status==="completed"&&"bg-green-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"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] text-zinc-600 w-6",children:"B"}),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:L("h-full rounded transition-all",h.status==="completed"&&"bg-blue-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"})]})]})]},d))})]})}function lj({nodeComparison:s,selectedNode:r,onSelectNode:o,runA:u,runB:d}){const m=s.find(h=>h.name===r);return l.jsxs("div",{className:"flex gap-4",children:[l.jsx("div",{className:"w-64 space-y-1",children:s.map(({name:h,nodeA:p,nodeB:b})=>{const z=(p==null?void 0:p.status)===(b==null?void 0:b.status),v=(p==null?void 0:p.durationMs)!==void 0&&(b==null?void 0:b.durationMs)!==void 0?b.durationMs-p.durationMs:null;return l.jsxs("button",{type:"button",onClick:()=>o(r===h?null:h),className:L("w-full text-left rounded-md px-3 py-2 text-sm transition-colors",r===h?"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:[z?l.jsx(ec,{className:"w-3 h-3 text-green-500 shrink-0"}):p&&b?l.jsx(kg,{className:"w-3 h-3 text-amber-500 shrink-0"}):l.jsx(Zm,{className:"w-3 h-3 text-red-500 shrink-0"}),l.jsx("span",{className:"truncate",children:h})]}),v!==null&&l.jsx("div",{className:"text-[10px] mt-0.5 ml-5",children:l.jsxs("span",{className:L("font-mono",v>0?"text-red-400":v<0?"text-green-400":"text-zinc-600"),children:[v>0?"+":"",ge(Math.abs(v))]})})]},h)})}),l.jsx("div",{className:"flex-1",children:m?l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(Sm,{node:m.nodeA,label:"Run A",logs:u.logs.filter(h=>h.nodeName===m.name)}),l.jsx(Sm,{node:m.nodeB,label:"Run B",logs:d.logs.filter(h=>h.nodeName===m.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 Sm({node:s,label:r,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:r}),l.jsx(ws,{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:L(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:[r,": Not present in this run"]})}function aj({nodeComparison:s}){const r=s.filter(({nodeA:o,nodeB:u})=>(o==null?void 0:o.outputs)!==void 0||(u==null?void 0:u.outputs)!==void 0);return r.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:r.map(({name:o,nodeA:u,nodeB:d})=>{const m=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}),m?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 sj(s,r){if(s===void 0||r===void 0)return"different";if(s===r)return"same";const o=Math.abs(r-s),u=Math.max(s,r)*.1;return o<u?"same":r<s?"better":"worse"}const ux=Et("/runs/diff")({validateSearch:s=>({a:s.a,b:s.b}),component:ij});function ij(){const{a:s,b:r}=ux.useSearch(),{data:o,isLoading:u,error:d}=zv(s||"",r||"");return!s||!r?l.jsx("div",{className:"p-6",children:l.jsx(Xe,{icon:l.jsx(ys,{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(ys,{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(Zo,{className:"w-4 h-4"})}),l.jsx(ys,{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(tj,{runA:o.runA,runB:o.runB})})]})}function cj({runId:s,tags:r}){const[o,u]=R.useState(!1),[d,m]=R.useState(""),h=Sv(s),p=wv(s),b=()=>{const v=d.trim();if(!v||r.includes(v)){m("");return}h.mutate([v],{onSuccess:()=>{m(""),u(!1)}})},z=v=>{v.key==="Enter"?(v.preventDefault(),b()):v.key==="Escape"&&(u(!1),m(""))};return l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[l.jsx(Rg,{className:"w-3 h-3 text-zinc-600 shrink-0"}),r.map(v=>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:[v,l.jsx("button",{type:"button",onClick:()=>p.mutate(v),className:"opacity-0 group-hover:opacity-100 transition-opacity hover:text-zinc-200",title:`Remove tag "${v}"`,children:l.jsx(Kt,{className:"w-2.5 h-2.5"})})]},v)),o?l.jsx("input",{type:"text",value:d,onChange:v=>m(v.target.value),onKeyDown:z,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:L("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(Nl,{className:"w-2.5 h-2.5"}),"tag"]})]})}function dx({runId:s,nodeId:r,compact:o}){const[u,d]=R.useState("idle"),[m,h]=R.useState(""),[p,b]=R.useState(""),[z,v]=R.useState(""),y=async()=>{d("loading"),v("");try{const S=await Yh(s,r);h(S.explanation),b(S.model),d("done")}catch(S){v(S instanceof Error?S.message:"Failed to get explanation"),d("error")}},j=()=>{d("idle"),h(""),b(""),v("")};return u==="idle"?l.jsxs("button",{type:"button",onClick:y,className:L("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(So,{className:"w-3 h-3"}),"Explain Error"]}):u==="loading"?l.jsxs("div",{className:L("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:L("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($m,{className:"w-3.5 h-3.5 text-amber-400 shrink-0"}),l.jsx("span",{className:"text-xs text-amber-300",children:z}),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:y,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(So,{className:"w-3 h-3"}),"Try Again"]})]}):l.jsxs("div",{className:L("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(So,{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:["(",p,")"]})]}),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(rj,{content:m})})]})}function rj({content:s}){var u;const r=s.split(`
|
|
38
|
+
`),o=[];for(let d=0;d<r.length;d++){const m=r[d]??"";if(m.startsWith("### "))o.push(l.jsx("h4",{className:"text-sm font-semibold text-zinc-200 mt-3 mb-1",children:m.slice(4)},d));else if(m.startsWith("## "))o.push(l.jsx("h3",{className:"text-sm font-bold text-zinc-100 mt-3 mb-1",children:m.slice(3)},d));else if(m.startsWith("# "))o.push(l.jsx("h2",{className:"text-base font-bold text-zinc-100 mt-3 mb-1",children:m.slice(2)},d));else if(m.startsWith("- ")||m.startsWith("* "))o.push(l.jsx("li",{className:"ml-4 list-disc text-zinc-300",children:l.jsx(Ro,{text:m.slice(2)})},d));else if(/^\d+\.\s/.test(m)){const h=m.replace(/^\d+\.\s/,"");o.push(l.jsx("li",{className:"ml-4 list-decimal text-zinc-300",children:l.jsx(Ro,{text:h})},d))}else if(m.startsWith("```")){const h=[];for(d++;d<r.length&&!((u=r[d])!=null&&u.startsWith("```"));)h.push(r[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:h.join(`
|
|
39
|
+
`)},d))}else m.trim()===""?o.push(l.jsx("br",{},d)):o.push(l.jsx("p",{className:"text-zinc-300 my-0.5",children:l.jsx(Ro,{text:m})},d))}return l.jsx(l.Fragment,{children:o})}function Ro({text:s}){const r=s.split(/(\*\*.*?\*\*|`[^`]+`)/g);return l.jsx(l.Fragment,{children:r.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 oj({error:s,stepName:r,stepIndex:o,totalSteps:u,runtimeKind:d,transport:m,finishedAt:h,runId:p,nodeId:b}){const z=!!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(Em,{category:s.category}),l.jsx(xj,{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(Yo,{className:"w-2.5 h-2.5"}),"retryable",typeof s.retryAfterMs=="number"&&s.retryAfterMs>0&&l.jsxs("span",{className:"opacity-70",children:["· ",mj(s.retryAfterMs)]})]}),l.jsxs("span",{className:"ml-auto text-zinc-500 truncate",children:["step ",l.jsx("span",{className:"text-zinc-200 font-medium",children:r}),d&&l.jsxs("span",{className:"text-zinc-600",children:[" · ",d]}),m&&l.jsxs("span",{className:"text-zinc-600",children:[" · ",m]}),h&&l.jsxs("span",{className:"text-zinc-600",children:[" · ",new Date(h).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(uj,{code:s.code,message:s.message})}),(s.description||z)&&l.jsx("p",{className:"text-[13px] text-zinc-300 leading-relaxed font-mono whitespace-pre-wrap max-w-3xl",children:s.description??dj(s)})]}),l.jsxs("section",{className:"px-8 py-6 space-y-6",children:[s.remediation&&l.jsxs("div",{children:[l.jsx(gs,{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(Dg,{className:"w-3.5 h-3.5"}),fj(s.docUrl)]})]})]}),l.jsxs("div",{children:[l.jsx(gs,{children:"AI explain"}),l.jsx("div",{className:"rounded-md bg-overlay border border-zinc-800 px-4 py-3",children:l.jsx(dx,{runId:p,nodeId:b,compact:!0})})]}),s.details!==void 0&&s.details!==null&&l.jsxs("div",{children:[l.jsx(gs,{children:"Details"}),l.jsx(wm,{snapshot:s.details})]}),s.causes&&s.causes.length>0&&l.jsxs("div",{children:[l.jsxs(gs,{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((v,y)=>{const j=v.code??"uncoded",S=v.message??"",D=v.category,q=j==="uncoded"&&!S?`uncoded-${y}`:`${j}::${S.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(Em,{category:D,compact:!0})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-zinc-100 truncate",children:j}),S&&l.jsx("div",{className:"text-zinc-400 text-[11.5px] mt-0.5 break-words",children:S})]}),l.jsxs("span",{className:"text-zinc-600 text-[11px]",children:["#",y+1]})]},q)})]})]}),s.contextSnapshot!==void 0&&s.contextSnapshot!==null&&l.jsxs("div",{children:[l.jsx(gs,{children:"Context snapshot"}),l.jsx(wm,{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})]}),!z&&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 gs({children:s}){return l.jsx("h3",{className:"text-[11px] uppercase tracking-[0.08em] text-zinc-500 font-semibold mb-2",children:s})}function uj({code:s,message:r}){const o=/\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+|localhost:\d+)\b/,u=r.match(o),d=u?r.slice(0,u.index):r,m=u?u[0]:"",h=u?r.slice((u.index??0)+m.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}),m&&l.jsx("span",{className:"text-blok-green-500",children:m}),l.jsx("span",{className:"text-zinc-300",children:h})]})}function dj(s){const r=s.category;return r==="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.":r==="TIMEOUT"?"The step exceeded its allowed runtime. This is usually a downstream slowness signal, not a bug in the node itself.":r==="VALIDATION"?"The step's input failed schema validation. Inputs are checked against the node's Zod schema before `execute()` is called.":r==="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 fj(s){try{const r=new URL(s);return`${r.host}${r.pathname}`.replace(/\/+$/,"")}catch{return s}}function mj(s){if(s<1e3)return`${s}ms`;const r=Math.round(s/1e3);return r<90?`${r}s`:`${Math.round(r/60)}m`}function wm({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 r=Object.entries(s),o=r.filter(([,d])=>d==null||typeof d!="object"),u=r.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,m],h)=>l.jsxs("div",{className:L("px-4 py-2.5 font-mono text-[11.5px]","border-zinc-800",h%2===0?"border-r":"",h<o.length-2?"border-b":"",o.length%2===1&&h===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:hj(m)})]},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 hj(s){return s==null?"—":typeof s=="string"?s:typeof s=="number"?String(s):typeof s=="boolean"?s?"true":"false":JSON.stringify(s)}function Em({category:s,compact:r}){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:L("font-mono uppercase tracking-[0.06em] font-semibold rounded-full border",r?"text-[10px] px-2 py-0.5":"text-[10px] px-2.5 py-0.5",u),children:s})}function xj({severity:s}){if(!s)return null;const r={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:L("font-mono text-[10px] uppercase tracking-[0.06em] font-semibold rounded-full border px-2.5 py-0.5",r[s]??r.ERROR),children:s})}function pj({node:s,logs:r,totalSteps:o,transport:u}){var z;const[d,m]=R.useState({input:!0,output:!0,logs:!1,live:!0});R.useEffect(()=>{m({input:!0,output:!0,logs:!1,live:!0})},[s.id]);const h=r.filter(v=>v.nodeId===s.id||v.nodeName===s.nodeName),p=!!s.error,b=u??gj(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(bj,{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(Wi,{children:s.nodeType}),b&&l.jsx(Wi,{accent:!0,children:b}),s.runtimeKind&&l.jsx(Wi,{children:s.runtimeKind}),((z=s.metrics)==null?void 0:z.request_bytes)!=null&&l.jsxs(Wi,{children:[l.jsx("span",{className:"text-zinc-500",children:"req"})," ",yj(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(v=>l.jsxs("li",{className:"flex items-start gap-3 font-mono",children:[l.jsxs("span",{className:"text-zinc-500 shrink-0",children:["#",v.attempt]}),l.jsx("span",{className:"text-zinc-500 shrink-0",children:new Date(v.timestamp).toISOString().slice(11,23)}),l.jsx("span",{className:"text-status-failed wrap-break-word",children:v.error.message})]},v.timestamp))})]})}),s.progress&&l.jsx("div",{className:"px-8 pt-5",children:l.jsx(vj,{percent:s.progress.percent,phase:s.progress.phase})}),s.partialResult&&l.jsx("div",{className:"px-8 pt-5",children:l.jsx(Fi,{title:"Partial result",subtitle:"live",open:d.live,onToggle:()=>m(v=>({...v,live:!v.live})),children:l.jsx(Qt,{data:s.partialResult.snapshot,defaultExpanded:!1})})}),p&&s.error&&l.jsx(oj,{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}),!p&&l.jsxs("div",{className:"px-8 py-5 space-y-5",children:[s.inputs!==void 0&&s.inputs!==null&&l.jsx(Fi,{title:"Input",subtitle:Tm(s.inputs),open:d.input,onToggle:()=>m(v=>({...v,input:!v.input})),children:l.jsx(Qt,{data:s.inputs,defaultExpanded:!1})}),s.outputs!==void 0&&s.outputs!==null&&l.jsx(Fi,{title:"Output",subtitle:Tm(s.outputs),open:d.output,onToggle:()=>m(v=>({...v,output:!v.output})),children:l.jsx(Qt,{data:s.outputs,defaultExpanded:!1})}),h.length>0&&l.jsx(Fi,{title:"Logs",subtitle:`${h.length} ${h.length===1?"entry":"entries"}`,open:d.logs,onToggle:()=>m(v=>({...v,logs:!v.logs})),children:l.jsx("div",{className:"font-mono text-[11.5px] leading-relaxed max-h-72 overflow-y-auto",children:h.map(v=>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(v.timestamp).toISOString().slice(11,23)}),l.jsx("span",{className:L("uppercase text-[10px] tracking-[0.05em] font-semibold",v.level==="info"&&"text-log-info",v.level==="warn"&&"text-log-warn",v.level==="error"&&"text-log-error",v.level==="debug"&&"text-log-debug"),children:v.level}),l.jsx("span",{className:"text-zinc-200 wrap-break-word",children:v.message})]},v.id))})}),(s.inputs==null||s.inputs===void 0)&&(s.outputs==null||s.outputs===void 0)&&h.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 Fi({title:s,subtitle:r,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(va,{className:L("w-3 h-3 transition-transform shrink-0",o&&"rotate-90")}),l.jsx("span",{children:s}),r&&l.jsx("span",{className:"text-[11px] normal-case tracking-normal text-zinc-600 font-normal ml-auto",children:r})]}),o&&l.jsx("div",{className:"mt-1.5 rounded-md border border-zinc-800 bg-overlay px-4 py-3",children:d})]})}function Wi({children:s,accent:r}){return l.jsx("span",{className:L("font-mono text-[11px] px-2 py-0.5 rounded-full border",r?"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 bj({status:s}){const r={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:L("w-2 h-2 rounded-full shrink-0 translate-y-px",r[s])})}function gj(s){var r;if(s.nodeType==="module"||s.nodeType==="local")return"module";if((r=s.nodeType)!=null&&r.startsWith("runtime."))return"grpc"}function Tm(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 r=Object.keys(s);return`${r.length} ${r.length===1?"key":"keys"}`}function yj(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}function vj({percent:s,phase:r}){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,"%",r?` · ${r}`:""]})]}),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 jj({runId:s}){const{data:r,isLoading:o}=qe({queryKey:["run-events",s],queryFn:()=>ph(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"})}):!r||r.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:r.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:lc(u.timestamp).split(", ")[1]}),l.jsx("span",{className:L("text-[10px] px-1.5 py-0.5 rounded font-medium shrink-0",Zh[u.type]),children:Vh[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 Do(s){return s==null?"—":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}function Cm(s){return s==null?"—":s<1?`${s.toFixed(2)} ms`:s<1e3?`${s.toFixed(1)} ms`:`${(s/1e3).toFixed(2)} s`}function Nj({node:s,logs:r}){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(km,{})]});const o=s.metrics??{},u=r.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(xa,{label:"Wall",value:Cm(s.durationMs)}),l.jsx(xa,{label:"Wire",value:o.request_bytes!=null||o.response_bytes!=null?`${Do(o.request_bytes)} → ${Do(o.response_bytes)}`:"—",dim:o.request_bytes==null&&o.response_bytes==null}),l.jsx(xa,{label:"CPU",value:Cm(o.cpu_ms),dim:!o.cpu_ms}),l.jsx(xa,{label:"Memory",value:Do(o.memory_bytes),dim:!o.memory_bytes}),l.jsx(xa,{label:"Depth",value:String(s.depth)}),l.jsx(xa,{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:L("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(km,{})]})}function xa({label:s,value:r,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:L("font-mono text-sm font-medium",o?"text-zinc-600":"text-zinc-100"),children:r})]})}function km(){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(Ii,{children:"j"}),l.jsx(Ii,{children:"k"})," step"]}),l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(Ii,{children:"1-5"})," mode"]}),l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(Ii,{children:"Esc"})," deselect"]})]})}function Ii({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 zj({logs:s,nodeNames:r}){const[o,u]=R.useState(""),[d,m]=R.useState(""),[h,p]=R.useState(!0),b=R.useRef(null),z=R.useMemo(()=>s.filter(v=>!(o&&v.level!==o||d&&v.nodeName!==d)),[s,o,d]);return R.useEffect(()=>{h&&b.current&&(b.current.scrollTop=b.current.scrollHeight)},[z.length,h]),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:v=>u(v.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"})]}),r.length>0&&l.jsxs("select",{value:d,onChange:v=>m(v.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"}),r.map(v=>l.jsx("option",{value:v,children:v},v))]}),l.jsx("div",{className:"ml-auto",children:l.jsxs("button",{type:"button",onClick:()=>p(!h),className:L("flex items-center gap-1 px-2 py-1 rounded text-xs transition-colors",h?"bg-blue-600/20 text-blue-400":"text-zinc-500 hover:text-zinc-300"),children:[l.jsx(Mg,{className:"w-3 h-3"}),"Auto-scroll"]})})]}),l.jsx("div",{ref:b,className:"flex-1 overflow-y-auto font-mono text-xs",children:z.length===0?l.jsx("div",{className:"text-center py-8 text-zinc-600 text-xs",children:"No log entries"}):z.map(v=>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:lc(v.timestamp).split(", ")[1]}),l.jsx("span",{className:L("text-[10px] uppercase font-bold shrink-0 w-10 pt-0.5",Ly[v.level]),children:v.level}),v.nodeName&&l.jsx("span",{className:"text-[10px] text-zinc-600 shrink-0 truncate w-20 pt-0.5",children:v.nodeName}),l.jsx("span",{className:"text-zinc-300 break-all flex-1",children:v.message})]},v.id))})]})}const Sj=["GET","POST","PUT","PATCH","DELETE"],wj={GET:"text-green-400",POST:"text-blue-400",PUT:"text-amber-400",PATCH:"text-orange-400",DELETE:"text-red-400"};function Ej({defaultMethod:s="GET",defaultPath:r="/",defaultBody:o="",defaultHeaders:u,onClose:d,onRequestSent:m}){const[h,p]=R.useState(s.toUpperCase()),[b,z]=R.useState(r),[v,y]=R.useState(o),[j,S]=R.useState(u?JSON.stringify(u,null,2):"{}"),[D,q]=R.useState(!1),[O,Y]=R.useState(null),[M,G]=R.useState(null),[B,X]=R.useState(!1),[Q,F]=R.useState(!1),[Z,ae]=R.useState(!1),_e=async()=>{q(!0),G(null),Y(null);try{let ee={};try{ee=JSON.parse(j)}catch{}const Be=await Mh({method:h,path:b,headers:ee,body:h!=="GET"&&h!=="HEAD"?v:void 0});Y(Be),m==null||m()}catch(ee){G(ee instanceof Error?ee.message:"Request failed")}finally{q(!1)}},He=()=>{O&&(navigator.clipboard.writeText(O.body),ae(!0),setTimeout(()=>ae(!1),2e3))},K=O&&O.status>=200&&O.status<300?"text-green-400":O&&O.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:h,onChange:ee=>p(ee.target.value),className:L("bg-zinc-800 border border-zinc-700 rounded-md px-2 py-1.5 text-sm font-mono outline-none",wj[h]||"text-zinc-300"),children:Sj.map(ee=>l.jsx("option",{value:ee,children:ee},ee))}),l.jsx("input",{value:b,onChange:ee=>z(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:D||!b,className:L("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",D?"bg-zinc-700 text-zinc-400 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-500"),children:[D?l.jsx(Oe,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(Wm,{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(js,{className:"w-3 h-3"}):l.jsx(va,{className:"w-3 h-3"}),"Headers (JSON)"]}),B&&l.jsx("textarea",{value:j,onChange:ee=>S(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 ..."}'})]}),h!=="GET"&&h!=="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:v,onChange:ee=>y(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"}'})]}),M&&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:M}),O&&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:L("text-sm font-mono font-medium",K),children:O.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(ya,{className:"w-3 h-3 text-green-400"}):l.jsx(Vo,{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(js,{className:"w-3 h-3"}):l.jsx(va,{className:"w-3 h-3"}),"Headers (",Object.keys(O.headers).length,")"]}),Q&&l.jsx("div",{className:"px-3 pb-2",children:Object.entries(O.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:Rm(O.body)?l.jsx(Qt,{data:Rm(O.body),maxDepth:6}):l.jsx("pre",{className:"text-xs font-mono text-zinc-300 whitespace-pre-wrap break-all",children:O.body})})]})]})]})}function Rm(s){try{return JSON.parse(s)}catch{return null}}function pa(s,r,o){let u=o.initialDeps??[],d,m=!0;function h(){var p,b,z;let v;o.key&&((p=o.debug)!=null&&p.call(o))&&(v=Date.now());const y=s();if(!(y.length!==u.length||y.some((D,q)=>u[q]!==D)))return d;u=y;let S;if(o.key&&((b=o.debug)!=null&&b.call(o))&&(S=Date.now()),d=r(...y),o.key&&((z=o.debug)!=null&&z.call(o))){const D=Math.round((Date.now()-v)*100)/100,q=Math.round((Date.now()-S)*100)/100,O=q/16,Y=(M,G)=>{for(M=String(M);M.length<G;)M=" "+M;return M};console.info(`%c⏱ ${Y(q,5)} /${Y(D,5)} ms`,`
|
|
40
|
+
font-size: .6rem;
|
|
41
|
+
font-weight: bold;
|
|
42
|
+
color: hsl(${Math.max(0,Math.min(120-120*O,120))}deg 100% 31%);`,o==null?void 0:o.key)}return o!=null&&o.onChange&&!(m&&o.skipInitialOnChange)&&o.onChange(d),m=!1,d}return h.updateDeps=p=>{u=p},h}function Dm(s,r){if(s===void 0)throw new Error("Unexpected undefined");return s}const Tj=(s,r)=>Math.abs(s-r)<1.01,Cj=(s,r,o)=>{let u;return function(...d){s.clearTimeout(u),u=s.setTimeout(()=>r.apply(this,d),o)}},Mm=s=>{const{offsetWidth:r,offsetHeight:o}=s;return{width:r,height:o}},kj=s=>s,Rj=s=>{const r=Math.max(s.startIndex-s.overscan,0),o=Math.min(s.endIndex+s.overscan,s.count-1),u=[];for(let d=r;d<=o;d++)u.push(d);return u},Dj=(s,r)=>{const o=s.scrollElement;if(!o)return;const u=s.targetWindow;if(!u)return;const d=h=>{const{width:p,height:b}=h;r({width:Math.round(p),height:Math.round(b)})};if(d(Mm(o)),!u.ResizeObserver)return()=>{};const m=new u.ResizeObserver(h=>{const p=()=>{const b=h[0];if(b!=null&&b.borderBoxSize){const z=b.borderBoxSize[0];if(z){d({width:z.inlineSize,height:z.blockSize});return}}d(Mm(o))};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(p):p()});return m.observe(o,{box:"border-box"}),()=>{m.unobserve(o)}},Am={passive:!0},Om=typeof window>"u"?!0:"onscrollend"in window,Mj=(s,r)=>{const o=s.scrollElement;if(!o)return;const u=s.targetWindow;if(!u)return;let d=0;const m=s.options.useScrollendEvent&&Om?()=>{}:Cj(u,()=>{r(d,!1)},s.options.isScrollingResetDelay),h=v=>()=>{const{horizontal:y,isRtl:j}=s.options;d=y?o.scrollLeft*(j&&-1||1):o.scrollTop,m(),r(d,v)},p=h(!0),b=h(!1);o.addEventListener("scroll",p,Am);const z=s.options.useScrollendEvent&&Om;return z&&o.addEventListener("scrollend",b,Am),()=>{o.removeEventListener("scroll",p),z&&o.removeEventListener("scrollend",b)}},Aj=(s,r,o)=>{if(r!=null&&r.borderBoxSize){const u=r.borderBoxSize[0];if(u)return Math.round(u[o.options.horizontal?"inlineSize":"blockSize"])}return s[o.options.horizontal?"offsetWidth":"offsetHeight"]},Oj=(s,{adjustments:r=0,behavior:o},u)=>{var d,m;const h=s+r;(m=(d=u.scrollElement)==null?void 0:d.scrollTo)==null||m.call(d,{[u.options.horizontal?"left":"top"]:h,behavior:o})};class _j{constructor(r){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(m=>{const h=()=>{this._measureElement(m.target,m)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(h):h()})}));return{disconnect:()=>{var d;(d=u())==null||d.disconnect(),o=null},observe:d=>{var m;return(m=u())==null?void 0:m.observe(d,{box:"border-box"})},unobserve:d=>{var m;return(m=u())==null?void 0:m.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:kj,rangeExtractor:Rj,onChange:()=>{},measureElement:Aj,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=pa(()=>(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,m)=>{this.scrollAdjustments=0,this.scrollDirection=m?this.getScrollOffset()<d?"forward":"backward":null,this.scrollOffset=d,this.isScrolling=m,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,m=new Map;for(let h=u-1;h>=0;h--){const p=o[h];if(d.has(p.lane))continue;const b=m.get(p.lane);if(b==null||p.end>b.end?m.set(p.lane,p):p.end<b.end&&d.set(p.lane,!0),d.size===this.options.lanes)break}return m.size===this.options.lanes?Array.from(m.values()).sort((h,p)=>h.end===p.end?h.index-p.index:h.end-p.end)[0]:void 0},this.getMeasurementOptions=pa(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(o,u,d,m,h,p)=>(this.prevLanes!==void 0&&this.prevLanes!==p&&(this.lanesChangedFlag=!0),this.prevLanes=p,this.pendingMeasuredCacheIndexes=[],{count:o,paddingStart:u,scrollMargin:d,getItemKey:m,enabled:h,lanes:p}),{key:!1}),this.getMeasurements=pa(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:o,paddingStart:u,scrollMargin:d,getItemKey:m,enabled:h,lanes:p},b)=>{if(!h)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 z=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===o&&(this.lanesSettling=!1);const v=this.measurementsCache.slice(0,z),y=new Array(p).fill(void 0);for(let j=0;j<z;j++){const S=v[j];S&&(y[S.lane]=j)}for(let j=z;j<o;j++){const S=m(j),D=this.laneAssignments.get(j);let q,O;if(D!==void 0&&this.options.lanes>1){q=D;const B=y[q],X=B!==void 0?v[B]:void 0;O=X?X.end+this.options.gap:u+d}else{const B=this.options.lanes===1?v[j-1]:this.getFurthestMeasurement(v,j);O=B?B.end+this.options.gap:u+d,q=B?B.lane:j%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(j,q)}const Y=b.get(S),M=typeof Y=="number"?Y:this.options.estimateSize(j),G=O+M;v[j]={index:j,start:O,size:M,end:G,key:S,lane:q},y[q]=j}return this.measurementsCache=v,v},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(o,u,d,m)=>this.range=o.length>0&&u>0?Uj({measurements:o,outerSize:u,scrollOffset:d,lanes:m}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=pa(()=>{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,m,h)=>m===null||h===null?[]:o({startIndex:m,endIndex:h,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),m=this.measurementsCache[d];if(!m)return;const h=m.key,p=this.elementsCache.get(h);p!==o&&(p&&this.observer.unobserve(p),this.observer.observe(o),this.elementsCache.set(h,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 m=this.itemSizeCache.get(d.key)??d.size,h=u-m;h!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(d,h,this):d.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=h,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=pa(()=>[this.getVirtualIndexes(),this.getMeasurements()],(o,u)=>{const d=[];for(let m=0,h=o.length;m<h;m++){const p=o[m],b=u[p];d.push(b)}return d},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=o=>{const u=this.getMeasurements();if(u.length!==0)return Dm(u[fx(0,u.length-1,d=>Dm(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 m=this.getSize(),h=this.getScrollOffset();u==="auto"&&(u=o>=h+m?"end":"start"),u==="center"?o+=(d-m)/2:u==="end"&&(o-=m);const p=this.getMaxScrollOffset();return Math.max(Math.min(p,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 m=this.getSize(),h=this.getScrollOffset();if(u==="auto")if(d.end>=h+m-this.options.scrollPaddingEnd)u="end";else if(d.start<=h+this.options.scrollPaddingStart)u="start";else return[h,u];if(u==="end"&&o===this.options.count-1)return[this.getMaxScrollOffset(),u];const p=u==="end"?d.end+this.options.scrollPaddingEnd:d.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(p,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 m=0;const h=10,p=z=>{if(!this.targetWindow)return;const v=this.getOffsetForIndex(o,z);if(!v){console.warn("Failed to get offset for index:",o);return}const[y,j]=v;this._scrollToOffset(y,{adjustments:void 0,behavior:d}),this.targetWindow.requestAnimationFrame(()=>{const S=()=>{if(this.currentScrollToIndex!==o)return;const D=this.getScrollOffset(),q=this.getOffsetForIndex(o,j);if(!q){console.warn("Failed to get offset for index:",o);return}Tj(q[0],D)||b(j)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(S):S()})},b=z=>{this.targetWindow&&this.currentScrollToIndex===o&&(m++,m<h?this.targetWindow.requestAnimationFrame(()=>p(z)):console.warn(`Failed to scroll to index ${o} after ${h} attempts.`))};p(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 m=Array(this.options.lanes).fill(null);let h=u.length-1;for(;h>=0&&m.some(p=>p===null);){const p=u[h];m[p.lane]===null&&(m[p.lane]=p.end),h--}d=Math.max(...m.filter(p=>p!==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(r)}}const fx=(s,r,o,u)=>{for(;s<=r;){const d=(s+r)/2|0,m=o(d);if(m<u)s=d+1;else if(m>u)r=d-1;else return d}return s>0?s-1:0};function Uj({measurements:s,outerSize:r,scrollOffset:o,lanes:u}){const d=s.length-1,m=b=>s[b].start;if(s.length<=u)return{startIndex:0,endIndex:d};let h=fx(0,d,m,o),p=h;if(u===1)for(;p<d&&s[p].end<o+r;)p++;else if(u>1){const b=Array(u).fill(0);for(;p<d&&b.some(v=>v<o+r);){const v=s[p];b[v.lane]=v.end,p++}const z=Array(u).fill(o+r);for(;h>=0&&z.some(v=>v>=o);){const v=s[h];z[v.lane]=v.start,h--}h=Math.max(0,h-h%u),p=Math.min(d,p+(u-1-p%u))}return{startIndex:h,endIndex:p}}const _m=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Lj({useFlushSync:s=!0,...r}){const o=R.useReducer(()=>({}),{})[1],u={...r,onChange:(m,h)=>{var p;s&&h?$b.flushSync(o):o(),(p=r.onChange)==null||p.call(r,m,h)}},[d]=R.useState(()=>new _j(u));return d.setOptions(u),_m(()=>d._didMount(),[]),_m(()=>d._willUpdate()),d}function qj(s){return Lj({observeElementRect:Dj,observeElementOffset:Mj,scrollToFn:Oj,...s})}const Hj=50,Bj=30;function Gj(s){const r=[],o=[];let u=-1;for(const d of s){d.depth<u&&(o.length=d.depth+1);const m=d.iterationIndex;typeof m=="number"&&o[d.depth]!==m&&(r.push({kind:"iteration-header",key:`iter-${d.depth}-${m}-${d.id}`,iterIndex:m,depth:d.depth}),o[d.depth]=m),r.push({kind:"node",node:d}),u=d.depth}return r}function Um({iterIndex:s,depth:r}){return l.jsxs("div",{style:{paddingLeft:`${16+r*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 Qj({nodes:s,activeStepId:r,onSelect:o}){const u=R.useMemo(()=>s.slice().sort((j,S)=>j.stepIndex-S.stepIndex),[s]),d=R.useMemo(()=>Gj(u),[u]),m=s.filter(j=>j.status==="completed").length,h=s.filter(j=>j.status==="failed").length,p=s.filter(j=>j.status==="running").length,b=R.useRef(null),z=d.length>=Hj,v=qj({count:z?d.length:0,getScrollElement:()=>b.current,estimateSize:()=>Bj,overscan:8}),y=(j,S)=>l.jsxs("button",{type:"button",onClick:()=>o(j.id),style:j.depth>0?{paddingLeft:`${16+j.depth*12}px`}:void 0,className:L("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",S?"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:L("w-1.5 h-1.5 rounded-full shrink-0 transition-status",Ss[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:L("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:L("font-mono text-[10.5px] shrink-0",j.status==="failed"?"text-status-failed":S?"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:L("font-mono normal-case tracking-normal",h>0?"text-status-failed":"text-zinc-400"),children:[h>0?`${h} failed`:`${m} / ${s.length}`,p>0&&l.jsxs("span",{className:"text-status-running",children:[" · ",p," running"]})]})]}),z?l.jsx("ul",{className:"relative mt-1 list-none p-0 m-0",style:{height:`${v.getTotalSize()}px`},"aria-label":`${d.length} steps`,children:v.getVirtualItems().map(j=>{const S=d[j.index];if(!S)return null;const D=S.kind==="iteration-header"?S.key:S.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:S.kind==="iteration-header"?l.jsx(Um,{iterIndex:S.iterIndex,depth:S.depth}):y(S.node,S.node.id===r)},D)})}):l.jsx("ul",{className:"mt-1",children:d.map(j=>j.kind==="iteration-header"?l.jsx("li",{children:l.jsx(Um,{iterIndex:j.iterIndex,depth:j.depth})},j.key):l.jsx("li",{children:y(j.node,j.node.id===r)},j.node.id))})]})}const Lm=180,qm=50;function Yj({nodes:s,selectedNodeId:r,onSelectNode:o}){const{flowNodes:u,flowEdges:d}=R.useMemo(()=>{var j;const p=new Pi.graphlib.Graph;p.setDefaultEdgeLabel(()=>({})),p.setGraph({rankdir:"TB",nodesep:30,ranksep:50});for(const S of s)p.setNode(S.id,{width:Lm,height:qm});const b=[...s].sort((S,D)=>S.stepIndex-D.stepIndex);for(let S=1;S<b.length;S++){const D=b[S-1],q=b[S];if(!(!D||!q)){if(q.parentNodeId)p.setEdge(q.parentNodeId,q.id);else if(D.depth===q.depth)p.setEdge(D.id,q.id);else if(q.depth<D.depth)for(let O=S-1;O>=0;O--){const Y=b[O];if(Y&&Y.depth===q.depth){p.setEdge(Y.id,q.id);break}}}}Pi.layout(p);const z=s.map(S=>{const D=p.node(S.id);return{id:S.id,type:"traceNode",position:{x:((D==null?void 0:D.x)||0)-Lm/2,y:((D==null?void 0:D.y)||0)-qm/2},data:{node:S,selected:r===S.id}}}),v=[],y=p.edges();for(const S of y)v.push({id:`${S.v}-${S.w}`,source:S.v,target:S.w,animated:((j=s.find(D=>D.id===S.w))==null?void 0:j.status)==="running",style:{stroke:"#3f3f46",strokeWidth:1.5}});return{flowNodes:z,flowEdges:v}},[s,r]),m=R.useCallback((p,b)=>{o(b.id)},[o]),h=R.useMemo(()=>({traceNode:Kj}),[]);return l.jsx("div",{className:"h-[500px] rounded-lg border border-zinc-800 overflow-hidden",children:l.jsxs(Im,{nodes:u,edges:d,nodeTypes:h,onNodeClick:m,fitView:!0,fitViewOptions:{padding:.2},proOptions:{hideAttribution:!0},minZoom:.3,maxZoom:2,children:[l.jsx(Pm,{color:"#27272a",gap:16,size:1}),l.jsx(eh,{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(th,{nodeStrokeColor:"#3f3f46",nodeColor:p=>{const b=p.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 Kj({data:s}){const{node:r,selected:o}=s;return l.jsxs(l.Fragment,{children:[l.jsx(El,{type:"target",position:Tl.Top,className:"bg-zinc-600! w-2! h-2! border-0!"}),l.jsxs("div",{className:L("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:L("w-2 h-2 rounded-full shrink-0",Ss[r.status],r.status==="running"&&"animate-pulse-dot")}),l.jsx("span",{className:"text-xs font-medium text-zinc-200 truncate",children:r.nodeName})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.runtimeKind&&l.jsx("span",{className:"text-[10px] text-zinc-500",children:r.runtimeKind}),l.jsx("span",{className:"text-[10px] font-mono text-zinc-500 ml-auto",children:r.status==="running"?"...":ge(r.durationMs)})]})]}),l.jsx(El,{type:"source",position:Tl.Bottom,className:"bg-zinc-600! w-2! h-2! border-0!"})]})}const Xj="modulepreload",Vj=function(s){return"/"+s},Hm={},Zj=function(r,o,u){let d=Promise.resolve();if(o&&o.length>0){let h=function(z){return Promise.all(z.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),b=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));d=h(o.map(z=>{if(z=Vj(z),z in Hm)return;Hm[z]=!0;const v=z.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${z}"]${y}`))return;const j=document.createElement("link");if(j.rel=v?"stylesheet":Xj,v||(j.as="script"),j.crossOrigin="",j.href=z,b&&j.setAttribute("nonce",b),document.head.appendChild(j),v)return new Promise((S,D)=>{j.addEventListener("load",S),j.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${z}`)))})}))}function m(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return d.then(h=>{for(const p of h||[])p.status==="rejected"&&m(p.reason);return r().catch(m)})};function $j(s){return qe({queryKey:["run",s],queryFn:()=>xh(s),enabled:!!s})}function Jj(s){return qe({queryKey:["run",s,"subruns"],queryFn:()=>Zj(()=>Promise.resolve().then(()=>My),void 0).then(r=>r.fetchSubRuns(s)),enabled:!!s})}function Fj(s){const r=ht(),o=zl(h=>h.incrementStreams),u=zl(h=>h.decrementStreams),d=zl(h=>h.setStatus),m=R.useCallback(h=>{r.setQueryData(["run",s],p=>{var z,v,y,j;if(!p)return p;const b={...p};switch(h.type){case"RUN_COMPLETED":case"RUN_FAILED":b.run={...b.run,status:h.type==="RUN_COMPLETED"?"completed":"failed",finishedAt:h.timestamp,durationMs:h.timestamp-b.run.startedAt,...h.type==="RUN_FAILED"&&h.payload?{error:h.payload}:{}};break;case"NODE_STARTED":{const S=h.nodeId||h.id;if(b.nodes.some(q=>q.id===S))break;const D={id:S,runId:s,nodeName:h.nodeName||"",nodeType:((z=h.payload)==null?void 0:z.nodeType)||"unknown",runtimeKind:(v=h.payload)==null?void 0:v.runtimeKind,status:"running",startedAt:h.timestamp,depth:((y=h.payload)==null?void 0:y.depth)||0,stepIndex:((j=h.payload)==null?void 0:j.stepIndex)||0};b.nodes=[...b.nodes,D],b.run={...b.run,status:"running"};break}case"NODE_COMPLETED":{b.nodes=b.nodes.map(S=>{var D,q;return S.id===h.nodeId||S.nodeName===h.nodeName?{...S,status:"completed",finishedAt:h.timestamp,durationMs:h.timestamp-S.startedAt,outputs:(D=h.payload)==null?void 0:D.outputs,metrics:(q=h.payload)==null?void 0:q.metrics}:S}),b.run={...b.run,completedNodes:b.run.completedNodes+1};break}case"NODE_FAILED":{b.nodes=b.nodes.map(S=>S.id===h.nodeId||S.nodeName===h.nodeName?{...S,status:"failed",finishedAt:h.timestamp,durationMs:h.timestamp-S.startedAt,error:h.payload}:S);break}case"NODE_SKIPPED":{b.nodes=b.nodes.map(S=>S.id===h.nodeId||S.nodeName===h.nodeName?{...S,status:"skipped"}:S);break}case"LOG_ENTRY":{const S=h.payload;if(S){if(b.logs.some(q=>q.id===h.id))break;const D={id:h.id,runId:s,nodeId:h.nodeId,nodeName:h.nodeName,level:S.level||"info",message:S.message||"",timestamp:h.timestamp,data:S.data};b.logs=[...b.logs,D]}break}case"NODE_PROGRESS":{const S=h.payload;if(!S)break;b.nodes=b.nodes.map(D=>D.id===h.nodeId||D.nodeName===h.nodeName?{...D,progress:{percent:Math.max(0,Math.min(100,Number(S.percent??0))),phase:S.phase||"",updatedAt:h.timestamp}}:D);break}case"NODE_PARTIAL_RESULT":{const S=h.payload;if(!S)break;b.nodes=b.nodes.map(D=>D.id===h.nodeId||D.nodeName===h.nodeName?{...D,partialResult:{snapshot:S.snapshot,updatedAt:h.timestamp}}:D);break}}return b})},[r,s]);R.useEffect(()=>{if(!s)return;o(),d("connecting");const h=Jy(s,{onEvent:m,onOpen:()=>d("connected"),onEnd:()=>{d("connected"),u(),r.invalidateQueries({queryKey:["run",s]}),r.invalidateQueries({queryKey:["runs"]}),r.invalidateQueries({queryKey:["workflows"]})},onError:()=>d("error")});return()=>{h(),u()}},[s,m,o,u,d,r])}const mx=Et("/runs/$runId")({component:Wj});function Wj(){const{runId:s}=mx.useParams(),r=Cl(),{data:o,isLoading:u,error:d}=$j(s),[m,h]=R.useState(null),[p,b]=R.useState("step"),[z,v]=R.useState(!1),[y,j]=R.useState(null);Fj(s);const{data:S}=Jj(s);R.useEffect(()=>{if(m||!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&&h(He.id)},[o,m]),R.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===m),K=ae.key==="j"?Math.min(He+1,_e.length-1):Math.max(He-1,0),ee=_e[K];ee&&h(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,m]);const D=R.useMemo(()=>!o||!m?null:o.nodes.find(Z=>Z.id===m)||null,[o,m]),q=R.useMemo(()=>o?[...new Set(o.nodes.map(Z=>Z.nodeName))]:[],[o]),O=R.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||z)){v(!0),j(null);try{const Z=await Fo(s);r({to:"/runs/$runId",params:{runId:Z.newRunId}})}catch(Z){j(Z instanceof Error?Z.message:"Replay failed")}finally{v(!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(Wn,{className:"w-12 h-12"}),title:"Run not found",description:`No run with ID "${s}" was found.`})});const{run:M,nodes:G,logs:B}=o,X=M.triggerType==="http",Q=M.status==="completed"||M.status==="failed"||M.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:M.workflowName},className:"p-1 rounded hover:bg-hover text-zinc-500 hover:text-zinc-300 transition-colors",children:l.jsx(Zo,{className:"w-4 h-4"})}),l.jsx("span",{className:"text-sm text-zinc-500",children:M.workflowName}),l.jsx("span",{className:"text-zinc-700",children:"/"}),l.jsx("span",{className:"text-sm font-mono text-zinc-400",children:M.id.slice(0,12)}),l.jsx(ws,{status:M.status}),l.jsx(ox,{ms:M.status==="running"?M.startedAt:M.durationMs,running:M.status==="running"}),M.replayOf&&l.jsxs(De,{to:"/runs/$runId",params:{runId:M.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 ${M.replayOf}`,children:[l.jsx(Oo,{className:"w-2.5 h-2.5"}),"replay of ",M.replayOf.slice(0,8)]}),M.parentRunId&&l.jsxs(De,{to:"/runs/$runId",params:{runId:M.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 ${M.parentRunId}`,children:[l.jsx(wl,{className:"w-2.5 h-2.5"}),"called from ",M.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:z,className:L("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",z?"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:[z?l.jsx(Oe,{className:"w-3 h-3 animate-spin"}):l.jsx(Oo,{className:"w-3 h-3"}),"Replay"]}),X&&l.jsxs("button",{type:"button",onClick:()=>b("request"),className:L("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",p==="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(Wm,{className:"w-3 h-3"}),"Request"]}),M.status==="failed"&&M.error&&l.jsx(dx,{runId:s}),l.jsx(sx,{onExportJson:()=>Wo(s),onExportCsv:()=>Io(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:M.triggerSummary})]}),l.jsxs("span",{children:["Started: ",l.jsx("span",{className:"text-zinc-400",children:lc(M.startedAt)})]}),l.jsxs("span",{children:["Nodes:"," ",l.jsxs("span",{className:"text-zinc-400",children:[M.completedNodes,"/",M.nodeCount]})]}),y&&l.jsx("span",{className:"text-red-400",children:y})]}),l.jsx("div",{className:"ml-9 mt-1",children:l.jsx(cj,{runId:M.id,tags:M.tags||[]})}),S&&S.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(wl,{className:"w-3 h-3"}),"sub-runs (",S.length,")"]}),S.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:L("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(Qj,{nodes:G,activeStepId:m,onSelect:h}),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:L("px-3 py-2 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5",p===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:[p==="step"&&(D?l.jsx(pj,{node:D,logs:B,totalSteps:G.length}):l.jsx("div",{className:"p-8 text-sm text-zinc-500",children:"No step selected."})),p==="graph"&&l.jsx("div",{className:"p-4 h-full",children:l.jsx(Yj,{run:M,nodes:G,selectedNodeId:m,onSelectNode:h})}),p==="logs"&&l.jsx("div",{className:"h-full",children:l.jsx(zj,{logs:B,nodeNames:q})}),p==="events"&&l.jsx("div",{className:"p-4",children:l.jsx(jj,{runId:s})}),p==="request"&&l.jsx(Ej,{defaultMethod:O.method,defaultPath:O.path,onClose:()=>b("step")})]})]}),l.jsx(Nj,{node:D,logs:B})]})]})}const Ij=sv.update({id:"/webhooks",path:"/webhooks",getParentRoute:()=>xt}),Pj=rv.update({id:"/settings",path:"/settings",getParentRoute:()=>xt}),eN=xv.update({id:"/scheduled",path:"/scheduled",getParentRoute:()=>xt}),tN=vv.update({id:"/queues",path:"/queues",getParentRoute:()=>xt}),nN=Ev.update({id:"/metrics",path:"/metrics",getParentRoute:()=>xt}),lN=Cv.update({id:"/logs",path:"/logs",getParentRoute:()=>xt}),aN=Dv.update({id:"/deployments",path:"/deployments",getParentRoute:()=>xt}),sN=Zv.update({id:"/dashboards",path:"/dashboards",getParentRoute:()=>xt}),iN=t1.update({id:"/",path:"/",getParentRoute:()=>xt}),cN=d1.update({id:"/runs/",path:"/runs/",getParentRoute:()=>xt}),rN=rx.update({id:"/workflows/$name",path:"/workflows/$name",getParentRoute:()=>xt}),oN=ux.update({id:"/runs/diff",path:"/runs/diff",getParentRoute:()=>xt}),uN=mx.update({id:"/runs/$runId",path:"/runs/$runId",getParentRoute:()=>xt}),dN={IndexRoute:iN,DashboardsRoute:sN,DeploymentsRoute:aN,LogsRoute:lN,MetricsRoute:nN,QueuesRoute:tN,ScheduledRoute:eN,SettingsRoute:Pj,WebhooksRoute:Ij,RunsRunIdRoute:uN,RunsDiffRoute:oN,WorkflowsNameRoute:rN,RunsIndexRoute:cN},fN=xt._addFileChildren(dN)._addFileTypes(),hx=new Qb({defaultOptions:{queries:{staleTime:2e3,retry:1,refetchOnWindowFocus:!0}}}),mN=Jb({routeTree:fN,context:{queryClient:hx},defaultPreload:"intent"}),hN=document.getElementById("root");Gg.createRoot(hN).render(l.jsx(R.StrictMode,{children:l.jsx(Yb,{client:hx,children:l.jsx(Fb,{router:mN})})}));
|