sanoma 0.11.25 → 0.11.26

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 (86) hide show
  1. package/app/dist/client/assets/{_id-DlmbMke7.js → _id-COueWOzP.js} +1 -1
  2. package/app/dist/client/assets/{_id-CVGM4Xlz.js → _id-CgSZkWFR.js} +1 -1
  3. package/app/dist/client/assets/{_id-BPCwPSnZ.js → _id-D3BoRB48.js} +1 -1
  4. package/app/dist/client/assets/{_id-CqRlgPJ1.js → _id-DDD_ITXx.js} +1 -1
  5. package/app/dist/client/assets/{_id-BEXVX1yS.js → _id-Doju8qUR.js} +1 -1
  6. package/app/dist/client/assets/{_name-CbkToEsW.js → _name-7EgMexzO.js} +1 -1
  7. package/app/dist/client/assets/{_name-DgHTis3y.js → _name-C3TWd0NA.js} +1 -1
  8. package/app/dist/client/assets/{_name-CPJtbMby.js → _name-CR3Qqon_.js} +1 -1
  9. package/app/dist/client/assets/{_name-0rz5ub2Q.js → _name-DbfrpSJT.js} +1 -1
  10. package/app/dist/client/assets/{_vendor-CoKl4mw3.js → _vendor-B9Oh8xNB.js} +1 -1
  11. package/app/dist/client/assets/{_vendor-Se8sS6w0.js → _vendor-bEmTq5QU.js} +1 -1
  12. package/app/dist/client/assets/{app-chrome-C1ohNHid.js → app-chrome-CzcZez2G.js} +4 -4
  13. package/app/dist/client/assets/{approval-BjpDgpK_.js → approval-CcJFVQB7.js} +1 -1
  14. package/app/dist/client/assets/{apps-CeKUqwRD.js → apps-BwmXpIZ7.js} +1 -1
  15. package/app/dist/client/assets/{changes-C6L4olgQ.js → changes-B3Z_0p4M.js} +1 -1
  16. package/app/dist/client/assets/{connect-DKoB6Rh8.js → connect-CC1Se3F9.js} +1 -1
  17. package/app/dist/client/assets/{connect-agent-CR6dp2y6.js → connect-agent-B1UifylG.js} +1 -1
  18. package/app/dist/client/assets/{connections-Bdyi6W2K.js → connections-OO1NDgc1.js} +1 -1
  19. package/app/dist/client/assets/{connectors-B8x4YxH-.js → connectors-mnoegKZk.js} +1 -1
  20. package/app/dist/client/assets/{credentials-CUaEA2fA.js → credentials-C-kN42O9.js} +1 -1
  21. package/app/dist/client/assets/{data-Bny-ZVRR.js → data-Dlx7LdSP.js} +1 -1
  22. package/app/dist/client/assets/{declaration-form-CwPHdrw2.js → declaration-form-DHOktMul.js} +1 -1
  23. package/app/dist/client/assets/{existing-DX-XGhqd.js → existing-BJJGu3LZ.js} +1 -1
  24. package/app/dist/client/assets/{fence-DpwIpsjJ.js → fence-Cjuv7UnK.js} +1 -1
  25. package/app/dist/client/assets/{held-card-DYxBZDQ2.js → held-card-BnSjtbEo.js} +1 -1
  26. package/app/dist/client/assets/{highlighted-body-JLMTFACH-DtqFbdE8.js → highlighted-body-JLMTFACH-W_A7gIsD.js} +1 -1
  27. package/app/dist/client/assets/{hosting-D9SnD4yE.js → hosting-C1TopaP_.js} +1 -1
  28. package/app/dist/client/assets/{import-BpO-HXzL.js → import-Bu6yGCcD.js} +1 -1
  29. package/app/dist/client/assets/{inbox-DbLdpphP.js → inbox-DXzDv0eC.js} +1 -1
  30. package/app/dist/client/assets/{inbox-CQOl57so.js → inbox-Dto80Qqh.js} +1 -1
  31. package/app/dist/client/assets/{index-BkjZ82BQ.js → index-bWqaZ5SR.js} +2 -2
  32. package/app/dist/client/assets/{markdown-DKae_pfo.js → markdown-CBEdAnWH.js} +5 -5
  33. package/app/dist/client/assets/mermaid-WFAXDIZX-COpX35v0.js +1 -0
  34. package/app/dist/client/assets/{operations._name-BNGOEH-O.js → operations._name-BsZkO0sP.js} +1 -1
  35. package/app/dist/client/assets/{operations._name-rNkLP6We.js → operations._name-CKXoxg5Q.js} +1 -1
  36. package/app/dist/client/assets/{people-Cv-UlmJ1.js → people-B8-WHpbD.js} +1 -1
  37. package/app/dist/client/assets/{permissions-BzOgIZ7u.js → permissions-Ajcu9fkv.js} +1 -1
  38. package/app/dist/client/assets/{route-BskxNAwB.js → route-BTO8mZ6d.js} +1 -1
  39. package/app/dist/client/assets/{route-CRq0fSc-.js → route-D4TNDOXy.js} +1 -1
  40. package/app/dist/client/assets/{routes-DqP9msnB.js → routes-BcuQlVc8.js} +1 -1
  41. package/app/dist/client/assets/{start-form-BpIrXpIj.js → start-form-B4lodl8U.js} +1 -1
  42. package/app/dist/client/assets/{who-are-you-C3g1odDB.js → who-are-you-ByL2bQ_I.js} +1 -1
  43. package/app/dist/client/assets/{workflow-view-BhFMDJaB.js → workflow-view-_uuHOg0C.js} +1 -1
  44. package/app/dist/client/assets/{workflows-BbONkSLX.js → workflows-Dll7wi8z.js} +1 -1
  45. package/app/dist/server/assets/{_id-CAuqLb6v.js → _id-B9aCLkow.js} +1 -1
  46. package/app/dist/server/assets/{_id-CpBnx3jW.js → _id-BWH3uVGy.js} +1 -1
  47. package/app/dist/server/assets/{_id-DEBt7LRr.js → _id-Co12FiVj.js} +1 -1
  48. package/app/dist/server/assets/{_id-CNJlGJCQ.js → _id-Lo8RtD8f.js} +1 -1
  49. package/app/dist/server/assets/{_id-s-_zOGcg.js → _id-SV_go0FE.js} +1 -1
  50. package/app/dist/server/assets/{_name-DCgwL6BR.js → _name-48nnwErV.js} +1 -1
  51. package/app/dist/server/assets/{_name-WDROmuMl.js → _name-BSxshpQ5.js} +1 -1
  52. package/app/dist/server/assets/{_name-BcI9Gice.js → _name-C1YpYrTx.js} +1 -1
  53. package/app/dist/server/assets/{_name-CiE1PGmR.js → _name-CDSGDekt.js} +1 -1
  54. package/app/dist/server/assets/{_tanstack-start-manifest_v-5_9vW9zG.js → _tanstack-start-manifest_v-Cgg94-dq.js} +48 -48
  55. package/app/dist/server/assets/{_vendor-DqlHyGJR.js → _vendor-B15N7FgV.js} +1 -1
  56. package/app/dist/server/assets/{_vendor-DYLR6vJC.js → _vendor-CJlB6wAc.js} +1 -1
  57. package/app/dist/server/assets/{app-chrome-BVhkVW1G.js → app-chrome-CRK9r62z.js} +5 -5
  58. package/app/dist/server/assets/{changes-CCoYosOZ.js → changes-BjBLZsCp.js} +1 -1
  59. package/app/dist/server/assets/{connect-Bc7r_s62.js → connect-DkdRG_rZ.js} +1 -1
  60. package/app/dist/server/assets/{connect-agent-B7cH_CoO.js → connect-agent-DTE0sr-8.js} +1 -1
  61. package/app/dist/server/assets/{connectors-XHbCVtS2.js → connectors-aP9CdAh4.js} +1 -1
  62. package/app/dist/server/assets/{data-BTIoZdcw.js → data-D-aNBh4S.js} +1 -1
  63. package/app/dist/server/assets/{fence-DaknxkSI.js → fence-DaS6DvOb.js} +1 -1
  64. package/app/dist/server/assets/{hosting-BKCsLWxo.js → hosting-CkeOmCpy.js} +2 -2
  65. package/app/dist/server/assets/{import-Cj76S4zt.js → import-DA8iyU2_.js} +1 -1
  66. package/app/dist/server/assets/{inbox-nK7fBtOF.js → inbox-Utyss_FI.js} +1 -1
  67. package/app/dist/server/assets/{markdown-BysXq7nb.js → markdown-DiIT1Tr8.js} +2 -2
  68. package/app/dist/server/assets/{operations._name-BBReq2oS.js → operations._name-C4hDrT32.js} +1 -1
  69. package/app/dist/server/assets/{operations._name-Ctdq6L1v.js → operations._name-Dctg1NZR.js} +1 -1
  70. package/app/dist/server/assets/{people-BnyWPIpn.js → people-DFg8O6sq.js} +1 -1
  71. package/app/dist/server/assets/{permissions-CLy25AEe.js → permissions-DdsEx9aC.js} +1 -1
  72. package/app/dist/server/assets/{route-BlXP21pk.js → route-C2OOhovr.js} +1 -1
  73. package/app/dist/server/assets/{route-AGuUCm56.js → route-DH8uaU9_.js} +1 -1
  74. package/app/dist/server/assets/{router-Clsv9yeE.js → router-DhV2uomr.js} +26 -26
  75. package/app/dist/server/assets/{who-are-you-CBGu7guy.js → who-are-you-Cqe3JRrW.js} +1 -1
  76. package/app/dist/server/assets/{workflows-UNvVgBrS.js → workflows-_5EHAk5E.js} +1 -1
  77. package/app/dist/server/server.js +2 -2
  78. package/oxlint.json +9 -0
  79. package/package.json +2 -1
  80. package/workflows/dist/scenario.js +7 -1
  81. package/workflows/dist/scenario.js.map +1 -1
  82. package/workflows/dist/steps.d.ts +9 -0
  83. package/workflows/dist/steps.js.map +1 -1
  84. package/workflows/src/scenario.ts +6 -1
  85. package/workflows/src/steps.ts +6 -1
  86. package/app/dist/client/assets/mermaid-WFAXDIZX-BunRuvMz.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./engine-CBuzy-Ik.js";import{s as t}from"./kit-BNTzGjDn.js";import{d as n}from"./index-BkjZ82BQ.js";var r=e(),i=()=>(0,r.jsxs)(t,{variant:`destructive`,children:[`No run `,n.useParams().id,`.`]});export{i as notFoundComponent};
