tubeless 0.3.4 → 0.3.6

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.
@@ -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 x,C2,Y4,_0,_2,H$,R2,G$,k2,x$,E$,B4,P$={},M$=[],q4=/^m(i|n|o|s|text|space)$/,m$=Array.isArray,w2=M$.slice,g0=Object.assign;function L$($){$&&$.parentNode&&$.remove()}function N$($,X,Q,K,J){var W={type:$,props:X,key:Q,ref:K,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:J||++C2,__i:-1,__u:0};return!J&&x.vnode&&x.vnode(W),W}function j($){return $.children}function F$($,X){this.props=$,this.context=X,this.__g=0}function T0($,X){if(X==null)return $.__?T0($.__,$.__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:T0($)}function I2($){if(($=$.__)&&$.__c&&!$.props.__P)return $.__e=null,$.__k.some(function(X){return X&&($.__e=X.__e)}),I2($)}function T2($){(8&$.__g||!($.__g|=8)||!_0.push($)||H$++)&&_2==x.debounceRendering||((_2=x.debounceRendering)||queueMicrotask)(U4)}function U4(){var $,X,Q,K,J,W,z,q,G;try{for(X=1;_0.length;)_0.length>X&&_0.sort(R2),$=_0.shift(),X=_0.length,8&$.__g&&(K=void 0,J=void 0,W=(J=(Q=$).__v).__e,z=[],q=[],(G=Q.__P)&&((K=g0({constructor:void 0},J)).__v=J.__v+1,x.vnode&&x.vnode(K),c$(G,K,J,Q.__n,G.namespaceURI,32&J.__u?[W]:null,z,W||T0(J),32&J.__u,q),K.__v=J.__v,K.__.__k[K.__i]=K,v2(z,K,q),J.__=J.__e=null,K.__e!=W&&I2(K)))}finally{_0.length=H$=0}}function S2($,X,Q,K,J,W,z,q,G,B,U){var F,P,M,A,Y,H,T=K.__k||M$,O=X.length;for(G=G4(Q,X,T,G,O),F=0;F<O;F++)(M=Q.__k[F])!=null&&(P=~M.__i&&T[M.__i]||P$,M.__i=F,H=c$($,M,P,J,W,z,q,G,B,U),A=M.__e,(P.ref!=M.ref||8&P.__u)&&(P.ref&&l$(P.ref,null,M,P),M.ref&&U.push(M.ref,M.__c||A,M)),Y=Y||A,4&M.__u?(G=g2(M,G,$,!P.__v),P.__e&&(P.__e=null)):typeof M.type==\"function\"&&H!==void 0?G=H:A&&(G=A.nextSibling),M.__u&=-7);return Q.__e=Y,G}function G4($,X,Q,K,J){var W,z,q,G,B,U,F,P,M,A,Y=Q.length,H=Y,T=0,O=!1,_=$.__k=Array(J);for(W=0;W<J;W++)(z=X[W])!=null&&typeof z!=\"boolean\"&&typeof z!=\"function\"?(typeof z!=\"object\"||z.constructor==String?z=_[W]=N$(null,z):m$(z)?z=_[W]=N$(j,{children:z}):z.constructor===void 0&&z.__b?z=_[W]=N$(z.type,z.props,z.key,z.ref,z.__v):_[W]=z,G=W+T,z.__=$,z.__b=$.__b+1,q=null,~(B=z.__i=N4(z,Q,G,H))&&(H--,(q=Q[B])&&(q.__u|=2)),q&&q.__v?(z.__u|=2,B==G-1?T--:B==G+1?T++:B!=G&&(B>G?T--:T++,O=!0)):(~B||(J>Y?T--:J<Y&&T++),typeof z.type!=\"function\"&&(z.__u|=4))):_[W]=null;if(O){for(U=[],F=[],W=0;W<J;W++)if((z=_[W])&&2&z.__u){for(P=0,M=U.length;P<M;)U[A=P+M>>1]<z.__i?P=A+1:M=A;U[P]=z.__i,F[W]=P+1}for(T=U.length;W--;)F[W]&&(F[W]==T?T--:_[W].__u|=4)}if(H)for(W=0;W<Y;W++)!(q=Q[W])||2&q.__u||(q.__e==K&&(K=T0(q)),p$(q,q));return K}function g2($,X,Q,K){var J,W,z;if(typeof $.type==\"function\"){if($.props.__P)return X;if(J=$.__k)for(W=0;W<J.length;W++)J[W]&&(J[W].__=$,X=g2(J[W],X,Q,!1));return X}for(X&&!X.parentNode&&(X=T0($))&&!X.parentNode&&(X=null),z=X;z&&z.nodeType==8;)z=z.nextSibling;for($.__e!=z&&(!K&&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 N4($,X,Q,K){var J,W,z,q=$.key,G=$.type,B=X[Q],U=B&&!(2&B.__u);if(B===null&&q==null||U&&q==B.key&&G==B.type)return Q;if(K>(U?1:0)){for(J=Q-1,W=Q+1;J>=0||W<X.length;)if((B=X[z=J>=0?J--:W++])&&!(2&B.__u)&&q==B.key&&G==B.type)return z}return-1}function b2($,X,Q){Q==null&&(Q=\"\"),X[0]==\"-\"?$.setProperty(X,Q):$[X]=Q}function U$($,X,Q,K,J){var W,z;$:if(X==\"style\")if(typeof Q==\"string\")$.style.cssText=Q;else{if(typeof K==\"string\"&&($.style.cssText=K=\"\"),K)for(X in K)Q&&X in Q||b2($.style,X,\"\");if(Q)for(X in Q)K&&Q[X]==K[X]||b2($.style,X,Q[X])}else if(X[0]==\"o\"&&X[1]==\"n\")($.__e||($.__e={}))[X]=Q,Q&&K||(z=E$[X]||(E$[X]=F4(X)),($.__a||($.__a={}))[X]=x$,W=X!=(X=X.replace(k2,\"$1\")),(X=X.slice(2))[0]<\"a\"&&(X=X.toLowerCase()),Q?$.addEventListener(X,z,W):$.removeEventListener(X,z,W));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(q){}typeof Q==\"function\"||(Q==null||Q===!1&&X[4]!=\"-\"?$.removeAttribute(X):$.setAttribute(X,X==\"popover\"&&Q==1?\"\":Q))}}function F4($){return function(X){if(this.__e){var Q=this.__e[$];if(X[G$]==null)X[G$]=x$++;else if(X[G$]<this.__a[$])return;return Q(x.event?x.event(X):X)}}}function c$($,X,Q,K,J,W,z,q,G,B){var U,F,P,M,A,Y,H,T,O,_,w,I,E,c,C,b,k,f,S,h,d=X.type;if(X.constructor!==void 0)return null;if(128&Q.__u&&(G=32&Q.__u,U=Q.__c.__z)){if(X.__u|=G,F=W=[],U.nodeType==8)for(P=1,M=U.nextSibling;M;M=M.nextSibling){if(M.nodeType==8){if(M.data.startsWith(\"$s\"))P++;else if(M.data.startsWith(\"/$s\")&&!--P)break}W.push(M)}else W.push(U);q=W[0]}(U=x.__b)&&U(X);$:if(typeof d==\"function\"){A=z.length;try{if(_=X.props,w=(U=d.prototype)&&U.render,I=(U=d.contextType)&&K[U.__c],E=U?I?I.props.value:U.__:K,Q.__c?2&(Y=X.__c=Q.__c).__g&&(Y.__g|=1):(w?X.__c=Y=new d(_,E):(X.__c=Y=new F$(_,E),Y.constructor=d,Y.render=P4),I&&I.sub(Y),Y.state||(Y.state={}),Y.__n=K,Y.__g|=8,Y.__h=[],Y.__k=[]),w&&(Y.__s||(Y.__s=Y.state),d.getDerivedStateFromProps&&(Y.__s==Y.state&&(Y.__s=g0({},Y.__s)),g0(Y.__s,d.getDerivedStateFromProps(_,Y.__s)))),H=Y.props,T=Y.state,Y.__v=X,Q.__c){if(w&&!d.getDerivedStateFromProps&&_!==H&&Y.componentWillReceiveProps&&Y.componentWillReceiveProps(_,E),X.__v==Q.__v&&!(8&Y.__g)||!(4&Y.__g)&&Y.shouldComponentUpdate&&Y.shouldComponentUpdate(_,Y.__s,E)===!1){X.__v!=Q.__v&&(Y.props=_,Y.state=Y.__s,Y.__g&=-9),X.__e=Q.__e,X.__k=Q.__k,X.__k.some(function(o){o&&(o.__=X)}),M$.push.apply(Y.__h,Y.__k),Y.__k=[],Y.__h.length&&z.push(Y),q=T0(Q);break $}Y.componentWillUpdate&&Y.componentWillUpdate(_,Y.__s,E),w&&Y.componentDidUpdate&&Y.__h.push(function(){Y.componentDidUpdate(H,T,O)})}else w&&!d.getDerivedStateFromProps&&Y.componentWillMount&&Y.componentWillMount(),w&&Y.componentDidMount&&Y.__h.push(Y.componentDidMount);if(Y.context=E,Y.props=_,Y.__P=$,Y.__g&=-5,c=x.__r,C=0,w)Y.state=Y.__s,Y.__g&=-9,c&&c(X),U=Y.render(Y.props,Y.state,Y.context),M$.push.apply(Y.__h,Y.__k),Y.__k=[];else do Y.__g&=-9,c&&c(X),U=Y.render(Y.props,Y.state,Y.context),Y.state=Y.__s;while(8&Y.__g&&++C<25);Y.state=Y.__s,Y.getChildContext&&(K=g0({},K,Y.getChildContext())),w&&Q.__c&&Y.getSnapshotBeforeUpdate&&(O=Y.getSnapshotBeforeUpdate(H,T)),b=U&&U.type===j&&U.key==null?U.props.children:U,_.__P&&(U=q,J=($=_.__P).namespaceURI,G=W=null,Q.props&&Q.props.__P!=$&&(Q.__k.some(function(o){o&&p$(o,o)}),Q.__k=null),q=Q.__k?T0(Q,0):null),q=S2($,m$(b)?b:[b],X,Q,K,J,W,z,q,G,B),_.__P&&(X.__e=null,q=U),X.__u&=-161,128&Q.__u&&(Y.__z=null),F&&F.some(L$),Y.__h.length&&z.push(Y),1&Y.__g&&(Y.__g&=-4)}catch(o){if(z.length=A,X.__v=null,G||W)if(o.then){if(k=0,X.__u|=G?160:128,W){for(~(S=W.indexOf(q||void 0))||(S=W.length);(h=W[S-1])&&h.nodeType==8;)S--;for(;S<W.length;S++)if(h=W[S]){if(W[S]=null,h.nodeType==8){if(h.data.startsWith(\"$s\"))k++||(f=h);else if(k&&h.data.startsWith(\"/$s\")&&!--k){q=h;break}}else if(!k)break}}if(!f){for(;q&&q.nodeType==8&&q.nextSibling;)q=q.nextSibling;f=q}X.__c.__z||(X.__c.__z=f),X.__e=q}else W&&W.some(L$);else X.__e=Q.__e;X.__k||(X.__k=Q.__k||[]),o.then||y2(X),x.__e(o,X,Q)}}else q=X.__e=H4(Q.__e,X,Q,K,J,W,z,G,B,$);return(U=x.diffed)&&U(X),128&X.__u?void 0:q}function y2($){$&&($.__c&&($.__c.__g|=4),$.__k&&$.__k.some(y2))}function v2($,X,Q){for(var K=0;K<Q.length;)l$(Q[K++],Q[K++],Q[K++]);x.__c&&x.__c(X,$),$.some(function(J){try{$=J.__h,J.__h=[],$.some(function(W){W.call(J)})}catch(W){x.__e(W,J.__v)}})}function H4($,X,Q,K,J,W,z,q,G,B){var U,F,P,M,A,Y,H,T,O,_=Q.props||P$,w=X.props,I=X.type;if(I==\"svg\"?J=\"http://www.w3.org/2000/svg\":I==\"math\"?J=\"http://www.w3.org/1998/Math/MathML\":J||(J=\"http://www.w3.org/1999/xhtml\"),W){for(U=0;U<W.length;U++)if((A=W[U])&&(I?A.localName==I:A.nodeType==3)){$=A,W[U]=null;break}}if(!$){if(T=B.ownerDocument||document,!I)return T.createTextNode(w);$=T.createElementNS(J,I,w.is&&w),q&&(x.__m&&x.__m(X,W),q=!1),W=null}if(I){if(B=I==\"template\"?$.content:$,W=I==\"textarea\"&&w.defaultValue!=null?null:W&&w2.call(B.childNodes),!q&&W)for(_={},U=0;U<$.attributes.length;U++)_[(A=$.attributes[U]).name]=A.value;for(U in _)A=_[U],U==\"dangerouslySetInnerHTML\"?P=A:U==\"children\"||(U in w)||U==\"value\"&&(\"defaultValue\"in w)||U==\"checked\"&&(\"defaultChecked\"in w)||U$($,U,null,A,J);for(U in O=1&Q.__u,w)A=w[U],U==\"children\"?M=A:U==\"dangerouslySetInnerHTML\"?F=A:U==\"value\"?Y=A:U==\"checked\"?H=A:q&&typeof A!=\"function\"||!(_[U]!==A||O&&A!=null)||U$($,U,A,_[U],J);F?(q||P&&(F.__html==P.__html||F.__html==$.innerHTML)||($.innerHTML=F.__html),X.__k=[]):(P&&($.textContent=\"\"),(I==\"foreignObject\"||J==\"http://www.w3.org/1998/Math/MathML\"&&q4.test(I))&&(J=\"http://www.w3.org/1999/xhtml\"),S2(B,m$(M)?M:[M],X,Q,K,J,W,z,W?W[0]:Q.__k&&T0(Q,0),q,G),W&&W.some(L$)),q&&I!=\"textarea\"||(U=\"value\",I==\"progress\"&&Y==null?$.removeAttribute(U):Y==null||Y===$[U]&&(I!=\"progress\"||Y)||U$($,U,Y,_[U],J),U=\"checked\",H!=null&&H!=$[U]&&U$($,U,H,_[U],J))}else _===w||q&&$.data==w||($.data=w);return $}function l$($,X,Q,K){try{typeof $==\"function\"?X?X.__x=$(X)||1:K&&(K=K.__c||K.__e)&&(X=K.__x)&&(K.__x=null,typeof X==\"function\"?X():$(null)):$.current=X}catch(J){x.__e(J,Q)}}function p$($,X,Q){var K,J;if(x.unmount&&x.unmount($),!(K=$.ref)||K.current&&K.current!=$.__e||l$(K,null,X,$),K=$.__c){if(K.componentWillUnmount)try{K.componentWillUnmount()}catch(W){x.__e(W,X)}K.__P=K.__n=null}if(K=$.__k)for(J=0;J<K.length;J++)K[J]&&p$(K[J],X,typeof $.type!=\"function\"||Q&&!$.props.__P);(K=$.__e)&&(Q||L$(K),K.__e&&(K.__e=null)),$.__e=$.__c=$.__=null}function P4($,X,Q){return this.constructor($,Q)}function f2($,X){var Q,K,J,W;x.__&&x.__($,X),X.nodeType==9&&(X=X.documentElement),K=(Q=$&&32&$.__u)?null:X.__k,X.__k=N$(j,{children:[$]}),J=[],W=[],c$(X,X.__k,K||P$,P$,X.namespaceURI,K?null:X.firstChild?w2.call(X.childNodes):null,J,K?K.__e:X.firstChild,Q,W),v2(J,X.__k,W),X.__k.props.children=null}x={__e:function($,X,Q,K){for(var J,W,z;X=X.__;)if((J=X.__c)&&!(1&J.__g)){J.__g|=4;try{if((W=J.constructor)&&W.getDerivedStateFromError&&(J.setState(W.getDerivedStateFromError($)),z=8&J.__g),J.componentDidCatch&&(J.componentDidCatch($,K||{}),z=8&J.__g),z)return void(J.__g|=2)}catch(q){$=q,z=0}}throw H$=0,$}},C2=0,Y4=function($){return $!=null&&$.constructor===void 0},F$.prototype.setState=function($,X){var Q=this.__s;Q&&Q!=this.state||(Q=this.__s=g0({},this.state)),typeof $==\"function\"&&($=$(g0({},Q),this.props)),$&&(g0(Q,$),this.__v&&(X&&this.__k.push(X),T2(this)))},F$.prototype.forceUpdate=function($){this.__v&&(this.__g|=4,$&&this.__h.push($),T2(this))},F$.prototype.render=j,_0=[],H$=0,R2=function($,X){return $.__v.__b-X.__v.__b},G$=Symbol(),k2=/(PointerCapture)$|Capture$/i,x$=0,E$={},B4=0;var r0,i,u$,h2,d$=Object.is,a0=0,p2=[],o$=[],u=x,V2=u.__b,j2=u.__r,D2=u.diffed,E2=u.__c,x2=u.unmount,m2=u.__;function r$($,X){u.__h&&u.__h(i,$,a0||X),a0=0;var Q=i.__H||(i.__H={__:[],__h:[]});return $>=Q.__.length&&Q.__.push({}),Q.__[$]}function R($){return a0=1,M4(d2,$)}function M4($,X,Q){var K=r$(r0++,2);if(K.t=$,!K.__c&&(K.__=[Q?Q(X):d2(void 0,X),function(W){var z=K.__N?K.__N[0]:K.__[0],q=K.t(z,W);d$(z,q)||(K.__N=[q,K.__[1]],K.__c.setState({}))}],K.__c=i,!i.__f)){i.__f=!0;var J=i.shouldComponentUpdate;i.shouldComponentUpdate=function(W,z,q){var G=this.__H;if(!G)return!0;var B=!1,U=this.props!=W;if(G.__.some(function(P){P.__N&&(B=!0,d$(P.__[0],P.__N[0])||(U=!0))}),J){var F=J.call(this,W,z,q);return B?F||U:F}return!B||U}}return K.__}function l($,X){var Q=r$(r0++,3);!u.__s&&u2(Q.__H,X)&&(Q.__P=!0,Q.__=$,Q.u=X,i.__H.__h.push(Q))}function q0($){return a0=5,A$(function(){return{current:$}},[])}function A$($,X){var Q=r$(r0++,7);return u2(Q.__H,X)&&(Q.__=$(),Q.__H=X),Q.__}function n0($,X){return a0=8,A$(function(){return $},X)}function L4(){var $;do{for(;$=o$.shift();)try{i0($)}catch(Q){u.__e(Q,{__:($=$.__P)&&$.__v})}for(;$=p2.shift();){var X=$.__H;if($.__P&&X)try{X.__h.some(i0),X.__h.some(i$),X.__h=[]}catch(Q){X.__h=[],u.__e(Q,$.__v)}}}while(o$.length)}u.__b=function($){i=null,V2&&V2($)},u.__=function($,X){$&&X.__k&&X.__k.__m&&($.__m=X.__k.__m),m2&&m2($,X)},u.__r=function($){j2&&j2($),r0=0;var X=(i=$.__c).__H;X&&(u$==i?i.__h=[]:(X.__h.some(i0),X.__h.some(i$),r0=0),X.__h=[],X.__.some(function(Q){Q.__N&&(Q.__=Q.__N),Q.u=Q.__N=void 0})),u$=i},u.diffed=function($){D2&&D2($);var X=$.__c;X&&X.__H&&(X.__H.__h.length&&l2(p2.push(X)),X.__H.__.some(function(Q){Q.u&&(Q.__H=Q.u)})),u$=i=null},u.__c=function($,X){X.some(function(Q){try{Q.__h.some(i0),Q.__h=Q.__h.filter(function(K){return!K.__||i$(K)})}catch(K){X.some(function(J){J.__h&&(J.__h=[])}),X=[],u.__e(K,Q.__v)}}),E2&&E2($,X)},u.unmount=function($){x2&&x2($);var X,Q,K=$.__c;K&&K.__H&&(K.__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,l2(o$.push(J))}else i0(J)}catch(W){X=W}}),K.__H=void 0,X&&u.__e(X,K.__v))};var c2=typeof requestAnimationFrame==\"function\";function A4($){var X,Q=function(){clearTimeout(K),c2&&cancelAnimationFrame(X),setTimeout($)},K=setTimeout(Q,35);c2&&(X=requestAnimationFrame(Q))}function l2($){$!=1&&h2==u.requestAnimationFrame||((h2=u.requestAnimationFrame)||A4)(L4)}function i0($){var X=i,Q=$.__c;typeof Q==\"function\"&&($.__c=void 0,Q()),i=X}function i$($){var X=i;$.__c=$.__(),i=X}function u2($,X){return!$||$.length!=X.length||X.some(function(Q,K){return!d$(Q,$[K])})}function d2($,X){return typeof X==\"function\"?X($):X}function a$($){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 O4=0;function Z($,X,Q,K,J,W){X||(X={});var z,q,G=X;if(\"ref\"in G&&typeof $!=\"function\")for(q in G={},X)q==\"ref\"?z=X[q]:G[q]=X[q];var B={type:$,props:G,key:Q,ref:z,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--O4,__i:-1,__u:0};return(J||W)&&(B.__source=J,B.__self=W),x.vnode&&x.vnode(B),B}function O$({artifacts:$,stepId:X}){let[Q,K]=R(\"all\"),J=$.filter((z)=>a$(z.artifact)),W=J.length>0&&J.length<$.length;return Z(j,{children:[W&&Z(\"label\",{class:\"artifact-filter\",children:[\"Artifacts for \",X,\" \",Z(\"select\",{value:Q,onChange:(z)=>K(z.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((z,q)=>{let G=a$(z.artifact);if(W&&(Q===\"cache\"&&!G||Q===\"application\"&&G))return null;let B=G?new Date(G.createdAtMs):void 0;return Z(\"details\",{class:\"artifact-detail\",children:[Z(\"summary\",{children:[G?\"Cached output \":z.preview?\"Preview \":\"Artifact \",z.operation,!G&&`: ${z.artifact.id||z.artifact.uri}`]},void 0,!0,void 0,this),G&&Z(\"div\",{class:\"artifact-info\",children:[Z(\"div\",{children:[\"Created:\",\" \",B&&Number.isFinite(B.getTime())?B.toISOString():String(G.createdAtMs)]},void 0,!0,void 0,this),Z(\"div\",{children:[\"Age at \",z.operation,\": \",G.ageMs,\" ms\"]},void 0,!0,void 0,this),z.artifact.uri&&Z(\"div\",{children:[\"Location: \",z.artifact.uri]},void 0,!0,void 0,this),z.artifact.byteSize!==void 0&&Z(\"div\",{children:[\"Size: \",z.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),G?Z(\"details\",{class:\"artifact-receipt\",children:[Z(\"summary\",{children:\"Receipt metadata\"},void 0,!1,void 0,this),Z(\"pre\",{children:JSON.stringify(z.artifact,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z(\"pre\",{children:JSON.stringify(z.artifact,null,2)},void 0,!1,void 0,this)]},q,!0,void 0,this)})]},void 0,!0,void 0,this)}var y0=($)=>$.length>24?$.slice(0,12)+\"…\"+$.slice(-7):$;function H0($){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 _4($){return $===\"completed\"?\"✓\":$===\"skipped\"?\"×\":$===\"cancelled\"?\"■\":$===\"failed\"?\"!\":$===\"planned\"?\"…\":\"\"}function z0({value:$,outputSource:X}){return Z(\"span\",{class:`status ${$}`,children:[Z(\"i\",{class:\"status-mark\",\"aria-hidden\":\"true\",children:_4($)},void 0,!1,void 0,this),$,X===\"override\"&&\" (overridden)\",X===\"cache\"&&\" (cached)\"]},void 0,!0,void 0,this)}function s0({children:$,label:X,secondary:Q,stepIds:K}){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),K?.map((J)=>Z(\"code\",{children:J},J,!1,void 0,this)),$]},void 0,!0,void 0,this)}function T4({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)}var b4=($)=>$===\"failed\"||$===\"cancelled\";function C4($,X){if($.status!==\"skipped\"||!$.skipReason)return;let Q=(K)=>X.find((J)=>J.id===K)?.status;switch($.skipReason){case\"failed-dependency\":{let K=$.skipAfterFailureOf?.find((J)=>b4(Q(J)));return K?`Skipped because failure gate “${K}” ${Q(K)}.`:\"Skipped because a failure gate failed or was cancelled.\"}case\"unmet-dependency\":{let K=$.dependencies?.find((J)=>{let W=X.find((z)=>z.id===J);return W&&W.status!==\"completed\"&&!(W.status===\"skipped\"&&W.skipReason===\"policy\")});return K?`Skipped because required input “${K}” was ${Q(K)}.`:\"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 _$({step:$,steps:X=[]}){let Q=$.progress?.total,K=Q?Math.max(0,Math.min(100,($.progress?.completed??0)/Q*100)):$.status===\"completed\"?100:18,J=$.nestedPipeline,W=J?J.stepCount??J.stepIds.length:0,z=J&&J.stepIds.length<W?J.stepIds.length+\" of \"+W+\" declared steps\":W+\" declared steps\",q=$.progress?.detailCount,G=$.attempt?.retries.length??0,B=C4($,X);return Z(\"article\",{class:`step ${$.status}`,\"data-step-id\":$.id,children:[Z(T4,{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(z0,{value:$.status,outputSource:$.outputSource},void 0,!1,void 0,this),$.name&&Z(\"code\",{children:$.id},void 0,!1,void 0,this),G>0&&Z(\"span\",{class:\"step-retries\",children:[G,\" retr\",G===1?\"y\":\"ies\"]},void 0,!0,void 0,this),Z(\"span\",{class:\"step-duration\",title:$.attempt?.attemptId,children:H0($.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),B&&Z(\"div\",{class:\"step-skip-reason\",children:B},void 0,!1,void 0,this),J&&Z(s0,{label:J.pipelineId,secondary:`${z}${J.mode===\"iterate\"?` per iteration, at most ${J.maxIterations} iterations`:J.mode===\"for-each\"?\" per runtime item\":\"\"}`,stepIds:J.stepIds},void 0,!1,void 0,this),$.remote&&Z(s0,{label:$.remote.engine,secondary:$.remote.target},void 0,!1,void 0,this),$.artifacts&&Z(O$,{artifacts:$.artifacts,stepId:$.id},void 0,!1,void 0,this),$.progress&&Z(j,{children:[Z(\"div\",{class:\"progress\",children:Z(\"i\",{class:`w${Math.round(K)}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{class:\"progress-copy\",children:$.progress.message||$.progress.completed+(Q?\" / \"+Q:\"\")+\" complete\"},void 0,!1,void 0,this),$.progress.details&&$.progress.details.length>0&&Z(\"div\",{class:\"progress-details\",children:[$.progress.details.map((U)=>Z(\"div\",{class:`progress-detail ${U.status||\"running\"}`,children:[Z(\"b\",{children:U.id},void 0,!1,void 0,this),U.label&&Z(\"span\",{children:U.label},void 0,!1,void 0,this),U.outputSource===\"override\"&&Z(\"span\",{children:\"(overridden)\"},void 0,!1,void 0,this),U.outputSource===\"cache\"&&Z(\"span\",{children:\"(cached)\"},void 0,!1,void 0,this)]},U.id,!0,void 0,this)),q&&$.progress.details.length<q?Z(\"div\",{class:\"progress-detail-truncated\",children:[\"Showing \",$.progress.details.length,\" of \",q,\" 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 o2=2;var J6=Symbol(\"tubeless.wire-schema.type\");function t($,X,Q={}){return{decode:X,jsonSchema:$,optionalInput:Q.optionalInput??!1,optionalOutput:Q.optionalOutput??!1}}function R4($,X){return $.length===0?X:`${$}.${X}`}function V(){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,K)=>{if(typeof Q!==\"number\"||!Number.isFinite(Q))throw Error(`${K} must be a finite number`);if($.integer&&(!Number.isSafeInteger(Q)||Q<($.minimum??-1/0))){if($.minimum===0)throw Error(`${K} must be a nonnegative safe integer`);throw Error(`${K} must be a safe integer`)}if($.minimum!==void 0&&Q<$.minimum)throw Error(`${K} must be at least ${$.minimum}`);return Q})}function p($={}){let X={type:\"string\"};if($.allowEmpty!==!0)X.minLength=1;if($.maxLength!==void 0)X.maxLength=$.maxLength;return t(X,(Q,K)=>{if(typeof Q!==\"string\"||$.allowEmpty!==!0&&Q.length===0)throw Error($.allowEmpty===!0?`${K} must be a string`:`${K} must be a non-empty string`);if($.maxLength!==void 0&&Q.length>$.maxLength)throw Error(`${K} exceeds ${$.maxLength} code units`);return Q})}function D($,X){return t({const:$,type:typeof $},(Q,K)=>{if(Q!==$)throw Error(X?.(K)??`${K} must be ${String($)}`);return $})}function v($,X=(Q)=>`${Q} is unsupported`){let Q=new Set($);return t({enum:$,type:\"string\"},(K,J)=>{if(typeof K!==\"string\"||!Q.has(K))throw Error(X(J));return K})}function N($){return t($.jsonSchema,(X,Q)=>X===void 0?void 0:$.decode(X,Q),{optionalInput:!0,optionalOutput:!0})}function n$($,X){return t($.jsonSchema,(Q,K)=>Q===void 0?X:$.decode(Q,K),{optionalInput:!0})}function y($,X={}){let Q={items:$.jsonSchema,type:\"array\"};if(X.maxItems!==void 0)Q.maxItems=X.maxItems;return t(Q,(K,J)=>{if(!Array.isArray(K)||X.maxItems!==void 0&&K.length>X.maxItems){let W=X.maxItems===void 0?\"\":` of at most ${X.maxItems}${X.noun?` ${X.noun}`:\"\"}`;throw Error(`${J} must be an array${W}`)}return K.map((W,z)=>$.decode(W,`${J}[${z}]`))})}function L($){let X=Object.entries($).filter(([,K])=>!K.optionalOutput).map(([K])=>K),Q=Object.fromEntries(Object.entries($).map(([K,J])=>[K,J.jsonSchema]));return t({additionalProperties:!1,properties:Q,...X.length>0?{required:X}:{},type:\"object\"},(K,J)=>{if(K===null||typeof K!==\"object\"||Array.isArray(K))throw Error(`${J} must be an object`);let W=K,z={};for(let[q,G]of Object.entries($)){let B=G.decode(W[q],R4(J,q));if(B!==void 0)z[q]=B}return z})}function i2($,X){return t({additionalProperties:$.jsonSchema,type:\"object\"},(Q,K)=>{if(Q===null||typeof Q!==\"object\"||Array.isArray(Q))throw Error(`${K} must be an object`);let J={};for(let[W,z]of Object.entries(Q))try{J[W]=$.decode(z,`${K}.${W}`)}catch{throw Error(X?.(K)??`${K} contains an unsupported value`)}return J})}function b0($,X){return t({oneOf:$.map((Q)=>Q.jsonSchema)},(Q,K)=>{for(let J of $)try{return J.decode(Q,K)}catch{}throw Error(X?.(K)??`${K} is unsupported`)})}function a($,X,Q=$.jsonSchema){return t(Q,(K,J)=>{let W=$.decode(K,J);return X(W,J),W},{optionalInput:$.optionalInput,optionalOutput:$.optionalOutput})}function T$($,X){return t($.jsonSchema,(Q,K)=>X($.decode(Q,K)),{optionalInput:$.optionalInput,optionalOutput:$.optionalOutput})}function Y0($,X){return t($,X)}function s$($,X){return t({oneOf:Object.entries(X).map(([Q,K])=>({allOf:[K.jsonSchema,{properties:{[$]:{const:Q,type:\"string\"}},required:[$],type:\"object\"}]}))},(Q,K)=>{if(Q===null||typeof Q!==\"object\"||Array.isArray(Q))throw Error(`${K} must be an object`);let J=Q[$];if(typeof J!==\"string\"||!(J in X))throw Error(`${$} is unsupported`);return X[J].decode(Q,K)})}var D0=16384,r2=new TextEncoder;function t$($,X){let Q=0,K=0,J=(q)=>{if(q.length>D0)throw Error(`${X} exceeds ${D0} bytes`);if(K+=r2.encode(JSON.stringify(q)).byteLength,K>D0)throw Error(`${X} exceeds ${D0} bytes`)},W=(q,G)=>{if(++Q>256||G>8)throw Error(`${X} exceeds metadata complexity limits`);if(q===null||typeof q===\"boolean\")return q;if(typeof q===\"number\"&&Number.isFinite(q))return q;if(typeof q===\"string\")return J(q),q;if(typeof q!==\"object\"||q===null)throw Error(`${X} must be JSON-safe`);let B=Array.isArray(q),U=Object.getPrototypeOf(q);if(!B&&U!==Object.prototype&&U!==null)throw Error(`${X} must contain only plain JSON objects`);let F=Reflect.ownKeys(q);if(F.length>256)throw Error(`${X} exceeds metadata complexity limits`);let P=[];for(let M of F){if(B&&M===\"length\")continue;if(typeof M!==\"string\")throw Error(`${X} must be JSON-safe`);let A=Object.getOwnPropertyDescriptor(q,M);if(!(\"value\"in A)||!A.enumerable)throw Error(`${X} must contain only enumerable data properties`);J(M),P.push([M,W(A.value,G+1)])}if(B){if(P.length!==q.length||P.some(([M],A)=>M!==String(A)))throw Error(`${X} must contain only dense JSON arrays`);return P.map(([,M])=>M)}return Object.fromEntries(P)},z=W($,0);if(r2.encode(JSON.stringify(z)).byteLength>D0)throw Error(`${X} exceeds ${D0} bytes`);return z}var E0=p({maxLength:4096}),a2=L({id:N(E0),uri:N(E0),mediaType:N(E0),checksum:N(E0),version:N(E0),byteSize:N(Q0({integer:!0,minimum:0})),schemaVersion:N(E0),metadata:N(Y0({type:\"object\",additionalProperties:!0},($,X)=>{if(!$||typeof $!==\"object\"||Array.isArray($))throw Error(`${X} must be an object`);return $}))}),t0=Y0({...a2.jsonSchema,anyOf:[{required:[\"id\"]},{required:[\"uri\"]}]},($,X)=>{let Q=t$($,X),K=a2.decode(Q,X);if(!K.id&&!K.uri)throw Error(`${X} requires id or uri`);let J=[\"id\",\"uri\",\"mediaType\",\"checksum\",\"version\",\"byteSize\",\"schemaVersion\",\"metadata\"];if(Object.keys(Q).some((W)=>!J.includes(W)))throw Error(`${X} has unknown fields; use metadata for application fields`);return K.id?{...K,id:K.id}:{...K,uri:K.uri}}),e0=v([\"read\",\"write\",\"reuse\"]),z6=L({operation:e0,artifact:t0});function n2($){if($!==null&&typeof $===\"object\"){for(let X of Object.values($))n2(X);Object.freeze($)}return $}var $$=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=t$($,X);if(!Q||typeof Q!==\"object\"||Array.isArray(Q))throw TypeError(`${X} must be an object`);let K=(J)=>typeof J===\"string\"&&J.trim().length>0&&J.length<=256;for(let[J,W]of Object.entries(Q))if(J===\"tags\"){if(!Array.isArray(W)||W.length>64||!W.every(K))throw TypeError(`${X}.tags must contain at most 64 nonblank strings of at most 256 characters`)}else if(J===\"owner\"||J===\"domain\"){if(!K(W))throw TypeError(`${X}.${J} must be a nonblank string of at most 256 characters`)}else if(J===\"annotations\"){if(!W||typeof W!==\"object\"||Array.isArray(W))throw TypeError(`${X}.annotations must be an object`)}else throw TypeError(`${X}.${J} is unknown; use annotations for application fields`);return n2(Q)});var s2=3,L0=128,C0=4096,e$=262144;var k4=[\"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\"],w4=[\"cancellation\",\"child\",\"definition\",\"finalization\",\"selection\",\"step\",\"validation\"],I4=[\"definition\",\"execution\",\"finalization\",\"planning\"],S4=[\"cancelled\",\"completed\",\"failed\"],J2=[\"dry-run\",\"failed-dependency\",\"fail-fast\",\"filtered\",\"policy\",\"unmet-dependency\"],g4=[\"cancelled\",\"completed\",\"failed\",\"pending\",\"running\",\"skipped\"],n=p({allowEmpty:!0}),e=p(),Z2=p({allowEmpty:!0,maxLength:C0}),P0=Q0({integer:!0,minimum:0}),$0=Q0(),b$=y(e),y4=y(e,{maxItems:L0,noun:\"strings\"});function K2($,X,Q,K){if($===null||typeof $!==\"object\"||Array.isArray($))throw Error(`${X} must be an object`);if(!K&&Q>=16||K&&Q>8)throw Error(K?\"error.fanOut cause exceeds its depth limit\":\"error.cause exceeds 16 levels\");let J=$,W=(B)=>{let U=J[B];if(U===void 0)return;if(typeof U!==\"string\")throw Error(`${X}.${B} must be a string`);return U},z={message:W(\"message\")??\"\"},q=W(\"name\"),G=W(\"sourceCode\");if(q!==void 0)z.name=q;if(G!==void 0)z.sourceCode=G;if(K&&[z.message,z.name,z.sourceCode].some((B)=>B!==void 0&&B.length>1024))throw Error(\"error.fanOut cause strings exceed 1024 code units\");if(J.cause!==void 0)z.cause=K2(J.cause,X,Q+1,K);return z}var $1={additionalProperties:!1,properties:{cause:{$ref:\"#/components/schemas/PipelineErrorCause\"},message:{type:\"string\"},name:{type:\"string\"},sourceCode:{type:\"string\"}},required:[\"message\"],type:\"object\"},v4=Y0($1,($,X)=>K2($,X,0,!1)),X1=Y0({$ref:\"#/components/schemas/PipelineErrorCause\"},($,X)=>K2($,X,0,!0)),f4=Y0({items:{oneOf:[{type:\"number\"},{type:\"string\",maxLength:C0}]},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>C0))throw Error(`${X} string exceeds ${C0} code units`);return $}),Q2=L({message:p({maxLength:C0}),path:N(f4)}),h4=Y0({items:Q2.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,K)=>Q2.decode(Q,`${X}[${K}]`))}),Z1=L({cancelled:V(),error:X1,index:P0,key:p({allowEmpty:!0,maxLength:1024}),keyTruncated:V()}),Q1=a(L({failureCount:P0,failures:y(Z1,{maxItems:32,noun:\"entries\"}),omittedFailureCount:P0,schedulerError:N(X1)}),($)=>{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}}),v0=L({cause:N(a(v4,()=>{return},{$ref:\"#/components/schemas/PipelineErrorCause\"})),code:v(k4),fanOut:N(a(Q1,()=>{return},{$ref:\"#/components/schemas/PipelineFanOutDiagnostics\"})),issues:N(h4),kind:v(w4),message:n$(n,\"\"),phase:v(I4),sourceCode:N(n),stack:N(n)}),C$=a(v0,()=>{return},{$ref:\"#/components/schemas/PipelineError\"}),J1=L({outputSource:N(v([\"override\",\"cache\"])),completed:N($0),depth:N($0),id:p({maxLength:C0}),label:N(Z2),name:N(Z2),status:N(v(g4)),total:N($0)}),V4=a(y(J1,{maxItems:L0,noun:\"details\"}),($,X)=>{if(new TextEncoder().encode(JSON.stringify($)).byteLength>e$)throw Error(`${X} exceeds the ${e$}-byte limit`)}),W2=T$(a(L({completed:$0,detailCount:N(P0),details:N(V4),message:N(n),total:N($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}:$),x0=Q0({integer:!0,minimum:1}),K1=[\"for-each\",\"single\",\"iterate\"],k$=a(L({mode:v(K1),maxIterations:N(x0),pipelineId:e,stepCount:P0,stepIds:y4}),($,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`)}),f0=L({engine:p({maxLength:C0}),target:N(Z2)}),A0=a(L({version:b0([D(1),D(2),D(3)]),definitionId:p({maxLength:80}),structuralFingerprint:p({maxLength:80}),implementationVersion:N(p({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`)}),Z$=p({maxLength:4096}),k0=y(Z$,{maxItems:4096}),t2=a(p({maxLength:80}),($,X)=>{if(!/^sha256:[a-f0-9]{64}$/.test($))throw Error(`${X} must be a SHA-256 fingerprint`)}),z2=L({maxTurns:x0,maxCalls:P0,maxDecisions:x0,maxDepth:N(P0),maxConcurrency:x0}),Y2=L({limits:z2,resultSchemaFingerprint:t2,capabilities:y(L({name:Z$,description:Z$,inputSchemaFingerprint:t2,identity:A0}),{maxItems:4096})}),B2=L({cache:N(v([\"use\",\"recompute\",\"bypass\"])),dryRun:N(V()),continueOnError:N(V()),maxConcurrency:N($0),targets:N(k0),stepIds:N(k0)}),j4=L({metadata:N($$),agent:N(Y2),id:Z$,dependencies:k0,optionalDependencies:k0,skipAfterFailureOf:k0,dryRun:v([\"custom\",\"run\",\"skip\"]),runtimeSkipPossible:V(),outputValidated:V(),cache:N(L({version:p({maxLength:256}),maxAgeMs:N($0),policy:v([\"use\",\"recompute\",\"bypass\",\"dynamic\"])})),nestedPipeline:N(L({pipelineId:Z$,mode:v(K1),maxIterations:N(x0),controls:N(B2),identity:N(A0),stepIds:k0,concurrency:N(b0([$0,D(\"dynamic\")]))})),remote:N(f0)}),Q$=a(L({identity:A0,metadata:N($$),steps:y(j4,{maxItems:4096}),targetIds:k0,requiredFinalizerStepIds:N(k0),optionsValidated:V(),resultValidated:V()}),($,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 K=Q.nestedPipeline;if(!K)continue;if(K.mode===\"iterate\"!==(K.maxIterations!==void 0)||K.controls!==void 0&&K.mode!==\"iterate\")throw Error(`${X}: invalid iteration metadata`);if($.identity.version===1&&(K.mode===\"iterate\"||K.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`)}),R$=L({kind:v([\"all\",\"exact\",\"not-selected\",\"outside-target-closure\"])}),D4=L({kind:D(\"target\"),targetId:e}),$2=L({dependentId:e,kind:v([\"failure-gate\",\"optional-only\",\"required-dependency\"]),targetId:e}),E4=s$(\"kind\",{all:R$,exact:R$,\"failure-gate\":$2,\"not-selected\":R$,\"optional-only\":$2,\"outside-target-closure\":R$,\"required-dependency\":$2,target:D4}),q2=y(E4,{maxItems:L0,noun:\"reasons\"}),x4=i2(b0([V(),$0,n]),($)=>`${$} values must be booleans, finite numbers, or strings`),J0={correlationId:N(n),itemKey:N(n),parentRunId:N(n),pipelineId:e,runId:e,timestampMs:$0,version:b0([D(2),D(s2)]),iteration:N(L({runId:e,stepId:e,attemptId:e,index:x0}))},X$={attemptId:N(n),durationMs:N($0)},R0={stepId:e},X2=L({}),W1={\"step.artifact\":L({...J0,...R0,attemptId:e,name:D(\"step.artifact\"),payload:L({operation:e0,preview:V(),artifact:t0})}),\"pipeline.completed\":L({...J0,durationMs:N($0),error:N(C$),name:D(\"pipeline.completed\"),payload:L({dryRun:V(),errorCount:P0,finalized:V(),status:v(S4,($)=>`${$} must be cancelled, completed, or failed`),stepCount:P0})}),\"pipeline.finalize.completed\":L({...J0,durationMs:$0,name:D(\"pipeline.finalize.completed\"),payload:X2}),\"pipeline.finalize.failed\":L({...J0,durationMs:$0,error:C$,name:D(\"pipeline.finalize.failed\"),payload:X2}),\"pipeline.finalize.started\":L({...J0,name:D(\"pipeline.finalize.started\"),payload:X2}),\"pipeline.log\":L({...J0,attemptId:N(n),name:D(\"pipeline.log\"),payload:L({level:v([\"error\",\"log\",\"warn\"],($)=>`${$} must be error, log, or warn`),message:n$(n,\"\")}),stepId:N(n)}),\"pipeline.started\":L({...J0,name:D(\"pipeline.started\"),payload:a(L({definitionIdentity:N(A0),definitionSnapshot:N(Q$),dryRun:V(),planOk:V(),parentStepId:N(e),stepCount:P0,targetIds:b$}),($)=>{if($.definitionSnapshot&&JSON.stringify($.definitionSnapshot.identity)!==JSON.stringify($.definitionIdentity))throw Error(\"Definition snapshot must match the run definition identity\")})}),\"step.attempted\":L({...J0,...X$,...R0,name:D(\"step.attempted\"),payload:L({attempt:$0,attributes:x4})}),\"step.cancelled\":L({...J0,...X$,...R0,error:C$,name:D(\"step.cancelled\"),payload:L({status:D(\"cancelled\"),outputSource:N(v([\"override\",\"cache\"]))})}),\"step.complete\":L({...J0,...X$,...R0,name:D(\"step.complete\"),payload:L({status:D(\"completed\"),outputSource:N(v([\"override\",\"cache\"]))})}),\"step.failed\":L({...J0,...X$,...R0,error:C$,name:D(\"step.failed\"),payload:L({status:D(\"failed\"),outputSource:N(v([\"override\",\"cache\"]))})}),\"step.planned\":L({...J0,...R0,name:D(\"step.planned\"),payload:L({dependencies:b$,description:N(n),dryRun:v([\"custom\",\"run\",\"skip\"],($)=>`${$} must be custom, run, or skip`),name:N(n),nestedPipeline:N(k$),optionalDependencies:b$,remote:N(f0),runtimeSkipPossible:V(),selected:V(),selectionReasons:q2,skipAfterFailureOf:b$})}),\"step.running\":L({...J0,...R0,attemptId:e,name:D(\"step.running\"),payload:L({progress:N(W2),outputSource:N(v([\"override\",\"cache\"]))})}),\"step.skipped\":L({...J0,...X$,...R0,name:D(\"step.skipped\"),payload:L({dependencyId:N(n),message:N(n),reason:v(J2),status:D(\"skipped\"),outputSource:N(v([\"override\",\"cache\"]))})})},z1={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}}}}}}},e2=s$(\"name\",W1),M6=a(e2,($)=>{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\")},{...e2.jsonSchema,...z1}),L6={PipelineError:v0.jsonSchema,PipelineErrorCause:$1,PipelineFanOutDiagnostics:Q1.jsonSchema,PipelineFanOutFailure:Z1.jsonSchema,PipelineProgressDetail:J1.jsonSchema,PipelineValidationIssue:Q2.jsonSchema,StoredPipelineEvent:{oneOf:Object.values(W1).map(($)=>{let X=$.jsonSchema;return{...X,...z1,properties:{...X.properties,id:{minimum:0,type:\"integer\"}},required:[...X.required,\"id\"]}})}};var s=p({allowEmpty:!0}),m=p(),X0=Q0(),K0=Q0({integer:!0,minimum:0}),J$=Q0({integer:!0,minimum:1}),q1=v([\"running\",\"completed\",\"failed\",\"cancelled\"]),m4=v([\"planned\",\"running\",\"completed\",\"failed\",\"cancelled\",\"skipped\"]),Y1=N(v([\"override\",\"cache\"])),B1=L({agentRunId:m,turn:J$,callId:m,tool:m,parentAttemptId:m}),U1=L({version:D(o2),agent:N(L({stepId:m,limits:z2,capabilities:y(m)})),agentTurn:N(L({agentRunId:m,index:J$,decision:N(v([\"continue\",\"finish\"])),stateVersion:N(K0),nextStateVersion:N(K0),callCount:N(K0),callsAdmitted:N(K0),calls:y(B1)})),agentCall:N(B1),itemKey:N(s),iteration:N(L({runId:m,stepId:m,attemptId:m,index:J$})),definitionIdentity:N(A0),correlationId:N(s),parentRunId:N(s),parentStepId:N(m),dryRun:V(),durationMs:N(X0),error:N(v0),eventCount:K0,finishedAtMs:N(X0),logCount:K0,logs:y(L({attemptId:N(s),id:K0,level:v([\"error\",\"log\",\"warn\"]),message:s,stepId:N(s),timestampMs:X0})),pipelineId:m,runId:m,startedAtMs:X0,status:q1,steps:y(L({id:m,status:m4,outputSource:Y1,dependencies:N(y(m)),description:N(s),name:N(s),durationMs:N(X0),finishedAtMs:N(X0),startedAtMs:N(X0),nestedPipeline:N(k$),optionalDependencies:N(y(m)),remote:N(f0),skipAfterFailureOf:N(y(m)),skipReason:N(v(J2)),progress:N(W2),attempt:N(L({attemptId:m,outputSource:Y1,durationMs:N(X0),finishedAtMs:N(X0),retries:y(J$),startedAtMs:X0,status:v([\"running\",\"completed\",\"failed\",\"cancelled\",\"skipped\"])})),artifacts:N(y(L({artifact:t0,operation:e0,preview:V(),attemptId:m,timestampMs:X0})))}))}),G1={identity:N(A0),activeRuns:K0,firstSeenAtMs:X0,lastSeenAtMs:X0,pipelineId:m,runCount:K0},N1=L(G1),F1=L({...G1,snapshot:N(Q$),targetIds:y(m),steps:y(L({dependencies:y(m),description:N(s),dryRun:s,id:m,name:N(s),nestedPipeline:N(k$),remote:N(f0),optionalDependencies:y(m),runtimeSkipPossible:V(),skipAfterFailureOf:y(m)}))}),h0=L({runId:m,pipelineId:m,correlationId:N(s),parentRunId:N(s),startedAtMs:X0,status:q1,dryRun:V(),durationMs:N(X0),eventCount:K0,subtreeEventCount:K0,stepCount:K0,rootRunId:m,descendantCount:K0,subtreeIsRunning:V(),activity:L({count:K0,names:y(s,{maxItems:3}),message:N(s)}),origin:N(L({stepId:N(m),itemKey:N(s),iteration:N(J$)}))});var B0=50,H1=16,M0=p({allowEmpty:!0}),U0=p(),K$=Q0(),r=Q0({integer:!0,minimum:0}),c4=T$(B2,($)=>{let{targets:X,stepIds:Q,...K}=$;if(X!==void 0&&Q!==void 0)throw Error(\"Child selectors are mutually exclusive.\");return X!==void 0?{...K,targets:X}:{...K,stepIds:Q}}),U2=y(U0),l4=a(L({choices:N(y(M0)),default:N(b0([M0,K$,V()])),description:N(M0),environment:N(M0),exclusive:N(D(!0)),flag:U0,group:N(D(\"execution\")),integer:N(V()),key:U0,max:N(K$),min:N(K$),multiple:V(),mustExist:N(V()),pathKind:N(v([\"directory\",\"file\"])),positional:V(),required:V(),short:N(M0),type:v([\"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}`)}),P1=L({commands:y(L({canPlan:V(),id:U0,name:U0,description:N(M0),parameters:y(l4)}))}),M1=L({definition:N(Q$),dryRun:V(),ok:V(),pipelineId:U0,errors:y(Y0(v0.jsonSchema,($,X)=>({...v0.decode($,X),...L({message:M0,stepId:N(M0)}).decode($,X)}))),steps:y(L({metadata:N($$),agent:N(Y2),dependencies:U2,description:N(M0),dryRun:v([\"custom\",\"run\",\"skip\"]),id:U0,name:N(M0),optionalDependencies:U2,runtimeSkipPossible:V(),selected:V(),selectionReasons:q2,skipAfterFailureOf:U2,skipReason:N(v([\"dry-run\",\"failed-dependency\",\"fail-fast\",\"filtered\",\"policy\",\"unmet-dependency\"])),remote:N(f0),nestedPipeline:N(a(L({mode:v([\"single\",\"for-each\",\"iterate\"]),maxIterations:N(Q0({integer:!0,minimum:1})),controls:N(c4),identity:N(A0),concurrency:N(b0([K$,D(\"dynamic\")])),pipelineId:U0,stepIds:y(U0)}),($,X)=>{if($.mode===\"iterate\"!==($.maxIterations!==void 0))throw Error(`${X}: only iterate requires maxIterations`)}))}))}),L1=L({activeRunCount:r,completedRunCount:r,failedRunCount:r,generatedAtMs:K$,lastEventId:r,revision:r,runCount:r,eventCount:r,rootRunCount:r,matchingRootCount:r,offset:r,definitions:y(N1),liveRunIds:y(U0),runs:y(h0,{maxItems:B0}),selectedRun:N(h0)}),p4=L({stepId:N(U0),count:r}),A1=L({run:U1,ancestors:y(h0),children:y(h0),childCount:r,childSteps:y(p4),descendantCount:r}),O1=L({children:y(h0),page:r,childCount:r}),_1=L({definition:F1}),T1=L({runs:y(h0,{maxItems:B0}),offset:r,runCount:r});function w0($,X){try{return $.decode(X,\"Studio response\")}catch{return}}class c0 extends Error{status;constructor($,X){super(X);this.status=$}}function m0($){return typeof $===\"object\"&&$!==null&&!Array.isArray($)}function u4($){return typeof $===\"number\"&&Number.isFinite($)}function d4($){return w0(L1,$)}function o4($){return w0(P1,$)?.commands}function G0($,X,Q){if(!m0($))return new c0(Q,X);if(Array.isArray($.errors)&&$.errors.every((K)=>typeof K===\"string\"))return new c0(Q,$.errors.join(`\n`));return new c0(Q,typeof $.message===\"string\"?$.message:X)}function N0($){return Error(`Studio API returned an invalid response for ${$}.`)}function b1($=fetch,X=\"\"){let Q=new Set,K,J,W=()=>{if(K)throw new c0(K,K===401?\"Sign in to continue.\":\"Access denied.\")},z=async(G,B)=>{W();let U=await $(X+String(G),B);if(!K&&(U.status===401||U.status===403)){K=U.status;for(let F of Q)F(K)}return W(),U},q=async(G)=>{let B;try{B=await G.json()}catch{throw W(),new c0(G.status,\"Studio API returned invalid JSON.\")}return W(),B};return{subscribeAccessDenied(G){if(Q.add(G),K)G(K);return()=>{Q.delete(G)}},async loadSnapshot({query:G=\"\",offset:B=0,selectedRunId:U}={}){let F=new URLSearchParams;if(G)F.set(\"query\",G);if(B)F.set(\"offset\",String(B));if(U)F.set(\"run\",U);let P=\"/api/snapshot\"+(F.size?\"?\"+F:\"\"),M=J?.key===P?J:void 0,A=await z(P,{cache:\"no-store\",headers:M?.etag?{\"if-none-match\":M.etag}:void 0});if(A.status===304&&M)return M.snapshot;let Y=await q(A);if(!A.ok)throw G0(Y,\"Snapshot request failed.\",A.status);let H=d4(Y);if(!H)throw N0(\"snapshot\");return J={key:P,etag:A.headers.get(\"etag\"),snapshot:H},H},async loadDefinition(G,B){let U=new URLSearchParams({pipelineId:G});if(B)U.set(\"definitionId\",B);let F=await z(\"/api/definitions?\"+U,{cache:\"no-store\"}),P=await q(F);if(!F.ok)throw G0(P,\"Definition request failed.\",F.status);let M=w0(_1,P);if(!M)throw N0(\"definition\");return M.definition},async loadDefinitionRuns(G,B,U=0){let F=new URLSearchParams({pipelineId:G,offset:String(U)});if(B)F.set(\"definitionId\",B);let P=await z(\"/api/definitions/runs?\"+F,{cache:\"no-store\"}),M=await q(P);if(!P.ok)throw G0(M,\"Definition runs request failed.\",P.status);let A=w0(T1,M);if(!A)throw N0(\"definition runs\");return A},async loadRunDetail(G){let B=await z(\"/api/runs/\"+encodeURIComponent(G),{cache:\"no-store\"}),U=await q(B);if(B.status===404)return null;if(!B.ok)throw G0(U,\"Run detail request failed.\",B.status);let F=w0(A1,U);if(!F)throw N0(\"run detail\");return F},async loadChildRuns(G,B){let U=await z(\"/api/runs/\"+encodeURIComponent(G)+\"/children?page=\"+B,{cache:\"no-store\"}),F=await q(U);if(U.status===404)return null;if(!U.ok)throw G0(F,\"Child runs request failed.\",U.status);let P=w0(O1,F);if(!P)throw N0(\"child runs\");return P},async loadCommands(){let G=await z(\"/api/commands\",{cache:\"no-store\"}),B=await q(G);if(!G.ok)throw G0(B,\"Commands request failed.\",G.status);let U=o4(B);if(!U)throw N0(\"commands\");return U},async loadCapabilities(){let G=await z(\"/api/capabilities\",{cache:\"no-store\"}),B=await q(G);if(!G.ok||!m0(B)||typeof B.canCancel!==\"boolean\"||typeof B.canClearHistory!==\"boolean\"){if(!G.ok)throw G0(B,\"Capabilities request failed.\",G.status);throw N0(\"capabilities\")}return{canCancel:B.canCancel,canClearHistory:B.canClearHistory}},async clearHistory(){let G=await z(\"/api/history\",{method:\"DELETE\",headers:{\"x-tubeless-studio-clear-history\":\"1\"}}),B=await q(G);if(!G.ok)throw G0(B,\"History could not be cleared.\",G.status);if(!m0(B)||B.cleared!==!0||!u4(B.eventCount))throw N0(\"clear history\");return J=void 0,{eventCount:B.eventCount}},async previewPlan(G,B){let U=await z(\"/api/commands/\"+encodeURIComponent(G)+\"/plan\",{method:\"POST\",headers:{\"content-type\":\"application/json\",\"x-tubeless-studio-plan\":\"1\"},body:JSON.stringify(B)}),F=await q(U);if(!U.ok)throw G0(F,\"Plan request failed.\",U.status);let P=m0(F)?w0(M1,F.plan):void 0;if(!P)throw N0(\"plan\");return P},async cancelRun(G){let B=await z(\"/api/runs/\"+encodeURIComponent(G)+\"/cancel\",{method:\"POST\",headers:{\"x-tubeless-studio-cancel\":\"1\"}}),U=await q(B);if(!B.ok)throw G0(U,\"Run could not be cancelled.\",B.status);if(!m0(U)||U.cancelled!==!0||U.runId!==G)throw N0(\"cancel run\")},async launch(G,B){let U=await z(\"/api/commands/\"+encodeURIComponent(G)+\"/runs\",{method:\"POST\",headers:{\"content-type\":\"application/json\",\"x-tubeless-studio-launch\":\"1\"},body:JSON.stringify({values:B})}),F=await q(U);if(!U.ok)throw G0(F,\"Launch failed.\",U.status);if(!m0(F)||F.accepted!==!0||typeof F.runId!==\"string\"||F.runId.length===0)throw N0(\"launch\");return F.runId}}}var R1=1200;function C1($){return[$.runId,$.eventCount,$.subtreeEventCount,$.rootRunId,$.status].join(\":\")}function i4($){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 G2{#F;#M;#L;#G=new Set;#Y=null;#Q;#K=null;#z=0;#X=!1;#Z;#H=!1;#W=0;#P=!1;#N=!1;#$;constructor($,{runId:X=null,detailRetryMs:Q=1200}={}){this.#F=$,this.#L=Q,this.#$={connected:!0,historyQuery:{query:\"\",offset:0},selection:X?{status:\"loading\",runId:X}:{status:\"none\"},manualRefreshing:!1,snapshot:null},this.#M=$.subscribeAccessDenied?.((K)=>{if(this.#W+=1,this.#q(),this.#Z)clearTimeout(this.#Z);this.#Z=void 0,this.#N=!1,this.#J({accessDenied:K,connected:!1,snapshot:null,selection:{status:\"none\"},manualRefreshing:!1})})}getState(){return this.#$}subscribe($){return this.#G.add($),()=>this.#G.delete($)}setHistoryQuery({query:$=\"\",offset:X=0}){if(this.#X||this.#$.accessDenied)return;if(this.#$.historyQuery.query===$&&this.#$.historyQuery.offset===X)return;this.#W+=1,this.#J({historyQuery:{query:$,offset:X}}),this.refresh(!0)}selectRun($){if(this.#X||this.#$.accessDenied||$===this.#U())return;let X=$?this.#T($):void 0,Q=X&&this.#$.snapshot?.runs.some((K)=>K.runId===X.rootRunId);if(this.#q(),this.#W+=1,this.#J({historyQuery:Q?this.#$.historyQuery:{query:\"\",offset:0},selection:$?{status:\"loading\",runId:$,summary:X}:{status:\"none\"}}),X)this.#K=C1(X),this.#B(this.#z);this.refresh(!0)}refresh($=!1){if(this.#X||this.#$.accessDenied)return;if($)this.#H=!0,this.#J({manualRefreshing:!0});if(this.#P){if($)this.#N=!0;return}this.#A()}invalidate({delayMs:$=0,resetHistory:X=!1}={}){if(this.#X||this.#$.accessDenied)return;this.#W+=1;let Q=this.#U();if(X)this.#q(),this.#J({historyQuery:{query:\"\",offset:0},selection:Q?{status:\"unavailable\",runId:Q}:{status:\"none\"},snapshot:this.#$.snapshot?i4(this.#$.snapshot):null});else this.#C($);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.#M?.(),this.#X=!0,this.#W+=1,this.#q(),this.#Z)clearTimeout(this.#Z);this.#Z=void 0,this.#G.clear()}#U(){return this.#$.selection.status===\"none\"?null:this.#$.selection.runId}#T($){let{snapshot:X,selection:Q}=this.#$;return(X?.selectedRun?.runId===$?X.selectedRun:void 0)??X?.runs.find((K)=>K.runId===$)??(Q.status===\"ready\"?Q.detail.children.find((K)=>K.runId===$)??Q.detail.ancestors.find((K)=>K.runId===$):void 0)}#b($){let X=this.#$.selection,Q=this.#U();if(Q){let K=$.selectedRun??$.runs.find((J)=>J.runId===Q);if(K?.runId===Q){let J=C1(K);X=X.status===\"ready\"?{...X,summary:K}:{status:\"loading\",runId:Q,summary:K};let W=J!==this.#K;if(this.#K=J,this.#J({connected:!0,snapshot:$,selection:X}),W)this.#B(this.#z);return}this.#q(),X={status:\"unavailable\",runId:Q}}this.#J({connected:!0,snapshot:$,selection:X})}#A(){if(this.#X||this.#$.accessDenied)return;this.#P=!0;let $=this.#W;this.#H=!1,this.#F.loadSnapshot({...this.#$.historyQuery,selectedRunId:this.#U()}).then((X)=>{if(this.#X||this.#$.accessDenied||$!==this.#W)return;this.#b(X)}).catch(()=>{if(this.#X||this.#$.accessDenied||$!==this.#W)return;this.#J({connected:!1})}).finally(()=>{if(this.#X||this.#$.accessDenied)return;if(this.#P=!1,this.#N){this.#N=!1,this.#A();return}if(!this.#H)this.#J({manualRefreshing:!1})})}#B($){let X=this.#U(),Q=this.#K;if(this.#X||this.#$.accessDenied||this.#Y!==null||this.#Q!==void 0||!X||!Q||$!==this.#z)return;let K={};this.#Y=K,this.#F.loadRunDetail(X).then((J)=>{if(!this.#O(K,$))return;this.#Y=null;let W=this.#$.selection;if(J?.run.runId===X&&(W.status===\"loading\"||W.status===\"ready\")&&W.summary){if(this.#J({selection:{status:\"ready\",runId:X,summary:W.summary,detail:J}}),Q!==this.#K)this.#B($)}else this.#_($)}).catch(()=>{if(!this.#O(K,$))return;this.#Y=null,this.#_($)})}#O($,X){return!this.#X&&!this.#$.accessDenied&&this.#Y===$&&this.#z===X}#_($){if(this.#X||this.#$.accessDenied||$!==this.#z)return;if(this.#Q)clearTimeout(this.#Q);this.#Q=setTimeout(()=>{this.#Q=void 0,this.#B($)},this.#L)}#C($){let X=this.#K;if(this.#q(),this.#K=X,!X)return;let Q=this.#z;if($>0)this.#Q=setTimeout(()=>{this.#Q=void 0,this.#B(Q)},$);else this.#B(Q)}#q(){if(this.#z+=1,this.#Y=null,this.#K=null,this.#Q)clearTimeout(this.#Q);this.#Q=void 0}#J($){this.#$={...this.#$,...$};for(let X of this.#G)X(this.#$)}}function l0({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 p0($){return $.description||\"Run this typed pipeline command.\"}function I0($){return $ instanceof Error?$.message||String($):String($)}function w$($=globalThis.matchMedia){return $?.(\"(prefers-reduced-motion: reduce)\").matches?\"auto\":\"smooth\"}function u0({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 r4($,X,Q){let K=new Map,J=X.trim().toLowerCase();for(let W of $){if(!`${W.id} ${JSON.stringify(W.metadata??{})}`.toLowerCase().includes(J))continue;let z=Q===\"none\"?\"Steps\":W.metadata?.[Q],q=K.get(z)??[];q.push(W),K.set(z,q)}return K}function I$({steps:$}){let[X,Q]=R(\"\"),[K,J]=R(\"none\"),W=r4($,X,K);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:(z)=>Q(z.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"label\",{class:\"field\",children:[\"Group steps\",Z(\"select\",{value:K,onChange:(z)=>{let q=z.currentTarget.value;if(q===\"owner\"||q===\"domain\"||q===\"none\")J(q)},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),W.size===0&&Z(\"p\",{children:\"No matching steps.\"},void 0,!1,void 0,this),[...W].map(([z,q])=>Z(\"section\",{children:[Z(\"h4\",{children:z??\"Unassigned\"},void 0,!1,void 0,this),z===void 0&&Z(\"small\",{children:[\"No \",K,\" specified\"]},void 0,!0,void 0,this),Z(\"ul\",{children:q.map((G)=>Z(\"li\",{children:[Z(\"code\",{children:G.id},void 0,!1,void 0,this),Z(u0,{metadata:G.metadata},void 0,!1,void 0,this)]},G.id,!0,void 0,this))},void 0,!1,void 0,this)]},JSON.stringify([z]),!0,void 0,this))]},void 0,!0,void 0,this)}function k1({commands:$,onConfigure:X}){if(!$.length)return Z(\"div\",{class:\"sheet\",children:Z(l0,{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:p0(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 a4($){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 n4($){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 N2({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 w1({plan:$}){let X=$.steps.filter((J)=>J.selected&&!J.skipReason).length,Q=new Map($.steps.map((J)=>[J.id,J])),K=$.steps.some((J)=>J.selectionReasons.some((W)=>W.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((W)=>W.kind===\"exact\"||W.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:[$.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:K.title},void 0,!1,void 0,this),Z(\"span\",{children:K.detail},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(u0,{metadata:$.definition?.metadata},void 0,!1,void 0,this),Z(I$,{steps:$.steps},void 0,!1,void 0,this),Z(\"div\",{class:\"plan-steps\",children:$.steps.map((J)=>{let W=!J.selected?\"Not selected\":J.skipReason===\"dry-run\"?\"Dry-run skip\":J.skipReason?\"Skipped\":\"Will run\",z=J.nestedPipeline,q=J.remote,G=q?\"Remote step\":z?z.mode===\"iterate\"?\"Pipeline iteration\":z.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${z?\" pipeline\":\"\"}`,children:G},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(u0,{metadata:J.metadata},void 0,!1,void 0,this),Z(\"span\",{class:`plan-disposition${W===\"Will run\"?\"\":\" skipped\"}`,children:W},void 0,!1,void 0,this),Z(\"ul\",{class:\"plan-explanation\",children:[J.selectionReasons.map((B,U)=>Z(\"li\",{children:[Z(\"strong\",{children:J.selected?\"Selected\":\"Omitted\"},void 0,!1,void 0,this),Z(\"span\",{children:a4(B)},void 0,!1,void 0,this)]},U,!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(N2,{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(N2,{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(N2,{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:n4(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),z&&Z(s0,{label:z.pipelineId,secondary:`${z.stepIds.length} declared steps${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),q&&Z(s0,{label:q.engine,secondary:q.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 I1($,X,Q){let K=new Map($.map((J,W)=>{let z=X.get(J).filter((G)=>Q.has(G)),q=z.length?z.reduce((G,B)=>G+Q.get(B),0)/z.length:W;return[J,q]}));$.sort((J,W)=>K.get(J)-K.get(W)),$.forEach((J,W)=>Q.set(J,W))}function S1($,X,Q){let K=new Map($.map((Y)=>[Y.id,Y])),J=new Map($.map((Y)=>[Y.id,[]])),W=new Map($.map((Y)=>[Y.id,[]]));for(let{from:Y,to:H}of X){if(Y===H||!K.has(Y)||!K.has(H))continue;if(J.get(H).includes(Y))continue;J.get(H).push(Y),W.get(Y).push(H)}let z=new Map,q=new Set,G=(Y)=>{let H=z.get(Y);if(H!==void 0)return H;if(q.has(Y))return-1;q.add(Y);let T=0;for(let O of J.get(Y))T=Math.max(T,G(O)+1);return q.delete(Y),z.set(Y,T),T},B=[];for(let Y of $)(B[G(Y.id)]??=[]).push(Y.id);let U=new Map;B[0]?.forEach((Y,H)=>U.set(Y,H));for(let Y=0;Y<4;Y+=1){for(let H of B.slice(1))I1(H,J,U);for(let H of B.slice(0,-1).reverse())I1(H,W,U)}let F=(Y)=>Y.reduce((H,T)=>H+K.get(T).width,0)+Math.max(0,Y.length-1)*Q.columnGap,P=Math.max(0,...B.map(F)),M=new Map,A=0;return B.forEach((Y,H)=>{let T=(P-F(Y))/2,O=0;for(let _ of Y){let w=K.get(_);M.set(_,{...w,x:T,y:A,layer:H}),T+=w.width+Q.columnGap,O=Math.max(O,w.height)}A+=O+Q.rowGap}),{nodes:M,width:P,height:Math.max(0,A-Q.rowGap)}}var W$=124,z$=64,f$=20,F0=15,v1=50,s4=18,O0=14,d0=36,S0=12,F2=26,t4=18,e4=4,g1=H1,f1=6,S$=18,$3=5.5,P2={input:\"Required input\",optional:\"Optional input\",gate:\"Failure gate\"},X3={cancelled:!0,completed:!0,failed:!0},Z3={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 h1($,X,Q){if(Q)$.opened.add(X);return $.opened.has(X)}function v$($){let X=new Map,Q=(K,J)=>{for(let W of K??[])X.set(W,[...X.get(W)??[],J])};return Q($.dependencies,\"input\"),Q($.optionalDependencies,\"optional\"),Q($.skipAfterFailureOf,\"gate\"),X}function Q3($){return $.status===\"completed\"||$.skipReason===\"policy\"}function V1($,X,Q){let K=$.includes(\"gate\"),J=X.status===\"failed\"||X.status===\"cancelled\";if(K&&J)return\"tripped\";if(Q.status===\"planned\")return\"candidate\";if($.length===1&&K)return\"settled\";if(!Q3(X))return J?\"blocked\":\"unused\";if(Q.status===\"running\")return\"active\";return Q.status===\"skipped\"&&Q.skipReason!==\"policy\"?\"unused\":\"used\"}function J3($){return $.state===\"tripped\"?\"gate\":$.kinds[0]}var K3={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}.`},W3={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 j1($){return $===void 0||$===\"pending\"?\"planned\":$}function z3($,X){let{itemKey:Q,iteration:K}=$.origin??{};return(Q!==void 0?X.get(Q):void 0)??(K!==void 0?`iteration ${K}`:Q??$.pipelineId)}function D1($,X=s4){return $.length>X?$.slice(0,Math.max(1,X-1))+\"…\":$}function Y3($){return $.y+($.kind===\"run\"&&$.graph?0:f$-F0-3)}function E1($,X,Q){let K=$.find((J)=>J.stepId===X);return K?Math.max(K.count,Q):Q}function B3($,X,Q,K,J,W,z,q){let G=new Map($.agentTurn?.calls.map((C)=>[C.callId,C.tool])??[]),B=[...Q].sort((C,b)=>(C.origin?.iteration??0)-(b.origin?.iteration??0)||C.startedAtMs-b.startedAtMs),U=B.filter((C)=>C.subtreeIsRunning).length,F=[];for(let C of B.slice(0,g1)){let b=z3(C,G),k=z.canLoad&&q+1<f1;if(k)z.expandable.add(C.runId);let f=k&&(z.toggles.get(C.runId)??h1(z,C.runId,C.subtreeIsRunning&&U===1)),S=f?z.loads.get(C.runId):void 0;if(f)z.wanted.add(C.runId);let h=S&&S!==\"missing\"?x1(S.run,S.children,z,q+1,S.childSteps):void 0;F.push({kind:\"run\",summary:C,label:b,expandable:k,expanded:f,graph:h,unavailable:S===\"missing\",x:0,y:0,width:h?Math.max(W$,h.width+S0*2):W$,height:h?F2+h.height+S0:z$})}let P=F.length;for(let C of K.slice(0,Math.max(0,g1-F.length)))F.push({kind:\"item\",detail:C,label:C.name??G.get(C.id)??C.id,x:0,y:0,width:W$,height:z$});let M=W-P,A=K.length-(F.length-P),Y=[M>0&&`+${M} more in the run list`,A>0&&`+${A} more in the timeline`,J>0&&`${J} progress rows not recorded`].filter(Boolean).join(\" · \"),H=X.nestedPipeline?.mode===\"iterate\"?1:e4,T=[];for(let C=0;C<F.length;C+=H)T.push(F.slice(C,C+H));let O=(C)=>C.reduce((b,k)=>b+k.width,0)+(C.length-1)*O0,_=Math.max(W$,...T.map(O)),w=S0;for(let C of T){let b=S0+(_-O(C))/2;for(let k of C)k.x=b,k.y=w,b+=k.width+O0;w+=Math.max(...C.map((k)=>k.height))+(H===1?d0/2:O0)}let I=H===1?F.slice(1).map((C,b)=>{let k=F[b];return`M${k.x+k.width/2} ${k.y+k.height-4}V${Y3(C)}`}):[],E=F.length?w-(H===1?d0/2:O0):S0,c=_+S0*2;return{x:0,y:z$,width:c,height:E+(Y?t4:0)+S0,items:F,links:I,...Y?{more:Y}:{}}}function x1($,X,Q,K,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 W=new Map($.steps.map((Y)=>[Y.id,Y])),z=$.steps.map((Y)=>{let H=`${$.runId}/${Y.id}`,T=X.filter((h)=>h.origin?.stepId===Y.id),O=new Set(T.map((h)=>h.origin?.itemKey)),_=Y.nestedPipeline?.mode,I=(_===\"single\"||_===\"iterate\")&&T.length>0?[]:(Y.progress?.details??[]).filter((h)=>!h.depth&&!O.has(h.id)),E=Y.progress?.details??[],c=Y.nestedPipeline?0:Math.max(0,(Y.progress?.detailCount??E.length)-E.length),C=E1(J,Y.id,T.length),b=C+I.length,k=b>0&&K<f1&&(Q.toggles.get(H)??h1(Q,H,Y.status===\"running\"&&T.length>0)),f=k?B3($,Y,T,I,c,C,Q,K):void 0,S=Math.max(W$,f?.width??0);if(f)f.x=(S-f.width)/2;return{key:H,step:Y,x:0,y:0,width:S,height:f?z$+f.height+6:z$,itemCount:b,expanded:k,expansion:f}}),q=new Map($.steps.map((Y)=>[Y.id,v$(Y)])),G=S1(z.map(({key:Y,width:H,height:T})=>({id:Y,width:H,height:T})),$.steps.flatMap((Y)=>[...q.get(Y.id).keys()].map((H)=>({from:`${$.runId}/${H}`,to:`${$.runId}/${Y.id}`}))),{columnGap:O0,rowGap:d0}),B=new Map,U=[],F=new Map;for(let Y of z){let H=G.nodes.get(Y.key);Y.x=H.x,Y.y=H.y,B.set(Y.step.id,Y),F.set(Y.step.id,H.layer),U[H.layer]=H.y}let P=G.width,M=0,A=[];for(let Y of z)for(let[H,T]of q.get(Y.step.id)){let O=B.get(H);if(!O)continue;let _=O.x+O.width/2,w=O.y+(O.expansion?O.height:v1+8),I=Y.x+Y.width/2,E=Y.y+f$-F0-3,c=F.get(H)+1,C=F.get(Y.step.id),b=z.filter((S)=>{let h=F.get(S.step.id);return h>=c&&h<C}),k=b.some((S)=>S.x<Math.max(_,I)+O0&&S.x+S.width>Math.min(_,I)-O0),f;if(k){let S=Math.max(...b.map((o)=>o.x+o.width))+O0/2+M*6;M+=1,P=Math.max(P,S+O0/2);let h=U[c]-d0/2,d=U[C]-d0/2;f=`M${_} ${w}C${_} ${h} ${S} ${h} ${S} ${U[c]}V${U[C]-d0}C${S} ${d} ${I} ${d} ${I} ${E-4}`}else{let S=(w+E)/2;f=`M${_} ${w}C${_} ${S} ${I} ${S} ${I} ${E-4}`}A.push({from:H,to:Y.step.id,kinds:T,state:V1(T,W.get(H),Y.step),path:f,head:`M${I-4} ${E-7}L${I} ${E}L${I+4} ${E-7}Z`})}return{run:$,width:P,height:G.height,steps:z,edges:A}}function h$($){return(X)=>{if(X.key!==\"Enter\"&&X.key!==\" \")return;X.preventDefault(),$()}}function m1({count:$,expanded:X,label:Q,onToggle:K}){let J=()=>K();return Z(\"g\",{class:`graph-badge${X?\" expanded\":\"\"}`,transform:`translate(${F0-2} ${F0-3})`,role:\"button\",tabIndex:0,\"aria-expanded\":X,\"aria-label\":`${X?\"Collapse\":\"Expand\"} ${Q}`,onClick:(W)=>{W.stopPropagation(),J()},onKeyDown:h$(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 H2($){let X=Z3[$.status];return Z(\"g\",{class:`graph-node ${$.kind} ${$.status}${$.selected?\" selected\":\"\"}${$.pulse?\" pulse\":\"\"}`,transform:`translate(${$.cx} ${f$})`,children:[Z(\"g\",{class:\"graph-hit\",role:\"button\",tabIndex:0,\"aria-pressed\":$.selected,\"aria-label\":`${$.title}: ${$.status}`,onClick:$.onSelect,onKeyDown:h$($.onSelect),children:[Z(\"title\",{children:`${$.title} · ${$.status}`},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-halo\",r:F0+8},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-focus\",r:F0+4},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-disc\",r:F0},void 0,!1,void 0,this),$.kind===\"run\"&&Z(\"circle\",{class:\"graph-ring\",r:F0-4},void 0,!1,void 0,this),Z(\"circle\",{class:\"graph-spinner\",r:F0,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:v1-f$,children:D1($.label)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.badge]},void 0,!0,void 0,this)}function Y$($,X){return $!==null&&JSON.stringify($)===JSON.stringify(X)}function q3({expansion:$,run:X,step:Q,ui:K}){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 G={kind:\"item\",runId:X.runId,stepId:Q.id,itemId:J.detail.id},B=j1(J.detail.status??\"running\");return Z(\"g\",{transform:`translate(${J.x} ${J.y})`,children:Z(H2,{cx:J.width/2,kind:\"item\",label:J.label,title:J.label,status:B,selected:Y$(K.selection,G),pulse:K.pulse(`${X.runId}/${Q.id}/${J.detail.id}`,B),onSelect:()=>K.select(G)},void 0,!1,void 0,this)},\"item:\"+J.detail.id,!1,void 0,this)}let{summary:W}=J,z={kind:\"run\",runId:W.runId},q=Z(m1,{count:W.stepCount,expanded:J.expanded,label:J.label,onToggle:()=>K.toggle(W.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 ${W.status}${Y$(K.selection,z)?\" 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:()=>K.select(z),onKeyDown:h$(()=>K.select(z)),children:[Z(\"rect\",{width:J.width,height:F2-4,rx:8},void 0,!1,void 0,this),Z(\"text\",{x:10,y:15,children:D1(J.label===W.pipelineId?J.label:`${J.label} · ${W.pipelineId}`,Math.floor((J.width-40)/$3))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"g\",{transform:`translate(${J.width-12-(F0-2)} ${11-(F0-3)})`,children:q},void 0,!1,void 0,this),Z(\"g\",{transform:`translate(${(J.width-J.graph.width)/2} ${F2})`,children:Z(c1,{scene:J.graph,ui:K},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},W.runId,!0,void 0,this);return Z(\"g\",{transform:`translate(${J.x} ${J.y})`,children:Z(H2,{cx:J.width/2,kind:\"run\",label:J.unavailable?\"unavailable\":J.expanded?\"loading…\":J.label,title:`${J.label} (${W.pipelineId})`,status:W.status,selected:Y$(K.selection,z),pulse:K.pulse(W.runId,W.status),onSelect:()=>K.select(z),badge:J.unavailable||!J.expandable?void 0:q},void 0,!1,void 0,this)},W.runId,!1,void 0,this)}),$.more&&Z(\"text\",{class:\"graph-more\",x:$.width/2,y:$.height-S0,children:$.more},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function c1({scene:$,ui:X}){let Q=$.run.runId;return Z(\"g\",{class:\"graph-run\",children:[$.edges.map((K)=>{let J={kind:\"edge\",runId:Q,from:K.from,to:K.to},W=()=>X.select(J);return Z(\"g\",{class:`graph-edge-group ${J3(K)} ${K.state}${Y$(X.selection,J)?\" selected\":\"\"}`,role:\"button\",tabIndex:0,\"aria-label\":`Connection ${K.from} to ${K.to}`,onClick:W,onKeyDown:h$(W),children:[Z(\"title\",{children:`${K.from} → ${K.to} · ${K.kinds.map((z)=>P2[z]).join(\", \")}`},void 0,!1,void 0,this),Z(\"path\",{class:\"graph-edge-hit\",d:K.path},void 0,!1,void 0,this),Z(\"path\",{class:\"graph-edge\",d:K.path},void 0,!1,void 0,this),K.state===\"active\"&&Z(\"path\",{class:\"graph-edge-flow\",d:K.path},void 0,!1,void 0,this),Z(\"path\",{class:\"graph-edge-head\",d:K.head},void 0,!1,void 0,this)]},K.from+\"->\"+K.to,!0,void 0,this)}),$.steps.map((K)=>{let{step:J}=K,W={kind:\"step\",runId:Q,stepId:J.id};return Z(\"g\",{transform:`translate(${K.x} ${K.y})`,children:[K.expansion&&Z(q3,{expansion:K.expansion,run:$.run,step:J,ui:X},void 0,!1,void 0,this),Z(H2,{cx:K.width/2,kind:\"step\",label:J.name||J.id,title:J.name?`${J.name} (${J.id})`:J.id,status:J.status,selected:Y$(X.selection,W),pulse:X.pulse(K.key,J.status),onSelect:()=>X.select(W),badge:K.itemCount>0&&Z(m1,{count:K.itemCount,expanded:K.expanded,label:J.name||J.id,onToggle:()=>X.toggle(K.key,!K.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 g$({rows:$}){return Z(\"dl\",{class:\"graph-facts\",children:$.map(([X,Q])=>Z(j,{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 y1({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((K)=>Z(\"button\",{type:\"button\",onClick:K.onSelect,children:[Z(z0,{value:K.status},void 0,!1,void 0,this),Z(\"code\",{children:K.id},void 0,!1,void 0,this),Z(\"small\",{children:K.kinds.map((J)=>P2[J]).join(\" + \")},void 0,!1,void 0,this)]},K.id,!0,void 0,this))]},void 0,!0,void 0,this)}function U3({runs:$,total:X,onOpenRun:Q}){if($.length===0)return null;let K=X>$.length?`${$.length} of ${X}`:String($.length);return Z(\"div\",{class:\"graph-io\",children:[Z(\"h4\",{children:[\"Nested runs (\",K,\")\"]},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(z0,{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:[H0(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 y$=($,X)=>X===void 0?\"—\":\"+\"+H0(X-$.startedAtMs);function G3({selection:$,ctx:X,ui:Q,onOpenRun:K}){let J=$?X.runs.get($.runId):void 0;if($?.kind===\"run\"){let W=X.summaries.get($.runId);if(W){let q=(W.parentRunId?X.runs.get(W.parentRunId):void 0)?.agentTurn?.calls.find((B)=>B.callId===W.origin?.itemKey)?.tool,G=X.wanted.has(W.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:W.pipelineId},void 0,!1,void 0,this),Z(z0,{value:W.status},void 0,!1,void 0,this),Z(g$,{rows:[[\"Run\",Z(\"code\",{title:W.runId,children:y0(W.runId)},void 0,!1,void 0,this)],...W.origin?.stepId?[[\"Started by\",Z(\"code\",{children:W.origin.stepId},void 0,!1,void 0,this)]]:[],...q?[[\"Tool\",Z(\"code\",{children:q},void 0,!1,void 0,this)]]:[],...W.origin?.iteration!==void 0?[[\"Iteration\",String(W.origin.iteration)]]:[],...W.origin?.itemKey!==void 0&&!q?[[\"Item\",Z(\"code\",{children:W.origin.itemKey},void 0,!1,void 0,this)]]:[],[\"Duration\",H0(W.durationMs)],[\"Steps\",String(W.stepCount)],[\"Nested\",String(W.descendantCount)]]},void 0,!1,void 0,this),Z(\"div\",{class:\"graph-actions\",children:[Z(\"button\",{class:\"primary-button\",type:\"button\",onClick:()=>K(W.runId),children:\"Open run\"},void 0,!1,void 0,this),X.expandable.has(W.runId)&&Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>Q.toggle(W.runId,!G),children:G?\"Collapse steps\":\"Show steps\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X.canLoad&&!X.expandable.has(W.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 W=J.steps.find((q)=>q.id===$.stepId),z=W?.progress?.details?.find((q)=>q.id===$.itemId);if(W&&z)return Z(\"div\",{class:\"graph-inspector\",children:[Z(\"div\",{class:\"graph-kicker\",children:[\"Dynamic item · \",W.name||W.id]},void 0,!0,void 0,this),Z(\"h3\",{children:z.name??z.id},void 0,!1,void 0,this),Z(z0,{value:j1(z.status??\"running\"),outputSource:z.outputSource},void 0,!1,void 0,this),Z(g$,{rows:[[\"Item\",Z(\"code\",{children:z.id},void 0,!1,void 0,this)],...z.label?[[\"Activity\",z.label]]:[],...z.total!==void 0?[[\"Progress\",`${z.completed??0} / ${z.total}`]]:[]]},void 0,!1,void 0,this),Z(\"p\",{class:\"graph-hint\",children:[\"Reported by \",W.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:W.id}),children:[\"Inspect \",W.id]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}if(J&&$?.kind===\"edge\"){let W=J.steps.find((G)=>G.id===$.from),z=J.steps.find((G)=>G.id===$.to),q=z?v$(z).get($.from):void 0;if(W&&z&&q){let G=V1(q,W,z);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:[W.id,\" → \",z.id]},void 0,!0,void 0,this),q.map((B)=>Z(\"p\",{class:\"graph-hint\",children:[Z(\"b\",{children:[P2[B],\".\"]},void 0,!0,void 0,this),\" \",W3[B](W.id,z.id)]},B,!0,void 0,this)),Z(\"p\",{class:`graph-edge-state ${G}`,children:K3[G](W.id,z.id)},void 0,!1,void 0,this),Z(g$,{rows:[[\"Source\",Z(z0,{value:W.status,outputSource:W.outputSource},void 0,!1,void 0,this)],[\"Target\",Z(z0,{value:z.status,outputSource:z.outputSource},void 0,!1,void 0,this)],[\"Output ready\",y$(J,W.finishedAtMs)],[\"Consumed\",y$(J,z.startedAtMs)]]},void 0,!1,void 0,this),W.artifacts&&W.artifacts.length>0&&Z(\"div\",{class:\"graph-io\",children:[Z(\"h4\",{children:\"Recorded source artifacts\"},void 0,!1,void 0,this),Z(O$,{artifacts:W.artifacts,stepId:W.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"graph-actions\",children:[W,z].map((B)=>Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>Q.select({kind:\"step\",runId:J.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(J&&$?.kind===\"step\"){let W=J.steps.find((z)=>z.id===$.stepId);if(W){let z=(F)=>J.steps.find((P)=>P.id===F)?.status,q=[...v$(W)].map(([F,P])=>({id:F,kinds:P,status:z(F)??\"planned\",onSelect:()=>Q.select({kind:\"edge\",runId:J.runId,from:F,to:W.id})})),G=J.steps.flatMap((F)=>{let P=v$(F).get(W.id);return P?[{id:F.id,kinds:P,status:F.status,onSelect:()=>Q.select({kind:\"edge\",runId:J.runId,from:W.id,to:F.id})}]:[]}),B=(X.children.get(J.runId)??[]).filter((F)=>F.origin?.stepId===W.id),U=E1(X.childSteps.get(J.runId)??[],W.id,B.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(_$,{step:W,steps:J.steps},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(g$,{rows:[[\"Started\",y$(J,W.startedAtMs)],[\"Finished\",y$(J,W.finishedAtMs)]]},void 0,!1,void 0,this),Z(y1,{title:\"Inputs\",empty:\"None: this step starts the graph.\",rows:q},void 0,!1,void 0,this),Z(y1,{title:\"Consumers\",empty:\"None: no later step depends on this output.\",rows:G},void 0,!1,void 0,this),Z(U3,{runs:B,total:U,onOpenRun:K},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 N3(){let $=q0(new Map),X=q0(new Set);return(Q,K)=>{let J=$.current.get(Q);if($.current.set(Q,K),J!==void 0&&J!==K)if(X3[K])X.current.add(Q);else X.current.delete(Q);return X.current.has(Q)}}function F3($){return JSON.stringify([$.runId,$.eventCount,$.subtreeEventCount,$.status])}function H3($,X){let Q=[];for(let K of $){let J=JSON.parse(K)[0];if(typeof J===\"string\"&&X.get(J)!==K)Q.push({key:K,runId:J})}return Q}function l1({detail:$,api:X,onOpenRun:Q,focus:K}){let[J,W]=R(new Map),z=q0(new Set),[q,G]=R(new Map),[B,U]=R(null),F=q0(new Map),[P,M]=R(0),A=N3(),Y=q0(null);l(()=>{if(!K)return;U({kind:\"step\",runId:$.run.runId,stepId:K.stepId}),Y.current?.scrollIntoView({block:\"nearest\",behavior:w$()})},[K?.request]);let H={loads:q,toggles:J,opened:z.current,canLoad:X!==void 0,expandable:new Set,wanted:new Set,runs:new Map,children:new Map,childSteps:new Map,summaries:new Map},T=x1($.run,$.children,H,0,$.childSteps),O=[...H.wanted].sort().map((E)=>F3(H.summaries.get(E))).join(`\n`);l(()=>{if(!X||!O)return;let E=H3(O.split(`\n`),F.current);if(E.length===0)return;let c=!0,C=!1;for(let{key:b,runId:k}of E)X.loadRunDetail(k).then((f)=>{if(!c)return;F.current.set(k,b),G((S)=>new Map(S).set(k,f??\"missing\"))},()=>{if(c&&!C)C=!0,setTimeout(()=>{if(c)M((f)=>f+1)},R1)});return()=>{c=!1}},[X,O,P]);let _={selection:B,select:U,toggle:(E,c)=>W((C)=>new Map(C).set(E,c)),pulse:A},w=T.width+S$*2,I=T.height+S$*2;return Z(\"section\",{class:\"graph-panel\",\"aria-label\":\"Run graph\",children:[Z(\"div\",{class:\"graph-canvas\",children:Z(\"svg\",{width:w,height:I,viewBox:`${-S$} ${-S$} ${w} ${I}`,role:\"group\",\"aria-label\":`${$.run.pipelineId} step graph`,children:Z(c1,{scene:T,ui:_},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z(\"div\",{ref:Y,children:Z(G3,{selection:B,ctx:H,ui:_,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 P3($){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 M3($,X,Q,K){let J=X.trim().toLowerCase();return $.filter((W)=>(Q===\"all\"||W.level===Q)&&(K===\"all\"||(K===\"unattributed\"?!W.stepId:W.stepId===K.slice(5)))&&(!J||W.message.toLowerCase().includes(J)))}function V$({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(V$,{cause:$.cause},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function p1({error:$,failedStepIds:X=[],onSelectStep:Q}){let K=$.fanOut;return Z(\"section\",{\"aria-label\":\"Run diagnostics\",class:\"error-card\",children:[X.length>0&&Z(\"div\",{class:\"error-steps\",children:[Z(\"span\",{children:\"Failed at\"},void 0,!1,void 0,this),X.map((J)=>Q?Z(\"button\",{type:\"button\",onClick:()=>Q(J),children:J},J,!1,void 0,this):Z(\"code\",{children:J},J,!1,void 0,this))]},void 0,!0,void 0,this),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((J,W)=>Z(\"li\",{children:[Z(\"code\",{children:P3(J.path)},void 0,!1,void 0,this),Z(\"span\",{children:J.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(V$,{cause:$.cause},void 0,!1,void 0,this)},void 0,!1,void 0,this),K&&Z(\"div\",{class:\"debug-group\",children:[Z(\"strong\",{children:[\"Failed fan-out items · \",K.failureCount]},void 0,!0,void 0,this),K.failures.map((J)=>Z(\"details\",{class:\"debug-cause\",children:[Z(\"summary\",{children:[\"#\",J.index+1,\" · \",J.key,J.keyTruncated&&\" (key truncated)\",\" ·\",\" \",J.cancelled?\"cancelled\":\"failed\",\" · \",J.error.message]},void 0,!0,void 0,this),Z(\"div\",{class:\"debug-cause-body\",children:[J.error.name&&Z(\"div\",{children:[\"Type: \",J.error.name]},void 0,!0,void 0,this),J.error.sourceCode&&Z(\"div\",{children:[\"Source code: \",J.error.sourceCode]},void 0,!0,void 0,this),J.error.cause&&Z(V$,{cause:J.error.cause},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},J.index,!0,void 0,this)),K.omittedFailureCount>0&&Z(\"div\",{class:\"debug-note\",children:[K.omittedFailureCount,\" more failures omitted from the recording\"]},void 0,!0,void 0,this),K.schedulerError&&Z(V$,{cause:K.schedulerError,label:\"Scheduler error\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function L3($){if(!Number.isFinite($)||Math.abs($)>8640000000000000)return\"\";return new Intl.DateTimeFormat(void 0,{hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\"}).format($)}function u1({logs:$}){let[X,Q]=R(\"\"),[K,J]=R(\"all\"),[W,z]=R(\"all\"),q=[...new Set($.flatMap((B)=>B.stepId?[B.stepId]:[]))].sort(),G=M3($,X,K,W);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:G.length===$.length?$.length:`${G.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:(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:K,onChange:(B)=>J(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:W,onChange:(B)=>z(B.currentTarget.value),children:[Z(\"option\",{value:\"all\",children:\"All steps\"},void 0,!1,void 0,this),$.some((B)=>!B.stepId)&&Z(\"option\",{value:\"unattributed\",children:\"No step\"},void 0,!1,void 0,this),q.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),G.length?Z(\"div\",{class:\"logs\",children:G.map((B)=>Z(\"div\",{class:\"log-line\",children:[Z(\"time\",{class:\"log-time\",children:L3(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 d1($){if(!Number.isFinite($)||Math.abs($)>8640000000000000)return\"\";return new Intl.DateTimeFormat(void 0,{dateStyle:\"medium\",timeStyle:\"medium\"}).format($)}function o1($){if(!Number.isFinite($)||Math.abs($)>8640000000000000)return\"\";return new Date($).toISOString()}function i1($,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 B$=($,X)=>`${$} ${X}${$===1?\"\":\"s\"}`;function A3($){let X=$.steps.length,Q=(W)=>$.steps.filter((z)=>z.status===W).length,K=Q(\"skipped\"),J=K?` · ${K} skipped`:\"\";switch($.status){case\"running\":{let W=X-Q(\"running\")-Q(\"planned\");return X?`Running · ${W} of ${B$(X,\"step\")} finished`:\"Starting\"}case\"completed\":return`Completed ${B$(Q(\"completed\"),\"step\")} in ${H0($.durationMs)}${J}`;case\"cancelled\":return`Cancelled after ${Q(\"completed\")} of ${B$(X,\"step\")}${J}`;case\"failed\":{let W=$.steps.filter((z)=>z.status===\"failed\").map((z)=>z.id);if(W.length)return`Failed at ${W.join(\", \")}${J}`;return $.error?.message?`Failed: ${$.error.message}`:\"Failed\"}}return $.status}function O3({nowMs:$,onSelect:X,run:Q,selectedRootRunId:K}){let{activity:J,descendantCount:W}=Q;return Z(\"button\",{class:`run-row ${Q.status} ${K===Q.runId?\"selected\":\"\"}`,\"data-run-id\":Q.runId,onClick:()=>X(Q.runId),children:[Z(\"div\",{class:\"run-primary\",children:[Z(z0,{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:o1(Q.startedAtMs),title:d1(Q.startedAtMs),children:i1(Q.startedAtMs,$)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"run-secondary\",children:[Z(\"code\",{children:y0(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:H0(Q.durationMs)},void 0,!1,void 0,this),Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Z(\"span\",{children:B$(Q.stepCount,\"step\")},void 0,!1,void 0,this),W>0&&Z(j,{children:[Z(\"i\",{class:\"dot\"},void 0,!1,void 0,this),Z(\"span\",{children:[W,\" nested run\",W===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: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 _3($){return[\"running\",\"failed\",\"cancelled\",\"skipped\",\"completed\",\"planned\"].map((Q)=>[Q,$.steps.filter((K)=>K.status===Q).length]).filter(([,Q])=>Q).map(([Q,K])=>K+\" \"+Q).join(\" · \")||\"No steps\"}function T3($,X){let Q=[...$],K=new Set(Q.map((J)=>J.runId));for(let J of X){if(K.has(J.runId))continue;K.add(J.runId),Q.push(J)}return Q}function b3({api:$,detail:X,onSelect:Q}){let[K,J]=R([]),[W,z]=R(1),[q,G]=R(!1),[B,U]=R(!1),[F,P]=R(),M=T3(X.children,K);if(X.childCount===0)return null;let A=()=>{if(!$||q||B||M.length>=X.childCount)return;G(!0),P(void 0),$.loadChildRuns(X.run.runId,W).then((Y)=>{if(G(!1),!Y){P(\"This run is no longer in history.\"),U(!0);return}let H=new Set(M.map((O)=>O.runId)),T=Y.children.filter((O)=>!H.has(O.runId));if(T.length===0){U(!0);return}J((O)=>[...O,...T]),z(Y.page+1)},(Y)=>{G(!1),P(Y instanceof Error?Y.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:[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 H=Y.descendantCount;return Z(\"button\",{class:\"nested-run\",type:\"button\",onClick:()=>Q(Y.runId),children:[Z(z0,{value:Y.status},void 0,!1,void 0,this),Z(\"strong\",{children:Y.pipelineId},void 0,!1,void 0,this),Z(\"small\",{children:[H0(Y.durationMs),\" · \",B$(Y.stepCount,\"step\"),H?\" · \"+H+\" nested\":\"\"]},void 0,!0,void 0,this)]},Y.runId,!0,void 0,this)})},void 0,!1,void 0,this),F&&Z(\"p\",{role:\"alert\",children:F},void 0,!1,void 0,this),$&&!B&&M.length<X.childCount&&Z(\"div\",{class:\"confirm-actions\",children:Z(\"button\",{class:\"secondary-button\",type:\"button\",disabled:q,onClick:A,children:q?\"Loading…\":\"Show more\"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function C3({api:$,canCancel:X,cancelling:Q,liveRunIds:K,nowMs:J,onCancel:W,onCopyLink:z,onSelect:q,onStepView:G,selection:B,stepView:U=\"timeline\",latestRunId:F}){let[P,M]=R(),A=B.status===\"ready\"?B.detail.run.runId:void 0;if(l(()=>M(void 0),[A]),l(()=>{if(!P||U!==\"timeline\")return;let O=document.querySelector(`.step-list [data-step-id=\"${CSS.escape(P.stepId)}\"]`);if(!O)return;O.scrollIntoView({block:\"center\",behavior:w$()}),O.classList.remove(\"focused\"),O.offsetWidth,O.classList.add(\"focused\")},[P,U]),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),F&&Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:()=>q(F),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(l0,{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:Y}=B,{run:H,ancestors:T}=Y;return Z(\"article\",{class:\"sheet detail\",children:Z(\"div\",{class:\"detail-body\",children:[T.length>0&&Z(\"div\",{class:\"run-parentage\",children:[T.map((O)=>Z(\"span\",{children:[Z(\"button\",{type:\"button\",onClick:()=>q(O.runId),children:O.pipelineId},void 0,!1,void 0,this),Z(\"span\",{children:\" / \"},void 0,!1,void 0,this)]},O.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\",\" ·\",\" \",i1(H.startedAtMs,J)]},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:A3(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(z0,{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:()=>z(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),X&&H.status===\"running\"&&!H.parentRunId&&K.includes(H.runId)&&Z(\"button\",{class:\"danger-button\",type:\"button\",disabled:Q,onClick:()=>W(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:o1(H.startedAtMs),children:d1(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:H0(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(p1,{error:H.error,failedStepIds:H.steps.filter((O)=>O.status===\"failed\").map((O)=>O.id),onSelectStep:(O)=>M((_)=>({stepId:O,request:(_?.request??0)+1}))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"section-title\",children:[Z(\"span\",{children:U===\"graph\"?\"Step graph\":\"Step timeline\"},void 0,!1,void 0,this),Z(\"span\",{class:\"section-title-actions\",children:[_3(H),G&&H.steps.length>0&&Z(\"span\",{class:\"view-toggle\",role:\"group\",\"aria-label\":\"Step view\",children:[\"timeline\",\"graph\"].map((O)=>Z(\"button\",{type:\"button\",\"aria-pressed\":U===O,onClick:()=>G(O),children:O===\"graph\"?\"Graph\":\"Timeline\"},O,!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(l0,{title:\"No planned steps\",copy:\"This run ended before a step plan was recorded.\"},void 0,!1,void 0,this):U===\"graph\"?Z(l1,{detail:Y,api:$,onOpenRun:q,focus:P},H.runId,!1,void 0,this):Z(\"div\",{class:\"step-list\",children:H.steps.map((O)=>Z(_$,{step:O,steps:H.steps},O.id,!1,void 0,this))},void 0,!1,void 0,this),Z(b3,{api:$,detail:Y,onSelect:q},H.runId,!1,void 0,this),H.logs.length>0&&Z(u1,{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 r1($){let[X,Q]=R($.stepView??\"timeline\"),K=$.roots.filter((z)=>z.subtreeIsRunning),J=$.roots.filter((z)=>!z.subtreeIsRunning),W=(z,q)=>q.length?Z(j,{children:[Z(\"div\",{class:\"run-group\",children:[z,\" · \",q.length]},void 0,!0,void 0,this),q.map((G)=>Z(O3,{nowMs:$.nowMs,onSelect:$.onSelect,run:G,selectedRootRunId:$.selection.status===\"ready\"||$.selection.status===\"loading\"?$.selection.summary?.rootRunId:void 0},G.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:[$.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(j,{children:[W(\"Running now\",K),W(\"Recent\",J)]},void 0,!0,void 0,this):Z(l0,{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)>B0&&Z(\"div\",{class:\"confirm-actions\",children:[Z(\"button\",{class:\"secondary-button\",disabled:!$.offset,onClick:()=>$.onPage?.(Math.max(0,($.offset??0)-B0)),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)+B0>=($.matchingRootCount??0),onClick:()=>$.onPage?.(($.offset??0)+B0),children:\"Next\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z(C3,{...$,stepView:X,onStepView:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function R3($){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 k3($,X){let Q={};return $.parameters.forEach((K,J)=>{let W=X(K,J);if(K.type===\"boolean\"){let q=W[0];if(q!==Boolean(K.default))Q[K.key]=q;return}if(K.multiple){Q[K.key]=K.type===\"number\"?W.filter((q)=>typeof q===\"number\"):W.filter((q)=>typeof q===\"string\");return}let z=W[0];if(z!==\"\"&&z!==void 0)Q[K.key]=z}),Q}function w3($,X){let Q={};return $.parameters.forEach((K,J)=>{if(K.group!==\"execution\")return;let W=X(K,J);if(K.type===\"boolean\"){if(W[0]===!0)Q[K.key]=!0;return}if(K.multiple&&W.length)Q[K.key]=W.filter((z)=>typeof z===\"string\")}),Q}function I3($){return $.key.replace(/([a-z0-9])([A-Z])/g,\"$1 $2\").replace(/[-_]+/g,\" \").replace(/\\b\\w/g,(X)=>X.toUpperCase())}function S3($){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 g3({index:$,onChange:X,parameter:Q,values:K}){let J=\"run-param-\"+$,W=S3(Q),z=I3(Q);if(Q.type===\"boolean\")return Z(\"label\",{class:\"boolean-field\",for:J,children:[Z(\"span\",{children:[Z(\"strong\",{children:z},void 0,!1,void 0,this),Z(\"small\",{children:W||\"Enable this option.\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"input\",{id:J,type:\"checkbox\",checked:K[0]===!0,onChange:(B)=>X($,[B.currentTarget.checked])},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let q=Z(\"label\",{for:J,children:[z,Q.required&&Z(\"span\",{class:\"required-mark\",children:\"required\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),G;if(Q.choices){let B=K.filter((U)=>typeof U===\"string\");G=Z(\"select\",{id:J,multiple:Q.multiple,required:Q.required,value:Q.multiple?void 0:B[0]??\"\",onChange:(U)=>X($,Q.multiple?Array.from(U.currentTarget.selectedOptions,(F)=>F.value):[U.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((U)=>Z(\"option\",{value:U,selected:Q.multiple?B.includes(U):void 0,children:U},U,!1,void 0,this))]},void 0,!0,void 0,this)}else if(Q.multiple)G=Z(\"textarea\",{id:J,spellcheck:!1,placeholder:\"One value per line\",value:String(K[0]??\"\"),onInput:(B)=>X($,[B.currentTarget.value])},void 0,!1,void 0,this);else if(Q.type===\"number\"){let B=K[0]??\"\";G=Z(\"input\",{id:J,type:\"number\",value:String(B),step:Q.integer?\"1\":\"any\",min:Q.min,max:Q.max,required:Q.required,onInput:(U)=>X($,U.currentTarget.value!==\"\"?[Number(U.currentTarget.value)]:[U.currentTarget.value])},void 0,!1,void 0,this)}else{let B=K[0]??\"\";G=Z(\"input\",{id:J,type:\"text\",value:String(B),placeholder:Q.type===\"path\"?Q.pathKind===\"directory\"?\"./directory\":\"./file\":\"\",required:Q.required,onInput:(U)=>X($,[U.currentTarget.value])},void 0,!1,void 0,this)}return Z(\"div\",{class:\"field\",children:[q,G,W&&Z(\"div\",{class:\"field-hint\",children:W},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function y3({command:$,onChange:X,values:Q}){let K=(W,z,q)=>{let G=$.parameters.map((U,F)=>({index:F,parameter:U})).filter(({parameter:U})=>U.group===\"execution\"===W);if(!G.length)return null;let B=Z(\"div\",{class:\"parameter-grid\",children:G.map(({index:U,parameter:F})=>Z(g3,{index:U,onChange:X,parameter:F,values:Q[U]??[]},F.key,!1,void 0,this))},void 0,!1,void 0,this);return W?Z(\"details\",{class:\"form-section execution-controls\",children:[Z(\"summary\",{class:\"form-section-head\",children:[Z(\"strong\",{children:z},void 0,!1,void 0,this),Z(\"span\",{children:q},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:z},void 0,!1,void 0,this),Z(\"span\",{children:q},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B]},void 0,!0,void 0,this)},J=$.parameters.filter((W)=>W.group!==\"execution\").length;return Z(\"div\",{class:\"parameter-fields\",id:\"parameterFields\",children:[K(!1,\"Pipeline inputs\",J+\" parameter\"+(J===1?\"\":\"s\")),J===0&&Z(\"p\",{class:\"form-empty\",children:\"This pipeline takes no inputs.\"},void 0,!1,void 0,this),K(!0,\"Execution controls\",\"Built into Tubeless · dry run, step selection, cache, concurrency\")]},void 0,!0,void 0,this)}function a1({api:$,commands:X,commandId:Q,onClose:K,onLaunched:J}){let[W,z]=R(Q??X[0]?.id??\"\"),q=X.find((b)=>b.id===W),[G,B]=R([]),[U,F]=R(null),[P,M]=R(\"\"),[A,Y]=R(!1),[H,T]=R(!1),O=q0(null),_=q0(0);if(l(()=>{z(Q??X[0]?.id??\"\")},[Q,X]),l(()=>{_.current+=1,B(q?R3(q):[]),F(null),M(\"\"),requestAnimationFrame(()=>O.current?.querySelector(\"input, select, textarea\")?.focus())},[q]),l(()=>{if(Q===null)return;let b=(k)=>{if(k.key===\"Escape\"&&!A&&!H)K()};return document.addEventListener(\"keydown\",b),()=>document.removeEventListener(\"keydown\",b)},[Q,A,K,H]),Q===null)return null;let w=()=>{if(!A&&!H)K()},I=(b,k)=>{if(!q)return;_.current+=1,B((f)=>f.map((S,h)=>{if(h===b)return k;let d=q.parameters[h];return q.parameters[b]?.exclusive&&q.parameters[b]?.multiple&&k.length>0&&d?.exclusive&&d.multiple?[]:S})),F(null)},E=(b,k)=>{let f=G[k]??[];if(!b.multiple||b.choices)return f;return String(f[0]??\"\").split(/\\r?\\n/).map((S)=>S.trim()).filter(Boolean).map((S)=>b.type===\"number\"?Number(S):S)},c=async()=>{if(!q?.canPlan||H)return;let b=_.current;T(!0),M(\"\");try{let k=await $.previewPlan(q.id,w3(q,E));if(_.current===b)F(k)}catch(k){if(_.current===b)M(I0(k))}finally{T(!1)}},C=async(b)=>{if(b.preventDefault(),!q||A)return;Y(!0),M(\"\");try{J(await $.launch(q.id,k3(q,E)))}catch(k){M(I0(k))}finally{Y(!1)}};return Z(\"div\",{class:\"modal-backdrop\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"launchTitle\",onClick:(b)=>b.target===b.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:q?.name||\"Run a pipeline\"},void 0,!1,void 0,this),Z(\"p\",{children:q?p0(q):\"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:C,onInvalidCapture:(b)=>{(b.target instanceof HTMLElement?b.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:W,onChange:(b)=>{_.current+=1,F(null),M(\"\"),z(b.currentTarget.value)},children:X.map((b)=>Z(\"option\",{value:b.id,children:b.name},b.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{ref:O,children:q&&Z(y3,{command:q,onChange:I,values:G},void 0,!1,void 0,this)},void 0,!1,void 0,this),U&&Z(\"div\",{class:\"plan-result\",\"aria-live\":\"polite\",children:Z(w1,{plan:U},void 0,!1,void 0,this)},void 0,!1,void 0,this),P&&Z(\"div\",{class:\"launch-error\",children:P},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),q?.canPlan&&Z(\"button\",{class:\"secondary-button\",type:\"button\",disabled:H||A,onClick:()=>void c(),children:H?\"Planning…\":\"Preview plan\"},void 0,!1,void 0,this),Z(\"button\",{class:\"primary-button\",type:\"submit\",disabled:A||H,children:A?\"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 V0($){if(Array.isArray($))return $.map(V0);if($!==null&&typeof $===\"object\")return Object.fromEntries(Object.entries($).sort(([X],[Q])=>X<Q?-1:X>Q?1:0).map(([X,Q])=>[X,V0(Q)]));return $}var n1={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 s1($,X){let Q=[],K=(z,q,G,B)=>{let U=JSON.stringify(q),F=JSON.stringify(G);if(U!==F)Q.push({field:z,before:U,after:F,...B?{stepId:B}:{}})};K(\"Implementation version\",$.identity.implementationVersion,X.identity.implementationVersion),K(\"Execution order\",$.steps.map(({id:z})=>z),X.steps.map(({id:z})=>z)),K(\"Metadata\",V0($.metadata),V0(X.metadata)),K(\"Targets\",$.targetIds,X.targetIds),K(\"Required finalizer steps\",$.requiredFinalizerStepIds,X.requiredFinalizerStepIds),K(\"Options validation\",$.optionsValidated,X.optionsValidated),K(\"Result validation\",$.resultValidated,X.resultValidated);let J=new Map($.steps.map((z)=>[z.id,z])),W=new Map(X.steps.map((z)=>[z.id,z]));for(let z of $.steps)if(!W.has(z.id))Q.push({stepId:z.id,field:\"Removed step\"});for(let z of X.steps){let q=J.get(z.id);if(!q){Q.push({stepId:z.id,field:\"Added step\"});continue}K(\"Metadata\",V0(q.metadata),V0(z.metadata),z.id);for(let G of Object.keys(n1)){let B=G;K(n1[B],q[B],z[B],z.id)}}return Q}function M2($,X,Q){let[K,J]=R(0),W=n0(()=>J((G)=>G+1),[]),[z,q]=R({key:\"\",request:Q,value:null,loading:!1});if(l(()=>{if(!$||!X){q({key:\"\",request:Q,value:null,loading:!1});return}let G=!0;return q((B)=>({owner:$,key:X,request:Q,value:B.owner===$&&B.key===X?B.value:null,loading:!0})),Q().then((B)=>{if(G)q({owner:$,key:X,request:Q,value:B,loading:!1})}).catch((B)=>{if(G)q((U)=>({...U,loading:!1,error:B instanceof Error?B.message:\"Could not load definition history.\"}))}),()=>{G=!1}},[$,X,Q,K]),!$||!X)return{value:null,loading:!1,reload:W};if(z.owner!==$||z.key!==X)return{value:null,loading:!0,reload:W};return{reload:W,value:z.value,loading:z.loading||z.request!==Q,error:z.request===Q?z.error:void 0}}function W0($){return JSON.stringify([$.pipelineId,$.identity?.definitionId??null])}function t1($){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 v3({definitions:$,selected:X,candidates:Q,previous:K,definition:J,runs:W,comparison:z,onDefinition:q,onCompare:G,onPage:B,onSelect:U}){if(!X)return null;let F=J.value?.snapshot,P=W.value,M=P?.runs??[],A=z.value?.snapshot&&F?s1(z.value.snapshot,F):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:W0(X),onChange:(Y)=>{q(Y.currentTarget.value)},children:$.map((Y)=>Z(\"option\",{value:W0(Y),children:t1(Y)},W0(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),F&&Z(j,{children:[Z(u0,{metadata:F.metadata},void 0,!1,void 0,this),Z(I$,{steps:F.steps},W0(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),W.error&&Z(\"p\",{role:\"alert\",children:[W.error,\" \",Z(\"button\",{type:\"button\",onClick:W.reload,children:\"Retry runs\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.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:()=>U(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),P&&P.runCount>B0&&Z(\"div\",{class:\"confirm-actions\",children:[Z(\"button\",{class:\"secondary-button\",disabled:W.loading||!P.offset,onClick:()=>B(Math.max(0,P.offset-B0)),children:\"Previous\"},void 0,!1,void 0,this),Z(\"span\",{children:[P.offset+1,\"–\",P.offset+M.length,\" of \",P.runCount]},void 0,!0,void 0,this),Z(\"button\",{class:\"secondary-button\",disabled:W.loading||P.offset+B0>=P.runCount,onClick:()=>B(P.offset+B0),children:\"Next\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),K?Z(j,{children:[Z(\"label\",{class:\"field\",children:[\"Compare from\",\" \",Z(\"select\",{\"aria-label\":\"Compare from\",value:W0(K),onChange:(Y)=>G(Y.currentTarget.value),children:Q.map((Y)=>Z(\"option\",{value:W0(Y),children:t1(Y)},W0(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),z.error?Z(\"p\",{role:\"alert\",children:[z.error,\" \",Z(\"button\",{type:\"button\",onClick:z.reload,children:\"Retry comparison\"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!z.value||!J.value?(z.loading||J.loading)&&Z(\"p\",{children:\"Loading comparison…\"},void 0,!1,void 0,this):A?A.length?Z(\"ul\",{class:\"definition-changes\",children:A.map((Y,H)=>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)]},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 e1($,X){let Q=X?.pipelineId,K=X?.identity?.definitionId,J=K?X?.runCount:X?.lastSeenAtMs,W=n0(async()=>{if(!$||!Q)throw Error(\"No definition selected.\");return $.loadDefinition(Q,K)},[$,Q,K,J]);return M2($,X?W0(X):\"\",W)}function f3($,X,Q){let K=X?.pipelineId,J=X?.identity?.definitionId,W=X?[X.runCount,X.activeRuns,X.lastSeenAtMs].join(\":\"):\"\",z=n0(async()=>{if(!$||!K)throw Error(\"No definition selected.\");return $.loadDefinitionRuns(K,J,Q)},[$,K,J,W,Q]);return M2($,X?W0(X):\"\",z)}function $4({definitions:$,api:X,onSelect:Q}){let[K,J]=R(\"\"),[W,z]=R(\"\"),[q,G]=R(0),B=$.find((Y)=>W0(Y)===K)??$[0],U=$.filter((Y)=>Y.pipelineId===B?.pipelineId&&W0(Y)!==(B&&W0(B))),F=U.find((Y)=>W0(Y)===W)??U[0],P=e1(X,B),M=f3(X,B,q),A=e1(X,F);return Z(v3,{definitions:$,selected:B,candidates:U,previous:F,definition:P,runs:M,comparison:A,onDefinition:(Y)=>{J(Y),z(\"\"),G(0)},onCompare:z,onPage:G,onSelect:Q},void 0,!1,void 0,this)}function h3({commandCount:$,snapshot:X}){let Q=X.completedRunCount+X.failedRunCount,K=Q?Math.round(X.completedRunCount/Q*100):0,J=$||new Set(X.definitions.map(({pipelineId:z})=>z)).size,W=[[\"Active now\",X.activeRunCount,X.activeRunCount?\"Live execution in progress\":\"No work in flight\"],[\"Recorded runs\",X.runCount,\"Append-only local history\"],[\"Success rate\",K+\"%\",Q+\" terminal runs\"],[\"Pipelines\",J,$?\"Available to configure\":\"Observed in run history\"]];return Z(j,{children:W.map(([z,q,G])=>Z(\"article\",{class:\"metric\",children:[Z(\"div\",{class:\"metric-label\",children:z},void 0,!1,void 0,this),Z(\"div\",{class:\"metric-value\",children:q},void 0,!1,void 0,this),Z(\"div\",{class:\"metric-note\",children:G},void 0,!1,void 0,this)]},z,!0,void 0,this))},void 0,!1,void 0,this)}function V3({api:$,onCleared:X,onClose:Q,snapshot:K}){let[J,W]=R(!1),[z,q]=R(\"\"),G=q0(null);l(()=>G.current?.focus(),[]),l(()=>{let M=(A)=>{if(A.key===\"Escape\"&&!J)Q()};return document.addEventListener(\"keydown\",M),()=>document.removeEventListener(\"keydown\",M)},[J,Q]);let{runCount:B,eventCount:U}=K,F=()=>{if(!J)Q()},P=async()=>{if(J)return;W(!0),q(\"\");try{X((await $.clearHistory()).eventCount)}catch(M){q(I0(M))}finally{W(!1)}};return Z(\"div\",{class:\"modal-backdrop\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"clearHistoryTitle\",onClick:(M)=>M.target===M.currentTarget&&F(),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:F,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 \",U,\" event\",U===1?\"\":\"s\",\" from this SQLite store.\",K.activeRunCount?` ${K.activeRunCount} recorded run${K.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),z&&Z(\"div\",{class:\"launch-error\",children:z},void 0,!1,void 0,this),Z(\"div\",{class:\"confirm-actions\",children:[Z(\"button\",{class:\"secondary-button\",type:\"button\",onClick:F,children:\"Cancel\"},void 0,!1,void 0,this),Z(\"button\",{ref:G,class:\"danger-button\",type:\"button\",disabled:J,onClick:()=>void P(),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 X4={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.\"}},j3=typeof document>\"u\"?\"\":document.querySelector('meta[name=\"tubeless-studio-mount\"]')?.content??\"\",D3=b1(fetch,j3);function E3($){return{className:`pulse${$?\"\":\" lost\"}`,label:$?\"Connected · local\":\"Connection lost\"}}function L2($){return new URL($).searchParams.get(\"run\")||null}function A2($,X){let Q=new URL($);return Q.searchParams.set(\"run\",X),Q.href}function x3($,X){return $===\"definitions\"&&X&&X.definitions.length===0?\"runs\":$}function m3($,X){return $??X[0]?.runId??null}function c3({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 l3({api:$=D3}){let X=A$(()=>new G2($,{runId:L2(window.location.href)}),[$]),[Q,K]=R(()=>X.getState()),{accessDenied:J,connected:W,historyQuery:z,selection:q,manualRefreshing:G,snapshot:B}=Q,U=q.status===\"none\"?null:q.runId,[F,P]=R([]),[M,A]=R(!1),[Y,H]=R(\"runs\"),[T,O]=R(\"\"),_=Y===\"runs\"?z.query:T,[w,I]=R(!1),[E,c]=R(!1),[C,b]=R(!1),[k,f]=R(null),[S,h]=R(!1),[d,o]=R(\"\"),[Q4,J4]=R(Date.now);l(()=>{return K(X.getState()),X.subscribe(K)},[X]),l(()=>()=>X.dispose(),[X]),l(()=>{if(J){P([]),I(!1),c(!1),f(null),h(!1),o(\"\");return}$.loadCommands().then((Z0)=>{if(X.getState().accessDenied)return;if(P(Z0),Z0.length&&!L2(window.location.href))H(\"pipelines\")}).catch((Z0)=>{if(!X.getState().accessDenied)o(I0(Z0))}).finally(()=>{if(!X.getState().accessDenied)A(!0)}),$.loadCapabilities().then((Z0)=>{if(X.getState().accessDenied)return;I(Z0.canCancel),c(Z0.canClearHistory)}).catch((Z0)=>{if(!X.getState().accessDenied)o(I0(Z0))}),X.refresh();let g=setInterval(()=>{X.refresh(),J4(Date.now())},1200);return()=>clearInterval(g)},[J,$,X]),l(()=>{let g=()=>{X.setHistoryQuery({}),X.selectRun(L2(window.location.href)),H(\"runs\")};return window.addEventListener(\"popstate\",g),()=>window.removeEventListener(\"popstate\",g)},[X]),l(()=>{if(!d)return;let g=setTimeout(()=>o(\"\"),4200);return()=>clearTimeout(g)},[d]);let q$=B?.runs??[];l(()=>{let g=x3(Y,B);if(g!==Y)H(g)},[B,Y]),l(()=>{if(!B||!M||Y!==\"runs\"||U)return;let g=m3(U,q$);if(!g)return;window.history.replaceState(null,\"\",A2(window.location.href,g)),X.selectRun(g)},[M,X,q$,U,B,Y]);let j0=(g)=>{if(!X.getState().accessDenied)o(g)},j$=(g)=>{if(X.getState().accessDenied)return;if(g!==U)window.history.pushState(null,\"\",A2(window.location.href,g));X.selectRun(g),H(\"runs\")},K4=async(g)=>{try{await navigator.clipboard.writeText(A2(window.location.href,g)),j0(\"Run link copied\")}catch{j0(\"Could not copy run link. Copy the address from your browser instead.\")}},W4=async(g)=>{if(X.getState().accessDenied||!w||C)return;b(!0);try{await $.cancelRun(g),j0(\"Run cancelled · \"+y0(g)),X.invalidate({delayMs:80})}catch(Z0){j0(I0(Z0))}finally{b(!1)}},z4=F.filter((g)=>!_||g.name.toLowerCase().includes(_.toLowerCase())||p0(g).toLowerCase().includes(_.toLowerCase())),o0=Y===\"pipelines\",D$=B?.definitions??[];if(J)return Z(c3,{status:J,href:window.location.href},void 0,!1,void 0,this);let O2=E3(W);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:[F.length>0&&Z(\"button\",{class:o0?\"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:F.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"button\",{class:Y===\"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),D$.length>0&&Z(\"button\",{class:Y===\"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:D$.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:O2.className},void 0,!1,void 0,this),Z(\"span\",{children:O2.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),E&&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:X4[Y].title},void 0,!1,void 0,this),Z(\"p\",{class:\"lede\",children:X4[Y].lede},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z(\"div\",{class:\"toolbar\",children:[Y!==\"definitions\"&&Z(\"input\",{class:\"search\",type:\"search\",value:_,placeholder:o0?\"Filter pipelines\":\"Filter runs or IDs\",\"aria-label\":\"Filter\",onInput:(g)=>{let Z0=g.currentTarget.value.trim();if(o0)O(Z0);else X.setHistoryQuery({query:Z0})}},void 0,!1,void 0,this),F.length>0&&Z(\"button\",{class:\"primary-button\",onClick:()=>f(F[0]?.id??\"\"),children:\"Run pipeline\"},void 0,!1,void 0,this),Z(\"button\",{class:`icon-button${G?\" 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),B&&Z(j,{children:[o0&&Z(\"section\",{class:\"metrics\",children:Z(h3,{commandCount:F.length,snapshot:B},void 0,!1,void 0,this)},void 0,!1,void 0,this),o0&&Z(k1,{commands:z4,onConfigure:f},void 0,!1,void 0,this),Y===\"runs\"&&Z(r1,{api:$,offset:B.offset,matchingRootCount:B.matchingRootCount,onPage:(g)=>X.setHistoryQuery({...z,offset:g}),canCancel:w,cancelling:C,liveRunIds:B.liveRunIds??[],nowMs:Q4,onCancel:(g)=>void W4(g),onCopyLink:(g)=>void K4(g),onSelect:j$,roots:q$,selection:q,latestRunId:q$[0]?.runId,totalRunCount:B.runCount},void 0,!1,void 0,this),Z(\"div\",{hidden:Y!==\"definitions\",children:Z($4,{definitions:D$,api:$,onSelect:j$},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(a1,{api:$,commands:F,commandId:k,onClose:()=>f(null),onLaunched:(g)=>{if(X.getState().accessDenied)return;j$(g),X.setHistoryQuery({}),f(null),j0(\"Run accepted · \"+y0(g)),X.invalidate({delayMs:80})}},void 0,!1,void 0,this),S&&B&&Z(V3,{api:$,snapshot:B,onClose:()=>h(!1),onCleared:(g)=>{if(X.getState().accessDenied)return;h(!1),j0(\"Cleared \"+g+\" recorded event\"+(g===1?\"\":\"s\")),X.invalidate({resetHistory:!0})}},void 0,!1,void 0,this),d&&Z(\"div\",{class:\"toast\",role:\"status\",children:d},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Z4(){let $=document.querySelector(\"#studio-root\");if(!($ instanceof HTMLElement))throw Error(\"Missing #studio-root\");f2(Z(l3,{},void 0,!1,void 0,this),$)}Z4();\n";