@inkeep/open-knowledge 0.47.3 → 0.47.5

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 (120) hide show
  1. package/dist/{acp-harness-probe-QNrRVJhc.mjs → acp-harness-probe-inKMbnTO.mjs} +2 -2
  2. package/dist/cli.mjs +57 -57
  3. package/dist/constants-iJqy8Hia.mjs +2 -0
  4. package/dist/{git-handle-CllEzrX4.mjs → git-handle-BKNpWc-0.mjs} +2 -2
  5. package/dist/git-handle-vAOkZizz.mjs +1 -0
  6. package/dist/index.mjs +1 -1
  7. package/dist/init-Bp0b6aXB.mjs +1 -0
  8. package/dist/{init-DL_j9FNQ.mjs → init-D0r4e25M.mjs} +36 -36
  9. package/dist/{launch-json-removal-B-K7szy8.mjs → launch-json-removal-p9WHQkrd.mjs} +2 -2
  10. package/dist/loader-C6qDEjnp.mjs +1 -0
  11. package/dist/{loader-Ro5TBLoF.mjs → loader-DI6RYqwy.mjs} +2 -2
  12. package/dist/md-manager-BuZAb56s.mjs +2 -0
  13. package/dist/{open-browser-DiR8zaBV.mjs → open-browser-BGPHwSRQ.mjs} +2 -2
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/{preview-CyVtre2s.mjs → preview-B-2W99IX.mjs} +2 -2
  16. package/dist/preview-CITNy9Et.mjs +1 -0
  17. package/dist/public/assets/{ActivityModeContent-2l8BA531.js → ActivityModeContent-Cs_G4A2z.js} +1 -1
  18. package/dist/public/assets/{AgentDiffPane-wqdF9lpR.js → AgentDiffPane-CWfs6hRd.js} +1 -1
  19. package/dist/public/assets/{AgentThreadClientBinder-56IhVeqo.js → AgentThreadClientBinder-GaJMQpHN.js} +1 -1
  20. package/dist/public/assets/{ChangedOutsideBadge-eT1ODdAD.js → ChangedOutsideBadge-DhOK_p1U.js} +1 -1
  21. package/dist/public/assets/{CodeMirrorPropInput-L7fbBlLy.js → CodeMirrorPropInput-DvoNWmdR.js} +1 -1
  22. package/dist/public/assets/{DocumentContext-DD95gIt4.js → DocumentContext-BaYg4CBg.js} +1 -1
  23. package/dist/public/assets/{EditorModeToggle-CR5jA0YM.js → EditorModeToggle-C9I-Efpm.js} +1 -1
  24. package/dist/public/assets/{EnableSyncConfirmDialog-C5fNw26t.js → EnableSyncConfirmDialog-DCen-fKk.js} +1 -1
  25. package/dist/public/assets/FeedbackForm-EBcXu2CA.js +1 -0
  26. package/dist/public/assets/{GraphPanel-BDGxPSvY.js → GraphPanel-B9HMPssx.js} +1 -1
  27. package/dist/public/assets/{ImportSkillDialog-B2ilfqxe.js → ImportSkillDialog-BjLITatU.js} +1 -1
  28. package/dist/public/assets/{LintConfigEditor-ByUOzhaw.js → LintConfigEditor-D6dnss9h.js} +1 -1
  29. package/dist/public/assets/{ManagedArtifactProperties-CVGjtd3P.js → ManagedArtifactProperties-BO70pd59.js} +1 -1
  30. package/dist/public/assets/ManagedArtifactProperties-BkBzFhn7.js +1 -0
  31. package/dist/public/assets/{McpConsentDialogBody-B3ubISnW.js → McpConsentDialogBody-CZC9r_Ug.js} +1 -1
  32. package/dist/public/assets/{MermaidDocEditor-CftVeU4U.js → MermaidDocEditor-C6SV6GjT.js} +1 -1
  33. package/dist/public/assets/{ReportBugDialogBody-CWbkwdNL.js → ReportBugDialogBody-BZrgGB1Z.js} +1 -1
  34. package/dist/public/assets/{SchemaConfigEditor-UkvF3UAn.js → SchemaConfigEditor-BYBjMHsb.js} +1 -1
  35. package/dist/public/assets/{SessionsHost-Pa6hY3sI.js → SessionsHost-llsZYWbP.js} +2 -2
  36. package/dist/public/assets/{SettingsDialogBody-Be8P3Vqa.js → SettingsDialogBody-DXaeMFz_.js} +1 -1
  37. package/dist/public/assets/{ShareBranchSwitchDialog-BmGWQCY6.js → ShareBranchSwitchDialog-DUzjoGVJ.js} +1 -1
  38. package/dist/public/assets/{ShareReceiveDialog-BoqZXYhT.js → ShareReceiveDialog-BQhhG70Y.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveMissDialog-B_DT1dz2.js → ShareReceiveMissDialog-CaI0eq9C.js} +1 -1
  40. package/dist/public/assets/{SkillEditBanner-hcLaEQ2F.js → SkillEditBanner-WG0cwpb-.js} +1 -1
  41. package/dist/public/assets/{SkillOriginInline-CtSdZ4_j.js → SkillOriginInline-8KJ3qbz8.js} +1 -1
  42. package/dist/public/assets/{SkillToolbarControls-DQYbvJTe.js → SkillToolbarControls-LDRTNFTx.js} +1 -1
  43. package/dist/public/assets/{SourceEditor-DX9L1Mci.js → SourceEditor-nYPGo8QU.js} +1 -1
  44. package/dist/public/assets/{TerminalPanel-WTiFd3Z6.js → TerminalPanel-CkcArSmy.js} +1 -1
  45. package/dist/public/assets/{TerminalWindowApp-CnhrK_tv.js → TerminalWindowApp-COjq6Uas.js} +1 -1
  46. package/dist/public/assets/{TextDocEditor-BGlQEeBq.js → TextDocEditor-eS5P-G2H.js} +1 -1
  47. package/dist/public/assets/{ThreadView-CExveDEV.js → ThreadView-v9Y3Ih_a.js} +1 -1
  48. package/dist/public/assets/{TimelineDiffPane-DDFvXSlv.js → TimelineDiffPane-3nkpH5uW.js} +1 -1
  49. package/dist/public/assets/{agent-diff-store-jazihC28.js → agent-diff-store-PJFwSxS1.js} +1 -1
  50. package/dist/public/assets/{agent-visibility-Ch0XQMkJ.js → agent-visibility-Cieocxzz.js} +1 -1
  51. package/dist/public/assets/{auth-state-cache-D47fide1.js → auth-state-cache-B8KE-_17.js} +1 -1
  52. package/dist/public/assets/{client-version-CHRlMl4l.js → client-version-uMlMQx33.js} +1 -1
  53. package/dist/public/assets/{config-context-B2fceTMP.js → config-context-BIynQsCe.js} +1 -1
  54. package/dist/public/assets/{config-provider-Cb43FIW2.js → config-provider-DKj_NBqh.js} +1 -1
  55. package/dist/public/assets/{dist-5ovMzVKN2.js → dist-CrqBb5y32.js} +175 -175
  56. package/dist/public/assets/{doc-paths-BFNbv2er.js → doc-paths-CCYuGvJq.js} +1 -1
  57. package/dist/public/assets/{documents-events-BM8xyAJz.js → documents-events-CdU1iFH9.js} +1 -1
  58. package/dist/public/assets/{file-tree-adapter-C1zJK1Gk.js → file-tree-adapter-a1hBKu8z.js} +1 -1
  59. package/dist/public/assets/{file-tree-utils-Dma5c4k_.js → file-tree-utils-CClHAhYa.js} +1 -1
  60. package/dist/public/assets/{folder-config-api-BxuLFuqM.js → folder-config-api-6QhNU0oa.js} +1 -1
  61. package/dist/public/assets/{index-DlH6tzhG.js → index-kaTVsIsC.js} +108 -108
  62. package/dist/public/assets/{lint-config-client-DDxBMTZk.js → lint-config-client-B0H2okzr.js} +1 -1
  63. package/dist/public/assets/{markdownlint-rule-browser-c2Uv_5Ry.js → markdownlint-rule-browser-BXGIkBuD.js} +1 -1
  64. package/dist/public/assets/{navigation-targets-D9VW9WdW.js → navigation-targets-BwmQHp3k.js} +1 -1
  65. package/dist/public/assets/{open-managed-artifact-tab-CLwVAGCD.js → open-managed-artifact-tab-BzW5kLR0.js} +1 -1
  66. package/dist/public/assets/{pending-receive-nav-store-BmcjNZOu.js → pending-receive-nav-store-B1W7hvut.js} +1 -1
  67. package/dist/public/assets/{prop-types-BPmLSxhG.js → prop-types-DIaGyPZM.js} +1 -1
  68. package/dist/public/assets/{receive-store-BlAqmJZT.js → receive-store-DlIsfkuF.js} +1 -1
  69. package/dist/public/assets/{selection-context-DJvv-kK_.js → selection-context-DS--IqEv.js} +1 -1
  70. package/dist/public/assets/{skill-actions-CfQkZqK6.js → skill-actions-DCISbh85.js} +2 -2
  71. package/dist/public/assets/skill-scope-7fBhGcjl.js +1 -0
  72. package/dist/public/assets/{skills-api-BTy9LAk0.js → skills-api-wUsPYcxD.js} +1 -1
  73. package/dist/public/assets/{src-hNXjwMT1.js → src-ScxRfF8q.js} +1 -1
  74. package/dist/public/assets/{tag-pill-input-DVdwNfBT.js → tag-pill-input-Bx_oWl-2.js} +1 -1
  75. package/dist/public/assets/{target-navigation-intent-C6AhTsfc.js → target-navigation-intent-D2TXEip5.js} +1 -1
  76. package/dist/public/assets/{terminal-launch-events-B1DGOVIv.js → terminal-launch-events-B3gBFWc1.js} +1 -1
  77. package/dist/public/assets/{terminal-telemetry-CviFLmIq.js → terminal-telemetry-Bv3GE2Aw.js} +1 -1
  78. package/dist/public/assets/{typing-burst-detector-B4AQIJp7.js → typing-burst-detector-lX1cLLkC.js} +2 -2
  79. package/dist/public/assets/{uninstall-CfW-qETg.js → uninstall-BILpXTW1.js} +1 -1
  80. package/dist/public/assets/{use-activity-panel-D8pDT3xu.js → use-activity-panel-CxtCUEYv.js} +1 -1
  81. package/dist/public/assets/{use-collab-url-CUHlgRv5.js → use-collab-url-BjRhUqsT.js} +1 -1
  82. package/dist/public/assets/{use-live-xterm-theme-CLCjRdjJ.js → use-live-xterm-theme-Cvtrg0j6.js} +1 -1
  83. package/dist/public/assets/{use-open-skill-akwbVkG4.js → use-open-skill-BHdzD0v1.js} +1 -1
  84. package/dist/public/assets/{use-settings-route-BnOIfxuB.js → use-settings-route-aXWIMVRt.js} +1 -1
  85. package/dist/public/assets/{use-skill-directory-CSx9txvQ.js → use-skill-directory-BV092Gnw.js} +1 -1
  86. package/dist/public/assets/{use-skill-origin-DvSOmIz_.js → use-skill-origin-DMt7ay7U.js} +1 -1
  87. package/dist/public/assets/{use-skills-DcLUuUJ9.js → use-skills-C7huRzJa.js} +1 -1
  88. package/dist/public/assets/{use-terminal-enabled-CgG0yd-l.js → use-terminal-enabled-C5zv0ln-.js} +1 -1
  89. package/dist/public/assets/{use-timeline-entry-diff-DD-1OHsM.js → use-timeline-entry-diff-EbqHCjsV.js} +1 -1
  90. package/dist/public/assets/{use-workspace-J5QvjwOx.js → use-workspace-D80aSSBD.js} +1 -1
  91. package/dist/public/index.html +41 -41
  92. package/dist/public/uninstall.html +2 -2
  93. package/dist/{repair-launch-json-DlAJs_pz.mjs → repair-launch-json-CSPeJG-m.mjs} +2 -2
  94. package/dist/{repair-mcp-configs-Bg-qmFa_.mjs → repair-mcp-configs-Basw3obQ.mjs} +2 -2
  95. package/dist/{repair-skills-CYkvjSVb.mjs → repair-skills-CXOdNyyU.mjs} +2 -2
  96. package/dist/repair-skills-CdFjRSeM.mjs +1 -0
  97. package/dist/{server-lock-CmYdHyX7.mjs → server-lock-9wk8At58.mjs} +2 -2
  98. package/dist/server-lock-DxjYF04b.mjs +1 -0
  99. package/dist/src-7fluFHtm.mjs +1 -0
  100. package/dist/{src-2gMaOH-l.mjs → src-BA6UmYHS.mjs} +418 -418
  101. package/dist/src-D81OiBLA.mjs +20 -0
  102. package/dist/{src-CHSJwcpc.mjs → src-Dkrbi5Bh.mjs} +87 -87
  103. package/dist/start-B5xwD4lL.mjs +1 -0
  104. package/dist/{start-CszIxyyk.mjs → start-DUP_Th9B.mjs} +3 -3
  105. package/dist/{write-project-skill-jk9SeWrA.mjs → write-project-skill-D_i5y_ki.mjs} +4 -4
  106. package/package.json +4 -4
  107. package/dist/constants-C5EnGQBy.mjs +0 -2
  108. package/dist/git-handle-DJPLRe3o.mjs +0 -1
  109. package/dist/init-I4_eavst.mjs +0 -1
  110. package/dist/loader-_DlE802w.mjs +0 -1
  111. package/dist/md-manager-DqRVEVmJ.mjs +0 -2
  112. package/dist/preview-CwNUTst2.mjs +0 -1
  113. package/dist/public/assets/FeedbackForm-macxQS8x.js +0 -1
  114. package/dist/public/assets/ManagedArtifactProperties-m1GRSrIt.js +0 -1
  115. package/dist/public/assets/skill-scope-DwJ84s_r.js +0 -1
  116. package/dist/repair-skills-R8jaRgSC.mjs +0 -1
  117. package/dist/server-lock-D61z37T2.mjs +0 -1
  118. package/dist/src--MxQA4BK.mjs +0 -20
  119. package/dist/src-B7qPUQHJ.mjs +0 -1
  120. package/dist/start-BFzPdz8R.mjs +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calendar-DLNiQf9e.js","./chunk-CYidjpOJ.js","./button-RQ5o7P7w.js","./dist-DUWYPul7.js","./react-f2sANaYj.js","./bundle-mjs-SHeFpKGC.js","./compiler-runtime-BfE3aGVn.js","./jsx-runtime-BUgB2tll.js","./utils-CPqDy6Hr.js","./format-DAPkd5Gj.js","./chevron-down-BeptYHqQ.js","./createLucideIcon-DihYAFEK.js","./chevron-left-B-obKYha.js","./chevron-right-CABnKLlm.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Cn as r,Gt as i,S as a,Ut as o,_ as s,g as c,hn as l,i as u,nt as d,vn as f,xn as p,y as m}from"./DocumentContext-DD95gIt4.js";import{t as h}from"./react-f2sANaYj.js";import{n as g,r as _}from"./dist-Nvb76hAm.js";import{t as v}from"./compiler-runtime-BfE3aGVn.js";import{a as y,c as b,s as x,u as S}from"./terminal-input-events-BGPQuYMh.js";import{t as C}from"./utils-CPqDy6Hr.js";import{t as w}from"./button-RQ5o7P7w.js";import{i as T,n as E,t as D}from"./tooltip-x7BNUa3s.js";import{n as O,r as k,t as A}from"./collapsible-OhEmjTXw.js";import{T as j,it as M}from"./CodeMirrorPropInput-L7fbBlLy.js";import{t as N}from"./checkbox-DoJAOcMt.js";import{c as P,l as F,m as I,r as L,t as R}from"./dropdown-menu-AlVJ7dJz.js";import{i as z,n as B,o as V,s as H,t as U}from"./select-BUOcREjn.js";import{Aa as ee,Bn as W,Ct as G,F as K,I as q,Ir as J,Ja as te,Kr as ne,Ma as re,Mt as ie,Na as ae,O as oe,Rr as se,S as ce,Sr as le,Ua as ue,Vn as de,Zt as fe,ft as pe,ht as me,ja as he,mt as ge,q as _e,wr as ve,x as ye,za as be,zr as xe}from"./dist-5ovMzVKN2.js";import{t as Se}from"./createLucideIcon-DihYAFEK.js";import{t as Ce}from"./braces-BG3bQFuB.js";import{t as we}from"./chevron-down-BeptYHqQ.js";import{t as Te}from"./chevron-right-CABnKLlm.js";import{o as Ee,r as De}from"./folder-config-api-BxuLFuqM.js";import{t as Oe}from"./hash-BXtq910s.js";import{t as ke}from"./trash-2-WxyktwvM.js";import{t as Ae}from"./triangle-alert-C2yId37R.js";import{t as je}from"./x-xV4a4mi6.js";import{n as Me}from"./dist-uN7pEWl0.js";import{t as Ne}from"./input-Cm94Cun3.js";import{t as Y}from"./dist-CzC3AWOn.js";import{f as Pe,x as Fe}from"./doc-paths-BFNbv2er.js";import{K as Ie,U as Le,b as Re,m as ze}from"./navigation-targets-D9VW9WdW.js";import{d as Be}from"./documents-events-BM8xyAJz.js";import{o as Ve}from"./skill-scope-DwJ84s_r.js";import{t as He}from"./badge-CAMtyz4F.js";import{g as Ue}from"./skills-api-BTy9LAk0.js";import{t as We}from"./external-link-Dvu-nzFi.js";import{t as Ge}from"./use-skills-DcLUuUJ9.js";import{a as Ke,l as qe,r as Je,t as Ye}from"./selection-context-DJvv-kK_.js";import{t as Xe}from"./textarea-Cl4IJ1LU.js";import{l as Ze}from"./lint-config-client-DDxBMTZk.js";import{a as Qe,d as $e,f as et,i as tt,l as nt,m as rt,o as it,p as at,s as ot,t as st,u as ct}from"./sortable.esm-BuA5-2It.js";import{C as lt,S as ut,_ as dt,a as ft,b as pt,c as mt,g as ht,h as gt,i as _t,l as vt,n as yt,o as bt,r as xt,s as St,t as Ct,v as wt,w as Tt,x as Et,y as Dt}from"./format-DAPkd5Gj.js";var Ot=Se(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),kt=Se(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),At=Se(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),jt=Se(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Mt=Se(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Nt=Se(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Pt=Se(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Ft=Se(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),X=n(),Z=e(h(),1),Q=v(),It=`open-knowledge:doc-panel-tab`,Lt=null;function Rt(){let e=Lt;return Lt=null,e}function zt(e,t=typeof window>`u`?new EventTarget:window){Lt=e,t.dispatchEvent(new CustomEvent(It,{detail:{tab:e}}))}function Bt(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail?.tab:void 0;n&&e(n)};return t.addEventListener(It,n),()=>t.removeEventListener(It,n)}var Vt=Object.defineProperty,Ht=(e,t)=>{for(var n in t)Vt(e,n,{get:t[n],enumerable:!0})},Ut={};Ht(Ut,{ActiveEmoji:()=>kr,Empty:()=>Or,List:()=>wr,Loading:()=>Er,Root:()=>or,Search:()=>sr,SkinTone:()=>Ar,SkinToneSelector:()=>Tr,Viewport:()=>lr});var Wt=`'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif`,Gt=[`none`,`light`,`medium-light`,`medium`,`medium-dark`,`dark`];function Kt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var qt=2,Jt=null;function Yt(e){try{Jt??=document.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0})}catch{}if(!Jt||(queueMicrotask(()=>{Jt&&=null}),Jt.canvas.width=qt,Jt.canvas.height=qt,Jt.font=`2px ${Wt}`,Jt.textBaseline=`middle`,Jt.measureText(e).width>=qt*2))return!1;Jt.fillStyle=`#00f`,Jt.fillText(e,0,0);let t=Jt.getImageData(0,0,qt,qt).data;Jt.clearRect(0,0,qt,qt),Jt.fillStyle=`#f00`,Jt.fillText(e,0,0);let n=Jt.getImageData(0,0,qt,qt).data;for(let e=0;e<qt*qt*4;e+=4)if(t[e]!==n[e]||t[e+1]!==n[e+1]||t[e+2]!==n[e+2])return!1;return!0}function Xt(e,t,n){try{let r=e.getItem(t);if(!r)throw Error(`No value found for "${t}".`);return n(JSON.parse(r))}catch{return null}}function Zt(e,t,n){e.setItem(t,JSON.stringify(n))}function Qt(e){return t=>t===void 0?void 0:e(t)}function $t(e){return t=>t===null?null:e(t)}function en(e){if(typeof e!=`string`)throw Error();return e}function tn(e){if(typeof e!=`number`)throw Error();return e}function nn(e){if(typeof e!=`boolean`)throw Error();return e}function rn(e){return t=>{if(typeof t!=`object`||!t)throw Error();let n={};for(let r in e){let i=t[r];i===void 0&&e[r](void 0),n[r]=e[r](i)}return n}}function an(e){return t=>{if(!Array.isArray(t))throw Error();return t.length>0&&e(t[0]),t}}var on=(e,t)=>`${e}/${t}/data.json`,sn=(e,t)=>`${e}/${t}/messages.json`,cn=`bn.da.de.en-gb.en.es-mx.es.et.fi.fr.hi.hu.it.ja.ko.lt.ms.nb.nl.pl.pt.ru.sv.th.uk.vi.zh-hant.zh`.split(`.`),ln=`en`,un=e=>`frimousse/data/${e}`,dn=`frimousse/metadata`;async function fn(e,t){try{return(await fetch(e,{method:`HEAD`,signal:t})).headers.get(`etag`)}catch{return null}}async function pn(e,t,n){let[{emojis:r,emojisEtag:i},{messages:a,messagesEtag:o}]=await Promise.all([fetch(on(e,t),{signal:n}).then(async e=>({emojis:await e.json(),emojisEtag:e.headers.get(`etag`)})),fetch(sn(e,t),{signal:n}).then(async e=>({messages:await e.json(),messagesEtag:e.headers.get(`etag`)}))]);return{emojis:r,messages:a,emojisEtag:i,messagesEtag:o}}async function mn(e,t,n){let[r,i]=await Promise.all([fn(on(e,t),n),fn(sn(e,t),n)]);return{emojisEtag:r,messagesEtag:i}}function hn(e){return e.skins?e.skins.filter(e=>typeof e.tone==`number`).reduce((e,t)=>{let n=Gt[t.tone];return e[n]=t.emoji,e},{}):void 0}async function gn(e,t,n){let{emojis:r,emojisEtag:i,messages:a,messagesEtag:o}=await pn(e,t,n),s=a.subgroups.find(e=>e.key===`country-flag`||e.key===`subdivision-flag`),c=a.groups.filter(e=>e.key!==`component`),l=r.filter(e=>`group`in e),u=c.map(e=>({index:e.order,label:Kt(e.message)})),d=a.skinTones.reduce((e,t)=>(e[t.key]=Kt(t.message),e),{}),f={locale:t,emojis:l.map(e=>({emoji:e.emoji,category:e.group,version:e.version,label:Kt(e.label),tags:e.tags??[],countryFlag:s&&e.subgroup===s.order||void 0,skins:hn(e)})),categories:u,skinTones:d};return Zt(localStorage,un(t),{data:f,metadata:{emojisEtag:i,messagesEtag:o}}),f}function _n(e,t){let n=new Map;for(let t of e)n.has(t.version)||n.set(t.version,t.emoji);let r=[...n.keys()].sort((e,t)=>t-e),i=r[0]??0,a=Yt(`🇪🇺`);if(typeof t==`number`)return{emojiVersion:t,countryFlags:a};for(let e of r)if(Yt(n.get(e)))return{emojiVersion:e,countryFlags:a};return{emojiVersion:i,countryFlags:a}}var vn=rn({emojiVersion:tn,countryFlags:nn}),yn=rn({data:rn({locale:en,emojis:an(rn({emoji:en,category:tn,label:en,version:tn,tags:an(en),countryFlag:Qt(nn),skins:Qt(rn({light:en,"medium-light":en,medium:en,"medium-dark":en,dark:en}))})),categories:an(rn({index:tn,label:en})),skinTones:rn({light:en,"medium-light":en,medium:en,"medium-dark":en,dark:en})}),metadata:rn({emojisEtag:$t(en),messagesEtag:$t(en)})});async function bn({locale:e,emojiVersion:t,emojibaseUrl:n,signal:r}){let i=typeof n==`string`?n:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof t==`number`?Math.floor(t):`latest`}`,a=Xt(sessionStorage,dn,vn),o=Xt(localStorage,un(e),yn),s;if(!o)s=await gn(i,e,r);else if(a)s=o.data;else try{let{emojisEtag:t,messagesEtag:n}=await mn(i,e,r);s=!t||!n||t!==o.metadata.emojisEtag||n!==o.metadata.messagesEtag?await gn(i,e,r):o.data}catch{s=o.data}return a??=_n(s.emojis,t),Zt(sessionStorage,dn,a),{locale:e,emojis:s.emojis.filter(e=>{let t=e.version<=a.emojiVersion;return e.countryFlag?t&&a.countryFlags:t}),categories:s.categories,skinTones:s.skinTones}}function xn(e){return cn.includes(e)?e:(console.warn(`Locale "${e}" is not supported, using "${ln}" instead.`),ln)}function Sn(e){return Gt.includes(e)?e:(console.warn(`Skin tone "${e}" is not valid, using "none" instead.`),`none`)}function Cn(e,t){let n=[];if(t<=0)return n;for(let r=0,i=e.length;r<i;r+=t)n.push(e.slice(r,r+t));return n}function wn(e,t){if(!t)return e;let n=t.toLowerCase().trim(),r=new WeakMap;return e.filter(e=>{let t=0;e.label.toLowerCase().includes(n)&&(t+=10);for(let r of e.tags)r.toLowerCase().includes(n)&&(t+=1);return t>0?(r.set(e,t),!0):!1}).sort((e,t)=>(r.get(t)??0)-(r.get(e)??0))}function Tn(e,t,n,r){let i=wn(e.emojis,r),a=[],o=[],s=[],c={},l=0,u=0;for(let e of i)c[e.category]||(c[e.category]=[]),c[e.category].push({emoji:n&&n!==`none`&&e.skins?e.skins[n]:e.emoji,label:e.label});for(let n of e.categories){let e=c[n.index];if(!e||e.length===0)continue;let r=Cn(Array.from(e),t).map(e=>({categoryIndex:l,emojis:e}));a.push(...r),o.push({label:n.label,rowsCount:r.length,startRowIndex:u}),s.push(u),l++,u+=r.length}return{count:i.length,categories:o,categoriesStartRowIndices:s,rows:a,skinTones:e.skinTones}}function En(e){let t={},n=null,r=null,i=new Set,a=()=>{if(n){t=n,n=null;for(let e of i)e(t)}r=null},o=()=>n??t,s=e=>{n??=t,Object.assign(n,typeof e==`function`?e(o()):e),r||=requestAnimationFrame(a)};return t=e(s,o),{get:o,set:s,subscribe:e=>(i.add(e),()=>i.delete(e))}}function Dn(e){let[t]=(0,Z.useState)(e);return t}function On(e){let t=(0,Z.createContext)(null);return{useStore:()=>{let n=(0,Z.useContext)(t);if(!n)throw Error(e);return n},Provider:({store:e,children:n})=>(0,X.jsx)(t.Provider,{value:e,children:n})}}function kn(e,t,n=Object.is){let[r,i]=(0,Z.useState)(()=>t(e.get()));return(0,Z.useEffect)(()=>e.subscribe(()=>{let r=t(e.get());i(e=>n(e,r)?e:r)}),[e,t,n]),(0,Z.useDebugValue)(r),r}function An(e,t,n){return kn(e,(0,Z.useCallback)(e=>e[t],[t]),n)}var jn=2;function Mn(e,t,n,r,i){let a=0;return En((o,s)=>({locale:t,columns:n,sticky:r,skinTone:i,onEmojiSelect:e,data:null,search:``,interaction:`none`,activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:e=>{let t=s(),n=e?.data??t.data,r=e?.categoryHeaderHeight??t.categoryHeaderHeight,i=e?.rowHeight??t.rowHeight,c=e?.viewportHeight??t.viewportHeight;if(!n||n.rows.length===0||!r||!i||!c)return o({...e,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let l=0,u=0;for(let e of n.categories)if(u++*r+e.startRowIndex*i<a)l+=r;else break;let d=n.categories.length*r+n.rows.length*i,f=Math.floor(jn*i/2),p=Math.ceil(jn*i/2),m=Math.min(a-l-f,d-c),h=m+c+p,g=Math.max(0,Math.floor(m/i)),_=Math.min(n.rows.length-1,Math.ceil(h/i)),v=n.rows[g]?.categoryIndex;return o(v===void 0&&e?e:{...e,viewportStartCategoryIndex:v,viewportStartRowIndex:g,viewportEndRowIndex:_})},onDataChange:e=>{s().updateViewportState({data:e,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:e=>{o({search:e,interaction:e?`keyboard`:`none`})},onActiveEmojiChange:(e,t,n)=>{if(o({interaction:e,activeColumnIndex:t,activeRowIndex:n}),e!==`keyboard`)return;let{listRef:r,viewportRef:i,sticky:c,rowHeight:l,viewportHeight:u,categoryHeaderHeight:d}=s(),f=r?.current,p=i?.current;if(!f||!p||!l||!d||!u)return;let m=n;m===0&&p.scrollTo({top:0,behavior:`instant`});let h=f.querySelector(`[aria-rowindex="${m}"]`);if(!(h instanceof HTMLElement))return;let g=h.offsetTop,_=getComputedStyle(h),v=Number.parseFloat(_.scrollMarginTop),y=Number.parseFloat(_.scrollMarginBottom),b=a+v;c&&g<a+u/2&&(b+=d);let x=b+u-y;(g<b||g+l>x)&&p.scrollTo({top:Math.max(g<b+d?g-Math.max(c?d:0,v):g-u+l+y,0),behavior:`instant`})},onActiveEmojiReset:()=>{o({interaction:`none`,activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:e=>{s().updateViewportState({rowHeight:e})},onCategoryHeaderHeightChange:e=>{s().updateViewportState({categoryHeaderHeight:e})},onViewportSizeChange:(e,t)=>{s().updateViewportState({viewportWidth:e,viewportHeight:t})},onViewportScroll:e=>{a=e,s().updateViewportState()}}))}var{useStore:Nn,Provider:Pn}=On(`EmojiPicker.Root is missing.`);function Fn(e){return e.search}function In(e){return e.interaction===`none`?void 0:e.data?.rows[e.activeRowIndex]?.emojis[e.activeColumnIndex]}function Ln(e){return e.data===void 0||typeof e.data?.count==`number`&&e.data.count===0}function Rn(e){return e.data===null||e.viewportHeight===null||e.rowHeight===null||e.categoryHeaderHeight===null}function zn(e){return e.data?.rows.length}function Bn(e){return e.data?.categories.length}function Vn(e){return e.data?.categoriesStartRowIndices}function Hn(e){return e.data?.skinTones}function Un(e,t){return e?.emoji===t?.emoji}function Wn(e,t){return e?.categoryIndex!==t?.categoryIndex||e?.emojis.length!==t?.emojis.length?!1:!!e?.emojis.every((e,n)=>Un(e,t?.emojis[n]))}var Gn=`‍`,Kn=/\p{Emoji_Modifier_Base}/u,qn=/\uFE0F$/,Jn=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,Yn={light:`🏻`,"medium-light":`🏼`,medium:`🏽`,"medium-dark":`🏾`,dark:`🏿`};function Xn(e,t){if(!e.split(Gn).some(e=>Kn.test(e)))return e;let n=e.split(Gn).map(e=>e.replace(Jn,``)).join(Gn);return t===`none`?n:n.split(Gn).map((e,n,r)=>{let i=r.length>1;return!Kn.test(e)||i&&e===`🤝`?e:e.replace(qn,``)+Yn[t]}).join(Gn)}function Zn(e){return Gt.map(t=>({skinTone:t,emoji:Xn(e,t)}))}function Qn(){return(0,Z.useDeferredValue)(kn(Nn(),In,Un))}function $n(e=`✋`){let t=Nn(),n=An(t,`skinTone`),r=(0,Z.useMemo)(()=>Zn(e),[e]);return[n,(0,Z.useCallback)(e=>{t.set({skinTone:e})},[]),r]}function er(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>n in t&&e[n]===t[n]):!1}function tr(...e){}function nr(e,t){let n=null;if(typeof window.requestIdleCallback==`function`)n=window.requestIdleCallback(e,t);else{let r=Date.now();n=window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,(t?.timeout??50)-(Date.now()-r))})},10)}return()=>{typeof window.cancelIdleCallback==`function`?window.cancelIdleCallback(n):window.clearTimeout(n)}}var rr=typeof window<`u`?Z.useLayoutEffect:Z.useEffect;function ir(e){let t=(0,Z.useRef)(e);return rr(()=>{t.current=e}),(0,Z.useCallback)((...e)=>t.current(...e),[])}function ar({emojiVersion:e,emojibaseUrl:t}){let[n,r]=(0,Z.useState)(void 0),i=Nn(),a=An(i,`locale`),o=An(i,`columns`),s=An(i,`skinTone`),c=An(i,`search`);return(0,Z.useEffect)(()=>{let n=new AbortController,i=n.signal;return bn({locale:a,emojiVersion:e,emojibaseUrl:t,signal:i}).then(e=>{r(e)}).catch(e=>{i.aborted||console.error(e)}),()=>{n.abort()}},[e,t,a]),(0,Z.useEffect)(()=>{if(n)return nr(()=>{i.get().onDataChange(Tn(n,o,s,c))},{timeout:100})},[n,o,s,c]),null}var or=(0,Z.forwardRef)(({locale:e=`en`,columns:t=9,skinTone:n=`none`,onEmojiSelect:r=tr,emojiVersion:i,emojibaseUrl:a,onFocusCapture:o,onBlurCapture:s,children:c,style:l,sticky:u=!0,...d},f)=>{let p=ir(r),m=Dn(()=>Mn(p,xn(e),t,u,Sn(n))),[h,g]=(0,Z.useState)(!1),_=(0,Z.useRef)(null),v=(0,Z.useCallback)(e=>{e&&(_.current=e,m.set({rootRef:_}))},[]);rr(()=>{m.set({locale:xn(e)})},[e]),rr(()=>{m.set({columns:t})},[t]),rr(()=>{m.set({sticky:u})},[u]),rr(()=>{m.set({skinTone:Sn(n)})},[n]);let y=(0,Z.useCallback)(e=>{o?.(e);let{searchRef:t,viewportRef:n}=m.get(),r=e.target===t?.current||e.target.hasAttribute(`frimousse-search`),i=e.target===n?.current||e.target.hasAttribute(`frimousse-viewport`);e.isDefaultPrevented()||(g(r||i),e.isDefaultPrevented()||(g(r||i),i?m.get().onActiveEmojiChange(`keyboard`,0,0):r&&m.get().search===``&&m.set({interaction:`none`})))},[o]),b=(0,Z.useCallback)(e=>{s?.(e),!e.isDefaultPrevented()&&!e.currentTarget.contains(e.relatedTarget)&&g(!1)},[s]);return rr(()=>{h||m.get().onActiveEmojiReset()},[h]),(0,Z.useImperativeHandle)(f,()=>_.current),(0,Z.useEffect)(()=>{if(!h)return;function e(e){if(e.defaultPrevented||!e.key.startsWith(`Arrow`)&&e.key!==`Enter`)return;let{data:t,onEmojiSelect:n,onActiveEmojiChange:r,interaction:i,activeColumnIndex:a,activeRowIndex:o}=m.get();if(e.key===`Enter`){let t=In(m.get());t&&(e.preventDefault(),n(t))}if(e.key.startsWith(`Arrow`)){let n=a,s=o;if(e.preventDefault(),i!==`none`){if(t?.rows&&t.rows.length>0)switch(e.key){case`ArrowLeft`:if(n===0){let e=s-1,r=t.rows[e];r&&(s=e,n=r.emojis.length-1)}else --n;break;case`ArrowRight`:if(n===t.rows[s].emojis.length-1){let e=s+1;t.rows[e]&&(s=e,n=0)}else n+=1;break;case`ArrowUp`:{let e=t.rows[s-1];e&&(--s,e.emojis[n]||(n=e.emojis.length-1));break}case`ArrowDown`:{let e=t.rows[s+1];e&&(s+=1,e.emojis[n]||(n=e.emojis.length-1));break}}r(`keyboard`,n,s)}else r(`keyboard`,0,0)}}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[h]),rr(()=>{let e=null,t=null,n=null,r=null,i=m.subscribe(i=>{_.current&&(e!==i.viewportWidth&&(e=i.viewportWidth,_.current.style.setProperty(`--frimousse-viewport-width`,`${i.viewportWidth}px`)),t!==i.viewportHeight&&(t=i.viewportHeight,_.current.style.setProperty(`--frimousse-viewport-height`,`${i.viewportHeight}px`)),n!==i.rowHeight&&(n=i.rowHeight,_.current.style.setProperty(`--frimousse-row-height`,`${i.rowHeight}px`)),r!==i.categoryHeaderHeight&&(r=i.categoryHeaderHeight,_.current.style.setProperty(`--frimousse-category-header-height`,`${i.categoryHeaderHeight}px`)))}),{viewportWidth:a,viewportHeight:o,rowHeight:s,categoryHeaderHeight:c}=m.get();return a&&_.current.style.setProperty(`--frimousse-viewport-width`,`${a}px`),o&&_.current.style.setProperty(`--frimousse-viewport-height`,`${o}px`),s&&_.current.style.setProperty(`--frimousse-row-height`,`${s}px`),c&&_.current.style.setProperty(`--frimousse-category-header-height`,`${c}px`),i},[]),(0,X.jsx)(`div`,{"data-focused":h?``:void 0,"frimousse-root":``,onBlurCapture:b,onFocusCapture:y,...d,ref:v,style:{"--frimousse-emoji-font":Wt,...l},children:(0,X.jsxs)(Pn,{store:m,children:[(0,X.jsx)(ar,{emojiVersion:i,emojibaseUrl:a}),c]})})}),sr=(0,Z.forwardRef)(({value:e,defaultValue:t,onChange:n,...r},i)=>{let a=Nn(),o=(0,Z.useRef)(null),s=(0,Z.useCallback)(e=>{e&&(o.current=e,a.set({searchRef:o}))},[]),c=typeof e==`string`,l=(0,Z.useRef)(c);(0,Z.useEffect)(()=>{l.current=c},[c]),rr(()=>{a.set({search:typeof e==`string`?e:typeof t==`string`?t:``})},[]),rr(()=>{typeof e==`string`&&a.get().onSearchChange(e)},[e]);let u=(0,Z.useCallback)(e=>{n?.(e),e.isDefaultPrevented()||a.get().onSearchChange(e.target.value)},[n]);return(0,Z.useImperativeHandle)(i,()=>o.current),(0,X.jsx)(`input`,{autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,enterKeyHint:`done`,"frimousse-search":``,placeholder:`Search…`,spellCheck:!1,type:`search`,...r,defaultValue:t,onChange:u,ref:s,value:e})}),cr=(0,Z.memo)(()=>{let e=Qn();return e?(0,X.jsx)(`div`,{"aria-live":`polite`,style:{border:0,clip:`rect(0, 0, 0, 0)`,height:1,margin:-1,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:1,wordWrap:`normal`},children:e.label}):null}),lr=(0,Z.forwardRef)(({children:e,onScroll:t,onKeyDown:n,style:r,...i},a)=>{let o=Nn(),s=(0,Z.useRef)(null),c=(0,Z.useCallback)(e=>{e&&(s.current=e,o.set({viewportRef:s}))},[]),l=kn(o,zn),u=kn(o,Bn),d=(0,Z.useCallback)(e=>{t?.(e),o.get().onViewportScroll(e.currentTarget.scrollTop)},[t]);return rr(()=>{if(!s.current)return;let e=new ResizeObserver(([e])=>{let t=e?.borderBoxSize[0]?.inlineSize??0,n=e?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:r,viewportHeight:i,viewportWidth:a}=o.get();(i!==n||a!==t)&&r(t,n)});return e.observe(s.current),o.get().onViewportSizeChange(s.current.offsetWidth,s.current.clientHeight),()=>{e.disconnect()}},[]),(0,Z.useImperativeHandle)(a,()=>s.current),(0,X.jsxs)(`div`,{"frimousse-viewport":``,...i,onScroll:d,ref:c,style:{position:`relative`,boxSizing:`border-box`,contain:`layout paint`,containIntrinsicSize:typeof l==`number`&&typeof u==`number`?`var(--frimousse-viewport-width, auto) calc(${l} * var(--frimousse-row-height) + ${u} * var(--frimousse-category-header-height))`:void 0,overflowY:`auto`,overscrollBehavior:`contain`,scrollbarGutter:`stable`,willChange:`scroll-position`,...r},children:[(0,X.jsx)(cr,{}),e]})});function ur(e,t,n){return{emoji:{...e,isActive:n},role:`gridcell`,"aria-colindex":t,"aria-selected":n||void 0,"aria-label":e.label,"data-active":n?``:void 0,"frimousse-emoji":``,style:{fontFamily:`var(--frimousse-emoji-font)`},tabIndex:-1}}function dr(e,t=!1){return{role:t?void 0:`row`,"aria-rowindex":t?void 0:e,"frimousse-row":``,style:{contain:t?void 0:`content`,height:t?void 0:`var(--frimousse-row-height)`,display:`flex`}}}function fr(e,t){return{"frimousse-category":``,style:{contain:`content`,top:t?`calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))`:void 0,height:t?`calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))`:void 0,width:`100%`,pointerEvents:`none`,position:`absolute`}}}function pr(e,t=!1,n=!0){return{category:e,"frimousse-category-header":``,style:{contain:t?void 0:`layout paint`,height:t?void 0:`var(--frimousse-category-header-height)`,pointerEvents:`auto`,position:n?`sticky`:void 0,top:0}}}function mr(e,t,n,r){return{"frimousse-list-sizer":``,style:{position:`relative`,boxSizing:`border-box`,height:`calc(${e} * var(--frimousse-row-height) + ${t} * var(--frimousse-category-header-height))`,paddingTop:`calc(${n} * var(--frimousse-row-height) + ${r} * var(--frimousse-category-header-height))`}}}function hr(e,t,n){return{"aria-colcount":e,"aria-rowcount":t,"frimousse-list":``,style:{"--frimousse-list-columns":e,...n},role:`grid`}}function gr(e){e.preventDefault()}var _r=(0,Z.memo)(({Emoji:e,emoji:t,columnIndex:n,rowIndex:r})=>{let i=Nn(),a=kn(i,e=>In(e)?.emoji===t.emoji),o=(0,Z.useCallback)(()=>{i.get().onEmojiSelect(t)},[t]),s=(0,Z.useCallback)(()=>{i.get().onActiveEmojiChange(`pointer`,n,r)},[n,r]),c=(0,Z.useCallback)(()=>{i.get().onActiveEmojiReset()},[]);return(0,X.jsx)(e,{...ur(t,n,a),onClick:o,onPointerDown:gr,onPointerEnter:s,onPointerLeave:c})}),vr=(0,Z.memo)(({Row:e,Emoji:t,rowIndex:n})=>{let r=kn(Nn(),e=>e.data?.rows[n],Wn);return r?(0,X.jsx)(e,{...dr(n),children:r.emojis.map((e,r)=>(0,X.jsx)(_r,{Emoji:t,columnIndex:r,emoji:e,rowIndex:n},e.label))}):null}),yr=(0,Z.memo)(({CategoryHeader:e,categoryIndex:t})=>{let n=Nn(),r=kn(n,e=>e.data?.categories[t],er),i=An(n,`sticky`);return r?(0,X.jsx)(`div`,{...fr(t,r),children:(0,X.jsx)(e,{...pr({label:r.label},!1,i)})}):null}),br=(0,Z.memo)(({CategoryHeader:e,Row:t,Emoji:n})=>{let r=(0,Z.useRef)(null),i=Nn(),a=An(i,`columns`),o=(0,Z.useMemo)(()=>Array(a).fill({emoji:`🙂`,label:``}),[a]),s=(0,Z.useMemo)(()=>({label:`Category`}),[]),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null);return rr(()=>{let e=r.current?.parentElement?.parentElement;if(!e||!c.current||!l.current)return;let t=new ResizeObserver(e=>{for(let t of e){let e=t.contentRect.height,{onRowHeightChange:n,onCategoryHeaderHeightChange:r,rowHeight:a,categoryHeaderHeight:o}=i.get();t.target===c.current&&a!==e&&n(e),t.target===l.current&&o!==e&&r(e)}});t.observe(e),t.observe(c.current),t.observe(l.current);let{onRowHeightChange:n,onCategoryHeaderHeightChange:a}=i.get();return n(c.current.clientHeight),a(l.current.clientHeight),()=>{t.disconnect()}},[]),(0,X.jsxs)(`div`,{"aria-hidden":!0,ref:r,style:{height:0,visibility:`hidden`},children:[(0,X.jsx)(`div`,{"frimousse-row-sizer":``,ref:c,children:(0,X.jsx)(t,{...dr(-1,!0),children:o.map((e,t)=>(0,X.jsx)(n,{...ur(e,t,!1)},t))})}),(0,X.jsx)(`div`,{...fr(-1),children:(0,X.jsx)(`div`,{"frimousse-category-header-sizer":``,ref:l,children:(0,X.jsx)(e,{...pr(s,!0)})})})]})});function xr({category:e,...t}){return(0,X.jsx)(`div`,{...t,children:e.label})}function Sr({emoji:e,...t}){return(0,X.jsx)(`button`,{type:`button`,...t,children:e.emoji})}function Cr({...e}){return(0,X.jsx)(`div`,{...e})}var wr=(0,Z.forwardRef)(({style:e,components:t,...n},r)=>{let i=Nn(),a=(0,Z.useRef)(null),o=(0,Z.useCallback)(e=>{e&&(a.current=e,i.set({listRef:a}))},[]),s=t?.CategoryHeader??xr,c=t?.Emoji??Sr,l=t?.Row??Cr,u=An(i,`columns`),d=An(i,`viewportStartRowIndex`),f=An(i,`viewportEndRowIndex`),p=kn(i,zn),m=kn(i,Vn,er),h=(0,Z.useMemo)(()=>m?.filter(e=>e<d).length??0,[m,d]),g=m?.length??0;return(0,Z.useImperativeHandle)(r,()=>a.current),!p||!m||g===0?(0,X.jsx)(`div`,{...hr(u,0,e),...n,children:(0,X.jsx)(`div`,{...mr(0,0,0,0),children:(0,X.jsx)(br,{CategoryHeader:s,Emoji:c,Row:l})})}):(0,X.jsx)(`div`,{...hr(u,p,e),...n,ref:o,children:(0,X.jsxs)(`div`,{...mr(p,g,d,h),children:[(0,X.jsx)(br,{CategoryHeader:s,Emoji:c,Row:l}),Array.from({length:f-d+1},(e,t)=>{let n=d+t;return(0,X.jsxs)(Z.Fragment,{children:[m.indexOf(n)>=0&&(0,X.jsx)(`div`,{style:{height:`var(--frimousse-category-header-height)`}}),(0,X.jsx)(vr,{Emoji:c,Row:l,rowIndex:n})]},n)}),Array.from({length:g},(e,t)=>(0,X.jsx)(yr,{CategoryHeader:s,categoryIndex:t},t))]})})}),Tr=(0,Z.forwardRef)(({emoji:e,onClick:t,"aria-label":n=`Change skin tone`,...r},i)=>{let a=kn(Nn(),Hn,er),[o,s,c]=$n(e),l=(0,Z.useMemo)(()=>Math.max(0,c.findIndex(e=>e.skinTone===o)),[o,c]),u=c[l],d=c[(l+1)%c.length].skinTone,f=o===`none`?void 0:a?.[o],p=d===`none`?void 0:a?.[d],m=(0,Z.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||s(d)},[t,s,d]);return(0,X.jsx)(`button`,{type:`button`,...r,"aria-label":n+(p?` (${p})`:``),"aria-live":`polite`,"aria-valuetext":f,"frimousse-skin-tone-selector":``,onClick:m,ref:i,children:u.emoji})});function Er({children:e,...t}){return kn(Nn(),Rn)?(0,X.jsx)(`span`,{"frimousse-loading":``,...t,children:e}):null}function Dr({children:e}){return e({search:kn(Nn(),Fn)})}function Or({children:e,...t}){return kn(Nn(),Ln)?(0,X.jsx)(`span`,{"frimousse-empty":``,...t,children:typeof e==`function`?(0,X.jsx)(Dr,{children:e}):e}):null}function kr({children:e}){return e({emoji:Qn()})}function Ar({children:e,emoji:t}){let[n,r,i]=$n(t);return e({skinTone:n,setSkinTone:r,skinToneVariations:i})}or.displayName=`EmojiPicker.Root`,sr.displayName=`EmojiPicker.Search`,lr.displayName=`EmojiPicker.Viewport`,wr.displayName=`EmojiPicker.List`,Er.displayName=`EmojiPicker.Loading`,Or.displayName=`EmojiPicker.Empty`,Tr.displayName=`EmojiPicker.SkinToneSelector`,kr.displayName=`EmojiPicker.ActiveEmoji`,Ar.displayName=`EmojiPicker.SkinTone`;var jr={CategoryHeader:({category:e,...t})=>(0,X.jsx)(`div`,{...t,className:`bg-popover px-3 pt-3 pb-1.5 font-medium text-muted-foreground text-xs`,children:e.label}),Row:({children:e,...t})=>(0,X.jsx)(`div`,{...t,className:`scroll-my-1.5 px-1.5`,children:e}),Emoji:({emoji:e,...t})=>(0,X.jsx)(`button`,{type:`button`,...t,className:`flex size-8 items-center justify-center rounded-md text-lg data-[active]:bg-accent`,children:e.emoji})};function Mr(e){let t=(0,Q.c)(11),{onSelect:n}=e,{_:r}=_(),i;t[0]===n?i=t[1]:(i=e=>{let{emoji:t}=e;return n(t)},t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`EarrCe`}),t[2]=r,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,X.jsx)(Ut.Search,{className:`z-10 mx-2 mt-2 rounded-md border bg-background px-2.5 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring`,placeholder:a,autoFocus:!0}),t[4]=a,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(Ut.Loading,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,X.jsx)(g,{id:`yQE2r9`})}),t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsxs)(Ut.Viewport,{className:`relative flex-1 overscroll-contain outline-none`,children:[s,(0,X.jsx)(Ut.Empty,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,X.jsx)(g,{id:`z1uNN0`})}),(0,X.jsx)(Ut.List,{className:`select-none pb-1.5`,components:jr})]}),t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==o?(l=(0,X.jsxs)(Ut.Root,{className:`isolate flex h-[326px] w-[320px] flex-col bg-popover text-popover-foreground`,onEmojiSelect:i,children:[o,c]}),t[8]=i,t[9]=o,t[10]=l):l=t[10],l}var Nr=`245,158,11`,Pr=Nr,Fr={fill:.22,line:.7},Ir={fill:.45,line:1},Lr=.45;function Rr(e,t){let n=Pr,{fill:r,line:i}=t?Ir:Fr;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:rgba(${n},${r})`,`box-shadow:inset 0 -2px 0 rgba(${n},${i})`,``].join(`;`)}function zr(e){return e.map(e=>e.id??`·`).join(`|`)}function Br(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function Vr(e,t){return e.id===null||e.id===t}function Hr(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>Vr(e,t));i.push({from:a.from,to:a.to,style:Rr(e??a.covering[0],e!==void 0),threadId:Br(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&zr(a.covering)===zr(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var Ur=`data-comment-reveal`;function Wr(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function Gr(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${Wr(e)}"]`)}function Kr(e){let t=Gr(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function qr(e){Gr(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function Jr(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${Wr(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=Yr(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),Xr(n),!0}return!1}function Yr(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function Xr(e){e.style.setProperty(`--comment-reveal-fill`,`rgba(${Nr},${Lr})`),e.setAttribute(Ur,`true`);let t=()=>{e.removeAttribute(Ur),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function Zr(e){let t=``,n=[];return e.descendants((e,r)=>{if(e.isText&&e.text)for(let i=0;i<e.text.length;i++)t+=e.text[i],n.push(r+i);return!0}),{text:t,positions:n}}function Qr(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function $r(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function ei(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}var ti=4,ni=64;function ri(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:de(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:de(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=Math.max(t.length*ti,t.length+ni);return c-s>l?null:{start:s,end:c}}function ii(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function ai(e,t,n){if(t.length===0)return null;let r=Qr(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=de(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=ri(e.text,t,n);return r===null?null:ii(e,r)}if(r.length===1)return ii(e,r[0]);let i=n?.prefix??``,a=n?.suffix??``,o=[],s=-1;for(let t of r){let n=$r(i,e.text.slice(0,t.start))+ei(a,e.text.slice(t.end));n>s?(s=n,o=[t]):n===s&&o.push(t)}if(o.length===1)return ii(e,o[0]);let c=n?.start;if(c===void 0)return ii(e,o[0]);let l=o[0],u=1/0;for(let e of o){let t=Math.abs(e.start-c);t<u&&(u=t,l=e)}return ii(e,l)}var oi=64;function si(e,t,n){return{prefix:e.textBetween(Math.max(0,t-oi),t,`
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Cn as r,Gt as i,S as a,Ut as o,_ as s,g as c,hn as l,i as u,nt as d,vn as f,xn as p,y as m}from"./DocumentContext-BaYg4CBg.js";import{t as h}from"./react-f2sANaYj.js";import{n as g,r as _}from"./dist-Nvb76hAm.js";import{t as v}from"./compiler-runtime-BfE3aGVn.js";import{a as y,c as b,s as x,u as S}from"./terminal-input-events-BGPQuYMh.js";import{t as C}from"./utils-CPqDy6Hr.js";import{t as w}from"./button-RQ5o7P7w.js";import{i as T,n as E,t as D}from"./tooltip-x7BNUa3s.js";import{n as O,r as k,t as A}from"./collapsible-OhEmjTXw.js";import{T as j,it as M}from"./CodeMirrorPropInput-DvoNWmdR.js";import{t as N}from"./checkbox-DoJAOcMt.js";import{c as P,l as F,m as I,r as L,t as R}from"./dropdown-menu-AlVJ7dJz.js";import{i as z,n as B,o as V,s as H,t as U}from"./select-BUOcREjn.js";import{Aa as ee,Bn as W,Ct as G,F as K,I as q,Ir as J,Ja as te,Kr as ne,Ma as re,Mt as ie,Na as ae,O as oe,Rr as se,S as ce,Sr as le,Ua as ue,Vn as de,Zt as fe,ft as pe,ht as me,ja as he,mt as ge,q as _e,wr as ve,x as ye,za as be,zr as xe}from"./dist-CrqBb5y32.js";import{t as Se}from"./createLucideIcon-DihYAFEK.js";import{t as Ce}from"./braces-BG3bQFuB.js";import{t as we}from"./chevron-down-BeptYHqQ.js";import{t as Te}from"./chevron-right-CABnKLlm.js";import{o as Ee,r as De}from"./folder-config-api-6QhNU0oa.js";import{t as Oe}from"./hash-BXtq910s.js";import{t as ke}from"./trash-2-WxyktwvM.js";import{t as Ae}from"./triangle-alert-C2yId37R.js";import{t as je}from"./x-xV4a4mi6.js";import{n as Me}from"./dist-uN7pEWl0.js";import{t as Ne}from"./input-Cm94Cun3.js";import{t as Y}from"./dist-CzC3AWOn.js";import{f as Pe,x as Fe}from"./doc-paths-CCYuGvJq.js";import{K as Ie,U as Le,b as Re,m as ze}from"./navigation-targets-BwmQHp3k.js";import{d as Be}from"./documents-events-CdU1iFH9.js";import{s as Ve}from"./skill-scope-7fBhGcjl.js";import{t as He}from"./badge-CAMtyz4F.js";import{g as Ue}from"./skills-api-wUsPYcxD.js";import{t as We}from"./external-link-Dvu-nzFi.js";import{t as Ge}from"./use-skills-C7huRzJa.js";import{a as Ke,l as qe,r as Je,t as Ye}from"./selection-context-DS--IqEv.js";import{t as Xe}from"./textarea-Cl4IJ1LU.js";import{l as Ze}from"./lint-config-client-B0H2okzr.js";import{a as Qe,d as $e,f as et,i as tt,l as nt,m as rt,o as it,p as at,s as ot,t as st,u as ct}from"./sortable.esm-BuA5-2It.js";import{C as lt,S as ut,_ as dt,a as ft,b as pt,c as mt,g as ht,h as gt,i as _t,l as vt,n as yt,o as bt,r as xt,s as St,t as Ct,v as wt,w as Tt,x as Et,y as Dt}from"./format-DAPkd5Gj.js";var Ot=Se(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),kt=Se(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),At=Se(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),jt=Se(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Mt=Se(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Nt=Se(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Pt=Se(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Ft=Se(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),X=n(),Z=e(h(),1),Q=v(),It=`open-knowledge:doc-panel-tab`,Lt=null;function Rt(){let e=Lt;return Lt=null,e}function zt(e,t=typeof window>`u`?new EventTarget:window){Lt=e,t.dispatchEvent(new CustomEvent(It,{detail:{tab:e}}))}function Bt(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail?.tab:void 0;n&&e(n)};return t.addEventListener(It,n),()=>t.removeEventListener(It,n)}var Vt=Object.defineProperty,Ht=(e,t)=>{for(var n in t)Vt(e,n,{get:t[n],enumerable:!0})},Ut={};Ht(Ut,{ActiveEmoji:()=>kr,Empty:()=>Or,List:()=>wr,Loading:()=>Er,Root:()=>or,Search:()=>sr,SkinTone:()=>Ar,SkinToneSelector:()=>Tr,Viewport:()=>lr});var Wt=`'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif`,Gt=[`none`,`light`,`medium-light`,`medium`,`medium-dark`,`dark`];function Kt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var qt=2,Jt=null;function Yt(e){try{Jt??=document.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0})}catch{}if(!Jt||(queueMicrotask(()=>{Jt&&=null}),Jt.canvas.width=qt,Jt.canvas.height=qt,Jt.font=`2px ${Wt}`,Jt.textBaseline=`middle`,Jt.measureText(e).width>=qt*2))return!1;Jt.fillStyle=`#00f`,Jt.fillText(e,0,0);let t=Jt.getImageData(0,0,qt,qt).data;Jt.clearRect(0,0,qt,qt),Jt.fillStyle=`#f00`,Jt.fillText(e,0,0);let n=Jt.getImageData(0,0,qt,qt).data;for(let e=0;e<qt*qt*4;e+=4)if(t[e]!==n[e]||t[e+1]!==n[e+1]||t[e+2]!==n[e+2])return!1;return!0}function Xt(e,t,n){try{let r=e.getItem(t);if(!r)throw Error(`No value found for "${t}".`);return n(JSON.parse(r))}catch{return null}}function Zt(e,t,n){e.setItem(t,JSON.stringify(n))}function Qt(e){return t=>t===void 0?void 0:e(t)}function $t(e){return t=>t===null?null:e(t)}function en(e){if(typeof e!=`string`)throw Error();return e}function tn(e){if(typeof e!=`number`)throw Error();return e}function nn(e){if(typeof e!=`boolean`)throw Error();return e}function rn(e){return t=>{if(typeof t!=`object`||!t)throw Error();let n={};for(let r in e){let i=t[r];i===void 0&&e[r](void 0),n[r]=e[r](i)}return n}}function an(e){return t=>{if(!Array.isArray(t))throw Error();return t.length>0&&e(t[0]),t}}var on=(e,t)=>`${e}/${t}/data.json`,sn=(e,t)=>`${e}/${t}/messages.json`,cn=`bn.da.de.en-gb.en.es-mx.es.et.fi.fr.hi.hu.it.ja.ko.lt.ms.nb.nl.pl.pt.ru.sv.th.uk.vi.zh-hant.zh`.split(`.`),ln=`en`,un=e=>`frimousse/data/${e}`,dn=`frimousse/metadata`;async function fn(e,t){try{return(await fetch(e,{method:`HEAD`,signal:t})).headers.get(`etag`)}catch{return null}}async function pn(e,t,n){let[{emojis:r,emojisEtag:i},{messages:a,messagesEtag:o}]=await Promise.all([fetch(on(e,t),{signal:n}).then(async e=>({emojis:await e.json(),emojisEtag:e.headers.get(`etag`)})),fetch(sn(e,t),{signal:n}).then(async e=>({messages:await e.json(),messagesEtag:e.headers.get(`etag`)}))]);return{emojis:r,messages:a,emojisEtag:i,messagesEtag:o}}async function mn(e,t,n){let[r,i]=await Promise.all([fn(on(e,t),n),fn(sn(e,t),n)]);return{emojisEtag:r,messagesEtag:i}}function hn(e){return e.skins?e.skins.filter(e=>typeof e.tone==`number`).reduce((e,t)=>{let n=Gt[t.tone];return e[n]=t.emoji,e},{}):void 0}async function gn(e,t,n){let{emojis:r,emojisEtag:i,messages:a,messagesEtag:o}=await pn(e,t,n),s=a.subgroups.find(e=>e.key===`country-flag`||e.key===`subdivision-flag`),c=a.groups.filter(e=>e.key!==`component`),l=r.filter(e=>`group`in e),u=c.map(e=>({index:e.order,label:Kt(e.message)})),d=a.skinTones.reduce((e,t)=>(e[t.key]=Kt(t.message),e),{}),f={locale:t,emojis:l.map(e=>({emoji:e.emoji,category:e.group,version:e.version,label:Kt(e.label),tags:e.tags??[],countryFlag:s&&e.subgroup===s.order||void 0,skins:hn(e)})),categories:u,skinTones:d};return Zt(localStorage,un(t),{data:f,metadata:{emojisEtag:i,messagesEtag:o}}),f}function _n(e,t){let n=new Map;for(let t of e)n.has(t.version)||n.set(t.version,t.emoji);let r=[...n.keys()].sort((e,t)=>t-e),i=r[0]??0,a=Yt(`🇪🇺`);if(typeof t==`number`)return{emojiVersion:t,countryFlags:a};for(let e of r)if(Yt(n.get(e)))return{emojiVersion:e,countryFlags:a};return{emojiVersion:i,countryFlags:a}}var vn=rn({emojiVersion:tn,countryFlags:nn}),yn=rn({data:rn({locale:en,emojis:an(rn({emoji:en,category:tn,label:en,version:tn,tags:an(en),countryFlag:Qt(nn),skins:Qt(rn({light:en,"medium-light":en,medium:en,"medium-dark":en,dark:en}))})),categories:an(rn({index:tn,label:en})),skinTones:rn({light:en,"medium-light":en,medium:en,"medium-dark":en,dark:en})}),metadata:rn({emojisEtag:$t(en),messagesEtag:$t(en)})});async function bn({locale:e,emojiVersion:t,emojibaseUrl:n,signal:r}){let i=typeof n==`string`?n:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof t==`number`?Math.floor(t):`latest`}`,a=Xt(sessionStorage,dn,vn),o=Xt(localStorage,un(e),yn),s;if(!o)s=await gn(i,e,r);else if(a)s=o.data;else try{let{emojisEtag:t,messagesEtag:n}=await mn(i,e,r);s=!t||!n||t!==o.metadata.emojisEtag||n!==o.metadata.messagesEtag?await gn(i,e,r):o.data}catch{s=o.data}return a??=_n(s.emojis,t),Zt(sessionStorage,dn,a),{locale:e,emojis:s.emojis.filter(e=>{let t=e.version<=a.emojiVersion;return e.countryFlag?t&&a.countryFlags:t}),categories:s.categories,skinTones:s.skinTones}}function xn(e){return cn.includes(e)?e:(console.warn(`Locale "${e}" is not supported, using "${ln}" instead.`),ln)}function Sn(e){return Gt.includes(e)?e:(console.warn(`Skin tone "${e}" is not valid, using "none" instead.`),`none`)}function Cn(e,t){let n=[];if(t<=0)return n;for(let r=0,i=e.length;r<i;r+=t)n.push(e.slice(r,r+t));return n}function wn(e,t){if(!t)return e;let n=t.toLowerCase().trim(),r=new WeakMap;return e.filter(e=>{let t=0;e.label.toLowerCase().includes(n)&&(t+=10);for(let r of e.tags)r.toLowerCase().includes(n)&&(t+=1);return t>0?(r.set(e,t),!0):!1}).sort((e,t)=>(r.get(t)??0)-(r.get(e)??0))}function Tn(e,t,n,r){let i=wn(e.emojis,r),a=[],o=[],s=[],c={},l=0,u=0;for(let e of i)c[e.category]||(c[e.category]=[]),c[e.category].push({emoji:n&&n!==`none`&&e.skins?e.skins[n]:e.emoji,label:e.label});for(let n of e.categories){let e=c[n.index];if(!e||e.length===0)continue;let r=Cn(Array.from(e),t).map(e=>({categoryIndex:l,emojis:e}));a.push(...r),o.push({label:n.label,rowsCount:r.length,startRowIndex:u}),s.push(u),l++,u+=r.length}return{count:i.length,categories:o,categoriesStartRowIndices:s,rows:a,skinTones:e.skinTones}}function En(e){let t={},n=null,r=null,i=new Set,a=()=>{if(n){t=n,n=null;for(let e of i)e(t)}r=null},o=()=>n??t,s=e=>{n??=t,Object.assign(n,typeof e==`function`?e(o()):e),r||=requestAnimationFrame(a)};return t=e(s,o),{get:o,set:s,subscribe:e=>(i.add(e),()=>i.delete(e))}}function Dn(e){let[t]=(0,Z.useState)(e);return t}function On(e){let t=(0,Z.createContext)(null);return{useStore:()=>{let n=(0,Z.useContext)(t);if(!n)throw Error(e);return n},Provider:({store:e,children:n})=>(0,X.jsx)(t.Provider,{value:e,children:n})}}function kn(e,t,n=Object.is){let[r,i]=(0,Z.useState)(()=>t(e.get()));return(0,Z.useEffect)(()=>e.subscribe(()=>{let r=t(e.get());i(e=>n(e,r)?e:r)}),[e,t,n]),(0,Z.useDebugValue)(r),r}function An(e,t,n){return kn(e,(0,Z.useCallback)(e=>e[t],[t]),n)}var jn=2;function Mn(e,t,n,r,i){let a=0;return En((o,s)=>({locale:t,columns:n,sticky:r,skinTone:i,onEmojiSelect:e,data:null,search:``,interaction:`none`,activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:e=>{let t=s(),n=e?.data??t.data,r=e?.categoryHeaderHeight??t.categoryHeaderHeight,i=e?.rowHeight??t.rowHeight,c=e?.viewportHeight??t.viewportHeight;if(!n||n.rows.length===0||!r||!i||!c)return o({...e,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let l=0,u=0;for(let e of n.categories)if(u++*r+e.startRowIndex*i<a)l+=r;else break;let d=n.categories.length*r+n.rows.length*i,f=Math.floor(jn*i/2),p=Math.ceil(jn*i/2),m=Math.min(a-l-f,d-c),h=m+c+p,g=Math.max(0,Math.floor(m/i)),_=Math.min(n.rows.length-1,Math.ceil(h/i)),v=n.rows[g]?.categoryIndex;return o(v===void 0&&e?e:{...e,viewportStartCategoryIndex:v,viewportStartRowIndex:g,viewportEndRowIndex:_})},onDataChange:e=>{s().updateViewportState({data:e,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:e=>{o({search:e,interaction:e?`keyboard`:`none`})},onActiveEmojiChange:(e,t,n)=>{if(o({interaction:e,activeColumnIndex:t,activeRowIndex:n}),e!==`keyboard`)return;let{listRef:r,viewportRef:i,sticky:c,rowHeight:l,viewportHeight:u,categoryHeaderHeight:d}=s(),f=r?.current,p=i?.current;if(!f||!p||!l||!d||!u)return;let m=n;m===0&&p.scrollTo({top:0,behavior:`instant`});let h=f.querySelector(`[aria-rowindex="${m}"]`);if(!(h instanceof HTMLElement))return;let g=h.offsetTop,_=getComputedStyle(h),v=Number.parseFloat(_.scrollMarginTop),y=Number.parseFloat(_.scrollMarginBottom),b=a+v;c&&g<a+u/2&&(b+=d);let x=b+u-y;(g<b||g+l>x)&&p.scrollTo({top:Math.max(g<b+d?g-Math.max(c?d:0,v):g-u+l+y,0),behavior:`instant`})},onActiveEmojiReset:()=>{o({interaction:`none`,activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:e=>{s().updateViewportState({rowHeight:e})},onCategoryHeaderHeightChange:e=>{s().updateViewportState({categoryHeaderHeight:e})},onViewportSizeChange:(e,t)=>{s().updateViewportState({viewportWidth:e,viewportHeight:t})},onViewportScroll:e=>{a=e,s().updateViewportState()}}))}var{useStore:Nn,Provider:Pn}=On(`EmojiPicker.Root is missing.`);function Fn(e){return e.search}function In(e){return e.interaction===`none`?void 0:e.data?.rows[e.activeRowIndex]?.emojis[e.activeColumnIndex]}function Ln(e){return e.data===void 0||typeof e.data?.count==`number`&&e.data.count===0}function Rn(e){return e.data===null||e.viewportHeight===null||e.rowHeight===null||e.categoryHeaderHeight===null}function zn(e){return e.data?.rows.length}function Bn(e){return e.data?.categories.length}function Vn(e){return e.data?.categoriesStartRowIndices}function Hn(e){return e.data?.skinTones}function Un(e,t){return e?.emoji===t?.emoji}function Wn(e,t){return e?.categoryIndex!==t?.categoryIndex||e?.emojis.length!==t?.emojis.length?!1:!!e?.emojis.every((e,n)=>Un(e,t?.emojis[n]))}var Gn=`‍`,Kn=/\p{Emoji_Modifier_Base}/u,qn=/\uFE0F$/,Jn=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,Yn={light:`🏻`,"medium-light":`🏼`,medium:`🏽`,"medium-dark":`🏾`,dark:`🏿`};function Xn(e,t){if(!e.split(Gn).some(e=>Kn.test(e)))return e;let n=e.split(Gn).map(e=>e.replace(Jn,``)).join(Gn);return t===`none`?n:n.split(Gn).map((e,n,r)=>{let i=r.length>1;return!Kn.test(e)||i&&e===`🤝`?e:e.replace(qn,``)+Yn[t]}).join(Gn)}function Zn(e){return Gt.map(t=>({skinTone:t,emoji:Xn(e,t)}))}function Qn(){return(0,Z.useDeferredValue)(kn(Nn(),In,Un))}function $n(e=`✋`){let t=Nn(),n=An(t,`skinTone`),r=(0,Z.useMemo)(()=>Zn(e),[e]);return[n,(0,Z.useCallback)(e=>{t.set({skinTone:e})},[]),r]}function er(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>n in t&&e[n]===t[n]):!1}function tr(...e){}function nr(e,t){let n=null;if(typeof window.requestIdleCallback==`function`)n=window.requestIdleCallback(e,t);else{let r=Date.now();n=window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,(t?.timeout??50)-(Date.now()-r))})},10)}return()=>{typeof window.cancelIdleCallback==`function`?window.cancelIdleCallback(n):window.clearTimeout(n)}}var rr=typeof window<`u`?Z.useLayoutEffect:Z.useEffect;function ir(e){let t=(0,Z.useRef)(e);return rr(()=>{t.current=e}),(0,Z.useCallback)((...e)=>t.current(...e),[])}function ar({emojiVersion:e,emojibaseUrl:t}){let[n,r]=(0,Z.useState)(void 0),i=Nn(),a=An(i,`locale`),o=An(i,`columns`),s=An(i,`skinTone`),c=An(i,`search`);return(0,Z.useEffect)(()=>{let n=new AbortController,i=n.signal;return bn({locale:a,emojiVersion:e,emojibaseUrl:t,signal:i}).then(e=>{r(e)}).catch(e=>{i.aborted||console.error(e)}),()=>{n.abort()}},[e,t,a]),(0,Z.useEffect)(()=>{if(n)return nr(()=>{i.get().onDataChange(Tn(n,o,s,c))},{timeout:100})},[n,o,s,c]),null}var or=(0,Z.forwardRef)(({locale:e=`en`,columns:t=9,skinTone:n=`none`,onEmojiSelect:r=tr,emojiVersion:i,emojibaseUrl:a,onFocusCapture:o,onBlurCapture:s,children:c,style:l,sticky:u=!0,...d},f)=>{let p=ir(r),m=Dn(()=>Mn(p,xn(e),t,u,Sn(n))),[h,g]=(0,Z.useState)(!1),_=(0,Z.useRef)(null),v=(0,Z.useCallback)(e=>{e&&(_.current=e,m.set({rootRef:_}))},[]);rr(()=>{m.set({locale:xn(e)})},[e]),rr(()=>{m.set({columns:t})},[t]),rr(()=>{m.set({sticky:u})},[u]),rr(()=>{m.set({skinTone:Sn(n)})},[n]);let y=(0,Z.useCallback)(e=>{o?.(e);let{searchRef:t,viewportRef:n}=m.get(),r=e.target===t?.current||e.target.hasAttribute(`frimousse-search`),i=e.target===n?.current||e.target.hasAttribute(`frimousse-viewport`);e.isDefaultPrevented()||(g(r||i),e.isDefaultPrevented()||(g(r||i),i?m.get().onActiveEmojiChange(`keyboard`,0,0):r&&m.get().search===``&&m.set({interaction:`none`})))},[o]),b=(0,Z.useCallback)(e=>{s?.(e),!e.isDefaultPrevented()&&!e.currentTarget.contains(e.relatedTarget)&&g(!1)},[s]);return rr(()=>{h||m.get().onActiveEmojiReset()},[h]),(0,Z.useImperativeHandle)(f,()=>_.current),(0,Z.useEffect)(()=>{if(!h)return;function e(e){if(e.defaultPrevented||!e.key.startsWith(`Arrow`)&&e.key!==`Enter`)return;let{data:t,onEmojiSelect:n,onActiveEmojiChange:r,interaction:i,activeColumnIndex:a,activeRowIndex:o}=m.get();if(e.key===`Enter`){let t=In(m.get());t&&(e.preventDefault(),n(t))}if(e.key.startsWith(`Arrow`)){let n=a,s=o;if(e.preventDefault(),i!==`none`){if(t?.rows&&t.rows.length>0)switch(e.key){case`ArrowLeft`:if(n===0){let e=s-1,r=t.rows[e];r&&(s=e,n=r.emojis.length-1)}else --n;break;case`ArrowRight`:if(n===t.rows[s].emojis.length-1){let e=s+1;t.rows[e]&&(s=e,n=0)}else n+=1;break;case`ArrowUp`:{let e=t.rows[s-1];e&&(--s,e.emojis[n]||(n=e.emojis.length-1));break}case`ArrowDown`:{let e=t.rows[s+1];e&&(s+=1,e.emojis[n]||(n=e.emojis.length-1));break}}r(`keyboard`,n,s)}else r(`keyboard`,0,0)}}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[h]),rr(()=>{let e=null,t=null,n=null,r=null,i=m.subscribe(i=>{_.current&&(e!==i.viewportWidth&&(e=i.viewportWidth,_.current.style.setProperty(`--frimousse-viewport-width`,`${i.viewportWidth}px`)),t!==i.viewportHeight&&(t=i.viewportHeight,_.current.style.setProperty(`--frimousse-viewport-height`,`${i.viewportHeight}px`)),n!==i.rowHeight&&(n=i.rowHeight,_.current.style.setProperty(`--frimousse-row-height`,`${i.rowHeight}px`)),r!==i.categoryHeaderHeight&&(r=i.categoryHeaderHeight,_.current.style.setProperty(`--frimousse-category-header-height`,`${i.categoryHeaderHeight}px`)))}),{viewportWidth:a,viewportHeight:o,rowHeight:s,categoryHeaderHeight:c}=m.get();return a&&_.current.style.setProperty(`--frimousse-viewport-width`,`${a}px`),o&&_.current.style.setProperty(`--frimousse-viewport-height`,`${o}px`),s&&_.current.style.setProperty(`--frimousse-row-height`,`${s}px`),c&&_.current.style.setProperty(`--frimousse-category-header-height`,`${c}px`),i},[]),(0,X.jsx)(`div`,{"data-focused":h?``:void 0,"frimousse-root":``,onBlurCapture:b,onFocusCapture:y,...d,ref:v,style:{"--frimousse-emoji-font":Wt,...l},children:(0,X.jsxs)(Pn,{store:m,children:[(0,X.jsx)(ar,{emojiVersion:i,emojibaseUrl:a}),c]})})}),sr=(0,Z.forwardRef)(({value:e,defaultValue:t,onChange:n,...r},i)=>{let a=Nn(),o=(0,Z.useRef)(null),s=(0,Z.useCallback)(e=>{e&&(o.current=e,a.set({searchRef:o}))},[]),c=typeof e==`string`,l=(0,Z.useRef)(c);(0,Z.useEffect)(()=>{l.current=c},[c]),rr(()=>{a.set({search:typeof e==`string`?e:typeof t==`string`?t:``})},[]),rr(()=>{typeof e==`string`&&a.get().onSearchChange(e)},[e]);let u=(0,Z.useCallback)(e=>{n?.(e),e.isDefaultPrevented()||a.get().onSearchChange(e.target.value)},[n]);return(0,Z.useImperativeHandle)(i,()=>o.current),(0,X.jsx)(`input`,{autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,enterKeyHint:`done`,"frimousse-search":``,placeholder:`Search…`,spellCheck:!1,type:`search`,...r,defaultValue:t,onChange:u,ref:s,value:e})}),cr=(0,Z.memo)(()=>{let e=Qn();return e?(0,X.jsx)(`div`,{"aria-live":`polite`,style:{border:0,clip:`rect(0, 0, 0, 0)`,height:1,margin:-1,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:1,wordWrap:`normal`},children:e.label}):null}),lr=(0,Z.forwardRef)(({children:e,onScroll:t,onKeyDown:n,style:r,...i},a)=>{let o=Nn(),s=(0,Z.useRef)(null),c=(0,Z.useCallback)(e=>{e&&(s.current=e,o.set({viewportRef:s}))},[]),l=kn(o,zn),u=kn(o,Bn),d=(0,Z.useCallback)(e=>{t?.(e),o.get().onViewportScroll(e.currentTarget.scrollTop)},[t]);return rr(()=>{if(!s.current)return;let e=new ResizeObserver(([e])=>{let t=e?.borderBoxSize[0]?.inlineSize??0,n=e?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:r,viewportHeight:i,viewportWidth:a}=o.get();(i!==n||a!==t)&&r(t,n)});return e.observe(s.current),o.get().onViewportSizeChange(s.current.offsetWidth,s.current.clientHeight),()=>{e.disconnect()}},[]),(0,Z.useImperativeHandle)(a,()=>s.current),(0,X.jsxs)(`div`,{"frimousse-viewport":``,...i,onScroll:d,ref:c,style:{position:`relative`,boxSizing:`border-box`,contain:`layout paint`,containIntrinsicSize:typeof l==`number`&&typeof u==`number`?`var(--frimousse-viewport-width, auto) calc(${l} * var(--frimousse-row-height) + ${u} * var(--frimousse-category-header-height))`:void 0,overflowY:`auto`,overscrollBehavior:`contain`,scrollbarGutter:`stable`,willChange:`scroll-position`,...r},children:[(0,X.jsx)(cr,{}),e]})});function ur(e,t,n){return{emoji:{...e,isActive:n},role:`gridcell`,"aria-colindex":t,"aria-selected":n||void 0,"aria-label":e.label,"data-active":n?``:void 0,"frimousse-emoji":``,style:{fontFamily:`var(--frimousse-emoji-font)`},tabIndex:-1}}function dr(e,t=!1){return{role:t?void 0:`row`,"aria-rowindex":t?void 0:e,"frimousse-row":``,style:{contain:t?void 0:`content`,height:t?void 0:`var(--frimousse-row-height)`,display:`flex`}}}function fr(e,t){return{"frimousse-category":``,style:{contain:`content`,top:t?`calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))`:void 0,height:t?`calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))`:void 0,width:`100%`,pointerEvents:`none`,position:`absolute`}}}function pr(e,t=!1,n=!0){return{category:e,"frimousse-category-header":``,style:{contain:t?void 0:`layout paint`,height:t?void 0:`var(--frimousse-category-header-height)`,pointerEvents:`auto`,position:n?`sticky`:void 0,top:0}}}function mr(e,t,n,r){return{"frimousse-list-sizer":``,style:{position:`relative`,boxSizing:`border-box`,height:`calc(${e} * var(--frimousse-row-height) + ${t} * var(--frimousse-category-header-height))`,paddingTop:`calc(${n} * var(--frimousse-row-height) + ${r} * var(--frimousse-category-header-height))`}}}function hr(e,t,n){return{"aria-colcount":e,"aria-rowcount":t,"frimousse-list":``,style:{"--frimousse-list-columns":e,...n},role:`grid`}}function gr(e){e.preventDefault()}var _r=(0,Z.memo)(({Emoji:e,emoji:t,columnIndex:n,rowIndex:r})=>{let i=Nn(),a=kn(i,e=>In(e)?.emoji===t.emoji),o=(0,Z.useCallback)(()=>{i.get().onEmojiSelect(t)},[t]),s=(0,Z.useCallback)(()=>{i.get().onActiveEmojiChange(`pointer`,n,r)},[n,r]),c=(0,Z.useCallback)(()=>{i.get().onActiveEmojiReset()},[]);return(0,X.jsx)(e,{...ur(t,n,a),onClick:o,onPointerDown:gr,onPointerEnter:s,onPointerLeave:c})}),vr=(0,Z.memo)(({Row:e,Emoji:t,rowIndex:n})=>{let r=kn(Nn(),e=>e.data?.rows[n],Wn);return r?(0,X.jsx)(e,{...dr(n),children:r.emojis.map((e,r)=>(0,X.jsx)(_r,{Emoji:t,columnIndex:r,emoji:e,rowIndex:n},e.label))}):null}),yr=(0,Z.memo)(({CategoryHeader:e,categoryIndex:t})=>{let n=Nn(),r=kn(n,e=>e.data?.categories[t],er),i=An(n,`sticky`);return r?(0,X.jsx)(`div`,{...fr(t,r),children:(0,X.jsx)(e,{...pr({label:r.label},!1,i)})}):null}),br=(0,Z.memo)(({CategoryHeader:e,Row:t,Emoji:n})=>{let r=(0,Z.useRef)(null),i=Nn(),a=An(i,`columns`),o=(0,Z.useMemo)(()=>Array(a).fill({emoji:`🙂`,label:``}),[a]),s=(0,Z.useMemo)(()=>({label:`Category`}),[]),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null);return rr(()=>{let e=r.current?.parentElement?.parentElement;if(!e||!c.current||!l.current)return;let t=new ResizeObserver(e=>{for(let t of e){let e=t.contentRect.height,{onRowHeightChange:n,onCategoryHeaderHeightChange:r,rowHeight:a,categoryHeaderHeight:o}=i.get();t.target===c.current&&a!==e&&n(e),t.target===l.current&&o!==e&&r(e)}});t.observe(e),t.observe(c.current),t.observe(l.current);let{onRowHeightChange:n,onCategoryHeaderHeightChange:a}=i.get();return n(c.current.clientHeight),a(l.current.clientHeight),()=>{t.disconnect()}},[]),(0,X.jsxs)(`div`,{"aria-hidden":!0,ref:r,style:{height:0,visibility:`hidden`},children:[(0,X.jsx)(`div`,{"frimousse-row-sizer":``,ref:c,children:(0,X.jsx)(t,{...dr(-1,!0),children:o.map((e,t)=>(0,X.jsx)(n,{...ur(e,t,!1)},t))})}),(0,X.jsx)(`div`,{...fr(-1),children:(0,X.jsx)(`div`,{"frimousse-category-header-sizer":``,ref:l,children:(0,X.jsx)(e,{...pr(s,!0)})})})]})});function xr({category:e,...t}){return(0,X.jsx)(`div`,{...t,children:e.label})}function Sr({emoji:e,...t}){return(0,X.jsx)(`button`,{type:`button`,...t,children:e.emoji})}function Cr({...e}){return(0,X.jsx)(`div`,{...e})}var wr=(0,Z.forwardRef)(({style:e,components:t,...n},r)=>{let i=Nn(),a=(0,Z.useRef)(null),o=(0,Z.useCallback)(e=>{e&&(a.current=e,i.set({listRef:a}))},[]),s=t?.CategoryHeader??xr,c=t?.Emoji??Sr,l=t?.Row??Cr,u=An(i,`columns`),d=An(i,`viewportStartRowIndex`),f=An(i,`viewportEndRowIndex`),p=kn(i,zn),m=kn(i,Vn,er),h=(0,Z.useMemo)(()=>m?.filter(e=>e<d).length??0,[m,d]),g=m?.length??0;return(0,Z.useImperativeHandle)(r,()=>a.current),!p||!m||g===0?(0,X.jsx)(`div`,{...hr(u,0,e),...n,children:(0,X.jsx)(`div`,{...mr(0,0,0,0),children:(0,X.jsx)(br,{CategoryHeader:s,Emoji:c,Row:l})})}):(0,X.jsx)(`div`,{...hr(u,p,e),...n,ref:o,children:(0,X.jsxs)(`div`,{...mr(p,g,d,h),children:[(0,X.jsx)(br,{CategoryHeader:s,Emoji:c,Row:l}),Array.from({length:f-d+1},(e,t)=>{let n=d+t;return(0,X.jsxs)(Z.Fragment,{children:[m.indexOf(n)>=0&&(0,X.jsx)(`div`,{style:{height:`var(--frimousse-category-header-height)`}}),(0,X.jsx)(vr,{Emoji:c,Row:l,rowIndex:n})]},n)}),Array.from({length:g},(e,t)=>(0,X.jsx)(yr,{CategoryHeader:s,categoryIndex:t},t))]})})}),Tr=(0,Z.forwardRef)(({emoji:e,onClick:t,"aria-label":n=`Change skin tone`,...r},i)=>{let a=kn(Nn(),Hn,er),[o,s,c]=$n(e),l=(0,Z.useMemo)(()=>Math.max(0,c.findIndex(e=>e.skinTone===o)),[o,c]),u=c[l],d=c[(l+1)%c.length].skinTone,f=o===`none`?void 0:a?.[o],p=d===`none`?void 0:a?.[d],m=(0,Z.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||s(d)},[t,s,d]);return(0,X.jsx)(`button`,{type:`button`,...r,"aria-label":n+(p?` (${p})`:``),"aria-live":`polite`,"aria-valuetext":f,"frimousse-skin-tone-selector":``,onClick:m,ref:i,children:u.emoji})});function Er({children:e,...t}){return kn(Nn(),Rn)?(0,X.jsx)(`span`,{"frimousse-loading":``,...t,children:e}):null}function Dr({children:e}){return e({search:kn(Nn(),Fn)})}function Or({children:e,...t}){return kn(Nn(),Ln)?(0,X.jsx)(`span`,{"frimousse-empty":``,...t,children:typeof e==`function`?(0,X.jsx)(Dr,{children:e}):e}):null}function kr({children:e}){return e({emoji:Qn()})}function Ar({children:e,emoji:t}){let[n,r,i]=$n(t);return e({skinTone:n,setSkinTone:r,skinToneVariations:i})}or.displayName=`EmojiPicker.Root`,sr.displayName=`EmojiPicker.Search`,lr.displayName=`EmojiPicker.Viewport`,wr.displayName=`EmojiPicker.List`,Er.displayName=`EmojiPicker.Loading`,Or.displayName=`EmojiPicker.Empty`,Tr.displayName=`EmojiPicker.SkinToneSelector`,kr.displayName=`EmojiPicker.ActiveEmoji`,Ar.displayName=`EmojiPicker.SkinTone`;var jr={CategoryHeader:({category:e,...t})=>(0,X.jsx)(`div`,{...t,className:`bg-popover px-3 pt-3 pb-1.5 font-medium text-muted-foreground text-xs`,children:e.label}),Row:({children:e,...t})=>(0,X.jsx)(`div`,{...t,className:`scroll-my-1.5 px-1.5`,children:e}),Emoji:({emoji:e,...t})=>(0,X.jsx)(`button`,{type:`button`,...t,className:`flex size-8 items-center justify-center rounded-md text-lg data-[active]:bg-accent`,children:e.emoji})};function Mr(e){let t=(0,Q.c)(11),{onSelect:n}=e,{_:r}=_(),i;t[0]===n?i=t[1]:(i=e=>{let{emoji:t}=e;return n(t)},t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`EarrCe`}),t[2]=r,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,X.jsx)(Ut.Search,{className:`z-10 mx-2 mt-2 rounded-md border bg-background px-2.5 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring`,placeholder:a,autoFocus:!0}),t[4]=a,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(Ut.Loading,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,X.jsx)(g,{id:`yQE2r9`})}),t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsxs)(Ut.Viewport,{className:`relative flex-1 overscroll-contain outline-none`,children:[s,(0,X.jsx)(Ut.Empty,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,X.jsx)(g,{id:`z1uNN0`})}),(0,X.jsx)(Ut.List,{className:`select-none pb-1.5`,components:jr})]}),t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==o?(l=(0,X.jsxs)(Ut.Root,{className:`isolate flex h-[326px] w-[320px] flex-col bg-popover text-popover-foreground`,onEmojiSelect:i,children:[o,c]}),t[8]=i,t[9]=o,t[10]=l):l=t[10],l}var Nr=`245,158,11`,Pr=Nr,Fr={fill:.22,line:.7},Ir={fill:.45,line:1},Lr=.45;function Rr(e,t){let n=Pr,{fill:r,line:i}=t?Ir:Fr;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:rgba(${n},${r})`,`box-shadow:inset 0 -2px 0 rgba(${n},${i})`,``].join(`;`)}function zr(e){return e.map(e=>e.id??`·`).join(`|`)}function Br(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function Vr(e,t){return e.id===null||e.id===t}function Hr(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>Vr(e,t));i.push({from:a.from,to:a.to,style:Rr(e??a.covering[0],e!==void 0),threadId:Br(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&zr(a.covering)===zr(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var Ur=`data-comment-reveal`;function Wr(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function Gr(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${Wr(e)}"]`)}function Kr(e){let t=Gr(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function qr(e){Gr(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function Jr(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${Wr(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=Yr(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),Xr(n),!0}return!1}function Yr(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function Xr(e){e.style.setProperty(`--comment-reveal-fill`,`rgba(${Nr},${Lr})`),e.setAttribute(Ur,`true`);let t=()=>{e.removeAttribute(Ur),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function Zr(e){let t=``,n=[];return e.descendants((e,r)=>{if(e.isText&&e.text)for(let i=0;i<e.text.length;i++)t+=e.text[i],n.push(r+i);return!0}),{text:t,positions:n}}function Qr(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function $r(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function ei(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}var ti=4,ni=64;function ri(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:de(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:de(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=Math.max(t.length*ti,t.length+ni);return c-s>l?null:{start:s,end:c}}function ii(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function ai(e,t,n){if(t.length===0)return null;let r=Qr(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=de(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=ri(e.text,t,n);return r===null?null:ii(e,r)}if(r.length===1)return ii(e,r[0]);let i=n?.prefix??``,a=n?.suffix??``,o=[],s=-1;for(let t of r){let n=$r(i,e.text.slice(0,t.start))+ei(a,e.text.slice(t.end));n>s?(s=n,o=[t]):n===s&&o.push(t)}if(o.length===1)return ii(e,o[0]);let c=n?.start;if(c===void 0)return ii(e,o[0]);let l=o[0],u=1/0;for(let e of o){let t=Math.abs(e.start-c);t<u&&(u=t,l=e)}return ii(e,l)}var oi=64;function si(e,t,n){return{prefix:e.textBetween(Math.max(0,t-oi),t,`
3
3
  `),suffix:e.textBetween(n,Math.min(e.content.size,n+oi),`
4
4
  `)}}function ci(e,t,n){return ai(Zr(e),t,n)}var li=220,ui=24;function di(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-li;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+ui)}function fi(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function pi(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function mi(e,t){let n=j(e);if(!n)return;let r=fi(n.dom);if(!r){e.commands.scrollIntoView();return}let i,a;try{i=n.coordsAtPos(t.from),a=n.coordsAtPos(t.to)}catch{return}let o=r.getBoundingClientRect(),s=di({anchorTop:i.top,anchorBottom:Math.max(i.bottom,a.bottom),viewTop:o.top,viewBottom:o.bottom,insetTop:pi(r)});if(s===0)return;let c=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollTo({top:r.scrollTop+s,behavior:c?`auto`:`smooth`})}async function hi(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok){let e=ge.safeParse(r);throw Error(e.success?e.data.title??e.data.detail:`comments request failed (${n.status})`)}return r}function gi(e){return hi(`/api/comment`,{method:`POST`,body:JSON.stringify(e)})}function _i(e,t){let n=e.safeParse(t);if(!n.success)throw Error(`The server returned a response this build cannot read.`);return n.data}function vi(e){let t=ye.safeParse(e);if(!t.success)throw Error(`The server returned a comment thread this build cannot read.`);return t.data}function yi(e){let t=[];for(let n of e){let e=ye.safeParse(n);e.success?t.push(e.data):console.warn(`[comments] skipped a thread this build cannot read`,e.error.issues)}return t}async function bi(e){let{threads:t}=await hi(e===void 0?`/api/comments`:`/api/comments?doc=${encodeURIComponent(e)}`);return yi(t)}function xi(e){return hi(`/api/comments`,{method:`POST`,body:JSON.stringify(e)}).then(vi)}function Si(e,t){return gi({action:`edit`,id:e,body:t}).then(vi)}function Ci(e){return gi({action:`resolve`,id:e}).then(vi)}function wi(e){return gi({action:`reopen`,id:e}).then(vi)}function Ti(e,t){return gi({action:`replace`,id:e,...t}).then(vi)}function Ei(e){return gi({action:`queue`,id:e}).then(e=>_i(me,e))}function Di(e){return gi({action:`unqueue`,id:e}).then(vi)}function Oi(e){return hi(`/api/comment?id=${encodeURIComponent(e)}`,{method:`DELETE`}).then(e=>_i(oe,e))}function ki(e){return gi({action:`dispatch-prepare-batch`,ids:e}).then(e=>_i(pe,e))}function Ai(e){return gi({action:`dispatch-complete-batch`,ids:e}).then(e=>_i(ce,e))}var ji=`open-knowledge:comments-queue-scope`,Mi=typeof window>`u`?new EventTarget:window,Ni=!1;function Pi(){let e=Ni;return Ni=!1,e}function Fi(e){let t=()=>{Ni=!1,e()};return Mi.addEventListener(ji,t),()=>Mi.removeEventListener(ji,t)}function Ii(){Ni=!0,zt(`comments`),Mi.dispatchEvent(new Event(ji))}var Li=Object.freeze([]),Ri=Object.freeze([]),zi=new Map,Bi=[],Vi=new Set,Hi=new Set,Ui=!1,Wi=new Set,Gi=0,Ki=0;function qi(){for(let e of Vi)e()}function Ji(){Gi+=1,qi()}function Yi(){Ki+=1,qi()}function Xi(e){return{id:e.threadId,docName:e.docName,target:e.target,anchor:e.anchor===null?null:{quote:e.anchor.exact,prefix:e.anchor.prefix,suffix:e.anchor.suffix,start:e.anchor.start,end:e.anchor.end},status:e.state===`anchored`?`open`:e.state,body:e.latestComment,createdAt:e.createdAt,queued:e.queued}}async function Zi(){return(await bi()).map(Xi).sort((e,t)=>t.createdAt-e.createdAt)}async function Qi(e){e!==void 0&&Hi.add(e);let t=await Zi();Bi=t,Ui=!0;for(let e of Hi)zi.set(e,t.filter(t=>t.docName===e));Ji()}var $i=!1;function ea(){$i||typeof window>`u`||($i=!0,Be(e=>{e.includes(`comments`)&&Qi().catch(()=>void 0)}))}function ta(e){ea(),!Hi.has(e)&&(Hi.add(e),Qi(e).catch(()=>{Hi.delete(e)}))}function na(){ea(),!Ui&&(Ui=!0,Qi().catch(()=>{Ui=!1}))}function ra(e){return ta(e),zi.get(e)??Li}function ia(e){return Vi.add(e),()=>{Vi.delete(e)}}function aa(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=()=>ra(e),t[0]=e,t[1]=n),(0,Z.useSyncExternalStore)(ia,n,oa)}function oa(){return Li}function sa(e){for(let t of zi.values()){let n=t.find(t=>t.id===e);if(n)return n}return Bi.find(t=>t.id===e)??null}function ca(e){xi({docName:e.docName,quote:e.quote,prefix:e.prefix,suffix:e.suffix,body:e.body,queue:!0}).then(t=>{if(Qi(e.docName).catch(()=>void 0),e.onCreated!==void 0){e.onCreated(t.threadId);return}Ii(),to()}).catch(e=>{Me.error(e instanceof Error&&e.message?Y._({id:`q3W2nd`,values:{0:e.message}}):Y._({id:`SRBk2G`}))})}function la(e){xi({docName:e.docName,propertyKey:e.propertyKey,propertyPath:e.propertyPath,quote:e.quote,body:e.body,queue:!0}).then(()=>{Qi(e.docName).catch(()=>void 0),Ii(),to()}).catch(e=>{Me.error(e instanceof Error&&e.message?Y._({id:`q3W2nd`,values:{0:e.message}}):Y._({id:`SRBk2G`}))})}function ua(e,t,n){e.then(()=>Qi(t)).catch(e=>{Me.error(e instanceof Error&&e.message?`${n} ${e.message}`:n),Qi(t).catch(()=>void 0)})}function da(e,t){let n=sa(e)?.docName;ua(Si(e,t),n,Y._({id:`kzpkcn`}))}function fa(e){let t=sa(e)?.docName;ua(Ci(e),t,Y._({id:`eoEUI3`}))}function pa(e){let t=sa(e)?.docName;ua(wi(e),t,Y._({id:`lISYEX`}))}function ma(e){let t=sa(e)?.docName;ua(Oi(e),t,Y._({id:`IxHMdF`}))}function ha(e,t,n){let r=sa(e)?.docName;ua(Ti(e,{quote:t,prefix:n?.prefix,suffix:n?.suffix}),r,Y._({id:`mlvM8g`}))}var ga=Ri,_a=-1,va=Ri,ya=-1,ba=-1;function xa(){if(na(),_a!==Gi){let e=Bi.filter(e=>e.queued&&e.status!==`resolved`).sort((e,t)=>e.createdAt-t.createdAt).map(e=>e.id);ga=e.length===0?Ri:e,_a=Gi}return ga}function Sa(){return(0,Z.useSyncExternalStore)(ia,xa,Ca)}function Ca(){return Ri}function wa(){let e=xa();if(ya!==Gi||ba!==Ki){let t=e.filter(e=>!Wi.has(e));va=t.length===0?Ri:t,ya=Gi,ba=Ki}return va}function Ta(){return(0,Z.useSyncExternalStore)(ia,wa,Ea)}function Ea(){return Ri}function Da(e){return xa().includes(e)}function Oa(e){let t=sa(e)?.docName;if(Wi.has(e)){let t=new Set(Wi);t.delete(e),Wi=t,Yi()}ua(Ei(e),t,Y._({id:`S-7ej_`}))}function ka(e){let t=sa(e)?.docName;ua(Di(e),t,Y._({id:`PTUuoc`}))}function Aa(e){Da(e)?ka(e):Oa(e)}function ja(){Wi.size!==0&&(Wi=new Set,Yi())}function Ma(e){let t=new Set(Wi);t.has(e)?t.delete(e):t.add(e),Wi=t,Yi()}function Na(){let e=xa();e.length!==0&&Promise.all(e.map(e=>Di(e).then(()=>!0).catch(()=>!1))).then(t=>{let n=t.filter(e=>!e).length;n>0&&Me.error(Y._({id:`1oawp3`,values:{0:e.length,failed:n}})),Qi().catch(()=>void 0)})}var Pa=!1;async function Fa({compose:e,threadIds:t,resolve:n=!0}){let r=t??wa();if(r.length===0||Pa)return[];Pa=!0;try{return await Ia(r,e,n)}finally{Pa=!1}}async function Ia(e,t,n){let r;try{r=await ki(e)}catch(e){return Me.error(e instanceof Error&&e.message?Y._({id:`cVKnqL`,values:{0:e.message}}):Y._({id:`7FA2iI`})),[]}Ji();let i=r.results.flatMap(e=>e.ok?[{threadId:e.threadId,payload:e.payload}]:[]);if(i.length===0)return await Qi().catch(()=>void 0),[];let a=!1;try{a=await t(i)}catch{a=!1}let o=a?i.map(e=>e.threadId):[];return o.length>0&&n&&await Ai(o).catch(()=>{Me.error(Y._({id:`JyM0gO`}))}),await Qi().catch(()=>void 0),o}var La=`ok:comment-focus-thread`,Ra=`ok:comment-open-popover`,za=`ok:comment-start`,Ba=`ok:comment-posted`,Va=typeof window>`u`?new EventTarget:window;function Ha(e){Va.dispatchEvent(new CustomEvent(La,{detail:e}))}function Ua(e){let t=t=>e(t.detail);return Va.addEventListener(La,t),()=>Va.removeEventListener(La,t)}var Wa=null,Ga=null,Ka=null,qa=new Set;function Ja(){let e=Ga??Wa;if(e!==Ka){Ka=e;for(let e of qa)e()}}function Ya(){return Ka}function Xa(e){Ga=e,Ja()}function Za(e){Ga===e&&(Ga=null,Ja())}function Qa(e){return qa.add(e),()=>{qa.delete(e)}}function $a(e){Wa=e,Ja(),Va.dispatchEvent(new CustomEvent(Ra,{detail:e}))}function eo(e){let t=t=>e(t.detail);return Va.addEventListener(Ra,t),()=>Va.removeEventListener(Ra,t)}function to(){Va.dispatchEvent(new CustomEvent(Ba))}function no(e){let t=()=>e();return Va.addEventListener(Ba,t),()=>Va.removeEventListener(Ba,t)}function ro(){Va.dispatchEvent(new CustomEvent(za))}function io(e){let t=()=>e();return Va.addEventListener(za,t),()=>Va.removeEventListener(za,t)}var ao=1e4;function oo(e){let t=()=>{let t=o(e.docName);if(!t||t.isDestroyed)return!1;let n=ci(t.state.doc,e.quote,e.context);return n&&(t.chain().focus().setTextSelection(n).run(),mi(t,n)),Ha(e.threadId),!0};if(zt(`comments`),t())return;window.location.assign(Pe(e.docName));let n=!1,r=()=>{n||(n=!0,a(),window.clearTimeout(s))},a=i(()=>{t()&&r()}),s=window.setTimeout(r,ao);t()&&r()}function so(){let e=(0,Q.c)(2),t=Sa(),n;if(e[0]!==t){n=[];for(let e of t){let t=sa(e);t!==null&&n.push(t)}e[0]=t,e[1]=n}else n=e[1];return n}function co(){return Ta().length}function lo(e){let t=(0,Q.c)(34),{count:n,attached:r,expanded:i,onAttach:a,onToggleExpanded:o,onDismiss:s}=e,{_:c}=_();if(n===0)return null;if(!r){let e;t[0]===c?e=t[1]:(e=c({id:`UpOct_`}),t[0]=c,t[1]=e);let n,r,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=C(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,X.jsx)(S,{className:`size-3`}),i=(0,X.jsx)(g,{id:`VbyRUy`}),t[2]=n,t[3]=r,t[4]=i):(n=t[2],r=t[3],i=t[4]);let o;return t[5]!==a||t[6]!==e?(o=(0,X.jsxs)(w,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[5]=a,t[6]=e,t[7]=o):o=t[7],o}let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=C(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[8]=l):l=t[8];let u;t[9]!==c||t[10]!==i?(u=c(i?{id:`kMKqP_`}:{id:`15MMFT`}),t[9]=c,t[10]=i,t[11]=u):u=t[11];let d;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(Mt,{className:`size-3`}),t[12]=d):d=t[12];let f;t[13]===n?f=t[14]:(f=(0,X.jsx)(g,{id:`eiUA4k`,values:{count:n}}),t[13]=n,t[14]=f);let p=i&&`rotate-180`,m;t[15]===p?m=t[16]:(m=C(`size-3 transition-transform`,p),t[15]=p,t[16]=m);let h;t[17]===m?h=t[18]:(h=(0,X.jsx)(we,{className:m}),t[17]=m,t[18]=h);let v;t[19]!==i||t[20]!==o||t[21]!==u||t[22]!==f||t[23]!==h?(v=(0,X.jsxs)(w,{type:`button`,size:`sm`,variant:`ghost`,"aria-expanded":i,"aria-label":u,onClick:o,"data-testid":`composer-comments-peek`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[d,f,h]}),t[19]=i,t[20]=o,t[21]=u,t[22]=f,t[23]=h,t[24]=v):v=t[24];let y;t[25]===c?y=t[26]:(y=c({id:`pFRz_E`}),t[25]=c,t[26]=y);let b;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(je,{className:`size-3`}),t[27]=b):b=t[27];let x;t[28]!==s||t[29]!==y?(x=(0,X.jsx)(w,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":y,onClick:s,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:b}),t[28]=s,t[29]=y,t[30]=x):x=t[30];let T;return t[31]!==x||t[32]!==v?(T=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:l,children:[v,x]}),t[31]=x,t[32]=v,t[33]=T):T=t[33],T}function uo(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function fo(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function po(e){let t=(0,Q.c)(14),{thread:n,className:r}=e,i=n.anchor?.quote??``;if(n.target.kind===`property`){let e;t[0]!==n.target.key||t[1]!==n.target.path?(e=fo(n.target.key,n.target.path),t[0]=n.target.key,t[1]=n.target.path,t[2]=e):e=t[2];let a=e,o;t[3]===r?o=t[4]:(o=C(`w-full truncate font-mono text-[11px] text-muted-foreground`,r),t[3]=r,t[4]=o);let s=i===``?``:` “${i}”`,c;return t[5]!==a||t[6]!==o||t[7]!==s?(c=(0,X.jsxs)(`span`,{className:o,children:[a,`:`,s]}),t[5]=a,t[6]=o,t[7]=s,t[8]=c):c=t[8],c}let a;t[9]===r?a=t[10]:(a=C(`w-full truncate font-mono text-[11px] text-muted-foreground`,r),t[9]=r,t[10]=a);let o;return t[11]!==i||t[12]!==a?(o=(0,X.jsxs)(`span`,{className:a,children:[`“`,i,`”`]}),t[11]=i,t[12]=a,t[13]=o):o=t[13],o}function mo(e){oo({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{Jr({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=ho)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var ho=30;function go(e){let t=(0,Q.c)(9),{threads:n}=e,{_:r}=_(),i=Ta();if(n.length===0)return null;let a;if(t[0]!==r||t[1]!==i||t[2]!==n){let e;t[4]!==r||t[5]!==i?(e=e=>{let t=e.status===`orphaned`,n=i.includes(e.id);return(0,X.jsxs)(`li`,{className:C(`flex items-start gap-2 rounded-md border bg-background/60 px-2 py-1.5`,!n&&`opacity-50`),children:[(0,X.jsx)(N,{checked:n,onCheckedChange:()=>Ma(e.id),"aria-label":r({id:`Uoux8m`}),className:`mt-0.5`}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 rounded border px-1 py-px text-[10px] text-muted-foreground`,title:e.docName,children:[(0,X.jsx)(M,{className:`size-2.5 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:uo(e.docName)})]}),t&&(0,X.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-[10px] text-amber-600 dark:text-amber-500`,title:r({id:`MBe6TE`}),children:[(0,X.jsx)(Ft,{className:`size-2.5`}),(0,X.jsx)(g,{id:`2UgoBZ`})]})]}),(0,X.jsxs)(w,{type:`button`,variant:`ghost`,"aria-label":r({id:`rscgd_`,values:{0:uo(e.docName)}}),onClick:()=>mo(e),className:`h-auto min-h-0 w-full min-w-0 flex-col items-start gap-1 px-0 py-0 text-left font-normal hover:bg-transparent`,children:[(0,X.jsx)(po,{thread:e}),(0,X.jsx)(`span`,{className:`line-clamp-2 w-full text-xs whitespace-normal text-foreground/90`,children:e.body})]})]}),(0,X.jsx)(w,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":r({id:`1jym2J`}),onClick:()=>ka(e.id),className:`size-5 shrink-0 p-0 text-muted-foreground hover:text-foreground`,children:(0,X.jsx)(je,{className:`size-3`})})]},e.id)},t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=i,t[2]=n,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,X.jsx)(`ul`,{"data-testid":`composer-comments-list`,className:`mt-1 flex max-h-64 basis-full list-none flex-col gap-1 overflow-y-auto subtle-scrollbar`,children:a}),t[7]=a,t[8]=o),o}function _o(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var vo=48;function yo(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>vo?`…${t.slice(-vo)}`:t}function bo(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>vo?`${t.slice(0,vo)}…`:t}function xo(e){if(!e.repeats)return null;let t=yo(e.prefix),n=bo(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function So(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
5
5
  `))i.push(` > ${e}`);i.push(``),i.push(` ${e.body.trim()}`)}e.anchorLost&&(i.push(``),i.push(n===``?` (Note: \`${e.propertyKey}\` is no longer in this document's frontmatter — it was renamed or removed since the comment was written. Do not apply this to a different property; if you cannot tell what it now refers to, say so instead of guessing.)`:` (Note: that text is no longer in \`${e.propertyKey}\` — the value was edited, reshaped, or removed since the comment was written. Do not apply this to a different property or a different part of the value; if you cannot tell what it now refers to, say so instead of guessing.)`));return}i.push(`${t+1}. In \`${e.docName}\`, on this passage:`),i.push(``);for(let t of e.quote.split(`
@@ -0,0 +1 @@
1
+ import{t as e}from"./ManagedArtifactProperties-BO70pd59.js";export{e as ManagedArtifactProperties};
@@ -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{a as u,c as ee,i as d,n as f,o as p,s as m,t as h}from"./dialog-FGMqkFjm.js";import{t as g}from"./checkbox-DoJAOcMt.js";import{t as _}from"./label-G0lbYOgL.js";import{_a as v}from"./dist-5ovMzVKN2.js";import{t as y}from"./arrow-up-right-CxtRAecj.js";import{t as te}from"./chevron-down-BeptYHqQ.js";import{t as ne}from"./chevron-up-rNlu7Zrz.js";import{t as re}from"./info-BO0f2XRt.js";import{n as b}from"./dist-uN7pEWl0.js";import{t as ie}from"./external-link-Dvu-nzFi.js";import{n as x}from"./mcp-consent-store-BcrhbRwc.js";var ae=a(),S=e(n(),1),C=t();function oe(e){return e.shellDetected&&!e.alreadyInstalled}function se(e){let t=new Set;for(let n of e)n.detected&&t.add(n.id);return t}function ce(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function le(e,t){let n=[];for(let r of t)e.has(r.id)&&n.push(r.id);return n}function ue(e,t,n){let r=e.filter(e=>e.detected||t.has(e.id)),i=e.filter(e=>!e.detected&&!t.has(e.id));return r.length===0||i.length===0?{visible:e,hiddenCount:0,collapsible:!1}:{visible:n?[...r,...i]:r,hiddenCount:i.length,collapsible:!0}}function de(e){return new Set(e.map(e=>e.id))}function fe(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function pe(e,t){return t.filter(t=>e.has(t.id)).map(e=>e.id)}var w={error:e=>b.error(e),message:e=>b.message(e)};function T(e){let t=(0,ae.c)(9),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{store:r,toast:i,payload:a}=n,o=r===void 0?x:r,s=i===void 0?w:i,c;t[2]!==a||t[3]!==o?(c=a??o.getSnapshot(),t[2]=a,t[3]=o,t[4]=c):c=t[4];let l=c;if(!l)return null;let u;return t[5]!==l||t[6]!==o||t[7]!==s?(u=(0,C.jsx)(E,{payload:l,store:o,toast:s}),t[5]=l,t[6]=o,t[7]=s,t[8]=u):u=t[8],u}function me(e){let t=(0,ae.c)(21),{editor:n}=e,{_:a}=i(),u;t[0]===a?u=t[1]:(u=a({id:`2B6eYX`}),t[0]=a,t[1]=u);let ee=`mcp-consent-editor-info-${n.id}`,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,C.jsx)(re,{className:`size-3.5`,"aria-hidden":!0}),t[2]=d):d=t[2];let f;t[3]!==u||t[4]!==ee?(f=(0,C.jsx)(s,{asChild:!0,children:(0,C.jsx)(o,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 size-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":u,"data-testid":ee,children:d})}),t[3]=u,t[4]=ee,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,C.jsx)(`p`,{className:`opacity-70`,children:(0,C.jsx)(r,{id:`J2eKUI`})}),t[6]=p):p=t[6];let m;t[7]!==a||t[8]!==n.configPath?(m=n.configPath??a({id:`ndwmea`}),t[7]=a,t[8]=n.configPath,t[9]=m):m=t[9];let h;t[10]===m?h=t[11]:(h=(0,C.jsx)(`p`,{children:(0,C.jsx)(`code`,{className:`break-all`,children:m})}),t[10]=m,t[11]=h);let g;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,C.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,C.jsx)(r,{id:`VIwCaD`})}),t[12]=g):g=t[12];let _;t[13]===n.entryLocator?_=t[14]:(_=(0,C.jsx)(`p`,{children:(0,C.jsx)(`code`,{className:`break-all`,children:n.entryLocator})}),t[13]=n.entryLocator,t[14]=_);let v;t[15]!==h||t[16]!==_?(v=(0,C.jsx)(c,{side:`left`,className:`max-w-sm text-left`,children:(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[p,h,g,_]})}),t[15]=h,t[16]=_,t[17]=v):v=t[17];let y;return t[18]!==v||t[19]!==f?(y=(0,C.jsxs)(l,{children:[f,v]}),t[18]=v,t[19]=f,t[20]=y):y=t[20],y}function E(e){let t=(0,ae.c)(88),{payload:n,store:a,toast:b}=e,{_:x}=i(),w=n.detectedEditors,T=n.pathInstall,E=n.globalSkills,D=E.length>0,ve;t[0]===T?ve=t[1]:(ve=oe(T),t[0]=T,t[1]=ve);let O=ve,ye;t[2]===w?ye=t[3]:(ye=()=>se(w),t[2]=w,t[3]=ye);let[k,be]=(0,S.useState)(ye),[A,xe]=(0,S.useState)(!0),Se;t[4]===E?Se=t[5]:(Se=()=>de(E),t[4]=E,t[5]=Se);let[j,Ce]=(0,S.useState)(Se),[M,we]=(0,S.useState)(!1),[N,Te]=(0,S.useState)(!1),P=ue(w,k,N),F=(0,S.useId)(),Ee;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=function(e){be(t=>ce(t,e))},t[6]=Ee):Ee=t[6];let De=Ee,I;t[7]!==w||t[8]!==E||t[9]!==O||t[10]!==A||t[11]!==k||t[12]!==j||t[13]!==D||t[14]!==a||t[15]!==b?(I=async function(){we(!0);let e=await a.confirm({editorIds:le(k,w),pathInstall:O?A:void 0,skills:D?pe(j,E):void 0});e.ok||(b.error(e.error),we(!1))},t[7]=w,t[8]=E,t[9]=O,t[10]=A,t[11]=k,t[12]=j,t[13]=D,t[14]=a,t[15]=b,t[16]=I):I=t[16];let Oe=I,ke;t[17]!==x||t[18]!==a||t[19]!==b?(ke=async function(){we(!0);let e=await a.skip();e.ok?b.message(x({id:`851WA-`})):(b.error(e.error),we(!1))},t[17]=x,t[18]=a,t[19]=b,t[20]=ke):ke=t[20];let L=ke,Ae;t[21]!==M||t[22]!==L?(Ae=function(e){!e&&!M&&L()},t[21]=M,t[22]=L,t[23]=Ae):Ae=t[23];let je=Ae,Me=h,Ne=d,Pe;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,C.jsx)(ee,{children:(0,C.jsx)(r,{id:`tsyExA`})}),t[24]=Pe):Pe=t[24];let R;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,C.jsxs)(m,{children:[Pe,(0,C.jsx)(u,{children:(0,C.jsx)(r,{id:`kwLcuN`})})]}),t[25]=R):R=t[25];let Fe=f,z;t[26]!==x||t[27]!==M||t[28]!==F||t[29]!==O||t[30]!==A||t[31]!==T.rcFilesToTouch||t[32]!==T.shellDetected?(z=T.shellDetected&&(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,C.jsx)(r,{id:`ALhMYW`})}),(0,C.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border bg-card/50`,children:(0,C.jsxs)(_,{htmlFor:`${F}-path`,className:O?`flex cursor-pointer flex-col items-start gap-1 px-3 py-2.5 font-normal hover:bg-accent`:`flex flex-col items-start gap-1 px-3 py-2.5 font-normal`,children:[(0,C.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,C.jsx)(g,{id:`${F}-path`,checked:O?A:!0,disabled:M||!O,onCheckedChange:()=>xe(_e),"data-testid":`mcp-consent-path-checkbox`}),(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm font-medium text-foreground`,children:[(0,C.jsx)(r,{id:`Fsx78O`,components:{0:(0,C.jsx)(`code`,{className:`inline-code`})}}),O&&(0,C.jsxs)(l,{children:[(0,C.jsx)(s,{onClick:ge,className:`text-muted-foreground hover:text-foreground`,"aria-label":x({id:`LiAw2k`}),"data-testid":`mcp-consent-path-info`,children:(0,C.jsx)(re,{className:`size-3.5`,"aria-hidden":!0})}),(0,C.jsx)(c,{className:`max-w-xs`,children:(0,C.jsx)(`p`,{className:`leading-relaxed wrap-break-word`,"data-testid":`mcp-consent-path-status`,children:x({id:`04XyCH`,values:{0:T.rcFilesToTouch.join(`, `)}})})})]})]})]}),!O&&(0,C.jsx)(`span`,{className:`ps-6.5 text-xs text-muted-foreground`,"data-testid":`mcp-consent-path-status`,children:x({id:`RnrnTe`})}),O&&!A&&(0,C.jsx)(`span`,{className:`ps-6.5 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-path-warning`,children:(0,C.jsx)(r,{id:`7PXYaF`,components:{0:(0,C.jsx)(`code`,{className:`inline-code`})}})})]})})]}),t[26]=x,t[27]=M,t[28]=F,t[29]=O,t[30]=A,t[31]=T.rcFilesToTouch,t[32]=T.shellDetected,t[33]=z):z=t[33];let B;t[34]===T.shellDetected?B=t[35]:(B=T.shellDetected&&(0,C.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:(0,C.jsx)(r,{id:`psfGPX`})}),t[34]=T.shellDetected,t[35]=B);let Ie;t[36]!==x||t[37]!==M||t[38]!==F||t[39]!==k?(Ie=e=>{let t=k.has(e.id),n=`${F}-${e.id}`,i=`https://openknowledge.ai/docs/integrations/${v[e.id]}`;return(0,C.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,C.jsxs)(_,{htmlFor:n,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,C.jsx)(g,{id:n,checked:t,disabled:M,onCheckedChange:()=>De(e.id),className:`mt-0.5`,"data-testid":`mcp-consent-checkbox-${e.id}`}),(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,C.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),e.willReplace&&(0,C.jsx)(`span`,{className:`text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-status-${e.id}`,children:(0,C.jsx)(r,{id:`TEEPPF`})})]})]}),!e.willReplace&&!e.detected&&(0,C.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>ie(e,i),onAuxClick:e=>ie(e,i),"aria-label":x({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`mcp-consent-status-${e.id}`,children:[(0,C.jsx)(r,{id:`P_bX4O`}),(0,C.jsx)(y,{className:`size-3`,"aria-hidden":!0})]}),(0,C.jsx)(me,{editor:e})]},e.id)},t[36]=x,t[37]=M,t[38]=F,t[39]=k,t[40]=Ie):Ie=t[40];let Le=P.visible.map(Ie),V;t[41]===Le?V=t[42]:(V=(0,C.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:Le}),t[41]=Le,t[42]=V);let H;t[43]!==P.collapsible||t[44]!==P.hiddenCount||t[45]!==N?(H=P.collapsible&&(0,C.jsx)(o,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto justify-start gap-1 self-start px-1 py-1 text-xs font-normal text-muted-foreground hover:text-foreground`,onClick:()=>Te(he),"data-testid":`mcp-consent-editors-toggle`,"aria-expanded":N,children:N?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),(0,C.jsx)(r,{id:`6fGjTz`})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(te,{className:`size-3.5`,"aria-hidden":!0}),(0,C.jsx)(r,{id:`3s-k7L`,values:{0:P.hiddenCount}})]})}),t[43]=P.collapsible,t[44]=P.hiddenCount,t[45]=N,t[46]=H):H=t[46];let U;t[47]!==B||t[48]!==V||t[49]!==H?(U=(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[B,V,H]}),t[47]=B,t[48]=V,t[49]=H,t[50]=U):U=t[50];let W;t[51]!==M||t[52]!==E||t[53]!==F||t[54]!==j||t[55]!==D?(W=D&&(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,C.jsx)(r,{id:`28B21t`})}),(0,C.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:E.map(e=>{let t=j.has(e.id),n=`${F}-skill-${e.id}`;return(0,C.jsx)(`li`,{children:(0,C.jsxs)(_,{htmlFor:n,className:`flex cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal hover:bg-accent`,children:[(0,C.jsx)(g,{id:n,checked:t,disabled:M,onCheckedChange:()=>Ce(t=>fe(t,e.id)),className:`mt-0.5`,"data-testid":`mcp-consent-skill-checkbox-${e.id}`}),(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,C.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,C.jsx)(`code`,{children:e.name})}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`mcp-consent-skill-status-${e.id}`,children:e.id===`discovery`?(0,C.jsx)(r,{id:`0inVGS`}):(0,C.jsx)(r,{id:`FXk_zY`})}),e.alreadyInstalled&&!t&&(0,C.jsx)(`span`,{className:`text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-skill-warning-${e.id}`,children:(0,C.jsx)(r,{id:`dXWMFn`})})]})]})},e.id)})})]}),t[51]=M,t[52]=E,t[53]=F,t[54]=j,t[55]=D,t[56]=W):W=t[56];let G;t[57]!==Fe||t[58]!==z||t[59]!==U||t[60]!==W?(G=(0,C.jsxs)(Fe,{className:`flex flex-col gap-6 min-h-0`,children:[z,U,W]}),t[57]=Fe,t[58]=z,t[59]=U,t[60]=W,t[61]=G):G=t[61];let K;t[62]===L?K=t[63]:(K=()=>void L(),t[62]=L,t[63]=K);let Re;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,C.jsx)(r,{id:`hnlGzG`}),t[64]=Re):Re=t[64];let q;t[65]!==M||t[66]!==K?(q=(0,C.jsx)(o,{variant:`outline-mono`,onClick:K,disabled:M,"data-testid":`mcp-consent-skip`,children:Re}),t[65]=M,t[66]=K,t[67]=q):q=t[67];let J;t[68]===Oe?J=t[69]:(J=()=>void Oe(),t[68]=Oe,t[69]=J);let ze=M||k.size===0&&!(O&&A)&&!D,Y;t[70]===M?Y=t[71]:(Y=M?(0,C.jsx)(r,{id:`b4itZn`}):(0,C.jsx)(r,{id:`iSLIjg`}),t[70]=M,t[71]=Y);let X;t[72]!==J||t[73]!==ze||t[74]!==Y?(X=(0,C.jsx)(o,{onClick:J,disabled:ze,"data-testid":`mcp-consent-add`,children:Y}),t[72]=J,t[73]=ze,t[74]=Y,t[75]=X):X=t[75];let Z;t[76]!==q||t[77]!==X?(Z=(0,C.jsxs)(p,{children:[q,X]}),t[76]=q,t[77]=X,t[78]=Z):Z=t[78];let Q;t[79]!==Ne||t[80]!==R||t[81]!==G||t[82]!==Z?(Q=(0,C.jsxs)(Ne,{className:`sm:max-w-lg`,children:[R,G,Z]}),t[79]=Ne,t[80]=R,t[81]=G,t[82]=Z,t[83]=Q):Q=t[83];let $;return t[84]!==Me||t[85]!==je||t[86]!==Q?($=(0,C.jsx)(Me,{open:!0,onOpenChange:je,children:Q}),t[84]=Me,t[85]=je,t[86]=Q,t[87]=$):$=t[87],$}function he(e){return!e}function ge(e){e.preventDefault(),e.stopPropagation()}function _e(e){return!e}export{T as McpConsentDialogBody,T as default,se as computeInitialSelection,de as computeInitialSkillSelection,oe as isPathRowActionable,ue as partitionEditorsForDisplay,le as selectedIdsOrdered,pe as skillIdsOrdered,ce as toggleSelectedId,fe as toggleSkillId};
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{a as u,c as ee,i as d,n as f,o as p,s as m,t as h}from"./dialog-FGMqkFjm.js";import{t as g}from"./checkbox-DoJAOcMt.js";import{t as _}from"./label-G0lbYOgL.js";import{_a as v}from"./dist-CrqBb5y32.js";import{t as y}from"./arrow-up-right-CxtRAecj.js";import{t as te}from"./chevron-down-BeptYHqQ.js";import{t as ne}from"./chevron-up-rNlu7Zrz.js";import{t as re}from"./info-BO0f2XRt.js";import{n as b}from"./dist-uN7pEWl0.js";import{t as ie}from"./external-link-Dvu-nzFi.js";import{n as x}from"./mcp-consent-store-BcrhbRwc.js";var ae=a(),S=e(n(),1),C=t();function oe(e){return e.shellDetected&&!e.alreadyInstalled}function se(e){let t=new Set;for(let n of e)n.detected&&t.add(n.id);return t}function ce(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function le(e,t){let n=[];for(let r of t)e.has(r.id)&&n.push(r.id);return n}function ue(e,t,n){let r=e.filter(e=>e.detected||t.has(e.id)),i=e.filter(e=>!e.detected&&!t.has(e.id));return r.length===0||i.length===0?{visible:e,hiddenCount:0,collapsible:!1}:{visible:n?[...r,...i]:r,hiddenCount:i.length,collapsible:!0}}function de(e){return new Set(e.map(e=>e.id))}function fe(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function pe(e,t){return t.filter(t=>e.has(t.id)).map(e=>e.id)}var w={error:e=>b.error(e),message:e=>b.message(e)};function T(e){let t=(0,ae.c)(9),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{store:r,toast:i,payload:a}=n,o=r===void 0?x:r,s=i===void 0?w:i,c;t[2]!==a||t[3]!==o?(c=a??o.getSnapshot(),t[2]=a,t[3]=o,t[4]=c):c=t[4];let l=c;if(!l)return null;let u;return t[5]!==l||t[6]!==o||t[7]!==s?(u=(0,C.jsx)(E,{payload:l,store:o,toast:s}),t[5]=l,t[6]=o,t[7]=s,t[8]=u):u=t[8],u}function me(e){let t=(0,ae.c)(21),{editor:n}=e,{_:a}=i(),u;t[0]===a?u=t[1]:(u=a({id:`2B6eYX`}),t[0]=a,t[1]=u);let ee=`mcp-consent-editor-info-${n.id}`,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,C.jsx)(re,{className:`size-3.5`,"aria-hidden":!0}),t[2]=d):d=t[2];let f;t[3]!==u||t[4]!==ee?(f=(0,C.jsx)(s,{asChild:!0,children:(0,C.jsx)(o,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 size-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":u,"data-testid":ee,children:d})}),t[3]=u,t[4]=ee,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,C.jsx)(`p`,{className:`opacity-70`,children:(0,C.jsx)(r,{id:`J2eKUI`})}),t[6]=p):p=t[6];let m;t[7]!==a||t[8]!==n.configPath?(m=n.configPath??a({id:`ndwmea`}),t[7]=a,t[8]=n.configPath,t[9]=m):m=t[9];let h;t[10]===m?h=t[11]:(h=(0,C.jsx)(`p`,{children:(0,C.jsx)(`code`,{className:`break-all`,children:m})}),t[10]=m,t[11]=h);let g;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,C.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,C.jsx)(r,{id:`VIwCaD`})}),t[12]=g):g=t[12];let _;t[13]===n.entryLocator?_=t[14]:(_=(0,C.jsx)(`p`,{children:(0,C.jsx)(`code`,{className:`break-all`,children:n.entryLocator})}),t[13]=n.entryLocator,t[14]=_);let v;t[15]!==h||t[16]!==_?(v=(0,C.jsx)(c,{side:`left`,className:`max-w-sm text-left`,children:(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[p,h,g,_]})}),t[15]=h,t[16]=_,t[17]=v):v=t[17];let y;return t[18]!==v||t[19]!==f?(y=(0,C.jsxs)(l,{children:[f,v]}),t[18]=v,t[19]=f,t[20]=y):y=t[20],y}function E(e){let t=(0,ae.c)(88),{payload:n,store:a,toast:b}=e,{_:x}=i(),w=n.detectedEditors,T=n.pathInstall,E=n.globalSkills,D=E.length>0,ve;t[0]===T?ve=t[1]:(ve=oe(T),t[0]=T,t[1]=ve);let O=ve,ye;t[2]===w?ye=t[3]:(ye=()=>se(w),t[2]=w,t[3]=ye);let[k,be]=(0,S.useState)(ye),[A,xe]=(0,S.useState)(!0),Se;t[4]===E?Se=t[5]:(Se=()=>de(E),t[4]=E,t[5]=Se);let[j,Ce]=(0,S.useState)(Se),[M,we]=(0,S.useState)(!1),[N,Te]=(0,S.useState)(!1),P=ue(w,k,N),F=(0,S.useId)(),Ee;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=function(e){be(t=>ce(t,e))},t[6]=Ee):Ee=t[6];let De=Ee,I;t[7]!==w||t[8]!==E||t[9]!==O||t[10]!==A||t[11]!==k||t[12]!==j||t[13]!==D||t[14]!==a||t[15]!==b?(I=async function(){we(!0);let e=await a.confirm({editorIds:le(k,w),pathInstall:O?A:void 0,skills:D?pe(j,E):void 0});e.ok||(b.error(e.error),we(!1))},t[7]=w,t[8]=E,t[9]=O,t[10]=A,t[11]=k,t[12]=j,t[13]=D,t[14]=a,t[15]=b,t[16]=I):I=t[16];let Oe=I,ke;t[17]!==x||t[18]!==a||t[19]!==b?(ke=async function(){we(!0);let e=await a.skip();e.ok?b.message(x({id:`851WA-`})):(b.error(e.error),we(!1))},t[17]=x,t[18]=a,t[19]=b,t[20]=ke):ke=t[20];let L=ke,Ae;t[21]!==M||t[22]!==L?(Ae=function(e){!e&&!M&&L()},t[21]=M,t[22]=L,t[23]=Ae):Ae=t[23];let je=Ae,Me=h,Ne=d,Pe;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,C.jsx)(ee,{children:(0,C.jsx)(r,{id:`tsyExA`})}),t[24]=Pe):Pe=t[24];let R;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,C.jsxs)(m,{children:[Pe,(0,C.jsx)(u,{children:(0,C.jsx)(r,{id:`kwLcuN`})})]}),t[25]=R):R=t[25];let Fe=f,z;t[26]!==x||t[27]!==M||t[28]!==F||t[29]!==O||t[30]!==A||t[31]!==T.rcFilesToTouch||t[32]!==T.shellDetected?(z=T.shellDetected&&(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,C.jsx)(r,{id:`ALhMYW`})}),(0,C.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border bg-card/50`,children:(0,C.jsxs)(_,{htmlFor:`${F}-path`,className:O?`flex cursor-pointer flex-col items-start gap-1 px-3 py-2.5 font-normal hover:bg-accent`:`flex flex-col items-start gap-1 px-3 py-2.5 font-normal`,children:[(0,C.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,C.jsx)(g,{id:`${F}-path`,checked:O?A:!0,disabled:M||!O,onCheckedChange:()=>xe(_e),"data-testid":`mcp-consent-path-checkbox`}),(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm font-medium text-foreground`,children:[(0,C.jsx)(r,{id:`Fsx78O`,components:{0:(0,C.jsx)(`code`,{className:`inline-code`})}}),O&&(0,C.jsxs)(l,{children:[(0,C.jsx)(s,{onClick:ge,className:`text-muted-foreground hover:text-foreground`,"aria-label":x({id:`LiAw2k`}),"data-testid":`mcp-consent-path-info`,children:(0,C.jsx)(re,{className:`size-3.5`,"aria-hidden":!0})}),(0,C.jsx)(c,{className:`max-w-xs`,children:(0,C.jsx)(`p`,{className:`leading-relaxed wrap-break-word`,"data-testid":`mcp-consent-path-status`,children:x({id:`04XyCH`,values:{0:T.rcFilesToTouch.join(`, `)}})})})]})]})]}),!O&&(0,C.jsx)(`span`,{className:`ps-6.5 text-xs text-muted-foreground`,"data-testid":`mcp-consent-path-status`,children:x({id:`RnrnTe`})}),O&&!A&&(0,C.jsx)(`span`,{className:`ps-6.5 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-path-warning`,children:(0,C.jsx)(r,{id:`7PXYaF`,components:{0:(0,C.jsx)(`code`,{className:`inline-code`})}})})]})})]}),t[26]=x,t[27]=M,t[28]=F,t[29]=O,t[30]=A,t[31]=T.rcFilesToTouch,t[32]=T.shellDetected,t[33]=z):z=t[33];let B;t[34]===T.shellDetected?B=t[35]:(B=T.shellDetected&&(0,C.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:(0,C.jsx)(r,{id:`psfGPX`})}),t[34]=T.shellDetected,t[35]=B);let Ie;t[36]!==x||t[37]!==M||t[38]!==F||t[39]!==k?(Ie=e=>{let t=k.has(e.id),n=`${F}-${e.id}`,i=`https://openknowledge.ai/docs/integrations/${v[e.id]}`;return(0,C.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,C.jsxs)(_,{htmlFor:n,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,C.jsx)(g,{id:n,checked:t,disabled:M,onCheckedChange:()=>De(e.id),className:`mt-0.5`,"data-testid":`mcp-consent-checkbox-${e.id}`}),(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,C.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),e.willReplace&&(0,C.jsx)(`span`,{className:`text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-status-${e.id}`,children:(0,C.jsx)(r,{id:`TEEPPF`})})]})]}),!e.willReplace&&!e.detected&&(0,C.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>ie(e,i),onAuxClick:e=>ie(e,i),"aria-label":x({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`mcp-consent-status-${e.id}`,children:[(0,C.jsx)(r,{id:`P_bX4O`}),(0,C.jsx)(y,{className:`size-3`,"aria-hidden":!0})]}),(0,C.jsx)(me,{editor:e})]},e.id)},t[36]=x,t[37]=M,t[38]=F,t[39]=k,t[40]=Ie):Ie=t[40];let Le=P.visible.map(Ie),V;t[41]===Le?V=t[42]:(V=(0,C.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:Le}),t[41]=Le,t[42]=V);let H;t[43]!==P.collapsible||t[44]!==P.hiddenCount||t[45]!==N?(H=P.collapsible&&(0,C.jsx)(o,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto justify-start gap-1 self-start px-1 py-1 text-xs font-normal text-muted-foreground hover:text-foreground`,onClick:()=>Te(he),"data-testid":`mcp-consent-editors-toggle`,"aria-expanded":N,children:N?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),(0,C.jsx)(r,{id:`6fGjTz`})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(te,{className:`size-3.5`,"aria-hidden":!0}),(0,C.jsx)(r,{id:`3s-k7L`,values:{0:P.hiddenCount}})]})}),t[43]=P.collapsible,t[44]=P.hiddenCount,t[45]=N,t[46]=H):H=t[46];let U;t[47]!==B||t[48]!==V||t[49]!==H?(U=(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[B,V,H]}),t[47]=B,t[48]=V,t[49]=H,t[50]=U):U=t[50];let W;t[51]!==M||t[52]!==E||t[53]!==F||t[54]!==j||t[55]!==D?(W=D&&(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,C.jsx)(r,{id:`28B21t`})}),(0,C.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:E.map(e=>{let t=j.has(e.id),n=`${F}-skill-${e.id}`;return(0,C.jsx)(`li`,{children:(0,C.jsxs)(_,{htmlFor:n,className:`flex cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal hover:bg-accent`,children:[(0,C.jsx)(g,{id:n,checked:t,disabled:M,onCheckedChange:()=>Ce(t=>fe(t,e.id)),className:`mt-0.5`,"data-testid":`mcp-consent-skill-checkbox-${e.id}`}),(0,C.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,C.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,C.jsx)(`code`,{children:e.name})}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`mcp-consent-skill-status-${e.id}`,children:e.id===`discovery`?(0,C.jsx)(r,{id:`0inVGS`}):(0,C.jsx)(r,{id:`FXk_zY`})}),e.alreadyInstalled&&!t&&(0,C.jsx)(`span`,{className:`text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-skill-warning-${e.id}`,children:(0,C.jsx)(r,{id:`dXWMFn`})})]})]})},e.id)})})]}),t[51]=M,t[52]=E,t[53]=F,t[54]=j,t[55]=D,t[56]=W):W=t[56];let G;t[57]!==Fe||t[58]!==z||t[59]!==U||t[60]!==W?(G=(0,C.jsxs)(Fe,{className:`flex flex-col gap-6 min-h-0`,children:[z,U,W]}),t[57]=Fe,t[58]=z,t[59]=U,t[60]=W,t[61]=G):G=t[61];let K;t[62]===L?K=t[63]:(K=()=>void L(),t[62]=L,t[63]=K);let Re;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,C.jsx)(r,{id:`hnlGzG`}),t[64]=Re):Re=t[64];let q;t[65]!==M||t[66]!==K?(q=(0,C.jsx)(o,{variant:`outline-mono`,onClick:K,disabled:M,"data-testid":`mcp-consent-skip`,children:Re}),t[65]=M,t[66]=K,t[67]=q):q=t[67];let J;t[68]===Oe?J=t[69]:(J=()=>void Oe(),t[68]=Oe,t[69]=J);let ze=M||k.size===0&&!(O&&A)&&!D,Y;t[70]===M?Y=t[71]:(Y=M?(0,C.jsx)(r,{id:`b4itZn`}):(0,C.jsx)(r,{id:`iSLIjg`}),t[70]=M,t[71]=Y);let X;t[72]!==J||t[73]!==ze||t[74]!==Y?(X=(0,C.jsx)(o,{onClick:J,disabled:ze,"data-testid":`mcp-consent-add`,children:Y}),t[72]=J,t[73]=ze,t[74]=Y,t[75]=X):X=t[75];let Z;t[76]!==q||t[77]!==X?(Z=(0,C.jsxs)(p,{children:[q,X]}),t[76]=q,t[77]=X,t[78]=Z):Z=t[78];let Q;t[79]!==Ne||t[80]!==R||t[81]!==G||t[82]!==Z?(Q=(0,C.jsxs)(Ne,{className:`sm:max-w-lg`,children:[R,G,Z]}),t[79]=Ne,t[80]=R,t[81]=G,t[82]=Z,t[83]=Q):Q=t[83];let $;return t[84]!==Me||t[85]!==je||t[86]!==Q?($=(0,C.jsx)(Me,{open:!0,onOpenChange:je,children:Q}),t[84]=Me,t[85]=je,t[86]=Q,t[87]=$):$=t[87],$}function he(e){return!e}function ge(e){e.preventDefault(),e.stopPropagation()}function _e(e){return!e}export{T as McpConsentDialogBody,T as default,se as computeInitialSelection,de as computeInitialSkillSelection,oe as isPathRowActionable,ue as partitionEditorsForDisplay,le as selectedIdsOrdered,pe as skillIdsOrdered,ce as toggleSelectedId,fe as toggleSkillId};
@@ -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{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{O as o,n as s}from"./CodeMirrorPropInput-L7fbBlLy.js";import{t as c}from"./Mermaid-BePjlqwg.js";import{f as l}from"./config-provider-Cb43FIW2.js";import{N as u,Ot as d,X as f}from"./dist-BNDNcytQ.js";import{t as p}from"./cm-theme-BCzjFmR8.js";import{t as m}from"./overlay-layers-Bzzqy8A3.js";import{t as h}from"./dist-CZG2zXVq.js";import{t as g}from"./src-hNXjwMT1.js";var _=a(),v=e(n(),1),y=t(),b=p({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),x=p({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function S(e,t,n){let r=e.toString();if(r===t)return;let i=0,a=Math.min(r.length,t.length);for(;i<a&&r[i]===t[i];)i+=1;let o=r.length,s=t.length;for(;o>i&&s>i&&r[o-1]===t[s-1];)--o,--s;let c=()=>{o>i&&e.delete(i,o-i),s>i&&e.insert(i,t.slice(i,s))},l=e.doc;l?l.transact(c,n):c()}function C(e){let t=(0,_.c)(7),{ytext:n,provider:r,undoManager:a}=e,c=(0,v.useRef)(null),{resolvedTheme:l}=i(),p,m;t[0]!==r||t[1]!==l||t[2]!==a||t[3]!==n?(p=()=>{let e=c.current;if(!e)return;let t=l===`dark`?b:x,i=new f({state:d.create({doc:n.toString(),extensions:[h,g(n,r.awareness,{undoManager:a}),o(),u(s),f.lineWrapping,f.theme({"&":{height:`100%`}}),t]}),parent:e});return()=>i.destroy()},m=[n,r,l,a],t[0]=r,t[1]=l,t[2]=a,t[3]=n,t[4]=p,t[5]=m):(p=t[4],m=t[5]),(0,v.useEffect)(p,m);let S;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,y.jsx)(`div`,{ref:c,className:`h-full min-h-0 overflow-auto`}),t[6]=S):S=t[6],S}var w=Symbol(`mermaid-diagram-edit`);function T(e){let t=(0,_.c)(28),{provider:n,isSourceMode:i}=e,{_:a}=r(),o;t[0]===n.document?o=t[1]:(o=n.document.getText(`source`),t[0]=n.document,t[1]=o);let s=o,u;t[2]===s?u=t[3]:(u=()=>s.toString(),t[2]=s,t[3]=u);let[d,f]=(0,v.useState)(u),p,h;t[4]===s?(p=t[5],h=t[6]):(p=()=>{let e=()=>f(s.toString());return s.observe(e),e(),()=>s.unobserve(e)},h=[s],t[4]=s,t[5]=p,t[6]=h),(0,v.useEffect)(p,h);let g;t[7]===s?g=t[8]:(g=()=>new l(s,{trackedOrigins:new Set([w])}),t[7]=s,t[8]=g);let[b]=(0,v.useState)(g),x;t[9]===s?x=t[10]:(x={canEdit:!0,commitChart:e=>S(s,e,w)},t[9]=s,t[10]=x);let T=x,E,D;t[11]!==i||t[12]!==b?(E=()=>{if(i)return;let e=e=>{if(!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`z`||m())return;let t=e.target;if(t instanceof HTMLElement){let e=t.tagName;if(e===`INPUT`||e===`TEXTAREA`||t.isContentEditable)return}e.preventDefault(),e.shiftKey?b.redo():b.undo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},D=[i,b],t[11]=i,t[12]=b,t[13]=E,t[14]=D):(E=t[13],D=t[14]),(0,v.useEffect)(E,D);let O;t[15]===a?O=t[16]:(O=a({id:`8PifYj`}),t[15]=a,t[16]=O);let k=i?`source`:`diagram`,A;t[17]!==T||t[18]!==i||t[19]!==n||t[20]!==d||t[21]!==b||t[22]!==s?(A=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:i?(0,y.jsx)(C,{ytext:s,provider:n,undoManager:b}):(0,y.jsx)(`div`,{className:`flex h-full min-h-0 flex-col p-3`,children:(0,y.jsx)(c,{chart:d,editBinding:T,className:`min-h-0 flex-1`})})}),t[17]=T,t[18]=i,t[19]=n,t[20]=d,t[21]=b,t[22]=s,t[23]=A):A=t[23];let j;return t[24]!==k||t[25]!==A||t[26]!==O?(j=(0,y.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":O,"data-mermaid-doc-editor":``,"data-mermaid-doc-editor-mode":k,children:A}),t[24]=k,t[25]=A,t[26]=O,t[27]=j):j=t[27],j}export{T as MermaidDocEditor};
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{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{O as o,n as s}from"./CodeMirrorPropInput-DvoNWmdR.js";import{t as c}from"./Mermaid-BePjlqwg.js";import{f as l}from"./config-provider-DKj_NBqh.js";import{N as u,Ot as d,X as f}from"./dist-BNDNcytQ.js";import{t as p}from"./cm-theme-BCzjFmR8.js";import{t as m}from"./overlay-layers-Bzzqy8A3.js";import{t as h}from"./dist-CZG2zXVq.js";import{t as g}from"./src-ScxRfF8q.js";var _=a(),v=e(n(),1),y=t(),b=p({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),x=p({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function S(e,t,n){let r=e.toString();if(r===t)return;let i=0,a=Math.min(r.length,t.length);for(;i<a&&r[i]===t[i];)i+=1;let o=r.length,s=t.length;for(;o>i&&s>i&&r[o-1]===t[s-1];)--o,--s;let c=()=>{o>i&&e.delete(i,o-i),s>i&&e.insert(i,t.slice(i,s))},l=e.doc;l?l.transact(c,n):c()}function C(e){let t=(0,_.c)(7),{ytext:n,provider:r,undoManager:a}=e,c=(0,v.useRef)(null),{resolvedTheme:l}=i(),p,m;t[0]!==r||t[1]!==l||t[2]!==a||t[3]!==n?(p=()=>{let e=c.current;if(!e)return;let t=l===`dark`?b:x,i=new f({state:d.create({doc:n.toString(),extensions:[h,g(n,r.awareness,{undoManager:a}),o(),u(s),f.lineWrapping,f.theme({"&":{height:`100%`}}),t]}),parent:e});return()=>i.destroy()},m=[n,r,l,a],t[0]=r,t[1]=l,t[2]=a,t[3]=n,t[4]=p,t[5]=m):(p=t[4],m=t[5]),(0,v.useEffect)(p,m);let S;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,y.jsx)(`div`,{ref:c,className:`h-full min-h-0 overflow-auto`}),t[6]=S):S=t[6],S}var w=Symbol(`mermaid-diagram-edit`);function T(e){let t=(0,_.c)(28),{provider:n,isSourceMode:i}=e,{_:a}=r(),o;t[0]===n.document?o=t[1]:(o=n.document.getText(`source`),t[0]=n.document,t[1]=o);let s=o,u;t[2]===s?u=t[3]:(u=()=>s.toString(),t[2]=s,t[3]=u);let[d,f]=(0,v.useState)(u),p,h;t[4]===s?(p=t[5],h=t[6]):(p=()=>{let e=()=>f(s.toString());return s.observe(e),e(),()=>s.unobserve(e)},h=[s],t[4]=s,t[5]=p,t[6]=h),(0,v.useEffect)(p,h);let g;t[7]===s?g=t[8]:(g=()=>new l(s,{trackedOrigins:new Set([w])}),t[7]=s,t[8]=g);let[b]=(0,v.useState)(g),x;t[9]===s?x=t[10]:(x={canEdit:!0,commitChart:e=>S(s,e,w)},t[9]=s,t[10]=x);let T=x,E,D;t[11]!==i||t[12]!==b?(E=()=>{if(i)return;let e=e=>{if(!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`z`||m())return;let t=e.target;if(t instanceof HTMLElement){let e=t.tagName;if(e===`INPUT`||e===`TEXTAREA`||t.isContentEditable)return}e.preventDefault(),e.shiftKey?b.redo():b.undo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},D=[i,b],t[11]=i,t[12]=b,t[13]=E,t[14]=D):(E=t[13],D=t[14]),(0,v.useEffect)(E,D);let O;t[15]===a?O=t[16]:(O=a({id:`8PifYj`}),t[15]=a,t[16]=O);let k=i?`source`:`diagram`,A;t[17]!==T||t[18]!==i||t[19]!==n||t[20]!==d||t[21]!==b||t[22]!==s?(A=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:i?(0,y.jsx)(C,{ytext:s,provider:n,undoManager:b}):(0,y.jsx)(`div`,{className:`flex h-full min-h-0 flex-col p-3`,children:(0,y.jsx)(c,{chart:d,editBinding:T,className:`min-h-0 flex-1`})})}),t[17]=T,t[18]=i,t[19]=n,t[20]=d,t[21]=b,t[22]=s,t[23]=A):A=t[23];let j;return t[24]!==k||t[25]!==A||t[26]!==O?(j=(0,y.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":O,"data-mermaid-doc-editor":``,"data-mermaid-doc-editor-mode":k,children:A}),t[24]=k,t[25]=A,t[26]=O,t[27]=j):j=t[27],j}export{T as MermaidDocEditor};
@@ -1,3 +1,3 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-RQ5o7P7w.js";import{a as s,c,i as l,n as u,o as d,s as f,t as p}from"./dialog-FGMqkFjm.js";import{t as m}from"./checkbox-DoJAOcMt.js";import{a as h}from"./dist-5ovMzVKN2.js";import{t as g}from"./createLucideIcon-DihYAFEK.js";import{t as _}from"./check-BIbL8Vva.js";import{r as v,t as y}from"./CopyButton-D6N3opvE.js";import{t as b}from"./loader-circle-DJ1nzSAL.js";import{n as ee}from"./BugReportHistory-D5qnl9oj.js";import{t as te}from"./triangle-alert-C2yId37R.js";import{t as ne}from"./input-Cm94Cun3.js";import{t as re}from"./badge-CAMtyz4F.js";import{t as x}from"./external-link-Dvu-nzFi.js";import{t as ie}from"./textarea-Cl4IJ1LU.js";import{n as ae}from"./clipboard-adapter-Brbch5VX.js";var S=g(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),oe=g(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),se=a(),C=e(n(),1),w=t(),T=`support@inkeep.com`;function ce(e){return`mailto:${T}?subject=${encodeURIComponent(e)}`}function le(e){let t=(0,se.c)(7),{href:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=e=>x(e,n),i=e=>x(e,n),t[0]=n,t[1]=r,t[2]=i);let a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,w.jsx)(`a`,{href:n,onClick:r,onAuxClick:i,className:`text-primary hover:underline`,children:T}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function ue(e,t){let n=e.trim();if(t===void 0)return n===``?void 0:n;let r=t.join(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-RQ5o7P7w.js";import{a as s,c,i as l,n as u,o as d,s as f,t as p}from"./dialog-FGMqkFjm.js";import{t as m}from"./checkbox-DoJAOcMt.js";import{a as h}from"./dist-CrqBb5y32.js";import{t as g}from"./createLucideIcon-DihYAFEK.js";import{t as _}from"./check-BIbL8Vva.js";import{r as v,t as y}from"./CopyButton-D6N3opvE.js";import{t as b}from"./loader-circle-DJ1nzSAL.js";import{n as ee}from"./BugReportHistory-D5qnl9oj.js";import{t as te}from"./triangle-alert-C2yId37R.js";import{t as ne}from"./input-Cm94Cun3.js";import{t as re}from"./badge-CAMtyz4F.js";import{t as x}from"./external-link-Dvu-nzFi.js";import{t as ie}from"./textarea-Cl4IJ1LU.js";import{n as ae}from"./clipboard-adapter-Brbch5VX.js";var S=g(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),oe=g(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),se=a(),C=e(n(),1),w=t(),T=`support@inkeep.com`;function ce(e){return`mailto:${T}?subject=${encodeURIComponent(e)}`}function le(e){let t=(0,se.c)(7),{href:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=e=>x(e,n),i=e=>x(e,n),t[0]=n,t[1]=r,t[2]=i);let a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,w.jsx)(`a`,{href:n,onClick:r,onAuxClick:i,className:`text-primary hover:underline`,children:T}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function ue(e,t){let n=e.trim();if(t===void 0)return n===``?void 0:n;let r=t.join(`
2
2
  `);return n===``?r:`${n}\n\n${r}`}var de=25;function E(e){return e.replace(/\(([^)]*)\)/,(e,t)=>{let n=t.split(/[/\\]/).pop();return n===void 0||n===``?e:`(${n})`})}function D(e){let t=e.split(`
3
3
  `).map(e=>E(e.trim())).filter(e=>e!==``);if(t.length===0)return[];let n=t.slice(0,de),r=t.length-n.length;return[`Component stack:`,...n,...r>0?[`... ${r} more frame(s) omitted`]:[]]}function fe(e){let t=[`Crash source: ${e.source}`];return e.docName!==void 0&&t.push(`Document: ${e.docName}`),e.errorMessage!==void 0&&t.push(`Error: ${e.errorMessage}`),e.componentStack!==void 0&&t.push(...D(e.componentStack)),t}function pe(e){return[`Crash source: ${e.kind===`render-process-gone`?`renderer process crash (reason: ${e.context.reason})`:e.kind===`child-process-gone`?`${e.context.processType} process crash (reason: ${e.context.reason})`:e.context.dirtyShutdown?`previous session ended without a clean quit`:`new crash dump found from the previous session`}`,`Crash event: ${e.eventId}`]}var me={step:`compose`,creating:!1,createError:null};function he(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function O(e){return e.split(/[\\/]/).pop()??e}function ge(e){return e.summary.files.some(e=>e.startsWith(`extra/`)&&e!==h)}function k(e){let t=(0,se.c)(93),{open:n,onOpenChange:a,systemWide:g,crashContext:x,crashInvite:S,screenshot:T}=e,de=g===void 0?!1:g,E=T===void 0?null:T,{_:D}=i(),[O,k]=(0,C.useState)(me),[A,be]=(0,C.useState)(``),[j,xe]=(0,C.useState)(x!==void 0||S!==void 0),M=S?.minidumpAvailable===!0,[N,Se]=(0,C.useState)(M),[P,Ce]=(0,C.useState)(!0),[we,Te]=(0,C.useState)(0),F=(0,C.useRef)(0),I=(0,C.useId)(),L=(0,C.useId)(),R=(0,C.useId)(),z=(0,C.useId)(),B=(0,C.useId)(),V=(0,C.useId)(),Ee=(0,C.useId)(),De=(0,C.useId)(),Oe=(0,C.useId)(),ke=(0,C.useId)(),Ae=(0,C.useId)(),H=O.step===`sending`,je;t[0]!==x||t[1]!==S?(je=x===void 0?S===void 0?void 0:pe(S):fe(x),t[0]=x,t[1]=S,t[2]=je):je=t[2];let U=je,Me,Ne;t[3]===H?(Me=t[4],Ne=t[5]):(Me=()=>{if(!H)return;Te(0);let e=Date.now(),t=setInterval(()=>{let t=(Date.now()-e)/1e3;Te(Math.min(.9,1-Math.exp(-t/3)))},200);return()=>{clearInterval(t)}},Ne=[H],t[3]=H,t[4]=Me,t[5]=Ne),(0,C.useEffect)(Me,Ne);let Pe;t[6]!==x||t[7]!==M||t[8]!==S||t[9]!==a||t[10]!==O.step?(Pe=function(e){!e&&O.step===`sending`||(e||(F.current+=1,(O.step===`success`||O.step===`email`||O.step===`failure`)&&(be(``),xe(x!==void 0||S!==void 0),Se(M),Ce(!0)),k(me)),a(e))},t[6]=x,t[7]=M,t[8]=S,t[9]=a,t[10]=O.step,t[11]=Pe):Pe=t[11];let W=Pe,Fe;t[12]!==D||t[13]!==M||t[14]!==j||t[15]!==N||t[16]!==P||t[17]!==A||t[18]!==U||t[19]!==E?(Fe=async function(){let e=window.okDesktop?.bugReport;if(!e){k({step:`compose`,creating:!1,createError:D({id:`_0JUKX`})});return}let t=F.current+=1;k({step:`compose`,creating:!0,createError:null});let n=await e.create({level:j?`full`:`standard`,note:ue(A,U),...M?{includeCrashDump:N}:{},...E===null?{}:{includeScreenshot:P}});F.current===t&&(n.ok?k({step:`review`,report:{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,summary:n.summary}}):k({step:`compose`,creating:!1,createError:n.error}))},t[12]=D,t[13]=M,t[14]=j,t[15]=N,t[16]=P,t[17]=A,t[18]=U,t[19]=E,t[20]=Fe):Fe=t[20];let Ie=Fe,Le;t[21]!==A||t[22]!==U?(Le=async function(e){let t=window.okDesktop?.bugReport;if(!t)return;let n=F.current+=1;k({step:`sending`,report:e});let r=await t.send({zipPath:e.zipPath,metadata:{level:e.summary.level,systemWide:e.summary.systemWide,projectSlug:e.summary.projectSlug,note:ue(A,U)},includeScreenshot:e.summary.files.includes(h)});F.current===n&&(r.ok?k({step:`success`,report:e,reference:r.reference}):r.reason===`email-draft`?k({step:`email`,report:e,mailtoUrl:r.fallback.mailtoUrl}):k({step:`failure`,report:e,mailtoUrl:r.fallback.mailtoUrl}))},t[21]=A,t[22]=U,t[23]=Le):Le=t[23];let G=Le,Re;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Re=function(e){F.current+=1,k({step:`review`,report:e})},t[24]=Re):Re=t[24];let ze=Re,Be;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Be=function(e){window.okDesktop?.shell.showItemInFolder(e)},t[25]=Be):Be=t[25];let Ve=Be,He;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(He=function(e){window.okDesktop?.shell.openExternal(e)},t[26]=He):He=t[26];let Ue=He,K;t[27]===we?K=t[28]:(K=Math.round(we*100),t[27]=we,t[28]=K);let We=K,Ge=!H,q;t[29]!==D||t[30]!==x||t[31]!==M||t[32]!==S||t[33]!==j||t[34]!==B||t[35]!==z||t[36]!==Ee||t[37]!==V||t[38]!==Ie||t[39]!==W||t[40]!==N||t[41]!==P||t[42]!==R||t[43]!==L||t[44]!==A||t[45]!==I||t[46]!==O.createError||t[47]!==O.creating||t[48]!==O.step||t[49]!==E||t[50]!==Oe||t[51]!==De||t[52]!==de||t[53]!==Ae?(q=O.step===`compose`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(f,{children:[(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`cd5EXh`})}),S===void 0&&(0,w.jsx)(s,{children:(0,w.jsx)(r,{id:`rD-woT`})})]}),(0,w.jsxs)(u,{className:`flex flex-col gap-5`,children:[S!==void 0&&(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border border-chart-3/35 bg-chart-3/10 px-3 py-2.5 text-sm`,children:[(0,w.jsx)(te,{className:`mt-0.5 size-4 shrink-0 text-chart-3`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium`,children:(0,w.jsx)(r,{id:`_IGfXZ`})}),(0,w.jsx)(s,{className:`mt-0.5 text-xs`,children:(0,w.jsx)(r,{id:`03wKPg`})})]})]}),O.createError!==null&&(0,w.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,w.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium`,children:(0,w.jsx)(r,{id:`wVa83H`})}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:O.createError}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,w.jsx)(r,{id:`5PHgV2`,components:{0:(0,w.jsx)(`code`,{className:`font-mono`})}})})]})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,w.jsxs)(`label`,{htmlFor:I,className:`text-sm font-medium`,children:[S===void 0?(0,w.jsx)(r,{id:`y_K0Dz`}):(0,w.jsx)(r,{id:`60vpJN`}),` `,(0,w.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:(0,w.jsx)(r,{id:`NzluOx`})})]}),(0,w.jsx)(ie,{id:I,value:A,onChange:e=>be(e.target.value),placeholder:D(S===void 0?{id:`YLMBSd`}:{id:`T3j-7o`}),rows:3,className:`resize-none`,disabled:O.creating})]}),(0,w.jsxs)(`div`,{role:`group`,"aria-labelledby":Ae,className:`flex flex-col gap-3.5`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(`p`,{id:Ae,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`WJjviG`})}),S===void 0&&(0,w.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:x===void 0?(0,w.jsx)(r,{id:`2H43L8`}):(0,w.jsx)(r,{id:`GZzDqc`})})]}),(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(m,{id:L,checked:!0,disabled:!0,"aria-describedby":R,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsxs)(`label`,{htmlFor:L,className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,w.jsx)(r,{id:`FgRAvd`}),(0,w.jsx)(re,{variant:`primary`,className:`text-2xs`,children:(0,w.jsx)(r,{id:`C0hoX6`})})]}),(0,w.jsx)(`p`,{id:R,className:`text-1sm text-muted-foreground`,children:de?(0,w.jsx)(r,{id:`ZoOlzR`}):(0,w.jsx)(r,{id:`2FnYUD`})})]})]}),(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(m,{id:z,checked:j,onCheckedChange:e=>xe(e===!0),"aria-describedby":B,disabled:O.creating,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsx)(`label`,{htmlFor:z,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`zvjCD4`})}),(0,w.jsx)(`p`,{id:B,className:`text-1sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`fRVBiq`})})]})]}),E!==null&&(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(m,{id:De,checked:P,onCheckedChange:e=>Ce(e===!0),"aria-describedby":Oe,disabled:O.creating,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,w.jsx)(`label`,{htmlFor:De,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`IxyZXD`})}),(0,w.jsx)(`p`,{id:Oe,className:`text-1sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`yzYE4B`})}),(0,w.jsx)(`div`,{className:`mt-2 overflow-hidden rounded-md border bg-muted/40`,children:(0,w.jsx)(`img`,{src:E.dataUrl,alt:D({id:`WuntOK`}),className:`block max-h-44 w-full object-contain transition-opacity motion-reduce:transition-none ${P?`opacity-100`:`opacity-40`}`})})]})]}),M&&(0,w.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,w.jsx)(m,{id:V,checked:N,onCheckedChange:e=>Se(e===!0),"aria-describedby":Ee,disabled:O.creating,className:`mt-0.5`}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsx)(`label`,{htmlFor:V,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`8TvlHF`})}),(0,w.jsx)(`p`,{id:Ee,className:`text-1sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`jnCROW`})})]})]})]}),S===void 0&&x===void 0?(0,w.jsx)(ee,{}):null]}),(0,w.jsxs)(d,{children:[(0,w.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>W(!1),children:S===void 0?(0,w.jsx)(r,{id:`dEgA5A`}):(0,w.jsx)(r,{id:`PBxg_E`})}),(0,w.jsxs)(o,{onClick:()=>void Ie(),disabled:O.creating,children:[O.creating&&(0,w.jsx)(b,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}),(0,w.jsx)(r,{id:`Si7mIR`})]})]})]}),t[29]=D,t[30]=x,t[31]=M,t[32]=S,t[33]=j,t[34]=B,t[35]=z,t[36]=Ee,t[37]=V,t[38]=Ie,t[39]=W,t[40]=N,t[41]=P,t[42]=R,t[43]=L,t[44]=A,t[45]=I,t[46]=O.createError,t[47]=O.creating,t[48]=O.step,t[49]=E,t[50]=Oe,t[51]=De,t[52]=de,t[53]=Ae,t[54]=q):q=t[54];let J;t[55]!==G||t[56]!==O.report||t[57]!==O.step?(J=O.step===`review`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(f,{children:[(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`2AIVbm`})}),(0,w.jsx)(s,{children:(0,w.jsx)(r,{id:`3l_cXP`})})]}),(0,w.jsxs)(u,{className:`flex flex-col gap-4`,children:[(0,w.jsx)(ye,{zipPath:O.report.zipPath,zipSizeBytes:O.report.zipSizeBytes,fileCount:O.report.summary.files.length,rawDumpIncluded:ge(O.report),onReveal:Ve}),(0,w.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border bg-muted/50 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,w.jsx)(oe,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,w.jsx)(`span`,{children:(0,w.jsx)(r,{id:`-o5XAG`})})]})]}),(0,w.jsxs)(d,{className:`sm:justify-between`,children:[(0,w.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>k(me),children:(0,w.jsx)(r,{id:`iH8pgl`})}),(0,w.jsx)(o,{onClick:()=>void G(O.report),children:(0,w.jsx)(r,{id:`O9oQJS`})})]})]}),t[55]=G,t[56]=O.report,t[57]=O.step,t[58]=J):J=t[58];let Y;t[59]!==D||t[60]!==O.report||t[61]!==O.step||t[62]!==We?(Y=O.step===`sending`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(f,{children:[(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`M5_9s2`})}),(0,w.jsx)(s,{className:`sr-only`,children:(0,w.jsx)(r,{id:`MJqRO6`})})]}),(0,w.jsxs)(u,{className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 text-sm`,children:[(0,w.jsx)(b,{className:`size-4 shrink-0 animate-spin text-primary motion-reduce:animate-none`,"aria-hidden":`true`}),(0,w.jsx)(r,{id:`qmL1UG`}),(0,w.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:(0,w.jsx)(r,{id:`JJcBCm`,values:{0:he(O.report.zipSizeBytes)}})})]}),(0,w.jsx)(`div`,{role:`progressbar`,"aria-label":D({id:`M5_9s2`}),className:`h-1.5 overflow-hidden rounded-full bg-secondary`,children:(0,w.jsx)(`div`,{className:`h-full rounded-full bg-primary`,style:{width:`${We}%`}})})]}),(0,w.jsxs)(d,{className:`sm:justify-between`,children:[(0,w.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>ze(O.report),children:(0,w.jsx)(r,{id:`dEgA5A`})}),(0,w.jsx)(o,{disabled:!0,children:(0,w.jsx)(r,{id:`O9oQJS`})})]})]}),t[59]=D,t[60]=O.report,t[61]=O.step,t[62]=We,t[63]=Y):Y=t[63];let X;t[64]!==D||t[65]!==W||t[66]!==O.reference||t[67]!==O.step||t[68]!==ke?(X=O.step===`success`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(u,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{role:`status`,className:`flex flex-col gap-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(_,{className:`size-5 shrink-0 text-primary`,"aria-hidden":`true`}),(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`IYciRC`})})]}),(0,w.jsx)(s,{children:(0,w.jsx)(r,{id:`2myNzt`})})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(`label`,{htmlFor:ke,className:`text-sm font-medium`,children:(0,w.jsx)(r,{id:`M-IF14`})}),(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsx)(ne,{id:ke,readOnly:!0,value:O.reference,onFocus:ve,onClick:_e,className:`select-all bg-muted pr-9 font-mono text-sm font-medium tracking-wide`}),(0,w.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:(0,w.jsx)(y,{copyContent:O.reference,clipboardWrite:ae})})]})]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`fxJk_6`,components:{0:(0,w.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,w.jsx)(le,{href:ce(D({id:`qEEfPk`,values:{0:O.reference}}))})}})})]})}),(0,w.jsx)(d,{children:(0,w.jsx)(o,{onClick:()=>W(!1),children:(0,w.jsx)(r,{id:`DPfwMq`})})})]}),t[64]=D,t[65]=W,t[66]=O.reference,t[67]=O.step,t[68]=ke,t[69]=X):X=t[69];let Z;t[70]!==W||t[71]!==O.mailtoUrl||t[72]!==O.report||t[73]!==O.step?(Z=O.step===`email`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(f,{children:[(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`6zzhQL`})}),(0,w.jsx)(s,{children:(0,w.jsx)(r,{id:`UTgWxm`})})]}),(0,w.jsxs)(u,{className:`flex flex-col gap-4`,children:[(0,w.jsx)(ye,{zipPath:O.report.zipPath,zipSizeBytes:O.report.zipSizeBytes,fileCount:O.report.summary.files.length,rawDumpIncluded:ge(O.report),onReveal:Ve}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`9XIEYq`,components:{0:(0,w.jsx)(le,{href:O.mailtoUrl})}})})]}),(0,w.jsxs)(d,{className:`sm:justify-between`,children:[(0,w.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>W(!1),children:(0,w.jsx)(r,{id:`yz7wBu`})}),(0,w.jsx)(o,{onClick:()=>Ue(O.mailtoUrl),children:(0,w.jsx)(r,{id:`GuaJb-`})})]})]}),t[70]=W,t[71]=O.mailtoUrl,t[72]=O.report,t[73]=O.step,t[74]=Z):Z=t[74];let Q;t[75]!==W||t[76]!==G||t[77]!==O.mailtoUrl||t[78]!==O.report||t[79]!==O.step?(Q=O.step===`failure`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(f,{children:[(0,w.jsx)(c,{children:(0,w.jsx)(r,{id:`Wi-VWy`})}),(0,w.jsx)(s,{className:`sr-only`,children:(0,w.jsx)(r,{id:`1OKzC_`})})]}),(0,w.jsxs)(u,{className:`flex flex-col gap-4`,children:[(0,w.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,w.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`font-medium`,children:(0,w.jsx)(r,{id:`Oawo4U`})}),(0,w.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,w.jsx)(r,{id:`2-CeZn`})})]})]}),(0,w.jsx)(ye,{zipPath:O.report.zipPath,zipSizeBytes:O.report.zipSizeBytes,fileCount:null,rawDumpIncluded:ge(O.report),onReveal:Ve}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,w.jsx)(r,{id:`9XIEYq`,components:{0:(0,w.jsx)(le,{href:O.mailtoUrl})}})})]}),(0,w.jsxs)(d,{className:`sm:justify-between`,children:[(0,w.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>W(!1),children:(0,w.jsx)(r,{id:`yz7wBu`})}),(0,w.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:[(0,w.jsx)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>void G(O.report),children:(0,w.jsx)(r,{id:`KDw4GX`})}),(0,w.jsx)(o,{onClick:()=>Ue(O.mailtoUrl),children:(0,w.jsx)(r,{id:`GuaJb-`})})]})]})]}),t[75]=W,t[76]=G,t[77]=O.mailtoUrl,t[78]=O.report,t[79]=O.step,t[80]=Q):Q=t[80];let $;t[81]!==Ge||t[82]!==q||t[83]!==J||t[84]!==Y||t[85]!==X||t[86]!==Z||t[87]!==Q?($=(0,w.jsxs)(l,{className:`sm:max-w-2xl`,showCloseButton:Ge,children:[q,J,Y,X,Z,Q]}),t[81]=Ge,t[82]=q,t[83]=J,t[84]=Y,t[85]=X,t[86]=Z,t[87]=Q,t[88]=$):$=t[88];let Ke;return t[89]!==W||t[90]!==n||t[91]!==$?(Ke=(0,w.jsx)(p,{open:n,onOpenChange:W,children:$}),t[89]=W,t[90]=n,t[91]=$,t[92]=Ke):Ke=t[92],Ke}function _e(e){return e.currentTarget.select()}function ve(e){return e.currentTarget.select()}function ye(e){let t=(0,se.c)(23),{zipPath:n,zipSizeBytes:i,fileCount:a,rawDumpIncluded:s,onReveal:c}=e,l;t[0]===n?l=t[1]:(l=O(n),t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=he(i),t[2]=i,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,w.jsx)(`div`,{className:`flex items-center justify-center size-8 rounded-md bg-muted`,children:(0,w.jsx)(S,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`})}),t[4]=p):p=t[4];let m;t[5]===u?m=t[6]:(m=(0,w.jsx)(`p`,{className:`truncate text-1sm`,title:u,children:u}),t[5]=u,t[6]=m);let h;t[7]!==a||t[8]!==s||t[9]!==f?(h=(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a===null?s?(0,w.jsx)(r,{id:`_FLBbi`,values:{sizeText:f}}):(0,w.jsx)(r,{id:`89y7ar`,values:{sizeText:f}}):s?(0,w.jsx)(r,{id:`sn5BEU`,values:{sizeText:f,fileCount:a}}):(0,w.jsx)(r,{id:`3DJEEt`,values:{sizeText:f,fileCount:a}})}),t[7]=a,t[8]=s,t[9]=f,t[10]=h):h=t[10];let g;t[11]!==m||t[12]!==h?(g=(0,w.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[m,h]}),t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==c||t[15]!==n?(_=()=>c(n),t[14]=c,t[15]=n,t[16]=_):_=t[16];let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,w.jsx)(r,{id:`LtSYdi`}),t[17]=v):v=t[17];let y;t[18]===_?y=t[19]:(y=(0,w.jsx)(o,{variant:`link`,className:`h-auto shrink-0 p-0 text-xs`,onClick:_,children:v}),t[18]=_,t[19]=y);let b;return t[20]!==g||t[21]!==y?(b=(0,w.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md border px-3 py-2.5`,children:[p,g,y]}),t[20]=g,t[21]=y,t[22]=b):b=t[22],b}export{k as default};
