@openartifactsai/cli 0.23.0 → 0.24.0

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 (128) hide show
  1. package/SKILL.md +7 -2
  2. package/package.json +1 -1
  3. package/vendor/CHANGELOG.md +1082 -0
  4. package/vendor/artifact-types/page/SKILL.md +3 -1
  5. package/vendor/artifact-types/page/artifact-type/reference/capabilities.d.ts +0 -1
  6. package/vendor/artifact-types/page/artifact-type/reference/capabilities.md +1 -1
  7. package/vendor/frame-host/client/comments.js +20 -19
  8. package/vendor/frame-host/client/page.js +1352 -0
  9. package/vendor/frame-host/client/review.js +279 -0
  10. package/vendor/frame-host/client/runtime.js +8 -6
  11. package/vendor/frame-host/client/sample.js +1 -1
  12. package/vendor/frame-host/client/shell.css +1 -0
  13. package/vendor/frame-host/client/shell.js +206 -6
  14. package/vendor/frame-host/client/translate.js +375 -0
  15. package/vendor/frame-host/frame-host.mjs +91 -30
  16. package/vendor/home/assets/{browser-models-DWkPVHmp.js → browser-models-Ceon9UIN.js} +4 -4
  17. package/vendor/home/assets/library-RBaguEV9.js +397 -0
  18. package/vendor/home/assets/main-BKHYngAm.js +2 -0
  19. package/vendor/home/assets/main-Cw3mY0u9.css +1 -0
  20. package/vendor/home/assets/node.browser-BFrmG6rb.js +1 -0
  21. package/vendor/home/assets/node.browser-CPQVYRMD.js +1 -0
  22. package/vendor/home/assets/react-DQymU5Da.js +47 -0
  23. package/vendor/home/index.html +3 -3
  24. package/vendor/home/library/index.html +2 -2
  25. package/vendor/open-artifacts.mjs +2516 -1072
  26. package/vendor/runtime.json +1 -1
  27. package/vendor/shell/assets/{browser-models-BzwWAVuE.js → browser-models-CiXqE7b9.js} +4 -4
  28. package/vendor/shell/assets/index-BhxD6amu.js +53 -0
  29. package/vendor/shell/assets/index-Cw3mY0u9.css +1 -0
  30. package/vendor/shell/assets/{node.browser-BgqLTfql.js → node.browser-ByUkO9oN.js} +1 -1
  31. package/vendor/shell/assets/{node.browser-BvryIsl7.js → node.browser-CSEwiusG.js} +1 -1
  32. package/vendor/shell/index.html +2 -2
  33. package/vendor/type-server/cli.mjs +87 -26
  34. package/vendor/type-server/editors/data/assets/{index-CX_sn7ZZ.js → index-B0E35R1E.js} +5 -4
  35. package/vendor/type-server/editors/data/index.html +1 -1
  36. package/vendor/type-server/editors/design/assets/{index-BpNUmTVD.js → index-BOc3kd6N.js} +78 -77
  37. package/vendor/type-server/editors/design/index.html +1 -1
  38. package/vendor/type-server/editors/design-system/assets/{index-CP6AEO1P.js → index-B7MtPrtk.js} +5 -4
  39. package/vendor/type-server/editors/design-system/index.html +1 -1
  40. package/vendor/type-server/editors/docs/assets/{abnfDiagram-WEYOIA3C-Do25i7oS.js → abnfDiagram-WEYOIA3C-DcfGbMC9.js} +1 -1
  41. package/vendor/type-server/editors/docs/assets/{architectureDiagram-ZHVYKT53-BLlpboc2.js → architectureDiagram-ZHVYKT53-CfcGFZjM.js} +1 -1
  42. package/vendor/type-server/editors/docs/assets/{blockDiagram-RJAE7QA3-D0rO5p7M.js → blockDiagram-RJAE7QA3-C5s3aXD2.js} +1 -1
  43. package/vendor/type-server/editors/docs/assets/{c4Diagram-XDPPPE54-OoTiysJI.js → c4Diagram-XDPPPE54-BJgchX97.js} +1 -1
  44. package/vendor/type-server/editors/docs/assets/channel-B2TtMfsN.js +1 -0
  45. package/vendor/type-server/editors/docs/assets/{chunk-2E7WHVMD-yBl5BEaI.js → chunk-2E7WHVMD-BgQ4xapY.js} +1 -1
  46. package/vendor/type-server/editors/docs/assets/{chunk-2Q5K7J3B-DHKM5gd6.js → chunk-2Q5K7J3B-B1ktgQTo.js} +1 -1
  47. package/vendor/type-server/editors/docs/assets/{chunk-4EMNKR2T-B-f8WPM6.js → chunk-4EMNKR2T-Co-2oGfa.js} +1 -1
  48. package/vendor/type-server/editors/docs/assets/{chunk-55XCU76K-n8RDJr36.js → chunk-55XCU76K-BqpDaZgl.js} +1 -1
  49. package/vendor/type-server/editors/docs/assets/{chunk-5VM5RSS4-DzLzcqXE.js → chunk-5VM5RSS4-BJPvauTV.js} +1 -1
  50. package/vendor/type-server/editors/docs/assets/{chunk-JWPE2WC7-BLXkUVcK.js → chunk-JWPE2WC7-NCBAl-SW.js} +1 -1
  51. package/vendor/type-server/editors/docs/assets/{chunk-VQ5W62QI-DAGNVD29.js → chunk-VQ5W62QI-DPzloG3R.js} +1 -1
  52. package/vendor/type-server/editors/docs/assets/{chunk-XXDRQBXY-fgVyAbWV.js → chunk-XXDRQBXY-D08KAfXl.js} +1 -1
  53. package/vendor/type-server/editors/docs/assets/{chunk-ZCHMQSOR-D90xHR9n.js → chunk-ZCHMQSOR-CLWESu07.js} +2 -2
  54. package/vendor/type-server/editors/docs/assets/{classDiagram-v2-4MYWR3UA-uk1mPogR.js → classDiagram-v2-4MYWR3UA-BSPsabsn.js} +1 -1
  55. package/vendor/type-server/editors/docs/assets/{core-BMv5rGOd.js → core-Cqu2ilBr.js} +1 -1
  56. package/vendor/type-server/editors/docs/assets/{cose-bilkent-JH36ORCC-BJdqW8l3.js → cose-bilkent-JH36ORCC-D6at9M78.js} +1 -1
  57. package/vendor/type-server/editors/docs/assets/{cynefin-EF2NZ3EQ-BCce_ZhK.js → cynefin-EF2NZ3EQ-BTylb97F.js} +1 -1
  58. package/vendor/type-server/editors/docs/assets/{cynefinDiagram-WF24UDRP-DxD-4yjR.js → cynefinDiagram-WF24UDRP-Din3pKvL.js} +1 -1
  59. package/vendor/type-server/editors/docs/assets/{dagre-NK4GIZVX-B3VAS51Y.js → dagre-NK4GIZVX-5qfRwQnt.js} +1 -1
  60. package/vendor/type-server/editors/docs/assets/{diagram-CBK3MWTC-B0kHeUdr.js → diagram-CBK3MWTC-BnrAjIhJ.js} +1 -1
  61. package/vendor/type-server/editors/docs/assets/{diagram-I5XIIV2D-BCRvsLAu.js → diagram-I5XIIV2D-CH_xkoKv.js} +1 -1
  62. package/vendor/type-server/editors/docs/assets/{diagram-ODIL2UCW-DFOTsSuA.js → diagram-ODIL2UCW-D5dns2KC.js} +1 -1
  63. package/vendor/type-server/editors/docs/assets/{diagram-PFBEJUXE-_DT3jk0i.js → diagram-PFBEJUXE-D-3cnWXB.js} +1 -1
  64. package/vendor/type-server/editors/docs/assets/{diagram-RJA3I4VV-UFrdnTgs.js → diagram-RJA3I4VV-DImejfKM.js} +1 -1
  65. package/vendor/type-server/editors/docs/assets/{diagram-TYUNFSNR-DrbWyZOX.js → diagram-TYUNFSNR-DscxSG0M.js} +1 -1
  66. package/vendor/type-server/editors/docs/assets/{ebnfDiagram-V4P3TTPT-M-DCWgZM.js → ebnfDiagram-V4P3TTPT-C4wwb0NC.js} +1 -1
  67. package/vendor/type-server/editors/docs/assets/{elk-QONTBCTQ-l6XmbRQj.js → elk-QONTBCTQ-O05tgWzI.js} +1 -1
  68. package/vendor/type-server/editors/docs/assets/{erDiagram-KYQIGQAA-CHqbnmEE.js → erDiagram-KYQIGQAA-D171V8gY.js} +1 -1
  69. package/vendor/type-server/editors/docs/assets/{flowDiagram-IUGLLWBU-BzkFyGCL.js → flowDiagram-IUGLLWBU-DcvtJsgJ.js} +1 -1
  70. package/vendor/type-server/editors/docs/assets/{ganttDiagram-R7GPNTJY-BcNaSXNv.js → ganttDiagram-R7GPNTJY-DcuQ9a5m.js} +1 -1
  71. package/vendor/type-server/editors/docs/assets/{gitGraphDiagram-PDYL7XHY-JaNdSZbv.js → gitGraphDiagram-PDYL7XHY-iQoh6Yen.js} +1 -1
  72. package/vendor/type-server/editors/docs/assets/{index-BMNUnwXE.js → index-BNk_Jpgl.js} +49 -48
  73. package/vendor/type-server/editors/docs/assets/{infoDiagram-MVDRKAX5-Cl2Q_Ylf.js → infoDiagram-MVDRKAX5-DECkmgI6.js} +1 -1
  74. package/vendor/type-server/editors/docs/assets/{ishikawaDiagram-HPEHV2GE-umirqIpN.js → ishikawaDiagram-HPEHV2GE-CK0mATvD.js} +1 -1
  75. package/vendor/type-server/editors/docs/assets/{journeyDiagram-BOSHW7O7-HMtvkXvq.js → journeyDiagram-BOSHW7O7-Dz1u7rfA.js} +1 -1
  76. package/vendor/type-server/editors/docs/assets/{kanban-definition-FNSA4HC5-CYouTBUM.js → kanban-definition-FNSA4HC5-B1-0Mp0R.js} +1 -1
  77. package/vendor/type-server/editors/docs/assets/{mermaid.core-BEcbgpI8.js → mermaid.core-DhXbeevr.js} +4 -4
  78. package/vendor/type-server/editors/docs/assets/{mindmap-definition-6OY57UG3-BnwugHtV.js → mindmap-definition-6OY57UG3-Czy5C8sa.js} +1 -1
  79. package/vendor/type-server/editors/docs/assets/{pegDiagram-ECIUJNBX-DqT6jxo7.js → pegDiagram-ECIUJNBX-C97juwaO.js} +1 -1
  80. package/vendor/type-server/editors/docs/assets/{pieDiagram-GNMPY74T-CBKjnr1W.js → pieDiagram-GNMPY74T-rrh7flvh.js} +1 -1
  81. package/vendor/type-server/editors/docs/assets/{quadrantDiagram-D57K4MC3-CdTG11Ff.js → quadrantDiagram-D57K4MC3-D3xBy1ZX.js} +1 -1
  82. package/vendor/type-server/editors/docs/assets/{railroadDiagram-Y72NRBL7-BZgG8r2y.js → railroadDiagram-Y72NRBL7-B3r2jnFu.js} +1 -1
  83. package/vendor/type-server/editors/docs/assets/{requirementDiagram-EQYSW5RA-CutdnAmY.js → requirementDiagram-EQYSW5RA-BQ47C1Ra.js} +1 -1
  84. package/vendor/type-server/editors/docs/assets/{sankeyDiagram-SY24JHO5-DBaoPDhR.js → sankeyDiagram-SY24JHO5-CzPG7mjJ.js} +1 -1
  85. package/vendor/type-server/editors/docs/assets/{sequenceDiagram-BLEHNHQU-B6YZp-Wu.js → sequenceDiagram-BLEHNHQU-Bg7XKU4E.js} +1 -1
  86. package/vendor/type-server/editors/docs/assets/{sizeCapture-INFHLROL-xATlK6Zl.js → sizeCapture-INFHLROL-CKrHufer.js} +1 -1
  87. package/vendor/type-server/editors/docs/assets/{stateDiagram-v2-A6IESKWZ-C7BND5vv.js → stateDiagram-v2-A6IESKWZ-CW9zsuBs.js} +1 -1
  88. package/vendor/type-server/editors/docs/assets/{swimlanes-B3ENRKFQ-WYLzM6hb.js → swimlanes-B3ENRKFQ-ucM-4idg.js} +1 -1
  89. package/vendor/type-server/editors/docs/assets/swimlanesDiagram-AYQRV4AK-DuNOy5jj.js +8 -0
  90. package/vendor/type-server/editors/docs/assets/{timeline-definition-JXYKGLGB-BXC0F4xE.js → timeline-definition-JXYKGLGB-D__Vd4zC.js} +1 -1
  91. package/vendor/type-server/editors/docs/assets/{usecaseDiagram-WPOLBNNX-Cx58jkEj.js → usecaseDiagram-WPOLBNNX-MvJGETnL.js} +1 -1
  92. package/vendor/type-server/editors/docs/assets/{vennDiagram-Q3Y3IDCW-DhdwpApW.js → vennDiagram-Q3Y3IDCW-DqUtQLGR.js} +1 -1
  93. package/vendor/type-server/editors/docs/assets/{wardleyDiagram-IVAIDKWA-CBdbPWVr.js → wardleyDiagram-IVAIDKWA-usWt7-Hk.js} +1 -1
  94. package/vendor/type-server/editors/docs/assets/{xychartDiagram-4URNHDU4-Cb0tcPqs.js → xychartDiagram-4URNHDU4-D2RJz2yB.js} +1 -1
  95. package/vendor/type-server/editors/docs/index.html +1 -1
  96. package/vendor/type-server/editors/motion/assets/{gif-jobs-Bq4rwLBV.js → gif-jobs-Bn-j8izW.js} +1 -1
  97. package/vendor/type-server/editors/motion/assets/{index-BDOqtmcc.js → index-C6NXgLix.js} +7 -6
  98. package/vendor/type-server/editors/motion/assets/{src-8SKXU1IY.js → src-C0eDPv3h.js} +1 -1
  99. package/vendor/type-server/editors/motion/index.html +1 -1
  100. package/vendor/type-server/editors/sheets/assets/{index-BY38EAff.js → index-BzbNSKJF.js} +7 -6
  101. package/vendor/type-server/editors/sheets/assets/{workbook-worker-CRtLrZhP.js → workbook-worker-3zEBX9ep.js} +3 -2
  102. package/vendor/type-server/editors/sheets/index.html +1 -1
  103. package/vendor/type-server/editors/slides/assets/{index-B51oMclO.js → index-BfTA-zoQ.js} +7 -6
  104. package/vendor/type-server/editors/slides/assets/{src-CdsEFSuC.js → src-DPkvzCL6.js} +1 -1
  105. package/vendor/type-server/editors/slides/index.html +1 -1
  106. package/vendor/type-server/editors/whiteboard/assets/{drawing-look-worker-Dd2iYbXC.js → drawing-look-worker-CYqIJdVf.js} +4 -3
  107. package/vendor/type-server/editors/whiteboard/assets/{gif-jobs-DmIqT6gk.js → gif-jobs-CPyG3MAt.js} +1 -1
  108. package/vendor/type-server/editors/whiteboard/assets/{index-B3oRKavi.js → index-BBgN0Gcr.js} +2 -2
  109. package/vendor/type-server/editors/whiteboard/assets/{index-CTf9pd4S.js → index-BKFgBbwk.js} +8 -7
  110. package/vendor/type-server/editors/whiteboard/index.html +1 -1
  111. package/vendor/type-server/shell/assets/{browser-models-BzwWAVuE.js → browser-models-CiXqE7b9.js} +4 -4
  112. package/vendor/type-server/shell/assets/index-BhxD6amu.js +53 -0
  113. package/vendor/type-server/shell/assets/index-Cw3mY0u9.css +1 -0
  114. package/vendor/type-server/shell/assets/{node.browser-BgqLTfql.js → node.browser-ByUkO9oN.js} +1 -1
  115. package/vendor/type-server/shell/assets/{node.browser-BvryIsl7.js → node.browser-CSEwiusG.js} +1 -1
  116. package/vendor/type-server/shell/index.html +2 -2
  117. package/vendor/home/assets/RuntimeUpdate-BwvJ9sYp.js +0 -43
  118. package/vendor/home/assets/library-CyeaNaQo.js +0 -226
  119. package/vendor/home/assets/main-DUyobyFI.js +0 -5
  120. package/vendor/home/assets/main-DXpv3z2x.css +0 -1
  121. package/vendor/home/assets/node.browser-Cy4GM7Yl.js +0 -1
  122. package/vendor/home/assets/node.browser-nUfHL25Z.js +0 -1
  123. package/vendor/shell/assets/index-BIHLxOO6.js +0 -52
  124. package/vendor/shell/assets/index-DXpv3z2x.css +0 -1
  125. package/vendor/type-server/editors/docs/assets/channel-Cgat34ii.js +0 -1
  126. package/vendor/type-server/editors/docs/assets/swimlanesDiagram-AYQRV4AK-Bwh1tnzE.js +0 -8
  127. package/vendor/type-server/shell/assets/index-BIHLxOO6.js +0 -52
  128. package/vendor/type-server/shell/assets/index-DXpv3z2x.css +0 -1
