cezarion 0.18.0 → 0.19.0-dev.8640

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 (203) hide show
  1. package/package.json +4 -5
  2. package/web/dist/app-icon.png +0 -0
  3. package/web/dist/assets/accounts-section-D7EK3_7b.js +1 -0
  4. package/web/dist/assets/activity-motion-2BQBW4lA.js +2 -0
  5. package/web/dist/assets/{activity-motion-0wHCeUs7.css → activity-motion-DcKVM8fM.css} +1 -1
  6. package/web/dist/assets/activity-route-Ct06t8Y9.js +1 -0
  7. package/web/dist/assets/agent-config-section-D6Lcc7c5.js +7 -0
  8. package/web/dist/assets/agent-defaults-section-BnDBbzuG.js +1 -0
  9. package/web/dist/assets/agents-settings-path-7X6_cvUg.js +1 -0
  10. package/web/dist/assets/appearance-CM6ahUyy.js +1 -0
  11. package/web/dist/assets/archive-on-merge-field-C7_Fwy2A.js +1 -0
  12. package/web/dist/assets/arrow-up-right-DKGzsMqY.js +1 -0
  13. package/web/dist/assets/attention-CBCeJN5w.js +1 -0
  14. package/web/dist/assets/automation-format-DB34jUyF.js +1 -0
  15. package/web/dist/assets/automations-route-7B_DF4O1.js +2 -0
  16. package/web/dist/assets/automations-route-CzqZXK0W.css +1 -0
  17. package/web/dist/assets/badge-DQ3U69Ht.js +1 -0
  18. package/web/dist/assets/bot-TkDIw4y-.js +1 -0
  19. package/web/dist/assets/bundle-mjs-rHxsej31.js +1 -0
  20. package/web/dist/assets/button-B7MKxYjT.js +1 -0
  21. package/web/dist/assets/centered-state-V15AR_qo.js +1 -0
  22. package/web/dist/assets/cez-idle-CdswdDRd.js +1 -0
  23. package/web/dist/assets/change-counts-CW7O8g5Y.js +1 -0
  24. package/web/dist/assets/check-OP-CVgZG.js +1 -0
  25. package/web/dist/assets/chevron-down-CHGyCDBH.js +1 -0
  26. package/web/dist/assets/chevron-right-BENZ-1ZN.js +1 -0
  27. package/web/dist/assets/{chunk-BO2N2NFS-DE6qKn3r.js → chunk-BO2N2NFS-DQrpGzb-.js} +17 -17
  28. package/web/dist/assets/chunk-KS7C4IRE-Cg8l-LDN.js +3 -0
  29. package/web/dist/assets/circle-x-7nTlobAF.js +1 -0
  30. package/web/dist/assets/code-editor-B4baSOhz.js +4 -0
  31. package/web/dist/assets/collapsible-BEV4FO-1.js +1 -0
  32. package/web/dist/assets/command-KdW7aO0N.js +1 -0
  33. package/web/dist/assets/commit-list-O4ugJ12w.js +1 -0
  34. package/web/dist/assets/{core-BCsw8oQw.js → core-DzoyrHjB.js} +2 -2
  35. package/web/dist/assets/design-icons-CzEoMH9c.js +1 -0
  36. package/web/dist/assets/dialog-B531GGAo.js +1 -0
  37. package/web/dist/assets/diff-DKZvZQ2G.js +3 -0
  38. package/web/dist/assets/diff-controls-BpTFu29H.js +1 -0
  39. package/web/dist/assets/diff-view-D4yXb2w7.js +11 -0
  40. package/web/dist/assets/dist-BAoXdNsT.js +1 -0
  41. package/web/dist/assets/dist-BW234Kg5.js +1 -0
  42. package/web/dist/assets/dist-C5mlVBmd.js +1 -0
  43. package/web/dist/assets/dist-Czz3Y5qH.js +1 -0
  44. package/web/dist/assets/dist-DXO3xwbC.js +1 -0
  45. package/web/dist/assets/dist-Da4ckcJG.js +1 -0
  46. package/web/dist/assets/dropdown-menu-4e2iKSMT.js +1 -0
  47. package/web/dist/assets/es2015-CQth82uv.js +41 -0
  48. package/web/dist/assets/external-link-BE6y205O.js +1 -0
  49. package/web/dist/assets/file-preview-CUhut4J9.js +2 -0
  50. package/web/dist/assets/folder-browser-B7IbnF0d.js +1 -0
  51. package/web/dist/assets/folder-o-AvL3y3.js +1 -0
  52. package/web/dist/assets/format-BU7D3IfE.js +1 -0
  53. package/web/dist/assets/git-toolbar-po0QJciG.js +1 -0
  54. package/web/dist/assets/github-TgLTixC7.js +1 -0
  55. package/web/dist/assets/global-activity-route-OHCmn0ZO.js +1 -0
  56. package/web/dist/assets/{highlighted-body-OFNGDK62-BL-MfFgl.js → highlighted-body-OFNGDK62-Cx8MiNVZ.js} +1 -1
  57. package/web/dist/assets/highlighter-DvLzHjjY.js +3 -0
  58. package/web/dist/assets/hourglass-CikYdGGQ.js +1 -0
  59. package/web/dist/assets/html-report-BX3msvci.js +3 -0
  60. package/web/dist/assets/html-report-frame-uuqkBC0u.js +1 -0
  61. package/web/dist/assets/image-preview-Sisptm3b.js +1 -0
  62. package/web/dist/assets/index-C69_Sk06.css +1 -0
  63. package/web/dist/assets/index-CvVmG4Yu.js +21 -0
  64. package/web/dist/assets/label-Bt8n7Spq.js +1 -0
  65. package/web/dist/assets/lib-DrPFkMXk.js +1 -0
  66. package/web/dist/assets/live-protocol-DMhTnCmf.js +64 -0
  67. package/web/dist/assets/live-reads-Crd6fVGH.js +1 -0
  68. package/web/dist/assets/{live-worker-BWdeGzQX.ts → live-worker-DBw-5jVE.ts} +3 -1
  69. package/web/dist/assets/loader-circle-CPBhhDbB.js +1 -0
  70. package/web/dist/assets/markdown-jle_P0a2.js +2 -0
  71. package/web/dist/assets/mermaid-GHXKKRXX-lTc_AjAC.js +1 -0
  72. package/web/dist/assets/moon-CRE9nU5R.js +1 -0
  73. package/web/dist/assets/nav-row-styles-DKeXbc4N.js +1 -0
  74. package/web/dist/assets/notifications-section-Bhqr3yOz.js +1 -0
  75. package/web/dist/assets/open-in-menu-BPp88ouw.js +1 -0
  76. package/web/dist/assets/own-lookup-DS54wXvD.js +1 -0
  77. package/web/dist/assets/page-shell-7pLJMOgh.js +1 -0
  78. package/web/dist/assets/page-shell-DQPYcKyL.css +1 -0
  79. package/web/dist/assets/play-CmVAj_fu.js +1 -0
  80. package/web/dist/assets/plus-CxRU2X8C.js +1 -0
  81. package/web/dist/assets/popover-BPgUYFyu.js +1 -0
  82. package/web/dist/assets/preload-helper-Czpn1I53.js +1 -0
  83. package/web/dist/assets/preview-pane-connected-CBt_nlmX.js +3 -0
  84. package/web/dist/assets/project-location-BRxXN249.js +1 -0
  85. package/web/dist/assets/project-order-AcHI4Dcl.js +1 -0
  86. package/web/dist/assets/project-rail-sortable-BmVI4_-T.js +1 -0
  87. package/web/dist/assets/project-router-CLJTc7gv.js +1 -0
  88. package/web/dist/assets/project-scope-context-Rv6S_BXt.js +4 -0
  89. package/web/dist/assets/projects-section-DnGSWHZJ.js +1 -0
  90. package/web/dist/assets/prompt-templates-section-8kBTviSw.js +1 -0
  91. package/web/dist/assets/queries-qCF-eOqZ.js +1 -0
  92. package/web/dist/assets/reference-chip-D0v0keVC.js +1 -0
  93. package/web/dist/assets/remote-settings-notice-D7G8cXSx.js +1 -0
  94. package/web/dist/assets/repo-git-DqBUjQMh.js +1 -0
  95. package/web/dist/assets/report-reader-DtSBGt0O.js +1 -0
  96. package/web/dist/assets/reports-CgbU2SrW.css +1 -0
  97. package/web/dist/assets/reports-ea3-iuBm.js +1 -0
  98. package/web/dist/assets/resources-section-CpXFFHXl.js +1 -0
  99. package/web/dist/assets/run-header-BWTrj0_2.js +2 -0
  100. package/web/dist/assets/{run-header-CC7VUTg9.css → run-header-Ccnr9k0X.css} +1 -1
  101. package/web/dist/assets/save-cue-Cd3ZAPBS.js +1 -0
  102. package/web/dist/assets/saved-draft-BwzBc-_Y.js +1 -0
  103. package/web/dist/assets/select-aiSr0uTB.js +1 -0
  104. package/web/dist/assets/session-context-section-BRaZbxVO.js +119 -0
  105. package/web/dist/assets/settings-agent-picker-DMIqQhkC.js +1 -0
  106. package/web/dist/assets/settings-field-DP9sYv5a.js +1 -0
  107. package/web/dist/assets/settings-select-CCIMGnyA.js +1 -0
  108. package/web/dist/assets/settings-shell-CqiAPuLq.css +1 -0
  109. package/web/dist/assets/settings-shell-DwMbZhxp.js +1 -0
  110. package/web/dist/assets/sidebar-section-ClrORHpO.js +1 -0
  111. package/web/dist/assets/skills-B97qjJ7j.js +1 -0
  112. package/web/dist/assets/skills-pM_PouEs.js +1 -0
  113. package/web/dist/assets/smartphone-Lr8Ug2z_.js +1 -0
  114. package/web/dist/assets/sortable.esm-CAVTYaA3.js +5 -0
  115. package/web/dist/assets/square-terminal-B6RYYieR.js +1 -0
  116. package/web/dist/assets/status-dot-BRzVlF2X.js +1 -0
  117. package/web/dist/assets/switch-SP8pw5uU.js +1 -0
  118. package/web/dist/assets/tab-link-Bu1g-ArE.js +1 -0
  119. package/web/dist/assets/task-changes-BEfLx9dF.js +1 -0
  120. package/web/dist/assets/task-commits-6f0GpNF7.js +1 -0
  121. package/web/dist/assets/task-files-CA2xTRaM.js +1 -0
  122. package/web/dist/assets/task-github-item-BWapcDJr.js +1 -0
  123. package/web/dist/assets/task-groups-4tzKGROI.js +1 -0
  124. package/web/dist/assets/task-thread-0rKVutjQ.js +9 -0
  125. package/web/dist/assets/task-thread-DzADOhZd.css +1 -0
  126. package/web/dist/assets/tasks-table-C5uoZMFs.js +1 -0
  127. package/web/dist/assets/textarea-vJt9undk.js +1 -0
  128. package/web/dist/assets/thread-state-C3eDWXYs.js +4 -0
  129. package/web/dist/assets/toaster-BXnLIU3z.js +1 -0
  130. package/web/dist/assets/use-hand-to-agent-state-Ch0ok71s.css +1 -0
  131. package/web/dist/assets/use-hand-to-agent-state-DrAmCxn8.js +1 -0
  132. package/web/dist/assets/utils-DSMR_WLb.js +1 -0
  133. package/web/dist/assets/workflows-CW-1K6tq.js +7 -0
  134. package/web/dist/assets/workflows-DsE0ExV6.css +1 -0
  135. package/web/dist/assets/workspace-tools-BzDQrP3y.js +1 -0
  136. package/web/dist/assets/worktrees-section-ay1jJn_w.js +4 -0
  137. package/web/dist/assets/zoomable-image-CIQl1Wpe.js +1 -0
  138. package/web/dist/index.html +67 -32
  139. package/web/dist/live-worker.js +2 -2
  140. package/web/dist/assets/activity-motion-hhx0e841.js +0 -2
  141. package/web/dist/assets/activity-route-De0BnSrc.js +0 -1
  142. package/web/dist/assets/agent-accounts-BCg-578Q.js +0 -18
  143. package/web/dist/assets/alert-dialog-Dj464rjk.js +0 -1
  144. package/web/dist/assets/bundle-mjs-BT31bpU6.js +0 -1
  145. package/web/dist/assets/button-CHUAMTHK.js +0 -3
  146. package/web/dist/assets/centered-state-DGyy0SuA.js +0 -1
  147. package/web/dist/assets/cez-idle-BT0U4GN_.js +0 -1
  148. package/web/dist/assets/commit-diff-panel-DYtYc_dH.js +0 -1
  149. package/web/dist/assets/control-locations-CA9TMupq.js +0 -1
  150. package/web/dist/assets/design-icons-DmYTv2r1.js +0 -1
  151. package/web/dist/assets/diff-controls-BR2uqhwG.js +0 -1
  152. package/web/dist/assets/diff-tVGVhYyc.js +0 -3
  153. package/web/dist/assets/diff-view-CNM3u77o.js +0 -11
  154. package/web/dist/assets/dropdown-menu-DhrBcVgr.js +0 -1
  155. package/web/dist/assets/es2015-D345RR4o.js +0 -41
  156. package/web/dist/assets/file-preview-C1eTdJLJ.js +0 -2
  157. package/web/dist/assets/git-toolbar-Dwz8p8GW.js +0 -1
  158. package/web/dist/assets/github-BSezqH6f.js +0 -1
  159. package/web/dist/assets/github-sidebar-model-Ct0DltOv.js +0 -1
  160. package/web/dist/assets/global-activity-route-BZiYz-B0.js +0 -1
  161. package/web/dist/assets/hourglass-B0lPAJvT.js +0 -1
  162. package/web/dist/assets/image-preview-Cq1vDiEo.js +0 -1
  163. package/web/dist/assets/index-B18AqW0Z.css +0 -1
  164. package/web/dist/assets/index-D489J7QW.js +0 -14
  165. package/web/dist/assets/lib-BxQXEXDF.js +0 -1
  166. package/web/dist/assets/live-protocol-BDY7JJpT.js +0 -64
  167. package/web/dist/assets/live-refetch-C0kQc3-z.js +0 -1
  168. package/web/dist/assets/loader-circle-CZkGEdoI.js +0 -1
  169. package/web/dist/assets/markdown-D7DUNWcJ.js +0 -6
  170. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +0 -1
  171. package/web/dist/assets/nav-row-styles-BZUUavOF.js +0 -1
  172. package/web/dist/assets/popover-DRcRI46x.js +0 -1
  173. package/web/dist/assets/preview-pane-connected-DGkEs_L3.js +0 -3
  174. package/web/dist/assets/project-router-1m_VlC22.js +0 -1
  175. package/web/dist/assets/project-scope-context-CaUqlAd7.js +0 -4
  176. package/web/dist/assets/queries-DYfIpJ-d.js +0 -1
  177. package/web/dist/assets/repo-git-CU1S5P-y.js +0 -1
  178. package/web/dist/assets/report-reader-DlZol2Ux.js +0 -1
  179. package/web/dist/assets/reports-B7QAzibP.css +0 -1
  180. package/web/dist/assets/reports-DIGGjk7C.js +0 -1
  181. package/web/dist/assets/run-header-DPjiPKRe.js +0 -2
  182. package/web/dist/assets/skill-empty-hint-YDmkqgo-.js +0 -1
  183. package/web/dist/assets/skills-BMwanop_.js +0 -1
  184. package/web/dist/assets/skills-DFBiAuJG.js +0 -1
  185. package/web/dist/assets/skills-workflows-C21NystW.css +0 -1
  186. package/web/dist/assets/sortable.esm-zp_qkYGV.js +0 -5
  187. package/web/dist/assets/tab-link-DCUifQ46.js +0 -1
  188. package/web/dist/assets/task-changes-BZXWvQN3.js +0 -1
  189. package/web/dist/assets/task-commits-ByI9MSfc.js +0 -1
  190. package/web/dist/assets/task-files-LJbenpiH.js +0 -1
  191. package/web/dist/assets/task-github-item-B0CU9lGR.js +0 -1
  192. package/web/dist/assets/task-thread-CXCN__1a.js +0 -9
  193. package/web/dist/assets/task-thread-DtQ6uGfQ.css +0 -1
  194. package/web/dist/assets/textarea-DlVUfdWG.js +0 -1
  195. package/web/dist/assets/thread-state-BLaCzqeX.js +0 -4
  196. package/web/dist/assets/toaster-B1MyeHiE.js +0 -1
  197. package/web/dist/assets/use-hand-to-agent-state-BkmKad8x.js +0 -1
  198. package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +0 -1
  199. package/web/dist/assets/useInfiniteQuery-qEY8OhKb.js +0 -1
  200. package/web/dist/assets/useQuery-DOJQOEBO.js +0 -1
  201. package/web/dist/assets/workflows-Dbxb-d-6.js +0 -7
  202. package/web/dist/assets/ws-DvGmrP4z.js +0 -1
  203. package/web/dist/assets/zoomable-image-5pOUaPEg.js +0 -1
