@vokril/ui-solid 0.2.1 → 0.3.0

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 (90) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/{CommandPalette-4w3pEbna.cjs → CommandPalette-CF0B1C8k.cjs} +1 -1
  3. package/dist/{CommandPalette-D5BzLE0U.js → CommandPalette-DiCgZhOV.js} +1 -1
  4. package/dist/{GuidedTour-YUs4zuez.js → GuidedTour-C6Na3wqL.js} +1208 -1242
  5. package/dist/{GuidedTour-CYgy48bt.cjs → GuidedTour-DzQoun_d.cjs} +9 -9
  6. package/dist/{StatusBarNotificationBell-DQ94Snzi.cjs → StatusBarNotificationBell-CGW8eLXe.cjs} +1 -1
  7. package/dist/{StatusBarNotificationBell-BWZj0Pc2.js → StatusBarNotificationBell-DUiOZ0m5.js} +2 -2
  8. package/dist/_internal/app/keybindings/context/useFocusClaim.d.cts +27 -0
  9. package/dist/_internal/app/keybindings/context/useFocusClaim.d.ts +27 -0
  10. package/dist/_internal/app/keybindings/context/useListCommands.d.cts +15 -0
  11. package/dist/_internal/app/keybindings/context/useListCommands.d.ts +15 -0
  12. package/dist/_internal/app/keybindings/contextKey/builtins.d.cts +48 -2
  13. package/dist/_internal/app/keybindings/contextKey/builtins.d.ts +48 -2
  14. package/dist/_internal/app/keybindings/panelCommandsRegistry.d.cts +30 -0
  15. package/dist/_internal/app/keybindings/panelCommandsRegistry.d.ts +30 -0
  16. package/dist/builtins-DM7FDxEt.cjs +1 -0
  17. package/dist/builtins-XOM9gfIx.js +74 -0
  18. package/dist/descriptor-7e-M9YCk.cjs +1 -0
  19. package/dist/descriptor-DxSLz4-c.js +1106 -0
  20. package/dist/host/index.cjs +1 -1
  21. package/dist/host/index.d.cts +3 -0
  22. package/dist/host/index.d.ts +3 -0
  23. package/dist/host/index.js +67 -61
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.js +411 -404
  26. package/dist/notifications/index.cjs +1 -1
  27. package/dist/notifications/index.js +3 -3
  28. package/dist/overlay/index.cjs +1 -1
  29. package/dist/overlay/index.js +3 -3
  30. package/dist/server/{CommandPalette-C-Y0biXL.cjs → CommandPalette-CklLeIaO.cjs} +1 -1
  31. package/dist/server/{CommandPalette-C69NFoDY.js → CommandPalette-Dq-wVRJf.js} +1 -1
  32. package/dist/server/{GuidedTour-C38isG70.js → GuidedTour-CC3huRhY.js} +1074 -1109
  33. package/dist/server/{GuidedTour-TAGGtEp2.cjs → GuidedTour-Dik03Ffv.cjs} +11 -11
  34. package/dist/server/{StatusBarNotificationBell-Bm2ZiM-t.js → StatusBarNotificationBell-Cg9Zomfn.js} +2 -2
  35. package/dist/server/{StatusBarNotificationBell-DL_OCMv7.cjs → StatusBarNotificationBell-DSuT1si2.cjs} +1 -1
  36. package/dist/server/builtins-DM7FDxEt.cjs +1 -0
  37. package/dist/server/builtins-XOM9gfIx.js +74 -0
  38. package/dist/server/descriptor-BXVyZiT7.cjs +1 -0
  39. package/dist/server/descriptor-CqLXoy2i.js +992 -0
  40. package/dist/server/host/index.cjs +1 -1
  41. package/dist/server/host/index.js +71 -65
  42. package/dist/server/index.cjs +1 -1
  43. package/dist/server/index.js +713 -706
  44. package/dist/server/notifications/index.cjs +1 -1
  45. package/dist/server/notifications/index.js +3 -3
  46. package/dist/server/overlay/index.cjs +1 -1
  47. package/dist/server/overlay/index.js +3 -3
  48. package/dist/server/{settingsSearchContributor-CDqRlqt7.cjs → settingsSearchContributor-BHsOfue1.cjs} +1 -1
  49. package/dist/server/{settingsSearchContributor-Dn-HFipc.js → settingsSearchContributor-xo70xEuW.js} +1 -1
  50. package/dist/server/tree/index.cjs +1 -1
  51. package/dist/server/tree/index.js +9 -8
  52. package/dist/server/useListCommands-Bf7aOTXZ.js +61 -0
  53. package/dist/server/useListCommands-ucngC3t4.cjs +1 -0
  54. package/dist/server/visibleBrowserRegistry-BTfWUlI1.cjs +1 -0
  55. package/dist/server/visibleBrowserRegistry-Dw2Y4y_I.js +89 -0
  56. package/dist/{settingsSearchContributor-BGImAgsw.js → settingsSearchContributor-Ba4vBBmO.js} +1 -1
  57. package/dist/{settingsSearchContributor-Ci6vEEQ1.cjs → settingsSearchContributor-CYWXZV0b.cjs} +1 -1
  58. package/dist/solid/_internal/app/keybindings/context/useFocusClaim.js +32 -0
  59. package/dist/solid/_internal/app/keybindings/context/useListCommands.js +22 -0
  60. package/dist/solid/_internal/app/keybindings/contextKey/builtins.js +10 -0
  61. package/dist/solid/_internal/app/keybindings/panelCommandsRegistry.js +25 -0
  62. package/dist/solid/host/index.js +3 -0
  63. package/dist/solid/tree/TreeSurface.jsx +17 -0
  64. package/dist/solid/tree/createTreeController.js +7 -6
  65. package/dist/solid/tree/index.js +1 -0
  66. package/dist/solid/tree/selectAllInScope.js +47 -0
  67. package/dist/solid/tree/treeKeymap.js +0 -5
  68. package/dist/tree/createTreeController.d.cts +5 -0
  69. package/dist/tree/createTreeController.d.ts +5 -0
  70. package/dist/tree/index.cjs +1 -1
  71. package/dist/tree/index.d.cts +1 -0
  72. package/dist/tree/index.d.ts +1 -0
  73. package/dist/tree/index.js +9 -8
  74. package/dist/tree/selectAllInScope.d.cts +5 -0
  75. package/dist/tree/selectAllInScope.d.ts +5 -0
  76. package/dist/tree/treeKeymap.d.cts +2 -4
  77. package/dist/tree/treeKeymap.d.ts +2 -4
  78. package/dist/useListCommands-Bf7aOTXZ.js +61 -0
  79. package/dist/useListCommands-ucngC3t4.cjs +1 -0
  80. package/dist/visibleBrowserRegistry-BTfWUlI1.cjs +1 -0
  81. package/dist/visibleBrowserRegistry-Dw2Y4y_I.js +89 -0
  82. package/package.json +1 -1
  83. package/dist/descriptor-NxSXaBdy.cjs +0 -1
  84. package/dist/descriptor-zKWZdo3E.js +0 -1059
  85. package/dist/server/descriptor-B6FQLHie.cjs +0 -1
  86. package/dist/server/descriptor-DNWBt66Z.js +0 -951
  87. package/dist/server/visibleBrowserRegistry-CZFCFSo_.cjs +0 -1
  88. package/dist/server/visibleBrowserRegistry-DOZlLrpo.js +0 -113
  89. package/dist/visibleBrowserRegistry-CZFCFSo_.cjs +0 -1
  90. package/dist/visibleBrowserRegistry-DOZlLrpo.js +0 -113
