@vostride/agent-qa-dashboard-ui 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/assets/{arrow-up-down-D8UGCR46.js → arrow-up-down-DD6yziGv.js} +1 -1
  2. package/dist/assets/{badge-Dd058S66.js → badge-CC1v3nk4.js} +1 -1
  3. package/dist/assets/{batch-action-bar-BlKdJC25.js → batch-action-bar-D1IfTx55.js} +1 -1
  4. package/dist/assets/{circle-alert-Cr31wwud.js → circle-alert-CULfrrqE.js} +1 -1
  5. package/dist/assets/{circle-x-CbsF-Or-.js → circle-x-B7AOkLOS.js} +1 -1
  6. package/dist/assets/{config-B6eE0o2y.js → config-a9DxCBoP.js} +1 -1
  7. package/dist/assets/{copy-BdD4bkD_.js → copy-CEZJVgtu.js} +1 -1
  8. package/dist/assets/{display-step-4AfU6w4K.js → display-step-CO4k5dQA.js} +1 -1
  9. package/dist/assets/{dist-KjoEChiB.js → dist-BJdB11cl.js} +1 -1
  10. package/dist/assets/{dist-D9h3nbVK.js → dist-DzF0KPMF.js} +1 -1
  11. package/dist/assets/{dist-DrO-WGvP.js → dist-wK15YRiu.js} +1 -1
  12. package/dist/assets/{empty-state-c1UKljbh.js → empty-state-BfgY0UGA.js} +1 -1
  13. package/dist/assets/{external-link-MKpqbawt.js → external-link-DC-KkLmq.js} +1 -1
  14. package/dist/assets/{eye-vXF-W3Sy.js → eye-YQHiLgt4.js} +1 -1
  15. package/dist/assets/{file-code-C7vOuS4q.js → file-code-BpwHxsqo.js} +1 -1
  16. package/dist/assets/{file-search-COrO0ndH.js → file-search-LR6NeRNh.js} +1 -1
  17. package/dist/assets/{filename-validation-Ccwuaki1.js → filename-validation-S8QXnNdt.js} +1 -1
  18. package/dist/assets/{grip-vertical-B4rX3Pd9.js → grip-vertical-KfzS75WH.js} +1 -1
  19. package/dist/assets/{hook-editor-fVte-sFt.js → hook-editor-tcKRn_gP.js} +1 -1
  20. package/dist/assets/{hook-runtime-CPPjqz70.js → hook-runtime-CTRviwQE.js} +1 -1
  21. package/dist/assets/{hook-viewer-Ceps9GqL.js → hook-viewer-eGadGjA0.js} +1 -1
  22. package/dist/assets/{hooks-BwveYPPu.js → hooks-BM--ZgFe.js} +1 -1
  23. package/dist/assets/{id-badge-5c0D9pZV.js → id-badge-BmmZdbHv.js} +1 -1
  24. package/dist/assets/{index-CZotRLCc.js → index-B4FdO6Vk.js} +2 -2
  25. package/dist/assets/index-DzWZqTlZ.css +2 -0
  26. package/dist/assets/{insights-D_d7szDN.js → insights-C_tn8W_Q.js} +1 -1
  27. package/dist/assets/{insights-line-grid-DzQiRxUU.js → insights-line-grid-DKZyKGcI.js} +1 -1
  28. package/dist/assets/{lib-CCr9qhea.js → lib-B9z0w3j9.js} +1 -1
  29. package/dist/assets/{live-run-BxEaMSEi.js → live-run-EmcKA5cK.js} +1 -1
  30. package/dist/assets/{memory-7vVmoZvP.js → memory-CdMqWelO.js} +1 -1
  31. package/dist/assets/{memory-product-B30NAtAP.js → memory-product-f5AfXXJn.js} +1 -1
  32. package/dist/assets/{monaco-editor-Ba9qdSve.js → monaco-editor-DF4W-NC-.js} +2 -2
  33. package/dist/assets/{monaco-editor-inner-CeD8qR_F.js → monaco-editor-inner-I81tD0qz.js} +1 -1
  34. package/dist/assets/{monaco.contribution-ZpEX2Im1.js → monaco.contribution-CEeipeu9.js} +2 -2
  35. package/dist/assets/{observation-block-BRa3lkBV.js → observation-block-DC5e2IE9.js} +1 -1
  36. package/dist/assets/{observation-markdown-BJ9B18Mk.js → observation-markdown-DyWjt-yP.js} +1 -1
  37. package/dist/assets/{pencil-BdoVUAcl.js → pencil-CZF_NGi6.js} +1 -1
  38. package/dist/assets/plus-Qf7V331e.js +1 -0
  39. package/dist/assets/{popover-BAlAEoO4.js → popover-DwYq4QYF.js} +1 -1
  40. package/dist/assets/{refresh-cw-3zJOKpgR.js → refresh-cw-RAow1kax.js} +1 -1
  41. package/dist/assets/{resizable-BuOu2RfX.js → resizable-B2X6KlcC.js} +1 -1
  42. package/dist/assets/run-detail-DZ-1orHT.js +1 -0
  43. package/dist/assets/{runs-Bs16pBe9.js → runs-CTOIdEAQ.js} +1 -1
  44. package/dist/assets/{scroll-area-48uajHeh.js → scroll-area-BmkJ1y7Q.js} +1 -1
  45. package/dist/assets/{select-B2_tSMl_.js → select-D5oFJNaq.js} +1 -1
  46. package/dist/assets/{shortcut-hints-BnEYaq1r.js → shortcut-hints-CtwepXR1.js} +1 -1
  47. package/dist/assets/{split-button-C54F4hz3.js → split-button-wGcE-JDx.js} +1 -1
  48. package/dist/assets/square-CgFZz_zK.js +1 -0
  49. package/dist/assets/{step-name-pills-hCVbMRBe.js → step-name-pills-VuIw2nNC.js} +1 -1
  50. package/dist/assets/{suite-editor-HxXY0n_h.js → suite-editor-DLu7OCZy.js} +1 -1
  51. package/dist/assets/{suite-navbar-DzgJZNSk.js → suite-navbar-B8gZoPMT.js} +1 -1
  52. package/dist/assets/{suite-viewer-DX-uI0KI.js → suite-viewer-CPBPmJdG.js} +1 -1
  53. package/dist/assets/{suites-BrCm410e.js → suites-wRKqOnN6.js} +1 -1
  54. package/dist/assets/{switch-C7U17ptQ.js → switch-CPd0R3ri.js} +1 -1
  55. package/dist/assets/{tab-console-W4FDWhGS.js → tab-console-BORDNFzI.js} +1 -1
  56. package/dist/assets/{table-BGMQ2E9D.js → table-QG2rKYu8.js} +1 -1
  57. package/dist/assets/{tabs-CWnvxa-h.js → tabs-DzjvuMEX.js} +1 -1
  58. package/dist/assets/{test-editor-C7jMc_bm.js → test-editor-BoaHOuai.js} +1 -1
  59. package/dist/assets/{test-navbar-1FE5zQJP.js → test-navbar-C6-h4kbc.js} +1 -1
  60. package/dist/assets/{test-viewer-yi44-64J.js → test-viewer-0SziRmsW.js} +1 -1
  61. package/dist/assets/{tests-D9iNxwue.js → tests-OLyMTO9C.js} +1 -1
  62. package/dist/assets/{tests-suites-table-widths-C3pXnpiW.js → tests-suites-table-widths-D49Zcf1r.js} +1 -1
  63. package/dist/assets/{textarea-C-0LUFGZ.js → textarea-CVB6Do1_.js} +1 -1
  64. package/dist/assets/{trash-2-Cj6kkRf4.js → trash-2-BhJSaMLG.js} +1 -1
  65. package/dist/assets/{tsMode-fizT3CAG.js → tsMode-TiV3uQ0t.js} +1 -1
  66. package/dist/assets/{use-hook-run-session-RvECpdZN.js → use-hook-run-session-DH_86Jtn.js} +1 -1
  67. package/dist/assets/{use-keyboard-shortcuts-BTppBDf3.js → use-keyboard-shortcuts-Bal_Cx9w.js} +1 -1
  68. package/dist/assets/{use-page-title-BeSr97vd.js → use-page-title-B4YPyIzc.js} +1 -1
  69. package/dist/assets/use-run-status-favicon-Rjqwuxhd.js +1 -0
  70. package/dist/assets/{use-selection-queue-B7ZRHEAV.js → use-selection-queue-O7K3NZNK.js} +1 -1
  71. package/dist/assets/{viewer-url-state-aAMA3-2e.js → viewer-url-state-ClEUZJMl.js} +1 -1
  72. package/dist/assets/{zap-oUNJUGP6.js → zap-BYpQfhU4.js} +1 -1
  73. package/dist/index.html +2 -2
  74. package/package.json +2 -2
  75. package/dist/assets/index-cLLRFOsN.css +0 -2
  76. package/dist/assets/plus-BDA9KiOF.js +0 -1
  77. package/dist/assets/run-detail-BkmoKeU2.js +0 -1
  78. package/dist/assets/square-lmyO8EeE.js +0 -1
  79. package/dist/assets/use-run-status-favicon-ClaOG7BI.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{pr as t}from"./index-CZotRLCc.js";var n=e(t(),1);function r(e,t){return typeof e==`function`?e(t):e}function i(e,t){return n=>{t.setState(t=>({...t,[e]:r(n,t[e])}))}}function a(e){return e instanceof Function}function o(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function s(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function c(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{pr as t}from"./index-B4FdO6Vk.js";var n=e(t(),1);function r(e,t){return typeof e==`function`?e(t):e}function i(e,t){return n=>{t.setState(t=>({...t,[e]:r(n,t[e])}))}}function a(e){return e instanceof Function}function o(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function s(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function c(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return i}}function l(e,t,n,r){return{debug:()=>e?.debugAll??e[t],key:!1,onChange:r}}function u(e,t,n,r){let i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>i.getValue()??e.options.renderFallbackValue,getContext:c(()=>[e,n,t,i],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),l(e.options,`debugCells`,`cell.getContext`))};return e._features.forEach(r=>{r.createCell==null||r.createCell(i,n,t,e)},{}),i}function d(e,t,n,r){let i={...e._getDefaultColumnDef(),...t},a=i.accessorKey,o=i.id??(a?typeof String.prototype.replaceAll==`function`?a.replaceAll(`.`,`_`):a.replace(/\./g,`_`):void 0)??(typeof i.header==`string`?i.header:void 0),s;if(i.accessorFn?s=i.accessorFn:a&&(s=a.includes(`.`)?e=>{let t=e;for(let e of a.split(`.`))t=t?.[e];return t}:e=>e[i.accessorKey]),!o)throw Error();let u={id:`${String(o)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:c(()=>[!0],()=>[u,...u.columns?.flatMap(e=>e.getFlatColumns())],l(e.options,`debugColumns`,`column.getFlatColumns`)),getLeafColumns:c(()=>[e._getOrderColumnsFn()],e=>{var t;return(t=u.columns)!=null&&t.length?e(u.columns.flatMap(e=>e.getLeafColumns())):[u]},l(e.options,`debugColumns`,`column.getLeafColumns`))};for(let t of e._features)t.createColumn==null||t.createColumn(u,e);return u}var f=`debugHeaders`;function p(e,t,n){let r={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{t.createHeader==null||t.createHeader(r,e)}),r}var m={createTable:e=>{e.getHeaderGroups=c(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{let a=r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],o=i?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],s=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id)));return h(t,[...a,...s,...o],e)},l(e.options,f,`getHeaderGroups`)),e.getCenterHeaderGroups=c(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id))),h(t,n,e,`center`)),l(e.options,f,`getCenterHeaderGroups`)),e.getLeftHeaderGroups=c(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>h(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`left`),l(e.options,f,`getLeftHeaderGroups`)),e.getRightHeaderGroups=c(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>h(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`right`),l(e.options,f,`getRightHeaderGroups`)),e.getFooterGroups=c(()=>[e.getHeaderGroups()],e=>[...e].reverse(),l(e.options,f,`getFooterGroups`)),e.getLeftFooterGroups=c(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),l(e.options,f,`getLeftFooterGroups`)),e.getCenterFooterGroups=c(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),l(e.options,f,`getCenterFooterGroups`)),e.getRightFooterGroups=c(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),l(e.options,f,`getRightFooterGroups`)),e.getFlatHeaders=c(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),l(e.options,f,`getFlatHeaders`)),e.getLeftFlatHeaders=c(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),l(e.options,f,`getLeftFlatHeaders`)),e.getCenterFlatHeaders=c(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),l(e.options,f,`getCenterFlatHeaders`)),e.getRightFlatHeaders=c(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),l(e.options,f,`getRightFlatHeaders`)),e.getCenterLeafHeaders=c(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),l(e.options,f,`getCenterLeafHeaders`)),e.getLeftLeafHeaders=c(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),l(e.options,f,`getLeftLeafHeaders`)),e.getRightLeafHeaders=c(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),l(e.options,f,`getRightLeafHeaders`)),e.getLeafHeaders=c(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>[...e[0]?.headers??[],...t[0]?.headers??[],...n[0]?.headers??[]].map(e=>e.getLeafHeaders()).flat(),l(e.options,f,`getLeafHeaders`))}};function h(e,t,n,r){let i=0,a=function(e,t){t===void 0&&(t=1),i=Math.max(i,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;(n=e.columns)!=null&&n.length&&a(e.columns,t+1)},0)};a(e);let o=[],s=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join(`_`),headers:[]},a=[];e.forEach(e=>{let o=[...a].reverse()[0],s=e.column.depth===i.depth,c,l=!1;if(s&&e.column.parent?c=e.column.parent:(c=e.column,l=!0),o&&o?.column===c)o.subHeaders.push(e);else{let i=p(n,c,{id:[r,t,c.id,e?.id].filter(Boolean).join(`_`),isPlaceholder:l,placeholderId:l?`${a.filter(e=>e.column===c).length}`:void 0,depth:t,index:a.length});i.subHeaders.push(e),a.push(i)}i.headers.push(e),e.headerGroup=i}),o.push(i),t>0&&s(a,t-1)};s(t.map((e,t)=>p(n,e,{depth:i,index:t})),i-1),o.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1;let i=Math.min(...r);return n+=i,e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(o[0]?.headers??[]),o}var g=(e,t,n,r,i,a,o)=>{let d={id:t,index:r,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(d._valuesCache.hasOwnProperty(t))return d._valuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return d._valuesCache[t]=n.accessorFn(d.original,r),d._valuesCache[t]},getUniqueValues:t=>{if(d._uniqueValuesCache.hasOwnProperty(t))return d._uniqueValuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(d._uniqueValuesCache[t]=n.columnDef.getUniqueValues(d.original,r),d._uniqueValuesCache[t]):(d._uniqueValuesCache[t]=[d.getValue(t)],d._uniqueValuesCache[t])},renderValue:t=>d.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>s(d.subRows,e=>e.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let e=[],t=d;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:c(()=>[e.getAllLeafColumns()],t=>t.map(t=>u(e,d,t,t.id)),l(e.options,`debugRows`,`getAllCells`)),_getAllCellsByColumnId:c(()=>[d.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),l(e.options,`debugRows`,`getAllCellsByColumnId`))};for(let t=0;t<e._features.length;t++){let n=e._features[t];n==null||n.createRow==null||n.createRow(d,e)}return d},ee={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},_=(e,t,n)=>{var r,i;let a=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(a))};_.autoRemove=e=>D(e);var v=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};v.autoRemove=e=>D(e);var y=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};y.autoRemove=e=>D(e);var b=(e,t,n)=>e.getValue(t)?.includes(n);b.autoRemove=e=>D(e);var x=(e,t,n)=>!n.some(n=>{var r;return!((r=e.getValue(t))!=null&&r.includes(n))});x.autoRemove=e=>D(e)||!(e!=null&&e.length);var S=(e,t,n)=>n.some(n=>e.getValue(t)?.includes(n));S.autoRemove=e=>D(e)||!(e!=null&&e.length);var C=(e,t,n)=>e.getValue(t)===n;C.autoRemove=e=>D(e);var w=(e,t,n)=>e.getValue(t)==n;w.autoRemove=e=>D(e);var T=(e,t,n)=>{let[r,i]=n,a=e.getValue(t);return a>=r&&a<=i};T.resolveFilterValue=e=>{let[t,n]=e,r=typeof t==`number`?t:parseFloat(t),i=typeof n==`number`?n:parseFloat(n),a=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(i)?1/0:i;if(a>o){let e=a;a=o,o=e}return[a,o]},T.autoRemove=e=>D(e)||D(e[0])&&D(e[1]);var E={includesString:_,includesStringSensitive:v,equalsString:y,arrIncludes:b,arrIncludesAll:x,arrIncludesSome:S,equals:C,weakEquals:w,inNumberRange:T};function D(e){return e==null||e===``}var O={getDefaultColumnDef:()=>({filterFn:`auto`}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:i(`columnFilters`,e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);return typeof n==`string`?E.includesString:typeof n==`number`?E.inNumberRange:typeof n==`boolean`||typeof n==`object`&&n?E.equals:Array.isArray(n)?E.arrIncludes:E.weakEquals},e.getFilterFn=()=>a(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn===`auto`?e.getAutoFilterFn():t.options.filterFns?.[e.columnDef.filterFn]??E[e.columnDef.filterFn],e.getCanFilter=()=>(e.columnDef.enableColumnFilter??!0)&&(t.options.enableColumnFilters??!0)&&(t.options.enableFilters??!0)&&!!e.accessorFn,e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(t=>t.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>t.getState().columnFilters?.findIndex(t=>t.id===e.id)??-1,e.setFilterValue=n=>{t.setColumnFilters(t=>{let i=e.getFilterFn(),a=t?.find(t=>t.id===e.id),o=r(n,a?a.value:void 0);if(k(i,o,e))return t?.filter(t=>t.id!==e.id)??[];let s={id:e.id,value:o};return a?t?.map(t=>t.id===e.id?s:t)??[]:t!=null&&t.length?[...t,s]:[s]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(e=>r(t,e)?.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&k(t.getFilterFn(),e.value,t))}))},e.resetColumnFilters=t=>{e.setColumnFilters(t?[]:e.initialState?.columnFilters??[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function k(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||t===void 0||typeof t==`string`&&!t}var A={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+(typeof r==`number`?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r>n||r===void 0&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r<n||r===void 0&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r===void 0?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!o(n))return;if(n.length===1)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2==0?(i[r-1]+i[r])/2:i[r]},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},j={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return((t=e.getValue())==null||t.toString==null?void 0:t.toString())??null},aggregationFn:`auto`}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:i(`grouping`,e),groupedColumnMode:`reorder`}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(t=>t!==e.id):[...t??[],e.id])},e.getCanGroup=()=>(e.columnDef.enableGrouping??!0)&&(t.options.enableGrouping??!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue),e.getIsGrouped=()=>t.getState().grouping?.includes(e.id),e.getGroupedIndex=()=>t.getState().grouping?.indexOf(e.id),e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);if(typeof n==`number`)return A.sum;if(Object.prototype.toString.call(n)===`[object Date]`)return A.extent},e.getAggregationFn=()=>{if(!e)throw Error();return a(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn===`auto`?e.getAutoAggregationFn():t.options.aggregationFns?.[e.columnDef.aggregationFn]??A[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{e.setGrouping(t?[]:e.initialState?.grouping??[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((t=n.subRows)!=null&&t.length)}}};function te(e,t,n){if(!(t!=null&&t.length)||!n)return e;let r=e.filter(e=>!t.includes(e.id));return n===`remove`?r:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...r]}var ne={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:i(`columnOrder`,e)}),createColumn:(e,t)=>{e.getIndex=c(e=>[L(t,e)],t=>t.findIndex(t=>t.id===e.id),l(t.options,`debugColumns`,`getIndex`)),e.getIsFirstColumn=n=>L(t,n)[0]?.id===e.id,e.getIsLastColumn=n=>{let r=L(t,n);return r[r.length-1]?.id===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},e._getOrderColumnsFn=c(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(!(e!=null&&e.length))i=r;else{let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}return te(i,t,n)},l(e.options,`debugTable`,`_getOrderColumnsFn`))}},M=()=>({left:[],right:[]}),re={getInitialState:e=>({columnPinning:M(),...e}),getDefaultOptions:e=>({onColumnPinningChange:i(`columnPinning`,e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>n===`right`?{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:[...(e?.right??[]).filter(e=>!(r!=null&&r.includes(e))),...r]}:n===`left`?{left:[...(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),...r],right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))}:{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))})},e.getCanPin=()=>e.getLeafColumns().some(e=>(e.columnDef.enablePinning??!0)&&(t.options.enableColumnPinning??t.options.enablePinning??!0)),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`left`:o?`right`:!1},e.getPinnedIndex=()=>{var n;let r=e.getIsPinned();return r?((n=t.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))??-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=c(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.column.id))},l(t.options,`debugRows`,`getCenterVisibleCells`)),e.getLeftVisibleCells=c(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`left`})),l(t.options,`debugRows`,`getLeftVisibleCells`)),e.getRightVisibleCells=c(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`right`})),l(t.options,`debugRows`,`getRightVisibleCells`))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>e.setColumnPinning(t?M():e.initialState?.columnPinning??M()),e.getIsSomeColumnsPinned=t=>{let n=e.getState().columnPinning;return t?!!n[t]?.length:!!(n.left?.length||n.right?.length)},e.getLeftLeafColumns=c(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),l(e.options,`debugColumns`,`getLeftLeafColumns`)),e.getRightLeafColumns=c(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),l(e.options,`debugColumns`,`getRightLeafColumns`)),e.getCenterLeafColumns=c(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.id))},l(e.options,`debugColumns`,`getCenterLeafColumns`))}};function ie(e){return e||(typeof document<`u`?document:null)}var N={size:150,minSize:20,maxSize:2**53-1},P=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ae={getDefaultColumnDef:()=>N,getInitialState:e=>({columnSizing:{},columnSizingInfo:P(),...e}),getDefaultOptions:e=>({columnResizeMode:`onEnd`,columnResizeDirection:`ltr`,onColumnSizingChange:i(`columnSizing`,e),onColumnSizingInfoChange:i(`columnSizingInfo`,e)}),createColumn:(e,t)=>{e.getSize=()=>{let n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??N.minSize,n??e.columnDef.size??N.size),e.columnDef.maxSize??N.maxSize)},e.getStart=c(e=>[e,L(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),l(t.options,`debugColumns`,`getStart`)),e.getAfter=c(e=>[e,L(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),l(t.options,`debugColumns`,`getAfter`)),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=r?.getCanResize();return a=>{if(!r||!i||(a.persist==null||a.persist(),I(a)&&a.touches&&a.touches.length>1))return;let o=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],c=I(a)?Math.round(a.touches[0].clientX):a.clientX,l={},u=(e,n)=>{typeof n==`number`&&(t.setColumnSizingInfo(e=>{let r=t.options.columnResizeDirection===`rtl`?-1:1,i=(n-(e?.startOffset??0))*r,a=Math.max(i/(e?.startSize??0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;l[t]=Math.round(Math.max(n+n*a,0)*100)/100}),{...e,deltaOffset:i,deltaPercentage:a}}),(t.options.columnResizeMode===`onChange`||e===`end`)&&t.setColumnSizing(e=>({...e,...l})))},d=e=>u(`move`,e),f=e=>{u(`end`,e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=ie(n),m={moveHandler:e=>d(e.clientX),upHandler:e=>{p?.removeEventListener(`mousemove`,m.moveHandler),p?.removeEventListener(`mouseup`,m.upHandler),f(e.clientX)}},h={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{p?.removeEventListener(`touchmove`,h.moveHandler),p?.removeEventListener(`touchend`,h.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0]?.clientX)}},g=oe()?{passive:!1}:!1;I(a)?(p?.addEventListener(`touchmove`,h.moveHandler,g),p?.addEventListener(`touchend`,h.upHandler,g)):(p?.addEventListener(`mousemove`,m.moveHandler,g),p?.addEventListener(`mouseup`,m.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},e.resetHeaderSizeInfo=t=>{e.setColumnSizingInfo(t?P():e.initialState.columnSizingInfo??P())},e.getTotalSize=()=>e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getLeftTotalSize=()=>e.getLeftHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getCenterTotalSize=()=>e.getCenterHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getRightTotalSize=()=>e.getRightHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0}},F=null;function oe(){if(typeof F==`boolean`)return F;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test`,n,t),window.removeEventListener(`test`,n)}catch{e=!1}return F=e,F}function I(e){return e.type===`touchstart`}var se={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:i(`columnVisibility`,e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{let n=e.columns;return(n.length?n.some(e=>e.getIsVisible()):t.getState().columnVisibility?.[e.id])??!0},e.getCanHide=()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=c(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),l(t.options,`debugRows`,`_getAllVisibleCells`)),e.getVisibleCells=c(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],l(t.options,`debugRows`,`getVisibleCells`))},createTable:e=>{let t=(t,n)=>c(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join(`_`)],e=>e.filter(e=>e.getIsVisible==null?void 0:e.getIsVisible()),l(e.options,`debugColumns`,t));e.getVisibleFlatColumns=t(`getVisibleFlatColumns`,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(`getVisibleLeafColumns`,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(`getLeftVisibleLeafColumns`,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(`getRightVisibleLeafColumns`,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(`getCenterVisibleLeafColumns`,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},e.toggleAllColumnsVisible=t=>{t??=!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(n.getCanHide!=null&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(e.getIsVisible!=null&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>e.getIsVisible==null?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{e.toggleAllColumnsVisible(t.target?.checked)}}};function L(e,t){return t?t===`center`?e.getCenterVisibleLeafColumns():t===`left`?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var ce={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,`__global__`),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,`__global__`),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,`__global__`),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},le={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:i(`globalFilter`,e),globalFilterFn:`auto`,getColumnCanGlobalFilter:t=>{var n;let r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r==`string`||typeof r==`number`}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>(e.columnDef.enableGlobalFilter??!0)&&(t.options.enableGlobalFilter??!0)&&(t.options.enableFilters??!0)&&((t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn},createTable:e=>{e.getGlobalAutoFilterFn=()=>E.includesString,e.getGlobalFilterFn=()=>{let{globalFilterFn:t}=e.options;return a(t)?t:t===`auto`?e.getGlobalAutoFilterFn():e.options.filterFns?.[t]??E[t]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},ue={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:i(`expanded`,e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{e.setExpanded(t?{}:e.initialState?.expanded??{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{t.persist==null||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return t===!0||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return typeof t==`boolean`?t===!0:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(`.`);t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{let i=r===!0?!0:!!(r!=null&&r[e.id]),a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n??=!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{let n=t.getState().expanded;return!!((t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))??(n===!0||n?.[e.id]))},e.getCanExpand=()=>{var n;return(t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!!((n=e.subRows)!=null&&n.length))},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},R=0,z=10,B=()=>({pageIndex:R,pageSize:z}),V={getInitialState:e=>({...e,pagination:{...B(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:i(`pagination`,e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(e=>r(t,e)),e.resetPagination=t=>{e.setPagination(t?B():e.initialState.pagination??B())},e.setPageIndex=t=>{e.setPagination(n=>{let i=r(t,n.pageIndex),a=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...n,pageIndex:i}})},e.resetPageIndex=t=>{var n;e.setPageIndex(t?R:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageIndex)??R)},e.resetPageSize=t=>{var n;e.setPageSize(t?z:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageSize)??z)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,r(t,e.pageSize)),i=e.pageSize*e.pageIndex,a=Math.floor(i/n);return{...e,pageIndex:a,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{let i=r(t,e.options.pageCount??-1);return typeof i==`number`&&(i=Math.max(-1,i)),{...n,pageCount:i}}),e.getPageOptions=c(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},l(e.options,`debugTable`,`getPageOptions`)),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return n===-1?!0:n===0?!1:t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>e.options.pageCount??Math.ceil(e.getRowCount()/e.getState().pagination.pageSize),e.getRowCount=()=>e.options.rowCount??e.getPrePaginationRowModel().rows.length}},H=()=>({top:[],bottom:[]}),U={getInitialState:e=>({rowPinning:H(),...e}),getDefaultOptions:e=>({onRowPinningChange:i(`rowPinning`,e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let a=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],o=i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...o,e.id,...a]);t.setRowPinning(e=>n===`bottom`?{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:[...(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)]}:n===`top`?{top:[...(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)],bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))}:{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))})},e.getCanPin=()=>{let{enableRowPinning:n,enablePinning:r}=t.options;return typeof n==`function`?n(e):n??r??!0},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`top`:o?`bottom`:!1},e.getPinnedIndex=()=>{let n=e.getIsPinned();return n?((n===`top`?t.getTopRows():t.getBottomRows())?.map(e=>{let{id:t}=e;return t}))?.indexOf(e.id)??-1:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>e.setRowPinning(t?H():e.initialState?.rowPinning??H()),e.getIsSomeRowsPinned=t=>{let n=e.getState().rowPinning;return t?!!n[t]?.length:!!(n.top?.length||n.bottom?.length)},e._getPinnedRows=(t,n,r)=>(e.options.keepPinnedRows??!0?(n??[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(n??[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r})),e.getTopRows=c(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,`top`),l(e.options,`debugRows`,`getTopRows`)),e.getBottomRows=c(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,`bottom`),l(e.options,`debugRows`,`getBottomRows`)),e.getCenterRows=c(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...t??[],...n??[]]);return e.filter(e=>!r.has(e.id))},l(e.options,`debugRows`,`getCenterRows`))}},de={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:i(`rowSelection`,e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=t===void 0?!e.getIsAllRowsSelected():t;let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=t===void 0?!e.getIsAllPageRowsSelected():t,i={...n};return e.getRowModel().rows.forEach(t=>{W(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=c(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?G(e,n):{rows:[],flatRows:[],rowsById:{}},l(e.options,`debugTable`,`getSelectedRowModel`)),e.getFilteredSelectedRowModel=c(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?G(e,n):{rows:[],flatRows:[],rowsById:{}},l(e.options,`debugTable`,`getFilteredSelectedRowModel`)),e.getGroupedSelectedRowModel=c(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?G(e,n):{rows:[],flatRows:[],rowsById:{}},l(e.options,`debugTable`,`getGroupedSelectedRowModel`)),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{let t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(a=>{if(n=n===void 0?!i:n,e.getCanSelect()&&i===n)return a;let o={...a};return W(o,e.id,n,r?.selectChildren??!0,t),o})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return K(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return q(e,n)===`some`},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return q(e,n)===`all`},e.getCanSelect=()=>typeof t.options.enableRowSelection==`function`?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,e.getCanSelectSubRows=()=>typeof t.options.enableSubRowSelection==`function`?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,e.getCanMultiSelect=()=>typeof t.options.enableMultiRowSelection==`function`?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{t&&e.toggleSelected(n.target?.checked)}}}},W=(e,t,n,r,i)=>{var a;let o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(t=>W(e,t.id,n,r,i))};function G(e,t){let n=e.getState().rowSelection,r=[],i={},a=function(e,t){return e.map(e=>{var t;let o=K(e,n);if(o&&(r.push(e),i[e.id]=e),(t=e.subRows)!=null&&t.length&&(e={...e,subRows:a(e.subRows)}),o)return e}).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:i}}function K(e,t){return t[e.id]??!1}function q(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,a=!1;return e.subRows.forEach(e=>{if(!(a&&!i)&&(e.getCanSelect()&&(K(e,t)?a=!0:i=!1),e.subRows&&e.subRows.length)){let n=q(e,t);n===`all`?a=!0:(n===`some`&&(a=!0),i=!1)}}),i?`all`:a?`some`:!1}var J=/([0-9]+)/gm,fe=(e,t,n)=>Z(X(e.getValue(n)).toLowerCase(),X(t.getValue(n)).toLowerCase()),pe=(e,t,n)=>Z(X(e.getValue(n)),X(t.getValue(n))),me=(e,t,n)=>Y(X(e.getValue(n)).toLowerCase(),X(t.getValue(n)).toLowerCase()),he=(e,t,n)=>Y(X(e.getValue(n)),X(t.getValue(n))),ge=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},_e=(e,t,n)=>Y(e.getValue(n),t.getValue(n));function Y(e,t){return e===t?0:e>t?1:-1}function X(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function Z(e,t){let n=e.split(J).filter(Boolean),r=t.split(J).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),a=parseInt(t,10),o=[i,a].sort();if(isNaN(o[0])){if(e>t)return 1;if(t>e)return-1;continue}if(isNaN(o[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}var Q={alphanumeric:fe,alphanumericCaseSensitive:pe,text:me,textCaseSensitive:he,datetime:ge,basic:_e},ve=[m,se,ne,re,ee,O,ce,le,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:`auto`,sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:i(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=t?.getValue(e.id);if(Object.prototype.toString.call(n)===`[object Date]`)return Q.datetime;if(typeof n==`string`&&(r=!0,n.split(J).length>1))return Q.alphanumeric}return r?Q.text:Q.basic},e.getAutoSortDir=()=>typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id)==`string`?`asc`:`desc`,e.getSortingFn=()=>{if(!e)throw Error();return a(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn===`auto`?e.getAutoSortingFn():t.options.sortingFns?.[e.columnDef.sortingFn]??Q[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),a=n!=null;t.setSorting(o=>{let s=o?.find(t=>t.id===e.id),c=o?.findIndex(t=>t.id===e.id),l=[],u,d=a?n:i===`desc`;return u=o!=null&&o.length&&e.getCanMultiSort()&&r?s?`toggle`:`add`:o!=null&&o.length&&c!==o.length-1?`replace`:s?`toggle`:`replace`,u===`toggle`&&(a||i||(u=`remove`)),u===`add`?(l=[...o,{id:e.id,desc:d}],l.splice(0,l.length-(t.options.maxMultiSortColCount??2**53-1))):l=u===`toggle`?o.map(t=>t.id===e.id?{...t,desc:d}:t):u===`remove`?o.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],l})},e.getFirstSortDir=()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??e.getAutoSortDir()===`desc`?`desc`:`asc`,e.getNextSortingOrder=n=>{let r=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==r&&(t.options.enableSortingRemoval??!0)&&(!n||(t.options.enableMultiRemove??!0))?!1:i===`desc`?`asc`:`desc`:r},e.getCanSort=()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,e.getCanMultiSort=()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,e.getIsSorted=()=>{let n=t.getState().sorting?.find(t=>t.id===e.id);return n?n.desc?`desc`:`asc`:!1},e.getSortIndex=()=>t.getState().sorting?.findIndex(t=>t.id===e.id)??-1,e.clearSorting=()=>{t.setSorting(t=>t!=null&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{e.setSorting(t?[]:e.initialState?.sorting??[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},j,ue,V,U,de,ae];function ye(e){let t=[...ve,...e._features??[]],n={_features:t},i=n._features.reduce((e,t)=>Object.assign(e,t.getDefaultOptions==null?void 0:t.getDefaultOptions(n)),{}),a=e=>n.options.mergeOptions?n.options.mergeOptions(i,e):{...i,...e},o={...e.initialState??{}};n._features.forEach(e=>{o=(e.getInitialState==null?void 0:e.getInitialState(o))??o});let s=[],u=!1,f={_features:t,options:{...i,...e},initialState:o,_queue:e=>{s.push(e),u||(u=!0,Promise.resolve().then(()=>{for(;s.length;)s.shift()();u=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{n.options=a(r(e,n.options))},getState:()=>n.options.state,setState:e=>{n.options.onStateChange==null||n.options.onStateChange(e)},_getRowId:(e,t,r)=>(n.options.getRowId==null?void 0:n.options.getRowId(e,t,r))??`${r?[r.id,t].join(`.`):t}`,getCoreRowModel:()=>(n._getCoreRowModel||=n.options.getCoreRowModel(n),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw Error();return r},_getDefaultColumnDef:c(()=>[n.options.defaultColumn],e=>(e??={},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return((t=e.renderValue())==null||t.toString==null?void 0:t.toString())??null},...n._features.reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef==null?void 0:t.getDefaultColumnDef()),{}),...e}),l(e,`debugColumns`,`_getDefaultColumnDef`)),_getColumnDefs:()=>n.options.columns,getAllColumns:c(()=>[n._getColumnDefs()],e=>{let t=function(e,r,i){return i===void 0&&(i=0),e.map(e=>{let a=d(n,e,i,r),o=e;return a.columns=o.columns?t(o.columns,a,i+1):[],a})};return t(e)},l(e,`debugColumns`,`getAllColumns`)),getAllFlatColumns:c(()=>[n.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),l(e,`debugColumns`,`getAllFlatColumns`)),_getAllFlatColumnsById:c(()=>[n.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),l(e,`debugColumns`,`getAllFlatColumnsById`)),getAllLeafColumns:c(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),l(e,`debugColumns`,`getAllLeafColumns`)),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,f);for(let e=0;e<n._features.length;e++){let t=n._features[e];t==null||t.createTable==null||t.createTable(n)}return n}function be(){return e=>c(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,a){i===void 0&&(i=0);let o=[];for(let c=0;c<t.length;c++){let l=g(e,e._getRowId(t[c],c,a),t[c],c,i,void 0,a?.id);if(n.flatRows.push(l),n.rowsById[l.id]=l,o.push(l),e.options.getSubRows){var s;l.originalSubRows=e.options.getSubRows(t[c],c),(s=l.originalSubRows)!=null&&s.length&&(l.subRows=r(l.originalSubRows,i+1,l))}}return o};return n.rows=r(t),n},l(e.options,`debugTable`,`getRowModel`,()=>e._autoResetPageIndex()))}function xe(e){let t=[],n=e=>{var r;t.push(e),(r=e.subRows)!=null&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Se(e,t,n){return n.options.filterFromLeafRows?Ce(e,t,n):$(e,t,n)}function Ce(e,t,n){let r=[],i={},a=n.options.maxLeafRowFilterDepth??100,o=function(e,s){s===void 0&&(s=0);let c=[];for(let u=0;u<e.length;u++){var l;let d=e[u],f=g(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(f.columnFilters=d.columnFilters,(l=d.subRows)!=null&&l.length&&s<a){if(f.subRows=o(d.subRows,s+1),d=f,t(d)&&!f.subRows.length){c.push(d),i[d.id]=d,r.push(d);continue}if(t(d)||f.subRows.length){c.push(d),i[d.id]=d,r.push(d);continue}}else d=f,t(d)&&(c.push(d),i[d.id]=d,r.push(d))}return c};return{rows:o(e),flatRows:r,rowsById:i}}function $(e,t,n){let r=[],i={},a=n.options.maxLeafRowFilterDepth??100,o=function(e,s){s===void 0&&(s=0);let c=[];for(let u=0;u<e.length;u++){let d=e[u];if(t(d)){var l;if((l=d.subRows)!=null&&l.length&&s<a){let e=g(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);e.subRows=o(d.subRows,s+1),d=e}c.push(d),r.push(d),i[d.id]=d}}return c};return{rows:o(e),flatRows:r,rowsById:i}}function we(){return e=>c(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}let i=[],a=[];(n??[]).forEach(t=>{let n=e.getColumn(t.id);if(!n)return;let r=n.getFilterFn();r&&i.push({id:t.id,filterFn:r,resolvedValue:(r.resolveFilterValue==null?void 0:r.resolveFilterValue(t.value))??t.value})});let o=(n??[]).map(e=>e.id),s=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());r&&s&&c.length&&(o.push(`__global__`),c.forEach(e=>{a.push({id:e.id,filterFn:s,resolvedValue:(s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))??r})}));let l,u;for(let e=0;e<t.flatRows.length;e++){let n=t.flatRows[e];if(n.columnFilters={},i.length)for(let e=0;e<i.length;e++){l=i[e];let t=l.id;n.columnFilters[t]=l.filterFn(n,t,l.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(a.length){for(let e=0;e<a.length;e++){u=a[e];let t=u.id;if(u.filterFn(n,t,u.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}n.columnFilters.__global__!==!0&&(n.columnFilters.__global__=!1)}}return Se(t.rows,e=>{for(let t=0;t<o.length;t++)if(e.columnFilters[o[t]]===!1)return!1;return!0},e)},l(e.options,`debugTable`,`getFilteredRowModel`,()=>e._autoResetPageIndex()))}function Te(e){return e=>c(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{if(!n.rows.length)return n;let{pageSize:r,pageIndex:i}=t,{rows:a,flatRows:o,rowsById:s}=n,c=r*i,l=c+r;a=a.slice(c,l);let u;u=e.options.paginateExpandedRows?{rows:a,flatRows:o,rowsById:s}:xe({rows:a,flatRows:o,rowsById:s}),u.flatRows=[];let d=e=>{u.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return u.rows.forEach(d),u},l(e.options,`debugTable`,`getPaginationRowModel`))}function Ee(){return e=>c(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;let r=e.getState().sorting,i=[],a=r.filter(t=>e.getColumn(t.id)?.getCanSort()),o={};a.forEach(t=>{let n=e.getColumn(t.id);n&&(o[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let r=a[n],i=o[r.id],s=i.sortUndefined,c=r?.desc??!1,l=0;if(s){let n=e.getValue(r.id),i=t.getValue(r.id),a=n===void 0,o=i===void 0;if(a||o){if(s===`first`)return a?-1:1;if(s===`last`)return a?1:-1;l=a&&o?0:a?s:-s}}if(l===0&&(l=i.sortingFn(e,t,r.id)),l!==0)return c&&(l*=-1),i.invertSorting&&(l*=-1),l}return e.index-t.index}),t.forEach(e=>{var t;i.push(e),(t=e.subRows)!=null&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},l(e.options,`debugTable`,`getSortedRowModel`,()=>e._autoResetPageIndex()))}function De(e,t){return e?Oe(e)?n.createElement(e,t):e:null}function Oe(e){return ke(e)||typeof e==`function`||Ae(e)}function ke(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Ae(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function je(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=n.useState(()=>({current:ye(t)})),[i,a]=n.useState(()=>r.current.initialState);return r.current.setOptions(t=>({...t,...e,state:{...i,...e.state},onStateChange:t=>{a(t),e.onStateChange==null||e.onStateChange(t)}})),r.current}export{Te as a,we as i,je as n,Ee as o,be as r,De as t};
@@ -1 +1 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{a as t,c as n,n as r,o as i,r as a,s as o,t as s}from"./use-run-status-favicon-ClaOG7BI.js";import{d as c}from"./tab-console-W4FDWhGS.js";import{t as l}from"./circle-x-CbsF-Or-.js";import{t as u}from"./square-lmyO8EeE.js";import{t as d}from"./use-page-title-BeSr97vd.js";import{$n as ee,At as f,C as te,Fn as ne,Jn as p,Nt as re,Q as m,Qn as h,U as ie,Un as ae,Ut as g,Wt as _,bt as v,cr as oe,er as se,ir as ce,lr as le,n as ue,nr as de,or as y,pr as fe,rr as pe,tr as b}from"./index-CZotRLCc.js";import{t as x}from"./badge-Dd058S66.js";import{n as me,r as he,t as ge}from"./resizable-BuOu2RfX.js";import{t as _e}from"./empty-state-c1UKljbh.js";import{i as S,n as C,r as w}from"./display-step-4AfU6w4K.js";var ve=p(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ye=p(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),T=e(fe(),1);function E(e=null){return L({runId:e,testInfo:null,steps:[],displaySteps:[],setupHooks:[],teardownHooks:[],inlineLogs:[],suiteTests:[],completedSteps:0,passedSteps:0,failedSteps:0,totalSteps:0,processedEventIds:[],stepNodes:[]})}function D(e){let t=e.runId??null,n=e.parentRunId??null,r=H(e);return t&&e.stepId?`step:${t}:${e.stepId}`:t&&typeof e.stepIndex==`number`?`step:${t}:index:${e.stepIndex}`:n&&r!==null&&e.stepId?`step:${n}:suite:${r}:step:${e.stepId}`:n&&r!==null&&typeof e.stepIndex==`number`?`step:${n}:suite:${r}:index:${e.stepIndex}`:n&&e.stepId?`step:${n}:${e.stepId}`:n&&typeof e.stepIndex==`number`?`step:${n}:index:${e.stepIndex}`:null}function be(e){return`hook:${e.runId??e.parentRunId??`unknown-run`}:${e.hookExecutionId}`}function O(e,t){if(t.eventId&&e.processedEventIds.includes(t.eventId))return e;let n=t.eventId?{...e,processedEventIds:[...e.processedEventIds,t.eventId]}:e;switch(t.type){case`run-start`:return L({...n,runId:t.runId});case`test-start`:return k(n,t);case`test-complete`:return A(n,t);case`step-start`:return j(n,t);case`step-phase`:return M(n,t);case`step-complete`:return N(n,t);case`hook-start`:return P(n,t);case`hook-end`:return F(n,t);case`run-complete`:return I(n,t);case`run-error`:return I(n,{type:`run-complete`,runId:t.runId,status:`failed`,duration:0});default:return n}}function xe(e,t){let n={...e},r=Ee(t,e.suiteTests),i=t.run?.id??e.runId??null,a=[...t.steps??[],...(t.childRuns??[]).flatMap(e=>e.steps)];t.run&&(n={...n,runId:n.runId??t.run.id,finalStatus:t.run.status}),t.suiteTests&&(n={...n,suiteTests:t.suiteTests});for(let e of a){let t=r.get(e.runId)??null,a=n.stepNodes.findIndex(n=>n.runId&&n.runId!==e.runId?!1:n.runId===e.runId&&n.stepId&&n.stepId===e.id||n.runId===e.runId&&typeof n.stepIndex==`number`&&n.stepIndex===e.stepOrder||!n.runId&&i&&n.parentRunId===i&&t!==null&&H(n)===t&&(n.stepId&&n.stepId===e.id||typeof n.stepIndex==`number`&&n.stepIndex===e.stepOrder)?!0:!n.runId&&!n.parentRunId&&n.name===e.name&&n.status!==`running`),o=a>=0?n.stepNodes[a]:null,s=K(C(e),o),c=a>=0?n.stepNodes[a].key:`step:${e.runId}:index:${e.stepOrder}`,l={...a>=0?n.stepNodes[a]:{key:c,phases:[],phaseGroups:{},status:y(e.status)},key:c,runId:e.runId,stepId:e.id,stepIndex:e.stepOrder,name:e.name,status:y(e.status),duration:e.duration,error:e.error??void 0,display:s},u=[...n.stepNodes];a>=0?u[a]=l:u.push(l),n={...n,stepNodes:u}}let o=[...t.logs??[],...(t.childRuns??[]).flatMap(e=>e.logs??[])];if(o.length>0){let e=Y(n.setupHooks,o.filter(e=>e.phase===`setup`)),t=Y(n.teardownHooks,o.filter(e=>e.phase===`teardown`)),r=Y(n.inlineLogs,o.filter(e=>e.phase===`inline`));n={...n,setupHooks:e,teardownHooks:t,inlineLogs:r}}return L(n)}function k(e,t){let n={name:t.testName,filePath:t.filePath,totalSteps:t.totalSteps},r=e.suiteTests;if(t.parentRunId&&typeof t.suiteIndex==`number`){let e=ke(t),n=[...r];n[t.suiteIndex]=e,r=n.filter(Boolean)}return L({...e,runId:e.runId??t.parentRunId??t.runId,testInfo:n,suiteTests:r})}function A(e,t){if(!t.parentRunId||typeof t.suiteIndex!=`number`)return e;let n=[...e.suiteTests],r=n[t.suiteIndex];return r&&(n[t.suiteIndex]={...r,status:t.status,duration:t.duration,endedAt:new Date().toISOString()}),L({...e,suiteTests:n})}function j(e,t){let n=V(e,t),r=e.stepNodes.findIndex(e=>e.key===n),i={...r>=0?e.stepNodes[r]:{key:n,phases:[],phaseGroups:{}},key:n,runId:t.runId,parentRunId:t.parentRunId,suiteIndex:t.suiteIndex,testIndex:t.testIndex,stepIndex:t.stepIndex,stepId:t.stepId,testName:t.testName,name:t.stepName,status:`running`};return L({...e,stepNodes:q(e.stepNodes,r,i)})}function M(e,t){let n=B(e,t);if(n<0)return M(j(e,{...t,type:`step-start`,timestamp:t.timestamp}),t);let r=e.stepNodes[n],i={phase:t.phase,subActionIndex:t.subActionIndex,phaseOrdinal:t.phaseOrdinal,text:t.text,confidence:t.confidence,action:t.action,success:t.success,duration:t.duration,timestamp:t.timestamp},a=[...r.phases,i],o={...r.phaseGroups};typeof t.subActionIndex==`number`&&(o[t.subActionIndex]=[...o[t.subActionIndex]??[],i]);let s={...r,phases:a,phaseGroups:o,observation:t.phase===`observe`?t.text:r.observation,reasoning:t.phase===`plan`?t.text:r.reasoning,plannedAction:t.phase===`execute`?t.action:r.plannedAction,action:t.phase===`execute`?t.action:r.action,confidence:t.phase===`plan`?t.confidence??null:r.confidence};return L({...e,stepNodes:q(e.stepNodes,n,s)})}function N(e,t){let n=B(e,t),r=n>=0?e.stepNodes[n].key:V(e,t),i={...n>=0?e.stepNodes[n]:{key:r,phases:[],phaseGroups:{}},key:r,runId:t.runId,parentRunId:t.parentRunId,suiteIndex:t.suiteIndex,testIndex:t.testIndex,stepIndex:t.stepIndex,stepId:t.stepId,name:t.stepName,testName:t.testName,status:y(t.status),duration:t.duration,error:t.error,screenshot:t.screenshot,screenshotBefore:t.screenshotBefore,observation:t.observation,reasoning:t.reasoning,plannedAction:t.plannedAction,result:t.result,annotation:t.annotation??null};return L({...e,stepNodes:q(e.stepNodes,n,i)})}function P(e,t){return L(De(e,J(t,`running`),t.phase))}function F(e,t){return L(De(e,J(t,t.status),t.phase))}function I(e,t){let n=se(t.status);return L({...e,finalStatus:t.status,stepNodes:e.stepNodes.map(e=>e.status===`running`?{...e,status:n}:e)})}function L(e){let t=S(e.stepNodes.map(Ce)),n=[...e.setupHooks.map(R),...e.stepNodes.map(Se),...e.teardownHooks.map(R)],r=t.filter(e=>![`pending`,`running`].includes(e.status)).length,i=t.filter(e=>[`passed`,`healed`,`flaky`].includes(e.status)).length,a=t.filter(e=>[`failed`,`cancelled`,`skipped`].includes(e.status)).length,o=e.testInfo?.totalSteps??t.length;return{...e,displaySteps:t,steps:n,completedSteps:r,passedSteps:i,failedSteps:a,totalSteps:o}}function R(e){return{id:e.id,kind:`hook`,hookPhase:e.phase,hookExecutionId:e.id,name:e.name,status:e.status,duration:e.duration,error:e.stderr??void 0}}function Se(e){return{id:e.key,kind:`step`,name:e.name,status:e.status,duration:e.duration,error:e.error,screenshot:e.screenshot,reasoning:e.reasoning,observation:e.observation,result:e.result,plannedAction:e.plannedAction,annotation:e.annotation??void 0,phases:e.phases}}function Ce(e){if(e.display)return{...e.display,id:e.key,rawRunId:e.display.rawRunId??e.runId??null,runId:e.display.runId??e.runId??null};let t=z(e),n=t?.find(e=>!!(e.observation||e.reasoning||e.plannedAction!=null));return{id:e.key,name:e.name,status:e.status,duration:e.duration??0,subActionsData:t,originalStepName:null,variableSnapshot:null,screenshotPath:Oe(e.screenshot),screenshotBeforePath:Oe(e.screenshotBefore),annotationData:e.annotation??null,observation:e.observation??n?.observation??null,reasoning:e.reasoning??n?.reasoning??null,plannedAction:e.plannedAction??n?.plannedAction??null,action:e.action??e.plannedAction??n?.plannedAction??null,error:e.error??null,confidence:e.confidence??n?.confidence??null,runId:e.runId??null,stepOrder:e.stepIndex??0,consoleLogs:null,networkLogs:null,healingAttempts:null,screenContextBefore:null,screenContextAfter:null,rawRunId:e.runId??null,rawStepOrder:e.stepIndex??0,displayStepOrder:(e.stepIndex??0)+1,displayStepTotal:null}}function z(e){let t=Object.entries(e.phaseGroups);return t.length===0?w(e.phases):t.sort(([e],[t])=>Number(e)-Number(t)).map(([e,t])=>we(Number(e),t))}function we(e,t){let n=t.find(e=>e.phase===`observe`),r=t.find(e=>e.phase===`plan`),i=t.find(e=>e.phase===`execute`),a=t.find(e=>e.phase===`verify`);return{index:e,observation:n?.text??``,reasoning:r?.text??``,plannedAction:i?.action??null,result:a?a.success?`success`:`failure`:`in-progress`,error:void 0,screenStateBefore:``,cached:!1,confidence:r?.confidence,verifierReasoning:a?.text,phaseDurations:{observe:n?.duration,plan:r?.duration,execute:i?.duration,verify:a?.duration}}}function B(e,t){let n=D(t);if(n){let t=e.stepNodes.findIndex(e=>e.key===n);if(t>=0)return t}if(t.runId&&typeof t.stepIndex==`number`){let n=e.stepNodes.findIndex(e=>e.runId===t.runId&&e.stepIndex===t.stepIndex);if(n>=0)return n}let r=Te(e.stepNodes,t);if(r>=0)return r;if(t.stepId){let n=e.stepNodes.findIndex(e=>e.stepId===t.stepId&&U(e,t));if(n>=0)return n}return e.stepNodes.findIndex(e=>e.name===t.stepName&&e.status===`running`&&U(e,t))}function V(e,t){let n=H(t),r=t.parentRunId&&n!==null?`${t.parentRunId}:suite:${n}`:t.runId??t.parentRunId??e.runId??`legacy`;return D(t)??`step:${r}:${t.stepName}:${e.stepNodes.length}`}function H(e){return typeof e.suiteIndex==`number`?e.suiteIndex:typeof e.testIndex==`number`?e.testIndex:null}function Te(e,t){let n=H(t);return!t.parentRunId||n===null||typeof t.stepIndex!=`number`?-1:e.findIndex(e=>e.parentRunId===t.parentRunId&&H(e)===n&&e.stepIndex===t.stepIndex)}function U(e,t){if(t.runId&&e.runId&&e.runId!==t.runId||t.parentRunId&&e.parentRunId&&e.parentRunId!==t.parentRunId)return!1;let n=H(t),r=H(e);return!(n!==null&&r!==null&&n!==r)}function Ee(e,t){let n=new Map;return t.forEach((e,t)=>W(n,e,t)),e.suiteTests?.forEach((e,t)=>W(n,e,t)),e.childRuns?.forEach((e,t)=>W(n,e.run,t)),n}function W(e,t,n){e.set(t.id,G(t)??e.get(t.id)??n)}function G(e){let t=e.metadata?.suiteIndex;if(typeof t==`number`)return t;if(typeof t==`string`&&t.trim()!==``){let e=Number(t);if(Number.isInteger(e))return e}return null}function K(e,t){if(!t||e.subActionsData)return e;let n=z(t);if(!n)return e;let r=n.find(e=>!!(e.observation||e.reasoning||e.plannedAction!=null));return{...e,subActionsData:n,observation:e.observation??t.observation??r?.observation??null,reasoning:e.reasoning??t.reasoning??r?.reasoning??null,plannedAction:e.plannedAction??t.plannedAction??r?.plannedAction??null,action:e.action??t.action??t.plannedAction??r?.plannedAction??null,confidence:e.confidence??t.confidence??r?.confidence??null}}function q(e,t,n){let r=[...e];return t>=0?r[t]=n:r.push(n),r}function J(e,t){return{id:be(e),runId:e.runId??e.parentRunId??``,stepId:e.stepId??null,type:`logType`in e&&e.logType?e.logType:`hook`,name:e.hookName,hookId:e.hookId??null,phase:e.phase,status:t,duration:`duration`in e?e.duration:0,stdout:`stdout`in e?e.stdout??null:null,stderr:`stderr`in e?e.stderr??null:null,returnData:null,variables:`variables`in e?e.variables??null:null,createdAt:e.timestamp}}function De(e,t,n){return n===`setup`?{...e,setupHooks:Y(e.setupHooks,[t])}:n===`teardown`?{...e,teardownHooks:Y(e.teardownHooks,[t])}:{...e,inlineLogs:Y(e.inlineLogs,[t])}}function Y(e,t){let n=[...e];for(let e of t){let t=n.findIndex(t=>t.id===e.id||t.id.endsWith(`:${e.id}`));t>=0?n[t]={...n[t],...e,id:n[t].id}:n.push(e)}return n}function Oe(e){return e?e.startsWith(`data:image/`)||e.startsWith(`blob:`)||e.startsWith(`http://`)||e.startsWith(`https://`)?e:`data:image/png;base64,${e}`:null}function ke(e){let t=e.timestamp??new Date().toISOString();return{id:e.runId,name:e.testName,filePath:e.filePath,status:`running`,duration:0,attributes:{},environment:null,metadata:{suiteIndex:e.suiteIndex},startedAt:t,endedAt:null,videoPath:null,failureSummary:null,errorLog:null,memoryLog:null,testId:null,suiteId:e.parentRunId??null,platform:`unknown`,testFileContent:null,modelName:null,llmProvider:null,parentRunId:e.parentRunId??null,attemptNumber:1,retryCount:0,maxRetries:0,createdAt:t}}function Ae(e,t){let[n,r]=(0,T.useState)(()=>E(e)),[i,a]=(0,T.useState)(`idle`),[o,s]=(0,T.useState)(),[c,l]=(0,T.useState)(0),[u,d]=(0,T.useState)(),ee=(0,T.useRef)(null),f=(0,T.useCallback)(e=>{r(t=>xe(t,e))},[]);return(0,T.useEffect)(()=>{if(!e){a(`idle`);return}let n=!1;r(E(e)),s(void 0),d(void 0),l(0),a(`connecting`);let i=t?new Date(t).getTime():Date.now();l(Math.max(0,Math.floor((Date.now()-i)/1e3)));let o=setInterval(()=>{n||l(Math.max(0,Math.floor((Date.now()-i)/1e3)))},1e3),c=v(e,{onRunStart:e=>{n||(a(`running`),r(t=>O(t,{type:`run-start`,runId:e.runId,status:e.status,eventId:e.eventId})))},onTestStart:e=>{n||r(t=>O(t,e))},onHookStart:e=>{n||r(t=>O(t,e))},onHookEnd:e=>{n||r(t=>O(t,e))},onStepStart:e=>{n||r(t=>O(t,e))},onStepComplete:e=>{n||r(t=>O(t,e))},onStepPhase:e=>{n||r(t=>O(t,e))},onRunComplete:e=>{if(!n){let t=b(e.status);a(`complete`),s(t.normalized),clearInterval(o),r(t=>O(t,e))}},onRunError:e=>{n||(a(`error`),d(e.error),clearInterval(o),r(t=>O(t,{type:`run-error`,...e})))}});return ee.current=c,()=>{n=!0,clearInterval(o),c.close(),ee.current=null}},[e,t]),{steps:n.steps,displaySteps:n.displaySteps,setupHooks:n.setupHooks,teardownHooks:n.teardownHooks,inlineLogs:n.inlineLogs,suiteTests:n.suiteTests,testInfo:n.testInfo,runStatus:i,finalStatus:o,elapsed:c,error:u,completedSteps:n.completedSteps,passedSteps:n.passedSteps,failedSteps:n.failedSteps,totalSteps:n.totalSteps,mergeFinalArtifacts:f}}var X=h();function je(e){let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}function Me({status:e,finalStatus:t}){if(e===`complete`&&t){let e=b(t);return(0,X.jsx)(x,{className:de(e.tone),children:e.label})}switch(e){case`connecting`:return(0,X.jsx)(x,{className:`border-amber-500/20 bg-amber-500/15 text-amber-500`,children:`Connecting...`});case`running`:return(0,X.jsx)(x,{className:`border-blue-500/20 bg-blue-500/15 text-blue-500`,children:`Running`});case`complete`:return(0,X.jsx)(x,{className:`border-emerald-500/20 bg-emerald-500/15 text-emerald-500`,children:`Complete`});case`error`:return(0,X.jsx)(x,{variant:`destructive`,children:`Error`});default:return(0,X.jsx)(x,{variant:`outline`,children:`Idle`})}}function Ne(e){return e?e.type===`step`?`step:${e.stepId}`:e.type===`subaction`?`sub:${e.stepId}:${e.subIndex}`:e.type===`execution`?`exec:${e.stepId}:${e.logId}`:e.type===`hook`?`hook:${e.hookId}`:e.type===`suite-hook`?`suite-hook:${e.phase}:${e.hookId}`:e.type===`test-hook`?`test-hook:${e.testIndex}:${e.phase}:${e.hookId}`:`test:${e.testIndex}`:null}function Pe(e,t){return e.stepId?e.stepId===t.id||t.id.endsWith(`:${e.stepId}`)?!0:t.rawRunId&&e.runId&&t.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===t.rawStepOrder:!1}function Fe(e,t,n,r){if(!e)return!1;if(e.type===`hook`)return n.some(t=>t.id===e.hookId);if(e.type===`execution`)return r.some(t=>t.id===e.logId);if(i(e)){let n=t.find(t=>t.id===e.stepId);return n?e.type===`subaction`?!!n.subActionsData?.[e.subIndex]:!0:!1}return!1}function Ie(e,t,n,r){let i=[...e].reverse().find(e=>e.status===`running`)??e.at(-1);if(i){let e=r.filter(e=>Pe(e,i)),t=[...e].reverse().find(e=>e.status===`running`)??e.at(-1);if(t)return{type:`execution`,stepId:i.id,logId:t.id};let n=i.subActionsData??[];return n.length>0?{type:`subaction`,stepId:i.id,subIndex:n.length-1}:{type:`step`,stepId:i.id}}let a=[...t,...n].at(-1);return a?{type:`hook`,hookId:a.id}:null}function Le(){d(`Live Run`);let{id:e}=le(),p=oe(),[h,v]=(0,T.useState)(null),[se,de]=(0,T.useState)(!1),[y,fe]=(0,T.useState)(!1),[x,S]=(0,T.useState)(null),[C,w]=(0,T.useState)(!0),[E,D]=(0,T.useState)(`overview`),[be,O]=(0,T.useState)(),xe=(0,T.useRef)(null),{displaySteps:k,setupHooks:A,teardownHooks:j,inlineLogs:M,suiteTests:N,testInfo:P,runStatus:F,finalStatus:I,elapsed:L,error:R,completedSteps:Se,passedSteps:Ce,failedSteps:z,totalSteps:we,mergeFinalArtifacts:B}=Ae(e??null,h?.startedAt),[V,H]=(0,T.useState)(!1);async function Te(){if(!(y||!e)){fe(!0);try{await te(e),f.success(`Run cancelled`)}catch{f.error(`Failed to cancel run`)}finally{fe(!1)}}}(0,T.useEffect)(()=>{if(!e)return;let t=!1;return v(null),H(!1),de(!0),m(e).then(e=>{t||v(e.run)}).catch(e=>{let n=e instanceof Error&&e.message.includes(`404`);!t&&!n&&f.error(`Failed to load run details`)}).finally(()=>{t||de(!1)}),()=>{t=!0}},[e]);let U=!!(h&&ce(h.status));(0,T.useEffect)(()=>{if(!e||V||!(F===`complete`||F===`error`||U))return;let t=!1;async function n(){try{let[n,r]=await Promise.all([m(e),ie(e).catch(()=>({logs:[]}))]);if(t)return;let i=[];if(n.tests&&n.tests.length>0)for(let e of n.tests)try{let n=await m(e.id);if(t)return;i.push({run:n.run,steps:n.steps})}catch{i.push({run:e,steps:[]})}B({run:n.run,steps:n.steps,logs:r.logs,suiteTests:n.tests,childRuns:i}),v(n.run),H(!0)}catch{t||H(!0)}}return n(),()=>{t=!0}},[U,V,e,B,F]);let Ee=I?s(I):h&&U?s(h.status):F===`error`?`failed`:F===`connecting`||F===`running`?`running`:`default`;r(e?Ee:`default`);let W=(0,T.useMemo)(()=>[...A,...j],[A,j]),G=(0,T.useMemo)(()=>Ie(k,A,j,M),[k,M,A,j]),K=Ne(G),q=Ne(x);(0,T.useEffect)(()=>{if(!G){x&&S(null);return}if(C||!x){q!==K&&S(G);return}if(!Fe(x,k,W,M)){let e=i(x)?k.find(e=>e.id===x.stepId):null;S(e?{type:`step`,stepId:e.id}:G)}},[W,q,k,M,C,K,G,x]);let J=(0,T.useCallback)(e=>{w(!1),S(e)},[]),De=(0,T.useCallback)(()=>{w(!0),G&&S(G)},[G]),Y=(0,T.useMemo)(()=>i(x)?k.find(e=>e.id===x.stepId)??null:null,[k,x]),Oe=(0,T.useMemo)(()=>!o(x)||!Y?null:Y.subActionsData?.[x.subIndex]??null,[x,Y]),ke=(0,T.useMemo)(()=>Y?M.filter(e=>Pe(e,Y)):[],[M,Y]),Le=(0,T.useMemo)(()=>x?.type===`hook`?W.find(e=>e.id===x.hookId)??null:null,[W,x]),Re=(0,T.useMemo)(()=>x?.type===`execution`?M.find(e=>e.id===x.logId)??null:null,[M,x]);if(!e)return(0,X.jsx)(_e,{icon:ye,title:`No run selected`,description:`Select a test run to watch live execution`});if(F===`idle`&&se)return(0,X.jsx)(ue,{});let Z=!!(U&&!I&&F!==`running`),ze=P?.name??h?.name??`Test Run`,Be=P?.filePath??h?.filePath??void 0,Q=we||k.length,Ve=Se||k.filter(e=>![`pending`,`running`].includes(e.status)).length,He=Q>0?Math.round(Ve/Q*100):0,Ue=(F===`running`||F===`connecting`)&&!Z,We=F===`complete`||F===`error`||Z,$=b(I??h?.status),Ge=!!(I||Z),Ke=k.length>0||A.length>0||j.length>0,qe=N.length>0?`all`:void 0;return(0,X.jsx)(re,{children:(0,X.jsxs)(`div`,{className:`flex h-screen min-w-0 flex-col overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center justify-between border-b px-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(ye,{className:_(`h-4 w-4 shrink-0`,Ue&&`animate-pulse text-blue-500`,We&&`text-muted-foreground`)}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`h2`,{className:`text-base font-semibold leading-tight`,children:`Live Execution`}),(0,X.jsx)(Me,{status:Z?`complete`:F,finalStatus:I??h?.status})]}),(0,X.jsxs)(`div`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:ze}),Be&&(0,X.jsx)(`span`,{className:`ml-2`,children:Be})]})]})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,X.jsx)(g,{variant:`ghost`,size:`sm`,onClick:De,disabled:!G||C,className:`h-7 px-2 text-xs`,children:`Latest`}),Ue&&(0,X.jsxs)(g,{variant:`ghost`,size:`sm`,onClick:Te,disabled:y,className:`h-7 px-2 text-xs text-muted-foreground transition-colors hover:bg-red-500/10 hover:text-red-400`,children:[(0,X.jsx)(l,{className:`size-3.5`}),y?`Cancelling...`:`Cancel`]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-sm text-muted-foreground`,children:[(0,X.jsx)(c,{className:`h-3.5 w-3.5`}),je(L)]}),(0,X.jsxs)(g,{variant:`outline`,size:`sm`,onClick:()=>p(ee.runDetail(e)),className:`h-7 px-2 text-xs`,children:[`View Full Results`,(0,X.jsx)(ve,{className:`ml-1 h-3.5 w-3.5`})]})]})]}),(0,X.jsxs)(`div`,{className:`shrink-0 border-b px-3 py-2`,children:[Q>0?(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{children:[`Step `,Ve,` of `,Q]}),(0,X.jsxs)(`span`,{children:[He,`%`]})]}),(0,X.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,X.jsx)(`div`,{className:_(`h-full rounded-full transition-all duration-300`,F===`error`||Ge&&$.tone===`danger`?`bg-destructive`:Ge&&$.tone===`muted`?`bg-muted-foreground`:`bg-emerald-500`),style:{width:`${He}%`}})})]}):null,F===`error`&&R?(0,X.jsxs)(`div`,{className:`mt-2 flex items-start gap-2 rounded-[2px] bg-destructive/10 p-2 text-destructive`,children:[(0,X.jsx)(ne,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,X.jsxs)(`div`,{className:`text-sm`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:`Run Error`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs`,children:R})]})]}):Ge?(0,X.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 text-sm`,children:[(0,X.jsxs)(`span`,{className:_(`flex items-center gap-1.5 font-medium`,pe($.tone)),children:[$.normalized===`passed`?(0,X.jsx)(ae,{className:`h-4 w-4`}):$.normalized===`cancelled`?(0,X.jsx)(u,{className:`h-4 w-4`}):$.normalized===`flaky`||$.normalized===`healed`?(0,X.jsx)(ne,{className:`h-4 w-4`}):(0,X.jsx)(l,{className:`h-4 w-4`}),$.label]}),k.length>0&&(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[Ce,` passed, `,z,` failed`]})]}):null]}),(0,X.jsxs)(he,{orientation:`horizontal`,className:`min-h-0 flex-1 overflow-hidden`,children:[(0,X.jsx)(me,{defaultSize:35,minSize:20,children:(0,X.jsx)(`div`,{className:`flex h-full min-h-0 min-w-[280px] flex-col overflow-y-auto`,children:Ke?(0,X.jsx)(t,{steps:k,selection:x,onSelect:J,suiteTests:N.length>0?N:void 0,suiteSelectedView:qe,setupHooks:A,teardownHooks:j,inlineLogs:M}):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Waiting for live events...`})})}),(0,X.jsx)(ge,{withHandle:!0}),(0,X.jsx)(me,{defaultSize:65,minSize:30,children:(0,X.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:x?.type===`hook`&&Le?(0,X.jsx)(n,{log:Le}):x?.type===`execution`&&Re?(0,X.jsx)(n,{log:Re}):(0,X.jsx)(a,{activeTab:E,onTabChange:D,step:Y,subAction:Oe,runId:Y?.rawRunId??e,allSteps:k,executionLogs:ke,platform:h?.platform,screenshotSide:be,onScreenshotSideChange:e=>O(e),pipelineRef:xe})})})]})]})})}export{Le as default};
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{a as t,c as n,n as r,o as i,r as a,s as o,t as s}from"./use-run-status-favicon-Rjqwuxhd.js";import{d as c}from"./tab-console-BORDNFzI.js";import{t as l}from"./circle-x-B7AOkLOS.js";import{t as u}from"./square-CgFZz_zK.js";import{t as d}from"./use-page-title-B4YPyIzc.js";import{$n as ee,At as f,C as te,Fn as ne,Jn as p,Nt as re,Q as m,Qn as h,U as ie,Un as ae,Ut as g,Wt as _,bt as v,cr as oe,er as se,ir as ce,lr as le,n as ue,nr as de,or as y,pr as fe,rr as pe,tr as b}from"./index-B4FdO6Vk.js";import{t as x}from"./badge-CC1v3nk4.js";import{n as me,r as he,t as ge}from"./resizable-B2X6KlcC.js";import{t as _e}from"./empty-state-BfgY0UGA.js";import{i as S,n as C,r as w}from"./display-step-CO4k5dQA.js";var ve=p(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ye=p(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),T=e(fe(),1);function E(e=null){return L({runId:e,testInfo:null,steps:[],displaySteps:[],setupHooks:[],teardownHooks:[],inlineLogs:[],suiteTests:[],completedSteps:0,passedSteps:0,failedSteps:0,totalSteps:0,processedEventIds:[],stepNodes:[]})}function D(e){let t=e.runId??null,n=e.parentRunId??null,r=H(e);return t&&e.stepId?`step:${t}:${e.stepId}`:t&&typeof e.stepIndex==`number`?`step:${t}:index:${e.stepIndex}`:n&&r!==null&&e.stepId?`step:${n}:suite:${r}:step:${e.stepId}`:n&&r!==null&&typeof e.stepIndex==`number`?`step:${n}:suite:${r}:index:${e.stepIndex}`:n&&e.stepId?`step:${n}:${e.stepId}`:n&&typeof e.stepIndex==`number`?`step:${n}:index:${e.stepIndex}`:null}function be(e){return`hook:${e.runId??e.parentRunId??`unknown-run`}:${e.hookExecutionId}`}function O(e,t){if(t.eventId&&e.processedEventIds.includes(t.eventId))return e;let n=t.eventId?{...e,processedEventIds:[...e.processedEventIds,t.eventId]}:e;switch(t.type){case`run-start`:return L({...n,runId:t.runId});case`test-start`:return k(n,t);case`test-complete`:return A(n,t);case`step-start`:return j(n,t);case`step-phase`:return M(n,t);case`step-complete`:return N(n,t);case`hook-start`:return P(n,t);case`hook-end`:return F(n,t);case`run-complete`:return I(n,t);case`run-error`:return I(n,{type:`run-complete`,runId:t.runId,status:`failed`,duration:0});default:return n}}function xe(e,t){let n={...e},r=Ee(t,e.suiteTests),i=t.run?.id??e.runId??null,a=[...t.steps??[],...(t.childRuns??[]).flatMap(e=>e.steps)];t.run&&(n={...n,runId:n.runId??t.run.id,finalStatus:t.run.status}),t.suiteTests&&(n={...n,suiteTests:t.suiteTests});for(let e of a){let t=r.get(e.runId)??null,a=n.stepNodes.findIndex(n=>n.runId&&n.runId!==e.runId?!1:n.runId===e.runId&&n.stepId&&n.stepId===e.id||n.runId===e.runId&&typeof n.stepIndex==`number`&&n.stepIndex===e.stepOrder||!n.runId&&i&&n.parentRunId===i&&t!==null&&H(n)===t&&(n.stepId&&n.stepId===e.id||typeof n.stepIndex==`number`&&n.stepIndex===e.stepOrder)?!0:!n.runId&&!n.parentRunId&&n.name===e.name&&n.status!==`running`),o=a>=0?n.stepNodes[a]:null,s=K(C(e),o),c=a>=0?n.stepNodes[a].key:`step:${e.runId}:index:${e.stepOrder}`,l={...a>=0?n.stepNodes[a]:{key:c,phases:[],phaseGroups:{},status:y(e.status)},key:c,runId:e.runId,stepId:e.id,stepIndex:e.stepOrder,name:e.name,status:y(e.status),duration:e.duration,error:e.error??void 0,display:s},u=[...n.stepNodes];a>=0?u[a]=l:u.push(l),n={...n,stepNodes:u}}let o=[...t.logs??[],...(t.childRuns??[]).flatMap(e=>e.logs??[])];if(o.length>0){let e=Y(n.setupHooks,o.filter(e=>e.phase===`setup`)),t=Y(n.teardownHooks,o.filter(e=>e.phase===`teardown`)),r=Y(n.inlineLogs,o.filter(e=>e.phase===`inline`));n={...n,setupHooks:e,teardownHooks:t,inlineLogs:r}}return L(n)}function k(e,t){let n={name:t.testName,filePath:t.filePath,totalSteps:t.totalSteps},r=e.suiteTests;if(t.parentRunId&&typeof t.suiteIndex==`number`){let e=ke(t),n=[...r];n[t.suiteIndex]=e,r=n.filter(Boolean)}return L({...e,runId:e.runId??t.parentRunId??t.runId,testInfo:n,suiteTests:r})}function A(e,t){if(!t.parentRunId||typeof t.suiteIndex!=`number`)return e;let n=[...e.suiteTests],r=n[t.suiteIndex];return r&&(n[t.suiteIndex]={...r,status:t.status,duration:t.duration,endedAt:new Date().toISOString()}),L({...e,suiteTests:n})}function j(e,t){let n=V(e,t),r=e.stepNodes.findIndex(e=>e.key===n),i={...r>=0?e.stepNodes[r]:{key:n,phases:[],phaseGroups:{}},key:n,runId:t.runId,parentRunId:t.parentRunId,suiteIndex:t.suiteIndex,testIndex:t.testIndex,stepIndex:t.stepIndex,stepId:t.stepId,testName:t.testName,name:t.stepName,status:`running`};return L({...e,stepNodes:q(e.stepNodes,r,i)})}function M(e,t){let n=B(e,t);if(n<0)return M(j(e,{...t,type:`step-start`,timestamp:t.timestamp}),t);let r=e.stepNodes[n],i={phase:t.phase,subActionIndex:t.subActionIndex,phaseOrdinal:t.phaseOrdinal,text:t.text,confidence:t.confidence,action:t.action,success:t.success,duration:t.duration,timestamp:t.timestamp},a=[...r.phases,i],o={...r.phaseGroups};typeof t.subActionIndex==`number`&&(o[t.subActionIndex]=[...o[t.subActionIndex]??[],i]);let s={...r,phases:a,phaseGroups:o,observation:t.phase===`observe`?t.text:r.observation,reasoning:t.phase===`plan`?t.text:r.reasoning,plannedAction:t.phase===`execute`?t.action:r.plannedAction,action:t.phase===`execute`?t.action:r.action,confidence:t.phase===`plan`?t.confidence??null:r.confidence};return L({...e,stepNodes:q(e.stepNodes,n,s)})}function N(e,t){let n=B(e,t),r=n>=0?e.stepNodes[n].key:V(e,t),i={...n>=0?e.stepNodes[n]:{key:r,phases:[],phaseGroups:{}},key:r,runId:t.runId,parentRunId:t.parentRunId,suiteIndex:t.suiteIndex,testIndex:t.testIndex,stepIndex:t.stepIndex,stepId:t.stepId,name:t.stepName,testName:t.testName,status:y(t.status),duration:t.duration,error:t.error,screenshot:t.screenshot,screenshotBefore:t.screenshotBefore,observation:t.observation,reasoning:t.reasoning,plannedAction:t.plannedAction,result:t.result,annotation:t.annotation??null};return L({...e,stepNodes:q(e.stepNodes,n,i)})}function P(e,t){return L(De(e,J(t,`running`),t.phase))}function F(e,t){return L(De(e,J(t,t.status),t.phase))}function I(e,t){let n=se(t.status);return L({...e,finalStatus:t.status,stepNodes:e.stepNodes.map(e=>e.status===`running`?{...e,status:n}:e)})}function L(e){let t=S(e.stepNodes.map(Ce)),n=[...e.setupHooks.map(R),...e.stepNodes.map(Se),...e.teardownHooks.map(R)],r=t.filter(e=>![`pending`,`running`].includes(e.status)).length,i=t.filter(e=>[`passed`,`healed`,`flaky`].includes(e.status)).length,a=t.filter(e=>[`failed`,`cancelled`,`skipped`].includes(e.status)).length,o=e.testInfo?.totalSteps??t.length;return{...e,displaySteps:t,steps:n,completedSteps:r,passedSteps:i,failedSteps:a,totalSteps:o}}function R(e){return{id:e.id,kind:`hook`,hookPhase:e.phase,hookExecutionId:e.id,name:e.name,status:e.status,duration:e.duration,error:e.stderr??void 0}}function Se(e){return{id:e.key,kind:`step`,name:e.name,status:e.status,duration:e.duration,error:e.error,screenshot:e.screenshot,reasoning:e.reasoning,observation:e.observation,result:e.result,plannedAction:e.plannedAction,annotation:e.annotation??void 0,phases:e.phases}}function Ce(e){if(e.display)return{...e.display,id:e.key,rawRunId:e.display.rawRunId??e.runId??null,runId:e.display.runId??e.runId??null};let t=z(e),n=t?.find(e=>!!(e.observation||e.reasoning||e.plannedAction!=null));return{id:e.key,name:e.name,status:e.status,duration:e.duration??0,subActionsData:t,originalStepName:null,variableSnapshot:null,screenshotPath:Oe(e.screenshot),screenshotBeforePath:Oe(e.screenshotBefore),annotationData:e.annotation??null,observation:e.observation??n?.observation??null,reasoning:e.reasoning??n?.reasoning??null,plannedAction:e.plannedAction??n?.plannedAction??null,action:e.action??e.plannedAction??n?.plannedAction??null,error:e.error??null,confidence:e.confidence??n?.confidence??null,runId:e.runId??null,stepOrder:e.stepIndex??0,consoleLogs:null,networkLogs:null,healingAttempts:null,screenContextBefore:null,screenContextAfter:null,rawRunId:e.runId??null,rawStepOrder:e.stepIndex??0,displayStepOrder:(e.stepIndex??0)+1,displayStepTotal:null}}function z(e){let t=Object.entries(e.phaseGroups);return t.length===0?w(e.phases):t.sort(([e],[t])=>Number(e)-Number(t)).map(([e,t])=>we(Number(e),t))}function we(e,t){let n=t.find(e=>e.phase===`observe`),r=t.find(e=>e.phase===`plan`),i=t.find(e=>e.phase===`execute`),a=t.find(e=>e.phase===`verify`);return{index:e,observation:n?.text??``,reasoning:r?.text??``,plannedAction:i?.action??null,result:a?a.success?`success`:`failure`:`in-progress`,error:void 0,screenStateBefore:``,cached:!1,confidence:r?.confidence,verifierReasoning:a?.text,phaseDurations:{observe:n?.duration,plan:r?.duration,execute:i?.duration,verify:a?.duration}}}function B(e,t){let n=D(t);if(n){let t=e.stepNodes.findIndex(e=>e.key===n);if(t>=0)return t}if(t.runId&&typeof t.stepIndex==`number`){let n=e.stepNodes.findIndex(e=>e.runId===t.runId&&e.stepIndex===t.stepIndex);if(n>=0)return n}let r=Te(e.stepNodes,t);if(r>=0)return r;if(t.stepId){let n=e.stepNodes.findIndex(e=>e.stepId===t.stepId&&U(e,t));if(n>=0)return n}return e.stepNodes.findIndex(e=>e.name===t.stepName&&e.status===`running`&&U(e,t))}function V(e,t){let n=H(t),r=t.parentRunId&&n!==null?`${t.parentRunId}:suite:${n}`:t.runId??t.parentRunId??e.runId??`legacy`;return D(t)??`step:${r}:${t.stepName}:${e.stepNodes.length}`}function H(e){return typeof e.suiteIndex==`number`?e.suiteIndex:typeof e.testIndex==`number`?e.testIndex:null}function Te(e,t){let n=H(t);return!t.parentRunId||n===null||typeof t.stepIndex!=`number`?-1:e.findIndex(e=>e.parentRunId===t.parentRunId&&H(e)===n&&e.stepIndex===t.stepIndex)}function U(e,t){if(t.runId&&e.runId&&e.runId!==t.runId||t.parentRunId&&e.parentRunId&&e.parentRunId!==t.parentRunId)return!1;let n=H(t),r=H(e);return!(n!==null&&r!==null&&n!==r)}function Ee(e,t){let n=new Map;return t.forEach((e,t)=>W(n,e,t)),e.suiteTests?.forEach((e,t)=>W(n,e,t)),e.childRuns?.forEach((e,t)=>W(n,e.run,t)),n}function W(e,t,n){e.set(t.id,G(t)??e.get(t.id)??n)}function G(e){let t=e.metadata?.suiteIndex;if(typeof t==`number`)return t;if(typeof t==`string`&&t.trim()!==``){let e=Number(t);if(Number.isInteger(e))return e}return null}function K(e,t){if(!t||e.subActionsData)return e;let n=z(t);if(!n)return e;let r=n.find(e=>!!(e.observation||e.reasoning||e.plannedAction!=null));return{...e,subActionsData:n,observation:e.observation??t.observation??r?.observation??null,reasoning:e.reasoning??t.reasoning??r?.reasoning??null,plannedAction:e.plannedAction??t.plannedAction??r?.plannedAction??null,action:e.action??t.action??t.plannedAction??r?.plannedAction??null,confidence:e.confidence??t.confidence??r?.confidence??null}}function q(e,t,n){let r=[...e];return t>=0?r[t]=n:r.push(n),r}function J(e,t){return{id:be(e),runId:e.runId??e.parentRunId??``,stepId:e.stepId??null,type:`logType`in e&&e.logType?e.logType:`hook`,name:e.hookName,hookId:e.hookId??null,phase:e.phase,status:t,duration:`duration`in e?e.duration:0,stdout:`stdout`in e?e.stdout??null:null,stderr:`stderr`in e?e.stderr??null:null,returnData:null,variables:`variables`in e?e.variables??null:null,createdAt:e.timestamp}}function De(e,t,n){return n===`setup`?{...e,setupHooks:Y(e.setupHooks,[t])}:n===`teardown`?{...e,teardownHooks:Y(e.teardownHooks,[t])}:{...e,inlineLogs:Y(e.inlineLogs,[t])}}function Y(e,t){let n=[...e];for(let e of t){let t=n.findIndex(t=>t.id===e.id||t.id.endsWith(`:${e.id}`));t>=0?n[t]={...n[t],...e,id:n[t].id}:n.push(e)}return n}function Oe(e){return e?e.startsWith(`data:image/`)||e.startsWith(`blob:`)||e.startsWith(`http://`)||e.startsWith(`https://`)?e:`data:image/png;base64,${e}`:null}function ke(e){let t=e.timestamp??new Date().toISOString();return{id:e.runId,name:e.testName,filePath:e.filePath,status:`running`,duration:0,attributes:{},environment:null,metadata:{suiteIndex:e.suiteIndex},startedAt:t,endedAt:null,videoPath:null,failureSummary:null,errorLog:null,memoryLog:null,testId:null,suiteId:e.parentRunId??null,platform:`unknown`,testFileContent:null,modelName:null,llmProvider:null,parentRunId:e.parentRunId??null,attemptNumber:1,retryCount:0,maxRetries:0,createdAt:t}}function Ae(e,t){let[n,r]=(0,T.useState)(()=>E(e)),[i,a]=(0,T.useState)(`idle`),[o,s]=(0,T.useState)(),[c,l]=(0,T.useState)(0),[u,d]=(0,T.useState)(),ee=(0,T.useRef)(null),f=(0,T.useCallback)(e=>{r(t=>xe(t,e))},[]);return(0,T.useEffect)(()=>{if(!e){a(`idle`);return}let n=!1;r(E(e)),s(void 0),d(void 0),l(0),a(`connecting`);let i=t?new Date(t).getTime():Date.now();l(Math.max(0,Math.floor((Date.now()-i)/1e3)));let o=setInterval(()=>{n||l(Math.max(0,Math.floor((Date.now()-i)/1e3)))},1e3),c=v(e,{onRunStart:e=>{n||(a(`running`),r(t=>O(t,{type:`run-start`,runId:e.runId,status:e.status,eventId:e.eventId})))},onTestStart:e=>{n||r(t=>O(t,e))},onHookStart:e=>{n||r(t=>O(t,e))},onHookEnd:e=>{n||r(t=>O(t,e))},onStepStart:e=>{n||r(t=>O(t,e))},onStepComplete:e=>{n||r(t=>O(t,e))},onStepPhase:e=>{n||r(t=>O(t,e))},onRunComplete:e=>{if(!n){let t=b(e.status);a(`complete`),s(t.normalized),clearInterval(o),r(t=>O(t,e))}},onRunError:e=>{n||(a(`error`),d(e.error),clearInterval(o),r(t=>O(t,{type:`run-error`,...e})))}});return ee.current=c,()=>{n=!0,clearInterval(o),c.close(),ee.current=null}},[e,t]),{steps:n.steps,displaySteps:n.displaySteps,setupHooks:n.setupHooks,teardownHooks:n.teardownHooks,inlineLogs:n.inlineLogs,suiteTests:n.suiteTests,testInfo:n.testInfo,runStatus:i,finalStatus:o,elapsed:c,error:u,completedSteps:n.completedSteps,passedSteps:n.passedSteps,failedSteps:n.failedSteps,totalSteps:n.totalSteps,mergeFinalArtifacts:f}}var X=h();function je(e){let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}function Me({status:e,finalStatus:t}){if(e===`complete`&&t){let e=b(t);return(0,X.jsx)(x,{className:de(e.tone),children:e.label})}switch(e){case`connecting`:return(0,X.jsx)(x,{className:`border-amber-500/20 bg-amber-500/15 text-amber-500`,children:`Connecting...`});case`running`:return(0,X.jsx)(x,{className:`border-blue-500/20 bg-blue-500/15 text-blue-500`,children:`Running`});case`complete`:return(0,X.jsx)(x,{className:`border-emerald-500/20 bg-emerald-500/15 text-emerald-500`,children:`Complete`});case`error`:return(0,X.jsx)(x,{variant:`destructive`,children:`Error`});default:return(0,X.jsx)(x,{variant:`outline`,children:`Idle`})}}function Ne(e){return e?e.type===`step`?`step:${e.stepId}`:e.type===`subaction`?`sub:${e.stepId}:${e.subIndex}`:e.type===`execution`?`exec:${e.stepId}:${e.logId}`:e.type===`hook`?`hook:${e.hookId}`:e.type===`suite-hook`?`suite-hook:${e.phase}:${e.hookId}`:e.type===`test-hook`?`test-hook:${e.testIndex}:${e.phase}:${e.hookId}`:`test:${e.testIndex}`:null}function Pe(e,t){return e.stepId?e.stepId===t.id||t.id.endsWith(`:${e.stepId}`)?!0:t.rawRunId&&e.runId&&t.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===t.rawStepOrder:!1}function Fe(e,t,n,r){if(!e)return!1;if(e.type===`hook`)return n.some(t=>t.id===e.hookId);if(e.type===`execution`)return r.some(t=>t.id===e.logId);if(i(e)){let n=t.find(t=>t.id===e.stepId);return n?e.type===`subaction`?!!n.subActionsData?.[e.subIndex]:!0:!1}return!1}function Ie(e,t,n,r){let i=[...e].reverse().find(e=>e.status===`running`)??e.at(-1);if(i){let e=r.filter(e=>Pe(e,i)),t=[...e].reverse().find(e=>e.status===`running`)??e.at(-1);if(t)return{type:`execution`,stepId:i.id,logId:t.id};let n=i.subActionsData??[];return n.length>0?{type:`subaction`,stepId:i.id,subIndex:n.length-1}:{type:`step`,stepId:i.id}}let a=[...t,...n].at(-1);return a?{type:`hook`,hookId:a.id}:null}function Le(){d(`Live Run`);let{id:e}=le(),p=oe(),[h,v]=(0,T.useState)(null),[se,de]=(0,T.useState)(!1),[y,fe]=(0,T.useState)(!1),[x,S]=(0,T.useState)(null),[C,w]=(0,T.useState)(!0),[E,D]=(0,T.useState)(`overview`),[be,O]=(0,T.useState)(),xe=(0,T.useRef)(null),{displaySteps:k,setupHooks:A,teardownHooks:j,inlineLogs:M,suiteTests:N,testInfo:P,runStatus:F,finalStatus:I,elapsed:L,error:R,completedSteps:Se,passedSteps:Ce,failedSteps:z,totalSteps:we,mergeFinalArtifacts:B}=Ae(e??null,h?.startedAt),[V,H]=(0,T.useState)(!1);async function Te(){if(!(y||!e)){fe(!0);try{await te(e),f.success(`Run cancelled`)}catch{f.error(`Failed to cancel run`)}finally{fe(!1)}}}(0,T.useEffect)(()=>{if(!e)return;let t=!1;return v(null),H(!1),de(!0),m(e).then(e=>{t||v(e.run)}).catch(e=>{let n=e instanceof Error&&e.message.includes(`404`);!t&&!n&&f.error(`Failed to load run details`)}).finally(()=>{t||de(!1)}),()=>{t=!0}},[e]);let U=!!(h&&ce(h.status));(0,T.useEffect)(()=>{if(!e||V||!(F===`complete`||F===`error`||U))return;let t=!1;async function n(){try{let[n,r]=await Promise.all([m(e),ie(e).catch(()=>({logs:[]}))]);if(t)return;let i=[];if(n.tests&&n.tests.length>0)for(let e of n.tests)try{let n=await m(e.id);if(t)return;i.push({run:n.run,steps:n.steps})}catch{i.push({run:e,steps:[]})}B({run:n.run,steps:n.steps,logs:r.logs,suiteTests:n.tests,childRuns:i}),v(n.run),H(!0)}catch{t||H(!0)}}return n(),()=>{t=!0}},[U,V,e,B,F]);let Ee=I?s(I):h&&U?s(h.status):F===`error`?`failed`:F===`connecting`||F===`running`?`running`:`default`;r(e?Ee:`default`);let W=(0,T.useMemo)(()=>[...A,...j],[A,j]),G=(0,T.useMemo)(()=>Ie(k,A,j,M),[k,M,A,j]),K=Ne(G),q=Ne(x);(0,T.useEffect)(()=>{if(!G){x&&S(null);return}if(C||!x){q!==K&&S(G);return}if(!Fe(x,k,W,M)){let e=i(x)?k.find(e=>e.id===x.stepId):null;S(e?{type:`step`,stepId:e.id}:G)}},[W,q,k,M,C,K,G,x]);let J=(0,T.useCallback)(e=>{w(!1),S(e)},[]),De=(0,T.useCallback)(()=>{w(!0),G&&S(G)},[G]),Y=(0,T.useMemo)(()=>i(x)?k.find(e=>e.id===x.stepId)??null:null,[k,x]),Oe=(0,T.useMemo)(()=>!o(x)||!Y?null:Y.subActionsData?.[x.subIndex]??null,[x,Y]),ke=(0,T.useMemo)(()=>Y?M.filter(e=>Pe(e,Y)):[],[M,Y]),Le=(0,T.useMemo)(()=>x?.type===`hook`?W.find(e=>e.id===x.hookId)??null:null,[W,x]),Re=(0,T.useMemo)(()=>x?.type===`execution`?M.find(e=>e.id===x.logId)??null:null,[M,x]);if(!e)return(0,X.jsx)(_e,{icon:ye,title:`No run selected`,description:`Select a test run to watch live execution`});if(F===`idle`&&se)return(0,X.jsx)(ue,{});let Z=!!(U&&!I&&F!==`running`),ze=P?.name??h?.name??`Test Run`,Be=P?.filePath??h?.filePath??void 0,Q=we||k.length,Ve=Se||k.filter(e=>![`pending`,`running`].includes(e.status)).length,He=Q>0?Math.round(Ve/Q*100):0,Ue=(F===`running`||F===`connecting`)&&!Z,We=F===`complete`||F===`error`||Z,$=b(I??h?.status),Ge=!!(I||Z),Ke=k.length>0||A.length>0||j.length>0,qe=N.length>0?`all`:void 0;return(0,X.jsx)(re,{children:(0,X.jsxs)(`div`,{className:`flex h-screen min-w-0 flex-col overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center justify-between border-b px-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(ye,{className:_(`h-4 w-4 shrink-0`,Ue&&`animate-pulse text-blue-500`,We&&`text-muted-foreground`)}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`h2`,{className:`text-base font-semibold leading-tight`,children:`Live Execution`}),(0,X.jsx)(Me,{status:Z?`complete`:F,finalStatus:I??h?.status})]}),(0,X.jsxs)(`div`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:ze}),Be&&(0,X.jsx)(`span`,{className:`ml-2`,children:Be})]})]})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,X.jsx)(g,{variant:`ghost`,size:`sm`,onClick:De,disabled:!G||C,className:`h-7 px-2 text-xs`,children:`Latest`}),Ue&&(0,X.jsxs)(g,{variant:`ghost`,size:`sm`,onClick:Te,disabled:y,className:`h-7 px-2 text-xs text-muted-foreground transition-colors hover:bg-red-500/10 hover:text-red-400`,children:[(0,X.jsx)(l,{className:`size-3.5`}),y?`Cancelling...`:`Cancel`]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-sm text-muted-foreground`,children:[(0,X.jsx)(c,{className:`h-3.5 w-3.5`}),je(L)]}),(0,X.jsxs)(g,{variant:`outline`,size:`sm`,onClick:()=>p(ee.runDetail(e)),className:`h-7 px-2 text-xs`,children:[`View Full Results`,(0,X.jsx)(ve,{className:`ml-1 h-3.5 w-3.5`})]})]})]}),(0,X.jsxs)(`div`,{className:`shrink-0 border-b px-3 py-2`,children:[Q>0?(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{children:[`Step `,Ve,` of `,Q]}),(0,X.jsxs)(`span`,{children:[He,`%`]})]}),(0,X.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,X.jsx)(`div`,{className:_(`h-full rounded-full transition-all duration-300`,F===`error`||Ge&&$.tone===`danger`?`bg-destructive`:Ge&&$.tone===`muted`?`bg-muted-foreground`:`bg-emerald-500`),style:{width:`${He}%`}})})]}):null,F===`error`&&R?(0,X.jsxs)(`div`,{className:`mt-2 flex items-start gap-2 rounded-[2px] bg-destructive/10 p-2 text-destructive`,children:[(0,X.jsx)(ne,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,X.jsxs)(`div`,{className:`text-sm`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:`Run Error`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs`,children:R})]})]}):Ge?(0,X.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 text-sm`,children:[(0,X.jsxs)(`span`,{className:_(`flex items-center gap-1.5 font-medium`,pe($.tone)),children:[$.normalized===`passed`?(0,X.jsx)(ae,{className:`h-4 w-4`}):$.normalized===`cancelled`?(0,X.jsx)(u,{className:`h-4 w-4`}):$.normalized===`flaky`||$.normalized===`healed`?(0,X.jsx)(ne,{className:`h-4 w-4`}):(0,X.jsx)(l,{className:`h-4 w-4`}),$.label]}),k.length>0&&(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[Ce,` passed, `,z,` failed`]})]}):null]}),(0,X.jsxs)(he,{orientation:`horizontal`,className:`min-h-0 flex-1 overflow-hidden`,children:[(0,X.jsx)(me,{defaultSize:35,minSize:20,children:(0,X.jsx)(`div`,{className:`flex h-full min-h-0 min-w-[280px] flex-col overflow-y-auto`,children:Ke?(0,X.jsx)(t,{steps:k,selection:x,onSelect:J,suiteTests:N.length>0?N:void 0,suiteSelectedView:qe,setupHooks:A,teardownHooks:j,inlineLogs:M}):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Waiting for live events...`})})}),(0,X.jsx)(ge,{withHandle:!0}),(0,X.jsx)(me,{defaultSize:65,minSize:30,children:(0,X.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:x?.type===`hook`&&Le?(0,X.jsx)(n,{log:Le}):x?.type===`execution`&&Re?(0,X.jsx)(n,{log:Re}):(0,X.jsx)(a,{activeTab:E,onTabChange:D,step:Y,subAction:Oe,runId:Y?.rawRunId??e,allSteps:k,executionLogs:ke,platform:h?.platform,screenshotSide:be,onScreenshotSideChange:e=>O(e),pipelineRef:xe})})})]})]})})}export{Le as default};
@@ -1 +1 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{n as t,r as n}from"./shortcut-hints-BnEYaq1r.js";import{t as r}from"./use-page-title-BeSr97vd.js";import{t as i}from"./scroll-area-48uajHeh.js";import{$n as a,Gt as o,Ht as s,J as c,Kt as l,Mt as u,Nt as d,Pt as f,Qn as p,Ut as m,Wt as h,a as g,cr as _,jt as v,pr as y,qn as b}from"./index-CZotRLCc.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./table-BGMQ2E9D.js";import{t as D}from"./empty-state-c1UKljbh.js";import{t as O}from"./use-keyboard-shortcuts-BTppBDf3.js";var k=e(y(),1),A=p(),j=3,M={scope:`9rem`,source:`8rem`,lastConfirmed:`9rem`};function N(){r(`Memory`);let e=_(),[t,n]=(0,k.useState)([]),[p,h]=(0,k.useState)(!0),[y,j]=(0,k.useState)(!1),[N,B]=(0,k.useState)(``),[V,H]=(0,k.useState)(-1),U=(0,k.useRef)([]),W=(0,k.useCallback)(()=>{let e=!1;return h(!0),j(!1),c().then(t=>{e||n(t.products)}).catch(()=>{e||(n([]),j(!0))}).finally(()=>{e||h(!1)}),()=>{e=!0}},[]);(0,k.useEffect)(()=>W(),[W]);let G=(0,k.useMemo)(()=>{let e=N.trim().toLowerCase();return e?t.filter(t=>t.productKey.toLowerCase().includes(e)):t},[t,N]),K=(0,k.useCallback)(e=>{B(e),H(-1)},[]),q=(0,k.useCallback)((t,n)=>{n&&n.preventDefault(),e(a.memoryProduct(t.productKey))},[e]);return O((0,k.useMemo)(()=>{let t=()=>H(e=>Math.min(e+1,G.length-1)),n=()=>H(e=>Math.max(e-1,0));return{j:t,arrowdown:t,k:n,arrowup:n,enter:t=>{if(V<0||!G[V])return;let n=G[V],r=a.memoryProduct(n.productKey);if(t.metaKey||t.ctrlKey){window.open(r,`_blank`);return}e(r)}}},[G,e,V])),(0,k.useEffect)(()=>{if(V<0)return;let e=U.current[V];e&&document.activeElement!==e&&e.focus()},[V,G.length]),p?(0,A.jsx)(g,{}):y?(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsx)(P,{}),(0,A.jsxs)(`div`,{className:`rounded-md border bg-card p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Couldn't load memory. Refresh the page. If it continues, verify the dashboard server can read the workspace memory directory.`}),(0,A.jsx)(m,{className:`mt-4`,variant:`outline`,onClick:W,children:`Refresh`})]})]}):t.length===0?(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsx)(P,{}),(0,A.jsx)(D,{icon:b,title:`No product memory yet`,description:`Run tests or suites with memory enabled to build memory for this workspace.`,actionLabel:`Open Runs`,onAction:()=>e(a.runs)})]}):(0,A.jsx)(d,{children:(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsx)(P,{actions:(0,A.jsx)(F,{})}),(0,A.jsx)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:(0,A.jsx)(s,{placeholder:`Search products`,value:N,onChange:e=>K(e.target.value),className:`max-w-[220px]`})}),(0,A.jsx)(i,{className:`rounded-md border`,children:(0,A.jsxs)(E,{className:`min-w-full table-fixed`,children:[(0,A.jsxs)(`colgroup`,{children:[(0,A.jsx)(`col`,{"data-column-id":`product`}),(0,A.jsx)(`col`,{"data-column-id":`scope`,style:{width:M.scope}}),(0,A.jsx)(`col`,{"data-column-id":`source`,style:{width:M.source}}),(0,A.jsx)(`col`,{"data-column-id":`lastConfirmed`,style:{width:M.lastConfirmed}})]}),(0,A.jsx)(x,{children:(0,A.jsxs)(w,{className:`hover:bg-transparent`,children:[(0,A.jsx)(S,{"data-column-id":`product`,className:I(`product`),children:`Product`}),(0,A.jsx)(S,{"data-column-id":`scope`,className:I(`scope`),children:`Product / Suite / Test`}),(0,A.jsx)(S,{"data-column-id":`source`,className:I(`source`),children:`Suite / Test`}),(0,A.jsx)(S,{"data-column-id":`lastConfirmed`,className:I(`lastConfirmed`),children:`Last confirmed`})]})}),(0,A.jsx)(C,{children:G.length>0?G.map((e,t)=>{let n=t===V,r=z(e.targetReferences),i=[e.scopeCounts.product,e.scopeCounts.suite,e.scopeCounts.test].join(` / `),a=[e.sourceCounts.suite,e.sourceCounts.test].join(` / `);return(0,A.jsxs)(w,{ref:e=>{U.current[t]=e},"data-memory-product":e.productKey,tabIndex:n?0:-1,"aria-selected":n,className:R(n),onClick:()=>{H(t),q(e)},onFocus:()=>H(t),onKeyDown:t=>{t.key===`Enter`&&q(e,t)},children:[(0,A.jsx)(T,{"data-column-id":`product`,className:L(`product`),children:(0,A.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,A.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:e.productKey}),r?(0,A.jsx)(`span`,{"data-memory-targets":!0,title:e.targetReferences.join(`, `),className:`block truncate text-xs leading-snug text-muted-foreground`,children:r}):null]})}),(0,A.jsx)(T,{"data-column-id":`scope`,className:L(`scope`),children:(0,A.jsx)(`span`,{className:`whitespace-nowrap font-mono text-sm tabular-nums text-foreground`,children:i})}),(0,A.jsx)(T,{"data-column-id":`source`,className:L(`source`),children:(0,A.jsx)(`span`,{className:`whitespace-nowrap font-mono text-sm tabular-nums text-foreground`,children:a})}),(0,A.jsx)(T,{"data-column-id":`lastConfirmed`,className:L(`lastConfirmed`),children:e.freshness?(0,A.jsxs)(v,{children:[(0,A.jsx)(f,{asChild:!0,children:(0,A.jsx)(`span`,{className:`block truncate text-sm text-muted-foreground`,children:o(e.freshness)})}),(0,A.jsx)(u,{children:l(e.freshness)})]}):(0,A.jsx)(`span`,{className:`block truncate text-sm text-muted-foreground`,children:`No confirmations yet`})})]},e.productKey)}):(0,A.jsx)(w,{children:(0,A.jsx)(T,{colSpan:4,className:`h-24 text-center text-sm text-muted-foreground`,children:`No matching products.`})})})]})})]})})}function P({actions:e}){return(0,A.jsxs)(`header`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-3`,children:[(0,A.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Memory`}),e?(0,A.jsx)(`div`,{className:`shrink-0`,children:e}):null]}),(0,A.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:`Browse what the agent has learned for each product.`})]})}function F(){return(0,A.jsxs)(v,{children:[(0,A.jsx)(f,{asChild:!0,children:(0,A.jsx)(m,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,title:`Keyboard shortcuts`,children:(0,A.jsx)(n,{className:`h-4 w-4`})})}),(0,A.jsxs)(u,{side:`bottom`,className:`space-y-2 p-3`,children:[(0,A.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Keyboard shortcuts`}),(0,A.jsx)(t,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open memory`},{key:`⌘ / Ctrl+Enter`,label:`Open in new tab`}]})]})]})}function I(e){return h(`h-10 bg-background px-3 text-[13px] font-medium text-foreground/90`,e!==`product`&&`text-right`)}function L(e){return h(`py-2 align-top`,e===`product`&&`max-w-0 px-3`,(e===`scope`||e===`source`)&&`px-3 text-right`,e===`lastConfirmed`&&`max-w-0 px-3 text-right`)}function R(e){return h(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary/60`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function z(e){if(e.length===0)return null;let t=e.slice(0,j),n=e.length-t.length;return n<=0?t.join(`, `):`${t.join(`, `)}, +${n} more`}export{N as default};
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{n as t,r as n}from"./shortcut-hints-CtwepXR1.js";import{t as r}from"./use-page-title-B4YPyIzc.js";import{t as i}from"./scroll-area-BmkJ1y7Q.js";import{$n as a,Gt as o,Ht as s,J as c,Kt as l,Mt as u,Nt as d,Pt as f,Qn as p,Ut as m,Wt as h,a as g,cr as _,jt as v,pr as y,qn as b}from"./index-B4FdO6Vk.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./table-QG2rKYu8.js";import{t as D}from"./empty-state-BfgY0UGA.js";import{t as O}from"./use-keyboard-shortcuts-Bal_Cx9w.js";var k=e(y(),1),A=p(),j=3,M={scope:`9rem`,source:`8rem`,lastConfirmed:`9rem`};function N(){r(`Memory`);let e=_(),[t,n]=(0,k.useState)([]),[p,h]=(0,k.useState)(!0),[y,j]=(0,k.useState)(!1),[N,B]=(0,k.useState)(``),[V,H]=(0,k.useState)(-1),U=(0,k.useRef)([]),W=(0,k.useCallback)(()=>{let e=!1;return h(!0),j(!1),c().then(t=>{e||n(t.products)}).catch(()=>{e||(n([]),j(!0))}).finally(()=>{e||h(!1)}),()=>{e=!0}},[]);(0,k.useEffect)(()=>W(),[W]);let G=(0,k.useMemo)(()=>{let e=N.trim().toLowerCase();return e?t.filter(t=>t.productKey.toLowerCase().includes(e)):t},[t,N]),K=(0,k.useCallback)(e=>{B(e),H(-1)},[]),q=(0,k.useCallback)((t,n)=>{n&&n.preventDefault(),e(a.memoryProduct(t.productKey))},[e]);return O((0,k.useMemo)(()=>{let t=()=>H(e=>Math.min(e+1,G.length-1)),n=()=>H(e=>Math.max(e-1,0));return{j:t,arrowdown:t,k:n,arrowup:n,enter:t=>{if(V<0||!G[V])return;let n=G[V],r=a.memoryProduct(n.productKey);if(t.metaKey||t.ctrlKey){window.open(r,`_blank`);return}e(r)}}},[G,e,V])),(0,k.useEffect)(()=>{if(V<0)return;let e=U.current[V];e&&document.activeElement!==e&&e.focus()},[V,G.length]),p?(0,A.jsx)(g,{}):y?(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsx)(P,{}),(0,A.jsxs)(`div`,{className:`rounded-md border bg-card p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Couldn't load memory. Refresh the page. If it continues, verify the dashboard server can read the workspace memory directory.`}),(0,A.jsx)(m,{className:`mt-4`,variant:`outline`,onClick:W,children:`Refresh`})]})]}):t.length===0?(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsx)(P,{}),(0,A.jsx)(D,{icon:b,title:`No product memory yet`,description:`Run tests or suites with memory enabled to build memory for this workspace.`,actionLabel:`Open Runs`,onAction:()=>e(a.runs)})]}):(0,A.jsx)(d,{children:(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsx)(P,{actions:(0,A.jsx)(F,{})}),(0,A.jsx)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:(0,A.jsx)(s,{placeholder:`Search products`,value:N,onChange:e=>K(e.target.value),className:`max-w-[220px]`})}),(0,A.jsx)(i,{className:`rounded-md border`,children:(0,A.jsxs)(E,{className:`min-w-full table-fixed`,children:[(0,A.jsxs)(`colgroup`,{children:[(0,A.jsx)(`col`,{"data-column-id":`product`}),(0,A.jsx)(`col`,{"data-column-id":`scope`,style:{width:M.scope}}),(0,A.jsx)(`col`,{"data-column-id":`source`,style:{width:M.source}}),(0,A.jsx)(`col`,{"data-column-id":`lastConfirmed`,style:{width:M.lastConfirmed}})]}),(0,A.jsx)(x,{children:(0,A.jsxs)(w,{className:`hover:bg-transparent`,children:[(0,A.jsx)(S,{"data-column-id":`product`,className:I(`product`),children:`Product`}),(0,A.jsx)(S,{"data-column-id":`scope`,className:I(`scope`),children:`Product / Suite / Test`}),(0,A.jsx)(S,{"data-column-id":`source`,className:I(`source`),children:`Suite / Test`}),(0,A.jsx)(S,{"data-column-id":`lastConfirmed`,className:I(`lastConfirmed`),children:`Last confirmed`})]})}),(0,A.jsx)(C,{children:G.length>0?G.map((e,t)=>{let n=t===V,r=z(e.targetReferences),i=[e.scopeCounts.product,e.scopeCounts.suite,e.scopeCounts.test].join(` / `),a=[e.sourceCounts.suite,e.sourceCounts.test].join(` / `);return(0,A.jsxs)(w,{ref:e=>{U.current[t]=e},"data-memory-product":e.productKey,tabIndex:n?0:-1,"aria-selected":n,className:R(n),onClick:()=>{H(t),q(e)},onFocus:()=>H(t),onKeyDown:t=>{t.key===`Enter`&&q(e,t)},children:[(0,A.jsx)(T,{"data-column-id":`product`,className:L(`product`),children:(0,A.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,A.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:e.productKey}),r?(0,A.jsx)(`span`,{"data-memory-targets":!0,title:e.targetReferences.join(`, `),className:`block truncate text-xs leading-snug text-muted-foreground`,children:r}):null]})}),(0,A.jsx)(T,{"data-column-id":`scope`,className:L(`scope`),children:(0,A.jsx)(`span`,{className:`whitespace-nowrap font-mono text-sm tabular-nums text-foreground`,children:i})}),(0,A.jsx)(T,{"data-column-id":`source`,className:L(`source`),children:(0,A.jsx)(`span`,{className:`whitespace-nowrap font-mono text-sm tabular-nums text-foreground`,children:a})}),(0,A.jsx)(T,{"data-column-id":`lastConfirmed`,className:L(`lastConfirmed`),children:e.freshness?(0,A.jsxs)(v,{children:[(0,A.jsx)(f,{asChild:!0,children:(0,A.jsx)(`span`,{className:`block truncate text-sm text-muted-foreground`,children:o(e.freshness)})}),(0,A.jsx)(u,{children:l(e.freshness)})]}):(0,A.jsx)(`span`,{className:`block truncate text-sm text-muted-foreground`,children:`No confirmations yet`})})]},e.productKey)}):(0,A.jsx)(w,{children:(0,A.jsx)(T,{colSpan:4,className:`h-24 text-center text-sm text-muted-foreground`,children:`No matching products.`})})})]})})]})})}function P({actions:e}){return(0,A.jsxs)(`header`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-3`,children:[(0,A.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Memory`}),e?(0,A.jsx)(`div`,{className:`shrink-0`,children:e}):null]}),(0,A.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:`Browse what the agent has learned for each product.`})]})}function F(){return(0,A.jsxs)(v,{children:[(0,A.jsx)(f,{asChild:!0,children:(0,A.jsx)(m,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,title:`Keyboard shortcuts`,children:(0,A.jsx)(n,{className:`h-4 w-4`})})}),(0,A.jsxs)(u,{side:`bottom`,className:`space-y-2 p-3`,children:[(0,A.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Keyboard shortcuts`}),(0,A.jsx)(t,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open memory`},{key:`⌘ / Ctrl+Enter`,label:`Open in new tab`}]})]})]})}function I(e){return h(`h-10 bg-background px-3 text-[13px] font-medium text-foreground/90`,e!==`product`&&`text-right`)}function L(e){return h(`py-2 align-top`,e===`product`&&`max-w-0 px-3`,(e===`scope`||e===`source`)&&`px-3 text-right`,e===`lastConfirmed`&&`max-w-0 px-3 text-right`)}function R(e){return h(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary/60`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function z(e){if(e.length===0)return null;let t=e.slice(0,j),n=e.length-t.length;return n<=0?t.join(`, `):`${t.join(`, `)}, +${n} more`}export{N as default};
@@ -1,2 +1,2 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{i as t,n,o as r,s as i,t as a}from"./select-B2_tSMl_.js";import{t as o}from"./copy-BdD4bkD_.js";import{t as s}from"./observation-block-BRa3lkBV.js";import{n as c,r as l}from"./shortcut-hints-BnEYaq1r.js";import{t as u}from"./use-page-title-BeSr97vd.js";import{n as d,r as f,t as p}from"./popover-BAlAEoO4.js";import{$n as m,At as h,Ft as g,Mt as _,Nt as v,Pt as y,Qn as b,S as ee,Ut as x,Wn as S,Wt as C,Y as w,Yt as T,cr as E,jt as D,lr as O,pr as k,qn as A,sr as j}from"./index-CZotRLCc.js";import{t as M}from"./empty-state-c1UKljbh.js";import{t as te}from"./use-keyboard-shortcuts-BTppBDf3.js";var N=e(k(),1),P=b(),F={any:`Any (0.00 - 1.00)`,high:`High (0.75 - 1.00)`,medium:`Medium (0.50 - 0.74)`,low:`Low (0.00 - 0.49)`},I={last_confirmed:`Last confirmed`,updated:`Updated`,created:`Created`},L=[`all`,`7d`,`30d`,`90d`];function R({filters:e,onConfidenceChange:o,onDateBasisChange:s,onDateWindowChange:c,showHeading:l=!0}){return(0,P.jsxs)(`aside`,{"data-workspace-filter-rail":`true`,className:`space-y-4`,children:[l?(0,P.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.16em] text-muted-foreground`,children:`Filters`}):null,(0,P.jsxs)(`div`,{className:`space-y-5`,children:[(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Confidence`}),(0,P.jsxs)(a,{onValueChange:e=>o(e),children:[(0,P.jsx)(r,{className:`w-full justify-between bg-background/70`,children:(0,P.jsx)(i,{placeholder:F[e.confidence]})}),(0,P.jsxs)(n,{children:[(0,P.jsx)(t,{value:`any`,children:F.any}),(0,P.jsx)(t,{value:`high`,children:F.high}),(0,P.jsx)(t,{value:`medium`,children:F.medium}),(0,P.jsx)(t,{value:`low`,children:F.low})]})]})]}),(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Date`}),(0,P.jsxs)(a,{onValueChange:e=>s(e),children:[(0,P.jsx)(r,{className:`w-full justify-between bg-background/70`,children:(0,P.jsx)(i,{placeholder:I[e.dateBasis]})}),(0,P.jsxs)(n,{children:[(0,P.jsx)(t,{value:`last_confirmed`,children:`Last confirmed`}),(0,P.jsx)(t,{value:`updated`,children:`Updated`}),(0,P.jsx)(t,{value:`created`,children:`Created`})]})]}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:L.map(t=>(0,P.jsx)(x,{type:`button`,variant:e.dateWindow===t?`default`:`outline`,size:`xs`,"aria-pressed":e.dateWindow===t,onClick:()=>c(t),children:t===`all`?`All time`:t},t))})]})]})]})}function ne({onCopyPage:e,onShortcutsOpenChange:t,productKey:n,shortcutsOpen:r}){return(0,P.jsxs)(`div`,{"data-workspace-navbar":`true`,className:`flex h-14 min-w-0 shrink-0 items-center justify-between border-b bg-background px-4`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(j,{to:m.memory,className:`shrink-0 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:`Memory`}),(0,P.jsx)(S,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,P.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n})]}),(0,P.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,P.jsxs)(x,{"data-workspace-copy-button":`true`,type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 rounded-sm px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`,onClick:()=>{e()},children:[(0,P.jsx)(o,{className:`size-4`}),`Copy page`]}),(0,P.jsxs)(p,{open:r,onOpenChange:t,children:[(0,P.jsxs)(D,{children:[(0,P.jsx)(y,{asChild:!0,children:(0,P.jsx)(f,{asChild:!0,children:(0,P.jsx)(x,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,onClick:()=>t(!r),children:(0,P.jsx)(l,{className:`size-4`})})})}),(0,P.jsx)(_,{children:`Shortcuts`})]}),(0,P.jsx)(d,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h4`,{className:`mb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Navigation`}),(0,P.jsx)(c,{hints:[{key:`J / ↓`,label:`Next entry`},{key:`K / ↑`,label:`Previous entry`}]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h4`,{className:`mb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Actions`}),(0,P.jsx)(c,{hints:[{key:`C`,label:`Copy page`},{key:`Shift+?`,label:`Toggle shortcuts`},{key:`Esc`,label:`Close`}]})]})]})})]})]})]})}function z({activeAnchorId:e=null,document:t,onNavigate:n,showHeading:r=!0}){let i=(0,N.useRef)(null);return(0,N.useEffect)(()=>{i.current?.scrollIntoView({block:`nearest`,inline:`nearest`})},[e]),(0,P.jsxs)(`aside`,{"data-workspace-outline":`true`,className:`space-y-3`,children:[r?(0,P.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.16em] text-muted-foreground`,children:`On this page`}):null,(0,P.jsx)(`nav`,{"aria-label":`Page outline`,children:(0,P.jsx)(`ul`,{className:`space-y-1`,children:t.outline.map(t=>B(t,0,e,n,i))})})]})}function B(e,t,n,r,i){let a=n===e.anchorId;return(0,P.jsxs)(`li`,{className:`space-y-1`,children:[(0,P.jsx)(`button`,{type:`button`,ref:a?i:null,"data-workspace-outline-item":e.anchorId,"data-active":a?`true`:void 0,"aria-current":a?`location`:void 0,className:C(`block w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-accent hover:text-foreground`,t===0?`font-medium text-foreground`:`text-muted-foreground`,t===1?`pl-4`:``,t>=2?`pl-6 text-[13px]`:``,a?`bg-accent text-foreground`:``),onClick:()=>r(e.anchorId),children:e.title}),e.children.length>0?(0,P.jsx)(`ul`,{className:`space-y-1`,children:e.children.map(e=>B(e,t+1,n,r,i))}):null]},e.anchorId)}var V=[{id:`product`,title:`Product`},{id:`suite`,title:`Suite`},{id:`test`,title:`Test`}],H={confidence:`any`,dateBasis:`last_confirmed`,dateWindow:`all`};function U(e,t){let n=V.map(({id:n,title:r})=>({anchorId:`memory-section-${n}`,groups:K(n,e,t.filter(e=>e.scope===n)),id:n,title:r}));return{outline:q(n),productKey:e,sections:n}}function re(e,t,n){return e.filter(e=>ie(e,t.confidence)&&ae(e,t.dateBasis,t.dateWindow,n))}function W(e){return e.flatMap(e=>[e.anchorId,...W(e.children)])}function G(e,t=[]){let n=[`# Memory: ${e.productKey}`,``];t.length>0&&n.push(`> ${t.length} invalid memory file${t.length===1?``:`s`} hidden from this workspace.`,`> ${t.map(e=>e.filename).join(`, `)}`,``);for(let t of e.sections){if(n.push(`## ${t.title}`,``),t.id===`product`){for(let e of t.groups[0]?.observations??[])n.push(`### ${e.observation.title}`,``,e.observation.content,``);continue}for(let e of t.groups){e.title&&n.push(`### ${e.title}`,``);for(let t of e.observations)n.push(`#### ${t.observation.title}`,``,t.observation.content,``)}}return n.join(`
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{i as t,n,o as r,s as i,t as a}from"./select-D5oFJNaq.js";import{t as o}from"./copy-CEZJVgtu.js";import{t as s}from"./observation-block-DC5e2IE9.js";import{n as c,r as l}from"./shortcut-hints-CtwepXR1.js";import{t as u}from"./use-page-title-B4YPyIzc.js";import{n as d,r as f,t as p}from"./popover-DwYq4QYF.js";import{$n as m,At as h,Ft as g,Mt as _,Nt as v,Pt as y,Qn as b,S as ee,Ut as x,Wn as S,Wt as C,Y as w,Yt as T,cr as E,jt as D,lr as O,pr as k,qn as A,sr as j}from"./index-B4FdO6Vk.js";import{t as M}from"./empty-state-BfgY0UGA.js";import{t as te}from"./use-keyboard-shortcuts-Bal_Cx9w.js";var N=e(k(),1),P=b(),F={any:`Any (0.00 - 1.00)`,high:`High (0.75 - 1.00)`,medium:`Medium (0.50 - 0.74)`,low:`Low (0.00 - 0.49)`},I={last_confirmed:`Last confirmed`,updated:`Updated`,created:`Created`},L=[`all`,`7d`,`30d`,`90d`];function R({filters:e,onConfidenceChange:o,onDateBasisChange:s,onDateWindowChange:c,showHeading:l=!0}){return(0,P.jsxs)(`aside`,{"data-workspace-filter-rail":`true`,className:`space-y-4`,children:[l?(0,P.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.16em] text-muted-foreground`,children:`Filters`}):null,(0,P.jsxs)(`div`,{className:`space-y-5`,children:[(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Confidence`}),(0,P.jsxs)(a,{onValueChange:e=>o(e),children:[(0,P.jsx)(r,{className:`w-full justify-between bg-background/70`,children:(0,P.jsx)(i,{placeholder:F[e.confidence]})}),(0,P.jsxs)(n,{children:[(0,P.jsx)(t,{value:`any`,children:F.any}),(0,P.jsx)(t,{value:`high`,children:F.high}),(0,P.jsx)(t,{value:`medium`,children:F.medium}),(0,P.jsx)(t,{value:`low`,children:F.low})]})]})]}),(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Date`}),(0,P.jsxs)(a,{onValueChange:e=>s(e),children:[(0,P.jsx)(r,{className:`w-full justify-between bg-background/70`,children:(0,P.jsx)(i,{placeholder:I[e.dateBasis]})}),(0,P.jsxs)(n,{children:[(0,P.jsx)(t,{value:`last_confirmed`,children:`Last confirmed`}),(0,P.jsx)(t,{value:`updated`,children:`Updated`}),(0,P.jsx)(t,{value:`created`,children:`Created`})]})]}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:L.map(t=>(0,P.jsx)(x,{type:`button`,variant:e.dateWindow===t?`default`:`outline`,size:`xs`,"aria-pressed":e.dateWindow===t,onClick:()=>c(t),children:t===`all`?`All time`:t},t))})]})]})]})}function ne({onCopyPage:e,onShortcutsOpenChange:t,productKey:n,shortcutsOpen:r}){return(0,P.jsxs)(`div`,{"data-workspace-navbar":`true`,className:`flex h-14 min-w-0 shrink-0 items-center justify-between border-b bg-background px-4`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(j,{to:m.memory,className:`shrink-0 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:`Memory`}),(0,P.jsx)(S,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,P.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n})]}),(0,P.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,P.jsxs)(x,{"data-workspace-copy-button":`true`,type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 rounded-sm px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`,onClick:()=>{e()},children:[(0,P.jsx)(o,{className:`size-4`}),`Copy page`]}),(0,P.jsxs)(p,{open:r,onOpenChange:t,children:[(0,P.jsxs)(D,{children:[(0,P.jsx)(y,{asChild:!0,children:(0,P.jsx)(f,{asChild:!0,children:(0,P.jsx)(x,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,onClick:()=>t(!r),children:(0,P.jsx)(l,{className:`size-4`})})})}),(0,P.jsx)(_,{children:`Shortcuts`})]}),(0,P.jsx)(d,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h4`,{className:`mb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Navigation`}),(0,P.jsx)(c,{hints:[{key:`J / ↓`,label:`Next entry`},{key:`K / ↑`,label:`Previous entry`}]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h4`,{className:`mb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Actions`}),(0,P.jsx)(c,{hints:[{key:`C`,label:`Copy page`},{key:`Shift+?`,label:`Toggle shortcuts`},{key:`Esc`,label:`Close`}]})]})]})})]})]})]})}function z({activeAnchorId:e=null,document:t,onNavigate:n,showHeading:r=!0}){let i=(0,N.useRef)(null);return(0,N.useEffect)(()=>{i.current?.scrollIntoView({block:`nearest`,inline:`nearest`})},[e]),(0,P.jsxs)(`aside`,{"data-workspace-outline":`true`,className:`space-y-3`,children:[r?(0,P.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.16em] text-muted-foreground`,children:`On this page`}):null,(0,P.jsx)(`nav`,{"aria-label":`Page outline`,children:(0,P.jsx)(`ul`,{className:`space-y-1`,children:t.outline.map(t=>B(t,0,e,n,i))})})]})}function B(e,t,n,r,i){let a=n===e.anchorId;return(0,P.jsxs)(`li`,{className:`space-y-1`,children:[(0,P.jsx)(`button`,{type:`button`,ref:a?i:null,"data-workspace-outline-item":e.anchorId,"data-active":a?`true`:void 0,"aria-current":a?`location`:void 0,className:C(`block w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-accent hover:text-foreground`,t===0?`font-medium text-foreground`:`text-muted-foreground`,t===1?`pl-4`:``,t>=2?`pl-6 text-[13px]`:``,a?`bg-accent text-foreground`:``),onClick:()=>r(e.anchorId),children:e.title}),e.children.length>0?(0,P.jsx)(`ul`,{className:`space-y-1`,children:e.children.map(e=>B(e,t+1,n,r,i))}):null]},e.anchorId)}var V=[{id:`product`,title:`Product`},{id:`suite`,title:`Suite`},{id:`test`,title:`Test`}],H={confidence:`any`,dateBasis:`last_confirmed`,dateWindow:`all`};function U(e,t){let n=V.map(({id:n,title:r})=>({anchorId:`memory-section-${n}`,groups:K(n,e,t.filter(e=>e.scope===n)),id:n,title:r}));return{outline:q(n),productKey:e,sections:n}}function re(e,t,n){return e.filter(e=>ie(e,t.confidence)&&ae(e,t.dateBasis,t.dateWindow,n))}function W(e){return e.flatMap(e=>[e.anchorId,...W(e.children)])}function G(e,t=[]){let n=[`# Memory: ${e.productKey}`,``];t.length>0&&n.push(`> ${t.length} invalid memory file${t.length===1?``:`s`} hidden from this workspace.`,`> ${t.map(e=>e.filename).join(`, `)}`,``);for(let t of e.sections){if(n.push(`## ${t.title}`,``),t.id===`product`){for(let e of t.groups[0]?.observations??[])n.push(`### ${e.observation.title}`,``,e.observation.content,``);continue}for(let e of t.groups){e.title&&n.push(`### ${e.title}`,``);for(let t of e.observations)n.push(`#### ${t.observation.title}`,``,t.observation.content,``)}}return n.join(`
2
2
  `).trim()}function K(e,t,n){let r=[...n].sort(Y);if(e===`product`)return r.length>0?[{anchorId:`memory-group-product-${Q(t)}`,id:t,title:null,observations:r.map(Z)}]:[];let i=new Map;for(let e of r){let t=e.scopeRef?.id??e.scopeId,n=i.get(t);if(n){n.observations.push(e);continue}i.set(t,{title:e.scopeRef?.label??e.scopeId,observations:[e]})}return[...i.entries()].map(([t,n])=>({anchorId:`memory-group-${e}-${Q(t)}`,id:t,title:n.title,observations:n.observations.sort(Y).map(Z)})).sort(J)}function q(e){return e.map(e=>({anchorId:e.anchorId,children:e.id===`product`?(e.groups[0]?.observations??[]).map(e=>({anchorId:e.anchorId,children:[],id:e.observation.id,title:e.observation.title})):e.groups.map(t=>({anchorId:t.anchorId,children:t.observations.map(e=>({anchorId:e.anchorId,children:[],id:e.observation.id,title:e.observation.title})),id:t.id,title:t.title??e.title})),id:e.id,title:e.title}))}function J(e,t){let n=e.observations[0]?.observation,r=t.observations[0]?.observation;if(n&&r){let e=Y(n,r);if(e!==0)return e}return(e.title??``).localeCompare(t.title??``)}function Y(e,t){return X(e.last_confirmed,t.last_confirmed)||X(e.updated,t.updated)||e.title.localeCompare(t.title)}function X(e,t){return t.localeCompare(e)}function ie(e,t){switch(t){case`any`:return!0;case`high`:return e.trust>=.75;case`medium`:return e.trust>=.5&&e.trust<.75;case`low`:return e.trust<.5}}function ae(e,t,n,r){if(n===`all`)return!0;let i=e[t],a=new Date(i).getTime();if(Number.isNaN(a))return!1;let o=new Date(r),s=oe(n);return o.setDate(o.getDate()-s),a>=o.getTime()}function oe(e){switch(e){case`7d`:return 7;case`30d`:return 30;case`90d`:return 90}}function Z(e){return{anchorId:`memory-observation-${Q(e.id)}`,id:e.id,observation:e}}function Q(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function se(){let{product:e}=O();u(e?`Memory · ${e}`:`Memory`);let t=E(),[n,r]=(0,N.useState)(null),[i,a]=(0,N.useState)(!0),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(!1),[d,f]=(0,N.useState)(H),[p,_]=(0,N.useState)(null),[y,b]=(0,N.useState)(!1),x=T(),S=(0,N.useCallback)(()=>{if(!e)return a(!1),s(!0),()=>{};let t=!1;return a(!0),l(!1),s(!1),w(e).then(e=>{t||r(e.product)}).catch(e=>{if(!t){if(r(null),e instanceof ee&&e.status===404){s(!0);return}l(!0)}}).finally(()=>{t||a(!1)}),()=>{t=!0}},[e]);(0,N.useEffect)(()=>S(),[S]),(0,N.useEffect)(()=>{f(H)},[e]),(0,N.useEffect)(()=>{b(!1)},[e]);let C=(0,N.useMemo)(()=>new Date,[e]),D=(0,N.useMemo)(()=>n?U(n.productKey,n.observations):null,[n]),k=(0,N.useMemo)(()=>n?re(n.observations,d,C):[],[n,d,C]),j=(0,N.useMemo)(()=>n?U(n.productKey,k):null,[n,k]),F=(0,N.useMemo)(()=>D&&n?G(D,n.invalidFiles):null,[n,D]),I=(0,N.useMemo)(()=>j?W(j.outline):[],[j]);(0,N.useEffect)(()=>{if(!j){_(null);return}let e=W(j.outline);if(_(t=>t&&e.includes(t)?t:e[0]??null),typeof IntersectionObserver>`u`)return;let t=new Map(e.map((e,t)=>[e,t])),n=new IntersectionObserver(e=>{let n=e.filter(e=>e.isIntersecting).sort((e,n)=>{let r=n.intersectionRatio-e.intersectionRatio;return r===0?(t.get(e.target.id)??2**53-1)-(t.get(n.target.id)??2**53-1):r})[0];n&&_(n.target.id)},{rootMargin:`-72px 0px -55% 0px`,threshold:[.2,.6,1]});for(let t of e){let e=document.getElementById(t);e&&n.observe(e)}return()=>n.disconnect()},[j]);let L=(0,N.useCallback)(e=>{_(e),document.getElementById(e)?.scrollIntoView({block:`start`})},[]),B=(0,N.useCallback)(async()=>{if(F)try{await navigator.clipboard.writeText(F),h.success(`Copied page as Markdown`)}catch{h.error(`Couldn't copy page`)}},[F]),V=(0,N.useCallback)(e=>{if(I.length===0)return;let t=p?I.indexOf(p):-1,n=I[t<0?0:Math.min(I.length-1,Math.max(0,t+e))];n&&L(n)},[p,L,I]),K=(0,N.useCallback)(e=>{f(t=>({...t,confidence:e}))},[]),q=(0,N.useCallback)(e=>{f(t=>({...t,dateBasis:e}))},[]),J=(0,N.useCallback)(e=>{f(t=>({...t,dateWindow:e}))},[]);return te((0,N.useMemo)(()=>({j:()=>V(1),arrowdown:()=>V(1),k:()=>V(-1),arrowup:()=>V(-1),c:()=>{B()},"shift+?":()=>b(e=>!e),escape:()=>b(!1)}),[B,V])),i?(0,P.jsxs)(`div`,{className:`space-y-4`,children:[(0,P.jsxs)(`div`,{className:`space-y-3`,children:[(0,P.jsx)(g,{className:`h-8 w-32`}),(0,P.jsx)(g,{className:`h-9 w-72 max-w-full`}),(0,P.jsx)(g,{className:`h-4 w-64 max-w-full`})]}),(0,P.jsx)(g,{className:`h-28 w-full rounded-md`}),(0,P.jsx)(g,{className:`h-56 w-full rounded-md`})]}):o?(0,P.jsx)(M,{icon:A,title:`Memory not found for this product`,description:`This product doesn't currently have cataloged memory in this workspace, or the product key changed.`,actionLabel:`Back to Memory`,onAction:()=>t(m.memory)}):c||!n?(0,P.jsx)(`div`,{className:`rounded-md border bg-card p-4`,children:(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Couldn't load this memory workspace. Refresh the page. If it continues, verify the dashboard server can read the workspace memory directory.`})}):(0,P.jsx)(v,{children:(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,P.jsx)(ne,{onCopyPage:B,onShortcutsOpenChange:b,productKey:n.productKey,shortcutsOpen:y}),x?(0,P.jsx)(`div`,{className:`workspace-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-3 py-3`,children:(0,P.jsx)(ce,{activeAnchorId:p,detail:n,document:j,filters:d,onConfidenceChange:K,onDateBasisChange:q,onDateWindowChange:J,onNavigate:L})}):(0,P.jsxs)(`div`,{"data-workspace-shell":`true`,className:`grid min-h-0 flex-1 grid-cols-[15rem_minmax(0,1fr)_14rem] overflow-hidden`,children:[(0,P.jsx)(`aside`,{className:`workspace-scrollbar min-h-0 overflow-y-auto overscroll-y-contain border-r border-border bg-background`,children:(0,P.jsx)(`div`,{className:`min-h-full px-3 py-3`,children:j?(0,P.jsx)(z,{activeAnchorId:p,document:j,onNavigate:L}):null})}),(0,P.jsx)(`div`,{className:`workspace-scrollbar min-h-0 min-w-0 overflow-y-auto overscroll-y-contain bg-muted/[0.04]`,children:(0,P.jsx)($,{detail:n,document:j})}),(0,P.jsx)(`aside`,{className:`workspace-scrollbar min-h-0 overflow-y-auto overscroll-y-contain border-l border-border bg-background`,children:(0,P.jsx)(`div`,{className:`min-h-full px-3 py-3`,children:(0,P.jsx)(R,{filters:d,onConfidenceChange:K,onDateBasisChange:q,onDateWindowChange:J})})})]})]})})}function ce({activeAnchorId:e,detail:t,document:n,filters:r,onConfidenceChange:i,onDateBasisChange:a,onDateWindowChange:o,onNavigate:s}){return(0,P.jsxs)(`div`,{className:`space-y-4`,children:[n?(0,P.jsxs)(`details`,{className:`border bg-card px-3 py-2.5`,children:[(0,P.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-foreground`,children:`On this page`}),(0,P.jsx)(`div`,{className:`mt-3`,children:(0,P.jsx)(z,{activeAnchorId:e,document:n,onNavigate:s,showHeading:!1})})]}):null,(0,P.jsxs)(`details`,{className:`border bg-card px-3 py-2.5`,children:[(0,P.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-foreground`,children:`Filters`}),(0,P.jsx)(`div`,{className:`mt-3`,children:(0,P.jsx)(R,{filters:r,onConfidenceChange:i,onDateBasisChange:a,onDateWindowChange:o,showHeading:!1})})]}),(0,P.jsx)($,{detail:t,document:n})]})}function $({detail:e,document:t}){return(0,P.jsx)(`div`,{"data-workspace-reader-page":`true`,className:`min-h-full w-full bg-card/55`,children:(0,P.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[e.invalidFiles.length>0?(0,P.jsxs)(`div`,{className:`mb-4 border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-amber-950 dark:text-amber-200`,children:[(0,P.jsxs)(`p`,{className:`font-medium`,children:[e.invalidFiles.length,` invalid memory file`,e.invalidFiles.length===1?``:`s`,` hidden from this workspace.`]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-amber-900/80 dark:text-amber-200/80`,children:e.invalidFiles.map(e=>e.filename).join(`, `)})]}):null,e.observations.length===0?(0,P.jsx)(M,{icon:A,title:`No memory in this product yet`,description:`This product doesn't have cataloged observations in this workspace yet. Run tests or suites with memory enabled, then reopen this workspace.`}):t&&le(t)?(0,P.jsx)(`article`,{className:`w-full space-y-10`,children:t.sections.map(e=>(0,P.jsxs)(`section`,{id:e.anchorId,"data-workspace-section":e.id,className:`scroll-mt-20 space-y-5`,children:[(0,P.jsx)(`header`,{className:`border-b pb-3`,children:(0,P.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight text-foreground`,children:e.title})}),e.groups.length>0?(0,P.jsx)(`div`,{className:`space-y-8`,children:e.groups.map(e=>(0,P.jsxs)(`div`,{className:`space-y-5`,children:[(0,P.jsx)(`div`,{id:e.anchorId,className:`scroll-mt-20`,children:e.title?(0,P.jsx)(`h3`,{className:`text-base font-medium tracking-tight text-foreground`,children:e.title}):(0,P.jsx)(`span`,{className:`sr-only`,children:`Product observations`})}),(0,P.jsx)(`div`,{className:`space-y-8`,children:e.observations.map(e=>(0,P.jsx)(`div`,{id:e.anchorId,className:`scroll-mt-24`,children:(0,P.jsx)(s,{observation:e.observation,query:``})},e.observation.id))})]},e.anchorId))}):(0,P.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No `,e.title.toLowerCase(),` observations in this workspace yet.`]})]},e.id))}):(0,P.jsx)(M,{icon:A,title:`No observations match these filters`,description:`Clear one or more filters to return to the full document.`})]})})}function le(e){return e.sections.some(e=>e.groups.some(e=>e.observations.length>0))}export{se as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-editor-inner-CeD8qR_F.js","assets/chunk-CilyBKbf.js","assets/index-CZotRLCc.js","assets/index-cLLRFOsN.css","assets/editor.api2-DEGvZ9jW.js","assets/editor-Br_kD0ds.css","assets/workers-BbHjH3Kx.js","assets/monaco.contribution-ZpEX2Im1.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./chunk-CilyBKbf.js";import{Jn as t,Qn as n,Wt as r,dr as i,pr as a}from"./index-CZotRLCc.js";var o=t(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),s=t(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),c=e(a(),1),l=n(),u=(0,c.lazy)(()=>i(()=>import(`./monaco-editor-inner-CeD8qR_F.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])));function d({className:e}){return(0,l.jsx)(`div`,{className:r(`flex items-center justify-center bg-background border border-border rounded-md`,e),children:(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Loading editor...`})})}function f(e){return(0,l.jsx)(c.Suspense,{fallback:(0,l.jsx)(d,{className:e.className}),children:(0,l.jsx)(u,{...e})})}export{s as n,o as r,f as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-editor-inner-I81tD0qz.js","assets/chunk-CilyBKbf.js","assets/index-B4FdO6Vk.js","assets/index-DzWZqTlZ.css","assets/editor.api2-DEGvZ9jW.js","assets/editor-Br_kD0ds.css","assets/workers-BbHjH3Kx.js","assets/monaco.contribution-CEeipeu9.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./chunk-CilyBKbf.js";import{Jn as t,Qn as n,Wt as r,dr as i,pr as a}from"./index-B4FdO6Vk.js";var o=t(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),s=t(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),c=e(a(),1),l=n(),u=(0,c.lazy)(()=>i(()=>import(`./monaco-editor-inner-I81tD0qz.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])));function d({className:e}){return(0,l.jsx)(`div`,{className:r(`flex items-center justify-center bg-background border border-border rounded-md`,e),children:(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Loading editor...`})})}function f(e){return(0,l.jsx)(c.Suspense,{fallback:(0,l.jsx)(d,{className:e.className}),children:(0,l.jsx)(u,{...e})})}export{s as n,o as r,f as t};