@@ -0,0 +1,119 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Nn as i}from"./project-scope-context-Rv6S_BXt.js";import{n as a}from"./toaster-BXnLIU3z.js";import{D as o,O as s,S as c}from"./queries-qCF-eOqZ.js";import{t as l}from"./plus-CxRU2X8C.js";import{t as u}from"./button-B7MKxYjT.js";import{t as d}from"./badge-DQ3U69Ht.js";import{t as f}from"./centered-state-V15AR_qo.js";import{Hn as p,er as m,gn as h}from"./index-CvVmG4Yu.js";import{t as g}from"./code-editor-B4baSOhz.js";var _=e(t(),1);function v(e,t,n){let r=e.indexOf(t),i={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};if(n===`Home`)return e[0];if(n===`End`)return e.at(-1);if(!(i[n]===void 0||r===-1))return e[(r+i[n]+e.length)%e.length]}var y=n(),b={"built-in":`built in`,parent:`parent`,worker:`worker`,both:`both`},x={"built-in":`built in`,shared:`shared`,local:`local`},S={applied:`border-success/40 text-success`,skipped:`border-conflict/50 text-conflict`,"not-for-role":`text-soft-foreground`},C=e=>`${e.toLocaleString(`en-US`)} B`;function ee({id:e,preview:t,role:n,onRole:i,pending:a,className:o}){return(0,y.jsxs)(`section`,{id:e,"data-slot":`session-context-preview`,"aria-labelledby":`session-context-preview-title`,"aria-busy":a,className:r(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,o),children:[(0,y.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border p-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`h3`,{id:`session-context-preview-title`,className:`text-sm font-semibold`,children:`Combined preview`}),(0,y.jsx)(`span`,{className:`ml-auto text-[12px] text-soft-foreground`,children:`Updates as you type`})]}),(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,y.jsx)(`span`,{id:`session-context-role`,className:`text-[12px] text-soft-foreground`,children:`Preview as`}),(0,y.jsx)(te,{role:n,onRole:i}),(0,y.jsx)(`span`,{className:`text-[12px] text-soft-foreground`,children:`Handoff, shared, then local. Files come from the project checkout.`})]}),t?(0,y.jsx)(ne,{used:t.usedBytes,limit:t.limitBytes,blocks:t.blocks}):(0,y.jsx)(`div`,{className:`h-[38px]`})]}),(0,y.jsx)(`ul`,{"data-slot":`session-context-blocks`,className:`divide-y divide-border`,children:t?.blocks.map((e,t)=>(0,y.jsx)(T,{block:e,role:n},`${e.source}-${e.id}-${t}`))})]})}var w=[`parent`,`worker`];function te({role:e,onRole:t}){let n=(0,_.useRef)(new Map);return(0,y.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`session-context-role`,onKeyDown:r=>{let i=v(w,e,r.key);i!==void 0&&(r.preventDefault(),t(i),n.current.get(i)?.focus())},className:`inline-flex overflow-hidden rounded-md border border-[var(--control-border)]`,children:w.map(i=>(0,y.jsx)(`button`,{ref:e=>{e?n.current.set(i,e):n.current.delete(i)},type:`button`,role:`radio`,"aria-checked":e===i,tabIndex:e===i?0:-1,"data-slot":`session-context-role`,onClick:()=>t(i),className:r(`min-h-11 px-4 text-[13px] capitalize text-muted-foreground focus-visible:outline-2 focus-visible:outline-ring`,e===i&&`bg-muted text-foreground`),children:i},i))})}function ne({used:e,limit:t,blocks:n}){let r=n.filter(e=>e.status===`applied`).length,i=n.filter(e=>e.status===`skipped`).length,a=Math.min(100,e/t*100);return(0,y.jsxs)(`div`,{"data-slot":`session-context-meter`,children:[(0,y.jsx)(`div`,{role:`meter`,"aria-label":`Session context size`,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,"aria-valuetext":`${C(e)} of ${C(t)}`,className:`h-2 overflow-hidden rounded-full bg-muted`,children:(0,y.jsx)(`div`,{className:`h-full rounded-full bg-accent-strong`,style:{width:`${a}%`}})}),(0,y.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap gap-x-3 text-[12px]`,children:[(0,y.jsxs)(`span`,{className:`text-muted-foreground`,children:[C(e),` used: `,r,` `,r===1?`block`:`blocks`,` applied`,i>0?`, ${i} skipped`:``]}),(0,y.jsxs)(`span`,{className:`ml-auto text-soft-foreground`,children:[`Limit 64 KiB (`,C(t),`)`]})]})]})}function T({block:e,role:t}){let n=e.status===`not-for-role`?`not for ${t}`:e.status,i=e.overridesShared?`local · overrides shared`:x[e.source],a=e.source===`built-in`||e.overridesShared,o=e.reason!==null&&!(e.status===`applied`&&e.overridesShared);return(0,y.jsxs)(`li`,{"data-slot":`session-context-block`,"data-status":e.status,"data-source":e.source,className:`flex flex-col gap-1.5 p-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(`code`,{className:`font-mono text-[12px] text-foreground`,children:e.id}),(0,y.jsx)(d,{"data-slot":`session-context-source`,variant:`outline`,className:r(`text-[11px]`,a&&`border-accent-strong/40 text-link-foreground`),children:i}),e.target&&e.target!==`built-in`&&(0,y.jsx)(d,{variant:`outline`,className:`text-[11px]`,children:b[e.target]}),(0,y.jsx)(`span`,{className:`ml-auto font-mono text-[12px] text-soft-foreground`,children:e.bytes===null?`—`:C(e.bytes)}),(0,y.jsx)(d,{variant:`outline`,className:r(`text-[11px]`,S[e.status]),children:n})]}),o&&(0,y.jsx)(`p`,{className:`text-[12px] text-conflict`,children:e.reason}),e.text!==null&&(0,y.jsxs)(`pre`,{tabIndex:0,"aria-label":`${e.id} text`,className:`max-h-28 overflow-auto rounded-md bg-background px-2.5 py-2 font-mono text-[12px] whitespace-pre-wrap text-muted-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[e.text,e.truncated?`
2
+ …`:``]})]})}var re=Symbol.for(`yaml.alias`),E=Symbol.for(`yaml.document`),D=Symbol.for(`yaml.map`),ie=Symbol.for(`yaml.pair`),O=Symbol.for(`yaml.scalar`),k=Symbol.for(`yaml.seq`),A=Symbol.for(`yaml.node.type`),j=e=>!!e&&typeof e==`object`&&e[A]===re,ae=e=>!!e&&typeof e==`object`&&e[A]===E,oe=e=>!!e&&typeof e==`object`&&e[A]===D,M=e=>!!e&&typeof e==`object`&&e[A]===ie,N=e=>!!e&&typeof e==`object`&&e[A]===O,se=e=>!!e&&typeof e==`object`&&e[A]===k;function P(e){if(e&&typeof e==`object`)switch(e[A]){case D:case k:return!0}return!1}function F(e){if(e&&typeof e==`object`)switch(e[A]){case re:case D:case O:case k:return!0}return!1}var ce=e=>(N(e)||P(e))&&!!e.anchor,I=Symbol(`break visit`),le=Symbol(`skip children`),L=Symbol(`remove node`);function ue(e,t){let n=pe(t);ae(e)?de(null,e.contents,n,Object.freeze([e]))===L&&(e.contents=null):de(null,e,n,Object.freeze([]))}ue.BREAK=I,ue.SKIP=le,ue.REMOVE=L;function de(e,t,n,r){let i=me(e,t,n,r);if(F(i)||M(i))return he(e,r,i),de(e,i,n,r);if(typeof i!=`symbol`){if(P(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=de(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===I)return I;else i===L&&(t.items.splice(e,1),--e)}}else if(M(t)){r=Object.freeze(r.concat(t));let e=de(`key`,t.key,n,r);if(e===I)return I;e===L&&(t.key=null);let i=de(`value`,t.value,n,r);if(i===I)return I;i===L&&(t.value=null)}}return i}async function fe(e,t){let n=pe(t);ae(e)?await R(null,e.contents,n,Object.freeze([e]))===L&&(e.contents=null):await R(null,e,n,Object.freeze([]))}fe.BREAK=I,fe.SKIP=le,fe.REMOVE=L;async function R(e,t,n,r){let i=await me(e,t,n,r);if(F(i)||M(i))return he(e,r,i),R(e,i,n,r);if(typeof i!=`symbol`){if(P(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await R(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===I)return I;else i===L&&(t.items.splice(e,1),--e)}}else if(M(t)){r=Object.freeze(r.concat(t));let e=await R(`key`,t.key,n,r);if(e===I)return I;e===L&&(t.key=null);let i=await R(`value`,t.value,n,r);if(i===I)return I;i===L&&(t.value=null)}}return i}function pe(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function me(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(oe(t))return n.Map?.(e,t,r);if(se(t))return n.Seq?.(e,t,r);if(M(t))return n.Pair?.(e,t,r);if(N(t))return n.Scalar?.(e,t,r);if(j(t))return n.Alias?.(e,t,r)}function he(e,t,n){let r=t[t.length-1];if(P(r))r.items[e]=n;else if(M(r))e===`key`?r.key=n:r.value=n;else if(ae(r))r.contents=n;else{let e=j(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var ge={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},_e=e=>e.replace(/[!,[\]{}]/g,e=>ge[e]),z=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+_e(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&F(e.contents)){let t={};ue(e.contents,(e,n)=>{F(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
3
+ `)}};z.defaultYaml={explicit:!1,version:`1.2`},z.defaultTags={"!!":`tag:yaml.org,2002:`};function ve(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function ye(e){let t=new Set;return ue(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function be(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function xe(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=ye(e);let a=be(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(N(t.node)||P(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function Se(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Se(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Se(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Se(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Se(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function B(e,t,n){if(Array.isArray(e))return e.map((e,t)=>B(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!ce(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Ce=class{constructor(e){Object.defineProperty(this,A,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!ae(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=B(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Se(i,{"":o},``,o):o}},we=class extends Ce{constructor(e){super(re),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],ue(e,{Node:(e,t)=>{(j(t)||ce(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(B(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Te(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ve(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Te(e,t,n){if(j(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(P(t)){let r=0;for(let i of t.items){let t=Te(e,i,n);t>r&&(r=t)}return r}else if(M(t)){let r=Te(e,t.key,n),i=Te(e,t.value,n);return Math.max(r,i)}return 1}var Ee=e=>!e||typeof e!=`function`&&typeof e!=`object`,V=class extends Ce{constructor(e){super(O),this.value=e}toJSON(e,t){return t?.keep?this.value:B(this.value,e,t)}toString(){return String(this.value)}};V.BLOCK_FOLDED=`BLOCK_FOLDED`,V.BLOCK_LITERAL=`BLOCK_LITERAL`,V.PLAIN=`PLAIN`,V.QUOTE_DOUBLE=`QUOTE_DOUBLE`,V.QUOTE_SINGLE=`QUOTE_SINGLE`;var De=`tag:yaml.org,2002:`;function Oe(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function ke(e,t,n){if(ae(e)&&(e=e.contents),F(e))return e;if(M(e)){let t=n.schema[D].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new we(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=De+t.slice(2));let l=Oe(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new V(e);return c&&(c.node=t),t}l=e instanceof Map?o[D]:Symbol.iterator in Object(e)?o[k]:o[D]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new V(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Ae(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return ke(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var je=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Me=class extends Ce{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>F(t)||M(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(je(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(P(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Ae(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(P(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&N(i)?i.value:i:P(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!M(t))return!1;let n=t.value;return n==null||e&&N(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return P(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(P(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Ae(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Ne=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function H(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var U=(e,t,n)=>e.endsWith(`
4
+ `)?H(n,t):n.includes(`
5
+ `)?`
6
+ `+H(n,t):(e.endsWith(` `)?``:` `)+n,Pe=`flow`,Fe=`block`,Ie=`quoted`;function Le(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=Re(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
7
+ `)n===`block`&&(h=Re(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
8
+ `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
9
+ `&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function Re(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
10
+ `);r=t,i=t+1,a=e[i]}return r}var ze=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Be=e=>/^(%|---|\.\.\.)/m.test(e);function Ve(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
11
+ `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function He(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Be(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
12
+
13
+ `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
14
+ `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:Le(o,a,Ie,ze(t,!1))}function Ue(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
15
+ `)||/[ \t]\n|\n[ \t]/.test(e))return He(e,t);let n=t.indent||(Be(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:Le(r,n,Pe,ze(t,!1))}function W(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=He;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?Ue:i&&!t?He:n?Ue:He}return r(e,t)}var We;try{We=RegExp(`(^|(?<!
16
+ ))
17
+ +(?!
18
+ |$)`,`g`)}catch{We=/\n+(?!\n|$)/g}function Ge({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return W(n,r);let l=r.indent||(r.forceBlockIndent||Be(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===V.BLOCK_FOLDED?!1:t===V.BLOCK_LITERAL||!Ve(n,c,l.length);if(!n)return u?`|
19
+ `:`>
20
+ `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
21
+ `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
22
+ `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
23
+ `&&(p=p.slice(0,-1)),p.replace(We,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
24
+ `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
25
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=ze(r,!0);o!==`folded`&&t!==V.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=Le(`${v}${e}${p}`,l,Fe,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function Ke(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
26
+ `)||u&&/[[\]{},]/.test(a))return W(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
27
+ `)?W(a,t):Ge(e,t,n,r);if(!s&&!u&&i!==V.PLAIN&&a.includes(`
28
+ `))return Ge(e,t,n,r);if(Be(a)){if(c===``)return t.forceBlockIndent=!0,Ge(e,t,n,r);if(s&&c===l)return W(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return W(a,t)}return s?d:Le(d,c,Pe,ze(t,!1))}function qe(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==V.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=V.QUOTE_DOUBLE);let c=e=>{switch(e){case V.BLOCK_FOLDED:case V.BLOCK_LITERAL:return i||a?W(o.value,t):Ge(o,t,n,r);case V.QUOTE_DOUBLE:return He(o.value,t);case V.QUOTE_SINGLE:return Ue(o.value,t);case V.PLAIN:return Ke(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function Je(e,t){let n=Object.assign({blockQuote:!0,commentString:Ne,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Ye(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(N(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Xe(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(N(e)||P(e))&&e.anchor;a&&ve(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function Ze(e,t,n,r){if(M(e))return e.toString(t,n,r);if(j(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=F(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Ye(t.doc.schema.tags,a);let o=Xe(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):N(a)?qe(a,t,n,r):a.toString(t,n,r);return o?N(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Qe({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=F(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(P(e)||!F(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||P(e)||(N(e)?e.type===V.BLOCK_FOLDED||e.type===V.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Ze(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=U(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=U(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=U(g,n.indent,l(f))));let _,v,y;F(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&N(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&se(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Ze(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
29
+ `:``,v){let e=l(v);S+=`\n${H(e,n.indent)}`}x===``&&!n.inFlow?S===`
30
+ `&&y&&(S=`
31
+
32
+ `):S+=`\n${n.indent}`}else if(!p&&P(t)){let e=x[0],r=x.indexOf(`
33
+ `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
34
+ `)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=U(g,n.indent,l(y)):h&&i&&i(),g}function $e(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var et=`<<`,G={identify:e=>e===et||typeof e==`symbol`&&e.description===et,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new V(Symbol(et)),{addToJSMap:nt}),stringify:()=>et},tt=(e,t)=>(G.identify(t)||N(t)&&(!t.type||t.type===V.PLAIN)&&G.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===G.tag&&e.default);function nt(e,t,n){let r=it(e,n);if(se(r))for(let n of r.items)rt(e,t,n);else if(Array.isArray(r))for(let n of r)rt(e,t,n);else rt(e,t,r)}function rt(e,t,n){let r=it(e,n);if(!oe(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function it(e,t){return e&&j(t)?t.resolve(e.doc,e):t}function at(e,t,{key:n,value:r}){if(F(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(tt(e,n))nt(e,t,r);else{let i=B(n,``,e);if(t instanceof Map)t.set(i,B(r,i,e));else if(t instanceof Set)t.add(i);else{let a=ot(n,i,e),o=B(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function ot(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(F(e)&&n?.doc){let t=Je(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),$e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function st(e,t,n){return new K(ke(e,void 0,n),ke(t,void 0,n))}var K=class e{constructor(e,t=null){Object.defineProperty(this,A,{value:ie}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return F(n)&&(n=n.clone(t)),F(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return at(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Qe(this,e,t,n):JSON.stringify(this)}};function ct(e,t,n){return(t.inFlow??e.flow?ut:lt)(e,t,n)}function lt({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(F(i))!d&&i.spaceBefore&&f.push(``),dt(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(M(i)){let e=F(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),dt(n,f,e.commentBefore,d))}d=!1;let s=Ze(i,u,()=>o=null,()=>d=!0);o&&(s+=U(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
35
+ `}}return e?(p+=`
36
+ `+H(l(e),c),s&&s()):d&&o&&o(),p}function ut({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(F(i))i.spaceBefore&&d.push(``),dt(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(M(i)){let e=F(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),dt(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=F(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=Ze(i,c,()=>a=null);l||=d.length>u||o.includes(`
37
+ `),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=U(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
38
+ `;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function dt({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=H(t(r),e);n.push(i.trimStart())}}function q(e,t){let n=N(t)?t.value:t;for(let r of e)if(M(r)&&(r.key===t||r.key===n||N(r.key)&&r.key.value===n))return r}var J=class extends Me{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(D,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(st(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=M(e)?e:!e||typeof e!=`object`||!(`key`in e)?new K(e,e?.value):new K(e.key,e.value);let r=q(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);N(r.value)&&Ee(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=q(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=q(this.items,e)?.value;return(!t&&N(n)?n.value:n)??void 0}has(e){return!!q(this.items,e)}set(e,t){this.add(new K(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)at(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!M(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ct(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},ft={collection:`map`,default:!0,nodeClass:J,tag:`tag:yaml.org,2002:map`,resolve(e,t){return oe(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>J.from(e,t,n)},Y=class extends Me{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(k,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=pt(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=pt(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&N(r)?r.value:r}has(e){let t=pt(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=pt(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];N(r)&&Ee(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(B(e,String(r++),t));return n}toString(e,t,n){return e?ct(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(ke(a,void 0,n))}}return i}};function pt(e){let t=N(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var mt={collection:`seq`,default:!0,nodeClass:Y,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return se(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Y.from(e,t,n)},ht={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),qe(e,t,n,r)}},gt={identify:e=>e==null,createNode:()=>new V(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new V(null),stringify:({source:e},t)=>typeof e==`string`&&gt.test.test(e)?e:t.options.nullStr},_t={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new V(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&_t.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function X({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var vt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:X},yt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():X(e)}},bt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new V(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:X},xt=e=>typeof e==`bigint`||Number.isInteger(e),St=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Ct(e,t,n){let{value:r}=e;return xt(r)&&r>=0?n+r.toString(t):X(e)}var wt={identify:e=>xt(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>St(e,2,8,n),stringify:e=>Ct(e,8,`0o`)},Tt={identify:xt,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>St(e,0,10,n),stringify:X},Et={identify:e=>xt(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>St(e,2,16,n),stringify:e=>Ct(e,16,`0x`)},Dt=[ft,mt,ht,gt,_t,wt,Tt,Et,vt,yt,bt];function Ot(e){return typeof e==`bigint`||Number.isInteger(e)}var kt=({value:e})=>JSON.stringify(e),At=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:kt},{identify:e=>e==null,createNode:()=>new V(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:kt},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:kt},{identify:Ot,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Ot(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:kt}],jt=[ft,mt].concat(At,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),Mt={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=V.BLOCK_LITERAL,t!==V.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===V.BLOCK_LITERAL?`
39
+ `:` `)}return qe({comment:e,type:t,value:s},r,i,a)}};function Nt(e,t){if(se(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!M(r)){if(oe(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new K(new V(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=M(r)?r:new K(r)}}else t(`Expected a sequence for this tag`);return e}function Pt(e,t,n){let{replacer:r}=n,i=new Y(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(st(o,s,n))}return i}var Ft={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Nt,createNode:Pt},It=class e extends Y{constructor(){super(),this.add=J.prototype.add.bind(this),this.delete=J.prototype.delete.bind(this),this.get=J.prototype.get.bind(this),this.has=J.prototype.has.bind(this),this.set=J.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(M(e)?(r=B(e.key,``,t),i=B(e.value,r,t)):r=B(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Pt(e,t,n),i=new this;return i.items=r.items,i}};It.tag=`tag:yaml.org,2002:omap`;var Lt={collection:`seq`,identify:e=>e instanceof Map,nodeClass:It,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Nt(e,t),r=[];for(let{key:e}of n.items)N(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new It,n)},createNode:(e,t,n)=>It.from(e,t,n)};function Rt({value:e,source:t},n){return t&&(e?zt:Bt).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var zt={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new V(!0),stringify:Rt},Bt={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new V(!1),stringify:Rt},Vt={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:X},Ht={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():X(e)}},Ut={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new V(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:X},Wt=e=>typeof e==`bigint`||Number.isInteger(e);function Gt(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function Kt(e,t,n){let{value:r}=e;if(Wt(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return X(e)}var qt={identify:Wt,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Gt(e,2,2,n),stringify:e=>Kt(e,2,`0b`)},Jt={identify:Wt,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Gt(e,1,8,n),stringify:e=>Kt(e,8,`0`)},Yt={identify:Wt,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Gt(e,0,10,n),stringify:X},Xt={identify:Wt,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Gt(e,2,16,n),stringify:e=>Kt(e,16,`0x`)},Zt=class e extends J{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=M(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new K(e.key,null):new K(e,null),q(this.items,t.key)||this.items.push(t)}get(e,t){let n=q(this.items,e);return!t&&M(n)?N(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=q(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new K(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(st(e,null,n));return i}};Zt.tag=`tag:yaml.org,2002:set`;var Qt={collection:`map`,identify:e=>e instanceof Set,nodeClass:Zt,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>Zt.from(e,t,n),resolve(e,t){if(oe(e)){if(e.hasAllNullValues(!0))return Object.assign(new Zt,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function $t(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function en(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return X(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var tn={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>$t(e,n),stringify:en},nn={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>$t(e,!1),stringify:en},rn={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(rn.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=$t(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},an=[ft,mt,ht,gt,zt,Bt,qt,Jt,Yt,Xt,Vt,Ht,Ut,Mt,G,Lt,Ft,Qt,tn,nn,rn],on=new Map([[`core`,Dt],[`failsafe`,[ft,mt,ht]],[`json`,jt],[`yaml11`,an],[`yaml-1.1`,an]]),sn={binary:Mt,bool:_t,float:bt,floatExp:yt,floatNaN:vt,floatTime:nn,int:Tt,intHex:Et,intOct:wt,intTime:tn,map:ft,merge:G,null:gt,omap:Lt,pairs:Ft,seq:mt,set:Qt,timestamp:rn},cn={"tag:yaml.org,2002:binary":Mt,"tag:yaml.org,2002:merge":G,"tag:yaml.org,2002:omap":Lt,"tag:yaml.org,2002:pairs":Ft,"tag:yaml.org,2002:set":Qt,"tag:yaml.org,2002:timestamp":rn};function ln(e,t,n){let r=on.get(t);if(r&&!e)return n&&!r.includes(G)?r.concat(G):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(on.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(G)),i.reduce((e,t)=>{let n=typeof t==`string`?sn[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(sn).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var un=(e,t)=>e.key<t.key?-1:+(e.key>t.key),dn=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?ln(e,`compat`):e?ln(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?cn:{},this.tags=ln(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,D,{value:ft}),Object.defineProperty(this,O,{value:ht}),Object.defineProperty(this,k,{value:mt}),this.sortMapEntries=typeof a==`function`?a:a===!0?un:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function fn(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=Je(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(H(t,``))}let o=!1,s=null;if(e.contents){if(F(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(H(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=Ze(e.contents,i,()=>s=null,t);s&&(c+=U(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Ze(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=a(e.comment);t.includes(`
40
+ `)?(n.push(`...`),n.push(H(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(H(a(t),``)))}return n.join(`
41
+ `)+`
42
+ `}var pn=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,A,{value:E});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new z({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[A]:{value:E}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=F(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){mn(this.contents)&&this.contents.add(e)}addIn(e,t){mn(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=ye(this);e.anchor=!t||n.has(t)?be(t||`a`,n):t}return new we(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=xe(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=ke(e,l,p);return o&&P(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new K(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return mn(this.contents)?this.contents.delete(e):!1}deleteIn(e){return je(e)?this.contents==null?!1:(this.contents=null,!0):mn(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return P(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return je(e)?!t&&N(this.contents)?this.contents.value:this.contents:P(this.contents)?this.contents.getIn(e,t):void 0}has(e){return P(this.contents)?this.contents.has(e):!1}hasIn(e){return je(e)?this.contents!==void 0:P(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ae(this.schema,[e],t):mn(this.contents)&&this.contents.set(e,t)}setIn(e,t){je(e)?this.contents=t:this.contents==null?this.contents=Ae(this.schema,Array.from(e),t):mn(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new z({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new z({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new dn(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=B(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?Se(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return fn(this,e)}};function mn(e){if(P(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var hn=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},gn=class extends hn{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},_n=class extends hn{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},vn=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
43
+ `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function yn(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function bn(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
44
+ `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(bn(t.key)||bn(t.value))return!0}return!1;default:return!0}}function xn(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&bn(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Sn(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||N(e)&&N(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Cn=`All mapping items must start at the same column`;function wn({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??J)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=yn(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,Cn)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
45
+ `+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||bn(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,Cn);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&xn(r.indent,u,i),n.atKey=!1,Sn(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=yn(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&xn(r.indent,f,i),s=c.range[2];let l=new K(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
46
+ `+_.comment:g.comment=_.comment);let e=new K(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function Tn({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??Y)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=yn(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&xn(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function En(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var Dn=`Block collections are not allowed within flow collections`,On=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function kn({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?J:Y))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=yn(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
47
+ `+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&bn(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];M(t)&&(t=t.value??t.key),t.comment?t.comment+=`
48
+ `+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],On(m)&&i(r.range,`BLOCK_IN_FLOW`,Dn)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);On(f)&&i(g.range,`BLOCK_IN_FLOW`,Dn),n.atKey=!1;let _=yn(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?On(m)&&i(v.range,`BLOCK_IN_FLOW`,Dn):_.comment&&(g.comment?g.comment+=`
49
+ `+_.comment:g.comment=_.comment);let y=new K(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Sn(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new J(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=En(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
50
+ `+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function An(e,t,n,r,i,a){let o=n.type===`block-map`?wn(e,t,n,r,a):n.type===`block-seq`?Tn(e,t,n,r,a):kn(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function jn(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===J.tagName&&s===`map`||o===Y.tagName&&s===`seq`)return An(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),An(e,t,n,i,o)}let l=An(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=F(u)?u:new V(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function Mn(e,t,n){let r=t.offset,i=Nn(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?V.BLOCK_FOLDED:V.BLOCK_LITERAL,o=t.source?Pn(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
51
+ `.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
52
+ `;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===V.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
53
+ `):t.length>c||r[0]===` `?(f===` `?f=`
54
+ `:!p&&f===`
55
+ `&&(f=`
56
+
57
+ `),d+=f+t.slice(c)+r,f=`
58
+ `,p=!0):r===``?f===`
59
+ `?d+=`
60
+ `:f=`
61
+ `:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
62
+ `+o[e][0].slice(c);d[d.length-1]!==`
63
+ `&&(d+=`
64
+ `);break;default:d+=`
65
+ `}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function Nn({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function Pn(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function Fn(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=V.PLAIN,c=In(a,l);break;case`single-quoted-scalar`:s=V.QUOTE_SINGLE,c=Ln(a,l);break;case`double-quoted-scalar`:s=V.QUOTE_DOUBLE,c=zn(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=En(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function In(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),Rn(e)}function Ln(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),Rn(e.slice(1,-1)).replace(/''/g,`'`)}function Rn(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
66
+ `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
67
+ `,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
68
+ `?i+=a:a=`
69
+ `:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function zn(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
70
+ `))if(i===`
71
+ `){let{fold:t,offset:i}=Bn(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=Vn[i];if(a)n+=a;else if(i===`
72
+ `)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
73
+ `)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=Hn(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
74
+ `&&!(a===`\r`&&e[r+2]===`
75
+ `)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function Bn(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
76
+ `||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
77
+ `);)r===`
78
+ `&&(n+=`
79
+ `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var Vn={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
80
+ `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Hn(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function Un(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?Mn(e,t,r):Fn(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[O]:c?Wn(e.schema,i,c,n,r):t.type===`scalar`?Gn(e,i,t,r):e.schema[O];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=N(a)?a:new V(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new V(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Wn(e,t,n,r,i){if(n===`!`)return e[O];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[O])}function Gn({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[O];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[O];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function Kn(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var qn={composeNode:Jn,composeEmptyNode:Yn};function Jn(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Xn(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=Un(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=jn(qn,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Yn(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!N(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Yn(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=Un(e,{type:`scalar`,offset:Kn(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Xn({options:e},{offset:t,source:n,end:r},i){let a=new we(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=En(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Zn(e,t,{offset:n,start:r,value:i,end:a},o){let s=new pn(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=yn(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?Jn(c,i,l,o):Yn(c,l.end,r,null,l,o);let u=s.contents.range[2],d=En(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Qn(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function $n(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
81
+
82
+ `:`
83
+ `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var er=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Qn(e);r?this.warnings.push(new _n(i,t,n)):this.errors.push(new gn(i,t,n))},this.directives=new z({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=$n(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(P(i)&&!i.flow&&i.items.length>0){let e=i.items[0];M(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:$n(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Qn(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Zn(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new gn(Qn(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new gn(Qn(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=En(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new gn(Qn(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new pn(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},tr=Symbol(`break visit`),nr=Symbol(`skip children`),rr=Symbol(`remove item`);function ir(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),ar(Object.freeze([]),e,t)}ir.BREAK=tr,ir.SKIP=nr,ir.REMOVE=rr,ir.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},ir.parentCollection=(e,t)=>{let n=ir.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function ar(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=ar(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===tr)return tr;else r===rr&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function or(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
84
+ `:case`\r
85
+ `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function Z(e){switch(e){case void 0:case` `:case`
86
+ `:case`\r`:case` `:return!0;default:return!1}}var sr=new Set(`0123456789ABCDEFabcdef`),cr=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),lr=new Set(`,[]{}`),ur=new Set(` ,[]{}
87
+ \r `),dr=e=>!e||ur.has(e),fr=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
88
+ `||t===`\r`&&this.buffer[e+1]===`
89
+ `}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
90
+ `||!t&&!this.atEnd)return e+n+1}return t===`
91
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&Z(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
92
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&Z(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Z(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&Z(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(dr),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&Z(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(dr),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||Z(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
93
+ `,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
94
+ `,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>Z(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
95
+ `:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
96
+ `)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
97
+ `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
98
+ `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
99
+ `&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(Z(r)||e&&lr.has(r))break;t=n}else if(Z(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
100
+ `?(n+=1,r=`
101
+ `,i=this.buffer[n+1]):t=n),i===`#`||e&&lr.has(i))break;if(r===`
102
+ `){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&lr.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(dr),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(Z(n)||t&&lr.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!Z(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(cr.has(t))t=this.buffer[++e];else if(t===`%`&&sr.has(this.buffer[e+1])&&sr.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
103
+ `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
104
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},pr=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function Q(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function mr(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function hr(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function gr(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function _r(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function vr(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function yr(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!Q(t.start,`explicit-key-ind`)&&!Q(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,hr(t.value)?t.value.end?vr(t.value.end,t.sep):t.value.end=t.sep:vr(t.start,t.sep),delete t.sep)}var br=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new fr,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=or(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&yr(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&mr(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:mr(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=_r(gr(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
105
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
106
+ `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){vr(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(Q(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=_r(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Q(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(hr(t.key)&&!Q(t.sep,`newline`)){let e=_r(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Q(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!Q(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){vr(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||Q(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=_r(gr(t));yr(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
107
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
108
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=_r(gr(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=_r(gr(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function xr(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new pr||null,prettyErrors:t}}function Sr(e,t={}){let{lineCounter:n,prettyErrors:r}=xr(t),i=new br(n?.addNewLine),a=new er(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new gn(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(vn(e,n)),o.warnings.forEach(vn(e,n))),o}var Cr=[`task`,`run.id`,`role`,`workflow.name`,`step.id`,`project.root`,`worktree.root`,`handoff.path`,`file:docs/example.md`],wr=`file:<path>`,Tr=/(?:^\s*-\s*|\{\s*)id:\s*([^\s,}]+)/gm;function Er(e,t){if(e){for(let n of e.matchAll(Tr))t.add(n[1]);try{let n=Sr(e).toJS()?.rules;if(Array.isArray(n))for(let e of n)t.add(e?.id)}catch{}}}function Dr(e,t=``){let n=new Set;if(Er(e,n),Er(t,n),!n.has(`new-rule`))return`new-rule`;let r=2;for(;n.has(`new-rule-${r}`);)r++;return`new-rule-${r}`}var Or=`Text for every session.`;function kr(e,t){return[`${t}- id: ${e}`,`${t} on: session_start`,`${t} target: both`,`${t} template: |`,`${t} ${Or}`].join(`
109
+ `)}function $(e,t,n){return{text:e+t+n,select:[e.length,e.length+t.length]}}function Ar(e){return kr(`x`,e).slice(e.length+1+6)}function jr(){return[`[{ id: `,`, on: session_start, target: both, template: "${Or}" }]`]}function Mr(e,t,n,r,i){let[a,o]=jr();if(n?.range&&n.range[1]>n.range[0])return $(`${e.slice(0,n.range[0])}${a}`,i,o+e.slice(n.range[1]));let s=e.indexOf(`:`,t)+1;if(r)return $(`${e.slice(0,s)} ${a}`,i,o+e.slice(s));let c=e.lastIndexOf(`
110
+ `,t-1)+1,l=e.indexOf(`
111
+ `,t),u=e.slice(c,t);return $(`${l===-1?`${e}\n`:e.slice(0,l+1)}${u} - id: `,i,Ar(`${u} `)+(l===-1?`
112
+ `:e.slice(l)))}function Nr(e,t,n,r){let i=n?.range?n.range[1]:e.indexOf(`[`,t)+1;return $(`${e.slice(0,i)}${n?`, `:``}{ id: `,r,`, on: session_start, target: both, template: "${Or}" }${e.slice(i)}`)}function Pr(e,t,n,r){let i=e.lastIndexOf(`
113
+ `,t-1)+1,a=/^[ \t]*/.exec(e.slice(i))[0],o=e.slice(0,n);return o.endsWith(`
114
+ `)?$(`${o}${a}- id: `,r,`${Ar(a)}\n${e.slice(n)}`):$(`${o}\n${a}- id: `,r,Ar(a)+e.slice(n))}function Fr(e,t,n,r){let i=e.lastIndexOf(`}`,t),[a,o]=jr();return $(`${e.slice(0,i).replace(/\s*$/,``)}${n?`, `:``}rules: ${a}`,r,o+e.slice(i))}function Ir(e,t){let n=e.endsWith(`
115
+ `)?e:`${e}\n`;return/^rules:/m.test(n)||(n+=`rules:
116
+ `),$(`${n} - id: `,t,`${Ar(` `)}\n`)}function Lr(e,t,n){if(!se(t)||!t.range)return;let r=t.items.at(-1);if(t.flow)return Nr(e,t.range[0],r,n);let i=t.items[0]?.range?.[0];return i===void 0?void 0:Pr(e,i,t.range[1],n)}function Rr(e,t=``){let n=Dr(e,t);if(e.trim()===``)return Ir(`version: 1
117
+ `,n);let r=Sr(e),i=r.errors.length===0&&oe(r.contents)?r.contents:void 0,a=i?.items.find(e=>N(e.key)&&e.key.value===`rules`),o=a?.value,s=N(a?.key)?a.key.range?.[0]:void 0;return s!==void 0&&(o===null||N(o)&&o.value===null)?Mr(e,s,o,i?.flow===!0,n):Lr(e,o,n)||(!a&&i?.flow&&i.range?Fr(e,i.range[1],i.items.length>0,n):Ir(e,n))}function zr(e,t,n,r){let i=`{{${r}}}`,a=e.slice(0,t)+i+e.slice(n);if(r.startsWith(`file:`)){let e=t+7;return{text:a,select:[e,e+r.length-5]}}let o=t+i.length;return{text:a,select:[o,o]}}function Br(e,t){let n=0;for(let r=1;r<t;r++){let t=e.indexOf(`
118
+ `,n);if(t===-1)return[e.length,e.length];n=t+1}let r=e.indexOf(`
119
+ `,n);return[n,r===-1?e.length:r]}var Vr=`https://github.com/hearsay-tools/squawk/blob/main/docs/context-injection.md`;function Hr(){let e=o();return(0,y.jsxs)(`div`,{"data-slot":`session-context`,className:`flex flex-col gap-4 p-4 md:p-6`,children:[(0,y.jsx)(Ur,{}),e.data===void 0?e.isError?(0,y.jsx)(f,{icon:(0,y.jsx)(m,{}),tone:`danger`,title:`Session context did not load`,subtitle:e.error.message,heading:`h2`,actions:(0,y.jsx)(u,{variant:`outline`,onClick:()=>void e.refetch(),children:`Try again`})}):(0,y.jsx)(Wr,{}):(0,y.jsxs)(y.Fragment,{children:[e.isError&&(0,y.jsxs)(`p`,{"data-slot":`session-context-reload-error`,role:`alert`,className:`text-[13px] text-danger`,children:[`Could not read session context again: `,e.error.message]}),(0,y.jsx)(qr,{state:e.data,refetch:()=>e.refetch()},e.data.local.path)]})]})}function Ur(){return(0,y.jsx)(`div`,{"data-slot":`session-context-handoff`,className:`flex items-start gap-3 rounded-lg border border-border bg-card p-3`,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Handoff block`}),(0,y.jsx)(d,{variant:`outline`,className:`border-accent-strong/40 text-[11px] text-link-foreground`,children:`Built in · always first`})]}),(0,y.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Each task’s own handoff file: Goal, Progress log and Resume notes. It needs no setup and cannot be turned off. Shared and local rules come after it.`})]})})}function Wr(){return(0,y.jsxs)(`div`,{"data-slot":`session-context-loading`,"aria-busy":`true`,"aria-label":`Loading session context`,className:`grid gap-4 md:grid-cols-[minmax(0,1.15fr)_minmax(0,1fr)]`,children:[(0,y.jsx)(p,{className:`h-[420px] rounded-lg`}),(0,y.jsx)(p,{className:`h-[420px] rounded-lg max-md:hidden`})]})}function Gr(e,t=250){let[n,r]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Kr(e,t,n){let[r,o]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),d=(0,_.useRef)(r);d.current=r;let f=t=>{u(t=>t??{version:e.version}),o(t)},[p,m]=(0,_.useState)(`parent`),[g,v]=(0,_.useState)(`edit`),[y,b]=(0,_.useState)(`local`),[x,S]=(0,_.useState)(null),[C,ee]=(0,_.useState)(!1),w=(0,_.useRef)(null),[te,ne]=(0,_.useState)(null),T=r??e.content,re=T!==e.content;h(re);let E=Gr(T),D=s(E,p,`${t.path}|${t.exists?`1`:`0`}|${t.unreadableReason??``}|${t.content}`),ie=D.data!==void 0&&!D.isPlaceholderData&&!D.isError&&E===T,O=D.isError&&!D.isFetching&&E===T?D.error.message:null,k=(0,_.useMemo)(()=>D.data?.problems??[],[D.data]),A=c();(0,_.useLayoutEffect)(()=>{!te||!w.current||(w.current.focus(),w.current.setSelectionRange(te[0],te[1]),ne(null))},[te]);let j=e=>{f(e.text),b(`local`),v(`edit`),ne(e.select)};return{localStarted:e.exists||r!==null,content:T,dirty:re,setDraft:f,role:p,setRole:m,pane:g,setPane:v,scope:y,setScope:b,failure:x,showDisk:C,toggleDisk:()=>ee(e=>!e),inputRef:w,preview:D.data,current:ie,problems:k,previewError:O,retryPreview:()=>void D.refetch(),saving:A.isPending,edit:j,insert:e=>{let t=w.current;j(zr(T,t?.selectionStart??T.length,t?.selectionEnd??T.length,e))},goToLine:e=>{b(`local`),v(`edit`),ne(Br(T,e))},discard:()=>{o(null),u(null),S(null)},save:(t=!1)=>{let r=t||l===null?e.version:l.version;S(null);let s=T;A.mutate({content:s,version:r},{onSuccess:e=>{let t=d.current!==null&&d.current!==s;o(t?d.current:null),u(t?{version:e.local.version}:null),ee(!1),a(`Saved ${e.local.path}`)},onError:e=>{let t=e instanceof i&&e.status===409;S({kind:t?`conflict`:`error`,message:e.message}),t&&n()}})}}}function qr({state:e,refetch:t}){let{local:n,shared:i}=e,a=Kr(n,i,t),{content:o,problems:s,current:c}=a,l=n.writable,d=(0,_.useMemo)(()=>new Set(s.flatMap(e=>e.line===null?[]:[e.line])),[s]);return!a.localStarted&&!i.exists?(0,y.jsx)(ui,{localPath:n.path,sharedPath:i.path,readOnlyReason:n.readOnlyReason,onAdd:l?()=>a.edit(Rr(``,i.content)):void 0}):(0,y.jsxs)(`div`,{"data-slot":`session-context-editor`,"data-reports-dirty":``,className:`flex flex-col gap-4`,children:[!l&&a.scope===`local`&&(0,y.jsx)(li,{reason:n.readOnlyReason}),a.failure&&l&&(0,y.jsx)(ci,{failure:a.failure,showDisk:a.showDisk,onShowDisk:a.toggleDisk,onOverwrite:()=>a.save(!0)}),a.showDisk&&(0,y.jsx)(ri,{content:n.content}),a.previewError&&(0,y.jsxs)(`div`,{"data-slot":`session-context-preview-error`,role:`alert`,className:`flex flex-wrap items-center gap-3 rounded-lg border border-danger/45 bg-danger/10 p-3 text-[13px]`,children:[(0,y.jsxs)(`span`,{className:`mr-auto`,children:[`The preview failed: `,a.previewError,`. Save stays off until the draft is checked.`]}),(0,y.jsx)(u,{variant:`outline`,onClick:a.retryPreview,children:`Check again`})]}),s.length>0&&(0,y.jsx)(oi,{problems:s,onLine:a.goToLine}),(0,y.jsx)(ni,{pane:a.pane,onPane:a.setPane}),(0,y.jsxs)(`div`,{className:`grid items-start gap-4 md:grid-cols-[minmax(0,1.15fr)_minmax(0,1fr)]`,children:[(0,y.jsxs)(`section`,{id:ti.edit,"data-slot":`session-context-file`,"aria-label":`Session context rules`,className:r(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,a.pane!==`edit`&&`max-md:hidden`),children:[(0,y.jsx)(Xr,{scope:a.scope,onScope:a.setScope,dirty:a.dirty,shared:i}),a.scope===`local`?(0,y.jsx)(Zr,{file:n,sharedPath:i.path,started:a.localStarted,content:o,dirty:a.dirty,problems:s.length,current:c,previewFailed:a.previewError!==null,marked:d,inputRef:a.inputRef,onDraft:a.setDraft,onAdd:()=>a.edit(Rr(o,i.content)),onInsert:a.insert}):(0,y.jsx)($r,{shared:i,onOpenLocal:()=>a.setScope(`local`)})]}),(0,y.jsx)(ee,{id:ti.preview,preview:a.preview,role:a.role,onRole:a.setRole,pending:!c,className:r(a.pane!==`preview`&&`max-md:hidden`)})]}),(a.localStarted||a.dirty)&&(0,y.jsx)(ii,{localPath:n.path,writable:l,hasProblems:s.length>0,dirty:a.dirty,saving:a.saving,canSave:l&&a.dirty&&!a.saving&&c&&s.length===0,onDiscard:a.discard,onSave:()=>a.save()})]})}var Jr=[`local`,`shared`],Yr={local:`session-context-local-panel`,shared:`session-context-shared-panel`};function Xr({scope:e,onScope:t,dirty:n,shared:i}){let a=(0,_.useRef)(new Map);return(0,y.jsx)(`div`,{role:`tablist`,"aria-label":`Context rule layer`,onKeyDown:n=>{let r=v(Jr,e,n.key);r!==void 0&&(n.preventDefault(),t(r),a.current.get(r)?.focus())},className:`flex border-b border-border bg-muted/30`,children:Jr.map(o=>{let s=e===o;return(0,y.jsxs)(`button`,{ref:e=>{e?a.current.set(o,e):a.current.delete(o)},type:`button`,role:`tab`,tabIndex:s?0:-1,"aria-selected":s,"aria-controls":Yr[o],"data-slot":`session-context-scope`,"data-scope":o,onClick:()=>t(o),className:r(`flex min-h-11 flex-1 items-center justify-center gap-2 border-b-2 border-transparent px-3 py-3 text-[13px] leading-5 font-medium text-muted-foreground focus-visible:outline-2 focus-visible:outline-ring`,s&&`border-accent-strong bg-card text-foreground`),children:[(0,y.jsx)(`span`,{children:o===`local`?`Local`:`Shared`}),o===`local`&&n&&(0,y.jsx)(`span`,{className:`text-[11px] text-conflict`,children:`· Unsaved`}),o===`shared`&&i.tracked&&(0,y.jsx)(`span`,{className:`text-[11px] text-soft-foreground`,children:`· Tracked`})]},o)})})}function Zr(e){let{file:t,started:n,content:r}=e,i=t.writable;return(0,y.jsxs)(`div`,{id:Yr.local,role:`tabpanel`,className:`flex flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border p-3`,children:[(0,y.jsx)(`code`,{className:`font-mono text-[12px] break-all`,children:t.path}),(0,y.jsx)(d,{variant:`outline`,className:`text-[11px]`,children:`Gitignored · local`}),n&&(0,y.jsx)(ai,{problems:e.problems,current:e.current,failed:e.previewFailed,dirty:e.dirty}),i&&n&&(0,y.jsxs)(u,{"data-slot":`session-context-add-rule`,variant:`outline`,className:`ml-auto min-h-11`,onClick:e.onAdd,children:[(0,y.jsx)(l,{}),` Add rule`]})]}),n?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(g,{value:r,onChange:i?e.onDraft:void 0,readOnly:!i,language:`yaml`,markedLines:e.marked,inputRef:e.inputRef,"aria-label":`context.local.yaml rules`,className:`h-[420px] rounded-none border-0`}),i&&(0,y.jsx)(si,{onInsert:e.onInsert})]}):(0,y.jsxs)(`div`,{"data-slot":`session-context-local-empty`,className:`flex flex-col items-start gap-3 p-4`,children:[(0,y.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No local rules yet. Local rules live in `,(0,y.jsx)(`code`,{className:`font-mono text-[12px] text-foreground`,children:t.path}),` (auto-ignored by Git) and run after shared rules from `,(0,y.jsx)(`code`,{className:`font-mono text-[12px] text-foreground`,children:e.sharedPath}),`. Reuse a shared rule’s `,(0,y.jsx)(`code`,{className:`font-mono text-[12px] text-foreground`,children:`id`}),` to replace it locally, or set `,(0,y.jsx)(`code`,{className:`font-mono text-[12px] text-foreground`,children:`enabled: false`}),` to mute it.`]}),i&&(0,y.jsxs)(u,{"data-slot":`session-context-add-rule`,className:`min-h-11`,onClick:e.onAdd,children:[(0,y.jsx)(l,{}),` Add a local rule`]})]})]})}function Qr({shared:e}){return e.exists?e.tracked?(0,y.jsx)(d,{"data-slot":`session-context-shared-status`,variant:`outline`,className:`border-accent-strong/40 text-[11px] text-link-foreground`,children:`Tracked in Git`}):(0,y.jsx)(d,{"data-slot":`session-context-shared-status`,variant:`outline`,className:`text-[11px]`,children:`Untracked · repo file`}):(0,y.jsx)(d,{"data-slot":`session-context-shared-status`,variant:`outline`,className:`text-[11px]`,children:`Not in repo`})}function $r({shared:e,onOpenLocal:t}){return(0,y.jsxs)(`div`,{id:Yr.shared,role:`tabpanel`,"data-slot":`session-context-shared`,className:`flex flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border p-3`,children:[(0,y.jsx)(`code`,{className:`font-mono text-[12px] break-all`,children:e.path}),(0,y.jsx)(Qr,{shared:e}),(0,y.jsx)(d,{variant:`outline`,className:`text-[11px]`,children:`Read only`})]}),(0,y.jsx)(`p`,{"data-slot":`session-context-shared-note`,className:`border-b border-border bg-muted/30 px-3 py-2 text-[12px] text-muted-foreground`,children:`Shared team rules are versioned in Git and read only here. To replace or mute a rule on this host without dirtying Git, add a rule with the same id in Local.`}),e.unreadableReason?(0,y.jsx)(`div`,{className:`p-3`,children:(0,y.jsx)(li,{reason:e.unreadableReason})}):e.exists?(0,y.jsx)(g,{value:e.content,language:`yaml`,readOnly:!0,"aria-label":`context.yaml shared rules`,className:`h-[420px] rounded-none border-0`}):(0,y.jsxs)(`div`,{className:`flex flex-col items-start gap-3 p-4`,children:[(0,y.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`This repository has no shared `,(0,y.jsx)(`code`,{className:`font-mono text-[12px] text-foreground`,children:e.path}),` yet. Commit one to share team rules across contributors, or add host-only rules in Local.`]}),(0,y.jsx)(u,{variant:`outline`,className:`min-h-11`,onClick:t,children:`Edit Local rules`})]})]})}var ei=[`edit`,`preview`],ti={edit:`session-context-edit-panel`,preview:`session-context-preview-panel`};function ni({pane:e,onPane:t}){let n=(0,_.useRef)(new Map);return(0,y.jsx)(`div`,{role:`tablist`,"aria-label":`Session context view`,onKeyDown:r=>{let i=v(ei,e,r.key);i!==void 0&&(r.preventDefault(),t(i),n.current.get(i)?.focus())},className:`flex overflow-hidden rounded-md border border-[var(--control-border)] md:hidden`,children:ei.map(i=>(0,y.jsx)(`button`,{ref:e=>{e?n.current.set(i,e):n.current.delete(i)},type:`button`,tabIndex:e===i?0:-1,"aria-controls":ti[i],role:`tab`,"data-slot":`session-context-pane`,"data-pane":i,"aria-selected":e===i,onClick:()=>t(i),className:r(`min-h-11 flex-1 text-[13px] capitalize text-muted-foreground`,e===i&&`bg-muted text-foreground`),children:i},i))})}function ri({content:e}){return(0,y.jsxs)(`div`,{"data-slot":`session-context-disk`,className:`flex flex-col gap-2`,children:[(0,y.jsx)(`h3`,{className:`text-sm font-semibold`,children:`On disk now`}),(0,y.jsx)(g,{value:e,language:`yaml`,readOnly:!0,"aria-label":`context.local.yaml on disk`,className:`h-[200px]`})]})}function ii(e){return(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-3`,children:[(0,y.jsx)(`p`,{"data-slot":`session-context-note`,className:`mr-auto text-[12px] text-soft-foreground`,children:e.hasProblems?`Save is off while the file has problems.`:`Applies from the next session launch. Saved to ${e.localPath} (gitignored; does not dirty Git).`}),e.writable&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(u,{variant:`outline`,className:`min-h-11`,disabled:!e.dirty||e.saving,onClick:e.onDiscard,children:`Discard changes`}),(0,y.jsx)(u,{"data-slot":`session-context-save`,className:`min-h-11`,disabled:!e.canSave,onClick:e.onSave,children:e.saving?`Saving…`:`Save`})]})]})}function ai({problems:e,current:t,failed:n,dirty:r}){return(0,y.jsxs)(`span`,{className:`flex flex-wrap gap-1.5`,"aria-live":`polite`,children:[t&&e>0&&(0,y.jsxs)(d,{variant:`outline`,className:`border-danger/45 text-[11px] text-danger`,children:[e,` `,e===1?`problem`:`problems`]}),t&&e===0&&(0,y.jsx)(d,{variant:`outline`,className:`border-success/40 text-[11px] text-success`,children:`Valid`}),!t&&!n&&(0,y.jsx)(d,{variant:`outline`,className:`text-[11px]`,children:`Checking…`}),n&&(0,y.jsx)(d,{variant:`outline`,className:`border-danger/45 text-[11px] text-danger`,children:`Not checked`}),r&&(0,y.jsx)(d,{variant:`outline`,className:`border-conflict/50 text-[11px] text-conflict`,children:`Unsaved`})]})}function oi({problems:e,onLine:t}){return(0,y.jsxs)(`div`,{"data-slot":`session-context-problems`,role:`alert`,className:`rounded-lg border border-danger/45 bg-danger/10 p-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsxs)(`h3`,{className:`text-sm font-semibold text-danger`,children:[e.length,` `,e.length===1?`problem`:`problems`,`: fix `,e.length===1?`it`:`them`,` to save`]}),(0,y.jsx)(`span`,{className:`ml-auto text-[12px] text-soft-foreground`,children:`Your draft is kept until you save or discard it.`})]}),(0,y.jsx)(`ul`,{className:`mt-1.5 flex flex-col`,children:e.map((e,n)=>(0,y.jsxs)(`li`,{className:`text-[13px] leading-6`,children:[e.line!==null&&(0,y.jsxs)(`button`,{type:`button`,"data-slot":`session-context-line`,onClick:()=>t(e.line),className:`inline-flex min-h-11 items-center align-middle text-link-foreground underline-offset-2 hover:underline focus-visible:outline-2 focus-visible:outline-ring md:min-h-8`,children:[`Line `,e.line]}),e.line!==null&&(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`text-soft-foreground`,children:` · `}),e.rule!==null&&(0,y.jsxs)(`span`,{className:`text-muted-foreground`,children:[`rule `,e.rule,`: `]}),(0,y.jsx)(`span`,{"data-slot":`session-context-problem`,children:e.message})]},n))})]})}function si({onInsert:e}){return(0,y.jsxs)(`div`,{"data-slot":`session-context-tokens`,className:`flex flex-col gap-2 border-t border-border p-3`,children:[(0,y.jsx)(`span`,{id:`session-context-tokens`,className:`text-[12px] text-soft-foreground`,children:`Insert a variable`}),(0,y.jsx)(`div`,{role:`group`,"aria-labelledby":`session-context-tokens`,className:`flex flex-wrap gap-1.5`,children:Cr.map(t=>(0,y.jsx)(`button`,{type:`button`,onClick:()=>e(t),className:`min-h-8 rounded-md bg-muted px-2 font-mono text-[12px] text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring pointer-coarse:min-h-11`,children:`{{${t.startsWith(`file:`)?wr:t}}}`},t))})]})}function ci({failure:e,showDisk:t,onShowDisk:n,onOverwrite:r}){return(0,y.jsxs)(`div`,{"data-slot":`session-context-save-failure`,role:`alert`,className:`rounded-lg border border-danger/45 bg-danger/10 p-3`,children:[(0,y.jsx)(`h3`,{className:`text-sm font-semibold text-danger`,children:e.kind===`conflict`?`Not saved: the file changed on disk`:`Not saved`}),(0,y.jsxs)(`p`,{className:`mt-1 text-[13px] text-muted-foreground`,children:[e.message,` Your draft is still here.`]}),e.kind===`conflict`&&(0,y.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,y.jsx)(u,{variant:`outline`,className:`min-h-11`,onClick:n,children:t?`Hide the disk version`:`Show the disk version`}),(0,y.jsx)(u,{variant:`outline`,className:`min-h-11`,onClick:r,children:`Overwrite it`})]})]})}function li({reason:e}){return(0,y.jsxs)(`div`,{"data-slot":`session-context-readonly`,className:`rounded-md border border-border bg-muted/40 px-3 py-2 text-[13px] text-muted-foreground`,children:[`Read only. `,e]})}function ui({localPath:e,sharedPath:t,readOnlyReason:n,onAdd:r}){return(0,y.jsx)(`div`,{"data-slot":`session-context-empty`,className:`rounded-lg border border-border bg-card`,children:(0,y.jsx)(f,{icon:(0,y.jsx)(m,{}),title:`No project rules yet`,heading:`h2`,subtitle:`Every session already starts with its handoff block. Commit shared team rules in ${t}, or add host-local rules in ${e} (gitignored; overrides shared rules with the same id).`,actions:(0,y.jsxs)(y.Fragment,{children:[r&&(0,y.jsx)(u,{className:`min-h-11`,onClick:r,children:`Add a local rule`}),(0,y.jsx)(u,{variant:`outline`,className:`min-h-11`,asChild:!0,children:(0,y.jsx)(`a`,{href:Vr,target:`_blank`,rel:`noreferrer`,children:`How rules work`})})]}),children:n&&(0,y.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`Read only. `,n]})})})}export{Hr as SessionContextSection};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{c as i,m as a,u as o}from"./live-reads-Crd6fVGH.js";import{Cr as s,Ln as c,Pn as l,pi as u,ti as d}from"./project-scope-context-Rv6S_BXt.js";import{Qt as f,Vt as p,vt as m}from"./queries-qCF-eOqZ.js";import{it as h,l as g}from"./design-icons-CzEoMH9c.js";import{t as _}from"./button-B7MKxYjT.js";import{a as v,i as y,o as b,r as x,s as S,t as C}from"./dialog-B531GGAo.js";import{Wn as w}from"./index-CvVmG4Yu.js";var T=e(t(),1),E=n();function D(e,t){return i(t).flatMap(t=>{let n=e.filter(e=>e.provider===t.id);return n.length<2?[{runner:t,account:null,label:t.pickerLabel,desc:t.pickerDescription,missing:!1}]:n.map(e=>({runner:t,account:e.isDefault?null:e.id,label:`${t.pickerLabel} · ${e.label}`,desc:e.configDir?e.exists?e.configDir:`${e.configDir} — folder not created yet`:e.exists?``:`Not initialized on host yet`,missing:!e.exists,...e.isDefault||e.status===void 0?{}:{accountStatus:e.status.status}}))})}var O=(e,t)=>e.length>o(t).length;function k(e,t,n){let r=s(e.data,t),i=r!==void 0&&r.status!==`not-installed`&&(n??r.status)===`connected`,a=!e.isPending&&!e.isError&&r?.enabled===!0&&i;return{providerConnected:a,providerReason:e.isPending?`Checking provider authentication…`:e.isError?`Provider authentication could not be verified.`:r?.enabled===!1?`This provider is disabled. Enable it above or choose another provider.`:a?void 0:`Connect this provider before selecting it.`}}function A({rows:e,runner:t,accountFor:n,providerStatus:i,disabled:o=!1,accountDisabled:s=!1,onPick:c}){let l=a().data,u=l===void 0,d=O(e,l);return(0,E.jsx)(`div`,{role:`radiogroup`,"aria-label":`Default runner`,"data-slot":`agents-runner`,className:r(`gap-0.5 rounded-md border border-border bg-card p-0.5`,d?`flex max-w-md flex-col`:`inline-flex w-fit`),children:e.map(a=>{let{providerConnected:l,providerReason:f}=k(i,a.runner.id,a.accountStatus),p=e.filter(e=>e.runner.id===a.runner.id).length>1,m=a.runner.id===t&&a.account===n(a.runner.id);return(0,E.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":m,"data-value":a.runner.id,"data-account":a.account??``,title:f??a.desc,disabled:o||u||!l||p&&s,onClick:()=>c(a.runner.id,a.account,p),className:r(`rounded-sm px-3 py-1.5 text-left font-mono text-[13px] font-medium transition-colors disabled:opacity-50`,m?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:[a.label,d?(0,E.jsx)(`span`,{"data-slot":a.missing?`agents-account-missing`:`agents-account-dir`,"data-runner":a.runner.id,className:`ml-2 font-sans text-[11px] text-soft-foreground`,children:a.desc}):null]},`${a.runner.id}:${a.account??``}`)})})}async function j(e,t){return c(await l.api.v1.providers[`sign-in`].start.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/sign-in/start`)}async function M(e){return c(await l.api.v1.providers[`sign-in`][`:id`].$get({param:{id:e}}),`/providers/sign-in/:id`)}async function N(e,t){return c(await l.api.v1.providers[`sign-in`][`:id`].redirect.$post({param:{id:e},json:{redirectUrl:t}}),`/providers/sign-in/:id/redirect`)}async function P(e){return c(await l.api.v1.providers[`sign-in`][`:id`].$delete({param:{id:e}}),`/providers/sign-in/:id`)}function F(e,t){let n=u(),[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(null),[s,c]=(0,T.useState)(``),l=(0,T.useRef)(null),m=(0,T.useRef)(!0),h=(0,T.useRef)(0),g=()=>{h.current++,v.current=!1;let e=l.current;l.current=null,e?.state===`waiting`&&P(e.id).catch(()=>{}),o(null),c(``),i(!1)};(0,T.useEffect)(()=>(m.current=!0,()=>{m.current=!1,h.current++;let e=l.current;e?.state===`waiting`&&P(e.id).catch(()=>{})}),[]);let _=f({mutationFn:n=>j(e,t).then(e=>({result:e,generation:n})),retry:!1,onSuccess:({result:e,generation:t})=>{if(!m.current||!v.current||t!==h.current){P(e.id).catch(()=>{});return}l.current=e,o(e)}}),v=(0,T.useRef)(r);v.current=r;let y=d({queryKey:[`browser-sign-in`,a?.id],queryFn:()=>M(a.id),enabled:r&&a?.state===`waiting`,retry:!1,refetchInterval:e=>e.state.error||e.state.data?.state&&e.state.data.state!==`waiting`?!1:1e3,gcTime:0}),b=y.data??a,x=f({mutationFn:()=>N(a.id,s),retry:!1,onSuccess:()=>{c(``),y.refetch()}});return(0,T.useEffect)(()=>{b?.state===`connected`&&(l.current=b,o(b),Promise.all([n.invalidateQueries({queryKey:p.agentProfiles}),n.invalidateQueries({queryKey:p.providerStatus}),n.invalidateQueries({queryKey:p.models(e)})]))},[b,n,e]),{open:r,result:b,redirect:s,setRedirect:c,start:_,replay:x,status:y,error:_.error??x.error??y.error,close:g,connect:()=>{i(!0),v.current=!0,_.reset(),x.reset(),_.mutate(++h.current)}}}function I(){return`Open the sign-in link in your browser. After Google consent, the page shows a code. Copy that code, or the full address of that page, and paste it below.`}function L({provider:e,profileId:t,label:n}){let{open:r,result:i,redirect:a,setRedirect:o,start:s,replay:c,status:l,error:u,close:d,connect:f}=F(e,t);return m().data?.capabilities?.settingsAdmin===!0?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(_,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:s.isPending,onClick:f,children:`Connect`}),(0,E.jsx)(C,{open:r,onOpenChange:e=>{e||d()},children:(0,E.jsxs)(x,{children:[(0,E.jsxs)(b,{children:[(0,E.jsxs)(S,{children:[`Sign in to `,n]}),(0,E.jsx)(y,{children:`Use a personal Google account. Business and agent-platform sign-in are not supported.`})]}),s.isPending?(0,E.jsx)(`p`,{role:`status`,children:`Preparing sign-in…`}):null,i?.state===`waiting`?(0,E.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,E.jsx)(`a`,{href:i.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-action underline`,children:`Open Google sign-in`}),(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,E.jsx)(I,{})}),(0,E.jsxs)(`label`,{className:`grid gap-2`,children:[`Code or page address`,(0,E.jsx)(w,{type:`text`,autoComplete:`off`,spellCheck:!1,value:a,onChange:e=>o(e.target.value)})]}),(0,E.jsx)(_,{disabled:!a.trim()||c.isPending,onClick:()=>c.mutate(),children:`Complete sign-in`})]}):null,i?.state===`connected`?(0,E.jsx)(`p`,{role:`status`,children:`Connected.`}):null,i?.state===`failed`?(0,E.jsx)(`p`,{role:`alert`,children:i.error}):null,i?.state===`cancelled`?(0,E.jsx)(`p`,{role:`status`,children:`Sign-in cancelled. Close this window and Connect again.`}):null,u?(0,E.jsx)(`p`,{role:`alert`,children:u.message}):null,l.isError&&i?.state===`waiting`?(0,E.jsx)(_,{onClick:()=>void l.refetch(),children:`Retry status`}):null,(0,E.jsx)(v,{children:(0,E.jsx)(_,{variant:`outline`,onClick:d,children:i?.state===`connected`?`Done`:`Cancel`})})]})})]}):null}function R(e){let t=e.label.startsWith(e.runner.pickerLabel)?e.label.slice(e.runner.pickerLabel.length):``;return{...e,label:`${e.runner.displayName}${t}`}}function z(e){let t=(0,T.useRef)(null),n=e.rows.map(R),r=n.find(t=>t.runner.id===e.runner&&t.account===e.accountFor(t.runner.id)),i=n.find(t=>t.runner.id===e.runner)?.runner.displayName;return(0,E.jsxs)(`details`,{ref:t,className:`settings-agent-picker`,children:[(0,E.jsxs)(`summary`,{children:[(0,E.jsx)(h,{"aria-hidden":`true`,className:`size-4 text-accent-text`}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1`,children:r?.label??i??e.runner}),(0,E.jsx)(g,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})]}),(0,E.jsx)(A,{...e,rows:n,onPick:(...n)=>{e.onPick(...n),t.current&&(t.current.open=!1)}})]})}export{k as a,O as i,L as n,D as r,z as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";var t=e(),n=`text-xs font-medium text-foreground`;function r({title:e,hint:n,children:r}){return(0,t.jsxs)(`section`,{className:`settings-field flex flex-col gap-2`,children:[(0,t.jsxs)(`div`,{children:[(0,t.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),(0,t.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:n})]}),r]})}export{r as n,n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{l as n}from"./design-icons-CzEoMH9c.js";var r=e();function i({className:e,children:i,...a}){return(0,r.jsxs)(`span`,{"data-slot":`settings-select`,className:`settings-select relative inline-block w-fit min-w-0 max-w-full align-middle`,children:[(0,r.jsx)(`select`,{...a,className:t(`appearance-none pr-8 max-w-full`,e),children:i}),(0,r.jsx)(n,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`})]})}export{i as t};
@@ -0,0 +1 @@
1
+ .settings-panel{border:1px solid var(--border);background:var(--card);border-radius:12px;width:100%;padding:24px}.settings-panel>[data-slot]{width:100%;max-width:none;margin:0;padding:0}.settings-panel .settings-field+.settings-field{border-block-start:1px solid var(--border);padding-block-start:22px}.settings-panel .settings-field h2{font-size:14px;font-weight:400}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])){background:var(--background);min-width:0;max-width:100%;min-height:44px;box-shadow:none;font-size:13px}.settings-panel .settings-field>:is(input,select,textarea:not([data-slot=code-editor-input])),.settings-panel .settings-field>.settings-select,.settings-panel .settings-field>.settings-select>select,.settings-panel [data-slot=agents-default-runner],.settings-panel [data-slot=projects-browse-root],.settings-panel [data-slot=projects-checkout-root]{width:100%;max-width:none}.settings-panel button:not([role=switch]):not([data-slot=project-tag-suggestion]){min-height:40px}.settings-panel [data-slot=resources-composer-defaults]{grid-template-columns:1fr;gap:24px}.settings-panel [data-slot=prompt-template-row]{border:1px solid var(--border);background:0 0;border-radius:8px;gap:6px;margin-block-end:0;padding:12px 14px}.settings-panel [data-slot=prompt-template-new]{border:0;border-block-end:1px solid var(--border);border-radius:0;gap:12px;padding-block:20px;padding-inline:0}.settings-panel [data-slot=agent-config-agents]{background:color-mix(in oklch, var(--muted) 60%, transparent);border:1px solid var(--border);border-radius:8px;gap:4px;width:fit-content;max-width:100%;padding:4px}.settings-panel [data-slot=agent-config-agent]{border:1px solid #0000}.settings-panel [data-slot=agent-config-agent][aria-selected=true]{background:var(--card);border-color:var(--border);color:var(--foreground);box-shadow:var(--shadow-xs)}.settings-panel [data-slot=projects-section] table{display:block}.settings-panel [data-slot=projects-section] :is(tbody,tr){min-width:0;display:grid}.settings-panel [data-slot=projects-section] thead{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}.settings-panel [data-slot=projects-section] colgroup{display:none}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]){gap:8px;padding-block:16px;padding-inline:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>:is(th,td){text-align:start;width:100%;min-width:0;max-width:none;padding-block:0;padding-inline:12px;display:block}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]) .truncate{white-space:normal;overflow-wrap:anywhere}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]) td:last-child{border-block-start:1px solid var(--border);padding-block-start:12px}:is(.settings-panel .settings-field:has([data-slot=resources-auto-resume]),.settings-panel .settings-field:has([data-slot=resources-monitoring-wake-mode])){position:relative}:is(.settings-panel .settings-field:has([data-slot=resources-auto-resume])>div:first-child,.settings-panel .settings-field:has([data-slot=resources-monitoring-wake-mode])>div:first-child){padding-inline-end:60px}.settings-panel [data-slot=resources-auto-resume],.settings-panel [data-slot=resources-monitoring-wake-mode]{position:absolute;inset-block-start:24px;inset-inline-end:0}.settings-panel [data-slot=agent-config-group] ul{flex-direction:column;gap:6px}.settings-panel [data-slot=agent-config-file]{border:1px solid var(--border);width:100%;color:var(--foreground);padding-block:10px;padding-inline:12px}.settings-panel [data-slot=agent-config-file][data-selected=true]{border-color:var(--accent-strong);color:var(--accent-text)}.settings-route-body{gap:24px;width:100%;max-width:56rem;padding-block:0;padding-inline:0}.settings-route[data-route=settings-agent-config] .settings-route-body{max-width:none}.settings-section-picker{border:1px solid var(--border);background:var(--card);border-radius:8px;width:100%;position:relative}.settings-section-picker summary{cursor:pointer;justify-content:space-between;align-items:center;min-height:48px;padding-block:12px;padding-inline:14px;font-size:14px;list-style:none;display:flex}.settings-section-picker summary::-webkit-details-marker{display:none}.settings-section-picker nav{border-block-start:1px solid var(--border);padding:4px;display:grid}.settings-section-picker nav a{border-radius:6px;padding:12px;font-size:13px}.settings-section-picker nav a[aria-current=page]{background:color-mix(in oklch, var(--accent-strong) 12%, transparent);color:var(--accent-text)}.settings-panel{border-radius:10px}.settings-panel h3,.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2{font-weight:400}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2+p{margin-block-start:8px;line-height:1.6}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) [role=switch]{margin-block-start:8px}.settings-panel [data-slot=appearance-section]{border:0;border-radius:0}.settings-panel [data-slot=appearance-section]>section{gap:12px}.settings-panel [data-slot=appearance-section]>section+section{border-block-start:1px solid var(--border);padding-block-start:24px}.settings-panel [data-slot=appearance-section] h2{font-size:14px;font-weight:400}.settings-panel [data-slot=appearance-section] h2+p{margin-block-start:8px}.settings-panel [data-slot=appearance-section] [role=radiogroup]{gap:4px}.settings-panel [data-slot=appearance-section] [role=radio]{border-radius:6px;padding-block:8px;padding-inline:14px;font-weight:400}.settings-panel [data-slot=notifications-permission]{margin-block:20px;margin-inline:0}.settings-panel [data-slot=notifications-permission][data-permission=denied]{color:var(--danger)}.settings-panel .settings-readout{border:1px solid var(--border);background:var(--background);overflow-wrap:anywhere;border-radius:6px;padding:12px;font-size:13px;line-height:1.6}.settings-panel .settings-disclosure{border-block-start:1px solid var(--border);color:var(--muted-foreground);padding-block-start:16px;font-size:12px}.settings-panel .settings-disclosure summary{cursor:pointer;padding-block:4px;padding-inline:0}.settings-panel .settings-disclosure>:not(summary){margin-block-start:12px}.settings-panel [data-slot=agent-defaults-section]{gap:20px}.settings-panel [data-slot=agent-defaults-section] .settings-field+.settings-field{padding-block-start:20px}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}.settings-panel [data-slot=agents-task-runs]>h2{font-size:14px;font-weight:400}.settings-panel .settings-option-row{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.settings-panel .settings-option-row>div:first-child{flex:1;min-width:0}.settings-panel .settings-option-row h3{font-size:14px;font-weight:400}.settings-panel .settings-option-row p{margin-block-start:8px;line-height:1.6}.settings-panel .settings-option-row label{flex-shrink:0}.settings-panel .settings-option-row label>span{display:none}.settings-panel .settings-form-actions{border-block-start:1px solid var(--border);flex-wrap:wrap;gap:12px;padding-block-start:20px;display:flex}@media (width<=767px){.settings-route-body{gap:20px;max-width:none}.settings-panel{padding:16px}.settings-panel button:not([role=switch]):not([data-slot=project-tag-suggestion]):not([data-slot=prompt-template-skill-chip]){min-height:44px}.settings-panel [data-slot=agent-config-agents]{flex-wrap:wrap}.settings-panel [data-slot=agent-config-group] li{max-width:100%}.settings-panel [data-slot=appearance-section] [role=radiogroup]{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%;display:grid}.settings-panel [data-slot=appearance-section] [role=radiogroup][data-slot=appearance-width]{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-panel [data-slot=appearance-section] [role=radio]{white-space:nowrap;justify-content:center;padding-inline:8px;font-size:12px}.settings-panel [data-slot=appearance-section] [role=radiogroup][data-slot=appearance-density]{grid-template-columns:repeat(3,auto);gap:4px}.settings-panel [data-slot=appearance-section] [data-slot=appearance-density] [role=radio]{padding-inline:10px}.settings-panel .settings-resource-controls{align-items:stretch}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}}.settings-panel .settings-retention-controls input{width:100%}.settings-panel .settings-retention-controls>span{display:none}.settings-panel .settings-appearance-preview{padding:20px}.settings-panel [data-slot=appearance-theme] svg,.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>h2{display:none}.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>p{margin-block-start:0}.settings-panel [data-slot=prompt-template-row]>label,.settings-panel [data-slot=prompt-template-row]>p,.settings-panel [data-slot=prompt-template-new]>label:not(:first-of-type){margin-block-start:6px}.settings-panel [data-slot=prompt-template-row] textarea{min-height:44px}.settings-panel [data-slot=prompt-template-skill-chip]{border:1px solid var(--border);background:var(--muted);border-radius:6px;min-height:28px;padding-block:2px;padding-inline:8px;font-size:12px}.settings-panel [data-slot=prompt-template-skill-chip]:hover{background:color-mix(in oklch, var(--danger) 10%, transparent);color:var(--danger)}.settings-panel [data-slot=prompt-template-skills-trigger]{border-radius:6px}.settings-panel [data-slot=accounts-defaults]{margin-block-start:8px}.settings-panel [data-slot=accounts-defaults] select{max-width:none}.settings-panel [data-slot=account-details]{background:var(--background)}.settings-route [data-slot=project-general]{gap:20px}.settings-route [data-slot=project-general]>section{border-radius:10px;padding:20px}.settings-route [data-slot=project-general] [data-slot=project-facts]{border-block-end:1px solid var(--border);padding-block-end:16px}:is(.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-browse-root])>div:nth-child(2),.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-checkout-root])>div:nth-child(2)){flex-wrap:wrap;row-gap:8px}.settings-panel [data-slot=settings-save-row]{align-items:center}.settings-panel [data-slot=settings-save-row]>*{margin:0}.settings-panel [data-slot=projects-section] .overflow-x-auto{border:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>:is(th,td){padding-inline:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>th{font-size:14px}@media (width<=767px){.settings-panel [data-slot=accounts-defaults] label{flex-direction:column;align-items:stretch}.settings-panel [data-slot=accounts-defaults] label>span{width:auto}.settings-route [data-slot=project-general]>section{padding:16px}}.settings-agent-picker{border:1px solid var(--border);background:var(--background);border-radius:6px;min-width:0}.settings-agent-picker summary{cursor:pointer;align-items:center;gap:10px;min-height:44px;padding-block:10px;padding-inline:12px;font-size:13px;list-style:none;display:flex}.settings-agent-picker summary::-webkit-details-marker{display:none}.settings-agent-picker [data-slot=agents-runner]{border:0;border-block-start:1px solid var(--border);flex-direction:column;width:100%;max-width:none;padding:4px;display:flex}.settings-agent-picker [role=radio]{white-space:normal;font-family:inherit}.settings-panel [data-slot=settings-config-editor]>[data-slot=agent-config-editor-frame]{margin-block-start:8px}@media (width<=767px){.settings-route[data-route=settings] [data-slot=settings-index]{border:1px solid var(--border);background:var(--card);border-block-start:0;border-radius:0 0 10px 10px;gap:0;margin-block-start:0;padding-block:12px;padding-inline:16px}.settings-route[data-route=settings] [data-slot=settings-index] a{border:0;border-radius:0;padding-block:16px;padding-inline:0}.settings-route[data-route=settings] [data-slot=settings-index] a>span:first-child,.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span+span{display:none}.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span:first-child{color:var(--muted-foreground);font-size:13px;font-weight:400}.settings-panel .settings-resource-controls input{flex-basis:100%}.settings-panel [data-slot=resources-composer-defaults] :is(.settings-select,select){width:100%}}.settings-model-control{position:relative}.settings-model-control>svg{pointer-events:none;position:absolute;inset-block-start:50%;inset-inline-start:12px;transform:translateY(-50%)}.settings-panel .settings-model-control :is(select,output){padding-inline-start:36px}.settings-route [data-slot=button]{border-radius:8px;font-weight:400}.settings-panel [data-slot=button]{padding-inline:16px}.settings-route [data-slot=switch-thumb]{background:#fff}.settings-panel .settings-form-actions [data-variant=primary]{order:1}.settings-panel .settings-form-actions>span{order:2}.settings-panel [data-slot=settings-config-editor]{gap:12px}.settings-config-toolbar{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.settings-config-file-row{flex-wrap:wrap;gap:10px;display:flex}.settings-config-file-row button{border:1px solid var(--border);background:var(--card);border-radius:8px;padding-block:10px;padding-inline:16px;font-size:12px;font-weight:400}.settings-config-file-row button[aria-pressed=true]{background:var(--card);color:var(--foreground);border-color:var(--border);box-shadow:var(--shadow-xs);font-weight:500}.settings-config-agent-choice{color:var(--muted-foreground);align-items:center;gap:8px;margin-inline-start:auto;font-size:12px;display:flex}.settings-panel .settings-config-agent-choice select{border:1px solid var(--border);border-radius:6px;min-height:36px;padding-block:6px;padding-inline:10px}.settings-config-content-heading{border-block-start:1px solid var(--border);margin-block-start:8px;padding-block-start:20px}.settings-config-content-heading h3{font-size:14px}.settings-config-content-heading p{color:var(--muted-foreground);margin-block-start:8px;font-size:12px}.settings-config-save-help{color:var(--muted-foreground);gap:8px;padding-block-start:8px;font-size:12px;display:grid}.settings-config-scopes{border-block-start:1px solid var(--border);gap:12px;padding-block-start:24px;display:grid}.settings-config-scopes h3{font-size:14px}.settings-panel [data-slot=accounts-defaults]{background:0 0;border:0;gap:12px;margin-block-start:12px;padding:0}.settings-panel [data-slot=accounts-defaults]>div:first-child>h3{font-size:14px}.settings-panel [data-slot=accounts-defaults]>div:first-child>p{margin-block-start:8px;font-size:12px}.settings-account-models{background:var(--background);border:1px solid var(--border);border-radius:8px;padding:14px}.settings-panel .settings-account-model{background:var(--background);border:1px solid var(--border);border-radius:8px;padding-block:10px;padding-inline:12px;position:relative}.settings-panel .settings-account-model select{min-height:24px;box-shadow:none;background:0 0;border:0;padding:0 36px 0 0;font-size:13px}@media (width<=767px){.settings-config-agent-choice{margin-inline-start:0}.settings-config-file-row{gap:8px}.settings-config-file-row button{padding-inline:12px}.settings-panel [data-slot=accounts-defaults] .settings-account-model{flex-flow:wrap;align-items:center}.settings-panel .settings-account-model select{flex:1;min-width:100px}}.settings-panel [data-slot=agent-config-path]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.settings-config-scopes [data-slot=agent-config-nav]{grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:20px;display:grid}.settings-config-scopes [data-slot=agent-config-file]{padding:8px;font-size:12px}.settings-panel [data-slot=accounts-defaults] .settings-model-agent-choice{color:var(--muted-foreground);flex-direction:row;align-items:center;gap:8px;font-size:12px;display:flex}.settings-panel .settings-model-agent-choice select{width:16rem;max-width:100%}.settings-config-scopes [data-slot=agent-config-group]>ul>li{width:100%;min-width:0}.settings-config-scopes [data-slot=agent-config-file]{min-width:0;max-width:100%}.settings-panel [data-slot=settings-config-editor] [data-slot=code-editor]{background:var(--background)}.settings-panel select{appearance:none;border:1px solid var(--border);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-position:right 12px center;background-repeat:no-repeat;border-radius:8px;padding-inline:12px 36px}.settings-panel .settings-select>select{background-image:none}.settings-panel .settings-option-row{align-items:center}.settings-panel .settings-option-row :is(select,output){width:16rem;min-width:0;max-width:100%}.settings-panel .settings-field>select{width:16rem;max-width:100%}.settings-panel .settings-field>.settings-select:has(>select:is([data-slot=resources-max-parallel],[data-slot=resources-max-monitoring])){width:8rem}.settings-panel .settings-resource-controls input[data-slot=resources-memory-limit],.settings-panel .settings-resource-controls input[data-slot=resources-monitoring-wake-interval]{flex:none;width:9rem}.settings-panel [data-slot=resources-composer-defaults] select{width:16rem;max-width:100%}.settings-panel [data-slot=archive-on-merge-field]>div:first-child>label{font-size:14px;font-weight:400}.settings-panel [data-slot=archive-on-merge-field]>div:first-child>label+p{margin-block-start:4px;line-height:1.6}.settings-panel .settings-agent-card{gap:0;padding:0;scroll-margin-block-start:16px}.settings-agent-head{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 16px;padding:12px 16px;display:flex}.settings-agent-heading{flex-wrap:wrap;flex:18rem;align-items:baseline;gap:2px 12px;min-width:0;display:flex}.settings-panel .settings-account-provider-title{color:var(--foreground);font-size:14px;font-weight:600}.settings-agent-summary{min-width:0;color:var(--muted-foreground);flex-wrap:wrap;align-items:center;gap:2px 0;font-size:12px;line-height:1.5;display:flex}.settings-agent-summary-item{overflow-wrap:anywhere;align-items:center;min-width:0;display:inline-flex}.settings-agent-summary-sep{color:var(--soft-foreground);padding-inline:6px}.settings-account-actions{flex-flow:wrap;align-items:center;gap:8px;display:flex}.settings-panel .settings-agent-card .settings-account-actions button:not([data-slot=account-rename-input]){min-height:32px;padding-inline:12px;font-size:12px}.settings-agent-accounts{flex-direction:column;display:flex}.settings-account-meta{border-block-start:1px solid var(--border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 16px;margin-inline:16px;padding-block:8px 10px;display:flex}.settings-account-readout{flex-direction:column;align-items:flex-start;gap:2px;min-width:0;display:flex}.settings-account-meta-line{min-width:0;color:var(--muted-foreground);flex-wrap:wrap;align-items:center;gap:2px 12px;font-size:12px;display:flex}.settings-account-label{color:var(--foreground);font-size:13px;font-weight:500}.settings-account-path{font-family:var(--font-mono);color:color-mix(in oklch, var(--foreground) 80%, transparent);overflow-wrap:anywhere;font-size:12px;line-height:1.5}.settings-account-hint{color:var(--muted-foreground);font-size:12px;line-height:1.5}.settings-account-line{border-block-start:1px solid var(--border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 16px;margin-inline:16px;padding-block:8px 10px;display:flex}.settings-agent-note{border-block-start:1px solid var(--border);color:var(--muted-foreground);margin-inline:16px;padding-block:8px 10px;font-size:12px;line-height:1.5}.settings-agent-card>section[aria-label=CLI\ installation]{border-block-start:1px solid var(--border);margin-inline:16px;padding-block:8px 10px}.settings-account-management{display:contents}.settings-account-management>span{color:var(--muted-foreground);flex-basis:100%;font-size:12px}.settings-account-management [data-slot=account-rename-input]{min-width:0;max-width:100%}@media (width<=767px){.settings-agent-head{padding:12px}.settings-account-meta,.settings-account-line,.settings-agent-note,.settings-agent-card>section[aria-label=CLI\ installation]{margin-inline:12px}.settings-panel .settings-agent-card .settings-account-actions button:not([data-slot=account-rename-input]){min-height:44px}}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])),.settings-panel [data-slot=code-editor]{border-color:var(--border)}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])):focus-visible{border-color:var(--ring)}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input]))[aria-invalid=true]{border-color:var(--destructive)}.settings-panel [data-slot=code-editor]:focus-within{border-color:var(--ring)}.settings-panel :is(input,textarea)::placeholder{color:var(--soft-foreground);opacity:1}.settings-panel .settings-form-actions [data-variant=outline]:disabled{opacity:1;color:var(--muted-foreground);background:0 0}@media (width>=768px){.settings-panel{padding:20px 24px}}.settings-panel>:is([data-slot=agent-defaults-section],[data-slot=worktrees-section],[data-slot=projects-section],[data-slot=accounts-section]){gap:16px}.settings-panel .settings-field{gap:10px}.settings-panel .settings-field+.settings-field,.settings-panel [data-slot=agent-defaults-section] .settings-field+.settings-field{padding-block-start:18px}.settings-panel .settings-field h2+p{margin-block-start:4px;line-height:1.55}.settings-panel [data-slot=agents-task-runs]{gap:16px}.settings-panel [data-slot=agent-cards]{gap:12px}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]){gap:6px;padding-block:12px}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>td:last-child{margin-block-start:4px;padding-block-start:12px}.settings-panel .settings-form-actions{padding-block-start:16px}.settings-panel [data-slot=appearance-section] [role=radiogroup]{background:color-mix(in oklch, var(--muted) 60%, transparent)}.settings-panel [data-slot=appearance-section] [role=radio][aria-checked=true]{background:var(--card);border-color:var(--border);color:var(--foreground);box-shadow:var(--shadow-xs);font-weight:500}.settings-panel .settings-select:has(>select[data-slot=project-max-parallel]){width:15rem;max-width:100%}@media (width<=767px){.settings-panel .settings-select:has(>select[data-slot=project-max-parallel]){width:100%}}@media (width<48rem),(any-pointer:coarse){[data-slot=agent-config-placeholder]{font-size:max(16px,1rem)}}
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{En as r,Sn as i,Tn as a,bn as o,xn as s}from"./project-scope-context-Rv6S_BXt.js";import{n as c}from"./toaster-BXnLIU3z.js";import{Ft as l,Ot as u,Pt as d,ht as f,jt as p,xt as m}from"./queries-qCF-eOqZ.js";import{n as h,p as g,r as _}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{l as v,u as y}from"./design-icons-CzEoMH9c.js";import{t as b}from"./plus-CxRU2X8C.js";import{t as x}from"./button-B7MKxYjT.js";import{n as ee,r as S,t as C}from"./collapsible-BEV4FO-1.js";import{r as w}from"./switch-SP8pw5uU.js";import{t as T}from"./badge-DQ3U69Ht.js";import{n as E,s as D,t as O}from"./project-router-CLJTc7gv.js";import"./attention-CBCeJN5w.js";import{a as k,l as te}from"./page-shell-7pLJMOgh.js";import{Bn as ne,Wn as A,dt as re,ft as j,gn as M,pt as N,z as ie}from"./index-CvVmG4Yu.js";import{t as ae}from"./textarea-vJt9undk.js";import{n as oe,t as se}from"./saved-draft-BwzBc-_Y.js";import{ArchiveOnMergeField as ce}from"./archive-on-merge-field-C7_Fwy2A.js";import{a as le,i as ue,n as de,t as fe}from"./projects-section-DnGSWHZJ.js";import{n as P}from"./settings-field-DP9sYv5a.js";import{t as pe}from"./project-location-BRxXN249.js";var F=e(t(),1),I={"needs-you":{label:`Needs you`,hint:`Asks a question, asks for permission, or waits for review`},failed:{label:`Failed`,hint:`Failed, with no scheduled resume`},done:{label:`Done`,hint:`Finished`},cancelled:{label:`Cancelled`,hint:`Was cancelled`},running:{label:`Running`,hint:`Runs an agent turn`},"waiting-workers":{label:`Waiting for agents`,hint:`Waits on its workers or their replies`},"waiting-ci":{label:`Waiting on CI`,hint:`Waits on a pull request's checks`},"waiting-timer":{label:`Waiting`,hint:`Waits on a timer`},"waiting-other":{label:`Any other wait`,hint:`Waits on anything else, including wait types added later`}},L=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),R={name:``,description:``,url:``,token:``,tasks:!0,triggers:a,agent:!1};function z(e){return{name:e.name,description:e.description??``,url:e.url,token:``,tasks:e.tasks,triggers:e.triggers??a,agent:e.agent}}var B=e=>r.filter(t=>e.includes(t));function me(e){let t=e.description.trim();return{name:e.name.trim(),url:e.url.trim(),...t?{description:t}:{},...e.token?{token:e.token}:{},tasks:e.tasks,...L(e.triggers,a)?{}:{triggers:B(e.triggers)},agent:e.agent}}function he(e){return e.name.trim()!==``||e.description.trim()!==``||e.url.trim()!==``||e.token!==``||e.tasks!==R.tasks||e.agent!==R.agent||!L(e.triggers,R.triggers)}function ge(e,t){let n={},r=e.name.trim(),i=e.description.trim(),o=e.url.trim();return r!==t.name&&(n.name=r),i!==(t.description??``)&&(n.description=i),o!==t.url&&(n.url=o),e.token&&(n.token=e.token),e.tasks!==t.tasks&&(n.tasks=e.tasks),L(e.triggers,t.triggers??a)||(n.triggers=B(e.triggers)),e.agent!==t.agent&&(n.agent=e.agent),n}var V=n(),H=`flex flex-col gap-1 text-[13px]`,U=`text-[11px] text-muted-foreground`;function W({draft:e,onChange:t,tokenSet:n}){let a=(0,F.useId)(),c=(0,F.useId)(),l=(0,F.useId)(),u=(0,F.useId)(),d=(0,F.useId)(),f=(0,F.useId)(),p=(0,F.useId)(),m=(0,F.useId)(),h=(0,F.useId)(),g=(0,F.useId)();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3`,children:[(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:a,className:U,children:`Name`}),(0,V.jsx)(A,{id:a,"data-slot":`webhook-name`,autoComplete:`off`,maxLength:80,placeholder:`e.g. Team bot`,value:e.name,onChange:e=>t({name:e.target.value})})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:u,className:U,children:`URL`}),(0,V.jsx)(A,{id:u,"data-slot":`webhook-url`,type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,maxLength:i,placeholder:`https://bot.example/hooks/cez`,value:e.url,onChange:e=>t({url:e.target.value})})]})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:c,className:U,children:`Description`}),(0,V.jsx)(ae,{id:c,"data-slot":`webhook-description`,"aria-describedby":l,rows:2,maxLength:o,placeholder:`e.g. Posts to the #releases channel. Use it for release notes.`,value:e.description,onChange:e=>t({description:e.target.value})}),(0,V.jsx)(`span`,{id:l,className:`text-[11px] text-soft-foreground`,children:`Agents read the name and description to decide when to use this webhook.`})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:d,className:U,children:`Token`}),(0,V.jsx)(A,{id:d,"data-slot":`webhook-token`,type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:s,"aria-describedby":f,placeholder:n?`Token set — type to replace`:`Optional Bearer token`,value:e.token,onChange:e=>t({token:e.target.value})}),(0,V.jsx)(`span`,{id:f,className:`text-[11px] text-soft-foreground`,children:n?`The token is stored in ~/.cezar and never shown again. Leave it empty to keep it.`:`The token is stored in ~/.cezar, never in the repo. It is sent as a Bearer header.`})]}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(w,{id:p,"aria-describedby":m,"data-slot":`webhook-tasks`,checked:e.tasks,onCheckedChange:e=>t({tasks:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:p,className:`font-medium`,children:`Task notifications`}),(0,V.jsx)(`span`,{id:m,className:`text-[11px] text-soft-foreground`,children:`Tasks you hand off, or start with notify on, send their status here.`})]})]}),e.tasks?(0,V.jsxs)(`fieldset`,{"data-slot":`webhook-triggers`,className:`flex flex-col gap-1 sm:ps-[3.25rem]`,children:[(0,V.jsx)(`legend`,{className:`pbe-1 text-[11px] text-muted-foreground`,children:`Send a delivery when a task enters`}),(0,V.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,15rem),1fr))] gap-x-3`,children:r.map(n=>(0,V.jsxs)(`label`,{className:`flex min-h-11 items-start gap-2.5 pbs-2 text-[13px]`,children:[(0,V.jsx)(`input`,{type:`checkbox`,"data-trigger":n,checked:e.triggers.includes(n),onChange:r=>t({triggers:r.target.checked?[...e.triggers,n]:e.triggers.filter(e=>e!==n)}),className:`mbs-0.5 size-[18px] shrink-0`}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:I[n].label}),(0,V.jsx)(`span`,{className:`text-[11px] text-soft-foreground`,children:I[n].hint})]})]},n))}),(0,V.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:`Handing a task off and Send test always deliver.`})]}):null]}),(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(w,{id:h,"aria-describedby":g,"data-slot":`webhook-agent`,checked:e.agent,onCheckedChange:e=>t({agent:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:h,className:`font-medium`,children:`Let agents send reports`}),(0,V.jsx)(`span`,{id:g,className:`text-[11px] text-soft-foreground`,children:`Agents in this project may post a report here when the task calls for it.`})]})]})]})}var G=`max-sm:h-11`,K=(e,t)=>({tone:`alert`,text:`Not saved: ${e.message}. Fix the field and select ${t} again.`}),_e=e=>e.dryRun?{tone:`ok`,text:`Dry run: nothing was sent.`}:e.ok?{tone:`ok`,text:`Delivered (HTTP ${e.status??200}).`}:{tone:`danger`,text:`Not delivered: ${e.error??`unknown error`}.`};function q({feedback:e}){return e?(0,V.jsx)(`p`,{"data-slot":e.tone===`alert`?`webhook-error`:`webhook-result`,role:e.tone===`alert`?`alert`:`status`,className:e.tone===`ok`?`text-[13px] text-muted-foreground`:`text-[13px] text-danger`,children:e.text}):null}var J=`rounded-md border border-border bg-background`,Y=`flex flex-col gap-3 border-bs border-border p-3`;function ve({projectId:e,webhook:t,defaultOpen:n=!1}){let r=d(),i=u(),a=p(),[o,s]=(0,F.useState)(n),[l,f]=oe(z(t),se),[m,h]=(0,F.useState)(null),g=ge(l,t),_=Object.keys(g).length>0;M(_);let y=l.name.trim()!==``&&l.url.trim()!==``,b=r.isPending||i.isPending||a.isPending,w={projectId:e,webhookId:t.id},E=e=>r.mutate({...w,...g},{onSuccess:()=>{f(e=>({...e,token:``})),e?e():c(`${l.name.trim()} saved`)},onError:e=>h(K(e,`Save`))}),D=()=>a.mutate(w,{onSuccess:e=>h(_e(e)),onError:e=>h({tone:`danger`,text:e.message})});return(0,V.jsx)(`li`,{"data-slot":`webhook-card`,"data-webhook-id":t.id,className:J,children:(0,V.jsxs)(C,{open:o,onOpenChange:s,children:[(0,V.jsx)(S,{asChild:!0,children:(0,V.jsxs)(`button`,{type:`button`,"data-action":`webhook-toggle`,className:`group flex min-h-11 w-full items-center gap-3 rounded-md p-3 text-start focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-foreground pointer-hover:bg-muted/50 active:bg-muted/50`,children:[(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,V.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,V.jsx)(`span`,{"data-slot":`webhook-card-name`,className:`min-w-0 break-words text-[13px] font-medium`,children:t.name}),t.tasks?(0,V.jsx)(T,{variant:`secondary`,"data-badge":`tasks`,children:`Task notifications`}):null,t.agent?(0,V.jsx)(T,{variant:`secondary`,"data-badge":`agent`,children:`Agents`}):null]}),(0,V.jsx)(`span`,{"data-slot":`webhook-card-url`,className:`truncate text-[12px] text-muted-foreground`,children:ie(t.url)})]}),(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground group-data-[state=open]:rotate-180`})]})}),(0,V.jsx)(ee,{children:(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,className:Y,onSubmit:e=>{e.preventDefault(),h(null),y&&_&&E()},children:[(0,V.jsx)(W,{draft:l,tokenSet:t.tokenSet,onChange:e=>f(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-save`,disabled:b||!y||!_,children:`Save`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`outline`,"data-action":`webhook-test`,disabled:b||!y,onClick:()=>{h(null),_?E(D):D()},children:`Send test`}),t.tokenSet?(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-clear-token`,disabled:b,onClick:()=>r.mutate({...w,token:``},{onSuccess:()=>c(`Webhook token cleared`),onError:e=>h({tone:`danger`,text:`Token not cleared: ${e.message}.`})}),children:`Clear token`}):null,(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`danger-ghost`,"data-action":`webhook-remove`,"aria-label":`Remove ${t.name}`,disabled:b,onClick:()=>i.mutate(w,{onSuccess:()=>c(`${t.name} removed`),onError:e=>h({tone:`danger`,text:`Not removed: ${e.message}.`})}),children:`Remove`})]}),(0,V.jsx)(q,{feedback:m})]})})]})})}function ye({projectId:e,onCreated:t,onCancel:n}){let r=f(),[i,a]=(0,F.useState)(R),[o,s]=(0,F.useState)(null),l=i.name.trim()!==``&&i.url.trim()!==``;return M(he(i)),(0,V.jsxs)(`li`,{"data-slot":`webhook-card`,"data-draft":``,className:J,children:[(0,V.jsx)(`p`,{className:`p-3 text-[13px] font-medium`,children:`New webhook`}),(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,"aria-label":`New webhook`,className:Y,onSubmit:n=>{n.preventDefault(),s(null),l&&r.mutate({projectId:e,...me(i)},{onSuccess:({webhook:e})=>{c(`${e.name} created`),t(e)},onError:e=>s(K(e,`Create`))})},children:[(0,V.jsx)(W,{draft:i,tokenSet:!1,onChange:e=>a(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-create`,disabled:r.isPending||!l,children:`Create`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-cancel`,disabled:r.isPending,onClick:n,children:`Cancel`})]}),(0,V.jsx)(q,{feedback:o})]})]})}function be({project:e}){let t=e.webhooks??[],[n,r]=(0,F.useState)(!1),[i,a]=(0,F.useState)(null),o=t.length>=16;return(0,V.jsx)(P,{title:`Webhooks`,hint:`A webhook gets a POST from Squawk. Tasks can send their status to it, and agents can send it reports.`,children:(0,V.jsxs)(`div`,{"data-slot":`project-webhooks`,className:`flex flex-col gap-3`,children:[t.length===0&&!n?(0,V.jsx)(`p`,{"data-slot":`webhooks-empty`,className:`text-[13px] text-soft-foreground`,children:`No webhooks yet. Add one to send task updates to a bot, or to let agents post reports.`}):null,t.length>0||n?(0,V.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[t.map(t=>(0,V.jsx)(ve,{projectId:e.id,webhook:t,defaultOpen:t.id===i},t.id)),n?(0,V.jsx)(ye,{projectId:e.id,onCancel:()=>r(!1),onCreated:e=>{a(e.id),r(!1)}}):null]}):null,n?null:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(x,{type:`button`,size:`sm`,variant:`outline`,className:`max-sm:h-11`,"data-action":`webhook-add`,disabled:o,onClick:()=>r(!0),children:[(0,V.jsx)(b,{"aria-hidden":`true`}),`Add webhook`]}),o?(0,V.jsxs)(`span`,{className:`text-[11px] text-soft-foreground`,children:[`A project holds at most `,16,` webhooks.`]}):null]})]})})}function X(e){let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}function xe(){let e=D(),t=m(),n=l();if(t.isPending)return(0,V.jsx)(`p`,{"data-slot":`project-general-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading project…`});if(t.isError)return(0,V.jsxs)(`p`,{"data-slot":`project-general-error`,className:`text-[13px] text-danger`,children:[`Could not read the project registry — `,t.error.message]});let r=t.data,i=r?.projects.find(t=>t.id===e);return!r||!i?null:(0,V.jsxs)(`div`,{"data-slot":`project-general`,className:`flex w-full flex-col gap-5`,children:[(0,V.jsxs)(`section`,{className:`flex flex-col gap-5 rounded-lg border border-border bg-card p-5 [&_select]:min-h-11 [&_select]:w-full`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`General`}),(0,V.jsx)(pe,{}),(0,V.jsx)(Se,{project:i}),(0,V.jsx)(P,{title:`Max parallel tasks`,hint:n.data?`The workspace limit (${n.data.resources.maxParallel}) still applies as an overall ceiling.`:`How many of this project's tasks may run at once. The workspace limit still applies as an overall ceiling.`,children:n.data?(0,V.jsx)(fe,{project:i,workspaceMax:n.data.resources.maxParallel}):(0,V.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading the workspace limit…`})}),(0,V.jsx)(be,{project:i},i.id)]}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(Z,{project:i,bootProject:r.bootProject})})]})}function Se({project:e}){return(0,V.jsxs)(`dl`,{"data-slot":`project-facts`,className:`grid grid-cols-1 gap-4 text-[13px] sm:grid-cols-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Project`}),(0,V.jsx)(`dd`,{className:`mt-1 font-medium`,children:e.name})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Branch`}),(0,V.jsx)(`dd`,{className:`mt-1 break-all`,children:e.branch??`—`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Status`}),(0,V.jsxs)(`dd`,{"data-slot":`project-general-status`,className:e.status===`missing`?`mt-1 text-danger`:`mt-1`,children:[de[e.status],e.status===`missing`?` — remove it below, or restore the folder`:null]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Added`}),(0,V.jsxs)(`dd`,{className:`mt-1`,children:[X(e.addedAt),(0,V.jsx)(`span`,{className:`text-soft-foreground`,children:e.source===`checkout`?` · cloned from GitHub`:` · opened locally`})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last opened`}),(0,V.jsx)(`dd`,{className:`mt-1`,children:X(e.lastOpenedAt)})]})]})}function Z({project:e,bootProject:t}){let[n,r]=(0,F.useState)(null),i=le(),a=g(),o=e.id===t;return(0,V.jsxs)(P,{title:`Remove from workspace`,hint:`Unregisters this project so it leaves the sidebar and the project list. Nothing on disk is deleted — the folder, its git history and its task history all stay, and opening it again re-registers it.`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,"data-action":`project-general-remove`,"aria-label":`Remove ${e.name} from the workspace — unregisters it, no files are deleted`,title:o?`Squawk is serving this project — it re-registers itself at every start`:void 0,disabled:o||i.isPending,onClick:()=>r(e),className:`text-danger`,children:[`Remove `,e.name]}),o?(0,V.jsx)(`span`,{"data-slot":`project-general-remove-boot`,className:`text-xs text-soft-foreground`,children:`Squawk is serving this project — it re-registers itself at every start.`}):null]}),(0,V.jsx)(ue,{project:n,onOpenChange:e=>!e&&r(null),onConfirm:()=>{r(null),i.confirm(e,()=>void a(`/p/${encodeURIComponent(t)}`))}})]})}function Ce(e){return e===`global`?{Link:h,NavLink:_}:{Link:O,NavLink:E}}function Q({scope:e,title:t,mobileTitle:n,description:r}){let i=ne().name,a=e===`global`?`every project`:i??`this project`;return{headerSlot:`settings-main-header`,title:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`md:hidden`,children:n}),(0,V.jsxs)(`span`,{className:`max-md:hidden`,children:[t,` `,(0,V.jsxs)(`span`,{"data-slot":`page-header-scope`,className:`font-normal text-soft-foreground`,children:[`· `,a]})]})]}),subtitle:r,hideSubtitleOnMobile:!0,headerExtra:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{"data-slot":`settings-mobile-scope`,className:`mt-1 text-[13px] text-muted-foreground md:hidden`,children:e===`global`?`Applies to every project`:a}),e===`global`?(0,V.jsx)(`span`,{"data-slot":`settings-scope-chip`,className:`sr-only`,children:`Global settings`}):null]})}}function $({scope:e,activeId:t}){let{NavLink:n}=Ce(e),r=N(e);return(0,V.jsxs)(`details`,{className:`settings-section-picker md:hidden`,children:[(0,V.jsxs)(`summary`,{children:[r.find(e=>e.id===t)?.title??`General`,(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-5 text-muted-foreground`})]}),(0,V.jsxs)(`nav`,{"aria-label":`Settings sections`,"data-slot":`settings-nav-mobile`,"data-scope":e,children:[e===`project`?(0,V.jsx)(n,{to:`/settings`,end:!0,"data-slot":`settings-nav-index`,children:`General`}):null,r.map(t=>(0,V.jsx)(n,{to:j(e,t.id),"data-section":t.id,children:t.title},t.id))]})]},`${e}-${t}`)}function we({section:e,scope:t}){let n=e.component,r=Q({scope:t,title:e.title,description:e.description,mobileTitle:t===`global`?`Global settings`:`Project settings`});return(0,V.jsx)(e.id===`agent-config`?te:k,{route:t===`global`?`settings-global-${e.id}`:`settings-${e.id}`,density:`full`,className:`settings-route`,header:r,children:(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsxs)(`div`,{"data-slot":`settings-mobile-section`,className:`flex flex-col gap-2 md:hidden`,children:[(0,V.jsx)($,{scope:t,activeId:e.id}),e.description?(0,V.jsx)(`p`,{"data-slot":`settings-mobile-section-subtitle`,className:`px-1 text-[13px] leading-normal text-muted-foreground`,children:e.description}):null]}),(0,V.jsxs)(`section`,{className:`settings-panel min-w-0 self-start md:flex-1`,"aria-label":e.title,children:[(0,V.jsx)(`h2`,{className:`settings-panel-title sr-only`,children:e.title}),(0,V.jsx)(n,{})]})]})})}function Te(){return(0,V.jsx)(k,{route:`settings`,density:`full`,className:`settings-route`,header:Q({scope:`project`,title:`General`,mobileTitle:`Project settings`}),children:(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsx)($,{scope:`project`,activeId:null}),(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,V.jsx)(xe,{}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(ce,{})}),(0,V.jsx)(`h2`,{className:`settings-other-title mt-6 rounded-t-lg border border-b-0 border-border bg-card px-5 pt-5 text-base font-semibold md:hidden`,children:`Other project settings`}),(0,V.jsx)(`ul`,{"data-slot":`settings-index`,className:`mt-7 flex w-full flex-col gap-5 md:hidden`,children:N(`project`).map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(O,{to:j(`project`,e.id),"data-section":e.id,className:`flex items-center gap-3.5 rounded-lg border border-border bg-card p-4 transition-colors hover:bg-card-2`,children:[(0,V.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center text-accent-text`,children:(0,V.jsx)(e.icon,{"aria-hidden":`true`,className:`size-4`})}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,V.jsx)(`span`,{className:`block text-xs text-soft-foreground`,children:e.description})]}),(0,V.jsx)(y,{"aria-hidden":`true`,className:`size-4 shrink-0 text-soft-foreground`})]})},e.id))}),(0,V.jsxs)(`p`,{className:`mt-5 w-full text-[12px] text-soft-foreground`,children:[`Appearance, notifications, host resources and the project registry live in`,` `,(0,V.jsx)(h,{to:re,"data-slot":`settings-global-link`,className:`underline underline-offset-2 hover:text-foreground`,children:`Global settings`}),`.`]})]})]})})}export{Te as SettingsIndexRoute,we as SettingsSectionRoute};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{c as r}from"./utils-DSMR_WLb.js";import{Ir as i,Lr as a,P as o,pi as s}from"./project-scope-context-Rv6S_BXt.js";import{Qt as c,y as l}from"./queries-qCF-eOqZ.js";import{t as u}from"./button-B7MKxYjT.js";import{gn as d}from"./index-CvVmG4Yu.js";var f=e(t(),1),p=n(),m=[[`overall`,`Overall`],[`needsYou`,`Needs You`],[`finished`,`Finished`],[`working`,`Working`]];function h(){let e=r(),t=l(e);return t.isPending?(0,p.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-muted-foreground`,children:`Loading sidebar settings…`}):t.isError?(0,p.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,p.jsxs)(`p`,{role:`alert`,children:[`Sidebar settings did not load: `,t.error.message]}),(0,p.jsx)(u,{className:`min-h-[44px]`,onClick:()=>void t.refetch(),children:`Retry`})]}):(0,p.jsx)(g,{scope:e,initial:t.data.sidebarLimits??{}},e)}function g({scope:e,initial:t}){let n=s(),r=i(void 0),l=_(t),[h,g]=(0,f.useState)(()=>({values:l,saved:l,received:l})),{values:y,saved:b}=h,x=e=>g(t=>({...t,values:e})),S=a.safeParse(Object.fromEntries(m.map(([e])=>[e,y[e]===null?null:Number(y[e])]))),C=e=>y[e]!==null&&(y[e].trim()===``||!Number.isSafeInteger(Number(y[e]))||Number(y[e])<=0),w=m.some(([e])=>y[e]!==b[e]);d(w);let T=c({onMutate:()=>n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),mutationFn:t=>o({sidebarLimits:t},e),onSuccess:async t=>{await n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),n.setQueryData([e,`ui-state`],t);let r=_(t.sidebarLimits);g({values:r,saved:r,received:r})}});return!T.isPending&&!v(h.received,l)&&g({values:w?y:l,saved:l,received:l}),(0,p.jsxs)(`form`,{"data-slot":`sidebar-settings`,"data-reports-dirty":``,className:`flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6`,onSubmit:e=>{e.preventDefault(),S.success&&!m.some(([e])=>C(e))&&!T.isPending&&T.mutate(S.data)},children:[(0,p.jsx)(`p`,{id:`sidebar-limits-help`,className:`text-sm text-muted-foreground`,children:`Limits apply to this project on desktop and mobile. The overall budget is shared in section order: Needs You, Finished, then Working. Each section also respects its own limit. Unlimited removes only that constraint.`}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pinned tasks and groups containing a pin bypass both limits. A task group counts as one row. Archived uses only the overall limit; archived pins are not exempt.`}),m.map(([e,t])=>(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`label`,{htmlFor:`sidebar-${e}`,className:`text-sm font-medium`,children:t}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,p.jsx)(`input`,{id:`sidebar-${e}`,type:`number`,inputMode:`numeric`,min:`1`,step:`1`,value:y[e]??``,disabled:y[e]===null||T.isPending,"aria-invalid":C(e),"aria-describedby":C(e)?`sidebar-${e}-error sidebar-limits-help`:`sidebar-limits-help`,onChange:t=>x({...y,[e]:t.target.value}),className:`min-h-[44px] w-28 rounded-md border border-input bg-card px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50`}),(0,p.jsxs)(`label`,{className:`flex min-h-[44px] cursor-pointer items-center gap-2 text-sm`,children:[(0,p.jsx)(`input`,{type:`checkbox`,"aria-label":`${t} Unlimited`,checked:y[e]===null,disabled:T.isPending,onChange:t=>x({...y,[e]:t.target.checked?null:String(r[e]??10)}),className:`size-4 accent-[var(--accent-strong)]`}),`Unlimited`]})]}),C(e)&&(0,p.jsx)(`p`,{id:`sidebar-${e}-error`,className:`text-sm text-danger`,children:`Enter a positive whole number or choose Unlimited.`})]},e)),(0,p.jsx)(u,{type:`submit`,className:`min-h-[44px] self-start`,variant:`primary`,disabled:!w||!S.success||m.some(([e])=>C(e))||T.isPending,children:T.isPending?`Saving…`:`Save sidebar limits`}),T.isError&&(0,p.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not save sidebar limits: `,T.error.message]}),T.isSuccess&&!w&&(0,p.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Sidebar limits saved.`})]})}function _(e){let t=i(e);return Object.fromEntries(m.map(([e])=>[e,t[e]===null?null:String(t[e])]))}function v(e,t){return m.every(([n])=>e[n]===t[n])}export{h as SidebarSection};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{m as i,p as a}from"./live-reads-Crd6fVGH.js";import{S as o,pi as s}from"./project-scope-context-Rv6S_BXt.js";import{n as c}from"./toaster-BXnLIU3z.js";import{Bt as l,Wt as u,_ as d}from"./queries-qCF-eOqZ.js";import{g as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{O as p,T as m,X as h,Y as g,ct as _,l as v,ot as y,tt as b,u as x}from"./design-icons-CzEoMH9c.js";import{t as S}from"./button-B7MKxYjT.js";import{t as C}from"./project-router-CLJTc7gv.js";import{f as w,l as T}from"./skills-pM_PouEs.js";import{d as E,n as D,s as O,t as k,u as A}from"./page-shell-7pLJMOgh.js";import{En as j,V as M,Wn as N,bn as P}from"./index-CvVmG4Yu.js";var F=e(t(),1),I=n(),L=e=>e.split(`@`)[0]||e,R={project:0,user:1,plugin:2,system:3,other:4},z={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function B(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:L(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:z[t],kind:t}}function V(e){let t=new Map;for(let n of e){let e=B(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>R[e.kind]-R[t.kind]||e.label.localeCompare(t.label))}function H(e){let t=e.plugin?`${L(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var U={project:m,user:_,plugin:p,system:p,other:p};function W({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,F.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,I.jsx)(`div`,{"data-slot":`skills-list`,className:`overflow-hidden rounded-xl border border-border bg-card`,children:e.map(e=>{let o=n||!a.has(e.key);return(0,I.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,I.jsx)(G,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,I.jsx)(K,{skill:e,open:e.id===t,runner:r,account:i},w(e))):null]},e.key)})})}function G({group:e,open:t,onToggle:n}){let i=U[e.kind];return(0,I.jsx)(`h2`,{className:`m-0`,children:(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:n,className:`flex min-h-10 w-full items-center gap-2 bg-muted/45 px-3.5 text-left text-xs font-semibold text-muted-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:text-foreground`,children:[(0,I.jsx)(x,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,I.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,I.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function K({skill:e,open:t,runner:n,account:r}){let i=j({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,I.jsxs)(`details`,{"data-slot":`skill-row`,"data-skill":e.id,"data-skill-path":e.path,name:`skill-details`,open:t||void 0,className:`group/skill border-t border-border/60 open:bg-sidebar-row-selected`,children:[(0,I.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-3 py-2 pr-3.5 pl-9 focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:bg-sidebar-row-hover [&::-webkit-details-marker]:hidden`,children:[(0,I.jsxs)(`span`,{className:`grid min-w-0 flex-1 grid-cols-1 items-center gap-x-4 gap-y-0.5 sm:grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)]`,children:[(0,I.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:H(e)}),e.description?(0,I.jsx)(`span`,{className:`min-w-0 line-clamp-2 text-[13px] leading-snug text-muted-foreground [overflow-wrap:anywhere] group-open/skill:hidden`,title:e.description,children:e.description}):null]}),(0,I.jsx)(v,{"data-slot":`skill-row-cue`,"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground transition-transform group-open/skill:rotate-180 motion-reduce:transition-none`})]}),(0,I.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,I.jsx)(M,{skill:e,heading:null,actions:(0,I.jsx)(S,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,I.jsx)(C,{to:i,children:`Start task`})})})})]})}function q(){let e=d(),[t,n]=(0,F.useState)(null),[i,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(``),[l]=f(),p=t??e.data?.defaultRunner,{runner:m}=a(p??`claude`),_=i?.runner===m?i.id:null,v=e=>o(e===null?null:{runner:m,id:e}),y=u(p,_),b=Q(m,y.account),x=y.data??[],w=T(x,s);return(0,I.jsxs)(A,{route:`skills`,density:y.isPending?`full`:E(w.length),className:`max-md:[padding-block-end:5rem]`,bodyClassName:`gap-5`,header:{title:`Skills`,subtitle:`The skills each agent loads in this project, as its runner reports them.`,secondaryActions:(0,I.jsxs)(O,{variant:`outline`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,I.jsx)(g,{"aria-hidden":`true`,className:r(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})},sparseFooter:!y.isPending&&w.length>0?(0,I.jsx)(D,{summary:`${w.length} ${w.length===1?`skill`:`skills`} available for this runner. Type / in New task to invoke one, or chain them into a workflow.`,actions:(0,I.jsx)(S,{variant:`outline`,size:`sm`,asChild:!0,className:`max-md:min-h-11`,children:(0,I.jsx)(C,{to:`/workflows`,children:`Open workflows`})})}):void 0,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(Y,{runner:m,onChange:e=>{n(e),v(null)}}),(0,I.jsx)(X,{runner:m,account:_,onChange:v}),(0,I.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,"data-slot":`skills-count`,children:y.list?`${x.length} ${x.length===1?`skill`:`skills`}${y.list.source===`cache`?` · from cache`:``}`:null})]}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,I.jsx)(N,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:s,onChange:e=>c(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-9 text-[13px]`})]}),(0,I.jsx)(Z,{query:y}),y.isPending?(0,I.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,I.jsx)(J,{skills:x,matches:w,search:s,onClearSearch:()=>c(``),onRefresh:()=>void b.run(),openId:l.get(`skill`),runner:m,account:y.account??null,unchecked:y.unchecked})]})}function J({skills:e,matches:t,search:n,onClearSearch:r,onRefresh:i,openId:a,runner:o,account:s,unchecked:c}){return e.length===0?c?null:(0,I.jsx)(k,{icon:(0,I.jsx)(b,{}),title:`No skills reported by this runner and account.`,description:`Add a skill to this repository or your runner home, then re-read to refresh the inventory.`,actions:(0,I.jsx)(S,{variant:`outline`,className:`max-md:min-h-11`,onClick:i,children:`Re-read skills`})}):t.length===0?(0,I.jsx)(k,{icon:(0,I.jsx)(h,{}),title:`No skills match “${n.trim()}”.`,description:`Try a different keyword or clear the filter to browse every available skill.`,actions:(0,I.jsx)(S,{variant:`outline`,className:`max-md:min-h-11`,onClick:r,children:`Clear filter`})}):(0,I.jsx)(W,{groups:V(t),openId:a,searching:n.trim()!==``,runner:o,account:s})}function Y({runner:e,onChange:t}){let n=i().data;return n?(0,I.jsx)(`div`,{role:`group`,"aria-label":`Runner`,className:`flex max-w-full gap-1 overflow-x-auto rounded-lg border border-border bg-muted/60 p-1`,children:n.runners.map(n=>(0,I.jsx)(`button`,{type:`button`,"aria-pressed":n.id===e,onClick:()=>t(n.id),className:`h-8 shrink-0 rounded-md border border-transparent px-3 text-[13px] font-normal text-muted-foreground transition-colors focus-visible:outline-2 aria-pressed:border-border aria-pressed:bg-card aria-pressed:font-semibold aria-pressed:text-foreground aria-pressed:shadow-xs pointer-hover:text-foreground max-md:h-11`,children:n.displayName},n.id))}):null}function X({runner:e,account:t,onChange:n}){let r=P().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,I.jsxs)(`div`,{className:`relative inline-flex items-center`,children:[(0,I.jsxs)(`select`,{"aria-label":`Account`,value:t??``,onChange:e=>n(e.target.value||null),className:`h-[38px] appearance-none rounded-lg border border-border bg-card pr-8 pl-3 text-[13px] text-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,I.jsx)(`option`,{value:``,children:`Account: project default`}),r.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))]}),(0,I.jsx)(v,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 size-3.5 text-muted-foreground`})]})}function Z({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,I.jsxs)(`div`,{className:`grid gap-1.5 rounded-lg border border-pending/40 bg-pending/10 px-3.5 py-2.5 text-[13px]`,children:[e.unchecked&&!e.isPending?(0,I.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,I.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,I.jsxs)(`span`,{children:[`Skill list unavailable. `,e.list?.reason??e.error?.message,` You can still type a skill id when starting a task.`]})]}):null,t.map((e,t)=>(0,I.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,I.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,I.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function Q(e,t){let n=s(),[r,i]=(0,F.useState)(!1),a=l.runnerSkills(e,t);return{running:r,run:async()=>{i(!0);try{n.setQueryData(a,await o(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:a.slice(0,3)})}catch(e){c(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{i(!1)}}}}export{q as SkillsRoute};
@@ -0,0 +1 @@
1
+ function e(e){return e.scope===`repo`}function t(e){return JSON.stringify([e.id,e.path??null])}function n(e){return{id:e.id,...e.path===void 0?{}:{path:e.path}}}function r(t){return[...t].sort((t,n)=>Number(!e(t))-Number(!e(n)))}function i(t,n,{mostUsedLimit:r=5}={}){let i=t.map((e,t)=>({skill:e,index:t,count:o(n,e.id)})).filter(e=>e.count>0).sort((t,n)=>n.count-t.count||Number(!e(t.skill))-Number(!e(n.skill))||t.index-n.index).slice(0,r).map(e=>e.skill),a=new Set(i),s=t.filter(e=>!a.has(e));return{mostUsed:i,project:s.filter(e),global:s.filter(t=>!e(t))}}function a(e,t){let n=i(e,t);return[...n.mostUsed,...n.project,...n.global]}function o(e,t){if(!e||!Object.hasOwn(e,t))return 0;let n=e[t];return typeof n==`number`?n:0}function s(e,t){return{...e,[t]:o(e,t)+1}}function c(e,t){if(t===``)return!0;let n=e.toLowerCase(),r=t.toLowerCase(),i=0;for(let e of r){if(i=n.indexOf(e,i),i===-1)return!1;i+=1}return!0}var l=/[\s\-/_.]/;function u(e,t){let n=0;for(let r=e.indexOf(t);r!==-1;r=e.indexOf(t,r+1)){let i=1,a=e[r-1];if(r===0||a!==void 0&&l.test(a)){let n=e[r+t.length];i=n===void 0||l.test(n)?3:2}if(i>n&&(n=i),n===3)break}return n}function d(e,t,n){let r=t.toLowerCase().split(/\s+/).filter(Boolean);if(r.length===0)return 1;let i=[e,...n??[]].join(` `).toLowerCase(),a=0;for(let e of r){let t=u(i,e);if(t===0)return 0;a+=t}return a/(r.length*3)}function f(e,t){if(t===``)return 1;let n=e.toLowerCase(),r=t.toLowerCase();if(n===r)return 6;if(n.startsWith(r))return 5;let i=n.indexOf(r);if(i>0){let e=n[i-1];return e!==void 0&&l.test(e)?4:3}return+!!c(n,r)}function p(e,t){let n=e.split(`-`).filter(Boolean);return t?[...n,t]:n}function m(e,t,n,r){let i=n.toLowerCase().split(/\s+/).filter(Boolean);if(i.length===0)return 1;let a=0;for(let n of i){let i=f(e,n),o=Math.max(t?f(t,n):0,r?f(r,n):0);if(i===0&&o===0)return 0;a+=i>0?i+10:o}return a}function h(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean),r=0;for(let t of n)r+=f(e,t);return r}function g(e,t,n){return t.trim()===``?[...e]:e.map((e,r)=>{let i=m(e.name,e.description,t,e.id);return{item:e,index:r,count:o(n,e.id??e.name),nameScore:h(e.name,t),score:i}}).filter(e=>e.score>0).sort((e,t)=>t.nameScore-e.nameScore||t.score-e.score||t.count-e.count||e.index-t.index).map(e=>e.item)}function _(e,t,n){return g(e,t,n)}function v(e,t,n){return t.trim()===``?{...i(e,n),ranked:null}:{mostUsed:[],project:[],global:[],ranked:_(r(e),t,n)}}function y(e,t){return g(e,t)}function b(e,t,n){return g(a(e,n),t,n)}export{d as a,m as c,y as d,t as f,e as i,_ as l,b as n,a as o,p,c as r,n as s,s as t,v as u};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-BHp8sXmF.js";var t=e(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),n=e(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]);export{t as n,n as t};