@inkeep/open-knowledge 0.38.0 → 0.38.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/{acp-harness-probe-DVr67aDl.mjs → acp-harness-probe-NL4hpo9c.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/assets/skills/write-skill/SKILL.md +1 -1
  5. package/dist/cli.mjs +7 -7
  6. package/dist/constants-D-kTLVuD.mjs +2 -0
  7. package/dist/git-handle-DluCIpMR.mjs +1 -0
  8. package/dist/{git-handle-Kmafc544.mjs → git-handle-DnLoe9hy.mjs} +2 -2
  9. package/dist/index.d.mts +17 -17
  10. package/dist/index.mjs +1 -1
  11. package/dist/{init-CPMjxAVJ.mjs → init-BG47-P0C.mjs} +3 -3
  12. package/dist/init-DI5KSZSh.mjs +1 -0
  13. package/dist/{launch-json-removal--7ytoIfk.mjs → launch-json-removal-BqbIfT8X.mjs} +2 -2
  14. package/dist/{loader-CF5zifwE.mjs → loader-Cg0POwYf.mjs} +2 -2
  15. package/dist/loader-DiPPj4Ze.mjs +1 -0
  16. package/dist/md-manager-DtA0LK6p.mjs +2 -0
  17. package/dist/{open-browser-DwZulh9C.mjs → open-browser-Bbzq7Z7d.mjs} +2 -2
  18. package/dist/parse-worker.mjs +1 -1
  19. package/dist/{preview-CEz-vYuH.mjs → preview-BfEWnuNa.mjs} +2 -2
  20. package/dist/preview-CDtd73ru.mjs +1 -0
  21. package/dist/public/assets/{ActivityModeContent-U6pBXIBQ.js → ActivityModeContent-CQTRie_S.js} +1 -1
  22. package/dist/public/assets/{AgentDiffPane-DNb7BQuZ.js → AgentDiffPane-ZsuLVO9W.js} +1 -1
  23. package/dist/public/assets/{AgentThreadClientBinder-BwmyMJCE.js → AgentThreadClientBinder-poPjsQXP.js} +1 -1
  24. package/dist/public/assets/{CodeMirrorPropInput-CIGTqTT1.js → CodeMirrorPropInput-DUwQlljh.js} +1 -1
  25. package/dist/public/assets/{DocumentContext-BjkX60te.js → DocumentContext-CPZffvoA.js} +1 -1
  26. package/dist/public/assets/{EnableSyncConfirmDialog-211MVqW1.js → EnableSyncConfirmDialog-BfZ_iVD2.js} +1 -1
  27. package/dist/public/assets/{FeedbackForm-CVHlnDrU.js → FeedbackForm-BUn96JmL.js} +1 -1
  28. package/dist/public/assets/{GraphPanel-Cdu7mW48.js → GraphPanel-BjCltqW1.js} +1 -1
  29. package/dist/public/assets/{ManagedArtifactProperties-DewIpjBm.js → ManagedArtifactProperties-CHmkRShb.js} +1 -1
  30. package/dist/public/assets/{McpConsentDialogBody-Ds1pkJ9h.js → McpConsentDialogBody-B0VkhB1e.js} +1 -1
  31. package/dist/public/assets/{MermaidDocEditor-RY-6y6bj.js → MermaidDocEditor-cedDjA-A.js} +1 -1
  32. package/dist/public/assets/{PropertyPanel-DQ9GHyDu.js → PropertyPanel-CpcpWkfS.js} +1 -1
  33. package/dist/public/assets/{ReportBugDialogBody-SgvzkcQL.js → ReportBugDialogBody-hPmCfQyc.js} +1 -1
  34. package/dist/public/assets/{SettingsDialogBody-CNW4J8BO.js → SettingsDialogBody-B6_psJil.js} +1 -1
  35. package/dist/public/assets/{ShareBranchSwitchDialog-CNMlHlvg.js → ShareBranchSwitchDialog-GXTPAgND.js} +1 -1
  36. package/dist/public/assets/{ShareReceiveDialog-m9Ncf1Rl.js → ShareReceiveDialog-IVAS4xf8.js} +1 -1
  37. package/dist/public/assets/{ShareReceiveMissDialog-Dt5rngAU.js → ShareReceiveMissDialog-ClkBICGx.js} +1 -1
  38. package/dist/public/assets/{SkillEditorActions-7t_8lXO9.js → SkillEditorActions-BEtnBlep.js} +1 -1
  39. package/dist/public/assets/{SourceEditor-CZsCwI8R.js → SourceEditor-Bp45kdTW.js} +1 -1
  40. package/dist/public/assets/{TerminalPanel-CMCcE_sg.js → TerminalPanel-CUoZt7C0.js} +1 -1
  41. package/dist/public/assets/{TerminalSessionsHost-D-He0AKd.js → TerminalSessionsHost-CNebjNFj.js} +2 -2
  42. package/dist/public/assets/{TerminalWindowApp--K-HXyFC.js → TerminalWindowApp-B6bT25Jw.js} +1 -1
  43. package/dist/public/assets/{ThreadView-DXQ4PyDl.js → ThreadView-CmIHLGuV.js} +1 -1
  44. package/dist/public/assets/{TimelineDiffPane-DnTda2pq.js → TimelineDiffPane-DffKOwf1.js} +1 -1
  45. package/dist/public/assets/{agent-diff-store-D_W1QQps.js → agent-diff-store-D6N0WX_4.js} +1 -1
  46. package/dist/public/assets/{agent-visibility-BwHf-SiF.js → agent-visibility-Z2AQQ5Ce.js} +1 -1
  47. package/dist/public/assets/{auth-state-cache-BXAoUmHN.js → auth-state-cache-CfU3gJ3i.js} +1 -1
  48. package/dist/public/assets/client-version-BBhtdyiC.js +1 -0
  49. package/dist/public/assets/{config-provider-YhhBOmCK.js → config-provider-DstRVgzH.js} +1 -1
  50. package/dist/public/assets/{dist-CWKw6fA9.js → dist-DKsN2Ojq.js} +1 -1
  51. package/dist/public/assets/{dist-C6nSogV9.js → dist-Vm1kQiqo.js} +1 -1
  52. package/dist/public/assets/{doc-hash-eIVtLs9w.js → doc-hash-B8kD24Kw.js} +1 -1
  53. package/dist/public/assets/{documents-events-DeUc9zJv.js → documents-events-DQ6Iario.js} +1 -1
  54. package/dist/public/assets/{file-tree-adapter-vjTAoe5H.js → file-tree-adapter-eftmn56d.js} +1 -1
  55. package/dist/public/assets/{index-POPidK7Y.css → index-NzW9g3x_.css} +1 -1
  56. package/dist/public/assets/index-XkYGz2OG.js +1995 -0
  57. package/dist/public/assets/{keyboard-shortcuts-CUmPZNQy.js → keyboard-shortcuts-DZ9kTSZ4.js} +1 -1
  58. package/dist/public/assets/{lint-config-client-nikplC1R.js → lint-config-client-Bg-6mquJ.js} +1 -1
  59. package/dist/public/assets/{navigation-targets-DxoCd6kX.js → navigation-targets-4J3F85tT.js} +1 -1
  60. package/dist/public/assets/{open-managed-artifact-tab-ZPlXuFu4.js → open-managed-artifact-tab-ze9HkqWn.js} +1 -1
  61. package/dist/public/assets/{pending-receive-nav-store-CEPAOvDY.js → pending-receive-nav-store-CVDTioM4.js} +1 -1
  62. package/dist/public/assets/{prop-types-DUCnPFii.js → prop-types-B0l6ZN6O.js} +1 -1
  63. package/dist/public/assets/{receive-store-y2q0bQn6.js → receive-store-jfaprLyZ.js} +1 -1
  64. package/dist/public/assets/{selection-context-Db3fWWF7.js → selection-context-BpEA0WhV.js} +1 -1
  65. package/dist/public/assets/{skill-actions-BtUexWRp.js → skill-actions-s_ATobEI.js} +1 -1
  66. package/dist/public/assets/{skills-api-Bww6-eOu.js → skills-api-CYoD9FQt.js} +1 -1
  67. package/dist/public/assets/{src-CpymDWKp.js → src-B-pNk3y3.js} +1 -1
  68. package/dist/public/assets/{target-navigation-intent-C1iQZwv4.js → target-navigation-intent-95GTKrco.js} +1 -1
  69. package/dist/public/assets/{telemetry-impl-CcmuhtrG.js → telemetry-impl-BgQUPJ0t.js} +1 -1
  70. package/dist/public/assets/{telemetry-startup-CARo6YEP.js → telemetry-startup-DcvNN2rn.js} +1 -1
  71. package/dist/public/assets/{terminal-launch-events-CTfLdB6Z.js → terminal-launch-events-D0NkBM4g.js} +1 -1
  72. package/dist/public/assets/{terminal-telemetry-CbpvB1jF.js → terminal-telemetry-DxZXlrf4.js} +1 -1
  73. package/dist/public/assets/{typing-burst-detector-CwFvl_zZ.js → typing-burst-detector-CI_4wux0.js} +1 -1
  74. package/dist/public/assets/{use-activity-panel-C8eRf28P.js → use-activity-panel-DoU5dDI7.js} +1 -1
  75. package/dist/public/assets/{use-apply-config-color-theme-Cn_1YtLn.js → use-apply-config-color-theme-DBdIMwiU.js} +1 -1
  76. package/dist/public/assets/{use-collab-url-JouvqC5o.js → use-collab-url-CwAStsIj.js} +1 -1
  77. package/dist/public/assets/{use-live-xterm-theme-BnrEyx1M.js → use-live-xterm-theme-oqXGh0AM.js} +1 -1
  78. package/dist/public/assets/{use-terminal-enabled-BOL2sXHs.js → use-terminal-enabled-B1QnDzPO.js} +1 -1
  79. package/dist/public/assets/{use-timeline-entry-diff-CpGmM4IW.js → use-timeline-entry-diff-C_hkFzJg.js} +1 -1
  80. package/dist/public/assets/{use-workspace-BZeW5fgR.js → use-workspace-DyAcZSjY.js} +1 -1
  81. package/dist/public/assets/{workspace-paths-CS1BfvNO.js → workspace-paths-B_ozK4P-.js} +1 -1
  82. package/dist/public/assets/{zod-D4GZNMdC.js → zod-CCGVCn6n.js} +1 -1
  83. package/dist/public/index.html +36 -36
  84. package/dist/{repair-launch-json-BqMX91yY.mjs → repair-launch-json-BwW3yDaL.mjs} +2 -2
  85. package/dist/{repair-mcp-configs-Pzh4BjH1.mjs → repair-mcp-configs-DwI0lE_4.mjs} +2 -2
  86. package/dist/{repair-skills-Q9Gr8Nvl.mjs → repair-skills-DaVaOiQC.mjs} +2 -2
  87. package/dist/repair-skills-vw_jVt0o.mjs +1 -0
  88. package/dist/server-lock-DZZ64TDY.mjs +1 -0
  89. package/dist/{server-lock-C2OcZirx.mjs → server-lock-DzWMWbLN.mjs} +2 -2
  90. package/dist/{src-ncRTs63f.mjs → src-AWKG2Y_X.mjs} +2 -2
  91. package/dist/{src-DTPLCYnP.mjs → src-Cwu3lS3D.mjs} +2 -2
  92. package/dist/{src-BEaiZuXz.mjs → src-DxAg43k_.mjs} +6 -6
  93. package/dist/{src-C4MRpQ6i.mjs → src-eVRfK1KK.mjs} +1 -1
  94. package/dist/start-DALmk3r3.mjs +1 -0
  95. package/dist/{start-DyvuJUR_.mjs → start-DL49LWv5.mjs} +2 -2
  96. package/dist/{write-project-skill-CMePkU0W.mjs → write-project-skill-DtERurRT.mjs} +2 -2
  97. package/package.json +4 -4
  98. package/dist/constants-DpFOPcaR.mjs +0 -2
  99. package/dist/git-handle-DY72DIzL.mjs +0 -1
  100. package/dist/init-C5AeIGix.mjs +0 -1
  101. package/dist/loader-B21K_fve.mjs +0 -1
  102. package/dist/md-manager-Burt5wQf.mjs +0 -2
  103. package/dist/preview-DkTBLSdT.mjs +0 -1
  104. package/dist/public/assets/client-version-BcS_alrQ.js +0 -1
  105. package/dist/public/assets/index-B8c-hqIt.js +0 -1995
  106. package/dist/repair-skills-pY9FxlXw.mjs +0 -1
  107. package/dist/server-lock-DTx_Ih9P.mjs +0 -1
  108. package/dist/start-DA5Owg6k.mjs +0 -1
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{t as o}from"./createLucideIcon-BUb14crZ.js";import{t as s}from"./button-DHE6Sx02.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dialog-BLaUGJCd.js";import{Sa as g}from"./dist-C6nSogV9.js";import{t as _}from"./eye-CmnH89UE.js";import{n as v}from"./dist-DwCd6eR-.js";import{o as y}from"./documents-events-DeUc9zJv.js";import"./config-provider-YhhBOmCK.js";import{n as b}from"./config-context-C5AosGyi.js";var x=o(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),S=o(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),C=a(),w=e(n(),1);async function T(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function E(){return D().status}function D(){let e=(0,C.c)(8),[t,n]=(0,w.useState)(null),[r,i]=(0,w.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){T().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,w.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>y(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,w.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var O=t();function k(){let e=(0,C.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,O.jsx)(l,{children:(0,O.jsx)(r,{id:`q_9EcE`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,O.jsxs)(O.Fragment,{children:[t,(0,O.jsx)(c,{children:(0,O.jsx)(r,{id:`n6hXUm`})})]}),e[1]=n):n=e[1],n}function A(){let e=(0,C.c)(10),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,O.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-semibold font-mono uppercase tracking-wider text-primary`,children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,O.jsx)(r,{id:`6s7LXO`})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,O.jsx)(x,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[1]=n):n=e[1];let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,O.jsx)(`p`,{className:`font-medium`,children:(0,O.jsx)(r,{id:`cdmk8A`})}),e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,O.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,(0,O.jsxs)(`div`,{className:`space-y-0.5`,children:[i,(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:(0,O.jsx)(r,{id:`YaeyFh`})})]})]}),e[3]=a):a=e[3];let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,O.jsx)(S,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[4]=o):o=e[4];let s;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,O.jsx)(`p`,{className:`font-medium`,children:(0,O.jsx)(r,{id:`9i21pa`})}),e[5]=s):s=e[5];let c;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,O.jsxs)(`div`,{className:`flex items-start gap-3`,children:[o,(0,O.jsxs)(`div`,{className:`space-y-0.5`,children:[s,(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:(0,O.jsx)(r,{id:`KIIamL`})})]})]}),e[6]=c):c=e[6];let l;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,O.jsx)(_,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[7]=l):l=e[7];let u;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,O.jsx)(`p`,{className:`font-medium`,children:(0,O.jsx)(r,{id:`8cpeU3`})}),e[8]=u):u=e[8];let d;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,O.jsxs)(`div`,{role:`note`,className:`text-sm space-y-5`,children:[t,(0,O.jsxs)(`div`,{className:`space-y-5`,children:[a,c,(0,O.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l,(0,O.jsxs)(`div`,{className:`space-y-0.5`,children:[u,(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:(0,O.jsx)(r,{id:`DELNQk`})})]})]})]})]}),e[9]=d):d=e[9],d}function j(){let e=(0,C.c)(2),{projectLocalBinding:t}=b();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{enabled:e}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function M(){let e=(0,C.c)(2),{projectBinding:t}=b();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function N(e,t){let n=(0,C.c)(12),{_:r}=i(),[a,o]=(0,w.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return v.error(r({id:`fiMNLl`})),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return v.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}async function P(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}function F(e){let t=(0,C.c)(10),{open:n,onOpenChange:i,onConfirm:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,O.jsx)(m,{children:(0,O.jsx)(k,{})}),t[0]=o):o=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,O.jsx)(d,{children:(0,O.jsx)(A,{})}),t[1]=c):c=t[1];let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,O.jsx)(p,{asChild:!0,children:(0,O.jsx)(s,{variant:`outline`,children:(0,O.jsx)(r,{id:`dEgA5A`})})}),t[2]=l):l=t[2];let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,O.jsx)(r,{id:`XU0OXn`}),t[3]=g):g=t[3];let _;t[4]===a?_=t[5]:(_=(0,O.jsxs)(u,{className:`sm:max-w-lg`,children:[o,c,(0,O.jsxs)(f,{children:[l,(0,O.jsx)(s,{onClick:a,children:g})]})]}),t[4]=a,t[5]=_);let v;return t[6]!==i||t[7]!==n||t[8]!==_?(v=(0,O.jsx)(h,{open:n,onOpenChange:i,children:_}),t[6]=i,t[7]=n,t[8]=_,t[9]=v):v=t[9],v}export{j as a,E as c,M as i,D as l,P as n,k as o,N as r,A as s,F as t};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{t as o}from"./createLucideIcon-BUb14crZ.js";import{t as s}from"./button-DHE6Sx02.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dialog-BLaUGJCd.js";import{Sa as g}from"./dist-Vm1kQiqo.js";import{t as _}from"./eye-CmnH89UE.js";import{n as v}from"./dist-DwCd6eR-.js";import{o as y}from"./documents-events-DQ6Iario.js";import"./config-provider-DstRVgzH.js";import{n as b}from"./config-context-C5AosGyi.js";var x=o(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),S=o(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),C=a(),w=e(n(),1);async function T(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function E(){return D().status}function D(){let e=(0,C.c)(8),[t,n]=(0,w.useState)(null),[r,i]=(0,w.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){T().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,w.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>y(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,w.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var O=t();function k(){let e=(0,C.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,O.jsx)(l,{children:(0,O.jsx)(r,{id:`q_9EcE`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,O.jsxs)(O.Fragment,{children:[t,(0,O.jsx)(c,{children:(0,O.jsx)(r,{id:`n6hXUm`})})]}),e[1]=n):n=e[1],n}function A(){let e=(0,C.c)(10),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,O.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-semibold font-mono uppercase tracking-wider text-primary`,children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,O.jsx)(r,{id:`6s7LXO`})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,O.jsx)(x,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[1]=n):n=e[1];let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,O.jsx)(`p`,{className:`font-medium`,children:(0,O.jsx)(r,{id:`cdmk8A`})}),e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,O.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,(0,O.jsxs)(`div`,{className:`space-y-0.5`,children:[i,(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:(0,O.jsx)(r,{id:`YaeyFh`})})]})]}),e[3]=a):a=e[3];let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,O.jsx)(S,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[4]=o):o=e[4];let s;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,O.jsx)(`p`,{className:`font-medium`,children:(0,O.jsx)(r,{id:`9i21pa`})}),e[5]=s):s=e[5];let c;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,O.jsxs)(`div`,{className:`flex items-start gap-3`,children:[o,(0,O.jsxs)(`div`,{className:`space-y-0.5`,children:[s,(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:(0,O.jsx)(r,{id:`KIIamL`})})]})]}),e[6]=c):c=e[6];let l;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,O.jsx)(_,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[7]=l):l=e[7];let u;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,O.jsx)(`p`,{className:`font-medium`,children:(0,O.jsx)(r,{id:`8cpeU3`})}),e[8]=u):u=e[8];let d;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,O.jsxs)(`div`,{role:`note`,className:`text-sm space-y-5`,children:[t,(0,O.jsxs)(`div`,{className:`space-y-5`,children:[a,c,(0,O.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l,(0,O.jsxs)(`div`,{className:`space-y-0.5`,children:[u,(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:(0,O.jsx)(r,{id:`DELNQk`})})]})]})]})]}),e[9]=d):d=e[9],d}function j(){let e=(0,C.c)(2),{projectLocalBinding:t}=b();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{enabled:e}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function M(){let e=(0,C.c)(2),{projectBinding:t}=b();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:g(n.error)}},e[0]=t,e[1]=n),n}function N(e,t){let n=(0,C.c)(12),{_:r}=i(),[a,o]=(0,w.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return v.error(r({id:`fiMNLl`})),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return v.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}async function P(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}function F(e){let t=(0,C.c)(10),{open:n,onOpenChange:i,onConfirm:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,O.jsx)(m,{children:(0,O.jsx)(k,{})}),t[0]=o):o=t[0];let c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,O.jsx)(d,{children:(0,O.jsx)(A,{})}),t[1]=c):c=t[1];let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,O.jsx)(p,{asChild:!0,children:(0,O.jsx)(s,{variant:`outline`,children:(0,O.jsx)(r,{id:`dEgA5A`})})}),t[2]=l):l=t[2];let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,O.jsx)(r,{id:`XU0OXn`}),t[3]=g):g=t[3];let _;t[4]===a?_=t[5]:(_=(0,O.jsxs)(u,{className:`sm:max-w-lg`,children:[o,c,(0,O.jsxs)(f,{children:[l,(0,O.jsx)(s,{onClick:a,children:g})]})]}),t[4]=a,t[5]=_);let v;return t[6]!==i||t[7]!==n||t[8]!==_?(v=(0,O.jsx)(h,{open:n,onOpenChange:i,children:_}),t[6]=i,t[7]=n,t[8]=_,t[9]=v):v=t[9],v}export{j as a,E as c,M as i,D as l,P as n,k as o,N as r,A as s,F as t};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{s as o,t as s}from"./createLucideIcon-BUb14crZ.js";import{r as c,t as l}from"./button-DHE6Sx02.js";import{i as u,n as d,t as f}from"./tooltip-BCGL5jDF.js";import{t as ee}from"./checkbox-Cn88M3G6.js";import{n as te,t as ne}from"./toggle-group-CxrQL99E.js";import{Aa as re,Fa as ie,Ia as ae,Ma as oe,Na as p,ja as se,ka as ce}from"./dist-C6nSogV9.js";import{t as le}from"./paperclip-DF10JkTg.js";import{t as ue}from"./x-6ATUQvcC.js";import{n as m}from"./dist-DwCd6eR-.js";import{t as de}from"./input-CsXmpyZP.js";import{t as h}from"./client-version-BcS_alrQ.js";import{t as fe}from"./textarea-DwJR-19i.js";import{l as pe,o as me}from"./index.esm-DRU91WyY.js";import{t as he}from"./zod-D4GZNMdC.js";import{a as g,i as _,n as v,o as ge,s as _e,t as ve}from"./form-J8CRFj8p.js";var ye=s(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),be=s(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),xe=e(n(),1),y=a(),b=new URL(`/api/feedback`,{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.35.6`}?.VITE_OK_FEEDBACK_INTAKE_ORIGIN||`https://openknowledge.ai`).href;function x(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=typeof r.result==`string`?r.result:``,n=e.indexOf(`,`);t(n===-1?``:e.slice(n+1))},r.onerror=()=>n(r.error??Error(`file read failed`)),r.readAsDataURL(e)})}async function Se(e){return{contentType:e.type,base64:await x(e)}}function S(){return typeof window<`u`&&window.okDesktop?.platform||`web`}async function Ce(e){try{let t=await fetch(b,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e,appVersion:h,platform:S()}),signal:AbortSignal.timeout(3e4)});if(t.ok){let e=await t.json().catch(e=>(console.warn(`[feedback] action=submit result=ok-parse-error message=${e instanceof Error?e.message:String(e)}`),null));return{ok:!0,reference:e&&typeof e.reference==`string`?e.reference:``}}return t.status===400||t.status===413?{ok:!1,reason:`invalid`}:t.status===503?{ok:!1,reason:`unavailable`}:(console.warn(`[feedback] action=submit result=http-error status=${t.status}`),{ok:!1,reason:`error`})}catch(e){return console.warn(`[feedback] action=submit result=network-error message=${e instanceof Error?e.message:String(e)}`),{ok:!1,reason:`error`}}}var C=t(),w=c(`group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed`,{variants:{size:{default:`gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2`,sm:`gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5`,xs:`gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1`},orientation:{horizontal:`min-w-40 items-center`,vertical:`w-24 flex-col has-data-[slot=attachment-content]:w-30`}}});function we(e){let t=(0,y.c)(16),n,r,i,a,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5]):({className:n,state:i,size:a,orientation:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s);let c=i===void 0?`done`:i,l=a===void 0?`default`:a,u=s===void 0?`horizontal`:s,d;t[6]!==n||t[7]!==u||t[8]!==l?(d=o(w({size:l,orientation:u}),n),t[6]=n,t[7]=u,t[8]=l,t[9]=d):d=t[9];let f;return t[10]!==u||t[11]!==r||t[12]!==l||t[13]!==c||t[14]!==d?(f=(0,C.jsx)(`div`,{"data-slot":`attachment`,"data-state":c,"data-size":l,"data-orientation":u,className:d,...r}),t[10]=u,t[11]=r,t[12]=l,t[13]=c,t[14]=d,t[15]=f):f=t[15],f}var T=c(`relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5`,{variants:{variant:{icon:``,image:`opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover`}},defaultVariants:{variant:`icon`}});function Te(e){let t=(0,y.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`icon`:i,s;t[4]!==n||t[5]!==a?(s=o(T({variant:a}),n),t[4]=n,t[5]=a,t[6]=s):s=t[6];let c;return t[7]!==r||t[8]!==s||t[9]!==a?(c=(0,C.jsx)(`div`,{"data-slot":`attachment-media`,"data-variant":a,className:s,...r}),t[7]=r,t[8]=s,t[9]=a,t[10]=c):c=t[10],c}function Ee(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`div`,{"data-slot":`attachment-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function De(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`span`,{"data-slot":`attachment-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Oe(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80`,`max-w-full`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`span`,{"data-slot":`attachment-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ke(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`div`,{"data-slot":`attachment-actions`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ae(e){let t=(0,y.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:a,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=i===void 0?`icon-xs`:i,c=a??`ghost`,u;t[5]===n?u=t[6]:(u=o(n),t[5]=n,t[6]=u);let d;return t[7]!==r||t[8]!==s||t[9]!==c||t[10]!==u?(d=(0,C.jsx)(l,{"data-slot":`attachment-action`,variant:c,size:s,className:u,...r}),t[7]=r,t[8]=s,t[9]=c,t[10]=u,t[11]=d):d=t[11],d}function je(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`div`,{"data-slot":`attachment-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Me=[{value:`too-slow`,label:{id:`YJPN3F`}},{value:`hard-to-use`,label:{id:`MDBJwN`}},{value:`missing-feature`,label:{id:`anmUZq`}},{value:`something-broke`,label:{id:`dXCi3J`}},{value:`formatting`,label:{id:`RcrskJ`}},{value:`other`,label:{id:`_IX_7x`}}],E=3,D=3*1024*1024,Ne=[`image/png`,`image/jpeg`,`image/webp`],Pe=`data-[state=on]:border-primary data-[state=on]:bg-primary/5 data-[state=on]:text-primary`,Fe=`rounded-full border border-input bg-transparent px-3 ${Pe}`;function Ie(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Le(e,t){let n=new Set(e.map(e=>`${e.name}:${e.size}`)),r=Array.from(t??[]).filter(e=>Ne.includes(e.type)&&!n.has(`${e.name}:${e.size}`));return[...e,...r].slice(0,E)}var Re=e=>{let t=(0,y.c)(5),{file:n}=e,[r,i]=(0,xe.useState)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=URL.createObjectURL(n);return i(e),()=>URL.revokeObjectURL(e)},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,xe.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=r?(0,C.jsx)(`img`,{src:r,alt:``,className:`size-full object-cover`}):null,t[3]=r,t[4]=s),s},O=e=>{let t=(0,y.c)(76),{onSuccess:n,source:a}=e,s=a===void 0?`resources_menu`:a,{_:c}=i(),ee=(0,xe.useRef)(null),p,h;if(t[0]!==c){let e=ie({rating:ce([`positive`,`negative`],{error:c({id:`H-hzll`})}),reasons:se(ae()),message:ae(),attachments:se(re(File)).max(E,c({id:`E9gh86`,values:{MAX_ATTACHMENTS:E}})).refine(ze,c({id:`s7us1p`})).refine(Be,c({id:`ItxGi3`})),shareEmail:oe(),email:ae()}).refine(Ve,{path:[`email`],message:c({id:`fwrPh4`})});h=me,p=he(e),t[0]=c,t[1]=p,t[2]=h}else p=t[1],h=t[2];let b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[3]=b):b=t[3];let x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x={rating:void 0,reasons:b,message:``,attachments:[],shareEmail:!1,email:``},t[4]=x):x=t[4];let S;t[5]===p?S=t[6]:(S={resolver:p,defaultValues:x},t[5]=p,t[6]=S);let w=h(S),T;t[7]===w.control?T=t[8]:(T={control:w.control,name:`rating`},t[7]=w.control,t[8]=T);let D=pe(T),O;t[9]===w.control?O=t[10]:(O={control:w.control,name:`shareEmail`},t[9]=w.control,t[10]=O);let k=pe(O),A;t[11]===w.control?A=t[12]:(A={control:w.control,name:`attachments`},t[11]=w.control,t[12]=A);let j=pe(A),M=j.length>=E,N=w.formState.errors.attachments,P;t[13]===w?P=t[14]:(P=e=>w.setValue(`attachments`,e,{shouldValidate:!0}),t[13]=w,t[14]=P);let F=P,I;t[15]!==c||t[16]!==w||t[17]!==n||t[18]!==s?(I=async e=>{try{let t=e.attachments.length?await Promise.all(e.attachments.map(Se)):void 0,r=await Ce({kind:`general`,rating:e.rating,reasons:e.reasons,message:e.message.trim()||void 0,email:e.shareEmail&&e.email?e.email:void 0,attachments:t,source:s});if(r.ok){m.success(c({id:`LvdLef`})),w.reset(),n?.();return}if(r.reason===`unavailable`){m.error(c({id:`D8JJwQ`}));return}m.error(c({id:`D2emTw`}))}catch(e){let t=e;console.warn(`[feedback] action=submit result=unexpected-error message=${t instanceof Error?t.message:String(t)}`),m.error(c({id:`D2emTw`}))}},t[15]=c,t[16]=w,t[17]=n,t[18]=s,t[19]=I):I=t[19];let Ue=I,L;t[20]!==w||t[21]!==Ue?(L=w.handleSubmit(Ue),t[20]=w,t[21]=Ue,t[22]=L):L=t[22];let R;t[23]===w?R=t[24]:(R=e=>{let{field:t}=e;return(0,C.jsxs)(g,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(ne,{type:`single`,variant:`outline`,spacing:2,value:t.value??``,onValueChange:e=>{e&&(t.onChange(e),e===`positive`&&w.setValue(`reasons`,[]))},className:`w-full`,children:[(0,C.jsxs)(te,{value:`positive`,className:`h-auto flex-1 justify-center gap-2 py-2 ${Pe}`,children:[(0,C.jsx)(be,{className:`size-4`}),(0,C.jsx)(r,{id:`OEEQKT`})]}),(0,C.jsxs)(te,{value:`negative`,className:`h-auto flex-1 justify-center gap-2 py-2 ${Pe}`,children:[(0,C.jsx)(ye,{className:`size-4`}),(0,C.jsx)(r,{id:`U0QBh4`})]})]})}),(0,C.jsx)(_e,{})]})},t[23]=w,t[24]=R);let z;t[25]!==w.control||t[26]!==R?(z=(0,C.jsx)(_,{control:w.control,name:`rating`,render:R}),t[25]=w.control,t[26]=R,t[27]=z):z=t[27];let B;t[28]!==c||t[29]!==w.control||t[30]!==D?(B=D===`negative`&&(0,C.jsx)(_,{control:w.control,name:`reasons`,render:e=>{let{field:t}=e;return(0,C.jsxs)(g,{children:[(0,C.jsx)(ge,{children:(0,C.jsx)(r,{id:`Fqx38P`})}),(0,C.jsx)(v,{children:(0,C.jsx)(ne,{type:`multiple`,variant:`outline`,spacing:2,value:t.value,onValueChange:t.onChange,className:`w-full flex-wrap justify-start`,children:Me.map(e=>(0,C.jsx)(te,{value:e.value,className:Fe,children:c(e.label)},e.value))})})]})}}),t[28]=c,t[29]=w.control,t[30]=D,t[31]=B):B=t[31];let V;t[32]!==c||t[33]!==M||t[34]!==j||t[35]!==F?(V=e=>{let{field:t}=e;return(0,C.jsx)(g,{children:(0,C.jsx)(v,{children:(0,C.jsxs)(`div`,{className:`relative`,children:[(0,C.jsx)(fe,{...t,placeholder:c({id:`QlAG4m`}),className:`min-h-20 resize-none pb-9`}),(0,C.jsxs)(f,{children:[(0,C.jsx)(u,{asChild:!0,children:(0,C.jsx)(`span`,{className:o(`absolute bottom-1.5 left-1.5 inline-flex`,M&&`cursor-not-allowed`),children:(0,C.jsxs)(l,{type:`button`,variant:`ghost`,size:`icon`,disabled:M,onClick:()=>ee.current?.click(),className:`size-7 text-muted-foreground`,children:[(0,C.jsx)(le,{className:`size-4`}),(0,C.jsx)(`span`,{className:`sr-only`,children:(0,C.jsx)(r,{id:`3LbBJn`})})]})})}),(0,C.jsx)(d,{children:M?(0,C.jsx)(r,{id:`ASqqsQ`,values:{MAX_ATTACHMENTS:E}}):(0,C.jsx)(r,{id:`3LbBJn`})})]}),(0,C.jsx)(de,{ref:ee,type:`file`,accept:Ne.join(`,`),multiple:!0,className:`hidden`,onChange:e=>{F(Le(j,e.target.files)),e.target.value=``}})]})})})},t[32]=c,t[33]=M,t[34]=j,t[35]=F,t[36]=V):V=t[36];let H;t[37]!==w.control||t[38]!==V?(H=(0,C.jsx)(_,{control:w.control,name:`message`,render:V}),t[37]=w.control,t[38]=V,t[39]=H):H=t[39];let U;t[40]!==c||t[41]!==j||t[42]!==F?(U=j.length>0&&(0,C.jsx)(je,{children:j.map((e,t)=>(0,C.jsxs)(we,{size:`xs`,children:[(0,C.jsx)(Te,{variant:`image`,children:(0,C.jsx)(Re,{file:e})}),(0,C.jsxs)(Ee,{children:[(0,C.jsx)(De,{children:e.name}),(0,C.jsx)(Oe,{children:Ie(e.size)})]}),(0,C.jsx)(ke,{children:(0,C.jsx)(Ae,{type:`button`,"aria-label":c({id:`w61W3L`,values:{0:e.name}}),onClick:()=>F(j.filter((e,n)=>n!==t)),children:(0,C.jsx)(ue,{className:`size-3.5`})})})]},`${e.name}:${e.size}`))}),t[40]=c,t[41]=j,t[42]=F,t[43]=U):U=t[43];let W;t[44]===N?W=t[45]:(W=N?.message&&(0,C.jsx)(`p`,{className:`text-destructive text-sm`,children:N.message}),t[44]=N,t[45]=W);let G;t[46]!==H||t[47]!==U||t[48]!==W?(G=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[H,U,W]}),t[46]=H,t[47]=U,t[48]=W,t[49]=G):G=t[49];let K;t[50]!==B||t[51]!==G?(K=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[B,G]}),t[50]=B,t[51]=G,t[52]=K):K=t[52];let q;t[53]===w.control?q=t[54]:(q=(0,C.jsx)(_,{control:w.control,name:`shareEmail`,render:He}),t[53]=w.control,t[54]=q);let J;t[55]!==c||t[56]!==w.control||t[57]!==k?(J=k&&(0,C.jsx)(_,{control:w.control,name:`email`,render:e=>{let{field:t}=e;return(0,C.jsxs)(g,{children:[(0,C.jsx)(v,{children:(0,C.jsx)(de,{...t,type:`email`,placeholder:c({id:`JHf6qZ`})})}),(0,C.jsx)(_e,{})]})}}),t[55]=c,t[56]=w.control,t[57]=k,t[58]=J):J=t[58];let Y;t[59]!==q||t[60]!==J?(Y=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[q,J]}),t[59]=q,t[60]=J,t[61]=Y):Y=t[61];let X;t[62]===w.formState.isSubmitting?X=t[63]:(X=w.formState.isSubmitting?(0,C.jsx)(r,{id:`9bG48P`}):(0,C.jsx)(r,{id:`JlFcis`}),t[62]=w.formState.isSubmitting,t[63]=X);let Z;t[64]!==w.formState.isSubmitting||t[65]!==X?(Z=(0,C.jsx)(`div`,{className:`flex justify-end`,children:(0,C.jsx)(l,{type:`submit`,disabled:w.formState.isSubmitting,children:X})}),t[64]=w.formState.isSubmitting,t[65]=X,t[66]=Z):Z=t[66];let Q;t[67]!==L||t[68]!==z||t[69]!==K||t[70]!==Y||t[71]!==Z?(Q=(0,C.jsxs)(`form`,{onSubmit:L,className:`space-y-5`,children:[z,K,Y,Z]}),t[67]=L,t[68]=z,t[69]=K,t[70]=Y,t[71]=Z,t[72]=Q):Q=t[72];let $;return t[73]!==w||t[74]!==Q?($=(0,C.jsx)(ve,{...w,children:Q}),t[73]=w,t[74]=Q,t[75]=$):$=t[75],$};function k(e){return Ne.includes(e.type)}function ze(e){return e.every(k)}function A(e,t){return e+t.size}function Be(e){return e.reduce(A,0)<=D}function Ve(e){return!e.shareEmail||p().safeParse(e.email).success}function He(e){let{field:t}=e;return(0,C.jsxs)(g,{className:`flex flex-row items-center gap-2 space-y-0`,children:[(0,C.jsx)(v,{children:(0,C.jsx)(ee,{checked:t.value,onCheckedChange:e=>t.onChange(e===!0)})}),(0,C.jsx)(ge,{className:`font-normal`,children:(0,C.jsx)(r,{id:`SF9qpO`})})]})}export{O as FeedbackForm};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{s as o,t as s}from"./createLucideIcon-BUb14crZ.js";import{r as c,t as l}from"./button-DHE6Sx02.js";import{i as u,n as d,t as f}from"./tooltip-BCGL5jDF.js";import{t as ee}from"./checkbox-Cn88M3G6.js";import{n as te,t as ne}from"./toggle-group-CxrQL99E.js";import{Aa as re,Fa as ie,Ia as ae,Ma as oe,Na as p,ja as se,ka as ce}from"./dist-Vm1kQiqo.js";import{t as le}from"./paperclip-DF10JkTg.js";import{t as ue}from"./x-6ATUQvcC.js";import{n as m}from"./dist-DwCd6eR-.js";import{t as de}from"./input-CsXmpyZP.js";import{t as h}from"./client-version-BBhtdyiC.js";import{t as fe}from"./textarea-DwJR-19i.js";import{l as pe,o as me}from"./index.esm-DRU91WyY.js";import{t as he}from"./zod-CCGVCn6n.js";import{a as g,i as _,n as v,o as ge,s as _e,t as ve}from"./form-J8CRFj8p.js";var ye=s(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),be=s(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),xe=e(n(),1),y=a(),b=new URL(`/api/feedback`,{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.37.1`}?.VITE_OK_FEEDBACK_INTAKE_ORIGIN||`https://openknowledge.ai`).href;function x(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=typeof r.result==`string`?r.result:``,n=e.indexOf(`,`);t(n===-1?``:e.slice(n+1))},r.onerror=()=>n(r.error??Error(`file read failed`)),r.readAsDataURL(e)})}async function Se(e){return{contentType:e.type,base64:await x(e)}}function S(){return typeof window<`u`&&window.okDesktop?.platform||`web`}async function Ce(e){try{let t=await fetch(b,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e,appVersion:h,platform:S()}),signal:AbortSignal.timeout(3e4)});if(t.ok){let e=await t.json().catch(e=>(console.warn(`[feedback] action=submit result=ok-parse-error message=${e instanceof Error?e.message:String(e)}`),null));return{ok:!0,reference:e&&typeof e.reference==`string`?e.reference:``}}return t.status===400||t.status===413?{ok:!1,reason:`invalid`}:t.status===503?{ok:!1,reason:`unavailable`}:(console.warn(`[feedback] action=submit result=http-error status=${t.status}`),{ok:!1,reason:`error`})}catch(e){return console.warn(`[feedback] action=submit result=network-error message=${e instanceof Error?e.message:String(e)}`),{ok:!1,reason:`error`}}}var C=t(),w=c(`group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed`,{variants:{size:{default:`gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2`,sm:`gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5`,xs:`gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1`},orientation:{horizontal:`min-w-40 items-center`,vertical:`w-24 flex-col has-data-[slot=attachment-content]:w-30`}}});function we(e){let t=(0,y.c)(16),n,r,i,a,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5]):({className:n,state:i,size:a,orientation:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s);let c=i===void 0?`done`:i,l=a===void 0?`default`:a,u=s===void 0?`horizontal`:s,d;t[6]!==n||t[7]!==u||t[8]!==l?(d=o(w({size:l,orientation:u}),n),t[6]=n,t[7]=u,t[8]=l,t[9]=d):d=t[9];let f;return t[10]!==u||t[11]!==r||t[12]!==l||t[13]!==c||t[14]!==d?(f=(0,C.jsx)(`div`,{"data-slot":`attachment`,"data-state":c,"data-size":l,"data-orientation":u,className:d,...r}),t[10]=u,t[11]=r,t[12]=l,t[13]=c,t[14]=d,t[15]=f):f=t[15],f}var T=c(`relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5`,{variants:{variant:{icon:``,image:`opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover`}},defaultVariants:{variant:`icon`}});function Te(e){let t=(0,y.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`icon`:i,s;t[4]!==n||t[5]!==a?(s=o(T({variant:a}),n),t[4]=n,t[5]=a,t[6]=s):s=t[6];let c;return t[7]!==r||t[8]!==s||t[9]!==a?(c=(0,C.jsx)(`div`,{"data-slot":`attachment-media`,"data-variant":a,className:s,...r}),t[7]=r,t[8]=s,t[9]=a,t[10]=c):c=t[10],c}function Ee(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`div`,{"data-slot":`attachment-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function De(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`span`,{"data-slot":`attachment-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Oe(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80`,`max-w-full`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`span`,{"data-slot":`attachment-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ke(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`div`,{"data-slot":`attachment-actions`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ae(e){let t=(0,y.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:a,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=i===void 0?`icon-xs`:i,c=a??`ghost`,u;t[5]===n?u=t[6]:(u=o(n),t[5]=n,t[6]=u);let d;return t[7]!==r||t[8]!==s||t[9]!==c||t[10]!==u?(d=(0,C.jsx)(l,{"data-slot":`attachment-action`,variant:c,size:s,className:u,...r}),t[7]=r,t[8]=s,t[9]=c,t[10]=u,t[11]=d):d=t[11],d}function je(e){let t=(0,y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,C.jsx)(`div`,{"data-slot":`attachment-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Me=[{value:`too-slow`,label:{id:`YJPN3F`}},{value:`hard-to-use`,label:{id:`MDBJwN`}},{value:`missing-feature`,label:{id:`anmUZq`}},{value:`something-broke`,label:{id:`dXCi3J`}},{value:`formatting`,label:{id:`RcrskJ`}},{value:`other`,label:{id:`_IX_7x`}}],E=3,D=3*1024*1024,Ne=[`image/png`,`image/jpeg`,`image/webp`],Pe=`data-[state=on]:border-primary data-[state=on]:bg-primary/5 data-[state=on]:text-primary`,Fe=`rounded-full border border-input bg-transparent px-3 ${Pe}`;function Ie(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Le(e,t){let n=new Set(e.map(e=>`${e.name}:${e.size}`)),r=Array.from(t??[]).filter(e=>Ne.includes(e.type)&&!n.has(`${e.name}:${e.size}`));return[...e,...r].slice(0,E)}var Re=e=>{let t=(0,y.c)(5),{file:n}=e,[r,i]=(0,xe.useState)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=URL.createObjectURL(n);return i(e),()=>URL.revokeObjectURL(e)},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,xe.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=r?(0,C.jsx)(`img`,{src:r,alt:``,className:`size-full object-cover`}):null,t[3]=r,t[4]=s),s},O=e=>{let t=(0,y.c)(76),{onSuccess:n,source:a}=e,s=a===void 0?`resources_menu`:a,{_:c}=i(),ee=(0,xe.useRef)(null),p,h;if(t[0]!==c){let e=ie({rating:ce([`positive`,`negative`],{error:c({id:`H-hzll`})}),reasons:se(ae()),message:ae(),attachments:se(re(File)).max(E,c({id:`E9gh86`,values:{MAX_ATTACHMENTS:E}})).refine(ze,c({id:`s7us1p`})).refine(Be,c({id:`ItxGi3`})),shareEmail:oe(),email:ae()}).refine(Ve,{path:[`email`],message:c({id:`fwrPh4`})});h=me,p=he(e),t[0]=c,t[1]=p,t[2]=h}else p=t[1],h=t[2];let b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[3]=b):b=t[3];let x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x={rating:void 0,reasons:b,message:``,attachments:[],shareEmail:!1,email:``},t[4]=x):x=t[4];let S;t[5]===p?S=t[6]:(S={resolver:p,defaultValues:x},t[5]=p,t[6]=S);let w=h(S),T;t[7]===w.control?T=t[8]:(T={control:w.control,name:`rating`},t[7]=w.control,t[8]=T);let D=pe(T),O;t[9]===w.control?O=t[10]:(O={control:w.control,name:`shareEmail`},t[9]=w.control,t[10]=O);let k=pe(O),A;t[11]===w.control?A=t[12]:(A={control:w.control,name:`attachments`},t[11]=w.control,t[12]=A);let j=pe(A),M=j.length>=E,N=w.formState.errors.attachments,P;t[13]===w?P=t[14]:(P=e=>w.setValue(`attachments`,e,{shouldValidate:!0}),t[13]=w,t[14]=P);let F=P,I;t[15]!==c||t[16]!==w||t[17]!==n||t[18]!==s?(I=async e=>{try{let t=e.attachments.length?await Promise.all(e.attachments.map(Se)):void 0,r=await Ce({kind:`general`,rating:e.rating,reasons:e.reasons,message:e.message.trim()||void 0,email:e.shareEmail&&e.email?e.email:void 0,attachments:t,source:s});if(r.ok){m.success(c({id:`LvdLef`})),w.reset(),n?.();return}if(r.reason===`unavailable`){m.error(c({id:`D8JJwQ`}));return}m.error(c({id:`D2emTw`}))}catch(e){let t=e;console.warn(`[feedback] action=submit result=unexpected-error message=${t instanceof Error?t.message:String(t)}`),m.error(c({id:`D2emTw`}))}},t[15]=c,t[16]=w,t[17]=n,t[18]=s,t[19]=I):I=t[19];let Ue=I,L;t[20]!==w||t[21]!==Ue?(L=w.handleSubmit(Ue),t[20]=w,t[21]=Ue,t[22]=L):L=t[22];let R;t[23]===w?R=t[24]:(R=e=>{let{field:t}=e;return(0,C.jsxs)(g,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(ne,{type:`single`,variant:`outline`,spacing:2,value:t.value??``,onValueChange:e=>{e&&(t.onChange(e),e===`positive`&&w.setValue(`reasons`,[]))},className:`w-full`,children:[(0,C.jsxs)(te,{value:`positive`,className:`h-auto flex-1 justify-center gap-2 py-2 ${Pe}`,children:[(0,C.jsx)(be,{className:`size-4`}),(0,C.jsx)(r,{id:`OEEQKT`})]}),(0,C.jsxs)(te,{value:`negative`,className:`h-auto flex-1 justify-center gap-2 py-2 ${Pe}`,children:[(0,C.jsx)(ye,{className:`size-4`}),(0,C.jsx)(r,{id:`U0QBh4`})]})]})}),(0,C.jsx)(_e,{})]})},t[23]=w,t[24]=R);let z;t[25]!==w.control||t[26]!==R?(z=(0,C.jsx)(_,{control:w.control,name:`rating`,render:R}),t[25]=w.control,t[26]=R,t[27]=z):z=t[27];let B;t[28]!==c||t[29]!==w.control||t[30]!==D?(B=D===`negative`&&(0,C.jsx)(_,{control:w.control,name:`reasons`,render:e=>{let{field:t}=e;return(0,C.jsxs)(g,{children:[(0,C.jsx)(ge,{children:(0,C.jsx)(r,{id:`Fqx38P`})}),(0,C.jsx)(v,{children:(0,C.jsx)(ne,{type:`multiple`,variant:`outline`,spacing:2,value:t.value,onValueChange:t.onChange,className:`w-full flex-wrap justify-start`,children:Me.map(e=>(0,C.jsx)(te,{value:e.value,className:Fe,children:c(e.label)},e.value))})})]})}}),t[28]=c,t[29]=w.control,t[30]=D,t[31]=B):B=t[31];let V;t[32]!==c||t[33]!==M||t[34]!==j||t[35]!==F?(V=e=>{let{field:t}=e;return(0,C.jsx)(g,{children:(0,C.jsx)(v,{children:(0,C.jsxs)(`div`,{className:`relative`,children:[(0,C.jsx)(fe,{...t,placeholder:c({id:`QlAG4m`}),className:`min-h-20 resize-none pb-9`}),(0,C.jsxs)(f,{children:[(0,C.jsx)(u,{asChild:!0,children:(0,C.jsx)(`span`,{className:o(`absolute bottom-1.5 left-1.5 inline-flex`,M&&`cursor-not-allowed`),children:(0,C.jsxs)(l,{type:`button`,variant:`ghost`,size:`icon`,disabled:M,onClick:()=>ee.current?.click(),className:`size-7 text-muted-foreground`,children:[(0,C.jsx)(le,{className:`size-4`}),(0,C.jsx)(`span`,{className:`sr-only`,children:(0,C.jsx)(r,{id:`3LbBJn`})})]})})}),(0,C.jsx)(d,{children:M?(0,C.jsx)(r,{id:`ASqqsQ`,values:{MAX_ATTACHMENTS:E}}):(0,C.jsx)(r,{id:`3LbBJn`})})]}),(0,C.jsx)(de,{ref:ee,type:`file`,accept:Ne.join(`,`),multiple:!0,className:`hidden`,onChange:e=>{F(Le(j,e.target.files)),e.target.value=``}})]})})})},t[32]=c,t[33]=M,t[34]=j,t[35]=F,t[36]=V):V=t[36];let H;t[37]!==w.control||t[38]!==V?(H=(0,C.jsx)(_,{control:w.control,name:`message`,render:V}),t[37]=w.control,t[38]=V,t[39]=H):H=t[39];let U;t[40]!==c||t[41]!==j||t[42]!==F?(U=j.length>0&&(0,C.jsx)(je,{children:j.map((e,t)=>(0,C.jsxs)(we,{size:`xs`,children:[(0,C.jsx)(Te,{variant:`image`,children:(0,C.jsx)(Re,{file:e})}),(0,C.jsxs)(Ee,{children:[(0,C.jsx)(De,{children:e.name}),(0,C.jsx)(Oe,{children:Ie(e.size)})]}),(0,C.jsx)(ke,{children:(0,C.jsx)(Ae,{type:`button`,"aria-label":c({id:`w61W3L`,values:{0:e.name}}),onClick:()=>F(j.filter((e,n)=>n!==t)),children:(0,C.jsx)(ue,{className:`size-3.5`})})})]},`${e.name}:${e.size}`))}),t[40]=c,t[41]=j,t[42]=F,t[43]=U):U=t[43];let W;t[44]===N?W=t[45]:(W=N?.message&&(0,C.jsx)(`p`,{className:`text-destructive text-sm`,children:N.message}),t[44]=N,t[45]=W);let G;t[46]!==H||t[47]!==U||t[48]!==W?(G=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[H,U,W]}),t[46]=H,t[47]=U,t[48]=W,t[49]=G):G=t[49];let K;t[50]!==B||t[51]!==G?(K=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[B,G]}),t[50]=B,t[51]=G,t[52]=K):K=t[52];let q;t[53]===w.control?q=t[54]:(q=(0,C.jsx)(_,{control:w.control,name:`shareEmail`,render:He}),t[53]=w.control,t[54]=q);let J;t[55]!==c||t[56]!==w.control||t[57]!==k?(J=k&&(0,C.jsx)(_,{control:w.control,name:`email`,render:e=>{let{field:t}=e;return(0,C.jsxs)(g,{children:[(0,C.jsx)(v,{children:(0,C.jsx)(de,{...t,type:`email`,placeholder:c({id:`JHf6qZ`})})}),(0,C.jsx)(_e,{})]})}}),t[55]=c,t[56]=w.control,t[57]=k,t[58]=J):J=t[58];let Y;t[59]!==q||t[60]!==J?(Y=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[q,J]}),t[59]=q,t[60]=J,t[61]=Y):Y=t[61];let X;t[62]===w.formState.isSubmitting?X=t[63]:(X=w.formState.isSubmitting?(0,C.jsx)(r,{id:`9bG48P`}):(0,C.jsx)(r,{id:`JlFcis`}),t[62]=w.formState.isSubmitting,t[63]=X);let Z;t[64]!==w.formState.isSubmitting||t[65]!==X?(Z=(0,C.jsx)(`div`,{className:`flex justify-end`,children:(0,C.jsx)(l,{type:`submit`,disabled:w.formState.isSubmitting,children:X})}),t[64]=w.formState.isSubmitting,t[65]=X,t[66]=Z):Z=t[66];let Q;t[67]!==L||t[68]!==z||t[69]!==K||t[70]!==Y||t[71]!==Z?(Q=(0,C.jsxs)(`form`,{onSubmit:L,className:`space-y-5`,children:[z,K,Y,Z]}),t[67]=L,t[68]=z,t[69]=K,t[70]=Y,t[71]=Z,t[72]=Q):Q=t[72];let $;return t[73]!==w||t[74]!==Q?($=(0,C.jsx)(ve,{...w,children:Q}),t[73]=w,t[74]=Q,t[75]=$):$=t[75],$};function k(e){return Ne.includes(e.type)}function ze(e){return e.every(k)}function A(e,t){return e+t.size}function Be(e){return e.reduce(A,0)<=D}function Ve(e){return!e.shareEmail||p().safeParse(e.email).success}function He(e){let{field:t}=e;return(0,C.jsxs)(g,{className:`flex flex-row items-center gap-2 space-y-0`,children:[(0,C.jsx)(v,{children:(0,C.jsx)(ee,{checked:t.value,onCheckedChange:e=>t.onChange(e===!0)})}),(0,C.jsx)(ge,{className:`font-normal`,children:(0,C.jsx)(r,{id:`SF9qpO`})})]})}export{O as FeedbackForm};
@@ -1,4 +1,4 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{t as o}from"./useQuery-NsPxD6kI.js";import{n as s}from"./dist-COAuqNbv.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{s as l,t as u}from"./createLucideIcon-BUb14crZ.js";import{t as d}from"./button-DHE6Sx02.js";import{i as f,n as p,t as m}from"./tooltip-BCGL5jDF.js";import{n as h,t as g}from"./toggle-group-CxrQL99E.js";import{U as _,Y as v,ct as y,gt as b,lt as x,mr as S}from"./dist-C6nSogV9.js";import{t as C}from"./arrow-up-right-BKliW282.js";import{i as w,o as T,s as E,t as D}from"./prop-types-DUCnPFii.js";import{t as ee}from"./triangle-alert-DpxK7pzx.js";import{t as O}from"./dist-BD3698ve.js";import{o as k}from"./documents-events-DeUc9zJv.js";import{s as te}from"./doc-hash-eIVtLs9w.js";import{n as ne}from"./external-link-BtglP1zb.js";import{a as A,i as re,n as ie,o as ae,r as oe,s as se,t as ce}from"./panel-DLUMbyPl.js";import{t as le}from"./target-navigation-intent-C1iQZwv4.js";import{t as ue}from"./ordinal-DC5m951M.js";import{n as de,t as j}from"./min-C03Z0UNc.js";import{C as fe,S as M,_ as pe,b as me,g as he,n as N,r as ge,t as _e,v as ve,w as ye,x as be,y as xe}from"./src-DlwJ21NB.js";import{t as Se}from"./colors-N4wXgevD.js";import{t as Ce}from"./isObject-ClHKc-zZ.js";import{n as we,t as P}from"./now-LAZzaJBH.js";var Te=u(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),Ee=u(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]);function F(e,n){let r=0;if(n===void 0)for(let n of e)(n=+n)&&(r+=n);else{let i=-1;for(let a of e)(a=+n(a,++i,e))&&(r+=a)}return r}var De=e=>()=>e;function Oe(e,{sourceEvent:n,subject:r,target:i,identifier:a,active:o,x:s,y:c,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}Oe.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ke(e){return!e.ctrlKey&&!e.button}function Ae(){return this.parentNode}function je(e,n){return n??{x:e.x,y:e.y}}function Me(){return navigator.maxTouchPoints||`ontouchstart`in this}function Ne(){var e=ke,n=Ae,r=je,i=Me,a={},o=ye(`start`,`drag`,`end`),s=0,c,l,u,d,f=0;function p(e){e.on(`mousedown.drag`,m).filter(i).on(`touchstart.drag`,_).on(`touchmove.drag`,v,xe).on(`touchend.drag touchcancel.drag`,y).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function m(r,i){if(!(d||!e.call(this,r,i))){var a=b(this,n.call(this,r,i),r,i,`mouse`);a&&(fe(r.view).on(`mousemove.drag`,h,me).on(`mouseup.drag`,g,me),he(r.view),be(r),u=!1,c=r.clientX,l=r.clientY,a(`start`,r))}}function h(e){if(ve(e),!u){var n=e.clientX-c,r=e.clientY-l;u=n*n+r*r>f}a.mouse(`drag`,e)}function g(e){fe(e.view).on(`mousemove.drag mouseup.drag`,null),pe(e.view,u),ve(e),a.mouse(`end`,e)}function _(r,i){if(e.call(this,r,i)){var a=r.changedTouches,o=n.call(this,r,i),s=a.length,c,l;for(c=0;c<s;++c)(l=b(this,o,r,i,a[c].identifier,a[c]))&&(be(r),l(`start`,r,a[c]))}}function v(e){var n=e.changedTouches,r=n.length,i,o;for(i=0;i<r;++i)(o=a[n[i].identifier])&&(ve(e),o(`drag`,e,n[i]))}function y(e){var n=e.changedTouches,r=n.length,i,o;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),i=0;i<r;++i)(o=a[n[i].identifier])&&(be(e),o(`end`,e,n[i]))}function b(e,n,i,c,l,u){var d=o.copy(),f=M(u||i,n),m,h,g;if((g=r.call(e,new Oe(`beforestart`,{sourceEvent:i,target:p,identifier:l,active:s,x:f[0],y:f[1],dx:0,dy:0,dispatch:d}),c))!=null)return m=g.x-f[0]||0,h=g.y-f[1]||0,function r(i,o,u){var _=f,v;switch(i){case`start`:a[l]=r,v=s++;break;case`end`:delete a[l],--s;case`drag`:f=M(u||o,n),v=s;break}d.call(i,e,new Oe(i,{sourceEvent:o,subject:g,target:p,identifier:l,active:v,x:f[0]+m,y:f[1]+h,dx:f[0]-_[0],dy:f[1]-_[1],dispatch:d}),c)}}return p.filter=function(n){return arguments.length?(e=typeof n==`function`?n:De(!!n),p):e},p.container=function(e){return arguments.length?(n=typeof e==`function`?e:De(e),p):n},p.subject=function(e){return arguments.length?(r=typeof e==`function`?e:De(e),p):r},p.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:De(!!e),p):i},p.on=function(){var e=o.on.apply(o,arguments);return e===o?p:e},p.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,p):Math.sqrt(f)},p}function I(e){let n=+this._x.call(null,e),r=+this._y.call(null,e);return Pe(this.cover(n,r),n,r,e)}function Pe(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var a,o=e._root,s={data:i},c=e._x0,l=e._y0,u=e._x1,d=e._y1,f,p,m,h,g,_,v,y;if(!o)return e._root=s,e;for(;o.length;)if((g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p,a=o,!(o=o[v=_<<1|g]))return a[v]=s,e;if(m=+e._x.call(null,o.data),h=+e._y.call(null,o.data),n===m&&r===h)return s.next=o,a?a[v]=s:e._root=s,e;do a=a?a[v]=[,,,,]:e._root=[,,,,],(g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p;while((v=_<<1|g)==(y=(h>=p)<<1|m>=f));return a[y]=o,a[v]=s,e}function Fe(e){var n,r,i=e.length,a,o,s=Array(i),c=Array(i),l=1/0,u=1/0,d=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(a=+this._x.call(null,n=e[r]))||isNaN(o=+this._y.call(null,n))||(s[r]=a,c[r]=o,a<l&&(l=a),a>d&&(d=a),o<u&&(u=o),o>f&&(f=o));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<i;++r)Pe(this,s[r],c[r],e[r]);return this}function Ie(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,a=this._x1,o=this._y1;if(isNaN(r))a=(r=Math.floor(e))+1,o=(i=Math.floor(n))+1;else{for(var s=a-r||1,c=this._root,l,u;r>e||e>=a||i>n||n>=o;)switch(u=(n<i)<<1|e<r,l=[,,,,],l[u]=c,c=l,s*=2,u){case 0:a=r+s,o=i+s;break;case 1:r=a-s,o=i+s;break;case 2:a=r+s,i=o-s;break;case 3:r=a-s,i=o-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=i,this._x1=a,this._y1=o,this}function L(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Le(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function R(e,n,r,i,a){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=a}function Re(e,n,r){var i,a=this._x0,o=this._y0,s,c,l,u,d=this._x1,f=this._y1,p=[],m=this._root,h,g;for(m&&p.push(new R(m,a,o,d,f)),r==null?r=1/0:(a=e-r,o=n-r,d=e+r,f=n+r,r*=r);h=p.pop();)if(!(!(m=h.node)||(s=h.x0)>d||(c=h.y0)>f||(l=h.x1)<a||(u=h.y1)<o))if(m.length){var _=(s+l)/2,v=(c+u)/2;p.push(new R(m[3],_,v,l,u),new R(m[2],s,v,_,u),new R(m[1],_,c,l,v),new R(m[0],s,c,_,v)),(g=(n>=v)<<1|e>=_)&&(h=p[p.length-1],p[p.length-1]=p[p.length-1-g],p[p.length-1-g]=h)}else{var y=e-+this._x.call(null,m.data),b=n-+this._y.call(null,m.data),x=y*y+b*b;if(x<r){var S=Math.sqrt(r=x);a=e-S,o=n-S,d=e+S,f=n+S,i=m.data}}return i}function ze(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,a,o,s=this._x0,c=this._y0,l=this._x1,u=this._y1,d,f,p,m,h,g,_,v;if(!r)return this;if(r.length)for(;;){if((h=d>=(p=(s+l)/2))?s=p:l=p,(g=f>=(m=(c+u)/2))?c=m:u=m,n=r,!(r=r[_=g<<1|h]))return this;if(!r.length)break;(n[_+1&3]||n[_+2&3]||n[_+3&3])&&(i=n,v=_)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(o=r.next)&&delete r.next,a?(o?a.next=o:delete a.next,this):n?(o?n[_]=o:delete n[_],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[v]=r:this._root=r),this):(this._root=o,this)}function Be(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Ve(){return this._root}function He(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Ue(e){var n=[],r,i=this._root,a,o,s,c,l;for(i&&n.push(new R(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,o=r.x0,s=r.y0,c=r.x1,l=r.y1)&&i.length){var u=(o+c)/2,d=(s+l)/2;(a=i[3])&&n.push(new R(a,u,d,c,l)),(a=i[2])&&n.push(new R(a,o,d,u,l)),(a=i[1])&&n.push(new R(a,u,s,c,d)),(a=i[0])&&n.push(new R(a,o,s,u,d))}return this}function We(e){var n=[],r=[],i;for(this._root&&n.push(new R(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var a=i.node;if(a.length){var o,s=i.x0,c=i.y0,l=i.x1,u=i.y1,d=(s+l)/2,f=(c+u)/2;(o=a[0])&&n.push(new R(o,s,c,d,f)),(o=a[1])&&n.push(new R(o,d,c,l,f)),(o=a[2])&&n.push(new R(o,s,f,d,u)),(o=a[3])&&n.push(new R(o,d,f,l,u))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Ge(e){return e[0]}function Ke(e){return arguments.length?(this._x=e,this):this._x}function qe(e){return e[1]}function Je(e){return arguments.length?(this._y=e,this):this._y}function Ye(e,n,r){var i=new Xe(n??Ge,r??qe,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Xe(e,n,r,i,a,o){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=a,this._y1=o,this._root=void 0}function Ze(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var z=Ye.prototype=Xe.prototype;z.copy=function(){var e=new Xe(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=Ze(n),e;for(r=[{source:n,target:e._root=[,,,,]}];n=r.pop();)for(var a=0;a<4;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=[,,,,]}):n.target[a]=Ze(i));return e},z.add=I,z.addAll=Fe,z.cover=Ie,z.data=L,z.extent=Le,z.find=Re,z.remove=ze,z.removeAll=Be,z.root=Ve,z.size=He,z.visit=Ue,z.visitAfter=We,z.x=Ke,z.y=Je;var Qe=Se(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`),B=n(),V=e(r(),1),$e=c(),et=`Expected a function`,tt=Math.max,nt=Math.min;function rt(e,n,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(et);n=we(n)||0,Ce(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?tt(we(r.maxWait)||0,n):o,p=`trailing`in r?!!r.trailing:p);function m(n){var r=i,o=a;return i=a=void 0,u=n,s=e.apply(o,r),s}function h(e){return u=e,c=setTimeout(v,n),d?m(e):s}function g(e){var r=e-l,i=e-u,a=n-r;return f?nt(a,o-i):a}function _(e){var r=e-l,i=e-u;return l===void 0||r>=n||r<0||f&&i>=o}function v(){var e=P();if(_(e))return y(e);c=setTimeout(v,g(e))}function y(e){return c=void 0,p&&i?m(e):(i=a=void 0,s)}function b(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function x(){return c===void 0?s:y(P())}function S(){var e=P(),r=_(e);if(i=arguments,a=this,l=e,r){if(c===void 0)return h(l);if(f)return clearTimeout(c),c=setTimeout(v,n),m(l)}return c===void 0&&(c=setTimeout(v,n)),s}return S.cancel=b,S.flush=x,S}var it=`Expected a function`;function H(e,n,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(it);return Ce(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),rt(e,n,{leading:i,maxWait:n,trailing:a})}var at=[`#60a5fa`,`#a78bfa`,`#34d399`,`#f472b6`,`#fb923c`,`#22d3ee`,`#c084fc`,`#4ade80`,`#f87171`,`#eab308`,`#ec4899`,`#06b67f`,`#8b5cf6`,`#f43f5e`,`#0ea5e9`,`#a855f7`],ot=[`#1e40af`,`#6b21a8`,`#166534`,`#9f1239`,`#9a3412`,`#164e63`,`#581c87`,`#166534`,`#991b1b`,`#854d0e`,`#831843`,`#0f766e`,`#312e81`,`#9f1239`,`#0c4a6e`,`#6b21a8`];function st(e){let n=2;for(let r=0;r<e.length;r++)n=Math.imul(n^e.charCodeAt(r),1540483477),n^=n>>>13,n=Math.imul(n,1540483477),n^=n>>>15;return n>>>0}function ct(e,n){let r=n?at:ot;return r[st(e)%r.length]}var lt={fullscreen:{maxEntries:10,containerClassName:`bottom-3 left-3 gap-1 rounded-lg px-3 py-2 text-xs`,titleClassName:`mb-1.5`,rowClassName:`gap-2`,swatchClassName:`size-2.5`,labelClassName:`max-w-[140px]`,overflowClassName:`pl-[18px]`},docked:{maxEntries:6,containerClassName:`bottom-2 left-2 gap-0.5 rounded-md px-2 py-1.5 text-[11px]`,titleClassName:`mb-1`,rowClassName:`gap-1.5`,swatchClassName:`size-2`,labelClassName:`max-w-[112px]`,overflowClassName:`pl-[14px]`}};function U(e){return lt[e]}function ut(e){let n=(0,$e.c)(6),{clusters:r,variant:a}=e,o=a===void 0?`fullscreen`:a,{resolvedTheme:c}=s(),u=c===`dark`,d,f;if(n[0]!==r||n[1]!==u||n[2]!==o){f=Symbol.for(`react.early_return_sentinel`);bb0:{let e=U(o);if(r.length===0){f=null;break bb0}let a=r.slice(0,e.maxEntries),s=r.length-a.length,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,B.jsx)(i,{id:`kmKqZg`}),n[5]=c):c=n[5],d=(0,B.jsxs)(`div`,{className:l(`pointer-events-none absolute z-10 flex flex-col backdrop-blur-sm`,e.containerClassName,u?`bg-black/70 text-gray-200`:`bg-white/80 text-gray-800 ring-1 ring-black/5`),children:[(0,B.jsx)(`div`,{className:l(`font-medium`,e.titleClassName,u?`text-slate-300`:`text-slate-700`),children:c}),a.map(n=>(0,B.jsxs)(`div`,{className:l(`flex items-center`,e.rowClassName),children:[(0,B.jsx)(`span`,{className:l(`inline-block shrink-0 rounded-full`,e.swatchClassName),style:{backgroundColor:ct(n,u)}}),(0,B.jsx)(`span`,{className:l(`truncate`,e.labelClassName),children:n})]},n)),s>0&&(0,B.jsx)(`div`,{className:l(`text-muted-foreground`,e.overflowClassName),children:(0,B.jsx)(i,{id:`lrhetp`,values:{overflow:s}})})]})}n[0]=r,n[1]=u,n[2]=o,n[3]=d,n[4]=f}else d=n[3],f=n[4];return f===Symbol.for(`react.early_return_sentinel`)?d:f}function W(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function dt(e,n,r){return n=St(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function ft(e,n){return ht(e)||W(e,n)||_t(e,n)||bt()}function pt(e){return mt(e)||gt(e)||_t(e)||yt()}function mt(e){if(Array.isArray(e))return vt(e)}function ht(e){if(Array.isArray(e))return e}function gt(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function _t(e,n){if(e){if(typeof e==`string`)return vt(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Array.from(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vt(e,n)}}function vt(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function yt(){throw TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{t as o}from"./useQuery-NsPxD6kI.js";import{n as s}from"./dist-COAuqNbv.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{s as l,t as u}from"./createLucideIcon-BUb14crZ.js";import{t as d}from"./button-DHE6Sx02.js";import{i as f,n as p,t as m}from"./tooltip-BCGL5jDF.js";import{n as h,t as g}from"./toggle-group-CxrQL99E.js";import{U as _,Y as v,ct as y,gt as b,lt as x,mr as S}from"./dist-Vm1kQiqo.js";import{t as C}from"./arrow-up-right-BKliW282.js";import{i as w,o as T,s as E,t as D}from"./prop-types-B0l6ZN6O.js";import{t as ee}from"./triangle-alert-DpxK7pzx.js";import{t as O}from"./dist-BD3698ve.js";import{o as k}from"./documents-events-DQ6Iario.js";import{s as te}from"./doc-hash-B8kD24Kw.js";import{n as ne}from"./external-link-BtglP1zb.js";import{a as A,i as re,n as ie,o as ae,r as oe,s as se,t as ce}from"./panel-DLUMbyPl.js";import{t as le}from"./target-navigation-intent-95GTKrco.js";import{t as ue}from"./ordinal-DC5m951M.js";import{n as de,t as j}from"./min-C03Z0UNc.js";import{C as fe,S as M,_ as pe,b as me,g as he,n as N,r as ge,t as _e,v as ve,w as ye,x as be,y as xe}from"./src-DlwJ21NB.js";import{t as Se}from"./colors-N4wXgevD.js";import{t as Ce}from"./isObject-ClHKc-zZ.js";import{n as we,t as P}from"./now-LAZzaJBH.js";var Te=u(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),Ee=u(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]);function F(e,n){let r=0;if(n===void 0)for(let n of e)(n=+n)&&(r+=n);else{let i=-1;for(let a of e)(a=+n(a,++i,e))&&(r+=a)}return r}var De=e=>()=>e;function Oe(e,{sourceEvent:n,subject:r,target:i,identifier:a,active:o,x:s,y:c,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}Oe.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ke(e){return!e.ctrlKey&&!e.button}function Ae(){return this.parentNode}function je(e,n){return n??{x:e.x,y:e.y}}function Me(){return navigator.maxTouchPoints||`ontouchstart`in this}function Ne(){var e=ke,n=Ae,r=je,i=Me,a={},o=ye(`start`,`drag`,`end`),s=0,c,l,u,d,f=0;function p(e){e.on(`mousedown.drag`,m).filter(i).on(`touchstart.drag`,_).on(`touchmove.drag`,v,xe).on(`touchend.drag touchcancel.drag`,y).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function m(r,i){if(!(d||!e.call(this,r,i))){var a=b(this,n.call(this,r,i),r,i,`mouse`);a&&(fe(r.view).on(`mousemove.drag`,h,me).on(`mouseup.drag`,g,me),he(r.view),be(r),u=!1,c=r.clientX,l=r.clientY,a(`start`,r))}}function h(e){if(ve(e),!u){var n=e.clientX-c,r=e.clientY-l;u=n*n+r*r>f}a.mouse(`drag`,e)}function g(e){fe(e.view).on(`mousemove.drag mouseup.drag`,null),pe(e.view,u),ve(e),a.mouse(`end`,e)}function _(r,i){if(e.call(this,r,i)){var a=r.changedTouches,o=n.call(this,r,i),s=a.length,c,l;for(c=0;c<s;++c)(l=b(this,o,r,i,a[c].identifier,a[c]))&&(be(r),l(`start`,r,a[c]))}}function v(e){var n=e.changedTouches,r=n.length,i,o;for(i=0;i<r;++i)(o=a[n[i].identifier])&&(ve(e),o(`drag`,e,n[i]))}function y(e){var n=e.changedTouches,r=n.length,i,o;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),i=0;i<r;++i)(o=a[n[i].identifier])&&(be(e),o(`end`,e,n[i]))}function b(e,n,i,c,l,u){var d=o.copy(),f=M(u||i,n),m,h,g;if((g=r.call(e,new Oe(`beforestart`,{sourceEvent:i,target:p,identifier:l,active:s,x:f[0],y:f[1],dx:0,dy:0,dispatch:d}),c))!=null)return m=g.x-f[0]||0,h=g.y-f[1]||0,function r(i,o,u){var _=f,v;switch(i){case`start`:a[l]=r,v=s++;break;case`end`:delete a[l],--s;case`drag`:f=M(u||o,n),v=s;break}d.call(i,e,new Oe(i,{sourceEvent:o,subject:g,target:p,identifier:l,active:v,x:f[0]+m,y:f[1]+h,dx:f[0]-_[0],dy:f[1]-_[1],dispatch:d}),c)}}return p.filter=function(n){return arguments.length?(e=typeof n==`function`?n:De(!!n),p):e},p.container=function(e){return arguments.length?(n=typeof e==`function`?e:De(e),p):n},p.subject=function(e){return arguments.length?(r=typeof e==`function`?e:De(e),p):r},p.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:De(!!e),p):i},p.on=function(){var e=o.on.apply(o,arguments);return e===o?p:e},p.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,p):Math.sqrt(f)},p}function I(e){let n=+this._x.call(null,e),r=+this._y.call(null,e);return Pe(this.cover(n,r),n,r,e)}function Pe(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var a,o=e._root,s={data:i},c=e._x0,l=e._y0,u=e._x1,d=e._y1,f,p,m,h,g,_,v,y;if(!o)return e._root=s,e;for(;o.length;)if((g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p,a=o,!(o=o[v=_<<1|g]))return a[v]=s,e;if(m=+e._x.call(null,o.data),h=+e._y.call(null,o.data),n===m&&r===h)return s.next=o,a?a[v]=s:e._root=s,e;do a=a?a[v]=[,,,,]:e._root=[,,,,],(g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p;while((v=_<<1|g)==(y=(h>=p)<<1|m>=f));return a[y]=o,a[v]=s,e}function Fe(e){var n,r,i=e.length,a,o,s=Array(i),c=Array(i),l=1/0,u=1/0,d=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(a=+this._x.call(null,n=e[r]))||isNaN(o=+this._y.call(null,n))||(s[r]=a,c[r]=o,a<l&&(l=a),a>d&&(d=a),o<u&&(u=o),o>f&&(f=o));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<i;++r)Pe(this,s[r],c[r],e[r]);return this}function Ie(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,a=this._x1,o=this._y1;if(isNaN(r))a=(r=Math.floor(e))+1,o=(i=Math.floor(n))+1;else{for(var s=a-r||1,c=this._root,l,u;r>e||e>=a||i>n||n>=o;)switch(u=(n<i)<<1|e<r,l=[,,,,],l[u]=c,c=l,s*=2,u){case 0:a=r+s,o=i+s;break;case 1:r=a-s,o=i+s;break;case 2:a=r+s,i=o-s;break;case 3:r=a-s,i=o-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=i,this._x1=a,this._y1=o,this}function L(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Le(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function R(e,n,r,i,a){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=a}function Re(e,n,r){var i,a=this._x0,o=this._y0,s,c,l,u,d=this._x1,f=this._y1,p=[],m=this._root,h,g;for(m&&p.push(new R(m,a,o,d,f)),r==null?r=1/0:(a=e-r,o=n-r,d=e+r,f=n+r,r*=r);h=p.pop();)if(!(!(m=h.node)||(s=h.x0)>d||(c=h.y0)>f||(l=h.x1)<a||(u=h.y1)<o))if(m.length){var _=(s+l)/2,v=(c+u)/2;p.push(new R(m[3],_,v,l,u),new R(m[2],s,v,_,u),new R(m[1],_,c,l,v),new R(m[0],s,c,_,v)),(g=(n>=v)<<1|e>=_)&&(h=p[p.length-1],p[p.length-1]=p[p.length-1-g],p[p.length-1-g]=h)}else{var y=e-+this._x.call(null,m.data),b=n-+this._y.call(null,m.data),x=y*y+b*b;if(x<r){var S=Math.sqrt(r=x);a=e-S,o=n-S,d=e+S,f=n+S,i=m.data}}return i}function ze(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,a,o,s=this._x0,c=this._y0,l=this._x1,u=this._y1,d,f,p,m,h,g,_,v;if(!r)return this;if(r.length)for(;;){if((h=d>=(p=(s+l)/2))?s=p:l=p,(g=f>=(m=(c+u)/2))?c=m:u=m,n=r,!(r=r[_=g<<1|h]))return this;if(!r.length)break;(n[_+1&3]||n[_+2&3]||n[_+3&3])&&(i=n,v=_)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(o=r.next)&&delete r.next,a?(o?a.next=o:delete a.next,this):n?(o?n[_]=o:delete n[_],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[v]=r:this._root=r),this):(this._root=o,this)}function Be(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Ve(){return this._root}function He(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Ue(e){var n=[],r,i=this._root,a,o,s,c,l;for(i&&n.push(new R(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,o=r.x0,s=r.y0,c=r.x1,l=r.y1)&&i.length){var u=(o+c)/2,d=(s+l)/2;(a=i[3])&&n.push(new R(a,u,d,c,l)),(a=i[2])&&n.push(new R(a,o,d,u,l)),(a=i[1])&&n.push(new R(a,u,s,c,d)),(a=i[0])&&n.push(new R(a,o,s,u,d))}return this}function We(e){var n=[],r=[],i;for(this._root&&n.push(new R(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var a=i.node;if(a.length){var o,s=i.x0,c=i.y0,l=i.x1,u=i.y1,d=(s+l)/2,f=(c+u)/2;(o=a[0])&&n.push(new R(o,s,c,d,f)),(o=a[1])&&n.push(new R(o,d,c,l,f)),(o=a[2])&&n.push(new R(o,s,f,d,u)),(o=a[3])&&n.push(new R(o,d,f,l,u))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Ge(e){return e[0]}function Ke(e){return arguments.length?(this._x=e,this):this._x}function qe(e){return e[1]}function Je(e){return arguments.length?(this._y=e,this):this._y}function Ye(e,n,r){var i=new Xe(n??Ge,r??qe,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Xe(e,n,r,i,a,o){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=a,this._y1=o,this._root=void 0}function Ze(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var z=Ye.prototype=Xe.prototype;z.copy=function(){var e=new Xe(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=Ze(n),e;for(r=[{source:n,target:e._root=[,,,,]}];n=r.pop();)for(var a=0;a<4;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=[,,,,]}):n.target[a]=Ze(i));return e},z.add=I,z.addAll=Fe,z.cover=Ie,z.data=L,z.extent=Le,z.find=Re,z.remove=ze,z.removeAll=Be,z.root=Ve,z.size=He,z.visit=Ue,z.visitAfter=We,z.x=Ke,z.y=Je;var Qe=Se(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`),B=n(),V=e(r(),1),$e=c(),et=`Expected a function`,tt=Math.max,nt=Math.min;function rt(e,n,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(et);n=we(n)||0,Ce(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?tt(we(r.maxWait)||0,n):o,p=`trailing`in r?!!r.trailing:p);function m(n){var r=i,o=a;return i=a=void 0,u=n,s=e.apply(o,r),s}function h(e){return u=e,c=setTimeout(v,n),d?m(e):s}function g(e){var r=e-l,i=e-u,a=n-r;return f?nt(a,o-i):a}function _(e){var r=e-l,i=e-u;return l===void 0||r>=n||r<0||f&&i>=o}function v(){var e=P();if(_(e))return y(e);c=setTimeout(v,g(e))}function y(e){return c=void 0,p&&i?m(e):(i=a=void 0,s)}function b(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function x(){return c===void 0?s:y(P())}function S(){var e=P(),r=_(e);if(i=arguments,a=this,l=e,r){if(c===void 0)return h(l);if(f)return clearTimeout(c),c=setTimeout(v,n),m(l)}return c===void 0&&(c=setTimeout(v,n)),s}return S.cancel=b,S.flush=x,S}var it=`Expected a function`;function H(e,n,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(it);return Ce(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),rt(e,n,{leading:i,maxWait:n,trailing:a})}var at=[`#60a5fa`,`#a78bfa`,`#34d399`,`#f472b6`,`#fb923c`,`#22d3ee`,`#c084fc`,`#4ade80`,`#f87171`,`#eab308`,`#ec4899`,`#06b67f`,`#8b5cf6`,`#f43f5e`,`#0ea5e9`,`#a855f7`],ot=[`#1e40af`,`#6b21a8`,`#166534`,`#9f1239`,`#9a3412`,`#164e63`,`#581c87`,`#166534`,`#991b1b`,`#854d0e`,`#831843`,`#0f766e`,`#312e81`,`#9f1239`,`#0c4a6e`,`#6b21a8`];function st(e){let n=2;for(let r=0;r<e.length;r++)n=Math.imul(n^e.charCodeAt(r),1540483477),n^=n>>>13,n=Math.imul(n,1540483477),n^=n>>>15;return n>>>0}function ct(e,n){let r=n?at:ot;return r[st(e)%r.length]}var lt={fullscreen:{maxEntries:10,containerClassName:`bottom-3 left-3 gap-1 rounded-lg px-3 py-2 text-xs`,titleClassName:`mb-1.5`,rowClassName:`gap-2`,swatchClassName:`size-2.5`,labelClassName:`max-w-[140px]`,overflowClassName:`pl-[18px]`},docked:{maxEntries:6,containerClassName:`bottom-2 left-2 gap-0.5 rounded-md px-2 py-1.5 text-[11px]`,titleClassName:`mb-1`,rowClassName:`gap-1.5`,swatchClassName:`size-2`,labelClassName:`max-w-[112px]`,overflowClassName:`pl-[14px]`}};function U(e){return lt[e]}function ut(e){let n=(0,$e.c)(6),{clusters:r,variant:a}=e,o=a===void 0?`fullscreen`:a,{resolvedTheme:c}=s(),u=c===`dark`,d,f;if(n[0]!==r||n[1]!==u||n[2]!==o){f=Symbol.for(`react.early_return_sentinel`);bb0:{let e=U(o);if(r.length===0){f=null;break bb0}let a=r.slice(0,e.maxEntries),s=r.length-a.length,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,B.jsx)(i,{id:`kmKqZg`}),n[5]=c):c=n[5],d=(0,B.jsxs)(`div`,{className:l(`pointer-events-none absolute z-10 flex flex-col backdrop-blur-sm`,e.containerClassName,u?`bg-black/70 text-gray-200`:`bg-white/80 text-gray-800 ring-1 ring-black/5`),children:[(0,B.jsx)(`div`,{className:l(`font-medium`,e.titleClassName,u?`text-slate-300`:`text-slate-700`),children:c}),a.map(n=>(0,B.jsxs)(`div`,{className:l(`flex items-center`,e.rowClassName),children:[(0,B.jsx)(`span`,{className:l(`inline-block shrink-0 rounded-full`,e.swatchClassName),style:{backgroundColor:ct(n,u)}}),(0,B.jsx)(`span`,{className:l(`truncate`,e.labelClassName),children:n})]},n)),s>0&&(0,B.jsx)(`div`,{className:l(`text-muted-foreground`,e.overflowClassName),children:(0,B.jsx)(i,{id:`lrhetp`,values:{overflow:s}})})]})}n[0]=r,n[1]=u,n[2]=o,n[3]=d,n[4]=f}else d=n[3],f=n[4];return f===Symbol.for(`react.early_return_sentinel`)?d:f}function W(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function dt(e,n,r){return n=St(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function ft(e,n){return ht(e)||W(e,n)||_t(e,n)||bt()}function pt(e){return mt(e)||gt(e)||_t(e)||yt()}function mt(e){if(Array.isArray(e))return vt(e)}function ht(e){if(Array.isArray(e))return e}function gt(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function _t(e,n){if(e){if(typeof e==`string`)return vt(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Array.from(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vt(e,n)}}function vt(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function yt(){throw TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xt(e,n){if(typeof e!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(typeof i!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function St(e){var n=xt(e,`string`);return typeof n==`symbol`?n:String(n)}var Ct=function(e,n){var r=new Set(n);return Object.assign.apply(Object,[{}].concat(pt(Object.entries(e).filter(function(e){var n=ft(e,1)[0];return!r.has(n)}).map(function(e){var n=ft(e,2),r=n[0],i=n[1];return dt({},r,i)}))))};function wt(e,{wrapperElementType:n=`div`,nodeMapper:r=e=>e,methodNames:i=[],initPropNames:a=[]}={}){return(0,V.forwardRef)((o,s)=>{let c=(0,V.useRef)(),l=(0,V.useMemo)(()=>e(Object.fromEntries(a.filter(e=>o.hasOwnProperty(e)).map(e=>[e,o[e]]))),[]);Tt(()=>{l(r(c.current))},V.useLayoutEffect),Tt(()=>l._destructor instanceof Function?l._destructor:void 0);let u=(0,V.useCallback)((e,...n)=>l[e]instanceof Function?l[e](...n):void 0,[l]),d=(0,V.useRef)({});return Object.keys(Ct(o,[...i,...a])).filter(e=>d.current[e]!==o[e]).forEach(e=>u(e,o[e])),d.current=o,(0,V.useImperativeHandle)(s,()=>Object.fromEntries(i.map(e=>[e,(...n)=>u(e,...n)])),[u]),V.createElement(n,{ref:c})})}function Tt(e,n=V.useEffect){let r=(0,V.useRef)(),i=(0,V.useRef)(!1),a=(0,V.useRef)(!1),[o,s]=(0,V.useState)(0);i.current&&(a.current=!0),n(()=>(i.current||=(r.current=e(),!0),s(e=>e+1),()=>{a.current&&=(r.current&&r.current(),r.current=void 0,i.current=!1,!1)}),[])}var Et=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:1024**(e-1)},Out:function(e){return e===1?1:1-2**(-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-(2**(10*(e-1)))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:2**(-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*2**(10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*2**(-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=1.70158*1.525;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Et.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Et.Bounce.In(e*2)*.5:Et.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<2**-52?2**-52:e,e=e>1e4?1e4:e,{In:function(n){return n**+e},Out:function(n){return 1-(1-n)**e},InOut:function(n){return n<.5?(n*2)**e/2:(1-(2-n*2)**e)/2+.5}}}}),Dt=function(){return performance.now()},Ot=function(){function e(){var e=[...arguments];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var o=a[i];(e=o._group)==null||e.remove(o),o._group=this,this._tweens[o.getId()]=o,this._tweensAddedDuringUpdate[o.getId()]=o}},e.prototype.remove=function(){for(var e=[...arguments],n=0,r=e;n<r.length;n++){var i=r[n];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},e.prototype.update=function(e,n){e===void 0&&(e=Dt()),n===void 0&&(n=!0);var r=Object.keys(this._tweens);if(r.length!==0)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var a=this._tweens[r[i]],o=!n;a&&a.update(e,o)===!1&&!n&&this.remove(a)}r=Object.keys(this._tweensAddedDuringUpdate)}},e}(),kt={Linear:function(e,n){var r=e.length-1,i=r*n,a=Math.floor(i),o=kt.Utils.Linear;return n<0?o(e[0],e[1],i):n>1?o(e[r],e[r-1],r-i):o(e[a],e[a+1>r?r:a+1],i-a)},Bezier:function(e,n){for(var r=0,i=e.length-1,a=Math.pow,o=kt.Utils.Bernstein,s=0;s<=i;s++)r+=a(1-n,i-s)*a(n,s)*e[s]*o(i,s);return r},CatmullRom:function(e,n){var r=e.length-1,i=r*n,a=Math.floor(i),o=kt.Utils.CatmullRom;return e[0]===e[r]?(n<0&&(a=Math.floor(i=r*(1+n))),o(e[(a-1+r)%r],e[a],e[(a+1)%r],e[(a+2)%r],i-a)):n<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):n>1?e[r]-(o(e[r],e[r],e[r-1],e[r-1],i-r)-e[r]):o(e[a?a-1:0],e[a],e[r<a+1?r:a+1],e[r<a+2?r:a+2],i-a)},Utils:{Linear:function(e,n,r){return(n-e)*r+e},Bernstein:function(e,n){var r=kt.Utils.Factorial;return r(e)/r(n)/r(e-n)},Factorial:(function(){var e=[1];return function(n){var r=1;if(e[n])return e[n];for(var i=n;i>1;i--)r*=i;return e[n]=r,r}})(),CatmullRom:function(e,n,r,i,a){var o=(r-e)*.5,s=(i-n)*.5,c=a*a,l=a*c;return(2*n-2*r+o+s)*l+(-3*n+3*r-2*o-s)*c+o*a+n}}},At=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),jt=new Ot,Mt=function(){function e(e,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Et.Linear.None,this._interpolationFunction=kt.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=At.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof n==`object`?(this._group=n,n.add(this)):n===!0&&(this._group=jt,jt.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,n){if(n===void 0&&(n=1e3),this._isPlaying)throw Error(`Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.`);return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,n){if(e===void 0&&(e=Dt()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var a in this._valuesEnd)i[a]=this._valuesEnd[a];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,n,r,i,a){for(var o in r){var s=e[o],c=Array.isArray(s),l=c?`array`:typeof s,u=!c&&Array.isArray(r[o]);if(!(l===`undefined`||l===`function`)){if(u){var d=r[o];if(d.length===0)continue;for(var f=[s],p=0,m=d.length;p<m;p+=1){var h=this._handleRelativeValue(s,d[p]);if(isNaN(h)){u=!1,console.warn(`Found invalid interpolation list. Skipping.`);break}f.push(h)}u&&(r[o]=f)}if((l===`object`||c)&&s&&!u){n[o]=c?[]:{};var g=s;for(var _ in g)n[o][_]=g[_];i[o]=c?[]:{};var d=r[o];if(!this._isDynamic){var v={};for(var _ in d)v[_]=d[_];r[o]=d=v}this._setupProperties(g,n[o],d,i[o],a)}else (n[o]===void 0||a)&&(n[o]=s),c||(n[o]*=1),u?i[o]=r[o].slice().reverse():i[o]=n[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(e){return e===void 0&&(e=Dt()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},e.prototype.resume=function(e){return e===void 0&&(e=Dt()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return e?(e.add(this),this):(console.warn(`tween.group() without args has been removed, use group.add(tween) instead.`),this)},e.prototype.remove=function(){var e;return(e=this._group)==null||e.remove(this),this},e.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return e===void 0&&(e=Et.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return e===void 0&&(e=kt.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){return this._chainedTweens=[...arguments],this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(n,r){var i=this;if(n===void 0&&(n=Dt()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(n,!0);else return!1;if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=n-this._startTime,s=this._duration+(this._repeatDelayTime??this._delayTime),c=this._duration+this._repeat*s,l=function(){if(i._duration===0||o>c)return 1;var e=o-Math.trunc(o/s)*s,n=Math.min(e/i._duration,1);return n===0&&o===i._duration?1:n}(),u=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),this._duration===0||o>=this._duration)if(this._repeat>0){var d=Math.min(Math.trunc((o-this._duration)/s)+1,this._repeat);for(a in isFinite(this._repeat)&&(this._repeat-=d),this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]==`string`&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var f=0,p=this._chainedTweens.length;f<p;f++)this._chainedTweens[f].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,n,r,i){for(var a in r)if(n[a]!==void 0){var o=n[a]||0,s=r[a];!Array.isArray(e[a])&&Array.isArray(s)?e[a]=this._interpolationFunction(s,i):typeof s==`object`&&s?this._updateProperties(e[a],o,s,i):(s=this._handleRelativeValue(o,s),typeof s==`number`&&(e[a]=o+(s-o)*i))}},e.prototype._handleRelativeValue=function(e,n){return typeof n==`string`?n.charAt(0)===`+`||n.charAt(0)===`-`?e+parseFloat(n):parseFloat(n):n},e.prototype._swapEndStartRepeatValues=function(e){var n=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r==`string`?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=n},e.autoStartOnUpdate=!1,e}();At.nextId;var Nt=jt;Nt.getAll.bind(Nt),Nt.removeAll.bind(Nt),Nt.add.bind(Nt),Nt.remove.bind(Nt),Nt.update.bind(Nt);function Pt(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Ft(e){if(Array.isArray(e))return e}function It(e,n){if(!(e instanceof n))throw TypeError(`Cannot call a class as a function`)}function Lt(e,n,r){return Object.defineProperty(e,`prototype`,{writable:!1}),e}function Rt(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n!==0)for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function zt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bt(e,n){return Ft(e)||Rt(e,n)||Vt(e,n)||zt()}function Vt(e,n){if(e){if(typeof e==`string`)return Pt(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pt(e,n):void 0}}var Ht=Lt(function e(n,r){var i=r.default,a=i===void 0?null:i,o=r.triggerUpdate,s=o===void 0?!0:o,c=r.onChange,l=c===void 0?function(e,n){}:c;It(this,e),this.name=n,this.defaultVal=a,this.triggerUpdate=s,this.onChange=l});function Ut(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,a=i===void 0?{}:i,o=e.methods,s=o===void 0?{}:o,c=e.aliases,l=c===void 0?{}:c,u=e.init,d=u===void 0?function(){}:u,f=e.update,p=f===void 0?function(){}:f,m=Object.keys(a).map(function(e){return new Ht(e,a[e])});return function e(){var n=[...arguments],i=!!(this instanceof e&&this.constructor),a=i?n.shift():void 0,o=n[0],c=o===void 0?{}:o,u=Object.assign({},r instanceof Function?r(c):r,{initialised:!1}),f={};function h(e){return g(e,c),_(),h}var g=function(e,n){d.call(h,e,u,n),u.initialised=!0},_=rt(function(){u.initialised&&(p.call(h,u,f),f={})},1);return m.forEach(function(e){h[e.name]=n(e);function n(e){var n=e.name,r=e.triggerUpdate,i=r===void 0?!1:r,a=e.onChange,o=a===void 0?function(e,n){}:a,s=e.defaultVal,c=s===void 0?null:s;return function(e){var r=u[n];if(!arguments.length)return r;var a=e===void 0?c:e;return u[n]=a,o.call(h,a,u,r),!f.hasOwnProperty(n)&&(f[n]=r),i&&_(),h}}}),Object.keys(s).forEach(function(e){h[e]=function(){var n,r=[...arguments];return(n=s[e]).call.apply(n,[h,u].concat(r))}}),Object.entries(l).forEach(function(e){var n=Bt(e,2),r=n[0];return h[r]=h[n[1]]}),h.resetProps=function(){return m.forEach(function(e){h[e.name](e.defaultVal)}),h},h.resetProps(),u._rerender=_,i&&a&&h(a),h}}var G=(function(e){return typeof e==`function`?e:typeof e==`string`?function(n){return n[e]}:function(n){return e}});function Wt(e){"@babel/helpers - typeof";return Wt=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Wt(e)}var Gt=/^\s+/,Kt=/\s+$/;function K(e,n){if(e||=``,n||={},e instanceof K)return e;if(!(this instanceof K))return new K(e,n);var r=qt(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}K.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),n=e.r/255,r=e.g/255,i=e.b/255,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4;return .2126*a+.7152*o+.0722*s},setAlpha:function(e){return this._a=vn(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Zt(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Zt(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?`hsv(`+n+`, `+r+`%, `+i+`%)`:`hsva(`+n+`, `+r+`%, `+i+`%, `+this._roundA+`)`},toHsl:function(){var e=Yt(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Yt(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?`hsl(`+n+`, `+r+`%, `+i+`%)`:`hsla(`+n+`, `+r+`%, `+i+`%, `+this._roundA+`)`},toHex:function(e){return $t(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return en(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`)`:`rgba(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:Math.round(q(this._r,255)*100)+`%`,g:Math.round(q(this._g,255)*100)+`%`,b:Math.round(q(this._b,255)*100)+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+Math.round(q(this._r,255)*100)+`%, `+Math.round(q(this._g,255)*100)+`%, `+Math.round(q(this._b,255)*100)+`%)`:`rgba(`+Math.round(q(this._r,255)*100)+`%, `+Math.round(q(this._g,255)*100)+`%, `+Math.round(q(this._b,255)*100)+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:this._a<1?!1:gn[$t(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var n=`#`+tn(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?`GradientType = 1, `:``;if(e){var a=K(e);r=`#`+tn(a._r,a._g,a._b,a._a)}return`progid:DXImageTransform.Microsoft.gradient(`+i+`startColorstr=`+n+`,endColorstr=`+r+`)`},toString:function(e){var n=!!e;e||=this._format;var r=!1,i=this._a<1&&this._a>=0;return!n&&i&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(r=this.toRgbString()),e===`prgb`&&(r=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(r=this.toHexString()),e===`hex3`&&(r=this.toHexString(!0)),e===`hex4`&&(r=this.toHex8String(!0)),e===`hex8`&&(r=this.toHex8String()),e===`name`&&(r=this.toName()),e===`hsl`&&(r=this.toHslString()),e===`hsv`&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return K(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(on,arguments)},brighten:function(){return this._applyModification(sn,arguments)},darken:function(){return this._applyModification(cn,arguments)},desaturate:function(){return this._applyModification(nn,arguments)},saturate:function(){return this._applyModification(rn,arguments)},greyscale:function(){return this._applyModification(an,arguments)},spin:function(){return this._applyModification(ln,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(pn,arguments)},complement:function(){return this._applyCombination(un,arguments)},monochromatic:function(){return this._applyCombination(mn,arguments)},splitcomplement:function(){return this._applyCombination(fn,arguments)},triad:function(){return this._applyCombination(dn,[3])},tetrad:function(){return this._applyCombination(dn,[4])}},K.fromRatio=function(e,n){if(Wt(e)==`object`){var r={};for(var i in e)e.hasOwnProperty(i)&&(i===`a`?r[i]=e[i]:r[i]=wn(e[i]));e=r}return K(e,n)};function qt(e){var n={r:0,g:0,b:0},r=1,i=null,a=null,o=null,s=!1,c=!1;return typeof e==`string`&&(e=kn(e)),Wt(e)==`object`&&(On(e.r)&&On(e.g)&&On(e.b)?(n=Jt(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):On(e.h)&&On(e.s)&&On(e.v)?(i=wn(e.s),a=wn(e.v),n=Qt(e.h,i,a),s=!0,c=`hsv`):On(e.h)&&On(e.s)&&On(e.l)&&(i=wn(e.s),o=wn(e.l),n=Xt(e.h,i,o),s=!0,c=`hsl`),e.hasOwnProperty(`a`)&&(r=e.a)),r=vn(r),{ok:s,format:e.format||c,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Jt(e,n,r){return{r:q(e,255)*255,g:q(n,255)*255,b:q(r,255)*255}}function Yt(e,n,r){e=q(e,255),n=q(n,255),r=q(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),o,s,c=(i+a)/2;if(i==a)o=s=0;else{var l=i-a;switch(s=c>.5?l/(2-i-a):l/(i+a),i){case e:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-e)/l+2;break;case r:o=(e-n)/l+4;break}o/=6}return{h:o,s,l:c}}function Xt(e,n,r){var i,a,o;e=q(e,360),n=q(n,100),r=q(r,100);function s(e,n,r){return r<0&&(r+=1),r>1&&--r,r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}if(n===0)i=a=o=r;else{var c=r<.5?r*(1+n):r+n-r*n,l=2*r-c;i=s(l,c,e+1/3),a=s(l,c,e),o=s(l,c,e-1/3)}return{r:i*255,g:a*255,b:o*255}}function Zt(e,n,r){e=q(e,255),n=q(n,255),r=q(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),o,s,c=i,l=i-a;if(s=i===0?0:l/i,i==a)o=0;else{switch(i){case e:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-e)/l+2;break;case r:o=(e-n)/l+4;break}o/=6}return{h:o,s,v:c}}function Qt(e,n,r){e=q(e,360)*6,n=q(n,100),r=q(r,100);var i=Math.floor(e),a=e-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=i%6,u=[r,s,o,o,c,r][l],d=[c,r,r,s,o,o][l],f=[o,o,c,r,r,s][l];return{r:u*255,g:d*255,b:f*255}}function $t(e,n,r,i){var a=[Cn(Math.round(e).toString(16)),Cn(Math.round(n).toString(16)),Cn(Math.round(r).toString(16))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join(``)}function en(e,n,r,i,a){var o=[Cn(Math.round(e).toString(16)),Cn(Math.round(n).toString(16)),Cn(Math.round(r).toString(16)),Cn(Tn(i))];return a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(``)}function tn(e,n,r,i){return[Cn(Tn(i)),Cn(Math.round(e).toString(16)),Cn(Math.round(n).toString(16)),Cn(Math.round(r).toString(16))].join(``)}K.equals=function(e,n){return!e||!n?!1:K(e).toRgbString()==K(n).toRgbString()},K.random=function(){return K.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function nn(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.s-=n/100,r.s=yn(r.s),K(r)}function rn(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.s+=n/100,r.s=yn(r.s),K(r)}function an(e){return K(e).desaturate(100)}function on(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.l+=n/100,r.l=yn(r.l),K(r)}function sn(e,n){n=n===0?0:n||10;var r=K(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),K(r)}function cn(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.l-=n/100,r.l=yn(r.l),K(r)}function ln(e,n){var r=K(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,K(r)}function un(e){var n=K(e).toHsl();return n.h=(n.h+180)%360,K(n)}function dn(e,n){if(isNaN(n)||n<=0)throw Error(`Argument to polyad must be a positive number`);for(var r=K(e).toHsl(),i=[K(e)],a=360/n,o=1;o<n;o++)i.push(K({h:(r.h+o*a)%360,s:r.s,l:r.l}));return i}function fn(e){var n=K(e).toHsl(),r=n.h;return[K(e),K({h:(r+72)%360,s:n.s,l:n.l}),K({h:(r+216)%360,s:n.s,l:n.l})]}function pn(e,n,r){n||=6,r||=30;var i=K(e).toHsl(),a=360/r,o=[K(e)];for(i.h=(i.h-(a*n>>1)+720)%360;--n;)i.h=(i.h+a)%360,o.push(K(i));return o}function mn(e,n){n||=6;for(var r=K(e).toHsv(),i=r.h,a=r.s,o=r.v,s=[],c=1/n;n--;)s.push(K({h:i,s:a,v:o})),o=(o+c)%1;return s}K.mix=function(e,n,r){r=r===0?0:r||50;var i=K(e).toRgb(),a=K(n).toRgb(),o=r/100;return K({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},K.readability=function(e,n){var r=K(e),i=K(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},K.isReadable=function(e,n,r){var i=K.readability(e,n),a,o=!1;switch(a=An(r),a.level+a.size){case`AAsmall`:case`AAAlarge`:o=i>=4.5;break;case`AAlarge`:o=i>=3;break;case`AAAsmall`:o=i>=7;break}return o},K.mostReadable=function(e,n,r){var i=null,a=0,o,s,c,l;r||={},s=r.includeFallbackColors,c=r.level,l=r.size;for(var u=0;u<n.length;u++)o=K.readability(e,n[u]),o>a&&(a=o,i=K(n[u]));return K.isReadable(e,i,{level:c,size:l})||!s?i:(r.includeFallbackColors=!1,K.mostReadable(e,[`#fff`,`#000`],r))};var hn=K.names={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`0ff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000`,blanchedalmond:`ffebcd`,blue:`00f`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,burntsienna:`ea7e5d`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`0ff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkgrey:`a9a9a9`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`f0f`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,grey:`808080`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgreen:`90ee90`,lightgrey:`d3d3d3`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`789`,lightslategrey:`789`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`0f0`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`f0f`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370db`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`db7093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`f00`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`fff`,whitesmoke:`f5f5f5`,yellow:`ff0`,yellowgreen:`9acd32`},gn=K.hexNames=_n(hn);function _n(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function vn(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function q(e,n){xn(e)&&(e=`100%`);var r=Sn(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function yn(e){return Math.min(1,Math.max(0,e))}function bn(e){return parseInt(e,16)}function xn(e){return typeof e==`string`&&e.indexOf(`.`)!=-1&&parseFloat(e)===1}function Sn(e){return typeof e==`string`&&e.indexOf(`%`)!=-1}function Cn(e){return e.length==1?`0`+e:``+e}function wn(e){return e<=1&&(e=e*100+`%`),e}function Tn(e){return Math.round(parseFloat(e)*255).toString(16)}function En(e){return bn(e)/255}var Dn=function(){var e=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,n=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`,r=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`;return{CSS_UNIT:new RegExp(e),rgb:RegExp(`rgb`+n),rgba:RegExp(`rgba`+r),hsl:RegExp(`hsl`+n),hsla:RegExp(`hsla`+r),hsv:RegExp(`hsv`+n),hsva:RegExp(`hsva`+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function On(e){return!!Dn.CSS_UNIT.exec(e)}function kn(e){e=e.replace(Gt,``).replace(Kt,``).toLowerCase();var n=!1;if(hn[e])e=hn[e],n=!0;else if(e==`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var r;return(r=Dn.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Dn.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Dn.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Dn.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Dn.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Dn.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Dn.hex8.exec(e))?{r:bn(r[1]),g:bn(r[2]),b:bn(r[3]),a:En(r[4]),format:n?`name`:`hex8`}:(r=Dn.hex6.exec(e))?{r:bn(r[1]),g:bn(r[2]),b:bn(r[3]),format:n?`name`:`hex`}:(r=Dn.hex4.exec(e))?{r:bn(r[1]+``+r[1]),g:bn(r[2]+``+r[2]),b:bn(r[3]+``+r[3]),a:En(r[4]+``+r[4]),format:n?`name`:`hex8`}:(r=Dn.hex3.exec(e))?{r:bn(r[1]+``+r[1]),g:bn(r[2]+``+r[2]),b:bn(r[3]+``+r[3]),format:n?`name`:`hex`}:!1}function An(e){var n,r;return e||={level:`AA`,size:`small`},n=(e.level||`AA`).toUpperCase(),r=(e.size||`small`).toLowerCase(),n!==`AA`&&n!==`AAA`&&(n=`AA`),r!==`small`&&r!==`large`&&(r=`small`),{level:n,size:r}}function jn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Mn(e){if(Array.isArray(e))return jn(e)}function Nn(e,n,r){if(typeof e==`function`?e===n:e.has(n))return arguments.length<3?n:r;throw TypeError(`Private element is not present on this object`)}function Pn(e,n){if(n.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function Fn(e,n){if(!(e instanceof n))throw TypeError(`Cannot call a class as a function`)}function In(e,n){return e.get(Nn(e,n))}function Ln(e,n,r){Pn(e,n),n.set(e,r)}function Rn(e,n,r){return e.set(Nn(e,n),r),r}function zn(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,`value`in i&&(i.writable=!0),Object.defineProperty(e,Gn(i.key),i)}}function Bn(e,n,r){return n&&zn(e.prototype,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Vn(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Hn(){throw TypeError(`Invalid attempt to spread non-iterable instance.
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{at as n,n as r,st as i}from"./DocumentContext-BjkX60te.js";import{t as a}from"./react-JNybMug3.js";import{n as o,r as s}from"./dist-DBENJeML.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{s as l,t as u}from"./createLucideIcon-BUb14crZ.js";import{t as d}from"./button-DHE6Sx02.js";import{Et as f,It as p,Mr as m,Rr as h,Yt as g,qr as _}from"./dist-C6nSogV9.js";import{h as v,r as y,t as b}from"./PropertyPanel-DQ9GHyDu.js";import{c as x,i as ee,s as S}from"./workspace-paths-CS1BfvNO.js";import{a as C,t as w}from"./open-managed-artifact-tab-ZPlXuFu4.js";import{n as T}from"./dist-DwCd6eR-.js";import{t as te}from"./input-CsXmpyZP.js";import{t as ne}from"./textarea-DwJR-19i.js";import{c as E,s as D}from"./skills-api-Bww6-eOu.js";var re=u(`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`}]]),O=c(),k=e(a(),1),A=t(),j=[`name`];function M(e){let t=(0,O.c)(46),{provider:n,name:r,scopeControl:i,onRename:a,nameError:c,onNameDraftChange:u,nameEditable:p}=e,m=p===void 0?!0:p,{_:h}=s(),g=(0,k.useId)(),_=(0,k.useId)(),y=x(),[S,C]=(0,k.useState)(r),w,T;t[0]===r?(w=t[1],T=t[2]):(w=()=>C(r),T=[r],t[0]=r,t[1]=w,t[2]=T),(0,k.useEffect)(w,T);let ne,E;t[3]===S?(ne=t[4],E=t[5]):(E=S.trim(),ne=E!==``&&!f.test(E),t[3]=S,t[4]=ne,t[5]=E);let D=ne,M;t[6]!==r||t[7]!==D||t[8]!==a||t[9]!==E?(M=function(){a&&(D||E===``||E===r||a(E))},t[6]=r,t[7]=D,t[8]=a,t[9]=E,t[10]=M):M=t[10];let F=M,I=D||!!c,L;t[11]!==h||t[12]!==i||t[13]!==_||t[14]!==y?(L=i?(0,A.jsx)(P,{icon:(0,A.jsx)(re,{className:`size-3.5`}),label:h({id:`oCHfGC`}),htmlFor:_,children:(0,A.jsxs)(`fieldset`,{id:_,className:`m-0 inline-flex items-center gap-1 rounded-full border-0 bg-muted/60 p-0.5`,children:[(0,A.jsx)(`legend`,{className:`sr-only`,children:h({id:`KszKI_`})}),ee.map(e=>{let t=i.scope===e;return(0,A.jsx)(d,{type:`button`,"aria-pressed":t,variant:`ghost`,size:`sm`,onClick:()=>{t||i.onScopeChange(e)},className:l(`h-6 rounded-full px-3 text-xs font-medium`,t?e===`global`?`bg-violet-700 text-white hover:bg-violet-700 hover:text-white`:`bg-sky-700 text-white hover:bg-sky-700 hover:text-white`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),children:y[e]},e)})]})}):null,t[11]=h,t[12]=i,t[13]=_,t[14]=y,t[15]=L):L=t[15];let ie;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,A.jsx)(v,{className:`size-3.5`}),t[16]=ie):ie=t[16];let R;t[17]===h?R=t[18]:(R=h({id:`XmJfZT`}),t[17]=h,t[18]=R);let z=!m,B;t[19]===u?B=t[20]:(B=e=>{let t=e.target.value;C(t),u?.(t)},t[19]=u,t[20]=B);let V=I?`${g}-error`:void 0,H;t[21]!==F||t[22]!==S||t[23]!==g||t[24]!==I||t[25]!==B||t[26]!==V||t[27]!==z?(H=(0,A.jsx)(te,{id:g,"data-testid":`skill-name-input`,value:S,readOnly:z,onChange:B,onBlur:F,onKeyDown:N,"aria-invalid":I,"aria-describedby":V,className:`h-7 rounded-sm border-transparent bg-transparent px-2 font-mono text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 dark:bg-transparent`}),t[21]=F,t[22]=S,t[23]=g,t[24]=I,t[25]=B,t[26]=V,t[27]=z,t[28]=H):H=t[28];let U;t[29]!==c||t[30]!==g||t[31]!==I?(U=I?(0,A.jsx)(`p`,{id:`${g}-error`,className:`px-1 pt-0.5 text-[11px] text-destructive`,children:c||(0,A.jsx)(o,{id:`A50vr3`,components:{0:(0,A.jsx)(`code`,{className:`font-mono`})}})}):(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,A.jsx)(o,{id:`1hvhf0`})}),t[29]=c,t[30]=g,t[31]=I,t[32]=U):U=t[32];let W;t[33]!==g||t[34]!==H||t[35]!==U||t[36]!==R?(W=(0,A.jsxs)(P,{icon:ie,label:R,htmlFor:g,children:[H,U]}),t[33]=g,t[34]=H,t[35]=U,t[36]=R,t[37]=W):W=t[37];let G;t[38]!==W||t[39]!==L?(G=(0,A.jsxs)(`div`,{className:`editor-content-aligned gap-0.5 pt-4`,children:[L,W]}),t[38]=W,t[39]=L,t[40]=G):G=t[40];let K;t[41]===n?K=t[42]:(K=(0,A.jsx)(b,{provider:n,reservedKeys:j}),t[41]=n,t[42]=K);let q;return t[43]!==G||t[44]!==K?(q=(0,A.jsxs)(`div`,{className:`flex flex-col`,children:[G,K]}),t[43]=G,t[44]=K,t[45]=q):q=t[45],q}function N(e){e.key===`Enter`&&e.currentTarget.blur()}function P(e){let t=(0,O.c)(14),{icon:n,label:r,htmlFor:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,A.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,A.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center text-muted-foreground`,children:n}),t[1]=n,t[2]=s);let c;t[3]!==i||t[4]!==r?(c=(0,A.jsx)(`label`,{htmlFor:i,className:`flex h-7 w-32 shrink-0 items-center truncate px-2 text-sm text-muted-foreground`,children:r}),t[3]=i,t[4]=r,t[5]=c):c=t[5];let l;t[6]!==s||t[7]!==c?(l=(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,A.jsx)(`div`,{className:`min-w-0 flex-1`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==l||t[12]!==u?(d=(0,A.jsxs)(`div`,{className:`flex items-start gap-1 py-0.5`,children:[o,l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function F(e,t){let n=e.current().map[t];return typeof n==`string`?n:``}function I(e,t){let n=(0,O.c)(15),[r,i]=(0,k.useState)(null),a;n[0]!==t||n[1]!==e?(a=()=>{let n=g(e),r=F(n,t);return n.dispose(),r},n[0]=t,n[1]=e,n[2]=a):a=n[2];let[o,s]=(0,k.useState)(a),c=(0,k.useRef)(!1),l,u;n[3]!==t||n[4]!==e?(l=()=>{let n=g(e);i(n),s(F(n,t));let r=n.subscribe(()=>{c.current||s(F(n,t))});return()=>{r(),n.dispose(),i(e=>e===n?null:e)}},u=[e,t],n[3]=t,n[4]=e,n[5]=l,n[6]=u):(l=n[5],u=n[6]),(0,k.useEffect)(l,u);let d;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{c.current=!0},n[7]=d):d=n[7];let f;n[8]!==r||n[9]!==t||n[10]!==o?(f=()=>{c.current=!1,r&&o!==F(r,t)&&r.patch({[t]:o})},n[8]=r,n[9]=t,n[10]=o,n[11]=f):f=n[11];let p;return n[12]!==f||n[13]!==o?(p={value:o,setValue:s,onFocus:d,onBlur:f},n[12]=f,n[13]=o,n[14]=p):p=n[14],p}function L(e){let t=(0,O.c)(76),{provider:n,name:r,folder:i,onRename:a,nameError:c}=e,{_:l}=s(),u=(0,k.useId)(),d=(0,k.useId)(),f=(0,k.useId)(),m=(0,k.useId)(),h=I(n,`title`),g=I(n,`description`),[_,b]=(0,k.useState)(r),x,ee;t[0]===r?(x=t[1],ee=t[2]):(x=()=>b(r),ee=[r],t[0]=r,t[1]=x,t[2]=ee),(0,k.useEffect)(x,ee);let S,C;t[3]===_?(S=t[4],C=t[5]):(C=_.trim(),S=C!==``&&!p.test(C),t[3]=_,t[4]=S,t[5]=C);let w=S,T;t[6]!==r||t[7]!==w||t[8]!==a||t[9]!==C?(T=function(){a&&(w||C===``||C===r||a(C))},t[6]=r,t[7]=w,t[8]=a,t[9]=C,t[10]=T):T=t[10];let E=T,D=w||!!c,j;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,A.jsx)(o,{id:`l_UFPv`}),t[11]=j):j=t[11];let M;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,A.jsx)(re,{className:`size-3.5`}),t[12]=M):M=t[12];let N;t[13]===l?N=t[14]:(N=l({id:`ugoTXs`}),t[13]=l,t[14]=N);let P=i||`/`,F;t[15]!==m||t[16]!==P?(F=(0,A.jsx)(te,{id:m,value:P,readOnly:!0,className:`h-8 border-input bg-transparent px-2 font-mono text-muted-foreground shadow-none`}),t[15]=m,t[16]=P,t[17]=F):F=t[17];let L;t[18]!==m||t[19]!==N||t[20]!==F?(L=(0,A.jsx)(R,{icon:M,label:N,htmlFor:m,children:F}),t[18]=m,t[19]=N,t[20]=F,t[21]=L):L=t[21];let z;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,A.jsx)(v,{className:`size-3.5`}),t[22]=z):z=t[22];let B;t[23]===l?B=t[24]:(B=l({id:`XmJfZT`}),t[23]=l,t[24]=B);let V;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>b(e.target.value),t[25]=V):V=t[25];let H;t[26]!==E||t[27]!==_||t[28]!==u||t[29]!==D?(H=(0,A.jsx)(te,{id:u,"data-testid":`template-name-input`,value:_,onChange:V,onBlur:E,onKeyDown:ie,"aria-invalid":D,className:`h-8 border-input bg-transparent px-2 font-mono shadow-none focus-visible:bg-muted/30`}),t[26]=E,t[27]=_,t[28]=u,t[29]=D,t[30]=H):H=t[30];let U;t[31]!==c||t[32]!==D?(U=D?(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-destructive`,children:c||(0,A.jsx)(o,{id:`lI0Td2`,components:{0:(0,A.jsx)(`code`,{className:`font-mono`}),1:(0,A.jsx)(`code`,{className:`font-mono`})}})}):(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,A.jsx)(o,{id:`QfFBdJ`})}),t[31]=c,t[32]=D,t[33]=U):U=t[33];let W;t[34]!==u||t[35]!==B||t[36]!==H||t[37]!==U?(W=(0,A.jsxs)(R,{icon:z,label:B,htmlFor:u,children:[H,U]}),t[34]=u,t[35]=B,t[36]=H,t[37]=U,t[38]=W):W=t[38];let G;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,A.jsx)(v,{className:`size-3.5`}),t[39]=G):G=t[39];let K;t[40]===l?K=t[41]:(K=l({id:`q7F5am`}),t[40]=l,t[41]=K);let q;t[42]===h?q=t[43]:(q=e=>h.setValue(e.target.value),t[42]=h,t[43]=q);let J;t[44]!==q||t[45]!==h.onBlur||t[46]!==h.onFocus||t[47]!==h.value||t[48]!==d?(J=(0,A.jsx)(te,{id:d,"data-testid":`template-title-input`,value:h.value,onChange:q,onFocus:h.onFocus,onBlur:h.onBlur,className:`h-8 border-input bg-transparent px-2 shadow-none focus-visible:bg-muted/30`}),t[44]=q,t[45]=h.onBlur,t[46]=h.onFocus,t[47]=h.value,t[48]=d,t[49]=J):J=t[49];let ae;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,A.jsx)(o,{id:`5e1Dri`})}),t[50]=ae):ae=t[50];let Y;t[51]!==K||t[52]!==J||t[53]!==d?(Y=(0,A.jsxs)(R,{icon:G,label:K,htmlFor:d,children:[J,ae]}),t[51]=K,t[52]=J,t[53]=d,t[54]=Y):Y=t[54];let oe;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,A.jsx)(v,{className:`size-3.5`}),t[55]=oe):oe=t[55];let X;t[56]===l?X=t[57]:(X=l({id:`eTsJYJ`}),t[56]=l,t[57]=X);let Z;t[58]===g?Z=t[59]:(Z=e=>g.setValue(e.target.value),t[58]=g,t[59]=Z);let Q;t[60]!==g.onBlur||t[61]!==g.onFocus||t[62]!==g.value||t[63]!==f||t[64]!==Z?(Q=(0,A.jsx)(ne,{id:f,"data-testid":`template-description-input`,value:g.value,onChange:Z,onFocus:g.onFocus,onBlur:g.onBlur,className:`min-h-16 resize-none border-input bg-transparent px-2 py-1.5 shadow-none focus-visible:bg-muted/30`}),t[60]=g.onBlur,t[61]=g.onFocus,t[62]=g.value,t[63]=f,t[64]=Z,t[65]=Q):Q=t[65];let se;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,A.jsx)(o,{id:`sFhaTJ`})}),t[66]=se):se=t[66];let $;t[67]!==f||t[68]!==X||t[69]!==Q?($=(0,A.jsxs)(R,{icon:oe,label:X,htmlFor:f,children:[Q,se]}),t[67]=f,t[68]=X,t[69]=Q,t[70]=$):$=t[70];let ce;return t[71]!==L||t[72]!==W||t[73]!==Y||t[74]!==$?(ce=(0,A.jsxs)(y,{title:j,className:`pt-4 pb-2`,children:[L,W,Y,$]}),t[71]=L,t[72]=W,t[73]=Y,t[74]=$,t[75]=ce):ce=t[75],ce}function ie(e){e.key===`Enter`&&e.currentTarget.blur()}function R(e){let t=(0,O.c)(13),{icon:n,label:r,htmlFor:i,children:a}=e,o;t[0]===n?o=t[1]:(o=(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:n}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,A.jsx)(`span`,{className:`truncate text-muted-foreground`,children:r}),t[2]=r,t[3]=s);let c;t[4]!==i||t[5]!==o||t[6]!==s?(c=(0,A.jsxs)(`label`,{htmlFor:i,className:`flex w-32 shrink-0 items-center gap-1 pt-1.5`,children:[o,s]}),t[4]=i,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;t[8]===a?l=t[9]:(l=(0,A.jsx)(`div`,{className:`min-w-0 flex-1`,children:a}),t[8]=a,t[9]=l);let u;return t[10]!==c||t[11]!==l?(u=(0,A.jsxs)(`div`,{className:`flex items-start gap-1 py-0.5`,children:[c,l]}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function z(e){let t=(0,O.c)(18),{docName:r,provider:i}=e,a;t[0]===r?a=t[1]:(a=m(r),t[0]=r,t[1]=a);let o=a;if(o?.kind===`skill`){let e;return t[2]!==r||t[3]!==o.name||t[4]!==o.scope||t[5]!==i?(e=(0,A.jsx)(V,{provider:i,docName:r,scope:o.scope,name:o.name}),t[2]=r,t[3]=o.name,t[4]=o.scope,t[5]=i,t[6]=e):e=t[6],e}if(o?.kind===`template`){let e;return t[7]!==r||t[8]!==o.folder||t[9]!==o.name||t[10]!==i?(e=(0,A.jsx)(U,{provider:i,docName:r,folder:o.folder,name:o.name}),t[7]=r,t[8]=o.folder,t[9]=o.name,t[10]=i,t[11]=e):e=t[11],e}let s;t[12]===r?s=t[13]:(s=n(r),t[12]=r,t[13]=s);let c=s;if(c){let e;return t[14]!==r||t[15]!==c||t[16]!==i?(e=(0,A.jsx)(H,{provider:i,docName:r,name:c}),t[14]=r,t[15]=c,t[16]=i,t[17]=e):e=t[17],e}return null}function B(){let e=(0,O.c)(2),{closeDocument:t}=r(),n;return e[0]===t?n=e[1]:(n=(e,n)=>{e!==n&&(w(n),t(e))},e[0]=t,e[1]=n),n}function V(e){let t=(0,O.c)(24),{provider:n,docName:r,scope:i,name:a}=e,{_:o}=s(),c=S(),l=B(),[u,d]=(0,k.useState)(null),[f,p]=(0,k.useState)(!1),m;t[0]!==o||t[1]!==r||t[2]!==a||t[3]!==l||t[4]!==i?(m=async function(e){d(null);let t=await D({scope:i,fromName:a,toName:e});if(!t.ok){d(t.error),T.error(o({id:`sHrqDx`,values:{0:t.error}}));return}T.success(o({id:`_hPpdX`})),l(r,_(i,e))},t[0]=o,t[1]=r,t[2]=a,t[3]=l,t[4]=i,t[5]=m):m=t[5];let h=m,g;t[6]!==o||t[7]!==r||t[8]!==f||t[9]!==a||t[10]!==l||t[11]!==i||t[12]!==c?(g=async function(e){if(e===i||f)return;p(!0);let t=await E({name:a,fromScope:i,toScope:e});if(p(!1),!t.ok){T.error(o({id:`07eGJB`,values:{0:t.error}}));return}let n=t.skippedBinaryFiles?.length??0;n>0?T.warning(o({id:`DhK_hZ`,values:{0:c[e],name:a,skipped:n}})):T.success(o({id:`UQMMvx`,values:{0:c[e],name:a}})),l(r,_(e,a))},t[6]=o,t[7]=r,t[8]=f,t[9]=a,t[10]=l,t[11]=i,t[12]=c,t[13]=g):g=t[13];let v=g,y=!f,b;t[14]!==v||t[15]!==i?(b={scope:i,onScopeChange:v},t[14]=v,t[15]=i,t[16]=b):b=t[16];let x;return t[17]!==h||t[18]!==a||t[19]!==n||t[20]!==u||t[21]!==y||t[22]!==b?(x=(0,A.jsx)(M,{provider:n,name:a,onRename:h,nameError:u,nameEditable:y,scopeControl:b}),t[17]=h,t[18]=a,t[19]=n,t[20]=u,t[21]=y,t[22]=b,t[23]=x):x=t[23],x}function H(e){let t=(0,O.c)(21),{provider:n,docName:r,name:i}=e,{_:a}=s(),o=S(),c=B(),[l,u]=(0,k.useState)(null),[d,f]=(0,k.useState)(!1),p;t[0]!==a||t[1]!==r||t[2]!==i||t[3]!==c?(p=async function(e){u(null);let t=await D({scope:`project`,fromName:i,toName:e});if(!t.ok){u(t.error),T.error(a({id:`sHrqDx`,values:{0:t.error}}));return}T.success(a({id:`_hPpdX`})),c(r,h(e))},t[0]=a,t[1]=r,t[2]=i,t[3]=c,t[4]=p):p=t[4];let m=p,g;t[5]!==a||t[6]!==r||t[7]!==d||t[8]!==i||t[9]!==c||t[10]!==o?(g=async function(e){if(e===`project`||d)return;f(!0);let t=await E({name:i,fromScope:`project`,toScope:e});if(f(!1),!t.ok){T.error(a({id:`07eGJB`,values:{0:t.error}}));return}let n=t.skippedBinaryFiles?.length??0;n>0?T.warning(a({id:`DhK_hZ`,values:{0:o[e],name:i,skipped:n}})):T.success(a({id:`UQMMvx`,values:{0:o[e],name:i}})),c(r,_(e,i))},t[5]=a,t[6]=r,t[7]=d,t[8]=i,t[9]=c,t[10]=o,t[11]=g):g=t[11];let v=g,y=!d,b;t[12]===v?b=t[13]:(b={scope:`project`,onScopeChange:v},t[12]=v,t[13]=b);let x;return t[14]!==m||t[15]!==i||t[16]!==n||t[17]!==l||t[18]!==y||t[19]!==b?(x=(0,A.jsx)(M,{provider:n,name:i,onRename:m,nameError:l,nameEditable:y,scopeControl:b}),t[14]=m,t[15]=i,t[16]=n,t[17]=l,t[18]=y,t[19]=b,t[20]=x):x=t[20],x}function U(e){let t=(0,O.c)(12),{provider:n,docName:r,folder:a,name:o}=e,{_:c}=s(),l=B(),[u,d]=(0,k.useState)(null),f;t[0]!==c||t[1]!==r||t[2]!==a||t[3]!==o||t[4]!==l?(f=async function(e){d(null);let t=await C({fromFolder:a,fromName:o,toFolder:a,toName:e});if(!t.ok){d(t.error),T.error(c({id:`gk_-qj`,values:{0:t.error}}));return}T.success(c({id:`YKLP_-`})),l(r,i(a,e))},t[0]=c,t[1]=r,t[2]=a,t[3]=o,t[4]=l,t[5]=f):f=t[5];let p=f,m;return t[6]!==a||t[7]!==p||t[8]!==o||t[9]!==n||t[10]!==u?(m=(0,A.jsx)(L,{provider:n,name:o,folder:a,onRename:p,nameError:u}),t[6]=a,t[7]=p,t[8]=o,t[9]=n,t[10]=u,t[11]=m):m=t[11],m}export{z as ManagedArtifactProperties};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{at as n,n as r,st as i}from"./DocumentContext-CPZffvoA.js";import{t as a}from"./react-JNybMug3.js";import{n as o,r as s}from"./dist-DBENJeML.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{s as l,t as u}from"./createLucideIcon-BUb14crZ.js";import{t as d}from"./button-DHE6Sx02.js";import{Et as f,It as p,Mr as m,Rr as h,Yt as g,qr as _}from"./dist-Vm1kQiqo.js";import{h as v,r as y,t as b}from"./PropertyPanel-CpcpWkfS.js";import{c as x,i as ee,s as S}from"./workspace-paths-B_ozK4P-.js";import{a as C,t as w}from"./open-managed-artifact-tab-ze9HkqWn.js";import{n as T}from"./dist-DwCd6eR-.js";import{t as te}from"./input-CsXmpyZP.js";import{t as ne}from"./textarea-DwJR-19i.js";import{c as E,s as D}from"./skills-api-CYoD9FQt.js";var re=u(`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`}]]),O=c(),k=e(a(),1),A=t(),j=[`name`];function M(e){let t=(0,O.c)(46),{provider:n,name:r,scopeControl:i,onRename:a,nameError:c,onNameDraftChange:u,nameEditable:p}=e,m=p===void 0?!0:p,{_:h}=s(),g=(0,k.useId)(),_=(0,k.useId)(),y=x(),[S,C]=(0,k.useState)(r),w,T;t[0]===r?(w=t[1],T=t[2]):(w=()=>C(r),T=[r],t[0]=r,t[1]=w,t[2]=T),(0,k.useEffect)(w,T);let ne,E;t[3]===S?(ne=t[4],E=t[5]):(E=S.trim(),ne=E!==``&&!f.test(E),t[3]=S,t[4]=ne,t[5]=E);let D=ne,M;t[6]!==r||t[7]!==D||t[8]!==a||t[9]!==E?(M=function(){a&&(D||E===``||E===r||a(E))},t[6]=r,t[7]=D,t[8]=a,t[9]=E,t[10]=M):M=t[10];let F=M,I=D||!!c,L;t[11]!==h||t[12]!==i||t[13]!==_||t[14]!==y?(L=i?(0,A.jsx)(P,{icon:(0,A.jsx)(re,{className:`size-3.5`}),label:h({id:`oCHfGC`}),htmlFor:_,children:(0,A.jsxs)(`fieldset`,{id:_,className:`m-0 inline-flex items-center gap-1 rounded-full border-0 bg-muted/60 p-0.5`,children:[(0,A.jsx)(`legend`,{className:`sr-only`,children:h({id:`KszKI_`})}),ee.map(e=>{let t=i.scope===e;return(0,A.jsx)(d,{type:`button`,"aria-pressed":t,variant:`ghost`,size:`sm`,onClick:()=>{t||i.onScopeChange(e)},className:l(`h-6 rounded-full px-3 text-xs font-medium`,t?e===`global`?`bg-violet-700 text-white hover:bg-violet-700 hover:text-white`:`bg-sky-700 text-white hover:bg-sky-700 hover:text-white`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),children:y[e]},e)})]})}):null,t[11]=h,t[12]=i,t[13]=_,t[14]=y,t[15]=L):L=t[15];let ie;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,A.jsx)(v,{className:`size-3.5`}),t[16]=ie):ie=t[16];let R;t[17]===h?R=t[18]:(R=h({id:`XmJfZT`}),t[17]=h,t[18]=R);let z=!m,B;t[19]===u?B=t[20]:(B=e=>{let t=e.target.value;C(t),u?.(t)},t[19]=u,t[20]=B);let V=I?`${g}-error`:void 0,H;t[21]!==F||t[22]!==S||t[23]!==g||t[24]!==I||t[25]!==B||t[26]!==V||t[27]!==z?(H=(0,A.jsx)(te,{id:g,"data-testid":`skill-name-input`,value:S,readOnly:z,onChange:B,onBlur:F,onKeyDown:N,"aria-invalid":I,"aria-describedby":V,className:`h-7 rounded-sm border-transparent bg-transparent px-2 font-mono text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 dark:bg-transparent`}),t[21]=F,t[22]=S,t[23]=g,t[24]=I,t[25]=B,t[26]=V,t[27]=z,t[28]=H):H=t[28];let U;t[29]!==c||t[30]!==g||t[31]!==I?(U=I?(0,A.jsx)(`p`,{id:`${g}-error`,className:`px-1 pt-0.5 text-[11px] text-destructive`,children:c||(0,A.jsx)(o,{id:`A50vr3`,components:{0:(0,A.jsx)(`code`,{className:`font-mono`})}})}):(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,A.jsx)(o,{id:`1hvhf0`})}),t[29]=c,t[30]=g,t[31]=I,t[32]=U):U=t[32];let W;t[33]!==g||t[34]!==H||t[35]!==U||t[36]!==R?(W=(0,A.jsxs)(P,{icon:ie,label:R,htmlFor:g,children:[H,U]}),t[33]=g,t[34]=H,t[35]=U,t[36]=R,t[37]=W):W=t[37];let G;t[38]!==W||t[39]!==L?(G=(0,A.jsxs)(`div`,{className:`editor-content-aligned gap-0.5 pt-4`,children:[L,W]}),t[38]=W,t[39]=L,t[40]=G):G=t[40];let K;t[41]===n?K=t[42]:(K=(0,A.jsx)(b,{provider:n,reservedKeys:j}),t[41]=n,t[42]=K);let q;return t[43]!==G||t[44]!==K?(q=(0,A.jsxs)(`div`,{className:`flex flex-col`,children:[G,K]}),t[43]=G,t[44]=K,t[45]=q):q=t[45],q}function N(e){e.key===`Enter`&&e.currentTarget.blur()}function P(e){let t=(0,O.c)(14),{icon:n,label:r,htmlFor:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,A.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,A.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center text-muted-foreground`,children:n}),t[1]=n,t[2]=s);let c;t[3]!==i||t[4]!==r?(c=(0,A.jsx)(`label`,{htmlFor:i,className:`flex h-7 w-32 shrink-0 items-center truncate px-2 text-sm text-muted-foreground`,children:r}),t[3]=i,t[4]=r,t[5]=c):c=t[5];let l;t[6]!==s||t[7]!==c?(l=(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,A.jsx)(`div`,{className:`min-w-0 flex-1`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==l||t[12]!==u?(d=(0,A.jsxs)(`div`,{className:`flex items-start gap-1 py-0.5`,children:[o,l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function F(e,t){let n=e.current().map[t];return typeof n==`string`?n:``}function I(e,t){let n=(0,O.c)(15),[r,i]=(0,k.useState)(null),a;n[0]!==t||n[1]!==e?(a=()=>{let n=g(e),r=F(n,t);return n.dispose(),r},n[0]=t,n[1]=e,n[2]=a):a=n[2];let[o,s]=(0,k.useState)(a),c=(0,k.useRef)(!1),l,u;n[3]!==t||n[4]!==e?(l=()=>{let n=g(e);i(n),s(F(n,t));let r=n.subscribe(()=>{c.current||s(F(n,t))});return()=>{r(),n.dispose(),i(e=>e===n?null:e)}},u=[e,t],n[3]=t,n[4]=e,n[5]=l,n[6]=u):(l=n[5],u=n[6]),(0,k.useEffect)(l,u);let d;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{c.current=!0},n[7]=d):d=n[7];let f;n[8]!==r||n[9]!==t||n[10]!==o?(f=()=>{c.current=!1,r&&o!==F(r,t)&&r.patch({[t]:o})},n[8]=r,n[9]=t,n[10]=o,n[11]=f):f=n[11];let p;return n[12]!==f||n[13]!==o?(p={value:o,setValue:s,onFocus:d,onBlur:f},n[12]=f,n[13]=o,n[14]=p):p=n[14],p}function L(e){let t=(0,O.c)(76),{provider:n,name:r,folder:i,onRename:a,nameError:c}=e,{_:l}=s(),u=(0,k.useId)(),d=(0,k.useId)(),f=(0,k.useId)(),m=(0,k.useId)(),h=I(n,`title`),g=I(n,`description`),[_,b]=(0,k.useState)(r),x,ee;t[0]===r?(x=t[1],ee=t[2]):(x=()=>b(r),ee=[r],t[0]=r,t[1]=x,t[2]=ee),(0,k.useEffect)(x,ee);let S,C;t[3]===_?(S=t[4],C=t[5]):(C=_.trim(),S=C!==``&&!p.test(C),t[3]=_,t[4]=S,t[5]=C);let w=S,T;t[6]!==r||t[7]!==w||t[8]!==a||t[9]!==C?(T=function(){a&&(w||C===``||C===r||a(C))},t[6]=r,t[7]=w,t[8]=a,t[9]=C,t[10]=T):T=t[10];let E=T,D=w||!!c,j;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,A.jsx)(o,{id:`l_UFPv`}),t[11]=j):j=t[11];let M;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,A.jsx)(re,{className:`size-3.5`}),t[12]=M):M=t[12];let N;t[13]===l?N=t[14]:(N=l({id:`ugoTXs`}),t[13]=l,t[14]=N);let P=i||`/`,F;t[15]!==m||t[16]!==P?(F=(0,A.jsx)(te,{id:m,value:P,readOnly:!0,className:`h-8 border-input bg-transparent px-2 font-mono text-muted-foreground shadow-none`}),t[15]=m,t[16]=P,t[17]=F):F=t[17];let L;t[18]!==m||t[19]!==N||t[20]!==F?(L=(0,A.jsx)(R,{icon:M,label:N,htmlFor:m,children:F}),t[18]=m,t[19]=N,t[20]=F,t[21]=L):L=t[21];let z;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,A.jsx)(v,{className:`size-3.5`}),t[22]=z):z=t[22];let B;t[23]===l?B=t[24]:(B=l({id:`XmJfZT`}),t[23]=l,t[24]=B);let V;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>b(e.target.value),t[25]=V):V=t[25];let H;t[26]!==E||t[27]!==_||t[28]!==u||t[29]!==D?(H=(0,A.jsx)(te,{id:u,"data-testid":`template-name-input`,value:_,onChange:V,onBlur:E,onKeyDown:ie,"aria-invalid":D,className:`h-8 border-input bg-transparent px-2 font-mono shadow-none focus-visible:bg-muted/30`}),t[26]=E,t[27]=_,t[28]=u,t[29]=D,t[30]=H):H=t[30];let U;t[31]!==c||t[32]!==D?(U=D?(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-destructive`,children:c||(0,A.jsx)(o,{id:`lI0Td2`,components:{0:(0,A.jsx)(`code`,{className:`font-mono`}),1:(0,A.jsx)(`code`,{className:`font-mono`})}})}):(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,A.jsx)(o,{id:`QfFBdJ`})}),t[31]=c,t[32]=D,t[33]=U):U=t[33];let W;t[34]!==u||t[35]!==B||t[36]!==H||t[37]!==U?(W=(0,A.jsxs)(R,{icon:z,label:B,htmlFor:u,children:[H,U]}),t[34]=u,t[35]=B,t[36]=H,t[37]=U,t[38]=W):W=t[38];let G;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,A.jsx)(v,{className:`size-3.5`}),t[39]=G):G=t[39];let K;t[40]===l?K=t[41]:(K=l({id:`q7F5am`}),t[40]=l,t[41]=K);let q;t[42]===h?q=t[43]:(q=e=>h.setValue(e.target.value),t[42]=h,t[43]=q);let J;t[44]!==q||t[45]!==h.onBlur||t[46]!==h.onFocus||t[47]!==h.value||t[48]!==d?(J=(0,A.jsx)(te,{id:d,"data-testid":`template-title-input`,value:h.value,onChange:q,onFocus:h.onFocus,onBlur:h.onBlur,className:`h-8 border-input bg-transparent px-2 shadow-none focus-visible:bg-muted/30`}),t[44]=q,t[45]=h.onBlur,t[46]=h.onFocus,t[47]=h.value,t[48]=d,t[49]=J):J=t[49];let ae;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,A.jsx)(o,{id:`5e1Dri`})}),t[50]=ae):ae=t[50];let Y;t[51]!==K||t[52]!==J||t[53]!==d?(Y=(0,A.jsxs)(R,{icon:G,label:K,htmlFor:d,children:[J,ae]}),t[51]=K,t[52]=J,t[53]=d,t[54]=Y):Y=t[54];let oe;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,A.jsx)(v,{className:`size-3.5`}),t[55]=oe):oe=t[55];let X;t[56]===l?X=t[57]:(X=l({id:`eTsJYJ`}),t[56]=l,t[57]=X);let Z;t[58]===g?Z=t[59]:(Z=e=>g.setValue(e.target.value),t[58]=g,t[59]=Z);let Q;t[60]!==g.onBlur||t[61]!==g.onFocus||t[62]!==g.value||t[63]!==f||t[64]!==Z?(Q=(0,A.jsx)(ne,{id:f,"data-testid":`template-description-input`,value:g.value,onChange:Z,onFocus:g.onFocus,onBlur:g.onBlur,className:`min-h-16 resize-none border-input bg-transparent px-2 py-1.5 shadow-none focus-visible:bg-muted/30`}),t[60]=g.onBlur,t[61]=g.onFocus,t[62]=g.value,t[63]=f,t[64]=Z,t[65]=Q):Q=t[65];let se;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,A.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,A.jsx)(o,{id:`sFhaTJ`})}),t[66]=se):se=t[66];let $;t[67]!==f||t[68]!==X||t[69]!==Q?($=(0,A.jsxs)(R,{icon:oe,label:X,htmlFor:f,children:[Q,se]}),t[67]=f,t[68]=X,t[69]=Q,t[70]=$):$=t[70];let ce;return t[71]!==L||t[72]!==W||t[73]!==Y||t[74]!==$?(ce=(0,A.jsxs)(y,{title:j,className:`pt-4 pb-2`,children:[L,W,Y,$]}),t[71]=L,t[72]=W,t[73]=Y,t[74]=$,t[75]=ce):ce=t[75],ce}function ie(e){e.key===`Enter`&&e.currentTarget.blur()}function R(e){let t=(0,O.c)(13),{icon:n,label:r,htmlFor:i,children:a}=e,o;t[0]===n?o=t[1]:(o=(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:n}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,A.jsx)(`span`,{className:`truncate text-muted-foreground`,children:r}),t[2]=r,t[3]=s);let c;t[4]!==i||t[5]!==o||t[6]!==s?(c=(0,A.jsxs)(`label`,{htmlFor:i,className:`flex w-32 shrink-0 items-center gap-1 pt-1.5`,children:[o,s]}),t[4]=i,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;t[8]===a?l=t[9]:(l=(0,A.jsx)(`div`,{className:`min-w-0 flex-1`,children:a}),t[8]=a,t[9]=l);let u;return t[10]!==c||t[11]!==l?(u=(0,A.jsxs)(`div`,{className:`flex items-start gap-1 py-0.5`,children:[c,l]}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function z(e){let t=(0,O.c)(18),{docName:r,provider:i}=e,a;t[0]===r?a=t[1]:(a=m(r),t[0]=r,t[1]=a);let o=a;if(o?.kind===`skill`){let e;return t[2]!==r||t[3]!==o.name||t[4]!==o.scope||t[5]!==i?(e=(0,A.jsx)(V,{provider:i,docName:r,scope:o.scope,name:o.name}),t[2]=r,t[3]=o.name,t[4]=o.scope,t[5]=i,t[6]=e):e=t[6],e}if(o?.kind===`template`){let e;return t[7]!==r||t[8]!==o.folder||t[9]!==o.name||t[10]!==i?(e=(0,A.jsx)(U,{provider:i,docName:r,folder:o.folder,name:o.name}),t[7]=r,t[8]=o.folder,t[9]=o.name,t[10]=i,t[11]=e):e=t[11],e}let s;t[12]===r?s=t[13]:(s=n(r),t[12]=r,t[13]=s);let c=s;if(c){let e;return t[14]!==r||t[15]!==c||t[16]!==i?(e=(0,A.jsx)(H,{provider:i,docName:r,name:c}),t[14]=r,t[15]=c,t[16]=i,t[17]=e):e=t[17],e}return null}function B(){let e=(0,O.c)(2),{closeDocument:t}=r(),n;return e[0]===t?n=e[1]:(n=(e,n)=>{e!==n&&(w(n),t(e))},e[0]=t,e[1]=n),n}function V(e){let t=(0,O.c)(24),{provider:n,docName:r,scope:i,name:a}=e,{_:o}=s(),c=S(),l=B(),[u,d]=(0,k.useState)(null),[f,p]=(0,k.useState)(!1),m;t[0]!==o||t[1]!==r||t[2]!==a||t[3]!==l||t[4]!==i?(m=async function(e){d(null);let t=await D({scope:i,fromName:a,toName:e});if(!t.ok){d(t.error),T.error(o({id:`sHrqDx`,values:{0:t.error}}));return}T.success(o({id:`_hPpdX`})),l(r,_(i,e))},t[0]=o,t[1]=r,t[2]=a,t[3]=l,t[4]=i,t[5]=m):m=t[5];let h=m,g;t[6]!==o||t[7]!==r||t[8]!==f||t[9]!==a||t[10]!==l||t[11]!==i||t[12]!==c?(g=async function(e){if(e===i||f)return;p(!0);let t=await E({name:a,fromScope:i,toScope:e});if(p(!1),!t.ok){T.error(o({id:`07eGJB`,values:{0:t.error}}));return}let n=t.skippedBinaryFiles?.length??0;n>0?T.warning(o({id:`DhK_hZ`,values:{0:c[e],name:a,skipped:n}})):T.success(o({id:`UQMMvx`,values:{0:c[e],name:a}})),l(r,_(e,a))},t[6]=o,t[7]=r,t[8]=f,t[9]=a,t[10]=l,t[11]=i,t[12]=c,t[13]=g):g=t[13];let v=g,y=!f,b;t[14]!==v||t[15]!==i?(b={scope:i,onScopeChange:v},t[14]=v,t[15]=i,t[16]=b):b=t[16];let x;return t[17]!==h||t[18]!==a||t[19]!==n||t[20]!==u||t[21]!==y||t[22]!==b?(x=(0,A.jsx)(M,{provider:n,name:a,onRename:h,nameError:u,nameEditable:y,scopeControl:b}),t[17]=h,t[18]=a,t[19]=n,t[20]=u,t[21]=y,t[22]=b,t[23]=x):x=t[23],x}function H(e){let t=(0,O.c)(21),{provider:n,docName:r,name:i}=e,{_:a}=s(),o=S(),c=B(),[l,u]=(0,k.useState)(null),[d,f]=(0,k.useState)(!1),p;t[0]!==a||t[1]!==r||t[2]!==i||t[3]!==c?(p=async function(e){u(null);let t=await D({scope:`project`,fromName:i,toName:e});if(!t.ok){u(t.error),T.error(a({id:`sHrqDx`,values:{0:t.error}}));return}T.success(a({id:`_hPpdX`})),c(r,h(e))},t[0]=a,t[1]=r,t[2]=i,t[3]=c,t[4]=p):p=t[4];let m=p,g;t[5]!==a||t[6]!==r||t[7]!==d||t[8]!==i||t[9]!==c||t[10]!==o?(g=async function(e){if(e===`project`||d)return;f(!0);let t=await E({name:i,fromScope:`project`,toScope:e});if(f(!1),!t.ok){T.error(a({id:`07eGJB`,values:{0:t.error}}));return}let n=t.skippedBinaryFiles?.length??0;n>0?T.warning(a({id:`DhK_hZ`,values:{0:o[e],name:i,skipped:n}})):T.success(a({id:`UQMMvx`,values:{0:o[e],name:i}})),c(r,_(e,i))},t[5]=a,t[6]=r,t[7]=d,t[8]=i,t[9]=c,t[10]=o,t[11]=g):g=t[11];let v=g,y=!d,b;t[12]===v?b=t[13]:(b={scope:`project`,onScopeChange:v},t[12]=v,t[13]=b);let x;return t[14]!==m||t[15]!==i||t[16]!==n||t[17]!==l||t[18]!==y||t[19]!==b?(x=(0,A.jsx)(M,{provider:n,name:i,onRename:m,nameError:l,nameEditable:y,scopeControl:b}),t[14]=m,t[15]=i,t[16]=n,t[17]=l,t[18]=y,t[19]=b,t[20]=x):x=t[20],x}function U(e){let t=(0,O.c)(12),{provider:n,docName:r,folder:a,name:o}=e,{_:c}=s(),l=B(),[u,d]=(0,k.useState)(null),f;t[0]!==c||t[1]!==r||t[2]!==a||t[3]!==o||t[4]!==l?(f=async function(e){d(null);let t=await C({fromFolder:a,fromName:o,toFolder:a,toName:e});if(!t.ok){d(t.error),T.error(c({id:`gk_-qj`,values:{0:t.error}}));return}T.success(c({id:`YKLP_-`})),l(r,i(a,e))},t[0]=c,t[1]=r,t[2]=a,t[3]=o,t[4]=l,t[5]=f):f=t[5];let p=f,m;return t[6]!==a||t[7]!==p||t[8]!==o||t[9]!==n||t[10]!==u?(m=(0,A.jsx)(L,{provider:n,name:o,folder:a,onRename:p,nameError:u}),t[6]=a,t[7]=p,t[8]=o,t[9]=n,t[10]=u,t[11]=m):m=t[11],m}export{z as ManagedArtifactProperties};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{s as o}from"./createLucideIcon-BUb14crZ.js";import{t as s}from"./button-DHE6Sx02.js";import{i as c,n as l,r as u,t as ee}from"./tooltip-BCGL5jDF.js";import{a as te,c as ne,i as re,n as ie,o as ae,s as oe,t as se}from"./dialog-BLaUGJCd.js";import{t as d}from"./checkbox-Cn88M3G6.js";import{t as f}from"./label-bn6BDr7p.js";import{F as ce}from"./dist-C6nSogV9.js";import{t as le}from"./arrow-up-right-BKliW282.js";import{t as ue}from"./info-DV3bzhzI.js";import{n as p}from"./dist-DwCd6eR-.js";import{t as de}from"./external-link-BtglP1zb.js";import{n as m}from"./mcp-consent-store-rBVJ88Wy.js";var fe=a(),h=e(n(),1),g=t();function pe(e){return e.shellDetected&&!e.alreadyInstalled}function me(e){let t=new Set;for(let n of e)n.detected&&t.add(n.id);return t}function he(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function ge(e,t){let n=[];for(let r of t)e.has(r.id)&&n.push(r.id);return n}function _e(e){return new Set(e.map(e=>e.id))}function ve(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function ye(e,t){return t.filter(t=>e.has(t.id)).map(e=>e.id)}var _={error:e=>p.error(e)};function v(e){let t=(0,fe.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?m:r,s=i===void 0?_: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,g.jsx)(y,{payload:l,store:o,toast:s}),t[5]=l,t[6]=o,t[7]=s,t[8]=u):u=t[8],u}function y(e){let t=(0,fe.c)(84),{payload:n,store:a,toast:p}=e,{_:m}=i(),_=n.detectedEditors,v=n.pathInstall,y=n.globalSkills,b=y.length>0,x;t[0]===v?x=t[1]:(x=pe(v),t[0]=v,t[1]=x);let S=x,C;t[2]===_?C=t[3]:(C=()=>me(_),t[2]=_,t[3]=C);let[w,Se]=(0,h.useState)(C),[T,Ce]=(0,h.useState)(!0),E;t[4]===y?E=t[5]:(E=()=>_e(y),t[4]=y,t[5]=E);let[D,we]=(0,h.useState)(E),[O,k]=(0,h.useState)(!1),A=(0,h.useId)(),j;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(e){Se(t=>he(t,e))},t[6]=j):j=t[6];let Te=j,M;t[7]!==_||t[8]!==y||t[9]!==S||t[10]!==T||t[11]!==w||t[12]!==D||t[13]!==b||t[14]!==a||t[15]!==p?(M=async function(){k(!0);let e=await a.confirm({editorIds:ge(w,_),pathInstall:S?T:void 0,skills:b?ye(D,y):void 0});e.ok||(p.error(e.error),k(!1))},t[7]=_,t[8]=y,t[9]=S,t[10]=T,t[11]=w,t[12]=D,t[13]=b,t[14]=a,t[15]=p,t[16]=M):M=t[16];let Ee=M,N;t[17]!==a||t[18]!==p?(N=async function(){k(!0);let e=await a.skip();e.ok||(p.error(e.error),k(!1))},t[17]=a,t[18]=p,t[19]=N):N=t[19];let P=N,F;t[20]!==O||t[21]!==P?(F=function(e){!e&&!O&&P()},t[20]=O,t[21]=P,t[22]=F):F=t[22];let De=F,I;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,g.jsx)(ne,{children:(0,g.jsx)(r,{id:`tsyExA`})}),t[23]=I):I=t[23];let L;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,g.jsxs)(oe,{children:[I,(0,g.jsx)(te,{children:(0,g.jsx)(r,{id:`GF51cw`})})]}),t[24]=L):L=t[24];let R;t[25]!==m||t[26]!==O||t[27]!==A||t[28]!==S||t[29]!==T||t[30]!==v.rcFilesToTouch||t[31]!==v.shellDetected?(R=v.shellDetected&&(0,g.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,g.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,g.jsx)(r,{id:`ALhMYW`})}),(0,g.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border bg-card/50`,children:(0,g.jsxs)(f,{htmlFor:`${A}-path`,className:S?`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,g.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,g.jsx)(d,{id:`${A}-path`,checked:S?T:!0,disabled:O||!S,onCheckedChange:()=>Ce(xe),"data-testid":`mcp-consent-path-checkbox`}),(0,g.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm font-medium text-foreground`,children:[(0,g.jsx)(r,{id:`Fsx78O`,components:{0:(0,g.jsx)(`code`,{className:`inline-code`})}}),S&&(0,g.jsx)(u,{children:(0,g.jsxs)(ee,{children:[(0,g.jsx)(c,{onClick:be,className:`text-muted-foreground hover:text-foreground`,"aria-label":m({id:`LiAw2k`}),"data-testid":`mcp-consent-path-info`,children:(0,g.jsx)(ue,{className:`size-3.5`,"aria-hidden":!0})}),(0,g.jsx)(l,{className:`max-w-xs`,children:(0,g.jsx)(`p`,{className:`leading-relaxed wrap-break-word`,"data-testid":`mcp-consent-path-status`,children:m({id:`04XyCH`,values:{0:v.rcFilesToTouch.join(`, `)}})})})]})})]})]}),!S&&(0,g.jsx)(`span`,{className:`ps-6.5 text-xs text-muted-foreground`,"data-testid":`mcp-consent-path-status`,children:m({id:`RnrnTe`})}),S&&!T&&(0,g.jsx)(`span`,{className:`ps-6.5 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-path-warning`,children:(0,g.jsx)(r,{id:`7PXYaF`,components:{0:(0,g.jsx)(`code`,{className:`inline-code`})}})})]})})]}),t[25]=m,t[26]=O,t[27]=A,t[28]=S,t[29]=T,t[30]=v.rcFilesToTouch,t[31]=v.shellDetected,t[32]=R):R=t[32];let z;t[33]===v.shellDetected?z=t[34]:(z=v.shellDetected&&(0,g.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:(0,g.jsx)(r,{id:`psfGPX`})}),t[33]=v.shellDetected,t[34]=z);let B;if(t[35]!==m||t[36]!==O||t[37]!==_||t[38]!==A||t[39]!==w){let e;t[41]!==m||t[42]!==O||t[43]!==A||t[44]!==w?(e=e=>{let t=w.has(e.id),n=`${A}-${e.id}`,i=`https://openknowledge.ai/docs/integrations/${ce[e.id]}`;return(0,g.jsxs)(`li`,{className:`flex flex-wrap items-stretch hover:bg-accent`,children:[(0,g.jsxs)(f,{htmlFor:n,className:o(`flex flex-1 cursor-pointer items-center gap-2.5 px-3 py-2.5 font-normal`,e.willReplace?`pb-0.5`:``),children:[(0,g.jsx)(d,{id:n,checked:t,disabled:O,onCheckedChange:()=>Te(e.id),"data-testid":`mcp-consent-checkbox-${e.id}`}),(0,g.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label})]}),e.willReplace?(0,g.jsx)(`span`,{className:`ms-6.5 basis-full px-3 pb-2.5 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-status-${e.id}`,children:(0,g.jsx)(r,{id:`TEEPPF`})}):e.detected?null:(0,g.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>de(e,i),onAuxClick:e=>de(e,i),"aria-label":m({id:`D-Oh1s`,values:{0:e.label}}),className:`flex items-center gap-0.5 px-3 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,g.jsx)(r,{id:`P_bX4O`}),(0,g.jsx)(le,{className:`size-3`,"aria-hidden":!0})]})]},e.id)},t[41]=m,t[42]=O,t[43]=A,t[44]=w,t[45]=e):e=t[45],B=_.map(e),t[35]=m,t[36]=O,t[37]=_,t[38]=A,t[39]=w,t[40]=B}else B=t[40];let V;t[46]===B?V=t[47]:(V=(0,g.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:B}),t[46]=B,t[47]=V);let H;t[48]!==z||t[49]!==V?(H=(0,g.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[z,V]}),t[48]=z,t[49]=V,t[50]=H):H=t[50];let U;t[51]!==O||t[52]!==y||t[53]!==A||t[54]!==D||t[55]!==b?(U=b&&(0,g.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,g.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,g.jsx)(r,{id:`28B21t`})}),(0,g.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:y.map(e=>{let t=D.has(e.id),n=`${A}-skill-${e.id}`;return(0,g.jsx)(`li`,{children:(0,g.jsxs)(f,{htmlFor:n,className:`flex cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal hover:bg-accent`,children:[(0,g.jsx)(d,{id:n,checked:t,disabled:O,onCheckedChange:()=>we(t=>ve(t,e.id)),className:`mt-0.5`,"data-testid":`mcp-consent-skill-checkbox-${e.id}`}),(0,g.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,g.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,g.jsx)(`code`,{children:e.name})}),(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`mcp-consent-skill-status-${e.id}`,children:e.id===`discovery`?(0,g.jsx)(r,{id:`0inVGS`}):(0,g.jsx)(r,{id:`FXk_zY`})}),e.alreadyInstalled&&!t&&(0,g.jsx)(`span`,{className:`text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-skill-warning-${e.id}`,children:(0,g.jsx)(r,{id:`dXWMFn`})})]})]})},e.id)})})]}),t[51]=O,t[52]=y,t[53]=A,t[54]=D,t[55]=b,t[56]=U):U=t[56];let W;t[57]!==R||t[58]!==H||t[59]!==U?(W=(0,g.jsxs)(ie,{className:`flex flex-col gap-6 min-h-0`,children:[R,H,U]}),t[57]=R,t[58]=H,t[59]=U,t[60]=W):W=t[60];let G;t[61]===P?G=t[62]:(G=()=>void P(),t[61]=P,t[62]=G);let K;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,g.jsx)(r,{id:`6Uau97`}),t[63]=K):K=t[63];let q;t[64]!==O||t[65]!==G?(q=(0,g.jsx)(s,{variant:`outline`,className:`font-mono uppercase`,onClick:G,disabled:O,"data-testid":`mcp-consent-skip`,children:K}),t[64]=O,t[65]=G,t[66]=q):q=t[66];let J;t[67]===Ee?J=t[68]:(J=()=>void Ee(),t[67]=Ee,t[68]=J);let Oe=O||w.size===0&&!(S&&T)&&!b,Y;t[69]===O?Y=t[70]:(Y=O?(0,g.jsx)(r,{id:`b4itZn`}):(0,g.jsx)(r,{id:`iSLIjg`}),t[69]=O,t[70]=Y);let X;t[71]!==J||t[72]!==Oe||t[73]!==Y?(X=(0,g.jsx)(s,{onClick:J,disabled:Oe,"data-testid":`mcp-consent-add`,children:Y}),t[71]=J,t[72]=Oe,t[73]=Y,t[74]=X):X=t[74];let Z;t[75]!==q||t[76]!==X?(Z=(0,g.jsxs)(ae,{children:[q,X]}),t[75]=q,t[76]=X,t[77]=Z):Z=t[77];let Q;t[78]!==W||t[79]!==Z?(Q=(0,g.jsxs)(re,{className:`sm:max-w-md`,children:[L,W,Z]}),t[78]=W,t[79]=Z,t[80]=Q):Q=t[80];let $;return t[81]!==De||t[82]!==Q?($=(0,g.jsx)(se,{open:!0,onOpenChange:De,children:Q}),t[81]=De,t[82]=Q,t[83]=$):$=t[83],$}function be(e){e.preventDefault(),e.stopPropagation()}function xe(e){return!e}export{v as McpConsentDialogBody,v as default,me as computeInitialSelection,_e as computeInitialSkillSelection,pe as isPathRowActionable,ge as selectedIdsOrdered,ye as skillIdsOrdered,he as toggleSelectedId,ve as toggleSkillId};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{n as r,r as i}from"./dist-DBENJeML.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{s as o}from"./createLucideIcon-BUb14crZ.js";import{t as s}from"./button-DHE6Sx02.js";import{i as c,n as l,r as u,t as ee}from"./tooltip-BCGL5jDF.js";import{a as te,c as ne,i as re,n as ie,o as ae,s as oe,t as se}from"./dialog-BLaUGJCd.js";import{t as d}from"./checkbox-Cn88M3G6.js";import{t as f}from"./label-bn6BDr7p.js";import{F as ce}from"./dist-Vm1kQiqo.js";import{t as le}from"./arrow-up-right-BKliW282.js";import{t as ue}from"./info-DV3bzhzI.js";import{n as p}from"./dist-DwCd6eR-.js";import{t as de}from"./external-link-BtglP1zb.js";import{n as m}from"./mcp-consent-store-rBVJ88Wy.js";var fe=a(),h=e(n(),1),g=t();function pe(e){return e.shellDetected&&!e.alreadyInstalled}function me(e){let t=new Set;for(let n of e)n.detected&&t.add(n.id);return t}function he(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function ge(e,t){let n=[];for(let r of t)e.has(r.id)&&n.push(r.id);return n}function _e(e){return new Set(e.map(e=>e.id))}function ve(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function ye(e,t){return t.filter(t=>e.has(t.id)).map(e=>e.id)}var _={error:e=>p.error(e)};function v(e){let t=(0,fe.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?m:r,s=i===void 0?_: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,g.jsx)(y,{payload:l,store:o,toast:s}),t[5]=l,t[6]=o,t[7]=s,t[8]=u):u=t[8],u}function y(e){let t=(0,fe.c)(84),{payload:n,store:a,toast:p}=e,{_:m}=i(),_=n.detectedEditors,v=n.pathInstall,y=n.globalSkills,b=y.length>0,x;t[0]===v?x=t[1]:(x=pe(v),t[0]=v,t[1]=x);let S=x,C;t[2]===_?C=t[3]:(C=()=>me(_),t[2]=_,t[3]=C);let[w,Se]=(0,h.useState)(C),[T,Ce]=(0,h.useState)(!0),E;t[4]===y?E=t[5]:(E=()=>_e(y),t[4]=y,t[5]=E);let[D,we]=(0,h.useState)(E),[O,k]=(0,h.useState)(!1),A=(0,h.useId)(),j;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(e){Se(t=>he(t,e))},t[6]=j):j=t[6];let Te=j,M;t[7]!==_||t[8]!==y||t[9]!==S||t[10]!==T||t[11]!==w||t[12]!==D||t[13]!==b||t[14]!==a||t[15]!==p?(M=async function(){k(!0);let e=await a.confirm({editorIds:ge(w,_),pathInstall:S?T:void 0,skills:b?ye(D,y):void 0});e.ok||(p.error(e.error),k(!1))},t[7]=_,t[8]=y,t[9]=S,t[10]=T,t[11]=w,t[12]=D,t[13]=b,t[14]=a,t[15]=p,t[16]=M):M=t[16];let Ee=M,N;t[17]!==a||t[18]!==p?(N=async function(){k(!0);let e=await a.skip();e.ok||(p.error(e.error),k(!1))},t[17]=a,t[18]=p,t[19]=N):N=t[19];let P=N,F;t[20]!==O||t[21]!==P?(F=function(e){!e&&!O&&P()},t[20]=O,t[21]=P,t[22]=F):F=t[22];let De=F,I;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,g.jsx)(ne,{children:(0,g.jsx)(r,{id:`tsyExA`})}),t[23]=I):I=t[23];let L;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,g.jsxs)(oe,{children:[I,(0,g.jsx)(te,{children:(0,g.jsx)(r,{id:`GF51cw`})})]}),t[24]=L):L=t[24];let R;t[25]!==m||t[26]!==O||t[27]!==A||t[28]!==S||t[29]!==T||t[30]!==v.rcFilesToTouch||t[31]!==v.shellDetected?(R=v.shellDetected&&(0,g.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,g.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,g.jsx)(r,{id:`ALhMYW`})}),(0,g.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border bg-card/50`,children:(0,g.jsxs)(f,{htmlFor:`${A}-path`,className:S?`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,g.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,g.jsx)(d,{id:`${A}-path`,checked:S?T:!0,disabled:O||!S,onCheckedChange:()=>Ce(xe),"data-testid":`mcp-consent-path-checkbox`}),(0,g.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm font-medium text-foreground`,children:[(0,g.jsx)(r,{id:`Fsx78O`,components:{0:(0,g.jsx)(`code`,{className:`inline-code`})}}),S&&(0,g.jsx)(u,{children:(0,g.jsxs)(ee,{children:[(0,g.jsx)(c,{onClick:be,className:`text-muted-foreground hover:text-foreground`,"aria-label":m({id:`LiAw2k`}),"data-testid":`mcp-consent-path-info`,children:(0,g.jsx)(ue,{className:`size-3.5`,"aria-hidden":!0})}),(0,g.jsx)(l,{className:`max-w-xs`,children:(0,g.jsx)(`p`,{className:`leading-relaxed wrap-break-word`,"data-testid":`mcp-consent-path-status`,children:m({id:`04XyCH`,values:{0:v.rcFilesToTouch.join(`, `)}})})})]})})]})]}),!S&&(0,g.jsx)(`span`,{className:`ps-6.5 text-xs text-muted-foreground`,"data-testid":`mcp-consent-path-status`,children:m({id:`RnrnTe`})}),S&&!T&&(0,g.jsx)(`span`,{className:`ps-6.5 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-path-warning`,children:(0,g.jsx)(r,{id:`7PXYaF`,components:{0:(0,g.jsx)(`code`,{className:`inline-code`})}})})]})})]}),t[25]=m,t[26]=O,t[27]=A,t[28]=S,t[29]=T,t[30]=v.rcFilesToTouch,t[31]=v.shellDetected,t[32]=R):R=t[32];let z;t[33]===v.shellDetected?z=t[34]:(z=v.shellDetected&&(0,g.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:(0,g.jsx)(r,{id:`psfGPX`})}),t[33]=v.shellDetected,t[34]=z);let B;if(t[35]!==m||t[36]!==O||t[37]!==_||t[38]!==A||t[39]!==w){let e;t[41]!==m||t[42]!==O||t[43]!==A||t[44]!==w?(e=e=>{let t=w.has(e.id),n=`${A}-${e.id}`,i=`https://openknowledge.ai/docs/integrations/${ce[e.id]}`;return(0,g.jsxs)(`li`,{className:`flex flex-wrap items-stretch hover:bg-accent`,children:[(0,g.jsxs)(f,{htmlFor:n,className:o(`flex flex-1 cursor-pointer items-center gap-2.5 px-3 py-2.5 font-normal`,e.willReplace?`pb-0.5`:``),children:[(0,g.jsx)(d,{id:n,checked:t,disabled:O,onCheckedChange:()=>Te(e.id),"data-testid":`mcp-consent-checkbox-${e.id}`}),(0,g.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label})]}),e.willReplace?(0,g.jsx)(`span`,{className:`ms-6.5 basis-full px-3 pb-2.5 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-status-${e.id}`,children:(0,g.jsx)(r,{id:`TEEPPF`})}):e.detected?null:(0,g.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>de(e,i),onAuxClick:e=>de(e,i),"aria-label":m({id:`D-Oh1s`,values:{0:e.label}}),className:`flex items-center gap-0.5 px-3 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,g.jsx)(r,{id:`P_bX4O`}),(0,g.jsx)(le,{className:`size-3`,"aria-hidden":!0})]})]},e.id)},t[41]=m,t[42]=O,t[43]=A,t[44]=w,t[45]=e):e=t[45],B=_.map(e),t[35]=m,t[36]=O,t[37]=_,t[38]=A,t[39]=w,t[40]=B}else B=t[40];let V;t[46]===B?V=t[47]:(V=(0,g.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:B}),t[46]=B,t[47]=V);let H;t[48]!==z||t[49]!==V?(H=(0,g.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[z,V]}),t[48]=z,t[49]=V,t[50]=H):H=t[50];let U;t[51]!==O||t[52]!==y||t[53]!==A||t[54]!==D||t[55]!==b?(U=b&&(0,g.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,g.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,g.jsx)(r,{id:`28B21t`})}),(0,g.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:y.map(e=>{let t=D.has(e.id),n=`${A}-skill-${e.id}`;return(0,g.jsx)(`li`,{children:(0,g.jsxs)(f,{htmlFor:n,className:`flex cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal hover:bg-accent`,children:[(0,g.jsx)(d,{id:n,checked:t,disabled:O,onCheckedChange:()=>we(t=>ve(t,e.id)),className:`mt-0.5`,"data-testid":`mcp-consent-skill-checkbox-${e.id}`}),(0,g.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,g.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,g.jsx)(`code`,{children:e.name})}),(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`mcp-consent-skill-status-${e.id}`,children:e.id===`discovery`?(0,g.jsx)(r,{id:`0inVGS`}):(0,g.jsx)(r,{id:`FXk_zY`})}),e.alreadyInstalled&&!t&&(0,g.jsx)(`span`,{className:`text-xs text-amber-600 dark:text-amber-400`,"data-testid":`mcp-consent-skill-warning-${e.id}`,children:(0,g.jsx)(r,{id:`dXWMFn`})})]})]})},e.id)})})]}),t[51]=O,t[52]=y,t[53]=A,t[54]=D,t[55]=b,t[56]=U):U=t[56];let W;t[57]!==R||t[58]!==H||t[59]!==U?(W=(0,g.jsxs)(ie,{className:`flex flex-col gap-6 min-h-0`,children:[R,H,U]}),t[57]=R,t[58]=H,t[59]=U,t[60]=W):W=t[60];let G;t[61]===P?G=t[62]:(G=()=>void P(),t[61]=P,t[62]=G);let K;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,g.jsx)(r,{id:`6Uau97`}),t[63]=K):K=t[63];let q;t[64]!==O||t[65]!==G?(q=(0,g.jsx)(s,{variant:`outline`,className:`font-mono uppercase`,onClick:G,disabled:O,"data-testid":`mcp-consent-skip`,children:K}),t[64]=O,t[65]=G,t[66]=q):q=t[66];let J;t[67]===Ee?J=t[68]:(J=()=>void Ee(),t[67]=Ee,t[68]=J);let Oe=O||w.size===0&&!(S&&T)&&!b,Y;t[69]===O?Y=t[70]:(Y=O?(0,g.jsx)(r,{id:`b4itZn`}):(0,g.jsx)(r,{id:`iSLIjg`}),t[69]=O,t[70]=Y);let X;t[71]!==J||t[72]!==Oe||t[73]!==Y?(X=(0,g.jsx)(s,{onClick:J,disabled:Oe,"data-testid":`mcp-consent-add`,children:Y}),t[71]=J,t[72]=Oe,t[73]=Y,t[74]=X):X=t[74];let Z;t[75]!==q||t[76]!==X?(Z=(0,g.jsxs)(ae,{children:[q,X]}),t[75]=q,t[76]=X,t[77]=Z):Z=t[77];let Q;t[78]!==W||t[79]!==Z?(Q=(0,g.jsxs)(re,{className:`sm:max-w-md`,children:[L,W,Z]}),t[78]=W,t[79]=Z,t[80]=Q):Q=t[80];let $;return t[81]!==De||t[82]!==Q?($=(0,g.jsx)(se,{open:!0,onOpenChange:De,children:Q}),t[81]=De,t[82]=Q,t[83]=$):$=t[83],$}function be(e){e.preventDefault(),e.stopPropagation()}function xe(e){return!e}export{v as McpConsentDialogBody,v as default,me as computeInitialSelection,_e as computeInitialSkillSelection,pe as isPathRowActionable,ge as selectedIdsOrdered,ye as skillIdsOrdered,he as toggleSelectedId,ve as toggleSkillId};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{r}from"./dist-DBENJeML.js";import{n as i}from"./dist-COAuqNbv.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{A as o,L as s,T as c,n as l,w as u}from"./CodeMirrorPropInput-CIGTqTT1.js";import{f as d}from"./config-provider-YhhBOmCK.js";import{N as f,Ot as p,X as m}from"./dist-5kUc8Rop.js";import{t as h}from"./dist-CWKw6fA9.js";import{t as g}from"./src-CpymDWKp.js";var _=a(),v=e(n(),1),y=t(),b=c({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),x=u({settings:{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,s=(0,v.useRef)(null),{resolvedTheme:c}=i(),u,d;t[0]!==r||t[1]!==c||t[2]!==a||t[3]!==n?(u=()=>{let e=s.current;if(!e)return;let t=c===`dark`?b:x,i=new m({state:p.create({doc:n.toString(),extensions:[h,g(n,r.awareness,{undoManager:a}),o(),f(l),m.lineWrapping,m.theme({"&":{height:`100%`}}),t]}),parent:e});return()=>i.destroy()},d=[n,r,c,a],t[0]=r,t[1]=c,t[2]=a,t[3]=n,t[4]=u,t[5]=d):(u=t[4],d=t[5]),(0,v.useEffect)(u,d);let S;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,y.jsx)(`div`,{ref:s,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 c=o,l;t[2]===c?l=t[3]:(l=()=>c.toString(),t[2]=c,t[3]=l);let[u,f]=(0,v.useState)(l),p,m;t[4]===c?(p=t[5],m=t[6]):(p=()=>{let e=()=>f(c.toString());return c.observe(e),e(),()=>c.unobserve(e)},m=[c],t[4]=c,t[5]=p,t[6]=m),(0,v.useEffect)(p,m);let h;t[7]===c?h=t[8]:(h=()=>new d(c,{trackedOrigins:new Set([w])}),t[7]=c,t[8]=h);let[g]=(0,v.useState)(h),b;t[9]===c?b=t[10]:(b={canEdit:!0,commitChart:e=>S(c,e,w)},t[9]=c,t[10]=b);let x=b,T,E;t[11]!==i||t[12]!==g?(T=()=>{if(i)return;let e=e=>{if(!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`z`)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?g.redo():g.undo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},E=[i,g],t[11]=i,t[12]=g,t[13]=T,t[14]=E):(T=t[13],E=t[14]),(0,v.useEffect)(T,E);let D;t[15]===a?D=t[16]:(D=a({id:`8PifYj`}),t[15]=a,t[16]=D);let O=i?`source`:`diagram`,k;t[17]!==x||t[18]!==i||t[19]!==n||t[20]!==u||t[21]!==g||t[22]!==c?(k=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:i?(0,y.jsx)(C,{ytext:c,provider:n,undoManager:g}):(0,y.jsx)(`div`,{className:`flex h-full min-h-0 flex-col p-3`,children:(0,y.jsx)(s,{chart:u,editBinding:x,className:`min-h-0 flex-1`})})}),t[17]=x,t[18]=i,t[19]=n,t[20]=u,t[21]=g,t[22]=c,t[23]=k):k=t[23];let A;return t[24]!==O||t[25]!==k||t[26]!==D?(A=(0,y.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":D,"data-mermaid-doc-editor":``,"data-mermaid-doc-editor-mode":O,children:k}),t[24]=O,t[25]=k,t[26]=D,t[27]=A):A=t[27],A}export{T as MermaidDocEditor};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{t as n}from"./react-JNybMug3.js";import{r}from"./dist-DBENJeML.js";import{n as i}from"./dist-COAuqNbv.js";import{t as a}from"./compiler-runtime-dQcBxOhn.js";import{A as o,L as s,T as c,n as l,w as u}from"./CodeMirrorPropInput-DUwQlljh.js";import{f as d}from"./config-provider-DstRVgzH.js";import{N as f,Ot as p,X as m}from"./dist-5kUc8Rop.js";import{t as h}from"./dist-DKsN2Ojq.js";import{t as g}from"./src-B-pNk3y3.js";var _=a(),v=e(n(),1),y=t(),b=c({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),x=u({settings:{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,s=(0,v.useRef)(null),{resolvedTheme:c}=i(),u,d;t[0]!==r||t[1]!==c||t[2]!==a||t[3]!==n?(u=()=>{let e=s.current;if(!e)return;let t=c===`dark`?b:x,i=new m({state:p.create({doc:n.toString(),extensions:[h,g(n,r.awareness,{undoManager:a}),o(),f(l),m.lineWrapping,m.theme({"&":{height:`100%`}}),t]}),parent:e});return()=>i.destroy()},d=[n,r,c,a],t[0]=r,t[1]=c,t[2]=a,t[3]=n,t[4]=u,t[5]=d):(u=t[4],d=t[5]),(0,v.useEffect)(u,d);let S;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,y.jsx)(`div`,{ref:s,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 c=o,l;t[2]===c?l=t[3]:(l=()=>c.toString(),t[2]=c,t[3]=l);let[u,f]=(0,v.useState)(l),p,m;t[4]===c?(p=t[5],m=t[6]):(p=()=>{let e=()=>f(c.toString());return c.observe(e),e(),()=>c.unobserve(e)},m=[c],t[4]=c,t[5]=p,t[6]=m),(0,v.useEffect)(p,m);let h;t[7]===c?h=t[8]:(h=()=>new d(c,{trackedOrigins:new Set([w])}),t[7]=c,t[8]=h);let[g]=(0,v.useState)(h),b;t[9]===c?b=t[10]:(b={canEdit:!0,commitChart:e=>S(c,e,w)},t[9]=c,t[10]=b);let x=b,T,E;t[11]!==i||t[12]!==g?(T=()=>{if(i)return;let e=e=>{if(!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`z`)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?g.redo():g.undo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},E=[i,g],t[11]=i,t[12]=g,t[13]=T,t[14]=E):(T=t[13],E=t[14]),(0,v.useEffect)(T,E);let D;t[15]===a?D=t[16]:(D=a({id:`8PifYj`}),t[15]=a,t[16]=D);let O=i?`source`:`diagram`,k;t[17]!==x||t[18]!==i||t[19]!==n||t[20]!==u||t[21]!==g||t[22]!==c?(k=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:i?(0,y.jsx)(C,{ytext:c,provider:n,undoManager:g}):(0,y.jsx)(`div`,{className:`flex h-full min-h-0 flex-col p-3`,children:(0,y.jsx)(s,{chart:u,editBinding:x,className:`min-h-0 flex-1`})})}),t[17]=x,t[18]=i,t[19]=n,t[20]=u,t[21]=g,t[22]=c,t[23]=k):k=t[23];let A;return t[24]!==O||t[25]!==k||t[26]!==D?(A=(0,y.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":D,"data-mermaid-doc-editor":``,"data-mermaid-doc-editor-mode":O,children:k}),t[24]=O,t[25]=k,t[26]=D,t[27]=A):A=t[27],A}export{T as MermaidDocEditor};