@githumbi/grabby 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- "use strict";(()=>{var pa=Object.defineProperty;var ba=(e,t)=>()=>(e&&(t=e(e=0)),t);var ga=(e,t)=>{for(var n in t)pa(e,n,{get:t[n],enumerable:!0})};var kr={};ga(kr,{createContext:()=>pr,destroyContext:()=>vr,domToBlob:()=>vl,domToCanvas:()=>ut,domToDataUrl:()=>Ne,domToForeignObjectSvg:()=>Cr,domToImage:()=>El,domToJpeg:()=>wl,domToPixel:()=>xl,domToPng:()=>Sl,domToSvg:()=>Tr,domToWebp:()=>Cl,loadMedia:()=>Ie,waitUntilLoad:()=>dr});function Zo(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function ls(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function cs(e){let t=-1;Qt||(Qt=ls());for(let n=0;n<e.length;n++)t=Qt[(t^e[n])&255]^t>>>8;return t^-1}function us(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===Jo&&e[n-2]===Qo&&e[n-1]===er&&e[n]===tr)return n-3;return 0}function nr(e,t,n=!1){let o=new Uint8Array(13);t*=39.3701,o[0]=Jo,o[1]=Qo,o[2]=er,o[3]=tr,o[4]=t>>>24,o[5]=t>>>16,o[6]=t>>>8,o[7]=t&255,o[8]=o[4],o[9]=o[5],o[10]=o[6],o[11]=o[7],o[12]=1;let r=cs(o),a=new Uint8Array(4);if(a[0]=r>>>24,a[1]=r>>>16,a[2]=r>>>8,a[3]=r&255,n){let i=us(e);return e.set(o,i),e.set(a,i+13),e}else{let i=new Uint8Array(4);i[0]=0,i[1]=0,i[2]=0,i[3]=9;let s=new Uint8Array(54);return s.set(e,0),s.set(i,33),s.set(o,37),s.set(a,50),s}}function ps(e){let t=e.indexOf(ds);return t===-1&&(t=e.indexOf(ms)),t===-1&&(t=e.indexOf(fs)),t}function Ls(e){let t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}function sr(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(fe&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!fe)return e;let n=lt().implementation.createHTMLDocument(),o=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(r),t&&(o.href=t),r.href=e,r.href}function lt(e){return(e&&q(e)?e?.ownerDocument:e)??window.document}function lr(e,t,n){let o=lt(n).createElementNS(ct,"svg");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),o}function cr(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}async function Ps(e,t="image/png",n=1){try{return await new Promise((o,r)=>{e.toBlob(a=>{a?o(a):r(new Error("Blob is null"))},t,n)})}catch(o){if(rr)return Ms(e.toDataURL(t,n));throw o}}function Ms(e){let[t,n]=e.split(","),o=t.match(/data:(.+);/)?.[1]??void 0,r=window.atob(n),a=r.length,i=new Uint8Array(a);for(let s=0;s<a;s+=1)i[s]=r.charCodeAt(s);return new Blob([i],{type:o})}function ur(e,t){return new Promise((n,o)=>{let r=new FileReader;r.onload=()=>n(r.result),r.onerror=()=>o(r.error),r.onabort=()=>o(new Error(`Failed read blob to ${t}`)),t==="dataUrl"?r.readAsDataURL(e):t==="arrayBuffer"&&r.readAsArrayBuffer(e)})}function Se(e,t){let n=lt(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function Ie(e,t){return new Promise(n=>{let{timeout:o,ownerDocument:r,onError:a,onWarn:i}=t??{},s=typeof e=="string"?Se(e,lt(r)):e,u=null,l=null;function c(){n(s),u&&clearTimeout(u),l?.()}if(o&&(u=setTimeout(c,o)),st(s)){let m=s.currentSrc||s.src;if(!m)return s.poster?Ie(s.poster,t).then(n):c();if(s.readyState>=2)return c();let f=c,p=g=>{i?.("Failed video load",m,g),a?.(g),c()};l=()=>{s.removeEventListener("loadeddata",f),s.removeEventListener("error",p)},s.addEventListener("loadeddata",f,{once:!0}),s.addEventListener("error",p,{once:!0})}else{let m=ir(s)?s.href.baseVal:s.currentSrc||s.src;if(!m)return c();let f=async()=>{if(Re(s)&&"decode"in s)try{await s.decode()}catch(g){i?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||m,g)}c()},p=g=>{i?.("Failed image load",s.dataset.originalSrc||m,g),c()};if(Re(s)&&s.complete)return f();l=()=>{s.removeEventListener("load",f),s.removeEventListener("error",p)},s.addEventListener("load",f,{once:!0}),s.addEventListener("error",p,{once:!0})}})}async function dr(e,t){Ge(e)&&(Re(e)||st(e)?await Ie(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(o=>Ie(o,t)))))}function fr(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function Fs(e){let t=`${or}[#${jo}]`;return jo++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&$s(...n)}}function Hs(e){return{cache:e?"no-cache":"force-cache"}}async function Z(e,t){return hs(e)?e:pr(e,{...t,autoDestruct:!0})}async function pr(e,t){let{scale:n=1,workerUrl:o,workerNumber:r=1}=t||{},a=!!t?.debug,i=t?.features??!0,s=e.ownerDocument??(fe?window.document:void 0),u=e.ownerDocument?.defaultView??(fe?window:void 0),l=new Map,c={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:Hs(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:r,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:Fs(a),node:e,ownerDocument:s,ownerWindow:u,dpi:n===1?null:96*n,svgStyleElement:br(s),svgDefsElement:s?.createElementNS(ct,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:bs&&o&&r?r:0})].map(()=>{try{let p=new Worker(o);return p.onmessage=async g=>{let{url:b,result:E}=g.data;E?l.get(b)?.resolve?.(E):l.get(b)?.reject?.(new Error(`Error receiving message from worker: ${b}`))},p.onmessageerror=g=>{let{url:b}=g.data;l.get(b)?.reject?.(new Error(`Error receiving message from worker: ${b}`))},p}catch(p){return c.log.warn("Failed to new Worker",p),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Ls(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:i,isEnable:p=>p==="restoreScrollPosition"?typeof i=="boolean"?!1:i[p]??!1:typeof i=="boolean"?i:i[p]??!0,shadowRoots:[]};c.log.time("wait until load"),await dr(e,{timeout:c.timeout,onWarn:c.log.warn}),c.log.timeEnd("wait until load");let{width:m,height:f}=Us(e,c);return c.width=m,c.height=f,c}function br(e){if(!e)return;let t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
1
+ "use strict";(()=>{var Ia=Object.defineProperty;var La=(e,t)=>()=>(e&&(t=e(e=0)),t);var Na=(e,t)=>{for(var n in t)Ia(e,n,{get:t[n],enumerable:!0})};var Dr={};Na(Dr,{createContext:()=>Tr,destroyContext:()=>Ir,domToBlob:()=>Ul,domToCanvas:()=>bt,domToDataUrl:()=>Me,domToForeignObjectSvg:()=>Mr,domToImage:()=>Bl,domToJpeg:()=>Gl,domToPixel:()=>Vl,domToPng:()=>zl,domToSvg:()=>Or,domToWebp:()=>Kl,loadMedia:()=>Pe,waitUntilLoad:()=>wr});function lr(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function Rs(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function Is(e){let t=-1;rn||(rn=Rs());for(let n=0;n<e.length;n++)t=rn[(t^e[n])&255]^t>>>8;return t^-1}function Ls(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===cr&&e[n-2]===ur&&e[n-1]===dr&&e[n]===mr)return n-3;return 0}function fr(e,t,n=!1){let o=new Uint8Array(13);t*=39.3701,o[0]=cr,o[1]=ur,o[2]=dr,o[3]=mr,o[4]=t>>>24,o[5]=t>>>16,o[6]=t>>>8,o[7]=t&255,o[8]=o[4],o[9]=o[5],o[10]=o[6],o[11]=o[7],o[12]=1;let r=Is(o),a=new Uint8Array(4);if(a[0]=r>>>24,a[1]=r>>>16,a[2]=r>>>8,a[3]=r&255,n){let i=Ls(e);return e.set(o,i),e.set(a,i+13),e}else{let i=new Uint8Array(4);i[0]=0,i[1]=0,i[2]=0,i[3]=9;let s=new Uint8Array(54);return s.set(e,0),s.set(i,33),s.set(o,37),s.set(a,50),s}}function Ms(e){let t=e.indexOf(Ns);return t===-1&&(t=e.indexOf($s)),t===-1&&(t=e.indexOf(Ps)),t}function el(e){let t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}function yr(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(be&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!be)return e;let n=ft().implementation.createHTMLDocument(),o=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(r),t&&(o.href=t),r.href=e,r.href}function ft(e){return(e&&J(e)?e?.ownerDocument:e)??window.document}function vr(e,t,n){let o=ft(n).createElementNS(pt,"svg");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),o}function Er(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}async function tl(e,t="image/png",n=1){try{return await new Promise((o,r)=>{e.toBlob(a=>{a?o(a):r(new Error("Blob is null"))},t,n)})}catch(o){if(br)return nl(e.toDataURL(t,n));throw o}}function nl(e){let[t,n]=e.split(","),o=t.match(/data:(.+);/)?.[1]??void 0,r=window.atob(n),a=r.length,i=new Uint8Array(a);for(let s=0;s<a;s+=1)i[s]=r.charCodeAt(s);return new Blob([i],{type:o})}function xr(e,t){return new Promise((n,o)=>{let r=new FileReader;r.onload=()=>n(r.result),r.onerror=()=>o(r.error),r.onabort=()=>o(new Error(`Failed read blob to ${t}`)),t==="dataUrl"?r.readAsDataURL(e):t==="arrayBuffer"&&r.readAsArrayBuffer(e)})}function Se(e,t){let n=ft(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function Pe(e,t){return new Promise(n=>{let{timeout:o,ownerDocument:r,onError:a,onWarn:i}=t??{},s=typeof e=="string"?Se(e,ft(r)):e,l=null,u=null;function d(){n(s),l&&clearTimeout(l),u?.()}if(o&&(l=setTimeout(d,o)),mt(s)){let f=s.currentSrc||s.src;if(!f)return s.poster?Pe(s.poster,t).then(n):d();if(s.readyState>=2)return d();let h=d,c=p=>{i?.("Failed video load",f,p),a?.(p),d()};u=()=>{s.removeEventListener("loadeddata",h),s.removeEventListener("error",c)},s.addEventListener("loadeddata",h,{once:!0}),s.addEventListener("error",c,{once:!0})}else{let f=hr(s)?s.href.baseVal:s.currentSrc||s.src;if(!f)return d();let h=async()=>{if($e(s)&&"decode"in s)try{await s.decode()}catch(p){i?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||f,p)}d()},c=p=>{i?.("Failed image load",s.dataset.originalSrc||f,p),d()};if($e(s)&&s.complete)return h();u=()=>{s.removeEventListener("load",h),s.removeEventListener("error",c)},s.addEventListener("load",h,{once:!0}),s.addEventListener("error",c,{once:!0})}})}async function wr(e,t){je(e)&&($e(e)||mt(e)?await Pe(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(o=>Pe(o,t)))))}function Cr(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function al(e){let t=`${pr}[#${nr}]`;return nr++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&Qs(...n)}}function il(e){return{cache:e?"no-cache":"force-cache"}}async function Q(e,t){return Fs(e)?e:Tr(e,{...t,autoDestruct:!0})}async function Tr(e,t){let{scale:n=1,workerUrl:o,workerNumber:r=1}=t||{},a=!!t?.debug,i=t?.features??!0,s=e.ownerDocument??(be?window.document:void 0),l=e.ownerDocument?.defaultView??(be?window:void 0),u=new Map,d={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:il(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:r,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:al(a),node:e,ownerDocument:s,ownerWindow:l,dpi:n===1?null:96*n,svgStyleElement:kr(s),svgDefsElement:s?.createElementNS(pt,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Os&&o&&r?r:0})].map(()=>{try{let c=new Worker(o);return c.onmessage=async p=>{let{url:g,result:y}=p.data;y?u.get(g)?.resolve?.(y):u.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},c.onmessageerror=p=>{let{url:g}=p.data;u.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},c}catch(c){return d.log.warn("Failed to new Worker",c),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[el(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:u,drawImageCount:0,tasks:[],features:i,isEnable:c=>c==="restoreScrollPosition"?typeof i=="boolean"?!1:i[c]??!1:typeof i=="boolean"?i:i[c]??!0,shadowRoots:[]};d.log.time("wait until load"),await wr(e,{timeout:d.timeout,onWarn:d.log.warn}),d.log.timeEnd("wait until load");let{width:f,height:h}=sl(e,d);return d.width=f,d.height=h,d}function kr(e){if(!e)return;let t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
2
2
  .______background-clip--text {
3
3
  background-clip: text;
4
4
  -webkit-background-clip: text;
5
5
  }
6
- `);return t.appendChild(n),t}function Us(e,t){let{width:n,height:o}=t;if(q(e)&&(!n||!o)){let r=e.getBoundingClientRect();n=n||r.width||Number(e.getAttribute("width"))||0,o=o||r.height||Number(e.getAttribute("height"))||0}return{width:n,height:o}}async function Bs(e,t){let{log:n,timeout:o,drawImageCount:r,drawImageInterval:a}=t;n.time("image to canvas");let i=await Ie(e,{timeout:o,onWarn:t.log.warn}),{canvas:s,context2d:u}=Gs(e.ownerDocument,t),l=()=>{try{u?.drawImage(i,0,0,s.width,s.height)}catch(c){t.log.warn("Failed to drawImage",c)}};if(l(),t.isEnable("fixSvgXmlDecode"))for(let c=0;c<r;c++)await new Promise(m=>{setTimeout(()=>{u?.clearRect(0,0,s.width,s.height),l(),m()},c+a)});return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function Gs(e,t){let{width:n,height:o,scale:r,backgroundColor:a,maximumCanvasSize:i}=t,s=e.createElement("canvas");s.width=Math.floor(n*r),s.height=Math.floor(o*r),s.style.width=`${n}px`,s.style.height=`${o}px`,i&&(s.width>i||s.height>i)&&(s.width>i&&s.height>i?s.width>s.height?(s.height*=i/s.width,s.width=i):(s.width*=i/s.height,s.height=i):s.width>i?(s.height*=i/s.width,s.width=i):(s.width*=i/s.height,s.height=i));let u=s.getContext("2d");return u&&a&&(u.fillStyle=a,u.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:u}}function gr(e,t){if(e.ownerDocument)try{let a=e.toDataURL();if(a!=="data:,")return Se(a,e.ownerDocument)}catch(a){t.log.warn("Failed to clone canvas",a)}let n=e.cloneNode(!1),o=e.getContext("2d"),r=n.getContext("2d");try{return o&&r&&r.putImageData(o.getImageData(0,0,e.width,e.height),0,0),n}catch(a){t.log.warn("Failed to clone canvas",a)}return n}function Vs(e,t){try{if(e?.contentDocument?.documentElement)return rn(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}function zs(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function js(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Se(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let o=n.ownerDocument;if(o){let r=!0;if(await Ie(n,{onError:()=>r=!1,onWarn:t.log.warn}),!r)return e.poster?Se(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(i=>{n.addEventListener("seeked",i,{once:!0})});let a=o.createElement("canvas");a.width=e.offsetWidth,a.height=e.offsetHeight;try{let i=a.getContext("2d");i&&i.drawImage(n,0,0,a.width,a.height)}catch(i){return t.log.warn("Failed to clone video",i),e.poster?Se(e.poster,e.ownerDocument):n}return gr(a,t)}return n}function Ks(e,t){return Cs(e)?gr(e,t):Ns(e)?Vs(e,t):Re(e)?zs(e):st(e)?js(e,t):e.cloneNode(!1)}function Ws(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${mr()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",n.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(o){e.log.warn("Failed to getSandBox",o)}}return t}function hr(e,t,n){let{defaultComputedStyles:o}=n,r=e.nodeName.toLowerCase(),a=ze(e)&&r!=="svg",i=a?Xs.map(b=>[b,e.getAttribute(b)]).filter(([,b])=>b!==null):[],s=[a&&"svg",r,i.map((b,E)=>`${b}=${E}`).join(","),t].filter(Boolean).join(":");if(o.has(s))return o.get(s);let l=Ws(n)?.contentWindow;if(!l)return new Map;let c=l?.document,m,f;a?(m=c.createElementNS(ct,"svg"),f=m.ownerDocument.createElementNS(m.namespaceURI,r),i.forEach(([b,E])=>{f.setAttributeNS(null,b,E)}),m.appendChild(f)):m=f=c.createElement(r),f.textContent=" ",c.body.appendChild(m);let p=l.getComputedStyle(f,t),g=new Map;for(let b=p.length,E=0;E<b;E++){let w=p.item(E);Ys.includes(w)||g.set(w,p.getPropertyValue(w))}return c.body.removeChild(m),o.set(s,g),g}function yr(e,t,n){let o=new Map,r=[],a=new Map;if(n)for(let s of n)i(s);else for(let s=e.length,u=0;u<s;u++){let l=e.item(u);i(l)}for(let s=r.length,u=0;u<s;u++)a.get(r[u])?.forEach((l,c)=>o.set(c,l));function i(s){let u=e.getPropertyValue(s),l=e.getPropertyPriority(s),c=s.lastIndexOf("-"),m=c>-1?s.substring(0,c):void 0;if(m){let f=a.get(m);f||(f=new Map,a.set(m,f)),f.set(s,[u,l])}t.get(s)===u&&!l||(m?r.push(m):o.set(s,[u,l]))}return o}function qs(e,t,n,o){let{ownerWindow:r,includeStyleProperties:a,currentParentNodeStyle:i}=o,s=t.style,u=r.getComputedStyle(e),l=hr(e,null,o);i?.forEach((m,f)=>{l.delete(f)});let c=yr(u,l,a);c.delete("transition-property"),c.delete("all"),c.delete("d"),c.delete("content"),n&&(c.delete("position"),c.delete("margin-top"),c.delete("margin-right"),c.delete("margin-bottom"),c.delete("margin-left"),c.delete("margin-block-start"),c.delete("margin-block-end"),c.delete("margin-inline-start"),c.delete("margin-inline-end"),c.set("box-sizing",["border-box",""])),c.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),ar&&(c.has("font-kerning")||c.set("font-kerning",["normal",""]),(c.get("overflow-x")?.[0]==="hidden"||c.get("overflow-y")?.[0]==="hidden")&&c.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&c.set("text-overflow",["clip",""]));for(let m=s.length,f=0;f<m;f++)s.removeProperty(s.item(f));return c.forEach(([m,f],p)=>{s.setProperty(p,m,f)}),c}function Zs(e,t){(Ts(e)||ks(e)||Rs(e))&&t.setAttribute("value",e.value)}function el(e,t,n,o,r){let{ownerWindow:a,svgStyleElement:i,svgStyles:s,currentNodeStyle:u}=o;if(!i||!a)return;function l(c){let m=a.getComputedStyle(e,c),f=m.getPropertyValue("content");if(!f||f==="none")return;r?.(f),f=f.replace(/(')|(")|(counter\(.+\))/g,"");let p=[mr()],g=hr(e,c,o);u?.forEach((v,y)=>{g.delete(y)});let b=yr(m,g,o.includeStyleProperties);b.delete("content"),b.delete("-webkit-locale"),b.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let E=[`content: '${f}';`];if(b.forEach(([v,y],T)=>{E.push(`${T}: ${v}${y?" !important":""};`)}),E.length===1)return;try{t.className=[t.className,...p].join(" ")}catch(v){o.log.warn("Failed to copyPseudoClass",v);return}let w=E.join(`
7
- `),h=s.get(w);h||(h=[],s.set(w,h)),h.push(`.${p[0]}${c}`)}Js.forEach(l),n&&Qs.forEach(l)}async function Wo(e,t,n,o,r){if(q(n)&&(As(n)||_s(n))||o.filter&&!o.filter(n))return;Ko.has(t.nodeName)||Ko.has(n.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;let a=await rn(n,o,!1,r);o.isEnable("restoreScrollPosition")&&tl(e,a),t.appendChild(a)}async function Yo(e,t,n,o){let r=e.firstChild;q(e)&&e.shadowRoot&&(r=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let a=r;a;a=a.nextSibling)if(!xs(a))if(q(a)&&Is(a)&&typeof a.assignedNodes=="function"){let i=a.assignedNodes();for(let s=0;s<i.length;s++)await Wo(e,t,i[s],n,o)}else await Wo(e,t,a,n,o)}function tl(e,t){if(!Ge(e)||!Ge(t))return;let{scrollTop:n,scrollLeft:o}=e;if(!n&&!o)return;let{transform:r}=t.style,a=new DOMMatrix(r),{a:i,b:s,c:u,d:l}=a;a.a=1,a.b=0,a.c=0,a.d=1,a.translateSelf(-o,-n),a.a=i,a.b=s,a.c=u,a.d=l,t.style.transform=a.toString()}function nl(e,t){let{backgroundColor:n,width:o,height:r,style:a}=t,i=e.style;if(n&&i.setProperty("background-color",n,"important"),o&&i.setProperty("width",`${o}px`,"important"),r&&i.setProperty("height",`${r}px`,"important"),a)for(let s in a)i[s]=a[s]}async function rn(e,t,n=!1,o){let{ownerDocument:r,ownerWindow:a,fontFamilies:i,onCloneEachNode:s}=t;if(r&&Ss(e))return o&&/\S/.test(e.data)&&o(e.data),r.createTextNode(e.data);if(r&&a&&q(e)&&(Ge(e)||ze(e))){let l=await Ks(e,t);if(t.isEnable("removeAbnormalAttributes")){let b=l.getAttributeNames();for(let E=b.length,w=0;w<E;w++){let h=b[w];ol.test(h)||l.removeAttribute(h)}}let c=t.currentNodeStyle=qs(e,l,n,t);n&&nl(l,t);let m=!1;if(t.isEnable("copyScrollbar")){let b=[c.get("overflow-x")?.[0],c.get("overflow-y")?.[0]];m=b.includes("scroll")||(b.includes("auto")||b.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let f=c.get("text-transform")?.[0],p=fr(c.get("font-family")?.[0]),g=p?b=>{f==="uppercase"?b=b.toUpperCase():f==="lowercase"?b=b.toLowerCase():f==="capitalize"&&(b=b[0].toUpperCase()+b.substring(1)),p.forEach(E=>{let w=i.get(E);w||i.set(E,w=new Set),b.split("").forEach(h=>w.add(h))})}:void 0;return el(e,l,m,t,g),Zs(e,l),st(e)||await Yo(e,l,t,g),await s?.(l),l}let u=e.cloneNode(!1);return await Yo(e,u,t),await s?.(u),u}function vr(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn("Failed to destroyContext",t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function rl(e){let{url:t,timeout:n,responseType:o,...r}=e,a=new AbortController,i=n?setTimeout(()=>a.abort(),n):void 0;return fetch(t,{signal:a.signal,...r}).then(s=>{if(!s.ok)throw new Error("Failed fetch, not 2xx response",{cause:s});switch(o){case"arrayBuffer":return s.arrayBuffer();case"dataUrl":return s.blob().then(Ds);default:return s.text()}}).finally(()=>clearTimeout(i))}function Ve(e,t){let{url:n,requestType:o="text",responseType:r="text",imageDom:a}=t,i=n,{timeout:s,acceptOfImage:u,requests:l,fetchFn:c,fetch:{requestInit:m,bypassingCache:f,placeholderImage:p},font:g,workers:b,fontFamilies:E}=e;o==="image"&&(it||on)&&e.drawImageCount++;let w=l.get(n);if(!w){f&&f instanceof RegExp&&f.test(i)&&(i+=(/\?/.test(i)?"&":"?")+new Date().getTime());let h=o.startsWith("font")&&g&&g.minify,v=new Set;h&&o.split(";")[1].split(",").forEach(M=>{E.has(M)&&E.get(M).forEach(V=>v.add(V))});let y=h&&v.size,T={url:i,timeout:s,responseType:y?"arrayBuffer":r,headers:o==="image"?{accept:u}:void 0,...m};w={type:o,resolve:void 0,reject:void 0,response:null},w.response=(async()=>{if(c&&o==="image"){let S=await c(n);if(S)return S}return!it&&n.startsWith("http")&&b.length?new Promise((S,M)=>{b[l.size&b.length-1].postMessage({rawUrl:n,...T}),w.resolve=S,w.reject=M}):rl(T)})().catch(S=>{if(l.delete(n),o==="image"&&p)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",i),typeof p=="string"?p:p(a);throw S}),l.set(n,w)}return w.response}async function Er(e,t,n,o){if(!wr(e))return e;for(let[r,a]of al(e,t))try{let i=await Ve(n,{url:a,requestType:o?"image":"text",responseType:"dataUrl"});e=e.replace(il(r),`$1${i}$3`)}catch(i){n.log.warn("Failed to fetch css data url",r,i)}return e}function wr(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}function al(e,t){let n=[];return e.replace(xr,(o,r,a)=>(n.push([a,sr(a,t)]),o)),n.filter(([o])=>!en(o))}function il(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function ll(e,t){return sl.map(n=>{let o=e.getPropertyValue(n);return!o||o==="none"?null:((it||on)&&t.drawImageCount++,Er(o,null,t,!0).then(r=>{!r||o===r||e.setProperty(n,r,e.getPropertyPriority(n))}))}).filter(Boolean)}function cl(e,t){if(Re(e)){let n=e.currentSrc||e.src;if(!en(n))return[Ve(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.srcset="",e.dataset.originalSrc=n,e.src=o||"")})];(it||on)&&t.drawImageCount++}else if(ze(e)&&!en(e.href.baseVal)){let n=e.href.baseVal;return[Ve(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.dataset.originalSrc=n,e.href.baseVal=o||"")})]}return[]}function ul(e,t){let{ownerDocument:n,svgDefsElement:o}=t,r=e.getAttribute("href")??e.getAttribute("xlink:href");if(!r)return[];let[a,i]=r.split("#");if(i){let s=`#${i}`,u=t.shadowRoots.reduce((l,c)=>l??c.querySelector(`svg ${s}`),n?.querySelector(`svg ${s}`));if(a&&e.setAttribute("href",s),o?.querySelector(s))return[];if(u)return o?.appendChild(u.cloneNode(!0)),[];if(a)return[Ve(t,{url:a,responseType:"text"}).then(l=>{o?.insertAdjacentHTML("beforeend",l)})]}return[]}function Sr(e,t){let{tasks:n}=t;q(e)&&((Re(e)||ir(e))&&n.push(...cl(e,t)),ws(e)&&n.push(...ul(e,t))),Ge(e)&&n.push(...ll(e.style,t)),e.childNodes.forEach(o=>{Sr(o,t)})}async function dl(e,t){let{ownerDocument:n,svgStyleElement:o,fontFamilies:r,fontCssTexts:a,tasks:i,font:s}=t;if(!(!n||!o||!r.size))if(s&&s.cssText){let u=qo(s.cssText,t);o.appendChild(n.createTextNode(`${u}
8
- `))}else{let u=Array.from(n.styleSheets).filter(p=>{try{return"cssRules"in p&&!!p.cssRules.length}catch(g){return t.log.warn(`Error while reading CSS rules from ${p.href}`,g),!1}}),l=n.implementation.createHTMLDocument(""),c=l.createElement("style");l.head.appendChild(c);let m=c.sheet;await Promise.all(u.flatMap(p=>Array.from(p.cssRules).map(async g=>{if(vs(g)){let b=g.href,E="";try{E=await Ve(t,{url:b,requestType:"text",responseType:"text"})}catch(h){t.log.warn(`Error fetch remote css import from ${b}`,h)}let w=E.replace(xr,(h,v,y)=>h.replace(y,sr(y,b)));for(let h of fl(w))try{m.insertRule(h,m.cssRules.length)}catch(v){t.log.warn("Error inserting rule from remote css import",{rule:h,error:v})}}}))),m.cssRules.length&&u.push(m);let f=[];u.forEach(p=>{tn(p.cssRules,f)}),f.filter(p=>ys(p)&&wr(p.style.getPropertyValue("src"))&&fr(p.style.getPropertyValue("font-family"))?.some(g=>r.has(g))).forEach(p=>{let g=p,b=a.get(g.cssText);b?o.appendChild(n.createTextNode(`${b}
9
- `)):i.push(Er(g.cssText,g.parentStyleSheet?g.parentStyleSheet.href:null,t).then(E=>{E=qo(E,t),a.set(g.cssText,E),o.appendChild(n.createTextNode(`${E}
10
- `))}))})}}function fl(e){if(e==null)return[];let t=[],n=e.replace(ml,"");for(;;){let a=Xo.exec(n);if(!a)break;t.push(a[0])}n=n.replace(Xo,"");let o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,r=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let a=o.exec(n);if(a)r.lastIndex=o.lastIndex;else if(a=r.exec(n),a)o.lastIndex=r.lastIndex;else break;t.push(a[0])}return t}function qo(e,t){let{font:n}=t,o=n?n?.preferredFormat:void 0;return o?e.replace(bl,r=>{for(;;){let[a,,i]=pl.exec(r)||[];if(!i)return"";if(i===o)return`src: ${a};`}}):e}function tn(e,t=[]){for(let n of Array.from(e))Es(n)?t.push(...tn(n.cssRules)):"cssRules"in n?tn(n.cssRules,t):t.push(n);return t}function hl(e){return gl.test(e.innerHTML)}async function Cr(e,t){let n=await Z(e,t);if(q(n.node)&&ze(n.node)&&!hl(n.node))return n.node;let{ownerDocument:o,log:r,tasks:a,svgStyleElement:i,svgDefsElement:s,svgStyles:u,font:l,progress:c,autoDestruct:m,onCloneNode:f,onEmbedNode:p,onCreateForeignObjectSvg:g}=n;r.time("clone node");let b=await rn(n.node,n,!0);if(i&&o){let y="";u.forEach((T,S)=>{y+=`${T.join(`,
6
+ `);return t.appendChild(n),t}function sl(e,t){let{width:n,height:o}=t;if(J(e)&&(!n||!o)){let r=e.getBoundingClientRect();n=n||r.width||Number(e.getAttribute("width"))||0,o=o||r.height||Number(e.getAttribute("height"))||0}return{width:n,height:o}}async function ll(e,t){let{log:n,timeout:o,drawImageCount:r,drawImageInterval:a}=t;n.time("image to canvas");let i=await Pe(e,{timeout:o,onWarn:t.log.warn}),{canvas:s,context2d:l}=cl(e.ownerDocument,t),u=()=>{try{l?.drawImage(i,0,0,s.width,s.height)}catch(d){t.log.warn("Failed to drawImage",d)}};if(u(),t.isEnable("fixSvgXmlDecode"))for(let d=0;d<r;d++)await new Promise(f=>{setTimeout(()=>{l?.clearRect(0,0,s.width,s.height),u(),f()},d+a)});return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function cl(e,t){let{width:n,height:o,scale:r,backgroundColor:a,maximumCanvasSize:i}=t,s=e.createElement("canvas");s.width=Math.floor(n*r),s.height=Math.floor(o*r),s.style.width=`${n}px`,s.style.height=`${o}px`,i&&(s.width>i||s.height>i)&&(s.width>i&&s.height>i?s.width>s.height?(s.height*=i/s.width,s.width=i):(s.width*=i/s.height,s.height=i):s.width>i?(s.height*=i/s.width,s.width=i):(s.width*=i/s.height,s.height=i));let l=s.getContext("2d");return l&&a&&(l.fillStyle=a,l.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:l}}function Ar(e,t){if(e.ownerDocument)try{let a=e.toDataURL();if(a!=="data:,")return Se(a,e.ownerDocument)}catch(a){t.log.warn("Failed to clone canvas",a)}let n=e.cloneNode(!1),o=e.getContext("2d"),r=n.getContext("2d");try{return o&&r&&r.putImageData(o.getImageData(0,0,e.width,e.height),0,0),n}catch(a){t.log.warn("Failed to clone canvas",a)}return n}function ul(e,t){try{if(e?.contentDocument?.documentElement)return un(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}function dl(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function ml(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Se(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let o=n.ownerDocument;if(o){let r=!0;if(await Pe(n,{onError:()=>r=!1,onWarn:t.log.warn}),!r)return e.poster?Se(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(i=>{n.addEventListener("seeked",i,{once:!0})});let a=o.createElement("canvas");a.width=e.offsetWidth,a.height=e.offsetHeight;try{let i=a.getContext("2d");i&&i.drawImage(n,0,0,a.width,a.height)}catch(i){return t.log.warn("Failed to clone video",i),e.poster?Se(e.poster,e.ownerDocument):n}return Ar(a,t)}return n}function fl(e,t){return Ks(e)?Ar(e,t):Js(e)?ul(e,t):$e(e)?dl(e):mt(e)?ml(e,t):e.cloneNode(!1)}function pl(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${Sr()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",n.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(o){e.log.warn("Failed to getSandBox",o)}}return t}function _r(e,t,n){let{defaultComputedStyles:o}=n,r=e.nodeName.toLowerCase(),a=Ye(e)&&r!=="svg",i=a?gl.map(g=>[g,e.getAttribute(g)]).filter(([,g])=>g!==null):[],s=[a&&"svg",r,i.map((g,y)=>`${g}=${y}`).join(","),t].filter(Boolean).join(":");if(o.has(s))return o.get(s);let u=pl(n)?.contentWindow;if(!u)return new Map;let d=u?.document,f,h;a?(f=d.createElementNS(pt,"svg"),h=f.ownerDocument.createElementNS(f.namespaceURI,r),i.forEach(([g,y])=>{h.setAttributeNS(null,g,y)}),f.appendChild(h)):f=h=d.createElement(r),h.textContent=" ",d.body.appendChild(f);let c=u.getComputedStyle(h,t),p=new Map;for(let g=c.length,y=0;y<g;y++){let v=c.item(y);bl.includes(v)||p.set(v,c.getPropertyValue(v))}return d.body.removeChild(f),o.set(s,p),p}function Rr(e,t,n){let o=new Map,r=[],a=new Map;if(n)for(let s of n)i(s);else for(let s=e.length,l=0;l<s;l++){let u=e.item(l);i(u)}for(let s=r.length,l=0;l<s;l++)a.get(r[l])?.forEach((u,d)=>o.set(d,u));function i(s){let l=e.getPropertyValue(s),u=e.getPropertyPriority(s),d=s.lastIndexOf("-"),f=d>-1?s.substring(0,d):void 0;if(f){let h=a.get(f);h||(h=new Map,a.set(f,h)),h.set(s,[l,u])}t.get(s)===l&&!u||(f?r.push(f):o.set(s,[l,u]))}return o}function hl(e,t,n,o){let{ownerWindow:r,includeStyleProperties:a,currentParentNodeStyle:i}=o,s=t.style,l=r.getComputedStyle(e),u=_r(e,null,o);i?.forEach((f,h)=>{u.delete(h)});let d=Rr(l,u,a);d.delete("transition-property"),d.delete("all"),d.delete("d"),d.delete("content"),n&&(d.delete("position"),d.delete("margin-top"),d.delete("margin-right"),d.delete("margin-bottom"),d.delete("margin-left"),d.delete("margin-block-start"),d.delete("margin-block-end"),d.delete("margin-inline-start"),d.delete("margin-inline-end"),d.set("box-sizing",["border-box",""])),d.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),gr&&(d.has("font-kerning")||d.set("font-kerning",["normal",""]),(d.get("overflow-x")?.[0]==="hidden"||d.get("overflow-y")?.[0]==="hidden")&&d.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&d.set("text-overflow",["clip",""]));for(let f=s.length,h=0;h<f;h++)s.removeProperty(s.item(h));return d.forEach(([f,h],c)=>{s.setProperty(c,f,h)}),d}function yl(e,t){(js(e)||Ws(e)||qs(e))&&t.setAttribute("value",e.value)}function xl(e,t,n,o,r){let{ownerWindow:a,svgStyleElement:i,svgStyles:s,currentNodeStyle:l}=o;if(!i||!a)return;function u(d){let f=a.getComputedStyle(e,d),h=f.getPropertyValue("content");if(!h||h==="none")return;r?.(h),h=h.replace(/(')|(")|(counter\(.+\))/g,"");let c=[Sr()],p=_r(e,d,o);l?.forEach((E,x)=>{p.delete(x)});let g=Rr(f,p,o.includeStyleProperties);g.delete("content"),g.delete("-webkit-locale"),g.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let y=[`content: '${h}';`];if(g.forEach(([E,x],C)=>{y.push(`${C}: ${E}${x?" !important":""};`)}),y.length===1)return;try{t.className=[t.className,...c].join(" ")}catch(E){o.log.warn("Failed to copyPseudoClass",E);return}let v=y.join(`
7
+ `),b=s.get(v);b||(b=[],s.set(v,b)),b.push(`.${c[0]}${d}`)}vl.forEach(u),n&&El.forEach(u)}async function rr(e,t,n,o,r){if(J(n)&&(Ys(n)||Xs(n))||o.filter&&!o.filter(n))return;or.has(t.nodeName)||or.has(n.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;let a=await un(n,o,!1,r);o.isEnable("restoreScrollPosition")&&wl(e,a),t.appendChild(a)}async function ar(e,t,n,o){let r=e.firstChild;J(e)&&e.shadowRoot&&(r=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let a=r;a;a=a.nextSibling)if(!Vs(a))if(J(a)&&Zs(a)&&typeof a.assignedNodes=="function"){let i=a.assignedNodes();for(let s=0;s<i.length;s++)await rr(e,t,i[s],n,o)}else await rr(e,t,a,n,o)}function wl(e,t){if(!je(e)||!je(t))return;let{scrollTop:n,scrollLeft:o}=e;if(!n&&!o)return;let{transform:r}=t.style,a=new DOMMatrix(r),{a:i,b:s,c:l,d:u}=a;a.a=1,a.b=0,a.c=0,a.d=1,a.translateSelf(-o,-n),a.a=i,a.b=s,a.c=l,a.d=u,t.style.transform=a.toString()}function Sl(e,t){let{backgroundColor:n,width:o,height:r,style:a}=t,i=e.style;if(n&&i.setProperty("background-color",n,"important"),o&&i.setProperty("width",`${o}px`,"important"),r&&i.setProperty("height",`${r}px`,"important"),a)for(let s in a)i[s]=a[s]}async function un(e,t,n=!1,o){let{ownerDocument:r,ownerWindow:a,fontFamilies:i,onCloneEachNode:s}=t;if(r&&zs(e))return o&&/\S/.test(e.data)&&o(e.data),r.createTextNode(e.data);if(r&&a&&J(e)&&(je(e)||Ye(e))){let u=await fl(e,t);if(t.isEnable("removeAbnormalAttributes")){let g=u.getAttributeNames();for(let y=g.length,v=0;v<y;v++){let b=g[v];Cl.test(b)||u.removeAttribute(b)}}let d=t.currentNodeStyle=hl(e,u,n,t);n&&Sl(u,t);let f=!1;if(t.isEnable("copyScrollbar")){let g=[d.get("overflow-x")?.[0],d.get("overflow-y")?.[0]];f=g.includes("scroll")||(g.includes("auto")||g.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let h=d.get("text-transform")?.[0],c=Cr(d.get("font-family")?.[0]),p=c?g=>{h==="uppercase"?g=g.toUpperCase():h==="lowercase"?g=g.toLowerCase():h==="capitalize"&&(g=g[0].toUpperCase()+g.substring(1)),c.forEach(y=>{let v=i.get(y);v||i.set(y,v=new Set),g.split("").forEach(b=>v.add(b))})}:void 0;return xl(e,u,f,t,p),yl(e,u),mt(e)||await ar(e,u,t,p),await s?.(u),u}let l=e.cloneNode(!1);return await ar(e,l,t),await s?.(l),l}function Ir(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn("Failed to destroyContext",t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function Tl(e){let{url:t,timeout:n,responseType:o,...r}=e,a=new AbortController,i=n?setTimeout(()=>a.abort(),n):void 0;return fetch(t,{signal:a.signal,...r}).then(s=>{if(!s.ok)throw new Error("Failed fetch, not 2xx response",{cause:s});switch(o){case"arrayBuffer":return s.arrayBuffer();case"dataUrl":return s.blob().then(ol);default:return s.text()}}).finally(()=>clearTimeout(i))}function We(e,t){let{url:n,requestType:o="text",responseType:r="text",imageDom:a}=t,i=n,{timeout:s,acceptOfImage:l,requests:u,fetchFn:d,fetch:{requestInit:f,bypassingCache:h,placeholderImage:c},font:p,workers:g,fontFamilies:y}=e;o==="image"&&(dt||cn)&&e.drawImageCount++;let v=u.get(n);if(!v){h&&h instanceof RegExp&&h.test(i)&&(i+=(/\?/.test(i)?"&":"?")+new Date().getTime());let b=o.startsWith("font")&&p&&p.minify,E=new Set;b&&o.split(";")[1].split(",").forEach(T=>{y.has(T)&&y.get(T).forEach(U=>E.add(U))});let x=b&&E.size,C={url:i,timeout:s,responseType:x?"arrayBuffer":r,headers:o==="image"?{accept:l}:void 0,...f};v={type:o,resolve:void 0,reject:void 0,response:null},v.response=(async()=>{if(d&&o==="image"){let A=await d(n);if(A)return A}return!dt&&n.startsWith("http")&&g.length?new Promise((A,T)=>{g[u.size&g.length-1].postMessage({rawUrl:n,...C}),v.resolve=A,v.reject=T}):Tl(C)})().catch(A=>{if(u.delete(n),o==="image"&&c)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",i),typeof c=="string"?c:c(a);throw A}),u.set(n,v)}return v.response}async function Lr(e,t,n,o){if(!Nr(e))return e;for(let[r,a]of kl(e,t))try{let i=await We(n,{url:a,requestType:o?"image":"text",responseType:"dataUrl"});e=e.replace(Al(r),`$1${i}$3`)}catch(i){n.log.warn("Failed to fetch css data url",r,i)}return e}function Nr(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}function kl(e,t){let n=[];return e.replace($r,(o,r,a)=>(n.push([a,yr(a,t)]),o)),n.filter(([o])=>!an(o))}function Al(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Rl(e,t){return _l.map(n=>{let o=e.getPropertyValue(n);return!o||o==="none"?null:((dt||cn)&&t.drawImageCount++,Lr(o,null,t,!0).then(r=>{!r||o===r||e.setProperty(n,r,e.getPropertyPriority(n))}))}).filter(Boolean)}function Il(e,t){if($e(e)){let n=e.currentSrc||e.src;if(!an(n))return[We(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.srcset="",e.dataset.originalSrc=n,e.src=o||"")})];(dt||cn)&&t.drawImageCount++}else if(Ye(e)&&!an(e.href.baseVal)){let n=e.href.baseVal;return[We(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.dataset.originalSrc=n,e.href.baseVal=o||"")})]}return[]}function Ll(e,t){let{ownerDocument:n,svgDefsElement:o}=t,r=e.getAttribute("href")??e.getAttribute("xlink:href");if(!r)return[];let[a,i]=r.split("#");if(i){let s=`#${i}`,l=t.shadowRoots.reduce((u,d)=>u??d.querySelector(`svg ${s}`),n?.querySelector(`svg ${s}`));if(a&&e.setAttribute("href",s),o?.querySelector(s))return[];if(l)return o?.appendChild(l.cloneNode(!0)),[];if(a)return[We(t,{url:a,responseType:"text"}).then(u=>{o?.insertAdjacentHTML("beforeend",u)})]}return[]}function Pr(e,t){let{tasks:n}=t;J(e)&&(($e(e)||hr(e))&&n.push(...Il(e,t)),Gs(e)&&n.push(...Ll(e,t))),je(e)&&n.push(...Rl(e.style,t)),e.childNodes.forEach(o=>{Pr(o,t)})}async function Nl(e,t){let{ownerDocument:n,svgStyleElement:o,fontFamilies:r,fontCssTexts:a,tasks:i,font:s}=t;if(!(!n||!o||!r.size))if(s&&s.cssText){let l=sr(s.cssText,t);o.appendChild(n.createTextNode(`${l}
8
+ `))}else{let l=Array.from(n.styleSheets).filter(c=>{try{return"cssRules"in c&&!!c.cssRules.length}catch(p){return t.log.warn(`Error while reading CSS rules from ${c.href}`,p),!1}}),u=n.implementation.createHTMLDocument(""),d=u.createElement("style");u.head.appendChild(d);let f=d.sheet;await Promise.all(l.flatMap(c=>Array.from(c.cssRules).map(async p=>{if(Us(p)){let g=p.href,y="";try{y=await We(t,{url:g,requestType:"text",responseType:"text"})}catch(b){t.log.warn(`Error fetch remote css import from ${g}`,b)}let v=y.replace($r,(b,E,x)=>b.replace(x,yr(x,g)));for(let b of Pl(v))try{f.insertRule(b,f.cssRules.length)}catch(E){t.log.warn("Error inserting rule from remote css import",{rule:b,error:E})}}}))),f.cssRules.length&&l.push(f);let h=[];l.forEach(c=>{sn(c.cssRules,h)}),h.filter(c=>Hs(c)&&Nr(c.style.getPropertyValue("src"))&&Cr(c.style.getPropertyValue("font-family"))?.some(p=>r.has(p))).forEach(c=>{let p=c,g=a.get(p.cssText);g?o.appendChild(n.createTextNode(`${g}
9
+ `)):i.push(Lr(p.cssText,p.parentStyleSheet?p.parentStyleSheet.href:null,t).then(y=>{y=sr(y,t),a.set(p.cssText,y),o.appendChild(n.createTextNode(`${y}
10
+ `))}))})}}function Pl(e){if(e==null)return[];let t=[],n=e.replace($l,"");for(;;){let a=ir.exec(n);if(!a)break;t.push(a[0])}n=n.replace(ir,"");let o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,r=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let a=o.exec(n);if(a)r.lastIndex=o.lastIndex;else if(a=r.exec(n),a)o.lastIndex=r.lastIndex;else break;t.push(a[0])}return t}function sr(e,t){let{font:n}=t,o=n?n?.preferredFormat:void 0;return o?e.replace(Ol,r=>{for(;;){let[a,,i]=Ml.exec(r)||[];if(!i)return"";if(i===o)return`src: ${a};`}}):e}function sn(e,t=[]){for(let n of Array.from(e))Bs(n)?t.push(...sn(n.cssRules)):"cssRules"in n?sn(n.cssRules,t):t.push(n);return t}function Fl(e){return Dl.test(e.innerHTML)}async function Mr(e,t){let n=await Q(e,t);if(J(n.node)&&Ye(n.node)&&!Fl(n.node))return n.node;let{ownerDocument:o,log:r,tasks:a,svgStyleElement:i,svgDefsElement:s,svgStyles:l,font:u,progress:d,autoDestruct:f,onCloneNode:h,onEmbedNode:c,onCreateForeignObjectSvg:p}=n;r.time("clone node");let g=await un(n.node,n,!0);if(i&&o){let x="";l.forEach((C,A)=>{x+=`${C.join(`,
11
11
  `)} {
12
- ${S}
12
+ ${A}
13
13
  }
14
- `}),i.appendChild(o.createTextNode(y))}r.timeEnd("clone node"),await f?.(b),l!==!1&&q(b)&&(r.time("embed web font"),await dl(b,n),r.timeEnd("embed web font")),r.time("embed node"),Sr(b,n);let E=a.length,w=0,h=async()=>{for(;;){let y=a.pop();if(!y)break;try{await y}catch(T){n.log.warn("Failed to run task",T)}c?.(++w,E)}};c?.(w,E),await Promise.all([...Array.from({length:4})].map(h)),r.timeEnd("embed node"),await p?.(b);let v=yl(b,n);return s&&v.insertBefore(s,v.children[0]),i&&v.insertBefore(i,v.children[0]),m&&vr(n),await g?.(v),v}function yl(e,t){let{width:n,height:o}=t,r=lr(n,o,e.ownerDocument),a=r.ownerDocument.createElementNS(r.namespaceURI,"foreignObject");return a.setAttributeNS(null,"x","0%"),a.setAttributeNS(null,"y","0%"),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.append(e),r.appendChild(a),r}async function ut(e,t){let n=await Z(e,t),o=await Cr(n),r=cr(o,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=br(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(ct,"defs"),n.svgStyles.clear());let a=Se(r,o.ownerDocument);return await Bs(a,n)}async function vl(e,t){let n=await Z(e,t),{log:o,type:r,quality:a,dpi:i}=n,s=await ut(n);o.time("canvas to blob");let u=await Ps(s,r,a);if(["image/png","image/jpeg"].includes(r)&&i){let l=await Os(u.slice(0,33)),c=new Uint8Array(l);return r==="image/png"?c=nr(c,i):r==="image/jpeg"&&(c=Zo(c,i)),o.timeEnd("canvas to blob"),new Blob([c,u.slice(33)],{type:r})}return o.timeEnd("canvas to blob"),u}async function Ne(e,t){let n=await Z(e,t),{log:o,quality:r,type:a,dpi:i}=n,s=await ut(n);o.time("canvas to data url");let u=s.toDataURL(a,r);if(["image/png","image/jpeg"].includes(a)&&i&&rr&&gs){let[l,c]=u.split(","),m=0,f=!1;if(a==="image/png"){let v=ps(c);v>=0?(m=Math.ceil((v+28)/3)*4,f=!0):m=33/3*4}else a==="image/jpeg"&&(m=18/3*4);let p=c.substring(0,m),g=c.substring(m),b=window.atob(p),E=new Uint8Array(b.length);for(let v=0;v<E.length;v++)E[v]=b.charCodeAt(v);let w=a==="image/png"?nr(E,i,f):Zo(E,i),h=window.btoa(String.fromCharCode(...w));u=[l,",",h,g].join("")}return o.timeEnd("canvas to data url"),u}async function Tr(e,t){let n=await Z(e,t),{width:o,height:r,ownerDocument:a}=n,i=await Ne(n),s=lr(o,r,a),u=s.ownerDocument.createElementNS(s.namespaceURI,"image");return u.setAttributeNS(null,"href",i),u.setAttributeNS(null,"height","100%"),u.setAttributeNS(null,"width","100%"),s.appendChild(u),cr(s,n.isEnable("removeControlCharacter"))}async function El(e,t){let n=await Z(e,t),{ownerDocument:o,width:r,height:a,scale:i,type:s}=n,u=s==="image/svg+xml"?await Tr(n):await Ne(n),l=Se(u,o);return l.width=Math.floor(r*i),l.height=Math.floor(a*i),l.style.width=`${r}px`,l.style.height=`${a}px`,l}async function wl(e,t){return Ne(await Z(e,{...t,type:"image/jpeg"}))}async function xl(e,t){let n=await Z(e,t),o=await ut(n);return o.getContext("2d").getImageData(0,0,o.width,o.height).data}async function Sl(e,t){return Ne(await Z(e,{...t,type:"image/png"}))}async function Cl(e,t){return Ne(await Z(e,{...t,type:"image/webp"}))}var Jo,Qo,er,tr,Qt,ds,ms,fs,or,fe,bs,rr,gs,nn,ar,it,on,hs,ys,vs,Es,q,ze,ir,ws,Ge,xs,Ss,Re,st,Cs,Ts,ks,As,_s,Rs,Is,Ns,$s,en,ct,Ds,Os,mr,jo,Ys,Xs,Js,Qs,Ko,ol,xr,sl,ml,Xo,pl,bl,gl,Ar=ba(()=>{"use strict";Jo=112,Qo=72,er=89,tr=115;ds="AAlwSFlz",ms="AAAJcEhZ",fs="AAAACXBI";or="[modern-screenshot]",fe=typeof window<"u",bs=fe&&"Worker"in window,rr=fe&&"atob"in window,gs=fe&&"btoa"in window,nn=fe?window.navigator?.userAgent:"",ar=nn.includes("Chrome"),it=nn.includes("AppleWebKit")&&!ar,on=nn.includes("Firefox"),hs=e=>e&&"__CONTEXT__"in e,ys=e=>e.constructor.name==="CSSFontFaceRule",vs=e=>e.constructor.name==="CSSImportRule",Es=e=>e.constructor.name==="CSSLayerBlockRule",q=e=>e.nodeType===1,ze=e=>typeof e.className=="object",ir=e=>e.tagName==="image",ws=e=>e.tagName==="use",Ge=e=>q(e)&&typeof e.style<"u"&&!ze(e),xs=e=>e.nodeType===8,Ss=e=>e.nodeType===3,Re=e=>e.tagName==="IMG",st=e=>e.tagName==="VIDEO",Cs=e=>e.tagName==="CANVAS",Ts=e=>e.tagName==="TEXTAREA",ks=e=>e.tagName==="INPUT",As=e=>e.tagName==="STYLE",_s=e=>e.tagName==="SCRIPT",Rs=e=>e.tagName==="SELECT",Is=e=>e.tagName==="SLOT",Ns=e=>e.tagName==="IFRAME",$s=(...e)=>console.warn(or,...e);en=e=>e.startsWith("data:");ct="http://www.w3.org/2000/svg";Ds=e=>ur(e,"dataUrl"),Os=e=>ur(e,"arrayBuffer");mr=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();jo=0;Ys=["width","height","-webkit-text-fill-color"],Xs=["stroke","fill"];Js=["::before","::after"],Qs=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];Ko=new Set(["symbol"]);ol=/^[\w-:]+$/;xr=/url\((['"]?)([^'"]+?)\1\)/g;sl=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];ml=/(\/\*[\s\S]*?\*\/)/g,Xo=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;pl=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,bl=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;gl=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i});function xn(e){let t=new Set,n={active:!1,frozen:!1,hoveredElement:null,options:e,toolbar:{visible:e.showToolbar,themeMode:e.themeMode,comments:[]}},o=new Proxy(n,{set(r,a,i){let s=a;return r[s]===i||(Reflect.set(r,s,i),t.forEach(u=>u(o,s))),!0}});return{state:o,subscribe(r){return t.add(r),()=>t.delete(r)}}}var Sn="72px",ie="68px";var vt="grabby-root",Q=null,ye=null,yt,ee=new Map;function ha(e){try{return"adoptedStyleSheets"in e&&typeof CSSStyleSheet=="function"&&typeof CSSStyleSheet.prototype.replaceSync=="function"}catch{return!1}}function Cn(e){yt=e}function N(){if(ye&&Q?.isConnected)return ye;Q=document.createElement(vt),Q.setAttribute("data-grabby-ignore",""),ye=Q.attachShadow({mode:"open"}),document.documentElement.appendChild(Q);for(let[e,t]of Array.from(ee))t.target==="shadow"&&(ee.delete(e),_(e,t.css));return ye}function _(e,t,n="shadow"){let o=ee.get(e);if(o){o.css=t,o.sheet&&o.sheet.replaceSync(t),o.el&&(o.el.textContent=t);return}let r=n==="shadow"?N():document;if(ha(r)){let i=new CSSStyleSheet;i.replaceSync(t),r.adoptedStyleSheets=[...r.adoptedStyleSheets,i],ee.set(e,{target:n,css:t,sheet:i});return}let a=document.createElement("style");a.setAttribute("data-grabby-style",e),yt&&(a.nonce=yt),a.textContent=t,n==="shadow"?N().prepend(a):document.head.appendChild(a),ee.set(e,{target:n,css:t,el:a})}function U(e){return ee.has(e)}function R(e){let t=ee.get(e);if(t&&(ee.delete(e),t.el&&t.el.remove(),t.sheet)){let n=t.target==="shadow"?ye:document;n&&(n.adoptedStyleSheets=n.adoptedStyleSheets.filter(o=>o!==t.sheet))}}function Tn(e){return!e||!Q?!1:e===Q?!0:e.getRootNode()===ye}function se(e){let n=(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target;return n instanceof Element?n:null}function Et(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}function ve(e){if(!e)return!1;let t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable===!0}function kn(){for(let e of Array.from(ee.keys()))R(e);Q?.remove(),Q=null,ye=null}var wt="__grabby-overlay__",xt="__grabby-label__",St="__grabby-styles__",Ea=3;function An(){let e=null,t=null,n=null,o=null,r=null,a=null,i=[];function s(){U(St)||_(St,`
15
- #${wt} {
14
+ `}),i.appendChild(o.createTextNode(x))}r.timeEnd("clone node"),await h?.(g),u!==!1&&J(g)&&(r.time("embed web font"),await Nl(g,n),r.timeEnd("embed web font")),r.time("embed node"),Pr(g,n);let y=a.length,v=0,b=async()=>{for(;;){let x=a.pop();if(!x)break;try{await x}catch(C){n.log.warn("Failed to run task",C)}d?.(++v,y)}};d?.(v,y),await Promise.all([...Array.from({length:4})].map(b)),r.timeEnd("embed node"),await c?.(g);let E=Hl(g,n);return s&&E.insertBefore(s,E.children[0]),i&&E.insertBefore(i,E.children[0]),f&&Ir(n),await p?.(E),E}function Hl(e,t){let{width:n,height:o}=t,r=vr(n,o,e.ownerDocument),a=r.ownerDocument.createElementNS(r.namespaceURI,"foreignObject");return a.setAttributeNS(null,"x","0%"),a.setAttributeNS(null,"y","0%"),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.append(e),r.appendChild(a),r}async function bt(e,t){let n=await Q(e,t),o=await Mr(n),r=Er(o,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=kr(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(pt,"defs"),n.svgStyles.clear());let a=Se(r,o.ownerDocument);return await ll(a,n)}async function Ul(e,t){let n=await Q(e,t),{log:o,type:r,quality:a,dpi:i}=n,s=await bt(n);o.time("canvas to blob");let l=await tl(s,r,a);if(["image/png","image/jpeg"].includes(r)&&i){let u=await rl(l.slice(0,33)),d=new Uint8Array(u);return r==="image/png"?d=fr(d,i):r==="image/jpeg"&&(d=lr(d,i)),o.timeEnd("canvas to blob"),new Blob([d,l.slice(33)],{type:r})}return o.timeEnd("canvas to blob"),l}async function Me(e,t){let n=await Q(e,t),{log:o,quality:r,type:a,dpi:i}=n,s=await bt(n);o.time("canvas to data url");let l=s.toDataURL(a,r);if(["image/png","image/jpeg"].includes(a)&&i&&br&&Ds){let[u,d]=l.split(","),f=0,h=!1;if(a==="image/png"){let E=Ms(d);E>=0?(f=Math.ceil((E+28)/3)*4,h=!0):f=33/3*4}else a==="image/jpeg"&&(f=18/3*4);let c=d.substring(0,f),p=d.substring(f),g=window.atob(c),y=new Uint8Array(g.length);for(let E=0;E<y.length;E++)y[E]=g.charCodeAt(E);let v=a==="image/png"?fr(y,i,h):lr(y,i),b=window.btoa(String.fromCharCode(...v));l=[u,",",b,p].join("")}return o.timeEnd("canvas to data url"),l}async function Or(e,t){let n=await Q(e,t),{width:o,height:r,ownerDocument:a}=n,i=await Me(n),s=vr(o,r,a),l=s.ownerDocument.createElementNS(s.namespaceURI,"image");return l.setAttributeNS(null,"href",i),l.setAttributeNS(null,"height","100%"),l.setAttributeNS(null,"width","100%"),s.appendChild(l),Er(s,n.isEnable("removeControlCharacter"))}async function Bl(e,t){let n=await Q(e,t),{ownerDocument:o,width:r,height:a,scale:i,type:s}=n,l=s==="image/svg+xml"?await Or(n):await Me(n),u=Se(l,o);return u.width=Math.floor(r*i),u.height=Math.floor(a*i),u.style.width=`${r}px`,u.style.height=`${a}px`,u}async function Gl(e,t){return Me(await Q(e,{...t,type:"image/jpeg"}))}async function Vl(e,t){let n=await Q(e,t),o=await bt(n);return o.getContext("2d").getImageData(0,0,o.width,o.height).data}async function zl(e,t){return Me(await Q(e,{...t,type:"image/png"}))}async function Kl(e,t){return Me(await Q(e,{...t,type:"image/webp"}))}var cr,ur,dr,mr,rn,Ns,$s,Ps,pr,be,Os,br,Ds,ln,gr,dt,cn,Fs,Hs,Us,Bs,J,Ye,hr,Gs,je,Vs,zs,$e,mt,Ks,js,Ws,Ys,Xs,qs,Zs,Js,Qs,an,pt,ol,rl,Sr,nr,bl,gl,vl,El,or,Cl,$r,_l,$l,ir,Ml,Ol,Dl,Fr=La(()=>{"use strict";cr=112,ur=72,dr=89,mr=115;Ns="AAlwSFlz",$s="AAAJcEhZ",Ps="AAAACXBI";pr="[modern-screenshot]",be=typeof window<"u",Os=be&&"Worker"in window,br=be&&"atob"in window,Ds=be&&"btoa"in window,ln=be?window.navigator?.userAgent:"",gr=ln.includes("Chrome"),dt=ln.includes("AppleWebKit")&&!gr,cn=ln.includes("Firefox"),Fs=e=>e&&"__CONTEXT__"in e,Hs=e=>e.constructor.name==="CSSFontFaceRule",Us=e=>e.constructor.name==="CSSImportRule",Bs=e=>e.constructor.name==="CSSLayerBlockRule",J=e=>e.nodeType===1,Ye=e=>typeof e.className=="object",hr=e=>e.tagName==="image",Gs=e=>e.tagName==="use",je=e=>J(e)&&typeof e.style<"u"&&!Ye(e),Vs=e=>e.nodeType===8,zs=e=>e.nodeType===3,$e=e=>e.tagName==="IMG",mt=e=>e.tagName==="VIDEO",Ks=e=>e.tagName==="CANVAS",js=e=>e.tagName==="TEXTAREA",Ws=e=>e.tagName==="INPUT",Ys=e=>e.tagName==="STYLE",Xs=e=>e.tagName==="SCRIPT",qs=e=>e.tagName==="SELECT",Zs=e=>e.tagName==="SLOT",Js=e=>e.tagName==="IFRAME",Qs=(...e)=>console.warn(pr,...e);an=e=>e.startsWith("data:");pt="http://www.w3.org/2000/svg";ol=e=>xr(e,"dataUrl"),rl=e=>xr(e,"arrayBuffer");Sr=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();nr=0;bl=["width","height","-webkit-text-fill-color"],gl=["stroke","fill"];vl=["::before","::after"],El=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];or=new Set(["symbol"]);Cl=/^[\w-:]+$/;$r=/url\((['"]?)([^'"]+?)\1\)/g;_l=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];$l=/(\/\*[\s\S]*?\*\/)/g,ir=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;Ml=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ol=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;Dl=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i});function In(e){let t=new Set,n={active:!1,frozen:!1,hoveredElement:null,options:e,toolbar:{visible:e.showToolbar,themeMode:e.themeMode,comments:[]}},o=new Proxy(n,{set(r,a,i){let s=a;return r[s]===i||(Reflect.set(r,s,i),t.forEach(l=>l(o,s))),!0}});return{state:o,subscribe(r){return t.add(r),()=>t.delete(r)}}}var Ln="72px",le="68px";var Ct="grabby-root",oe=null,ye=null,St,re=new Map;function $a(e){try{return"adoptedStyleSheets"in e&&typeof CSSStyleSheet=="function"&&typeof CSSStyleSheet.prototype.replaceSync=="function"}catch{return!1}}function Nn(e){St=e}function N(){if(ye&&oe?.isConnected)return ye;oe=document.createElement(Ct),oe.setAttribute("data-grabby-ignore",""),ye=oe.attachShadow({mode:"open"}),document.documentElement.appendChild(oe);for(let[e,t]of Array.from(re))t.target==="shadow"&&(re.delete(e),R(e,t.css));return ye}function R(e,t,n="shadow"){let o=re.get(e);if(o){o.css=t,o.sheet&&o.sheet.replaceSync(t),o.el&&(o.el.textContent=t);return}let r=n==="shadow"?N():document;if($a(r)){let i=new CSSStyleSheet;i.replaceSync(t),r.adoptedStyleSheets=[...r.adoptedStyleSheets,i],re.set(e,{target:n,css:t,sheet:i});return}let a=document.createElement("style");a.setAttribute("data-grabby-style",e),St&&(a.nonce=St),a.textContent=t,n==="shadow"?N().prepend(a):document.head.appendChild(a),re.set(e,{target:n,css:t,el:a})}function z(e){return re.has(e)}function I(e){let t=re.get(e);if(t&&(re.delete(e),t.el&&t.el.remove(),t.sheet)){let n=t.target==="shadow"?ye:document;n&&(n.adoptedStyleSheets=n.adoptedStyleSheets.filter(o=>o!==t.sheet))}}function $n(e){return!e||!oe?!1:e===oe?!0:e.getRootNode()===ye}function ce(e){let n=(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target;return n instanceof Element?n:null}function Tt(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}function ve(e){if(!e)return!1;let t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable===!0}function Pn(){for(let e of Array.from(re.keys()))I(e);oe?.remove(),oe=null,ye=null}var Pa=new Set(["BUTTON","A","SUMMARY"]),Ma=new Set(["button","link","tab","menuitem","menuitemcheckbox","menuitemradio","switch","option","checkbox","radio"]),On=new Set(["button","submit","reset","image"]),Oa=new Set(["INPUT","SELECT","TEXTAREA"]),Da=new Set(["textbox","combobox","searchbox","spinbutton","slider"]),Fa=new Set(["IMG","SVG","VIDEO","PICTURE","CANVAS","IFRAME","AUDIO"]),Ha=new Set(["H1","H2","H3","H4","H5","H6","P","SPAN","LABEL","LI","STRONG","EM","B","I","SMALL","BLOCKQUOTE","CODE","PRE","TD","TH","DT","DD","FIGCAPTION","LEGEND","CAPTION","Q","CITE","MARK","TIME"]),Dn=new Set(["HTML","BODY","MAIN"]),Ua=new Set(["HEADER","FOOTER","NAV","ASIDE"]),Ba=.6;function nt(e){return(e.getAttribute("role")??"").toLowerCase()}function kt(e){return Pa.has(e.tagName)?e.tagName!=="A"||e.hasAttribute("href")||e.hasAttribute("role"):e.tagName==="INPUT"&&On.has(e.type)?!0:Ma.has(nt(e))}function At(e){return e.tagName==="INPUT"?!On.has(e.type):Oa.has(e.tagName)||e.isContentEditable&&e.getAttribute("contenteditable")!==null?!0:Da.has(nt(e))}function Mn(e){let t=e.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;if(!n||!o)return!1;let r=Math.max(0,Math.min(t.right,n)-Math.max(t.left,0)),a=Math.max(0,Math.min(t.bottom,o)-Math.max(t.top,0));return r*a/(n*o)>=Ba}function Ga(e){return e.children.length>0}function ot(e){return Dn.has(e.tagName)?"section":Fa.has(e.tagName)?"media":At(e)?"field":kt(e)?"action":Ua.has(e.tagName)||nt(e)==="main"||nt(e)==="region"?Mn(e)?"section":"container":Ha.has(e.tagName)||!Ga(e)&&(e.textContent??"").trim()?"text":Mn(e)?"section":"container"}var Va=3;function Fn(e){if(kt(e)||At(e))return e;let t=e.parentElement;for(let n=0;t&&n<Va;n++){if(kt(t)||At(t))return t;if(Dn.has(t.tagName))break;t=t.parentElement}return e}var za=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,Ka=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g,ja=/\b(Bearer|Basic|Token)\s+[A-Za-z0-9._~+/=-]{8,}/gi,Wa=/\b\d(?:[ -]?\d){8,}\b/g,Ya=/\b[A-Za-z0-9_-]{32,}\b/g,Xa=/([?&#](?:access_token|id_token|token|key|api_key|apikey|secret|password|pass|auth|code|session|sig|signature)=)[^&#\s]*/gi;function P(e,t={}){if(!e)return e;let n=e.replace(Xa,"$1[redacted]").replace(Ka,"[token]").replace(ja,"$1 [token]");return(t.keepEmails?n:n.replace(za,"[email]")).replace(Wa,"[number]").replace(Ya,o=>/\d/.test(o)&&/[A-Za-z]/.test(o)?"[token]":o)}function Hn(e,t=[]){let n=e.pathname||"/";if(t.length>0&&e.search){let o=new URLSearchParams(e.search),r=new URLSearchParams;for(let i of t){let s=o.get(i);s!==null&&r.set(i,s)}let a=r.toString();a&&(n+=`?${a}`)}return e.hash.startsWith("#/")&&(n+=e.hash.split("?")[0]),P(n)}function Oe(e,t=typeof location<"u"?location.href:"http://localhost/"){try{let n=new URL(e,t);if(n.protocol==="javascript:"||n.protocol==="data:"||n.protocol==="vbscript:")return`${n.protocol}\u2026`;let o=new URL(t),r=n.pathname+(n.hash.startsWith("#/")?n.hash:"");return P(n.origin===o.origin?r:`${n.host}${r}`)}catch{return P(e.split(/[?#]/)[0])}}var rt="data-grabby-mask",ae="data-grabby-ignore",qa=["id","class","role","aria-label","data-testid","data-test","data-cy","name","type","href","src","alt","placeholder","title","for","aria-expanded","aria-selected","disabled"],Za=new Set(["href","src"]),Ja=8,Qa=60,ei=80,ti=80,Un=300;function ni(e){return e.startsWith("_ng")||e.startsWith("ng-reflect-")||e.startsWith("data-v-")||e.startsWith("data-grabby-")||e.startsWith("data-svelte")||e==="style"||e==="value"||e.startsWith("on")}function De(e){return e.startsWith("ng-")||e.startsWith("_ng")||/^svelte-[a-z0-9]+$/i.test(e)||/^s-[A-Za-z0-9_-]{8,}$/.test(e)}function X(e,t){return e.length<=t?e:`${e.slice(0,t-1).trimEnd()}\u2026`}function Le(e){return e.closest(`[${rt}]`)!==null}function K(e,t){if(Le(e))return"[masked]";let n="",o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let r=o.nextNode();r;r=o.nextNode()){let a=r.parentElement;if(!(a&&/^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE)$/.test(a.tagName))&&!a?.closest(`[${ae}], [${rt}]`)&&(n+=` ${r.nodeValue??""}`,n.length>t*3))break}return X(P(n.replace(/\s+/g," ").trim()),t)}function Bn(e){let t="";for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE&&(t+=` ${n.nodeValue??""}`);return t.replace(/\s+/g," ").trim()}function oi(e,t,n,o){if(t==="class"){let r=o(n.split(/\s+/).filter(Boolean));return r.length===0?null:X(r.join(" "),Qa)}return Za.has(t)?X(Oe(n),120):X(P(n,{keepEmails:t==="placeholder"}),ei)}function ri(e,t=n=>n.filter(o=>!De(o))){let n=e.tagName.toLowerCase(),o=[],r=new Set,a=i=>{if(o.length>=Ja||r.has(i)||ni(i))return;let s=e.getAttribute(i);if(s===null)return;if(r.add(i),s===""){o.push(i);return}let l=oi(e,i,s,t);l!==null&&o.push(`${i}="${l.replace(/"/g,"&quot;")}"`)};for(let i of qa)a(i);for(let{name:i}of Array.from(e.attributes))i.startsWith("aria-")&&a(i);return`<${n}${o.length?` ${o.join(" ")}`:""}>`}function Gn(e,t){let n=e.tagName.toLowerCase(),o=ri(e,t);if(/^(img|input|br|hr|meta|link|source|area|col|embed|wbr)$/.test(n))return X(o,Un);let r=Array.from(e.children).filter(i=>!i.hasAttribute(ae)),a;if(Le(e))a="[masked]";else if(r.length===0)a=X(P(Bn(e)),ti);else if(r.length<=2){let i=X(P(Bn(e)),40),s=r.map(l=>{let u=K(l,30);return`<${l.tagName.toLowerCase()}${u?`>${u}</${l.tagName.toLowerCase()}>`:" \u2026>"}`});a=[i,...s].filter(Boolean).join(" ")}else a=`(${r.length} elements)`;return X(`${o}${a}</${n}>`,Un)}var Fe=40,ai=/^h[1-6]$/;function ii(e){return(e.getAttribute("role")??"").toLowerCase()}function si(e){try{let t=getComputedStyle(e),n=t.borderStyle!=="none"&&parseFloat(t.borderWidth)>0;return!!t.boxShadow&&t.boxShadow!=="none"||n&&parseFloat(t.borderRadius)>0}catch{return!1}}function Vn(e,t,n="",o="",r=!1,a=!1){switch(t){case"action":return n==="tab"?"Tab":n.startsWith("menuitem")?"Menu item":n==="checkbox"||o==="checkbox"?"Checkbox":n==="radio"||n==="option"||o==="radio"?"Option":n==="switch"?"Switch":e==="a"||n==="link"?"Link":"Button";case"field":return e==="select"||n==="combobox"?"Dropdown":e==="textarea"?"Text area":o==="checkbox"?"Checkbox":o==="radio"?"Option":o==="range"||n==="slider"?"Slider":o==="file"?"File upload":o==="search"||n==="searchbox"?"Search box":/^(date|datetime-local|month|week|time)$/.test(o)?"Date picker":"Text box";case"media":return e==="svg"?"Icon":e==="video"?"Video":e==="audio"?"Audio player":e==="iframe"?"Embedded content":e==="canvas"?"Chart or drawing":"Image";case"text":return ai.test(e)||n==="heading"?"Heading":e==="li"?"List item":e==="label"?"Label":e==="td"||e==="th"?"Table cell":e==="blockquote"||e==="q"?"Quote":e==="code"||e==="pre"?"Code":"Text";case"section":return e==="html"||e==="body"?"Whole page":e==="main"||n==="main"?"Main content":e==="header"?"Page header":e==="footer"?"Page footer":e==="nav"?"Navigation menu":"Page section";default:return e==="nav"||n==="navigation"||n==="menu"||n==="menubar"?"Menu":e==="header"?"Header":e==="footer"?"Footer":e==="aside"?"Sidebar":e==="form"||n==="form"?"Form":e==="table"||n==="table"||n==="grid"?"Table":e==="ul"||e==="ol"||n==="list"?"List":e==="dialog"||n==="dialog"||n==="alertdialog"?"Pop-up":r?"Card":a?"Section":"Area"}}function li(e){let t=e.labels;return t&&t.length?K(t[0],Fe):P(e.getAttribute("aria-label")??"")||P(e.getAttribute("placeholder")??"")}function zn(e){return e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]')}function ci(e,t){if(Le(e)||e.tagName==="BODY"||e.tagName==="HTML")return"";let n=P(e.getAttribute("aria-label")??"");switch(t){case"action":return n||K(e,Fe)||P(e.getAttribute("title")??"")||P(e.querySelector("img[alt]")?.getAttribute("alt")??"");case"field":return li(e);case"media":return P(e.getAttribute("alt")??"")||n||P(e.getAttribute("title")??"");case"text":return K(e,Fe);default:{let o=zn(e);return n||(o?K(o,Fe):"")}}}function Kn(e,t){let n=X(t.replace(/\s+/g," ").trim(),Fe);return n?`${e} \u201C${n}\u201D`:e}function jn(e){let t=e.tagName.toLowerCase(),n=t==="svg"?"media":ot(e),o=ii(e),r=t==="input"?(e.type||"").toLowerCase():"",a=n==="container",i=Vn(t,n,o,r,a&&si(e),a&&!!zn(e));return Kn(i,ci(e,n))}function Wn(e){let t=e.facts??{},n=Vn(e.tag,e.kind,"",(t.type??"").toLowerCase(),!1,!!t.heading),o=t.label||t.heading||t.text||t.alt||"";return Kn(n,o)}var _t="__grabby-overlay__",at="__grabby-label__",Rt="__grabby-styles__",mi=3;function Yn(e={}){let t=null,n=null,o=null,r=null,a=null,i=null,s=[],l="";function u(){z(Rt)||R(Rt,`
15
+ #${_t} {
16
16
  position: fixed;
17
17
  pointer-events: none;
18
18
  z-index: ${2147483646};
@@ -21,7 +21,7 @@
21
21
  transition: top 0.05s ease, left 0.05s ease, width 0.05s ease, height 0.05s ease;
22
22
  box-sizing: border-box;
23
23
  }
24
- #${xt} {
24
+ #${at} {
25
25
  position: fixed;
26
26
  pointer-events: none;
27
27
  z-index: ${2147483647};
@@ -36,7 +36,12 @@
36
36
  overflow: hidden;
37
37
  text-overflow: ellipsis;
38
38
  }
39
- `)}function u(){e||(s(),e=document.createElement("div"),e.id=wt,N().appendChild(e)),t||(t=document.createElement("div"),t.id=xt,N().appendChild(t))}function l(){if(!o||!e||!t)return;let f=o.getBoundingClientRect();if(f.width===0&&f.height===0&&!o.isConnected){e.style.display="none",t.style.display="none";return}e.style.top=`${f.top}px`,e.style.left=`${f.left}px`,e.style.width=`${f.width}px`,e.style.height=`${f.height}px`,e.style.display="block";let g=`<${o.tagName.toLowerCase()}>`;if(i.length>0){let T=i.slice(0,Ea);g+=` .${T.join(".")}${i.length>T.length?"\u2026":""}`}r&&(g+=` in ${r}`),a&&(g+=` \u2014 ${a}`),t.textContent=g;let b=20,E=4,w=f.top-b-E;w<0&&(w=f.bottom+E);let h=f.left;t.style.top=`${w}px`,t.style.left=`${h}px`,t.style.display="block";let v=t.getBoundingClientRect(),y=document.documentElement.clientWidth;v.right>y&&(h=Math.max(0,y-v.width),t.style.left=`${h}px`)}function c(){l(),n=requestAnimationFrame(c)}function m(){n!==null&&(cancelAnimationFrame(n),n=null)}return{show(f,p,g,b){u(),o=f,r=p,a=g??null,i=b??[],m(),c()},hide(){m(),o=null,r=null,a=null,i=[],e&&(e.style.display="none"),t&&(t.style.display="none")},isOverlayElement(f){return f===e||f===t||f.id===wt||f.id===xt},dispose(){m(),o=null,r=null,a=null,i=[],e?.remove(),t?.remove(),R(St),e=null,t=null}}}var Ct="__grabby-crosshair-styles__",_n="__grabby-crosshair-cursor__",Tt="__grabby-crosshair-h__",kt="__grabby-crosshair-v__";function Rn(){let e=null,t=null,n=!1;function o(){U(Ct)||(_(Ct,`
39
+ #${at}.grabby-plain {
40
+ font: 600 12px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
41
+ padding: 3px 8px;
42
+ border-radius: 6px;
43
+ }
44
+ `)}function d(){t||(u(),t=document.createElement("div"),t.id=_t,N().appendChild(t)),n||(n=document.createElement("div"),n.id=at,e.plainLabels&&(n.className="grabby-plain"),N().appendChild(n))}function f(){if(!r||!t||!n)return;let g=r.getBoundingClientRect();if(g.width===0&&g.height===0&&!r.isConnected){t.style.display="none",n.style.display="none";return}t.style.top=`${g.top}px`,t.style.left=`${g.left}px`,t.style.width=`${g.width}px`,t.style.height=`${g.height}px`,t.style.display="block";let v=`<${r.tagName.toLowerCase()}>`;if(e.plainLabels){n.textContent=`${l} \xB7 Click to select`,h(g);return}if(s.length>0){let b=s.slice(0,mi);v+=` .${b.join(".")}${s.length>b.length?"\u2026":""}`}a&&(v+=` in ${a}`),i&&(v+=` \u2014 ${i}`),n.textContent=v,h(g)}function h(g){if(!n)return;let y=20,v=4,b=g.top-y-v;b<0&&(b=g.bottom+v);let E=g.left;n.style.top=`${b}px`,n.style.left=`${E}px`,n.style.display="block";let x=n.getBoundingClientRect(),C=document.documentElement.clientWidth;x.right>C&&(E=Math.max(0,C-x.width),n.style.left=`${E}px`)}function c(){f(),o=requestAnimationFrame(c)}function p(){o!==null&&(cancelAnimationFrame(o),o=null)}return{show(g,y,v,b){d(),r=g,a=y,e.plainLabels&&(l=jn(g)),i=v??null,s=b??[],p(),c()},hide(){p(),r=null,a=null,i=null,s=[],t&&(t.style.display="none"),n&&(n.style.display="none")},isOverlayElement(g){return g===t||g===n||g.id===_t||g.id===at},dispose(){p(),r=null,a=null,i=null,s=[],t?.remove(),n?.remove(),I(Rt),t=null,n=null}}}var It="__grabby-crosshair-styles__",Xn="__grabby-crosshair-cursor__",Lt="__grabby-crosshair-h__",Nt="__grabby-crosshair-v__";function qn(){let e=null,t=null,n=!1,o=!1;function r(){z(It)||(R(It,`
40
45
  .grabby-crosshair-line {
41
46
  position: fixed;
42
47
  pointer-events: none;
@@ -45,18 +50,18 @@
45
50
  opacity: 0.25;
46
51
  transition: none;
47
52
  }
48
- #${Tt} {
53
+ #${Lt} {
49
54
  left: 0;
50
55
  right: 0;
51
56
  height: 1px;
52
57
  }
53
- #${kt} {
58
+ #${Nt} {
54
59
  top: 0;
55
60
  bottom: 0;
56
61
  width: 1px;
57
62
  }
58
- `),_(_n,"body.grabby-crosshair-active { cursor: crosshair !important; }","document"))}function r(){e||(o(),e=document.createElement("div"),e.id=Tt,e.className="grabby-crosshair-line",N().appendChild(e)),t||(t=document.createElement("div"),t.id=kt,t.className="grabby-crosshair-line",N().appendChild(t))}function a(i){e&&(e.style.top=`${i.clientY}px`),t&&(t.style.left=`${i.clientX}px`)}return{activate(){n||(n=!0,r(),document.body.classList.add("grabby-crosshair-active"),document.addEventListener("mousemove",a,!0))},deactivate(){n&&(n=!1,document.body.classList.remove("grabby-crosshair-active"),document.removeEventListener("mousemove",a,!0),e&&(e.style.top="-10px"),t&&(t.style.left="-10px"))},isCrosshairElement(i){return i===e||i===t||i.id===Tt||i.id===kt},dispose(){this.deactivate(),e?.remove(),t?.remove(),R(Ct),R(_n),e=null,t=null}}}function wa(e,t){for(let n of t)n==null||n===!1||e.appendChild(typeof n=="object"?n:document.createTextNode(String(n)))}function x(e,t,...n){let o=document.createElement(e);if(t)for(let[r,a]of Object.entries(t))a==null||a===!1||(r==="class"?o.className=String(a):r==="style"?Object.assign(o.style,a):r==="dataset"?Object.assign(o.dataset,a):r.startsWith("on")&&typeof a=="function"?o.addEventListener(r.slice(2).toLowerCase(),a):r in o&&typeof a!="string"?o[r]=a:o.setAttribute(r,a===!0?"":String(a)));return wa(o,n),o}var In="http://www.w3.org/2000/svg";function le(e,t){let n=String(e.size??16),o=document.createElementNS(In,"svg");o.setAttribute("width",n),o.setAttribute("height",n),o.setAttribute("viewBox",e.viewBox??"0 0 16 16"),o.setAttribute("fill",e.fill??"none"),o.setAttribute("aria-hidden","true"),(e.stroke!==void 0||e.fill===void 0)&&(o.setAttribute("stroke",e.stroke??"currentColor"),o.setAttribute("stroke-width",e.strokeWidth??"1.5"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),t&&o.setAttribute("class",t);for(let r of e.shapes){let a=document.createElementNS(In,r.tag);for(let[i,s]of Object.entries(r.attrs))a.setAttribute(i,s);o.appendChild(a)}return o}function Le(...e){return e.map(t=>({tag:"path",attrs:{d:t}}))}var Nn={shapes:Le("M5.5 7V3.5a1 1 0 0 1 2 0V7","M7.5 6.5V2.5a1 1 0 0 1 2 0v4","M9.5 7V3.5a1 1 0 0 1 2 0V8","M5.5 7V5.5a1 1 0 0 0-2 0V9a4 4 0 0 0 4 4h1.5a4 4 0 0 0 4-4V6a1 1 0 0 0-2 0")},$n={shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"6"}},...Le("M8 4.5V8l2.5 1.5")]},Ln={shapes:Le("M8 2v5","M4.5 4a5.5 5.5 0 1 0 7 0")},Je={shapes:Le("M4 4l8 8M12 4l-8 8")},Pn={fill:"none",shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"7",fill:"#22c55e"}},{tag:"path",attrs:{d:"M5 8l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]},Mn={viewBox:"0 0 10 10",size:10,fill:"none",shapes:[{tag:"path",attrs:{d:"M2 5.5l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]};var P="__grabby-toast__",_t="__grabby-toast-styles__",W=null;function xa(){U(_t)||_(_t,`
59
- #${P} {
63
+ `),R(Xn,"body.grabby-crosshair-active:not(.grabby-crosshair-held) { cursor: crosshair !important; }","document"))}function a(){e||(r(),e=document.createElement("div"),e.id=Lt,e.className="grabby-crosshair-line",N().appendChild(e)),t||(t=document.createElement("div"),t.id=Nt,t.className="grabby-crosshair-line",N().appendChild(t))}function i(){e&&(e.style.top="-10px"),t&&(t.style.left="-10px")}function s(l){o||(e&&(e.style.top=`${l.clientY}px`),t&&(t.style.left=`${l.clientX}px`))}return{activate(){n||(n=!0,a(),document.body.classList.add("grabby-crosshair-active"),document.addEventListener("mousemove",s,!0))},deactivate(){n&&(n=!1,document.body.classList.remove("grabby-crosshair-active"),document.removeEventListener("mousemove",s,!0),i())},hold(l){o!==l&&(o=l,document.body.classList.toggle("grabby-crosshair-held",l),l&&i())},isCrosshairElement(l){return l===e||l===t||l.id===Lt||l.id===Nt},dispose(){this.hold(!1),this.deactivate(),e?.remove(),t?.remove(),I(It),I(Xn),e=null,t=null}}}function fi(e,t){for(let n of t)n==null||n===!1||e.appendChild(typeof n=="object"?n:document.createTextNode(String(n)))}function w(e,t,...n){let o=document.createElement(e);if(t)for(let[r,a]of Object.entries(t))a==null||a===!1||(r==="class"?o.className=String(a):r==="style"?Object.assign(o.style,a):r==="dataset"?Object.assign(o.dataset,a):r.startsWith("on")&&typeof a=="function"?o.addEventListener(r.slice(2).toLowerCase(),a):r in o&&typeof a!="string"?o[r]=a:o.setAttribute(r,a===!0?"":String(a)));return fi(o,n),o}var Zn="http://www.w3.org/2000/svg";function ue(e,t){let n=String(e.size??16),o=document.createElementNS(Zn,"svg");o.setAttribute("width",n),o.setAttribute("height",n),o.setAttribute("viewBox",e.viewBox??"0 0 16 16"),o.setAttribute("fill",e.fill??"none"),o.setAttribute("aria-hidden","true"),(e.stroke!==void 0||e.fill===void 0)&&(o.setAttribute("stroke",e.stroke??"currentColor"),o.setAttribute("stroke-width",e.strokeWidth??"1.5"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),t&&o.setAttribute("class",t);for(let r of e.shapes){let a=document.createElementNS(Zn,r.tag);for(let[i,s]of Object.entries(r.attrs))a.setAttribute(i,s);o.appendChild(a)}return o}function He(...e){return e.map(t=>({tag:"path",attrs:{d:t}}))}var $t={shapes:He("M5.5 7V3.5a1 1 0 0 1 2 0V7","M7.5 6.5V2.5a1 1 0 0 1 2 0v4","M9.5 7V3.5a1 1 0 0 1 2 0V8","M5.5 7V5.5a1 1 0 0 0-2 0V9a4 4 0 0 0 4 4h1.5a4 4 0 0 0 4-4V6a1 1 0 0 0-2 0")},Jn={shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"6"}},...He("M8 4.5V8l2.5 1.5")]},Qn={shapes:He("M8 2v5","M4.5 4a5.5 5.5 0 1 0 7 0")},it={shapes:He("M4 4l8 8M12 4l-8 8")},eo={fill:"none",shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"7",fill:"#22c55e"}},{tag:"path",attrs:{d:"M5 8l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]},to={viewBox:"0 0 10 10",size:10,fill:"none",shapes:[{tag:"path",attrs:{d:"M2 5.5l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]};var H="__grabby-toast__",Mt="__grabby-toast-styles__",Z=null;function pi(){z(Mt)||R(Mt,`
64
+ #${H} {
60
65
  position: fixed;
61
66
  bottom: var(--grabby-toast-bottom, 24px);
62
67
  left: 50%;
@@ -75,13 +80,13 @@
75
80
  max-width: 480px;
76
81
  min-width: 260px;
77
82
  }
78
- #${P} .grabby-toast-actions {
83
+ #${H} .grabby-toast-actions {
79
84
  margin-left: auto;
80
85
  display: flex;
81
86
  gap: 6px;
82
87
  padding-left: 12px;
83
88
  }
84
- #${P} .grabby-toast-action {
89
+ #${H} .grabby-toast-action {
85
90
  pointer-events: auto;
86
91
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
87
92
  padding: 6px 10px;
@@ -92,40 +97,40 @@
92
97
  cursor: pointer;
93
98
  white-space: nowrap;
94
99
  }
95
- #${P}:not(.grabby-toast-visible) .grabby-toast-action {
100
+ #${H}:not(.grabby-toast-visible) .grabby-toast-action {
96
101
  pointer-events: none;
97
102
  }
98
- #${P} .grabby-toast-action:hover {
103
+ #${H} .grabby-toast-action:hover {
99
104
  background: var(--grabby-surface, #f1f5f9);
100
105
  }
101
- #${P} .grabby-toast-action-primary {
106
+ #${H} .grabby-toast-action-primary {
102
107
  background: var(--grabby-accent, #2563eb);
103
108
  border-color: var(--grabby-accent, #2563eb);
104
109
  color: #fff;
105
110
  }
106
- #${P} .grabby-toast-action-primary:hover {
111
+ #${H} .grabby-toast-action-primary:hover {
107
112
  background: var(--grabby-accent-hover, #1d4ed8);
108
113
  }
109
- #${P}.grabby-toast-visible {
114
+ #${H}.grabby-toast-visible {
110
115
  transform: translateX(-50%) translateY(0);
111
116
  opacity: 1;
112
117
  }
113
- #${P} .grabby-toast-header {
118
+ #${H} .grabby-toast-header {
114
119
  display: flex;
115
120
  align-items: center;
116
121
  gap: 8px;
117
122
  margin-bottom: 0;
118
123
  }
119
- #${P} .grabby-toast-icon {
124
+ #${H} .grabby-toast-icon {
120
125
  flex-shrink: 0;
121
126
  width: 16px;
122
127
  height: 16px;
123
128
  }
124
- #${P} .grabby-toast-title {
129
+ #${H} .grabby-toast-title {
125
130
  font-weight: 600;
126
131
  color: var(--grabby-toast-title, #334155);
127
132
  }
128
- #${P} .grabby-toast-details {
133
+ #${H} .grabby-toast-details {
129
134
  margin-top: 8px;
130
135
  display: flex;
131
136
  flex-direction: column;
@@ -133,23 +138,23 @@
133
138
  font-size: 12px;
134
139
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
135
140
  }
136
- #${P} .grabby-toast-row {
141
+ #${H} .grabby-toast-row {
137
142
  display: flex;
138
143
  gap: 8px;
139
144
  align-items: baseline;
140
145
  }
141
- #${P} .grabby-toast-label {
146
+ #${H} .grabby-toast-label {
142
147
  color: var(--grabby-toast-label, #64748b);
143
148
  flex-shrink: 0;
144
149
  min-width: 72px;
145
150
  }
146
- #${P} .grabby-toast-value {
151
+ #${H} .grabby-toast-value {
147
152
  color: var(--grabby-toast-text, #334155);
148
153
  overflow: hidden;
149
154
  text-overflow: ellipsis;
150
155
  white-space: nowrap;
151
156
  }
152
- #${P} .grabby-toast-file-link {
157
+ #${H} .grabby-toast-file-link {
153
158
  color: var(--grabby-toast-text, #334155);
154
159
  text-decoration: none;
155
160
  overflow: hidden;
@@ -158,11 +163,11 @@
158
163
  pointer-events: auto;
159
164
  cursor: pointer;
160
165
  }
161
- #${P} .grabby-toast-file-link:hover {
166
+ #${H} .grabby-toast-file-link:hover {
162
167
  text-decoration: underline;
163
168
  color: var(--grabby-accent, #2563eb);
164
169
  }
165
- `)}var ce=null;function Sa(){return ce?.isConnected||(xa(),ce=x("div",{id:P,role:"status","aria-live":"polite"}),N().appendChild(ce)),ce}function Ca(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}function At(e,t){return x("div",{class:"grabby-toast-row"},x("span",{class:"grabby-toast-label"},e),typeof t=="string"?x("span",{class:"grabby-toast-value"},t):t)}function G(e,t={}){let n=Sa(),{detail:o,actions:r}=t,a=t.duration??(r?.length?8e3:3500),i=[x("div",{class:"grabby-toast-header"},le(Pn,"grabby-toast-icon"),x("span",{class:"grabby-toast-title"},e))];if(o){let s=x("div",{class:"grabby-toast-details"});if(o.componentName&&s.appendChild(At("Component",o.componentName)),o.filePath){let u=o.line!=null?`${o.filePath}:${o.line}`:o.filePath;s.appendChild(At("File",x("a",{class:"grabby-toast-file-link",href:Ca(o.filePath,o.line,o.column),title:"Open in VS Code"},u)))}o.cssClasses&&o.cssClasses.length>0&&s.appendChild(At("Classes",o.cssClasses.map(u=>`.${u}`).join(" "))),i.push(s)}r?.length&&i[0].appendChild(x("span",{class:"grabby-toast-actions"},...r.map(s=>x("button",{type:"button",class:s.primary?"grabby-toast-action grabby-toast-action-primary":"grabby-toast-action",onclick:u=>{u.stopPropagation(),Ta(),s.onClick()}},s.label)))),n.replaceChildren(...i),W&&(clearTimeout(W),W=null),n.classList.remove("grabby-toast-visible"),n.offsetHeight,n.classList.add("grabby-toast-visible"),W=setTimeout(()=>{n.classList.remove("grabby-toast-visible"),W=null},a)}function Ta(){W&&(clearTimeout(W),W=null),ce?.classList.remove("grabby-toast-visible")}function Dn(){W&&(clearTimeout(W),W=null),ce?.remove(),ce=null,R(_t)}function Fn(e){return Array.from(e).filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))}function On(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);let t="";for(let n=0;n<e.length;n++){let o=e.charAt(n),r=e.charCodeAt(n);if(r===0){t+="\uFFFD";continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&e.charCodeAt(0)===45){t+=`\\${r.toString(16)} `;continue}if(n===0&&e.length===1&&r===45){t+=`\\${o}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){t+=o;continue}t+=`\\${o}`}return t}function Pe(e,t=document){if(!e)return null;try{return t.querySelector(e)}catch{return null}}var ka=["data-testid","data-test","data-cy","data-qa"],Aa=8;function Qe(e,t){try{let n=t.ownerDocument.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}function _a(e){let t=e.tagName.toLowerCase(),n=e.parentElement;if(!n)return t;let o=Array.from(n.children).filter(r=>r.tagName===e.tagName);return o.length===1?t:`${t}:nth-of-type(${o.indexOf(e)+1})`}function Hn(e){for(let o of ka){let r=e.getAttribute(o);if(r){let a=`[${o}="${r.replace(/["\\]/g,"\\$&")}"]`;if(Qe(a,e))return a}}if(e.id){let o=`#${On(e.id)}`;if(Qe(o,e))return o}let t=[],n=e;for(;n&&t.length<Aa;){if(n!==e&&n.id){let r=`#${On(n.id)}`;if(Qe(r,n)){t.unshift(r);break}}t.unshift(_a(n));let o=t.join(" > ");if(Qe(o,e))return o;if(n.tagName==="BODY"||n.tagName==="HTML")break;n=n.parentElement}return t.join(" > ")}var Ra=new Set(["BUTTON","A","SUMMARY"]),Ia=new Set(["button","link","tab","menuitem","menuitemcheckbox","menuitemradio","switch","option","checkbox","radio"]),Bn=new Set(["button","submit","reset","image"]),Na=new Set(["INPUT","SELECT","TEXTAREA"]),$a=new Set(["textbox","combobox","searchbox","spinbutton","slider"]),La=new Set(["IMG","SVG","VIDEO","PICTURE","CANVAS","IFRAME","AUDIO"]),Pa=new Set(["H1","H2","H3","H4","H5","H6","P","SPAN","LABEL","LI","STRONG","EM","B","I","SMALL","BLOCKQUOTE","CODE","PRE","TD","TH","DT","DD","FIGCAPTION","LEGEND","CAPTION","Q","CITE","MARK","TIME"]),Gn=new Set(["HTML","BODY","MAIN"]),Ma=new Set(["HEADER","FOOTER","NAV","ASIDE"]),Da=.6;function et(e){return(e.getAttribute("role")??"").toLowerCase()}function Rt(e){return Ra.has(e.tagName)?e.tagName!=="A"||e.hasAttribute("href")||e.hasAttribute("role"):e.tagName==="INPUT"&&Bn.has(e.type)?!0:Ia.has(et(e))}function It(e){return e.tagName==="INPUT"?!Bn.has(e.type):Na.has(e.tagName)||e.isContentEditable&&e.getAttribute("contenteditable")!==null?!0:$a.has(et(e))}function Un(e){let t=e.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;if(!n||!o)return!1;let r=Math.max(0,Math.min(t.right,n)-Math.max(t.left,0)),a=Math.max(0,Math.min(t.bottom,o)-Math.max(t.top,0));return r*a/(n*o)>=Da}function Oa(e){return e.children.length>0}function Vn(e){return Gn.has(e.tagName)?"section":La.has(e.tagName)?"media":It(e)?"field":Rt(e)?"action":Ma.has(e.tagName)||et(e)==="main"||et(e)==="region"?Un(e)?"section":"container":Pa.has(e.tagName)||!Oa(e)&&(e.textContent??"").trim()?"text":Un(e)?"section":"container"}var Fa=3;function zn(e){if(Rt(e)||It(e))return e;let t=e.parentElement;for(let n=0;t&&n<Fa;n++){if(Rt(t)||It(t))return t;if(Gn.has(t.tagName))break;t=t.parentElement}return e}var Ha=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,Ua=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g,Ba=/\b(Bearer|Basic|Token)\s+[A-Za-z0-9._~+/=-]{8,}/gi,Ga=/\b\d(?:[ -]?\d){8,}\b/g,Va=/\b[A-Za-z0-9_-]{32,}\b/g,za=/([?&#](?:access_token|id_token|token|key|api_key|apikey|secret|password|pass|auth|code|session|sig|signature)=)[^&#\s]*/gi;function O(e,t={}){if(!e)return e;let n=e.replace(za,"$1[redacted]").replace(Ua,"[token]").replace(Ba,"$1 [token]");return(t.keepEmails?n:n.replace(Ha,"[email]")).replace(Ga,"[number]").replace(Va,o=>/\d/.test(o)&&/[A-Za-z]/.test(o)?"[token]":o)}function jn(e,t=[]){let n=e.pathname||"/";if(t.length>0&&e.search){let o=new URLSearchParams(e.search),r=new URLSearchParams;for(let i of t){let s=o.get(i);s!==null&&r.set(i,s)}let a=r.toString();a&&(n+=`?${a}`)}return e.hash.startsWith("#/")&&(n+=e.hash.split("?")[0]),O(n)}function Me(e,t=typeof location<"u"?location.href:"http://localhost/"){try{let n=new URL(e,t);if(n.protocol==="javascript:"||n.protocol==="data:"||n.protocol==="vbscript:")return`${n.protocol}\u2026`;let o=new URL(t),r=n.pathname+(n.hash.startsWith("#/")?n.hash:"");return O(n.origin===o.origin?r:`${n.host}${r}`)}catch{return O(e.split(/[?#]/)[0])}}var tt="data-grabby-mask",te="data-grabby-ignore",ja=["id","class","role","aria-label","data-testid","data-test","data-cy","name","type","href","src","alt","placeholder","title","for","aria-expanded","aria-selected","disabled"],Ka=new Set(["href","src"]),Wa=8,Ya=60,Xa=80,qa=80,Kn=300;function Za(e){return e.startsWith("_ng")||e.startsWith("ng-reflect-")||e.startsWith("data-v-")||e.startsWith("data-grabby-")||e.startsWith("data-svelte")||e==="style"||e==="value"||e.startsWith("on")}function De(e){return e.startsWith("ng-")||e.startsWith("_ng")||/^svelte-[a-z0-9]+$/i.test(e)||/^s-[A-Za-z0-9_-]{8,}$/.test(e)}function X(e,t){return e.length<=t?e:`${e.slice(0,t-1).trimEnd()}\u2026`}function nt(e){return e.closest(`[${tt}]`)!==null}function ne(e,t){if(nt(e))return"[masked]";let n="",o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let r=o.nextNode();r;r=o.nextNode()){let a=r.parentElement;if(!(a&&/^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE)$/.test(a.tagName))&&!a?.closest(`[${te}], [${tt}]`)&&(n+=` ${r.nodeValue??""}`,n.length>t*3))break}return X(O(n.replace(/\s+/g," ").trim()),t)}function Wn(e){let t="";for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE&&(t+=` ${n.nodeValue??""}`);return t.replace(/\s+/g," ").trim()}function Ja(e,t,n,o){if(t==="class"){let r=o(n.split(/\s+/).filter(Boolean));return r.length===0?null:X(r.join(" "),Ya)}return Ka.has(t)?X(Me(n),120):X(O(n,{keepEmails:t==="placeholder"}),Xa)}function Qa(e,t=n=>n.filter(o=>!De(o))){let n=e.tagName.toLowerCase(),o=[],r=new Set,a=i=>{if(o.length>=Wa||r.has(i)||Za(i))return;let s=e.getAttribute(i);if(s===null)return;if(r.add(i),s===""){o.push(i);return}let u=Ja(e,i,s,t);u!==null&&o.push(`${i}="${u.replace(/"/g,"&quot;")}"`)};for(let i of ja)a(i);for(let{name:i}of Array.from(e.attributes))i.startsWith("aria-")&&a(i);return`<${n}${o.length?` ${o.join(" ")}`:""}>`}function Yn(e,t){let n=e.tagName.toLowerCase(),o=Qa(e,t);if(/^(img|input|br|hr|meta|link|source|area|col|embed|wbr)$/.test(n))return X(o,Kn);let r=Array.from(e.children).filter(i=>!i.hasAttribute(te)),a;if(nt(e))a="[masked]";else if(r.length===0)a=X(O(Wn(e)),qa);else if(r.length<=2){let i=X(O(Wn(e)),40),s=r.map(u=>{let l=ne(u,30);return`<${u.tagName.toLowerCase()}${l?`>${l}</${u.tagName.toLowerCase()}>`:" \u2026>"}`});a=[i,...s].filter(Boolean).join(" ")}else a=`(${r.length} elements)`;return X(`${o}${a}</${n}>`,Kn)}function Xn(e){let t=null,n=!1;function o(l){let c=e.getComponentResolver();return c?c(l)?.name??null:null}function r(l){let c=e.getSourceResolver();if(!c)return null;let m=c(l);if(!m?.filePath)return null;let f=m.filePath;return m.line!=null&&(f+=`:${m.line}`),f}function a(l,c){let m=e.getFreezeElement?.();m&&(m.style.pointerEvents="none");let f=document.elementFromPoint(l,c);return m&&(m.style.pointerEvents="auto"),f}function i(l,c,m){let f=a(l,c);return!f||f.closest(`[${te}]`)?f&&e.isToolbarElement?.(f)?f:null:m?f:zn(f)}function s(l){let c=i(l.clientX,l.clientY,l.shiftKey);if(!c||e.overlay.isOverlayElement(c)||e.crosshair.isCrosshairElement(c)||e.isToolbarElement?.(c)||c===t)return;t=c;let m=o(c),f=r(c),p=Fn(c.classList);e.overlay.show(c,m,f,p),e.onHover(c)}function u(l){let c=se(l);if(c&&e.isToolbarElement?.(c))return;let m=a(l.clientX,l.clientY);m&&(e.isToolbarElement?.(m)||e.crosshair.isCrosshairElement(m))||(l.preventDefault(),l.stopPropagation(),t&&e.onSelect(t))}return{activate(){n||(n=!0,e.crosshair.activate(),document.addEventListener("mousemove",s,!0),document.addEventListener("click",u,!0))},deactivate(){n&&(n=!1,t=null,e.crosshair.deactivate(),document.removeEventListener("mousemove",s,!0),document.removeEventListener("click",u,!0),e.overlay.hide(),e.onHover(null))},getHoveredElement(){return t},dispose(){this.deactivate()}}}function qn(e){let t=e.split("+").map(o=>o.trim()),n={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let o of t){let r=o.toLowerCase();r==="meta"||r==="cmd"||r==="command"?n.meta=!0:r==="ctrl"||r==="control"?n.ctrl=!0:r==="shift"?n.shift=!0:r==="alt"||r==="option"?n.alt=!0:n.key=r}return n}function Zn(e,t){return e.key&&e.key.toLowerCase()===t?!0:e.code?/^[a-z]$/.test(t)?e.code===`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?e.code===`Digit${t}`:!1:!1}function ei(e,t){return t.meta&&!e.metaKey||t.ctrl&&!e.ctrlKey||t.shift&&!e.shiftKey||t.alt&&!e.altKey?!1:Zn(e,t.key)}function Jn(e){let t=null,n=!1,o=!1;function r(i){if(!e.getEnableInInputs()&&ve(se(i)))return;let s=qn(e.getActivationKey());if(!ei(i,s))return;let u=e.getActivationMode(),l=e.getKeyHoldDuration();if(u==="hold"){if(i.preventDefault(),n)return;if(l>0){if(t)return;t=setTimeout(()=>{n=!0,e.onActivate()},l)}else n=!0,e.onActivate()}else i.preventDefault()}function a(i){let s=qn(e.getActivationKey());if(!Zn(i,s.key))return;e.getActivationMode()==="hold"?(t&&(clearTimeout(t),t=null),n&&(n=!1,e.onDeactivate())):e.isActive()?e.onDeactivate():e.onActivate()}return{start(){o||(o=!0,document.addEventListener("keydown",r,!0),document.addEventListener("keyup",a,!0))},stop(){o&&(o=!1,t&&(clearTimeout(t),t=null),n=!1,document.removeEventListener("keydown",r,!0),document.removeEventListener("keyup",a,!0))},dispose(){this.stop()}}}function Qn(){let e=new Map,t=new Map;return{register(n,o){if(e.has(n.name)&&this.unregister(n.name),e.set(n.name,n),n.setup){let r=n.setup(o);r&&t.set(n.name,r)}},unregister(n){let o=t.get(n);o&&(o(),t.delete(n)),e.delete(n)},callHook(n,...o){for(let r of e.values()){let a=r.hooks?.[n];if(a)try{a(...o)}catch(i){console.warn(`[grabby] Plugin "${r.name}" hook "${n}" threw:`,i)}}},callTransformHook(n,o){let r=n;for(let a of e.values()){let i=a.hooks?.transformCopyContent;if(i)try{r=i(r,o)}catch(s){console.warn(`[grabby] Plugin "${a.name}" transformCopyContent threw:`,s)}}return r},getPlugins(){return Array.from(e.values())},dispose(){for(let n of t.values())try{n()}catch{}t.clear(),e.clear()}}}function ti(e){try{let t=new URL(e,typeof location<"u"?location.href:void 0);return t.protocol==="https:"?!0:t.protocol==="http:"&&/^(localhost|127\.0\.0\.1|\[::1\])$/.test(t.hostname)}catch{return!1}}function eo(e){return ti(e)?{name:"webhook",hooks:{onComment(t){fetch(e,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"grabby.comment",version:1,origin:typeof location<"u"?location.origin:null,comment:t})}).catch(()=>{})}}}:(console.warn(`[grabby] webhookUrl must be https:// or http://localhost; ignoring "${e}".`),{name:"webhook"})}var to="theme-vars",no="theme-overrides",ni=`
170
+ `)}var de=null;function bi(){return de?.isConnected||(pi(),de=w("div",{id:H,role:"status","aria-live":"polite"}),N().appendChild(de)),de}function gi(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}function Pt(e,t){return w("div",{class:"grabby-toast-row"},w("span",{class:"grabby-toast-label"},e),typeof t=="string"?w("span",{class:"grabby-toast-value"},t):t)}function Y(e,t={}){let n=bi(),{detail:o,actions:r}=t,a=t.duration??(r?.length?8e3:3500),i=[w("div",{class:"grabby-toast-header"},ue(eo,"grabby-toast-icon"),w("span",{class:"grabby-toast-title"},e))];if(o){let s=w("div",{class:"grabby-toast-details"});if(o.componentName&&s.appendChild(Pt("Component",o.componentName)),o.filePath){let l=o.line!=null?`${o.filePath}:${o.line}`:o.filePath;s.appendChild(Pt("File",w("a",{class:"grabby-toast-file-link",href:gi(o.filePath,o.line,o.column),title:"Open in VS Code"},l)))}o.cssClasses&&o.cssClasses.length>0&&s.appendChild(Pt("Classes",o.cssClasses.map(l=>`.${l}`).join(" "))),i.push(s)}r?.length&&i[0].appendChild(w("span",{class:"grabby-toast-actions"},...r.map(s=>w("button",{type:"button",class:s.primary?"grabby-toast-action grabby-toast-action-primary":"grabby-toast-action",onclick:l=>{l.stopPropagation(),hi(),s.onClick()}},s.label)))),n.replaceChildren(...i),Z&&(clearTimeout(Z),Z=null),n.classList.remove("grabby-toast-visible"),n.offsetHeight,n.classList.add("grabby-toast-visible"),Z=setTimeout(()=>{n.classList.remove("grabby-toast-visible"),Z=null},a)}function hi(){Z&&(clearTimeout(Z),Z=null),de?.classList.remove("grabby-toast-visible")}function no(){Z&&(clearTimeout(Z),Z=null),de?.remove(),de=null,I(Mt)}function ro(e){return Array.from(e).filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))}function oo(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);let t="";for(let n=0;n<e.length;n++){let o=e.charAt(n),r=e.charCodeAt(n);if(r===0){t+="\uFFFD";continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&e.charCodeAt(0)===45){t+=`\\${r.toString(16)} `;continue}if(n===0&&e.length===1&&r===45){t+=`\\${o}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){t+=o;continue}t+=`\\${o}`}return t}function Ue(e,t=document){if(!e)return null;try{return t.querySelector(e)}catch{return null}}var yi=["data-testid","data-test","data-cy","data-qa"],vi=8;function st(e,t){try{let n=t.ownerDocument.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}function Ei(e){let t=e.tagName.toLowerCase(),n=e.parentElement;if(!n)return t;let o=Array.from(n.children).filter(r=>r.tagName===e.tagName);return o.length===1?t:`${t}:nth-of-type(${o.indexOf(e)+1})`}function ao(e){for(let o of yi){let r=e.getAttribute(o);if(r){let a=`[${o}="${r.replace(/["\\]/g,"\\$&")}"]`;if(st(a,e))return a}}if(e.id){let o=`#${oo(e.id)}`;if(st(o,e))return o}let t=[],n=e;for(;n&&t.length<vi;){if(n!==e&&n.id){let r=`#${oo(n.id)}`;if(st(r,n)){t.unshift(r);break}}t.unshift(Ei(n));let o=t.join(" > ");if(st(o,e))return o;if(n.tagName==="BODY"||n.tagName==="HTML")break;n=n.parentElement}return t.join(" > ")}function io(e){let t=null,n=null,o=!1;function r(f){let h=e.getComponentResolver();return h?h(f)?.name??null:null}function a(f){let h=e.getSourceResolver();if(!h)return null;let c=h(f);if(!c?.filePath)return null;let p=c.filePath;return c.line!=null&&(p+=`:${c.line}`),p}function i(f,h){let c=e.getFreezeElement?.();c&&(c.style.pointerEvents="none");let p=document.elementFromPoint(f,h);return c&&(c.style.pointerEvents="auto"),p}function s(f,h,c){let p=i(f,h);return!p||p.closest(`[${ae}]`)?p&&e.isToolbarElement?.(p)?p:null:c?p:Fn(p)}function l(f){let h=r(f),c=a(f),p=ro(f.classList);e.overlay.show(f,h,c,p)}function u(f){if(n)return;let h=s(f.clientX,f.clientY,f.shiftKey);!h||e.overlay.isOverlayElement(h)||e.crosshair.isCrosshairElement(h)||e.isToolbarElement?.(h)||h!==t&&(t=h,l(h),e.onHover(h))}function d(f){let h=ce(f);if(h&&e.isToolbarElement?.(h))return;let c=i(f.clientX,f.clientY);c&&(e.isToolbarElement?.(c)||e.crosshair.isCrosshairElement(c))||(f.preventDefault(),f.stopPropagation(),!n&&t&&e.onSelect(t))}return{activate(){o||(o=!0,e.crosshair.activate(),document.addEventListener("mousemove",u,!0),document.addEventListener("click",d,!0))},deactivate(){o&&(o=!1,t=null,n=null,e.crosshair.hold(!1),e.crosshair.deactivate(),document.removeEventListener("mousemove",u,!0),document.removeEventListener("click",d,!0),e.overlay.hide(),e.onHover(null))},hold(f){o&&(n=f,t=f,e.crosshair.hold(!0),l(f))},release(){n&&(n=null,e.crosshair.hold(!1))},isHolding(){return n!==null},getHoveredElement(){return t},dispose(){this.deactivate()}}}function so(e){let t=e.split("+").map(o=>o.trim()),n={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let o of t){let r=o.toLowerCase();r==="meta"||r==="cmd"||r==="command"?n.meta=!0:r==="ctrl"||r==="control"?n.ctrl=!0:r==="shift"?n.shift=!0:r==="alt"||r==="option"?n.alt=!0:n.key=r}return n}function lo(e,t){return e.key&&e.key.toLowerCase()===t?!0:e.code?/^[a-z]$/.test(t)?e.code===`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?e.code===`Digit${t}`:!1:!1}function xi(e,t){return t.meta&&!e.metaKey||t.ctrl&&!e.ctrlKey||t.shift&&!e.shiftKey||t.alt&&!e.altKey?!1:lo(e,t.key)}function co(e){let t=null,n=!1,o=!1,r=!1;function a(s){if(!e.getEnableInInputs()&&ve(ce(s)))return;let l=so(e.getActivationKey());if(!xi(s,l))return;let u=e.getActivationMode(),d=e.getKeyHoldDuration();if(u==="hold"){if(s.preventDefault(),n)return;if(d>0){if(t)return;t=setTimeout(()=>{n=!0,e.onActivate()},d)}else n=!0,e.onActivate()}else s.preventDefault(),o=!0}function i(s){let l=so(e.getActivationKey());if(!lo(s,l.key))return;if(e.getActivationMode()==="hold")t&&(clearTimeout(t),t=null),n&&(n=!1,e.onDeactivate());else{if(!o)return;o=!1,e.isActive()?e.onDeactivate():e.onActivate()}}return{start(){r||(r=!0,document.addEventListener("keydown",a,!0),document.addEventListener("keyup",i,!0))},stop(){r&&(r=!1,t&&(clearTimeout(t),t=null),n=!1,o=!1,document.removeEventListener("keydown",a,!0),document.removeEventListener("keyup",i,!0))},dispose(){this.stop()}}}function uo(){let e=new Map,t=new Map;return{register(n,o){if(e.has(n.name)&&this.unregister(n.name),e.set(n.name,n),n.setup){let r=n.setup(o);r&&t.set(n.name,r)}},unregister(n){let o=t.get(n);o&&(o(),t.delete(n)),e.delete(n)},callHook(n,...o){for(let r of e.values()){let a=r.hooks?.[n];if(a)try{a(...o)}catch(i){console.warn(`[grabby] Plugin "${r.name}" hook "${n}" threw:`,i)}}},callTransformHook(n,o){let r=n;for(let a of e.values()){let i=a.hooks?.transformCopyContent;if(i)try{r=i(r,o)}catch(s){console.warn(`[grabby] Plugin "${a.name}" transformCopyContent threw:`,s)}}return r},getPlugins(){return Array.from(e.values())},dispose(){for(let n of t.values())try{n()}catch{}t.clear(),e.clear()}}}function wi(e){try{let t=new URL(e,typeof location<"u"?location.href:void 0);return t.protocol==="https:"?!0:t.protocol==="http:"&&/^(localhost|127\.0\.0\.1|\[::1\])$/.test(t.hostname)}catch{return!1}}function mo(e){return wi(e)?{name:"webhook",hooks:{onComment(t){fetch(e,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"grabby.comment",version:1,origin:typeof location<"u"?location.origin:null,comment:t})}).catch(()=>{})}}}:(console.warn(`[grabby] webhookUrl must be https:// or http://localhost; ignoring "${e}".`),{name:"webhook"})}var fo="theme-vars",po="theme-overrides",Si=`
166
171
  :host {
167
172
  all: initial;
168
173
  --grabby-bg: #ffffff;
@@ -193,11 +198,11 @@
193
198
  --grabby-popover-hover: #f1f5f9;
194
199
  --grabby-popover-shadow: rgba(0, 0, 0, 0.12);
195
200
  }
196
- `,oi={overlayBorderColor:"--grabby-overlay-border",overlayBgColor:"--grabby-overlay-bg",labelBgColor:"--grabby-label-bg",labelTextColor:"--grabby-label-text",toastBgColor:"--grabby-toast-bg",toastTextColor:"--grabby-toast-text",toolbarBgColor:"--grabby-toolbar-bg",toolbarTextColor:"--grabby-toolbar-text",toolbarAccentColor:"--grabby-toolbar-active",popoverBgColor:"--grabby-popover-bg",popoverTextColor:"--grabby-popover-text",popoverBorderColor:"--grabby-popover-border"},ri=/^[#a-zA-Z0-9\s(),.%-]+$/;function oo(){return{apply(e){_(to,ni)},applyOverrides(e){let t=[];for(let[n,o]of Object.entries(oi)){let r=e[n];r&&ri.test(r)&&!/url\s*\(/i.test(r)&&t.push(` ${o}: ${r};`)}if(t.length===0){this.clearOverrides();return}_(no,` :host {
201
+ `,Ci={overlayBorderColor:"--grabby-overlay-border",overlayBgColor:"--grabby-overlay-bg",labelBgColor:"--grabby-label-bg",labelTextColor:"--grabby-label-text",toastBgColor:"--grabby-toast-bg",toastTextColor:"--grabby-toast-text",toolbarBgColor:"--grabby-toolbar-bg",toolbarTextColor:"--grabby-toolbar-text",toolbarAccentColor:"--grabby-toolbar-active",popoverBgColor:"--grabby-popover-bg",popoverTextColor:"--grabby-popover-text",popoverBorderColor:"--grabby-popover-border"},Ti=/^[#a-zA-Z0-9\s(),.%-]+$/;function bo(){return{apply(e){R(fo,Si)},applyOverrides(e){let t=[];for(let[n,o]of Object.entries(Ci)){let r=e[n];r&&Ti.test(r)&&!/url\s*\(/i.test(r)&&t.push(` ${o}: ${r};`)}if(t.length===0){this.clearOverrides();return}R(po,` :host {
197
202
  ${t.join(`
198
203
  `)}
199
- }`)},clearOverrides(){R(no)},dispose(){R(to),this.clearOverrides()}}}var $="__grabby-toolbar__",Nt="__grabby-toolbar-styles__";function ai(e){if(e.length===0)return null;let t=0,n=0;for(let o of e)o.sync==="pending"?t++:o.sync==="failed"&&n++;return n?{text:`${n} not sent`,tone:"error"}:t?{text:"Sending\u2026",tone:"busy"}:{text:`${e.length} sent`,tone:"ok"}}function ro(e,t={}){let n=null,o=null,r={},a=new Set,i=null,s=null;function u(){U(Nt)||_(Nt,`
200
- #${$} {
204
+ }`)},clearOverrides(){I(po)},dispose(){I(fo),this.clearOverrides()}}}var L="__grabby-toolbar__",Ot="__grabby-toolbar-styles__";function ki(e){if(e.length===0)return null;let t=0,n=0;for(let o of e)o.sync==="pending"?t++:o.sync==="failed"&&n++;return n?{text:`${n} not sent`,tone:"error"}:t?{text:"Sending\u2026",tone:"busy"}:{text:`${e.length} sent`,tone:"ok"}}function go(e,t={}){let n=null,o=null,r={},a=new Set,i=null,s=null,l=null,u=!1;function d(){z(Ot)||R(Ot,`
205
+ #${L} {
201
206
  position: fixed;
202
207
  bottom: 20px;
203
208
  left: 50%;
@@ -215,12 +220,12 @@ ${t.join(`
215
220
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
216
221
  transition: opacity 0.2s ease, transform 0.2s ease;
217
222
  }
218
- #${$}.grabby-toolbar-hidden {
223
+ #${L}.grabby-toolbar-hidden {
219
224
  opacity: 0;
220
225
  transform: translateX(-50%) translateY(20px);
221
226
  pointer-events: none;
222
227
  }
223
- #${$} button {
228
+ #${L} button {
224
229
  display: flex;
225
230
  align-items: center;
226
231
  justify-content: center;
@@ -234,19 +239,19 @@ ${t.join(`
234
239
  padding: 0;
235
240
  transition: background 0.15s ease, color 0.15s ease;
236
241
  }
237
- #${$} button:hover {
242
+ #${L} button:hover {
238
243
  background: var(--grabby-toolbar-hover, #f1f5f9);
239
244
  color: var(--grabby-accent, #2563eb);
240
245
  }
241
- #${$} button { position: relative; }
242
- #${$} button.grabby-btn-labelled {
246
+ #${L} button { position: relative; }
247
+ #${L} button.grabby-btn-labelled {
243
248
  width: auto;
244
249
  gap: 6px;
245
250
  padding: 0 12px 0 10px;
246
251
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
247
252
  color: var(--grabby-accent, #2563eb);
248
253
  }
249
- #${$} .grabby-badge {
254
+ #${L} .grabby-badge {
250
255
  position: absolute;
251
256
  top: 1px;
252
257
  right: 1px;
@@ -261,22 +266,22 @@ ${t.join(`
261
266
  text-align: center;
262
267
  pointer-events: none;
263
268
  }
264
- #${$} .grabby-badge[hidden] { display: none; }
265
- #${$} button.grabby-btn-active {
269
+ #${L} .grabby-badge[hidden] { display: none; }
270
+ #${L} button.grabby-btn-active {
266
271
  color: var(--grabby-toolbar-active, #2563eb);
267
272
  }
268
- #${$} button.grabby-btn-disabled {
273
+ #${L} button.grabby-btn-disabled {
269
274
  opacity: 0.4;
270
275
  color: var(--grabby-toolbar-text, #64748b);
271
276
  }
272
- #${$} .grabby-toolbar-divider {
277
+ #${L} .grabby-toolbar-divider {
273
278
  width: 1px;
274
279
  height: 20px;
275
280
  background: var(--grabby-toolbar-border, #e2e8f0);
276
281
  margin: 0 4px;
277
282
  flex-shrink: 0;
278
283
  }
279
- #${$} .grabby-toolbar-left {
284
+ #${L} .grabby-toolbar-left {
280
285
  display: flex;
281
286
  align-items: center;
282
287
  gap: 2px;
@@ -285,18 +290,18 @@ ${t.join(`
285
290
  opacity: 1;
286
291
  transition: max-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
287
292
  }
288
- #${$} .grabby-toolbar-status {
293
+ #${L} .grabby-toolbar-status {
289
294
  padding: 0 6px;
290
295
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
291
296
  white-space: nowrap;
292
297
  color: #15803d;
293
298
  }
294
- #${$} .grabby-toolbar-status[data-tone="ok"]::before { content: "\u2713 "; }
295
- #${$} .grabby-toolbar-status[data-tone="busy"] { color: var(--grabby-toolbar-text, #64748b); }
296
- #${$} .grabby-toolbar-status[data-tone="error"] { color: #b91c1c; }
297
- #${$} .grabby-toolbar-status[hidden],
298
- #${$} button[hidden] { display: none; }
299
- #${$} button.grabby-btn-finish {
299
+ #${L} .grabby-toolbar-status[data-tone="ok"]::before { content: "\u2713 "; }
300
+ #${L} .grabby-toolbar-status[data-tone="busy"] { color: var(--grabby-toolbar-text, #64748b); }
301
+ #${L} .grabby-toolbar-status[data-tone="error"] { color: #b91c1c; }
302
+ #${L} .grabby-toolbar-status[hidden],
303
+ #${L} button[hidden] { display: none; }
304
+ #${L} button.grabby-btn-finish {
300
305
  width: auto;
301
306
  padding: 0 14px;
302
307
  margin-left: 2px;
@@ -305,23 +310,41 @@ ${t.join(`
305
310
  background: var(--grabby-accent, #2563eb);
306
311
  color: #fff;
307
312
  }
308
- #${$} button.grabby-btn-finish:hover {
313
+ #${L} button.grabby-btn-finish:hover {
309
314
  background: var(--grabby-accent-hover, #1d4ed8);
310
315
  color: #fff;
311
316
  }
312
- #${$} .grabby-toolbar-left.grabby-toolbar-left-hidden {
317
+ #${L} button.grabby-btn-expand { display: none; }
318
+ #${L}.grabby-toolbar-collapsed {
319
+ left: auto;
320
+ right: 20px;
321
+ transform: none;
322
+ padding: 4px;
323
+ }
324
+ #${L}.grabby-toolbar-collapsed.grabby-toolbar-hidden {
325
+ transform: translateY(20px);
326
+ }
327
+ #${L}.grabby-toolbar-collapsed > * { display: none !important; }
328
+ #${L}.grabby-toolbar-collapsed > button.grabby-btn-expand {
329
+ display: flex !important;
330
+ width: 40px;
331
+ height: 40px;
332
+ border-radius: 50%;
333
+ color: var(--grabby-accent, #2563eb);
334
+ }
335
+ #${L} .grabby-toolbar-left.grabby-toolbar-left-hidden {
313
336
  max-width: 0;
314
337
  opacity: 0;
315
338
  pointer-events: none;
316
339
  }
317
- `)}function l(m,f,p,g){let b=document.createElement("button");return b.type="button",b.appendChild(le(f)),b.title=p,b.setAttribute("aria-label",p),b.setAttribute("data-grabby-btn",m),b.addEventListener("click",E=>{E.preventDefault(),E.stopPropagation(),g()}),b}function c(){if(n)return;u(),n=document.createElement("div"),n.id=$,n.setAttribute("role","toolbar"),n.setAttribute("aria-label","Grabby toolbar"),r.selection=l("selection",Nn,"Comment on an element (Alt+G)",e.onSelectionMode),t.label&&(r.selection.classList.add("grabby-btn-labelled"),r.selection.append(document.createTextNode(t.label))),r.history=l("history",$n,"Comments",e.onHistory),i=document.createElement("span"),i.className="grabby-badge",i.hidden=!0,r.history.appendChild(i),r.enable=l("enable",Ln,"Enable/Disable",e.onEnableToggle),r.dismiss=l("dismiss",Je,t.dismissLabel??"Dismiss toolbar",e.onDismiss);let m=document.createElement("span");m.className="grabby-toolbar-divider",o=document.createElement("div"),o.className="grabby-toolbar-left",o.appendChild(r.selection),o.appendChild(r.history),o.appendChild(m),n.appendChild(o),t.review&&(s=document.createElement("span"),s.className="grabby-toolbar-status",s.setAttribute("role","status"),s.hidden=!0,r.finish=document.createElement("button"),r.finish.type="button",r.finish.className="grabby-btn-finish",r.finish.textContent="Finish review",r.finish.setAttribute("data-grabby-btn","finish"),r.finish.hidden=!0,r.finish.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation(),e.onFinish?.()}),n.appendChild(s),n.appendChild(r.finish),a.add(s)),t.hideEnable||n.appendChild(r.enable),n.appendChild(r.dismiss),N().appendChild(n),a.clear(),a.add(n),a.add(o),a.add(m);for(let f of Object.values(r))a.add(f)}return{show(){c(),n.classList.remove("grabby-toolbar-hidden")},hide(){n&&n.classList.add("grabby-toolbar-hidden")},update(m){if(!n)return;m.active?r.selection.classList.add("grabby-btn-active"):r.selection.classList.remove("grabby-btn-active");let f=m.toolbar.comments.length;if(i&&(i.hidden=f===0,i.textContent=f>99?"99+":String(f)),r.history.setAttribute("aria-label",f?`Comments (${f})`:"Comments"),s&&r.finish){let p=ai(m.toolbar.comments);s.hidden=!p,s.textContent=p?.text??"",s.dataset.tone=p?.tone??"",r.finish.hidden=f===0}m.options.enabled?(r.enable.classList.add("grabby-btn-active"),o?.classList.remove("grabby-toolbar-left-hidden")):(r.enable.classList.remove("grabby-btn-active"),o?.classList.add("grabby-toolbar-left-hidden"))},isToolbarElement(m){if(a.has(m))return!0;let f=m;for(;f;){if(f===n||f.id===$)return!0;f=f.parentElement}return!1},dispose(){n?.remove(),R(Nt),n=null,o=null,r={},i=null,s=null,a.clear()}}}function io(e){return Math.ceil(e.length/4)}var ao=new Set(["styles","layout","computed"]),ii=new Set(["label","type","text","href","placeholder","alt","src","title"]);function si(e,t){return t.length>0&&(e.includes(`>${t}<`)||e.includes(`"${t}"`)||e.includes(`>${t}`))}function li(e){return e.anonymous||!e.name?`anon:${e.sessionId}`:`name:${e.name}`}function Oe(e){return!e.anonymous&&e.name?e.name:`Anonymous ${e.sessionId.replace(/-/g,"").slice(0,4)}`}function ci(e){return e.split(/[\\/]/).pop()??e}function $t(e,t,n){let o=n?e:ci(e);return t!=null?`${o}:${t}`:o}function so(e,t){return e.split(`
340
+ `)}function f(c,p,g,y){let v=document.createElement("button");return v.type="button",v.appendChild(ue(p)),v.title=g,v.setAttribute("aria-label",g),v.setAttribute("data-grabby-btn",c),v.addEventListener("click",b=>{b.preventDefault(),b.stopPropagation(),y()}),v}function h(){if(n)return;d(),n=document.createElement("div"),n.id=L,n.setAttribute("role","toolbar"),n.setAttribute("aria-label","Grabby toolbar"),r.selection=f("selection",$t,"Comment on an element (Alt+G)",e.onSelectionMode),t.label&&(r.selection.classList.add("grabby-btn-labelled"),r.selection.append(document.createTextNode(t.label))),r.history=f("history",Jn,"Comments",e.onHistory),i=document.createElement("span"),i.className="grabby-badge",i.hidden=!0,r.history.appendChild(i),r.enable=f("enable",Qn,"Enable/Disable",e.onEnableToggle),r.dismiss=f("dismiss",it,t.dismissLabel??"Dismiss toolbar",e.onDismiss),r.expand=f("expand",$t,t.expandLabel??"Open Grabby toolbar",()=>e.onExpand?.()),r.expand.classList.add("grabby-btn-expand"),l=document.createElement("span"),l.className="grabby-badge",l.hidden=!0,r.expand.appendChild(l);let c=document.createElement("span");c.className="grabby-toolbar-divider",o=document.createElement("div"),o.className="grabby-toolbar-left",o.appendChild(r.selection),o.appendChild(r.history),o.appendChild(c),n.appendChild(o),t.review&&(s=document.createElement("span"),s.className="grabby-toolbar-status",s.setAttribute("role","status"),s.hidden=!0,r.finish=document.createElement("button"),r.finish.type="button",r.finish.className="grabby-btn-finish",r.finish.textContent="Finish review",r.finish.setAttribute("data-grabby-btn","finish"),r.finish.hidden=!0,r.finish.addEventListener("click",p=>{p.preventDefault(),p.stopPropagation(),e.onFinish?.()}),n.appendChild(s),n.appendChild(r.finish),a.add(s)),t.hideEnable||n.appendChild(r.enable),n.appendChild(r.dismiss),n.appendChild(r.expand),n.classList.toggle("grabby-toolbar-collapsed",u),N().appendChild(n),a.clear(),a.add(n),a.add(o),a.add(c);for(let p of Object.values(r))a.add(p)}return{show(){h(),n.classList.remove("grabby-toolbar-hidden")},hide(){n&&n.classList.add("grabby-toolbar-hidden")},update(c){if(!n)return;c.active?r.selection.classList.add("grabby-btn-active"):r.selection.classList.remove("grabby-btn-active");let p=c.toolbar.comments.length;for(let g of[i,l])g&&(g.hidden=p===0,g.textContent=p>99?"99+":String(p));if(r.history.setAttribute("aria-label",p?`Comments (${p})`:"Comments"),s&&r.finish){let g=ki(c.toolbar.comments);s.hidden=!g,s.textContent=g?.text??"",s.dataset.tone=g?.tone??"",r.finish.hidden=p===0}c.options.enabled?(r.enable.classList.add("grabby-btn-active"),o?.classList.remove("grabby-toolbar-left-hidden")):(r.enable.classList.remove("grabby-btn-active"),o?.classList.add("grabby-toolbar-left-hidden"))},collapse(){u=!0,n?.classList.add("grabby-toolbar-collapsed")},expand(){u=!1,n?.classList.remove("grabby-toolbar-collapsed")},isCollapsed(){return u},isToolbarElement(c){if(a.has(c))return!0;let p=c;for(;p;){if(p===n||p.id===L)return!0;p=p.parentElement}return!1},dispose(){n?.remove(),I(Ot),n=null,o=null,r={},i=null,l=null,s=null,a.clear()}}}function yo(e){return Math.ceil(e.length/4)}var ho=new Set(["styles","layout","computed"]),Ai=new Set(["label","type","text","href","placeholder","alt","src","title"]);function _i(e,t){return t.length>0&&(e.includes(`>${t}<`)||e.includes(`"${t}"`)||e.includes(`>${t}`))}function Ri(e){return e.anonymous||!e.name?`anon:${e.sessionId}`:`name:${e.name}`}function Be(e){return!e.anonymous&&e.name?e.name:`Anonymous ${e.sessionId.replace(/-/g,"").slice(0,4)}`}function Ii(e){return e.split(/[\\/]/).pop()??e}function Dt(e,t,n){let o=n?e:Ii(e);return t!=null?`${o}:${t}`:o}function vo(e,t){return e.split(`
318
341
  `).map((n,o)=>o===0?n:`${t}${n}`).join(`
319
- `)}function Ee(e){return Array.from(new Set(e))}function ui(e,t,n){let o=e.length,r=[`# UI feedback \xB7 ${o} comment${o===1?"":"s"}`],a=[];t.origin&&a.push(t.origin);let i=Ee(e.map(l=>l.framework).filter(Boolean));i.length&&a.push(i.join(", "));let s=Ee(e.map(l=>l.page.route));!n.showRoutes&&s.length===1&&a.push(`page ${s[0]}`);let u=e[0]?.page.viewport;if(u&&a.push(`${u[0]}\xD7${u[1]}`),a.push((t.now??new Date).toISOString().slice(0,10)),r.push(a.join(" \xB7 ")),n.showAuthors){let l=Ee(e.map(c=>Oe(c.author)));r.push(`From: ${l.join(", ")}`)}return r}function di(e,t,n){let o=e.target,a=[o.source?$t(o.source.file,o.source.line,!0):o.selector,o.component,`<${o.tag}>`].filter(Boolean).join(" "),i=n.showAuthors?` (${Oe(e.author)})`:"",s=n.showRoutes?` [${e.page.route}]`:"",u=n.showIds?` [id ${e.id}]`:"";return`${t}. ${a}${s} \u2014 ${so(e.comment," ")}${i}${u}`}function mi(e,t,n,o,r){let a=e.target,i=n.level==="detailed",s=[`${t}. ${so(e.comment," ")}`],u=p=>s.push(` - ${p}`),l=[`\`${a.preview}\``,`(${a.kind})`];a.component&&a.component!==r?l.push(a.source?.line!=null&&o?`${a.component} line ${a.source.line}`:a.component):a.source?.line!=null&&o&&l.push(`line ${a.source.line}`),u(l.join(" ")),(!a.source||i)&&u(`selector: \`${a.selector}\``);let c=Object.entries(a.facts).filter(([p,g])=>!ao.has(p)&&!(ii.has(p)&&!i&&si(a.preview,g)));c.length&&u(c.map(([p,g])=>`${p}: ${g}`).join(" \xB7 "));for(let[p,g]of Object.entries(a.facts))ao.has(p)&&u(`${p}: ${g}`);let m=a.stack.filter((p,g)=>!(g===0&&(a.source||p.name===a.component)));if(m.length&&u(`inside: ${m.map(p=>p.file?`${p.name} (${$t(p.file,p.line,i)})`:p.name).join(" \u203A ")}`),i){for(let[p,g]of Object.entries(a.extra))u(`${p}: ${g}`);u(`viewport: ${e.page.viewport[0]}\xD7${e.page.viewport[1]}`)}e.screenshot?.url&&u(`screenshot: ${e.screenshot.url}`);let f=[];return n.showAuthors&&f.push(`by ${Oe(e.author)}`),n.showRoutes&&f.push(`on ${e.page.route}`),f.length&&u(f.join(" ")),n.showIds&&u(`id: ${e.id}`),s}function lo(e,t="standard",n={}){if(e.length===0)return"";let o=[...e].sort((l,c)=>l.createdAt-c.createdAt),r=Ee(o.map(l=>li(l.author))),a={level:t,showIds:n.showIds===!0,showAuthors:r.length>1||o.some(l=>!l.author.anonymous&&!!l.author.name),showRoutes:Ee(o.map(l=>l.page.route)).length>1},i=ui(o,n,a);if(t==="compact")return i.push(""),o.forEach((l,c)=>i.push(di(l,c+1,a))),i.join(`
320
- `);let s=new Map;for(let l of o){let c=l.target.source?.file??"",m=s.get(c);m?m.push(l):s.set(c,[l])}let u=0;for(let[l,c]of s){i.push("");let m=Ee(c.map(g=>g.target.component)),f=l&&m.length===1?m[0]:null,p=Ee(c.map(g=>g.target.source?.line??null));if(l){let g=p.length===1?$t(l,p[0],!0):l;i.push(`## ${g}${f?` \xB7 ${f}`:""}`)}else i.push("## Elements without source info");for(let g of c)u+=1,i.push(...mi(g,u,a,!!l&&p.length>1,f))}return i.join(`
321
- `)}var fi="grabby",rt="screenshots";var ot=null;function pi(){return ot||(ot=new Promise(e=>{try{if(typeof indexedDB>"u"){e(null);return}let t=indexedDB.open(fi,1);t.onupgradeneeded=()=>{t.result.objectStoreNames.contains(rt)||t.result.createObjectStore(rt)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}catch{e(null)}}),ot)}async function Lt(e,t){let n=await pi();return n?new Promise(o=>{try{let r=n.transaction(rt,e),a=t(r.objectStore(rt));r.oncomplete=()=>o(a?a.result:null),r.onerror=()=>o(null),r.onabort=()=>o(null)}catch{o(null)}}):null}function co(e,t){return Lt("readwrite",n=>n.put(t,e))}function Fe(e){return Lt("readonly",t=>t.get(e))}function Pt(e){return e.length===0?Promise.resolve(null):Lt("readwrite",t=>{for(let n of e)t.delete(n)})}var Mt="__grabby-comments__",uo="comments-panel",bi={pending:"Sending\u2026",sent:"Sent",failed:"Not sent"};function gi(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function hi(e){return e.split(/[\\/]/).pop()??e}function yi(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}var vi=`
322
- #${Mt} {
342
+ `)}function Ee(e){return Array.from(new Set(e))}function Li(e,t,n){let o=e.length,r=[`# UI feedback \xB7 ${o} comment${o===1?"":"s"}`],a=[];t.origin&&a.push(t.origin);let i=Ee(e.map(u=>u.framework).filter(Boolean));i.length&&a.push(i.join(", "));let s=Ee(e.map(u=>u.page.route));!n.showRoutes&&s.length===1&&a.push(`page ${s[0]}`);let l=e[0]?.page.viewport;if(l&&a.push(`${l[0]}\xD7${l[1]}`),a.push((t.now??new Date).toISOString().slice(0,10)),r.push(a.join(" \xB7 ")),n.showAuthors){let u=Ee(e.map(d=>Be(d.author)));r.push(`From: ${u.join(", ")}`)}return r}function Ni(e,t,n){let o=e.target,a=[o.source?Dt(o.source.file,o.source.line,!0):o.selector,o.component,`<${o.tag}>`].filter(Boolean).join(" "),i=n.showAuthors?` (${Be(e.author)})`:"",s=n.showRoutes?` [${e.page.route}]`:"",l=n.showIds?` [id ${e.id}]`:"";return`${t}. ${a}${s} \u2014 ${vo(e.comment," ")}${i}${l}`}function $i(e,t,n,o,r){let a=e.target,i=n.level==="detailed",s=[`${t}. ${vo(e.comment," ")}`],l=c=>s.push(` - ${c}`),u=[`\`${a.preview}\``,`(${a.kind})`];a.component&&a.component!==r?u.push(a.source?.line!=null&&o?`${a.component} line ${a.source.line}`:a.component):a.source?.line!=null&&o&&u.push(`line ${a.source.line}`),l(u.join(" ")),(!a.source||i)&&l(`selector: \`${a.selector}\``);let d=Object.entries(a.facts).filter(([c,p])=>!ho.has(c)&&!(Ai.has(c)&&!i&&_i(a.preview,p)));d.length&&l(d.map(([c,p])=>`${c}: ${p}`).join(" \xB7 "));for(let[c,p]of Object.entries(a.facts))ho.has(c)&&l(`${c}: ${p}`);let f=a.stack.filter((c,p)=>!(p===0&&(a.source||c.name===a.component)));if(f.length&&l(`inside: ${f.map(c=>c.file?`${c.name} (${Dt(c.file,c.line,i)})`:c.name).join(" \u203A ")}`),i){for(let[c,p]of Object.entries(a.extra))l(`${c}: ${p}`);l(`viewport: ${e.page.viewport[0]}\xD7${e.page.viewport[1]}`)}e.screenshot?.url&&l(`screenshot: ${e.screenshot.url}`);let h=[];return n.showAuthors&&h.push(`by ${Be(e.author)}`),n.showRoutes&&h.push(`on ${e.page.route}`),h.length&&l(h.join(" ")),n.showIds&&l(`id: ${e.id}`),s}function Eo(e,t="standard",n={}){if(e.length===0)return"";let o=[...e].sort((u,d)=>u.createdAt-d.createdAt),r=Ee(o.map(u=>Ri(u.author))),a={level:t,showIds:n.showIds===!0,showAuthors:r.length>1||o.some(u=>!u.author.anonymous&&!!u.author.name),showRoutes:Ee(o.map(u=>u.page.route)).length>1},i=Li(o,n,a);if(t==="compact")return i.push(""),o.forEach((u,d)=>i.push(Ni(u,d+1,a))),i.join(`
343
+ `);let s=new Map;for(let u of o){let d=u.target.source?.file??"",f=s.get(d);f?f.push(u):s.set(d,[u])}let l=0;for(let[u,d]of s){i.push("");let f=Ee(d.map(p=>p.target.component)),h=u&&f.length===1?f[0]:null,c=Ee(d.map(p=>p.target.source?.line??null));if(u){let p=c.length===1?Dt(u,c[0],!0):u;i.push(`## ${p}${h?` \xB7 ${h}`:""}`)}else i.push("## Elements without source info");for(let p of d)l+=1,i.push(...$i(p,l,a,!!u&&c.length>1,h))}return i.join(`
344
+ `)}var Pi="grabby",ct="screenshots";var lt=null;function Mi(){return lt||(lt=new Promise(e=>{try{if(typeof indexedDB>"u"){e(null);return}let t=indexedDB.open(Pi,1);t.onupgradeneeded=()=>{t.result.objectStoreNames.contains(ct)||t.result.createObjectStore(ct)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}catch{e(null)}}),lt)}async function Ft(e,t){let n=await Mi();return n?new Promise(o=>{try{let r=n.transaction(ct,e),a=t(r.objectStore(ct));r.oncomplete=()=>o(a?a.result:null),r.onerror=()=>o(null),r.onabort=()=>o(null)}catch{o(null)}}):null}function xo(e,t){return Ft("readwrite",n=>n.put(t,e))}function Ge(e){return Ft("readonly",t=>t.get(e))}function Ht(e){return e.length===0?Promise.resolve(null):Ft("readwrite",t=>{for(let n of e)t.delete(n)})}var Ut="__grabby-comments__",wo="comments-panel",Oi={pending:"Sending\u2026",sent:"Sent",failed:"Not sent"};function Di(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Fi(e){return e.split(/[\\/]/).pop()??e}function Hi(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}var Ui=`
345
+ #${Ut} {
323
346
  position: fixed;
324
- bottom: ${ie};
347
+ bottom: ${le};
325
348
  left: 50%;
326
349
  transform: translateX(-50%);
327
350
  z-index: ${2147483647};
@@ -339,7 +362,7 @@ ${t.join(`
339
362
  visibility: hidden;
340
363
  transition: opacity .15s ease, visibility .15s ease;
341
364
  }
342
- #${Mt}.grabby-popover-visible { opacity: 1; visibility: visible; }
365
+ #${Ut}.grabby-popover-visible { opacity: 1; visibility: visible; }
343
366
  .grabby-panel-header {
344
367
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
345
368
  padding: 10px 12px 10px 14px;
@@ -405,8 +428,8 @@ ${t.join(`
405
428
  padding: 6px 8px 6px 14px; border-top: 1px solid var(--grabby-popover-border, #e2e8f0);
406
429
  font-size: 11px; color: var(--grabby-text-muted, #94a3b8);
407
430
  }
408
- `;function mo(e,t={}){let n=t.variant==="live",o=null,r=!1,a=[];function i(){return o?.isConnected||(_(uo,vi),o=x("div",{id:Mt,role:"dialog","aria-label":"Comments"}),N().appendChild(o)),o}function s(){for(let m of a)URL.revokeObjectURL(m);a=[]}function u(m){let f=m.screenshot?.localId;if(!f)return null;let p=x("img",{class:"grabby-thumb",alt:"",loading:"lazy"});return p.addEventListener("error",()=>p.remove(),{once:!0}),Fe(f).then(g=>{if(!g||typeof URL.createObjectURL!="function"){p.remove();return}let b=URL.createObjectURL(g);a.push(b),p.src=b}).catch(()=>p.remove()),p}function l(m,f){let p=m.target,g=[x("span",{class:"grabby-kind"},p.kind)];p.component&&g.push(document.createTextNode(`${p.component} `)),p.source?g.push(x("a",{href:yi(p.source.file,p.source.line,p.source.column),title:`Open ${p.source.file} in VS Code`,onclick:h=>h.stopPropagation()},`${hi(p.source.file)}${p.source.line!=null?`:${p.source.line}`:""}`)):p.component||g.push(document.createTextNode(`<${p.tag}>`));let b=[f&&!n?Oe(m.author):"",gi(m.createdAt)].filter(Boolean);g.push(document.createTextNode(` \xB7 ${b.join(" \xB7 ")}`)),t.showSync&&m.sync&&(g.push(document.createTextNode(" \xB7 ")),g.push(x("span",{class:`grabby-sync grabby-sync-${m.sync}`},bi[m.sync]??m.sync)));let E=x("button",{type:"button",class:"grabby-comment-delete","aria-label":"Delete comment",title:"Delete comment",onclick:h=>{h.stopPropagation(),e.onDelete(m)}},le(Je)),w=x("div",{class:"grabby-comment-row",role:"button",tabindex:"0","aria-label":`Edit comment: ${m.comment}`,dataset:{grabbyCommentId:m.id}},u(m),x("div",{class:"grabby-comment-body"},x("div",{class:"grabby-comment-text"},m.comment),x("div",{class:"grabby-comment-meta"},...g)),E);return Pe(p.selector)||w.classList.add("grabby-comment-missing"),w.addEventListener("mouseenter",()=>e.onHover(m)),w.addEventListener("mouseleave",()=>e.onHover(null)),w.addEventListener("click",h=>{h.stopPropagation(),e.onEdit(m,w)}),w.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),e.onEdit(m,w)),(h.key==="Delete"||h.key==="Backspace")&&(h.preventDefault(),e.onDelete(m))}),w}function c(m){let f=i();s();let p=m.length,b=new Set(m.map(y=>y.author.anonymous?y.author.sessionId:y.author.name)).size>1||m.some(y=>!y.author.anonymous),E=x("div",{class:"grabby-panel-header"},x("span",{class:"grabby-panel-title"},n?"Your feedback":"Comments",x("span",{class:"grabby-panel-count"},String(p))),p>0&&!n?x("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-all":"",onclick:y=>{y.stopPropagation(),e.onCopyAll()}},"Copy all\u2026"):null),w=p===0?x("div",{class:"grabby-panel-empty"},x("strong",null,n?"Nothing sent yet":"No comments yet"),n?"Click Comment, then click the part of the page you want to talk about.":"Click the hand icon (or press Alt+G), then click anything on the page to comment on it."):x("div",{class:"grabby-panel-list"},...m.map(y=>l(y,b))),h=t.identityLabel?.()??null,v=null;n&&h?v=x("div",{class:"grabby-panel-footer"},x("span",null,`Commenting as ${h}`),x("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-change-identity":"",onclick:y=>{y.stopPropagation(),e.onChangeIdentity?.()}},"Change")):!n&&p>0&&(v=x("div",{class:"grabby-panel-footer"},x("span",null,"Click a comment to edit it"),x("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-clear-all":"",onclick:y=>{y.stopPropagation(),e.onClearAll()}},"Clear all"))),f.replaceChildren(E,w,...v?[v]:[])}return{show(m){c(m),r=!0,i().offsetHeight,i().classList.add("grabby-popover-visible")},refresh(m){r&&c(m)},hide(){r=!1,o?.classList.remove("grabby-popover-visible")},isVisible(){return r},isPanelElement(m){return!!o&&(m===o||o.contains(m))},dispose(){s(),o?.remove(),R(uo),o=null,r=!1}}}var B="__grabby-comment-popover__",Dt="__grabby-comment-styles__";function fo(e){let t=null,n=null,o=!1,r={mode:"new"},a=null,i=!1,s="comment",u="",l=null,c="";function m(){U(Dt)||_(Dt,`
409
- #${B} {
431
+ `;function So(e,t={}){let n=t.variant==="live",o=null,r=!1,a=[];function i(){return o?.isConnected||(R(wo,Ui),o=w("div",{id:Ut,role:"dialog","aria-label":"Comments"}),N().appendChild(o)),o}function s(){for(let f of a)URL.revokeObjectURL(f);a=[]}function l(f){let h=f.screenshot?.localId;if(!h)return null;let c=w("img",{class:"grabby-thumb",alt:"",loading:"lazy"});return c.addEventListener("error",()=>c.remove(),{once:!0}),Ge(h).then(p=>{if(!p||typeof URL.createObjectURL!="function"){c.remove();return}let g=URL.createObjectURL(p);a.push(g),c.src=g}).catch(()=>c.remove()),c}function u(f,h){let c=f.target,p=n?[document.createTextNode(`${Wn(c)} `)]:[w("span",{class:"grabby-kind"},c.kind)];n||(c.component&&p.push(document.createTextNode(`${c.component} `)),c.source?p.push(w("a",{href:Hi(c.source.file,c.source.line,c.source.column),title:`Open ${c.source.file} in VS Code`,onclick:b=>b.stopPropagation()},`${Fi(c.source.file)}${c.source.line!=null?`:${c.source.line}`:""}`)):c.component||p.push(document.createTextNode(`<${c.tag}>`)));let g=[h&&!n?Be(f.author):"",Di(f.createdAt)].filter(Boolean);p.push(document.createTextNode(` \xB7 ${g.join(" \xB7 ")}`)),t.showSync&&f.sync&&(p.push(document.createTextNode(" \xB7 ")),p.push(w("span",{class:`grabby-sync grabby-sync-${f.sync}`},Oi[f.sync]??f.sync)));let y=w("button",{type:"button",class:"grabby-comment-delete","aria-label":"Delete comment",title:"Delete comment",onclick:b=>{b.stopPropagation(),e.onDelete(f)}},ue(it)),v=w("div",{class:"grabby-comment-row",role:"button",tabindex:"0","aria-label":`Edit comment: ${f.comment}`,dataset:{grabbyCommentId:f.id}},l(f),w("div",{class:"grabby-comment-body"},w("div",{class:"grabby-comment-text"},f.comment),w("div",{class:"grabby-comment-meta"},...p)),y);return Ue(c.selector)||v.classList.add("grabby-comment-missing"),v.addEventListener("mouseenter",()=>e.onHover(f)),v.addEventListener("mouseleave",()=>e.onHover(null)),v.addEventListener("click",b=>{b.stopPropagation(),e.onEdit(f,v)}),v.addEventListener("keydown",b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),e.onEdit(f,v)),(b.key==="Delete"||b.key==="Backspace")&&(b.preventDefault(),e.onDelete(f))}),v}function d(f){let h=i();s();let c=f.length,g=new Set(f.map(x=>x.author.anonymous?x.author.sessionId:x.author.name)).size>1||f.some(x=>!x.author.anonymous),y=w("div",{class:"grabby-panel-header"},w("span",{class:"grabby-panel-title"},n?"Your feedback":"Comments",w("span",{class:"grabby-panel-count"},String(c))),c>0&&!n?w("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-all":"",onclick:x=>{x.stopPropagation(),e.onCopyAll()}},"Copy all\u2026"):null),v=c===0?w("div",{class:"grabby-panel-empty"},w("strong",null,n?"Nothing sent yet":"No comments yet"),n?"Click Comment, then click the part of the page you want to talk about.":"Click the hand icon (or press Alt+G), then click anything on the page to comment on it."):w("div",{class:"grabby-panel-list"},...f.map(x=>u(x,g))),b=t.identityLabel?.()??null,E=null;n&&b?E=w("div",{class:"grabby-panel-footer"},w("span",null,`Commenting as ${b}`),w("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-change-identity":"",onclick:x=>{x.stopPropagation(),e.onChangeIdentity?.()}},"Change")):!n&&c>0&&(E=w("div",{class:"grabby-panel-footer"},w("span",null,"Click a comment to edit it"),w("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-clear-all":"",onclick:x=>{x.stopPropagation(),e.onClearAll()}},"Clear all"))),h.replaceChildren(y,v,...E?[E]:[])}return{show(f){d(f),r=!0,i().offsetHeight,i().classList.add("grabby-popover-visible")},refresh(f){r&&d(f)},hide(){r=!1,o?.classList.remove("grabby-popover-visible")},isVisible(){return r},isPanelElement(f){return!!o&&(f===o||o.contains(f))},dispose(){s(),o?.remove(),I(wo),o=null,r=!1}}}var j="__grabby-comment-popover__",Bt="__grabby-comment-styles__";function Co(e){let t=null,n=null,o=!1,r={mode:"new"},a=null,i=!1,s="comment",l="",u=null,d="";function f(){z(Bt)||R(Bt,`
432
+ #${j} {
410
433
  position: fixed;
411
434
  z-index: ${2147483647};
412
435
  background: var(--grabby-popover-bg, #ffffff);
@@ -426,7 +449,7 @@ ${t.join(`
426
449
  from { opacity: 0; transform: scale(0.96); }
427
450
  to { opacity: 1; transform: scale(1); }
428
451
  }
429
- #${B} textarea {
452
+ #${j} textarea {
430
453
  width: 100%;
431
454
  min-height: 64px;
432
455
  padding: 8px 10px;
@@ -439,39 +462,39 @@ ${t.join(`
439
462
  outline: none;
440
463
  box-sizing: border-box;
441
464
  }
442
- #${B} textarea:focus {
465
+ #${j} textarea:focus {
443
466
  border-color: var(--grabby-accent, #2563eb);
444
467
  }
445
- #${B} textarea::placeholder {
468
+ #${j} textarea::placeholder {
446
469
  color: var(--grabby-text-muted, #94a3b8);
447
470
  }
448
- #${B} .grabby-cp-title { font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-popover-text, #334155); }
449
- #${B} .grabby-cp-sub { font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-text-muted, #94a3b8); }
450
- #${B} .grabby-cp-name {
471
+ #${j} .grabby-cp-title { font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-popover-text, #334155); }
472
+ #${j} .grabby-cp-sub { font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-text-muted, #94a3b8); }
473
+ #${j} .grabby-cp-name {
451
474
  width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; outline: none;
452
475
  border: 1px solid var(--grabby-popover-border, #e2e8f0); background: var(--grabby-surface, #f1f5f9);
453
476
  color: var(--grabby-popover-text, #334155); font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
454
477
  }
455
- #${B} .grabby-cp-name:focus { border-color: var(--grabby-accent, #2563eb); }
456
- #${B} .grabby-cp-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
457
- #${B} .grabby-cp-post {
478
+ #${j} .grabby-cp-name:focus { border-color: var(--grabby-accent, #2563eb); }
479
+ #${j} .grabby-cp-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
480
+ #${j} .grabby-cp-post {
458
481
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 14px; border-radius: 8px; cursor: pointer;
459
482
  border: 1px solid var(--grabby-accent, #2563eb); background: var(--grabby-accent, #2563eb); color: #fff;
460
483
  }
461
- #${B} .grabby-cp-link {
484
+ #${j} .grabby-cp-link {
462
485
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 4px; border: none;
463
486
  background: transparent; color: var(--grabby-text-muted, #64748b); cursor: pointer; text-decoration: underline;
464
487
  }
465
- #${B} .grabby-cp-hint {
488
+ #${j} .grabby-cp-hint {
466
489
  font-size: 11px;
467
490
  color: var(--grabby-text-muted, #94a3b8);
468
491
  white-space: nowrap;
469
492
  text-align: right;
470
493
  }
471
- `)}function f(){if(t)return t;m(),t=document.createElement("div"),t.id=B,t.setAttribute("role","dialog"),t.setAttribute("aria-label","Comment"),n=document.createElement("textarea"),n.placeholder="What should change here?",n.rows=3;let y=document.createElement("span");return y.className="grabby-cp-hint",y.textContent="\u21B5 save \xB7 Esc cancel \xB7 \u21E7\u21B5 newline",t.appendChild(n),t.appendChild(y),N().appendChild(t),t}function p(y,T){let S=window.innerWidth,M=window.innerHeight,V=300,be=120;if(!T){y.style.left="50%",y.style.top="24px",y.style.transform="translateX(-50%)";return}let D=T.getBoundingClientRect(),ge,J;D.right+16+V<=S?(ge=D.right+16,J=D.top+D.height/2-be/2):D.left-16-V>=0?(ge=D.left-16-V,J=D.top+D.height/2-be/2):D.bottom+12+be<=M?(ge=Math.max(12,Math.min(D.left,S-V-12)),J=D.bottom+12):(ge=Math.max(12,Math.min(D.left,S-V-12)),J=Math.max(12,D.top-12-be)),J=Math.max(12,Math.min(J,M-be-12)),y.style.transform="",y.style.left=`${ge}px`,y.style.top=`${J}px`}function g(y){return!!y&&y!==n&&y!==l&&ve(y)}function b(y){let T=r,S=u;v(),y?e.onSubmit(S,T,y):e.onSubmit(S,T)}function E(){if(!t)return;s="identity",l=x("input",{type:"text",class:"grabby-cp-name",placeholder:"Your name",maxlength:"80",autocomplete:"name","aria-label":"Your name"});let y=()=>b({name:l?.value.trim()||null});t.replaceChildren(x("div",{class:"grabby-cp-title"},"Thanks! Who is this from?"),x("div",{class:"grabby-cp-sub"},"Your name helps the team follow up. It's remembered in this browser."),l,x("div",{class:"grabby-cp-actions"},x("button",{type:"button",class:"grabby-cp-link","data-grabby-anonymous":"",onclick:T=>{T.stopPropagation(),b({name:null})}},"Post anonymously"),x("button",{type:"button",class:"grabby-cp-post","data-grabby-post":"",onclick:T=>{T.stopPropagation(),y()}},"Post"))),l.focus()}function w(){a||(a=y=>{if(!o)return;if(s==="identity"){if(y.key==="Escape"){y.preventDefault(),y.stopImmediatePropagation();let S=r;v(),e.onCancel(S)}else y.key==="Enter"&&Et()===l&&(y.preventDefault(),y.stopImmediatePropagation(),b({name:l?.value.trim()||null}));return}if(!n)return;let T=Et();if(T!==n){if(g(T))return;n.focus()}if(y.stopImmediatePropagation(),y.key==="Enter"&&!y.shiftKey){y.preventDefault();let S=n.value.trim();if(!S)return;u=S,i?E():b()}else if(y.key==="Escape"){y.preventDefault();let S=r;v(),e.onCancel(S)}},document.addEventListener("keydown",a,!0))}function h(){a&&(document.removeEventListener("keydown",a,!0),a=null)}function v(){o=!1,t?.remove(),t=null,n=null,l=null,s="comment",h()}return{show(y){v();let T=f();c=y.initialValue??"",n.value=c,r={mode:y.mode,entryId:y.entryId},i=y.askIdentity===!0&&y.mode==="new",o=!0,p(T,y.anchor),w(),n?.focus(),requestAnimationFrame(()=>n?.focus())},hide(){o&&v()},isVisible(){return o},hasDraft(){if(!o)return!1;if(s==="identity")return!0;let y=n?.value.trim()??"";return y!==""&&y!==c.trim()},isPopoverElement(y){if(!t)return!1;let T=y;for(;T;){if(T===t||T.id===B)return!0;T=T.parentElement}return!1},dispose(){v(),R(Dt)}}}var go="__grabby-copy-sheet__",po="copy-sheet",bo=[{id:"compact",label:"Compact",hint:"One line per comment: file, component and your note."},{id:"standard",label:"Standard",hint:"Adds the element, its key facts and styles. Best for most fixes."},{id:"detailed",label:"Detailed",hint:"Adds ancestors, position and all custom styles, for tricky layout bugs."}],Ei=`
472
- #${go} {
494
+ `)}function h(){if(t)return t;f(),t=document.createElement("div"),t.id=j,t.setAttribute("role","dialog"),t.setAttribute("aria-label","Comment"),n=document.createElement("textarea"),n.placeholder="What should change here?",n.rows=3;let x=document.createElement("span");return x.className="grabby-cp-hint",x.textContent="\u21B5 save \xB7 Esc cancel \xB7 \u21E7\u21B5 newline",t.appendChild(n),t.appendChild(x),N().appendChild(t),t}function c(x,C){let A=window.innerWidth,T=window.innerHeight,U=300,ie=120;if(!C){x.style.left="50%",x.style.top="24px",x.style.transform="translateX(-50%)";return}let B=C.getBoundingClientRect(),ee,te;B.right+16+U<=A?(ee=B.right+16,te=B.top+B.height/2-ie/2):B.left-16-U>=0?(ee=B.left-16-U,te=B.top+B.height/2-ie/2):B.bottom+12+ie<=T?(ee=Math.max(12,Math.min(B.left,A-U-12)),te=B.bottom+12):(ee=Math.max(12,Math.min(B.left,A-U-12)),te=Math.max(12,B.top-12-ie)),te=Math.max(12,Math.min(te,T-ie-12)),x.style.transform="",x.style.left=`${ee}px`,x.style.top=`${te}px`}function p(x){return!!x&&x!==n&&x!==u&&ve(x)}function g(x){let C=r,A=l;E(),x?e.onSubmit(A,C,x):e.onSubmit(A,C)}function y(){if(!t)return;s="identity",u=w("input",{type:"text",class:"grabby-cp-name",placeholder:"Your name",maxlength:"80",autocomplete:"name","aria-label":"Your name"});let x=()=>g({name:u?.value.trim()||null});t.replaceChildren(w("div",{class:"grabby-cp-title"},"Thanks! Who is this from?"),w("div",{class:"grabby-cp-sub"},"Your name helps the team follow up. It's remembered in this browser."),u,w("div",{class:"grabby-cp-actions"},w("button",{type:"button",class:"grabby-cp-link","data-grabby-anonymous":"",onclick:C=>{C.stopPropagation(),g({name:null})}},"Post anonymously"),w("button",{type:"button",class:"grabby-cp-post","data-grabby-post":"",onclick:C=>{C.stopPropagation(),x()}},"Post"))),u.focus()}function v(){a||(a=x=>{if(!o)return;if(s==="identity"){if(x.key==="Escape"){x.preventDefault(),x.stopImmediatePropagation();let A=r;E(),e.onCancel(A)}else x.key==="Enter"&&Tt()===u&&(x.preventDefault(),x.stopImmediatePropagation(),g({name:u?.value.trim()||null}));return}if(!n)return;let C=Tt();if(C!==n){if(p(C))return;n.focus()}if(x.stopImmediatePropagation(),x.key==="Enter"&&!x.shiftKey){x.preventDefault();let A=n.value.trim();if(!A)return;l=A,i?y():g()}else if(x.key==="Escape"){x.preventDefault();let A=r;E(),e.onCancel(A)}},document.addEventListener("keydown",a,!0))}function b(){a&&(document.removeEventListener("keydown",a,!0),a=null)}function E(){o=!1,t?.remove(),t=null,n=null,u=null,s="comment",b()}return{show(x){E();let C=h();d=x.initialValue??"",n.value=d,r={mode:x.mode,entryId:x.entryId},i=x.askIdentity===!0&&x.mode==="new",o=!0,c(C,x.anchor),v(),n?.focus(),requestAnimationFrame(()=>n?.focus())},hide(){o&&E()},isVisible(){return o},hasDraft(){if(!o)return!1;if(s==="identity")return!0;let x=n?.value.trim()??"";return x!==""&&x!==d.trim()},isPopoverElement(x){if(!t)return!1;let C=x;for(;C;){if(C===t||C.id===j)return!0;C=C.parentElement}return!1},dispose(){E(),I(Bt)}}}var Ao="__grabby-copy-sheet__",To="copy-sheet",ko=[{id:"compact",label:"Compact",hint:"One line per comment: file, component and your note."},{id:"standard",label:"Standard",hint:"Adds the element, its key facts and styles. Best for most fixes."},{id:"detailed",label:"Detailed",hint:"Adds ancestors, position and all custom styles, for tricky layout bugs."}],Bi=`
495
+ #${Ao} {
473
496
  position: fixed;
474
- bottom: ${ie};
497
+ bottom: ${le};
475
498
  left: 50%;
476
499
  transform: translateX(-50%);
477
500
  z-index: ${2147483647};
@@ -515,10 +538,10 @@ ${t.join(`
515
538
  .grabby-sheet .grabby-btn:hover { background: var(--grabby-popover-hover, #f1f5f9); }
516
539
  .grabby-sheet .grabby-btn-primary { background: var(--grabby-accent, #2563eb); border-color: var(--grabby-accent, #2563eb); color: #fff; }
517
540
  .grabby-sheet .grabby-btn-primary:hover { background: var(--grabby-accent-hover, #1d4ed8); }
518
- `;function wi(){return typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent)}function ho(e){let t=null,n=null;function o(){t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null),e.onClose?.())}function r(a){o(),_(po,Ei);let i=a.level,s=!1,u=wi()?"\u2318":"Ctrl",l=x("span",{class:"grabby-sheet-tokens"}),c=x("div",{class:"grabby-sheet-hint"}),m=x("div",{class:"grabby-sheet-status",role:"status","aria-live":"polite"}),f=x("textarea",{"aria-label":"Text that will be copied",spellcheck:"false"}),p=new Map;function g(){l.textContent=`\u2248 ${io(f.value).toLocaleString()} tokens`}function b(v,y=!1){if(v===i&&!y)return;let T=s&&v!==i;i=v,s=!1,f.value=a.render(i),c.textContent=bo.find(S=>S.id===i)?.hint??"";for(let[S,M]of p)M.setAttribute("aria-checked",String(S===i));m.classList.remove("grabby-error"),m.textContent=T?"Your edits were replaced by the new detail level.":"",g(),e.onLevelChange?.(i)}let E=x("div",{class:"grabby-seg",role:"radiogroup","aria-label":"Detail level"},...bo.map(v=>{let y=x("button",{type:"button",role:"radio","aria-checked":"false",title:v.hint,onclick:T=>{T.stopPropagation(),b(v.id)}},v.label);return p.set(v.id,y),y}));async function w(v){if(await e.onCopy(f.value,v,i)){o();return}f.focus(),f.select(),m.classList.add("grabby-error"),m.textContent=`The browser blocked the clipboard. The text is selected; press ${u}+C to copy it.`}f.addEventListener("input",()=>{s=!0,g()});let h=a.count;t=x("div",{id:go,class:"grabby-sheet",role:"dialog","aria-modal":"false","aria-label":"Copy comments"},x("div",{class:"grabby-sheet-head"},x("span",{class:"grabby-sheet-title"},`Copy ${h} comment${h===1?"":"s"} for your AI agent`),l),E,c,f,m,x("div",{class:"grabby-sheet-actions"},x("span",{class:"grabby-spacer"},`${u}+Enter copies and clears \xB7 Esc closes`),x("button",{type:"button",class:"grabby-btn","data-grabby-copy-keep":"",onclick:v=>{v.stopPropagation(),w("keep")}},"Copy, keep comments"),x("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-clear":"",onclick:v=>{v.stopPropagation(),w("clear")}},"Copy & clear"))),n=v=>{t&&(v.key==="Escape"?(v.preventDefault(),v.stopImmediatePropagation(),o()):v.key==="Enter"&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),v.stopImmediatePropagation(),w("clear")))},document.addEventListener("keydown",n,!0),N().appendChild(t),b(i,!0),t.querySelector("[data-grabby-copy-clear]")?.focus()}return{open:r,close:o,isVisible:()=>!!t,isSheetElement:a=>!!t&&(a===t||t.contains(a)),dispose(){o(),R(po)}}}var vo="__grabby-finish-sheet__",yo="finish-sheet",xi=15e3,Si=3e3,Ci=`
519
- #${vo} {
541
+ `;function Gi(){return typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent)}function _o(e){let t=null,n=null;function o(){t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null),e.onClose?.())}function r(a){o(),R(To,Bi);let i=a.level,s=!1,l=Gi()?"\u2318":"Ctrl",u=w("span",{class:"grabby-sheet-tokens"}),d=w("div",{class:"grabby-sheet-hint"}),f=w("div",{class:"grabby-sheet-status",role:"status","aria-live":"polite"}),h=w("textarea",{"aria-label":"Text that will be copied",spellcheck:"false"}),c=new Map;function p(){u.textContent=`\u2248 ${yo(h.value).toLocaleString()} tokens`}function g(E,x=!1){if(E===i&&!x)return;let C=s&&E!==i;i=E,s=!1,h.value=a.render(i),d.textContent=ko.find(A=>A.id===i)?.hint??"";for(let[A,T]of c)T.setAttribute("aria-checked",String(A===i));f.classList.remove("grabby-error"),f.textContent=C?"Your edits were replaced by the new detail level.":"",p(),e.onLevelChange?.(i)}let y=w("div",{class:"grabby-seg",role:"radiogroup","aria-label":"Detail level"},...ko.map(E=>{let x=w("button",{type:"button",role:"radio","aria-checked":"false",title:E.hint,onclick:C=>{C.stopPropagation(),g(E.id)}},E.label);return c.set(E.id,x),x}));async function v(E){if(await e.onCopy(h.value,E,i)){o();return}h.focus(),h.select(),f.classList.add("grabby-error"),f.textContent=`The browser blocked the clipboard. The text is selected; press ${l}+C to copy it.`}h.addEventListener("input",()=>{s=!0,p()});let b=a.count;t=w("div",{id:Ao,class:"grabby-sheet",role:"dialog","aria-modal":"false","aria-label":"Copy comments"},w("div",{class:"grabby-sheet-head"},w("span",{class:"grabby-sheet-title"},`Copy ${b} comment${b===1?"":"s"} for your AI agent`),u),y,d,h,f,w("div",{class:"grabby-sheet-actions"},w("span",{class:"grabby-spacer"},`${l}+Enter copies and clears \xB7 Esc closes`),w("button",{type:"button",class:"grabby-btn","data-grabby-copy-keep":"",onclick:E=>{E.stopPropagation(),v("keep")}},"Copy, keep comments"),w("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-clear":"",onclick:E=>{E.stopPropagation(),v("clear")}},"Copy & clear"))),n=E=>{t&&(E.key==="Escape"?(E.preventDefault(),E.stopImmediatePropagation(),o()):E.key==="Enter"&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),E.stopImmediatePropagation(),v("clear")))},document.addEventListener("keydown",n,!0),N().appendChild(t),g(i,!0),t.querySelector("[data-grabby-copy-clear]")?.focus()}return{open:r,close:o,isVisible:()=>!!t,isSheetElement:a=>!!t&&(a===t||t.contains(a)),dispose(){o(),I(To)}}}var Io="__grabby-finish-sheet__",Ro="finish-sheet",Vi=15e3,zi=3e3,Ki=`
542
+ #${Io} {
520
543
  position: fixed;
521
- bottom: ${ie};
544
+ bottom: ${le};
522
545
  left: 50%;
523
546
  transform: translateX(-50%);
524
547
  z-index: ${2147483647};
@@ -549,29 +572,29 @@ ${t.join(`
549
572
  .grabby-finish .grabby-btn[disabled] { opacity: .6; cursor: default; }
550
573
  .grabby-finish .grabby-btn-primary { background: var(--grabby-accent, #2563eb); border-color: var(--grabby-accent, #2563eb); color: #fff; }
551
574
  .grabby-finish .grabby-btn-primary:hover { background: var(--grabby-accent-hover, #1d4ed8); }
552
- `;function Ot(e,t){return`${e} ${t}${e===1?"":"s"}`}function Eo(e){let t=null,n=null,o={total:0,sent:0,pending:0,failed:0},r=!1,a=null,i=null,s=!1;function u(){r=!1,a&&clearTimeout(a),i&&clearInterval(i),a=null,i=null}function l(){u(),s=!1,t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null))}function c(){l(),e.onDone()}function m(){if(o.pending===0||s){c();return}r=!0,e.onRetry(),i=setInterval(e.onRetry,Si),a=setTimeout(()=>{u(),s=!0,p()},xi),p()}function f(g,b,E=!1,w=!1){let h=x("button",{type:"button",class:E?"grabby-btn grabby-btn-primary":"grabby-btn",onclick:v=>{v.stopPropagation(),b()}},g);return h.disabled=w,h}function p(){if(!t)return;let{total:g,sent:b,pending:E,failed:w}=o,h=[],v="";g===0?h.push(x("div",{class:"grabby-finish-line"},"You haven't left any comments yet.")):E===0&&w===0?(h.push(x("div",{class:"grabby-finish-line","data-tone":"ok"},g===1?"\u2713 Your comment was sent to the team.":`\u2713 All ${g} comments were sent to the team.`)),v="Press Done to start a fresh list, or just close this tab."):(b&&h.push(x("div",{class:"grabby-finish-line","data-tone":"ok"},`\u2713 ${Ot(b,"comment")} sent to the team`)),E&&h.push(x("div",{class:"grabby-finish-line"},`${Ot(E,"comment")} still sending\u2026`)),w&&h.push(x("div",{class:"grabby-finish-line","data-tone":"error"},`${Ot(w,"comment")} couldn't be sent`)),s&&E?v="They're saved in this browser and will be sent the next time you open this site. You can close this tab.":E?v="Keep this tab open for a moment.":w&&(v="Try again, or let the team know your feedback didn't go through."));let y=[f("Keep reviewing",l)];w&&y.push(f("Try again",e.onRetry)),g===0?y.push(f("Exit feedback mode",c,!0)):r?y.push(f("Sending\u2026",()=>{},!0,!0)):y.push(f("Done",m,!0)),t.replaceChildren(x("div",{class:"grabby-finish-title"},"Your review"),x("div",{class:"grabby-finish-lines",role:"status","aria-live":"polite"},...h),...v?[x("div",{class:"grabby-finish-note"},v)]:[],x("div",{class:"grabby-finish-actions"},...y)),t.querySelector(".grabby-btn-primary:not([disabled])")?.focus()}return{open(g){l(),_(yo,Ci),o=g,t=x("div",{id:vo,class:"grabby-finish",role:"dialog","aria-modal":"false","aria-label":"Finish review"}),n=b=>{t&&b.key==="Escape"&&(b.preventDefault(),b.stopImmediatePropagation(),l())},document.addEventListener("keydown",n,!0),N().appendChild(t),p()},update(g){if(t){if(o=g,r&&g.pending===0&&(u(),g.failed===0)){c();return}p()}},close:l,isVisible:()=>!!t,isSheetElement:g=>!!t&&(g===t||t.contains(g)),dispose(){l(),R(yo)}}}var de="__grabby-coach__",wo="coach-mark",xo="grabby:v1:onboarded",Ti=`
553
- #${de} {
554
- position: fixed; bottom: ${ie}; left: 50%; transform: translateX(-50%);
575
+ `;function Gt(e,t){return`${e} ${t}${e===1?"":"s"}`}function Lo(e){let t=null,n=null,o={total:0,sent:0,pending:0,failed:0},r=!1,a=null,i=null,s=!1;function l(){r=!1,a&&clearTimeout(a),i&&clearInterval(i),a=null,i=null}function u(){l(),s=!1,t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null))}function d(){u(),e.onDone()}function f(){if(o.pending===0||s){d();return}r=!0,e.onRetry(),i=setInterval(e.onRetry,zi),a=setTimeout(()=>{l(),s=!0,c()},Vi),c()}function h(p,g,y=!1,v=!1){let b=w("button",{type:"button",class:y?"grabby-btn grabby-btn-primary":"grabby-btn",onclick:E=>{E.stopPropagation(),g()}},p);return b.disabled=v,b}function c(){if(!t)return;let{total:p,sent:g,pending:y,failed:v}=o,b=[],E="";p===0?b.push(w("div",{class:"grabby-finish-line"},"You haven't left any comments yet.")):y===0&&v===0?(b.push(w("div",{class:"grabby-finish-line","data-tone":"ok"},p===1?"\u2713 Your comment was sent to the team.":`\u2713 All ${p} comments were sent to the team.`)),E="Press Done to start a fresh list, or just close this tab."):(g&&b.push(w("div",{class:"grabby-finish-line","data-tone":"ok"},`\u2713 ${Gt(g,"comment")} sent to the team`)),y&&b.push(w("div",{class:"grabby-finish-line"},`${Gt(y,"comment")} still sending\u2026`)),v&&b.push(w("div",{class:"grabby-finish-line","data-tone":"error"},`${Gt(v,"comment")} couldn't be sent`)),s&&y?E="They're saved in this browser and will be sent the next time you open this site. You can close this tab.":y?E="Keep this tab open for a moment.":v&&(E="Try again, or let the team know your feedback didn't go through."));let x=[h("Keep reviewing",u)];v&&x.push(h("Try again",e.onRetry)),p===0?x.push(h("Exit feedback mode",d,!0)):r?x.push(h("Sending\u2026",()=>{},!0,!0)):x.push(h("Done",f,!0)),t.replaceChildren(w("div",{class:"grabby-finish-title"},"Your review"),w("div",{class:"grabby-finish-lines",role:"status","aria-live":"polite"},...b),...E?[w("div",{class:"grabby-finish-note"},E)]:[],w("div",{class:"grabby-finish-actions"},...x)),t.querySelector(".grabby-btn-primary:not([disabled])")?.focus()}return{open(p){u(),R(Ro,Ki),o=p,t=w("div",{id:Io,class:"grabby-finish",role:"dialog","aria-modal":"false","aria-label":"Finish review"}),n=g=>{t&&g.key==="Escape"&&(g.preventDefault(),g.stopImmediatePropagation(),u())},document.addEventListener("keydown",n,!0),N().appendChild(t),c()},update(p){if(t){if(o=p,r&&p.pending===0&&(l(),p.failed===0)){d();return}c()}},close:u,isVisible:()=>!!t,isSheetElement:p=>!!t&&(p===t||t.contains(p)),dispose(){u(),I(Ro)}}}var fe="__grabby-coach__",No="coach-mark",$o="grabby:v1:onboarded",ji=`
576
+ #${fe} {
577
+ position: fixed; bottom: ${le}; left: 50%; transform: translateX(-50%);
555
578
  z-index: ${2147483647}; width: min(320px, calc(100vw - 32px)); box-sizing: border-box;
556
579
  padding: 14px 16px; border-radius: 12px; background: #0f172a; color: #f8fafc;
557
580
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
558
581
  box-shadow: 0 12px 32px rgba(15, 23, 42, .3); animation: grabby-coach-in .2s ease;
559
582
  }
560
- #${de}::after {
583
+ #${fe}::after {
561
584
  content: ''; position: absolute; bottom: -6px; left: 50%; margin-left: -6px;
562
585
  border: 6px solid transparent; border-bottom: 0; border-top-color: #0f172a;
563
586
  }
564
587
  @keyframes grabby-coach-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
565
- #${de} strong { display: block; font-size: 14px; margin-bottom: 6px; }
566
- #${de} ol { margin: 0 0 10px; padding-left: 20px; }
567
- #${de} li { margin: 2px 0; }
568
- #${de} button {
588
+ #${fe} strong { display: block; font-size: 14px; margin-bottom: 6px; }
589
+ #${fe} ol { margin: 0 0 10px; padding-left: 20px; }
590
+ #${fe} li { margin: 2px 0; }
591
+ #${fe} button {
569
592
  font: 600 12px/1 inherit; font-family: inherit; padding: 7px 12px; border-radius: 7px; border: 0;
570
593
  background: #f8fafc; color: #0f172a; cursor: pointer; float: right;
571
594
  }
572
- #${de} .grabby-coach-foot { overflow: hidden; color: #94a3b8; font-size: 12px; line-height: 28px; }
573
- `;function ki(){try{return localStorage.getItem(xo)==="1"}catch{return!1}}function Ai(){try{localStorage.setItem(xo,"1")}catch{}}function So(){let e=null;function t(){Ai(),e?.remove(),e=null}return{maybeShow(){e||ki()||(_(wo,Ti),e=x("div",{id:de,role:"dialog","aria-label":"How to leave feedback"},x("strong",null,"Leave feedback on this page"),x("ol",null,x("li",null,"Click ",x("b",null,"Comment")," below."),x("li",null,"Click the part of the page you want to talk about."),x("li",null,"Type your note and press Enter.")),x("div",{class:"grabby-coach-foot"},"A screenshot is attached for you.",x("button",{type:"button",onclick:n=>{n.stopPropagation(),t()}},"Got it"))),N().appendChild(e))},dismiss:t,dispose(){e?.remove(),e=null,R(wo)}}}var Ft="grabby:v1:outbox",Co=[2e3,1e4,3e4,12e4,3e5,6e5],_i=336*60*60*1e3,To=6e4;function Ri(){try{let e=localStorage.getItem(Ft),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n.id=="string"&&(n.kind==="comment"||n.kind==="shot")).map(n=>typeof n.created=="number"?n:{...n,created:Date.now()}):[]}catch{return[]}}function Ii(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function Ht(e){let t=Ii(e.server),n=Ri().map(b=>({...b,next:0})),o=null,r=!1,a=!1;function i(){try{n.length?localStorage.setItem(Ft,JSON.stringify(n)):localStorage.removeItem(Ft)}catch{}}function s(b={}){return{...e.projectKey?{"X-Grabby-Key":e.projectKey}:{},...b}}function u(b,E){n.some(w=>w.id===b&&w.kind===E)||(n.push({id:b,kind:E,attempts:0,next:0,created:Date.now()}),i(),l(0))}function l(b){a||(o&&clearTimeout(o),o=setTimeout(()=>{o=null,p()},b))}function c(b){let{screenshot:E,sync:w,...h}=b;return h}function m(b){let E=JSON.stringify({comment:c(b)});return fetch(`${t}/v1/comments`,{method:"POST",credentials:"omit",keepalive:E.length<To,headers:s({"Content-Type":"application/json"}),body:E})}async function f(b){let E=e.getComment(b.id);if(!E)return"drop";if(b.kind==="comment"){let S=await m(E);return S.ok?(e.getComment(b.id)?.screenshot?.localId&&u(b.id,"shot"),"done"):S.status===429||S.status>=500?"retry":(e.onState(b.id,"failed",await S.text().catch(()=>String(S.status))),"drop")}let w=E.screenshot?.localId,h=w?await e.getScreenshot(w):null;if(!h)return"drop";let{width:v,height:y}=E.screenshot,T=await fetch(`${t}/v1/comments/${encodeURIComponent(b.id)}/screenshot?w=${v}&h=${y}`,{method:"PUT",credentials:"omit",keepalive:h.size<To,headers:s({"Content-Type":h.type||"image/webp","X-Grabby-Session":E.author.sessionId}),body:h});return T.ok||T.status>=400&&T.status<500&&T.status!==429?T.ok?"done":"drop":"retry"}async function p(){if(r||a)return;r=!0;try{let E=Date.now();for(let w of[...n].sort((h,v)=>h.next-v.next)){if(w.next>E)continue;let h;try{h=await f(w)}catch{h="retry"}h==="retry"&&Date.now()-w.created<_i?(w.attempts+=1,w.next=Date.now()+Co[Math.min(w.attempts-1,Co.length-1)],w.kind==="comment"&&e.onState(w.id,"pending")):(n=n.filter(v=>v!==w),w.kind==="comment"&&h==="done"&&e.onState(w.id,"sent"),w.kind==="comment"&&h==="retry"&&e.onState(w.id,"failed","could not reach the feedback server for 14 days")),i()}}finally{r=!1}let b=n.reduce((E,w)=>Math.min(E,w.next),1/0);b!==1/0&&l(Math.max(0,b-Date.now()))}let g=()=>{for(let b of n)b.next=0;l(0)};return typeof window<"u"&&window.addEventListener("online",g),n.length&&l(500),{send:b=>u(b,"comment"),sendScreenshot:b=>{n.some(E=>E.id===b&&E.kind==="comment")||u(b,"shot")},isQueued:b=>n.some(E=>E.id===b),flush:g,flushOnExit(){for(let b of n){if(b.kind!=="comment")continue;let E=e.getComment(b.id);E&&m(E).catch(()=>{})}},dispose(){a=!0,o&&clearTimeout(o),typeof window<"u"&&window.removeEventListener("online",g)}}}var ko="grabby",Ut="grabby:v1:live";function Bt(){try{return window.sessionStorage}catch{return null}}function Ni(){return Bt()?.getItem(Ut)==="1"}function at(){try{Bt()?.setItem(Ut,"1")}catch{}}function Gt(){try{Bt()?.removeItem(Ut)}catch{}}function Ao(e){try{let t=new URL(window.location.href),n=t.searchParams.get(ko);n!==null&&(n&&(!e||n===e)&&at(),t.searchParams.delete(ko),window.history.replaceState(window.history.state,"",t.pathname+t.search+t.hash))}catch{}return Ni()}var Vt="__grabby-freeze-overlay__",zt="__grabby-freeze-styles__",_o="__grabby-freeze-hover-styles__",Ro="__grabby-freeze-anim-styles__",jt="data-grabby-hover",Io=["mouseenter","mouseleave","mouseover","mouseout","pointerenter","pointerleave","pointerover","pointerout"],No=["focus","blur","focusin","focusout"];function $o(){let e=null,t=!1,n=!1,o=!1,r=[];function a(){U(zt)||_(zt,`
574
- #${Vt} {
595
+ #${fe} .grabby-coach-foot { overflow: hidden; color: #94a3b8; font-size: 12px; line-height: 28px; }
596
+ `;function Wi(){try{return localStorage.getItem($o)==="1"}catch{return!1}}function Yi(){try{localStorage.setItem($o,"1")}catch{}}function Po(){let e=null;function t(){Yi(),e?.remove(),e=null}return{maybeShow(){e||Wi()||(R(No,ji),e=w("div",{id:fe,role:"dialog","aria-label":"How to leave feedback"},w("strong",null,"Leave feedback on this page"),w("ol",null,w("li",null,"Click ",w("b",null,"Comment")," below."),w("li",null,"Click the part of the page you want to talk about."),w("li",null,"Type your note and press Enter.")),w("div",{class:"grabby-coach-foot"},"A screenshot is attached for you.",w("button",{type:"button",onclick:n=>{n.stopPropagation(),t()}},"Got it"))),N().appendChild(e))},dismiss:t,dispose(){e?.remove(),e=null,I(No)}}}var Vt="grabby:v1:outbox",Mo=[2e3,1e4,3e4,12e4,3e5,6e5],Xi=336*60*60*1e3,Oo=6e4;function qi(){try{let e=localStorage.getItem(Vt),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n.id=="string"&&(n.kind==="comment"||n.kind==="shot"||n.kind==="delete"&&typeof n.session=="string")).map(n=>typeof n.created=="number"?n:{...n,created:Date.now()}):[]}catch{return[]}}function Zi(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function zt(e){let t=Zi(e.server),n=qi().map(y=>({...y,next:0})),o=null,r=!1,a=!1;function i(){try{n.length?localStorage.setItem(Vt,JSON.stringify(n)):localStorage.removeItem(Vt)}catch{}}function s(y={}){return{...e.projectKey?{"X-Grabby-Key":e.projectKey}:{},...y}}function l(y,v){n.some(b=>b.id===y&&b.kind===v)||(n.push({id:y,kind:v,attempts:0,next:0,created:Date.now()}),i(),u(0))}function u(y){a||(o&&clearTimeout(o),o=setTimeout(()=>{o=null,p()},y))}function d(y){let{screenshot:v,sync:b,...E}=y;return E}function f(y){let v=JSON.stringify({comment:d(y)});return fetch(`${t}/v1/comments`,{method:"POST",credentials:"omit",keepalive:v.length<Oo,headers:s({"Content-Type":"application/json"}),body:v})}function h(y,v){return fetch(`${t}/v1/comments/${encodeURIComponent(y)}`,{method:"DELETE",credentials:"omit",keepalive:!0,headers:s({"X-Grabby-Session":v})})}async function c(y){if(y.kind==="delete"){let T=await h(y.id,y.session);return T.ok||T.status===404?"done":T.status===429||T.status>=500?"retry":"drop"}let v=e.getComment(y.id);if(!v)return"drop";if(y.kind==="comment"){let T=await f(v);return T.ok?(e.getComment(y.id)?.screenshot?.localId&&l(y.id,"shot"),"done"):T.status===429||T.status>=500?"retry":(e.onState(y.id,"failed",await T.text().catch(()=>String(T.status))),"drop")}let b=v.screenshot?.localId,E=b?await e.getScreenshot(b):null;if(!E)return"drop";let{width:x,height:C}=v.screenshot,A=await fetch(`${t}/v1/comments/${encodeURIComponent(y.id)}/screenshot?w=${x}&h=${C}`,{method:"PUT",credentials:"omit",keepalive:E.size<Oo,headers:s({"Content-Type":E.type||"image/webp","X-Grabby-Session":v.author.sessionId}),body:E});return A.ok||A.status>=400&&A.status<500&&A.status!==429?A.ok?"done":"drop":"retry"}async function p(){if(r||a)return;r=!0;try{let v=Date.now();for(let b of[...n].sort((E,x)=>E.next-x.next)){if(b.next>v)continue;let E;try{E=await c(b)}catch{E="retry"}E==="retry"&&Date.now()-b.created<Xi?(b.attempts+=1,b.next=Date.now()+Mo[Math.min(b.attempts-1,Mo.length-1)],b.kind==="comment"&&e.onState(b.id,"pending")):(n=n.filter(x=>x!==b),b.kind==="comment"&&E==="done"&&e.onState(b.id,"sent"),b.kind==="comment"&&E==="retry"&&e.onState(b.id,"failed","could not reach the feedback server for 14 days")),i()}}finally{r=!1}let y=n.reduce((v,b)=>Math.min(v,b.next),1/0);y!==1/0&&u(Math.max(0,y-Date.now()))}let g=()=>{for(let y of n)y.next=0;u(0)};return typeof window<"u"&&window.addEventListener("online",g),n.length&&u(500),{send:y=>l(y,"comment"),remove(y,v,b=0){n=n.filter(E=>E.id!==y),n.push({id:y,kind:"delete",session:v,attempts:0,next:Date.now()+b,created:Date.now()}),i(),u(0)},cancelRemove(y){let v=n.find(b=>b.id===y&&b.kind==="delete");return v?(n=n.filter(b=>b!==v),i(),v.attempts===0):!1},sendScreenshot:y=>{n.some(v=>v.id===y&&v.kind==="comment")||l(y,"shot")},isQueued:y=>n.some(v=>v.id===y),flush:g,flushOnExit(){for(let y of n){if(y.kind==="delete"){y.attempts+=1,h(y.id,y.session).catch(()=>{});continue}if(y.kind!=="comment")continue;let v=e.getComment(y.id);v&&f(v).catch(()=>{})}i()},dispose(){a=!0,o&&clearTimeout(o),typeof window<"u"&&window.removeEventListener("online",g)}}}var Do="grabby",Kt="grabby:v1:live";function jt(){try{return window.sessionStorage}catch{return null}}function Ji(){return jt()?.getItem(Kt)==="1"}function ut(){try{jt()?.setItem(Kt,"1")}catch{}}function Wt(){try{jt()?.removeItem(Kt)}catch{}}function Fo(e){try{let t=new URL(window.location.href),n=t.searchParams.get(Do);n!==null&&(n&&(!e||n===e)&&ut(),t.searchParams.delete(Do),window.history.replaceState(window.history.state,"",t.pathname+t.search+t.hash))}catch{}return Ji()}var Yt="__grabby-freeze-overlay__",Xt="__grabby-freeze-styles__",Ho="__grabby-freeze-hover-styles__",Uo="__grabby-freeze-anim-styles__",qt="data-grabby-hover",Bo=["mouseenter","mouseleave","mouseover","mouseout","pointerenter","pointerleave","pointerover","pointerout"],Go=["focus","blur","focusin","focusout"];function Vo(){let e=null,t=!1,n=!1,o=!1,r=[];function a(){z(Xt)||R(Xt,`
597
+ #${Yt} {
575
598
  position: fixed;
576
599
  top: 0;
577
600
  left: 0;
@@ -581,14 +604,14 @@ ${t.join(`
581
604
  pointer-events: auto;
582
605
  background: transparent;
583
606
  }
584
- `)}function i(){return e||(a(),e=document.createElement("div"),e.id=Vt,e.style.display="none",N().appendChild(e),e)}let s=h=>{h.stopImmediatePropagation()},u=h=>{h.preventDefault(),h.stopImmediatePropagation()};function l(){for(let h of Io)document.addEventListener(h,s,!0);for(let h of No)document.addEventListener(h,u,!0)}function c(){for(let h of Io)document.removeEventListener(h,s,!0);for(let h of No)document.removeEventListener(h,u,!0)}function m(h){let v=h;for(;v&&v!==document.documentElement;)v.setAttribute(jt,""),r.push(v),v=v.parentElement}function f(){for(let h of r)h.removeAttribute(jt);r=[]}function p(){if(n)return;let h=[];for(let v of Array.from(document.styleSheets)){let y;try{y=v.cssRules}catch{continue}g(y,h)}h.length!==0&&(_(_o,h.join(`
585
- `),"document"),n=!0)}function g(h,v){for(let y of Array.from(h))if(y instanceof CSSStyleRule){if(y.selectorText.includes(":hover")){let T=y.selectorText.replace(/:hover/g,`[${jt}]`);v.push(`${T} { ${y.style.cssText} }`)}}else if(y instanceof CSSMediaRule){let T=[];g(y.cssRules,T),T.length>0&&v.push(`@media ${y.conditionText} { ${T.join(`
586
- `)} }`)}}function b(){R(_o),n=!1}function E(){o||(_(Ro,`
607
+ `)}function i(){return e||(a(),e=document.createElement("div"),e.id=Yt,e.style.display="none",N().appendChild(e),e)}let s=b=>{b.stopImmediatePropagation()},l=b=>{b.preventDefault(),b.stopImmediatePropagation()};function u(){for(let b of Bo)document.addEventListener(b,s,!0);for(let b of Go)document.addEventListener(b,l,!0)}function d(){for(let b of Bo)document.removeEventListener(b,s,!0);for(let b of Go)document.removeEventListener(b,l,!0)}function f(b){let E=b;for(;E&&E!==document.documentElement;)E.setAttribute(qt,""),r.push(E),E=E.parentElement}function h(){for(let b of r)b.removeAttribute(qt);r=[]}function c(){if(n)return;let b=[];for(let E of Array.from(document.styleSheets)){let x;try{x=E.cssRules}catch{continue}p(x,b)}b.length!==0&&(R(Ho,b.join(`
608
+ `),"document"),n=!0)}function p(b,E){for(let x of Array.from(b))if(x instanceof CSSStyleRule){if(x.selectorText.includes(":hover")){let C=x.selectorText.replace(/:hover/g,`[${qt}]`);E.push(`${C} { ${x.style.cssText} }`)}}else if(x instanceof CSSMediaRule){let C=[];p(x.cssRules,C),C.length>0&&E.push(`@media ${x.conditionText} { ${C.join(`
609
+ `)} }`)}}function g(){I(Ho),n=!1}function y(){o||(R(Uo,`
587
610
  *, *::before, *::after {
588
611
  animation-play-state: paused !important;
589
612
  transition: none !important;
590
613
  }
591
- `,"document"),o=!0)}function w(){R(Ro),o=!1}return{show(h){l(),h&&(m(h),p()),E();let v=i();v.style.display="block",t=!0},hide(){e&&(e.style.display="none"),t=!1,f(),b(),w(),c()},isVisible(){return t},isFreezeElement(h){return h===e||h.id===Vt},getElement(){return e},dispose(){f(),b(),w(),c(),e?.remove(),R(zt),e=null,t=!1}}}var Kt="__grabby-feedback-styles__";function $i(){U(Kt)||_(Kt,`
614
+ `,"document"),o=!0)}function v(){I(Uo),o=!1}return{show(b){u(),b&&(f(b),c()),y();let E=i();E.style.display="block",t=!0},hide(){e&&(e.style.display="none"),t=!1,h(),g(),v(),d()},isVisible(){return t},isFreezeElement(b){return b===e||b.id===Yt},getElement(){return e},dispose(){h(),g(),v(),d(),e?.remove(),I(Xt),e=null,t=!1}}}var Zt="__grabby-feedback-styles__";function Qi(){z(Zt)||R(Zt,`
592
615
  @keyframes grabby-flash {
593
616
  0% { opacity: 1; }
594
617
  100% { opacity: 0; transform: scale(1.02); }
@@ -632,4 +655,4 @@ ${t.join(`
632
655
  height: 10px;
633
656
  flex-shrink: 0;
634
657
  }
635
- `)}function Lo(e,t="Selected"){$i();let n=e.getBoundingClientRect(),o=document.createElement("div");o.className="grabby-select-flash",o.style.top=`${n.top}px`,o.style.left=`${n.left}px`,o.style.width=`${n.width}px`,o.style.height=`${n.height}px`,N().appendChild(o);let r=document.createElement("div");r.className="grabby-select-pill",r.append(le(Mn),` ${t}`),N().appendChild(r);let a=70,i=n.left+n.width/2-a/2,s=n.top-24;s<4&&(s=n.bottom+6);let u=document.documentElement.clientWidth;i+a>u-4&&(i=u-a-4),i<4&&(i=4),r.style.top=`${s}px`,r.style.left=`${i}px`;let l=()=>{o.remove(),r.remove()};r.addEventListener("animationend",l),setTimeout(l,1200)}function Po(){R(Kt)}var Be="grabby:v1:comments";var me=null,He=null,Ue=null,Mo=!1,Li=100;function Wt(){try{let e=localStorage.getItem(Be);if(!e)return[];let t=JSON.parse(e);return!t||typeof t!="object"||t.v!==1||!Array.isArray(t.entries)?[]:t.entries}catch{try{localStorage.removeItem(Be)}catch{}return[]}}function Yt(e){Ue=e,!(me!=null||He!=null)&&(me=requestAnimationFrame(_e),He=setTimeout(_e,Li))}function _e(){if(me!=null&&(cancelAnimationFrame(me),me=null),He!=null&&(clearTimeout(He),He=null),Ue==null)return;let e=Ue;Ue=null,Pi(e)}function Pi(e){let t={v:1,entries:e};try{localStorage.setItem(Be,JSON.stringify(t))}catch(n){if(Mi(n)){let o=e.slice(0,Math.floor(e.length/2));try{localStorage.setItem(Be,JSON.stringify({v:1,entries:o}))}catch{Do()}}else Do()}}function Mi(e){if(!e||typeof e!="object")return!1;let t=e;return t.name==="QuotaExceededError"||t.code===22}function Do(){Mo||(Mo=!0,console.warn("[grabby] saving comments to localStorage failed (quota or other error)."))}function Oo(){me!=null&&(cancelAnimationFrame(me),me=null),Ue=null;try{localStorage.removeItem(Be)}catch{}}var K=null,qt=new Map;function Di(){if(K?.isConnected&&K.contentDocument)return K.contentDocument;try{return K=document.createElement("iframe"),K.setAttribute("aria-hidden","true"),K.setAttribute("tabindex","-1"),K.setAttribute("data-grabby-ignore",""),Object.assign(K.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(K),K.contentDocument}catch{return null}}function Oi(e,t,n){let o=t?`${e}[${t}]`:e,r=qt.get(o);r||(r=new Map,qt.set(o,r));let a=n.filter(i=>!r.has(i));if(a.length>0){let i=Di(),s=i?.defaultView;if(i?.body&&s){let u=i.createElement(e);t&&u.setAttribute("type",t),i.body.appendChild(u);let l=s.getComputedStyle(u);for(let c of a)r.set(c,l.getPropertyValue(c));u.remove()}else for(let u of a)r.set(u,"")}return r}function Fo(){K?.remove(),K=null,qt.clear()}function Xt(e){return Math.round(e).toString(16).padStart(2,"0")}function Fi(e){let t=e.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?\s*\)$/);if(!t)return e;let[n,o,r]=[Number(t[1]),Number(t[2]),Number(t[3])],a=t[4]===void 0?1:t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]);if(a===0)return"transparent";let i=`#${Xt(n)}${Xt(o)}${Xt(r)}`;return a>=1?/^#(.)\1(.)\2(.)\3$/.test(i)?`#${i[1]}${i[3]}${i[5]}`:i:(a=Math.round(a*100)/100,`${i} ${Math.round(a*100)}%`)}function Hi(e,t){let n=t.trim().replace(/(\d+\.\d{2,})px/g,(r,a)=>`${Math.round(Number(a)*10)/10}px`);/color|background|border|shadow|fill|stroke/.test(e)&&(n=n.replace(/rgba?\([^)]*\)/g,r=>Fi(r))),e==="font-family"&&(n=n.split(",")[0].replace(/["']/g,"").trim());let o=n.split(" ");return o.length===4&&o.every(r=>r===o[0])?n=o[0]:o.length===4&&o[0]===o[2]&&o[1]===o[3]&&(n=`${o[0]} ${o[1]}`),n}function we(e,t){let n={},o;try{o=getComputedStyle(e)}catch{return n}let r=e.tagName.toLowerCase(),a=r==="input"||r==="button"?e.getAttribute("type"):null,i=Oi(r,a,t);for(let s of t){let u=o.getPropertyValue(s);!u||u===i.get(s)||u==="none"||u==="normal"||u==="auto"||u==="rgba(0, 0, 0, 0)"||/^border/.test(s)&&(/^0px\b/.test(u)||/\bnone\b/.test(u))||(n[s]=Hi(s,u))}return n}var Ui={"background-color":"bg","border-radius":"radius","font-size":"size","font-weight":"weight","line-height":"line-height","font-family":"font","box-shadow":"shadow","flex-direction":"direction","grid-template-columns":"columns","justify-content":"justify","align-items":"align","text-align":"text-align","object-fit":"fit"};function xe(e){return Object.entries(e).map(([t,n])=>`${Ui[t]??t} ${t==="box-shadow"?"yes":n}`).join(" \xB7 ")}var Bi=["background-color","color","font-size","font-weight","padding","border-radius","border"],Gi=["background-color","border","border-radius","padding","font-size"],Vi=["font-size","font-weight","line-height","color","font-family","text-align","letter-spacing"],zi=["object-fit","border-radius","aspect-ratio"],ji=["display","flex-direction","gap","grid-template-columns","justify-content","align-items","padding","max-width","background-color","border-radius","box-shadow","border"],Ki=["margin","color","background-color","font-size","font-weight","line-height","display","position","z-index","opacity","overflow","box-shadow","border"];function A(e,t,n){n!=null&&n!==""&&(e[t]=n)}function Uo(e){let t=e.getBoundingClientRect();return t.width||t.height?`${Math.round(t.width)}\xD7${Math.round(t.height)}`:""}function Wi(e){let t=e.getAttribute("aria-labelledby");return t?t.split(/\s+/).map(n=>e.ownerDocument.getElementById(n)).filter(n=>!!n).map(n=>ne(n,60)).join(" "):""}function Zt(e){return O(e.getAttribute("aria-label")??"")||Wi(e)}function Yi(e){let t=[];(e.disabled||e.getAttribute("aria-disabled")==="true")&&t.push("disabled");for(let n of["aria-expanded","aria-pressed","aria-selected","aria-checked"]){let o=e.getAttribute(n);o!==null&&t.push(`${n.slice(5)}=${o}`)}return e.getAttribute("aria-current")&&t.push("current"),t.join(", ")}function Xi(e){let t={},n=e.querySelector("img[alt]")?.getAttribute("alt")??"";return A(t,"label",Zt(e)||ne(e,80)||O(e.getAttribute("title")??"")||O(n)),e.tagName==="A"?A(t,"href",Me(e.getAttribute("href")??"")):(e.tagName==="BUTTON"||e.tagName==="INPUT")&&A(t,"type",e.getAttribute("type")??(e.tagName==="BUTTON"?"submit":"")),A(t,"state",Yi(e)),A(t,"styles",xe(we(e,Bi))),t}function qi(e){let t=e.labels;return t&&t.length>0?ne(t[0],60):Zt(e)||O(e.getAttribute("placeholder")??"",{keepEmails:!0})}function Zi(e){let t={};A(t,"label",qi(e));let n=e.tagName==="INPUT"?e.type||"text":e.tagName.toLowerCase();A(t,"type",n),A(t,"placeholder",O(e.getAttribute("placeholder")??"",{keepEmails:!0}));let o=[];return(e.required||e.getAttribute("aria-required")==="true")&&o.push("required"),e.disabled&&o.push("disabled"),e.getAttribute("aria-invalid")==="true"&&o.push("invalid"),A(t,"state",o.join(", ")),e.tagName==="SELECT"&&A(t,"options",String(e.options.length)),A(t,"styles",xe(we(e,Gi))),t}function Ji(e){let t={};return A(t,"text",ne(e,120)),A(t,"styles",xe(we(e,Vi))),t}function Ho(e){let t=Me(e);return t.split("/").filter(Boolean).pop()??t}function Qi(e){let t={};if(e.tagName==="IMG"){let n=e;A(t,"alt",n.hasAttribute("alt")?O(n.alt)||"(empty)":"(missing)"),A(t,"src",Ho(n.currentSrc||n.getAttribute("src")||"")),n.naturalWidth&&A(t,"natural",`${n.naturalWidth}\xD7${n.naturalHeight}`)}else e.tagName==="SVG"||e.tagName.toLowerCase()==="svg"?(A(t,"label",Zt(e)||ne(e.querySelector("title")??e,40)),A(t,"viewBox",e.getAttribute("viewBox")??"")):(e.tagName==="VIDEO"||e.tagName==="AUDIO"||e.tagName==="IFRAME")&&(A(t,"src",Ho(e.getAttribute("src")??e.querySelector("source")?.getAttribute("src")??"")),A(t,"title",O(e.getAttribute("title")??"")));return A(t,"size",Uo(e)),A(t,"styles",xe(we(e,zi))),t}function es(e,t){let n=t?.(e);if(n?.name&&n.hostElement===e)return n.name;let o=e.tagName.toLowerCase();return/^h[1-6]$/.test(o)?"heading":o==="a"?"link":o==="img"||o==="svg"?"image":o==="ul"||o==="ol"?"list":o}function Bo(e,t){let n=new Map;for(let r of Array.from(e.children)){if(r.hasAttribute(te)||/^(SCRIPT|STYLE|TEMPLATE)$/.test(r.tagName))continue;let a=es(r,t);n.set(a,(n.get(a)??0)+1)}let o=Array.from(n.entries()).slice(0,6).map(([r,a])=>a>1?`${a}\xD7 ${r}`:r);return n.size>6&&o.push("\u2026"),o.join(", ")}function Go(e){let t=e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]');return t?ne(t,60):""}function ts(e,t){let n={};return A(n,"heading",Go(e)),A(n,"contains",Bo(e,t)),A(n,"size",Uo(e)),A(n,"layout",xe(we(e,ji))),n}function ns(e,t){let n={};A(n,"title",O(e.ownerDocument.title)),A(n,"viewport",`${window.innerWidth}\xD7${window.innerHeight}`);let o=Array.from(e.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter(r=>!r.parentElement?.closest('header, nav, main, aside, footer, section, [role="region"]')||r.parentElement===e).slice(0,8).map(r=>{let a=Go(r);return a?`${r.tagName.toLowerCase()} "${X(a,30)}"`:r.tagName.toLowerCase()});return A(n,"regions",o.join(", ")),A(n,"contains",Bo(e.tagName==="HTML"?e.ownerDocument.body??e:e,t)),n}function os(e,t){let n=[],o=e.parentElement;for(;o&&n.length<t&&o.tagName!=="BODY"&&o.tagName!=="HTML";){let r=Array.from(o.classList).filter(a=>!a.startsWith("ng-")&&!a.startsWith("_ng")).slice(0,2);n.push(`${o.tagName.toLowerCase()}${r.length?`.${r.join(".")}`:""}`),o=o.parentElement}return n.reverse().join(" > ")}function rs(e,t){let n={},o=e.getBoundingClientRect();return(o.width||o.height)&&A(n,"box",`${Math.round(o.left)},${Math.round(o.top)} ${Math.round(o.width)}\xD7${Math.round(o.height)}`),A(n,"ancestors",os(e,5)),A(n,"computed",xe(we(e,Ki))),t!=="section"&&t!=="field"&&!nt(e)&&A(n,"text",ne(e,240)),n}function Vo(e,t,n){let o;switch(t){case"action":o=Xi(e);break;case"field":o=Zi(e);break;case"text":o=Ji(e);break;case"media":o=Qi(e);break;case"section":o=ns(e,n);break;default:o=ts(e,n)}return{facts:o,extra:rs(e,t)}}var as=3;function Jt(e){return!!e&&!/(^|[\\/])node_modules[\\/]/.test(e)}function is(e,t){let n=t.componentResolver?.(e)??null,o=[],r=[];for(let a of n?.stack??[]){let i=a.filePath!==void 0?{filePath:a.filePath,line:a.line??null}:a.hostElement&&t.sourceResolver?t.sourceResolver(a.hostElement):null,s={name:a.name,file:i?.filePath??null,line:i?.line??null};r.push(s),Jt(s.file)&&o.length<as&&o.push(s)}return{component:n?.name??null,frames:o.length>0?o:r.slice(0,2)}}function ss(e,t,n){let o=t.sourceResolver?.(e);if(o&&Jt(o.filePath))return{file:o.filePath,line:o.line,column:o.column};let r=n.find(a=>Jt(a.file));return r?.file?{file:r.file,line:r.line,column:null}:null}function zo(e,t){let n=t.cleanClasses??(l=>l.filter(c=>!De(c))),o=Vn(e),{component:r,frames:a}=is(e,t),i=ss(e,t,a),{facts:s,extra:u}=Vo(e,o,t.componentResolver);return{kind:o,tag:e.tagName.toLowerCase(),component:r,source:i,stack:a,selector:Hn(e),preview:o==="section"?`<${e.tagName.toLowerCase()}>`:Yn(e,n),facts:s,extra:u}}var Tl=1200,kl=1600,_r=5e3;function Al(e){return e instanceof Element?e.tagName.toLowerCase()===vt?!1:!e.hasAttribute(te):!0}function _l(e){e instanceof HTMLElement&&e.hasAttribute(tt)&&(e.style.filter="blur(8px)")}var an='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',Ke=null,je;function Rl(){let e=window.trustedTypes;if(!e)return an;if(je===void 0)try{je=e.createPolicy("grabby",{createHTML:t=>t===an?t:""})}catch{je=null}return je?je.createHTML(an):null}async function Il(){if(Ke?.isConnected)return Ke;let e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"),e.setAttribute(te,""),Object.assign(e.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(e);let t=Rl();return t!==null&&await new Promise(n=>{let o=()=>n();e.addEventListener("load",o,{once:!0}),setTimeout(o,1e3);try{e.srcdoc=t}catch{o()}}),Ke=e,e}function Rr(){Ke?.remove(),Ke=null}function Nl(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}async function Ir(e){if(typeof window>"u"||!e.isConnected)return null;let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return null;let n=Math.min(t.width,document.documentElement.scrollWidth||t.width),o=Math.min(t.height,kl),r=window.devicePixelRatio||1,a=Math.min(r,Tl/Math.max(n,o));return Nl((async()=>{let{createContext:s,destroyContext:u,domToBlob:l}=await Promise.resolve().then(()=>(Ar(),kr)),c=await s(e,{width:n,height:o,scale:a,type:"image/webp",quality:.8,filter:Al,onCloneEachNode:_l,style:{margin:"0"},timeout:_r});c.sandbox=await Il();let m;try{m=await l(c)}finally{c.sandbox=void 0,u(c)}return m?{blob:m,width:Math.round(n*a),height:Math.round(o*a)}:null})(),_r+1e3)}var Nr="grabby:v1:session",sn="grabby:v1:author";function We(){let e=typeof crypto<"u"?crypto:void 0;if(e&&typeof e.randomUUID=="function")try{return e.randomUUID()}catch{}let t=new Uint8Array(16);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let o=0;o<16;o++)t[o]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var $r=null;function dt(){try{let e=localStorage.getItem(Nr);if(e)return e;let t=We();return localStorage.setItem(Nr,t),t}catch{return $r??=We(),$r}}function mt(){try{let e=localStorage.getItem(sn);if(!e)return null;let t=JSON.parse(e);return typeof t!="object"||t===null||typeof t.anonymous!="boolean"?null:{name:typeof t.name=="string"?t.name.slice(0,80):null,anonymous:t.anonymous}}catch{return null}}function Lr(e){try{localStorage.setItem(sn,JSON.stringify(e))}catch{}}function Pr(){try{localStorage.removeItem(sn)}catch{}}function Mr(e){return{name:e&&!e.anonymous?e.name:null,anonymous:!e||e.anonymous||!e.name,sessionId:dt()}}function ft(){return typeof window>"u"?null:window.ng||null}function Ce(e){return e.startsWith("_")?e.slice(1):e}function Dr(e){let t=ft();if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=new Set,r=e;for(;r;){let i=t.getComponent(r);i&&!o.has(i)&&(o.add(i),n.push({name:Ce(i.constructor.name),hostElement:r})),r=r.parentElement}if(n.length===0){let i=e;for(;i;){let s=t.getOwningComponent(i);if(s&&!o.has(s)){o.add(s);let u=i.parentElement;for(;u&&t.getComponent(u)!==s;)u=u.parentElement;for(n.push({name:Ce(s.constructor.name),hostElement:u??i.parentElement}),r=u?.parentElement??i.parentElement?.parentElement??null;r;){let l=t.getComponent(r);l&&!o.has(l)&&(o.add(l),n.push({name:Ce(l.constructor.name),hostElement:r})),r=r.parentElement}break}i=i.parentElement}}let a=n.length>0?n[0]:{name:null,hostElement:null};return{name:a.name,hostElement:a.hostElement,stack:n}}function $l(){return globalThis.__GRABBY_SOURCE_MAP__??null}function Or(e){let t=$l();if(!t)return{filePath:null,line:null,column:null};let n=ft();if(!n)return{filePath:null,line:null,column:null};let o=Ll(e,n);if(!o)return{filePath:null,line:null,column:null};let r=t[o];return r?{filePath:r.file,line:r.line,column:null}:{filePath:null,line:null,column:null}}function Ll(e,t){let n=t.getComponent(e);if(n)return Ce(n.constructor.name);let o=e;for(;o;){let r=t.getOwningComponent(o);if(r)return Ce(r.constructor.name);o=o.parentElement}return null}var Fr={name:"Angular",resolveComponent:e=>{let t=Dr(e);return t.name?t:null},resolveSource:Or,cleanClasses:e=>e.filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))};var pt={filePath:null,line:null,column:null};function Ye(e){let t=e.replace(/\\/g,"/").replace(/^file:\/\//,"").split("?")[0];if(!/^(\/|[A-Za-z]:\/)/.test(t))return t;let n=t.lastIndexOf("/src/");if(n>=0){let o=/\/((?:packages|apps|libs)\/[^/]+)$/.exec(t.slice(0,n));return`${o?`${o[1]}/`:""}${t.slice(n+1)}`}for(let o of["app","pages","components","routes","lib"]){let r=t.lastIndexOf(`/${o}/`);if(r>=0)return t.slice(r+1)}return t.split("/").slice(-3).join("/")}function pe(e){return(e.replace(/\\/g,"/").split("/").pop()??e).replace(/\.(vue|svelte|[cm]?[jt]sx?)$/,"")}var Pl=["__reactFiber$","__reactInternalInstance$"];function gt(e){let t=Object.keys(e);for(let n of Pl){let o=t.find(r=>r.startsWith(n));if(o)return e[o]??null}return null}function bt(e,t=0){if(!e||t>4||typeof e=="string")return null;if(typeof e=="function"){let n=e;return n.displayName||n.name||null}if(typeof e=="object"){let n=e;if(n.displayName)return n.displayName;if(n.render)return bt(n.render,t+1);if(n.type)return bt(n.type,t+1)}return null}function ln(e,t=0){if(t>8)return null;if(e.stateNode instanceof Element)return e.stateNode;let n=e.child;for(;n;){let o=ln(n,t+1);if(o)return o;n=n.sibling}return null}var Ml=12,Dl=new Set(["Slot","SlotClone","Presence","Primitive","Anonymous","Unknown"]);function Ol(e){return Dl.has(e)||e.startsWith("_")||e.includes(".")}function Hr(e){let t=gt(e);if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=t;for(;o&&n.length<Ml;){let r=bt(o.type);r&&!Ol(r)&&n[n.length-1]?.name!==r&&n.push({name:r,hostElement:ln(o)}),o=o.return}return{name:n[0]?.name??null,hostElement:n[0]?.hostElement??null,stack:n}}var Ur="data-grabby-loc",Br=/^(.*?):(\d+):(\d+)(?::([A-Za-z_$][\w$.]*))?$/;function Gr(e){let t=e;for(;t;){let n=t.getAttribute?.(Ur);if(n)return Fl(n);t=t.parentElement}return{filePath:null,line:null,column:null}}function Fl(e){let t=Br.exec(e);return t?{filePath:t[1],line:Number(t[2]),column:Number(t[3])}:{filePath:e,line:null,column:null}}function Vr(e){let t=e?.getAttribute?.(Ur);if(!t)return null;let n=Br.exec(t);return n?{file:n[1],line:Number(n[2]),column:Number(n[3]),name:n[4]??null}:{file:t,line:null,column:null,name:null}}function Hl(e){return!("_debugOwner"in e)&&!("_debugSource"in e)&&!("_debugStack"in e)}function Ul(e){let t=[];for(let n of e.stack){let o=Vr(n.hostElement),r=o?.name??(o?pe(o.file):null);r&&t[t.length-1]?.name!==r&&t.push({name:r,hostElement:n.hostElement})}return t[0]?{name:t[0].name,hostElement:t[0].hostElement,stack:t}:null}var zr={name:"React",resolveComponent:e=>{let t=Hr(e);if(!t.name)return null;let n=gt(e);return n&&Hl(n)?Ul(t)??{name:null,hostElement:null,stack:[]}:t}};var jr=new Set(["KeepAlive","Transition","TransitionGroup","Teleport","Suspense","BaseTransition","RouterView","RouterLink"]),Kr=12;function Wr(e){let t=e??null;for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.nextSibling;return t}function Yr(e){let t=e;for(;t;){let n=t.__vueParentComponent;if(n)return n;t=t.parentElement}return null}function Bl(e){let t=e.type??{};return t.__name||t.name||t.displayName||(t.__file?pe(t.__file):null)}function Gl(e){return Wr(e.subTree?.el??e.vnode?.el)}function Xr(e){let t=e;for(;t;){let n=t.__vue__;if(n)return n;t=t.parentElement}return null}function Vl(e){let t=e.$options??{};return t.name||t._componentTag||(t.__file?pe(t.__file):null)}function zl(e){let t=Yr(e);if(t){let o=[];for(let a=t;a&&o.length<Kr;a=a.parent){let i=Bl(a);i&&!jr.has(i)&&o.push({name:i,hostElement:Gl(a)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}let n=Xr(e);if(n){let o=[];for(let a=n;a&&o.length<Kr;a=a.$parent){let i=Vl(a);i&&!jr.has(i)&&o.push({name:i,hostElement:Wr(a.$el)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}return null}function jl(e){let n=Yr(e)?.type?.__file??Xr(e)?.$options?.__file;return n?{filePath:Ye(n),line:null,column:null}:pt}var qr={name:"Vue",resolveComponent:zl,resolveSource:jl};var Kl=12;function Zr(e){let t=e;for(;t;){let n=t.__svelte_meta;if(n?.loc)return{meta:n,el:t};t=t.parentElement}return null}function Wl(e){let t=e.loc?.line;return typeof t!="number"?null:"parent"in e?t:t+1}function Yl(e){let t=Zr(e);if(!t?.meta.loc?.file)return null;let{meta:n}=t,o=pe(n.loc.file),r=[{name:o,hostElement:t.el}];for(let a=n.parent;a&&r.length<Kl;a=a.parent){if(a.type!=="component"||!a.file)continue;let i=pe(a.file);i!==r[r.length-1].name&&r.push({name:i,hostElement:null,filePath:Ye(a.file),line:typeof a.line=="number"?a.line:null})}return{name:o,hostElement:t.el,stack:r}}function Xl(e){let t=Zr(e),n=t?.meta.loc?.file;if(!t||!n)return pt;let o=t.meta.loc?.column;return{filePath:Ye(n),line:Wl(t.meta),column:typeof o=="number"?o+1:null}}var Jr={name:"Svelte",resolveComponent:Yl,resolveSource:Xl,cleanClasses:e=>e.filter(t=>!/^svelte-[a-z0-9]+$/i.test(t)&&!/^s-[A-Za-z0-9_-]{8,}$/.test(t))};var Qr={name:"HTML",resolveComponent:e=>{let t=e.closest("[data-component]"),n=t?.getAttribute("data-component");if(!t||!n)return null;let o=[];for(let r=t;r;r=r.parentElement?.closest("[data-component]")??null){let a=r.getAttribute("data-component");if(a&&o.push({name:a,hostElement:r}),o.length>=12)break}return{name:n,hostElement:t,stack:o}}};var cn=[Fr,zr,qr,Jr,Qr];function ea(e=cn){function t(n){for(let o of e)try{let r=o.resolveComponent(n);if(r?.name)return{adapter:o,result:r}}catch{}return null}return{resolveComponent(n){return t(n)?.result??null},resolveSource(n){let o=Gr(n);if(o.filePath)return o;let r=t(n),a=r?[r.adapter,...e.filter(i=>i!==r.adapter)]:e;for(let i of a)try{let s=i.resolveSource?.(n);if(s?.filePath)return s}catch{}return null},frameworkFor(n){return t(n)?.adapter.name??"HTML"},cleanClasses(n){return e.reduce((o,r)=>r.cleanClasses?r.cleanClasses(o):o,n)}}}var ql=200,na="grabby:v1:level",ta=8e3;function Zl(){return{activationKey:"Alt+G",activationMode:"toggle",keyHoldDuration:0,enabled:!0,enableInInputs:!1,devOnly:!0,showToolbar:!0,themeMode:"light",mode:"local",persistHistory:!0,copyOnComment:!1,detailLevel:"standard",screenshots:!0,captureQueryParams:[]}}function oa(e){return e?.mode==="live"&&!Ao(e.projectKey)?Jl(e):aa(e)}function Jl(e){let t=null,n=[],o=i=>{t?i(t):n.push(i)},r=e.server?Ql(e):null,a={...ra(),setOptions:i=>o(s=>s.setOptions(i)),registerPlugin:i=>o(s=>s.registerPlugin(i)),unregisterPlugin:i=>o(s=>s.unregisterPlugin(i)),setComponentResolver:i=>o(s=>s.setComponentResolver(i)),setSourceResolver:i=>o(s=>s.setSourceResolver(i)),identify:i=>o(s=>s.identify(i)),show(){if(t){t.show();return}r?.dispose(),at(),t=aa(e);for(let i of n.splice(0))i(t);Object.assign(a,t)}};return a}function Ql(e){try{if(!localStorage.getItem("grabby:v1:outbox"))return null}catch{return null}let t=Wt();return Ht({server:e.server,projectKey:e.projectKey,getComment:n=>t.find(o=>o.id===n),getScreenshot:Fe,onState(n,o){t=t.map(r=>r.id===n?{...r,sync:o}:r),Yt(t)}})}function ec(){try{if(typeof ngDevMode<"u"&&ngDevMode===!1)return!1}catch{}try{if(process.env.NODE_ENV==="production")return!1}catch{}return!0}function tc(e){try{let t=localStorage.getItem(na);if(t==="compact"||t==="standard"||t==="detailed")return t}catch{}return e}function nc(e){try{localStorage.setItem(na,e)}catch{}}function ra(){let e=()=>{};return{activate:e,deactivate:e,toggle:e,isActive:()=>!1,setOptions:e,registerPlugin:e,unregisterPlugin:e,setComponentResolver:e,setSourceResolver:e,showToolbar:e,hideToolbar:e,setThemeMode:e,getComments:()=>[],exportComments:()=>"",deleteComment:e,clearComments:e,identify:e,show:e,hide:e,dispose:e}}function aa(e){let n={...Zl(),...e},o=n.mode==="live";if(!o&&n.devOnly&&!ec())return ra();let r=n.identity??(o?"ask":"none"),a=null;Cn(n.styleNonce);let i=xn(n);if(n.persistHistory){let d=Wt();d.length>0&&(i.state.toolbar={...i.state.toolbar,comments:d})}let s=An(),u=Rn(),l=$o(),c=Qn(),m=oo(),f=So(),p=null,g=ea(n.adapters??cn),b=g.resolveComponent,E=g.resolveSource,w=d=>g.cleanClasses(d.filter(C=>!De(C))),h=null,v=null,y=tc(n.detailLevel),T=new Map;m.apply(i.state.toolbar.themeMode),qe();function S(){return i.state.toolbar.comments}function M(d){i.state.toolbar={...i.state.toolbar,comments:d},j.update(i.state),H.refresh(d),re.update(V())}function V(){let d=S(),C=k=>d.filter(L=>L.sync===k).length;return{total:d.length,sent:C("sent"),pending:C("pending"),failed:C("failed")}}function be(){return ae.hasDraft()||!!p&&S().some(d=>d.sync==="pending")}function D(d,C){let k=lo(d,C,{origin:location.host});return c.callTransformHook(k,d)}function ge(){return r==="anonymous"?{name:null,anonymous:!0,sessionId:dt()}:a?{name:a.name,anonymous:!1,sessionId:dt(),...a.id?{userId:a.id}:{}}:Mr(mt())}function J(){return r==="ask"&&!a&&!mt()}function sa(){if(r!=="ask")return null;if(a)return a.name;let d=mt();return d?d.anonymous||!d.name?"anonymous":d.name:null}function la(d,C){let k=S().find(L=>L.id===d);!k||k.sync===C||(o&&C==="sent"&&G("Feedback sent. Thank you!"),o&&C==="failed"&&G("Your feedback couldn't be sent. Please try again later."),M(S().map(L=>L.id===d?{...L,sync:C}:L)))}function un(d){return{componentName:d.target.component,filePath:d.target.source?.file??null,line:d.target.source?.line??null,column:d.target.source?.column??null}}function ca(d,C,k){let L=Date.now(),I={id:We(),createdAt:L,updatedAt:L,status:"open",comment:C,author:ge(),page:{route:jn(location,i.state.options.captureQueryParams),title:document.title,viewport:[window.innerWidth,window.innerHeight]},target:zo(d,{componentResolver:b,sourceResolver:E,cleanClasses:w}),screenshot:null,framework:g.frameworkFor(d),...p?{sync:"pending"}:{}};M([I,...S()].slice(0,ql)),c.callHook("onComment",I,d),p?.send(I.id),k&&ua(I.id,k);let F=S().length;if(o)return G("Thanks! Sending your feedback\u2026"),I;let he={label:F===1?"Copy":`Copy all ${F}`,onClick:mn,primary:!0};return i.state.options.copyOnComment?dn(D([I],y)).then(Y=>{G(Y?"Comment saved and copied":"Comment saved (clipboard blocked)",{detail:un(I),actions:F>1?[he]:[]})}):G(F===1?"Comment saved":`Comment saved \xB7 ${F} total`,{detail:un(I),actions:[he]}),I}async function ua(d,C){let k=await C;if(!k)return;await co(d,k.blob);let L=S().find(F=>F.id===d);if(!L){Pt([d]);return}let I={...L,screenshot:{localId:d,width:k.width,height:k.height}};M(S().map(F=>F.id===d?I:F)),c.callHook("onScreenshot",I,k.blob),p?.sendScreenshot(d)}function Te(d,C){if(d.length===0)return;let k=new Set(d),L=S(),I=L.filter(Y=>k.has(Y.id));M(L.filter(Y=>!k.has(Y.id)));let F=I.flatMap(Y=>Y.screenshot?.localId?[Y.screenshot.localId]:[]),he=We();T.set(he,setTimeout(()=>{T.delete(he),Pt(F)},ta+500)),C&&G(C,{duration:ta,actions:[{label:"Undo",onClick:()=>{clearTimeout(T.get(he)),T.delete(he);let Y=new Set(S().map($e=>$e.id)),ma=[...I.filter($e=>!Y.has($e.id)),...S()].sort(($e,fa)=>fa.createdAt-$e.createdAt);M(ma),G(`Restored ${I.length} comment${I.length===1?"":"s"}`)}}]})}async function dn(d){try{return await navigator.clipboard.writeText(d),!0}catch(C){return c.callHook("onCopyError",C instanceof Error?C:new Error(String(C))),!1}}function mn(){let d=S();if(d.length===0){G("No comments to copy yet");return}oe(),ke.open({count:d.length,level:y,render:C=>D(d,C)})}function fn(d){return Tn(d)||l.isFreezeElement(d)}function oe(){H.hide(),ae.hide(),ke.close(),re.close()}function pn(){if(re.isVisible()){re.close();return}oe(),z(!0),re.open(V())}function bn(){oe(),f.dismiss(),z(!0),i.state.toolbar={...i.state.toolbar,visible:!1},j.hide(),o&&Gt()}let ht=Xn({overlay:s,crosshair:u,getComponentResolver:()=>b,getSourceResolver:()=>E,isToolbarElement:fn,getFreezeElement:()=>l.getElement(),onHover(d){i.state.hoveredElement=d,d&&c.callHook("onElementHover",d)},onSelect(d){h=d,v=i.state.options.screenshots?Ir(d):null,c.callHook("onElementSelect",d),f.dismiss(),Lo(d),ae.show({anchor:d,mode:"new",askIdentity:J()})}});function Xe(){i.state.options.enabled&&(i.state.active||(i.state.toolbar.visible===!1&&i.state.options.showToolbar&&(i.state.toolbar={...i.state.toolbar,visible:!0},j.show()),oe(),i.state.active=!0,ht.activate(),c.callHook("onActivate"),j.update(i.state)))}function z(d=!1){i.state.active&&(!d&&i.state.frozen||(i.state.active=!1,i.state.frozen=!1,l.hide(),ht.deactivate(),c.callHook("onDeactivate"),j.update(i.state)))}function da(){i.state.frozen=!i.state.frozen,i.state.frozen?l.show(i.state.hoveredElement):l.hide(),j.update(i.state)}let j=ro({onSelectionMode(){i.state.active?z(!0):Xe()},onHistory(){ae.hide(),ke.close(),H.isVisible()?H.hide():H.show([...S()])},onEnableToggle(){oe();let d=!i.state.options.enabled;i.state.options={...i.state.options,enabled:d},d||z(!0),j.update(i.state)},onDismiss(){let{pending:d,failed:C}=V();if(o&&p&&(d||C)){pn();return}bn()},onFinish:pn},o?{label:"Comment",dismissLabel:"Exit feedback mode",hideEnable:!0,review:!!n.server}:{}),H=mo({onHover(d){let C=d?Pe(d.target.selector):null;C&&d?s.show(C,d.target.component,null,[]):s.hide()},onEdit(d,C){s.hide();let k=Pe(d.target.selector);H.hide(),ae.show({anchor:k??C,initialValue:d.comment,mode:"edit",entryId:d.id})},onDelete(d){s.hide(),Te([d.id],"Comment deleted")},onCopyAll(){s.hide(),mn()},onClearAll(){s.hide();let d=S().length;Te(S().map(C=>C.id),`Cleared ${d} comment${d===1?"":"s"}`),H.hide()},onChangeIdentity(){Pr(),H.refresh(S()),G("We'll ask for your name on your next comment")}},{variant:o?"live":"local",showSync:!!n.server,identityLabel:sa}),ke=ho({async onCopy(d,C){let k=S();if(!await dn(d))return!1;c.callHook("onCopySuccess",d,k);let I=`${k.length} comment${k.length===1?"":"s"}`;return C==="clear"?Te(k.map(F=>F.id),`Copied and cleared ${I}`):G(`Copied ${I}`),!0},onLevelChange(d){y=d,nc(d)}}),re=Eo({onDone(){let d=S().filter(k=>k.sync==="sent"&&!p?.isQueued(k.id)).map(k=>k.id);if(!S().length){bn();return}Te(d,null);let C=S().length;G(C?`Thanks for your review! ${C} comment${C===1?" is":"s are"} still sending.`:"Thanks for your review! Your feedback was sent.")},onRetry(){let d=S().filter(C=>C.sync==="failed");if(d.length){let C=new Set(d.map(k=>k.id));M(S().map(k=>C.has(k.id)?{...k,sync:"pending"}:k));for(let k of C)p?.send(k)}p?.flush()}}),ae=fo({onSubmit(d,C,k){if(k&&Lr({name:k.name,anonymous:!k.name}),C.mode==="new"){let I=h,F=v;h=null,v=null,I&&ca(I,d,F),z(!0);return}if(!C.entryId)return;let L=S().map(I=>I.id===C.entryId?{...I,comment:d,updatedAt:Date.now(),...p?{sync:"pending"}:{}}:I);M(L),p?.send(C.entryId),G("Comment updated"),H.show([...L])},onCancel(d){if(d.mode==="new"){h=null,v=null,z(!0);return}H.show([...S()])}});function gn(d){let C=se(d);C&&(fn(C)||(H.isVisible()||ae.isVisible()||ke.isVisible()||re.isVisible())&&oe())}document.addEventListener("click",gn);function hn(){_e(),p?.flushOnExit()}function yn(){document.visibilityState==="hidden"&&_e()}window.addEventListener("pagehide",hn),document.addEventListener("visibilitychange",yn);function vn(d){!o||!be()||(d.preventDefault(),d.returnValue="")}window.addEventListener("beforeunload",vn);function qe(){i.state.toolbar.visible?document.documentElement.style.setProperty("--grabby-toast-bottom",Sn):document.documentElement.style.removeProperty("--grabby-toast-bottom")}function En(d){d.key.toLowerCase()!=="f"||d.metaKey||d.ctrlKey||d.altKey||ve(se(d))||i.state.active&&(d.preventDefault(),da())}document.addEventListener("keydown",En,!0);function wn(d){if(d.key==="Escape"&&!ve(se(d))&&!(ae.isVisible()||ke.isVisible()||re.isVisible())){if(H.isVisible()){H.hide(),d.preventDefault();return}i.state.active&&(d.preventDefault(),z(!0))}}document.addEventListener("keydown",wn,!0);let Ze=Jn({getActivationKey:()=>i.state.options.activationKey,getActivationMode:()=>i.state.options.activationMode,getKeyHoldDuration:()=>i.state.options.keyHoldDuration,getEnableInInputs:()=>i.state.options.enableInInputs,onActivate:Xe,onDeactivate:()=>z(),isActive:()=>i.state.active}),Ae={activate:Xe,deactivate:()=>z(!0),toggle(){i.state.active?z(!0):Xe()},isActive(){return i.state.active},setOptions(d){i.state.options={...i.state.options,...d}},registerPlugin(d){d.options&&(i.state.options={...i.state.options,...d.options}),d.theme&&m.applyOverrides(d.theme),c.register(d,Ae)},unregisterPlugin(d){c.unregister(d)},setComponentResolver(d){b=d},setSourceResolver(d){E=d},showToolbar(){i.state.toolbar={...i.state.toolbar,visible:!0},j.show(),j.update(i.state),qe()},hideToolbar(){oe(),i.state.toolbar={...i.state.toolbar,visible:!1},j.hide(),qe()},setThemeMode(d){i.state.toolbar={...i.state.toolbar,themeMode:d},m.apply(d),j.update(i.state)},getComments(){return[...S()]},exportComments(d={}){let C=d.ids?new Set(d.ids):null,k=C?S().filter(L=>C.has(L.id)):S();return D(k,d.level??y)},deleteComment(d){Te([d],null)},clearComments(){Te(S().map(d=>d.id),null)},identify(d){a=d&&d.name?{id:d.id,name:d.name.slice(0,80)}:null,H.refresh(S())},show(){o&&at(),Ae.showToolbar()},hide(){o&&Gt(),Ae.hideToolbar()},dispose(){_e(),z(!0),document.removeEventListener("click",gn),window.removeEventListener("pagehide",hn),window.removeEventListener("beforeunload",vn),document.removeEventListener("visibilitychange",yn),document.removeEventListener("keydown",En,!0),document.removeEventListener("keydown",wn,!0),Ze.dispose(),ht.dispose(),s.dispose(),u.dispose(),l.dispose(),Dn(),Po(),c.dispose(),oe(),j.dispose(),H.dispose(),ae.dispose(),ke.dispose(),re.dispose(),f.dispose(),p?.dispose(),m.dispose(),Fo(),Rr(),document.documentElement.style.removeProperty("--grabby-toast-bottom"),kn()}};return i.state.options.enabled&&Ze.start(),i.state.toolbar={...i.state.toolbar,visible:!1},o&&n.showToolbar&&(Ae.showToolbar(),f.maybeShow()),i.subscribe((d,C)=>{C==="options"&&(d.options.enabled?Ze.start():(Ze.stop(),z(!0))),C==="toolbar"&&(qe(),d.options.persistHistory&&(d.toolbar.comments.length>0?Yt(d.toolbar.comments):Oo()))}),n.server&&(p=Ht({server:n.server,projectKey:n.projectKey,getComment:d=>S().find(C=>C.id===d),getScreenshot:Fe,onState:(d,C)=>la(d,C)})),n.webhookUrl&&Ae.registerPlugin(eo(n.webhookUrl)),Ae}function oc(e){let t=e?.dataset??{},n={};return(t.mode==="live"||t.mode==="local")&&(n.mode=t.mode),t.server&&(n.server=t.server),t.projectKey&&(n.projectKey=t.projectKey),(t.identity==="ask"||t.identity==="anonymous"||t.identity==="none")&&(n.identity=t.identity),t.activationKey&&(n.activationKey=t.activationKey),t.screenshots==="false"&&(n.screenshots=!1),t.webhookUrl&&(n.webhookUrl=t.webhookUrl),t.styleNonce?n.styleNonce=t.styleNonce:e?.nonce&&(n.styleNonce=e.nonce),n}var ia=oa(oc(document.currentScript));window.grabby=ia;var Xd=ia;})();
658
+ `)}function zo(e,t="Selected"){Qi();let n=e.getBoundingClientRect(),o=document.createElement("div");o.className="grabby-select-flash",o.style.top=`${n.top}px`,o.style.left=`${n.left}px`,o.style.width=`${n.width}px`,o.style.height=`${n.height}px`,N().appendChild(o);let r=document.createElement("div");r.className="grabby-select-pill",r.append(ue(to),` ${t}`),N().appendChild(r);let a=70,i=n.left+n.width/2-a/2,s=n.top-24;s<4&&(s=n.bottom+6);let l=document.documentElement.clientWidth;i+a>l-4&&(i=l-a-4),i<4&&(i=4),r.style.top=`${s}px`,r.style.left=`${i}px`;let u=()=>{o.remove(),r.remove()};r.addEventListener("animationend",u),setTimeout(u,1200)}function Ko(){I(Zt)}var Ke="grabby:v1:comments";var pe=null,Ve=null,ze=null,jo=!1,es=100;function Jt(){try{let e=localStorage.getItem(Ke);if(!e)return[];let t=JSON.parse(e);return!t||typeof t!="object"||t.v!==1||!Array.isArray(t.entries)?[]:t.entries}catch{try{localStorage.removeItem(Ke)}catch{}return[]}}function Qt(e){ze=e,!(pe!=null||Ve!=null)&&(pe=requestAnimationFrame(Ne),Ve=setTimeout(Ne,es))}function Ne(){if(pe!=null&&(cancelAnimationFrame(pe),pe=null),Ve!=null&&(clearTimeout(Ve),Ve=null),ze==null)return;let e=ze;ze=null,ts(e)}function ts(e){let t={v:1,entries:e};try{localStorage.setItem(Ke,JSON.stringify(t))}catch(n){if(ns(n)){let o=e.slice(0,Math.floor(e.length/2));try{localStorage.setItem(Ke,JSON.stringify({v:1,entries:o}))}catch{Wo()}}else Wo()}}function ns(e){if(!e||typeof e!="object")return!1;let t=e;return t.name==="QuotaExceededError"||t.code===22}function Wo(){jo||(jo=!0,console.warn("[grabby] saving comments to localStorage failed (quota or other error)."))}function Yo(){pe!=null&&(cancelAnimationFrame(pe),pe=null),ze=null;try{localStorage.removeItem(Ke)}catch{}}var q=null,tn=new Map;function os(){if(q?.isConnected&&q.contentDocument)return q.contentDocument;try{return q=document.createElement("iframe"),q.setAttribute("aria-hidden","true"),q.setAttribute("tabindex","-1"),q.setAttribute("data-grabby-ignore",""),Object.assign(q.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(q),q.contentDocument}catch{return null}}function rs(e,t,n){let o=t?`${e}[${t}]`:e,r=tn.get(o);r||(r=new Map,tn.set(o,r));let a=n.filter(i=>!r.has(i));if(a.length>0){let i=os(),s=i?.defaultView;if(i?.body&&s){let l=i.createElement(e);t&&l.setAttribute("type",t),i.body.appendChild(l);let u=s.getComputedStyle(l);for(let d of a)r.set(d,u.getPropertyValue(d));l.remove()}else for(let l of a)r.set(l,"")}return r}function Xo(){q?.remove(),q=null,tn.clear()}function en(e){return Math.round(e).toString(16).padStart(2,"0")}function as(e){let t=e.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?\s*\)$/);if(!t)return e;let[n,o,r]=[Number(t[1]),Number(t[2]),Number(t[3])],a=t[4]===void 0?1:t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]);if(a===0)return"transparent";let i=`#${en(n)}${en(o)}${en(r)}`;return a>=1?/^#(.)\1(.)\2(.)\3$/.test(i)?`#${i[1]}${i[3]}${i[5]}`:i:(a=Math.round(a*100)/100,`${i} ${Math.round(a*100)}%`)}function is(e,t){let n=t.trim().replace(/(\d+\.\d{2,})px/g,(r,a)=>`${Math.round(Number(a)*10)/10}px`);/color|background|border|shadow|fill|stroke/.test(e)&&(n=n.replace(/rgba?\([^)]*\)/g,r=>as(r))),e==="font-family"&&(n=n.split(",")[0].replace(/["']/g,"").trim());let o=n.split(" ");return o.length===4&&o.every(r=>r===o[0])?n=o[0]:o.length===4&&o[0]===o[2]&&o[1]===o[3]&&(n=`${o[0]} ${o[1]}`),n}function xe(e,t){let n={},o;try{o=getComputedStyle(e)}catch{return n}let r=e.tagName.toLowerCase(),a=r==="input"||r==="button"?e.getAttribute("type"):null,i=rs(r,a,t);for(let s of t){let l=o.getPropertyValue(s);!l||l===i.get(s)||l==="none"||l==="normal"||l==="auto"||l==="rgba(0, 0, 0, 0)"||/^border/.test(s)&&(/^0px\b/.test(l)||/\bnone\b/.test(l))||(n[s]=is(s,l))}return n}var ss={"background-color":"bg","border-radius":"radius","font-size":"size","font-weight":"weight","line-height":"line-height","font-family":"font","box-shadow":"shadow","flex-direction":"direction","grid-template-columns":"columns","justify-content":"justify","align-items":"align","text-align":"text-align","object-fit":"fit"};function we(e){return Object.entries(e).map(([t,n])=>`${ss[t]??t} ${t==="box-shadow"?"yes":n}`).join(" \xB7 ")}var ls=["background-color","color","font-size","font-weight","padding","border-radius","border"],cs=["background-color","border","border-radius","padding","font-size"],us=["font-size","font-weight","line-height","color","font-family","text-align","letter-spacing"],ds=["object-fit","border-radius","aspect-ratio"],ms=["display","flex-direction","gap","grid-template-columns","justify-content","align-items","padding","max-width","background-color","border-radius","box-shadow","border"],fs=["margin","color","background-color","font-size","font-weight","line-height","display","position","z-index","opacity","overflow","box-shadow","border"];function _(e,t,n){n!=null&&n!==""&&(e[t]=n)}function Zo(e){let t=e.getBoundingClientRect();return t.width||t.height?`${Math.round(t.width)}\xD7${Math.round(t.height)}`:""}function ps(e){let t=e.getAttribute("aria-labelledby");return t?t.split(/\s+/).map(n=>e.ownerDocument.getElementById(n)).filter(n=>!!n).map(n=>K(n,60)).join(" "):""}function nn(e){return P(e.getAttribute("aria-label")??"")||ps(e)}function bs(e){let t=[];(e.disabled||e.getAttribute("aria-disabled")==="true")&&t.push("disabled");for(let n of["aria-expanded","aria-pressed","aria-selected","aria-checked"]){let o=e.getAttribute(n);o!==null&&t.push(`${n.slice(5)}=${o}`)}return e.getAttribute("aria-current")&&t.push("current"),t.join(", ")}function gs(e){let t={},n=e.querySelector("img[alt]")?.getAttribute("alt")??"";return _(t,"label",nn(e)||K(e,80)||P(e.getAttribute("title")??"")||P(n)),e.tagName==="A"?_(t,"href",Oe(e.getAttribute("href")??"")):(e.tagName==="BUTTON"||e.tagName==="INPUT")&&_(t,"type",e.getAttribute("type")??(e.tagName==="BUTTON"?"submit":"")),_(t,"state",bs(e)),_(t,"styles",we(xe(e,ls))),t}function hs(e){let t=e.labels;return t&&t.length>0?K(t[0],60):nn(e)||P(e.getAttribute("placeholder")??"",{keepEmails:!0})}function ys(e){let t={};_(t,"label",hs(e));let n=e.tagName==="INPUT"?e.type||"text":e.tagName.toLowerCase();_(t,"type",n),_(t,"placeholder",P(e.getAttribute("placeholder")??"",{keepEmails:!0}));let o=[];return(e.required||e.getAttribute("aria-required")==="true")&&o.push("required"),e.disabled&&o.push("disabled"),e.getAttribute("aria-invalid")==="true"&&o.push("invalid"),_(t,"state",o.join(", ")),e.tagName==="SELECT"&&_(t,"options",String(e.options.length)),_(t,"styles",we(xe(e,cs))),t}function vs(e){let t={};return _(t,"text",K(e,120)),_(t,"styles",we(xe(e,us))),t}function qo(e){let t=Oe(e);return t.split("/").filter(Boolean).pop()??t}function Es(e){let t={};if(e.tagName==="IMG"){let n=e;_(t,"alt",n.hasAttribute("alt")?P(n.alt)||"(empty)":"(missing)"),_(t,"src",qo(n.currentSrc||n.getAttribute("src")||"")),n.naturalWidth&&_(t,"natural",`${n.naturalWidth}\xD7${n.naturalHeight}`)}else e.tagName==="SVG"||e.tagName.toLowerCase()==="svg"?(_(t,"label",nn(e)||K(e.querySelector("title")??e,40)),_(t,"viewBox",e.getAttribute("viewBox")??"")):(e.tagName==="VIDEO"||e.tagName==="AUDIO"||e.tagName==="IFRAME")&&(_(t,"src",qo(e.getAttribute("src")??e.querySelector("source")?.getAttribute("src")??"")),_(t,"title",P(e.getAttribute("title")??"")));return _(t,"size",Zo(e)),_(t,"styles",we(xe(e,ds))),t}function xs(e,t){let n=t?.(e);if(n?.name&&n.hostElement===e)return n.name;let o=e.tagName.toLowerCase();return/^h[1-6]$/.test(o)?"heading":o==="a"?"link":o==="img"||o==="svg"?"image":o==="ul"||o==="ol"?"list":o}function Jo(e,t){let n=new Map;for(let r of Array.from(e.children)){if(r.hasAttribute(ae)||/^(SCRIPT|STYLE|TEMPLATE)$/.test(r.tagName))continue;let a=xs(r,t);n.set(a,(n.get(a)??0)+1)}let o=Array.from(n.entries()).slice(0,6).map(([r,a])=>a>1?`${a}\xD7 ${r}`:r);return n.size>6&&o.push("\u2026"),o.join(", ")}function Qo(e){let t=e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]');return t?K(t,60):""}function ws(e,t){let n={};return _(n,"heading",Qo(e)),_(n,"contains",Jo(e,t)),_(n,"size",Zo(e)),_(n,"layout",we(xe(e,ms))),n}function Ss(e,t){let n={};_(n,"title",P(e.ownerDocument.title)),_(n,"viewport",`${window.innerWidth}\xD7${window.innerHeight}`);let o=Array.from(e.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter(r=>!r.parentElement?.closest('header, nav, main, aside, footer, section, [role="region"]')||r.parentElement===e).slice(0,8).map(r=>{let a=Qo(r);return a?`${r.tagName.toLowerCase()} "${X(a,30)}"`:r.tagName.toLowerCase()});return _(n,"regions",o.join(", ")),_(n,"contains",Jo(e.tagName==="HTML"?e.ownerDocument.body??e:e,t)),n}function Cs(e,t){let n=[],o=e.parentElement;for(;o&&n.length<t&&o.tagName!=="BODY"&&o.tagName!=="HTML";){let r=Array.from(o.classList).filter(a=>!a.startsWith("ng-")&&!a.startsWith("_ng")).slice(0,2);n.push(`${o.tagName.toLowerCase()}${r.length?`.${r.join(".")}`:""}`),o=o.parentElement}return n.reverse().join(" > ")}function Ts(e,t){let n={},o=e.getBoundingClientRect();return(o.width||o.height)&&_(n,"box",`${Math.round(o.left)},${Math.round(o.top)} ${Math.round(o.width)}\xD7${Math.round(o.height)}`),_(n,"ancestors",Cs(e,5)),_(n,"computed",we(xe(e,fs))),t!=="section"&&t!=="field"&&!Le(e)&&_(n,"text",K(e,240)),n}function er(e,t,n){let o;switch(t){case"action":o=gs(e);break;case"field":o=ys(e);break;case"text":o=vs(e);break;case"media":o=Es(e);break;case"section":o=Ss(e,n);break;default:o=ws(e,n)}return{facts:o,extra:Ts(e,t)}}var ks=3;function on(e){return!!e&&!/(^|[\\/])node_modules[\\/]/.test(e)}function As(e,t){let n=t.componentResolver?.(e)??null,o=[],r=[];for(let a of n?.stack??[]){let i=a.filePath!==void 0?{filePath:a.filePath,line:a.line??null}:a.hostElement&&t.sourceResolver?t.sourceResolver(a.hostElement):null,s={name:a.name,file:i?.filePath??null,line:i?.line??null};r.push(s),on(s.file)&&o.length<ks&&o.push(s)}return{component:n?.name??null,frames:o.length>0?o:r.slice(0,2)}}function _s(e,t,n){let o=t.sourceResolver?.(e);if(o&&on(o.filePath))return{file:o.filePath,line:o.line,column:o.column};let r=n.find(a=>on(a.file));return r?.file?{file:r.file,line:r.line,column:null}:null}function tr(e,t){let n=t.cleanClasses??(u=>u.filter(d=>!De(d))),o=ot(e),{component:r,frames:a}=As(e,t),i=_s(e,t,a),{facts:s,extra:l}=er(e,o,t.componentResolver);return{kind:o,tag:e.tagName.toLowerCase(),component:r,source:i,stack:a,selector:ao(e),preview:o==="section"?`<${e.tagName.toLowerCase()}>`:Gn(e,n),facts:s,extra:l}}var jl=1200,Wl=1600,Hr=5e3;function Yl(e){return e instanceof Element?e.tagName.toLowerCase()===Ct?!1:!e.hasAttribute(ae):!0}function Xl(e){e instanceof HTMLElement&&e.hasAttribute(rt)&&(e.style.filter="blur(8px)")}var dn='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',qe=null,Xe;function ql(){let e=window.trustedTypes;if(!e)return dn;if(Xe===void 0)try{Xe=e.createPolicy("grabby",{createHTML:t=>t===dn?t:""})}catch{Xe=null}return Xe?Xe.createHTML(dn):null}async function Zl(){if(qe?.isConnected)return qe;let e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"),e.setAttribute(ae,""),Object.assign(e.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(e);let t=ql();return t!==null&&await new Promise(n=>{let o=()=>n();e.addEventListener("load",o,{once:!0}),setTimeout(o,1e3);try{e.srcdoc=t}catch{o()}}),qe=e,e}function Ur(){qe?.remove(),qe=null}function Jl(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}async function Br(e){if(typeof window>"u"||!e.isConnected)return null;let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return null;let n=Math.min(t.width,document.documentElement.scrollWidth||t.width),o=Math.min(t.height,Wl),r=window.devicePixelRatio||1,a=Math.min(r,jl/Math.max(n,o));return Jl((async()=>{let{createContext:s,destroyContext:l,domToBlob:u}=await Promise.resolve().then(()=>(Fr(),Dr)),d=await s(e,{width:n,height:o,scale:a,type:"image/webp",quality:.8,filter:Yl,onCloneEachNode:Xl,style:{margin:"0"},timeout:Hr});d.sandbox=await Zl();let f;try{f=await u(d)}finally{d.sandbox=void 0,l(d)}return f?{blob:f,width:Math.round(n*a),height:Math.round(o*a)}:null})(),Hr+1e3)}var Gr="grabby:v1:session",mn="grabby:v1:author";function Ze(){let e=typeof crypto<"u"?crypto:void 0;if(e&&typeof e.randomUUID=="function")try{return e.randomUUID()}catch{}let t=new Uint8Array(16);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let o=0;o<16;o++)t[o]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var Vr=null;function gt(){try{let e=localStorage.getItem(Gr);if(e)return e;let t=Ze();return localStorage.setItem(Gr,t),t}catch{return Vr??=Ze(),Vr}}function ht(){try{let e=localStorage.getItem(mn);if(!e)return null;let t=JSON.parse(e);return typeof t!="object"||t===null||typeof t.anonymous!="boolean"?null:{name:typeof t.name=="string"?t.name.slice(0,80):null,anonymous:t.anonymous}}catch{return null}}function zr(e){try{localStorage.setItem(mn,JSON.stringify(e))}catch{}}function Kr(){try{localStorage.removeItem(mn)}catch{}}function jr(e){return{name:e&&!e.anonymous?e.name:null,anonymous:!e||e.anonymous||!e.name,sessionId:gt()}}function yt(){return typeof window>"u"?null:window.ng||null}function Ce(e){return e.startsWith("_")?e.slice(1):e}function Wr(e){let t=yt();if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=new Set,r=e;for(;r;){let i=t.getComponent(r);i&&!o.has(i)&&(o.add(i),n.push({name:Ce(i.constructor.name),hostElement:r})),r=r.parentElement}if(n.length===0){let i=e;for(;i;){let s=t.getOwningComponent(i);if(s&&!o.has(s)){o.add(s);let l=i.parentElement;for(;l&&t.getComponent(l)!==s;)l=l.parentElement;for(n.push({name:Ce(s.constructor.name),hostElement:l??i.parentElement}),r=l?.parentElement??i.parentElement?.parentElement??null;r;){let u=t.getComponent(r);u&&!o.has(u)&&(o.add(u),n.push({name:Ce(u.constructor.name),hostElement:r})),r=r.parentElement}break}i=i.parentElement}}let a=n.length>0?n[0]:{name:null,hostElement:null};return{name:a.name,hostElement:a.hostElement,stack:n}}function Ql(){return globalThis.__GRABBY_SOURCE_MAP__??null}function Yr(e){let t=Ql();if(!t)return{filePath:null,line:null,column:null};let n=yt();if(!n)return{filePath:null,line:null,column:null};let o=ec(e,n);if(!o)return{filePath:null,line:null,column:null};let r=t[o];return r?{filePath:r.file,line:r.line,column:null}:{filePath:null,line:null,column:null}}function ec(e,t){let n=t.getComponent(e);if(n)return Ce(n.constructor.name);let o=e;for(;o;){let r=t.getOwningComponent(o);if(r)return Ce(r.constructor.name);o=o.parentElement}return null}var Xr={name:"Angular",resolveComponent:e=>{let t=Wr(e);return t.name?t:null},resolveSource:Yr,cleanClasses:e=>e.filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))};var vt={filePath:null,line:null,column:null};function Je(e){let t=e.replace(/\\/g,"/").replace(/^file:\/\//,"").split("?")[0];if(!/^(\/|[A-Za-z]:\/)/.test(t))return t;let n=t.lastIndexOf("/src/");if(n>=0){let o=/\/((?:packages|apps|libs)\/[^/]+)$/.exec(t.slice(0,n));return`${o?`${o[1]}/`:""}${t.slice(n+1)}`}for(let o of["app","pages","components","routes","lib"]){let r=t.lastIndexOf(`/${o}/`);if(r>=0)return t.slice(r+1)}return t.split("/").slice(-3).join("/")}function ge(e){return(e.replace(/\\/g,"/").split("/").pop()??e).replace(/\.(vue|svelte|[cm]?[jt]sx?)$/,"")}var tc=["__reactFiber$","__reactInternalInstance$"];function xt(e){let t=Object.keys(e);for(let n of tc){let o=t.find(r=>r.startsWith(n));if(o)return e[o]??null}return null}function Et(e,t=0){if(!e||t>4||typeof e=="string")return null;if(typeof e=="function"){let n=e;return n.displayName||n.name||null}if(typeof e=="object"){let n=e;if(n.displayName)return n.displayName;if(n.render)return Et(n.render,t+1);if(n.type)return Et(n.type,t+1)}return null}function fn(e,t=0){if(t>8)return null;if(e.stateNode instanceof Element)return e.stateNode;let n=e.child;for(;n;){let o=fn(n,t+1);if(o)return o;n=n.sibling}return null}var nc=12,oc=new Set(["Slot","SlotClone","Presence","Primitive","Anonymous","Unknown"]);function rc(e){return oc.has(e)||e.startsWith("_")||e.includes(".")}function qr(e){let t=xt(e);if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=t;for(;o&&n.length<nc;){let r=Et(o.type);r&&!rc(r)&&n[n.length-1]?.name!==r&&n.push({name:r,hostElement:fn(o)}),o=o.return}return{name:n[0]?.name??null,hostElement:n[0]?.hostElement??null,stack:n}}var Zr="data-grabby-loc",Jr=/^(.*?):(\d+):(\d+)(?::([A-Za-z_$][\w$.]*))?$/;function Qr(e){let t=e;for(;t;){let n=t.getAttribute?.(Zr);if(n)return ac(n);t=t.parentElement}return{filePath:null,line:null,column:null}}function ac(e){let t=Jr.exec(e);return t?{filePath:t[1],line:Number(t[2]),column:Number(t[3])}:{filePath:e,line:null,column:null}}function ea(e){let t=e?.getAttribute?.(Zr);if(!t)return null;let n=Jr.exec(t);return n?{file:n[1],line:Number(n[2]),column:Number(n[3]),name:n[4]??null}:{file:t,line:null,column:null,name:null}}function ic(e){return!("_debugOwner"in e)&&!("_debugSource"in e)&&!("_debugStack"in e)}function sc(e){let t=[];for(let n of e.stack){let o=ea(n.hostElement),r=o?.name??(o?ge(o.file):null);r&&t[t.length-1]?.name!==r&&t.push({name:r,hostElement:n.hostElement})}return t[0]?{name:t[0].name,hostElement:t[0].hostElement,stack:t}:null}var ta={name:"React",resolveComponent:e=>{let t=qr(e);if(!t.name)return null;let n=xt(e);return n&&ic(n)?sc(t)??{name:null,hostElement:null,stack:[]}:t}};var na=new Set(["KeepAlive","Transition","TransitionGroup","Teleport","Suspense","BaseTransition","RouterView","RouterLink"]),oa=12;function ra(e){let t=e??null;for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.nextSibling;return t}function aa(e){let t=e;for(;t;){let n=t.__vueParentComponent;if(n)return n;t=t.parentElement}return null}function lc(e){let t=e.type??{};return t.__name||t.name||t.displayName||(t.__file?ge(t.__file):null)}function cc(e){return ra(e.subTree?.el??e.vnode?.el)}function ia(e){let t=e;for(;t;){let n=t.__vue__;if(n)return n;t=t.parentElement}return null}function uc(e){let t=e.$options??{};return t.name||t._componentTag||(t.__file?ge(t.__file):null)}function dc(e){let t=aa(e);if(t){let o=[];for(let a=t;a&&o.length<oa;a=a.parent){let i=lc(a);i&&!na.has(i)&&o.push({name:i,hostElement:cc(a)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}let n=ia(e);if(n){let o=[];for(let a=n;a&&o.length<oa;a=a.$parent){let i=uc(a);i&&!na.has(i)&&o.push({name:i,hostElement:ra(a.$el)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}return null}function mc(e){let n=aa(e)?.type?.__file??ia(e)?.$options?.__file;return n?{filePath:Je(n),line:null,column:null}:vt}var sa={name:"Vue",resolveComponent:dc,resolveSource:mc};var fc=12;function la(e){let t=e;for(;t;){let n=t.__svelte_meta;if(n?.loc)return{meta:n,el:t};t=t.parentElement}return null}function pc(e){let t=e.loc?.line;return typeof t!="number"?null:"parent"in e?t:t+1}function bc(e){let t=la(e);if(!t?.meta.loc?.file)return null;let{meta:n}=t,o=ge(n.loc.file),r=[{name:o,hostElement:t.el}];for(let a=n.parent;a&&r.length<fc;a=a.parent){if(a.type!=="component"||!a.file)continue;let i=ge(a.file);i!==r[r.length-1].name&&r.push({name:i,hostElement:null,filePath:Je(a.file),line:typeof a.line=="number"?a.line:null})}return{name:o,hostElement:t.el,stack:r}}function gc(e){let t=la(e),n=t?.meta.loc?.file;if(!t||!n)return vt;let o=t.meta.loc?.column;return{filePath:Je(n),line:pc(t.meta),column:typeof o=="number"?o+1:null}}var ca={name:"Svelte",resolveComponent:bc,resolveSource:gc,cleanClasses:e=>e.filter(t=>!/^svelte-[a-z0-9]+$/i.test(t)&&!/^s-[A-Za-z0-9_-]{8,}$/.test(t))};var ua={name:"HTML",resolveComponent:e=>{let t=e.closest("[data-component]"),n=t?.getAttribute("data-component");if(!t||!n)return null;let o=[];for(let r=t;r;r=r.parentElement?.closest("[data-component]")??null){let a=r.getAttribute("data-component");if(a&&o.push({name:a,hostElement:r}),o.length>=12)break}return{name:n,hostElement:t,stack:o}}};var pn=[Xr,ta,sa,ca,ua];function da(e=pn){function t(n){for(let o of e)try{let r=o.resolveComponent(n);if(r?.name)return{adapter:o,result:r}}catch{}return null}return{resolveComponent(n){return t(n)?.result??null},resolveSource(n){let o=Qr(n);if(o.filePath)return o;let r=t(n),a=r?[r.adapter,...e.filter(i=>i!==r.adapter)]:e;for(let i of a)try{let s=i.resolveSource?.(n);if(s?.filePath)return s}catch{}return null},frameworkFor(n){return t(n)?.adapter.name??"HTML"},cleanClasses(n){return e.reduce((o,r)=>r.cleanClasses?r.cleanClasses(o):o,n)}}}var hc=200,fa="grabby:v1:level",bn=8e3;function yc(){return{activationKey:"Alt+G",activationMode:"toggle",keyHoldDuration:0,enabled:!0,enableInInputs:!1,devOnly:!0,showToolbar:!0,themeMode:"light",mode:"local",persistHistory:!0,copyOnComment:!1,detailLevel:"standard",screenshots:!0,captureQueryParams:[]}}function pa(e){return e?.mode==="live"&&!Fo(e.projectKey)?vc(e):ga(e)}function vc(e){let t=null,n=[],o=i=>{t?i(t):n.push(i)},r=e.server?Ec(e):null,a={...ba(),setOptions:i=>o(s=>s.setOptions(i)),registerPlugin:i=>o(s=>s.registerPlugin(i)),unregisterPlugin:i=>o(s=>s.unregisterPlugin(i)),setComponentResolver:i=>o(s=>s.setComponentResolver(i)),setSourceResolver:i=>o(s=>s.setSourceResolver(i)),identify:i=>o(s=>s.identify(i)),show(){if(t){t.show();return}r?.dispose(),ut(),t=ga(e);for(let i of n.splice(0))i(t);Object.assign(a,t)}};return a}function Ec(e){try{if(!localStorage.getItem("grabby:v1:outbox"))return null}catch{return null}let t=Jt();return zt({server:e.server,projectKey:e.projectKey,getComment:n=>t.find(o=>o.id===n),getScreenshot:Ge,onState(n,o){t=t.map(r=>r.id===n?{...r,sync:o}:r),Qt(t)}})}var gn="grabby:v1:collapsed";function xc(){try{return sessionStorage.getItem(gn)==="1"}catch{return!1}}function ma(e){try{e?sessionStorage.setItem(gn,"1"):sessionStorage.removeItem(gn)}catch{}}function wc(){try{if(typeof ngDevMode<"u"&&ngDevMode===!1)return!1}catch{}try{if(process.env.NODE_ENV==="production")return!1}catch{}return!0}function Sc(e){try{let t=localStorage.getItem(fa);if(t==="compact"||t==="standard"||t==="detailed")return t}catch{}return e}function Cc(e){try{localStorage.setItem(fa,e)}catch{}}function ba(){let e=()=>{};return{activate:e,deactivate:e,toggle:e,isActive:()=>!1,setOptions:e,registerPlugin:e,unregisterPlugin:e,setComponentResolver:e,setSourceResolver:e,showToolbar:e,hideToolbar:e,setThemeMode:e,getComments:()=>[],exportComments:()=>"",deleteComment:e,clearComments:e,identify:e,show:e,hide:e,dispose:e}}function ga(e){let n={...yc(),...e},o=n.mode==="live";if(!o&&n.devOnly&&!wc())return ba();let r=n.identity??(o?"ask":"none"),a=null;Nn(n.styleNonce);let i=In(n);if(n.persistHistory){let m=Jt();m.length>0&&(i.state.toolbar={...i.state.toolbar,comments:m})}let s=Yn({plainLabels:o}),l=qn(),u=Vo(),d=uo(),f=bo(),h=Po(),c=null,p=da(n.adapters??pn),g=p.resolveComponent,y=p.resolveSource,v=m=>p.cleanClasses(m.filter(S=>!De(S))),b=null,E=null,x=Sc(n.detailLevel),C=xc(),A=new Map;f.apply(i.state.toolbar.themeMode),_e();function T(){return i.state.toolbar.comments}function U(m){i.state.toolbar={...i.state.toolbar,comments:m},G.update(i.state),V.refresh(m),se.update(ie())}function ie(){let m=T(),S=k=>m.filter(M=>M.sync===k).length;return{total:m.length,sent:S("sent"),pending:S("pending"),failed:S("failed")}}function B(){return he.hasDraft()||!!c&&T().some(m=>m.sync==="pending")}function ee(m,S){let k=Eo(m,S,{origin:location.host});return d.callTransformHook(k,m)}function te(){return r==="anonymous"?{name:null,anonymous:!0,sessionId:gt()}:a?{name:a.name,anonymous:!1,sessionId:gt(),...a.id?{userId:a.id}:{}}:jr(ht())}function ya(){return r==="ask"&&!a&&!ht()}function va(){if(r!=="ask")return null;if(a)return a.name;let m=ht();return m?m.anonymous||!m.name?"anonymous":m.name:null}function Ea(m,S){let k=T().find(M=>M.id===m);!k||k.sync===S||(o&&S==="sent"&&Y("Feedback sent. Thank you!"),o&&S==="failed"&&Y("Your feedback couldn't be sent. Please try again later."),U(T().map(M=>M.id===m?{...M,sync:S}:M)))}function hn(m){return{componentName:m.target.component,filePath:m.target.source?.file??null,line:m.target.source?.line??null,column:m.target.source?.column??null}}function xa(m,S,k){let M=Date.now(),$={id:Ze(),createdAt:M,updatedAt:M,status:"open",comment:S,author:te(),page:{route:Hn(location,i.state.options.captureQueryParams),title:document.title,viewport:[window.innerWidth,window.innerHeight]},target:tr(m,{componentResolver:g,sourceResolver:y,cleanClasses:v}),screenshot:null,framework:p.frameworkFor(m),...c?{sync:"pending"}:{}};U([$,...T()].slice(0,hc)),d.callHook("onComment",$,m),c?.send($.id),k&&wa($.id,k);let O=T().length;if(o)return Y("Thanks! Sending your feedback\u2026"),$;let Ie={label:O===1?"Copy":`Copy all ${O}`,onClick:vn,primary:!0};return i.state.options.copyOnComment?yn(ee([$],x)).then(wt=>{Y(wt?"Comment saved and copied":"Comment saved (clipboard blocked)",{detail:hn($),actions:O>1?[Ie]:[]})}):Y(O===1?"Comment saved":`Comment saved \xB7 ${O} total`,{detail:hn($),actions:[Ie]}),$}async function wa(m,S){let k=await S;if(!k)return;await xo(m,k.blob);let M=T().find(O=>O.id===m);if(!M){Ht([m]);return}let $={...M,screenshot:{localId:m,width:k.width,height:k.height}};U(T().map(O=>O.id===m?$:O)),d.callHook("onScreenshot",$,k.blob),c?.sendScreenshot(m)}function Te(m,S,k=!1){if(m.length===0)return;let M=new Set(m),$=T(),O=$.filter(D=>M.has(D.id));U($.filter(D=>!M.has(D.id)));let Ie=k&&c?O.filter(D=>D.sync!==void 0):[],wt=new Set(Ie.filter(D=>c.isQueued(D.id)).map(D=>D.id));for(let D of Ie)c.remove(D.id,D.author.sessionId,S?bn+500:0);let Aa=O.flatMap(D=>D.screenshot?.localId?[D.screenshot.localId]:[]),tt=Ze();A.set(tt,setTimeout(()=>{A.delete(tt),Ht(Aa)},bn+500)),S&&Y(S,{duration:bn,actions:[{label:"Undo",onClick:()=>{clearTimeout(A.get(tt)),A.delete(tt);let D=new Set(T().map(F=>F.id)),Rn=new Set(Ie.filter(F=>!D.has(F.id)&&(!c.cancelRemove(F.id)||F.sync!=="sent"||wt.has(F.id))).map(F=>F.id)),_a=[...O.filter(F=>!D.has(F.id)).map(F=>Rn.has(F.id)?{...F,sync:"pending"}:F),...T()].sort((F,Ra)=>Ra.createdAt-F.createdAt);U(_a);for(let F of Rn)c?.send(F);Y(`Restored ${O.length} comment${O.length===1?"":"s"}`)}}]})}async function yn(m){try{return await navigator.clipboard.writeText(m),!0}catch(S){return d.callHook("onCopyError",S instanceof Error?S:new Error(String(S))),!1}}function vn(){let m=T();if(m.length===0){Y("No comments to copy yet");return}ne(),Ae.open({count:m.length,level:x,render:S=>ee(m,S)})}function En(m){return $n(m)||u.isFreezeElement(m)}function xn(){he.hide(),ke.isHolding()&&(b=null,E=null,ke.release())}function ne(){V.hide(),xn(),Ae.close(),se.close()}function Sa(){if(se.isVisible()){se.close();return}ne(),W(!0),se.open(ie())}function Ca(){ne(),h.dismiss(),W(!0),i.state.toolbar={...i.state.toolbar,visible:!1},G.hide(),o&&Wt()}let ke=io({overlay:s,crosshair:l,getComponentResolver:()=>g,getSourceResolver:()=>y,isToolbarElement:En,getFreezeElement:()=>u.getElement(),onHover(m){i.state.hoveredElement=m,m&&d.callHook("onElementHover",m)},onSelect(m){b=m,E=i.state.options.screenshots?Br(m):null,d.callHook("onElementSelect",m),h.dismiss(),zo(m),ke.hold(m),he.show({anchor:m,mode:"new",askIdentity:ya()})}});function Qe(){i.state.options.enabled&&(i.state.active||(i.state.toolbar.visible===!1&&i.state.options.showToolbar&&(i.state.toolbar={...i.state.toolbar,visible:!0},G.show()),C&&wn(),ne(),i.state.active=!0,ke.activate(),d.callHook("onActivate"),G.update(i.state)))}function W(m=!1){i.state.active&&(!m&&i.state.frozen||(i.state.active=!1,i.state.frozen=!1,u.hide(),ke.deactivate(),d.callHook("onDeactivate"),G.update(i.state)))}function Ta(){i.state.frozen=!i.state.frozen,i.state.frozen?u.show(i.state.hoveredElement):u.hide(),G.update(i.state)}let G=go({onSelectionMode(){i.state.active?W(!0):Qe()},onHistory(){xn(),Ae.close(),V.isVisible()?V.hide():V.show([...T()])},onEnableToggle(){ne();let m=!i.state.options.enabled;i.state.options={...i.state.options,enabled:m},m||W(!0),G.update(i.state)},onDismiss:ka,onExpand:wn,onFinish:Sa},o?{label:"Comment",dismissLabel:"Hide toolbar",expandLabel:"Leave feedback",hideEnable:!0,review:!!n.server}:{dismissLabel:"Hide toolbar",expandLabel:"Open Grabby toolbar"});function ka(){ne(),h.dismiss(),W(!0),C=!0,G.collapse(),ma(!0),_e()}function wn(){C=!1,G.expand(),ma(!1),_e()}let V=So({onHover(m){let S=m?Ue(m.target.selector):null;S&&m?s.show(S,m.target.component,null,[]):s.hide()},onEdit(m,S){s.hide();let k=Ue(m.target.selector);V.hide(),he.show({anchor:k??S,initialValue:m.comment,mode:"edit",entryId:m.id})},onDelete(m){s.hide(),Te([m.id],"Comment deleted",!0)},onCopyAll(){s.hide(),vn()},onClearAll(){s.hide();let m=T().length;Te(T().map(S=>S.id),`Cleared ${m} comment${m===1?"":"s"}`,!0),V.hide()},onChangeIdentity(){Kr(),V.refresh(T()),Y("We'll ask for your name on your next comment")}},{variant:o?"live":"local",showSync:!!n.server,identityLabel:va}),Ae=_o({async onCopy(m,S){let k=T();if(!await yn(m))return!1;d.callHook("onCopySuccess",m,k);let $=`${k.length} comment${k.length===1?"":"s"}`;return S==="clear"?Te(k.map(O=>O.id),`Copied and cleared ${$}`):Y(`Copied ${$}`),!0},onLevelChange(m){x=m,Cc(m)}}),se=Lo({onDone(){let m=T().filter(k=>k.sync==="sent"&&!c?.isQueued(k.id)).map(k=>k.id);if(!T().length){Ca();return}Te(m,null);let S=T().length;Y(S?`Thanks for your review! ${S} comment${S===1?" is":"s are"} still sending.`:"Thanks for your review! Your feedback was sent.")},onRetry(){let m=T().filter(S=>S.sync==="failed");if(m.length){let S=new Set(m.map(k=>k.id));U(T().map(k=>S.has(k.id)?{...k,sync:"pending"}:k));for(let k of S)c?.send(k)}c?.flush()}}),he=Co({onSubmit(m,S,k){if(k&&zr({name:k.name,anonymous:!k.name}),S.mode==="new"){let $=b,O=E;b=null,E=null,$&&xa($,m,O),W(!0);return}if(!S.entryId)return;let M=T().map($=>$.id===S.entryId?{...$,comment:m,updatedAt:Date.now(),...c?{sync:"pending"}:{}}:$);U(M),c?.send(S.entryId),Y("Comment updated"),V.show([...M])},onCancel(m){if(m.mode==="new"){b=null,E=null,W(!0);return}V.show([...T()])}});function Sn(m){let S=ce(m);S&&(En(S)||(V.isVisible()||he.isVisible()||Ae.isVisible()||se.isVisible())&&ne())}document.addEventListener("click",Sn);function Cn(){Ne(),c?.flushOnExit()}function Tn(){document.visibilityState==="hidden"&&Ne()}window.addEventListener("pagehide",Cn),document.addEventListener("visibilitychange",Tn);function kn(m){!o||!B()||(m.preventDefault(),m.returnValue="")}window.addEventListener("beforeunload",kn);function _e(){i.state.toolbar.visible&&!C?document.documentElement.style.setProperty("--grabby-toast-bottom",Ln):document.documentElement.style.removeProperty("--grabby-toast-bottom")}function An(m){m.key.toLowerCase()!=="f"||m.metaKey||m.ctrlKey||m.altKey||ve(ce(m))||i.state.active&&(m.preventDefault(),Ta())}document.addEventListener("keydown",An,!0);function _n(m){if(m.key==="Escape"&&!ve(ce(m))&&!(he.isVisible()||Ae.isVisible()||se.isVisible())){if(V.isVisible()){V.hide(),m.preventDefault();return}i.state.active&&(m.preventDefault(),W(!0))}}document.addEventListener("keydown",_n,!0);let et=co({getActivationKey:()=>i.state.options.activationKey,getActivationMode:()=>i.state.options.activationMode,getKeyHoldDuration:()=>i.state.options.keyHoldDuration,getEnableInInputs:()=>i.state.options.enableInInputs,onActivate:Qe,onDeactivate:()=>W(),isActive:()=>i.state.active}),Re={activate:Qe,deactivate:()=>W(!0),toggle(){i.state.active?W(!0):Qe()},isActive(){return i.state.active},setOptions(m){i.state.options={...i.state.options,...m}},registerPlugin(m){m.options&&(i.state.options={...i.state.options,...m.options}),m.theme&&f.applyOverrides(m.theme),d.register(m,Re)},unregisterPlugin(m){d.unregister(m)},setComponentResolver(m){g=m},setSourceResolver(m){y=m},showToolbar(){i.state.toolbar={...i.state.toolbar,visible:!0},G.show(),G.update(i.state),_e()},hideToolbar(){ne(),i.state.toolbar={...i.state.toolbar,visible:!1},G.hide(),_e()},setThemeMode(m){i.state.toolbar={...i.state.toolbar,themeMode:m},f.apply(m),G.update(i.state)},getComments(){return[...T()]},exportComments(m={}){let S=m.ids?new Set(m.ids):null,k=S?T().filter(M=>S.has(M.id)):T();return ee(k,m.level??x)},deleteComment(m){Te([m],null,!0)},clearComments(){Te(T().map(m=>m.id),null)},identify(m){a=m&&m.name?{id:m.id,name:m.name.slice(0,80)}:null,V.refresh(T())},show(){o&&ut(),Re.showToolbar()},hide(){o&&Wt(),Re.hideToolbar()},dispose(){Ne(),W(!0),document.removeEventListener("click",Sn),window.removeEventListener("pagehide",Cn),window.removeEventListener("beforeunload",kn),document.removeEventListener("visibilitychange",Tn),document.removeEventListener("keydown",An,!0),document.removeEventListener("keydown",_n,!0),et.dispose(),ke.dispose(),s.dispose(),l.dispose(),u.dispose(),no(),Ko(),d.dispose(),ne(),G.dispose(),V.dispose(),he.dispose(),Ae.dispose(),se.dispose(),h.dispose(),c?.dispose(),f.dispose(),Xo(),Ur(),document.documentElement.style.removeProperty("--grabby-toast-bottom"),Pn()}};return i.state.options.enabled&&et.start(),i.state.toolbar={...i.state.toolbar,visible:!1},C&&G.collapse(),o&&n.showToolbar&&(Re.showToolbar(),C||h.maybeShow()),i.subscribe((m,S)=>{S==="options"&&(m.options.enabled?et.start():(et.stop(),W(!0))),S==="toolbar"&&(_e(),m.options.persistHistory&&(m.toolbar.comments.length>0?Qt(m.toolbar.comments):Yo()))}),n.server&&(c=zt({server:n.server,projectKey:n.projectKey,getComment:m=>T().find(S=>S.id===m),getScreenshot:Ge,onState:(m,S)=>Ea(m,S)})),n.webhookUrl&&Re.registerPlugin(mo(n.webhookUrl)),Re}function Tc(e){let t=e?.dataset??{},n={};return(t.mode==="live"||t.mode==="local")&&(n.mode=t.mode),t.server&&(n.server=t.server),t.projectKey&&(n.projectKey=t.projectKey),(t.identity==="ask"||t.identity==="anonymous"||t.identity==="none")&&(n.identity=t.identity),t.activationKey&&(n.activationKey=t.activationKey),t.screenshots==="false"&&(n.screenshots=!1),t.webhookUrl&&(n.webhookUrl=t.webhookUrl),t.styleNonce?n.styleNonce=t.styleNonce:e?.nonce&&(n.styleNonce=e.nonce),n}var ha=pa(Tc(document.currentScript));window.grabby=ha;var Cm=ha;})();