@inkeep/open-knowledge 0.47.0-beta.21 → 0.47.0-beta.23

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 (134) hide show
  1. package/dist/{acp-harness-probe-DXYqzFYA.mjs → acp-harness-probe-YqRQ76NC.mjs} +2 -2
  2. package/dist/cli.mjs +7 -7
  3. package/dist/constants-CKAiJSzo.mjs +2 -0
  4. package/dist/{git-handle-D0JshIxh.mjs → git-handle-DDjBzdsL.mjs} +2 -2
  5. package/dist/git-handle-DtHx3JAy.mjs +1 -0
  6. package/dist/index.mjs +1 -1
  7. package/dist/{init-BqXcwHZr.mjs → init-3DxCRcv-.mjs} +3 -3
  8. package/dist/init-Cp4mynB_.mjs +1 -0
  9. package/dist/{launch-json-removal--78GOuKl.mjs → launch-json-removal-DO9mBEMa.mjs} +2 -2
  10. package/dist/{loader-BEBLs0tu.mjs → loader-CqMLB27X.mjs} +2 -2
  11. package/dist/loader-Cw-kPsC-.mjs +1 -0
  12. package/dist/md-manager-BURSRub5.mjs +2 -0
  13. package/dist/{open-browser-TU_nA_Sm.mjs → open-browser-71rCCeYe.mjs} +2 -2
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/{preview-iFFl27Qj.mjs → preview-CIiqIWzm.mjs} +2 -2
  16. package/dist/preview-sXpBdWrB.mjs +1 -0
  17. package/dist/public/assets/{ActivityModeContent-D3YT_cL3.js → ActivityModeContent-eMJa8Av4.js} +1 -1
  18. package/dist/public/assets/{AgentDiffPane-BCIrjLxd.js → AgentDiffPane-r4ZADFR_.js} +1 -1
  19. package/dist/public/assets/{AgentThreadClientBinder-BdHHup4k.js → AgentThreadClientBinder-qe1MEACR.js} +1 -1
  20. package/dist/public/assets/{ChangedOutsideBadge--Hze6vD1.js → ChangedOutsideBadge-BhytPKwo.js} +1 -1
  21. package/dist/public/assets/{CodeMirrorPropInput-BfYJOB1U.js → CodeMirrorPropInput-DfuEjOgx.js} +1 -1
  22. package/dist/public/assets/DocumentContext-B-GZJDKB.js +38 -0
  23. package/dist/public/assets/{EditorModeToggle-DLnTYb-h.js → EditorModeToggle-AMKA13Js.js} +1 -1
  24. package/dist/public/assets/{EnableSyncConfirmDialog-wfbNMORg.js → EnableSyncConfirmDialog-DaRwi97i.js} +1 -1
  25. package/dist/public/assets/FeedbackForm-CEI7D-Bc.js +1 -0
  26. package/dist/public/assets/{GraphPanel-DcFOscrG.js → GraphPanel-DNd_Soou.js} +1 -1
  27. package/dist/public/assets/{ImportSkillDialog-C21eWM_C.js → ImportSkillDialog-r6XGcGP8.js} +1 -1
  28. package/dist/public/assets/{LintConfigEditor-yHM3zNKy.js → LintConfigEditor-DP0mvlD-.js} +1 -1
  29. package/dist/public/assets/ManagedArtifactProperties-C35Phj1Z.js +2 -0
  30. package/dist/public/assets/ManagedArtifactProperties-CHUp4ecd.js +1 -0
  31. package/dist/public/assets/{McpConsentDialogBody-DMOmHuL7.js → McpConsentDialogBody-DNje2HrA.js} +1 -1
  32. package/dist/public/assets/{MermaidDocEditor-Brsvw0SI.js → MermaidDocEditor-V8wUIrH9.js} +1 -1
  33. package/dist/public/assets/{ReportBugDialogBody-et6slT5A.js → ReportBugDialogBody-RgJU4owp.js} +1 -1
  34. package/dist/public/assets/{SchemaConfigEditor-CDfilRoj.js → SchemaConfigEditor-DMB202DW.js} +1 -1
  35. package/dist/public/assets/SessionsHost-BaMZq0qm.js +2 -0
  36. package/dist/public/assets/{SettingsDialogBody-DCVQf8Sd.js → SettingsDialogBody-C6D_dIPg.js} +3 -3
  37. package/dist/public/assets/{ShareBranchSwitchDialog-Cq3P5fIG.js → ShareBranchSwitchDialog-CaHo1QOg.js} +1 -1
  38. package/dist/public/assets/{ShareReceiveDialog-BZMp2nd8.js → ShareReceiveDialog-DtypcM-G.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveMissDialog-CtBVQ8M0.js → ShareReceiveMissDialog-BEVKAVyo.js} +1 -1
  40. package/dist/public/assets/{SkillEditBanner-vKY168Q9.js → SkillEditBanner-CdIPoRZZ.js} +1 -1
  41. package/dist/public/assets/{SkillOriginInline-DgP96Q7o.js → SkillOriginInline-Dv7Qj-yN.js} +1 -1
  42. package/dist/public/assets/SkillToolbarControls-CqRru1Un.js +1 -0
  43. package/dist/public/assets/SourceEditor-pvbfMbXX.js +1 -0
  44. package/dist/public/assets/{TerminalPanel-D_zDvWvD.js → TerminalPanel-7KKsR7RM.js} +1 -1
  45. package/dist/public/assets/{TerminalWindowApp-DyVBq2Ss.js → TerminalWindowApp-BHpRan9i.js} +1 -1
  46. package/dist/public/assets/{TextDocEditor-BL_-QkB7.js → TextDocEditor-DIySejtJ.js} +1 -1
  47. package/dist/public/assets/ThreadView-BYloKbR4.js +6 -0
  48. package/dist/public/assets/{TimelineDiffPane-Dqrp96vQ.js → TimelineDiffPane-CElwxbvF.js} +1 -1
  49. package/dist/public/assets/{agent-diff-store-x2lZWEbT.js → agent-diff-store-Cf_Scq3g.js} +1 -1
  50. package/dist/public/assets/{agent-visibility-DooA6q6Y.js → agent-visibility-ZpjqX-Ne.js} +1 -1
  51. package/dist/public/assets/{auth-state-cache-UtyGZJkf.js → auth-state-cache-CaC4Oksn.js} +2 -2
  52. package/dist/public/assets/{client-version-BeO7mg7I.js → client-version-BeqRGVBh.js} +1 -1
  53. package/dist/public/assets/comment-chips-D23V_sWM.js +7 -0
  54. package/dist/public/assets/{config-context-DO4l6dU6.js → config-context-B7cObhlW.js} +1 -1
  55. package/dist/public/assets/{config-provider-BmNEf-_4.js → config-provider-CNXTSTPo.js} +1 -1
  56. package/dist/public/assets/{dist-CLzUuFWF2.js → dist-8iqUcAwa2.js} +185 -184
  57. package/dist/public/assets/{doc-paths-D7j_eEce.js → doc-paths-Brm31tog.js} +1 -1
  58. package/dist/public/assets/{documents-events-BXEDUEK0.js → documents-events-DG_D787e.js} +1 -1
  59. package/dist/public/assets/{file-tree-adapter-CjX34jcF.js → file-tree-adapter-BPB3Amf5.js} +1 -1
  60. package/dist/public/assets/{file-tree-utils-Ce34hqQC.js → file-tree-utils-D-gnyeyb.js} +1 -1
  61. package/dist/public/assets/{folder-config-api-B4ZIaRYS.js → folder-config-api-DIR7rDTa.js} +1 -1
  62. package/dist/public/assets/{follow-file-B0woPClO.js → follow-file-DcOTm2RV.js} +1 -1
  63. package/dist/public/assets/{globals-C8FNtceU.js → globals-DeqcMGTI.js} +1 -1
  64. package/dist/public/assets/index-B3IJzpjG.js +2092 -0
  65. package/dist/public/assets/{lint-config-client-5M2PwjWj.js → lint-config-client-DsXWTTJY.js} +1 -1
  66. package/dist/public/assets/local-menu-action-bus-C838bfRF.js +1 -0
  67. package/dist/public/assets/{markdownlint-rule-browser-Bh_v81ob.js → markdownlint-rule-browser-cGTqvDGI.js} +1 -1
  68. package/dist/public/assets/{navigation-targets-CBDcAPCE.js → navigation-targets-CgKIg62o.js} +1 -1
  69. package/dist/public/assets/{open-managed-artifact-tab-CD2IVH49.js → open-managed-artifact-tab-DvBGQQ5v.js} +1 -1
  70. package/dist/public/assets/{pending-receive-nav-store-Biw1Epvx.js → pending-receive-nav-store-BbcYKqrN.js} +1 -1
  71. package/dist/public/assets/{prop-types-CzBvMPTy.js → prop-types-BlpcaMv6.js} +1 -1
  72. package/dist/public/assets/{receive-store-8-NLCTcl.js → receive-store-CrJ66EaF.js} +1 -1
  73. package/dist/public/assets/selection-context-DTwo8ecm.js +4 -0
  74. package/dist/public/assets/skill-actions-Dzann-5H.js +2 -0
  75. package/dist/public/assets/{skill-scope-DQD8O86J.js → skill-scope-Q1zIQcaf.js} +1 -1
  76. package/dist/public/assets/{skills-api-CmrsjdWe.js → skills-api-DMJMDCm9.js} +1 -1
  77. package/dist/public/assets/{sortable.esm-DR5PU-kX.js → sortable.esm-lATz1Hrd.js} +1 -1
  78. package/dist/public/assets/{src-DFNABQhY.js → src-BfQvygCL.js} +1 -1
  79. package/dist/public/assets/{tag-pill-input-MTbs9SQK.js → tag-pill-input-BJhyzUl0.js} +1 -1
  80. package/dist/public/assets/{target-navigation-intent-O-KNJVho.js → target-navigation-intent-CXoUJsrm.js} +1 -1
  81. package/dist/public/assets/terminal-launch-events-D_QtqRUl.js +1 -0
  82. package/dist/public/assets/{terminal-telemetry-B4AWY5_A.js → terminal-telemetry-6LxP9TAC.js} +1 -1
  83. package/dist/public/assets/{typing-burst-detector-BC_MP6fa.js → typing-burst-detector-BXQ21SLH.js} +3 -3
  84. package/dist/public/assets/{uninstall-D1vd3-cj.js → uninstall-C5NMESG5.js} +1 -1
  85. package/dist/public/assets/{use-activity-panel-D8J3vm0W.js → use-activity-panel-BMIeYlRC.js} +1 -1
  86. package/dist/public/assets/{use-collab-url-ryL1J_Cn.js → use-collab-url-DFxPwofD.js} +1 -1
  87. package/dist/public/assets/{use-live-xterm-theme-Bit3P-w4.js → use-live-xterm-theme-B_-LdG2B.js} +1 -1
  88. package/dist/public/assets/{use-open-skill-CItHgrjr.js → use-open-skill-DY7TTfKE.js} +1 -1
  89. package/dist/public/assets/{use-settings-route-DzedD2vL.js → use-settings-route-CU2Rp9Kx.js} +1 -1
  90. package/dist/public/assets/{use-skill-directory-zc2nSEYt.js → use-skill-directory-Cy50CLq2.js} +1 -1
  91. package/dist/public/assets/{use-skill-origin-C_LYVSfo.js → use-skill-origin-CcipDhTq.js} +1 -1
  92. package/dist/public/assets/{use-skills-DrxE5iKU.js → use-skills-07203H6O.js} +1 -1
  93. package/dist/public/assets/{use-terminal-enabled-CXM-nkD1.js → use-terminal-enabled-BBEYB_Kw.js} +1 -1
  94. package/dist/public/assets/{use-timeline-entry-diff-BvT74ai9.js → use-timeline-entry-diff-DynYCyDT.js} +1 -1
  95. package/dist/public/assets/{use-workspace-Di9mo5VO.js → use-workspace-Dwf_RQAR.js} +1 -1
  96. package/dist/public/index.html +46 -46
  97. package/dist/public/uninstall.html +3 -3
  98. package/dist/{repair-launch-json-DXxrE4q1.mjs → repair-launch-json-B7lTEm8g.mjs} +2 -2
  99. package/dist/{repair-mcp-configs-CJYHrV-m.mjs → repair-mcp-configs-D40IMSsi.mjs} +2 -2
  100. package/dist/repair-skills-B9fwDZT5.mjs +1 -0
  101. package/dist/{repair-skills-DueNXSu9.mjs → repair-skills-CZ-a80SS.mjs} +2 -2
  102. package/dist/{server-lock-3ByzWRdV.mjs → server-lock-Cg66XiR-.mjs} +2 -2
  103. package/dist/server-lock-DyY9o-h3.mjs +1 -0
  104. package/dist/{src-czIvvgm0.mjs → src-Bnk118Ag.mjs} +126 -125
  105. package/dist/{src-CoiPAaPO.mjs → src-C5BS3yyY.mjs} +2 -2
  106. package/dist/{src-C_7vTM-s.mjs → src-DksXweG3.mjs} +4 -4
  107. package/dist/{src-xynSvLbg.mjs → src-Jkr5of5-.mjs} +1 -1
  108. package/dist/{start-BSKY8GSZ.mjs → start-BjAsPFDu.mjs} +3 -3
  109. package/dist/start-lwe_MarI.mjs +1 -0
  110. package/dist/{write-project-skill-DpGXCFNK.mjs → write-project-skill-B1qOkawu.mjs} +2 -2
  111. package/package.json +4 -4
  112. package/dist/constants-DlluQJ9P.mjs +0 -2
  113. package/dist/git-handle-C8yML4WA.mjs +0 -1
  114. package/dist/init-BH_UUTAa.mjs +0 -1
  115. package/dist/loader-JMKw2q8P.mjs +0 -1
  116. package/dist/md-manager-2FlXlcPD.mjs +0 -2
  117. package/dist/preview-B4LkEOYR.mjs +0 -1
  118. package/dist/public/assets/DocumentContext-BpUSHG7l.js +0 -38
  119. package/dist/public/assets/FeedbackForm-DBEWSa2N.js +0 -1
  120. package/dist/public/assets/ManagedArtifactProperties-BKmB2Biq.js +0 -2
  121. package/dist/public/assets/ManagedArtifactProperties-Bz4VLtAN.js +0 -1
  122. package/dist/public/assets/SessionsHost-BGzKrV22.js +0 -2
  123. package/dist/public/assets/SkillToolbarControls-_SvouuNK.js +0 -1
  124. package/dist/public/assets/SourceEditor-CEU2fHXS.js +0 -1
  125. package/dist/public/assets/ThreadView-ChbqsfCR.js +0 -6
  126. package/dist/public/assets/comment-chips-CnL7Mdk6.js +0 -7
  127. package/dist/public/assets/index-gkgpssO7.js +0 -2092
  128. package/dist/public/assets/selection-context-e4f29ln_.js +0 -4
  129. package/dist/public/assets/skill-actions-BRtvvjCU.js +0 -2
  130. package/dist/public/assets/terminal-input-events-BGPQuYMh.js +0 -1
  131. package/dist/public/assets/terminal-launch-events-BBXOhZSh.js +0 -1
  132. package/dist/repair-skills-rWKf_ECf.mjs +0 -1
  133. package/dist/server-lock-BqPFXabR.mjs +0 -1
  134. package/dist/start-B_TU8YFy.mjs +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{Q as r,R as i,Z as a}from"./dist-CLzUuFWF2.js";var o=n(),s=e(t(),1),c=`open-knowledge:lint-config-changed`;function l(){window.dispatchEvent(new CustomEvent(c))}function u(e){let t=()=>e();return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}async function d(e){try{let t=e===void 0?``:`?doc=${encodeURIComponent(e)}`,n=await fetch(`/api/lint/config${t}`);if(!n.ok)return null;let r=await n.json().catch(()=>null),i=a.safeParse(r);return i.success?i.data:(console.warn(`[lint] lint-config response failed schema validation`,i.error.issues),null)}catch{return null}}async function f(e){return(await d(e))?.effective??null}var p=3e4;async function m(e){let t=new AbortController,n=setTimeout(()=>t.abort(),p);try{let n=await fetch(`/api/lint/fix`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({docName:e}),signal:t.signal});if(!n.ok){let e=await n.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null,status:n.status,problemType:typeof e?.type==`string`?e.type:null}}let i=await n.json().catch(()=>null),a=r.safeParse(i);return a.success?{ok:!0,result:a.data}:(console.warn(`[lint] fix response failed schema validation`,a.error.issues),{ok:!1,errorDetail:null,status:n.status,problemType:null})}catch(t){return console.warn(`[lint] fix request failed`,e,t instanceof Error?t.message:t),{ok:!1,errorDetail:null,status:null,problemType:null}}finally{clearTimeout(n)}}async function h(e,t){try{let n=await fetch(`/api/lint/markdownlint-config`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ruleId:e,value:t})});if(!n.ok){let e=await n.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let r=await n.json().catch(()=>null),i=a.safeParse(r);return i.success?{ok:!0,response:i.data}:{ok:!1,errorDetail:null}}catch{return{ok:!1,errorDetail:null}}}async function g(e){try{let t=await fetch(`/api/lint/frontmatter-schema`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let n=a.safeParse(await t.json().catch(()=>null));return n.success?{ok:!0,response:n.data}:{ok:!1,errorDetail:null}}catch{return{ok:!1,errorDetail:null}}}function _(e){return e.length>0?e:void 0}async function v(e,t,n,r=[]){return g({file:e,field:t,constraint:n,parentPath:_(r)})}async function y(){try{let e=await fetch(`/api/lint/frontmatter-schemas`);if(!e.ok)return[];let t=await e.json().catch(()=>null),n=i.safeParse(t);return n.success?n.data.schemas:(console.warn(`[lint] frontmatter-schemas response failed schema validation`,n.error.issues),[])}catch{return[]}}async function b(e){let t=await g({file:e});return t.ok&&l(),t}async function x(e,t,n=[]){return g({file:e,field:t,removeField:!0,parentPath:_(n)})}async function S(e,t,n,r=[]){return g({file:e,field:t,renameTo:n,parentPath:_(r)})}async function C(e){let t=await g({file:e,delete:!0});return t.ok&&l(),t}function w(){let e=(0,o.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,s.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{y().then(r)},e[1]=i):i=e[1];let a=i,c,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1,t=()=>{y().then(t=>{e||r(t)})};t();let n=u(t);return()=>{e=!0,n()}},l=[],e[2]=c,e[3]=l):(c=e[2],l=e[3]),(0,s.useEffect)(c,l);let d;return e[4]===n?d=e[5]:(d={schemas:n,refresh:a},e[4]=n,e[5]=d),d}function T(e){let t=(0,o.c)(5),[n,r]=(0,s.useState)(null),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(null);return}let t=!1,n=()=>{d(e).then(e=>{t||r(e)})};n();let i=u(n);return()=>{t=!0,i()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,s.useEffect)(i,a);let c;return t[3]===n?c=t[4]:(c={data:n},t[3]=n,t[4]=c),c}function E(){let e=(0,o.c)(4),[t,n]=(0,s.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!1,t=()=>{d().then(t=>{e||n(t)})};t();let r=u(t);return()=>{e=!0,r()}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,s.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={data:t},e[2]=t,e[3]=a),a}export{m as a,u as c,E as d,v as f,f as i,T as l,C as n,x as o,h as p,l as r,S as s,b as t,w as u};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{Q as r,R as i,Z as a}from"./dist-8iqUcAwa2.js";var o=n(),s=e(t(),1),c=`open-knowledge:lint-config-changed`;function l(){window.dispatchEvent(new CustomEvent(c))}function u(e){let t=()=>e();return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}async function d(e){try{let t=e===void 0?``:`?doc=${encodeURIComponent(e)}`,n=await fetch(`/api/lint/config${t}`);if(!n.ok)return null;let r=await n.json().catch(()=>null),i=a.safeParse(r);return i.success?i.data:(console.warn(`[lint] lint-config response failed schema validation`,i.error.issues),null)}catch{return null}}async function f(e){return(await d(e))?.effective??null}var p=3e4;async function m(e){let t=new AbortController,n=setTimeout(()=>t.abort(),p);try{let n=await fetch(`/api/lint/fix`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({docName:e}),signal:t.signal});if(!n.ok){let e=await n.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null,status:n.status,problemType:typeof e?.type==`string`?e.type:null}}let i=await n.json().catch(()=>null),a=r.safeParse(i);return a.success?{ok:!0,result:a.data}:(console.warn(`[lint] fix response failed schema validation`,a.error.issues),{ok:!1,errorDetail:null,status:n.status,problemType:null})}catch(t){return console.warn(`[lint] fix request failed`,e,t instanceof Error?t.message:t),{ok:!1,errorDetail:null,status:null,problemType:null}}finally{clearTimeout(n)}}async function h(e,t){try{let n=await fetch(`/api/lint/markdownlint-config`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ruleId:e,value:t})});if(!n.ok){let e=await n.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let r=await n.json().catch(()=>null),i=a.safeParse(r);return i.success?{ok:!0,response:i.data}:{ok:!1,errorDetail:null}}catch{return{ok:!1,errorDetail:null}}}async function g(e){try{let t=await fetch(`/api/lint/frontmatter-schema`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let n=a.safeParse(await t.json().catch(()=>null));return n.success?{ok:!0,response:n.data}:{ok:!1,errorDetail:null}}catch{return{ok:!1,errorDetail:null}}}function _(e){return e.length>0?e:void 0}async function v(e,t,n,r=[]){return g({file:e,field:t,constraint:n,parentPath:_(r)})}async function y(){try{let e=await fetch(`/api/lint/frontmatter-schemas`);if(!e.ok)return[];let t=await e.json().catch(()=>null),n=i.safeParse(t);return n.success?n.data.schemas:(console.warn(`[lint] frontmatter-schemas response failed schema validation`,n.error.issues),[])}catch{return[]}}async function b(e){let t=await g({file:e});return t.ok&&l(),t}async function x(e,t,n=[]){return g({file:e,field:t,removeField:!0,parentPath:_(n)})}async function S(e,t,n,r=[]){return g({file:e,field:t,renameTo:n,parentPath:_(r)})}async function C(e){let t=await g({file:e,delete:!0});return t.ok&&l(),t}function w(){let e=(0,o.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,s.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{y().then(r)},e[1]=i):i=e[1];let a=i,c,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1,t=()=>{y().then(t=>{e||r(t)})};t();let n=u(t);return()=>{e=!0,n()}},l=[],e[2]=c,e[3]=l):(c=e[2],l=e[3]),(0,s.useEffect)(c,l);let d;return e[4]===n?d=e[5]:(d={schemas:n,refresh:a},e[4]=n,e[5]=d),d}function T(e){let t=(0,o.c)(5),[n,r]=(0,s.useState)(null),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(null);return}let t=!1,n=()=>{d(e).then(e=>{t||r(e)})};n();let i=u(n);return()=>{t=!0,i()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,s.useEffect)(i,a);let c;return t[3]===n?c=t[4]:(c={data:n},t[3]=n,t[4]=c),c}function E(){let e=(0,o.c)(4),[t,n]=(0,s.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!1,t=()=>{d().then(t=>{e||n(t)})};t();let r=u(t);return()=>{e=!0,r()}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,s.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={data:t},e[2]=t,e[3]=a),a}export{m as a,u as c,E as d,v as f,f as i,T as l,C as n,x as o,h as p,l as r,S as s,b as t,w as u};