1
+ import{r as e}from"./engine-CBuzy-Ik.js";import{s as t}from"./kit-BNTzGjDn.js";import{d as n}from"./index-bWqaZ5SR.js";var r=e(),i=()=>(0,r.jsxs)(t,{variant:`destructive`,children:[`No run `,n.useParams().id,`.`]});export{i as notFoundComponent};
@@ -1 +1 @@
1
- import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{Fi as r,Kr as i,Zn as a,dt as o,kt as s,pn as c}from"./queries-BTgXQRLH.js";import{M as l,s as u}from"./common-WJKVhtNw.js";import{h as d,m as f,s as p,t as m,z as h}from"./kit-BNTzGjDn.js";import{t as g}from"./Play.es-DGJ1CGhp.js";import{m as _,t as v}from"./index-BkjZ82BQ.js";import{t as y}from"./workflow-view-BhFMDJaB.js";var b=n(e()),x=t();function S(){let{id:e}=v.useParams(),{data:t,error:n,dataUpdatedAt:S}=c(o(e)),{run:C,ledger:w}=t,T=s(C.workflow),E=w.at(-1),D=E?.type===`sleep.started`&&E.until<=S?E.until:0,O=(0,b.useMemo)(()=>({...t,at:D}),[t,D]),k=C.workflow===`change`?i(C.runId):void 0;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(u,{action:k===void 0?T&&!T.internal&&(0,x.jsx)(m,{size:`sm`,children:(0,x.jsxs)(r,{to:`/workflows/$name`,params:{name:C.workflow},search:{new:!0},children:[(0,x.jsx)(g,{"aria-hidden":`true`,"data-icon":`inline-start`}),`New run`]})}):(0,x.jsx)(m,{size:`sm`,children:(0,x.jsx)(r,{to:`/changes/$id`,params:{id:k},children:`Review`})}),children:[(0,x.jsx)(f,{id:`run-status`,dot:!0,tone:h[C.status],children:C.status}),C.sandbox!==void 0&&(0,x.jsx)(l,{name:C.sandbox}),(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[a(C),` · `,(0,x.jsx)(d,{at:C.createdAt})]})]}),n&&(0,x.jsxs)(p,{variant:`destructive`,children:[`Could not refresh: `,n.message]}),(0,x.jsx)(_,{workflow:C.workflow,status:C.status,ahead:t.ahead}),(0,x.jsx)(y,{name:C.workflow,workflow:T,run:O},C.runId)]})}export{S as component};
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{Fi as r,Kr as i,Zn as a,dt as o,kt as s,pn as c}from"./queries-BTgXQRLH.js";import{M as l,s as u}from"./common-WJKVhtNw.js";import{h as d,m as f,s as p,t as m,z as h}from"./kit-BNTzGjDn.js";import{t as g}from"./Play.es-DGJ1CGhp.js";import{m as _,t as v}from"./index-bWqaZ5SR.js";import{t as y}from"./workflow-view-_uuHOg0C.js";var b=n(e()),x=t();function S(){let{id:e}=v.useParams(),{data:t,error:n,dataUpdatedAt:S}=c(o(e)),{run:C,ledger:w}=t,T=s(C.workflow),E=w.at(-1),D=E?.type===`sleep.started`&&E.until<=S?E.until:0,O=(0,b.useMemo)(()=>({...t,at:D}),[t,D]),k=C.workflow===`change`?i(C.runId):void 0;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(u,{action:k===void 0?T&&!T.internal&&(0,x.jsx)(m,{size:`sm`,children:(0,x.jsxs)(r,{to:`/workflows/$name`,params:{name:C.workflow},search:{new:!0},children:[(0,x.jsx)(g,{"aria-hidden":`true`,"data-icon":`inline-start`}),`New run`]})}):(0,x.jsx)(m,{size:`sm`,children:(0,x.jsx)(r,{to:`/changes/$id`,params:{id:k},children:`Review`})}),children:[(0,x.jsx)(f,{id:`run-status`,dot:!0,tone:h[C.status],children:C.status}),C.sandbox!==void 0&&(0,x.jsx)(l,{name:C.sandbox}),(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[a(C),` · `,(0,x.jsx)(d,{at:C.createdAt})]})]}),n&&(0,x.jsxs)(p,{variant:`destructive`,children:[`Could not refresh: `,n.message]}),(0,x.jsx)(_,{workflow:C.workflow,status:C.status,ahead:t.ahead}),(0,x.jsx)(y,{name:C.workflow,workflow:T,run:O},C.runId)]})}export{S as component};
@@ -1 +1 @@
1
- import{r as e}from"./engine-CBuzy-Ik.js";import{s as t}from"./kit-BNTzGjDn.js";import{t as n}from"./index-BkjZ82BQ.js";var r=e(),i=()=>(0,r.jsxs)(t,{variant:`destructive`,children:[`No run `,n.useParams().id,`.`]});export{i as notFoundComponent};
1
+ import{r as e}from"./engine-CBuzy-Ik.js";import{s as t}from"./kit-BNTzGjDn.js";import{t as n}from"./index-bWqaZ5SR.js";var r=e(),i=()=>(0,r.jsxs)(t,{variant:`destructive`,children:[`No run `,n.useParams().id,`.`]});export{i as notFoundComponent};
@@ -1 +1 @@
1
- import{r as e}from"./engine-CBuzy-Ik.js";import{s as t}from"./kit-BNTzGjDn.js";import{U as n}from"./index-BkjZ82BQ.js";var r=e(),i=()=>(0,r.jsxs)(t,{variant:`destructive`,children:[`No change `,n.useParams().id,`.`]});export{i as notFoundComponent};
1
+ import{r as e}from"./engine-CBuzy-Ik.js";import{s as t}from"./kit-BNTzGjDn.js";import{U as n}from"./index-bWqaZ5SR.js";var r=e(),i=()=>(0,r.jsxs)(t,{variant:`destructive`,children:[`No change `,n.useParams().id,`.`]});export{i as notFoundComponent};
@@ -1 +1 @@
1
- import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{Er as r,Et as i,Fi as a,Lt as o,M as s,S as c,Xn as l,Zn as u,hr as d,k as f,nt as p,pn as m,ut as h,ya as g}from"./queries-BTgXQRLH.js";import{N as _,g as v,o as y,p as b,s as x}from"./common-WJKVhtNw.js";import{H as S,K as C,L as w,P as ee,W as te,a as ne,h as T,i as E,l as D,m as O,n as k,q as A,r as j,s as M}from"./kit-BNTzGjDn.js";import{t as N}from"./button-D5kdANef.js";import{n as P,t as F}from"./utils-BRvE9-Fo.js";import{U as I}from"./index-BkjZ82BQ.js";import{a as L,i as R,o as z,r as B,s as V,t as H}from"./changes-CihK9Huo.js";import{a as U,n as W,o as re,r as G,s as K,t as q}from"./grid-diff-pzwWoTh4.js";import{n as J}from"./change-glance-BYVLeDLI.js";import{r as Y,t as X}from"./approval-BjpDgpK_.js";import{n as ie,t as ae}from"./review-C5Wt_3Az.js";import{n as oe}from"./permissions-grid-0-cx77oT.js";var Z=t();function se({change:e,verbs:t=Y}){let{state:n}=e,i={...e,workflow:r},a=e.approvals.find(e=>e.status===`pending`&&e.covers.includes(`sanoma.change.merge`));return(0,Z.jsxs)(ne,{role:`region`,"aria-label":`Publish`,className:F(b,`order-first`),children:[(0,Z.jsx)(A,{className:`border-b`,children:(0,Z.jsx)(k,{children:`Publish`})}),(0,Z.jsxs)(te,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,Z.jsx)(Q,{state:n}),(0,Z.jsxs)(E,{children:[(0,Z.jsx)(j,{label:`Checks`,children:n.check?n.check.ok?`pass`:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.check.problems.map((e,t)=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`text-xs`,children:e})},t))}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`not run yet`})}),(0,Z.jsx)(j,{label:`Card`,children:n.card.reason}),n.merged&&(0,Z.jsx)(ce,{merged:n.merged})]})]}),a&&(0,Z.jsxs)(C,{className:`flex-wrap gap-2`,children:[(0,Z.jsx)(X,{run:i,approval:a,verbs:t}),(0,Z.jsxs)(`p`,{className:`w-full text-sm text-muted-foreground`,children:[t===Y?`Rejecting`:`Choosing ${t.reject}`,` closes the change.`]})]})]})}function Q({state:e}){let{decision:t}=e,n;n=e.phase===`merged`?`Published`:e.phase===`closed`?e.closedBy?`Closed by ${e.closedBy}`:`Closed`:t?.answer===`deny`?`Refused: ${t.reason??`the policy denies it`}`:e.phase===`blocked`?`Blocked: ${e.blocked??`it waits for a new commit`}`:t?t.answer===`hold`?`Publish waits for ${H(t.approver)}`:t.approver?`Allowed: Publish is for ${H(t.approver)}`:`Allowed`:`The policy has not been asked yet`;let r=L(e)?void 0:V(t);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:n}),r&&(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r})]})}function ce({merged:e}){let{deploy:t,verified:n}=e,r=t?.follow;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(j,{label:`Merged`,children:[(0,Z.jsx)(y,{sha:e.sha}),`, `,(0,Z.jsx)(T,{at:e.at})]}),r&&(0,Z.jsx)(j,{label:`This computer`,children:`revision`in r?(0,Z.jsxs)(Z.Fragment,{children:[`follows main at `,(0,Z.jsx)(y,{sha:r.revision})]}):`skipped`in r?`did not follow main: ${r.skipped}`:`could not follow main: ${r.error}`}),t?.apply&&(0,Z.jsxs)(j,{label:`Deploy`,children:[(0,Z.jsx)(a,{...h({runId:t.apply.runId,workflow:`apply`}),children:`the hosts' apply`}),t.apply.error?`: ${t.apply.error}`:``]}),n&&(0,Z.jsxs)(j,{label:`Verified`,children:[(0,Z.jsx)(a,{...h({runId:n.runId,workflow:`drift`}),children:`drift`}),n.error?`: ${n.error}`:n.drifted.length>0?`: not as declared: ${n.drifted.join(`, `)}`:`: as declared`]})]})}var $=n(e(),1);function le({before:e,after:t}){let n=(0,$.useMemo)(()=>U(e,t),[e,t]),[r,i]=(0,$.useState)(!1),a=r?n:K(n),o=re(n),s=a.workflows.length===0&&a.ops.length===0;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o.length>0?o.join(` · `):`No one's answers change`}),(0,Z.jsx)(N,{variant:`ghost`,size:`sm`,"aria-pressed":r,onClick:()=>i(!r),children:r?`Hide unchanged rows`:`Show unchanged rows`})]}),!s&&(0,Z.jsx)(S,{className:`gap-0 py-0`,children:(0,Z.jsx)(oe,{groups:a.groups.map(e=>e.group),workflows:a.workflows,ops:a.ops,cell:(e,t)=>(0,Z.jsx)(ue,{cell:e.cells[t]}),linkRow:e=>e.status!==`added`&&e.status!==`removed`})})]})}function ue({cell:e}){let t=e.after??e.before;return t?e.change===`same`?(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:q(t)}):(0,Z.jsx)(O,{tone:w[e.change],"aria-label":W(e),children:G(e)}):null}function de(){let{id:e}=I.useParams(),{data:t,error:n}=m(c(e));if(!t)throw g();let{state:o}=t,p=d.safeParse(o.plan).data,{data:_}=m(s()),b=i();return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(x,{children:[(0,Z.jsx)(O,{dot:!0,tone:ee[o.phase],children:z(o)}),(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[o.branch&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`code`,{children:o.branch}),o.head&&(0,Z.jsxs)(Z.Fragment,{children:[` `,`at `,(0,Z.jsx)(y,{sha:o.head})]}),` `,`·`,` `]}),o.pullRequest&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(J,{pullRequest:o.pullRequest}),` ·`,` `]}),`opened by `,u(t),` · `,(0,Z.jsx)(T,{at:t.createdAt}),` ·`,` `,(0,Z.jsx)(a,{...h({runId:t.runId,workflow:r}),children:l(t.runId)})]})]}),n&&(0,Z.jsxs)(M,{variant:`destructive`,children:[`Could not refresh: `,n.message]}),(0,Z.jsx)(v,{float:(0,Z.jsx)(se,{change:t,...p&&{verbs:ae}}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-(--gap-region) p-4`,children:[(0,Z.jsx)(fe,{change:t}),(0,Z.jsx)(me,{change:t}),p&&(0,Z.jsx)(ie,{change:t,plan:p,collection:f(p.collection)(_),tryAgain:b}),(0,Z.jsx)(he,{change:t}),(0,Z.jsx)(ge,{change:t})]})})]})}function fe({change:{state:e}}){let{decision:t}=e;if(L(e))return null;if(t?.answer===`deny`){let e=V(t);return(0,Z.jsxs)(M,{variant:`destructive`,children:[e?`${e}: `:``,t.reason??`the policy refuses this change`]})}return e.phase===`blocked`&&e.blocked?(0,Z.jsxs)(M,{variant:`destructive`,children:[`This change cannot publish now: `,e.blocked]}):null}var pe=new Intl.ListFormat(`en`,{type:`conjunction`});function me({change:e}){let{data:t}=m({...s(),select:o}),n=e.state.facts?.stranded??[];if(n.length===0||L(e.state))return null;let r=pe.format(e.edits.map(e=>t[e]??e)),i=n.length===1;return(0,Z.jsxs)(M,{children:[P(n.length,`run`),` of`,` `,r?`${r}, which this change edits,`:`the workflows this change edits`,` `,i?`is`:`are`,` waiting: publishing cannot move `,i?`it`:`them`,` to the new version.`,` `,n.map((e,t)=>(0,Z.jsxs)(`span`,{children:[t>0&&`, `,(0,Z.jsx)(a,{to:`/runs/$id`,params:{id:e},children:l(e)})]},e))]})}function he({change:{state:e}}){let t=R(B(e.facts));return(0,Z.jsx)(D,{title:`What changed`,children:e.facts?t.map(({key:e,title:t,files:n})=>(0,Z.jsx)(_,{title:t,children:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`text-xs`,children:e})},e))})},e)):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Sanoma has not read the change yet.`})})}function ge({change:{state:e}}){let{data:t}=m(p()),n=e.check?.grid;return n&&U(t,n).changed?(0,Z.jsx)(D,{title:`Who may do what`,children:(0,Z.jsx)(le,{before:t,after:n})}):!n&&e.facts?.rules?(0,Z.jsx)(D,{title:`Who may do what`,children:(0,Z.jsxs)(M,{variant:`destructive`,children:[`The branch's Permissions grid could not be computed`,e.check?.problems.length?`: ${e.check.problems.join(`; `)}`:``,`.`]})}):null}export{de as component};
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{Er as r,Et as i,Fi as a,Lt as o,M as s,S as c,Xn as l,Zn as u,hr as d,k as f,nt as p,pn as m,ut as h,ya as g}from"./queries-BTgXQRLH.js";import{N as _,g as v,o as y,p as b,s as x}from"./common-WJKVhtNw.js";import{H as S,K as C,L as w,P as ee,W as te,a as ne,h as T,i as E,l as D,m as O,n as k,q as A,r as j,s as M}from"./kit-BNTzGjDn.js";import{t as N}from"./button-D5kdANef.js";import{n as P,t as F}from"./utils-BRvE9-Fo.js";import{U as I}from"./index-bWqaZ5SR.js";import{a as L,i as R,o as z,r as B,s as V,t as H}from"./changes-CihK9Huo.js";import{a as U,n as W,o as re,r as G,s as K,t as q}from"./grid-diff-pzwWoTh4.js";import{n as J}from"./change-glance-BYVLeDLI.js";import{r as Y,t as X}from"./approval-CcJFVQB7.js";import{n as ie,t as ae}from"./review-C5Wt_3Az.js";import{n as oe}from"./permissions-grid-0-cx77oT.js";var Z=t();function se({change:e,verbs:t=Y}){let{state:n}=e,i={...e,workflow:r},a=e.approvals.find(e=>e.status===`pending`&&e.covers.includes(`sanoma.change.merge`));return(0,Z.jsxs)(ne,{role:`region`,"aria-label":`Publish`,className:F(b,`order-first`),children:[(0,Z.jsx)(A,{className:`border-b`,children:(0,Z.jsx)(k,{children:`Publish`})}),(0,Z.jsxs)(te,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,Z.jsx)(Q,{state:n}),(0,Z.jsxs)(E,{children:[(0,Z.jsx)(j,{label:`Checks`,children:n.check?n.check.ok?`pass`:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.check.problems.map((e,t)=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`text-xs`,children:e})},t))}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`not run yet`})}),(0,Z.jsx)(j,{label:`Card`,children:n.card.reason}),n.merged&&(0,Z.jsx)(ce,{merged:n.merged})]})]}),a&&(0,Z.jsxs)(C,{className:`flex-wrap gap-2`,children:[(0,Z.jsx)(X,{run:i,approval:a,verbs:t}),(0,Z.jsxs)(`p`,{className:`w-full text-sm text-muted-foreground`,children:[t===Y?`Rejecting`:`Choosing ${t.reject}`,` closes the change.`]})]})]})}function Q({state:e}){let{decision:t}=e,n;n=e.phase===`merged`?`Published`:e.phase===`closed`?e.closedBy?`Closed by ${e.closedBy}`:`Closed`:t?.answer===`deny`?`Refused: ${t.reason??`the policy denies it`}`:e.phase===`blocked`?`Blocked: ${e.blocked??`it waits for a new commit`}`:t?t.answer===`hold`?`Publish waits for ${H(t.approver)}`:t.approver?`Allowed: Publish is for ${H(t.approver)}`:`Allowed`:`The policy has not been asked yet`;let r=L(e)?void 0:V(t);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:n}),r&&(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r})]})}function ce({merged:e}){let{deploy:t,verified:n}=e,r=t?.follow;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(j,{label:`Merged`,children:[(0,Z.jsx)(y,{sha:e.sha}),`, `,(0,Z.jsx)(T,{at:e.at})]}),r&&(0,Z.jsx)(j,{label:`This computer`,children:`revision`in r?(0,Z.jsxs)(Z.Fragment,{children:[`follows main at `,(0,Z.jsx)(y,{sha:r.revision})]}):`skipped`in r?`did not follow main: ${r.skipped}`:`could not follow main: ${r.error}`}),t?.apply&&(0,Z.jsxs)(j,{label:`Deploy`,children:[(0,Z.jsx)(a,{...h({runId:t.apply.runId,workflow:`apply`}),children:`the hosts' apply`}),t.apply.error?`: ${t.apply.error}`:``]}),n&&(0,Z.jsxs)(j,{label:`Verified`,children:[(0,Z.jsx)(a,{...h({runId:n.runId,workflow:`drift`}),children:`drift`}),n.error?`: ${n.error}`:n.drifted.length>0?`: not as declared: ${n.drifted.join(`, `)}`:`: as declared`]})]})}var $=n(e(),1);function le({before:e,after:t}){let n=(0,$.useMemo)(()=>U(e,t),[e,t]),[r,i]=(0,$.useState)(!1),a=r?n:K(n),o=re(n),s=a.workflows.length===0&&a.ops.length===0;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o.length>0?o.join(` · `):`No one's answers change`}),(0,Z.jsx)(N,{variant:`ghost`,size:`sm`,"aria-pressed":r,onClick:()=>i(!r),children:r?`Hide unchanged rows`:`Show unchanged rows`})]}),!s&&(0,Z.jsx)(S,{className:`gap-0 py-0`,children:(0,Z.jsx)(oe,{groups:a.groups.map(e=>e.group),workflows:a.workflows,ops:a.ops,cell:(e,t)=>(0,Z.jsx)(ue,{cell:e.cells[t]}),linkRow:e=>e.status!==`added`&&e.status!==`removed`})})]})}function ue({cell:e}){let t=e.after??e.before;return t?e.change===`same`?(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:q(t)}):(0,Z.jsx)(O,{tone:w[e.change],"aria-label":W(e),children:G(e)}):null}function de(){let{id:e}=I.useParams(),{data:t,error:n}=m(c(e));if(!t)throw g();let{state:o}=t,p=d.safeParse(o.plan).data,{data:_}=m(s()),b=i();return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(x,{children:[(0,Z.jsx)(O,{dot:!0,tone:ee[o.phase],children:z(o)}),(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[o.branch&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`code`,{children:o.branch}),o.head&&(0,Z.jsxs)(Z.Fragment,{children:[` `,`at `,(0,Z.jsx)(y,{sha:o.head})]}),` `,`·`,` `]}),o.pullRequest&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(J,{pullRequest:o.pullRequest}),` ·`,` `]}),`opened by `,u(t),` · `,(0,Z.jsx)(T,{at:t.createdAt}),` ·`,` `,(0,Z.jsx)(a,{...h({runId:t.runId,workflow:r}),children:l(t.runId)})]})]}),n&&(0,Z.jsxs)(M,{variant:`destructive`,children:[`Could not refresh: `,n.message]}),(0,Z.jsx)(v,{float:(0,Z.jsx)(se,{change:t,...p&&{verbs:ae}}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-(--gap-region) p-4`,children:[(0,Z.jsx)(fe,{change:t}),(0,Z.jsx)(me,{change:t}),p&&(0,Z.jsx)(ie,{change:t,plan:p,collection:f(p.collection)(_),tryAgain:b}),(0,Z.jsx)(he,{change:t}),(0,Z.jsx)(ge,{change:t})]})})]})}function fe({change:{state:e}}){let{decision:t}=e;if(L(e))return null;if(t?.answer===`deny`){let e=V(t);return(0,Z.jsxs)(M,{variant:`destructive`,children:[e?`${e}: `:``,t.reason??`the policy refuses this change`]})}return e.phase===`blocked`&&e.blocked?(0,Z.jsxs)(M,{variant:`destructive`,children:[`This change cannot publish now: `,e.blocked]}):null}var pe=new Intl.ListFormat(`en`,{type:`conjunction`});function me({change:e}){let{data:t}=m({...s(),select:o}),n=e.state.facts?.stranded??[];if(n.length===0||L(e.state))return null;let r=pe.format(e.edits.map(e=>t[e]??e)),i=n.length===1;return(0,Z.jsxs)(M,{children:[P(n.length,`run`),` of`,` `,r?`${r}, which this change edits,`:`the workflows this change edits`,` `,i?`is`:`are`,` waiting: publishing cannot move `,i?`it`:`them`,` to the new version.`,` `,n.map((e,t)=>(0,Z.jsxs)(`span`,{children:[t>0&&`, `,(0,Z.jsx)(a,{to:`/runs/$id`,params:{id:e},children:l(e)})]},e))]})}function he({change:{state:e}}){let t=R(B(e.facts));return(0,Z.jsx)(D,{title:`What changed`,children:e.facts?t.map(({key:e,title:t,files:n})=>(0,Z.jsx)(_,{title:t,children:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`text-xs`,children:e})},e))})},e)):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Sanoma has not read the change yet.`})})}function ge({change:{state:e}}){let{data:t}=m(p()),n=e.check?.grid;return n&&U(t,n).changed?(0,Z.jsx)(D,{title:`Who may do what`,children:(0,Z.jsx)(le,{before:t,after:n})}):!n&&e.facts?.rules?(0,Z.jsx)(D,{title:`Who may do what`,children:(0,Z.jsxs)(M,{variant:`destructive`,children:[`The branch's Permissions grid could not be computed`,e.check?.problems.length?`: ${e.check.problems.join(`; `)}`:``,`.`]})}):null}export{de as component};
@@ -1 +1 @@
1
- import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{Fi as r,Ft as i,Ii as a,It as o,Pr as s,Wr as c,Xn as l,Yn as u,Zn as d,dt as f,f as p,gt as m,kt as h,p as g,pn as _,rt as ee,ut as te,va as ne,vt as v}from"./queries-BTgXQRLH.js";import{C as y,Dt as b,Et as x,M as S,N as C,T as re,g as w,p as T,s as E,w as D}from"./common-WJKVhtNw.js";import{J as O,K as k,U as A,W as j,a as M,h as N,i as P,m as F,n as I,o as L,q as R,r as z,s as B,t as V,z as H}from"./kit-BNTzGjDn.js";import{t as ie}from"./Play.es-DGJ1CGhp.js";import{t as U}from"./utils-BRvE9-Fo.js";import{C as W,S as G,n as K}from"./index-BkjZ82BQ.js";import{t as q}from"./X.es-B7rq0E_-.js";import{n as J}from"./runs-table-DjqR0vHc.js";import{n as Y,t as ae}from"./scenario-CYwAtzNF.js";import{t as oe}from"./workflow-C4e2RPVy.js";import{n as se,r as ce,t as le}from"./workflow-view-BhFMDJaB.js";var X=n(e(),1),Z=t(),ue={all:`All`,live:`Live`,sandbox:`Sandbox`,waiting:`Waiting`,failed:`Failed`};function Q(e,t){let{data:n,error:r}=_(o(e,t)),a=ee(t);return{shown:i(t,n),fromLatest:a,capped:n.length===g,error:r,empty:t===`all`?`No runs yet`:a?`No ${t} runs among the latest ${g}`:`No runs match`}}function de({name:e,filter:t,open:n}){let{shown:r,fromLatest:i,capped:a,error:o,empty:s}=Q(e,t);return(0,Z.jsxs)(Z.Fragment,{children:[o&&(0,Z.jsxs)(B,{variant:`destructive`,children:[`Could not refresh the runs: `,o.message]}),(0,Z.jsxs)(w,{float:n&&(0,Z.jsx)(pe,{id:n},n),children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 p-3`,children:[(0,Z.jsx)(fe,{filter:t}),a&&(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[i?`From`:`Showing`,` the latest `,g]})]}),r.length===0?(0,Z.jsx)(L,{className:`border-0 border-t`,title:s}):(0,Z.jsx)(J,{runs:r,className:`border-t`,link:e=>({to:`.`,search:t=>({...t,run:e.runId})}),selected:n})]})]})}function fe({filter:e}){let t=a();return(0,Z.jsx)(G,{size:`sm`,"aria-label":`Show runs`,value:e,onChange:e=>{let n=e.target.value;t({to:`.`,search:e=>({...e,runs:n===`all`?void 0:n,run:void 0}),replace:!0})},children:p.map(e=>(0,Z.jsx)(W,{value:e,children:ue[e]},e))})}function pe({id:e}){let{data:t,error:n}=b({...f(e),retry:(e,t)=>!ne(t)&&e<3}),i=t?.run;return(0,Z.jsxs)(M,{role:`region`,"aria-label":l(e),className:U(T,`order-first gap-0 py-0`),children:[(0,Z.jsxs)(R,{className:`border-b py-3`,children:[(0,Z.jsx)(I,{children:l(e)}),(0,Z.jsx)(A,{children:(0,Z.jsx)(V,{variant:`ghost`,size:`icon-sm`,children:(0,Z.jsxs)(r,{to:`.`,search:e=>({...e,run:void 0}),children:[(0,Z.jsx)(q,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})})]}),(0,Z.jsx)(j,{className:`flex min-h-0 flex-1 flex-col gap-(--card-spacing) overflow-y-auto py-(--card-spacing)`,children:t?(0,Z.jsx)(me,{...t}):n?(0,Z.jsxs)(B,{variant:`destructive`,children:[`Could not read the run: `,n.message]}):(0,Z.jsx)(x,{role:`status`,"aria-label":`Loading the run`,className:`h-24`})}),i&&(0,Z.jsx)(k,{className:`border-t py-3`,children:(0,Z.jsx)(V,{size:`sm`,children:(0,Z.jsx)(r,{...te(i),children:`Open run`})})})]})}function me({run:e,ledger:t,ledgerError:n,approvals:r}){let i=u(e)[0],a=t.find(e=>e.type===`run.started`)?.input,o=(0,X.useMemo)(()=>new Map(r.map(e=>[e.id,e.title])),[r]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(F,{dot:!0,tone:H[e.status],children:e.status}),e.sandbox!==void 0&&(0,Z.jsx)(S,{name:e.sandbox}),i&&(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`on `,c(i.approver),` for “`,i.title,`”`]})]}),e.error&&(0,Z.jsx)(`p`,{className:`text-destructive`,children:e.error}),(0,Z.jsxs)(P,{children:[(0,Z.jsx)(z,{label:`Started by`,children:d(e)}),(0,Z.jsx)(z,{label:`Started`,children:(0,Z.jsx)(N,{at:e.createdAt})})]}),(0,Z.jsx)(C,{title:`Input`,children:(0,Z.jsx)(ce,{value:a,sealed:e.workflow===s})}),(0,Z.jsx)(C,{title:`Ledger`,children:n?(0,Z.jsxs)(B,{variant:`destructive`,children:[`Could not read the ledger: `,n]}):t.length===0?(0,Z.jsx)(re,{children:`Nothing recorded yet.`}):(0,Z.jsx)(se,{ledger:t,titles:o})})]})}function he(){let{name:e}=K.useParams(),{view:t,run:n,runs:i=`all`,scenario:a}=K.useSearch(),o=h(e),s=(0,X.useMemo)(()=>m(e),[e]),{data:{scenarios:c,errors:l}}=_({...v(),select:s}),u=c.find(e=>e.name===a),d={code:!!o,scenarios:c.length>0,runs:!0},f=t&&d[t]?t:void 0;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(E,{action:o&&!o.internal&&(0,Z.jsx)(V,{size:`sm`,children:(0,Z.jsxs)(r,{from:K.fullPath,to:`.`,search:e=>({...e,view:void 0,run:void 0,new:!0}),children:[(0,Z.jsx)(ie,{"aria-hidden":`true`,"data-icon":`inline-start`}),`New run`]})}),children:[o&&(0,Z.jsx)(`code`,{className:`text-muted-foreground`,children:e}),o?.builtin&&(0,Z.jsx)(O,{variant:`secondary`,children:`built-in`}),o?.app&&(0,Z.jsx)(O,{variant:`secondary`,children:o.app})]}),(0,Z.jsx)(ae,{errors:l}),(0,Z.jsxs)(D,{label:`Views`,value:f??`graph`,children:[(0,Z.jsx)(y,{value:`graph`,link:$(void 0),children:`Graph`}),(0,Z.jsx)(ge,{name:e,filter:i}),d.code&&(0,Z.jsx)(y,{value:`code`,link:$(`code`),children:`Code`}),d.scenarios&&(0,Z.jsx)(y,{value:`scenarios`,link:$(`scenarios`),count:c.length,children:`Scenarios`})]}),f===`runs`?(0,Z.jsx)(de,{name:e,filter:i,open:n}):f===`scenarios`?(0,Z.jsx)(Y,{scenarios:c,open:u}):o?(0,Z.jsx)(le,{name:e,workflow:o,scenario:u,view:f??`graph`},e):(0,Z.jsx)(oe,{name:e})]})}function $(e){return(0,Z.jsx)(r,{from:K.fullPath,to:`.`,search:t=>({...t,view:e,run:e===`runs`?t.run:void 0}),activeOptions:{explicitUndefined:!0}})}function ge({name:e,filter:t}){let{shown:n}=Q(e,t);return(0,Z.jsx)(y,{value:`runs`,link:$(`runs`),count:n.length,children:`Runs`})}export{he as component};
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{Fi as r,Ft as i,Ii as a,It as o,Pr as s,Wr as c,Xn as l,Yn as u,Zn as d,dt as f,f as p,gt as m,kt as h,p as g,pn as _,rt as ee,ut as te,va as ne,vt as v}from"./queries-BTgXQRLH.js";import{C as y,Dt as b,Et as x,M as S,N as C,T as re,g as w,p as T,s as E,w as D}from"./common-WJKVhtNw.js";import{J as O,K as k,U as A,W as j,a as M,h as N,i as P,m as F,n as I,o as L,q as R,r as z,s as B,t as V,z as H}from"./kit-BNTzGjDn.js";import{t as ie}from"./Play.es-DGJ1CGhp.js";import{t as U}from"./utils-BRvE9-Fo.js";import{C as W,S as G,n as K}from"./index-bWqaZ5SR.js";import{t as q}from"./X.es-B7rq0E_-.js";import{n as J}from"./runs-table-DjqR0vHc.js";import{n as Y,t as ae}from"./scenario-CYwAtzNF.js";import{t as oe}from"./workflow-C4e2RPVy.js";import{n as se,r as ce,t as le}from"./workflow-view-_uuHOg0C.js";var X=n(e(),1),Z=t(),ue={all:`All`,live:`Live`,sandbox:`Sandbox`,waiting:`Waiting`,failed:`Failed`};function Q(e,t){let{data:n,error:r}=_(o(e,t)),a=ee(t);return{shown:i(t,n),fromLatest:a,capped:n.length===g,error:r,empty:t===`all`?`No runs yet`:a?`No ${t} runs among the latest ${g}`:`No runs match`}}function de({name:e,filter:t,open:n}){let{shown:r,fromLatest:i,capped:a,error:o,empty:s}=Q(e,t);return(0,Z.jsxs)(Z.Fragment,{children:[o&&(0,Z.jsxs)(B,{variant:`destructive`,children:[`Could not refresh the runs: `,o.message]}),(0,Z.jsxs)(w,{float:n&&(0,Z.jsx)(pe,{id:n},n),children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 p-3`,children:[(0,Z.jsx)(fe,{filter:t}),a&&(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[i?`From`:`Showing`,` the latest `,g]})]}),r.length===0?(0,Z.jsx)(L,{className:`border-0 border-t`,title:s}):(0,Z.jsx)(J,{runs:r,className:`border-t`,link:e=>({to:`.`,search:t=>({...t,run:e.runId})}),selected:n})]})]})}function fe({filter:e}){let t=a();return(0,Z.jsx)(G,{size:`sm`,"aria-label":`Show runs`,value:e,onChange:e=>{let n=e.target.value;t({to:`.`,search:e=>({...e,runs:n===`all`?void 0:n,run:void 0}),replace:!0})},children:p.map(e=>(0,Z.jsx)(W,{value:e,children:ue[e]},e))})}function pe({id:e}){let{data:t,error:n}=b({...f(e),retry:(e,t)=>!ne(t)&&e<3}),i=t?.run;return(0,Z.jsxs)(M,{role:`region`,"aria-label":l(e),className:U(T,`order-first gap-0 py-0`),children:[(0,Z.jsxs)(R,{className:`border-b py-3`,children:[(0,Z.jsx)(I,{children:l(e)}),(0,Z.jsx)(A,{children:(0,Z.jsx)(V,{variant:`ghost`,size:`icon-sm`,children:(0,Z.jsxs)(r,{to:`.`,search:e=>({...e,run:void 0}),children:[(0,Z.jsx)(q,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})})]}),(0,Z.jsx)(j,{className:`flex min-h-0 flex-1 flex-col gap-(--card-spacing) overflow-y-auto py-(--card-spacing)`,children:t?(0,Z.jsx)(me,{...t}):n?(0,Z.jsxs)(B,{variant:`destructive`,children:[`Could not read the run: `,n.message]}):(0,Z.jsx)(x,{role:`status`,"aria-label":`Loading the run`,className:`h-24`})}),i&&(0,Z.jsx)(k,{className:`border-t py-3`,children:(0,Z.jsx)(V,{size:`sm`,children:(0,Z.jsx)(r,{...te(i),children:`Open run`})})})]})}function me({run:e,ledger:t,ledgerError:n,approvals:r}){let i=u(e)[0],a=t.find(e=>e.type===`run.started`)?.input,o=(0,X.useMemo)(()=>new Map(r.map(e=>[e.id,e.title])),[r]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(F,{dot:!0,tone:H[e.status],children:e.status}),e.sandbox!==void 0&&(0,Z.jsx)(S,{name:e.sandbox}),i&&(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`on `,c(i.approver),` for “`,i.title,`”`]})]}),e.error&&(0,Z.jsx)(`p`,{className:`text-destructive`,children:e.error}),(0,Z.jsxs)(P,{children:[(0,Z.jsx)(z,{label:`Started by`,children:d(e)}),(0,Z.jsx)(z,{label:`Started`,children:(0,Z.jsx)(N,{at:e.createdAt})})]}),(0,Z.jsx)(C,{title:`Input`,children:(0,Z.jsx)(ce,{value:a,sealed:e.workflow===s})}),(0,Z.jsx)(C,{title:`Ledger`,children:n?(0,Z.jsxs)(B,{variant:`destructive`,children:[`Could not read the ledger: `,n]}):t.length===0?(0,Z.jsx)(re,{children:`Nothing recorded yet.`}):(0,Z.jsx)(se,{ledger:t,titles:o})})]})}function he(){let{name:e}=K.useParams(),{view:t,run:n,runs:i=`all`,scenario:a}=K.useSearch(),o=h(e),s=(0,X.useMemo)(()=>m(e),[e]),{data:{scenarios:c,errors:l}}=_({...v(),select:s}),u=c.find(e=>e.name===a),d={code:!!o,scenarios:c.length>0,runs:!0},f=t&&d[t]?t:void 0;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(E,{action:o&&!o.internal&&(0,Z.jsx)(V,{size:`sm`,children:(0,Z.jsxs)(r,{from:K.fullPath,to:`.`,search:e=>({...e,view:void 0,run:void 0,new:!0}),children:[(0,Z.jsx)(ie,{"aria-hidden":`true`,"data-icon":`inline-start`}),`New run`]})}),children:[o&&(0,Z.jsx)(`code`,{className:`text-muted-foreground`,children:e}),o?.builtin&&(0,Z.jsx)(O,{variant:`secondary`,children:`built-in`}),o?.app&&(0,Z.jsx)(O,{variant:`secondary`,children:o.app})]}),(0,Z.jsx)(ae,{errors:l}),(0,Z.jsxs)(D,{label:`Views`,value:f??`graph`,children:[(0,Z.jsx)(y,{value:`graph`,link:$(void 0),children:`Graph`}),(0,Z.jsx)(ge,{name:e,filter:i}),d.code&&(0,Z.jsx)(y,{value:`code`,link:$(`code`),children:`Code`}),d.scenarios&&(0,Z.jsx)(y,{value:`scenarios`,link:$(`scenarios`),count:c.length,children:`Scenarios`})]}),f===`runs`?(0,Z.jsx)(de,{name:e,filter:i,open:n}):f===`scenarios`?(0,Z.jsx)(Y,{scenarios:c,open:u}):o?(0,Z.jsx)(le,{name:e,workflow:o,scenario:u,view:f??`graph`},e):(0,Z.jsx)(oe,{name:e})]})}function $(e){return(0,Z.jsx)(r,{from:K.fullPath,to:`.`,search:t=>({...t,view:e,run:e===`runs`?t.run:void 0}),activeOptions:{explicitUndefined:!0}})}function ge({name:e,filter:t}){let{shown:n}=Q(e,t);return(0,Z.jsx)(y,{value:`runs`,link:$(`runs`),count:n.length,children:`Runs`})}export{he as component};
@@ -1 +1 @@
1
- import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{Fi as r,M as i,Y as a,pn as o,sn as s,vt as c,ya as l}from"./queries-BTgXQRLH.js";import{D as u,L as d,f,n as p,s as m,x as h}from"./common-WJKVhtNw.js";import{H as g,J as _}from"./kit-BNTzGjDn.js";import{n as v}from"./utils-BRvE9-Fo.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./table-B81tv0LG.js";import{G as T}from"./index-BkjZ82BQ.js";import{n as E}from"./apps-71ZEzcL9.js";import{t as D}from"./chat-button-DNusaP5n.js";var O=n(e()),k=t(),A=e=>t=>{let n=t.apps.find(t=>t.name===e);if(!n)return;let r=t.policy.files.filter(({file:e})=>e.startsWith(`${n.dir}/policies/`)).map(({file:e,text:t})=>({file:e,rules:t.match(/^\s*(?:permit|forbid)\s*\(/gm)?.length??0,reasons:[...t.matchAll(/@reason\("((?:[^"\\]|\\.)*)"\)/g)].map(([,e])=>e)}));return{app:n,sites:t.sites.filter(t=>t.app===e),collections:t.collections.filter(t=>t.app===e),workflows:t.workflows.filter(t=>t.app===e),policies:r,ops:s(t)}},j=e=>{let t=t=>t.startsWith(`${e}/`);return({scenarios:e,errors:n})=>({files:[...Map.groupBy(e.filter(e=>t(e.file)),e=>e.file)].map(([e,t])=>({file:e,count:t.length,workflows:[...new Set(t.map(e=>e.workflow))]})),errors:n.filter(e=>t(e.file))})};function M(){let{name:e}=T.useParams(),t=(0,O.useMemo)(()=>A(e),[e]),{data:n}=o({...i(),select:t});if(!n)throw l();let{app:a}=n;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(m,{action:a.source&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f,{href:a.source,children:`Source`}),(0,k.jsx)(D,{prompt:E(a.name),children:`Update`})]}),children:a.source&&(0,k.jsx)(p,{folder:a.name})}),(0,k.jsx)(N,{app:a}),(0,k.jsxs)(g,{className:`gap-0 py-0`,children:[(0,k.jsx)(P,{title:`Sites`,note:`${n.sites.length} · in the bar`,children:n.sites.length>0&&(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`Site`}),(0,k.jsx)(b,{children:`Pages`}),(0,k.jsx)(b,{children:`Calls`}),(0,k.jsx)(b,{className:`text-right`,children:`Seen by`})]})}),(0,k.jsx)(x,{children:n.sites.map(e=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{className:`font-medium`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(d,{site:e}),(0,k.jsxs)(`code`,{className:`text-xs font-normal text-muted-foreground`,children:[`/sites/`,e.name]})]})}),(0,k.jsx)(C,{className:`text-muted-foreground`,children:v(e.pages.length,`page`)}),(0,k.jsx)(C,{className:`whitespace-normal`,children:(0,k.jsx)(I,{items:[...new Set(e.calls.map(e=>e.target))]})}),(0,k.jsx)(C,{className:`text-right`,children:e.public?(0,k.jsx)(_,{variant:`secondary`,children:`Visitors`}):(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`People in the app`})})]},e.name))})]})}),(0,k.jsx)(P,{title:`Collections`,note:`${n.collections.length} · on Data`,children:n.collections.length>0&&(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`Collection`}),(0,k.jsx)(b,{children:`Key`}),(0,k.jsx)(b,{children:`Fields`})]})}),(0,k.jsx)(x,{children:n.collections.map(({name:e,title:t,key:n,fields:i})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{className:`font-medium`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(r,{to:`/data/$name`,params:{name:e},children:t??e}),(0,k.jsxs)(`code`,{className:`text-xs font-normal text-muted-foreground`,children:[`data.`,e]})]})}),(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{children:n})}),(0,k.jsx)(C,{className:`whitespace-normal text-muted-foreground`,children:Object.keys(i).join(`, `)})]},e))})]})}),(0,k.jsx)(P,{title:`Workflows`,note:`${n.workflows.length} · on Workflows`,children:n.workflows.length>0&&(0,k.jsx)(L,{workflows:n.workflows,ops:n.ops})}),(0,k.jsx)(P,{title:`Policies`,note:`${v(n.policies.length,`file`)} · on Permissions`,children:n.policies.length>0&&(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`File`}),(0,k.jsx)(b,{children:`Rules`}),(0,k.jsx)(b,{children:`Why`}),(0,k.jsx)(b,{className:`text-right`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Open`})})]})}),(0,k.jsx)(x,{children:n.policies.map(({file:e,rules:t,reasons:n})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{className:`text-xs`,children:e})}),(0,k.jsx)(C,{className:`text-muted-foreground`,children:v(t,`rule`)}),(0,k.jsx)(C,{className:`whitespace-normal`,children:n.join(`; `)||`-`}),(0,k.jsx)(C,{className:`text-right`,children:(0,k.jsx)(r,{to:`/permissions`,children:`See the grid`})})]},e))})]})}),(0,k.jsx)(P,{title:`Scenarios`,note:`run by sanoma check`,children:(0,k.jsx)(R,{dir:a.dir})})]}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`People are never inside an app: its folder declares collections, workflows, policies and sites, and the company's people stay at the root, on People.`})]})}function N({app:e}){return(0,k.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e.source?(0,k.jsxs)(k.Fragment,{children:[`Taken from `,(0,k.jsx)(f,{href:e.source,children:e.source}),` into `,(0,k.jsxs)(`code`,{children:[e.dir,`/`]}),`.`]}):(0,k.jsxs)(k.Fragment,{children:[`The company's own app, in `,(0,k.jsxs)(`code`,{children:[e.dir,`/`]}),`.`]}),` `,`Everything below lives in that folder and is named `,(0,k.jsxs)(`code`,{children:[e.name,`.`]}),`…`]})}function P({title:e,note:t,children:n}){return(0,k.jsxs)(`section`,{"aria-label":e,className:`flex flex-col border-b last:border-b-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-baseline gap-2 px-4 pt-3 pb-1`,children:[(0,k.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]}),n||F]})}var F=(0,k.jsx)(`p`,{className:`px-4 pb-3 text-sm text-muted-foreground`,children:`None.`});function I({items:e}){return e.length===0?(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,k.jsx)(`span`,{className:`flex flex-wrap gap-x-2 gap-y-1`,children:e.map(e=>(0,k.jsx)(`code`,{className:`text-xs`,children:e},e))})}function L({workflows:e,ops:t}){let{data:n}=o(a());return(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`Workflow`}),(0,k.jsx)(b,{children:`Uses`}),(0,k.jsx)(b,{children:`Last run`}),(0,k.jsx)(b,{className:`text-right`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Runs`})})]})}),(0,k.jsx)(x,{children:e.map(e=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{className:`font-medium`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(r,{to:`/workflows/$name`,params:{name:e.name},children:e.title??e.name}),(0,k.jsx)(`code`,{className:`text-xs font-normal text-muted-foreground`,children:e.name})]})}),(0,k.jsx)(C,{className:`whitespace-normal`,children:e.ops.length===0?(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,k.jsx)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:e.ops.map(e=>(0,k.jsx)(`span`,{className:`inline-flex items-center gap-1.5 text-xs`,children:(0,k.jsx)(u,{id:e,op:t.get(e)})},e))})}),(0,k.jsx)(C,{children:(0,k.jsx)(h,{run:n[e.name],none:`Never run`})}),(0,k.jsx)(C,{className:`text-right`,children:(0,k.jsx)(r,{to:`/workflows/$name`,params:{name:e.name},search:{view:`runs`},children:`Runs`})})]},e.name))})]})}function R({dir:e}){let t=(0,O.useMemo)(()=>j(e),[e]),{data:{files:n,errors:i}}=o({...c(),select:t});return n.length===0&&i.length===0?F:(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`File`}),(0,k.jsx)(b,{children:`Scenarios`}),(0,k.jsx)(b,{children:`Of`})]})}),(0,k.jsxs)(x,{children:[n.map(({file:e,count:t,workflows:n})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{className:`text-xs`,children:e})}),(0,k.jsx)(C,{className:`text-muted-foreground`,children:v(t,`scenario`)}),(0,k.jsx)(C,{className:`whitespace-normal`,children:(0,k.jsx)(`span`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:n.map(e=>(0,k.jsx)(r,{to:`/workflows/$name`,params:{name:e},search:{view:`scenarios`},children:e},e))})})]},e)),i.map(({file:e,message:t})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{className:`text-xs`,children:e})}),(0,k.jsx)(C,{colSpan:2,className:`whitespace-normal text-destructive`,children:t})]},e))]})]})}export{M as component};
1
+ import{i as e,r as t,s as n}from"./engine-CBuzy-Ik.js";import{Fi as r,M as i,Y as a,pn as o,sn as s,vt as c,ya as l}from"./queries-BTgXQRLH.js";import{D as u,L as d,f,n as p,s as m,x as h}from"./common-WJKVhtNw.js";import{H as g,J as _}from"./kit-BNTzGjDn.js";import{n as v}from"./utils-BRvE9-Fo.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./table-B81tv0LG.js";import{G as T}from"./index-bWqaZ5SR.js";import{n as E}from"./apps-71ZEzcL9.js";import{t as D}from"./chat-button-DNusaP5n.js";var O=n(e()),k=t(),A=e=>t=>{let n=t.apps.find(t=>t.name===e);if(!n)return;let r=t.policy.files.filter(({file:e})=>e.startsWith(`${n.dir}/policies/`)).map(({file:e,text:t})=>({file:e,rules:t.match(/^\s*(?:permit|forbid)\s*\(/gm)?.length??0,reasons:[...t.matchAll(/@reason\("((?:[^"\\]|\\.)*)"\)/g)].map(([,e])=>e)}));return{app:n,sites:t.sites.filter(t=>t.app===e),collections:t.collections.filter(t=>t.app===e),workflows:t.workflows.filter(t=>t.app===e),policies:r,ops:s(t)}},j=e=>{let t=t=>t.startsWith(`${e}/`);return({scenarios:e,errors:n})=>({files:[...Map.groupBy(e.filter(e=>t(e.file)),e=>e.file)].map(([e,t])=>({file:e,count:t.length,workflows:[...new Set(t.map(e=>e.workflow))]})),errors:n.filter(e=>t(e.file))})};function M(){let{name:e}=T.useParams(),t=(0,O.useMemo)(()=>A(e),[e]),{data:n}=o({...i(),select:t});if(!n)throw l();let{app:a}=n;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(m,{action:a.source&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f,{href:a.source,children:`Source`}),(0,k.jsx)(D,{prompt:E(a.name),children:`Update`})]}),children:a.source&&(0,k.jsx)(p,{folder:a.name})}),(0,k.jsx)(N,{app:a}),(0,k.jsxs)(g,{className:`gap-0 py-0`,children:[(0,k.jsx)(P,{title:`Sites`,note:`${n.sites.length} · in the bar`,children:n.sites.length>0&&(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`Site`}),(0,k.jsx)(b,{children:`Pages`}),(0,k.jsx)(b,{children:`Calls`}),(0,k.jsx)(b,{className:`text-right`,children:`Seen by`})]})}),(0,k.jsx)(x,{children:n.sites.map(e=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{className:`font-medium`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(d,{site:e}),(0,k.jsxs)(`code`,{className:`text-xs font-normal text-muted-foreground`,children:[`/sites/`,e.name]})]})}),(0,k.jsx)(C,{className:`text-muted-foreground`,children:v(e.pages.length,`page`)}),(0,k.jsx)(C,{className:`whitespace-normal`,children:(0,k.jsx)(I,{items:[...new Set(e.calls.map(e=>e.target))]})}),(0,k.jsx)(C,{className:`text-right`,children:e.public?(0,k.jsx)(_,{variant:`secondary`,children:`Visitors`}):(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`People in the app`})})]},e.name))})]})}),(0,k.jsx)(P,{title:`Collections`,note:`${n.collections.length} · on Data`,children:n.collections.length>0&&(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`Collection`}),(0,k.jsx)(b,{children:`Key`}),(0,k.jsx)(b,{children:`Fields`})]})}),(0,k.jsx)(x,{children:n.collections.map(({name:e,title:t,key:n,fields:i})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{className:`font-medium`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(r,{to:`/data/$name`,params:{name:e},children:t??e}),(0,k.jsxs)(`code`,{className:`text-xs font-normal text-muted-foreground`,children:[`data.`,e]})]})}),(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{children:n})}),(0,k.jsx)(C,{className:`whitespace-normal text-muted-foreground`,children:Object.keys(i).join(`, `)})]},e))})]})}),(0,k.jsx)(P,{title:`Workflows`,note:`${n.workflows.length} · on Workflows`,children:n.workflows.length>0&&(0,k.jsx)(L,{workflows:n.workflows,ops:n.ops})}),(0,k.jsx)(P,{title:`Policies`,note:`${v(n.policies.length,`file`)} · on Permissions`,children:n.policies.length>0&&(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`File`}),(0,k.jsx)(b,{children:`Rules`}),(0,k.jsx)(b,{children:`Why`}),(0,k.jsx)(b,{className:`text-right`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Open`})})]})}),(0,k.jsx)(x,{children:n.policies.map(({file:e,rules:t,reasons:n})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{className:`text-xs`,children:e})}),(0,k.jsx)(C,{className:`text-muted-foreground`,children:v(t,`rule`)}),(0,k.jsx)(C,{className:`whitespace-normal`,children:n.join(`; `)||`-`}),(0,k.jsx)(C,{className:`text-right`,children:(0,k.jsx)(r,{to:`/permissions`,children:`See the grid`})})]},e))})]})}),(0,k.jsx)(P,{title:`Scenarios`,note:`run by sanoma check`,children:(0,k.jsx)(R,{dir:a.dir})})]}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`People are never inside an app: its folder declares collections, workflows, policies and sites, and the company's people stay at the root, on People.`})]})}function N({app:e}){return(0,k.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e.source?(0,k.jsxs)(k.Fragment,{children:[`Taken from `,(0,k.jsx)(f,{href:e.source,children:e.source}),` into `,(0,k.jsxs)(`code`,{children:[e.dir,`/`]}),`.`]}):(0,k.jsxs)(k.Fragment,{children:[`The company's own app, in `,(0,k.jsxs)(`code`,{children:[e.dir,`/`]}),`.`]}),` `,`Everything below lives in that folder and is named `,(0,k.jsxs)(`code`,{children:[e.name,`.`]}),`…`]})}function P({title:e,note:t,children:n}){return(0,k.jsxs)(`section`,{"aria-label":e,className:`flex flex-col border-b last:border-b-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-baseline gap-2 px-4 pt-3 pb-1`,children:[(0,k.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]}),n||F]})}var F=(0,k.jsx)(`p`,{className:`px-4 pb-3 text-sm text-muted-foreground`,children:`None.`});function I({items:e}){return e.length===0?(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,k.jsx)(`span`,{className:`flex flex-wrap gap-x-2 gap-y-1`,children:e.map(e=>(0,k.jsx)(`code`,{className:`text-xs`,children:e},e))})}function L({workflows:e,ops:t}){let{data:n}=o(a());return(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`Workflow`}),(0,k.jsx)(b,{children:`Uses`}),(0,k.jsx)(b,{children:`Last run`}),(0,k.jsx)(b,{className:`text-right`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Runs`})})]})}),(0,k.jsx)(x,{children:e.map(e=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{className:`font-medium`,children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(r,{to:`/workflows/$name`,params:{name:e.name},children:e.title??e.name}),(0,k.jsx)(`code`,{className:`text-xs font-normal text-muted-foreground`,children:e.name})]})}),(0,k.jsx)(C,{className:`whitespace-normal`,children:e.ops.length===0?(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,k.jsx)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:e.ops.map(e=>(0,k.jsx)(`span`,{className:`inline-flex items-center gap-1.5 text-xs`,children:(0,k.jsx)(u,{id:e,op:t.get(e)})},e))})}),(0,k.jsx)(C,{children:(0,k.jsx)(h,{run:n[e.name],none:`Never run`})}),(0,k.jsx)(C,{className:`text-right`,children:(0,k.jsx)(r,{to:`/workflows/$name`,params:{name:e.name},search:{view:`runs`},children:`Runs`})})]},e.name))})]})}function R({dir:e}){let t=(0,O.useMemo)(()=>j(e),[e]),{data:{files:n,errors:i}}=o({...c(),select:t});return n.length===0&&i.length===0?F:(0,k.jsxs)(w,{children:[(0,k.jsx)(y,{children:(0,k.jsxs)(S,{children:[(0,k.jsx)(b,{children:`File`}),(0,k.jsx)(b,{children:`Scenarios`}),(0,k.jsx)(b,{children:`Of`})]})}),(0,k.jsxs)(x,{children:[n.map(({file:e,count:t,workflows:n})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{className:`text-xs`,children:e})}),(0,k.jsx)(C,{className:`text-muted-foreground`,children:v(t,`scenario`)}),(0,k.jsx)(C,{className:`whitespace-normal`,children:(0,k.jsx)(`span`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:n.map(e=>(0,k.jsx)(r,{to:`/workflows/$name`,params:{name:e},search:{view:`scenarios`},children:e},e))})})]},e)),i.map(({file:e,message:t})=>(0,k.jsxs)(S,{children:[(0,k.jsx)(C,{children:(0,k.jsx)(`code`,{className:`text-xs`,children:e})}),(0,k.jsx)(C,{colSpan:2,className:`whitespace-normal text-destructive`,children:t})]},e))]})]})}export{M as component};