@visulima/dev-toolbar 1.0.0-alpha.26 → 1.0.0-alpha.28

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## @visulima/dev-toolbar [1.0.0-alpha.28](https://github.com/visulima/visulima/compare/@visulima/dev-toolbar@1.0.0-alpha.27...@visulima/dev-toolbar@1.0.0-alpha.28) (2026-05-26)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **security:** address codeql findings across packages ([3366f9c](https://github.com/visulima/visulima/commit/3366f9c07d54bdde5242fbd90780baa4634de179))
6
+
7
+ ### Miscellaneous Chores
8
+
9
+ * **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
10
+ * **repo:** apply eslint --fix and prettier --fix across packages ([#650](https://github.com/visulima/visulima/issues/650)) ([2e26a84](https://github.com/visulima/visulima/commit/2e26a84774f218f21345e9a8ecd68236b6542743)), closes [#620](https://github.com/visulima/visulima/issues/620)
11
+ * **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
12
+
13
+ ### Tests
14
+
15
+ * **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
16
+ * **repo:** cover bin entry points in dist integration suite ([7479ef1](https://github.com/visulima/visulima/commit/7479ef113cf5ccef25692619082afb1b6a0eecab))
17
+
18
+ ## @visulima/dev-toolbar [1.0.0-alpha.27](https://github.com/visulima/visulima/compare/@visulima/dev-toolbar@1.0.0-alpha.26...@visulima/dev-toolbar@1.0.0-alpha.27) (2026-05-20)
19
+
20
+ ### Tests
21
+
22
+ * **dev-toolbar:** rebind localStorage globals for Node 25 ([ee5e1f8](https://github.com/visulima/visulima/commit/ee5e1f8774cce170c95248d9c4d74d91fafe90e7))
23
+
1
24
  ## @visulima/dev-toolbar [1.0.0-alpha.26](https://github.com/visulima/visulima/compare/@visulima/dev-toolbar@1.0.0-alpha.25...@visulima/dev-toolbar@1.0.0-alpha.26) (2026-05-19)
2
25
 
3
26
  ## @visulima/dev-toolbar [1.0.0-alpha.25](https://github.com/visulima/visulima/compare/@visulima/dev-toolbar@1.0.0-alpha.24...@visulima/dev-toolbar@1.0.0-alpha.25) (2026-05-16)
package/bin/mcp.js CHANGED
@@ -21,7 +21,7 @@
21
21
  */
22
22
 
23
23
  // eslint-disable-next-line antfu/no-import-dist -- bin entry point runs after build
24
- import { startMcpServer } from "../dist/mcp/server";
24
+ import { startMcpServer } from "../dist/mcp/server.js";
25
25
 
26
26
  startMcpServer().catch((error) => {
27
27
  console.error("Failed to start MCP server:", error);
@@ -14,7 +14,7 @@ var Bn=Object.defineProperty;var ae=(e,t)=>Bn(e,"name",{value:t,configurable:!0}
14
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
15
  <path d="M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6" />
16
16
  </svg>
17
- `;var Pn=Object.defineProperty,P=ae((e,t)=>Pn(e,"name",{value:t,configurable:!0}),"l$2");const Zt=P(e=>{try{const t=e.contentDocument;return t!==null&&t.body!==null}catch{return!1}},"isSameOriginIframe"),_e=P((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(Zt(i)){const r=i.getBoundingClientRect(),a=e-r.left,l=t-r.top;try{const d=i.contentDocument.elementFromPoint(a,l);d&&d!==i&&(n=d,o=!0)}catch{}}}}return n},"deepElementFromPoint"),st=P(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 a=r.getBoundingClientRect();n+=a.left,o+=a.top,i=r.ownerDocument}return new DOMRect(t.x+n,t.y+o,t.width,t.height)},"getViewportRect"),Rn=new Set(["ARTICLE","ASIDE","DIV","FOOTER","HEADER","MAIN","NAV","SECTION","SPAN"]),gt=P(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},"isEffectivelyInvisible"),Dt=P(e=>{if(!Rn.has(e.tagName))return!0;for(const t of e.childNodes)if(t.nodeType===Node.TEXT_NODE&&t.textContent?.trim())return!0;return!1},"hasDirectContent"),rt=P((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(Dt(o)&&!gt(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(Dt(h)&&!gt(h))return h}const r=o.getBoundingClientRect(),a=r.width*r.height;let l=null,d=a;for(const x of i){if(x===n||x===document.documentElement||x===document.body||gt(x))continue;const h=x.getBoundingClientRect(),c=h.width*h.height;c>0&&c<d&&(l=x,d=c)}return l??o},"pierceElementFromPoint"),en=P(e=>{if(e.parentElement)return e.parentElement;const t=e.getRootNode();return t instanceof ShadowRoot?t.host:null},"getParentElement"),tn=P(e=>{let t=e;for(;t;){const{position:n}=getComputedStyle(t);if(n==="fixed"||n==="sticky")return!0;t=en(t)}return!1},"isElementFixed"),Tt=P(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"),a=e.textContent?.trim().slice(0,30);return r&&!r.startsWith("javascript:")?a?`link "${a}" to ${r}`:`link to ${r}`:a?`link "${a}"`:"link"}if(t==="img"){const{alt:r}=e;return r?`image "${r.slice(0,40)}"`:"image"}if(t==="input"){const{type:r}=e,{placeholder:a}=e;return a?`input[${r}] "${a.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},"getElementLabel"),In=new Set(["active","checked","disabled","focus","hover","selected","visited"]),nn=P(e=>{if(e.id)return`#${CSS.escape(e.id)}`;const t=[...e.classList].filter(i=>!In.has(i)&&!i.startsWith("__")&&!Dn(i));if(t.length>0){const i=e.tagName.toLowerCase();for(const r of t){const a=`${i}.${CSS.escape(r)}`;if(document.querySelectorAll(a).length===1)return a}for(let r=0;r<t.length;r++)for(let a=r+1;a<t.length;a++){const l=`${i}.${CSS.escape(t[r])}.${CSS.escape(t[a])}`;if(document.querySelectorAll(l).length===1)return l}}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 a=[...r.children].filter(l=>l.tagName===o.tagName);if(a.length>1){const l=a.indexOf(o)+1;i+=`:nth-of-type(${l})`}}n.unshift(i),o=r}return n.join(" > ")},"generateSelector"),on=/[_-][a-f0-9]{5,}$/i,Dn=P(e=>on.test(e),"isModuleHash"),rn=P(e=>Array.from(e,t=>t.replace(on,"")).filter(Boolean).join(" "),"cleanCssClasses"),an=P(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(" > ")},"getFullDomPath"),sn=P(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(", "):""},"getNearbyElements"),ln=P((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)??"":""},"getNearbyText"),cn=P((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},"getSelectedText"),Fn=new Set(["A","BUTTON","INPUT","SELECT","TEXTAREA"]),dn=P(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"),a=r===null?void 0:Number.parseInt(r,10),l=Fn.has(t.tagName)||a!==void 0&&a>=0;return{ariaDescribedBy:i,ariaLabel:o,focusable:l,role:n===t.tagName.toLowerCase()?void 0:n,tabindex:a}},"captureAccessibility"),On=["display","position","color","background-color","font-size","font-family","font-weight","line-height","padding","margin","border","width","height","overflow","z-index","opacity"],wt=P(e=>{const t=getComputedStyle(e),n=[];for(const o of On){const i=t.getPropertyValue(o);i&&i!=="normal"&&i!=="none"&&i!=="auto"&&i!=="0px"&&n.push(`${o}: ${i}`)}return n.join("; ")},"captureComputedStyles"),jn=P(e=>{const t=Object.keys(e).find(l=>l.startsWith("__reactFiber$")||l.startsWith("__reactInternalInstance$"));if(!t)return;let n=e[t],o,i,r;const a=[];for(;n;){if(typeof n.type=="function"||typeof n.type=="object"){const l=n.type?.displayName??n.type?.name;l&&!l.startsWith("_")&&l!=="Fragment"&&l!=="Suspense"&&l.length>1&&(a.push(l),o||(o=l,n._debugSource&&(i=n._debugSource.fileName,r=n._debugSource.lineNumber)))}n=n.return}if(o)return{componentName:o,componentStack:a.length>1?a.reverse():void 0,framework:"react",sourceFile:i,sourceLine:r}},"detectReact"),Nn=P(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}},"detectVue"),qn=P(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}},"detectSvelte"),pn=P(e=>jn(e)??Nn(e)??qn(e),"detectFrameworkComponent"),un=P(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 a=document.createElement("canvas");a.width=r.videoWidth,a.height=r.videoHeight;const l=a.getContext("2d");if(!l)return i.getTracks().forEach(b=>b.stop()),null;l.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,a.width-d),c=Math.min((t.height+n*2)*o,a.height-x),u=document.createElement("canvas");u.width=h,u.height=c;const p=u.getContext("2d");return p?(p.drawImage(a,d,x,h,c,0,0,h,c),u.toDataURL("image/png")):null}catch{return null}},"captureElementScreenshot"),Hn=P(e=>{const t=[],n=P(o=>{for(const i of o.querySelectorAll(e))t.push(i);for(const i of o.querySelectorAll("iframe"))if(Zt(i))try{n(i.contentDocument)}catch{}},"searchDocument");return n(document),t},"querySelectorAllWithIframes"),mn=P(e=>{const t=[],n=Math.max(10,e.width/20),o=Math.max(10,e.height/20),i=new Set;for(let{x:a}=e;a<=e.x+e.width;a+=n)for(let{y:l}=e;l<=e.y+e.height;l+=o){const d=_e(a,l);if(d&&!i.has(d)&&d.tagName!=="BODY"&&d.tagName!=="HTML"&&!d.tagName.includes("-")){const x=st(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 a of Hn(r)){if(i.has(a)||a.tagName==="BODY"||a.tagName==="HTML")continue;const l=st(a);l.width>window.innerWidth*.8&&l.height>window.innerHeight*.5||l.width<10||l.height<10||l.left<e.x+e.width&&l.right>e.x&&l.top<e.y+e.height&&l.bottom>e.y&&(i.add(a),t.push(a))}return t.filter(a=>!t.some(l=>l!==a&&a.contains(l)))},"getElementsInRect"),gn=P(e=>e.map(t=>{const n=st(t);return{height:n.height,width:n.width,x:n.x,y:n.y}}),"getElementBoundingBoxes"),Ct=P((e,t="standard")=>{if(e.length===0)return`# Annotations
17
+ `;var Pn=Object.defineProperty,P=ae((e,t)=>Pn(e,"name",{value:t,configurable:!0}),"a$2");const Zt=P(e=>{try{const t=e.contentDocument;return t!==null&&t.body!==null}catch{return!1}},"isSameOriginIframe"),_e=P((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(Zt(i)){const r=i.getBoundingClientRect(),a=e-r.left,s=t-r.top;try{const d=i.contentDocument.elementFromPoint(a,s);d&&d!==i&&(n=d,o=!0)}catch{}}}}return n},"deepElementFromPoint"),st=P(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 a=r.getBoundingClientRect();n+=a.left,o+=a.top,i=r.ownerDocument}return new DOMRect(t.x+n,t.y+o,t.width,t.height)},"getViewportRect"),Rn=new Set(["ARTICLE","ASIDE","DIV","FOOTER","HEADER","MAIN","NAV","SECTION","SPAN"]),gt=P(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},"isEffectivelyInvisible"),Dt=P(e=>{if(!Rn.has(e.tagName))return!0;for(const t of e.childNodes)if(t.nodeType===Node.TEXT_NODE&&t.textContent?.trim())return!0;return!1},"hasDirectContent"),rt=P((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(Dt(o)&&!gt(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(Dt(h)&&!gt(h))return h}const r=o.getBoundingClientRect(),a=r.width*r.height;let s=null,d=a;for(const x of i){if(x===n||x===document.documentElement||x===document.body||gt(x))continue;const h=x.getBoundingClientRect(),c=h.width*h.height;c>0&&c<d&&(s=x,d=c)}return s??o},"pierceElementFromPoint"),en=P(e=>{if(e.parentElement)return e.parentElement;const t=e.getRootNode();return t instanceof ShadowRoot?t.host:null},"getParentElement"),tn=P(e=>{let t=e;for(;t;){const{position:n}=getComputedStyle(t);if(n==="fixed"||n==="sticky")return!0;t=en(t)}return!1},"isElementFixed"),Tt=P(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"),a=e.textContent?.trim().slice(0,30),s=r?.trim().toLowerCase();return r&&s&&!s.startsWith("javascript:")&&!s.startsWith("data:")&&!s.startsWith("vbscript:")?a?`link "${a}" to ${r}`:`link to ${r}`:a?`link "${a}"`:"link"}if(t==="img"){const{alt:r}=e;return r?`image "${r.slice(0,40)}"`:"image"}if(t==="input"){const{type:r}=e,{placeholder:a}=e;return a?`input[${r}] "${a.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},"getElementLabel"),In=new Set(["active","checked","disabled","focus","hover","selected","visited"]),nn=P(e=>{if(e.id)return`#${CSS.escape(e.id)}`;const t=[...e.classList].filter(i=>!In.has(i)&&!i.startsWith("__")&&!Dn(i));if(t.length>0){const i=e.tagName.toLowerCase();for(const r of t){const a=`${i}.${CSS.escape(r)}`;if(document.querySelectorAll(a).length===1)return a}for(let r=0;r<t.length;r++)for(let a=r+1;a<t.length;a++){const s=`${i}.${CSS.escape(t[r])}.${CSS.escape(t[a])}`;if(document.querySelectorAll(s).length===1)return s}}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 a=[...r.children].filter(s=>s.tagName===o.tagName);if(a.length>1){const s=a.indexOf(o)+1;i+=`:nth-of-type(${s})`}}n.unshift(i),o=r}return n.join(" > ")},"generateSelector"),on=/[_-][a-f0-9]{5,}$/i,Dn=P(e=>on.test(e),"isModuleHash"),rn=P(e=>Array.from(e,t=>t.replace(on,"")).filter(Boolean).join(" "),"cleanCssClasses"),an=P(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(" > ")},"getFullDomPath"),sn=P(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(", "):""},"getNearbyElements"),ln=P((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)??"":""},"getNearbyText"),cn=P((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},"getSelectedText"),Fn=new Set(["A","BUTTON","INPUT","SELECT","TEXTAREA"]),dn=P(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"),a=r===null?void 0:Number.parseInt(r,10),s=Fn.has(t.tagName)||a!==void 0&&a>=0;return{ariaDescribedBy:i,ariaLabel:o,focusable:s,role:n===t.tagName.toLowerCase()?void 0:n,tabindex:a}},"captureAccessibility"),On=["display","position","color","background-color","font-size","font-family","font-weight","line-height","padding","margin","border","width","height","overflow","z-index","opacity"],wt=P(e=>{const t=getComputedStyle(e),n=[];for(const o of On){const i=t.getPropertyValue(o);i&&i!=="normal"&&i!=="none"&&i!=="auto"&&i!=="0px"&&n.push(`${o}: ${i}`)}return n.join("; ")},"captureComputedStyles"),jn=P(e=>{const t=Object.keys(e).find(s=>s.startsWith("__reactFiber$")||s.startsWith("__reactInternalInstance$"));if(!t)return;let n=e[t],o,i,r;const a=[];for(;n;){if(typeof n.type=="function"||typeof n.type=="object"){const s=n.type?.displayName??n.type?.name;s&&!s.startsWith("_")&&s!=="Fragment"&&s!=="Suspense"&&s.length>1&&(a.push(s),o||(o=s,n._debugSource&&(i=n._debugSource.fileName,r=n._debugSource.lineNumber)))}n=n.return}if(o)return{componentName:o,componentStack:a.length>1?a.reverse():void 0,framework:"react",sourceFile:i,sourceLine:r}},"detectReact"),Nn=P(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}},"detectVue"),qn=P(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}},"detectSvelte"),pn=P(e=>jn(e)??Nn(e)??qn(e),"detectFrameworkComponent"),un=P(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 a=document.createElement("canvas");a.width=r.videoWidth,a.height=r.videoHeight;const s=a.getContext("2d");if(!s)return i.getTracks().forEach(b=>b.stop()),null;s.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,a.width-d),c=Math.min((t.height+n*2)*o,a.height-x),u=document.createElement("canvas");u.width=h,u.height=c;const p=u.getContext("2d");return p?(p.drawImage(a,d,x,h,c,0,0,h,c),u.toDataURL("image/png")):null}catch{return null}},"captureElementScreenshot"),Hn=P(e=>{const t=[],n=P(o=>{for(const i of o.querySelectorAll(e))t.push(i);for(const i of o.querySelectorAll("iframe"))if(Zt(i))try{n(i.contentDocument)}catch{}},"searchDocument");return n(document),t},"querySelectorAllWithIframes"),mn=P(e=>{const t=[],n=Math.max(10,e.width/20),o=Math.max(10,e.height/20),i=new Set;for(let{x:a}=e;a<=e.x+e.width;a+=n)for(let{y:s}=e;s<=e.y+e.height;s+=o){const d=_e(a,s);if(d&&!i.has(d)&&d.tagName!=="BODY"&&d.tagName!=="HTML"&&!d.tagName.includes("-")){const x=st(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 a of Hn(r)){if(i.has(a)||a.tagName==="BODY"||a.tagName==="HTML")continue;const s=st(a);s.width>window.innerWidth*.8&&s.height>window.innerHeight*.5||s.width<10||s.height<10||s.left<e.x+e.width&&s.right>e.x&&s.top<e.y+e.height&&s.bottom>e.y&&(i.add(a),t.push(a))}return t.filter(a=>!t.some(s=>s!==a&&a.contains(s)))},"getElementsInRect"),gn=P(e=>e.map(t=>{const n=st(t);return{height:n.height,width:n.width,x:n.x,y:n.y}}),"getElementBoundingBoxes"),Ct=P((e,t="standard")=>{if(e.length===0)return`# Annotations
18
18
 
19
19
  No annotations found.`;if(t==="compact"){const o=[`# Annotations (${e.length})`,""];for(const i of e){const r=i.elementLabel??i.elementTag,a=i.selectedText?` (re: "${i.selectedText.slice(0,30)}...")`:"";o.push(`- **${r}:** ${i.comment}${a}`)}return o.join(`
20
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 a=i.frameworkContext;n.push(`**Component:** ${a.componentName} (${a.framework})`),a.componentStack&&a.componentStack.length>1&&n.push(`**Stack:** ${a.componentStack.join(" > ")}`),a.sourceFile&&n.push(`**File:** \`${a.sourceFile}${a.sourceLine?`:${a.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(`
@@ -25,6 +25,6 @@ No annotations found.`;if(t==="compact"){const o=[`# Annotations (${e.length})`,
25
25
  animation-play-state: paused !important;
26
26
  transition: none !important;
27
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())},"freezeAll"),hn=ue(()=>{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<ce&&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<ce&&E.frozenRAFQueue.push(n);return}n(o)});for(const n of E.pausedAnimations)try{n.play()}catch{}E.pausedAnimations=[],document.getElementById($t)?.remove();for(const n of document.querySelectorAll("video[data-was-paused='false']"))n.play().catch(()=>{}),delete n.dataset.wasPaused},"unfreezeAll"),Jn=ue(()=>E.frozen?(hn(),!1):(Kn(),!0),"toggleFreeze");var Wn=Object.defineProperty,Je=ae((e,t)=>Wn(e,"name",{value:t,configurable:!0}),"r");const fn={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)"},bn={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)"},yn={...fn,overlayBg:"rgba(196,181,253,0.06)",overlayBorder:"rgba(196,181,253,0.7)"},Gn={...bn,overlayBg:"rgba(124,58,237,0.06)",overlayBorder:"rgba(124,58,237,0.7)"},Zn={...fn,danger:"#ef4444",success:"#22c55e"},eo={...bn,danger:"#dc2626",success:"#16a34a"};let de;const St=Je(()=>{if(de!==void 0)return de;try{const e=localStorage.getItem("__v_dt__theme");if(e==="light")return de=!1,!1;if(e==="dark")return de=!0,!0}catch{}return de=globalThis.window?.matchMedia("(prefers-color-scheme: dark)").matches??!0,de},"resolveIsDark");Je(()=>St(),"isDarkTheme");const to=Je(()=>St()?yn:Gn,"getInspectorPalette"),no=Je(()=>St()?Zn:eo,"getAnnotationPalette");Je(()=>{de=void 0},"resetPaletteCache");const Ft="__vdt_palette_listener";globalThis.window!==void 0&&!globalThis[Ft]&&(globalThis[Ft]=!0,globalThis.addEventListener("storage",e=>{e.key==="__v_dt__theme"&&(de=void 0)}));var oo=Object.defineProperty,_=ae((e,t)=>oo(e,"name",{value:t,configurable:!0}),"p");const fe="__vdt_annotation_marker",be="__vdt_annotation_form",Lt="__vdt_annotation_detail",it="__vdt_area_outline",U={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"},Ke={blocking:"Blocking",important:"Important",suggestion:"Suggestion"},We=no,Y=_(()=>globalThis.__VISULIMA_DEVTOOLS__?.rpc,"getRpc"),ft=_(e=>{if(!e)return null;try{return document.querySelector(e)}catch{return null}},"safeQuerySelector"),K=_((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)},"showToast"),ro=_(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}},"matchesCurrentPage"),he=_((e,t,n)=>{const o=We(),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},"makeButton"),se=_((e,t,n,o)=>{const i=document.createElement("div"),r=document.createElement("b");r.textContent=`${t}: `;const a=document.createElement("span");a.textContent=n,o&&(a.style.color=o),i.append(r,a),e.append(i)},"addMetaRow"),At=_((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},"makeCloseButton"),io=_(()=>globalThis.__VISULIMA_DEVTOOLS__?.getApps?.().some(e=>e.id==="dev-toolbar:annotations")??!1,"isAnnotationsAppEnabled");let W=[],Te,je,ge;const Bt=_((e,t,n=!1)=>({x:e/window.innerWidth*100,y:n?t:t+window.scrollY}),"toPageCoords"),Ne=_((e,t,n=!1)=>({left:e/100*window.innerWidth,top:n?t:t-window.scrollY}),"toViewportCoords"),ao=_(()=>{const e=document.querySelectorAll(`.${fe}`);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:a}=Ne(n,o,i);t.style.left=`${r-11}px`,t.style.top=`${a-11}px`,t.style.display=a<-24||a>window.innerHeight+24?"none":"flex"}},"repositionMarkers");let bt=!1;const Ot=_(()=>{bt||(bt=!0,xn(()=>{ao(),bt=!1},16))},"throttledReposition"),so=_(()=>{Te||(Te=Ot,je=Ot,window.addEventListener("scroll",Te,{passive:!0}),window.addEventListener("resize",je,{passive:!0}))},"attachScrollListeners"),lo=_(()=>{Te&&(window.removeEventListener("scroll",Te),Te=void 0),je&&(window.removeEventListener("resize",je),je=void 0)},"detachScrollListeners");let qe,He,pe=[];const co=_(()=>{if(ge)return;ge=_(()=>{X().catch(()=>{})},"navigationHandler"),globalThis.addEventListener("popstate",ge),qe=history.pushState.bind(history),He=history.replaceState.bind(history);const e=ge;history.pushState=(...t)=>{qe(...t);const n=setTimeout(()=>{e(),pe=pe.filter(o=>o!==n)},50);pe.push(n)},history.replaceState=(...t)=>{He(...t);const n=setTimeout(()=>{e(),pe=pe.filter(o=>o!==n)},50);pe.push(n)}},"attachNavigationListener"),po=_(()=>{ge&&(globalThis.removeEventListener("popstate",ge),ge=void 0);for(const e of pe)clearTimeout(e);pe=[],qe&&(history.pushState=qe,qe=void 0),He&&(history.replaceState=He,He=void 0)},"detachNavigationListener");let xe;const uo=_(()=>{if(!xe)try{xe=new EventSource("/__devtoolbar/events"),xe.addEventListener("annotations.changed",()=>{const e=Y();e?.getAnnotations&&e.getAnnotations().then(t=>{W=t,lt()}).catch(()=>{})}),xe.addEventListener("error",()=>{})}catch{}},"attachSSE"),mo=_(()=>{xe&&(xe.close(),xe=void 0)},"detachSSE"),X=_(async()=>{if(!io())return;const e=Y();if(e?.getAnnotations)try{W=await e.getAnnotations(),lt(),so(),co(),uo()}catch{}},"loadAndShowMarkers"),vn=_(()=>{for(const e of document.querySelectorAll(`.${fe}`))e.remove();wn(),lo(),po(),mo(),hn()},"removeAllMarkers"),wn=_(()=>{q(),N(),document.getElementById(it)?.remove()},"closeAnnotationPopups"),lt=_(()=>{for(const t of document.querySelectorAll(`.${fe}`))t.remove();const e=W.filter(t=>(t.status==="pending"||t.status==="acknowledged")&&ro(t.url));for(const[t,n]of e.entries())xo(n,t+1)},"renderMarkers"),ne="__vdt_annotation_highlight",go={bg:"#22c55e",border:"#16a34a",fg:"#fff",highlightBg:"rgba(34,197,94,0.12)"},xo=_((e,t)=>{const n=_t(),o=e.isMultiSelect&&t>1?go:Gt(n),i=e.isFixed??!1,{left:r,top:a}=Ne(e.x,e.y,i),l=e.status==="acknowledged",d=document.createElement("div");d.className=fe,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:${a-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)`,l?"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(ne);p||(p=document.createElement("div"),p.id=ne,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=ft(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=_e(p,b),c){const T=c.getBoundingClientRect(),v=u.width>0?T.width/u.width:1,D=u.height>0?T.height/u.height:1;(v<.5||D<.5)&&(c=null)}}if(c){const u=c.getBoundingClientRect();let p=document.getElementById(ne);p||(p=document.createElement("div"),p.id=ne,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(ne);b||(b=document.createElement("div"),b.id=ne,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=`${ne}_${c}`;let b=document.getElementById(p);b||(b=document.createElement("div"),b.id=p,document.body.append(b));const T=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:${T}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(ne)?.remove(),e.elementBoundingBoxes)for(let c=0;c<e.elementBoundingBoxes.length;c++)document.getElementById(`${ne}_${c}`)?.remove()}),d.addEventListener("click",h=>{if(h.stopPropagation(),h.preventDefault(),n.markerClickBehavior==="delete")Y()?.deleteAnnotation?.(e.id)?.then(()=>{X().catch(()=>{})});else if(n.markerClickBehavior==="edit"){const c=ft(e.elementPath),{left:u,top:p}=Ne(e.x,e.y,e.isFixed),b=c?.getBoundingClientRect()??new DOMRect(u,p,100,20);ct(c??document.body,b,e.source,e)}else $e(e)}),d.addEventListener("contextmenu",h=>{if(h.preventDefault(),h.stopPropagation(),n.markerClickBehavior==="delete"){const c=ft(e.elementPath),{left:u,top:p}=Ne(e.x,e.y,e.isFixed),b=c?.getBoundingClientRect()??new DOMRect(u,p,100,20);ct(c??document.body,b,e.source,e)}else $e(e)}),(a<-24||a>window.innerHeight+24)&&(d.style.display="none"),document.body.append(d)},"createMarkerElement"),ho=_(e=>{e&&e.__resizeObserver?.disconnect()},"cleanupResizeObserver"),q=_(()=>{const e=document.querySelector(`#${be}`),t=!!e;e?.annotationId&&ut(e.annotationId,!1),ho(e),e?.remove(),document.querySelector("#__vdt_pending_marker")?.remove(),t&&document.dispatchEvent(new CustomEvent("__vdt_annotation_form_closed"))},"removeAnnotationForm"),Ze=_(()=>!!document.querySelector(`#${be}`),"isAnnotationFormOpen"),fo=_(()=>{const e=document.querySelector(`#${be}`);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})},"shakeAnnotationForm"),ct=_((e,t,n,o,i)=>{q(),N();const r=We(),a=e.tagName.toLowerCase(),l=e.id?`#${e.id}`:"",d=e.classList.length>0?`.${[...e.classList].slice(0,3).join(".")}`:"",x=nn(e),h=ln(e),c=cn(),u=pn(e),p=document.createElement("div");p.id=be,o&&(p.annotationId=o.id,ut(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,T=i?.x??t.left,v="__vdt_pending_marker";if(document.getElementById(v)?.remove(),i&&!o){const f=Gt(),M=document.createElement("div");M.id=v,M.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 L=document.createElement("span");L.style.cssText=`color:${f.fg};font-size:13px;font-weight:700;line-height:1;`,L.textContent="+",M.append(L),document.body.append(M)}const D=document.createElement("div");D.style.cssText=`color:${r.primary};font-weight:bold;margin-bottom:8px;font-size:12px;`,D.textContent=o?"Edit Annotation":"Annotate Element",p.append(D);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 C=document.createElement("span");if(C.textContent=`${a}${l}${d}`,k.append(C),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=wt(e);if(f){const M=document.createElement("details");M.style.cssText=`margin-bottom:8px;font-size:10px;color:${r.muted};`;const L=document.createElement("summary");L.style.cssText="cursor:pointer;font-size:10px;padding:2px 0;",L.textContent="Computed Styles",L.addEventListener("click",te=>te.stopPropagation());const Q=document.createElement("div");Q.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;`,Q.textContent=f.replaceAll("; ",`;
29
- `),M.append(L,Q),p.append(M)}}let F=o?.intent??"fix";const R=Se(r,"Intent",["fix","change","question","approve"].map(f=>({active:f===F,activeStyle:`background:${U[f].bg};border-color:${U[f].border};color:${U[f].fg}`,key:f,label:Qe[f]})),f=>{F=f});p.append(R);let $=o?.severity??"important";const B=Se(r,"Severity",["blocking","important","suggestion"].map(f=>({active:f===$,activeStyle:`background:${r.btnBg};border-color:${r.primary};color:${r.primary}`,key:f,label:Ke[f]})),f=>{$=f});p.append(B);let A=o?.screenshot?"existing":null;const s=document.createElement("div");s.style.cssText="margin-bottom:8px;";const g=document.createElement("button");g.type="button",g.textContent=A?"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(),A)A=null,g.textContent="Capture Screenshot",m.style.display="none";else{g.textContent="Capturing...",g.disabled=!0;const M=await un(e);M?(A=M,g.textContent="Remove Screenshot",m.style.display="block",m.style.backgroundImage=`url(${M})`):g.textContent="Capture Failed — Retry",g.disabled=!1}}),s.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:${A?"block":"none"};`,s.append(m),p.append(s);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(),z.click()),f.key==="Escape"&&(f.preventDefault(),q())}),p.append(y);const w=document.createElement("div");w.style.cssText="display:flex;gap:6px;";const z=he(o?"Save":"Create",async()=>{const f=y.value.trim();if(!f){y.style.borderColor=r.danger;return}const M=Y();if(M){z.textContent=o?"Saving...":"Creating...",z.disabled=!0;try{if(o)await M.updateAnnotation(o.id,{comment:f,intent:F,severity:$,...A!=="existing"&&{screenshot:A}}),A&&A!=="existing"&&await M.saveScreenshot(o.id,A).catch(()=>{});else{const L=tn(e),Q=i?.x??t.x+t.width/2,te=i?.y??t.y+t.height/2,re=Bt(Q,te,L),ye=dn(e),Me=wt(e),ze=an(e),Pe=sn(e),Ge=Tt(e),Re={accessibility:ye,boundingBox:{height:t.height,width:t.width,x:t.x+(L?0:window.scrollX),y:t.y+(L?0:window.scrollY)},comment:f,computedStyles:Me||void 0,cssClasses:rn(e.classList),elementLabel:Ge,elementPath:x,elementTag:a,frameworkContext:u,fullPath:ze,intent:F,isFixed:L||void 0,nearbyElements:Pe||void 0,nearbyText:h||void 0,selectedText:c||void 0,severity:$,source:n,url:globalThis.location.href,x:re.x,y:re.y},j=await M.createAnnotation(Re);A&&A!=="existing"&&await M.saveScreenshot(j.id,A).catch(()=>{}),W.push(j)}await X(),q(),K(o?"Annotation saved":"Annotation created")}catch{z.textContent="Error — retry",z.disabled=!1}}});w.append(z,he("Cancel",()=>q())),o&&w.append(he("Delete",async()=>{await Y()?.deleteAnnotation?.(o.id),await X(),q()},r.danger)),p.append(w),p.append(At(r,()=>q())),pt(p,T,b,y)},"showAnnotationForm"),jt=_((e,t,n)=>{q(),N();const o=We(),i=e.slice(0,5).map(p=>p.tagName.toLowerCase()).join(", "),r=document.createElement("div");r.id=be,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 a=document.createElement("div");a.style.cssText=`color:${o.primary};font-weight:bold;margin-bottom:8px;font-size:12px;`,a.textContent=`Multi-Select: ${e.length} elements`,r.append(a);const l=document.createElement("div");l.style.cssText=`color:${o.muted};font-size:10px;margin-bottom:8px;padding:4px 6px;background:${o.btnBg};border:1px solid ${o.btnBorder};`,l.textContent=i+(e.length>5?` +${e.length-5} more`:""),r.append(l);let d="fix";r.append(Se(o,"Intent",["fix","change","question","approve"].map(p=>({active:p===d,activeStyle:`background:${U[p].bg};border-color:${U[p].border};color:${U[p].fg}`,key:p,label:Qe[p]})),p=>{d=p}));let x="important";r.append(Se(o,"Severity",["blocking","important","suggestion"].map(p=>({active:p===x,activeStyle:`background:${o.btnBg};border-color:${o.primary};color:${o.primary}`,key:p,label:Ke[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(),q())}),r.append(h);const c=document.createElement("div");c.style.cssText="display:flex;gap:6px;";const u=he("Create",async()=>{const p=h.value.trim();if(!p){h.style.borderColor=o.danger;return}const b=Y();if(!b)return;const T=Bt(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:T.x,y:T.y};await b.createAnnotation(v),await X(),q(),K("Annotation created")});c.append(u),c.append(he("Cancel",()=>q())),r.append(c),r.append(At(o,()=>q())),pt(r,t.x+t.width/2,t.bottom,h)},"showMultiSelectForm"),bo=_(e=>{q(),N();const t=We();document.getElementById(it)?.remove();const n=document.createElement("div");n.id=it,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=be,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 a="fix";i.append(Se(t,"Intent",["fix","change","question","approve"].map(u=>({active:u===a,activeStyle:`background:${U[u].bg};border-color:${U[u].border};color:${U[u].fg}`,key:u,label:Qe[u]})),u=>{a=u}));let l="important";i.append(Se(t,"Severity",["blocking","important","suggestion"].map(u=>({active:u===l,activeStyle:`background:${t.btnBg};border-color:${t.primary};color:${t.primary}`,key:u,label:Ke[u]})),u=>{l=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=_(()=>{q(),document.getElementById(it)?.remove()},"cleanup"),h=document.createElement("div");h.style.cssText="display:flex;gap:6px;justify-content:flex-end;",h.append(he("Cancel",x));const c=he("Add",async()=>{const u=d.value.trim();if(!u){d.style.borderColor=t.danger;return}const p=Y();if(p){c.textContent="Adding...",c.disabled=!0;try{const b=Bt(e.x+e.width/2,e.y+e.height/2),T={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:a,isMultiSelect:!0,severity:l,url:globalThis.location.href,x:b.x,y:b.y};await p.createAnnotation(T),await X(),x(),K("Annotation created")}catch{c.textContent="Error — retry",c.disabled=!1}}},"#22c55e");h.append(c),i.append(h),i.append(At(t,x)),pt(i,e.x+e.width/2,e.bottom,d)},"showAreaSelectionForm"),yo=_((e,t,n)=>{const o=window.innerWidth,i=window.innerHeight,r=8;let a;n+r+e.height<=i-r?a=n+r:n-r-e.height>=r?a=n-r-e.height:a=Math.max(r,i-e.height-r);let l;return t+e.width<=o-r?l=t:t-e.width>=r?l=t-e.width:l=Math.max(r,o-e.width-r),{left:l,top:a}},"computePopupPosition"),pt=_((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 a=e.getBoundingClientRect(),{left:l,top:d}=yo(a,t,n);e.style.top=`${d}px`,e.style.left=`${l}px`},"applyPosition");requestAnimationFrame(()=>{i(),o?.focus()});const r=new ResizeObserver(()=>{i()});r.observe(e),e.__resizeObserver=r},"positionFormNearAnchor"),Se=_((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 a=document.createElement("div");a.style.cssText="display:flex;gap:4px;";const l=[];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 l){const u=n.find(p=>p.key===c.dataset.key);c.dataset.key===d.key&&u?Object.assign(c.style,vo(u.activeStyle)):(c.style.background=e.btnBg,c.style.borderColor=e.btnBorder,c.style.color=e.muted)}}),l.push(x),a.append(x)}return i.append(a),i},"createToggleGroup"),vo=_(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 a=i.replaceAll(/-([a-z])/g,(l,d)=>d.toUpperCase());t[a]=r}}return t},"parseInlineStyle"),N=_(()=>{const e=document.querySelector(`#${Lt}`);e?.annotationId&&ut(e.annotationId,!1),e?.__cleanup?.(),e?.__resizeObserver?.disconnect(),e?.remove()},"removeAnnotationDetail"),ut=_((e,t)=>{const n=document.querySelector(`.${fe}[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")}},"setMarkerPopupOpen"),$e=_(e=>{N(),q(),ut(e.id,!0);const t=We(),n=U[e.intent],o=t.bg==="#18181b",i=document.createElement("div");i.id=Lt,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:a}=Ne(e.x,e.y,e.isFixed??!1),l=document.createElement("div");l.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};`,l.append(d);const x=document.createElement("span");x.textContent=Ke[e.severity],x.style.cssText=`font-size:10px;font-weight:600;color:${e.severity==="blocking"?t.danger:t.muted};`,l.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};`,l.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(),N()}),l.append(c),i.append(l);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 T=document.createElement("summary");T.textContent=`${e.elementLabel??e.elementTag}${e.source?` • ${e.source.split("/").pop()}`:""}`,T.style.cssText=`cursor:pointer;font-size:10px;color:${t.muted};padding:4px 0;list-style:none;`,T.addEventListener("click",m=>m.stopPropagation()),b.append(T);const v=document.createElement("div");if(v.style.cssText="padding:6px 0;line-height:1.7;",se(v,"Element",`${e.elementTag}${e.cssClasses?` .${e.cssClasses}`:""}`),e.elementPath&&se(v,"Selector",e.elementPath),e.source&&se(v,"Source",e.source,t.primary),e.frameworkContext&&se(v,"Component",`${e.frameworkContext.componentName} (${e.frameworkContext.framework})`,t.success),e.nearbyText&&se(v,"Context",e.nearbyText),e.selectedText&&se(v,"Selected",`"${e.selectedText}"`),se(v,"URL",e.url),se(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 z=w.role==="human",f=document.createElement("div");f.style.cssText=["max-width:85%","padding:6px 10px",`border-radius:${z?"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:${z?"flex-end":"flex-start"}`,z?`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 M=document.createElement("div");M.style.cssText=`font-size:10px;color:${t.muted};margin-top:2px;opacity:0.6;text-align:${z?"right":"left"};`,M.textContent=new Date(w.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});const L=document.createElement("div");L.style.cssText=`display:flex;flex-direction:column;align-items:${z?"flex-end":"flex-start"};`,L.append(f,M),y.append(L)}requestAnimationFrame(()=>{y.scrollTop=y.scrollHeight}),u.append(y)}i.append(u);const D=document.createElement("div");D.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`}),D.append(k);const C=document.createElement("button");C.type="button",C.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 F=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");C.append(F.documentElement),C.disabled=!0,k.addEventListener("input",()=>{const m=k.value.trim().length>0;C.disabled=!m,C.style.opacity=m?"1":"0.3",C.style.cursor=m?"pointer":"not-allowed"}),C.addEventListener("click",async m=>{m.preventDefault(),m.stopPropagation();const y=k.value.trim();if(!y)return;await Y()?.updateAnnotation?.(e.id,{threadMessage:{content:y,role:"human",timestamp:new Date().toISOString()}}),K("Message sent"),await X();const w=W.find(z=>z.id===e.id);w&&$e(w)}),D.append(C),i.append(D);const R=document.createElement("div");if(R.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 Y()?.updateAnnotation?.(e.id,{status:"resolved"}),K("Annotation resolved"),await X(),N()}),R.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 z=document.createElement("div");z.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};`,z.append(f);const M=document.createElement("button");M.type="button",M.textContent="×",M.style.cssText=`background:none;border:none;color:${t.muted};cursor:pointer;font-size:16px;padding:0;line-height:1;margin-left:auto;`,M.addEventListener("click",I=>{I.preventDefault(),I.stopPropagation(),N(),$e(e)}),z.append(M),i.append(z);const L=document.createElement("div");L.style.cssText="flex:1;overflow-y:auto;padding:12px;";const Q=document.createElement("div");Q.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,Q.textContent="Intent",L.append(Q);let te=e.intent;const re=document.createElement("div");re.style.cssText="display:flex;gap:4px;margin-bottom:12px;";const ye=[];for(const I of["fix","change","question","approve"]){const O=U[I],V=document.createElement("button");V.type="button",V.textContent=Qe[I],V.dataset.intent=I,V.style.cssText=`padding:4px 10px;border:none;font-size:10px;font-weight:600;cursor:pointer;transition:all 0.15s;${I===te?`background:${O.bg};color:${O.fg};box-shadow:0 0 0 1px ${O.border};`:`background:${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)"};color:${t.muted};`}`,V.addEventListener("click",G=>{G.preventDefault(),G.stopPropagation(),te=I;for(const ie of ye){const mt=U[ie.dataset.intent];ie.dataset.intent===I?(ie.style.background=mt.bg,ie.style.color=mt.fg,ie.style.boxShadow=`0 0 0 1px ${mt.border}`):(ie.style.background=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",ie.style.color=t.muted,ie.style.boxShadow="none")}}),ye.push(V),re.append(V)}L.append(re);const Me=document.createElement("div");Me.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,Me.textContent="Severity",L.append(Me);let ze=e.severity;const Pe=document.createElement("div");Pe.style.cssText="display:flex;gap:4px;margin-bottom:12px;";const Ge=[];for(const I of["blocking","important","suggestion"]){const O=document.createElement("button");O.type="button",O.textContent=Ke[I],O.dataset.severity=I,O.style.cssText=`padding:4px 10px;border:none;font-size:10px;font-weight:600;cursor:pointer;transition:all 0.15s;${I===ze?`background:${t.primary};color:#18181b;`:`background:${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)"};color:${t.muted};`}`,O.addEventListener("click",V=>{V.preventDefault(),V.stopPropagation(),ze=I;for(const G of Ge)G.dataset.severity===I?(G.style.background=t.primary,G.style.color="#18181b"):(G.style.background=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",G.style.color=t.muted)}),Ge.push(O),Pe.append(O)}L.append(Pe);const Re=document.createElement("div");Re.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,Re.textContent="Comment",L.append(Re);const j=document.createElement("textarea");j.value=e.comment,j.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;`,j.addEventListener("click",I=>I.stopPropagation()),j.addEventListener("keydown",I=>I.stopPropagation()),j.addEventListener("focus",()=>{j.style.borderColor=t.primary}),j.addEventListener("blur",()=>{j.style.borderColor=o?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"}),L.append(j),i.append(L);const Ie=document.createElement("div");Ie.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 De=document.createElement("button");De.type="button",De.textContent="Save",De.style.cssText=`padding:4px 10px;border:none;background:${t.primary};color:#18181b;font-size:10px;font-weight:600;cursor:pointer;`,De.addEventListener("click",async I=>{I.stopPropagation();const O=j.value.trim();if(!O){j.style.borderColor=t.danger;return}await Y()?.updateAnnotation?.(e.id,{comment:O,intent:te,severity:ze}),K("Annotation saved"),await X();const V=W.find(G=>G.id===e.id);V?(N(),$e(V)):N()}),Ie.append(De);const Fe=document.createElement("button");Fe.type="button",Fe.textContent="Cancel",Fe.style.cssText=`padding:4px 10px;border:1px solid ${t.btnBorder};background:transparent;color:${t.fg};font-size:10px;font-weight:500;cursor:pointer;`,Fe.addEventListener("click",I=>{I.stopPropagation(),N(),$e(e)}),Ie.append(Fe);const Oe=document.createElement("button");Oe.type="button",Oe.textContent="Delete",Oe.style.cssText=`padding:4px 10px;border:none;background:transparent;color:${t.danger};font-size:10px;cursor:pointer;margin-left:auto;`,Oe.addEventListener("click",async I=>{I.stopPropagation(),await Y()?.deleteAnnotation?.(e.id),W=W.filter(O=>O.id!==e.id),K("Annotation deleted"),N(),lt()}),Ie.append(Oe),i.append(Ie),setTimeout(()=>j.focus(),50)}),R.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 Y()?.updateAnnotation?.(e.id,{status:"dismissed"}),K("Annotation dismissed"),await X(),N()}),$.append(m)}const B=document.createElement("button");B.type="button",B.textContent="Copy",B.style.cssText=`padding:4px 8px;border:none;background:transparent;color:${t.muted};font-size:10px;cursor:pointer;`,B.addEventListener("click",async m=>{m.stopPropagation();try{await navigator.clipboard.writeText(Ct([e])),K("Copied to clipboard")}catch{K("Copy failed","error")}}),$.append(B);const A=document.createElement("button");A.type="button",A.textContent="Delete",A.style.cssText=`padding:4px 8px;border:none;background:transparent;color:${t.danger};font-size:10px;cursor:pointer;`,A.addEventListener("click",async m=>{m.stopPropagation(),await Y()?.deleteAnnotation?.(e.id),W=W.filter(y=>y.id!==e.id),K("Annotation deleted"),N(),lt()}),$.append(A),R.append($),i.append(R),pt(i,r+16,a);const s=_(m=>{!i.contains(m.target)&&!m.target?.classList.contains(fe)&&N()},"outsideHandler"),g=setTimeout(()=>{document.addEventListener("click",s,!0)},100);i.__cleanup=()=>{clearTimeout(g),document.removeEventListener("click",s,!0)}},"showAnnotationDetail");let Ce;const wo=_(()=>{Ce||(Ce=_(e=>{if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.key==="C"){e.preventDefault();const t=Ct(W);navigator.clipboard.writeText(t).catch(()=>{})}},"markdownShortcutHandler"),document.addEventListener("keydown",Ce))},"attachMarkdownShortcut"),$n=_(()=>{Ce&&(document.removeEventListener("keydown",Ce),Ce=void 0)},"detachMarkdownShortcut"),Nt=_(e=>{if(!e)return!1;for(const t of[be,Lt]){const n=document.querySelector(`#${t}`);if(n&&(e===n||n.contains(e)))return!0}return!!e.closest?.(`.${fe}`)},"isOverAnnotationOverlay");var $o=Object.defineProperty,kn=ae((e,t)=>$o(e,"name",{value:t,configurable:!0}),"o");const ko=kn(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"]),a=e.tagName.toLowerCase(),l=r.has(a)&&!e.hasAttribute("disabled"),d=e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false",x=l||d||i!==null&&i>=0;return{ariaAttributes:t,focusable:x,role:n,tabindex:i}},"captureA11yInfo"),Eo=kn(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
- `)},"formatA11yText");var _o=Object.defineProperty,H=ae((e,t)=>_o(e,"name",{value:t,configurable:!0}),"u");const Mt="__vdt_ruler_corner",zt="__vdt_ruler_h",Pt="__vdt_ruler_v",Rt="__vdt_guideline",En='9px "JetBrains Mono","Geist Mono",ui-monospace,monospace';let Le=!1,ke=null,Z=null,ee=null,dt=new Set,Ve=null,Ye=null,Xe=null;const _n=H(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,a=10,l=r/a;return{major:r,minor:l,stepsPerMajor:a}},"computeTickIntervals"),Tn=H((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:a}=globalThis,{minor:l,stepsPerMajor:d}=_n(1);r.fillStyle=t.muted,r.strokeStyle=t.muted,r.lineWidth=1,r.font=En,r.textAlign="center",r.textBaseline="top";const x=Math.floor(a/l),h=Math.ceil((a+o)/l);for(let c=x;c<=h;c++){const u=c*l,p=u-a;if(p<0||p>o)continue;const b=c%d===0,T=c%(d/2)===0;let v;b?v=10:T?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)}},"drawHorizontalRuler"),Cn=H((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:a}=globalThis,{minor:l,stepsPerMajor:d}=_n(1);r.fillStyle=t.muted,r.strokeStyle=t.muted,r.lineWidth=1,r.font=En;const x=Math.floor(a/l),h=Math.ceil((a+i)/l);for(let c=x;c<=h;c++){const u=c*l,p=u-a;if(p<0||p>i)continue;const b=c%d===0,T=c%(d/2)===0;let v;b?v=10:T?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())}},"drawVerticalRuler"),qt=H(()=>{Xe&&(Z&&Tn(Z,Xe),ee&&Cn(ee,Xe))},"redraw"),To=H(e=>{const t=[],n=document.querySelectorAll("body *"),o=2e3;let i=0;for(const r of n){if(i>=o)break;if(r.id===Mt||r.id===zt||r.id===Pt||r.classList.contains(Rt))continue;const a=r.getBoundingClientRect();a.width===0&&a.height===0||(e==="horizontal"?t.push(a.top,a.bottom):t.push(a.left,a.right),i++)}return t},"collectSnapEdges"),Co=H((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},"findSnapEdge"),et=9,Ht=H((e,t,n)=>{const o=document.createElement("div");o.className=Rt;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 a=document.createElement("div");a.style.cssText=["position:absolute","pointer-events:auto",i?`left:0;right:0;height:${et*2+1}px;top:${-et}px`:`top:0;bottom:0;width:${et*2+1}px;left:${-et}px`,"background:transparent",i?"cursor:row-resize":"cursor:col-resize"].join(";"),o.append(a);const l=document.createElement("div");l.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(l),document.body.append(o),dt.add(o);let d=t;const x=H(c=>{d=c,i?o.style.top=`${d}px`:o.style.left=`${d}px`;const u=i?d+window.scrollY:d+window.scrollX;l.textContent=`${Math.round(u)}px`},"updatePosition"),h=H(()=>{let c=performance.now(),u=d,p=!1,b=null;l.style.display="";const T=H(D=>{const k=performance.now(),C=i?D.clientY:D.clientX,F=Math.abs(C-u)/Math.max(1,k-c);if(c=k,u=C,b===null&&(b=To(e)),F<3){const R=Co(C,b);if(R!==null){x(R),p||(p=!0,r.style.background="#0D99FF",l.style.background="#0D99FF");return}}p&&(p=!1,r.style.background=n.primary,l.style.background=n.primary),x(C)},"onPointerMove"),v=H(()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",v),l.style.display="none",r.style.background=n.primary,l.style.background=n.primary,(i&&d<20||!i&&d<20)&&(o.remove(),dt.delete(o))},"onPointerUp");document.addEventListener("pointermove",T),document.addEventListener("pointerup",v)},"startDrag");a.addEventListener("pointerdown",c=>{c.preventDefault(),c.stopPropagation(),h()}),x(d),h()},"spawnGuideline"),So=H(e=>{Le||(Xe=e,ke=document.createElement("div"),ke.id=Mt,ke.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(ke),Z=document.createElement("canvas"),Z.id=zt,Z.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(";"),Z.addEventListener("pointerdown",t=>{t.preventDefault(),Ht("horizontal",t.clientY,e)}),document.body.append(Z),ee=document.createElement("canvas"),ee.id=Pt,ee.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(";"),ee.addEventListener("pointerdown",t=>{t.preventDefault(),Ht("vertical",t.clientX,e)}),document.body.append(ee),Tn(Z,e),Cn(ee,e),Ve=qt,window.addEventListener("resize",Ve),Ye=qt,window.addEventListener("scroll",Ye,{passive:!0}),Le=!0)},"createRulers"),Sn=H(()=>{if(Le){ke?.remove(),Z?.remove(),ee?.remove();for(const e of dt)e.remove();dt.clear(),Ve&&(window.removeEventListener("resize",Ve),Ve=null),Ye&&(window.removeEventListener("scroll",Ye),Ye=null),ke=null,Z=null,ee=null,Xe=null,Le=!1}},"removeRulers"),Vt=H(()=>Le,"areRulersVisible"),yt=H(e=>{if(!Le)return!1;const{id:t}=e;return t===Mt||t===zt||t===Pt?!0:e.classList.contains(Rt)},"isRulerElement");var Lo=Object.defineProperty,S=ae((e,t)=>Lo(e,"name",{value:t,configurable:!0}),"l");const Ae=to,Ao=yn,me="__vdt_inspector_overlay",Bo=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"]),Ln="__vdt_inspector_label",kt="__vdt_inspector_cursor",J="__vdt_inspector_badge",Yt="__vdt_inspector_kf",Be="__vdt_inspector_result",tt=S(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},"isInsideDevToolbar"),Mo=S(()=>{let e=document.querySelector(`#${me}`);if(!e){const t=Ae();e=document.createElement("div"),e.id=me,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=Ln,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},"getOrCreateOverlay"),Et=S(e=>{let t=e;for(;t;){const n=t.dataset.vdtSource;if(n)return n;t=t.parentElement??void 0}},"findSource"),zo=S(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}`},"formatSourceShort"),nt=S(e=>{const t=document.querySelector(`#${me}`);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(`#${Ln}`);if(o){const i=e.tagName.toLowerCase(),r=e.id?`#${e.id}`:"",a=e.classList.length>0?`.${[...e.classList].slice(0,3).join(".")}`:"",l=`${i}${r}${a}`,d=Et(e);o.textContent=d?`${l} · ${zo(d)}`:l,n.top<28?(o.style.bottom="auto",o.style.top="calc(100% + 2px)"):(o.style.top="",o.style.bottom="calc(100% + 2px)")}},"updateOverlayPosition"),ve=S(()=>{const e=document.querySelector(`#${me}`);e&&(e.style.display="none")},"hideOverlay"),Po=S(()=>{document.querySelector(`#${me}`)?.remove(),document.querySelector(`#${kt}`)?.remove()},"removeOverlay"),Xt=S(e=>{let t=document.querySelector(`#${kt}`);e?(t||(t=document.createElement("style"),t.id=kt,document.head.append(t)),t.textContent=["*, *::before, *::after { cursor: crosshair !important; }",`#${J}, #${J} * { cursor: pointer !important; }`,`#${Be}, #${Be} * { 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()},"setCrosshairCursor");let Ue="inspect";const An=S(()=>{document.querySelector(`#${J}`)?.remove()},"removeFloatingBadge"),It=S(e=>new DOMParser().parseFromString(e,"image/svg+xml").documentElement,"parseSvg"),Ut='<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>',Qt='<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>',Kt='<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>',Ro='<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>',Io='<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>',Do='<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>',Fo='<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>',Oo='<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>',jo='<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>',No='<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 oe=!0;const we=S((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 a=document.createElement("div");return a.style.cssText="width:24px;height:24px;display:flex;align-items:center;justify-content:center;user-select:none;",a.append(It(t)),r.append(a),r.addEventListener("pointerover",()=>{r.style.background=`${e.primary}14`,r.style.color=e.primary}),r.addEventListener("pointerout",()=>{const l=r.dataset.active==="1";r.style.background=l?`${e.primary}1f`:"transparent",r.style.color=l?e.primary:e.muted}),r.addEventListener("pointerdown",()=>{r.style.transform="scale(0.94)"}),r.addEventListener("pointerup",()=>{r.style.transform=""}),r.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),o()}),r},"makeToolbarButton"),Jt=S((e,t)=>{const n=e.querySelector("svg");n&&n.replaceWith(It(t))},"setButtonIcon"),vt=S((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)},"showToast"),qo=S(e=>{if(!document.querySelector(`#${Yt}`)){const $=document.createElement("style");$.id=Yt,$.textContent="@keyframes __vdt_pulse{0%,100%{opacity:1}50%{opacity:.3}}",document.head.append($)}An(),oe=!0;const t=Ae(),n=document.createElement("div"),o=t===Ao,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=J,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,a=0;const l=S($=>{n.style.left=`${$.clientX-r}px`,n.style.top=`${$.clientY-a}px`,n.style.transform="none",n.style.bottom="auto",n.style.cursor="grabbing"},"onDragMove"),d=S(()=>{document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",d),n.style.cursor=""},"onDragEnd");n.addEventListener("pointerdown",$=>{if($.target.closest("button"))return;const B=n.getBoundingClientRect();r=$.clientX-B.left,a=$.clientY-B.top,document.addEventListener("pointermove",l),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 B=document.createElement("div");B.style.cssText="display:flex;gap:2px;";for(let A=0;A<2;A++){const s=document.createElement("div");s.style.cssText=`width:2px;height:2px;border-radius:50%;background:${t.muted};`,B.append(s)}x.append(B)}n.append(x),Ue="inspect";const h=S(($,B,A)=>{const s=document.createElement("button");s.type="button",s.title=B;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(It($)),s.append(g);const m=S(()=>{const y=Ue===A;s.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(";")},"applyState");return m(),s.addEventListener("pointerover",()=>{s.style.background=`${t.primary}14`,s.style.color=t.primary}),s.addEventListener("pointerout",m),s.addEventListener("pointerdown",()=>{s.style.transform="scale(0.94)"}),s.addEventListener("pointerup",()=>{s.style.transform=""}),s.addEventListener("click",y=>{y.preventDefault(),y.stopPropagation(),Ue=A,m();for(const w of n.querySelectorAll("[data-mode]"))w!==s&&w.dispatchEvent(new Event("pointerout"))}),s.dataset.mode=A,s},"createModeButton"),c=h(Oo,"Inspect mode — click to view source & info","inspect");n.append(c);const u=h(jo,"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=Qn(),T=we(t,b?Qt:Ut,b?"Resume animations (P)":"Pause animations (P)",()=>{const $=Jn();Jt(T,$?Qt:Ut),T.title=$?"Resume animations (P)":"Pause animations (P)",T.dataset.active=$?"1":"",T.style.color=$?t.primary:t.muted,T.style.background=$?`${t.primary}22`:"transparent"},b);n.append(T);const v=we(t,Kt,"Toggle markers (H)",()=>{oe=!oe;for(const $ of document.querySelectorAll(".__vdt_annotation_marker"))$.style.visibility=oe?"visible":"hidden";Jt(v,oe?Kt:Ro),v.title=oe?"Hide markers (H)":"Show markers (H)",v.dataset.active=oe?"":"1",v.style.color=oe?t.muted:t.primary,v.style.background=oe?"transparent":`${t.primary}22`});n.append(v);const D=we(t,Io,"Copy annotations (C)",async()=>{const $=globalThis.__VISULIMA_DEVTOOLS__?.rpc;if($?.getAnnotations)try{const B=await $.getAnnotations(),{annotationsToMarkdown:A}=await Promise.resolve().then(()=>Vn),s=A(B,_t().outputDetail);await navigator.clipboard.writeText(s),vt("Copied to clipboard")}catch{vt("Copy failed","error")}});n.append(D);const k=Vt(),C=we(t,No,"Toggle rulers (R)",()=>{Vt()?(Sn(),C.dataset.active="",C.style.color=t.muted,C.style.background="transparent"):(So(t),C.dataset.active="1",C.style.color=t.primary,C.style.background=`${t.primary}22`)},k);n.append(C);const F="__vdt_clear_confirm";n.append(we(t,Do,"Clear all annotations (X)",()=>{document.getElementById(F)?.remove();const $=n.getBoundingClientRect(),B=document.createElement("div");B.id=F,B.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(";"),B.addEventListener("click",m=>m.stopPropagation()),B.addEventListener("mousedown",m=>m.stopPropagation());const A=document.createElement("span");A.textContent="Clear all annotations?",A.style.cssText=`color:${t.muted};font-size:11px;`;const s=document.createElement("button");s.type="button",s.textContent="Yes, clear",s.style.cssText="background:#ef4444;color:#fff;border:none;padding:4px 10px;cursor:pointer;font-size:11px;font-weight:600;",s.addEventListener("click",async m=>{m.stopPropagation(),B.remove();const y=globalThis.__VISULIMA_DEVTOOLS__?.rpc;if(!y?.getAnnotations||!y?.deleteAnnotation)return;const w=await y.getAnnotations();await Promise.all(w.map(z=>y.deleteAnnotation(z.id))),await X(),vt(`${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(),B.remove()}),B.append(A,s,g),document.body.append(B),setTimeout(()=>B.remove(),5e3)}));const R=document.createElement("span");R.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(R),n.append(we(t,Fo,"Close inspector (Esc)",()=>{e()})),document.body.append(n)},"createFloatingBadge"),Ho=S((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,l,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=a;const c=document.createElement("span");c.style.cssText=`color:${d?t.primary:t.fg};word-break:break-all;`,c.textContent=l,x.append(h,c),n.append(x)},"addRow");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 a of r)i(a,e.ariaAttributes[a]);if(!e.role&&r.length===0&&e.tabindex===null){const a=document.createElement("div");a.style.cssText=`color:${t.muted};font-style:italic;`,a.textContent="No ARIA attributes",n.append(a)}return n},"renderA11ySection");let Ee;const Vo=S(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,Mn()).catch(()=>{})},"openInEditor"),le=S(()=>{Ee?.(),Ee=void 0,document.querySelector(`#${Be}`)?.remove()},"removeResultPopup"),ot=S((e,t)=>{const n=Ae(),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},"makeActionButton"),Wt=S((e,t,n,o,i)=>{Ee?.(),Ee=void 0,le();const r=Ae(),a=document.createElement("div");a.id=Be,a.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 l=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}`,a.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,a.append(k)}const p=ko(e);a.append(Ho(p,r));const b=document.createElement("div");b.style.cssText="display:flex;gap:6px;flex-wrap:wrap;",n&&b.append(ot("Open in editor",()=>{Vo(n),le()})),b.append(ot("Copy HTML",()=>{navigator.clipboard.writeText(e.outerHTML).catch(()=>{}),le()})),n&&b.append(ot("Copy path",()=>{navigator.clipboard.writeText(n).catch(()=>{}),le()})),b.append(ot("Copy A11y",()=>{navigator.clipboard.writeText(Eo(p)).catch(()=>{}),le()})),a.append(b);const T=document.createElement("button");T.textContent="×",T.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(";"),T.addEventListener("pointerover",()=>{T.style.color=r.fg}),T.addEventListener("pointerout",()=>{T.style.color=r.muted}),T.addEventListener("click",k=>{k.stopPropagation(),le()}),a.append(T),a.style.top="-9999px",a.style.left="-9999px",document.body.append(a),xn(()=>{if(!document.contains(a))return;const k=a.getBoundingClientRect(),C=window.innerWidth,F=window.innerHeight,R=8;let $;d+R+k.height<=F-R?$=d+R:d-t.height-R-k.height>=R?$=d-t.height-R-k.height:$=Math.max(R,F-k.height-R);let B;B=l+k.width<=C-R?l:Math.max(R,C-k.width-R),a.style.top=`${$}px`,a.style.left=`${B}px`},0);const v=S(k=>{a.contains(k.target)||(le(),document.removeEventListener("click",v,!0),Ee=void 0)},"handleOutside"),D=setTimeout(()=>{document.addEventListener("click",v,!0)},100);Ee=S(()=>{clearTimeout(D),document.removeEventListener("click",v,!0)},"removePopupOutsideHandler")},"showResultPopup");let at;const Yo=S(e=>{at?.(),Mo(),Xt(!0),X().catch(()=>{}),wo();const t=S(()=>document.querySelector(`#${J}`)??void 0,"badgeElement"),n=S(s=>{if(!s)return!1;const g=t();return!!(g&&(s===g||g.contains(s)))},"isOverBadge"),o=S(s=>{if(!s)return!1;const g=document.querySelector(`#${Be}`);return!!(g&&(s===g||g.contains(s)))},"isOverResultPopup"),i=new MutationObserver(s=>{for(const g of s)for(const m of g.addedNodes)if(m instanceof HTMLElement&&(m.tagName==="VITE-ERROR-OVERLAY"||m.id==="vite-error-overlay")){C.cleanup(),e();return}});i.observe(document.body,{childList:!0});const r="__vdt_multi_select_outline";let a=[];const l={cmd:!1,shift:!1},d=S(()=>{for(const g of document.querySelectorAll(`.${r}`))g.remove();const s=a.length>1;for(const g of a){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`,s?"border:2px solid rgba(34,197,94,0.7);background:rgba(34,197,94,0.08);":`border:2px solid ${Ae().overlayBorder};background:${Ae().overlayBg};`,"transition:all 0.1s;"].join(""),document.body.append(y)}},"renderMultiSelectOutlines"),x=S(()=>{for(const s of document.querySelectorAll(`.${r}`))s.remove()},"removeMultiSelectOutlines"),h=S(()=>{if(a.length!==0)if(ve(),a.length===1){const s=a[0],g=s.element.getBoundingClientRect(),m=Et(s.element);x(),a=[],Ue==="annotate"?ct(s.element,g,m,void 0,{x:g.left+g.width/2,y:g.top+g.height/2}):Wt(s.element,g,m)}else{const s=a.map(w=>w.element),g=s.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(),a=[],jt(s,y,m)}},"commitMultiSelect"),c={hasMoved:!1,x:0,y:0},u=S(s=>{if((s.key==="Meta"||s.key==="Control")&&(l.cmd=!0,c.hasMoved&&!Ze())){const g=rt(c.x,c.y);if(g&&!tt(g)){nt(g);const m=document.querySelector(`#${me}`);m&&(m.style.borderStyle="dashed")}}s.key==="Shift"&&(l.shift=!0)},"handleModifierKeyDown"),p=S(s=>{const g=l.cmd&&l.shift;if((s.key==="Meta"||s.key==="Control")&&(l.cmd=!1,c.hasMoved&&!Ze())){const y=_e(c.x,c.y);if(y&&!tt(y)){nt(y);const w=document.querySelector(`#${me}`);w&&(w.style.borderStyle="solid")}}s.key==="Shift"&&(l.shift=!1);const m=l.cmd&&l.shift;g&&!m&&a.length>0&&h()},"handleModifierKeyUp"),b=S(()=>{l.cmd=!1,l.shift=!1,a.length>0&&(x(),a=[])},"handleModifierBlur");document.addEventListener("keydown",u),document.addEventListener("keyup",p),window.addEventListener("blur",b);const T="__vdt_drag_rect";let v,D=!1;const k=S(()=>{document.querySelector(`#${T}`)?.remove(),v=void 0,D=!1},"removeDragRect"),C={cleanup(){document.removeEventListener("mousemove",C.handleMouseMove),document.removeEventListener("mousedown",C.handleMouseDown),document.removeEventListener("mouseup",C.handleMouseUp,!0),document.removeEventListener("click",C.handleClick,!0),document.removeEventListener("keydown",C.handleKeyDown),i.disconnect(),ve(),Po(),k(),x(),a=[],document.removeEventListener("__vdt_annotation_form_closed",A),document.removeEventListener("keydown",u),document.removeEventListener("keyup",p),window.removeEventListener("blur",b),Xt(!1),Sn(),An(),at=void 0},handleClick(s){const g=((s.metaKey||s.ctrlKey)&&!s.shiftKey?rt(s.clientX,s.clientY):_e(s.clientX,s.clientY))??s.target;if(!g||tt(g)||n(g)||o(g)||Nt(g)||yt(g))return;if((s.metaKey||s.ctrlKey)&&s.shiftKey){s.preventDefault(),s.stopPropagation();const w=a.findIndex(z=>z.element===g);w===-1?a.push({element:g,name:Tt(g),rect:g.getBoundingClientRect()}):a.splice(w,1),d();return}if(s.preventDefault(),s.stopPropagation(),Ze()){fo();return}if(!_t().blockInteractions&&g.closest?.("button, a, input, select, textarea, [role='button'], [onclick]"))return;wn();const m=g.getBoundingClientRect(),y=Et(g);Ue==="annotate"?(nt(g),ct(g,m,y,void 0,{x:s.clientX,y:s.clientY})):(ve(),Wt(g,m,y,s.clientX,s.clientY))},handleKeyDown(s){const g=s.target?.tagName;if(g==="INPUT"||g==="TEXTAREA"||g==="SELECT")return;if(s.key==="Escape"){if(a.length>0){x(),a=[];return}C.cleanup(),e();return}const m=s.key.toLowerCase();if(m==="p"){s.preventDefault(),document.querySelector(`#${J} button[title*="animations"]`)?.click();return}if(m==="h"){s.preventDefault(),document.querySelector(`#${J} button[title*="markers"]`)?.click();return}if(m==="c"&&!s.ctrlKey&&!s.metaKey){s.preventDefault(),document.querySelector(`#${J} button[title*="Copy"]`)?.click();return}if(m==="r"){s.preventDefault(),document.querySelector(`#${J} button[title*="rulers"]`)?.click();return}m==="x"&&(s.preventDefault(),document.querySelector(`#${J} button[title*="Clear"]`)?.click())},handleMouseDown(s){const g=s.composedPath()[0]||s.target;g.closest?.(`#${J}`)||g.closest?.(`#${Be}`)||g.classList?.contains("__vdt_annotation_marker")||yt(g)||g.closest?.("#__vdt_annotation_form")||g.closest?.("#__vdt_annotation_detail")||Bo.has(g.tagName)||g.isContentEditable||(v={x:s.clientX,y:s.clientY},D=!1)},handleMouseMove(s){if(Ze())return;if(v){const w=s.clientX-v.x,z=s.clientY-v.y,f=w*w+z*z,M=8;if(!D&&f<M*M)return;D=!0;let L=document.querySelector(`#${T}`);L||(L=document.createElement("div"),L.id=T,L.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(L));const Q=Math.min(v.x,s.clientX),te=Math.min(v.y,s.clientY),re=Math.abs(s.clientX-v.x),ye=Math.abs(s.clientY-v.y);L.style.left=`${Q}px`,L.style.top=`${te}px`,L.style.width=`${re}px`,L.style.height=`${ye}px`;return}c.x=s.clientX,c.y=s.clientY,c.hasMoved=!0;const g=(s.metaKey||s.ctrlKey)&&!s.shiftKey,m=(g?rt(s.clientX,s.clientY):_e(s.clientX,s.clientY))??s.target;if(!m||tt(m)||n(m)||o(m)||Nt(m)||yt(m)){ve();return}nt(m);const y=document.querySelector(`#${me}`);y&&(y.style.borderStyle=g?"dashed":"solid")},handleMouseUp(s){if(!v||!D){k();return}s.preventDefault(),s.stopPropagation();const g=Math.min(v.x,s.clientX),m=Math.min(v.y,s.clientY),y=Math.abs(s.clientX-v.x),w=Math.abs(s.clientY-v.y);if(k(),y<20||w<20)return;const z=new DOMRect(g,m,y,w),f=mn(z);if(ve(),f.length===0)bo(z);else{const M=gn(f);jt(f,z,M)}}},{cleanup:F,handleClick:R,handleKeyDown:$,handleMouseMove:B}=C;qo(()=>{F(),e()});const A=S(()=>{ve()},"onFormClosed");document.addEventListener("__vdt_annotation_form_closed",A),document.addEventListener("mousemove",B),document.addEventListener("mousedown",C.handleMouseDown),document.addEventListener("mouseup",C.handleMouseUp,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",$),at=F},"startGlobalInspection"),Xo=S(()=>{at?.(),le(),vn(),$n();const e=globalThis.__VISULIMA_DEVTOOLS__;e?.getActiveApp?.()==="dev-toolbar:annotations"&&e.setAppActive?.("dev-toolbar:annotations",!1)},"stopGlobalInspection"),Jo={icon:zn,id:"dev-toolbar:inspector",name:"Inspector",onClick(){const e=globalThis.__VISULIMA_DEVTOOLS__;Yo(async()=>{try{if(vn(),$n(),e?.getActiveApp?.()==="dev-toolbar:annotations")try{await e.closeApp?.()}catch{}}finally{e?.setAppActive&&e.setAppActive("dev-toolbar:inspector",!1)}})},onDeactivate(){Xo()}};export{Jo as default};
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())},"freezeAll"),hn=ue(()=>{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<ce&&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<ce&&E.frozenRAFQueue.push(n);return}n(o)});for(const n of E.pausedAnimations)try{n.play()}catch{}E.pausedAnimations=[],document.getElementById($t)?.remove();for(const n of document.querySelectorAll("video[data-was-paused='false']"))n.play().catch(()=>{}),delete n.dataset.wasPaused},"unfreezeAll"),Wn=ue(()=>E.frozen?(hn(),!1):(Kn(),!0),"toggleFreeze");var Jn=Object.defineProperty,We=ae((e,t)=>Jn(e,"name",{value:t,configurable:!0}),"r");const fn={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)"},bn={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)"},yn={...fn,overlayBg:"rgba(196,181,253,0.06)",overlayBorder:"rgba(196,181,253,0.7)"},Gn={...bn,overlayBg:"rgba(124,58,237,0.06)",overlayBorder:"rgba(124,58,237,0.7)"},Zn={...fn,danger:"#ef4444",success:"#22c55e"},eo={...bn,danger:"#dc2626",success:"#16a34a"};let de;const St=We(()=>{if(de!==void 0)return de;try{const e=localStorage.getItem("__v_dt__theme");if(e==="light")return de=!1,!1;if(e==="dark")return de=!0,!0}catch{}return de=globalThis.window?.matchMedia("(prefers-color-scheme: dark)").matches??!0,de},"resolveIsDark");We(()=>St(),"isDarkTheme");const to=We(()=>St()?yn:Gn,"getInspectorPalette"),no=We(()=>St()?Zn:eo,"getAnnotationPalette");We(()=>{de=void 0},"resetPaletteCache");const Ft="__vdt_palette_listener";globalThis.window!==void 0&&!globalThis[Ft]&&(globalThis[Ft]=!0,globalThis.addEventListener("storage",e=>{e.key==="__v_dt__theme"&&(de=void 0)}));var oo=Object.defineProperty,_=ae((e,t)=>oo(e,"name",{value:t,configurable:!0}),"p");const fe="__vdt_annotation_marker",be="__vdt_annotation_form",Lt="__vdt_annotation_detail",it="__vdt_area_outline",U={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"},Ke={blocking:"Blocking",important:"Important",suggestion:"Suggestion"},Je=no,Y=_(()=>globalThis.__VISULIMA_DEVTOOLS__?.rpc,"getRpc"),ft=_(e=>{if(!e)return null;try{return document.querySelector(e)}catch{return null}},"safeQuerySelector"),K=_((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)},"showToast"),ro=_(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}},"matchesCurrentPage"),he=_((e,t,n)=>{const o=Je(),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},"makeButton"),se=_((e,t,n,o)=>{const i=document.createElement("div"),r=document.createElement("b");r.textContent=`${t}: `;const a=document.createElement("span");a.textContent=n,o&&(a.style.color=o),i.append(r,a),e.append(i)},"addMetaRow"),At=_((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},"makeCloseButton"),io=_(()=>globalThis.__VISULIMA_DEVTOOLS__?.getApps?.().some(e=>e.id==="dev-toolbar:annotations")??!1,"isAnnotationsAppEnabled");let J=[],Te,je,ge;const Bt=_((e,t,n=!1)=>({x:e/window.innerWidth*100,y:n?t:t+window.scrollY}),"toPageCoords"),Ne=_((e,t,n=!1)=>({left:e/100*window.innerWidth,top:n?t:t-window.scrollY}),"toViewportCoords"),ao=_(()=>{const e=document.querySelectorAll(`.${fe}`);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:a}=Ne(n,o,i);t.style.left=`${r-11}px`,t.style.top=`${a-11}px`,t.style.display=a<-24||a>window.innerHeight+24?"none":"flex"}},"repositionMarkers");let bt=!1;const Ot=_(()=>{bt||(bt=!0,xn(()=>{ao(),bt=!1},16))},"throttledReposition"),so=_(()=>{Te||(Te=Ot,je=Ot,window.addEventListener("scroll",Te,{passive:!0}),window.addEventListener("resize",je,{passive:!0}))},"attachScrollListeners"),lo=_(()=>{Te&&(window.removeEventListener("scroll",Te),Te=void 0),je&&(window.removeEventListener("resize",je),je=void 0)},"detachScrollListeners");let qe,He,pe=[];const co=_(()=>{if(ge)return;ge=_(()=>{X().catch(()=>{})},"navigationHandler"),globalThis.addEventListener("popstate",ge),qe=history.pushState.bind(history),He=history.replaceState.bind(history);const e=ge;history.pushState=(...t)=>{qe(...t);const n=setTimeout(()=>{e(),pe=pe.filter(o=>o!==n)},50);pe.push(n)},history.replaceState=(...t)=>{He(...t);const n=setTimeout(()=>{e(),pe=pe.filter(o=>o!==n)},50);pe.push(n)}},"attachNavigationListener"),po=_(()=>{ge&&(globalThis.removeEventListener("popstate",ge),ge=void 0);for(const e of pe)clearTimeout(e);pe=[],qe&&(history.pushState=qe,qe=void 0),He&&(history.replaceState=He,He=void 0)},"detachNavigationListener");let xe;const uo=_(()=>{if(!xe)try{xe=new EventSource("/__devtoolbar/events"),xe.addEventListener("annotations.changed",()=>{const e=Y();e?.getAnnotations&&e.getAnnotations().then(t=>{J=t,lt()}).catch(()=>{})}),xe.addEventListener("error",()=>{})}catch{}},"attachSSE"),mo=_(()=>{xe&&(xe.close(),xe=void 0)},"detachSSE"),X=_(async()=>{if(!io())return;const e=Y();if(e?.getAnnotations)try{J=await e.getAnnotations(),lt(),so(),co(),uo()}catch{}},"loadAndShowMarkers"),vn=_(()=>{for(const e of document.querySelectorAll(`.${fe}`))e.remove();wn(),lo(),po(),mo(),hn()},"removeAllMarkers"),wn=_(()=>{q(),N(),document.getElementById(it)?.remove()},"closeAnnotationPopups"),lt=_(()=>{for(const t of document.querySelectorAll(`.${fe}`))t.remove();const e=J.filter(t=>(t.status==="pending"||t.status==="acknowledged")&&ro(t.url));for(const[t,n]of e.entries())xo(n,t+1)},"renderMarkers"),ne="__vdt_annotation_highlight",go={bg:"#22c55e",border:"#16a34a",fg:"#fff",highlightBg:"rgba(34,197,94,0.12)"},xo=_((e,t)=>{const n=_t(),o=e.isMultiSelect&&t>1?go:Gt(n),i=e.isFixed??!1,{left:r,top:a}=Ne(e.x,e.y,i),s=e.status==="acknowledged",d=document.createElement("div");d.className=fe,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:${a-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)`,s?"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(ne);p||(p=document.createElement("div"),p.id=ne,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=ft(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=_e(p,b),c){const T=c.getBoundingClientRect(),v=u.width>0?T.width/u.width:1,D=u.height>0?T.height/u.height:1;(v<.5||D<.5)&&(c=null)}}if(c){const u=c.getBoundingClientRect();let p=document.getElementById(ne);p||(p=document.createElement("div"),p.id=ne,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(ne);b||(b=document.createElement("div"),b.id=ne,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=`${ne}_${c}`;let b=document.getElementById(p);b||(b=document.createElement("div"),b.id=p,document.body.append(b));const T=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:${T}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(ne)?.remove(),e.elementBoundingBoxes)for(let c=0;c<e.elementBoundingBoxes.length;c++)document.getElementById(`${ne}_${c}`)?.remove()}),d.addEventListener("click",h=>{if(h.stopPropagation(),h.preventDefault(),n.markerClickBehavior==="delete")Y()?.deleteAnnotation?.(e.id)?.then(()=>{X().catch(()=>{})});else if(n.markerClickBehavior==="edit"){const c=ft(e.elementPath),{left:u,top:p}=Ne(e.x,e.y,e.isFixed),b=c?.getBoundingClientRect()??new DOMRect(u,p,100,20);ct(c??document.body,b,e.source,e)}else $e(e)}),d.addEventListener("contextmenu",h=>{if(h.preventDefault(),h.stopPropagation(),n.markerClickBehavior==="delete"){const c=ft(e.elementPath),{left:u,top:p}=Ne(e.x,e.y,e.isFixed),b=c?.getBoundingClientRect()??new DOMRect(u,p,100,20);ct(c??document.body,b,e.source,e)}else $e(e)}),(a<-24||a>window.innerHeight+24)&&(d.style.display="none"),document.body.append(d)},"createMarkerElement"),ho=_(e=>{e&&e.__resizeObserver?.disconnect()},"cleanupResizeObserver"),q=_(()=>{const e=document.querySelector(`#${be}`),t=!!e;e?.annotationId&&ut(e.annotationId,!1),ho(e),e?.remove(),document.querySelector("#__vdt_pending_marker")?.remove(),t&&document.dispatchEvent(new CustomEvent("__vdt_annotation_form_closed"))},"removeAnnotationForm"),Ze=_(()=>!!document.querySelector(`#${be}`),"isAnnotationFormOpen"),fo=_(()=>{const e=document.querySelector(`#${be}`);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})},"shakeAnnotationForm"),ct=_((e,t,n,o,i)=>{q(),N();const r=Je(),a=e.tagName.toLowerCase(),s=e.id?`#${e.id}`:"",d=e.classList.length>0?`.${[...e.classList].slice(0,3).join(".")}`:"",x=nn(e),h=ln(e),c=cn(),u=pn(e),p=document.createElement("div");p.id=be,o&&(p.annotationId=o.id,ut(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,T=i?.x??t.left,v="__vdt_pending_marker";if(document.getElementById(v)?.remove(),i&&!o){const f=Gt(),M=document.createElement("div");M.id=v,M.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 L=document.createElement("span");L.style.cssText=`color:${f.fg};font-size:13px;font-weight:700;line-height:1;`,L.textContent="+",M.append(L),document.body.append(M)}const D=document.createElement("div");D.style.cssText=`color:${r.primary};font-weight:bold;margin-bottom:8px;font-size:12px;`,D.textContent=o?"Edit Annotation":"Annotate Element",p.append(D);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 C=document.createElement("span");if(C.textContent=`${a}${s}${d}`,k.append(C),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=wt(e);if(f){const M=document.createElement("details");M.style.cssText=`margin-bottom:8px;font-size:10px;color:${r.muted};`;const L=document.createElement("summary");L.style.cssText="cursor:pointer;font-size:10px;padding:2px 0;",L.textContent="Computed Styles",L.addEventListener("click",te=>te.stopPropagation());const Q=document.createElement("div");Q.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;`,Q.textContent=f.replaceAll("; ",`;
29
+ `),M.append(L,Q),p.append(M)}}let F=o?.intent??"fix";const R=Se(r,"Intent",["fix","change","question","approve"].map(f=>({active:f===F,activeStyle:`background:${U[f].bg};border-color:${U[f].border};color:${U[f].fg}`,key:f,label:Qe[f]})),f=>{F=f});p.append(R);let $=o?.severity??"important";const B=Se(r,"Severity",["blocking","important","suggestion"].map(f=>({active:f===$,activeStyle:`background:${r.btnBg};border-color:${r.primary};color:${r.primary}`,key:f,label:Ke[f]})),f=>{$=f});p.append(B);let A=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=A?"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(),A)A=null,g.textContent="Capture Screenshot",m.style.display="none";else{g.textContent="Capturing...",g.disabled=!0;const M=await un(e);M?(A=M,g.textContent="Remove Screenshot",m.style.display="block",m.style.backgroundImage=`url(${M})`):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:${A?"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(),z.click()),f.key==="Escape"&&(f.preventDefault(),q())}),p.append(y);const w=document.createElement("div");w.style.cssText="display:flex;gap:6px;";const z=he(o?"Save":"Create",async()=>{const f=y.value.trim();if(!f){y.style.borderColor=r.danger;return}const M=Y();if(M){z.textContent=o?"Saving...":"Creating...",z.disabled=!0;try{if(o)await M.updateAnnotation(o.id,{comment:f,intent:F,severity:$,...A!=="existing"&&{screenshot:A}}),A&&A!=="existing"&&await M.saveScreenshot(o.id,A).catch(()=>{});else{const L=tn(e),Q=i?.x??t.x+t.width/2,te=i?.y??t.y+t.height/2,re=Bt(Q,te,L),ye=dn(e),Me=wt(e),ze=an(e),Pe=sn(e),Ge=Tt(e),Re={accessibility:ye,boundingBox:{height:t.height,width:t.width,x:t.x+(L?0:window.scrollX),y:t.y+(L?0:window.scrollY)},comment:f,computedStyles:Me||void 0,cssClasses:rn(e.classList),elementLabel:Ge,elementPath:x,elementTag:a,frameworkContext:u,fullPath:ze,intent:F,isFixed:L||void 0,nearbyElements:Pe||void 0,nearbyText:h||void 0,selectedText:c||void 0,severity:$,source:n,url:globalThis.location.href,x:re.x,y:re.y},j=await M.createAnnotation(Re);A&&A!=="existing"&&await M.saveScreenshot(j.id,A).catch(()=>{}),J.push(j)}await X(),q(),K(o?"Annotation saved":"Annotation created")}catch{z.textContent="Error — retry",z.disabled=!1}}});w.append(z,he("Cancel",()=>q())),o&&w.append(he("Delete",async()=>{await Y()?.deleteAnnotation?.(o.id),await X(),q()},r.danger)),p.append(w),p.append(At(r,()=>q())),pt(p,T,b,y)},"showAnnotationForm"),jt=_((e,t,n)=>{q(),N();const o=Je(),i=e.slice(0,5).map(p=>p.tagName.toLowerCase()).join(", "),r=document.createElement("div");r.id=be,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 a=document.createElement("div");a.style.cssText=`color:${o.primary};font-weight:bold;margin-bottom:8px;font-size:12px;`,a.textContent=`Multi-Select: ${e.length} elements`,r.append(a);const s=document.createElement("div");s.style.cssText=`color:${o.muted};font-size:10px;margin-bottom:8px;padding:4px 6px;background:${o.btnBg};border:1px solid ${o.btnBorder};`,s.textContent=i+(e.length>5?` +${e.length-5} more`:""),r.append(s);let d="fix";r.append(Se(o,"Intent",["fix","change","question","approve"].map(p=>({active:p===d,activeStyle:`background:${U[p].bg};border-color:${U[p].border};color:${U[p].fg}`,key:p,label:Qe[p]})),p=>{d=p}));let x="important";r.append(Se(o,"Severity",["blocking","important","suggestion"].map(p=>({active:p===x,activeStyle:`background:${o.btnBg};border-color:${o.primary};color:${o.primary}`,key:p,label:Ke[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(),q())}),r.append(h);const c=document.createElement("div");c.style.cssText="display:flex;gap:6px;";const u=he("Create",async()=>{const p=h.value.trim();if(!p){h.style.borderColor=o.danger;return}const b=Y();if(!b)return;const T=Bt(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:T.x,y:T.y};await b.createAnnotation(v),await X(),q(),K("Annotation created")});c.append(u),c.append(he("Cancel",()=>q())),r.append(c),r.append(At(o,()=>q())),pt(r,t.x+t.width/2,t.bottom,h)},"showMultiSelectForm"),bo=_(e=>{q(),N();const t=Je();document.getElementById(it)?.remove();const n=document.createElement("div");n.id=it,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=be,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 a="fix";i.append(Se(t,"Intent",["fix","change","question","approve"].map(u=>({active:u===a,activeStyle:`background:${U[u].bg};border-color:${U[u].border};color:${U[u].fg}`,key:u,label:Qe[u]})),u=>{a=u}));let s="important";i.append(Se(t,"Severity",["blocking","important","suggestion"].map(u=>({active:u===s,activeStyle:`background:${t.btnBg};border-color:${t.primary};color:${t.primary}`,key:u,label:Ke[u]})),u=>{s=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=_(()=>{q(),document.getElementById(it)?.remove()},"cleanup"),h=document.createElement("div");h.style.cssText="display:flex;gap:6px;justify-content:flex-end;",h.append(he("Cancel",x));const c=he("Add",async()=>{const u=d.value.trim();if(!u){d.style.borderColor=t.danger;return}const p=Y();if(p){c.textContent="Adding...",c.disabled=!0;try{const b=Bt(e.x+e.width/2,e.y+e.height/2),T={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:a,isMultiSelect:!0,severity:s,url:globalThis.location.href,x:b.x,y:b.y};await p.createAnnotation(T),await X(),x(),K("Annotation created")}catch{c.textContent="Error — retry",c.disabled=!1}}},"#22c55e");h.append(c),i.append(h),i.append(At(t,x)),pt(i,e.x+e.width/2,e.bottom,d)},"showAreaSelectionForm"),yo=_((e,t,n)=>{const o=window.innerWidth,i=window.innerHeight,r=8;let a;n+r+e.height<=i-r?a=n+r:n-r-e.height>=r?a=n-r-e.height:a=Math.max(r,i-e.height-r);let s;return t+e.width<=o-r?s=t:t-e.width>=r?s=t-e.width:s=Math.max(r,o-e.width-r),{left:s,top:a}},"computePopupPosition"),pt=_((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 a=e.getBoundingClientRect(),{left:s,top:d}=yo(a,t,n);e.style.top=`${d}px`,e.style.left=`${s}px`},"applyPosition");requestAnimationFrame(()=>{i(),o?.focus()});const r=new ResizeObserver(()=>{i()});r.observe(e),e.__resizeObserver=r},"positionFormNearAnchor"),Se=_((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 a=document.createElement("div");a.style.cssText="display:flex;gap:4px;";const s=[];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 s){const u=n.find(p=>p.key===c.dataset.key);c.dataset.key===d.key&&u?Object.assign(c.style,vo(u.activeStyle)):(c.style.background=e.btnBg,c.style.borderColor=e.btnBorder,c.style.color=e.muted)}}),s.push(x),a.append(x)}return i.append(a),i},"createToggleGroup"),vo=_(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 a=i.replaceAll(/-([a-z])/g,(s,d)=>d.toUpperCase());t[a]=r}}return t},"parseInlineStyle"),N=_(()=>{const e=document.querySelector(`#${Lt}`);e?.annotationId&&ut(e.annotationId,!1),e?.__cleanup?.(),e?.__resizeObserver?.disconnect(),e?.remove()},"removeAnnotationDetail"),ut=_((e,t)=>{const n=document.querySelector(`.${fe}[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")}},"setMarkerPopupOpen"),$e=_(e=>{N(),q(),ut(e.id,!0);const t=Je(),n=U[e.intent],o=t.bg==="#18181b",i=document.createElement("div");i.id=Lt,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:a}=Ne(e.x,e.y,e.isFixed??!1),s=document.createElement("div");s.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};`,s.append(d);const x=document.createElement("span");x.textContent=Ke[e.severity],x.style.cssText=`font-size:10px;font-weight:600;color:${e.severity==="blocking"?t.danger:t.muted};`,s.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};`,s.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(),N()}),s.append(c),i.append(s);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 T=document.createElement("summary");T.textContent=`${e.elementLabel??e.elementTag}${e.source?` • ${e.source.split("/").pop()}`:""}`,T.style.cssText=`cursor:pointer;font-size:10px;color:${t.muted};padding:4px 0;list-style:none;`,T.addEventListener("click",m=>m.stopPropagation()),b.append(T);const v=document.createElement("div");if(v.style.cssText="padding:6px 0;line-height:1.7;",se(v,"Element",`${e.elementTag}${e.cssClasses?` .${e.cssClasses}`:""}`),e.elementPath&&se(v,"Selector",e.elementPath),e.source&&se(v,"Source",e.source,t.primary),e.frameworkContext&&se(v,"Component",`${e.frameworkContext.componentName} (${e.frameworkContext.framework})`,t.success),e.nearbyText&&se(v,"Context",e.nearbyText),e.selectedText&&se(v,"Selected",`"${e.selectedText}"`),se(v,"URL",e.url),se(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 z=w.role==="human",f=document.createElement("div");f.style.cssText=["max-width:85%","padding:6px 10px",`border-radius:${z?"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:${z?"flex-end":"flex-start"}`,z?`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 M=document.createElement("div");M.style.cssText=`font-size:10px;color:${t.muted};margin-top:2px;opacity:0.6;text-align:${z?"right":"left"};`,M.textContent=new Date(w.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});const L=document.createElement("div");L.style.cssText=`display:flex;flex-direction:column;align-items:${z?"flex-end":"flex-start"};`,L.append(f,M),y.append(L)}requestAnimationFrame(()=>{y.scrollTop=y.scrollHeight}),u.append(y)}i.append(u);const D=document.createElement("div");D.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`}),D.append(k);const C=document.createElement("button");C.type="button",C.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 F=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");C.append(F.documentElement),C.disabled=!0,k.addEventListener("input",()=>{const m=k.value.trim().length>0;C.disabled=!m,C.style.opacity=m?"1":"0.3",C.style.cursor=m?"pointer":"not-allowed"}),C.addEventListener("click",async m=>{m.preventDefault(),m.stopPropagation();const y=k.value.trim();if(!y)return;await Y()?.updateAnnotation?.(e.id,{threadMessage:{content:y,role:"human",timestamp:new Date().toISOString()}}),K("Message sent"),await X();const w=J.find(z=>z.id===e.id);w&&$e(w)}),D.append(C),i.append(D);const R=document.createElement("div");if(R.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 Y()?.updateAnnotation?.(e.id,{status:"resolved"}),K("Annotation resolved"),await X(),N()}),R.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 z=document.createElement("div");z.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};`,z.append(f);const M=document.createElement("button");M.type="button",M.textContent="×",M.style.cssText=`background:none;border:none;color:${t.muted};cursor:pointer;font-size:16px;padding:0;line-height:1;margin-left:auto;`,M.addEventListener("click",I=>{I.preventDefault(),I.stopPropagation(),N(),$e(e)}),z.append(M),i.append(z);const L=document.createElement("div");L.style.cssText="flex:1;overflow-y:auto;padding:12px;";const Q=document.createElement("div");Q.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,Q.textContent="Intent",L.append(Q);let te=e.intent;const re=document.createElement("div");re.style.cssText="display:flex;gap:4px;margin-bottom:12px;";const ye=[];for(const I of["fix","change","question","approve"]){const O=U[I],V=document.createElement("button");V.type="button",V.textContent=Qe[I],V.dataset.intent=I,V.style.cssText=`padding:4px 10px;border:none;font-size:10px;font-weight:600;cursor:pointer;transition:all 0.15s;${I===te?`background:${O.bg};color:${O.fg};box-shadow:0 0 0 1px ${O.border};`:`background:${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)"};color:${t.muted};`}`,V.addEventListener("click",G=>{G.preventDefault(),G.stopPropagation(),te=I;for(const ie of ye){const mt=U[ie.dataset.intent];ie.dataset.intent===I?(ie.style.background=mt.bg,ie.style.color=mt.fg,ie.style.boxShadow=`0 0 0 1px ${mt.border}`):(ie.style.background=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",ie.style.color=t.muted,ie.style.boxShadow="none")}}),ye.push(V),re.append(V)}L.append(re);const Me=document.createElement("div");Me.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,Me.textContent="Severity",L.append(Me);let ze=e.severity;const Pe=document.createElement("div");Pe.style.cssText="display:flex;gap:4px;margin-bottom:12px;";const Ge=[];for(const I of["blocking","important","suggestion"]){const O=document.createElement("button");O.type="button",O.textContent=Ke[I],O.dataset.severity=I,O.style.cssText=`padding:4px 10px;border:none;font-size:10px;font-weight:600;cursor:pointer;transition:all 0.15s;${I===ze?`background:${t.primary};color:#18181b;`:`background:${o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)"};color:${t.muted};`}`,O.addEventListener("click",V=>{V.preventDefault(),V.stopPropagation(),ze=I;for(const G of Ge)G.dataset.severity===I?(G.style.background=t.primary,G.style.color="#18181b"):(G.style.background=o?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",G.style.color=t.muted)}),Ge.push(O),Pe.append(O)}L.append(Pe);const Re=document.createElement("div");Re.style.cssText=`font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:${t.muted};margin-bottom:6px;`,Re.textContent="Comment",L.append(Re);const j=document.createElement("textarea");j.value=e.comment,j.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;`,j.addEventListener("click",I=>I.stopPropagation()),j.addEventListener("keydown",I=>I.stopPropagation()),j.addEventListener("focus",()=>{j.style.borderColor=t.primary}),j.addEventListener("blur",()=>{j.style.borderColor=o?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"}),L.append(j),i.append(L);const Ie=document.createElement("div");Ie.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 De=document.createElement("button");De.type="button",De.textContent="Save",De.style.cssText=`padding:4px 10px;border:none;background:${t.primary};color:#18181b;font-size:10px;font-weight:600;cursor:pointer;`,De.addEventListener("click",async I=>{I.stopPropagation();const O=j.value.trim();if(!O){j.style.borderColor=t.danger;return}await Y()?.updateAnnotation?.(e.id,{comment:O,intent:te,severity:ze}),K("Annotation saved"),await X();const V=J.find(G=>G.id===e.id);V?(N(),$e(V)):N()}),Ie.append(De);const Fe=document.createElement("button");Fe.type="button",Fe.textContent="Cancel",Fe.style.cssText=`padding:4px 10px;border:1px solid ${t.btnBorder};background:transparent;color:${t.fg};font-size:10px;font-weight:500;cursor:pointer;`,Fe.addEventListener("click",I=>{I.stopPropagation(),N(),$e(e)}),Ie.append(Fe);const Oe=document.createElement("button");Oe.type="button",Oe.textContent="Delete",Oe.style.cssText=`padding:4px 10px;border:none;background:transparent;color:${t.danger};font-size:10px;cursor:pointer;margin-left:auto;`,Oe.addEventListener("click",async I=>{I.stopPropagation(),await Y()?.deleteAnnotation?.(e.id),J=J.filter(O=>O.id!==e.id),K("Annotation deleted"),N(),lt()}),Ie.append(Oe),i.append(Ie),setTimeout(()=>j.focus(),50)}),R.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 Y()?.updateAnnotation?.(e.id,{status:"dismissed"}),K("Annotation dismissed"),await X(),N()}),$.append(m)}const B=document.createElement("button");B.type="button",B.textContent="Copy",B.style.cssText=`padding:4px 8px;border:none;background:transparent;color:${t.muted};font-size:10px;cursor:pointer;`,B.addEventListener("click",async m=>{m.stopPropagation();try{await navigator.clipboard.writeText(Ct([e])),K("Copied to clipboard")}catch{K("Copy failed","error")}}),$.append(B);const A=document.createElement("button");A.type="button",A.textContent="Delete",A.style.cssText=`padding:4px 8px;border:none;background:transparent;color:${t.danger};font-size:10px;cursor:pointer;`,A.addEventListener("click",async m=>{m.stopPropagation(),await Y()?.deleteAnnotation?.(e.id),J=J.filter(y=>y.id!==e.id),K("Annotation deleted"),N(),lt()}),$.append(A),R.append($),i.append(R),pt(i,r+16,a);const l=_(m=>{!i.contains(m.target)&&!m.target?.classList.contains(fe)&&N()},"outsideHandler"),g=setTimeout(()=>{document.addEventListener("click",l,!0)},100);i.__cleanup=()=>{clearTimeout(g),document.removeEventListener("click",l,!0)}},"showAnnotationDetail");let Ce;const wo=_(()=>{Ce||(Ce=_(e=>{if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.key==="C"){e.preventDefault();const t=Ct(J);navigator.clipboard.writeText(t).catch(()=>{})}},"markdownShortcutHandler"),document.addEventListener("keydown",Ce))},"attachMarkdownShortcut"),$n=_(()=>{Ce&&(document.removeEventListener("keydown",Ce),Ce=void 0)},"detachMarkdownShortcut"),Nt=_(e=>{if(!e)return!1;for(const t of[be,Lt]){const n=document.querySelector(`#${t}`);if(n&&(e===n||n.contains(e)))return!0}return!!e.closest?.(`.${fe}`)},"isOverAnnotationOverlay");var $o=Object.defineProperty,kn=ae((e,t)=>$o(e,"name",{value:t,configurable:!0}),"o");const ko=kn(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"]),a=e.tagName.toLowerCase(),s=r.has(a)&&!e.hasAttribute("disabled"),d=e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false",x=s||d||i!==null&&i>=0;return{ariaAttributes:t,focusable:x,role:n,tabindex:i}},"captureA11yInfo"),Eo=kn(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
+ `)},"formatA11yText");var _o=Object.defineProperty,H=ae((e,t)=>_o(e,"name",{value:t,configurable:!0}),"u");const Mt="__vdt_ruler_corner",zt="__vdt_ruler_h",Pt="__vdt_ruler_v",Rt="__vdt_guideline",En='9px "JetBrains Mono","Geist Mono",ui-monospace,monospace';let Le=!1,ke=null,Z=null,ee=null,dt=new Set,Ve=null,Ye=null,Xe=null;const _n=H(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,a=10,s=r/a;return{major:r,minor:s,stepsPerMajor:a}},"computeTickIntervals"),Tn=H((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:a}=globalThis,{minor:s,stepsPerMajor:d}=_n(1);r.fillStyle=t.muted,r.strokeStyle=t.muted,r.lineWidth=1,r.font=En,r.textAlign="center",r.textBaseline="top";const x=Math.floor(a/s),h=Math.ceil((a+o)/s);for(let c=x;c<=h;c++){const u=c*s,p=u-a;if(p<0||p>o)continue;const b=c%d===0,T=c%(d/2)===0;let v;b?v=10:T?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)}},"drawHorizontalRuler"),Cn=H((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:a}=globalThis,{minor:s,stepsPerMajor:d}=_n(1);r.fillStyle=t.muted,r.strokeStyle=t.muted,r.lineWidth=1,r.font=En;const x=Math.floor(a/s),h=Math.ceil((a+i)/s);for(let c=x;c<=h;c++){const u=c*s,p=u-a;if(p<0||p>i)continue;const b=c%d===0,T=c%(d/2)===0;let v;b?v=10:T?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())}},"drawVerticalRuler"),qt=H(()=>{Xe&&(Z&&Tn(Z,Xe),ee&&Cn(ee,Xe))},"redraw"),To=H(e=>{const t=[],n=document.querySelectorAll("body *"),o=2e3;let i=0;for(const r of n){if(i>=o)break;if(r.id===Mt||r.id===zt||r.id===Pt||r.classList.contains(Rt))continue;const a=r.getBoundingClientRect();a.width===0&&a.height===0||(e==="horizontal"?t.push(a.top,a.bottom):t.push(a.left,a.right),i++)}return t},"collectSnapEdges"),Co=H((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},"findSnapEdge"),et=9,Ht=H((e,t,n)=>{const o=document.createElement("div");o.className=Rt;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 a=document.createElement("div");a.style.cssText=["position:absolute","pointer-events:auto",i?`left:0;right:0;height:${et*2+1}px;top:${-et}px`:`top:0;bottom:0;width:${et*2+1}px;left:${-et}px`,"background:transparent",i?"cursor:row-resize":"cursor:col-resize"].join(";"),o.append(a);const s=document.createElement("div");s.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(s),document.body.append(o),dt.add(o);let d=t;const x=H(c=>{d=c,i?o.style.top=`${d}px`:o.style.left=`${d}px`;const u=i?d+window.scrollY:d+window.scrollX;s.textContent=`${Math.round(u)}px`},"updatePosition"),h=H(()=>{let c=performance.now(),u=d,p=!1,b=null;s.style.display="";const T=H(D=>{const k=performance.now(),C=i?D.clientY:D.clientX,F=Math.abs(C-u)/Math.max(1,k-c);if(c=k,u=C,b===null&&(b=To(e)),F<3){const R=Co(C,b);if(R!==null){x(R),p||(p=!0,r.style.background="#0D99FF",s.style.background="#0D99FF");return}}p&&(p=!1,r.style.background=n.primary,s.style.background=n.primary),x(C)},"onPointerMove"),v=H(()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",v),s.style.display="none",r.style.background=n.primary,s.style.background=n.primary,(i&&d<20||!i&&d<20)&&(o.remove(),dt.delete(o))},"onPointerUp");document.addEventListener("pointermove",T),document.addEventListener("pointerup",v)},"startDrag");a.addEventListener("pointerdown",c=>{c.preventDefault(),c.stopPropagation(),h()}),x(d),h()},"spawnGuideline"),So=H(e=>{Le||(Xe=e,ke=document.createElement("div"),ke.id=Mt,ke.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(ke),Z=document.createElement("canvas"),Z.id=zt,Z.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(";"),Z.addEventListener("pointerdown",t=>{t.preventDefault(),Ht("horizontal",t.clientY,e)}),document.body.append(Z),ee=document.createElement("canvas"),ee.id=Pt,ee.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(";"),ee.addEventListener("pointerdown",t=>{t.preventDefault(),Ht("vertical",t.clientX,e)}),document.body.append(ee),Tn(Z,e),Cn(ee,e),Ve=qt,window.addEventListener("resize",Ve),Ye=qt,window.addEventListener("scroll",Ye,{passive:!0}),Le=!0)},"createRulers"),Sn=H(()=>{if(Le){ke?.remove(),Z?.remove(),ee?.remove();for(const e of dt)e.remove();dt.clear(),Ve&&(window.removeEventListener("resize",Ve),Ve=null),Ye&&(window.removeEventListener("scroll",Ye),Ye=null),ke=null,Z=null,ee=null,Xe=null,Le=!1}},"removeRulers"),Vt=H(()=>Le,"areRulersVisible"),yt=H(e=>{if(!Le)return!1;const{id:t}=e;return t===Mt||t===zt||t===Pt?!0:e.classList.contains(Rt)},"isRulerElement");var Lo=Object.defineProperty,S=ae((e,t)=>Lo(e,"name",{value:t,configurable:!0}),"l");const Ae=to,Ao=yn,me="__vdt_inspector_overlay",Bo=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"]),Ln="__vdt_inspector_label",kt="__vdt_inspector_cursor",W="__vdt_inspector_badge",Yt="__vdt_inspector_kf",Be="__vdt_inspector_result",tt=S(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},"isInsideDevToolbar"),Mo=S(()=>{let e=document.querySelector(`#${me}`);if(!e){const t=Ae();e=document.createElement("div"),e.id=me,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=Ln,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},"getOrCreateOverlay"),Et=S(e=>{let t=e;for(;t;){const n=t.dataset.vdtSource;if(n)return n;t=t.parentElement??void 0}},"findSource"),zo=S(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}`},"formatSourceShort"),nt=S(e=>{const t=document.querySelector(`#${me}`);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(`#${Ln}`);if(o){const i=e.tagName.toLowerCase(),r=e.id?`#${e.id}`:"",a=e.classList.length>0?`.${[...e.classList].slice(0,3).join(".")}`:"",s=`${i}${r}${a}`,d=Et(e);o.textContent=d?`${s} · ${zo(d)}`:s,n.top<28?(o.style.bottom="auto",o.style.top="calc(100% + 2px)"):(o.style.top="",o.style.bottom="calc(100% + 2px)")}},"updateOverlayPosition"),ve=S(()=>{const e=document.querySelector(`#${me}`);e&&(e.style.display="none")},"hideOverlay"),Po=S(()=>{document.querySelector(`#${me}`)?.remove(),document.querySelector(`#${kt}`)?.remove()},"removeOverlay"),Xt=S(e=>{let t=document.querySelector(`#${kt}`);e?(t||(t=document.createElement("style"),t.id=kt,document.head.append(t)),t.textContent=["*, *::before, *::after { cursor: crosshair !important; }",`#${W}, #${W} * { cursor: pointer !important; }`,`#${Be}, #${Be} * { 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()},"setCrosshairCursor");let Ue="inspect";const An=S(()=>{document.querySelector(`#${W}`)?.remove()},"removeFloatingBadge"),It=S(e=>new DOMParser().parseFromString(e,"image/svg+xml").documentElement,"parseSvg"),Ut='<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>',Qt='<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>',Kt='<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>',Ro='<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>',Io='<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>',Do='<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>',Fo='<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>',Oo='<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>',jo='<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>',No='<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 oe=!0;const we=S((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 a=document.createElement("div");return a.style.cssText="width:24px;height:24px;display:flex;align-items:center;justify-content:center;user-select:none;",a.append(It(t)),r.append(a),r.addEventListener("pointerover",()=>{r.style.background=`${e.primary}14`,r.style.color=e.primary}),r.addEventListener("pointerout",()=>{const s=r.dataset.active==="1";r.style.background=s?`${e.primary}1f`:"transparent",r.style.color=s?e.primary:e.muted}),r.addEventListener("pointerdown",()=>{r.style.transform="scale(0.94)"}),r.addEventListener("pointerup",()=>{r.style.transform=""}),r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),o()}),r},"makeToolbarButton"),Wt=S((e,t)=>{const n=e.querySelector("svg");n&&n.replaceWith(It(t))},"setButtonIcon"),vt=S((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)},"showToast"),qo=S(e=>{if(!document.querySelector(`#${Yt}`)){const $=document.createElement("style");$.id=Yt,$.textContent="@keyframes __vdt_pulse{0%,100%{opacity:1}50%{opacity:.3}}",document.head.append($)}An(),oe=!0;const t=Ae(),n=document.createElement("div"),o=t===Ao,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=W,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,a=0;const s=S($=>{n.style.left=`${$.clientX-r}px`,n.style.top=`${$.clientY-a}px`,n.style.transform="none",n.style.bottom="auto",n.style.cursor="grabbing"},"onDragMove"),d=S(()=>{document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",d),n.style.cursor=""},"onDragEnd");n.addEventListener("pointerdown",$=>{if($.target.closest("button"))return;const B=n.getBoundingClientRect();r=$.clientX-B.left,a=$.clientY-B.top,document.addEventListener("pointermove",s),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 B=document.createElement("div");B.style.cssText="display:flex;gap:2px;";for(let A=0;A<2;A++){const l=document.createElement("div");l.style.cssText=`width:2px;height:2px;border-radius:50%;background:${t.muted};`,B.append(l)}x.append(B)}n.append(x),Ue="inspect";const h=S(($,B,A)=>{const l=document.createElement("button");l.type="button",l.title=B;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(It($)),l.append(g);const m=S(()=>{const y=Ue===A;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(";")},"applyState");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(),Ue=A,m();for(const w of n.querySelectorAll("[data-mode]"))w!==l&&w.dispatchEvent(new Event("pointerout"))}),l.dataset.mode=A,l},"createModeButton"),c=h(Oo,"Inspect mode — click to view source & info","inspect");n.append(c);const u=h(jo,"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=Qn(),T=we(t,b?Qt:Ut,b?"Resume animations (P)":"Pause animations (P)",()=>{const $=Wn();Wt(T,$?Qt:Ut),T.title=$?"Resume animations (P)":"Pause animations (P)",T.dataset.active=$?"1":"",T.style.color=$?t.primary:t.muted,T.style.background=$?`${t.primary}22`:"transparent"},b);n.append(T);const v=we(t,Kt,"Toggle markers (H)",()=>{oe=!oe;for(const $ of document.querySelectorAll(".__vdt_annotation_marker"))$.style.visibility=oe?"visible":"hidden";Wt(v,oe?Kt:Ro),v.title=oe?"Hide markers (H)":"Show markers (H)",v.dataset.active=oe?"":"1",v.style.color=oe?t.muted:t.primary,v.style.background=oe?"transparent":`${t.primary}22`});n.append(v);const D=we(t,Io,"Copy annotations (C)",async()=>{const $=globalThis.__VISULIMA_DEVTOOLS__?.rpc;if($?.getAnnotations)try{const B=await $.getAnnotations(),{annotationsToMarkdown:A}=await Promise.resolve().then(()=>Vn),l=A(B,_t().outputDetail);await navigator.clipboard.writeText(l),vt("Copied to clipboard")}catch{vt("Copy failed","error")}});n.append(D);const k=Vt(),C=we(t,No,"Toggle rulers (R)",()=>{Vt()?(Sn(),C.dataset.active="",C.style.color=t.muted,C.style.background="transparent"):(So(t),C.dataset.active="1",C.style.color=t.primary,C.style.background=`${t.primary}22`)},k);n.append(C);const F="__vdt_clear_confirm";n.append(we(t,Do,"Clear all annotations (X)",()=>{document.getElementById(F)?.remove();const $=n.getBoundingClientRect(),B=document.createElement("div");B.id=F,B.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(";"),B.addEventListener("click",m=>m.stopPropagation()),B.addEventListener("mousedown",m=>m.stopPropagation());const A=document.createElement("span");A.textContent="Clear all annotations?",A.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(),B.remove();const y=globalThis.__VISULIMA_DEVTOOLS__?.rpc;if(!y?.getAnnotations||!y?.deleteAnnotation)return;const w=await y.getAnnotations();await Promise.all(w.map(z=>y.deleteAnnotation(z.id))),await X(),vt(`${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(),B.remove()}),B.append(A,l,g),document.body.append(B),setTimeout(()=>B.remove(),5e3)}));const R=document.createElement("span");R.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(R),n.append(we(t,Fo,"Close inspector (Esc)",()=>{e()})),document.body.append(n)},"createFloatingBadge"),Ho=S((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,s,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=a;const c=document.createElement("span");c.style.cssText=`color:${d?t.primary:t.fg};word-break:break-all;`,c.textContent=s,x.append(h,c),n.append(x)},"addRow");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 a of r)i(a,e.ariaAttributes[a]);if(!e.role&&r.length===0&&e.tabindex===null){const a=document.createElement("div");a.style.cssText=`color:${t.muted};font-style:italic;`,a.textContent="No ARIA attributes",n.append(a)}return n},"renderA11ySection");let Ee;const Vo=S(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,Mn()).catch(()=>{})},"openInEditor"),le=S(()=>{Ee?.(),Ee=void 0,document.querySelector(`#${Be}`)?.remove()},"removeResultPopup"),ot=S((e,t)=>{const n=Ae(),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},"makeActionButton"),Jt=S((e,t,n,o,i)=>{Ee?.(),Ee=void 0,le();const r=Ae(),a=document.createElement("div");a.id=Be,a.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 s=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}`,a.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,a.append(k)}const p=ko(e);a.append(Ho(p,r));const b=document.createElement("div");b.style.cssText="display:flex;gap:6px;flex-wrap:wrap;",n&&b.append(ot("Open in editor",()=>{Vo(n),le()})),b.append(ot("Copy HTML",()=>{navigator.clipboard.writeText(e.outerHTML).catch(()=>{}),le()})),n&&b.append(ot("Copy path",()=>{navigator.clipboard.writeText(n).catch(()=>{}),le()})),b.append(ot("Copy A11y",()=>{navigator.clipboard.writeText(Eo(p)).catch(()=>{}),le()})),a.append(b);const T=document.createElement("button");T.textContent="×",T.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(";"),T.addEventListener("pointerover",()=>{T.style.color=r.fg}),T.addEventListener("pointerout",()=>{T.style.color=r.muted}),T.addEventListener("click",k=>{k.stopPropagation(),le()}),a.append(T),a.style.top="-9999px",a.style.left="-9999px",document.body.append(a),xn(()=>{if(!document.contains(a))return;const k=a.getBoundingClientRect(),C=window.innerWidth,F=window.innerHeight,R=8;let $;d+R+k.height<=F-R?$=d+R:d-t.height-R-k.height>=R?$=d-t.height-R-k.height:$=Math.max(R,F-k.height-R);let B;B=s+k.width<=C-R?s:Math.max(R,C-k.width-R),a.style.top=`${$}px`,a.style.left=`${B}px`},0);const v=S(k=>{a.contains(k.target)||(le(),document.removeEventListener("click",v,!0),Ee=void 0)},"handleOutside"),D=setTimeout(()=>{document.addEventListener("click",v,!0)},100);Ee=S(()=>{clearTimeout(D),document.removeEventListener("click",v,!0)},"removePopupOutsideHandler")},"showResultPopup");let at;const Yo=S(e=>{at?.(),Mo(),Xt(!0),X().catch(()=>{}),wo();const t=S(()=>document.querySelector(`#${W}`)??void 0,"badgeElement"),n=S(l=>{if(!l)return!1;const g=t();return!!(g&&(l===g||g.contains(l)))},"isOverBadge"),o=S(l=>{if(!l)return!1;const g=document.querySelector(`#${Be}`);return!!(g&&(l===g||g.contains(l)))},"isOverResultPopup"),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")){C.cleanup(),e();return}});i.observe(document.body,{childList:!0});const r="__vdt_multi_select_outline";let a=[];const s={cmd:!1,shift:!1},d=S(()=>{for(const g of document.querySelectorAll(`.${r}`))g.remove();const l=a.length>1;for(const g of a){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 ${Ae().overlayBorder};background:${Ae().overlayBg};`,"transition:all 0.1s;"].join(""),document.body.append(y)}},"renderMultiSelectOutlines"),x=S(()=>{for(const l of document.querySelectorAll(`.${r}`))l.remove()},"removeMultiSelectOutlines"),h=S(()=>{if(a.length!==0)if(ve(),a.length===1){const l=a[0],g=l.element.getBoundingClientRect(),m=Et(l.element);x(),a=[],Ue==="annotate"?ct(l.element,g,m,void 0,{x:g.left+g.width/2,y:g.top+g.height/2}):Jt(l.element,g,m)}else{const l=a.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(),a=[],jt(l,y,m)}},"commitMultiSelect"),c={hasMoved:!1,x:0,y:0},u=S(l=>{if((l.key==="Meta"||l.key==="Control")&&(s.cmd=!0,c.hasMoved&&!Ze())){const g=rt(c.x,c.y);if(g&&!tt(g)){nt(g);const m=document.querySelector(`#${me}`);m&&(m.style.borderStyle="dashed")}}l.key==="Shift"&&(s.shift=!0)},"handleModifierKeyDown"),p=S(l=>{const g=s.cmd&&s.shift;if((l.key==="Meta"||l.key==="Control")&&(s.cmd=!1,c.hasMoved&&!Ze())){const y=_e(c.x,c.y);if(y&&!tt(y)){nt(y);const w=document.querySelector(`#${me}`);w&&(w.style.borderStyle="solid")}}l.key==="Shift"&&(s.shift=!1);const m=s.cmd&&s.shift;g&&!m&&a.length>0&&h()},"handleModifierKeyUp"),b=S(()=>{s.cmd=!1,s.shift=!1,a.length>0&&(x(),a=[])},"handleModifierBlur");document.addEventListener("keydown",u),document.addEventListener("keyup",p),window.addEventListener("blur",b);const T="__vdt_drag_rect";let v,D=!1;const k=S(()=>{document.querySelector(`#${T}`)?.remove(),v=void 0,D=!1},"removeDragRect"),C={cleanup(){document.removeEventListener("mousemove",C.handleMouseMove),document.removeEventListener("mousedown",C.handleMouseDown),document.removeEventListener("mouseup",C.handleMouseUp,!0),document.removeEventListener("click",C.handleClick,!0),document.removeEventListener("keydown",C.handleKeyDown),i.disconnect(),ve(),Po(),k(),x(),a=[],document.removeEventListener("__vdt_annotation_form_closed",A),document.removeEventListener("keydown",u),document.removeEventListener("keyup",p),window.removeEventListener("blur",b),Xt(!1),Sn(),An(),at=void 0},handleClick(l){const g=((l.metaKey||l.ctrlKey)&&!l.shiftKey?rt(l.clientX,l.clientY):_e(l.clientX,l.clientY))??l.target;if(!g||tt(g)||n(g)||o(g)||Nt(g)||yt(g))return;if((l.metaKey||l.ctrlKey)&&l.shiftKey){l.preventDefault(),l.stopPropagation();const w=a.findIndex(z=>z.element===g);w===-1?a.push({element:g,name:Tt(g),rect:g.getBoundingClientRect()}):a.splice(w,1),d();return}if(l.preventDefault(),l.stopPropagation(),Ze()){fo();return}if(!_t().blockInteractions&&g.closest?.("button, a, input, select, textarea, [role='button'], [onclick]"))return;wn();const m=g.getBoundingClientRect(),y=Et(g);Ue==="annotate"?(nt(g),ct(g,m,y,void 0,{x:l.clientX,y:l.clientY})):(ve(),Jt(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(a.length>0){x(),a=[];return}C.cleanup(),e();return}const m=l.key.toLowerCase();if(m==="p"){l.preventDefault(),document.querySelector(`#${W} button[title*="animations"]`)?.click();return}if(m==="h"){l.preventDefault(),document.querySelector(`#${W} button[title*="markers"]`)?.click();return}if(m==="c"&&!l.ctrlKey&&!l.metaKey){l.preventDefault(),document.querySelector(`#${W} button[title*="Copy"]`)?.click();return}if(m==="r"){l.preventDefault(),document.querySelector(`#${W} button[title*="rulers"]`)?.click();return}m==="x"&&(l.preventDefault(),document.querySelector(`#${W} button[title*="Clear"]`)?.click())},handleMouseDown(l){const g=l.composedPath()[0]||l.target;g.closest?.(`#${W}`)||g.closest?.(`#${Be}`)||g.classList?.contains("__vdt_annotation_marker")||yt(g)||g.closest?.("#__vdt_annotation_form")||g.closest?.("#__vdt_annotation_detail")||Bo.has(g.tagName)||g.isContentEditable||(v={x:l.clientX,y:l.clientY},D=!1)},handleMouseMove(l){if(Ze())return;if(v){const w=l.clientX-v.x,z=l.clientY-v.y,f=w*w+z*z,M=8;if(!D&&f<M*M)return;D=!0;let L=document.querySelector(`#${T}`);L||(L=document.createElement("div"),L.id=T,L.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(L));const Q=Math.min(v.x,l.clientX),te=Math.min(v.y,l.clientY),re=Math.abs(l.clientX-v.x),ye=Math.abs(l.clientY-v.y);L.style.left=`${Q}px`,L.style.top=`${te}px`,L.style.width=`${re}px`,L.style.height=`${ye}px`;return}c.x=l.clientX,c.y=l.clientY,c.hasMoved=!0;const g=(l.metaKey||l.ctrlKey)&&!l.shiftKey,m=(g?rt(l.clientX,l.clientY):_e(l.clientX,l.clientY))??l.target;if(!m||tt(m)||n(m)||o(m)||Nt(m)||yt(m)){ve();return}nt(m);const y=document.querySelector(`#${me}`);y&&(y.style.borderStyle=g?"dashed":"solid")},handleMouseUp(l){if(!v||!D){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 z=new DOMRect(g,m,y,w),f=mn(z);if(ve(),f.length===0)bo(z);else{const M=gn(f);jt(f,z,M)}}},{cleanup:F,handleClick:R,handleKeyDown:$,handleMouseMove:B}=C;qo(()=>{F(),e()});const A=S(()=>{ve()},"onFormClosed");document.addEventListener("__vdt_annotation_form_closed",A),document.addEventListener("mousemove",B),document.addEventListener("mousedown",C.handleMouseDown),document.addEventListener("mouseup",C.handleMouseUp,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",$),at=F},"startGlobalInspection"),Xo=S(()=>{at?.(),le(),vn(),$n();const e=globalThis.__VISULIMA_DEVTOOLS__;e?.getActiveApp?.()==="dev-toolbar:annotations"&&e.setAppActive?.("dev-toolbar:annotations",!1)},"stopGlobalInspection"),Wo={icon:zn,id:"dev-toolbar:inspector",name:"Inspector",onClick(){const e=globalThis.__VISULIMA_DEVTOOLS__;Yo(async()=>{try{if(vn(),$n(),e?.getActiveApp?.()==="dev-toolbar:annotations")try{await e.closeApp?.()}catch{}}finally{e?.setAppActive&&e.setAppActive("dev-toolbar:inspector",!1)}})},onDeactivate(){Xo()}};export{Wo as default};
@@ -1,4 +1,4 @@
1
- var G=Object.defineProperty;var P=(r,e)=>G(r,"name",{value:e,configurable:!0});import{addHookName as b}from"preact/devtools";import{clsx as y}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as v,useRef as H,useEffect as W}from"preact/hooks";import{jsxs as n,jsx as t,Fragment as E}from"preact/jsx-runtime";import B from"../../packem_shared/Button-Bkx66Co7.js";import K from"../../packem_shared/Badge-BEgU04nl.js";const Q=`<!-- @license lucide-static v1.16.0 - ISC -->
1
+ var G=Object.defineProperty;var P=(r,e)=>G(r,"name",{value:e,configurable:!0});import{addHookName as b}from"preact/devtools";import{clsx as y}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as v,useRef as W,useEffect as H}from"preact/hooks";import{jsxs as n,jsx as t,Fragment as E}from"preact/jsx-runtime";import B from"../../packem_shared/Button-Bkx66Co7.js";import K from"../../packem_shared/Badge-BEgU04nl.js";const Q=`<!-- @license lucide-static v1.16.0 - ISC -->
2
2
  <svg
