@inkeep/open-knowledge 0.47.0-beta.0 → 0.47.0-beta.2

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 (137) hide show
  1. package/dist/{acp-harness-probe-OOqhJYkA.mjs → acp-harness-probe-BYLCx-9P.mjs} +2 -2
  2. package/dist/cli.mjs +7 -7
  3. package/dist/constants-CHd7yi0X.mjs +2 -0
  4. package/dist/git-handle-D0uAjBAd.mjs +1 -0
  5. package/dist/{git-handle-CcP97K0r.mjs → git-handle-RLYVdszV.mjs} +2 -2
  6. package/dist/index.mjs +1 -1
  7. package/dist/{init-XQge-Dye.mjs → init-4qi6zG9S.mjs} +3 -3
  8. package/dist/init-DVGGoG7U.mjs +1 -0
  9. package/dist/{launch-json-removal-BHGCiUUm.mjs → launch-json-removal-CwrvAwfU.mjs} +2 -2
  10. package/dist/loader-Da51ptLu.mjs +1 -0
  11. package/dist/{loader-DNLU_zDg.mjs → loader-cuv9j2d2.mjs} +2 -2
  12. package/dist/md-manager-CrYbAiKl.mjs +2 -0
  13. package/dist/{open-browser-Dxxuy1ht.mjs → open-browser-4sOlBbCM.mjs} +2 -2
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/{preview-CeEfl5CC.mjs → preview-BQIDNBdK.mjs} +2 -2
  16. package/dist/preview-CpHlywZf.mjs +1 -0
  17. package/dist/public/assets/{ActivityModeContent-BsjKj2Dp.js → ActivityModeContent-DnjDjPFp.js} +1 -1
  18. package/dist/public/assets/{AgentDiffPane-8FeMlxNc.js → AgentDiffPane-Th6j3NhO.js} +1 -1
  19. package/dist/public/assets/{AgentThreadClientBinder-DGuLR7_T.js → AgentThreadClientBinder-BVm5Ldhz.js} +1 -1
  20. package/dist/public/assets/{BugReportHistory-CNzYOdOg.js → BugReportHistory-D5qnl9oj.js} +1 -1
  21. package/dist/public/assets/{BugReportHistoryDialog-BdXwvet_.js → BugReportHistoryDialog-Da9QnJRc.js} +1 -1
  22. package/dist/public/assets/{ChangedOutsideBadge-iFQrYC_j.js → ChangedOutsideBadge-DVfCTGd2.js} +1 -1
  23. package/dist/public/assets/{CodeMirrorPropInput-B6FJjE4p.js → CodeMirrorPropInput-DmM8F7PJ.js} +2 -2
  24. package/dist/public/assets/DocumentContext-B0g_vd8N.js +38 -0
  25. package/dist/public/assets/{EditorModeToggle-B9w1EcVW.js → EditorModeToggle-DKuXrb9b.js} +1 -1
  26. package/dist/public/assets/{EnableSyncConfirmDialog-C9Zj2o5B.js → EnableSyncConfirmDialog-BQttSYlY.js} +1 -1
  27. package/dist/public/assets/FeedbackForm-FbNH_TYS.js +1 -0
  28. package/dist/public/assets/{GraphPanel-WAn3iep6.js → GraphPanel-DK2w8FEz.js} +2 -2
  29. package/dist/public/assets/{ImportSkillDialog-BT12LF7o.js → ImportSkillDialog-DHfVuiKL.js} +1 -1
  30. package/dist/public/assets/{LintConfigEditor-fuqihOSh.js → LintConfigEditor-B-7Pe22_.js} +1 -1
  31. package/dist/public/assets/ManagedArtifactProperties-B-Y5eayN.js +8 -0
  32. package/dist/public/assets/ManagedArtifactProperties-Ddk1e_f6.js +1 -0
  33. package/dist/public/assets/{McpConsentDialogBody-D399lgb6.js → McpConsentDialogBody-DPMIdjmd.js} +1 -1
  34. package/dist/public/assets/{MermaidDocEditor-Btncic6F.js → MermaidDocEditor-CBHNf1No.js} +1 -1
  35. package/dist/public/assets/{ReportBugDialogBody-DMJRqZYG.js → ReportBugDialogBody-CXLxw7Fr.js} +1 -1
  36. package/dist/public/assets/{SchemaConfigEditor-CJxPYFfH.js → SchemaConfigEditor-DG-dOTBT.js} +1 -1
  37. package/dist/public/assets/{SessionsHost-DjUsH4OV.js → SessionsHost-DjbdveAp.js} +2 -2
  38. package/dist/public/assets/{SettingsDialogBody-BlqFfFZF.js → SettingsDialogBody-CFwua7VK.js} +3 -3
  39. package/dist/public/assets/{ShareBranchSwitchDialog-CqdCfvTW.js → ShareBranchSwitchDialog-CyWPLWZG.js} +1 -1
  40. package/dist/public/assets/{ShareReceiveDialog-C07-MMeb.js → ShareReceiveDialog-C-fxd4DJ.js} +1 -1
  41. package/dist/public/assets/{ShareReceiveMissDialog-B28LUAEG.js → ShareReceiveMissDialog-Y4PyuUCZ.js} +1 -1
  42. package/dist/public/assets/{SkillEditBanner-D54IcYm9.js → SkillEditBanner-Dbu0PwqP.js} +1 -1
  43. package/dist/public/assets/{SkillOriginInline-CaPLAC2_.js → SkillOriginInline-DuFc7cZs.js} +1 -1
  44. package/dist/public/assets/{SkillToolbarControls-np0Ok_xI.js → SkillToolbarControls-B4k3LXLX.js} +1 -1
  45. package/dist/public/assets/SourceEditor-BCMM4zJn.js +1 -0
  46. package/dist/public/assets/{TerminalPanel-BShIp-v4.js → TerminalPanel-DkXL03UX.js} +3 -3
  47. package/dist/public/assets/{TerminalWindowApp-BxdCV4WQ.js → TerminalWindowApp-DH34WwKL.js} +1 -1
  48. package/dist/public/assets/{TextDocEditor-N4-T0dws.js → TextDocEditor-DEdxUQxb.js} +1 -1
  49. package/dist/public/assets/{ThreadView-vuv4OflF.js → ThreadView-ktubIY9d.js} +1 -1
  50. package/dist/public/assets/{TimelineDiffPane-CoNZWl8n.js → TimelineDiffPane-DSvFVt40.js} +1 -1
  51. package/dist/public/assets/{agent-diff-store-D8_4Cfah.js → agent-diff-store-BX4UT3y1.js} +1 -1
  52. package/dist/public/assets/{agent-visibility-k-CBEP62.js → agent-visibility-CYBYXsoR.js} +1 -1
  53. package/dist/public/assets/{auth-state-cache-C4QFsqNn.js → auth-state-cache-ZZgXmLCf.js} +5 -5
  54. package/dist/public/assets/badge-CAMtyz4F.js +1 -0
  55. package/dist/public/assets/client-version-DN8Gnc8R.js +1 -0
  56. package/dist/public/assets/{config-context-BzGTI1i6.js → config-context-CdjtvoAz.js} +1 -1
  57. package/dist/public/assets/{config-provider-DAkovZnw.js → config-provider-CKct7q_G.js} +2 -2
  58. package/dist/public/assets/{dist-BqtkiFoE2.js → dist-DIn3VYDc2.js} +131 -131
  59. package/dist/public/assets/{doc-paths-DoYUYB8x.js → doc-paths-KCjzuC60.js} +1 -1
  60. package/dist/public/assets/{documents-events-D-wbjalg.js → documents-events-FrlFXuC-.js} +1 -1
  61. package/dist/public/assets/{file-tree-adapter-BnupHYtj.js → file-tree-adapter-BBMHbQG5.js} +1 -1
  62. package/dist/public/assets/{file-tree-utils-B1hGkjTf.js → file-tree-utils-DeyBapi2.js} +1 -1
  63. package/dist/public/assets/{folder-config-api-CMh_Htev.js → folder-config-api-OU19qNKs.js} +1 -1
  64. package/dist/public/assets/globals-BLjNYywW.css +1 -0
  65. package/dist/public/assets/{globals-DAQcZTzX.js → globals-D4ycChQP.js} +1 -1
  66. package/dist/public/assets/index-Bnezs-Zg.js +2092 -0
  67. package/dist/public/assets/{lint-config-client-CKUe53Ux.js → lint-config-client-D7DpNIwn.js} +1 -1
  68. package/dist/public/assets/markdownlint-rule-browser-eFxHHf9q.js +1 -0
  69. package/dist/public/assets/navigation-targets-BDSeZX3c.js +1 -0
  70. package/dist/public/assets/{open-managed-artifact-tab-LHp8L5oX.js → open-managed-artifact-tab-Wkw7QMir.js} +1 -1
  71. package/dist/public/assets/{pending-receive-nav-store-B23Cw9B-.js → pending-receive-nav-store-BN0afFCO.js} +1 -1
  72. package/dist/public/assets/{prop-types-CoFeckWu.js → prop-types-MABP6X1c.js} +1 -1
  73. package/dist/public/assets/{receive-store-DioA0dZX.js → receive-store-CTNYU3q-.js} +1 -1
  74. package/dist/public/assets/{schema-fields-view-intent-D5lrn_hr.js → schema-fields-view-intent-DVVFEaIP.js} +1 -1
  75. package/dist/public/assets/{selection-context-Dof8jCKa.js → selection-context-BgucOSM-.js} +1 -1
  76. package/dist/public/assets/skill-actions-By3ZQhYp.js +2 -0
  77. package/dist/public/assets/{skill-scope-mciGgli7.js → skill-scope-DkGQeaIH.js} +1 -1
  78. package/dist/public/assets/{skills-api-BCwis81Y.js → skills-api-BCiYKVSk.js} +1 -1
  79. package/dist/public/assets/{src-otYw9bF5.js → src-C_O1F_4l.js} +1 -1
  80. package/dist/public/assets/{tag-pill-input-BG-0qGDI.js → tag-pill-input-3Bkld5bN.js} +1 -1
  81. package/dist/public/assets/{target-navigation-intent-Dsxw_-u4.js → target-navigation-intent-BZ8rve8n.js} +1 -1
  82. package/dist/public/assets/{telemetry-impl-DbCWmxd-.js → telemetry-impl-BnnSgCUt.js} +1 -1
  83. package/dist/public/assets/{telemetry-startup-CwzbE1L1.js → telemetry-startup-Bm4eG3HE.js} +1 -1
  84. package/dist/public/assets/{terminal-launch-events-CVi1Y914.js → terminal-launch-events-DbpTBIvl.js} +1 -1
  85. package/dist/public/assets/{terminal-telemetry-Co-_es1q.js → terminal-telemetry-BMiT9GUh.js} +1 -1
  86. package/dist/public/assets/typing-burst-detector-DDN6b6N7.js +8 -0
  87. package/dist/public/assets/{uninstall-D8EeYjNd.js → uninstall-DJBDkbwq.js} +1 -1
  88. package/dist/public/assets/{use-activity-panel-BP2jMJSo.js → use-activity-panel-CInEut0L.js} +1 -1
  89. package/dist/public/assets/{use-collab-url-CPBFUo6-.js → use-collab-url-ecWCytiv.js} +1 -1
  90. package/dist/public/assets/{use-live-xterm-theme-C0oqpg5T.js → use-live-xterm-theme-Bf72FxVk.js} +1 -1
  91. package/dist/public/assets/{use-open-skill-s-eClkKp.js → use-open-skill-C3UqDa0B.js} +1 -1
  92. package/dist/public/assets/{use-settings-route-B0zt3SsC.js → use-settings-route-CYvmk4XT.js} +1 -1
  93. package/dist/public/assets/{use-skill-directory-B26V0_k7.js → use-skill-directory-Ce1Wy5Qf.js} +1 -1
  94. package/dist/public/assets/{use-skill-origin-BvDx434L.js → use-skill-origin-DscI7Fo0.js} +1 -1
  95. package/dist/public/assets/{use-skills-CJcOuHij.js → use-skills-B19yYlmR.js} +1 -1
  96. package/dist/public/assets/{use-terminal-enabled-Cfo3YlOk.js → use-terminal-enabled-D556BQSW.js} +1 -1
  97. package/dist/public/assets/use-timeline-entry-diff-C_2VFthE.js +6 -0
  98. package/dist/public/assets/{use-workspace-DTXZHJjI.js → use-workspace-008C-zhL.js} +1 -1
  99. package/dist/public/index.html +44 -44
  100. package/dist/public/uninstall.html +5 -5
  101. package/dist/{repair-launch-json-D6l8aL_D.mjs → repair-launch-json-BDkJpah_.mjs} +2 -2
  102. package/dist/{repair-mcp-configs-ichif-Bk.mjs → repair-mcp-configs-DnQc3393.mjs} +2 -2
  103. package/dist/{repair-skills-qmrK6SZN.mjs → repair-skills-BikzcmQr.mjs} +2 -2
  104. package/dist/repair-skills-CCM2p_7S.mjs +1 -0
  105. package/dist/server-lock-CiN5OJ-t.mjs +1 -0
  106. package/dist/{server-lock-n5pTKJ05.mjs → server-lock-DgWnoftI.mjs} +2 -2
  107. package/dist/{src-BV42FuHX.mjs → src-CGOjzQCL.mjs} +1 -1
  108. package/dist/{src-CKVQuBxP.mjs → src-CWDcUomk.mjs} +428 -428
  109. package/dist/{src-CQgwa7f6.mjs → src-Drda0pBn.mjs} +2 -2
  110. package/dist/{src-OfREap3u.mjs → src-pJ6LEXKc.mjs} +87 -87
  111. package/dist/{start-DAjONYhR.mjs → start-B8X4x2RR.mjs} +3 -3
  112. package/dist/start-CPV4EUy8.mjs +1 -0
  113. package/dist/{write-project-skill-C2-Cx_IS.mjs → write-project-skill-B8LGhuHT.mjs} +2 -2
  114. package/package.json +4 -4
  115. package/dist/constants-DoQnHGhM.mjs +0 -2
  116. package/dist/git-handle-C9PtYtLJ.mjs +0 -1
  117. package/dist/init-Y3Ee4Qri.mjs +0 -1
  118. package/dist/loader-wZnCFuTj.mjs +0 -1
  119. package/dist/md-manager-DkIWmj3u.mjs +0 -2
  120. package/dist/preview-DodRhg2O.mjs +0 -1
  121. package/dist/public/assets/DocumentContext-DtWKWc6V.js +0 -38
  122. package/dist/public/assets/FeedbackForm-MjJfwT3F.js +0 -1
  123. package/dist/public/assets/ManagedArtifactProperties-TvpPVnSJ.js +0 -1
  124. package/dist/public/assets/ManagedArtifactProperties-aEllvXPH.js +0 -8
  125. package/dist/public/assets/SourceEditor-CGoHkzWL.js +0 -1
  126. package/dist/public/assets/badge-C21d8Yhu.js +0 -1
  127. package/dist/public/assets/client-version-CwCARyxk.js +0 -1
  128. package/dist/public/assets/globals-BhZJ5T7E.css +0 -1
  129. package/dist/public/assets/index-DPYFSa8u.js +0 -2092
  130. package/dist/public/assets/markdownlint-rule-browser-B-cbNggE.js +0 -1
  131. package/dist/public/assets/navigation-targets-WVfDNB_X.js +0 -1
  132. package/dist/public/assets/skill-actions-BGPeKm35.js +0 -2
  133. package/dist/public/assets/typing-burst-detector-QhbUz0KI.js +0 -8
  134. package/dist/public/assets/use-timeline-entry-diff-Bj1P5iQG.js +0 -6
  135. package/dist/repair-skills-_EoqOWxY.mjs +0 -1
  136. package/dist/server-lock-5mHH4XDo.mjs +0 -1
  137. package/dist/start-CN-_ICe7.mjs +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./button-RQ5o7P7w.js";import{i as l,n as u,t as d}from"./tooltip-x7BNUa3s.js";import{c as f}from"./select-BUOcREjn.js";import{n as p,t as m}from"./toggle-group-Cnezoq-B.js";import{Zr as h,_o as g,fo as _,qa as v}from"./dist-BqtkiFoE2.js";import{n as y}from"./dist-uN7pEWl0.js";import{t as b}from"./file-tree-utils-B1hGkjTf.js";import"./config-provider-DAkovZnw.js";import{n as x}from"./config-context-BzGTI1i6.js";import{Ot as S,X as C}from"./dist-BNDNcytQ.js";import{t as w}from"./cm-theme-BCzjFmR8.js";import{t as T}from"./asset-dispatch-BOfThpQD.js";import{t as E}from"./dist-CZG2zXVq.js";import{t as D}from"./text-viewer-languages-BZtGVaBl.js";var O=o(),k=e(n(),1),A=class extends Error{httpStatus;constructor(e,t){super(e),this.name=`ViewerTextLoadError`,this.httpStatus=t}};function j(e){let t=(0,O.c)(10),{_:n}=i(),r;t[0]===n?r=t[1]:(r=e=>n(e===413?{id:`C_WGy8`}:e===415?{id:`VM7H66`}:e===404?{id:`s0IDhW`}:e===400?{id:`N1mdmS`}:typeof e==`number`?{id:`96w9hU`,values:{status:e}}:{id:`ig5vUe`}),t[0]=n,t[1]=r);let a=r,{src:o,loadText:s}=e,c=(0,k.useRef)(s),l=(0,k.useRef)(a),u;t[2]!==s||t[3]!==a?(u=()=>{c.current=s,l.current=a},t[2]=s,t[3]=a,t[4]=u):u=t[4],(0,k.useEffect)(u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`loading`},t[5]=d):d=t[5];let[f,p]=(0,k.useState)(d),m,h;return t[6]!==n||t[7]!==o?(m=()=>{let e=!1,t=new AbortController;p({status:`loading`});let r=c.current;return r?(r(t.signal).then(t=>{if(!e){if(t.ok){p({status:`loaded`,content:t.text});return}p({status:`error`,message:t.message??l.current(t.status),httpStatus:t.status})}}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()}):(fetch(o??``,{credentials:`same-origin`,signal:t.signal}).then(async e=>{if(!e.ok)throw new A(l.current(e.status),e.status);return e.text()}).then(t=>{e||p({status:`loaded`,content:t})}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:t instanceof Error?t.message:n({id:`ig5vUe`}),httpStatus:t instanceof A?t.httpStatus:void 0})}),()=>{e=!0,t.abort()})},h=[o,n],t[6]=n,t[7]=o,t[8]=m,t[9]=h):(m=t[8],h=t[9]),(0,k.useEffect)(m,h),f}var M=t();function N(e){let t=(0,O.c)(10),{fileName:n,dataAttr:i,extraAttrs:a}=e,o=`${i}-state`,s;t[0]!==i||t[1]!==o?(s={[i]:``,[o]:`loading`},t[0]=i,t[1]=o,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,M.jsx)(`span`,{children:(0,M.jsx)(r,{id:`Md709y`,values:{fileName:n}})}),t[3]=n,t[4]=c);let l;return t[5]!==a||t[6]!==n||t[7]!==s||t[8]!==c?(l=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":n,...s,...a,children:c}),t[5]=a,t[6]=n,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function P(e){let t=(0,O.c)(16),{fileName:n,dataAttr:i,extraAttrs:a,message:o,openFile:s}=e,l=`${i}-state`,u;t[0]!==i||t[1]!==l?(u={[i]:``,[l]:`error`},t[0]=i,t[1]=l,t[2]=u):u=t[2];let d;t[3]===n?d=t[4]:(d=(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:(0,M.jsx)(r,{id:`qdBUHP`,values:{fileName:n}})}),t[3]=n,t[4]=d);let f;t[5]===o?f=t[6]:(f=(0,M.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:o}),t[5]=o,t[6]=f);let p;t[7]===s?p=t[8]:(p=s?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`mt-2`,"data-testid":`viewer-open-file`,onClick:()=>{T({url:s.url,projectRelPath:s.projectRelPath,ext:s.ext,title:s.title,forceOsDelegation:!0})},children:(0,M.jsx)(r,{id:`9npOH9`})}):null,t[7]=s,t[8]=p);let m;return t[9]!==a||t[10]!==n||t[11]!==u||t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,M.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":n,...u,...a,children:[d,f,p]}),t[9]=a,t[10]=n,t[11]=u,t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function F({assetPath:e,fileName:t,extension:n,httpStatus:r}){if(!e||r===404)return;let i=n.toLowerCase();return{projectRelPath:e,ext:i,title:t,url:h(`${v.has(i)?`/api/asset`:`/api/asset-text`}?path=${encodeURIComponent(e)}`)}}var I=w({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),L=w({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function R(e){let t=(0,O.c)(28),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({fileName:r,extension:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o=(0,k.useRef)(null),s=(0,k.useRef)(null),{resolvedTheme:c}=a(),l=j(i),u=l.status===`loaded`?l.content:null,d,f;t[4]!==n||t[5]!==u||t[6]!==c?(d=()=>{if(!o.current||u===null)return;let e=n.toLowerCase(),t=_(e),r=c===`dark`?I:L,i=!1,a=null;return D(e,t).then(e=>{if(i||!o.current)return;let t=[E,...e?[e]:[],C.editable.of(!0),S.readOnly.of(!0),C.lineWrapping,r];a=new C({state:S.create({doc:u,extensions:t}),parent:o.current}),s.current=a}),()=>{i=!0,a?.destroy(),s.current=null}},f=[u,n,c],t[4]=n,t[5]=u,t[6]=c,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,k.useEffect)(d,f);let p;t[9]===n?p=t[10]:(p={"data-text-viewer-extension":n},t[9]=n,t[10]=p);let m=p;if(l.status===`loading`){let e;return t[11]!==m||t[12]!==r?(e=(0,M.jsx)(N,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m}),t[11]=m,t[12]=r,t[13]=e):e=t[13],e}if(l.status===`error`){let e=l.message,a;t[14]!==n||t[15]!==l.httpStatus||t[16]!==r||t[17]!==i.assetPath?(a=F({assetPath:i.assetPath,fileName:r,extension:n,httpStatus:l.httpStatus}),t[14]=n,t[15]=l.httpStatus,t[16]=r,t[17]=i.assetPath,t[18]=a):a=t[18];let o;return t[19]!==m||t[20]!==l.message||t[21]!==r||t[22]!==a?(o=(0,M.jsx)(P,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m,message:e,openFile:a}),t[19]=m,t[20]=l.message,t[21]=r,t[22]=a,t[23]=o):o=t[23],o}let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,M.jsx)(`div`,{ref:o,className:`min-h-0 flex-1 overflow-auto`}),t[24]=h):h=t[24];let g;return t[25]!==n||t[26]!==r?(g=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":n,children:h}),t[25]=n,t[26]=r,t[27]=g):g=t[27],g}function z(e){let t=(0,O.c)(29),{entry:n,className:r}=e,{_:a}=i(),{projectLocalBinding:o,merged:l}=x(),u=l?.appearance?.sidebar,d=u?.showHiddenFiles??!1,p=u?.showOnlyMarkdownFiles??!1,m;t[0]!==n||t[1]!==d||t[2]!==p?(m=b(n,{showHiddenFiles:d,showOnlyMarkdownFiles:p}),t[0]=n,t[1]=d,t[2]=p,t[3]=m):m=t[3];let h=m;if(!h.hiddenFiles&&!h.onlyMarkdownFiles)return null;let _;t[4]!==a||t[5]!==o?(_=e=>{if(o===null)return;let t=o.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[NotInSidebarIndicator] sidebar visibility flip rejected:`,g(t.error)),y.error(a({id:`P47EWZ`}),{description:g(t.error)}))},t[4]=a,t[5]=o,t[6]=_):_=t[6];let v=_,S;t[7]===r?S=t[8]:(S=s(`flex items-center gap-1.5 text-muted-foreground/70 text-xs`,r),t[7]=r,t[8]=S);let C;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,M.jsx)(f,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),t[9]=C):C=t[9];let w;t[10]===a?w=t[11]:(w=a({id:`j9tqwO`}),t[10]=a,t[11]=w);let T;t[12]===w?T=t[13]:(T=(0,M.jsx)(`span`,{className:`whitespace-nowrap`,children:w}),t[12]=w,t[13]=T);let E;t[14]!==a||t[15]!==h.hiddenFiles||t[16]!==v||t[17]!==o?(E=h.hiddenFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>v({showHiddenFiles:!0}),"aria-label":a({id:`XcGbim`}),title:a({id:`XcGbim`}),"data-testid":`not-in-sidebar-flip-hidden-files`,children:a({id:`6KCH4m`})}):null,t[14]=a,t[15]=h.hiddenFiles,t[16]=v,t[17]=o,t[18]=E):E=t[18];let D;t[19]!==a||t[20]!==h.onlyMarkdownFiles||t[21]!==v||t[22]!==o?(D=h.onlyMarkdownFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>v({showOnlyMarkdownFiles:!1}),"aria-label":a({id:`10g8I_`}),title:a({id:`10g8I_`}),"data-testid":`not-in-sidebar-flip-only-markdown`,children:a({id:`5-o4kO`})}):null,t[19]=a,t[20]=h.onlyMarkdownFiles,t[21]=v,t[22]=o,t[23]=D):D=t[23];let k;return t[24]!==D||t[25]!==S||t[26]!==T||t[27]!==E?(k=(0,M.jsxs)(`div`,{"data-testid":`not-in-sidebar-indicator`,className:S,children:[C,T,E,D]}),t[24]=D,t[25]=S,t[26]=T,t[27]=E,t[28]=k):k=t[28],k}var B={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},V=e=>{let t=(0,O.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,M.jsx)(`svg`,{"aria-hidden":`true`,...B,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},H=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Markdown`}),r=(0,M.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},U=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Textbox`}),r=(0,M.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function W(e){let t=(0,O.c)(48),{isSourceMode:n,onModeChange:a,sourceDisabled:o,wysiwygDisabled:s,wysiwygLabel:c,sourceLabel:f,wysiwygDisabledReason:h}=e,g=o===void 0?!1:o,_=s===void 0?!1:s,{_:v}=i(),y;t[0]!==v||t[1]!==c?(y=c??v({id:`ur2XSb`}),t[0]=v,t[1]=c,t[2]=y):y=t[2];let b=y,x;t[3]!==v||t[4]!==f?(x=f??v({id:`xbdtfY`}),t[3]=v,t[4]=f,t[5]=x):x=t[5];let S=x,C=(0,k.useId)(),w=_&&h?h:null,T=n?`source`:`wysiwyg`,E;t[6]===a?E=t[7]:(E=e=>{e&&a(e)},t[6]=a,t[7]=E);let D;t[8]===v?D=t[9]:(D=v({id:`n7aopT`}),t[8]=v,t[9]=D);let A=w?C:void 0,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,M.jsx)(U,{className:`size-4`}),t[10]=j):j=t[10];let N;t[11]!==A||t[12]!==_||t[13]!==b?(N=(0,M.jsx)(p,{value:`wysiwyg`,"aria-label":b,"aria-describedby":A,disabled:_,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:j}),t[11]=A,t[12]=_,t[13]=b,t[14]=N):N=t[14];let P;t[15]!==w||t[16]!==C?(P=w?(0,M.jsx)(`span`,{id:C,className:`sr-only`,children:w}):null,t[15]=w,t[16]=C,t[17]=P):P=t[17];let F;t[18]!==N||t[19]!==P?(F=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsxs)(`div`,{children:[N,P]})}),t[18]=N,t[19]=P,t[20]=F):F=t[20];let I;t[21]!==_||t[22]!==h||t[23]!==c?(I=_&&h?h:c||(0,M.jsx)(r,{id:`Mb_20S`}),t[21]=_,t[22]=h,t[23]=c,t[24]=I):I=t[24];let L;t[25]===I?L=t[26]:(L=(0,M.jsx)(u,{side:`bottom`,children:I}),t[25]=I,t[26]=L);let R;t[27]!==F||t[28]!==L?(R=(0,M.jsxs)(d,{children:[F,L]}),t[27]=F,t[28]=L,t[29]=R):R=t[29];let z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,M.jsx)(H,{className:`size-4`}),t[30]=z):z=t[30];let B;t[31]!==g||t[32]!==S?(B=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsx)(`div`,{children:(0,M.jsx)(p,{value:`source`,"aria-label":S,disabled:g,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:z})})}),t[31]=g,t[32]=S,t[33]=B):B=t[33];let V;t[34]!==g||t[35]!==f?(V=g?(0,M.jsx)(r,{id:`G-JBA1`}):f||(0,M.jsx)(r,{id:`u6Hp4N`}),t[34]=g,t[35]=f,t[36]=V):V=t[36];let W;t[37]===V?W=t[38]:(W=(0,M.jsx)(u,{side:`bottom`,children:V}),t[37]=V,t[38]=W);let G;t[39]!==B||t[40]!==W?(G=(0,M.jsxs)(d,{children:[B,W]}),t[39]=B,t[40]=W,t[41]=G):G=t[41];let K;return t[42]!==R||t[43]!==G||t[44]!==T||t[45]!==E||t[46]!==D?(K=(0,M.jsxs)(m,{type:`single`,value:T,onValueChange:E,"aria-label":D,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 bg-muted p-0.5 data-[size=sm]:rounded-[10px]`,children:[R,G]}),t[42]=R,t[43]=G,t[44]=T,t[45]=E,t[46]=D,t[47]=K):K=t[47],K}export{F as a,j as c,R as i,H as n,P as o,z as r,N as s,W as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./button-RQ5o7P7w.js";import{i as l,n as u,t as d}from"./tooltip-x7BNUa3s.js";import{c as f}from"./select-BUOcREjn.js";import{n as p,t as m}from"./toggle-group-Cnezoq-B.js";import{$r as h,Ya as g,mo as _,yo as v}from"./dist-DIn3VYDc2.js";import{n as y}from"./dist-uN7pEWl0.js";import{t as b}from"./file-tree-utils-DeyBapi2.js";import"./config-provider-CKct7q_G.js";import{n as x}from"./config-context-CdjtvoAz.js";import{Ot as S,X as C}from"./dist-BNDNcytQ.js";import{t as w}from"./cm-theme-BCzjFmR8.js";import{t as T}from"./asset-dispatch-BOfThpQD.js";import{t as E}from"./dist-CZG2zXVq.js";import{t as D}from"./text-viewer-languages-BZtGVaBl.js";var O=o(),k=e(n(),1),A=class extends Error{httpStatus;constructor(e,t){super(e),this.name=`ViewerTextLoadError`,this.httpStatus=t}};function j(e){let t=(0,O.c)(10),{_:n}=i(),r;t[0]===n?r=t[1]:(r=e=>n(e===413?{id:`C_WGy8`}:e===415?{id:`VM7H66`}:e===404?{id:`s0IDhW`}:e===400?{id:`N1mdmS`}:typeof e==`number`?{id:`96w9hU`,values:{status:e}}:{id:`ig5vUe`}),t[0]=n,t[1]=r);let a=r,{src:o,loadText:s}=e,c=(0,k.useRef)(s),l=(0,k.useRef)(a),u;t[2]!==s||t[3]!==a?(u=()=>{c.current=s,l.current=a},t[2]=s,t[3]=a,t[4]=u):u=t[4],(0,k.useEffect)(u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`loading`},t[5]=d):d=t[5];let[f,p]=(0,k.useState)(d),m,h;return t[6]!==n||t[7]!==o?(m=()=>{let e=!1,t=new AbortController;p({status:`loading`});let r=c.current;return r?(r(t.signal).then(t=>{if(!e){if(t.ok){p({status:`loaded`,content:t.text});return}p({status:`error`,message:t.message??l.current(t.status),httpStatus:t.status})}}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()}):(fetch(o??``,{credentials:`same-origin`,signal:t.signal}).then(async e=>{if(!e.ok)throw new A(l.current(e.status),e.status);return e.text()}).then(t=>{e||p({status:`loaded`,content:t})}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||p({status:`error`,message:t instanceof Error?t.message:n({id:`ig5vUe`}),httpStatus:t instanceof A?t.httpStatus:void 0})}),()=>{e=!0,t.abort()})},h=[o,n],t[6]=n,t[7]=o,t[8]=m,t[9]=h):(m=t[8],h=t[9]),(0,k.useEffect)(m,h),f}var M=t();function N(e){let t=(0,O.c)(10),{fileName:n,dataAttr:i,extraAttrs:a}=e,o=`${i}-state`,s;t[0]!==i||t[1]!==o?(s={[i]:``,[o]:`loading`},t[0]=i,t[1]=o,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,M.jsx)(`span`,{children:(0,M.jsx)(r,{id:`Md709y`,values:{fileName:n}})}),t[3]=n,t[4]=c);let l;return t[5]!==a||t[6]!==n||t[7]!==s||t[8]!==c?(l=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":n,...s,...a,children:c}),t[5]=a,t[6]=n,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function P(e){let t=(0,O.c)(16),{fileName:n,dataAttr:i,extraAttrs:a,message:o,openFile:s}=e,l=`${i}-state`,u;t[0]!==i||t[1]!==l?(u={[i]:``,[l]:`error`},t[0]=i,t[1]=l,t[2]=u):u=t[2];let d;t[3]===n?d=t[4]:(d=(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:(0,M.jsx)(r,{id:`qdBUHP`,values:{fileName:n}})}),t[3]=n,t[4]=d);let f;t[5]===o?f=t[6]:(f=(0,M.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:o}),t[5]=o,t[6]=f);let p;t[7]===s?p=t[8]:(p=s?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`mt-2`,"data-testid":`viewer-open-file`,onClick:()=>{T({url:s.url,projectRelPath:s.projectRelPath,ext:s.ext,title:s.title,forceOsDelegation:!0})},children:(0,M.jsx)(r,{id:`9npOH9`})}):null,t[7]=s,t[8]=p);let m;return t[9]!==a||t[10]!==n||t[11]!==u||t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,M.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":n,...u,...a,children:[d,f,p]}),t[9]=a,t[10]=n,t[11]=u,t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function F({assetPath:e,fileName:t,extension:n,httpStatus:r}){if(!e||r===404)return;let i=n.toLowerCase();return{projectRelPath:e,ext:i,title:t,url:h(`${g.has(i)?`/api/asset`:`/api/asset-text`}?path=${encodeURIComponent(e)}`)}}var I=w({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),L=w({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function R(e){let t=(0,O.c)(28),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({fileName:r,extension:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o=(0,k.useRef)(null),s=(0,k.useRef)(null),{resolvedTheme:c}=a(),l=j(i),u=l.status===`loaded`?l.content:null,d,f;t[4]!==n||t[5]!==u||t[6]!==c?(d=()=>{if(!o.current||u===null)return;let e=n.toLowerCase(),t=_(e),r=c===`dark`?I:L,i=!1,a=null;return D(e,t).then(e=>{if(i||!o.current)return;let t=[E,...e?[e]:[],C.editable.of(!0),S.readOnly.of(!0),C.lineWrapping,r];a=new C({state:S.create({doc:u,extensions:t}),parent:o.current}),s.current=a}),()=>{i=!0,a?.destroy(),s.current=null}},f=[u,n,c],t[4]=n,t[5]=u,t[6]=c,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,k.useEffect)(d,f);let p;t[9]===n?p=t[10]:(p={"data-text-viewer-extension":n},t[9]=n,t[10]=p);let m=p;if(l.status===`loading`){let e;return t[11]!==m||t[12]!==r?(e=(0,M.jsx)(N,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m}),t[11]=m,t[12]=r,t[13]=e):e=t[13],e}if(l.status===`error`){let e=l.message,a;t[14]!==n||t[15]!==l.httpStatus||t[16]!==r||t[17]!==i.assetPath?(a=F({assetPath:i.assetPath,fileName:r,extension:n,httpStatus:l.httpStatus}),t[14]=n,t[15]=l.httpStatus,t[16]=r,t[17]=i.assetPath,t[18]=a):a=t[18];let o;return t[19]!==m||t[20]!==l.message||t[21]!==r||t[22]!==a?(o=(0,M.jsx)(P,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:m,message:e,openFile:a}),t[19]=m,t[20]=l.message,t[21]=r,t[22]=a,t[23]=o):o=t[23],o}let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,M.jsx)(`div`,{ref:o,className:`min-h-0 flex-1 overflow-auto`}),t[24]=h):h=t[24];let g;return t[25]!==n||t[26]!==r?(g=(0,M.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":n,children:h}),t[25]=n,t[26]=r,t[27]=g):g=t[27],g}function z(e){let t=(0,O.c)(29),{entry:n,className:r}=e,{_:a}=i(),{projectLocalBinding:o,merged:l}=x(),u=l?.appearance?.sidebar,d=u?.showHiddenFiles??!1,p=u?.showOnlyMarkdownFiles??!1,m;t[0]!==n||t[1]!==d||t[2]!==p?(m=b(n,{showHiddenFiles:d,showOnlyMarkdownFiles:p}),t[0]=n,t[1]=d,t[2]=p,t[3]=m):m=t[3];let h=m;if(!h.hiddenFiles&&!h.onlyMarkdownFiles)return null;let g;t[4]!==a||t[5]!==o?(g=e=>{if(o===null)return;let t=o.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[NotInSidebarIndicator] sidebar visibility flip rejected:`,v(t.error)),y.error(a({id:`P47EWZ`}),{description:v(t.error)}))},t[4]=a,t[5]=o,t[6]=g):g=t[6];let _=g,S;t[7]===r?S=t[8]:(S=s(`flex items-center gap-1.5 text-muted-foreground/70 text-xs`,r),t[7]=r,t[8]=S);let C;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,M.jsx)(f,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),t[9]=C):C=t[9];let w;t[10]===a?w=t[11]:(w=a({id:`j9tqwO`}),t[10]=a,t[11]=w);let T;t[12]===w?T=t[13]:(T=(0,M.jsx)(`span`,{className:`whitespace-nowrap`,children:w}),t[12]=w,t[13]=T);let E;t[14]!==a||t[15]!==h.hiddenFiles||t[16]!==_||t[17]!==o?(E=h.hiddenFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>_({showHiddenFiles:!0}),"aria-label":a({id:`XcGbim`}),title:a({id:`XcGbim`}),"data-testid":`not-in-sidebar-flip-hidden-files`,children:a({id:`6KCH4m`})}):null,t[14]=a,t[15]=h.hiddenFiles,t[16]=_,t[17]=o,t[18]=E):E=t[18];let D;t[19]!==a||t[20]!==h.onlyMarkdownFiles||t[21]!==_||t[22]!==o?(D=h.onlyMarkdownFiles?(0,M.jsx)(c,{variant:`outline`,size:`sm`,className:`h-5 rounded-sm px-1.5 font-normal text-2xs text-muted-foreground hover:text-foreground`,disabled:o===null,onClick:()=>_({showOnlyMarkdownFiles:!1}),"aria-label":a({id:`10g8I_`}),title:a({id:`10g8I_`}),"data-testid":`not-in-sidebar-flip-only-markdown`,children:a({id:`5-o4kO`})}):null,t[19]=a,t[20]=h.onlyMarkdownFiles,t[21]=_,t[22]=o,t[23]=D):D=t[23];let k;return t[24]!==D||t[25]!==S||t[26]!==T||t[27]!==E?(k=(0,M.jsxs)(`div`,{"data-testid":`not-in-sidebar-indicator`,className:S,children:[C,T,E,D]}),t[24]=D,t[25]=S,t[26]=T,t[27]=E,t[28]=k):k=t[28],k}var B={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},V=e=>{let t=(0,O.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,M.jsx)(`svg`,{"aria-hidden":`true`,...B,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},H=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Markdown`}),r=(0,M.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},U=e=>{let t=(0,O.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,M.jsx)(`title`,{children:`Textbox`}),r=(0,M.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,M.jsxs)(V,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function W(e){let t=(0,O.c)(48),{isSourceMode:n,onModeChange:a,sourceDisabled:o,wysiwygDisabled:s,wysiwygLabel:c,sourceLabel:f,wysiwygDisabledReason:h}=e,g=o===void 0?!1:o,_=s===void 0?!1:s,{_:v}=i(),y;t[0]!==v||t[1]!==c?(y=c??v({id:`ur2XSb`}),t[0]=v,t[1]=c,t[2]=y):y=t[2];let b=y,x;t[3]!==v||t[4]!==f?(x=f??v({id:`xbdtfY`}),t[3]=v,t[4]=f,t[5]=x):x=t[5];let S=x,C=(0,k.useId)(),w=_&&h?h:null,T=n?`source`:`wysiwyg`,E;t[6]===a?E=t[7]:(E=e=>{e&&a(e)},t[6]=a,t[7]=E);let D;t[8]===v?D=t[9]:(D=v({id:`n7aopT`}),t[8]=v,t[9]=D);let A=w?C:void 0,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,M.jsx)(U,{className:`size-4`}),t[10]=j):j=t[10];let N;t[11]!==A||t[12]!==_||t[13]!==b?(N=(0,M.jsx)(p,{value:`wysiwyg`,"aria-label":b,"aria-describedby":A,disabled:_,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:j}),t[11]=A,t[12]=_,t[13]=b,t[14]=N):N=t[14];let P;t[15]!==w||t[16]!==C?(P=w?(0,M.jsx)(`span`,{id:C,className:`sr-only`,children:w}):null,t[15]=w,t[16]=C,t[17]=P):P=t[17];let F;t[18]!==N||t[19]!==P?(F=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsxs)(`div`,{children:[N,P]})}),t[18]=N,t[19]=P,t[20]=F):F=t[20];let I;t[21]!==_||t[22]!==h||t[23]!==c?(I=_&&h?h:c||(0,M.jsx)(r,{id:`Mb_20S`}),t[21]=_,t[22]=h,t[23]=c,t[24]=I):I=t[24];let L;t[25]===I?L=t[26]:(L=(0,M.jsx)(u,{side:`bottom`,children:I}),t[25]=I,t[26]=L);let R;t[27]!==F||t[28]!==L?(R=(0,M.jsxs)(d,{children:[F,L]}),t[27]=F,t[28]=L,t[29]=R):R=t[29];let z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,M.jsx)(H,{className:`size-4`}),t[30]=z):z=t[30];let B;t[31]!==g||t[32]!==S?(B=(0,M.jsx)(l,{asChild:!0,children:(0,M.jsx)(`div`,{children:(0,M.jsx)(p,{value:`source`,"aria-label":S,disabled:g,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:z})})}),t[31]=g,t[32]=S,t[33]=B):B=t[33];let V;t[34]!==g||t[35]!==f?(V=g?(0,M.jsx)(r,{id:`G-JBA1`}):f||(0,M.jsx)(r,{id:`u6Hp4N`}),t[34]=g,t[35]=f,t[36]=V):V=t[36];let W;t[37]===V?W=t[38]:(W=(0,M.jsx)(u,{side:`bottom`,children:V}),t[37]=V,t[38]=W);let G;t[39]!==B||t[40]!==W?(G=(0,M.jsxs)(d,{children:[B,W]}),t[39]=B,t[40]=W,t[41]=G):G=t[41];let K;return t[42]!==R||t[43]!==G||t[44]!==T||t[45]!==E||t[46]!==D?(K=(0,M.jsxs)(m,{type:`single`,value:T,onValueChange:E,"aria-label":D,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 bg-muted p-0.5 data-[size=sm]:rounded-[10px]`,children:[R,G]}),t[42]=R,t[43]=G,t[44]=T,t[45]=E,t[46]=D,t[47]=K):K=t[47],K}export{F as a,j as c,R as i,H as n,P as o,z as r,N as s,W as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-RQ5o7P7w.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./dialog-FGMqkFjm.js";import{No as h,_o as g,go as _,mo as v,wo as y}from"./dist-BqtkiFoE2.js";import{t as b}from"./createLucideIcon-DihYAFEK.js";import{t as x}from"./eye-BIA1oECU.js";import{n as S}from"./dist-uN7pEWl0.js";import{d as C}from"./documents-events-D-wbjalg.js";import"./config-provider-DAkovZnw.js";import{n as w}from"./config-context-BzGTI1i6.js";var T=b(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),E=b(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),D=b(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),O=b(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),k=b(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),A=a(),j=e(n(),1);async function M(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function N(){return P().status}function P(){let e=(0,A.c)(8),[t,n]=(0,j.useState)(null),[r,i]=(0,j.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){M().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,j.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>C(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,j.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var F=t();function I(e){let t=(0,A.c)(4),{variant:n}=e;if((n===void 0?`full`:n)===`follow`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,F.jsx)(c,{children:(0,F.jsx)(r,{id:`8sMErm`})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(F.Fragment,{children:[e,(0,F.jsx)(s,{children:(0,F.jsx)(r,{id:`CVRM5N`})})]}),t[1]=n):n=t[1],n}let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(c,{children:(0,F.jsx)(r,{id:`q_9EcE`})}),t[2]=i):i=t[2];let a;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,F.jsxs)(F.Fragment,{children:[i,(0,F.jsx)(s,{children:(0,F.jsx)(r,{id:`n6hXUm`})})]}),t[3]=a):a=t[3],a}function L(e){let t=(0,A.c)(3),{variant:n}=e,i=n===void 0?`full`:n,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,F.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-semibold font-mono uppercase tracking-wider text-primary`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,F.jsx)(r,{id:`6s7LXO`})]}),t[0]=a):a=t[0];let o;return t[1]===i?o=t[2]:(o=(0,F.jsxs)(`div`,{role:`note`,className:`text-sm space-y-5`,children:[a,(0,F.jsx)(`div`,{className:`space-y-5`,children:i===`follow`?(0,F.jsx)(z,{}):(0,F.jsx)(R,{})})]}),t[1]=i,t[2]=o),o}function R(){let e=(0,A.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(B,{icon:(0,F.jsx)(E,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`cdmk8A`}),body:(0,F.jsx)(r,{id:`YaeyFh`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(B,{icon:(0,F.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`9i21pa`}),body:(0,F.jsx)(r,{id:`KIIamL`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsxs)(F.Fragment,{children:[t,n,(0,F.jsx)(B,{icon:(0,F.jsx)(x,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`8cpeU3`}),body:(0,F.jsx)(r,{id:`DELNQk`})})]}),e[2]=i):i=e[2],i}function z(){let e=(0,A.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(B,{icon:(0,F.jsx)(T,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`0xnQ_X`}),body:(0,F.jsx)(r,{id:`aCoQfY`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(B,{icon:(0,F.jsx)(k,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`5rnB76`}),body:(0,F.jsx)(r,{id:`evHlIg`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsxs)(F.Fragment,{children:[t,n,(0,F.jsx)(B,{icon:(0,F.jsx)(O,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`oBK5fD`}),body:(0,F.jsx)(r,{id:`8Wav8y`})})]}),e[2]=i):i=e[2],i}function B(e){let t=(0,A.c)(10),{icon:n,title:r,body:i}=e,a;t[0]===r?a=t[1]:(a=(0,F.jsx)(`p`,{className:`font-medium`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,F.jsxs)(`div`,{className:`space-y-0.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==s?(c=(0,F.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,s]}),t[7]=n,t[8]=s,t[9]=c):c=t[9],c}function V(){let e=(0,A.c)(2),{projectLocalBinding:t}=w();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:g(r.error)}},e[0]=t,e[1]=n),n}function H(){let e=(0,A.c)(2),{projectLocalBinding:t}=w();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function U(){let e=(0,A.c)(2),{projectBinding:t}=w();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function W(e,t){let n=(0,A.c)(12),{_:r}=i(),[a,o]=(0,j.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return S.error(r({id:`fiMNLl`})),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return S.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}function G(e,t,n){let r=(0,A.c)(15),{_:a}=i(),[o,s]=(0,j.useState)(!1),[c,l]=(0,j.useState)(null),u;r[0]!==a||r[1]!==n||r[2]!==e?(u=function(t){if(e===null)return S.error(a({id:`fiMNLl`})),!1;let r=e(t);if(!r.ok){console.error(`[sync] mode change failed:`,r.error);let e=r.error;return S.error(a({id:`nOEDQs`,values:{detail:e}})),!1}return n?.onApplied?.(t),!0},r[0]=a,r[1]=n,r[2]=e,r[3]=u):u=r[3];let d=u,f;r[4]!==d||r[5]!==t?(f=function(e){if(e!==t){if(e===`off`){d(`off`);return}l(e),s(!0)}},r[4]=d,r[5]=t,r[6]=f):f=r[6];let p=f,m;r[7]!==d||r[8]!==c?(m=function(){c!==null&&d(c)&&s(!1)},r[7]=d,r[8]=c,r[9]=m):m=r[9];let h=m,g;return r[10]!==o||r[11]!==h||r[12]!==p||r[13]!==c?(g={confirmOpen:o,setConfirmOpen:s,pendingMode:c,onModeSelect:p,onConfirm:h},r[10]=o,r[11]=h,r[12]=p,r[13]=c,r[14]=g):g=r[14],g}function K(){let e=(0,A.c)(2),{projectLocalBinding:t}=w();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function q(e,t){let n=(0,A.c)(34),{_:r}=i(),a=K(),[o,s]=(0,j.useState)(!1),[c,l]=(0,j.useState)(null),u;n[0]===e?u=n[1]:(u=h(e)??`off`,n[0]=e,n[1]=u);let d=u,f=d===`follow`||d===`full`,p;n[2]===e?p=n[3]:(p=y(e),n[2]=e,n[3]=p);let m=p,g;n[4]===e?g=n[5]:(g=_(e),n[4]=e,n[5]=g);let b=g,x;n[6]===e?x=n[7]:(x=v(e),n[6]=e,n[7]=x);let C=x,w;n[8]!==r||n[9]!==a?(w=function(e){if(a===null)return S.error(r({id:`fiMNLl`})),!1;let t=a(e);if(!t.ok){console.error(`[sync] badge control failed:`,t.error);let e=t.error;return S.error(r({id:`ZVOhXM`,values:{detail:e}})),!1}return!0},n[8]=r,n[9]=a,n[10]=w):w=n[10];let T=w,E;n[11]!==f||n[12]!==T||n[13]!==d||n[14]!==C?(E=function(e){if(e){if(C===`full`){l(`full`),s(!0);return}T({mode:`follow`,enabled:null,resumeMode:null});return}T({mode:`off`,enabled:null,resumeMode:f?d:C})},n[11]=f,n[12]=T,n[13]=d,n[14]=C,n[15]=E):E=n[15];let D=E,O;n[16]!==f||n[17]!==T||n[18]!==C?(O=function(e){if(e!==C){if(!f){T({resumeMode:e});return}l(e),s(!0)}},n[16]=f,n[17]=T,n[18]=C,n[19]=O):O=n[19];let k=O,M;n[20]!==T||n[21]!==c?(M=function(){c!==null&&T({mode:c,enabled:null,resumeMode:null})&&(s(!1),l(null))},n[20]=T,n[21]=c,n[22]=M):M=n[22];let N=M,P=c===`follow`?t:0,F;return n[23]!==f||n[24]!==o||n[25]!==b||n[26]!==N||n[27]!==k||n[28]!==D||n[29]!==m||n[30]!==c||n[31]!==P||n[32]!==C?(F={active:f,paused:m,everEnabled:b,toggleMode:C,confirmOpen:o,setConfirmOpen:s,pendingMode:c,strandedCommitCount:P,onToggleActive:D,onModeSelect:k,onConfirm:N},n[23]=f,n[24]=o,n[25]=b,n[26]=N,n[27]=k,n[28]=D,n[29]=m,n[30]=c,n[31]=P,n[32]=C,n[33]=F):F=n[33],F}async function J(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}function Y(e){let t=(0,A.c)(24),{open:n,onOpenChange:i,onConfirm:a,variant:s,strandedCommitCount:c}=e,h=s===void 0?`full`:s,g=c===void 0?0:c,_=h===`follow`&&g>0,v;t[0]===h?v=t[1]:(v=(0,F.jsx)(p,{children:(0,F.jsx)(I,{variant:h})}),t[0]=h,t[1]=v);let y;t[2]===h?y=t[3]:(y=(0,F.jsx)(L,{variant:h}),t[2]=h,t[3]=y);let b;t[4]!==_||t[5]!==g?(b=_&&(0,F.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:(0,F.jsx)(r,{id:`caw8gO`,values:{strandedCommitCount:g}})}),t[4]=_,t[5]=g,t[6]=b):b=t[6];let x;t[7]!==y||t[8]!==b?(x=(0,F.jsxs)(u,{children:[y,b]}),t[7]=y,t[8]=b,t[9]=x):x=t[9];let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,F.jsx)(f,{asChild:!0,children:(0,F.jsx)(o,{variant:`outline`,children:(0,F.jsx)(r,{id:`dEgA5A`})})}),t[10]=S):S=t[10];let C;t[11]===h?C=t[12]:(C=h===`follow`?(0,F.jsx)(r,{id:`U4nTfu`}):(0,F.jsx)(r,{id:`XU0OXn`}),t[11]=h,t[12]=C);let w;t[13]!==a||t[14]!==C?(w=(0,F.jsxs)(d,{children:[S,(0,F.jsx)(o,{onClick:a,children:C})]}),t[13]=a,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==v||t[17]!==x||t[18]!==w?(T=(0,F.jsxs)(l,{className:`sm:max-w-lg`,children:[v,x,w]}),t[16]=v,t[17]=x,t[18]=w,t[19]=T):T=t[19];let E;return t[20]!==i||t[21]!==n||t[22]!==T?(E=(0,F.jsx)(m,{open:n,onOpenChange:i,children:T}),t[20]=i,t[21]=n,t[22]=T,t[23]=E):E=t[23],E}export{U as a,H as c,N as d,P as f,W as i,I as l,J as n,V as o,T as p,q as r,G as s,Y as t,L as u};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-RQ5o7P7w.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./dialog-FGMqkFjm.js";import{Eo as h,Fo as g,go as _,vo as v,yo as y}from"./dist-DIn3VYDc2.js";import{t as b}from"./createLucideIcon-DihYAFEK.js";import{t as x}from"./eye-BIA1oECU.js";import{n as S}from"./dist-uN7pEWl0.js";import{d as C}from"./documents-events-FrlFXuC-.js";import"./config-provider-CKct7q_G.js";import{n as w}from"./config-context-CdjtvoAz.js";var T=b(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),E=b(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),D=b(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),O=b(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),k=b(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),A=a(),j=e(n(),1);async function M(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function N(){return P().status}function P(){let e=(0,A.c)(8),[t,n]=(0,j.useState)(null),[r,i]=(0,j.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){M().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,j.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>C(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,j.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var F=t();function I(e){let t=(0,A.c)(4),{variant:n}=e;if((n===void 0?`full`:n)===`follow`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,F.jsx)(c,{children:(0,F.jsx)(r,{id:`8sMErm`})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(F.Fragment,{children:[e,(0,F.jsx)(s,{children:(0,F.jsx)(r,{id:`CVRM5N`})})]}),t[1]=n):n=t[1],n}let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(c,{children:(0,F.jsx)(r,{id:`q_9EcE`})}),t[2]=i):i=t[2];let a;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,F.jsxs)(F.Fragment,{children:[i,(0,F.jsx)(s,{children:(0,F.jsx)(r,{id:`n6hXUm`})})]}),t[3]=a):a=t[3],a}function L(e){let t=(0,A.c)(3),{variant:n}=e,i=n===void 0?`full`:n,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,F.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-semibold font-mono uppercase tracking-wider text-primary`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,F.jsx)(r,{id:`6s7LXO`})]}),t[0]=a):a=t[0];let o;return t[1]===i?o=t[2]:(o=(0,F.jsxs)(`div`,{role:`note`,className:`text-sm space-y-5`,children:[a,(0,F.jsx)(`div`,{className:`space-y-5`,children:i===`follow`?(0,F.jsx)(z,{}):(0,F.jsx)(R,{})})]}),t[1]=i,t[2]=o),o}function R(){let e=(0,A.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(B,{icon:(0,F.jsx)(E,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`cdmk8A`}),body:(0,F.jsx)(r,{id:`YaeyFh`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(B,{icon:(0,F.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`9i21pa`}),body:(0,F.jsx)(r,{id:`KIIamL`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsxs)(F.Fragment,{children:[t,n,(0,F.jsx)(B,{icon:(0,F.jsx)(x,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`8cpeU3`}),body:(0,F.jsx)(r,{id:`DELNQk`})})]}),e[2]=i):i=e[2],i}function z(){let e=(0,A.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(B,{icon:(0,F.jsx)(T,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`0xnQ_X`}),body:(0,F.jsx)(r,{id:`aCoQfY`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(B,{icon:(0,F.jsx)(k,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`5rnB76`}),body:(0,F.jsx)(r,{id:`evHlIg`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsxs)(F.Fragment,{children:[t,n,(0,F.jsx)(B,{icon:(0,F.jsx)(O,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,F.jsx)(r,{id:`oBK5fD`}),body:(0,F.jsx)(r,{id:`8Wav8y`})})]}),e[2]=i):i=e[2],i}function B(e){let t=(0,A.c)(10),{icon:n,title:r,body:i}=e,a;t[0]===r?a=t[1]:(a=(0,F.jsx)(`p`,{className:`font-medium`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,F.jsxs)(`div`,{className:`space-y-0.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==s?(c=(0,F.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,s]}),t[7]=n,t[8]=s,t[9]=c):c=t[9],c}function V(){let e=(0,A.c)(2),{projectLocalBinding:t}=w();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:y(r.error)}},e[0]=t,e[1]=n),n}function H(){let e=(0,A.c)(2),{projectLocalBinding:t}=w();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:y(n.error)}},e[0]=t,e[1]=n),n}function U(){let e=(0,A.c)(2),{projectBinding:t}=w();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:y(n.error)}},e[0]=t,e[1]=n),n}function W(e,t){let n=(0,A.c)(12),{_:r}=i(),[a,o]=(0,j.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return S.error(r({id:`fiMNLl`})),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return S.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}function G(e,t,n){let r=(0,A.c)(15),{_:a}=i(),[o,s]=(0,j.useState)(!1),[c,l]=(0,j.useState)(null),u;r[0]!==a||r[1]!==n||r[2]!==e?(u=function(t){if(e===null)return S.error(a({id:`fiMNLl`})),!1;let r=e(t);if(!r.ok){console.error(`[sync] mode change failed:`,r.error);let e=r.error;return S.error(a({id:`nOEDQs`,values:{detail:e}})),!1}return n?.onApplied?.(t),!0},r[0]=a,r[1]=n,r[2]=e,r[3]=u):u=r[3];let d=u,f;r[4]!==d||r[5]!==t?(f=function(e){if(e!==t){if(e===`off`){d(`off`);return}l(e),s(!0)}},r[4]=d,r[5]=t,r[6]=f):f=r[6];let p=f,m;r[7]!==d||r[8]!==c?(m=function(){c!==null&&d(c)&&s(!1)},r[7]=d,r[8]=c,r[9]=m):m=r[9];let h=m,g;return r[10]!==o||r[11]!==h||r[12]!==p||r[13]!==c?(g={confirmOpen:o,setConfirmOpen:s,pendingMode:c,onModeSelect:p,onConfirm:h},r[10]=o,r[11]=h,r[12]=p,r[13]=c,r[14]=g):g=r[14],g}function K(){let e=(0,A.c)(2),{projectLocalBinding:t}=w();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:y(n.error)}},e[0]=t,e[1]=n),n}function q(e,t){let n=(0,A.c)(34),{_:r}=i(),a=K(),[o,s]=(0,j.useState)(!1),[c,l]=(0,j.useState)(null),u;n[0]===e?u=n[1]:(u=g(e)??`off`,n[0]=e,n[1]=u);let d=u,f=d===`follow`||d===`full`,p;n[2]===e?p=n[3]:(p=h(e),n[2]=e,n[3]=p);let m=p,y;n[4]===e?y=n[5]:(y=v(e),n[4]=e,n[5]=y);let b=y,x;n[6]===e?x=n[7]:(x=_(e),n[6]=e,n[7]=x);let C=x,w;n[8]!==r||n[9]!==a?(w=function(e){if(a===null)return S.error(r({id:`fiMNLl`})),!1;let t=a(e);if(!t.ok){console.error(`[sync] badge control failed:`,t.error);let e=t.error;return S.error(r({id:`ZVOhXM`,values:{detail:e}})),!1}return!0},n[8]=r,n[9]=a,n[10]=w):w=n[10];let T=w,E;n[11]!==f||n[12]!==T||n[13]!==d||n[14]!==C?(E=function(e){if(e){if(C===`full`){l(`full`),s(!0);return}T({mode:`follow`,enabled:null,resumeMode:null});return}T({mode:`off`,enabled:null,resumeMode:f?d:C})},n[11]=f,n[12]=T,n[13]=d,n[14]=C,n[15]=E):E=n[15];let D=E,O;n[16]!==f||n[17]!==T||n[18]!==C?(O=function(e){if(e!==C){if(!f){T({resumeMode:e});return}l(e),s(!0)}},n[16]=f,n[17]=T,n[18]=C,n[19]=O):O=n[19];let k=O,M;n[20]!==T||n[21]!==c?(M=function(){c!==null&&T({mode:c,enabled:null,resumeMode:null})&&(s(!1),l(null))},n[20]=T,n[21]=c,n[22]=M):M=n[22];let N=M,P=c===`follow`?t:0,F;return n[23]!==f||n[24]!==o||n[25]!==b||n[26]!==N||n[27]!==k||n[28]!==D||n[29]!==m||n[30]!==c||n[31]!==P||n[32]!==C?(F={active:f,paused:m,everEnabled:b,toggleMode:C,confirmOpen:o,setConfirmOpen:s,pendingMode:c,strandedCommitCount:P,onToggleActive:D,onModeSelect:k,onConfirm:N},n[23]=f,n[24]=o,n[25]=b,n[26]=N,n[27]=k,n[28]=D,n[29]=m,n[30]=c,n[31]=P,n[32]=C,n[33]=F):F=n[33],F}async function J(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}function Y(e){let t=(0,A.c)(24),{open:n,onOpenChange:i,onConfirm:a,variant:s,strandedCommitCount:c}=e,h=s===void 0?`full`:s,g=c===void 0?0:c,_=h===`follow`&&g>0,v;t[0]===h?v=t[1]:(v=(0,F.jsx)(p,{children:(0,F.jsx)(I,{variant:h})}),t[0]=h,t[1]=v);let y;t[2]===h?y=t[3]:(y=(0,F.jsx)(L,{variant:h}),t[2]=h,t[3]=y);let b;t[4]!==_||t[5]!==g?(b=_&&(0,F.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:(0,F.jsx)(r,{id:`caw8gO`,values:{strandedCommitCount:g}})}),t[4]=_,t[5]=g,t[6]=b):b=t[6];let x;t[7]!==y||t[8]!==b?(x=(0,F.jsxs)(u,{children:[y,b]}),t[7]=y,t[8]=b,t[9]=x):x=t[9];let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,F.jsx)(f,{asChild:!0,children:(0,F.jsx)(o,{variant:`outline`,children:(0,F.jsx)(r,{id:`dEgA5A`})})}),t[10]=S):S=t[10];let C;t[11]===h?C=t[12]:(C=h===`follow`?(0,F.jsx)(r,{id:`U4nTfu`}):(0,F.jsx)(r,{id:`XU0OXn`}),t[11]=h,t[12]=C);let w;t[13]!==a||t[14]!==C?(w=(0,F.jsxs)(d,{children:[S,(0,F.jsx)(o,{onClick:a,children:C})]}),t[13]=a,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==v||t[17]!==x||t[18]!==w?(T=(0,F.jsxs)(l,{className:`sm:max-w-lg`,children:[v,x,w]}),t[16]=v,t[17]=x,t[18]=w,t[19]=T):T=t[19];let E;return t[20]!==i||t[21]!==n||t[22]!==T?(E=(0,F.jsx)(m,{open:n,onOpenChange:i,children:T}),t[20]=i,t[21]=n,t[22]=T,t[23]=E):E=t[23],E}export{U as a,H as c,N as d,P as f,W as i,I as l,J as n,V as o,T as p,q as r,G as s,Y as t,L as u};
@@ -0,0 +1 @@
1
+ import{t as e}from"./index-Bnezs-Zg.js";export{e as FeedbackForm};