@@ -0,0 +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{t as r}from"./compiler-runtime-BfE3aGVn.js";import{t as i}from"./utils-CPqDy6Hr.js";import{a,n as o}from"./dist-DUWYPul7.js";import{c as s,i as c,l,n as u,o as d,r as f}from"./dist-Bi80hc1t.js";import{n as p,t as m}from"./dist-DY-494HN.js";import{i as ee,n as h,r as te,t as g}from"./es2015-B2hWAwcf.js";import{a as _,i as ne,n as re,r as v,t as y}from"./dist-DpaqLIPT.js";import{t as b}from"./createLucideIcon-DihYAFEK.js";var x=e(n(),1),S=(0,x.createContext)(null),C={didCatch:!1,error:null},ie=class extends x.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=C}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(C))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&w(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(C))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,x.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,x.createElement)(S.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function w(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}var T=t(),E=`Popover`,[D,ae]=s(E,[_]),O=_(),[k,A]=D(E),j=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=O(t),l=x.useRef(null),[d,f]=x.useState(!1),[p,m]=c({prop:r,defaultProp:i??!1,onChange:a,caller:E});return(0,T.jsx)(ne,{...s,children:(0,T.jsx)(k,{scope:t,contentId:u(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>f(!0),[]),onCustomAnchorRemove:x.useCallback(()=>f(!1),[]),modal:o,children:n})})};j.displayName=E;var M=`PopoverAnchor`,N=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=A(M,n),a=O(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return x.useEffect(()=>(o(),()=>s()),[o,s]),(0,T.jsx)(y,{...a,...r,ref:t})});N.displayName=M;var P=`PopoverTrigger`,F=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=A(P,n),o=O(n),s=a(t,i.triggerRef),c=(0,T.jsx)(l.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Y(i.open),...r,ref:s,onClick:d(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:(0,T.jsx)(y,{asChild:!0,...o,children:c})});F.displayName=P;var I=`PopoverPortal`,[L,R]=D(I,{forceMount:void 0}),z=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=A(I,t);return(0,T.jsx)(L,{scope:t,forceMount:n,children:(0,T.jsx)(f,{present:n||a.open,children:(0,T.jsx)(m,{asChild:!0,container:i,children:r})})})};z.displayName=I;var B=`PopoverContent`,V=x.forwardRef((e,t)=>{let n=R(B,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=A(B,e.__scopePopover);return(0,T.jsx)(f,{present:r||a.open,children:a.modal?(0,T.jsx)(U,{...i,ref:t}):(0,T.jsx)(W,{...i,ref:t})})});V.displayName=B;var H=o(`PopoverContent.RemoveScroll`),U=x.forwardRef((e,t)=>{let n=A(B,e.__scopePopover),r=x.useRef(null),i=a(t,r),o=x.useRef(!1);return x.useEffect(()=>{let e=r.current;if(e)return g(e)},[]),(0,T.jsx)(h,{as:H,allowPinchZoom:!0,children:(0,T.jsx)(G,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:d(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:d(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;o.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:d(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),W=x.forwardRef((e,t)=>{let n=A(B,e.__scopePopover),r=x.useRef(!1),i=x.useRef(!1);return(0,T.jsx)(G,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),G=x.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=A(B,n),m=O(n);return te(),(0,T.jsx)(ee,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,T.jsx)(p,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,T.jsx)(v,{"data-state":Y(f.open),role:`dialog`,id:f.contentId,...m,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),K=`PopoverClose`,q=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=A(K,n);return(0,T.jsx)(l.button,{type:`button`,...r,ref:t,onClick:d(e.onClick,()=>i.onOpenChange(!1))})});q.displayName=K;var J=`PopoverArrow`,oe=x.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(n);return(0,T.jsx)(re,{...i,...r,ref:t})});oe.displayName=J;function Y(e){return e?`open`:`closed`}var se=j,ce=N,le=F,ue=z,de=V,fe=b(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),pe=b(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),X=r();function me(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,T.jsx)(se,{"data-slot":`popover`,...n}),t[2]=n,t[3]=r),r}function he(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,T.jsx)(le,{"data-slot":`popover-trigger`,...n}),t[2]=n,t[3]=r),r}function ge(e){let t=(0,X.c)(12),n,r,a,o;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4]):({className:n,align:a,sideOffset:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o);let s=a===void 0?`center`:a,c=o===void 0?4:o,l;t[5]===n?l=t[6]:(l=i(`z-50 w-72 rounded-lg border bg-popover p-4 text-popover-foreground shadow-md outline-hidden origin-(--radix-popover-content-transform-origin) duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[5]=n,t[6]=l);let u;return t[7]!==s||t[8]!==r||t[9]!==c||t[10]!==l?(u=(0,T.jsx)(ue,{children:(0,T.jsx)(de,{"data-slot":`popover-content`,align:s,sideOffset:c,className:l,...r})}),t[7]=s,t[8]=r,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function _e(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,T.jsx)(ce,{"data-slot":`popover-anchor`,...n}),t[2]=n,t[3]=r),r}var Z=new Set,Q=null;function ve(){if(Q!==null)return;let e=typeof window<`u`?window.okDesktop:void 0;e==null||typeof e.onMenuAction!=`function`||(Q=e.onMenuAction(e=>{$(e)}))}function ye(){Z.size===0&&Q!==null&&(Q(),Q=null)}function be(e){return Z.add(e),ve(),()=>{Z.delete(e),ye()}}function $(e){for(let t of Z)try{t(e)}catch(e){console.error(`[local-menu-action-bus] subscriber threw during dispatch:`,e)}}export{ge as a,fe as c,_e as i,ie as l,be as n,he as o,me as r,pe as s,$ 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{i as s,n as c,t as l}from"./tooltip-x7BNUa3s.js";import{n as u,r as d,t as f}from"./collapsible-OhEmjTXw.js";import{t as p}from"./checkbox-IqSEcunZ.js";import{t as m}from"./label-G0lbYOgL.js";import{i as h,n as g,o as _,s as v,t as y}from"./select-BUOcREjn.js";import{t as ee}from"./switch-BuVbhbtp.js";import{Pn as b,Un as x,et as S,vt as C}from"./dist-CLzUuFWF2.js";import{t as te}from"./arrow-up-right-CxtRAecj.js";import{t as ne}from"./chevron-right-CABnKLlm.js";import{t as w}from"./info-BO0f2XRt.js";import{c as T,r as E}from"./field-7smx8aeY.js";import{n as D}from"./dist-DmEZHXvB.js";import{t as O}from"./input-CtKG6a5B.js";import{t as k}from"./badge-CnYDYmI5.js";import{t as A}from"./external-link-COF7NUCm.js";import{t as j}from"./skeleton-DS8zjX9Q.js";import{d as M,p as N,r as re}from"./lint-config-client-5M2PwjWj.js";import{t as P}from"./tag-pill-input-MTbs9SQK.js";var F=a(),I=e(n(),1),L=t(),R={};function ie(e){let t=(0,F.c)(5),n=R[e.ruleId];if(n!==void 0){let r;return t[0]!==n||t[1]!==e?(r=(0,L.jsx)(n,{...e}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r}let r;return t[3]===e?r=t[4]:(r=(0,L.jsx)(z,{...e}),t[3]=e,t[4]=r),r}function z(e){let t=(0,F.c)(65),{ruleId:n,spec:i,value:a,disabled:o,onChange:s}=e,c=`rule-option-${n}-${i.key}`,l=`${c}-description`,u;t[0]!==c||t[1]!==i.key||t[2]!==i.type?(u=i.type===`unsupported`?(0,L.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:i.key}):(0,L.jsx)(m,{htmlFor:c,className:`font-mono text-sm font-medium`,children:i.key}),t[0]=c,t[1]=i.key,t[2]=i.type,t[3]=u):u=t[3];let d;t[4]===i.default?d=t[5]:(d=i.default===void 0?null:(0,L.jsxs)(L.Fragment,{children:[` · `,(0,L.jsx)(r,{id:`KtACeE`,values:{0:H(i.default)},components:{0:(0,L.jsx)(`code`,{className:`font-mono`})}})]}),t[4]=i.default,t[5]=d);let f;t[6]!==l||t[7]!==i.description||t[8]!==d?(f=(0,L.jsxs)(E,{id:l,children:[i.description,d]}),t[6]=l,t[7]=i.description,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==u||t[11]!==f?(p=(0,L.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[u,f]}),t[10]=u,t[11]=f,t[12]=p):p=t[12];let h=p,g=o===!0,_;t[13]!==c||t[14]!==l||t[15]!==s||t[16]!==g?(_={controlId:c,descriptionId:l,disabled:g,onChange:s},t[13]=c,t[14]=l,t[15]=s,t[16]=g,t[17]=_):_=t[17];let v=_;switch(i.type){case`boolean`:{let e;t[18]!==v||t[19]!==i||t[20]!==a?(e=(0,L.jsx)(U,{...v,spec:i,value:a}),t[18]=v,t[19]=i,t[20]=a,t[21]=e):e=t[21];let n;return t[22]!==c||t[23]!==h||t[24]!==e?(n=(0,L.jsx)(B,{testId:c,header:h,children:e}),t[22]=c,t[23]=h,t[24]=e,t[25]=n):n=t[25],n}case`enum`:{let e;t[26]!==v||t[27]!==i||t[28]!==a?(e=(0,L.jsx)(W,{...v,spec:i,value:a}),t[26]=v,t[27]=i,t[28]=a,t[29]=e):e=t[29];let n;return t[30]!==c||t[31]!==h||t[32]!==e?(n=(0,L.jsx)(B,{testId:c,header:h,children:e}),t[30]=c,t[31]=h,t[32]=e,t[33]=n):n=t[33],n}case`integer`:{let e;t[34]!==v||t[35]!==i||t[36]!==a?(e=(0,L.jsx)(G,{...v,spec:i,value:a}),t[34]=v,t[35]=i,t[36]=a,t[37]=e):e=t[37];let n;return t[38]!==c||t[39]!==h||t[40]!==e?(n=(0,L.jsx)(B,{testId:c,header:h,children:e}),t[38]=c,t[39]=h,t[40]=e,t[41]=n):n=t[41],n}case`string`:{let e;t[42]!==v||t[43]!==i||t[44]!==a?(e=(0,L.jsx)(K,{...v,spec:i,value:a}),t[42]=v,t[43]=i,t[44]=a,t[45]=e):e=t[45];let n;return t[46]!==c||t[47]!==h||t[48]!==e?(n=(0,L.jsx)(V,{testId:c,header:h,children:e}),t[46]=c,t[47]=h,t[48]=e,t[49]=n):n=t[49],n}case`string-array`:{let e;t[50]!==v||t[51]!==i||t[52]!==a?(e=(0,L.jsx)(q,{...v,spec:i,value:a}),t[50]=v,t[51]=i,t[52]=a,t[53]=e):e=t[53];let n;return t[54]!==c||t[55]!==h||t[56]!==e?(n=(0,L.jsx)(V,{testId:c,header:h,children:e}),t[54]=c,t[55]=h,t[56]=e,t[57]=n):n=t[57],n}case`unsupported`:{let e=`${c}-unsupported`,n;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,L.jsx)(r,{id:`NQXwDy`}),t[58]=n):n=t[58];let i;t[59]===e?i=t[60]:(i=(0,L.jsx)(k,{variant:`gray`,"data-testid":e,children:n}),t[59]=e,t[60]=i);let a;return t[61]!==c||t[62]!==h||t[63]!==i?(a=(0,L.jsx)(B,{testId:c,header:h,children:i}),t[61]=c,t[62]=h,t[63]=i,t[64]=a):a=t[64],a}default:return i}}function B(e){let t=(0,F.c)(6),{testId:n,header:r,children:i}=e,a;t[0]===i?a=t[1]:(a=(0,L.jsx)(`div`,{className:`shrink-0`,children:i}),t[0]=i,t[1]=a);let o;return t[2]!==r||t[3]!==a||t[4]!==n?(o=(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,"data-testid":n,children:[r,a]}),t[2]=r,t[3]=a,t[4]=n,t[5]=o):o=t[5],o}function V(e){let t=(0,F.c)(4),{testId:n,header:r,children:i}=e,a;return t[0]!==i||t[1]!==r||t[2]!==n?(a=(0,L.jsxs)(`div`,{className:`space-y-1.5`,"data-testid":n,children:[r,i]}),t[0]=i,t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function H(e){return JSON.stringify(e)}function U(e){let t=(0,F.c)(8),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c=typeof r==`boolean`?r:n.default??!1,l;t[0]===s?l=t[1]:(l=e=>s(e),t[0]=s,t[1]=l);let u;return t[2]!==c||t[3]!==i||t[4]!==a||t[5]!==o||t[6]!==l?(u=(0,L.jsx)(ee,{id:i,checked:c,disabled:o,"aria-describedby":a,onCheckedChange:l}),t[2]=c,t[3]=i,t[4]=a,t[5]=o,t[6]=l,t[7]=u):u=t[7],u}function W(e){let t=(0,F.c)(16),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c=typeof r==`string`?r:n.default??``,l;t[0]===s?l=t[1]:(l=e=>s(e),t[0]=s,t[1]=l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,L.jsx)(v,{}),t[2]=u):u=t[2];let d;t[3]!==i||t[4]!==a?(d=(0,L.jsx)(_,{id:i,"aria-describedby":a,className:`w-48`,children:u}),t[3]=i,t[4]=a,t[5]=d):d=t[5];let f;t[6]===n.enum?f=t[7]:(f=n.enum.map(ae),t[6]=n.enum,t[7]=f);let p;t[8]===f?p=t[9]:(p=(0,L.jsx)(g,{children:f}),t[8]=f,t[9]=p);let m;return t[10]!==c||t[11]!==o||t[12]!==l||t[13]!==d||t[14]!==p?(m=(0,L.jsxs)(y,{value:c,onValueChange:l,disabled:o,children:[d,p]}),t[10]=c,t[11]=o,t[12]=l,t[13]=d,t[14]=p,t[15]=m):m=t[15],m}function ae(e){return(0,L.jsx)(h,{value:e,children:e},e)}function G(e){let t=(0,F.c)(22),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c=typeof r==`number`?r:n.default,l=c===void 0?``:String(c),[u,d]=(0,I.useState)(l),f=(0,I.useRef)(c),p,m;t[0]===c?(p=t[1],m=t[2]):(p=()=>{f.current!==c&&(d(c===void 0?``:String(c)),f.current=c)},m=[c],t[0]=c,t[1]=p,t[2]=m),(0,I.useEffect)(p,m);let h;t[3]!==c||t[4]!==l||t[5]!==s||t[6]!==u||t[7]!==n.maximum||t[8]!==n.minimum?(h=()=>{if(u.trim()===``){d(l);return}let e=Number(u);if(!Number.isFinite(e)){d(l);return}let t=Math.round(e);n.minimum!==void 0&&t<n.minimum&&(t=n.minimum),n.maximum!==void 0&&t>n.maximum&&(t=n.maximum),d(String(t)),t!==c&&s(t)},t[3]=c,t[4]=l,t[5]=s,t[6]=u,t[7]=n.maximum,t[8]=n.minimum,t[9]=h):h=t[9];let g=h,_;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>d(e.target.value),t[10]=_):_=t[10];let v;t[11]===g?v=t[12]:(v=e=>{e.key===`Enter`&&(e.preventDefault(),g())},t[11]=g,t[12]=v);let y;return t[13]!==g||t[14]!==i||t[15]!==a||t[16]!==o||t[17]!==u||t[18]!==n.maximum||t[19]!==n.minimum||t[20]!==v?(y=(0,L.jsx)(O,{id:i,type:`number`,value:u,min:n.minimum,max:n.maximum,disabled:o,"aria-describedby":a,onChange:_,onBlur:g,onKeyDown:v,className:`h-8 w-28 text-sm tabular-nums`}),t[13]=g,t[14]=i,t[15]=a,t[16]=o,t[17]=u,t[18]=n.maximum,t[19]=n.minimum,t[20]=v,t[21]=y):y=t[21],y}function K(e){let t=(0,F.c)(17),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c=typeof r==`string`?r:n.default??``,[l,u]=(0,I.useState)(c),d=(0,I.useRef)(c),f,p;t[0]===c?(f=t[1],p=t[2]):(f=()=>{d.current!==c&&(u(c),d.current=c)},p=[c],t[0]=c,t[1]=f,t[2]=p),(0,I.useEffect)(f,p);let m;t[3]!==c||t[4]!==s||t[5]!==l?(m=()=>{l!==c&&s(l)},t[3]=c,t[4]=s,t[5]=l,t[6]=m):m=t[6];let h=m,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>u(e.target.value),t[7]=g):g=t[7];let _;t[8]===h?_=t[9]:(_=e=>{e.key===`Enter`&&(e.preventDefault(),h())},t[8]=h,t[9]=_);let v;return t[10]!==h||t[11]!==i||t[12]!==a||t[13]!==o||t[14]!==l||t[15]!==_?(v=(0,L.jsx)(O,{id:i,value:l,disabled:o,"aria-describedby":a,onChange:g,onBlur:h,onKeyDown:_,className:`h-8 font-mono text-sm`}),t[10]=h,t[11]=i,t[12]=a,t[13]=o,t[14]=l,t[15]=_,t[16]=v):v=t[16],v}function q(e){let t=(0,F.c)(11),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c;t[0]!==n||t[1]!==r?(c=Array.isArray(r)?r.filter(J):[...n.default??[]],t[0]=n,t[1]=r,t[2]=c):c=t[2];let l=c,u;t[3]===s?u=t[4]:(u=e=>s(e),t[3]=s,t[4]=u);let d;return t[5]!==i||t[6]!==a||t[7]!==o||t[8]!==l||t[9]!==u?(d=(0,L.jsx)(P,{id:i,value:l,grammar:`free-text`,disabled:o,"aria-describedby":a,onChange:u}),t[5]=i,t[6]=a,t[7]=o,t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function J(e){return typeof e==`string`}function oe(e){let t=(0,F.c)(53),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{hideConfigSourceNote:a,initialRuleQuery:o}=n,s=a===void 0?!1:a,{_:c}=i(),{data:l}=M(),h=l!==null,g;t[2]===l?.effective.plugins.markdownlint.rules?g=t[3]:(g=l?.effective.plugins.markdownlint.rules??{},t[2]=l?.effective.plugins.markdownlint.rules,t[3]=g);let _=g,v=l?.configFile??null,[y,ee]=(0,I.useState)(o?.query??``),[x,te]=(0,I.useState)(!1),T=o?.nonce,E=o?.query,k,A;t[4]!==T||t[5]!==E?(k=()=>{T===void 0||E===void 0||ee(E)},A=[T,E],t[4]=T,t[5]=E,t[6]=k,t[7]=A):(k=t[6],A=t[7]),(0,I.useEffect)(k,A);let P;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(P=[],t[8]=P):P=t[8];let[R,ie]=(0,I.useState)(P),z;t[9]===c?z=t[10]:(z=function(e,t){N(e,t).then(e=>{if(!e.ok){D.error(e.errorDetail??c({id:`2G-56b`}));return}re()})},t[9]=c,t[10]=z);let B=z,V;t[11]!==x||t[12]!==y?(V=y.trim()!==``||x,t[11]=x,t[12]=y,t[13]=V):V=t[13];let H=V,U;if(t[14]!==c||t[15]!==R||t[16]!==v||t[17]!==H||t[18]!==s||t[19]!==x||t[20]!==h||t[21]!==_||t[22]!==y||t[23]!==B){let e;t[25]!==v||t[26]!==x||t[27]!==_||t[28]!==y?(e=e=>le(e,y)&&(!x||se(_,v,e.id)),t[25]=v,t[26]=x,t[27]=_,t[28]=y,t[29]=e):e=t[29];let n=S.filter(e),i=C.map(e=>({category:e,entries:n.filter(t=>b(t)===e)})).filter(Y),a;t[30]!==v||t[31]!==s||t[32]!==h?(a=!s&&(h?v?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`markdownlint-config-source-note`,children:(0,L.jsx)(r,{id:`V2Gmie`,values:{configFile:v},components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}):(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,L.jsx)(r,{id:`Z6rrjc`,components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}),(0,L.jsxs)(`p`,{className:`flex items-start gap-1.5 rounded-md border border-dashed p-2.5 text-sm text-muted-foreground`,"data-testid":`markdownlint-no-file-disclaimer`,children:[(0,L.jsx)(w,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),(0,L.jsx)(`span`,{children:(0,L.jsx)(r,{id:`Te6sK2`,components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})})]})]}):(0,L.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,"data-testid":`markdownlint-rule-browser-config-loading`,children:[(0,L.jsx)(j,{className:`h-4 w-full`}),(0,L.jsx)(j,{className:`h-4 w-2/3`})]})),t[30]=v,t[31]=s,t[32]=h,t[33]=a):a=t[33];let o;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`markdownlint-rule-browser-legend`,children:(0,L.jsx)(r,{id:`zYp8Sr`,components:{0:(0,L.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}),t[34]=o):o=t[34];let l;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(l=e=>ee(e.target.value),t[35]=l):l=t[35];let g;t[36]===c?g=t[37]:(g=c({id:`l-4nnw`}),t[36]=c,t[37]=g);let T;t[38]===c?T=t[39]:(T=c({id:`yf5auF`}),t[38]=c,t[39]=T);let E;t[40]!==y||t[41]!==g||t[42]!==T?(E=(0,L.jsx)(O,{value:y,onChange:l,placeholder:g,"aria-label":T,className:`h-8`,"data-testid":`markdownlint-rule-search`}),t[40]=y,t[41]=g,t[42]=T,t[43]=E):E=t[43];let D;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>te(e===!0),t[44]=D):D=t[44];let k;t[45]===x?k=t[46]:(k=(0,L.jsx)(p,{id:`markdownlint-only-modified`,checked:x,onCheckedChange:D,"data-testid":`markdownlint-only-modified`}),t[45]=x,t[46]=k);let A;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,L.jsx)(m,{htmlFor:`markdownlint-only-modified`,className:`text-sm font-normal`,children:(0,L.jsx)(r,{id:`ccNps_`})}),t[47]=A):A=t[47];let M;t[48]===k?M=t[49]:(M=(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[k,A]}),t[48]=k,t[49]=M);let N;t[50]!==E||t[51]!==M?(N=(0,L.jsxs)(`div`,{className:`flex items-center gap-4`,children:[E,M]}),t[50]=E,t[51]=M,t[52]=N):N=t[52],U=(0,L.jsxs)(`div`,{className:`space-y-3`,"data-testid":`settings-linting-markdownlint-rules`,children:[a,o,N,i.length===0?(0,L.jsx)(`p`,{className:`rounded-md border border-dashed p-3 text-sm text-muted-foreground`,"data-testid":`markdownlint-rule-browser-empty`,children:(0,L.jsx)(r,{id:`RfilGt`})}):(0,L.jsx)(`div`,{className:`space-y-2`,children:i.map(e=>{let{category:t,entries:n}=e,i=n.filter(e=>ue($(_,e.id))).length;return(0,L.jsxs)(f,{open:H||!R.includes(t),onOpenChange:e=>ie(e?R.filter(e=>e!==t):[...R,t]),children:[(0,L.jsxs)(d,{className:`group flex w-full items-center gap-2 rounded-md px-1.5 py-1.5 text-sm font-medium hover:bg-muted/50`,"data-testid":`markdownlint-rule-category-${Q(t)}`,children:[(0,L.jsx)(ne,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),(0,L.jsx)(Z,{category:t}),(0,L.jsx)(`span`,{className:`ms-auto text-xs font-normal text-muted-foreground tabular-nums`,children:(0,L.jsx)(r,{id:`NgZwB0`,values:{0:n.length,enabledCount:i}})})]}),(0,L.jsx)(u,{children:(0,L.jsx)(`div`,{className:`mt-1 divide-y rounded-md border`,children:n.map(e=>(0,L.jsx)(X,{rule:e,value:$(_,e.id),modified:se(_,v,e.id),ready:h,onWrite:t=>B(e.id,t)},e.id))})})]},t)})})]}),t[14]=c,t[15]=R,t[16]=v,t[17]=H,t[18]=s,t[19]=x,t[20]=h,t[21]=_,t[22]=y,t[23]=B,t[24]=U}else U=t[24];return U}function Y(e){return e.entries.length>0}function X(e){let t=(0,F.c)(96),{rule:n,value:a,modified:p,ready:m,onWrite:h}=e,{_:g}=i(),_;t[0]===a?_=t[1]:(_=ue(a),t[0]=a,t[1]=_);let v=_,y;t[2]===a?y=t[3]:(y=ce(a),t[2]=a,t[3]=y);let b=y,x,S,C,w,E,D,O;if(t[4]!==n.id||t[5]!==n.name||t[6]!==a){S=de(a),x=f,O=`markdownlint-rule-row-${n.id}`,E=`flex items-center justify-between gap-3 px-3 py-2`;let e=`markdownlint-rule-expand-${n.id}`,i;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,L.jsx)(ne,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[14]=i):i=t[14];let o;t[15]===n.name?o=t[16]:(o=(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:n.name}),t[15]=n.name,t[16]=o),t[17]!==o||t[18]!==e?(D=(0,L.jsxs)(d,{className:`group flex min-w-0 flex-1 items-center gap-1.5 rounded-md py-0.5 text-left hover:bg-muted/50`,"data-testid":e,children:[i,o]}),t[17]=o,t[18]=e,t[19]=D):D=t[19],C=`flex shrink-0 items-center gap-2`,w=S.length>0?(0,L.jsx)(`span`,{id:`settings-linting-markdownlint-options-${n.id}`,className:`text-xs text-muted-foreground`,title:S.join(`, `),"data-testid":`settings-linting-markdownlint-options-${n.id}`,children:(0,L.jsx)(r,{id:`G-h6qN`,values:{0:S.length}})}):null,t[4]=n.id,t[5]=n.name,t[6]=a,t[7]=x,t[8]=S,t[9]=C,t[10]=w,t[11]=E,t[12]=D,t[13]=O}else x=t[7],S=t[8],C=t[9],w=t[10],E=t[11],D=t[12],O=t[13];let j;t[20]!==n.id||t[21]!==b?(j=b===null?null:(0,L.jsx)(k,{variant:`gray`,"data-testid":`markdownlint-rule-severity-${n.id}`,children:b}),t[20]=n.id,t[21]=b,t[22]=j):j=t[22];let M;t[23]!==p||t[24]!==n.id?(M=p?(0,L.jsx)(k,{variant:`outline`,"data-testid":`markdownlint-rule-modified-${n.id}`,children:(0,L.jsx)(r,{id:`tgWuMB`})}):null,t[23]=p,t[24]=n.id,t[25]=M):M=t[25];let N;t[26]!==g||t[27]!==p||t[28]!==h||t[29]!==m||t[30]!==n.id?(N=p?(0,L.jsxs)(l,{children:[(0,L.jsx)(s,{asChild:!0,children:(0,L.jsx)(o,{variant:`ghost`,size:`icon`,className:`h-5 w-5 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,disabled:!m,"aria-label":g({id:`50ORFs`,values:{0:n.id}}),onClick:()=>h(null),children:(0,L.jsx)(T,{className:`size-3.5`})})}),(0,L.jsx)(c,{children:(0,L.jsx)(r,{id:`L-rMC9`})})]}):null,t[26]=g,t[27]=p,t[28]=h,t[29]=m,t[30]=n.id,t[31]=N):N=t[31];let re=`markdownlint-rule-toggle-${n.id}`,P=!m,I;t[32]!==g||t[33]!==v||t[34]!==n.name?(I=g(v?{id:`y5UgU8`,values:{0:n.name}}:{id:`FZtBeR`,values:{0:n.name}}),t[32]=g,t[33]=v,t[34]=n.name,t[35]=I):I=t[35];let R=S.length>0?`settings-linting-markdownlint-options-${n.id}`:void 0,z;t[36]!==h||t[37]!==a?(z=e=>h(fe(a,e)),t[36]=h,t[37]=a,t[38]=z):z=t[38];let B=`markdownlint-rule-toggle-${n.id}`,V;t[39]!==v||t[40]!==re||t[41]!==P||t[42]!==I||t[43]!==R||t[44]!==z||t[45]!==B?(V=(0,L.jsx)(ee,{id:re,checked:v,disabled:P,"aria-label":I,"aria-describedby":R,onCheckedChange:z,"data-testid":B}),t[39]=v,t[40]=re,t[41]=P,t[42]=I,t[43]=R,t[44]=z,t[45]=B,t[46]=V):V=t[46];let H;t[47]!==N||t[48]!==V||t[49]!==C||t[50]!==w||t[51]!==j||t[52]!==M?(H=(0,L.jsxs)(`div`,{className:C,children:[w,j,M,N,V]}),t[47]=N,t[48]=V,t[49]=C,t[50]=w,t[51]=j,t[52]=M,t[53]=H):H=t[53];let U;t[54]!==H||t[55]!==E||t[56]!==D?(U=(0,L.jsxs)(`div`,{className:E,children:[D,H]}),t[54]=H,t[55]=E,t[56]=D,t[57]=U):U=t[57];let W;t[58]!==n.alias||t[59]!==n.id?(W=(0,L.jsxs)(`span`,{className:`font-mono`,children:[n.id,` · `,n.alias]}),t[58]=n.alias,t[59]=n.id,t[60]=W):W=t[60];let ae=n.docUrl,G,K;t[61]===n.docUrl?(G=t[62],K=t[63]):(G=e=>A(e,n.docUrl),K=e=>A(e,n.docUrl),t[61]=n.docUrl,t[62]=G,t[63]=K);let q;t[64]!==g||t[65]!==n.id?(q=g({id:`iv452l`,values:{0:n.id}}),t[64]=g,t[65]=n.id,t[66]=q):q=t[66];let J,oe;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,L.jsx)(r,{id:`TvY_XA`}),oe=(0,L.jsx)(te,{"aria-hidden":!0,className:`size-3`}),t[67]=J,t[68]=oe):(J=t[67],oe=t[68]);let Y;t[69]!==n.docUrl||t[70]!==G||t[71]!==K||t[72]!==q?(Y=(0,L.jsxs)(`a`,{href:ae,target:`_blank`,rel:`noopener noreferrer`,onClick:G,onAuxClick:K,"aria-label":q,className:`inline-flex items-center gap-0.5 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,children:[J,oe]}),t[69]=n.docUrl,t[70]=G,t[71]=K,t[72]=q,t[73]=Y):Y=t[73];let X;t[74]!==W||t[75]!==Y?(X=(0,L.jsxs)(`p`,{className:`text-1sm text-muted-foreground`,children:[W,` · `,Y]}),t[74]=W,t[75]=Y,t[76]=X):X=t[76];let Z;if(t[77]!==h||t[78]!==m||t[79]!==n.id||t[80]!==n.options||t[81]!==a){let e;t[83]!==h||t[84]!==m||t[85]!==n.id||t[86]!==a?(e=e=>(0,L.jsx)(ie,{ruleId:n.id,spec:e,value:me(a,e.key),disabled:!m,onChange:t=>h(pe(a,e.key,t))},e.key),t[83]=h,t[84]=m,t[85]=n.id,t[86]=a,t[87]=e):e=t[87],Z=n.options.map(e),t[77]=h,t[78]=m,t[79]=n.id,t[80]=n.options,t[81]=a,t[82]=Z}else Z=t[82];let Q;t[88]!==X||t[89]!==Z?(Q=(0,L.jsx)(u,{className:`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,children:(0,L.jsxs)(`div`,{className:`space-y-3 px-3 pb-3 pt-1`,children:[X,Z]})}),t[88]=X,t[89]=Z,t[90]=Q):Q=t[90];let $;return t[91]!==x||t[92]!==U||t[93]!==Q||t[94]!==O?($=(0,L.jsxs)(x,{"data-testid":O,children:[U,Q]}),t[91]=x,t[92]=U,t[93]=Q,t[94]=O,t[95]=$):$=t[95],$}function Z(e){let t=(0,F.c)(6),{category:n}=e;switch(n){case`Headings`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`PKjGhT`}),t[0]=e):e=t[0],e}case`Lists`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`h16FyT`}),t[1]=e):e=t[1],e}case`Whitespace`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`iIaSUD`}),t[2]=e):e=t[2],e}case`Code`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`EWPtMO`}),t[3]=e):e=t[3],e}case`Links & images`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`-kbIAr`}),t[4]=e):e=t[4],e}case`Style`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`1CalO6`}),t[5]=e):e=t[5],e}default:return n}}function Q(e){return e.toLowerCase().replace(/[^a-z]+/g,`-`).replace(/^-|-$/g,``)}function $(e,t){let n=x(e,t);return n===void 0?e.default??!0:n.value}function se(e,t,n){return t!==null&&x(e,n)!==void 0}function ce(e){return typeof e==`string`?e:null}function le(e,t){let n=t.trim().toLowerCase();return n===``?!0:e.id.toLowerCase().includes(n)||e.alias.toLowerCase().includes(n)||e.name.toLowerCase().includes(n)}function ue(e){return typeof e!=`object`||!e?e!==!1:e.enabled!==!1}function de(e){return typeof e!=`object`||!e?[]:Object.keys(e).filter(e=>e!==`enabled`)}function fe(e,t){if(typeof e!=`object`||!e)return t;let n={};for(let t of Object.keys(e))t!==`enabled`&&(n[t]=e[t]);return Object.keys(n).length===0?t:t?n:{...n,enabled:!1}}function pe(e,t,n){return typeof e==`object`&&e?{...e,[t]:n}:e===!1?{enabled:!1,[t]:n}:{[t]:n}}function me(e,t){if(!(typeof e!=`object`||!e))return e[t]}export{oe 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{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-RQ5o7P7w.js";import{i as s,n as c,t as l}from"./tooltip-x7BNUa3s.js";import{n as u,r as d,t as f}from"./collapsible-OhEmjTXw.js";import{t as p}from"./checkbox-IqSEcunZ.js";import{t as m}from"./label-G0lbYOgL.js";import{i as h,n as g,o as _,s as v,t as y}from"./select-BUOcREjn.js";import{t as ee}from"./switch-BuVbhbtp.js";import{Pn as b,Un as x,et as S,vt as C}from"./dist-8iqUcAwa2.js";import{t as te}from"./arrow-up-right-CxtRAecj.js";import{t as ne}from"./chevron-right-CABnKLlm.js";import{t as w}from"./info-BO0f2XRt.js";import{c as T,r as E}from"./field-7smx8aeY.js";import{n as D}from"./dist-DmEZHXvB.js";import{t as O}from"./input-CtKG6a5B.js";import{t as k}from"./badge-CnYDYmI5.js";import{t as A}from"./external-link-COF7NUCm.js";import{t as j}from"./skeleton-DS8zjX9Q.js";import{d as M,p as N,r as re}from"./lint-config-client-DsXWTTJY.js";import{t as P}from"./tag-pill-input-BJhyzUl0.js";var F=a(),I=e(n(),1),L=t(),R={};function ie(e){let t=(0,F.c)(5),n=R[e.ruleId];if(n!==void 0){let r;return t[0]!==n||t[1]!==e?(r=(0,L.jsx)(n,{...e}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r}let r;return t[3]===e?r=t[4]:(r=(0,L.jsx)(z,{...e}),t[3]=e,t[4]=r),r}function z(e){let t=(0,F.c)(65),{ruleId:n,spec:i,value:a,disabled:o,onChange:s}=e,c=`rule-option-${n}-${i.key}`,l=`${c}-description`,u;t[0]!==c||t[1]!==i.key||t[2]!==i.type?(u=i.type===`unsupported`?(0,L.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:i.key}):(0,L.jsx)(m,{htmlFor:c,className:`font-mono text-sm font-medium`,children:i.key}),t[0]=c,t[1]=i.key,t[2]=i.type,t[3]=u):u=t[3];let d;t[4]===i.default?d=t[5]:(d=i.default===void 0?null:(0,L.jsxs)(L.Fragment,{children:[` · `,(0,L.jsx)(r,{id:`KtACeE`,values:{0:H(i.default)},components:{0:(0,L.jsx)(`code`,{className:`font-mono`})}})]}),t[4]=i.default,t[5]=d);let f;t[6]!==l||t[7]!==i.description||t[8]!==d?(f=(0,L.jsxs)(E,{id:l,children:[i.description,d]}),t[6]=l,t[7]=i.description,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==u||t[11]!==f?(p=(0,L.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[u,f]}),t[10]=u,t[11]=f,t[12]=p):p=t[12];let h=p,g=o===!0,_;t[13]!==c||t[14]!==l||t[15]!==s||t[16]!==g?(_={controlId:c,descriptionId:l,disabled:g,onChange:s},t[13]=c,t[14]=l,t[15]=s,t[16]=g,t[17]=_):_=t[17];let v=_;switch(i.type){case`boolean`:{let e;t[18]!==v||t[19]!==i||t[20]!==a?(e=(0,L.jsx)(U,{...v,spec:i,value:a}),t[18]=v,t[19]=i,t[20]=a,t[21]=e):e=t[21];let n;return t[22]!==c||t[23]!==h||t[24]!==e?(n=(0,L.jsx)(B,{testId:c,header:h,children:e}),t[22]=c,t[23]=h,t[24]=e,t[25]=n):n=t[25],n}case`enum`:{let e;t[26]!==v||t[27]!==i||t[28]!==a?(e=(0,L.jsx)(W,{...v,spec:i,value:a}),t[26]=v,t[27]=i,t[28]=a,t[29]=e):e=t[29];let n;return t[30]!==c||t[31]!==h||t[32]!==e?(n=(0,L.jsx)(B,{testId:c,header:h,children:e}),t[30]=c,t[31]=h,t[32]=e,t[33]=n):n=t[33],n}case`integer`:{let e;t[34]!==v||t[35]!==i||t[36]!==a?(e=(0,L.jsx)(G,{...v,spec:i,value:a}),t[34]=v,t[35]=i,t[36]=a,t[37]=e):e=t[37];let n;return t[38]!==c||t[39]!==h||t[40]!==e?(n=(0,L.jsx)(B,{testId:c,header:h,children:e}),t[38]=c,t[39]=h,t[40]=e,t[41]=n):n=t[41],n}case`string`:{let e;t[42]!==v||t[43]!==i||t[44]!==a?(e=(0,L.jsx)(K,{...v,spec:i,value:a}),t[42]=v,t[43]=i,t[44]=a,t[45]=e):e=t[45];let n;return t[46]!==c||t[47]!==h||t[48]!==e?(n=(0,L.jsx)(V,{testId:c,header:h,children:e}),t[46]=c,t[47]=h,t[48]=e,t[49]=n):n=t[49],n}case`string-array`:{let e;t[50]!==v||t[51]!==i||t[52]!==a?(e=(0,L.jsx)(q,{...v,spec:i,value:a}),t[50]=v,t[51]=i,t[52]=a,t[53]=e):e=t[53];let n;return t[54]!==c||t[55]!==h||t[56]!==e?(n=(0,L.jsx)(V,{testId:c,header:h,children:e}),t[54]=c,t[55]=h,t[56]=e,t[57]=n):n=t[57],n}case`unsupported`:{let e=`${c}-unsupported`,n;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,L.jsx)(r,{id:`NQXwDy`}),t[58]=n):n=t[58];let i;t[59]===e?i=t[60]:(i=(0,L.jsx)(k,{variant:`gray`,"data-testid":e,children:n}),t[59]=e,t[60]=i);let a;return t[61]!==c||t[62]!==h||t[63]!==i?(a=(0,L.jsx)(B,{testId:c,header:h,children:i}),t[61]=c,t[62]=h,t[63]=i,t[64]=a):a=t[64],a}default:return i}}function B(e){let t=(0,F.c)(6),{testId:n,header:r,children:i}=e,a;t[0]===i?a=t[1]:(a=(0,L.jsx)(`div`,{className:`shrink-0`,children:i}),t[0]=i,t[1]=a);let o;return t[2]!==r||t[3]!==a||t[4]!==n?(o=(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,"data-testid":n,children:[r,a]}),t[2]=r,t[3]=a,t[4]=n,t[5]=o):o=t[5],o}function V(e){let t=(0,F.c)(4),{testId:n,header:r,children:i}=e,a;return t[0]!==i||t[1]!==r||t[2]!==n?(a=(0,L.jsxs)(`div`,{className:`space-y-1.5`,"data-testid":n,children:[r,i]}),t[0]=i,t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function H(e){return JSON.stringify(e)}function U(e){let t=(0,F.c)(8),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c=typeof r==`boolean`?r:n.default??!1,l;t[0]===s?l=t[1]:(l=e=>s(e),t[0]=s,t[1]=l);let u;return t[2]!==c||t[3]!==i||t[4]!==a||t[5]!==o||t[6]!==l?(u=(0,L.jsx)(ee,{id:i,checked:c,disabled:o,"aria-describedby":a,onCheckedChange:l}),t[2]=c,t[3]=i,t[4]=a,t[5]=o,t[6]=l,t[7]=u):u=t[7],u}function W(e){let t=(0,F.c)(16),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c=typeof r==`string`?r:n.default??``,l;t[0]===s?l=t[1]:(l=e=>s(e),t[0]=s,t[1]=l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,L.jsx)(v,{}),t[2]=u):u=t[2];let d;t[3]!==i||t[4]!==a?(d=(0,L.jsx)(_,{id:i,"aria-describedby":a,className:`w-48`,children:u}),t[3]=i,t[4]=a,t[5]=d):d=t[5];let f;t[6]===n.enum?f=t[7]:(f=n.enum.map(ae),t[6]=n.enum,t[7]=f);let p;t[8]===f?p=t[9]:(p=(0,L.jsx)(g,{children:f}),t[8]=f,t[9]=p);let m;return t[10]!==c||t[11]!==o||t[12]!==l||t[13]!==d||t[14]!==p?(m=(0,L.jsxs)(y,{value:c,onValueChange:l,disabled:o,children:[d,p]}),t[10]=c,t[11]=o,t[12]=l,t[13]=d,t[14]=p,t[15]=m):m=t[15],m}function ae(e){return(0,L.jsx)(h,{value:e,children:e},e)}function G(e){let t=(0,F.c)(22),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c=typeof r==`number`?r:n.default,l=c===void 0?``:String(c),[u,d]=(0,I.useState)(l),f=(0,I.useRef)(c),p,m;t[0]===c?(p=t[1],m=t[2]):(p=()=>{f.current!==c&&(d(c===void 0?``:String(c)),f.current=c)},m=[c],t[0]=c,t[1]=p,t[2]=m),(0,I.useEffect)(p,m);let h;t[3]!==c||t[4]!==l||t[5]!==s||t[6]!==u||t[7]!==n.maximum||t[8]!==n.minimum?(h=()=>{if(u.trim()===``){d(l);return}let e=Number(u);if(!Number.isFinite(e)){d(l);return}let t=Math.round(e);n.minimum!==void 0&&t<n.minimum&&(t=n.minimum),n.maximum!==void 0&&t>n.maximum&&(t=n.maximum),d(String(t)),t!==c&&s(t)},t[3]=c,t[4]=l,t[5]=s,t[6]=u,t[7]=n.maximum,t[8]=n.minimum,t[9]=h):h=t[9];let g=h,_;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>d(e.target.value),t[10]=_):_=t[10];let v;t[11]===g?v=t[12]:(v=e=>{e.key===`Enter`&&(e.preventDefault(),g())},t[11]=g,t[12]=v);let y;return t[13]!==g||t[14]!==i||t[15]!==a||t[16]!==o||t[17]!==u||t[18]!==n.maximum||t[19]!==n.minimum||t[20]!==v?(y=(0,L.jsx)(O,{id:i,type:`number`,value:u,min:n.minimum,max:n.maximum,disabled:o,"aria-describedby":a,onChange:_,onBlur:g,onKeyDown:v,className:`h-8 w-28 text-sm tabular-nums`}),t[13]=g,t[14]=i,t[15]=a,t[16]=o,t[17]=u,t[18]=n.maximum,t[19]=n.minimum,t[20]=v,t[21]=y):y=t[21],y}function K(e){let t=(0,F.c)(17),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c=typeof r==`string`?r:n.default??``,[l,u]=(0,I.useState)(c),d=(0,I.useRef)(c),f,p;t[0]===c?(f=t[1],p=t[2]):(f=()=>{d.current!==c&&(u(c),d.current=c)},p=[c],t[0]=c,t[1]=f,t[2]=p),(0,I.useEffect)(f,p);let m;t[3]!==c||t[4]!==s||t[5]!==l?(m=()=>{l!==c&&s(l)},t[3]=c,t[4]=s,t[5]=l,t[6]=m):m=t[6];let h=m,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>u(e.target.value),t[7]=g):g=t[7];let _;t[8]===h?_=t[9]:(_=e=>{e.key===`Enter`&&(e.preventDefault(),h())},t[8]=h,t[9]=_);let v;return t[10]!==h||t[11]!==i||t[12]!==a||t[13]!==o||t[14]!==l||t[15]!==_?(v=(0,L.jsx)(O,{id:i,value:l,disabled:o,"aria-describedby":a,onChange:g,onBlur:h,onKeyDown:_,className:`h-8 font-mono text-sm`}),t[10]=h,t[11]=i,t[12]=a,t[13]=o,t[14]=l,t[15]=_,t[16]=v):v=t[16],v}function q(e){let t=(0,F.c)(11),{spec:n,value:r,controlId:i,descriptionId:a,disabled:o,onChange:s}=e,c;t[0]!==n||t[1]!==r?(c=Array.isArray(r)?r.filter(J):[...n.default??[]],t[0]=n,t[1]=r,t[2]=c):c=t[2];let l=c,u;t[3]===s?u=t[4]:(u=e=>s(e),t[3]=s,t[4]=u);let d;return t[5]!==i||t[6]!==a||t[7]!==o||t[8]!==l||t[9]!==u?(d=(0,L.jsx)(P,{id:i,value:l,grammar:`free-text`,disabled:o,"aria-describedby":a,onChange:u}),t[5]=i,t[6]=a,t[7]=o,t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function J(e){return typeof e==`string`}function oe(e){let t=(0,F.c)(53),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{hideConfigSourceNote:a,initialRuleQuery:o}=n,s=a===void 0?!1:a,{_:c}=i(),{data:l}=M(),h=l!==null,g;t[2]===l?.effective.plugins.markdownlint.rules?g=t[3]:(g=l?.effective.plugins.markdownlint.rules??{},t[2]=l?.effective.plugins.markdownlint.rules,t[3]=g);let _=g,v=l?.configFile??null,[y,ee]=(0,I.useState)(o?.query??``),[x,te]=(0,I.useState)(!1),T=o?.nonce,E=o?.query,k,A;t[4]!==T||t[5]!==E?(k=()=>{T===void 0||E===void 0||ee(E)},A=[T,E],t[4]=T,t[5]=E,t[6]=k,t[7]=A):(k=t[6],A=t[7]),(0,I.useEffect)(k,A);let P;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(P=[],t[8]=P):P=t[8];let[R,ie]=(0,I.useState)(P),z;t[9]===c?z=t[10]:(z=function(e,t){N(e,t).then(e=>{if(!e.ok){D.error(e.errorDetail??c({id:`2G-56b`}));return}re()})},t[9]=c,t[10]=z);let B=z,V;t[11]!==x||t[12]!==y?(V=y.trim()!==``||x,t[11]=x,t[12]=y,t[13]=V):V=t[13];let H=V,U;if(t[14]!==c||t[15]!==R||t[16]!==v||t[17]!==H||t[18]!==s||t[19]!==x||t[20]!==h||t[21]!==_||t[22]!==y||t[23]!==B){let e;t[25]!==v||t[26]!==x||t[27]!==_||t[28]!==y?(e=e=>le(e,y)&&(!x||se(_,v,e.id)),t[25]=v,t[26]=x,t[27]=_,t[28]=y,t[29]=e):e=t[29];let n=S.filter(e),i=C.map(e=>({category:e,entries:n.filter(t=>b(t)===e)})).filter(Y),a;t[30]!==v||t[31]!==s||t[32]!==h?(a=!s&&(h?v?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`markdownlint-config-source-note`,children:(0,L.jsx)(r,{id:`V2Gmie`,values:{configFile:v},components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}):(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,L.jsx)(r,{id:`Z6rrjc`,components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}),(0,L.jsxs)(`p`,{className:`flex items-start gap-1.5 rounded-md border border-dashed p-2.5 text-sm text-muted-foreground`,"data-testid":`markdownlint-no-file-disclaimer`,children:[(0,L.jsx)(w,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),(0,L.jsx)(`span`,{children:(0,L.jsx)(r,{id:`Te6sK2`,components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})})]})]}):(0,L.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,"data-testid":`markdownlint-rule-browser-config-loading`,children:[(0,L.jsx)(j,{className:`h-4 w-full`}),(0,L.jsx)(j,{className:`h-4 w-2/3`})]})),t[30]=v,t[31]=s,t[32]=h,t[33]=a):a=t[33];let o;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`markdownlint-rule-browser-legend`,children:(0,L.jsx)(r,{id:`zYp8Sr`,components:{0:(0,L.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}),t[34]=o):o=t[34];let l;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(l=e=>ee(e.target.value),t[35]=l):l=t[35];let g;t[36]===c?g=t[37]:(g=c({id:`l-4nnw`}),t[36]=c,t[37]=g);let T;t[38]===c?T=t[39]:(T=c({id:`yf5auF`}),t[38]=c,t[39]=T);let E;t[40]!==y||t[41]!==g||t[42]!==T?(E=(0,L.jsx)(O,{value:y,onChange:l,placeholder:g,"aria-label":T,className:`h-8`,"data-testid":`markdownlint-rule-search`}),t[40]=y,t[41]=g,t[42]=T,t[43]=E):E=t[43];let D;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>te(e===!0),t[44]=D):D=t[44];let k;t[45]===x?k=t[46]:(k=(0,L.jsx)(p,{id:`markdownlint-only-modified`,checked:x,onCheckedChange:D,"data-testid":`markdownlint-only-modified`}),t[45]=x,t[46]=k);let A;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,L.jsx)(m,{htmlFor:`markdownlint-only-modified`,className:`text-sm font-normal`,children:(0,L.jsx)(r,{id:`ccNps_`})}),t[47]=A):A=t[47];let M;t[48]===k?M=t[49]:(M=(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[k,A]}),t[48]=k,t[49]=M);let N;t[50]!==E||t[51]!==M?(N=(0,L.jsxs)(`div`,{className:`flex items-center gap-4`,children:[E,M]}),t[50]=E,t[51]=M,t[52]=N):N=t[52],U=(0,L.jsxs)(`div`,{className:`space-y-3`,"data-testid":`settings-linting-markdownlint-rules`,children:[a,o,N,i.length===0?(0,L.jsx)(`p`,{className:`rounded-md border border-dashed p-3 text-sm text-muted-foreground`,"data-testid":`markdownlint-rule-browser-empty`,children:(0,L.jsx)(r,{id:`RfilGt`})}):(0,L.jsx)(`div`,{className:`space-y-2`,children:i.map(e=>{let{category:t,entries:n}=e,i=n.filter(e=>ue($(_,e.id))).length;return(0,L.jsxs)(f,{open:H||!R.includes(t),onOpenChange:e=>ie(e?R.filter(e=>e!==t):[...R,t]),children:[(0,L.jsxs)(d,{className:`group flex w-full items-center gap-2 rounded-md px-1.5 py-1.5 text-sm font-medium hover:bg-muted/50`,"data-testid":`markdownlint-rule-category-${Q(t)}`,children:[(0,L.jsx)(ne,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),(0,L.jsx)(Z,{category:t}),(0,L.jsx)(`span`,{className:`ms-auto text-xs font-normal text-muted-foreground tabular-nums`,children:(0,L.jsx)(r,{id:`NgZwB0`,values:{0:n.length,enabledCount:i}})})]}),(0,L.jsx)(u,{children:(0,L.jsx)(`div`,{className:`mt-1 divide-y rounded-md border`,children:n.map(e=>(0,L.jsx)(X,{rule:e,value:$(_,e.id),modified:se(_,v,e.id),ready:h,onWrite:t=>B(e.id,t)},e.id))})})]},t)})})]}),t[14]=c,t[15]=R,t[16]=v,t[17]=H,t[18]=s,t[19]=x,t[20]=h,t[21]=_,t[22]=y,t[23]=B,t[24]=U}else U=t[24];return U}function Y(e){return e.entries.length>0}function X(e){let t=(0,F.c)(96),{rule:n,value:a,modified:p,ready:m,onWrite:h}=e,{_:g}=i(),_;t[0]===a?_=t[1]:(_=ue(a),t[0]=a,t[1]=_);let v=_,y;t[2]===a?y=t[3]:(y=ce(a),t[2]=a,t[3]=y);let b=y,x,S,C,w,E,D,O;if(t[4]!==n.id||t[5]!==n.name||t[6]!==a){S=de(a),x=f,O=`markdownlint-rule-row-${n.id}`,E=`flex items-center justify-between gap-3 px-3 py-2`;let e=`markdownlint-rule-expand-${n.id}`,i;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,L.jsx)(ne,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[14]=i):i=t[14];let o;t[15]===n.name?o=t[16]:(o=(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:n.name}),t[15]=n.name,t[16]=o),t[17]!==o||t[18]!==e?(D=(0,L.jsxs)(d,{className:`group flex min-w-0 flex-1 items-center gap-1.5 rounded-md py-0.5 text-left hover:bg-muted/50`,"data-testid":e,children:[i,o]}),t[17]=o,t[18]=e,t[19]=D):D=t[19],C=`flex shrink-0 items-center gap-2`,w=S.length>0?(0,L.jsx)(`span`,{id:`settings-linting-markdownlint-options-${n.id}`,className:`text-xs text-muted-foreground`,title:S.join(`, `),"data-testid":`settings-linting-markdownlint-options-${n.id}`,children:(0,L.jsx)(r,{id:`G-h6qN`,values:{0:S.length}})}):null,t[4]=n.id,t[5]=n.name,t[6]=a,t[7]=x,t[8]=S,t[9]=C,t[10]=w,t[11]=E,t[12]=D,t[13]=O}else x=t[7],S=t[8],C=t[9],w=t[10],E=t[11],D=t[12],O=t[13];let j;t[20]!==n.id||t[21]!==b?(j=b===null?null:(0,L.jsx)(k,{variant:`gray`,"data-testid":`markdownlint-rule-severity-${n.id}`,children:b}),t[20]=n.id,t[21]=b,t[22]=j):j=t[22];let M;t[23]!==p||t[24]!==n.id?(M=p?(0,L.jsx)(k,{variant:`outline`,"data-testid":`markdownlint-rule-modified-${n.id}`,children:(0,L.jsx)(r,{id:`tgWuMB`})}):null,t[23]=p,t[24]=n.id,t[25]=M):M=t[25];let N;t[26]!==g||t[27]!==p||t[28]!==h||t[29]!==m||t[30]!==n.id?(N=p?(0,L.jsxs)(l,{children:[(0,L.jsx)(s,{asChild:!0,children:(0,L.jsx)(o,{variant:`ghost`,size:`icon`,className:`h-5 w-5 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,disabled:!m,"aria-label":g({id:`50ORFs`,values:{0:n.id}}),onClick:()=>h(null),children:(0,L.jsx)(T,{className:`size-3.5`})})}),(0,L.jsx)(c,{children:(0,L.jsx)(r,{id:`L-rMC9`})})]}):null,t[26]=g,t[27]=p,t[28]=h,t[29]=m,t[30]=n.id,t[31]=N):N=t[31];let re=`markdownlint-rule-toggle-${n.id}`,P=!m,I;t[32]!==g||t[33]!==v||t[34]!==n.name?(I=g(v?{id:`y5UgU8`,values:{0:n.name}}:{id:`FZtBeR`,values:{0:n.name}}),t[32]=g,t[33]=v,t[34]=n.name,t[35]=I):I=t[35];let R=S.length>0?`settings-linting-markdownlint-options-${n.id}`:void 0,z;t[36]!==h||t[37]!==a?(z=e=>h(fe(a,e)),t[36]=h,t[37]=a,t[38]=z):z=t[38];let B=`markdownlint-rule-toggle-${n.id}`,V;t[39]!==v||t[40]!==re||t[41]!==P||t[42]!==I||t[43]!==R||t[44]!==z||t[45]!==B?(V=(0,L.jsx)(ee,{id:re,checked:v,disabled:P,"aria-label":I,"aria-describedby":R,onCheckedChange:z,"data-testid":B}),t[39]=v,t[40]=re,t[41]=P,t[42]=I,t[43]=R,t[44]=z,t[45]=B,t[46]=V):V=t[46];let H;t[47]!==N||t[48]!==V||t[49]!==C||t[50]!==w||t[51]!==j||t[52]!==M?(H=(0,L.jsxs)(`div`,{className:C,children:[w,j,M,N,V]}),t[47]=N,t[48]=V,t[49]=C,t[50]=w,t[51]=j,t[52]=M,t[53]=H):H=t[53];let U;t[54]!==H||t[55]!==E||t[56]!==D?(U=(0,L.jsxs)(`div`,{className:E,children:[D,H]}),t[54]=H,t[55]=E,t[56]=D,t[57]=U):U=t[57];let W;t[58]!==n.alias||t[59]!==n.id?(W=(0,L.jsxs)(`span`,{className:`font-mono`,children:[n.id,` · `,n.alias]}),t[58]=n.alias,t[59]=n.id,t[60]=W):W=t[60];let ae=n.docUrl,G,K;t[61]===n.docUrl?(G=t[62],K=t[63]):(G=e=>A(e,n.docUrl),K=e=>A(e,n.docUrl),t[61]=n.docUrl,t[62]=G,t[63]=K);let q;t[64]!==g||t[65]!==n.id?(q=g({id:`iv452l`,values:{0:n.id}}),t[64]=g,t[65]=n.id,t[66]=q):q=t[66];let J,oe;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,L.jsx)(r,{id:`TvY_XA`}),oe=(0,L.jsx)(te,{"aria-hidden":!0,className:`size-3`}),t[67]=J,t[68]=oe):(J=t[67],oe=t[68]);let Y;t[69]!==n.docUrl||t[70]!==G||t[71]!==K||t[72]!==q?(Y=(0,L.jsxs)(`a`,{href:ae,target:`_blank`,rel:`noopener noreferrer`,onClick:G,onAuxClick:K,"aria-label":q,className:`inline-flex items-center gap-0.5 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,children:[J,oe]}),t[69]=n.docUrl,t[70]=G,t[71]=K,t[72]=q,t[73]=Y):Y=t[73];let X;t[74]!==W||t[75]!==Y?(X=(0,L.jsxs)(`p`,{className:`text-1sm text-muted-foreground`,children:[W,` · `,Y]}),t[74]=W,t[75]=Y,t[76]=X):X=t[76];let Z;if(t[77]!==h||t[78]!==m||t[79]!==n.id||t[80]!==n.options||t[81]!==a){let e;t[83]!==h||t[84]!==m||t[85]!==n.id||t[86]!==a?(e=e=>(0,L.jsx)(ie,{ruleId:n.id,spec:e,value:me(a,e.key),disabled:!m,onChange:t=>h(pe(a,e.key,t))},e.key),t[83]=h,t[84]=m,t[85]=n.id,t[86]=a,t[87]=e):e=t[87],Z=n.options.map(e),t[77]=h,t[78]=m,t[79]=n.id,t[80]=n.options,t[81]=a,t[82]=Z}else Z=t[82];let Q;t[88]!==X||t[89]!==Z?(Q=(0,L.jsx)(u,{className:`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,children:(0,L.jsxs)(`div`,{className:`space-y-3 px-3 pb-3 pt-1`,children:[X,Z]})}),t[88]=X,t[89]=Z,t[90]=Q):Q=t[90];let $;return t[91]!==x||t[92]!==U||t[93]!==Q||t[94]!==O?($=(0,L.jsxs)(x,{"data-testid":O,children:[U,Q]}),t[91]=x,t[92]=U,t[93]=Q,t[94]=O,t[95]=$):$=t[95],$}function Z(e){let t=(0,F.c)(6),{category:n}=e;switch(n){case`Headings`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`PKjGhT`}),t[0]=e):e=t[0],e}case`Lists`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`h16FyT`}),t[1]=e):e=t[1],e}case`Whitespace`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`iIaSUD`}),t[2]=e):e=t[2],e}case`Code`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`EWPtMO`}),t[3]=e):e=t[3],e}case`Links & images`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`-kbIAr`}),t[4]=e):e=t[4],e}case`Style`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(r,{id:`1CalO6`}),t[5]=e):e=t[5],e}default:return n}}function Q(e){return e.toLowerCase().replace(/[^a-z]+/g,`-`).replace(/^-|-$/g,``)}function $(e,t){let n=x(e,t);return n===void 0?e.default??!0:n.value}function se(e,t,n){return t!==null&&x(e,n)!==void 0}function ce(e){return typeof e==`string`?e:null}function le(e,t){let n=t.trim().toLowerCase();return n===``?!0:e.id.toLowerCase().includes(n)||e.alias.toLowerCase().includes(n)||e.name.toLowerCase().includes(n)}function ue(e){return typeof e!=`object`||!e?e!==!1:e.enabled!==!1}function de(e){return typeof e!=`object`||!e?[]:Object.keys(e).filter(e=>e!==`enabled`)}function fe(e,t){if(typeof e!=`object`||!e)return t;let n={};for(let t of Object.keys(e))t!==`enabled`&&(n[t]=e[t]);return Object.keys(n).length===0?t:t?n:{...n,enabled:!1}}function pe(e,t,n){return typeof e==`object`&&e?{...e,[t]:n}:e===!1?{enabled:!1,[t]:n}:{[t]:n}}function me(e,t){if(!(typeof e!=`object`||!e))return e[t]}export{oe as t};
@@ -1 +1 @@
1
- import{Ba as e,Co as t,Do as n,E as r,Ha as i,Ia as a,Ka as o,La as s,Pa as c,Ua as l,Va as u,ba as d,dr as f,ti as p,xa as ee,xo as te,za as m}from"./dist-CLzUuFWF2.js";import{l as ne,o as re,r as ie}from"./doc-paths-D7j_eEce.js";import{o as ae,r as oe}from"./file-tree-utils-Ce34hqQC.js";import{o as h}from"./skill-scope-DQD8O86J.js";var g=null,_=new Set;function v(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function se(e,t){return e===null?!1:e===t?!0:v(e.pages,t.pages)&&v(e.folderPaths,t.folderPaths)&&v(e.assetPaths??new Set,t.assetPaths??new Set)&&v(e.filePaths??new Set,t.filePaths??new Set)&&ce(e.pageIcons,t.pageIcons)}function ce(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function le(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function ue(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function de(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function fe(){return g}function pe(e){if(!se(g,e)){g=e;for(let t of Array.from(_))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function me(e){if(_.add(e),g!==null)try{e(g)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{_.delete(e)}}function he(e,t){let n=e.replace(/^\/+|\/+$/g,``);return`${d}${n?`${n}/`:``}${t}`}function ge(e){return e.scope===`project`?o(e.path):l(e.scope,e.name)}function _e(e,t){return e.scope===`project`?`${e.path.replace(/\/SKILL\.mdx?$/i,``)}/${o(t)}`:i(e.scope,e.name,t)}function y(t){let n=e(t);return n?.kind===`skill`?n.name:null}function ve(e){return ee.includes(e)}function b(e,t,n){return typeof e!=`string`||!n.includes(e)?null:U(e)===(t===`skills`)?e:null}function x(){return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,activeTabByMode:{files:null,skills:null},updatedAt:null}}var ye=`ok-editor-tabs-v1:`,S=`\0folder:`,C=`\0asset:`,w=`\0skill-file:`,T=`\0skill-preview:`,be=`\0doc-tab:`,E=`skills:hub`,D=/\.(md|mdx)$/i;function O(e){let t=e.lastIndexOf(be);return t<0?{baseTabId:e,instanceSuffix:``}:{baseTabId:e.slice(0,t),instanceSuffix:e.slice(t)}}function k(e){return O(e).baseTabId}function A(e){return D.test(e)?e.replace(D,``):null}function j(e){if(typeof e!=`string`||e.length===0)return!1;let t=k(e);return t.startsWith(S)?t.length>8:t.startsWith(C)?t.length>7:t.startsWith(w)?P(t)!==null:t===E?!1:t.startsWith(T)?I(t)!==null:!0}var M=`:`;function N(e){let t=e.host===void 0?e.name:`${e.name}${M}${e.host}`;return`${w}${e.scope}/${t}/${e.path}`}function P(e){if(!e.startsWith(w))return null;let t=e.slice(12).split(`/`);if(t.length<3)return null;let[n,r,...i]=t,a=i.join(`/`);if(!n||!r||!a||!ve(n))return null;let o=r.indexOf(M),s=o===-1?r:r.slice(0,o),c=o===-1?void 0:r.slice(o+1);return s?{scope:n,name:s,path:a,...c?{host:c}:{}}:null}function F(e){return`${T}${ne(e)}`}function xe(e,t,n,r){for(let i of e){let e=B(i);if(e.kind===`skill-preview`&&e.flavor===t&&e.name===n&&e.level===r)return i}return null}function I(e){return e.startsWith(T)?re(e.slice(15)):null}function L(e){return e}function R(e){return`${S}${e}`}function z(e){return`${C}${e}`}function Se(e,t){let n=y(e);if(n){let e=h(n);return{baseName:e,extension:``,label:e,prefix:``}}let r=s(e);if(r){let e=r.rel?r.rel.split(`/`).pop()??r.rel:h(r.name);return{baseName:e,extension:``,label:e,prefix:``}}let i=e.lastIndexOf(`/`),a=i<0?e:e.slice(i+1),o=D.test(t)&&D.test(a)?``:t,c=`${a}${o}`;return i<0?{baseName:a,extension:o,label:c,prefix:``}:{baseName:a,extension:o,label:c,prefix:`${e.slice(0,i)}/`}}function Ce(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return L(e.docName);case`folder`:return R(e.folderPath);case`missing`:return L(e.target);case`asset`:return z(e.assetPath);case`skill-file`:return N(e);case`skills`:return null;case`skill-preview`:return F(e)}}function B(e){let t=k(e);if(t.startsWith(S))return{kind:`folder`,folderPath:t.slice(8)};if(t.startsWith(C))return{kind:`asset`,assetPath:t.slice(7)};if(t===E)return{kind:`skills`,target:`skills`};let n=I(t);if(n)return{kind:`skill-preview`,...n};let r=P(t);return r?{kind:`skill-file`,...r}:{kind:`doc`,docName:t}}function we(e){let t=B(e);return t.kind===`doc`?t.docName:null}function Te(e,t){return e||t>0}function V(t){return e(t)!=null||m(t)?.kind===`skill`||s(t)!=null}var Ee=/(?:^|\/)skills\/[^/]+\/(?:SKILL|references\/.+)$/;function H(e){return Ee.test(e)}function U(e){let t=B(e);return t.kind===`skills`||t.kind===`skill-file`||t.kind===`skill-preview`||t.kind===`doc`&&(V(t.docName)||H(t.docName))}function W(e,t){if(!Array.isArray(e)||t<=0)return[];let n=[],r=new Set;for(let i of e)if(j(i)&&!r.has(i)&&(r.add(i),n.push(i),n.length>=t))break;return n}function G(e,t){let n=new Set(W(t,2**53-1));return W(e,2**53-1).filter(e=>n.has(e))}function K(e,t,n){if(t<=0)return[];let r=new Set(W(n,2**53-1)),i=W(e,2**53-1);if(r.size===0&&i.length<=t)return i;let a=[],o=0;for(let e=i.length-1;e>=0;e--){let n=i[e];if(r.has(n)){a.push(n);continue}o>=t||(o++,a.push(n))}return a.reverse()}function q(e,t,n){let r=G(e,n);return!W(n,2**53-1).includes(t)||r.includes(t)?r:[...r,t]}function J(e,t){return W(e,2**53-1).filter(e=>e!==t)}function De(e,t){let n=new Set(W(t,2**53-1));return W(e,2**53-1).filter(e=>!n.has(e))}function Oe(e,t,n){let r=W(e,2**53-1),i=G(t,r),a=r.indexOf(n);if(a<0)return i;let o=i.includes(n),s=a<i.length;return o===s?i:s?q(i,n,r):J(i,n)}function Y(e,t,n,r=[]){let i=K(e,n,r);return!j(t)||i.includes(t)?i:K([...i,t],n,r)}function ke(e,t,n,r,i=[]){let a=K(e,r,i);if(!j(n))return a;if(!t||t===n)return Y(a,n,r,i);let o=a.filter(e=>e!==n),s=o.indexOf(t);if(s<0)return Y(o,n,r,i);let c=[...o];return c[s]=n,K(c,r,i)}function Ae(e,t,n){return X(e,L(t),n)}function X(e,t,{behavior:n,currentTabId:r,limit:i,pinnedTabIds:a=[]}){let o=K(e,i,a),s=k(t);if(r&&o.includes(r)&&k(r)===s)return{tabs:o,activeTabId:r};let c=o.find(e=>k(e)===s);return c?{tabs:o,activeTabId:c}:n===`replace-active`?{tabs:ke(o,r,s,i,a),activeTabId:s}:{tabs:Y(o,s,i,a),activeTabId:s}}function je(e,t){return e.filter(e=>e!==t)}function Me(e,t,n){let r=W(t,2**53-1),i=new Set(r),a=new Set(n),o=new Set,s=[];for(let t of e)o.has(t)||!i.has(t)&&!a.has(t)||(o.add(t),s.push(t));for(let e of[...r,...n])o.has(e)||(o.add(e),s.push(e));return s}function Ne(e,{pages:t,folderPaths:n,assetPaths:r,filePaths:i,keepMissingDocName:a=null,keepHashDocName:o=null}){return W(e,2**53-1).filter(e=>{let s=B(e);if(s.kind===`folder`)return n.has(s.folderPath);if(s.kind===`asset`)return r.has(s.assetPath)||i?.has(s.assetPath)===!0;if(s.kind===`skill-file`||s.kind===`skill-preview`)return!0;if(s.kind===`skills`)return!1;let l=A(s.docName);return t.has(s.docName)||l!==null&&t.has(l)||c(s.docName)||s.docName===a||s.docName===o})}function Z(e,t,n,r=[],i=[],a=[]){if(t.length===0&&r.length===0&&a.length===0)return W(e,n);let o=new Map(t.map(e=>[e.fromDocName,e.toDocName])),s=new Map(a.flatMap(e=>{let t=A(e.fromPath);return t?[[t,e.toPath]]:[]})),c=new Map(a.flatMap(e=>{let t=A(e.toPath);return t?[[e.fromPath,t]]:[]})),l=e=>Fe(Q(e,r),a),u=(e,t)=>{let n=o.get(e);if(n)return n;let r=s.get(e);return r?z(r):t},d=e=>{let t=c.get(e);return t?L(t):z(l(e))},f=[],p=new Set;for(let t of e){let{instanceSuffix:e}=O(t),a=B(t),o=`${a.kind===`doc`?u(a.docName,k(t)):a.kind===`folder`?R(Q(a.folderPath,r)):a.kind===`asset`?d(a.assetPath):k(t)}${e}`;if(!p.has(o)&&(p.add(o),f.push(o),i.length===0&&f.length>=n))break}return i.length===0?f:K(f,n,i.map(e=>{let t=B(e);return t.kind===`doc`?u(t.docName,e):t.kind===`folder`?R(Q(t.folderPath,r)):t.kind===`asset`?d(t.assetPath):k(e)}))}function Pe(e,t,n=[],r=[]){return Z(e,t,2**53-1,n,[],r)}function Q(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function Fe(e,t){for(let{fromPath:n,toPath:r}of t)if(e===n)return r;return e}function Ie(e,t,n){if(t!==n)return t;let r=e.indexOf(n);return r<0?e[0]??null:e[r+1]??e[r-1]??null}function Le(e,t,n){if(!t)return null;let r=new Set(n);if(!r.has(t))return t;let i=e.indexOf(t);if(i<0)return e.find(e=>!r.has(e))??null;for(let t=i+1;t<e.length;t++)if(!r.has(e[t]))return e[t];for(let t=i-1;t>=0;t--)if(!r.has(e[t]))return e[t];return null}function Re(e,t){if(typeof e!=`object`||!e)return x();let n=e,r=W(n.openTabs,2**53-1),i=G(n.pinnedTabIds,r),a=i.length===0?W(n.openTabs,t):K(r,t,i),o=G(n.pinnedTabIds,a),s=typeof n.activeTabId==`string`&&a.includes(n.activeTabId)?n.activeTabId:typeof n.activeDocName==`string`&&a.includes(n.activeDocName)?n.activeDocName:null,c=s?B(s):null,l=typeof n.activeTabByMode==`object`&&n.activeTabByMode!==null&&!Array.isArray(n.activeTabByMode)?n.activeTabByMode:{};return{openTabs:a,pinnedTabIds:o,activeDocName:c?.kind===`doc`?c.docName:null,activeTabId:s,activeTabByMode:{files:b(l.files,`files`,a),skills:b(l.skills,`skills`,a)},updatedAt:typeof n.updatedAt==`string`?n.updatedAt:null}}function ze(e,t,n=[],r={files:null,skills:null},i=()=>new Date){let a=W(e,2**53-1),o=t&&a.includes(t)?t:null,s=o?B(o):null;return{openTabs:a,pinnedTabIds:G(n,a),activeDocName:s?.kind===`doc`?s.docName:null,activeTabId:o,activeTabByMode:{files:b(r.files,`files`,a),skills:b(r.skills,`skills`,a)},updatedAt:i().toISOString()}}function Be(e){return`${ye}${e}`}function Ve(e,t,n){if(!e)return x();try{let r=e.getItem(t);return r?Re(JSON.parse(r),n):x()}catch(e){return console.warn(`[editor-tabs] failed to read local tab session:`,e),x()}}function He(e,t,n){if(e)try{e.setItem(t,JSON.stringify(n))}catch(e){console.warn(`[editor-tabs] failed to write local tab session:`,e)}}function Ue(e){return e?e.kind===`skills`||e.kind===`skill-file`||e.kind===`skill-preview`?!0:e.kind===`doc`&&(V(e.docName)||H(e.docName)):!1}function We(e){let t=e.trim();return{normalizedTarget:t.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function Ge(e){return ie(e).replace(/\/+$/g,``)}function Ke(e){let t=new Set;for(let n of e)for(let e of oe(n))t.add(e);return t}function qe(e,t){if(!t)return;let n=p(e);if(n)return t.get(n)}function Je(e,t){if(!t||e.includes(`/`))return;let n=p(e);if(n)return t.get(n)}function Ye(e,t){return t?`${e}${t}`:(e.split(`/`).pop()??``).lastIndexOf(`.`)>0?e:`${e}.md`}function Xe(e,t){if(!ae(e))return null;let r=a(e);if(r)return{kind:`doc`,target:r,docName:r};if(t.pages.has(e))return null;let i=Ye(e,t.docExt);return{kind:`asset`,target:i,assetPath:i,mediaKind:n(i.slice(i.lastIndexOf(`.`)+1))}}function Ze(e,n){if(c(e)){let t=m(e);if(t?.kind===`skill`&&t.scope===`project`){let e=u(t.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}if(y(e))return{kind:`doc`,target:e,docName:e};let r=a(e);if(r)return{kind:`doc`,target:r,docName:r};let{normalizedTarget:i,expectsFolder:o}=We(e);if(!i)return{kind:`missing`,target:i};if(!o&&(t(i)||te(i)))return{kind:`doc`,target:i,docName:i};let s=Ge(e);if(!o&&n.pages.has(i))return{kind:`doc`,target:i,docName:i};if(!o&&s!==i&&n.pages.has(s))return{kind:`doc`,target:s,docName:s};if(!o){let e=qe(s,n.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let l=`${s}/index`;if(n.pages.has(l))return{kind:`folder-index`,target:s,folderPath:s,docName:l,noteKind:`canonical-index`};let d=s.split(`/`).pop(),f=d?`${s}/${d}`:null;if(f&&n.pages.has(f))return{kind:`folder-index`,target:s,folderPath:s,docName:f,noteKind:`legacy-folder-note`};if(!o){let e=Je(s,n.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}if((n.folderPaths??Ke(n.pages)).has(s))return{kind:`folder`,target:s,folderPath:s};if(!o){let e=Xe(i,n);if(e)return e}return{kind:`missing`,target:s||i}}function Qe(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function $(e,t,n=r){return typeof t!=`number`||!f(t,n)?null:{kind:`large-file`,target:e,docName:e,size:t,limit:n}}function $e(e,t,n=r){return e.kind!==`doc`&&e.kind!==`folder-index`?e:$(e.docName,t.get(e.docName)?.size,n)??e}function et(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`skills`:case`skill-preview`:case`folder`:return null}}export{Ve as A,Ce as B,Ie as C,X as D,Ae as E,je as F,ge as G,He as H,J as I,ue as J,he as K,Te as L,Z as M,Q as N,B as O,Pe as P,me as Q,N as R,Be as S,G as T,y as U,Se as V,_e as W,fe as X,le as Y,pe as Z,Ne as _,$ as a,V as b,$e as c,Oe as d,z as f,De as g,L as h,Ue as i,Me as j,Re as k,Y as l,we as m,et as n,Xe as o,ze as p,de as q,Qe as r,Ze as s,Ke as t,q as u,xe as v,Le as w,U as x,R as y,F as z};
1
+ import{Ba as e,Co as t,Do as n,E as r,Ha as i,Ia as a,Ka as o,La as s,Pa as c,Ua as l,Va as u,ba as d,dr as f,ti as p,xa as ee,xo as te,za as m}from"./dist-8iqUcAwa2.js";import{l as ne,o as re,r as ie}from"./doc-paths-Brm31tog.js";import{o as ae,r as oe}from"./file-tree-utils-D-gnyeyb.js";import{o as h}from"./skill-scope-Q1zIQcaf.js";var g=null,_=new Set;function v(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function se(e,t){return e===null?!1:e===t?!0:v(e.pages,t.pages)&&v(e.folderPaths,t.folderPaths)&&v(e.assetPaths??new Set,t.assetPaths??new Set)&&v(e.filePaths??new Set,t.filePaths??new Set)&&ce(e.pageIcons,t.pageIcons)}function ce(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function le(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function ue(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function de(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function fe(){return g}function pe(e){if(!se(g,e)){g=e;for(let t of Array.from(_))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function me(e){if(_.add(e),g!==null)try{e(g)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{_.delete(e)}}function he(e,t){let n=e.replace(/^\/+|\/+$/g,``);return`${d}${n?`${n}/`:``}${t}`}function ge(e){return e.scope===`project`?o(e.path):l(e.scope,e.name)}function _e(e,t){return e.scope===`project`?`${e.path.replace(/\/SKILL\.mdx?$/i,``)}/${o(t)}`:i(e.scope,e.name,t)}function y(t){let n=e(t);return n?.kind===`skill`?n.name:null}function ve(e){return ee.includes(e)}function b(e,t,n){return typeof e!=`string`||!n.includes(e)?null:U(e)===(t===`skills`)?e:null}function x(){return{openTabs:[],pinnedTabIds:[],activeDocName:null,activeTabId:null,activeTabByMode:{files:null,skills:null},updatedAt:null}}var ye=`ok-editor-tabs-v1:`,S=`\0folder:`,C=`\0asset:`,w=`\0skill-file:`,T=`\0skill-preview:`,be=`\0doc-tab:`,E=`skills:hub`,D=/\.(md|mdx)$/i;function O(e){let t=e.lastIndexOf(be);return t<0?{baseTabId:e,instanceSuffix:``}:{baseTabId:e.slice(0,t),instanceSuffix:e.slice(t)}}function k(e){return O(e).baseTabId}function A(e){return D.test(e)?e.replace(D,``):null}function j(e){if(typeof e!=`string`||e.length===0)return!1;let t=k(e);return t.startsWith(S)?t.length>8:t.startsWith(C)?t.length>7:t.startsWith(w)?P(t)!==null:t===E?!1:t.startsWith(T)?I(t)!==null:!0}var M=`:`;function N(e){let t=e.host===void 0?e.name:`${e.name}${M}${e.host}`;return`${w}${e.scope}/${t}/${e.path}`}function P(e){if(!e.startsWith(w))return null;let t=e.slice(12).split(`/`);if(t.length<3)return null;let[n,r,...i]=t,a=i.join(`/`);if(!n||!r||!a||!ve(n))return null;let o=r.indexOf(M),s=o===-1?r:r.slice(0,o),c=o===-1?void 0:r.slice(o+1);return s?{scope:n,name:s,path:a,...c?{host:c}:{}}:null}function F(e){return`${T}${ne(e)}`}function xe(e,t,n,r){for(let i of e){let e=B(i);if(e.kind===`skill-preview`&&e.flavor===t&&e.name===n&&e.level===r)return i}return null}function I(e){return e.startsWith(T)?re(e.slice(15)):null}function L(e){return e}function R(e){return`${S}${e}`}function z(e){return`${C}${e}`}function Se(e,t){let n=y(e);if(n){let e=h(n);return{baseName:e,extension:``,label:e,prefix:``}}let r=s(e);if(r){let e=r.rel?r.rel.split(`/`).pop()??r.rel:h(r.name);return{baseName:e,extension:``,label:e,prefix:``}}let i=e.lastIndexOf(`/`),a=i<0?e:e.slice(i+1),o=D.test(t)&&D.test(a)?``:t,c=`${a}${o}`;return i<0?{baseName:a,extension:o,label:c,prefix:``}:{baseName:a,extension:o,label:c,prefix:`${e.slice(0,i)}/`}}function Ce(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return L(e.docName);case`folder`:return R(e.folderPath);case`missing`:return L(e.target);case`asset`:return z(e.assetPath);case`skill-file`:return N(e);case`skills`:return null;case`skill-preview`:return F(e)}}function B(e){let t=k(e);if(t.startsWith(S))return{kind:`folder`,folderPath:t.slice(8)};if(t.startsWith(C))return{kind:`asset`,assetPath:t.slice(7)};if(t===E)return{kind:`skills`,target:`skills`};let n=I(t);if(n)return{kind:`skill-preview`,...n};let r=P(t);return r?{kind:`skill-file`,...r}:{kind:`doc`,docName:t}}function we(e){let t=B(e);return t.kind===`doc`?t.docName:null}function Te(e,t){return e||t>0}function V(t){return e(t)!=null||m(t)?.kind===`skill`||s(t)!=null}var Ee=/(?:^|\/)skills\/[^/]+\/(?:SKILL|references\/.+)$/;function H(e){return Ee.test(e)}function U(e){let t=B(e);return t.kind===`skills`||t.kind===`skill-file`||t.kind===`skill-preview`||t.kind===`doc`&&(V(t.docName)||H(t.docName))}function W(e,t){if(!Array.isArray(e)||t<=0)return[];let n=[],r=new Set;for(let i of e)if(j(i)&&!r.has(i)&&(r.add(i),n.push(i),n.length>=t))break;return n}function G(e,t){let n=new Set(W(t,2**53-1));return W(e,2**53-1).filter(e=>n.has(e))}function K(e,t,n){if(t<=0)return[];let r=new Set(W(n,2**53-1)),i=W(e,2**53-1);if(r.size===0&&i.length<=t)return i;let a=[],o=0;for(let e=i.length-1;e>=0;e--){let n=i[e];if(r.has(n)){a.push(n);continue}o>=t||(o++,a.push(n))}return a.reverse()}function q(e,t,n){let r=G(e,n);return!W(n,2**53-1).includes(t)||r.includes(t)?r:[...r,t]}function J(e,t){return W(e,2**53-1).filter(e=>e!==t)}function De(e,t){let n=new Set(W(t,2**53-1));return W(e,2**53-1).filter(e=>!n.has(e))}function Oe(e,t,n){let r=W(e,2**53-1),i=G(t,r),a=r.indexOf(n);if(a<0)return i;let o=i.includes(n),s=a<i.length;return o===s?i:s?q(i,n,r):J(i,n)}function Y(e,t,n,r=[]){let i=K(e,n,r);return!j(t)||i.includes(t)?i:K([...i,t],n,r)}function ke(e,t,n,r,i=[]){let a=K(e,r,i);if(!j(n))return a;if(!t||t===n)return Y(a,n,r,i);let o=a.filter(e=>e!==n),s=o.indexOf(t);if(s<0)return Y(o,n,r,i);let c=[...o];return c[s]=n,K(c,r,i)}function Ae(e,t,n){return X(e,L(t),n)}function X(e,t,{behavior:n,currentTabId:r,limit:i,pinnedTabIds:a=[]}){let o=K(e,i,a),s=k(t);if(r&&o.includes(r)&&k(r)===s)return{tabs:o,activeTabId:r};let c=o.find(e=>k(e)===s);return c?{tabs:o,activeTabId:c}:n===`replace-active`?{tabs:ke(o,r,s,i,a),activeTabId:s}:{tabs:Y(o,s,i,a),activeTabId:s}}function je(e,t){return e.filter(e=>e!==t)}function Me(e,t,n){let r=W(t,2**53-1),i=new Set(r),a=new Set(n),o=new Set,s=[];for(let t of e)o.has(t)||!i.has(t)&&!a.has(t)||(o.add(t),s.push(t));for(let e of[...r,...n])o.has(e)||(o.add(e),s.push(e));return s}function Ne(e,{pages:t,folderPaths:n,assetPaths:r,filePaths:i,keepMissingDocName:a=null,keepHashDocName:o=null}){return W(e,2**53-1).filter(e=>{let s=B(e);if(s.kind===`folder`)return n.has(s.folderPath);if(s.kind===`asset`)return r.has(s.assetPath)||i?.has(s.assetPath)===!0;if(s.kind===`skill-file`||s.kind===`skill-preview`)return!0;if(s.kind===`skills`)return!1;let l=A(s.docName);return t.has(s.docName)||l!==null&&t.has(l)||c(s.docName)||s.docName===a||s.docName===o})}function Z(e,t,n,r=[],i=[],a=[]){if(t.length===0&&r.length===0&&a.length===0)return W(e,n);let o=new Map(t.map(e=>[e.fromDocName,e.toDocName])),s=new Map(a.flatMap(e=>{let t=A(e.fromPath);return t?[[t,e.toPath]]:[]})),c=new Map(a.flatMap(e=>{let t=A(e.toPath);return t?[[e.fromPath,t]]:[]})),l=e=>Fe(Q(e,r),a),u=(e,t)=>{let n=o.get(e);if(n)return n;let r=s.get(e);return r?z(r):t},d=e=>{let t=c.get(e);return t?L(t):z(l(e))},f=[],p=new Set;for(let t of e){let{instanceSuffix:e}=O(t),a=B(t),o=`${a.kind===`doc`?u(a.docName,k(t)):a.kind===`folder`?R(Q(a.folderPath,r)):a.kind===`asset`?d(a.assetPath):k(t)}${e}`;if(!p.has(o)&&(p.add(o),f.push(o),i.length===0&&f.length>=n))break}return i.length===0?f:K(f,n,i.map(e=>{let t=B(e);return t.kind===`doc`?u(t.docName,e):t.kind===`folder`?R(Q(t.folderPath,r)):t.kind===`asset`?d(t.assetPath):k(e)}))}function Pe(e,t,n=[],r=[]){return Z(e,t,2**53-1,n,[],r)}function Q(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function Fe(e,t){for(let{fromPath:n,toPath:r}of t)if(e===n)return r;return e}function Ie(e,t,n){if(t!==n)return t;let r=e.indexOf(n);return r<0?e[0]??null:e[r+1]??e[r-1]??null}function Le(e,t,n){if(!t)return null;let r=new Set(n);if(!r.has(t))return t;let i=e.indexOf(t);if(i<0)return e.find(e=>!r.has(e))??null;for(let t=i+1;t<e.length;t++)if(!r.has(e[t]))return e[t];for(let t=i-1;t>=0;t--)if(!r.has(e[t]))return e[t];return null}function Re(e,t){if(typeof e!=`object`||!e)return x();let n=e,r=W(n.openTabs,2**53-1),i=G(n.pinnedTabIds,r),a=i.length===0?W(n.openTabs,t):K(r,t,i),o=G(n.pinnedTabIds,a),s=typeof n.activeTabId==`string`&&a.includes(n.activeTabId)?n.activeTabId:typeof n.activeDocName==`string`&&a.includes(n.activeDocName)?n.activeDocName:null,c=s?B(s):null,l=typeof n.activeTabByMode==`object`&&n.activeTabByMode!==null&&!Array.isArray(n.activeTabByMode)?n.activeTabByMode:{};return{openTabs:a,pinnedTabIds:o,activeDocName:c?.kind===`doc`?c.docName:null,activeTabId:s,activeTabByMode:{files:b(l.files,`files`,a),skills:b(l.skills,`skills`,a)},updatedAt:typeof n.updatedAt==`string`?n.updatedAt:null}}function ze(e,t,n=[],r={files:null,skills:null},i=()=>new Date){let a=W(e,2**53-1),o=t&&a.includes(t)?t:null,s=o?B(o):null;return{openTabs:a,pinnedTabIds:G(n,a),activeDocName:s?.kind===`doc`?s.docName:null,activeTabId:o,activeTabByMode:{files:b(r.files,`files`,a),skills:b(r.skills,`skills`,a)},updatedAt:i().toISOString()}}function Be(e){return`${ye}${e}`}function Ve(e,t,n){if(!e)return x();try{let r=e.getItem(t);return r?Re(JSON.parse(r),n):x()}catch(e){return console.warn(`[editor-tabs] failed to read local tab session:`,e),x()}}function He(e,t,n){if(e)try{e.setItem(t,JSON.stringify(n))}catch(e){console.warn(`[editor-tabs] failed to write local tab session:`,e)}}function Ue(e){return e?e.kind===`skills`||e.kind===`skill-file`||e.kind===`skill-preview`?!0:e.kind===`doc`&&(V(e.docName)||H(e.docName)):!1}function We(e){let t=e.trim();return{normalizedTarget:t.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function Ge(e){return ie(e).replace(/\/+$/g,``)}function Ke(e){let t=new Set;for(let n of e)for(let e of oe(n))t.add(e);return t}function qe(e,t){if(!t)return;let n=p(e);if(n)return t.get(n)}function Je(e,t){if(!t||e.includes(`/`))return;let n=p(e);if(n)return t.get(n)}function Ye(e,t){return t?`${e}${t}`:(e.split(`/`).pop()??``).lastIndexOf(`.`)>0?e:`${e}.md`}function Xe(e,t){if(!ae(e))return null;let r=a(e);if(r)return{kind:`doc`,target:r,docName:r};if(t.pages.has(e))return null;let i=Ye(e,t.docExt);return{kind:`asset`,target:i,assetPath:i,mediaKind:n(i.slice(i.lastIndexOf(`.`)+1))}}function Ze(e,n){if(c(e)){let t=m(e);if(t?.kind===`skill`&&t.scope===`project`){let e=u(t.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}if(y(e))return{kind:`doc`,target:e,docName:e};let r=a(e);if(r)return{kind:`doc`,target:r,docName:r};let{normalizedTarget:i,expectsFolder:o}=We(e);if(!i)return{kind:`missing`,target:i};if(!o&&(t(i)||te(i)))return{kind:`doc`,target:i,docName:i};let s=Ge(e);if(!o&&n.pages.has(i))return{kind:`doc`,target:i,docName:i};if(!o&&s!==i&&n.pages.has(s))return{kind:`doc`,target:s,docName:s};if(!o){let e=qe(s,n.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let l=`${s}/index`;if(n.pages.has(l))return{kind:`folder-index`,target:s,folderPath:s,docName:l,noteKind:`canonical-index`};let d=s.split(`/`).pop(),f=d?`${s}/${d}`:null;if(f&&n.pages.has(f))return{kind:`folder-index`,target:s,folderPath:s,docName:f,noteKind:`legacy-folder-note`};if(!o){let e=Je(s,n.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}if((n.folderPaths??Ke(n.pages)).has(s))return{kind:`folder`,target:s,folderPath:s};if(!o){let e=Xe(i,n);if(e)return e}return{kind:`missing`,target:s||i}}function Qe(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function $(e,t,n=r){return typeof t!=`number`||!f(t,n)?null:{kind:`large-file`,target:e,docName:e,size:t,limit:n}}function $e(e,t,n=r){return e.kind!==`doc`&&e.kind!==`folder-index`?e:$(e.docName,t.get(e.docName)?.size,n)??e}function et(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`skills`:case`skill-preview`:case`folder`:return null}}export{Ve as A,Ce as B,Ie as C,X as D,Ae as E,je as F,ge as G,He as H,J as I,ue as J,he as K,Te as L,Z as M,Q as N,B as O,Pe as P,me as Q,N as R,Be as S,G as T,y as U,Se as V,_e as W,fe as X,le as Y,pe as Z,Ne as _,$ as a,V as b,$e as c,Oe as d,z as f,De as g,L as h,Ue as i,Me as j,Re as k,Y as l,we as m,et as n,Xe as o,ze as p,de as q,Qe as r,Ze as s,Ke as t,q as u,xe as v,Le as w,U as x,R as y,F as z};
@@ -1 +1 @@
1
- import{f as e,h as t}from"./doc-paths-D7j_eEce.js";function n(t){if(typeof window>`u`)return;let n=e(t);window.location.hash!==n&&(window.location.hash=n)}function r(e){if(typeof window>`u`)return;let n=t(e);window.location.hash!==n&&(window.location.hash=n)}export{r as n,n as t};
1
+ import{f as e,h as t}from"./doc-paths-Brm31tog.js";function n(t){if(typeof window>`u`)return;let n=e(t);window.location.hash!==n&&(window.location.hash=n)}function r(e){if(typeof window>`u`)return;let n=t(e);window.location.hash!==n&&(window.location.hash=n)}export{r as n,n 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{t as s}from"./createLucideIcon-DihYAFEK.js";import{c,d as l,i as u,n as d,o as f,p,s as m,t as h}from"./EnableSyncConfirmDialog-wfbNMORg.js";import{t as g}from"./arrow-up-right-CxtRAecj.js";import{t as _}from"./check-BIbL8Vva.js";import{t as v}from"./folder-open-Ceue91os.js";import{t as y}from"./info-BO0f2XRt.js";import{t as b}from"./loader-circle-DJ1nzSAL.js";import{n as x}from"./miss-dialog-store-BGDBpPYJ.js";import{t as S}from"./refresh-cw-s-1Jcbef.js";import{t as C}from"./triangle-alert-aDFrGIbV.js";import{n as w}from"./dist-DmEZHXvB.js";import{_ as T,r as E,s as D}from"./doc-paths-D7j_eEce.js";import{t as O}from"./external-link-COF7NUCm.js";var k=s(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=s(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),j=s(`file-x-corner`,[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]]),M=a(),N=e(n(),1),P=t(),F=`https://git-scm.com/docs/git-push`;function I(e,t){return e===`empty`?!0:!(e!==`stale`&&e!==`absent`||e===`stale`&&t?.syncEnabled===!0)}function L(e){return e?e.state!==`dormant`&&e.state!==`disabled`&&e.state!==`auth-error`&&e.state!==`conflict`:!1}function R(e){let t=(0,M.c)(52),{freshness:n,status:a,kind:s}=e,{_:c}=i(),{confirmOpen:l,setConfirmOpen:p,onToggleRequest:m,onConfirm:v}=u(f()),[b,x]=(0,N.useState)(`idle`),w=(0,N.useRef)(null),T,E;if(t[0]!==a||t[1]!==b?(T=()=>{if(!(b!==`pending`||!a)){if(a.pushError||a.pushErrorCode){x(`idle`);return}(a.lastSyncUtc??null)!==w.current&&x(`synced`)}},E=[b,a],t[0]=a,t[1]=b,t[2]=T,t[3]=E):(T=t[2],E=t[3]),(0,N.useEffect)(T,E),!I(n,a))return null;if(n===`empty`){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[4]=e):e=t[4];let n;t[5]===c?n=t[6]:(n=c({id:`eazHgv`}),t[5]=c,t[6]=n);let r;return t[7]===n?r=t[8]:(r=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[e,(0,P.jsx)(`span`,{children:n})]}),t[7]=n,t[8]=r),r}if(b===`synced`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[(0,P.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:(0,P.jsx)(r,{id:`fxbCNQ`})})]}),t[9]=e):e=t[9],e}let D=a?.syncEnabled===!0,O=a?.pushPermission?.checkStatus===`denied`,k=!!(a?.pushError||a?.pushErrorCode),A=O||k,j=n===`absent`&&!D,R;if(n===`absent`&&!D){let e;t[10]!==c||t[11]!==s?(e=c(s===`folder`?{id:`PrJYSN`}:{id:`3BnyYc`}),t[10]=c,t[11]=s,t[12]=e):e=t[12],R=e}else if(n===`stale`){let e;t[13]!==c||t[14]!==s?(e=c(s===`folder`?{id:`Gt4gOO`}:{id:`2IYGkU`}),t[13]=c,t[14]=s,t[15]=e):e=t[15],R=e}else{let e;t[16]!==c||t[17]!==s?(e=c(s===`folder`?{id:`nqV0Kk`}:{id:`gwykHF`}),t[16]=c,t[17]=s,t[18]=e):e=t[18],R=e}let V;t[19]!==c||t[20]!==k||t[21]!==O?(V=O?c({id:`9OIqw4`}):k?c({id:`K6MQQk`}):null,t[19]=c,t[20]=k,t[21]=O,t[22]=V):V=t[22];let H=V,U;t[23]===a?.lastSyncUtc?U=t[24]:(U=()=>{w.current=a?.lastSyncUtc??null,x(`pending`),d(`sync`).catch(e=>{console.warn(`[share-freshness] sync trigger failed`,e instanceof Error?e.message:e),x(`idle`)})},t[23]=a?.lastSyncUtc,t[24]=U);let W=U,G=j?C:y,K;t[25]===G?K=t[26]:(K=(0,P.jsx)(G,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[25]=G,t[26]=K);let q;t[27]===R?q=t[28]:(q=(0,P.jsx)(`span`,{children:R}),t[27]=R,t[28]=q);let J;t[29]===H?J=t[30]:(J=H?(0,P.jsx)(`span`,{children:H}):null,t[29]=H,t[30]=J);let Y;t[31]!==A||t[32]!==W||t[33]!==m||t[34]!==a||t[35]!==D||t[36]!==b?(Y=A?null:D?L(a)?(0,P.jsx)(`div`,{children:b===`pending`?(0,P.jsxs)(o,{variant:`outline`,size:`xs`,disabled:!0,children:[(0,P.jsx)(S,{className:`size-3 shrink-0 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:W,children:(0,P.jsx)(r,{id:`lb_UU4`})})}):null:(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:()=>m(!0),children:(0,P.jsx)(r,{id:`XU0OXn`})}),(0,P.jsxs)(`a`,{href:F,target:`_blank`,rel:`noopener noreferrer`,onClick:B,onAuxClick:z,className:`inline-flex items-center gap-1 transition-colors hover:text-primary`,children:[(0,P.jsx)(r,{id:`GLxIKR`}),(0,P.jsx)(g,{className:`size-3 shrink-0`,"aria-hidden":`true`})]})]}),t[31]=A,t[32]=W,t[33]=m,t[34]=a,t[35]=D,t[36]=b,t[37]=Y):Y=t[37];let X;t[38]!==q||t[39]!==J||t[40]!==Y?(X=(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[q,J,Y]}),t[38]=q,t[39]=J,t[40]=Y,t[41]=X):X=t[41];let Z;t[42]!==K||t[43]!==X?(Z=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[K,X]}),t[42]=K,t[43]=X,t[44]=Z):Z=t[44];let Q;t[45]!==l||t[46]!==v||t[47]!==p?(Q=(0,P.jsx)(h,{open:l,onOpenChange:p,onConfirm:v}),t[45]=l,t[46]=v,t[47]=p,t[48]=Q):Q=t[48];let $;return t[49]!==Z||t[50]!==Q?($=(0,P.jsxs)(P.Fragment,{children:[Z,Q]}),t[49]=Z,t[50]=Q,t[51]=$):$=t[51],$}function z(e){return O(e,F)}function B(e){return O(e,F)}function V(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function H(e){let t=(0,M.c)(13),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={phase:`pending`},t[0]=n):n=t[0];let[r,i]=(0,N.useState)(n),[a,o]=(0,N.useState)(0),s=e.branch,c;t[1]!==s||t[2]!==e.kind||t[3]!==e.path?(c=()=>{let t=window.okDesktop??null;if(!t||s===null){i({phase:`resolved`,resolution:{verdict:`unknown`}});return}let n=!1;return t.project.fetchTargetStatus({projectPath:t.config.projectPath,branch:s,path:e.path,kind:e.kind}).then(e=>{n||i({phase:`resolved`,resolution:e??{verdict:`unknown`}})}).catch(e=>{n||(console.warn(`[receive] miss target-status fetch failed`,e instanceof Error?e.message:e),i({phase:`resolved`,resolution:{verdict:`unknown`}}))}),()=>{n=!0}},t[1]=s,t[2]=e.kind,t[3]=e.path,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==a||t[7]!==e.kind||t[8]!==e.path?(l=[s,e.kind,e.path,a],t[5]=s,t[6]=a,t[7]=e.kind,t[8]=e.path,t[9]=l):l=t[9],(0,N.useEffect)(c,l);let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{i({phase:`pending`}),o(U)},t[10]=u):u=t[10];let d;return t[11]===r?d=t[12]:(d={state:r,refetch:u},t[11]=r,t[12]=d),d}function U(e){return e+1}function W(e){let t=(0,M.c)(15),{onEnabled:n}=e,i=f(),a;t[0]===n?a=t[1]:(a={onEnabled:n},t[0]=n,t[1]=a);let{confirmOpen:s,setConfirmOpen:c,onToggleRequest:l,onConfirm:d}=u(i,a),p;t[2]===l?p=t[3]:(p=()=>l(!0),t[2]=l,t[3]=p);let m,g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,P.jsx)(S,{className:`size-4`,"aria-hidden":`true`}),g=(0,P.jsx)(r,{id:`XU0OXn`}),t[4]=m,t[5]=g):(m=t[4],g=t[5]);let _;t[6]===p?_=t[7]:(_=(0,P.jsxs)(o,{onClick:p,"data-testid":`share-receive-miss-enable-sync`,children:[m,g]}),t[6]=p,t[7]=_);let v;t[8]!==s||t[9]!==d||t[10]!==c?(v=(0,P.jsx)(h,{open:s,onOpenChange:c,onConfirm:d}),t[8]=s,t[9]=d,t[10]=c,t[11]=v):v=t[11];let y;return t[12]!==_||t[13]!==v?(y=(0,P.jsxs)(P.Fragment,{children:[_,v]}),t[12]=_,t[13]=v,t[14]=y):y=t[14],y}function G(e){let t=(0,M.c)(23),{status:n,onSyncCompleted:a}=e,{_:s}=i(),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),f;t[0]!==a||t[1]!==c||t[2]!==n.lastSyncUtc||t[3]!==n.pushError||t[4]!==n.pushErrorCode?(f=()=>{if(c){if(n.pushError||n.pushErrorCode){l(!1);return}(n.lastSyncUtc??null)!==u.current&&(l(!1),a?.())}},t[0]=a,t[1]=c,t[2]=n.lastSyncUtc,t[3]=n.pushError,t[4]=n.pushErrorCode,t[5]=f):f=t[5];let p;t[6]!==a||t[7]!==c||t[8]!==n?(p=[c,n,a],t[6]=a,t[7]=c,t[8]=n,t[9]=p):p=t[9],(0,N.useEffect)(f,p);let m;t[10]!==s||t[11]!==n.lastSyncUtc?(m=()=>{u.current=n.lastSyncUtc??null,l(!0),d(`sync`).catch(e=>{console.warn(`[receive] miss sync trigger failed`,e instanceof Error?e.message:e),l(!1),w.error(s({id:`1u-mAI`}))})},t[10]=s,t[11]=n.lastSyncUtc,t[12]=m):m=t[12];let h=m,g;t[13]!==h||t[14]!==c?(g=c?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(S,{className:`size-4 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsxs)(o,{onClick:h,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(S,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`lb_UU4`})]}),t[13]=h,t[14]=c,t[15]=g):g=t[15];let _;t[16]===c?_=t[17]:(_=c?(0,P.jsx)(r,{id:`dXOolp`}):null,t[16]=c,t[17]=_);let v;t[18]===_?v=t[19]:(v=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-sync-status`,children:_}),t[18]=_,t[19]=v);let y;return t[20]!==g||t[21]!==v?(y=(0,P.jsxs)(P.Fragment,{children:[g,v]}),t[20]=g,t[21]=v,t[22]=y):y=t[22],y}var K=!1;function q(e){return!K&&e!==null&&e.syncEnabled!==!0}function J(e){return e===null?!1:e.hasRemote&&e.lastPullUtc!==void 0&&e.state!==`conflict`}function Y(e,t){let n=(0,M.c)(15),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),u,f;n[0]!==t||n[1]!==r||n[2]!==e?(u=()=>{if(!r||(e?.lastPullUtc??null)===l.current)return;i(!1);let n=e?.lastPullOutcome??null;if(n===null){t?.();return}switch(n){case`refused`:case`error`:o(n);return;case`succeeded`:case`up-to-date`:if(q(e)){K=!0,c(!0);return}t?.();return;case`conflict`:t?.();return;default:t?.();return}},f=[r,e,t],n[0]=t,n[1]=r,n[2]=e,n[3]=u,n[4]=f):(u=n[3],f=n[4]),(0,N.useEffect)(u,f);let p;n[5]===t?p=n[6]:(p=()=>{c(!1),t?.()},n[5]=t,n[6]=p);let m;n[7]===e?.lastPullUtc?m=n[8]:(m=()=>{l.current=e?.lastPullUtc??null,o(null),i(!0),d(`pull`).catch(e=>{console.warn(`[receive] miss pull trigger failed`,e instanceof Error?e.message:e),i(!1),o(`error`)})},n[7]=e?.lastPullUtc,n[8]=m);let h;return n[9]!==a||n[10]!==s||n[11]!==r||n[12]!==p||n[13]!==m?(h={pending:r,failure:a,offering:s,resolveOffer:p,start:m},n[9]=a,n[10]=s,n[11]=r,n[12]=p,n[13]=m,n[14]=h):h=n[14],h}function X(e){let t=(0,M.c)(10),{pending:n,onPull:i}=e,a;t[0]!==i||t[1]!==n?(a=n?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(S,{className:`size-4 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`4uNLmk`})]}):(0,P.jsxs)(o,{onClick:i,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(p,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`fevEu0`})]}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let s;t[3]===n?s=t[4]:(s=n?(0,P.jsx)(r,{id:`glG1TR`}):null,t[3]=n,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-pull-status`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==a||t[8]!==c?(l=(0,P.jsxs)(P.Fragment,{children:[a,c]}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function Z(e){let t=(0,M.c)(18),{onResolve:n,strandedCommitCount:r}=e,i=c(),a=(0,N.useRef)(!1),o;t[0]===n?o=t[1]:(o=function(){a.current||(a.current=!0,n())},t[0]=n,t[1]=o);let s=o,l;t[2]===s?l=t[3]:(l={onApplied:s},t[2]=s,t[3]=l);let{confirmOpen:u,setConfirmOpen:d,onModeSelect:f,onConfirm:p}=m(i,`off`,l),g=(0,N.useRef)(!1),_,v;t[4]===f?(_=t[5],v=t[6]):(_=()=>{g.current||(g.current=!0,f(`follow`))},v=[f],t[4]=f,t[5]=_,t[6]=v),(0,N.useEffect)(_,v);let y;t[7]!==s||t[8]!==d?(y=e=>{d(e),e||s()},t[7]=s,t[8]=d,t[9]=y):y=t[9];let b;t[10]!==p||t[11]!==s?(b=()=>{p(),s()},t[10]=p,t[11]=s,t[12]=b):b=t[12];let x;return t[13]!==u||t[14]!==r||t[15]!==y||t[16]!==b?(x=(0,P.jsx)(h,{open:u,onOpenChange:y,onConfirm:b,variant:`follow`,strandedCommitCount:r}),t[13]=u,t[14]=r,t[15]=y,t[16]=b,t[17]=x):x=t[17],x}function Q(e){let t=(0,M.c)(89),{nav:n,state:a,onBrowseFolder:s,onOpenRenamed:c,onEnableAutoSync:u,onSyncCompleted:d,onPullApplied:f}=e,{_:m}=i(),h=l(),g=Y(h,f),_=n.branch,y;t[0]!==m||t[1]!==n.kind?(y=n.kind===`folder`?m({id:`ugoTXs`}):m({id:`XH30C4`}),t[0]=m,t[1]=n.kind,t[2]=y):y=t[2];let S=y;if(a.phase===`pending`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(b,{className:`size-5 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`c8jBgX`})]}),t[3]=e):e=t[3],e}let{resolution:C}=a,w,T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,P.jsx)(v,{className:`size-4`,"aria-hidden":`true`}),T=(0,P.jsx)(r,{id:`hItdtk`}),t[4]=w,t[5]=T):(w=t[4],T=t[5]);let E;t[6]===s?E=t[7]:(E=(0,P.jsxs)(o,{variant:`outline`,onClick:s,"data-testid":`share-receive-miss-browse`,children:[w,T]}),t[6]=s,t[7]=E);let D=E,O,N,F,I=null;if(C.verdict===`renamed`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(x,{className:`size-9`,"aria-hidden":`true`}),t[8]=e):e=t[8],O=e;let n;t[9]!==C.renamedTo||t[10]!==S?(n={0:C.renamedTo,targetNoun:S},t[9]=C.renamedTo,t[10]=S,t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[12]=i):i=t[12];let a;t[13]===n?a=t[14]:(a=(0,P.jsx)(r,{id:`P0HC30`,values:n,components:i}),t[13]=n,t[14]=a),N=a;let s;t[15]!==c||t[16]!==C.renamedTo?(s=()=>c(C.renamedTo),t[15]=c,t[16]=C.renamedTo,t[17]=s):s=t[17];let l,u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,P.jsx)(x,{className:`size-4`,"aria-hidden":`true`}),u=(0,P.jsx)(r,{id:`AItsE5`}),t[18]=l,t[19]=u):(l=t[18],u=t[19]);let d;t[20]===s?d=t[21]:(d=(0,P.jsxs)(o,{onClick:s,"data-testid":`share-receive-miss-open-renamed`,children:[l,u]}),t[20]=s,t[21]=d);let f;t[22]!==D||t[23]!==d?(f=(0,P.jsxs)(P.Fragment,{children:[d,D]}),t[22]=D,t[23]=d,t[24]=f):f=t[24],F=f}else if(C.verdict===`deleted`){let e;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(j,{className:`size-9`,"aria-hidden":`true`}),t[25]=e):e=t[25],O=e;let n;t[26]!==_||t[27]!==S?(n={targetNoun:S,branch:_},t[26]=_,t[27]=S,t[28]=n):n=t[28];let i;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[29]=i):i=t[29];let a;t[30]===n?a=t[31]:(a=(0,P.jsx)(r,{id:`kpqWwG`,values:n,components:i}),t[30]=n,t[31]=a),N=a,F=D}else if(C.verdict===`never-on-branch`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(A,{className:`size-9`,"aria-hidden":`true`}),t[32]=e):e=t[32],O=e;let n;t[33]!==_||t[34]!==S?(n={targetNoun:S,branch:_},t[33]=_,t[34]=S,t[35]=n):n=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[36]=i):i=t[36];let a;t[37]===n?a=t[38]:(a=(0,P.jsx)(r,{id:`i9TPUi`,values:n,components:i}),t[37]=n,t[38]=a),N=a,F=D}else if(C.verdict===`changed-locally`){let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(k,{className:`size-9`,"aria-hidden":`true`}),t[39]=e):e=t[39],O=e;let n=h?.syncEnabled===!0,i=h?.pushPermission?.checkStatus===`denied`||!!(h?.pushError||h?.pushErrorCode);if(n){let e;t[40]!==_||t[41]!==S?(e=_===null?(0,P.jsx)(r,{id:`RyIKxy`,values:{targetNoun:S}}):(0,P.jsx)(r,{id:`l6kpzR`,values:{targetNoun:S,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[40]=_,t[41]=S,t[42]=e):e=t[42],N=e}else{let e;t[43]!==_||t[44]!==S?(e=_===null?(0,P.jsx)(r,{id:`UuYo7g`,values:{targetNoun:S}}):(0,P.jsx)(r,{id:`HoWElC`,values:{targetNoun:S,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[43]=_,t[44]=S,t[45]=e):e=t[45],N=e}let a=null;if(h?.syncEnabled){if(L(h)&&!i){let e;t[46]!==d||t[47]!==h?(e=(0,P.jsx)(G,{status:h,onSyncCompleted:d}),t[46]=d,t[47]=h,t[48]=e):e=t[48],a=e}}else if(h!==null){let e;t[49]===u?e=t[50]:(e=(0,P.jsx)(W,{onEnabled:u}),t[49]=u,t[50]=e),a=e}let o;t[51]!==D||t[52]!==a?(o=(0,P.jsxs)(P.Fragment,{children:[a,D]}),t[51]=D,t[52]=a,t[53]=o):o=t[53],F=o}else{let e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(p,{className:`size-9`,"aria-hidden":`true`}),t[54]=e):e=t[54],O=e;let n;t[55]===h?n=t[56]:(n=J(h),t[55]=h,t[56]=n);let i=n;if(i){let e;t[57]===_?e=t[58]:(e=_===null?(0,P.jsx)(r,{id:`gwEcOD`}):(0,P.jsx)(r,{id:`wvK7Ay`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[57]=_,t[58]=e),N=e}else{let e;t[59]===_?e=t[60]:(e=_===null?(0,P.jsx)(r,{id:`Xewl6B`}):(0,P.jsx)(r,{id:`d1JjXo`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[59]=_,t[60]=e),N=e}let a=g.failure===null?`sr-only`:`max-w-md text-balance text-1sm text-destructive`,o;t[61]===g.failure?o=t[62]:(o=g.failure===`refused`?(0,P.jsx)(r,{id:`Xp7Kq4`}):g.failure===`error`?(0,P.jsx)(r,{id:`JG_8KT`}):null,t[61]=g.failure,t[62]=o);let s;t[63]!==a||t[64]!==o?(s=(0,P.jsx)(`p`,{role:`alert`,className:a,"data-testid":`share-receive-miss-pull-error`,children:o}),t[63]=a,t[64]=o,t[65]=s):s=t[65],I=s;let c;t[66]!==i||t[67]!==g.pending||t[68]!==g.start?(c=i?(0,P.jsx)(X,{pending:g.pending,onPull:g.start}):null,t[66]=i,t[67]=g.pending,t[68]=g.start,t[69]=c):c=t[69];let l;t[70]!==g.offering||t[71]!==g.resolveOffer||t[72]!==h?.ahead?(l=g.offering?(0,P.jsx)(Z,{onResolve:g.resolveOffer,strandedCommitCount:h?.ahead??0}):null,t[70]=g.offering,t[71]=g.resolveOffer,t[72]=h?.ahead,t[73]=l):l=t[73];let u;t[74]!==D||t[75]!==c||t[76]!==l?(u=(0,P.jsxs)(P.Fragment,{children:[c,D,l]}),t[74]=D,t[75]=c,t[76]=l,t[77]=u):u=t[77],F=u}let R;t[78]===O?R=t[79]:(R=(0,P.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:O}),t[78]=O,t[79]=R);let z;t[80]===N?z=t[81]:(z=(0,P.jsx)(`p`,{className:`max-w-md text-balance text-base leading-6 text-foreground/90`,children:N}),t[80]=N,t[81]=z);let B;t[82]===F?B=t[83]:(B=(0,P.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-center`,children:F}),t[82]=F,t[83]=B);let V;return t[84]!==I||t[85]!==R||t[86]!==z||t[87]!==B?(V=(0,P.jsxs)(P.Fragment,{children:[R,z,I,B]}),t[84]=I,t[85]=R,t[86]=z,t[87]=B,t[88]=V):V=t[88],V}function $(e){return e.replace(/^\/+|\/+$/g,``)}function ee(e,t){if(t.kind===`folder`){if(T(e))return $(t.path)===``;let n=D(e);return n!==null&&$(n)===$(t.path)}let n=D(e);return n===null?!1:E(n)===E(t.path)}function te(){let e=null,t=new Set,n=!1;function r(){for(let e of t)e()}function i(t){e!==t&&(e=t,r())}function a(){e!==null&&(ee(window.location.hash,e)||i(null))}function o(){n||typeof window>`u`||(n=!0,window.addEventListener(`hashchange`,a))}return{arm(e){o(),i(e)},clear(){i(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dispose(){n&&typeof window<`u`&&(window.removeEventListener(`hashchange`,a),n=!1),i(null)}}}var ne=te();function re(e,t){return e===null||e.kind!==`missing`||t===null||E(t.path)!==e.target?null:t}export{H as a,V as i,ne as n,R as o,Q as r,I as s,re 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{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-RQ5o7P7w.js";import{t as s}from"./createLucideIcon-DihYAFEK.js";import{c,d as l,i as u,n as d,o as f,p,s as m,t as h}from"./EnableSyncConfirmDialog-DaRwi97i.js";import{t as g}from"./arrow-up-right-CxtRAecj.js";import{t as _}from"./check-BIbL8Vva.js";import{t as v}from"./folder-open-Ceue91os.js";import{t as y}from"./info-BO0f2XRt.js";import{t as b}from"./loader-circle-DJ1nzSAL.js";import{n as x}from"./miss-dialog-store-BGDBpPYJ.js";import{t as S}from"./refresh-cw-s-1Jcbef.js";import{t as C}from"./triangle-alert-aDFrGIbV.js";import{n as w}from"./dist-DmEZHXvB.js";import{_ as T,r as E,s as D}from"./doc-paths-Brm31tog.js";import{t as O}from"./external-link-COF7NUCm.js";var k=s(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=s(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),j=s(`file-x-corner`,[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]]),M=a(),N=e(n(),1),P=t(),F=`https://git-scm.com/docs/git-push`;function I(e,t){return e===`empty`?!0:!(e!==`stale`&&e!==`absent`||e===`stale`&&t?.syncEnabled===!0)}function L(e){return e?e.state!==`dormant`&&e.state!==`disabled`&&e.state!==`auth-error`&&e.state!==`conflict`:!1}function R(e){let t=(0,M.c)(52),{freshness:n,status:a,kind:s}=e,{_:c}=i(),{confirmOpen:l,setConfirmOpen:p,onToggleRequest:m,onConfirm:v}=u(f()),[b,x]=(0,N.useState)(`idle`),w=(0,N.useRef)(null),T,E;if(t[0]!==a||t[1]!==b?(T=()=>{if(!(b!==`pending`||!a)){if(a.pushError||a.pushErrorCode){x(`idle`);return}(a.lastSyncUtc??null)!==w.current&&x(`synced`)}},E=[b,a],t[0]=a,t[1]=b,t[2]=T,t[3]=E):(T=t[2],E=t[3]),(0,N.useEffect)(T,E),!I(n,a))return null;if(n===`empty`){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[4]=e):e=t[4];let n;t[5]===c?n=t[6]:(n=c({id:`eazHgv`}),t[5]=c,t[6]=n);let r;return t[7]===n?r=t[8]:(r=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[e,(0,P.jsx)(`span`,{children:n})]}),t[7]=n,t[8]=r),r}if(b===`synced`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[(0,P.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:(0,P.jsx)(r,{id:`fxbCNQ`})})]}),t[9]=e):e=t[9],e}let D=a?.syncEnabled===!0,O=a?.pushPermission?.checkStatus===`denied`,k=!!(a?.pushError||a?.pushErrorCode),A=O||k,j=n===`absent`&&!D,R;if(n===`absent`&&!D){let e;t[10]!==c||t[11]!==s?(e=c(s===`folder`?{id:`PrJYSN`}:{id:`3BnyYc`}),t[10]=c,t[11]=s,t[12]=e):e=t[12],R=e}else if(n===`stale`){let e;t[13]!==c||t[14]!==s?(e=c(s===`folder`?{id:`Gt4gOO`}:{id:`2IYGkU`}),t[13]=c,t[14]=s,t[15]=e):e=t[15],R=e}else{let e;t[16]!==c||t[17]!==s?(e=c(s===`folder`?{id:`nqV0Kk`}:{id:`gwykHF`}),t[16]=c,t[17]=s,t[18]=e):e=t[18],R=e}let V;t[19]!==c||t[20]!==k||t[21]!==O?(V=O?c({id:`9OIqw4`}):k?c({id:`K6MQQk`}):null,t[19]=c,t[20]=k,t[21]=O,t[22]=V):V=t[22];let H=V,U;t[23]===a?.lastSyncUtc?U=t[24]:(U=()=>{w.current=a?.lastSyncUtc??null,x(`pending`),d(`sync`).catch(e=>{console.warn(`[share-freshness] sync trigger failed`,e instanceof Error?e.message:e),x(`idle`)})},t[23]=a?.lastSyncUtc,t[24]=U);let W=U,G=j?C:y,K;t[25]===G?K=t[26]:(K=(0,P.jsx)(G,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[25]=G,t[26]=K);let q;t[27]===R?q=t[28]:(q=(0,P.jsx)(`span`,{children:R}),t[27]=R,t[28]=q);let J;t[29]===H?J=t[30]:(J=H?(0,P.jsx)(`span`,{children:H}):null,t[29]=H,t[30]=J);let Y;t[31]!==A||t[32]!==W||t[33]!==m||t[34]!==a||t[35]!==D||t[36]!==b?(Y=A?null:D?L(a)?(0,P.jsx)(`div`,{children:b===`pending`?(0,P.jsxs)(o,{variant:`outline`,size:`xs`,disabled:!0,children:[(0,P.jsx)(S,{className:`size-3 shrink-0 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:W,children:(0,P.jsx)(r,{id:`lb_UU4`})})}):null:(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:()=>m(!0),children:(0,P.jsx)(r,{id:`XU0OXn`})}),(0,P.jsxs)(`a`,{href:F,target:`_blank`,rel:`noopener noreferrer`,onClick:B,onAuxClick:z,className:`inline-flex items-center gap-1 transition-colors hover:text-primary`,children:[(0,P.jsx)(r,{id:`GLxIKR`}),(0,P.jsx)(g,{className:`size-3 shrink-0`,"aria-hidden":`true`})]})]}),t[31]=A,t[32]=W,t[33]=m,t[34]=a,t[35]=D,t[36]=b,t[37]=Y):Y=t[37];let X;t[38]!==q||t[39]!==J||t[40]!==Y?(X=(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[q,J,Y]}),t[38]=q,t[39]=J,t[40]=Y,t[41]=X):X=t[41];let Z;t[42]!==K||t[43]!==X?(Z=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[K,X]}),t[42]=K,t[43]=X,t[44]=Z):Z=t[44];let Q;t[45]!==l||t[46]!==v||t[47]!==p?(Q=(0,P.jsx)(h,{open:l,onOpenChange:p,onConfirm:v}),t[45]=l,t[46]=v,t[47]=p,t[48]=Q):Q=t[48];let $;return t[49]!==Z||t[50]!==Q?($=(0,P.jsxs)(P.Fragment,{children:[Z,Q]}),t[49]=Z,t[50]=Q,t[51]=$):$=t[51],$}function z(e){return O(e,F)}function B(e){return O(e,F)}function V(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function H(e){let t=(0,M.c)(13),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={phase:`pending`},t[0]=n):n=t[0];let[r,i]=(0,N.useState)(n),[a,o]=(0,N.useState)(0),s=e.branch,c;t[1]!==s||t[2]!==e.kind||t[3]!==e.path?(c=()=>{let t=window.okDesktop??null;if(!t||s===null){i({phase:`resolved`,resolution:{verdict:`unknown`}});return}let n=!1;return t.project.fetchTargetStatus({projectPath:t.config.projectPath,branch:s,path:e.path,kind:e.kind}).then(e=>{n||i({phase:`resolved`,resolution:e??{verdict:`unknown`}})}).catch(e=>{n||(console.warn(`[receive] miss target-status fetch failed`,e instanceof Error?e.message:e),i({phase:`resolved`,resolution:{verdict:`unknown`}}))}),()=>{n=!0}},t[1]=s,t[2]=e.kind,t[3]=e.path,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==a||t[7]!==e.kind||t[8]!==e.path?(l=[s,e.kind,e.path,a],t[5]=s,t[6]=a,t[7]=e.kind,t[8]=e.path,t[9]=l):l=t[9],(0,N.useEffect)(c,l);let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{i({phase:`pending`}),o(U)},t[10]=u):u=t[10];let d;return t[11]===r?d=t[12]:(d={state:r,refetch:u},t[11]=r,t[12]=d),d}function U(e){return e+1}function W(e){let t=(0,M.c)(15),{onEnabled:n}=e,i=f(),a;t[0]===n?a=t[1]:(a={onEnabled:n},t[0]=n,t[1]=a);let{confirmOpen:s,setConfirmOpen:c,onToggleRequest:l,onConfirm:d}=u(i,a),p;t[2]===l?p=t[3]:(p=()=>l(!0),t[2]=l,t[3]=p);let m,g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,P.jsx)(S,{className:`size-4`,"aria-hidden":`true`}),g=(0,P.jsx)(r,{id:`XU0OXn`}),t[4]=m,t[5]=g):(m=t[4],g=t[5]);let _;t[6]===p?_=t[7]:(_=(0,P.jsxs)(o,{onClick:p,"data-testid":`share-receive-miss-enable-sync`,children:[m,g]}),t[6]=p,t[7]=_);let v;t[8]!==s||t[9]!==d||t[10]!==c?(v=(0,P.jsx)(h,{open:s,onOpenChange:c,onConfirm:d}),t[8]=s,t[9]=d,t[10]=c,t[11]=v):v=t[11];let y;return t[12]!==_||t[13]!==v?(y=(0,P.jsxs)(P.Fragment,{children:[_,v]}),t[12]=_,t[13]=v,t[14]=y):y=t[14],y}function G(e){let t=(0,M.c)(23),{status:n,onSyncCompleted:a}=e,{_:s}=i(),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),f;t[0]!==a||t[1]!==c||t[2]!==n.lastSyncUtc||t[3]!==n.pushError||t[4]!==n.pushErrorCode?(f=()=>{if(c){if(n.pushError||n.pushErrorCode){l(!1);return}(n.lastSyncUtc??null)!==u.current&&(l(!1),a?.())}},t[0]=a,t[1]=c,t[2]=n.lastSyncUtc,t[3]=n.pushError,t[4]=n.pushErrorCode,t[5]=f):f=t[5];let p;t[6]!==a||t[7]!==c||t[8]!==n?(p=[c,n,a],t[6]=a,t[7]=c,t[8]=n,t[9]=p):p=t[9],(0,N.useEffect)(f,p);let m;t[10]!==s||t[11]!==n.lastSyncUtc?(m=()=>{u.current=n.lastSyncUtc??null,l(!0),d(`sync`).catch(e=>{console.warn(`[receive] miss sync trigger failed`,e instanceof Error?e.message:e),l(!1),w.error(s({id:`1u-mAI`}))})},t[10]=s,t[11]=n.lastSyncUtc,t[12]=m):m=t[12];let h=m,g;t[13]!==h||t[14]!==c?(g=c?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(S,{className:`size-4 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsxs)(o,{onClick:h,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(S,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`lb_UU4`})]}),t[13]=h,t[14]=c,t[15]=g):g=t[15];let _;t[16]===c?_=t[17]:(_=c?(0,P.jsx)(r,{id:`dXOolp`}):null,t[16]=c,t[17]=_);let v;t[18]===_?v=t[19]:(v=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-sync-status`,children:_}),t[18]=_,t[19]=v);let y;return t[20]!==g||t[21]!==v?(y=(0,P.jsxs)(P.Fragment,{children:[g,v]}),t[20]=g,t[21]=v,t[22]=y):y=t[22],y}var K=!1;function q(e){return!K&&e!==null&&e.syncEnabled!==!0}function J(e){return e===null?!1:e.hasRemote&&e.lastPullUtc!==void 0&&e.state!==`conflict`}function Y(e,t){let n=(0,M.c)(15),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),u,f;n[0]!==t||n[1]!==r||n[2]!==e?(u=()=>{if(!r||(e?.lastPullUtc??null)===l.current)return;i(!1);let n=e?.lastPullOutcome??null;if(n===null){t?.();return}switch(n){case`refused`:case`error`:o(n);return;case`succeeded`:case`up-to-date`:if(q(e)){K=!0,c(!0);return}t?.();return;case`conflict`:t?.();return;default:t?.();return}},f=[r,e,t],n[0]=t,n[1]=r,n[2]=e,n[3]=u,n[4]=f):(u=n[3],f=n[4]),(0,N.useEffect)(u,f);let p;n[5]===t?p=n[6]:(p=()=>{c(!1),t?.()},n[5]=t,n[6]=p);let m;n[7]===e?.lastPullUtc?m=n[8]:(m=()=>{l.current=e?.lastPullUtc??null,o(null),i(!0),d(`pull`).catch(e=>{console.warn(`[receive] miss pull trigger failed`,e instanceof Error?e.message:e),i(!1),o(`error`)})},n[7]=e?.lastPullUtc,n[8]=m);let h;return n[9]!==a||n[10]!==s||n[11]!==r||n[12]!==p||n[13]!==m?(h={pending:r,failure:a,offering:s,resolveOffer:p,start:m},n[9]=a,n[10]=s,n[11]=r,n[12]=p,n[13]=m,n[14]=h):h=n[14],h}function X(e){let t=(0,M.c)(10),{pending:n,onPull:i}=e,a;t[0]!==i||t[1]!==n?(a=n?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(S,{className:`size-4 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`4uNLmk`})]}):(0,P.jsxs)(o,{onClick:i,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(p,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`fevEu0`})]}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let s;t[3]===n?s=t[4]:(s=n?(0,P.jsx)(r,{id:`glG1TR`}):null,t[3]=n,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-pull-status`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==a||t[8]!==c?(l=(0,P.jsxs)(P.Fragment,{children:[a,c]}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function Z(e){let t=(0,M.c)(18),{onResolve:n,strandedCommitCount:r}=e,i=c(),a=(0,N.useRef)(!1),o;t[0]===n?o=t[1]:(o=function(){a.current||(a.current=!0,n())},t[0]=n,t[1]=o);let s=o,l;t[2]===s?l=t[3]:(l={onApplied:s},t[2]=s,t[3]=l);let{confirmOpen:u,setConfirmOpen:d,onModeSelect:f,onConfirm:p}=m(i,`off`,l),g=(0,N.useRef)(!1),_,v;t[4]===f?(_=t[5],v=t[6]):(_=()=>{g.current||(g.current=!0,f(`follow`))},v=[f],t[4]=f,t[5]=_,t[6]=v),(0,N.useEffect)(_,v);let y;t[7]!==s||t[8]!==d?(y=e=>{d(e),e||s()},t[7]=s,t[8]=d,t[9]=y):y=t[9];let b;t[10]!==p||t[11]!==s?(b=()=>{p(),s()},t[10]=p,t[11]=s,t[12]=b):b=t[12];let x;return t[13]!==u||t[14]!==r||t[15]!==y||t[16]!==b?(x=(0,P.jsx)(h,{open:u,onOpenChange:y,onConfirm:b,variant:`follow`,strandedCommitCount:r}),t[13]=u,t[14]=r,t[15]=y,t[16]=b,t[17]=x):x=t[17],x}function Q(e){let t=(0,M.c)(89),{nav:n,state:a,onBrowseFolder:s,onOpenRenamed:c,onEnableAutoSync:u,onSyncCompleted:d,onPullApplied:f}=e,{_:m}=i(),h=l(),g=Y(h,f),_=n.branch,y;t[0]!==m||t[1]!==n.kind?(y=n.kind===`folder`?m({id:`ugoTXs`}):m({id:`XH30C4`}),t[0]=m,t[1]=n.kind,t[2]=y):y=t[2];let S=y;if(a.phase===`pending`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(b,{className:`size-5 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`c8jBgX`})]}),t[3]=e):e=t[3],e}let{resolution:C}=a,w,T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,P.jsx)(v,{className:`size-4`,"aria-hidden":`true`}),T=(0,P.jsx)(r,{id:`hItdtk`}),t[4]=w,t[5]=T):(w=t[4],T=t[5]);let E;t[6]===s?E=t[7]:(E=(0,P.jsxs)(o,{variant:`outline`,onClick:s,"data-testid":`share-receive-miss-browse`,children:[w,T]}),t[6]=s,t[7]=E);let D=E,O,N,F,I=null;if(C.verdict===`renamed`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(x,{className:`size-9`,"aria-hidden":`true`}),t[8]=e):e=t[8],O=e;let n;t[9]!==C.renamedTo||t[10]!==S?(n={0:C.renamedTo,targetNoun:S},t[9]=C.renamedTo,t[10]=S,t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[12]=i):i=t[12];let a;t[13]===n?a=t[14]:(a=(0,P.jsx)(r,{id:`P0HC30`,values:n,components:i}),t[13]=n,t[14]=a),N=a;let s;t[15]!==c||t[16]!==C.renamedTo?(s=()=>c(C.renamedTo),t[15]=c,t[16]=C.renamedTo,t[17]=s):s=t[17];let l,u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,P.jsx)(x,{className:`size-4`,"aria-hidden":`true`}),u=(0,P.jsx)(r,{id:`AItsE5`}),t[18]=l,t[19]=u):(l=t[18],u=t[19]);let d;t[20]===s?d=t[21]:(d=(0,P.jsxs)(o,{onClick:s,"data-testid":`share-receive-miss-open-renamed`,children:[l,u]}),t[20]=s,t[21]=d);let f;t[22]!==D||t[23]!==d?(f=(0,P.jsxs)(P.Fragment,{children:[d,D]}),t[22]=D,t[23]=d,t[24]=f):f=t[24],F=f}else if(C.verdict===`deleted`){let e;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(j,{className:`size-9`,"aria-hidden":`true`}),t[25]=e):e=t[25],O=e;let n;t[26]!==_||t[27]!==S?(n={targetNoun:S,branch:_},t[26]=_,t[27]=S,t[28]=n):n=t[28];let i;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[29]=i):i=t[29];let a;t[30]===n?a=t[31]:(a=(0,P.jsx)(r,{id:`kpqWwG`,values:n,components:i}),t[30]=n,t[31]=a),N=a,F=D}else if(C.verdict===`never-on-branch`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(A,{className:`size-9`,"aria-hidden":`true`}),t[32]=e):e=t[32],O=e;let n;t[33]!==_||t[34]!==S?(n={targetNoun:S,branch:_},t[33]=_,t[34]=S,t[35]=n):n=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[36]=i):i=t[36];let a;t[37]===n?a=t[38]:(a=(0,P.jsx)(r,{id:`i9TPUi`,values:n,components:i}),t[37]=n,t[38]=a),N=a,F=D}else if(C.verdict===`changed-locally`){let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(k,{className:`size-9`,"aria-hidden":`true`}),t[39]=e):e=t[39],O=e;let n=h?.syncEnabled===!0,i=h?.pushPermission?.checkStatus===`denied`||!!(h?.pushError||h?.pushErrorCode);if(n){let e;t[40]!==_||t[41]!==S?(e=_===null?(0,P.jsx)(r,{id:`RyIKxy`,values:{targetNoun:S}}):(0,P.jsx)(r,{id:`l6kpzR`,values:{targetNoun:S,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[40]=_,t[41]=S,t[42]=e):e=t[42],N=e}else{let e;t[43]!==_||t[44]!==S?(e=_===null?(0,P.jsx)(r,{id:`UuYo7g`,values:{targetNoun:S}}):(0,P.jsx)(r,{id:`HoWElC`,values:{targetNoun:S,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[43]=_,t[44]=S,t[45]=e):e=t[45],N=e}let a=null;if(h?.syncEnabled){if(L(h)&&!i){let e;t[46]!==d||t[47]!==h?(e=(0,P.jsx)(G,{status:h,onSyncCompleted:d}),t[46]=d,t[47]=h,t[48]=e):e=t[48],a=e}}else if(h!==null){let e;t[49]===u?e=t[50]:(e=(0,P.jsx)(W,{onEnabled:u}),t[49]=u,t[50]=e),a=e}let o;t[51]!==D||t[52]!==a?(o=(0,P.jsxs)(P.Fragment,{children:[a,D]}),t[51]=D,t[52]=a,t[53]=o):o=t[53],F=o}else{let e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(p,{className:`size-9`,"aria-hidden":`true`}),t[54]=e):e=t[54],O=e;let n;t[55]===h?n=t[56]:(n=J(h),t[55]=h,t[56]=n);let i=n;if(i){let e;t[57]===_?e=t[58]:(e=_===null?(0,P.jsx)(r,{id:`gwEcOD`}):(0,P.jsx)(r,{id:`wvK7Ay`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[57]=_,t[58]=e),N=e}else{let e;t[59]===_?e=t[60]:(e=_===null?(0,P.jsx)(r,{id:`Xewl6B`}):(0,P.jsx)(r,{id:`d1JjXo`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[59]=_,t[60]=e),N=e}let a=g.failure===null?`sr-only`:`max-w-md text-balance text-1sm text-destructive`,o;t[61]===g.failure?o=t[62]:(o=g.failure===`refused`?(0,P.jsx)(r,{id:`Xp7Kq4`}):g.failure===`error`?(0,P.jsx)(r,{id:`JG_8KT`}):null,t[61]=g.failure,t[62]=o);let s;t[63]!==a||t[64]!==o?(s=(0,P.jsx)(`p`,{role:`alert`,className:a,"data-testid":`share-receive-miss-pull-error`,children:o}),t[63]=a,t[64]=o,t[65]=s):s=t[65],I=s;let c;t[66]!==i||t[67]!==g.pending||t[68]!==g.start?(c=i?(0,P.jsx)(X,{pending:g.pending,onPull:g.start}):null,t[66]=i,t[67]=g.pending,t[68]=g.start,t[69]=c):c=t[69];let l;t[70]!==g.offering||t[71]!==g.resolveOffer||t[72]!==h?.ahead?(l=g.offering?(0,P.jsx)(Z,{onResolve:g.resolveOffer,strandedCommitCount:h?.ahead??0}):null,t[70]=g.offering,t[71]=g.resolveOffer,t[72]=h?.ahead,t[73]=l):l=t[73];let u;t[74]!==D||t[75]!==c||t[76]!==l?(u=(0,P.jsxs)(P.Fragment,{children:[c,D,l]}),t[74]=D,t[75]=c,t[76]=l,t[77]=u):u=t[77],F=u}let R;t[78]===O?R=t[79]:(R=(0,P.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:O}),t[78]=O,t[79]=R);let z;t[80]===N?z=t[81]:(z=(0,P.jsx)(`p`,{className:`max-w-md text-balance text-base leading-6 text-foreground/90`,children:N}),t[80]=N,t[81]=z);let B;t[82]===F?B=t[83]:(B=(0,P.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-center`,children:F}),t[82]=F,t[83]=B);let V;return t[84]!==I||t[85]!==R||t[86]!==z||t[87]!==B?(V=(0,P.jsxs)(P.Fragment,{children:[R,z,I,B]}),t[84]=I,t[85]=R,t[86]=z,t[87]=B,t[88]=V):V=t[88],V}function $(e){return e.replace(/^\/+|\/+$/g,``)}function ee(e,t){if(t.kind===`folder`){if(T(e))return $(t.path)===``;let n=D(e);return n!==null&&$(n)===$(t.path)}let n=D(e);return n===null?!1:E(n)===E(t.path)}function te(){let e=null,t=new Set,n=!1;function r(){for(let e of t)e()}function i(t){e!==t&&(e=t,r())}function a(){e!==null&&(ee(window.location.hash,e)||i(null))}function o(){n||typeof window>`u`||(n=!0,window.addEventListener(`hashchange`,a))}return{arm(e){o(),i(e)},clear(){i(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dispose(){n&&typeof window<`u`&&(window.removeEventListener(`hashchange`,a),n=!1),i(null)}}}var ne=te();function re(e,t){return e===null||e.kind!==`missing`||t===null||E(t.path)!==e.target?null:t}export{H as a,V as i,ne as n,R as o,Q as r,I as s,re as t};
@@ -1 +1 @@
1
- import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{ti as a}from"./dist-CLzUuFWF2.js";import{t as o}from"./createLucideIcon-DihYAFEK.js";import{t as s}from"./parse-api-error-BFe1cdS7.js";import{J as ee,Y as te,Z as c,q as ne,t as l}from"./navigation-targets-CBDcAPCE.js";import{d as re}from"./documents-events-BXEDUEK0.js";import{t as u}from"./documents-fetch-DK-kdvYE.js";import{r as ie}from"./startup-marks-BJYEMeGu.js";var d=o(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),f=o(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),p=e(r(),1),ae=i();function m(e,t){let n=!1,r=!1,i=!1;async function a(){if(!i){n=!0;try{await e()}finally{n=!1,i?r=!1:r&&(r=!1,a())}}}return{request(){if(!i){if(n){r=!0,t?.();return}a()}},dispose(){i=!0,r=!1,t?.()}}}var oe=n(),h=(0,p.createContext)(null);function se(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function ce(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function g(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function le(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(s(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function ue(){let{ok:e,status:t,body:n}=await u();if(!e)throw Error(s(n)??`/api/documents responded with ${t}`);let r=n??{};return Array.isArray(r.documents)?{assetPaths:r.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:r.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),filePaths:r.documents.filter(e=>e.kind===`file`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[],filePaths:[]}}function de(e){console.error(`[PageListContext] Failed to load pages:`,e)}function _(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function v(e){let t=(0,ae.c)(54),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,o]=(0,p.useState)(r),s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=new Map,t[1]=s):s=t[1];let[u,d]=(0,p.useState)(s),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Map,t[2]=f):f=t[2];let[_,v]=(0,p.useState)(f),y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Set,t[3]=y):y=t[3];let[b,x]=(0,p.useState)(y),S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=new Set,t[4]=S):S=t[4];let[C,ge]=(0,p.useState)(S),w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=new Set,t[5]=w):w=t[5];let[T,_e]=(0,p.useState)(w),E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=new Set,t[6]=E):E=t[6];let[D,O]=(0,p.useState)(E),[k,A]=(0,p.useState)(!0),[j,M]=(0,p.useState)(null),N=(0,p.useRef)(0),P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(){let e=N.current+=1;return Promise.all([le(),ue().catch(he)]).then(t=>{let[n,r]=t;if(e!==N.current)return;let i=new Set(n.map(me));o(i),d(new Map(n.map(pe))),v(new Map(n.map(fe))),x(new Set(r.assetPaths)),ge(new Set(r.folderPaths)),_e(new Set(r.filePaths)),O(e=>ce(e,i)),M(null),ie()}).catch(t=>{e===N.current&&(de(t),M(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===N.current&&A(!1)})},t[7]=P):P=t[7];let F=P,I;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){O(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),M(null)},t[8]=I):I=t[8];let ve=I,L,R;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{let e=m(F);e.request();let t=null,n=()=>{document.visibilityState===`visible`&&e.request()};window.addEventListener(`focus`,n),window.addEventListener(`visibilitychange`,n);let r=re(n=>{n.includes(`files`)&&t===null&&(t=setTimeout(()=>{t=null,e.request()},300))});return()=>{t!==null&&clearTimeout(t),e.dispose(),window.removeEventListener(`focus`,n),window.removeEventListener(`visibilitychange`,n),r()}},R=[],t[9]=L,t[10]=R):(L=t[9],R=t[10]),(0,p.useEffect)(L,R);let z,B,V,H,U,W,G,K;if(t[11]!==D||t[12]!==b||t[13]!==T||t[14]!==C||t[15]!==_||t[16]!==u||t[17]!==i){W=se(i,D);let e;t[26]!==D||t[27]!==u?(e=g(u,D),t[26]=D,t[27]=u,t[28]=e):e=t[28],U=e,H=_,z=b,B=T,V=new Set([...l(W),...C]),G=te(W,a),K=ee(W,a),t[11]=D,t[12]=b,t[13]=T,t[14]=C,t[15]=_,t[16]=u,t[17]=i,t[18]=z,t[19]=B,t[20]=V,t[21]=H,t[22]=U,t[23]=W,t[24]=G,t[25]=K}else z=t[18],B=t[19],V=t[20],H=t[21],U=t[22],W=t[23],G=t[24],K=t[25];let q=K,J;t[29]===_?J=t[30]:(J=ne(_),t[29]=_,t[30]=J);let Y=J,X,Z;t[31]!==z||t[32]!==B||t[33]!==V||t[34]!==Y||t[35]!==W||t[36]!==q||t[37]!==G?(X=()=>{c({pages:W,folderPaths:V,pagesBySlug:G,pagesByBasename:q,assetPaths:z,filePaths:B,pageIcons:Y})},Z=[W,V,G,q,z,B,Y],t[31]=z,t[32]=B,t[33]=V,t[34]=Y,t[35]=W,t[36]=q,t[37]=G,t[38]=X,t[39]=Z):(X=t[38],Z=t[39]),(0,p.useEffect)(X,Z);let Q;t[40]!==z||t[41]!==j||t[42]!==B||t[43]!==V||t[44]!==k||t[45]!==H||t[46]!==U||t[47]!==W||t[48]!==q||t[49]!==G?(Q={pages:W,pagesBySlug:G,pagesByBasename:q,pageTitles:U,pageMeta:H,folderPaths:V,assetPaths:z,filePaths:B,loading:k,error:j,refetch:F,addPage:ve},t[40]=z,t[41]=j,t[42]=B,t[43]=V,t[44]=k,t[45]=H,t[46]=U,t[47]=W,t[48]=q,t[49]=G,t[50]=Q):Q=t[50];let $;return t[51]!==n||t[52]!==Q?($=(0,oe.jsx)(h,{value:Q,children:n}),t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}function fe(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function pe(e){return[e.docName,e.title]}function me(e){return e.docName}function he(e){return _(e),{assetPaths:[],folderPaths:[],filePaths:[]}}function y(){let e=(0,p.use)(h);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function b(){return(0,p.use)(h)}var x=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),S=t(((e,t)=>{var n=x();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),C=t(((e,t)=>{t.exports=S()()}));export{m as a,y as i,v as n,f as o,b as r,d as s,C as t};
1
+ import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{ti as a}from"./dist-8iqUcAwa2.js";import{t as o}from"./createLucideIcon-DihYAFEK.js";import{t as s}from"./parse-api-error-BFe1cdS7.js";import{J as ee,Y as te,Z as c,q as ne,t as l}from"./navigation-targets-CgKIg62o.js";import{d as re}from"./documents-events-DG_D787e.js";import{t as u}from"./documents-fetch-DK-kdvYE.js";import{r as ie}from"./startup-marks-BJYEMeGu.js";var d=o(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),f=o(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),p=e(r(),1),ae=i();function m(e,t){let n=!1,r=!1,i=!1;async function a(){if(!i){n=!0;try{await e()}finally{n=!1,i?r=!1:r&&(r=!1,a())}}}return{request(){if(!i){if(n){r=!0,t?.();return}a()}},dispose(){i=!0,r=!1,t?.()}}}var oe=n(),h=(0,p.createContext)(null);function se(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function ce(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function g(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function le(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(s(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function ue(){let{ok:e,status:t,body:n}=await u();if(!e)throw Error(s(n)??`/api/documents responded with ${t}`);let r=n??{};return Array.isArray(r.documents)?{assetPaths:r.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:r.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),filePaths:r.documents.filter(e=>e.kind===`file`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[],filePaths:[]}}function de(e){console.error(`[PageListContext] Failed to load pages:`,e)}function _(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function v(e){let t=(0,ae.c)(54),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,o]=(0,p.useState)(r),s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=new Map,t[1]=s):s=t[1];let[u,d]=(0,p.useState)(s),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Map,t[2]=f):f=t[2];let[_,v]=(0,p.useState)(f),y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Set,t[3]=y):y=t[3];let[b,x]=(0,p.useState)(y),S;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=new Set,t[4]=S):S=t[4];let[C,ge]=(0,p.useState)(S),w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=new Set,t[5]=w):w=t[5];let[T,_e]=(0,p.useState)(w),E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=new Set,t[6]=E):E=t[6];let[D,O]=(0,p.useState)(E),[k,A]=(0,p.useState)(!0),[j,M]=(0,p.useState)(null),N=(0,p.useRef)(0),P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(){let e=N.current+=1;return Promise.all([le(),ue().catch(he)]).then(t=>{let[n,r]=t;if(e!==N.current)return;let i=new Set(n.map(me));o(i),d(new Map(n.map(pe))),v(new Map(n.map(fe))),x(new Set(r.assetPaths)),ge(new Set(r.folderPaths)),_e(new Set(r.filePaths)),O(e=>ce(e,i)),M(null),ie()}).catch(t=>{e===N.current&&(de(t),M(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===N.current&&A(!1)})},t[7]=P):P=t[7];let F=P,I;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){O(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),M(null)},t[8]=I):I=t[8];let ve=I,L,R;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{let e=m(F);e.request();let t=null,n=()=>{document.visibilityState===`visible`&&e.request()};window.addEventListener(`focus`,n),window.addEventListener(`visibilitychange`,n);let r=re(n=>{n.includes(`files`)&&t===null&&(t=setTimeout(()=>{t=null,e.request()},300))});return()=>{t!==null&&clearTimeout(t),e.dispose(),window.removeEventListener(`focus`,n),window.removeEventListener(`visibilitychange`,n),r()}},R=[],t[9]=L,t[10]=R):(L=t[9],R=t[10]),(0,p.useEffect)(L,R);let z,B,V,H,U,W,G,K;if(t[11]!==D||t[12]!==b||t[13]!==T||t[14]!==C||t[15]!==_||t[16]!==u||t[17]!==i){W=se(i,D);let e;t[26]!==D||t[27]!==u?(e=g(u,D),t[26]=D,t[27]=u,t[28]=e):e=t[28],U=e,H=_,z=b,B=T,V=new Set([...l(W),...C]),G=te(W,a),K=ee(W,a),t[11]=D,t[12]=b,t[13]=T,t[14]=C,t[15]=_,t[16]=u,t[17]=i,t[18]=z,t[19]=B,t[20]=V,t[21]=H,t[22]=U,t[23]=W,t[24]=G,t[25]=K}else z=t[18],B=t[19],V=t[20],H=t[21],U=t[22],W=t[23],G=t[24],K=t[25];let q=K,J;t[29]===_?J=t[30]:(J=ne(_),t[29]=_,t[30]=J);let Y=J,X,Z;t[31]!==z||t[32]!==B||t[33]!==V||t[34]!==Y||t[35]!==W||t[36]!==q||t[37]!==G?(X=()=>{c({pages:W,folderPaths:V,pagesBySlug:G,pagesByBasename:q,assetPaths:z,filePaths:B,pageIcons:Y})},Z=[W,V,G,q,z,B,Y],t[31]=z,t[32]=B,t[33]=V,t[34]=Y,t[35]=W,t[36]=q,t[37]=G,t[38]=X,t[39]=Z):(X=t[38],Z=t[39]),(0,p.useEffect)(X,Z);let Q;t[40]!==z||t[41]!==j||t[42]!==B||t[43]!==V||t[44]!==k||t[45]!==H||t[46]!==U||t[47]!==W||t[48]!==q||t[49]!==G?(Q={pages:W,pagesBySlug:G,pagesByBasename:q,pageTitles:U,pageMeta:H,folderPaths:V,assetPaths:z,filePaths:B,loading:k,error:j,refetch:F,addPage:ve},t[40]=z,t[41]=j,t[42]=B,t[43]=V,t[44]=k,t[45]=H,t[46]=U,t[47]=W,t[48]=q,t[49]=G,t[50]=Q):Q=t[50];let $;return t[51]!==n||t[52]!==Q?($=(0,oe.jsx)(h,{value:Q,children:n}),t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}function fe(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function pe(e){return[e.docName,e.title]}function me(e){return e.docName}function he(e){return _(e),{assetPaths:[],folderPaths:[],filePaths:[]}}function y(){let e=(0,p.use)(h);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function b(){return(0,p.use)(h)}var x=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),S=t(((e,t)=>{var n=x();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),C=t(((e,t)=>{t.exports=S()()}));export{m as a,y as i,v as n,f as o,b as r,d as s,C as t};
@@ -1,2 +1,2 @@
1
- import{an as e}from"./dist-CLzUuFWF2.js";function t(t){return e(t)}function n(e,t){switch(e.kind){case`ok`:return null;case`not-git`:return`This folder doesn't contain a git repository. Pick a different folder?`;case`wrong-repo`:return`This folder is a clone of ${e.actualOwner}/${e.actualRepo}, not ${t.owner}/${t.repo}. Pick a different folder?`;case`wrong-host`:return`This folder is a clone of ${t.owner}/${t.repo} on ${e.actualHost}, not ${t.host}. Pick a folder cloned from ${t.host}?`;case`no-origin`:case`non-github`:case`symlink-escape`:return`This folder isn't a clone of ${t.owner}/${t.repo}. Pick a different folder?`}}function r(e){return e.kind===`unsupported-version`?{kind:`unsupported-version`,message:`Update OpenKnowledge to open this share.`}:e.kind===`invalid`?{kind:`invalid`,message:`Invalid share URL.`}:null}function i(e){let t=e.split(`
1
+ import{an as e}from"./dist-8iqUcAwa2.js";function t(t){return e(t)}function n(e,t){switch(e.kind){case`ok`:return null;case`not-git`:return`This folder doesn't contain a git repository. Pick a different folder?`;case`wrong-repo`:return`This folder is a clone of ${e.actualOwner}/${e.actualRepo}, not ${t.owner}/${t.repo}. Pick a different folder?`;case`wrong-host`:return`This folder is a clone of ${t.owner}/${t.repo} on ${e.actualHost}, not ${t.host}. Pick a folder cloned from ${t.host}?`;case`no-origin`:case`non-github`:case`symlink-escape`:return`This folder isn't a clone of ${t.owner}/${t.repo}. Pick a different folder?`}}function r(e){return e.kind===`unsupported-version`?{kind:`unsupported-version`,message:`Update OpenKnowledge to open this share.`}:e.kind===`invalid`?{kind:`invalid`,message:`Invalid share URL.`}:null}function i(e){let t=e.split(`
2
2
  `).map(e=>e.trim()).filter(e=>e.length>0&&!/^Cloning into /i.test(e)),n=t.filter(e=>/^remote:/i.test(e)),r=n[n.length-1];if(r)return r.replace(/^remote:\s*/i,``).trim();let i=t.find(e=>/^fatal:/i.test(e));return i?i.replace(/^fatal:\s*/i,``).trim():t[0]??``}function a(e){let t=[`[receive]`];return e.q2_path!==void 0&&t.push(`q2_path=${e.q2_path}`),e.folder_validate!==void 0&&t.push(`folder_validate=${e.folder_validate}`),e.branch_action!==void 0&&t.push(`branch_action=${e.branch_action}`),e.branch!==void 0&&t.push(`branch=${e.branch}`),e.doc_check!==void 0&&t.push(`doc_check=${e.doc_check}`),e.branch_dialog_action!==void 0&&t.push(`branch_dialog_action=${e.branch_dialog_action}`),e.verdict_cell!==void 0&&t.push(`verdict_cell=${e.verdict_cell}`),t.join(` `)}function o(){let e=null,t=new Set,n=!1,r=null;function i(){for(let e of t)e()}function a(){e!==null&&(e=null,i())}return{install({bridge:t}){if(t)return n?r??void 0:(n=!0,r=t.onShareReceived(t=>{e=t,i()}),()=>{r?.(),r=null,n=!1,a()})},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dismiss(){a()}}}var s=o();function c(e){return s.install(e)}export{a,i,s as n,n as o,t as r,r as s,c as t};
@@ -0,0 +1,4 @@
1
+ import{I as e}from"./DocumentContext-B-GZJDKB.js";import{k as t}from"./CodeMirrorPropInput-DfuEjOgx.js";function n(n){let r=e(n.state.selection.content(),n.state.schema);return t().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
2
+ `).split(`
3
+ `),n=[],r=!1;for(let e of t){let t=e.trim();if(/^(```|~~~)/.test(t)){r||n.push(`code`),r=!r;continue}if(r||t===``)continue;if(/^\|.*\|?$/.test(t)&&t.includes(`|`)){n[n.length-1]!==`table`&&n.push(`table`);continue}if(/^<\/?[A-Za-z]/.test(t)){n[n.length-1]!==`component`&&n.push(`component`);continue}let i=t.match(/^#{1,6}\s+(.*)$/);if(i){n.push(i[1]??``);continue}let a=t.match(/^[-*+]\s+(.*)$/);if(a){n.push(`• ${a[1]??``}`);continue}let o=t.match(/^\d+\.\s+(.*)$/);if(o){n.push(`• ${o[1]??``}`);continue}let s=t.match(/^>\s?(.*)$/);if(s){n.push(s[1]??``);continue}n.push(t)}return n.join(` `).replace(/\s+/g,` `).trim()}var o=new Map,s=new Set,c=(e,t)=>`${t}:${e}`;function l(){for(let e of s)e()}function u(e,t){return e.markdown===t.markdown&&e.sourceLineStart===t.sourceLineStart&&e.sourceLineEnd===t.sourceLineEnd}function d(e,t,n){let r=c(e,t);if(n===null){o.delete(r)&&l();return}let i=o.get(r);i&&u(i,n)||(o.set(r,n),l())}function f(e,t){return e===null?null:o.get(c(e,t))??null}function p(e){return s.add(e),()=>{s.delete(e)}}function m(e,t){if(e.state.selection.empty)return null;let r=n(e);return r.trim()?{surface:`wysiwyg`,docName:t,markdown:r,charLen:r.trim().length,lineCount:(r.match(/\n/g)?.length??0)+1}:null}function h(e,t){return e.trim()?{surface:`frontmatter`,docName:t,markdown:e,charLen:e.trim().length,lineCount:(e.match(/\n/g)?.length??0)+1}:null}function g(e,t){let n=[],r=1/0,i=-1;for(let t of e.state.selection.ranges)t.empty||(n.push(e.state.sliceDoc(t.from,t.to)),r=Math.min(r,t.from),i=Math.max(i,t.to));if(n.length===0)return null;let a=n.join(`
4
+ `);if(!a.trim())return null;let o=e.state.doc.lineAt(r).number,s=e.state.doc.lineAt(i).number;return{surface:`source`,docName:t,markdown:a,charLen:a.trim().length,lineCount:s-o+1,sourceLineStart:o,sourceLineEnd:s}}export{h as a,r as c,i,p as l,a as n,g as o,d as r,m as s,f as t};
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{L as n,Qn as r,hr as i,i as a}from"./DocumentContext-B-GZJDKB.js";import{t as o}from"./react-f2sANaYj.js";import{n as s,r as c}from"./dist-Nvb76hAm.js";import{t as l}from"./compiler-runtime-BfE3aGVn.js";import{s as u}from"./local-menu-action-bus-C838bfRF.js";import{t as d}from"./utils-CPqDy6Hr.js";import{t as f}from"./use-workspace-Dwf_RQAR.js";import{c as p,i as m,n as h,o as g,s as _,t as v}from"./ChangedOutsideBadge-BhytPKwo.js";import{t as y}from"./button-RQ5o7P7w.js";import{i as b,n as x,t as S}from"./tooltip-x7BNUa3s.js";import{a as C,c as w,i as T,n as E,o as D,r as O,s as ee,t as te}from"./dialog-CCQHftjy.js";import{a as k,d as A,f as j,i as M,n as N,o as P,p as F,u as I}from"./dropdown-menu-AlVJ7dJz.js";import{t as L}from"./label-G0lbYOgL.js";import{C as R,a as z,f as B,h as V,m as H,n as U,o as W,p as G,r as K,s as q,t as J}from"./agent-visibility-ZpjqX-Ne.js";import{$t as Y,Ba as ne,Cn as X,Ct as re,Jt as ie,Nt as ae,Pt as oe,Ra as se,Sn as ce,Ua as le,_n as ue,ai as de,gn as fe,ha as pe,hn as me,it as he,kt as ge,mn as _e,nn as ve,rt as ye,tn as be,wn as xe,xn as Se,xr as Ce,yn as we}from"./dist-8iqUcAwa2.js";import{t as Te}from"./createLucideIcon-DihYAFEK.js";import{t as Ee}from"./RegisteredAgentIcon-MOyQ-5gc.js";import{n as De,r as Oe}from"./ManagedArtifactProperties-C35Phj1Z.js";import{n as ke}from"./CopyButton-D6N3opvE.js";import{t as Ae}from"./folder-open-Ceue91os.js";import{t as je}from"./folder-DcWlgZbb.js";import{t as Me}from"./trash-2-B8G0hzas.js";import{n as Z}from"./dist-DmEZHXvB.js";import{t as Ne}from"./input-CtKG6a5B.js";import{t as Pe}from"./dist-CpRBr-Ct.js";import{i as Fe}from"./use-settings-route-CU2Rp9Kx.js";import{t as Ie}from"./parse-api-error-BFe1cdS7.js";import{G as Le,O as Re,W as ze}from"./navigation-targets-CgKIg62o.js";import{c as Be,n as Ve,o as He}from"./documents-events-DG_D787e.js";import{c as Ue,f as We,n as Ge,r as Ke}from"./skill-scope-Q1zIQcaf.js";import{t as qe}from"./badge-CnYDYmI5.js";import{A as Je,D as Ye,O as Xe,S as Ze,_ as Qe,c as $e,f as et,i as tt,n as nt,t as rt,v as it,x as at,y as ot}from"./skills-api-DMJMDCm9.js";import{n as st}from"./config-context-B7cObhlW.js";import{t as ct}from"./use-skills-07203H6O.js";import{t as lt}from"./use-open-skill-DY7TTfKE.js";import{n as ut}from"./clipboard-adapter-DPkNOslT.js";import{t as dt}from"./DiffView-by44lBMn.js";var ft=Te(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),pt=Te(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),mt=Te(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),ht=Te(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),gt=Te(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q=t(),$=e(o(),1),_t=l();function vt(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function yt(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Ie(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function bt(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?vt(e):yt()}var xt=`ok:skill:cowork:installed`,St=`1`,Ct=250,wt=`/api/skill/install-state`;function Tt(e){return`${xt}:v${e}`}var Et=new Map;async function Dt(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Et.get(n);if(r)return r;let i=Ot(e,t);return Et.set(n,i),i.finally(()=>{Et.get(n)===i&&Et.delete(n)}),i}async function Ot(e,t){let n=e.installer===void 0?bt():e.installer,r=kt(e.storage),i=e.fetchSnapshot??jt,a=e.serverTimeoutMs??Ct,o=null;if(!t.force){try{o=await Mt(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Tt(o?.currentVersion??e.fallbackSkillVersion??At());if(!t.force&&r?.getItem(s)===St)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,St)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function kt(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function At(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function jt(){let e;try{e=await fetch(wt,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function Mt(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Nt(e){return Dt({},e)}function Pt(){return Dt({},{force:!0})}async function Ft(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function It(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Ft({target:`claude-cowork`,url:Y({mode:`cowork`},e)},n);case`claude-code`:return Ft({target:`claude-code`,url:Y({mode:`code`},e)},n);case`codex`:return Ft({target:`codex`,url:be(e)},n);case`cursor`:return Ft({target:`cursor`,url:ve(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function Lt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function Rt(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var zt=/\.(md|mdx)$/i;function Bt(e){return zt.test(e)?e:`${e}.md`}var Vt=`open-knowledge:agent-thread-launch`;function Ht(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(Vt,{detail:e}))}function Ut(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(Vt,n),()=>t.removeEventListener(Vt,n)}function Wt(e){if(!e.docName||!e.workspace)return null;let t=Bt(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:Rt(n,t,r)}}function Gt(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function Kt(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function qt(e){return G(e.installUrl).then(()=>void 0)}function Jt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function Yt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function Xt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??Bt(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:Rt(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function Zt(e){return`Opened in ${e}.`}function Qt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function $t(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function en(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function tn(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function nn(e,t,n,r){return e.compose?ie(tn(e.compose,t,n,r)):e.selection?Se({...e.selection,target:t,transport:r}):e.skill?ce(e.skill.name,e.skill.scope,n):e.ask?_e(e.ask.relativePath,e.ask.instruction,n,t,r):de(e.docContext===null?e.folderRelativePath?we(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?fe(n,e.instruction,r):me(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):ue(e.docContext.relativePath,n,e.instruction,r))}function rn(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${ye} ${nn(e,ae[t].handoffTarget,!1,`terminal`)}`:X(e.docContext?.relativePath??null)}function an(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${he} ${nn(e,`claude-code`,!1,`terminal`)}`:xe(e.docContext?.relativePath??null)}function on(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function sn(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function cn(e,t){Ht({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:an(e),docName:on(e),titleHint:sn(e)})}async function ln(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:nn(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=en(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(Zt(u));else{let i=$t(r),a=Qt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{ln(e,t,n,r+1)}}})}return a}function un(e){return H.find(t=>t.id===e)?.displayName??e}function dn(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function fn(){return{dispatchHandoff:It,recordHandoff:Lt,toast:{success:e=>{Z.success(e)},error:(e,t)=>{Z.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>dn(),getDisplayName:un,ensureCoworkSkillInstalled:Nt,autoOpen:!0}}function pn(){let e=(0,_t.c)(2),{merged:t}=st(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>ln(e,t,{...fn(),autoOpen:n}),reinstallCoworkSkill:Pt},e[0]=n,e[1]=r),r}var mn=Object.freeze({hosts:null,source:null}),hn=new Map,gn=new Map;function _n(e,t){return`${e}:${t}`}function vn(e){return hn.get(e)??mn}function yn(e,t){let n=gn.get(e)??new Set;return gn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&gn.delete(e)}}function bn(e,t){let n=vn(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?hn.delete(e):hn.set(e,r);for(let t of gn.get(e)??[])t()}}var xn=ge.options,Sn=`min-w-[24rem]`;function Cn(e,t){let n=(0,_t.c)(45),r=t.installingName===e.name,i=(0,$.useRef)(e),[a,o]=(0,$.useState)(!1),s=(0,$.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,$.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,$.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=_n(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>yn(m,e),g=()=>vn(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,$.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&bn(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,$.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,$.useRef)(e.hosts),O,ee;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},ee=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=ee):(O=n[21],ee=n[22]),(0,$.useEffect)(O,ee);let te;n[23]===e.hosts?te=n[24]:(te=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=te);let k=te,A,j;n[25]!==m||n[26]!==k?(A=()=>{let e=vn(m).hosts;e&&[...e].sort().join(`,`)===k&&bn(m,{hosts:null})},j=[k,m],n[25]=m,n[26]=k,n[27]=A,n[28]=j):(A=n[27],j=n[28]),(0,$.useEffect)(A,j);let M=(0,$.useRef)(null),N=(0,$.useRef)(null),P,F;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>()=>{M.current&&clearTimeout(M.current),N.current?.(),N.current=null},F=[],n[29]=P,n[30]=F):(P=n[29],F=n[30]),(0,$.useEffect)(P,F);let I;n[31]!==t||n[32]!==m||n[33]!==e?(I=function(n,r){D.current=n,bn(m,{hosts:n}),M.current&&clearTimeout(M.current);let i=async()=>{N.current=null,M.current=null;let r=await t.install(e,n.filter(Ce));if(!r.ok){bn(m,{hosts:null});return}D.current=[...r.hosts],bn(m,{hosts:[...r.hosts]})};r?(N.current=()=>void i(),M.current=setTimeout(()=>void i(),350)):(N.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=I):I=n[34];let L=I,R;return n[35]!==t||n[36]!==L||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(R={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),L([...n],!0)},installAll(){let t=D.current.filter(En),n=e.installableEditors??xn,r=xn.filter(e=>n.includes(e)||D.current.includes(e));L([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>it({scope:e.scope,name:e.name,dir:n,mode:r})).then(Tn)},unplaceAt(n){t.runLocationWrite(e,()=>Xe({scope:e.scope,name:e.name,path:n})).then(wn)},setSource(n){bn(m,{source:n}),t.runLocationWrite(e,()=>Ye({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(bn(m,{source:null}),Z.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=L,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=R):R=n[44],R}function wn(e){e.ok||Z.error(e.error)}function Tn(e){e.ok||Z.error(e.error)}function En(e){return!xn.includes(e)}function Dn(e){let t=(0,_t.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(b,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Q.jsx)(x,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(S,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function On(e){let t=(0,_t.c)(155),{toggles:n,skill:r,onResolveFork:i,onRunStart:a}=e,{_:o}=c(),{hostSet:l,toggleEditor:u,installAll:d}=n,f;t[0]===r?f=t[1]:(f=e=>r?`${Ue(e,r.scope)}/${r.name}`:null,t[0]=r,t[1]=f);let p=f,m=ct(),g;t[2]!==m.data||t[3]!==m.status||t[4]!==r?(g=r!==void 0&&((r.hosts??[]).includes(`agents`)||m.status===`ready`&&m.data.some(Bn)),t[2]=m.data,t[3]=m.status,t[4]=r,t[5]=g):g=t[5];let _=g,b;t[6]!==m.data||t[7]!==m.status||t[8]!==r?(b=r?.hostAliases??(r&&m.status===`ready`?Object.assign({},...m.data.filter(e=>e.scope===r.scope).map(zn)):{}),t[6]=m.data,t[7]=m.status,t[8]=r,t[9]=b):b=t[9];let x=b,S;t[10]!==m.data||t[11]!==m.status||t[12]!==r?(S=r?.installableEditors??(r&&m.status===`ready`?m.data.find(e=>e.scope===r.scope)?.installableEditors:void 0),t[10]=m.data,t[11]=m.status,t[12]=r,t[13]=S):S=t[13];let C=S,w,T,E,D,O,ee,te;if(t[14]!==o||t[15]!==x||t[16]!==m.data||t[17]!==m.status||t[18]!==l||t[19]!==_||t[20]!==d||t[21]!==C||t[22]!==i||t[23]!==a||t[24]!==p||t[25]!==r||t[26]!==u||t[27]!==n){let e=C?new Set(C):null,c;t[35]===x?c=t[36]:(c=e=>!(e in x),t[35]=x,t[36]=c);let f=(_?[`agents`,...xn]:xn).filter(c).filter(t=>t===`agents`||e===null||e.has(t)||l.has(t)),g;t[37]===p?g=t[38]:(g=e=>p(e),t[37]=p,t[38]=g);let b=new Set(f.map(g)),S=r?.scope===`global`?`~/`:``,k;t[39]!==S||t[40]!==r?(k=r?.path?.includes(`/`)?`${S}${r.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,t[39]=S,t[40]=r,t[41]=k):k=t[41];let A=k,j=A!==null&&!b.has(A)?A:null,M=j===null?n.sourceHost??r?.hosts?.[0]:void 0,F;t[42]===x?F=t[43]:(F=e=>Ge(x,e),t[42]=x,t[43]=F);let I=F,L=Rn,R;t[44]!==o||t[45]!==I?(R=e=>{let t=I(e);return t.length===0?!0:window.confirm(o({id:`Uobeu9`,values:{0:t.map(L).join(`, `),rootRel:e}}))},t[44]=o,t[45]=I,t[46]=R):R=t[46];let z=R,B;t[47]!==o||t[48]!==r?(B=(e,t)=>{let n=e.includes(`/`)?e:Ue(e,r?.scope??`project`);return(0,Q.jsx)(Dn,{hint:o({id:`0dslv8`,values:{0:L(e),1:L(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":o({id:`G6Lrs_`,values:{0:L(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(o({id:`iiqOKM`,values:{0:L(e),1:r.name,2:L(e),subRoot:n,poolRootRel:t}}))&&ot({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?He():Z.error(o({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Q.jsx)(h,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[47]=o,t[48]=r,t[49]=B):B=t[49];let V=B,H;t[50]===r?.conflictHosts?H=t[51]:(H=r?.conflictHosts??[],t[50]=r?.conflictHosts,t[51]=H);let U;t[52]===H?U=t[53]:(U=new Set(H),t[52]=H,t[53]=U);let W=U,G;t[54]===r?.driftPaths?G=t[55]:(G=r?.driftPaths??[],t[54]=r?.driftPaths,t[55]=G);let K;t[56]===G?K=t[57]:(K=new Set(G),t[56]=G,t[57]=K);let q=K;w=n.installing;let J=Ln,Y;t[58]===r?.symlinkedHosts?Y=t[59]:(Y=r?.symlinkedHosts??[],t[58]=r?.symlinkedHosts,t[59]=Y);let ne;t[60]===Y?ne=t[61]:(ne=new Set(Y),t[60]=Y,t[61]=ne);let X=ne,re=[...[...l].filter(e=>e!==M&&!(e in x)&&!W.has(e)&&!e.includes(`/`)).map(e=>X.has(e)?`link`:`copy`),...(r?.customPlacements??[]).map(In)],ie=re.filter(Fn).length;E=re.length===0?n.linkMode?`link`:`copy`:ie*2>=re.length?`link`:`copy`;let ae;t[62]!==x||t[63]!==W||t[64]!==l||t[65]!==X||t[66]!==p||t[67]!==M?(ae=[...l].filter(e=>e!==M&&!(e in x)&&!W.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:p(e)??L(e),mode:X.has(e)?`link`:`copy`})),t[62]=x,t[63]=W,t[64]=l,t[65]=X,t[66]=p,t[67]=M,t[68]=ae):ae=t[68];let oe;t[69]===r?.customPlacements?oe=t[70]:(oe=r?.customPlacements??[],t[69]=r?.customPlacements,t[70]=oe);let se;if(t[71]!==S||t[72]!==ae||t[73]!==oe){let e;t[75]===S?e=t[76]:(e=e=>({target:Ke(e),display:`${S}${e.path}`,mode:e.mode}),t[75]=S,t[76]=e),se=[...ae,...oe.map(e)],t[71]=S,t[72]=ae,t[73]=oe,t[74]=se}else se=t[74];T=se;let ce;t[77]!==o||t[78]!==a||t[79]!==n?(ce=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Q.jsx)(Dn,{hint:o(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(o(i===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(a?.(),n.convertLocation?.(e,i))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Q.jsx)(s,{id:`uUCrBv`}):(0,Q.jsx)(s,{id:`iaPtht`})})})},t[77]=o,t[78]=a,t[79]=n,t[80]=ce):ce=t[80];let le=ce,ue;t[81]===r?.customPlacements?ue=t[82]:(ue=r?.customPlacements??[],t[81]=r?.customPlacements,t[82]=ue);let de=new Map(ue.map(Pn)),fe=new Set(de.keys());if(m.status===`ready`&&r){for(let e of m.data)if(e.scope===r.scope)for(let t of e.customPlacements??[]){let e=Ke(t);e!==``&&fe.add(e)}}let me=r===void 0?[]:[...fe].sort().map(e=>({root:e,display:`${S}${e}/${r.name}`,placed:de.get(e)??null})).filter(e=>!b.has(e.display)&&e.display!==A&&!(e.root in x)),he;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Q.jsx)(s,{id:`npcziF`}),t[83]=he):he=t[83];let ge;t[84]===o?ge=t[85]:(ge=o({id:`6f_UX4`}),t[84]=o,t[85]=ge);let _e;t[86]===d?_e=t[87]:(_e=()=>d(),t[86]=d,t[87]=_e);let ve;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Q.jsx)(s,{id:`N40H-G`}),t[88]=ve):ve=t[88];let ye;t[89]!==w||t[90]!==_e?(ye=(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:w,onClick:_e,"data-testid":`skill-install-all`,children:ve}),t[89]=w,t[90]=_e,t[91]=ye):ye=t[91],t[92]!==ge||t[93]!==ye?(D=(0,Q.jsxs)(P,{className:`flex items-center justify-between gap-2`,children:[he,(0,Q.jsx)(Dn,{hint:ge,children:ye})]}),t[92]=ge,t[93]=ye,t[94]=D):D=t[94],t[95]!==o||t[96]!==V||t[97]!==w||t[98]!==j||t[99]!==I?(O=j===null?null:(0,Q.jsx)(Dn,{hint:o({id:`pXB6SL`}),children:(0,Q.jsxs)(N,{disabled:w,checked:!0,onSelect:Nn,"data-testid":`skill-source-row`,children:[(0,Q.jsx)(je,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:j}),(()=>{let e=J(j).split(`/`).slice(0,-1).join(`/`),t=I(e);return t.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>V(t,e))}):null})(),(0,Q.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Q.jsx)(s,{id:`tiFPjk`})})]})]})}),t[95]=o,t[96]=V,t[97]=w,t[98]=j,t[99]=I,t[100]=O):O=t[100];let be;t[101]!==o||t[102]!==V||t[103]!==w||t[104]!==z||t[105]!==W||t[106]!==le||t[107]!==q||t[108]!==E||t[109]!==l||t[110]!==X||t[111]!==i||t[112]!==p||t[113]!==r?.hosts||t[114]!==M||t[115]!==I||t[116]!==u||t[117]!==n?(be=e=>{let t=p(e),a=e===`agents`?`.agents`:pe[e],c=J(t).split(`/`).slice(0,-1).join(`/`),d=I(c);return(0,Q.jsx)(Dn,{hint:W.has(e)?o({id:`8HvJlU`,values:{0:t??a}}):e===M?t?o({id:`ssk6rl`,values:{path:t}}):a:l.has(e)?o(t?{id:`9ieZhu`,values:{path:t}}:{id:`n3T3EE`,values:{label:a}}):o(t?E===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}:{id:`Pp0Vgd`,values:{label:a}}),children:(0,Q.jsxs)(N,{disabled:w,checked:l.has(e),onCheckedChange:t=>{W.has(e)||t===!0&&!z(c)||u(e,t===!0)},onSelect:Mn,className:`group`,"data-testid":`skill-install-editor-${e}`,children:[(0,Q.jsx)(h,{host:e,"aria-hidden":!0,className:`size-4`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:t??a}),d.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${e}`,children:d.map(e=>V(e,c))}):null,W.has(e)?(0,Q.jsx)(Dn,{hint:o({id:`_O7dJS`}),children:(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:t=>{t.preventDefault(),i?.(e)},"data-testid":`skill-fork-chip-${e}`,children:(0,Q.jsx)(s,{id:`jng7Ko`})})}):e===M?(0,Q.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Q.jsx)(s,{id:`tiFPjk`})}):l.has(e)&&r?.hosts?(0,Q.jsxs)(Q.Fragment,{children:[!w&&(X.has(e)?`link`:`copy`)!==E?le(e,t??a,X.has(e)?`link`:`copy`):null,(0,Q.jsx)(Dn,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e)},"data-testid":`skill-set-source-${e}`,children:(0,Q.jsx)(s,{id:`VNNRfN`})})})]}):null,!w&&q.has(J(t))?(0,Q.jsx)(Dn,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(v,{testId:`skill-drift-${e}`})}):null]})]})},e)},t[101]=o,t[102]=V,t[103]=w,t[104]=z,t[105]=W,t[106]=le,t[107]=q,t[108]=E,t[109]=l,t[110]=X,t[111]=i,t[112]=p,t[113]=r?.hosts,t[114]=M,t[115]=I,t[116]=u,t[117]=n,t[118]=be):be=t[118],ee=f.map(be);let xe;t[119]!==o||t[120]!==V||t[121]!==w||t[122]!==z||t[123]!==le||t[124]!==q||t[125]!==E||t[126]!==I||t[127]!==n?(xe=e=>(0,Q.jsx)(Dn,{hint:e.placed===null?o(E===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):o({id:`C0cll5`,values:{0:e.display}}),children:(0,Q.jsxs)(N,{disabled:w,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!z(e.root))return;n.placeAt(e.root,E)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:jn,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Q.jsx)(h,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Q.jsx)(je,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),I(e.root).length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:I(e.root).map(t=>V(t,e.root))}):null,!w&&e.placed!==null&&q.has(e.placed.path)?(0,Q.jsx)(Dn,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(v,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Q.jsxs)(Q.Fragment,{children:[!w&&e.placed.mode!==E?le(e.root,e.display,e.placed.mode):null,(0,Q.jsx)(Dn,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Q.jsx)(s,{id:`VNNRfN`})})})]})]})]})},e.root),t[119]=o,t[120]=V,t[121]=w,t[122]=z,t[123]=le,t[124]=q,t[125]=E,t[126]=I,t[127]=n,t[128]=xe):xe=t[128],te=me.map(xe),t[14]=o,t[15]=x,t[16]=m.data,t[17]=m.status,t[18]=l,t[19]=_,t[20]=d,t[21]=C,t[22]=i,t[23]=a,t[24]=p,t[25]=r,t[26]=u,t[27]=n,t[28]=w,t[29]=T,t[30]=E,t[31]=D,t[32]=O,t[33]=ee,t[34]=te}else w=t[28],T=t[29],E=t[30],D=t[31],O=t[32],ee=t[33],te=t[34];let A;t[129]!==o||t[130]!==w||t[131]!==T||t[132]!==E||t[133]!==a||t[134]!==n?(A=T.length>0&&n.convertLocations?(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=E===`link`?`copy`:`link`,r=T.filter(e=>e.mode!==t);if(r.length===0)return;let i=o(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),s=o(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),c=r.map(An).join(`
2
+ `);window.confirm(`${i}\n\n${s}\n\n${c}\n\n${o({id:`Cu6GXQ`})}`)&&(a?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:w,"data-testid":`skill-convert-all`,children:E===`link`?(0,Q.jsx)(s,{id:`rcJmK8`}):(0,Q.jsx)(s,{id:`LBv_TR`})}),(0,Q.jsx)(Dn,{hint:o({id:`0J6nhG`}),children:(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,"aria-label":o({id:`qJSo0_`}),className:`size-4 shrink-0 rounded-full border border-border/60 p-0 font-normal text-[9px] text-muted-foreground hover:border-foreground/40 hover:bg-transparent hover:text-foreground`,onClick:kn,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[129]=o,t[130]=w,t[131]=T,t[132]=E,t[133]=a,t[134]=n,t[135]=A):A=t[135];let j;t[136]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(I,{}),t[136]=j):j=t[136];let M;t[137]===o?M=t[138]:(M=o({id:`jqe7Yq`}),t[137]=o,t[138]=M);let F;t[139]===r?.scope?F=t[140]:(F=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[139]=r?.scope,t[140]=F);let L,R;t[141]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(gt,{"aria-hidden":!0}),R=(0,Q.jsx)(s,{id:`ZBF9fn`}),t[141]=L,t[142]=R):(L=t[141],R=t[142]);let z;t[143]===F?z=t[144]:(z=(0,Q.jsxs)(k,{onSelect:F,children:[L,R]}),t[143]=F,t[144]=z);let B;t[145]!==M||t[146]!==z?(B=(0,Q.jsx)(Dn,{hint:M,children:z}),t[145]=M,t[146]=z,t[147]=B):B=t[147];let V;return t[148]!==B||t[149]!==D||t[150]!==O||t[151]!==ee||t[152]!==te||t[153]!==A?(V=(0,Q.jsxs)(Q.Fragment,{children:[D,O,ee,te,A,j,B]}),t[148]=B,t[149]=D,t[150]=O,t[151]=ee,t[152]=te,t[153]=A,t[154]=V):V=t[154],V}function kn(e){return e.preventDefault()}function An(e){return e.display}function jn(e){return e.preventDefault()}function Mn(e){return e.preventDefault()}function Nn(e){return e.preventDefault()}function Pn(e){return[Ke(e),e]}function Fn(e){return e===`link`}function In(e){return e.mode}function Ln(e){return(e??``).replace(/^~\//,``)}function Rn(e){return e===`agents`?`.agents`:pe[e]??e}function zn(e){return e.hostAliases??{}}function Bn(e){return e.hosts.includes(`agents`)||e.path.startsWith(`.agents/`)}function Vn(e){let t=(0,_t.c)(23),{onAddProperty:n,className:r,problemCount:i,problemMessages:a}=e,o=i===void 0?0:i,{_:l}=c(),u=o>0,f;t[0]!==l||t[1]!==u||t[2]!==o?(f=l(u?{id:`3KOHFt`,values:{problemCount:o}}:{id:`81H_23`}),t[0]=l,t[1]=u,t[2]=o,t[3]=f):f=t[3];let p=f,m;t[4]===r?m=t[5]:(m=d(`relative`,r),t[4]=r,t[5]=m);let h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(mt,{}),t[6]=h):h=t[6];let g;t[7]!==u||t[8]!==o?(g=u?(0,Q.jsx)(qe,{variant:`notification`,"aria-hidden":`true`,"data-testid":`add-properties-problem-badge`,className:`pointer-events-none absolute -top-0.5 -right-0.5 size-3.5 rounded-full p-0 font-sans text-[9px] leading-none tabular-nums`,children:o>9?`9+`:o}):null,t[7]=u,t[8]=o,t[9]=g):g=t[9];let _;t[10]===g?_=t[11]:(_=(0,Q.jsxs)(b,{children:[h,g]}),t[10]=g,t[11]=_);let v;t[12]!==p||t[13]!==n||t[14]!==m||t[15]!==_?(v=(0,Q.jsx)(y,{variant:`ghost`,size:`icon`,"aria-label":p,onClick:n,"data-testid":`add-properties-button`,className:m,asChild:!0,children:_}),t[12]=p,t[13]=n,t[14]=m,t[15]=_,t[16]=v):v=t[16];let C;t[17]!==u||t[18]!==a?(C=(0,Q.jsx)(x,{side:`bottom`,children:u?(0,Q.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:(0,Q.jsx)(s,{id:`AwrGuz`})}),a?.map(Hn),(0,Q.jsx)(`span`,{className:`pt-0.5 opacity-70`,children:(0,Q.jsx)(s,{id:`yh5-4s`})})]}):(0,Q.jsx)(s,{id:`81H_23`})}),t[17]=u,t[18]=a,t[19]=C):C=t[19];let w;return t[20]!==v||t[21]!==C?(w=(0,Q.jsxs)(S,{children:[v,C]}),t[20]=v,t[21]=C,t[22]=w):w=t[22],w}function Hn(e,t){return(0,Q.jsx)(`span`,{className:`opacity-90`,children:e},t)}function Un(e){return e?Pe._({id:`wTcjov`}):null}function Wn(e){let t=(0,_t.c)(47),{_:i}=c(),a=n(),o=g(),l=R(),d=B();if(a)return null;let{input:f,installStates:p,dispatch:m,onBeforeLaunch:h}=e,_=f===null,v,y,b,x,S,C,w,T,E,D,O;if(t[0]!==i||t[1]!==m||t[2]!==f||t[3]!==_||t[4]!==p||t[5]!==h||t[6]!==d||t[7]!==l||t[8]!==o){let e=Un(_),n;t[20]===d?n=t[21]:(n=e=>J(d,e.id),t[20]=d,t[21]=n);let a=V.filter(n),c;t[22]===d?c=t[23]:(c=e=>U(d,e.source,e.id,!0,e.supported),t[22]=d,t[23]=c);let u=l.filter(c),g=o?oe.filter(e=>K(d,e,o.installedClis)):[];b=a.length>0,x=o!==null&&g.length>0,S=u.length>0,y=A,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsxs)(F,{children:[(0,Q.jsx)(r,{"aria-hidden":`true`}),(0,Q.jsx)(s,{id:`O7_W_a`})]}),t[24]=O):O=t[24],v=j,C=`max-h-80`,w=S?(0,Q.jsxs)(M,{"aria-label":i({id:`vPKX2i`}),children:[(0,Q.jsxs)(P,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(s,{id:`RXEbZy`}),(0,Q.jsx)(q,{})]}),u.map(t=>{let n=t.name;return(0,Q.jsxs)(k,{onSelect:()=>{f!==null&&(h?.(),cn(f,{agent:{source:t.source,id:t.id}}))},disabled:_,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?i({id:`gtGQ9S`,values:{agentName:n,hint:e}}):void 0,children:[(0,Q.jsx)(Ee,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`5PrrYw`,values:{agentName:n}})}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[25]!==b||t[26]!==x||t[27]!==S?(T=S&&(x||b)?(0,Q.jsx)(I,{}):null,t[25]=b,t[26]=x,t[27]=S,t[28]=T):T=t[28],E=x?(0,Q.jsxs)(M,{"aria-label":i({id:`ALhMYW`}),children:[(0,Q.jsx)(P,{children:(0,Q.jsx)(s,{id:`ALhMYW`})}),g.map(t=>{let{displayName:n}=ae[t];return(0,Q.jsxs)(k,{onSelect:()=>{f!==null&&(h?.(),o.launchInTerminal(f,t))},disabled:_,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":i(e?{id:`AIn2Yv`,values:{displayName:n,hint:e}}:{id:`QYfQdv`,values:{displayName:n}}),children:[(0,Q.jsx)(W,{id:z(t),"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:n}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,D=b?(0,Q.jsxs)(Q.Fragment,{children:[x?(0,Q.jsx)(I,{}):null,(0,Q.jsxs)(M,{"aria-label":i({id:`BBqGS9`}),children:[(0,Q.jsx)(P,{children:(0,Q.jsx)(s,{id:`BBqGS9`})}),a.map(t=>{let n=!_,{displayName:r}=t,a=i(e?{id:`1ZpfyB`,values:{displayName:r,hint:e}}:{id:`WqLq6M`,values:{displayName:r}});return(0,Q.jsxs)(k,{disabled:!n,onSelect:()=>{if(f){if(h?.(),p[t.id]?.installed!==!0){qt(t);return}m(t.id,f)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Q.jsx)(W,{id:t.id,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=i,t[1]=m,t[2]=f,t[3]=_,t[4]=p,t[5]=h,t[6]=d,t[7]=l,t[8]=o,t[9]=v,t[10]=y,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=D,t[19]=O}else v=t[9],y=t[10],b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],D=t[18],O=t[19];let ee;t[29]!==b||t[30]!==x||t[31]!==S?(ee=S||x||b?(0,Q.jsx)(I,{}):null,t[29]=b,t[30]=x,t[31]=S,t[32]=ee):ee=t[32];let te;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(u,{"aria-hidden":`true`}),t[33]=te):te=t[33];let N;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsxs)(k,{onSelect:Fe,"data-testid":`file-tree-open-in-settings`,children:[te,(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`jRAGrQ`})})]}),t[34]=N):N=t[34];let L;t[35]!==v||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==D||t[41]!==ee?(L=(0,Q.jsxs)(v,{className:C,children:[w,T,E,D,ee,N]}),t[35]=v,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=D,t[41]=ee,t[42]=L):L=t[42];let H;return t[43]!==y||t[44]!==O||t[45]!==L?(H=(0,Q.jsxs)(y,{children:[O,L]}),t[43]=y,t[44]=O,t[45]=L,t[46]=H):H=t[46],H}function Gn(e){let t=ne(e);if(t)return{scope:`project`,name:t.name,rel:t.rel};let n=se(e);return n?{scope:`global`,name:n.name,rel:n.rel}:null}function Kn(e,t,n){return e.filter(e=>{let r=Re(e);if(r.kind===`skill-file`)return r.scope===t&&r.name===n;if(r.kind!==`doc`)return!1;let i=Gn(r.docName);return i?.scope===t&&i.name===n})}function qn(e,t){let n=new Map(t.map(e=>[`${e.scope}\u0000${e.name}`,e])),r=[];for(let t of e){let e=Gn(t);if(!e||n.has(`${e.scope}\u0000${e.name}`))continue;let i=e.scope===`project`?`global`:`project`,a=n.get(`${i}\u0000${e.name}`);e.rel===null&&a!==void 0?r.push({kind:`retarget`,fromDocName:t,toDocName:Le(a)}):r.push({kind:`close`,docName:t})}return r}function Jn(){let e=(0,_t.c)(15),{openTabs:t,closeDocument:n}=a(),r=De(),i;e[0]===t?i=e[1]:(i=t.some(Xn),e[0]=t,e[1]=i);let o=i,s;e[2]===o?s=e[3]:(s={enabled:o},e[2]=o,e[3]=s);let c=ct(s),l=(0,$.useRef)(null),u;e[4]!==n||e[5]!==t||e[6]!==r||e[7]!==c.data||e[8]!==c.status?(u=()=>{if(c.status!==`ready`)return;let e=c.data,i=`${t.join(``)}\u0002${e.map(Yn).sort().join(``)}`;if(l.current===i)return;l.current=i;let a=qn(t,e);for(let e of a)e.kind===`retarget`?r(e.fromDocName,e.toDocName):n(e.docName)},e[4]=n,e[5]=t,e[6]=r,e[7]=c.data,e[8]=c.status,e[9]=u):u=e[9];let d;e[10]!==n||e[11]!==t||e[12]!==r||e[13]!==c?(d=[c,t,r,n],e[10]=n,e[11]=t,e[12]=r,e[13]=c,e[14]=d):d=e[14],(0,$.useEffect)(u,d)}function Yn(e){return`${e.scope}\u0000${e.name}`}function Xn(e){return Gn(e)!==null}function Zn(e){let t=(0,_t.c)(19),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:o}=c(),{setSkillsSidebar:s,closeTabs:l,openTabs:u}=a(),[d,f]=(0,$.useState)(!1),p;t[0]!==o||t[1]!==l||t[2]!==i||t[3]!==r||t[4]!==u||t[5]!==s?(p=async function(e){s(!0),f(!0);let t=await nt(e.scope,e.name);if(f(!1),!t.ok){let{error:e}=t;Z.error(o({id:`AtBdnD`,values:{error:e}}));return}Z.success(o({id:`h9QFb9`,values:{0:e.name}})),l(Kn(u,e.scope,e.name),{force:!0}),i(),r(!1)},t[0]=o,t[1]=l,t[2]=i,t[3]=r,t[4]=u,t[5]=s,t[6]=p):p=t[6];let h=p,g=n!==null,_;t[7]!==d||t[8]!==r?(_=e=>{!e&&!d&&r(!1)},t[7]=d,t[8]=r,t[9]=_):_=t[9];let v;t[10]!==o||t[11]!==d||t[12]!==h||t[13]!==n?(v=n?(0,Q.jsx)(m,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:d,onDelete:()=>h(n),customDescription:n.origin?.source&&/\/plugins\/(?:cache|marketplaces)\//.test(n.origin.source)?o({id:`WnsbUT`,values:{0:n.path}}):o({id:`E1Da_b`,values:{0:n.path}})}):null,t[10]=o,t[11]=d,t[12]=h,t[13]=n,t[14]=v):v=t[14];let y;return t[15]!==g||t[16]!==_||t[17]!==v?(y=(0,Q.jsx)(te,{open:g,onOpenChange:_,children:v}),t[15]=g,t[16]=_,t[17]=v,t[18]=y):y=t[18],y}function Qn(e){let t=e.split(`/`);return t.some(e=>e===``||e===`.`||e===`..`)||t.length===0||t.length===1&&t[0].toLowerCase()===`skill.md`?!1:!/\s/.test(e)}function $n(e){let t=(0,_t.c)(66),{target:n,onOpenChange:r}=e,{_:i}=c(),{openTarget:o}=a(),l=(0,$.useId)(),[u,d]=(0,$.useState)(``),[f,p]=(0,$.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.prefix??`references/`)},t[0]=n,t[1]=m);let h=n?.skill.scope,g=n?.skill.name,_=n?.prefix,v;if(t[2]!==h||t[3]!==g||t[4]!==_?(v=[h,g,_],t[2]=h,t[3]=g,t[4]=_,t[5]=v):v=t[5],(0,$.useEffect)(m,v),!n)return null;let b,x,S,E;t[6]!==u||t[7]!==f?(E=u.trim(),x=E===``||!Qn(E),b=!x&&!f,S=E.includes(`/`)?E.split(`/`).slice(0,-1).join(`/`):null,t[6]=u,t[7]=f,t[8]=b,t[9]=x,t[10]=S,t[11]=E):(b=t[8],x=t[9],S=t[10],E=t[11]);let O=S,k;t[12]!==i||t[13]!==b||t[14]!==r||t[15]!==o||t[16]!==n||t[17]!==E?(k=async function(){if(!n||!b)return;p(!0);let e=/\.mdx?$/i.test(E),t=await Je({scope:n.skill.scope,name:n.skill.name,path:E,content:e?`# ${E.split(`/`).pop()?.replace(/\.mdx?$/i,``)??``}\n`:``});if(p(!1),!t.ok){Z.error(i({id:`a_2_uB`,values:{0:t.error,trimmed:E}}));return}if(Z.success(i({id:`MXSt4t`,values:{0:t.path}})),e){let e=ze(n.skill,E);o({kind:`doc`,target:e,docName:e})}r(!1)},t[12]=i,t[13]=b,t[14]=r,t[15]=o,t[16]=n,t[17]=E,t[18]=k):k=t[18];let A=k,j;t[19]!==r||t[20]!==f?(j=e=>{!e&&!f&&r(!1)},t[19]=r,t[20]=f,t[21]=j):j=t[21];let M;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(w,{children:(0,Q.jsx)(s,{id:`wQvvZY`})}),t[22]=M):M=t[22];let N;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsxs)(ee,{children:[M,(0,Q.jsx)(C,{children:(0,Q.jsx)(s,{id:`lM4c-I`})})]}),t[23]=N):N=t[23];let P;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(s,{id:`I6gXOa`}),t[24]=P):P=t[24];let F;t[25]===l?F=t[26]:(F=(0,Q.jsx)(L,{htmlFor:l,children:P}),t[25]=l,t[26]=F);let I;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>d(e.target.value),t[27]=I):I=t[27];let R=x&&E!==``,z;t[28]===A?z=t[29]:(z=e=>{e.key===`Enter`&&A()},t[28]=A,t[29]=z);let B;t[30]!==l||t[31]!==u||t[32]!==R||t[33]!==z?(B=(0,Q.jsx)(Ne,{id:l,value:u,onChange:I,placeholder:`references/notes.md`,"aria-invalid":R,onKeyDown:z}),t[30]=l,t[31]=u,t[32]=R,t[33]=z,t[34]=B):B=t[34];let V;t[35]!==O||t[36]!==x||t[37]!==E?(V=x&&E!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(s,{id:`fVzizW`})}):O?(0,Q.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,Q.jsx)(s,{id:`9lso1Y`,values:{folderPart:O},components:{0:(0,Q.jsx)(`span`,{className:`font-mono text-foreground/80`})}})}):null,t[35]=O,t[36]=x,t[37]=E,t[38]=V):V=t[38];let H;t[39]!==F||t[40]!==B||t[41]!==V?(H=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[F,B,V]}),t[39]=F,t[40]=B,t[41]=V,t[42]=H):H=t[42];let U;t[43]===r?U=t[44]:(U=()=>r(!1),t[43]=r,t[44]=U);let W;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(s,{id:`dEgA5A`}),t[45]=W):W=t[45];let G;t[46]!==f||t[47]!==U?(G=(0,Q.jsx)(y,{variant:`outline`,onClick:U,disabled:f,children:W}),t[46]=f,t[47]=U,t[48]=G):G=t[48];let K;t[49]===A?K=t[50]:(K=()=>void A(),t[49]=A,t[50]=K);let q=!b,J;t[51]===f?J=t[52]:(J=f?(0,Q.jsx)(s,{id:`E9bKSA`}):(0,Q.jsx)(s,{id:`hYgDIe`}),t[51]=f,t[52]=J);let Y;t[53]!==K||t[54]!==q||t[55]!==J?(Y=(0,Q.jsx)(y,{onClick:K,disabled:q,children:J}),t[53]=K,t[54]=q,t[55]=J,t[56]=Y):Y=t[56];let ne;t[57]!==G||t[58]!==Y?(ne=(0,Q.jsxs)(D,{children:[G,Y]}),t[57]=G,t[58]=Y,t[59]=ne):ne=t[59];let X;t[60]!==H||t[61]!==ne?(X=(0,Q.jsxs)(T,{className:`sm:max-w-md`,children:[N,H,ne]}),t[60]=H,t[61]=ne,t[62]=X):X=t[62];let re;return t[63]!==X||t[64]!==j?(re=(0,Q.jsx)(te,{open:!0,onOpenChange:j,children:X}),t[63]=X,t[64]=j,t[65]=re):re=t[65],re}function er(e){let t=(0,_t.c)(64),{target:n,onOpenChange:r}=e,{_:i}=c(),a=De(),o=(0,$.useId)(),[l,u]=(0,$.useState)(``),[d,f]=(0,$.useState)(!1),p;t[0]===n?p=t[1]:(p=()=>{n&&u(n.filePath)},t[0]=n,t[1]=p);let m=n?.skill.scope,h=n?.skill.name,g=n?.filePath,_;if(t[2]!==m||t[3]!==h||t[4]!==g?(_=[m,h,g],t[2]=m,t[3]=h,t[4]=g,t[5]=_):_=t[5],(0,$.useEffect)(p,_),!n)return null;let v,b,x;t[6]!==l||t[7]!==n.filePath?(b=l.trim(),x=b===n.filePath,v=b===``||!Qn(b),t[6]=l,t[7]=n.filePath,t[8]=v,t[9]=b,t[10]=x):(v=t[8],b=t[9],x=t[10]);let S=v,E=!S&&!x&&!d,O;t[11]!==i||t[12]!==E||t[13]!==r||t[14]!==a||t[15]!==n||t[16]!==b?(O=async function(){if(!n||!E)return;f(!0);let e=await at({scope:n.skill.scope,name:n.skill.name,from:n.filePath,to:b});if(f(!1),!e.ok){Z.error(i({id:`11ukmX`,values:{0:e.error}}));return}e.fromDocName!==void 0&&e.toDocName!==void 0&&a(e.fromDocName,e.toDocName),Z.success(i({id:`XszXjc`,values:{0:e.to}})),r(!1)},t[11]=i,t[12]=E,t[13]=r,t[14]=a,t[15]=n,t[16]=b,t[17]=O):O=t[17];let k=O,A;t[18]!==r||t[19]!==d?(A=e=>{!e&&!d&&r(!1)},t[18]=r,t[19]=d,t[20]=A):A=t[20];let j;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(w,{children:(0,Q.jsx)(s,{id:`yckias`})}),t[21]=j):j=t[21];let M;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsxs)(ee,{children:[j,(0,Q.jsx)(C,{children:(0,Q.jsx)(s,{id:`HzVAoz`})})]}),t[22]=M):M=t[22];let N;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(s,{id:`I6gXOa`}),t[23]=N):N=t[23];let P;t[24]===o?P=t[25]:(P=(0,Q.jsx)(L,{htmlFor:o,children:N}),t[24]=o,t[25]=P);let F;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>u(e.target.value),t[26]=F):F=t[26];let I=S&&b!==``,R;t[27]===k?R=t[28]:(R=e=>{e.key===`Enter`&&k()},t[27]=k,t[28]=R);let z;t[29]!==o||t[30]!==l||t[31]!==I||t[32]!==R?(z=(0,Q.jsx)(Ne,{id:o,value:l,onChange:F,"aria-invalid":I,onKeyDown:R}),t[29]=o,t[30]=l,t[31]=I,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==S||t[35]!==b?(B=S&&b!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(s,{id:`fVzizW`})}):null,t[34]=S,t[35]=b,t[36]=B):B=t[36];let V;t[37]!==P||t[38]!==z||t[39]!==B?(V=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[P,z,B]}),t[37]=P,t[38]=z,t[39]=B,t[40]=V):V=t[40];let H;t[41]===r?H=t[42]:(H=()=>r(!1),t[41]=r,t[42]=H);let U;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(s,{id:`dEgA5A`}),t[43]=U):U=t[43];let W;t[44]!==d||t[45]!==H?(W=(0,Q.jsx)(y,{variant:`outline`,onClick:H,disabled:d,children:U}),t[44]=d,t[45]=H,t[46]=W):W=t[46];let G;t[47]===k?G=t[48]:(G=()=>void k(),t[47]=k,t[48]=G);let K=!E,q;t[49]===d?q=t[50]:(q=d?(0,Q.jsx)(s,{id:`tHKQ6j`}):(0,Q.jsx)(s,{id:`2wxgft`}),t[49]=d,t[50]=q);let J;t[51]!==G||t[52]!==K||t[53]!==q?(J=(0,Q.jsx)(y,{onClick:G,disabled:K,children:q}),t[51]=G,t[52]=K,t[53]=q,t[54]=J):J=t[54];let Y;t[55]!==W||t[56]!==J?(Y=(0,Q.jsxs)(D,{children:[W,J]}),t[55]=W,t[56]=J,t[57]=Y):Y=t[57];let ne;t[58]!==V||t[59]!==Y?(ne=(0,Q.jsxs)(T,{className:`sm:max-w-md`,children:[M,V,Y]}),t[58]=V,t[59]=Y,t[60]=ne):ne=t[60];let X;return t[61]!==ne||t[62]!==A?(X=(0,Q.jsx)(te,{open:!0,onOpenChange:A,children:ne}),t[61]=ne,t[62]=A,t[63]=X):X=t[63],X}function tr(e){let t=(0,_t.c)(59),{target:n,onOpenChange:r}=e,{_:i}=c(),a=(0,$.useId)(),[o,l]=(0,$.useState)(null),[u,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(!1),[m,h]=(0,$.useState)(!1),[g,_]=(0,$.useState)(``),[v,b]=(0,$.useState)(!1),x;t[0]===n?x=t[1]:(x=()=>{if(l(null),d(null),p(!1),h(!1),!n)return;let{skill:e,editor:t}=n,r=e.absolutePath?.slice(0,-`/${e.path}`.length)??null;if(r===null){p(!0);return}let i=`${r}/${e.path.replace(/\/SKILL\.mdx?$/i,``)}`,a=`${r}/${Ue(t,e.scope)}/${e.name}`,o=new AbortController;for(let[t,n]of[[i,d],[a,l]])$e({source:t,name:e.name},o.signal).then(e=>{o.signal.aborted||(e.ok?n(e.skillMd):p(!0))}).catch(()=>{o.signal.aborted||p(!0)});return()=>o.abort()},t[0]=n,t[1]=x);let S=n?.skill.scope,O=n?.skill.name,k=n?.editor,A;if(t[2]!==S||t[3]!==O||t[4]!==k?(A=[S,O,k],t[2]=S,t[3]=O,t[4]=k,t[5]=A):A=t[5],(0,$.useEffect)(x,A),!n)return null;let{skill:j,editor:M}=n,N;t[6]!==i||t[7]!==M||t[8]!==r||t[9]!==j.name||t[10]!==j.scope||t[11]!==n||t[12]!==g?(N=async function(e){if(!n)return;b(!0);let t=await Ze({scope:j.scope,name:j.name,editor:M,action:e,...e===`rename`?{toName:g.trim()}:{}});if(b(!1),!t.ok){Z.error(i({id:`MIF36T`,values:{0:t.error}}));return}Z.success(i(e===`align`?{id:`QKgePK`,values:{editor:M}}:e===`make-source`?{id:`It9oAP`,values:{editor:M}}:{id:`b2ezG_`,values:{0:g.trim()}})),r(!1)},t[6]=i,t[7]=M,t[8]=r,t[9]=j.name,t[10]=j.scope,t[11]=n,t[12]=g,t[13]=N):N=t[13];let P=N,F,I;t[14]!==j.name||t[15]!==g?(I=g.trim(),F=I===``||!re.test(I)||I===j.name,t[14]=j.name,t[15]=g,t[16]=F,t[17]=I):(F=t[16],I=t[17]);let R=F,z;t[18]!==v||t[19]!==r?(z=e=>{!e&&!v&&r(!1)},t[18]=v,t[19]=r,t[20]=z):z=t[20];let B;t[21]!==M||t[22]!==j.name?(B=(0,Q.jsx)(w,{children:(0,Q.jsx)(s,{id:`q8aCbb`,values:{0:j.name,editor:M}})}),t[21]=M,t[22]=j.name,t[23]=B):B=t[23];let V;t[24]===M?V=t[25]:(V=(0,Q.jsx)(C,{children:(0,Q.jsx)(s,{id:`QASTNu`,values:{editor:M}})}),t[24]=M,t[25]=V);let H;t[26]!==V||t[27]!==B?(H=(0,Q.jsxs)(ee,{children:[B,V]}),t[26]=V,t[27]=B,t[28]=H):H=t[28];let U;t[29]!==u||t[30]!==o||t[31]!==f?(U=u!==null&&o!==null?(0,Q.jsx)(dt,{oldContent:u,newContent:o,layout:`unified`}):f?(0,Q.jsx)(`div`,{className:`flex min-h-56 items-center justify-center px-6 text-center text-muted-foreground text-sm`,children:(0,Q.jsx)(s,{id:`5BlXTD`})}):(0,Q.jsx)(`div`,{className:`flex min-h-56 items-center justify-center text-muted-foreground text-sm`,children:(0,Q.jsx)(s,{id:`1V17kO`})}),t[29]=u,t[30]=o,t[31]=f,t[32]=U):U=t[32];let W;t[33]!==P||t[34]!==M||t[35]!==a||t[36]!==R||t[37]!==m||t[38]!==j.name||t[39]!==g||t[40]!==I?(W=m?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Q.jsx)(L,{htmlFor:a,children:(0,Q.jsx)(s,{id:`pSimwP`,values:{editor:M}})}),(0,Q.jsx)(Ne,{id:a,value:g,onChange:e=>_(e.target.value),placeholder:`${j.name}-${M}`,"aria-invalid":R&&I!==``,onKeyDown:e=>{e.key===`Enter`&&!R&&P(`rename`)}})]}):null,t[33]=P,t[34]=M,t[35]=a,t[36]=R,t[37]=m,t[38]=j.name,t[39]=g,t[40]=I,t[41]=W):W=t[41];let G;t[42]!==U||t[43]!==W?(G=(0,Q.jsxs)(E,{className:`min-h-0 flex-1 overflow-auto`,children:[U,W]}),t[42]=U,t[43]=W,t[44]=G):G=t[44];let K;t[45]!==P||t[46]!==v||t[47]!==M||t[48]!==R||t[49]!==m||t[50]!==j.name?(K=(0,Q.jsx)(D,{children:m?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(y,{variant:`outline`,onClick:()=>h(!1),disabled:v,children:(0,Q.jsx)(s,{id:`iH8pgl`})}),(0,Q.jsx)(y,{onClick:()=>void P(`rename`),disabled:v||R,children:(0,Q.jsx)(s,{id:`AT0e50`})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(y,{variant:`outline`,onClick:()=>{_(`${j.name}-${M}`),h(!0)},disabled:v,children:(0,Q.jsx)(s,{id:`AT0e50`})}),(0,Q.jsx)(y,{variant:`outline`,onClick:()=>void P(`make-source`),disabled:v,children:(0,Q.jsx)(s,{id:`xWomUD`,values:{editor:M}})}),(0,Q.jsx)(y,{onClick:()=>void P(`align`),disabled:v,children:(0,Q.jsx)(s,{id:`PZn2LP`})})]})}),t[45]=P,t[46]=v,t[47]=M,t[48]=R,t[49]=m,t[50]=j.name,t[51]=K):K=t[51];let q;t[52]!==H||t[53]!==G||t[54]!==K?(q=(0,Q.jsxs)(T,{className:`flex max-h-[85vh] w-full max-w-3xl flex-col`,children:[H,G,K]}),t[52]=H,t[53]=G,t[54]=K,t[55]=q):q=t[55];let J;return t[56]!==q||t[57]!==z?(J=(0,Q.jsx)(te,{open:!0,onOpenChange:z,children:q}),t[56]=q,t[57]=z,t[58]=J):J=t[58],J}function nr(e){let t=(0,_t.c)(75),{skill:n,existingNames:r,onOpenChange:i,onRenamed:a}=e,o=Oe(),c=n!==null,l=(0,$.useId)(),[u,d]=(0,$.useState)(``),[f,p]=(0,$.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.name)},t[0]=n,t[1]=m);let h=n?.scope,g=n?.name,_;if(t[2]!==h||t[3]!==g?(_=[h,g],t[2]=h,t[3]=g,t[4]=_):_=t[4],(0,$.useEffect)(m,_),!n)return null;let v,b,x,S,E,O;if(t[5]!==r||t[6]!==u||t[7]!==n.name){E=u.trim(),O=E===n.name;let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\s/,t[14]=e):e=t[14];let i;t[15]===u?i=t[16]:(i=e.test(u),t[15]=u,t[16]=i),v=i,S=E.length>64,b=E===``||!re.test(E)||S,x=!b&&!O&&r.has(E),t[5]=r,t[6]=u,t[7]=n.name,t[8]=v,t[9]=b,t[10]=x,t[11]=S,t[12]=E,t[13]=O}else v=t[8],b=t[9],x=t[10],S=t[11],E=t[12],O=t[13];let k=x,A=!b&&!k&&!O&&!f,j;t[17]!==A||t[18]!==i||t[19]!==a||t[20]!==o||t[21]!==n||t[22]!==E?(j=async function(){if(!n||!A)return;p(!0);let e=await o({scope:n.scope,name:n.name},E);p(!1),e.ok&&(a?.(E),i(!1))},t[17]=A,t[18]=i,t[19]=a,t[20]=o,t[21]=n,t[22]=E,t[23]=j):j=t[23];let M=j,N;t[24]===i?N=t[25]:(N=e=>e?null:i(!1),t[24]=i,t[25]=N);let P;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(w,{children:(0,Q.jsx)(s,{id:`dw_3cv`})}),t[26]=P):P=t[26];let F;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsxs)(ee,{children:[P,(0,Q.jsx)(C,{children:(0,Q.jsx)(s,{id:`R9IDFz`})})]}),t[27]=F):F=t[27];let I;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(s,{id:`6YtxFj`}),t[28]=I):I=t[28];let R;t[29]===l?R=t[30]:(R=(0,Q.jsx)(L,{htmlFor:l,children:I}),t[29]=l,t[30]=R);let z;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>d(e.target.value),t[31]=z):z=t[31];let B;t[32]===M?B=t[33]:(B=e=>{e.key===`Enter`&&M()},t[32]=M,t[33]=B);let V=b||k,H=b&&E!==``||k?`${l}-error`:void 0,U;t[34]!==l||t[35]!==u||t[36]!==B||t[37]!==V||t[38]!==H?(U=(0,Q.jsx)(Ne,{id:l,value:u,onChange:z,onKeyDown:B,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,maxLength:64,"aria-invalid":V,"aria-describedby":H,className:`font-mono`}),t[34]=l,t[35]=u,t[36]=B,t[37]=V,t[38]=H,t[39]=U):U=t[39];let W;t[40]!==k||t[41]!==v||t[42]!==l||t[43]!==b||t[44]!==S||t[45]!==E?(W=b&&E!==``?(0,Q.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:v?(0,Q.jsx)(s,{id:`iUwpZI`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}}):S?(0,Q.jsx)(s,{id:`lK9c4T`}):(0,Q.jsx)(s,{id:`A50vr3`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}})}):k?(0,Q.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:(0,Q.jsx)(s,{id:`YJ1BTp`})}):null,t[40]=k,t[41]=v,t[42]=l,t[43]=b,t[44]=S,t[45]=E,t[46]=W):W=t[46];let G;t[47]!==R||t[48]!==U||t[49]!==W?(G=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[R,U,W]}),t[47]=R,t[48]=U,t[49]=W,t[50]=G):G=t[50];let K;t[51]===i?K=t[52]:(K=()=>i(!1),t[51]=i,t[52]=K);let q;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Q.jsx)(s,{id:`dEgA5A`}),t[53]=q):q=t[53];let J;t[54]!==f||t[55]!==K?(J=(0,Q.jsx)(y,{variant:`outline`,className:`font-mono uppercase`,onClick:K,disabled:f,children:q}),t[54]=f,t[55]=K,t[56]=J):J=t[56];let Y;t[57]===M?Y=t[58]:(Y=()=>void M(),t[57]=M,t[58]=Y);let ne=!A,X;t[59]===f?X=t[60]:(X=f?(0,Q.jsx)(s,{id:`tHKQ6j`}):(0,Q.jsx)(s,{id:`2wxgft`}),t[59]=f,t[60]=X);let ie;t[61]!==Y||t[62]!==ne||t[63]!==X?(ie=(0,Q.jsx)(y,{onClick:Y,disabled:ne,children:X}),t[61]=Y,t[62]=ne,t[63]=X,t[64]=ie):ie=t[64];let ae;t[65]!==J||t[66]!==ie?(ae=(0,Q.jsxs)(D,{children:[J,ie]}),t[65]=J,t[66]=ie,t[67]=ae):ae=t[67];let oe;t[68]!==G||t[69]!==ae?(oe=(0,Q.jsxs)(T,{children:[F,G,ae]}),t[68]=G,t[69]=ae,t[70]=oe):oe=t[70];let se;return t[71]!==c||t[72]!==oe||t[73]!==N?(se=(0,Q.jsx)(te,{open:c,onOpenChange:N,children:oe}),t[71]=c,t[72]=oe,t[73]=N,t[74]=se):se=t[74],se}function rr(){let e=(0,_t.c)(5),{_:t}=c(),n=We(),r=De(),i=ct(),a;return e[0]!==t||e[1]!==r||e[2]!==n||e[3]!==i?(a=async(e,a)=>{if(a===e.scope)return!1;Ve(e.scope,e.name);let o=await Qe({name:e.name,fromScope:e.scope,toScope:a});if(Be(e.scope,e.name),!o.ok)return Z.error(t({id:`07eGJB`,values:{0:o.error}})),!1;Z.success(t({id:`yhI6P0`,values:{0:e.name,1:n[a]}}));let s=i.status===`ready`?i.data.find(t=>t.scope===e.scope&&t.name===e.name):void 0;return r(s?Le(s):le(e.scope,e.name),a===`project`&&o.path!==void 0?`${o.path.replace(/\/+$/,``)}/SKILL`:le(a,e.name)),!0},e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function ir(e){let t=(0,_t.c)(38),{target:n,onOpenChange:r}=e,i=We(),a=rr(),[o,c]=(0,$.useState)(!1);if(!n)return null;let{scope:l,name:u,toScope:d}=n,f;t[0]!==o||t[1]!==r?(f=e=>!e&&!o&&r(!1),t[0]=o,t[1]=r,t[2]=f):f=t[2];let p=i[d],m;t[3]===p?m=t[4]:(m=(0,Q.jsx)(w,{children:(0,Q.jsx)(s,{id:`SXEdCq`,values:{0:p}})}),t[3]=p,t[4]=m);let h=i[l],g=i[d],_=i[d],v;t[5]!==u||t[6]!==h||t[7]!==g||t[8]!==_?(v={0:h,1:g,2:_,name:u},t[5]=u,t[6]=h,t[7]=g,t[8]=_,t[9]=v):v=t[9];let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b={0:(0,Q.jsx)(`code`,{className:`font-mono`})},t[10]=b):b=t[10];let x;t[11]===v?x=t[12]:(x=(0,Q.jsx)(C,{children:(0,Q.jsx)(s,{id:`7bIiJ7`,values:v,components:b})}),t[11]=v,t[12]=x);let S;t[13]!==m||t[14]!==x?(S=(0,Q.jsxs)(ee,{children:[m,x]}),t[13]=m,t[14]=x,t[15]=S):S=t[15];let E;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(s,{id:`dEgA5A`}),t[16]=E):E=t[16];let k;t[17]===o?k=t[18]:(k=(0,Q.jsx)(O,{asChild:!0,children:(0,Q.jsx)(y,{variant:`outline`,disabled:o,children:E})}),t[17]=o,t[18]=k);let A;t[19]!==a||t[20]!==u||t[21]!==r||t[22]!==l||t[23]!==d?(A=async()=>{c(!0),await a({scope:l,name:u},d),c(!1),r(!1)},t[19]=a,t[20]=u,t[21]=r,t[22]=l,t[23]=d,t[24]=A):A=t[24];let j;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(s,{id:`QWdKwH`}),t[25]=j):j=t[25];let M;t[26]!==o||t[27]!==A?(M=(0,Q.jsx)(y,{"data-testid":`skill-scope-move-confirm`,disabled:o,onClick:A,children:j}),t[26]=o,t[27]=A,t[28]=M):M=t[28];let N;t[29]!==k||t[30]!==M?(N=(0,Q.jsxs)(D,{children:[k,M]}),t[29]=k,t[30]=M,t[31]=N):N=t[31];let P;t[32]!==S||t[33]!==N?(P=(0,Q.jsxs)(T,{className:`sm:max-w-md`,children:[S,N]}),t[32]=S,t[33]=N,t[34]=P):P=t[34];let F;return t[35]!==f||t[36]!==P?(F=(0,Q.jsx)(te,{open:!0,onOpenChange:f,children:P}),t[35]=f,t[36]=P,t[37]=F):F=t[37],F}function ar(){let e=(0,_t.c)(45),{_:t}=c(),n=lt(),[r,i]=(0,$.useState)(null),[a,o]=(0,$.useState)(null),[s,l]=(0,$.useState)(null),[u,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(null),[m,h]=(0,$.useState)(null),[g,_]=(0,$.useState)(null),v;e[0]===t?v=e[1]:(v=async function(e,n,r){_(e.name);let i=await et({scope:e.scope,name:e.name,...n?{targets:[...n]}:{},...r?.linkMode===void 0?{}:{linkMode:r.linkMode}});if(_(null),!i.ok)return Z.error(t({id:`Mj8R8K`,values:{0:i.error}})),i;let a=or,o=new Set(i.hosts),s=i.hosts.filter(t=>!e.hosts.includes(t)),c=e.hosts.filter(e=>!o.has(e)),l=e=>{let t=i.warningCodes.indexOf(e);return t>=0?i.warnings[t]:void 0},u=l(`no-targets`);if(u)return Z.warning(u),i;if(s.length>0){let e=l(`scripts-present`);e&&Z.warning(e);let t=l(`no-description`);t&&Z.warning(t)}return i.hosts.length===0?Z.success(t({id:`4pDZ2N`,values:{0:e.name}})):s.length>0&&c.length===0?Z.success(t({id:`PPFQ3o`,values:{0:e.name,1:a(s)}})):c.length>0&&s.length===0?Z.success(t({id:`OOIVJo`,values:{0:e.name,1:a(c)}})):s.length>0&&c.length>0?Z.success(t({id:`OxplNM`,values:{0:e.name,1:a(s),2:a(c)}})):Z.success(t({id:`wDgmsr`,values:{0:e.name,1:a(i.hosts)}})),i},e[0]=t,e[1]=v);let y=v,b;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=async function(e,t){if(t.length!==0){_(e.name);for(let{target:n,mode:r}of t){let t=await rt({scope:e.scope,name:e.name,target:n,mode:r});if(!t.ok){Z.error(t.error);break}}_(null)}},e[2]=b):b=e[2];let x=b,S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=async function(e,t){_(e.name);let n=await t();return _(null),n},e[3]=S):S=e[3];let C=S,w;e[4]!==t||e[5]!==n?(w=async function(e,r){let i=await tt({scope:e.scope,name:e.name,existingNames:r});if(!i.ok){Z.error(t({id:`UPjaXD`,values:{0:e.name,1:i.error}}));return}Z.success(t({id:`0g7rCZ`,values:{0:i.name}})),n(e.scope,i.name)},e[4]=t,e[5]=n,e[6]=w):w=e[6];let T=w,E,D;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||i(null)},D=()=>i(null),e[7]=E,e[8]=D):(E=e[7],D=e[8]);let O;e[9]===r?O=e[10]:(O=(0,Q.jsx)(Zn,{skill:r,onOpenChange:E,onDeleted:D}),e[9]=r,e[10]=O);let ee=a?.skill??null,te=a?.existingNames??cr,k,A;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{e||o(null)},k=()=>o(null),e[11]=k,e[12]=A):(k=e[11],A=e[12]);let j;e[13]!==ee||e[14]!==te?(j=(0,Q.jsx)(nr,{skill:ee,existingNames:te,onOpenChange:A,onRenamed:k}),e[13]=ee,e[14]=te,e[15]=j):j=e[15];let M;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{e||l(null)},e[16]=M):M=e[16];let N;e[17]===s?N=e[18]:(N=(0,Q.jsx)(ir,{target:s,onOpenChange:M}),e[17]=s,e[18]=N);let P;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{e||d(null)},e[19]=P):P=e[19];let F;e[20]===u?F=e[21]:(F=(0,Q.jsx)(er,{target:u,onOpenChange:P}),e[20]=u,e[21]=F);let I;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{e||p(null)},e[22]=I):I=e[22];let L;e[23]===f?L=e[24]:(L=(0,Q.jsx)($n,{target:f,onOpenChange:I}),e[23]=f,e[24]=L);let R;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{e||h(null)},e[25]=R):R=e[25];let z;e[26]===m?z=e[27]:(z=(0,Q.jsx)(tr,{target:m,onOpenChange:R}),e[26]=m,e[27]=z);let B;e[28]!==j||e[29]!==N||e[30]!==F||e[31]!==L||e[32]!==z||e[33]!==O?(B=(0,Q.jsxs)(Q.Fragment,{children:[O,j,N,F,L,z]}),e[28]=j,e[29]=N,e[30]=F,e[31]=L,e[32]=z,e[33]=O,e[34]=B):B=e[34];let V=B,H,U,W,G,K;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(H=(e,t)=>o({skill:e,existingNames:t}),U=(e,t)=>l({scope:e.scope,name:e.name,toScope:t}),W=(e,t)=>d({skill:e,filePath:t}),G=(e,t)=>p(t===void 0?{skill:e}:{skill:e,prefix:t}),K=(e,t)=>h({skill:e,editor:t}),e[35]=H,e[36]=U,e[37]=W,e[38]=G,e[39]=K):(H=e[35],U=e[36],W=e[37],G=e[38],K=e[39]);let q;return e[40]!==V||e[41]!==T||e[42]!==y||e[43]!==g?(q={installingName:g,install:y,convertLocations:x,runLocationWrite:C,duplicate:T,requestDelete:i,requestRename:H,requestScopeMove:U,requestFileRename:W,requestFileCreate:G,requestForkResolve:K,dialogs:V},e[40]=V,e[41]=T,e[42]=y,e[43]=g,e[44]=q):q=e[44],q}function or(e){return e.map(sr).join(`, `)}function sr(e){return pe[e]??e}var cr=new Set;function lr(e){let t=(0,_t.c)(29),{skill:n,filePath:r,actions:i}=e,{_:a}=c(),o=typeof window<`u`?window.okDesktop:void 0,l=n.absolutePath?`${n.absolutePath}/${r}`:void 0,u=`${n.path}/${r}`,d;t[0]===a?d=t[1]:(d=async function(e){try{await ut(e),Z.success(a({id:`SXCSQd`}))}catch{Z.error(a({id:`cRHuuI`}))}},t[0]=a,t[1]=d);let f=d,p;t[2]!==i||t[3]!==r||t[4]!==n?(p=()=>i.requestFileRename(n,r),t[2]=i,t[3]=r,t[4]=n,t[5]=p):p=t[5];let m,h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(ht,{"aria-hidden":!0}),h=(0,Q.jsx)(s,{id:`2wxgft`}),t[6]=m,t[7]=h):(m=t[6],h=t[7]);let g;t[8]===p?g=t[9]:(g=(0,Q.jsxs)(k,{onSelect:p,children:[m,h]}),t[8]=p,t[9]=g);let _;t[10]===l?_=t[11]:(_=o&&l?(0,Q.jsxs)(k,{onSelect:()=>void o.shell.showItemInFolder(l),children:[(0,Q.jsx)(Ae,{"aria-hidden":!0}),(0,Q.jsx)(s,{id:`LtSYdi`})]}):null,t[10]=l,t[11]=_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsxs)(F,{children:[(0,Q.jsx)(ke,{"aria-hidden":!0}),(0,Q.jsx)(s,{id:`zd00pH`})]}),t[12]=v):v=t[12];let y;t[13]!==l||t[14]!==f?(y=l?(0,Q.jsx)(k,{onSelect:()=>void f(l),children:(0,Q.jsx)(s,{id:`z2funE`})}):null,t[13]=l,t[14]=f,t[15]=y):y=t[15];let b;t[16]!==f||t[17]!==u?(b=()=>void f(u),t[16]=f,t[17]=u,t[18]=b):b=t[18];let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(s,{id:`xloBjn`}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,Q.jsx)(k,{onSelect:b,children:x}),t[20]=b,t[21]=S);let C;t[22]!==S||t[23]!==y?(C=(0,Q.jsxs)(A,{children:[v,(0,Q.jsxs)(j,{children:[y,S]})]}),t[22]=S,t[23]=y,t[24]=C):C=t[24];let w;return t[25]!==C||t[26]!==g||t[27]!==_?(w=(0,Q.jsxs)(Q.Fragment,{children:[g,_,C]}),t[25]=C,t[26]=g,t[27]=_,t[28]=w):w=t[28],w}function ur(e){let t=(0,_t.c)(86),{skill:n,actions:r,existingNames:a}=e,{_:o}=c(),l=f(),u=We(),d=_().states,{dispatch:m}=pn(),h=Cn(n,r),g=typeof window<`u`?window.okDesktop:void 0,v=n.absolutePath,y;t[0]===o?y=t[1]:(y=async function(e){try{await ut(e),Z.success(o({id:`SXCSQd`}))}catch{Z.error(o({id:`cRHuuI`}))}},t[0]=o,t[1]=y);let b=y,x;t[2]===v?x=t[3]:(x=g&&v?(0,Q.jsxs)(k,{onSelect:()=>void g.shell.showItemInFolder(v),children:[(0,Q.jsx)(Ae,{"aria-hidden":!0}),(0,Q.jsx)(s,{id:`LtSYdi`})]}):null,t[2]=v,t[3]=x);let S;t[4]!==n.name||t[5]!==n.scope||t[6]!==l?(S=Yt({skillName:n.name,scope:n.scope,workspace:l}),t[4]=n.name,t[5]=n.scope,t[6]=l,t[7]=S):S=t[7];let C;t[8]!==m||t[9]!==d||t[10]!==S?(C=(0,Q.jsx)(Wn,{input:S,installStates:d,isElectronHost:g!=null,dispatch:m}),t[8]=m,t[9]=d,t[10]=S,t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(F,{children:[(0,Q.jsx)(ke,{"aria-hidden":!0}),(0,Q.jsx)(s,{id:`zd00pH`})]}),t[12]=w):w=t[12];let T;t[13]!==v||t[14]!==b?(T=v?(0,Q.jsx)(k,{onSelect:()=>void b(v),children:(0,Q.jsx)(s,{id:`z2funE`})}):null,t[13]=v,t[14]=b,t[15]=T):T=t[15];let E;t[16]!==b||t[17]!==n.path?(E=()=>void b(n.path),t[16]=b,t[17]=n.path,t[18]=E):E=t[18];let D;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(s,{id:`xloBjn`}),t[19]=D):D=t[19];let O;t[20]===E?O=t[21]:(O=(0,Q.jsx)(k,{onSelect:E,children:D}),t[20]=E,t[21]=O);let ee;t[22]!==T||t[23]!==O?(ee=(0,Q.jsxs)(A,{children:[w,(0,Q.jsxs)(j,{children:[T,O]})]}),t[22]=T,t[23]=O,t[24]=ee):ee=t[24];let te;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(I,{}),t[25]=te):te=t[25];let M;t[26]!==r||t[27]!==a||t[28]!==n?(M=()=>void r.duplicate(n,a),t[26]=r,t[27]=a,t[28]=n,t[29]=M):M=t[29];let N,P;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(i,{"aria-hidden":!0}),P=(0,Q.jsx)(s,{id:`euc6Ns`}),t[30]=N,t[31]=P):(N=t[30],P=t[31]);let L;t[32]===M?L=t[33]:(L=(0,Q.jsxs)(k,{onSelect:M,children:[N,P]}),t[32]=M,t[33]=L);let R;t[34]!==r||t[35]!==a||t[36]!==n?(R=()=>r.requestRename(n,a),t[34]=r,t[35]=a,t[36]=n,t[37]=R):R=t[37];let z,B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(ht,{"aria-hidden":!0}),B=(0,Q.jsx)(s,{id:`2wxgft`}),t[38]=z,t[39]=B):(z=t[38],B=t[39]);let V;t[40]===R?V=t[41]:(V=(0,Q.jsxs)(k,{onSelect:R,children:[z,B]}),t[40]=R,t[41]=V);let H;t[42]!==r||t[43]!==n?(H=()=>r.requestFileCreate(n),t[42]=r,t[43]=n,t[44]=H):H=t[44];let U,W;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(p,{"aria-hidden":!0}),W=(0,Q.jsx)(s,{id:`HdkSiO`}),t[45]=U,t[46]=W):(U=t[45],W=t[46]);let G;t[47]===H?G=t[48]:(G=(0,Q.jsxs)(k,{onSelect:H,children:[U,W]}),t[47]=H,t[48]=G);let K;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsxs)(F,{children:[(0,Q.jsx)(pt,{"aria-hidden":!0}),(0,Q.jsx)(s,{id:`TKQ7K-`})]}),t[49]=K):K=t[49];let q;t[50]!==r||t[51]!==n?(q=e=>r.requestForkResolve(n,e),t[50]=r,t[51]=n,t[52]=q):q=t[52];let J;t[53]!==h||t[54]!==n||t[55]!==q?(J=(0,Q.jsxs)(A,{children:[K,(0,Q.jsx)(j,{className:Sn,children:(0,Q.jsx)(On,{toggles:h,skill:n,onResolveFork:q})})]}),t[53]=h,t[54]=n,t[55]=q,t[56]=J):J=t[56];let Y;t[57]!==r||t[58]!==n?(Y=()=>r.requestScopeMove(n,n.scope===`project`?`global`:`project`),t[57]=r,t[58]=n,t[59]=Y):Y=t[59];let ne;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(ft,{"aria-hidden":!0}),t[60]=ne):ne=t[60];let X;t[61]!==u.global||t[62]!==u.project||t[63]!==n.scope?(X=n.scope===`project`?(0,Q.jsx)(s,{id:`bpytj4`,values:{0:u.global}}):(0,Q.jsx)(s,{id:`bpytj4`,values:{0:u.project}}),t[61]=u.global,t[62]=u.project,t[63]=n.scope,t[64]=X):X=t[64];let re;t[65]!==Y||t[66]!==X?(re=(0,Q.jsxs)(k,{onSelect:Y,children:[ne,X]}),t[65]=Y,t[66]=X,t[67]=re):re=t[67];let ie;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(I,{}),t[68]=ie):ie=t[68];let ae;t[69]!==r||t[70]!==n?(ae=()=>r.requestDelete(n),t[69]=r,t[70]=n,t[71]=ae):ae=t[71];let oe,se;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(Me,{"aria-hidden":!0}),se=(0,Q.jsx)(s,{id:`cnGeoo`}),t[72]=oe,t[73]=se):(oe=t[72],se=t[73]);let ce;t[74]===ae?ce=t[75]:(ce=(0,Q.jsxs)(k,{variant:`destructive`,onSelect:ae,children:[oe,se]}),t[74]=ae,t[75]=ce);let le;return t[76]!==ee||t[77]!==L||t[78]!==V||t[79]!==x||t[80]!==G||t[81]!==J||t[82]!==re||t[83]!==ce||t[84]!==C?(le=(0,Q.jsxs)(Q.Fragment,{children:[x,C,ee,te,L,V,G,J,re,ie,ce]}),t[76]=ee,t[77]=L,t[78]=V,t[79]=x,t[80]=G,t[81]=J,t[82]=re,t[83]=ce,t[84]=C,t[85]=le):le=t[85],le}export{Bt as C,ft as D,mt as E,Ut as S,gt as T,rn as _,Jn as a,cn as b,xn as c,Cn as d,Xt as f,Gt as g,Wt as h,ir as i,Sn as l,Jt as m,lr as n,Wn as o,Kt as p,ar as r,Vn as s,ur as t,On as u,un as v,Rt as w,pn as x,qt as y};
@@ -1 +1 @@
1
- import{r as e}from"./dist-Nvb76hAm.js";import{Sa as t,ga as n,kt as r,va as i}from"./dist-CLzUuFWF2.js";function a(e){return e.path.split(`/`).slice(0,-1).join(`/`)}var o=[`project`,`global`];function s(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}function c(e){return e.startsWith(`open-knowledge-pack-`)?e.slice(t.length):e}function l(e){let t=e.path.replace(/\/SKILL\.mdx?$/i,``);return e.scope===`global`?`~/${t}`:t}function u(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,`~`).replace(/^\/root/,`~`)}function d(e){let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):e}function f(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function p(){let{_:t}=e();return{project:t({id:`Es3G-g`}),global:t({id:`fvrHin`})}}function m(e,t){if(e.includes(`/`))return t===`global`?`~/${e}`:e;let r=e===`agents`?`.agents/skills`:(t===`global`?i:n)[e]??`.${e}/skills`;return t===`global`?`~/${r}`:r}function h(e,t){return!e||t===``?[]:Object.keys(e).filter(n=>e[n]===t)}function g(e){let t=e.hostAliases??{},n=e=>e.split(`/`).slice(0,-1).join(`/`),r=new Set(e.hosts),i=new Set([...e.hosts.filter(e=>!e.includes(`/`)).map(t=>m(t,e.scope).replace(/^~\//,``)),...(e.customPlacements??[]).map(e=>n(e.path)),...e.path.includes(`/`)?[n(e.path.replace(/\/SKILL\.mdx?$/i,``))]:[]]);return Object.entries(t).filter(([e,t])=>!r.has(e)&&i.has(t)).map(([e])=>e)}function _(e){let t=new Set(e.symlinkedHosts??[]),n=[],r=new Set,i=(e,t)=>{r.has(e)||(r.add(e),n.push({dir:e,symlink:t}))};i(l(e),t.has(e.hosts[0]??``));for(let n of e.hosts)i(`${m(n,e.scope)}/${e.name}`,t.has(n));for(let t of e.customPlacements??[])i(t.path,t.mode===`link`);return n}function v(e,t=e.hosts){let n=r.options,i=g(e);return[...t.includes(`agents`)?[`agents`]:[],...n.filter(e=>t.includes(e)||i.includes(e)),...(e.customPlacements??[]).map(e=>a(e))]}export{d as a,m as c,p as d,f,v as i,s as l,h as n,c as o,a as r,_ as s,o as t,u};
1
+ import{r as e}from"./dist-Nvb76hAm.js";import{Sa as t,ga as n,kt as r,va as i}from"./dist-8iqUcAwa2.js";function a(e){return e.path.split(`/`).slice(0,-1).join(`/`)}var o=[`project`,`global`];function s(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}function c(e){return e.startsWith(`open-knowledge-pack-`)?e.slice(t.length):e}function l(e){let t=e.path.replace(/\/SKILL\.mdx?$/i,``);return e.scope===`global`?`~/${t}`:t}function u(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,`~`).replace(/^\/root/,`~`)}function d(e){let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):e}function f(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function p(){let{_:t}=e();return{project:t({id:`Es3G-g`}),global:t({id:`fvrHin`})}}function m(e,t){if(e.includes(`/`))return t===`global`?`~/${e}`:e;let r=e===`agents`?`.agents/skills`:(t===`global`?i:n)[e]??`.${e}/skills`;return t===`global`?`~/${r}`:r}function h(e,t){return!e||t===``?[]:Object.keys(e).filter(n=>e[n]===t)}function g(e){let t=e.hostAliases??{},n=e=>e.split(`/`).slice(0,-1).join(`/`),r=new Set(e.hosts),i=new Set([...e.hosts.filter(e=>!e.includes(`/`)).map(t=>m(t,e.scope).replace(/^~\//,``)),...(e.customPlacements??[]).map(e=>n(e.path)),...e.path.includes(`/`)?[n(e.path.replace(/\/SKILL\.mdx?$/i,``))]:[]]);return Object.entries(t).filter(([e,t])=>!r.has(e)&&i.has(t)).map(([e])=>e)}function _(e){let t=new Set(e.symlinkedHosts??[]),n=[],r=new Set,i=(e,t)=>{r.has(e)||(r.add(e),n.push({dir:e,symlink:t}))};i(l(e),t.has(e.hosts[0]??``));for(let n of e.hosts)i(`${m(n,e.scope)}/${e.name}`,t.has(n));for(let t of e.customPlacements??[])i(t.path,t.mode===`link`);return n}function v(e,t=e.hosts){let n=r.options,i=g(e);return[...t.includes(`agents`)?[`agents`]:[],...n.filter(e=>t.includes(e)||i.includes(e)),...(e.customPlacements??[]).map(e=>a(e))]}export{d as a,m as c,p as d,f,v as i,s as l,h as n,c as o,a as r,_ as s,o as t,u};