@nextclaw/ui 0.15.20 → 0.15.21

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 (102) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/assets/{api-tWUa6l9J.js → api-CHo2gekJ.js} +5 -5
  3. package/dist/assets/app-presenter-provider-2_DmWYT9.js +108 -0
  4. package/dist/assets/{appearance-settings-page-dMRBD7ni.js → appearance-settings-page-BEy2UE7R.js} +1 -1
  5. package/dist/assets/{book-open-BQ29ZmDE.js → book-open-BrZL4o9L.js} +1 -1
  6. package/dist/assets/{card-CtKueklV.js → card-B5rRLu_6.js} +1 -1
  7. package/dist/assets/{channels-list-page-C8y3rqYt.js → channels-list-page-C1dnm68I.js} +1 -1
  8. package/dist/assets/chat-page-Dz6tvZ91.js +1 -0
  9. package/dist/assets/{config-split-page-uC6d_r9c.js → config-split-page-6y6W6dz4.js} +1 -1
  10. package/dist/assets/{confirm-dialog-C1pbqHZX.js → confirm-dialog-q1CpEmR8.js} +1 -1
  11. package/dist/assets/{desktop-update-config-DssP8LCk.js → desktop-update-config-DrdlwP4j.js} +1 -1
  12. package/dist/assets/{dist-rYHnBo8t.js → dist-C9EX46wM.js} +1 -1
  13. package/dist/assets/doc-browser-BfttDSti.js +1 -0
  14. package/dist/assets/{doc-browser-D8ng4EUc.js → doc-browser-DH-3hDnI.js} +1 -1
  15. package/dist/assets/{doc-browser-context-CPHNzQ8m.js → doc-browser-context-TU2heon0.js} +1 -1
  16. package/dist/assets/{eye-CiJz3ODY.js → eye-B-3dyZNA.js} +1 -1
  17. package/dist/assets/{form-actions-BnZVzLZf.js → form-actions-DvvxCpL4.js} +1 -1
  18. package/dist/assets/index-CXDPLDFD.css +1 -0
  19. package/dist/assets/index-k_eWScvN.js +2 -0
  20. package/dist/assets/loader-circle-B35NlHTI.js +1 -0
  21. package/dist/assets/{logo-badge-BXI-Kdhd.js → logo-badge-DB51c0cS.js} +1 -1
  22. package/dist/assets/mcp-marketplace-page-CkPtwPBk.js +1 -0
  23. package/dist/assets/{mcp-marketplace-page-CxNe-Q9Q.js → mcp-marketplace-page-DWtsIqml.js} +1 -1
  24. package/dist/assets/{model-config-page-CR_mgEVp.js → model-config-page-D6cGNnMM.js} +1 -1
  25. package/dist/assets/{navigation-link-C1cvB7y4.js → navigation-link-BSJEUiwD.js} +1 -1
  26. package/dist/assets/plus-BRVe5jSJ.js +1 -0
  27. package/dist/assets/{popover-ZoDwVwwd.js → popover-Bp9IpE_N.js} +1 -1
  28. package/dist/assets/{provider-scoped-model-input-DIL6Ex_d.js → provider-scoped-model-input-dk7fz9NL.js} +1 -1
  29. package/dist/assets/{providers-config-page-D2NXVctW.js → providers-config-page-DTP2YfxA.js} +1 -1
  30. package/dist/assets/react-D6ShNq95.js +8 -0
  31. package/dist/assets/{refresh-cw-DKewcdAl.js → refresh-cw-C2e94pmp.js} +1 -1
  32. package/dist/assets/remote-FllhXW3o.js +1 -0
  33. package/dist/assets/rotate-cw-CTC-Qszi.js +1 -0
  34. package/dist/assets/runtime-config-page-C57OLdPm.js +1 -0
  35. package/dist/assets/{save-BrckuAXY.js → save-CkwDOgvt.js} +1 -1
  36. package/dist/assets/{search-BhXQB2TO.js → search-CLXM2reO.js} +1 -1
  37. package/dist/assets/{search-config-page-DFOQ6SDJ.js → search-config-page-tnJXaaSr.js} +1 -1
  38. package/dist/assets/{secrets-config-page-BqqeClqE.js → secrets-config-page-DQ_Curaj.js} +1 -1
  39. package/dist/assets/security-config-S00DjFfO.js +1 -0
  40. package/dist/assets/{select-CVzGGT38.js → select-CNFBf00l.js} +1 -1
  41. package/dist/assets/{settings-2-BP6L2enG.js → settings-2-B9IT2HGd.js} +1 -1
  42. package/dist/assets/skeleton-Dc06gatK.js +1 -0
  43. package/dist/assets/{tabs-B-QWjKCL.js → tabs-BuNr8LSO.js} +1 -1
  44. package/dist/assets/{tag-chip-C88mxjwx.js → tag-chip-CDkB5smU.js} +1 -1
  45. package/dist/assets/{trash-2-ck3t33I3.js → trash-2-GchaJuEM.js} +1 -1
  46. package/dist/assets/{use-config-BAr5bH2c.js → use-config-C69rR15i.js} +1 -1
  47. package/dist/assets/{use-confirm-dialog-C4e0nG_4.js → use-confirm-dialog-DF_EgPYx.js} +1 -1
  48. package/dist/assets/{use-viewport-layout-k1isXfNm.js → use-viewport-layout-BACNZyMY.js} +1 -1
  49. package/dist/assets/x-BXFquY9e.js +1 -0
  50. package/dist/index.html +28 -28
  51. package/package.json +7 -7
  52. package/src/app/components/__tests__/app-notification-runtime.test.tsx +32 -0
  53. package/src/app/components/app-notification-runtime.tsx +15 -0
  54. package/src/app/components/layout/sidebar-items.tsx +23 -9
  55. package/src/app/configs/app-navigation.config.ts +21 -0
  56. package/src/app/index.tsx +22 -2
  57. package/src/app/presenters/app.presenter.ts +8 -0
  58. package/src/features/chat/components/layout/chat-page-shell.tsx +7 -2
  59. package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +12 -0
  60. package/src/features/chat/index.ts +1 -0
  61. package/src/features/chat/managers/__tests__/chat-completion-notification.manager.test.ts +177 -0
  62. package/src/features/chat/managers/chat-completion-notification.manager.ts +146 -0
  63. package/src/features/chat/pages/__tests__/ncp-chat-page.test.tsx +29 -2
  64. package/src/features/chat/pages/ncp-chat-page.tsx +9 -0
  65. package/src/features/inbox/components/inbox-delivery-content.test.tsx +57 -0
  66. package/src/features/inbox/components/inbox-delivery-content.tsx +118 -0
  67. package/src/features/inbox/components/inbox-reader-dialog.test.tsx +77 -0
  68. package/src/features/inbox/components/inbox-reader-dialog.tsx +224 -0
  69. package/src/features/inbox/components/inbox-runtime.tsx +14 -0
  70. package/src/features/inbox/hooks/use-inbox-deliveries.ts +14 -0
  71. package/src/features/inbox/index.ts +7 -0
  72. package/src/features/inbox/managers/inbox.manager.test.ts +86 -0
  73. package/src/features/inbox/managers/inbox.manager.ts +178 -0
  74. package/src/features/inbox/pages/inbox-page.test.ts +28 -0
  75. package/src/features/inbox/pages/inbox-page.tsx +385 -0
  76. package/src/features/inbox/stores/inbox.store.ts +23 -0
  77. package/src/features/notifications/components/__tests__/app-notification-toast.test.tsx +48 -0
  78. package/src/features/notifications/components/app-notification-toast.tsx +80 -0
  79. package/src/features/notifications/index.ts +8 -0
  80. package/src/features/notifications/managers/__tests__/app-notification.manager.test.ts +75 -0
  81. package/src/features/notifications/managers/app-notification.manager.ts +41 -0
  82. package/src/platforms/mobile/components/mobile-bottom-nav.tsx +14 -7
  83. package/src/shared/lib/i18n/index.ts +4 -0
  84. package/src/shared/lib/i18n/locales/en-US/chat.json +3 -0
  85. package/src/shared/lib/i18n/locales/en-US/inbox.json +30 -0
  86. package/src/shared/lib/i18n/locales/zh-CN/chat.json +3 -0
  87. package/src/shared/lib/i18n/locales/zh-CN/inbox.json +30 -0
  88. package/dist/assets/app-presenter-provider-s-FrOinZ.js +0 -106
  89. package/dist/assets/chat-page-MXBltS3G.js +0 -1
  90. package/dist/assets/doc-browser-AXF1zRsM.js +0 -1
  91. package/dist/assets/index-CocHWEsI.js +0 -2
  92. package/dist/assets/index-DN6KM7WD.css +0 -1
  93. package/dist/assets/loader-circle-AOpK5kkW.js +0 -1
  94. package/dist/assets/mcp-marketplace-page-5ogeBHnl.js +0 -1
  95. package/dist/assets/plus-DI37QuHc.js +0 -1
  96. package/dist/assets/react-39CDNZlM.js +0 -8
  97. package/dist/assets/remote-DYOOO1YG.js +0 -1
  98. package/dist/assets/rotate-cw-PmqA8LQT.js +0 -1
  99. package/dist/assets/runtime-config-page-0lb5NyKc.js +0 -1
  100. package/dist/assets/security-config-13AtPIlm.js +0 -1
  101. package/dist/assets/skeleton-OwCNQJ7M.js +0 -1
  102. package/dist/assets/x-C1ijNWcE.js +0 -1
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{D as t,i as n,k as r,r as i,w as a}from"./react-39CDNZlM.js";import{S as o,T as s,a as c,v as l}from"./app-presenter-provider-s-FrOinZ.js";import{Bt as u,Ht as d,Ut as f,Vt as p,wt as m}from"./api-tWUa6l9J.js";import{a as h,i as g,n as _,r as v,t as y,w as b}from"./select-CVzGGT38.js";import{r as x}from"./use-confirm-dialog-C4e0nG_4.js";var S=e(r(),1);function C(){let{language:e,setLanguage:t}=x();return{currentLanguage:e,currentLanguageLabel:n.find(t=>t.value===e)?.label??e,languageOptions:n,selectLanguage:(0,S.useCallback)(n=>{e!==n&&(t(n),window.location.reload())},[e,t])}}var w=t(),T=[{value:`card`,labelKey:`chatMessageLayoutCard`,descriptionKey:`chatMessageLayoutCardDescription`},{value:`flat`,labelKey:`chatMessageLayoutFlat`,descriptionKey:`chatMessageLayoutFlatDescription`}];function E(){let{theme:e,setTheme:t}=l(),{currentLanguage:n,languageOptions:r,selectLanguage:x}=C(),S=s(e=>e.layout),E=s(e=>e.setLayout),D=c(e=>e.isVisible),O=c(e=>e.setVisible);return(0,w.jsx)(f,{title:i(`appearance`),children:(0,w.jsx)(d,{children:(0,w.jsxs)(p,{children:[(0,w.jsx)(u,{title:i(`theme`),control:(0,w.jsxs)(y,{value:e,onValueChange:e=>t(e),children:[(0,w.jsx)(g,{"aria-label":i(`theme`),className:`w-36 sm:w-44`,children:(0,w.jsx)(h,{})}),(0,w.jsx)(_,{children:o.map(e=>(0,w.jsx)(v,{value:e.value,children:i(e.labelKey)},e.value))})]})}),(0,w.jsx)(u,{title:i(`language`),control:(0,w.jsxs)(y,{value:n,onValueChange:e=>x(e),children:[(0,w.jsx)(g,{"aria-label":i(`language`),className:`w-36 sm:w-44`,children:(0,w.jsx)(h,{})}),(0,w.jsx)(_,{children:r.map(e=>(0,w.jsx)(v,{value:e.value,children:e.label},e.value))})]})}),(0,w.jsx)(u,{title:i(`chatMessageLayoutTitle`),description:i(`chatMessageLayoutDescription`),layout:`stacked`,children:(0,w.jsx)(`div`,{role:`radiogroup`,"aria-label":i(`chatMessageLayoutTitle`),className:`grid gap-1 rounded-xl bg-background/65 p-1 sm:grid-cols-2`,children:T.map(e=>{let t=e.value===S;return(0,w.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>E(e.value),className:a(`flex min-w-0 items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,t?`bg-card text-foreground shadow-sm`:`text-muted-foreground hover:bg-card/60 hover:text-foreground`),children:[(0,w.jsx)(`span`,{className:a(`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full ring-1`,t?`bg-primary text-primary-foreground ring-primary`:`bg-background ring-border`),children:t?(0,w.jsx)(b,{className:`h-2.5 w-2.5`,strokeWidth:3}):null}),(0,w.jsxs)(`span`,{className:`min-w-0`,children:[(0,w.jsx)(`span`,{className:`block text-sm font-medium`,children:i(e.labelKey)}),(0,w.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-muted-foreground`,children:i(e.descriptionKey)})]})]},e.value)})})}),(0,w.jsx)(u,{title:i(`sideDockVisibilityTitle`),description:i(`sideDockVisibilityDescription`),control:(0,w.jsx)(m,{id:`appearance-side-dock-visible`,"aria-label":i(`sideDockVisibilityTitle`),checked:D,onCheckedChange:O})})]})})})}export{E as AppearanceSettingsPage};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{D as t,i as n,k as r,r as i,w as a}from"./react-D6ShNq95.js";import{D as o,a as s,b as c,w as l}from"./app-presenter-provider-2_DmWYT9.js";import{Bt as u,Ht as d,Ut as f,Vt as p,wt as m}from"./api-CHo2gekJ.js";import{a as h,i as g,n as _,r as v,t as y,w as b}from"./select-CNFBf00l.js";import{r as x}from"./use-confirm-dialog-DF_EgPYx.js";var S=e(r(),1);function C(){let{language:e,setLanguage:t}=x();return{currentLanguage:e,currentLanguageLabel:n.find(t=>t.value===e)?.label??e,languageOptions:n,selectLanguage:(0,S.useCallback)(n=>{e!==n&&(t(n),window.location.reload())},[e,t])}}var w=t(),T=[{value:`card`,labelKey:`chatMessageLayoutCard`,descriptionKey:`chatMessageLayoutCardDescription`},{value:`flat`,labelKey:`chatMessageLayoutFlat`,descriptionKey:`chatMessageLayoutFlatDescription`}];function E(){let{theme:e,setTheme:t}=c(),{currentLanguage:n,languageOptions:r,selectLanguage:x}=C(),S=o(e=>e.layout),E=o(e=>e.setLayout),D=s(e=>e.isVisible),O=s(e=>e.setVisible);return(0,w.jsx)(f,{title:i(`appearance`),children:(0,w.jsx)(d,{children:(0,w.jsxs)(p,{children:[(0,w.jsx)(u,{title:i(`theme`),control:(0,w.jsxs)(y,{value:e,onValueChange:e=>t(e),children:[(0,w.jsx)(g,{"aria-label":i(`theme`),className:`w-36 sm:w-44`,children:(0,w.jsx)(h,{})}),(0,w.jsx)(_,{children:l.map(e=>(0,w.jsx)(v,{value:e.value,children:i(e.labelKey)},e.value))})]})}),(0,w.jsx)(u,{title:i(`language`),control:(0,w.jsxs)(y,{value:n,onValueChange:e=>x(e),children:[(0,w.jsx)(g,{"aria-label":i(`language`),className:`w-36 sm:w-44`,children:(0,w.jsx)(h,{})}),(0,w.jsx)(_,{children:r.map(e=>(0,w.jsx)(v,{value:e.value,children:e.label},e.value))})]})}),(0,w.jsx)(u,{title:i(`chatMessageLayoutTitle`),description:i(`chatMessageLayoutDescription`),layout:`stacked`,children:(0,w.jsx)(`div`,{role:`radiogroup`,"aria-label":i(`chatMessageLayoutTitle`),className:`grid gap-1 rounded-xl bg-background/65 p-1 sm:grid-cols-2`,children:T.map(e=>{let t=e.value===S;return(0,w.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>E(e.value),className:a(`flex min-w-0 items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,t?`bg-card text-foreground shadow-sm`:`text-muted-foreground hover:bg-card/60 hover:text-foreground`),children:[(0,w.jsx)(`span`,{className:a(`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full ring-1`,t?`bg-primary text-primary-foreground ring-primary`:`bg-background ring-border`),children:t?(0,w.jsx)(b,{className:`h-2.5 w-2.5`,strokeWidth:3}):null}),(0,w.jsxs)(`span`,{className:`min-w-0`,children:[(0,w.jsx)(`span`,{className:`block text-sm font-medium`,children:i(e.labelKey)}),(0,w.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-muted-foreground`,children:i(e.descriptionKey)})]})]},e.value)})})}),(0,w.jsx)(u,{title:i(`sideDockVisibilityTitle`),description:i(`sideDockVisibilityDescription`),control:(0,w.jsx)(m,{id:`appearance-side-dock-visible`,"aria-label":i(`sideDockVisibilityTitle`),checked:D,onCheckedChange:O})})]})})})}export{E as AppearanceSettingsPage};
@@ -1 +1 @@
1
- import{c as e}from"./dist-rYHnBo8t.js";var t=e(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]);export{t};
1
+ import{c as e}from"./dist-C9EX46wM.js";var t=e(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]);export{t};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{D as t,k as n,w as r}from"./react-39CDNZlM.js";import{c as i}from"./dist-rYHnBo8t.js";var a=i(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),o=e(n(),1),s=t(),c=o.forwardRef(({className:e,hover:t=!0,surface:n=`raised`,...i},a)=>(0,s.jsx)(`div`,{ref:a,className:r(`rounded-2xl border bg-card text-card-foreground transition-colors duration-base`,n===`raised`?`border-border shadow-card`:`border-border/75 shadow-none`,t&&n===`raised`&&`hover:border-primary/25 hover:shadow-card-hover`,t&&n===`flat`&&`hover:bg-muted/40`,e),...i}));c.displayName=`Card`;var l=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`div`,{ref:n,className:r(`flex flex-col space-y-1.5 p-6`,e),...t}));l.displayName=`CardHeader`;var u=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`h3`,{ref:n,className:r(`text-[15px] font-semibold leading-tight tracking-tight text-foreground`,e),...t}));u.displayName=`CardTitle`;var d=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`p`,{ref:n,className:r(`text-[13px] text-muted-foreground leading-relaxed`,e),...t}));d.displayName=`CardDescription`;var f=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`div`,{ref:n,className:r(`p-6 pt-0`,e),...t}));f.displayName=`CardContent`;var p=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`div`,{ref:n,className:r(`flex items-center justify-between p-6 pt-0`,e),...t}));p.displayName=`CardFooter`;export{u as a,l as i,f as n,a as o,d as r,c as t};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{D as t,k as n,w as r}from"./react-D6ShNq95.js";import{c as i}from"./dist-C9EX46wM.js";var a=i(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),o=e(n(),1),s=t(),c=o.forwardRef(({className:e,hover:t=!0,surface:n=`raised`,...i},a)=>(0,s.jsx)(`div`,{ref:a,className:r(`rounded-2xl border bg-card text-card-foreground transition-colors duration-base`,n===`raised`?`border-border shadow-card`:`border-border/75 shadow-none`,t&&n===`raised`&&`hover:border-primary/25 hover:shadow-card-hover`,t&&n===`flat`&&`hover:bg-muted/40`,e),...i}));c.displayName=`Card`;var l=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`div`,{ref:n,className:r(`flex flex-col space-y-1.5 p-6`,e),...t}));l.displayName=`CardHeader`;var u=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`h3`,{ref:n,className:r(`text-[15px] font-semibold leading-tight tracking-tight text-foreground`,e),...t}));u.displayName=`CardTitle`;var d=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`p`,{ref:n,className:r(`text-[13px] text-muted-foreground leading-relaxed`,e),...t}));d.displayName=`CardDescription`;var f=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`div`,{ref:n,className:r(`p-6 pt-0`,e),...t}));f.displayName=`CardContent`;var p=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`div`,{ref:n,className:r(`flex items-center justify-between p-6 pt-0`,e),...t}));p.displayName=`CardFooter`;export{u as a,l as i,f as n,a as o,d as r,c as t};
@@ -1,4 +1,4 @@
1
- import{i as e,t}from"./chunk-DseTPa7n.js";import{D as n,S as r,a as i,k as a,n as o,r as s,w as c}from"./react-39CDNZlM.js";import{$t as l,Gt as u,Kt as d,Qt as f,Ut as p,Zt as m,ft as h,mt as g,pt as _,qt as v,un as y,vt as b,wt as x}from"./api-tWUa6l9J.js";import{c as S}from"./dist-rYHnBo8t.js";import{t as C}from"./search-BhXQB2TO.js";import{t as w}from"./book-open-BQ29ZmDE.js";import{C as T,a as E,i as D,n as O,r as k,t as A}from"./select-CVzGGT38.js";import{n as ee,t as j}from"./navigation-link-C1cvB7y4.js";import{a as te,c as ne,i as M,n as N,o as re,r as P,s as ie,t as F}from"./tabs-B-QWjKCL.js";import{i as ae,t as oe}from"./use-viewport-layout-k1isXfNm.js";import{t as se}from"./loader-circle-AOpK5kkW.js";import{t as ce}from"./x-C1ijNWcE.js";import{n as le,t as ue}from"./logo-badge-BXI-Kdhd.js";import{t as de}from"./tag-chip-C88mxjwx.js";import{t as fe}from"./form-actions-BnZVzLZf.js";import{n as pe,o as me,p as he,r as ge,t as _e}from"./use-config-BAr5bH2c.js";import{t as I}from"./config-hints-S3g-UVZb.js";import{a as ve,c as ye,i as be,l as xe,n as Se,o as L,r as Ce,s as we,t as Te}from"./config-split-page-uC6d_r9c.js";var Ee=S(`Hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),De=S(`Mail`,[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}]]),R=S(`MessageCircleMore`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]),z=S(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),Oe=S(`ToggleLeft`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`6`,ry:`6`,key:`f2vt7d`}],[`circle`,{cx:`8`,cy:`12`,r:`2`,key:`1nvbw3`}]]),B=e(a(),1),V=n();function ke({value:e,onChange:t,className:n,placeholder:r=``}){let[i,a]=(0,B.useState)(``),o=n=>{n.key===`Enter`&&i.trim()?(n.preventDefault(),t([...e,i.trim()]),a(``)):n.key===`Backspace`&&!i&&e.length>0&&t(e.slice(0,-1))},l=n=>{t(e.filter((e,t)=>t!==n))};return(0,V.jsxs)(`div`,{className:c(`flex min-h-[42px] flex-wrap gap-2 rounded-xl border border-gray-200/80 bg-white p-2`,n),children:[e.map((e,t)=>(0,V.jsxs)(de,{tone:`info`,className:`gap-1 px-2 py-1 text-sm`,children:[e,(0,V.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`transition-colors hover:text-rose-200`,children:(0,V.jsx)(ce,{className:`h-3 w-3`})})]},t)),(0,V.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),onKeyDown:o,className:`flex-1 outline-none min-w-[100px] bg-transparent text-sm`,placeholder:r||s(`enterTag`)})]})}function Ae(e){return e.includes(`token`)||e.includes(`secret`)||e.includes(`password`)?(0,V.jsx)(ae,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`url`)||e.includes(`host`)?(0,V.jsx)(ne,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`email`)||e.includes(`mail`)?(0,V.jsx)(De,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`id`)||e.includes(`from`)?(0,V.jsx)(Ee,{className:`h-3.5 w-3.5 text-gray-500`}):e===`enabled`||e===`consentGranted`?(0,V.jsx)(Oe,{className:`h-3.5 w-3.5 text-gray-500`}):(0,V.jsx)(re,{className:`h-3.5 w-3.5 text-gray-500`})}function je({channelName:e,fields:t,formData:n,jsonDrafts:r,setJsonDrafts:i,updateField:a,uiHints:o}){return(0,V.jsx)(V.Fragment,{children:t.map(t=>{let c=I(`channels.${e}.${t.name}`,o),l=c?.label??t.label,f=c?.placeholder;return(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsxs)(u,{htmlFor:t.name,className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[Ae(t.name),l]}),t.type===`boolean`&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-gray-50 p-3`,children:[(0,V.jsx)(`span`,{className:`text-sm text-gray-500`,children:n[t.name]?s(`enabled`):s(`disabled`)}),(0,V.jsx)(x,{id:t.name,checked:n[t.name]||!1,onCheckedChange:e=>a(t.name,e),className:`data-[state=checked]:bg-emerald-500`})]}),(t.type===`text`||t.type===`email`)&&(0,V.jsx)(d,{id:t.name,type:t.type,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:f,className:`rounded-xl`}),t.type===`password`&&(0,V.jsx)(d,{id:t.name,type:`password`,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:f??s(`leaveBlankToKeepUnchanged`),className:`rounded-xl`}),t.type===`number`&&(0,V.jsx)(d,{id:t.name,type:`number`,value:n[t.name]||0,onChange:e=>a(t.name,parseInt(e.target.value,10)||0),placeholder:f,className:`rounded-xl`}),t.type===`tags`&&(0,V.jsx)(ke,{value:n[t.name]||[],onChange:e=>a(t.name,e)}),t.type===`select`&&(0,V.jsxs)(A,{value:n[t.name]||``,onValueChange:e=>a(t.name,e),children:[(0,V.jsx)(D,{className:`rounded-xl`,children:(0,V.jsx)(E,{})}),(0,V.jsx)(O,{children:(t.options??[]).map(e=>(0,V.jsx)(k,{value:e.value,children:e.label},e.value))})]}),t.type===`json`&&(0,V.jsx)(`textarea`,{id:t.name,value:r[t.name]??`{}`,onChange:e=>i(n=>({...n,[t.name]:e.target.value})),className:`min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`})]},t.name)})})}var Me=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),H=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),U=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),Ne=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Pe=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Fe=t((e=>{var t=H().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),Ie=t((e=>{var t=H().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Le=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),W=t((e=>{var t=U(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Re=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),ze=t((e=>{var t=Re();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),Be=t(((e,t)=>{var n=ze();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),G=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),K=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
1
+ import{i as e,t}from"./chunk-DseTPa7n.js";import{D as n,S as r,a as i,k as a,n as o,r as s,w as c}from"./react-D6ShNq95.js";import{$t as l,Gt as u,Kt as d,Qt as f,Ut as p,Zt as m,ft as h,mt as g,pt as _,qt as v,un as y,vt as b,wt as x}from"./api-CHo2gekJ.js";import{c as S}from"./dist-C9EX46wM.js";import{t as C}from"./search-CLXM2reO.js";import{t as w}from"./book-open-BrZL4o9L.js";import{C as T,a as E,i as D,n as O,r as k,t as A}from"./select-CNFBf00l.js";import{n as ee,t as j}from"./navigation-link-BSJEUiwD.js";import{a as te,c as ne,i as M,n as N,o as re,r as P,s as ie,t as F}from"./tabs-BuNr8LSO.js";import{i as ae,t as oe}from"./use-viewport-layout-BACNZyMY.js";import{t as se}from"./loader-circle-B35NlHTI.js";import{t as ce}from"./x-BXFquY9e.js";import{n as le,t as ue}from"./logo-badge-DB51c0cS.js";import{t as de}from"./tag-chip-CDkB5smU.js";import{t as fe}from"./form-actions-DvvxCpL4.js";import{n as pe,o as me,p as he,r as ge,t as _e}from"./use-config-C69rR15i.js";import{t as I}from"./config-hints-S3g-UVZb.js";import{a as ve,c as ye,i as be,l as xe,n as Se,o as L,r as Ce,s as we,t as Te}from"./config-split-page-6y6W6dz4.js";var Ee=S(`Hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),De=S(`Mail`,[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}]]),R=S(`MessageCircleMore`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]),z=S(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),Oe=S(`ToggleLeft`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`6`,ry:`6`,key:`f2vt7d`}],[`circle`,{cx:`8`,cy:`12`,r:`2`,key:`1nvbw3`}]]),B=e(a(),1),V=n();function ke({value:e,onChange:t,className:n,placeholder:r=``}){let[i,a]=(0,B.useState)(``),o=n=>{n.key===`Enter`&&i.trim()?(n.preventDefault(),t([...e,i.trim()]),a(``)):n.key===`Backspace`&&!i&&e.length>0&&t(e.slice(0,-1))},l=n=>{t(e.filter((e,t)=>t!==n))};return(0,V.jsxs)(`div`,{className:c(`flex min-h-[42px] flex-wrap gap-2 rounded-xl border border-gray-200/80 bg-white p-2`,n),children:[e.map((e,t)=>(0,V.jsxs)(de,{tone:`info`,className:`gap-1 px-2 py-1 text-sm`,children:[e,(0,V.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`transition-colors hover:text-rose-200`,children:(0,V.jsx)(ce,{className:`h-3 w-3`})})]},t)),(0,V.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),onKeyDown:o,className:`flex-1 outline-none min-w-[100px] bg-transparent text-sm`,placeholder:r||s(`enterTag`)})]})}function Ae(e){return e.includes(`token`)||e.includes(`secret`)||e.includes(`password`)?(0,V.jsx)(ae,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`url`)||e.includes(`host`)?(0,V.jsx)(ne,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`email`)||e.includes(`mail`)?(0,V.jsx)(De,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`id`)||e.includes(`from`)?(0,V.jsx)(Ee,{className:`h-3.5 w-3.5 text-gray-500`}):e===`enabled`||e===`consentGranted`?(0,V.jsx)(Oe,{className:`h-3.5 w-3.5 text-gray-500`}):(0,V.jsx)(re,{className:`h-3.5 w-3.5 text-gray-500`})}function je({channelName:e,fields:t,formData:n,jsonDrafts:r,setJsonDrafts:i,updateField:a,uiHints:o}){return(0,V.jsx)(V.Fragment,{children:t.map(t=>{let c=I(`channels.${e}.${t.name}`,o),l=c?.label??t.label,f=c?.placeholder;return(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsxs)(u,{htmlFor:t.name,className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[Ae(t.name),l]}),t.type===`boolean`&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-gray-50 p-3`,children:[(0,V.jsx)(`span`,{className:`text-sm text-gray-500`,children:n[t.name]?s(`enabled`):s(`disabled`)}),(0,V.jsx)(x,{id:t.name,checked:n[t.name]||!1,onCheckedChange:e=>a(t.name,e),className:`data-[state=checked]:bg-emerald-500`})]}),(t.type===`text`||t.type===`email`)&&(0,V.jsx)(d,{id:t.name,type:t.type,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:f,className:`rounded-xl`}),t.type===`password`&&(0,V.jsx)(d,{id:t.name,type:`password`,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:f??s(`leaveBlankToKeepUnchanged`),className:`rounded-xl`}),t.type===`number`&&(0,V.jsx)(d,{id:t.name,type:`number`,value:n[t.name]||0,onChange:e=>a(t.name,parseInt(e.target.value,10)||0),placeholder:f,className:`rounded-xl`}),t.type===`tags`&&(0,V.jsx)(ke,{value:n[t.name]||[],onChange:e=>a(t.name,e)}),t.type===`select`&&(0,V.jsxs)(A,{value:n[t.name]||``,onValueChange:e=>a(t.name,e),children:[(0,V.jsx)(D,{className:`rounded-xl`,children:(0,V.jsx)(E,{})}),(0,V.jsx)(O,{children:(t.options??[]).map(e=>(0,V.jsx)(k,{value:e.value,children:e.label},e.value))})]}),t.type===`json`&&(0,V.jsx)(`textarea`,{id:t.name,value:r[t.name]??`{}`,onChange:e=>i(n=>({...n,[t.name]:e.target.value})),className:`min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`})]},t.name)})})}var Me=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),H=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),U=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),Ne=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Pe=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Fe=t((e=>{var t=H().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),Ie=t((e=>{var t=H().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Le=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),W=t((e=>{var t=U(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Re=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),ze=t((e=>{var t=Re();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),Be=t(((e,t)=>{var n=ze();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),G=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),K=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
2
2
  ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),q=t((e=>{var t=G(),n=K();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),Ve=t((e=>{var t=H(),n=W(),r=U(),i=q(),a=G(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),He=t((e=>{var t=H(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),Ue=t(((e,t)=>{var n=q();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),We=t(((e,t)=>{var n=q(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),Ge=t(((e,t)=>{var n=q();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),Ke=t(((e,t)=>{var n=q(),r=H();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
3
3
  Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),qe=t(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),Je=t((e=>{var t=q(),n=Ue(),r=We(),i=Ge(),a=Ke(),o=K(),s=H(),c=qe();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
4
4
  Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),Ye=t((e=>{var t=H(),n=U(),r=Ne(),i=Pe(),a=Fe(),o=Ie(),s=Le(),c=W(),l=Be(),u=Ve(),d=He(),f=q(),p=Je();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
@@ -0,0 +1 @@
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{D as t,S as n,k as r,r as i,w as a}from"./react-D6ShNq95.js";import{A as o,B as s,E as c,F as l,I as u,L as d,M as f,N as p,P as m,R as h,T as g,V as _,_ as v,_t as y,at as b,c as x,d as S,dt as ee,it as C,j as te,l as w,n as T,nt as E,o as ne,ot as D,s as O,ut as re,vt as k,yt as A,z as ie}from"./app-presenter-provider-2_DmWYT9.js";import{Kt as j,Wt as ae,Zt as oe,qt as M,vt as N}from"./api-CHo2gekJ.js";import{c as P}from"./dist-C9EX46wM.js";import{i as se,r as ce,t as le}from"./popover-Bp9IpE_N.js";import{a as ue,i as F,n as I,o as L,r as R,s as z}from"./confirm-dialog-q1CpEmR8.js";import{C as de,a as fe,i as pe,n as me,r as he,t as ge}from"./select-CNFBf00l.js";import{t as _e}from"./provider-scoped-model-input-dk7fz9NL.js";import{a as ve,o as B,t as ye}from"./use-confirm-dialog-DF_EgPYx.js";import{n as V,t as H}from"./card-B5rRLu_6.js";import{n as be,t as xe}from"./eye-B-3dyZNA.js";import{t as Se}from"./use-viewport-layout-BACNZyMY.js";import{t as U}from"./plus-BRVe5jSJ.js";import{t as Ce}from"./settings-2-B9IT2HGd.js";import{t as we}from"./trash-2-GchaJuEM.js";import{n as Te}from"./provider-models-CXUgDxGR.js";import{t as Ee}from"./tag-chip-CDkB5smU.js";import{t as De}from"./index-k_eWScvN.js";import{l as W,t as G,u as K}from"./use-config-C69rR15i.js";var Oe=P(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),q=e(r(),1),J=t(),Y=new Intl.NumberFormat;function ke({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:r,defaultRuntimeLabel:a,onOpenChange:o,onEdit:s}){if(!e)return null;let c=Ae(e.model,t?.model),l=je({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:r,defaultRuntimeLabel:a}),u=X(e.contextTokens,t?.contextTokens??2e5),d=X(e.reservedContextTokens,t?.reservedContextTokens),f=X(e.maxToolIterations,t?.maxToolIterations??1e3),m=Ae(e.thinkingDefault,t?.thinkingDefault??`off`),h=Ne(e.runtimeConfig??e.engineConfig,t?.engineConfig),g=Ne(e.models,t?.models);return(0,J.jsx)(I,{open:e!==null,onOpenChange:o,children:(0,J.jsxs)(R,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-white p-0 sm:max-h-[720px] sm:max-w-2xl`,children:[(0,J.jsx)(`div`,{className:`shrink-0 px-5 pb-3 pt-5`,children:(0,J.jsx)(L,{className:`text-left`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,J.jsx)(p,{agentId:e.id,displayName:e.displayName,avatarUrl:e.avatarUrl,className:`h-10 w-10 shrink-0`}),(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(z,{className:`truncate text-base`,children:e.displayName?.trim()||e.id}),(0,J.jsxs)(F,{className:`truncate text-xs`,children:[`@`,e.id]})]})]})})}),(0,J.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-5 py-3`,children:[(0,J.jsxs)(Z,{icon:ee,title:i(`agentsDetailsIdentitySection`),children:[(0,J.jsx)(Q,{label:i(`agentsDetailsFieldDisplayName`),value:e.displayName?.trim()||e.id}),(0,J.jsx)(Q,{label:i(`agentsDetailsFieldId`),value:e.id,mono:!0}),(0,J.jsx)(Q,{label:i(`agentsDetailsFieldDescription`),value:e.description?.trim()||i(`agentsDetailsEmptyValue`),wide:!0}),(0,J.jsx)(Q,{label:i(`agentsDetailsFieldWorkspace`),value:e.workspace??i(`agentsDetailsUnsetValue`),mono:!0,wide:!0})]}),(0,J.jsxs)(Z,{icon:B,title:i(`agentsDetailsRuntimeSection`),children:[(0,J.jsx)(Q,{label:i(`agentsDetailsFieldModel`),value:c.value,source:c.source}),(0,J.jsx)(Q,{label:i(`agentsDetailsFieldRuntime`),value:l.value,source:l.source}),(0,J.jsx)(Q,{label:i(`agentsDetailsFieldRuntimeConfig`),value:h.value,source:h.source,mono:!0,prewrap:!0})]}),(0,J.jsxs)(Z,{icon:Oe,title:i(`agentsDetailsContextSection`),children:[(0,J.jsx)(Q,{label:i(`agentsDetailsFieldContextTokens`),value:u.value,source:u.source}),(0,J.jsx)(Q,{label:i(`agentsDetailsFieldReservedContextTokens`),value:d.value,source:d.source}),(0,J.jsx)(Q,{label:i(`agentsDetailsFieldMaxToolIterations`),value:f.value,source:f.source})]}),(0,J.jsxs)(Z,{icon:re,title:i(`agentsDetailsBehaviorSection`),children:[(0,J.jsx)(Q,{label:i(`agentsDetailsFieldThinkingDefault`),value:m.value,source:m.source}),(0,J.jsx)(Q,{label:i(`agentsDetailsFieldModelOverrides`),value:g.value,source:g.source,mono:!0,prewrap:!0}),(0,J.jsx)(Q,{label:i(`agentsDetailsFieldAvatar`),value:e.avatar??i(`agentsDetailsUnsetValue`),mono:!0})]})]}),(0,J.jsxs)(ue,{className:`shrink-0 px-5 pb-4 pt-2`,children:[(0,J.jsx)(M,{type:`button`,variant:`ghost`,onClick:()=>o(!1),children:i(`cancel`)}),(0,J.jsxs)(M,{type:`button`,variant:`primary`,className:`px-4`,onClick:()=>s(e),children:[(0,J.jsx)(C,{className:`mr-2 h-4 w-4`}),i(`agentsDetailsEditAction`)]})]})]})})}function Ae(e,t){let n=e?.trim();return n?{value:n,source:`override`}:{value:t?.trim()||i(`agentsDetailsUnsetValue`),source:`default`}}function X(e,t){return typeof e==`number`?{value:Y.format(e),source:`override`}:{value:typeof t==`number`?Y.format(t):i(`agentsDetailsUnsetValue`),source:`default`}}function je(e){let{agent:t,defaults:n,runtimeOptions:r,defaultRuntime:i,defaultRuntimeLabel:a}=e,o=t.runtime?.trim()||t.engine?.trim();if(o)return{value:Me(o,r,a),source:`override`};let s=n?.engine?.trim()||i;return{value:s?Me(s,r,a):a,source:`default`}}function Me(e,t,n){let r=l(e);return r?t.find(e=>e.value===r)?.label??d(r):n}function Ne(e,t){return Pe(e)?{value:JSON.stringify(e,null,2),source:`override`}:{value:Pe(t)?JSON.stringify(t,null,2):i(`agentsDetailsUnsetValue`),source:`default`}}function Pe(e){return!!(e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length>0)}function Z(e){let{icon:t,title:n,children:r}=e;return(0,J.jsxs)(`section`,{className:`space-y-2 border-t border-gray-100 pt-3 first:border-t-0 first:pt-0`,children:[(0,J.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold leading-5 text-gray-900`,children:[(0,J.jsx)(t,{className:`h-3.5 w-3.5 text-gray-400`}),n]}),(0,J.jsx)(`dl`,{className:`grid min-w-0 gap-x-6 gap-y-2.5 pl-5 sm:grid-cols-2`,children:r})]})}function Q(e){let{label:t,value:n,source:r,mono:i=!1,prewrap:o=!1,wide:s=!1}=e,c=o&&n.trim().startsWith(`{`),l=i&&(!o||c);return(0,J.jsxs)(`div`,{className:a(`grid min-w-0 grid-cols-[10rem_minmax(0,1fr)] items-baseline gap-x-2`,(s||c)&&`sm:col-span-2`),children:[(0,J.jsx)(`dt`,{className:`flex min-w-0 items-baseline leading-5`,children:(0,J.jsx)(`span`,{className:`whitespace-nowrap text-xs font-medium text-gray-500`,children:t})}),(0,J.jsxs)(`dd`,{className:a(`min-w-0 break-words text-xs leading-5 text-gray-900`,c?`max-h-28 overflow-auto whitespace-pre-wrap rounded bg-gray-50/70 px-2 py-1.5 text-left`:``),children:[(0,J.jsx)(`span`,{className:l?`font-mono`:void 0,children:n}),r?(0,J.jsx)(Fe,{source:r}):null]})]})}function Fe({source:e}){return(0,J.jsxs)(`span`,{className:a(`ml-1 whitespace-nowrap text-xs font-normal leading-5`,e===`override`?`text-blue-500`:`text-gray-400`),children:[`(`,i(e===`override`?`agentsDetailsAgentOverride`:`agentsDetailsInheritedDefault`),`)`]})}function Ie({form:e,disabled:t=!1,onChange:n}){return(0,J.jsxs)(`details`,{className:`group rounded-2xl border border-gray-200 bg-white`,children:[(0,J.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-gray-800 [&::-webkit-details-marker]:hidden`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(Ce,{className:`h-4 w-4 shrink-0 text-gray-400`}),(0,J.jsx)(`span`,{className:`truncate`,children:i(`agentsAdvancedConfigToggle`)})]}),(0,J.jsx)(de,{className:`h-4 w-4 shrink-0 text-gray-400 transition-transform group-open:rotate-180`})]}),(0,J.jsxs)(`div`,{className:`space-y-4 border-t border-gray-100 px-4 py-4`,children:[(0,J.jsx)(`p`,{className:`text-xs leading-5 text-gray-500`,children:i(`agentsAdvancedConfigDescription`)}),(0,J.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:(0,J.jsx)(Le,{label:i(`agentsAdvancedContextTokensLabel`),value:e.contextTokens,min:1e3,step:1e3,disabled:t,onChange:e=>n({contextTokens:e})})})]})]})}function Le(e){let{label:t,value:n,min:r,step:a,disabled:o,onChange:s}=e;return(0,J.jsxs)(`label`,{className:`space-y-2 text-sm font-medium text-gray-700`,children:[(0,J.jsx)(`span`,{children:t}),(0,J.jsx)(j,{type:`number`,min:r,step:a,value:n,disabled:o,placeholder:i(`agentsAdvancedInheritPlaceholder`),"aria-label":t,onChange:e=>s(e.target.value)})]})}function Re(e){return{displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,model:e.model??``,runtime:e.runtime??e.engine??``,contextTokens:ze(e.contextTokens)}}function ze(e){return typeof e==`number`?String(e):``}var Be=q.forwardRef(({className:e,...t},n)=>(0,J.jsx)(`textarea`,{className:a(`flex min-h-28 w-full rounded-xl border border-border/75 bg-card px-3.5 py-2.5 text-sm text-foreground placeholder:text-muted-foreground/55 placeholder:font-normal transition-colors focus:outline-none focus:ring-0 focus:border-border disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));Be.displayName=`Textarea`;function Ve(e){let{runtimeOptions:t,currentRuntime:n}=e,r=n.trim();if(!r)return t;let i=l(r);return t.some(e=>e.value===i)?t:[...t,{value:i,label:d(i),icon:null,ready:!1,reason:`unavailable`,reasonMessage:null,supportedModels:void 0,recommendedModel:null,cta:null}].sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}function He({value:e,disabled:t=!1,runtimeOptions:n,defaultRuntime:r,onChange:a}){let o=e.trim()?l(e):``,s=Ve({runtimeOptions:n,currentRuntime:e}),c=s.find(e=>e.value===o)??null,u=c?.reasonMessage?.trim()||(c?.ready===!1?i(`agentsRuntimeUnavailableHelp`):``);return(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsxs)(ge,{value:o||r,onValueChange:e=>a(e===r?``:e),disabled:t,children:[(0,J.jsx)(pe,{"aria-label":i(`agentsCardRuntimeLabel`),className:`rounded-xl`,children:(0,J.jsx)(fe,{placeholder:i(`agentsRuntimeSelectPlaceholder`)})}),(0,J.jsx)(me,{className:`rounded-xl`,children:s.map(e=>(0,J.jsx)(he,{value:e.value,disabled:e.ready===!1&&e.value!==o,className:`rounded-lg`,children:e.label},e.value))})]}),u?(0,J.jsx)(`p`,{className:`text-xs text-gray-500`,children:u}):null]})}function Ue({agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,J.jsx)(I,{open:e!==null,onOpenChange:a,children:e?(0,J.jsx)(We,{agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e.id):null})}function We(e){let{agent:t,pending:n,providerCatalog:r,runtimeOptions:a,defaultRuntime:o,onOpenChange:s,onSubmit:c}=e,[l,u]=(0,q.useState)(Re(t));return(0,J.jsxs)(R,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-[linear-gradient(180deg,#fff9f1_0%,#ffffff_24%)] p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,J.jsx)(`div`,{className:`shrink-0 border-b border-[#f0e2c8] px-6 py-6`,children:(0,J.jsxs)(L,{className:`text-left`,children:[(0,J.jsx)(z,{children:i(`agentsEditDialogTitle`)}),(0,J.jsx)(F,{children:i(`agentsEditDialogDescription`)})]})}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,J.jsxs)(`div`,{className:`space-y-4`,children:[(0,J.jsx)(ve,{tone:`warning`,title:i(`agentsEditHomeReadonly`),description:i(`agentsEditHomeReadonlyHint`),children:(0,J.jsx)(`div`,{className:`break-all text-sm text-amber-950`,children:t.workspace??`-`})}),(0,J.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,J.jsx)(j,{value:l.displayName,onChange:e=>u(t=>({...t,displayName:e.target.value})),placeholder:i(`agentsFormNamePlaceholder`)}),(0,J.jsx)(Be,{value:l.description,onChange:e=>u(t=>({...t,description:e.target.value})),placeholder:i(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,J.jsx)(j,{value:l.avatar,onChange:e=>u(t=>({...t,avatar:e.target.value})),placeholder:i(`agentsFormAvatarPlaceholder`)}),(0,J.jsx)(_e,{value:l.model,onChange:e=>u(t=>({...t,model:e})),providerCatalog:r,disabled:n,className:`md:col-span-2`}),(0,J.jsx)(He,{value:l.runtime,onChange:e=>u(t=>({...t,runtime:e})),runtimeOptions:a,defaultRuntime:o,disabled:n})]}),(0,J.jsx)(Ie,{form:l,disabled:n,onChange:e=>u(t=>({...t,...e}))})]})}),(0,J.jsxs)(ue,{className:`shrink-0 border-t border-[#f1e7d4] px-6 py-5`,children:[(0,J.jsx)(M,{type:`button`,variant:`ghost`,onClick:()=>s(!1),disabled:n,children:i(`cancel`)}),(0,J.jsxs)(M,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>c(t.id,l),disabled:n,children:[(0,J.jsx)(C,{className:`mr-2 h-4 w-4`}),i(`agentsEditSaveAction`)]})]})]})}var Ge=`请直接创建一个默认示例 Agent,不要问我问题。创建完成后,简单告诉我它能做什么。`;function Ke(e,t){let n=e.trim();if(!n)return null;let r=Number(n);if(!Number.isFinite(r))throw Error(i(`agentsAdvancedInvalidNumberError`));return Math.max(t,Math.trunc(r))}function qe(e){return{displayName:e.displayName,description:e.description,avatar:e.avatar,model:e.model,...e.runtime.trim()?{runtime:e.runtime.trim()}:{runtime:``},contextTokens:Ke(e.contextTokens,1e3)}}function Je(e){let{agentCount:t,onCreate:n}=e;return(0,J.jsxs)(`section`,{className:`flex flex-col gap-3 border-b border-gray-200 pb-4 sm:flex-row sm:items-end sm:justify-between`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`h1`,{className:`text-xl font-semibold text-gray-950`,children:i(`agentsHeroEyebrow`)}),(0,J.jsx)(`span`,{className:`rounded-full border border-gray-200 bg-white px-2 py-0.5 text-xs font-medium text-gray-500`,children:t})]}),(0,J.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-gray-500`,children:i(`agentsHeroDescription`)})]}),(0,J.jsxs)(M,{type:`button`,variant:`primary`,className:`h-9 shrink-0 rounded-xl px-4 text-sm font-semibold`,onClick:n,children:[(0,J.jsx)(U,{className:`mr-2 h-4 w-4`}),i(`agentsCreateButton`)]})]})}function $(e){let{icon:t,label:n,disabled:r=!1,destructive:i=!1,onClick:o}=e;return(0,J.jsxs)(`button`,{type:`button`,className:a(`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,i?`text-destructive hover:bg-destructive/10`:`text-gray-700 hover:bg-gray-100`),onClick:o,disabled:r,children:[(0,J.jsx)(t,{className:`h-4 w-4 shrink-0`}),(0,J.jsx)(`span`,{children:n})]})}function Ye(e){let{agent:t,runtimeOptions:n,defaultRuntimeLabel:r,updatePending:a,deletePending:o,onStartChat:s,onView:c,onEdit:u,onDelete:f}=e,m=t.runtime?.trim()||t.engine?.trim()||``,h=m?n.find(e=>e.value===l(m))?.label??d(m):r;return(0,J.jsx)(H,{className:`group overflow-hidden border border-gray-200 bg-white shadow-none transition-colors duration-200 hover:border-gray-300`,children:(0,J.jsxs)(V,{className:`relative flex h-full flex-col gap-3 px-3.5 py-3.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-16`,children:[(0,J.jsx)(p,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-9 w-9 shrink-0`}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`div`,{className:`truncate text-sm font-semibold text-gray-950`,children:t.displayName?.trim()||t.id}),t.builtIn?(0,J.jsxs)(Ee,{tone:`warning`,className:`h-5 gap-1 border-amber-200 bg-amber-50 px-1.5 text-[10px] text-amber-700`,children:[(0,J.jsx)(E,{className:`h-3 w-3`}),i(`agentsCardBuiltInTag`)]}):null]}),(0,J.jsxs)(`div`,{className:`truncate text-xs text-gray-400`,children:[`@`,t.id]})]})]}),(0,J.jsxs)(`div`,{className:`absolute right-2.5 top-2.5 flex items-center gap-1 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,children:[(0,J.jsx)(M,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":i(`agentsCardStartChat`),title:i(`agentsCardStartChat`),onClick:s,children:(0,J.jsx)(b,{className:`h-4 w-4`})}),(0,J.jsxs)(le,{children:[(0,J.jsx)(se,{asChild:!0,children:(0,J.jsx)(M,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":i(`chatSessionMoreActions`),title:i(`chatSessionMoreActions`),children:(0,J.jsx)(be,{className:`h-4 w-4`})})}),(0,J.jsxs)(ce,{align:`end`,className:`w-44 p-1.5`,children:[(0,J.jsx)($,{icon:xe,label:i(`agentsViewDetailsAction`),onClick:c}),(0,J.jsx)($,{icon:C,label:i(`agentsEditAction`),onClick:u,disabled:a}),t.builtIn?null:(0,J.jsx)($,{icon:we,label:i(`agentsRemoveAction`),onClick:f,disabled:o,destructive:!0})]})]})]}),(0,J.jsx)(`p`,{className:`line-clamp-2 min-h-10 text-sm leading-5 text-gray-600`,children:t.description?.trim()||(t.builtIn?i(`agentsCardBuiltInSummary`):i(`agentsCardCustomSummary`))}),(0,J.jsxs)(`div`,{className:`mt-auto grid gap-2 border-t border-gray-100 pt-2 text-xs text-gray-500`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(B,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,J.jsx)(`span`,{className:`truncate`,children:h})]}),(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(D,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,J.jsx)(`span`,{className:`truncate`,children:t.workspace??`-`})]})]})]})})}function Xe(){let e=_(),t=T(),n=k(),r=o(),a=G(),s=K(),c=W(),p=ne(),h=f(),g=te(),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(null),S=(0,q.useMemo)(()=>r.data?.agents??[],[r.data?.agents]),C=(0,q.useMemo)(()=>[...S].sort((e,t)=>Number(!!t.builtIn)-Number(!!e.builtIn)||e.id.localeCompare(t.id)),[S]),w=(0,q.useMemo)(()=>Te({config:a.data,providersView:s.data,templatesView:c.data,onlyConfigured:!0}),[a.data,s.data,c.data]),E=(0,q.useMemo)(()=>m(p.data?.options??[]),[p.data?.options]),D=(0,q.useMemo)(()=>l(p.data?.defaultType??`native`),[p.data?.defaultType]),O=(0,q.useMemo)(()=>E.find(e=>e.value===D)?.label??d(D),[D,E]),re=a.data?.agents.defaults,A=e=>{y(e)},ie=e=>{x(e)},j=async(e,t)=>{let n;try{n=qe(t)}catch(e){oe.error(e instanceof Error?e.message:i(`agentsAdvancedParseFailed`));return}await h.mutateAsync({agentId:e,data:n}),x(null)},N=t=>{e.chatSessionListManager.startAgentDraftChat(t.id,u(t,D))},P=()=>{n(`/chat`),t.chatDraftIntentManager.requestDraft(Ge)};return(0,J.jsxs)(ae,{className:`space-y-5`,children:[(0,J.jsx)(Je,{agentCount:S.length,onCreate:P}),(0,J.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:r.isLoading?(0,J.jsx)(H,{className:`md:col-span-2 xl:col-span-3 border-dashed border-[#d9dce3] bg-white/70`,children:(0,J.jsx)(V,{className:`py-14 text-center text-sm text-gray-500`,children:i(`agentsLoading`)})}):C.length===0?(0,J.jsx)(H,{className:`md:col-span-2 xl:col-span-3 overflow-hidden border-dashed border-[#d9dce3] bg-[linear-gradient(135deg,#fff7ea_0%,#f4fbff_100%)]`,children:(0,J.jsxs)(V,{className:`flex min-h-[240px] flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,J.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-white/80 shadow-[0_18px_44px_rgba(0,0,0,0.08)]`,children:(0,J.jsx)(ee,{className:`h-8 w-8 text-[#d39a3b]`})}),(0,J.jsx)(`div`,{className:`text-lg font-semibold text-[#2f2212]`,children:i(`agentsEmpty`)}),(0,J.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-[#78644d]`,children:i(`agentsEmptyDescription`)}),(0,J.jsxs)(M,{type:`button`,variant:`primary`,className:`mt-5 rounded-2xl px-5`,onClick:P,children:[(0,J.jsx)(U,{className:`mr-2 h-4 w-4`}),i(`agentsCreateButton`)]})]})}):C.map(e=>(0,J.jsx)(Ye,{agent:e,runtimeOptions:E,defaultRuntimeLabel:O,updatePending:h.isPending,deletePending:g.isPending,onStartChat:()=>N(e),onView:()=>A(e),onEdit:()=>ie(e),onDelete:()=>g.mutate({agentId:e.id})},e.id))}),(0,J.jsx)(ke,{agent:v,defaults:re,runtimeOptions:E,defaultRuntime:D,defaultRuntimeLabel:O,onOpenChange:e=>{e||y(null)},onEdit:e=>{y(null),x(e)}}),(0,J.jsx)(Ue,{agent:b,pending:h.isPending,providerCatalog:w,runtimeOptions:E,defaultRuntime:D,onOpenChange:e=>{!e&&!h.isPending&&x(null)},onSubmit:j})]})}function Ze(e){let{view:t,routeSessionKey:n,syncRouteSessionSelection:r}=e;(0,q.useLayoutEffect)(()=>{r({isChatView:t===`chat`,routeSessionKey:n})},[n,r,t])}function Qe({view:e,confirmDialog:t}){let{isMobile:n}=Se();return(0,J.jsxs)(`div`,{className:`h-full flex`,children:[n?null:(0,J.jsx)(w,{}),e===`chat`?n?(0,J.jsx)(S,{}):(0,J.jsx)(g,{}):(0,J.jsx)(`section`,{className:`flex-1 min-h-0 overflow-hidden bg-background`,children:e===`inbox`?(0,J.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-[min(1180px,100%)] flex-col py-4 sm:px-6 sm:py-5`,children:(0,J.jsx)(v,{})}):e===`cron`?(0,J.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,J.jsx)(`div`,{className:`mx-auto w-full max-w-[min(1120px,100%)] px-4 py-4 sm:px-6 sm:py-5`,children:(0,J.jsx)(c,{})})}):e===`agents`?(0,J.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,J.jsx)(`div`,{className:`mx-auto w-full max-w-[min(1180px,100%)] px-4 py-4 sm:px-6 sm:py-5`,children:(0,J.jsx)(Xe,{})})}):(0,J.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,J.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-[min(1120px,100%)] flex-col px-4 py-4 sm:px-6 sm:py-5`,children:(0,J.jsx)(De,{forcedType:`skills`})})})}),t]})}function $e(e){let t=_(),n=G(),r=K(),i=W(),a=ie({limit:200}),o=ne(),s=e.sessionKey?.trim()||`draft-session`,c=h({sessionId:s});(0,q.useEffect)(()=>{t.chatQueryManager.syncSnapshot({configQuery:n,providersQuery:r,providerTemplatesQuery:i,sessionsQuery:a,sessionTypesQuery:o,sessionSkillsSessionId:s,sessionSkillsQuery:c})},[n,t.chatQueryManager,r,s,c,a,o,i])}function et(){let e=_();(0,q.useEffect)(()=>N.eventBus.on(n.uiShowContent,t=>{e.chatThreadManager.handleUiShowContentEvent(t)}),[e])}function tt(){let{sessionId:e}=A(),t=(0,q.useMemo)(()=>x(e),[e]);return{routeSessionKey:t,sessionKey:t??void 0}}function nt(){let e=_(),{confirm:t,ConfirmDialog:n}=ye(),r=y(),i=k();return(0,q.useEffect)(()=>{e.chatUiManager.syncState({pathname:r.pathname}),e.chatUiManager.bindActions({navigate:i,confirm:t})},[t,r.pathname,i,e]),(0,J.jsx)(n,{})}function rt({view:e}){let t=T();return(0,J.jsx)(s,{presenter:(0,q.useMemo)(()=>new O(t),[t]),children:(0,J.jsx)(it,{view:e})})}function it({view:e}){let t=T(),n=_(),r=nt(),{routeSessionKey:i,sessionKey:a}=tt();return(0,q.useEffect)(()=>(t.chatCompletionNotificationManager.syncActiveSession(a??null),()=>{t.chatCompletionNotificationManager.syncActiveSession(null)}),[t.chatCompletionNotificationManager,a]),$e({sessionKey:a??null}),Ze({view:e,routeSessionKey:i,syncRouteSessionSelection:n.chatSessionListManager.syncRouteSessionSelection}),et(),(0,J.jsx)(Qe,{view:e,confirmDialog:r})}function at({view:e}){return(0,J.jsx)(rt,{view:e})}export{at as ChatPage};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{D as t,k as n,r,w as i}from"./react-39CDNZlM.js";import{n as a}from"./search-BhXQB2TO.js";var o=e(n(),1),s=t(),c=`min-w-0 overflow-hidden bg-card/70 text-card-foreground md:h-[calc(100vh-180px)] md:max-h-[860px]`,l=`min-h-0 overflow-hidden rounded-2xl bg-muted/30 ring-1 ring-border/45`,u=640;function d({className:e,children:t,compactView:n,onMobileBack:c,mobileListLabel:d,...f}){let p=(0,o.useRef)(null),[m,h]=(0,o.useState)(!1),[g,_,...v]=o.Children.toArray(t);(0,o.useEffect)(()=>{let e=p.current;if(!e||!n||typeof ResizeObserver>`u`)return;let t=()=>h(e.clientWidth>0&&e.clientWidth<u),r=new ResizeObserver(t);return r.observe(e),t(),()=>r.disconnect()},[n]);let y=!!(m&&n&&g&&_);return(0,s.jsx)(`div`,{ref:p,className:i(`min-h-0 md:flex-1`,e),...f,children:y?(0,s.jsxs)(`div`,{className:`space-y-3`,children:[n===`detail`?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`button`,{type:`button`,onClick:c,className:`inline-flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,children:[(0,s.jsx)(a,{className:`h-4 w-4`}),(0,s.jsx)(`span`,{children:d??r(`backToMain`)})]}),(0,s.jsx)(`div`,{className:l,children:_})]}):(0,s.jsx)(`div`,{className:l,children:g}),v]}):(0,s.jsx)(`div`,{className:i(l,`grid grid-cols-1 md:grid-cols-[minmax(240px,30%)_minmax(0,1fr)]`),children:t})})}function f({className:e,...t}){return(0,s.jsx)(`section`,{className:i(c,`flex flex-col md:border-r md:border-border/55`,e),...t})}function p({className:e,...t}){return(0,s.jsx)(`section`,{className:i(c,`flex flex-col`,e),...t})}function m({className:e,...t}){return(0,s.jsx)(`section`,{className:i(c,`flex items-center justify-center px-6 py-12 text-center`,e),...t})}function h({className:e,...t}){return(0,s.jsx)(`div`,{className:i(`shrink-0 border-b border-border/70`,e),...t})}function g({className:e,scrollOnDesktop:t=!0,...n}){return(0,s.jsx)(`div`,{className:i(`min-h-0 flex-1`,t&&`overflow-visible md:overflow-y-auto md:overscroll-contain`,e),...n})}function _({className:e,...t}){return(0,s.jsx)(`div`,{className:i(`shrink-0 border-t border-border/70 px-4 py-2.5`,e),...t})}function v({active:e=!1,className:t,type:n=`button`,...r}){return(0,s.jsx)(`button`,{type:n,className:i(`w-full rounded-xl p-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,e?`bg-background/95 text-foreground shadow-sm`:`bg-transparent text-muted-foreground hover:bg-background/65 hover:text-foreground`,t),...r})}function y({icon:e,title:t,description:n,className:r,...a}){return(0,s.jsxs)(`div`,{className:i(`flex min-h-[220px] flex-col items-center justify-center rounded-xl bg-background/55 px-4 py-10 text-center`,r),...a,children:[(0,s.jsx)(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-card`,children:(0,s.jsx)(e,{className:`h-5 w-5 text-muted-foreground/45`})}),(0,s.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t}),n?(0,s.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:n}):null]})}export{d as a,h as c,y as i,f as l,p as n,g as o,m as r,_ as s,v as t};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{D as t,k as n,r,w as i}from"./react-D6ShNq95.js";import{n as a}from"./search-CLXM2reO.js";var o=e(n(),1),s=t(),c=`min-w-0 overflow-hidden bg-card/70 text-card-foreground md:h-[calc(100vh-180px)] md:max-h-[860px]`,l=`min-h-0 overflow-hidden rounded-2xl bg-muted/30 ring-1 ring-border/45`,u=640;function d({className:e,children:t,compactView:n,onMobileBack:c,mobileListLabel:d,...f}){let p=(0,o.useRef)(null),[m,h]=(0,o.useState)(!1),[g,_,...v]=o.Children.toArray(t);(0,o.useEffect)(()=>{let e=p.current;if(!e||!n||typeof ResizeObserver>`u`)return;let t=()=>h(e.clientWidth>0&&e.clientWidth<u),r=new ResizeObserver(t);return r.observe(e),t(),()=>r.disconnect()},[n]);let y=!!(m&&n&&g&&_);return(0,s.jsx)(`div`,{ref:p,className:i(`min-h-0 md:flex-1`,e),...f,children:y?(0,s.jsxs)(`div`,{className:`space-y-3`,children:[n===`detail`?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`button`,{type:`button`,onClick:c,className:`inline-flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,children:[(0,s.jsx)(a,{className:`h-4 w-4`}),(0,s.jsx)(`span`,{children:d??r(`backToMain`)})]}),(0,s.jsx)(`div`,{className:l,children:_})]}):(0,s.jsx)(`div`,{className:l,children:g}),v]}):(0,s.jsx)(`div`,{className:i(l,`grid grid-cols-1 md:grid-cols-[minmax(240px,30%)_minmax(0,1fr)]`),children:t})})}function f({className:e,...t}){return(0,s.jsx)(`section`,{className:i(c,`flex flex-col md:border-r md:border-border/55`,e),...t})}function p({className:e,...t}){return(0,s.jsx)(`section`,{className:i(c,`flex flex-col`,e),...t})}function m({className:e,...t}){return(0,s.jsx)(`section`,{className:i(c,`flex items-center justify-center px-6 py-12 text-center`,e),...t})}function h({className:e,...t}){return(0,s.jsx)(`div`,{className:i(`shrink-0 border-b border-border/70`,e),...t})}function g({className:e,scrollOnDesktop:t=!0,...n}){return(0,s.jsx)(`div`,{className:i(`min-h-0 flex-1`,t&&`overflow-visible md:overflow-y-auto md:overscroll-contain`,e),...n})}function _({className:e,...t}){return(0,s.jsx)(`div`,{className:i(`shrink-0 border-t border-border/70 px-4 py-2.5`,e),...t})}function v({active:e=!1,className:t,type:n=`button`,...r}){return(0,s.jsx)(`button`,{type:n,className:i(`w-full rounded-xl p-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,e?`bg-background/95 text-foreground shadow-sm`:`bg-transparent text-muted-foreground hover:bg-background/65 hover:text-foreground`,t),...r})}function y({icon:e,title:t,description:n,className:r,...a}){return(0,s.jsxs)(`div`,{className:i(`flex min-h-[220px] flex-col items-center justify-center rounded-xl bg-background/55 px-4 py-10 text-center`,r),...a,children:[(0,s.jsx)(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-card`,children:(0,s.jsx)(e,{className:`h-5 w-5 text-muted-foreground/45`})}),(0,s.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t}),n?(0,s.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:n}):null]})}export{d as a,h as c,y as i,f as l,p as n,g as o,m as r,_ as s,v as t};
@@ -1,4 +1,4 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{D as t,k as n,r,w as i}from"./react-39CDNZlM.js";import{qt as a}from"./api-tWUa6l9J.js";import{C as o,S as s,T as c,_ as l,b as u,d,f as ee,g as f,l as te,m as ne,p as re,u as ie,w as p,y as ae}from"./dist-rYHnBo8t.js";import{d as m}from"./popover-ZoDwVwwd.js";import{t as oe}from"./x-C1ijNWcE.js";var h=e(n(),1),g=t(),_=`Dialog`,[v,se]=o(_),[ce,y]=v(_),b=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=h.useRef(null),c=h.useRef(null),[l,d]=ae({prop:r,defaultProp:i??!1,onChange:a,caller:_});return(0,g.jsx)(ce,{scope:t,triggerRef:s,contentRef:c,contentId:u(),titleId:u(),descriptionId:u(),open:l,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};b.displayName=_;var x=`DialogTrigger`,S=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(x,n),a=p(t,i.triggerRef);return(0,g.jsx)(f.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":L(i.open),...r,ref:a,onClick:c(e.onClick,i.onOpenToggle)})});S.displayName=x;var C=`DialogPortal`,[le,w]=v(C,{forceMount:void 0}),T=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=y(C,t);return(0,g.jsx)(le,{scope:t,forceMount:n,children:h.Children.map(r,e=>(0,g.jsx)(m,{present:n||a.open,children:(0,g.jsx)(ee,{asChild:!0,container:i,children:e})}))})};T.displayName=C;var E=`DialogOverlay`,D=h.forwardRef((e,t)=>{let n=w(E,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=y(E,e.__scopeDialog);return a.modal?(0,g.jsx)(m,{present:r||a.open,children:(0,g.jsx)(de,{...i,ref:t})}):null});D.displayName=E;var ue=l(`DialogOverlay.RemoveScroll`),de=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(E,n);return(0,g.jsx)(ie,{as:ue,allowPinchZoom:!0,shards:[i.contentRef],children:(0,g.jsx)(f.div,{"data-state":L(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),O=`DialogContent`,k=h.forwardRef((e,t)=>{let n=w(O,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=y(O,e.__scopeDialog);return(0,g.jsx)(m,{present:r||a.open,children:a.modal?(0,g.jsx)(fe,{...i,ref:t}):(0,g.jsx)(pe,{...i,ref:t})})});k.displayName=O;var fe=h.forwardRef((e,t)=>{let n=y(O,e.__scopeDialog),r=h.useRef(null),i=p(t,n.contentRef,r);return h.useEffect(()=>{let e=r.current;if(e)return te(e)},[]),(0,g.jsx)(A,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:c(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:c(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:c(e.onFocusOutside,e=>e.preventDefault())})}),pe=h.forwardRef((e,t)=>{let n=y(O,e.__scopeDialog),r=h.useRef(!1),i=h.useRef(!1);return(0,g.jsx)(A,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),A=h.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=y(O,n),c=h.useRef(null),l=p(t,c);return d(),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(re,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,g.jsx)(ne,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":L(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(he,{titleId:s.titleId}),(0,g.jsx)(_e,{contentRef:c,descriptionId:s.descriptionId})]})]})}),j=`DialogTitle`,M=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(j,n);return(0,g.jsx)(f.h2,{id:i.titleId,...r,ref:t})});M.displayName=j;var N=`DialogDescription`,P=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(N,n);return(0,g.jsx)(f.p,{id:i.descriptionId,...r,ref:t})});P.displayName=N;var F=`DialogClose`,I=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(F,n);return(0,g.jsx)(f.button,{type:`button`,...r,ref:t,onClick:c(e.onClick,()=>i.onOpenChange(!1))})});I.displayName=F;function L(e){return e?`open`:`closed`}var R=`DialogTitleWarning`,[me,z]=s(R,{contentName:O,titleName:j,docsSlug:`dialog`}),he=({titleId:e})=>{let t=z(R),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{D as t,k as n,r,w as i}from"./react-D6ShNq95.js";import{qt as a}from"./api-CHo2gekJ.js";import{C as o,S as s,T as c,_ as l,b as u,d,f as ee,g as f,l as te,m as ne,p as re,u as ie,w as p,y as ae}from"./dist-C9EX46wM.js";import{d as m}from"./popover-Bp9IpE_N.js";import{t as oe}from"./x-BXFquY9e.js";var h=e(n(),1),g=t(),_=`Dialog`,[v,se]=o(_),[ce,y]=v(_),b=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=h.useRef(null),c=h.useRef(null),[l,d]=ae({prop:r,defaultProp:i??!1,onChange:a,caller:_});return(0,g.jsx)(ce,{scope:t,triggerRef:s,contentRef:c,contentId:u(),titleId:u(),descriptionId:u(),open:l,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};b.displayName=_;var x=`DialogTrigger`,S=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(x,n),a=p(t,i.triggerRef);return(0,g.jsx)(f.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":L(i.open),...r,ref:a,onClick:c(e.onClick,i.onOpenToggle)})});S.displayName=x;var C=`DialogPortal`,[le,w]=v(C,{forceMount:void 0}),T=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=y(C,t);return(0,g.jsx)(le,{scope:t,forceMount:n,children:h.Children.map(r,e=>(0,g.jsx)(m,{present:n||a.open,children:(0,g.jsx)(ee,{asChild:!0,container:i,children:e})}))})};T.displayName=C;var E=`DialogOverlay`,D=h.forwardRef((e,t)=>{let n=w(E,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=y(E,e.__scopeDialog);return a.modal?(0,g.jsx)(m,{present:r||a.open,children:(0,g.jsx)(de,{...i,ref:t})}):null});D.displayName=E;var ue=l(`DialogOverlay.RemoveScroll`),de=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(E,n);return(0,g.jsx)(ie,{as:ue,allowPinchZoom:!0,shards:[i.contentRef],children:(0,g.jsx)(f.div,{"data-state":L(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),O=`DialogContent`,k=h.forwardRef((e,t)=>{let n=w(O,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=y(O,e.__scopeDialog);return(0,g.jsx)(m,{present:r||a.open,children:a.modal?(0,g.jsx)(fe,{...i,ref:t}):(0,g.jsx)(pe,{...i,ref:t})})});k.displayName=O;var fe=h.forwardRef((e,t)=>{let n=y(O,e.__scopeDialog),r=h.useRef(null),i=p(t,n.contentRef,r);return h.useEffect(()=>{let e=r.current;if(e)return te(e)},[]),(0,g.jsx)(A,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:c(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:c(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:c(e.onFocusOutside,e=>e.preventDefault())})}),pe=h.forwardRef((e,t)=>{let n=y(O,e.__scopeDialog),r=h.useRef(!1),i=h.useRef(!1);return(0,g.jsx)(A,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),A=h.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=y(O,n),c=h.useRef(null),l=p(t,c);return d(),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(re,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,g.jsx)(ne,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":L(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(he,{titleId:s.titleId}),(0,g.jsx)(_e,{contentRef:c,descriptionId:s.descriptionId})]})]})}),j=`DialogTitle`,M=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(j,n);return(0,g.jsx)(f.h2,{id:i.titleId,...r,ref:t})});M.displayName=j;var N=`DialogDescription`,P=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(N,n);return(0,g.jsx)(f.p,{id:i.descriptionId,...r,ref:t})});P.displayName=N;var F=`DialogClose`,I=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(F,n);return(0,g.jsx)(f.button,{type:`button`,...r,ref:t,onClick:c(e.onClick,()=>i.onOpenChange(!1))})});I.displayName=F;function L(e){return e?`open`:`closed`}var R=`DialogTitleWarning`,[me,z]=s(R,{contentName:O,titleName:j,docsSlug:`dialog`}),he=({titleId:e})=>{let t=z(R),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
2
 
3
3
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
4
 
@@ -1 +1 @@
1
- import{D as e,a as t,n,r,w as i}from"./react-39CDNZlM.js";import{$t as a,At as o,Bt as s,Dt as c,Et as l,Ht as u,Ot as d,Ut as f,Vt as p,jt as m,qt as h}from"./api-tWUa6l9J.js";import{a as g,i as _,n as v,r as y,t as b}from"./select-CVzGGT38.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./card-CtKueklV.js";import{t as D}from"./navigation-link-C1cvB7y4.js";import{t as O}from"./refresh-cw-DKewcdAl.js";import{t as k}from"./rotate-cw-PmqA8LQT.js";var A=e(),j={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`},M={feature:`desktopUpdatesReleaseNotesFeature`,enhancement:`desktopUpdatesReleaseNotesEnhancement`,fix:`desktopUpdatesReleaseNotesFix`,compatibility:`desktopUpdatesReleaseNotesCompatibility`};function N({snapshot:e}){return(0,A.jsx)(`span`,{className:i(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,H(e.status)),children:V(e)})}function P({label:e,value:t}){return(0,A.jsxs)(`div`,{className:`rounded-lg bg-background/70 p-3`,children:[(0,A.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,A.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-foreground`,children:t})]})}function F({snapshot:e}){if(e.status!==`downloading`)return null;let t=e.progress?.percent,n=t==null?r(`desktopUpdatesDownloadProgressUnknown`):r(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(t)),i=R(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:n}),(0,A.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:i})]}),(0,A.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${t??0}%`}})})]})}function I(e){return e?.trim()||`-`}function L(e){return e?n(e):`-`}function R(e,t){let n=z(e);return t&&t>0?`${n} / ${z(t)}`:n}function z(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function B(e){return r(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function V(e){return e.status===`failed`&&e.failureStage?r(`desktopUpdatesFailureStage.${e.failureStage}`):r(j[e.status]??`desktopUpdatesStatusIdle`)}function H(e){return e===`downloaded`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function U(){return t()===`zh`?`zh-CN`:`en-US`}function W(e,t){return c(e.title,t)??r(M[e.kind]??`desktopUpdatesReleaseNotesEnhancement`)}function G({snapshot:e}){let t=d(e),n=U(),i=a({queryKey:[`runtime-release-notes`,t],queryFn:async()=>await l(t??``),enabled:!!t,retry:!1,staleTime:300*1e3}),o=i.data,s=c(o?.title,n)??r(`desktopUpdatesReleaseNotesPreviewTitle`),u=c(o?.summary,n)??r(`desktopUpdatesReleaseNotesPreviewDescription`);return e.releaseNotesUrl?(0,A.jsxs)(E,{children:[(0,A.jsx)(S,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(x,{children:s}),(0,A.jsx)(T,{children:u})]}),(0,A.jsx)(D,{href:e.releaseNotesUrl,external:!0,children:r(`desktopUpdatesReleaseNotes`)})]})}),(0,A.jsxs)(C,{className:`space-y-4`,children:[i.isLoading?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:r(`desktopUpdatesReleaseNotesPreviewLoading`)}):null,!t||i.isError?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:r(`desktopUpdatesReleaseNotesPreviewUnavailable`)}):null,o?(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:o.sections.map(e=>(0,A.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:W(e,n)}),(0,A.jsx)(`ul`,{className:`mt-3 space-y-3`,children:e.items.map((t,r)=>{let i=c(t.title,n),a=c(t.body,n);return(0,A.jsxs)(`li`,{className:`space-y-1`,children:[i?(0,A.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:i}):null,a?(0,A.jsx)(`p`,{className:`text-sm leading-5 text-gray-600`,children:a}):null]},`${i??e.kind}-${r}`)})})]},e.kind))}):null]})]}):null}function K(){return(0,A.jsx)(f,{title:r(`runtimeUpdatesPageTitle`),description:r(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(u,{title:r(`runtimeUpdatesUnavailableTitle`),description:r(`runtimeUpdatesUnavailableDescription`),children:(0,A.jsx)(p,{children:(0,A.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:r(`runtimeUpdatesUnavailableHint`)})})})})}function q(){let{supported:e,initialized:t,busyAction:n,snapshot:a}=m();if(!t)return(0,A.jsx)(f,{title:r(`runtimeUpdatesPageTitle`),description:r(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:r(`loading`)})});if(!e||!a)return(0,A.jsx)(K,{});let c=n===`checking`,l=n===`downloading`,d=n===`applying`,x=n===`switching-channel`,S=a.status===`update-available`&&!l&&!d,C=a.status===`downloaded`&&!d,T=[[r(`runtimeUpdatesHostVersion`),I(a.hostVersion)],[r(`desktopUpdatesCurrentBundleVersion`),I(a.currentVersion)],[r(`desktopUpdatesAvailableVersion`),I(a.availableVersion)],[r(`desktopUpdatesLastCheckedAt`),L(a.lastCheckedAt)],[r(`desktopUpdatesCurrentChannel`),B(a.channel)]];return(0,A.jsxs)(f,{title:r(`runtimeUpdatesPageTitle`),description:r(`runtimeUpdatesPageDescription`),actions:(0,A.jsxs)(h,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:c||l||d,children:[(0,A.jsx)(O,{className:i(`mr-2 h-4 w-4`,c&&`animate-spin`)}),r(`desktopUpdatesCheckNow`)]}),children:[(0,A.jsx)(u,{title:r(`desktopUpdatesOverviewTitle`),description:r(`desktopUpdatesOverviewDescription`),children:(0,A.jsx)(p,{children:(0,A.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r(`desktopUpdatesStatusLabel`)}),(0,A.jsx)(N,{snapshot:a})]}),(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:T.map(([e,t])=>(0,A.jsx)(P,{label:e,value:t},e))}),a.channel===`beta`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:r(`desktopUpdatesBetaBadgeTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:r(`desktopUpdatesBetaBadgeDescription`)})]}):null,a.downloadedVersion?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:r(`desktopUpdatesDownloadedBannerTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:r(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,a.downloadedVersion)})]}):null,(0,A.jsx)(F,{snapshot:a}),a.status===`blocked`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:r(`desktopUpdatesBlockedTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:a.errorMessage??r(`desktopUpdatesBlockedDescription`)}),a.recoveryCommand?(0,A.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:a.recoveryCommand}):null]}):null,a.errorMessage&&a.status!==`blocked`?(0,A.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:a.errorMessage}):null]})})}),(0,A.jsx)(G,{snapshot:a}),(0,A.jsx)(u,{title:r(`desktopUpdatesChannelSettingsTitle`),description:r(`desktopUpdatesChannelSettingsDescription`),children:(0,A.jsx)(p,{children:(0,A.jsx)(s,{title:r(`desktopUpdatesReleaseChannel`),description:r(`desktopUpdatesReleaseChannelHelp`),layout:`stacked`,children:(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(b,{value:a.channel,disabled:x||c||l||d,onValueChange:e=>void o.updateChannel(e),children:[(0,A.jsx)(_,{className:`w-full max-w-sm`,children:(0,A.jsx)(g,{placeholder:r(`desktopUpdatesReleaseChannel`)})}),(0,A.jsxs)(v,{children:[(0,A.jsx)(y,{value:`stable`,children:r(`desktopUpdatesChannelStable`)}),(0,A.jsx)(y,{value:`beta`,children:r(`desktopUpdatesChannelBeta`)})]})]}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`desktopUpdatesReleaseChannelDowngradeHint`)})]})})})}),(0,A.jsx)(u,{title:r(`desktopUpdatesActionsTitle`),description:r(`runtimeUpdatesActionsDescription`),children:(0,A.jsx)(p,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,A.jsxs)(h,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:c||l||d,children:[(0,A.jsx)(O,{className:i(`mr-2 h-4 w-4`,c&&`animate-spin`)}),r(`desktopUpdatesCheckNow`)]}),(0,A.jsxs)(h,{onClick:()=>void o.downloadUpdate(),disabled:!S,children:[(0,A.jsx)(w,{className:i(`mr-2 h-4 w-4`,l&&`animate-bounce`)}),r(`desktopUpdatesDownloadNow`)]}),(0,A.jsxs)(h,{variant:`secondary`,onClick:()=>void o.applyDownloadedUpdate(),disabled:!C,children:[(0,A.jsx)(k,{className:i(`mr-2 h-4 w-4`,d&&`animate-spin`)}),r(`runtimeUpdatesApplyNow`)]})]})})})]})}export{q as DesktopUpdateConfig};
1
+ import{D as e,a as t,n,r,w as i}from"./react-D6ShNq95.js";import{$t as a,At as o,Bt as s,Dt as c,Et as l,Ht as u,Ot as d,Ut as f,Vt as p,jt as m,qt as h}from"./api-CHo2gekJ.js";import{a as g,i as _,n as v,r as y,t as b}from"./select-CNFBf00l.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./card-B5rRLu_6.js";import{t as D}from"./navigation-link-BSJEUiwD.js";import{t as O}from"./refresh-cw-C2e94pmp.js";import{t as k}from"./rotate-cw-CTC-Qszi.js";var A=e(),j={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`},M={feature:`desktopUpdatesReleaseNotesFeature`,enhancement:`desktopUpdatesReleaseNotesEnhancement`,fix:`desktopUpdatesReleaseNotesFix`,compatibility:`desktopUpdatesReleaseNotesCompatibility`};function N({snapshot:e}){return(0,A.jsx)(`span`,{className:i(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,H(e.status)),children:V(e)})}function P({label:e,value:t}){return(0,A.jsxs)(`div`,{className:`rounded-lg bg-background/70 p-3`,children:[(0,A.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,A.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-foreground`,children:t})]})}function F({snapshot:e}){if(e.status!==`downloading`)return null;let t=e.progress?.percent,n=t==null?r(`desktopUpdatesDownloadProgressUnknown`):r(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(t)),i=R(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:n}),(0,A.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:i})]}),(0,A.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${t??0}%`}})})]})}function I(e){return e?.trim()||`-`}function L(e){return e?n(e):`-`}function R(e,t){let n=z(e);return t&&t>0?`${n} / ${z(t)}`:n}function z(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function B(e){return r(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function V(e){return e.status===`failed`&&e.failureStage?r(`desktopUpdatesFailureStage.${e.failureStage}`):r(j[e.status]??`desktopUpdatesStatusIdle`)}function H(e){return e===`downloaded`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function U(){return t()===`zh`?`zh-CN`:`en-US`}function W(e,t){return c(e.title,t)??r(M[e.kind]??`desktopUpdatesReleaseNotesEnhancement`)}function G({snapshot:e}){let t=d(e),n=U(),i=a({queryKey:[`runtime-release-notes`,t],queryFn:async()=>await l(t??``),enabled:!!t,retry:!1,staleTime:300*1e3}),o=i.data,s=c(o?.title,n)??r(`desktopUpdatesReleaseNotesPreviewTitle`),u=c(o?.summary,n)??r(`desktopUpdatesReleaseNotesPreviewDescription`);return e.releaseNotesUrl?(0,A.jsxs)(E,{children:[(0,A.jsx)(S,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(x,{children:s}),(0,A.jsx)(T,{children:u})]}),(0,A.jsx)(D,{href:e.releaseNotesUrl,external:!0,children:r(`desktopUpdatesReleaseNotes`)})]})}),(0,A.jsxs)(C,{className:`space-y-4`,children:[i.isLoading?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:r(`desktopUpdatesReleaseNotesPreviewLoading`)}):null,!t||i.isError?(0,A.jsx)(`p`,{className:`text-sm text-gray-500`,children:r(`desktopUpdatesReleaseNotesPreviewUnavailable`)}):null,o?(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:o.sections.map(e=>(0,A.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:W(e,n)}),(0,A.jsx)(`ul`,{className:`mt-3 space-y-3`,children:e.items.map((t,r)=>{let i=c(t.title,n),a=c(t.body,n);return(0,A.jsxs)(`li`,{className:`space-y-1`,children:[i?(0,A.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:i}):null,a?(0,A.jsx)(`p`,{className:`text-sm leading-5 text-gray-600`,children:a}):null]},`${i??e.kind}-${r}`)})})]},e.kind))}):null]})]}):null}function K(){return(0,A.jsx)(f,{title:r(`runtimeUpdatesPageTitle`),description:r(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(u,{title:r(`runtimeUpdatesUnavailableTitle`),description:r(`runtimeUpdatesUnavailableDescription`),children:(0,A.jsx)(p,{children:(0,A.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:r(`runtimeUpdatesUnavailableHint`)})})})})}function q(){let{supported:e,initialized:t,busyAction:n,snapshot:a}=m();if(!t)return(0,A.jsx)(f,{title:r(`runtimeUpdatesPageTitle`),description:r(`runtimeUpdatesPageDescription`),children:(0,A.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:r(`loading`)})});if(!e||!a)return(0,A.jsx)(K,{});let c=n===`checking`,l=n===`downloading`,d=n===`applying`,x=n===`switching-channel`,S=a.status===`update-available`&&!l&&!d,C=a.status===`downloaded`&&!d,T=[[r(`runtimeUpdatesHostVersion`),I(a.hostVersion)],[r(`desktopUpdatesCurrentBundleVersion`),I(a.currentVersion)],[r(`desktopUpdatesAvailableVersion`),I(a.availableVersion)],[r(`desktopUpdatesLastCheckedAt`),L(a.lastCheckedAt)],[r(`desktopUpdatesCurrentChannel`),B(a.channel)]];return(0,A.jsxs)(f,{title:r(`runtimeUpdatesPageTitle`),description:r(`runtimeUpdatesPageDescription`),actions:(0,A.jsxs)(h,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:c||l||d,children:[(0,A.jsx)(O,{className:i(`mr-2 h-4 w-4`,c&&`animate-spin`)}),r(`desktopUpdatesCheckNow`)]}),children:[(0,A.jsx)(u,{title:r(`desktopUpdatesOverviewTitle`),description:r(`desktopUpdatesOverviewDescription`),children:(0,A.jsx)(p,{children:(0,A.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r(`desktopUpdatesStatusLabel`)}),(0,A.jsx)(N,{snapshot:a})]}),(0,A.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:T.map(([e,t])=>(0,A.jsx)(P,{label:e,value:t},e))}),a.channel===`beta`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:r(`desktopUpdatesBetaBadgeTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:r(`desktopUpdatesBetaBadgeDescription`)})]}):null,a.downloadedVersion?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:r(`desktopUpdatesDownloadedBannerTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:r(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,a.downloadedVersion)})]}):null,(0,A.jsx)(F,{snapshot:a}),a.status===`blocked`?(0,A.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:r(`desktopUpdatesBlockedTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:a.errorMessage??r(`desktopUpdatesBlockedDescription`)}),a.recoveryCommand?(0,A.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:a.recoveryCommand}):null]}):null,a.errorMessage&&a.status!==`blocked`?(0,A.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:a.errorMessage}):null]})})}),(0,A.jsx)(G,{snapshot:a}),(0,A.jsx)(u,{title:r(`desktopUpdatesChannelSettingsTitle`),description:r(`desktopUpdatesChannelSettingsDescription`),children:(0,A.jsx)(p,{children:(0,A.jsx)(s,{title:r(`desktopUpdatesReleaseChannel`),description:r(`desktopUpdatesReleaseChannelHelp`),layout:`stacked`,children:(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(b,{value:a.channel,disabled:x||c||l||d,onValueChange:e=>void o.updateChannel(e),children:[(0,A.jsx)(_,{className:`w-full max-w-sm`,children:(0,A.jsx)(g,{placeholder:r(`desktopUpdatesReleaseChannel`)})}),(0,A.jsxs)(v,{children:[(0,A.jsx)(y,{value:`stable`,children:r(`desktopUpdatesChannelStable`)}),(0,A.jsx)(y,{value:`beta`,children:r(`desktopUpdatesChannelBeta`)})]})]}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`desktopUpdatesReleaseChannelDowngradeHint`)})]})})})}),(0,A.jsx)(u,{title:r(`desktopUpdatesActionsTitle`),description:r(`runtimeUpdatesActionsDescription`),children:(0,A.jsx)(p,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,A.jsxs)(h,{variant:`outline`,onClick:()=>void o.checkForUpdates(),disabled:c||l||d,children:[(0,A.jsx)(O,{className:i(`mr-2 h-4 w-4`,c&&`animate-spin`)}),r(`desktopUpdatesCheckNow`)]}),(0,A.jsxs)(h,{onClick:()=>void o.downloadUpdate(),disabled:!S,children:[(0,A.jsx)(w,{className:i(`mr-2 h-4 w-4`,l&&`animate-bounce`)}),r(`desktopUpdatesDownloadNow`)]}),(0,A.jsxs)(h,{variant:`secondary`,onClick:()=>void o.applyDownloadedUpdate(),disabled:!C,children:[(0,A.jsx)(k,{className:i(`mr-2 h-4 w-4`,d&&`animate-spin`)}),r(`runtimeUpdatesApplyNow`)]})]})})})]})}export{q as DesktopUpdateConfig};
@@ -1,4 +1,4 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{D as t,O as n,k as r}from"./react-39CDNZlM.js";typeof window<`u`&&window.document&&window.document.createElement;function i(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var a=e(r(),1);function o(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function s(...e){return t=>{let n=!1,r=e.map(e=>{let r=o(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():o(e[t],null)}}}}function c(...e){return a.useCallback(s(...e),e)}var l=t();function u(e,t){let n=a.createContext(t),r=e=>{let{children:t,...r}=e,i=a.useMemo(()=>r,Object.values(r));return(0,l.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=a.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function d(e,t=[]){let n=[];function r(t,r){let i=a.createContext(r),o=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[o]||i,u=a.useMemo(()=>s,Object.values(s));return(0,l.jsx)(c.Provider,{value:u,children:r})};s.displayName=t+`Provider`;function c(n,s){let c=s?.[e]?.[o]||i,l=a.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,c]}let i=()=>{let t=n.map(e=>a.createContext(e));return function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,f(i,...t)]}function f(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var p=globalThis?.document?a.useLayoutEffect:()=>{},m=a.useId||(()=>void 0),h=0;function g(e){let[t,n]=a.useState(m());return p(()=>{e||n(e=>e??String(h++))},[e]),e||(t?`radix-${t}`:``)}var _=a.useInsertionEffect||p;function v({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,o,s]=y({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=a.useRef(e!==void 0);a.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,a.useCallback(t=>{if(c){let n=b(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}function y({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return _(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function b(e){return typeof e==`function`}function x(e){let t=S(e),n=a.forwardRef((e,n)=>{let{children:r,...i}=e,o=a.Children.toArray(r),s=o.find(T);if(s){let e=s.props.children,r=o.map(t=>t===s?a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null:t);return(0,l.jsx)(t,{...i,ref:n,children:a.isValidElement(e)?a.cloneElement(e,void 0,r):null})}return(0,l.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function S(e){let t=a.forwardRef((e,t)=>{let{children:n,...r}=e;if(a.isValidElement(n)){let e=D(n),i=E(r,n.props);return n.type!==a.Fragment&&(i.ref=t?s(t,e):e),a.cloneElement(n,i)}return a.Children.count(n)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var C=Symbol(`radix.slottable`);function w(e){let t=({children:e})=>(0,l.jsx)(l.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=C,t}function T(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===C}function E(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function D(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var O=e(n(),1),k=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=x(`Primitive.${t}`),r=a.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,l.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function A(e,t){e&&O.flushSync(()=>e.dispatchEvent(t))}function j(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}function M(e,t=globalThis?.document){let n=j(e);a.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var N=`DismissableLayer`,P=`dismissableLayer.update`,F=`dismissableLayer.pointerDownOutside`,ee=`dismissableLayer.focusOutside`,te,ne=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),re=a.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:u,onDismiss:d,...f}=e,p=a.useContext(ne),[m,h]=a.useState(null),g=m?.ownerDocument??globalThis?.document,[,_]=a.useState({}),v=c(t,e=>h(e)),y=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(b),S=m?y.indexOf(m):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=ae(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!w||n||(o?.(e),u?.(e),e.defaultPrevented||d?.())},g),E=oe(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(s?.(e),u?.(e),e.defaultPrevented||d?.())},g);return M(e=>{S===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},g),a.useEffect(()=>{if(m)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(te=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),se(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=te)}},[m,g,n,p]),a.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),se())},[m,p]),a.useEffect(()=>{let e=()=>_({});return document.addEventListener(P,e),()=>document.removeEventListener(P,e)},[]),(0,l.jsx)(k.div,{...f,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:i(e.onFocusCapture,E.onFocusCapture),onBlurCapture:i(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:i(e.onPointerDownCapture,T.onPointerDownCapture)})});re.displayName=N;var I=`DismissableLayerBranch`,ie=a.forwardRef((e,t)=>{let n=a.useContext(ne),r=a.useRef(null),i=c(t,r);return a.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,l.jsx)(k.div,{...e,ref:i})});ie.displayName=I;function ae(e,t=globalThis?.document){let n=j(e),r=a.useRef(!1),i=a.useRef(()=>{});return a.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ce(F,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function oe(e,t=globalThis?.document){let n=j(e),r=a.useRef(!1);return a.useEffect(()=>{let e=e=>{e.target&&!r.current&&ce(ee,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function se(){let e=new CustomEvent(P);document.dispatchEvent(e)}function ce(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?A(i,a):i.dispatchEvent(a)}var le=`focusScope.autoFocusOnMount`,ue=`focusScope.autoFocusOnUnmount`,de={bubbles:!1,cancelable:!0},fe=`FocusScope`,pe=a.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[u,d]=a.useState(null),f=j(i),p=j(o),m=a.useRef(null),h=c(t,e=>d(e)),g=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let e=function(e){if(g.paused||!u)return;let t=e.target;u.contains(t)?m.current=t:L(m.current,{select:!0})},t=function(e){if(g.paused||!u)return;let t=e.relatedTarget;t!==null&&(u.contains(t)||L(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&L(u)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,u,g.paused]),a.useEffect(()=>{if(u){be.add(g);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(le,de);u.addEventListener(le,f),u.dispatchEvent(t),t.defaultPrevented||(me(Ce(ge(u)),{select:!0}),document.activeElement===e&&L(u))}return()=>{u.removeEventListener(le,f),setTimeout(()=>{let t=new CustomEvent(ue,de);u.addEventListener(ue,p),u.dispatchEvent(t),t.defaultPrevented||L(e??document.body,{select:!0}),u.removeEventListener(ue,p),be.remove(g)},0)}}},[u,f,p,g]);let _=a.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=he(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&L(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&L(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,l.jsx)(k.div,{tabIndex:-1,...s,ref:h,onKeyDown:_})});pe.displayName=fe;function me(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(L(r,{select:t}),document.activeElement!==n)return}function he(e){let t=ge(e);return[_e(t,e),_e(t.reverse(),e)]}function ge(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _e(e,t){for(let n of e)if(!ve(n,{upTo:t}))return n}function ve(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function ye(e){return e instanceof HTMLInputElement&&`select`in e}function L(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ye(e)&&t&&e.select()}}var be=xe();function xe(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Se(e,t),e.unshift(t)},remove(t){e=Se(e,t),e[0]?.resume()}}}function Se(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ce(e){return e.filter(e=>e.tagName!==`A`)}var we=`Portal`,Te=a.forwardRef((e,t)=>{let{container:n,...r}=e,[i,o]=a.useState(!1);p(()=>o(!0),[]);let s=n||i&&globalThis?.document?.body;return s?O.createPortal((0,l.jsx)(k.div,{...r,ref:t}),s):null});Te.displayName=we;var Ee=0;function De(){a.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Oe()),document.body.insertAdjacentElement(`beforeend`,e[1]??Oe()),Ee++,()=>{Ee===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Ee--}},[])}function Oe(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var R=function(){return R=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},R.apply(this,arguments)};function ke(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ae(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var je=`right-scroll-bar-position`,Me=`width-before-scroll-bar`,Ne=`with-scroll-bars-hidden`,Pe=`--removed-body-scroll-bar-size`;function Fe(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ie(e,t){var n=(0,a.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Le=typeof window<`u`?a.useLayoutEffect:a.useEffect,Re=new WeakMap;function ze(e,t){var n=Ie(t||null,function(t){return e.forEach(function(e){return Fe(e,t)})});return Le(function(){var t=Re.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Fe(e,null)}),i.forEach(function(e){r.has(e)||Fe(e,a)})}Re.set(n,e)},[e]),n}function Be(e){return e}function Ve(e,t){t===void 0&&(t=Be);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function He(e){e===void 0&&(e={});var t=Ve(null);return t.options=R({async:!0,ssr:!1},e),t}var Ue=function(e){var t=e.sideCar,n=ke(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return a.createElement(r,R({},n))};Ue.isSideCarExport=!0;function We(e,t){return e.useMedium(t),Ue}var Ge=He(),Ke=function(){},qe=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:Ke,onWheelCapture:Ke,onTouchMoveCapture:Ke}),i=r[0],o=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ke(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ze([n,t]),w=R(R({},x),i);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:Ge,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:o,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?a.cloneElement(a.Children.only(c),R(R({},w),{ref:C})):a.createElement(y,R({},w,{className:l,ref:C}),c))});qe.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},qe.classNames={fullWidth:Me,zeroRight:je};var Je,Ye=function(){if(Je)return Je;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Xe(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ye();return t&&e.setAttribute(`nonce`,t),e}function Ze(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qe(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var $e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xe())&&(Ze(t,n),Qe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},et=function(){var e=$e();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tt=function(){var e=et();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},nt={left:0,top:0,right:0,gap:0},rt=function(e){return parseInt(e||``,10)||0},it=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[rt(n),rt(r),rt(i)]},at=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return nt;var t=it(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ot=tt(),st=`data-scroll-locked`,ct=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{D as t,O as n,k as r}from"./react-D6ShNq95.js";typeof window<`u`&&window.document&&window.document.createElement;function i(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var a=e(r(),1);function o(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function s(...e){return t=>{let n=!1,r=e.map(e=>{let r=o(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():o(e[t],null)}}}}function c(...e){return a.useCallback(s(...e),e)}var l=t();function u(e,t){let n=a.createContext(t),r=e=>{let{children:t,...r}=e,i=a.useMemo(()=>r,Object.values(r));return(0,l.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=a.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function d(e,t=[]){let n=[];function r(t,r){let i=a.createContext(r),o=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[o]||i,u=a.useMemo(()=>s,Object.values(s));return(0,l.jsx)(c.Provider,{value:u,children:r})};s.displayName=t+`Provider`;function c(n,s){let c=s?.[e]?.[o]||i,l=a.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,c]}let i=()=>{let t=n.map(e=>a.createContext(e));return function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,f(i,...t)]}function f(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var p=globalThis?.document?a.useLayoutEffect:()=>{},m=a.useId||(()=>void 0),h=0;function g(e){let[t,n]=a.useState(m());return p(()=>{e||n(e=>e??String(h++))},[e]),e||(t?`radix-${t}`:``)}var _=a.useInsertionEffect||p;function v({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,o,s]=y({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=a.useRef(e!==void 0);a.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,a.useCallback(t=>{if(c){let n=b(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}function y({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return _(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function b(e){return typeof e==`function`}function x(e){let t=S(e),n=a.forwardRef((e,n)=>{let{children:r,...i}=e,o=a.Children.toArray(r),s=o.find(T);if(s){let e=s.props.children,r=o.map(t=>t===s?a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null:t);return(0,l.jsx)(t,{...i,ref:n,children:a.isValidElement(e)?a.cloneElement(e,void 0,r):null})}return(0,l.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function S(e){let t=a.forwardRef((e,t)=>{let{children:n,...r}=e;if(a.isValidElement(n)){let e=D(n),i=E(r,n.props);return n.type!==a.Fragment&&(i.ref=t?s(t,e):e),a.cloneElement(n,i)}return a.Children.count(n)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var C=Symbol(`radix.slottable`);function w(e){let t=({children:e})=>(0,l.jsx)(l.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=C,t}function T(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===C}function E(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function D(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var O=e(n(),1),k=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=x(`Primitive.${t}`),r=a.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,l.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function A(e,t){e&&O.flushSync(()=>e.dispatchEvent(t))}function j(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}function M(e,t=globalThis?.document){let n=j(e);a.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var N=`DismissableLayer`,P=`dismissableLayer.update`,F=`dismissableLayer.pointerDownOutside`,ee=`dismissableLayer.focusOutside`,te,ne=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),re=a.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:u,onDismiss:d,...f}=e,p=a.useContext(ne),[m,h]=a.useState(null),g=m?.ownerDocument??globalThis?.document,[,_]=a.useState({}),v=c(t,e=>h(e)),y=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(b),S=m?y.indexOf(m):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=ae(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!w||n||(o?.(e),u?.(e),e.defaultPrevented||d?.())},g),E=oe(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(s?.(e),u?.(e),e.defaultPrevented||d?.())},g);return M(e=>{S===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},g),a.useEffect(()=>{if(m)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(te=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),se(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=te)}},[m,g,n,p]),a.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),se())},[m,p]),a.useEffect(()=>{let e=()=>_({});return document.addEventListener(P,e),()=>document.removeEventListener(P,e)},[]),(0,l.jsx)(k.div,{...f,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:i(e.onFocusCapture,E.onFocusCapture),onBlurCapture:i(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:i(e.onPointerDownCapture,T.onPointerDownCapture)})});re.displayName=N;var I=`DismissableLayerBranch`,ie=a.forwardRef((e,t)=>{let n=a.useContext(ne),r=a.useRef(null),i=c(t,r);return a.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,l.jsx)(k.div,{...e,ref:i})});ie.displayName=I;function ae(e,t=globalThis?.document){let n=j(e),r=a.useRef(!1),i=a.useRef(()=>{});return a.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ce(F,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function oe(e,t=globalThis?.document){let n=j(e),r=a.useRef(!1);return a.useEffect(()=>{let e=e=>{e.target&&!r.current&&ce(ee,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function se(){let e=new CustomEvent(P);document.dispatchEvent(e)}function ce(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?A(i,a):i.dispatchEvent(a)}var le=`focusScope.autoFocusOnMount`,ue=`focusScope.autoFocusOnUnmount`,de={bubbles:!1,cancelable:!0},fe=`FocusScope`,pe=a.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[u,d]=a.useState(null),f=j(i),p=j(o),m=a.useRef(null),h=c(t,e=>d(e)),g=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let e=function(e){if(g.paused||!u)return;let t=e.target;u.contains(t)?m.current=t:L(m.current,{select:!0})},t=function(e){if(g.paused||!u)return;let t=e.relatedTarget;t!==null&&(u.contains(t)||L(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&L(u)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,u,g.paused]),a.useEffect(()=>{if(u){be.add(g);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(le,de);u.addEventListener(le,f),u.dispatchEvent(t),t.defaultPrevented||(me(Ce(ge(u)),{select:!0}),document.activeElement===e&&L(u))}return()=>{u.removeEventListener(le,f),setTimeout(()=>{let t=new CustomEvent(ue,de);u.addEventListener(ue,p),u.dispatchEvent(t),t.defaultPrevented||L(e??document.body,{select:!0}),u.removeEventListener(ue,p),be.remove(g)},0)}}},[u,f,p,g]);let _=a.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=he(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&L(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&L(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,l.jsx)(k.div,{tabIndex:-1,...s,ref:h,onKeyDown:_})});pe.displayName=fe;function me(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(L(r,{select:t}),document.activeElement!==n)return}function he(e){let t=ge(e);return[_e(t,e),_e(t.reverse(),e)]}function ge(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _e(e,t){for(let n of e)if(!ve(n,{upTo:t}))return n}function ve(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function ye(e){return e instanceof HTMLInputElement&&`select`in e}function L(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ye(e)&&t&&e.select()}}var be=xe();function xe(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Se(e,t),e.unshift(t)},remove(t){e=Se(e,t),e[0]?.resume()}}}function Se(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ce(e){return e.filter(e=>e.tagName!==`A`)}var we=`Portal`,Te=a.forwardRef((e,t)=>{let{container:n,...r}=e,[i,o]=a.useState(!1);p(()=>o(!0),[]);let s=n||i&&globalThis?.document?.body;return s?O.createPortal((0,l.jsx)(k.div,{...r,ref:t}),s):null});Te.displayName=we;var Ee=0;function De(){a.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Oe()),document.body.insertAdjacentElement(`beforeend`,e[1]??Oe()),Ee++,()=>{Ee===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Ee--}},[])}function Oe(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var R=function(){return R=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},R.apply(this,arguments)};function ke(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ae(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var je=`right-scroll-bar-position`,Me=`width-before-scroll-bar`,Ne=`with-scroll-bars-hidden`,Pe=`--removed-body-scroll-bar-size`;function Fe(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ie(e,t){var n=(0,a.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Le=typeof window<`u`?a.useLayoutEffect:a.useEffect,Re=new WeakMap;function ze(e,t){var n=Ie(t||null,function(t){return e.forEach(function(e){return Fe(e,t)})});return Le(function(){var t=Re.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Fe(e,null)}),i.forEach(function(e){r.has(e)||Fe(e,a)})}Re.set(n,e)},[e]),n}function Be(e){return e}function Ve(e,t){t===void 0&&(t=Be);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function He(e){e===void 0&&(e={});var t=Ve(null);return t.options=R({async:!0,ssr:!1},e),t}var Ue=function(e){var t=e.sideCar,n=ke(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return a.createElement(r,R({},n))};Ue.isSideCarExport=!0;function We(e,t){return e.useMedium(t),Ue}var Ge=He(),Ke=function(){},qe=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:Ke,onWheelCapture:Ke,onTouchMoveCapture:Ke}),i=r[0],o=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ke(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ze([n,t]),w=R(R({},x),i);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:Ge,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:o,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?a.cloneElement(a.Children.only(c),R(R({},w),{ref:C})):a.createElement(y,R({},w,{className:l,ref:C}),c))});qe.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},qe.classNames={fullWidth:Me,zeroRight:je};var Je,Ye=function(){if(Je)return Je;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Xe(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ye();return t&&e.setAttribute(`nonce`,t),e}function Ze(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qe(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var $e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xe())&&(Ze(t,n),Qe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},et=function(){var e=$e();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tt=function(){var e=et();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},nt={left:0,top:0,right:0,gap:0},rt=function(e){return parseInt(e||``,10)||0},it=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[rt(n),rt(r),rt(i)]},at=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return nt;var t=it(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ot=tt(),st=`data-scroll-locked`,ct=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${Ne} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -0,0 +1 @@
1
+ import{t as e}from"./doc-browser-DH-3hDnI.js";export{e as DocBrowser};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{D as t,d as n,k as r,r as i,w as a}from"./react-39CDNZlM.js";import{C as o,T as s,a as c,b as l,c as u,f as d,g as f,i as p,m,o as h,r as g,s as _,t as v,v as y,w as b,y as x}from"./dist-rYHnBo8t.js";import{d as S,i as C,r as w,t as T}from"./popover-ZoDwVwwd.js";import{n as ee,t as E}from"./search-BhXQB2TO.js";import{t as te}from"./navigation-link-C1cvB7y4.js";import{t as D}from"./plus-DI37QuHc.js";import{t as O}from"./refresh-cw-DKewcdAl.js";import{t as k}from"./x-C1ijNWcE.js";import{_ as ne,d as re,g as A,m as j,n as ie,p as ae}from"./doc-browser-context-CPHNzQ8m.js";var M=u(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),N=u(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),P=u(`EllipsisVertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),oe=u(`GripVertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),F=u(`PanelRightOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),se=u(`PictureInPicture2`,[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]),ce=u(`PinOff`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),le=u(`Pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),I=e(r(),1),L=t(),[R,ue]=o(`Tooltip`,[_]),z=_(),B=`TooltipProvider`,de=700,V=`tooltip.open`,[fe,H]=R(B),U=e=>{let{__scopeTooltip:t,delayDuration:n=de,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=I.useRef(!0),s=I.useRef(!1),c=I.useRef(0);return I.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(fe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:I.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};U.displayName=B;var W=`Tooltip`,[pe,G]=R(W),K=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=H(W,e.__scopeTooltip),u=z(t),[d,f]=I.useState(null),p=l(),m=I.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=I.useRef(!1),[y,b]=x({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(V))):c.onClose(),a?.(e)},caller:W}),S=I.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),C=I.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,b(!0)},[b]),w=I.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),T=I.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,b(!0),m.current=0},_)},[_,b]);return I.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,L.jsx)(h,{...u,children:(0,L.jsx)(pe,{scope:t,contentId:p,open:y,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:I.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:I.useCallback(()=>{g?w():(window.clearTimeout(m.current),m.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})};K.displayName=W;var q=`TooltipTrigger`,me=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=G(q,n),a=H(q,n),o=z(n),c=b(t,I.useRef(null),i.onTriggerChange),l=I.useRef(!1),u=I.useRef(!1),d=I.useCallback(()=>l.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,L.jsx)(g,{asChild:!0,...o,children:(0,L.jsx)(f.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:s(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:s(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:s(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:s(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:s(e.onBlur,i.onClose),onClick:s(e.onClick,i.onClose)})})});me.displayName=q;var J=`TooltipPortal`,[he,ge]=R(J,{forceMount:void 0}),_e=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=G(J,t);return(0,L.jsx)(he,{scope:t,forceMount:n,children:(0,L.jsx)(S,{present:n||a.open,children:(0,L.jsx)(d,{asChild:!0,container:i,children:r})})})};_e.displayName=J;var Y=`TooltipContent`,ve=I.forwardRef((e,t)=>{let n=ge(Y,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=G(Y,e.__scopeTooltip);return(0,L.jsx)(S,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(Ce,{side:i,...a,ref:t}):(0,L.jsx)(ye,{side:i,...a,ref:t})})}),ye=I.forwardRef((e,t)=>{let n=G(Y,e.__scopeTooltip),r=H(Y,e.__scopeTooltip),i=I.useRef(null),a=b(t,i),[o,s]=I.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=I.useCallback(()=>{s(null),d(!1)},[d]),p=I.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=De(r,Ee(r,n.getBoundingClientRect())),a=Oe(t.getBoundingClientRect());s(Ae([...i,...a])),d(!0)},[d]);return I.useEffect(()=>()=>f(),[f]),I.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),I.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ke(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(Ce,{...e,ref:a})}),[be,xe]=R(W,{isInside:!1}),Se=y(`TooltipContent`),Ce=I.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,l=G(Y,n),u=z(n),{onClose:d}=l;return I.useEffect(()=>(document.addEventListener(V,d),()=>document.removeEventListener(V,d)),[d]),I.useEffect(()=>{if(l.trigger){let e=e=>{e.target?.contains(l.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]),(0,L.jsx)(m,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(c,{"data-state":l.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(Se,{children:r}),(0,L.jsx)(be,{scope:n,isInside:!0,children:(0,L.jsx)(v,{id:l.contentId,role:`tooltip`,children:i||r})})]})})});ve.displayName=Y;var we=`TooltipArrow`,Te=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=z(n);return xe(we,n).isInside?null:(0,L.jsx)(p,{...i,...r,ref:t})});Te.displayName=we;function Ee(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function De(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Oe(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ke(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ae(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),je(t)}function je(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Me=U,Ne=K,Pe=me,Fe=_e,Ie=ve,Le=Me,Re=Ne,ze=Pe,X=I.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,L.jsx)(Fe,{children:(0,L.jsx)(Ie,{ref:r,sideOffset:t,className:a(`z-[var(--z-tooltip,10150)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));X.displayName=Ie.displayName;var Be={sm:`h-6 w-6 rounded-md p-1`,md:`h-7 w-7 rounded-md p-1.5`,lg:`h-8 w-8 rounded-lg p-1.5`},Ve={default:`text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`,strong:`text-muted-foreground hover:bg-black/10 hover:text-foreground disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`},Z=I.forwardRef(({className:e,disabled:t=!1,icon:n,label:r,size:i=`md`,tone:o=`default`,tooltip:s,tooltipSide:c=`bottom`,...l},u)=>{let d=(0,L.jsx)(`button`,{...l,ref:u,type:`button`,disabled:t,"aria-label":r,className:a(`inline-flex shrink-0 items-center justify-center transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed`,Be[i],Ve[o],e),children:n}),f=s===!1?null:s??r;return f?(0,L.jsx)(Le,{delayDuration:250,children:(0,L.jsxs)(Re,{disableHoverableContent:!0,children:[(0,L.jsx)(ze,{asChild:!0,onFocus:e=>{e.currentTarget.matches(`:focus-visible`)||e.preventDefault()},children:t?(0,L.jsx)(`span`,{className:`inline-flex`,children:d}):d}),(0,L.jsx)(X,{side:c,className:`text-xs`,children:f})]})}):d});Z.displayName=`IconActionButton`;function He(e,t){e.stopPropagation(),t()}function Ue({tab:e}){let[t,n]=I.useState(!1),r=I.useRef(!0);if(!e.menuActions?.length)return null;let i=e.menuLabel??e.label;return(0,L.jsxs)(T,{open:t,onOpenChange:e=>{e&&(r.current=!0),n(e)},children:[(0,L.jsx)(`div`,{className:a(`-ml-1.5 flex w-0 shrink-0 overflow-hidden opacity-0 transition-[width,margin,opacity] group-hover:ml-0 group-hover:w-5 group-hover:opacity-100 group-focus-within:ml-0 group-focus-within:w-5 group-focus-within:opacity-100`,t?`ml-0 w-5 opacity-100`:null),children:(0,L.jsx)(C,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":i,onClick:e=>e.stopPropagation(),className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-700 focus-visible:bg-gray-200 focus-visible:text-gray-700 focus-visible:outline-none`,children:(0,L.jsx)(P,{className:`h-3.5 w-3.5`})})})}),(0,L.jsx)(w,{align:`end`,className:`w-40 rounded-xl p-1.5`,onClick:e=>e.stopPropagation(),onCloseAutoFocus:e=>{r.current||e.preventDefault()},children:(0,L.jsx)(`div`,{role:`menu`,"aria-label":i,children:e.menuActions.map(e=>(0,L.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:e.disabled,className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-xs text-gray-700 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>{r.current=!1,n(!1),e.onClick()},children:[(0,L.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center`,children:e.icon}),(0,L.jsx)(`span`,{children:e.label})]},e.key))})})]})}function We({labelClassName:e,tab:t}){let n=t.onClose&&t.closePlacement===`leading-hover`?null:t.leadingIcon,r=(0,L.jsxs)(`button`,{type:`button`,onClick:t.onSelect,"aria-label":t.label,className:`flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[n?(0,L.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center`,children:n}):null,(0,L.jsx)(`span`,{className:a(`min-w-0 truncate text-[12px] font-medium`,e,t.labelClassName),children:t.label}),t.badge,t.unreadIndicator]}),i=t.tooltip??t.label;return i?(0,L.jsx)(Le,{delayDuration:250,children:(0,L.jsxs)(Re,{children:[(0,L.jsx)(ze,{asChild:!0,children:r}),(0,L.jsx)(X,{side:`bottom`,className:`text-xs`,children:i})]})}):r}function Ge({activeTabClassName:e,inactiveTabClassName:t,itemRef:n,labelClassName:r,tab:i,tabBaseClassName:o}){let s=i.onClose&&i.closePlacement===`leading-hover`;return(0,L.jsxs)(`div`,{ref:n,"data-compact-tab-item":``,onClick:e=>e.target===e.currentTarget&&i.onSelect(),className:a(o??`group flex max-w-[180px] min-w-0 cursor-pointer items-center gap-1.5 border-r border-gray-200/70 border-b-2 px-2.5 py-2 transition-colors`,i.active?e??`border-b-primary bg-white text-gray-900`:t??`border-b-transparent bg-gray-50/85 text-gray-500 hover:bg-gray-100`),children:[s?(0,L.jsxs)(`button`,{type:`button`,onClick:e=>He(e,i.onClose),className:`relative inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-700`,"aria-label":i.closeLabel,children:[(0,L.jsx)(`span`,{className:`flex items-center justify-center group-hover:hidden`,children:i.leadingIcon}),(0,L.jsx)(k,{className:`hidden h-3.5 w-3.5 group-hover:block`})]}):null,(0,L.jsx)(We,{tab:i,labelClassName:r}),(0,L.jsx)(Ue,{tab:i}),i.onClose&&i.closePlacement!==`leading-hover`?(0,L.jsx)(Z,{size:`sm`,tone:`strong`,icon:(0,L.jsx)(k,{className:`h-3 w-3`}),label:i.closeLabel??``,tooltip:i.closeLabel??null,onClick:e=>He(e,i.onClose)}):null]})}function Ke({actionButtonClassName:e,actions:t,actionsClassName:n,actionsTestId:r,className:i,onPointerDown:o,onScrollPointerDown:s,scrollClassName:c,scrollTestId:l,tabs:u,tabsClassName:d,testId:f,...p}){let m=I.useCallback(e=>{e?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[]);return(0,L.jsxs)(`div`,{"data-testid":f,className:a(`flex min-w-0 items-stretch border-b border-gray-200/70 bg-gray-50/85`,i),onPointerDown:o,children:[(0,L.jsx)(`div`,{className:a(`min-w-0 flex-1 overflow-x-auto overflow-y-hidden`,c),onPointerDown:s,children:(0,L.jsx)(`div`,{"data-testid":l,className:a(`flex min-w-max items-stretch`,d),children:u.map(e=>(0,L.jsx)(Ge,{itemRef:e.active?m:void 0,tab:e,...p},e.key))})}),(0,L.jsx)(`div`,{className:a(`flex shrink-0 items-center gap-1`,n),"data-testid":r,onPointerDown:e=>e.stopPropagation(),children:t.map(t=>(0,L.jsx)(Z,{icon:t.icon,label:t.label,disabled:t.disabled,onClick:t.onClick,className:e},t.key))})]})}function qe(){return(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center bg-background px-5 py-6`,children:(0,L.jsxs)(`div`,{className:`flex max-w-[260px] flex-col items-center gap-3 text-center`,children:[(0,L.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground shadow-[0_1px_2px_rgba(30,20,10,0.04)]`,children:(0,L.jsx)(N,{className:`h-5 w-5`})}),(0,L.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:i(`docBrowserHomeTitle`)})]})})}function Je({isVisible:e,onRefresh:t,onSubmit:n,onUrlInputChange:r,placeholder:a,urlInput:o}){return e?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/70 bg-card px-3.5 py-2 shrink-0`,children:[(0,L.jsxs)(`form`,{onSubmit:n,className:`flex-1 relative`,children:[(0,L.jsx)(E,{className:`absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,L.jsx)(`input`,{type:`text`,value:o,onChange:e=>r(e.target.value),"aria-label":i(`docBrowserAddressLabel`),placeholder:a,className:`h-8 w-full rounded-lg border border-border/75 bg-background pl-8 pr-3 text-xs text-foreground transition-colors placeholder:text-muted-foreground/55 focus:border-border focus:outline-none focus:ring-0`})]}),(0,L.jsx)(Z,{icon:(0,L.jsx)(O,{className:`h-3.5 w-3.5`}),label:i(`docBrowserRefresh`),onClick:t})]}):null}function Ye({currentTab:e,currentUrl:t,customContent:r,iframeRef:i,iframeInstanceId:a,iframeSandbox:o,isDragging:s,isResizing:c,onIframePointerOver:l}){return(0,L.jsxs)(`div`,{className:`flex-1 relative overflow-hidden`,children:[r||(0,L.jsx)(`iframe`,{ref:i,src:t,name:n(e?.contentParams),className:`absolute inset-0 w-full h-full border-0`,title:e?.title||`NextClaw Docs`,sandbox:o,tabIndex:l?0:void 0,onPointerOver:l,allow:`clipboard-read; clipboard-write`,allowFullScreen:!0},a),(c||s)&&(0,L.jsx)(`div`,{className:`absolute inset-0 z-10`})]})}function Xe(e){try{let t=new URL(e,window.location.origin);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function Ze({currentUrl:e,isVisible:t}){if(!t||!Xe(e))return null;let n=A(e)?i(`docBrowserOpenExternal`):i(`docBrowserOpenInBrowser`);return(0,L.jsx)(`div`,{className:`flex items-center justify-between border-t border-border/70 bg-muted/55 px-4 py-2 shrink-0`,children:(0,L.jsx)(te,{href:e,external:!0,iconPosition:`trailing`,size:`xs`,"data-doc-external":!0,children:n})})}function Qe(e){return e instanceof Element&&!!e.closest(`button, a, input, textarea, select, [data-compact-tab-item]`)}function $e({tabs:e,activeTabId:t,canGoBack:n,canGoForward:r,isDocked:o,isFullscreen:s,dockState:c,onGoBack:l,onGoForward:u,onOpenNewTab:d,onToggleDock:f,onSetActiveTab:p,onCloseTab:m,onClose:h,onDragStart:g,onToggleMode:_}){let v=i(`docBrowserBack`),y=i(`docBrowserClose`),b=i(`docBrowserCloseTab`),x=c?.isDocked?c.removable?i(`sideDockUnpinCurrent`):i(`sideDockBuiltInDocked`):i(`sideDockPinCurrent`),S=i(`docBrowserForward`),C=i(o?`docBrowserFloatMode`:`docBrowserDockMode`),w=i(`docBrowserNewTab`);return(0,L.jsx)(Ke,{testId:`doc-browser-tab-strip`,actionsTestId:`doc-browser-tab-actions`,tabs:e.map(e=>({key:e.id,label:e.title||i(`docBrowserTabUntitled`),active:e.id===t,tooltip:e.title,closeLabel:b,closePlacement:`trailing`,onSelect:()=>p(e.id),onClose:()=>m(e.id)})),actions:[{key:`back`,disabled:!n,icon:(0,L.jsx)(ee,{className:`h-3.5 w-3.5`}),label:v,onClick:l},{key:`forward`,disabled:!r,icon:(0,L.jsx)(M,{className:`h-3.5 w-3.5`}),label:S,onClick:u},{key:`new-tab`,icon:(0,L.jsx)(D,{className:`h-3.5 w-3.5`}),label:w,onClick:d},...c?.canDock?[{key:`dock`,disabled:c.isDocked&&!c.removable,icon:c.isDocked&&c.removable?(0,L.jsx)(ce,{className:`h-3.5 w-3.5`}):(0,L.jsx)(le,{className:`h-3.5 w-3.5`}),label:x,onClick:()=>f?.()}]:[],...s?[]:[{key:`mode`,icon:o?(0,L.jsx)(se,{className:`h-3.5 w-3.5`}):(0,L.jsx)(F,{className:`h-3.5 w-3.5`}),label:C,onClick:_}],{key:`close`,icon:(0,L.jsx)(k,{className:`h-3.5 w-3.5`}),label:y,onClick:h}],className:a(`h-10 gap-1.5 border-border/50 bg-card/80 px-2 shrink-0 select-none`,s&&`h-[calc(env(safe-area-inset-top,0px)+2.5rem)] pt-[env(safe-area-inset-top,0px)]`),scrollClassName:a(`doc-browser-tab-scrollbar flex h-full items-center gap-0.5`,!o&&!s&&`cursor-grab active:cursor-grabbing`),tabsClassName:`items-center gap-0.5`,actionsClassName:`h-full items-center gap-0.5`,actionButtonClassName:`rounded-md p-1.5 text-muted-foreground hover:bg-muted/60 hover:text-foreground disabled:opacity-50`,tabBaseClassName:`group inline-flex min-w-0 cursor-pointer items-center gap-0.5 h-7 px-2 rounded-md text-xs max-w-[220px] shrink-0 transition-colors`,activeTabClassName:`bg-muted/80 text-foreground`,inactiveTabClassName:`text-muted-foreground hover:bg-muted/45 hover:text-foreground`,labelClassName:`px-0.5 text-xs font-normal`,onPointerDown:!o&&!s?g:void 0,onScrollPointerDown:e=>{if(Qe(e.target)){e.stopPropagation();return}!o&&!s&&(e.stopPropagation(),g(e))}})}var Q=40,et=360,tt=400;function $(e,t,n){return Math.min(n,Math.max(t,e))}function nt(e,t){return e.split(`-`).includes(t)}function rt(){return{x:Math.max(Q,window.innerWidth-520),y:80,w:480,h:600}}function it(e,t,n){return{...e,x:$(e.x+t,Q,window.innerWidth-Q-e.w),y:$(e.y+n,Q,window.innerHeight-Q-e.h)}}function at(e,t,n,r){let i=t.x+t.w,a=t.y+t.h,o=nt(e,`left`)?$(t.x+n,Q,i-et):t.x,s=nt(e,`right`)?$(i+n,o+et,window.innerWidth-Q):i,c=nt(e,`top`)?$(t.y+r,Q,a-tt):t.y,l=nt(e,`bottom`)?$(a+r,c+tt,window.innerHeight-Q):a;return{x:o,y:c,w:s-o,h:l-c}}function ot({children:e,className:t,style:n,defaultWidth:r=420,minWidth:i=320,maxWidth:o=860,onWidthCommit:s,overlay:c=!1,overlayScope:l=`viewport`,width:u,...d}){let f=(0,I.useRef)(null),p=(0,I.useRef)(u??r),[m,h]=(0,I.useState)(!1),[g,_]=(0,I.useState)(null),[v,y]=(0,I.useState)(r),b=g??u??v,x=c?l===`container`?`absolute inset-0 z-30`:`fixed inset-0 z-40`:`border-l border-border`,S=e=>{if(c)return;e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),h(!0),p.current=b,f.current={startX:e.clientX,startWidth:b};let t=e=>{let t=f.current;if(!t)return;let n=t.startWidth+t.startX-e.clientX,r=Math.max(i,Math.min(o,n));p.current=r,_(r)},n=()=>{u===void 0&&y(p.current),s?.(p.current),_(null),h(!1),f.current=null,window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n),window.removeEventListener(`pointercancel`,n)};window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n),window.addEventListener(`pointercancel`,n)};return(0,L.jsxs)(`aside`,{...d,className:a(`relative flex h-full min-h-0 shrink-0 overflow-hidden bg-card text-card-foreground`,x,t),style:c?n:{...n,width:b},children:[c?null:(0,L.jsx)(`div`,{className:`absolute left-0 top-0 z-20 h-full w-3 cursor-ew-resize transition-colors hover:bg-primary/10`,"data-testid":`resizable-right-panel-handle`,onPointerDown:S}),(0,L.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,children:e}),m?(0,L.jsx)(`div`,{className:`absolute inset-0 z-10 cursor-ew-resize`,"data-testid":`resizable-right-panel-resize-shield`}):null]})}var st=`allow-same-origin allow-scripts allow-popups allow-forms`;function ct(e,t){if(e.startsWith(`/`))try{return new URL(e,t).toString()}catch{return e}return/^[a-z][a-z\d+.-]*:\/\//i.test(e)||e===`about:blank`?e:/^(localhost|127\.|0\.0\.0\.0|\[::1\])(?::|\/|$)/i.test(e)?`http://${e}`:`https://${e}`}function lt(e,t){if(!t)return st;let n=e?.getIframeSandbox?.(t);return n===void 0?t.kind===`content`?void 0:st:n}function ut(e,t,n){return(0,I.useCallback)(()=>{if(n?.canDock){if(n.isDocked){n.removable&&e?.unpinTab(t);return}e?.pinTab(t)}},[t,e,n])}function dt({activeTabId:e,currentUrl:t,isAddressToolbarTab:n,isContentTab:r,isDocsTab:i,navigate:a}){let o=`${e}:${t}:${r?`content`:`docs`}`,[s,c]=(0,I.useState)(null),l=(()=>{if(!n)return``;if(r)return t;try{return new URL(t).pathname}catch{return t}})(),u=s?.key===o?s.value:l,d=(0,I.useCallback)(e=>c({key:o,value:e}),[o]);return{handleUrlSubmit:(0,I.useCallback)(e=>{if(e.preventDefault(),!n)return;let r=u.trim();r&&(i&&r.startsWith(`/`)?a(j(r)):i&&r.startsWith(`http`)?a(r):a(i?j(`/${r}`):ct(r,t)))},[t,n,i,a,u]),setUrlInput:d,urlInput:u}}function ft({customTabRenderers:e={},displayMode:t=`desktop`,dockControls:n}){let{isOpen:r,mode:o,dockedWidth:s,tabs:c,activeTabId:l,activeHistory:u,activeHistoryIndex:d,currentTab:f,open:p,openTarget:m,openNewTab:h,close:g,toggleMode:_,setDockedWidth:v,goBack:y,goForward:b,navigate:x,syncUrl:S,setActiveTab:C,closeTab:w}=ie(),[T,ee]=(0,I.useState)(0),[E,te]=(0,I.useState)(rt),[D,O]=(0,I.useState)(null),k=(0,I.useRef)(null),A=f?.currentUrl??ae(),j=f?.navVersion??0,M=`${l}:${j}:${T}`,N=(0,I.useRef)(null),P=(0,I.useRef)(j),F=f?.kind===`docs`,se=f?.kind===re,ce=d>0,le=d<u.length-1,R=f?e[f.kind]:void 0,ue=n?.getDockState(f),z=f?.kind===`content`,B=F||z,{handleUrlSubmit:de,setUrlInput:V,urlInput:fe}=dt({activeTabId:l,currentUrl:A,isAddressToolbarTab:B,isContentTab:z,isDocsTab:F,navigate:x});(0,I.useEffect)(()=>{if(!F){N.current=null;return}if(j!==P.current){P.current=j,N.current=ne(A);return}if(k.current?.contentWindow)try{let e=new URL(A).pathname;N.current=ne(A),k.current.contentWindow.postMessage({type:`docs-navigate`,path:e},`*`)}catch{}},[A,j,F]),(0,I.useEffect)(()=>{let e=e=>{if(F&&e.data?.type===`docs-route-change`&&typeof e.data.url==`string`){let t=ne(e.data.url);if(N.current&&t!==N.current)return;N.current=null,S(e.data.url)}};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[A,S,F]),(0,I.useEffect)(()=>{if(!f||!R?.onIframeMessage)return;let e=e=>{R.onIframeMessage?.({event:e,iframe:k.current,iframeInstanceId:M,tab:f})};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[f,R,M]);let H=(0,I.useCallback)(e=>{e.preventDefault(),O({kind:`drag`,startX:e.clientX,startY:e.clientY,startRect:E})},[E]),U=(0,I.useCallback)(e=>t=>{t.preventDefault(),t.stopPropagation(),O({kind:`resize`,edge:e,startX:t.clientX,startY:t.clientY,startRect:E})},[E]);(0,I.useEffect)(()=>{if(!D)return;let e=e=>{let{startRect:t,startX:n,startY:r}=D,i=e.clientX-n,a=e.clientY-r;if(D.kind===`drag`){te(it(t,i,a));return}te(at(D.edge,t,i,a))},t=()=>O(null);return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[D]);let W=(0,I.useCallback)(()=>{ee(e=>e+1)},[]),pe=ut(n,f,ue);if(!r)return null;let G=o===`docked`,K=t===`fullscreen`,q=f?{currentUrl:A,open:p,openTarget:m,refreshIframe:W,tab:f}:void 0,me=q?R?.renderToolbar?.(q):null,J=q?R?.renderContent?.(q)??(se?(0,L.jsx)(qe,{}):null):null,he=lt(R,f),ge=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)($e,{tabs:c,activeTabId:l,canGoBack:ce,canGoForward:le,dockState:ue,isDocked:G,isFullscreen:K,onGoBack:y,onGoForward:b,onOpenNewTab:h,onToggleDock:pe,onSetActiveTab:C,onCloseTab:w,onClose:g,onDragStart:H,onToggleMode:_}),(0,L.jsx)(Je,{isVisible:B,onRefresh:W,onSubmit:de,onUrlInputChange:V,placeholder:i(F?`docBrowserSearchPlaceholder`:`docBrowserAddressPlaceholder`),urlInput:fe}),me,(0,L.jsx)(Ye,{currentTab:f,currentUrl:A,customContent:J,iframeRef:k,iframeInstanceId:M,iframeSandbox:he,isDragging:D?.kind===`drag`,isResizing:D?.kind===`resize`,onIframePointerOver:R?.onIframePointerOver}),(0,L.jsx)(Ze,{currentUrl:A,isVisible:F||z})]});return G&&!K?(0,L.jsx)(ot,{"data-testid":`doc-browser-panel`,defaultWidth:s,width:s,minWidth:320,maxWidth:860,onWidthCommit:v,children:ge}):(0,L.jsxs)(`div`,{"data-testid":`doc-browser-panel`,className:a(`relative flex flex-col overflow-hidden bg-card text-card-foreground`,K?`fixed inset-0 z-[var(--z-floating-panel)] h-[100dvh] w-screen rounded-none border-0 shadow-2xl`:`rounded-2xl border border-border shadow-2xl`),style:K?void 0:{position:`fixed`,left:E.x,top:E.y,width:E.w,height:E.h,zIndex:`var(--z-floating-panel)`},children:[ge,!G&&!K&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`absolute top-0 left-0 h-3 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top`,onPointerDown:U(`top`)}),(0,L.jsx)(`div`,{className:`absolute top-0 left-0 w-3 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-left`,onPointerDown:U(`left`)}),(0,L.jsx)(`div`,{className:`absolute top-0 right-0 w-3 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-right`,onPointerDown:U(`right`)}),(0,L.jsx)(`div`,{className:`absolute bottom-0 left-0 h-3 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-bottom`,onPointerDown:U(`bottom`)}),(0,L.jsx)(`div`,{className:`absolute top-0 left-0 z-30 h-4 w-4 cursor-nw-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top-left`,onPointerDown:U(`top-left`)}),(0,L.jsx)(`div`,{className:`absolute top-0 right-0 z-30 h-4 w-4 cursor-ne-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top-right`,onPointerDown:U(`top-right`)}),(0,L.jsx)(`div`,{className:`absolute bottom-0 left-0 z-30 h-4 w-4 cursor-sw-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-bottom-left`,onPointerDown:U(`bottom-left`)}),(0,L.jsx)(`div`,{className:`absolute bottom-0 right-0 z-30 flex h-4 w-4 cursor-se-resize items-center justify-center text-muted-foreground/45 transition-colors hover:text-muted-foreground`,"data-testid":`doc-browser-resize-bottom-right`,onPointerDown:U(`bottom-right`),children:(0,L.jsx)(oe,{className:`w-3 h-3 rotate-[-45deg]`})})]})]})}export{N as _,Re as a,ze as c,Me as d,Ne as f,P as g,F as h,Z as i,Ie as l,le as m,ot as n,X as o,Pe as p,Ke as r,Le as s,ft as t,Fe as u,M as v};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{D as t,d as n,k as r,r as i,w as a}from"./react-D6ShNq95.js";import{C as o,T as s,a as c,b as l,c as u,f as d,g as f,i as p,m,o as h,r as g,s as _,t as v,v as y,w as b,y as x}from"./dist-C9EX46wM.js";import{d as S,i as C,r as w,t as T}from"./popover-Bp9IpE_N.js";import{n as ee,t as E}from"./search-CLXM2reO.js";import{t as te}from"./navigation-link-BSJEUiwD.js";import{t as D}from"./plus-BRVe5jSJ.js";import{t as O}from"./refresh-cw-C2e94pmp.js";import{t as k}from"./x-BXFquY9e.js";import{_ as ne,d as re,g as A,m as j,n as ie,p as ae}from"./doc-browser-context-TU2heon0.js";var M=u(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),N=u(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),P=u(`EllipsisVertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),oe=u(`GripVertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),F=u(`PanelRightOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),se=u(`PictureInPicture2`,[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]),ce=u(`PinOff`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),le=u(`Pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),I=e(r(),1),L=t(),[R,ue]=o(`Tooltip`,[_]),z=_(),B=`TooltipProvider`,de=700,V=`tooltip.open`,[fe,H]=R(B),U=e=>{let{__scopeTooltip:t,delayDuration:n=de,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=I.useRef(!0),s=I.useRef(!1),c=I.useRef(0);return I.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(fe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:I.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};U.displayName=B;var W=`Tooltip`,[pe,G]=R(W),K=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=H(W,e.__scopeTooltip),u=z(t),[d,f]=I.useState(null),p=l(),m=I.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=I.useRef(!1),[y,b]=x({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(V))):c.onClose(),a?.(e)},caller:W}),S=I.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),C=I.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,b(!0)},[b]),w=I.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),T=I.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,b(!0),m.current=0},_)},[_,b]);return I.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,L.jsx)(h,{...u,children:(0,L.jsx)(pe,{scope:t,contentId:p,open:y,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:I.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:I.useCallback(()=>{g?w():(window.clearTimeout(m.current),m.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})};K.displayName=W;var q=`TooltipTrigger`,me=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=G(q,n),a=H(q,n),o=z(n),c=b(t,I.useRef(null),i.onTriggerChange),l=I.useRef(!1),u=I.useRef(!1),d=I.useCallback(()=>l.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,L.jsx)(g,{asChild:!0,...o,children:(0,L.jsx)(f.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:s(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:s(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:s(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:s(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:s(e.onBlur,i.onClose),onClick:s(e.onClick,i.onClose)})})});me.displayName=q;var J=`TooltipPortal`,[he,ge]=R(J,{forceMount:void 0}),_e=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=G(J,t);return(0,L.jsx)(he,{scope:t,forceMount:n,children:(0,L.jsx)(S,{present:n||a.open,children:(0,L.jsx)(d,{asChild:!0,container:i,children:r})})})};_e.displayName=J;var Y=`TooltipContent`,ve=I.forwardRef((e,t)=>{let n=ge(Y,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=G(Y,e.__scopeTooltip);return(0,L.jsx)(S,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(Ce,{side:i,...a,ref:t}):(0,L.jsx)(ye,{side:i,...a,ref:t})})}),ye=I.forwardRef((e,t)=>{let n=G(Y,e.__scopeTooltip),r=H(Y,e.__scopeTooltip),i=I.useRef(null),a=b(t,i),[o,s]=I.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=I.useCallback(()=>{s(null),d(!1)},[d]),p=I.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=De(r,Ee(r,n.getBoundingClientRect())),a=Oe(t.getBoundingClientRect());s(Ae([...i,...a])),d(!0)},[d]);return I.useEffect(()=>()=>f(),[f]),I.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),I.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ke(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(Ce,{...e,ref:a})}),[be,xe]=R(W,{isInside:!1}),Se=y(`TooltipContent`),Ce=I.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,l=G(Y,n),u=z(n),{onClose:d}=l;return I.useEffect(()=>(document.addEventListener(V,d),()=>document.removeEventListener(V,d)),[d]),I.useEffect(()=>{if(l.trigger){let e=e=>{e.target?.contains(l.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]),(0,L.jsx)(m,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(c,{"data-state":l.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(Se,{children:r}),(0,L.jsx)(be,{scope:n,isInside:!0,children:(0,L.jsx)(v,{id:l.contentId,role:`tooltip`,children:i||r})})]})})});ve.displayName=Y;var we=`TooltipArrow`,Te=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=z(n);return xe(we,n).isInside?null:(0,L.jsx)(p,{...i,...r,ref:t})});Te.displayName=we;function Ee(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function De(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Oe(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ke(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ae(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),je(t)}function je(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Me=U,Ne=K,Pe=me,Fe=_e,Ie=ve,Le=Me,Re=Ne,ze=Pe,X=I.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,L.jsx)(Fe,{children:(0,L.jsx)(Ie,{ref:r,sideOffset:t,className:a(`z-[var(--z-tooltip,10150)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));X.displayName=Ie.displayName;var Be={sm:`h-6 w-6 rounded-md p-1`,md:`h-7 w-7 rounded-md p-1.5`,lg:`h-8 w-8 rounded-lg p-1.5`},Ve={default:`text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`,strong:`text-muted-foreground hover:bg-black/10 hover:text-foreground disabled:text-muted-foreground/45 disabled:hover:bg-transparent disabled:hover:text-muted-foreground/45`},Z=I.forwardRef(({className:e,disabled:t=!1,icon:n,label:r,size:i=`md`,tone:o=`default`,tooltip:s,tooltipSide:c=`bottom`,...l},u)=>{let d=(0,L.jsx)(`button`,{...l,ref:u,type:`button`,disabled:t,"aria-label":r,className:a(`inline-flex shrink-0 items-center justify-center transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed`,Be[i],Ve[o],e),children:n}),f=s===!1?null:s??r;return f?(0,L.jsx)(Le,{delayDuration:250,children:(0,L.jsxs)(Re,{disableHoverableContent:!0,children:[(0,L.jsx)(ze,{asChild:!0,onFocus:e=>{e.currentTarget.matches(`:focus-visible`)||e.preventDefault()},children:t?(0,L.jsx)(`span`,{className:`inline-flex`,children:d}):d}),(0,L.jsx)(X,{side:c,className:`text-xs`,children:f})]})}):d});Z.displayName=`IconActionButton`;function He(e,t){e.stopPropagation(),t()}function Ue({tab:e}){let[t,n]=I.useState(!1),r=I.useRef(!0);if(!e.menuActions?.length)return null;let i=e.menuLabel??e.label;return(0,L.jsxs)(T,{open:t,onOpenChange:e=>{e&&(r.current=!0),n(e)},children:[(0,L.jsx)(`div`,{className:a(`-ml-1.5 flex w-0 shrink-0 overflow-hidden opacity-0 transition-[width,margin,opacity] group-hover:ml-0 group-hover:w-5 group-hover:opacity-100 group-focus-within:ml-0 group-focus-within:w-5 group-focus-within:opacity-100`,t?`ml-0 w-5 opacity-100`:null),children:(0,L.jsx)(C,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":i,onClick:e=>e.stopPropagation(),className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-700 focus-visible:bg-gray-200 focus-visible:text-gray-700 focus-visible:outline-none`,children:(0,L.jsx)(P,{className:`h-3.5 w-3.5`})})})}),(0,L.jsx)(w,{align:`end`,className:`w-40 rounded-xl p-1.5`,onClick:e=>e.stopPropagation(),onCloseAutoFocus:e=>{r.current||e.preventDefault()},children:(0,L.jsx)(`div`,{role:`menu`,"aria-label":i,children:e.menuActions.map(e=>(0,L.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:e.disabled,className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-xs text-gray-700 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>{r.current=!1,n(!1),e.onClick()},children:[(0,L.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center`,children:e.icon}),(0,L.jsx)(`span`,{children:e.label})]},e.key))})})]})}function We({labelClassName:e,tab:t}){let n=t.onClose&&t.closePlacement===`leading-hover`?null:t.leadingIcon,r=(0,L.jsxs)(`button`,{type:`button`,onClick:t.onSelect,"aria-label":t.label,className:`flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[n?(0,L.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center`,children:n}):null,(0,L.jsx)(`span`,{className:a(`min-w-0 truncate text-[12px] font-medium`,e,t.labelClassName),children:t.label}),t.badge,t.unreadIndicator]}),i=t.tooltip??t.label;return i?(0,L.jsx)(Le,{delayDuration:250,children:(0,L.jsxs)(Re,{children:[(0,L.jsx)(ze,{asChild:!0,children:r}),(0,L.jsx)(X,{side:`bottom`,className:`text-xs`,children:i})]})}):r}function Ge({activeTabClassName:e,inactiveTabClassName:t,itemRef:n,labelClassName:r,tab:i,tabBaseClassName:o}){let s=i.onClose&&i.closePlacement===`leading-hover`;return(0,L.jsxs)(`div`,{ref:n,"data-compact-tab-item":``,onClick:e=>e.target===e.currentTarget&&i.onSelect(),className:a(o??`group flex max-w-[180px] min-w-0 cursor-pointer items-center gap-1.5 border-r border-gray-200/70 border-b-2 px-2.5 py-2 transition-colors`,i.active?e??`border-b-primary bg-white text-gray-900`:t??`border-b-transparent bg-gray-50/85 text-gray-500 hover:bg-gray-100`),children:[s?(0,L.jsxs)(`button`,{type:`button`,onClick:e=>He(e,i.onClose),className:`relative inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-700`,"aria-label":i.closeLabel,children:[(0,L.jsx)(`span`,{className:`flex items-center justify-center group-hover:hidden`,children:i.leadingIcon}),(0,L.jsx)(k,{className:`hidden h-3.5 w-3.5 group-hover:block`})]}):null,(0,L.jsx)(We,{tab:i,labelClassName:r}),(0,L.jsx)(Ue,{tab:i}),i.onClose&&i.closePlacement!==`leading-hover`?(0,L.jsx)(Z,{size:`sm`,tone:`strong`,icon:(0,L.jsx)(k,{className:`h-3 w-3`}),label:i.closeLabel??``,tooltip:i.closeLabel??null,onClick:e=>He(e,i.onClose)}):null]})}function Ke({actionButtonClassName:e,actions:t,actionsClassName:n,actionsTestId:r,className:i,onPointerDown:o,onScrollPointerDown:s,scrollClassName:c,scrollTestId:l,tabs:u,tabsClassName:d,testId:f,...p}){let m=I.useCallback(e=>{e?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[]);return(0,L.jsxs)(`div`,{"data-testid":f,className:a(`flex min-w-0 items-stretch border-b border-gray-200/70 bg-gray-50/85`,i),onPointerDown:o,children:[(0,L.jsx)(`div`,{className:a(`min-w-0 flex-1 overflow-x-auto overflow-y-hidden`,c),onPointerDown:s,children:(0,L.jsx)(`div`,{"data-testid":l,className:a(`flex min-w-max items-stretch`,d),children:u.map(e=>(0,L.jsx)(Ge,{itemRef:e.active?m:void 0,tab:e,...p},e.key))})}),(0,L.jsx)(`div`,{className:a(`flex shrink-0 items-center gap-1`,n),"data-testid":r,onPointerDown:e=>e.stopPropagation(),children:t.map(t=>(0,L.jsx)(Z,{icon:t.icon,label:t.label,disabled:t.disabled,onClick:t.onClick,className:e},t.key))})]})}function qe(){return(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center bg-background px-5 py-6`,children:(0,L.jsxs)(`div`,{className:`flex max-w-[260px] flex-col items-center gap-3 text-center`,children:[(0,L.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground shadow-[0_1px_2px_rgba(30,20,10,0.04)]`,children:(0,L.jsx)(N,{className:`h-5 w-5`})}),(0,L.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:i(`docBrowserHomeTitle`)})]})})}function Je({isVisible:e,onRefresh:t,onSubmit:n,onUrlInputChange:r,placeholder:a,urlInput:o}){return e?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/70 bg-card px-3.5 py-2 shrink-0`,children:[(0,L.jsxs)(`form`,{onSubmit:n,className:`flex-1 relative`,children:[(0,L.jsx)(E,{className:`absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,L.jsx)(`input`,{type:`text`,value:o,onChange:e=>r(e.target.value),"aria-label":i(`docBrowserAddressLabel`),placeholder:a,className:`h-8 w-full rounded-lg border border-border/75 bg-background pl-8 pr-3 text-xs text-foreground transition-colors placeholder:text-muted-foreground/55 focus:border-border focus:outline-none focus:ring-0`})]}),(0,L.jsx)(Z,{icon:(0,L.jsx)(O,{className:`h-3.5 w-3.5`}),label:i(`docBrowserRefresh`),onClick:t})]}):null}function Ye({currentTab:e,currentUrl:t,customContent:r,iframeRef:i,iframeInstanceId:a,iframeSandbox:o,isDragging:s,isResizing:c,onIframePointerOver:l}){return(0,L.jsxs)(`div`,{className:`flex-1 relative overflow-hidden`,children:[r||(0,L.jsx)(`iframe`,{ref:i,src:t,name:n(e?.contentParams),className:`absolute inset-0 w-full h-full border-0`,title:e?.title||`NextClaw Docs`,sandbox:o,tabIndex:l?0:void 0,onPointerOver:l,allow:`clipboard-read; clipboard-write`,allowFullScreen:!0},a),(c||s)&&(0,L.jsx)(`div`,{className:`absolute inset-0 z-10`})]})}function Xe(e){try{let t=new URL(e,window.location.origin);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function Ze({currentUrl:e,isVisible:t}){if(!t||!Xe(e))return null;let n=A(e)?i(`docBrowserOpenExternal`):i(`docBrowserOpenInBrowser`);return(0,L.jsx)(`div`,{className:`flex items-center justify-between border-t border-border/70 bg-muted/55 px-4 py-2 shrink-0`,children:(0,L.jsx)(te,{href:e,external:!0,iconPosition:`trailing`,size:`xs`,"data-doc-external":!0,children:n})})}function Qe(e){return e instanceof Element&&!!e.closest(`button, a, input, textarea, select, [data-compact-tab-item]`)}function $e({tabs:e,activeTabId:t,canGoBack:n,canGoForward:r,isDocked:o,isFullscreen:s,dockState:c,onGoBack:l,onGoForward:u,onOpenNewTab:d,onToggleDock:f,onSetActiveTab:p,onCloseTab:m,onClose:h,onDragStart:g,onToggleMode:_}){let v=i(`docBrowserBack`),y=i(`docBrowserClose`),b=i(`docBrowserCloseTab`),x=c?.isDocked?c.removable?i(`sideDockUnpinCurrent`):i(`sideDockBuiltInDocked`):i(`sideDockPinCurrent`),S=i(`docBrowserForward`),C=i(o?`docBrowserFloatMode`:`docBrowserDockMode`),w=i(`docBrowserNewTab`);return(0,L.jsx)(Ke,{testId:`doc-browser-tab-strip`,actionsTestId:`doc-browser-tab-actions`,tabs:e.map(e=>({key:e.id,label:e.title||i(`docBrowserTabUntitled`),active:e.id===t,tooltip:e.title,closeLabel:b,closePlacement:`trailing`,onSelect:()=>p(e.id),onClose:()=>m(e.id)})),actions:[{key:`back`,disabled:!n,icon:(0,L.jsx)(ee,{className:`h-3.5 w-3.5`}),label:v,onClick:l},{key:`forward`,disabled:!r,icon:(0,L.jsx)(M,{className:`h-3.5 w-3.5`}),label:S,onClick:u},{key:`new-tab`,icon:(0,L.jsx)(D,{className:`h-3.5 w-3.5`}),label:w,onClick:d},...c?.canDock?[{key:`dock`,disabled:c.isDocked&&!c.removable,icon:c.isDocked&&c.removable?(0,L.jsx)(ce,{className:`h-3.5 w-3.5`}):(0,L.jsx)(le,{className:`h-3.5 w-3.5`}),label:x,onClick:()=>f?.()}]:[],...s?[]:[{key:`mode`,icon:o?(0,L.jsx)(se,{className:`h-3.5 w-3.5`}):(0,L.jsx)(F,{className:`h-3.5 w-3.5`}),label:C,onClick:_}],{key:`close`,icon:(0,L.jsx)(k,{className:`h-3.5 w-3.5`}),label:y,onClick:h}],className:a(`h-10 gap-1.5 border-border/50 bg-card/80 px-2 shrink-0 select-none`,s&&`h-[calc(env(safe-area-inset-top,0px)+2.5rem)] pt-[env(safe-area-inset-top,0px)]`),scrollClassName:a(`doc-browser-tab-scrollbar flex h-full items-center gap-0.5`,!o&&!s&&`cursor-grab active:cursor-grabbing`),tabsClassName:`items-center gap-0.5`,actionsClassName:`h-full items-center gap-0.5`,actionButtonClassName:`rounded-md p-1.5 text-muted-foreground hover:bg-muted/60 hover:text-foreground disabled:opacity-50`,tabBaseClassName:`group inline-flex min-w-0 cursor-pointer items-center gap-0.5 h-7 px-2 rounded-md text-xs max-w-[220px] shrink-0 transition-colors`,activeTabClassName:`bg-muted/80 text-foreground`,inactiveTabClassName:`text-muted-foreground hover:bg-muted/45 hover:text-foreground`,labelClassName:`px-0.5 text-xs font-normal`,onPointerDown:!o&&!s?g:void 0,onScrollPointerDown:e=>{if(Qe(e.target)){e.stopPropagation();return}!o&&!s&&(e.stopPropagation(),g(e))}})}var Q=40,et=360,tt=400;function $(e,t,n){return Math.min(n,Math.max(t,e))}function nt(e,t){return e.split(`-`).includes(t)}function rt(){return{x:Math.max(Q,window.innerWidth-520),y:80,w:480,h:600}}function it(e,t,n){return{...e,x:$(e.x+t,Q,window.innerWidth-Q-e.w),y:$(e.y+n,Q,window.innerHeight-Q-e.h)}}function at(e,t,n,r){let i=t.x+t.w,a=t.y+t.h,o=nt(e,`left`)?$(t.x+n,Q,i-et):t.x,s=nt(e,`right`)?$(i+n,o+et,window.innerWidth-Q):i,c=nt(e,`top`)?$(t.y+r,Q,a-tt):t.y,l=nt(e,`bottom`)?$(a+r,c+tt,window.innerHeight-Q):a;return{x:o,y:c,w:s-o,h:l-c}}function ot({children:e,className:t,style:n,defaultWidth:r=420,minWidth:i=320,maxWidth:o=860,onWidthCommit:s,overlay:c=!1,overlayScope:l=`viewport`,width:u,...d}){let f=(0,I.useRef)(null),p=(0,I.useRef)(u??r),[m,h]=(0,I.useState)(!1),[g,_]=(0,I.useState)(null),[v,y]=(0,I.useState)(r),b=g??u??v,x=c?l===`container`?`absolute inset-0 z-30`:`fixed inset-0 z-40`:`border-l border-border`,S=e=>{if(c)return;e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),h(!0),p.current=b,f.current={startX:e.clientX,startWidth:b};let t=e=>{let t=f.current;if(!t)return;let n=t.startWidth+t.startX-e.clientX,r=Math.max(i,Math.min(o,n));p.current=r,_(r)},n=()=>{u===void 0&&y(p.current),s?.(p.current),_(null),h(!1),f.current=null,window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n),window.removeEventListener(`pointercancel`,n)};window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n),window.addEventListener(`pointercancel`,n)};return(0,L.jsxs)(`aside`,{...d,className:a(`relative flex h-full min-h-0 shrink-0 overflow-hidden bg-card text-card-foreground`,x,t),style:c?n:{...n,width:b},children:[c?null:(0,L.jsx)(`div`,{className:`absolute left-0 top-0 z-20 h-full w-3 cursor-ew-resize transition-colors hover:bg-primary/10`,"data-testid":`resizable-right-panel-handle`,onPointerDown:S}),(0,L.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,children:e}),m?(0,L.jsx)(`div`,{className:`absolute inset-0 z-10 cursor-ew-resize`,"data-testid":`resizable-right-panel-resize-shield`}):null]})}var st=`allow-same-origin allow-scripts allow-popups allow-forms`;function ct(e,t){if(e.startsWith(`/`))try{return new URL(e,t).toString()}catch{return e}return/^[a-z][a-z\d+.-]*:\/\//i.test(e)||e===`about:blank`?e:/^(localhost|127\.|0\.0\.0\.0|\[::1\])(?::|\/|$)/i.test(e)?`http://${e}`:`https://${e}`}function lt(e,t){if(!t)return st;let n=e?.getIframeSandbox?.(t);return n===void 0?t.kind===`content`?void 0:st:n}function ut(e,t,n){return(0,I.useCallback)(()=>{if(n?.canDock){if(n.isDocked){n.removable&&e?.unpinTab(t);return}e?.pinTab(t)}},[t,e,n])}function dt({activeTabId:e,currentUrl:t,isAddressToolbarTab:n,isContentTab:r,isDocsTab:i,navigate:a}){let o=`${e}:${t}:${r?`content`:`docs`}`,[s,c]=(0,I.useState)(null),l=(()=>{if(!n)return``;if(r)return t;try{return new URL(t).pathname}catch{return t}})(),u=s?.key===o?s.value:l,d=(0,I.useCallback)(e=>c({key:o,value:e}),[o]);return{handleUrlSubmit:(0,I.useCallback)(e=>{if(e.preventDefault(),!n)return;let r=u.trim();r&&(i&&r.startsWith(`/`)?a(j(r)):i&&r.startsWith(`http`)?a(r):a(i?j(`/${r}`):ct(r,t)))},[t,n,i,a,u]),setUrlInput:d,urlInput:u}}function ft({customTabRenderers:e={},displayMode:t=`desktop`,dockControls:n}){let{isOpen:r,mode:o,dockedWidth:s,tabs:c,activeTabId:l,activeHistory:u,activeHistoryIndex:d,currentTab:f,open:p,openTarget:m,openNewTab:h,close:g,toggleMode:_,setDockedWidth:v,goBack:y,goForward:b,navigate:x,syncUrl:S,setActiveTab:C,closeTab:w}=ie(),[T,ee]=(0,I.useState)(0),[E,te]=(0,I.useState)(rt),[D,O]=(0,I.useState)(null),k=(0,I.useRef)(null),A=f?.currentUrl??ae(),j=f?.navVersion??0,M=`${l}:${j}:${T}`,N=(0,I.useRef)(null),P=(0,I.useRef)(j),F=f?.kind===`docs`,se=f?.kind===re,ce=d>0,le=d<u.length-1,R=f?e[f.kind]:void 0,ue=n?.getDockState(f),z=f?.kind===`content`,B=F||z,{handleUrlSubmit:de,setUrlInput:V,urlInput:fe}=dt({activeTabId:l,currentUrl:A,isAddressToolbarTab:B,isContentTab:z,isDocsTab:F,navigate:x});(0,I.useEffect)(()=>{if(!F){N.current=null;return}if(j!==P.current){P.current=j,N.current=ne(A);return}if(k.current?.contentWindow)try{let e=new URL(A).pathname;N.current=ne(A),k.current.contentWindow.postMessage({type:`docs-navigate`,path:e},`*`)}catch{}},[A,j,F]),(0,I.useEffect)(()=>{let e=e=>{if(F&&e.data?.type===`docs-route-change`&&typeof e.data.url==`string`){let t=ne(e.data.url);if(N.current&&t!==N.current)return;N.current=null,S(e.data.url)}};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[A,S,F]),(0,I.useEffect)(()=>{if(!f||!R?.onIframeMessage)return;let e=e=>{R.onIframeMessage?.({event:e,iframe:k.current,iframeInstanceId:M,tab:f})};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[f,R,M]);let H=(0,I.useCallback)(e=>{e.preventDefault(),O({kind:`drag`,startX:e.clientX,startY:e.clientY,startRect:E})},[E]),U=(0,I.useCallback)(e=>t=>{t.preventDefault(),t.stopPropagation(),O({kind:`resize`,edge:e,startX:t.clientX,startY:t.clientY,startRect:E})},[E]);(0,I.useEffect)(()=>{if(!D)return;let e=e=>{let{startRect:t,startX:n,startY:r}=D,i=e.clientX-n,a=e.clientY-r;if(D.kind===`drag`){te(it(t,i,a));return}te(at(D.edge,t,i,a))},t=()=>O(null);return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[D]);let W=(0,I.useCallback)(()=>{ee(e=>e+1)},[]),pe=ut(n,f,ue);if(!r)return null;let G=o===`docked`,K=t===`fullscreen`,q=f?{currentUrl:A,open:p,openTarget:m,refreshIframe:W,tab:f}:void 0,me=q?R?.renderToolbar?.(q):null,J=q?R?.renderContent?.(q)??(se?(0,L.jsx)(qe,{}):null):null,he=lt(R,f),ge=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)($e,{tabs:c,activeTabId:l,canGoBack:ce,canGoForward:le,dockState:ue,isDocked:G,isFullscreen:K,onGoBack:y,onGoForward:b,onOpenNewTab:h,onToggleDock:pe,onSetActiveTab:C,onCloseTab:w,onClose:g,onDragStart:H,onToggleMode:_}),(0,L.jsx)(Je,{isVisible:B,onRefresh:W,onSubmit:de,onUrlInputChange:V,placeholder:i(F?`docBrowserSearchPlaceholder`:`docBrowserAddressPlaceholder`),urlInput:fe}),me,(0,L.jsx)(Ye,{currentTab:f,currentUrl:A,customContent:J,iframeRef:k,iframeInstanceId:M,iframeSandbox:he,isDragging:D?.kind===`drag`,isResizing:D?.kind===`resize`,onIframePointerOver:R?.onIframePointerOver}),(0,L.jsx)(Ze,{currentUrl:A,isVisible:F||z})]});return G&&!K?(0,L.jsx)(ot,{"data-testid":`doc-browser-panel`,defaultWidth:s,width:s,minWidth:320,maxWidth:860,onWidthCommit:v,children:ge}):(0,L.jsxs)(`div`,{"data-testid":`doc-browser-panel`,className:a(`relative flex flex-col overflow-hidden bg-card text-card-foreground`,K?`fixed inset-0 z-[var(--z-floating-panel)] h-[100dvh] w-screen rounded-none border-0 shadow-2xl`:`rounded-2xl border border-border shadow-2xl`),style:K?void 0:{position:`fixed`,left:E.x,top:E.y,width:E.w,height:E.h,zIndex:`var(--z-floating-panel)`},children:[ge,!G&&!K&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`absolute top-0 left-0 h-3 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top`,onPointerDown:U(`top`)}),(0,L.jsx)(`div`,{className:`absolute top-0 left-0 w-3 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-left`,onPointerDown:U(`left`)}),(0,L.jsx)(`div`,{className:`absolute top-0 right-0 w-3 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-right`,onPointerDown:U(`right`)}),(0,L.jsx)(`div`,{className:`absolute bottom-0 left-0 h-3 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-bottom`,onPointerDown:U(`bottom`)}),(0,L.jsx)(`div`,{className:`absolute top-0 left-0 z-30 h-4 w-4 cursor-nw-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top-left`,onPointerDown:U(`top-left`)}),(0,L.jsx)(`div`,{className:`absolute top-0 right-0 z-30 h-4 w-4 cursor-ne-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top-right`,onPointerDown:U(`top-right`)}),(0,L.jsx)(`div`,{className:`absolute bottom-0 left-0 z-30 h-4 w-4 cursor-sw-resize hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-bottom-left`,onPointerDown:U(`bottom-left`)}),(0,L.jsx)(`div`,{className:`absolute bottom-0 right-0 z-30 flex h-4 w-4 cursor-se-resize items-center justify-center text-muted-foreground/45 transition-colors hover:text-muted-foreground`,"data-testid":`doc-browser-resize-bottom-right`,onPointerDown:U(`bottom-right`),children:(0,L.jsx)(oe,{className:`w-3 h-3 rotate-[-45deg]`})})]})]})}export{N as _,Re as a,ze as c,Me as d,Ne as f,P as g,F as h,Z as i,Ie as l,le as m,ot as n,X as o,Pe as p,Ke as r,Le as s,ft as t,Fe as u,M as v};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{D as t,a as n,d as r,k as i,r as a,t as o}from"./react-39CDNZlM.js";import{n as s,t as c}from"./middleware-Df-a4x-q.js";var l=`docs.nextclaw.io`,u=`docs.nextclaw.net`,d=`nextclaw-docs.pages.dev`,f=new Set([l,`www.${l}`,u,`www.${u}`,d,`www.${d}`]),p=`https://${l}`,ee=`https://${u}`,m=`home`,h=`nextclaw://new-tab`,g=`/guide/getting-started`;function _(e){return e===`zh`?`zh`:`en`}function v(e,t){let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`||n===``?`/${t}/`:/^\/(en|zh)(\/|$)/.test(n)?n:`/${t}${n}`}function y(e){let t=e?.trim();if(t)try{return new URL(t).origin}catch{return}}function b(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function x(e){return/^[a-z][a-z\d+.-]*:/i.test(e.trim())}function S(){return n()===`zh`||b()===`Asia/Shanghai`}function C(){return y(void 0)||(S()?y(void 0)??ee:p)}function w(e){let t=_(n()),r=C();try{let n=new URL(e,r),i=new URL(r);return!x(e)||f.has(n.hostname)||n.origin===i.origin?(n.protocol=i.protocol,n.host=i.host,n.pathname=v(n.pathname,t),n.toString()):n.toString()}catch{return new URL(`/${t}${g}`,r).toString()}}function T(){return w(g)}function E(e){return w(e)}function D(e){try{return new URL(e).pathname.replace(/\.html$/,``).replace(/\/$/,``)}catch{return e}}function O(e,t,n=`Docs`){try{let r=new URL(e,p);if(r.protocol===`data:`)return t===`docs`?n:`Detail`;let i=r.pathname.split(`/`).filter(Boolean),a=i[i.length-1]??n;return decodeURIComponent(a).replace(/[-_]/g,` `).slice(0,40)||n}catch{return n}}function k(e){try{let t=typeof window<`u`?window.location.origin:p,n=new URL(e,t);return f.has(n.hostname)}catch{return!1}}function te(e,t){return t===`docs`?w(e):e}var A=0;function j(e){return typeof e==`number`&&Number.isFinite(e)?Math.min(860,Math.max(320,e)):420}function M(){return A+=1,`doc-tab-${Date.now()}-${A}`}function N(e,t,n,r,i,o,s){let c=n?.trim()||O(e,t,t===`docs`?a(`docBrowserHelp`):`Detail`),l=i?.trim();return{id:M(),kind:t,title:c,currentUrl:e,resourceUri:l||void 0,contentParams:s,dockIcon:o,dedupeKey:r,history:[e],historyIndex:0,navVersion:0}}function P(e,t){let n=[...e.history.slice(0,e.historyIndex+1),t];return{history:n,historyIndex:n.length-1}}function F(e,t,n,i,a){let o={...t,title:i?.title||n.title||t.title,kind:n.kind,resourceUri:n.resourceUri??n.url,dockIcon:i?.dockIcon??n.dockIcon,dedupeKey:a,contentParams:n.contentParams},s=e.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind);return s&&r(t.contentParams)===r(n.contentParams)?o:s?{...o,navVersion:t.navVersion+1}:{...o,currentUrl:n.url,...P(t,n.url),navVersion:t.navVersion+1}}function I(e){return{kind:e.kind,resourceUri:e.resourceUri,tabId:e.id,url:e.currentUrl}}function L(){let e=N(h,m,a(`docBrowserHomeTitle`));return{isOpen:!1,mode:`docked`,dockedWidth:420,tabs:[e],activeTabId:e.id,activeHistory:[I(e)],activeHistoryIndex:0}}var R=`nextclaw.doc-browser.state`,z=1,B=8;function V(e){return!!e&&typeof e==`object`}function H(e){return e===`floating`||e===`docked`}function U(e,t){if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`&&e.trim().length>0);return n.length>0?n:[t]}function W(e,t,n,r){return typeof e==`number`&&Number.isFinite(e)?Math.min(n,Math.max(t,e)):r}function G(e){if(!(!V(e)||typeof e.type!=`string`)){if(e.type===`builtin`&&typeof e.name==`string`&&e.name.trim().length>0)return{type:`builtin`,name:e.name.trim()};if(e.type===`url`&&typeof e.url==`string`&&e.url.trim().length>0)return{type:`url`,url:e.url.trim()};if(e.type===`text`&&typeof e.value==`string`&&e.value.trim().length>0)return{type:`text`,value:e.value.trim()}}}function K(e){if(!V(e)||typeof e.id!=`string`||typeof e.kind!=`string`||typeof e.title!=`string`||typeof e.currentUrl!=`string`||e.currentUrl.trim().length===0)return null;let t=U(e.history,e.currentUrl),n=W(e.historyIndex,0,t.length-1,t.length-1),r=W(e.navVersion,0,2**53-1,0),i=typeof e.dedupeKey==`string`&&e.dedupeKey.trim().length>0?e.dedupeKey:void 0,a=typeof e.resourceUri==`string`&&e.resourceUri.trim().length>0?e.resourceUri.trim():void 0,o=G(e.dockIcon);return{id:e.id,kind:e.kind,title:e.title,currentUrl:t[n]??e.currentUrl,resourceUri:a,dockIcon:o,dedupeKey:i,history:t,historyIndex:n,navVersion:r}}function q(e){return{kind:e.kind,resourceUri:e.resourceUri,tabId:e.id,url:e.currentUrl}}function J(e,t){if(!V(e)||typeof e.tabId!=`string`||typeof e.kind!=`string`||typeof e.url!=`string`||e.url.trim().length===0||!t.has(e.tabId))return null;let n=typeof e.resourceUri==`string`&&e.resourceUri.trim().length>0?e.resourceUri.trim():void 0;return{kind:e.kind,resourceUri:n,tabId:e.tabId,url:e.url}}function Y(e){if(!V(e))return null;let t=Array.isArray(e.tabs)?e.tabs.map(K).filter(e=>e!==null).slice(-B):[];if(t.length===0)return null;let n=typeof e.activeTabId==`string`?e.activeTabId:null,r=t.some(e=>e.id===n)?n??t[0].id:t[0].id,i=new Map(t.map(e=>[e.id,e])),a=Array.isArray(e.activeHistory)?e.activeHistory.map(e=>J(e,i)).filter(e=>e!==null):[],o=[q(i.get(r)??t[0])],s=a.length>0?a:o,c=W(e.activeHistoryIndex,0,s.length-1,s.length-1),l=s[c],u=i.has(l.tabId)?l.tabId:r;return{isOpen:e.isOpen===!0,mode:H(e.mode)?e.mode:`docked`,dockedWidth:j(e.dockedWidth),tabs:t,activeTabId:u,activeHistory:s,activeHistoryIndex:c}}function X(e,t){return typeof t==`function`?t(e):t}var Z=o()(s(e=>({snapshot:L(),setSnapshot:t=>e(e=>({snapshot:X(e.snapshot,t)}))}),{name:R,version:z,storage:c(()=>window.localStorage),partialize:e=>({snapshot:{isOpen:e.snapshot.isOpen,mode:e.snapshot.mode,dockedWidth:e.snapshot.dockedWidth,tabs:e.snapshot.tabs.slice(-B),activeTabId:e.snapshot.activeTabId,activeHistory:e.snapshot.activeHistory,activeHistoryIndex:e.snapshot.activeHistoryIndex}}),merge:(e,t)=>{let n=Y(V(e)?e.snapshot:null);return n?{...t,snapshot:n}:t}})),Q=e(i(),1),ne=t(),$=(0,Q.createContext)(null);function re(){let e=(0,Q.useContext)($);if(!e)throw Error(`useDocBrowser must be used within DocBrowserProvider`);return e}function ie({children:e,manager:t}){let n=Z(e=>e.snapshot),r=(0,Q.useMemo)(()=>n.tabs.find(e=>e.id===n.activeTabId)??n.tabs[0],[n.activeTabId,n.tabs]),i=(0,Q.useMemo)(()=>({...n,currentTab:r,open:t.open,openTarget:t.openTarget,openNewTab:t.openNewTab,close:t.close,toggleMode:t.toggleMode,setDockedWidth:t.setDockedWidth,navigate:t.navigate,syncUrl:t.syncUrl,goBack:t.goBack,goForward:t.goForward,closeTab:t.closeTab,setActiveTab:t.setActiveTab}),[r,t,n]);return(0,ne.jsx)($.Provider,{value:i,children:e})}export{D as _,L as a,j as c,m as d,h as f,k as g,O as h,P as i,F as l,E as m,re as n,I as o,T as p,Z as r,N as s,ie as t,p as u,te as v};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{D as t,a as n,d as r,k as i,r as a,t as o}from"./react-D6ShNq95.js";import{n as s,t as c}from"./middleware-Df-a4x-q.js";var l=`docs.nextclaw.io`,u=`docs.nextclaw.net`,d=`nextclaw-docs.pages.dev`,f=new Set([l,`www.${l}`,u,`www.${u}`,d,`www.${d}`]),p=`https://${l}`,ee=`https://${u}`,m=`home`,h=`nextclaw://new-tab`,g=`/guide/getting-started`;function _(e){return e===`zh`?`zh`:`en`}function v(e,t){let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`||n===``?`/${t}/`:/^\/(en|zh)(\/|$)/.test(n)?n:`/${t}${n}`}function y(e){let t=e?.trim();if(t)try{return new URL(t).origin}catch{return}}function b(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function x(e){return/^[a-z][a-z\d+.-]*:/i.test(e.trim())}function S(){return n()===`zh`||b()===`Asia/Shanghai`}function C(){return y(void 0)||(S()?y(void 0)??ee:p)}function w(e){let t=_(n()),r=C();try{let n=new URL(e,r),i=new URL(r);return!x(e)||f.has(n.hostname)||n.origin===i.origin?(n.protocol=i.protocol,n.host=i.host,n.pathname=v(n.pathname,t),n.toString()):n.toString()}catch{return new URL(`/${t}${g}`,r).toString()}}function T(){return w(g)}function E(e){return w(e)}function D(e){try{return new URL(e).pathname.replace(/\.html$/,``).replace(/\/$/,``)}catch{return e}}function O(e,t,n=`Docs`){try{let r=new URL(e,p);if(r.protocol===`data:`)return t===`docs`?n:`Detail`;let i=r.pathname.split(`/`).filter(Boolean),a=i[i.length-1]??n;return decodeURIComponent(a).replace(/[-_]/g,` `).slice(0,40)||n}catch{return n}}function k(e){try{let t=typeof window<`u`?window.location.origin:p,n=new URL(e,t);return f.has(n.hostname)}catch{return!1}}function te(e,t){return t===`docs`?w(e):e}var A=0;function j(e){return typeof e==`number`&&Number.isFinite(e)?Math.min(860,Math.max(320,e)):420}function M(){return A+=1,`doc-tab-${Date.now()}-${A}`}function N(e,t,n,r,i,o,s){let c=n?.trim()||O(e,t,t===`docs`?a(`docBrowserHelp`):`Detail`),l=i?.trim();return{id:M(),kind:t,title:c,currentUrl:e,resourceUri:l||void 0,contentParams:s,dockIcon:o,dedupeKey:r,history:[e],historyIndex:0,navVersion:0}}function P(e,t){let n=[...e.history.slice(0,e.historyIndex+1),t];return{history:n,historyIndex:n.length-1}}function F(e,t,n,i,a){let o={...t,title:i?.title||n.title||t.title,kind:n.kind,resourceUri:n.resourceUri??n.url,dockIcon:i?.dockIcon??n.dockIcon,dedupeKey:a,contentParams:n.contentParams},s=e.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind);return s&&r(t.contentParams)===r(n.contentParams)?o:s?{...o,navVersion:t.navVersion+1}:{...o,currentUrl:n.url,...P(t,n.url),navVersion:t.navVersion+1}}function I(e){return{kind:e.kind,resourceUri:e.resourceUri,tabId:e.id,url:e.currentUrl}}function L(){let e=N(h,m,a(`docBrowserHomeTitle`));return{isOpen:!1,mode:`docked`,dockedWidth:420,tabs:[e],activeTabId:e.id,activeHistory:[I(e)],activeHistoryIndex:0}}var R=`nextclaw.doc-browser.state`,z=1,B=8;function V(e){return!!e&&typeof e==`object`}function H(e){return e===`floating`||e===`docked`}function U(e,t){if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`&&e.trim().length>0);return n.length>0?n:[t]}function W(e,t,n,r){return typeof e==`number`&&Number.isFinite(e)?Math.min(n,Math.max(t,e)):r}function G(e){if(!(!V(e)||typeof e.type!=`string`)){if(e.type===`builtin`&&typeof e.name==`string`&&e.name.trim().length>0)return{type:`builtin`,name:e.name.trim()};if(e.type===`url`&&typeof e.url==`string`&&e.url.trim().length>0)return{type:`url`,url:e.url.trim()};if(e.type===`text`&&typeof e.value==`string`&&e.value.trim().length>0)return{type:`text`,value:e.value.trim()}}}function K(e){if(!V(e)||typeof e.id!=`string`||typeof e.kind!=`string`||typeof e.title!=`string`||typeof e.currentUrl!=`string`||e.currentUrl.trim().length===0)return null;let t=U(e.history,e.currentUrl),n=W(e.historyIndex,0,t.length-1,t.length-1),r=W(e.navVersion,0,2**53-1,0),i=typeof e.dedupeKey==`string`&&e.dedupeKey.trim().length>0?e.dedupeKey:void 0,a=typeof e.resourceUri==`string`&&e.resourceUri.trim().length>0?e.resourceUri.trim():void 0,o=G(e.dockIcon);return{id:e.id,kind:e.kind,title:e.title,currentUrl:t[n]??e.currentUrl,resourceUri:a,dockIcon:o,dedupeKey:i,history:t,historyIndex:n,navVersion:r}}function q(e){return{kind:e.kind,resourceUri:e.resourceUri,tabId:e.id,url:e.currentUrl}}function J(e,t){if(!V(e)||typeof e.tabId!=`string`||typeof e.kind!=`string`||typeof e.url!=`string`||e.url.trim().length===0||!t.has(e.tabId))return null;let n=typeof e.resourceUri==`string`&&e.resourceUri.trim().length>0?e.resourceUri.trim():void 0;return{kind:e.kind,resourceUri:n,tabId:e.tabId,url:e.url}}function Y(e){if(!V(e))return null;let t=Array.isArray(e.tabs)?e.tabs.map(K).filter(e=>e!==null).slice(-B):[];if(t.length===0)return null;let n=typeof e.activeTabId==`string`?e.activeTabId:null,r=t.some(e=>e.id===n)?n??t[0].id:t[0].id,i=new Map(t.map(e=>[e.id,e])),a=Array.isArray(e.activeHistory)?e.activeHistory.map(e=>J(e,i)).filter(e=>e!==null):[],o=[q(i.get(r)??t[0])],s=a.length>0?a:o,c=W(e.activeHistoryIndex,0,s.length-1,s.length-1),l=s[c],u=i.has(l.tabId)?l.tabId:r;return{isOpen:e.isOpen===!0,mode:H(e.mode)?e.mode:`docked`,dockedWidth:j(e.dockedWidth),tabs:t,activeTabId:u,activeHistory:s,activeHistoryIndex:c}}function X(e,t){return typeof t==`function`?t(e):t}var Z=o()(s(e=>({snapshot:L(),setSnapshot:t=>e(e=>({snapshot:X(e.snapshot,t)}))}),{name:R,version:z,storage:c(()=>window.localStorage),partialize:e=>({snapshot:{isOpen:e.snapshot.isOpen,mode:e.snapshot.mode,dockedWidth:e.snapshot.dockedWidth,tabs:e.snapshot.tabs.slice(-B),activeTabId:e.snapshot.activeTabId,activeHistory:e.snapshot.activeHistory,activeHistoryIndex:e.snapshot.activeHistoryIndex}}),merge:(e,t)=>{let n=Y(V(e)?e.snapshot:null);return n?{...t,snapshot:n}:t}})),Q=e(i(),1),ne=t(),$=(0,Q.createContext)(null);function re(){let e=(0,Q.useContext)($);if(!e)throw Error(`useDocBrowser must be used within DocBrowserProvider`);return e}function ie({children:e,manager:t}){let n=Z(e=>e.snapshot),r=(0,Q.useMemo)(()=>n.tabs.find(e=>e.id===n.activeTabId)??n.tabs[0],[n.activeTabId,n.tabs]),i=(0,Q.useMemo)(()=>({...n,currentTab:r,open:t.open,openTarget:t.openTarget,openNewTab:t.openNewTab,close:t.close,toggleMode:t.toggleMode,setDockedWidth:t.setDockedWidth,navigate:t.navigate,syncUrl:t.syncUrl,goBack:t.goBack,goForward:t.goForward,closeTab:t.closeTab,setActiveTab:t.setActiveTab}),[r,t,n]);return(0,ne.jsx)($.Provider,{value:i,children:e})}export{D as _,L as a,j as c,m as d,h as f,k as g,O as h,P as i,F as l,E as m,re as n,I as o,T as p,Z as r,N as s,ie as t,p as u,te as v};
@@ -1 +1 @@
1
- import{c as e}from"./dist-rYHnBo8t.js";var t=e(`Ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),n=e(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);export{t as n,n as t};
1
+ import{c as e}from"./dist-C9EX46wM.js";var t=e(`Ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),n=e(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);export{t as n,n as t};
@@ -1 +1 @@
1
- import{D as e,w as t}from"./react-39CDNZlM.js";var n=e();function r({align:e=`end`,className:r,...i}){return(0,n.jsx)(`div`,{className:t(`flex flex-wrap items-center gap-2`,e===`start`&&`justify-start`,e===`end`&&`justify-end`,e===`between`&&`justify-between`,r),...i})}export{r as t};
1
+ import{D as e,w as t}from"./react-D6ShNq95.js";var n=e();function r({align:e=`end`,className:r,...i}){return(0,n.jsx)(`div`,{className:t(`flex flex-wrap items-center gap-2`,e===`start`&&`justify-start`,e===`end`&&`justify-end`,e===`between`&&`justify-between`,r),...i})}export{r as t};