@@ -1,226 +0,0 @@
1
- import{j as e,r as g,aW as Qe,bd as Aa,aV as Pa,bL as La,bM as Oa,b8 as za,bj as Me,be as Fa,bN as Ra,b0 as Da,b1 as Ia,aY as $a,aZ as E,aX as _a,bO as Ba,a$ as Ce,bF as Ua,bJ as Ha,bh as Wa,b2 as Ka,bP as Ya,bQ as Va,bR as Ga,b4 as qa,bS as Za,bT as Ke}from"./RuntimeUpdate-BwvJ9sYp.js";const Ja={},Qa={getSnapshot:()=>Ja,subscribe:()=>()=>{}},Xa={updates:[],phase:"idle",to:"",restart:!1,failure:null,dismissed:""},et={getSnapshot:()=>Xa,subscribe:()=>()=>{},start(){},later(){},close(){},reopen(){},t:a=>a},Xe=g.createContext(null);function at({env:a,children:t}){return e.jsx(Xe.Provider,{value:a,children:t})}function T(){const a=g.useContext(Xe);if(a===null)throw new Error("usePageEnv needs an EnvProvider");return a}function tt(){const{sessions:a}=T(),t=g.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);return g.useCallback(o=>t.byId?.[o]?.title?.trim()??"",[t])}function K(){const a=T().updates??et;return{...g.useSyncExternalStore(a.subscribe,a.getSnapshot),offer:a}}const ae=Object.freeze({sort:"opened",types:[],projects:[],date:"any",sharing:"any",pinned:!1}),ot=["opened","updated","created","name"],nt=Aa;function ye(a){return a.types.length>0||a.projects.length>0||a.date!=="any"||a.sharing!=="any"||a.pinned}const rt=Pa;function st(a,t,o){if(t==="name")return[...a].sort((r,l)=>r.title.localeCompare(l.title,o));const n=t==="updated"?"updatedAt":t==="created"?"createdAt":"openedAt";return[...a].sort((r,l)=>r[n]<l[n]?1:r[n]>l[n]?-1:0)}function it(a,{filters:t,query:o,now:n,locale:r,sessionTitle:l}){const d=o.trim().toLowerCase(),u=a.filter(c=>{if(t.types.length>0&&!t.types.includes(c.type)||t.projects.length>0&&!t.projects.includes(c.project??Qe)||t.pinned&&!c.pinned||t.sharing!=="any"&&c.shared!==(t.sharing==="shared")||!rt(c.openedAt,t.date,n))return!1;if(!d)return!0;const p=c.sessionId&&l?l(c.sessionId):"";return c.title.toLowerCase().includes(d)||p.toLowerCase().includes(d)||c.root.toLowerCase().includes(d)||(c.project??"").toLowerCase().includes(d)});return st(u,t.sort,r)}function lt(a){const t=new Map;for(const o of a)t.set(o.type,(t.get(o.type)??0)+1);return t}const ea={panel:"Open Artifacts",title:"Open Artifacts","time.locale":"zh-CN",search:"搜索作品","search.clear":"清除搜索","type.slides":"幻灯片","type.design":"设计","type.design-system":"设计系统","type.data":"数据","type.docs":"文档","type.motion":"动画","type.whiteboard":"白板","type.sheets":"表格","create.heading":"新建","create.new":"新建","create.session":"新会话","view.list":"列表视图","view.grid":"网格视图","filter.button":"排序和筛选","filter.sort":"排序方式","filter.type":"类型","filter.project":"项目","filter.noProject":"不属于项目","filter.date":"打开时间","filter.sharing":"共享","filter.pinned":"已固定","filter.any":"不限","filter.some":"{count} 项","filter.clear":"清除筛选","sort.opened":"最近打开","sort.updated":"最近修改","sort.created":"创建时间","sort.name":"名称","date.any":"不限","date.today":"今天","date.yesterday":"昨天","date.week":"最近 7 天","date.month":"最近 30 天","sharing.any":"不限","sharing.shared":"已共享","sharing.private":"未共享","card.opened":"{time}打开","card.justNow":"刚刚打开","card.opening":"正在打开…","card.shared":"已在局域网共享","card.webShared":"已分享到网上","action.more":"更多操作","action.pin":"固定","action.unpin":"取消固定","action.rename":"重命名","action.copy":"复制链接","action.share":"分享…","action.delete":"删除","rename.title":"重命名作品","rename.save":"保存","dialog.cancel":"取消","dialog.close":"关闭","changelog.title":"更新日志","changelog.new":"Open Artifacts {version} 更新了这些","changelog.all":"更新日志","changelog.gotIt":"知道了","changelog.more":"展开其余 {count} 条","changelog.version":"Open Artifacts {version}","changelog.installed":"当前版本","changelog.available":"可更新","changelog.none":"还没有更新日志。","changelog.releases":"在 GitHub 上查看","changelog.section.added":"新增","changelog.section.changed":"改进","changelog.section.fixed":"修复","changelog.section.removed":"移除","delete.title":"删除“{title}”?","delete.moves":"这会移除这个作品,它的文件夹移到 Open Artifacts 的回收站,可以在提示里撤销。","delete.confirm":"删除","delete.webShared":"它已分享到网上,删除不会停止分享:{url} 仍然可以打开。要停止,先在它的分享面板里点“停止分享”,或者去 {manage}。","toast.copied":"链接已复制到剪贴板。","toast.copyRemote":"作品的链接只在运行 Open Artifacts 的电脑上能打开,这里打开的那个是你本人的入口,不能给别人。要分享,在作品页面里点“分享”。","toast.deleted":"已删除“{title}”。","toast.removed":"已从作品里移除“{title}”,文件夹还在原处。","toast.undo":"撤销","toast.close":"关闭","empty.title":"还没有作品","empty.body":"本机任意 Agent 用 Artifact 工具做出来的东西都会出现在这里。点上面的入口开始做一个。","empty.noMatches":"没有符合条件的作品","load.error":"读取作品列表失败:{message}","load.retry":"重试","open.typeMissing":"没有安装「{type}」类型,打不开这个作品。","open.failed":"打不开:{message}","open.noSession":"原来的对话已不在,作品在新窗口里打开了。","open.blocked":"浏览器拦下了新窗口:允许这个网站弹出窗口后再试。","action.failed":"没有做成:{message}","tile.beta":"Beta","peek.by":"来自 Open Artifacts","peek.start":"从提示词开始","about.docs":"团队一起读、评论、直接修改的文档,Agent 负责让它保持最新。","about.slides":"能直接演示的幻灯片,可以套用设计系统换风格,也能导出成 PowerPoint。","about.sheets":"带公式和格式的表格,你和 Agent 一起填。","about.design":"界面、流程和图形,作为画板排在同一张画布上,也可以动手改。","about.design-system":"颜色、字体、组件和素材,幻灯片和设计都照着它来做。","about.data":"用你的数据做的图表、数字和表格,每一项都标明出处。","about.whiteboard":"方框、箭头和便利贴,你和 Agent 都能在上面画。","about.motion":"一段在页面里直接播放的短动画,可以导出成 MP4、GIF 或网页。"},Ee=a=>Object.prototype.hasOwnProperty.call(ea,a),aa={panel:"Open Artifacts",title:"Open Artifacts","time.locale":"en",search:"Search artifacts","search.clear":"Clear search","type.slides":"Slides","type.design":"Design","type.design-system":"Design system","type.data":"Data","type.docs":"Docs","type.motion":"Motion","type.whiteboard":"Whiteboard","type.sheets":"Sheets","create.heading":"Make something new","create.new":"New","create.session":"New session","view.list":"List view","view.grid":"Grid view","filter.button":"Sort and filter","filter.sort":"Sort by","filter.type":"Type","filter.project":"Project","filter.noProject":"No project","filter.date":"Date opened","filter.sharing":"Sharing","filter.pinned":"Pinned","filter.any":"Any","filter.some":"{count} selected","filter.clear":"Clear filters","sort.opened":"Last opened","sort.updated":"Last edited","sort.created":"Date created","sort.name":"Name","date.any":"Any time","date.today":"Today","date.yesterday":"Yesterday","date.week":"Past 7 days","date.month":"Past 30 days","sharing.any":"Any","sharing.shared":"Shared","sharing.private":"Not shared","card.opened":"Opened {time}","card.justNow":"Opened just now","card.opening":"Opening…","card.shared":"Shared on the local network","card.webShared":"Shared on the web","action.more":"More actions","action.pin":"Pin","action.unpin":"Unpin","action.rename":"Rename","action.copy":"Copy link","action.share":"Share…","action.delete":"Delete","rename.title":"Rename artifact","rename.save":"Save","dialog.cancel":"Cancel","dialog.close":"Close","changelog.title":"Changelog","changelog.new":"What's new in Open Artifacts {version}","changelog.all":"Changelog","changelog.gotIt":"Got it","changelog.more":"Show {count} more","changelog.version":"Open Artifacts {version}","changelog.installed":"Installed","changelog.available":"Available","changelog.none":"No release notes yet.","changelog.releases":"View on GitHub","changelog.section.added":"Added","changelog.section.changed":"Changed","changelog.section.fixed":"Fixed","changelog.section.removed":"Removed","delete.title":"Delete {title}?","delete.moves":"This removes the artifact and moves its folder to Open Artifacts' trash. You can undo it from the notice.","delete.confirm":"Delete","delete.webShared":"It is shared to the web, and deleting it does not stop that: {url} keeps working. To stop it, use Stop sharing in its Share panel first, or go to {manage}.","toast.copied":"Link copied to clipboard.","toast.copyRemote":"An artifact's link opens only on the computer that runs Open Artifacts, and the one opened here is your own way in, not for others. To share it, use Share on its page.","toast.deleted":"Deleted “{title}”.","toast.removed":"Took “{title}” off your artifacts. Its folder stays where it is.","toast.undo":"Undo","toast.close":"Close","empty.title":"No artifacts yet","empty.body":"What an agent on this computer makes with the Artifact tool shows up here. Start one with a tile above.","empty.noMatches":"No artifacts match","load.error":"Could not read the artifacts: {message}","load.retry":"Try again","open.typeMissing":"The {type} type is not installed, so this artifact cannot open.","open.failed":"Could not open it: {message}","open.noSession":"The conversation is gone, so the artifact opened in a new window.","open.blocked":"The browser blocked the new window: allow pop-ups for this site and try again.","action.failed":"That did not work: {message}","tile.beta":"Beta","peek.by":"By Open Artifacts","peek.start":"Start with a prompt","about.docs":"A document your team reads, comments on and edits in place while the agent keeps it current.","about.slides":"A deck you can present, restyle with a design system and export to PowerPoint.","about.sheets":"A grid with formulas and formatting that you and the agent fill in together.","about.design":"Screens, flows and graphics laid out as artboards on one canvas you can edit by hand.","about.design-system":"Colors, type, components and assets that your decks and designs are built from.","about.data":"Charts, numbers and tables from your data, each marked with its source.","about.whiteboard":"Boxes, arrows and sticky notes you and the agent both draw on.","about.motion":"A short animated film that plays in place and exports as MP4, GIF or HTML."};function ta(a,t={}){return a.replace(/\{(\w+)\}/g,(o,n)=>t[n]??o)}const Ye=(a,t)=>ta(aa[a]??a,t);function ct(a){return typeof a!="function"?Ye:(t,o)=>{const n=a(t,o);return typeof n=="string"&&n!==t?ta(n,o):Ye(t,o)}}const ve=["docs","slides","sheets","design","design-system","data","whiteboard","motion"],oa=a=>ve.includes(a);function Ve(a){const t=[...new Set(a)],o=n=>oa(n)?ve.indexOf(n):ve.length+t.indexOf(n);return t.sort((n,r)=>o(n)-o(r))}const dt={docs:{wash:"#cce3fd",ink:"#1757ac",tint:"#3f8ef0"},slides:{wash:"#f7d9ca",ink:"#903710",tint:"#e8703a"},sheets:{wash:"#caecc8",ink:"#016c0f",tint:"#3d9e3a"},design:{wash:"#e4deff",ink:"#5437b8",tint:"#7a5cf0"},"design-system":{wash:"#fbe6bd",ink:"#865400",tint:"#c79a1b"},data:{wash:"#fbd4d4",ink:"#a42528",tint:"#e5484d"},whiteboard:{wash:"#fbd6e5",ink:"#902552",tint:"#d6409f"},motion:{wash:"#bfeee5",ink:"#006458",tint:"#14a38b"}},pt={page:{wash:"#d6e4ee",ink:"#2c5672",tint:"#4f86ad"}},ut={wash:"#ececec",ink:"#555555",tint:"#8a8a8a"},Y=a=>{const t=oa(a)?dt[a]:pt[a]??ut;return{"--oa-tint":t.tint,"--oa-wash":t.wash,"--oa-ink":t.ink}},ht=["whiteboard","data","sheets","motion"],V=a=>({display:"block",width:a,height:a,flex:"none"});function gt({size:a=16}){return e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:V(a),children:[e.jsx("path",{d:"M15 9V6a3 3 0 0 0-3-3H6a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h3"}),e.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"3"}),e.jsx("circle",{cx:"15",cy:"15",r:"2",fill:"currentColor",stroke:"none"})]})}function te({type:a,size:t=18}){const o={stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"},n=(()=>{switch(a){case"docs":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M6 2.25h5.6c.4 0 .78.16 1.06.44l3.65 3.65c.28.28.44.66.44 1.06v7.85A2.75 2.75 0 0 1 14 18H6a2.75 2.75 0 0 1-2.75-2.75V5A2.75 2.75 0 0 1 6 2.25Z",...o}),e.jsx("path",{d:"M12 2.4v2.85a2 2 0 0 0 2 2h2.6",...o})]});case"slides":return e.jsx(e.Fragment,{children:e.jsx("path",{d:"M1.25 2.75h17.5M2.75 2.75v8.75A2.25 2.25 0 0 0 5 13.75h10a2.25 2.25 0 0 0 2.25-2.25V2.75M10 13.75l-3 4M10 13.75l3 4",...o})});case"sheets":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"2.25",y:"2.25",width:"15.5",height:"15.5",rx:"3",...o}),e.jsx("path",{d:"M2.25 7.5h15.5M2.25 12.5h15.5M7 2.25v15.5",...o})]});case"design":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M10 2.25c-4.75 0-8.5 3.3-8.5 7.6 0 4.5 3.55 8.150 8.2 8.15 3.1 0 5.55-1.25 5.55-3.4 0-1.25-1.15-1.75-1.15-2.8 0-1.2 1.050-1.6 2.25-2.2 1.3-.65 2.15-1.5 2.15-3C18.5 3.95 14.6 2.25 10 2.25Z",...o}),e.jsx("circle",{cx:"8",cy:"6.6",r:"1.35",fill:"currentColor"}),e.jsx("circle",{cx:"12.4",cy:"6.9",r:"1.35",fill:"currentColor"}),e.jsx("circle",{cx:"5.2",cy:"10.3",r:"1.35",fill:"currentColor"})]});case"design-system":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"2.25",y:"2.25",width:"6.75",height:"6.75",rx:"1.75",...o}),e.jsx("circle",{cx:"14.4",cy:"5.6",r:"3.4",...o}),e.jsx("circle",{cx:"5.6",cy:"14.4",r:"3.4",...o}),e.jsx("rect",{x:"11",y:"11",width:"6.75",height:"6.75",rx:"1.75",...o})]});case"data":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M1.75 16.25V11.5c0-.97.78-1.75 1.75-1.750H7V4c0-.97.78-1.75 1.75-1.75h2c.97 0 1.75.78 1.75 1.75v2.25h3.75c.97 0 1.75.78 1.75 1.75v8.25c0 .97-.78 1.75-1.75 1.75H3.5c-.97 0-1.75-.78-1.75-1.75Z",...o}),e.jsx("path",{d:"M7 9.75V18M12.5 6.25V18",...o})]});case"whiteboard":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M11.52 8.25A5 5 0 1 0 8.25 11.52",...o}),e.jsx("rect",{x:"8.25",y:"8.25",width:"10",height:"10",rx:"2.25",...o})]});case"motion":return e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M3.75 6.6h2M1.5 10H5M3.75 13.4h2",...o}),e.jsx("circle",{cx:"13.75",cy:"10",r:"4.75",...o})]});case"page":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"2.25",y:"3.25",width:"15.5",height:"13.5",rx:"2.75",...o}),e.jsx("path",{d:"M2.25 7.25h15.5",...o}),e.jsx("circle",{cx:"5",cy:"5.25",r:".8",fill:"currentColor",stroke:"none"}),e.jsx("circle",{cx:"7.4",cy:"5.25",r:".8",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"m8 10.25-2 1.75 2 1.75M12 10.25l2 1.75-2 1.75",...o})]});default:return e.jsx("rect",{x:"3",y:"3",width:"14",height:"14",rx:"2",...o})}})();return e.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",style:V(t),children:n})}function xt({type:a}){const t=`oa-chalk-${a.replace(/[^\w-]/g,"_")}`,o={fill:"none",stroke:"currentColor",strokeWidth:7,strokeLinecap:"round",strokeLinejoin:"round"},n=(()=>{switch(a){case"docs":return e.jsx("path",{d:"M12 28c5 14 10 27 15 38 7-10 14-21 20-31 4 9 8 19 11 28M84 74c9-10 18-20 27-30 4 11 7 23 11 34 6-8 12-15 20-23",...o});case"slides":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"-14",y:"45",width:"107",height:"72",rx:"11",...o}),e.jsx("rect",{x:"4",y:"66",width:"116",height:"52",rx:"11",...o}),e.jsx("path",{d:"M17 86h55",...o})]});case"sheets":return e.jsx("path",{d:"M9 -6v94M51 -6v94M90 -6v94M-6 23h122M-6 57h122",...o});case"design":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"15",y:"18",width:"106",height:"64",...o}),[[15,18],[121,18],[15,82],[121,82]].map(([r,l])=>e.jsx("rect",{x:r-7,y:l-7,width:"14",height:"14",rx:"2",...o},`${r},${l}`))]});case"design-system":return e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"20",cy:"22",r:"13",...o}),e.jsx("rect",{x:"98",y:"6",width:"32",height:"26",rx:"6",...o}),e.jsx("rect",{x:"8",y:"66",width:"34",height:"28",rx:"6",...o}),e.jsx("circle",{cx:"118",cy:"76",r:"15",...o})]});case"data":return e.jsx("path",{d:"M38 94v20M70 81v33M101 67v47M132 48v66",...o,strokeWidth:11});case"whiteboard":return e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"-12",y:"60",width:"46",height:"31",rx:"7",...o}),e.jsx("path",{d:"M36 81c22-3 42-12 62-36 8-10 16-19 25-25M104 25l20-6 2 26",...o})]});case"motion":return e.jsx("path",{d:"M19 44c13-4 26-5 38-4 14 1 23 13 34 15 16 3 33-5 49-4M19 68c13 1 26 3 38 5 16 3 26 13 42 14 15 1 28-6 41-7",...o});default:return e.jsx("path",{d:"M18 30h50M18 52h80M18 74h36",...o})}})();return e.jsxs("svg",{className:"oa-tile-doodle",viewBox:"0 0 140 100",preserveAspectRatio:"xMidYMid slice","aria-hidden":"true",children:[e.jsxs("filter",{id:t,x:"-10%",y:"-10%",width:"120%",height:"120%",children:[e.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.9",numOctaves:2,seed:3,result:"noise"}),e.jsx("feDisplacementMap",{in:"SourceGraphic",in2:"noise",scale:3,xChannelSelector:"R",yChannelSelector:"G",result:"rough"}),e.jsx("feColorMatrix",{in:"noise",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.4 -0.7",result:"grain"}),e.jsx("feComposite",{in:"rough",in2:"grain",operator:"in"})]}),e.jsx("g",{filter:`url(#${t})`,children:n})]})}function k({d:a,size:t=16,fill:o}){return e.jsx("svg",{viewBox:"0 0 16 16",fill:o?"currentColor":"none",stroke:o?void 0:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:V(t),children:typeof a=="string"?e.jsx("path",{d:a}):a})}const v={search:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5"}),e.jsx("path",{d:"m10.5 10.5 3 3"})]}),clear:"m4.5 4.5 7 7m0-7-7 7",filter:"M2.5 4.5h11M4.5 8h7M6.5 11.5h3",list:e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M5.75 4h7.75M5.75 8h7.75M5.75 12h7.75"}),e.jsx("path",{d:"M2.5 4h.01M2.5 8h.01M2.5 12h.01",strokeWidth:"1.8"})]}),grid:e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"2.5",y:"2.5",width:"4.5",height:"4.5",rx:"1"}),e.jsx("rect",{x:"9",y:"2.5",width:"4.5",height:"4.5",rx:"1"}),e.jsx("rect",{x:"2.5",y:"9",width:"4.5",height:"4.5",rx:"1"}),e.jsx("rect",{x:"9",y:"9",width:"4.5",height:"4.5",rx:"1"})]}),plus:"M8 3v10M3 8h10",chat:"M3 3.5h10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H8.2L5.4 13.8a.3.3 0 0 1-.5-.23V11.5H3a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1Z",pin:"M9.75 2.25 13.75 6.25M10.75 3.25 7 6.25 4.5 6.5 9.5 11.5 9.75 9 12.75 5.25M7 9l-4 4",more:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"3.5",cy:"8",r:".6",fill:"currentColor"}),e.jsx("circle",{cx:"8",cy:"8",r:".6",fill:"currentColor"}),e.jsx("circle",{cx:"12.5",cy:"8",r:".6",fill:"currentColor"})]}),rename:"M10.5 3 13 5.5 5.5 13 2.5 13.5 3 10.5 10.5 3Z",link:"M6.75 9.25a2.5 2.5 0 0 0 3.54 0l2.25-2.25a2.5 2.5 0 0 0-3.54-3.54L8.250 4.2M9.25 6.75a2.5 2.5 0 0 0-3.54 0L3.46 9a2.5 2.5 0 0 0 3.54 3.54l.75-.75",share:"M8 2.5v7.5M5 5.25 8 2.5l3 2.75M3.5 8.5v4a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-4",trash:"M2.75 4.25h10.5M6.25 4.25V3a.75.75 0 0 1 .75-.75h2a.75.75 0 0 1 .75.75v1.25M4 4.25l.6 8.6a1 1 0 0 0 1 .9h4.8a1 1 0 0 0 1-.9l.6-8.6M6.75 7v4M9.25 7v4",info:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"8",cy:"8",r:"6"}),e.jsx("path",{d:"M8 7.5v3.25M8 5.25h.01"})]}),chevron:"m6 3.5 4.5 4.5L6 12.5",tick:"m3 8.5 3.25 3.25L13 4.75",globe:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"8",cy:"8",r:"5.75"}),e.jsx("path",{d:"M2.25 8h11.5M8 2.25c1.6 1.6 2.4 3.5 2.4 5.75S9.6 12.15 8 13.75C6.4 12.15 5.6 10.25 5.6 8S6.4 3.85 8 2.25Z"})]}),people:e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:"6",cy:"5.5",r:"2.25"}),e.jsx("path",{d:"M2 13c0-2.2 1.8-3.75 4-3.75S10 10.8 10 13M10.5 3.5a2.25 2.25 0 0 1 0 4M12 9.5c1.3.45 2.25 1.75 2.25 3.5"})]})};function mt({type:a,title:t}){const o=e.jsx("div",{className:"oa-paper-title",children:t});switch(a){case"slides":return e.jsxs("div",{className:"oa-slide",children:[o,e.jsx("div",{className:"oa-line"})]});case"motion":return e.jsxs("div",{className:"oa-film",children:[e.jsx("div",{className:"oa-film-title",children:t}),e.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",style:V(22),children:e.jsx("path",{d:"M7 5.5v9l7.5-4.5L7 5.5Z",fill:"currentColor"})}),e.jsx("div",{className:"oa-film-bar"})]});case"whiteboard":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("svg",{className:"oa-flow",viewBox:"0 0 120 36","aria-hidden":"true",children:[e.jsx("rect",{x:"1",y:"3",width:"30",height:"15",rx:"3"}),e.jsx("rect",{x:"45",y:"3",width:"30",height:"15",rx:"3"}),e.jsx("rect",{x:"89",y:"19",width:"30",height:"15",rx:"3"}),e.jsx("path",{d:"M31 10.5h14M75 10.5h12a3 3 0 0 1 3 3v5.5"})]})]});case"sheets":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("svg",{className:"oa-cells",viewBox:"0 0 120 48","aria-hidden":"true",children:[e.jsx("rect",{className:"oa-cells-head",x:".5",y:".5",width:"119",height:"9.5"}),e.jsx("rect",{className:"oa-cells-pick",x:"40",y:"19.5",width:"40",height:"9.5"}),e.jsx("path",{d:"M.5 .5h119v47H.5ZM.5 10h119M.5 19.5h119M.5 29h119M.5 38.5h119M40 .5v47M80 .5v47"})]})]});case"design":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("div",{className:"oa-boards",children:[e.jsx("div",{className:"oa-board"}),e.jsx("div",{className:"oa-board"})]})]});case"design-system":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("div",{className:"oa-swatches",children:[e.jsx("span",{className:"oa-swatch"}),e.jsx("span",{className:"oa-swatch"}),e.jsx("span",{className:"oa-swatch"}),e.jsx("span",{className:"oa-swatch"})]}),e.jsx("div",{className:"oa-specimen",children:"Aa"})]});case"data":return e.jsxs("div",{className:"oa-paper",children:[o,e.jsxs("div",{className:"oa-kpis",children:[e.jsx("span",{className:"oa-kpi"}),e.jsx("span",{className:"oa-kpi"}),e.jsx("span",{className:"oa-kpi"})]}),e.jsx("div",{className:"oa-bars",children:[45,70,55,90,65,80].map((n,r)=>e.jsx("span",{className:"oa-bar",style:{height:`${n}%`}},r))})]});default:return e.jsxs("div",{className:"oa-paper",children:[o,[92,100,84,96,70].map((n,r)=>e.jsx("div",{className:"oa-line",style:{width:`${n}%`}},r))]})}}const na="open-artifacts.view";function ft(a,t,o){try{const n=new URL(a);return n.searchParams.set(t,o),n.href}catch{return a}}function bt(a){try{return a?.getItem(na)==="list"?"list":"grid"}catch{return"grid"}}function yt({api:a,host:t,t:o,eventDelayMs:n=300}){let r=0,l=null;const d=new Set;let u=null,c=!1;return La()((p,h)=>{const x=(s,m)=>p({artifacts:h().artifacts.map(f=>f.id===s?{...f,...m}:f)}),b=s=>h().showToast(o("action.failed",{message:s.message}),"error"),w=s=>s.openable?!0:(h().showToast(o("open.typeMissing",{type:s.typeTitle||s.type}),"error"),!1),N=()=>{const s=t.capture;if(c||u===null||s===void 0)return;const m=u.signal;c=!0,(async()=>{try{for(;;){if(m.aborted||!t.visible())return;const f=h().artifacts.find(y=>y.thumbnail!==y.updatedAt&&y.openable&&!d.has(`${y.id}\0${y.updatedAt}`));if(f===void 0)return;d.add(`${f.id}\0${f.updatedAt}`);try{const y=await a.preview(f.id);if(typeof y!="string")throw new Error("no address");const A=await s(y,f.type,m),P=await a.saveThumbnail(f.id,f.updatedAt,A);x(f.id,{thumbnail:P??f.updatedAt})}catch(y){m.aborted||console.warn(`Open Artifacts page: no thumbnail for ${f.root}:`,y)}}}finally{c=!1}})()};return{status:"loading",artifacts:[],types:[],error:"",opening:null,toast:null,filters:ae,query:"",layout:bt(t.storage),menuFor:null,dialog:null,live:!1,searchFocus:0,reload(){return l||(h().artifacts.length===0&&p({status:"loading"}),l=(async()=>{try{const{artifacts:s,types:m}=await a.list();p({status:"ready",artifacts:s,types:m,error:""}),N()}catch(s){p({status:"error",error:s.message})}})().finally(()=>{l=null}),l)},setFilters:s=>p({filters:{...h().filters,...s}}),clearFilters:()=>p({filters:{...ae,sort:h().filters.sort}}),setQuery:s=>p({query:s}),focusSearch:()=>p({searchFocus:h().searchFocus+1}),setLayout(s){p({layout:s});try{t.storage?.setItem(na,s)}catch{}},setMenuFor:s=>p({menuFor:s}),openDialog:s=>p({dialog:s,menuFor:null}),closeDialog:()=>p({dialog:null}),showToast:(s,m="info",f)=>p({toast:{id:++r,message:s,kind:m,...f?{undo:f}:{}}}),dismissToast:()=>p({toast:null}),async open(s,m){if(h().opening!==null||!w(s))return;const f=t.away(),y=f?t.pendingWindow():null;if(f&&y===null)return h().showToast(o("open.blocked"),"error");p({opening:s.id,toast:null});try{const A=await a.open(s.id),P=m?{...A,url:ft(A.url,"panel",m)}:A,{sessionGone:G}=await t.show({...P,sessionId:P.sessionId||s.sessionId},y);p({opening:null}),G&&(P.sessionId||s.sessionId)&&h().showToast(o("open.noSession")),h().reload()}catch(A){y?.close(),p({opening:null}),h().showToast(o("open.failed",{message:A.message}),"error")}},share:s=>h().open(s,"share"),create(s){if(t.canCreate()){if(s===void 0)return t.create();t.create({id:s,title:h().types.find(m=>m.id===s)?.title||s})}},async pin(s,m){if(w(s)){x(s.id,{pinned:m});try{await a.update(s.id,{pinned:m})}catch(f){x(s.id,{pinned:s.pinned}),b(f)}}},async rename(s,m){const f=m.trim();if(!(!f||f===s.title||!w(s))){x(s.id,{title:f});try{const y=await a.update(s.id,{title:f});y&&typeof y.id=="string"&&y.id&&x(s.id,y)}catch(y){x(s.id,{title:s.title}),b(y)}}},async copyLink(s){if(w(s)){if(t.away())return h().showToast(o("toast.copyRemote"));try{await t.copy(s.viewUrl),h().showToast(o("toast.copied"))}catch(m){b(m)}}},async remove(s){try{const{trash:m,path:f}=await a.remove(s.id);p({artifacts:h().artifacts.filter(y=>y.id!==s.id),dialog:null}),h().showToast(o(f?"toast.removed":"toast.deleted",{title:s.title}),"info",m)}catch(m){b(m)}},async undo(s){p({toast:null});try{await a.restore(s),await h().reload()}catch(m){b(m)}},watchEvents(){let s;const m=a.events(()=>{h().live||p({live:!0}),clearTimeout(s),s=setTimeout(()=>{h().reload()},n)},()=>p({live:!1}));return()=>{clearTimeout(s),m?.(),p({live:!1})}},watchThumbnails(){const s=new AbortController;return u=s,N(),()=>{s.abort(new Error("the page closed")),u===s&&(u=null)}}}})}const ra=g.createContext(null);function vt({store:a,children:t}){return g.createElement(ra.Provider,{value:a},t)}function S(a){const t=g.useContext(ra);if(t===null)throw new Error("usePage needs a StoreProvider");return Oa(t,a)}function L(a,t){const o=l=>{const[d="",u]=l.split("+")[0].split(/-(.*)/s);return{numbers:d.split(".").map(c=>Number.parseInt(c,10)||0),pre:u}},n=o(a),r=o(t);for(let l=0;l<3;l++){const d=(n.numbers[l]??0)-(r.numbers[l]??0);if(d!==0)return d>0}return n.pre===void 0||r.pre===void 0?n.pre===void 0&&r.pre!==void 0:n.pre.localeCompare(r.pre,"en",{numeric:!0})>0}const oe=a=>a.reduce((t,o)=>t===""||L(o.latest,t)?o.latest:t,"");function wt(a,t,o){return a.filter(n=>!L(n.version,o)&&(t===""||L(n.version,t))).sort((n,r)=>L(n.version,r.version)?-1:L(r.version,n.version)?1:0)}const jt=/`([^`]+)`|\*\*([^*]+)\*\*|\[([^\]]+)\]\(([^)\s]+)\)/g;function kt(a){const t=[];let o=0;for(const n of a.matchAll(jt))n.index>o&&t.push({kind:"text",text:a.slice(o,n.index)}),n[1]!==void 0?t.push({kind:"code",text:n[1]}):n[2]!==void 0?t.push({kind:"strong",text:n[2]}):/^https?:\/\//i.test(n[4])?t.push({kind:"link",text:n[3],href:n[4]}):t.push({kind:"text",text:n[3]}),o=n.index+n[0].length;return o<a.length&&t.push({kind:"text",text:a.slice(o)}),t}const sa="open-artifacts.changelog.seen";function Nt(){try{return localStorage.getItem(sa)}catch{return null}}let z={version:"",releases:[],upcoming:[],upcomingFor:"",seen:Nt(),open:!1};const we=new Set;function D(a){z={...z,...a};for(const t of[...we])t()}const St=a=>(we.add(a),()=>{we.delete(a)}),Mt=()=>z;async function me(a){const t=await a(!1);if(t===null)return;const o=z.upcoming.filter(n=>L(n.version,t.version));D({version:t.version,releases:t.releases,upcoming:o})}async function ia(a,t){if(a===""||a===z.upcomingFor)return;D({upcomingFor:a});const o=await t(!0);if(o===null||z.upcomingFor!==a){z.upcomingFor===a&&D({upcomingFor:""});return}D({version:o.version,releases:o.releases,upcoming:o.upcoming})}function Ct({version:a,releases:t,seen:o}){return a===""||o===a?[]:o===null?t.filter(n=>n.version===a):L(o,a)?[]:wt(t,o,a)}function Et(){const{version:a}=z;if(a!==""){try{localStorage.setItem(sa,a)}catch{}D({seen:a})}}const ne=()=>D({open:!0}),la=()=>D({open:!1}),B=()=>g.useSyncExternalStore(St,Mt);function Ge({text:a}){return e.jsx(e.Fragment,{children:kt(a).map((t,o)=>t.kind==="code"?e.jsx("code",{children:t.text},o):t.kind==="strong"?e.jsx("strong",{children:t.text},o):t.kind==="link"?e.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",children:t.text},o):e.jsx("span",{children:t.text},o))})}const Tt=(a,t)=>{const o=`changelog.section.${t.toLowerCase()}`;return Ee(o)?a(o):t},fe=4;function Te({releases:a,headings:t,fold:o=!1,tag:n}){const{t:r}=T(),[l,d]=g.useState(!o),u=a.reduce((p,h)=>p+h.sections.reduce((x,b)=>x+b.items.length,0),0);let c=l?1/0:fe;return e.jsxs("div",{className:"oa-notes",children:[a.map(p=>c<=0?null:e.jsxs("article",{className:"oa-release","data-version":p.version,children:[t&&e.jsxs("h3",{className:"oa-release-head",children:[e.jsx("span",{className:"oa-release-version",children:p.version}),p.date&&e.jsx("span",{className:"oa-release-date",children:p.date}),n?.(p)]}),p.summary.map((h,x)=>e.jsx("p",{className:"oa-release-summary",children:e.jsx(Ge,{text:h})},x)),p.sections.map(h=>{if(c<=0||h.items.length===0)return null;const x=h.items.slice(0,c);return c-=x.length,e.jsxs("section",{className:"oa-release-section",children:[e.jsx("h4",{children:Tt(r,h.title)}),e.jsx("ul",{children:x.map((b,w)=>e.jsx("li",{children:e.jsx(Ge,{text:b})},w))})]},h.title)})]},p.version)),!l&&u>fe&&e.jsx("button",{type:"button",className:"oau-show",onClick:()=>d(!0),children:r("changelog.more",{count:String(u-fe)})})]})}function At(){const{phase:a}=K(),{changelog:t}=T();g.useEffect(()=>{t&&me(t)},[t]),g.useEffect(()=>{if(a!=="done"||!t)return;me(t);const o=setTimeout(()=>{me(t)},5e3);return()=>clearTimeout(o)},[a,t])}function Pt(){const{t:a}=T();At();const t=B(),o=Ct(t);return o.length===0?null:e.jsxs("section",{className:"oau-panel oa-news",role:"status","aria-label":a("changelog.new",{version:t.version}),"data-testid":"open-artifacts-whats-new",children:[e.jsxs("div",{className:"oau-head",children:[e.jsx("div",{className:"oau-head-text",children:e.jsx("div",{className:"oau-title",children:a("changelog.new",{version:t.version})})}),e.jsxs("div",{className:"oau-actions",children:[e.jsx("button",{type:"button",className:"oa-btn",onClick:ne,children:a("changelog.all")}),e.jsx("button",{type:"button",className:"oa-btn","data-primary":"true",onClick:Et,children:a("changelog.gotIt")})]})]}),e.jsx(Te,{releases:o,headings:o.length>1,fold:!0})]})}function Lt(){const{t:a,changelog:t}=T(),o=oe(K().updates),{upcoming:n}=B();return g.useEffect(()=>{t&&ia(o,t)},[o,t]),n.length===0?null:e.jsxs("div",{className:"oa-news-upcoming",children:[e.jsx(Te,{releases:n,headings:n.length>1,fold:!0}),e.jsx("button",{type:"button",className:"oau-show",onClick:ne,children:a("changelog.all")})]})}function Ot(){const{t:a}=T(),{version:t}=B(),{updates:o,offer:n}=K();if(t==="")return null;const r=oe(o),l=r!==""&&L(r,t),d=l?`${a("changelog.version",{version:t})} · ${n.t("available",{version:r})}`:a("changelog.version",{version:t});return e.jsxs("button",{type:"button",className:"oa-version",title:`${d} · ${a("changelog.title")}`,"aria-label":d,"data-update":l,onClick:ne,"data-testid":"open-artifacts-version",children:["v",t,l&&e.jsx("span",{className:"oa-version-dot","aria-hidden":"true"})]})}function zt(){const{t:a}=T(),{version:t}=B();return t===""?null:e.jsxs("footer",{className:"oa-foot",children:[e.jsx("span",{children:a("changelog.version",{version:t})}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("button",{type:"button",className:"oau-show",onClick:ne,"data-testid":"open-artifacts-changelog",children:a("changelog.title")})]})}function Ft(){const{t:a,changelog:t}=T(),{version:o,releases:n,upcoming:r}=B(),l=oe(K().updates);g.useEffect(()=>{t&&ia(l,t)},[l,t]);const d=u=>u.version===o?e.jsx("span",{className:"oau-tag","data-tone":"neutral",children:a("changelog.installed")}):r.includes(u)?e.jsx("span",{className:"oau-tag",children:a("changelog.available")}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"oa-dialog-head",children:e.jsx("h2",{children:a("changelog.title")})}),e.jsx("div",{className:"oa-changelog",children:r.length+n.length===0?e.jsx("p",{children:a("changelog.none")}):e.jsx(Te,{releases:[...r,...n],headings:!0,tag:d})}),e.jsxs("div",{className:"oa-dialog-actions",children:[e.jsx("a",{className:"oa-btn oa-btn-link",href:"https://github.com/openartifactsai/open-artifacts/releases",target:"_blank",rel:"noopener noreferrer",children:a("changelog.releases")}),e.jsx("button",{type:"button",className:"oa-btn","data-primary":"true",autoFocus:!0,onClick:la,children:a("dialog.close")})]})]})}function _({primary:a,onClick:t,children:o,label:n,disabled:r}){return e.jsx("button",{type:"button",className:"oa-btn",...a?{"data-primary":"true"}:{},...n?{"aria-label":n}:{},disabled:r,onClick:t,children:o})}function Rt(){const{phase:a,updates:t,to:o,restart:n,failure:r,dismissed:l,offer:d}=K(),{t:u,start:c,later:p,close:h,reopen:x}=d,b=oe(t);if(a==="idle"&&b==="")return null;if(a==="idle"&&b===l)return e.jsxs("div",{className:"oau-line","data-testid":"open-artifacts-update-line",children:[e.jsx("span",{children:u("available",{version:b})}),e.jsx("button",{type:"button",className:"oau-show",onClick:x,children:u("show")})]});let w,N=null,s=null;return a==="running"?w=u("busy"):a==="done"?(w=u("done",{version:o}),N=u(n?"done.restart":"done.session"),s=e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:h,children:u("close")}),n&&d.restart&&e.jsx(_,{primary:!0,onClick:()=>d.restart?.(),children:u("restart")})]})):a==="failed"&&r?(w=u("failed"),N=`${r.message} ${u(r.left==="unknown"?"failed.unknown":"failed.kept")}`,s=e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:h,children:u("close")}),t.length>0&&e.jsx(_,{primary:!0,onClick:c,children:u("retry")})]})):(w=u("available",{version:b}),N=u("current",{version:t[0]?.version??""}),s=e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:p,children:u("later")}),e.jsx(_,{primary:!0,onClick:c,label:u("update.one",{version:b}),children:u("update")})]})),e.jsxs("section",{className:"oau-panel",role:a==="failed"?"alert":"status","data-testid":"open-artifacts-update","data-phase":a,children:[e.jsxs("div",{className:"oau-head",children:[e.jsxs("div",{className:"oau-head-text",children:[e.jsx("div",{className:"oau-title",children:w}),N!==null&&e.jsx("div",{className:"oau-text",children:N})]}),s!==null&&e.jsx("div",{className:"oau-actions",children:s})]}),a==="idle"&&e.jsx(Lt,{})]})}const Dt=[["minute",60],["hour",3600],["day",86400],["week",604800],["month",2629800],["year",31557600]];function ca(a,t,o){const n=Date.parse(a);if(!Number.isFinite(n))return"";const r=Math.round((n-t)/1e3);if(r>-60)return o("card.justNow");let l="minute",d=60;for(const[c,p]of Dt)-r>=p&&([l,d]=[c,p]);let u;try{u=new Intl.RelativeTimeFormat(o("time.locale"),{numeric:"auto"})}catch{u=new Intl.RelativeTimeFormat("en",{numeric:"auto"})}return o("card.opened",{time:u.format(Math.round(r/d),l)})}function It(a=6e4){const[t,o]=g.useState(()=>Date.now());return g.useEffect(()=>{const n=setInterval(()=>o(Date.now()),a);return()=>clearInterval(n)},[a]),t}function re(a,t,o){const n=`type.${t}`;return Ee(n)?a(n):o||t}function $t(a,t,o){const n=`about.${t}`;return Ee(n)?a(n):o||""}function _t({artifact:a}){const{api:t}=T(),o=a.thumbnail===null?null:t.thumbnailUrl(a.id,a.thumbnail),[n,r]=g.useState(null),l=o!==null&&n!==o;return e.jsx("span",{className:"oa-preview","data-stack":l&&a.type==="docs",children:l?e.jsx("span",{className:"oa-sheet",children:e.jsx("img",{src:o,alt:"",draggable:!1,onError:()=>r(o)})}):e.jsx(mt,{type:a.type,title:a.title})})}const Ae="[role^=menuitem]";function da(a,t){if(a.key==="Escape"){a.preventDefault(),a.stopPropagation(),t();return}if(a.key!=="ArrowDown"&&a.key!=="ArrowUp")return;a.preventDefault(),a.stopPropagation();const o=[...a.currentTarget.querySelectorAll(Ae)].filter(r=>r.closest("[role=menu]")===a.currentTarget),n=o.indexOf(document.activeElement);o[(n+(a.key==="ArrowDown"?1:o.length-1))%o.length]?.focus()}function Pe({anchor:a,label:t,onClose:o,onKey:n,children:r}){const l=g.useRef(null),[d,u]=g.useState({visibility:"hidden"});g.useLayoutEffect(()=>{const p=a.getBoundingClientRect(),h=l.current?.offsetHeight??0,x=l.current?.offsetWidth??0,b=Math.max(8,window.innerWidth-p.right),w=p.bottom+6+h<=window.innerHeight-8;u({right:window.innerWidth-b-x<8?window.innerWidth-x-8:b,...w?{top:p.bottom+6}:{bottom:Math.max(8,window.innerHeight-p.top+6)}})},[a]);const c=d.visibility!=="hidden";return g.useEffect(()=>{c&&l.current?.querySelector(Ae)?.focus({preventScroll:!0})},[c]),g.useEffect(()=>{const p=x=>{const b=x.target;!l.current?.contains(b)&&!a.contains(b)&&o()},h=()=>o();return document.addEventListener("pointerdown",p,!0),window.addEventListener("resize",h),()=>{document.removeEventListener("pointerdown",p,!0),window.removeEventListener("resize",h)}},[a,o]),e.jsx("div",{ref:l,className:"oa-menu",role:"menu","aria-label":t,style:d,onKeyDown:p=>{if(n&&!p.metaKey&&!p.ctrlKey&&!p.altKey&&n(p.key.toLowerCase())){p.preventDefault();return}da(p,()=>{o(),a.focus()})},children:r})}function be({label:a,on:t,count:o,onPick:n}){return e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitemradio","aria-checked":t,onClick:n,children:[e.jsx("span",{className:"oa-menu-label",children:a}),o!==void 0&&e.jsx("span",{className:"oa-menu-count",children:o}),t&&e.jsx("span",{className:"oa-tick",children:e.jsx(k,{d:v.tick})})]})}function W({id:a,label:t,value:o,open:n,setOpen:r,children:l}){const d=n===a,u=g.useRef(null),[c,p]=g.useState(!1);return g.useLayoutEffect(()=>{d&&u.current&&p(u.current.getBoundingClientRect().right+(c?u.current.offsetWidth:0)>window.innerWidth-8)},[d]),e.jsxs("div",{className:"oa-menu-row",onMouseEnter:()=>r(a),children:[e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","aria-haspopup":"menu","aria-expanded":d,onClick:()=>r(d?null:a),onKeyDown:h=>{(h.key==="ArrowRight"||h.key==="Enter"||h.key===" ")&&(h.preventDefault(),r(a),requestAnimationFrame(()=>u.current?.querySelector(Ae)?.focus()))},children:[e.jsx("span",{className:"oa-menu-label",children:t}),e.jsx("span",{className:"oa-menu-value",children:o}),e.jsx("span",{className:"oa-menu-chev",children:e.jsx(k,{d:v.chevron,size:12})})]}),d&&e.jsx("div",{ref:u,className:"oa-submenu",role:"menu","aria-label":t,"data-flip":c,onKeyDown:h=>{if(h.key==="ArrowLeft"||h.key==="Escape"){h.preventDefault(),h.stopPropagation(),r(null),h.currentTarget.previousElementSibling?.focus();return}da(h,()=>r(null))},children:l})]})}function Bt({anchor:a,filters:t,setFilters:o,types:n,counts:r,projects:l,t:d,onClose:u}){const[c,p]=g.useState(null),h=s=>re(d,s,n.find(m=>m.id===s)?.title),x=t.types.length===0?d("filter.any"):t.types.length===1?h(t.types[0]):d("filter.some",{count:String(t.types.length)}),b=s=>s.project===Qe?d("filter.noProject"):s.label,w=l.find(s=>s.project===t.projects[0]),N=t.projects.length===0?d("filter.any"):t.projects.length===1?w?b(w):Me(t.projects[0]):d("filter.some",{count:String(t.projects.length)});return e.jsxs(Pe,{anchor:a,label:d("filter.button"),onClose:u,children:[e.jsx(W,{id:"sort",label:d("filter.sort"),value:d(`sort.${t.sort}`),open:c,setOpen:p,children:ot.map(s=>e.jsx(be,{label:d(`sort.${s}`),on:t.sort===s,onPick:()=>o({...t,sort:s})},s))}),e.jsx("div",{className:"oa-menu-rule",role:"separator"}),e.jsx(W,{id:"type",label:d("filter.type"),value:x,open:c,setOpen:p,children:n.map(({id:s})=>{const m=t.types.includes(s);return e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitemcheckbox","aria-checked":m,onClick:()=>o({...t,types:m?t.types.filter(f=>f!==s):[...t.types,s]}),children:[e.jsx("span",{className:"oa-check","data-on":m,children:e.jsx(k,{d:v.tick,size:12})}),e.jsx("span",{className:"oa-menu-label",children:h(s)}),e.jsx("span",{className:"oa-menu-count",children:r.get(s)??0})]},s)})}),l.length>0&&e.jsx(W,{id:"project",label:d("filter.project"),value:N,open:c,setOpen:p,children:l.map(s=>{const m=t.projects.includes(s.project);return e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitemcheckbox","aria-checked":m,title:s.project||void 0,"data-project":s.project,onClick:()=>o({...t,projects:m?t.projects.filter(f=>f!==s.project):[...t.projects,s.project]}),children:[e.jsx("span",{className:"oa-check","data-on":m,children:e.jsx(k,{d:v.tick,size:12})}),e.jsx("span",{className:"oa-menu-label",children:b(s)}),e.jsx("span",{className:"oa-menu-count",children:s.count})]},s.project||"none")})}),e.jsx(W,{id:"date",label:d("filter.date"),value:d(`date.${t.date}`),open:c,setOpen:p,children:nt.map(s=>e.jsx(be,{label:d(`date.${s}`),on:t.date===s,onPick:()=>o({...t,date:s})},s))}),e.jsx(W,{id:"sharing",label:d("filter.sharing"),value:d(`sharing.${t.sharing}`),open:c,setOpen:p,children:Fa.map(s=>e.jsx(be,{label:d(`sharing.${s}`),on:t.sharing===s,onPick:()=>o({...t,sharing:s})},s))}),e.jsx("div",{className:"oa-menu-rule",role:"separator"}),e.jsxs("div",{onMouseEnter:()=>p(null),children:[e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitemcheckbox","aria-checked":t.pinned,onClick:()=>o({...t,pinned:!t.pinned}),children:[e.jsx("span",{className:"oa-menu-label",children:d("filter.pinned")}),t.pinned&&e.jsx("span",{className:"oa-tick",children:e.jsx(k,{d:v.tick})})]}),ye(t)&&e.jsx("button",{type:"button",className:"oa-menu-item",role:"menuitem",onClick:()=>o({...ae,sort:t.sort}),children:e.jsx("span",{className:"oa-menu-label",children:d("filter.clear")})})]})]})}function Ut({anchor:a,artifact:t,t:o,onClose:n,act:r,extra:l=[],onExtra:d}){const u=(c,p,h,x)=>e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","aria-keyshortcuts":x,onClick:()=>r(c),children:[e.jsx(k,{d:p}),e.jsx("span",{className:"oa-menu-label",children:h}),e.jsx("kbd",{className:"oa-menu-key",children:x})]});return e.jsxs(Pe,{anchor:a,label:o("action.more"),onClose:n,onKey:c=>{const p={p:"pin",r:"rename",c:"copy",s:"share"}[c];return p===void 0?!1:(r(p),!0)},children:[u("pin",v.pin,o(t.pinned?"action.unpin":"action.pin"),"P"),u("rename",v.rename,o("action.rename"),"R"),u("copy",v.link,o("action.copy"),"C"),u("share",v.share,o("action.share"),"S"),l.map(c=>e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","data-action":c.id,onClick:()=>d?.(c),children:[e.jsx(k,{d:c.icon??""}),e.jsx("span",{className:"oa-menu-label",children:c.label})]},c.id)),e.jsx("div",{className:"oa-menu-rule",role:"separator"}),e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","data-danger":"true",onClick:()=>r("delete"),children:[e.jsx(k,{d:v.trash}),e.jsx("span",{className:"oa-menu-label",children:o("action.delete")})]})]})}function Ht({anchor:a,tiles:t,canCreate:o,t:n,onClose:r,create:l}){return e.jsxs(Pe,{anchor:a,label:n("create.new"),onClose:r,children:[e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem",disabled:!o,onClick:()=>l(),children:[e.jsx(k,{d:v.chat}),e.jsx("span",{className:"oa-menu-label",children:n("create.session")})]}),t.length>0&&e.jsx("div",{className:"oa-menu-rule",role:"separator"}),t.map(d=>e.jsxs("button",{type:"button",className:"oa-menu-item",role:"menuitem","data-type":d.id,onClick:()=>l(d.id),style:Y(d.id),children:[e.jsx("span",{className:"oa-menu-glyph",children:e.jsx(te,{type:d.id,size:16})}),e.jsx("span",{className:"oa-menu-label",children:re(n,d.id,d.title)})]},d.id))]})}function Le({label:a,onClose:t,children:o,wide:n=!1}){return e.jsx("div",{className:"oa-scrim",onPointerDown:r=>{r.target===r.currentTarget&&t()},onKeyDown:r=>{r.key==="Escape"&&(r.stopPropagation(),t())},children:e.jsx("div",{className:"oa-dialog",role:"dialog","aria-modal":"true","aria-label":a,...n?{"data-wide":"true"}:{},children:o})})}function Wt({artifact:a,t,onClose:o,onSave:n}){const[r,l]=g.useState(a.title),d=g.useRef(null);g.useEffect(()=>{d.current?.focus(),d.current?.select()},[]);const u=r.trim(),c=u!==""&&u!==a.title;return e.jsx(Le,{label:t("rename.title"),onClose:o,children:e.jsxs("form",{onSubmit:p=>{p.preventDefault(),c&&n(u)},children:[e.jsx("h2",{children:t("rename.title")}),e.jsx("input",{ref:d,value:r,"aria-label":t("rename.title"),maxLength:200,onChange:p=>l(p.target.value)}),e.jsxs("div",{className:"oa-dialog-actions",children:[e.jsx("button",{type:"button",className:"oa-btn",onClick:o,children:t("dialog.cancel")}),e.jsx("button",{type:"submit",className:"oa-btn","data-primary":"true",disabled:!c,children:t("rename.save")})]})]})})}function Kt({artifact:a,t,onClose:o,onDelete:n}){const r=g.useRef(null);g.useEffect(()=>r.current?.focus(),[]);const l=t("delete.title",{title:a.title});return e.jsxs(Le,{label:l,onClose:o,children:[e.jsx("h2",{children:l}),e.jsx("p",{children:t("delete.moves")}),a.webShare&&e.jsx("p",{"data-webshare":"",children:t("delete.webShared",{url:a.webShare.url,manage:a.webShare.manage})}),e.jsxs("div",{className:"oa-dialog-actions",children:[e.jsx("button",{type:"button",className:"oa-btn",onClick:o,children:t("dialog.cancel")}),e.jsx("button",{ref:r,type:"button",className:"oa-btn","data-danger":"true",onClick:n,children:t("delete.confirm")})]})]})}function Yt(){const{t:a}=T(),t=S(r=>r.toast),o=S(r=>r.dismissToast),n=S(r=>r.undo);return g.useEffect(()=>{if(t===null)return;const r=setTimeout(o,t.undo||t.kind==="error"?1e4:4e3);return()=>clearTimeout(r)},[t,o]),t===null?null:e.jsxs("div",{className:"oa-toast",role:t.kind==="error"?"alert":"status","data-kind":t.kind,children:[e.jsx(k,{d:v.info}),e.jsx("span",{className:"oa-toast-text",children:t.message}),t.undo&&e.jsx("button",{type:"button",className:"oa-toast-undo",onClick:()=>{n(t.undo)},children:a("toast.undo")}),e.jsx("button",{type:"button",className:"oa-toast-close","aria-label":a("toast.close"),onClick:o,children:e.jsx(k,{d:v.clear,size:14})})]},t.id)}const pa=(a,t)=>[a.root,a.project&&!a.root.startsWith(a.project)?a.project:"",t].filter(Boolean).join(`
2
- `);function ua({artifact:a,t,onPin:o}){const n=t(a.pinned?"action.unpin":"action.pin");return e.jsx("button",{type:"button",className:"oa-act","data-on":a.pinned,"aria-pressed":a.pinned,"aria-label":n,title:n,onClick:()=>o(a),children:a.pinned?e.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",style:V(16),children:e.jsx("path",{d:"M9.75 2.25 13.75 6.25M10.75 3.25 7 6.25 4.5 6.5 9.5 11.5 9.75 9 12.75 5.25M7 9l-4 4",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})}):e.jsx(k,{d:v.pin})})}function ha({artifact:a,t,menuOpen:o,onMenu:n,extra:r}){return e.jsx("button",{type:"button",className:`oa-act ${r??""}`,"aria-label":t("action.more"),title:t("action.more"),"aria-haspopup":"menu","aria-expanded":o,onClick:l=>n(a,l.currentTarget),children:e.jsx(k,{d:v.more})})}function Vt({artifact:a,opening:t,conversation:o,now:n,t:r,onOpen:l,onPin:d,menuOpen:u,onMenu:c}){const p=t===a.id;return e.jsxs("li",{className:"oa-item","data-menu":u,style:Y(a.type),children:[e.jsxs("button",{type:"button",className:"oa-card",disabled:t!==null,"aria-busy":p,title:pa(a,o),onClick:()=>l(a),"data-type":a.type,children:[e.jsxs("span",{className:"oa-preview-wrap",style:{display:"block",position:"relative",width:"100%"},children:[e.jsx(_t,{artifact:a}),p&&e.jsxs("span",{className:"oa-busy",children:[e.jsx("span",{className:"oa-spinner"}),r("card.opening")]})]}),e.jsxs("span",{className:"oa-info",children:[e.jsx("span",{className:"oa-glyph",children:e.jsx(te,{type:a.type})}),e.jsxs("span",{className:"oa-text",children:[e.jsx("span",{className:"oa-name",children:a.title}),e.jsxs("span",{className:"oa-meta",children:[a.project?e.jsxs("span",{className:"oa-project","data-project":a.project,children:[Me(a.project)," · "]}):null,ca(a.openedAt,n,r)]})]})]})]}),e.jsxs("div",{className:"oa-actions",children:[e.jsx(ha,{artifact:a,t:r,menuOpen:u,onMenu:c}),e.jsx(ua,{artifact:a,t:r,onPin:d})]})]})}function Gt({artifact:a,opening:t,conversation:o,now:n,t:r,onOpen:l,onPin:d,menuOpen:u,onMenu:c}){const p=t===a.id;return e.jsxs("li",{className:"oa-item","data-menu":u,style:Y(a.type),children:[e.jsxs("button",{type:"button",className:"oa-row",disabled:t!==null,"aria-busy":p,title:pa(a,o),onClick:()=>l(a),"data-type":a.type,children:[e.jsx("span",{className:"oa-glyph",children:p?e.jsx("span",{className:"oa-spinner"}):e.jsx(te,{type:a.type})}),e.jsx("span",{className:"oa-name",children:a.title}),e.jsx("span",{className:"oa-meta",children:p?r("card.opening"):e.jsxs(e.Fragment,{children:[a.project?e.jsxs("span",{className:"oa-project","data-project":a.project,children:[Me(a.project)," · "]}):null,ca(a.openedAt,n,r)]})})]}),e.jsxs("div",{className:"oa-row-tools",children:[a.shared&&e.jsx("span",{className:"oa-shared",title:r("card.shared"),"aria-label":r("card.shared"),children:e.jsx(k,{d:v.people})}),a.webShare&&e.jsx("span",{className:"oa-shared","data-webshare":"",title:`${r("card.webShared")}: ${a.webShare.url}`,"aria-label":r("card.webShared"),children:e.jsx(k,{d:v.globe})}),e.jsx(ua,{artifact:a,t:r,onPin:d}),e.jsx(ha,{artifact:a,t:r,menuOpen:u,onMenu:c,extra:"oa-act-more"})]})]})}const qt=350,Zt=160,ga="oa-peek-about";function Jt({tile:a,anchor:t,t:o,onAct:n,onEnter:r,onLeave:l,onClose:d}){const u=g.useRef(null),[c,p]=g.useState({visibility:"hidden"});g.useLayoutEffect(()=>{const x=t.getBoundingClientRect(),b=u.current?.offsetWidth??0,w=u.current?.offsetHeight??0,N=x.bottom+8;p({left:Math.max(8,Math.min(x.left,window.innerWidth-b-8)),top:N+w<=window.innerHeight-8?N:Math.max(8,x.top-8-w)})},[t]),g.useEffect(()=>{const x=()=>d();return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[d]);const h=re(o,a.id,a.title);return e.jsxs("div",{ref:u,className:"oa-peek",role:"group","aria-label":h,"data-testid":"open-artifacts-peek","data-type":a.id,style:{...Y(a.id),...c},onPointerEnter:r,onPointerLeave:l,onKeyDown:x=>{x.key==="Escape"&&(d(),t.focus())},children:[e.jsx("div",{className:"oa-peek-title",children:h}),e.jsx("div",{className:"oa-peek-by",children:o("peek.by")}),e.jsx("p",{className:"oa-peek-about",id:ga,children:$t(o,a.id,a.description)}),e.jsx("button",{type:"button",className:"oa-peek-act",onClick:n,children:o("peek.start")})]})}function Qt(a,t){const o=new Set(t.flatMap(r=>r.types)),n=a.filter(r=>!o.has(r.id));return t.map((r,l)=>({group:r,tiles:[...r.types.map(d=>a.find(u=>u.id===d)).filter(d=>d!==void 0),...l===t.length-1?n:[]]})).filter(r=>r.tiles.length>0)}function Xt({canCreate:a,theme:t,platform:o,searchButton:n=!0,createButton:r=!0,tileGroups:l,headingTools:d,cardActions:u}){const{t:c}=T(),p=tt(),h=S(i=>i.status),x=S(i=>i.artifacts),b=S(i=>i.types),w=S(i=>i.error),N=S(i=>i.opening),s=S(i=>i.filters),m=S(i=>i.query),f=S(i=>i.layout),y=S(i=>i.dialog),A=S(i=>i.searchFocus),{reload:P,watchEvents:G,watchThumbnails:Fe,setFilters:Re,setQuery:se,setLayout:va,openDialog:wa,closeDialog:q,open:ja,create:De,pin:Ie,rename:ka,copyLink:Na,share:Sa,remove:Ma}=S(i=>i),[F,ie]=g.useState(null),R=g.useRef(void 0),Z=g.useRef(!1),[le,J]=g.useState(!1),[M,I]=g.useState(null),U=g.useRef(null),ce=It(),Ca=B().open;g.useEffect(()=>{P();const i=()=>{document.visibilityState==="visible"&&P()};return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)},[P]),g.useEffect(()=>G(),[G]),g.useEffect(()=>Fe(),[Fe]),g.useEffect(()=>{le&&U.current?.focus()},[le]),g.useEffect(()=>{A!==0&&(J(!0),U.current?.focus(),U.current?.select())},[A]);const de=g.useMemo(()=>lt(x),[x]),Ea=g.useMemo(()=>za(x,c("time.locale")),[x,c]),H=g.useMemo(()=>Ve(b.map(i=>i.id)).map(i=>b.find(j=>j.id===i)),[b]),Ta=g.useMemo(()=>Ve([...b.map(i=>i.id),...de.keys()]).map(i=>({id:i,title:b.find(j=>j.id===i)?.title||x.find(j=>j.type===i)?.typeTitle||i})),[b,de,x]),pe=g.useMemo(()=>()=>{clearTimeout(R.current),Z.current=!1,ie(null)},[]);g.useEffect(()=>()=>clearTimeout(R.current),[]);const $e=(i,j,C=!1)=>{clearTimeout(R.current),R.current=setTimeout(()=>ie({id:i,anchor:j}),C||F!==null?0:qt)},ue=()=>{clearTimeout(R.current),R.current=setTimeout(()=>ie(null),Zt)},_e=i=>{pe(),De(i)},he=g.useMemo(()=>it(x,{filters:s,query:m,now:ce,locale:c("time.locale"),sessionTitle:p}),[x,s,m,ce,c,p]),ge=g.useMemo(()=>()=>I(null),[]),O=M?.kind==="actions"?x.find(i=>i.id===M.id):void 0,$=y?x.find(i=>i.id===y.id):void 0,xe=F===null?void 0:H.find(i=>i.id===F.id),Be=i=>({artifact:i,opening:N,conversation:p(i.sessionId),now:ce,t:c,onOpen:j=>{ja(j)},onPin:j=>{Ie(j,!j.pinned)},menuOpen:M?.kind==="actions"&&M.id===i.id,onMenu:(j,C)=>I(We=>We?.kind==="actions"&&We.id===j.id?null:{kind:"actions",anchor:C,id:j.id})}),Ue=i=>{const j=F?.id===i.id;return e.jsx("li",{onPointerEnter:C=>C.pointerType!=="touch"&&$e(i.id,C.currentTarget.firstElementChild),onPointerLeave:ue,children:e.jsxs("button",{type:"button",className:"oa-tile","data-type":i.id,...j?{"data-peek":"true","aria-describedby":ga}:{},style:Y(i.id),onClick:()=>_e(i.id),onFocus:C=>{C.currentTarget.matches(":focus-visible")&&$e(i.id,C.currentTarget,!0)},onBlur:()=>{Z.current||ue()},onKeyDown:C=>{C.key==="Escape"&&F!==null&&pe()},children:[e.jsxs("span",{className:"oa-tile-art",children:[e.jsx(xt,{type:i.id}),e.jsx(te,{type:i.id,size:42}),ht.includes(i.id)&&e.jsx("span",{className:"oa-tile-beta",children:c("tile.beta")})]}),e.jsx("span",{className:"oa-tile-label",children:re(c,i.id,i.title)})]})},i.id)},He=(i,j)=>I(C=>C?.kind===i?null:{kind:i,anchor:j});return e.jsxs("section",{className:"oa-page","aria-label":c("title"),"data-testid":"open-artifacts-page","data-theme":t,"data-platform":o,children:[e.jsx("div",{className:"oa-scroll",children:e.jsxs("div",{className:"oa-content",children:[e.jsxs("div",{className:"oa-heading",children:[e.jsxs("div",{className:"oa-title",children:[e.jsx("h1",{children:c("title")}),e.jsx(Ot,{})]}),e.jsxs("div",{className:"oa-tools",children:[d,le||m?e.jsxs("label",{className:"oa-search",children:[e.jsx(k,{d:v.search,size:14}),e.jsx("input",{ref:U,type:"search",value:m,placeholder:c("search"),"aria-label":c("search"),onChange:i=>se(i.target.value),onBlur:()=>{m||J(!1)},onKeyDown:i=>{i.nativeEvent.isComposing||i.keyCode===229||i.key==="Escape"&&(se(""),J(!1))}}),m&&e.jsx("button",{type:"button","aria-label":c("search.clear"),onClick:()=>{se(""),U.current?.focus()},children:e.jsx(k,{d:v.clear,size:12})})]}):n?e.jsx("button",{type:"button",className:"oa-tool","aria-label":c("search"),title:c("search"),onClick:()=>J(!0),children:e.jsx(k,{d:v.search,size:18})}):null,e.jsx("button",{type:"button",className:"oa-tool","aria-label":c("filter.button"),title:c("filter.button"),"aria-haspopup":"menu","aria-expanded":M?.kind==="filter","data-active":ye(s),onClick:i=>He("filter",i.currentTarget),children:e.jsx(k,{d:v.filter,size:18})}),e.jsx("button",{type:"button",className:"oa-tool","aria-label":c(f==="grid"?"view.list":"view.grid"),title:c(f==="grid"?"view.list":"view.grid"),onClick:()=>va(f==="grid"?"list":"grid"),children:e.jsx(k,{d:f==="grid"?v.list:v.grid,size:18})}),a&&r&&e.jsx("button",{type:"button",className:"oa-tool","aria-label":c("create.new"),title:c("create.new"),"aria-haspopup":"menu","aria-expanded":M?.kind==="create",onClick:i=>He("create",i.currentTarget),children:e.jsx(k,{d:v.plus,size:18})})]})]}),e.jsx(Rt,{}),e.jsx(Pt,{}),a&&H.length>0&&e.jsxs(e.Fragment,{children:[l===void 0?e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"oa-section-title",children:c("create.heading")}),e.jsx("ul",{className:"oa-tiles",children:H.map(Ue)})]}):e.jsx("div",{className:"oa-tile-groups",children:Qt(H,l).map(({group:i,tiles:j})=>e.jsxs("section",{className:"oa-tile-group","data-group":i.id,"aria-label":i.title,children:[e.jsx("h2",{className:"oa-section-title",children:i.title}),e.jsx("ul",{className:"oa-tiles",children:j.map(Ue)})]},i.id))}),F!==null&&xe!==void 0&&M===null&&e.jsx(Jt,{tile:xe,anchor:F.anchor,t:c,onAct:()=>_e(xe.id),onEnter:()=>{Z.current=!0,clearTimeout(R.current)},onLeave:()=>{Z.current=!1,ue()},onClose:pe})]}),h==="loading"&&x.length===0?e.jsx("ul",{className:"oa-grid oa-skeleton","aria-hidden":"true",children:[0,1,2].map(i=>e.jsx("li",{className:"oa-item",children:e.jsxs("div",{className:"oa-card",children:[e.jsx("div",{className:"oa-preview"}),e.jsx("div",{className:"oa-line"})]})},i))}):h==="error"&&x.length===0?e.jsxs("div",{className:"oa-empty",role:"alert",children:[e.jsx("p",{children:c("load.error",{message:w})}),e.jsx("button",{type:"button",className:"oa-retry",onClick:()=>{P()},children:c("load.retry")})]}):x.length===0?e.jsxs("div",{className:"oa-empty",children:[e.jsx(gt,{size:28}),e.jsx("h2",{children:c("empty.title")}),e.jsx("p",{children:c("empty.body")})]}):he.length===0?e.jsxs("div",{className:"oa-empty",children:[e.jsx("p",{children:c("empty.noMatches")}),ye(s)&&e.jsx("button",{type:"button",className:"oa-retry",onClick:()=>Re({...ae,sort:s.sort}),children:c("filter.clear")})]}):f==="grid"?e.jsx("ul",{className:"oa-grid",children:he.map(i=>e.jsx(Vt,{...Be(i)},i.id))}):e.jsx("ul",{className:"oa-list",children:he.map(i=>e.jsx(Gt,{...Be(i)},i.id))}),e.jsx(zt,{})]})}),M?.kind==="filter"&&e.jsx(Bt,{anchor:M.anchor,filters:s,setFilters:i=>Re(i),types:Ta,counts:de,projects:Ea,t:c,onClose:ge}),M?.kind==="create"&&e.jsx(Ht,{anchor:M.anchor,tiles:H,canCreate:a,t:c,onClose:ge,create:i=>{I(null),De(i)}}),M?.kind==="actions"&&O&&e.jsx(Ut,{anchor:M.anchor,artifact:O,t:c,onClose:ge,extra:u,onExtra:i=>{I(null),i.run(O)},act:i=>{I(null),i==="pin"?Ie(O,!O.pinned):i==="copy"?Na(O):i==="share"?Sa(O):wa({kind:i,id:O.id})}}),y?.kind==="rename"&&$&&e.jsx(Wt,{artifact:$,t:c,onClose:q,onSave:i=>{q(),ka($,i)}}),y?.kind==="delete"&&$&&e.jsx(Kt,{artifact:$,t:c,onClose:q,onDelete:()=>{q(),Ma($)}}),Ca&&e.jsx(Le,{label:c("changelog.title"),onClose:la,wide:!0,children:e.jsx(Ft,{})}),e.jsx(Yt,{})]})}const eo=`
3
- .oa-page{position:relative;width:100%;min-width:0;height:100%;min-height:0;color:var(--oa-page-text-primary);background:var(--oa-page-bg);font-size:14px;line-height:1.6;display:flex;flex-direction:column;overflow:hidden}
4
- .oa-scroll{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable}
5
- .oa-content{max-width:1120px;margin:0 auto;padding:0 clamp(24px,4vw,48px) 56px}
6
- .oa-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px;padding-top:28px;margin-bottom:24px}
7
- :where(.oa-page)[data-platform=darwin] .oa-heading{padding-top:calc(28px + var(--oa-page-top-clearance,0px))}
8
- .oa-heading h1{margin:0;font-size:20px;font-weight:500;line-height:28px}
9
- .oa-title{display:flex;align-items:center;gap:8px;min-width:0}
10
- .oa-version{position:relative;flex:none;display:inline-flex;align-items:center;height:20px;padding:0 7px;border:0;border-radius:10px;background:var(--oa-page-hover-bg);color:var(--oa-page-text-tertiary);font:inherit;font-size:12px;line-height:20px;font-variant-numeric:tabular-nums;cursor:pointer}
11
- .oa-version:hover{color:var(--oa-page-text-secondary)}
12
- .oa-version:focus-visible{outline:2px solid var(--oa-page-accent);outline-offset:2px}
13
- .oa-version-dot{position:absolute;top:-1px;right:-1px;width:7px;height:7px;border-radius:50%;background:var(--oa-page-accent);box-shadow:0 0 0 2px var(--oa-page-bg,transparent)}
14
- .oa-tools{display:flex;align-items:center;gap:4px;margin-left:auto}
15
- .oa-tool{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:8px;background:none;color:var(--oa-page-text-secondary);cursor:pointer}
16
- .oa-tool:hover,.oa-tool[aria-expanded=true]{background:var(--oa-page-hover-bg);color:var(--oa-page-text-primary)}
17
- .oa-tool[data-active=true]::after{content:"";position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:var(--oa-page-accent)}
18
- .oa-search{display:flex;align-items:center;gap:6px;width:min(240px,50vw);height:32px;padding:0 8px 0 10px;border:.5px solid var(--oa-page-border);border-radius:8px;color:var(--oa-page-text-tertiary)}
19
- .oa-search:focus-within{border-color:var(--oa-page-accent)}
20
- .oa-search input{flex:1;min-width:0;height:100%;border:0;padding:0;background:none;color:var(--oa-page-text-primary);font:inherit;font-size:13px;outline:none}
21
- .oa-search input::placeholder{color:var(--oa-page-text-caption)}
22
- .oa-search input::-webkit-search-cancel-button{display:none}
23
- .oa-search button{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;margin-right:-4px;padding:0;border:0;border-radius:6px;background:none;color:inherit;cursor:pointer}
24
- .oa-search button:hover{background:var(--oa-page-hover-bg)}
25
- .oa-section-title{margin:0 0 12px;font-size:13px;font-weight:400;line-height:20px;color:var(--oa-page-text-tertiary)}
26
- .oa-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:14px 10px;margin:0 0 36px;padding:0;list-style:none}
27
- .oa-tile-groups{display:flex;flex-wrap:wrap;gap:20px 28px;margin:0 0 36px}
28
- .oa-tile-group{display:flex;flex-direction:column;min-width:0}
29
- .oa-tile-group .oa-section-title{margin-bottom:10px}
30
- .oa-tile-group .oa-tiles{display:flex;flex-wrap:wrap;gap:10px;margin:0}
31
- .oa-tile-group .oa-tiles>li{width:112px}
32
- .oa-tile{display:flex;flex-direction:column;gap:8px;width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
33
- .oa-tile-art{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:10/7;border-radius:14px;overflow:hidden;background:var(--oa-wash);color:var(--oa-ink);transition:transform .2s cubic-bezier(.2,.7,.3,1),background-color .15s}
34
- .oa-tile:hover .oa-tile-art,.oa-tile[data-peek=true] .oa-tile-art{transform:scale(1.03)}
35
- .oa-tile:focus-visible{outline:none}
36
- .oa-tile:focus-visible .oa-tile-art{outline:var(--oa-page-focus-ring-width,2px) solid var(--oa-page-focus-ring-color,var(--oa-page-accent));outline-offset:2px}
37
- .oa-tile-art>svg{position:relative}
38
- .oa-tile-art>.oa-tile-doodle{position:absolute;inset:0;width:100%;height:100%;opacity:.14;pointer-events:none}
39
- .oa-tile-beta{position:absolute;top:6px;left:6px;padding:0 6px;border-radius:999px;background:#fff;box-shadow:0 0 0 .5px var(--oa-page-border-floating,rgba(0,0,0,.16));color:var(--oa-page-text-secondary);font-size:11px;line-height:16px}
40
- .oa-tile-label{display:flex;flex-direction:column;padding-left:2px;font-size:14px;line-height:20px}
41
- .oa-tile-state{display:inline-flex;align-items:center;gap:5px;color:var(--oa-page-text-tertiary);font-size:12px;line-height:16px}
42
- .oa-tile-state[data-state=failed]{color:var(--oa-page-danger)}
43
- .oa-tile-state .oa-spinner{width:9px;height:9px;border-width:1.2px}
44
- .oa-tile[data-missing=true] .oa-tile-art{background:color-mix(in srgb,var(--oa-wash) 45%,var(--oa-page-bg));color:color-mix(in srgb,var(--oa-ink) 55%,var(--oa-page-bg));box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--oa-ink) 22%,transparent)}
45
- .oa-tile[data-missing=true]:hover .oa-tile-art,.oa-tile[data-missing=true][data-peek=true] .oa-tile-art{background:color-mix(in srgb,var(--oa-wash) 65%,var(--oa-page-bg))}
46
- .oa-tile[data-missing=true] .oa-tile-doodle{opacity:.08}
47
- .oa-tile[data-missing=true] .oa-tile-label{color:var(--oa-page-text-secondary)}
48
- :where(.oa-page)[data-theme=dark] .oa-tile-art{background:color-mix(in srgb,var(--oa-ink) 36%,var(--oa-page-bg));color:var(--oa-wash)}
49
- :where(.oa-page)[data-theme=dark] .oa-tile[data-missing=true] .oa-tile-art{background:color-mix(in srgb,var(--oa-ink) 16%,var(--oa-page-bg));color:color-mix(in srgb,var(--oa-wash) 55%,var(--oa-page-bg));box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--oa-wash) 18%,transparent)}
50
- :where(.oa-page)[data-theme=dark] .oa-tile[data-missing=true]:hover .oa-tile-art,:where(.oa-page)[data-theme=dark] .oa-tile[data-missing=true][data-peek=true] .oa-tile-art{background:color-mix(in srgb,var(--oa-ink) 24%,var(--oa-page-bg))}
51
- :where(.oa-page)[data-theme=dark] .oa-tile-art>.oa-tile-doodle{opacity:.12}
52
- :where(.oa-page)[data-theme=dark] .oa-tile-beta{background:var(--oa-page-bg)}
53
- .oa-peek{position:fixed;z-index:900;width:288px;max-width:calc(100vw - 16px);box-sizing:border-box;padding:16px;border:.5px solid var(--oa-page-border-floating,rgba(0,0,0,.16));border-radius:16px;background:var(--oa-page-bg);box-shadow:0 12px 32px -10px rgba(0,0,0,.22);color:var(--oa-page-text-primary);animation:oa-peek-in .14s ease-out}
54
- .oa-peek-title{font-size:17px;line-height:24px}
55
- .oa-peek-by{margin-top:2px;font-size:14px;line-height:20px;color:var(--oa-page-text-secondary)}
56
- .oa-peek-about{margin:6px 0 0;font-size:14px;line-height:20px;color:var(--oa-page-text-secondary)}
57
- .oa-peek-act{margin-top:14px;height:32px;padding:0 10px;border:0;border-radius:8px;background:color-mix(in srgb,var(--oa-page-text-primary) 6%,var(--oa-page-bg));color:var(--oa-page-text-primary);font:inherit;font-size:14px;cursor:pointer}
58
- .oa-peek-act:hover{background:color-mix(in srgb,var(--oa-page-text-primary) 10%,var(--oa-page-bg))}
59
- .oa-peek-act:focus-visible{outline:var(--oa-page-focus-ring-width,2px) solid var(--oa-page-focus-ring-color,var(--oa-page-accent));outline-offset:2px}
60
- @keyframes oa-peek-in{from{opacity:0;transform:translateY(-4px)}}
61
- .oa-dialog-head{display:flex;align-items:center;gap:12px;margin-bottom:12px}
62
- .oa-dialog-head h2{margin:0}
63
- .oa-dialog .oa-glyph{width:40px;height:40px}
64
- .oa-dialog p+p{margin-top:8px}
65
- .oa-dialog p[data-kind=error]{color:var(--oa-page-danger)}
66
- .oa-dialog-status{display:flex;align-items:center;gap:8px}
67
- .oa-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:20px;margin:0;padding:0;list-style:none}
68
- .oa-item{position:relative;min-width:0}
69
- .oa-card{display:flex;flex-direction:column;width:100%;padding:0;border:.5px solid var(--oa-page-border);border-radius:14px;overflow:hidden;background:var(--oa-page-bg);color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background-color .15s}
70
- .oa-item:hover .oa-card{background:var(--oa-page-hover-bg)}
71
- .oa-card:disabled{cursor:progress}
72
- .oa-card:focus-visible,.oa-row:focus-visible{outline:var(--oa-page-focus-ring-width,2px) solid var(--oa-page-focus-ring-color,var(--oa-page-accent));outline-offset:2px}
73
- .oa-preview{position:relative;display:block;width:100%;aspect-ratio:2/1;overflow:hidden;background:color-mix(in srgb,var(--oa-tint) 16%,var(--oa-page-bg))}
74
- .oa-sheet{position:absolute;left:12%;right:12%;top:13%;bottom:-8px;border-radius:8px 8px 0 0;overflow:hidden;background:var(--oa-page-bg);box-shadow:0 0 0 .5px var(--oa-page-border),0 6px 18px -8px rgba(0,0,0,.28);transition:transform .2s}
75
- .oa-item:hover .oa-sheet{transform:translateY(-3px)}
76
- .oa-sheet img{display:block;width:100%;height:100%;object-fit:cover;object-position:top center;user-select:none}
77
- .oa-preview[data-stack=true] .oa-sheet{left:20%;right:20%}
78
- .oa-preview[data-stack=true]::before{content:"";position:absolute;left:21%;right:19%;top:10%;bottom:-8px;border-radius:8px 8px 0 0;background:var(--oa-page-bg);box-shadow:0 0 0 .5px var(--oa-page-border);transform:rotate(1.6deg);transform-origin:bottom center}
79
- .oa-paper{position:absolute;left:14%;right:14%;top:13%;bottom:-8px;border-radius:8px 8px 0 0;background:var(--oa-page-bg);box-shadow:0 0 0 .5px var(--oa-page-border),0 6px 18px -8px rgba(0,0,0,.25);padding:6% 7% 0;display:flex;flex-direction:column;gap:6px;overflow:hidden;transition:transform .2s}
80
- .oa-item:hover .oa-paper{transform:translateY(-3px)}
81
- .oa-paper-title{font-size:11px;line-height:1.35;font-weight:600;color:var(--oa-page-text-primary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
82
- .oa-line{height:5px;border-radius:3px;background:var(--oa-page-border)}
83
- .oa-slide{position:absolute;left:14%;right:14%;top:13%;aspect-ratio:16/9;border-radius:6px;background:var(--oa-page-bg);box-shadow:0 0 0 .5px var(--oa-page-border),0 6px 18px -8px rgba(0,0,0,.25);display:flex;flex-direction:column;justify-content:center;gap:6px;padding:0 9%;transition:transform .2s}
84
- .oa-item:hover .oa-slide{transform:translateY(-3px)}
85
- .oa-slide .oa-paper-title{font-size:12px}
86
- .oa-slide .oa-line{width:40%;background:var(--oa-tint);opacity:.55}
87
- .oa-boards{display:flex;gap:6px;flex:1;margin-top:2px}
88
- .oa-board{flex:1;border-radius:3px;background:color-mix(in srgb,var(--oa-tint) 18%,var(--oa-page-bg));box-shadow:0 0 0 .5px var(--oa-page-border)}
89
- .oa-board:nth-child(2){flex:.7;margin-top:10%}
90
- .oa-flow{display:block;width:100%;height:auto;margin-top:4px}
91
- .oa-flow rect{fill:color-mix(in srgb,var(--oa-tint) 18%,var(--oa-page-bg));stroke:var(--oa-page-border);stroke-width:.5}
92
- .oa-flow path{fill:none;stroke:var(--oa-tint);stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
93
- .oa-cells{display:block;width:100%;height:auto;margin-top:4px}
94
- .oa-cells path{fill:none;stroke:var(--oa-page-border);stroke-width:.75}
95
- .oa-cells-head{fill:color-mix(in srgb,var(--oa-tint) 18%,var(--oa-page-bg))}
96
- .oa-cells-pick{fill:none;stroke:var(--oa-tint);stroke-width:1.5}
97
- .oa-swatches{display:flex;gap:4px}
98
- .oa-swatch{width:16px;height:16px;border-radius:50%;background:var(--oa-tint)}
99
- .oa-swatch:nth-child(2){opacity:.7}.oa-swatch:nth-child(3){opacity:.45}.oa-swatch:nth-child(4){opacity:.25}
100
- .oa-specimen{font-size:20px;line-height:1;font-weight:600;color:var(--oa-page-text-secondary)}
101
- .oa-kpis{display:flex;gap:5px}
102
- .oa-kpi{flex:1;height:16px;border-radius:3px;box-shadow:0 0 0 .5px var(--oa-page-border)}
103
- .oa-bars{display:flex;align-items:flex-end;gap:5px;height:34%;margin-top:2px}
104
- .oa-bar{flex:1;border-radius:2px 2px 0 0;background:var(--oa-tint);opacity:.7}
105
- .oa-film{position:absolute;left:14%;right:14%;top:13%;aspect-ratio:16/9;border-radius:6px;background:#1d1d1f;box-shadow:0 6px 18px -8px rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;transition:transform .2s;color:#fff}
106
- .oa-item:hover .oa-film{transform:translateY(-3px)}
107
- .oa-film-bar{position:absolute;left:8%;right:8%;bottom:10%;height:3px;border-radius:2px;background:rgba(255,255,255,.25)}
108
- .oa-film-bar::after{content:"";position:absolute;left:0;top:0;bottom:0;width:38%;border-radius:2px;background:var(--oa-tint)}
109
- .oa-film-title{position:absolute;left:8%;right:8%;top:10%;font-size:10px;font-weight:600;color:rgba(255,255,255,.85);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
110
- .oa-busy{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:8px;background:color-mix(in srgb,var(--oa-page-bg) 70%,transparent);color:var(--oa-page-text-secondary);font-size:13px}
111
- .oa-spinner{width:14px;height:14px;border-radius:50%;border:1.5px solid currentColor;border-right-color:transparent;animation:oa-spin .8s linear infinite}
112
- @keyframes oa-spin{to{transform:rotate(360deg)}}
113
- .oa-info{display:flex;align-items:center;gap:12px;min-width:0;padding:12px 14px}
114
- .oa-glyph{flex:none;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:9px;background:var(--oa-wash);color:var(--oa-ink)}
115
- :where(.oa-page)[data-theme=dark] .oa-glyph{background:color-mix(in srgb,var(--oa-ink) 36%,var(--oa-page-bg));color:var(--oa-wash)}
116
- .oa-menu-glyph{display:flex;color:var(--oa-ink)}
117
- :where(.oa-page)[data-theme=dark] .oa-menu-glyph{color:var(--oa-wash)}
118
- .oa-text{display:flex;flex-direction:column;min-width:0;flex:1}
119
- .oa-name{font-weight:500;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
120
- .oa-meta{color:var(--oa-page-text-tertiary);font-size:12px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
121
- .oa-actions{position:absolute;top:10px;right:10px;display:flex;align-items:center;gap:6px}
122
- .oa-act{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:.5px solid var(--oa-page-border);border-radius:8px;background:var(--oa-page-bg);color:var(--oa-page-text-secondary);cursor:pointer;opacity:0;transition:opacity .12s}
123
- .oa-act:hover{color:var(--oa-page-text-primary);background:color-mix(in srgb,var(--oa-page-text-primary) 6%,var(--oa-page-bg))}
124
- .oa-item:hover .oa-act,.oa-item:focus-within .oa-act,.oa-act[aria-expanded=true],.oa-act[data-on=true]{opacity:1}
125
- .oa-act[data-on=true]{color:var(--oa-page-text-primary)}
126
- .oa-list{display:flex;flex-direction:column;gap:2px;margin:0;padding:0;list-style:none}
127
- .oa-list .oa-item{display:flex;align-items:center;border-radius:10px;padding-right:8px}
128
- .oa-list .oa-item:hover,.oa-list .oa-item[data-menu=true]{background:var(--oa-page-hover-bg)}
129
- .oa-row{display:flex;align-items:center;gap:12px;flex:1;min-width:0;padding:8px 10px;border:0;border-radius:10px;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
130
- .oa-row:disabled{cursor:progress}
131
- .oa-row .oa-name{flex:1;min-width:0}
132
- .oa-row .oa-meta{flex:none;max-width:45%;margin-left:16px}
133
- .oa-row-tools{flex:none;display:flex;align-items:center;gap:2px;margin-left:4px;color:var(--oa-page-text-tertiary)}
134
- .oa-shared{display:inline-flex;align-items:center;margin-right:6px;color:var(--oa-page-text-tertiary)}
135
- .oa-list .oa-act{width:28px;height:28px;border:0;background:none}
136
- .oa-list .oa-act:hover{background:color-mix(in srgb,var(--oa-page-text-primary) 8%,transparent)}
137
- .oa-list .oa-act-more{opacity:1}
138
- @media (max-width:560px){.oa-row .oa-meta{display:none}}
139
- .oa-menu{position:fixed;z-index:1000;min-width:200px;padding:6px;border:.5px solid var(--oa-page-border);border-radius:12px;background:var(--oa-page-bg);box-shadow:0 8px 28px -6px rgba(0,0,0,.28);font-size:14px}
140
- .oa-menu-item{display:flex;align-items:center;gap:10px;width:100%;min-height:34px;padding:5px 10px;border:0;border-radius:8px;background:none;color:var(--oa-page-text-primary);font:inherit;text-align:left;white-space:nowrap;cursor:pointer}
141
- .oa-menu-item:hover,.oa-menu-item:focus-visible,.oa-menu-item[aria-expanded=true]{background:var(--oa-page-hover-bg);outline:none}
142
- .oa-menu-item[data-danger=true]{color:var(--oa-page-danger)}
143
- .oa-menu-item svg{flex:none}
144
- .oa-menu-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
145
- .oa-menu-value{margin-left:16px;color:var(--oa-page-text-tertiary)}
146
- .oa-menu-count{margin-left:16px;color:var(--oa-page-text-tertiary);font-variant-numeric:tabular-nums}
147
- .oa-menu-key{margin-left:20px;color:var(--oa-page-text-tertiary);font:inherit;font-size:12px}
148
- .oa-menu-rule{height:.5px;margin:6px 4px;background:var(--oa-page-border)}
149
- .oa-menu-chev{margin-left:6px;color:var(--oa-page-text-tertiary)}
150
- .oa-menu-row{position:relative}
151
- .oa-submenu{position:absolute;left:calc(100% + 12px);top:-6px;z-index:1001;min-width:190px;padding:6px;border:.5px solid var(--oa-page-border);border-radius:12px;background:var(--oa-page-bg);box-shadow:0 8px 28px -6px rgba(0,0,0,.28)}
152
- .oa-submenu[data-flip=true]{left:auto;right:calc(100% + 12px)}
153
- .oa-check{flex:none;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:1px solid var(--oa-page-border-strong);border-radius:5px;color:transparent}
154
- .oa-check[data-on=true]{border-color:var(--oa-page-accent);background:var(--oa-page-accent);color:#fff}
155
- .oa-tick{flex:none;margin-left:16px;color:var(--oa-page-accent)}
156
- .oa-scrim{position:fixed;inset:0;z-index:1100;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.36)}
157
- .oa-dialog{width:min(420px,100%);padding:20px;border-radius:16px;background:var(--oa-page-bg);box-shadow:0 18px 48px -12px rgba(0,0,0,.4)}
158
- .oa-dialog h2{margin:0 0 12px;font-size:16px;font-weight:600;line-height:24px;overflow-wrap:anywhere}
159
- .oa-dialog p{margin:0;color:var(--oa-page-text-secondary);font-size:14px;line-height:1.55;overflow-wrap:anywhere}
160
- .oa-dialog input{box-sizing:border-box;width:100%;height:38px;padding:0 12px;border:1px solid var(--oa-page-border);border-radius:10px;background:none;color:var(--oa-page-text-primary);font:inherit;outline:none}
161
- .oa-dialog input:focus{border-color:var(--oa-page-accent)}
162
- .oa-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}
163
- .oa-btn{height:34px;padding:0 14px;border:0;border-radius:9px;background:var(--oa-page-hover-bg);color:var(--oa-page-text-primary);font:inherit;font-weight:500;cursor:pointer}
164
- .oa-btn:hover{background:color-mix(in srgb,var(--oa-page-text-primary) 12%,var(--oa-page-bg))}
165
- .oa-btn:disabled{color:var(--oa-page-text-caption);cursor:default;background:var(--oa-page-hover-bg)}
166
- .oa-btn[data-primary=true]{background:var(--oa-page-accent);color:#fff}
167
- .oa-btn[data-primary=true]:hover:not(:disabled){filter:brightness(1.08)}
168
- .oa-btn[data-primary=true]:disabled{background:var(--oa-page-hover-bg);color:var(--oa-page-text-caption)}
169
- .oa-btn[data-danger=true]{border:1px solid var(--oa-page-danger);background:color-mix(in srgb,var(--oa-page-danger) 10%,var(--oa-page-bg));color:var(--oa-page-danger)}
170
- .oa-btn[data-danger=true]:hover{background:color-mix(in srgb,var(--oa-page-danger) 18%,var(--oa-page-bg))}
171
- .oa-toast{position:absolute;left:50%;bottom:24px;z-index:900;display:flex;align-items:center;gap:10px;max-width:min(560px,calc(100% - 32px));padding:9px 10px 9px 14px;border:.5px solid var(--oa-page-border);border-radius:12px;background:var(--oa-page-bg);box-shadow:0 8px 28px -6px rgba(0,0,0,.28);transform:translateX(-50%);font-size:14px}
172
- .oa-toast[data-kind=error]{color:var(--oa-page-danger)}
173
- .oa-toast svg{flex:none}
174
- .oa-toast-text{min-width:0;overflow-wrap:anywhere}
175
- .oa-toast-undo{flex:none;padding:2px 8px;border:0;border-radius:6px;background:none;color:var(--oa-page-accent);font:inherit;font-weight:500;cursor:pointer}
176
- .oa-toast-undo:hover{background:var(--oa-page-hover-bg)}
177
- .oa-toast-close{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:none;color:var(--oa-page-text-tertiary);cursor:pointer}
178
- .oa-toast-close:hover{background:var(--oa-page-hover-bg)}
179
- .oa-empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:56px 20px;text-align:center;color:var(--oa-page-text-tertiary)}
180
- .oa-empty svg{color:var(--oa-page-text-caption);margin-bottom:4px}
181
- .oa-empty h2{margin:0;font-size:14px;font-weight:500;color:var(--oa-page-text-secondary)}
182
- .oa-empty p{margin:0;max-width:420px;font-size:13px;line-height:1.6}
183
- .oa-retry{margin-top:8px;height:30px;padding:0 12px;border:.5px solid var(--oa-page-border);border-radius:15px;background:none;color:var(--oa-page-text-primary);font:inherit;font-size:13px;cursor:pointer}
184
- .oa-retry:hover{background:var(--oa-page-hover-bg)}
185
- .oa-skeleton .oa-card{cursor:default}
186
- .oa-skeleton .oa-preview{background:var(--oa-page-skeleton-bg,var(--oa-page-hover-bg))}
187
- .oa-skeleton .oa-line{width:60%;height:10px;margin:18px 14px}
188
- @media (prefers-reduced-motion:reduce){.oa-sheet,.oa-paper,.oa-slide,.oa-film,.oa-act,.oa-tile-art,.oa-card{transition:none}.oa-tile:hover .oa-tile-art,.oa-tile[data-peek=true] .oa-tile-art{transform:none}.oa-peek{animation:none}.oa-spinner{animation-duration:2s}}
189
- .oa-news .oau-head{margin-bottom:8px}
190
- .oa-notes{display:flex;flex-direction:column;gap:12px;align-items:flex-start}
191
- .oa-release{align-self:stretch;min-width:0}
192
- .oa-release-head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0 0 4px;font-size:14px;font-weight:600;line-height:22px;color:var(--oa-page-text-primary)}
193
- .oa-release-date{font-weight:400;color:var(--oa-page-text-tertiary);font-size:12px}
194
- .oa-release-summary{margin:0 0 6px;color:var(--oa-page-text-primary);font-size:13px;line-height:20px;overflow-wrap:anywhere}
195
- .oa-release-section{margin-top:6px}
196
- .oa-release-section h4{margin:0 0 2px;font-size:12px;font-weight:500;line-height:18px;color:var(--oa-page-text-tertiary)}
197
- .oa-release-section ul{margin:0;padding-left:18px;color:var(--oa-page-text-secondary);font-size:13px;line-height:20px}
198
- .oa-release-section li{overflow-wrap:anywhere}
199
- .oa-release-section li+li{margin-top:2px}
200
- .oa-release code{padding:0 4px;border-radius:4px;background:color-mix(in srgb,var(--oa-page-text-primary) 8%,transparent);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}
201
- .oa-release strong{font-weight:600;color:var(--oa-page-text-primary)}
202
- .oa-release a{color:var(--oa-page-accent)}
203
- .oa-news-upcoming{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:10px;padding-top:10px;border-top:.5px solid var(--oa-page-border)}
204
- .oa-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 8px;margin-top:40px;color:var(--oa-page-text-tertiary);font-size:12px;line-height:18px}
205
- .oa-dialog[data-wide=true]{width:min(640px,100%);display:flex;flex-direction:column;max-height:min(720px,calc(100vh - 48px))}
206
- .oa-changelog{flex:1;min-height:0;overflow:auto;margin:0 -20px;padding:0 20px}
207
- .oa-changelog .oa-release+.oa-release{padding-top:12px;border-top:.5px solid var(--oa-page-border)}
208
- .oa-btn-link{display:inline-flex;align-items:center;text-decoration:none;margin-right:auto}
209
- `,ao=`
210
- .oau-panel{margin:0 0 24px;padding:14px 16px;border-radius:12px;background:var(--oa-page-hover-bg);color:var(--oa-page-text-primary);font-size:13px;line-height:20px}
211
- .oau-head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 16px}
212
- .oau-head-text{flex:1;min-width:200px}
213
- .oau-title{font-weight:500;overflow-wrap:anywhere}
214
- .oau-text{color:var(--oa-page-text-secondary);overflow-wrap:anywhere}
215
- .oau-actions{flex:none;display:flex;gap:8px}
216
- .oau-line{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0 0 20px;color:var(--oa-page-text-secondary);font-size:13px;line-height:20px}
217
- .oau-show{padding:0;border:0;background:none;color:var(--oa-page-accent);font:inherit;cursor:pointer}
218
- .oau-show:hover{text-decoration:underline}
219
- .oau-tag{display:inline-flex;align-items:center;padding:0 8px;border-radius:9px;font-size:12px;line-height:20px;background:color-mix(in srgb,var(--oa-page-accent) 12%,transparent);color:var(--oa-page-accent)}
220
- .oau-tag[data-tone="neutral"]{background:var(--oa-page-hover-bg);color:var(--oa-page-text-secondary)}
221
- `;function to(a,t){if(typeof document>"u"||!t)return()=>{};if(document.querySelector(`style[data-plugin-css="${a}"]`))return()=>{};const o=document.createElement("style");return o.dataset.pluginCss=a,o.textContent=t,document.head.appendChild(o),()=>o.remove()}function xa(a){if(!a)return null;if(!/^[a-z][a-z0-9+.-]*:\/\//i.test(a)&&!a.startsWith("/"))return a;try{return new URL(a,"http://localhost").searchParams.get("v")??a}catch{return a}}function X(a,t){const o=a.createdAt??"",n=a.owner??null;return{id:a.id??"",root:a.root??"",project:a.project??"",type:a.type??"",typeTitle:a.typeTitle??a.type??"",sessionId:n?.harness===t&&typeof n.session=="string"?n.session:"",ownerStatus:n?n.live===!1?"offline":n.status??null:null,title:a.title??"",openedAt:a.openedAt??o,createdAt:o,updatedAt:a.contentAt??a.updatedAt??o,pinned:!!a.pinned,shared:!!a.shared,webShare:a.webShare?.url?{url:a.webShare.url,manage:Ra(a.webShare.endpoint)}:null,thumbnail:xa(a.thumbnail),openable:!a.typeMissing,viewUrl:a.view_url??""}}function oo(a){return a.filter(t=>typeof t.id=="string"&&t.enabled!==!1&&t.runnable!==!1&&!t.shadowedBy&&!t.problems?.length).map(t=>({id:t.id,title:t.title||t.id,description:t.description??""}))}function no(a,t,o){return{artifacts:(a.artifacts??[]).map(n=>X(n,o)),types:oo(t.types??[])}}function ro(a,t){return{url:a.view_url??t.viewUrl,sessionId:t.sessionId,title:t.title}}function so(a,t){return{trash:a.deleted??t,path:a.folderKept??""}}const Q="",ee=(a,t)=>`/api/open-artifacts.${a}${t?`?${new URLSearchParams(t)}`:""}`;async function je(a,t,o){const n=await a(ee(t,o?.query),{cache:"no-store",...o?.body!==void 0?{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(o.body)}:{}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(typeof r.message=="string"&&r.message?r.message:`HTTP ${n.status}`);return r}function io(a=(...t)=>fetch(...t)){const t=(r,l)=>je(a,r,l?{query:l}:void 0),o=(r,l)=>je(a,r,{body:l}),n=async r=>X(await t(E.artifact,{id:r}),Q);return{async list(){const[r,l]=await Promise.all([t(E.artifacts),t(E.types)]);return no(r,l,Q)},async open(r){const l=await o(E.open,{id:r,host:!1});return ro(l,await n(r))},preview:async r=>(await o(E.preview,{id:r})).page_url??null,update:async(r,l)=>X(await o(E.update,{id:r,...l}),Q),remove:async r=>so(await o(E.delete,{id:r}),r),restore:async r=>X(await o(E.restore,{id:r}),Q),async saveThumbnail(r,l,d){const u=await a(ee(E.thumbnail,{id:r,v:l}),{method:"POST",headers:{"content-type":"image/jpeg"},body:d}),c=await u.json().catch(()=>({}));return u.ok?xa(c.thumbnail)??l:null},thumbnailUrl:(r,l)=>ee(E.thumbnail,{id:r,v:l}),events(r,l){if(typeof EventSource>"u")return null;const d=new EventSource(ee(E.events));return d.onmessage=()=>r(),d.onerror=()=>l(),()=>d.close()}}}function qe(a,t){const o=a.app();o?.caps.artifacts?a.toApp({openArtifacts:"open_artifact",url:`open-artifacts://artifact/${t.id}`,id:t.id,title:t.title,type:t.type},o.origin):a.navigate(Ba(t.id))}function lo(a){const t=a.fetcher??((...o)=>fetch(...o));return{canCreate:()=>!0,create(o){if(!o)return;const n=_a(o.id)==="blank";je(t,E.create,{body:{type:o.id,title:a.untitled(o.title),...n?{blank:!0}:{}}}).then(r=>{typeof r.id=="string"&&qe(a,{id:r.id,title:r.title||o.title,type:r.typeTitle||o.title})},r=>a.failed(r instanceof Error?r.message:String(r)))},away:()=>!1,pendingWindow:()=>null,async show(o){const n=/\/a\/([^/?#]+)/.exec(o.url)?.[1];if(n){const r=decodeURIComponent(n);qe(a,{id:r,title:o.title,type:a.typeOf(r)})}else a.navigate(o.url);return{sessionGone:!1}},copy:o=>a.copy(o),visible:()=>a.visible(),storage:a.storage}}function co(a,t){const o=Da(a);if(!Ia(o)||o.openArtifacts!=="host_hello")return null;const n=$a(o);return!n||n.openArtifacts!=="host_hello"?null:{origin:t,caps:n.caps,theme:n.theme?.scheme??null}}const po={updates:[],phase:"idle",to:"",restart:!1,failure:null,dismissed:""};function uo(a){const{status:t}=a,o=t?.check?.available??"",n=t?.running??"",r=t?.policy.update;return{updates:!!o&&r!=="off"&&r!=="bundled"&&(!n||L(o,n))?[{name:"Open Artifacts",version:n,latest:o}]:[],phase:a.phase,to:a.to,restart:a.pending,failure:a.phase==="failed"?{plugin:"Open Artifacts",message:a.error,left:"kept"}:null,dismissed:a.dismissed}}const ho={available:"updateAvailable",current:"updateCurrent",update:"updateNow","update.one":"updateNow",later:"updateLater",busy:"updateBusy",done:"updateDone","done.session":"updateDoneCurrent","done.restart":"updateDonePending",failed:"updateFailed","failed.kept":"updateFailedKept","failed.unknown":"updateFailedKept",retry:"updateRetry",close:"updateClose",show:"updateShow",restart:"updateClose"};function go(a){let t=null,o=po;return{getSnapshot(){const n=a.get();if(n!==t){t=n;const r=uo(n);o=JSON.stringify(r)===JSON.stringify(o)?o:r}return o},subscribe:a.subscribe,start:a.start,later:a.later,close:a.close,reopen:a.reopen,t:(n,r)=>a.words(ho[n],r)}}const xo=Object.freeze({"--oa-page-text-primary":["#1a1a1a","#ececea"],"--oa-page-text-secondary":["#4a4a4a","#b8b8b4"],"--oa-page-text-tertiary":["#5c5c5c","#8f8f8a"],"--oa-page-text-caption":["#8a8a8a","#6b6b67"],"--oa-page-bg":["#ffffff","#1c1c1e"],"--oa-page-hover-bg":["#f1f1f1","#2a2a2c"],"--oa-page-accent":["#2f5fe0","#5b84f0"],"--oa-page-danger":["#d1373b","#f06a6e"],"--oa-page-border-strong":["#cfcfcf","#4a4a4c"],"--oa-page-border":["#e2e2e2","#333335"],"--oa-page-border-floating":["rgba(0,0,0,.14)","rgba(255,255,255,.14)"],"--oa-page-skeleton-bg":["#f1f1f1","#2a2a2c"],"--oa-page-focus-ring-width":["2px","2px"],"--oa-page-focus-ring-color":["#2f5fe0","#5b84f0"],"--oa-page-top-clearance":["0px","0px"]}),Ze=a=>Object.entries(xo).map(([t,o])=>`${t}:${o[a]}`).join(";"),mo=`
222
- :root{color-scheme:light;${Ze(0)}}
223
- :root[data-theme=dark]{color-scheme:dark;${Ze(1)}}
224
- html,body,#root{height:100%;margin:0}
225
- body{background:var(--oa-page-bg);color:var(--oa-page-text-primary);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;-webkit-font-smoothing:antialiased}
226
- `,Oe=Wa==="zh-CN",fo=Oe?ea:aa,ma=ct((a,t)=>{const o=fo[a];return o===void 0?a:o.replace(/\{(\w+)\}/g,(n,r)=>t?.[r]??n)});document.documentElement.lang=Oe?"zh-CN":"en";let ze=null;const ke=new Set,bo=a=>{ze=a;for(const t of ke)t()};let fa=null;try{fa=typeof localStorage>"u"?null:localStorage}catch{}async function yo(a){try{await navigator.clipboard.writeText(a)}catch{const t=document.createElement("textarea");t.value=a,t.style.cssText="position:fixed;opacity:0",document.body.append(t),t.select();const o=document.execCommand("copy");if(t.remove(),!o)throw new Error("the clipboard refused it")}}const ba=io(),Ne=yt({api:ba,t:ma,host:lo({app:()=>ze,toApp:(a,t)=>window.parent.postMessage(Ce(a),t),navigate:a=>location.assign(a),failed:a=>Ne.getState().showToast(a,"error"),copy:yo,visible:()=>document.visibilityState==="visible",storage:fa,untitled:a=>{const t=a.replace(/\s*[((].*[))]\s*$/,"")||a;return Oe?`未命名${t}`:`Untitled ${t}`},typeOf:a=>Ne.getState().artifacts.find(t=>t.id===a)?.typeTitle??""})}),vo=go({get:()=>Ke.getState(),subscribe:a=>Ke.subscribe(a),start:()=>{Za()},later:Ga,close:Va,reopen:Ya,words:(a,t)=>qa(a,t)}),wo={t:ma,api:ba,sessions:Qa,updates:vo},ya=window.parent!==window,jo=Ka();window.addEventListener("message",a=>{if(!ya||a.source!==window.parent)return;const t=co(a.data,a.origin);t&&jo().then(({hosts:o,latest:n})=>{!n||o?.length&&!o.includes(a.origin)||(bo(t),window.parent.postMessage(Ce({openArtifacts:"home_ready"}),a.origin))})});ya&&window.parent.postMessage(Ce({openArtifacts:"home_hello"}),"*");const Se=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null;function ko(a){return ke.add(a),Se?.addEventListener("change",a),()=>{ke.delete(a),Se?.removeEventListener("change",a)}}const Je=()=>ze?.theme??(Se?.matches?"dark":"light");function No(){const a=g.useSyncExternalStore(ko,Je,Je);return document.documentElement.dataset.theme=a,e.jsx(at,{env:wo,children:e.jsx(vt,{store:Ne,children:e.jsx(Xt,{canCreate:!0,theme:a,createButton:!1})})})}to("open-artifacts-library/page.css",mo+eo+ao);Ua();Ha.createRoot(document.getElementById("root")).render(e.jsx(g.StrictMode,{children:e.jsx(No,{})}));