PageSourceSearch

https://sidequestvr.com/chunk-X42EJFMT.js

js sidequestvr.com collected 2026-10-01 10:28:48 UTC 80,654 bytes, 1 lines download raw bytes

1import{a as rt}from"./chunk-KNUFBNSY.js";import{e as ye}from"./chunk-MRESQWJM.js";import{a as Pe,b as Se}from"./chunk-WWM3C3N2.js";import{a as ot,b as Oe}from"./chunk-S3Y5QQZV.js";import{c as ve,d as be}from"./chunk-46UG4V5A.js";import{a as G,b as J,c as Y,d as X,e as Z,f as tt,g as et,h as nt,i as it,j as at,l as Ce}from"./chunk-M2PHWBRS.js";import{c as xe,d as he,e as Ct,f as xt,h as Me}from"./chunk-AHGLNGI7.js";import{b as fe,c as ue}from"./chunk-OQFCII5W.js";import{c as me,d as _e,g as wt,h as Et,i as ge}from"./chunk-AAYASV7G.js";import{a as B,b as W,c as U,f as Q,j as le}from"./chunk-6PG7IYZ7.js";import{a as de,b as pe}from"./chunk-G6SJKYUZ.js";import"./chunk-NFERE7NO.js";import{b as ce,c as se}from"./chunk-BMTLM4UU.js";import"./chunk-GC6M2APA.js";import{e as ee,i as ae,k as oe,m as re}from"./chunk-T4YU4S5W.js";import{a as ne,b as ie,i as ut}from"./chunk-AKB263UE.js";import"./chunk-AOE7LU5Y.js";import"./chunk-F5X5MWHG.js";import{a as R,b as Kt}from"./chunk-XBEQDSG6.js";import"./chunk-V3FSQCTV.js";import"./chunk-HNMKMD4D.js";import"./chunk-LOT5ZNYN.js";import"./chunk-TCYQSISX.js";import"./chunk-WLEUS5GQ.js";import"./chunk-4WG2XUF3.js";import"./chunk-JYABGAYF.js";import"./chunk-S7HRMRUH.js";import{a as $,c as F,d as Zt,i as te}from"./chunk-RYEE4MTR.js";import"./chunk-6C3X3GDZ.js";import"./chunk-56T3LZBL.js";import{J as Yt,L as Xt,c as Ut,e as ct,h as Qt,q as Gt,t as Jt}from"./chunk-RVRQAAHX.js";import{b as E,c as Lt}from"./chunk-AP2OL2VB.js";import{$b as r,Ac as b,Bb as a,Bc as yt,Cb as i,Db as x,Eb as p,Fb as f,Hb as v,Jb as h,Kb as m,Wc as pt,Xc as H,Ya as o,Yc as D,aa as vt,ab as S,ac as C,ba as lt,bc as d,ca as V,cc as mt,cd as At,d as k,e as Rt,gb as w,gc as _t,gd as q,hb as Vt,hc as gt,hd as Nt,ic as dt,id as jt,ka as Ft,mb as _,md as Ht,me as ft,n as Ot,nd as qt,oc as T,pb as zt,pc as N,pe as L,qb as l,qe as K,s as $t,sb as z,t as Pt,te as Wt,ua as Bt,ub as bt,va as M,wa as O,y as St,yc as P,z as A,zc as j}from"./chunk-I5ZBT2OJ.js";import{h as y}from"./chunk-WWX6BADO.js";var we=()=>["order","name","key","status","forceRun","currentRun","actions"];function Ae(e,c){if(e&1&&(a(0,"div",26),r(1),i()),e&2){let t=m().$implicit;o(),d("IP: ",t.ip_address,"")}}function Ne(e,c){if(e&1&&(a(0,"div",27),r(1),i()),e&2){let t=m().$implicit;o(),d(" Memory: ",t.memory_usage_mb," MB ")}}function je(e,c){if(e&1&&(a(0,"div",28)(1,"strong"),r(2,"Running:"),i(),r(3),x(4,"br"),a(5,"small"),r(6),P(7,"date"),i()()),e&2){let t=m().$implicit;o(3),d(" ",t.current_stage.stage_name," "),o(3),d("Started: ",b(7,2,t.current_stage.started_at,"short"),"")}}function He(e,c){if(e&1&&(a(0,"div",14)(1,"div",15)(2,"div",16),r(3),i(),a(4,"div",17),r(5),i()(),a(6,"div",18)(7,"div",19),r(8),i(),_(9,Ae,2,1,"div",20),a(10,"div",21),r(11),i(),_(12,Ne,2,1,"div",22),a(13,"div",23),r(14),P(15,"date"),i(),_(16,je,8,5,"div",24),a(17,"div",25)(18,"strong"),r(19,"Claimed Stages:"),i(),r(20),i()()()),e&2){let t=c.$implicit,n=m(2);bt(n.getInstanceStatusClass(t)),z("current-instance",t.instance_id===n.currentInstanceId),o(3),C(t.instance_id),o(),bt(n.getInstanceStatusClass(t)),o(),d(" ",n.getInstanceStatusBadge(t)," "),o(3),C(t.hostname||"Unknown"),o(),l("ngIf",t.ip_address),o(2),d("Heartbeat: ",n.getTimeSinceHeartbeat(t),""),o(),l("ngIf",t.memory_usage_mb),o(2),d("Started: ",b(15,15,t.started_at,"short"),""),o(2),l("ngIf",t.current_stage),o(4),d(" ",t.claimed_stages!=null&&t.claimed_stages.length?t.claimed_stages.join(", "):"None"," ")}}function qe(e,c){e&1&&(a(0,"div",29),r(1," No active instances "),i())}function Le(e,c){if(e&1&&(a(0,"div",11),_(1,He,21,18,"div",12)(2,qe,2,0,"div",13),i()),e&2){let t=m();o(),l("ngForOf",t.instances),o(),l("ngIf",t.instances.length===0)}}function Ke(e,c){e&1&&x(0,"mat-progress-bar",30)}function We(e,c){if(e&1&&(a(0,"div",31)(1,"mat-icon"),r(2,"error"),i(),r(3),i()),e&2){let t=m();o(3),d(" ",t.error," ")}}function Ue(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Order"),i())}function Qe(e,c){if(e&1&&(a(0,"mat-cell"),r(1),i()),e&2){let t=c.$implicit;o(),C(t.stage_order)}}function Ge(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Stage Name"),i())}function Je(e,c){if(e&1){let t=v();a(0,"mat-cell")(1,"a",44),h("click",function(){let s=M(t).$implicit,g=m(2);return O(g.viewDetails(s))}),r(2),i()()}if(e&2){let t=c.$implicit;o(2),C(t.stage_name)}}function Ye(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Key"),i())}function Xe(e,c){if(e&1&&(a(0,"mat-cell")(1,"code"),r(2),i()()),e&2){let t=c.$implicit;o(2),C(t.stage_key)}}function Ze(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Status"),i())}
1function tn(e,c){if(e&1&&(a(0,"div",47)(1,"small"),r(2),i()()),e&2){let t=m().$implicit,n=m(2);o(2),C(n.getStageStatusCounts(t))}}function en(e,c){if(e&1&&(a(0,"mat-cell")(1,"span",45),r(2),i(),_(3,tn,3,1,"div",46),i()),e&2){let t=c.$implicit,n=m(2);o(),l("ngClass",n.getStageStatusClass(t)),o(),d(" ",n.getStageStatusText(t)," "),o(),l("ngIf",n.getStageStatusCounts(t)!=="-")}}function nn(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Force Run"),i())}function an(e,c){if(e&1&&(a(0,"div",50),r(1),x(2,"br"),a(3,"small"),r(4),P(5,"date"),i()()),e&2){let t=m().$implicit;o(),d(" Requested by ",t.force_run_requested_by," "),o(3),C(b(5,2,t.force_run_requested_at,"short"))}}function on(e,c){e&1&&(a(0,"span"),r(1,"-"),i())}function rn(e,c){if(e&1&&(a(0,"mat-cell"),_(1,an,6,5,"div",48)(2,on,2,0,"span",49),i()),e&2){let t=c.$implicit;o(),l("ngIf",t.force_run_requested),o(),l("ngIf",!t.force_run_requested)}}function cn(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Current Run"),i())}function sn(e,c){if(e&1&&(a(0,"div",52),r(1),P(2,"date"),x(3,"br"),r(4),i()),e&2){let t=m().$implicit;o(),d(" Started: ",b(2,2,t.current_run.started_at,"short")," "),o(3),d(" Instance: ",t.current_run.instance_id," ")}}function ln(e,c){e&1&&(a(0,"span"),r(1,"-"),i())}function mn(e,c){if(e&1&&(a(0,"mat-cell"),_(1,sn,5,5,"div",51)(2,ln,2,0,"span",49),i()),e&2){let t=c.$implicit;o(),l("ngIf",t.current_run),o(),l("ngIf",!t.current_run)}}function _n(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Actions"),i())}function gn(e,c){if(e&1){let t=v();a(0,"mat-cell")(1,"button",53),h("click",function(){let s=M(t).$implicit,g=m(2);return O(g.toggleStage(s))}),a(2,"mat-icon"),r(3),i()(),a(4,"button",54),h("click",function(){let s=M(t).$implicit,g=m(2);return O(g.forceRun(s))}),a(5,"mat-icon"),r(6,"fast_forward"),i()(),a(7,"button",55),h("click",function(){let s=M(t).$implicit,g=m(2);return O(g.viewDetails(s))}),a(8,"mat-icon"),r(9,"info"),i()()()}if(e&2){let t=c.$implicit;o(),l("matTooltip",t.is_enabled?"Disable":"Enable"),o(2),C(t.is_enabled?"pause":"play_arrow"),o(),l("disabled",t.force_run_requested||t.is_running)}}function dn(e,c){e&1&&x(0,"mat-header-row")}function pn(e,c){e&1&&x(0,"mat-row")}function fn(e,c){if(e&1&&(a(0,"mat-table",32),p(1,33),_(2,Ue,2,0,"mat-header-cell",34)(3,Qe,2,1,"mat-cell",35),f(),p(4,36),_(5,Ge,2,0,"mat-header-cell",34)(6,Je,3,1,"mat-cell",35),f(),p(7,37),_(8,Ye,2,0,"mat-header-cell",34)(9,Xe,3,1,"mat-cell",35),f(),p(10,38),_(11,Ze,2,0,"mat-header-cell",34)(12,en,4,3,"mat-cell",35),f(),p(13,39),_(14,nn,2,0,"mat-header-cell",34)(15,rn,3,2,"mat-cell",35),f(),p(16,40),_(17,cn,2,0,"mat-header-cell",34)(18,mn,3,2,"mat-cell",35),f(),p(19,41),_(20,_n,2,0,"mat-header-cell",34)(21,gn,10,3,"mat-cell",35),f(),_(22,dn,1,0,"mat-header-row",42)(23,pn,1,0,"mat-row",43),i()),e&2){let t=m();l("dataSource",t.stages),o(22),l("matHeaderRowDef",T(3,we)),o(),l("matRowDefColumns",T(4,we))}}function un(e,c){e&1&&x(0,"mat-progress-bar",30)}var De=(()=>{class e{constructor(t,n){this._controlApi=t,this._router=n,this.stages=[],this.instances=[],this.currentInstanceId="",this.loading=!0,this.error=null,this._destroy$=new k,this._refreshInterval=5e3}ngOnInit(){this.loadData(),A(this._refreshInterval).pipe(V(this._destroy$)).subscribe(()=>{this.loadData(!1)})}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete()}loadData(t=!0){return y(this,null,function*(){t&&(this.loading=!0);try{let[n,s]=yield Promise.all([this._controlApi.listStages(),this._controlApi.listInstances()]);this.stages=n.stages,this.currentInstanceId=n.instance_id,this.instances=s.instances,this.error=null}catch(n){console.error("Failed to load stages data",n),this.error="Failed to load stages data"}finally{this.loading=!1}})}getStageStatusClass(t){return t.is_running?"status-running":t.is_enabled?t.force_run_requested?"status-force-requested":"status-enabled":"status-disabled"}getStageStatusText(t){return t.is_running?"Running":t.is_enabled?t.force_run_requested?"Force Run Requested":"Enabled":"Disabled"}toggleStage(t){return y(this,null,function*(){try{let n=!t.is_enabled;yield this._controlApi.toggleStage(t.stage_key,n),t.is_enabled=n}catch(n){console.error("Failed to toggle stage",n),alert("Failed to toggle stage")}})}forceRun(t){return y(this,null,function*(){if(confirm(`Are you sure you want to force run ${t.stage_name}?`))try{yield this._controlApi.forceRunStage(t.stage_key),t.force_run_requested=!0,alert(`Force run requested for ${t.stage_name}`)}catch(n){console.error("Failed to force run stage",n),alert("Failed to force run stage")}})}viewDetails(t){this._router.navigate(["/admin/scraper/stages",t.stage_key])}getInstanceStatusClass(t){if(!t.computed_status)return"instance-inactive";switch(t.computed_status){case"running":return"instance-active";case"warning":return"instance-warning";case"frozen":return"instance-frozen";case"dead":return"instance-inactive";default:return"instance-inactive"}}getTimeSinceHeartbeat(t){if(!t.time_since_heartbeat_ms)return"Unknown";let n=Math.floor(t.time_since_heartbeat_ms/1e3);if(n<60)return`${n}s ago`;let s=Math.floor(n/60);if(s<60)return`${s}m ago`;let g=Math.floor(s/60);return g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`}getStageStatusCounts(t){let n={running:0,warning:0,frozen:0,dead:0};
1this.instances.forEach(g=>{g.current_stage?.stage_key===t.stage_key&&g.computed_status&&n[g.computed_status]++});let s=[];return n.running>0&&s.push(`${n.running} Running`),n.warning>0&&s.push(`${n.warning} Warning`),n.frozen>0&&s.push(`${n.frozen} Frozen`),n.dead>0&&s.push(`${n.dead} Dead`),s.length>0?s.join(", "):"-"}getInstanceStatusBadge(t){return t.computed_status?t.computed_status.toUpperCase():"UNKNOWN"}static{this.\u0275fac=function(n){return new(n||e)(S(rt),S(L))}}static{this.\u0275cmp=w({type:e,selectors:[["app-stages-overview"]],standalone:!1,decls:28,vars:5,consts:[[1,"stages-container"],[1,"header"],[1,"header-actions"],["mat-stroked-button","","routerLink","/admin/scraper/stages/scaling-config"],["mat-raised-button","","color","primary",3,"click"],[1,"instances-card"],["class","instances-grid",4,"ngIf"],["mode","indeterminate",4,"ngIf"],[1,"stages-card"],["class","error-message",4,"ngIf"],["class","stages-table",3,"dataSource",4,"ngIf"],[1,"instances-grid"],["class","instance-item",3,"class","current-instance",4,"ngFor","ngForOf"],["class","instance-item no-instances",4,"ngIf"],[1,"instance-item"],[1,"instance-header"],[1,"instance-id"],[1,"instance-status-badge"],[1,"instance-info"],[1,"instance-hostname"],["class","instance-ip",4,"ngIf"],[1,"instance-heartbeat"],["class","instance-memory",4,"ngIf"],[1,"instance-started-at"],["class","instance-current-stage",4,"ngIf"],[1,"instance-claimed-stages"],[1,"instance-ip"],[1,"instance-memory"],[1,"instance-current-stage"],[1,"instance-item","no-instances"],["mode","indeterminate"],[1,"error-message"],[1,"stages-table",3,"dataSource"],["matColumnDef","order"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","name"],["matColumnDef","key"],["matColumnDef","status"],["matColumnDef","forceRun"],["matColumnDef","currentRun"],["matColumnDef","actions"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],[1,"stage-link",3,"click"],[1,"status-badge",3,"ngClass"],["class","status-counts",4,"ngIf"],[1,"status-counts"],["class","force-run-info",4,"ngIf"],[4,"ngIf"],[1,"force-run-info"],["class","current-run-info",4,"ngIf"],[1,"current-run-info"],["mat-icon-button","",3,"click","matTooltip"],["mat-icon-button","","matTooltip","Force Run",3,"click","disabled"],["mat-icon-button","","matTooltip","View Details",3,"click"]],template:function(n,s){n&1&&(a(0,"div",0)(1,"div",1)(2,"h1"),r(3,"Scraper Stages"),i(),a(4,"div",2)(5,"a",3)(6,"mat-icon"),r(7,"tune"),i(),r(8," Scaling Config "),i(),a(9,"button",4),h("click",function(){return s.loadData()}),a(10,"mat-icon"),r(11,"refresh"),i(),r(12," Refresh "),i()()(),a(13,"mat-card",5)(14,"mat-card-header")(15,"mat-card-title"),r(16,"Active Instances"),i()(),a(17,"mat-card-content"),_(18,Le,3,2,"div",6)(19,Ke,1,0,"mat-progress-bar",7),i()(),a(20,"mat-card",8)(21,"mat-card-header")(22,"mat-card-title"),r(23,"Stage Controls"),i()(),a(24,"mat-card-content"),_(25,We,4,1,"div",9)(26,fn,24,5,"mat-table",10)(27,un,1,0,"mat-progress-bar",7),i()()()),n&2&&(o(18),l("ngIf",!s.loading),o(),l("ngIf",s.loading),o(6),l("ngIf",s.error),o(),l("ngIf",!s.loading),o(),l("ngIf",s.loading))},dependencies:[pt,H,D,K,G,Y,et,X,J,nt,Z,tt,it,at,B,U,Q,W,Zt,F,$,E,ot,R,q],styles:['@charset "UTF-8";.stages-container[_ngcontent-%COMP%]{padding:20px;max-width:1400px;margin:0 auto}.stages-container[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.stages-container[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{margin:0;font-size:24px}.stages-container[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:10px}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]{margin-bottom:20px;background-color:#2a2a2a}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px;padding:10px 0}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-gri
1d[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]{padding:10px;border-radius:4px;border:1px solid #444;background-color:#333}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item.instance-active[_ngcontent-%COMP%]{border-color:#4caf50;background-color:#4caf501a}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item.instance-warning[_ngcontent-%COMP%]{border-color:#ff9800;background-color:#ff98001a}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item.instance-frozen[_ngcontent-%COMP%]{border-color:#9c27b0;background-color:#9c27b01a}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item.instance-inactive[_ngcontent-%COMP%]{border-color:#f44336;background-color:#f443361a}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item.current-instance[_ngcontent-%COMP%]{position:relative}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item.current-instance[_ngcontent-%COMP%]:before{content:"\\2605";position:absolute;top:5px;right:5px;color:#ffc107}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item.no-instances[_ngcontent-%COMP%]{grid-column:1/-1;text-align:center;color:#888;font-style:italic}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-id[_ngcontent-%COMP%]{font-weight:700;font-size:12px;word-break:break-all}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-status-badge[_ngcontent-%COMP%]{padding:2px 6px;border-radius:3px;font-size:10px;font-weight:700}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-status-badge.instance-active[_ngcontent-%COMP%]{background-color:#4caf50;color:#fff}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-status-badge.instance-warning[_ngcontent-%COMP%]{background-color:#ff9800;color:#fff}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-status-badge.instance-frozen[_ngcontent-%COMP%]{background-color:#9c27b0;color:#fff}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-status-badge.instance-inactive[_ngcontent-%COMP%]{background-color:#f44336;color:#fff}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]{font-size:11px}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]   .instance-hostname[_ngcontent-%COMP%]{color:#aaa;margin-bottom:4px}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]   .instance-ip[_ngcontent-%COMP%], .stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-gri
1d[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]   .instance-heartbeat[_ngcontent-%COMP%]{color:#888;margin-bottom:4px}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]   .instance-memory[_ngcontent-%COMP%]{color:#64b5f6;margin-bottom:4px}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]   .instance-current-stage[_ngcontent-%COMP%]{margin-top:6px;padding-top:6px;border-top:1px solid #555;color:#aaa}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]   .instance-current-stage[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:#ddd}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]   .instance-current-stage[_ngcontent-%COMP%]   small[_ngcontent-%COMP%]{color:#888}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]   .instance-claimed-stages[_ngcontent-%COMP%]{margin-top:6px;padding-top:6px;border-top:1px solid #555;color:#aaa;font-size:11px;word-break:break-word}.stages-container[_ngcontent-%COMP%]   .instances-card[_ngcontent-%COMP%]   .instances-grid[_ngcontent-%COMP%]   .instance-item[_ngcontent-%COMP%]   .instance-info[_ngcontent-%COMP%]   .instance-claimed-stages[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:#ddd}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]{background-color:#2a2a2a}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:10px;background-color:#f443361a;border:1px solid #f44336;border-radius:4px;color:#f44336;margin-bottom:10px}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]{width:100%;background-color:transparent}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .stage-link[_ngcontent-%COMP%]{color:#64b5f6;cursor:pointer;text-decoration:none}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .stage-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   code[_ngcontent-%COMP%]{background-color:#1a1a1a;padding:2px 6px;border-radius:3px;font-size:12px}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .status-badge[_ngcontent-%COMP%]{padding:4px 8px;border-radius:4px;font-size:11px;font-weight:700;text-transform:uppercase;display:inline-block}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .status-badge.status-running[_ngcontent-%COMP%]{background-color:#2196f333;color:#2196f3}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .status-badge.status-enabled[_ngcontent-%COMP%]{background-color:#4caf5033;color:#4caf50}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .status-badge.status-disabled[_ngcontent-%COMP%]{background-color:#9e9e9e33;color:#9e9e9e}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .status-badge.status-force-requested[_ngcontent-%COMP%]{background-color:#ff980033;color:#ff9800}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .status-counts[_ngcontent-%COMP%]{margin-top:4px;font-size:10px;color:#888}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .force-run-info[_ngcontent-%COMP%]{font-size:12px;line-height:1.4}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .force-run-info[_ngcontent-%COMP%]   small[_ngcontent-%COMP%]{color:#888}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   .current-run-info[_ngcontent-%COMP%]{font-size:12px;line-height:1.4}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   mat-cell[_ngcontent-%COMP%]{padding:8px}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   mat-header-cell[_ngcontent-%COMP%]{font-weight:700;color:#aaa}.stages-container[_ngcontent-%COMP%]   .stages-card[_ngcontent-%COMP%]   .stages-table[_ngcontent-%COMP%]   mat-row[_ngcontent-%COMP%]:hover{background-color:#ffffff0d}']})}}return e})();var hn=e=>["/admin/scraper/stages",e],Mn=e=>["/admin/scraper/stages",e,"stats"],On=()=>["expandedDetail"];
1function Pn(e,c){if(e&1&&(a(0,"div",14)(1,"mat-icon"),r(2,"error"),i(),r(3),i()),e&2){let t=m();o(3),d(" ",t.error," ")}}function Sn(e,c){if(e&1&&(a(0,"span"),r(1),P(2,"date"),i()),e&2){let t=m(2);o(),mt(" Yes - by ",t.stage.force_run_requested_by," at ",b(2,2,t.stage.force_run_requested_at,"short")," ")}}function vn(e,c){e&1&&(a(0,"span"),r(1,"No"),i())}function bn(e,c){if(e&1&&(a(0,"span"),r(1),i()),e&2){let t=m(2);o(),d(" by ",t.stage.updated_by,"")}}function yn(e,c){if(e&1){let t=v();a(0,"mat-card",15)(1,"mat-card-header")(2,"mat-card-title"),r(3,"Stage Information"),i()(),a(4,"mat-card-content")(5,"div",16)(6,"div",17)(7,"label"),r(8,"Stage Key:"),i(),a(9,"span")(10,"code"),r(11),i()()(),a(12,"div",17)(13,"label"),r(14,"Execution Order:"),i(),a(15,"span"),r(16),i()(),a(17,"div",17)(18,"label"),r(19,"Status:"),i(),a(20,"span",18),r(21),i()(),a(22,"div",17)(23,"label"),r(24,"Force Run Requested:"),i(),a(25,"span"),_(26,Sn,3,5,"span",19)(27,vn,2,0,"span",19),i()(),a(28,"div",17)(29,"label"),r(30,"Created At:"),i(),a(31,"span"),r(32),P(33,"date"),i()(),a(34,"div",17)(35,"label"),r(36,"Last Updated:"),i(),a(37,"span"),r(38),P(39,"date"),_(40,bn,2,1,"span",19),i()()(),a(41,"div",20)(42,"button",21),h("click",function(){M(t);let s=m();return O(s.toggleStage())}),a(43,"mat-icon"),r(44),i(),r(45),i(),a(46,"button",22),h("click",function(){M(t);let s=m();return O(s.forceRun())}),a(47,"mat-icon"),r(48,"fast_forward"),i(),r(49," Force Run "),i()()()()}if(e&2){let t=m();o(11),C(t.stage.stage_key),o(5),C(t.stage.execution_order),o(4),l("ngClass",t.stage.is_enabled?"status-enabled":"status-disabled"),o(),d(" ",t.stage.is_enabled?"Enabled":"Disabled"," "),o(5),l("ngIf",t.stage.force_run_requested),o(),l("ngIf",!t.stage.force_run_requested),o(5),C(b(33,13,t.stage.created_at,"medium")),o(6),d(" ",b(39,16,t.stage.updated_at,"medium")," "),o(2),l("ngIf",t.stage.updated_by),o(2),l("color",t.stage.is_enabled?"warn":"primary"),o(2),C(t.stage.
1is_enabled?"pause":"play_arrow"),o(),d(" ",t.stage.is_enabled?"Disable Stage":"Enable Stage"," "),o(),l("disabled",t.stage.force_run_requested)}}function wn(e,c){e&1&&x(0,"mat-progress-bar",23)}function En(e,c){if(e&1){let t=v();a(0,"div",24)(1,"mat-form-field",25)(2,"mat-label"),r(3,"Status"),i(),a(4,"mat-select",26),dt("valueChange",function(s){M(t);let g=m();return gt(g.statusFilter,s)||(g.statusFilter=s),O(s)}),h("selectionChange",function(){M(t);let s=m();return O(s.onStatusFilterChange())}),a(5,"mat-option",27),r(6,"All"),i(),a(7,"mat-option",28),r(8,"Running"),i(),a(9,"mat-option",29),r(10,"Success"),i(),a(11,"mat-option",30),r(12,"Failed"),i()()(),a(13,"mat-form-field",25)(14,"mat-label"),r(15,"Sort By"),i(),a(16,"mat-select",26),dt("valueChange",function(s){M(t);let g=m();return gt(g.sortBy,s)||(g.sortBy=s),O(s)}),h("selectionChange",function(){M(t);let s=m();return O(s.onSortChange())}),a(17,"mat-option",31),r(18,"Started At"),i(),a(19,"mat-option",32),r(20,"Duration"),i(),a(21,"mat-option",33),r(22,"Memory Usage"),i()()(),a(23,"mat-form-field",25)(24,"mat-label"),r(25,"Sort Order"),i(),a(26,"mat-select",26),dt("valueChange",function(s){M(t);let g=m();return gt(g.sortOrder,s)||(g.sortOrder=s),O(s)}),h("selectionChange",function(){M(t);let s=m();return O(s.onSortChange())}),a(27,"mat-option",34),r(28,"Descending"),i(),a(29,"mat-option",35),r(30,"Ascending"),i()()()()}if(e&2){let t=m();o(4),_t("value",t.statusFilter),o(12),_t("value",t.sortBy),o(10),_t("value",t.sortOrder)}}function In(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Status"),i())}function kn(e,c){if(e&1&&(a(0,"mat-cell")(1,"span",18),r(2),i()()),e&2){let t=c.$implicit,n=m(2);o(),l("ngClass",n.getRunStatusClass(t)),o(),d(" ",t.computed_status||t.status," ")}}function Tn(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Started At"),i())}function Dn(e,c){if(e&1&&(a(0,"mat-cell"),r(1),P(2,"date"),i()),e&2){let t=c.$implicit;o(),d(" ",b(2,1,t.started_at,"short")," ")}}function Rn(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Duration"),i())}function $n(e,c){if(e&1&&(a(0,"mat-cell"),r(1),i()),e&2){let t=c.$implicit,n=m(2);o(),d(" ",n.formatDuration(t.duration_ms)," ")}}function Fn(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Instance"),i())}function Bn(e,c){if(e&1&&(a(0,"mat-cell")(1,"code",56),r(2),i()()),e&2){let t=c.$implicit;o(2),C(t.instance_id)}}function Vn(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Items"),i())}function zn(e,c){if(e&1&&(a(0,"span",58),r(1),i()),e&2){let t=m(2).$implicit;o(),d("(",t.items_failed," failed)")}}function An(e,c){if(e&1&&(a(0,"span"),r(1),_(2,zn,2,1,"span",57),i()),e&2){let t=m().$implicit;o(),d(" ",t.items_processed," "),o(),l("ngIf",t.items_failed)}}function Nn(e,c){e&1&&(a(0,"span"),r(1,"-"),i())}function jn(e,c){if(e&1&&(a(0,"mat-cell"),_(1,An,3,2,"span",19)(2,Nn,2,0,"span",19),i()),e&2){let t=c.$implicit;o(),l("ngIf",t.items_processed!==null&&t.items_processed!==void 0),o(),l("ngIf",t.items_processed===null||t.items_processed===void 0)}}function Hn(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Memory"),i())}function qn(e,c){if(e&1&&(a(0,"mat-cell"),r(1),i()),e&2){let t=c.$implicit,n=m(2);o(),d(" ",n.formatMemory(t.memory_usage_mb)," ")}}function Ln(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Triggered By"),i())}function Kn(e,c){if(e&1&&(a(0,"mat-cell"),r(1),i()),e&2){let t=c.$implicit;o(),d(" ",t.created_by||"System"," ")}}function Wn(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Outcome"),i())}function Un(e,c){if(e&1&&(a(0,"span",63),r(1),P(2,"slice"),i()),e&2){let t=m().$implicit;l("matTooltip","Click row to see details"),o(),mt(" ",yt(2,3,t.outcome.summary,0,50),"",t.outcome.summary.length>50?"...":""," ")}}function Qn(e,c){e&1&&(a(0,"span"),r(1,"Has outcome data"),i())}function Gn(e,c){e&1&&(a(0,"span"),r(1,"No outcome"),i())}function Jn(e,c){if(e&1&&(a(0,"mat-icon",64),r(1),i()),e&2){let t=m().$implicit,n=m(2);o(),d(" ",n.isRowExpanded(t)?"expand_less":"expand_more"," ")}}function Yn(e,c){if(e&1&&(a(0,"mat-cell",59)(1,"div",60),_(2,Un,3,7,"span",61)(3,Qn,2,0,"span",19)(4,Gn,2,0,"span",19)(5,Jn,2,1,"mat-icon",62),i()()),e&2){let t=c.$implicit,n=m(2);o(2),l("ngIf",t.outcome==null?null:t.outcome.summary),o(),l("ngIf",!(t.outcome!=null&&t.outcome.summary)&&t.outcome),o(),l("ngIf",!t.outcome),o(),l("ngIf",n.hasOutcomeData(t.outcome))}}function Xn(e,c){e&1&&(a(0,"mat-header-cell"),r(1,"Error"),i())}
1function Zn(e,c){if(e&1&&(a(0,"span",66),r(1),P(2,"slice"),i()),e&2){let t=m().$implicit;l("matTooltip",t.error_message),o(),mt(" ",yt(2,3,t.error_message,0,50),"",t.error_message.length>50?"...":""," ")}}function ti(e,c){e&1&&(a(0,"span"),r(1,"-"),i())}function ei(e,c){if(e&1&&(a(0,"mat-cell"),_(1,Zn,3,7,"span",65)(2,ti,2,0,"span",19),i()),e&2){let t=c.$implicit;o(),l("ngIf",t.error_message),o(),l("ngIf",!t.error_message)}}function ni(e,c){if(e&1&&(a(0,"div",74)(1,"strong"),r(2,"Summary:"),i(),r(3),i()),e&2){let t=m(2).$implicit;o(3),d(" ",t.outcome.summary," ")}}function ii(e,c){if(e&1&&(a(0,"pre"),r(1),i()),e&2){let t=m().$implicit,n=m(4);o(),C(n.formatMetricValue(t.value))}}function ai(e,c){if(e&1&&(a(0,"span"),r(1),i()),e&2){let t=m().$implicit,n=m(4);o(),C(n.formatMetricValue(t.value))}}function oi(e,c){if(e&1&&(a(0,"div",75)(1,"span",76),r(2),i(),_(3,ii,2,1,"pre",19)(4,ai,2,1,"span",19),i()),e&2){let t=c.$implicit,n=m(4);o(2),d("",t.key,":"),o(),l("ngIf",n.isComplexMetric(t)),o(),l("ngIf",!n.isComplexMetric(t))}}function ri(e,c){if(e&1&&(a(0,"li"),r(1),i()),e&2){let t=c.$implicit;o(),C(t)}}function ci(e,c){if(e&1&&(a(0,"div",77)(1,"h5"),r(2,"Warnings:"),i(),a(3,"ul"),_(4,ri,2,1,"li",78),i()()),e&2){let t=m(2).$implicit;o(4),l("ngForOf",t.outcome.warnings)}}function si(e,c){if(e&1&&(a(0,"div",69)(1,"h4"),r(2,"Outcome Details"),i(),_(3,ni,4,1,"div",70),a(4,"div",71),_(5,oi,5,3,"div",72),i(),_(6,ci,5,1,"div",73),i()),e&2){let t=m().$implicit,n=m(2);o(3),l("ngIf",t.outcome.summary),o(2),l("ngForOf",n.getOutcomeMetrics(t.outcome)),o(),l("ngIf",n.hasWarnings(t.outcome))}}function li(e,c){if(e&1&&(a(0,"mat-cell")(1,"div",67),_(2,si,7,3,"div",68),i()()),e&2){let t=c.$implicit,n=m(2);zt("colspan",n.displayedColumns.length),o(),l("@detailExpand",n.isRowExpanded(t)?"expanded":"collapsed"),o(),l("ngIf",t.outcome)}}function mi(e,c){e&1&&x(0,"mat-header-row")}function _i(e,c){if(e&1){let t=v();a(0,"mat-row",79),h("click",function(){let s=M(t).$implicit,g=m(2);return O(g.toggleRowExpansion(s))}),i()}if(e&2){let t=c.$implicit,n=m(2);z("expanded",n.isRowExpanded(t))}}function gi(e,c){if(e&1&&x(0,"mat-row",80),e&2){let t=c.$implicit,n=m(2);l("@detailExpand",n.isRowExpanded(t)?"expanded":"collapsed")}}function di(e,c){e&1&&(a(0,"div",81),r(1," No run history available for this stage. "),i())}
1function pi(e,c){if(e&1){let t=v();a(0,"mat-paginator",82),h("page",function(s){M(t);let g=m(2);return O(g.onPageChange(s))}),i()}if(e&2){let t=m(2);l("length",t.historyTotalCount)("pageSize",t.pageSize)("pageIndex",t.pageIndex)("pageSizeOptions",t.pageSizeOptions)}}function fi(e,c){if(e&1&&(a(0,"div",36)(1,"mat-table",37),p(2,38),_(3,In,2,0,"mat-header-cell",39)(4,kn,3,2,"mat-cell",40),f(),p(5,41),_(6,Tn,2,0,"mat-header-cell",39)(7,Dn,3,4,"mat-cell",40),f(),p(8,42),_(9,Rn,2,0,"mat-header-cell",39)(10,$n,2,1,"mat-cell",40),f(),p(11,43),_(12,Fn,2,0,"mat-header-cell",39)(13,Bn,3,1,"mat-cell",40),f(),p(14,44),_(15,Vn,2,0,"mat-header-cell",39)(16,jn,3,2,"mat-cell",40),f(),p(17,45),_(18,Hn,2,0,"mat-header-cell",39)(19,qn,2,1,"mat-cell",40),f(),p(20,46),_(21,Ln,2,0,"mat-header-cell",39)(22,Kn,2,1,"mat-cell",40),f(),p(23,47),_(24,Wn,2,0,"mat-header-cell",39)(25,Yn,6,4,"mat-cell",48),f(),p(26,49),_(27,Xn,2,0,"mat-header-cell",39)(28,ei,3,2,"mat-cell",40),f(),p(29,50),_(30,li,3,3,"mat-cell",40),f(),_(31,mi,1,0,"mat-header-row",51)(32,_i,1,2,"mat-row",52)(33,gi,1,1,"mat-row",53),i(),_(34,di,2,0,"div",54)(35,pi,1,4,"mat-paginator",55),i()),e&2){let t=m();z("refreshing",t.refreshing),o(),l("dataSource",t.historyDataSource),o(30),l("matHeaderRowDef",t.displayedColumns),o(),l("matRowDefColumns",t.displayedColumns),o(),l("matRowDefColumns",T(8,On)),o(),l("ngIf",t.historyDataSource.length===0),o(),l("ngIf",t.historyDataSource.length>0)}}var Re=(()=>{class e{constructor(t,n,s){this._route=t,this._router=n,this._controlApi=s,this.stage=null,this.historyDataSource=[],this.historyTotalCount=0,this.loading=!0,this.refreshing=!1,this.error=null,this.stageKey="",this.pageSize=25,this.pageIndex=0,this.pageSizeOptions=[10,25,50,100],this.statusFilter="",this.sortBy="started_at",this.sortOrder="DESC",this.autoRefreshEnabled=!0,this.displayedColumns=["status","started","duration","instance","items","memory","createdBy","outcome","error"],this.expandedElement=null,this._destroy$=new k,this._refreshInterval=1e4,this._skipNextLoad=!1}ngOnInit(){if(this.stageKey=this._route.snapshot.params.stageKey,!this.stageKey){this._router.navigate(["/admin/scraper/stages"]);return}this._route.queryParams.pipe(V(this._destroy$)).subscribe(t=>{this._initializeFromQueryParams(t),this._skipNextLoad||this.loadData(),this._skipNextLoad=!1}),A(this._refreshInterval).pipe(V(this._destroy$)).subscribe(()=>{this.autoRefreshEnabled&&(this.expandedElement&&(this._pendingExpandedRunId=this.expandedElement.run_id),this.loadData(!1))})}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete()}loadData(t=!0){return y(this,null,function*(){t?this.loading=!0:this.refreshing=!0;try{let n={limit:this.pageSize,offset:this.pageIndex*this.pageSize,status:this.statusFilter||void 0,sortBy:this.sortBy,sortOrder:this.sortOrder},s=yield this._controlApi.getStageDetails(this.stageKey,n);if(this.stage=s.stage,this.historyDataSource=s.history,this.historyTotalCount=s.total_count,this._pendingExpandedRunId){let g=this.historyDataSource.find(u=>u.run_id===this._pendingExpandedRunId);g&&(this.expandedElement=g),this._pendingExpandedRunId=void 0}this.error=null}catch(n){console.error("Failed to load stage details",n),this.error="Failed to load stage details"}finally{this.loading=!1,this.refreshing=!1}})}onPageChange(t){this.pageSize=t.pageSize,this.pageIndex=t.pageIndex,this._updateQueryParams()}onStatusFilterChange(){this.pageIndex=0,this._updateQueryParams(),this.loadData()}onSortChange(){this.pageIndex=0,this._updateQueryParams(),this.loadData()}toggleStage(){return y(this,null,function*(){if(this.stage)try{let t=!this.stage.is_enabled;yield this._controlApi.toggleStage(this.stage.stage_key,t),this.stage.is_enabled=t}catch(t){console.error("Failed to toggle stage",t),alert("Failed to toggle stage")}})}forceRun(){return y(this,null,function*(){if(this.stage&&confirm(`Are you sure you want to force run ${this.stage.stage_name}?`))try{yield this._controlApi.forceRunStage(this.stage.stage_key),this.stage.force_run_requested=!0,alert(`Force run requested for ${this.stage.stage_name}`),yield this.loadData()}catch(t){console.error("Failed to force run stage",t),alert("Failed to force run stage")}})}getRunStatusClass(t){switch(t.computed_status||t.status){case"running":return"status-running";case"success":return"status-success";case"failed":return"status-failed";default:return""}}formatDuration(t){if(!t)return"-";let n=Math.floor(t/1e3);if(n<60)return`${n}s`;let s=Math.floor(n/60),g=n%60;if(s<60)return`${s}m ${g}s`;let u=Math.floor(s/60),I=s%60;return`${u}h ${I}m`}formatMemory(t){return t?t<1024?`${t.toFixed(1)} MB`:`${(t/1024).toFixed(2)} GB`:"-"}goBack(){this._router.navigate(["/admin/scraper/stages"])}toggleRowExpansion(t){this.hasOutcomeData(t.outcome)&&(this.expandedElement=this.expandedElement===t?null:t,this._updateQueryParams())}isRowExpanded(t){return this.expandedElement===t}getOutcomeMetrics(t){if(!t)return[];let n=[];if(t.success_count!==void 0&&n.push({key:"Success Count",value:t.success_count}),t.error_count!==void 0&&n.push({key:"Error Count",value:t.error_count}),t.skipped_count!==void 0&&n.push({key:"Skipped Count",value:t.skipped_count}),t.summary&&n.push({key:"Summary",value:t.summary}),t.custom_metrics)for(let[s,g]of Object.entries(t.custom_metrics)){let u=s.replace(/_/g," ").replace(/\b\w/g,I=>I.toUpperCase());n.push({key:u,value:g})}return n}formatMetricValue(t){return t==null?"-":typeof t=="object"?JSON.stringify(t,null,2):String(t)}isComplexMetric(t){return t.key==="Duration Breakdown"||typeof t.value=="object"}hasWarnings(t){return t&&t.warnings&&t.warnings.length>0}hasOutcomeData(t){return t?Object.keys(t).length>0:!1}toggleAutoRefresh(){this.autoRefreshEnabled=!this.autoRefreshEnabled,this._updateQueryParams()}_initializeFromQueryParams(t){this.statusFilter=t.status||"",this.sortBy=t.sortBy||"started_at",this.sortOrder=t.sortOrder||"DESC";let n=parseInt(t.page||"0",10),s=parseInt(t.limit||"25",10);this.pageIndex=n,this.pageSize=s,this.autoRefreshEnabled=t.autoRefresh!=="false";let g=t.expanded;
1g&&(this._pendingExpandedRunId=parseInt(g,10))}_updateQueryParams(){let t={};t.status=this.statusFilter||null,t.sortBy=this.sortBy,t.sortOrder=this.sortOrder,t.page=this.pageIndex,t.limit=this.pageSize,t.autoRefresh=this.autoRefreshEnabled?null:"false",t.expanded=this.expandedElement?this.expandedElement.run_id:null,this._skipNextLoad=!0,this._router.navigate([],{relativeTo:this._route,queryParams:t,queryParamsHandling:"merge",replaceUrl:!0})}static{this.\u0275fac=function(n){return new(n||e)(S(ft),S(L),S(rt))}}static{this.\u0275cmp=w({type:e,selectors:[["app-stage-detail"]],standalone:!1,decls:31,vars:17,consts:[[1,"stage-detail-container"],[1,"header"],["mat-icon-button","",3,"click"],[1,"header-actions"],["mat-raised-button","","color","primary",3,"click"],["mat-raised-button","",3,"click","color","matTooltip"],["mat-tab-nav-bar",""],["mat-tab-link","",3,"routerLink","active"],["class","error-message",4,"ngIf"],["class","stage-info-card",4,"ngIf"],[1,"history-card"],["mode","indeterminate",4,"ngIf"],["class","filters-row",4,"ngIf"],["class","history-table",3,"refreshing",4,"ngIf"],[1,"error-message"],[1,"stage-info-card"],[1,"info-grid"],[1,"info-item"],[1,"status-badge",3,"ngClass"],[4,"ngIf"],[1,"actions"],["mat-raised-button","",3,"click","color"],["mat-raised-button","","color","accent",3,"click","disabled"],["mode","indeterminate"],[1,"filters-row"],["appearance","outline"],[3,"valueChange","selectionChange","value"],["value",""],["value","running"],["value","success"],["value","failed"],["value","started_at"],["value","duration_ms"],["value","memory_usage_mb"],["value","DESC"],["value","ASC"],[1,"history-table"],["multiTemplateDataRows","",3,"dataSource"],["matColumnDef","status"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","started"],["matColumnDef","duration"],["matColumnDef","instance"],["matColumnDef","items"],["matColumnDef","memory"],["matColumnDef","createdBy"],["matColumnDef","outcome"],["class","outcome-cell",4,"matCellDef"],["matColumnDef","error"],["matColumnDef","expandedDetail"],[4,"matHeaderRowDef"],["class","clickable-row",3,"expanded","click",4,"matRowDef","matRowDefColumns"],["class","detail-row",4,"matRowDef","matRowDefColumns"],["class","no-history",4,"ngIf"],["showFirstLastButtons","",3,"length","pageSize","pageIndex","pageSizeOptions","page",4,"ngIf"],[1,"instance-id"],["class","failed-count",4,"ngIf"],[1,"failed-count"],[1,"outcome-cell"],[1,"outcome-preview"],["class","outcome-summary",3,"matTooltip",4,"ngIf"],["class","expand-icon",4,"ngIf"],[1,"outcome-summary",3,"matTooltip"],[1,"expand-icon"],["class","error-text",3,"matTooltip",4,"ngIf"],[1,"error-text",3,"matTooltip"],[1,"outcome-details"],["class","outcome-content",4,"ngIf"],[1,"outcome-content"],["class","outcome-summary",4,"ngIf"],[1,"outcome-metrics"],["class","metric-item",4,"ngFor","ngForOf"],["class","outcome-warnings",4,"ngIf"],[1,"outcome-summary"],[1,"metric-item"],[1,"metric-label"],[1,"outcome-warnings"],[4,"ngFor","ngForOf"],[1,"clickable-row",3,"click"],[1,"detail-row"],[1,"n
1o-history"],["showFirstLastButtons","",3,"page","length","pageSize","pageIndex","pageSizeOptions"]],template:function(n,s){n&1&&(a(0,"div",0)(1,"div",1)(2,"button",2),h("click",function(){return s.goBack()}),a(3,"mat-icon"),r(4,"arrow_back"),i()(),a(5,"h1"),r(6),i(),a(7,"div",3)(8,"button",4),h("click",function(){return s.loadData()}),a(9,"mat-icon"),r(10,"refresh"),i(),r(11," Refresh "),i(),a(12,"button",5),h("click",function(){return s.toggleAutoRefresh()}),a(13,"mat-icon"),r(14),i(),r(15," Auto-refresh "),i()()(),a(16,"nav",6)(17,"a",7),r(18," Controls "),i(),a(19,"a",7),r(20," Stats "),i()(),_(21,Pn,4,1,"div",8)(22,yn,50,19,"mat-card",9),a(23,"mat-card",10)(24,"mat-card-header")(25,"mat-card-title"),r(26,"Run History"),i()(),a(27,"mat-card-content"),_(28,wn,1,0,"mat-progress-bar",11)(29,En,31,3,"div",12)(30,fi,36,9,"div",13),i()()()),n&2&&(o(6),C((s.stage==null?null:s.stage.stage_name)||"Loading..."),o(6),l("color",s.autoRefreshEnabled?"accent":"")("matTooltip",s.autoRefreshEnabled?"Auto-refresh enabled":"Auto-refresh disabled"),o(2),C(s.autoRefreshEnabled?"sync":"sync_disabled"),o(3),l("routerLink",N(13,hn,s.stageKey))("active",!0),o(2),l("routerLink",N(15,Mn,s.stageKey))("active",!1),o(2),l("ngIf",s.error),o(),l("ngIf",s.stage&&!s.loading),o(6),l("ngIf",s.loading),o(),l("ngIf",!s.loading),o(),l("ngIf",!s.loading))},dependencies:[pt,H,D,K,G,Y,et,X,J,nt,Z,tt,it,at,B,U,Q,W,F,$,E,ot,R,fe,ut,ne,oe,ee,Ct,xt,Ht,q],styles:['.stage-detail-container[_ngcontent-%COMP%]{padding:20px;max-width:1400px;margin:0 auto}.stage-detail-container[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-bottom:20px}.stage-detail-container[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{margin:0;flex:1;font-size:24px}.stage-detail-container[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:10px}.stage-detail-container[_ngcontent-%COMP%]   .error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:10px;background-color:#f443361a;border:1px solid #f44336;border-radius:4px;color:#f44336;margin-bottom:20px}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]{margin-bottom:20px;background-color:#2a2a2a}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]   .info-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:15px;margin-bottom:20px}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]   .info-grid[_ngcontent-%COMP%]   .info-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]   .info-grid[_ngcontent-%COMP%]   .info-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-size:12px;color:#888;text-transform:uppercase}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]   .info-grid[_ngcontent-%COMP%]   .info-item[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:14px;color:#ddd}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]   .info-grid[_ngcontent-%COMP%]   .info-item[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]   code[_ngcontent-%COMP%]{background-color:#1a1a1a;padding:2px 6px;border-radius:3px;font-size:12px}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]   .actions[_ngcontent-%COMP%]{display:flex;gap:10px;margin-top:20px}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]   .status-badge[_ngcontent-%COMP%]{display:inline-block;padding:4px 8px;border-radius:4px;font-size:11px;font-weight:700;text-transform:uppercase}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]   .status-badge.status-enabled[_ngcontent-%COMP%]{background-color:#4caf5033;color:#4caf50}.stage-detail-container[_ngcontent-%COMP%]   .stage-info-card[_ngcontent-%COMP%]   .status-badge.status-disabled[_ngcontent-%COMP%]{background-color:#9e9e9e33;color:#9e9e9e}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]{background-color:#2a2a2a}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .filters-row[_ngcontent-%COMP%]{display:flex;gap:16px;margin-bottom:16px;align-items:center}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .filters-row[_ngcontent-%COMP%]   mat-form-field[_ngcontent-%COMP%]{min-width:180px}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]{width:100%}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table.refreshing[_ngcontent-%COMP%]{opacity:.5;pointer-events:none;position:relative}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table.refreshing[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;background-color:#0000001a;z-index:1}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .status-badge[_ngcontent-%COMP%]{display:inline-block;padding:4px 8px;border-radius:4px;font-size:11px;font-weight:700;text-transform:uppercase}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .status-badge.status-running[_ngcontent-%COMP%]{background-color:#2196f333;color:#2196f3}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .status-badge.status-success[_ngcontent-%COMP%]{background-color:#4caf5033;color:#4caf50}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .status-badge.status-failed[_ngcontent-%COMP%]{background-color:#f4433633;color:#f44336}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .instance-id[_ngcontent-%COMP%]{font-size:11px;background-color:#1a1a1a;padding:2px 4px;border-radius:3px}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .failed-count[_ngcontent-%COMP%], .stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .error-text[_ngcontent-%COMP%]{color:#f44336;font-size:12px}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   mat-table[_ngcontent-%COMP%]{background-color:transparent}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   mat-header-cell[_ngcontent-%COMP%]{font-weight:700;color:#aaa}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   mat-row.clickable-row[_ngcontent-%COMP%]{cursor:pointer}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   mat-row.clickable-row[_ngcontent-%COMP%]:hover{background-color:#ffffff0a}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   mat-row.clickable-row.expanded[_ngcontent-%COMP%]{background-color:#ffffff14}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .detail-row[_ngcontent-%COMP%]   mat-cell[_ngcontent-%COMP%]{padding:0!important}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-cell[_ngcontent-%COMP%]   .outcome-preview[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-cell[_ngcontent-%COMP%]   .outcome-preview[_ngcontent-%COMP%]   .outcome-summary[_ngcontent-%COMP%]{flex:1;color:#ffffffb3;font-size:13px}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-cell[_ngcontent-%COMP%]   .outcome-preview[_ngcontent-%COMP%]   .expand-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:#ffffff80}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]{overflow:hidden;display:flex;flex-direction:column;background-color:#2a2a2a}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]{padding:16px;max-width:100%}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   h4[_ng
1content-%COMP%]{margin-top:0;color:#ffffffe6;font-size:16px;font-weight:500;margin-bottom:16px}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   .outcome-summary[_ngcontent-%COMP%]{margin-bottom:16px;padding:12px;background:#ffffff0d;border-radius:4px;border-left:3px solid #4caf50}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   .outcome-metrics[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   .outcome-metrics[_ngcontent-%COMP%]   .metric-item[_ngcontent-%COMP%]{padding:12px;background:#ffffff0d;border-radius:4px;border:1px solid rgba(255,255,255,.08)}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   .outcome-metrics[_ngcontent-%COMP%]   .metric-item[_ngcontent-%COMP%]   .metric-label[_ngcontent-%COMP%]{font-weight:600;margin-right:8px;color:#ffffffb3}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   .outcome-metrics[_ngcontent-%COMP%]   .metric-item[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%]{margin:8px 0 0;padding:8px;background:#0000004d;border-radius:4px;overflow-x:auto;font-family:Courier New,monospace;font-size:12px;color:#ffffffe6}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   .outcome-warnings[_ngcontent-%COMP%]{margin-top:16px;padding:12px;background:#ff98001a;border:1px solid rgba(255,152,0,.3);border-radius:4px}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   .outcome-warnings[_ngcontent-%COMP%]   h5[_ngcontent-%COMP%]{margin-top:0;color:#ff9800;font-size:14px;font-weight:500}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   .outcome-warnings[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]{margin-bottom:0;padding-left:20px}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .history-table[_ngcontent-%COMP%]   .outcome-details[_ngcontent-%COMP%]   .outcome-content[_ngcontent-%COMP%]   .outcome-warnings[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{color:#fffc}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .no-history[_ngcontent-%COMP%]{text-align:center;padding:40px;color:#888;font-style:italic}.stage-detail-container[_ngcontent-%COMP%]   .history-card[_ngcontent-%COMP%]   .load-more[_ngcontent-%COMP%]{text-align:center;padding:20px}'],data:{animation:[me("detailExpand",[Et("collapsed",wt({height:"0px",minHeight:"0"})),Et("expanded",wt({height:"*"})),ge("expanded <=> collapsed",_e("225ms cubic-bezier(0.4, 0.0, 0.2, 1)"))])]}})}}return e})();var $e=(()=>{class e{constructor(){this.chart=null,this.chartOptions={}}ngOnChanges(){this.chart&&(this.chartOptions=this.buildChartOptions())}buildChartOptions(){if(!this.chart||!this.chart.segments?.length)return{};let t=this.chart.segments,n=t.reduce((g,u)=>g+u.value,0),s=t.map((g,u)=>({name:g.label,type:"bar",stack:"total",emphasis:{focus:"series"},data:[g.value],itemStyle:{color:g.color,borderRadius:u===0?[4,0,0,4]:u===t.length-1?[0,4,4,0]:0},barWidth:"100%"}));return{tooltip:{trigger:"item",formatter:g=>{let u=t.find(ze=>ze.label===g.seriesName);if(!u)return"";let I=n>0?(u.value/n*100).toFixed(1):"0",Mt=`<strong>${u.label}</strong><br/>`;
1return Mt+=`Value: ${u.value.toLocaleString()} (${I}%)`,u.tooltip&&(Mt+=`<br/><em style="opacity: 0.8">${u.tooltip}</em>`),Mt}},legend:{bottom:0,orient:"horizontal",type:"scroll",textStyle:{color:"#fff",fontSize:11},itemWidth:12,itemHeight:12,itemGap:8},grid:{left:0,right:0,top:0,bottom:35,containLabel:!1},xAxis:{type:"value",show:!1,max:n||1},yAxis:{type:"category",data:[""],show:!1},series:s}}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=w({type:e,selectors:[["app-stage-progress-bar"]],inputs:{chart:"chart"},standalone:!1,features:[Bt],decls:7,vars:4,consts:[[1,"progress-chart-container"],[1,"chart-header"],["matTooltipPosition","above",3,"matTooltip"],["echarts","",1,"progress-bar",3,"options","theme"]],template:function(n,s){n&1&&(a(0,"div",0)(1,"div",1)(2,"h4"),r(3),i(),a(4,"mat-icon",2),r(5,"info_outline"),i()(),x(6,"div",3),i()),n&2&&(o(3),C(s.chart==null?null:s.chart.title),o(),l("matTooltip",(s.chart==null?null:s.chart.description)||""),o(2),l("options",s.chartOptions)("theme","dark"))},dependencies:[E,R,Pe],styles:[".progress-chart-container[_ngcontent-%COMP%]{background:#303030;border-radius:8px;padding:16px}.chart-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:8px}.chart-header[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]{margin:0;font-size:14px;font-weight:500}.chart-header[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;cursor:help;opacity:.7}.progress-bar[_ngcontent-%COMP%]{height:80px;width:100%}"],changeDetection:0})}}return e})();var Ci=e=>["/admin/scraper/stages",e],xi=e=>["/admin/scraper/stages",e,"stats"];
1function hi(e,c){if(e&1&&(a(0,"span"),r(1),P(2,"date"),i()),e&2){let t=m().ngIf;o(),d("Last updated: ",b(2,1,t.response.timestamp,"short"),"")}}function Mi(e,c){e&1&&x(0,"mat-progress-spinner",12)}function Oi(e,c){e&1&&(a(0,"mat-card",13),r(1,"Failed to load stats"),i())}function Pi(e,c){if(e&1&&x(0,"app-stage-progress-bar",17),e&2){let t=c.$implicit;l("chart",t)}}function Si(e,c){if(e&1&&(a(0,"div",14)(1,"h3"),r(2,"Progress Overview"),i(),a(3,"div",15),_(4,Pi,1,1,"app-stage-progress-bar",16),i()()),e&2){let t=m().ngIf;o(4),l("ngForOf",t.response.progress_charts)}}function vi(e,c){if(e&1&&(a(0,"div"),r(1),i()),e&2){let t=m().$implicit;o(),d(" ",t.value," ")}}function bi(e,c){if(e&1&&(a(0,"div")(1,"pre"),r(2),P(3,"json"),i()()),e&2){let t=m().$implicit;o(2),C(j(3,1,t.value))}}function yi(e,c){if(e&1&&(a(0,"div")(1,"pre"),r(2),P(3,"json"),i()()),e&2){let t=m().$implicit;o(2),C(j(3,1,t.value))}}function wi(e,c){if(e&1&&(p(0),a(1,"mat-card",23)(2,"h3"),r(3),i(),_(4,vi,2,1,"div",0)(5,bi,4,3,"div",0)(6,yi,4,3,"div",0),i(),f()),e&2){let t=c.$implicit,n=m(3);o(3),C(t.key),o(),l("ngIf",!n.isObject(t.value)&&!n.isArray(t.value)),o(),l("ngIf",n.isArray(t.value)),o(),l("ngIf",n.isObject(t.value))}}function Ei(e,c){if(e&1&&(a(0,"mat-tab-group")(1,"mat-tab",18)(2,"div",19),_(3,wi,7,4,"ng-container",20),P(4,"keyvalue"),i()(),a(5,"mat-tab",21)(6,"pre",22),r(7),P(8,"json"),i()()()),e&2){let t=m().ngIf;o(3),l("ngForOf",j(4,2,t.stats)),o(4),C(j(8,4,t.response))}}function Ii(e,c){if(e&1){let t=v();p(0),a(1,"div",1)(2,"button",2),h("click",function(){M(t);let s=m();return O(s.goToControls())}),a(3,"mat-icon"),r(4,"arrow_back"),i()(),a(5,"h1"),r(6),i()(),a(7,"nav",3)(8,"a",4),r(9," Controls "),i(),a(10,"a",4),r(11," Stats "),i()(),a(12,"div",5)(13,"button",6),h("click",function(){M(t);let s=m();return O(s.refreshNow())}),a(14,"mat-icon"),r(15,"refresh"),i(),r(16," Refresh "),i(),a(17,"mat-slide-toggle",7),h("change",function(s){M(t);let g=m();return O(g.toggleAutoRefresh(s.checked))}),r(18," Auto-refresh (60s) "),i(),x(19,"span",8),_(20,hi,3,4,"span",0),i(),_(21,Mi,1,0,"mat-progress-spinner",9)(22,Oi,2,0,"mat-card",10)(23,Si,5,1,"div",11)(24,Ei,9,6,"mat-tab-group",0),f()}if(e&2){let t=c.ngIf,n=m();o(6),d("Stage Stats - ",n.stageKey,""),o(2),l("routerLink",N(11,Ci,n.stageKey))("active",!1),o(2),l("routerLink",N(13,xi,n.stageKey))("active",!0),o(7),l("checked",!0),o(3),l("ngIf",t.response),o(),l("ngIf",t.loading),o(),l("ngIf",t.error),o(),l("ngIf",!t.loading&&(t.response==null||t.response.progress_charts==null?null:t.response.progress_charts.length)),o(),l("ngIf",!t.loading&&t.stats)}}var Fe=(()=>{class e{constructor(t,n,s){this._route=t,this._router=n,this._api=s,this.stageKey="",this._autoRefresh$=new Rt(!0),this._manualRefresh$=new k,this._destroy$=new k,this.vm$=Pt({auto:this._autoRefresh$,tick:Pt([this._autoRefresh$,this._manualRefresh$.pipe(vt(void 0))]).pipe(lt(([g])=>g?St(0,6e4):St(0)))}).pipe(lt(()=>this._loadStats()),vt({loading:!0}))}ngOnInit(){this.stageKey=this._route.snapshot.params.stageKey,this.stageKey||this._router.navigate(["/admin/scraper/stages"])}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete()}toggleAutoRefresh(t){this._autoRefresh$.next(t)}refreshNow(){this._manualRefresh$.next()}goToControls(){this._router.navigate(["/admin/scraper/stages",this.stageKey])}goToStats(){this._router.navigate(["/admin/scraper/stages",this.stageKey,"stats"])}isObject(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}isArray(t){return Array.isArray(t)}_loadStats(){return this.stageKey?Ot(null).pipe(lt(()=>this._api.getStageStats(this.stageKey)),$t(t=>({loading:!1,error:null,response:t,stats:t?.stats||{}}))):Ot({loading:!1,error:"Missing stage key",stats:null})}static{this.\u0275fac=function(n){return new(n||e)(S(ft),S(L),S(ye))}}static{this.\u0275cmp=w({type:e,selectors:[["app-stage-stats"]],standalone:!1,decls:2,vars:3,consts:[[4,"ngIf"],[1,"header"],["mat-icon-button","",3,"click"],["mat-tab-nav-bar",""],["mat-tab-link","",3,"routerLink","active"],[1,"toolbar"],["mat-stroked-button","","color","primary",3,"click"],[3,"change","checked"],[1,"spacer"],["mode","indeterminate","diameter","32",4,"ngIf"],["color","warn",4,"ngIf"],["class","progress-charts-section",4,"ngIf"],["mode","indeterminate","diameter","32"],["color","warn"],[1,"progress-charts-section"],[1,"progress-charts-grid"],[3,"chart",4,"ngFor","ngForOf"],[3,"chart"],["label","Overview"],[1,"stats-grid"],[4,"ngFor","ngForOf"],["label","Raw JSON"],[2,"white-space","pre-wrap","word-break","break-word","max-height","70vh","overflow","auto"],[1,"stat-card"]],template:function(n,s){n&1&&(_(0,Ii,25,15,"ng-container",0),P(1,"async")),n&2&&l("ngIf",j(1,1,s.vm$))},dependencies:[H,D,K,B,F,$,E,xe,he,Ct,xt,de,$e,At,Nt,q,jt],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:8px}.header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{margin:0 0 0 8px}.toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;margin:8px 0 16px}.toolbar[_ngcontent-%COMP%]   .spacer[_ngcontent-%COMP%]{flex:1}.stats-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));grid-gap:12px}.stat-card[_ngcontent-%COMP%]{word-break:break-word}.stat-card[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%]{margin:0;font-size:12px}.progress-charts-section[_ngcontent-%COMP%]{margin-bottom:24px}.progress-charts-section[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0 0 16px;font-size:18px;font-weight:500}.progress-charts-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr));gap:16px}"],changeDetection:0})}}return e})();var Be=()=>["stage_name","stage_key","desired_instances","running_instances","claimed_instances","min_instances","max_instances","scale_up_threshold","scale_down_threshold","target_backlog","actions"];
1function ki(e,c){if(e&1&&(a(0,"div",9)(1,"mat-icon"),r(2,"error"),i(),r(3),i()),e&2){let t=m();o(3),d(" ",t.error," ")}}function Ti(e,c){e&1&&(a(0,"th",26),r(1,"Stage Name"),i())}function Di(e,c){if(e&1&&(a(0,"td",27),r(1),i()),e&2){let t=c.$implicit;o(),C(t.stage_name||t.stage_key)}}function Ri(e,c){e&1&&(a(0,"th",26),r(1,"Key"),i())}function $i(e,c){if(e&1&&(a(0,"td",27)(1,"code"),r(2),i()()),e&2){let t=c.$implicit;o(2),C(t.stage_key)}}function Fi(e,c){e&1&&(a(0,"th",26),r(1,"Desired"),i())}function Bi(e,c){if(e&1&&(a(0,"td",27)(1,"span",28),r(2),i()()),e&2){let t=c.$implicit,n=m(2);o(2),d(" ",n.getDesiredInstances(t.stage_key)," ")}}function Vi(e,c){e&1&&(a(0,"th",26),r(1,"Running"),i())}function zi(e,c){if(e&1&&(a(0,"td",27)(1,"span",29),r(2),i()()),e&2){let t=c.$implicit,n=m(2);o(),z("at-zero",n.getRunningInstances(t.stage_key)===0)("at-desired",n.getRunningInstances(t.stage_key)>=n.getDesiredInstances(t.stage_key)),o(),d(" ",n.getRunningInstances(t.stage_key)," ")}}function Ai(e,c){e&1&&(a(0,"th",26),r(1,"Claimed"),i())}function Ni(e,c){if(e&1&&(a(0,"td",27)(1,"span",30),r(2),i()()),e&2){let t=c.$implicit,n=m(2);o(2),d(" ",n.getInstanceCount(t.stage_key)," ")}}function ji(e,c){e&1&&(a(0,"th",26),r(1,"Min Instances"),i())}
1function Hi(e,c){if(e&1&&(p(0),r(1),f()),e&2){let t=m().$implicit;o(),d(" ",t.min_instances," ")}}function qi(e,c){e&1&&(a(0,"mat-error"),r(1,"Required"),i())}function Li(e,c){e&1&&(a(0,"mat-error"),r(1,"Min: 1"),i())}function Ki(e,c){if(e&1&&(a(0,"mat-form-field",33),x(1,"input",34),_(2,qi,2,0,"mat-error",31)(3,Li,2,0,"mat-error",31),i()),e&2){let t,n,s,g=m().$implicit,u=m(2);o(),l("formControl",(t=u.getForm(g.stage_key))==null?null:t.get("min_instances")),o(),l("ngIf",(n=u.getForm(g.stage_key))==null||(n=n.get("min_instances"))==null?null:n.hasError("required")),o(),l("ngIf",(s=u.getForm(g.stage_key))==null||(s=s.get("min_instances"))==null?null:s.hasError("min"))}}function Wi(e,c){if(e&1&&(a(0,"td",27),_(1,Hi,2,1,"ng-container",31)(2,Ki,4,3,"mat-form-field",32),i()),e&2){let t=c.$implicit,n=m(2);o(),l("ngIf",!n.isEditing(t.stage_key)),o(),l("ngIf",n.isEditing(t.stage_key))}}function Ui(e,c){e&1&&(a(0,"th",26),r(1,"Max Instances"),i())}function Qi(e,c){if(e&1&&(p(0),r(1),f()),e&2){let t=m().$implicit;o(),d(" ",t.max_instances," ")}}function Gi(e,c){e&1&&(a(0,"mat-error"),r(1,"Required"),i())}function Ji(e,c){e&1&&(a(0,"mat-error"),r(1,"Min: 1"),i())}function Yi(e,c){if(e&1&&(a(0,"mat-form-field",33),x(1,"input",34),_(2,Gi,2,0,"mat-error",31)(3,Ji,2,0,"mat-error",31),i()),e&2){let t,n,s,g=m().$implicit,u=m(2);o(),l("formControl",(t=u.getForm(g.stage_key))==null?null:t.get("max_instances")),o(),l("ngIf",(n=u.getForm(g.stage_key))==null||(n=n.get("max_instances"))==null?null:n.hasError("required")),o(),l("ngIf",(s=u.getForm(g.stage_key))==null||(s=s.get("max_instances"))==null?null:s.hasError("min"))}}function Xi(e,c){if(e&1&&(a(0,"td",27),_(1,Qi,2,1,"ng-container",31)(2,Yi,4,3,"mat-form-field",32),i()),e&2){let t=c.$implicit,n=m(2);o(),l("ngIf",!n.isEditing(t.stage_key)),o(),l("ngIf",n.isEditing(t.stage_key))}}function Zi(e,c){e&1&&(a(0,"th",26),r(1,"Scale Up Threshold"),i())}function ta(e,c){if(e&1&&(p(0),r(1),f()),e&2){let t=m().$implicit,n=m(2);o(),d(" ",n.getDisplayValue(t.scale_up_backlog_threshold)," ")}}function ea(e,c){if(e&1&&(a(0,"mat-form-field",33),x(1,"input",34),i()),e&2){let t,n=m().$implicit,s=m(2);o(),l("formControl",(t=s.getForm(n.stage_key))==null?null:t.get("scale_up_backlog_threshold"))}}function na(e,c){if(e&1&&(a(0,"td",27),_(1,ta,2,1,"ng-container",31)(2,ea,2,1,"mat-form-field",32),i()),e&2){let t=c.$implicit,n=m(2);o(),l("ngIf",!n.isEditing(t.stage_key)),o(),l("ngIf",n.isEditing(t.stage_key))}}function ia(e,c){e&1&&(a(0,"th",26),r(1,"Scale Down Threshold"),i())}function aa(e,c){if(e&1&&(p(0),r(1),f()),e&2){let t=m().$implicit,n=m(2);o(),d(" ",n.getDisplayValue(t.scale_down_backlog_threshold)," ")}}function oa(e,c){if(e&1&&(a(0,"mat-form-field",33),x(1,"input",34),i()),e&2){let t,n=m().$implicit,s=m(2);o(),l("formControl",(t=s.getForm(n.stage_key))==null?null:t.get("scale_down_backlog_threshold"))}}
1function ra(e,c){if(e&1&&(a(0,"td",27),_(1,aa,2,1,"ng-container",31)(2,oa,2,1,"mat-form-field",32),i()),e&2){let t=c.$implicit,n=m(2);o(),l("ngIf",!n.isEditing(t.stage_key)),o(),l("ngIf",n.isEditing(t.stage_key))}}function ca(e,c){e&1&&(a(0,"th",26),r(1,"Target Backlog/Instance"),i())}function sa(e,c){if(e&1&&(p(0),r(1),f()),e&2){let t=m().$implicit,n=m(2);o(),d(" ",n.getDisplayValue(t.target_backlog_per_instance)," ")}}function la(e,c){if(e&1&&(a(0,"mat-form-field",33),x(1,"input",34),i()),e&2){let t,n=m().$implicit,s=m(2);o(),l("formControl",(t=s.getForm(n.stage_key))==null?null:t.get("target_backlog_per_instance"))}}function ma(e,c){if(e&1&&(a(0,"td",27),_(1,sa,2,1,"ng-container",31)(2,la,2,1,"mat-form-field",32),i()),e&2){let t=c.$implicit,n=m(2);o(),l("ngIf",!n.isEditing(t.stage_key)),o(),l("ngIf",n.isEditing(t.stage_key))}}function _a(e,c){e&1&&(a(0,"th",26),r(1,"Actions"),i())}function ga(e,c){if(e&1){let t=v();p(0),a(1,"button",36),h("click",function(){M(t);let s=m().$implicit,g=m(2);return O(g.startEdit(s))}),a(2,"mat-icon"),r(3,"edit"),i()(),f()}if(e&2){let t=m().$implicit,n=m(2);o(),l("disabled",n.isSaving(t.stage_key))}}function da(e,c){if(e&1){let t=v();a(0,"div",37)(1,"button",38),h("click",function(){M(t);let s=m().$implicit,g=m(2);return O(g.saveConfig(s))}),a(2,"mat-icon"),r(3,"save"),i()(),a(4,"button",39),h("click",function(){M(t);let s=m().$implicit,g=m(2);return O(g.cancelEdit(s.stage_key))}),a(5,"mat-icon"),r(6,"close"),i()()()}if(e&2){let t,n=m().$implicit,s=m(2);o(),l("disabled",s.isSaving(n.stage_key)||((t=s.getForm(n.stage_key))==null?null:t.invalid)),o(3),l("disabled",s.isSaving(n.stage_key))}}function pa(e,c){e&1&&(a(0,"mat-error"),r(1," Min must be \u2264 Max "),i())}function fa(e,c){if(e&1&&(a(0,"td",27),_(1,ga,4,1,"ng-container",31)(2,da,7,2,"div",35)(3,pa,2,0,"mat-error",31),i()),e&2){let t,n=c.$implicit,s=m(2);o(),l("ngIf",!s.isEditing(n.stage_key)),o(),l("ngIf",s.isEditing(n.stage_key)),o(),l("ngIf",s.isEditing(n.stage_key)&&((t=s.getForm(n.stage_key))==null?null:t.hasError("minGreaterThanMax")))}}function ua(e,c){e&1&&x(0,"tr",40)}function Ca(e,c){e&1&&x(0,"tr",41)}function xa(e,c){if(e&1&&(a(0,"table",10),p(1,11),_(2,Ti,2,0,"th",12)(3,Di,2,1,"td",13),f(),p(4,14),_(5,Ri,2,0,"th",12)(6,$i,3,1,"td",13),f(),p(7,15),_(8,Fi,2,0,"th",12)(9,Bi,3,1,"td",13),f(),p(10,16),_(11,Vi,2,0,"th",12)(12,zi,3,5,"td",13),f(),p(13,17),_(14,Ai,2,0,"th",12)(15,Ni,3,1,"td",13),f(),p(16,18),_(17,ji,2,0,"th",12)(18,Wi,3,2,"td",13),f(),p(19,19),_(20,Ui,2,0,"th",12)(21,Xi,3,2,"td",13),f(),p(22,20),_(23,Zi,2,0,"th",12)(24,na,3,2,"td",13),f(),p(25,21),_(26,ia,2,0,"th",12)(27,ra,3,2,"td",13),f(),p(28,22),_(29,ca,2,0,"th",12)(30,ma,3,2,"td",13),f(),p(31,23),_(32,_a,2,0,"th",12)(33,fa,4,3,"td",13),f(),_(34,ua,1,0,"tr",24)(35,Ca,1,0,"tr",25),i()),e&2){let t=m();l("dataSource",t.configs),o(34),l("matHeaderRowDef",T(3,Be)),o(),l("matRowDefColumns",T(4,Be))}}function ha(e,c){e&1&&x(0,"mat-progress-bar",42)}var Ve=(()=>{class e{constructor(t,n,s){this._controlApi=t,this._fb=n,this._snackBar=s,this.configs=[],this.instanceCounts=new Map,this.executionStatus=new Map,this.editingForms=new Map,this.editingStages=new Set,this.loading=!0,this.saving=new Set,this.error=null,this._destroy$=new k,this._refreshInterval=3e4}ngOnInit(){this.loadData(),A(this._refreshInterval).pipe(V(this._destroy$)).subscribe(()=>{this.loadData(!1)})}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete()}loadData(t=!0){return y(this,null,function*(){t&&(this.loading=!0);try{let[n,s,g]=yield Promise.all([this._controlApi.getScalingConfigs(),this._controlApi.getAllAssignments(),this._controlApi.getExecutionStatus()]);this.configs=n,this.instanceCounts.clear();for(let[u,I]of Object.entries(s))this.instanceCounts.set(u,I.length);this.executionStatus.clear();for(let[u,I]of Object.entries(g))this.executionStatus.set(u,I);this.error=null}catch(n){console.error("Failed to load scaling configs",n),this.error="Failed to load scaling configurations"}finally{this.loading=!1}})}getInstanceCount(t){return this.instanceCounts.get(t)||0}getDesiredInstances(t){return this.executionStatus.get(t)?.desired_instances||1}getRunningInstances(t){return this.executionStatus.get(t)?.executing_instances||0}startEdit(t){let n=this._fb.group({min_instances:[t.min_instances,[ct.required,
1ct.min(1)]],max_instances:[t.max_instances,[ct.required,ct.min(1)]],scale_up_backlog_threshold:[t.scale_up_backlog_threshold],scale_down_backlog_threshold:[t.scale_down_backlog_threshold],target_backlog_per_instance:[t.target_backlog_per_instance]},{validators:this.minMaxValidator});this.editingForms.set(t.stage_key,n),this.editingStages.add(t.stage_key)}cancelEdit(t){this.editingStages.delete(t),this.editingForms.delete(t)}saveConfig(t){return y(this,null,function*(){let n=this.editingForms.get(t.stage_key);if(!(!n||n.invalid)){this.saving.add(t.stage_key);try{let s={min_instances:this.toNumberOrNull(n.get("min_instances")?.value),max_instances:this.toNumberOrNull(n.get("max_instances")?.value),scale_up_backlog_threshold:this.toNumberOrNull(n.get("scale_up_backlog_threshold")?.value),scale_down_backlog_threshold:this.toNumberOrNull(n.get("scale_down_backlog_threshold")?.value),target_backlog_per_instance:this.toNumberOrNull(n.get("target_backlog_per_instance")?.value)};yield this._controlApi.updateScalingConfig(t.stage_key,s),this._snackBar.open(`Scaling config updated for ${t.stage_name||t.stage_key}`,"Dismiss",{duration:3e3}),this.cancelEdit(t.stage_key),yield this.loadData(!1)}catch(s){console.error("Failed to save scaling config",s),this._snackBar.open("Failed to save scaling configuration","Dismiss",{duration:5e3})}finally{this.saving.delete(t.stage_key)}}})}toNumberOrNull(t){if(t==null||t==="")return null;let n=Number(t);return isNaN(n)?null:n}isEditing(t){return this.editingStages.has(t)}isSaving(t){return this.saving.has(t)}getForm(t){return this.editingForms.get(t)}getDisplayValue(t){return t!=null?t.toString():"-"}minMaxValidator(t){let n=t.get("min_instances")?.value,s=t.get("max_instances")?.value;return n!==null&&s!==null&&n>s?{minGreaterThanMax:!0}:null}static{this.\u0275fac=function(n){return new(n||e)(S(rt),S(Yt),S(ve))}}static{this.\u0275cmp=w({type:e,selectors:[["app-scaling-config"]],standalone:!1,decls:19,vars:3,consts:[[1,"scaling-config-container"],[1,"header"],[1,"header-actions"],["mat-raised-button","","color","primary",3,"click"],[1,"description"],[1,"config-card"],["class","error-message",4,"ngIf"],["mat-table","","class","config-table",3,"dataSource",4,"ngIf"],["mode","indeterminate",4,"ngIf"],[1,"error-message"],["mat-table","",1,"config-table",3,"dataSource"],["matColumnDef","stage_name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","stage_key"],["matColumnDef","desired_instances"],["matColumnDef","running_instances"],["matColumnDef","claimed_instances"],["matColumnDef","min_instances"],["matColumnDef","max_instances"],["matColumnDef","scale_up_threshold"],["matColumnDef","scale_down_threshold"],["matColumnDef","target_backlog"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],[1,"desired-count"],[1,"running-count"],[1,"claimed-count"],[4,"ngIf"],["appearance","outline",4,"ngIf"],["appearance","outline"],["matInput","","type","number",3,"formControl"],["class","edit-actions",4,"ngIf"],["mat-icon-button","","matTooltip","Edit",3,"click","disabled"],[1,"edit-actions"],["mat-icon-button","","matTooltip","Save","color","primary",3,"click","disabled"],["mat-icon-button","","matTooltip","Cancel",3,"click","disabled"],["mat-header-row",""],["mat-row",""],["mode","indeterminate"]],template:function(n,s){n&1&&(a(0,"div",0)(1,"div",1)(2,"h1"),r(3,"Stage Scaling Configuration"),i(),a(4,"div",2)(5,"button",3),h("click",function(){return s.loadData()}),a(6,"mat-icon"),r(7,"refresh"),i(),r(8," Refresh "),i()()(),a(9,"p",4),r(10," Configure minimum and maximum instances for each stage, along with backlog thresholds for automatic scaling. "),i(),a(11,"mat-card",5)(12,"mat-card-header")(13,"mat-card-title"),r(14,"Scaling Configurations"),i()(),a(15,"mat-card-content"),_(16,ki,4,1,"div",6)(17,xa,36,5,"table",7)(18,ha,1,0,"mat-progress-bar",8),i()()()),n&2&&(o(16),l("ngIf",s.error),o(),l("ngIf",!s.loading),o(),l("ngIf",s.loading))},dependencies:[D,Ut,Gt,Qt,Jt,G,Y,et,X,J,nt,Z,tt,it,at,B,U,Q,W,F,$,E,ot,R,ut,ie,ce],styles:[".scaling-config-container[_ngcontent-%COMP%]{padding:20px;max-width:1600px;margin:0 auto}.scaling-config-container[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.scaling-config-container[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{margin:0;font-size:24px}.scaling-config-container[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:10px}.scaling-config-container[_ngcontent-%COMP%]   .description[_ngcontent-%COMP%]{color:#aaa;margin-bottom:20px;font-size:14px;line-height:1.5}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]{background-color:#2a2a2a}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:10px;background-color:#f443361a;border:1px solid #f44336;border-radius:4px;color:#f44336;margin-bottom:10px}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]{width:100%;background-color:transparent}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   code[_ngcontent-%COMP%]{background-color:#1a1a1a;padding:2px 6px;border-radius:3px;font-size:12px}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   mat-form-field[_ngcontent-%COMP%]{width:100%;font-size:14px;margin:0}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   mat-form-field[_ngcontent-%COMP%]     .mat-mdc-form-field-subscript-wrapper{display:none}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-stage_name[_ngcontent-%COMP%]{min-width:150px}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-stage_key[_ngcontent-%COMP%]{min-width:180px}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-desired_instances[_ngcontent-%COMP%], .scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-running_instances[_ngcontent-%COMP%], .scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-claimed_instances[_ngcontent-%COMP%]{width:80px;text-align:center}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-min_instances[_ngcontent-%COMP%], .scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-max_instances[_ngcontent-%COMP%]{width:100px}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .desired-count[_ngcontent-%COMP%]{display:inline-block;padding:4px 10px;border-radius:4px;font-weight:700;background-color:#2196f333;color:#2196f3}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .running-count[_ngcontent-%COMP%]{display:inline-block;padding:4px 10px;border-radius:4px;font-weight:700;background-color:#4caf5033;color:#4caf50}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .running-count.at-zero[_ngcontent-%COMP%]{background-color:#9e9e9e33;color:#9e9e9e}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .running-count.at-desired[_ngcontent-%COMP%]{background-color:#4caf504d;color:#66bb6a}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .claimed-count[_ngcontent-%COMP%]{display:inline-block;padding:4px 10px;border-radius:4px;font-weight:700;background-color:#9c27b033;color:#ab47bc}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-scale_up_threshold[_ngcontent-%COMP%], .scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-scale_down_threshold[_ngcontent-%COMP%], .scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-target_backlog[_ngcontent-%COMP%]{width:140px}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .mat-column-actions[_ngcontent-%COMP%]{width:150px;text-align:right}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   th.mat-mdc-header-cell[_ngcontent-%COMP%], .scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]{padding:8px;vertical-align:middle}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   th.mat-mdc-header-cell[_ngcontent-%COMP%]{font-weight:700;color:#aaa}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]:hover{background-color:#ffffff0d}.scaling-config-container[_ngcontent-%COMP%]   .config-card[_ngcontent-%COMP%]   .config-table[_ngcontent-%COMP%]   .edit-actions[_ngcontent-%COMP%]{display:flex;gap:4px;justify-content:flex-end}"]})}}return e})();var Ma=[{path:"",component:De,data:{breadcrumb:"Stages"}},{path:"scaling-config",component:Ve,data:{breadcrumb:"Scaling Configuration"}},{path:":stageKey",component:Re,data:{breadcrumb:"Stage Detail"}},{path:":stageKey/stats",component:Fe,data:{breadcrumb:"Stage Stats"}}],po=(()=>{class e{static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275mod=Vt({type:e})}static{this.\u0275inj=Ft({imports:[qt,Wt.forChild(Ma),Xt,Ce,le,te,Lt,Oe,Kt,ue,re,ae,se,Me,pe,be,Se.forRoot({echarts:()=>import("./chunk-RA7NMIA3.js")})]})}}return e})();
1export{po as StagesModule};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.