tubeless 0.3.4 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/cloudflare/cloudflare-studio-client.js +1 -1
  2. package/dist/run-store/legacy-trace-event.d.ts +28 -0
  3. package/dist/run-store/legacy-trace-event.js +200 -0
  4. package/dist/run-store/legacy-trace-event.js.map +1 -0
  5. package/dist/run-store/run-store-migrate.d.ts +24 -0
  6. package/dist/run-store/run-store-migrate.js +197 -0
  7. package/dist/run-store/run-store-migrate.js.map +1 -0
  8. package/dist/run-store/run-store-sql.d.ts +1 -0
  9. package/dist/run-store/run-store-sql.js +1 -0
  10. package/dist/run-store/run-store-sql.js.map +1 -1
  11. package/dist/run-store/run-store-sqlite.d.ts +14 -4
  12. package/dist/run-store/run-store-sqlite.js +51 -23
  13. package/dist/run-store/run-store-sqlite.js.map +1 -1
  14. package/dist/studio/run-store-ui-client-browser.js +4 -4
  15. package/dist/studio/run-store-ui-client.d.ts +5 -0
  16. package/dist/studio/run-store-ui-client.js +23 -6
  17. package/dist/studio/run-store-ui-client.js.map +1 -1
  18. package/dist/studio/run-store-ui-common.d.ts +4 -0
  19. package/dist/studio/run-store-ui-common.js +4 -0
  20. package/dist/studio/run-store-ui-common.js.map +1 -1
  21. package/dist/studio/run-store-ui-debugging.d.ts +6 -2
  22. package/dist/studio/run-store-ui-debugging.js +2 -2
  23. package/dist/studio/run-store-ui-debugging.js.map +1 -1
  24. package/dist/studio/run-store-ui-graph.d.ts +6 -1
  25. package/dist/studio/run-store-ui-graph.js +11 -3
  26. package/dist/studio/run-store-ui-graph.js.map +1 -1
  27. package/dist/studio/run-store-ui-launch.js +9 -3
  28. package/dist/studio/run-store-ui-launch.js.map +1 -1
  29. package/dist/studio/run-store-ui-page.js +39 -8
  30. package/dist/studio/run-store-ui-page.js.map +1 -1
  31. package/dist/studio/run-store-ui-runs.d.ts +4 -2
  32. package/dist/studio/run-store-ui-runs.js +50 -8
  33. package/dist/studio/run-store-ui-runs.js.map +1 -1
  34. package/dist/studio/run-store-ui-steps.d.ts +11 -2
  35. package/dist/studio/run-store-ui-steps.js +42 -7
  36. package/dist/studio/run-store-ui-steps.js.map +1 -1
  37. package/dist/workbench/workbench-upgrade.d.ts +3 -0
  38. package/dist/workbench/workbench-upgrade.js +61 -0
  39. package/dist/workbench/workbench-upgrade.js.map +1 -0
  40. package/dist/workbench/workbench.js +4 -0
  41. package/dist/workbench/workbench.js.map +1 -1
  42. package/docs/agent-guide.md +3 -1
  43. package/docs/assets/social.svg +62 -184
  44. package/docs/cli.md +25 -1
  45. package/docs/studio.md +40 -19
  46. package/package.json +8 -8
@@ -1 +1 @@
1
- export const PIPELINE_RUN_STUDIO_CLIENT = "var j,O2,W6,O0,L2,P1,A2,B1,C2,c1,h1,J6,M1={},G1=[],K6=/^m(i|n|o|s|text|space)$/,l1=Array.isArray,T2=G1.slice,f0=Object.assign;function F1($){$&&$.parentNode&&$.remove()}function q1($,X,Q,W,J){var K={type:$,props:X,key:Q,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:J||++O2,__i:-1,__u:0};return!J&&j.vnode&&j.vnode(K),K}function l($){return $.children}function U1($,X){this.props=$,this.context=X,this.__g=0}function A0($,X){if(X==null)return $.__?A0($.__,$.__i+1):null;for(var Q;X<$.__k.length;X++)if((Q=$.__k[X])&&Q.__e)return Q.__e;return typeof $.type!=\"function\"||$.props.__P?null:A0($)}function R2($){if(($=$.__)&&$.__c&&!$.props.__P)return $.__e=null,$.__k.some(function(X){return X&&($.__e=X.__e)}),R2($)}function H2($){(8&$.__g||!($.__g|=8)||!O0.push($)||P1++)&&L2==j.debounceRendering||((L2=j.debounceRendering)||queueMicrotask)(b6)}function b6(){var $,X,Q,W,J,K,b,N,q;try{for(X=1;O0.length;)O0.length>X&&O0.sort(A2),$=O0.shift(),X=O0.length,8&$.__g&&(W=void 0,J=void 0,K=(J=(Q=$).__v).__e,b=[],N=[],(q=Q.__P)&&((W=f0({constructor:void 0},J)).__v=J.__v+1,j.vnode&&j.vnode(W),m1(q,W,J,Q.__n,q.namespaceURI,32&J.__u?[K]:null,b,K||A0(J),32&J.__u,N),W.__v=J.__v,W.__.__k[W.__i]=W,w2(b,W,N),J.__=J.__e=null,W.__e!=K&&R2(W)))}finally{O0.length=P1=0}}function _2($,X,Q,W,J,K,b,N,q,z,B){var P,G,M,L,Y,F,O=W.__k||G1,k=X.length;for(q=Y6(Q,X,O,q,k),P=0;P<k;P++)(M=Q.__k[P])!=null&&(G=~M.__i&&O[M.__i]||M1,M.__i=P,F=m1($,M,G,J,K,b,N,q,z,B),L=M.__e,(G.ref!=M.ref||8&G.__u)&&(G.ref&&V1(G.ref,null,M,G),M.ref&&B.push(M.ref,M.__c||L,M)),Y=Y||L,4&M.__u?(q=S2(M,q,$,!G.__v),G.__e&&(G.__e=null)):typeof M.type==\"function\"&&F!==void 0?q=F:L&&(q=L.nextSibling),M.__u&=-7);return Q.__e=Y,q}function Y6($,X,Q,W,J){var K,b,N,q,z,B,P,G,M,L,Y=Q.length,F=Y,O=0,k=!1,g=$.__k=Array(J);for(K=0;K<J;K++)(b=X[K])!=null&&typeof b!=\"boolean\"&&typeof b!=\"function\"?(typeof b!=\"object\"||b.constructor==String?b=g[K]=q1(null,b):l1(b)?b=g[K]=q1(l,{children:b}):b.constructor===void 0&&b.__b?b=g[K]=q1(b.type,b.props,b.key,b.ref,b.__v):g[K]=b,q=K+O,b.__=$,b.__b=$.__b+1,N=null,~(z=b.__i=z6(b,Q,q,F))&&(F--,(N=Q[z])&&(N.__u|=2)),N&&N.__v?(b.__u|=2,z==q-1?O--:z==q+1?O++:z!=q&&(z>q?O--:O++,k=!0)):(~z||(J>Y?O--:J<Y&&O++),typeof b.type!=\"function\"&&(b.__u|=4))):g[K]=null;if(k){for(B=[],P=[],K=0;K<J;K++)if((b=g[K])&&2&b.__u){for(G=0,M=B.length;G<M;)B[L=G+M>>1]<b.__i?G=L+1:M=L;B[G]=b.__i,P[K]=G+1}for(O=B.length;K--;)P[K]&&(P[K]==O?O--:g[K].__u|=4)}if(F)for(K=0;K<Y;K++)!(N=Q[K])||2&N.__u||(N.__e==W&&(W=A0(N)),j1(N,N));return W}function S2($,X,Q,W){var J,K,b;if(typeof $.type==\"function\"){if($.props.__P)return X;if(J=$.__k)for(K=0;K<J.length;K++)J[K]&&(J[K].__=$,X=S2(J[K],X,Q,!1));return X}for(X&&!X.parentNode&&(X=A0($))&&!X.parentNode&&(X=null),b=X;b&&b.nodeType==8;)b=b.nextSibling;for($.__e!=b&&(!W&&Q.moveBefore&&$.__e.parentNode?Q.moveBefore($.__e,X):Q.insertBefore($.__e,X||null)),X=$.__e;(X=X&&X.nextSibling)&&X.nodeType==8;);return X}function z6($,X,Q,W){var J,K,b,N=$.key,q=$.type,z=X[Q],B=z&&!(2&z.__u);if(z===null&&N==null||B&&N==z.key&&q==z.type)return Q;if(W>(B?1:0)){for(J=Q-1,K=Q+1;J>=0||K<X.length;)if((z=X[b=J>=0?J--:K++])&&!(2&z.__u)&&N==z.key&&q==z.type)return b}return-1}function g2($,X,Q){Q==null&&(Q=\"\"),X[0]==\"-\"?$.setProperty(X,Q):$[X]=Q}function N1($,X,Q,W,J){var K,b;$:if(X==\"style\")if(typeof Q==\"string\")$.style.cssText=Q;else{if(typeof W==\"string\"&&($.style.cssText=W=\"\"),W)for(X in W)Q&&X in Q||g2($.style,X,\"\");if(Q)for(X in Q)W&&Q[X]==W[X]||g2($.style,X,Q[X])}else if(X[0]==\"o\"&&X[1]==\"n\")($.__e||($.__e={}))[X]=Q,Q&&W||(b=h1[X]||(h1[X]=N6(X)),($.__a||($.__a={}))[X]=c1,K=X!=(X=X.replace(C2,\"$1\")),(X=X.slice(2))[0]<\"a\"&&(X=X.toLowerCase()),Q?$.addEventListener(X,b,K):$.removeEventListener(X,b,K));else{if(J==\"http://www.w3.org/2000/svg\")X=X.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(X!=\"width\"&&X!=\"height\"&&X!=\"href\"&&X!=\"list\"&&X!=\"form\"&&X!=\"tabIndex\"&&X!=\"download\"&&X!=\"rowSpan\"&&X!=\"colSpan\"&&X!=\"role\"&&X!=\"popover\"&&X in $)try{$[X]=Q==null?\"\":Q;break $}catch(N){}typeof Q==\"function\"||(Q==null||Q===!1&&X[4]!=\"-\"?$.removeAttribute(X):$.setAttribute(X,X==\"popover\"&&Q==1?\"\":Q))}}function N6($){return function(X){if(this.__e){var Q=this.__e[$];if(X[B1]==null)X[B1]=c1++;else if(X[B1]<this.__a[$])return;return Q(j.event?j.event(X):X)}}}function m1($,X,Q,W,J,K,b,N,q,z){var B,P,G,M,L,Y,F,O,k,g,R,_,V,d,C,A,S,c,w,y,x=X.type;if(X.constructor!==void 0)return null;if(128&Q.__u&&(q=32&Q.__u,B=Q.__c.__z)){if(X.__u|=q,P=K=[],B.nodeType==8)for(G=1,M=B.nextSibling;M;M=M.nextSibling){if(M.nodeType==8){if(M.data.startsWith(\"$s\"))G++;else if(M.data.startsWith(\"/$s\")&&!--G)break}K.push(M)}else K.push(B);N=K[0]}(B=j.__b)&&B(X);$:if(typeof x==\"function\"){L=b.length;try{if(g=X.props,R=(B=x.prototype)&&B.render,_=(B=x.contextType)&&W[B.__c],V=B?_?_.props.value:B.__:W,Q.__c?2&(Y=X.__c=Q.__c).__g&&(Y.__g|=1):(R?X.__c=Y=new x(g,V):(X.__c=Y=new U1(g,V),Y.constructor=x,Y.render=q6),_&&_.sub(Y),Y.state||(Y.state={}),Y.__n=W,Y.__g|=8,Y.__h=[],Y.__k=[]),R&&(Y.__s||(Y.__s=Y.state),x.getDerivedStateFromProps&&(Y.__s==Y.state&&(Y.__s=f0({},Y.__s)),f0(Y.__s,x.getDerivedStateFromProps(g,Y.__s)))),F=Y.props,O=Y.state,Y.__v=X,Q.__c){if(R&&!x.getDerivedStateFromProps&&g!==F&&Y.componentWillReceiveProps&&Y.componentWillReceiveProps(g,V),X.__v==Q.__v&&!(8&Y.__g)||!(4&Y.__g)&&Y.shouldComponentUpdate&&Y.shouldComponentUpdate(g,Y.__s,V)===!1){X.__v!=Q.__v&&(Y.props=g,Y.state=Y.__s,Y.__g&=-9),X.__e=Q.__e,X.__k=Q.__k,X.__k.some(function(p){p&&(p.__=X)}),G1.push.apply(Y.__h,Y.__k),Y.__k=[],Y.__h.length&&b.push(Y),N=A0(Q);break $}Y.componentWillUpdate&&Y.componentWillUpdate(g,Y.__s,V),R&&Y.componentDidUpdate&&Y.__h.push(function(){Y.componentDidUpdate(F,O,k)})}else R&&!x.getDerivedStateFromProps&&Y.componentWillMount&&Y.componentWillMount(),R&&Y.componentDidMount&&Y.__h.push(Y.componentDidMount);if(Y.context=V,Y.props=g,Y.__P=$,Y.__g&=-5,d=j.__r,C=0,R)Y.state=Y.__s,Y.__g&=-9,d&&d(X),B=Y.render(Y.props,Y.state,Y.context),G1.push.apply(Y.__h,Y.__k),Y.__k=[];else do Y.__g&=-9,d&&d(X),B=Y.render(Y.props,Y.state,Y.context),Y.state=Y.__s;while(8&Y.__g&&++C<25);Y.state=Y.__s,Y.getChildContext&&(W=f0({},W,Y.getChildContext())),R&&Q.__c&&Y.getSnapshotBeforeUpdate&&(k=Y.getSnapshotBeforeUpdate(F,O)),A=B&&B.type===l&&B.key==null?B.props.children:B,g.__P&&(B=N,J=($=g.__P).namespaceURI,q=K=null,Q.props&&Q.props.__P!=$&&(Q.__k.some(function(p){p&&j1(p,p)}),Q.__k=null),N=Q.__k?A0(Q,0):null),N=_2($,l1(A)?A:[A],X,Q,W,J,K,b,N,q,z),g.__P&&(X.__e=null,N=B),X.__u&=-161,128&Q.__u&&(Y.__z=null),P&&P.some(F1),Y.__h.length&&b.push(Y),1&Y.__g&&(Y.__g&=-4)}catch(p){if(b.length=L,X.__v=null,q||K)if(p.then){if(S=0,X.__u|=q?160:128,K){for(~(w=K.indexOf(N||void 0))||(w=K.length);(y=K[w-1])&&y.nodeType==8;)w--;for(;w<K.length;w++)if(y=K[w]){if(K[w]=null,y.nodeType==8){if(y.data.startsWith(\"$s\"))S++||(c=y);else if(S&&y.data.startsWith(\"/$s\")&&!--S){N=y;break}}else if(!S)break}}if(!c){for(;N&&N.nodeType==8&&N.nextSibling;)N=N.nextSibling;c=N}X.__c.__z||(X.__c.__z=c),X.__e=N}else K&&K.some(F1);else X.__e=Q.__e;X.__k||(X.__k=Q.__k||[]),p.then||k2(X),j.__e(p,X,Q)}}else N=X.__e=B6(Q.__e,X,Q,W,J,K,b,q,z,$);return(B=j.diffed)&&B(X),128&X.__u?void 0:N}function k2($){$&&($.__c&&($.__c.__g|=4),$.__k&&$.__k.some(k2))}function w2($,X,Q){for(var W=0;W<Q.length;)V1(Q[W++],Q[W++],Q[W++]);j.__c&&j.__c(X,$),$.some(function(J){try{$=J.__h,J.__h=[],$.some(function(K){K.call(J)})}catch(K){j.__e(K,J.__v)}})}function B6($,X,Q,W,J,K,b,N,q,z){var B,P,G,M,L,Y,F,O,k,g=Q.props||M1,R=X.props,_=X.type;if(_==\"svg\"?J=\"http://www.w3.org/2000/svg\":_==\"math\"?J=\"http://www.w3.org/1998/Math/MathML\":J||(J=\"http://www.w3.org/1999/xhtml\"),K){for(B=0;B<K.length;B++)if((L=K[B])&&(_?L.localName==_:L.nodeType==3)){$=L,K[B]=null;break}}if(!$){if(O=z.ownerDocument||document,!_)return O.createTextNode(R);$=O.createElementNS(J,_,R.is&&R),N&&(j.__m&&j.__m(X,K),N=!1),K=null}if(_){if(z=_==\"template\"?$.content:$,K=_==\"textarea\"&&R.defaultValue!=null?null:K&&T2.call(z.childNodes),!N&&K)for(g={},B=0;B<$.attributes.length;B++)g[(L=$.attributes[B]).name]=L.value;for(B in g)L=g[B],B==\"dangerouslySetInnerHTML\"?G=L:B==\"children\"||(B in R)||B==\"value\"&&(\"defaultValue\"in R)||B==\"checked\"&&(\"defaultChecked\"in R)||N1($,B,null,L,J);for(B in k=1&Q.__u,R)L=R[B],B==\"children\"?M=L:B==\"dangerouslySetInnerHTML\"?P=L:B==\"value\"?Y=L:B==\"checked\"?F=L:N&&typeof L!=\"function\"||!(g[B]!==L||k&&L!=null)||N1($,B,L,g[B],J);P?(N||G&&(P.__html==G.__html||P.__html==$.innerHTML)||($.innerHTML=P.__html),X.__k=[]):(G&&($.textContent=\"\"),(_==\"foreignObject\"||J==\"http://www.w3.org/1998/Math/MathML\"&&K6.test(_))&&(J=\"http://www.w3.org/1999/xhtml\"),_2(z,l1(M)?M:[M],X,Q,W,J,K,b,K?K[0]:Q.__k&&A0(Q,0),N,q),K&&K.some(F1)),N&&_!=\"textarea\"||(B=\"value\",_==\"progress\"&&Y==null?$.removeAttribute(B):Y==null||Y===$[B]&&(_!=\"progress\"||Y)||N1($,B,Y,g[B],J),B=\"checked\",F!=null&&F!=$[B]&&N1($,B,F,g[B],J))}else g===R||N&&$.data==R||($.data=R);return $}function V1($,X,Q,W){try{typeof $==\"function\"?X?X.__x=$(X)||1:W&&(W=W.__c||W.__e)&&(X=W.__x)&&(W.__x=null,typeof X==\"function\"?X():$(null)):$.current=X}catch(J){j.__e(J,Q)}}function j1($,X,Q){var W,J;if(j.unmount&&j.unmount($),!(W=$.ref)||W.current&&W.current!=$.__e||V1(W,null,X,$),W=$.__c){if(W.componentWillUnmount)try{W.componentWillUnmount()}catch(K){j.__e(K,X)}W.__P=W.__n=null}if(W=$.__k)for(J=0;J<W.length;J++)W[J]&&j1(W[J],X,typeof $.type!=\"function\"||Q&&!$.props.__P);(W=$.__e)&&(Q||F1(W),W.__e&&(W.__e=null)),$.__e=$.__c=$.__=null}function q6($,X,Q){return this.constructor($,Q)}function I2($,X){var Q,W,J,K;j.__&&j.__($,X),X.nodeType==9&&(X=X.documentElement),W=(Q=$&&32&$.__u)?null:X.__k,X.__k=q1(l,{children:[$]}),J=[],K=[],m1(X,X.__k,W||M1,M1,X.namespaceURI,W?null:X.firstChild?T2.call(X.childNodes):null,J,W?W.__e:X.firstChild,Q,K),w2(J,X.__k,K),X.__k.props.children=null}j={__e:function($,X,Q,W){for(var J,K,b;X=X.__;)if((J=X.__c)&&!(1&J.__g)){J.__g|=4;try{if((K=J.constructor)&&K.getDerivedStateFromError&&(J.setState(K.getDerivedStateFromError($)),b=8&J.__g),J.componentDidCatch&&(J.componentDidCatch($,W||{}),b=8&J.__g),b)return void(J.__g|=2)}catch(N){$=N,b=0}}throw P1=0,$}},O2=0,W6=function($){return $!=null&&$.constructor===void 0},U1.prototype.setState=function($,X){var Q=this.__s;Q&&Q!=this.state||(Q=this.__s=f0({},this.state)),typeof $==\"function\"&&($=$(f0({},Q),this.props)),$&&(f0(Q,$),this.__v&&(X&&this.__k.push(X),H2(this)))},U1.prototype.forceUpdate=function($){this.__v&&(this.__g|=4,$&&this.__h.push($),H2(this))},U1.prototype.render=l,O0=[],P1=0,A2=function($,X){return $.__v.__b-X.__v.__b},B1=Symbol(),C2=/(PointerCapture)$|Capture$/i,c1=0,h1={},J6=0;var r0,o,D1,v2,u1=Object.is,n0=0,D2=[],E1=[],E=j,f2=E.__b,y2=E.__r,h2=E.diffed,c2=E.__c,l2=E.unmount,m2=E.__;function x1($,X){E.__h&&E.__h(o,$,n0||X),n0=0;var Q=o.__H||(o.__H={__:[],__h:[]});return $>=Q.__.length&&Q.__.push({}),Q.__[$]}function T($){return n0=1,U6(E2,$)}function U6($,X,Q){var W=x1(r0++,2);if(W.t=$,!W.__c&&(W.__=[Q?Q(X):E2(void 0,X),function(K){var b=W.__N?W.__N[0]:W.__[0],N=W.t(b,K);u1(b,N)||(W.__N=[N,W.__[1]],W.__c.setState({}))}],W.__c=o,!o.__f)){o.__f=!0;var J=o.shouldComponentUpdate;o.shouldComponentUpdate=function(K,b,N){var q=this.__H;if(!q)return!0;var z=!1,B=this.props!=K;if(q.__.some(function(G){G.__N&&(z=!0,u1(G.__[0],G.__N[0])||(B=!0))}),J){var P=J.call(this,K,b,N);return z?P||B:P}return!z||B}}return W.__}function i($,X){var Q=x1(r0++,3);!E.__s&&u2(Q.__H,X)&&(Q.__P=!0,Q.__=$,Q.u=X,o.__H.__h.push(Q))}function P0($){return n0=5,L1(function(){return{current:$}},[])}function L1($,X){var Q=x1(r0++,7);return u2(Q.__H,X)&&(Q.__=$(),Q.__H=X),Q.__}function s0($,X){return n0=8,L1(function(){return $},X)}function P6(){var $;do{for(;$=E1.shift();)try{i0($)}catch(Q){E.__e(Q,{__:($=$.__P)&&$.__v})}for(;$=D2.shift();){var X=$.__H;if($.__P&&X)try{X.__h.some(i0),X.__h.some(d1),X.__h=[]}catch(Q){X.__h=[],E.__e(Q,$.__v)}}}while(E1.length)}E.__b=function($){o=null,f2&&f2($)},E.__=function($,X){$&&X.__k&&X.__k.__m&&($.__m=X.__k.__m),m2&&m2($,X)},E.__r=function($){y2&&y2($),r0=0;var X=(o=$.__c).__H;X&&(D1==o?o.__h=[]:(X.__h.some(i0),X.__h.some(d1),r0=0),X.__h=[],X.__.some(function(Q){Q.__N&&(Q.__=Q.__N),Q.u=Q.__N=void 0})),D1=o},E.diffed=function($){h2&&h2($);var X=$.__c;X&&X.__H&&(X.__H.__h.length&&j2(D2.push(X)),X.__H.__.some(function(Q){Q.u&&(Q.__H=Q.u)})),D1=o=null},E.__c=function($,X){X.some(function(Q){try{Q.__h.some(i0),Q.__h=Q.__h.filter(function(W){return!W.__||d1(W)})}catch(W){X.some(function(J){J.__h&&(J.__h=[])}),X=[],E.__e(W,Q.__v)}}),c2&&c2($,X)},E.unmount=function($){l2&&l2($);var X,Q,W=$.__c;W&&W.__H&&(W.__H.__.some(function(J){try{if(J.__P&&J.__c){if(Q===void 0){for(Q=$.__;Q&&(!Q.__c||!Q.__c.__P);)Q=Q.__;Q=Q&&Q.__c}J.__P=Q,j2(E1.push(J))}else i0(J)}catch(K){X=K}}),W.__H=void 0,X&&E.__e(X,W.__v))};var V2=typeof requestAnimationFrame==\"function\";function M6($){var X,Q=function(){clearTimeout(W),V2&&cancelAnimationFrame(X),setTimeout($)},W=setTimeout(Q,35);V2&&(X=requestAnimationFrame(Q))}function j2($){$!=1&&v2==E.requestAnimationFrame||((v2=E.requestAnimationFrame)||M6)(P6)}function i0($){var X=o,Q=$.__c;typeof Q==\"function\"&&($.__c=void 0,Q()),o=X}function d1($){var X=o;$.__c=$.__(),o=X}function u2($,X){return!$||$.length!=X.length||X.some(function(Q,W){return!u1(Q,$[W])})}function E2($,X){return typeof X==\"function\"?X($):X}function p1($){let X=$.metadata?.tubelessCache;if(!X||typeof X!==\"object\"||Array.isArray(X)||!(\"implementationVersion\"in X)||typeof X.implementationVersion!==\"string\"||!(\"createdAtMs\"in X)||typeof X.createdAtMs!==\"number\"||!Number.isFinite(X.createdAtMs)||!(\"ageMs\"in X)||typeof X.ageMs!==\"number\"||!Number.isFinite(X.ageMs))return;return{implementationVersion:X.implementationVersion,createdAtMs:X.createdAtMs,ageMs:X.ageMs}}var G6=0;function Z($,X,Q,W,J,K){X||(X={});var b,N,q=X;if(\"ref\"in q&&typeof $!=\"function\")for(N in q={},X)N==\"ref\"?b=X[N]:q[N]=X[N];var z={type:$,props:q,key:Q,ref:b,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--G6,__i:-1,__u:0};return(J||K)&&(z.__source=J,z.__self=K),j.vnode&&j.vnode(z),z}function H1({artifacts:$,stepId:X}){let[Q,W]=T(\"all\"),J=$.filter((b)=>p1(b.artifact)),K=J.length>0&&J.length<$.length;return Z(l,{children:[K&&Z(\"label\",{class:\"artifact-filter\",children:[\"Artifacts for \",X,\" \",Z(\"select\",{value:Q,onChange:(b)=>W(b.currentTarget.value),children:[Z(\"option\",{value:\"all\",children:\"All artifacts\"},void 0,!1,void 0,this),Z(\"option\",{value:\"cache\",children:\"Cached outputs\"},void 0,!1,void 0,this),Z(\"option\",{value:\"application\",children:\"Application artifacts\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.map((b,N)=>{let q=p1(b.artifact);if(K&&(Q===\"cache\"&&!q||Q===\"application\"&&q))return null;let z=q?new Date(q.createdAtMs):void 0;return Z(\"details\",{class:\"artifact-detail\",children:[Z(\"summary\",{children:[q?\"Cached output \":b.preview?\"Preview \":\"Artifact \",b.operation,!q&&`: ${b.artifact.id||b.artifact.uri}`]},void 0,!0,void 0,this),q&&Z(\"div\",{class:\"artifact-info\",children:[Z(\"div\",{children:[\"Created:\",\" \",z&&Number.isFinite(z.getTime())?z.toISOString():String(q.createdAtMs)]},void 0,!0,void 0,this),Z(\"div\",{children:[\"Age at \",b.operation,\": \",q.ageMs,\" ms\"]},void 0,!0,void 0,this),b.artifact.uri&&Z(\"div\",{children:[\"Location: \",b.artifact.uri]},void 0,!0,void 0,this),b.artifact.byteSize!==void 0&&Z(\"div\",{children:[\"Size: \",b.artifact.byteSize,\" bytes\"]},void 0,!0,void 0,this),Z(\"p\",{class:\"artifact-note\",children:\"Recorded operation; current cache availability is not checked.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q?Z(\"details\",{class:\"artifact-receipt\",children:[Z(\"summary\",{children:\"Receipt metadata\"},void 0,!1,void 0,this),Z(\"pre\",{children:JSON.stringify(b.artifact,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z(\"pre\",{children:JSON.stringify(b.artifact,null,2)},void 0,!1,void 0,this)]},N,!0,void 0,this)})]},void 0,!0,void 0,this)}var C0=($)=>$.length>24?$.slice(0,12)+\"…\"+$.slice(-7):$;function F0($){return $==null?\"—\":$<1000?Math.max(0,Math.round($))+\" ms\":$<60000?($/1000).toFixed($<1e4?1:0)+\" s\":Math.floor($/60000)+\"m \"+Math.round($%60000/1000)+\"s\"}function F6($){return $===\"completed\"?\"✓\":$===\"skipped\"?\"×\":$===\"cancelled\"?\"■\":$===\"failed\"?\"!\":$===\"planned\"?\"…\":\"\"}function b0({value:$,outputSource:X}){return Z(\"span\",{class:`status ${$}`,children:[Z(\"i\",{class:\"status-mark\",\"aria-hidden\":\"true\",children:F6($)},void 0,!1,void 0,this),$,X===\"override\"&&\" (overridden)\",X===\"cache\"&&\" (cached)\"]},void 0,!0,void 0,this)}function a0({children:$,label:X,secondary:Q,stepIds:W}){return Z(\"div\",{class:\"plan-nested\",children:[Z(\"strong\",{children:X},void 0,!1,void 0,this),Q&&Z(\"span\",{children:Q},void 0,!1,void 0,this),W?.map((J)=>Z(\"code\",{children:J},J,!1,void 0,this)),$]},void 0,!0,void 0,this)}function L6({value:$}){let X=$.charAt(0).toUpperCase()+$.slice(1),Q=$===\"completed\"?Z(\"svg\",{viewBox:\"0 0 12 12\",children:Z(\"path\",{d:\"m2 6 2.4 2.4L10 3\"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$===\"running\"?Z(\"i\",{},void 0,!1,void 0,this):$===\"skipped\"?Z(\"svg\",{viewBox:\"0 0 12 12\",children:Z(\"path\",{d:\"m3 3 6 6M9 3 3 9\"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$===\"cancelled\"?Z(\"svg\",{viewBox:\"0 0 12 12\",children:Z(\"rect\",{x:\"3\",y:\"3\",width:\"6\",height:\"6\",rx:\"1\",fill:\"currentColor\",stroke:\"none\"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$===\"failed\"?\"!\":\"…\";return Z(\"span\",{class:`step-status-icon ${$}`,role:\"img\",\"aria-label\":X,title:X,children:Q},void 0,!1,void 0,this)}function g1({step:$}){let X=$.progress?.total,Q=X?Math.max(0,Math.min(100,($.progress?.completed??0)/X*100)):$.status===\"completed\"?100:18,W=$.nestedPipeline,J=W?W.stepCount??W.stepIds.length:0,K=W&&W.stepIds.length<J?W.stepIds.length+\" of \"+J+\" declared steps\":J+\" declared steps\",b=$.progress?.detailCount;return Z(\"article\",{class:`step ${$.status}`,children:[Z(L6,{value:$.status},void 0,!1,void 0,this),Z(\"div\",{class:\"step-head\",children:[Z(\"strong\",{children:$.name||$.id},void 0,!1,void 0,this),$.outputSource&&Z(b0,{value:$.status,outputSource:$.outputSource},void 0,!1,void 0,this),$.name&&Z(\"code\",{children:$.id},void 0,!1,void 0,this),Z(\"span\",{class:\"step-duration\",children:F0($.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.description&&Z(\"div\",{class:\"step-description\",children:$.description},void 0,!1,void 0,this),W&&Z(a0,{label:W.pipelineId,secondary:`${K}${W.mode===\"iterate\"?` per iteration, at most ${W.maxIterations} iterations`:W.mode===\"for-each\"?\" per runtime item\":\"\"}`,stepIds:W.stepIds},void 0,!1,void 0,this),$.remote&&Z(a0,{label:$.remote.engine,secondary:$.remote.target},void 0,!1,void 0,this),$.attempt&&Z(\"div\",{class:\"execution\",children:Z(\"span\",{class:\"execution-summary\",title:$.attempt.attemptId,children:[Z(\"b\",{children:$.attempt.outputSource===\"override\"?\"Override validation\":$.attempt.outputSource===\"cache\"?\"Cache validation\":\"Execution\"},void 0,!1,void 0,this),\" \",\"· \",C0($.attempt.attemptId),$.attempt.retries.length>0&&` · ${$.attempt.retries.length} retr${$.attempt.retries.length===1?\"y\":\"ies\"}`]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.artifacts&&Z(H1,{artifacts:$.artifacts,stepId:$.id},void 0,!1,void 0,this),$.progress&&Z(l,{children:[Z(\"div\",{class:\"progress\",children:Z(\"i\",{class:`w${Math.round(Q)}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{class:\"progress-copy\",children:$.progress.message||$.progress.completed+(X?\" / \"+X:\"\")+\" complete\"},void 0,!1,void 0,this),$.progress.details&&$.progress.details.length>0&&Z(\"div\",{class:\"progress-details\",children:[$.progress.details.map((N)=>Z(\"div\",{class:`progress-detail ${N.status||\"running\"}`,children:[Z(\"b\",{children:N.id},void 0,!1,void 0,this),N.label&&Z(\"span\",{children:N.label},void 0,!1,void 0,this),N.outputSource===\"override\"&&Z(\"span\",{children:\"(overridden)\"},void 0,!1,void 0,this),N.outputSource===\"cache\"&&Z(\"span\",{children:\"(cached)\"},void 0,!1,void 0,this)]},N.id,!0,void 0,this)),b&&$.progress.details.length<b?Z(\"div\",{class:\"progress-detail-truncated\",children:[\"Showing \",$.progress.details.length,\" of \",b,\" items\"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var d2=2;var s4=Symbol(\"tubeless.wire-schema.type\");function t($,X,Q={}){return{decode:X,jsonSchema:$,optionalInput:Q.optionalInput??!1,optionalOutput:Q.optionalOutput??!1}}function H6($,X){return $.length===0?X:`${$}.${X}`}function h(){return t({type:\"boolean\"},($,X)=>{if(typeof $!==\"boolean\")throw Error(`${X} must be a boolean`);return $})}function Q0($={}){let X={type:$.integer?\"integer\":\"number\"};if($.minimum!==void 0)X.minimum=$.minimum;return t(X,(Q,W)=>{if(typeof Q!==\"number\"||!Number.isFinite(Q))throw Error(`${W} must be a finite number`);if($.integer&&(!Number.isSafeInteger(Q)||Q<($.minimum??-1/0))){if($.minimum===0)throw Error(`${W} must be a nonnegative safe integer`);throw Error(`${W} must be a safe integer`)}if($.minimum!==void 0&&Q<$.minimum)throw Error(`${W} must be at least ${$.minimum}`);return Q})}function u($={}){let X={type:\"string\"};if($.allowEmpty!==!0)X.minLength=1;if($.maxLength!==void 0)X.maxLength=$.maxLength;return t(X,(Q,W)=>{if(typeof Q!==\"string\"||$.allowEmpty!==!0&&Q.length===0)throw Error($.allowEmpty===!0?`${W} must be a string`:`${W} must be a non-empty string`);if($.maxLength!==void 0&&Q.length>$.maxLength)throw Error(`${W} exceeds ${$.maxLength} code units`);return Q})}function m($,X){return t({const:$,type:typeof $},(Q,W)=>{if(Q!==$)throw Error(X?.(W)??`${W} must be ${String($)}`);return $})}function f($,X=(Q)=>`${Q} is unsupported`){let Q=new Set($);return t({enum:$,type:\"string\"},(W,J)=>{if(typeof W!==\"string\"||!Q.has(W))throw Error(X(J));return W})}function U($){return t($.jsonSchema,(X,Q)=>X===void 0?void 0:$.decode(X,Q),{optionalInput:!0,optionalOutput:!0})}function o1($,X){return t($.jsonSchema,(Q,W)=>Q===void 0?X:$.decode(Q,W),{optionalInput:!0})}function I($,X={}){let Q={items:$.jsonSchema,type:\"array\"};if(X.maxItems!==void 0)Q.maxItems=X.maxItems;return t(Q,(W,J)=>{if(!Array.isArray(W)||X.maxItems!==void 0&&W.length>X.maxItems){let K=X.maxItems===void 0?\"\":` of at most ${X.maxItems}${X.noun?` ${X.noun}`:\"\"}`;throw Error(`${J} must be an array${K}`)}return W.map((K,b)=>$.decode(K,`${J}[${b}]`))})}function H($){let X=Object.entries($).filter(([,W])=>!W.optionalOutput).map(([W])=>W),Q=Object.fromEntries(Object.entries($).map(([W,J])=>[W,J.jsonSchema]));return t({additionalProperties:!1,properties:Q,...X.length>0?{required:X}:{},type:\"object\"},(W,J)=>{if(W===null||typeof W!==\"object\"||Array.isArray(W))throw Error(`${J} must be an object`);let K=W,b={};for(let[N,q]of Object.entries($)){let z=q.decode(K[N],H6(J,N));if(z!==void 0)b[N]=z}return b})}function x2($,X){return t({additionalProperties:$.jsonSchema,type:\"object\"},(Q,W)=>{if(Q===null||typeof Q!==\"object\"||Array.isArray(Q))throw Error(`${W} must be an object`);let J={};for(let[K,b]of Object.entries(Q))try{J[K]=$.decode(b,`${W}.${K}`)}catch{throw Error(X?.(W)??`${W} contains an unsupported value`)}return J})}function T0($,X){return t({oneOf:$.map((Q)=>Q.jsonSchema)},(Q,W)=>{for(let J of $)try{return J.decode(Q,W)}catch{}throw Error(X?.(W)??`${W} is unsupported`)})}function n($,X,Q=$.jsonSchema){return t(Q,(W,J)=>{let K=$.decode(W,J);return X(K,J),K},{optionalInput:$.optionalInput,optionalOutput:$.optionalOutput})}function O1($,X){return t($.jsonSchema,(Q,W)=>X($.decode(Q,W)),{optionalInput:$.optionalInput,optionalOutput:$.optionalOutput})}function Y0($,X){return t($,X)}function i1($,X){return t({oneOf:Object.entries(X).map(([Q,W])=>({allOf:[W.jsonSchema,{properties:{[$]:{const:Q,type:\"string\"}},required:[$],type:\"object\"}]}))},(Q,W)=>{if(Q===null||typeof Q!==\"object\"||Array.isArray(Q))throw Error(`${W} must be an object`);let J=Q[$];if(typeof J!==\"string\"||!(J in X))throw Error(`${$} is unsupported`);return X[J].decode(Q,W)})}var V0=16384,p2=new TextEncoder;function r1($,X){let Q=0,W=0,J=(N)=>{if(N.length>V0)throw Error(`${X} exceeds ${V0} bytes`);if(W+=p2.encode(JSON.stringify(N)).byteLength,W>V0)throw Error(`${X} exceeds ${V0} bytes`)},K=(N,q)=>{if(++Q>256||q>8)throw Error(`${X} exceeds metadata complexity limits`);if(N===null||typeof N===\"boolean\")return N;if(typeof N===\"number\"&&Number.isFinite(N))return N;if(typeof N===\"string\")return J(N),N;if(typeof N!==\"object\"||N===null)throw Error(`${X} must be JSON-safe`);let z=Array.isArray(N),B=Object.getPrototypeOf(N);if(!z&&B!==Object.prototype&&B!==null)throw Error(`${X} must contain only plain JSON objects`);let P=Reflect.ownKeys(N);if(P.length>256)throw Error(`${X} exceeds metadata complexity limits`);let G=[];for(let M of P){if(z&&M===\"length\")continue;if(typeof M!==\"string\")throw Error(`${X} must be JSON-safe`);let L=Object.getOwnPropertyDescriptor(N,M);if(!(\"value\"in L)||!L.enumerable)throw Error(`${X} must contain only enumerable data properties`);J(M),G.push([M,K(L.value,q+1)])}if(z){if(G.length!==N.length||G.some(([M],L)=>M!==String(L)))throw Error(`${X} must contain only dense JSON arrays`);return G.map(([,M])=>M)}return Object.fromEntries(G)},b=K($,0);if(p2.encode(JSON.stringify(b)).byteLength>V0)throw Error(`${X} exceeds ${V0} bytes`);return b}var j0=u({maxLength:4096}),o2=H({id:U(j0),uri:U(j0),mediaType:U(j0),checksum:U(j0),version:U(j0),byteSize:U(Q0({integer:!0,minimum:0})),schemaVersion:U(j0),metadata:U(Y0({type:\"object\",additionalProperties:!0},($,X)=>{if(!$||typeof $!==\"object\"||Array.isArray($))throw Error(`${X} must be an object`);return $}))}),t0=Y0({...o2.jsonSchema,anyOf:[{required:[\"id\"]},{required:[\"uri\"]}]},($,X)=>{let Q=r1($,X),W=o2.decode(Q,X);if(!W.id&&!W.uri)throw Error(`${X} requires id or uri`);let J=[\"id\",\"uri\",\"mediaType\",\"checksum\",\"version\",\"byteSize\",\"schemaVersion\",\"metadata\"];if(Object.keys(Q).some((K)=>!J.includes(K)))throw Error(`${X} has unknown fields; use metadata for application fields`);return W.id?{...W,id:W.id}:{...W,uri:W.uri}}),e0=f([\"read\",\"write\",\"reuse\"]),e4=H({operation:e0,artifact:t0});function i2($){if($!==null&&typeof $===\"object\"){for(let X of Object.values($))i2(X);Object.freeze($)}return $}var $1=Y0({type:\"object\",additionalProperties:!1,properties:{tags:{type:\"array\",maxItems:64,items:{type:\"string\",minLength:1,maxLength:256}},owner:{type:\"string\",minLength:1,maxLength:256},domain:{type:\"string\",minLength:1,maxLength:256},annotations:{type:\"object\",additionalProperties:!0}}},($,X)=>{let Q=r1($,X);if(!Q||typeof Q!==\"object\"||Array.isArray(Q))throw TypeError(`${X} must be an object`);let W=(J)=>typeof J===\"string\"&&J.trim().length>0&&J.length<=256;for(let[J,K]of Object.entries(Q))if(J===\"tags\"){if(!Array.isArray(K)||K.length>64||!K.every(W))throw TypeError(`${X}.tags must contain at most 64 nonblank strings of at most 256 characters`)}else if(J===\"owner\"||J===\"domain\"){if(!W(K))throw TypeError(`${X}.${J} must be a nonblank string of at most 256 characters`)}else if(J===\"annotations\"){if(!K||typeof K!==\"object\"||Array.isArray(K))throw TypeError(`${X}.annotations must be an object`)}else throw TypeError(`${X}.${J} is unknown; use annotations for application fields`);return i2(Q)});var r2=3,L0=128,R0=4096,n1=262144;var g6=[\"TUBELESS_CHILD_FAILED\",\"TUBELESS_DEFINITION_CACHE_INVALID\",\"TUBELESS_DEFINITION_DEPENDENCY_CONTRADICTORY\",\"TUBELESS_DEFINITION_DEPENDENCY_CYCLE\",\"TUBELESS_DEFINITION_DEPENDENCY_DUPLICATE\",\"TUBELESS_DEFINITION_DEPENDENCY_NOT_IN_STEPS\",\"TUBELESS_DEFINITION_DEPENDENCY_SELF_REFERENCE\",\"TUBELESS_DEFINITION_FINALIZER_STEP_NOT_IN_STEPS\",\"TUBELESS_DEFINITION_IMPLEMENTATION_VERSION_INVALID\",\"TUBELESS_DEFINITION_OPTIONS_SCHEMA_CONFLICT\",\"TUBELESS_DEFINITION_PIPELINE_DESCRIPTION_BLANK\",\"TUBELESS_DEFINITION_PIPELINE_ID_BLANK\",\"TUBELESS_DEFINITION_PIPELINE_NAME_BLANK\",\"TUBELESS_DEFINITION_STEP_CACHE_INVALID\",\"TUBELESS_DEFINITION_STEP_ID_BLANK\",\"TUBELESS_DEFINITION_STEP_ID_RESERVED\",\"TUBELESS_DEFINITION_STEP_IDS_DUPLICATE\",\"TUBELESS_DEFINITION_STEP_NAME_BLANK\",\"TUBELESS_DEFINITION_TARGET_FINALIZER_MISMATCH\",\"TUBELESS_DEFINITION_TARGET_NOT_IN_STEPS\",\"TUBELESS_DEFINITION_TARGETS_DUPLICATE\",\"TUBELESS_FINALIZATION_CANCELLED\",\"TUBELESS_FINALIZATION_FAILED\",\"TUBELESS_FINAL_RESULT_VALIDATION_FAILED\",\"TUBELESS_OPTIONS_VALIDATION_FAILED\",\"TUBELESS_PLANNING_SELECTION_CONFLICT\",\"TUBELESS_PLANNING_STEP_SELECTION_DUPLICATE\",\"TUBELESS_PLANNING_STEP_SELECTION_EMPTY\",\"TUBELESS_PLANNING_STEP_UNKNOWN\",\"TUBELESS_PLANNING_TARGET_SELECTION_DUPLICATE\",\"TUBELESS_PLANNING_TARGET_SELECTION_EMPTY\",\"TUBELESS_PLANNING_TARGET_UNDECLARED\",\"TUBELESS_PLANNING_TARGET_UNKNOWN\",\"TUBELESS_RUN_CANCELLED\",\"TUBELESS_RUN_CONCURRENCY_INVALID\",\"TUBELESS_RUN_CACHE_INVALID\",\"TUBELESS_STEP_OUTPUT_VALIDATION_FAILED\",\"TUBELESS_STEP_FAILED\"],O6=[\"cancellation\",\"child\",\"definition\",\"finalization\",\"selection\",\"step\",\"validation\"],A6=[\"definition\",\"execution\",\"finalization\",\"planning\"],C6=[\"cancelled\",\"completed\",\"failed\"],$2=[\"dry-run\",\"failed-dependency\",\"fail-fast\",\"filtered\",\"policy\",\"unmet-dependency\"],T6=[\"cancelled\",\"completed\",\"failed\",\"pending\",\"running\",\"skipped\"],s=u({allowEmpty:!0}),e=u(),t1=u({allowEmpty:!0,maxLength:R0}),M0=Q0({integer:!0,minimum:0}),$0=Q0(),A1=I(e),R6=I(e,{maxItems:L0,noun:\"strings\"});function X2($,X,Q,W){if($===null||typeof $!==\"object\"||Array.isArray($))throw Error(`${X} must be an object`);if(!W&&Q>=16||W&&Q>8)throw Error(W?\"error.fanOut cause exceeds its depth limit\":\"error.cause exceeds 16 levels\");let J=$,K=(z)=>{let B=J[z];if(B===void 0)return;if(typeof B!==\"string\")throw Error(`${X}.${z} must be a string`);return B},b={message:K(\"message\")??\"\"},N=K(\"name\"),q=K(\"sourceCode\");if(N!==void 0)b.name=N;if(q!==void 0)b.sourceCode=q;if(W&&[b.message,b.name,b.sourceCode].some((z)=>z!==void 0&&z.length>1024))throw Error(\"error.fanOut cause strings exceed 1024 code units\");if(J.cause!==void 0)b.cause=X2(J.cause,X,Q+1,W);return b}var a2={additionalProperties:!1,properties:{cause:{$ref:\"#/components/schemas/PipelineErrorCause\"},message:{type:\"string\"},name:{type:\"string\"},sourceCode:{type:\"string\"}},required:[\"message\"],type:\"object\"},_6=Y0(a2,($,X)=>X2($,X,0,!1)),t2=Y0({$ref:\"#/components/schemas/PipelineErrorCause\"},($,X)=>X2($,X,0,!0)),S6=Y0({items:{oneOf:[{type:\"number\"},{type:\"string\",maxLength:R0}]},maxItems:L0,type:\"array\"},($,X)=>{if(!Array.isArray($)||$.length>L0||!$.every((Q)=>typeof Q===\"string\"||typeof Q===\"number\"&&Number.isFinite(Q)))throw Error(`${X} must contain strings or finite numbers`);if($.some((Q)=>typeof Q===\"string\"&&Q.length>R0))throw Error(`${X} string exceeds ${R0} code units`);return $}),e1=H({message:u({maxLength:R0}),path:U(S6)}),k6=Y0({items:e1.jsonSchema,maxItems:L0,type:\"array\"},($,X)=>{if(!Array.isArray($))throw Error(`${X} must be an array`);if($.length>L0)throw Error(`${X} must contain at most ${L0} entries`);return $.map((Q,W)=>e1.decode(Q,`${X}[${W}]`))}),e2=H({cancelled:h(),error:t2,index:M0,key:u({allowEmpty:!0,maxLength:1024}),keyTruncated:h()}),$$=n(H({failureCount:M0,failures:I(e2,{maxItems:32,noun:\"entries\"}),omittedFailureCount:M0,schedulerError:U(t2)}),($)=>{if($.failureCount-$.failures.length!==$.omittedFailureCount)throw Error(\"error.fanOut counts do not match failures\");let X=-1;for(let Q of $.failures){if(Q.index<=X)throw Error(\"error.fanOut indices must be in input order\");X=Q.index}}),y0=H({cause:U(n(_6,()=>{return},{$ref:\"#/components/schemas/PipelineErrorCause\"})),code:f(g6),fanOut:U(n($$,()=>{return},{$ref:\"#/components/schemas/PipelineFanOutDiagnostics\"})),issues:U(k6),kind:f(O6),message:o1(s,\"\"),phase:f(A6),sourceCode:U(s),stack:U(s)}),C1=n(y0,()=>{return},{$ref:\"#/components/schemas/PipelineError\"}),X$=H({outputSource:U(f([\"override\",\"cache\"])),completed:U($0),depth:U($0),id:u({maxLength:R0}),label:U(t1),name:U(t1),status:U(f(T6)),total:U($0)}),w6=n(I(X$,{maxItems:L0,noun:\"details\"}),($,X)=>{if(new TextEncoder().encode(JSON.stringify($)).byteLength>n1)throw Error(`${X} exceeds the ${n1}-byte limit`)}),Z2=O1(n(H({completed:$0,detailCount:U(M0),details:U(w6),message:U(s),total:U($0)}),($)=>{if($.details!==void 0&&$.detailCount!==void 0&&$.detailCount<$.details.length)throw Error(\"payload.progress.detailCount must be at least the retained details length\")}),($)=>$.details!==void 0&&$.detailCount===void 0?{...$,detailCount:$.details.length}:$),D0=Q0({integer:!0,minimum:1}),Z$=[\"for-each\",\"single\",\"iterate\"],R1=n(H({mode:f(Z$),maxIterations:U(D0),pipelineId:e,stepCount:M0,stepIds:R6}),($,X)=>{if($.mode===\"iterate\"!==($.maxIterations!==void 0))throw Error(`${X}: only iterate requires maxIterations`);if($.stepCount<$.stepIds.length)throw Error(`${X}.stepCount must be at least the retained stepIds length`)}),h0=H({engine:u({maxLength:R0}),target:U(t1)}),H0=n(H({version:T0([m(1),m(2),m(3)]),definitionId:u({maxLength:80}),structuralFingerprint:u({maxLength:80}),implementationVersion:U(u({maxLength:256}))}),($,X)=>{if(![$.definitionId,$.structuralFingerprint].every((Q)=>/^sha256:[a-f0-9]{64}$/.test(Q)))throw Error(`${X} must contain SHA-256 fingerprints`);if($.implementationVersion!==void 0&&$.implementationVersion.trim().length===0)throw Error(`${X}.implementationVersion must not be blank`)}),Z1=u({maxLength:4096}),S0=I(Z1,{maxItems:4096}),n2=n(u({maxLength:80}),($,X)=>{if(!/^sha256:[a-f0-9]{64}$/.test($))throw Error(`${X} must be a SHA-256 fingerprint`)}),Q2=H({maxTurns:D0,maxCalls:M0,maxDecisions:D0,maxDepth:U(M0),maxConcurrency:D0}),W2=H({limits:Q2,resultSchemaFingerprint:n2,capabilities:I(H({name:Z1,description:Z1,inputSchemaFingerprint:n2,identity:H0}),{maxItems:4096})}),J2=H({cache:U(f([\"use\",\"recompute\",\"bypass\"])),dryRun:U(h()),continueOnError:U(h()),maxConcurrency:U($0),targets:U(S0),stepIds:U(S0)}),I6=H({metadata:U($1),agent:U(W2),id:Z1,dependencies:S0,optionalDependencies:S0,skipAfterFailureOf:S0,dryRun:f([\"custom\",\"run\",\"skip\"]),runtimeSkipPossible:h(),outputValidated:h(),cache:U(H({version:u({maxLength:256}),maxAgeMs:U($0),policy:f([\"use\",\"recompute\",\"bypass\",\"dynamic\"])})),nestedPipeline:U(H({pipelineId:Z1,mode:f(Z$),maxIterations:U(D0),controls:U(J2),identity:U(H0),stepIds:S0,concurrency:U(T0([$0,m(\"dynamic\")]))})),remote:U(h0)}),Q1=n(H({identity:H0,metadata:U($1),steps:I(I6,{maxItems:4096}),targetIds:S0,requiredFinalizerStepIds:U(S0),optionsValidated:h(),resultValidated:h()}),($,X)=>{if($.identity.version!==3&&($.metadata!==void 0||$.steps.some((Q)=>Q.metadata!==void 0||Q.nestedPipeline?.identity?.version===3)))throw Error(`${X}: metadata requires identity version 3`);for(let Q of $.steps){if(Q.agent&&$.identity.version===1)throw Error(`${X}: agent requires identity version 2`);let W=Q.nestedPipeline;if(!W)continue;if(W.mode===\"iterate\"!==(W.maxIterations!==void 0)||W.controls!==void 0&&W.mode!==\"iterate\")throw Error(`${X}: invalid iteration metadata`);if($.identity.version===1&&(W.mode===\"iterate\"||W.identity?.version===2))throw Error(`${X}: iteration requires identity version 2`)}if(new TextEncoder().encode(JSON.stringify($)).byteLength>262144)throw Error(`${X} exceeds the 262144-byte definition limit`)}),T1=H({kind:f([\"all\",\"exact\",\"not-selected\",\"outside-target-closure\"])}),v6=H({kind:m(\"target\"),targetId:e}),s1=H({dependentId:e,kind:f([\"failure-gate\",\"optional-only\",\"required-dependency\"]),targetId:e}),f6=i1(\"kind\",{all:T1,exact:T1,\"failure-gate\":s1,\"not-selected\":T1,\"optional-only\":s1,\"outside-target-closure\":T1,\"required-dependency\":s1,target:v6}),K2=I(f6,{maxItems:L0,noun:\"reasons\"}),y6=x2(T0([h(),$0,s]),($)=>`${$} values must be booleans, finite numbers, or strings`),W0={correlationId:U(s),itemKey:U(s),parentRunId:U(s),pipelineId:e,runId:e,timestampMs:$0,version:T0([m(2),m(r2)]),iteration:U(H({runId:e,stepId:e,attemptId:e,index:D0}))},X1={attemptId:U(s),durationMs:U($0)},_0={stepId:e},a1=H({}),Q$={\"step.artifact\":H({...W0,..._0,attemptId:e,name:m(\"step.artifact\"),payload:H({operation:e0,preview:h(),artifact:t0})}),\"pipeline.completed\":H({...W0,durationMs:U($0),error:U(C1),name:m(\"pipeline.completed\"),payload:H({dryRun:h(),errorCount:M0,finalized:h(),status:f(C6,($)=>`${$} must be cancelled, completed, or failed`),stepCount:M0})}),\"pipeline.finalize.completed\":H({...W0,durationMs:$0,name:m(\"pipeline.finalize.completed\"),payload:a1}),\"pipeline.finalize.failed\":H({...W0,durationMs:$0,error:C1,name:m(\"pipeline.finalize.failed\"),payload:a1}),\"pipeline.finalize.started\":H({...W0,name:m(\"pipeline.finalize.started\"),payload:a1}),\"pipeline.log\":H({...W0,attemptId:U(s),name:m(\"pipeline.log\"),payload:H({level:f([\"error\",\"log\",\"warn\"],($)=>`${$} must be error, log, or warn`),message:o1(s,\"\")}),stepId:U(s)}),\"pipeline.started\":H({...W0,name:m(\"pipeline.started\"),payload:n(H({definitionIdentity:U(H0),definitionSnapshot:U(Q1),dryRun:h(),planOk:h(),parentStepId:U(e),stepCount:M0,targetIds:A1}),($)=>{if($.definitionSnapshot&&JSON.stringify($.definitionSnapshot.identity)!==JSON.stringify($.definitionIdentity))throw Error(\"Definition snapshot must match the run definition identity\")})}),\"step.attempted\":H({...W0,...X1,..._0,name:m(\"step.attempted\"),payload:H({attempt:$0,attributes:y6})}),\"step.cancelled\":H({...W0,...X1,..._0,error:C1,name:m(\"step.cancelled\"),payload:H({status:m(\"cancelled\"),outputSource:U(f([\"override\",\"cache\"]))})}),\"step.complete\":H({...W0,...X1,..._0,name:m(\"step.complete\"),payload:H({status:m(\"completed\"),outputSource:U(f([\"override\",\"cache\"]))})}),\"step.failed\":H({...W0,...X1,..._0,error:C1,name:m(\"step.failed\"),payload:H({status:m(\"failed\"),outputSource:U(f([\"override\",\"cache\"]))})}),\"step.planned\":H({...W0,..._0,name:m(\"step.planned\"),payload:H({dependencies:A1,description:U(s),dryRun:f([\"custom\",\"run\",\"skip\"],($)=>`${$} must be custom, run, or skip`),name:U(s),nestedPipeline:U(R1),optionalDependencies:A1,remote:U(h0),runtimeSkipPossible:h(),selected:h(),selectionReasons:K2,skipAfterFailureOf:A1})}),\"step.running\":H({...W0,..._0,attemptId:e,name:m(\"step.running\"),payload:H({progress:U(Z2),outputSource:U(f([\"override\",\"cache\"]))})}),\"step.skipped\":H({...W0,...X1,..._0,name:m(\"step.skipped\"),payload:H({dependencyId:U(s),message:U(s),reason:f($2),status:m(\"skipped\"),outputSource:U(f([\"override\",\"cache\"]))})})},W$={if:{properties:{version:{const:2}},required:[\"version\"]},then:{properties:{iteration:!1,payload:{properties:{definitionIdentity:{properties:{version:{const:1}}},nestedPipeline:{properties:{mode:{enum:[\"single\",\"for-each\"]},maxIterations:!1}}}}}}},s2=i1(\"name\",Q$),z3=n(s2,($)=>{if($.iteration!==void 0&&$.iteration.runId!==$.parentRunId)throw Error(\"iteration.runId must match parentRunId\");if($.name===\"pipeline.started\"&&$.payload.parentStepId!==void 0&&$.parentRunId===void 0)throw Error(\"payload.parentStepId requires parentRunId\");if($.version!==2)return;if($.iteration!==void 0||$.name===\"step.planned\"&&$.payload.nestedPipeline?.mode===\"iterate\")throw Error(\"Iteration metadata requires trace version 3\");if($.name===\"pipeline.started\"&&$.payload.definitionIdentity!==void 0&&$.payload.definitionIdentity.version!==1)throw Error(\"Trace version 2 requires identity version 1\")},{...s2.jsonSchema,...W$}),N3={PipelineError:y0.jsonSchema,PipelineErrorCause:a2,PipelineFanOutDiagnostics:$$.jsonSchema,PipelineFanOutFailure:e2.jsonSchema,PipelineProgressDetail:X$.jsonSchema,PipelineValidationIssue:e1.jsonSchema,StoredPipelineEvent:{oneOf:Object.values(Q$).map(($)=>{let X=$.jsonSchema;return{...X,...W$,properties:{...X.properties,id:{minimum:0,type:\"integer\"}},required:[...X.required,\"id\"]}})}};var a=u({allowEmpty:!0}),D=u(),X0=Q0(),J0=Q0({integer:!0,minimum:0}),W1=Q0({integer:!0,minimum:1}),b$=f([\"running\",\"completed\",\"failed\",\"cancelled\"]),h6=f([\"planned\",\"running\",\"completed\",\"failed\",\"cancelled\",\"skipped\"]),J$=U(f([\"override\",\"cache\"])),K$=H({agentRunId:D,turn:W1,callId:D,tool:D,parentAttemptId:D}),Y$=H({version:m(d2),agent:U(H({stepId:D,limits:Q2,capabilities:I(D)})),agentTurn:U(H({agentRunId:D,index:W1,decision:U(f([\"continue\",\"finish\"])),stateVersion:U(J0),nextStateVersion:U(J0),callCount:U(J0),callsAdmitted:U(J0),calls:I(K$)})),agentCall:U(K$),itemKey:U(a),iteration:U(H({runId:D,stepId:D,attemptId:D,index:W1})),definitionIdentity:U(H0),correlationId:U(a),parentRunId:U(a),parentStepId:U(D),dryRun:h(),durationMs:U(X0),error:U(y0),eventCount:J0,finishedAtMs:U(X0),logCount:J0,logs:I(H({attemptId:U(a),id:J0,level:f([\"error\",\"log\",\"warn\"]),message:a,stepId:U(a),timestampMs:X0})),pipelineId:D,runId:D,startedAtMs:X0,status:b$,steps:I(H({id:D,status:h6,outputSource:J$,dependencies:U(I(D)),description:U(a),name:U(a),durationMs:U(X0),finishedAtMs:U(X0),startedAtMs:U(X0),nestedPipeline:U(R1),optionalDependencies:U(I(D)),remote:U(h0),skipAfterFailureOf:U(I(D)),skipReason:U(f($2)),progress:U(Z2),attempt:U(H({attemptId:D,outputSource:J$,durationMs:U(X0),finishedAtMs:U(X0),retries:I(W1),startedAtMs:X0,status:f([\"running\",\"completed\",\"failed\",\"cancelled\",\"skipped\"])})),artifacts:U(I(H({artifact:t0,operation:e0,preview:h(),attemptId:D,timestampMs:X0})))}))}),z$={identity:U(H0),activeRuns:J0,firstSeenAtMs:X0,lastSeenAtMs:X0,pipelineId:D,runCount:J0},N$=H(z$),B$=H({...z$,snapshot:U(Q1),targetIds:I(D),steps:I(H({dependencies:I(D),description:U(a),dryRun:a,id:D,name:U(a),nestedPipeline:U(R1),remote:U(h0),optionalDependencies:I(D),runtimeSkipPossible:h(),skipAfterFailureOf:I(D)}))}),c0=H({runId:D,pipelineId:D,correlationId:U(a),parentRunId:U(a),startedAtMs:X0,status:b$,dryRun:h(),durationMs:U(X0),eventCount:J0,subtreeEventCount:J0,stepCount:J0,rootRunId:D,descendantCount:J0,subtreeIsRunning:h(),activity:H({count:J0,names:I(a,{maxItems:3}),message:U(a)}),origin:U(H({stepId:U(D),itemKey:U(a),iteration:U(W1)}))});var z0=50,q$=16,G0=u({allowEmpty:!0}),N0=u(),J1=Q0(),r=Q0({integer:!0,minimum:0}),c6=O1(J2,($)=>{let{targets:X,stepIds:Q,...W}=$;if(X!==void 0&&Q!==void 0)throw Error(\"Child selectors are mutually exclusive.\");return X!==void 0?{...W,targets:X}:{...W,stepIds:Q}}),b2=I(N0),l6=n(H({choices:U(I(G0)),default:U(T0([G0,J1,h()])),description:U(G0),environment:U(G0),exclusive:U(m(!0)),flag:N0,group:U(m(\"execution\")),integer:U(h()),key:N0,max:U(J1),min:U(J1),multiple:h(),mustExist:U(h()),pathKind:U(f([\"directory\",\"file\"])),positional:h(),required:h(),short:U(G0),type:f([\"boolean\",\"number\",\"path\",\"string\"])}),($,X)=>{let Q=$.type===\"boolean\"?\"boolean\":$.type===\"number\"?\"number\":\"string\";if($.default!==void 0&&typeof $.default!==Q)throw Error(`${X}.default must be a ${Q}`)}),U$=H({commands:I(H({canPlan:h(),id:N0,name:N0,description:U(G0),parameters:I(l6)}))}),P$=H({definition:U(Q1),dryRun:h(),ok:h(),pipelineId:N0,errors:I(Y0(y0.jsonSchema,($,X)=>({...y0.decode($,X),...H({message:G0,stepId:U(G0)}).decode($,X)}))),steps:I(H({metadata:U($1),agent:U(W2),dependencies:b2,description:U(G0),dryRun:f([\"custom\",\"run\",\"skip\"]),id:N0,name:U(G0),optionalDependencies:b2,runtimeSkipPossible:h(),selected:h(),selectionReasons:K2,skipAfterFailureOf:b2,skipReason:U(f([\"dry-run\",\"failed-dependency\",\"fail-fast\",\"filtered\",\"policy\",\"unmet-dependency\"])),remote:U(h0),nestedPipeline:U(n(H({mode:f([\"single\",\"for-each\",\"iterate\"]),maxIterations:U(Q0({integer:!0,minimum:1})),controls:U(c6),identity:U(H0),concurrency:U(T0([J1,m(\"dynamic\")])),pipelineId:N0,stepIds:I(N0)}),($,X)=>{if($.mode===\"iterate\"!==($.maxIterations!==void 0))throw Error(`${X}: only iterate requires maxIterations`)}))}))}),M$=H({activeRunCount:r,completedRunCount:r,failedRunCount:r,generatedAtMs:J1,lastEventId:r,revision:r,runCount:r,eventCount:r,rootRunCount:r,matchingRootCount:r,offset:r,definitions:I(N$),liveRunIds:I(N0),runs:I(c0,{maxItems:z0}),selectedRun:U(c0)}),m6=H({stepId:U(N0),count:r}),G$=H({run:Y$,ancestors:I(c0),children:I(c0),childCount:r,childSteps:I(m6),descendantCount:r}),F$=H({children:I(c0),page:r,childCount:r}),L$=H({definition:B$}),H$=H({runs:I(c0,{maxItems:z0}),offset:r,runCount:r});function k0($,X){try{return $.decode(X,\"Studio response\")}catch{return}}class E0 extends Error{status;constructor($,X){super(X);this.status=$}}function u0($){return typeof $===\"object\"&&$!==null&&!Array.isArray($)}function V6($){return typeof $===\"number\"&&Number.isFinite($)}function j6($){return k0(M$,$)}function D6($){return k0(U$,$)?.commands}function B0($,X,Q){if(!u0($))return new E0(Q,X);if(Array.isArray($.errors)&&$.errors.every((W)=>typeof W===\"string\"))return new E0(Q,$.errors.join(`\n`));return new E0(Q,typeof $.message===\"string\"?$.message:X)}function q0($){return Error(`Studio API returned an invalid response for ${$}.`)}function g$($=fetch,X=\"\"){let Q=new Set,W,J,K=()=>{if(W)throw new E0(W,W===401?\"Sign in to continue.\":\"Access denied.\")},b=async(q,z)=>{K();let B=await $(X+String(q),z);if(!W&&(B.status===401||B.status===403)){W=B.status;for(let P of Q)P(W)}return K(),B},N=async(q)=>{let z;try{z=await q.json()}catch{throw K(),new E0(q.status,\"Studio API returned invalid JSON.\")}return K(),z};return{subscribeAccessDenied(q){if(Q.add(q),W)q(W);return()=>{Q.delete(q)}},async loadSnapshot({query:q=\"\",offset:z=0,selectedRunId:B}={}){let P=new URLSearchParams;if(q)P.set(\"query\",q);if(z)P.set(\"offset\",String(z));if(B)P.set(\"run\",B);let G=\"/api/snapshot\"+(P.size?\"?\"+P:\"\"),M=J?.key===G?J:void 0,L=await b(G,{cache:\"no-store\",headers:M?.etag?{\"if-none-match\":M.etag}:void 0});if(L.status===304&&M)return M.snapshot;let Y=await N(L);if(!L.ok)throw B0(Y,\"Snapshot request failed.\",L.status);let F=j6(Y);if(!F)throw q0(\"snapshot\");return J={key:G,etag:L.headers.get(\"etag\"),snapshot:F},F},async loadDefinition(q,z){let B=new URLSearchParams({pipelineId:q});if(z)B.set(\"definitionId\",z);let P=await b(\"/api/definitions?\"+B,{cache:\"no-store\"}),G=await N(P);if(!P.ok)throw B0(G,\"Definition request failed.\",P.status);let M=k0(L$,G);if(!M)throw q0(\"definition\");return M.definition},async loadDefinitionRuns(q,z,B=0){let P=new URLSearchParams({pipelineId:q,offset:String(B)});if(z)P.set(\"definitionId\",z);let G=await b(\"/api/definitions/runs?\"+P,{cache:\"no-store\"}),M=await N(G);if(!G.ok)throw B0(M,\"Definition runs request failed.\",G.status);let L=k0(H$,M);if(!L)throw q0(\"definition runs\");return L},async loadRunDetail(q){let z=await b(\"/api/runs/\"+encodeURIComponent(q),{cache:\"no-store\"}),B=await N(z);if(z.status===404)return null;if(!z.ok)throw B0(B,\"Run detail request failed.\",z.status);let P=k0(G$,B);if(!P)throw q0(\"run detail\");return P},async loadChildRuns(q,z){let B=await b(\"/api/runs/\"+encodeURIComponent(q)+\"/children?page=\"+z,{cache:\"no-store\"}),P=await N(B);if(B.status===404)return null;if(!B.ok)throw B0(P,\"Child runs request failed.\",B.status);let G=k0(F$,P);if(!G)throw q0(\"child runs\");return G},async loadCommands(){let q=await b(\"/api/commands\",{cache:\"no-store\"}),z=await N(q);if(!q.ok)throw B0(z,\"Commands request failed.\",q.status);let B=D6(z);if(!B)throw q0(\"commands\");return B},async loadCapabilities(){let q=await b(\"/api/capabilities\",{cache:\"no-store\"}),z=await N(q);if(!q.ok||!u0(z)||typeof z.canCancel!==\"boolean\"||typeof z.canClearHistory!==\"boolean\"){if(!q.ok)throw B0(z,\"Capabilities request failed.\",q.status);throw q0(\"capabilities\")}return{canCancel:z.canCancel,canClearHistory:z.canClearHistory}},async clearHistory(){let q=await b(\"/api/history\",{method:\"DELETE\",headers:{\"x-tubeless-studio-clear-history\":\"1\"}}),z=await N(q);if(!q.ok)throw B0(z,\"History could not be cleared.\",q.status);if(!u0(z)||z.cleared!==!0||!V6(z.eventCount))throw q0(\"clear history\");return J=void 0,{eventCount:z.eventCount}},async previewPlan(q,z){let B=await b(\"/api/commands/\"+encodeURIComponent(q)+\"/plan\",{method:\"POST\",headers:{\"content-type\":\"application/json\",\"x-tubeless-studio-plan\":\"1\"},body:JSON.stringify(z)}),P=await N(B);if(!B.ok)throw B0(P,\"Plan request failed.\",B.status);let G=u0(P)?k0(P$,P.plan):void 0;if(!G)throw q0(\"plan\");return G},async cancelRun(q){let z=await b(\"/api/runs/\"+encodeURIComponent(q)+\"/cancel\",{method:\"POST\",headers:{\"x-tubeless-studio-cancel\":\"1\"}}),B=await N(z);if(!z.ok)throw B0(B,\"Run could not be cancelled.\",z.status);if(!u0(B)||B.cancelled!==!0||B.runId!==q)throw q0(\"cancel run\")},async launch(q,z){let B=await b(\"/api/commands/\"+encodeURIComponent(q)+\"/runs\",{method:\"POST\",headers:{\"content-type\":\"application/json\",\"x-tubeless-studio-launch\":\"1\"},body:JSON.stringify({values:z})}),P=await N(B);if(!B.ok)throw B0(P,\"Launch failed.\",B.status);if(!u0(P)||P.accepted!==!0||typeof P.runId!==\"string\"||P.runId.length===0)throw q0(\"launch\");return P.runId}}}var A$=1200;function O$($){return[$.runId,$.eventCount,$.subtreeEventCount,$.rootRunId,$.status].join(\":\")}function u6($){return{...$,activeRunCount:0,completedRunCount:0,definitions:[],failedRunCount:0,runCount:0,eventCount:0,rootRunCount:0,matchingRootCount:0,offset:0,selectedRun:void 0,lastEventId:0,liveRunIds:[],runs:[]}}class Y2{#P;#F;#L;#q=new Set;#Y=null;#Q;#J=null;#b=0;#X=!1;#Z;#M=!1;#K=0;#G=!1;#U=!1;#$;constructor($,{runId:X=null,detailRetryMs:Q=1200}={}){this.#P=$,this.#L=Q,this.#$={connected:!0,historyQuery:{query:\"\",offset:0},selection:X?{status:\"loading\",runId:X}:{status:\"none\"},manualRefreshing:!1,snapshot:null},this.#F=$.subscribeAccessDenied?.((W)=>{if(this.#K+=1,this.#N(),this.#Z)clearTimeout(this.#Z);this.#Z=void 0,this.#U=!1,this.#W({accessDenied:W,connected:!1,snapshot:null,selection:{status:\"none\"},manualRefreshing:!1})})}getState(){return this.#$}subscribe($){return this.#q.add($),()=>this.#q.delete($)}setHistoryQuery({query:$=\"\",offset:X=0}){if(this.#X||this.#$.accessDenied)return;if(this.#$.historyQuery.query===$&&this.#$.historyQuery.offset===X)return;this.#K+=1,this.#W({historyQuery:{query:$,offset:X}}),this.refresh(!0)}selectRun($){if(this.#X||this.#$.accessDenied||$===this.#B())return;let X=$?this.#A($):void 0,Q=X&&this.#$.snapshot?.runs.some((W)=>W.runId===X.rootRunId);if(this.#N(),this.#K+=1,this.#W({historyQuery:Q?this.#$.historyQuery:{query:\"\",offset:0},selection:$?{status:\"loading\",runId:$,summary:X}:{status:\"none\"}}),X)this.#J=O$(X),this.#z(this.#b);this.refresh(!0)}refresh($=!1){if(this.#X||this.#$.accessDenied)return;if($)this.#M=!0,this.#W({manualRefreshing:!0});if(this.#G){if($)this.#U=!0;return}this.#H()}invalidate({delayMs:$=0,resetHistory:X=!1}={}){if(this.#X||this.#$.accessDenied)return;this.#K+=1;let Q=this.#B();if(X)this.#N(),this.#W({historyQuery:{query:\"\",offset:0},selection:Q?{status:\"unavailable\",runId:Q}:{status:\"none\"},snapshot:this.#$.snapshot?u6(this.#$.snapshot):null});else this.#T($);if(this.#Z)clearTimeout(this.#Z);if(this.#Z=void 0,$>0){this.#Z=setTimeout(()=>{this.#Z=void 0,this.refresh(!0)},$);return}this.refresh(!0)}dispose(){if(this.#X)return;if(this.#F?.(),this.#X=!0,this.#K+=1,this.#N(),this.#Z)clearTimeout(this.#Z);this.#Z=void 0,this.#q.clear()}#B(){return this.#$.selection.status===\"none\"?null:this.#$.selection.runId}#A($){let{snapshot:X,selection:Q}=this.#$;return(X?.selectedRun?.runId===$?X.selectedRun:void 0)??X?.runs.find((W)=>W.runId===$)??(Q.status===\"ready\"?Q.detail.children.find((W)=>W.runId===$)??Q.detail.ancestors.find((W)=>W.runId===$):void 0)}#C($){let X=this.#$.selection,Q=this.#B();if(Q){let W=$.selectedRun??$.runs.find((J)=>J.runId===Q);if(W?.runId===Q){let J=O$(W);X=X.status===\"ready\"?{...X,summary:W}:{status:\"loading\",runId:Q,summary:W};let K=J!==this.#J;if(this.#J=J,this.#W({connected:!0,snapshot:$,selection:X}),K)this.#z(this.#b);return}this.#N(),X={status:\"unavailable\",runId:Q}}this.#W({connected:!0,snapshot:$,selection:X})}#H(){if(this.#X||this.#$.accessDenied)return;this.#G=!0;let $=this.#K;this.#M=!1,this.#P.loadSnapshot({...this.#$.historyQuery,selectedRunId:this.#B()}).then((X)=>{if(this.#X||this.#$.accessDenied||$!==this.#K)return;this.#C(X)}).catch(()=>{if(this.#X||this.#$.accessDenied||$!==this.#K)return;this.#W({connected:!1})}).finally(()=>{if(this.#X||this.#$.accessDenied)return;if(this.#G=!1,this.#U){this.#U=!1,this.#H();return}if(!this.#M)this.#W({manualRefreshing:!1})})}#z($){let X=this.#B(),Q=this.#J;if(this.#X||this.#$.accessDenied||this.#Y!==null||this.#Q!==void 0||!X||!Q||$!==this.#b)return;let W={};this.#Y=W,this.#P.loadRunDetail(X).then((J)=>{if(!this.#g(W,$))return;this.#Y=null;let K=this.#$.selection;if(J?.run.runId===X&&(K.status===\"loading\"||K.status===\"ready\")&&K.summary){if(this.#W({selection:{status:\"ready\",runId:X,summary:K.summary,detail:J}}),Q!==this.#J)this.#z($)}else this.#O($)}).catch(()=>{if(!this.#g(W,$))return;this.#Y=null,this.#O($)})}#g($,X){return!this.#X&&!this.#$.accessDenied&&this.#Y===$&&this.#b===X}#O($){if(this.#X||this.#$.accessDenied||$!==this.#b)return;if(this.#Q)clearTimeout(this.#Q);this.#Q=setTimeout(()=>{this.#Q=void 0,this.#z($)},this.#L)}#T($){let X=this.#J;if(this.#N(),this.#J=X,!X)return;let Q=this.#b;if($>0)this.#Q=setTimeout(()=>{this.#Q=void 0,this.#z(Q)},$);else this.#z(Q)}#N(){if(this.#b+=1,this.#Y=null,this.#J=null,this.#Q)clearTimeout(this.#Q);this.#Q=void 0}#W($){this.#$={...this.#$,...$};for(let X of this.#q)X(this.#$)}}function d0({copy:$,title:X}){return Z(\"div\",{class:\"empty\",children:Z(\"div\",{children:[Z(\"div\",{class:\"empty-icon\",children:Z(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.4\",children:Z(\"path\",{d:\"M4 5.5h12M4 10h12M4 14.5h8\"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"strong\",{children:X},void 0,!1,void 0,this),Z(\"p\",{children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function x0($){return $.description||\"Run this typed pipeline command.\"}function w0($){return $ instanceof Error?$.message||String($):String($)}function p0({metadata:$}){if(!$)return null;return Z(\"details\",{class:\"step-metadata\",children:[Z(\"summary\",{children:[$.owner,$.domain,...$.tags??[]].filter(Boolean).join(\" · \")||\"Metadata\"},void 0,!1,void 0,this),Z(\"pre\",{children:JSON.stringify($,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function E6($,X,Q){let W=new Map,J=X.trim().toLowerCase();for(let K of $){if(!`${K.id} ${JSON.stringify(K.metadata??{})}`.toLowerCase().includes(J))continue;let b=Q===\"none\"?\"Steps\":K.metadata?.[Q],N=W.get(b)??[];N.push(K),W.set(b,N)}return W}function _1({steps:$}){let[X,Q]=T(\"\"),[W,J]=T(\"none\"),K=E6($,X,W);return Z(\"details\",{children:[Z(\"summary\",{children:[\"Explore steps (\",$.length,\")\"]},void 0,!0,void 0,this),Z(\"label\",{class:\"field\",children:[\"Search steps and metadata\",Z(\"input\",{type:\"search\",value:X,onInput:(b)=>Q(b.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"label\",{class:\"field\",children:[\"Group steps\",Z(\"select\",{value:W,onChange:(b)=>{let N=b.currentTarget.value;if(N===\"owner\"||N===\"domain\"||N===\"none\")J(N)},children:[Z(\"option\",{value:\"none\",children:\"Execution order\"},void 0,!1,void 0,this),Z(\"option\",{value:\"owner\",children:\"Owner\"},void 0,!1,void 0,this),Z(\"option\",{value:\"domain\",children:\"Domain\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K.size===0&&Z(\"p\",{children:\"No matching steps.\"},void 0,!1,void 0,this),[...K].map(([b,N])=>Z(\"section\",{children:[Z(\"h4\",{children:b??\"Unassigned\"},void 0,!1,void 0,this),b===void 0&&Z(\"small\",{children:[\"No \",W,\" specified\"]},void 0,!0,void 0,this),Z(\"ul\",{children:N.map((q)=>Z(\"li\",{children:[Z(\"code\",{children:q.id},void 0,!1,void 0,this),Z(p0,{metadata:q.metadata},void 0,!1,void 0,this)]},q.id,!0,void 0,this))},void 0,!1,void 0,this)]},JSON.stringify([b]),!0,void 0,this))]},void 0,!0,void 0,this)}function C$({commands:$,onConfigure:X}){if(!$.length)return Z(\"div\",{class:\"sheet\",children:Z(d0,{title:\"No pipelines found\",copy:\"Try a different pipeline name or description.\"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return Z(\"section\",{class:\"sheet\",children:[Z(\"div\",{class:\"sheet-head\",children:[Z(\"div\",{children:[Z(\"div\",{class:\"sheet-title\",children:\"Available pipelines\"},void 0,!1,void 0,this),Z(\"div\",{class:\"sheet-subtitle\",children:\"Available in this Studio session\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{class:\"sheet-subtitle\",children:[$.length,\" shown\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"catalog\",children:$.map((Q)=>Z(\"article\",{class:\"catalog-card\",children:[Z(\"h3\",{children:Q.name},void 0,!1,void 0,this),Z(\"p\",{children:x0(Q)},void 0,!1,void 0,this),Z(\"div\",{class:\"catalog-actions\",children:Z(\"button\",{class:\"primary-button\",onClick:()=>X(Q.id),children:\"Configure\"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},Q.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function d6($){switch($.kind){case\"all\":return\"Included because no step or target filter was set.\";case\"exact\":return\"Explicitly listed in the exact step selection.\";case\"target\":return`Requested target “${$.targetId}”.`;case\"required-dependency\":return`Required input for “${$.dependentId}” on the path to target “${$.targetId}”.`;case\"failure-gate\":return`Failure gate for “${$.dependentId}” on the path to target “${$.targetId}”.`;case\"optional-only\":return`Optional input for “${$.dependentId}” on the path to target “${$.targetId}”; this link does not select it.`;case\"outside-target-closure\":return\"Outside the selected targets and their prerequisite paths.\";case\"not-selected\":return\"Not listed in the exact step selection.\"}}function x6($){switch($){case\"dry-run\":return\"Its dry-run policy skips this step.\";case\"unmet-dependency\":return\"A required input is unavailable in this selection or dry run.\";case\"failed-dependency\":return\"A failure gate failed or was cancelled.\";case\"fail-fast\":return\"Execution stops after an earlier failure.\";case\"policy\":return\"Its runtime skip policy omits this step.\";case\"filtered\":return\"Excluded by the selection filter.\"}}function z2({ids:$,stepsById:X}){return Z(\"span\",{class:\"plan-references\",children:$.map((Q)=>Z(\"span\",{children:[Z(\"code\",{children:Q},void 0,!1,void 0,this),X.get(Q)?.selected===!1&&\" (not selected)\"]},Q,!0,void 0,this))},void 0,!1,void 0,this)}function T$({plan:$}){let X=$.steps.filter((J)=>J.selected&&!J.skipReason).length,Q=new Map($.steps.map((J)=>[J.id,J])),W=$.steps.some((J)=>J.selectionReasons.some((K)=>K.kind===\"target\"))?{title:\"Targets with prerequisites\",detail:\"Targets include required inputs and failure gates recursively. Optional inputs are not added unless selected for another reason.\"}:$.steps.some((J)=>J.selectionReasons.some((K)=>K.kind===\"exact\"||K.kind===\"not-selected\"))?{title:\"Exact steps\",detail:\"Only listed steps are selected. Required inputs and failure gates are not added automatically, so missing required inputs can skip a selected step.\"}:{title:\"All steps\",detail:\"No selection filter is set; every declared step is selected.\"};return Z(l,{children:[$.errors.length>0&&Z(\"div\",{class:\"launch-error\",children:$.errors.map((J)=>Z(\"div\",{children:J.message},J.message,!1,void 0,this))},void 0,!1,void 0,this),Z(\"div\",{class:\"plan-summary\",children:[Z(\"strong\",{children:$.pipelineId},void 0,!1,void 0,this),Z(\"span\",{children:[X,\" of \",$.steps.length,\" steps planned to run\",$.dryRun?\" · dry run\":\"\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.steps.length>0&&Z(\"div\",{class:\"plan-selection-mode\",children:[Z(\"strong\",{children:W.title},void 0,!1,void 0,this),Z(\"span\",{children:W.detail},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(p0,{metadata:$.definition?.metadata},void 0,!1,void 0,this),Z(_1,{steps:$.steps},void 0,!1,void 0,this),Z(\"div\",{class:\"plan-steps\",children:$.steps.map((J)=>{let K=!J.selected?\"Not selected\":J.skipReason===\"dry-run\"?\"Dry-run skip\":J.skipReason?\"Skipped\":\"Will run\",b=J.nestedPipeline,N=J.remote,q=N?\"Remote step\":b?b.mode===\"iterate\"?\"Pipeline iteration\":b.mode===\"for-each\"?\"Pipeline fan-out\":\"Nested pipeline\":\"Step\";return Z(\"div\",{class:\"plan-step\",children:[Z(\"div\",{class:\"plan-step-title\",children:[Z(\"strong\",{children:J.name||J.id},void 0,!1,void 0,this),J.name&&J.name!==J.id&&Z(\"code\",{class:\"plan-step-id\",children:J.id},void 0,!1,void 0,this),Z(\"span\",{class:`plan-kind${b?\" pipeline\":\"\"}`,children:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J.description&&Z(\"small\",{children:J.description},void 0,!1,void 0,this),Z(p0,{metadata:J.metadata},void 0,!1,void 0,this),Z(\"span\",{class:`plan-disposition${K===\"Will run\"?\"\":\" skipped\"}`,children:K},void 0,!1,void 0,this),Z(\"ul\",{class:\"plan-explanation\",children:[J.selectionReasons.map((z,B)=>Z(\"li\",{children:[Z(\"strong\",{children:J.selected?\"Selected\":\"Omitted\"},void 0,!1,void 0,this),Z(\"span\",{children:d6(z)},void 0,!1,void 0,this)]},B,!0,void 0,this)),Z(\"li\",{children:[Z(\"strong\",{children:\"Required inputs\"},void 0,!1,void 0,this),J.dependencies.length>0?Z(\"span\",{children:[Z(z2,{ids:J.dependencies,stepsById:Q},void 0,!1,void 0,this),\" — unavailable inputs skip this step.\"]},void 0,!0,void 0,this):Z(\"span\",{children:\"No required inputs.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J.optionalDependencies.length>0&&Z(\"li\",{children:[Z(\"strong\",{children:\"Optional inputs\"},void 0,!1,void 0,this),Z(\"span\",{children:[Z(z2,{ids:J.optionalDependencies,stepsById:Q},void 0,!1,void 0,this),\" — unavailable inputs do not block it.\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),J.skipAfterFailureOf.length>0&&Z(\"li\",{children:[Z(\"strong\",{children:\"Failure gates\"},void 0,!1,void 0,this),Z(\"span\",{children:[Z(z2,{ids:J.skipAfterFailureOf,stepsById:Q},void 0,!1,void 0,this),\" — failure or cancellation skips this step.\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),J.selected&&J.skipReason&&Z(\"li\",{children:[Z(\"strong\",{children:\"Planned skip\"},void 0,!1,void 0,this),Z(\"span\",{children:x6(J.skipReason)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J.selected&&!J.skipReason&&J.runtimeSkipPossible&&Z(\"li\",{children:[Z(\"strong\",{children:\"Runtime policy\"},void 0,!1,void 0,this),Z(\"span\",{children:\"This step may still skip when it runs.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b&&Z(a0,{label:b.pipelineId,secondary:`${b.stepIds.length} declared steps${b.mode===\"iterate\"?` per iteration, at most ${b.maxIterations} iterations`:b.mode===\"for-each\"?\" per runtime item\":\"\"}`,stepIds:b.stepIds},void 0,!1,void 0,this),N&&Z(a0,{label:N.engine,secondary:N.target},void 0,!1,void 0,this)]},J.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function R$($,X,Q){let W=new Map($.map((J,K)=>{let b=X.get(J).filter((q)=>Q.has(q)),N=b.length?b.reduce((q,z)=>q+Q.get(z),0)/b.length:K;return[J,N]}));$.sort((J,K)=>W.get(J)-W.get(K)),$.forEach((J,K)=>Q.set(J,K))}function _$($,X,Q){let W=new Map($.map((Y)=>[Y.id,Y])),J=new Map($.map((Y)=>[Y.id,[]])),K=new Map($.map((Y)=>[Y.id,[]]));for(let{from:Y,to:F}of X){if(Y===F||!W.has(Y)||!W.has(F))continue;if(J.get(F).includes(Y))continue;J.get(F).push(Y),K.get(Y).push(F)}let b=new Map,N=new Set,q=(Y)=>{let F=b.get(Y);if(F!==void 0)return F;if(N.has(Y))return-1;N.add(Y);let O=0;for(let k of J.get(Y))O=Math.max(O,q(k)+1);return N.delete(Y),b.set(Y,O),O},z=[];for(let Y of $)(z[q(Y.id)]??=[]).push(Y.id);let B=new Map;z[0]?.forEach((Y,F)=>B.set(Y,F));for(let Y=0;Y<4;Y+=1){for(let F of z.slice(1))R$(F,J,B);for(let F of z.slice(0,-1).reverse())R$(F,K,B)}let P=(Y)=>Y.reduce((F,O)=>F+W.get(O).width,0)+Math.max(0,Y.length-1)*Q.columnGap,G=Math.max(0,...z.map(P)),M=new Map,L=0;return z.forEach((Y,F)=>{let O=(G-P(Y))/2,k=0;for(let g of Y){let R=W.get(g);M.set(g,{...R,x:O,y:L,layer:F}),O+=R.width+Q.columnGap,k=Math.max(k,R.height)}L+=k+Q.rowGap}),{nodes:M,width:G,height:Math.max(0,L-Q.rowGap)}}var K1=124,b1=64,v1=20,U0=15,w$=50,p6=18,g0=14,o0=36,I0=12,N2=26,o6=18,i6=4,S$=q$,I$=6,S1=18,r6=5.5,q2={input:\"Required input\",optional:\"Optional input\",gate:\"Failure gate\"},n6={cancelled:!0,completed:!0,failed:!0},s6={completed:\"M-6 .5 -2 4.5 6.5-4.5\",failed:\"M-4.5-4.5 4.5 4.5M4.5-4.5-4.5 4.5\",cancelled:\"M-4-4H4V4H-4Z\",skipped:\"M-5 5 5-5\"};function v$($,X,Q){if(Q)$.opened.add(X);return $.opened.has(X)}function I1($){let X=new Map,Q=(W,J)=>{for(let K of W??[])X.set(K,[...X.get(K)??[],J])};return Q($.dependencies,\"input\"),Q($.optionalDependencies,\"optional\"),Q($.skipAfterFailureOf,\"gate\"),X}function a6($){return $.status===\"completed\"||$.skipReason===\"policy\"}function f$($,X,Q){let W=$.includes(\"gate\"),J=X.status===\"failed\"||X.status===\"cancelled\";if(W&&J)return\"tripped\";if(Q.status===\"planned\")return\"candidate\";if($.length===1&&W)return\"settled\";if(!a6(X))return J?\"blocked\":\"unused\";if(Q.status===\"running\")return\"active\";return Q.status===\"skipped\"&&Q.skipReason!==\"policy\"?\"unused\":\"used\"}function t6($){return $.state===\"tripped\"?\"gate\":$.kinds[0]}var e6={active:($,X)=>`${X} is running with ${$}'s output.`,blocked:($,X)=>`${$} did not produce an output, so ${X} could not use it.`,candidate:($,X)=>`Candidate: ${X} has not started, so ${$}'s output is not consumed yet.`,settled:($)=>`The gate did not trip: ${$} neither failed nor was cancelled.`,tripped:($,X)=>`${$} failed or was cancelled, which skips ${X}.`,unused:($,X)=>`${X} did not receive ${$}'s output.`,used:($,X)=>`${$} produced an output that fed ${X}.`},$4={input:($,X)=>`${X} receives ${$}'s output as a required typed input.`,optional:($,X)=>`${X} receives ${$}'s output only when ${$} produced one.`,gate:($,X)=>`${X} is skipped when ${$} fails or is cancelled.`};function y$($){return $===void 0||$===\"pending\"?\"planned\":$}function X4($,X){let{itemKey:Q,iteration:W}=$.origin??{};return(Q!==void 0?X.get(Q):void 0)??(W!==void 0?`iteration ${W}`:Q??$.pipelineId)}function h$($,X=p6){return $.length>X?$.slice(0,Math.max(1,X-1))+\"…\":$}function Z4($){return $.y+($.kind===\"run\"&&$.graph?0:v1-U0-3)}function c$($,X,Q){let W=$.find((J)=>J.stepId===X);return W?Math.max(W.count,Q):Q}function Q4($,X,Q,W,J,K,b,N){let q=new Map($.agentTurn?.calls.map((C)=>[C.callId,C.tool])??[]),z=[...Q].sort((C,A)=>(C.origin?.iteration??0)-(A.origin?.iteration??0)||C.startedAtMs-A.startedAtMs),B=z.filter((C)=>C.subtreeIsRunning).length,P=[];for(let C of z.slice(0,S$)){let A=X4(C,q),S=b.canLoad&&N+1<I$;if(S)b.expandable.add(C.runId);let c=S&&(b.toggles.get(C.runId)??v$(b,C.runId,C.subtreeIsRunning&&B===1)),w=c?b.loads.get(C.runId):void 0;if(c)b.wanted.add(C.runId);let y=w&&w!==\"missing\"?l$(w.run,w.children,b,N+1,w.childSteps):void 0;P.push({kind:\"run\",summary:C,label:A,expandable:S,expanded:c,graph:y,unavailable:w===\"missing\",x:0,y:0,width:y?Math.max(K1,y.width+I0*2):K1,height:y?N2+y.height+I0:b1})}let G=P.length;for(let C of W.slice(0,Math.max(0,S$-P.length)))P.push({kind:\"item\",detail:C,label:C.name??q.get(C.id)??C.id,x:0,y:0,width:K1,height:b1});let M=K-G,L=W.length-(P.length-G),Y=[M>0&&`+${M} more in the run list`,L>0&&`+${L} more in the timeline`,J>0&&`${J} progress rows not recorded`].filter(Boolean).join(\" · \"),F=X.nestedPipeline?.mode===\"iterate\"?1:i6,O=[];for(let C=0;C<P.length;C+=F)O.push(P.slice(C,C+F));let k=(C)=>C.reduce((A,S)=>A+S.width,0)+(C.length-1)*g0,g=Math.max(K1,...O.map(k)),R=I0;for(let C of O){let A=I0+(g-k(C))/2;for(let S of C)S.x=A,S.y=R,A+=S.width+g0;R+=Math.max(...C.map((S)=>S.height))+(F===1?o0/2:g0)}let _=F===1?P.slice(1).map((C,A)=>{let S=P[A];return`M${S.x+S.width/2} ${S.y+S.height-4}V${Z4(C)}`}):[],V=P.length?R-(F===1?o0/2:g0):I0,d=g+I0*2;return{x:0,y:b1,width:d,height:V+(Y?o6:0)+I0,items:P,links:_,...Y?{more:Y}:{}}}function l$($,X,Q,W,J=[]){Q.runs.set($.runId,$),Q.children.set($.runId,X),Q.childSteps.set($.runId,J);for(let Y of X)Q.summaries.set(Y.runId,Y);let K=new Map($.steps.map((Y)=>[Y.id,Y])),b=$.steps.map((Y)=>{let F=`${$.runId}/${Y.id}`,O=X.filter((y)=>y.origin?.stepId===Y.id),k=new Set(O.map((y)=>y.origin?.itemKey)),g=Y.nestedPipeline?.mode,_=(g===\"single\"||g===\"iterate\")&&O.length>0?[]:(Y.progress?.details??[]).filter((y)=>!y.depth&&!k.has(y.id)),V=Y.progress?.details??[],d=Y.nestedPipeline?0:Math.max(0,(Y.progress?.detailCount??V.length)-V.length),C=c$(J,Y.id,O.length),A=C+_.length,S=A>0&&W<I$&&(Q.toggles.get(F)??v$(Q,F,Y.status===\"running\"&&O.length>0)),c=S?Q4($,Y,O,_,d,C,Q,W):void 0,w=Math.max(K1,c?.width??0);if(c)c.x=(w-c.width)/2;return{key:F,step:Y,x:0,y:0,width:w,height:c?b1+c.height+6:b1,itemCount:A,expanded:S,expansion:c}}),N=new Map($.steps.map((Y)=>[Y.id,I1(Y)])),q=_$(b.map(({key:Y,width:F,height:O})=>({id:Y,width:F,height:O})),$.steps.flatMap((Y)=>[...N.get(Y.id).keys()].map((F)=>({from:`${$.runId}/${F}`,to:`${$.runId}/${Y.id}`}))),{columnGap:g0,rowGap:o0}),z=new Map,B=[],P=new Map;for(let Y of b){let F=q.nodes.get(Y.key);Y.x=F.x,Y.y=F.y,z.set(Y.step.id,Y),P.set(Y.step.id,F.layer),B[F.layer]=F.y}let G=q.width,M=0,L=[];for(let Y of b)for(let[F,O]of N.get(Y.step.id)){let k=z.get(F);if(!k)continue;let g=k.x+k.width/2,R=k.y+(k.expansion?k.height:w$+8),_=Y.x+Y.width/2,V=Y.y+v1-U0-3,d=P.get(F)+1,C=P.get(Y.step.id),A=b.filter((w)=>{let y=P.get(w.step.id);return y>=d&&y<C}),S=A.some((w)=>w.x<Math.max(g,_)+g0&&w.x+w.width>Math.min(g,_)-g0),c;if(S){let w=Math.max(...A.map((p)=>p.x+p.width))+g0/2+M*6;M+=1,G=Math.max(G,w+g0/2);let y=B[d]-o0/2,x=B[C]-o0/2;c=`M${g} ${R}C${g} ${y} ${w} ${y} ${w} ${B[d]}V${B[C]-o0}C${w} ${x} ${_} ${x} ${_} ${V-4}`}else{let w=(R+V)/2;c=`M${g} ${R}C${g} ${w} ${_} ${w} ${_} ${V-4}`}L.push({from:F,to:Y.step.id,kinds:O,state:f$(O,K.get(F),Y.step),path:c,head:`M${_-4} ${V-7}L${_} ${V}L${_+4} ${V-7}Z`})}return{run:$,width:G,height:q.height,steps:b,edges:L}}function f1($){return(X)=>{if(X.key!==\"Enter\"&&X.key!==\" \")return;X.preventDefault(),$()}}function m$({count:$,expanded:X,label:Q,onToggle:W}){let J=()=>W();return Z(\"g\",{class:`graph-badge${X?\" expanded\":\"\"}`,transform:`translate(${U0-2} ${U0-3})`,role:\"button\",tabIndex:0,\"aria-expanded\":X,\"aria-label\":`${X?\"Collapse\":\"Expand\"} ${Q}`,onClick:(K)=>{K.stopPropagation(),J()},onKeyDown:f1(J),children:[Z(\"circle\",{r:8},void 0,!1,void 0,this),Z(\"text\",{dy:3,children:X?\"−\":$>99?\"99+\":$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function B2($){let X=s6[$.status];return Z(\"g\",{class:`graph-node ${$.kind} ${$.status}${$.selected?\" selected\":\"\"}${$.pulse?\" pulse\":\"\"}`,transform:`translate(${$.cx} ${v1})`,children:[Z(\"g\",{class:\"graph-hit\",role:\"button\",tabIndex:0,\"aria-pressed\":$.selected,\"aria-label\":`${$.title}: ${$.status}`,onClick:$.onSelect,onKeyDown:f1($.onSelect),children:[Z(\"title\",{children:`${$.title} · ${$.status}`},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-halo\",r:U0+8},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-focus\",r:U0+4},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-disc\",r:U0},void 0,!1,void 0,this),$.kind===\"run\"&&Z(\"circle\",{class:\"graph-ring\",r:U0-4},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-spinner\",r:U0,pathLength:100},void 0,!1,void 0,this),X&&Z(\"path\",{class:\"graph-icon\",d:X,pathLength:20},void 0,!1,void 0,this),Z(\"text\",{class:\"graph-label\",y:w$-v1,children:h$($.label)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.badge]},void 0,!0,void 0,this)}function Y1($,X){return $!==null&&JSON.stringify($)===JSON.stringify(X)}function W4({expansion:$,run:X,step:Q,ui:W}){return Z(\"g\",{class:\"graph-expansion\",transform:`translate(${$.x} ${$.y})`,children:[Z(\"rect\",{class:\"graph-frame\",width:$.width,height:$.height,rx:10},void 0,!1,void 0,this),$.links.map((J)=>Z(\"path\",{class:\"graph-sequence\",d:J},J,!1,void 0,this)),$.items.map((J)=>{if(J.kind===\"item\"){let q={kind:\"item\",runId:X.runId,stepId:Q.id,itemId:J.detail.id},z=y$(J.detail.status??\"running\");return Z(\"g\",{transform:`translate(${J.x} ${J.y})`,children:Z(B2,{cx:J.width/2,kind:\"item\",label:J.label,title:J.label,status:z,selected:Y1(W.selection,q),pulse:W.pulse(`${X.runId}/${Q.id}/${J.detail.id}`,z),onSelect:()=>W.select(q)},void 0,!1,void 0,this)},\"item:\"+J.detail.id,!1,void 0,this)}let{summary:K}=J,b={kind:\"run\",runId:K.runId},N=Z(m$,{count:K.stepCount,expanded:J.expanded,label:J.label,onToggle:()=>W.toggle(K.runId,!J.expanded)},void 0,!1,void 0,this);if(J.graph)return Z(\"g\",{transform:`translate(${J.x} ${J.y})`,children:[Z(\"rect\",{class:`graph-run-frame ${K.status}${Y1(W.selection,b)?\" selected\":\"\"}`,width:J.width,height:J.height,rx:8},void 0,!1,void 0,this),Z(\"g\",{class:\"graph-run-header\",role:\"button\",tabIndex:0,\"aria-label\":`Inspect nested run ${J.label}`,onClick:()=>W.select(b),onKeyDown:f1(()=>W.select(b)),children:[Z(\"rect\",{width:J.width,height:N2-4,rx:8},void 0,!1,void 0,this),Z(\"text\",{x:10,y:15,children:h$(J.label===K.pipelineId?J.label:`${J.label} · ${K.pipelineId}`,Math.floor((J.width-40)/r6))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"g\",{transform:`translate(${J.width-12-(U0-2)} ${11-(U0-3)})`,children:N},void 0,!1,void 0,this),Z(\"g\",{transform:`translate(${(J.width-J.graph.width)/2} ${N2})`,children:Z(V$,{scene:J.graph,ui:W},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},K.runId,!0,void 0,this);return Z(\"g\",{transform:`translate(${J.x} ${J.y})`,children:Z(B2,{cx:J.width/2,kind:\"run\",label:J.unavailable?\"unavailable\":J.expanded?\"loading…\":J.label,title:`${J.label} (${K.pipelineId})`,status:K.status,selected:Y1(W.selection,b),pulse:W.pulse(K.runId,K.status),onSelect:()=>W.select(b),badge:J.unavailable||!J.expandable?void 0:N},void 0,!1,void 0,this)},K.runId,!1,void 0,this)}),$.more&&Z(\"text\",{class:\"graph-more\",x:$.width/2,y:$.height-I0,children:$.more},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function V$({scene:$,ui:X}){let Q=$.run.runId;return Z(\"g\",{class:\"graph-run\",children:[$.edges.map((W)=>{let J={kind:\"edge\",runId:Q,from:W.from,to:W.to},K=()=>X.select(J);return Z(\"g\",{class:`graph-edge-group ${t6(W)} ${W.state}${Y1(X.selection,J)?\" selected\":\"\"}`,role:\"button\",tabIndex:0,\"aria-label\":`Connection ${W.from} to ${W.to}`,onClick:K,onKeyDown:f1(K),children:[Z(\"title\",{children:`${W.from} → ${W.to} · ${W.kinds.map((b)=>q2[b]).join(\", \")}`},void 0,!1,void 0,this),Z(\"path\",{class:\"graph-edge-hit\",d:W.path},void 0,!1,void 0,this),Z(\"path\",{class:\"graph-edge\",d:W.path},void 0,!1,void 0,this),W.state===\"active\"&&Z(\"path\",{class:\"graph-edge-flow\",d:W.path},void 0,!1,void 0,this),Z(\"path\",{class:\"graph-edge-head\",d:W.head},void 0,!1,void 0,this)]},W.from+\"->\"+W.to,!0,void 0,this)}),$.steps.map((W)=>{let{step:J}=W,K={kind:\"step\",runId:Q,stepId:J.id};return Z(\"g\",{transform:`translate(${W.x} ${W.y})`,children:[W.expansion&&Z(W4,{expansion:W.expansion,run:$.run,step:J,ui:X},void 0,!1,void 0,this),Z(B2,{cx:W.width/2,kind:\"step\",label:J.name||J.id,title:J.name?`${J.name} (${J.id})`:J.id,status:J.status,selected:Y1(X.selection,K),pulse:X.pulse(W.key,J.status),onSelect:()=>X.select(K),badge:W.itemCount>0&&Z(m$,{count:W.itemCount,expanded:W.expanded,label:J.name||J.id,onToggle:()=>X.toggle(W.key,!W.expanded)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},J.id,!0,void 0,this)})]},void 0,!0,void 0,this)}function k1({rows:$}){return Z(\"dl\",{class:\"graph-facts\",children:$.map(([X,Q])=>Z(l,{children:[Z(\"dt\",{children:X},void 0,!1,void 0,this),Z(\"dd\",{children:Q},void 0,!1,void 0,this)]},X,!0,void 0,this))},void 0,!1,void 0,this)}function k$({title:$,empty:X,rows:Q}){return Z(\"div\",{class:\"graph-io\",children:[Z(\"h4\",{children:$},void 0,!1,void 0,this),Q.length===0&&Z(\"p\",{class:\"graph-hint\",children:X},void 0,!1,void 0,this),Q.map((W)=>Z(\"button\",{type:\"button\",onClick:W.onSelect,children:[Z(b0,{value:W.status},void 0,!1,void 0,this),Z(\"code\",{children:W.id},void 0,!1,void 0,this),Z(\"small\",{children:W.kinds.map((J)=>q2[J]).join(\" + \")},void 0,!1,void 0,this)]},W.id,!0,void 0,this))]},void 0,!0,void 0,this)}function J4({runs:$,total:X,onOpenRun:Q}){if($.length===0)return null;let W=X>$.length?`${$.length} of ${X}`:String($.length);return Z(\"div\",{class:\"graph-io\",children:[Z(\"h4\",{children:[\"Nested runs (\",W,\")\"]},void 0,!0,void 0,this),Z(\"div\",{class:\"nested-runs\",children:$.map((J)=>Z(\"button\",{class:\"nested-run\",type:\"button\",onClick:()=>Q(J.runId),children:[Z(b0,{value:J.status},void 0,!1,void 0,this),Z(\"strong\",{children:J.origin?.itemKey??J.pipelineId},void 0,!1,void 0,this),Z(\"small\",{children:[F0(J.durationMs),\" · \",J.stepCount,\" steps\"]},void 0,!0,void 0,this)]},J.runId,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var w1=($,X)=>X===void 0?\"—\":\"+\"+F0(X-$.startedAtMs);function K4({selection:$,ctx:X,ui:Q,onOpenRun:W}){let J=$?X.runs.get($.runId):void 0;if($?.kind===\"run\"){let K=X.summaries.get($.runId);if(K){let N=(K.parentRunId?X.runs.get(K.parentRunId):void 0)?.agentTurn?.calls.find((z)=>z.callId===K.origin?.itemKey)?.tool,q=X.wanted.has(K.runId);return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:\"Nested run\"},void 0,!1,void 0,this),Z(\"h3\",{children:K.pipelineId},void 0,!1,void 0,this),Z(b0,{value:K.status},void 0,!1,void 0,this),Z(k1,{rows:[[\"Run\",Z(\"code\",{title:K.runId,children:C0(K.runId)},void 0,!1,void 0,this)],...K.origin?.stepId?[[\"Started by\",Z(\"code\",{children:K.origin.stepId},void 0,!1,void 0,this)]]:[],...N?[[\"Tool\",Z(\"code\",{children:N},void 0,!1,void 0,this)]]:[],...K.origin?.iteration!==void 0?[[\"Iteration\",String(K.origin.iteration)]]:[],...K.origin?.itemKey!==void 0&&!N?[[\"Item\",Z(\"code\",{children:K.origin.itemKey},void 0,!1,void 0,this)]]:[],[\"Duration\",F0(K.durationMs)],[\"Steps\",String(K.stepCount)],[\"Nested\",String(K.descendantCount)]]},void 0,!1,void 0,this),Z(\"div\",{class:\"graph-actions\",children:[Z(\"button\",{class:\"primary-button\",type:\"button\",onClick:()=>W(K.runId),children:\"Open run\"},void 0,!1,void 0,this),X.expandable.has(K.runId)&&Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>Q.toggle(K.runId,!q),children:q?\"Collapse steps\":\"Show steps\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.canLoad&&!X.expandable.has(K.runId)&&Z(\"p\",{class:\"graph-hint\",children:\"This run is nested too deeply to draw here. Open it to see its steps.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}}if(J&&$?.kind===\"item\"){let K=J.steps.find((N)=>N.id===$.stepId),b=K?.progress?.details?.find((N)=>N.id===$.itemId);if(K&&b)return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:[\"Dynamic item · \",K.name||K.id]},void 0,!0,void 0,this),Z(\"h3\",{children:b.name??b.id},void 0,!1,void 0,this),Z(b0,{value:y$(b.status??\"running\"),outputSource:b.outputSource},void 0,!1,void 0,this),Z(k1,{rows:[[\"Item\",Z(\"code\",{children:b.id},void 0,!1,void 0,this)],...b.label?[[\"Activity\",b.label]]:[],...b.total!==void 0?[[\"Progress\",`${b.completed??0} / ${b.total}`]]:[]]},void 0,!1,void 0,this),Z(\"p\",{class:\"graph-hint\",children:[\"Reported by \",K.id,\"'s progress. No nested run was recorded for this item.\"]},void 0,!0,void 0,this),Z(\"div\",{class:\"graph-actions\",children:Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>Q.select({kind:\"step\",runId:J.runId,stepId:K.id}),children:[\"Inspect \",K.id]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}if(J&&$?.kind===\"edge\"){let K=J.steps.find((q)=>q.id===$.from),b=J.steps.find((q)=>q.id===$.to),N=b?I1(b).get($.from):void 0;if(K&&b&&N){let q=f$(N,K,b);return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:[\"Connection · \",J.pipelineId]},void 0,!0,void 0,this),Z(\"h3\",{children:[K.id,\" → \",b.id]},void 0,!0,void 0,this),N.map((z)=>Z(\"p\",{class:\"graph-hint\",children:[Z(\"b\",{children:[q2[z],\".\"]},void 0,!0,void 0,this),\" \",$4[z](K.id,b.id)]},z,!0,void 0,this)),Z(\"p\",{class:`graph-edge-state ${q}`,children:e6[q](K.id,b.id)},void 0,!1,void 0,this),Z(k1,{rows:[[\"Source\",Z(b0,{value:K.status,outputSource:K.outputSource},void 0,!1,void 0,this)],[\"Target\",Z(b0,{value:b.status,outputSource:b.outputSource},void 0,!1,void 0,this)],[\"Output ready\",w1(J,K.finishedAtMs)],[\"Consumed\",w1(J,b.startedAtMs)]]},void 0,!1,void 0,this),K.artifacts&&K.artifacts.length>0&&Z(\"div\",{class:\"graph-io\",children:[Z(\"h4\",{children:\"Recorded source artifacts\"},void 0,!1,void 0,this),Z(H1,{artifacts:K.artifacts,stepId:K.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"graph-actions\",children:[K,b].map((z)=>Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>Q.select({kind:\"step\",runId:J.runId,stepId:z.id}),children:[\"Inspect \",z.id]},z.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}}if(J&&$?.kind===\"step\"){let K=J.steps.find((b)=>b.id===$.stepId);if(K){let b=(P)=>J.steps.find((G)=>G.id===P)?.status,N=[...I1(K)].map(([P,G])=>({id:P,kinds:G,status:b(P)??\"planned\",onSelect:()=>Q.select({kind:\"edge\",runId:J.runId,from:P,to:K.id})})),q=J.steps.flatMap((P)=>{let G=I1(P).get(K.id);return G?[{id:P.id,kinds:G,status:P.status,onSelect:()=>Q.select({kind:\"edge\",runId:J.runId,from:K.id,to:P.id})}]:[]}),z=(X.children.get(J.runId)??[]).filter((P)=>P.origin?.stepId===K.id),B=c$(X.childSteps.get(J.runId)??[],K.id,z.length);return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:[\"Step · \",J.pipelineId]},void 0,!0,void 0,this),Z(\"div\",{class:\"step-list\",children:Z(g1,{step:K},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(k1,{rows:[[\"Started\",w1(J,K.startedAtMs)],[\"Finished\",w1(J,K.finishedAtMs)]]},void 0,!1,void 0,this),Z(k$,{title:\"Inputs\",empty:\"None: this step starts the graph.\",rows:N},void 0,!1,void 0,this),Z(k$,{title:\"Consumers\",empty:\"None: no later step depends on this output.\",rows:q},void 0,!1,void 0,this),Z(J4,{runs:z,total:B,onOpenRun:W},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}}return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:\"Inspector\"},void 0,!1,void 0,this),Z(\"p\",{class:\"graph-hint\",children:\"Select a step, connection, or nested run to inspect its inputs, outputs, and execution. Badges expand child pipelines, agent turns, and dynamic tool calls in place.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function b4(){let $=P0(new Map),X=P0(new Set);return(Q,W)=>{let J=$.current.get(Q);if($.current.set(Q,W),J!==void 0&&J!==W)if(n6[W])X.current.add(Q);else X.current.delete(Q);return X.current.has(Q)}}function Y4($){return JSON.stringify([$.runId,$.eventCount,$.subtreeEventCount,$.status])}function z4($,X){let Q=[];for(let W of $){let J=JSON.parse(W)[0];if(typeof J===\"string\"&&X.get(J)!==W)Q.push({key:W,runId:J})}return Q}function j$({detail:$,api:X,onOpenRun:Q}){let[W,J]=T(new Map),K=P0(new Set),[b,N]=T(new Map),[q,z]=T(null),B=P0(new Map),[P,G]=T(0),M=b4(),L={loads:b,toggles:W,opened:K.current,canLoad:X!==void 0,expandable:new Set,wanted:new Set,runs:new Map,children:new Map,childSteps:new Map,summaries:new Map},Y=l$($.run,$.children,L,0,$.childSteps),F=[...L.wanted].sort().map((R)=>Y4(L.summaries.get(R))).join(`\n`);i(()=>{if(!X||!F)return;let R=z4(F.split(`\n`),B.current);if(R.length===0)return;let _=!0,V=!1;for(let{key:d,runId:C}of R)X.loadRunDetail(C).then((A)=>{if(!_)return;B.current.set(C,d),N((S)=>new Map(S).set(C,A??\"missing\"))},()=>{if(_&&!V)V=!0,setTimeout(()=>{if(_)G((A)=>A+1)},A$)});return()=>{_=!1}},[X,F,P]);let O={selection:q,select:z,toggle:(R,_)=>J((V)=>new Map(V).set(R,_)),pulse:M},k=Y.width+S1*2,g=Y.height+S1*2;return Z(\"section\",{class:\"graph-panel\",\"aria-label\":\"Run graph\",children:[Z(\"div\",{class:\"graph-canvas\",children:Z(\"svg\",{width:k,height:g,viewBox:`${-S1} ${-S1} ${k} ${g}`,role:\"group\",\"aria-label\":`${$.run.pipelineId} step graph`,children:Z(V$,{scene:Y,ui:O},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(K4,{selection:q,ctx:L,ui:O,onOpenRun:Q},void 0,!1,void 0,this),Z(\"div\",{class:\"graph-legend\",\"aria-hidden\":\"true\",children:[Z(\"span\",{children:[Z(\"i\",{class:\"running\"},void 0,!1,void 0,this),\"Running\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"completed\"},void 0,!1,void 0,this),\"Completed\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"failed\"},void 0,!1,void 0,this),\"Failed\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"cancelled\"},void 0,!1,void 0,this),\"Cancelled\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"skipped\"},void 0,!1,void 0,this),\"Skipped\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"planned\"},void 0,!1,void 0,this),\"Planned\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"b\",{class:\"candidate\"},void 0,!1,void 0,this),\"Candidate input\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"b\",{class:\"used\"},void 0,!1,void 0,this),\"Consumed input\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"b\",{class:\"gate\"},void 0,!1,void 0,this),\"Failure gate\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"run\"},void 0,!1,void 0,this),\"Nested run\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function l0($){if(Array.isArray($))return $.map(l0);if($!==null&&typeof $===\"object\")return Object.fromEntries(Object.entries($).sort(([X],[Q])=>X<Q?-1:X>Q?1:0).map(([X,Q])=>[X,l0(Q)]));return $}var D$={dependencies:\"Required edges\",optionalDependencies:\"Optional edges\",skipAfterFailureOf:\"Failure gates\",dryRun:\"Dry-run policy\",runtimeSkipPossible:\"Skip policy\",outputValidated:\"Output validation\",cache:\"Cache settings\",agent:\"Agent capabilities and limits\",nestedPipeline:\"Child pipeline\",remote:\"Remote adapter\"};function u$($,X){let Q=[],W=(b,N,q,z)=>{let B=JSON.stringify(N),P=JSON.stringify(q);if(B!==P)Q.push({field:b,before:B,after:P,...z?{stepId:z}:{}})};W(\"Implementation version\",$.identity.implementationVersion,X.identity.implementationVersion),W(\"Execution order\",$.steps.map(({id:b})=>b),X.steps.map(({id:b})=>b)),W(\"Metadata\",l0($.metadata),l0(X.metadata)),W(\"Targets\",$.targetIds,X.targetIds),W(\"Required finalizer steps\",$.requiredFinalizerStepIds,X.requiredFinalizerStepIds),W(\"Options validation\",$.optionsValidated,X.optionsValidated),W(\"Result validation\",$.resultValidated,X.resultValidated);let J=new Map($.steps.map((b)=>[b.id,b])),K=new Map(X.steps.map((b)=>[b.id,b]));for(let b of $.steps)if(!K.has(b.id))Q.push({stepId:b.id,field:\"Removed step\"});for(let b of X.steps){let N=J.get(b.id);if(!N){Q.push({stepId:b.id,field:\"Added step\"});continue}W(\"Metadata\",l0(N.metadata),l0(b.metadata),b.id);for(let q of Object.keys(D$)){let z=q;W(D$[z],N[z],b[z],b.id)}}return Q}function U2($,X,Q){let[W,J]=T(0),K=s0(()=>J((q)=>q+1),[]),[b,N]=T({key:\"\",request:Q,value:null,loading:!1});if(i(()=>{if(!$||!X){N({key:\"\",request:Q,value:null,loading:!1});return}let q=!0;return N((z)=>({owner:$,key:X,request:Q,value:z.owner===$&&z.key===X?z.value:null,loading:!0})),Q().then((z)=>{if(q)N({owner:$,key:X,request:Q,value:z,loading:!1})}).catch((z)=>{if(q)N((B)=>({...B,loading:!1,error:z instanceof Error?z.message:\"Could not load definition history.\"}))}),()=>{q=!1}},[$,X,Q,W]),!$||!X)return{value:null,loading:!1,reload:K};if(b.owner!==$||b.key!==X)return{value:null,loading:!0,reload:K};return{reload:K,value:b.value,loading:b.loading||b.request!==Q,error:b.request===Q?b.error:void 0}}function K0($){return JSON.stringify([$.pipelineId,$.identity?.definitionId??null])}function E$($){let X=$.identity;return`${$.pipelineId} · ${X?X.definitionId.slice(7,19):\"Legacy (identity not recorded)\"} · ${X?.implementationVersion??\"implementation unknown\"} · ${$.runCount} ${$.runCount===1?\"run\":\"runs\"}`}function N4({definitions:$,selected:X,candidates:Q,previous:W,definition:J,runs:K,comparison:b,onDefinition:N,onCompare:q,onPage:z,onSelect:B}){if(!X)return null;let P=J.value?.snapshot,G=K.value,M=G?.runs??[],L=b.value?.snapshot&&P?u$(b.value.snapshot,P):void 0;return Z(\"section\",{class:\"sheet definition-history\",children:[Z(\"div\",{class:\"sheet-head\",children:Z(\"div\",{children:[Z(\"div\",{class:\"sheet-title\",children:\"Observed definitions\"},void 0,!1,void 0,this),Z(\"div\",{class:\"sheet-subtitle\",children:\"Graph fingerprints do not verify handler code. Implementation versions are supplied by the application.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{class:\"definition-body\",children:[Z(\"label\",{class:\"field\",children:[\"Definition\",\" \",Z(\"select\",{\"aria-label\":\"Definition\",value:K0(X),onChange:(Y)=>{N(Y.currentTarget.value)},children:$.map((Y)=>Z(\"option\",{value:K0(Y),children:E$(Y)},K0(Y),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.identity&&Z(\"p\",{class:\"definition-identity\",children:[\"Structural fingerprint: \",Z(\"code\",{children:X.identity.structuralFingerprint},void 0,!1,void 0,this),Z(\"br\",{},void 0,!1,void 0,this),\"Definition ID: \",Z(\"code\",{children:X.identity.definitionId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P&&Z(l,{children:[Z(p0,{metadata:P.metadata},void 0,!1,void 0,this),Z(_1,{steps:P.steps},K0(X),!1,void 0,this)]},void 0,!0,void 0,this),J.error&&Z(\"p\",{role:\"alert\",children:[J.error,\" \",Z(\"button\",{type:\"button\",onClick:J.reload,children:\"Retry definition\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!J.value&&J.loading&&Z(\"p\",{children:\"Loading definition…\"},void 0,!1,void 0,this),Z(\"details\",{children:[Z(\"summary\",{children:[\"Runs with this definition (\",X.runCount,\")\"]},void 0,!0,void 0,this),K.error&&Z(\"p\",{role:\"alert\",children:[K.error,\" \",Z(\"button\",{type:\"button\",onClick:K.reload,children:\"Retry runs\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K.loading&&Z(\"p\",{children:\"Loading runs…\"},void 0,!1,void 0,this),Z(\"ul\",{children:M.map((Y)=>Z(\"li\",{children:Z(\"button\",{type:\"button\",onClick:()=>B(Y.runId),children:[Y.status,\" · \",new Date(Y.startedAtMs).toLocaleString(),\" · \",Y.runId]},void 0,!0,void 0,this)},Y.runId,!1,void 0,this))},void 0,!1,void 0,this),G&&G.runCount>z0&&Z(\"div\",{class:\"confirm-actions\",children:[Z(\"button\",{class:\"secondary-button\",disabled:K.loading||!G.offset,onClick:()=>z(Math.max(0,G.offset-z0)),children:\"Previous\"},void 0,!1,void 0,this),Z(\"span\",{children:[G.offset+1,\"–\",G.offset+M.length,\" of \",G.runCount]},void 0,!0,void 0,this),Z(\"button\",{class:\"secondary-button\",disabled:K.loading||G.offset+z0>=G.runCount,onClick:()=>z(G.offset+z0),children:\"Next\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W?Z(l,{children:[Z(\"label\",{class:\"field\",children:[\"Compare from\",\" \",Z(\"select\",{\"aria-label\":\"Compare from\",value:K0(W),onChange:(Y)=>q(Y.currentTarget.value),children:Q.map((Y)=>Z(\"option\",{value:K0(Y),children:E$(Y)},K0(Y),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"p\",{class:\"sheet-subtitle\",children:\"Changes from the comparison definition to the selected definition.\"},void 0,!1,void 0,this),b.error?Z(\"p\",{role:\"alert\",children:[b.error,\" \",Z(\"button\",{type:\"button\",onClick:b.reload,children:\"Retry comparison\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!b.value||!J.value?(b.loading||J.loading)&&Z(\"p\",{children:\"Loading comparison…\"},void 0,!1,void 0,this):L?L.length?Z(\"ul\",{class:\"definition-changes\",children:L.map((Y,F)=>Z(\"li\",{children:[Z(\"strong\",{children:[Y.stepId?`${Y.stepId}: `:\"\",Y.field]},void 0,!0,void 0,this),(Y.before!==void 0||Y.after!==void 0)&&Z(\"div\",{children:[Z(\"code\",{children:Y.before??\"not supplied\"},void 0,!1,void 0,this),\" →\",\" \",Z(\"code\",{children:Y.after??\"not supplied\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},F,!0,void 0,this))},void 0,!1,void 0,this):Z(\"p\",{children:\"No recorded semantic changes.\"},void 0,!1,void 0,this):Z(\"p\",{children:\"A complete comparison is unavailable: a legacy recording has no identity, or a definition snapshot exceeded recording limits.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z(\"p\",{class:\"sheet-subtitle\",children:\"Record another version of this pipeline to compare definitions.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function d$($,X){let Q=X?.pipelineId,W=X?.identity?.definitionId,J=W?X?.runCount:X?.lastSeenAtMs,K=s0(async()=>{if(!$||!Q)throw Error(\"No definition selected.\");return $.loadDefinition(Q,W)},[$,Q,W,J]);return U2($,X?K0(X):\"\",K)}function B4($,X,Q){let W=X?.pipelineId,J=X?.identity?.definitionId,K=X?[X.runCount,X.activeRuns,X.lastSeenAtMs].join(\":\"):\"\",b=s0(async()=>{if(!$||!W)throw Error(\"No definition selected.\");return $.loadDefinitionRuns(W,J,Q)},[$,W,J,K,Q]);return U2($,X?K0(X):\"\",b)}function x$({definitions:$,api:X,onSelect:Q}){let[W,J]=T(\"\"),[K,b]=T(\"\"),[N,q]=T(0),z=$.find((Y)=>K0(Y)===W)??$[0],B=$.filter((Y)=>Y.pipelineId===z?.pipelineId&&K0(Y)!==(z&&K0(z))),P=B.find((Y)=>K0(Y)===K)??B[0],G=d$(X,z),M=B4(X,z,N),L=d$(X,P);return Z(N4,{definitions:$,selected:z,candidates:B,previous:P,definition:G,runs:M,comparison:L,onDefinition:(Y)=>{J(Y),b(\"\"),q(0)},onCompare:b,onPage:q,onSelect:Q},void 0,!1,void 0,this)}function q4($){if($===void 0)return\"Path unavailable\";return $.reduce((X,Q)=>X+(typeof Q===\"number\"?`[${Q}]`:/^[A-Za-z_$][\\w$]*$/.test(Q)?`.${Q}`:`[${JSON.stringify(Q)}]`),\"$\")}function U4($,X,Q,W){let J=X.trim().toLowerCase();return $.filter((K)=>(Q===\"all\"||K.level===Q)&&(W===\"all\"||(W===\"unattributed\"?!K.stepId:K.stepId===W.slice(5)))&&(!J||K.message.toLowerCase().includes(J)))}function y1({cause:$,label:X=\"Cause\"}){return Z(\"details\",{class:\"debug-cause\",children:[Z(\"summary\",{children:[X,\": \",$.name&&`${$.name}: `,$.message||\"No message\"]},void 0,!0,void 0,this),Z(\"div\",{class:\"debug-cause-body\",children:[$.sourceCode&&Z(\"div\",{children:[\"Source code: \",$.sourceCode]},void 0,!0,void 0,this),$.cause&&Z(y1,{cause:$.cause},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function p$({error:$}){let X=$.fanOut;return Z(\"section\",{\"aria-label\":\"Run diagnostics\",class:\"error-card\",children:[Z(\"div\",{class:\"error-code\",children:[$.code,\" · \",$.phase,\" · \",$.kind,$.sourceCode&&` · ${$.sourceCode}`]},void 0,!0,void 0,this),Z(\"div\",{class:\"error-message\",children:$.message},void 0,!1,void 0,this),$.issues&&$.issues.length>0&&Z(\"div\",{class:\"debug-group\",children:[Z(\"strong\",{children:[\"Validation issues · \",$.issues.length]},void 0,!0,void 0,this),Z(\"ul\",{class:\"debug-issues\",children:$.issues.map((Q,W)=>Z(\"li\",{children:[Z(\"code\",{children:q4(Q.path)},void 0,!1,void 0,this),Z(\"span\",{children:Q.message},void 0,!1,void 0,this)]},W,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.cause&&Z(\"div\",{class:\"debug-group\",children:Z(y1,{cause:$.cause},void 0,!1,void 0,this)},void 0,!1,void 0,this),X&&Z(\"div\",{class:\"debug-group\",children:[Z(\"strong\",{children:[\"Failed fan-out items · \",X.failureCount]},void 0,!0,void 0,this),X.failures.map((Q)=>Z(\"details\",{class:\"debug-cause\",children:[Z(\"summary\",{children:[\"#\",Q.index+1,\" · \",Q.key,Q.keyTruncated&&\" (key truncated)\",\" ·\",\" \",Q.cancelled?\"cancelled\":\"failed\",\" · \",Q.error.message]},void 0,!0,void 0,this),Z(\"div\",{class:\"debug-cause-body\",children:[Q.error.name&&Z(\"div\",{children:[\"Type: \",Q.error.name]},void 0,!0,void 0,this),Q.error.sourceCode&&Z(\"div\",{children:[\"Source code: \",Q.error.sourceCode]},void 0,!0,void 0,this),Q.error.cause&&Z(y1,{cause:Q.error.cause},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},Q.index,!0,void 0,this)),X.omittedFailureCount>0&&Z(\"div\",{class:\"debug-note\",children:[X.omittedFailureCount,\" more failures omitted from the recording\"]},void 0,!0,void 0,this),X.schedulerError&&Z(y1,{cause:X.schedulerError,label:\"Scheduler error\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function P4($){if(!Number.isFinite($)||Math.abs($)>8640000000000000)return\"\";return new Intl.DateTimeFormat(void 0,{hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\"}).format($)}function o$({logs:$}){let[X,Q]=T(\"\"),[W,J]=T(\"all\"),[K,b]=T(\"all\"),N=[...new Set($.flatMap((z)=>z.stepId?[z.stepId]:[]))].sort(),q=U4($,X,W,K);return Z(\"section\",{\"aria-label\":\"Run logs\",children:[Z(\"div\",{class:\"section-title\",children:[Z(\"span\",{children:\"Logs\"},void 0,!1,void 0,this),Z(\"span\",{children:q.length===$.length?$.length:`${q.length} of ${$.length}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"log-filters\",children:[Z(\"label\",{children:[Z(\"span\",{children:\"Search text\"},void 0,!1,void 0,this),Z(\"input\",{type:\"search\",value:X,onInput:(z)=>Q(z.currentTarget.value),placeholder:\"Search log messages\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"label\",{children:[Z(\"span\",{children:\"Level\"},void 0,!1,void 0,this),Z(\"select\",{value:W,onChange:(z)=>J(z.currentTarget.value),children:[Z(\"option\",{value:\"all\",children:\"All levels\"},void 0,!1,void 0,this),Z(\"option\",{value:\"error\",children:\"Error\"},void 0,!1,void 0,this),Z(\"option\",{value:\"warn\",children:\"Warn\"},void 0,!1,void 0,this),Z(\"option\",{value:\"log\",children:\"Log\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"label\",{children:[Z(\"span\",{children:\"Step\"},void 0,!1,void 0,this),Z(\"select\",{value:K,onChange:(z)=>b(z.currentTarget.value),children:[Z(\"option\",{value:\"all\",children:\"All steps\"},void 0,!1,void 0,this),$.some((z)=>!z.stepId)&&Z(\"option\",{value:\"unattributed\",children:\"No step\"},void 0,!1,void 0,this),N.map((z)=>Z(\"option\",{value:`step:${z}`,children:z},z,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.length?Z(\"div\",{class:\"logs\",children:q.map((z)=>Z(\"div\",{class:\"log-line\",children:[Z(\"time\",{class:\"log-time\",children:P4(z.timestampMs)},void 0,!1,void 0,this),Z(\"span\",{class:`log-level ${z.level}`,children:z.level},void 0,!1,void 0,this),Z(\"span\",{class:\"log-message\",children:[z.stepId&&Z(l,{children:[Z(\"b\",{children:z.stepId},void 0,!1,void 0,this),\" ·\",\" \"]},void 0,!0,void 0,this),z.message]},void 0,!0,void 0,this)]},z.id,!0,void 0,this))},void 0,!1,void 0,this):Z(\"div\",{class:\"log-empty\",children:\"No logs match these filters.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function i$($){if(!Number.isFinite($)||Math.abs($)>8640000000000000)return\"\";return new Intl.DateTimeFormat(void 0,{dateStyle:\"medium\",timeStyle:\"medium\"}).format($)}function r$($){if(!Number.isFinite($)||Math.abs($)>8640000000000000)return\"\";return new Date($).toISOString()}function n$($,X){let Q=Math.max(0,X-$);if(Q<60000)return Math.floor(Q/1000)+\"s ago\";if(Q<3600000)return Math.floor(Q/60000)+\"m ago\";if(Q<86400000)return Math.floor(Q/3600000)+\"h ago\";return Math.floor(Q/86400000)+\"d ago\"}function M4({nowMs:$,onSelect:X,run:Q,selectedRootRunId:W}){let{activity:J,descendantCount:K}=Q;return Z(\"button\",{class:`run-row ${Q.status} ${W===Q.runId?\"selected\":\"\"}`,\"data-run-id\":Q.runId,onClick:()=>X(Q.runId),children:[Z(\"div\",{class:\"run-primary\",children:[Z(b0,{value:Q.status},void 0,!1,void 0,this),Z(\"strong\",{children:Q.pipelineId},void 0,!1,void 0,this),Z(\"time\",{class:\"run-time\",datetime:r$(Q.startedAtMs),title:i$(Q.startedAtMs),children:n$(Q.startedAtMs,$)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"run-secondary\",children:[Z(\"code\",{children:C0(Q.runId)},void 0,!1,void 0,this),Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Q.correlationId&&Z(l,{children:[Z(\"span\",{children:[\"correlation \",Q.correlationId]},void 0,!0,void 0,this),Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{children:F0(Q.durationMs)},void 0,!1,void 0,this),Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Z(\"span\",{children:[Q.stepCount,\" steps\"]},void 0,!0,void 0,this),K>0&&Z(l,{children:[Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Z(\"span\",{children:[K,\" nested run\",K===1?\"\":\"s\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q.dryRun&&Z(l,{children:[Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Z(\"span\",{children:\"dry run\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q.status===\"running\"&&Z(\"div\",{class:\"run-activity\",children:[Z(\"strong\",{children:J.count>1?`${J.count} steps running`:J.names[0]||\"Starting\"},void 0,!1,void 0,this),Z(\"span\",{children:J.count>1?`${J.names.join(\", \")}${J.count>3?` +${J.count-3} more`:\"\"}`:J.message||\"Execution in progress\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function G4($){return[\"running\",\"failed\",\"cancelled\",\"skipped\",\"completed\",\"planned\"].map((Q)=>[Q,$.steps.filter((W)=>W.status===Q).length]).filter(([,Q])=>Q).map(([Q,W])=>W+\" \"+Q).join(\" · \")||\"No steps\"}function F4($,X){let Q=[...$],W=new Set(Q.map((J)=>J.runId));for(let J of X){if(W.has(J.runId))continue;W.add(J.runId),Q.push(J)}return Q}function L4({api:$,detail:X,onSelect:Q}){let[W,J]=T([]),[K,b]=T(1),[N,q]=T(!1),[z,B]=T(!1),[P,G]=T(),M=F4(X.children,W);if(X.childCount===0)return null;let L=()=>{if(!$||N||z||M.length>=X.childCount)return;q(!0),G(void 0),$.loadChildRuns(X.run.runId,K).then((Y)=>{if(q(!1),!Y){G(\"This run is no longer in history.\"),B(!0);return}let F=new Set(M.map((k)=>k.runId)),O=Y.children.filter((k)=>!F.has(k.runId));if(O.length===0){B(!0);return}J((k)=>[...k,...O]),b(Y.page+1)},(Y)=>{q(!1),G(Y instanceof Error?Y.message:\"Could not load more runs.\")})};return Z(l,{children:[Z(\"div\",{class:\"section-title\",children:[Z(\"span\",{children:\"Nested runs\"},void 0,!1,void 0,this),Z(\"span\",{children:[X.childCount,\" direct · \",X.descendantCount,\" total\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"nested-runs\",children:M.map((Y)=>{let F=Y.descendantCount;return Z(\"button\",{class:\"nested-run\",type:\"button\",onClick:()=>Q(Y.runId),children:[Z(b0,{value:Y.status},void 0,!1,void 0,this),Z(\"strong\",{children:Y.pipelineId},void 0,!1,void 0,this),Z(\"small\",{children:[F0(Y.durationMs),\" · \",Y.stepCount,\" steps\",F?\" · \"+F+\" nested\":\"\"]},void 0,!0,void 0,this)]},Y.runId,!0,void 0,this)})},void 0,!1,void 0,this),P&&Z(\"p\",{role:\"alert\",children:P},void 0,!1,void 0,this),$&&!z&&M.length<X.childCount&&Z(\"div\",{class:\"confirm-actions\",children:Z(\"button\",{class:\"secondary-button\",type:\"button\",disabled:N,onClick:L,children:N?\"Loading…\":\"Show more\"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function H4({api:$,canCancel:X,cancelling:Q,liveRunIds:W,nowMs:J,onCancel:K,onCopyLink:b,onSelect:N,onStepView:q,selection:z,stepView:B=\"timeline\",latestRunId:P}){if(z.status!==\"ready\"){if(z.status===\"unavailable\")return Z(\"div\",{class:\"sheet detail\",children:Z(\"div\",{class:\"unavailable-run\",children:[Z(\"strong\",{children:\"Run unavailable\"},void 0,!1,void 0,this),Z(\"p\",{children:\"This run is not in this Studio history. It may have been deleted, or this link may refer to another local store.\"},void 0,!1,void 0,this),Z(\"code\",{children:z.runId},void 0,!1,void 0,this),P&&Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>N(P),children:\"Select latest run\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return Z(\"div\",{class:\"sheet detail\",children:Z(d0,{title:z.status===\"loading\"?\"Loading run\":\"Select a run\",copy:z.status===\"loading\"?\"Loading this run's recorded details.\":\"Choose a run from the history to inspect its steps, retry telemetry, logs, and errors.\"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}let{detail:G}=z,{run:M,ancestors:L}=G;return Z(\"article\",{class:\"sheet detail\",children:Z(\"div\",{class:\"detail-body\",children:[L.length>0&&Z(\"div\",{class:\"run-parentage\",children:[L.map((Y)=>Z(\"span\",{children:[Z(\"button\",{type:\"button\",onClick:()=>N(Y.runId),children:Y.pipelineId},void 0,!1,void 0,this),Z(\"span\",{children:\" / \"},void 0,!1,void 0,this)]},Y.runId,!0,void 0,this)),Z(\"span\",{children:M.pipelineId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"detail-heading\",children:[Z(\"div\",{class:\"detail-heading-copy\",children:[Z(\"div\",{class:\"detail-kicker\",children:[M.parentRunId?\"Nested run\":\"Top-level run\",\" ·\",\" \",n$(M.startedAtMs,J)]},void 0,!0,void 0,this),Z(\"h2\",{children:M.pipelineId},void 0,!1,void 0,this),Z(\"p\",{class:\"definition-identity\",children:[\"Definition:\",\" \",Z(\"code\",{children:M.definitionIdentity?.definitionId??\"Not recorded (legacy trace)\"},void 0,!1,void 0,this),Z(\"br\",{},void 0,!1,void 0,this),\"Implementation: \",M.definitionIdentity?.implementationVersion??\"Unknown\"]},void 0,!0,void 0,this),Z(\"div\",{class:\"run-id\",children:M.runId},void 0,!1,void 0,this),M.correlationId&&Z(\"div\",{class:\"run-id\",children:[\"Correlation: \",M.correlationId]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"detail-heading-actions\",children:[Z(b0,{value:M.status},void 0,!1,void 0,this),Z(\"button\",{class:\"icon-button\",type:\"button\",title:\"Copy run link\",\"aria-label\":\"Copy run link\",onClick:()=>b(M.runId),children:Z(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",\"aria-hidden\":\"true\",children:[Z(\"rect\",{x:\"7\",y:\"5\",width:\"10\",height:\"12\",rx:\"2\"},void 0,!1,void 0,this),Z(\"path\",{d:\"M13 5V4a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),X&&M.status===\"running\"&&!M.parentRunId&&W.includes(M.runId)&&Z(\"button\",{class:\"danger-button\",type:\"button\",disabled:Q,onClick:()=>K(M.runId),children:\"Cancel run\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"detail-meta\",children:[Z(\"div\",{children:[Z(\"label\",{children:\"Started\"},void 0,!1,void 0,this),Z(\"span\",{title:r$(M.startedAtMs),children:i$(M.startedAtMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{children:[Z(\"label\",{children:\"Duration\"},void 0,!1,void 0,this),Z(\"span\",{children:F0(M.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{children:[Z(\"label\",{children:\"Steps\"},void 0,!1,void 0,this),Z(\"span\",{children:M.steps.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{children:[Z(\"label\",{children:\"Events\"},void 0,!1,void 0,this),Z(\"span\",{children:M.eventCount},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(L4,{api:$,detail:G,onSelect:N},M.runId,!1,void 0,this),M.error&&Z(l,{children:[Z(\"div\",{class:\"section-title\",children:Z(\"span\",{children:\"Error diagnostics\"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(p$,{error:M.error},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.logs.length>0&&Z(o$,{logs:M.logs},M.runId,!1,void 0,this),Z(\"div\",{class:\"section-title\",children:[Z(\"span\",{children:B===\"graph\"?\"Step graph\":\"Step timeline\"},void 0,!1,void 0,this),Z(\"span\",{class:\"section-title-actions\",children:[G4(M),q&&M.steps.length>0&&Z(\"span\",{class:\"view-toggle\",role:\"group\",\"aria-label\":\"Step view\",children:[\"timeline\",\"graph\"].map((Y)=>Z(\"button\",{type:\"button\",\"aria-pressed\":B===Y,onClick:()=>q(Y),children:Y===\"graph\"?\"Graph\":\"Timeline\"},Y,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M.steps.length===0?Z(d0,{title:\"No planned steps\",copy:\"This run ended before a step plan was recorded.\"},void 0,!1,void 0,this):B===\"graph\"?Z(j$,{detail:G,api:$,onOpenRun:N},M.runId,!1,void 0,this):Z(\"div\",{class:\"step-list\",children:M.steps.map((Y)=>Z(g1,{step:Y},Y.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function s$($){let[X,Q]=T($.stepView??\"timeline\"),W=$.roots.filter((b)=>b.subtreeIsRunning),J=$.roots.filter((b)=>!b.subtreeIsRunning),K=(b,N)=>N.length?Z(l,{children:[Z(\"div\",{class:\"run-group\",children:[b,\" · \",N.length]},void 0,!0,void 0,this),N.map((q)=>Z(M4,{nowMs:$.nowMs,onSelect:$.onSelect,run:q,selectedRootRunId:$.selection.status===\"ready\"||$.selection.status===\"loading\"?$.selection.summary?.rootRunId:void 0},q.runId,!1,void 0,this))]},void 0,!0,void 0,this):null;return Z(l,{children:[Z(x$,{definitions:$.definitions??[],api:$.api,onSelect:$.onSelect},void 0,!1,void 0,this),Z(\"div\",{class:\"content-grid\",children:[Z(\"section\",{class:\"sheet\",children:[Z(\"div\",{class:\"sheet-head\",children:[Z(\"div\",{children:[Z(\"div\",{class:\"sheet-title\",children:\"Pipeline runs\"},void 0,!1,void 0,this),Z(\"div\",{class:\"sheet-subtitle\",children:\"Top-level runs · nested work stays with its parent\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{class:\"sheet-subtitle\",children:[$.matchingRootCount??$.roots.length,\" top-level · \",$.totalRunCount,\" \",\"total\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"run-list\",children:$.roots.length?Z(l,{children:[K(\"Running now\",W),K(\"Recent\",J)]},void 0,!0,void 0,this):Z(d0,{title:\"No recorded runs\",copy:\"Choose Pipelines to start a run and create local history.\"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.onPage&&($.matchingRootCount??0)>z0&&Z(\"div\",{class:\"confirm-actions\",children:[Z(\"button\",{class:\"secondary-button\",disabled:!$.offset,onClick:()=>$.onPage?.(Math.max(0,($.offset??0)-z0)),children:\"Previous\"},void 0,!1,void 0,this),Z(\"span\",{children:[($.offset??0)+1,\"–\",($.offset??0)+$.roots.length,\" of\",\" \",$.matchingRootCount]},void 0,!0,void 0,this),Z(\"button\",{class:\"secondary-button\",disabled:($.offset??0)+z0>=($.matchingRootCount??0),onClick:()=>$.onPage?.(($.offset??0)+z0),children:\"Next\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(H4,{...$,stepView:X,onStepView:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function g4($){return $.parameters.map((X)=>{if(X.type===\"boolean\")return[Boolean(X.default)];if(X.multiple)return X.choices?[]:[\"\"];return X.default===void 0?[\"\"]:[X.default]})}function O4($,X){let Q={};return $.parameters.forEach((W,J)=>{let K=X(W,J);if(W.type===\"boolean\"){let N=K[0];if(N!==Boolean(W.default))Q[W.key]=N;return}if(W.multiple){Q[W.key]=W.type===\"number\"?K.filter((N)=>typeof N===\"number\"):K.filter((N)=>typeof N===\"string\");return}let b=K[0];if(b!==\"\"&&b!==void 0)Q[W.key]=b}),Q}function A4($,X){let Q={};return $.parameters.forEach((W,J)=>{if(W.group!==\"execution\")return;let K=X(W,J);if(W.type===\"boolean\"){if(K[0]===!0)Q[W.key]=!0;return}if(W.multiple&&K.length)Q[W.key]=K.filter((b)=>typeof b===\"string\")}),Q}function C4($){return $.key.replace(/([a-z0-9])([A-Z])/g,\"$1 $2\").replace(/[-_]+/g,\" \").replace(/\\b\\w/g,(X)=>X.toUpperCase())}function T4($){let X=[];if($.description)X.push($.description);if($.environment)X.push(\"Environment fallback: \"+$.environment);if($.multiple)X.push($.choices?\"Choose one or more values.\":\"Enter one value per line.\");if($.mustExist)X.push(\"Must be an existing \"+($.pathKind||\"path\")+\".\");return X.join(\" \")}function R4({index:$,onChange:X,parameter:Q,values:W}){let J=\"run-param-\"+$,K=T4(Q),b=C4(Q);if(Q.type===\"boolean\")return Z(\"label\",{class:\"boolean-field\",for:J,children:[Z(\"span\",{children:[Z(\"strong\",{children:b},void 0,!1,void 0,this),Z(\"small\",{children:K||\"Enable this option.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"input\",{id:J,type:\"checkbox\",checked:W[0]===!0,onChange:(z)=>X($,[z.currentTarget.checked])},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let N=Z(\"label\",{for:J,children:[b,Q.required&&Z(\"span\",{class:\"required-mark\",children:\"required\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q;if(Q.choices){let z=W.filter((B)=>typeof B===\"string\");q=Z(\"select\",{id:J,multiple:Q.multiple,required:Q.required,value:Q.multiple?void 0:z[0]??\"\",onChange:(B)=>X($,Q.multiple?Array.from(B.currentTarget.selectedOptions,(P)=>P.value):[B.currentTarget.value]),children:[!Q.multiple&&!Q.required&&Z(\"option\",{value:\"\",children:\"Use default or leave unset\"},void 0,!1,void 0,this),Q.choices.map((B)=>Z(\"option\",{value:B,selected:Q.multiple?z.includes(B):void 0,children:B},B,!1,void 0,this))]},void 0,!0,void 0,this)}else if(Q.multiple)q=Z(\"textarea\",{id:J,spellcheck:!1,placeholder:\"One value per line\",value:String(W[0]??\"\"),onInput:(z)=>X($,[z.currentTarget.value])},void 0,!1,void 0,this);else if(Q.type===\"number\"){let z=W[0]??\"\";q=Z(\"input\",{id:J,type:\"number\",value:String(z),step:Q.integer?\"1\":\"any\",min:Q.min,max:Q.max,required:Q.required,onInput:(B)=>X($,B.currentTarget.value!==\"\"?[Number(B.currentTarget.value)]:[B.currentTarget.value])},void 0,!1,void 0,this)}else{let z=W[0]??\"\";q=Z(\"input\",{id:J,type:\"text\",value:String(z),placeholder:Q.type===\"path\"?Q.pathKind===\"directory\"?\"./directory\":\"./file\":\"\",required:Q.required,onInput:(B)=>X($,[B.currentTarget.value])},void 0,!1,void 0,this)}return Z(\"div\",{class:\"field\",children:[N,q,K&&Z(\"div\",{class:\"field-hint\",children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _4({command:$,onChange:X,values:Q}){let W=(K,b,N)=>{let q=$.parameters.map((z,B)=>({index:B,parameter:z})).filter(({parameter:z})=>z.group===\"execution\"===K);if(!q.length)return null;return Z(\"section\",{class:\"form-section\",children:[Z(\"div\",{class:\"form-section-head\",children:[Z(\"strong\",{children:b},void 0,!1,void 0,this),Z(\"span\",{children:N},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"parameter-grid\",children:q.map(({index:z,parameter:B})=>Z(R4,{index:z,onChange:X,parameter:B,values:Q[z]??[]},B.key,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},J=$.parameters.filter((K)=>K.group!==\"execution\").length;return Z(\"div\",{class:\"parameter-fields\",id:\"parameterFields\",children:[W(!1,\"Pipeline inputs\",J+\" parameter\"+(J===1?\"\":\"s\")),W(!0,\"Execution controls\",\"Built into Tubeless\")]},void 0,!0,void 0,this)}function a$({api:$,commands:X,commandId:Q,onClose:W,onLaunched:J}){let[K,b]=T(Q??X[0]?.id??\"\"),N=X.find((A)=>A.id===K),[q,z]=T([]),[B,P]=T(null),[G,M]=T(\"\"),[L,Y]=T(!1),[F,O]=T(!1),k=P0(null),g=P0(0);if(i(()=>{b(Q??X[0]?.id??\"\")},[Q,X]),i(()=>{g.current+=1,z(N?g4(N):[]),P(null),M(\"\"),requestAnimationFrame(()=>k.current?.querySelector(\"input, select, textarea\")?.focus())},[N]),i(()=>{if(Q===null)return;let A=(S)=>{if(S.key===\"Escape\"&&!L&&!F)W()};return document.addEventListener(\"keydown\",A),()=>document.removeEventListener(\"keydown\",A)},[Q,L,W,F]),Q===null)return null;let R=()=>{if(!L&&!F)W()},_=(A,S)=>{if(!N)return;g.current+=1,z((c)=>c.map((w,y)=>{if(y===A)return S;let x=N.parameters[y];return N.parameters[A]?.exclusive&&N.parameters[A]?.multiple&&S.length>0&&x?.exclusive&&x.multiple?[]:w})),P(null)},V=(A,S)=>{let c=q[S]??[];if(!A.multiple||A.choices)return c;return String(c[0]??\"\").split(/\\r?\\n/).map((w)=>w.trim()).filter(Boolean).map((w)=>A.type===\"number\"?Number(w):w)},d=async()=>{if(!N?.canPlan||F)return;let A=g.current;O(!0),M(\"\");try{let S=await $.previewPlan(N.id,A4(N,V));if(g.current===A)P(S)}catch(S){if(g.current===A)M(w0(S))}finally{O(!1)}},C=async(A)=>{if(A.preventDefault(),!N||L)return;Y(!0),M(\"\");try{J(await $.launch(N.id,O4(N,V)))}catch(S){M(w0(S))}finally{Y(!1)}};return Z(\"div\",{class:\"modal-backdrop\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"launchTitle\",onClick:(A)=>A.target===A.currentTarget&&R(),children:Z(\"div\",{class:\"modal\",children:[Z(\"div\",{class:\"modal-head\",children:[Z(\"div\",{children:[Z(\"div\",{class:\"detail-kicker\",children:\"Configure pipeline\"},void 0,!1,void 0,this),Z(\"h2\",{id:\"launchTitle\",children:N?.name||\"Run a pipeline\"},void 0,!1,void 0,this),Z(\"p\",{children:N?x0(N):\"Choose a declared pipeline and provide its inputs.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"button\",{class:\"close-button\",type:\"button\",\"aria-label\":\"Close\",onClick:R,children:\"×\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"form\",{class:\"launch-form\",onSubmit:C,children:[Z(\"div\",{class:\"field\",children:[Z(\"label\",{for:\"launchCommand\",children:\"Pipeline command\"},void 0,!1,void 0,this),Z(\"select\",{id:\"launchCommand\",value:K,onChange:(A)=>{g.current+=1,P(null),M(\"\"),b(A.currentTarget.value)},children:X.map((A)=>Z(\"option\",{value:A.id,children:A.name},A.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{ref:k,children:N&&Z(_4,{command:N,onChange:_,values:q},void 0,!1,void 0,this)},void 0,!1,void 0,this),B&&Z(\"div\",{class:\"plan-result\",\"aria-live\":\"polite\",children:Z(T$,{plan:B},void 0,!1,void 0,this)},void 0,!1,void 0,this),G&&Z(\"div\",{class:\"launch-error\",children:G},void 0,!1,void 0,this),Z(\"div\",{class:\"modal-actions\",children:[Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:R,children:\"Cancel\"},void 0,!1,void 0,this),N?.canPlan&&Z(\"button\",{class:\"secondary-button\",type:\"button\",disabled:F||L,onClick:()=>void d(),children:F?\"Planning…\":\"Preview plan\"},void 0,!1,void 0,this),Z(\"button\",{class:\"primary-button\",type:\"submit\",disabled:L||F,children:L?\"Starting…\":\"Run\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function S4({commandCount:$,snapshot:X}){let Q=X.completedRunCount+X.failedRunCount,W=Q?Math.round(X.completedRunCount/Q*100):0,J=$||new Set(X.definitions.map(({pipelineId:b})=>b)).size,K=[[\"Active now\",X.activeRunCount,X.activeRunCount?\"Live execution in progress\":\"No work in flight\"],[\"Recorded runs\",X.runCount,\"Append-only local history\"],[\"Success rate\",W+\"%\",Q+\" terminal runs\"],[\"Pipelines\",J,$?\"Available to configure\":\"Observed in run history\"]];return Z(l,{children:K.map(([b,N,q])=>Z(\"article\",{class:\"metric\",children:[Z(\"div\",{class:\"metric-label\",children:b},void 0,!1,void 0,this),Z(\"div\",{class:\"metric-value\",children:N},void 0,!1,void 0,this),Z(\"div\",{class:\"metric-note\",children:q},void 0,!1,void 0,this)]},b,!0,void 0,this))},void 0,!1,void 0,this)}function k4({api:$,onCleared:X,onClose:Q,snapshot:W}){let[J,K]=T(!1),[b,N]=T(\"\"),q=P0(null);i(()=>q.current?.focus(),[]),i(()=>{let M=(L)=>{if(L.key===\"Escape\"&&!J)Q()};return document.addEventListener(\"keydown\",M),()=>document.removeEventListener(\"keydown\",M)},[J,Q]);let{runCount:z,eventCount:B}=W,P=()=>{if(!J)Q()},G=async()=>{if(J)return;K(!0),N(\"\");try{X((await $.clearHistory()).eventCount)}catch(M){N(w0(M))}finally{K(!1)}};return Z(\"div\",{class:\"modal-backdrop\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"clearHistoryTitle\",onClick:(M)=>M.target===M.currentTarget&&P(),children:Z(\"div\",{class:\"modal confirm-modal\",children:[Z(\"div\",{class:\"modal-head\",children:[Z(\"div\",{children:[Z(\"div\",{class:\"detail-kicker\",children:\"Local maintenance\"},void 0,!1,void 0,this),Z(\"h2\",{id:\"clearHistoryTitle\",children:\"Clear run history?\"},void 0,!1,void 0,this),Z(\"p\",{children:\"This permanently resets the local studio history.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"button\",{class:\"close-button\",type:\"button\",\"aria-label\":\"Close\",onClick:P,children:\"×\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"confirm-body\",children:[Z(\"p\",{class:\"confirm-copy\",children:[\"Remove \",z,\" recorded run\",z===1?\"\":\"s\",\" and \",B,\" event\",B===1?\"\":\"s\",\" from this SQLite store.\",W.activeRunCount?` ${W.activeRunCount} recorded run${W.activeRunCount===1?\" is\":\"s are\"} still marked active; continue only if no external process is writing to this store.`:\"\"]},void 0,!0,void 0,this),Z(\"div\",{class:\"confirm-warning\",children:\"This cannot be undone. Pipeline definitions and execution remain unchanged; only recorded local events are removed.\"},void 0,!1,void 0,this),b&&Z(\"div\",{class:\"launch-error\",children:b},void 0,!1,void 0,this),Z(\"div\",{class:\"confirm-actions\",children:[Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:P,children:\"Cancel\"},void 0,!1,void 0,this),Z(\"button\",{ref:q,class:\"danger-button\",type:\"button\",disabled:J,onClick:()=>void G(),children:J?\"Clearing…\":\"Clear history\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var w4=typeof document>\"u\"?\"\":document.querySelector('meta[name=\"tubeless-studio-mount\"]')?.content??\"\",I4=g$(fetch,w4);function v4($){return{className:`pulse${$?\"\":\" lost\"}`,label:$?\"Connected · local\":\"Connection lost\"}}function P2($){return new URL($).searchParams.get(\"run\")||null}function M2($,X){let Q=new URL($);return Q.searchParams.set(\"run\",X),Q.href}function f4($,X){return $??X[0]?.runId??null}function y4({status:$,href:X}){return Z(\"main\",{class:\"workspace\",children:Z(\"div\",{role:\"alert\",children:[Z(\"h1\",{children:$===401?\"Sign in to continue\":\"Access denied\"},void 0,!1,void 0,this),Z(\"p\",{children:$===401?\"Your access has expired. Open Studio again to sign in through your application.\":\"Your account cannot access this Studio. Open Studio again after your access is restored.\"},void 0,!1,void 0,this),Z(\"a\",{href:X,children:\"Open Studio again\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function h4({api:$=I4}){let X=L1(()=>new Y2($,{runId:P2(window.location.href)}),[$]),[Q,W]=T(()=>X.getState()),{accessDenied:J,connected:K,historyQuery:b,selection:N,manualRefreshing:q,snapshot:z}=Q,B=N.status===\"none\"?null:N.runId,[P,G]=T([]),[M,L]=T(!1),[Y,F]=T(\"runs\"),[O,k]=T(\"\"),g=Y===\"runs\"?b.query:O,[R,_]=T(!1),[V,d]=T(!1),[C,A]=T(!1),[S,c]=T(null),[w,y]=T(!1),[x,p]=T(\"\"),[e$,$6]=T(Date.now);i(()=>{return W(X.getState()),X.subscribe(W)},[X]),i(()=>()=>X.dispose(),[X]),i(()=>{if(J){G([]),_(!1),d(!1),c(null),y(!1),p(\"\");return}$.loadCommands().then((Z0)=>{if(X.getState().accessDenied)return;if(G(Z0),Z0.length&&!P2(window.location.href))F(\"pipelines\")}).catch((Z0)=>{if(!X.getState().accessDenied)p(w0(Z0))}).finally(()=>{if(!X.getState().accessDenied)L(!0)}),$.loadCapabilities().then((Z0)=>{if(X.getState().accessDenied)return;_(Z0.canCancel),d(Z0.canClearHistory)}).catch((Z0)=>{if(!X.getState().accessDenied)p(w0(Z0))}),X.refresh();let v=setInterval(()=>{X.refresh(),$6(Date.now())},1200);return()=>clearInterval(v)},[J,$,X]),i(()=>{let v=()=>{X.setHistoryQuery({}),X.selectRun(P2(window.location.href)),F(\"runs\")};return window.addEventListener(\"popstate\",v),()=>window.removeEventListener(\"popstate\",v)},[X]),i(()=>{if(!x)return;let v=setTimeout(()=>p(\"\"),4200);return()=>clearTimeout(v)},[x]);let z1=z?.runs??[];i(()=>{if(!z||!M||Y!==\"runs\"||B)return;let v=f4(B,z1);if(!v)return;window.history.replaceState(null,\"\",M2(window.location.href,v)),X.selectRun(v)},[M,X,z1,B,z,Y]);let m0=(v)=>{if(!X.getState().accessDenied)p(v)},G2=(v)=>{if(X.getState().accessDenied)return;if(v!==B)window.history.pushState(null,\"\",M2(window.location.href,v));X.selectRun(v),F(\"runs\")},X6=async(v)=>{try{await navigator.clipboard.writeText(M2(window.location.href,v)),m0(\"Run link copied\")}catch{m0(\"Could not copy run link. Copy the address from your browser instead.\")}},Z6=async(v)=>{if(X.getState().accessDenied||!R||C)return;A(!0);try{await $.cancelRun(v),m0(\"Run cancelled · \"+C0(v)),X.invalidate({delayMs:80})}catch(Z0){m0(w0(Z0))}finally{A(!1)}},Q6=P.filter((v)=>!g||v.name.toLowerCase().includes(g.toLowerCase())||x0(v).toLowerCase().includes(g.toLowerCase())),v0=Y===\"pipelines\";if(J)return Z(y4,{status:J,href:window.location.href},void 0,!1,void 0,this);let F2=v4(K);return Z(l,{children:[Z(\"div\",{class:\"shell\",children:[Z(\"aside\",{class:\"rail\",children:[Z(\"div\",{class:\"brand\",children:[Z(\"div\",{class:\"mark\",\"aria-hidden\":\"true\",children:Z(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 18 18\",fill:\"none\",children:[Z(\"path\",{d:\"M3 4.5h6a3 3 0 0 1 3 3v6\",stroke:\"#f7f8f3\",strokeWidth:\"1.5\"},void 0,!1,void 0,this),Z(\"circle\",{cx:\"3\",cy:\"4.5\",r:\"2\",fill:\"#7396ff\"},void 0,!1,void 0,this),Z(\"circle\",{cx:\"12\",cy:\"13.5\",r:\"2\",fill:\"#63d297\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{class:\"brand-copy\",children:[Z(\"strong\",{children:\"Tubeless\"},void 0,!1,void 0,this),Z(\"small\",{children:\"Local studio\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"rail-label\",children:\"Workspace\"},void 0,!1,void 0,this),Z(\"nav\",{class:\"nav\",\"aria-label\":\"Studio sections\",children:[P.length>0&&Z(\"button\",{class:v0?\"active\":\"\",type:\"button\",title:\"Pipelines\",onClick:()=>F(\"pipelines\"),children:[Z(\"svg\",{viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",children:[Z(\"path\",{d:\"M4 5h7M4 10h12M9 15h7\"},void 0,!1,void 0,this),Z(\"circle\",{cx:\"14.5\",cy:\"5\",r:\"1.5\"},void 0,!1,void 0,this),Z(\"circle\",{cx:\"5.5\",cy:\"15\",r:\"1.5\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{children:\"Pipelines\"},void 0,!1,void 0,this),Z(\"b\",{class:\"nav-count\",children:P.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"button\",{class:v0?\"\":\"active\",type:\"button\",title:\"Runs\",onClick:()=>F(\"runs\"),children:[Z(\"svg\",{viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",children:[Z(\"path\",{d:\"M10 3v4l2.5 1.5M17 10a7 7 0 1 1-2.05-4.95\"},void 0,!1,void 0,this),Z(\"path\",{d:\"M14.5 2.8v3.5H18\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{children:\"Runs\"},void 0,!1,void 0,this),Z(\"b\",{class:\"nav-count\",children:z?.runCount??0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"rail-foot\",children:[Z(\"div\",{class:\"connection\",children:[Z(\"i\",{class:F2.className},void 0,!1,void 0,this),Z(\"span\",{children:F2.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"database\",children:\"append-only SQLite\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"main\",{class:\"workspace\",children:[Z(\"header\",{class:\"topbar\",children:[Z(\"div\",{children:[Z(\"div\",{class:\"eyebrow\",children:\"Execution workspace\"},void 0,!1,void 0,this),Z(\"h1\",{children:v0?\"Pipelines\":\"Runs\"},void 0,!1,void 0,this),Z(\"p\",{class:\"lede\",children:v0?\"Choose a declared workflow to configure and run.\":\"Live work and durable history in one place.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"toolbar\",children:[Z(\"input\",{class:\"search\",type:\"search\",value:g,placeholder:v0?\"Filter pipelines\":\"Filter runs or IDs\",\"aria-label\":\"Filter\",onInput:(v)=>{let Z0=v.currentTarget.value.trim();if(v0)k(Z0);else X.setHistoryQuery({query:Z0})}},void 0,!1,void 0,this),P.length>0&&Z(\"button\",{class:\"primary-button\",onClick:()=>c(P[0]?.id??\"\"),children:\"Run pipeline\"},void 0,!1,void 0,this),V&&Z(\"button\",{class:\"danger-button\",id:\"clearHistoryButton\",type:\"button\",disabled:!z?.runCount,title:z?.activeRunCount?\"Clear history, including runs left active by an interrupted process\":\"Clear history\",onClick:()=>y(!0),children:[Z(\"svg\",{viewBox:\"0 0 16 16\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.4\",\"aria-hidden\":\"true\",children:Z(\"path\",{d:\"M3 4.5h10M6 2.5h4M5 4.5l.5 9h5l.5-9M7 7v4M9 7v4\"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"span\",{children:\"Clear history\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"button\",{class:`icon-button${q?\" spinning\":\"\"}`,type:\"button\",title:\"Refresh now\",\"aria-label\":\"Refresh now\",onClick:()=>X.refresh(!0),children:Z(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",children:[Z(\"path\",{d:\"M16.5 7A7 7 0 1 0 17 11\"},void 0,!1,void 0,this),Z(\"path\",{d:\"M16.5 3v4h-4\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z&&Z(l,{children:[Z(\"section\",{class:\"metrics\",children:Z(S4,{commandCount:P.length,snapshot:z},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"section\",{children:v0?Z(C$,{commands:Q6,onConfigure:c},void 0,!1,void 0,this):Z(s$,{definitions:z.definitions,api:$,offset:z.offset,matchingRootCount:z.matchingRootCount,onPage:(v)=>X.setHistoryQuery({...b,offset:v}),canCancel:R,cancelling:C,liveRunIds:z.liveRunIds??[],nowMs:e$,onCancel:(v)=>void Z6(v),onCopyLink:(v)=>void X6(v),onSelect:G2,roots:z1,selection:N,latestRunId:z1[0]?.runId,totalRunCount:z.runCount},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S!==null&&Z(a$,{api:$,commands:P,commandId:S,onClose:()=>c(null),onLaunched:(v)=>{if(X.getState().accessDenied)return;G2(v),X.setHistoryQuery({}),c(null),m0(\"Run accepted · \"+C0(v)),X.invalidate({delayMs:80})}},void 0,!1,void 0,this),w&&z&&Z(k4,{api:$,snapshot:z,onClose:()=>y(!1),onCleared:(v)=>{if(X.getState().accessDenied)return;y(!1),m0(\"Cleared \"+v+\" recorded event\"+(v===1?\"\":\"s\")),X.invalidate({resetHistory:!0})}},void 0,!1,void 0,this),x&&Z(\"div\",{class:\"toast\",role:\"status\",children:x},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function t$(){let $=document.querySelector(\"#studio-root\");if(!($ instanceof HTMLElement))throw Error(\"Missing #studio-root\");I2(Z(h4,{},void 0,!1,void 0,this),$)}t$();\n";
1
+ export const PIPELINE_RUN_STUDIO_CLIENT = "var E,C1,q3,O0,E2,P2,R1,N2,I1,c2,x2,U3,M2={},L2=[],G3=/^m(i|n|o|s|text|space)$/,l2=Array.isArray,w1=L2.slice,y0=Object.assign;function g0(X){X&&X.parentNode&&X.remove()}function F2(X,$,Q,J,z){var K={type:X,props:$,key:Q,ref:J,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:z||++C1,__i:-1,__u:0};return!z&&E.vnode&&E.vnode(K),K}function j(X){return X.children}function H2(X,$){this.props=X,this.context=$,this.__g=0}function T0(X,$){if($==null)return X.__&&T0(X.__,X.__i+1);for(var Q;$<X.__k.length;$++)if((Q=X.__k[$])&&Q.__e)return Q.__e;return typeof X.type!=\"function\"||X.props.__P?null:T0(X)}function S1(X){if((X=X.__)&&X.__c&&!X.props.__P)return X.__e=null,X.__k.some(function($){return $&&(X.__e=$.__e)}),S1(X)}function b1(X){(8&X.__g||(X.__g|=8,O0.push(X),P2++))&&E2==E.debounceRendering||((E2=E.debounceRendering)||queueMicrotask)(g1)}function g1(){var X,$,Q,J,z,K,W,Y,U;try{for($=1;O0.length;)O0.length>$&&O0.sort(R1),X=O0.shift(),$=O0.length,8&X.__g&&(J=void 0,z=void 0,K=(z=(Q=X).__v).__e,W=[],Y=[],(U=Q.__P)&&((J=y0({constructor:void 0},z)).__v=z.__v+1,E.vnode&&E.vnode(J),p2(U,J,z,Q.__n,U.namespaceURI,32&z.__u?[K]:null,W,K||T0(z),32&z.__u,Y),J.__v=z.__v,J.__.__k[J.__i]=J,h1(W,J,Y),z.__=z.__e=null,J.__e!=K&&S1(J)))}finally{(P2=O0.length)&&(E2||queueMicrotask)(g1)}}function y1(X,$,Q,J,z,K,W,Y,U,B,q){var P,M,G,L,N,H,O=J.__k||L2,_=$.length;for(U=N3(Q,$,O,U,_),P=0;P<_;P++)(G=Q.__k[P])!=null&&(M=~G.__i&&O[G.__i]||M2,G.__i=P,H=p2(X,G,M,z,K,W,Y,U,B,q),L=G.__e,(M.ref!=G.ref||8&M.__u)&&(M.ref&&u2(M.ref,null,G,M),G.ref&&q.push(G.ref,G.__c||L,G)),N=N||L,4&G.__u?(U=v1(G,U,X,!M.__v),M.__e&&(M.__e=null)):typeof G.type==\"function\"&&H!==void 0?U=H:L&&(U=L.nextSibling),G.__u&=-21);return Q.__e=N,U}function N3(X,$,Q,J,z){var K,W,Y,U,B,q,P,M,G,L=Q.length,N=L,H=0,O=0,_=X.__k=Array(z);for(K=0;K<z;K++)(W=$[K])!=null&&typeof W!=\"boolean\"&&typeof W!=\"function\"?(typeof W!=\"object\"||W.constructor==String?W=_[K]=F2(null,W):l2(W)?W=_[K]=F2(j,{children:W}):W.constructor===void 0&&W.__b?W=_[K]=F2(W.type,W.props,W.key,W.ref,W.__v):_[K]=W,U=K+H,W.__=X,W.__b=X.__b+1,Y=null,~(B=W.__i=F3(W,Q,U,N))&&(N--,(Y=Q[B])&&(Y.__u|=2)),Y&&Y.__v?(W.__u|=16,B==U-1?H--:B==U+1?H++:B!=U&&(B>U?H--:H++,O=1)):(~B||(z>L?H--:z<L&&H++),typeof W.type!=\"function\"&&(W.__u|=4))):_[K]=null;if(O){for(q=[],P=[],K=0;K<z;K++)if((W=_[K])&&16&W.__u){for(H=0,M=q.length;H<M;)q[G=H+M>>1]<W.__i?H=G+1:M=G;q[H]=W.__i,P[K]=H+1}for(H=q.length;K--;)P[K]&&(P[K]==H?H--:_[K].__u|=4)}if(N)for(K=0;K<L;K++)!(Y=Q[K])||2&Y.__u||(Y.__e==J&&(J=T0(Y)),d2(Y,Y));return J}function v1(X,$,Q,J){var z,K,W,Y;if(typeof X.type==\"function\"){if(X.props.__P)return $;if(z=X.__k)for(K=0;K<z.length;K++)z[K]&&(z[K].__=X,$=v1(z[K],$,Q,!1));return $}for($&&!$.parentNode&&($=T0(X))&&!$.parentNode&&($=null),W=X.__e,Y=$;Y&&Y.nodeType==8;)Y=Y.nextSibling;for(W!=Y&&(!J&&Q.moveBefore&&W.parentNode?Q.moveBefore(W,$):Q.insertBefore(W,$||null)),$=W;($=$&&$.nextSibling)&&$.nodeType==8&&!$.data.startsWith(\"$s\"););return $}function F3(X,$,Q,J){var z,K=X.key,W=X.type,Y=$[Q],U=Y&&!(2&Y.__u);if(Y===null&&K==null||U&&K==Y.key&&W==Y.type)return Q;if(J>(U?1:0)){for(z=Q-1;z>=0;z--)if((Y=$[z])&&!(2&Y.__u)&&K==Y.key&&W==Y.type)return z;for(z=Q+1;z<$.length;z++)if((Y=$[z])&&!(2&Y.__u)&&K==Y.key&&W==Y.type)return z}return-1}function k1(X,$,Q){Q==null&&(Q=\"\"),$[0]==\"-\"?X.setProperty($,Q):X[$]=Q}function G2(X,$,Q,J,z){var K,W;if($==\"style\")if(typeof Q==\"string\")X.style.cssText=Q;else{if(typeof J==\"string\"&&(X.style.cssText=J=\"\"),J)for($ in J)Q&&$ in Q||k1(X.style,$);if(Q)for($ in Q)J&&Q[$]==J[$]||k1(X.style,$,Q[$])}else if($[0]==\"o\"&&$[1]==\"n\")(X.__e||(X.__e={}))[$]=Q,Q&&J||(W=x2[$]||(x2[$]=H3($)),(X.__a||(X.__a={}))[$]=c2,K=$!=($=$.replace(I1,\"$1\")),($=$.slice(2))[0]<\"a\"&&($=$.toLowerCase()),Q?X.addEventListener($,W,K):X.removeEventListener($,W,K));else{if(z==\"http://www.w3.org/2000/svg\")$=$.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if($!=\"width\"&&$!=\"height\"&&$!=\"href\"&&$!=\"list\"&&$!=\"form\"&&$!=\"tabIndex\"&&$!=\"download\"&&$!=\"rowSpan\"&&$!=\"colSpan\"&&$!=\"role\"&&$!=\"popover\"&&$ in X)try{return void(X[$]=Q==null?\"\":Q)}catch(Y){}if(typeof Q==\"function\")return;Q==null||Q===!1&&$[4]!=\"-\"?X.removeAttribute($):X.setAttribute($,$==\"popover\"&&Q==1?\"\":Q)}}function H3(X){return function($){var Q=this.__e;if(Q){if(Q=Q[X],$[N2]==null)$[N2]=c2++;else if($[N2]<this.__a[X])return;return Q(E.event?E.event($):$)}}}function p2(X,$,Q,J,z,K,W,Y,U,B){var q,P,M,G,L,N,H,O,_,R,w,S,m,c,b,T,k,v,I=$.type;if($.constructor!==void 0)return null;128&Q.__u&&(U=32&Q.__u,q=Q.__c.__z)&&($.__u|=U,P=K=[],q.nodeType==8?Y=m2(q,K):K.push(q),Y=K[0]||Y),(q=E.__b)&&q($);X:if(typeof I==\"function\"){M=W.length;try{if(O=$.props,_=(q=I.prototype)&&q.render,R=(q=I.contextType)&&J[q.__c],w=q?R?R.props.value:q.__:J,(G=Q.__c)?($.__c=G,2&G.__g&&(G.__g|=1)):(_?$.__c=G=new I(O,w):($.__c=G=new H2(O,w),G.constructor=I,G.render=M3),R&&R.sub(G),G.state||(G.state={}),G.__n=J,G.__g|=8,G.__h=[],G.__k=[]),_&&(G.__s||(G.__s=G.state),I.getDerivedStateFromProps&&(G.__s==G.state&&(G.__s=y0({},G.__s)),y0(G.__s,I.getDerivedStateFromProps(O,G.__s)))),L=G.props,N=G.state,G.__v=$,Q.__c){if(O!==L&&_&&!I.getDerivedStateFromProps&&G.componentWillReceiveProps&&G.componentWillReceiveProps(O,w),$.__v==Q.__v&&!(8&G.__g)||!(4&G.__g)&&G.shouldComponentUpdate&&G.shouldComponentUpdate(O,G.__s,w)===!1){$.__v!=Q.__v&&(G.props=O,G.state=G.__s,G.__g&=-9),$.__e=Q.__e,$.__k=Q.__k,$.__k.some(function(h){h&&(h.__=$)}),L2.push.apply(G.__h,G.__k),G.__k=[],G.__h.length&&W.push(G),Y=T0(Q);break X}G.componentWillUpdate&&G.componentWillUpdate(O,G.__s,w),_&&G.componentDidUpdate&&G.__h.push(function(){G.componentDidUpdate(L,N,H)})}else _&&!I.getDerivedStateFromProps&&G.componentWillMount&&G.componentWillMount(),_&&G.componentDidMount&&G.__h.push(G.componentDidMount);if(G.context=w,G.props=O,G.__P=X,G.__g&=-5,S=E.__r,m=0,_)G.state=G.__s,G.__g&=-9,S&&S($),q=G.render(G.props,G.state,G.context),L2.push.apply(G.__h,G.__k),G.__k=[];else do G.__g&=-9,S&&S($),q=G.render(G.props,G.state,G.context),G.state=G.__s;while(8&G.__g&&++m<25);G.state=G.__s,G.getChildContext&&(J=y0({},J,G.getChildContext())),_&&Q.__c&&G.getSnapshotBeforeUpdate&&(H=G.getSnapshotBeforeUpdate(L,N)),c=q&&q.type===j&&q.key==null?q.props.children:q,O.__P&&(q=Y,z=(X=O.__P).namespaceURI,U=K=null,Q.props&&Q.props.__P!=X&&(Q.__k.some(function(h){h&&d2(h,h)}),Q.__k=null),Y=Q.__k?T0(Q,0):null),Y=y1(X,l2(c)?c:[c],$,Q,J,z,K,W,Y,U,B),O.__P&&($.__e=null,Y=q),$.__u&=-161,P&&P.some(g0),G.__h.length&&W.push(G),1&G.__g&&(G.__g&=-4)}catch(h){if(W.length=M,$.__v=null,U||K)if(h.then){if(b=0,$.__u|=128|U,K){for(~(k=K.indexOf(Y||void 0))||(k=K.length);(v=K[k-1])&&v.nodeType==8;)k--;for(;k<K.length;k++)if(v=K[k]){if(K[k]=null,v.nodeType==8){if(v.data.startsWith(\"$s\"))b++||(T=v);else if(b&&v.data.startsWith(\"/$s\")&&!--b)break}else if(!b)break}}if(!T){for(;Y&&Y.nodeType==8&&Y.nextSibling;)Y=Y.nextSibling;T=Y}(q=m2(T=$.__c.__z||($.__c.__z=T)))?($.__e=T,Y=q):$.__e=Y,Y=Y&&Y.nextSibling}else K&&K.some(g0);else $.__e=Q.__e;$.__k||($.__k=Q.__k||[]),h.then||f1($),E.__e(h,$,Q)}}else Y=$.__e=P3(Q.__e,$,Q,J,z,K,W,U,B,X);return(q=E.diffed)&&q($),Y}function m2(X,$){if(X&&X.nodeType==8&&X.data.startsWith(\"$s\"))for(var Q=1;X=X.nextSibling;){if(X.nodeType==8){if(X.data.startsWith(\"$s\"))Q++;else if(X.data.startsWith(\"/$s\")&&!--Q)return X}$&&$.push(X)}}function f1(X){X&&(X.__c&&(X.__c.__g|=4),X.__k&&X.__k.some(f1))}function h1(X,$,Q){for(var J=0;J<Q.length;)u2(Q[J++],Q[J++],Q[J++]);E.__c&&E.__c($,X),X.some(function(z){try{X=z.__h,z.__h=[],X.some(function(K){K.call(z)})}catch(K){E.__e(K,z.__v)}})}function P3(X,$,Q,J,z,K,W,Y,U,B){var q,P,M,G,L,N,H,O,_,R=Q.props||M2,w=$.props,S=$.type;if(S==\"svg\"?z=\"http://www.w3.org/2000/svg\":S==\"math\"?z=\"http://www.w3.org/1998/Math/MathML\":z||(z=\"http://www.w3.org/1999/xhtml\"),K){for(q=0;q<K.length;q++)if((L=K[q])&&(S?L.localName==S:L.nodeType==3)){X=L,K[q]=null;break}}if(!X){if(O=B.ownerDocument||document,!S)return O.createTextNode(w);X=O.createElementNS(z,S,w.is&&w),Y&&(E.__m&&E.__m($,K),Y=!1),K=null}if(S){if(B=S==\"template\"?X.content:X,K=S==\"textarea\"&&w.defaultValue!=null?null:K&&w1.call(B.childNodes),!Y&&K)for(R={},q=0;q<X.attributes.length;q++)R[(L=X.attributes[q]).name]=L.value;for(q in R)L=R[q],q==\"dangerouslySetInnerHTML\"?M=L:q==\"children\"||(q in w)||q==\"value\"&&(\"defaultValue\"in w)||q==\"checked\"&&(\"defaultChecked\"in w)||G2(X,q,null,L,z);for(q in _=1&Q.__u,w)L=w[q],q==\"children\"?G=L:q==\"dangerouslySetInnerHTML\"?P=L:q==\"value\"?N=L:q==\"checked\"?H=L:Y&&typeof L!=\"function\"||!(R[q]!==L||_&&L!=null)||G2(X,q,L,R[q],z);P?(Y||M&&(P.__html==M.__html||P.__html==X.innerHTML)||(X.innerHTML=P.__html),$.__k=[]):(M&&(X.textContent=\"\"),(S==\"foreignObject\"||z==\"http://www.w3.org/1998/Math/MathML\"&&G3.test(S))&&(z=\"http://www.w3.org/1999/xhtml\"),y1(B,l2(G)?G:[G],$,Q,J,z,K,W,K?K[0]:Q.__k&&T0(Q,0),Y,U),K&&K.some(g0)),Y&&S!=\"textarea\"||(q=\"value\",S==\"progress\"&&N==null?X.removeAttribute(q):N==null||N===X[q]&&(S!=\"progress\"||N)||G2(X,q,N,R[q],z),q=\"checked\",H!=null&&H!=X[q]&&G2(X,q,H,R[q],z))}else R===w||Y&&X.data==w||(X.data=w);return X}function u2(X,$,Q,J){try{typeof X==\"function\"?$?$.__x=X($)||1:J&&(J=J.__c||J.__e)&&($=J.__x)&&(J.__x=null,typeof $==\"function\"?$():X(null)):X.current=$}catch(z){E.__e(z,Q)}}function d2(X,$,Q){var J,z,K,W;if(E.unmount&&E.unmount(X),!(J=X.ref)||J.current&&J.current!=X.__e||u2(J,null,$,X),J=X.__c){if(J.componentWillUnmount)try{J.componentWillUnmount()}catch(Y){E.__e(Y,$)}J.__P=J.__n=null}if(J=X.__k)for(W=0;W<J.length;W++)J[W]&&d2(J[W],$,typeof X.type!=\"function\"||Q&&!X.props.__P);!Q&&(J=X.__c)&&(J=J.__z)&&(z=m2(J,K=[]))&&(J==X.__e&&K.some(g0),g0(z),g0(J)),(J=X.__e)&&(Q||g0(J),J.__e&&(J.__e=null)),X.__e=X.__c=X.__=null}function M3(X,$,Q){return this.constructor(X,Q)}function V1(X,$){var Q,J,z,K;E.__&&E.__(X,$),$.nodeType==9&&($=$.documentElement),J=(Q=X&&32&X.__u)?null:$.__k,$.__k=F2(j,{children:[X]}),z=[],K=[],p2($,$.__k,J||M2,M2,$.namespaceURI,J?null:$.firstChild?w1.call($.childNodes):null,z,J?J.__e:$.firstChild,Q,K),h1(z,$.__k,K),$.__k.props.children=null}E={__e:function(X,$,Q,J){for(var z,K,W;$=$.__;)if((z=$.__c)&&!(1&z.__g)){z.__g|=4;try{if((W=(K=z.constructor)&&K.getDerivedStateFromError)&&z.setState(K.getDerivedStateFromError(X)),z.componentDidCatch&&(z.componentDidCatch(X,J||{}),W=1),W&&8&z.__g)return void(z.__g|=2)}catch(Y){X=Y}}throw P2=0,X}},C1=0,q3=function(X){return X!=null&&X.constructor===void 0},H2.prototype.setState=function(X,$){var Q=this.__s;Q&&Q!=this.state||(Q=this.__s=y0({},this.state)),typeof X==\"function\"&&(X=X(y0({},Q),this.props)),X&&(y0(Q,X),this.__v&&($&&this.__k.push($),b1(this)))},H2.prototype.forceUpdate=function(X){this.__v&&(this.__g|=4,X&&this.__h.push(X),b1(this))},H2.prototype.render=j,O0=[],P2=0,R1=function(X,$){return X.__v.__b-$.__v.__b},N2=Symbol(),I1=/(PointerCapture)$|Capture$/i,c2=0,x2={},U3=0;var a0,d,o2,j1,i2=Object.is,n0=0,d1=[],r2=[],u=E,D1=u.__b,E1=u.__r,x1=u.diffed,m1=u.__c,c1=u.unmount,l1=u.__;function n2(X,$){u.__h&&u.__h(d,X,n0||$),n0=0;var Q=d.__H||(d.__H={__:[],__h:[]});return X>=Q.__.length&&Q.__.push({}),Q.__[X]}function C(X){return n0=1,L3(i1,X)}function L3(X,$,Q){var J=n2(a0++,2);if(J.t=X,!J.__c&&(J.__=[Q?Q($):i1(void 0,$),function(K){var W=J.__N?J.__N[0]:J.__[0],Y=J.t(W,K);i2(W,Y)||(J.__N=[Y,J.__[1]],J.__c.setState({}))}],J.__c=d,!d.__f)){d.__f=!0;var z=d.shouldComponentUpdate;d.shouldComponentUpdate=function(K,W,Y){var U=this.__H;if(!U)return!0;var B=!1,q=this.props!=K;if(U.__.some(function(M){M.__N&&(B=!0,i2(M.__[0],M.__N[0])||(q=!0))}),z){var P=z.call(this,K,W,Y);return B?P||q:P}return!B||q}}return J.__}function l(X,$){var Q=n2(a0++,3);!u.__s&&o1(Q.__H,$)&&(Q.__P=!0,Q.__=X,Q.u=$,d.__H.__h.push(Q))}function Y0(X){return n0=5,A2(function(){return{current:X}},[])}function A2(X,$){var Q=n2(a0++,7);return o1(Q.__H,$)&&(Q.__=X(),Q.__H=$),Q.__}function s0(X,$){return n0=8,A2(function(){return X},$)}function A3(){var X;do{for(;X=r2.shift();)try{r0(X)}catch(Q){u.__e(Q,{__:(X=X.__P)&&X.__v})}for(;X=d1.shift();){var $=X.__H;if(X.__P&&$)try{$.__h.some(r0),$.__h.some(a2),$.__h=[]}catch(Q){$.__h=[],u.__e(Q,X.__v)}}}while(r2.length)}u.__b=function(X){d=null,D1&&D1(X)},u.__=function(X,$){X&&$.__k&&$.__k.__m&&(X.__m=$.__k.__m),l1&&l1(X,$)},u.__r=function(X){E1&&E1(X),a0=0;var $=(d=X.__c).__H;$&&(o2==d?d.__h=[]:($.__h.some(r0),$.__h.some(a2),a0=0),$.__h=[],$.__.some(function(Q){Q.__N&&(Q.__=Q.__N),Q.u=Q.__N=void 0})),o2=d},u.diffed=function(X){x1&&x1(X);var $=X.__c;$&&$.__H&&($.__H.__h.length&&u1(d1.push($)),$.__H.__.some(function(Q){Q.u&&(Q.__H=Q.u)})),o2=d=null},u.__c=function(X,$){$.some(function(Q){try{Q.__h.some(r0),Q.__h=Q.__h.filter(function(J){return!J.__||a2(J)})}catch(J){$.some(function(z){z.__h&&(z.__h=[])}),$=[],u.__e(J,Q.__v)}}),m1&&m1(X,$)},u.unmount=function(X){c1&&c1(X);var $,Q,J=X.__c;J&&J.__H&&(J.__H.__.some(function(z){try{if(z.__P&&z.__c){if(Q===void 0){for(Q=X.__;Q&&(!Q.__c||!Q.__c.__P);)Q=Q.__;Q=Q&&Q.__c}z.__P=Q,u1(r2.push(z))}else r0(z)}catch(K){$=K}}),J.__H=void 0,$&&u.__e($,J.__v))};var p1=typeof requestAnimationFrame==\"function\";function _3(X){var $,Q=function(){clearTimeout(J),p1&&cancelAnimationFrame($),setTimeout(X)},J=setTimeout(Q,35);p1&&($=requestAnimationFrame(Q))}function u1(X){X!=1&&j1==u.requestAnimationFrame||((j1=u.requestAnimationFrame)||_3)(A3)}function r0(X){var $=d,Q=X.__c;typeof Q==\"function\"&&(X.__c=void 0,Q()),d=$}function a2(X){var $=d;X.__c=X.__(),d=$}function o1(X,$){return!X||X.length!=$.length||$.some(function(Q,J){return!i2(Q,X[J])})}function i1(X,$){return typeof $==\"function\"?$(X):$}function s2(X){let $=X.metadata?.tubelessCache;if(!$||typeof $!==\"object\"||Array.isArray($)||!(\"implementationVersion\"in $)||typeof $.implementationVersion!==\"string\"||!(\"createdAtMs\"in $)||typeof $.createdAtMs!==\"number\"||!Number.isFinite($.createdAtMs)||!(\"ageMs\"in $)||typeof $.ageMs!==\"number\"||!Number.isFinite($.ageMs))return;return{implementationVersion:$.implementationVersion,createdAtMs:$.createdAtMs,ageMs:$.ageMs}}var O3=0;function Z(X,$,Q,J,z,K){$||($={});var W,Y,U=$;if(\"ref\"in U&&typeof X!=\"function\")for(Y in U={},$)Y==\"ref\"?W=$[Y]:U[Y]=$[Y];var B={type:X,props:U,key:Q,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--O3,__i:-1,__u:0};return(z||K)&&(B.__source=z,B.__self=K),E.vnode&&E.vnode(B),B}function _2({artifacts:X,stepId:$}){let[Q,J]=C(\"all\"),z=X.filter((W)=>s2(W.artifact)),K=z.length>0&&z.length<X.length;return Z(j,{children:[K&&Z(\"label\",{class:\"artifact-filter\",children:[\"Artifacts for \",$,\" \",Z(\"select\",{value:Q,onChange:(W)=>J(W.currentTarget.value),children:[Z(\"option\",{value:\"all\",children:\"All artifacts\"},void 0,!1,void 0,this),Z(\"option\",{value:\"cache\",children:\"Cached outputs\"},void 0,!1,void 0,this),Z(\"option\",{value:\"application\",children:\"Application artifacts\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X.map((W,Y)=>{let U=s2(W.artifact);if(K&&(Q===\"cache\"&&!U||Q===\"application\"&&U))return null;let B=U?new Date(U.createdAtMs):void 0;return Z(\"details\",{class:\"artifact-detail\",children:[Z(\"summary\",{children:[U?\"Cached output \":W.preview?\"Preview \":\"Artifact \",W.operation,!U&&`: ${W.artifact.id||W.artifact.uri}`]},void 0,!0,void 0,this),U&&Z(\"div\",{class:\"artifact-info\",children:[Z(\"div\",{children:[\"Created:\",\" \",B&&Number.isFinite(B.getTime())?B.toISOString():String(U.createdAtMs)]},void 0,!0,void 0,this),Z(\"div\",{children:[\"Age at \",W.operation,\": \",U.ageMs,\" ms\"]},void 0,!0,void 0,this),W.artifact.uri&&Z(\"div\",{children:[\"Location: \",W.artifact.uri]},void 0,!0,void 0,this),W.artifact.byteSize!==void 0&&Z(\"div\",{children:[\"Size: \",W.artifact.byteSize,\" bytes\"]},void 0,!0,void 0,this),Z(\"p\",{class:\"artifact-note\",children:\"Recorded operation; current cache availability is not checked.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U?Z(\"details\",{class:\"artifact-receipt\",children:[Z(\"summary\",{children:\"Receipt metadata\"},void 0,!1,void 0,this),Z(\"pre\",{children:JSON.stringify(W.artifact,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z(\"pre\",{children:JSON.stringify(W.artifact,null,2)},void 0,!1,void 0,this)]},Y,!0,void 0,this)})]},void 0,!0,void 0,this)}var v0=(X)=>X.length>24?X.slice(0,12)+\"…\"+X.slice(-7):X;function F0(X){return X==null?\"—\":X<1000?Math.max(0,Math.round(X))+\" ms\":X<60000?(X/1000).toFixed(X<1e4?1:0)+\" s\":Math.floor(X/60000)+\"m \"+Math.round(X%60000/1000)+\"s\"}function T3(X){return X===\"completed\"?\"✓\":X===\"skipped\"?\"×\":X===\"cancelled\"?\"■\":X===\"failed\"?\"!\":X===\"planned\"?\"…\":\"\"}function J0({value:X,outputSource:$}){return Z(\"span\",{class:`status ${X}`,children:[Z(\"i\",{class:\"status-mark\",\"aria-hidden\":\"true\",children:T3(X)},void 0,!1,void 0,this),X,$===\"override\"&&\" (overridden)\",$===\"cache\"&&\" (cached)\"]},void 0,!0,void 0,this)}function t0({children:X,label:$,secondary:Q,stepIds:J}){return Z(\"div\",{class:\"plan-nested\",children:[Z(\"strong\",{children:$},void 0,!1,void 0,this),Q&&Z(\"span\",{children:Q},void 0,!1,void 0,this),J?.map((z)=>Z(\"code\",{children:z},z,!1,void 0,this)),X]},void 0,!0,void 0,this)}function b3({value:X}){let $=X.charAt(0).toUpperCase()+X.slice(1),Q=X===\"completed\"?Z(\"svg\",{viewBox:\"0 0 12 12\",children:Z(\"path\",{d:\"m2 6 2.4 2.4L10 3\"},void 0,!1,void 0,this)},void 0,!1,void 0,this):X===\"running\"?Z(\"i\",{},void 0,!1,void 0,this):X===\"skipped\"?Z(\"svg\",{viewBox:\"0 0 12 12\",children:Z(\"path\",{d:\"m3 3 6 6M9 3 3 9\"},void 0,!1,void 0,this)},void 0,!1,void 0,this):X===\"cancelled\"?Z(\"svg\",{viewBox:\"0 0 12 12\",children:Z(\"rect\",{x:\"3\",y:\"3\",width:\"6\",height:\"6\",rx:\"1\",fill:\"currentColor\",stroke:\"none\"},void 0,!1,void 0,this)},void 0,!1,void 0,this):X===\"failed\"?\"!\":\"…\";return Z(\"span\",{class:`step-status-icon ${X}`,role:\"img\",\"aria-label\":$,title:$,children:Q},void 0,!1,void 0,this)}var k3=(X)=>X===\"failed\"||X===\"cancelled\";function C3(X,$){if(X.status!==\"skipped\"||!X.skipReason)return;let Q=(J)=>$.find((z)=>z.id===J)?.status;switch(X.skipReason){case\"failed-dependency\":{let J=X.skipAfterFailureOf?.find((z)=>k3(Q(z)));return J?`Skipped because failure gate “${J}” ${Q(J)}.`:\"Skipped because a failure gate failed or was cancelled.\"}case\"unmet-dependency\":{let J=X.dependencies?.find((z)=>{let K=$.find((W)=>W.id===z);return K&&K.status!==\"completed\"&&!(K.status===\"skipped\"&&K.skipReason===\"policy\")});return J?`Skipped because required input “${J}” was ${Q(J)}.`:\"Skipped because a required input was unavailable.\"}case\"fail-fast\":return\"Not started: the run stopped after an earlier failure.\";case\"dry-run\":return\"Skipped by its dry-run policy.\";case\"policy\":return\"Skipped by its runtime skip policy.\";case\"filtered\":return\"Not selected for this run.\"}}function O2({step:X,steps:$=[]}){let Q=X.progress?.total,J=Q?Math.max(0,Math.min(100,(X.progress?.completed??0)/Q*100)):X.status===\"completed\"?100:18,z=X.nestedPipeline,K=z?z.stepCount??z.stepIds.length:0,W=z&&z.stepIds.length<K?z.stepIds.length+\" of \"+K+\" declared steps\":K+\" declared steps\",Y=X.progress?.detailCount,U=X.attempt?.retries.length??0,B=C3(X,$);return Z(\"article\",{class:`step ${X.status}`,\"data-step-id\":X.id,children:[Z(b3,{value:X.status},void 0,!1,void 0,this),Z(\"div\",{class:\"step-head\",children:[Z(\"strong\",{children:X.name||X.id},void 0,!1,void 0,this),X.outputSource&&Z(J0,{value:X.status,outputSource:X.outputSource},void 0,!1,void 0,this),X.name&&Z(\"code\",{children:X.id},void 0,!1,void 0,this),U>0&&Z(\"span\",{class:\"step-retries\",children:[U,\" retr\",U===1?\"y\":\"ies\"]},void 0,!0,void 0,this),Z(\"span\",{class:\"step-duration\",title:X.attempt?.attemptId,children:F0(X.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.description&&Z(\"div\",{class:\"step-description\",children:X.description},void 0,!1,void 0,this),B&&Z(\"div\",{class:\"step-skip-reason\",children:B},void 0,!1,void 0,this),z&&Z(t0,{label:z.pipelineId,secondary:`${W}${z.mode===\"iterate\"?` per iteration, at most ${z.maxIterations} iterations`:z.mode===\"for-each\"?\" per runtime item\":\"\"}`,stepIds:z.stepIds},void 0,!1,void 0,this),X.remote&&Z(t0,{label:X.remote.engine,secondary:X.remote.target},void 0,!1,void 0,this),X.artifacts&&Z(_2,{artifacts:X.artifacts,stepId:X.id},void 0,!1,void 0,this),X.progress&&Z(j,{children:[Z(\"div\",{class:\"progress\",children:Z(\"i\",{class:`w${Math.round(J)}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{class:\"progress-copy\",children:X.progress.message||X.progress.completed+(Q?\" / \"+Q:\"\")+\" complete\"},void 0,!1,void 0,this),X.progress.details&&X.progress.details.length>0&&Z(\"div\",{class:\"progress-details\",children:[X.progress.details.map((q)=>Z(\"div\",{class:`progress-detail ${q.status||\"running\"}`,children:[Z(\"b\",{children:q.id},void 0,!1,void 0,this),q.label&&Z(\"span\",{children:q.label},void 0,!1,void 0,this),q.outputSource===\"override\"&&Z(\"span\",{children:\"(overridden)\"},void 0,!1,void 0,this),q.outputSource===\"cache\"&&Z(\"span\",{children:\"(cached)\"},void 0,!1,void 0,this)]},q.id,!0,void 0,this)),Y&&X.progress.details.length<Y?Z(\"div\",{class:\"progress-detail-truncated\",children:[\"Showing \",X.progress.details.length,\" of \",Y,\" items\"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var r1=2;var J5=Symbol(\"tubeless.wire-schema.type\");function n(X,$,Q={}){return{decode:$,jsonSchema:X,optionalInput:Q.optionalInput??!1,optionalOutput:Q.optionalOutput??!1}}function R3(X,$){return X.length===0?$:`${X}.${$}`}function V(){return n({type:\"boolean\"},(X,$)=>{if(typeof X!==\"boolean\")throw Error(`${$} must be a boolean`);return X})}function $0(X={}){let $={type:X.integer?\"integer\":\"number\"};if(X.minimum!==void 0)$.minimum=X.minimum;return n($,(Q,J)=>{if(typeof Q!==\"number\"||!Number.isFinite(Q))throw Error(`${J} must be a finite number`);if(X.integer&&(!Number.isSafeInteger(Q)||Q<(X.minimum??-1/0))){if(X.minimum===0)throw Error(`${J} must be a nonnegative safe integer`);throw Error(`${J} must be a safe integer`)}if(X.minimum!==void 0&&Q<X.minimum)throw Error(`${J} must be at least ${X.minimum}`);return Q})}function p(X={}){let $={type:\"string\"};if(X.allowEmpty!==!0)$.minLength=1;if(X.maxLength!==void 0)$.maxLength=X.maxLength;return n($,(Q,J)=>{if(typeof Q!==\"string\"||X.allowEmpty!==!0&&Q.length===0)throw Error(X.allowEmpty===!0?`${J} must be a string`:`${J} must be a non-empty string`);if(X.maxLength!==void 0&&Q.length>X.maxLength)throw Error(`${J} exceeds ${X.maxLength} code units`);return Q})}function D(X,$){return n({const:X,type:typeof X},(Q,J)=>{if(Q!==X)throw Error($?.(J)??`${J} must be ${String(X)}`);return X})}function f(X,$=(Q)=>`${Q} is unsupported`){let Q=new Set(X);return n({enum:X,type:\"string\"},(J,z)=>{if(typeof J!==\"string\"||!Q.has(J))throw Error($(z));return J})}function F(X){return n(X.jsonSchema,($,Q)=>$===void 0?void 0:X.decode($,Q),{optionalInput:!0,optionalOutput:!0})}function t2(X,$){return n(X.jsonSchema,(Q,J)=>Q===void 0?$:X.decode(Q,J),{optionalInput:!0})}function y(X,$={}){let Q={items:X.jsonSchema,type:\"array\"};if($.maxItems!==void 0)Q.maxItems=$.maxItems;return n(Q,(J,z)=>{if(!Array.isArray(J)||$.maxItems!==void 0&&J.length>$.maxItems){let K=$.maxItems===void 0?\"\":` of at most ${$.maxItems}${$.noun?` ${$.noun}`:\"\"}`;throw Error(`${z} must be an array${K}`)}return J.map((K,W)=>X.decode(K,`${z}[${W}]`))})}function A(X){let $=Object.entries(X).filter(([,J])=>!J.optionalOutput).map(([J])=>J),Q=Object.fromEntries(Object.entries(X).map(([J,z])=>[J,z.jsonSchema]));return n({additionalProperties:!1,properties:Q,...$.length>0?{required:$}:{},type:\"object\"},(J,z)=>{if(J===null||typeof J!==\"object\"||Array.isArray(J))throw Error(`${z} must be an object`);let K=J,W={};for(let[Y,U]of Object.entries(X)){let B=U.decode(K[Y],R3(z,Y));if(B!==void 0)W[Y]=B}return W})}function a1(X,$){return n({additionalProperties:X.jsonSchema,type:\"object\"},(Q,J)=>{if(Q===null||typeof Q!==\"object\"||Array.isArray(Q))throw Error(`${J} must be an object`);let z={};for(let[K,W]of Object.entries(Q))try{z[K]=X.decode(W,`${J}.${K}`)}catch{throw Error($?.(J)??`${J} contains an unsupported value`)}return z})}function b0(X,$){return n({oneOf:X.map((Q)=>Q.jsonSchema)},(Q,J)=>{for(let z of X)try{return z.decode(Q,J)}catch{}throw Error($?.(J)??`${J} is unsupported`)})}function i(X,$,Q=X.jsonSchema){return n(Q,(J,z)=>{let K=X.decode(J,z);return $(K,z),K},{optionalInput:X.optionalInput,optionalOutput:X.optionalOutput})}function T2(X,$){return n(X.jsonSchema,(Q,J)=>$(X.decode(Q,J)),{optionalInput:X.optionalInput,optionalOutput:X.optionalOutput})}function K0(X,$){return n(X,$)}function e2(X,$){return n({oneOf:Object.entries($).map(([Q,J])=>({allOf:[J.jsonSchema,{properties:{[X]:{const:Q,type:\"string\"}},required:[X],type:\"object\"}]}))},(Q,J)=>{if(Q===null||typeof Q!==\"object\"||Array.isArray(Q))throw Error(`${J} must be an object`);let z=Q[X];if(typeof z!==\"string\"||!(z in $))throw Error(`${X} is unsupported`);return $[z].decode(Q,J)})}var E0=16384,n1=new TextEncoder;function X1(X,$){let Q=0,J=0,z=(Y)=>{if(Y.length>E0)throw Error(`${$} exceeds ${E0} bytes`);if(J+=n1.encode(JSON.stringify(Y)).byteLength,J>E0)throw Error(`${$} exceeds ${E0} bytes`)},K=(Y,U)=>{if(++Q>256||U>8)throw Error(`${$} exceeds metadata complexity limits`);if(Y===null||typeof Y===\"boolean\")return Y;if(typeof Y===\"number\"&&Number.isFinite(Y))return Y;if(typeof Y===\"string\")return z(Y),Y;if(typeof Y!==\"object\"||Y===null)throw Error(`${$} must be JSON-safe`);let B=Array.isArray(Y),q=Object.getPrototypeOf(Y);if(!B&&q!==Object.prototype&&q!==null)throw Error(`${$} must contain only plain JSON objects`);let P=Reflect.ownKeys(Y);if(P.length>256)throw Error(`${$} exceeds metadata complexity limits`);let M=[];for(let G of P){if(B&&G===\"length\")continue;if(typeof G!==\"string\")throw Error(`${$} must be JSON-safe`);let L=Object.getOwnPropertyDescriptor(Y,G);if(!(\"value\"in L)||!L.enumerable)throw Error(`${$} must contain only enumerable data properties`);z(G),M.push([G,K(L.value,U+1)])}if(B){if(M.length!==Y.length||M.some(([G],L)=>G!==String(L)))throw Error(`${$} must contain only dense JSON arrays`);return M.map(([,G])=>G)}return Object.fromEntries(M)},W=K(X,0);if(n1.encode(JSON.stringify(W)).byteLength>E0)throw Error(`${$} exceeds ${E0} bytes`);return W}var x0=p({maxLength:4096}),s1=A({id:F(x0),uri:F(x0),mediaType:F(x0),checksum:F(x0),version:F(x0),byteSize:F($0({integer:!0,minimum:0})),schemaVersion:F(x0),metadata:F(K0({type:\"object\",additionalProperties:!0},(X,$)=>{if(!X||typeof X!==\"object\"||Array.isArray(X))throw Error(`${$} must be an object`);return X}))}),e0=K0({...s1.jsonSchema,anyOf:[{required:[\"id\"]},{required:[\"uri\"]}]},(X,$)=>{let Q=X1(X,$),J=s1.decode(Q,$);if(!J.id&&!J.uri)throw Error(`${$} requires id or uri`);let z=[\"id\",\"uri\",\"mediaType\",\"checksum\",\"version\",\"byteSize\",\"schemaVersion\",\"metadata\"];if(Object.keys(Q).some((K)=>!z.includes(K)))throw Error(`${$} has unknown fields; use metadata for application fields`);return J.id?{...J,id:J.id}:{...J,uri:J.uri}}),X2=f([\"read\",\"write\",\"reuse\"]),Y5=A({operation:X2,artifact:e0});function t1(X){if(X!==null&&typeof X===\"object\"){for(let $ of Object.values(X))t1($);Object.freeze(X)}return X}var $2=K0({type:\"object\",additionalProperties:!1,properties:{tags:{type:\"array\",maxItems:64,items:{type:\"string\",minLength:1,maxLength:256}},owner:{type:\"string\",minLength:1,maxLength:256},domain:{type:\"string\",minLength:1,maxLength:256},annotations:{type:\"object\",additionalProperties:!0}}},(X,$)=>{let Q=X1(X,$);if(!Q||typeof Q!==\"object\"||Array.isArray(Q))throw TypeError(`${$} must be an object`);let J=(z)=>typeof z===\"string\"&&z.trim().length>0&&z.length<=256;for(let[z,K]of Object.entries(Q))if(z===\"tags\"){if(!Array.isArray(K)||K.length>64||!K.every(J))throw TypeError(`${$}.tags must contain at most 64 nonblank strings of at most 256 characters`)}else if(z===\"owner\"||z===\"domain\"){if(!J(K))throw TypeError(`${$}.${z} must be a nonblank string of at most 256 characters`)}else if(z===\"annotations\"){if(!K||typeof K!==\"object\"||Array.isArray(K))throw TypeError(`${$}.annotations must be an object`)}else throw TypeError(`${$}.${z} is unknown; use annotations for application fields`);return t1(Q)});var e1=3,M0=128,k0=4096,$1=262144;var I3=[\"TUBELESS_CHILD_FAILED\",\"TUBELESS_DEFINITION_CACHE_INVALID\",\"TUBELESS_DEFINITION_DEPENDENCY_CONTRADICTORY\",\"TUBELESS_DEFINITION_DEPENDENCY_CYCLE\",\"TUBELESS_DEFINITION_DEPENDENCY_DUPLICATE\",\"TUBELESS_DEFINITION_DEPENDENCY_NOT_IN_STEPS\",\"TUBELESS_DEFINITION_DEPENDENCY_SELF_REFERENCE\",\"TUBELESS_DEFINITION_FINALIZER_STEP_NOT_IN_STEPS\",\"TUBELESS_DEFINITION_IMPLEMENTATION_VERSION_INVALID\",\"TUBELESS_DEFINITION_OPTIONS_SCHEMA_CONFLICT\",\"TUBELESS_DEFINITION_PIPELINE_DESCRIPTION_BLANK\",\"TUBELESS_DEFINITION_PIPELINE_ID_BLANK\",\"TUBELESS_DEFINITION_PIPELINE_NAME_BLANK\",\"TUBELESS_DEFINITION_STEP_CACHE_INVALID\",\"TUBELESS_DEFINITION_STEP_ID_BLANK\",\"TUBELESS_DEFINITION_STEP_ID_RESERVED\",\"TUBELESS_DEFINITION_STEP_IDS_DUPLICATE\",\"TUBELESS_DEFINITION_STEP_NAME_BLANK\",\"TUBELESS_DEFINITION_TARGET_FINALIZER_MISMATCH\",\"TUBELESS_DEFINITION_TARGET_NOT_IN_STEPS\",\"TUBELESS_DEFINITION_TARGETS_DUPLICATE\",\"TUBELESS_FINALIZATION_CANCELLED\",\"TUBELESS_FINALIZATION_FAILED\",\"TUBELESS_FINAL_RESULT_VALIDATION_FAILED\",\"TUBELESS_OPTIONS_VALIDATION_FAILED\",\"TUBELESS_PLANNING_SELECTION_CONFLICT\",\"TUBELESS_PLANNING_STEP_SELECTION_DUPLICATE\",\"TUBELESS_PLANNING_STEP_SELECTION_EMPTY\",\"TUBELESS_PLANNING_STEP_UNKNOWN\",\"TUBELESS_PLANNING_TARGET_SELECTION_DUPLICATE\",\"TUBELESS_PLANNING_TARGET_SELECTION_EMPTY\",\"TUBELESS_PLANNING_TARGET_UNDECLARED\",\"TUBELESS_PLANNING_TARGET_UNKNOWN\",\"TUBELESS_RUN_CANCELLED\",\"TUBELESS_RUN_CONCURRENCY_INVALID\",\"TUBELESS_RUN_CACHE_INVALID\",\"TUBELESS_STEP_OUTPUT_VALIDATION_FAILED\",\"TUBELESS_STEP_FAILED\"],w3=[\"cancellation\",\"child\",\"definition\",\"finalization\",\"selection\",\"step\",\"validation\"],S3=[\"definition\",\"execution\",\"finalization\",\"planning\"],g3=[\"cancelled\",\"completed\",\"failed\"],K1=[\"dry-run\",\"failed-dependency\",\"fail-fast\",\"filtered\",\"policy\",\"unmet-dependency\"],y3=[\"cancelled\",\"completed\",\"failed\",\"pending\",\"running\",\"skipped\"],r=p({allowEmpty:!0}),s=p(),z1=p({allowEmpty:!0,maxLength:k0}),H0=$0({integer:!0,minimum:0}),t=$0(),b2=y(s),v3=y(s,{maxItems:M0,noun:\"strings\"});function W1(X,$,Q,J){if(X===null||typeof X!==\"object\"||Array.isArray(X))throw Error(`${$} must be an object`);if(!J&&Q>=16||J&&Q>8)throw Error(J?\"error.fanOut cause exceeds its depth limit\":\"error.cause exceeds 16 levels\");let z=X,K=(B)=>{let q=z[B];if(q===void 0)return;if(typeof q!==\"string\")throw Error(`${$}.${B} must be a string`);return q},W={message:K(\"message\")??\"\"},Y=K(\"name\"),U=K(\"sourceCode\");if(Y!==void 0)W.name=Y;if(U!==void 0)W.sourceCode=U;if(J&&[W.message,W.name,W.sourceCode].some((B)=>B!==void 0&&B.length>1024))throw Error(\"error.fanOut cause strings exceed 1024 code units\");if(z.cause!==void 0)W.cause=W1(z.cause,$,Q+1,J);return W}var Z4={additionalProperties:!1,properties:{cause:{$ref:\"#/components/schemas/PipelineErrorCause\"},message:{type:\"string\"},name:{type:\"string\"},sourceCode:{type:\"string\"}},required:[\"message\"],type:\"object\"},f3=K0(Z4,(X,$)=>W1(X,$,0,!1)),Q4=K0({$ref:\"#/components/schemas/PipelineErrorCause\"},(X,$)=>W1(X,$,0,!0)),h3=K0({items:{oneOf:[{type:\"number\"},{type:\"string\",maxLength:k0}]},maxItems:M0,type:\"array\"},(X,$)=>{if(!Array.isArray(X)||X.length>M0||!X.every((Q)=>typeof Q===\"string\"||typeof Q===\"number\"&&Number.isFinite(Q)))throw Error(`${$} must contain strings or finite numbers`);if(X.some((Q)=>typeof Q===\"string\"&&Q.length>k0))throw Error(`${$} string exceeds ${k0} code units`);return X}),J1=A({message:p({maxLength:k0}),path:F(h3)}),V3=K0({items:J1.jsonSchema,maxItems:M0,type:\"array\"},(X,$)=>{if(!Array.isArray(X))throw Error(`${$} must be an array`);if(X.length>M0)throw Error(`${$} must contain at most ${M0} entries`);return X.map((Q,J)=>J1.decode(Q,`${$}[${J}]`))}),z4=A({cancelled:V(),error:Q4,index:H0,key:p({allowEmpty:!0,maxLength:1024}),keyTruncated:V()}),J4=i(A({failureCount:H0,failures:y(z4,{maxItems:32,noun:\"entries\"}),omittedFailureCount:H0,schedulerError:F(Q4)}),(X)=>{if(X.failureCount-X.failures.length!==X.omittedFailureCount)throw Error(\"error.fanOut counts do not match failures\");let $=-1;for(let Q of X.failures){if(Q.index<=$)throw Error(\"error.fanOut indices must be in input order\");$=Q.index}}),f0=A({cause:F(i(f3,()=>{return},{$ref:\"#/components/schemas/PipelineErrorCause\"})),code:f(I3),fanOut:F(i(J4,()=>{return},{$ref:\"#/components/schemas/PipelineFanOutDiagnostics\"})),issues:F(V3),kind:f(w3),message:t2(r,\"\"),phase:f(S3),sourceCode:F(r),stack:F(r)}),k2=i(f0,()=>{return},{$ref:\"#/components/schemas/PipelineError\"}),K4=A({outputSource:F(f([\"override\",\"cache\"])),completed:F(t),depth:F(t),id:p({maxLength:k0}),label:F(z1),name:F(z1),status:F(f(y3)),total:F(t)}),j3=i(y(K4,{maxItems:M0,noun:\"details\"}),(X,$)=>{if(new TextEncoder().encode(JSON.stringify(X)).byteLength>$1)throw Error(`${$} exceeds the ${$1}-byte limit`)}),Y1=T2(i(A({completed:t,detailCount:F(H0),details:F(j3),message:F(r),total:F(t)}),(X)=>{if(X.details!==void 0&&X.detailCount!==void 0&&X.detailCount<X.details.length)throw Error(\"payload.progress.detailCount must be at least the retained details length\")}),(X)=>X.details!==void 0&&X.detailCount===void 0?{...X,detailCount:X.details.length}:X),m0=$0({integer:!0,minimum:1}),W4=[\"for-each\",\"single\",\"iterate\"],R2=i(A({mode:f(W4),maxIterations:F(m0),pipelineId:s,stepCount:H0,stepIds:v3}),(X,$)=>{if(X.mode===\"iterate\"!==(X.maxIterations!==void 0))throw Error(`${$}: only iterate requires maxIterations`);if(X.stepCount<X.stepIds.length)throw Error(`${$}.stepCount must be at least the retained stepIds length`)}),h0=A({engine:p({maxLength:k0}),target:F(z1)}),L0=i(A({version:b0([D(1),D(2),D(3)]),definitionId:p({maxLength:80}),structuralFingerprint:p({maxLength:80}),implementationVersion:F(p({maxLength:256}))}),(X,$)=>{if(![X.definitionId,X.structuralFingerprint].every((Q)=>/^sha256:[a-f0-9]{64}$/.test(Q)))throw Error(`${$} must contain SHA-256 fingerprints`);if(X.implementationVersion!==void 0&&X.implementationVersion.trim().length===0)throw Error(`${$}.implementationVersion must not be blank`)}),Q2=p({maxLength:4096}),R0=y(Q2,{maxItems:4096}),X4=i(p({maxLength:80}),(X,$)=>{if(!/^sha256:[a-f0-9]{64}$/.test(X))throw Error(`${$} must be a SHA-256 fingerprint`)}),B1=A({maxTurns:m0,maxCalls:H0,maxDecisions:m0,maxDepth:F(H0),maxConcurrency:m0}),q1=A({limits:B1,resultSchemaFingerprint:X4,capabilities:y(A({name:Q2,description:Q2,inputSchemaFingerprint:X4,identity:L0}),{maxItems:4096})}),U1=A({cache:F(f([\"use\",\"recompute\",\"bypass\"])),dryRun:F(V()),continueOnError:F(V()),maxConcurrency:F(t),targets:F(R0),stepIds:F(R0)}),D3=A({metadata:F($2),agent:F(q1),id:Q2,dependencies:R0,optionalDependencies:R0,skipAfterFailureOf:R0,dryRun:f([\"custom\",\"run\",\"skip\"]),runtimeSkipPossible:V(),outputValidated:V(),cache:F(A({version:p({maxLength:256}),maxAgeMs:F(t),policy:f([\"use\",\"recompute\",\"bypass\",\"dynamic\"])})),nestedPipeline:F(A({pipelineId:Q2,mode:f(W4),maxIterations:F(m0),controls:F(U1),identity:F(L0),stepIds:R0,concurrency:F(b0([t,D(\"dynamic\")]))})),remote:F(h0)}),z2=i(A({identity:L0,metadata:F($2),steps:y(D3,{maxItems:4096}),targetIds:R0,requiredFinalizerStepIds:F(R0),optionsValidated:V(),resultValidated:V()}),(X,$)=>{if(X.identity.version!==3&&(X.metadata!==void 0||X.steps.some((Q)=>Q.metadata!==void 0||Q.nestedPipeline?.identity?.version===3)))throw Error(`${$}: metadata requires identity version 3`);for(let Q of X.steps){if(Q.agent&&X.identity.version===1)throw Error(`${$}: agent requires identity version 2`);let J=Q.nestedPipeline;if(!J)continue;if(J.mode===\"iterate\"!==(J.maxIterations!==void 0)||J.controls!==void 0&&J.mode!==\"iterate\")throw Error(`${$}: invalid iteration metadata`);if(X.identity.version===1&&(J.mode===\"iterate\"||J.identity?.version===2))throw Error(`${$}: iteration requires identity version 2`)}if(new TextEncoder().encode(JSON.stringify(X)).byteLength>262144)throw Error(`${$} exceeds the 262144-byte definition limit`)}),C2=A({kind:f([\"all\",\"exact\",\"not-selected\",\"outside-target-closure\"])}),E3=A({kind:D(\"target\"),targetId:s}),Z1=A({dependentId:s,kind:f([\"failure-gate\",\"optional-only\",\"required-dependency\"]),targetId:s}),x3=e2(\"kind\",{all:C2,exact:C2,\"failure-gate\":Z1,\"not-selected\":C2,\"optional-only\":Z1,\"outside-target-closure\":C2,\"required-dependency\":Z1,target:E3}),G1=y(x3,{maxItems:M0,noun:\"reasons\"}),m3=a1(b0([V(),t,r]),(X)=>`${X} values must be booleans, finite numbers, or strings`),Z0={correlationId:F(r),itemKey:F(r),parentRunId:F(r),pipelineId:s,runId:s,timestampMs:t,version:b0([D(2),D(e1)]),iteration:F(A({runId:s,stepId:s,attemptId:s,index:m0}))},Z2={attemptId:F(r),durationMs:F(t)},C0={stepId:s},Q1=A({}),Y4={\"step.artifact\":A({...Z0,...C0,attemptId:s,name:D(\"step.artifact\"),payload:A({operation:X2,preview:V(),artifact:e0})}),\"pipeline.completed\":A({...Z0,durationMs:F(t),error:F(k2),name:D(\"pipeline.completed\"),payload:A({dryRun:V(),errorCount:H0,finalized:V(),status:f(g3,(X)=>`${X} must be cancelled, completed, or failed`),stepCount:H0})}),\"pipeline.finalize.completed\":A({...Z0,durationMs:t,name:D(\"pipeline.finalize.completed\"),payload:Q1}),\"pipeline.finalize.failed\":A({...Z0,durationMs:t,error:k2,name:D(\"pipeline.finalize.failed\"),payload:Q1}),\"pipeline.finalize.started\":A({...Z0,name:D(\"pipeline.finalize.started\"),payload:Q1}),\"pipeline.log\":A({...Z0,attemptId:F(r),name:D(\"pipeline.log\"),payload:A({level:f([\"error\",\"log\",\"warn\"],(X)=>`${X} must be error, log, or warn`),message:t2(r,\"\")}),stepId:F(r)}),\"pipeline.started\":A({...Z0,name:D(\"pipeline.started\"),payload:i(A({definitionIdentity:F(L0),definitionSnapshot:F(z2),dryRun:V(),planOk:V(),parentStepId:F(s),stepCount:H0,targetIds:b2}),(X)=>{if(X.definitionSnapshot&&JSON.stringify(X.definitionSnapshot.identity)!==JSON.stringify(X.definitionIdentity))throw Error(\"Definition snapshot must match the run definition identity\")})}),\"step.attempted\":A({...Z0,...Z2,...C0,name:D(\"step.attempted\"),payload:A({attempt:t,attributes:m3})}),\"step.cancelled\":A({...Z0,...Z2,...C0,error:k2,name:D(\"step.cancelled\"),payload:A({status:D(\"cancelled\"),outputSource:F(f([\"override\",\"cache\"]))})}),\"step.complete\":A({...Z0,...Z2,...C0,name:D(\"step.complete\"),payload:A({status:D(\"completed\"),outputSource:F(f([\"override\",\"cache\"]))})}),\"step.failed\":A({...Z0,...Z2,...C0,error:k2,name:D(\"step.failed\"),payload:A({status:D(\"failed\"),outputSource:F(f([\"override\",\"cache\"]))})}),\"step.planned\":A({...Z0,...C0,name:D(\"step.planned\"),payload:A({dependencies:b2,description:F(r),dryRun:f([\"custom\",\"run\",\"skip\"],(X)=>`${X} must be custom, run, or skip`),name:F(r),nestedPipeline:F(R2),optionalDependencies:b2,remote:F(h0),runtimeSkipPossible:V(),selected:V(),selectionReasons:G1,skipAfterFailureOf:b2})}),\"step.running\":A({...Z0,...C0,attemptId:s,name:D(\"step.running\"),payload:A({progress:F(Y1),outputSource:F(f([\"override\",\"cache\"]))})}),\"step.skipped\":A({...Z0,...Z2,...C0,name:D(\"step.skipped\"),payload:A({dependencyId:F(r),message:F(r),reason:f(K1),status:D(\"skipped\"),outputSource:F(f([\"override\",\"cache\"]))})})},B4={if:{properties:{version:{const:2}},required:[\"version\"]},then:{properties:{iteration:!1,payload:{properties:{definitionIdentity:{properties:{version:{const:1}}},nestedPipeline:{properties:{mode:{enum:[\"single\",\"for-each\"]},maxIterations:!1}}}}}}},$4=e2(\"name\",Y4),L5=i($4,(X)=>{if(X.iteration!==void 0&&X.iteration.runId!==X.parentRunId)throw Error(\"iteration.runId must match parentRunId\");if(X.name===\"pipeline.started\"&&X.payload.parentStepId!==void 0&&X.parentRunId===void 0)throw Error(\"payload.parentStepId requires parentRunId\");if(X.version!==2)return;if(X.iteration!==void 0||X.name===\"step.planned\"&&X.payload.nestedPipeline?.mode===\"iterate\")throw Error(\"Iteration metadata requires trace version 3\");if(X.name===\"pipeline.started\"&&X.payload.definitionIdentity!==void 0&&X.payload.definitionIdentity.version!==1)throw Error(\"Trace version 2 requires identity version 1\")},{...$4.jsonSchema,...B4}),A5={PipelineError:f0.jsonSchema,PipelineErrorCause:Z4,PipelineFanOutDiagnostics:J4.jsonSchema,PipelineFanOutFailure:z4.jsonSchema,PipelineProgressDetail:K4.jsonSchema,PipelineValidationIssue:J1.jsonSchema,StoredPipelineEvent:{oneOf:Object.values(Y4).map((X)=>{let $=X.jsonSchema;return{...$,...B4,properties:{...$.properties,id:{minimum:0,type:\"integer\"}},required:[...$.required,\"id\"]}})}};var a=p({allowEmpty:!0}),x=p(),e=$0(),Q0=$0({integer:!0,minimum:0}),J2=$0({integer:!0,minimum:1}),G4=f([\"running\",\"completed\",\"failed\",\"cancelled\"]),c3=f([\"planned\",\"running\",\"completed\",\"failed\",\"cancelled\",\"skipped\"]),q4=F(f([\"override\",\"cache\"])),U4=A({agentRunId:x,turn:J2,callId:x,tool:x,parentAttemptId:x}),N4=A({version:D(r1),agent:F(A({stepId:x,limits:B1,capabilities:y(x)})),agentTurn:F(A({agentRunId:x,index:J2,decision:F(f([\"continue\",\"finish\"])),stateVersion:F(Q0),nextStateVersion:F(Q0),callCount:F(Q0),callsAdmitted:F(Q0),calls:y(U4)})),agentCall:F(U4),itemKey:F(a),iteration:F(A({runId:x,stepId:x,attemptId:x,index:J2})),definitionIdentity:F(L0),correlationId:F(a),parentRunId:F(a),parentStepId:F(x),dryRun:V(),durationMs:F(e),error:F(f0),eventCount:Q0,finishedAtMs:F(e),logCount:Q0,logs:y(A({attemptId:F(a),id:Q0,level:f([\"error\",\"log\",\"warn\"]),message:a,stepId:F(a),timestampMs:e})),pipelineId:x,runId:x,startedAtMs:e,status:G4,steps:y(A({id:x,status:c3,outputSource:q4,dependencies:F(y(x)),description:F(a),name:F(a),durationMs:F(e),finishedAtMs:F(e),startedAtMs:F(e),nestedPipeline:F(R2),optionalDependencies:F(y(x)),remote:F(h0),skipAfterFailureOf:F(y(x)),skipReason:F(f(K1)),progress:F(Y1),attempt:F(A({attemptId:x,outputSource:q4,durationMs:F(e),finishedAtMs:F(e),retries:y(J2),startedAtMs:e,status:f([\"running\",\"completed\",\"failed\",\"cancelled\",\"skipped\"])})),artifacts:F(y(A({artifact:e0,operation:X2,preview:V(),attemptId:x,timestampMs:e})))}))}),F4={identity:F(L0),activeRuns:Q0,firstSeenAtMs:e,lastSeenAtMs:e,pipelineId:x,runCount:Q0},H4=A(F4),P4=A({...F4,snapshot:F(z2),targetIds:y(x),steps:y(A({dependencies:y(x),description:F(a),dryRun:a,id:x,name:F(a),nestedPipeline:F(R2),remote:F(h0),optionalDependencies:y(x),runtimeSkipPossible:V(),skipAfterFailureOf:y(x)}))}),V0=A({runId:x,pipelineId:x,correlationId:F(a),parentRunId:F(a),startedAtMs:e,status:G4,dryRun:V(),durationMs:F(e),eventCount:Q0,subtreeEventCount:Q0,stepCount:Q0,rootRunId:x,descendantCount:Q0,subtreeIsRunning:V(),activity:A({count:Q0,names:y(a,{maxItems:3}),message:F(a)}),origin:F(A({stepId:F(x),itemKey:F(a),iteration:F(J2)}))});var W0=50,M4=16,P0=p({allowEmpty:!0}),B0=p(),K2=$0(),o=$0({integer:!0,minimum:0}),l3=T2(U1,(X)=>{let{targets:$,stepIds:Q,...J}=X;if($!==void 0&&Q!==void 0)throw Error(\"Child selectors are mutually exclusive.\");return $!==void 0?{...J,targets:$}:{...J,stepIds:Q}}),N1=y(B0),p3=i(A({choices:F(y(P0)),default:F(b0([P0,K2,V()])),description:F(P0),environment:F(P0),exclusive:F(D(!0)),flag:B0,group:F(D(\"execution\")),integer:F(V()),key:B0,max:F(K2),min:F(K2),multiple:V(),mustExist:F(V()),pathKind:F(f([\"directory\",\"file\"])),positional:V(),required:V(),short:F(P0),type:f([\"boolean\",\"number\",\"path\",\"string\"])}),(X,$)=>{let Q=X.type===\"boolean\"?\"boolean\":X.type===\"number\"?\"number\":\"string\";if(X.default!==void 0&&typeof X.default!==Q)throw Error(`${$}.default must be a ${Q}`)}),L4=A({commands:y(A({canPlan:V(),id:B0,name:B0,description:F(P0),parameters:y(p3)}))}),A4=A({definition:F(z2),dryRun:V(),ok:V(),pipelineId:B0,errors:y(K0(f0.jsonSchema,(X,$)=>({...f0.decode(X,$),...A({message:P0,stepId:F(P0)}).decode(X,$)}))),steps:y(A({metadata:F($2),agent:F(q1),dependencies:N1,description:F(P0),dryRun:f([\"custom\",\"run\",\"skip\"]),id:B0,name:F(P0),optionalDependencies:N1,runtimeSkipPossible:V(),selected:V(),selectionReasons:G1,skipAfterFailureOf:N1,skipReason:F(f([\"dry-run\",\"failed-dependency\",\"fail-fast\",\"filtered\",\"policy\",\"unmet-dependency\"])),remote:F(h0),nestedPipeline:F(i(A({mode:f([\"single\",\"for-each\",\"iterate\"]),maxIterations:F($0({integer:!0,minimum:1})),controls:F(l3),identity:F(L0),concurrency:F(b0([K2,D(\"dynamic\")])),pipelineId:B0,stepIds:y(B0)}),(X,$)=>{if(X.mode===\"iterate\"!==(X.maxIterations!==void 0))throw Error(`${$}: only iterate requires maxIterations`)}))}))}),_4=A({activeRunCount:o,completedRunCount:o,failedRunCount:o,generatedAtMs:K2,lastEventId:o,revision:o,runCount:o,eventCount:o,rootRunCount:o,matchingRootCount:o,offset:o,definitions:y(H4),liveRunIds:y(B0),runs:y(V0,{maxItems:W0}),selectedRun:F(V0)}),u3=A({stepId:F(B0),count:o}),O4=A({run:N4,ancestors:y(V0),children:y(V0),childCount:o,childSteps:y(u3),descendantCount:o}),T4=A({children:y(V0),page:o,childCount:o}),b4=A({definition:P4}),k4=A({runs:y(V0,{maxItems:W0}),offset:o,runCount:o});function I0(X,$){try{return X.decode($,\"Studio response\")}catch{return}}class l0 extends Error{status;constructor(X,$){super($);this.status=X}}function c0(X){return typeof X===\"object\"&&X!==null&&!Array.isArray(X)}function d3(X){return typeof X===\"number\"&&Number.isFinite(X)}function o3(X){return I0(_4,X)}function i3(X){return I0(L4,X)?.commands}function q0(X,$,Q){if(!c0(X))return new l0(Q,$);if(Array.isArray(X.errors)&&X.errors.every((J)=>typeof J===\"string\"))return new l0(Q,X.errors.join(`\n`));return new l0(Q,typeof X.message===\"string\"?X.message:$)}function U0(X){return Error(`Studio API returned an invalid response for ${X}.`)}function C4(X=fetch,$=\"\"){let Q=new Set,J,z,K=()=>{if(J)throw new l0(J,J===401?\"Sign in to continue.\":\"Access denied.\")},W=async(U,B)=>{K();let q=await X($+String(U),B);if(!J&&(q.status===401||q.status===403)){J=q.status;for(let P of Q)P(J)}return K(),q},Y=async(U)=>{let B;try{B=await U.json()}catch{throw K(),new l0(U.status,\"Studio API returned invalid JSON.\")}return K(),B};return{subscribeAccessDenied(U){if(Q.add(U),J)U(J);return()=>{Q.delete(U)}},async loadSnapshot({query:U=\"\",offset:B=0,selectedRunId:q}={}){let P=new URLSearchParams;if(U)P.set(\"query\",U);if(B)P.set(\"offset\",String(B));if(q)P.set(\"run\",q);let M=\"/api/snapshot\"+(P.size?\"?\"+P:\"\"),G=z?.key===M?z:void 0,L=await W(M,{cache:\"no-store\",headers:G?.etag?{\"if-none-match\":G.etag}:void 0});if(L.status===304&&G)return G.snapshot;let N=await Y(L);if(!L.ok)throw q0(N,\"Snapshot request failed.\",L.status);let H=o3(N);if(!H)throw U0(\"snapshot\");return z={key:M,etag:L.headers.get(\"etag\"),snapshot:H},H},async loadDefinition(U,B){let q=new URLSearchParams({pipelineId:U});if(B)q.set(\"definitionId\",B);let P=await W(\"/api/definitions?\"+q,{cache:\"no-store\"}),M=await Y(P);if(!P.ok)throw q0(M,\"Definition request failed.\",P.status);let G=I0(b4,M);if(!G)throw U0(\"definition\");return G.definition},async loadDefinitionRuns(U,B,q=0){let P=new URLSearchParams({pipelineId:U,offset:String(q)});if(B)P.set(\"definitionId\",B);let M=await W(\"/api/definitions/runs?\"+P,{cache:\"no-store\"}),G=await Y(M);if(!M.ok)throw q0(G,\"Definition runs request failed.\",M.status);let L=I0(k4,G);if(!L)throw U0(\"definition runs\");return L},async loadRunDetail(U){let B=await W(\"/api/runs/\"+encodeURIComponent(U),{cache:\"no-store\"}),q=await Y(B);if(B.status===404)return null;if(!B.ok)throw q0(q,\"Run detail request failed.\",B.status);let P=I0(O4,q);if(!P)throw U0(\"run detail\");return P},async loadChildRuns(U,B){let q=await W(\"/api/runs/\"+encodeURIComponent(U)+\"/children?page=\"+B,{cache:\"no-store\"}),P=await Y(q);if(q.status===404)return null;if(!q.ok)throw q0(P,\"Child runs request failed.\",q.status);let M=I0(T4,P);if(!M)throw U0(\"child runs\");return M},async loadCommands(){let U=await W(\"/api/commands\",{cache:\"no-store\"}),B=await Y(U);if(!U.ok)throw q0(B,\"Commands request failed.\",U.status);let q=i3(B);if(!q)throw U0(\"commands\");return q},async loadCapabilities(){let U=await W(\"/api/capabilities\",{cache:\"no-store\"}),B=await Y(U);if(!U.ok||!c0(B)||typeof B.canCancel!==\"boolean\"||typeof B.canClearHistory!==\"boolean\"){if(!U.ok)throw q0(B,\"Capabilities request failed.\",U.status);throw U0(\"capabilities\")}return{canCancel:B.canCancel,canClearHistory:B.canClearHistory}},async clearHistory(){let U=await W(\"/api/history\",{method:\"DELETE\",headers:{\"x-tubeless-studio-clear-history\":\"1\"}}),B=await Y(U);if(!U.ok)throw q0(B,\"History could not be cleared.\",U.status);if(!c0(B)||B.cleared!==!0||!d3(B.eventCount))throw U0(\"clear history\");return z=void 0,{eventCount:B.eventCount}},async previewPlan(U,B){let q=await W(\"/api/commands/\"+encodeURIComponent(U)+\"/plan\",{method:\"POST\",headers:{\"content-type\":\"application/json\",\"x-tubeless-studio-plan\":\"1\"},body:JSON.stringify(B)}),P=await Y(q);if(!q.ok)throw q0(P,\"Plan request failed.\",q.status);let M=c0(P)?I0(A4,P.plan):void 0;if(!M)throw U0(\"plan\");return M},async cancelRun(U){let B=await W(\"/api/runs/\"+encodeURIComponent(U)+\"/cancel\",{method:\"POST\",headers:{\"x-tubeless-studio-cancel\":\"1\"}}),q=await Y(B);if(!B.ok)throw q0(q,\"Run could not be cancelled.\",B.status);if(!c0(q)||q.cancelled!==!0||q.runId!==U)throw U0(\"cancel run\")},async launch(U,B){let q=await W(\"/api/commands/\"+encodeURIComponent(U)+\"/runs\",{method:\"POST\",headers:{\"content-type\":\"application/json\",\"x-tubeless-studio-launch\":\"1\"},body:JSON.stringify({values:B})}),P=await Y(q);if(!q.ok)throw q0(P,\"Launch failed.\",q.status);if(!c0(P)||P.accepted!==!0||typeof P.runId!==\"string\"||P.runId.length===0)throw U0(\"launch\");return P.runId}}}var I4=1200;function R4(X){return[X.runId,X.eventCount,X.subtreeEventCount,X.rootRunId,X.status].join(\":\")}function r3(X){return{...X,activeRunCount:0,completedRunCount:0,definitions:[],failedRunCount:0,runCount:0,eventCount:0,rootRunCount:0,matchingRootCount:0,offset:0,selectedRun:void 0,lastEventId:0,liveRunIds:[],runs:[]}}class F1{#F;#M;#L;#G=new Set;#Y=null;#Q;#J=null;#W=0;#$=!1;#Z;#H=!1;#K=0;#P=!1;#N=!1;#X;constructor(X,{runId:$=null,detailRetryMs:Q=1200}={}){this.#F=X,this.#L=Q,this.#X={connected:!0,historyQuery:{query:\"\",offset:0},selection:$?{status:\"loading\",runId:$}:{status:\"none\"},manualRefreshing:!1,snapshot:null},this.#M=X.subscribeAccessDenied?.((J)=>{if(this.#K+=1,this.#q(),this.#Z)clearTimeout(this.#Z);this.#Z=void 0,this.#N=!1,this.#z({accessDenied:J,connected:!1,snapshot:null,selection:{status:\"none\"},manualRefreshing:!1})})}getState(){return this.#X}subscribe(X){return this.#G.add(X),()=>this.#G.delete(X)}setHistoryQuery({query:X=\"\",offset:$=0}){if(this.#$||this.#X.accessDenied)return;if(this.#X.historyQuery.query===X&&this.#X.historyQuery.offset===$)return;this.#K+=1,this.#z({historyQuery:{query:X,offset:$}}),this.refresh(!0)}selectRun(X){if(this.#$||this.#X.accessDenied||X===this.#U())return;let $=X?this.#T(X):void 0,Q=$&&this.#X.snapshot?.runs.some((J)=>J.runId===$.rootRunId);if(this.#q(),this.#K+=1,this.#z({historyQuery:Q?this.#X.historyQuery:{query:\"\",offset:0},selection:X?{status:\"loading\",runId:X,summary:$}:{status:\"none\"}}),$)this.#J=R4($),this.#B(this.#W);this.refresh(!0)}refresh(X=!1){if(this.#$||this.#X.accessDenied)return;if(X)this.#H=!0,this.#z({manualRefreshing:!0});if(this.#P){if(X)this.#N=!0;return}this.#A()}invalidate({delayMs:X=0,resetHistory:$=!1}={}){if(this.#$||this.#X.accessDenied)return;this.#K+=1;let Q=this.#U();if($)this.#q(),this.#z({historyQuery:{query:\"\",offset:0},selection:Q?{status:\"unavailable\",runId:Q}:{status:\"none\"},snapshot:this.#X.snapshot?r3(this.#X.snapshot):null});else this.#k(X);if(this.#Z)clearTimeout(this.#Z);if(this.#Z=void 0,X>0){this.#Z=setTimeout(()=>{this.#Z=void 0,this.refresh(!0)},X);return}this.refresh(!0)}dispose(){if(this.#$)return;if(this.#M?.(),this.#$=!0,this.#K+=1,this.#q(),this.#Z)clearTimeout(this.#Z);this.#Z=void 0,this.#G.clear()}#U(){return this.#X.selection.status===\"none\"?null:this.#X.selection.runId}#T(X){let{snapshot:$,selection:Q}=this.#X;return($?.selectedRun?.runId===X?$.selectedRun:void 0)??$?.runs.find((J)=>J.runId===X)??(Q.status===\"ready\"?Q.detail.children.find((J)=>J.runId===X)??Q.detail.ancestors.find((J)=>J.runId===X):void 0)}#b(X){let $=this.#X.selection,Q=this.#U();if(Q){let J=X.selectedRun??X.runs.find((z)=>z.runId===Q);if(J?.runId===Q){let z=R4(J);$=$.status===\"ready\"?{...$,summary:J}:{status:\"loading\",runId:Q,summary:J};let K=z!==this.#J;if(this.#J=z,this.#z({connected:!0,snapshot:X,selection:$}),K)this.#B(this.#W);return}this.#q(),$={status:\"unavailable\",runId:Q}}this.#z({connected:!0,snapshot:X,selection:$})}#A(){if(this.#$||this.#X.accessDenied)return;this.#P=!0;let X=this.#K;this.#H=!1,this.#F.loadSnapshot({...this.#X.historyQuery,selectedRunId:this.#U()}).then(($)=>{if(this.#$||this.#X.accessDenied||X!==this.#K)return;this.#b($)}).catch(()=>{if(this.#$||this.#X.accessDenied||X!==this.#K)return;this.#z({connected:!1})}).finally(()=>{if(this.#$||this.#X.accessDenied)return;if(this.#P=!1,this.#N){this.#N=!1,this.#A();return}if(!this.#H)this.#z({manualRefreshing:!1})})}#B(X){let $=this.#U(),Q=this.#J;if(this.#$||this.#X.accessDenied||this.#Y!==null||this.#Q!==void 0||!$||!Q||X!==this.#W)return;let J={};this.#Y=J,this.#F.loadRunDetail($).then((z)=>{if(!this.#_(J,X))return;this.#Y=null;let K=this.#X.selection;if(z?.run.runId===$&&(K.status===\"loading\"||K.status===\"ready\")&&K.summary){if(this.#z({selection:{status:\"ready\",runId:$,summary:K.summary,detail:z}}),Q!==this.#J)this.#B(X)}else this.#O(X)}).catch(()=>{if(!this.#_(J,X))return;this.#Y=null,this.#O(X)})}#_(X,$){return!this.#$&&!this.#X.accessDenied&&this.#Y===X&&this.#W===$}#O(X){if(this.#$||this.#X.accessDenied||X!==this.#W)return;if(this.#Q)clearTimeout(this.#Q);this.#Q=setTimeout(()=>{this.#Q=void 0,this.#B(X)},this.#L)}#k(X){let $=this.#J;if(this.#q(),this.#J=$,!$)return;let Q=this.#W;if(X>0)this.#Q=setTimeout(()=>{this.#Q=void 0,this.#B(Q)},X);else this.#B(Q)}#q(){if(this.#W+=1,this.#Y=null,this.#J=null,this.#Q)clearTimeout(this.#Q);this.#Q=void 0}#z(X){this.#X={...this.#X,...X};for(let $ of this.#G)$(this.#X)}}function p0({copy:X,title:$}){return Z(\"div\",{class:\"empty\",children:Z(\"div\",{children:[Z(\"div\",{class:\"empty-icon\",children:Z(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.4\",children:Z(\"path\",{d:\"M4 5.5h12M4 10h12M4 14.5h8\"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"strong\",{children:$},void 0,!1,void 0,this),Z(\"p\",{children:X},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function u0(X){return X.description||\"Run this typed pipeline command.\"}function w0(X){return X instanceof Error?X.message||String(X):String(X)}function I2(X=globalThis.matchMedia){return X?.(\"(prefers-reduced-motion: reduce)\").matches?\"auto\":\"smooth\"}function d0({metadata:X}){if(!X)return null;return Z(\"details\",{class:\"step-metadata\",children:[Z(\"summary\",{children:[X.owner,X.domain,...X.tags??[]].filter(Boolean).join(\" · \")||\"Metadata\"},void 0,!1,void 0,this),Z(\"pre\",{children:JSON.stringify(X,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function a3(X,$,Q){let J=new Map,z=$.trim().toLowerCase();for(let K of X){if(!`${K.id} ${JSON.stringify(K.metadata??{})}`.toLowerCase().includes(z))continue;let W=Q===\"none\"?\"Steps\":K.metadata?.[Q],Y=J.get(W)??[];Y.push(K),J.set(W,Y)}return J}function w2({steps:X}){let[$,Q]=C(\"\"),[J,z]=C(\"none\"),K=a3(X,$,J);return Z(\"details\",{children:[Z(\"summary\",{children:[\"Explore steps (\",X.length,\")\"]},void 0,!0,void 0,this),Z(\"label\",{class:\"field\",children:[\"Search steps and metadata\",Z(\"input\",{type:\"search\",value:$,onInput:(W)=>Q(W.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"label\",{class:\"field\",children:[\"Group steps\",Z(\"select\",{value:J,onChange:(W)=>{let Y=W.currentTarget.value;if(Y===\"owner\"||Y===\"domain\"||Y===\"none\")z(Y)},children:[Z(\"option\",{value:\"none\",children:\"Execution order\"},void 0,!1,void 0,this),Z(\"option\",{value:\"owner\",children:\"Owner\"},void 0,!1,void 0,this),Z(\"option\",{value:\"domain\",children:\"Domain\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K.size===0&&Z(\"p\",{children:\"No matching steps.\"},void 0,!1,void 0,this),[...K].map(([W,Y])=>Z(\"section\",{children:[Z(\"h4\",{children:W??\"Unassigned\"},void 0,!1,void 0,this),W===void 0&&Z(\"small\",{children:[\"No \",J,\" specified\"]},void 0,!0,void 0,this),Z(\"ul\",{children:Y.map((U)=>Z(\"li\",{children:[Z(\"code\",{children:U.id},void 0,!1,void 0,this),Z(d0,{metadata:U.metadata},void 0,!1,void 0,this)]},U.id,!0,void 0,this))},void 0,!1,void 0,this)]},JSON.stringify([W]),!0,void 0,this))]},void 0,!0,void 0,this)}function w4({commands:X,onConfigure:$}){if(!X.length)return Z(\"div\",{class:\"sheet\",children:Z(p0,{title:\"No pipelines found\",copy:\"Try a different pipeline name or description.\"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return Z(\"section\",{class:\"sheet\",children:[Z(\"div\",{class:\"sheet-head\",children:[Z(\"div\",{children:[Z(\"div\",{class:\"sheet-title\",children:\"Available pipelines\"},void 0,!1,void 0,this),Z(\"div\",{class:\"sheet-subtitle\",children:\"Available in this Studio session\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{class:\"sheet-subtitle\",children:[X.length,\" shown\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"catalog\",children:X.map((Q)=>Z(\"article\",{class:\"catalog-card\",children:[Z(\"h3\",{children:Q.name},void 0,!1,void 0,this),Z(\"p\",{children:u0(Q)},void 0,!1,void 0,this),Z(\"div\",{class:\"catalog-actions\",children:Z(\"button\",{class:\"primary-button\",onClick:()=>$(Q.id),children:\"Configure\"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},Q.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function n3(X){switch(X.kind){case\"all\":return\"Included because no step or target filter was set.\";case\"exact\":return\"Explicitly listed in the exact step selection.\";case\"target\":return`Requested target “${X.targetId}”.`;case\"required-dependency\":return`Required input for “${X.dependentId}” on the path to target “${X.targetId}”.`;case\"failure-gate\":return`Failure gate for “${X.dependentId}” on the path to target “${X.targetId}”.`;case\"optional-only\":return`Optional input for “${X.dependentId}” on the path to target “${X.targetId}”; this link does not select it.`;case\"outside-target-closure\":return\"Outside the selected targets and their prerequisite paths.\";case\"not-selected\":return\"Not listed in the exact step selection.\"}}function s3(X){switch(X){case\"dry-run\":return\"Its dry-run policy skips this step.\";case\"unmet-dependency\":return\"A required input is unavailable in this selection or dry run.\";case\"failed-dependency\":return\"A failure gate failed or was cancelled.\";case\"fail-fast\":return\"Execution stops after an earlier failure.\";case\"policy\":return\"Its runtime skip policy omits this step.\";case\"filtered\":return\"Excluded by the selection filter.\"}}function H1({ids:X,stepsById:$}){return Z(\"span\",{class:\"plan-references\",children:X.map((Q)=>Z(\"span\",{children:[Z(\"code\",{children:Q},void 0,!1,void 0,this),$.get(Q)?.selected===!1&&\" (not selected)\"]},Q,!0,void 0,this))},void 0,!1,void 0,this)}function S4({plan:X}){let $=X.steps.filter((z)=>z.selected&&!z.skipReason).length,Q=new Map(X.steps.map((z)=>[z.id,z])),J=X.steps.some((z)=>z.selectionReasons.some((K)=>K.kind===\"target\"))?{title:\"Targets with prerequisites\",detail:\"Targets include required inputs and failure gates recursively. Optional inputs are not added unless selected for another reason.\"}:X.steps.some((z)=>z.selectionReasons.some((K)=>K.kind===\"exact\"||K.kind===\"not-selected\"))?{title:\"Exact steps\",detail:\"Only listed steps are selected. Required inputs and failure gates are not added automatically, so missing required inputs can skip a selected step.\"}:{title:\"All steps\",detail:\"No selection filter is set; every declared step is selected.\"};return Z(j,{children:[X.errors.length>0&&Z(\"div\",{class:\"launch-error\",children:X.errors.map((z)=>Z(\"div\",{children:z.message},z.message,!1,void 0,this))},void 0,!1,void 0,this),Z(\"div\",{class:\"plan-summary\",children:[Z(\"strong\",{children:X.pipelineId},void 0,!1,void 0,this),Z(\"span\",{children:[$,\" of \",X.steps.length,\" steps planned to run\",X.dryRun?\" · dry run\":\"\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X.steps.length>0&&Z(\"div\",{class:\"plan-selection-mode\",children:[Z(\"strong\",{children:J.title},void 0,!1,void 0,this),Z(\"span\",{children:J.detail},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(d0,{metadata:X.definition?.metadata},void 0,!1,void 0,this),Z(w2,{steps:X.steps},void 0,!1,void 0,this),Z(\"div\",{class:\"plan-steps\",children:X.steps.map((z)=>{let K=!z.selected?\"Not selected\":z.skipReason===\"dry-run\"?\"Dry-run skip\":z.skipReason?\"Skipped\":\"Will run\",W=z.nestedPipeline,Y=z.remote,U=Y?\"Remote step\":W?W.mode===\"iterate\"?\"Pipeline iteration\":W.mode===\"for-each\"?\"Pipeline fan-out\":\"Nested pipeline\":\"Step\";return Z(\"div\",{class:\"plan-step\",children:[Z(\"div\",{class:\"plan-step-title\",children:[Z(\"strong\",{children:z.name||z.id},void 0,!1,void 0,this),z.name&&z.name!==z.id&&Z(\"code\",{class:\"plan-step-id\",children:z.id},void 0,!1,void 0,this),Z(\"span\",{class:`plan-kind${W?\" pipeline\":\"\"}`,children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.description&&Z(\"small\",{children:z.description},void 0,!1,void 0,this),Z(d0,{metadata:z.metadata},void 0,!1,void 0,this),Z(\"span\",{class:`plan-disposition${K===\"Will run\"?\"\":\" skipped\"}`,children:K},void 0,!1,void 0,this),Z(\"ul\",{class:\"plan-explanation\",children:[z.selectionReasons.map((B,q)=>Z(\"li\",{children:[Z(\"strong\",{children:z.selected?\"Selected\":\"Omitted\"},void 0,!1,void 0,this),Z(\"span\",{children:n3(B)},void 0,!1,void 0,this)]},q,!0,void 0,this)),Z(\"li\",{children:[Z(\"strong\",{children:\"Required inputs\"},void 0,!1,void 0,this),z.dependencies.length>0?Z(\"span\",{children:[Z(H1,{ids:z.dependencies,stepsById:Q},void 0,!1,void 0,this),\" — unavailable inputs skip this step.\"]},void 0,!0,void 0,this):Z(\"span\",{children:\"No required inputs.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.optionalDependencies.length>0&&Z(\"li\",{children:[Z(\"strong\",{children:\"Optional inputs\"},void 0,!1,void 0,this),Z(\"span\",{children:[Z(H1,{ids:z.optionalDependencies,stepsById:Q},void 0,!1,void 0,this),\" — unavailable inputs do not block it.\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.skipAfterFailureOf.length>0&&Z(\"li\",{children:[Z(\"strong\",{children:\"Failure gates\"},void 0,!1,void 0,this),Z(\"span\",{children:[Z(H1,{ids:z.skipAfterFailureOf,stepsById:Q},void 0,!1,void 0,this),\" — failure or cancellation skips this step.\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.selected&&z.skipReason&&Z(\"li\",{children:[Z(\"strong\",{children:\"Planned skip\"},void 0,!1,void 0,this),Z(\"span\",{children:s3(z.skipReason)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.selected&&!z.skipReason&&z.runtimeSkipPossible&&Z(\"li\",{children:[Z(\"strong\",{children:\"Runtime policy\"},void 0,!1,void 0,this),Z(\"span\",{children:\"This step may still skip when it runs.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W&&Z(t0,{label:W.pipelineId,secondary:`${W.stepIds.length} declared steps${W.mode===\"iterate\"?` per iteration, at most ${W.maxIterations} iterations`:W.mode===\"for-each\"?\" per runtime item\":\"\"}`,stepIds:W.stepIds},void 0,!1,void 0,this),Y&&Z(t0,{label:Y.engine,secondary:Y.target},void 0,!1,void 0,this)]},z.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function g4(X,$,Q){let J=new Map(X.map((z,K)=>{let W=$.get(z).filter((U)=>Q.has(U)),Y=W.length?W.reduce((U,B)=>U+Q.get(B),0)/W.length:K;return[z,Y]}));X.sort((z,K)=>J.get(z)-J.get(K)),X.forEach((z,K)=>Q.set(z,K))}function y4(X,$,Q){let J=new Map(X.map((N)=>[N.id,N])),z=new Map(X.map((N)=>[N.id,[]])),K=new Map(X.map((N)=>[N.id,[]]));for(let{from:N,to:H}of $){if(N===H||!J.has(N)||!J.has(H))continue;if(z.get(H).includes(N))continue;z.get(H).push(N),K.get(N).push(H)}let W=new Map,Y=new Set,U=(N)=>{let H=W.get(N);if(H!==void 0)return H;if(Y.has(N))return-1;Y.add(N);let O=0;for(let _ of z.get(N))O=Math.max(O,U(_)+1);return Y.delete(N),W.set(N,O),O},B=[];for(let N of X)(B[U(N.id)]??=[]).push(N.id);let q=new Map;B[0]?.forEach((N,H)=>q.set(N,H));for(let N=0;N<4;N+=1){for(let H of B.slice(1))g4(H,z,q);for(let H of B.slice(0,-1).reverse())g4(H,K,q)}let P=(N)=>N.reduce((H,O)=>H+J.get(O).width,0)+Math.max(0,N.length-1)*Q.columnGap,M=Math.max(0,...B.map(P)),G=new Map,L=0;return B.forEach((N,H)=>{let O=(M-P(N))/2,_=0;for(let R of N){let w=J.get(R);G.set(R,{...w,x:O,y:L,layer:H}),O+=w.width+Q.columnGap,_=Math.max(_,w.height)}L+=_+Q.rowGap}),{nodes:G,width:M,height:Math.max(0,L-Q.rowGap)}}var W2=124,Y2=64,f2=20,G0=15,h4=50,t3=18,A0=14,o0=36,S0=12,P1=26,e3=18,X6=4,v4=M4,V4=6,S2=18,$6=5.5,L1={input:\"Required input\",optional:\"Optional input\",gate:\"Failure gate\"},Z6={cancelled:!0,completed:!0,failed:!0},Q6={completed:\"M-6 .5 -2 4.5 6.5-4.5\",failed:\"M-4.5-4.5 4.5 4.5M4.5-4.5-4.5 4.5\",cancelled:\"M-4-4H4V4H-4Z\",skipped:\"M-5 5 5-5\"};function j4(X,$,Q){if(Q)X.opened.add($);return X.opened.has($)}function v2(X){let $=new Map,Q=(J,z)=>{for(let K of J??[])$.set(K,[...$.get(K)??[],z])};return Q(X.dependencies,\"input\"),Q(X.optionalDependencies,\"optional\"),Q(X.skipAfterFailureOf,\"gate\"),$}function z6(X){return X.status===\"completed\"||X.skipReason===\"policy\"}function D4(X,$,Q){let J=X.includes(\"gate\"),z=$.status===\"failed\"||$.status===\"cancelled\";if(J&&z)return\"tripped\";if(Q.status===\"planned\")return\"candidate\";if(X.length===1&&J)return\"settled\";if(!z6($))return z?\"blocked\":\"unused\";if(Q.status===\"running\")return\"active\";return Q.status===\"skipped\"&&Q.skipReason!==\"policy\"?\"unused\":\"used\"}function J6(X){return X.state===\"tripped\"?\"gate\":X.kinds[0]}var K6={active:(X,$)=>`${$} is running with ${X}'s output.`,blocked:(X,$)=>`${X} did not produce an output, so ${$} could not use it.`,candidate:(X,$)=>`Candidate: ${$} has not started, so ${X}'s output is not consumed yet.`,settled:(X)=>`The gate did not trip: ${X} neither failed nor was cancelled.`,tripped:(X,$)=>`${X} failed or was cancelled, which skips ${$}.`,unused:(X,$)=>`${$} did not receive ${X}'s output.`,used:(X,$)=>`${X} produced an output that fed ${$}.`},W6={input:(X,$)=>`${$} receives ${X}'s output as a required typed input.`,optional:(X,$)=>`${$} receives ${X}'s output only when ${X} produced one.`,gate:(X,$)=>`${$} is skipped when ${X} fails or is cancelled.`};function E4(X){return X===void 0||X===\"pending\"?\"planned\":X}function Y6(X,$){let{itemKey:Q,iteration:J}=X.origin??{};return(Q!==void 0?$.get(Q):void 0)??(J!==void 0?`iteration ${J}`:Q??X.pipelineId)}function x4(X,$=t3){return X.length>$?X.slice(0,Math.max(1,$-1))+\"…\":X}function B6(X){return X.y+(X.kind===\"run\"&&X.graph?0:f2-G0-3)}function m4(X,$,Q){let J=X.find((z)=>z.stepId===$);return J?Math.max(J.count,Q):Q}function q6(X,$,Q,J,z,K,W,Y){let U=new Map(X.agentTurn?.calls.map((b)=>[b.callId,b.tool])??[]),B=[...Q].sort((b,T)=>(b.origin?.iteration??0)-(T.origin?.iteration??0)||b.startedAtMs-T.startedAtMs),q=B.filter((b)=>b.subtreeIsRunning).length,P=[];for(let b of B.slice(0,v4)){let T=Y6(b,U),k=W.canLoad&&Y+1<V4;if(k)W.expandable.add(b.runId);let v=k&&(W.toggles.get(b.runId)??j4(W,b.runId,b.subtreeIsRunning&&q===1)),I=v?W.loads.get(b.runId):void 0;if(v)W.wanted.add(b.runId);let h=I&&I!==\"missing\"?c4(I.run,I.children,W,Y+1,I.childSteps):void 0;P.push({kind:\"run\",summary:b,label:T,expandable:k,expanded:v,graph:h,unavailable:I===\"missing\",x:0,y:0,width:h?Math.max(W2,h.width+S0*2):W2,height:h?P1+h.height+S0:Y2})}let M=P.length;for(let b of J.slice(0,Math.max(0,v4-P.length)))P.push({kind:\"item\",detail:b,label:b.name??U.get(b.id)??b.id,x:0,y:0,width:W2,height:Y2});let G=K-M,L=J.length-(P.length-M),N=[G>0&&`+${G} more in the run list`,L>0&&`+${L} more in the timeline`,z>0&&`${z} progress rows not recorded`].filter(Boolean).join(\" · \"),H=$.nestedPipeline?.mode===\"iterate\"?1:X6,O=[];for(let b=0;b<P.length;b+=H)O.push(P.slice(b,b+H));let _=(b)=>b.reduce((T,k)=>T+k.width,0)+(b.length-1)*A0,R=Math.max(W2,...O.map(_)),w=S0;for(let b of O){let T=S0+(R-_(b))/2;for(let k of b)k.x=T,k.y=w,T+=k.width+A0;w+=Math.max(...b.map((k)=>k.height))+(H===1?o0/2:A0)}let S=H===1?P.slice(1).map((b,T)=>{let k=P[T];return`M${k.x+k.width/2} ${k.y+k.height-4}V${B6(b)}`}):[],m=P.length?w-(H===1?o0/2:A0):S0,c=R+S0*2;return{x:0,y:Y2,width:c,height:m+(N?e3:0)+S0,items:P,links:S,...N?{more:N}:{}}}function c4(X,$,Q,J,z=[]){Q.runs.set(X.runId,X),Q.children.set(X.runId,$),Q.childSteps.set(X.runId,z);for(let N of $)Q.summaries.set(N.runId,N);let K=new Map(X.steps.map((N)=>[N.id,N])),W=X.steps.map((N)=>{let H=`${X.runId}/${N.id}`,O=$.filter((h)=>h.origin?.stepId===N.id),_=new Set(O.map((h)=>h.origin?.itemKey)),R=N.nestedPipeline?.mode,S=(R===\"single\"||R===\"iterate\")&&O.length>0?[]:(N.progress?.details??[]).filter((h)=>!h.depth&&!_.has(h.id)),m=N.progress?.details??[],c=N.nestedPipeline?0:Math.max(0,(N.progress?.detailCount??m.length)-m.length),b=m4(z,N.id,O.length),T=b+S.length,k=T>0&&J<V4&&(Q.toggles.get(H)??j4(Q,H,N.status===\"running\"&&O.length>0)),v=k?q6(X,N,O,S,c,b,Q,J):void 0,I=Math.max(W2,v?.width??0);if(v)v.x=(I-v.width)/2;return{key:H,step:N,x:0,y:0,width:I,height:v?Y2+v.height+6:Y2,itemCount:T,expanded:k,expansion:v}}),Y=new Map(X.steps.map((N)=>[N.id,v2(N)])),U=y4(W.map(({key:N,width:H,height:O})=>({id:N,width:H,height:O})),X.steps.flatMap((N)=>[...Y.get(N.id).keys()].map((H)=>({from:`${X.runId}/${H}`,to:`${X.runId}/${N.id}`}))),{columnGap:A0,rowGap:o0}),B=new Map,q=[],P=new Map;for(let N of W){let H=U.nodes.get(N.key);N.x=H.x,N.y=H.y,B.set(N.step.id,N),P.set(N.step.id,H.layer),q[H.layer]=H.y}let M=U.width,G=0,L=[];for(let N of W)for(let[H,O]of Y.get(N.step.id)){let _=B.get(H);if(!_)continue;let R=_.x+_.width/2,w=_.y+(_.expansion?_.height:h4+8),S=N.x+N.width/2,m=N.y+f2-G0-3,c=P.get(H)+1,b=P.get(N.step.id),T=W.filter((I)=>{let h=P.get(I.step.id);return h>=c&&h<b}),k=T.some((I)=>I.x<Math.max(R,S)+A0&&I.x+I.width>Math.min(R,S)-A0),v;if(k){let I=Math.max(...T.map((_0)=>_0.x+_0.width))+A0/2+G*6;G+=1,M=Math.max(M,I+A0/2);let h=q[c]-o0/2,N0=q[b]-o0/2;v=`M${R} ${w}C${R} ${h} ${I} ${h} ${I} ${q[c]}V${q[b]-o0}C${I} ${N0} ${S} ${N0} ${S} ${m-4}`}else{let I=(w+m)/2;v=`M${R} ${w}C${R} ${I} ${S} ${I} ${S} ${m-4}`}L.push({from:H,to:N.step.id,kinds:O,state:D4(O,K.get(H),N.step),path:v,head:`M${S-4} ${m-7}L${S} ${m}L${S+4} ${m-7}Z`})}return{run:X,width:M,height:U.height,steps:W,edges:L}}function h2(X){return($)=>{if($.key!==\"Enter\"&&$.key!==\" \")return;$.preventDefault(),X()}}function l4({count:X,expanded:$,label:Q,onToggle:J}){let z=()=>J();return Z(\"g\",{class:`graph-badge${$?\" expanded\":\"\"}`,transform:`translate(${G0-2} ${G0-3})`,role:\"button\",tabIndex:0,\"aria-expanded\":$,\"aria-label\":`${$?\"Collapse\":\"Expand\"} ${Q}`,onClick:(K)=>{K.stopPropagation(),z()},onKeyDown:h2(z),children:[Z(\"circle\",{r:8},void 0,!1,void 0,this),Z(\"text\",{dy:3,children:$?\"−\":X>99?\"99+\":X},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function M1(X){let $=Q6[X.status];return Z(\"g\",{class:`graph-node ${X.kind} ${X.status}${X.selected?\" selected\":\"\"}${X.pulse?\" pulse\":\"\"}`,transform:`translate(${X.cx} ${f2})`,children:[Z(\"g\",{class:\"graph-hit\",role:\"button\",tabIndex:0,\"aria-pressed\":X.selected,\"aria-label\":`${X.title}: ${X.status}`,onClick:X.onSelect,onKeyDown:h2(X.onSelect),children:[Z(\"title\",{children:`${X.title} · ${X.status}`},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-halo\",r:G0+8},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-focus\",r:G0+4},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-disc\",r:G0},void 0,!1,void 0,this),X.kind===\"run\"&&Z(\"circle\",{class:\"graph-ring\",r:G0-4},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-spinner\",r:G0,pathLength:100},void 0,!1,void 0,this),$&&Z(\"path\",{class:\"graph-icon\",d:$,pathLength:20},void 0,!1,void 0,this),Z(\"text\",{class:\"graph-label\",y:h4-f2,children:x4(X.label)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.badge]},void 0,!0,void 0,this)}function B2(X,$){return X!==null&&JSON.stringify(X)===JSON.stringify($)}function U6({expansion:X,run:$,step:Q,ui:J}){return Z(\"g\",{class:\"graph-expansion\",transform:`translate(${X.x} ${X.y})`,children:[Z(\"rect\",{class:\"graph-frame\",width:X.width,height:X.height,rx:10},void 0,!1,void 0,this),X.links.map((z)=>Z(\"path\",{class:\"graph-sequence\",d:z},z,!1,void 0,this)),X.items.map((z)=>{if(z.kind===\"item\"){let U={kind:\"item\",runId:$.runId,stepId:Q.id,itemId:z.detail.id},B=E4(z.detail.status??\"running\");return Z(\"g\",{transform:`translate(${z.x} ${z.y})`,children:Z(M1,{cx:z.width/2,kind:\"item\",label:z.label,title:z.label,status:B,selected:B2(J.selection,U),pulse:J.pulse(`${$.runId}/${Q.id}/${z.detail.id}`,B),onSelect:()=>J.select(U)},void 0,!1,void 0,this)},\"item:\"+z.detail.id,!1,void 0,this)}let{summary:K}=z,W={kind:\"run\",runId:K.runId},Y=Z(l4,{count:K.stepCount,expanded:z.expanded,label:z.label,onToggle:()=>J.toggle(K.runId,!z.expanded)},void 0,!1,void 0,this);if(z.graph)return Z(\"g\",{transform:`translate(${z.x} ${z.y})`,children:[Z(\"rect\",{class:`graph-run-frame ${K.status}${B2(J.selection,W)?\" selected\":\"\"}`,width:z.width,height:z.height,rx:8},void 0,!1,void 0,this),Z(\"g\",{class:\"graph-run-header\",role:\"button\",tabIndex:0,\"aria-label\":`Inspect nested run ${z.label}`,onClick:()=>J.select(W),onKeyDown:h2(()=>J.select(W)),children:[Z(\"rect\",{width:z.width,height:P1-4,rx:8},void 0,!1,void 0,this),Z(\"text\",{x:10,y:15,children:x4(z.label===K.pipelineId?z.label:`${z.label} · ${K.pipelineId}`,Math.floor((z.width-40)/$6))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"g\",{transform:`translate(${z.width-12-(G0-2)} ${11-(G0-3)})`,children:Y},void 0,!1,void 0,this),Z(\"g\",{transform:`translate(${(z.width-z.graph.width)/2} ${P1})`,children:Z(p4,{scene:z.graph,ui:J},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},K.runId,!0,void 0,this);return Z(\"g\",{transform:`translate(${z.x} ${z.y})`,children:Z(M1,{cx:z.width/2,kind:\"run\",label:z.unavailable?\"unavailable\":z.expanded?\"loading…\":z.label,title:`${z.label} (${K.pipelineId})`,status:K.status,selected:B2(J.selection,W),pulse:J.pulse(K.runId,K.status),onSelect:()=>J.select(W),badge:z.unavailable||!z.expandable?void 0:Y},void 0,!1,void 0,this)},K.runId,!1,void 0,this)}),X.more&&Z(\"text\",{class:\"graph-more\",x:X.width/2,y:X.height-S0,children:X.more},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function p4({scene:X,ui:$}){let Q=X.run.runId;return Z(\"g\",{class:\"graph-run\",children:[X.edges.map((J)=>{let z={kind:\"edge\",runId:Q,from:J.from,to:J.to},K=()=>$.select(z);return Z(\"g\",{class:`graph-edge-group ${J6(J)} ${J.state}${B2($.selection,z)?\" selected\":\"\"}`,role:\"button\",tabIndex:0,\"aria-label\":`Connection ${J.from} to ${J.to}`,onClick:K,onKeyDown:h2(K),children:[Z(\"title\",{children:`${J.from} → ${J.to} · ${J.kinds.map((W)=>L1[W]).join(\", \")}`},void 0,!1,void 0,this),Z(\"path\",{class:\"graph-edge-hit\",d:J.path},void 0,!1,void 0,this),Z(\"path\",{class:\"graph-edge\",d:J.path},void 0,!1,void 0,this),J.state===\"active\"&&Z(\"path\",{class:\"graph-edge-flow\",d:J.path},void 0,!1,void 0,this),Z(\"path\",{class:\"graph-edge-head\",d:J.head},void 0,!1,void 0,this)]},J.from+\"->\"+J.to,!0,void 0,this)}),X.steps.map((J)=>{let{step:z}=J,K={kind:\"step\",runId:Q,stepId:z.id};return Z(\"g\",{transform:`translate(${J.x} ${J.y})`,children:[J.expansion&&Z(U6,{expansion:J.expansion,run:X.run,step:z,ui:$},void 0,!1,void 0,this),Z(M1,{cx:J.width/2,kind:\"step\",label:z.name||z.id,title:z.name?`${z.name} (${z.id})`:z.id,status:z.status,selected:B2($.selection,K),pulse:$.pulse(J.key,z.status),onSelect:()=>$.select(K),badge:J.itemCount>0&&Z(l4,{count:J.itemCount,expanded:J.expanded,label:z.name||z.id,onToggle:()=>$.toggle(J.key,!J.expanded)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},z.id,!0,void 0,this)})]},void 0,!0,void 0,this)}function g2({rows:X}){return Z(\"dl\",{class:\"graph-facts\",children:X.map(([$,Q])=>Z(j,{children:[Z(\"dt\",{children:$},void 0,!1,void 0,this),Z(\"dd\",{children:Q},void 0,!1,void 0,this)]},$,!0,void 0,this))},void 0,!1,void 0,this)}function f4({title:X,empty:$,rows:Q}){return Z(\"div\",{class:\"graph-io\",children:[Z(\"h4\",{children:X},void 0,!1,void 0,this),Q.length===0&&Z(\"p\",{class:\"graph-hint\",children:$},void 0,!1,void 0,this),Q.map((J)=>Z(\"button\",{type:\"button\",onClick:J.onSelect,children:[Z(J0,{value:J.status},void 0,!1,void 0,this),Z(\"code\",{children:J.id},void 0,!1,void 0,this),Z(\"small\",{children:J.kinds.map((z)=>L1[z]).join(\" + \")},void 0,!1,void 0,this)]},J.id,!0,void 0,this))]},void 0,!0,void 0,this)}function G6({runs:X,total:$,onOpenRun:Q}){if(X.length===0)return null;let J=$>X.length?`${X.length} of ${$}`:String(X.length);return Z(\"div\",{class:\"graph-io\",children:[Z(\"h4\",{children:[\"Nested runs (\",J,\")\"]},void 0,!0,void 0,this),Z(\"div\",{class:\"nested-runs\",children:X.map((z)=>Z(\"button\",{class:\"nested-run\",type:\"button\",onClick:()=>Q(z.runId),children:[Z(J0,{value:z.status},void 0,!1,void 0,this),Z(\"strong\",{children:z.origin?.itemKey??z.pipelineId},void 0,!1,void 0,this),Z(\"small\",{children:[F0(z.durationMs),\" · \",z.stepCount,\" steps\"]},void 0,!0,void 0,this)]},z.runId,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var y2=(X,$)=>$===void 0?\"—\":\"+\"+F0($-X.startedAtMs);function N6({selection:X,ctx:$,ui:Q,onOpenRun:J}){let z=X?$.runs.get(X.runId):void 0;if(X?.kind===\"run\"){let K=$.summaries.get(X.runId);if(K){let Y=(K.parentRunId?$.runs.get(K.parentRunId):void 0)?.agentTurn?.calls.find((B)=>B.callId===K.origin?.itemKey)?.tool,U=$.wanted.has(K.runId);return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:\"Nested run\"},void 0,!1,void 0,this),Z(\"h3\",{children:K.pipelineId},void 0,!1,void 0,this),Z(J0,{value:K.status},void 0,!1,void 0,this),Z(g2,{rows:[[\"Run\",Z(\"code\",{title:K.runId,children:v0(K.runId)},void 0,!1,void 0,this)],...K.origin?.stepId?[[\"Started by\",Z(\"code\",{children:K.origin.stepId},void 0,!1,void 0,this)]]:[],...Y?[[\"Tool\",Z(\"code\",{children:Y},void 0,!1,void 0,this)]]:[],...K.origin?.iteration!==void 0?[[\"Iteration\",String(K.origin.iteration)]]:[],...K.origin?.itemKey!==void 0&&!Y?[[\"Item\",Z(\"code\",{children:K.origin.itemKey},void 0,!1,void 0,this)]]:[],[\"Duration\",F0(K.durationMs)],[\"Steps\",String(K.stepCount)],[\"Nested\",String(K.descendantCount)]]},void 0,!1,void 0,this),Z(\"div\",{class:\"graph-actions\",children:[Z(\"button\",{class:\"primary-button\",type:\"button\",onClick:()=>J(K.runId),children:\"Open run\"},void 0,!1,void 0,this),$.expandable.has(K.runId)&&Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>Q.toggle(K.runId,!U),children:U?\"Collapse steps\":\"Show steps\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.canLoad&&!$.expandable.has(K.runId)&&Z(\"p\",{class:\"graph-hint\",children:\"This run is nested too deeply to draw here. Open it to see its steps.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}}if(z&&X?.kind===\"item\"){let K=z.steps.find((Y)=>Y.id===X.stepId),W=K?.progress?.details?.find((Y)=>Y.id===X.itemId);if(K&&W)return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:[\"Dynamic item · \",K.name||K.id]},void 0,!0,void 0,this),Z(\"h3\",{children:W.name??W.id},void 0,!1,void 0,this),Z(J0,{value:E4(W.status??\"running\"),outputSource:W.outputSource},void 0,!1,void 0,this),Z(g2,{rows:[[\"Item\",Z(\"code\",{children:W.id},void 0,!1,void 0,this)],...W.label?[[\"Activity\",W.label]]:[],...W.total!==void 0?[[\"Progress\",`${W.completed??0} / ${W.total}`]]:[]]},void 0,!1,void 0,this),Z(\"p\",{class:\"graph-hint\",children:[\"Reported by \",K.id,\"'s progress. No nested run was recorded for this item.\"]},void 0,!0,void 0,this),Z(\"div\",{class:\"graph-actions\",children:Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>Q.select({kind:\"step\",runId:z.runId,stepId:K.id}),children:[\"Inspect \",K.id]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}if(z&&X?.kind===\"edge\"){let K=z.steps.find((U)=>U.id===X.from),W=z.steps.find((U)=>U.id===X.to),Y=W?v2(W).get(X.from):void 0;if(K&&W&&Y){let U=D4(Y,K,W);return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:[\"Connection · \",z.pipelineId]},void 0,!0,void 0,this),Z(\"h3\",{children:[K.id,\" → \",W.id]},void 0,!0,void 0,this),Y.map((B)=>Z(\"p\",{class:\"graph-hint\",children:[Z(\"b\",{children:[L1[B],\".\"]},void 0,!0,void 0,this),\" \",W6[B](K.id,W.id)]},B,!0,void 0,this)),Z(\"p\",{class:`graph-edge-state ${U}`,children:K6[U](K.id,W.id)},void 0,!1,void 0,this),Z(g2,{rows:[[\"Source\",Z(J0,{value:K.status,outputSource:K.outputSource},void 0,!1,void 0,this)],[\"Target\",Z(J0,{value:W.status,outputSource:W.outputSource},void 0,!1,void 0,this)],[\"Output ready\",y2(z,K.finishedAtMs)],[\"Consumed\",y2(z,W.startedAtMs)]]},void 0,!1,void 0,this),K.artifacts&&K.artifacts.length>0&&Z(\"div\",{class:\"graph-io\",children:[Z(\"h4\",{children:\"Recorded source artifacts\"},void 0,!1,void 0,this),Z(_2,{artifacts:K.artifacts,stepId:K.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"graph-actions\",children:[K,W].map((B)=>Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>Q.select({kind:\"step\",runId:z.runId,stepId:B.id}),children:[\"Inspect \",B.id]},B.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}}if(z&&X?.kind===\"step\"){let K=z.steps.find((W)=>W.id===X.stepId);if(K){let W=(P)=>z.steps.find((M)=>M.id===P)?.status,Y=[...v2(K)].map(([P,M])=>({id:P,kinds:M,status:W(P)??\"planned\",onSelect:()=>Q.select({kind:\"edge\",runId:z.runId,from:P,to:K.id})})),U=z.steps.flatMap((P)=>{let M=v2(P).get(K.id);return M?[{id:P.id,kinds:M,status:P.status,onSelect:()=>Q.select({kind:\"edge\",runId:z.runId,from:K.id,to:P.id})}]:[]}),B=($.children.get(z.runId)??[]).filter((P)=>P.origin?.stepId===K.id),q=m4($.childSteps.get(z.runId)??[],K.id,B.length);return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:[\"Step · \",z.pipelineId]},void 0,!0,void 0,this),Z(\"div\",{class:\"step-list\",children:Z(O2,{step:K,steps:z.steps},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(g2,{rows:[[\"Started\",y2(z,K.startedAtMs)],[\"Finished\",y2(z,K.finishedAtMs)]]},void 0,!1,void 0,this),Z(f4,{title:\"Inputs\",empty:\"None: this step starts the graph.\",rows:Y},void 0,!1,void 0,this),Z(f4,{title:\"Consumers\",empty:\"None: no later step depends on this output.\",rows:U},void 0,!1,void 0,this),Z(G6,{runs:B,total:q,onOpenRun:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}}return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:\"Inspector\"},void 0,!1,void 0,this),Z(\"p\",{class:\"graph-hint\",children:\"Select a step, connection, or nested run to inspect its inputs, outputs, and execution. Badges expand child pipelines, agent turns, and dynamic tool calls in place.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function F6(){let X=Y0(new Map),$=Y0(new Set);return(Q,J)=>{let z=X.current.get(Q);if(X.current.set(Q,J),z!==void 0&&z!==J)if(Z6[J])$.current.add(Q);else $.current.delete(Q);return $.current.has(Q)}}function H6(X){return JSON.stringify([X.runId,X.eventCount,X.subtreeEventCount,X.status])}function P6(X,$){let Q=[];for(let J of X){let z=JSON.parse(J)[0];if(typeof z===\"string\"&&$.get(z)!==J)Q.push({key:J,runId:z})}return Q}function u4({detail:X,api:$,onOpenRun:Q,focus:J}){let[z,K]=C(new Map),W=Y0(new Set),[Y,U]=C(new Map),[B,q]=C(null),P=Y0(new Map),[M,G]=C(0),L=F6(),N=Y0(null);l(()=>{if(!J)return;q({kind:\"step\",runId:X.run.runId,stepId:J.stepId}),N.current?.scrollIntoView({block:\"nearest\",behavior:I2()})},[J?.request]);let H={loads:Y,toggles:z,opened:W.current,canLoad:$!==void 0,expandable:new Set,wanted:new Set,runs:new Map,children:new Map,childSteps:new Map,summaries:new Map},O=c4(X.run,X.children,H,0,X.childSteps),_=[...H.wanted].sort().map((m)=>H6(H.summaries.get(m))).join(`\n`);l(()=>{if(!$||!_)return;let m=P6(_.split(`\n`),P.current);if(m.length===0)return;let c=!0,b=!1;for(let{key:T,runId:k}of m)$.loadRunDetail(k).then((v)=>{if(!c)return;P.current.set(k,T),U((I)=>new Map(I).set(k,v??\"missing\"))},()=>{if(c&&!b)b=!0,setTimeout(()=>{if(c)G((v)=>v+1)},I4)});return()=>{c=!1}},[$,_,M]);let R={selection:B,select:q,toggle:(m,c)=>K((b)=>new Map(b).set(m,c)),pulse:L},w=O.width+S2*2,S=O.height+S2*2;return Z(\"section\",{class:\"graph-panel\",\"aria-label\":\"Run graph\",children:[Z(\"div\",{class:\"graph-canvas\",children:Z(\"svg\",{width:w,height:S,viewBox:`${-S2} ${-S2} ${w} ${S}`,role:\"group\",\"aria-label\":`${X.run.pipelineId} step graph`,children:Z(p4,{scene:O,ui:R},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{ref:N,children:Z(N6,{selection:B,ctx:H,ui:R,onOpenRun:Q},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{class:\"graph-legend\",\"aria-hidden\":\"true\",children:[Z(\"span\",{children:[Z(\"i\",{class:\"running\"},void 0,!1,void 0,this),\"Running\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"completed\"},void 0,!1,void 0,this),\"Completed\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"failed\"},void 0,!1,void 0,this),\"Failed\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"cancelled\"},void 0,!1,void 0,this),\"Cancelled\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"skipped\"},void 0,!1,void 0,this),\"Skipped\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"planned\"},void 0,!1,void 0,this),\"Planned\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"b\",{class:\"candidate\"},void 0,!1,void 0,this),\"Candidate input\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"b\",{class:\"used\"},void 0,!1,void 0,this),\"Consumed input\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"b\",{class:\"gate\"},void 0,!1,void 0,this),\"Failure gate\"]},void 0,!0,void 0,this),Z(\"span\",{children:[Z(\"i\",{class:\"run\"},void 0,!1,void 0,this),\"Nested run\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function M6(X){if(X===void 0)return\"Path unavailable\";return X.reduce(($,Q)=>$+(typeof Q===\"number\"?`[${Q}]`:/^[A-Za-z_$][\\w$]*$/.test(Q)?`.${Q}`:`[${JSON.stringify(Q)}]`),\"$\")}function L6(X,$,Q,J){let z=$.trim().toLowerCase();return X.filter((K)=>(Q===\"all\"||K.level===Q)&&(J===\"all\"||(J===\"unattributed\"?!K.stepId:K.stepId===J.slice(5)))&&(!z||K.message.toLowerCase().includes(z)))}function V2({cause:X,label:$=\"Cause\"}){return Z(\"details\",{class:\"debug-cause\",children:[Z(\"summary\",{children:[$,\": \",X.name&&`${X.name}: `,X.message||\"No message\"]},void 0,!0,void 0,this),Z(\"div\",{class:\"debug-cause-body\",children:[X.sourceCode&&Z(\"div\",{children:[\"Source code: \",X.sourceCode]},void 0,!0,void 0,this),X.cause&&Z(V2,{cause:X.cause},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function d4({error:X,failedStepIds:$=[],onSelectStep:Q}){let J=X.fanOut;return Z(\"section\",{\"aria-label\":\"Run diagnostics\",class:\"error-card\",children:[$.length>0&&Z(\"div\",{class:\"error-steps\",children:[Z(\"span\",{children:\"Failed at\"},void 0,!1,void 0,this),$.map((z)=>Q?Z(\"button\",{type:\"button\",onClick:()=>Q(z),children:z},z,!1,void 0,this):Z(\"code\",{children:z},z,!1,void 0,this))]},void 0,!0,void 0,this),Z(\"div\",{class:\"error-code\",children:[X.code,\" · \",X.phase,\" · \",X.kind,X.sourceCode&&` · ${X.sourceCode}`]},void 0,!0,void 0,this),Z(\"div\",{class:\"error-message\",children:X.message},void 0,!1,void 0,this),X.issues&&X.issues.length>0&&Z(\"div\",{class:\"debug-group\",children:[Z(\"strong\",{children:[\"Validation issues · \",X.issues.length]},void 0,!0,void 0,this),Z(\"ul\",{class:\"debug-issues\",children:X.issues.map((z,K)=>Z(\"li\",{children:[Z(\"code\",{children:M6(z.path)},void 0,!1,void 0,this),Z(\"span\",{children:z.message},void 0,!1,void 0,this)]},K,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.cause&&Z(\"div\",{class:\"debug-group\",children:Z(V2,{cause:X.cause},void 0,!1,void 0,this)},void 0,!1,void 0,this),J&&Z(\"div\",{class:\"debug-group\",children:[Z(\"strong\",{children:[\"Failed fan-out items · \",J.failureCount]},void 0,!0,void 0,this),J.failures.map((z)=>Z(\"details\",{class:\"debug-cause\",children:[Z(\"summary\",{children:[\"#\",z.index+1,\" · \",z.key,z.keyTruncated&&\" (key truncated)\",\" ·\",\" \",z.cancelled?\"cancelled\":\"failed\",\" · \",z.error.message]},void 0,!0,void 0,this),Z(\"div\",{class:\"debug-cause-body\",children:[z.error.name&&Z(\"div\",{children:[\"Type: \",z.error.name]},void 0,!0,void 0,this),z.error.sourceCode&&Z(\"div\",{children:[\"Source code: \",z.error.sourceCode]},void 0,!0,void 0,this),z.error.cause&&Z(V2,{cause:z.error.cause},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},z.index,!0,void 0,this)),J.omittedFailureCount>0&&Z(\"div\",{class:\"debug-note\",children:[J.omittedFailureCount,\" more failures omitted from the recording\"]},void 0,!0,void 0,this),J.schedulerError&&Z(V2,{cause:J.schedulerError,label:\"Scheduler error\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function A6(X){if(!Number.isFinite(X)||Math.abs(X)>8640000000000000)return\"\";return new Intl.DateTimeFormat(void 0,{hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\"}).format(X)}function o4({logs:X}){let[$,Q]=C(\"\"),[J,z]=C(\"all\"),[K,W]=C(\"all\"),Y=[...new Set(X.flatMap((B)=>B.stepId?[B.stepId]:[]))].sort(),U=L6(X,$,J,K);return Z(\"section\",{\"aria-label\":\"Run logs\",children:[Z(\"div\",{class:\"section-title\",children:[Z(\"span\",{children:\"Logs\"},void 0,!1,void 0,this),Z(\"span\",{children:U.length===X.length?X.length:`${U.length} of ${X.length}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"log-filters\",children:[Z(\"label\",{children:[Z(\"span\",{children:\"Search text\"},void 0,!1,void 0,this),Z(\"input\",{type:\"search\",value:$,onInput:(B)=>Q(B.currentTarget.value),placeholder:\"Search log messages\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"label\",{children:[Z(\"span\",{children:\"Level\"},void 0,!1,void 0,this),Z(\"select\",{value:J,onChange:(B)=>z(B.currentTarget.value),children:[Z(\"option\",{value:\"all\",children:\"All levels\"},void 0,!1,void 0,this),Z(\"option\",{value:\"error\",children:\"Error\"},void 0,!1,void 0,this),Z(\"option\",{value:\"warn\",children:\"Warn\"},void 0,!1,void 0,this),Z(\"option\",{value:\"log\",children:\"Log\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"label\",{children:[Z(\"span\",{children:\"Step\"},void 0,!1,void 0,this),Z(\"select\",{value:K,onChange:(B)=>W(B.currentTarget.value),children:[Z(\"option\",{value:\"all\",children:\"All steps\"},void 0,!1,void 0,this),X.some((B)=>!B.stepId)&&Z(\"option\",{value:\"unattributed\",children:\"No step\"},void 0,!1,void 0,this),Y.map((B)=>Z(\"option\",{value:`step:${B}`,children:B},B,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),U.length?Z(\"div\",{class:\"logs\",children:U.map((B)=>Z(\"div\",{class:\"log-line\",children:[Z(\"time\",{class:\"log-time\",children:A6(B.timestampMs)},void 0,!1,void 0,this),Z(\"span\",{class:`log-level ${B.level}`,children:B.level},void 0,!1,void 0,this),Z(\"span\",{class:\"log-message\",children:[B.stepId&&Z(j,{children:[Z(\"b\",{children:B.stepId},void 0,!1,void 0,this),\" ·\",\" \"]},void 0,!0,void 0,this),B.message]},void 0,!0,void 0,this)]},B.id,!0,void 0,this))},void 0,!1,void 0,this):Z(\"div\",{class:\"log-empty\",children:\"No logs match these filters.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function i4(X){if(!Number.isFinite(X)||Math.abs(X)>8640000000000000)return\"\";return new Intl.DateTimeFormat(void 0,{dateStyle:\"medium\",timeStyle:\"medium\"}).format(X)}function r4(X){if(!Number.isFinite(X)||Math.abs(X)>8640000000000000)return\"\";return new Date(X).toISOString()}function a4(X,$){let Q=Math.max(0,$-X);if(Q<60000)return Math.floor(Q/1000)+\"s ago\";if(Q<3600000)return Math.floor(Q/60000)+\"m ago\";if(Q<86400000)return Math.floor(Q/3600000)+\"h ago\";return Math.floor(Q/86400000)+\"d ago\"}var q2=(X,$)=>`${X} ${$}${X===1?\"\":\"s\"}`;function _6(X){let $=X.steps.length,Q=(K)=>X.steps.filter((W)=>W.status===K).length,J=Q(\"skipped\"),z=J?` · ${J} skipped`:\"\";switch(X.status){case\"running\":{let K=$-Q(\"running\")-Q(\"planned\");return $?`Running · ${K} of ${q2($,\"step\")} finished`:\"Starting\"}case\"completed\":return`Completed ${q2(Q(\"completed\"),\"step\")} in ${F0(X.durationMs)}${z}`;case\"cancelled\":return`Cancelled after ${Q(\"completed\")} of ${q2($,\"step\")}${z}`;case\"failed\":{let K=X.steps.filter((W)=>W.status===\"failed\").map((W)=>W.id);if(K.length)return`Failed at ${K.join(\", \")}${z}`;return X.error?.message?`Failed: ${X.error.message}`:\"Failed\"}}return X.status}function O6({nowMs:X,onSelect:$,run:Q,selectedRootRunId:J}){let{activity:z,descendantCount:K}=Q;return Z(\"button\",{class:`run-row ${Q.status} ${J===Q.runId?\"selected\":\"\"}`,\"data-run-id\":Q.runId,onClick:()=>$(Q.runId),children:[Z(\"div\",{class:\"run-primary\",children:[Z(J0,{value:Q.status},void 0,!1,void 0,this),Z(\"strong\",{children:Q.pipelineId},void 0,!1,void 0,this),Z(\"time\",{class:\"run-time\",datetime:r4(Q.startedAtMs),title:i4(Q.startedAtMs),children:a4(Q.startedAtMs,X)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"run-secondary\",children:[Z(\"code\",{children:v0(Q.runId)},void 0,!1,void 0,this),Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Q.correlationId&&Z(j,{children:[Z(\"span\",{children:[\"correlation \",Q.correlationId]},void 0,!0,void 0,this),Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{children:F0(Q.durationMs)},void 0,!1,void 0,this),Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Z(\"span\",{children:q2(Q.stepCount,\"step\")},void 0,!1,void 0,this),K>0&&Z(j,{children:[Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Z(\"span\",{children:[K,\" nested run\",K===1?\"\":\"s\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q.dryRun&&Z(j,{children:[Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Z(\"span\",{children:\"dry run\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Q.status===\"running\"&&Z(\"div\",{class:\"run-activity\",children:[Z(\"strong\",{children:z.count>1?`${z.count} steps running`:z.names[0]||\"Starting\"},void 0,!1,void 0,this),Z(\"span\",{children:z.count>1?`${z.names.join(\", \")}${z.count>3?` +${z.count-3} more`:\"\"}`:z.message||\"Execution in progress\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function T6(X){return[\"running\",\"failed\",\"cancelled\",\"skipped\",\"completed\",\"planned\"].map((Q)=>[Q,X.steps.filter((J)=>J.status===Q).length]).filter(([,Q])=>Q).map(([Q,J])=>J+\" \"+Q).join(\" · \")||\"No steps\"}function b6(X,$){let Q=[...X],J=new Set(Q.map((z)=>z.runId));for(let z of $){if(J.has(z.runId))continue;J.add(z.runId),Q.push(z)}return Q}function k6({api:X,detail:$,onSelect:Q}){let[J,z]=C([]),[K,W]=C(1),[Y,U]=C(!1),[B,q]=C(!1),[P,M]=C(),G=b6($.children,J);if($.childCount===0)return null;let L=()=>{if(!X||Y||B||G.length>=$.childCount)return;U(!0),M(void 0),X.loadChildRuns($.run.runId,K).then((N)=>{if(U(!1),!N){M(\"This run is no longer in history.\"),q(!0);return}let H=new Set(G.map((_)=>_.runId)),O=N.children.filter((_)=>!H.has(_.runId));if(O.length===0){q(!0);return}z((_)=>[..._,...O]),W(N.page+1)},(N)=>{U(!1),M(N instanceof Error?N.message:\"Could not load more runs.\")})};return Z(j,{children:[Z(\"div\",{class:\"section-title\",children:[Z(\"span\",{children:\"Nested runs\"},void 0,!1,void 0,this),Z(\"span\",{children:[$.childCount,\" direct · \",$.descendantCount,\" total\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"nested-runs\",children:G.map((N)=>{let H=N.descendantCount;return Z(\"button\",{class:\"nested-run\",type:\"button\",onClick:()=>Q(N.runId),children:[Z(J0,{value:N.status},void 0,!1,void 0,this),Z(\"strong\",{children:N.pipelineId},void 0,!1,void 0,this),Z(\"small\",{children:[F0(N.durationMs),\" · \",q2(N.stepCount,\"step\"),H?\" · \"+H+\" nested\":\"\"]},void 0,!0,void 0,this)]},N.runId,!0,void 0,this)})},void 0,!1,void 0,this),P&&Z(\"p\",{role:\"alert\",children:P},void 0,!1,void 0,this),X&&!B&&G.length<$.childCount&&Z(\"div\",{class:\"confirm-actions\",children:Z(\"button\",{class:\"secondary-button\",type:\"button\",disabled:Y,onClick:L,children:Y?\"Loading…\":\"Show more\"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function C6({api:X,canCancel:$,cancelling:Q,liveRunIds:J,nowMs:z,onCancel:K,onCopyLink:W,onSelect:Y,onStepView:U,selection:B,stepView:q=\"timeline\",latestRunId:P}){let[M,G]=C(),L=B.status===\"ready\"?B.detail.run.runId:void 0;if(l(()=>G(void 0),[L]),l(()=>{if(!M||q!==\"timeline\")return;let _=document.querySelector(`.step-list [data-step-id=\"${CSS.escape(M.stepId)}\"]`);if(!_)return;_.scrollIntoView({block:\"center\",behavior:I2()}),_.classList.remove(\"focused\"),_.offsetWidth,_.classList.add(\"focused\")},[M,q]),B.status!==\"ready\"){if(B.status===\"unavailable\")return Z(\"div\",{class:\"sheet detail\",children:Z(\"div\",{class:\"unavailable-run\",children:[Z(\"strong\",{children:\"Run unavailable\"},void 0,!1,void 0,this),Z(\"p\",{children:\"This run is not in this Studio history. It may have been deleted, or this link may refer to another local store.\"},void 0,!1,void 0,this),Z(\"code\",{children:B.runId},void 0,!1,void 0,this),P&&Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>Y(P),children:\"Select latest run\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return Z(\"div\",{class:\"sheet detail\",children:Z(p0,{title:B.status===\"loading\"?\"Loading run\":\"Select a run\",copy:B.status===\"loading\"?\"Loading this run's recorded details.\":\"Choose a run from the history to inspect its steps, retry telemetry, logs, and errors.\"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}let{detail:N}=B,{run:H,ancestors:O}=N;return Z(\"article\",{class:\"sheet detail\",children:Z(\"div\",{class:\"detail-body\",children:[O.length>0&&Z(\"div\",{class:\"run-parentage\",children:[O.map((_)=>Z(\"span\",{children:[Z(\"button\",{type:\"button\",onClick:()=>Y(_.runId),children:_.pipelineId},void 0,!1,void 0,this),Z(\"span\",{children:\" / \"},void 0,!1,void 0,this)]},_.runId,!0,void 0,this)),Z(\"span\",{children:H.pipelineId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"detail-heading\",children:[Z(\"div\",{class:\"detail-heading-copy\",children:[Z(\"div\",{class:\"detail-kicker\",children:[H.parentRunId?\"Nested run\":\"Top-level run\",\" ·\",\" \",a4(H.startedAtMs,z)]},void 0,!0,void 0,this),Z(\"h2\",{children:H.pipelineId},void 0,!1,void 0,this),Z(\"p\",{class:`run-outcome ${H.status}`,children:_6(H)},void 0,!1,void 0,this),Z(\"div\",{class:\"run-id\",children:H.runId},void 0,!1,void 0,this),H.correlationId&&Z(\"div\",{class:\"run-id\",children:[\"Correlation: \",H.correlationId]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"detail-heading-actions\",children:[Z(J0,{value:H.status},void 0,!1,void 0,this),Z(\"button\",{class:\"icon-button\",type:\"button\",title:\"Copy run link\",\"aria-label\":\"Copy run link\",onClick:()=>W(H.runId),children:Z(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",\"aria-hidden\":\"true\",children:[Z(\"rect\",{x:\"7\",y:\"5\",width:\"10\",height:\"12\",rx:\"2\"},void 0,!1,void 0,this),Z(\"path\",{d:\"M13 5V4a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$&&H.status===\"running\"&&!H.parentRunId&&J.includes(H.runId)&&Z(\"button\",{class:\"danger-button\",type:\"button\",disabled:Q,onClick:()=>K(H.runId),children:\"Cancel run\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"detail-meta\",children:[Z(\"div\",{children:[Z(\"label\",{children:\"Started\"},void 0,!1,void 0,this),Z(\"span\",{title:r4(H.startedAtMs),children:i4(H.startedAtMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{children:[Z(\"label\",{children:\"Duration\"},void 0,!1,void 0,this),Z(\"span\",{children:F0(H.durationMs)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{children:[Z(\"label\",{children:\"Steps\"},void 0,!1,void 0,this),Z(\"span\",{children:H.steps.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{children:[Z(\"label\",{children:\"Events\"},void 0,!1,void 0,this),Z(\"span\",{children:H.eventCount},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.error&&Z(j,{children:[Z(\"div\",{class:\"section-title\",children:Z(\"span\",{children:\"Error diagnostics\"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(d4,{error:H.error,failedStepIds:H.steps.filter((_)=>_.status===\"failed\").map((_)=>_.id),onSelectStep:(_)=>G((R)=>({stepId:_,request:(R?.request??0)+1}))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"section-title\",children:[Z(\"span\",{children:q===\"graph\"?\"Step graph\":\"Step timeline\"},void 0,!1,void 0,this),Z(\"span\",{class:\"section-title-actions\",children:[T6(H),U&&H.steps.length>0&&Z(\"span\",{class:\"view-toggle\",role:\"group\",\"aria-label\":\"Step view\",children:[\"timeline\",\"graph\"].map((_)=>Z(\"button\",{type:\"button\",\"aria-pressed\":q===_,onClick:()=>U(_),children:_===\"graph\"?\"Graph\":\"Timeline\"},_,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),H.steps.length===0?Z(p0,{title:\"No planned steps\",copy:\"This run ended before a step plan was recorded.\"},void 0,!1,void 0,this):q===\"graph\"?Z(u4,{detail:N,api:X,onOpenRun:Y,focus:M},H.runId,!1,void 0,this):Z(\"div\",{class:\"step-list\",children:H.steps.map((_)=>Z(O2,{step:_,steps:H.steps},_.id,!1,void 0,this))},void 0,!1,void 0,this),Z(k6,{api:X,detail:N,onSelect:Y},H.runId,!1,void 0,this),H.logs.length>0&&Z(o4,{logs:H.logs},H.runId,!1,void 0,this),Z(\"details\",{class:\"run-definition\",children:[Z(\"summary\",{children:[\"Definition\",\" \",Z(\"code\",{children:H.definitionIdentity?H.definitionIdentity.definitionId.slice(7,19):\"not recorded (legacy trace)\"},void 0,!1,void 0,this),\" \",\"· implementation \",H.definitionIdentity?.implementationVersion??\"unknown\"]},void 0,!0,void 0,this),Z(\"dl\",{class:\"run-definition-facts\",children:[Z(\"dt\",{children:\"Definition ID\"},void 0,!1,void 0,this),Z(\"dd\",{children:Z(\"code\",{children:H.definitionIdentity?.definitionId??\"Not recorded (legacy trace)\"},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.definitionIdentity&&Z(j,{children:[Z(\"dt\",{children:\"Structural fingerprint\"},void 0,!1,void 0,this),Z(\"dd\",{children:Z(\"code\",{children:H.definitionIdentity.structuralFingerprint},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"dt\",{children:\"Implementation\"},void 0,!1,void 0,this),Z(\"dd\",{children:H.definitionIdentity?.implementationVersion??\"Unknown\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function n4(X){let[$,Q]=C(X.stepView??\"timeline\"),J=X.roots.filter((W)=>W.subtreeIsRunning),z=X.roots.filter((W)=>!W.subtreeIsRunning),K=(W,Y)=>Y.length?Z(j,{children:[Z(\"div\",{class:\"run-group\",children:[W,\" · \",Y.length]},void 0,!0,void 0,this),Y.map((U)=>Z(O6,{nowMs:X.nowMs,onSelect:X.onSelect,run:U,selectedRootRunId:X.selection.status===\"ready\"||X.selection.status===\"loading\"?X.selection.summary?.rootRunId:void 0},U.runId,!1,void 0,this))]},void 0,!0,void 0,this):null;return Z(j,{children:Z(\"div\",{class:\"content-grid\",children:[Z(\"section\",{class:\"sheet\",children:[Z(\"div\",{class:\"sheet-head\",children:[Z(\"div\",{children:[Z(\"div\",{class:\"sheet-title\",children:\"Pipeline runs\"},void 0,!1,void 0,this),Z(\"div\",{class:\"sheet-subtitle\",children:\"Top-level runs · nested work stays with its parent\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{class:\"sheet-subtitle\",children:[X.matchingRootCount??X.roots.length,\" top-level · \",X.totalRunCount,\" \",\"total\"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"run-list\",children:X.roots.length?Z(j,{children:[K(\"Running now\",J),K(\"Recent\",z)]},void 0,!0,void 0,this):Z(p0,{title:\"No recorded runs\",copy:\"Choose Pipelines to start a run and create local history.\"},void 0,!1,void 0,this)},void 0,!1,void 0,this),X.onPage&&(X.matchingRootCount??0)>W0&&Z(\"div\",{class:\"confirm-actions\",children:[Z(\"button\",{class:\"secondary-button\",disabled:!X.offset,onClick:()=>X.onPage?.(Math.max(0,(X.offset??0)-W0)),children:\"Previous\"},void 0,!1,void 0,this),Z(\"span\",{children:[(X.offset??0)+1,\"–\",(X.offset??0)+X.roots.length,\" of\",\" \",X.matchingRootCount]},void 0,!0,void 0,this),Z(\"button\",{class:\"secondary-button\",disabled:(X.offset??0)+W0>=(X.matchingRootCount??0),onClick:()=>X.onPage?.((X.offset??0)+W0),children:\"Next\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(C6,{...X,stepView:$,onStepView:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function R6(X){return X.parameters.map(($)=>{if($.type===\"boolean\")return[Boolean($.default)];if($.multiple)return $.choices?[]:[\"\"];return $.default===void 0?[\"\"]:[$.default]})}function I6(X,$){let Q={};return X.parameters.forEach((J,z)=>{let K=$(J,z);if(J.type===\"boolean\"){let Y=K[0];if(Y!==Boolean(J.default))Q[J.key]=Y;return}if(J.multiple){Q[J.key]=J.type===\"number\"?K.filter((Y)=>typeof Y===\"number\"):K.filter((Y)=>typeof Y===\"string\");return}let W=K[0];if(W!==\"\"&&W!==void 0)Q[J.key]=W}),Q}function w6(X,$){let Q={};return X.parameters.forEach((J,z)=>{if(J.group!==\"execution\")return;let K=$(J,z);if(J.type===\"boolean\"){if(K[0]===!0)Q[J.key]=!0;return}if(J.multiple&&K.length)Q[J.key]=K.filter((W)=>typeof W===\"string\")}),Q}function S6(X){return X.key.replace(/([a-z0-9])([A-Z])/g,\"$1 $2\").replace(/[-_]+/g,\" \").replace(/\\b\\w/g,($)=>$.toUpperCase())}function g6(X){let $=[];if(X.description)$.push(X.description);if(X.environment)$.push(\"Environment fallback: \"+X.environment);if(X.multiple)$.push(X.choices?\"Choose one or more values.\":\"Enter one value per line.\");if(X.mustExist)$.push(\"Must be an existing \"+(X.pathKind||\"path\")+\".\");return $.join(\" \")}function y6({index:X,onChange:$,parameter:Q,values:J}){let z=\"run-param-\"+X,K=g6(Q),W=S6(Q);if(Q.type===\"boolean\")return Z(\"label\",{class:\"boolean-field\",for:z,children:[Z(\"span\",{children:[Z(\"strong\",{children:W},void 0,!1,void 0,this),Z(\"small\",{children:K||\"Enable this option.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"input\",{id:z,type:\"checkbox\",checked:J[0]===!0,onChange:(B)=>$(X,[B.currentTarget.checked])},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let Y=Z(\"label\",{for:z,children:[W,Q.required&&Z(\"span\",{class:\"required-mark\",children:\"required\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U;if(Q.choices){let B=J.filter((q)=>typeof q===\"string\");U=Z(\"select\",{id:z,multiple:Q.multiple,required:Q.required,value:Q.multiple?void 0:B[0]??\"\",onChange:(q)=>$(X,Q.multiple?Array.from(q.currentTarget.selectedOptions,(P)=>P.value):[q.currentTarget.value]),children:[!Q.multiple&&!Q.required&&Z(\"option\",{value:\"\",children:\"Use default or leave unset\"},void 0,!1,void 0,this),Q.choices.map((q)=>Z(\"option\",{value:q,selected:Q.multiple?B.includes(q):void 0,children:q},q,!1,void 0,this))]},void 0,!0,void 0,this)}else if(Q.multiple)U=Z(\"textarea\",{id:z,spellcheck:!1,placeholder:\"One value per line\",value:String(J[0]??\"\"),onInput:(B)=>$(X,[B.currentTarget.value])},void 0,!1,void 0,this);else if(Q.type===\"number\"){let B=J[0]??\"\";U=Z(\"input\",{id:z,type:\"number\",value:String(B),step:Q.integer?\"1\":\"any\",min:Q.min,max:Q.max,required:Q.required,onInput:(q)=>$(X,q.currentTarget.value!==\"\"?[Number(q.currentTarget.value)]:[q.currentTarget.value])},void 0,!1,void 0,this)}else{let B=J[0]??\"\";U=Z(\"input\",{id:z,type:\"text\",value:String(B),placeholder:Q.type===\"path\"?Q.pathKind===\"directory\"?\"./directory\":\"./file\":\"\",required:Q.required,onInput:(q)=>$(X,[q.currentTarget.value])},void 0,!1,void 0,this)}return Z(\"div\",{class:\"field\",children:[Y,U,K&&Z(\"div\",{class:\"field-hint\",children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function v6({command:X,onChange:$,values:Q}){let J=(K,W,Y)=>{let U=X.parameters.map((q,P)=>({index:P,parameter:q})).filter(({parameter:q})=>q.group===\"execution\"===K);if(!U.length)return null;let B=Z(\"div\",{class:\"parameter-grid\",children:U.map(({index:q,parameter:P})=>Z(y6,{index:q,onChange:$,parameter:P,values:Q[q]??[]},P.key,!1,void 0,this))},void 0,!1,void 0,this);return K?Z(\"details\",{class:\"form-section execution-controls\",children:[Z(\"summary\",{class:\"form-section-head\",children:[Z(\"strong\",{children:W},void 0,!1,void 0,this),Z(\"span\",{children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B]},void 0,!0,void 0,this):Z(\"section\",{class:\"form-section\",children:[Z(\"div\",{class:\"form-section-head\",children:[Z(\"strong\",{children:W},void 0,!1,void 0,this),Z(\"span\",{children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B]},void 0,!0,void 0,this)},z=X.parameters.filter((K)=>K.group!==\"execution\").length;return Z(\"div\",{class:\"parameter-fields\",id:\"parameterFields\",children:[J(!1,\"Pipeline inputs\",z+\" parameter\"+(z===1?\"\":\"s\")),z===0&&Z(\"p\",{class:\"form-empty\",children:\"This pipeline takes no inputs.\"},void 0,!1,void 0,this),J(!0,\"Execution controls\",\"Built into Tubeless · dry run, step selection, cache, concurrency\")]},void 0,!0,void 0,this)}function s4({api:X,commands:$,commandId:Q,onClose:J,onLaunched:z}){let[K,W]=C(Q??$[0]?.id??\"\"),Y=$.find((T)=>T.id===K),[U,B]=C([]),[q,P]=C(null),[M,G]=C(\"\"),[L,N]=C(!1),[H,O]=C(!1),_=Y0(null),R=Y0(0);if(l(()=>{W(Q??$[0]?.id??\"\")},[Q,$]),l(()=>{R.current+=1,B(Y?R6(Y):[]),P(null),G(\"\"),requestAnimationFrame(()=>_.current?.querySelector(\"input, select, textarea\")?.focus())},[Y]),l(()=>{if(Q===null)return;let T=(k)=>{if(k.key===\"Escape\"&&!L&&!H)J()};return document.addEventListener(\"keydown\",T),()=>document.removeEventListener(\"keydown\",T)},[Q,L,J,H]),Q===null)return null;let w=()=>{if(!L&&!H)J()},S=(T,k)=>{if(!Y)return;R.current+=1,B((v)=>v.map((I,h)=>{if(h===T)return k;let N0=Y.parameters[h];return Y.parameters[T]?.exclusive&&Y.parameters[T]?.multiple&&k.length>0&&N0?.exclusive&&N0.multiple?[]:I})),P(null)},m=(T,k)=>{let v=U[k]??[];if(!T.multiple||T.choices)return v;return String(v[0]??\"\").split(/\\r?\\n/).map((I)=>I.trim()).filter(Boolean).map((I)=>T.type===\"number\"?Number(I):I)},c=async()=>{if(!Y?.canPlan||H)return;let T=R.current;O(!0),G(\"\");try{let k=await X.previewPlan(Y.id,w6(Y,m));if(R.current===T)P(k)}catch(k){if(R.current===T)G(w0(k))}finally{O(!1)}},b=async(T)=>{if(T.preventDefault(),!Y||L)return;N(!0),G(\"\");try{z(await X.launch(Y.id,I6(Y,m)))}catch(k){G(w0(k))}finally{N(!1)}};return Z(\"div\",{class:\"modal-backdrop\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"launchTitle\",onClick:(T)=>T.target===T.currentTarget&&w(),children:Z(\"div\",{class:\"modal\",children:[Z(\"div\",{class:\"modal-head\",children:[Z(\"div\",{children:[Z(\"div\",{class:\"detail-kicker\",children:\"Configure pipeline\"},void 0,!1,void 0,this),Z(\"h2\",{id:\"launchTitle\",children:Y?.name||\"Run a pipeline\"},void 0,!1,void 0,this),Z(\"p\",{children:Y?u0(Y):\"Choose a declared pipeline and provide its inputs.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"button\",{class:\"close-button\",type:\"button\",\"aria-label\":\"Close\",onClick:w,children:\"×\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"form\",{class:\"launch-form\",onSubmit:b,onInvalidCapture:(T)=>{(T.target instanceof HTMLElement?T.target:null)?.closest(\"details\")?.setAttribute(\"open\",\"\")},children:[Z(\"div\",{class:\"field\",children:[Z(\"label\",{for:\"launchCommand\",children:\"Pipeline command\"},void 0,!1,void 0,this),Z(\"select\",{id:\"launchCommand\",value:K,onChange:(T)=>{R.current+=1,P(null),G(\"\"),W(T.currentTarget.value)},children:$.map((T)=>Z(\"option\",{value:T.id,children:T.name},T.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{ref:_,children:Y&&Z(v6,{command:Y,onChange:S,values:U},void 0,!1,void 0,this)},void 0,!1,void 0,this),q&&Z(\"div\",{class:\"plan-result\",\"aria-live\":\"polite\",children:Z(S4,{plan:q},void 0,!1,void 0,this)},void 0,!1,void 0,this),M&&Z(\"div\",{class:\"launch-error\",children:M},void 0,!1,void 0,this),Z(\"div\",{class:\"modal-actions\",children:[Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:w,children:\"Cancel\"},void 0,!1,void 0,this),Y?.canPlan&&Z(\"button\",{class:\"secondary-button\",type:\"button\",disabled:H||L,onClick:()=>void c(),children:H?\"Planning…\":\"Preview plan\"},void 0,!1,void 0,this),Z(\"button\",{class:\"primary-button\",type:\"submit\",disabled:L||H,children:L?\"Starting…\":\"Run\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function j0(X){if(Array.isArray(X))return X.map(j0);if(X!==null&&typeof X===\"object\")return Object.fromEntries(Object.entries(X).sort(([$],[Q])=>$<Q?-1:$>Q?1:0).map(([$,Q])=>[$,j0(Q)]));return X}var t4={dependencies:\"Required edges\",optionalDependencies:\"Optional edges\",skipAfterFailureOf:\"Failure gates\",dryRun:\"Dry-run policy\",runtimeSkipPossible:\"Skip policy\",outputValidated:\"Output validation\",cache:\"Cache settings\",agent:\"Agent capabilities and limits\",nestedPipeline:\"Child pipeline\",remote:\"Remote adapter\"};function e4(X,$){let Q=[],J=(W,Y,U,B)=>{let q=JSON.stringify(Y),P=JSON.stringify(U);if(q!==P)Q.push({field:W,before:q,after:P,...B?{stepId:B}:{}})};J(\"Implementation version\",X.identity.implementationVersion,$.identity.implementationVersion),J(\"Execution order\",X.steps.map(({id:W})=>W),$.steps.map(({id:W})=>W)),J(\"Metadata\",j0(X.metadata),j0($.metadata)),J(\"Targets\",X.targetIds,$.targetIds),J(\"Required finalizer steps\",X.requiredFinalizerStepIds,$.requiredFinalizerStepIds),J(\"Options validation\",X.optionsValidated,$.optionsValidated),J(\"Result validation\",X.resultValidated,$.resultValidated);let z=new Map(X.steps.map((W)=>[W.id,W])),K=new Map($.steps.map((W)=>[W.id,W]));for(let W of X.steps)if(!K.has(W.id))Q.push({stepId:W.id,field:\"Removed step\"});for(let W of $.steps){let Y=z.get(W.id);if(!Y){Q.push({stepId:W.id,field:\"Added step\"});continue}J(\"Metadata\",j0(Y.metadata),j0(W.metadata),W.id);for(let U of Object.keys(t4)){let B=U;J(t4[B],Y[B],W[B],W.id)}}return Q}function A1(X,$,Q){let[J,z]=C(0),K=s0(()=>z((U)=>U+1),[]),[W,Y]=C({key:\"\",request:Q,value:null,loading:!1});if(l(()=>{if(!X||!$){Y({key:\"\",request:Q,value:null,loading:!1});return}let U=!0;return Y((B)=>({owner:X,key:$,request:Q,value:B.owner===X&&B.key===$?B.value:null,loading:!0})),Q().then((B)=>{if(U)Y({owner:X,key:$,request:Q,value:B,loading:!1})}).catch((B)=>{if(U)Y((q)=>({...q,loading:!1,error:B instanceof Error?B.message:\"Could not load definition history.\"}))}),()=>{U=!1}},[X,$,Q,J]),!X||!$)return{value:null,loading:!1,reload:K};if(W.owner!==X||W.key!==$)return{value:null,loading:!0,reload:K};return{reload:K,value:W.value,loading:W.loading||W.request!==Q,error:W.request===Q?W.error:void 0}}function z0(X){return JSON.stringify([X.pipelineId,X.identity?.definitionId??null])}function X3(X){let $=X.identity;return`${X.pipelineId} · ${$?$.definitionId.slice(7,19):\"Legacy (identity not recorded)\"} · ${$?.implementationVersion??\"implementation unknown\"} · ${X.runCount} ${X.runCount===1?\"run\":\"runs\"}`}function f6({definitions:X,selected:$,candidates:Q,previous:J,definition:z,runs:K,comparison:W,onDefinition:Y,onCompare:U,onPage:B,onSelect:q}){if(!$)return null;let P=z.value?.snapshot,M=K.value,G=M?.runs??[],L=W.value?.snapshot&&P?e4(W.value.snapshot,P):void 0;return Z(\"section\",{class:\"sheet definition-history\",children:[Z(\"div\",{class:\"sheet-head\",children:Z(\"div\",{children:[Z(\"div\",{class:\"sheet-title\",children:\"Observed definitions\"},void 0,!1,void 0,this),Z(\"div\",{class:\"sheet-subtitle\",children:\"Graph fingerprints do not verify handler code. Implementation versions are supplied by the application.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{class:\"definition-body\",children:[Z(\"label\",{class:\"field\",children:[\"Definition\",\" \",Z(\"select\",{\"aria-label\":\"Definition\",value:z0($),onChange:(N)=>{Y(N.currentTarget.value)},children:X.map((N)=>Z(\"option\",{value:z0(N),children:X3(N)},z0(N),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.identity&&Z(\"p\",{class:\"definition-identity\",children:[\"Structural fingerprint: \",Z(\"code\",{children:$.identity.structuralFingerprint},void 0,!1,void 0,this),Z(\"br\",{},void 0,!1,void 0,this),\"Definition ID: \",Z(\"code\",{children:$.identity.definitionId},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P&&Z(j,{children:[Z(d0,{metadata:P.metadata},void 0,!1,void 0,this),Z(w2,{steps:P.steps},z0($),!1,void 0,this)]},void 0,!0,void 0,this),z.error&&Z(\"p\",{role:\"alert\",children:[z.error,\" \",Z(\"button\",{type:\"button\",onClick:z.reload,children:\"Retry definition\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!z.value&&z.loading&&Z(\"p\",{children:\"Loading definition…\"},void 0,!1,void 0,this),Z(\"details\",{children:[Z(\"summary\",{children:[\"Runs with this definition (\",$.runCount,\")\"]},void 0,!0,void 0,this),K.error&&Z(\"p\",{role:\"alert\",children:[K.error,\" \",Z(\"button\",{type:\"button\",onClick:K.reload,children:\"Retry runs\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K.loading&&Z(\"p\",{children:\"Loading runs…\"},void 0,!1,void 0,this),Z(\"ul\",{children:G.map((N)=>Z(\"li\",{children:Z(\"button\",{type:\"button\",onClick:()=>q(N.runId),children:[N.status,\" · \",new Date(N.startedAtMs).toLocaleString(),\" · \",N.runId]},void 0,!0,void 0,this)},N.runId,!1,void 0,this))},void 0,!1,void 0,this),M&&M.runCount>W0&&Z(\"div\",{class:\"confirm-actions\",children:[Z(\"button\",{class:\"secondary-button\",disabled:K.loading||!M.offset,onClick:()=>B(Math.max(0,M.offset-W0)),children:\"Previous\"},void 0,!1,void 0,this),Z(\"span\",{children:[M.offset+1,\"–\",M.offset+G.length,\" of \",M.runCount]},void 0,!0,void 0,this),Z(\"button\",{class:\"secondary-button\",disabled:K.loading||M.offset+W0>=M.runCount,onClick:()=>B(M.offset+W0),children:\"Next\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),J?Z(j,{children:[Z(\"label\",{class:\"field\",children:[\"Compare from\",\" \",Z(\"select\",{\"aria-label\":\"Compare from\",value:z0(J),onChange:(N)=>U(N.currentTarget.value),children:Q.map((N)=>Z(\"option\",{value:z0(N),children:X3(N)},z0(N),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"p\",{class:\"sheet-subtitle\",children:\"Changes from the comparison definition to the selected definition.\"},void 0,!1,void 0,this),W.error?Z(\"p\",{role:\"alert\",children:[W.error,\" \",Z(\"button\",{type:\"button\",onClick:W.reload,children:\"Retry comparison\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!W.value||!z.value?(W.loading||z.loading)&&Z(\"p\",{children:\"Loading comparison…\"},void 0,!1,void 0,this):L?L.length?Z(\"ul\",{class:\"definition-changes\",children:L.map((N,H)=>Z(\"li\",{children:[Z(\"strong\",{children:[N.stepId?`${N.stepId}: `:\"\",N.field]},void 0,!0,void 0,this),(N.before!==void 0||N.after!==void 0)&&Z(\"div\",{children:[Z(\"code\",{children:N.before??\"not supplied\"},void 0,!1,void 0,this),\" →\",\" \",Z(\"code\",{children:N.after??\"not supplied\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},H,!0,void 0,this))},void 0,!1,void 0,this):Z(\"p\",{children:\"No recorded semantic changes.\"},void 0,!1,void 0,this):Z(\"p\",{children:\"A complete comparison is unavailable: a legacy recording has no identity, or a definition snapshot exceeded recording limits.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z(\"p\",{class:\"sheet-subtitle\",children:\"Record another version of this pipeline to compare definitions.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function $3(X,$){let Q=$?.pipelineId,J=$?.identity?.definitionId,z=J?$?.runCount:$?.lastSeenAtMs,K=s0(async()=>{if(!X||!Q)throw Error(\"No definition selected.\");return X.loadDefinition(Q,J)},[X,Q,J,z]);return A1(X,$?z0($):\"\",K)}function h6(X,$,Q){let J=$?.pipelineId,z=$?.identity?.definitionId,K=$?[$.runCount,$.activeRuns,$.lastSeenAtMs].join(\":\"):\"\",W=s0(async()=>{if(!X||!J)throw Error(\"No definition selected.\");return X.loadDefinitionRuns(J,z,Q)},[X,J,z,K,Q]);return A1(X,$?z0($):\"\",W)}function Z3({definitions:X,api:$,onSelect:Q}){let[J,z]=C(\"\"),[K,W]=C(\"\"),[Y,U]=C(0),B=X.find((N)=>z0(N)===J)??X[0],q=X.filter((N)=>N.pipelineId===B?.pipelineId&&z0(N)!==(B&&z0(B))),P=q.find((N)=>z0(N)===K)??q[0],M=$3($,B),G=h6($,B,Y),L=$3($,P);return Z(f6,{definitions:X,selected:B,candidates:q,previous:P,definition:M,runs:G,comparison:L,onDefinition:(N)=>{z(N),W(\"\"),U(0)},onCompare:W,onPage:U,onSelect:Q},void 0,!1,void 0,this)}function V6({commandCount:X,snapshot:$}){let Q=$.completedRunCount+$.failedRunCount,J=Q?Math.round($.completedRunCount/Q*100):0,z=X||new Set($.definitions.map(({pipelineId:W})=>W)).size,K=[[\"Active now\",$.activeRunCount,$.activeRunCount?\"Live execution in progress\":\"No work in flight\"],[\"Recorded runs\",$.runCount,\"Append-only local history\"],[\"Success rate\",J+\"%\",Q+\" terminal runs\"],[\"Pipelines\",z,X?\"Available to configure\":\"Observed in run history\"]];return Z(j,{children:K.map(([W,Y,U])=>Z(\"article\",{class:\"metric\",children:[Z(\"div\",{class:\"metric-label\",children:W},void 0,!1,void 0,this),Z(\"div\",{class:\"metric-value\",children:Y},void 0,!1,void 0,this),Z(\"div\",{class:\"metric-note\",children:U},void 0,!1,void 0,this)]},W,!0,void 0,this))},void 0,!1,void 0,this)}function j6({api:X,onCleared:$,onClose:Q,snapshot:J}){let[z,K]=C(!1),[W,Y]=C(\"\"),U=Y0(null);l(()=>U.current?.focus(),[]),l(()=>{let G=(L)=>{if(L.key===\"Escape\"&&!z)Q()};return document.addEventListener(\"keydown\",G),()=>document.removeEventListener(\"keydown\",G)},[z,Q]);let{runCount:B,eventCount:q}=J,P=()=>{if(!z)Q()},M=async()=>{if(z)return;K(!0),Y(\"\");try{$((await X.clearHistory()).eventCount)}catch(G){Y(w0(G))}finally{K(!1)}};return Z(\"div\",{class:\"modal-backdrop\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"clearHistoryTitle\",onClick:(G)=>G.target===G.currentTarget&&P(),children:Z(\"div\",{class:\"modal confirm-modal\",children:[Z(\"div\",{class:\"modal-head\",children:[Z(\"div\",{children:[Z(\"div\",{class:\"detail-kicker\",children:\"Local maintenance\"},void 0,!1,void 0,this),Z(\"h2\",{id:\"clearHistoryTitle\",children:\"Clear run history?\"},void 0,!1,void 0,this),Z(\"p\",{children:\"This permanently resets the local studio history.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"button\",{class:\"close-button\",type:\"button\",\"aria-label\":\"Close\",onClick:P,children:\"×\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"confirm-body\",children:[Z(\"p\",{class:\"confirm-copy\",children:[\"Remove \",B,\" recorded run\",B===1?\"\":\"s\",\" and \",q,\" event\",q===1?\"\":\"s\",\" from this SQLite store.\",J.activeRunCount?` ${J.activeRunCount} recorded run${J.activeRunCount===1?\" is\":\"s are\"} still marked active; continue only if no external process is writing to this store.`:\"\"]},void 0,!0,void 0,this),Z(\"div\",{class:\"confirm-warning\",children:\"This cannot be undone. Pipeline definitions and execution remain unchanged; only recorded local events are removed.\"},void 0,!1,void 0,this),W&&Z(\"div\",{class:\"launch-error\",children:W},void 0,!1,void 0,this),Z(\"div\",{class:\"confirm-actions\",children:[Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:P,children:\"Cancel\"},void 0,!1,void 0,this),Z(\"button\",{ref:U,class:\"danger-button\",type:\"button\",disabled:z,onClick:()=>void M(),children:z?\"Clearing…\":\"Clear history\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var Q3={pipelines:{title:\"Pipelines\",lede:\"Choose a declared workflow to configure and run.\"},runs:{title:\"Runs\",lede:\"Live work and durable history in one place.\"},definitions:{title:\"Definitions\",lede:\"Recorded pipeline versions, their runs, and what changed between them.\"}},D6=typeof document>\"u\"?\"\":document.querySelector('meta[name=\"tubeless-studio-mount\"]')?.content??\"\",E6=C4(fetch,D6);function x6(X){return{className:`pulse${X?\"\":\" lost\"}`,label:X?\"Connected · local\":\"Connection lost\"}}function _1(X){return new URL(X).searchParams.get(\"run\")||null}function O1(X,$){let Q=new URL(X);return Q.searchParams.set(\"run\",$),Q.href}function m6(X,$){return X===\"definitions\"&&$&&$.definitions.length===0?\"runs\":X}function c6(X,$){return X??$[0]?.runId??null}function l6({status:X,href:$}){return Z(\"main\",{class:\"workspace\",children:Z(\"div\",{role:\"alert\",children:[Z(\"h1\",{children:X===401?\"Sign in to continue\":\"Access denied\"},void 0,!1,void 0,this),Z(\"p\",{children:X===401?\"Your access has expired. Open Studio again to sign in through your application.\":\"Your account cannot access this Studio. Open Studio again after your access is restored.\"},void 0,!1,void 0,this),Z(\"a\",{href:$,children:\"Open Studio again\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function p6({api:X=E6}){let $=A2(()=>new F1(X,{runId:_1(window.location.href)}),[X]),[Q,J]=C(()=>$.getState()),{accessDenied:z,connected:K,historyQuery:W,selection:Y,manualRefreshing:U,snapshot:B}=Q,q=Y.status===\"none\"?null:Y.runId,[P,M]=C([]),[G,L]=C(!1),[N,H]=C(\"runs\"),[O,_]=C(\"\"),R=N===\"runs\"?W.query:O,[w,S]=C(!1),[m,c]=C(!1),[b,T]=C(!1),[k,v]=C(null),[I,h]=C(!1),[N0,_0]=C(\"\"),[J3,K3]=C(Date.now);l(()=>{return J($.getState()),$.subscribe(J)},[$]),l(()=>()=>$.dispose(),[$]),l(()=>{if(z){M([]),S(!1),c(!1),v(null),h(!1),_0(\"\");return}X.loadCommands().then((X0)=>{if($.getState().accessDenied)return;if(M(X0),X0.length&&!_1(window.location.href))H(\"pipelines\")}).catch((X0)=>{if(!$.getState().accessDenied)_0(w0(X0))}).finally(()=>{if(!$.getState().accessDenied)L(!0)}),X.loadCapabilities().then((X0)=>{if($.getState().accessDenied)return;S(X0.canCancel),c(X0.canClearHistory)}).catch((X0)=>{if(!$.getState().accessDenied)_0(w0(X0))}),$.refresh();let g=setInterval(()=>{$.refresh(),K3(Date.now())},1200);return()=>clearInterval(g)},[z,X,$]),l(()=>{let g=()=>{$.setHistoryQuery({}),$.selectRun(_1(window.location.href)),H(\"runs\")};return window.addEventListener(\"popstate\",g),()=>window.removeEventListener(\"popstate\",g)},[$]),l(()=>{if(!N0)return;let g=setTimeout(()=>_0(\"\"),4200);return()=>clearTimeout(g)},[N0]);let U2=B?.runs??[];l(()=>{let g=m6(N,B);if(g!==N)H(g)},[B,N]),l(()=>{if(!B||!G||N!==\"runs\"||q)return;let g=c6(q,U2);if(!g)return;window.history.replaceState(null,\"\",O1(window.location.href,g)),$.selectRun(g)},[G,$,U2,q,B,N]);let D0=(g)=>{if(!$.getState().accessDenied)_0(g)},j2=(g)=>{if($.getState().accessDenied)return;if(g!==q)window.history.pushState(null,\"\",O1(window.location.href,g));$.selectRun(g),H(\"runs\")},W3=async(g)=>{try{await navigator.clipboard.writeText(O1(window.location.href,g)),D0(\"Run link copied\")}catch{D0(\"Could not copy run link. Copy the address from your browser instead.\")}},Y3=async(g)=>{if($.getState().accessDenied||!w||b)return;T(!0);try{await X.cancelRun(g),D0(\"Run cancelled · \"+v0(g)),$.invalidate({delayMs:80})}catch(X0){D0(w0(X0))}finally{T(!1)}},B3=P.filter((g)=>!R||g.name.toLowerCase().includes(R.toLowerCase())||u0(g).toLowerCase().includes(R.toLowerCase())),i0=N===\"pipelines\",D2=B?.definitions??[];if(z)return Z(l6,{status:z,href:window.location.href},void 0,!1,void 0,this);let T1=x6(K);return Z(j,{children:[Z(\"div\",{class:\"shell\",children:[Z(\"aside\",{class:\"rail\",children:[Z(\"div\",{class:\"brand\",children:[Z(\"div\",{class:\"mark\",\"aria-hidden\":\"true\",children:Z(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 18 18\",fill:\"none\",children:[Z(\"path\",{d:\"M3 4.5h6a3 3 0 0 1 3 3v6\",stroke:\"#f7f8f3\",strokeWidth:\"1.5\"},void 0,!1,void 0,this),Z(\"circle\",{cx:\"3\",cy:\"4.5\",r:\"2\",fill:\"#7396ff\"},void 0,!1,void 0,this),Z(\"circle\",{cx:\"12\",cy:\"13.5\",r:\"2\",fill:\"#63d297\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{class:\"brand-copy\",children:[Z(\"strong\",{children:\"Tubeless\"},void 0,!1,void 0,this),Z(\"small\",{children:\"Local studio\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"rail-label\",children:\"Workspace\"},void 0,!1,void 0,this),Z(\"nav\",{class:\"nav\",\"aria-label\":\"Studio sections\",children:[P.length>0&&Z(\"button\",{class:i0?\"active\":\"\",type:\"button\",title:\"Pipelines\",onClick:()=>H(\"pipelines\"),children:[Z(\"svg\",{viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",children:[Z(\"path\",{d:\"M4 5h7M4 10h12M9 15h7\"},void 0,!1,void 0,this),Z(\"circle\",{cx:\"14.5\",cy:\"5\",r:\"1.5\"},void 0,!1,void 0,this),Z(\"circle\",{cx:\"5.5\",cy:\"15\",r:\"1.5\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{children:\"Pipelines\"},void 0,!1,void 0,this),Z(\"b\",{class:\"nav-count\",children:P.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"button\",{class:N===\"runs\"?\"active\":\"\",type:\"button\",title:\"Runs\",onClick:()=>H(\"runs\"),children:[Z(\"svg\",{viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",children:[Z(\"path\",{d:\"M10 3v4l2.5 1.5M17 10a7 7 0 1 1-2.05-4.95\"},void 0,!1,void 0,this),Z(\"path\",{d:\"M14.5 2.8v3.5H18\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{children:\"Runs\"},void 0,!1,void 0,this),Z(\"b\",{class:\"nav-count\",children:B?.runCount??0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),D2.length>0&&Z(\"button\",{class:N===\"definitions\"?\"active\":\"\",type:\"button\",title:\"Definitions\",onClick:()=>H(\"definitions\"),children:[Z(\"svg\",{viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",children:[Z(\"rect\",{x:\"3\",y:\"3\",width:\"6\",height:\"6\",rx:\"1.5\"},void 0,!1,void 0,this),Z(\"rect\",{x:\"11\",y:\"11\",width:\"6\",height:\"6\",rx:\"1.5\"},void 0,!1,void 0,this),Z(\"path\",{d:\"M9 6h3a2 2 0 0 1 2 2v3\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"span\",{children:\"Definitions\"},void 0,!1,void 0,this),Z(\"b\",{class:\"nav-count\",children:D2.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"rail-foot\",children:[Z(\"div\",{class:\"connection\",children:[Z(\"i\",{class:T1.className},void 0,!1,void 0,this),Z(\"span\",{children:T1.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"database\",children:\"append-only SQLite\"},void 0,!1,void 0,this),m&&Z(\"button\",{class:\"rail-action\",id:\"clearHistoryButton\",type:\"button\",\"aria-label\":\"Clear history\",disabled:!B?.runCount,title:B?.activeRunCount?\"Clear history, including runs left active by an interrupted process\":\"Clear history\",onClick:()=>h(!0),children:[Z(\"svg\",{viewBox:\"0 0 16 16\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.4\",\"aria-hidden\":\"true\",children:Z(\"path\",{d:\"M3 4.5h10M6 2.5h4M5 4.5l.5 9h5l.5-9M7 7v4M9 7v4\"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"span\",{children:\"Clear history…\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(\"main\",{class:\"workspace\",children:[Z(\"header\",{class:\"topbar\",children:[Z(\"div\",{children:[Z(\"h1\",{children:Q3[N].title},void 0,!1,void 0,this),Z(\"p\",{class:\"lede\",children:Q3[N].lede},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"toolbar\",children:[N!==\"definitions\"&&Z(\"input\",{class:\"search\",type:\"search\",value:R,placeholder:i0?\"Filter pipelines\":\"Filter runs or IDs\",\"aria-label\":\"Filter\",onInput:(g)=>{let X0=g.currentTarget.value.trim();if(i0)_(X0);else $.setHistoryQuery({query:X0})}},void 0,!1,void 0,this),P.length>0&&Z(\"button\",{class:\"primary-button\",onClick:()=>v(P[0]?.id??\"\"),children:\"Run pipeline\"},void 0,!1,void 0,this),Z(\"button\",{class:`icon-button${U?\" spinning\":\"\"}`,type:\"button\",title:\"Refresh now\",\"aria-label\":\"Refresh now\",onClick:()=>$.refresh(!0),children:Z(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 20 20\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",children:[Z(\"path\",{d:\"M16.5 7A7 7 0 1 0 17 11\"},void 0,!1,void 0,this),Z(\"path\",{d:\"M16.5 3v4h-4\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),B&&Z(j,{children:[i0&&Z(\"section\",{class:\"metrics\",children:Z(V6,{commandCount:P.length,snapshot:B},void 0,!1,void 0,this)},void 0,!1,void 0,this),i0&&Z(w4,{commands:B3,onConfigure:v},void 0,!1,void 0,this),N===\"runs\"&&Z(n4,{api:X,offset:B.offset,matchingRootCount:B.matchingRootCount,onPage:(g)=>$.setHistoryQuery({...W,offset:g}),canCancel:w,cancelling:b,liveRunIds:B.liveRunIds??[],nowMs:J3,onCancel:(g)=>void Y3(g),onCopyLink:(g)=>void W3(g),onSelect:j2,roots:U2,selection:Y,latestRunId:U2[0]?.runId,totalRunCount:B.runCount},void 0,!1,void 0,this),Z(\"div\",{hidden:N!==\"definitions\",children:Z(Z3,{definitions:D2,api:X,onSelect:j2},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),k!==null&&Z(s4,{api:X,commands:P,commandId:k,onClose:()=>v(null),onLaunched:(g)=>{if($.getState().accessDenied)return;j2(g),$.setHistoryQuery({}),v(null),D0(\"Run accepted · \"+v0(g)),$.invalidate({delayMs:80})}},void 0,!1,void 0,this),I&&B&&Z(j6,{api:X,snapshot:B,onClose:()=>h(!1),onCleared:(g)=>{if($.getState().accessDenied)return;h(!1),D0(\"Cleared \"+g+\" recorded event\"+(g===1?\"\":\"s\")),$.invalidate({resetHistory:!0})}},void 0,!1,void 0,this),N0&&Z(\"div\",{class:\"toast\",role:\"status\",children:N0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function z3(){let X=document.querySelector(\"#studio-root\");if(!(X instanceof HTMLElement))throw Error(\"Missing #studio-root\");V1(Z(p6,{},void 0,!1,void 0,this),X)}z3();\n";