@@ -1,4 +1,4 @@
1
- "use strict";const p=require("./catalogNotify-B6x3enJ5.cjs"),H=require("./notification-CrxHMXsk.cjs"),Y=require("./rendererLogging-B4XML4_G.cjs"),F=require("./notificationSuppressions-DFbFpayS.cjs"),e=require("solid-js/web"),te=require("./mainRealmDom-DijAgSXt.cjs"),c=require("solid-js"),Ce=require("./Input-BrxV_Xcb.cjs"),I=require("@vokril/icons"),Te=require("./visibleBrowserRegistry-CZFCFSo_.cjs"),K=require("./GuidedTour-CYgy48bt.cjs"),o=require("./i18n-DZZyw7Iu.cjs"),U=require("./pageTourState-D8Uapyft.cjs"),ye=require("./useSettingsSubscription-vlMrNNH9.cjs"),Ke=require("./DesktopContextMenuContext-DMGNVjaR.cjs"),R=require("./Button-DntBQ4fM.cjs"),re=require("./format-Cy7RJpYG.cjs"),Et=require("./DateRangePicker-dLlHJR71.cjs"),Xe=require("./OverlayScrollArea-BSlaXG1h.cjs"),Mt=require("./HostWindowContext-DqDeJmBP.cjs"),xt=require("./Popover-B8ozGuDX.cjs"),Dt=require("./keys-BeeC5_RZ.cjs"),Ot=require("./EmptyState-B9TxGJ5v.cjs"),Pt="vk_bar_iSxMW",Rt="vk_barCompact_SCRfr",Bt="vk_search_P2Oii",Ft="vk_dateBtn_v3RN1",fe={bar:Pt,barCompact:Rt,search:Bt,dateBtn:Ft};var $t=e.template("<div>");function Ze(t){return(()=>{var r=$t();return e.insert(r,e.createComponent(Ce.Input,{type:"text",get class(){return fe.search},get placeholder(){return t.searchPlaceholder??o.t("Search…")},get value(){return t.searchValue},onInput:a=>t.onSearchInput(a.currentTarget.value)}),null),e.insert(r,e.createComponent(c.Show,{get when(){return t.onDateRangeChange},get children(){return e.createComponent(Et.DateRangePicker,e.mergeProps({get value(){return t.dateRange??null},onChange:a=>{var u;return(u=t.onDateRangeChange)==null?void 0:u.call(t,a)},get triggerClass(){return fe.dateBtn}},()=>t.dateRangeAlign?{align:t.dateRangeAlign}:{}))}}),null),e.insert(r,()=>t.children,null),e.effect(()=>e.className(r,`${fe.bar} ${t.compact?fe.barCompact:""} ${t.class??""}`)),r})()}const ke=["general","vendor-error","sql-execution","connection","ssh","schema","users","tablespaces","locking","monitoring","source-control","file-system","settings","rss","plugins","workspace","dev"];function et(t){return Dt.isOneOf(ke,t)}function tt(t,r){const a=t.trim();if(!a)return null;if(r)try{const u=new RegExp(a,"i");return{test:h=>u.test(h)}}catch{return qe(a)}return qe(a)}function qe(t){const r=t.toLowerCase();return{test:a=>a.toLowerCase().includes(r)}}function nt(t,r){const{tones:a,sources:u,priorities:h,dateBounds:C,searchMatcher:T}=r;return t.filter(d=>!(a.size>0&&!a.has(d.tone)||u.size>0&&!u.has(d.source)||h.size>0&&!h.has(d.priority)||C&&(d.createdAt<C.start||d.createdAt>C.end)||T&&!T.test(`${d.message} ${d.source}`)))}const Lt={general:{label:"General",description:"Uncategorized notifications. Default for callers that do not pass a source."},"vendor-error":{label:"Database errors",description:"Errors carrying a recognised vendor code (Oracle ORA-NNNNN, PG SQLSTATE, MSSQL Msg N, …). Treated as urgent when the matching setting is enabled."},"sql-execution":{label:"SQL execution",description:"Query completion / cancellation / failure notifications."},connection:{label:"Connection",description:"Connect, disconnect, test, vault credential events."},ssh:{label:"SSH & terminal",description:"SSH dock, tunnels, terminal lifecycle."},schema:{label:"Schema browser",description:"DDL extraction, copy-name, refresh."},users:{label:"Users",description:"User management — create, unlock, alter."},tablespaces:{label:"Tablespaces",description:"Tablespace creation, quota warnings."},locking:{label:"Locking",description:"Blocking sessions and deadlock alerts."},monitoring:{label:"Monitoring",description:"Threshold alerts — CPU, blocked sessions, long-running ops, invalid objects, failed logins."},"source-control":{label:"Source control",description:"Git commit / pull / push outcomes."},"file-system":{label:"File system",description:"Save, copy, paste, image clipboard."},settings:{label:"Settings",description:"Preference saves, layout reset, import/export."},rss:{label:"RSS feeds",description:"Feed refresh, post counts."},plugins:{label:"Plugins",description:"Plugin install, activation, marketplace and sandbox events."},workspace:{label:"Workspace",description:"Workspace tabs, session restore and layout events."},dev:{label:"Developer",description:"Dev test surface and internal diagnostics."}},ve=ke.map(t=>({id:t,...Lt[t]})),He=new Map(ve.map(t=>[t.id,t]));function J(t){if(t){const r=He.get(t);if(r)return r}return He.get("general")??ve[0]}function zt(){return ve}function ot(t,r){const a=[];let u=0;for(;u<t.length;){const h=t[u];if(!h)break;if(h.pinned===!0){a.push({type:"entry",id:h.id,entry:h}),u+=1;continue}const C=r==="source"?h.source:`${h.source}|${h.tone}`;let T=u+1;for(;T<t.length;){const D=t[T];if(!D||D.pinned===!0||(r==="source"?D.source:`${D.source}|${D.tone}`)!==C)break;T+=1}const d=T-u;d===1?a.push({type:"entry",id:h.id,entry:h}):a.push({type:"group",id:`group:${C}:${h.id}`,groupKey:C,groupCount:d,groupSource:h.source,groupTone:h.tone,groupItems:t.slice(u,T)}),u=T}return a}function Vt(t,r){return(t+r).indexOf(r)<t.length}const Ut=/^[=+\-@\t\r]/,qt=/^[+-]?\d[\d.,' \u00A0\u202F]*(?:[eE][+-]?\d+)?$/,Ht=/^[ \t]|[ \t]$/;function it(t){return Ut.test(t)}function Gt(t,r){return it(t)?r==="quotePrefix"?`'${t}`:` ${t}`:t}function Wt(t,r,a={}){if(t==null)return"";const u=String(t),h=a.numeric===!0&&qt.test(u),C=h?u:Gt(u,r.policy),T=a.forceQuote===!0,d=r.quoteChar,D=r.escape==="backslash";return r.alwaysQuote||T||Ht.test(u)||!h&&r.policy==="tabPrefix"&&it(u)||Vt(C,r.delimiter)||C.includes(d)||C.includes(`
1
+ "use strict";const p=require("./catalogNotify-B6x3enJ5.cjs"),H=require("./notification-CrxHMXsk.cjs"),Y=require("./rendererLogging-B4XML4_G.cjs"),F=require("./notificationSuppressions-DFbFpayS.cjs"),e=require("solid-js/web"),te=require("./mainRealmDom-DijAgSXt.cjs"),c=require("solid-js"),Ce=require("./Input-BrxV_Xcb.cjs"),I=require("@vokril/icons"),Te=require("./visibleBrowserRegistry-BTfWUlI1.cjs"),K=require("./GuidedTour-DzQoun_d.cjs"),o=require("./i18n-DZZyw7Iu.cjs"),U=require("./pageTourState-D8Uapyft.cjs"),ye=require("./useSettingsSubscription-vlMrNNH9.cjs"),Ke=require("./DesktopContextMenuContext-DMGNVjaR.cjs"),R=require("./Button-DntBQ4fM.cjs"),re=require("./format-Cy7RJpYG.cjs"),Et=require("./DateRangePicker-dLlHJR71.cjs"),Xe=require("./OverlayScrollArea-BSlaXG1h.cjs"),Mt=require("./HostWindowContext-DqDeJmBP.cjs"),xt=require("./Popover-B8ozGuDX.cjs"),Dt=require("./keys-BeeC5_RZ.cjs"),Ot=require("./EmptyState-B9TxGJ5v.cjs"),Pt="vk_bar_iSxMW",Rt="vk_barCompact_SCRfr",Bt="vk_search_P2Oii",Ft="vk_dateBtn_v3RN1",fe={bar:Pt,barCompact:Rt,search:Bt,dateBtn:Ft};var $t=e.template("<div>");function Ze(t){return(()=>{var r=$t();return e.insert(r,e.createComponent(Ce.Input,{type:"text",get class(){return fe.search},get placeholder(){return t.searchPlaceholder??o.t("Search…")},get value(){return t.searchValue},onInput:a=>t.onSearchInput(a.currentTarget.value)}),null),e.insert(r,e.createComponent(c.Show,{get when(){return t.onDateRangeChange},get children(){return e.createComponent(Et.DateRangePicker,e.mergeProps({get value(){return t.dateRange??null},onChange:a=>{var u;return(u=t.onDateRangeChange)==null?void 0:u.call(t,a)},get triggerClass(){return fe.dateBtn}},()=>t.dateRangeAlign?{align:t.dateRangeAlign}:{}))}}),null),e.insert(r,()=>t.children,null),e.effect(()=>e.className(r,`${fe.bar} ${t.compact?fe.barCompact:""} ${t.class??""}`)),r})()}const ke=["general","vendor-error","sql-execution","connection","ssh","schema","users","tablespaces","locking","monitoring","source-control","file-system","settings","rss","plugins","workspace","dev"];function et(t){return Dt.isOneOf(ke,t)}function tt(t,r){const a=t.trim();if(!a)return null;if(r)try{const u=new RegExp(a,"i");return{test:h=>u.test(h)}}catch{return qe(a)}return qe(a)}function qe(t){const r=t.toLowerCase();return{test:a=>a.toLowerCase().includes(r)}}function nt(t,r){const{tones:a,sources:u,priorities:h,dateBounds:C,searchMatcher:T}=r;return t.filter(d=>!(a.size>0&&!a.has(d.tone)||u.size>0&&!u.has(d.source)||h.size>0&&!h.has(d.priority)||C&&(d.createdAt<C.start||d.createdAt>C.end)||T&&!T.test(`${d.message} ${d.source}`)))}const Lt={general:{label:"General",description:"Uncategorized notifications. Default for callers that do not pass a source."},"vendor-error":{label:"Database errors",description:"Errors carrying a recognised vendor code (Oracle ORA-NNNNN, PG SQLSTATE, MSSQL Msg N, …). Treated as urgent when the matching setting is enabled."},"sql-execution":{label:"SQL execution",description:"Query completion / cancellation / failure notifications."},connection:{label:"Connection",description:"Connect, disconnect, test, vault credential events."},ssh:{label:"SSH & terminal",description:"SSH dock, tunnels, terminal lifecycle."},schema:{label:"Schema browser",description:"DDL extraction, copy-name, refresh."},users:{label:"Users",description:"User management — create, unlock, alter."},tablespaces:{label:"Tablespaces",description:"Tablespace creation, quota warnings."},locking:{label:"Locking",description:"Blocking sessions and deadlock alerts."},monitoring:{label:"Monitoring",description:"Threshold alerts — CPU, blocked sessions, long-running ops, invalid objects, failed logins."},"source-control":{label:"Source control",description:"Git commit / pull / push outcomes."},"file-system":{label:"File system",description:"Save, copy, paste, image clipboard."},settings:{label:"Settings",description:"Preference saves, layout reset, import/export."},rss:{label:"RSS feeds",description:"Feed refresh, post counts."},plugins:{label:"Plugins",description:"Plugin install, activation, marketplace and sandbox events."},workspace:{label:"Workspace",description:"Workspace tabs, session restore and layout events."},dev:{label:"Developer",description:"Dev test surface and internal diagnostics."}},ve=ke.map(t=>({id:t,...Lt[t]})),He=new Map(ve.map(t=>[t.id,t]));function J(t){if(t){const r=He.get(t);if(r)return r}return He.get("general")??ve[0]}function zt(){return ve}function ot(t,r){const a=[];let u=0;for(;u<t.length;){const h=t[u];if(!h)break;if(h.pinned===!0){a.push({type:"entry",id:h.id,entry:h}),u+=1;continue}const C=r==="source"?h.source:`${h.source}|${h.tone}`;let T=u+1;for(;T<t.length;){const D=t[T];if(!D||D.pinned===!0||(r==="source"?D.source:`${D.source}|${D.tone}`)!==C)break;T+=1}const d=T-u;d===1?a.push({type:"entry",id:h.id,entry:h}):a.push({type:"group",id:`group:${C}:${h.id}`,groupKey:C,groupCount:d,groupSource:h.source,groupTone:h.tone,groupItems:t.slice(u,T)}),u=T}return a}function Vt(t,r){return(t+r).indexOf(r)<t.length}const Ut=/^[=+\-@\t\r]/,qt=/^[+-]?\d[\d.,' \u00A0\u202F]*(?:[eE][+-]?\d+)?$/,Ht=/^[ \t]|[ \t]$/;function it(t){return Ut.test(t)}function Gt(t,r){return it(t)?r==="quotePrefix"?`'${t}`:` ${t}`:t}function Wt(t,r,a={}){if(t==null)return"";const u=String(t),h=a.numeric===!0&&qt.test(u),C=h?u:Gt(u,r.policy),T=a.forceQuote===!0,d=r.quoteChar,D=r.escape==="backslash";return r.alwaysQuote||T||Ht.test(u)||!h&&r.policy==="tabPrefix"&&it(u)||Vt(C,r.delimiter)||C.includes(d)||C.includes(`
2
2
  `)||C.includes("\r")||D&&C.includes("\\")?Qt(C,d,r.escape):C}function Qt(t,r,a){const u=a==="backslash"?t.replace(/\\/g,"\\\\").split(r).join(`\\${r}`):t.split(r).join(r+r);return`${r}${u}${r}`}const jt=t=>t==="crlf"?`\r
3
3
  `:`
4
4
  `,Yt="\uFEFF",Jt=Object.freeze({cell:Object.freeze({delimiter:",",quoteChar:'"',escape:"double",alwaysQuote:!1,policy:"quotePrefix"}),lineEnd:"crlf",byteOrderMark:!0});function Kt(t,r){const a=t instanceof Date?t.toISOString():t;return Wt(a,r,{numeric:typeof t=="number"})}function Xt(t,r,a){const u=jt(a.lineEnd),h=C=>C.map(T=>Kt(T,a.cell)).join(a.cell.delimiter)+u;return h(r.map(C=>C.header))+t.map(C=>h(r.map(T=>T.value(C)))).join("")}function Zt(t,r,a){return(a.byteOrderMark?Yt:"")+Xt(t,r,a)}const en=[{header:"timestamp",value:t=>new Date(t.createdAt)},{header:"source",value:t=>t.source},{header:"tone",value:t=>t.tone},{header:"priority",value:t=>t.priority},{header:"pinned",value:t=>t.pinned===!0},{header:"message",value:t=>t.message}];function rt(t){return Zt(t,en,Jt)}function at(t){return JSON.stringify(t,null,2)}let Ge=!1;function tn(){Ge||typeof window>"u"||(Ge=!0,p.startDigestScheduler())}let ne=null;function nn(){if(ne)return ne;if(typeof window>"u")return()=>{};const t=()=>{p.clearCompiledRuleRegexCache(),p.invalidateCustomSoundCache(),p.refreshOsBadge()};return window.addEventListener(H.notificationSettings.changeEvent,t),ne=()=>{window.removeEventListener(H.notificationSettings.changeEvent,t),ne=null},ne}function on(t,r){return{update:(a,u)=>{t.update({title:a}),u!==void 0&&t.setProgress({value:Math.max(0,Math.min(1,u)),...r.onCancel?{onCancel:r.onCancel}:{}})},success:a=>t.update({title:a??r.message,severity:"success",sticky:!1,progress:{done:!0}}),fail:a=>t.update({title:a??r.message,severity:"error",sticky:!0,progress:{done:!0},durationMs:1/0}),dismiss:()=>t.close()}}function We(t){return{label:t.label,onClick:()=>{},...t.expireOnAction!==void 0?{expireOnAction:t.expireOnAction}:{}}}function Qe(t){const r=p.withErrorActionButtons(t);return{...r,...r.action?{action:We(r.action)}:{},...r.actions?{actions:r.actions.map(We)}:{},...r.onCancel?{onCancel:()=>{}}:{}}}function rn(t){return t.vendorError===void 0||!F.isVendorErrorSourceInstalled()?null:F.resolveVendorError(t.vendorError)}function an(){let t={...H.DEFAULT_NOTIFICATION_SETTINGS},r={dismissed:!1,remindSuppressed:!1,sourceMuted:!1,inQuietHours:!1};const a=[],u=F.createNativeNotificationEngine({getSettings:()=>t,recordAutoFade:()=>{},warn:()=>{}});let h=[];const C=u.subscribe(d=>{h=d});return{host:{notify(d,D){var B;const s=Qe(D),_=rn(s),O=d.severity==="error"?p.enrichErrorToast(s.message,{...s.title?{title:s.title}:{},...s.subtitle?{subtitle:s.subtitle}:{},...s.description?{description:s.description}:{},...s.action?{action:s.action}:{}},_,F.openExternal):null,q=d.severity==="error"&&d.source==="general"&&_!==null?"vendor-error":d.source,k=p.resolveCatalogPreviewPriority(d.severity,d.priority,_!==null,t.vendorCodesAreUrgent),g=p.applyNotificationRules({severity:d.severity,title:(O==null?void 0:O.displayText)??s.title??s.message,priority:k,source:q},t.notificationRules),y=g===null?{showToast:!1,recordTimeline:!1}:F.decideFilter({priority:g.priority,recordTimeline:s.recordTimeline},t,r),E=d.delivery==="os-only"?"mock-os":y.showToast?"shown":y.recordTimeline?"timeline-only":"suppressed",A={definition:d,payload:{...s,message:Y.scrubSecrets(s.message),...s.title?{title:Y.scrubSecrets(s.title)}:{},...s.description?{description:Y.scrubSecrets(s.description)}:{}},channel:d.delivery,decision:y,outcome:E};if(d.delivery==="os-only"||g===null||!y.showToast)return a.push(A),"";const S=(O==null?void 0:O.bodyText)??s.subtitle??s.description,M=(O==null?void 0:O.primaryAction)??s.action,$=u.notify({severity:g.severity,title:Y.scrubSecrets(g.title),...S?{body:Y.scrubSecrets(S)}:{},source:g.source,priority:g.priority,...s.duration!==void 0?{durationMs:s.duration}:{},...s.id!==void 0?{id:String(s.id)}:{},...s.icon?{icon:s.icon}:{},...s.markdown?{markdown:!0}:{},...M||(B=s.actions)!=null&&B.length?{actions:[M,...s.actions??[]].filter(L=>L!==void 0).map((L,Q)=>({label:L.label,primary:Q===0,onClick:()=>{L.onClick()}}))}:{}});return a.push($.id?A:{...A,outcome:"spam-dropped"}),$.id},progress(d,D){const s=Qe(D),_=F.decideFilter({priority:d.priority,recordTimeline:s.recordTimeline},t,r);if(a.push({definition:d,payload:s,channel:"in-app",decision:_,outcome:_.showToast?"shown":_.recordTimeline?"timeline-only":"suppressed"}),!_.showToast)return{update:()=>{},success:()=>{},fail:()=>{},dismiss:()=>{}};const O=u.notify({severity:d.severity,title:Y.scrubSecrets(s.message),source:d.source,priority:d.priority,sticky:!0,progress:s.onCancel?{onCancel:s.onCancel}:{},...s.id!==void 0?{id:String(s.id)}:{}});return on(O,s)}},controller:u,deliveries:a,setBehavior:d=>{t={...H.DEFAULT_NOTIFICATION_SETTINGS},r={dismissed:d==="dismissed",remindSuppressed:d==="reminder",sourceMuted:d==="source-muted",inQuietHours:d==="quiet-hours"},d==="dnd"?t={...t,doNotDisturb:!0}:d==="rule-transform"?t={...t,notificationRules:[{id:"preview-transform",name:"Preview transform",enabled:!0,conditions:{source:"dev"},actions:{setSeverity:"warning",setPriority:"urgent",addPrefix:"[RULE]"}}]}:d==="rule-suppress"&&(t={...t,notificationRules:[{id:"preview-suppress",name:"Preview suppress",enabled:!0,conditions:{source:"dev"},actions:{suppress:!0}}]})},subscribe:d=>u.subscribe(d),clear:()=>{for(const d of h)u.close(d.id);a.splice(0,a.length)},dispose:()=>{C(),u.dispose()}}}const cn=p.defineNotification({id:"onboarding.PageTourHost.info.1",source:"general",severity:"info",priority:"default",delivery:"in-app",kind:"message"},()=>({message:o.t("You can reopen this tour from Help → Page tours.")}));function he(t){return t.getClientRects().length>0&&t.getBoundingClientRect().width>0&&t.getBoundingClientRect().height>0}function me(t){return r=>r.matches(t)&&he(r)?r:Array.from(r.querySelectorAll(t)).find(he)??null}var sn=e.template("<span hidden>");function ln(t){const r=c.useContext(Te.ToolWindowContext);let a;const[u,h]=c.createSignal(!1),[C,T]=c.createSignal(0),[d,D]=c.createSignal([]);let s=!1,_=!1,O=!1;const q={},k=()=>a.parentElement,g=()=>he(k()),y=(S,M=!0)=>{var $;h(!1),U.releaseTour(q),U.setActiveTour(null),($=t.onTourActiveChange)==null||$.call(t,!1);try{U.writeTourStatus(t.definition.pageId,S?"completed":"skipped")}catch(B){Y.getLogger("PageTour").warn("Could not save tour progress",B)}s&&M&&p.notifyFromCatalog(cn,{}),s=!1},E=()=>{U.setNeverShowToursAgain(!0),y(!1,!1)},A=(S=!1)=>{var $;if(!g()||!U.claimTour(q))return;_=!1;const M=t.definition.steps.filter(B=>{var L;return((L=B.available)==null?void 0:L.call(B))!==!1});if(!M.length){U.releaseTour(q);return}D(M),T(0),s=S;try{U.writeTourStatus(t.definition.pageId,"shown")}catch(B){Y.getLogger("PageTour").warn("Could not save tour progress",B)}U.setActiveTour(t.definition.pageId),($=t.onTourActiveChange)==null||$.call(t,!0),h(!0)};return c.onMount(()=>{const S=k(),M=S.hasAttribute("tabindex");M||(S.tabIndex=-1),c.onCleanup(()=>{M||S.removeAttribute("tabindex")});const B=a.ownerDocument.defaultView;if(!B)return;const L=()=>Array.from(a.ownerDocument.querySelectorAll('[role="dialog"], [role="alertdialog"]')).some(G=>he(G)&&!G.contains(k()));let Q=0;const W=()=>{var G;if(!g()){Q=0,u()&&y(!1,!1);return}if(!(u()||L()||((G=r==null?void 0:r.isReady)==null?void 0:G.call(r))===!1)&&!(++Q<2)){if(U.consumeTourRequest(t.definition.pageId)&&(_=!0),_){A();return}if(!O&&!U.shouldSkipWelcome())try{U.readTourStatus(t.definition.pageId)||A(!0)}catch(z){O=!0,Y.getLogger("PageTour").warn("Could not read tour progress",z)}}},v=U.registerTourHost({page:t.definition.pageId,document:()=>a.ownerDocument,visible:g,start:()=>{_=!0,(u()||!L())&&A()},dismiss:()=>{u()&&y(!1,!1)}}),N=B.setInterval(W,250);c.onCleanup(()=>{var G;B.clearInterval(N),v(),U.releaseTour(q),U.getActiveTourPage()===t.definition.pageId&&(U.setActiveTour(null),(G=t.onTourActiveChange)==null||G.call(t,!1))})}),[(()=>{var S=sn(),M=a;return typeof M=="function"?e.use(M,S):a=S,e.effect(()=>e.setAttribute(S,"data-page-tour-host",t.definition.pageId)),S})(),e.createComponent(c.Show,{get when(){return u()},get children(){return e.createComponent(K.GuidedTour,{get document(){return a.ownerDocument},focusFallback:()=>g()?k():null,get steps(){return d()},get index(){return C()},target:()=>{var S;return((S=d()[C()])==null?void 0:S.target(k()))??null},onSelect:T,onClose:y,onNeverShowAgain:E})}})]}const un={id:"notifications",pageId:"notifications",version:1,steps:[{id:"panel",title:"Notification Center",description:"Stay informed on database events, completed exports, query execution errors, and background system alerts.",target:me('[data-tour-target="notifications-panel"]')},{id:"actions",title:"Timeline Actions & Filter Options",description:"Search notifications, filter by priority or notification source, pin important entries, and export history to CSV or JSON.",target:me('[data-tour-target="notifications-actions"]')},{id:"settings",title:"Notification Settings & DND",description:"Open the notification menu to configure do-not-disturb, quiet hours, and notification delivery preferences.",target:me('[data-tour-target="notifications-settings"]')},{id:"timeline",title:"Interactive Timeline Cards",description:"Click notification entries to expand stack traces, inspect vendor error codes, or navigate directly to affected queries.",target:me('[data-tour-target="notifications-timeline"]')}]};function dn(t,r,a,u,h=2){return t<=0||t>a?0:Math.min(r,h+Math.floor((a-t)/u))}function oe(t,r){t(a=>{const u=new Set(a);return u.has(r)?u.delete(r):u.add(r),u})}const gn="vk_rightRail_HtYMh",fn="vk_notificationPanel_nrSZl",mn="vk_filterBar_WTQg3",pn="vk_notificationPanelHeader_aHtxT vk_headerRail_CLLzD",hn="vk_notificationPanelTitleWrap_cOfAP vk_titleWrapRail_b0Czp",vn="vk_notificationPanelTitle_9iMrQ vk_titleSmMargin_PPvAx",Sn="vk_notificationPanelActions_7fRj6 vk_actionsRail_QqUv8",bn="vk_notificationActionIcon_d5EzT",Cn="vk_notificationTimeline_K-mMI",Tn="vk_notificationEmpty_IU6kY",yn="vk_notificationItem_tm8HP",kn="vk_notificationGroup_4hkdy",wn="vk_notificationGroupToggle_Opmmd",_n="vk_notificationGroupBody_nlrmq",In="vk_notificationItemSelected_DspyF",Nn="vk_notificationItemCheckbox_knWVX",An="vk_bulkActionBar_6MHEY",En="vk_bulkActionCount_Mb4tN",Mn="vk_notificationItemTop_Mt0D7",xn="vk_notificationToneDot_Z-LOj",Dn="vk_notificationToneInfo_rxKOj",On="vk_notificationToneSuccess_Bxc9E",Pn="vk_notificationToneWarning_uBK0T",Rn="vk_notificationToneError_p9EYY",Bn="vk_notificationItemTime_WT4cd",Fn="vk_notificationItemCopyDone_P39uT",$n="vk_notificationItemMessage_G2mnV",Ln="vk_notificationItemMeta_xdFUH",zn="vk_notificationSourceLabel_VvB0i",Vn="vk_priorityBadgeIcon_UaJX0",m={rightRail:gn,notificationPanel:fn,filterBar:mn,notificationPanelHeader:pn,notificationPanelTitleWrap:hn,notificationPanelTitle:vn,notificationPanelActions:Sn,notificationActionIcon:bn,notificationTimeline:Cn,notificationEmpty:Tn,notificationItem:yn,notificationGroup:kn,notificationGroupToggle:wn,notificationGroupBody:_n,notificationItemSelected:In,notificationItemCheckbox:Nn,bulkActionBar:An,bulkActionCount:En,notificationItemTop:Mn,notificationToneDot:xn,notificationToneInfo:Dn,notificationToneSuccess:On,notificationToneWarning:Pn,notificationToneError:Rn,notificationItemTime:Bn,notificationItemCopyDone:Fn,notificationItemMessage:$n,notificationItemMeta:Ln,notificationSourceLabel:zn,priorityBadgeIcon:Vn};var Un=e.template("<h3>"),qn=e.template("<div data-tour-target=notifications-actions>"),Hn=e.template("<div role=toolbar><span>"),Gn=e.template("<span>📌 "),Wn=e.template("<aside tabindex=-1><section data-tour-target=notifications-panel>"),Qn=e.template("<p>"),je=e.template("<span>"),jn=e.template("<article><div><span></span><time></time></div><p></p><div><span>");const Ye=Y.getLogger("NotificationPanel");function Yn(t){return new Intl.DateTimeFormat(re.systemFormatLocale(),{hour:"2-digit",minute:"2-digit"}).format(new Date(t))}function Jn(t){return new Intl.DateTimeFormat(re.systemFormatLocale(),{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(t))}function Je(t){switch(t){case"success":return m.notificationToneSuccess;case"error":return m.notificationToneError;case"warning":return m.notificationToneWarning;default:return m.notificationToneInfo}}const pe=["error","warning","info","success"],Kn=189,Xn=27;function Zn(t){const r=Mt.useHostDocument(),[a,u]=c.createSignal(null),[h,C]=c.createSignal(0),[T,d]=c.createSignal(""),[D,s]=c.createSignal(null),[_,O]=c.createSignal(new Set),[q,k]=c.createSignal(!1),[g,y]=c.createSignal(new Set),[E,A]=c.createSignal(new Set),[S,M]=c.createSignal(new Set),[$,B]=c.createSignal(!1),[L,Q]=c.createSignal(0);let W=null,v;const N=Ke.useDesktopContextMenu(),G=c.createMemo(()=>tt(T(),$())),z=c.createMemo(()=>nt(t.notificationTimeline(),{tones:_(),sources:E(),priorities:S(),dateBounds:D(),searchMatcher:G()})),ae=c.createMemo(()=>{const n=new Set;for(const l of t.notificationTimeline())n.add(l.source);return Array.from(n).sort()}),X=c.createMemo(()=>z().filter(n=>n.pinned===!0)),[ce,se]=c.createSignal(0);ye.useSettingsSubscription(H.notificationSettings,()=>{se(n=>n+1)});const[le,ue]=c.createSignal(new Set),de=c.createMemo(()=>{ce();const n=H.notificationSettings.get();return n.timelineGroupingEnabled?ot(z(),n.timelineGroupBy):z().map(l=>({type:"entry",id:l.id,entry:l}))}),ge=n=>{oe(ue,n)},Z=()=>T().trim()!==""||D()!==null||_().size>0||E().size>0||S().size>0,st=()=>{d(""),s(null),O(new Set),A(new Set),M(new Set)},lt=n=>{oe(A,n)},ut=n=>{oe(M,n)},dt=["urgent","acknowledgment-required","default","optional","silent"],gt=n=>{if(n.preventDefault(),n.stopPropagation(),N.state()!==null){N.close();return}const i=n.currentTarget.getBoundingClientRect(),f=ae(),b={urgent:o.t("Urgent"),"acknowledgment-required":o.t("Acknowledgment required"),default:o.t("Default"),optional:o.t("Optional"),silent:o.t("Silent")};N.open(i.left,i.bottom+4,[{label:o.t("Use regex in search"),checked:()=>$(),keepOpenOnSelect:!0,onSelect:()=>{B(x=>!x)}},{type:"separator"},{label:o.t("Filter by priority"),submenu:dt.map(x=>({label:b[x],checked:()=>S().has(x),keepOpenOnSelect:!0,onSelect:()=>ut(x)}))},...f.length>0?[{label:o.t("Filter by source"),submenu:f.map(x=>({label:J(x).label,checked:()=>E().has(x),keepOpenOnSelect:!0,onSelect:()=>lt(x)}))}]:[],{type:"separator"},{label:o.t("Clear advanced filters"),disabled:E().size===0&&S().size===0,onSelect:()=>{A(new Set),M(new Set)}}])},ft=n=>{oe(O,n)},mt=()=>{const n=_();return n.size===0||n.size===pe.length?o.t("All tones"):Array.from(n).join(", ")},pt=n=>{if(n.preventDefault(),n.stopPropagation(),N.state()!==null){N.close();return}const i=n.currentTarget.getBoundingClientRect();N.open(i.left,i.bottom+4,[...pe.map(f=>({label:o.t(K.NOTIFICATION_SEVERITY_LABELS[f]),checked:()=>_().has(f),keepOpenOnSelect:!0,onSelect:()=>ft(f)})),{type:"separator"},..._().size===pe.length?[{label:o.t("Select none"),onSelect:()=>{O(new Set)}}]:[{label:o.t("Select all"),onSelect:()=>{O(new Set(pe))}}]])};c.onMount(()=>{const n=p.subscribeUnreadCount(C);c.onCleanup(n)});const we=()=>{h()>0&&p.markTimelineSeen()},_e=n=>{const l=t.notificationTimeline().find(i=>i.id===n);l&&F.recordDismiss(l.source),p.dismissNotificationTimelineEntry(n)},ht=n=>{const l={source:et(n.source)?n.source:"general",priority:"urgent",recordTimeline:!1},i=n.tone;i==="error"?p.notifyFromCatalog(p.notificationReplayError,{timelineMessage:n.message,options:l}):i==="warning"?p.notifyFromCatalog(p.notificationReplayWarning,{timelineMessage:n.message,options:l}):i==="success"?p.notifyFromCatalog(p.notificationReplaySuccess,{timelineMessage:n.message,options:l}):p.notifyFromCatalog(p.notificationReplayInfo,{timelineMessage:n.message,options:l})},vt=n=>{const l=p.entryVendorMatch(n);l&&F.openExternal(l.helpers.docsUrl(l.code))},St=(n,l)=>{n.preventDefault(),n.stopPropagation();const i=p.entryVendorMatch(l),f=J(l.source),b=F.isSourceMuted(l.source);N.open(n.clientX,n.clientY,[{label:o.t("Search on Google"),onSelect:()=>{F.openExternal(F.getGoogleSearchUrl(l.message))}},...i?[{label:o.t("Open {vendor} ({code})",{vendor:i.helpers.docsLinkLabel,code:i.helpers.formatCode(i.code)}),onSelect:()=>{F.openExternal(i.helpers.docsUrl(i.code))}},{label:o.t("Copy error code"),onSelect:()=>{var x;(x=navigator.clipboard)==null||x.writeText(i.helpers.formatCode(i.code)).catch(V=>{Ye.warn("Clipboard write failed:",V)})}}]:[],{type:"separator"},{label:b?o.t('Unmute "{source}"',{source:f.label}):o.t('Mute "{source}"',{source:f.label}),onSelect:()=>{F.setSourceMuted(l.source,!b)}},{type:"separator"},{label:o.t("Copy log message"),onSelect:()=>{Ee(l)}},{label:l.pinned?o.t("Unpin notification"):o.t("Pin notification"),onSelect:()=>{p.toggleTimelineEntryPin(l.id)}},{label:o.t("Remove notification"),danger:!0,onSelect:()=>{_e(l.id)}},...f?[{label:o.t('Remove all from "{source}"',{source:f.label}),danger:!0,onSelect:()=>{p.dismissNotificationTimelineEntriesBySource(l.source)}}]:[]])},bt=()=>{p.clearNotificationTimeline()},Ct=n=>{oe(y,n)},Tt=()=>{k(!0),y(new Set)},Ie=()=>{k(!1),y(new Set)},yt=()=>{y(new Set(z().map(n=>n.id)))},ee=()=>g().size,kt=()=>{const n=g();return z().filter(l=>n.has(l.id)).map(l=>l.id)},wt=()=>{const n=kt();n.length!==0&&(p.dismissNotificationTimelineEntries(n),Ie())},Ne=n=>{const l=g(),i=t.notificationTimeline().filter(f=>l.has(f.id));for(const f of i)(f.pinned??!1)!==n&&p.toggleTimelineEntryPin(f.id)},Ae=async n=>{const l=z();if(l.length===0)return;const i=F.getFsService(),b=`notifications-${new Date().toISOString().replace(/[:T]/g,"-").slice(0,19)}.${n}`,x=n==="csv"?[{name:"CSV",extensions:["csv"]}]:[{name:"JSON",extensions:["json"]}];try{const V=await i.showSaveDialog({title:o.t("Export notifications"),defaultPath:b,filters:x});if(!(V!=null&&V.filePath))return;const j=n==="csv"?rt(l):at(l);await i.writeFile(V.filePath,j),p.notifyFromCatalog(p.notificationTimelineExported,{entryCount:l.length})}catch(V){p.notifyFromCatalog(p.notificationTimelineExportFailed,{cause:V})}},_t=()=>{Te.openSettingsModal("notification")},It=n=>{if(n.preventDefault(),n.stopPropagation(),N.state()!==null){N.close();return}const i=n.currentTarget.getBoundingClientRect(),f=z().length===0;N.open(i.left,i.bottom+4,[{label:o.t("Export"),disabled:f,submenu:[{label:o.t("Export as CSV"),onSelect:()=>{Ae("csv")}},{label:o.t("Export as JSON"),onSelect:()=>{Ae("json")}}]},{type:"separator"},{label:o.t("Notification settings…"),onSelect:_t}])},Ee=async n=>{var i;const l=n.message.trim();if(l)try{if((i=navigator.clipboard)!=null&&i.writeText)await navigator.clipboard.writeText(l);else{const f=r,b=te.createElement("textarea");b.value=l,b.setAttribute("readonly","true"),b.style.position="fixed",b.style.opacity="0",f.body.appendChild(b),b.select(),f.execCommand("copy"),f.body.removeChild(b)}u(n.id),W!==null&&window.clearTimeout(W),W=window.setTimeout(()=>{u(f=>f===n.id?null:f),W=null},1400)}catch(f){Ye.warn("Timeline entry could not be copied:",f)}};c.onCleanup(()=>{W!==null&&window.clearTimeout(W)}),c.onMount(()=>{if(!v)return;const n=new ResizeObserver(l=>{for(const i of l)Q(i.contentRect.width)});n.observe(v),c.onCleanup(()=>n.disconnect())});const Se=c.createMemo(()=>[{id:"select",icon:()=>e.createComponent(I.VpSquareCheck,{get class(){return m.notificationActionIcon}}),label:()=>o.t("Select multiple notifications"),disabled:()=>z().length===0,onSelect:Tt},{id:"mark-read",icon:()=>e.createComponent(I.VpMailOpened,{get class(){return m.notificationActionIcon}}),label:()=>o.t("Mark all as read"),disabled:()=>h()===0,onSelect:()=>p.markTimelineSeen()},{id:"clear",icon:()=>e.createComponent(I.VpTrash,{get class(){return m.notificationActionIcon}}),label:()=>o.t("Clear all notifications"),disabled:()=>t.notificationTimeline().length===0,onSelect:bt}]),Me=c.createMemo(()=>dn(L(),Se().length,Kn,Xn)),Nt=c.createMemo(()=>{const n=Se();return n.slice(0,n.length-Me())}),xe=c.createMemo(()=>{const n=Se();return n.slice(n.length-Me())}),At=n=>{if(n.preventDefault(),n.stopPropagation(),N.state()!==null){N.close();return}N.openWithPlacement(K.placeMenuAtTrigger(n.currentTarget,{horizontal:"right"}),xe().map(l=>({label:l.label(),icon:l.icon(),disabled:l.disabled(),onSelect:l.onSelect})))};return(()=>{var n=Wn(),l=n.firstChild;return n.$$keydown=we,n.$$click=we,e.insert(l,e.createComponent(K.Panel.Header,{get class(){return m.notificationPanelHeader},ref:i=>v=i,get children(){return[e.createComponent(Ce.PressableSurface,{type:"button",get class(){return m.notificationPanelTitleWrap},"data-tour-target":"notifications-settings",onClick:It,ref:i=>i.setAttribute("data-desktop-menu-depth","trigger"),get title(){return o.t("Notification menu")},"aria-haspopup":"menu",get children(){return[(()=>{var i=Un();return e.insert(i,()=>o.t("Notifications")),e.effect(()=>e.className(i,m.notificationPanelTitle)),i})(),e.createComponent(c.Show,{get when(){return h()>0},get children(){return e.createComponent(te.Badge,{tone:"danger",size:"sm",get tooltip(){return o.t("{count} unread",{count:h()})},get children(){return e.memo(()=>h()>99)()?"99+":h()}})}})]}}),(()=>{var i=qn();return e.insert(i,e.createComponent(c.Show,{get when(){return!q()},get fallback(){return e.createComponent(R.Button,{variant:"ghost",size:"sm",onClick:Ie,get title(){return o.t("Exit selection mode")},get children(){return o.t("Cancel")}})},get children(){return[e.createComponent(c.For,{get each(){return Nt()},children:f=>e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,get onClick(){return f.onSelect},get disabled(){return f.disabled()},get title(){return f.label()},get"aria-label"(){return f.label()},get children(){return f.icon()}})}),e.createComponent(c.Show,{get when(){return xe().length>0},get children(){return e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,onClick:At,ref:f=>f.setAttribute("data-desktop-menu-depth","trigger"),get title(){return o.t("More actions")},get"aria-label"(){return o.t("More actions")},get children(){return e.createComponent(I.VpDots,{get class(){return m.notificationActionIcon}})}})}})]}})),e.effect(()=>e.className(i,m.notificationPanelActions)),i})()]}}),null),e.insert(l,e.createComponent(c.Show,{get when(){return q()},get children(){var i=Hn(),f=i.firstChild;return e.insert(f,()=>o.t("{count} selected",{count:ee()})),e.insert(i,e.createComponent(R.Button,{variant:"ghost",size:"sm",onClick:yt,get disabled(){return z().length===0||ee()===z().length},get title(){return o.t("Select all visible")},get children(){return o.t("Select all")}}),null),e.insert(i,e.createComponent(R.Button,{variant:"ghost",size:"sm",onClick:()=>Ne(!0),get disabled(){return ee()===0},get title(){return o.t("Pin selected")},get children(){return o.t("Pin")}}),null),e.insert(i,e.createComponent(R.Button,{variant:"ghost",size:"sm",onClick:()=>Ne(!1),get disabled(){return ee()===0},get title(){return o.t("Unpin selected")},get children(){return o.t("Unpin")}}),null),e.insert(i,e.createComponent(R.Button,{variant:"ghost",size:"sm",onClick:wt,get disabled(){return ee()===0},get title(){return o.t("Delete selected")},get leadingIcon(){return e.createComponent(I.VpTrash,{get class(){return m.notificationActionIcon}})},get children(){return o.t("Delete")}}),null),e.effect(b=>{var x=m.bulkActionBar,V=o.t("Bulk actions"),j=m.bulkActionCount;return x!==b.e&&e.className(i,b.e=x),V!==b.t&&e.setAttribute(i,"aria-label",b.t=V),j!==b.a&&e.className(f,b.a=j),b},{e:void 0,t:void 0,a:void 0}),i}}),null),e.insert(l,e.createComponent(Ze,{get class(){return m.filterBar},get searchValue(){return T()},onSearchInput:d,get searchPlaceholder(){return o.t("Search notifications…")},get dateRange(){return D()},onDateRangeChange:s,dateRangeAlign:"end",get children(){return[e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,get active(){return _().size>0},onClick:pt,ref:i=>i.setAttribute("data-desktop-menu-depth","trigger"),get title(){return e.memo(()=>_().size===0)()?o.t("Filter by tone"):o.t("Tone filter: {tones}",{tones:mt()})},get children(){return e.createComponent(I.VpFilter,{get class(){return m.notificationActionIcon}})}}),e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,get active(){return E().size>0||S().size>0||$()},onClick:gt,ref:i=>i.setAttribute("data-desktop-menu-depth","trigger"),get title(){return o.t("Advanced filters (source, priority, regex)")},get children(){return e.createComponent(I.VpAdjustments,{get class(){return m.notificationActionIcon}})}}),e.createComponent(c.Show,{get when(){return Z()},get children(){return e.createComponent(R.Button,{variant:"ghost",size:"sm",onClick:st,get title(){return o.t("Clear filters")},get children(){return o.t("Clear")}})}})]}}),null),e.insert(l,e.createComponent(Xe.OverlayScrollArea,{get viewportClass(){return m.notificationTimeline},"data-tour-target":"notifications-timeline",get children(){return e.createComponent(c.Show,{get when(){return z().length>0},get fallback(){return(()=>{var i=Qn();return e.insert(i,(()=>{var f=e.memo(()=>!!Z());return()=>f()?o.t("No notifications match the current filter."):o.t("No notifications yet.")})()),e.effect(()=>e.className(i,m.notificationEmpty)),i})()},get children(){return[e.createComponent(c.Show,{get when(){return X().length>0},get children(){return e.createComponent(K.Panel.Header,{get class(){return m.notificationItemTop},get children(){var i=Gn();return i.firstChild,e.insert(i,()=>o.t("Pinned ({count})",{count:X().length}),null),e.effect(()=>e.className(i,m.notificationSourceLabel)),i}})}}),e.createComponent(c.For,{get each(){return de()},children:i=>{if(i.type==="group"&&i.groupItems){const f=()=>le().has(i.id);return e.createComponent(K.Disclosure,{get class(){return m.notificationGroup},get toggleClass(){return m.notificationGroupToggle},get open(){return f()},onToggle:()=>ge(i.id),get bodyClass(){return m.notificationGroupBody},get title(){return[(()=>{var b=je();return e.effect(()=>e.className(b,`${m.notificationToneDot} ${Je(i.groupTone??"info")}`)),b})(),(()=>{var b=je();return e.insert(b,()=>o.t('{count} from "{source}"',{count:i.groupCount??0,source:J(i.groupSource??"").label})),e.effect(()=>e.className(b,m.notificationItemMessage)),b})()]},get children(){return e.createComponent(c.For,{get each(){return i.groupItems},children:b=>De(b)})}})}return i.type==="entry"&&i.entry?De(i.entry):null}})]}})}}),null),e.insert(l,e.createComponent(ln,{definition:un}),null),e.effect(i=>{var f=m.rightRail,b=m.notificationPanel;return f!==i.e&&e.className(n,i.e=f),b!==i.t&&e.className(l,i.t=b),i},{e:void 0,t:void 0}),n})();function De(n){const l=()=>p.entryVendorMatch(n);return(()=>{var i=jn(),f=i.firstChild,b=f.firstChild,x=b.nextSibling,V=f.nextSibling,j=V.nextSibling,be=j.firstChild;return i.$$contextmenu=w=>{St(w,n)},e.insert(f,e.createComponent(c.Show,{get when(){return q()},get children(){return e.createComponent(re.Checkbox,{get class(){return m.notificationItemCheckbox},get checked(){return g().has(n.id)},onChange:()=>Ct(n.id),get ariaLabel(){return o.t("Select notification")}})}}),b),e.insert(x,()=>Yn(n.createdAt)),e.insert(f,e.createComponent(c.Show,{keyed:!0,get when(){return l()},children:w=>e.createComponent(R.Button,{variant:"ghost",size:"2xs",iconOnly:!0,onClick:()=>{vt(n)},get title(){return o.t("Open {vendor} ({code})",{vendor:w.helpers.docsLinkLabel,code:w.helpers.formatCode(w.code)})},get"aria-label"(){return o.t("Open {vendor} ({code})",{vendor:w.helpers.docsLinkLabel,code:w.helpers.formatCode(w.code)})},get leadingIcon(){return e.createComponent(I.VpBook,{get class(){return m.notificationActionIcon}})}})}),null),e.insert(f,e.createComponent(R.Button,{variant:"ghost",size:"2xs",iconOnly:!0,onClick:()=>ht(n),get title(){return o.t("Show as toast again")},get"aria-label"(){return o.t("Show as toast again")},get leadingIcon(){return e.createComponent(I.VpBellRinging,{get class(){return m.notificationActionIcon}})}}),null),e.insert(f,e.createComponent(R.Button,{variant:"ghost",size:"2xs",iconOnly:!0,get class(){return e.memo(()=>a()===n.id)()?m.notificationItemCopyDone:void 0},onClick:()=>{Ee(n)},get title(){return e.memo(()=>a()===n.id)()?o.t("Copied"):o.t("Copy log message")},get"aria-label"(){return e.memo(()=>a()===n.id)()?o.t("Copied"):o.t("Copy log message")},get children(){return e.createComponent(c.Show,{get when(){return a()===n.id},get fallback(){return e.createComponent(I.VpCopy,{get class(){return m.notificationActionIcon}})},get children(){return e.createComponent(I.VpCheck,{get class(){return m.notificationActionIcon}})}})}}),null),e.insert(f,e.createComponent(R.Button,{variant:"ghost",size:"2xs",iconOnly:!0,onClick:()=>{_e(n.id)},get title(){return o.t("Remove notification")},get"aria-label"(){return o.t("Remove notification")},get leadingIcon(){return e.createComponent(I.VpMinus,{get class(){return m.notificationActionIcon}})}}),null),e.insert(V,()=>n.message),e.insert(be,()=>J(n.source).label),e.insert(j,e.createComponent(c.Show,{get when(){return n.priority==="urgent"},get children(){return e.createComponent(te.Badge,{tone:"danger",size:"sm",children:"urgent"})}}),null),e.insert(j,e.createComponent(c.Show,{get when(){return n.priority==="silent"},get children(){return e.createComponent(te.Badge,{tone:"neutral",size:"sm",get icon(){return e.createComponent(I.VpBellOff,{get class(){return m.priorityBadgeIcon}})},get tooltip(){return o.t("Silent — timeline only")},children:"silent"})}}),null),e.insert(j,e.createComponent(c.Show,{get when(){return F.isSourceMuted(n.source)},get children(){return e.createComponent(te.Badge,{tone:"warning",size:"sm",get tooltip(){return o.t("Source muted")},children:"muted"})}}),null),e.effect(w=>{var Oe=`${m.notificationItem} ${q()&&g().has(n.id)?m.notificationItemSelected:""}`,Pe=m.notificationItemTop,Re=`${m.notificationToneDot} ${Je(n.tone)}`,Be=m.notificationItemTime,Fe=new Date(n.createdAt).toISOString(),$e=Jn(n.createdAt),Le=m.notificationItemMessage,ze=m.notificationItemMeta,Ve=m.notificationSourceLabel,Ue=J(n.source).description;return Oe!==w.e&&e.className(i,w.e=Oe),Pe!==w.t&&e.className(f,w.t=Pe),Re!==w.a&&e.className(b,w.a=Re),Be!==w.o&&e.className(x,w.o=Be),Fe!==w.i&&e.setAttribute(x,"datetime",w.i=Fe),$e!==w.n&&e.setAttribute(x,"title",w.n=$e),Le!==w.s&&e.className(V,w.s=Le),ze!==w.h&&e.className(j,w.h=ze),Ve!==w.r&&e.className(be,w.r=Ve),Ue!==w.d&&e.setAttribute(be,"title",w.d=Ue),w},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),i})()}}e.delegateEvents(["click","keydown","contextmenu"]);const eo="vk_center_5Vlx7",to="vk_header_vo883",no="vk_title_JpYEU",oo="vk_actions_ErJgC",io="vk_actionIcon_-JWZ1",ro="vk_list_YLy-l",ao="vk_card_-fwSa",co="vk_cardIcon_RBj-W",so="vk_cardBody_z8pxK",lo="vk_cardMessage_aN-yw",uo="vk_cardMeta_XQ3my",go="vk_cardButtons_1PXZE",fo="vk_cardSource_Z8c0M",mo="vk_cardTime_OXbCq",po="vk_cardActions_QOc1i",P={center:eo,header:to,title:no,actions:oo,actionIcon:io,list:ro,card:ao,cardIcon:co,cardBody:so,cardMessage:lo,cardMeta:uo,cardButtons:go,cardSource:fo,cardTime:mo,cardActions:po};var ho=e.template("<h3>"),vo=e.template("<div>"),So=e.template("<section data-notification-center>"),bo=e.template("<div data-notification-card-actions>"),Co=e.template("<article><span aria-hidden=true></span><div><p></p><div><span></span><time></time></div></div><div>");const To={info:I.VpInfo,warning:I.VpWarning,error:I.VpError,success:I.VpPass};function yo(t){return new Intl.DateTimeFormat(re.systemFormatLocale(),{hour:"2-digit",minute:"2-digit"}).format(new Date(t))}function ko(t){return new Intl.DateTimeFormat(re.systemFormatLocale(),{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(t))}function ct(t){const[r,a]=c.createSignal([]),[u,h]=c.createSignal(H.notificationSettings.get().doNotDisturb),C=Ke.useDesktopContextMenu();c.onMount(()=>{const k=p.subscribeNotificationTimeline(a);c.onCleanup(k)}),ye.useSettingsSubscription(H.notificationSettings,()=>{h(H.notificationSettings.get().doNotDisturb)});const T=c.createMemo(()=>[...r()].sort((k,g)=>g.createdAt-k.createdAt)),d=k=>To[k],D=()=>{const k=H.notificationSettings.get();H.notificationSettings.update({...k,doNotDisturb:!k.doNotDisturb}).catch(g=>{p.notifyFromCatalog(p.notificationSettingsUpdateFailed,{cause:g})})},s=()=>{Te.openSettingsModal("notification")},_=k=>{const g=[...k.actions??[]],y=p.entryVendorMatch(k);if(y){const E=y.helpers.docsUrl(y.code);if(E){const A=`${y.helpers.formatCode(y.code)} ${y.helpers.docsLinkLabel}`;g.some(S=>S.label===A)||g.push({label:A,onClick:()=>F.openExternal(E)})}}return g},O=k=>{var y;const g=k.message.trim();g&&((y=navigator.clipboard)==null||y.writeText(g).catch(()=>{}))},q=(k,g,y)=>{if(C.state()!==null){C.close();return}const E=J(y.source),A=F.isSourceMuted(E.id),S=p.entryVendorMatch(y);C.open(k,g,[{label:o.t("Copy log message"),onSelect:()=>O(y)},...S?[{label:o.t("Open {vendor} ({code})",{vendor:S.helpers.docsLinkLabel,code:S.helpers.formatCode(S.code)}),onSelect:()=>F.openExternal(S.helpers.docsUrl(S.code))}]:[],{type:"separator"},{label:A?o.t('Unmute "{source}"',{source:E.label}):o.t('Mute "{source}"',{source:E.label}),onSelect:()=>{F.setSourceMuted(E.id,!A)}},{type:"separator"},{label:o.t("Remove notification"),danger:!0,onSelect:()=>p.dismissNotificationTimelineEntry(y.id)},{label:o.t('Remove all from "{source}"',{source:E.label}),danger:!0,onSelect:()=>p.dismissNotificationTimelineEntriesBySource(E.id)}])};return(()=>{var k=So();return e.insert(k,e.createComponent(K.Panel.Header,{get class(){return P.header},get children(){return[(()=>{var g=ho();return e.insert(g,()=>o.t("Notifications"),null),e.insert(g,e.createComponent(c.Show,{get when(){return T().length>0},get children(){return` (${T().length})`}}),null),e.effect(()=>e.className(g,P.title)),g})(),(()=>{var g=vo();return e.insert(g,e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,onClick:()=>p.clearNotificationTimeline(),get disabled(){return T().length===0},get title(){return o.t("Clear all notifications")},get"aria-label"(){return o.t("Clear all notifications")},get children(){return e.createComponent(I.VpTrash,{get class(){return P.actionIcon}})}}),null),e.insert(g,e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,get active(){return u()},onClick:D,get title(){return e.memo(()=>!!u())()?o.t("Disable Do Not Disturb"):o.t("Enable Do Not Disturb")},get"aria-label"(){return e.memo(()=>!!u())()?o.t("Disable Do Not Disturb"):o.t("Enable Do Not Disturb")},get children(){return e.createComponent(c.Show,{get when(){return u()},get fallback(){return e.createComponent(I.VpBell,{get class(){return P.actionIcon}})},get children(){return e.createComponent(I.VpBellOff,{get class(){return P.actionIcon}})}})}}),null),e.insert(g,e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,onClick:s,get title(){return o.t("Notification settings")},get"aria-label"(){return o.t("Notification settings")},get children(){return e.createComponent(I.VpGear,{get class(){return P.actionIcon}})}}),null),e.insert(g,e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,get onClick(){return t.onHide},get title(){return o.t("Hide notifications")},get"aria-label"(){return o.t("Hide notifications")},get children(){return e.createComponent(I.VpChevronDown,{get class(){return P.actionIcon}})}}),null),e.effect(()=>e.className(g,P.actions)),g})()]}}),null),e.insert(k,e.createComponent(c.Show,{get when(){return T().length>0},get fallback(){return e.createComponent(Ot.EmptyState,{size:"sm",get title(){return o.t("No new notifications")}})},get children(){return e.createComponent(Xe.OverlayScrollArea,{get viewportClass(){return P.list},get children(){return e.createComponent(c.For,{get each(){return T()},children:g=>{const y=J(g.source),E=_(g);return(()=>{var A=Co(),S=A.firstChild,M=S.nextSibling,$=M.firstChild,B=$.nextSibling,L=B.firstChild,Q=L.nextSibling,W=M.nextSibling;return A.$$contextmenu=v=>{v.preventDefault(),q(v.clientX,v.clientY,g)},e.insert(S,e.createComponent(e.Dynamic,{get component(){return d(g.tone)}})),e.insert($,()=>g.message),e.insert(L,()=>o.t("Source: {source}",{source:y.label})),e.insert(Q,()=>yo(g.createdAt)),e.insert(M,e.createComponent(c.Show,{get when(){return E.length>0},get children(){var v=bo();return e.insert(v,e.createComponent(c.For,{each:E,children:N=>e.createComponent(R.Button,{get variant(){return N.primary?"primary":"secondary"},size:"sm",onClick:()=>N.onClick(),get children(){return N.label}})})),e.effect(()=>e.className(v,P.cardButtons)),v}}),null),e.insert(W,e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,onClick:v=>{const N=v.currentTarget.getBoundingClientRect();q(N.left,N.bottom+4,g)},get title(){return o.t("More actions")},get"aria-label"(){return o.t("More actions")},get children(){return e.createComponent(I.VpGear,{get class(){return P.actionIcon}})}}),null),e.insert(W,e.createComponent(R.Button,{variant:"ghost",size:"sm",iconOnly:!0,onClick:()=>p.dismissNotificationTimelineEntry(g.id),get title(){return o.t("Remove notification")},get"aria-label"(){return o.t("Remove notification")},get children(){return e.createComponent(I.VpTreeClose,{get class(){return P.actionIcon}})}}),null),e.effect(v=>{var N=P.card,G=P.cardIcon,z=g.tone,ae=P.cardBody,X=P.cardMessage,ce=P.cardMeta,se=P.cardSource,le=y.description,ue=P.cardTime,de=new Date(g.createdAt).toISOString(),ge=ko(g.createdAt),Z=P.cardActions;return N!==v.e&&e.className(A,v.e=N),G!==v.t&&e.className(S,v.t=G),z!==v.a&&e.setAttribute(S,"data-tone",v.a=z),ae!==v.o&&e.className(M,v.o=ae),X!==v.i&&e.className($,v.i=X),ce!==v.n&&e.className(B,v.n=ce),se!==v.s&&e.className(L,v.s=se),le!==v.h&&e.setAttribute(L,"title",v.h=le),ue!==v.r&&e.className(Q,v.r=ue),de!==v.d&&e.setAttribute(Q,"datetime",v.d=de),ge!==v.l&&e.setAttribute(Q,"title",v.l=ge),Z!==v.u&&e.className(W,v.u=Z),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),A})()}})}})}}),null),e.effect(()=>e.className(k,P.center)),k})()}e.delegateEvents(["contextmenu"]);const wo="vk_bell_tx9ag vk_buttonReset_3WpyU",_o="vk_bellIcon_w6Lmy",Io="vk_badge_2L8Eg",No="vk_centerPopover_48x5p",ie={bell:wo,bellIcon:_o,badge:Io,centerPopover:No};var Ao=e.template("<span>");function Eo(){const[t,r]=c.createSignal(!1),[a,u]=c.createSignal(0),[h,C]=c.createSignal(H.notificationSettings.get().doNotDisturb);let T;c.onMount(()=>{const s=p.subscribeUnreadCount(u);c.onCleanup(s)}),ye.useSettingsSubscription(H.notificationSettings,()=>{C(H.notificationSettings.get().doNotDisturb)});const d=()=>{r(s=>{const _=!s;return _&&p.markTimelineSeen(),_})},D=()=>a()>99?"99+":String(a());return[e.createComponent(Ce.PressableSurface,{ref(s){var _=T;typeof _=="function"?_(s):T=s},type:"button",get class(){return ie.bell},"data-status-bar-bell":!0,get"data-open"(){return t()?"true":"false"},onClick:d,get title(){return e.memo(()=>!!h())()?o.t("Notifications (Do Not Disturb on)"):o.t("Show notifications")},get"aria-label"(){return e.memo(()=>!!h())()?o.t("Notifications (Do Not Disturb on)"):o.t("Show notifications")},"aria-haspopup":"dialog",get"aria-expanded"(){return t()},get children(){return[e.createComponent(c.Show,{get when(){return h()},get fallback(){return e.createComponent(I.VpBell,{get class(){return ie.bellIcon}})},get children(){return e.createComponent(I.VpBellOff,{get class(){return ie.bellIcon}})}}),e.createComponent(c.Show,{get when(){return a()>0},get children(){var s=Ao();return e.insert(s,D),e.effect(()=>e.className(s,ie.badge)),s}})]}}),e.createComponent(xt.Popover,{get open(){return t()},onClose:()=>r(!1),anchor:()=>T,placement:"top-end",gap:6,role:"dialog",get ariaLabel(){return o.t("Notifications")},get class(){return ie.centerPopover},get children(){return e.createComponent(ct,{onHide:()=>r(!1)})}})]}exports.LogFilterBar=Ze;exports.NOTIFICATION_SOURCES=ve;exports.NOTIFICATION_SOURCE_IDS=ke;exports.NotificationPanel=Zn;exports.NotificationsCenter=ct;exports.StatusBarNotificationBell=Eo;exports.compileNotificationSearchMatcher=tt;exports.createNotificationPreviewRuntime=an;exports.exportTimelineAsCsv=rt;exports.exportTimelineAsJson=at;exports.filterNotificationTimeline=nt;exports.groupTimelineEntries=ot;exports.isNotificationSourceId=et;exports.listNotificationSources=zt;exports.resolveNotificationSource=J;exports.startNotificationSchedulers=tn;exports.startNotificationSettingsReactions=nn;
@@ -7,8 +7,8 @@ import { B as ke, c as _n } from "./mainRealmDom-COGBiX78.js";
7
7
  import { Show as R, useContext as In, createSignal as $, onMount as ge, onCleanup as te, createMemo as K, For as de } from "solid-js";
8
8
  import { I as wn, P as yt } from "./Input-BqiQPUxA.js";
9
9
  import { VpSquareCheck as An, VpMailOpened as xn, VpTrash as Ne, VpDots as En, VpFilter as Dn, VpAdjustments as Pn, VpBook as On, VpBellRinging as Mn, VpCheck as Nn, VpCopy as Rn, VpMinus as $n, VpBellOff as $e, VpBell as Ct, VpGear as st, VpChevronDown as Bn, VpTreeClose as zn, VpPass as Fn, VpError as Ln, VpWarning as Vn, VpInfo as Un } from "@vokril/icons";
10
- import { T as Hn, o as _t } from "./visibleBrowserRegistry-DOZlLrpo.js";
11
- import { G as Gn, P as Re, D as Wn, f as qn, g as Qn } from "./GuidedTour-YUs4zuez.js";
10
+ import { T as Hn, o as _t } from "./visibleBrowserRegistry-Dw2Y4y_I.js";
11
+ import { G as Gn, P as Re, D as Wn, f as qn, g as Qn } from "./GuidedTour-C6Na3wqL.js";
12
12
  import { t as n } from "./i18n-B_XRSWWN.js";
13
13
  import { e as jn, g as Yn, s as Ee, w as ct, a as Kn, b as Jn, l as Xn, r as Zn, j as ei, f as De } from "./pageTourState-CIr8ockR.js";
14
14
  import { u as Be } from "./useSettingsSubscription-cu943hND.js";
@@ -0,0 +1,27 @@
1
+ import { type Accessor } from 'solid-js';
2
+ import type { FocusContextKey } from '../contextKey/builtins.cjs';
3
+ import type { PanelCommandRegistry } from '../panelCommandsRegistry.cjs';
4
+ /**
5
+ * A focus-scoped keybinding surface that can be mounted more than once: publishes the surface's focus key over
6
+ * `container` and claims the surface's handler registry while the component lives. The active claim is the one focus
7
+ * last entered, so the surface's commands (`registry.find(isActive)`) reach the mount the user was in even when focus
8
+ * is elsewhere at run time — the command palette runs a command while its own input still has focus. A mount without
9
+ * a keybinding service (a standalone test mount) has nothing to wire.
10
+ *
11
+ * The handlers are claimed before the key is published: a key without handlers would let a binding match, swallow
12
+ * the key and do nothing. Returns the claim, so a surface can publish its own state keys only while it is the
13
+ * active one.
14
+ */
15
+ export declare function useFocusClaim<T extends {
16
+ isActive(): boolean;
17
+ }>(options: {
18
+ /** ui adapter: a host's own focus keys are accepted too, not only the kit's built-in ones. */
19
+ readonly key: FocusContextKey | (string & {});
20
+ readonly registry: PanelCommandRegistry<T>;
21
+ readonly container: Accessor<HTMLElement | undefined>;
22
+ readonly verbs: Omit<T, 'isActive'>;
23
+ /** Runs each time focus enters `container`, after the claim has become the active one. */
24
+ readonly onFocusIn?: () => void;
25
+ /** See `createFocusContextKey`: focus on a control inside `container` that owns its keys clears the key. */
26
+ readonly countsAsFocus?: (target: Element) => boolean;
27
+ }): T | undefined;
@@ -0,0 +1,27 @@
1
+ import { type Accessor } from 'solid-js';
2
+ import type { FocusContextKey } from '../contextKey/builtins.js';
3
+ import type { PanelCommandRegistry } from '../panelCommandsRegistry.js';
4
+ /**
5
+ * A focus-scoped keybinding surface that can be mounted more than once: publishes the surface's focus key over
6
+ * `container` and claims the surface's handler registry while the component lives. The active claim is the one focus
7
+ * last entered, so the surface's commands (`registry.find(isActive)`) reach the mount the user was in even when focus
8
+ * is elsewhere at run time — the command palette runs a command while its own input still has focus. A mount without
9
+ * a keybinding service (a standalone test mount) has nothing to wire.
10
+ *
11
+ * The handlers are claimed before the key is published: a key without handlers would let a binding match, swallow
12
+ * the key and do nothing. Returns the claim, so a surface can publish its own state keys only while it is the
13
+ * active one.
14
+ */
15
+ export declare function useFocusClaim<T extends {
16
+ isActive(): boolean;
17
+ }>(options: {
18
+ /** ui adapter: a host's own focus keys are accepted too, not only the kit's built-in ones. */
19
+ readonly key: FocusContextKey | (string & {});
20
+ readonly registry: PanelCommandRegistry<T>;
21
+ readonly container: Accessor<HTMLElement | undefined>;
22
+ readonly verbs: Omit<T, 'isActive'>;
23
+ /** Runs each time focus enters `container`, after the claim has become the active one. */
24
+ readonly onFocusIn?: () => void;
25
+ /** See `createFocusContextKey`: focus on a control inside `container` that owns its keys clears the key. */
26
+ readonly countsAsFocus?: (target: Element) => boolean;
27
+ }): T | undefined;
@@ -0,0 +1,15 @@
1
+ import type { Accessor } from 'solid-js';
2
+ import { type ListCommandHandlers } from '../panelCommandsRegistry.cjs';
3
+ /**
4
+ * Puts one list or tree on the shared list verbs (`surfaces/list.ts`) — the reference's list registration with
5
+ * `IListService`: publishes `listFocus` over `container`, claims the list's verbs (the claim focus last entered is the
6
+ * reference's `lastFocusedList`) and, while focus is in a list that takes more than one selection,
7
+ * `listSupportsMultiselect` — so `Ctrl/Cmd+A` falls through to the next binding on a single-selection list instead of
8
+ * being swallowed. A mount without a keybinding service has nothing to wire.
9
+ */
10
+ export declare function useListCommands(options: {
11
+ /** The list element — the one holding the rows' focus; not a pinned header outside it. */
12
+ readonly container: Accessor<HTMLElement | undefined>;
13
+ readonly supportsMultiselect: Accessor<boolean>;
14
+ readonly verbs: Omit<ListCommandHandlers, 'isActive'>;
15
+ }): void;
@@ -0,0 +1,15 @@
1
+ import type { Accessor } from 'solid-js';
2
+ import { type ListCommandHandlers } from '../panelCommandsRegistry.js';
3
+ /**
4
+ * Puts one list or tree on the shared list verbs (`surfaces/list.ts`) — the reference's list registration with
5
+ * `IListService`: publishes `listFocus` over `container`, claims the list's verbs (the claim focus last entered is the
6
+ * reference's `lastFocusedList`) and, while focus is in a list that takes more than one selection,
7
+ * `listSupportsMultiselect` — so `Ctrl/Cmd+A` falls through to the next binding on a single-selection list instead of
8
+ * being swallowed. A mount without a keybinding service has nothing to wire.
9
+ */
10
+ export declare function useListCommands(options: {
11
+ /** The list element — the one holding the rows' focus; not a pinned header outside it. */
12
+ readonly container: Accessor<HTMLElement | undefined>;
13
+ readonly supportsMultiselect: Accessor<boolean>;
14
+ readonly verbs: Omit<ListCommandHandlers, 'isActive'>;
15
+ }): void;
@@ -3,7 +3,9 @@ export declare const PLATFORM_KEY = "platform";
3
3
  export declare const IS_MAC_KEY = "isMac";
4
4
  export declare const IS_WINDOWS_KEY = "isWindows";
5
5
  export declare const IS_LINUX_KEY = "isLinux";
6
- export declare function platformContextValues(platform: NodeJS.Platform | string): Readonly<Record<string, ContextValue>>;
6
+ export declare function platformContextValues(
7
+ /** A `process.platform` value (`'darwin'`, `'win32'`, `'linux'` …); typed as a string so the kit's types need no Node typings. */
8
+ platform: string): Readonly<Record<string, ContextValue>>;
7
9
  /**
8
10
  * The reference editor's development context key: true in a development build (`app/env.ts:isDevBuild`, the
9
11
  * renderer's one build-mode home), published once at the root. Gates the chords the reference binds for
@@ -56,6 +58,11 @@ export declare const FOCUS_CONTEXT_KEYS: {
56
58
  readonly sqlEditorFocus: "sqlEditorFocus";
57
59
  readonly sqlBindPromptFocus: "sqlBindPromptFocus";
58
60
  readonly dashboardFocus: "dashboardFocus";
61
+ /**
62
+ * A category of the dashboard's Categories panel has keyboard focus — `Alt+↑/↓` moves it
63
+ * (`surfaces/dashboardCategories.ts`). Not the rename box or the actions button: they own their keys.
64
+ */
65
+ readonly dashboardCategoryFocus: "dashboardCategoryFocus";
59
66
  readonly rssFeederFocus: "rssFeederFocus";
60
67
  readonly rssItemSelected: "rssItemSelected";
61
68
  readonly explorerFocus: "explorerFocus";
@@ -81,12 +88,29 @@ export declare const FOCUS_CONTEXT_KEYS: {
81
88
  * surfaces this was measured once and every surface was given its own key; same rule.
82
89
  */
83
90
  readonly sshTerminalFocus: "sshTerminalFocus";
91
+ /**
92
+ * Focus is in an SSH terminal WORKSPACE — the SSH page's multi-tab terminal, not a detached SSH terminal: its tab
93
+ * and find verbs (`SshTerminalWorkspaceHandlers`) are scoped by it. Text fields do not count, as for `sshTerminalFocus`.
94
+ */
95
+ readonly sshTerminalWorkspaceFocus: "sshTerminalWorkspaceFocus";
96
+ /**
97
+ * The reference's key: keyboard focus is in the terminal's find box — `Ctrl/Cmd+F` selects its text there. The
98
+ * terminal's own focus key is false in the box (`terminal/ui/terminalOwnFocus.ts`): the box owns its keys.
99
+ */
100
+ readonly terminalFindFocused: "terminalFindFocused";
101
+ /** The SSH terminal's find box, its own key for the same reason `sshTerminalFocus` is. */
102
+ readonly sshTerminalFindFocused: "sshTerminalFindFocused";
84
103
  /**
85
104
  * The active terminal's xterm is in the alternate buffer (vim/less/htop) — the command-mark
86
105
  * navigation bindings are guarded by `!terminalAltBufferActive` (reference
87
106
  * `altBufferActive.negate()`): the arrow key goes to the full-screen app.
88
107
  */
89
108
  readonly terminalAltBufferActive: "terminalAltBufferActive";
109
+ /**
110
+ * The reference's key: keyboard focus is in the terminal's accessible buffer view (`Alt+F2`) — `Alt+↓/↑` go to the
111
+ * next / previous command there (`surfaces/terminal.ts` `TERMINAL_ACCESSIBLE_BUFFER_BINDINGS`).
112
+ */
113
+ readonly terminalAccessibleBufferFocus: "terminalAccessibleBufferFocus";
90
114
  /** The active terminal tab is in a multi-pane group — the gate of the pane focus/size bindings. */
91
115
  readonly terminalMultiPane: "terminalMultiPane";
92
116
  /**
@@ -141,8 +165,30 @@ export declare const FOCUS_CONTEXT_KEYS: {
141
165
  readonly sqlSnippetsFocus: "sqlSnippetsFocus";
142
166
  /** Focus is in the Set Comment dialog's comment field — `Ctrl/Cmd+Enter` sets the comment. */
143
167
  readonly objectCommentFocus: "objectCommentFocus";
144
- /** Focus is in the maximized cell editor — `Ctrl/Cmd+Enter` saves the value. */
168
+ /**
169
+ * Focus is in a cell value editor — the maximized editor, the grid's inline editor or a record view field —
170
+ * `Ctrl/Cmd+Enter` saves the value.
171
+ */
145
172
  readonly cellEditorFocus: "cellEditorFocus";
173
+ /**
174
+ * Focus is in a cell value text field — the grid's inline cell editor or a record view field — `Ctrl/Cmd+Backspace`
175
+ * sets the value to NULL (`surfaces/cellValueField.ts`). Not the maximized editor: its code editor keeps the chord.
176
+ */
177
+ readonly cellValueFieldFocus: "cellValueFieldFocus";
178
+ /**
179
+ * Focus is in a JSON tree view — the cell detail, the inspector's Value tab or the result's JSON view —
180
+ * `Ctrl/Cmd+F` focuses its filter (`surfaces/jsonTree.ts`).
181
+ */
182
+ readonly jsonTreeFocus: "jsonTreeFocus";
183
+ /** Focus is in a JSON tree view's filter — `Shift+Enter` goes to the previous match (plain `Enter` is the filter's own). */
184
+ readonly jsonTreeFilterFocus: "jsonTreeFilterFocus";
185
+ /**
186
+ * The reference's list keys: focus is in a list or a tree — every tree surface, the search results, the terminal
187
+ * tab list — and that list takes more than one selection. `list.*` verbs (`surfaces/list.ts`) act on the list focus
188
+ * last entered (`context/useListCommands.ts`).
189
+ */
190
+ readonly listFocus: "listFocus";
191
+ readonly listSupportsMultiselect: "listSupportsMultiselect";
146
192
  /** Focus is in the Source Control commit message box — `Ctrl/Cmd+Enter` commits (the reference's `scm.acceptInput`). */
147
193
  readonly scmCommitInputFocus: "scmCommitInputFocus";
148
194
  /** Focus is in the terminal command history palette — its row verbs (`Ctrl+Enter`, `Shift+Enter`, `Delete`). */
@@ -3,7 +3,9 @@ export declare const PLATFORM_KEY = "platform";
3
3
  export declare const IS_MAC_KEY = "isMac";
4
4
  export declare const IS_WINDOWS_KEY = "isWindows";
5
5
  export declare const IS_LINUX_KEY = "isLinux";
6
- export declare function platformContextValues(platform: NodeJS.Platform | string): Readonly<Record<string, ContextValue>>;
6
+ export declare function platformContextValues(
7
+ /** A `process.platform` value (`'darwin'`, `'win32'`, `'linux'` …); typed as a string so the kit's types need no Node typings. */
8
+ platform: string): Readonly<Record<string, ContextValue>>;
7
9
  /**
8
10
  * The reference editor's development context key: true in a development build (`app/env.ts:isDevBuild`, the
9
11
  * renderer's one build-mode home), published once at the root. Gates the chords the reference binds for
@@ -56,6 +58,11 @@ export declare const FOCUS_CONTEXT_KEYS: {
56
58
  readonly sqlEditorFocus: "sqlEditorFocus";
57
59
  readonly sqlBindPromptFocus: "sqlBindPromptFocus";
58
60
  readonly dashboardFocus: "dashboardFocus";
61
+ /**
62
+ * A category of the dashboard's Categories panel has keyboard focus — `Alt+↑/↓` moves it
63
+ * (`surfaces/dashboardCategories.ts`). Not the rename box or the actions button: they own their keys.
64
+ */
65
+ readonly dashboardCategoryFocus: "dashboardCategoryFocus";
59
66
  readonly rssFeederFocus: "rssFeederFocus";
60
67
  readonly rssItemSelected: "rssItemSelected";
61
68
  readonly explorerFocus: "explorerFocus";
@@ -81,12 +88,29 @@ export declare const FOCUS_CONTEXT_KEYS: {
81
88
  * surfaces this was measured once and every surface was given its own key; same rule.
82
89
  */
83
90
  readonly sshTerminalFocus: "sshTerminalFocus";
91
+ /**
92
+ * Focus is in an SSH terminal WORKSPACE — the SSH page's multi-tab terminal, not a detached SSH terminal: its tab
93
+ * and find verbs (`SshTerminalWorkspaceHandlers`) are scoped by it. Text fields do not count, as for `sshTerminalFocus`.
94
+ */
95
+ readonly sshTerminalWorkspaceFocus: "sshTerminalWorkspaceFocus";
96
+ /**
97
+ * The reference's key: keyboard focus is in the terminal's find box — `Ctrl/Cmd+F` selects its text there. The
98
+ * terminal's own focus key is false in the box (`terminal/ui/terminalOwnFocus.ts`): the box owns its keys.
99
+ */
100
+ readonly terminalFindFocused: "terminalFindFocused";
101
+ /** The SSH terminal's find box, its own key for the same reason `sshTerminalFocus` is. */
102
+ readonly sshTerminalFindFocused: "sshTerminalFindFocused";
84
103
  /**
85
104
  * The active terminal's xterm is in the alternate buffer (vim/less/htop) — the command-mark
86
105
  * navigation bindings are guarded by `!terminalAltBufferActive` (reference
87
106
  * `altBufferActive.negate()`): the arrow key goes to the full-screen app.
88
107
  */
89
108
  readonly terminalAltBufferActive: "terminalAltBufferActive";
109
+ /**
110
+ * The reference's key: keyboard focus is in the terminal's accessible buffer view (`Alt+F2`) — `Alt+↓/↑` go to the
111
+ * next / previous command there (`surfaces/terminal.ts` `TERMINAL_ACCESSIBLE_BUFFER_BINDINGS`).
112
+ */
113
+ readonly terminalAccessibleBufferFocus: "terminalAccessibleBufferFocus";
90
114
  /** The active terminal tab is in a multi-pane group — the gate of the pane focus/size bindings. */
91
115
  readonly terminalMultiPane: "terminalMultiPane";
92
116
  /**
@@ -141,8 +165,30 @@ export declare const FOCUS_CONTEXT_KEYS: {
141
165
  readonly sqlSnippetsFocus: "sqlSnippetsFocus";
142
166
  /** Focus is in the Set Comment dialog's comment field — `Ctrl/Cmd+Enter` sets the comment. */
143
167
  readonly objectCommentFocus: "objectCommentFocus";
144
- /** Focus is in the maximized cell editor — `Ctrl/Cmd+Enter` saves the value. */
168
+ /**
169
+ * Focus is in a cell value editor — the maximized editor, the grid's inline editor or a record view field —
170
+ * `Ctrl/Cmd+Enter` saves the value.
171
+ */
145
172
  readonly cellEditorFocus: "cellEditorFocus";
173
+ /**
174
+ * Focus is in a cell value text field — the grid's inline cell editor or a record view field — `Ctrl/Cmd+Backspace`
175
+ * sets the value to NULL (`surfaces/cellValueField.ts`). Not the maximized editor: its code editor keeps the chord.
176
+ */
177
+ readonly cellValueFieldFocus: "cellValueFieldFocus";
178
+ /**
179
+ * Focus is in a JSON tree view — the cell detail, the inspector's Value tab or the result's JSON view —
180
+ * `Ctrl/Cmd+F` focuses its filter (`surfaces/jsonTree.ts`).
181
+ */
182
+ readonly jsonTreeFocus: "jsonTreeFocus";
183
+ /** Focus is in a JSON tree view's filter — `Shift+Enter` goes to the previous match (plain `Enter` is the filter's own). */
184
+ readonly jsonTreeFilterFocus: "jsonTreeFilterFocus";
185
+ /**
186
+ * The reference's list keys: focus is in a list or a tree — every tree surface, the search results, the terminal
187
+ * tab list — and that list takes more than one selection. `list.*` verbs (`surfaces/list.ts`) act on the list focus
188
+ * last entered (`context/useListCommands.ts`).
189
+ */
190
+ readonly listFocus: "listFocus";
191
+ readonly listSupportsMultiselect: "listSupportsMultiselect";
146
192
  /** Focus is in the Source Control commit message box — `Ctrl/Cmd+Enter` commits (the reference's `scm.acceptInput`). */
147
193
  readonly scmCommitInputFocus: "scmCommitInputFocus";
148
194
  /** Focus is in the terminal command history palette — its row verbs (`Ctrl+Enter`, `Shift+Enter`, `Delete`). */
@@ -0,0 +1,30 @@
1
+ /**
2
+ * ui adapter: the panel command registries the kit itself claims.
3
+ *
4
+ * The host app keeps one module of registries, one per keybinding surface (explorer, SQL editor,
5
+ * terminal, list …): a surface claims its verbs while mounted and a command acts on the claim the
6
+ * user is in. ui ships the registry factory and the one registry its own components claim — the
7
+ * shared list verbs (`listHandlers`, `Ctrl/Cmd+A` on a tree). The other surfaces are the host's.
8
+ *
9
+ * `listHandlers` is a single instance: a host that registers the `list.*` commands reads THIS
10
+ * registry (`@vokril/ui-solid/host`), so its own lists and the kit's trees share one claim stack and
11
+ * one "last focused list".
12
+ */
13
+ export interface PanelCommandRegistry<T extends object> {
14
+ set(handlers: T): () => void;
15
+ current(): T | null;
16
+ /**
17
+ * Top-down search over the stack (last-mounted first). Lets a surface that can be
18
+ * mounted more than once route a verb to the mount that is actually FOCUSED instead
19
+ * of the one that mounted last.
20
+ */
21
+ find(predicate: (handlers: T) => boolean): T | null;
22
+ }
23
+ export declare function createPanelCommandRegistry<T extends object>(): PanelCommandRegistry<T>;
24
+ /** The verbs every list and tree shares (the host's `list.*` commands act on the last focused list). */
25
+ export interface ListCommandHandlers {
26
+ isActive(): boolean;
27
+ /** `Ctrl/Cmd+A` — select every row the list's rule takes (a tree widens one level per press). */
28
+ selectAll(): void;
29
+ }
30
+ export declare const listHandlers: PanelCommandRegistry<ListCommandHandlers>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * ui adapter: the panel command registries the kit itself claims.
3
+ *
4
+ * The host app keeps one module of registries, one per keybinding surface (explorer, SQL editor,
5
+ * terminal, list …): a surface claims its verbs while mounted and a command acts on the claim the
6
+ * user is in. ui ships the registry factory and the one registry its own components claim — the
7
+ * shared list verbs (`listHandlers`, `Ctrl/Cmd+A` on a tree). The other surfaces are the host's.
8
+ *
9
+ * `listHandlers` is a single instance: a host that registers the `list.*` commands reads THIS
10
+ * registry (`@vokril/ui-solid/host`), so its own lists and the kit's trees share one claim stack and
11
+ * one "last focused list".
12
+ */
13
+ export interface PanelCommandRegistry<T extends object> {
14
+ set(handlers: T): () => void;
15
+ current(): T | null;
16
+ /**
17
+ * Top-down search over the stack (last-mounted first). Lets a surface that can be
18
+ * mounted more than once route a verb to the mount that is actually FOCUSED instead
19
+ * of the one that mounted last.
20
+ */
21
+ find(predicate: (handlers: T) => boolean): T | null;
22
+ }
23
+ export declare function createPanelCommandRegistry<T extends object>(): PanelCommandRegistry<T>;
24
+ /** The verbs every list and tree shares (the host's `list.*` commands act on the last focused list). */
25
+ export interface ListCommandHandlers {
26
+ isActive(): boolean;
27
+ /** `Ctrl/Cmd+A` — select every row the list's rule takes (a tree widens one level per press). */
28
+ selectAll(): void;
29
+ }
30
+ export declare const listHandlers: PanelCommandRegistry<ListCommandHandlers>;
@@ -0,0 +1 @@
1
+ "use strict";const K=require("solid-js/web"),n=require("solid-js"),y=require("./bugIndicatingError-D2X5Hfgg.cjs"),u=n.createContext(null);function x(t){return K.createComponent(u.Provider,{get value(){return t.value},get children(){return t.children}})}function F(){const t=n.useContext(u);if(!t)throw new y.BugIndicatingError("useKeybindings must be used inside <KeybindingsProvider>");return t}function S(){return n.useContext(u)}function _(t){const{contextKeys:s,key:c,containerRef:a,onFocusIn:r,countsAsFocus:d}=t;let o;const g=e=>d===void 0||e instanceof Element&&d(e),f=e=>{o=e;const l=i=>{s.setContext(c,g(i)),r==null||r()},E=i=>l(i.target),C=i=>{const b=i.relatedTarget;b&&e.contains(b)||s.setContext(c,!1)};e.addEventListener("focusin",E),e.addEventListener("focusout",C);const v=e.ownerDocument.activeElement;e.contains(v)&&l(v),n.onCleanup(()=>{e.removeEventListener("focusin",E),e.removeEventListener("focusout",C),s.setContext(c,!1),o===e&&(o=void 0)})};n.createRenderEffect(()=>{const e=a();e&&f(e)}),n.onMount(()=>{if(o)return;const e=a();e&&f(e)})}const O="accessibilityModeEnabled",T={notificationFocus:"notificationFocus",notificationToastsVisible:"notificationToastsVisible",listFocus:"listFocus",listSupportsMultiselect:"listSupportsMultiselect"};exports.ACCESSIBILITY_MODE_ENABLED_KEY=O;exports.FOCUS_CONTEXT_KEYS=T;exports.KeybindingsProvider=x;exports.createFocusContextKey=_;exports.useKeybindings=F;exports.useKeybindingsOptional=S;
@@ -0,0 +1,74 @@
1
+ import { createComponent as g } from "solid-js/web";
2
+ import { useContext as C, createContext as K, createRenderEffect as x, onMount as y, onCleanup as F } from "solid-js";
3
+ import { B as p } from "./bugIndicatingError-h3J5qkL6.js";
4
+ const r = K(null);
5
+ function T(e) {
6
+ return g(r.Provider, {
7
+ get value() {
8
+ return e.value;
9
+ },
10
+ get children() {
11
+ return e.children;
12
+ }
13
+ });
14
+ }
15
+ function M() {
16
+ const e = C(r);
17
+ if (!e)
18
+ throw new p("useKeybindings must be used inside <KeybindingsProvider>");
19
+ return e;
20
+ }
21
+ function O() {
22
+ return C(r);
23
+ }
24
+ function _(e) {
25
+ const { contextKeys: s, key: i, containerRef: u, onFocusIn: c, countsAsFocus: a } = e;
26
+ let o;
27
+ const b = (t) => a === void 0 || t instanceof Element && a(t), f = (t) => {
28
+ o = t;
29
+ const d = (n) => {
30
+ s.setContext(i, b(n)), c == null || c();
31
+ }, l = (n) => d(n.target), E = (n) => {
32
+ const m = n.relatedTarget;
33
+ m && t.contains(m) || s.setContext(i, !1);
34
+ };
35
+ t.addEventListener("focusin", l), t.addEventListener("focusout", E);
36
+ const v = t.ownerDocument.activeElement;
37
+ t.contains(v) && d(v), F(() => {
38
+ t.removeEventListener("focusin", l), t.removeEventListener("focusout", E), s.setContext(i, !1), o === t && (o = void 0);
39
+ });
40
+ };
41
+ x(() => {
42
+ const t = u();
43
+ t && f(t);
44
+ }), y(() => {
45
+ if (o) return;
46
+ const t = u();
47
+ t && f(t);
48
+ });
49
+ }
50
+ const w = "accessibilityModeEnabled", A = {
51
+ /**
52
+ * Notification toast stack (the reference's `notificationFocus` / `notificationToastsVisible`
53
+ * keys): keyboard focus is inside the stack · the painted stack is not empty (while the
54
+ * notification centre is visible the stack is hidden and the key is false). The gate of the
55
+ * `Ctrl+Shift+A` primary-action binding — together with accessibility mode.
56
+ */
57
+ notificationFocus: "notificationFocus",
58
+ notificationToastsVisible: "notificationToastsVisible",
59
+ /**
60
+ * The reference's list keys: focus is in a list or a tree — every tree surface, the search results, the terminal
61
+ * tab list — and that list takes more than one selection. `list.*` verbs (`surfaces/list.ts`) act on the list focus
62
+ * last entered (`context/useListCommands.ts`).
63
+ */
64
+ listFocus: "listFocus",
65
+ listSupportsMultiselect: "listSupportsMultiselect"
66
+ };
67
+ export {
68
+ w as A,
69
+ A as F,
70
+ T as K,
71
+ O as a,
72
+ _ as c,
73
+ M as u
74
+ };
@@ -0,0 +1 @@
1
+ "use strict";const a=require("solid-js/web"),S=require("solid-js"),V=require("@vokril/icons"),se=require("./OverlayScrollArea-BSlaXG1h.cjs"),de=require("./i18n-DZZyw7Iu.cjs"),he=require("./rendererLogging-B4XML4_G.cjs"),W=require("./keys-BeeC5_RZ.cjs"),fe=require("./useListCommands-ucngC3t4.cjs"),ge=require("./builtins-DM7FDxEt.cjs"),we=require("./createVirtualScroller-LN-7QFiv.cjs"),me=require("./DesktopContextMenuContext-DMGNVjaR.cjs"),ye=require("./bugIndicatingError-D2X5Hfgg.cjs"),Y={canExpand:!0,canMultiSelect:!0,canTypeAhead:!0,canRename:!1,canDestroy:!1,expandAll:!1};function z(e,c){return`${e}-row-${c}`}function oe(e){const{treeId:c,label:n,multiSelectable:t,focusMode:o,cursorKey:l}=e;return{role:e.flat===!0?"listbox":"tree",tabIndex:o==="active-descendant"||l===null?0:-1,"aria-label":n,"aria-multiselectable":t?!0:void 0,"aria-activedescendant":o==="active-descendant"&&l!==null?z(c,l):void 0}}function ce(e){const{treeId:c,rows:n,index:t,focusMode:o,isCursor:l,isSelected:r}=e,u=n[t],s=e.flat===!0;let h=t;for(let C=t-1;C>=0;C--){const D=n[C].depth;if(D<u.depth)break;D===u.depth&&(h=C)}let f=t;for(let C=t+1;C<n.length;C++){const D=n[C].depth;if(D<u.depth)break;D===u.depth&&(f=C)}let k=0,_=0;for(let C=h;C<=f;C++)n[C].depth===u.depth&&(k++,C<=t&&_++);return{role:s?"option":"treeitem",id:z(c,u.key),tabIndex:o==="roving-tabindex"&&l?0:-1,"aria-level":s?void 0:u.depth+1,"aria-setsize":k,"aria-posinset":_,"aria-selected":r,"aria-expanded":!s&&u.expandable?u.expanded:void 0,"aria-busy":u.busy===!0?!0:void 0}}const ve=/[\^$.*+?(){}|[\]\\]/;function Se(e){const c=e.trim();if(c.length===0)return null;if(ve.test(c))try{const t=new RegExp(c,"gi");return o=>Ce(o,t)}catch(t){he.bestEffortFailed("fall through to substring",t)}const n=c.toLowerCase();return t=>ke(t,n,c.length)}function Ce(e,c){c.lastIndex=0;const n=[];let t=0,o;for(;(o=c.exec(e))!==null;)o.index>t&&n.push({text:e.slice(t,o.index),match:!1}),n.push({text:o[0],match:!0}),t=o.index+o[0].length,o[0].length===0&&(c.lastIndex+=1);return t<e.length&&n.push({text:e.slice(t),match:!1}),n.length>0?n:[{text:e,match:!1}]}function ke(e,c,n){if(n===0)return[{text:e,match:!1}];const t=e.toLowerCase(),o=[];let l=0;for(;l<=e.length;){const r=t.indexOf(c,l);if(r===-1){l<e.length&&o.push({text:e.slice(l),match:!1});break}r>l&&o.push({text:e.slice(l,r),match:!1}),o.push({text:e.slice(r,r+n),match:!0}),l=r+n}return o.length>0?o:[{text:e,match:!1}]}const xe="vk_treeStickyHost_6aT7a",be="vk_treeViewport_Ku3yB",Te="vk_treeContainer_iMrOQ",Re="vk_treeSlice_homAf",Ie="vk_treeRow_Hh9r0",Ae="vk_treeRowCursor_QlUrp",_e="vk_treeRowSelected_UdZj-",Me="vk_treeIndentGuides_W4J04",Ee="vk_treeIndentGuideActive_9m4l3",De="vk_treeRowChevron_6WMjE",$e="vk_treeRowChevronSpacer_Jbp-q",Ke="vk_treeRowChevronIcon_KP24Y",Ge="vk_treeRowChevronIconOpen_fRKNn",He="vk_treeRowContent_RR7pP",Ne="vk_treeRowActions_LYQUv",Oe="vk_treeEmpty_s8RQ-",Pe="vk_treeRowChevronBusy_lZT8a",Le="vk_treeSpeedSearchBadge_9GHNi",Fe="vk_treeSpeedSearchIcon_48Ae2",qe="vk_treeSpeedSearchText_F4SZ8",Be="vk_treeMatchHighlight_NY75y",T={treeStickyHost:xe,treeViewport:be,treeContainer:Te,treeSlice:Re,treeRow:Ie,treeRowCursor:Ae,treeRowSelected:_e,treeIndentGuides:Me,treeIndentGuideActive:Ee,treeRowChevron:De,treeRowChevronSpacer:$e,treeRowChevronIcon:Ke,treeRowChevronIconOpen:Ge,treeRowContent:He,treeRowActions:Ne,treeEmpty:Oe,treeRowChevronBusy:Pe,treeSpeedSearchBadge:Le,treeSpeedSearchIcon:Fe,treeSpeedSearchText:qe,treeMatchHighlight:Be};var Ue=a.template("<span aria-hidden=true tabindex=-1>"),Q=a.template("<span aria-hidden=true>"),Qe=a.template("<span tabindex=-1>"),Ve=a.template("<div><span>"),We=a.template("<mark>");function Ye(e){return e.ctrlKey||e.metaKey?"toggle":e.shiftKey?"range":"replace"}function X(e){let c;S.createEffect(()=>{if(e.sticky===!0||!e.isCursor||!e.treeHasFocus())return;const t=c;!t||t.contains(t.ownerDocument.activeElement)||queueMicrotask(()=>t.focus({preventScroll:!0}))});const n=()=>a.createComponent(S.Show,{get when(){return e.row.expandable},get fallback(){return(()=>{var t=Q();return a.effect(()=>a.className(t,T.treeRowChevronSpacer)),t})()},get children(){var t=Ue();return t.$$dblclick=o=>o.stopPropagation(),t.$$keydown=o=>{(W.isKey(o,"Enter")||o.key===" ")&&(o.stopPropagation(),e.onToggle(e.row))},t.$$click=o=>{o.stopPropagation(),e.onToggle(e.row)},a.insert(t,a.createComponent(S.Show,{get when(){return e.row.busy},get fallback(){return a.createComponent(V.VpChevronRight,{get class(){return`${T.treeRowChevronIcon} ${e.row.expanded?T.treeRowChevronIconOpen:""}`}})},get children(){return a.createComponent(V.VpLoader2,{"data-motion-exempt":"true",get class(){return`${T.treeRowChevronIcon} ${T.treeRowChevronBusy}`}})}})),a.effect(()=>a.className(t,T.treeRowChevron)),t}});return(()=>{var t=Ve(),o=t.firstChild,l=c;return typeof l=="function"?a.use(l,t):c=t,a.spread(t,a.mergeProps({get tabIndex(){return e.sticky===!0?-1:0}},()=>e.sticky===!0?{tabIndex:-1}:e.aria,{get onKeyDown(){var r;return(r=e.dom)==null?void 0:r.onKeyDown},get class(){var r;return`${T.treeRow} ${((r=e.dom)==null?void 0:r.class)??""}`},get classList(){return{[T.treeRowCursor]:e.isCursor,[T.treeRowSelected]:e.isSelected}},get style(){return{height:`${e.rowHeight}px`,"--tree-depth":String(e.row.depth)}}},()=>e.sticky===!0?{"data-tree-sticky-key":e.row.key}:{"data-tree-row-key":e.row.key},()=>{var r;return((r=e.dom)==null?void 0:r.title)!==void 0?{title:e.dom.title}:{}},()=>{var r;return((r=e.dom)==null?void 0:r.draggable)!==void 0?{draggable:e.dom.draggable}:{}},()=>{var r;return(r=e.dom)!=null&&r.onDragStart?{onDragStart:e.dom.onDragStart}:{}},()=>{var r;return(r=e.dom)!=null&&r.onDragOver?{onDragOver:e.dom.onDragOver}:{}},()=>{var r;return(r=e.dom)!=null&&r.onDragLeave?{onDragLeave:e.dom.onDragLeave}:{}},()=>{var r;return(r=e.dom)!=null&&r.onDrop?{onDrop:e.dom.onDrop}:{}},()=>{var r;return(r=e.dom)!=null&&r.onDragEnd?{onDragEnd:e.dom.onDragEnd}:{}},()=>{var r;return(r=e.dom)!=null&&r.onMouseEnter?{onMouseEnter:e.dom.onMouseEnter}:{}},()=>{var r;return(r=e.dom)!=null&&r.onMouseLeave?{onMouseLeave:e.dom.onMouseLeave}:{}},{onMouseDown:r=>{if(r.button===2){e.isSelected?e.onFocusRow(e.index):e.onSelect(e.index,"replace");return}r.button===0&&e.onSelect(e.index,Ye(r))},onClick:r=>e.onActivateClick(e.row,"single-click",r),onDblClick:r=>e.onActivateClick(e.row,"double-click",r),onContextMenu:r=>{r.preventDefault(),r.stopPropagation(),e.onOpenMenu(e.row,r)}}),!1,!0),a.insert(t,a.createComponent(S.Show,{get when(){return a.memo(()=>e.indentGuide!=="none")()&&e.row.depth>0},get children(){var r=Q();return a.effect(()=>a.className(r,T.treeIndentGuides)),r}}),o),a.insert(t,a.createComponent(S.Show,{get when(){return a.memo(()=>e.indentGuide==="active"&&e.activeGuideDepth>=0)()&&e.row.depth>e.activeGuideDepth},get children(){var r=Q();return a.effect(u=>{var s=T.treeIndentGuideActive,h=`${e.activeGuideDepth}`;return s!==u.e&&a.className(r,u.e=s),h!==u.t&&a.setStyleProperty(r,"--tree-active-col",u.t=h),u},{e:void 0,t:void 0}),r}}),o),a.insert(t,a.createComponent(S.Show,{get when(){return e.showChevronGutter},get children(){return n()}}),o),a.insert(o,()=>e.content),a.insert(t,a.createComponent(S.Show,{get when(){return e.actions},get children(){var r=Qe();return r.$$dblclick=u=>u.stopPropagation(),r.$$keydown=u=>u.stopPropagation(),r.$$click=u=>u.stopPropagation(),a.insert(r,()=>e.actions),a.effect(()=>a.className(r,T.treeRowActions)),r}}),null),a.effect(()=>a.className(o,T.treeRowContent)),t})()}function ze(e){const c=()=>e.query?typeof e.query=="function"?e.query():e.query:"",n=S.createMemo(()=>{const t=c().trim();if(t.length===0)return null;const o=Se(t);return o?o(e.text):null});return a.createComponent(S.Show,{get when(){return n()},get fallback(){return a.memo(()=>e.text)},get children(){return a.createComponent(S.For,{get each(){return n()},children:t=>a.createComponent(S.Show,{get when(){return t.match},get fallback(){return a.memo(()=>t.text)},get children(){var o=We();return a.insert(o,()=>t.text),a.effect(()=>a.className(o,e.class??T.treeMatchHighlight)),o}})})}})}a.delegateEvents(["click","keydown","dblclick"]);const Xe="vk_treeStickyWidget_Q-8QQ",Ze="vk_treeStickyRow_7gWG2",p={treeStickyWidget:Xe,treeStickyRow:Ze};var Je=a.template("<div role=list>"),je=a.template("<div role=listitem>");function pe(e){return(()=>{var c=Je();return a.insert(c,a.createComponent(S.Index,{get each(){return e.rows},children:(n,t)=>(()=>{var o=je();return a.insert(o,a.createComponent(X,{sticky:!0,get row(){return n().row},get index(){return n().index},get rowHeight(){return e.descriptor.rowHeight},get isCursor(){return e.isCursor(n().index)},get isSelected(){return e.isSelected(n().row)},treeHasFocus:()=>!1,get showChevronGutter(){return e.showChevronGutter},get indentGuide(){return e.indentGuide},get activeGuideDepth(){return e.activeGuideDepth},get dom(){var l,r;return(r=(l=e.descriptor).rowProps)==null?void 0:r.call(l,n().row)},get content(){return e.descriptor.renderContent(n().row)},get actions(){var l,r;return(r=(l=e.descriptor).renderActions)==null?void 0:r.call(l,n().row)},get onSelect(){return e.onSelect},get onFocusRow(){return e.onFocusRow},get onToggle(){return e.onToggle},onActivateClick:()=>e.onReveal(n().index),get onOpenMenu(){return e.onOpenMenu}})),a.effect(l=>{var r=p.treeStickyRow,u=`${n().top}px`,s=`${e.rows.length-t}`;return r!==l.e&&a.className(o,l.e=r),u!==l.t&&a.setStyleProperty(o,"top",l.t=u),s!==l.a&&a.setStyleProperty(o,"z-index",l.a=s),l},{e:void 0,t:void 0,a:void 0}),o})()})),a.effect(n=>{var t=p.treeStickyWidget,o=e.label,l=`${e.height}px`;return t!==n.e&&a.className(c,n.e=t),o!==n.t&&a.setAttribute(c,"aria-label",n.t=o),l!==n.a&&a.setStyleProperty(c,"height",n.a=l),n},{e:void 0,t:void 0,a:void 0}),c})()}var et=a.template("<div role=status aria-live=polite aria-atomic=true><span>"),tt=a.template("<div><div>"),nt=a.template("<p>"),rt=a.template("<div>");const ee="roving-tabindex";function ot(e){const c=()=>e.surface.descriptor,n=()=>e.surface.controller;let t;const o=S.createMemo(()=>({...Y,...c().capabilities})),l=()=>o().canExpand&&(c().chevronGutter??!0),r=S.createMemo(()=>{if((c().indentGuide??"none")!=="active")return-1;const m=e.surface.rows()[n().cursorIndex()];return m?m.depth-1:-1});fe.useListCommands({container:()=>t,supportsMultiselect:()=>o().canMultiSelect,verbs:{selectAll:()=>n().selectAll()}});const u=ge.useKeybindingsOptional()===null,s=m=>(m.key==="a"||m.key==="A")&&(m.ctrlKey||m.metaKey)&&!m.altKey&&!m.shiftKey,h=S.createMemo(()=>oe({treeId:c().id,label:c().ariaLabel,multiSelectable:o().canMultiSelect,focusMode:ee,cursorKey:n().cursorKey(),flat:!o().canExpand})),f=m=>{const d=m;return d!=null&&d.tagName?d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.isContentEditable===!0:!1},k=()=>t!==void 0&&t.contains(t.ownerDocument.activeElement),_=(m,d)=>{n().selectIndex(m,d)},C=(m,d,R)=>{var I,x;(x=(I=c()).onActivate)==null||x.call(I,m,d,R)},D=(m,d)=>{e.surface.openMenu(m,{x:d.clientX,y:d.clientY},d)},O=m=>{t==null||t.focus({preventScroll:!0}),e.surface.scroller.scrollToIndex(m,"auto",e.surface.stickyInsetFor(m))};return(()=>{var m=rt();return a.insert(m,a.createComponent(S.Show,{get when(){return n().typeAheadQuery().length>0},get children(){var d=et(),R=d.firstChild;return a.insert(d,a.createComponent(V.VpSearch,{get class(){return T.treeSpeedSearchIcon}}),R),a.insert(R,()=>n().typeAheadQuery()),a.effect(I=>{var x=T.treeSpeedSearchBadge,K=T.treeSpeedSearchText;return x!==I.e&&a.className(d,I.e=x),K!==I.t&&a.className(R,I.t=K),I},{e:void 0,t:void 0}),d}}),null),a.insert(m,a.createComponent(se.OverlayScrollArea,{viewportRef:d=>{var R;e.surface.scroller.containerRef(d),(R=e.viewportRef)==null||R.call(e,d)},get viewportClass(){return`${T.treeViewport} ${e.viewportClass??""}`.trim()},get children(){return[(()=>{var d=tt(),R=d.firstChild,I=t;return typeof I=="function"?a.use(I,d):t=d,a.spread(d,a.mergeProps(h,{get class(){return T.treeContainer},get style(){return{height:`${e.surface.scroller.totalHeight()}px`}},onKeyDown:x=>{if(!f(x.target)){if(u&&s(x)&&o().canMultiSelect){x.preventDefault(),n().selectAll();return}n().handleKeyDown(x)}},onFocus:x=>{x.target===x.currentTarget&&n().cursorIndex()<0&&n().focusIndex(0)}}),!1,!0),a.insert(R,a.createComponent(S.Index,{get each(){return e.surface.scroller.visibleItems()},children:x=>{const K=()=>x().item,P=()=>x().index,B=()=>n().cursorIndex()===P(),i=()=>n().selectedKeys().has(K().key);return a.createComponent(X,{get row(){return K()},get index(){return P()},get aria(){return ce({treeId:c().id,rows:e.surface.rows(),index:P(),focusMode:ee,isCursor:B(),isSelected:i(),flat:!o().canExpand})},get rowHeight(){return c().rowHeight},get isCursor(){return B()},get isSelected(){return i()},treeHasFocus:k,get showChevronGutter(){return l()},get indentGuide(){return c().indentGuide??"none"},get activeGuideDepth(){return r()},get dom(){var g,w;return(w=(g=c()).rowProps)==null?void 0:w.call(g,K())},get content(){return c().renderContent(K())},get actions(){var g,w;return(w=(g=c()).renderActions)==null?void 0:w.call(g,K())},onSelect:_,onFocusRow:g=>n().focusIndex(g),onToggle:g=>{var w,v;return(v=(w=c()).onToggle)==null?void 0:v.call(w,g)},onActivateClick:C,onOpenMenu:D})}})),a.effect(x=>{var K=T.treeSlice,P=`translate3d(0, ${e.surface.scroller.offsetY()}px, 0)`;return K!==x.e&&a.className(R,x.e=K),P!==x.t&&a.setStyleProperty(R,"transform",x.t=P),x},{e:void 0,t:void 0}),d})(),a.createComponent(S.Show,{get when(){return a.memo(()=>e.surface.rows().length===0)()&&c().emptyLabel},get children(){var d=nt();return a.insert(d,()=>c().emptyLabel),a.effect(()=>a.className(d,T.treeEmpty)),d}})]}}),null),a.insert(m,a.createComponent(S.Show,{get when(){return e.surface.stickyState().rows.length>0},get children(){return a.createComponent(pe,{get rows(){return e.surface.stickyState().rows},get height(){return e.surface.stickyState().height},get label(){return de.t("Sticky parent rows")},get descriptor(){return c()},get showChevronGutter(){return l()},get indentGuide(){return c().indentGuide??"none"},get activeGuideDepth(){return r()},isCursor:d=>n().cursorIndex()===d,isSelected:d=>n().selectedKeys().has(d.key),onSelect:_,onFocusRow:d=>n().focusIndex(d),onToggle:d=>{var R,I;return(I=(R=c()).onToggle)==null?void 0:I.call(R,d)},onReveal:O,onOpenMenu:D})}}),null),a.effect(d=>{var R=T.treeStickyHost,I=`${c().indentBaseRem??0}rem`;return R!==d.e&&a.className(m,d.e=R),I!==d.t&&a.setStyleProperty(m,"--tree-indent-base",d.t=I),d},{e:void 0,t:void 0}),m})()}const te=10,q=(e,c)=>Math.max(0,Math.min(e,c-1));function ct(e){return e.key.length===1&&e.key!==" "&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function at(e,c){const{index:n,rowCount:t,capabilities:o}=c;if(t===0)return null;const l=n<0?-1:n;switch(W.namedKeyOf(e)){case"ArrowDown":return e.shiftKey&&o.canMultiSelect?{type:"extend",to:q(l+1,t)}:{type:"move",to:q(l+1,t)};case"ArrowUp":return l<0?{type:"move",to:t-1}:e.shiftKey&&o.canMultiSelect?{type:"extend",to:q(l-1,t)}:{type:"move",to:q(l-1,t)};case"Home":return{type:"move",to:0};case"End":return{type:"move",to:t-1};case"PageDown":return{type:"move",to:q(Math.max(l,0)+te,t)};case"PageUp":return{type:"move",to:q(Math.max(l,0)-te,t)};case"ArrowRight":return o.canExpand?{type:"expandOrDescend"}:{type:"flatNavigate",direction:"in"};case"ArrowLeft":return e.ctrlKey||e.metaKey?null:o.canExpand?{type:"collapseOrAscend"}:{type:"flatNavigate",direction:"out"};case"Enter":return{type:"activate"};case"ContextMenu":return{type:"openMenu"};case"F10":return e.shiftKey?{type:"openMenu"}:null}return e.key===" "?o.canExpand?{type:"toggle"}:null:o.canTypeAhead&&ct(e)?{type:"typeAhead",char:e.key}:null}function L(e,c){const n=e[c];if(!n)return-1;for(let t=c-1;t>=0;t--)if(e[t].depth<n.depth)return t;return-1}function ae(e,c){const n=e[c];if(!n)return null;const t=c+1;if(t>=e.length||e[t].depth<=n.depth)return null;let o=t;for(;o+1<e.length&&e[o+1].depth>n.depth;)o++;return{start:t,end:o}}function lt(e,c,n,t=!1){const o=n.toLowerCase();if(o.length===0)return-1;const l=e.length;if(l===0)return-1;const r=t?0:1;for(let u=r;u<=l;u++){const s=(c+u+l)%l;if(e[s].label.toLowerCase().startsWith(o))return s}for(let u=r;u<=l;u++){const s=(c+u+l)%l;if(e[s].label.toLowerCase().includes(o))return s}return-1}function le(e,c,n){const t=new Map(e.map((f,k)=>[f.key,k])),o=[...n].filter(f=>t.has(f)),l=it(e,c,o,t),r=ut(e,l),u=f=>f.selectable!==!1&&(r===void 0||f.kind===r),s=new Set(o);let h=l<0?-1:L(e,l);for(;;){const f=st(e,h).filter(u).map(C=>C.key);if(h<0)return f;const k=f.length===s.size&&f.every(C=>s.has(C));if(f.length>0&&!k)return f;const _=e[h];if(f.length>0&&u(_))return[_.key,...f];h=L(e,h)}}function it(e,c,n,t){var r;const o=(r=e[c])==null?void 0:r.key;if(o!==void 0&&!n.includes(o))return c;const l=n[0];return l===void 0?-1:t.get(l)??-1}function ut(e,c){const n=e[c];if(n&&n.selectable!==!1)return n.kind;const t=l=>l.selectable!==!1,o=e.slice(Math.max(c,0)).find(t)??e.find(t);return o==null?void 0:o.kind}function st(e,c){if(c<0)return e;const n=ae(e,c);return n?e.slice(n.start,n.end+1):[]}const ne=1e3;function ie(e){const c=()=>({...Y,...e.capabilities,expandAll:!1}),[n,t]=S.createSignal(-1),[o,l]=S.createSignal(new Set),[r,u]=S.createSignal(-1),[s,h]=S.createSignal("");let f=0,k;const _=()=>{k!==void 0&&(clearTimeout(k),k=void 0),s().length>0&&h("")},C=()=>{k!==void 0&&(clearTimeout(k),k=void 0),k=setTimeout(()=>{h(""),k=void 0},ne)};S.onCleanup(()=>{k!==void 0&&(clearTimeout(k),k=void 0)});const D=S.createMemo(()=>{var i;return((i=e.rows()[n()])==null?void 0:i.key)??null}),O=i=>{var w;const g=e.rows();i<0||i>=g.length||i===n()||(t(i),u(i),(w=e.onScrollToIndex)==null||w.call(e,i))},m=(i,g)=>{var b;const w=e.rows(),v=(b=w[i])==null?void 0:b.kind,[y,E]=i<=g?[i,g]:[g,i],M=new Set;for(let $=y;$<=E;$++){const A=w[$];A&&A.selectable!==!1&&(v!==void 0&&A.kind!==v||M.add(A.key))}return M};return{cursorIndex:n,cursorKey:D,selectedKeys:o,typeAheadQuery:s,get capabilities(){return c()},focusIndex:O,selectIndex:(i,g)=>{var y,E,M;_();const v=e.rows()[i];if(v){if(v.selectable===!1&&g!=="range"){O(i);return}if(g==="toggle"&&c().canMultiSelect){const b=new Set(o());b.has(v.key)?b.delete(v.key):b.add(v.key),l(b),t(i),u(i),(y=e.onScrollToIndex)==null||y.call(e,i);return}if(g==="range"&&c().canMultiSelect){const b=r()>=0?r():i;l(m(b,i)),t(i),(E=e.onScrollToIndex)==null||E.call(e,i);return}l(new Set([v.key])),t(i),u(i),(M=e.onScrollToIndex)==null||M.call(e,i)}},clearSelection:()=>{_(),o().size>0&&l(new Set)},selectChildren:i=>{var $;const g=e.rows(),w=g[i];if(!w)return;const v=w.depth+1,y=new Set;let E,M=!1,b=-1;for(let A=i+1;A<g.length;A++){const H=g[A];if(H.depth<=w.depth)break;if(H.depth===v&&H.selectable!==!1){if(!M)E=H.kind,b=A,M=!0;else if(E!==void 0&&H.kind!==E)continue;y.add(H.key)}}y.size!==0&&(l(y),b>=0&&(t(b),u(b),($=e.onScrollToIndex)==null||$.call(e,b)))},selectAll:()=>{c().canMultiSelect&&l(new Set(le(e.rows(),n(),o())))},childKindsHomogeneous:i=>{const g=e.rows(),w=g[i];if(!w)return{homogeneous:!1,total:0,selectable:0};const v=w.depth+1;let y,E=!1,M=0,b=0;for(let $=i+1;$<g.length;$++){const A=g[$];if(A.depth<=w.depth)break;A.depth===v&&A.selectable!==!1&&(M++,E?(y===void 0||A.kind===y)&&b++:(y=A.kind,E=!0,b++))}return{homogeneous:M>0&&M===b,total:M,selectable:b}},handleKeyDown:i=>{var E,M,b,$,A,H,Z,J;if(W.isKey(i,"Escape")&&s().length>0){i.preventDefault(),i.stopPropagation(),_();return}const g=e.rows(),w=n(),v=at(i,{index:w,rowCount:g.length,capabilities:c()});if(!v)return;const y=g[w];switch(v.type){case"move":i.preventDefault(),O(v.to);return;case"extend":{i.preventDefault();const G=r()>=0?r():w;l(m(G,v.to)),t(v.to),(E=e.onScrollToIndex)==null||E.call(e,v.to);return}case"expandOrDescend":if(!y)return;if(i.preventDefault(),y.expandable&&!y.expanded){(M=e.onToggle)==null||M.call(e,y);return}O(w+1);return;case"collapseOrAscend":{if(!y)return;if(i.preventDefault(),y.expandable&&y.expanded){(b=e.onToggle)==null||b.call(e,y);return}const G=L(g,w);G>=0&&O(G);return}case"toggle":if(!(y!=null&&y.expandable))return;i.preventDefault(),($=e.onToggle)==null||$.call(e,y);return;case"flatNavigate":i.preventDefault(),(A=e.onFlatNavigate)==null||A.call(e,v.direction,y);return;case"activate":if(!y)return;i.preventDefault(),(H=e.onActivate)==null||H.call(e,y);return;case"openMenu":{if(!y)return;i.preventDefault();const G=i.target,N=G==null?void 0:G.getBoundingClientRect();(Z=e.onOpenMenu)==null||Z.call(e,y,{x:Math.round((N==null?void 0:N.left)??0),y:Math.round((N==null?void 0:N.bottom)??0)});return}case"typeAhead":{const G=((J=e.now)==null?void 0:J.call(e))??Date.now(),N=G-f>ne,F=N?"":s(),U=F.length===1&&F.toLowerCase()===v.char.toLowerCase()?F:`${F}${v.char}`,j=lt(g,w,U,U.length>1&&!N);if(f=G,j<0){h(F),F.length>0?C():_();return}h(U),C(),i.preventDefault(),O(j);return}}},openMenuAt:(i,g)=>{var v;const w=e.rows()[i];w&&((v=e.onOpenMenu)==null||v.call(e,w,g))}}}const dt=.4,ht={rows:[],height:0};function ue(e){return Math.max(Math.floor(e),1)}function ft(e,c,n){let t=c,o=L(e,t);for(;o!==-1;){if(o===n)return t;t=o,o=L(e,t)}return n===-1?t:-1}function gt(e,c,n,t){let o=e;for(let r=0;r<e.length;r++)if(e[r].top+t>n||r>=c){o=e.slice(0,r);break}const l=o[o.length-1];return l?{rows:o,height:l.top+t}:{rows:[],height:0}}function wt(e){const{rows:c,scrollTop:n,rowHeight:t,viewportHeight:o}=e;if(c.length===0||t<=0)return ht;const l=ue(e.maxCount),r=[];let u=0,s=-1;for(;;){const h=Math.floor((n+u)/t);if(h<0||h>=c.length)break;const f=ft(c,h,s);if(f===-1)break;const k=ae(c,f);if(k===null||f===h&&n===f*t-u)break;const _=(k.end+1)*t-n,C=u,D=C+t>_&&C<=_?_-t:C;if(r.push({index:f,row:c[f],top:D}),u=D+t,s=f,r.length>=l)break}return gt(r,l,o*dt,t)}function mt(e,c,n,t){if(c<0||c>=e.length)return 0;let o=0,l=L(e,c);for(;l!==-1;)o++,l=L(e,l);return Math.min(o,ue(t))*n}const yt=8,re=7,vt={rows:[],height:0};function St(e){const c=S.useContext(me.DesktopContextMenuContext),n=S.createMemo(()=>[...e.rows()]),t=we.createVirtualScroller({items:n,itemHeight:e.rowHeight,overscan:e.overscan??yt}),o=S.createMemo(()=>e.stickyScroll!==!0?vt:wt({rows:n(),scrollTop:t.scrollTop(),rowHeight:e.rowHeight,viewportHeight:t.viewportHeight(),maxCount:e.stickyScrollMaxCount??re})),l=s=>e.stickyScroll===!0?mt(n(),s,e.rowHeight,e.stickyScrollMaxCount??re):0,r=ie({rows:n,...e.capabilities?{capabilities:e.capabilities}:{},onToggle:s=>{var h;return(h=e.onToggle)==null?void 0:h.call(e,s)},onActivate:s=>{var h;return(h=e.onActivate)==null?void 0:h.call(e,s,"keyboard")},onOpenMenu:(s,h)=>u(s,h),onCollapseAll:()=>{var s;return(s=e.onCollapseAll)==null?void 0:s.call(e)},onFlatNavigate:(s,h)=>{var f;return(f=e.onFlatNavigate)==null?void 0:f.call(e,s,h)},onRename:s=>{var h;return(h=e.onRename)==null?void 0:h.call(e,s)},onDestroy:s=>{var h;return(h=e.onDestroy)==null?void 0:h.call(e,s)},onScrollToIndex:s=>t.scrollToIndex(s,"auto",l(s))});function u(s,h,f){if(e.openMenu){e.openMenu(s,h,f);return}if(!e.buildMenu)return;const k=e.buildMenu(s,r.selectedKeys());if(k.length!==0){if(!c)throw new ye.BugIndicatingError("createTreeSurface: descriptor builds a context menu but no DesktopContextMenuProvider is mounted");c.open(h.x,h.y,k,f)}}return{descriptor:e,controller:r,scroller:t,rows:n,stickyState:o,stickyInsetFor:l,openMenu:u}}const Ct=.85;exports.DEFAULT_TREE_CAPABILITIES=Y;exports.TREE_INDENT_STEP_REM=Ct;exports.TreeHighlight=ze;exports.TreeRow=X;exports.TreeSurface=ot;exports.buildTreeContainerAria=oe;exports.buildTreeRowAria=ce;exports.createTreeController=ie;exports.createTreeSurface=St;exports.selectAllInScope=le;exports.treeRowDomId=z;