@visulima/dev-toolbar 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (175) hide show
  1. package/CHANGELOG.md +321 -0
  2. package/LICENSE.md +137 -5
  3. package/README.md +75 -18
  4. package/bin/mcp.js +29 -0
  5. package/dist/apps/a11y/index.d.ts +3 -2
  6. package/dist/apps/a11y/index.js +21 -2
  7. package/dist/apps/annotations/index.d.ts +4 -0
  8. package/dist/apps/annotations/index.js +18 -0
  9. package/dist/apps/assets/index.d.ts +4 -0
  10. package/dist/apps/assets/index.js +16 -0
  11. package/dist/apps/inspector/index.d.ts +3 -2
  12. package/dist/apps/inspector/index.js +30 -1
  13. package/dist/apps/module-graph/index.d.ts +3 -2
  14. package/dist/apps/module-graph/index.js +20 -1
  15. package/dist/apps/performance/index.d.ts +3 -2
  16. package/dist/apps/performance/index.js +17 -1
  17. package/dist/apps/seo/index.d.ts +3 -2
  18. package/dist/apps/seo/index.js +17 -1
  19. package/dist/apps/settings/index.d.ts +3 -2
  20. package/dist/apps/settings/index.js +17 -1
  21. package/dist/apps/tailwind/index.d.ts +3 -2
  22. package/dist/apps/tailwind/index.js +5 -5
  23. package/dist/apps/timeline/index.d.ts +3 -2
  24. package/dist/apps/timeline/index.js +18 -1
  25. package/dist/apps/vite-config/index.d.ts +3 -2
  26. package/dist/apps/vite-config/index.js +16 -1
  27. package/dist/client/overlay.d.ts +1 -1
  28. package/dist/client/overlay.js +1 -1
  29. package/dist/index.d.ts +133 -8
  30. package/dist/index.js +1 -1
  31. package/dist/mcp/server.d.ts +2 -0
  32. package/dist/mcp/server.js +1 -0
  33. package/dist/packem_chunks/inject-source.js +7 -1
  34. package/dist/packem_shared/Alert-CZq7C43v.js +1 -0
  35. package/dist/packem_shared/Badge-PpblpNWg.js +1 -0
  36. package/dist/packem_shared/Button-CAKvtfij.js +1 -0
  37. package/dist/packem_shared/Card-BSy2oRiS.js +1 -0
  38. package/dist/packem_shared/Icon-0XYV-4AL.js +1 -0
  39. package/dist/packem_shared/Input-Dc1WiT01.js +1 -0
  40. package/dist/packem_shared/Label-BZh8XxUb.js +1 -0
  41. package/dist/packem_shared/Popover-DuiU8EPg.js +1 -0
  42. package/dist/packem_shared/Progress-C90LC--2.js +1 -0
  43. package/dist/packem_shared/Select-CwD-d0pi.js +1 -0
  44. package/dist/packem_shared/Separator-PSjfhX_W.js +1 -0
  45. package/dist/packem_shared/Skeleton-BAFrGUR1.js +1 -0
  46. package/dist/packem_shared/Switch-Wpsp5M3p.js +1 -0
  47. package/dist/packem_shared/Tabs-BdNFQd3c.js +1 -0
  48. package/dist/packem_shared/Textarea-DP9gpte-.js +1 -0
  49. package/dist/packem_shared/Tooltip-DVeuszoY.js +1 -0
  50. package/dist/packem_shared/annotation-settings-DlLZO5Zp.js +1 -0
  51. package/dist/packem_shared/annotation-store-CXMIg0dM.js +1 -0
  52. package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
  53. package/dist/packem_shared/clsx-CtZWcPHt.js +1 -0
  54. package/dist/packem_shared/createClientRPCContext-80V9c3Qu.js +1 -0
  55. package/dist/packem_shared/createDevToolbarHook-CzejbqD2.js +1 -0
  56. package/dist/packem_shared/createServerRPCContext-C30tqEfQ.js +1 -0
  57. package/dist/packem_shared/getGlobalHook-GRSqUNJ3.js +1 -0
  58. package/dist/packem_shared/getTimelineStore-BT5sImVb.js +1 -0
  59. package/dist/packem_shared/global-api.d-DeaCvII9.d.ts +546 -0
  60. package/dist/packem_shared/loadSettings-C0pUyx9j.js +1 -0
  61. package/dist/packem_shared/server.d-ZkcY0pge.d.ts +39 -0
  62. package/dist/packem_shared/sharedToolbarStylesheet-DNABzHAf.js +2 -0
  63. package/dist/packem_shared/store-Dqy0FbGw.js +1 -0
  64. package/dist/packem_shared/use-theme-DIqZkPAe.js +1 -0
  65. package/dist/toolbar/index.d.ts +152 -49
  66. package/dist/toolbar/index.js +3 -3
  67. package/dist/ui/index.d.ts +382 -17
  68. package/dist/ui/index.js +1 -1
  69. package/dist/vite-plugin.d.ts +183 -141
  70. package/dist/vite-plugin.js +5 -2
  71. package/package.json +41 -22
  72. package/dist/apps/a11y/a11y-app.d.ts +0 -5
  73. package/dist/apps/a11y/a11y-store.d.ts +0 -42
  74. package/dist/apps/a11y/a11y-tooltip.d.ts +0 -11
  75. package/dist/apps/inspector/inspector-app.d.ts +0 -12
  76. package/dist/apps/module-graph/module-graph-app.d.ts +0 -5
  77. package/dist/apps/more/index.d.ts +0 -3
  78. package/dist/apps/more/index.js +0 -2
  79. package/dist/apps/more/more-app.d.ts +0 -5
  80. package/dist/apps/performance/performance-app.d.ts +0 -5
  81. package/dist/apps/performance/performance-tooltip.d.ts +0 -5
  82. package/dist/apps/seo/seo-app.d.ts +0 -5
  83. package/dist/apps/settings/settings-app.d.ts +0 -4
  84. package/dist/apps/tailwind/tailwind-app.d.ts +0 -5
  85. package/dist/apps/timeline/timeline-app.d.ts +0 -5
  86. package/dist/apps/vite-config/vite-config-app.d.ts +0 -5
  87. package/dist/hooks/create-hook.d.ts +0 -12
  88. package/dist/hooks/events.d.ts +0 -7
  89. package/dist/hooks/global-hook.d.ts +0 -15
  90. package/dist/hooks/index.d.ts +0 -6
  91. package/dist/packem_shared/Alert-H-x1JuZ0.js +0 -1
  92. package/dist/packem_shared/Badge-C30mDKKG.js +0 -1
  93. package/dist/packem_shared/Button-DODNCTPZ.js +0 -1
  94. package/dist/packem_shared/Card-DdI7Wn3t.js +0 -1
  95. package/dist/packem_shared/Icon-DWFLZkwW.js +0 -1
  96. package/dist/packem_shared/Input-GfbOwAkK.js +0 -1
  97. package/dist/packem_shared/Label-Bzi47aUf.js +0 -1
  98. package/dist/packem_shared/Popover-CLt7YhUF.js +0 -1
  99. package/dist/packem_shared/Progress-vGfFpxRn.js +0 -1
  100. package/dist/packem_shared/Separator-DQGeJPQg.js +0 -1
  101. package/dist/packem_shared/Skeleton-BYXau6jM.js +0 -1
  102. package/dist/packem_shared/Switch-BeC78S_T.js +0 -1
  103. package/dist/packem_shared/Tabs-CXERaeAp.js +0 -1
  104. package/dist/packem_shared/Textarea-DvbSX13V.js +0 -1
  105. package/dist/packem_shared/Tooltip-tlBN-NdK.js +0 -1
  106. package/dist/packem_shared/cn-DWLJYh3h.js +0 -1
  107. package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +0 -1
  108. package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +0 -1
  109. package/dist/packem_shared/createServerRPCContext-CEm1Ymkn.js +0 -1
  110. package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +0 -1
  111. package/dist/packem_shared/loadSettings-hvjR4fcS.js +0 -1
  112. package/dist/packem_shared/setupGlobalHook-CCf9Logv.js +0 -1
  113. package/dist/packem_shared/sharedToolbarStylesheet-DOV-Jwcm.js +0 -2
  114. package/dist/packem_shared/store-DaUtLjf3.js +0 -1
  115. package/dist/packem_shared/use-theme-BOw3dPpY.js +0 -1
  116. package/dist/performance/monitor.d.ts +0 -116
  117. package/dist/rpc/client.d.ts +0 -9
  118. package/dist/rpc/functions/module-graph.d.ts +0 -17
  119. package/dist/rpc/functions/open-in-editor.d.ts +0 -16
  120. package/dist/rpc/functions/tailwind-config.d.ts +0 -15
  121. package/dist/rpc/functions/vite-config.d.ts +0 -9
  122. package/dist/rpc/server.d.ts +0 -15
  123. package/dist/timeline/capture.d.ts +0 -8
  124. package/dist/timeline/index.d.ts +0 -8
  125. package/dist/timeline/store.d.ts +0 -42
  126. package/dist/toolbar/app-manager.d.ts +0 -104
  127. package/dist/toolbar/components/app-button.d.ts +0 -19
  128. package/dist/toolbar/components/app-canvas.d.ts +0 -12
  129. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -12
  130. package/dist/toolbar/components/first-visit-hint.d.ts +0 -16
  131. package/dist/toolbar/components/index.d.ts +0 -4
  132. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -22
  133. package/dist/toolbar/components/toolbar-bar.d.ts +0 -14
  134. package/dist/toolbar/components/toolbar-container.d.ts +0 -55
  135. package/dist/toolbar/components/vite-overlay-button.d.ts +0 -14
  136. package/dist/toolbar/context/index.d.ts +0 -2
  137. package/dist/toolbar/context/toolbar-context.d.ts +0 -107
  138. package/dist/toolbar/global-api.d.ts +0 -24
  139. package/dist/toolbar/helpers.d.ts +0 -8
  140. package/dist/toolbar/hooks/index.d.ts +0 -10
  141. package/dist/toolbar/hooks/use-apps.d.ts +0 -15
  142. package/dist/toolbar/hooks/use-frame-state.d.ts +0 -100
  143. package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -23
  144. package/dist/toolbar/hooks/use-position.d.ts +0 -24
  145. package/dist/toolbar/hooks/use-theme.d.ts +0 -15
  146. package/dist/toolbar/hooks/use-toolbar.d.ts +0 -16
  147. package/dist/toolbar/settings.d.ts +0 -17
  148. package/dist/toolbar/stylesheet.d.ts +0 -3
  149. package/dist/toolbar/utils/index.d.ts +0 -12
  150. package/dist/types/app.d.ts +0 -175
  151. package/dist/types/global-api.d.ts +0 -91
  152. package/dist/types/hooks.d.ts +0 -86
  153. package/dist/types/index.d.ts +0 -12
  154. package/dist/types/messaging.d.ts +0 -43
  155. package/dist/types/rpc.d.ts +0 -97
  156. package/dist/types/timeline.d.ts +0 -62
  157. package/dist/types/toolbar.d.ts +0 -56
  158. package/dist/ui/components/alert.d.ts +0 -20
  159. package/dist/ui/components/badge.d.ts +0 -10
  160. package/dist/ui/components/button.d.ts +0 -12
  161. package/dist/ui/components/card.d.ts +0 -17
  162. package/dist/ui/components/icon.d.ts +0 -20
  163. package/dist/ui/components/input.d.ts +0 -8
  164. package/dist/ui/components/label.d.ts +0 -8
  165. package/dist/ui/components/popover.d.ts +0 -27
  166. package/dist/ui/components/progress.d.ts +0 -8
  167. package/dist/ui/components/separator.d.ts +0 -9
  168. package/dist/ui/components/skeleton.d.ts +0 -7
  169. package/dist/ui/components/switch.d.ts +0 -12
  170. package/dist/ui/components/tabs.d.ts +0 -29
  171. package/dist/ui/components/textarea.d.ts +0 -8
  172. package/dist/ui/components/tooltip.d.ts +0 -19
  173. package/dist/utils/cn.d.ts +0 -8
  174. package/dist/vite/inject-source.d.ts +0 -24
  175. package/dist/vite/matcher.d.ts +0 -6
package/bin/mcp.js ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * MCP server for `@visulima/dev-toolbar` annotations.
5
+ *
6
+ * Usage:
7
+ * npx visulima-dev-toolbar-mcp
8
+ *
9
+ * Configure in .mcp.json:
10
+ * {
11
+ * "mcpServers": {
12
+ * "dev-toolbar": {
13
+ * "command": "npx",
14
+ * "args": ["visulima-dev-toolbar-mcp"],
15
+ * "cwd": "/absolute/path/to/project"
16
+ * }
17
+ * }
18
+ * }
19
+ *
20
+ * Requires @modelcontextprotocol/sdk to be installed.
21
+ */
22
+
23
+ // eslint-disable-next-line antfu/no-import-dist -- bin entry point runs after build
24
+ import { startMcpServer } from "../dist/mcp/server.js";
25
+
26
+ startMcpServer().catch((error) => {
27
+ console.error("Failed to start MCP server:", error);
28
+ process.exit(1);
29
+ });
@@ -1,3 +1,4 @@
1
- import type { DevToolbarApp } from "../../types/app.d.ts";
1
+ import { D as DevToolbarApp } from "../../packem_shared/app.d-SmKEDxsI.js";
2
+ import 'preact';
2
3
  declare const a11yApp: DevToolbarApp;