3
3
  class="lucide lucide-search"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -14,4 +14,4 @@ var G=Object.defineProperty;var P=(r,e)=>G(r,"name",{value:e,configurable:!0});i
14
14
  <path d="m21 21-4.34-4.34" />
15
15
  <circle cx="11" cy="11" r="8" />
16
16
  </svg>
17
- `;var Z=Object.defineProperty,a=P((r,e)=>Z(r,"name",{value:e,configurable:!0}),"a");const ee=a(()=>{const r=a(o=>document.querySelector(`meta[name="${o}"]`)?.content??"","getMeta"),e=a(o=>document.querySelector(`meta[property="og:${o}"]`)?.content??"","getOg"),s=a(o=>document.querySelector(`meta[name="twitter:${o}"]`)?.content??document.querySelector(`meta[property="twitter:${o}"]`)?.content??"","getTwitter"),i=a(o=>document.querySelector(`meta[property="article:${o}"]`)?.content??"","getArticle");return{articleAuthor:i("author"),articleModifiedTime:i("modified_time"),articlePublishedTime:i("published_time"),articleSection:i("section"),canonical:document.querySelector('link[rel="canonical"]')?.href??"",description:r("description"),ogDescription:e("description"),ogImage:e("image"),ogImageAlt:e("image:alt"),ogLocale:e("locale"),ogSiteName:e("site_name"),ogTitle:e("title"),ogType:e("type"),ogUrl:e("url"),title:document.title??"",twitterCard:s("card"),twitterCreator:s("creator"),twitterDescription:s("description"),twitterImage:s("image"),twitterImageAlt:s("image:alt"),twitterSite:s("site"),twitterTitle:s("title")}},"readMetaTags"),re=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2})?(?:[+-]\d{2}:\d{2}|Z)?)?$/,A=a(r=>typeof r=="string"&&re.test(r),"isISO8601"),l=a((r,e)=>r[e]!==void 0&&r[e]!==null&&r[e]!=="","has"),j=a(r=>Array.isArray(r)&&r.length>0,"isNonEmptyArray"),C=a(r=>{const e=[];if(!l(r,"headline")&&!l(r,"name")&&e.push({message:"headline (or name) is required",property:"headline",severity:"error"}),l(r,"author")){const s=r.author;typeof s=="object"&&!Array.isArray(s)&&!l(s,"name")&&e.push({message:"author.name is missing",property:"author.name",severity:"warning"})}else e.push({message:"author is required",property:"author",severity:"error"});return l(r,"datePublished")?A(r.datePublished)||e.push({message:"datePublished should be ISO 8601 format (e.g. 2024-01-15T09:00:00Z)",property:"datePublished",severity:"warning"}):e.push({message:"datePublished is required",property:"datePublished",severity:"error"}),l(r,"image")||e.push({message:"image is recommended for rich results",property:"image",severity:"warning"}),l(r,"description")||e.push({message:"description is recommended",property:"description",severity:"suggestion"}),e},"validateArticle"),te=a(r=>{const e=[];l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"});const s=l(r,"offers"),i=l(r,"aggregateRating"),o=l(r,"review");if(!s&&!i&&!o&&e.push({message:"At least one of: offers, aggregateRating, or review is required for rich results",property:"offers",severity:"error"}),s){const c=Array.isArray(r.offers)?r.offers[0]:r.offers;c&&typeof c=="object"&&(!l(c,"price")&&!l(c,"priceSpecification")&&e.push({message:"offers.price is required",property:"offers.price",severity:"error"}),l(c,"priceCurrency")||e.push({message:"offers.priceCurrency is required (e.g. 'USD')",property:"offers.priceCurrency",severity:"error"}))}if(i){const c=r.aggregateRating;l(c,"ratingValue")||e.push({message:"aggregateRating.ratingValue is required",property:"aggregateRating.ratingValue",severity:"error"}),!l(c,"reviewCount")&&!l(c,"ratingCount")&&e.push({message:"aggregateRating.reviewCount (or ratingCount) is required",property:"aggregateRating.reviewCount",severity:"error"})}return l(r,"image")||e.push({message:"image is recommended for rich results",property:"image",severity:"suggestion"}),e},"validateProduct"),ie=a(r=>{const e=[],s=r.itemListElement;return j(s)?(s.length<2&&e.push({message:"itemListElement should have at least 2 items",property:"itemListElement",severity:"warning"}),s.forEach((i,o)=>{i.position!==o+1&&e.push({message:`itemListElement[${o}].position should be ${o+1}`,property:`itemListElement[${o}].position`,severity:"warning"}),i.name||i.item?.name||e.push({message:`itemListElement[${o}].name is required`,property:`itemListElement[${o}].name`,severity:"error"})}),e):(e.push({message:"itemListElement array is required",property:"itemListElement",severity:"error"}),e)},"validateBreadcrumbList"),se=a(r=>{const e=[],s=r.mainEntity;return j(s)?(s.forEach((i,o)=>{l(i,"name")||e.push({message:`mainEntity[${o}].name (question text) is required`,property:`mainEntity[${o}].name`,severity:"error"});const c=i.acceptedAnswer;(!c||!l(c,"text"))&&e.push({message:`mainEntity[${o}].acceptedAnswer.text is required`,property:`mainEntity[${o}].acceptedAnswer.text`,severity:"error"})}),e):(e.push({message:"mainEntity array with at least one Question is required",property:"mainEntity",severity:"error"}),e)},"validateFaqPage"),N=a(r=>{const e=[];l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"startDate")?A(r.startDate)||e.push({message:"startDate should be ISO 8601 format",property:"startDate",severity:"warning"}):e.push({message:"startDate is required",property:"startDate",severity:"error"});const s=r.location;return s?l(s,"name")||e.push({message:"location.name is required",property:"location.name",severity:"error"}):e.push({message:"location is required",property:"location",severity:"error"}),l(r,"description")||e.push({message:"description is recommended",property:"description",severity:"suggestion"}),e},"validateEvent"),L=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"url")||e.push({message:"url is recommended",property:"url",severity:"warning"}),l(r,"logo")||e.push({message:"logo is recommended for Knowledge Panel eligibility",property:"logo",severity:"suggestion"}),e},"validateOrganization"),oe=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"url")||e.push({message:"url is recommended",property:"url",severity:"suggestion"}),e},"validatePerson"),ne=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"image")||e.push({message:"image is required for rich results",property:"image",severity:"error"}),!l(r,"recipeIngredient")&&!l(r,"ingredients")&&e.push({message:"recipeIngredient is recommended",property:"recipeIngredient",severity:"suggestion"}),l(r,"recipeInstructions")||e.push({message:"recipeInstructions is recommended",property:"recipeInstructions",severity:"suggestion"}),l(r,"author")||e.push({message:"author is recommended",property:"author",severity:"suggestion"}),e},"validateRecipe"),$=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"url")||e.push({message:"url is recommended",property:"url",severity:"warning"}),e},"validateWebSiteOrPage"),ae=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"description")||e.push({message:"description is required",property:"description",severity:"error"}),l(r,"thumbnailUrl")||e.push({message:"thumbnailUrl is required for rich results",property:"thumbnailUrl",severity:"error"}),l(r,"uploadDate")?A(r.uploadDate)||e.push({message:"uploadDate should be ISO 8601 format",property:"uploadDate",severity:"warning"}):e.push({message:"uploadDate is required",property:"uploadDate",severity:"error"}),e},"validateVideoObject"),X={Article:C,BlogPosting:C,BreadcrumbList:ie,Event:N,EventSeries:N,FAQPage:se,LocalBusiness:L,NewsArticle:C,Organization:L,Person:oe,Product:te,Recipe:ne,VideoObject:ae,WebPage:$,WebSite:$},le=new Set(Object.keys(X)),ce=a(r=>{const e=[],s=String(r["@context"]??""),i=String(r["@type"]??"");if(s?s.includes("schema.org")||e.push({message:"@context should reference schema.org",property:"@context",severity:"warning"}):e.push({message:"@context is missing — should be 'https://schema.org'",property:"@context",severity:"error"}),!i)return e.push({message:"@type is required",property:"@type",severity:"error"}),e;le.has(i)||e.push({message:`@type '${i}' is not validated — no known rules for this type`,property:"@type",severity:"suggestion"});const o=X[i];return o&&e.push(...o(r)),e},"validateJsonLd"),de=a(r=>r.some(e=>e.severity==="error")?"error":r.some(e=>e.severity==="warning")?"warning":r.some(e=>e.severity==="suggestion")?"suggestion":"ok","deriveStatus"),M=a((r,e,s,i)=>{const o=ce(r),c=String(r["@type"]??"Unknown");return{context:String(r["@context"]??""),graphIndex:s,index:e,messages:o,parsed:r,raw:i??JSON.stringify(r,void 0,2),status:de(o),type:c}},"processJsonLdNode"),pe=/^\/\/<!\[CDATA\[/,me=/\/\/\]\]>$/,ge=/^<!\[CDATA\[/,ue=/\]\]>$/,he=a(()=>{const r=document.querySelectorAll('script[type="application/ld+json"]'),e=[];return r.forEach((s,i)=>{let o=(s.textContent??"").trim();o=o.replace(pe,"").replace(me,""),o=o.replace(ge,"").replace(ue,"");try{const c=JSON.parse(o);if(j(c["@graph"])){const g=String(c["@context"]??"");c["@graph"].forEach((p,u)=>{const h={"@context":p["@context"]??g,...p};e.push(M(h,i,u,void 0))})}else e.push(M(c,i,void 0,o))}catch{e.push({context:"",index:i,messages:[{message:"Could not parse JSON content",property:"",severity:"error"}],parsed:{},raw:o,status:"error",type:"Invalid JSON"})}}),e},"readJsonLdSchemas"),R=[{description:"Page title shown in browser tabs and search engine results",key:"title",label:"title",priority:"required",snippet:"<title>Your Page Title</title>"},{description:"Title shown when your page is shared on social media",key:"ogTitle",label:"og:title",priority:"required",snippet:'<meta property="og:title" content="Your Page Title" />'},{description:"Description shown when sharing on social media (max 200 chars)",key:"ogDescription",label:"og:description",priority:"required",snippet:'<meta property="og:description" content="Your page description" />'},{description:"Image shown when sharing (recommended: 1200 × 630 px)",key:"ogImage",label:"og:image",priority:"required",snippet:'<meta property="og:image" content="https://yoursite.com/og-image.jpg" />'},{description:"Twitter card format — controls how link previews appear on X / Twitter",key:"twitterCard",label:"twitter:card",priority:"required",snippet:'<meta name="twitter:card" content="summary_large_image" />'},{description:"Meta description used by search engines (max 160 chars)",key:"description",label:"description",priority:"recommended",snippet:'<meta name="description" content="Your page description" />'},{description:"Canonical URL to prevent duplicate content issues with search engines",key:"canonical",label:"canonical",priority:"recommended",snippet:'<link rel="canonical" href="https://yoursite.com/page" />'},{description:"Canonical page URL for Open Graph — should match the canonical link tag",key:"ogUrl",label:"og:url",priority:"recommended",snippet:'<meta property="og:url" content="https://yoursite.com/page" />'},{description:"Type of content: website, article, product, video.movie, etc.",key:"ogType",label:"og:type",priority:"recommended",snippet:'<meta property="og:type" content="website" />'},{description:"Your website name — shown for consistent branding on social platforms",key:"ogSiteName",label:"og:site_name",priority:"recommended",snippet:'<meta property="og:site_name" content="Your Site Name" />'},{description:"Language and territory of page content (e.g. en_US, de_DE, fr_FR)",key:"ogLocale",label:"og:locale",priority:"recommended",snippet:'<meta property="og:locale" content="en_US" />'},{description:"Alt text for the OG image — important for accessibility on social platforms",key:"ogImageAlt",label:"og:image:alt",priority:"recommended",snippet:'<meta property="og:image:alt" content="Description of the shared image" />'},{description:"Override title specifically for X / Twitter cards (falls back to og:title)",key:"twitterTitle",label:"twitter:title",priority:"recommended",snippet:'<meta name="twitter:title" content="Your Page Title" />'},{description:"Override description for X / Twitter cards (falls back to og:description)",key:"twitterDescription",label:"twitter:description",priority:"recommended",snippet:'<meta name="twitter:description" content="Your page description" />'},{description:"Override image for X / Twitter cards (falls back to og:image)",key:"twitterImage",label:"twitter:image",priority:"recommended",snippet:'<meta name="twitter:image" content="https://yoursite.com/twitter-card.jpg" />'},{description:"X / Twitter handle of the website owner (e.g. @yourhandle)",key:"twitterSite",label:"twitter:site",priority:"recommended",snippet:'<meta name="twitter:site" content="@yourhandle" />'}],ye=[{accentClass:"border-blue-500/30",descKey:"ogDescription",id:"facebook",imageKey:"ogImage",name:"Facebook",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-foreground/20",descKey:"twitterDescription",id:"twitter",imageKey:"twitterImage",name:"X / Twitter",requiredKeys:["twitterTitle","twitterDescription","twitterImage","twitterCard"],titleKey:"twitterTitle",urlKey:"ogUrl"},{accentClass:"border-blue-600/30",descKey:"ogDescription",id:"linkedin",imageKey:"ogImage",name:"LinkedIn",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-indigo-500/30",descKey:"ogDescription",id:"discord",imageKey:"ogImage",name:"Discord",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-green-500/30",descKey:"ogDescription",id:"slack",imageKey:"ogImage",name:"Slack",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-purple-500/30",descKey:"ogDescription",id:"mastodon",imageKey:"ogImage",name:"Mastodon",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-sky-500/30",descKey:"ogDescription",id:"bluesky",imageKey:"ogImage",name:"Bluesky",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"}],be=a(({meta:r,platform:e})=>{const s=r[e.titleKey]||r.title||"No title",i=r[e.descKey]||r.description||"",o=r[e.imageKey]||"",c=r[e.urlKey]||r.canonical||"",g=e.requiredKeys.filter(p=>!r[p]);return n("div",{class:y("border bg-card overflow-hidden",e.accentClass),children:[n("div",{class:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border/50 bg-foreground/2",children:[t("span",{class:"text-[0.65rem] font-bold uppercase tracking-wider text-muted-foreground",children:e.name}),g.length>0&&n("span",{class:"text-[0.6rem] px-1.5 py-0.5 bg-warning/10 text-warning border border-warning/20 font-medium",children:["Missing: ",g.join(", ")]})]}),n("div",{class:"p-3",children:[t("div",{class:"w-full aspect-[1200/630] bg-foreground/6 border border-border/50 mb-2.5 overflow-hidden relative",children:o?t("img",{alt:"OG image preview",class:"w-full h-full object-cover",loading:"lazy",src:o}):t("div",{class:"absolute inset-0 flex items-center justify-center",children:t("span",{class:"text-[0.65rem] text-muted-foreground/40 uppercase tracking-wider",children:"No image"})})}),c&&t("div",{class:"text-[0.6rem] text-muted-foreground/60 uppercase tracking-wider truncate mb-1",children:c}),t("div",{class:"text-[0.8rem] font-semibold text-foreground line-clamp-1",children:s}),i&&t("div",{class:"text-[0.7rem] text-muted-foreground line-clamp-2 mt-0.5",children:i})]})]})},"SocialPreview"),m=a(({label:r,required:e=!1,value:s})=>n("div",{class:"flex items-start gap-3 py-2 border-b border-border/30 last:border-0",children:[t("div",{class:"w-44 shrink-0",children:t("span",{class:"text-[0.7rem] font-mono text-muted-foreground",children:r})}),t("div",{class:"flex-1 min-w-0",children:s?t("span",{class:"text-[0.75rem] text-foreground break-all",children:s}):t("span",{class:y("text-[0.7rem]",e?"text-warning":"text-muted-foreground/40"),children:e?"⚠ Missing":"—"})})]}),"MetaRow"),k=a(({children:r})=>n("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/60 mb-2",children:[t("span",{class:"text-primary/50",children:"// "}),r]}),"SectionHeading"),F=a(({text:r})=>{const[e,s]=b(v(!1),"copied"),i=b(H(void 0),"timerRef"),o=a(()=>{navigator.clipboard.writeText(r).then(()=>{s(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(s,2e3,!1)}).catch(()=>{})},"handleCopy");return t(B,{class:y("text-[0.6rem] font-mono shrink-0",e?"border-success/40 text-success bg-success/8":""),onClick:o,size:"sm",variant:"outline",children:e?"Copied!":"Copy"})},"CopyButton"),U=a(({def:r})=>n("div",{class:"border border-border/60 bg-card p-3 space-y-2",children:[n("div",{class:"flex items-start justify-between gap-3",children:[t("code",{class:"text-[0.7rem] font-mono font-bold text-foreground",children:r.label}),t(K,{class:"text-[0.58rem] uppercase tracking-wide shrink-0",variant:r.priority==="required"?"destructive":"warning",children:r.priority})]}),t("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed",children:r.description}),n("div",{class:"flex items-center gap-2",children:[t("code",{class:"flex-1 min-w-0 text-[0.65rem] font-mono text-muted-foreground bg-foreground/4 border border-border/40 px-2 py-1 overflow-x-auto whitespace-nowrap block",children:r.snippet}),t(F,{text:r.snippet})]})]}),"MissingTagCard"),_={error:{color:"text-destructive",icon:"✖",label:"Error"},ok:{color:"text-success",icon:"✔",label:"OK"},suggestion:{color:"text-primary",icon:"ℹ",label:"Info"},warning:{color:"text-warning",icon:"⚠",label:"Warning"}},fe={error:"destructive",ok:"success",suggestion:"outline",warning:"warning"},ve=a(({schema:r})=>{const[e,s]=b(v(!1),"open"),[i,o]=b(v(!1),"showRaw"),c=_[r.status],g=r.graphIndex===void 0?`Script ${r.index+1}`:`Script ${r.index+1} @graph[${r.graphIndex}]`;return n("div",{class:"border border-border bg-card overflow-hidden",children:[n("button",{class:"w-full flex items-center justify-between gap-3 px-4 py-3 bg-transparent border-0 cursor-pointer text-left hover:bg-foreground/3 transition-colors",onClick:a(()=>{s(p=>!p)},"onClick"),type:"button",children:[n("div",{class:"flex items-center gap-2 min-w-0",children:[t("span",{class:y("text-base shrink-0 leading-none",c.color),children:c.icon}),t("span",{class:"text-[0.7rem] text-muted-foreground font-mono shrink-0",children:g}),t("code",{class:"text-[0.75rem] font-mono font-semibold text-foreground truncate",children:r.type})]}),n("div",{class:"flex items-center gap-2 shrink-0",children:[t(K,{variant:fe[r.status],children:c.label}),t("span",{class:y("text-muted-foreground text-[0.65rem] transition-transform duration-150",e?"rotate-90":""),children:"▶"})]})]}),e&&n("div",{class:"border-t border-border",children:[r.messages.length>0?t("div",{class:"px-4 py-3 space-y-1.5",children:r.messages.map((p,u)=>{const h=_[p.severity];return n("div",{class:"flex items-start gap-2 text-[0.72rem]",children:[t("span",{class:y("shrink-0 leading-none mt-px",h.color),children:h.icon}),n("div",{class:"min-w-0",children:[p.property&&n("code",{class:"text-[0.65rem] font-mono text-muted-foreground mr-1.5",children:[p.property,":"]}),t("span",{class:"text-foreground/80",children:p.message})]})]},u)})}):n("div",{class:"px-4 py-3 flex items-center gap-2 text-[0.72rem] text-success",children:[t("span",{children:"✔"}),t("span",{children:"No issues found"})]}),n("div",{class:"border-t border-border/50 px-4 py-2 flex items-center justify-between",children:[n("button",{class:"text-[0.65rem] text-muted-foreground hover:text-foreground transition-colors bg-transparent border-0 cursor-pointer p-0",onClick:a(()=>{o(p=>!p)},"onClick"),type:"button",children:[i?"Hide":"Show"," raw JSON"]}),t(F,{text:r.raw})]}),i&&t("pre",{class:"text-[0.65rem] font-mono leading-relaxed bg-foreground/3 border-t border-border/50 px-4 py-3 overflow-x-auto max-h-60 text-muted-foreground whitespace-pre-wrap break-all m-0",children:r.raw})]})]})},"SchemaCard"),z=60,Y=158,J=120,T="...",xe=[{hasIssue:a(r=>!r.favicon,"hasIssue"),message:"No favicon or icon set on the page."},{hasIssue:a(r=>!r.title.trim(),"hasIssue"),message:"No title tag set on the page."},{hasIssue:a(r=>!r.description.trim(),"hasIssue"),message:"No meta description set on the page."},{hasIssue:a((r,e)=>e.titleOverflow,"hasIssue"),message:"The title exceeds ~60 characters and may be truncated in search results."}],we=[{extraChecks:[{hasIssue:a((r,e)=>e.descriptionOverflow,"hasIssue"),message:"The meta description exceeds ~158 characters and may be trimmed on desktop."}],isMobile:!1,label:"Desktop preview"},{extraChecks:[{hasIssue:a((r,e)=>e.descriptionOverflowMobile,"hasIssue"),message:"Description exceeds the 3-line limit for mobile view (~120 characters)."}],isMobile:!0,label:"Mobile preview"}],D=a((r,e)=>r.length<=e?r:e<=T.length?T:r.slice(0,e-T.length)+T,"truncateToChars"),ke=a(r=>{const e=globalThis.window===void 0?"":globalThis.location.href,s=r.ogSiteName||(globalThis.window===void 0?"":globalThis.location.hostname.replace(/^www\./,""));let i=[...document.head.querySelectorAll("link")].find(o=>o.getAttribute("rel")?.toLowerCase().split(/\s+/).includes("icon"))?.getAttribute("href")||null;if(i&&globalThis.window!==void 0)try{i=new URL(i,e).href}catch{i=null}return{description:r.description,favicon:i,siteName:s,title:r.title,url:e}},"getSerpFromMeta"),Te=a((r,e,s)=>s.filter(i=>i.hasIssue(r,e)).map(i=>i.message),"getSerpIssues"),Se=a(({data:r,displayDescription:e,displayTitle:s,isMobile:i,issues:o,label:c})=>n("div",{class:"border border-border bg-card p-4 mb-4",children:[t("p",{class:"text-[0.7rem] font-semibold text-muted-foreground mb-3",children:c}),n("div",{class:y("border border-border/50 bg-background p-4 font-sans",i?"max-w-[380px]":"max-w-[600px]"),children:[n("div",{class:"flex items-center gap-3 mb-2",children:[r.favicon?t("img",{alt:"favicon",class:"size-7 rounded-full shrink-0 object-contain",src:r.favicon}):t("div",{class:"size-7 rounded-full shrink-0 bg-foreground/10 flex items-center justify-center"}),n("div",{class:"flex flex-col min-w-0",children:[t("span",{class:"text-[0.875rem] text-foreground leading-snug",children:r.siteName||r.url}),t("span",{class:"text-[0.75rem] text-muted-foreground leading-snug truncate",children:r.url})]})]}),t("p",{class:"text-[1.25rem] font-normal leading-snug mb-1 m-0",style:{color:"var(--color-info, #1a0dab)"},children:s||"No title"}),t("p",{class:y("text-[0.875rem] text-muted-foreground leading-relaxed m-0",i&&"line-clamp-3"),children:e||"No meta description."})]}),o.length>0&&n("div",{class:"mt-3",children:[t("p",{class:"text-[0.7rem] font-semibold text-destructive mb-1",children:"Issues:"}),t("ul",{class:"m-0 pl-5 list-disc",children:o.map((g,p)=>t("li",{class:"text-[0.75rem] text-destructive/80 mt-0.5",children:g},p))})]})]}),"SerpSnippetPreview"),qe=a(({meta:r})=>{const e=ke(r),s=e.title||"No title",i=e.description||"No meta description.",o=D(s,z),c=D(i,Y),g={descriptionOverflow:i.length>Y,descriptionOverflowMobile:i.length>J,titleOverflow:s.length>z};return n("div",{children:[t("p",{class:"text-[0.7rem] text-muted-foreground mb-3 leading-relaxed",children:"See how your title tag and meta description may look in Google search results. Data is read from the current page."}),we.map(p=>{const u=Te(e,g,[...xe,...p.extraChecks]);return t(Se,{data:e,displayDescription:p.isMobile?D(i,J):c,displayTitle:o,isMobile:p.isMobile,issues:u,label:p.label},p.label)})]})},"SerpPreview"),Ie=a(r=>{const[e,s]=b(v(void 0),"meta"),[i,o]=b(v([]),"schemas"),[c,g]=b(v("preview"),"activeTab"),p=a(()=>{s(ee()),o(he())},"refresh");if(W(()=>{p()},[]),!e)return n("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[t("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(d=>t("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${d}ms`}},d))}),t("span",{class:"text-[0.75rem] text-muted-foreground",children:"Reading meta tags…"})]});const u=R.filter(d=>d.priority==="required"&&!e[d.key]),h=R.filter(d=>d.priority==="recommended"&&!e[d.key]),S=u.length+h.length,f=i.filter(d=>d.status==="error").length,O=i.filter(d=>d.status==="warning").length;let x;f>0?x=f:O>0&&(x=O);const V=e.ogType==="article"||!!(e.articleAuthor||e.articlePublishedTime||e.articleModifiedTime||e.articleSection);return n("div",{class:"flex flex-col h-full",children:[n("div",{class:"flex items-center justify-between gap-3 px-4 py-2.5 border-b border-border shrink-0",children:[t("div",{class:"flex items-center gap-0",children:["preview","serp","tags","missing","jsonld"].map(d=>{const q={jsonld:"Structured Data",missing:"Missing",preview:"Social Previews",serp:"SERP",tags:"Meta Tags"}[d];let w;d==="missing"&&S>0?w=S:d==="jsonld"&&x!==void 0&&(w=x);let I;return d==="missing"?I=u.length>0?"destructive":"warning":I=f>0?"destructive":"warning",n("button",{class:y("flex items-center gap-1.5 px-3 py-1.5 text-[0.75rem] font-medium border-0 cursor-pointer transition-colors capitalize",c===d?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:a(()=>{g(d)},"onClick"),type:"button",children:[q,w!==void 0&&t(K,{class:"text-[0.58rem] min-w-[1.1rem] text-center",variant:I,children:w})]},d)})}),t(B,{onClick:p,size:"sm",variant:"outline",children:"Refresh"})]}),n("div",{class:"flex-1 overflow-auto",children:[c==="preview"&&t("div",{class:"p-4 grid grid-cols-2 gap-4",children:ye.map(d=>t(be,{meta:e,platform:d},d.id))}),c==="serp"&&t("div",{class:"p-4",children:t(qe,{meta:e})}),c==="tags"&&n("div",{class:"p-5 space-y-5",children:[n("div",{children:[t(k,{children:"Basic"}),t("div",{class:"border border-border bg-card",children:n("div",{class:"px-4",children:[t(m,{label:"title",required:!0,value:e.title}),t(m,{label:"description",required:!0,value:e.description}),t(m,{label:"canonical",value:e.canonical})]})})]}),n("div",{children:[t(k,{children:"Open Graph"}),t("div",{class:"border border-border bg-card",children:n("div",{class:"px-4",children:[t(m,{label:"og:title",required:!0,value:e.ogTitle}),t(m,{label:"og:description",required:!0,value:e.ogDescription}),t(m,{label:"og:image",required:!0,value:e.ogImage}),t(m,{label:"og:image:alt",value:e.ogImageAlt}),t(m,{label:"og:url",value:e.ogUrl}),t(m,{label:"og:type",value:e.ogType}),t(m,{label:"og:site_name",value:e.ogSiteName}),t(m,{label:"og:locale",value:e.ogLocale})]})})]}),V&&n("div",{children:[t(k,{children:"Article"}),t("div",{class:"border border-border bg-card",children:n("div",{class:"px-4",children:[t(m,{label:"article:author",value:e.articleAuthor}),t(m,{label:"article:published_time",value:e.articlePublishedTime}),t(m,{label:"article:modified_time",value:e.articleModifiedTime}),t(m,{label:"article:section",value:e.articleSection})]})})]}),n("div",{children:[t(k,{children:"X / Twitter"}),t("div",{class:"border border-border bg-card",children:n("div",{class:"px-4",children:[t(m,{label:"twitter:card",required:!0,value:e.twitterCard}),t(m,{label:"twitter:title",value:e.twitterTitle}),t(m,{label:"twitter:description",value:e.twitterDescription}),t(m,{label:"twitter:image",value:e.twitterImage}),t(m,{label:"twitter:image:alt",value:e.twitterImageAlt}),t(m,{label:"twitter:site",value:e.twitterSite}),t(m,{label:"twitter:creator",value:e.twitterCreator})]})})]})]}),c==="jsonld"&&t("div",{class:"p-5 space-y-3",children:i.length===0?n("div",{class:"flex flex-col items-center justify-center py-12 gap-3",children:[t("div",{class:"size-10 border border-border flex items-center justify-center text-muted-foreground/40 text-lg select-none",children:"{}"}),t("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"No structured data found"}),n("p",{class:"text-[0.7rem] text-muted-foreground text-center max-w-xs leading-relaxed",children:["Add a ",t("code",{class:"font-mono bg-foreground/6 px-1",children:'<script type="application/ld+json">'})," block to help search engines understand your content."]})]}):n(E,{children:[n("div",{class:"flex items-center justify-between mb-1",children:[n("p",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground",children:[i.length," schema",i.length===1?"":"s"," detected"]}),f>0&&n("span",{class:"text-[0.65rem] text-destructive font-medium",children:[f," error",f===1?"":"s"]})]}),i.map((d,q)=>t(ve,{schema:d},q))]})}),c==="missing"&&t("div",{class:"p-5 space-y-5",children:S===0?n("div",{class:"flex flex-col items-center justify-center py-12 gap-3",children:[t("div",{class:"size-10 border border-success/30 bg-success/8 flex items-center justify-center text-success text-lg select-none",children:"✓"}),t("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"All recommended tags are present"}),t("p",{class:"text-[0.7rem] text-muted-foreground",children:"Your page has all required and recommended meta tags."})]}):n(E,{children:[u.length>0&&n("div",{children:[n("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-destructive/80 mb-2 flex items-center gap-1.5",children:[t("span",{children:"Required"}),t("span",{class:"bg-destructive/10 border border-destructive/25 text-destructive px-1 font-bold",children:u.length})]}),t("div",{class:"space-y-2",children:u.map(d=>t(U,{def:d},d.key))})]}),h.length>0&&n("div",{children:[n("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-warning/80 mb-2 flex items-center gap-1.5",children:[t("span",{children:"Recommended"}),t("span",{class:"bg-warning/10 border border-warning/25 text-warning px-1 font-bold",children:h.length})]}),t("div",{class:"space-y-2",children:h.map(d=>t(U,{def:d},d.key))})]})]})})]})]})},"SeoApp"),Ee={component:Ie,icon:Q,id:"dev-toolbar:seo",name:"SEO"};export{Ee as default};
17
+ `;var Z=Object.defineProperty,a=P((r,e)=>Z(r,"name",{value:e,configurable:!0}),"l");const ee=a(()=>{const r=a(o=>document.querySelector(`meta[name="${o}"]`)?.content??"","getMeta"),e=a(o=>document.querySelector(`meta[property="og:${o}"]`)?.content??"","getOg"),s=a(o=>document.querySelector(`meta[name="twitter:${o}"]`)?.content??document.querySelector(`meta[property="twitter:${o}"]`)?.content??"","getTwitter"),i=a(o=>document.querySelector(`meta[property="article:${o}"]`)?.content??"","getArticle");return{articleAuthor:i("author"),articleModifiedTime:i("modified_time"),articlePublishedTime:i("published_time"),articleSection:i("section"),canonical:document.querySelector('link[rel="canonical"]')?.href??"",description:r("description"),ogDescription:e("description"),ogImage:e("image"),ogImageAlt:e("image:alt"),ogLocale:e("locale"),ogSiteName:e("site_name"),ogTitle:e("title"),ogType:e("type"),ogUrl:e("url"),title:document.title??"",twitterCard:s("card"),twitterCreator:s("creator"),twitterDescription:s("description"),twitterImage:s("image"),twitterImageAlt:s("image:alt"),twitterSite:s("site"),twitterTitle:s("title")}},"readMetaTags"),re=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2})?(?:[+-]\d{2}:\d{2}|Z)?)?$/,A=a(r=>typeof r=="string"&&re.test(r),"isISO8601"),l=a((r,e)=>r[e]!==void 0&&r[e]!==null&&r[e]!=="","has"),j=a(r=>Array.isArray(r)&&r.length>0,"isNonEmptyArray"),C=a(r=>{const e=[];if(!l(r,"headline")&&!l(r,"name")&&e.push({message:"headline (or name) is required",property:"headline",severity:"error"}),l(r,"author")){const s=r.author;typeof s=="object"&&!Array.isArray(s)&&!l(s,"name")&&e.push({message:"author.name is missing",property:"author.name",severity:"warning"})}else e.push({message:"author is required",property:"author",severity:"error"});return l(r,"datePublished")?A(r.datePublished)||e.push({message:"datePublished should be ISO 8601 format (e.g. 2024-01-15T09:00:00Z)",property:"datePublished",severity:"warning"}):e.push({message:"datePublished is required",property:"datePublished",severity:"error"}),l(r,"image")||e.push({message:"image is recommended for rich results",property:"image",severity:"warning"}),l(r,"description")||e.push({message:"description is recommended",property:"description",severity:"suggestion"}),e},"validateArticle"),te=a(r=>{const e=[];l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"});const s=l(r,"offers"),i=l(r,"aggregateRating"),o=l(r,"review");if(!s&&!i&&!o&&e.push({message:"At least one of: offers, aggregateRating, or review is required for rich results",property:"offers",severity:"error"}),s){const c=Array.isArray(r.offers)?r.offers[0]:r.offers;c&&typeof c=="object"&&(!l(c,"price")&&!l(c,"priceSpecification")&&e.push({message:"offers.price is required",property:"offers.price",severity:"error"}),l(c,"priceCurrency")||e.push({message:"offers.priceCurrency is required (e.g. 'USD')",property:"offers.priceCurrency",severity:"error"}))}if(i){const c=r.aggregateRating;l(c,"ratingValue")||e.push({message:"aggregateRating.ratingValue is required",property:"aggregateRating.ratingValue",severity:"error"}),!l(c,"reviewCount")&&!l(c,"ratingCount")&&e.push({message:"aggregateRating.reviewCount (or ratingCount) is required",property:"aggregateRating.reviewCount",severity:"error"})}return l(r,"image")||e.push({message:"image is recommended for rich results",property:"image",severity:"suggestion"}),e},"validateProduct"),ie=a(r=>{const e=[],s=r.itemListElement;return j(s)?(s.length<2&&e.push({message:"itemListElement should have at least 2 items",property:"itemListElement",severity:"warning"}),s.forEach((i,o)=>{i.position!==o+1&&e.push({message:`itemListElement[${o}].position should be ${o+1}`,property:`itemListElement[${o}].position`,severity:"warning"}),i.name||i.item?.name||e.push({message:`itemListElement[${o}].name is required`,property:`itemListElement[${o}].name`,severity:"error"})}),e):(e.push({message:"itemListElement array is required",property:"itemListElement",severity:"error"}),e)},"validateBreadcrumbList"),se=a(r=>{const e=[],s=r.mainEntity;return j(s)?(s.forEach((i,o)=>{l(i,"name")||e.push({message:`mainEntity[${o}].name (question text) is required`,property:`mainEntity[${o}].name`,severity:"error"});const c=i.acceptedAnswer;(!c||!l(c,"text"))&&e.push({message:`mainEntity[${o}].acceptedAnswer.text is required`,property:`mainEntity[${o}].acceptedAnswer.text`,severity:"error"})}),e):(e.push({message:"mainEntity array with at least one Question is required",property:"mainEntity",severity:"error"}),e)},"validateFaqPage"),N=a(r=>{const e=[];l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"startDate")?A(r.startDate)||e.push({message:"startDate should be ISO 8601 format",property:"startDate",severity:"warning"}):e.push({message:"startDate is required",property:"startDate",severity:"error"});const s=r.location;return s?l(s,"name")||e.push({message:"location.name is required",property:"location.name",severity:"error"}):e.push({message:"location is required",property:"location",severity:"error"}),l(r,"description")||e.push({message:"description is recommended",property:"description",severity:"suggestion"}),e},"validateEvent"),L=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"url")||e.push({message:"url is recommended",property:"url",severity:"warning"}),l(r,"logo")||e.push({message:"logo is recommended for Knowledge Panel eligibility",property:"logo",severity:"suggestion"}),e},"validateOrganization"),oe=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"url")||e.push({message:"url is recommended",property:"url",severity:"suggestion"}),e},"validatePerson"),ne=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"image")||e.push({message:"image is required for rich results",property:"image",severity:"error"}),!l(r,"recipeIngredient")&&!l(r,"ingredients")&&e.push({message:"recipeIngredient is recommended",property:"recipeIngredient",severity:"suggestion"}),l(r,"recipeInstructions")||e.push({message:"recipeInstructions is recommended",property:"recipeInstructions",severity:"suggestion"}),l(r,"author")||e.push({message:"author is recommended",property:"author",severity:"suggestion"}),e},"validateRecipe"),$=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"url")||e.push({message:"url is recommended",property:"url",severity:"warning"}),e},"validateWebSiteOrPage"),ae=a(r=>{const e=[];return l(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),l(r,"description")||e.push({message:"description is required",property:"description",severity:"error"}),l(r,"thumbnailUrl")||e.push({message:"thumbnailUrl is required for rich results",property:"thumbnailUrl",severity:"error"}),l(r,"uploadDate")?A(r.uploadDate)||e.push({message:"uploadDate should be ISO 8601 format",property:"uploadDate",severity:"warning"}):e.push({message:"uploadDate is required",property:"uploadDate",severity:"error"}),e},"validateVideoObject"),X={Article:C,BlogPosting:C,BreadcrumbList:ie,Event:N,EventSeries:N,FAQPage:se,LocalBusiness:L,NewsArticle:C,Organization:L,Person:oe,Product:te,Recipe:ne,VideoObject:ae,WebPage:$,WebSite:$},le=new Set(Object.keys(X)),ce=a(r=>{const e=[],s=String(r["@context"]??""),i=String(r["@type"]??"");if(s){let c=!1;try{const g=new URL(s).hostname.toLowerCase();c=g==="schema.org"||g.endsWith(".schema.org")}catch{}c||e.push({message:"@context should reference schema.org",property:"@context",severity:"warning"})}else e.push({message:"@context is missing — should be 'https://schema.org'",property:"@context",severity:"error"});if(!i)return e.push({message:"@type is required",property:"@type",severity:"error"}),e;le.has(i)||e.push({message:`@type '${i}' is not validated — no known rules for this type`,property:"@type",severity:"suggestion"});const o=X[i];return o&&e.push(...o(r)),e},"validateJsonLd"),de=a(r=>r.some(e=>e.severity==="error")?"error":r.some(e=>e.severity==="warning")?"warning":r.some(e=>e.severity==="suggestion")?"suggestion":"ok","deriveStatus"),M=a((r,e,s,i)=>{const o=ce(r),c=String(r["@type"]??"Unknown");return{context:String(r["@context"]??""),graphIndex:s,index:e,messages:o,parsed:r,raw:i??JSON.stringify(r,void 0,2),status:de(o),type:c}},"processJsonLdNode"),pe=/^\/\/<!\[CDATA\[/,me=/\/\/\]\]>$/,ge=/^<!\[CDATA\[/,ue=/\]\]>$/,he=a(()=>{const r=document.querySelectorAll('script[type="application/ld+json"]'),e=[];return r.forEach((s,i)=>{let o=(s.textContent??"").trim();o=o.replace(pe,"").replace(me,""),o=o.replace(ge,"").replace(ue,"");try{const c=JSON.parse(o);if(j(c["@graph"])){const g=String(c["@context"]??"");c["@graph"].forEach((p,u)=>{const h={"@context":p["@context"]??g,...p};e.push(M(h,i,u,void 0))})}else e.push(M(c,i,void 0,o))}catch{e.push({context:"",index:i,messages:[{message:"Could not parse JSON content",property:"",severity:"error"}],parsed:{},raw:o,status:"error",type:"Invalid JSON"})}}),e},"readJsonLdSchemas"),R=[{description:"Page title shown in browser tabs and search engine results",key:"title",label:"title",priority:"required",snippet:"<title>Your Page Title</title>"},{description:"Title shown when your page is shared on social media",key:"ogTitle",label:"og:title",priority:"required",snippet:'<meta property="og:title" content="Your Page Title" />'},{description:"Description shown when sharing on social media (max 200 chars)",key:"ogDescription",label:"og:description",priority:"required",snippet:'<meta property="og:description" content="Your page description" />'},{description:"Image shown when sharing (recommended: 1200 × 630 px)",key:"ogImage",label:"og:image",priority:"required",snippet:'<meta property="og:image" content="https://yoursite.com/og-image.jpg" />'},{description:"Twitter card format — controls how link previews appear on X / Twitter",key:"twitterCard",label:"twitter:card",priority:"required",snippet:'<meta name="twitter:card" content="summary_large_image" />'},{description:"Meta description used by search engines (max 160 chars)",key:"description",label:"description",priority:"recommended",snippet:'<meta name="description" content="Your page description" />'},{description:"Canonical URL to prevent duplicate content issues with search engines",key:"canonical",label:"canonical",priority:"recommended",snippet:'<link rel="canonical" href="https://yoursite.com/page" />'},{description:"Canonical page URL for Open Graph — should match the canonical link tag",key:"ogUrl",label:"og:url",priority:"recommended",snippet:'<meta property="og:url" content="https://yoursite.com/page" />'},{description:"Type of content: website, article, product, video.movie, etc.",key:"ogType",label:"og:type",priority:"recommended",snippet:'<meta property="og:type" content="website" />'},{description:"Your website name — shown for consistent branding on social platforms",key:"ogSiteName",label:"og:site_name",priority:"recommended",snippet:'<meta property="og:site_name" content="Your Site Name" />'},{description:"Language and territory of page content (e.g. en_US, de_DE, fr_FR)",key:"ogLocale",label:"og:locale",priority:"recommended",snippet:'<meta property="og:locale" content="en_US" />'},{description:"Alt text for the OG image — important for accessibility on social platforms",key:"ogImageAlt",label:"og:image:alt",priority:"recommended",snippet:'<meta property="og:image:alt" content="Description of the shared image" />'},{description:"Override title specifically for X / Twitter cards (falls back to og:title)",key:"twitterTitle",label:"twitter:title",priority:"recommended",snippet:'<meta name="twitter:title" content="Your Page Title" />'},{description:"Override description for X / Twitter cards (falls back to og:description)",key:"twitterDescription",label:"twitter:description",priority:"recommended",snippet:'<meta name="twitter:description" content="Your page description" />'},{description:"Override image for X / Twitter cards (falls back to og:image)",key:"twitterImage",label:"twitter:image",priority:"recommended",snippet:'<meta name="twitter:image" content="https://yoursite.com/twitter-card.jpg" />'},{description:"X / Twitter handle of the website owner (e.g. @yourhandle)",key:"twitterSite",label:"twitter:site",priority:"recommended",snippet:'<meta name="twitter:site" content="@yourhandle" />'}],ye=[{accentClass:"border-blue-500/30",descKey:"ogDescription",id:"facebook",imageKey:"ogImage",name:"Facebook",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-foreground/20",descKey:"twitterDescription",id:"twitter",imageKey:"twitterImage",name:"X / Twitter",requiredKeys:["twitterTitle","twitterDescription","twitterImage","twitterCard"],titleKey:"twitterTitle",urlKey:"ogUrl"},{accentClass:"border-blue-600/30",descKey:"ogDescription",id:"linkedin",imageKey:"ogImage",name:"LinkedIn",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-indigo-500/30",descKey:"ogDescription",id:"discord",imageKey:"ogImage",name:"Discord",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-green-500/30",descKey:"ogDescription",id:"slack",imageKey:"ogImage",name:"Slack",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-purple-500/30",descKey:"ogDescription",id:"mastodon",imageKey:"ogImage",name:"Mastodon",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-sky-500/30",descKey:"ogDescription",id:"bluesky",imageKey:"ogImage",name:"Bluesky",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"}],be=a(({meta:r,platform:e})=>{const s=r[e.titleKey]||r.title||"No title",i=r[e.descKey]||r.description||"",o=r[e.imageKey]||"",c=r[e.urlKey]||r.canonical||"",g=e.requiredKeys.filter(p=>!r[p]);return n("div",{class:y("border bg-card overflow-hidden",e.accentClass),children:[n("div",{class:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border/50 bg-foreground/2",children:[t("span",{class:"text-[0.65rem] font-bold uppercase tracking-wider text-muted-foreground",children:e.name}),g.length>0&&n("span",{class:"text-[0.6rem] px-1.5 py-0.5 bg-warning/10 text-warning border border-warning/20 font-medium",children:["Missing: ",g.join(", ")]})]}),n("div",{class:"p-3",children:[t("div",{class:"w-full aspect-[1200/630] bg-foreground/6 border border-border/50 mb-2.5 overflow-hidden relative",children:o?t("img",{alt:"OG image preview",class:"w-full h-full object-cover",loading:"lazy",src:o}):t("div",{class:"absolute inset-0 flex items-center justify-center",children:t("span",{class:"text-[0.65rem] text-muted-foreground/40 uppercase tracking-wider",children:"No image"})})}),c&&t("div",{class:"text-[0.6rem] text-muted-foreground/60 uppercase tracking-wider truncate mb-1",children:c}),t("div",{class:"text-[0.8rem] font-semibold text-foreground line-clamp-1",children:s}),i&&t("div",{class:"text-[0.7rem] text-muted-foreground line-clamp-2 mt-0.5",children:i})]})]})},"SocialPreview"),m=a(({label:r,required:e=!1,value:s})=>n("div",{class:"flex items-start gap-3 py-2 border-b border-border/30 last:border-0",children:[t("div",{class:"w-44 shrink-0",children:t("span",{class:"text-[0.7rem] font-mono text-muted-foreground",children:r})}),t("div",{class:"flex-1 min-w-0",children:s?t("span",{class:"text-[0.75rem] text-foreground break-all",children:s}):t("span",{class:y("text-[0.7rem]",e?"text-warning":"text-muted-foreground/40"),children:e?"⚠ Missing":"—"})})]}),"MetaRow"),k=a(({children:r})=>n("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/60 mb-2",children:[t("span",{class:"text-primary/50",children:"// "}),r]}),"SectionHeading"),F=a(({text:r})=>{const[e,s]=b(v(!1),"copied"),i=b(W(void 0),"timerRef"),o=a(()=>{navigator.clipboard.writeText(r).then(()=>{s(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(s,2e3,!1)}).catch(()=>{})},"handleCopy");return t(B,{class:y("text-[0.6rem] font-mono shrink-0",e?"border-success/40 text-success bg-success/8":""),onClick:o,size:"sm",variant:"outline",children:e?"Copied!":"Copy"})},"CopyButton"),U=a(({def:r})=>n("div",{class:"border border-border/60 bg-card p-3 space-y-2",children:[n("div",{class:"flex items-start justify-between gap-3",children:[t("code",{class:"text-[0.7rem] font-mono font-bold text-foreground",children:r.label}),t(K,{class:"text-[0.58rem] uppercase tracking-wide shrink-0",variant:r.priority==="required"?"destructive":"warning",children:r.priority})]}),t("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed",children:r.description}),n("div",{class:"flex items-center gap-2",children:[t("code",{class:"flex-1 min-w-0 text-[0.65rem] font-mono text-muted-foreground bg-foreground/4 border border-border/40 px-2 py-1 overflow-x-auto whitespace-nowrap block",children:r.snippet}),t(F,{text:r.snippet})]})]}),"MissingTagCard"),_={error:{color:"text-destructive",icon:"✖",label:"Error"},ok:{color:"text-success",icon:"✔",label:"OK"},suggestion:{color:"text-primary",icon:"ℹ",label:"Info"},warning:{color:"text-warning",icon:"⚠",label:"Warning"}},fe={error:"destructive",ok:"success",suggestion:"outline",warning:"warning"},ve=a(({schema:r})=>{const[e,s]=b(v(!1),"open"),[i,o]=b(v(!1),"showRaw"),c=_[r.status],g=r.graphIndex===void 0?`Script ${r.index+1}`:`Script ${r.index+1} @graph[${r.graphIndex}]`;return n("div",{class:"border border-border bg-card overflow-hidden",children:[n("button",{class:"w-full flex items-center justify-between gap-3 px-4 py-3 bg-transparent border-0 cursor-pointer text-left hover:bg-foreground/3 transition-colors",onClick:a(()=>{s(p=>!p)},"onClick"),type:"button",children:[n("div",{class:"flex items-center gap-2 min-w-0",children:[t("span",{class:y("text-base shrink-0 leading-none",c.color),children:c.icon}),t("span",{class:"text-[0.7rem] text-muted-foreground font-mono shrink-0",children:g}),t("code",{class:"text-[0.75rem] font-mono font-semibold text-foreground truncate",children:r.type})]}),n("div",{class:"flex items-center gap-2 shrink-0",children:[t(K,{variant:fe[r.status],children:c.label}),t("span",{class:y("text-muted-foreground text-[0.65rem] transition-transform duration-150",e?"rotate-90":""),children:"▶"})]})]}),e&&n("div",{class:"border-t border-border",children:[r.messages.length>0?t("div",{class:"px-4 py-3 space-y-1.5",children:r.messages.map((p,u)=>{const h=_[p.severity];return n("div",{class:"flex items-start gap-2 text-[0.72rem]",children:[t("span",{class:y("shrink-0 leading-none mt-px",h.color),children:h.icon}),n("div",{class:"min-w-0",children:[p.property&&n("code",{class:"text-[0.65rem] font-mono text-muted-foreground mr-1.5",children:[p.property,":"]}),t("span",{class:"text-foreground/80",children:p.message})]})]},u)})}):n("div",{class:"px-4 py-3 flex items-center gap-2 text-[0.72rem] text-success",children:[t("span",{children:"✔"}),t("span",{children:"No issues found"})]}),n("div",{class:"border-t border-border/50 px-4 py-2 flex items-center justify-between",children:[n("button",{class:"text-[0.65rem] text-muted-foreground hover:text-foreground transition-colors bg-transparent border-0 cursor-pointer p-0",onClick:a(()=>{o(p=>!p)},"onClick"),type:"button",children:[i?"Hide":"Show"," raw JSON"]}),t(F,{text:r.raw})]}),i&&t("pre",{class:"text-[0.65rem] font-mono leading-relaxed bg-foreground/3 border-t border-border/50 px-4 py-3 overflow-x-auto max-h-60 text-muted-foreground whitespace-pre-wrap break-all m-0",children:r.raw})]})]})},"SchemaCard"),z=60,Y=158,J=120,T="...",xe=[{hasIssue:a(r=>!r.favicon,"hasIssue"),message:"No favicon or icon set on the page."},{hasIssue:a(r=>!r.title.trim(),"hasIssue"),message:"No title tag set on the page."},{hasIssue:a(r=>!r.description.trim(),"hasIssue"),message:"No meta description set on the page."},{hasIssue:a((r,e)=>e.titleOverflow,"hasIssue"),message:"The title exceeds ~60 characters and may be truncated in search results."}],we=[{extraChecks:[{hasIssue:a((r,e)=>e.descriptionOverflow,"hasIssue"),message:"The meta description exceeds ~158 characters and may be trimmed on desktop."}],isMobile:!1,label:"Desktop preview"},{extraChecks:[{hasIssue:a((r,e)=>e.descriptionOverflowMobile,"hasIssue"),message:"Description exceeds the 3-line limit for mobile view (~120 characters)."}],isMobile:!0,label:"Mobile preview"}],D=a((r,e)=>r.length<=e?r:e<=T.length?T:r.slice(0,e-T.length)+T,"truncateToChars"),ke=a(r=>{const e=globalThis.window===void 0?"":globalThis.location.href,s=r.ogSiteName||(globalThis.window===void 0?"":globalThis.location.hostname.replace(/^www\./,""));let i=[...document.head.querySelectorAll("link")].find(o=>o.getAttribute("rel")?.toLowerCase().split(/\s+/).includes("icon"))?.getAttribute("href")||null;if(i&&globalThis.window!==void 0)try{i=new URL(i,e).href}catch{i=null}return{description:r.description,favicon:i,siteName:s,title:r.title,url:e}},"getSerpFromMeta"),Te=a((r,e,s)=>s.filter(i=>i.hasIssue(r,e)).map(i=>i.message),"getSerpIssues"),Se=a(({data:r,displayDescription:e,displayTitle:s,isMobile:i,issues:o,label:c})=>n("div",{class:"border border-border bg-card p-4 mb-4",children:[t("p",{class:"text-[0.7rem] font-semibold text-muted-foreground mb-3",children:c}),n("div",{class:y("border border-border/50 bg-background p-4 font-sans",i?"max-w-[380px]":"max-w-[600px]"),children:[n("div",{class:"flex items-center gap-3 mb-2",children:[r.favicon?t("img",{alt:"favicon",class:"size-7 rounded-full shrink-0 object-contain",src:r.favicon}):t("div",{class:"size-7 rounded-full shrink-0 bg-foreground/10 flex items-center justify-center"}),n("div",{class:"flex flex-col min-w-0",children:[t("span",{class:"text-[0.875rem] text-foreground leading-snug",children:r.siteName||r.url}),t("span",{class:"text-[0.75rem] text-muted-foreground leading-snug truncate",children:r.url})]})]}),t("p",{class:"text-[1.25rem] font-normal leading-snug mb-1 m-0",style:{color:"var(--color-info, #1a0dab)"},children:s||"No title"}),t("p",{class:y("text-[0.875rem] text-muted-foreground leading-relaxed m-0",i&&"line-clamp-3"),children:e||"No meta description."})]}),o.length>0&&n("div",{class:"mt-3",children:[t("p",{class:"text-[0.7rem] font-semibold text-destructive mb-1",children:"Issues:"}),t("ul",{class:"m-0 pl-5 list-disc",children:o.map((g,p)=>t("li",{class:"text-[0.75rem] text-destructive/80 mt-0.5",children:g},p))})]})]}),"SerpSnippetPreview"),qe=a(({meta:r})=>{const e=ke(r),s=e.title||"No title",i=e.description||"No meta description.",o=D(s,z),c=D(i,Y),g={descriptionOverflow:i.length>Y,descriptionOverflowMobile:i.length>J,titleOverflow:s.length>z};return n("div",{children:[t("p",{class:"text-[0.7rem] text-muted-foreground mb-3 leading-relaxed",children:"See how your title tag and meta description may look in Google search results. Data is read from the current page."}),we.map(p=>{const u=Te(e,g,[...xe,...p.extraChecks]);return t(Se,{data:e,displayDescription:p.isMobile?D(i,J):c,displayTitle:o,isMobile:p.isMobile,issues:u,label:p.label},p.label)})]})},"SerpPreview"),Ie=a(r=>{const[e,s]=b(v(void 0),"meta"),[i,o]=b(v([]),"schemas"),[c,g]=b(v("preview"),"activeTab"),p=a(()=>{s(ee()),o(he())},"refresh");if(H(()=>{p()},[]),!e)return n("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[t("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(d=>t("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${d}ms`}},d))}),t("span",{class:"text-[0.75rem] text-muted-foreground",children:"Reading meta tags…"})]});const u=R.filter(d=>d.priority==="required"&&!e[d.key]),h=R.filter(d=>d.priority==="recommended"&&!e[d.key]),S=u.length+h.length,f=i.filter(d=>d.status==="error").length,O=i.filter(d=>d.status==="warning").length;let x;f>0?x=f:O>0&&(x=O);const V=e.ogType==="article"||!!(e.articleAuthor||e.articlePublishedTime||e.articleModifiedTime||e.articleSection);return n("div",{class:"flex flex-col h-full",children:[n("div",{class:"flex items-center justify-between gap-3 px-4 py-2.5 border-b border-border shrink-0",children:[t("div",{class:"flex items-center gap-0",children:["preview","serp","tags","missing","jsonld"].map(d=>{const q={jsonld:"Structured Data",missing:"Missing",preview:"Social Previews",serp:"SERP",tags:"Meta Tags"}[d];let w;d==="missing"&&S>0?w=S:d==="jsonld"&&x!==void 0&&(w=x);let I;return d==="missing"?I=u.length>0?"destructive":"warning":I=f>0?"destructive":"warning",n("button",{class:y("flex items-center gap-1.5 px-3 py-1.5 text-[0.75rem] font-medium border-0 cursor-pointer transition-colors capitalize",c===d?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:a(()=>{g(d)},"onClick"),type:"button",children:[q,w!==void 0&&t(K,{class:"text-[0.58rem] min-w-[1.1rem] text-center",variant:I,children:w})]},d)})}),t(B,{onClick:p,size:"sm",variant:"outline",children:"Refresh"})]}),n("div",{class:"flex-1 overflow-auto",children:[c==="preview"&&t("div",{class:"p-4 grid grid-cols-2 gap-4",children:ye.map(d=>t(be,{meta:e,platform:d},d.id))}),c==="serp"&&t("div",{class:"p-4",children:t(qe,{meta:e})}),c==="tags"&&n("div",{class:"p-5 space-y-5",children:[n("div",{children:[t(k,{children:"Basic"}),t("div",{class:"border border-border bg-card",children:n("div",{class:"px-4",children:[t(m,{label:"title",required:!0,value:e.title}),t(m,{label:"description",required:!0,value:e.description}),t(m,{label:"canonical",value:e.canonical})]})})]}),n("div",{children:[t(k,{children:"Open Graph"}),t("div",{class:"border border-border bg-card",children:n("div",{class:"px-4",children:[t(m,{label:"og:title",required:!0,value:e.ogTitle}),t(m,{label:"og:description",required:!0,value:e.ogDescription}),t(m,{label:"og:image",required:!0,value:e.ogImage}),t(m,{label:"og:image:alt",value:e.ogImageAlt}),t(m,{label:"og:url",value:e.ogUrl}),t(m,{label:"og:type",value:e.ogType}),t(m,{label:"og:site_name",value:e.ogSiteName}),t(m,{label:"og:locale",value:e.ogLocale})]})})]}),V&&n("div",{children:[t(k,{children:"Article"}),t("div",{class:"border border-border bg-card",children:n("div",{class:"px-4",children:[t(m,{label:"article:author",value:e.articleAuthor}),t(m,{label:"article:published_time",value:e.articlePublishedTime}),t(m,{label:"article:modified_time",value:e.articleModifiedTime}),t(m,{label:"article:section",value:e.articleSection})]})})]}),n("div",{children:[t(k,{children:"X / Twitter"}),t("div",{class:"border border-border bg-card",children:n("div",{class:"px-4",children:[t(m,{label:"twitter:card",required:!0,value:e.twitterCard}),t(m,{label:"twitter:title",value:e.twitterTitle}),t(m,{label:"twitter:description",value:e.twitterDescription}),t(m,{label:"twitter:image",value:e.twitterImage}),t(m,{label:"twitter:image:alt",value:e.twitterImageAlt}),t(m,{label:"twitter:site",value:e.twitterSite}),t(m,{label:"twitter:creator",value:e.twitterCreator})]})})]})]}),c==="jsonld"&&t("div",{class:"p-5 space-y-3",children:i.length===0?n("div",{class:"flex flex-col items-center justify-center py-12 gap-3",children:[t("div",{class:"size-10 border border-border flex items-center justify-center text-muted-foreground/40 text-lg select-none",children:"{}"}),t("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"No structured data found"}),n("p",{class:"text-[0.7rem] text-muted-foreground text-center max-w-xs leading-relaxed",children:["Add a ",t("code",{class:"font-mono bg-foreground/6 px-1",children:'<script type="application/ld+json">'})," block to help search engines understand your content."]})]}):n(E,{children:[n("div",{class:"flex items-center justify-between mb-1",children:[n("p",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground",children:[i.length," schema",i.length===1?"":"s"," detected"]}),f>0&&n("span",{class:"text-[0.65rem] text-destructive font-medium",children:[f," error",f===1?"":"s"]})]}),i.map((d,q)=>t(ve,{schema:d},q))]})}),c==="missing"&&t("div",{class:"p-5 space-y-5",children:S===0?n("div",{class:"flex flex-col items-center justify-center py-12 gap-3",children:[t("div",{class:"size-10 border border-success/30 bg-success/8 flex items-center justify-center text-success text-lg select-none",children:"✓"}),t("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"All recommended tags are present"}),t("p",{class:"text-[0.7rem] text-muted-foreground",children:"Your page has all required and recommended meta tags."})]}):n(E,{children:[u.length>0&&n("div",{children:[n("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-destructive/80 mb-2 flex items-center gap-1.5",children:[t("span",{children:"Required"}),t("span",{class:"bg-destructive/10 border border-destructive/25 text-destructive px-1 font-bold",children:u.length})]}),t("div",{class:"space-y-2",children:u.map(d=>t(U,{def:d},d.key))})]}),h.length>0&&n("div",{children:[n("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-warning/80 mb-2 flex items-center gap-1.5",children:[t("span",{children:"Recommended"}),t("span",{class:"bg-warning/10 border border-warning/25 text-warning px-1 font-bold",children:h.length})]}),t("div",{class:"space-y-2",children:h.map(d=>t(U,{def:d},d.key))})]})]})})]})]})},"SeoApp"),Ee={component:Ie,icon:Q,id:"dev-toolbar:seo",name:"SEO"};export{Ee as default};
package/dist/index.d.ts CHANGED
@@ -1,54 +1,11 @@
1
1
  import { D as DevToolbarApp, T as ToolbarSettings } from "./packem_shared/app.d-SmKEDxsI.js";
2
2
  export { A as AppView, b as DEFAULT_TOOLBAR_SETTINGS, a as DevToolbarAppState, F as FrameState, N as NotificationLevel, P as PositionAnchor, S as ServerFunctions, c as ServerHelpers, d as ToolbarAppEventTarget, e as ToolbarPlacement } from "./packem_shared/app.d-SmKEDxsI.js";
3
- import { T as TimelineEvent, D as DevToolbarHook, C as ClientFunctions, a as ClientRPCContext, S as ServerFunctions, b as ServerRPCContext, c as TimelineGroup } from "./packem_shared/global-api.d-BLfn-OUA.js";
4
- export { A as AccessibilityInfo, d as Annotation, e as AnnotationIntent, f as AnnotationSeverity, g as AnnotationStatus, B as BoundingBox, h as CreateAnnotationData, i as DEFAULT_TIMELINE_GROUPS, F as FrameworkContext, H as HookEvents, j as ThreadMessage, k as TimelineEventLevel, U as UpdateAnnotationData, V as VisulimaDevTools } from "./packem_shared/global-api.d-BLfn-OUA.js";
3
+ import { T as TimelineEvent, D as DevToolbarHook, C as ClientFunctions, a as ClientRPCContext, S as ServerFunctions, b as ServerRPCContext, c as TimelineGroup } from "./packem_shared/global-api.d-DG2WYakl.js";
4
+ export { A as AccessibilityInfo, d as Annotation, e as AnnotationIntent, f as AnnotationSeverity, g as AnnotationStatus, B as BoundingBox, h as CreateAnnotationData, i as DEFAULT_TIMELINE_GROUPS, F as FrameworkContext, H as HookEvents, j as ThreadMessage, k as TimelineEventLevel, U as UpdateAnnotationData, V as VisulimaDevTools } from "./packem_shared/global-api.d-DG2WYakl.js";
5
5
  import { ViteDevServer } from 'vite';
6
6
  export { DevToolbar } from "./toolbar/index.js";
7
7
  import 'preact';
8
8
  /**
9
- * Message channel interface for bidirectional communication
10
- */
11
- interface MessageChannel<TEvents extends Record<string, (...args: any[]) => void>> {
12
- /**
13
- * Unsubscribe from an event
14
- * @param event Event name
15
- * @param handler Optional specific handler to remove
16
- */
17
- off: <K extends keyof TEvents>(event: K, handler?: TEvents[K]) => void;
18
- /**
19
- * Subscribe to an event
20
- * @param event Event name
21
- * @param handler Event handler
22
- * @returns Unsubscribe function
23
- */
24
- on: <K extends keyof TEvents>(event: K, handler: TEvents[K]) => () => void;
25
- /**
26
- * Subscribe to an event once
27
- * @param event Event name
28
- * @param handler Event handler
29
- */
30
- once: <K extends keyof TEvents>(event: K, handler: TEvents[K]) => void;
31
- /**
32
- * Send a message/event
33
- * @param event Event name
34
- * @param data Event data
35
- */
36
- send: <K extends keyof TEvents>(event: K, ...args: Parameters<TEvents[K]>) => void;
37
- }
38
- /**
39
- * Channel factory function
40
- */
41
- type ChannelFactory<TEvents extends Record<string, (...args: any[]) => void>> = () => MessageChannel<TEvents>;
42
- /**
43
- * Factory result providing a method to instantiate named message channels.
44
- */
45
- interface MessageChannelContext<TEvents extends Record<string, (...args: any[]) => void>> {
46
- /**
47
- * Creates and returns a new channel instance.
48
- */
49
- createChannel: () => MessageChannel<TEvents>;
50
- }
51
- /**
52
9
  * Creates a dev toolbar hook instance.
53
10
  * @param onRegisterApp Callback when app is registered.
54
11
  * @param onTimelineEvent Callback when timeline event is added.
@@ -125,6 +82,49 @@ declare class TimelineStore {
125
82
  */
126
83
  declare const getTimelineStore: () => TimelineStore;
127
84
  /**
85
+ * Message channel interface for bidirectional communication
86
+ */
87
+ interface MessageChannel<TEvents extends Record<string, (...args: any[]) => void>> {
88
+ /**
89
+ * Unsubscribe from an event
90
+ * @param event Event name
91
+ * @param handler Optional specific handler to remove
92
+ */
93
+ off: <K extends keyof TEvents>(event: K, handler?: TEvents[K]) => void;
94
+ /**
95
+ * Subscribe to an event
96
+ * @param event Event name
97
+ * @param handler Event handler
98
+ * @returns Unsubscribe function
99
+ */
100
+ on: <K extends keyof TEvents>(event: K, handler: TEvents[K]) => () => void;
101
+ /**
102
+ * Subscribe to an event once
103
+ * @param event Event name
104
+ * @param handler Event handler
105
+ */
106
+ once: <K extends keyof TEvents>(event: K, handler: TEvents[K]) => void;
107
+ /**
108
+ * Send a message/event
109
+ * @param event Event name
110
+ * @param data Event data
111
+ */
112
+ send: <K extends keyof TEvents>(event: K, ...args: Parameters<TEvents[K]>) => void;
113
+ }
114
+ /**
115
+ * Channel factory function
116
+ */
117
+ type ChannelFactory<TEvents extends Record<string, (...args: any[]) => void>> = () => MessageChannel<TEvents>;
118
+ /**
119
+ * Factory result providing a method to instantiate named message channels.
120
+ */
121
+ interface MessageChannelContext<TEvents extends Record<string, (...args: any[]) => void>> {
122
+ /**
123
+ * Creates and returns a new channel instance.
124
+ */
125
+ createChannel: () => MessageChannel<TEvents>;
126
+ }
127
+ /**
128
128
  * Loads settings from localStorage, merging with defaults.
129
129
  * @returns Toolbar settings.
130
130
  */
@@ -1,5 +1,5 @@
1
1
  import { D as DevToolbarApp, a as DevToolbarAppState } from "../packem_shared/app.d-SmKEDxsI.js";
2
- import "../packem_shared/global-api.d-BLfn-OUA.js";
2
+ import "../packem_shared/global-api.d-DG2WYakl.js";
3
3
  import 'vite';
4
4
  import 'preact';
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from 'vite';
2
2
  import { D as DevToolbarApp, S as ServerFunctions } from "./packem_shared/app.d-SmKEDxsI.js";
3
- import "./packem_shared/global-api.d-BLfn-OUA.js";
3
+ import "./packem_shared/global-api.d-DG2WYakl.js";
4
4
  import '@babel/generator';
5
5
  import 'preact';
6
6
  interface InjectSourceIgnore {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/dev-toolbar",
3
- "version": "1.0.0-alpha.26",
3
+ "version": "1.0.0-alpha.28",
4
4
  "description": "Devtools is a set of tools for building advanced devtools for your application",
5
5
  "keywords": [
6
6
  "dev-toolbar",
@@ -1,162 +1,6 @@
1
1
  import { D as DevToolbarApp, T as ToolbarSettings } from "./app.d-SmKEDxsI.js";
2
2
  import { ViteDevServer } from 'vite';
3
3
  /**
4
- * Annotation intent — describes what the user wants to communicate.
5
- */
6
- type AnnotationIntent = "approve" | "change" | "fix" | "question";
7
- /**
8
- * Annotation severity — how urgent or important the annotation is.
9
- */
10
- type AnnotationSeverity = "blocking" | "important" | "suggestion";
11
- /**
12
- * Annotation status — lifecycle state.
13
- */
14
- type AnnotationStatus = "acknowledged" | "dismissed" | "pending" | "resolved";
15
- /**
16
- * A single message in a conversation thread attached to an annotation.
17
- */
18
- interface ThreadMessage {
19
- /** Message text */
20
- content: string;
21
- /** Unique message identifier */
22
- id?: string;
23
- /** Who wrote it — e.g. "human", "agent", or a specific agent name */
24
- role: string;
25
- /** ISO 8601 timestamp */
26
- timestamp: string;
27
- }
28
- /**
29
- * Bounding box of the annotated element relative to the viewport.
30
- */
31
- interface BoundingBox {
32
- height: number;
33
- width: number;
34
- x: number;
35
- y: number;
36
- }
37
- /**
38
- * Detected framework component information.
39
- */
40
- interface FrameworkContext {
41
- /** Component name */
42
- componentName?: string;
43
- /** Full component stack (e.g. ["App", "Layout", "Header", "Button"]) */
44
- componentStack?: string[];
45
- /** Additional framework-specific data (e.g. props) */
46
- data?: Record<string, unknown>;
47
- /** Framework identifier (react, vue, svelte, etc.) */
48
- framework: string;
49
- /** Source file path */
50
- sourceFile?: string;
51
- /** Source line number */
52
- sourceLine?: number;
53
- }
54
- /**
55
- * Captured accessibility attributes for an element.
56
- */
57
- interface AccessibilityInfo {
58
- /** aria-describedby content */
59
- ariaDescribedBy?: string;
60
- /** aria-label value */
61
- ariaLabel?: string;
62
- /** Whether the element is focusable */
63
- focusable: boolean;
64
- /** ARIA role (explicit or implicit) */
65
- role?: string;
66
- /** tabindex value */
67
- tabindex?: number;
68
- }
69
- /**
70
- * A visual annotation placed on a page element during development.
71
- * Stored in `.devtoolbar/annotations.json`.
72
- */
73
- interface Annotation {
74
- /** Captured accessibility attributes */
75
- accessibility?: AccessibilityInfo;
76
- /** Element bounding box at annotation time */
77
- boundingBox?: BoundingBox;
78
- /** User feedback / description */
79
- comment: string;
80
- /** Key computed CSS properties for forensic context */
81
- computedStyles?: string;
82
- /** ISO 8601 creation timestamp */
83
- createdAt: string;
84
- /** CSS classes on the annotated element (module hashes cleaned) */
85
- cssClasses?: string;
86
- /** Bounding boxes for multi-select annotations */
87
- elementBoundingBoxes?: BoundingBox[];
88
- /** Human-readable element label (e.g. 'button "Submit"') */
89
- elementLabel?: string;
90
- /** CSS selector path to the element */
91
- elementPath?: string;
92
- /** HTML tag name of the annotated element */
93
- elementTag: string;
94
- /** Detected framework component context */
95
- frameworkContext?: FrameworkContext;
96
- /** Full DOM ancestry path (e.g. "body > main > article > p") */
97
- fullPath?: string;
98
- /** Unique identifier (crypto.randomUUID) */
99
- id: string;
100
- /** What the user wants — fix, change, question, or approve */
101
- intent: AnnotationIntent;
102
- /** Whether the element has fixed/sticky positioning */
103
- isFixed?: boolean;
104
- /** Whether this is a multi-select (drag) annotation */
105
- isMultiSelect?: boolean;
106
- /** Sibling elements for spatial context */
107
- nearbyElements?: string;
108
- /** Text near the annotated element for additional context */
109
- nearbyText?: string;
110
- /** ISO 8601 resolution timestamp */
111
- resolvedAt?: string;
112
- /** Who resolved it — "human" or "agent" (or a specific agent name) */
113
- resolvedBy?: string;
114
- /** Path to screenshot file relative to .devtoolbar/ (e.g. "screenshots/&lt;id>.png") */
115
- screenshot?: string;
116
- /** Text the user had selected when annotating */
117
- selectedText?: string;
118
- /** Severity level */
119
- severity: AnnotationSeverity;
120
- /** Source file location from data-vdt-source (file:line:col) */
121
- source?: string;
122
- /** Lifecycle status */
123
- status: AnnotationStatus;
124
- /** Conversation thread (human ↔ AI agent) */
125
- thread?: ThreadMessage[];
126
- /** ISO 8601 last-updated timestamp */
127
- updatedAt: string;
128
- /** Page URL where the annotation was created */
129
- url: string;
130
- /** Click X as percentage of viewport width (0-100) — survives resize */
131
- x: number;
132
- /**
133
- * Click Y as absolute page position (pixels from document top) — survives scroll.
134
- * For fixed/sticky elements, Y is viewport-relative instead.
135
- */
136
- y: number;
137
- }
138
- /**
139
- * Data required to create a new annotation (server-generated fields omitted).
140
- */
141
- type CreateAnnotationData = Omit<Annotation, "createdAt" | "id" | "resolvedAt" | "resolvedBy" | "status" | "thread" | "updatedAt">;
142
- /**
143
- * Fields that can be updated on an existing annotation.
144
- */
145
- interface UpdateAnnotationData {
146
- /** Updated comment text */
147
- comment?: string;
148
- /** Updated intent */
149
- intent?: AnnotationIntent;
150
- /** Who resolved the annotation */
151
- resolvedBy?: string;
152
- /** Updated severity */
153
- severity?: AnnotationSeverity;
154
- /** New status */
155
- status?: AnnotationStatus;
156
- /** Append a thread message */
157
- threadMessage?: ThreadMessage;
158
- }
159
- /**
160
4
  * Severity levels for timeline events.
161
5
  */
162
6
  type TimelineEventLevel = "info" | "warning" | "error";
@@ -328,6 +172,162 @@ interface TailwindConfigResult {
328
172
  version: "v3" | "v4" | "unknown";
329
173
  }
330
174
  /**
175
+ * Annotation intent — describes what the user wants to communicate.
176
+ */
177
+ type AnnotationIntent = "approve" | "change" | "fix" | "question";
178
+ /**
179
+ * Annotation severity — how urgent or important the annotation is.
180
+ */
181
+ type AnnotationSeverity = "blocking" | "important" | "suggestion";
182
+ /**
183
+ * Annotation status — lifecycle state.
184
+ */
185
+ type AnnotationStatus = "acknowledged" | "dismissed" | "pending" | "resolved";
186
+ /**
187
+ * A single message in a conversation thread attached to an annotation.
188
+ */
189
+ interface ThreadMessage {
190
+ /** Message text */
191
+ content: string;
192
+ /** Unique message identifier */
193
+ id?: string;
194
+ /** Who wrote it — e.g. "human", "agent", or a specific agent name */
195
+ role: string;
196
+ /** ISO 8601 timestamp */
197
+ timestamp: string;
198
+ }
199
+ /**
200
+ * Bounding box of the annotated element relative to the viewport.
201
+ */
202
+ interface BoundingBox {
203
+ height: number;
204
+ width: number;
205
+ x: number;
206
+ y: number;
207
+ }
208
+ /**
209
+ * Detected framework component information.
210
+ */
211
+ interface FrameworkContext {
212
+ /** Component name */
213
+ componentName?: string;
214
+ /** Full component stack (e.g. ["App", "Layout", "Header", "Button"]) */
215
+ componentStack?: string[];
216
+ /** Additional framework-specific data (e.g. props) */
217
+ data?: Record<string, unknown>;
218
+ /** Framework identifier (react, vue, svelte, etc.) */
219
+ framework: string;
220
+ /** Source file path */
221
+ sourceFile?: string;
222
+ /** Source line number */
223
+ sourceLine?: number;
224
+ }
225
+ /**
226
+ * Captured accessibility attributes for an element.
227
+ */
228
+ interface AccessibilityInfo {
229
+ /** aria-describedby content */
230
+ ariaDescribedBy?: string;
231
+ /** aria-label value */
232
+ ariaLabel?: string;
233
+ /** Whether the element is focusable */
234
+ focusable: boolean;
235
+ /** ARIA role (explicit or implicit) */
236
+ role?: string;
237
+ /** tabindex value */
238
+ tabindex?: number;
239
+ }
240
+ /**
241
+ * A visual annotation placed on a page element during development.
242
+ * Stored in `.devtoolbar/annotations.json`.
243
+ */
244
+ interface Annotation {
245
+ /** Captured accessibility attributes */
246
+ accessibility?: AccessibilityInfo;
247
+ /** Element bounding box at annotation time */
248
+ boundingBox?: BoundingBox;
249
+ /** User feedback / description */
250
+ comment: string;
251
+ /** Key computed CSS properties for forensic context */
252
+ computedStyles?: string;
253
+ /** ISO 8601 creation timestamp */
254
+ createdAt: string;
255
+ /** CSS classes on the annotated element (module hashes cleaned) */
256
+ cssClasses?: string;
257
+ /** Bounding boxes for multi-select annotations */
258
+ elementBoundingBoxes?: BoundingBox[];
259
+ /** Human-readable element label (e.g. 'button "Submit"') */
260
+ elementLabel?: string;
261
+ /** CSS selector path to the element */
262
+ elementPath?: string;
263
+ /** HTML tag name of the annotated element */
264
+ elementTag: string;
265
+ /** Detected framework component context */
266
+ frameworkContext?: FrameworkContext;
267
+ /** Full DOM ancestry path (e.g. "body > main > article > p") */
268
+ fullPath?: string;
269
+ /** Unique identifier (crypto.randomUUID) */
270
+ id: string;
271
+ /** What the user wants — fix, change, question, or approve */
272
+ intent: AnnotationIntent;
273
+ /** Whether the element has fixed/sticky positioning */
274
+ isFixed?: boolean;
275
+ /** Whether this is a multi-select (drag) annotation */
276
+ isMultiSelect?: boolean;
277
+ /** Sibling elements for spatial context */
278
+ nearbyElements?: string;
279
+ /** Text near the annotated element for additional context */
280
+ nearbyText?: string;
281
+ /** ISO 8601 resolution timestamp */
282
+ resolvedAt?: string;
283
+ /** Who resolved it — "human" or "agent" (or a specific agent name) */
284
+ resolvedBy?: string;
285
+ /** Path to screenshot file relative to .devtoolbar/ (e.g. "screenshots/&lt;id>.png") */
286
+ screenshot?: string;
287
+ /** Text the user had selected when annotating */
288
+ selectedText?: string;
289
+ /** Severity level */
290
+ severity: AnnotationSeverity;
291
+ /** Source file location from data-vdt-source (file:line:col) */
292
+ source?: string;
293
+ /** Lifecycle status */
294
+ status: AnnotationStatus;
295
+ /** Conversation thread (human ↔ AI agent) */
296
+ thread?: ThreadMessage[];
297
+ /** ISO 8601 last-updated timestamp */
298
+ updatedAt: string;
299
+ /** Page URL where the annotation was created */
300
+ url: string;
301
+ /** Click X as percentage of viewport width (0-100) — survives resize */
302
+ x: number;
303
+ /**
304
+ * Click Y as absolute page position (pixels from document top) — survives scroll.
305
+ * For fixed/sticky elements, Y is viewport-relative instead.
306
+ */
307
+ y: number;
308
+ }
309
+ /**
310
+ * Data required to create a new annotation (server-generated fields omitted).
311
+ */
312
+ type CreateAnnotationData = Omit<Annotation, "createdAt" | "id" | "resolvedAt" | "resolvedBy" | "status" | "thread" | "updatedAt">;
313
+ /**
314
+ * Fields that can be updated on an existing annotation.
315
+ */
316
+ interface UpdateAnnotationData {
317
+ /** Updated comment text */
318
+ comment?: string;
319
+ /** Updated intent */
320
+ intent?: AnnotationIntent;
321
+ /** Who resolved the annotation */
322
+ resolvedBy?: string;
323
+ /** Updated severity */
324
+ severity?: AnnotationSeverity;
325
+ /** New status */
326
+ status?: AnnotationStatus;
327
+ /** Append a thread message */
328
+ threadMessage?: ThreadMessage;
329
+ }
330
+ /**
331
331
  * Server-side RPC functions
332
332
  * These can be called from the client
333
333
  */