@@ -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"./utils-CPqDy6Hr.js";import{t as s}from"./button-RQ5o7P7w.js";import{t as c}from"./label-G0lbYOgL.js";import{i as l,n as u,o as d,s as f,t as p}from"./select-BUOcREjn.js";import{t as m}from"./switch-BuVbhbtp.js";import{t as h}from"./createLucideIcon-DihYAFEK.js";import{t as g}from"./braces-BG3bQFuB.js";import{t as _}from"./case-sensitive-DjnVZ1Bg.js";import{t as v}from"./hash-BXtq910s.js";import{t as y}from"./trash-2-WxyktwvM.js";import{n as b}from"./dist-uN7pEWl0.js";import{t as x}from"./input-Cm94Cun3.js";import{d as S,f as C,o as w,r as T,s as E}from"./lint-config-client-DDxBMTZk.js";import{i as D,r as ee,t as O}from"./EditorModeToggle-CR5jA0YM.js";import{t as k}from"./tag-pill-input-DVdwNfBT.js";import{t as te}from"./useLintConfigViewMode-DHyC74de.js";import{i as A,r as ne,t as re}from"./schema-fields-view-intent-DVVFEaIP.js";var j=h(`brackets`,[[`path`,{d:`M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3`,key:`1kt8lf`}],[`path`,{d:`M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3`,key:`gduv9`}]]),M=h(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),N=h(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),P=a(),F=e(n(),1),I=t(),ie=[`string`,`number`,`boolean`,`array`,`object`],L=[`string`,`number`,`boolean`,`enum`,`array`,`object`],R=[`string`,`number`,`boolean`,`enum`,`object`],z={string:{Icon:_,className:`text-green-500`},number:{Icon:v,className:`text-blue-500`},boolean:{Icon:N,className:`text-orange-500`},enum:{Icon:M,className:`text-yellow-500`},array:{Icon:j,className:`text-pink-500`},object:{Icon:g,className:`text-purple-500`}};function ae(e){let t=(0,P.c)(8),{option:n}=e,{Icon:r,className:i}=z[n],a;t[0]===i?a=t[1]:(a=o(`size-3.5 shrink-0`,i),t[0]=i,t[1]=a);let s;t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==s?(c=(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[s,n]}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c}function oe(e){let t=(0,P.c)(5),{option:n}=e,{Icon:r,className:i}=z[n],a;t[0]===i?a=t[1]:(a=o(`size-4 shrink-0`,i),t[0]=i,t[1]=a);let s;return t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4],s}var se=4,B=new Set([`$schema`,`type`,`properties`,`required`]),ce=new Set([`type`,`enum`,`pattern`,`format`,`items`,`description`,`properties`,`required`]);function V(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function le(e){return e===void 0?[]:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:null}function ue(e){if(Object.keys(e).some(e=>!ce.has(e)))return!0;let t=e.items;if(t!==void 0){if(!V(t))return!0;let e=new Set([`enum`,`type`,`properties`,`required`,`description`]);if(Object.keys(t).some(t=>!e.has(t)))return!0}return!1}function de(e,t){return[...e.map(e=>typeof e==`string`?e:`[]`),t].join(`.`)}function fe(e){let t=(0,P.c)(28),{file:n}=e,{_:a}=i(),{data:o}=S(),s,c,l,u,d,f,p;if(t[0]!==a||t[1]!==o?.effective.plugins.frontmatter.schemas||t[2]!==n){let e=o?.effective.plugins.frontmatter.schemas.find(e=>e.file===n)?.schema,i=V(e)?Object.keys(e).filter(pe):[],m;t[10]!==a||t[11]!==n?(m={save:(e,t,r)=>{(async()=>{let i=await C(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`IQgeSn`}))})()},rename:(e,t,r)=>{(async()=>{let i=await E(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`kooyLJ`}))})()},remove:(e,t)=>{(async()=>{let r=await w(n,e,t);r.ok?T():b.error(r.errorDetail??a({id:`qC7PwZ`}))})()}},t[10]=a,t[11]=n,t[12]=m):m=t[12],c=m,u=`space-y-3`,d=`frontmatter-field-editor-${n}`,f=e===void 0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,I.jsx)(r,{id:`ri6zS-`})}),t[13]!==n||t[14]!==i?(p=i.length>0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-schema-root-preserved-${n}`,children:(0,I.jsx)(r,{id:`98FP1E`,values:{0:i.join(`, `)}})}),t[13]=n,t[14]=i,t[15]=p):p=t[15],s=me,l=V(e)?e:{},t[0]=a,t[1]=o?.effective.plugins.frontmatter.schemas,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[16]=m):m=t[16];let h=`frontmatter-add-field-${n}`,g;t[17]!==s||t[18]!==c||t[19]!==l||t[20]!==h?(g=(0,I.jsx)(s,{node:l,parentPath:m,depth:0,addInputId:h,ops:c}),t[17]=s,t[18]=c,t[19]=l,t[20]=h,t[21]=g):g=t[21];let _;return t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p||t[26]!==g?(_=(0,I.jsxs)(`div`,{className:u,"data-testid":d,children:[f,p,g]}),t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=g,t[27]=_):_=t[27],_}function pe(e){return!B.has(e)}function me(e){let t=(0,P.c)(19),{node:n,parentPath:r,depth:i,addInputId:a,ops:o}=e,s;t[0]===n.properties?s=t[1]:(s=V(n.properties)?n.properties:{},t[0]=n.properties,t[1]=s);let c=s,l,u;if(t[2]!==i||t[3]!==n.required||t[4]!==o||t[5]!==r||t[6]!==c){let e=Array.isArray(n.required)?n.required.filter(H):[];l=`space-y-2`,u=Object.entries(c).map(t=>{let[n,a]=t;return(0,I.jsx)(he,{field:n,property:V(a)?a:{},isRequired:e.includes(n),parentPath:r,depth:i,ops:o},n)}),t[2]=i,t[3]=n.required,t[4]=o,t[5]=r,t[6]=c,t[7]=l,t[8]=u}else l=t[7],u=t[8];let d;t[9]!==o||t[10]!==r?(d=e=>o.save(e,{type:`string`},r),t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;t[12]!==a||t[13]!==d?(f=(0,I.jsx)(U,{inputId:a,onAdd:d}),t[12]=a,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==u||t[17]!==f?(p=(0,I.jsxs)(`div`,{className:l,children:[u,f]}),t[15]=l,t[16]=u,t[17]=f,t[18]=p):p=t[18],p}function H(e){return typeof e==`string`}function he(e){let t=(0,P.c)(172),{field:n,property:a,isRequired:o,parentPath:l,depth:h,ops:g}=e,{_}=i(),[v,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(!1),C;t[0]!==n||t[1]!==l?(C=de(l,n),t[0]=n,t[1]=l,t[2]=C):C=t[2];let w=C,T=typeof a.type==`string`&&ie.includes(a.type)?a.type:void 0,E;t[3]===a.enum?E=t[4]:(E=le(a.enum),t[3]=a.enum,t[4]=E);let D=E,ee;t[5]===a.items?ee=t[6]:(ee=V(a.items)?a.items:{},t[5]=a.items,t[6]=ee);let O=ee,te;t[7]===O.enum?te=t[8]:(te=le(O.enum),t[7]=O.enum,t[8]=te);let A=te,ne=typeof a.pattern==`string`?a.pattern:``,re=typeof a.description==`string`?a.description:``,j;t[9]===a?j=t[10]:(j=ue(a),t[9]=a,t[10]=j);let M=j,N=T!==`array`&&D!==null&&(D.length>0||v),z=T===`object`&&h<se,ae;t[11]===O.type?ae=t[12]:(ae=typeof O.type==`string`&&R.includes(O.type)?O.type:void 0,t[11]=O.type,t[12]=ae);let B=ae,ce=B!==`object`&&A!==null&&(A.length>0||x),fe=T===`array`&&B===`object`&&h<se,pe=`frontmatter-field-row-${w}`,H;t[13]!==N||t[14]!==T?(H=(N||T!==void 0)&&(0,I.jsx)(oe,{option:N?`enum`:T}),t[13]=N,t[14]=T,t[15]=H):H=t[15];let he=`frontmatter-field-name-${w}`,U;t[16]===_?U=t[17]:(U=_({id:`nrXDdR`}),t[16]=_,t[17]=U);let W;t[18]!==n||t[19]!==g||t[20]!==l?(W=e=>{e!==``&&e!==n&&g.rename(n,e,l)},t[18]=n,t[19]=g,t[20]=l,t[21]=W):W=t[21];let G;t[22]!==n||t[23]!==U||t[24]!==W||t[25]!==he?(G=(0,I.jsx)(ve,{id:he,initial:n,ariaLabel:U,className:`h-7 w-36 shrink-0 font-mono text-sm font-medium`,onCommit:W}),t[22]=n,t[23]=U,t[24]=W,t[25]=he,t[26]=G):G=t[26];let ye=`frontmatter-field-description-${w}`,K;t[27]===_?K=t[28]:(K=_({id:`PGPGsL`}),t[27]=_,t[28]=K);let q;t[29]!==_||t[30]!==n?(q=_({id:`IFALcX`,values:{field:n}}),t[29]=_,t[30]=n,t[31]=q):q=t[31];let J;t[32]!==n||t[33]!==g||t[34]!==l?(J=e=>g.save(n,{description:e===``?null:e},l),t[32]=n,t[33]=g,t[34]=l,t[35]=J):J=t[35];let Y;t[36]!==re||t[37]!==ye||t[38]!==K||t[39]!==q||t[40]!==J?(Y=(0,I.jsx)(ve,{id:ye,initial:re,placeholder:K,ariaLabel:q,className:`h-7 min-w-0 flex-1`,onCommit:J}),t[36]=re,t[37]=ye,t[38]=K,t[39]=q,t[40]=J,t[41]=Y):Y=t[41];let be=`frontmatter-field-required-${w}`,xe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,I.jsx)(r,{id:`TMLAx2`}),t[42]=xe):xe=t[42];let X;t[43]===be?X=t[44]:(X=(0,I.jsx)(c,{htmlFor:be,className:`shrink-0 text-xs text-muted-foreground`,children:xe}),t[43]=be,t[44]=X);let Se=`frontmatter-field-required-${w}`,Z;t[45]!==n||t[46]!==g||t[47]!==l?(Z=e=>g.save(n,{required:e},l),t[45]=n,t[46]=g,t[47]=l,t[48]=Z):Z=t[48];let Ce=`frontmatter-field-required-${w}`,we;t[49]!==o||t[50]!==Se||t[51]!==Z||t[52]!==Ce?(we=(0,I.jsx)(m,{id:Se,checked:o,onCheckedChange:Z,"data-testid":Ce}),t[49]=o,t[50]=Se,t[51]=Z,t[52]=Ce,t[53]=we):we=t[53];let Te;t[54]!==n||t[55]!==g||t[56]!==l?(Te=()=>g.remove(n,l),t[54]=n,t[55]=g,t[56]=l,t[57]=Te):Te=t[57];let Ee;t[58]!==_||t[59]!==n?(Ee=_({id:`bF22t6`,values:{field:n}}),t[58]=_,t[59]=n,t[60]=Ee):Ee=t[60];let De=`frontmatter-field-remove-${w}`,Oe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,I.jsx)(y,{"aria-hidden":!0,className:`size-4`}),t[61]=Oe):Oe=t[61];let ke;t[62]!==Te||t[63]!==Ee||t[64]!==De?(ke=(0,I.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:Te,"aria-label":Ee,"data-testid":De,children:Oe}),t[62]=Te,t[63]=Ee,t[64]=De,t[65]=ke):ke=t[65];let Ae;t[66]!==G||t[67]!==Y||t[68]!==X||t[69]!==we||t[70]!==ke||t[71]!==H?(Ae=(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[H,G,Y,X,we,ke]}),t[66]=G,t[67]=Y,t[68]=X,t[69]=we,t[70]=ke,t[71]=H,t[72]=Ae):Ae=t[72];let je;t[73]!==w||t[74]!==M?(je=M&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-field-preserved-${w}`,children:(0,I.jsx)(r,{id:`TdlVEN`})}),t[73]=w,t[74]=M,t[75]=je):je=t[75];let Me=`frontmatter-field-type-${w}`,Ne;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,I.jsx)(r,{id:`-zy2Nq`}),t[76]=Ne):Ne=t[76];let Pe;t[77]===Me?Pe=t[78]:(Pe=(0,I.jsx)(c,{className:`text-xs`,htmlFor:Me,children:Ne}),t[77]=Me,t[78]=Pe);let Fe=N?`enum`:T??``,Ie;t[79]!==D?.length||t[80]!==n||t[81]!==g||t[82]!==l||t[83]!==N||t[84]!==T?(Ie=e=>{if(e===`enum`){b(!0),T===void 0&&g.save(n,{type:`string`},l);return}b(!1);let t=N&&(D?.length??0)>0?{type:e,enum:null}:{type:e};g.save(n,t,l)},t[79]=D?.length,t[80]=n,t[81]=g,t[82]=l,t[83]=N,t[84]=T,t[85]=Ie):Ie=t[85];let Le=`frontmatter-field-type-${w}`,Re=`frontmatter-field-type-${w}`,Q;t[86]===_?Q=t[87]:(Q=_({id:`EkUnmS`}),t[86]=_,t[87]=Q);let ze;t[88]===Q?ze=t[89]:(ze=(0,I.jsx)(f,{placeholder:Q}),t[88]=Q,t[89]=ze);let Be;t[90]!==Le||t[91]!==Re||t[92]!==ze?(Be=(0,I.jsx)(d,{id:Le,"data-testid":Re,children:ze}),t[90]=Le,t[91]=Re,t[92]=ze,t[93]=Be):Be=t[93];let Ve;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,I.jsx)(u,{children:L.map(_e)}),t[94]=Ve):Ve=t[94];let He;t[95]!==Fe||t[96]!==Ie||t[97]!==Be?(He=(0,I.jsxs)(p,{value:Fe,onValueChange:Ie,children:[Be,Ve]}),t[95]=Fe,t[96]=Ie,t[97]=Be,t[98]=He):He=t[98];let Ue;t[99]!==Pe||t[100]!==He?(Ue=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Pe,He]}),t[99]=Pe,t[100]=He,t[101]=Ue):Ue=t[101];let We=`frontmatter-field-pattern-${w}`,Ge;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,I.jsx)(r,{id:`cstC0z`}),t[102]=Ge):Ge=t[102];let Ke;t[103]===We?Ke=t[104]:(Ke=(0,I.jsx)(c,{className:`text-xs`,htmlFor:We,children:Ge}),t[103]=We,t[104]=Ke);let qe=`frontmatter-field-pattern-${w}`,Je;t[105]!==n||t[106]!==g||t[107]!==l?(Je=e=>g.save(n,{pattern:e===``?null:e},l),t[105]=n,t[106]=g,t[107]=l,t[108]=Je):Je=t[108];let Ye;t[109]!==ne||t[110]!==qe||t[111]!==Je?(Ye=(0,I.jsx)(ve,{id:qe,initial:ne,onCommit:Je}),t[109]=ne,t[110]=qe,t[111]=Je,t[112]=Ye):Ye=t[112];let Xe;t[113]!==Ke||t[114]!==Ye?(Xe=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Ke,Ye]}),t[113]=Ke,t[114]=Ye,t[115]=Xe):Xe=t[115];let Ze;t[116]!==Ue||t[117]!==Xe?(Ze=(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[Ue,Xe]}),t[116]=Ue,t[117]=Xe,t[118]=Ze):Ze=t[118];let Qe;t[119]!==_||t[120]!==D||t[121]!==n||t[122]!==g||t[123]!==l||t[124]!==w||t[125]!==T?(Qe=T!==`array`&&T!==`object`&&D!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(c,{className:`text-xs`,htmlFor:`frontmatter-field-enum-${w}`,children:(0,I.jsx)(r,{id:`UGeJuP`})}),(0,I.jsx)(k,{id:`frontmatter-field-enum-${w}`,value:D,grammar:`free-text`,onChange:e=>g.save(n,{enum:e.length===0?null:e},l),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`5qQr1u`,values:{field:n}})})]}),t[119]=_,t[120]=D,t[121]=n,t[122]=g,t[123]=l,t[124]=w,t[125]=T,t[126]=Qe):Qe=t[126];let $e;t[127]!==_||t[128]!==n||t[129]!==A?.length||t[130]!==B||t[131]!==g||t[132]!==l||t[133]!==w||t[134]!==ce||t[135]!==T?($e=T===`array`&&(0,I.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(c,{className:`text-xs`,htmlFor:`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(r,{id:`6pe_G5`})}),(0,I.jsxs)(p,{value:ce?`enum`:B??``,onValueChange:e=>{if(e===`enum`){S(!0),B===void 0&&g.save(n,{itemsType:`string`},l);return}S(!1);let t=ce&&(A?.length??0)>0?{itemsType:e,itemsEnum:null}:{itemsType:e};g.save(n,t,l)},children:[(0,I.jsx)(d,{id:`frontmatter-field-items-type-${w}`,"data-testid":`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(f,{placeholder:_({id:`EkUnmS`})})}),(0,I.jsx)(u,{children:R.map(ge)})]})]})}),t[127]=_,t[128]=n,t[129]=A?.length,t[130]=B,t[131]=g,t[132]=l,t[133]=w,t[134]=ce,t[135]=T,t[136]=$e):$e=t[136];let et;t[137]!==_||t[138]!==n||t[139]!==A||t[140]!==B||t[141]!==g||t[142]!==l||t[143]!==w||t[144]!==T?(et=T===`array`&&B!==`object`&&A!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(c,{className:`text-xs`,htmlFor:`frontmatter-field-items-enum-${w}`,children:(0,I.jsx)(r,{id:`ezUmoU`})}),(0,I.jsx)(k,{id:`frontmatter-field-items-enum-${w}`,value:A,grammar:`free-text`,onChange:e=>g.save(n,{itemsEnum:e.length===0?null:e},l),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`e60wew`,values:{field:n}})})]}),t[137]=_,t[138]=n,t[139]=A,t[140]=B,t[141]=g,t[142]=l,t[143]=w,t[144]=T,t[145]=et):et=t[145];let tt;t[146]!==h||t[147]!==n||t[148]!==O||t[149]!==g||t[150]!==l||t[151]!==w||t[152]!==fe?(tt=fe&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-item-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`wU8WyK`})}),(0,I.jsx)(me,{node:O,parentPath:[...l,n,{items:!0}],depth:h+1,addInputId:`frontmatter-add-field-${w}.[]`,ops:g})]}),t[146]=h,t[147]=n,t[148]=O,t[149]=g,t[150]=l,t[151]=w,t[152]=fe,t[153]=tt):tt=t[153];let $;t[154]!==h||t[155]!==n||t[156]!==g||t[157]!==l||t[158]!==w||t[159]!==a||t[160]!==z?($=z&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`9nIrRp`})}),(0,I.jsx)(me,{node:a,parentPath:[...l,n],depth:h+1,addInputId:`frontmatter-add-field-${w}`,ops:g})]}),t[154]=h,t[155]=n,t[156]=g,t[157]=l,t[158]=w,t[159]=a,t[160]=z,t[161]=$):$=t[161];let nt;return t[162]!==Ae||t[163]!==je||t[164]!==Ze||t[165]!==Qe||t[166]!==$e||t[167]!==et||t[168]!==tt||t[169]!==$||t[170]!==pe?(nt=(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":pe,children:[Ae,je,Ze,Qe,$e,et,tt,$]}),t[162]=Ae,t[163]=je,t[164]=Ze,t[165]=Qe,t[166]=$e,t[167]=et,t[168]=tt,t[169]=$,t[170]=pe,t[171]=nt):nt=t[171],nt}function ge(e){return(0,I.jsx)(l,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function _e(e){return(0,I.jsx)(l,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function U(e){let t=(0,P.c)(24),{inputId:n,onAdd:i}=e,[a,o]=(0,F.useState)(``),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(r,{id:`Va3xJe`}),t[0]=l):l=t[0];let u;t[1]===n?u=t[2]:(u=(0,I.jsx)(c,{htmlFor:n,className:`text-xs`,children:l}),t[1]=n,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[3]=d):d=t[3];let f=`${n}-input`,p;t[4]!==n||t[5]!==a||t[6]!==f?(p=(0,I.jsx)(x,{id:n,value:a,onChange:d,placeholder:`owner`,"data-testid":f}),t[4]=n,t[5]=a,t[6]=f,t[7]=p):p=t[7];let m;t[8]!==u||t[9]!==p?(m=(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[u,p]}),t[8]=u,t[9]=p,t[10]=m):m=t[10];let h;t[11]===a?h=t[12]:(h=a.trim(),t[11]=a,t[12]=h);let g=h===``,_;t[13]!==a||t[14]!==i?(_=()=>{i(a.trim()),o(``)},t[13]=a,t[14]=i,t[15]=_):_=t[15];let v=`${n}-save`,y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,I.jsx)(r,{id:`m16xKo`}),t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==g||t[19]!==_?(b=(0,I.jsx)(s,{size:`sm`,variant:`outline`,disabled:g,onClick:_,"data-testid":v,children:y}),t[17]=v,t[18]=g,t[19]=_,t[20]=b):b=t[20];let S;return t[21]!==b||t[22]!==m?(S=(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[m,b]}),t[21]=b,t[22]=m,t[23]=S):S=t[23],S}function ve(e){let t=(0,P.c)(15),{id:n,initial:r,onCommit:i,placeholder:a,ariaLabel:o,className:s}=e,[c,l]=(0,F.useState)(r),u;t[0]!==c||t[1]!==r||t[2]!==i?(u=()=>{c.trim()!==r&&i(c.trim())},t[0]=c,t[1]=r,t[2]=i,t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>l(e.target.value),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=e=>{e.key===`Enter`&&d()},t[5]=d,t[6]=p);let m;return t[7]!==o||t[8]!==s||t[9]!==d||t[10]!==c||t[11]!==n||t[12]!==a||t[13]!==p?(m=(0,I.jsx)(x,{id:n,value:c,onChange:f,onBlur:d,onKeyDown:p,placeholder:a,"aria-label":o,className:s,"data-testid":n}),t[7]=o,t[8]=s,t[9]=d,t[10]=c,t[11]=n,t[12]=a,t[13]=p,t[14]=m):m=t[14],m}function W(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function G(e){let t=(0,P.c)(45),{assetPath:n}=e,{_:r}=i(),[a,o]=te(),[s,c]=(0,F.useState)(null),l=s??a,u;t[0]===o?u=t[1]:(u=e=>{c(e),o(e)},t[0]=o,t[1]=u);let d=u,f,p;t[2]===n?(f=t[3],p=t[4]):(f=()=>{let e=e=>{e===n&&re(e)&&c(`rules`)};return e(n),ne(e)},p=[n],t[2]=n,t[3]=f,t[4]=p),(0,F.useEffect)(f,p);let{data:m}=S(),h;t[5]===m?.effective.plugins.frontmatter.schemas?h=t[6]:(h=m?.effective.plugins.frontmatter.schemas??[],t[5]=m?.effective.plugins.frontmatter.schemas,t[6]=h);let g;if(t[7]!==n||t[8]!==h){let e;t[10]===n?e=t[11]:(e=e=>e.file===n,t[10]=n,t[11]=e),g=h.some(e),t[7]=n,t[8]=h,t[9]=g}else g=t[9];let _=g,v=!_||l===`source`,y;t[12]===n?y=t[13]:(y=n.split(`/`).pop()??n,t[12]=n,t[13]=y);let b=y,x;t[14]===b?x=t[15]:(x=b.includes(`.`)?(b.split(`.`).pop()??``).toLowerCase():``,t[14]=b,t[15]=x);let C=x,w;t[16]===n?w=t[17]:(w=(0,I.jsx)(ee,{entry:{kind:`asset`,path:n},className:`shrink-0 border-b bg-background px-3 py-1.5`}),t[16]=n,t[17]=w);let T;t[18]===d?T=t[19]:(T=e=>d(e===`source`?`source`:`rules`),t[18]=d,t[19]=T);let E=!_,k;t[20]===r?k=t[21]:(k=r({id:`vF68cg`}),t[20]=r,t[21]=k);let j;t[22]===r?j=t[23]:(j=r({id:`wdxz7K`}),t[22]=r,t[23]=j);let M;t[24]===r?M=t[25]:(M=r({id:`nc-ipN`}),t[24]=r,t[25]=M);let N;t[26]!==v||t[27]!==E||t[28]!==k||t[29]!==j||t[30]!==M||t[31]!==T?(N=(0,I.jsx)(O,{isSourceMode:v,onModeChange:T,wysiwygDisabled:E,wysiwygLabel:k,sourceLabel:j,wysiwygDisabledReason:M}),t[26]=v,t[27]=E,t[28]=k,t[29]=j,t[30]=M,t[31]=T,t[32]=N):N=t[32];let ie;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,I.jsx)(A,{className:`absolute left-3 top-1/2 -translate-y-1/2`}),t[33]=ie):ie=t[33];let L;t[34]===N?L=t[35]:(L=(0,I.jsxs)(`div`,{className:`relative flex shrink-0 items-center justify-center border-b bg-background py-2`,children:[N,ie]}),t[34]=N,t[35]=L);let R;t[36]!==n||t[37]!==C||t[38]!==b||t[39]!==v?(R=v?(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,I.jsx)(D,{src:W(n),assetPath:n,fileName:b,extension:C},n)}):(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:(0,I.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,I.jsx)(fe,{file:n})})}),t[36]=n,t[37]=C,t[38]=b,t[39]=v,t[40]=R):R=t[40];let z;return t[41]!==L||t[42]!==R||t[43]!==w?(z=(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"data-schema-config-editor":``,children:[w,L,R]}),t[41]=L,t[42]=R,t[43]=w,t[44]=z):z=t[44],z}export{G as SchemaConfigEditor};
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"./utils-CPqDy6Hr.js";import{t as s}from"./button-RQ5o7P7w.js";import{t as c}from"./label-G0lbYOgL.js";import{i as l,n as u,o as d,s as f,t as p}from"./select-BUOcREjn.js";import{t as m}from"./switch-BuVbhbtp.js";import{t as h}from"./createLucideIcon-DihYAFEK.js";import{t as g}from"./braces-BG3bQFuB.js";import{t as _}from"./case-sensitive-DjnVZ1Bg.js";import{t as v}from"./hash-BXtq910s.js";import{t as y}from"./trash-2-WxyktwvM.js";import{n as b}from"./dist-uN7pEWl0.js";import{t as x}from"./input-Cm94Cun3.js";import{d as S,f as C,o as w,r as T,s as E}from"./lint-config-client-B0H2okzr.js";import{i as D,r as ee,t as O}from"./EditorModeToggle-C9I-Efpm.js";import{t as k}from"./tag-pill-input-Bx_oWl-2.js";import{t as te}from"./useLintConfigViewMode-DHyC74de.js";import{i as A,r as ne,t as re}from"./schema-fields-view-intent-DVVFEaIP.js";var j=h(`brackets`,[[`path`,{d:`M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3`,key:`1kt8lf`}],[`path`,{d:`M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3`,key:`gduv9`}]]),M=h(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),N=h(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),P=a(),F=e(n(),1),I=t(),ie=[`string`,`number`,`boolean`,`array`,`object`],L=[`string`,`number`,`boolean`,`enum`,`array`,`object`],R=[`string`,`number`,`boolean`,`enum`,`object`],z={string:{Icon:_,className:`text-green-500`},number:{Icon:v,className:`text-blue-500`},boolean:{Icon:N,className:`text-orange-500`},enum:{Icon:M,className:`text-yellow-500`},array:{Icon:j,className:`text-pink-500`},object:{Icon:g,className:`text-purple-500`}};function ae(e){let t=(0,P.c)(8),{option:n}=e,{Icon:r,className:i}=z[n],a;t[0]===i?a=t[1]:(a=o(`size-3.5 shrink-0`,i),t[0]=i,t[1]=a);let s;t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==s?(c=(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[s,n]}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c}function oe(e){let t=(0,P.c)(5),{option:n}=e,{Icon:r,className:i}=z[n],a;t[0]===i?a=t[1]:(a=o(`size-4 shrink-0`,i),t[0]=i,t[1]=a);let s;return t[2]!==r||t[3]!==a?(s=(0,I.jsx)(r,{"aria-hidden":!0,className:a}),t[2]=r,t[3]=a,t[4]=s):s=t[4],s}var se=4,B=new Set([`$schema`,`type`,`properties`,`required`]),ce=new Set([`type`,`enum`,`pattern`,`format`,`items`,`description`,`properties`,`required`]);function V(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function le(e){return e===void 0?[]:Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:null}function ue(e){if(Object.keys(e).some(e=>!ce.has(e)))return!0;let t=e.items;if(t!==void 0){if(!V(t))return!0;let e=new Set([`enum`,`type`,`properties`,`required`,`description`]);if(Object.keys(t).some(t=>!e.has(t)))return!0}return!1}function de(e,t){return[...e.map(e=>typeof e==`string`?e:`[]`),t].join(`.`)}function fe(e){let t=(0,P.c)(28),{file:n}=e,{_:a}=i(),{data:o}=S(),s,c,l,u,d,f,p;if(t[0]!==a||t[1]!==o?.effective.plugins.frontmatter.schemas||t[2]!==n){let e=o?.effective.plugins.frontmatter.schemas.find(e=>e.file===n)?.schema,i=V(e)?Object.keys(e).filter(pe):[],m;t[10]!==a||t[11]!==n?(m={save:(e,t,r)=>{(async()=>{let i=await C(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`IQgeSn`}))})()},rename:(e,t,r)=>{(async()=>{let i=await E(n,e,t,r);i.ok?T():b.error(i.errorDetail??a({id:`kooyLJ`}))})()},remove:(e,t)=>{(async()=>{let r=await w(n,e,t);r.ok?T():b.error(r.errorDetail??a({id:`qC7PwZ`}))})()}},t[10]=a,t[11]=n,t[12]=m):m=t[12],c=m,u=`space-y-3`,d=`frontmatter-field-editor-${n}`,f=e===void 0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,I.jsx)(r,{id:`ri6zS-`})}),t[13]!==n||t[14]!==i?(p=i.length>0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-schema-root-preserved-${n}`,children:(0,I.jsx)(r,{id:`98FP1E`,values:{0:i.join(`, `)}})}),t[13]=n,t[14]=i,t[15]=p):p=t[15],s=me,l=V(e)?e:{},t[0]=a,t[1]=o?.effective.plugins.frontmatter.schemas,t[2]=n,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p}else s=t[3],c=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=t[9];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=[],t[16]=m):m=t[16];let h=`frontmatter-add-field-${n}`,g;t[17]!==s||t[18]!==c||t[19]!==l||t[20]!==h?(g=(0,I.jsx)(s,{node:l,parentPath:m,depth:0,addInputId:h,ops:c}),t[17]=s,t[18]=c,t[19]=l,t[20]=h,t[21]=g):g=t[21];let _;return t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p||t[26]!==g?(_=(0,I.jsxs)(`div`,{className:u,"data-testid":d,children:[f,p,g]}),t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=g,t[27]=_):_=t[27],_}function pe(e){return!B.has(e)}function me(e){let t=(0,P.c)(19),{node:n,parentPath:r,depth:i,addInputId:a,ops:o}=e,s;t[0]===n.properties?s=t[1]:(s=V(n.properties)?n.properties:{},t[0]=n.properties,t[1]=s);let c=s,l,u;if(t[2]!==i||t[3]!==n.required||t[4]!==o||t[5]!==r||t[6]!==c){let e=Array.isArray(n.required)?n.required.filter(H):[];l=`space-y-2`,u=Object.entries(c).map(t=>{let[n,a]=t;return(0,I.jsx)(he,{field:n,property:V(a)?a:{},isRequired:e.includes(n),parentPath:r,depth:i,ops:o},n)}),t[2]=i,t[3]=n.required,t[4]=o,t[5]=r,t[6]=c,t[7]=l,t[8]=u}else l=t[7],u=t[8];let d;t[9]!==o||t[10]!==r?(d=e=>o.save(e,{type:`string`},r),t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;t[12]!==a||t[13]!==d?(f=(0,I.jsx)(U,{inputId:a,onAdd:d}),t[12]=a,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==u||t[17]!==f?(p=(0,I.jsxs)(`div`,{className:l,children:[u,f]}),t[15]=l,t[16]=u,t[17]=f,t[18]=p):p=t[18],p}function H(e){return typeof e==`string`}function he(e){let t=(0,P.c)(172),{field:n,property:a,isRequired:o,parentPath:l,depth:h,ops:g}=e,{_}=i(),[v,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(!1),C;t[0]!==n||t[1]!==l?(C=de(l,n),t[0]=n,t[1]=l,t[2]=C):C=t[2];let w=C,T=typeof a.type==`string`&&ie.includes(a.type)?a.type:void 0,E;t[3]===a.enum?E=t[4]:(E=le(a.enum),t[3]=a.enum,t[4]=E);let D=E,ee;t[5]===a.items?ee=t[6]:(ee=V(a.items)?a.items:{},t[5]=a.items,t[6]=ee);let O=ee,te;t[7]===O.enum?te=t[8]:(te=le(O.enum),t[7]=O.enum,t[8]=te);let A=te,ne=typeof a.pattern==`string`?a.pattern:``,re=typeof a.description==`string`?a.description:``,j;t[9]===a?j=t[10]:(j=ue(a),t[9]=a,t[10]=j);let M=j,N=T!==`array`&&D!==null&&(D.length>0||v),z=T===`object`&&h<se,ae;t[11]===O.type?ae=t[12]:(ae=typeof O.type==`string`&&R.includes(O.type)?O.type:void 0,t[11]=O.type,t[12]=ae);let B=ae,ce=B!==`object`&&A!==null&&(A.length>0||x),fe=T===`array`&&B===`object`&&h<se,pe=`frontmatter-field-row-${w}`,H;t[13]!==N||t[14]!==T?(H=(N||T!==void 0)&&(0,I.jsx)(oe,{option:N?`enum`:T}),t[13]=N,t[14]=T,t[15]=H):H=t[15];let he=`frontmatter-field-name-${w}`,U;t[16]===_?U=t[17]:(U=_({id:`nrXDdR`}),t[16]=_,t[17]=U);let W;t[18]!==n||t[19]!==g||t[20]!==l?(W=e=>{e!==``&&e!==n&&g.rename(n,e,l)},t[18]=n,t[19]=g,t[20]=l,t[21]=W):W=t[21];let G;t[22]!==n||t[23]!==U||t[24]!==W||t[25]!==he?(G=(0,I.jsx)(ve,{id:he,initial:n,ariaLabel:U,className:`h-7 w-36 shrink-0 font-mono text-sm font-medium`,onCommit:W}),t[22]=n,t[23]=U,t[24]=W,t[25]=he,t[26]=G):G=t[26];let ye=`frontmatter-field-description-${w}`,K;t[27]===_?K=t[28]:(K=_({id:`PGPGsL`}),t[27]=_,t[28]=K);let q;t[29]!==_||t[30]!==n?(q=_({id:`IFALcX`,values:{field:n}}),t[29]=_,t[30]=n,t[31]=q):q=t[31];let J;t[32]!==n||t[33]!==g||t[34]!==l?(J=e=>g.save(n,{description:e===``?null:e},l),t[32]=n,t[33]=g,t[34]=l,t[35]=J):J=t[35];let Y;t[36]!==re||t[37]!==ye||t[38]!==K||t[39]!==q||t[40]!==J?(Y=(0,I.jsx)(ve,{id:ye,initial:re,placeholder:K,ariaLabel:q,className:`h-7 min-w-0 flex-1`,onCommit:J}),t[36]=re,t[37]=ye,t[38]=K,t[39]=q,t[40]=J,t[41]=Y):Y=t[41];let be=`frontmatter-field-required-${w}`,xe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,I.jsx)(r,{id:`TMLAx2`}),t[42]=xe):xe=t[42];let X;t[43]===be?X=t[44]:(X=(0,I.jsx)(c,{htmlFor:be,className:`shrink-0 text-xs text-muted-foreground`,children:xe}),t[43]=be,t[44]=X);let Se=`frontmatter-field-required-${w}`,Z;t[45]!==n||t[46]!==g||t[47]!==l?(Z=e=>g.save(n,{required:e},l),t[45]=n,t[46]=g,t[47]=l,t[48]=Z):Z=t[48];let Ce=`frontmatter-field-required-${w}`,we;t[49]!==o||t[50]!==Se||t[51]!==Z||t[52]!==Ce?(we=(0,I.jsx)(m,{id:Se,checked:o,onCheckedChange:Z,"data-testid":Ce}),t[49]=o,t[50]=Se,t[51]=Z,t[52]=Ce,t[53]=we):we=t[53];let Te;t[54]!==n||t[55]!==g||t[56]!==l?(Te=()=>g.remove(n,l),t[54]=n,t[55]=g,t[56]=l,t[57]=Te):Te=t[57];let Ee;t[58]!==_||t[59]!==n?(Ee=_({id:`bF22t6`,values:{field:n}}),t[58]=_,t[59]=n,t[60]=Ee):Ee=t[60];let De=`frontmatter-field-remove-${w}`,Oe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,I.jsx)(y,{"aria-hidden":!0,className:`size-4`}),t[61]=Oe):Oe=t[61];let ke;t[62]!==Te||t[63]!==Ee||t[64]!==De?(ke=(0,I.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:Te,"aria-label":Ee,"data-testid":De,children:Oe}),t[62]=Te,t[63]=Ee,t[64]=De,t[65]=ke):ke=t[65];let Ae;t[66]!==G||t[67]!==Y||t[68]!==X||t[69]!==we||t[70]!==ke||t[71]!==H?(Ae=(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[H,G,Y,X,we,ke]}),t[66]=G,t[67]=Y,t[68]=X,t[69]=we,t[70]=ke,t[71]=H,t[72]=Ae):Ae=t[72];let je;t[73]!==w||t[74]!==M?(je=M&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-field-preserved-${w}`,children:(0,I.jsx)(r,{id:`TdlVEN`})}),t[73]=w,t[74]=M,t[75]=je):je=t[75];let Me=`frontmatter-field-type-${w}`,Ne;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,I.jsx)(r,{id:`-zy2Nq`}),t[76]=Ne):Ne=t[76];let Pe;t[77]===Me?Pe=t[78]:(Pe=(0,I.jsx)(c,{className:`text-xs`,htmlFor:Me,children:Ne}),t[77]=Me,t[78]=Pe);let Fe=N?`enum`:T??``,Ie;t[79]!==D?.length||t[80]!==n||t[81]!==g||t[82]!==l||t[83]!==N||t[84]!==T?(Ie=e=>{if(e===`enum`){b(!0),T===void 0&&g.save(n,{type:`string`},l);return}b(!1);let t=N&&(D?.length??0)>0?{type:e,enum:null}:{type:e};g.save(n,t,l)},t[79]=D?.length,t[80]=n,t[81]=g,t[82]=l,t[83]=N,t[84]=T,t[85]=Ie):Ie=t[85];let Le=`frontmatter-field-type-${w}`,Re=`frontmatter-field-type-${w}`,Q;t[86]===_?Q=t[87]:(Q=_({id:`EkUnmS`}),t[86]=_,t[87]=Q);let ze;t[88]===Q?ze=t[89]:(ze=(0,I.jsx)(f,{placeholder:Q}),t[88]=Q,t[89]=ze);let Be;t[90]!==Le||t[91]!==Re||t[92]!==ze?(Be=(0,I.jsx)(d,{id:Le,"data-testid":Re,children:ze}),t[90]=Le,t[91]=Re,t[92]=ze,t[93]=Be):Be=t[93];let Ve;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,I.jsx)(u,{children:L.map(_e)}),t[94]=Ve):Ve=t[94];let He;t[95]!==Fe||t[96]!==Ie||t[97]!==Be?(He=(0,I.jsxs)(p,{value:Fe,onValueChange:Ie,children:[Be,Ve]}),t[95]=Fe,t[96]=Ie,t[97]=Be,t[98]=He):He=t[98];let Ue;t[99]!==Pe||t[100]!==He?(Ue=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Pe,He]}),t[99]=Pe,t[100]=He,t[101]=Ue):Ue=t[101];let We=`frontmatter-field-pattern-${w}`,Ge;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,I.jsx)(r,{id:`cstC0z`}),t[102]=Ge):Ge=t[102];let Ke;t[103]===We?Ke=t[104]:(Ke=(0,I.jsx)(c,{className:`text-xs`,htmlFor:We,children:Ge}),t[103]=We,t[104]=Ke);let qe=`frontmatter-field-pattern-${w}`,Je;t[105]!==n||t[106]!==g||t[107]!==l?(Je=e=>g.save(n,{pattern:e===``?null:e},l),t[105]=n,t[106]=g,t[107]=l,t[108]=Je):Je=t[108];let Ye;t[109]!==ne||t[110]!==qe||t[111]!==Je?(Ye=(0,I.jsx)(ve,{id:qe,initial:ne,onCommit:Je}),t[109]=ne,t[110]=qe,t[111]=Je,t[112]=Ye):Ye=t[112];let Xe;t[113]!==Ke||t[114]!==Ye?(Xe=(0,I.jsxs)(`div`,{className:`space-y-1`,children:[Ke,Ye]}),t[113]=Ke,t[114]=Ye,t[115]=Xe):Xe=t[115];let Ze;t[116]!==Ue||t[117]!==Xe?(Ze=(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[Ue,Xe]}),t[116]=Ue,t[117]=Xe,t[118]=Ze):Ze=t[118];let Qe;t[119]!==_||t[120]!==D||t[121]!==n||t[122]!==g||t[123]!==l||t[124]!==w||t[125]!==T?(Qe=T!==`array`&&T!==`object`&&D!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(c,{className:`text-xs`,htmlFor:`frontmatter-field-enum-${w}`,children:(0,I.jsx)(r,{id:`UGeJuP`})}),(0,I.jsx)(k,{id:`frontmatter-field-enum-${w}`,value:D,grammar:`free-text`,onChange:e=>g.save(n,{enum:e.length===0?null:e},l),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`5qQr1u`,values:{field:n}})})]}),t[119]=_,t[120]=D,t[121]=n,t[122]=g,t[123]=l,t[124]=w,t[125]=T,t[126]=Qe):Qe=t[126];let $e;t[127]!==_||t[128]!==n||t[129]!==A?.length||t[130]!==B||t[131]!==g||t[132]!==l||t[133]!==w||t[134]!==ce||t[135]!==T?($e=T===`array`&&(0,I.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(c,{className:`text-xs`,htmlFor:`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(r,{id:`6pe_G5`})}),(0,I.jsxs)(p,{value:ce?`enum`:B??``,onValueChange:e=>{if(e===`enum`){S(!0),B===void 0&&g.save(n,{itemsType:`string`},l);return}S(!1);let t=ce&&(A?.length??0)>0?{itemsType:e,itemsEnum:null}:{itemsType:e};g.save(n,t,l)},children:[(0,I.jsx)(d,{id:`frontmatter-field-items-type-${w}`,"data-testid":`frontmatter-field-items-type-${w}`,children:(0,I.jsx)(f,{placeholder:_({id:`EkUnmS`})})}),(0,I.jsx)(u,{children:R.map(ge)})]})]})}),t[127]=_,t[128]=n,t[129]=A?.length,t[130]=B,t[131]=g,t[132]=l,t[133]=w,t[134]=ce,t[135]=T,t[136]=$e):$e=t[136];let et;t[137]!==_||t[138]!==n||t[139]!==A||t[140]!==B||t[141]!==g||t[142]!==l||t[143]!==w||t[144]!==T?(et=T===`array`&&B!==`object`&&A!==null&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(c,{className:`text-xs`,htmlFor:`frontmatter-field-items-enum-${w}`,children:(0,I.jsx)(r,{id:`ezUmoU`})}),(0,I.jsx)(k,{id:`frontmatter-field-items-enum-${w}`,value:A,grammar:`free-text`,onChange:e=>g.save(n,{itemsEnum:e.length===0?null:e},l),placeholder:_({id:`5tcmwY`}),"aria-label":_({id:`e60wew`,values:{field:n}})})]}),t[137]=_,t[138]=n,t[139]=A,t[140]=B,t[141]=g,t[142]=l,t[143]=w,t[144]=T,t[145]=et):et=t[145];let tt;t[146]!==h||t[147]!==n||t[148]!==O||t[149]!==g||t[150]!==l||t[151]!==w||t[152]!==fe?(tt=fe&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-item-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`wU8WyK`})}),(0,I.jsx)(me,{node:O,parentPath:[...l,n,{items:!0}],depth:h+1,addInputId:`frontmatter-add-field-${w}.[]`,ops:g})]}),t[146]=h,t[147]=n,t[148]=O,t[149]=g,t[150]=l,t[151]=w,t[152]=fe,t[153]=tt):tt=t[153];let $;t[154]!==h||t[155]!==n||t[156]!==g||t[157]!==l||t[158]!==w||t[159]!==a||t[160]!==z?($=z&&(0,I.jsxs)(`div`,{className:`ml-2 space-y-1 border-l pl-3 pt-1`,"data-testid":`frontmatter-field-children-${w}`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,I.jsx)(r,{id:`9nIrRp`})}),(0,I.jsx)(me,{node:a,parentPath:[...l,n],depth:h+1,addInputId:`frontmatter-add-field-${w}`,ops:g})]}),t[154]=h,t[155]=n,t[156]=g,t[157]=l,t[158]=w,t[159]=a,t[160]=z,t[161]=$):$=t[161];let nt;return t[162]!==Ae||t[163]!==je||t[164]!==Ze||t[165]!==Qe||t[166]!==$e||t[167]!==et||t[168]!==tt||t[169]!==$||t[170]!==pe?(nt=(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":pe,children:[Ae,je,Ze,Qe,$e,et,tt,$]}),t[162]=Ae,t[163]=je,t[164]=Ze,t[165]=Qe,t[166]=$e,t[167]=et,t[168]=tt,t[169]=$,t[170]=pe,t[171]=nt):nt=t[171],nt}function ge(e){return(0,I.jsx)(l,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function _e(e){return(0,I.jsx)(l,{value:e,children:(0,I.jsx)(ae,{option:e})},e)}function U(e){let t=(0,P.c)(24),{inputId:n,onAdd:i}=e,[a,o]=(0,F.useState)(``),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(r,{id:`Va3xJe`}),t[0]=l):l=t[0];let u;t[1]===n?u=t[2]:(u=(0,I.jsx)(c,{htmlFor:n,className:`text-xs`,children:l}),t[1]=n,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[3]=d):d=t[3];let f=`${n}-input`,p;t[4]!==n||t[5]!==a||t[6]!==f?(p=(0,I.jsx)(x,{id:n,value:a,onChange:d,placeholder:`owner`,"data-testid":f}),t[4]=n,t[5]=a,t[6]=f,t[7]=p):p=t[7];let m;t[8]!==u||t[9]!==p?(m=(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[u,p]}),t[8]=u,t[9]=p,t[10]=m):m=t[10];let h;t[11]===a?h=t[12]:(h=a.trim(),t[11]=a,t[12]=h);let g=h===``,_;t[13]!==a||t[14]!==i?(_=()=>{i(a.trim()),o(``)},t[13]=a,t[14]=i,t[15]=_):_=t[15];let v=`${n}-save`,y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,I.jsx)(r,{id:`m16xKo`}),t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==g||t[19]!==_?(b=(0,I.jsx)(s,{size:`sm`,variant:`outline`,disabled:g,onClick:_,"data-testid":v,children:y}),t[17]=v,t[18]=g,t[19]=_,t[20]=b):b=t[20];let S;return t[21]!==b||t[22]!==m?(S=(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[m,b]}),t[21]=b,t[22]=m,t[23]=S):S=t[23],S}function ve(e){let t=(0,P.c)(15),{id:n,initial:r,onCommit:i,placeholder:a,ariaLabel:o,className:s}=e,[c,l]=(0,F.useState)(r),u;t[0]!==c||t[1]!==r||t[2]!==i?(u=()=>{c.trim()!==r&&i(c.trim())},t[0]=c,t[1]=r,t[2]=i,t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>l(e.target.value),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=e=>{e.key===`Enter`&&d()},t[5]=d,t[6]=p);let m;return t[7]!==o||t[8]!==s||t[9]!==d||t[10]!==c||t[11]!==n||t[12]!==a||t[13]!==p?(m=(0,I.jsx)(x,{id:n,value:c,onChange:f,onBlur:d,onKeyDown:p,placeholder:a,"aria-label":o,className:s,"data-testid":n}),t[7]=o,t[8]=s,t[9]=d,t[10]=c,t[11]=n,t[12]=a,t[13]=p,t[14]=m):m=t[14],m}function W(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function G(e){let t=(0,P.c)(45),{assetPath:n}=e,{_:r}=i(),[a,o]=te(),[s,c]=(0,F.useState)(null),l=s??a,u;t[0]===o?u=t[1]:(u=e=>{c(e),o(e)},t[0]=o,t[1]=u);let d=u,f,p;t[2]===n?(f=t[3],p=t[4]):(f=()=>{let e=e=>{e===n&&re(e)&&c(`rules`)};return e(n),ne(e)},p=[n],t[2]=n,t[3]=f,t[4]=p),(0,F.useEffect)(f,p);let{data:m}=S(),h;t[5]===m?.effective.plugins.frontmatter.schemas?h=t[6]:(h=m?.effective.plugins.frontmatter.schemas??[],t[5]=m?.effective.plugins.frontmatter.schemas,t[6]=h);let g;if(t[7]!==n||t[8]!==h){let e;t[10]===n?e=t[11]:(e=e=>e.file===n,t[10]=n,t[11]=e),g=h.some(e),t[7]=n,t[8]=h,t[9]=g}else g=t[9];let _=g,v=!_||l===`source`,y;t[12]===n?y=t[13]:(y=n.split(`/`).pop()??n,t[12]=n,t[13]=y);let b=y,x;t[14]===b?x=t[15]:(x=b.includes(`.`)?(b.split(`.`).pop()??``).toLowerCase():``,t[14]=b,t[15]=x);let C=x,w;t[16]===n?w=t[17]:(w=(0,I.jsx)(ee,{entry:{kind:`asset`,path:n},className:`shrink-0 border-b bg-background px-3 py-1.5`}),t[16]=n,t[17]=w);let T;t[18]===d?T=t[19]:(T=e=>d(e===`source`?`source`:`rules`),t[18]=d,t[19]=T);let E=!_,k;t[20]===r?k=t[21]:(k=r({id:`vF68cg`}),t[20]=r,t[21]=k);let j;t[22]===r?j=t[23]:(j=r({id:`wdxz7K`}),t[22]=r,t[23]=j);let M;t[24]===r?M=t[25]:(M=r({id:`nc-ipN`}),t[24]=r,t[25]=M);let N;t[26]!==v||t[27]!==E||t[28]!==k||t[29]!==j||t[30]!==M||t[31]!==T?(N=(0,I.jsx)(O,{isSourceMode:v,onModeChange:T,wysiwygDisabled:E,wysiwygLabel:k,sourceLabel:j,wysiwygDisabledReason:M}),t[26]=v,t[27]=E,t[28]=k,t[29]=j,t[30]=M,t[31]=T,t[32]=N):N=t[32];let ie;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,I.jsx)(A,{className:`absolute left-3 top-1/2 -translate-y-1/2`}),t[33]=ie):ie=t[33];let L;t[34]===N?L=t[35]:(L=(0,I.jsxs)(`div`,{className:`relative flex shrink-0 items-center justify-center border-b bg-background py-2`,children:[N,ie]}),t[34]=N,t[35]=L);let R;t[36]!==n||t[37]!==C||t[38]!==b||t[39]!==v?(R=v?(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,I.jsx)(D,{src:W(n),assetPath:n,fileName:b,extension:C},n)}):(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:(0,I.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,I.jsx)(fe,{file:n})})}),t[36]=n,t[37]=C,t[38]=b,t[39]=v,t[40]=R):R=t[40];let z;return t[41]!==L||t[42]!==R||t[43]!==w?(z=(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"data-schema-config-editor":``,children:[w,L,R]}),t[41]=L,t[42]=R,t[43]=w,t[44]=z):z=t[44],z}export{G as SchemaConfigEditor};