3
- export default a11yApp;
4
+ export { a11yApp as default };
@@ -1,2 +1,21 @@
1
- var X=Object.defineProperty;var O=(n,e)=>X(n,"name",{value:e,configurable:!0});import Y from"lucide-static/icons/accessibility.svg?raw";import{addHookName as k}from"preact/devtools";import{useState as C,useEffect as L}from"preact/hooks";import d from"../../packem_shared/cn-DWLJYh3h.js";import{jsxs as i,jsx as t,Fragment as W}from"preact/jsx-runtime";import S from"../../packem_shared/Button-DODNCTPZ.js";import{Alert as Z,AlertDescription as ee}from"../../packem_shared/Alert-H-x1JuZ0.js";var te=Object.defineProperty,x=O((n,e)=>te(n,"name",{value:e,configurable:!0}),"i$3");const E=["critical","serious","moderate","minor"],re={critical:"rgb(239,68,68)",minor:"rgb(100,116,139)",moderate:"rgb(249,115,22)",serious:"rgb(234,179,8)"},se={"best-practice":["best-practice"],wcag2a:["wcag2a"],wcag21aa:["wcag2a","wcag2aa","wcag21a","wcag21aa"],wcag22aa:["wcag2a","wcag2aa","wcag21a","wcag21aa","wcag22a","wcag22aa"]},_="__vdt_a11y__",ae=x(()=>{try{const n=sessionStorage.getItem(_);if(n){const e=JSON.parse(n);if(Array.isArray(e.issues))return{issues:e.issues,lastScan:e.lastScan??void 0}}}catch{}return{issues:[],lastScan:void 0}},"loadFromSession"),z=x((n,e)=>{const a=n;a.dataset.vdtA11y=e,a.style.setProperty("outline",`2px solid ${re[e]}`,"important"),a.style.setProperty("outline-offset","2px","important")},"setHighlight"),N=x(()=>{for(const n of document.querySelectorAll("[data-vdt-a11y]")){const e=n;delete e.dataset.vdtA11y,e.style.removeProperty("outline"),e.style.removeProperty("outline-offset")}},"clearHighlightsDOM"),B=x(n=>{N();for(const e of n)for(const a of e.nodes)try{const r=document.querySelector(a.selector);r&&z(r,e.impact)}catch{}},"applyOverlaysDOM"),ne=x(n=>{const e=n.at(-1);return Array.isArray(e)?e.join(" "):String(e??"")},"nodeSelector"),ie=x((n,e)=>{const a=[];for(const r of n)e.includes(r.id)||a.push({helpUrl:r.helpUrl,id:r.id,impact:r.impact??"minor",message:r.help,nodes:r.nodes.map(o=>({html:o.html,selector:ne(o.target)})),wcagTags:r.tags.filter(o=>o.startsWith("wcag")||o==="best-practice")});return a},"convertViolations"),oe=x(async n=>{const e=await import("axe-core"),a=typeof e.default?.run=="function"?e.default:e;if(typeof a.run!="function")throw new TypeError("axe-core could not be loaded — .run is not available");return a.run(document,{exclude:[["dev-toolbar"]],runOnly:{type:"tag",values:se[n]}})},"runAxeScan");class le{static{O(this,"v")}static{x(this,"A11yStore")}listeners=new Set;state;constructor(){const{issues:e,lastScan:a}=ae();this.state={isScanning:!1,issues:e,lastScan:a,scanError:void 0,showOverlays:!1,standard:"wcag21aa"}}clearHighlights(){N()}getState(){return this.state}highlightIssue(e){N();let a=!1;for(const r of e.nodes)try{const o=document.querySelector(r.selector);o&&(z(o,e.impact),a||(o.scrollIntoView({behavior:"smooth",block:"center"}),a=!0))}catch{}}async scan(e=[]){if(!this.state.isScanning){this.update({isScanning:!0,scanError:void 0});try{const a=await oe(this.state.standard),r=ie(a.violations,e);this.update({isScanning:!1,issues:r,lastScan:new Date().toISOString()}),this.persist(),this.state.showOverlays&&B(r)}catch(a){this.update({isScanning:!1,scanError:a instanceof Error?a.message:String(a)})}}}setShowOverlays(e){this.update({showOverlays:e}),e?B(this.state.issues):N()}setStandard(e){this.update({standard:e})}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}persist(){try{sessionStorage.setItem(_,JSON.stringify({issues:this.state.issues,lastScan:this.state.lastScan}))}catch{}}update(e){this.state={...this.state,...e},this.notify()}}const c=new le;var ce=Object.defineProperty,l=O((n,e)=>ce(n,"name",{value:e,configurable:!0}),"i$2");const I={critical:"Critical",minor:"Minor",moderate:"Moderate",serious:"Serious"},J={critical:"text-destructive",minor:"text-muted-foreground",moderate:"text-warning-foreground",serious:"text-warning-foreground"},de={critical:"bg-destructive/10 border-destructive/30",minor:"bg-foreground/4 border-border",moderate:"bg-warning/10 border-warning/30",serious:"bg-warning/10 border-warning/30"},ue={critical:"bg-destructive",minor:"bg-muted-foreground/50",moderate:"bg-warning",serious:"bg-warning"},ge=l(({count:n,isActive:e,onClick:a,severity:r})=>i("button",{class:d("flex flex-col items-center gap-1 px-3 py-2.5 border cursor-pointer transition-colors",e?"ring-1 ring-inset ring-primary/40":"hover:bg-foreground/6",de[r]),onClick:a,title:`${e?"Clear":"Filter by"} ${I[r]}`,type:"button",children:[t("span",{class:d("text-xl font-bold tabular-nums leading-none",J[r]),children:n}),t("span",{class:"text-[0.6rem] font-semibold uppercase tracking-wider text-muted-foreground",children:I[r]})]}),"SeverityBucket"),me=l(({isSelected:n,issue:e,onClick:a,onDisable:r})=>i("div",{class:d("p-3 border cursor-pointer transition-colors",n?"bg-foreground/6 border-primary/30":"border-border hover:bg-foreground/3"),onClick:a,children:[i("div",{class:"flex items-start gap-2 mb-1.5",children:[t("span",{class:d("mt-1 size-2 rounded-full shrink-0",ue[e.impact])}),t("span",{class:"text-[0.75rem] font-semibold text-foreground flex-1 leading-snug",children:e.id}),t("span",{class:d("text-[0.6rem] font-bold uppercase tracking-wide shrink-0",J[e.impact]),children:I[e.impact]})]}),t("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed mb-2 ml-4",children:e.message}),e.nodes.length>0&&i("div",{class:"mb-2 ml-4 space-y-0.5",children:[e.nodes.slice(0,3).map((o,m)=>t("code",{class:"block text-[0.65rem] text-foreground/70 font-mono bg-foreground/5 px-2 py-1 truncate",children:o.selector},m)),e.nodes.length>3&&i("span",{class:"text-[0.62rem] text-muted-foreground/60",children:["+",e.nodes.length-3," more element",e.nodes.length>4?"s":""]})]}),i("div",{class:"flex items-center gap-2 flex-wrap ml-4",children:[e.wcagTags.slice(0,3).map(o=>t("span",{class:"text-[0.58rem] font-mono uppercase bg-primary/8 text-primary/70 border border-primary/20 px-1.5 py-0.5",children:o},o)),t("span",{class:"flex-1"}),t("a",{class:"text-[0.62rem] text-primary/70 hover:text-primary transition-colors",href:e.helpUrl,onClick:l(o=>o.stopPropagation(),"onClick"),rel:"noopener noreferrer",target:"_blank",children:"Learn more ↗"}),t("button",{class:"text-[0.62rem] text-muted-foreground/60 hover:text-muted-foreground transition-colors cursor-pointer bg-transparent border-0 p-0",onClick:l(o=>{o.stopPropagation(),r(e.id)},"onClick"),title:"Disable this rule for current session",type:"button",children:"Disable"})]})]}),"IssueCard"),pe=l(n=>{const[e,a]=k(C(()=>c.getState()),"storeState"),[r,o]=k(C([]),"disabledRules"),[m,$]=k(C(void 0),"minSeverity"),[w,v]=k(C(void 0),"activeIssueId"),[p,f]=k(C(void 0),"filterSeverity");L(()=>c.subscribe(()=>a(c.getState())),[]),L(()=>c.clearHighlights.bind(c),[]);const{isScanning:b,issues:h,lastScan:u,scanError:M,showOverlays:T,standard:q}=e,U=u!==void 0||M!==void 0,P=l(()=>{f(void 0),v(void 0),c.scan(r).catch(()=>{})},"handleScan"),V=l(s=>{w===s.id?(v(void 0),c.clearHighlights(),T&&c.setShowOverlays(!0)):(v(s.id),c.highlightIssue(s))},"handleIssueClick"),F=l(s=>{o(g=>[...g,s])},"handleDisableRule"),R=h.filter(s=>!(r.includes(s.id)||p&&s.impact!==p||m&&E.indexOf(s.impact)>E.indexOf(m))),K=l(s=>h.filter(g=>!r.includes(g.id)&&g.impact===s).length,"countBy");return i("div",{class:"flex flex-col h-full",children:[i("div",{class:"shrink-0 flex items-center gap-2 px-4 py-2.5 border-b border-border bg-foreground/2 flex-wrap",children:[t(S,{class:d(b?"border-primary/30 text-primary/50 bg-primary/5":""),disabled:b,onClick:P,size:"sm",variant:"outline",children:b?"Scanning…":"Scan page"}),i("label",{class:"flex items-center gap-1.5 text-[0.7rem] text-muted-foreground",children:["Standard",i("select",{class:"bg-card border border-border text-foreground text-[0.7rem] px-1.5 py-1 cursor-pointer",onChange:l(s=>c.setStandard(s.target.value),"onChange"),style:"color-scheme: dark",value:q,children:[t("option",{value:"wcag21aa",children:"WCAG 2.1 AA"}),t("option",{value:"wcag22aa",children:"WCAG 2.2 AA"}),t("option",{value:"wcag2a",children:"WCAG 2.0 A"}),t("option",{value:"best-practice",children:"Best Practice"})]})]}),i("label",{class:"flex items-center gap-1.5 text-[0.7rem] text-muted-foreground",children:["Min",i("select",{class:"bg-card border border-border text-foreground text-[0.7rem] px-1.5 py-1 cursor-pointer",onChange:l(s=>{const{value:g}=s.target;$(g||void 0)},"onChange"),style:"color-scheme: dark",value:m??"",children:[t("option",{value:"",children:"All"}),t("option",{value:"critical",children:"Critical only"}),t("option",{value:"serious",children:"Serious+"}),t("option",{value:"moderate",children:"Moderate+"})]})]}),t(S,{class:d(T?"border-primary/30 text-primary bg-primary/8":""),onClick:l(()=>c.setShowOverlays(!T),"onClick"),size:"sm",title:"Toggle visual highlights on affected elements",variant:"outline",children:"Overlays"}),U&&h.length>0&&i(W,{children:[t(S,{class:"ml-auto",onClick:l(()=>{const s=new Blob([JSON.stringify(h,void 0,2)],{type:"application/json"}),g=URL.createObjectURL(s),A=document.createElement("a");A.href=g,A.download="a11y-audit.json",A.click(),URL.revokeObjectURL(g)},"onClick"),size:"sm",title:"Export audit results as JSON",variant:"outline",children:"JSON"}),t(S,{onClick:l(()=>{const s=l(y=>`"${y.replaceAll('"','""')}"`,"q"),g=["Rule ID","Severity","Message","Selector","HTML","WCAG Tags"].join(","),A=h.flatMap(y=>y.nodes.map(H=>[s(y.id),s(y.impact),s(y.message),s(H.selector),s(H.html),s(y.wcagTags.join("; "))].join(","))),Q=new Blob([[g,...A].join(`
2
- `)],{type:"text/csv"}),G=URL.createObjectURL(Q),D=document.createElement("a");D.href=G,D.download="a11y-audit.csv",D.click(),URL.revokeObjectURL(G)},"onClick"),size:"sm",title:"Export audit results as CSV",variant:"outline",children:"CSV"})]})]}),i("div",{class:"flex-1 overflow-y-auto devtools-content-scroll",children:[M&&t(Z,{class:"rounded-none border-x-0 border-t-0",variant:"destructive",children:i(ee,{children:["Scan failed: ",M]})}),!U&&!b&&i("div",{class:"flex flex-col items-center justify-center gap-4 p-8 min-h-48 text-center",children:[t("p",{class:"text-[0.8125rem] text-muted-foreground max-w-sm",children:"Run an accessibility audit using axe-core to detect WCAG violations on this page."}),t(S,{onClick:P,variant:"outline",children:"Start scan"})]}),b&&t("div",{class:"flex items-center justify-center gap-3 p-8 min-h-48",children:t("span",{class:"text-[0.8rem] text-muted-foreground",children:"Scanning for accessibility issues…"})}),U&&!b&&!M&&i("div",{class:"p-5 space-y-4",children:[t("div",{class:"grid grid-cols-4 gap-2",children:E.map(s=>t(ge,{count:K(s),isActive:p===s,onClick:l(()=>f(p===s?void 0:s),"onClick"),severity:s},s))}),R.length===0?i("div",{class:"p-6 text-center border border-border",children:[t("p",{class:"text-[0.8125rem] font-medium text-foreground/70",children:h.length===0?"No violations found!":"No issues match the current filters."}),h.length===0&&t("p",{class:"mt-1 text-[0.7rem] text-muted-foreground",children:"Great — the page passes all rules for the selected standard."})]}):i("section",{children:[i("div",{class:"flex items-center gap-2 mb-2",children:[i("span",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground",children:[t("span",{"aria-hidden":"true",class:"text-primary/50",children:"//"})," ",R.length," issue",R.length===1?"":"s",p?` · ${I[p]} only`:""]}),p&&t(S,{class:"h-auto p-0 text-[0.62rem]",onClick:l(()=>f(void 0),"onClick"),variant:"link",children:"Clear ×"})]}),t("div",{class:"space-y-2",children:R.map(s=>t(me,{isSelected:w===s.id,issue:s,onClick:l(()=>V(s),"onClick"),onDisable:F},s.id))})]}),r.length>0&&i("div",{class:"flex items-center gap-2 text-[0.65rem] text-muted-foreground/60",children:[i("span",{children:[r.length," rule",r.length===1?"":"s"," disabled this session."]}),t(S,{class:"h-auto p-0 text-[0.62rem]",onClick:l(()=>o([]),"onClick"),variant:"link",children:"Reset"})]})]})]})]})},"A11yApp");var he=Object.defineProperty,j=O((n,e)=>he(n,"name",{value:e,configurable:!0}),"i$1");const fe={critical:"text-destructive",minor:"text-muted-foreground",moderate:"text-warning-foreground",serious:"text-warning-foreground"},be={critical:"Crit",minor:"Min",moderate:"Mod",serious:"Ser"},xe=j(n=>{const e=new Date(n).getTime();if(Number.isNaN(e))return"unknown";const a=Math.max(0,Math.floor((Date.now()-e)/1e3));if(a<10)return"just now";if(a<60)return`${a}s ago`;const r=Math.floor(a/60);return r<60?`${r} min ago`:`${Math.floor(r/60)} hr ago`},"formatElapsed"),ve=j(n=>{const[e,a]=k(C(()=>c.getState()),"state");L(()=>c.subscribe(()=>a(c.getState())),[]);const{isScanning:r,issues:o,lastScan:m,showOverlays:$}=e,w=o.length,v={critical:0,minor:0,moderate:0,serious:0};for(const u of o)v[u.impact]=(v[u.impact]??0)+1;const p=j(u=>v[u],"countBy");let f;r?f="Scanning…":m?f="Re-scan":f="Scan";const b=$?"border-primary/30 text-primary bg-primary/8":"border-border text-muted-foreground bg-transparent hover:text-foreground",h=o.length===0?"border-border/50 text-muted-foreground/40 bg-transparent cursor-not-allowed":d("cursor-pointer",b);return i("div",{class:"space-y-3 min-w-[200px]",children:[m?i(W,{children:[i("div",{class:"flex items-baseline gap-2",children:[t("span",{class:d("text-2xl font-bold tabular-nums leading-none",w>0?"text-destructive":"text-success-foreground"),children:w}),i("span",{class:"text-[0.65rem] text-muted-foreground",children:["violation",w===1?"":"s"]})]}),t("div",{class:"grid grid-cols-4 gap-1.5",children:E.map(u=>i("div",{class:"flex flex-col items-center gap-0.5",children:[t("span",{class:d("text-[0.85rem] font-bold tabular-nums leading-none",fe[u]),children:p(u)}),t("span",{class:"text-[0.55rem] uppercase tracking-wide text-muted-foreground/70",children:be[u]})]},u))}),i("p",{class:"text-[0.62rem] text-muted-foreground/50",children:["Scanned ",xe(m)]})]}):i("div",{children:[t("p",{class:"text-[0.72rem] text-muted-foreground",children:"No scan run yet."}),t("p",{class:"text-[0.65rem] text-muted-foreground/50 mt-0.5",children:"Scan this page to detect WCAG violations."})]}),i("div",{class:"flex items-center gap-2 pt-2 border-t border-border/50",children:[t("button",{class:d("flex-1 px-2.5 py-1.5 text-[0.7rem] font-medium border transition-colors cursor-pointer",r?"border-primary/30 text-primary/50 bg-primary/5 cursor-not-allowed":"border-border text-foreground bg-transparent hover:bg-foreground/5"),disabled:r,onClick:j(()=>{c.scan().catch(()=>{})},"onClick"),type:"button",children:f}),t("button",{class:d("px-2.5 py-1.5 text-[0.7rem] border transition-colors",h),disabled:o.length===0,onClick:j(()=>c.setShowOverlays(!$),"onClick"),title:"Toggle visual highlights on affected elements",type:"button",children:"Overlays"})]})]})},"A11yTooltip"),$e={component:pe,icon:Y,id:"dev-toolbar:a11y",name:"Accessibility",tooltip:ve};export{$e as default};
1
+ import{addHookName as w}from"preact/devtools";import{clsx as l}from"../../packem_shared/clsx-CtZWcPHt.js";import{useState as S,useEffect as U}from"preact/hooks";import{jsxs as a,jsx as t,Fragment as G}from"preact/jsx-runtime";import v from"../../packem_shared/Button-CAKvtfij.js";import{Alert as V,AlertDescription as F}from"../../packem_shared/Alert-CZq7C43v.js";const Y=`<!-- @license lucide-static v1.17.0 - ISC -->
2
+ <svg
3
+ class="lucide lucide-accessibility"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ stroke-width="2"
11
+ stroke-linecap="round"
12
+ stroke-linejoin="round"
13
+ >
14
+ <circle cx="16" cy="4" r="1" />
15
+ <path d="m18 19 1-7-6 1" />
16
+ <path d="m5 8 3-3 5.5 3-2.36 3.5" />
17
+ <path d="M4.24 14.5a5 5 0 0 0 6.88 6" />
18
+ <path d="M13.76 17.5a5 5 0 0 0-6.88-6" />
19
+ </svg>
20
+ `,j=["critical","serious","moderate","minor"],K={critical:"rgb(239,68,68)",minor:"rgb(100,116,139)",moderate:"rgb(249,115,22)",serious:"rgb(234,179,8)"},Q={"best-practice":["best-practice"],wcag2a:["wcag2a"],wcag21aa:["wcag2a","wcag2aa","wcag21a","wcag21aa"],wcag22aa:["wcag2a","wcag2aa","wcag21a","wcag21aa","wcag22a","wcag22aa"]},P="__vdt_a11y__",X=()=>{try{const o=sessionStorage.getItem(P);if(o){const e=JSON.parse(o);if(Array.isArray(e.issues))return{issues:e.issues,lastScan:e.lastScan??void 0}}}catch{}return{issues:[],lastScan:void 0}},W=(o,e)=>{const n=o;n.dataset.vdtA11y=e,n.style.setProperty("outline",`2px solid ${K[e]}`,"important"),n.style.setProperty("outline-offset","2px","important")},$=()=>{for(const o of document.querySelectorAll("[data-vdt-a11y]")){const e=o;delete e.dataset.vdtA11y,e.style.removeProperty("outline"),e.style.removeProperty("outline-offset")}},T=o=>{$();for(const e of o)for(const n of e.nodes)try{const r=document.querySelector(n.selector);r&&W(r,e.impact)}catch{}},Z=o=>{const e=o.at(-1);return Array.isArray(e)?e.join(" "):String(e??"")},ee=(o,e)=>{const n=[];for(const r of o)e.includes(r.id)||n.push({helpUrl:r.helpUrl,id:r.id,impact:r.impact??"minor",message:r.help,nodes:r.nodes.map(i=>({html:i.html,selector:Z(i.target)})),wcagTags:r.tags.filter(i=>i.startsWith("wcag")||i==="best-practice")});return n},te=async o=>{const e=await import("axe-core"),n=typeof e.default?.run=="function"?e.default:e;if(typeof n.run!="function")throw new TypeError("axe-core could not be loaded — .run is not available");return n.run(document,{exclude:[["dev-toolbar"]],runOnly:{type:"tag",values:Q[o]}})};class re{listeners=new Set;state;constructor(){const{issues:e,lastScan:n}=X();this.state={isScanning:!1,issues:e,lastScan:n,scanError:void 0,showOverlays:!1,standard:"wcag21aa"}}clearHighlights(){$()}getState(){return this.state}highlightIssue(e){$();let n=!1;for(const r of e.nodes)try{const i=document.querySelector(r.selector);i&&(W(i,e.impact),n||(i.scrollIntoView({behavior:"smooth",block:"center"}),n=!0))}catch{}}async scan(e=[]){if(!this.state.isScanning){this.update({isScanning:!0,scanError:void 0});try{const n=await te(this.state.standard),r=ee(n.violations,e);this.update({isScanning:!1,issues:r,lastScan:new Date().toISOString()}),this.persist(),this.state.showOverlays&&T(r)}catch(n){this.update({isScanning:!1,scanError:n instanceof Error?n.message:String(n)})}}}setShowOverlays(e){this.update({showOverlays:e}),e?T(this.state.issues):$()}setStandard(e){this.update({standard:e})}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}persist(){try{sessionStorage.setItem(P,JSON.stringify({issues:this.state.issues,lastScan:this.state.lastScan}))}catch{}}update(e){this.state={...this.state,...e},this.notify()}}const c=new re,M={critical:"Critical",minor:"Minor",moderate:"Moderate",serious:"Serious"},_={critical:"text-destructive",minor:"text-muted-foreground",moderate:"text-warning-foreground",serious:"text-warning-foreground"},se={critical:"bg-destructive/10 border-destructive/30",minor:"bg-foreground/4 border-border",moderate:"bg-warning/10 border-warning/30",serious:"bg-warning/10 border-warning/30"},ne={critical:"bg-destructive",minor:"bg-muted-foreground/50",moderate:"bg-warning",serious:"bg-warning"},ae=({count:o,isActive:e,onClick:n,severity:r})=>a("button",{class:l("flex flex-col items-center gap-1 px-3 py-2.5 border cursor-pointer transition-colors",e?"ring-1 ring-inset ring-primary/40":"hover:bg-foreground/6",se[r]),onClick:n,title:`${e?"Clear":"Filter by"} ${M[r]}`,type:"button",children:[t("span",{class:l("text-xl font-bold tabular-nums leading-none",_[r]),children:o}),t("span",{class:"text-[0.6rem] font-semibold uppercase tracking-wider text-muted-foreground",children:M[r]})]}),ie=({isSelected:o,issue:e,onClick:n,onDisable:r})=>a("div",{class:l("p-3 border cursor-pointer transition-colors",o?"bg-foreground/6 border-primary/30":"border-border hover:bg-foreground/3"),onClick:n,children:[a("div",{class:"flex items-start gap-2 mb-1.5",children:[t("span",{class:l("mt-1 size-2 rounded-full shrink-0",ne[e.impact])}),t("span",{class:"text-[0.75rem] font-semibold text-foreground flex-1 leading-snug",children:e.id}),t("span",{class:l("text-[0.6rem] font-bold uppercase tracking-wide shrink-0",_[e.impact]),children:M[e.impact]})]}),t("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed mb-2 ml-4",children:e.message}),e.nodes.length>0&&a("div",{class:"mb-2 ml-4 space-y-0.5",children:[e.nodes.slice(0,3).map((i,g)=>t("code",{class:"block text-[0.65rem] text-foreground/70 font-mono bg-foreground/5 px-2 py-1 truncate",children:i.selector},g)),e.nodes.length>3&&a("span",{class:"text-[0.62rem] text-muted-foreground/60",children:["+",e.nodes.length-3," more element",e.nodes.length>4?"s":""]})]}),a("div",{class:"flex items-center gap-2 flex-wrap ml-4",children:[e.wcagTags.slice(0,3).map(i=>t("span",{class:"text-[0.58rem] font-mono uppercase bg-primary/8 text-primary/70 border border-primary/20 px-1.5 py-0.5",children:i},i)),t("span",{class:"flex-1"}),t("a",{class:"text-[0.62rem] text-primary/70 hover:text-primary transition-colors",href:e.helpUrl,onClick:i=>i.stopPropagation(),rel:"noopener noreferrer",target:"_blank",children:"Learn more ↗"}),t("button",{class:"text-[0.62rem] text-muted-foreground/60 hover:text-muted-foreground transition-colors cursor-pointer bg-transparent border-0 p-0",onClick:i=>{i.stopPropagation(),r(e.id)},title:"Disable this rule for current session",type:"button",children:"Disable"})]})]}),oe=o=>{const[e,n]=w(S(()=>c.getState()),"storeState"),[r,i]=w(S([]),"disabledRules"),[g,C]=w(S(void 0),"minSeverity"),[y,b]=w(S(void 0),"activeIssueId"),[m,h]=w(S(void 0),"filterSeverity");U(()=>c.subscribe(()=>n(c.getState())),[]),U(()=>c.clearHighlights.bind(c),[]);const{isScanning:f,issues:p,lastScan:d,scanError:A,showOverlays:R,standard:H}=e,E=d!==void 0||A!==void 0,I=()=>{h(void 0),b(void 0),c.scan(r).catch(()=>{})},J=s=>{y===s.id?(b(void 0),c.clearHighlights(),R&&c.setShowOverlays(!0)):(b(s.id),c.highlightIssue(s))},z=s=>{i(u=>[...u,s])},O=p.filter(s=>!(r.includes(s.id)||m&&s.impact!==m||g&&j.indexOf(s.impact)>j.indexOf(g))),B=s=>p.filter(u=>!r.includes(u.id)&&u.impact===s).length;return a("div",{class:"flex flex-col h-full",children:[a("div",{class:"shrink-0 flex items-center gap-2 px-4 py-2.5 border-b border-border bg-foreground/2 flex-wrap",children:[t(v,{class:l(f?"border-primary/30 text-primary/50 bg-primary/5":""),disabled:f,onClick:I,size:"sm",variant:"outline",children:f?"Scanning…":"Scan page"}),a("label",{class:"flex items-center gap-1.5 text-[0.7rem] text-muted-foreground",children:["Standard",a("select",{class:"bg-card border border-border text-foreground text-[0.7rem] px-1.5 py-1 cursor-pointer",onChange:s=>c.setStandard(s.target.value),style:"color-scheme: dark",value:H,children:[t("option",{value:"wcag21aa",children:"WCAG 2.1 AA"}),t("option",{value:"wcag22aa",children:"WCAG 2.2 AA"}),t("option",{value:"wcag2a",children:"WCAG 2.0 A"}),t("option",{value:"best-practice",children:"Best Practice"})]})]}),a("label",{class:"flex items-center gap-1.5 text-[0.7rem] text-muted-foreground",children:["Min",a("select",{class:"bg-card border border-border text-foreground text-[0.7rem] px-1.5 py-1 cursor-pointer",onChange:s=>{const{value:u}=s.target;C(u||void 0)},style:"color-scheme: dark",value:g??"",children:[t("option",{value:"",children:"All"}),t("option",{value:"critical",children:"Critical only"}),t("option",{value:"serious",children:"Serious+"}),t("option",{value:"moderate",children:"Moderate+"})]})]}),t(v,{class:l(R?"border-primary/30 text-primary bg-primary/8":""),onClick:()=>c.setShowOverlays(!R),size:"sm",title:"Toggle visual highlights on affected elements",variant:"outline",children:"Overlays"}),E&&p.length>0&&a(G,{children:[t(v,{class:"ml-auto",onClick:()=>{const s=new Blob([JSON.stringify(p,void 0,2)],{type:"application/json"}),u=URL.createObjectURL(s),k=document.createElement("a");k.href=u,k.download="a11y-audit.json",k.click(),URL.revokeObjectURL(u)},size:"sm",title:"Export audit results as JSON",variant:"outline",children:"JSON"}),t(v,{onClick:()=>{const s=x=>`"${x.replaceAll('"','""')}"`,u=["Rule ID","Severity","Message","Selector","HTML","WCAG Tags"].join(","),k=p.flatMap(x=>x.nodes.map(D=>[s(x.id),s(x.impact),s(x.message),s(D.selector),s(D.html),s(x.wcagTags.join("; "))].join(","))),q=new Blob([[u,...k].join(`
21
+ `)],{type:"text/csv"}),L=URL.createObjectURL(q),N=document.createElement("a");N.href=L,N.download="a11y-audit.csv",N.click(),URL.revokeObjectURL(L)},size:"sm",title:"Export audit results as CSV",variant:"outline",children:"CSV"})]})]}),a("div",{class:"flex-1 overflow-y-auto devtools-content-scroll",children:[A&&t(V,{class:"rounded-none border-x-0 border-t-0",variant:"destructive",children:a(F,{children:["Scan failed: ",A]})}),!E&&!f&&a("div",{class:"flex flex-col items-center justify-center gap-4 p-8 min-h-48 text-center",children:[t("p",{class:"text-[0.8125rem] text-muted-foreground max-w-sm",children:"Run an accessibility audit using axe-core to detect WCAG violations on this page."}),t(v,{onClick:I,variant:"outline",children:"Start scan"})]}),f&&t("div",{class:"flex items-center justify-center gap-3 p-8 min-h-48",children:t("span",{class:"text-[0.8rem] text-muted-foreground",children:"Scanning for accessibility issues…"})}),E&&!f&&!A&&a("div",{class:"p-5 space-y-4",children:[t("div",{class:"grid grid-cols-4 gap-2",children:j.map(s=>t(ae,{count:B(s),isActive:m===s,onClick:()=>h(m===s?void 0:s),severity:s},s))}),O.length===0?a("div",{class:"p-6 text-center border border-border",children:[t("p",{class:"text-[0.8125rem] font-medium text-foreground/70",children:p.length===0?"No violations found!":"No issues match the current filters."}),p.length===0&&t("p",{class:"mt-1 text-[0.7rem] text-muted-foreground",children:"Great — the page passes all rules for the selected standard."})]}):a("section",{children:[a("div",{class:"flex items-center gap-2 mb-2",children:[a("span",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground",children:[t("span",{"aria-hidden":"true",class:"text-primary/50",children:"//"})," ",O.length," issue",O.length===1?"":"s",m?` · ${M[m]} only`:""]}),m&&t(v,{class:"h-auto p-0 text-[0.62rem]",onClick:()=>h(void 0),variant:"link",children:"Clear ×"})]}),t("div",{class:"space-y-2",children:O.map(s=>t(ie,{isSelected:y===s.id,issue:s,onClick:()=>J(s),onDisable:z},s.id))})]}),r.length>0&&a("div",{class:"flex items-center gap-2 text-[0.65rem] text-muted-foreground/60",children:[a("span",{children:[r.length," rule",r.length===1?"":"s"," disabled this session."]}),t(v,{class:"h-auto p-0 text-[0.62rem]",onClick:()=>i([]),variant:"link",children:"Reset"})]})]})]})]})},ce={critical:"text-destructive",minor:"text-muted-foreground",moderate:"text-warning-foreground",serious:"text-warning-foreground"},le={critical:"Crit",minor:"Min",moderate:"Mod",serious:"Ser"},de=o=>{const e=new Date(o).getTime();if(Number.isNaN(e))return"unknown";const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<10)return"just now";if(n<60)return`${n}s ago`;const r=Math.floor(n/60);return r<60?`${r} min ago`:`${Math.floor(r/60)} hr ago`},ue=o=>{const[e,n]=w(S(()=>c.getState()),"state");U(()=>c.subscribe(()=>n(c.getState())),[]);const{isScanning:r,issues:i,lastScan:g,showOverlays:C}=e,y=i.length,b={critical:0,minor:0,moderate:0,serious:0};for(const d of i)b[d.impact]=(b[d.impact]??0)+1;const m=d=>b[d];let h;r?h="Scanning…":g?h="Re-scan":h="Scan";const f=C?"border-primary/30 text-primary bg-primary/8":"border-border text-muted-foreground bg-transparent hover:text-foreground",p=i.length===0?"border-border/50 text-muted-foreground/40 bg-transparent cursor-not-allowed":l("cursor-pointer",f);return a("div",{class:"space-y-3 min-w-[200px]",children:[g?a(G,{children:[a("div",{class:"flex items-baseline gap-2",children:[t("span",{class:l("text-2xl font-bold tabular-nums leading-none",y>0?"text-destructive":"text-success-foreground"),children:y}),a("span",{class:"text-[0.65rem] text-muted-foreground",children:["violation",y===1?"":"s"]})]}),t("div",{class:"grid grid-cols-4 gap-1.5",children:j.map(d=>a("div",{class:"flex flex-col items-center gap-0.5",children:[t("span",{class:l("text-[0.85rem] font-bold tabular-nums leading-none",ce[d]),children:m(d)}),t("span",{class:"text-[0.55rem] uppercase tracking-wide text-muted-foreground/70",children:le[d]})]},d))}),a("p",{class:"text-[0.62rem] text-muted-foreground/50",children:["Scanned ",de(g)]})]}):a("div",{children:[t("p",{class:"text-[0.72rem] text-muted-foreground",children:"No scan run yet."}),t("p",{class:"text-[0.65rem] text-muted-foreground/50 mt-0.5",children:"Scan this page to detect WCAG violations."})]}),a("div",{class:"flex items-center gap-2 pt-2 border-t border-border/50",children:[t("button",{class:l("flex-1 px-2.5 py-1.5 text-[0.7rem] font-medium border transition-colors cursor-pointer",r?"border-primary/30 text-primary/50 bg-primary/5 cursor-not-allowed":"border-border text-foreground bg-transparent hover:bg-foreground/5"),disabled:r,onClick:()=>{c.scan().catch(()=>{})},type:"button",children:h}),t("button",{class:l("px-2.5 py-1.5 text-[0.7rem] border transition-colors",p),disabled:i.length===0,onClick:()=>c.setShowOverlays(!C),title:"Toggle visual highlights on affected elements",type:"button",children:"Overlays"})]})]})},xe={component:oe,icon:Y,id:"dev-toolbar:a11y",name:"Accessibility",tooltip:ue};export{xe as default};
@@ -0,0 +1,4 @@
1
+ import { D as DevToolbarApp } from "../../packem_shared/app.d-SmKEDxsI.js";
2
+ import 'preact';
3
+ declare const annotationsApp: DevToolbarApp;
4
+ export { annotationsApp as default };
@@ -0,0 +1,18 @@
1
+ import{addHookName as d}from"preact/devtools";import{clsx as p}from"../../packem_shared/clsx-CtZWcPHt.js";import{useState as c,useCallback as C,useEffect as O}from"preact/hooks";import{l as P,M as T,s as j}from"../../packem_shared/annotation-settings-DlLZO5Zp.js";import{jsx as e,jsxs as r}from"preact/jsx-runtime";import u from"../../packem_shared/Button-CAKvtfij.js";import Q from"../../packem_shared/Textarea-DP9gpte-.js";const U=`<!-- @license lucide-static v1.17.0 - ISC -->
2
+ <svg
3
+ class="lucide lucide-message-square-plus"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ stroke-width="2"
11
+ stroke-linecap="round"
12
+ stroke-linejoin="round"
13
+ >
14
+ <path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" />
15
+ <path d="M12 8v6" />
16
+ <path d="M9 11h6" />
17
+ </svg>
18
+ `,B={approve:"Approve",change:"Change",fix:"Fix",question:"Question"},I={approve:"bg-green-500/20 text-green-400 border-green-500/30",change:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",fix:"bg-destructive/20 text-destructive border-destructive/30",question:"bg-blue-500/20 text-blue-400 border-blue-500/30"},M={blocking:"Blocking",important:"Important",suggestion:"Suggestion"},z={blocking:"text-destructive",important:"text-warning-foreground",suggestion:"text-muted-foreground"},S={acknowledged:"Acknowledged",dismissed:"Dismissed",pending:"Pending",resolved:"Resolved"},H=({active:t,counts:o,onFilter:l})=>e("div",{class:"flex gap-1.5",children:["all","pending","acknowledged","resolved","dismissed"].map(n=>r("button",{class:p("px-2.5 py-1 text-[0.65rem] font-medium border cursor-pointer transition-colors",t===n?"bg-primary/10 border-primary/30 text-primary":"bg-foreground/3 border-border text-muted-foreground hover:bg-foreground/6"),onClick:()=>l(n),type:"button",children:[n==="all"?"All":S[n]," (",o[n],")"]},n))}),V=({annotation:t,isSelected:o,onClick:l,onDelete:n,onDismiss:i,onResolve:h})=>r("div",{class:p("p-3 border cursor-pointer transition-colors",o?"bg-foreground/6 border-primary/30":"border-border hover:bg-foreground/3"),onClick:l,children:[r("div",{class:"flex items-start gap-2 mb-1.5",children:[e("span",{class:p("text-[0.6rem] font-bold uppercase px-1.5 py-0.5 border shrink-0",I[t.intent]),children:B[t.intent]}),e("span",{class:p("text-[0.6rem] font-semibold uppercase tracking-wide shrink-0",z[t.severity]),children:M[t.severity]}),e("span",{class:"flex-1"}),t.resolvedBy&&r("span",{class:"text-[0.58rem] text-muted-foreground/60",children:["by ",t.resolvedBy]}),e("span",{class:"text-[0.58rem] text-muted-foreground/60",children:S[t.status]})]}),e("p",{class:"text-[0.7rem] text-foreground leading-relaxed mb-1.5 line-clamp-2",children:t.comment}),e("div",{class:"flex items-center gap-2 mb-1.5",children:r("code",{class:"text-[0.62rem] text-foreground/60 font-mono bg-foreground/5 px-1.5 py-0.5 truncate",children:[t.elementTag,t.elementPath?` · ${t.elementPath}`:""]})}),t.source&&e("div",{class:"mb-1.5",children:e("code",{class:"text-[0.6rem] text-primary/60 font-mono",children:t.source})}),e("div",{class:"text-[0.58rem] text-muted-foreground/50 truncate mb-2",children:t.url}),t.thread&&t.thread.length>0&&r("div",{class:"text-[0.6rem] text-muted-foreground/60 mb-2",children:[t.thread.length," message",t.thread.length===1?"":"s"," in thread"]}),t.status==="pending"&&r("div",{class:"flex items-center gap-1.5",onClick:m=>m.stopPropagation(),children:[e(u,{class:"h-auto py-0.5 px-2 text-[0.6rem]",onClick:h,size:"sm",variant:"outline",children:"Resolve"}),e(u,{class:"h-auto py-0.5 px-2 text-[0.6rem]",onClick:i,size:"sm",variant:"outline",children:"Dismiss"}),e("span",{class:"flex-1"}),e(u,{class:"h-auto py-0.5 px-2 text-[0.6rem] text-destructive hover:text-destructive",onClick:n,size:"sm",variant:"ghost",children:"Delete"})]})]}),K=({annotation:t,helpers:o,onBack:l,onRefresh:n})=>{const[i,h]=d(c(""),"message"),m=C(async()=>{const a=i.trim();a&&(await o.rpc.updateAnnotation?.(t.id,{threadMessage:{content:a,role:"human",timestamp:new Date().toISOString()}}),h(""),n())},[t.id,o,i,n]);return r("div",{class:"p-4 space-y-3",children:[e(u,{class:"h-auto py-0.5 px-2 text-[0.65rem]",onClick:l,size:"sm",variant:"ghost",children:"← Back"}),r("div",{class:"flex items-center gap-2 flex-wrap",children:[e("span",{class:p("text-[0.65rem] font-bold uppercase px-2 py-0.5 border",I[t.intent]),children:B[t.intent]}),e("span",{class:p("text-[0.65rem] font-semibold",z[t.severity]),children:M[t.severity]}),e("span",{class:"text-[0.6rem] text-muted-foreground ml-auto",children:S[t.status]})]}),e("div",{class:"text-[0.75rem] text-foreground leading-relaxed border border-border p-3",children:t.comment}),r("div",{class:"space-y-1 text-[0.65rem]",children:[r("div",{class:"flex gap-2",children:[e("span",{class:"text-muted-foreground w-16 shrink-0",children:"Element"}),r("code",{class:"text-foreground/70 font-mono",children:[t.elementTag,t.cssClasses?` .${t.cssClasses}`:""]})]}),t.source&&r("div",{class:"flex gap-2",children:[e("span",{class:"text-muted-foreground w-16 shrink-0",children:"Source"}),e("code",{class:"text-primary/70 font-mono",children:t.source})]}),r("div",{class:"flex gap-2",children:[e("span",{class:"text-muted-foreground w-16 shrink-0",children:"URL"}),e("span",{class:"text-foreground/60 truncate",children:t.url})]}),r("div",{class:"flex gap-2",children:[e("span",{class:"text-muted-foreground w-16 shrink-0",children:"Created"}),e("span",{class:"text-foreground/60",children:new Date(t.createdAt).toLocaleString()})]})]}),r("div",{children:[r("div",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground mb-2",children:[e("span",{"aria-hidden":"true",class:"text-primary/50",children:"// "}),"Thread (",t.thread?.length??0,")"]}),t.thread&&t.thread.length>0&&e("div",{class:"space-y-2 mb-3",children:t.thread.map(a=>r("div",{class:"border border-border p-2",children:[r("div",{class:"flex items-center gap-2 mb-1",children:[e("span",{class:"text-[0.62rem] font-semibold text-primary/70",children:a.role}),e("span",{class:"text-[0.55rem] text-muted-foreground/50",children:new Date(a.timestamp).toLocaleString()})]}),e("p",{class:"text-[0.68rem] text-foreground/80 leading-relaxed whitespace-pre-wrap",children:a.content})]},`${a.role}-${a.timestamp}`))}),r("div",{class:"space-y-2",children:[e(Q,{class:"text-[0.7rem] min-h-[60px]",onChange:a=>h(a.target.value),placeholder:"Add a message to the thread...",value:i}),e(u,{class:"text-[0.65rem]",disabled:!i.trim(),onClick:m,size:"sm",variant:"outline",children:"Send"})]})]})]})},Y=({onChange:t,settings:o})=>{const l=n=>{const i={...o,...n};j(i),t(i)};return r("div",{class:"space-y-3 p-4 border-t border-border",children:[r("div",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground",children:[e("span",{"aria-hidden":"true",class:"text-primary/50",children:"// "}),"Settings"]}),r("label",{class:"flex items-center gap-2 text-[0.7rem] text-foreground",children:[e("span",{class:"text-muted-foreground w-24 shrink-0",children:"Output Detail"}),r("select",{class:"flex-1 bg-card border border-border text-foreground text-[0.65rem] px-1.5 py-1 cursor-pointer",onChange:n=>l({outputDetail:n.target.value}),style:"color-scheme: dark",value:o.outputDetail,children:[e("option",{value:"compact",children:"Compact"}),e("option",{value:"standard",children:"Standard"}),e("option",{value:"detailed",children:"Detailed"}),e("option",{value:"forensic",children:"Forensic"})]})]}),r("div",{class:"flex items-center gap-2 text-[0.7rem]",children:[e("span",{class:"text-muted-foreground w-24 shrink-0",children:"Marker Color"}),e("div",{class:"flex gap-1.5",children:T.map(n=>e("button",{class:p("w-5 h-5 rounded-full border-2 cursor-pointer p-0 transition-all",n.name===o.markerColorName?"border-foreground scale-110":"border-transparent hover:scale-110"),onClick:()=>l({markerColorName:n.name}),style:{background:n.bg},title:n.label,type:"button"},n.name))})]}),r("label",{class:"flex items-center gap-2 text-[0.7rem] text-foreground",children:[e("span",{class:"text-muted-foreground w-24 shrink-0",children:"Marker Click"}),r("select",{class:"flex-1 bg-card border border-border text-foreground text-[0.65rem] px-1.5 py-1 cursor-pointer",onChange:n=>l({markerClickBehavior:n.target.value}),style:"color-scheme: dark",value:o.markerClickBehavior,children:[e("option",{value:"detail",children:"Show Detail"}),e("option",{value:"edit",children:"Edit"}),e("option",{value:"delete",children:"Delete"})]})]}),r("label",{class:"flex items-center gap-2 text-[0.7rem] text-foreground cursor-pointer",children:[e("input",{checked:o.blockInteractions,class:"cursor-pointer",onChange:n=>l({blockInteractions:n.target.checked}),type:"checkbox"}),e("span",{children:"Block page interactions while inspecting"})]})]})},_=({helpers:t})=>{const[o,l]=d(c([]),"annotations"),[n,i]=d(c(!1),"loading"),[h,m]=d(c(),"error"),[a,E]=d(c("pending"),"filterStatus"),[v,F]=d(c("all"),"filterIntent"),[b,D]=d(c(),"selectedId"),[k,$]=d(c(!1),"showSettings"),[L,N]=d(c(()=>P()),"settings"),g=C(async()=>{i(!0),m(void 0);try{const s=await t.rpc.getAnnotations?.();l(s??[])}catch(s){m(s instanceof Error?s.message:String(s))}finally{i(!1)}},[t]);O(()=>{g().catch(()=>{})},[g]);const A=o.filter(s=>!(a!=="all"&&s.status!==a||v!=="all"&&s.intent!==v)),f=s=>o.filter(x=>x.status===s).length,q={acknowledged:f("acknowledged"),all:o.length,dismissed:f("dismissed"),pending:f("pending"),resolved:f("resolved")},R=b?o.find(s=>s.id===b):void 0,y=C(async(s,x)=>{try{await(x==="delete"?t.rpc.deleteAnnotation?.(s):t.rpc.updateAnnotation?.(s,{status:x==="resolve"?"resolved":"dismissed"})),await g()}catch(w){console.error(`[annotations] ${x} failed for ${s}:`,w),m(w instanceof Error?w.message:`Failed to ${x} annotation`)}},[t,g]);return R?e(K,{annotation:R,helpers:t,onBack:()=>D(void 0),onRefresh:()=>g().catch(()=>{})}):r("div",{class:"flex flex-col h-full",children:[r("div",{class:"shrink-0 flex items-center gap-2 px-4 py-2.5 border-b border-border bg-foreground/2 flex-wrap",children:[e(u,{disabled:n,onClick:()=>g().catch(()=>{}),size:"sm",variant:"outline",children:n?"Loading…":"Refresh"}),e(u,{class:p("text-[0.65rem]",k&&"bg-primary/10 text-primary"),onClick:()=>$(!k),size:"sm",variant:"ghost",children:"Settings"}),e("span",{class:"flex-1"}),r("select",{class:"bg-card border border-border text-foreground text-[0.65rem] px-1.5 py-1 cursor-pointer",onChange:s=>F(s.target.value),style:"color-scheme: dark",value:v,children:[e("option",{value:"all",children:"All intents"}),e("option",{value:"fix",children:"Fix"}),e("option",{value:"change",children:"Change"}),e("option",{value:"question",children:"Question"}),e("option",{value:"approve",children:"Approve"})]})]}),r("div",{class:"flex-1 overflow-y-auto devtools-content-scroll",children:[h&&e("div",{class:"p-3 text-[0.7rem] text-destructive bg-destructive/10 border-b border-destructive/20",children:h}),r("div",{class:"p-4 space-y-3",children:[e(H,{active:a,counts:q,onFilter:E}),A.length===0?r("div",{class:"p-6 text-center border border-border",children:[e("p",{class:"text-[0.8125rem] font-medium text-foreground/70",children:o.length===0?"No annotations yet":"No annotations match filters"}),e("p",{class:"mt-1 text-[0.7rem] text-muted-foreground",children:o.length===0?'Use the Inspector to click an element and select "Annotate".':"Try changing the status or intent filter."})]}):e("div",{class:"space-y-2",children:A.map(s=>e(V,{annotation:s,isSelected:b===s.id,onClick:()=>D(s.id),onDelete:()=>y(s.id,"delete").catch(()=>{}),onDismiss:()=>y(s.id,"dismiss").catch(()=>{}),onResolve:()=>y(s.id,"resolve").catch(()=>{})},s.id))})]})]}),k&&e(Y,{onChange:N,settings:L})]})},re={component:_,icon:U,id:"dev-toolbar:annotations",name:"Annotations"};export{re as default};
@@ -0,0 +1,4 @@
1
+ import { D as DevToolbarApp } from "../../packem_shared/app.d-SmKEDxsI.js";
2
+ import 'preact';
3
+ declare const assetsApp: DevToolbarApp;
4
+ export { assetsApp as default };
@@ -0,0 +1,16 @@
1
+ import{addHookName as n}from"preact/devtools";import{clsx as c}from"../../packem_shared/clsx-CtZWcPHt.js";import{useState as a,useRef as N,useEffect as k}from"preact/hooks";import{jsxs as l,jsx as e}from"preact/jsx-runtime";import d from"../../packem_shared/Button-CAKvtfij.js";import R from"../../packem_shared/Input-Dc1WiT01.js";const H=`<!-- @license lucide-static v1.17.0 - ISC -->
2
+ <svg
3
+ class="lucide lucide-folder-open"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ stroke-width="2"
11
+ stroke-linecap="round"
12
+ stroke-linejoin="round"
13
+ >
14
+ <path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />
15
+ </svg>
16
+ `,P=t=>!Number.isFinite(t)||t<0?"–":t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`,j=t=>t.startsWith("/")&&!t.includes(":")?t:"#",I=[{label:"All",value:"all"},{label:"Images",value:"image"},{label:"Videos",value:"video"},{label:"Audio",value:"audio"},{label:"Fonts",value:"font"},{label:"Text",value:"text"},{label:"Other",value:"other"}],$={audio:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",font:"bg-orange-500/15 text-orange-400 border-orange-500/30",image:"bg-blue-500/15 text-blue-400 border-blue-500/30",other:"bg-foreground/6 text-muted-foreground border-border",text:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",video:"bg-purple-500/15 text-purple-400 border-purple-500/30"},C=({type:t})=>e("span",{class:c("inline-flex px-1.5 py-0.5 text-[0.6rem] font-mono font-bold uppercase border",$[t]),children:t}),E=({asset:t})=>{const i=j(t.publicPath);if(i!=="#"){if(t.type==="image")return e("div",{class:"flex items-center justify-center bg-foreground/4 border border-border h-32 overflow-hidden",children:e("img",{alt:t.publicPath,class:"max-w-full max-h-full object-contain",onError:u=>{u.target.style.display="none"},src:i})});if(t.type==="video")return e("div",{class:"flex items-center justify-center bg-foreground/4 border border-border h-32 overflow-hidden",children:e("video",{class:"max-w-full max-h-full",preload:"metadata",src:i})});if(t.type==="audio")return e("div",{class:"flex items-center justify-center bg-foreground/4 border border-border h-14 px-2",children:e("audio",{class:"w-full",controls:!0,preload:"none",src:i})})}},M=({helpers:t})=>{const[i,u]=n(a([]),"assets"),[z,p]=n(a(!0),"loading"),[x,g]=n(a(void 0),"error"),[v,F]=n(a(""),"search"),[s,T]=n(a("all"),"typeFilter"),[o,f]=n(a(void 0),"selected"),[A,y]=n(a(!1),"copied"),b=n(N(void 0),"copyTimerRef");k(()=>()=>{clearTimeout(b.current)},[]);const m=()=>{p(!0),g(void 0),f(void 0),t.rpc.getStaticAssets().then(r=>{u(r),p(!1)}).catch(r=>{g(r.message??"Failed to load assets"),p(!1)})};k(()=>{m()},[]);const h=i.filter(r=>{const w=v.toLowerCase(),L=!w||r.publicPath.toLowerCase().includes(w),B=s==="all"||r.type===s;return L&&B}),S=r=>{navigator.clipboard.writeText(r.publicPath).then(()=>{clearTimeout(b.current),y(!0),b.current=setTimeout(y,1500,!1)}).catch(()=>{})};return z?l("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[e("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(r=>e("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${r}ms`}},r))}),e("span",{class:"text-[0.75rem] text-muted-foreground",children:"Scanning assets…"})]}):x?l("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[e("p",{class:"text-[0.8rem] text-destructive",children:x}),e(d,{onClick:m,size:"sm",variant:"outline",children:"Retry"})]}):l("div",{class:"flex flex-col h-full",children:[l("div",{class:"flex items-center gap-2 px-4 py-2.5 border-b border-border shrink-0 flex-wrap",children:[e(R,{class:"flex-1 min-w-32 bg-foreground/4 font-mono text-[0.8rem] placeholder:text-muted-foreground/50 focus-visible:border-primary/50 border-border",onInput:r=>{F(r.target.value)},placeholder:"Filter assets…",type:"text",value:v}),l("span",{class:"text-[0.7rem] text-muted-foreground shrink-0",children:[h.length," / ",i.length]}),e(d,{onClick:m,size:"sm",variant:"outline",children:"Refresh"})]}),e("div",{"aria-label":"Filter by type",class:"flex items-center gap-1.5 px-4 py-2 border-b border-border shrink-0 flex-wrap",role:"group",children:I.map(r=>e("button",{"aria-pressed":s===r.value,class:c("px-2.5 py-0.5 text-[0.7rem] font-medium border cursor-pointer transition-colors duration-100",s===r.value?"bg-primary/15 text-primary border-primary/30":"bg-foreground/4 text-muted-foreground border-border hover:bg-foreground/8 hover:text-foreground"),onClick:()=>{T(r.value)},type:"button",children:r.label},r.value))}),l("div",{class:"flex flex-1 min-h-0 overflow-hidden",children:[e("div",{class:"flex-1 overflow-auto divide-y divide-border/30",role:"list",children:h.length===0?e("div",{class:"flex items-center justify-center p-8 text-[0.8rem] text-muted-foreground",children:i.length===0?"No assets found in public directory.":"No assets match the current filter."}):h.map(r=>l("button",{"aria-label":r.publicPath,"aria-selected":o?.publicPath===r.publicPath,class:c("w-full flex items-center gap-3 px-4 py-2.5 text-left border-0 bg-transparent cursor-pointer","hover:bg-foreground/4 transition-colors duration-100",o?.publicPath===r.publicPath&&"bg-primary/6"),onClick:()=>{f(o?.publicPath===r.publicPath?void 0:r)},role:"option",type:"button",children:[e(C,{type:r.type}),e("span",{class:"flex-1 text-[0.775rem] font-mono text-foreground/80 truncate min-w-0",children:r.publicPath}),e("span",{class:"shrink-0 text-[0.65rem] text-muted-foreground",children:P(r.size)})]},r.publicPath))}),o&&l("div",{class:"border-l border-border bg-background w-72 shrink-0 flex flex-col overflow-hidden",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border shrink-0",children:[e("span",{class:"text-[0.7rem] font-semibold text-foreground uppercase tracking-wide",children:"Asset Info"}),e(d,{"aria-label":"Close",class:"h-6 w-6 text-xs",onClick:()=>{f(void 0)},size:"icon",variant:"ghost",children:"✕"})]}),l("div",{class:"flex-1 overflow-auto p-4 space-y-4",children:[e(E,{asset:o}),l("div",{children:[e("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Path"}),e("code",{class:"text-[0.7rem] font-mono text-foreground/80 break-all",children:o.publicPath})]}),l("div",{children:[e("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Type"}),e(C,{type:o.type})]}),l("div",{children:[e("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Size"}),e("span",{class:"text-[0.8rem] font-mono text-foreground",children:P(o.size)})]}),l("div",{children:[e("div",{class:"text-[0.6rem] uppercase tracking-wider text-muted-foreground mb-1",children:"Last Modified"}),e("span",{class:"text-[0.75rem] text-foreground/80",children:new Date(o.mtime).toLocaleString()})]}),l("div",{class:"flex flex-col gap-2 pt-1",children:[e(d,{class:"w-full text-[0.75rem]",onClick:()=>{S(o)},size:"sm",variant:"outline",children:A?"Copied!":"Copy URL"}),e("a",{class:c("w-full text-[0.75rem] inline-flex items-center justify-center","px-3 py-1.5 border border-border bg-transparent","text-foreground hover:bg-foreground/6 transition-colors duration-100"),href:j(o.publicPath),rel:"noopener noreferrer",target:"_blank",children:"Open in browser"})]})]})]})]})]})},W={component:M,icon:H,id:"dev-toolbar:assets",name:"Assets"};export{W as default};
@@ -1,3 +1,4 @@
1
- import type { DevToolbarApp } from "../../types/app.d.ts";
1
+ import { D as DevToolbarApp } from "../../packem_shared/app.d-SmKEDxsI.js";
2
+ import 'preact';
2
3
  declare const inspectorApp: DevToolbarApp;
3
- export default inspectorApp;
4
+ export { inspectorApp as default };
@@ -1 +1,30 @@
1
- var I=Object.defineProperty;var w=(t,e)=>I(t,"name",{value:e,configurable:!0});import A from"lucide-static/icons/inspect.svg?raw";var q=Object.defineProperty,s=w((t,e)=>q(t,"name",{value:e,configurable:!0}),"s");const E={bg:"#18181b",btnBg:"rgba(196,181,253,0.08)",btnBgHover:"rgba(196,181,253,0.16)",btnBorder:"rgba(196,181,253,0.25)",btnBorderHover:"rgba(196,181,253,0.5)",fg:"#fafafa",muted:"#a1a1aa",overlayBg:"rgba(196,181,253,0.06)",overlayBorder:"rgba(196,181,253,0.7)",primary:"#c4b5fd",shadow:"0 8px 32px rgba(0,0,0,.75)"},k={bg:"#ffffff",btnBg:"rgba(124,58,237,0.08)",btnBgHover:"rgba(124,58,237,0.16)",btnBorder:"rgba(124,58,237,0.25)",btnBorderHover:"rgba(124,58,237,0.5)",fg:"#18181b",muted:"#52525b",overlayBg:"rgba(124,58,237,0.06)",overlayBorder:"rgba(124,58,237,0.7)",primary:"#7c3aed",shadow:"0 8px 32px rgba(0,0,0,.15)"},y=s(()=>{try{const t=localStorage.getItem("__v_dt__theme");if(t==="light")return k;if(t==="dark")return E}catch{}return globalThis.window?.matchMedia("(prefers-color-scheme: dark)").matches?E:k},"getThemePalette"),v="__vdt_inspector_overlay",T="__vdt_inspector_label",h="__vdt_inspector_cursor",$="__vdt_inspector_badge",B="__vdt_inspector_kf",S="__vdt_inspector_result",j=s(()=>{let t=document.querySelector(`#${v}`);if(!t){const e=y();t=document.createElement("div"),t.id=v,t.style.cssText=["position:fixed","pointer-events:none","z-index:2147483644","box-sizing:border-box",`border:1px solid ${e.overlayBorder}`,`background:${e.overlayBg}`,"transition:top 60ms,left 60ms,width 60ms,height 60ms","display:none"].join(";");const o=document.createElement("div");o.id=T,o.style.cssText=["position:absolute","bottom:calc(100% + 2px)","left:0",`background:${e.bg}`,`color:${e.primary}`,"font:11px/1.2 'JetBrains Mono',monospace","padding:2px 6px","white-space:nowrap","pointer-events:none",`border:1px solid ${e.btnBorder}`].join(";"),t.append(o),document.body.append(t)}return t},"getOrCreateOverlay"),M=s(t=>{let e=t;for(;e;){const o=e.dataset.vdtSource;if(o)return o;e=e.parentElement??void 0}},"findSource"),D=s(t=>{const e=t.split(":");if(e.length<3)return t;const o=e[e.length-2],n=e.slice(0,-2).join(":");return`${n.split("/").pop()??n}:${o}`},"formatSourceShort"),H=s(t=>{const e=document.querySelector(`#${v}`);if(!e)return;const o=t.getBoundingClientRect();e.style.display="block",e.style.top=`${o.top}px`,e.style.left=`${o.left}px`,e.style.width=`${o.width}px`,e.style.height=`${o.height}px`;const n=document.querySelector(`#${T}`);if(n){const r=t.tagName.toLowerCase(),c=t.id?`#${t.id}`:"",d=t.classList.length>0?`.${[...t.classList].slice(0,3).join(".")}`:"",l=`${r}${c}${d}`,g=M(t);n.textContent=g?`${l} · ${D(g)}`:l,o.top<28?(n.style.bottom="auto",n.style.top="calc(100% + 2px)"):(n.style.top="",n.style.bottom="calc(100% + 2px)")}},"updateOverlayPosition"),L=s(()=>{const t=document.querySelector(`#${v}`);t&&(t.style.display="none")},"hideOverlay"),P=s(()=>{document.querySelector(`#${v}`)?.remove(),document.querySelector(`#${h}`)?.remove()},"removeOverlay"),C=s(t=>{let e=document.querySelector(`#${h}`);t?(e||(e=document.createElement("style"),e.id=h,document.head.append(e)),e.textContent="*, *::before, *::after { cursor: crosshair !important; }"):e&&e.remove()},"setCrosshairCursor"),O=s(()=>{document.querySelector(`#${$}`)?.remove()},"removeFloatingBadge"),R=s(t=>{if(!document.querySelector(`#${B}`)){const l=document.createElement("style");l.id=B,l.textContent="@keyframes __vdt_pulse{0%,100%{opacity:1}50%{opacity:.3}}",document.head.append(l)}O();const e=y(),o=document.createElement("div");o.id=$,o.style.cssText=["position:fixed","bottom:4rem","left:50%","transform:translateX(-50%)","z-index:2147483645","display:flex","align-items:center","gap:8px","padding:6px 14px 6px 10px",`background:${e.bg}`,`border:1px solid ${e.btnBorder}`,`box-shadow:${e.shadow}`,"font:12px/1 'JetBrains Mono',monospace",`color:${e.fg}`,"pointer-events:auto","user-select:none","white-space:nowrap"].join(";");const n=document.createElement("span");n.style.cssText=`display:inline-block;width:7px;height:7px;border-radius:50%;background:${e.primary};animation:__vdt_pulse 1.4s ease-in-out infinite;flex-shrink:0;`;const r=document.createElement("span");r.textContent="Click any element to inspect";const c=document.createElement("span");c.style.cssText=`color:${e.muted};margin:0 4px;`,c.textContent="·";const d=document.createElement("button");d.textContent="Cancel",d.style.cssText=`background:transparent;border:none;color:${e.primary};cursor:pointer;padding:0;font:12px/1 'JetBrains Mono',monospace;text-decoration:underline;text-underline-offset:3px;`,d.addEventListener("click",l=>{l.stopPropagation(),t()}),o.append(n,r,c,d),document.body.append(o)},"createFloatingBadge"),J=s(t=>{const e=t.split(":"),o=Number.parseInt(e.at(-1)??"0",10)||void 0,n=Number.parseInt(e.at(-2)??"0",10)||void 0,r=e.slice(0,-2).join(":");globalThis.__VISULIMA_DEVTOOLS__?.rpc?.openInEditor?.(r,n,o).catch(()=>{})},"openInEditor"),b=s(()=>{document.querySelector(`#${S}`)?.remove()},"removeResultPopup"),f=s((t,e)=>{const o=y(),n=document.createElement("button");return n.textContent=t,n.style.cssText=[`background:${o.btnBg}`,`border:1px solid ${o.btnBorder}`,`color:${o.primary}`,"cursor:pointer","font:11px/1 'JetBrains Mono',monospace","padding:5px 10px","white-space:nowrap"].join(";"),n.addEventListener("pointerover",()=>{n.style.background=o.btnBgHover,n.style.borderColor=o.btnBorderHover}),n.addEventListener("pointerout",()=>{n.style.background=o.btnBg,n.style.borderColor=o.btnBorder}),n.addEventListener("click",r=>{r.stopPropagation(),e()}),n},"makeActionButton"),N=s((t,e,o)=>{b();const n=y(),r=document.createElement("div");r.id=S,r.style.cssText=["position:fixed","z-index:2147483646",`background:${n.bg}`,`border:1px solid ${n.btnBorder}`,"padding:10px 32px 10px 12px","font:12px/1.4 'JetBrains Mono',monospace",`color:${n.fg}`,`box-shadow:${n.shadow}`,"min-width:200px","max-width:400px","pointer-events:auto"].join(";");let c=e.bottom+8;c+110>window.innerHeight&&(c=e.top-110-8);let{left:d}=e;d+280>window.innerWidth&&(d=Math.max(8,window.innerWidth-288)),r.style.top=`${c}px`,r.style.left=`${d}px`;const l=t.tagName.toLowerCase(),g=t.id?`#${t.id}`:"",i=t.classList.length>0?`.${[...t.classList].slice(0,3).join(".")}`:"",a=document.createElement("div");if(a.style.cssText=`color:${n.primary};font-weight:bold;margin-bottom:4px;word-break:break-all;`,a.textContent=`${l}${g}${i}`,r.append(a),o){const m=document.createElement("div");m.style.cssText=`color:${n.muted};margin-bottom:10px;word-break:break-all;font-size:10px;`,m.textContent=o,r.append(m)}const u=document.createElement("div");u.style.cssText="display:flex;gap:6px;flex-wrap:wrap;",o&&u.append(f("Open in editor",()=>{J(o),b()})),u.append(f("Copy HTML",()=>{navigator.clipboard.writeText(t.outerHTML).catch(()=>{}),b()})),o&&u.append(f("Copy path",()=>{navigator.clipboard.writeText(o).catch(()=>{}),b()})),r.append(u);const p=document.createElement("button");p.textContent="×",p.style.cssText=["position:absolute","top:6px","right:8px","background:transparent","border:none",`color:${n.muted}`,"cursor:pointer","font:16px/1 'JetBrains Mono',monospace","padding:0","line-height:1","transition:color 0.15s"].join(";"),p.addEventListener("pointerover",()=>{p.style.color=n.fg}),p.addEventListener("pointerout",()=>{p.style.color=n.muted}),p.addEventListener("click",m=>{m.stopPropagation(),b()}),r.append(p),document.body.append(r);const _=s(m=>{r.contains(m.target)||(b(),document.removeEventListener("click",_,!0))},"handleOutside");setTimeout(()=>{document.addEventListener("click",_,!0)},100)},"showResultPopup");let x;const V=s((t,e)=>{x?.(),j(),C(!0);const o=s(()=>document.querySelector(`#${$}`)??void 0,"badgeElement"),n=s(i=>{if(!i)return!1;const a=o();return!!(a&&(i===a||a.contains(i)))},"isOverBadge"),r={cleanup(){document.removeEventListener("mousemove",r.handleMouseMove),document.removeEventListener("click",r.handleClick,!0),document.removeEventListener("keydown",r.handleKeyDown),L(),P(),C(!1),O(),x=void 0},handleClick(i){const a=i.target;if(!a||a.tagName==="DEV-TOOLBAR"||n(a))return;i.preventDefault(),i.stopPropagation();const u=a.getBoundingClientRect(),p=M(a);r.cleanup(),t(),N(a,u,p)},handleKeyDown(i){i.key==="Escape"&&(r.cleanup(),e())},handleMouseMove(i){const a=i.target;if(!a||a.tagName==="DEV-TOOLBAR"||n(a)){L();return}H(a)}},{cleanup:c,handleClick:d,handleKeyDown:l,handleMouseMove:g}=r;R(()=>{c(),e()}),document.addEventListener("mousemove",g),document.addEventListener("click",d,!0),document.addEventListener("keydown",l),x=c},"startGlobalInspection"),z=s(()=>{x?.(),b()},"stopGlobalInspection"),F={icon:A,id:"dev-toolbar:inspector",name:"Inspector",onClick(){const t=globalThis.__VISULIMA_DEVTOOLS__;V(()=>{t?.setAppActive&&t.setAppActive("dev-toolbar:inspector",!1)},()=>{t?.setAppActive&&t.setAppActive("dev-toolbar:inspector",!1)})},onDeactivate(){z()}};export{F as default};
1
+ import{l as bt,g as Yt}from"../../packem_shared/annotation-settings-DlLZO5Zp.js";const kn=`<!-- @license lucide-static v1.17.0 - ISC -->
2
+ <svg
3
+ class="lucide lucide-inspect"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ stroke-width="2"
11
+ stroke-linecap="round"
12
+ stroke-linejoin="round"
13
+ >
14
+ <path d="M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z" />
15
+ <path d="M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6" />
16
+ </svg>
17
+ `,Xt=e=>{try{const t=e.contentDocument;return t!==null&&t.body!==null}catch{return!1}},ye=(e,t)=>{let n=document.elementFromPoint(e,t);if(!n)return null;let o=!0;for(;o;){for(o=!1;n?.shadowRoot;){const i=n.shadowRoot.elementFromPoint(e,t);if(!i||i===n)break;n=i,o=!0}if(n?.tagName==="IFRAME"){const i=n;if(Xt(i)){const r=i.getBoundingClientRect(),s=e-r.left,a=t-r.top;try{const d=i.contentDocument.elementFromPoint(s,a);d&&d!==i&&(n=d,o=!0)}catch{}}}}return n},et=e=>{const t=e.getBoundingClientRect();let n=0,o=0,i=e.ownerDocument;for(;i!==document;){const r=i.defaultView?.frameElement;if(!r)break;const s=r.getBoundingClientRect();n+=s.left,o+=s.top,i=r.ownerDocument}return new DOMRect(t.x+n,t.y+o,t.width,t.height)},En=new Set(["ARTICLE","ASIDE","DIV","FOOTER","HEADER","MAIN","NAV","SECTION","SPAN"]),at=e=>{if(typeof e.checkVisibility=="function")return!e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=e;for(;t&&t!==document.body;){if(getComputedStyle(t).opacity==="0")return!0;t=t.parentElement}return!1},Lt=e=>{if(!En.has(e.tagName))return!0;for(const t of e.childNodes)if(t.nodeType===Node.TEXT_NODE&&t.textContent?.trim())return!0;return!1},We=(e,t)=>{const n=document.elementFromPoint(e,t);if(!n)return null;let o=n;for(;o.shadowRoot;){const x=o.shadowRoot.elementFromPoint(e,t);if(!x||x===o)break;o=x}if(Lt(o)&&!at(o))return o;const i=document.elementsFromPoint(e,t);for(const x of i){if(x===n||x===document.documentElement||x===document.body)continue;let h=x;for(;h.shadowRoot;){const c=h.shadowRoot.elementFromPoint(e,t);if(!c||c===h)break;h=c}if(Lt(h)&&!at(h))return h}const r=o.getBoundingClientRect(),s=r.width*r.height;let a=null,d=s;for(const x of i){if(x===n||x===document.documentElement||x===document.body||at(x))continue;const h=x.getBoundingClientRect(),c=h.width*h.height;c>0&&c<d&&(a=x,d=c)}return a??o},Vt=e=>{if(e.parentElement)return e.parentElement;const t=e.getRootNode();return t instanceof ShadowRoot?t.host:null},Qt=e=>{let t=e;for(;t;){const{position:n}=getComputedStyle(t);if(n==="fixed"||n==="sticky")return!0;t=Vt(t)}return!1},yt=e=>{const t=e.tagName.toLowerCase();if(t==="button"||e.type==="submit"){const r=e.textContent?.trim().slice(0,40);return r?`button "${r}"`:"button"}if(t==="a"){const r=e.getAttribute("href"),s=e.textContent?.trim().slice(0,30),a=r?.trim().toLowerCase();return r&&a&&!a.startsWith("javascript:")&&!a.startsWith("data:")&&!a.startsWith("vbscript:")?s?`link "${s}" to ${r}`:`link to ${r}`:s?`link "${s}"`:"link"}if(t==="img"){const{alt:r}=e;return r?`image "${r.slice(0,40)}"`:"image"}if(t==="input"){const{type:r}=e,{placeholder:s}=e;return s?`input[${r}] "${s.slice(0,30)}"`:`input[${r}]`}if(t==="textarea"){const{placeholder:r}=e;return r?`textarea "${r.slice(0,30)}"`:"textarea"}if(/^h[1-6]$/.test(t)){const r=e.textContent?.trim().slice(0,50);return r?`${t} "${r}"`:t}if(t==="select"){const r=e.getAttribute("aria-label")??e.name;return r?`select "${r}"`:"select"}const n=e.textContent?.trim();if(n&&n.length<=30&&n.length>0)return`${t} "${n}"`;const o=e.id?`#${e.id}`:"",i=e.classList.length>0?`.${[...e.classList].slice(0,2).join(".")}`:"";return`${t}${o}${i}`||t},_n=new Set(["active","checked","disabled","focus","hover","selected","visited"]),Ut=e=>{if(e.id)return`#${CSS.escape(e.id)}`;const t=[...e.classList].filter(i=>!_n.has(i)&&!i.startsWith("__")&&!Tn(i));if(t.length>0){const i=e.tagName.toLowerCase();for(const r of t){const s=`${i}.${CSS.escape(r)}`;if(document.querySelectorAll(s).length===1)return s}for(let r=0;r<t.length;r++)for(let s=r+1;s<t.length;s++){const a=`${i}.${CSS.escape(t[r])}.${CSS.escape(t[s])}`;if(document.querySelectorAll(a).length===1)return a}}const n=[];let o=e;for(;o&&o!==document.body&&o!==document.documentElement;){let i=o.tagName.toLowerCase();if(o.id){n.unshift(`#${CSS.escape(o.id)}`);break}const r=o.parentElement;if(r){const s=[...r.children].filter(a=>a.tagName===o.tagName);if(s.length>1){const a=s.indexOf(o)+1;i+=`:nth-of-type(${a})`}}n.unshift(i),o=r}return n.join(" > ")},Kt=/[_-][a-f0-9]{5,}$/i,Tn=e=>Kt.test(e),Jt=e=>Array.from(e,t=>t.replace(Kt,"")).filter(Boolean).join(" "),Wt=e=>{const t=[];let n=e;for(;n&&n!==document.documentElement;){const o=n.tagName.toLowerCase();if(o==="body"){t.unshift("body");break}const i=n.getRootNode();i instanceof ShadowRoot?(t.unshift(`${o} ⟨shadow⟩`),n=i.host):(t.unshift(o),n=n.parentElement)}return t.join(" > ")},Gt=e=>{const t=e.parentElement;return t?[...t.children].filter(n=>n!==e).slice(0,5).map(n=>n.tagName.toLowerCase()+(n.id?`#${n.id}`:"")).join(", "):""},Zt=(e,t=120)=>{const n=e.textContent?.trim()??"";if(n.length>0)return n.length>t?`${n.slice(0,t)}…`:n;const o=e.getAttribute("aria-label")??e.getAttribute("title")??"";return o?o.length>t?`${o.slice(0,t)}…`:o:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e.placeholder?.slice(0,t)??"":""},en=(e=80)=>{const t=globalThis.getSelection();if(!t||t.isCollapsed)return"";const n=t.toString().trim();return n.length>e?`${n.slice(0,e)}…`:n},Cn=new Set(["A","BUTTON","INPUT","SELECT","TEXTAREA"]),tn=e=>{const t=e,n=t.getAttribute("role")??t.tagName.toLowerCase(),o=t.getAttribute("aria-label")??void 0,i=t.getAttribute("aria-describedby")?document.getElementById(t.getAttribute("aria-describedby"))?.textContent?.trim():void 0,r=t.getAttribute("tabindex"),s=r===null?void 0:Number.parseInt(r,10),a=Cn.has(t.tagName)||s!==void 0&&s>=0;return{ariaDescribedBy:i,ariaLabel:o,focusable:a,role:n===t.tagName.toLowerCase()?void 0:n,tabindex:s}},Sn=["display","position","color","background-color","font-size","font-family","font-weight","line-height","padding","margin","border","width","height","overflow","z-index","opacity"],gt=e=>{const t=getComputedStyle(e),n=[];for(const o of Sn){const i=t.getPropertyValue(o);i&&i!=="normal"&&i!=="none"&&i!=="auto"&&i!=="0px"&&n.push(`${o}: ${i}`)}return n.join("; ")},Ln=e=>{const t=Object.keys(e).find(a=>a.startsWith("__reactFiber$")||a.startsWith("__reactInternalInstance$"));if(!t)return;let n=e[t],o,i,r;const s=[];for(;n;){if(typeof n.type=="function"||typeof n.type=="object"){const a=n.type?.displayName??n.type?.name;a&&!a.startsWith("_")&&a!=="Fragment"&&a!=="Suspense"&&a.length>1&&(s.push(a),o||(o=a,n._debugSource&&(i=n._debugSource.fileName,r=n._debugSource.lineNumber)))}n=n.return}if(o)return{componentName:o,componentStack:s.length>1?s.reverse():void 0,framework:"react",sourceFile:i,sourceLine:r}},Bn=e=>{let t=e.__vueParentComponent;if(!t){let r=e;for(;r&&(t=r.__vueParentComponent,!t);)r=r.parentElement}if(!t)return;const n=t.type?.__name??t.type?.name??t.type?.__file?.split("/").pop()?.replace(".vue","");if(!n)return;const o=[n];let{parent:i}=t;for(;i;){const r=i.type?.__name??i.type?.name;r&&o.push(r),i=i.parent}return{componentName:n,componentStack:o.length>1?o.reverse():void 0,framework:"vue",sourceFile:t.type?.__file}},An=e=>{let t=e;for(;t;){const n=t.__svelte_meta;if(n){const o=n.loc?.file??"";return{componentName:o.split("/").pop()?.replace(".svelte","")??"Unknown",framework:"svelte",sourceFile:o,sourceLine:n.loc?.line}}t=t.parentElement}},nn=e=>Ln(e)??Bn(e)??An(e),on=async e=>{try{const t=e.getBoundingClientRect(),n=20,o=window.devicePixelRatio||1,i=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:{displaySurface:"browser"}});if(!i.getVideoTracks()[0])return i.getTracks().forEach(b=>b.stop()),null;const r=document.createElement("video");r.srcObject=i,r.muted=!0,await r.play(),await new Promise(b=>{requestAnimationFrame(()=>b())});const s=document.createElement("canvas");s.width=r.videoWidth,s.height=r.videoHeight;const a=s.getContext("2d");if(!a)return i.getTracks().forEach(b=>b.stop()),null;a.drawImage(r,0,0),i.getTracks().forEach(b=>b.stop());const d=Math.max(0,(t.left-n)*o),x=Math.max(0,(t.top-n)*o),h=Math.min((t.width+n*2)*o,s.width-d),c=Math.min((t.height+n*2)*o,s.height-x),u=document.createElement("canvas");u.width=h,u.height=c;const p=u.getContext("2d");return p?(p.drawImage(s,d,x,h,c,0,0,h,c),u.toDataURL("image/png")):null}catch{return null}},Mn=e=>{const t=[],n=o=>{for(const i of o.querySelectorAll(e))t.push(i);for(const i of o.querySelectorAll("iframe"))if(Xt(i))try{n(i.contentDocument)}catch{}};return n(document),t},rn=e=>{const t=[],n=Math.max(10,e.width/20),o=Math.max(10,e.height/20),i=new Set;for(let{x:s}=e;s<=e.x+e.width;s+=n)for(let{y:a}=e;a<=e.y+e.height;a+=o){const d=ye(s,a);if(d&&!i.has(d)&&d.tagName!=="BODY"&&d.tagName!=="HTML"&&!d.tagName.includes("-")){const x=et(d);x.left>=e.x-5&&x.top>=e.y-5&&x.right<=e.x+e.width+5&&x.bottom<=e.y+e.height+5&&(i.add(d),t.push(d))}}const r="button, a, input, img, p, h1, h2, h3, h4, h5, h6, li, label, td, th";for(const s of Mn(r)){if(i.has(s)||s.tagName==="BODY"||s.tagName==="HTML")continue;const a=et(s);a.width>window.innerWidth*.8&&a.height>window.innerHeight*.5||a.width<10||a.height<10||a.left<e.x+e.width&&a.right>e.x&&a.top<e.y+e.height&&a.bottom>e.y&&(i.add(s),t.push(s))}return t.filter(s=>!t.some(a=>a!==s&&s.contains(a)))},sn=e=>e.map(t=>{const n=et(t);return{height:n.height,width:n.width,x:n.x,y:n.y}}),vt=(e,t="standard")=>{if(e.length===0)return`# Annotations
18
+
19
+ No annotations found.`;if(t==="compact"){const o=[`# Annotations (${e.length})`,""];for(const i of e){const r=i.elementLabel??i.elementTag,s=i.selectedText?` (re: "${i.selectedText.slice(0,30)}...")`:"";o.push(`- **${r}:** ${i.comment}${s}`)}return o.join(`
20
+ `)}const n=["# Annotations","",`> ${e.length} annotation(s)`,""];for(const[o,i]of e.entries()){const r=i.elementLabel??i.elementTag;if(n.push(`## ${o+1}. [${i.intent.toUpperCase()}] ${i.severity} — ${r}`,"",`**Status:** ${i.status}`,`**URL:** ${i.url}`),i.elementPath&&n.push(`**Selector:** \`${i.elementPath}\``),i.source&&n.push(`**Source:** \`${i.source}\``),i.frameworkContext){const s=i.frameworkContext;n.push(`**Component:** ${s.componentName} (${s.framework})`),s.componentStack&&s.componentStack.length>1&&n.push(`**Stack:** ${s.componentStack.join(" > ")}`),s.sourceFile&&n.push(`**File:** \`${s.sourceFile}${s.sourceLine?`:${s.sourceLine}`:""}\``)}i.selectedText&&n.push(`**Selected:** "${i.selectedText}"`),(t==="detailed"||t==="forensic")&&(i.cssClasses&&n.push(`**Classes:** \`${i.cssClasses}\``),i.nearbyText&&n.push(`**Context:** ${i.nearbyText}`),i.fullPath&&n.push(`**DOM Path:** \`${i.fullPath}\``)),t==="forensic"&&(i.accessibility?.role&&n.push(`**Role:** ${i.accessibility.role}`),i.nearbyElements&&n.push(`**Nearby:** ${i.nearbyElements}`),i.computedStyles&&n.push(`**Styles:** \`${i.computedStyles}\``)),n.push("",i.comment,"","---","")}return n.join(`
21
+ `)},zn=Object.defineProperty({__proto__:null,annotationsToMarkdown:vt,captureAccessibility:tn,captureComputedStyles:gt,captureElementScreenshot:on,cleanCssClasses:Jt,deepElementFromPoint:ye,detectFrameworkComponent:nn,generateSelector:Ut,getElementBoundingBoxes:sn,getElementLabel:yt,getElementsInRect:rn,getFullDomPath:Wt,getNearbyElements:Gt,getNearbyText:Zt,getParentElement:Vt,getSelectedText:en,getViewportRect:et,isElementFixed:Qt,pierceElementFromPoint:We},Symbol.toStringTag,{value:"Module"}),Pn=["id^='__vdt_'","class*='__vdt_'"],lt=Pn.flatMap(e=>[`:not([${e}])`,`:not([${e}] *)`]).join(""),xt="__vdt_freeze_styles",ct="__vdt_freeze_state",re=1e3,Rn=()=>{if(globalThis.window===void 0)return{frozen:!1,frozenRAFQueue:[],frozenTimeoutQueue:[],installed:!0,origRAF:()=>0,origSetInterval:(()=>0),origSetTimeout:(()=>0),pausedAnimations:[]};const e=globalThis;return e[ct]||(e[ct]={frozen:!1,frozenRAFQueue:[],frozenTimeoutQueue:[],installed:!1,origRAF:null,origSetInterval:null,origSetTimeout:null,pausedAnimations:[]}),e[ct]},E=Rn();globalThis.window!==void 0&&!E.installed&&(E.origSetTimeout=globalThis.setTimeout.bind(globalThis),E.origSetInterval=globalThis.setInterval.bind(globalThis),E.origRAF=globalThis.requestAnimationFrame.bind(globalThis),globalThis.setTimeout=(e,t,...n)=>typeof e=="string"?E.origSetTimeout(e,t):E.origSetTimeout((...o)=>{E.frozen?E.frozenTimeoutQueue.length<re?E.frozenTimeoutQueue.push(()=>e(...o)):E.frozenTimeoutQueue.length===re&&(E.frozenTimeoutQueue.push(()=>{}),console.warn(`[dev-toolbar] frozenTimeoutQueue exceeded ${re} entries — further callbacks are being dropped.`)):e(...o)},t,...n),globalThis.setInterval=(e,t,...n)=>typeof e=="string"?E.origSetInterval(e,t):E.origSetInterval((...o)=>{E.frozen||e(...o)},t,...n),globalThis.requestAnimationFrame=e=>E.origRAF(t=>{E.frozen?E.frozenRAFQueue.length<re?E.frozenRAFQueue.push(e):E.frozenRAFQueue.length===re&&(E.frozenRAFQueue.push(()=>{}),console.warn(`[dev-toolbar] frozenRAFQueue exceeded ${re} entries — further callbacks are being dropped.`)):e(t)}),E.installed=!0);const an=E.origSetTimeout,In=()=>E.frozen,Dn=()=>{if(typeof document>"u"||E.frozen)return;E.frozen=!0,E.frozenTimeoutQueue=[],E.frozenRAFQueue=[];let e=document.getElementById(xt);e||(e=document.createElement("style"),e.id=xt),e.textContent=`
22
+ *${lt},
23
+ *${lt}::before,
24
+ *${lt}::after {
25
+ animation-play-state: paused !important;
26
+ transition: none !important;
27
+ }
28
+ `,document.head.append(e),E.pausedAnimations=[];try{for(const t of document.getAnimations()){if(t.playState!=="running")continue;const n=t.effect?.target;n&&!n.closest?.("[id^='__vdt_']")&&!n.closest?.("dev-toolbar")&&(t.pause(),E.pausedAnimations.push(t))}}catch{}for(const t of document.querySelectorAll("video"))t.paused||(t.dataset.wasPaused="false",t.pause())},ln=()=>{if(typeof document>"u"||!E.frozen)return;E.frozen=!1;const e=E.frozenTimeoutQueue;E.frozenTimeoutQueue=[];for(const n of e)E.origSetTimeout(()=>{if(E.frozen){E.frozenTimeoutQueue.length<re&&E.frozenTimeoutQueue.push(n);return}try{n()}catch{}},0);const t=E.frozenRAFQueue;E.frozenRAFQueue=[];for(const n of t)E.origRAF(o=>{if(E.frozen){E.frozenRAFQueue.length<re&&E.frozenRAFQueue.push(n);return}n(o)});for(const n of E.pausedAnimations)try{n.play()}catch{}E.pausedAnimations=[],document.getElementById(xt)?.remove();for(const n of document.querySelectorAll("video[data-was-paused='false']"))n.play().catch(()=>{}),delete n.dataset.wasPaused},jn=()=>E.frozen?(ln(),!1):(Dn(),!0),cn={bg:"#212121",btnBg:"rgba(196,181,253,0.08)",btnBgHover:"rgba(196,181,253,0.16)",btnBorder:"rgba(196,181,253,0.25)",btnBorderHover:"rgba(196,181,253,0.5)",fg:"#fafafa",muted:"#a1a1aa",primary:"#c4b5fd",shadow:"0 6px 24px rgba(0,0,0,.7),0 2px 8px rgba(0,0,0,.5)"},dn={bg:"#f2f2f2",btnBg:"rgba(124,58,237,0.08)",btnBgHover:"rgba(124,58,237,0.16)",btnBorder:"rgba(124,58,237,0.25)",btnBorderHover:"rgba(124,58,237,0.5)",fg:"#18181b",muted:"#52525b",primary:"#7c3aed",shadow:"0 4px 20px rgba(0,0,0,.12),0 0 0 1px rgba(0,0,0,.08)"},pn={...cn,overlayBg:"rgba(196,181,253,0.06)",overlayBorder:"rgba(196,181,253,0.7)"},Fn={...dn,overlayBg:"rgba(124,58,237,0.06)",overlayBorder:"rgba(124,58,237,0.7)"},Nn={...cn,danger:"#ef4444",success:"#22c55e"},On={...dn,danger:"#dc2626",success:"#16a34a"};let ae;const un=()=>{if(ae!==void 0)return ae;try{const e=localStorage.getItem("__v_dt__theme");if(e==="light")return ae=!1,!1;if(e==="dark")return ae=!0,!0}catch{}return ae=globalThis.window?.matchMedia("(prefers-color-scheme: dark)").matches??!0,ae},qn=()=>un()?pn:Fn,Hn=()=>un()?Nn:On,Bt="__vdt_palette_listener";globalThis.window!==void 0&&!globalThis[Bt]&&(globalThis[Bt]=!0,globalThis.addEventListener("storage",e=>{e.key==="__v_dt__theme"&&(ae=void 0)}));const pe="__vdt_annotation_marker",ue="__vdt_annotation_form",wt="__vdt_annotation_detail",Ge="__vdt_area_outline",H={approve:{bg:"rgba(34,197,94,0.15)",border:"rgba(34,197,94,0.6)",fg:"#22c55e"},change:{bg:"rgba(234,179,8,0.15)",border:"rgba(234,179,8,0.6)",fg:"#eab308"},fix:{bg:"rgba(239,68,68,0.15)",border:"rgba(239,68,68,0.6)",fg:"#ef4444"},question:{bg:"rgba(59,130,246,0.15)",border:"rgba(59,130,246,0.6)",fg:"#3b82f6"}},qe={approve:"Approve",change:"Change",fix:"Fix",question:"Question"},He={blocking:"Blocking",important:"Important",suggestion:"Suggestion"},Ye=Hn,O=()=>globalThis.__VISULIMA_DEVTOOLS__?.rpc,dt=e=>{if(!e)return null;try{return document.querySelector(e)}catch{return null}},X=(e,t="success")=>{const n="__vdt_toast";document.getElementById(n)?.remove();const o=document.createElement("div");o.id=n,o.textContent=e,o.style.cssText=`position:fixed;z-index:2147483648;bottom:1rem;right:1rem;padding:6px 14px;background:${t==="success"?"#22c55e":"#ef4444"};color:#fff;font:12px/1 "JetBrains Mono","Geist Mono",ui-monospace,"Cascadia Code","Fira Code",monospace;font-weight:600;pointer-events:none;opacity:0;transition:opacity 0.2s,transform 0.2s;transform:translateY(4px);`,document.body.append(o),requestAnimationFrame(()=>{o.style.opacity="1",o.style.transform="translateY(0)"}),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),200)},1500)},Yn=e=>{try{const t=new URL(e),n=globalThis.location;return t.origin===n.origin&&t.pathname===n.pathname}catch{return e===globalThis.location.href}},de=(e,t,n)=>{const o=Ye(),i=document.createElement("button");return i.type="button",i.textContent=e,i.style.cssText=`background:${o.btnBg};border:1px solid ${o.btnBorder};color:${n??o.primary};cursor:pointer;font:11px/1 'JetBrains Mono',monospace;padding:5px 10px;white-space:nowrap;`,i.addEventListener("pointerover",()=>{i.style.background=o.btnBgHover,i.style.borderColor=o.btnBorderHover}),i.addEventListener("pointerout",()=>{i.style.background=o.btnBg,i.style.borderColor=o.btnBorder}),i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),t()}),i},ne=(e,t,n,o)=>{const i=document.createElement("div"),r=document.createElement("b");r.textContent=`${t}: `;const s=document.createElement("span");s.textContent=n,o&&(s.style.color=o),i.append(r,s),e.append(i)},$t=(e,t)=>{const n=document.createElement("button");return n.type="button",n.textContent="×",n.style.cssText=`position:absolute;top:6px;right:8px;background:transparent;border:none;color:${e.muted};cursor:pointer;font:16px/1 monospace;padding:0;`,n.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),t()}),n},Xn=()=>globalThis.__VISULIMA_DEVTOOLS__?.getApps?.().some(e=>e.id==="dev-toolbar:annotations")??!1;let Q=[],ve,Pe,le;const kt=(e,t,n=!1)=>({x:e/window.innerWidth*100,y:n?t:t+window.scrollY}),Re=(e,t,n=!1)=>({left:e/100*window.innerWidth,top:n?t:t-window.scrollY}),Vn=()=>{const e=document.querySelectorAll(`.${pe}`);for(const t of e){const n=Number.parseFloat(t.dataset.pageX??"0"),o=Number.parseFloat(t.dataset.pageY??"0"),i=t.dataset.isFixed==="true",{left:r,top:s}=Re(n,o,i);t.style.left=`${r-11}px`,t.style.top=`${s-11}px`,t.style.display=s<-24||s>window.innerHeight+24?"none":"flex"}};let pt=!1;const At=()=>{pt||(pt=!0,an(()=>{Vn(),pt=!1},16))},Qn=()=>{ve||(ve=At,Pe=At,window.addEventListener("scroll",ve,{passive:!0}),window.addEventListener("resize",Pe,{passive:!0}))},Un=()=>{ve&&(window.removeEventListener("scroll",ve),ve=void 0),Pe&&(window.removeEventListener("resize",Pe),Pe=void 0)};let Ie,De,ie=[];const Kn=()=>{if(le)return;le=()=>{q().catch(()=>{})},globalThis.addEventListener("popstate",le),Ie=history.pushState.bind(history),De=history.replaceState.bind(history);const e=le;history.pushState=(...t)=>{Ie(...t);const n=setTimeout(()=>{e(),ie=ie.filter(o=>o!==n)},50);ie.push(n)},history.replaceState=(...t)=>{De(...t);const n=setTimeout(()=>{e(),ie=ie.filter(o=>o!==n)},50);ie.push(n)}},Jn=()=>{le&&(globalThis.removeEventListener("popstate",le),le=void 0);for(const e of ie)clearTimeout(e);ie=[],Ie&&(history.pushState=Ie,Ie=void 0),De&&(history.replaceState=De,De=void 0)};let ce;const Wn=()=>{if(!ce)try{ce=new EventSource("/__devtoolbar/events"),ce.addEventListener("annotations.changed",()=>{const e=O();e?.getAnnotations&&e.getAnnotations().then(t=>{Q=t,tt()}).catch(()=>{})}),ce.addEventListener("error",()=>{})}catch{}},Gn=()=>{ce&&(ce.close(),ce=void 0)},q=async()=>{if(!Xn())return;const e=O();if(e?.getAnnotations)try{Q=await e.getAnnotations(),tt(),Qn(),Kn(),Wn()}catch{}},mn=()=>{for(const e of document.querySelectorAll(`.${pe}`))e.remove();gn(),Un(),Jn(),Gn(),ln()},gn=()=>{F(),j(),document.getElementById(Ge)?.remove()},tt=()=>{for(const t of document.querySelectorAll(`.${pe}`))t.remove();const e=Q.filter(t=>(t.status==="pending"||t.status==="acknowledged")&&Yn(t.url));for(const[t,n]of e.entries())eo(n,t+1)},G="__vdt_annotation_highlight",Zn={bg:"#22c55e",border:"#16a34a",fg:"#fff",highlightBg:"rgba(34,197,94,0.12)"},eo=(e,t)=>{const n=bt(),o=e.isMultiSelect&&t>1?Zn:Yt(n),i=e.isFixed??!1,{left:r,top:s}=Re(e.x,e.y,i),a=e.status==="acknowledged",d=document.createElement("div");d.className=pe,d.dataset.annotationId=e.id,d.dataset.pageX=String(e.x),d.dataset.pageY=String(e.y),d.dataset.isFixed=String(i),d.title=(e.elementLabel??e.comment.slice(0,60))||"Annotation",d.style.cssText=["position:fixed",`top:${s-11}px`,`left:${r-11}px`,"width:22px","height:22px","z-index:2147483643","pointer-events:auto","cursor:pointer","display:flex","align-items:center","justify-content:center",`background:${o.bg}`,"border:none","border-radius:50%","transition:transform 0.18s cubic-bezier(0.34,1.56,0.64,1),box-shadow 0.18s,opacity 0.15s",`box-shadow:0 1px 3px rgba(0,0,0,0.3),0 4px 12px ${o.border}66,inset 0 1px 0 rgba(255,255,255,0.2)`,a?"opacity:0.55":"",e.screenshot?`outline:2px solid ${o.bg};outline-offset:2px`:""].join(";");const x=document.createElement("span");x.style.cssText=[`color:${o.fg}`,"font-size:11px","font-weight:700","line-height:1","font-family:-apple-system,BlinkMacSystemFont,system-ui,sans-serif","letter-spacing:-0.02em"].join(";"),x.textContent=String(t),d.append(x),d.addEventListener("pointerover",()=>{d.style.transform="scale(1.25)",d.style.boxShadow=`0 2px 8px rgba(0,0,0,0.35),0 6px 20px ${o.border}88,inset 0 1px 0 rgba(255,255,255,0.25)`,x.style.display="none";let h=d.querySelector(".__vdt_edit_icon");if(h)h.style.display="flex";else{h=document.createElement("span"),h.className="__vdt_edit_icon",h.style.cssText="display:flex;align-items:center;justify-content:center;";const c=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="${o.fg}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/></svg>`,"image/svg+xml");h.append(c.documentElement),d.append(h)}if(e.isMultiSelect&&e.boundingBox&&!e.elementBoundingBoxes?.length){const c=e.boundingBox,u=i?c.y:c.y-window.scrollY;let p=document.getElementById(G);p||(p=document.createElement("div"),p.id=G,document.body.append(p)),p.style.cssText=`position:fixed;pointer-events:none;z-index:2147483642;box-sizing:border-box;border:2px dashed ${o.bg};background:${o.highlightBg};transition:all 0.1s;top:${u}px;left:${c.x}px;width:${c.width}px;height:${c.height}px;`}else{let c=null;if(e.elementPath&&(c=dt(e.elementPath)),!c&&e.boundingBox){const u=e.boundingBox,p=u.x+u.width/2,b=i?u.y+u.height/2:u.y+u.height/2-window.scrollY;if(c=ye(p,b),c){const _=c.getBoundingClientRect(),v=u.width>0?_.width/u.width:1,P=u.height>0?_.height/u.height:1;(v<.5||P<.5)&&(c=null)}}if(c){const u=c.getBoundingClientRect();let p=document.getElementById(G);p||(p=document.createElement("div"),p.id=G,document.body.append(p)),p.style.cssText=`position:fixed;pointer-events:none;z-index:2147483642;box-sizing:border-box;border:2px solid ${o.bg};background:${o.highlightBg};transition:all 0.1s;top:${u.top}px;left:${u.left}px;width:${u.width}px;height:${u.height}px;`}else if(e.boundingBox){const u=e.boundingBox,p=i?u.y:u.y-window.scrollY;let b=document.getElementById(G);b||(b=document.createElement("div"),b.id=G,document.body.append(b)),b.style.cssText=`position:fixed;pointer-events:none;z-index:2147483642;box-sizing:border-box;border:2px dashed ${o.bg};background:${o.highlightBg};transition:all 0.1s;top:${p}px;left:${u.x}px;width:${u.width}px;height:${u.height}px;`}}if(e.elementBoundingBoxes&&e.elementBoundingBoxes.length>0)for(const[c,u]of e.elementBoundingBoxes.entries()){const p=`${G}_${c}`;let b=document.getElementById(p);b||(b=document.createElement("div"),b.id=p,document.body.append(b));const _=u.y-window.scrollY;b.style.cssText=`position:fixed;pointer-events:none;z-index:2147483642;box-sizing:border-box;border:2px solid ${o.bg};background:${o.highlightBg};transition:all 0.1s;top:${_}px;left:${u.x}px;width:${u.width}px;height:${u.height}px;`}}),d.addEventListener("pointerout",()=>{if(d.dataset.popupOpen==="true")return;d.style.transform="",d.style.boxShadow=`0 1px 3px rgba(0,0,0,0.3),0 4px 12px ${o.border}66,inset 0 1px 0 rgba(255,255,255,0.2)`,x.style.display="";const h=d.querySelector(".__vdt_edit_icon");if(h&&(h.style.display="none"),document.getElementById(G)?.remove(),e.elementBoundingBoxes)for(let c=0;c<e.elementBoundingBoxes.length;c++)document.getElementById(`${G}_${c}`)?.remove()}),d.addEventListener("click",h=>{if(h.stopPropagation(),h.preventDefault(),n.markerClickBehavior==="delete")O()?.deleteAnnotation?.(e.id)?.then(()=>{q().catch(()=>{})});else if(n.markerClickBehavior==="edit"){const c=dt(e.elementPath),{left:u,top:p}=Re(e.x,e.y,e.isFixed),b=c?.getBoundingClientRect()??new DOMRect(u,p,100,20);nt(c??document.body,b,e.source,e)}else he(e)}),d.addEventListener("contextmenu",h=>{if(h.preventDefault(),h.stopPropagation(),n.markerClickBehavior==="delete"){const c=dt(e.elementPath),{left:u,top:p}=Re(e.x,e.y,e.isFixed),b=c?.getBoundingClientRect()??new DOMRect(u,p,100,20);nt(c??document.body,b,e.source,e)}else he(e)}),(s<-24||s>window.innerHeight+24)&&(d.style.display="none"),document.body.append(d)},to=e=>{e&&e.__resizeObserver?.disconnect()},F=()=>{const e=document.querySelector(`#${ue}`),t=!!e;e?.annotationId&&it(e.annotationId,!1),to(e),e?.remove(),document.querySelector("#__vdt_pending_marker")?.remove(),t&&document.dispatchEvent(new CustomEvent("__vdt_annotation_form_closed"))},Ve=()=>!!document.querySelector(`#${ue}`),no=()=>{const e=document.querySelector(`#${ue}`);if(!e)return;const t="__vdt_shake_kf";if(!document.getElementById(t)){const n=document.createElement("style");n.id=t,n.textContent="@keyframes __vdt_shake{0%,100%{transform:translateX(0)}15%{transform:translateX(-6px)}30%{transform:translateX(5px)}45%{transform:translateX(-4px)}60%{transform:translateX(3px)}75%{transform:translateX(-2px)}90%{transform:translateX(1px)}}",document.head.append(n)}e.style.animation="none",e.style.animation="__vdt_shake 0.4s ease",e.addEventListener("animationend",()=>{e.style.animation=""},{once:!0})},nt=(e,t,n,o,i)=>{F(),j();const r=Ye(),s=e.tagName.toLowerCase(),a=e.id?`#${e.id}`:"",d=e.classList.length>0?`.${[...e.classList].slice(0,3).join(".")}`:"",x=Ut(e),h=Zt(e),c=en(),u=nn(e),p=document.createElement("div");p.id=ue,o&&(p.annotationId=o.id,it(o.id,!0)),p.style.cssText=["position:fixed","z-index:2147483647",`background:${r.bg}`,`border:1px solid ${r.btnBorder}`,"padding:12px","font:12px/1.4 'JetBrains Mono',monospace",`color:${r.fg}`,`box-shadow:${r.shadow}`,"min-width:300px","max-width:400px","pointer-events:auto"].join(";");const b=i?.y??t.bottom,_=i?.x??t.left,v="__vdt_pending_marker";if(document.getElementById(v)?.remove(),i&&!o){const f=Yt(),B=document.createElement("div");B.id=v,B.style.cssText=["position:fixed",`top:${i.y-11}px`,`left:${i.x-11}px`,"width:22px","height:22px","z-index:2147483643","pointer-events:none","display:flex","align-items:center","justify-content:center",`background:${f.bg}`,"border:none","border-radius:50%",`box-shadow:0 1px 3px rgba(0,0,0,0.3),0 4px 12px ${f.border}66,inset 0 1px 0 rgba(255,255,255,0.2)`,"animation:__vdt_pulse 1.4s ease-in-out infinite"].join(";");const C=document.createElement("span");C.style.cssText=`color:${f.fg};font-size:13px;font-weight:700;line-height:1;`,C.textContent="+",B.append(C),document.body.append(B)}const P=document.createElement("div");P.style.cssText=`color:${r.primary};font-weight:bold;margin-bottom:8px;font-size:12px;`,P.textContent=o?"Edit Annotation":"Annotate Element",p.append(P);const k=document.createElement("div");k.style.cssText=`color:${r.muted};font-size:10px;margin-bottom:8px;padding:4px 6px;background:${r.btnBg};border:1px solid ${r.btnBorder};word-break:break-all;`;const T=document.createElement("span");if(T.textContent=`${s}${a}${d}`,k.append(T),n){const f=document.createElement("div");f.style.cssText=`color:${r.primary};opacity:0.6;margin-top:2px;`,f.textContent=n,k.append(f)}if(u){const f=document.createElement("div");f.style.cssText=`color:${r.success};margin-top:2px;`,f.textContent=`${u.framework}: <${u.componentName}>`,k.append(f)}if(c){const f=document.createElement("div");f.style.cssText=`color:${r.fg};opacity:0.5;margin-top:2px;font-style:italic;`,f.textContent=`"${c}"`,k.append(f)}if(p.append(k),!o){const f=gt(e);if(f){const B=document.createElement("details");B.style.cssText=`margin-bottom:8px;font-size:10px;color:${r.muted};`;const C=document.createElement("summary");C.style.cssText="cursor:pointer;font-size:10px;padding:2px 0;",C.textContent="Computed Styles",C.addEventListener("click",W=>W.stopPropagation());const Y=document.createElement("div");Y.style.cssText=`padding:4px 6px;margin-top:4px;background:${r.btnBg};border:1px solid ${r.btnBorder};font-family:'JetBrains Mono',monospace;white-space:pre-wrap;word-break:break-all;line-height:1.6;`,Y.textContent=f.replaceAll("; ",`;
29
+ `),B.append(C,Y),p.append(B)}}let R=o?.intent??"fix";const M=$e(r,"Intent",["fix","change","question","approve"].map(f=>({active:f===R,activeStyle:`background:${H[f].bg};border-color:${H[f].border};color:${H[f].fg}`,key:f,label:qe[f]})),f=>{R=f});p.append(M);let $=o?.severity??"important";const L=$e(r,"Severity",["blocking","important","suggestion"].map(f=>({active:f===$,activeStyle:`background:${r.btnBg};border-color:${r.primary};color:${r.primary}`,key:f,label:He[f]})),f=>{$=f});p.append(L);let S=o?.screenshot?"existing":null;const l=document.createElement("div");l.style.cssText="margin-bottom:8px;";const g=document.createElement("button");g.type="button",g.textContent=S?"Remove Screenshot":"Capture Screenshot",g.style.cssText=`cursor:pointer;font:10px/1 'JetBrains Mono',monospace;padding:4px 8px;background:${r.btnBg};border:1px solid ${r.btnBorder};color:${r.primary};`,g.addEventListener("click",async f=>{if(f.preventDefault(),f.stopPropagation(),S)S=null,g.textContent="Capture Screenshot",m.style.display="none";else{g.textContent="Capturing...",g.disabled=!0;const B=await on(e);B?(S=B,g.textContent="Remove Screenshot",m.style.display="block",m.style.backgroundImage=`url(${B})`):g.textContent="Capture Failed — Retry",g.disabled=!1}}),l.append(g);const m=document.createElement("div");m.style.cssText=`margin-top:4px;height:80px;background-size:contain;background-repeat:no-repeat;background-position:center;border:1px solid ${r.btnBorder};display:${S?"block":"none"};`,l.append(m),p.append(l);const y=document.createElement("textarea");y.placeholder=h?`Feedback about "${h.slice(0,40)}..."`:"Describe the issue or feedback...",y.value=o?.comment??"",y.style.cssText=`width:100%;min-height:60px;resize:vertical;margin-bottom:8px;padding:6px 8px;background:${r.btnBg};border:1px solid ${r.btnBorder};color:${r.fg};font:11px/1.4 'JetBrains Mono',monospace;box-sizing:border-box;outline:none;`,y.addEventListener("focus",()=>{y.style.borderColor=r.primary}),y.addEventListener("blur",()=>{y.style.borderColor=r.btnBorder}),y.addEventListener("click",f=>f.stopPropagation()),y.addEventListener("keydown",f=>{f.stopPropagation(),f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),A.click()),f.key==="Escape"&&(f.preventDefault(),F())}),p.append(y);const w=document.createElement("div");w.style.cssText="display:flex;gap:6px;";const A=de(o?"Save":"Create",async()=>{const f=y.value.trim();if(!f){y.style.borderColor=r.danger;return}const B=O();if(B){A.textContent=o?"Saving...":"Creating...",A.disabled=!0;try{if(o)await B.updateAnnotation(o.id,{comment:f,intent:R,severity:$,...S!=="existing"&&{screenshot:S}}),S&&S!=="existing"&&await B.saveScreenshot(o.id,S).catch(()=>{});else{const C=Qt(e),Y=i?.x??t.x+t.width/2,W=i?.y??t.y+t.height/2,ee=kt(Y,W,C),me=tn(e),Te=gt(e),Ce=Wt(e),Se=Gt(e),Xe=yt(e),Le={accessibility:me,boundingBox:{height:t.height,width:t.width,x:t.x+(C?0:window.scrollX),y:t.y+(C?0:window.scrollY)},comment:f,computedStyles:Te||void 0,cssClasses:Jt(e.classList),elementLabel:Xe,elementPath:x,elementTag:s,frameworkContext:u,fullPath:Ce,intent:R,isFixed:C||void 0,nearbyElements:Se||void 0,nearbyText:h||void 0,selectedText:c||void 0,severity:$,source:n,url:globalThis.location.href,x:ee.x,y:ee.y},D=await B.createAnnotation(Le);S&&S!=="existing"&&await B.saveScreenshot(D.id,S).catch(()=>{}),Q.push(D)}await q(),F(),X(o?"Annotation saved":"Annotation created")}catch{A.textContent="Error — retry",A.disabled=!1}}});w.append(A,de("Cancel",()=>F())),o&&w.append(de("Delete",async()=>{await O()?.deleteAnnotation?.(o.id),await q(),F()},r.danger)),p.append(w),p.append($t(r,()=>F())),rt(p,_,b,y)},Mt=(e,t,n)=>{F(),j();const o=Ye(),i=e.slice(0,5).map(p=>p.tagName.toLowerCase()).join(", "),r=document.createElement("div");r.id=ue,r.style.cssText=["position:fixed","z-index:2147483647",`background:${o.bg}`,`border:1px solid ${o.btnBorder}`,"padding:12px","font:12px/1.4 'JetBrains Mono',monospace",`color:${o.fg}`,`box-shadow:${o.shadow}`,"min-width:300px","max-width:400px","pointer-events:auto"].join(";");const s=document.createElement("div");s.style.cssText=`color:${o.primary};font-weight:bold;margin-bottom:8px;font-size:12px;`,s.textContent=`Multi-Select: ${e.length} elements`,r.append(s);const a=document.createElement("div");a.style.cssText=`color:${o.muted};font-size:10px;margin-bottom:8px;padding:4px 6px;background:${o.btnBg};border:1px solid ${o.btnBorder};`,a.textContent=i+(e.length>5?` +${e.length-5} more`:""),r.append(a);let d="fix";r.append($e(o,"Intent",["fix","change","question","approve"].map(p=>({active:p===d,activeStyle:`background:${H[p].bg};border-color:${H[p].border};color:${H[p].fg}`,key:p,label:qe[p]})),p=>{d=p}));let x="important";r.append($e(o,"Severity",["blocking","important","suggestion"].map(p=>({active:p===x,activeStyle:`background:${o.btnBg};border-color:${o.primary};color:${o.primary}`,key:p,label:He[p]})),p=>{x=p}));const h=document.createElement("textarea");h.placeholder=`Feedback about ${e.length} selected elements...`,h.style.cssText=`width:100%;min-height:60px;resize:vertical;margin-bottom:8px;padding:6px 8px;background:${o.btnBg};border:1px solid ${o.btnBorder};color:${o.fg};font:11px/1.4 'JetBrains Mono',monospace;box-sizing:border-box;outline:none;`,h.addEventListener("click",p=>p.stopPropagation()),h.addEventListener("keydown",p=>{p.stopPropagation(),p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),u.click()),p.key==="Escape"&&(p.preventDefault(),F())}),r.append(h);const c=document.createElement("div");c.style.cssText="display:flex;gap:6px;";const u=de("Create",async()=>{const p=h.value.trim();if(!p){h.style.borderColor=o.danger;return}const b=O();if(!b)return;const _=kt(t.x+t.width/2,t.y+t.height/2),v={boundingBox:{height:t.height,width:t.width,x:t.x+window.scrollX,y:t.y+window.scrollY},comment:p,elementBoundingBoxes:n,elementTag:"multi-select",intent:d,isMultiSelect:!0,severity:x,url:globalThis.location.href,x:_.x,y:_.y};await b.createAnnotation(v),await q(),F(),X("Annotation created")});c.append(u),c.append(de("Cancel",()=>F())),r.append(c),r.append($t(o,()=>F())),rt(r,t.x+t.width/2,t.bottom,h)},oo=e=>{F(),j();const t=Ye();document.getElementById(Ge)?.remove();const n=document.createElement("div");n.id=Ge,n.style.cssText=["position:fixed","pointer-events:none","z-index:2147483644","box-sizing:border-box",`top:${e.y}px`,`left:${e.x}px`,`width:${e.width}px`,`height:${e.height}px`,"border:2px dashed rgba(34,197,94,0.7)","background:rgba(34,197,94,0.04)","transition:opacity 0.15s"].join(";");const o=document.createElement("div");o.style.cssText="position:absolute;top:-10px;right:-10px;width:20px;height:20px;border-radius:50%;background:#22c55e;color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:bold;line-height:1;pointer-events:none;",o.textContent="+",n.append(o),document.body.append(n);const i=document.createElement("div");i.id=ue,i.style.cssText=["position:fixed","z-index:2147483647",`background:${t.bg}`,`border:1px solid ${t.btnBorder}`,"padding:12px","font:12px/1.4 'JetBrains Mono',monospace",`color:${t.fg}`,`box-shadow:${t.shadow}`,"min-width:280px","max-width:360px","pointer-events:auto"].join(";");const r=document.createElement("div");r.style.cssText=`color:${t.primary};font-weight:bold;margin-bottom:8px;font-size:12px;`,r.textContent="Area selection",i.append(r);let s="fix";i.append($e(t,"Intent",["fix","change","question","approve"].map(u=>({active:u===s,activeStyle:`background:${H[u].bg};border-color:${H[u].border};color:${H[u].fg}`,key:u,label:qe[u]})),u=>{s=u}));let a="important";i.append($e(t,"Severity",["blocking","important","suggestion"].map(u=>({active:u===a,activeStyle:`background:${t.btnBg};border-color:${t.primary};color:${t.primary}`,key:u,label:He[u]})),u=>{a=u}));const d=document.createElement("textarea");d.placeholder="Describe what should change in this area...",d.style.cssText=`width:100%;min-height:60px;resize:vertical;margin-bottom:8px;padding:6px 8px;background:${t.btnBg};border:1px solid ${t.btnBorder};color:${t.fg};font:11px/1.4 'JetBrains Mono',monospace;box-sizing:border-box;outline:none;`,d.addEventListener("click",u=>u.stopPropagation()),d.addEventListener("keydown",u=>{u.stopPropagation(),u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),c.click()),u.key==="Escape"&&(u.preventDefault(),x())}),i.append(d);const x=()=>{F(),document.getElementById(Ge)?.remove()},h=document.createElement("div");h.style.cssText="display:flex;gap:6px;justify-content:flex-end;",h.append(de("Cancel",x));const c=de("Add",async()=>{const u=d.value.trim();if(!u){d.style.borderColor=t.danger;return}const p=O();if(p){c.textContent="Adding...",c.disabled=!0;try{const b=kt(e.x+e.width/2,e.y+e.height/2),_={boundingBox:{height:e.height,width:e.width,x:e.x+window.scrollX,y:e.y+window.scrollY},comment:u,elementLabel:"Area selection",elementPath:`region at (${Math.round(e.x)}, ${Math.round(e.y)})`,elementTag:"area",intent:s,isMultiSelect:!0,severity:a,url:globalThis.location.href,x:b.x,y:b.y};await p.createAnnotation(_),await q(),x(),X("Annotation created")}catch{c.textContent="Error — retry",c.disabled=!1}}},"#22c55e");h.append(c),i.append(h),i.append($t(t,x)),rt(i,e.x+e.width/2,e.bottom,d)},ro=(e,t,n)=>{const o=window.innerWidth,i=window.innerHeight,r=8;let s;n+r+e.height<=i-r?s=n+r:n-r-e.height>=r?s=n-r-e.height:s=Math.max(r,i-e.height-r);let a;return t+e.width<=o-r?a=t:t-e.width>=r?a=t-e.width:a=Math.max(r,o-e.width-r),{left:a,top:s}},rt=(e,t,n,o)=>{e.style.top="-9999px",e.style.left="-9999px",e.parentElement||document.body.append(e);const i=()=>{if(!document.contains(e))return;const s=e.getBoundingClientRect(),{left:a,top:d}=ro(s,t,n);e.style.top=`${d}px`,e.style.left=`${a}px`};requestAnimationFrame(()=>{i(),o?.focus()});const r=new ResizeObserver(()=>{i()});r.observe(e),e.__resizeObserver=r},$e=(e,t,n,o)=>{const i=document.createElement("div");i.style.cssText="margin-bottom:8px;";const r=document.createElement("div");r.style.cssText=`color:${e.muted};font-size:10px;margin-bottom:4px;`,r.textContent=t,i.append(r);const s=document.createElement("div");s.style.cssText="display:flex;gap:4px;";const a=[];for(const d of n){const x=document.createElement("button");x.type="button",x.textContent=d.label,x.dataset.key=d.key,x.style.cssText=`cursor:pointer;font:10px/1 'JetBrains Mono',monospace;padding:4px 8px;border:1px solid;white-space:nowrap;${d.active?d.activeStyle:`background:${e.btnBg};border-color:${e.btnBorder};color:${e.muted}`}`,x.addEventListener("click",h=>{h.preventDefault(),h.stopPropagation(),o(d.key);for(const c of a){const u=n.find(p=>p.key===c.dataset.key);c.dataset.key===d.key&&u?Object.assign(c.style,io(u.activeStyle)):(c.style.background=e.btnBg,c.style.borderColor=e.btnBorder,c.style.color=e.muted)}}),a.push(x),s.append(x)}return i.append(s),i},io=e=>{const t={};for(const n of e.split(";")){const o=n.indexOf(":");if(o===-1)continue;const i=n.slice(0,o).trim(),r=n.slice(o+1).trim();if(i&&r){const s=i.replaceAll(/-([a-z])/g,(a,d)=>d.toUpperCase());t[s]=r}}return t},j=()=>{const e=document.querySelector(`#${wt}`);e?.annotationId&&it(e.annotationId,!1),e?.__cleanup?.(),e?.__resizeObserver?.disconnect(),e?.remove()},it=(e,t)=>{const n=document.querySelector(`.${pe}[data-annotation-id="${e}"]`);if(n)if(t){n.dataset.popupOpen="true",n.style.transform="scale(1.25)";const o=n.querySelector("span:not(.__vdt_edit_icon)");if(o&&(o.style.display="none"),n.querySelector(".__vdt_edit_icon"))n.querySelector(".__vdt_edit_icon").style.display="flex";else{const i=document.createElement("span");i.className="__vdt_edit_icon",i.style.cssText="display:flex;align-items:center;justify-content:center;";const r=new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/></svg>',"image/svg+xml");i.append(r.documentElement),n.append(i)}}else{delete n.dataset.popupOpen,n.style.transform="";const o=n.querySelector("span:not(.__vdt_edit_icon)");o&&(o.style.display="");const i=n.querySelector(".__vdt_edit_icon");i&&(i.style.display="none")}},he=e=>{j(),F(),it(e.id,!0);const t=Ye(),n=H[e.intent],o=t.bg==="#18181b",i=document.createElement("div");i.id=wt,i.annotationId=e.id,i.style.cssText=["position:fixed","z-index:2147483647",`background:${t.bg}`,`border:1px solid ${o?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.1)"}`,"padding:0","font:12px/1.5 -apple-system,BlinkMacSystemFont,system-ui,sans-serif",`color:${t.fg}`,`box-shadow:0 8px 32px rgba(0,0,0,${o?"0.5":"0.15"}),0 0 0 1px rgba(${o?"255,255,255,0.06":"0,0,0,0.06"})`,"width:360px","max-height:70vh","overflow:hidden","display:flex","flex-direction:column","pointer-events:auto"].join(";");const{left:r,top:s}=Re(e.x,e.y,e.isFixed??!1),a=document.createElement("div");a.style.cssText=`display:flex;align-items:center;gap:6px;padding:10px 12px;border-bottom:1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"};flex-shrink:0;`;const d=document.createElement("span");d.textContent=qe[e.intent].toUpperCase(),d.style.cssText=`font-size:10px;font-weight:700;letter-spacing:0.05em;padding:2px 6px;background:${n.bg};color:${n.fg};`,a.append(d);const x=document.createElement("span");x.textContent=He[e.severity],x.style.cssText=`font-size:10px;font-weight:600;color:${e.severity==="blocking"?t.danger:t.muted};`,a.append(x);const h=document.createElement("span");h.textContent=e.status.toUpperCase(),h.style.cssText=`font-size:10px;font-weight:700;letter-spacing:0.08em;padding:2px 6px;margin-left:auto;background:${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)"};color:${t.muted};`,a.append(h);const c=document.createElement("button");c.type="button",c.textContent="×",c.style.cssText=`background:none;border:none;color:${t.muted};cursor:pointer;font-size:16px;padding:0 0 0 4px;line-height:1;`,c.addEventListener("click",m=>{m.preventDefault(),m.stopPropagation(),j()}),a.append(c),i.append(a);const u=document.createElement("div");u.style.cssText="flex:1;overflow-y:auto;padding:10px 12px;";const p=document.createElement("div");p.style.cssText=`padding:8px 10px;background:${o?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)"};font-size:13px;line-height:1.6;white-space:pre-wrap;word-break:break-word;margin-bottom:10px;`,p.textContent=e.comment,u.append(p);const b=document.createElement("details");b.style.cssText=`margin-bottom:10px;font-size:10px;color:${t.muted};`;const _=document.createElement("summary");_.textContent=`${e.elementLabel??e.elementTag}${e.source?` • ${e.source.split("/").pop()}`:""}`,_.style.cssText=`cursor:pointer;font-size:10px;color:${t.muted};padding:4px 0;list-style:none;`,_.addEventListener("click",m=>m.stopPropagation()),b.append(_);const v=document.createElement("div");if(v.style.cssText="padding:6px 0;line-height:1.7;",ne(v,"Element",`${e.elementTag}${e.cssClasses?` .${e.cssClasses}`:""}`),e.elementPath&&ne(v,"Selector",e.elementPath),e.source&&ne(v,"Source",e.source,t.primary),e.frameworkContext&&ne(v,"Component",`${e.frameworkContext.componentName} (${e.frameworkContext.framework})`,t.success),e.nearbyText&&ne(v,"Context",e.nearbyText),e.selectedText&&ne(v,"Selected",`"${e.selectedText}"`),ne(v,"URL",e.url),ne(v,"Created",new Date(e.createdAt).toLocaleString()),b.append(v),u.append(b),e.thread&&e.thread.length>0){const m=document.createElement("div");m.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,m.textContent=`Thread · ${e.thread.length}`,u.append(m);const y=document.createElement("div");y.style.cssText="max-height:160px;overflow-y:auto;margin-bottom:8px;display:flex;flex-direction:column;gap:4px;";for(const w of e.thread){const A=w.role==="human",f=document.createElement("div");f.style.cssText=["max-width:85%","padding:6px 10px",`border-radius:${A?"2px 2px 0 2px":"2px 2px 2px 0"}`,"font-size:11px","line-height:1.45","white-space:pre-wrap","word-break:break-word",`align-self:${A?"flex-end":"flex-start"}`,A?`background:${t.primary};color:#18181b`:`background:${o?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"};color:${t.fg}`].join(";"),f.textContent=w.content;const B=document.createElement("div");B.style.cssText=`font-size:10px;color:${t.muted};margin-top:2px;opacity:0.6;text-align:${A?"right":"left"};`,B.textContent=new Date(w.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});const C=document.createElement("div");C.style.cssText=`display:flex;flex-direction:column;align-items:${A?"flex-end":"flex-start"};`,C.append(f,B),y.append(C)}requestAnimationFrame(()=>{y.scrollTop=y.scrollHeight}),u.append(y)}i.append(u);const P=document.createElement("div");P.style.cssText=`display:flex;gap:6px;align-items:flex-end;padding:8px 12px;border-top:1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"};flex-shrink:0;`;const k=document.createElement("textarea");k.placeholder="Message...",k.rows=1,k.style.cssText=`flex:1;min-height:28px;max-height:80px;resize:none;padding:5px 8px;background:${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)"};border:1px solid transparent;color:${t.fg};font:11px/1.4 -apple-system,BlinkMacSystemFont,system-ui,sans-serif;box-sizing:border-box;outline:none;`,k.addEventListener("click",m=>m.stopPropagation()),k.addEventListener("keydown",m=>m.stopPropagation()),k.addEventListener("focus",()=>{k.style.borderColor=t.primary}),k.addEventListener("blur",()=>{k.style.borderColor="transparent"}),k.addEventListener("input",()=>{k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,80)}px`}),P.append(k);const T=document.createElement("button");T.type="button",T.style.cssText=`width:28px;height:28px;border-radius:50%;border:none;background:${t.primary};color:#18181b;cursor:not-allowed;opacity:0.3;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:opacity 0.15s,background 0.15s;`;const R=new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m5 12 7-7 7 7"/><path d="M12 19V5"/></svg>',"image/svg+xml");T.append(R.documentElement),T.disabled=!0,k.addEventListener("input",()=>{const m=k.value.trim().length>0;T.disabled=!m,T.style.opacity=m?"1":"0.3",T.style.cursor=m?"pointer":"not-allowed"}),T.addEventListener("click",async m=>{m.preventDefault(),m.stopPropagation();const y=k.value.trim();if(!y)return;await O()?.updateAnnotation?.(e.id,{threadMessage:{content:y,role:"human",timestamp:new Date().toISOString()}}),X("Message sent"),await q();const w=Q.find(A=>A.id===e.id);w&&he(w)}),P.append(T),i.append(P);const M=document.createElement("div");if(M.style.cssText=`display:flex;align-items:center;gap:4px;padding:6px 12px;border-top:1px solid ${o?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.04)"};flex-shrink:0;`,e.status==="pending"){const m=document.createElement("button");m.type="button",m.textContent="Resolve",m.style.cssText=`padding:4px 10px;border:none;background:${t.success};color:#fff;font-size:10px;font-weight:600;cursor:pointer;`,m.addEventListener("click",async w=>{w.stopPropagation(),await O()?.updateAnnotation?.(e.id,{status:"resolved"}),X("Annotation resolved"),await q(),j()}),M.append(m);const y=document.createElement("button");y.type="button",y.textContent="Edit",y.style.cssText=`padding:4px 10px;border:1px solid ${t.btnBorder};background:transparent;color:${t.fg};font-size:10px;font-weight:500;cursor:pointer;`,y.addEventListener("click",w=>{for(w.stopPropagation();i.firstChild;)i.firstChild.remove();i.style.padding="0",i.style.overflow="hidden",i.style.display="flex";const A=document.createElement("div");A.style.cssText=`display:flex;align-items:center;padding:10px 12px;border-bottom:1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"};flex-shrink:0;`;const f=document.createElement("span");f.textContent="Edit Annotation",f.style.cssText=`font-size:12px;font-weight:700;color:${t.fg};`,A.append(f);const B=document.createElement("button");B.type="button",B.textContent="×",B.style.cssText=`background:none;border:none;color:${t.muted};cursor:pointer;font-size:16px;padding:0;line-height:1;margin-left:auto;`,B.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),j(),he(e)}),A.append(B),i.append(A);const C=document.createElement("div");C.style.cssText="flex:1;overflow-y:auto;padding:12px;";const Y=document.createElement("div");Y.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,Y.textContent="Intent",C.append(Y);let W=e.intent;const ee=document.createElement("div");ee.style.cssText="display:flex;gap:4px;margin-bottom:12px;";const me=[];for(const z of["fix","change","question","approve"]){const I=H[z],N=document.createElement("button");N.type="button",N.textContent=qe[z],N.dataset.intent=z,N.style.cssText=`padding:4px 10px;border:none;font-size:10px;font-weight:600;cursor:pointer;transition:all 0.15s;${z===W?`background:${I.bg};color:${I.fg};box-shadow:0 0 0 1px ${I.border};`:`background:${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)"};color:${t.muted};`}`,N.addEventListener("click",U=>{U.preventDefault(),U.stopPropagation(),W=z;for(const te of me){const st=H[te.dataset.intent];te.dataset.intent===z?(te.style.background=st.bg,te.style.color=st.fg,te.style.boxShadow=`0 0 0 1px ${st.border}`):(te.style.background=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",te.style.color=t.muted,te.style.boxShadow="none")}}),me.push(N),ee.append(N)}C.append(ee);const Te=document.createElement("div");Te.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,Te.textContent="Severity",C.append(Te);let Ce=e.severity;const Se=document.createElement("div");Se.style.cssText="display:flex;gap:4px;margin-bottom:12px;";const Xe=[];for(const z of["blocking","important","suggestion"]){const I=document.createElement("button");I.type="button",I.textContent=He[z],I.dataset.severity=z,I.style.cssText=`padding:4px 10px;border:none;font-size:10px;font-weight:600;cursor:pointer;transition:all 0.15s;${z===Ce?`background:${t.primary};color:#18181b;`:`background:${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)"};color:${t.muted};`}`,I.addEventListener("click",N=>{N.preventDefault(),N.stopPropagation(),Ce=z;for(const U of Xe)U.dataset.severity===z?(U.style.background=t.primary,U.style.color="#18181b"):(U.style.background=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",U.style.color=t.muted)}),Xe.push(I),Se.append(I)}C.append(Se);const Le=document.createElement("div");Le.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,Le.textContent="Comment",C.append(Le);const D=document.createElement("textarea");D.value=e.comment,D.style.cssText=`width:100%;min-height:90px;resize:vertical;padding:8px 10px;background:${o?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.03)"};border:1px solid ${o?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"};color:${t.fg};font:12px/1.5 -apple-system,BlinkMacSystemFont,system-ui,sans-serif;box-sizing:border-box;outline:none;transition:border-color 0.15s;`,D.addEventListener("click",z=>z.stopPropagation()),D.addEventListener("keydown",z=>z.stopPropagation()),D.addEventListener("focus",()=>{D.style.borderColor=t.primary}),D.addEventListener("blur",()=>{D.style.borderColor=o?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"}),C.append(D),i.append(C);const Be=document.createElement("div");Be.style.cssText=`display:flex;align-items:center;gap:6px;padding:8px 12px;border-top:1px solid ${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"};flex-shrink:0;`;const Ae=document.createElement("button");Ae.type="button",Ae.textContent="Save",Ae.style.cssText=`padding:4px 10px;border:none;background:${t.primary};color:#18181b;font-size:10px;font-weight:600;cursor:pointer;`,Ae.addEventListener("click",async z=>{z.stopPropagation();const I=D.value.trim();if(!I){D.style.borderColor=t.danger;return}await O()?.updateAnnotation?.(e.id,{comment:I,intent:W,severity:Ce}),X("Annotation saved"),await q();const N=Q.find(U=>U.id===e.id);N?(j(),he(N)):j()}),Be.append(Ae);const Me=document.createElement("button");Me.type="button",Me.textContent="Cancel",Me.style.cssText=`padding:4px 10px;border:1px solid ${t.btnBorder};background:transparent;color:${t.fg};font-size:10px;font-weight:500;cursor:pointer;`,Me.addEventListener("click",z=>{z.stopPropagation(),j(),he(e)}),Be.append(Me);const ze=document.createElement("button");ze.type="button",ze.textContent="Delete",ze.style.cssText=`padding:4px 10px;border:none;background:transparent;color:${t.danger};font-size:10px;cursor:pointer;margin-left:auto;`,ze.addEventListener("click",async z=>{z.stopPropagation(),await O()?.deleteAnnotation?.(e.id),Q=Q.filter(I=>I.id!==e.id),X("Annotation deleted"),j(),tt()}),Be.append(ze),i.append(Be),setTimeout(()=>D.focus(),50)}),M.append(y)}const $=document.createElement("div");if($.style.cssText="display:flex;gap:2px;margin-left:auto;",e.status==="pending"){const m=document.createElement("button");m.type="button",m.textContent="Dismiss",m.style.cssText=`padding:4px 8px;border:none;background:transparent;color:${t.muted};font-size:10px;cursor:pointer;`,m.addEventListener("click",async y=>{y.stopPropagation(),await O()?.updateAnnotation?.(e.id,{status:"dismissed"}),X("Annotation dismissed"),await q(),j()}),$.append(m)}const L=document.createElement("button");L.type="button",L.textContent="Copy",L.style.cssText=`padding:4px 8px;border:none;background:transparent;color:${t.muted};font-size:10px;cursor:pointer;`,L.addEventListener("click",async m=>{m.stopPropagation();try{await navigator.clipboard.writeText(vt([e])),X("Copied to clipboard")}catch{X("Copy failed","error")}}),$.append(L);const S=document.createElement("button");S.type="button",S.textContent="Delete",S.style.cssText=`padding:4px 8px;border:none;background:transparent;color:${t.danger};font-size:10px;cursor:pointer;`,S.addEventListener("click",async m=>{m.stopPropagation(),await O()?.deleteAnnotation?.(e.id),Q=Q.filter(y=>y.id!==e.id),X("Annotation deleted"),j(),tt()}),$.append(S),M.append($),i.append(M),rt(i,r+16,s);const l=m=>{!i.contains(m.target)&&!m.target?.classList.contains(pe)&&j()},g=setTimeout(()=>{document.addEventListener("click",l,!0)},100);i.__cleanup=()=>{clearTimeout(g),document.removeEventListener("click",l,!0)}};let we;const so=()=>{we||(we=e=>{if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.key==="C"){e.preventDefault();const t=vt(Q);navigator.clipboard.writeText(t).catch(()=>{})}},document.addEventListener("keydown",we))},xn=()=>{we&&(document.removeEventListener("keydown",we),we=void 0)},zt=e=>{if(!e)return!1;for(const t of[ue,wt]){const n=document.querySelector(`#${t}`);if(n&&(e===n||n.contains(e)))return!0}return!!e.closest?.(`.${pe}`)},ao=e=>{const t={};for(const h of e.attributes)h.name.startsWith("aria-")&&(t[h.name]=h.value);const n=e.getAttribute("role"),o=e.getAttribute("tabindex"),i=o===null?null:Number.parseInt(o,10),r=new Set(["a","button","details","input","select","summary","textarea"]),s=e.tagName.toLowerCase(),a=r.has(s)&&!e.hasAttribute("disabled"),d=e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false",x=a||d||i!==null&&i>=0;return{ariaAttributes:t,focusable:x,role:n,tabindex:i}},lo=e=>{const t=[];e.role&&t.push(`role: ${e.role}`),t.push(`focusable: ${e.focusable}`),e.tabindex!==null&&t.push(`tabindex: ${e.tabindex}`);for(const[n,o]of Object.entries(e.ariaAttributes))t.push(`${n}: ${o}`);return t.join(`
30
+ `)},Et="__vdt_ruler_corner",_t="__vdt_ruler_h",Tt="__vdt_ruler_v",Ct="__vdt_guideline",hn='9px "JetBrains Mono","Geist Mono",ui-monospace,monospace';let ke=!1,fe=null,K=null,J=null,ot=new Set,je=null,Fe=null,Ne=null;const fn=e=>{const t=80/e,n=10**Math.floor(Math.log10(t)),o=t/n;let i;o<=1?i=1:o<=2?i=2:o<=5?i=5:i=10;const r=i*n,s=10,a=r/s;return{major:r,minor:a,stepsPerMajor:s}},bn=(e,t)=>{const n=window.devicePixelRatio||1,o=e.clientWidth,i=20;e.width=o*n,e.height=i*n;const r=e.getContext("2d");if(!r)return;r.scale(n,n),r.clearRect(0,0,o,i),r.strokeStyle=t.btnBorder,r.lineWidth=1,r.beginPath(),r.moveTo(0,i-.5),r.lineTo(o,i-.5),r.stroke();const{scrollX:s}=globalThis,{minor:a,stepsPerMajor:d}=fn(1);r.fillStyle=t.muted,r.strokeStyle=t.muted,r.lineWidth=1,r.font=hn,r.textAlign="center",r.textBaseline="top";const x=Math.floor(s/a),h=Math.ceil((s+o)/a);for(let c=x;c<=h;c++){const u=c*a,p=u-s;if(p<0||p>o)continue;const b=c%d===0,_=c%(d/2)===0;let v;b?v=10:_?v=7:v=4,r.beginPath(),r.moveTo(Math.round(p)+.5,i),r.lineTo(Math.round(p)+.5,i-v),r.stroke(),b&&(r.fillStyle=t.fg,r.fillText(String(Math.round(u)),Math.round(p),2),r.fillStyle=t.muted)}},yn=(e,t)=>{const n=window.devicePixelRatio||1,o=20,i=e.clientHeight;e.width=o*n,e.height=i*n;const r=e.getContext("2d");if(!r)return;r.scale(n,n),r.clearRect(0,0,o,i),r.strokeStyle=t.btnBorder,r.lineWidth=1,r.beginPath(),r.moveTo(o-.5,0),r.lineTo(o-.5,i),r.stroke();const{scrollY:s}=globalThis,{minor:a,stepsPerMajor:d}=fn(1);r.fillStyle=t.muted,r.strokeStyle=t.muted,r.lineWidth=1,r.font=hn;const x=Math.floor(s/a),h=Math.ceil((s+i)/a);for(let c=x;c<=h;c++){const u=c*a,p=u-s;if(p<0||p>i)continue;const b=c%d===0,_=c%(d/2)===0;let v;b?v=10:_?v=7:v=4,r.beginPath(),r.moveTo(o,Math.round(p)+.5),r.lineTo(o-v,Math.round(p)+.5),r.stroke(),b&&(r.save(),r.fillStyle=t.fg,r.translate(9,Math.round(p)),r.rotate(-Math.PI/2),r.textAlign="center",r.textBaseline="top",r.fillText(String(Math.round(u)),0,0),r.restore())}},Pt=()=>{Ne&&(K&&bn(K,Ne),J&&yn(J,Ne))},co=e=>{const t=[],n=document.querySelectorAll("body *"),o=2e3;let i=0;for(const r of n){if(i>=o)break;if(r.id===Et||r.id===_t||r.id===Tt||r.classList.contains(Ct))continue;const s=r.getBoundingClientRect();s.width===0&&s.height===0||(e==="horizontal"?t.push(s.top,s.bottom):t.push(s.left,s.right),i++)}return t},po=(e,t)=>{let n=null,o=6;for(const i of t){const r=Math.abs(i-e);r<o&&(o=r,n=i)}return n},Qe=9,Rt=(e,t,n)=>{const o=document.createElement("div");o.className=Ct;const i=e==="horizontal";o.style.cssText=["position:fixed","z-index:2147483644","pointer-events:none",i?`top:${t}px;left:0;width:100vw;height:0`:`left:${t}px;top:0;width:0;height:100vh`].join(";");const r=document.createElement("div");r.style.cssText=["position:absolute","pointer-events:none",i?"left:0;right:0;height:1px;top:0;transform:translateY(-0.5px)":"top:0;bottom:0;width:1px;left:0;transform:translateX(-0.5px)",`background:${n.primary}`].join(";"),o.append(r);const s=document.createElement("div");s.style.cssText=["position:absolute","pointer-events:auto",i?`left:0;right:0;height:${Qe*2+1}px;top:${-Qe}px`:`top:0;bottom:0;width:${Qe*2+1}px;left:${-Qe}px`,"background:transparent",i?"cursor:row-resize":"cursor:col-resize"].join(";"),o.append(s);const a=document.createElement("div");a.style.cssText=["position:absolute",`background:${n.primary}`,"color:#fff",'font:9px/1 "JetBrains Mono","Geist Mono",ui-monospace,monospace',"padding:2px 4px","white-space:nowrap","pointer-events:none",i?"left:24px;top:2px":"top:24px;left:2px"].join(";"),o.append(a),document.body.append(o),ot.add(o);let d=t;const x=c=>{d=c,i?o.style.top=`${d}px`:o.style.left=`${d}px`;const u=i?d+window.scrollY:d+window.scrollX;a.textContent=`${Math.round(u)}px`},h=()=>{let c=performance.now(),u=d,p=!1,b=null;a.style.display="";const _=P=>{const k=performance.now(),T=i?P.clientY:P.clientX,R=Math.abs(T-u)/Math.max(1,k-c);if(c=k,u=T,b===null&&(b=co(e)),R<3){const M=po(T,b);if(M!==null){x(M),p||(p=!0,r.style.background="#0D99FF",a.style.background="#0D99FF");return}}p&&(p=!1,r.style.background=n.primary,a.style.background=n.primary),x(T)},v=()=>{document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",v),a.style.display="none",r.style.background=n.primary,a.style.background=n.primary,(i&&d<20||!i&&d<20)&&(o.remove(),ot.delete(o))};document.addEventListener("pointermove",_),document.addEventListener("pointerup",v)};s.addEventListener("pointerdown",c=>{c.preventDefault(),c.stopPropagation(),h()}),x(d),h()},uo=e=>{ke||(Ne=e,fe=document.createElement("div"),fe.id=Et,fe.style.cssText=["position:fixed","top:0","left:0","width:20px","height:20px",`background:${e.bg}`,`border-right:1px solid ${e.btnBorder}`,`border-bottom:1px solid ${e.btnBorder}`,"z-index:2147483646","pointer-events:none"].join(";"),document.body.append(fe),K=document.createElement("canvas"),K.id=_t,K.style.cssText=["position:fixed","top:0","left:20px","height:20px","width:calc(100vw - 20px)",`background:${e.bg}`,"z-index:2147483646","pointer-events:auto","cursor:s-resize"].join(";"),K.addEventListener("pointerdown",t=>{t.preventDefault(),Rt("horizontal",t.clientY,e)}),document.body.append(K),J=document.createElement("canvas"),J.id=Tt,J.style.cssText=["position:fixed","top:20px","left:0","width:20px","height:calc(100vh - 20px)",`background:${e.bg}`,"z-index:2147483646","pointer-events:auto","cursor:e-resize"].join(";"),J.addEventListener("pointerdown",t=>{t.preventDefault(),Rt("vertical",t.clientX,e)}),document.body.append(J),bn(K,e),yn(J,e),je=Pt,window.addEventListener("resize",je),Fe=Pt,window.addEventListener("scroll",Fe,{passive:!0}),ke=!0)},vn=()=>{if(ke){fe?.remove(),K?.remove(),J?.remove();for(const e of ot)e.remove();ot.clear(),je&&(window.removeEventListener("resize",je),je=null),Fe&&(window.removeEventListener("scroll",Fe),Fe=null),fe=null,K=null,J=null,Ne=null,ke=!1}},It=()=>ke,ut=e=>{if(!ke)return!1;const{id:t}=e;return t===Et||t===_t||t===Tt?!0:e.classList.contains(Ct)},Ee=qn,mo=pn,se="__vdt_inspector_overlay",go=new Set(["A","B","BLOCKQUOTE","CITE","CODE","EM","FIGCAPTION","H1","H2","H3","H4","H5","H6","I","LABEL","LI","MARK","P","PRE","Q","S","SMALL","SPAN","STRONG","TD","TH","TIME","U"]),wn="__vdt_inspector_label",ht="__vdt_inspector_cursor",V="__vdt_inspector_badge",Dt="__vdt_inspector_kf",_e="__vdt_inspector_result",Ue=e=>{if(!e)return!1;if(e.tagName==="DEV-TOOLBAR")return!0;let t=e;for(;t;)if(t instanceof ShadowRoot){if(t.host?.tagName==="DEV-TOOLBAR")return!0;t=t.host}else t=t.parentNode;return!1},xo=()=>{let e=document.querySelector(`#${se}`);if(!e){const t=Ee();e=document.createElement("div"),e.id=se,e.style.cssText=["position:fixed","pointer-events:none","z-index:2147483644","box-sizing:border-box",`border:1px solid ${t.overlayBorder}`,`background:${t.overlayBg}`,"transition:top 60ms,left 60ms,width 60ms,height 60ms","display:none"].join(";");const n=document.createElement("div");n.id=wn,n.style.cssText=["position:absolute","bottom:calc(100% + 2px)","left:0",`background:${t.bg}`,`color:${t.primary}`,"font:11px/1.2 'JetBrains Mono',monospace","padding:2px 6px","white-space:nowrap","pointer-events:none",`border:1px solid ${t.btnBorder}`].join(";"),e.append(n),document.body.append(e)}return e},ft=e=>{let t=e;for(;t;){const n=t.dataset.vdtSource;if(n)return n;t=t.parentElement??void 0}},ho=e=>{const t=e.split(":");if(t.length<3)return e;const n=t[t.length-2],o=t.slice(0,-2).join(":");return`${o.split("/").pop()??o}:${n}`},Ke=e=>{const t=document.querySelector(`#${se}`);if(!t)return;const n=e.getBoundingClientRect();t.style.display="block",t.style.top=`${n.top}px`,t.style.left=`${n.left}px`,t.style.width=`${n.width}px`,t.style.height=`${n.height}px`;const o=document.querySelector(`#${wn}`);if(o){const i=e.tagName.toLowerCase(),r=e.id?`#${e.id}`:"",s=e.classList.length>0?`.${[...e.classList].slice(0,3).join(".")}`:"",a=`${i}${r}${s}`,d=ft(e);o.textContent=d?`${a} · ${ho(d)}`:a,n.top<28?(o.style.bottom="auto",o.style.top="calc(100% + 2px)"):(o.style.top="",o.style.bottom="calc(100% + 2px)")}},ge=()=>{const e=document.querySelector(`#${se}`);e&&(e.style.display="none")},fo=()=>{document.querySelector(`#${se}`)?.remove(),document.querySelector(`#${ht}`)?.remove()},jt=e=>{let t=document.querySelector(`#${ht}`);e?(t||(t=document.createElement("style"),t.id=ht,document.head.append(t)),t.textContent=["*, *::before, *::after { cursor: crosshair !important; }",`#${V}, #${V} * { cursor: pointer !important; }`,`#${_e}, #${_e} * { cursor: pointer !important; }`,".__vdt_annotation_marker, .__vdt_annotation_marker * { cursor: pointer !important; }","#__vdt_annotation_form, #__vdt_annotation_form * { cursor: auto !important; }","#__vdt_annotation_form textarea { cursor: text !important; }","#__vdt_annotation_form button, #__vdt_annotation_form select { cursor: pointer !important; }","#__vdt_annotation_detail, #__vdt_annotation_detail * { cursor: auto !important; }","#__vdt_annotation_detail textarea { cursor: text !important; }","#__vdt_annotation_detail button { cursor: pointer !important; }","#__vdt_clear_confirm, #__vdt_clear_confirm * { cursor: auto !important; }","#__vdt_clear_confirm button { cursor: pointer !important; }","#__vdt_area_outline { cursor: auto !important; }","#__vdt_ruler_h { cursor: s-resize !important; }","#__vdt_ruler_v { cursor: e-resize !important; }",".__vdt_guideline { cursor: row-resize !important; }"].join(" ")):t&&t.remove()};let Oe="inspect";const $n=()=>{document.querySelector(`#${V}`)?.remove()},St=e=>new DOMParser().parseFromString(e,"image/svg+xml").documentElement,Ft='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="14" y="4" width="4" height="16" rx="1"/><rect x="6" y="4" width="4" height="16" rx="1"/></svg>',Nt='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="6 3 20 12 6 21 6 3"/></svg>',Ot='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/></svg>',bo='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/><path d="m2 2 20 20"/></svg>',yo='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>',vo='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/></svg>',wo='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',$o='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"/><path d="M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"/></svg>',ko='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M12 8v4"/><path d="M12 16h.01"/></svg>',Eo='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"/><path d="m14.5 12.5 2-2"/><path d="m11.5 9.5 2-2"/><path d="m8.5 6.5 2-2"/><path d="m17.5 15.5 2-2"/></svg>';let Z=!0;const xe=(e,t,n,o,i=!1)=>{const r=document.createElement("button");r.type="button",r.title=n,r.dataset.active=i?"1":"",r.style.cssText=["position:relative","display:flex","justify-content:center","align-items:center","border:0","white-space:nowrap","padding:0","margin:0","cursor:pointer",`background:${i?`${e.primary}1f`:"transparent"}`,`color:${i?e.primary:e.muted}`,"transition:all 150ms"].join(";");const s=document.createElement("div");return s.style.cssText="width:24px;height:24px;display:flex;align-items:center;justify-content:center;user-select:none;",s.append(St(t)),r.append(s),r.addEventListener("pointerover",()=>{r.style.background=`${e.primary}14`,r.style.color=e.primary}),r.addEventListener("pointerout",()=>{const a=r.dataset.active==="1";r.style.background=a?`${e.primary}1f`:"transparent",r.style.color=a?e.primary:e.muted}),r.addEventListener("pointerdown",()=>{r.style.transform="scale(0.94)"}),r.addEventListener("pointerup",()=>{r.style.transform=""}),r.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),o()}),r},qt=(e,t)=>{const n=e.querySelector("svg");n&&n.replaceWith(St(t))},mt=(e,t="success")=>{const n="__vdt_toast";document.getElementById(n)?.remove();const o=document.createElement("div");o.id=n,o.textContent=e,o.style.cssText=["position:fixed","z-index:2147483646","bottom:1rem","right:1rem","padding:6px 14px","border-radius:4px",`background:${t==="success"?"#22c55e":"#ef4444"}`,"color:#fff",'font:12px/1 "JetBrains Mono","Geist Mono",ui-monospace,"Cascadia Code","Fira Code",monospace',"font-weight:600","pointer-events:none","opacity:0","transition:opacity 0.2s,transform 0.2s","transform:translateY(4px)"].join(";"),document.body.append(o),requestAnimationFrame(()=>{o.style.opacity="1",o.style.transform="translateY(0)"}),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),200)},1500)},_o=e=>{if(!document.querySelector(`#${Dt}`)){const $=document.createElement("style");$.id=Dt,$.textContent="@keyframes __vdt_pulse{0%,100%{opacity:1}50%{opacity:.3}}",document.head.append($)}$n(),Z=!0;const t=Ee(),n=document.createElement("div"),o=t===mo,i=o?"0 6px 24px rgba(0,0,0,.7),0 2px 8px rgba(0,0,0,.5)":"0 4px 20px rgba(0,0,0,.12),0 0 0 1px rgba(0,0,0,.08)";n.id=V,n.style.cssText=["position:fixed","bottom:4rem","left:50%","transform:translateX(-50%)","z-index:2147483645","display:flex","align-items:center","gap:4px","padding:4px",`background:${t.bg}`,"border:0",`box-shadow:${i}`,"pointer-events:auto","user-select:none",'font:13px/1.6 "JetBrains Mono","Geist Mono",ui-monospace,"Cascadia Code","Fira Code",monospace'].join(";"),n.addEventListener("click",$=>$.stopPropagation()),n.addEventListener("mousedown",$=>$.stopPropagation());let r=0,s=0;const a=$=>{n.style.left=`${$.clientX-r}px`,n.style.top=`${$.clientY-s}px`,n.style.transform="none",n.style.bottom="auto",n.style.cursor="grabbing"},d=()=>{document.removeEventListener("pointermove",a),document.removeEventListener("pointerup",d),n.style.cursor=""};n.addEventListener("pointerdown",$=>{if($.target.closest("button"))return;const L=n.getBoundingClientRect();r=$.clientX-L.left,s=$.clientY-L.top,document.addEventListener("pointermove",a),document.addEventListener("pointerup",d)});const x=document.createElement("div");x.style.cssText=["display:flex","flex-direction:column","gap:2px","padding:2px 4px","cursor:grab",`color:${t.muted}`,"opacity:0.4","transition:opacity 0.15s"].join(";"),x.addEventListener("pointerover",()=>{x.style.opacity="0.8"}),x.addEventListener("pointerout",()=>{x.style.opacity="0.4"});for(let $=0;$<3;$++){const L=document.createElement("div");L.style.cssText="display:flex;gap:2px;";for(let S=0;S<2;S++){const l=document.createElement("div");l.style.cssText=`width:2px;height:2px;border-radius:50%;background:${t.muted};`,L.append(l)}x.append(L)}n.append(x),Oe="inspect";const h=($,L,S)=>{const l=document.createElement("button");l.type="button",l.title=L;const g=document.createElement("div");g.style.cssText="width:24px;height:24px;display:flex;align-items:center;justify-content:center;user-select:none;",g.append(St($)),l.append(g);const m=()=>{const y=Oe===S;l.style.cssText=["position:relative","display:flex","justify-content:center","align-items:center","border:0","white-space:nowrap","padding:0","margin:0","cursor:pointer",`background:${y?`${t.primary}1f`:"transparent"}`,`color:${y?t.primary:t.muted}`,"transition:all 150ms"].join(";")};return m(),l.addEventListener("pointerover",()=>{l.style.background=`${t.primary}14`,l.style.color=t.primary}),l.addEventListener("pointerout",m),l.addEventListener("pointerdown",()=>{l.style.transform="scale(0.94)"}),l.addEventListener("pointerup",()=>{l.style.transform=""}),l.addEventListener("click",y=>{y.preventDefault(),y.stopPropagation(),Oe=S,m();for(const w of n.querySelectorAll("[data-mode]"))w!==l&&w.dispatchEvent(new Event("pointerout"))}),l.dataset.mode=S,l},c=h($o,"Inspect mode — click to view source & info","inspect");n.append(c);const u=h(ko,"Annotate mode — click to add feedback","annotate");n.append(u);const p=document.createElement("span");p.style.cssText=`width:1px;height:20px;background:${o?"rgba(196,181,253,0.2)":"rgba(124,58,237,0.2)"};flex-shrink:0;`,n.append(p);const b=In(),_=xe(t,b?Nt:Ft,b?"Resume animations (P)":"Pause animations (P)",()=>{const $=jn();qt(_,$?Nt:Ft),_.title=$?"Resume animations (P)":"Pause animations (P)",_.dataset.active=$?"1":"",_.style.color=$?t.primary:t.muted,_.style.background=$?`${t.primary}22`:"transparent"},b);n.append(_);const v=xe(t,Ot,"Toggle markers (H)",()=>{Z=!Z;for(const $ of document.querySelectorAll(".__vdt_annotation_marker"))$.style.visibility=Z?"visible":"hidden";qt(v,Z?Ot:bo),v.title=Z?"Hide markers (H)":"Show markers (H)",v.dataset.active=Z?"":"1",v.style.color=Z?t.muted:t.primary,v.style.background=Z?"transparent":`${t.primary}22`});n.append(v);const P=xe(t,yo,"Copy annotations (C)",async()=>{const $=globalThis.__VISULIMA_DEVTOOLS__?.rpc;if($?.getAnnotations)try{const L=await $.getAnnotations(),{annotationsToMarkdown:S}=await Promise.resolve().then(()=>zn),l=S(L,bt().outputDetail);await navigator.clipboard.writeText(l),mt("Copied to clipboard")}catch{mt("Copy failed","error")}});n.append(P);const k=It(),T=xe(t,Eo,"Toggle rulers (R)",()=>{It()?(vn(),T.dataset.active="",T.style.color=t.muted,T.style.background="transparent"):(uo(t),T.dataset.active="1",T.style.color=t.primary,T.style.background=`${t.primary}22`)},k);n.append(T);const R="__vdt_clear_confirm";n.append(xe(t,vo,"Clear all annotations (X)",()=>{document.getElementById(R)?.remove();const $=n.getBoundingClientRect(),L=document.createElement("div");L.id=R,L.style.cssText=["position:fixed","z-index:2147483646",`bottom:${window.innerHeight-$.top+6}px`,`left:${$.left}px`,`background:${t.bg}`,`box-shadow:${i}`,"padding:6px 12px","display:flex","align-items:center","gap:8px",'font:12px/1 "JetBrains Mono","Geist Mono",ui-monospace,"Cascadia Code","Fira Code",monospace',`color:${t.fg}`,"pointer-events:auto"].join(";"),L.addEventListener("click",m=>m.stopPropagation()),L.addEventListener("mousedown",m=>m.stopPropagation());const S=document.createElement("span");S.textContent="Clear all annotations?",S.style.cssText=`color:${t.muted};font-size:11px;`;const l=document.createElement("button");l.type="button",l.textContent="Yes, clear",l.style.cssText="background:#ef4444;color:#fff;border:none;padding:4px 10px;cursor:pointer;font-size:11px;font-weight:600;",l.addEventListener("click",async m=>{m.stopPropagation(),L.remove();const y=globalThis.__VISULIMA_DEVTOOLS__?.rpc;if(!y?.getAnnotations||!y?.deleteAnnotation)return;const w=await y.getAnnotations();await Promise.all(w.map(A=>y.deleteAnnotation(A.id))),await q(),mt(`${w.length} annotation${w.length===1?"":"s"} cleared`)});const g=document.createElement("button");g.type="button",g.textContent="Cancel",g.style.cssText=`background:transparent;color:${t.muted};border:1px solid ${t.btnBorder};padding:4px 10px;cursor:pointer;font-size:11px;`,g.addEventListener("click",m=>{m.stopPropagation(),L.remove()}),L.append(S,l,g),document.body.append(L),setTimeout(()=>L.remove(),5e3)}));const M=document.createElement("span");M.style.cssText=`width:1px;height:20px;background:${o?"rgba(196,181,253,0.2)":"rgba(124,58,237,0.2)"};flex-shrink:0;`,n.append(M),n.append(xe(t,wo,"Close inspector (Esc)",()=>{e()})),document.body.append(n)},To=(e,t)=>{const n=document.createElement("div");n.style.cssText=`margin-bottom:10px;padding:6px 8px;background:${t.btnBg};border:1px solid ${t.btnBorder};font-size:10px;line-height:1.6;`;const o=document.createElement("div");o.style.cssText=`color:${t.primary};font-weight:bold;margin-bottom:2px;font-size:11px;`,o.textContent="Accessibility",n.append(o);const i=(s,a,d=!1)=>{const x=document.createElement("div");x.style.cssText="display:flex;gap:6px;align-items:baseline;";const h=document.createElement("span");h.style.cssText=`color:${t.muted};min-width:70px;`,h.textContent=s;const c=document.createElement("span");c.style.cssText=`color:${d?t.primary:t.fg};word-break:break-all;`,c.textContent=a,x.append(h,c),n.append(x)};e.role&&i("role",e.role,!0),i("focusable",String(e.focusable)),e.tabindex!==null&&i("tabindex",String(e.tabindex));const r=Object.keys(e.ariaAttributes);for(const s of r)i(s,e.ariaAttributes[s]);if(!e.role&&r.length===0&&e.tabindex===null){const s=document.createElement("div");s.style.cssText=`color:${t.muted};font-style:italic;`,s.textContent="No ARIA attributes",n.append(s)}return n};let be;const Co=e=>{const t=e.split(":"),n=Number.parseInt(t.at(-1)??"0",10)||void 0,o=Number.parseInt(t.at(-2)??"0",10)||void 0,i=t.slice(0,-2).join(":");globalThis.__VISULIMA_DEVTOOLS__?.rpc?.openInEditor?.(i,o,n).catch(()=>{})},oe=()=>{be?.(),be=void 0,document.querySelector(`#${_e}`)?.remove()},Je=(e,t)=>{const n=Ee(),o=document.createElement("button");return o.textContent=e,o.style.cssText=[`background:${n.btnBg}`,`border:1px solid ${n.btnBorder}`,`color:${n.primary}`,"cursor:pointer","font:11px/1 'JetBrains Mono',monospace","padding:5px 10px","white-space:nowrap"].join(";"),o.addEventListener("pointerover",()=>{o.style.background=n.btnBgHover,o.style.borderColor=n.btnBorderHover}),o.addEventListener("pointerout",()=>{o.style.background=n.btnBg,o.style.borderColor=n.btnBorder}),o.addEventListener("click",i=>{i.stopPropagation(),t()}),o},Ht=(e,t,n,o,i)=>{be?.(),be=void 0,oe();const r=Ee(),s=document.createElement("div");s.id=_e,s.style.cssText=["position:fixed","z-index:2147483646",`background:${r.bg}`,`border:1px solid ${r.btnBorder}`,"padding:10px 32px 10px 12px","font:12px/1.4 'JetBrains Mono',monospace",`color:${r.fg}`,`box-shadow:${r.shadow}`,"min-width:200px","max-width:400px","pointer-events:auto"].join(";");const a=o??t.left,d=i??t.bottom,x=e.tagName.toLowerCase(),h=e.id?`#${e.id}`:"",c=e.classList.length>0?`.${[...e.classList].slice(0,3).join(".")}`:"",u=document.createElement("div");if(u.style.cssText=`color:${r.primary};font-weight:bold;margin-bottom:4px;word-break:break-all;`,u.textContent=`${x}${h}${c}`,s.append(u),n){const k=document.createElement("div");k.style.cssText=`color:${r.muted};margin-bottom:10px;word-break:break-all;font-size:10px;`,k.textContent=n,s.append(k)}const p=ao(e);s.append(To(p,r));const b=document.createElement("div");b.style.cssText="display:flex;gap:6px;flex-wrap:wrap;",n&&b.append(Je("Open in editor",()=>{Co(n),oe()})),b.append(Je("Copy HTML",()=>{navigator.clipboard.writeText(e.outerHTML).catch(()=>{}),oe()})),n&&b.append(Je("Copy path",()=>{navigator.clipboard.writeText(n).catch(()=>{}),oe()})),b.append(Je("Copy A11y",()=>{navigator.clipboard.writeText(lo(p)).catch(()=>{}),oe()})),s.append(b);const _=document.createElement("button");_.textContent="×",_.style.cssText=["position:absolute","top:6px","right:8px","background:transparent","border:none",`color:${r.muted}`,"cursor:pointer","font:16px/1 'JetBrains Mono',monospace","padding:0","line-height:1","transition:color 0.15s"].join(";"),_.addEventListener("pointerover",()=>{_.style.color=r.fg}),_.addEventListener("pointerout",()=>{_.style.color=r.muted}),_.addEventListener("click",k=>{k.stopPropagation(),oe()}),s.append(_),s.style.top="-9999px",s.style.left="-9999px",document.body.append(s),an(()=>{if(!document.contains(s))return;const k=s.getBoundingClientRect(),T=window.innerWidth,R=window.innerHeight,M=8;let $;d+M+k.height<=R-M?$=d+M:d-t.height-M-k.height>=M?$=d-t.height-M-k.height:$=Math.max(M,R-k.height-M);let L;L=a+k.width<=T-M?a:Math.max(M,T-k.width-M),s.style.top=`${$}px`,s.style.left=`${L}px`},0);const v=k=>{s.contains(k.target)||(oe(),document.removeEventListener("click",v,!0),be=void 0)},P=setTimeout(()=>{document.addEventListener("click",v,!0)},100);be=()=>{clearTimeout(P),document.removeEventListener("click",v,!0)}};let Ze;const So=e=>{Ze?.(),xo(),jt(!0),q().catch(()=>{}),so();const t=()=>document.querySelector(`#${V}`)??void 0,n=l=>{if(!l)return!1;const g=t();return!!(g&&(l===g||g.contains(l)))},o=l=>{if(!l)return!1;const g=document.querySelector(`#${_e}`);return!!(g&&(l===g||g.contains(l)))},i=new MutationObserver(l=>{for(const g of l)for(const m of g.addedNodes)if(m instanceof HTMLElement&&(m.tagName==="VITE-ERROR-OVERLAY"||m.id==="vite-error-overlay")){T.cleanup(),e();return}});i.observe(document.body,{childList:!0});const r="__vdt_multi_select_outline";let s=[];const a={cmd:!1,shift:!1},d=()=>{for(const g of document.querySelectorAll(`.${r}`))g.remove();const l=s.length>1;for(const g of s){const m=g.element.getBoundingClientRect(),y=document.createElement("div");y.className=r,y.style.cssText=["position:fixed","pointer-events:none","z-index:2147483644","box-sizing:border-box",`top:${m.top}px`,`left:${m.left}px`,`width:${m.width}px`,`height:${m.height}px`,l?"border:2px solid rgba(34,197,94,0.7);background:rgba(34,197,94,0.08);":`border:2px solid ${Ee().overlayBorder};background:${Ee().overlayBg};`,"transition:all 0.1s;"].join(""),document.body.append(y)}},x=()=>{for(const l of document.querySelectorAll(`.${r}`))l.remove()},h=()=>{if(s.length!==0)if(ge(),s.length===1){const l=s[0],g=l.element.getBoundingClientRect(),m=ft(l.element);x(),s=[],Oe==="annotate"?nt(l.element,g,m,void 0,{x:g.left+g.width/2,y:g.top+g.height/2}):Ht(l.element,g,m)}else{const l=s.map(w=>w.element),g=l.map(w=>w.getBoundingClientRect()),m=g.map(w=>({height:w.height,width:w.width,x:w.x,y:w.y})),y=new DOMRect(Math.min(...g.map(w=>w.left)),Math.min(...g.map(w=>w.top)),Math.max(...g.map(w=>w.right))-Math.min(...g.map(w=>w.left)),Math.max(...g.map(w=>w.bottom))-Math.min(...g.map(w=>w.top)));x(),s=[],Mt(l,y,m)}},c={hasMoved:!1,x:0,y:0},u=l=>{if((l.key==="Meta"||l.key==="Control")&&(a.cmd=!0,c.hasMoved&&!Ve())){const g=We(c.x,c.y);if(g&&!Ue(g)){Ke(g);const m=document.querySelector(`#${se}`);m&&(m.style.borderStyle="dashed")}}l.key==="Shift"&&(a.shift=!0)},p=l=>{const g=a.cmd&&a.shift;if((l.key==="Meta"||l.key==="Control")&&(a.cmd=!1,c.hasMoved&&!Ve())){const y=ye(c.x,c.y);if(y&&!Ue(y)){Ke(y);const w=document.querySelector(`#${se}`);w&&(w.style.borderStyle="solid")}}l.key==="Shift"&&(a.shift=!1);const m=a.cmd&&a.shift;g&&!m&&s.length>0&&h()},b=()=>{a.cmd=!1,a.shift=!1,s.length>0&&(x(),s=[])};document.addEventListener("keydown",u),document.addEventListener("keyup",p),window.addEventListener("blur",b);const _="__vdt_drag_rect";let v,P=!1;const k=()=>{document.querySelector(`#${_}`)?.remove(),v=void 0,P=!1},T={cleanup(){document.removeEventListener("mousemove",T.handleMouseMove),document.removeEventListener("mousedown",T.handleMouseDown),document.removeEventListener("mouseup",T.handleMouseUp,!0),document.removeEventListener("click",T.handleClick,!0),document.removeEventListener("keydown",T.handleKeyDown),i.disconnect(),ge(),fo(),k(),x(),s=[],document.removeEventListener("__vdt_annotation_form_closed",S),document.removeEventListener("keydown",u),document.removeEventListener("keyup",p),window.removeEventListener("blur",b),jt(!1),vn(),$n(),Ze=void 0},handleClick(l){const g=((l.metaKey||l.ctrlKey)&&!l.shiftKey?We(l.clientX,l.clientY):ye(l.clientX,l.clientY))??l.target;if(!g||Ue(g)||n(g)||o(g)||zt(g)||ut(g))return;if((l.metaKey||l.ctrlKey)&&l.shiftKey){l.preventDefault(),l.stopPropagation();const w=s.findIndex(A=>A.element===g);w===-1?s.push({element:g,name:yt(g),rect:g.getBoundingClientRect()}):s.splice(w,1),d();return}if(l.preventDefault(),l.stopPropagation(),Ve()){no();return}if(!bt().blockInteractions&&g.closest?.("button, a, input, select, textarea, [role='button'], [onclick]"))return;gn();const m=g.getBoundingClientRect(),y=ft(g);Oe==="annotate"?(Ke(g),nt(g,m,y,void 0,{x:l.clientX,y:l.clientY})):(ge(),Ht(g,m,y,l.clientX,l.clientY))},handleKeyDown(l){const g=l.target?.tagName;if(g==="INPUT"||g==="TEXTAREA"||g==="SELECT")return;if(l.key==="Escape"){if(s.length>0){x(),s=[];return}T.cleanup(),e();return}const m=l.key.toLowerCase();if(m==="p"){l.preventDefault(),document.querySelector(`#${V} button[title*="animations"]`)?.click();return}if(m==="h"){l.preventDefault(),document.querySelector(`#${V} button[title*="markers"]`)?.click();return}if(m==="c"&&!l.ctrlKey&&!l.metaKey){l.preventDefault(),document.querySelector(`#${V} button[title*="Copy"]`)?.click();return}if(m==="r"){l.preventDefault(),document.querySelector(`#${V} button[title*="rulers"]`)?.click();return}m==="x"&&(l.preventDefault(),document.querySelector(`#${V} button[title*="Clear"]`)?.click())},handleMouseDown(l){const g=l.composedPath()[0]||l.target;g.closest?.(`#${V}`)||g.closest?.(`#${_e}`)||g.classList?.contains("__vdt_annotation_marker")||ut(g)||g.closest?.("#__vdt_annotation_form")||g.closest?.("#__vdt_annotation_detail")||go.has(g.tagName)||g.isContentEditable||(v={x:l.clientX,y:l.clientY},P=!1)},handleMouseMove(l){if(Ve())return;if(v){const w=l.clientX-v.x,A=l.clientY-v.y,f=w*w+A*A,B=8;if(!P&&f<B*B)return;P=!0;let C=document.querySelector(`#${_}`);C||(C=document.createElement("div"),C.id=_,C.style.cssText="position:fixed;pointer-events:none;z-index:2147483644;border:2px dashed rgba(99,102,241,0.7);background:rgba(99,102,241,0.1);",document.body.append(C));const Y=Math.min(v.x,l.clientX),W=Math.min(v.y,l.clientY),ee=Math.abs(l.clientX-v.x),me=Math.abs(l.clientY-v.y);C.style.left=`${Y}px`,C.style.top=`${W}px`,C.style.width=`${ee}px`,C.style.height=`${me}px`;return}c.x=l.clientX,c.y=l.clientY,c.hasMoved=!0;const g=(l.metaKey||l.ctrlKey)&&!l.shiftKey,m=(g?We(l.clientX,l.clientY):ye(l.clientX,l.clientY))??l.target;if(!m||Ue(m)||n(m)||o(m)||zt(m)||ut(m)){ge();return}Ke(m);const y=document.querySelector(`#${se}`);y&&(y.style.borderStyle=g?"dashed":"solid")},handleMouseUp(l){if(!v||!P){k();return}l.preventDefault(),l.stopPropagation();const g=Math.min(v.x,l.clientX),m=Math.min(v.y,l.clientY),y=Math.abs(l.clientX-v.x),w=Math.abs(l.clientY-v.y);if(k(),y<20||w<20)return;const A=new DOMRect(g,m,y,w),f=rn(A);if(ge(),f.length===0)oo(A);else{const B=sn(f);Mt(f,A,B)}}},{cleanup:R,handleClick:M,handleKeyDown:$,handleMouseMove:L}=T;_o(()=>{R(),e()});const S=()=>{ge()};document.addEventListener("__vdt_annotation_form_closed",S),document.addEventListener("mousemove",L),document.addEventListener("mousedown",T.handleMouseDown),document.addEventListener("mouseup",T.handleMouseUp,!0),document.addEventListener("click",M,!0),document.addEventListener("keydown",$),Ze=R},Lo=()=>{Ze?.(),oe(),mn(),xn();const e=globalThis.__VISULIMA_DEVTOOLS__;e?.getActiveApp?.()==="dev-toolbar:annotations"&&e.setAppActive?.("dev-toolbar:annotations",!1)},Ao={icon:kn,id:"dev-toolbar:inspector",name:"Inspector",onClick(){const e=globalThis.__VISULIMA_DEVTOOLS__;So(async()=>{try{if(mn(),xn(),e?.getActiveApp?.()==="dev-toolbar:annotations")try{await e.closeApp?.()}catch{}}finally{e?.setAppActive&&e.setAppActive("dev-toolbar:inspector",!1)}})},onDeactivate(){Lo()}};export{Ao as default};
@@ -1,3 +1,4 @@
1
- import type { DevToolbarApp } from "../../types/app.d.ts";
1
+ import { D as DevToolbarApp } from "../../packem_shared/app.d-SmKEDxsI.js";
2
+ import 'preact';
2
3
  declare const moduleGraphApp: DevToolbarApp;
3
- export default moduleGraphApp;
4
+ export { moduleGraphApp as default };