helldots 0.4.0 → 0.5.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,1468 +1,22 @@
1
1
  /*! HellDots — MIT. Bundles nanoid (MIT) © 2017 Andrey Sitnik <andrey@sitnik.es> — https://github.com/ai/nanoid */
2
- var HellDots=(()=>{var ye=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var eo=Object.getOwnPropertyNames;var to=Object.prototype.hasOwnProperty;var oo=(o,e)=>{for(var t in e)ye(o,t,{get:e[t],enumerable:!0})},no=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of eo(e))!to.call(o,s)&&s!==t&&ye(o,s,{get:()=>e[s],enumerable:!(n=Qt(e,s))||n.enumerable});return o};var io=o=>no(ye({},"__esModule",{value:!0}),o);var li={};oo(li,{CommentOverlay:()=>Ye,createCommentOverlay:()=>Zt,default:()=>ai});var Qe="[modern-screenshot]",L=typeof window<"u",ro=L&&"Worker"in window,di=L&&"atob"in window,hi=L&&"btoa"in window,Oe=L?window.navigator?.userAgent:"",et=Oe.includes("Chrome"),ie=Oe.includes("AppleWebKit")&&!et,ve=Oe.includes("Firefox"),so=o=>o&&"__CONTEXT__"in o,ao=o=>o.constructor.name==="CSSFontFaceRule",lo=o=>o.constructor.name==="CSSImportRule",co=o=>o.constructor.name==="CSSLayerBlockRule",A=o=>o.nodeType===1,j=o=>typeof o.className=="object",tt=o=>o.tagName==="image",ho=o=>o.tagName==="use",z=o=>A(o)&&typeof o.style<"u"&&!j(o),po=o=>o.nodeType===8,uo=o=>o.nodeType===3,H=o=>o.tagName==="IMG",re=o=>o.tagName==="VIDEO",mo=o=>o.tagName==="CANVAS",go=o=>o.tagName==="TEXTAREA",fo=o=>o.tagName==="INPUT",Eo=o=>o.tagName==="STYLE",bo=o=>o.tagName==="SCRIPT",Co=o=>o.tagName==="SELECT",To=o=>o.tagName==="SLOT",xo=o=>o.tagName==="IFRAME",_o=(...o)=>console.warn(Qe,...o);function yo(o){let e=o?.createElement?.("canvas");return e&&(e.height=e.width=1),!!e&&"toDataURL"in e&&!!e.toDataURL("image/webp").includes("image/webp")}var we=o=>o.startsWith("data:");function ot(o,e){if(o.match(/^[a-z]+:\/\//i))return o;if(L&&o.match(/^\/\//))return window.location.protocol+o;if(o.match(/^[a-z]+:/i)||!L)return o;let t=se().implementation.createHTMLDocument(),n=t.createElement("base"),s=t.createElement("a");return t.head.appendChild(n),t.body.appendChild(s),e&&(n.href=e),s.href=o,s.href}function se(o){return(o&&A(o)?o?.ownerDocument:o)??window.document}var ae="http://www.w3.org/2000/svg";function wo(o,e,t){let n=se(t).createElementNS(ae,"svg");return n.setAttributeNS(null,"width",o.toString()),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"viewBox",`0 0 ${o} ${e}`),n}function So(o,e){let t=new XMLSerializer().serializeToString(o);return e&&(t=t.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Oo(o,e){return new Promise((t,n)=>{let s=new FileReader;s.onload=()=>t(s.result),s.onerror=()=>n(s.error),s.onabort=()=>n(new Error(`Failed read blob to ${e}`)),e==="dataUrl"?s.readAsDataURL(o):e==="arrayBuffer"&&s.readAsArrayBuffer(o)})}var vo=o=>Oo(o,"dataUrl");function k(o,e){let t=se(e).createElement("img");return t.decoding="sync",t.loading="eager",t.src=o,t}function Y(o,e){return new Promise(t=>{let{timeout:n,ownerDocument:s,onError:r,onWarn:a}=e??{},l=typeof o=="string"?k(o,se(s)):o,c=null,h=null;function d(){t(l),c&&clearTimeout(c),h?.()}if(n&&(c=setTimeout(d,n)),re(l)){let p=l.currentSrc||l.src;if(!p)return l.poster?Y(l.poster,e).then(t):d();if(l.readyState>=2)return d();let m=d,u=g=>{a?.("Failed video load",p,g),r?.(g),d()};h=()=>{l.removeEventListener("loadeddata",m),l.removeEventListener("error",u)},l.addEventListener("loadeddata",m,{once:!0}),l.addEventListener("error",u,{once:!0})}else{let p=tt(l)?l.href.baseVal:l.currentSrc||l.src;if(!p)return d();let m=async()=>{if(H(l)&&"decode"in l)try{await l.decode()}catch(g){a?.("Failed to decode image, trying to render anyway",l.dataset.originalSrc||p,g)}d()},u=g=>{a?.("Failed image load",l.dataset.originalSrc||p,g),d()};if(H(l)&&l.complete)return m();h=()=>{l.removeEventListener("load",m),l.removeEventListener("error",u)},l.addEventListener("load",m,{once:!0}),l.addEventListener("error",u,{once:!0})}})}async function Ao(o,e){z(o)&&(H(o)||re(o)?await Y(o,e):await Promise.all(["img","video"].flatMap(t=>Array.from(o.querySelectorAll(t)).map(n=>Y(n,e)))))}var nt=(function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function it(o){return o?.split(",").map(e=>e.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var We=0;function No(o){let e=`${Qe}[#${We}]`;return We++,{time:t=>o&&console.time(`${e} ${t}`),timeEnd:t=>o&&console.timeEnd(`${e} ${t}`),warn:(...t)=>o&&_o(...t)}}function Ro(o){return{cache:o?"no-cache":"force-cache"}}async function rt(o,e){return so(o)?o:Io(o,{...e,autoDestruct:!0})}async function Io(o,e){let{scale:t=1,workerUrl:n,workerNumber:s=1}=e||{},r=!!e?.debug,a=e?.features??!0,l=o.ownerDocument??(L?window.document:void 0),c=o.ownerDocument?.defaultView??(L?window:void 0),h=new Map,d={width:0,height:0,quality:1,type:"image/png",scale:t,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:r,fetch:{requestInit:Ro(e?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...e?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:s,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...e,__CONTEXT__:!0,log:No(r),node:o,ownerDocument:l,ownerWindow:c,dpi:t===1?null:96*t,svgStyleElement:st(l),svgDefsElement:l?.createElementNS(ae,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:ro&&n&&s?s:0})].map(()=>{try{let u=new Worker(n);return u.onmessage=async g=>{let{url:f,result:b}=g.data;b?h.get(f)?.resolve?.(b):h.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`))},u.onmessageerror=g=>{let{url:f}=g.data;h.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`))},u}catch(u){return d.log.warn("Failed to new Worker",u),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[yo(l)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:h,drawImageCount:0,tasks:[],features:a,isEnable:u=>u==="restoreScrollPosition"?typeof a=="boolean"?!1:a[u]??!1:typeof a=="boolean"?a:a[u]??!0,shadowRoots:[]};d.log.time("wait until load"),await Ao(o,{timeout:d.timeout,onWarn:d.log.warn}),d.log.timeEnd("wait until load");let{width:p,height:m}=Lo(o,d);return d.width=p,d.height=m,d}function st(o){if(!o)return;let e=o.createElement("style"),t=e.ownerDocument.createTextNode(`
2
+ /*! Bundles modern-screenshot (MIT) © 2021-present wxm https://github.com/qq15725/modern-screenshot */
3
+ var HellDots=(()=>{var Fe=Object.defineProperty;var An=Object.getOwnPropertyDescriptor;var vn=Object.getOwnPropertyNames;var Nn=Object.prototype.hasOwnProperty;var Rn=(n,e)=>{for(var t in e)Fe(n,t,{get:e[t],enumerable:!0})},In=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of vn(e))!Nn.call(n,r)&&r!==t&&Fe(n,r,{get:()=>e[r],enumerable:!(o=An(e,r))||o.enumerable});return n};var Ln=n=>In(Fe({},"__esModule",{value:!0}),n);var Xi={};Rn(Xi,{CommentOverlay:()=>pt,createCommentOverlay:()=>wn,default:()=>Fi});var Ct="[modern-screenshot]",k=typeof window<"u",Bn=k&&"Worker"in window,Vi=k&&"atob"in window,zi=k&&"btoa"in window,Ve=k?window.navigator?.userAgent:"",_t=Ve.includes("Chrome"),pe=Ve.includes("AppleWebKit")&&!_t,ze=Ve.includes("Firefox"),Dn=n=>n&&"__CONTEXT__"in n,kn=n=>n.constructor.name==="CSSFontFaceRule",Mn=n=>n.constructor.name==="CSSImportRule",Pn=n=>n.constructor.name==="CSSLayerBlockRule",N=n=>n.nodeType===1,ne=n=>typeof n.className=="object",Tt=n=>n.tagName==="image",$n=n=>n.tagName==="use",Q=n=>N(n)&&typeof n.style<"u"&&!ne(n),Hn=n=>n.nodeType===8,Fn=n=>n.nodeType===3,U=n=>n.tagName==="IMG",ue=n=>n.tagName==="VIDEO",Xn=n=>n.tagName==="CANVAS",Un=n=>n.tagName==="TEXTAREA",Vn=n=>n.tagName==="INPUT",zn=n=>n.tagName==="STYLE",Gn=n=>n.tagName==="SCRIPT",Yn=n=>n.tagName==="SELECT",Wn=n=>n.tagName==="SLOT",jn=n=>n.tagName==="IFRAME",qn=(...n)=>console.warn(Ct,...n);function Kn(n){let e=n?.createElement?.("canvas");return e&&(e.height=e.width=1),!!e&&"toDataURL"in e&&!!e.toDataURL("image/webp").includes("image/webp")}var Xe=n=>n.startsWith("data:");function xt(n,e){if(n.match(/^[a-z]+:\/\//i))return n;if(k&&n.match(/^\/\//))return window.location.protocol+n;if(n.match(/^[a-z]+:/i)||!k)return n;let t=me().implementation.createHTMLDocument(),o=t.createElement("base"),r=t.createElement("a");return t.head.appendChild(o),t.body.appendChild(r),e&&(o.href=e),r.href=n,r.href}function me(n){return(n&&N(n)?n?.ownerDocument:n)??window.document}var fe="http://www.w3.org/2000/svg";function Zn(n,e,t){let o=me(t).createElementNS(fe,"svg");return o.setAttributeNS(null,"width",n.toString()),o.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${n} ${e}`),o}function Jn(n,e){let t=new XMLSerializer().serializeToString(n);return e&&(t=t.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Qn(n,e){return new Promise((t,o)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>o(r.error),r.onabort=()=>o(new Error(`Failed read blob to ${e}`)),e==="dataUrl"?r.readAsDataURL(n):e==="arrayBuffer"&&r.readAsArrayBuffer(n)})}var eo=n=>Qn(n,"dataUrl");function X(n,e){let t=me(e).createElement("img");return t.decoding="sync",t.loading="eager",t.src=n,t}function ee(n,e){return new Promise(t=>{let{timeout:o,ownerDocument:r,onError:i,onWarn:a}=e??{},l=typeof n=="string"?X(n,me(r)):n,c=null,d=null;function h(){t(l),c&&clearTimeout(c),d?.()}if(o&&(c=setTimeout(h,o)),ue(l)){let p=l.currentSrc||l.src;if(!p)return l.poster?ee(l.poster,e).then(t):h();if(l.readyState>=2)return h();let m=h,u=f=>{a?.("Failed video load",p,f),i?.(f),h()};d=()=>{l.removeEventListener("loadeddata",m),l.removeEventListener("error",u)},l.addEventListener("loadeddata",m,{once:!0}),l.addEventListener("error",u,{once:!0})}else{let p=Tt(l)?l.href.baseVal:l.currentSrc||l.src;if(!p)return h();let m=async()=>{if(U(l)&&"decode"in l)try{await l.decode()}catch(f){a?.("Failed to decode image, trying to render anyway",l.dataset.originalSrc||p,f)}h()},u=f=>{a?.("Failed image load",l.dataset.originalSrc||p,f),h()};if(U(l)&&l.complete)return m();d=()=>{l.removeEventListener("load",m),l.removeEventListener("error",u)},l.addEventListener("load",m,{once:!0}),l.addEventListener("error",u,{once:!0})}})}async function to(n,e){Q(n)&&(U(n)||ue(n)?await ee(n,e):await Promise.all(["img","video"].flatMap(t=>Array.from(n.querySelectorAll(t)).map(o=>ee(o,e)))))}var yt=(function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function St(n){return n?.split(",").map(e=>e.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var ut=0;function no(n){let e=`${Ct}[#${ut}]`;return ut++,{time:t=>n&&console.time(`${e} ${t}`),timeEnd:t=>n&&console.timeEnd(`${e} ${t}`),warn:(...t)=>n&&qn(...t)}}function oo(n){return{cache:n?"no-cache":"force-cache"}}async function wt(n,e){return Dn(n)?n:io(n,{...e,autoDestruct:!0})}async function io(n,e){let{scale:t=1,workerUrl:o,workerNumber:r=1}=e||{},i=!!e?.debug,a=e?.features??!0,l=n.ownerDocument??(k?window.document:void 0),c=n.ownerDocument?.defaultView??(k?window:void 0),d=new Map,h={width:0,height:0,quality:1,type:"image/png",scale:t,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:oo(e?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...e?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:r,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...e,__CONTEXT__:!0,log:no(i),node:n,ownerDocument:l,ownerWindow:c,dpi:t===1?null:96*t,svgStyleElement:Ot(l),svgDefsElement:l?.createElementNS(fe,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Bn&&o&&r?r:0})].map(()=>{try{let u=new Worker(o);return u.onmessage=async f=>{let{url:g,result:E}=f.data;E?d.get(g)?.resolve?.(E):d.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},u.onmessageerror=f=>{let{url:g}=f.data;d.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},u}catch(u){return h.log.warn("Failed to new Worker",u),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Kn(l)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:d,drawImageCount:0,tasks:[],features:a,isEnable:u=>u==="restoreScrollPosition"?typeof a=="boolean"?!1:a[u]??!1:typeof a=="boolean"?a:a[u]??!0,shadowRoots:[]};h.log.time("wait until load"),await to(n,{timeout:h.timeout,onWarn:h.log.warn}),h.log.timeEnd("wait until load");let{width:p,height:m}=ro(n,h);return h.width=p,h.height=m,h}function Ot(n){if(!n)return;let e=n.createElement("style"),t=e.ownerDocument.createTextNode(`
3
4
  .______background-clip--text {
4
5
  background-clip: text;
5
6
  -webkit-background-clip: text;
6
7
  }
7
- `);return e.appendChild(t),e}function Lo(o,e){let{width:t,height:n}=e;if(A(o)&&(!t||!n)){let s=o.getBoundingClientRect();t=t||s.width||Number(o.getAttribute("width"))||0,n=n||s.height||Number(o.getAttribute("height"))||0}return{width:t,height:n}}async function Bo(o,e){let{log:t,timeout:n,drawImageCount:s,drawImageInterval:r}=e;t.time("image to canvas");let a=await Y(o,{timeout:n,onWarn:e.log.warn}),{canvas:l,context2d:c}=Po(o.ownerDocument,e),h=()=>{try{c?.drawImage(a,0,0,l.width,l.height)}catch(d){e.log.warn("Failed to drawImage",d)}};if(h(),e.isEnable("fixSvgXmlDecode"))for(let d=0;d<s;d++)await new Promise(p=>{setTimeout(()=>{c?.clearRect(0,0,l.width,l.height),h(),p()},d+r)});return e.drawImageCount=0,t.timeEnd("image to canvas"),l}function Po(o,e){let{width:t,height:n,scale:s,backgroundColor:r,maximumCanvasSize:a}=e,l=o.createElement("canvas");l.width=Math.floor(t*s),l.height=Math.floor(n*s),l.style.width=`${t}px`,l.style.height=`${n}px`,a&&(l.width>a||l.height>a)&&(l.width>a&&l.height>a?l.width>l.height?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a):l.width>a?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a));let c=l.getContext("2d");return c&&r&&(c.fillStyle=r,c.fillRect(0,0,l.width,l.height)),{canvas:l,context2d:c}}function at(o,e){if(o.ownerDocument)try{let r=o.toDataURL();if(r!=="data:,")return k(r,o.ownerDocument)}catch(r){e.log.warn("Failed to clone canvas",r)}let t=o.cloneNode(!1),n=o.getContext("2d"),s=t.getContext("2d");try{return n&&s&&s.putImageData(n.getImageData(0,0,o.width,o.height),0,0),t}catch(r){e.log.warn("Failed to clone canvas",r)}return t}function Do(o,e){try{if(o?.contentDocument?.documentElement)return Ae(o.contentDocument.documentElement,e)}catch(t){e.log.warn("Failed to clone iframe",t)}return o.cloneNode(!1)}function Mo(o){let e=o.cloneNode(!1);return o.currentSrc&&o.currentSrc!==o.src&&(e.src=o.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager"),e}async function $o(o,e){if(o.ownerDocument&&!o.currentSrc&&o.poster)return k(o.poster,o.ownerDocument);let t=o.cloneNode(!1);t.crossOrigin="anonymous",o.currentSrc&&o.currentSrc!==o.src&&(t.src=o.currentSrc);let n=t.ownerDocument;if(n){let s=!0;if(await Y(t,{onError:()=>s=!1,onWarn:e.log.warn}),!s)return o.poster?k(o.poster,o.ownerDocument):t;t.currentTime=o.currentTime,await new Promise(a=>{t.addEventListener("seeked",a,{once:!0})});let r=n.createElement("canvas");r.width=o.offsetWidth,r.height=o.offsetHeight;try{let a=r.getContext("2d");a&&a.drawImage(t,0,0,r.width,r.height)}catch(a){return e.log.warn("Failed to clone video",a),o.poster?k(o.poster,o.ownerDocument):t}return at(r,e)}return t}function ko(o,e){return mo(o)?at(o,e):xo(o)?Do(o,e):H(o)?Mo(o):re(o)?$o(o,e):o.cloneNode(!1)}function Ho(o){let e=o.sandbox;if(!e){let{ownerDocument:t}=o;try{t&&(e=t.createElement("iframe"),e.id=`__SANDBOX__${nt()}`,e.width="0",e.height="0",e.style.visibility="hidden",e.style.position="fixed",t.body.appendChild(e),e.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',o.sandbox=e)}catch(n){o.log.warn("Failed to getSandBox",n)}}return e}var Xo=["width","height","-webkit-text-fill-color"],Fo=["stroke","fill"];function lt(o,e,t){let{defaultComputedStyles:n}=t,s=o.nodeName.toLowerCase(),r=j(o)&&s!=="svg",a=r?Fo.map(f=>[f,o.getAttribute(f)]).filter(([,f])=>f!==null):[],l=[r&&"svg",s,a.map((f,b)=>`${f}=${b}`).join(","),e].filter(Boolean).join(":");if(n.has(l))return n.get(l);let h=Ho(t)?.contentWindow;if(!h)return new Map;let d=h?.document,p,m;r?(p=d.createElementNS(ae,"svg"),m=p.ownerDocument.createElementNS(p.namespaceURI,s),a.forEach(([f,b])=>{m.setAttributeNS(null,f,b)}),p.appendChild(m)):p=m=d.createElement(s),m.textContent=" ",d.body.appendChild(p);let u=h.getComputedStyle(m,e),g=new Map;for(let f=u.length,b=0;b<f;b++){let C=u.item(b);Xo.includes(C)||g.set(C,u.getPropertyValue(C))}return d.body.removeChild(p),n.set(l,g),g}function ct(o,e,t){let n=new Map,s=[],r=new Map;if(t)for(let l of t)a(l);else for(let l=o.length,c=0;c<l;c++){let h=o.item(c);a(h)}for(let l=s.length,c=0;c<l;c++)r.get(s[c])?.forEach((h,d)=>n.set(d,h));function a(l){let c=o.getPropertyValue(l),h=o.getPropertyPriority(l),d=l.lastIndexOf("-"),p=d>-1?l.substring(0,d):void 0;if(p){let m=r.get(p);m||(m=new Map,r.set(p,m)),m.set(l,[c,h])}e.get(l)===c&&!h||(p?s.push(p):n.set(l,[c,h]))}return n}function Uo(o,e,t,n){let{ownerWindow:s,includeStyleProperties:r,currentParentNodeStyle:a}=n,l=e.style,c=s.getComputedStyle(o),h=lt(o,null,n);a?.forEach((p,m)=>{h.delete(m)});let d=ct(c,h,r);d.delete("transition-property"),d.delete("all"),d.delete("d"),d.delete("content"),t&&(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"&&e.classList.add("______background-clip--text"),et&&(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"&&o.scrollWidth===o.clientWidth&&d.set("text-overflow",["clip",""]));for(let p=l.length,m=0;m<p;m++)l.removeProperty(l.item(m));return d.forEach(([p,m],u)=>{l.setProperty(u,p,m)}),d}function Vo(o,e){(go(o)||fo(o)||Co(o))&&e.setAttribute("value",o.value)}var Go=["::before","::after"],zo=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function Yo(o,e,t,n,s){let{ownerWindow:r,svgStyleElement:a,svgStyles:l,currentNodeStyle:c}=n;if(!a||!r)return;function h(d){let p=r.getComputedStyle(o,d),m=p.getPropertyValue("content");if(!m||m==="none")return;s?.(m),m=m.replace(/(')|(")|(counter\(.+\))/g,"");let u=[nt()],g=lt(o,d,n);c?.forEach((E,T)=>{g.delete(T)});let f=ct(p,g,n.includeStyleProperties);f.delete("content"),f.delete("-webkit-locale"),f.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text");let b=[`content: '${m}';`];if(f.forEach(([E,T],w)=>{b.push(`${w}: ${E}${T?" !important":""};`)}),b.length===1)return;try{e.className=[e.className,...u].join(" ")}catch(E){n.log.warn("Failed to copyPseudoClass",E);return}let C=b.join(`
8
- `),x=l.get(C);x||(x=[],l.set(C,x)),x.push(`.${u[0]}${d}`)}Go.forEach(h),t&&zo.forEach(h)}var je=new Set(["symbol"]);async function qe(o,e,t,n,s){if(A(t)&&(Eo(t)||bo(t))||n.filter&&!n.filter(t))return;je.has(e.nodeName)||je.has(t.nodeName)?n.currentParentNodeStyle=void 0:n.currentParentNodeStyle=n.currentNodeStyle;let r=await Ae(t,n,!1,s);n.isEnable("restoreScrollPosition")&&Wo(o,r),e.appendChild(r)}async function Ke(o,e,t,n){let s=o.firstChild;A(o)&&o.shadowRoot&&(s=o.shadowRoot?.firstChild,t.shadowRoots.push(o.shadowRoot));for(let r=s;r;r=r.nextSibling)if(!po(r))if(A(r)&&To(r)&&typeof r.assignedNodes=="function"){let a=r.assignedNodes();for(let l=0;l<a.length;l++)await qe(o,e,a[l],t,n)}else await qe(o,e,r,t,n)}function Wo(o,e){if(!z(o)||!z(e))return;let{scrollTop:t,scrollLeft:n}=o;if(!t&&!n)return;let{transform:s}=e.style,r=new DOMMatrix(s),{a,b:l,c,d:h}=r;r.a=1,r.b=0,r.c=0,r.d=1,r.translateSelf(-n,-t),r.a=a,r.b=l,r.c=c,r.d=h,e.style.transform=r.toString()}function jo(o,e){let{backgroundColor:t,width:n,height:s,style:r}=e,a=o.style;if(t&&a.setProperty("background-color",t,"important"),n&&a.setProperty("width",`${n}px`,"important"),s&&a.setProperty("height",`${s}px`,"important"),r)for(let l in r)a[l]=r[l]}var qo=/^[\w-:]+$/;async function Ae(o,e,t=!1,n){let{ownerDocument:s,ownerWindow:r,fontFamilies:a,onCloneEachNode:l}=e;if(s&&uo(o))return n&&/\S/.test(o.data)&&n(o.data),s.createTextNode(o.data);if(s&&r&&A(o)&&(z(o)||j(o))){let h=await ko(o,e);if(e.isEnable("removeAbnormalAttributes")){let f=h.getAttributeNames();for(let b=f.length,C=0;C<b;C++){let x=f[C];qo.test(x)||h.removeAttribute(x)}}let d=e.currentNodeStyle=Uo(o,h,t,e);t&&jo(h,e);let p=!1;if(e.isEnable("copyScrollbar")){let f=[d.get("overflow-x")?.[0],d.get("overflow-y")?.[0]];p=f.includes("scroll")||(f.includes("auto")||f.includes("overlay"))&&(o.scrollHeight>o.clientHeight||o.scrollWidth>o.clientWidth)}let m=d.get("text-transform")?.[0],u=it(d.get("font-family")?.[0]),g=u?f=>{m==="uppercase"?f=f.toUpperCase():m==="lowercase"?f=f.toLowerCase():m==="capitalize"&&(f=f[0].toUpperCase()+f.substring(1)),u.forEach(b=>{let C=a.get(b);C||a.set(b,C=new Set),f.split("").forEach(x=>C.add(x))})}:void 0;return Yo(o,h,p,e,g),Vo(o,h),re(o)||await Ke(o,h,e,g),await l?.(h),h}let c=o.cloneNode(!1);return await Ke(o,c,e),await l?.(c),c}function Ko(o){if(o.ownerDocument=void 0,o.ownerWindow=void 0,o.svgStyleElement=void 0,o.svgDefsElement=void 0,o.svgStyles.clear(),o.defaultComputedStyles.clear(),o.sandbox){try{o.sandbox.remove()}catch(e){o.log.warn("Failed to destroyContext",e)}o.sandbox=void 0}o.workers=[],o.fontFamilies.clear(),o.fontCssTexts.clear(),o.requests.clear(),o.tasks=[],o.shadowRoots=[]}function Zo(o){let{url:e,timeout:t,responseType:n,...s}=o,r=new AbortController,a=t?setTimeout(()=>r.abort(),t):void 0;return fetch(e,{signal:r.signal,...s}).then(l=>{if(!l.ok)throw new Error("Failed fetch, not 2xx response",{cause:l});switch(n){case"arrayBuffer":return l.arrayBuffer();case"dataUrl":return l.blob().then(vo);default:return l.text()}}).finally(()=>clearTimeout(a))}function W(o,e){let{url:t,requestType:n="text",responseType:s="text",imageDom:r}=e,a=t,{timeout:l,acceptOfImage:c,requests:h,fetchFn:d,fetch:{requestInit:p,bypassingCache:m,placeholderImage:u},font:g,workers:f,fontFamilies:b}=o;n==="image"&&(ie||ve)&&o.drawImageCount++;let C=h.get(t);if(!C){m&&m instanceof RegExp&&m.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let x=n.startsWith("font")&&g&&g.minify,E=new Set;x&&n.split(";")[1].split(",").forEach(S=>{b.has(S)&&b.get(S).forEach(P=>E.add(P))});let T=x&&E.size,w={url:a,timeout:l,responseType:T?"arrayBuffer":s,headers:n==="image"?{accept:c}:void 0,...p};C={type:n,resolve:void 0,reject:void 0,response:null},C.response=(async()=>{if(d&&n==="image"){let _=await d(t);if(_)return _}return!ie&&t.startsWith("http")&&f.length?new Promise((_,S)=>{f[h.size&f.length-1].postMessage({rawUrl:t,...w}),C.resolve=_,C.reject=S}):Zo(w)})().catch(_=>{if(h.delete(t),n==="image"&&u)return o.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof u=="string"?u:u(r);throw _}),h.set(t,C)}return C.response}async function dt(o,e,t,n){if(!ht(o))return o;for(let[s,r]of Jo(o,e))try{let a=await W(t,{url:r,requestType:n?"image":"text",responseType:"dataUrl"});o=o.replace(Qo(s),`$1${a}$3`)}catch(a){t.log.warn("Failed to fetch css data url",s,a)}return o}function ht(o){return/url\((['"]?)([^'"]+?)\1\)/.test(o)}var pt=/url\((['"]?)([^'"]+?)\1\)/g;function Jo(o,e){let t=[];return o.replace(pt,(n,s,r)=>(t.push([r,ot(r,e)]),n)),t.filter(([n])=>!we(n))}function Qo(o){let e=o.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}var en=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function tn(o,e){return en.map(t=>{let n=o.getPropertyValue(t);return!n||n==="none"?null:((ie||ve)&&e.drawImageCount++,dt(n,null,e,!0).then(s=>{!s||n===s||o.setProperty(t,s,o.getPropertyPriority(t))}))}).filter(Boolean)}function on(o,e){if(H(o)){let t=o.currentSrc||o.src;if(!we(t))return[W(e,{url:t,imageDom:o,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(o.srcset="",o.dataset.originalSrc=t,o.src=n||"")})];(ie||ve)&&e.drawImageCount++}else if(j(o)&&!we(o.href.baseVal)){let t=o.href.baseVal;return[W(e,{url:t,imageDom:o,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(o.dataset.originalSrc=t,o.href.baseVal=n||"")})]}return[]}function nn(o,e){let{ownerDocument:t,svgDefsElement:n}=e,s=o.getAttribute("href")??o.getAttribute("xlink:href");if(!s)return[];let[r,a]=s.split("#");if(a){let l=`#${a}`,c=e.shadowRoots.reduce((h,d)=>h??d.querySelector(`svg ${l}`),t?.querySelector(`svg ${l}`));if(r&&o.setAttribute("href",l),n?.querySelector(l))return[];if(c)return n?.appendChild(c.cloneNode(!0)),[];if(r)return[W(e,{url:r,responseType:"text"}).then(h=>{n?.insertAdjacentHTML("beforeend",h)})]}return[]}function ut(o,e){let{tasks:t}=e;A(o)&&((H(o)||tt(o))&&t.push(...on(o,e)),ho(o)&&t.push(...nn(o,e))),z(o)&&t.push(...tn(o.style,e)),o.childNodes.forEach(n=>{ut(n,e)})}async function rn(o,e){let{ownerDocument:t,svgStyleElement:n,fontFamilies:s,fontCssTexts:r,tasks:a,font:l}=e;if(!(!t||!n||!s.size))if(l&&l.cssText){let c=Je(l.cssText,e);n.appendChild(t.createTextNode(`${c}
9
- `))}else{let c=Array.from(t.styleSheets).filter(u=>{try{return"cssRules"in u&&!!u.cssRules.length}catch(g){return e.log.warn(`Error while reading CSS rules from ${u.href}`,g),!1}}),h=t.implementation.createHTMLDocument(""),d=h.createElement("style");h.head.appendChild(d);let p=d.sheet;await Promise.all(c.flatMap(u=>Array.from(u.cssRules).map(async g=>{if(lo(g)){let f=g.href,b="";try{b=await W(e,{url:f,requestType:"text",responseType:"text"})}catch(x){e.log.warn(`Error fetch remote css import from ${f}`,x)}let C=b.replace(pt,(x,E,T)=>x.replace(T,ot(T,f)));for(let x of an(C))try{p.insertRule(x,p.cssRules.length)}catch(E){e.log.warn("Error inserting rule from remote css import",{rule:x,error:E})}}}))),p.cssRules.length&&c.push(p);let m=[];c.forEach(u=>{Se(u.cssRules,m)}),m.filter(u=>ao(u)&&ht(u.style.getPropertyValue("src"))&&it(u.style.getPropertyValue("font-family"))?.some(g=>s.has(g))).forEach(u=>{let g=u,f=r.get(g.cssText);f?n.appendChild(t.createTextNode(`${f}
10
- `)):a.push(dt(g.cssText,g.parentStyleSheet?g.parentStyleSheet.href:null,e).then(b=>{b=Je(b,e),r.set(g.cssText,b),n.appendChild(t.createTextNode(`${b}
11
- `))}))})}}var sn=/(\/\*[\s\S]*?\*\/)/g,Ze=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function an(o){if(o==null)return[];let e=[],t=o.replace(sn,"");for(;;){let r=Ze.exec(t);if(!r)break;e.push(r[0])}t=t.replace(Ze,"");let n=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let r=n.exec(t);if(r)s.lastIndex=n.lastIndex;else if(r=s.exec(t),r)n.lastIndex=s.lastIndex;else break;e.push(r[0])}return e}var ln=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,cn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Je(o,e){let{font:t}=e,n=t?t?.preferredFormat:void 0;return n?o.replace(cn,s=>{for(;;){let[r,,a]=ln.exec(s)||[];if(!a)return"";if(a===n)return`src: ${r};`}}):o}function Se(o,e=[]){for(let t of Array.from(o))co(t)?e.push(...Se(t.cssRules)):"cssRules"in t?Se(t.cssRules,e):e.push(t);return e}var dn=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function hn(o){return dn.test(o.innerHTML)}async function pn(o,e){let t=await rt(o,e);if(A(t.node)&&j(t.node)&&!hn(t.node))return t.node;let{ownerDocument:n,log:s,tasks:r,svgStyleElement:a,svgDefsElement:l,svgStyles:c,font:h,progress:d,autoDestruct:p,onCloneNode:m,onEmbedNode:u,onCreateForeignObjectSvg:g}=t;s.time("clone node");let f=await Ae(t.node,t,!0);if(a&&n){let T="";c.forEach((w,_)=>{T+=`${w.join(`,
8
+ `);return e.appendChild(t),e}function ro(n,e){let{width:t,height:o}=e;if(N(n)&&(!t||!o)){let r=n.getBoundingClientRect();t=t||r.width||Number(n.getAttribute("width"))||0,o=o||r.height||Number(n.getAttribute("height"))||0}return{width:t,height:o}}async function so(n,e){let{log:t,timeout:o,drawImageCount:r,drawImageInterval:i}=e;t.time("image to canvas");let a=await ee(n,{timeout:o,onWarn:e.log.warn}),{canvas:l,context2d:c}=ao(n.ownerDocument,e),d=()=>{try{c?.drawImage(a,0,0,l.width,l.height)}catch(h){e.log.warn("Failed to drawImage",h)}};if(d(),e.isEnable("fixSvgXmlDecode"))for(let h=0;h<r;h++)await new Promise(p=>{setTimeout(()=>{c?.clearRect(0,0,l.width,l.height),d(),p()},h+i)});return e.drawImageCount=0,t.timeEnd("image to canvas"),l}function ao(n,e){let{width:t,height:o,scale:r,backgroundColor:i,maximumCanvasSize:a}=e,l=n.createElement("canvas");l.width=Math.floor(t*r),l.height=Math.floor(o*r),l.style.width=`${t}px`,l.style.height=`${o}px`,a&&(l.width>a||l.height>a)&&(l.width>a&&l.height>a?l.width>l.height?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a):l.width>a?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a));let c=l.getContext("2d");return c&&i&&(c.fillStyle=i,c.fillRect(0,0,l.width,l.height)),{canvas:l,context2d:c}}function At(n,e){if(n.ownerDocument)try{let i=n.toDataURL();if(i!=="data:,")return X(i,n.ownerDocument)}catch(i){e.log.warn("Failed to clone canvas",i)}let t=n.cloneNode(!1),o=n.getContext("2d"),r=t.getContext("2d");try{return o&&r&&r.putImageData(o.getImageData(0,0,n.width,n.height),0,0),t}catch(i){e.log.warn("Failed to clone canvas",i)}return t}function lo(n,e){try{if(n?.contentDocument?.documentElement)return Ge(n.contentDocument.documentElement,e)}catch(t){e.log.warn("Failed to clone iframe",t)}return n.cloneNode(!1)}function co(n){let e=n.cloneNode(!1);return n.currentSrc&&n.currentSrc!==n.src&&(e.src=n.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager"),e}async function ho(n,e){if(n.ownerDocument&&!n.currentSrc&&n.poster)return X(n.poster,n.ownerDocument);let t=n.cloneNode(!1);t.crossOrigin="anonymous",n.currentSrc&&n.currentSrc!==n.src&&(t.src=n.currentSrc);let o=t.ownerDocument;if(o){let r=!0;if(await ee(t,{onError:()=>r=!1,onWarn:e.log.warn}),!r)return n.poster?X(n.poster,n.ownerDocument):t;t.currentTime=n.currentTime,await new Promise(a=>{t.addEventListener("seeked",a,{once:!0})});let i=o.createElement("canvas");i.width=n.offsetWidth,i.height=n.offsetHeight;try{let a=i.getContext("2d");a&&a.drawImage(t,0,0,i.width,i.height)}catch(a){return e.log.warn("Failed to clone video",a),n.poster?X(n.poster,n.ownerDocument):t}return At(i,e)}return t}function po(n,e){return Xn(n)?At(n,e):jn(n)?lo(n,e):U(n)?co(n):ue(n)?ho(n,e):n.cloneNode(!1)}function uo(n){let e=n.sandbox;if(!e){let{ownerDocument:t}=n;try{t&&(e=t.createElement("iframe"),e.id=`__SANDBOX__${yt()}`,e.width="0",e.height="0",e.style.visibility="hidden",e.style.position="fixed",t.body.appendChild(e),e.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',n.sandbox=e)}catch(o){n.log.warn("Failed to getSandBox",o)}}return e}var mo=["width","height","-webkit-text-fill-color"],fo=["stroke","fill"];function vt(n,e,t){let{defaultComputedStyles:o}=t,r=n.nodeName.toLowerCase(),i=ne(n)&&r!=="svg",a=i?fo.map(g=>[g,n.getAttribute(g)]).filter(([,g])=>g!==null):[],l=[i&&"svg",r,a.map((g,E)=>`${g}=${E}`).join(","),e].filter(Boolean).join(":");if(o.has(l))return o.get(l);let d=uo(t)?.contentWindow;if(!d)return new Map;let h=d?.document,p,m;i?(p=h.createElementNS(fe,"svg"),m=p.ownerDocument.createElementNS(p.namespaceURI,r),a.forEach(([g,E])=>{m.setAttributeNS(null,g,E)}),p.appendChild(m)):p=m=h.createElement(r),m.textContent=" ",h.body.appendChild(p);let u=d.getComputedStyle(m,e),f=new Map;for(let g=u.length,E=0;E<g;E++){let b=u.item(E);mo.includes(b)||f.set(b,u.getPropertyValue(b))}return h.body.removeChild(p),o.set(l,f),f}function Nt(n,e,t){let o=new Map,r=[],i=new Map;if(t)for(let l of t)a(l);else for(let l=n.length,c=0;c<l;c++){let d=n.item(c);a(d)}for(let l=r.length,c=0;c<l;c++)i.get(r[c])?.forEach((d,h)=>o.set(h,d));function a(l){let c=n.getPropertyValue(l),d=n.getPropertyPriority(l),h=l.lastIndexOf("-"),p=h>-1?l.substring(0,h):void 0;if(p){let m=i.get(p);m||(m=new Map,i.set(p,m)),m.set(l,[c,d])}e.get(l)===c&&!d||(p?r.push(p):o.set(l,[c,d]))}return o}function go(n,e,t,o){let{ownerWindow:r,includeStyleProperties:i,currentParentNodeStyle:a}=o,l=e.style,c=r.getComputedStyle(n),d=vt(n,null,o);a?.forEach((p,m)=>{d.delete(m)});let h=Nt(c,d,i);h.delete("transition-property"),h.delete("all"),h.delete("d"),h.delete("content"),t&&(h.delete("position"),h.delete("margin-top"),h.delete("margin-right"),h.delete("margin-bottom"),h.delete("margin-left"),h.delete("margin-block-start"),h.delete("margin-block-end"),h.delete("margin-inline-start"),h.delete("margin-inline-end"),h.set("box-sizing",["border-box",""])),h.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text"),_t&&(h.has("font-kerning")||h.set("font-kerning",["normal",""]),(h.get("overflow-x")?.[0]==="hidden"||h.get("overflow-y")?.[0]==="hidden")&&h.get("text-overflow")?.[0]==="ellipsis"&&n.scrollWidth===n.clientWidth&&h.set("text-overflow",["clip",""]));for(let p=l.length,m=0;m<p;m++)l.removeProperty(l.item(m));return h.forEach(([p,m],u)=>{l.setProperty(u,p,m)}),h}function Eo(n,e){(Un(n)||Vn(n)||Yn(n))&&e.setAttribute("value",n.value)}var bo=["::before","::after"],Co=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function _o(n,e,t,o,r){let{ownerWindow:i,svgStyleElement:a,svgStyles:l,currentNodeStyle:c}=o;if(!a||!i)return;function d(h){let p=i.getComputedStyle(n,h),m=p.getPropertyValue("content");if(!m||m==="none")return;r?.(m),m=m.replace(/(')|(")|(counter\(.+\))/g,"");let u=[yt()],f=vt(n,h,o);c?.forEach((_,y)=>{f.delete(y)});let g=Nt(p,f,o.includeStyleProperties);g.delete("content"),g.delete("-webkit-locale"),g.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text");let E=[`content: '${m}';`];if(g.forEach(([_,y],C)=>{E.push(`${C}: ${_}${y?" !important":""};`)}),E.length===1)return;try{e.className=[e.className,...u].join(" ")}catch(_){o.log.warn("Failed to copyPseudoClass",_);return}let b=E.join(`
9
+ `),T=l.get(b);T||(T=[],l.set(b,T)),T.push(`.${u[0]}${h}`)}bo.forEach(d),t&&Co.forEach(d)}var mt=new Set(["symbol"]);async function ft(n,e,t,o,r){if(N(t)&&(zn(t)||Gn(t))||o.filter&&!o.filter(t))return;mt.has(e.nodeName)||mt.has(t.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;let i=await Ge(t,o,!1,r);o.isEnable("restoreScrollPosition")&&To(n,i),e.appendChild(i)}async function gt(n,e,t,o){let r=n.firstChild;N(n)&&n.shadowRoot&&(r=n.shadowRoot?.firstChild,t.shadowRoots.push(n.shadowRoot));for(let i=r;i;i=i.nextSibling)if(!Hn(i))if(N(i)&&Wn(i)&&typeof i.assignedNodes=="function"){let a=i.assignedNodes();for(let l=0;l<a.length;l++)await ft(n,e,a[l],t,o)}else await ft(n,e,i,t,o)}function To(n,e){if(!Q(n)||!Q(e))return;let{scrollTop:t,scrollLeft:o}=n;if(!t&&!o)return;let{transform:r}=e.style,i=new DOMMatrix(r),{a,b:l,c,d}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-o,-t),i.a=a,i.b=l,i.c=c,i.d=d,e.style.transform=i.toString()}function xo(n,e){let{backgroundColor:t,width:o,height:r,style:i}=e,a=n.style;if(t&&a.setProperty("background-color",t,"important"),o&&a.setProperty("width",`${o}px`,"important"),r&&a.setProperty("height",`${r}px`,"important"),i)for(let l in i)a[l]=i[l]}var yo=/^[\w-:]+$/;async function Ge(n,e,t=!1,o){let{ownerDocument:r,ownerWindow:i,fontFamilies:a,onCloneEachNode:l}=e;if(r&&Fn(n))return o&&/\S/.test(n.data)&&o(n.data),r.createTextNode(n.data);if(r&&i&&N(n)&&(Q(n)||ne(n))){let d=await po(n,e);if(e.isEnable("removeAbnormalAttributes")){let g=d.getAttributeNames();for(let E=g.length,b=0;b<E;b++){let T=g[b];yo.test(T)||d.removeAttribute(T)}}let h=e.currentNodeStyle=go(n,d,t,e);t&&xo(d,e);let p=!1;if(e.isEnable("copyScrollbar")){let g=[h.get("overflow-x")?.[0],h.get("overflow-y")?.[0]];p=g.includes("scroll")||(g.includes("auto")||g.includes("overlay"))&&(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)}let m=h.get("text-transform")?.[0],u=St(h.get("font-family")?.[0]),f=u?g=>{m==="uppercase"?g=g.toUpperCase():m==="lowercase"?g=g.toLowerCase():m==="capitalize"&&(g=g[0].toUpperCase()+g.substring(1)),u.forEach(E=>{let b=a.get(E);b||a.set(E,b=new Set),g.split("").forEach(T=>b.add(T))})}:void 0;return _o(n,d,p,e,f),Eo(n,d),ue(n)||await gt(n,d,e,f),await l?.(d),d}let c=n.cloneNode(!1);return await gt(n,c,e),await l?.(c),c}function So(n){if(n.ownerDocument=void 0,n.ownerWindow=void 0,n.svgStyleElement=void 0,n.svgDefsElement=void 0,n.svgStyles.clear(),n.defaultComputedStyles.clear(),n.sandbox){try{n.sandbox.remove()}catch(e){n.log.warn("Failed to destroyContext",e)}n.sandbox=void 0}n.workers=[],n.fontFamilies.clear(),n.fontCssTexts.clear(),n.requests.clear(),n.tasks=[],n.shadowRoots=[]}function wo(n){let{url:e,timeout:t,responseType:o,...r}=n,i=new AbortController,a=t?setTimeout(()=>i.abort(),t):void 0;return fetch(e,{signal:i.signal,...r}).then(l=>{if(!l.ok)throw new Error("Failed fetch, not 2xx response",{cause:l});switch(o){case"arrayBuffer":return l.arrayBuffer();case"dataUrl":return l.blob().then(eo);default:return l.text()}}).finally(()=>clearTimeout(a))}function te(n,e){let{url:t,requestType:o="text",responseType:r="text",imageDom:i}=e,a=t,{timeout:l,acceptOfImage:c,requests:d,fetchFn:h,fetch:{requestInit:p,bypassingCache:m,placeholderImage:u},font:f,workers:g,fontFamilies:E}=n;o==="image"&&(pe||ze)&&n.drawImageCount++;let b=d.get(t);if(!b){m&&m instanceof RegExp&&m.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let T=o.startsWith("font")&&f&&f.minify,_=new Set;T&&o.split(";")[1].split(",").forEach(M=>{E.has(M)&&E.get(M).forEach(J=>_.add(J))});let y=T&&_.size,C={url:a,timeout:l,responseType:y?"arrayBuffer":r,headers:o==="image"?{accept:c}:void 0,...p};b={type:o,resolve:void 0,reject:void 0,response:null},b.response=(async()=>{if(h&&o==="image"){let x=await h(t);if(x)return x}return!pe&&t.startsWith("http")&&g.length?new Promise((x,M)=>{g[d.size&g.length-1].postMessage({rawUrl:t,...C}),b.resolve=x,b.reject=M}):wo(C)})().catch(x=>{if(d.delete(t),o==="image"&&u)return n.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof u=="string"?u:u(i);throw x}),d.set(t,b)}return b.response}async function Rt(n,e,t,o){if(!It(n))return n;for(let[r,i]of Oo(n,e))try{let a=await te(t,{url:i,requestType:o?"image":"text",responseType:"dataUrl"});n=n.replace(Ao(r),`$1${a}$3`)}catch(a){t.log.warn("Failed to fetch css data url",r,a)}return n}function It(n){return/url\((['"]?)([^'"]+?)\1\)/.test(n)}var Lt=/url\((['"]?)([^'"]+?)\1\)/g;function Oo(n,e){let t=[];return n.replace(Lt,(o,r,i)=>(t.push([i,xt(i,e)]),o)),t.filter(([o])=>!Xe(o))}function Ao(n){let e=n.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}var vo=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function No(n,e){return vo.map(t=>{let o=n.getPropertyValue(t);return!o||o==="none"?null:((pe||ze)&&e.drawImageCount++,Rt(o,null,e,!0).then(r=>{!r||o===r||n.setProperty(t,r,n.getPropertyPriority(t))}))}).filter(Boolean)}function Ro(n,e){if(U(n)){let t=n.currentSrc||n.src;if(!Xe(t))return[te(e,{url:t,imageDom:n,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(n.srcset="",n.dataset.originalSrc=t,n.src=o||"")})];(pe||ze)&&e.drawImageCount++}else if(ne(n)&&!Xe(n.href.baseVal)){let t=n.href.baseVal;return[te(e,{url:t,imageDom:n,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(n.dataset.originalSrc=t,n.href.baseVal=o||"")})]}return[]}function Io(n,e){let{ownerDocument:t,svgDefsElement:o}=e,r=n.getAttribute("href")??n.getAttribute("xlink:href");if(!r)return[];let[i,a]=r.split("#");if(a){let l=`#${a}`,c=e.shadowRoots.reduce((d,h)=>d??h.querySelector(`svg ${l}`),t?.querySelector(`svg ${l}`));if(i&&n.setAttribute("href",l),o?.querySelector(l))return[];if(c)return o?.appendChild(c.cloneNode(!0)),[];if(i)return[te(e,{url:i,responseType:"text"}).then(d=>{o?.insertAdjacentHTML("beforeend",d)})]}return[]}function Bt(n,e){let{tasks:t}=e;N(n)&&((U(n)||Tt(n))&&t.push(...Ro(n,e)),$n(n)&&t.push(...Io(n,e))),Q(n)&&t.push(...No(n.style,e)),n.childNodes.forEach(o=>{Bt(o,e)})}async function Lo(n,e){let{ownerDocument:t,svgStyleElement:o,fontFamilies:r,fontCssTexts:i,tasks:a,font:l}=e;if(!(!t||!o||!r.size))if(l&&l.cssText){let c=bt(l.cssText,e);o.appendChild(t.createTextNode(`${c}
10
+ `))}else{let c=Array.from(t.styleSheets).filter(u=>{try{return"cssRules"in u&&!!u.cssRules.length}catch(f){return e.log.warn(`Error while reading CSS rules from ${u.href}`,f),!1}}),d=t.implementation.createHTMLDocument(""),h=d.createElement("style");d.head.appendChild(h);let p=h.sheet;await Promise.all(c.flatMap(u=>Array.from(u.cssRules).map(async f=>{if(Mn(f)){let g=f.href,E="";try{E=await te(e,{url:g,requestType:"text",responseType:"text"})}catch(T){e.log.warn(`Error fetch remote css import from ${g}`,T)}let b=E.replace(Lt,(T,_,y)=>T.replace(y,xt(y,g)));for(let T of Do(b))try{p.insertRule(T,p.cssRules.length)}catch(_){e.log.warn("Error inserting rule from remote css import",{rule:T,error:_})}}}))),p.cssRules.length&&c.push(p);let m=[];c.forEach(u=>{Ue(u.cssRules,m)}),m.filter(u=>kn(u)&&It(u.style.getPropertyValue("src"))&&St(u.style.getPropertyValue("font-family"))?.some(f=>r.has(f))).forEach(u=>{let f=u,g=i.get(f.cssText);g?o.appendChild(t.createTextNode(`${g}
11
+ `)):a.push(Rt(f.cssText,f.parentStyleSheet?f.parentStyleSheet.href:null,e).then(E=>{E=bt(E,e),i.set(f.cssText,E),o.appendChild(t.createTextNode(`${E}
12
+ `))}))})}}var Bo=/(\/\*[\s\S]*?\*\/)/g,Et=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Do(n){if(n==null)return[];let e=[],t=n.replace(Bo,"");for(;;){let i=Et.exec(t);if(!i)break;e.push(i[0])}t=t.replace(Et,"");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 i=o.exec(t);if(i)r.lastIndex=o.lastIndex;else if(i=r.exec(t),i)o.lastIndex=r.lastIndex;else break;e.push(i[0])}return e}var ko=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Mo=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function bt(n,e){let{font:t}=e,o=t?t?.preferredFormat:void 0;return o?n.replace(Mo,r=>{for(;;){let[i,,a]=ko.exec(r)||[];if(!a)return"";if(a===o)return`src: ${i};`}}):n}function Ue(n,e=[]){for(let t of Array.from(n))Pn(t)?e.push(...Ue(t.cssRules)):"cssRules"in t?Ue(t.cssRules,e):e.push(t);return e}var Po=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function $o(n){return Po.test(n.innerHTML)}async function Ho(n,e){let t=await wt(n,e);if(N(t.node)&&ne(t.node)&&!$o(t.node))return t.node;let{ownerDocument:o,log:r,tasks:i,svgStyleElement:a,svgDefsElement:l,svgStyles:c,font:d,progress:h,autoDestruct:p,onCloneNode:m,onEmbedNode:u,onCreateForeignObjectSvg:f}=t;r.time("clone node");let g=await Ge(t.node,t,!0);if(a&&o){let y="";c.forEach((C,x)=>{y+=`${C.join(`,
12
13
  `)} {
13
- ${_}
14
+ ${x}
14
15
  }
15
- `}),a.appendChild(n.createTextNode(T))}s.timeEnd("clone node"),await m?.(f),h!==!1&&A(f)&&(s.time("embed web font"),await rn(f,t),s.timeEnd("embed web font")),s.time("embed node"),ut(f,t);let b=r.length,C=0,x=async()=>{for(;;){let T=r.pop();if(!T)break;try{await T}catch(w){t.log.warn("Failed to run task",w)}d?.(++C,b)}};d?.(C,b),await Promise.all([...Array.from({length:4})].map(x)),s.timeEnd("embed node"),await u?.(f);let E=un(f,t);return l&&E.insertBefore(l,E.children[0]),a&&E.insertBefore(a,E.children[0]),p&&Ko(t),await g?.(E),E}function un(o,e){let{width:t,height:n}=e,s=wo(t,n,o.ownerDocument),r=s.ownerDocument.createElementNS(s.namespaceURI,"foreignObject");return r.setAttributeNS(null,"x","0%"),r.setAttributeNS(null,"y","0%"),r.setAttributeNS(null,"width","100%"),r.setAttributeNS(null,"height","100%"),r.append(o),s.appendChild(r),s}async function mt(o,e){let t=await rt(o,e),n=await pn(t),s=So(n,t.isEnable("removeControlCharacter"));t.autoDestruct||(t.svgStyleElement=st(t.ownerDocument),t.svgDefsElement=t.ownerDocument?.createElementNS(ae,"defs"),t.svgStyles.clear());let r=k(s,n.ownerDocument);return await Bo(r,t)}var B="helldots-root",mn=()=>{customElements.get(B)||customElements.define(B,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function gt(){mn();let o=document.querySelector(B);return o||(o=document.createElement(B),document.body.appendChild(o)),o.shadowRoot}var le=.5,gn=.7,ft=o=>!o||o==="transparent"||o==="rgba(0, 0, 0, 0)",fn=()=>{let o=getComputedStyle(document.documentElement).backgroundColor;if(!ft(o))return o;let e=getComputedStyle(document.body).backgroundColor;return ft(e)?"#ffffff":e};async function Ne({scale:o=1}={}){return mt(document.body,{scale:o,backgroundColor:fn()})}async function Re(o){let e=document.querySelector(B),t=e?.style.display;e&&(e.style.display="none");try{return await o()}finally{e&&(e.style.display=t||"")}}function Et(o,{left:e,top:t,width:n,height:s}){let r=document.createElement("canvas");r.width=n,r.height=s;let a=r.getContext("2d");return a?(a.drawImage(o,e+window.scrollX,t+window.scrollY,n,s,0,0,n,s),r.toDataURL("image/png")):null}function Ie(o,{sourceScale:e=1,outputScale:t=le,quality:n=gn}={}){let s=document.createElement("canvas");s.width=Math.round(window.innerWidth*t),s.height=Math.round(window.innerHeight*t);let r=s.getContext("2d");return r?(r.drawImage(o,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,s.width,s.height),s.toDataURL("image/jpeg",n)):null}var En=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],bn=[{name:"iOS",re:/(?:iPhone|iPad).*OS ([\d_]+) like Mac OS X/},{name:"Android",re:/Android ([\d.]+)/},{name:"Windows",re:/Windows NT ([\d.]+)/},{name:"macOS",re:/Mac OS X ([\d_.]+)/},{name:"Linux",re:/Linux/}],Cn={name:"unknown",version:""},Tn=o=>/not[\W_]*a[\W_]*brand/i.test(o),bt=(o,e)=>{for(let{name:t,re:n}of o){let s=e.match(n);if(s)return{name:t,version:(s[1]||"").replace(/_/g,".")}}return{...Cn}};function Ct(o=window){let e=o.navigator||{},t=e.userAgent||"",n=e.userAgentData,s=bt(En,t),r=n?.brands?.find(l=>!Tn(l.brand));r&&(s={name:r.brand,version:r.version||""});let a=bt(bn,t);return n?.platform&&(a.name=n.platform),{version:1,url:o.location?.href||"",viewport:{width:o.innerWidth,height:o.innerHeight},screen:{width:o.screen?.width??0,height:o.screen?.height??0},devicePixelRatio:o.devicePixelRatio??1,userAgent:t,browser:s,os:a,language:e.language||""}}var i={CIRCLE:"comment-circle",CIRCLE_ACTIVE:"comment-circle--active",CIRCLE_WRAPPER:"comment-circle-wrapper",TOOLTIP:"comment-tooltip",TOOLBAR_TEXT:"toolbar-text",SHORTCUT_HINT:"shortcut-hint",COMMENT_INPUT_AREA:"comment-input-area",CLOSE_TOOLTIP:"close-tooltip",ACTIVE:"active",COMMENT_CURSOR:"comment-cursor",COMMENT_OVERLAY:"comment-overlay",THREAD_POPOVER:"comment-thread-popover",THREAD_HEADER:"thread-header",THREAD_BODY:"thread-body",THREAD_REPLIES:"thread-replies",THREAD_REPLY:"thread-reply",THREAD_REPLY_ACTIONS:"thread-reply-actions",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_ACTIONS_ROW:"thread-actions-row",THREAD_SCROLL:"thread-scroll",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",THREAD_TIME:"thread-time",THREAD_EDITED:"thread-edited",EDITOR:"helldots-editor",EDITOR_INPUT:"helldots-editor-input",EDITOR_ACTIONS:"helldots-editor-actions",EDITOR_SAVE:"helldots-editor-save",EDITOR_CANCEL:"helldots-editor-cancel",INBOX_NOTICE:"inbox-notice",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",CONFIRM:"helldots-confirm",CONFIRM_PANEL:"helldots-confirm-panel",CONFIRM_TITLE:"helldots-confirm-title",CONFIRM_MESSAGE:"helldots-confirm-message",CONFIRM_ACTIONS:"helldots-confirm-actions",CONFIRM_CANCEL:"helldots-confirm-cancel",CONFIRM_ACCEPT:"helldots-confirm-accept",LIGHTBOX:"helldots-lightbox",LIGHTBOX_IMG:"helldots-lightbox-img",LIGHTBOX_CLOSE:"helldots-lightbox-close",COMMENT_ACTIONS_BAR:"comment-actions-bar",ATTACH_IMAGE_BTN:"attach-image-btn",TOOLBAR_ACTIONS:"toolbar-actions",TOOLBAR_ACTION_BTN:"toolbar-action-btn",TOOLBAR_ACTION_WRAPPER:"toolbar-action-wrapper",TOOLBAR_ACTION_TOOLTIP:"toolbar-action-tooltip",TOOLBAR_COMMENT_BTN:"toolbar-comment-btn",TOOLBAR_MENU_BTN:"toolbar-menu-btn",INBOX_PANEL:"inbox-panel",INBOX_HEADER:"inbox-header",INBOX_FILTER:"inbox-filter",INBOX_FILTER_MENU:"inbox-filter-menu",INBOX_FILTER_MENU_HEADER:"inbox-filter-menu-header",INBOX_FILTER_CLEAR:"inbox-filter-clear",INBOX_FILTER_GROUP:"inbox-filter-group",INBOX_FILTER_CHIPS:"inbox-filter-chips",INBOX_FILTER_CHIP:"inbox-filter-chip",INBOX_FILTER_SECTION:"inbox-filter-section",INBOX_CLOSE:"inbox-close",INBOX_LIST:"inbox-list",INBOX_CARD:"inbox-card",INBOX_CARD_HEADER:"inbox-card-header",INBOX_CARD_ACTIONS:"inbox-card-actions",INBOX_CARD_TEXT:"inbox-card-text",INBOX_CARD_TAG:"inbox-card-tag",INBOX_CARD_REPLY_LINK:"inbox-card-reply-link",INBOX_ACTION_BTN:"inbox-action-btn",INBOX_ACTION_BTN_LABELED:"inbox-action-btn--labeled",INBOX_ACTION_LABEL:"inbox-action-label",INBOX_STATUS_DOT:"inbox-status-dot",INBOX_MENU:"inbox-menu",INBOX_MENU_ITEM:"inbox-menu-item",INBOX_DETAIL:"inbox-detail",INBOX_DETAIL_HEADER:"inbox-detail-header",INBOX_BACK:"inbox-back",INBOX_NAV_BTN:"inbox-nav-btn",INBOX_REPLIES:"inbox-replies",TOOLTIP_REPLY_COUNT:"comment-tooltip-reply-count",INBOX_EMPTY:"inbox-empty",INBOX_EMPTY_ICON:"inbox-empty-icon",INBOX_EMPTY_TITLE:"inbox-empty-title",INBOX_EMPTY_TEXT:"inbox-empty-text",INBOX_EMPTY_KBD:"inbox-empty-kbd",INBOX_EMPTY_ACTION:"inbox-empty-action",CLASSIFY_ROW:"classify-row",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",BADGE_STATUS:"helldots-badge--status",BADGE_TYPE:"helldots-badge--type",BADGE_PRIORITY:"helldots-badge--priority",BADGE_TAG:"helldots-badge--tag",BADGE_DURATION:"helldots-badge--duration",CONTEXT_BLOCK:"inbox-context",CONTEXT_TITLE:"inbox-context-title",CONTEXT_BODY:"inbox-context-body",CONTEXT_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",CONTEXT_TOGGLE:"inbox-context-toggle",HIGHLIGHT:"helldots-highlight"},Tt=[i.COMMENT_CURSOR],y={TOOLBAR:"comment-toolbar",COMMENT_BOX:"comment-box",COMMENT_INPUT:"comment-input",SUBMIT_COMMENT:"submit-comment",STYLES:"comment-overlay-styles",GLOBAL_STYLES:"comment-overlay-global-styles",ATTACH_IMAGE_INPUT:"attach-image-input"},D=["open","in_progress","resolved"],ce={open:"#2E90FA",in_progress:"#FF9F0A",resolved:"#30D158"},N=["bug","suggestion","question","improvement"],q={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},R=["high","medium","low"],K={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},xt={CONTAINER:'section, div[class*="container"], div[class*="content"]'},O={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},_t='data:image/svg+xml;utf8,<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-4,-4)"><path d="M6 8C6 6.89543 6.89543 6 8 6H20C27.732 6 34 12.268 34 20V20C34 27.732 27.732 34 20 34V34C12.268 34 6 27.732 6 20V8Z" fill="%232E90FA"/><path d="M8 7H20C27.1797 7 33 12.8203 33 20C33 27.1797 27.1797 33 20 33C12.8203 33 7 27.1797 7 20V8C7 7.44772 7.44772 7 8 7Z" stroke="white" stroke-width="2"/></g></svg>',yt="2 2";var de=`
16
- scrollbar-width: thin;
17
- scrollbar-color: rgba(255,255,255,0.22) transparent;`,xn=(...o)=>o.map(e=>`
18
- ${e}::-webkit-scrollbar {
19
- width: 8px;
20
- height: 8px;
21
- }
22
-
23
- ${e}::-webkit-scrollbar-track {
24
- background: transparent;
25
- }
26
-
27
- ${e}::-webkit-scrollbar-thumb {
28
- background: rgba(255,255,255,0.22);
29
- border-radius: 4px;
30
- }
31
-
32
- ${e}::-webkit-scrollbar-thumb:hover {
33
- background: rgba(255,255,255,0.35);
34
- }
35
- `).join(""),wt=()=>`
36
-
37
- :host {
38
- all: initial;
39
- display: block;
40
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
41
- line-height: 1.5;
42
- color-scheme: light;
43
- }
44
-
45
- :host *,
46
- :host *::before,
47
- :host *::after {
48
- box-sizing: border-box;
49
- font-family: inherit;
50
- }
51
-
52
- button {
53
- padding: 0;
54
- font: inherit;
55
- color: inherit;
56
- }
57
-
58
- #${y.TOOLBAR} {
59
- position: fixed;
60
- bottom: 20px;
61
- left: 50%;
62
- transform: translateX(-50%);
63
- z-index: ${O.TOOLBAR};
64
- }
65
-
66
- .${i.TOOLBAR_ACTION_WRAPPER} {
67
- position: relative;
68
- }
69
-
70
- .${i.TOOLBAR_ACTION_TOOLTIP} {
16
+ `}),a.appendChild(o.createTextNode(y))}r.timeEnd("clone node"),await m?.(g),d!==!1&&N(g)&&(r.time("embed web font"),await Lo(g,t),r.timeEnd("embed web font")),r.time("embed node"),Bt(g,t);let E=i.length,b=0,T=async()=>{for(;;){let y=i.pop();if(!y)break;try{await y}catch(C){t.log.warn("Failed to run task",C)}h?.(++b,E)}};h?.(b,E),await Promise.all([...Array.from({length:4})].map(T)),r.timeEnd("embed node"),await u?.(g);let _=Fo(g,t);return l&&_.insertBefore(l,_.children[0]),a&&_.insertBefore(a,_.children[0]),p&&So(t),await f?.(_),_}function Fo(n,e){let{width:t,height:o}=e,r=Zn(t,o,n.ownerDocument),i=r.ownerDocument.createElementNS(r.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(n),r.appendChild(i),r}async function Dt(n,e){let t=await wt(n,e),o=await Ho(t),r=Jn(o,t.isEnable("removeControlCharacter"));t.autoDestruct||(t.svgStyleElement=Ot(t.ownerDocument),t.svgDefsElement=t.ownerDocument?.createElementNS(fe,"defs"),t.svgStyles.clear());let i=X(r,o.ownerDocument);return await so(i,t)}var R="helldots-root",Xo=()=>{customElements.get(R)||customElements.define(R,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function kt(){Xo();let n=document.querySelector(R);return n||(n=document.createElement(R),document.body.appendChild(n)),n.shadowRoot}var ge=.5,Uo=.7,Mt=n=>!n||n==="transparent"||n==="rgba(0, 0, 0, 0)",Pt=()=>{let n=getComputedStyle(document.documentElement).backgroundColor;if(!Mt(n))return n;let e=getComputedStyle(document.body).backgroundColor;return Mt(e)?"#ffffff":e},$t=()=>{try{let n=document.implementation.createHTMLDocument(""),e=n.createElement("style");return n.head.appendChild(e),e.sheet!==null}catch{return!1}},Vo=n=>{let e=[],t=n.indexOf("@font-face");for(;t!==-1;){let o=n.indexOf("{",t),r=o===-1?-1:n.indexOf("}",o);if(r===-1)break;e.push(n.slice(t,r+1)),t=n.indexOf("@font-face",r)}return e.join(`
17
+ `)},Ye=new Map,zo=n=>(Ye.has(n)||Ye.set(n,fetch(n,{mode:"cors",credentials:"omit"}).then(e=>e.ok?e.text():"").then(Vo).catch(()=>"")),Ye.get(n)),Go=n=>{try{return!!n.cssRules}catch{return!1}},Yo=async n=>{let e=()=>{};if(!n||!$t())return e;let t=Array.from(document.styleSheets).filter(i=>i.href&&!Go(i)).map(i=>i.href);if(!t.length)return e;let o=(await Promise.all(t.map(zo))).filter(Boolean).join(`
18
+ `);if(!o)return e;let r=document.createElement("style");return r.textContent=o,document.head.appendChild(r),()=>r.remove()};async function We({scale:n=1,embedCrossOriginFonts:e=!1}={}){let t=await Yo(e);try{return await Dt(document.documentElement,{scale:n,backgroundColor:Pt(),...$t()?{}:{font:!1},filter:o=>o.nodeName?.toLowerCase()!==R})}finally{t()}}var Ht=(n,e,t)=>{n.fillStyle=Pt(),n.fillRect(0,0,e,t)};function Ft(n,{left:e,top:t,width:o,height:r}){let i=document.createElement("canvas");i.width=o,i.height=r;let a=i.getContext("2d");return a?(Ht(a,o,r),a.drawImage(n,e+window.scrollX,t+window.scrollY,o,r,0,0,o,r),i.toDataURL("image/png")):null}function je(n,{sourceScale:e=1,outputScale:t=ge,quality:o=Uo}={}){let r=document.createElement("canvas");r.width=Math.round(window.innerWidth*t),r.height=Math.round(window.innerHeight*t);let i=r.getContext("2d");return i?(Ht(i,r.width,r.height),i.drawImage(n,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,r.width,r.height),r.toDataURL("image/jpeg",o)):null}var s={CIRCLE:"comment-circle",CIRCLE_ACTIVE:"comment-circle--active",TOOLTIP:"comment-tooltip",TOOLBAR_TEXT:"toolbar-text",SHORTCUT_HINT:"shortcut-hint",COMMENT_INPUT_AREA:"comment-input-area",CLOSE_TOOLTIP:"close-tooltip",ACTIVE:"active",COMMENT_CURSOR:"comment-cursor",COMMENT_OVERLAY:"comment-overlay",THREAD_POPOVER:"comment-thread-popover",THREAD_HEADER:"thread-header",THREAD_BODY:"thread-body",THREAD_REPLIES:"thread-replies",THREAD_REPLY:"thread-reply",THREAD_REPLY_ACTIONS:"thread-reply-actions",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_ACTIONS_ROW:"thread-actions-row",THREAD_SCROLL:"thread-scroll",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",THREAD_TIME:"thread-time",THREAD_EDITED:"thread-edited",EDITOR:"helldots-editor",EDITOR_INPUT:"helldots-editor-input",EDITOR_ACTIONS:"helldots-editor-actions",EDITOR_SAVE:"helldots-editor-save",EDITOR_CANCEL:"helldots-editor-cancel",INBOX_NOTICE:"inbox-notice",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",CONFIRM:"helldots-confirm",CONFIRM_PANEL:"helldots-confirm-panel",CONFIRM_TITLE:"helldots-confirm-title",CONFIRM_MESSAGE:"helldots-confirm-message",CONFIRM_ACTIONS:"helldots-confirm-actions",CONFIRM_CANCEL:"helldots-confirm-cancel",CONFIRM_ACCEPT:"helldots-confirm-accept",LIGHTBOX:"helldots-lightbox",LIGHTBOX_IMG:"helldots-lightbox-img",LIGHTBOX_CLOSE:"helldots-lightbox-close",COMMENT_ACTIONS_BAR:"comment-actions-bar",ATTACH_IMAGE_BTN:"attach-image-btn",TOOLBAR_ACTIONS:"toolbar-actions",TOOLBAR_ACTION_BTN:"toolbar-action-btn",TOOLBAR_ACTION_WRAPPER:"toolbar-action-wrapper",TOOLBAR_ACTION_TOOLTIP:"toolbar-action-tooltip",TOOLBAR_COMMENT_BTN:"toolbar-comment-btn",TOOLBAR_MENU_BTN:"toolbar-menu-btn",INBOX_PANEL:"inbox-panel",INBOX_HEADER:"inbox-header",INBOX_FILTER:"inbox-filter",INBOX_FILTER_MENU:"inbox-filter-menu",INBOX_FILTER_MENU_HEADER:"inbox-filter-menu-header",INBOX_FILTER_CLEAR:"inbox-filter-clear",INBOX_FILTER_GROUP:"inbox-filter-group",INBOX_FILTER_CHIPS:"inbox-filter-chips",INBOX_FILTER_CHIP:"inbox-filter-chip",INBOX_FILTER_SECTION:"inbox-filter-section",INBOX_CLOSE:"inbox-close",INBOX_LIST:"inbox-list",INBOX_CARD:"inbox-card",INBOX_CARD_HEADER:"inbox-card-header",INBOX_CARD_ACTIONS:"inbox-card-actions",INBOX_CARD_TEXT:"inbox-card-text",INBOX_CARD_TAG:"inbox-card-tag",INBOX_CARD_REPLY_LINK:"inbox-card-reply-link",INBOX_ACTION_BTN:"inbox-action-btn",INBOX_ACTION_BTN_LABELED:"inbox-action-btn--labeled",INBOX_ACTION_LABEL:"inbox-action-label",INBOX_STATUS_DOT:"inbox-status-dot",INBOX_MENU:"inbox-menu",INBOX_MENU_UP:"inbox-menu--up",INBOX_MENU_ITEM:"inbox-menu-item",INBOX_DETAIL:"inbox-detail",INBOX_DETAIL_HEADER:"inbox-detail-header",INBOX_BACK:"inbox-back",INBOX_NAV_BTN:"inbox-nav-btn",INBOX_REPLIES:"inbox-replies",TOOLTIP_REPLY_COUNT:"comment-tooltip-reply-count",INBOX_EMPTY:"inbox-empty",INBOX_EMPTY_ICON:"inbox-empty-icon",INBOX_EMPTY_TITLE:"inbox-empty-title",INBOX_EMPTY_TEXT:"inbox-empty-text",INBOX_EMPTY_KBD:"inbox-empty-kbd",INBOX_EMPTY_ACTION:"inbox-empty-action",CLASSIFY_ROW:"classify-row",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",BADGE_STATUS:"helldots-badge--status",BADGE_TYPE:"helldots-badge--type",BADGE_PRIORITY:"helldots-badge--priority",BADGE_TAG:"helldots-badge--tag",BADGE_DURATION:"helldots-badge--duration",CONTEXT_BLOCK:"inbox-context",CONTEXT_TITLE:"inbox-context-title",CONTEXT_BODY:"inbox-context-body",CONTEXT_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",CONTEXT_TOGGLE:"inbox-context-toggle",HIGHLIGHT:"helldots-highlight"},Xt=[s.COMMENT_CURSOR],S={TOOLBAR:"comment-toolbar",COMMENT_BOX:"comment-box",COMMENT_INPUT:"comment-input",SUBMIT_COMMENT:"submit-comment",STYLES:"comment-overlay-styles",GLOBAL_STYLES:"comment-overlay-global-styles",ATTACH_IMAGE_INPUT:"attach-image-input"},A=28,Ee=5,P=["open","in_progress","resolved"],be={open:"#2E90FA",in_progress:"#FF9F0A",resolved:"#30D158"},L=["bug","suggestion","question","improvement"],oe={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},B=["high","medium","low"],ie={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},Ut={CONTAINER:'section, div[class*="container"], div[class*="content"]'},O={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},Vt='data:image/svg+xml;utf8,<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-4,-4)"><path d="M6 8C6 6.89543 6.89543 6 8 6H20C27.732 6 34 12.268 34 20V20C34 27.732 27.732 34 20 34V34C12.268 34 6 27.732 6 20V8Z" fill="%232E90FA"/><path d="M8 7H20C27.1797 7 33 12.8203 33 20C33 27.1797 27.1797 33 20 33C12.8203 33 7 27.1797 7 20V8C7 7.44772 7.44772 7 8 7Z" stroke="white" stroke-width="2"/></g></svg>',zt="2 2";var Ce=class{constructor({host:e,autoScreenshot:t,embedCrossOriginFonts:o=!1,onRegionCaptured:r,onPlace:i}){this.host=e,this.autoScreenshot=t,this.embedCrossOriginFonts=o,this.onRegionCaptured=r,this.onPlace=i,this.pendingCapture=null,this._dragStart=null,this._isDragging=!1,this._selectionRect=null,this._boundDragMove=a=>this.onDragMove(a),this._boundDragEnd=a=>this.onDragEnd(a)}beginDrag(e){this._dragStart={x:e.clientX,y:e.clientY},this._isDragging=!1,document.addEventListener("mousemove",this._boundDragMove),document.addEventListener("mouseup",this._boundDragEnd)}onDragMove(e){let t=e.clientX-this._dragStart.x,o=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,o)<5)return;this._isDragging=!0;let r=Math.min(this._dragStart.x,e.clientX),i=Math.min(this._dragStart.y,e.clientY),a=Math.abs(t),l=Math.abs(o);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=s.SELECTION_RECT,this.host.appendChild(this._selectionRect)),this._selectionRect.style.left=`${r}px`,this._selectionRect.style.top=`${i}px`,this._selectionRect.style.width=`${a}px`,this._selectionRect.style.height=`${l}px`}async onDragEnd(e){if(document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._isDragging){let t=Math.min(this._dragStart.x,e.clientX),o=Math.min(this._dragStart.y,e.clientY),r=Math.abs(e.clientX-this._dragStart.x),i=Math.abs(e.clientY-this._dragStart.y);if(this._selectionRect?.remove(),this._selectionRect=null,r>10&&i>10)try{let a=await We({scale:1,embedCrossOriginFonts:this.embedCrossOriginFonts}),l=Ft(a,{left:t,top:o,width:r,height:i});l&&this.onRegionCaptured(l),this.autoScreenshot&&(this.pendingCapture=Promise.resolve(je(a,{sourceScale:1})))}catch(a){console.warn("HellDots: screenshot capture failed:",a)}await this.onPlace(e.clientX,e.clientY)}else await this.onPlace(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}armClickCapture(){!this.autoScreenshot||this.pendingCapture||(this.pendingCapture=We({scale:ge,embedCrossOriginFonts:this.embedCrossOriginFonts}).then(e=>je(e,{sourceScale:ge})).catch(e=>(console.warn("HellDots: automatic screenshot failed",e),null)))}async consumePending(){return this.pendingCapture?await this.pendingCapture:null}clearPending(){this.pendingCapture=null}destroy(){document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._selectionRect?.remove(),this._selectionRect=null,this.pendingCapture=null,this._dragStart=null,this._isDragging=!1}};var Wo=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],jo=[{name:"iOS",re:/(?:iPhone|iPad).*OS ([\d_]+) like Mac OS X/},{name:"Android",re:/Android ([\d.]+)/},{name:"Windows",re:/Windows NT ([\d.]+)/},{name:"macOS",re:/Mac OS X ([\d_.]+)/},{name:"Linux",re:/Linux/}],qo={name:"unknown",version:""},Ko=n=>/not[\W_]*a[\W_]*brand/i.test(n),Gt=(n,e)=>{for(let{name:t,re:o}of n){let r=e.match(o);if(r)return{name:t,version:(r[1]||"").replace(/_/g,".")}}return{...qo}};function Yt(n=window){let e=n.navigator||{},t=e.userAgent||"",o=e.userAgentData,r=Gt(Wo,t),i=o?.brands?.find(l=>!Ko(l.brand));i&&(r={name:i.brand,version:i.version||""});let a=Gt(jo,t);return o?.platform&&(a.name=o.platform),{version:1,url:n.location?.href||"",viewport:{width:n.innerWidth,height:n.innerHeight},screen:{width:n.screen?.width??0,height:n.screen?.height??0},devicePixelRatio:n.devicePixelRatio??1,userAgent:t,browser:r,os:a,language:e.language||""}}var _e=" scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;",Zo=(...n)=>n.map(e=>` ${e}::-webkit-scrollbar{width:8px;height:8px;}${e}::-webkit-scrollbar-track{background:transparent;}${e}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}${e}::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.35);}`).join(""),Wt=()=>` :host{all:initial;display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;line-height:1.5;color-scheme:light;}:host *,:host *::before,:host *::after{box-sizing:border-box;font-family:inherit;}button{padding:0;font:inherit;color:inherit;}#${S.TOOLBAR}{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:${O.TOOLBAR};}.${s.TOOLBAR_ACTION_WRAPPER}{position:relative;}.${s.TOOLBAR_ACTION_TOOLTIP}{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%) translateY(4px);display:flex;align-items:center;gap:8px;background:rgba(20,20,23,0.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);padding:8px 12px;border-radius:10px;border:1px solid rgba(255,255,255,0.08);box-shadow:0 4px 24px rgba(0,0,0,0.35);color:white;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease,transform 0.15s ease;}.${s.TOOLBAR_ACTION_WRAPPER}:hover .${s.TOOLBAR_ACTION_TOOLTIP}{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}.${s.TOOLBAR_TEXT}{font-size:13px;font-weight:500;letter-spacing:-0.01em;}.${s.SHORTCUT_HINT}{font-size:11px;font-weight:500;color:rgba(255,255,255,0.5);background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.1);padding:2px 6px;border-radius:5px;line-height:1;white-space:nowrap;}.${s.TOOLBAR_ACTIONS}{display:flex;flex-direction:row;background:rgba(20,20,23,0.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:12px;box-shadow:0 4px 24px rgba(0,0,0,0.35);}.${s.TOOLBAR_ACTION_BTN}{width:42px;height:42px;display:flex;align-items:center;justify-content:center;background:none;border:none;outline:none;color:rgba(255,255,255,0.65);cursor:pointer;transition:background 0.2s,color 0.2s;padding:0;}.${s.TOOLBAR_ACTION_WRAPPER}:first-child .${s.TOOLBAR_ACTION_BTN}{border-radius:12px 0 0 12px;}.${s.TOOLBAR_ACTION_WRAPPER}:last-child .${s.TOOLBAR_ACTION_BTN}{border-radius:0 12px 12px 0;}.${s.TOOLBAR_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${s.TOOLBAR_COMMENT_BTN}.${s.ACTIVE}{color:#2E90FA;background:rgba(46,144,250,0.1);}#${S.COMMENT_BOX}{position:fixed;background:#1C1C1E;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.4);padding:16px;z-index:${O.COMMENT_BOX};width:min(400px,calc(100vw - 24px));display:none;box-sizing:border-box;}#${S.COMMENT_BOX} .${s.COMMENT_INPUT_AREA}{display:flex;flex-direction:column;gap:0;}.${s.CLASSIFY_ROW}{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:0 0 10px;border-bottom:1px solid rgba(255,255,255,0.08);}.${s.CLASSIFY_ROW} .${s.INBOX_ACTION_BTN}{height:26px;border:1px solid rgba(255,255,255,0.12);border-radius:8px;}.${s.CLASSIFY_ROW} .${s.INBOX_ACTION_BTN}:hover{border-color:rgba(255,255,255,0.28);}#${S.COMMENT_INPUT}{flex:1;min-height:20px;background:#1C1C1E;border:none;resize:none;font-family:inherit;color:white;font-size:14px;line-height:1.4;box-sizing:border-box;field-sizing:content;padding:8px 0;}#${S.COMMENT_INPUT}::placeholder{color:rgba(255,255,255,0.5);}#${S.COMMENT_INPUT}:focus{outline:none;box-shadow:none;}.${s.COMMENT_ACTIONS_BAR}{display:flex;align-items:center;justify-content:space-between;padding-top:12px;}.${s.ATTACH_IMAGE_BTN}{background:none;border:none;color:rgba(255,255,255,0.5);cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background 0.2s,color 0.2s;}.${s.ATTACH_IMAGE_BTN}:hover{background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.8);}.${s.CIRCLE}{position:absolute;width:${A}px;height:${A}px;background:#2E90FA;border-radius:0% 100% 100% 100%;border:2px solid #FFF;cursor:pointer;box-shadow:0 1px 5px rgba(0,0,0,0.2);transition:transform 0.2s,background 0.2s;z-index:${O.CIRCLE};transform:translate(-50%,-50%);}.${s.CIRCLE}:hover{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);}.${s.CIRCLE}.${s.HIGHLIGHT}{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);box-shadow:0 0 0 4px rgba(46,144,250,0.35),0 1px 5px rgba(0,0,0,0.2);}.${s.CIRCLE}.${s.CIRCLE_ACTIVE}{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);box-shadow:0 0 0 5px rgba(46,144,250,0.5),0 1px 5px rgba(0,0,0,0.2);}.${s.TOOLTIP}{position:fixed;background:#1C1C1E;border-radius:12px;padding:16px;box-shadow:0 4px 20px rgba(0,0,0,0.4);width:min(400px,calc(100vw - 24px));max-height:calc(100vh - 20px);overflow-y:auto;overscroll-behavior:contain;${_e} z-index:${O.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${s.TOOLTIP} .${s.THREAD_BODY}{padding:8px 0;}.${s.THREAD_POPOVER}{position:fixed;background:#1C1C1E;border-radius:12px;padding:16px;box-shadow:0 4px 20px rgba(0,0,0,0.4);width:min(400px,calc(100vw - 24px));max-height:calc(100vh - 20px);display:flex;flex-direction:column;z-index:${O.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${s.THREAD_POPOVER}>.${s.THREAD_HEADER},.${s.THREAD_POPOVER}>.${s.THREAD_ACTIONS_ROW},.${s.THREAD_POPOVER}>.${s.THREAD_INPUT_AREA}{flex:none;}.${s.THREAD_SCROLL}{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;${_e}}${Zo(`.${s.THREAD_SCROLL}`,`.${s.TOOLTIP}`,`.${s.INBOX_LIST}`,`.${s.INBOX_DETAIL}`,`.${s.EDITOR_INPUT}`)} .${s.INBOX_PANEL}{position:fixed;top:16px;right:16px;bottom:16px;width:380px;display:flex;flex-direction:column;background:#1C1C1E;border:1px solid rgba(255,255,255,0.08);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,0.5);z-index:${O.COMMENT_BOX};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;overflow:hidden;}@media (max-width:480px){.${s.INBOX_PANEL}{left:16px;width:auto;}}.${s.INBOX_HEADER},.${s.INBOX_DETAIL_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;border-bottom:1px solid rgba(255,255,255,0.08);flex:none;}.${s.INBOX_FILTER}-wrapper{position:relative;}.${s.INBOX_FILTER}{display:flex;align-items:center;gap:6px;background:transparent;border:none;color:white;font-size:13px;font-weight:600;cursor:pointer;padding:4px 6px;border-radius:6px;}.${s.INBOX_FILTER}:hover{background:rgba(255,255,255,0.08);}.${s.INBOX_FILTER_MENU}{position:absolute;top:calc(100% + 6px);left:0;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:12px;padding:14px;width:300px;max-width:calc(100vw - 40px);z-index:1;box-shadow:0 8px 28px rgba(0,0,0,0.5);}.${s.INBOX_FILTER_MENU_HEADER}{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:12px;}.${s.INBOX_FILTER_CLEAR}{background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:12px;font-weight:500;cursor:pointer;padding:0;}.${s.INBOX_FILTER_CLEAR}:hover:not(:disabled){color:white;}.${s.INBOX_FILTER_CLEAR}:disabled{opacity:0.35;cursor:default;}.${s.INBOX_FILTER_GROUP} + .${s.INBOX_FILTER_GROUP}{margin-top:14px;}.${s.INBOX_FILTER_SECTION}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);margin-bottom:8px;}.${s.INBOX_FILTER_CHIPS}{display:flex;flex-wrap:wrap;gap:6px;}.${s.INBOX_FILTER_CHIP}{background:transparent;border:1px solid rgba(255,255,255,0.18);border-radius:999px;color:rgba(255,255,255,0.75);font-size:12px;line-height:1;padding:7px 12px;cursor:pointer;transition:background 0.15s,border-color 0.15s,color 0.15s;}.${s.INBOX_FILTER_CHIP}:hover{border-color:rgba(255,255,255,0.4);color:white;}.${s.INBOX_FILTER_CHIP}[aria-checked="true"]{background:rgba(255,255,255,0.92);border-color:rgba(255,255,255,0.92);color:#1C1C1E;font-weight:600;}.${s.INBOX_MENU_ITEM}{display:block;width:100%;text-align:left;background:transparent;border:none;color:white;font-size:13px;padding:7px 10px;border-radius:6px;cursor:pointer;}.${s.INBOX_MENU_ITEM}:hover{background:rgba(255,255,255,0.08);}.${s.INBOX_CLOSE},.${s.INBOX_NAV_BTN},.${s.INBOX_BACK}{display:flex;align-items:center;gap:4px;background:transparent;border:none;color:rgba(255,255,255,0.75);cursor:pointer;padding:4px 6px;border-radius:6px;font-size:14px;}.${s.INBOX_CLOSE}{font-size:20px;line-height:1;}.${s.INBOX_CLOSE}:hover,.${s.INBOX_NAV_BTN}:not(:disabled):hover,.${s.INBOX_BACK}:hover{background:rgba(255,255,255,0.08);color:white;}.${s.INBOX_NAV_BTN}:disabled{opacity:0.35;cursor:default;}.${s.INBOX_LIST},.${s.INBOX_DETAIL}{flex:1;overflow-y:auto;${_e} padding:12px;display:flex;flex-direction:column;gap:12px;}.${s.INBOX_CARD}{border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}.${s.INBOX_LIST} .${s.INBOX_CARD}{cursor:pointer;}.${s.INBOX_LIST} .${s.INBOX_CARD}:hover{border-color:rgba(255,255,255,0.22);}.${s.INBOX_CARD}--resolved{border-color:rgba(48,209,88,0.4);opacity:0.75;}.${s.INBOX_LIST} .${s.INBOX_CARD}--resolved:hover{border-color:rgba(48,209,88,0.7);opacity:1;}.${s.INBOX_CARD_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;}.${s.INBOX_CARD_ACTIONS}{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:6px;}.${s.INBOX_ACTION_BTN}{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:transparent;border:none;border-radius:6px;color:rgba(255,255,255,0.65);cursor:pointer;}.${s.INBOX_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${s.INBOX_ACTION_BTN_LABELED}{width:auto;padding:0 8px 0 6px;gap:5px;justify-content:flex-start;flex:none;}.${s.INBOX_ACTION_LABEL}{font-size:11px;line-height:1;white-space:nowrap;}.${s.INBOX_STATUS_DOT}{width:12px;height:12px;border-radius:50%;border:1.5px solid rgba(255,255,255,0.45);display:inline-block;flex:none;}.${s.INBOX_MENU_ITEM} .${s.INBOX_STATUS_DOT}{width:9px;height:9px;border:none;margin-right:8px;vertical-align:baseline;}.${s.INBOX_MENU_ITEM}[aria-checked="true"]{background:rgba(255,255,255,0.08);}.${s.THREAD_ACTIONS_ROW}{display:flex;justify-content:flex-end;}.${s.THREAD_POPOVER}>.${s.THREAD_ACTIONS_ROW}{padding-top:8px;}[data-hd-tooltip]{position:relative;}[data-hd-tooltip]::after{content:attr(data-hd-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.12s ease;z-index:2;}[data-hd-tooltip]:hover::after{opacity:1;}.${s.INBOX_MENU}{position:absolute;top:calc(100% + 4px);right:0;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:8px;padding:4px;min-width:130px;z-index:1;box-shadow:0 4px 16px rgba(0,0,0,0.4);}.${s.INBOX_MENU}.${s.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${s.INBOX_CARD_TEXT}{white-space:pre-wrap;word-break:break-word;}.${s.INBOX_CARD_TAG}{align-self:flex-start;padding:1px 8px;border-radius:999px;background:rgba(255,159,10,0.2);color:#FF9F0A;font-size:11px;font-weight:600;}.${s.INBOX_BADGES}{display:flex;flex-wrap:wrap;gap:4px;}.${s.INBOX_CARD} .${s.INBOX_BADGES}{margin-top:6px;}.${s.TOOLTIP} .${s.INBOX_BADGES}{margin-bottom:4px;}.${s.BADGE}{display:inline-flex;align-items:center;padding:1px 6px;border:1px solid rgba(255,255,255,0.18);border-radius:10px;font-size:10px;line-height:1.6;letter-spacing:0.01em;white-space:nowrap;}.${s.BADGE_STATUS},.${s.BADGE_TYPE},.${s.BADGE_PRIORITY}{font-weight:600;}.${s.BADGE_TAG}{opacity:0.75;}.${s.BADGE_DURATION}{opacity:0.75;border-style:dashed;}.${s.CONTEXT_BLOCK}{display:flex;flex-direction:column;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.08);font-size:11px;}.${s.CONTEXT_BODY}{display:flex;flex-direction:column;gap:4px;}.${s.CONTEXT_TITLE}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);padding-bottom:4px;}.${s.CONTEXT_TOGGLE}{display:flex;align-items:center;justify-content:space-between;width:100%;background:transparent;border:none;color:rgba(255,255,255,0.45);font-size:11px;font-weight:600;cursor:pointer;padding:2px 0;}.${s.CONTEXT_TOGGLE}:hover{color:rgba(255,255,255,0.75);}.${s.CONTEXT_TOGGLE} svg{flex:none;transition:transform 0.15s ease;}.${s.CONTEXT_TOGGLE}[aria-expanded="true"] svg{transform:rotate(180deg);}.${s.CONTEXT_TOGGLE}[aria-expanded="true"] + .${s.CONTEXT_BODY}{padding-top:8px;}.${s.CONTEXT_BLOCK} img{width:100%;border-radius:6px;margin-bottom:6px;cursor:zoom-in;}.${s.CONTEXT_SCREENSHOT_CAPTION}{opacity:0.75;}.${s.CONTEXT_ROW}{display:flex;justify-content:space-between;gap:12px;opacity:0.75;}.${s.CONTEXT_ROW} span:last-child{text-align:right;word-break:break-all;}.${s.INBOX_CARD_REPLY_LINK}{align-self:flex-start;background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:13px;cursor:pointer;padding:0;}.${s.INBOX_CARD_REPLY_LINK}:hover{color:white;}.${s.INBOX_REPLIES}{display:flex;flex-direction:column;gap:10px;padding:0 4px;}.${s.TOOLTIP_REPLY_COUNT}{font-size:12px;color:rgba(255,255,255,0.45);padding-top:4px;}.${s.INBOX_EMPTY}{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;color:rgba(255,255,255,0.55);text-align:center;}.${s.INBOX_EMPTY_ICON}{width:44px;height:44px;margin-bottom:6px;border:2px dashed rgba(255,255,255,0.25);border-radius:0% 100% 100% 100%;flex:none;}.${s.INBOX_EMPTY_TITLE}{color:white;font-size:14px;font-weight:600;}.${s.INBOX_EMPTY_TEXT}{font-size:13px;line-height:1.5;max-width:30ch;}.${s.INBOX_EMPTY_KBD}{font-family:inherit;font-size:12px;font-weight:500;color:rgba(255,255,255,0.8);background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.14);border-radius:5px;padding:1px 5px;white-space:nowrap;}.${s.INBOX_EMPTY_ACTION}{margin-top:6px;background:transparent;border:1px solid rgba(255,255,255,0.2);border-radius:8px;color:white;font-size:13px;font-weight:500;padding:8px 16px;cursor:pointer;transition:background 0.15s,border-color 0.15s;}.${s.INBOX_EMPTY_ACTION}:hover{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.35);}.${s.THREAD_HEADER}{display:flex;justify-content:space-between;align-items:center;padding:0;}.${s.THREAD_META}{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}.${s.THREAD_AUTHOR}{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${s.THREAD_TIME}{font-size:12px;color:rgba(255,255,255,0.5);cursor:default;position:relative;flex:none;}.${s.THREAD_TIME}::after{content:attr(data-full-date);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease;z-index:1;}.${s.THREAD_TIME}:hover::after{opacity:1;}.${s.THREAD_BODY}{padding:8px 0;white-space:pre-wrap;word-break:break-word;}.${s.THREAD_REPLIES}{padding:0;}.${s.THREAD_REPLIES}:empty{display:none;}.${s.THREAD_REPLY}{padding:16px 0 0 0;border-top:1px solid rgba(255,255,255,0.1);white-space:pre-wrap;word-break:break-word;font-size:13px;color:rgba(255,255,255,0.85);}.${s.THREAD_REPLY} .${s.THREAD_META}{margin-bottom:2px;}.${s.THREAD_REPLY_ACTIONS}{margin-left:auto;flex:none;}.${s.THREAD_REPLY} .${s.SCREENSHOT_IMG}{width:144px;height:100px;object-fit:cover;border-radius:8px;margin-top:4px;cursor:pointer;display:block;}.${s.THREAD_INPUT_AREA}{display:flex;flex-direction:column;gap:0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,0.1);}.${s.THREAD_INPUT}{width:100%;background:transparent;border:none;padding:0;color:white;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;}.${s.THREAD_INPUT}::placeholder{color:rgba(255,255,255,0.5);}.${s.THREAD_INPUT}:focus{outline:none;box-shadow:none;}.${s.THREAD_SUBMIT}{background:none;border:none;color:#2E90FA;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background 0.2s;}.${s.THREAD_SUBMIT}:hover{background:rgba(46,144,250,0.15);color:#1570D6;}.${s.CLOSE_TOOLTIP}{background:none;border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.5);line-height:1;}.${s.CLOSE_TOOLTIP}:hover{color:white;}.${s.PREVIEW_CIRCLE}{animation:helldots-pulse 1.5s ease-in-out infinite;}@keyframes helldots-pulse{0%,100%{box-shadow:0 0 0 0 rgba(46,144,250,0.4),0 1px 5px rgba(0,0,0,0.2);}50%{box-shadow:0 0 0 8px rgba(46,144,250,0),0 1px 5px rgba(0,0,0,0.2);}}.${s.COMMENT_OVERLAY}{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;pointer-events:none;z-index:${O.TOOLBAR-1};}.${s.COMMENT_OVERLAY}.${s.ACTIVE}{pointer-events:auto;background:rgba(0,0,0,0.1);}.${s.SELECTION_RECT}{position:fixed;border:2px solid #2E90FA;background:rgba(46,144,250,0.1);pointer-events:none;z-index:${O.TOOLTIP};box-sizing:border-box;}.${s.SCREENSHOTS_CONTAINER}{display:none;overflow-x:auto;gap:8px;margin-top:4px;padding:4px 0;scrollbar-width:none;-ms-overflow-style:none;margin-bottom:8px;}.${s.SCREENSHOTS_CONTAINER}::-webkit-scrollbar{display:none;}.${s.SCREENSHOTS_CONTAINER}.${s.ACTIVE}{display:flex;}.${s.SCREENSHOT_ITEM}{position:relative;flex-shrink:0;}.${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG}{width:50px;height:50px;object-fit:cover;border-radius:8px;cursor:pointer;display:block;margin:0;}.${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG}:hover{opacity:0.85;}.${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_REMOVE}{position:absolute;top:-5px;right:-5px;width:18px;height:18px;background:rgba(0,0,0,0.7);border:none;border-radius:50%;color:white;font-size:12px;line-height:1;cursor:pointer;display:none;align-items:center;justify-content:center;z-index:1;}.${s.SCREENSHOT_ITEM}:hover .${s.SCREENSHOT_REMOVE}{display:flex;}.${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_REMOVE}:hover{background:rgba(0,0,0,0.9);}.${s.TOOLTIP}>.${s.SCREENSHOTS_CONTAINER} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG},.${s.THREAD_SCROLL}>.${s.SCREENSHOTS_CONTAINER} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG},.${s.THREAD_REPLY} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG}{width:144px;height:100px;}.${s.CONFIRM}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.6);display:flex;align-items:center;justify-content:center;padding:16px;animation:helldots-fade-in 0.15s ease;}.${s.CONFIRM_PANEL}{width:min(360px,100%);background:#1C1C1E;border:1px solid rgba(255,255,255,0.1);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,0.5);padding:20px;color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${s.CONFIRM_TITLE}{margin:0 0 8px;font-size:15px;font-weight:600;}.${s.CONFIRM_MESSAGE}{margin:0 0 20px;font-size:13px;color:rgba(255,255,255,0.65);}.${s.CONFIRM_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${s.CONFIRM_CANCEL},.${s.CONFIRM_ACCEPT}{padding:7px 14px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}.${s.CONFIRM_CANCEL}:focus-visible,.${s.CONFIRM_ACCEPT}:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}.${s.CONFIRM_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${s.CONFIRM_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${s.CONFIRM_ACCEPT}{background:#FF453A;color:white;}.${s.CONFIRM_ACCEPT}:hover{background:#FF6961;}.${s.LIGHTBOX}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.92);z-index:${O.LIGHTBOX};display:flex;align-items:center;justify-content:center;animation:helldots-fade-in 0.2s ease;}@keyframes helldots-fade-in{from{opacity:0;}to{opacity:1;}}.${s.LIGHTBOX_IMG}{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:8px;}.${s.LIGHTBOX_CLOSE}{position:absolute;top:16px;right:16px;background:rgba(255,255,255,0.15);border:none;color:white;font-size:24px;width:40px;height:40px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background 0.2s;}.${s.LIGHTBOX_CLOSE}:hover{background:rgba(255,255,255,0.3);}.${s.EDITOR}{display:flex;flex-direction:column;gap:8px;margin:4px 0 2px;}.${s.EDITOR_INPUT}{width:100%;box-sizing:border-box;resize:vertical;min-height:60px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.14);border-radius:8px;padding:8px 10px;color:white;font-size:14px;font-family:inherit;line-height:1.45;outline:none;${_e}}.${s.EDITOR_INPUT}:focus{border-color:rgba(46,144,250,0.7);}.${s.EDITOR_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${s.EDITOR_CANCEL},.${s.EDITOR_SAVE}{padding:5px 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;}.${s.EDITOR_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${s.EDITOR_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${s.EDITOR_SAVE}{background:#2E90FA;color:white;}.${s.EDITOR_SAVE}:hover:not(:disabled){background:#57A6FB;}.${s.EDITOR_SAVE}:disabled{background:rgba(255,255,255,0.10);color:rgba(255,255,255,0.4);cursor:not-allowed;}.${s.THREAD_EDITED}{font-size:12px;color:rgba(255,255,255,0.4);cursor:default;position:relative;flex:none;}.${s.THREAD_EDITED}::before{content:"\xB7";margin-right:4px;}.${s.THREAD_EDITED}::after{content:attr(data-full-date);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease;}.${s.THREAD_EDITED}:hover::after{opacity:1;}.${s.INBOX_NOTICE}{margin:0 0 10px;padding:9px 11px;border-radius:8px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);color:rgba(255,255,255,0.75);font-size:13px;line-height:1.4;}`,jt=()=>` .${s.COMMENT_CURSOR},.${s.COMMENT_CURSOR} *{cursor:url('${Vt}') ${zt},auto !important;}`;function qe(n,e,t){let o=Jo(e,n);if(o)return n.adoptedStyleSheets=[...n.adoptedStyleSheets??[],o],()=>{n.adoptedStyleSheets=(n.adoptedStyleSheets??[]).filter(a=>a!==o)};let r=n.head??n;r.querySelector?.(`#${t}`)?.remove();let i=document.createElement("style");return i.id=t,i.textContent=e,r.appendChild(i),()=>i.remove()}function Jo(n,e){if(typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in e))return null;try{let t=new CSSStyleSheet;return t.replaceSync(n),t}catch{return null}}var D={commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"Shift",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",filterByType:"Type",filterByPriority:"Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var qt={commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"May\xFAs",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",filterByType:"Tipo",filterByPriority:"Prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var Te={en:D,es:qt},re="en";function Kt(){let n=(navigator.language||re).slice(0,2).toLowerCase();return n in Te?n:re}function Zt(n){let e=Te[n];return!e||n===re?Te[re]:{...Te[re],...e}}function v(n,e){return n.replace("{n}",String(e))}var Qo=6e4;function xe(n,e){if(!Number.isFinite(n)||n<0)return"";let t=Math.floor(n/Qo);if(t<1)return e.durationLessThanMinute;if(t<60)return v(e.minutesAgoTemplate,t);let o=Math.floor(t/60);if(o<24){let l=t%60,c=v(e.hoursAgoTemplate,o);return l?`${c} ${v(e.minutesAgoTemplate,l)}`:c}let r=Math.floor(o/24),i=o%24,a=v(e.daysAgoTemplate,r);return i?`${a} ${v(e.hoursAgoTemplate,i)}`:a}var Ke=64,ei=3,ti=5,ni=.6,oi=.7,ii=/^(css|sc|jsx|emotion)-/i,ri=/^data-(reactid|react-|v-|svelte-)/,si=["id","name","role","aria-label"],ai=["data-testid","name","aria-label"],Ze=n=>typeof CSS<"u"&&CSS.escape?CSS.escape(n):String(n).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),li=n=>String(n).replace(/["\\]/g,"\\$&"),se=(n,e)=>{try{return e.querySelectorAll(n).length===1}catch{return!1}},en=n=>(n||"").replace(/\s+/g," ").trim().slice(0,Ke),ci=n=>Xt.includes(n)||ii.test(n)?!1:!n.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),di=n=>[...n.classList].filter(ci),hi=n=>{let e={};for(let{name:t,value:o}of n.attributes)(si.includes(t)||t.startsWith("data-")&&!ri.test(t))&&o&&(e[t]=o.slice(0,Ke));return e},Je=n=>{let e=n.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(o=>o.tagName===n.tagName);return{index:t.indexOf(n),count:t.length}},pi=(n,e)=>{if(!n.id)return null;let t=`#${Ze(n.id)}`;return se(t,e)?t:null},ui=(n,e)=>{let t=n.tagName.toLowerCase();for(let o of ai){let r=n.getAttribute(o);if(!r)continue;let i=`${t}[${o}="${li(r)}"]`;if(se(i,e))return i}return null},mi=(n,e)=>{let t=[],o=n;for(let r=0;r<ei&&o;r++){let i=di(o),a=o.tagName.toLowerCase();if(t.unshift(i.length?`${a}.${i.map(Ze).join(".")}`:a),r===0&&!i.length)return null;let l=t.join(" > ");if(se(l,e))return l;o=o.parentElement}return null},fi=(n,e)=>{if(n===e.body)return"body";let t=[],o=n;for(let i=0;i<ti&&o;i++){if(o===e.body){t.unshift("body");break}if(o.id){let l=[`#${Ze(o.id)}`,...t].join(" > ");if(se(l,e))return l}let{index:a}=Je(o);t.unshift(`${o.tagName.toLowerCase()}:nth-of-type(${a+1})`),o=o.parentElement}let r=t.join(" > ");return se(r,e)?r:null},tn=(n,e)=>pi(n,e)||ui(n,e)||mi(n,e)||fi(n,e);function nn(n){return tn(n,n.ownerDocument)}function on(n,e,t){let o=n.ownerDocument,{index:r,count:i}=Je(n);return{version:1,selector:tn(n,o),fingerprint:{tagName:n.tagName,textSnippet:en(n.textContent),attributes:hi(n),siblingIndex:r,siblingCount:i},relativeX:e,relativeY:t}}var gi=(n,e)=>{if(!n&&!e)return 1;if(!n||!e)return 0;if(n===e)return 1;if(n.startsWith(e)||e.startsWith(n))return .8;let t=new Set(n.split(" ")),o=new Set(e.split(" ")),r=0;for(let i of t)o.has(i)&&r++;return 2*r/(t.size+o.size)},Ei=(n,e)=>{let t=Object.keys(e);if(!t.length)return 1;let o=0;for(let r of t)(n.getAttribute(r)||"").slice(0,Ke)===e[r]&&o++;return o/t.length},Jt=(n,e)=>{let{index:t,count:o}=Je(n),r=Math.abs(t-e.siblingIndex),i=Math.max(e.siblingCount,o,1);return Math.max(0,1-r/i)},bi=(n,e)=>{if(n.tagName!==e.tagName)return 0;let t=!!e.textSnippet,o=Object.keys(e.attributes||{}).length>0,r=.5,i=.3,a=.2;return o?t||(i+=r,r=0):(r+=i,i=0),!t&&!o?Jt(n,e):r*gi(en(n.textContent),e.textSnippet)+i*Ei(n,e.attributes||{})+a*Jt(n,e)},Qt=(n,e)=>{let t=null;for(let o of n){let r=bi(o,e);(!t||r>t.confidence)&&(t={element:o,confidence:r})}return t};function Qe(n,e=document){if(n?.version!=null&&n.version>1)return null;let t=n?.fingerprint;if(!t||!t.tagName)return null;if(n.selector){let a=[];try{a=[...e.querySelectorAll(n.selector)]}catch{}let l=Qt(a,t);if(l&&l.confidence>=ni)return l}if(!(!!t.textSnippet||Object.keys(t.attributes||{}).length>0))return null;let r;try{r=[...e.querySelectorAll(t.tagName)]}catch{return null}let i=Qt(r,t);return i&&i.confidence>=oi?i:null}var ye="helldots-comments",Se="helldots-pending-detail";function et(){try{let n=localStorage.getItem(ye);if(!n)return[];let e=JSON.parse(n);return Array.isArray(e)?e:[]}catch(n){return console.warn("HellDots: could not read stored comments",n),[]}}function rn(n){try{return localStorage.setItem(ye,JSON.stringify(n)),!0}catch{return!1}}function we(n){if(rn(n))return!0;let e=n.map((r,i)=>({comment:r,index:i})).filter(({comment:r})=>r?.contextScreenshot).sort((r,i)=>{let a=Date.parse(r.comment.createdAt),l=Date.parse(i.comment.createdAt);return Number.isFinite(a)&&Number.isFinite(l)&&a!==l?a-l:r.index-i.index});if(e.length===0)return console.warn("HellDots: could not persist comments (storage quota exceeded, nothing left to shed)"),!1;let t=[...n],o=0;for(let{index:r}of e)if(t[r]={...t[r],contextScreenshot:null},o++,rn(t))return console.warn(`HellDots: localStorage quota exceeded \u2014 dropped the automatic context screenshot from the ${o} oldest comment(s) to keep all comments persisted. Comment text, replies and user-attached screenshots were not touched.`),!0;return console.warn(`HellDots: could not persist comments even after dropping all ${o} automatic context screenshot(s); storage quota exceeded`),!1}function tt(n,e,t){let o=new Set(e.map(i=>String(i.id)));return[...n.filter(i=>!o.has(String(i.id))&&i.page!==t),...e]}var sn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var an=(n=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(n|=0));for(;n--;)e+=sn[t[n]&63];return e};var nt=()=>an(),w=(n,e)=>String(n)===String(e);var Oe="helldotsComment",V=(n,e=Oe,t=location.href)=>{let o=new URL(t),r=n.page||o.pathname,i=r===o.pathname?o:new URL(r,o);return i.searchParams.set(e,String(n.id)),i.href},ln=(n=Oe,e=location.href)=>{try{return new URL(e).searchParams.get(n)}catch{return null}};var z=new Set,G=null,Ae=null,Ci=n=>[...n.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')],cn=4,_i=n=>{for(let e=n.parentElement;e;e=e.parentElement){let{overflowX:t,overflowY:o}=getComputedStyle(e);if(t!=="visible"||o!=="visible")return e.getBoundingClientRect()}return null},Ti=(n,e)=>{e.classList.remove(s.INBOX_MENU_UP);let t=_i(e),o=Math.min(t?.bottom??1/0,window.innerHeight),r=Math.max(t?.top??0,0),{height:i}=e.getBoundingClientRect(),a=n.getBoundingClientRect(),l=a.bottom+cn+i,c=a.top-cn-i;l>o&&c>=r&&e.classList.add(s.INBOX_MENU_UP)},dn=(n,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(n)||n.contains(e.target),xi=()=>{G||(G=n=>{for(let e of[...z])dn(e.menu,n)||dn(e.button,n)||e.close()},document.addEventListener("mousedown",G,!0),Ae=n=>{let e=[...z].pop();if(e){if(n.key==="Escape"){n.preventDefault(),n.stopPropagation(),e.close(),e.button.focus();return}if(["ArrowDown","ArrowUp","Home","End"].includes(n.key)){let t=Ci(e.menu);if(t.length===0)return;n.preventDefault(),n.stopPropagation();let o=e.menu.getRootNode(),r=t.indexOf(o.activeElement),i;if(n.key==="Home")i=0;else if(n.key==="End")i=t.length-1;else if(r===-1)i=n.key==="ArrowDown"?0:t.length-1;else{let a=n.key==="ArrowDown"?1:-1;i=(r+a+t.length)%t.length}t[i].focus()}}},document.addEventListener("keydown",Ae,!0))},yi=()=>{G&&(document.removeEventListener("mousedown",G,!0),G=null,document.removeEventListener("keydown",Ae,!0),Ae=null)},ve=()=>{for(let n of[...z])n.close()},ae=(n,e)=>{let t={button:n,menu:e,close:()=>{e.style.display="none",n.setAttribute("aria-expanded","false"),z.delete(t),z.size===0&&yi()}},o=()=>{ve(),e.style.display="block",Ti(n,e),n.setAttribute("aria-expanded","true"),z.add(t),xi()},r=()=>e.style.display!=="none";return e.style.display="none",n.setAttribute("aria-expanded","false"),n.addEventListener("click",i=>{i.stopPropagation();let a=r();ve(),a||o()}),{open:o,close:t.close,isOpen:r}};var ot=new Set,hn=()=>{for(let n of[...ot])n(!1)},Ne=(n,{title:e,message:t,confirmLabel:o,cancelLabel:r})=>new Promise(i=>{let a=document.createElement("div");a.className=s.CONFIRM,a.style.zIndex=String(O.CONFIRM);let l=document.createElement("div");l.className=s.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=s.CONFIRM_TITLE,c.textContent=e,c.id=`hd-confirm-title-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-labelledby",c.id);let d=document.createElement("p");d.className=s.CONFIRM_MESSAGE,d.textContent=t,d.id=`hd-confirm-message-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-describedby",d.id);let h=document.createElement("div");h.className=s.CONFIRM_ACTIONS;let p=document.createElement("button");p.type="button",p.className=s.CONFIRM_CANCEL,p.textContent=r;let m=document.createElement("button");m.type="button",m.className=s.CONFIRM_ACCEPT,m.textContent=o,h.appendChild(p),h.appendChild(m),l.appendChild(c),l.appendChild(d),l.appendChild(h),a.appendChild(l);let u=n.activeElement||document.activeElement,f=!1,g=_=>{f||(f=!0,ot.delete(g),document.removeEventListener("keydown",E,!0),a.remove(),u?.focus?.(),i(_))},E=_=>{if(_.key==="Escape"){_.stopPropagation(),_.preventDefault(),g(!1);return}if(_.key!=="Tab")return;let y=[p,m],C=n.activeElement||document.activeElement,x=y.indexOf(C);_.preventDefault(),(_.shiftKey?y[(x<=0?y.length:x)-1]:y[(x+1)%y.length]).focus()};p.addEventListener("click",()=>g(!1)),m.addEventListener("click",()=>g(!0));let b=!1;a.addEventListener("mousedown",_=>{b=_.target===a,_.stopPropagation()}),a.addEventListener("click",_=>{_.target===a&&b&&g(!1),b=!1}),ot.add(g),document.addEventListener("keydown",E,!0),(n.body||n).appendChild(a),p.focus()});var pn='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',Si='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',wi='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></svg>',W=n=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(n).catch(()=>{});let e=document.createElement("textarea");e.value=n,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},j=(n,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,resolved:e.statusResolved})[n]||e.statusOpen,$=(n,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[n]||e.unset,H=(n,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[n]||e.unset,Y=({action:n,options:e,value:t,colorOf:o,labelOf:r,tooltipLabel:i,onSelect:a,showLabel:l=!1})=>{let c=document.createElement("div");c.style.position="relative";let d=document.createElement("button");d.type="button",d.className=s.INBOX_ACTION_BTN,l&&d.classList.add(s.INBOX_ACTION_BTN_LABELED),d.dataset.action=n,d.setAttribute("aria-haspopup","true");let h=document.createElement("span");h.className=s.INBOX_STATUS_DOT,d.appendChild(h);let p=null;l&&(p=document.createElement("span"),p.className=s.INBOX_ACTION_LABEL,d.appendChild(p));let m=document.createElement("div");m.className=s.INBOX_MENU,m.setAttribute("role","menu");let u=ae(d,m),f=t,g=()=>{let E=`${i}: ${r(f)}`;h.style.backgroundColor=o(f),d.dataset.hdTooltip=E,d.setAttribute("aria-label",E),p&&(p.textContent=r(f)),m.querySelectorAll("[data-picker-option]").forEach(b=>{let T=b.dataset.pickerOption,_=T===""?null:T;b.setAttribute("aria-checked",String(_===f))})};for(let E of e){let b=document.createElement("button");b.type="button",b.className=s.INBOX_MENU_ITEM,b.dataset.pickerOption=E===null?"":E,b.setAttribute("role","menuitemradio");let T=document.createElement("span");T.className=s.INBOX_STATUS_DOT,T.style.backgroundColor=o(E),b.appendChild(T),b.appendChild(document.createTextNode(r(E))),b.addEventListener("click",_=>{_.stopPropagation(),u.close(),E!==f&&(f=E,a(E),g())}),m.appendChild(b)}return c.appendChild(d),c.appendChild(m),g(),c},it=({label:n,tooltip:e,items:t})=>{let o=document.createElement("div");o.style.position="relative";let r=document.createElement("button");r.type="button",r.className=s.INBOX_ACTION_BTN,r.dataset.action="menu",e&&(r.dataset.hdTooltip=e),r.setAttribute("aria-label",n),r.innerHTML=wi;let i=document.createElement("div");i.className=s.INBOX_MENU,i.setAttribute("role","menu");let a=ae(r,i);for(let l of t){let c=document.createElement("button");c.type="button",c.className=s.INBOX_MENU_ITEM,c.setAttribute("role","menuitem"),c.textContent=l.label,c.addEventListener("click",async d=>{if(d.stopPropagation(),l.feedbackLabel){l.onSelect(),c.textContent=l.feedbackLabel,setTimeout(()=>{c.textContent=l.label,a.close()},1200);return}if(a.close(),l.confirm){let h=c.getRootNode();if(!await Ne(h,l.confirm()))return}l.onSelect()}),i.appendChild(c)}return o.appendChild(r),o.appendChild(i),o},Re=(n,{strings:e,onCopy:t,onCopyLink:o,onEdit:r,onSetStatus:i,onSetType:a,onSetPriority:l,onDelete:c})=>{let d=document.createElement("div");d.className=s.INBOX_CARD_ACTIONS;let h=document.createElement("button");return h.type="button",h.className=s.INBOX_ACTION_BTN,h.dataset.action="copy",h.dataset.hdTooltip=e.copyAgentContext,h.setAttribute("aria-label",e.copyAgentContext),h.innerHTML=pn,h.addEventListener("click",p=>{p.stopPropagation(),t(n),h.innerHTML=Si,h.dataset.hdTooltip=e.copied,setTimeout(()=>{h.innerHTML=pn,h.dataset.hdTooltip=e.copyAgentContext},1500)}),d.appendChild(h),d.appendChild(Y({action:"status",options:P,value:n.status||"open",colorOf:p=>be[p]||"",labelOf:p=>j(p,e),tooltipLabel:e.statusLabel,onSelect:p=>i(n,p),showLabel:!0})),d.appendChild(Y({action:"type",options:[null,...L],value:n.type||null,colorOf:p=>oe[p]||"transparent",labelOf:p=>$(p,e),tooltipLabel:e.typeLabel,onSelect:p=>a?.(n,p),showLabel:!0})),d.appendChild(Y({action:"priority",options:[null,...B],value:n.priority||null,colorOf:p=>ie[p]||"transparent",labelOf:p=>H(p,e),tooltipLabel:e.priorityLabel,onSelect:p=>l?.(n,p),showLabel:!0})),d.appendChild(it({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>o?.(n)},{label:e.editComment,onSelect:()=>r?.(n)},{label:e.deleteComment,onSelect:()=>c(n),confirm:()=>({title:e.confirmDeleteCommentTitle,message:n.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),d};var q=({value:n,strings:e,onInput:t,onSave:o,onCancel:r})=>{let i=document.createElement("div");i.className=s.EDITOR;let a=document.createElement("textarea");a.className=s.EDITOR_INPUT,a.value=n,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=s.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=s.EDITOR_CANCEL,c.textContent=e.editCancel;let d=document.createElement("button");d.type="button",d.className=s.EDITOR_SAVE,d.textContent=e.editSave;let h=()=>{d.disabled=a.value.trim().length===0};return h(),a.addEventListener("input",()=>{h(),t(a.value)}),a.addEventListener("keydown",p=>{if(p.key==="Escape"){p.stopPropagation(),p.preventDefault(),r();return}p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&!d.disabled&&(p.preventDefault(),o(a.value))}),c.addEventListener("click",p=>{p.stopPropagation(),r()}),d.addEventListener("click",p=>{p.stopPropagation(),d.disabled||o(a.value)}),l.appendChild(c),l.appendChild(d),i.appendChild(a),i.appendChild(l),queueMicrotask(()=>{a.focus(),a.setSelectionRange(a.value.length,a.value.length)}),i},Ie=(n,e)=>Ne(n,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var Oi=(n,e)=>{let t=Date.now()-new Date(n).getTime(),o=Math.floor(t/6e4),r=Math.floor(t/36e5),i=Math.floor(t/864e5);return o<1?e.justNow:o<60?v(e.minutesAgoTemplate,o):r<24?v(e.hoursAgoTemplate,r):v(e.daysAgoTemplate,i)},mn=(n,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(n)),le=(n,e,t,o,r=null)=>{let i=document.createElement("div");i.className=s.THREAD_META;let a=document.createElement("span");a.className=s.THREAD_AUTHOR,a.textContent=n||t.anonymous;let l=document.createElement("span");return l.className=s.THREAD_TIME,l.textContent=Oi(e,t),l.dataset.fullDate=mn(e,o),i.appendChild(a),i.appendChild(l),r&&i.appendChild(rt(r,t,o)),i},rt=(n,e,t)=>{let o=document.createElement("span");return o.className=s.THREAD_EDITED,o.textContent=e.editedMark,o.dataset.fullDate=e.editedAtPrefix+mn(n,t),o},st=()=>/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),at=(n,e)=>{let t=st(),o={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:t?"\u21E7":e.modifierShift},r=o[n.shortcutModifier]||o.alt,i=n.shortcutKey?.toUpperCase()||"C";return`${r} + ${i}`},Le='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',Ai='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',vi='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2L15 22L11 13M11 13L2 9L22 2"/></svg>',Ni='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.8914 10.4028L2.98327 10.6318C3.22909 11.2445 3.5 12.1045 3.5 13C3.5 13.3588 3.4564 13.7131 3.38773 14.0495C3.69637 13.9446 4.01409 13.8159 4.32918 13.6584C4.87888 13.3835 5.33961 13.0611 5.70994 12.7521L6.22471 12.3226L6.88809 12.4196C7.24851 12.4724 7.61994 12.5 8 12.5C11.7843 12.5 14.5 9.85569 14.5 7C14.5 4.14431 11.7843 1.5 8 1.5C4.21574 1.5 1.5 4.14431 1.5 7C1.5 8.18175 1.94229 9.29322 2.73103 10.2153L2.8914 10.4028ZM2.8135 15.7653C1.76096 16 1 16 1 16C1 16 1.43322 15.3097 1.72937 14.4367C1.88317 13.9834 2 13.4808 2 13C2 12.3826 1.80733 11.7292 1.59114 11.1903C0.591845 10.0221 0 8.57152 0 7C0 3.13401 3.58172 0 8 0C12.4183 0 16 3.13401 16 7C16 10.866 12.4183 14 8 14C7.54721 14 7.10321 13.9671 6.67094 13.9038C6.22579 14.2753 5.66881 14.6656 5 15C4.23366 15.3832 3.46733 15.6195 2.8135 15.7653Z"/></svg>',Ri='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.67705 7.5L3.92705 3H12.0729L14.3229 7.5H10H9.25V8.25C9.25 8.94036 8.69036 9.5 8 9.5C7.30964 9.5 6.75 8.94036 6.75 8.25V7.5H6H1.67705ZM1.5 9V12C1.5 12.5523 1.94772 13 2.5 13H13.5C14.0523 13 14.5 12.5523 14.5 12V9H10.6465C10.32 10.1543 9.25878 11 8 11C6.74122 11 5.67998 10.1543 5.35352 9H1.5ZM3 1.5H13L15.8944 7.28885C15.9639 7.42771 16 7.58082 16 7.73607V12C16 13.3807 14.8807 14.5 13.5 14.5H2.5C1.11929 14.5 0 13.3807 0 12V7.73607C0 7.58082 0.0361451 7.42771 0.105573 7.28885L3 1.5Z"/></svg>',Be=({areaClassName:n,inputTag:e="textarea",inputClassName:t,inputId:o,inputPlaceholder:r,submitBtnId:i,fileInputId:a},l)=>{let c=document.createElement("div");c.className=n;let d=document.createElement(e);o&&(d.id=o),t&&(d.className=t),d.placeholder=r,d.setAttribute("aria-label",r),e==="input"&&(d.type="text");let h=document.createElement("div");h.className=s.SCREENSHOTS_CONTAINER;let p=document.createElement("div");p.className=s.COMMENT_ACTIONS_BAR;let m=document.createElement("button");m.className=s.ATTACH_IMAGE_BTN,m.type="button",m.setAttribute("aria-label",l.attachImage),m.innerHTML=Ai;let u=document.createElement("input");u.type="file",a&&(u.id=a),u.accept="image/*",u.style.display="none";let f=document.createElement("button");return i&&(f.id=i),f.className=s.THREAD_SUBMIT,f.type="button",f.setAttribute("aria-label",l.send),f.innerHTML=vi,p.appendChild(m),p.appendChild(u),p.appendChild(f),c.appendChild(d),c.appendChild(h),c.appendChild(p),{container:c,inputEl:d,screenshotsContainer:h,attachBtn:m,fileInput:u,submitBtn:f}},un=(n,e,t,o)=>{let r=document.createElement("div");r.className=s.TOOLBAR_ACTION_WRAPPER;let i=document.createElement("div");i.className=s.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>i.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${s.TOOLBAR_ACTION_BTN} ${n}`,a.setAttribute("aria-label",o),a.innerHTML=e,r.appendChild(i),r.appendChild(a),r},fn=(n={},e=D)=>{let t=document.createElement("div");t.id=S.TOOLBAR;let o=document.createElement("div");o.className=s.TOOLBAR_ACTIONS;let r=document.createElement("span");r.className=s.TOOLBAR_TEXT,r.textContent=e.toolbarComment;let i=document.createElement("span");i.className=s.SHORTCUT_HINT,i.textContent=at(n,e);let a=un(s.TOOLBAR_COMMENT_BTN,Ni,[r,i],e.toolbarComment);a.querySelector(`.${s.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=s.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=un(s.TOOLBAR_MENU_BTN,Ri,[l],e.toolbarInbox);return o.appendChild(a),o.appendChild(c),t.appendChild(o),t},lt=(n,e,{includeStatus:t=!1,includeClassification:o=!0}={})=>{let r=document.createElement("div");r.className=s.INBOX_BADGES;let i=(a,l,c)=>{let d=document.createElement("span");d.className=`${s.BADGE} ${l}`,d.textContent=a,c&&(d.style.borderColor=c),r.appendChild(d)};if(t){let a=n.status||"open";i(j(a,e),s.BADGE_STATUS,be[a])}o&&n.type&&i($(n.type,e),s.BADGE_TYPE,oe[n.type]),o&&n.priority&&i(H(n.priority,e),s.BADGE_PRIORITY,ie[n.priority]);for(let a of n.tags||[])i(a,s.BADGE_TAG,null);if(n.status==="resolved"){let a=n.resolvedAt?xe(new Date(n.resolvedAt).getTime()-new Date(n.createdAt).getTime(),e):"";i(v(e.resolvedInTemplate,a||"\u2014"),s.BADGE_DURATION,null)}return r.children.length?r:null},Ii=n=>{let e=document.createElement("div");e.className=s.CLASSIFY_ROW;let t=null,o=null,r=()=>{e.replaceChildren(),e.appendChild(Y({action:"type",options:[null,...L],value:null,colorOf:i=>oe[i]||"transparent",labelOf:i=>$(i,n),tooltipLabel:n.typeLabel,onSelect:i=>t=i,showLabel:!0})),e.appendChild(Y({action:"priority",options:[null,...B],value:null,colorOf:i=>ie[i]||"transparent",labelOf:i=>H(i,n),tooltipLabel:n.priorityLabel,onSelect:i=>o=i,showLabel:!0}))};return r(),{container:e,getType:()=>t,getPriority:()=>o,reset:()=>{t=null,o=null,r()}}},gn=(n=D)=>{let e=document.createElement("div");e.id=S.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",n.commentBoxAriaLabel);let{container:t}=Be({areaClassName:s.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:S.COMMENT_INPUT,inputPlaceholder:n.commentPlaceholder,submitBtnId:S.SUBMIT_COMMENT,fileInputId:S.ATTACH_IMAGE_INPUT},n),o=Ii(n);return e.appendChild(o.container),e.appendChild(t),e.style.display="none",e.classify=o,e},F=n=>String(n).replace(/[\\"]/g,"\\$&"),En=n=>`[data-comment-id="${F(n)}"]`,ct=n=>n.screenshots||(n.screenshot?[n.screenshot]:[]),K=(n,e,{strings:t,onShow:o,rerender:r})=>{n.innerHTML="",n.classList.toggle(s.ACTIVE,e.length>0),e.forEach((i,a)=>{let l=document.createElement("div");l.className=s.SCREENSHOT_ITEM;let c=document.createElement("img");c.className=s.SCREENSHOT_IMG,c.src=i,c.alt=t.attachedScreenshot,bn(c,()=>o(i));let d=document.createElement("button");d.type="button",d.className=s.SCREENSHOT_REMOVE,d.setAttribute("aria-label",t.removeScreenshot),d.innerHTML="&times;",d.onclick=h=>{h.stopPropagation(),e.splice(a,1),r()},l.appendChild(c),l.appendChild(d),n.appendChild(l)})},Z=(n,e,t)=>{n.addEventListener("change",o=>{let r=o.target.files[0];if(!r||r.type&&!r.type.startsWith("image/"))return;let i=e();if(i.length>=Ee)return;let a=new FileReader;a.onload=l=>{i.push(l.target.result),t()},a.readAsDataURL(r),n.value=""})},I=(n,e)=>{n.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(t=>{bn(t,()=>e(t.src))})},bn=(n,e)=>{n.setAttribute("role","button"),n.setAttribute("tabindex","0"),n.addEventListener("click",t=>{t.stopPropagation(),e()}),n.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())})},Cn=(n,e=D)=>{let t=document.createElement("div");return t.className=s.CIRCLE,t.dataset.commentId=n.id,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${n.text}`),t.style.cssText=`
71
19
  position: absolute;
72
- bottom: calc(100% + 10px);
73
- left: 50%;
74
- transform: translateX(-50%) translateY(4px);
75
- display: flex;
76
- align-items: center;
77
- gap: 8px;
78
- background: rgba(20, 20, 23, 0.95);
79
- backdrop-filter: blur(16px);
80
- -webkit-backdrop-filter: blur(16px);
81
- padding: 8px 12px;
82
- border-radius: 10px;
83
- border: 1px solid rgba(255, 255, 255, 0.08);
84
- box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
85
- color: white;
86
- white-space: nowrap;
87
- opacity: 0;
88
- pointer-events: none;
89
- transition: opacity 0.15s ease, transform 0.15s ease;
90
- }
91
-
92
- .${i.TOOLBAR_ACTION_WRAPPER}:hover .${i.TOOLBAR_ACTION_TOOLTIP} {
93
- opacity: 1;
94
20
  pointer-events: auto;
95
- transform: translateX(-50%) translateY(0);
96
- }
97
-
98
- .${i.TOOLBAR_TEXT} {
99
- font-size: 13px;
100
- font-weight: 500;
101
- letter-spacing: -0.01em;
102
- }
103
-
104
- .${i.SHORTCUT_HINT} {
105
- font-size: 11px;
106
- font-weight: 500;
107
- color: rgba(255, 255, 255, 0.5);
108
- background: rgba(255, 255, 255, 0.06);
109
- border: 1px solid rgba(255, 255, 255, 0.1);
110
- padding: 2px 6px;
111
- border-radius: 5px;
112
- line-height: 1;
113
- white-space: nowrap;
114
- }
115
-
116
- .${i.TOOLBAR_ACTIONS} {
117
- display: flex;
118
- flex-direction: row;
119
- background: rgba(20, 20, 23, 0.95);
120
- backdrop-filter: blur(16px);
121
- -webkit-backdrop-filter: blur(16px);
122
- border-radius: 12px;
123
- box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
124
- }
125
-
126
- .${i.TOOLBAR_ACTION_BTN} {
127
- width: 42px;
128
- height: 42px;
129
- display: flex;
130
- align-items: center;
131
- justify-content: center;
132
- background: none;
133
- border: none;
134
- outline: none;
135
- color: rgba(255, 255, 255, 0.65);
136
- cursor: pointer;
137
- transition: background 0.2s, color 0.2s;
138
- padding: 0;
139
- }
140
-
141
- .${i.TOOLBAR_ACTION_WRAPPER}:first-child .${i.TOOLBAR_ACTION_BTN} {
142
- border-radius: 12px 0 0 12px;
143
- }
144
-
145
- .${i.TOOLBAR_ACTION_WRAPPER}:last-child .${i.TOOLBAR_ACTION_BTN} {
146
- border-radius: 0 12px 12px 0;
147
- }
148
-
149
- .${i.TOOLBAR_ACTION_BTN}:hover {
150
- background: rgba(255, 255, 255, 0.08);
151
- color: white;
152
- }
153
-
154
- .${i.TOOLBAR_COMMENT_BTN}.${i.ACTIVE} {
155
- color: #2E90FA;
156
- background: rgba(46, 144, 250, 0.1);
157
- }
158
-
159
-
160
- #${y.COMMENT_BOX} {
161
- position: fixed;
162
- background: #1C1C1E;
163
- border-radius: 12px;
164
- box-shadow: 0 4px 20px rgba(0,0,0,0.4);
165
- padding: 16px;
166
- z-index: ${O.COMMENT_BOX};
167
- width: min(400px, calc(100vw - 24px));
168
- display: none;
169
- box-sizing: border-box;
170
- }
171
-
172
- #${y.COMMENT_BOX} .${i.COMMENT_INPUT_AREA} {
173
- display: flex;
174
- flex-direction: column;
175
- gap: 0;
176
- }
177
-
178
- /* Shares the comment box's own 16px inset instead of adding its own, so
179
- the pickers line up with the textarea below them. The hairline is the
180
- mirror of the one .thread-input-area carries on top. */
181
- .${i.CLASSIFY_ROW} {
182
- display: flex;
183
- align-items: center;
184
- flex-wrap: wrap;
185
- gap: 8px;
186
- padding: 0 0 10px;
187
- border-bottom: 1px solid rgba(255, 255, 255, 0.08);
188
- }
189
-
190
- /* In the inbox the pickers sit in a strip of other icon buttons and read
191
- as controls on their own. Alone at the top of an empty comment box
192
- they need an outline to do the same. */
193
- .${i.CLASSIFY_ROW} .${i.INBOX_ACTION_BTN} {
194
- height: 26px;
195
- border: 1px solid rgba(255, 255, 255, 0.12);
196
- border-radius: 8px;
197
- }
198
-
199
- .${i.CLASSIFY_ROW} .${i.INBOX_ACTION_BTN}:hover {
200
- border-color: rgba(255, 255, 255, 0.28);
201
- }
202
-
203
- #${y.COMMENT_INPUT} {
204
- flex: 1;
205
- min-height: 20px;
206
- background: #1C1C1E;
207
- border: none;
208
- resize: none;
209
- font-family: inherit;
210
- color: white;
211
- font-size: 14px;
212
- line-height: 1.4;
213
- box-sizing: border-box;
214
- field-sizing: content;
215
- padding: 8px 0;
216
- }
217
-
218
- #${y.COMMENT_INPUT}::placeholder {
219
- color: rgba(255, 255, 255, 0.5);
220
- }
221
-
222
- #${y.COMMENT_INPUT}:focus {
223
- outline: none;
224
- box-shadow: none;
225
- }
226
-
227
- .${i.COMMENT_ACTIONS_BAR} {
228
- display: flex;
229
- align-items: center;
230
- justify-content: space-between;
231
- padding-top: 12px;
232
- }
233
-
234
- .${i.ATTACH_IMAGE_BTN} {
235
- background: none;
236
- border: none;
237
- color: rgba(255, 255, 255, 0.5);
238
- cursor: pointer;
239
- display: flex;
240
- align-items: center;
241
- justify-content: center;
242
- border-radius: 6px;
243
- transition: background 0.2s, color 0.2s;
244
- }
245
-
246
- .${i.ATTACH_IMAGE_BTN}:hover {
247
- background: rgba(255, 255, 255, 0.1);
248
- color: rgba(255, 255, 255, 0.8);
249
- }
250
-
251
- .${i.CIRCLE} {
252
- position: absolute;
253
- width: 28px;
254
- height: 28px;
255
- background: #2E90FA;
256
- border-radius: 0% 100% 100% 100%;
257
- border: 2px solid #FFF;
258
- cursor: pointer;
259
- box-shadow: 0 1px 5px rgba(0,0,0,0.2);
260
- transition: transform 0.2s, background 0.2s;
261
- z-index: ${O.CIRCLE};
262
- transform: translate(-50%, -50%);
263
- }
264
-
265
- .${i.CIRCLE}:hover {
266
- transform: translate(-50%, -50%) scale(1.2) !important;
267
- background: rgb(0, 123, 255);
268
- }
269
-
270
- .${i.CIRCLE}.${i.HIGHLIGHT} {
271
- transform: translate(-50%, -50%) scale(1.2) !important;
272
- background: rgb(0, 123, 255);
273
- box-shadow: 0 0 0 4px rgba(46, 144, 250, 0.35), 0 1px 5px rgba(0,0,0,0.2);
274
- }
275
-
276
- /* The marker whose thread is open. Grows like hover does \u2014 the pointer
277
- has to leave the circle to reach the popover, so hover alone can't
278
- carry the selected state \u2014 and adds a heavier ring. Size and ring,
279
- not colour alone (WCAG 1.4.1). */
280
- .${i.CIRCLE}.${i.CIRCLE_ACTIVE} {
281
- transform: translate(-50%, -50%) scale(1.2) !important;
282
- background: rgb(0, 123, 255);
283
- box-shadow: 0 0 0 5px rgba(46, 144, 250, 0.5), 0 1px 5px rgba(0,0,0,0.2);
284
- }
285
-
286
- .${i.CIRCLE_WRAPPER} {
287
- position: absolute;
288
- left: 0;
289
- top: 0;
290
- width: 100%;
291
- height: 100%;
292
- pointer-events: none;
293
- z-index: ${O.CIRCLE};
294
- }
295
-
296
- .${i.TOOLTIP} {
297
- position: fixed;
298
- background: #1C1C1E;
299
- border-radius: 12px;
300
- padding: 16px;
301
- box-shadow: 0 4px 20px rgba(0,0,0,0.4);
302
- width: min(400px, calc(100vw - 24px));
303
- max-height: calc(100vh - 20px);
304
- overflow-y: auto;
305
- overscroll-behavior: contain;${de}
306
- z-index: ${O.TOOLTIP};
307
- color: white;
308
- font-size: 14px;
309
- line-height: 1.5;
310
- box-sizing: border-box;
311
- }
312
-
313
- .${i.TOOLTIP} .${i.THREAD_HEADER} {
314
- padding: 0 0 0;
315
- }
316
-
317
- .${i.TOOLTIP} .${i.THREAD_BODY} {
318
- padding: 8px 0;
319
- }
320
-
321
- .${i.THREAD_POPOVER} {
322
- position: fixed;
323
- background: #1C1C1E;
324
- border-radius: 12px;
325
- padding: 16px;
326
- box-shadow: 0 4px 20px rgba(0,0,0,0.4);
327
- width: min(400px, calc(100vw - 24px));
328
- max-height: calc(100vh - 20px);
329
- display: flex;
330
- flex-direction: column;
331
- z-index: ${O.TOOLTIP};
332
- color: white;
333
- font-size: 14px;
334
- line-height: 1.5;
335
- box-sizing: border-box;
336
- }
337
-
338
- /* The header, its action row and the reply box are pinned; the comment
339
- body, context block and replies scroll between them. The min-height: 0
340
- is required \u2014 a flex item's default minimum is its content height, so
341
- without it the popover grows past max-height instead of scrolling. */
342
- .${i.THREAD_POPOVER} > .${i.THREAD_HEADER},
343
- .${i.THREAD_POPOVER} > .${i.THREAD_ACTIONS_ROW},
344
- .${i.THREAD_POPOVER} > .${i.THREAD_INPUT_AREA} {
345
- flex: none;
346
- }
347
-
348
- .${i.THREAD_SCROLL} {
349
- flex: 1 1 auto;
350
- min-height: 0;
351
- overflow-y: auto;
352
- overscroll-behavior: contain;${de}
353
- }
354
- ${xn(`.${i.THREAD_SCROLL}`,`.${i.TOOLTIP}`,`.${i.INBOX_LIST}`,`.${i.INBOX_DETAIL}`,`.${i.EDITOR_INPUT}`)}
355
- .${i.INBOX_PANEL} {
356
- position: fixed;
357
- top: 16px;
358
- right: 16px;
359
- bottom: 16px;
360
- width: 380px;
361
- display: flex;
362
- flex-direction: column;
363
- background: #1C1C1E;
364
- border: 1px solid rgba(255,255,255,0.08);
365
- border-radius: 14px;
366
- box-shadow: 0 8px 32px rgba(0,0,0,0.5);
367
- z-index: ${O.COMMENT_BOX};
368
- color: white;
369
- font-size: 14px;
370
- line-height: 1.5;
371
- box-sizing: border-box;
372
- overflow: hidden;
373
- }
374
-
375
- /* 380px panel + 16px of gutter each side needs 412px to sit flush on
376
- the right; below that it spans the viewport instead. */
377
- @media (max-width: 480px) {
378
- .${i.INBOX_PANEL} {
379
- left: 16px;
380
- width: auto;
381
- }
382
- }
383
-
384
- .${i.INBOX_HEADER},
385
- .${i.INBOX_DETAIL_HEADER} {
386
- display: flex;
387
- align-items: center;
388
- justify-content: space-between;
389
- gap: 8px;
390
- padding: 12px 14px;
391
- border-bottom: 1px solid rgba(255,255,255,0.08);
392
- flex: none;
393
- }
394
-
395
- .${i.INBOX_FILTER}-wrapper {
396
- position: relative;
397
- }
398
-
399
- .${i.INBOX_FILTER} {
400
- display: flex;
401
- align-items: center;
402
- gap: 6px;
403
- background: transparent;
404
- border: none;
405
- color: white;
406
- font-size: 13px;
407
- font-weight: 600;
408
- cursor: pointer;
409
- padding: 4px 6px;
410
- border-radius: 6px;
411
- }
412
-
413
- .${i.INBOX_FILTER}:hover {
414
- background: rgba(255,255,255,0.08);
415
- }
416
-
417
- .${i.INBOX_FILTER_MENU} {
418
- position: absolute;
419
- top: calc(100% + 6px);
420
- left: 0;
421
- background: #2C2C2E;
422
- border: 1px solid rgba(255,255,255,0.1);
423
- border-radius: 12px;
424
- padding: 14px;
425
- width: 300px;
426
- max-width: calc(100vw - 40px);
427
- z-index: 1;
428
- box-shadow: 0 8px 28px rgba(0,0,0,0.5);
429
- }
430
-
431
- .${i.INBOX_FILTER_MENU_HEADER} {
432
- display: flex;
433
- align-items: baseline;
434
- justify-content: space-between;
435
- gap: 12px;
436
- font-size: 13px;
437
- font-weight: 600;
438
- margin-bottom: 12px;
439
- }
440
-
441
- .${i.INBOX_FILTER_CLEAR} {
442
- background: transparent;
443
- border: none;
444
- color: rgba(255,255,255,0.55);
445
- font-size: 12px;
446
- font-weight: 500;
447
- cursor: pointer;
448
- padding: 0;
449
- }
450
-
451
- .${i.INBOX_FILTER_CLEAR}:hover:not(:disabled) {
452
- color: white;
453
- }
454
-
455
- .${i.INBOX_FILTER_CLEAR}:disabled {
456
- opacity: 0.35;
457
- cursor: default;
458
- }
459
-
460
- .${i.INBOX_FILTER_GROUP} + .${i.INBOX_FILTER_GROUP} {
461
- margin-top: 14px;
462
- }
463
-
464
- .${i.INBOX_FILTER_SECTION} {
465
- font-size: 11px;
466
- font-weight: 600;
467
- color: rgba(255,255,255,0.45);
468
- margin-bottom: 8px;
469
- }
470
-
471
- .${i.INBOX_FILTER_CHIPS} {
472
- display: flex;
473
- flex-wrap: wrap;
474
- gap: 6px;
475
- }
476
-
477
- .${i.INBOX_FILTER_CHIP} {
478
- background: transparent;
479
- border: 1px solid rgba(255,255,255,0.18);
480
- border-radius: 999px;
481
- color: rgba(255,255,255,0.75);
482
- font-size: 12px;
483
- line-height: 1;
484
- padding: 7px 12px;
485
- cursor: pointer;
486
- transition: background 0.15s, border-color 0.15s, color 0.15s;
487
- }
488
-
489
- .${i.INBOX_FILTER_CHIP}:hover {
490
- border-color: rgba(255,255,255,0.4);
491
- color: white;
492
- }
493
-
494
- /* Selected chips are filled *and* carry aria-checked \u2014 the fill is a
495
- convenience, never the only way to tell them apart. */
496
- .${i.INBOX_FILTER_CHIP}[aria-checked="true"] {
497
- background: rgba(255,255,255,0.92);
498
- border-color: rgba(255,255,255,0.92);
499
- color: #1C1C1E;
500
- font-weight: 600;
501
- }
502
-
503
- .${i.INBOX_MENU_ITEM} {
504
- display: block;
505
- width: 100%;
506
- text-align: left;
507
- background: transparent;
508
- border: none;
509
- color: white;
510
- font-size: 13px;
511
- padding: 7px 10px;
512
- border-radius: 6px;
513
- cursor: pointer;
514
- }
515
-
516
- .${i.INBOX_MENU_ITEM}:hover {
517
- background: rgba(255,255,255,0.08);
518
- }
519
-
520
- .${i.INBOX_CLOSE},
521
- .${i.INBOX_NAV_BTN},
522
- .${i.INBOX_BACK} {
523
- display: flex;
524
- align-items: center;
525
- gap: 4px;
526
- background: transparent;
527
- border: none;
528
- color: rgba(255,255,255,0.75);
529
- cursor: pointer;
530
- padding: 4px 6px;
531
- border-radius: 6px;
532
- font-size: 14px;
533
- }
534
-
535
- .${i.INBOX_CLOSE} {
536
- font-size: 20px;
537
- line-height: 1;
538
- }
539
-
540
- .${i.INBOX_CLOSE}:hover,
541
- .${i.INBOX_NAV_BTN}:not(:disabled):hover,
542
- .${i.INBOX_BACK}:hover {
543
- background: rgba(255,255,255,0.08);
544
- color: white;
545
- }
546
-
547
- .${i.INBOX_NAV_BTN}:disabled {
548
- opacity: 0.35;
549
- cursor: default;
550
- }
551
-
552
- .${i.INBOX_LIST},
553
- .${i.INBOX_DETAIL} {
554
- flex: 1;
555
- overflow-y: auto;${de}
556
- padding: 12px;
557
- display: flex;
558
- flex-direction: column;
559
- gap: 12px;
560
- }
561
-
562
- .${i.INBOX_CARD} {
563
- border: 1px solid rgba(255,255,255,0.1);
564
- border-radius: 10px;
565
- padding: 12px;
566
- display: flex;
567
- flex-direction: column;
568
- gap: 8px;
569
- }
570
-
571
- .${i.INBOX_LIST} .${i.INBOX_CARD} {
572
- cursor: pointer;
573
- }
574
-
575
- .${i.INBOX_LIST} .${i.INBOX_CARD}:hover {
576
- border-color: rgba(255,255,255,0.22);
577
- }
578
-
579
- .${i.INBOX_CARD}--resolved {
580
- border-color: rgba(48, 209, 88, 0.4);
581
- opacity: 0.75;
582
- }
583
-
584
- .${i.INBOX_LIST} .${i.INBOX_CARD}--resolved:hover {
585
- border-color: rgba(48, 209, 88, 0.7);
586
- opacity: 1;
587
- }
588
-
589
- .${i.INBOX_CARD_HEADER} {
590
- display: flex;
591
- align-items: center;
592
- justify-content: space-between;
593
- gap: 8px;
594
- }
595
-
596
- /* Labels made the strip wide enough to overflow a narrow card in the
597
- worst case ("In progress" + "Improvement" + "Medium"), so it wraps to
598
- a second line rather than pushing the card sideways. */
599
- .${i.INBOX_CARD_ACTIONS} {
600
- display: flex;
601
- align-items: center;
602
- flex-wrap: wrap;
603
- justify-content: flex-end;
604
- gap: 6px;
605
- }
606
-
607
- .${i.INBOX_ACTION_BTN} {
608
- display: flex;
609
- align-items: center;
610
- justify-content: center;
611
- width: 24px;
612
- height: 24px;
613
- background: transparent;
614
- border: none;
615
- border-radius: 6px;
616
- color: rgba(255,255,255,0.65);
617
- cursor: pointer;
618
- }
619
-
620
- .${i.INBOX_ACTION_BTN}:hover {
621
- background: rgba(255,255,255,0.08);
622
- color: white;
623
- }
624
-
625
- /* Status/type/priority pickers show their current value as text next to
626
- the dot (colour alone can't tell bug/high apart \u2014 same hex, and
627
- there's no hover on touch). The 72px cap they used to carry is gone:
628
- the strip has its own row now, so labels show in full. */
629
- .${i.INBOX_ACTION_BTN_LABELED} {
630
- width: auto;
631
- padding: 0 8px 0 6px;
632
- gap: 5px;
633
- justify-content: flex-start;
634
- flex: none;
635
- }
636
-
637
- .${i.INBOX_ACTION_LABEL} {
638
- font-size: 11px;
639
- line-height: 1;
640
- white-space: nowrap;
641
- }
642
-
643
- .${i.INBOX_STATUS_DOT} {
644
- width: 12px;
645
- height: 12px;
646
- border-radius: 50%;
647
- border: 1.5px solid rgba(255,255,255,0.45);
648
- display: inline-block;
649
- flex: none;
650
- }
651
-
652
- .${i.INBOX_MENU_ITEM} .${i.INBOX_STATUS_DOT} {
653
- width: 9px;
654
- height: 9px;
655
- border: none;
656
- margin-right: 8px;
657
- vertical-align: baseline;
658
- }
659
-
660
- .${i.INBOX_MENU_ITEM}[aria-checked="true"] {
661
- background: rgba(255,255,255,0.08);
662
- }
663
-
664
- /* The action strip on its own row under the author. Shared by the inbox
665
- card and the thread popover so the two read the same; only the
666
- popover needs the extra top padding, since the card's column gap
667
- already spaces it. */
668
- .${i.THREAD_ACTIONS_ROW} {
669
- display: flex;
670
- justify-content: flex-end;
671
- }
672
-
673
- .${i.THREAD_POPOVER} > .${i.THREAD_ACTIONS_ROW} {
674
- padding-top: 8px;
675
- }
676
-
677
- /* Generic hover tooltip, same look as .thread-time[data-full-date] */
678
- [data-hd-tooltip] {
679
- position: relative;
680
- }
681
-
682
- [data-hd-tooltip]::after {
683
- content: attr(data-hd-tooltip);
684
- position: absolute;
685
- bottom: calc(100% + 6px);
686
- left: 50%;
687
- transform: translateX(-50%);
688
- background: #000;
689
- color: white;
690
- padding: 4px 8px;
691
- border-radius: 6px;
692
- font-size: 11px;
693
- white-space: nowrap;
694
- opacity: 0;
695
- pointer-events: none;
696
- transition: opacity 0.12s ease;
697
- z-index: 2;
698
- }
699
-
700
- [data-hd-tooltip]:hover::after {
701
- opacity: 1;
702
- }
703
-
704
- .${i.INBOX_MENU} {
705
- position: absolute;
706
- top: calc(100% + 4px);
707
- right: 0;
708
- background: #2C2C2E;
709
- border: 1px solid rgba(255,255,255,0.1);
710
- border-radius: 8px;
711
- padding: 4px;
712
- min-width: 130px;
713
- z-index: 1;
714
- box-shadow: 0 4px 16px rgba(0,0,0,0.4);
715
- }
716
-
717
- .${i.INBOX_CARD_TEXT} {
718
- white-space: pre-wrap;
719
- word-break: break-word;
720
- }
721
-
722
- .${i.INBOX_CARD_TAG} {
723
- align-self: flex-start;
724
- padding: 1px 8px;
725
- border-radius: 999px;
726
- background: rgba(255, 159, 10, 0.2);
727
- color: #FF9F0A;
728
- font-size: 11px;
729
- font-weight: 600;
730
- }
731
-
732
- .${i.INBOX_BADGES} {
733
- display: flex;
734
- flex-wrap: wrap;
735
- gap: 4px;
736
- }
737
- /* Vertical separation from the card text above only applies to the
738
- badge row on inbox cards -- inside the comment-box classify row,
739
- .inbox-badges is one flex item among the type/priority pickers and
740
- the tags input, and the classify row's own gap already spaces it
741
- from its siblings, so an extra margin here would nudge it out of
742
- alignment with them. */
743
- .${i.INBOX_CARD} .${i.INBOX_BADGES} {
744
- margin-top: 6px;
745
- }
746
- .${i.TOOLTIP} .${i.INBOX_BADGES} {
747
- margin-bottom: 4px;
748
- }
749
- .${i.BADGE} {
750
- display: inline-flex;
751
- align-items: center;
752
- padding: 1px 6px;
753
- border: 1px solid rgba(255, 255, 255, 0.18);
754
- border-radius: 10px;
755
- font-size: 10px;
756
- line-height: 1.6;
757
- letter-spacing: 0.01em;
758
- white-space: nowrap;
759
- }
760
- .${i.BADGE_STATUS},
761
- .${i.BADGE_TYPE},
762
- .${i.BADGE_PRIORITY} {
763
- font-weight: 600;
764
- }
765
- .${i.BADGE_TAG} {
766
- opacity: 0.75;
767
- }
768
- .${i.BADGE_DURATION} {
769
- opacity: 0.75;
770
- border-style: dashed;
771
- }
772
-
773
- .${i.CONTEXT_BLOCK} {
774
- display: flex;
775
- flex-direction: column;
776
- padding: 10px 12px;
777
- border-top: 1px solid rgba(255, 255, 255, 0.08);
778
- font-size: 11px;
779
- }
780
- .${i.CONTEXT_BODY} {
781
- display: flex;
782
- flex-direction: column;
783
- gap: 4px;
784
- }
785
- .${i.CONTEXT_TITLE} {
786
- font-size: 11px;
787
- font-weight: 600;
788
- color: rgba(255,255,255,0.45);
789
- padding-bottom: 4px;
790
- }
791
- /* The popover's collapsed variant. Same weight and colour as the inbox
792
- title so the two surfaces read as the same block. */
793
- .${i.CONTEXT_TOGGLE} {
794
- display: flex;
795
- align-items: center;
796
- justify-content: space-between;
797
- width: 100%;
798
- background: transparent;
799
- border: none;
800
- color: rgba(255,255,255,0.45);
801
- font-size: 11px;
802
- font-weight: 600;
803
- cursor: pointer;
804
- padding: 2px 0;
805
- }
806
- .${i.CONTEXT_TOGGLE}:hover {
807
- color: rgba(255,255,255,0.75);
808
- }
809
- .${i.CONTEXT_TOGGLE} svg {
810
- flex: none;
811
- transition: transform 0.15s ease;
812
- }
813
- .${i.CONTEXT_TOGGLE}[aria-expanded="true"] svg {
814
- transform: rotate(180deg);
815
- }
816
- .${i.CONTEXT_TOGGLE}[aria-expanded="true"] + .${i.CONTEXT_BODY} {
817
- padding-top: 8px;
818
- }
819
- .${i.CONTEXT_BLOCK} img {
820
- width: 100%;
821
- border-radius: 6px;
822
- margin-bottom: 6px;
823
- cursor: zoom-in;
824
- }
825
- .${i.CONTEXT_SCREENSHOT_CAPTION} {
826
- opacity: 0.75;
827
- }
828
- .${i.CONTEXT_ROW} {
829
- display: flex;
830
- justify-content: space-between;
831
- gap: 12px;
832
- opacity: 0.75;
833
- }
834
- /* URLs and user agents have no spaces to break on, so the value column
835
- would otherwise push the row wider than the panel. */
836
- .${i.CONTEXT_ROW} span:last-child {
837
- text-align: right;
838
- word-break: break-all;
839
- }
840
-
841
- .${i.INBOX_CARD_REPLY_LINK} {
842
- align-self: flex-start;
843
- background: transparent;
844
- border: none;
845
- color: rgba(255,255,255,0.55);
846
- font-size: 13px;
847
- cursor: pointer;
848
- padding: 0;
849
- }
850
-
851
- .${i.INBOX_CARD_REPLY_LINK}:hover {
852
- color: white;
853
- }
854
-
855
- .${i.INBOX_REPLIES} {
856
- display: flex;
857
- flex-direction: column;
858
- gap: 10px;
859
- padding: 0 4px;
860
- }
861
-
862
- /* Centred in whatever height the list has, so the state sits in the
863
- middle of the panel rather than clinging to the top. */
864
- /* Sits under the body as a quiet aside: the preview shows the root
865
- comment only, so this says "there is more" without competing with it. */
866
- .${i.TOOLTIP_REPLY_COUNT} {
867
- font-size: 12px;
868
- color: rgba(255,255,255,0.45);
869
- padding-top: 4px;
870
- }
871
-
872
- .${i.INBOX_EMPTY} {
873
- flex: 1;
874
- display: flex;
875
- flex-direction: column;
876
- align-items: center;
877
- justify-content: center;
878
- gap: 10px;
879
- padding: 32px 24px;
880
- color: rgba(255,255,255,0.55);
881
- text-align: center;
882
- }
883
-
884
- /* The marker's own silhouette, drawn as an outline: what the user is
885
- about to place, not a generic placeholder. Same border-radius as
886
- .comment-circle. */
887
- .${i.INBOX_EMPTY_ICON} {
888
- width: 44px;
889
- height: 44px;
890
- margin-bottom: 6px;
891
- border: 2px dashed rgba(255,255,255,0.25);
892
- border-radius: 0% 100% 100% 100%;
893
- flex: none;
894
- }
895
-
896
- .${i.INBOX_EMPTY_TITLE} {
897
- color: white;
898
- font-size: 14px;
899
- font-weight: 600;
900
- }
901
-
902
- .${i.INBOX_EMPTY_TEXT} {
903
- font-size: 13px;
904
- line-height: 1.5;
905
- max-width: 30ch;
906
- }
907
-
908
- .${i.INBOX_EMPTY_KBD} {
909
- font-family: inherit;
910
- font-size: 12px;
911
- font-weight: 500;
912
- color: rgba(255,255,255,0.8);
913
- background: rgba(255,255,255,0.08);
914
- border: 1px solid rgba(255,255,255,0.14);
915
- border-radius: 5px;
916
- padding: 1px 5px;
917
- white-space: nowrap;
918
- }
919
-
920
- .${i.INBOX_EMPTY_ACTION} {
921
- margin-top: 6px;
922
- background: transparent;
923
- border: 1px solid rgba(255,255,255,0.2);
924
- border-radius: 8px;
925
- color: white;
926
- font-size: 13px;
927
- font-weight: 500;
928
- padding: 8px 16px;
929
- cursor: pointer;
930
- transition: background 0.15s, border-color 0.15s;
931
- }
932
-
933
- .${i.INBOX_EMPTY_ACTION}:hover {
934
- background: rgba(255,255,255,0.08);
935
- border-color: rgba(255,255,255,0.35);
936
- }
937
-
938
- .${i.THREAD_HEADER} {
939
- display: flex;
940
- justify-content: space-between;
941
- align-items: center;
942
- padding: 0 0 0;
943
- }
944
-
945
- /* min-width:0 is what lets the author actually shrink: a flex item
946
- defaults to min-content, so without it the name pushes the row wider
947
- instead of truncating. */
948
- .${i.THREAD_META} {
949
- display: flex;
950
- align-items: center;
951
- gap: 6px;
952
- flex: 1;
953
- min-width: 0;
954
- }
955
-
956
- .${i.THREAD_AUTHOR} {
957
- font-weight: 600;
958
- font-size: 13px;
959
- overflow: hidden;
960
- text-overflow: ellipsis;
961
- white-space: nowrap;
962
- }
963
-
964
- .${i.THREAD_TIME} {
965
- font-size: 12px;
966
- color: rgba(255,255,255,0.5);
967
- cursor: default;
968
- position: relative;
969
- flex: none;
970
- }
971
-
972
- .${i.THREAD_TIME}::after {
973
- content: attr(data-full-date);
974
- position: absolute;
975
- bottom: calc(100% + 6px);
976
- left: 50%;
977
- transform: translateX(-50%);
978
- background: #000;
979
- color: white;
980
- padding: 4px 8px;
981
- border-radius: 6px;
982
- font-size: 11px;
983
- white-space: nowrap;
984
- opacity: 0;
985
- pointer-events: none;
986
- transition: opacity 0.15s ease;
987
- z-index: 1;
988
- }
989
-
990
- .${i.THREAD_TIME}:hover::after {
991
- opacity: 1;
992
- }
993
-
994
- .${i.THREAD_BODY} {
995
- padding: 8px 0;
996
- white-space: pre-wrap;
997
- word-break: break-word;
998
- }
999
-
1000
- .${i.THREAD_REPLIES} {
1001
- padding: 0;
1002
- }
1003
-
1004
- .${i.THREAD_REPLIES}:empty {
1005
- display: none;
1006
- }
1007
-
1008
- .${i.THREAD_REPLY} {
1009
- padding: 16px 0 0 0;
1010
- border-top: 1px solid rgba(255,255,255,0.1);
1011
- white-space: pre-wrap;
1012
- word-break: break-word;
1013
- font-size: 13px;
1014
- color: rgba(255,255,255,0.85);
1015
- }
1016
-
1017
- .${i.THREAD_REPLY} .${i.THREAD_META} {
1018
- margin-bottom: 2px;
1019
- }
1020
-
1021
- /* Pushed to the far edge of the reply's meta row, where the same \u22EF sits
1022
- on the comment above it. flex: none keeps it off the author's
1023
- truncation budget. */
1024
- .${i.THREAD_REPLY_ACTIONS} {
1025
- margin-left: auto;
1026
- flex: none;
1027
- }
1028
-
1029
- .${i.THREAD_REPLY} .${i.SCREENSHOT_IMG} {
1030
- width: 144px;
1031
- height: 100px;
1032
- object-fit: cover;
1033
- border-radius: 8px;
1034
- margin-top: 4px;
1035
- cursor: pointer;
1036
- display: block;
1037
- }
1038
-
1039
- .${i.THREAD_INPUT_AREA} {
1040
- display: flex;
1041
- flex-direction: column;
1042
- gap: 0;
1043
- padding: 12px 0 0;
1044
- border-top: 1px solid rgba(255,255,255,0.1);
1045
- }
1046
-
1047
- .${i.THREAD_INPUT} {
1048
- width: 100%;
1049
- background: transparent;
1050
- border: none;
1051
- padding: 0;
1052
- color: white;
1053
- font-size: 14px;
1054
- font-family: inherit;
1055
- outline: none;
1056
- box-sizing: border-box;
1057
- }
1058
-
1059
- .${i.THREAD_INPUT}::placeholder {
1060
- color: rgba(255,255,255,0.5);
1061
- }
1062
-
1063
- .${i.THREAD_INPUT}:focus {
1064
- outline: none;
1065
- box-shadow: none;
1066
- }
1067
-
1068
- .${i.THREAD_SUBMIT} {
1069
- background: none;
1070
- border: none;
1071
- color: #2E90FA;
1072
- cursor: pointer;
1073
- display: flex;
1074
- align-items: center;
1075
- justify-content: center;
1076
- border-radius: 6px;
1077
- transition: background 0.2s;
1078
- }
1079
-
1080
- .${i.THREAD_SUBMIT}:hover {
1081
- background: rgba(46, 144, 250, 0.15);
1082
- color: #1570D6;
1083
- }
1084
-
1085
- .${i.CLOSE_TOOLTIP} {
1086
- background: none;
1087
- border: none;
1088
- font-size: 18px;
1089
- cursor: pointer;
1090
- color: rgba(255,255,255,0.5);
1091
- line-height: 1;
1092
- }
1093
-
1094
- .${i.CLOSE_TOOLTIP}:hover {
1095
- color: white;
1096
- }
1097
-
1098
- .${i.PREVIEW_CIRCLE} {
1099
- animation: helldots-pulse 1.5s ease-in-out infinite;
1100
- }
1101
-
1102
- @keyframes helldots-pulse {
1103
- 0%, 100% { box-shadow: 0 0 0 0 rgba(46, 144, 250, 0.4), 0 1px 5px rgba(0,0,0,0.2); }
1104
- 50% { box-shadow: 0 0 0 8px rgba(46, 144, 250, 0), 0 1px 5px rgba(0,0,0,0.2); }
1105
- }
1106
-
1107
- .${i.COMMENT_OVERLAY} {
1108
- position: fixed;
1109
- top: 0;
1110
- left: 0;
1111
- right: 0;
1112
- bottom: 0;
1113
- background: transparent;
1114
- pointer-events: none;
1115
- z-index: ${O.TOOLBAR-1};
1116
- }
1117
-
1118
- .${i.COMMENT_OVERLAY}.${i.ACTIVE} {
1119
- pointer-events: auto;
1120
- background: rgba(0, 0, 0, 0.1);
1121
- }
1122
-
1123
- .${i.SELECTION_RECT} {
1124
- position: fixed;
1125
- border: 2px solid #2E90FA;
1126
- background: rgba(46, 144, 250, 0.1);
1127
- pointer-events: none;
1128
- z-index: ${O.TOOLTIP};
1129
- box-sizing: border-box;
1130
- }
1131
-
1132
- .${i.SCREENSHOTS_CONTAINER} {
1133
- display: none;
1134
- overflow-x: auto;
1135
- gap: 8px;
1136
- margin-top: 4px;
1137
- padding: 4px 0;
1138
- scrollbar-width: none;
1139
- -ms-overflow-style: none;
1140
- margin-bottom: 8px;
1141
- }
1142
-
1143
- .${i.SCREENSHOTS_CONTAINER}::-webkit-scrollbar {
1144
- display: none;
1145
- }
1146
-
1147
- .${i.SCREENSHOTS_CONTAINER}.${i.ACTIVE} {
1148
- display: flex;
1149
- }
1150
-
1151
- .${i.SCREENSHOT_ITEM} {
1152
- position: relative;
1153
- flex-shrink: 0;
1154
- }
1155
-
1156
- .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG} {
1157
- width: 50px;
1158
- height: 50px;
1159
- object-fit: cover;
1160
- border-radius: 8px;
1161
- cursor: pointer;
1162
- display: block;
1163
- margin: 0;
1164
- }
1165
-
1166
- .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG}:hover {
1167
- opacity: 0.85;
1168
- }
1169
-
1170
- .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_REMOVE} {
1171
- position: absolute;
1172
- top: -5px;
1173
- right: -5px;
1174
- width: 18px;
1175
- height: 18px;
1176
- background: rgba(0,0,0,0.7);
1177
- border: none;
1178
- border-radius: 50%;
1179
- color: white;
1180
- font-size: 12px;
1181
- line-height: 1;
1182
- cursor: pointer;
1183
- display: none;
1184
- align-items: center;
1185
- justify-content: center;
1186
- z-index: 1;
1187
- }
1188
-
1189
- .${i.SCREENSHOT_ITEM}:hover .${i.SCREENSHOT_REMOVE} {
1190
- display: flex;
1191
- }
1192
-
1193
- .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_REMOVE}:hover {
1194
- background: rgba(0,0,0,0.9);
1195
- }
1196
-
1197
- .${i.TOOLTIP} > .${i.SCREENSHOTS_CONTAINER} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG},
1198
- .${i.THREAD_SCROLL} > .${i.SCREENSHOTS_CONTAINER} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG},
1199
- .${i.THREAD_REPLY} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG} {
1200
- width: 144px;
1201
- height: 100px;
1202
- }
1203
-
1204
- .${i.CONFIRM} {
1205
- position: fixed;
1206
- top: 0;
1207
- left: 0;
1208
- right: 0;
1209
- bottom: 0;
1210
- background: rgba(0,0,0,0.6);
1211
- display: flex;
1212
- align-items: center;
1213
- justify-content: center;
1214
- padding: 16px;
1215
- animation: helldots-fade-in 0.15s ease;
1216
- }
1217
-
1218
- .${i.CONFIRM_PANEL} {
1219
- width: min(360px, 100%);
1220
- background: #1C1C1E;
1221
- border: 1px solid rgba(255,255,255,0.1);
1222
- border-radius: 14px;
1223
- box-shadow: 0 8px 32px rgba(0,0,0,0.5);
1224
- padding: 20px;
1225
- color: white;
1226
- font-size: 14px;
1227
- line-height: 1.5;
1228
- box-sizing: border-box;
1229
- }
1230
-
1231
- /* :host { all: initial } does not reach descendants, so the heading and
1232
- paragraph still arrive with UA margins. */
1233
- .${i.CONFIRM_TITLE} {
1234
- margin: 0 0 8px;
1235
- font-size: 15px;
1236
- font-weight: 600;
1237
- }
1238
-
1239
- .${i.CONFIRM_MESSAGE} {
1240
- margin: 0 0 20px;
1241
- font-size: 13px;
1242
- color: rgba(255,255,255,0.65);
1243
- }
1244
-
1245
- .${i.CONFIRM_ACTIONS} {
1246
- display: flex;
1247
- justify-content: flex-end;
1248
- gap: 8px;
1249
- }
1250
-
1251
- .${i.CONFIRM_CANCEL},
1252
- .${i.CONFIRM_ACCEPT} {
1253
- padding: 7px 14px;
1254
- border: 1px solid transparent;
1255
- border-radius: 8px;
1256
- font-size: 13px;
1257
- font-weight: 600;
1258
- cursor: pointer;
1259
- }
1260
-
1261
- /* The one place in the widget with visible focus rings. The dialog traps
1262
- Tab between exactly two buttons, one of them destructive, so a
1263
- keyboard user who cannot see which one is focused is being asked to
1264
- guess. Scoped here on purpose \u2014 see DECISIONS.md; it does not reopen
1265
- the rings that were reverted elsewhere for visual parity. */
1266
- .${i.CONFIRM_CANCEL}:focus-visible,
1267
- .${i.CONFIRM_ACCEPT}:focus-visible {
1268
- outline: 2px solid #2E90FA;
1269
- outline-offset: 2px;
1270
- }
1271
-
1272
- .${i.CONFIRM_CANCEL} {
1273
- background: rgba(255,255,255,0.08);
1274
- border-color: rgba(255,255,255,0.12);
1275
- color: white;
1276
- }
1277
-
1278
- .${i.CONFIRM_CANCEL}:hover {
1279
- background: rgba(255,255,255,0.14);
1280
- }
1281
-
1282
- .${i.CONFIRM_ACCEPT} {
1283
- background: #FF453A;
1284
- color: white;
1285
- }
1286
-
1287
- .${i.CONFIRM_ACCEPT}:hover {
1288
- background: #FF6961;
1289
- }
1290
-
1291
- .${i.LIGHTBOX} {
1292
- position: fixed;
1293
- top: 0;
1294
- left: 0;
1295
- right: 0;
1296
- bottom: 0;
1297
- background: rgba(0,0,0,0.92);
1298
- z-index: ${O.LIGHTBOX};
1299
- display: flex;
1300
- align-items: center;
1301
- justify-content: center;
1302
- animation: helldots-fade-in 0.2s ease;
1303
- }
1304
-
1305
- @keyframes helldots-fade-in {
1306
- from { opacity: 0; }
1307
- to { opacity: 1; }
1308
- }
1309
-
1310
- .${i.LIGHTBOX_IMG} {
1311
- max-width: 90vw;
1312
- max-height: 90vh;
1313
- object-fit: contain;
1314
- border-radius: 8px;
1315
- }
1316
-
1317
- .${i.LIGHTBOX_CLOSE} {
1318
- position: absolute;
1319
- top: 16px;
1320
- right: 16px;
1321
- background: rgba(255,255,255,0.15);
1322
- border: none;
1323
- color: white;
1324
- font-size: 24px;
1325
- width: 40px;
1326
- height: 40px;
1327
- border-radius: 50%;
1328
- cursor: pointer;
1329
- display: flex;
1330
- align-items: center;
1331
- justify-content: center;
1332
- transition: background 0.2s;
1333
- }
1334
-
1335
- .${i.LIGHTBOX_CLOSE}:hover {
1336
- background: rgba(255,255,255,0.3);
1337
- }
1338
- /* --- inline editor --- */
1339
-
1340
- .${i.EDITOR} {
1341
- display: flex;
1342
- flex-direction: column;
1343
- gap: 8px;
1344
- margin: 4px 0 2px;
1345
- }
1346
-
1347
- .${i.EDITOR_INPUT} {
1348
- width: 100%;
1349
- box-sizing: border-box;
1350
- resize: vertical;
1351
- min-height: 60px;
1352
- background: rgba(255,255,255,0.06);
1353
- border: 1px solid rgba(255,255,255,0.14);
1354
- border-radius: 8px;
1355
- padding: 8px 10px;
1356
- color: white;
1357
- font-size: 14px;
1358
- font-family: inherit;
1359
- line-height: 1.45;
1360
- outline: none;${de}
1361
- }
1362
-
1363
- .${i.EDITOR_INPUT}:focus {
1364
- border-color: rgba(46,144,250,0.7);
1365
- }
1366
-
1367
- .${i.EDITOR_ACTIONS} {
1368
- display: flex;
1369
- justify-content: flex-end;
1370
- gap: 8px;
1371
- }
1372
-
1373
- .${i.EDITOR_CANCEL},
1374
- .${i.EDITOR_SAVE} {
1375
- padding: 5px 12px;
1376
- border: 1px solid transparent;
1377
- border-radius: 7px;
1378
- font-size: 13px;
1379
- font-weight: 600;
1380
- font-family: inherit;
1381
- cursor: pointer;
1382
- }
1383
-
1384
- .${i.EDITOR_CANCEL} {
1385
- background: rgba(255,255,255,0.08);
1386
- border-color: rgba(255,255,255,0.12);
1387
- color: white;
1388
- }
1389
-
1390
- .${i.EDITOR_CANCEL}:hover {
1391
- background: rgba(255,255,255,0.14);
1392
- }
1393
-
1394
- .${i.EDITOR_SAVE} {
1395
- background: #2E90FA;
1396
- color: white;
1397
- }
1398
-
1399
- .${i.EDITOR_SAVE}:hover:not(:disabled) {
1400
- background: #57A6FB;
1401
- }
1402
-
1403
- /* Blanking a body is not a way to delete \u2014 the comment would keep its
1404
- marker, its replies and its inbox row while saying nothing. The
1405
- disabled state is carried by more than colour: the cursor changes and
1406
- the control stops responding (WCAG 1.4.1). */
1407
- .${i.EDITOR_SAVE}:disabled {
1408
- background: rgba(255,255,255,0.10);
1409
- color: rgba(255,255,255,0.4);
1410
- cursor: not-allowed;
1411
- }
1412
-
1413
- .${i.THREAD_EDITED} {
1414
- font-size: 12px;
1415
- color: rgba(255,255,255,0.4);
1416
- cursor: default;
1417
- position: relative;
1418
- flex: none;
1419
- }
1420
-
1421
- .${i.THREAD_EDITED}::before {
1422
- content: "\xB7";
1423
- margin-right: 4px;
1424
- }
1425
-
1426
- .${i.THREAD_EDITED}::after {
1427
- content: attr(data-full-date);
1428
- position: absolute;
1429
- bottom: calc(100% + 6px);
1430
- left: 50%;
1431
- transform: translateX(-50%);
1432
- background: #000;
1433
- color: white;
1434
- padding: 4px 8px;
1435
- border-radius: 6px;
1436
- font-size: 11px;
1437
- white-space: nowrap;
1438
- opacity: 0;
1439
- pointer-events: none;
1440
- transition: opacity 0.15s ease;
1441
- }
1442
-
1443
- .${i.THREAD_EDITED}:hover::after {
1444
- opacity: 1;
1445
- }
1446
-
1447
- .${i.INBOX_NOTICE} {
1448
- margin: 0 0 10px;
1449
- padding: 9px 11px;
1450
- border-radius: 8px;
1451
- background: rgba(255,255,255,0.06);
1452
- border: 1px solid rgba(255,255,255,0.12);
1453
- color: rgba(255,255,255,0.75);
1454
- font-size: 13px;
1455
- line-height: 1.4;
1456
- }
1457
- `,St=()=>`
1458
- .${i.COMMENT_CURSOR},
1459
- .${i.COMMENT_CURSOR} * {
1460
- cursor: url('${_t}') ${yt}, auto !important;
1461
- }
1462
-
1463
- `;var I={commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",filterByType:"Type",filterByPriority:"Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var Ot={commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",filterByType:"Tipo",filterByPriority:"Prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var Le={en:I,es:Ot},Be="en";function vt(){let o=(navigator.language||Be).slice(0,2).toLowerCase();return o in Le?o:Be}function At(o){return Le[o]||Le[Be]}function v(o,e){return o.replace("{n}",String(e))}var _n=6e4;function he(o,e){if(!Number.isFinite(o)||o<0)return"";let t=Math.floor(o/_n);if(t<1)return e.durationLessThanMinute;if(t<60)return v(e.minutesAgoTemplate,t);let n=Math.floor(t/60);if(n<24){let l=t%60,c=v(e.hoursAgoTemplate,n);return l?`${c} ${v(e.minutesAgoTemplate,l)}`:c}let s=Math.floor(n/24),r=n%24,a=v(e.daysAgoTemplate,s);return r?`${a} ${v(e.hoursAgoTemplate,r)}`:a}var Pe=64,yn=3,wn=5,Sn=.6,On=.7,vn=/^(css|sc|jsx|emotion)-/i,An=/^data-(reactid|react-|v-|svelte-)/,Nn=["id","name","role","aria-label"],Rn=["data-testid","name","aria-label"],De=o=>typeof CSS<"u"&&CSS.escape?CSS.escape(o):String(o).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),In=o=>String(o).replace(/["\\]/g,"\\$&"),Z=(o,e)=>{try{return e.querySelectorAll(o).length===1}catch{return!1}},It=o=>(o||"").replace(/\s+/g," ").trim().slice(0,Pe),Ln=o=>Tt.includes(o)||vn.test(o)?!1:!o.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),Bn=o=>[...o.classList].filter(Ln),Pn=o=>{let e={};for(let{name:t,value:n}of o.attributes)(Nn.includes(t)||t.startsWith("data-")&&!An.test(t))&&n&&(e[t]=n.slice(0,Pe));return e},Me=o=>{let e=o.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(n=>n.tagName===o.tagName);return{index:t.indexOf(o),count:t.length}},Dn=(o,e)=>{if(!o.id)return null;let t=`#${De(o.id)}`;return Z(t,e)?t:null},Mn=(o,e)=>{let t=o.tagName.toLowerCase();for(let n of Rn){let s=o.getAttribute(n);if(!s)continue;let r=`${t}[${n}="${In(s)}"]`;if(Z(r,e))return r}return null},$n=(o,e)=>{let t=[],n=o;for(let s=0;s<yn&&n;s++){let r=Bn(n),a=n.tagName.toLowerCase();if(t.unshift(r.length?`${a}.${r.map(De).join(".")}`:a),s===0&&!r.length)return null;let l=t.join(" > ");if(Z(l,e))return l;n=n.parentElement}return null},kn=(o,e)=>{if(o===e.body)return"body";let t=[],n=o;for(let r=0;r<wn&&n;r++){if(n===e.body){t.unshift("body");break}if(n.id){let l=[`#${De(n.id)}`,...t].join(" > ");if(Z(l,e))return l}let{index:a}=Me(n);t.unshift(`${n.tagName.toLowerCase()}:nth-of-type(${a+1})`),n=n.parentElement}let s=t.join(" > ");return Z(s,e)?s:null},Lt=(o,e)=>Dn(o,e)||Mn(o,e)||$n(o,e)||kn(o,e);function Bt(o){return Lt(o,o.ownerDocument)}function Pt(o,e,t){let n=o.ownerDocument,{index:s,count:r}=Me(o);return{version:1,selector:Lt(o,n),fingerprint:{tagName:o.tagName,textSnippet:It(o.textContent),attributes:Pn(o),siblingIndex:s,siblingCount:r},relativeX:e,relativeY:t}}var Hn=(o,e)=>{if(!o&&!e)return 1;if(!o||!e)return 0;if(o===e)return 1;if(o.startsWith(e)||e.startsWith(o))return .8;let t=new Set(o.split(" ")),n=new Set(e.split(" ")),s=0;for(let r of t)n.has(r)&&s++;return 2*s/(t.size+n.size)},Xn=(o,e)=>{let t=Object.keys(e);if(!t.length)return 1;let n=0;for(let s of t)(o.getAttribute(s)||"").slice(0,Pe)===e[s]&&n++;return n/t.length},Nt=(o,e)=>{let{index:t,count:n}=Me(o),s=Math.abs(t-e.siblingIndex),r=Math.max(e.siblingCount,n,1);return Math.max(0,1-s/r)},Fn=(o,e)=>{if(o.tagName!==e.tagName)return 0;let t=!!e.textSnippet,n=Object.keys(e.attributes||{}).length>0,s=.5,r=.3,a=.2;return n?t||(r+=s,s=0):(s+=r,r=0),!t&&!n?Nt(o,e):s*Hn(It(o.textContent),e.textSnippet)+r*Xn(o,e.attributes||{})+a*Nt(o,e)},Rt=(o,e)=>{let t=null;for(let n of o){let s=Fn(n,e);(!t||s>t.confidence)&&(t={element:n,confidence:s})}return t};function Dt(o,e=document){let t=o?.fingerprint;if(!t||!t.tagName)return null;if(o.selector){let a=[];try{a=[...e.querySelectorAll(o.selector)]}catch{}let l=Rt(a,t);if(l&&l.confidence>=Sn)return l}if(!(!!t.textSnippet||Object.keys(t.attributes||{}).length>0))return null;let s;try{s=[...e.querySelectorAll(t.tagName)]}catch{return null}let r=Rt(s,t);return r&&r.confidence>=On?r:null}var $t="helldots-comments",pe="helldots-pending-detail";function ue(){try{let o=localStorage.getItem($t);if(!o)return[];let e=JSON.parse(o);return Array.isArray(e)?e:[]}catch(o){return console.warn("HellDots: could not read stored comments",o),[]}}function Mt(o){try{return localStorage.setItem($t,JSON.stringify(o)),!0}catch{return!1}}function $e(o){if(Mt(o))return!0;let e=o.map((s,r)=>({comment:s,index:r})).filter(({comment:s})=>s?.contextScreenshot).sort((s,r)=>{let a=Date.parse(s.comment.createdAt),l=Date.parse(r.comment.createdAt);return Number.isFinite(a)&&Number.isFinite(l)&&a!==l?a-l:s.index-r.index});if(e.length===0)return console.warn("HellDots: could not persist comments (storage quota exceeded, nothing left to shed)"),!1;let t=[...o],n=0;for(let{index:s}of e)if(t[s]={...t[s],contextScreenshot:null},n++,Mt(t))return console.warn(`HellDots: localStorage quota exceeded \u2014 dropped the automatic context screenshot from the ${n} oldest comment(s) to keep all comments persisted. Comment text, replies and user-attached screenshots were not touched.`),!0;return console.warn(`HellDots: could not persist comments even after dropping all ${n} automatic context screenshot(s); storage quota exceeded`),!1}function ke(o,e,t){let n=new Set(e.map(r=>r.id));return[...o.filter(r=>!n.has(r.id)&&r.page!==t),...e]}var kt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ht=(o=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(o|=0));for(;o--;)e+=kt[t[o]&63];return e};var He=()=>Ht();var me="helldotsComment",J=(o,e=me,t=location.href)=>{let n=new URL(t),s=o.page||n.pathname,r=s===n.pathname?n:new URL(s,n);return r.searchParams.set(e,String(o.id)),r.href},Xt=(o=me,e=location.href)=>{try{return new URL(e).searchParams.get(o)}catch{return null}};var Q=new Set,X=null,Ft=(o,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(o)||o.contains(e.target),Un=()=>{X||(X=o=>{for(let e of[...Q])Ft(e.menu,o)||Ft(e.button,o)||e.close()},document.addEventListener("mousedown",X,!0))},Vn=()=>{X&&(document.removeEventListener("mousedown",X,!0),X=null)},ge=()=>{for(let o of[...Q])o.close()},ee=(o,e)=>{let t={button:o,menu:e,close:()=>{e.style.display="none",o.setAttribute("aria-expanded","false"),Q.delete(t),Q.size===0&&Vn()}},n=()=>{ge(),e.style.display="block",o.setAttribute("aria-expanded","true"),Q.add(t),Un()},s=()=>e.style.display!=="none";return e.style.display="none",o.setAttribute("aria-expanded","false"),o.addEventListener("click",r=>{r.stopPropagation();let a=s();ge(),a||n()}),{open:n,close:t.close,isOpen:s}};var Xe=new Set,Ut=()=>{for(let o of[...Xe])o(!1)},fe=(o,{title:e,message:t,confirmLabel:n,cancelLabel:s})=>new Promise(r=>{let a=document.createElement("div");a.className=i.CONFIRM,a.style.zIndex=String(O.CONFIRM);let l=document.createElement("div");l.className=i.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=i.CONFIRM_TITLE,c.textContent=e,c.id=`hd-confirm-title-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-labelledby",c.id);let h=document.createElement("p");h.className=i.CONFIRM_MESSAGE,h.textContent=t;let d=document.createElement("div");d.className=i.CONFIRM_ACTIONS;let p=document.createElement("button");p.type="button",p.className=i.CONFIRM_CANCEL,p.textContent=s;let m=document.createElement("button");m.type="button",m.className=i.CONFIRM_ACCEPT,m.textContent=n,d.appendChild(p),d.appendChild(m),l.appendChild(c),l.appendChild(h),l.appendChild(d),a.appendChild(l);let u=o.activeElement||document.activeElement,g=!1,f=E=>{g||(g=!0,Xe.delete(f),document.removeEventListener("keydown",b,!0),a.remove(),u?.focus?.(),r(E))},b=E=>{if(E.key==="Escape"){E.stopPropagation(),E.preventDefault(),f(!1);return}if(E.key!=="Tab")return;let T=[p,m],w=o.activeElement||document.activeElement,_=T.indexOf(w);E.preventDefault(),(E.shiftKey?T[(_<=0?T.length:_)-1]:T[(_+1)%T.length]).focus()};p.addEventListener("click",()=>f(!1)),m.addEventListener("click",()=>f(!0));let C=!1;a.addEventListener("mousedown",E=>{C=E.target===a,E.stopPropagation()}),a.addEventListener("click",E=>{E.target===a&&C&&f(!1),C=!1}),Xe.add(f),document.addEventListener("keydown",b,!0),(o.body||o).appendChild(a),p.focus()});var Vt='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',Gn='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',zn='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></svg>',U=o=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(o).catch(()=>{});let e=document.createElement("textarea");e.value=o,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},V=(o,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,resolved:e.statusResolved})[o]||e.statusOpen,M=(o,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[o]||e.unset,$=(o,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[o]||e.unset,F=({action:o,options:e,value:t,colorOf:n,labelOf:s,tooltipLabel:r,onSelect:a,showLabel:l=!1})=>{let c=document.createElement("div");c.style.position="relative";let h=document.createElement("button");h.type="button",h.className=i.INBOX_ACTION_BTN,l&&h.classList.add(i.INBOX_ACTION_BTN_LABELED),h.dataset.action=o,h.setAttribute("aria-haspopup","true");let d=document.createElement("span");d.className=i.INBOX_STATUS_DOT,h.appendChild(d);let p=null;l&&(p=document.createElement("span"),p.className=i.INBOX_ACTION_LABEL,h.appendChild(p));let m=document.createElement("div");m.className=i.INBOX_MENU,m.setAttribute("role","menu");let u=ee(h,m),g=t,f=()=>{let b=`${r}: ${s(g)}`;d.style.backgroundColor=n(g),h.dataset.hdTooltip=b,h.setAttribute("aria-label",b),p&&(p.textContent=s(g)),m.querySelectorAll("[data-picker-option]").forEach(C=>{let x=C.dataset.pickerOption,E=x===""?null:x;C.setAttribute("aria-checked",String(E===g))})};for(let b of e){let C=document.createElement("button");C.type="button",C.className=i.INBOX_MENU_ITEM,C.dataset.pickerOption=b===null?"":b,C.setAttribute("role","menuitemradio");let x=document.createElement("span");x.className=i.INBOX_STATUS_DOT,x.style.backgroundColor=n(b),C.appendChild(x),C.appendChild(document.createTextNode(s(b))),C.addEventListener("click",E=>{E.stopPropagation(),u.close(),b!==g&&(g=b,a(b),f())}),m.appendChild(C)}return c.appendChild(h),c.appendChild(m),f(),c},Fe=({label:o,tooltip:e,items:t})=>{let n=document.createElement("div");n.style.position="relative";let s=document.createElement("button");s.type="button",s.className=i.INBOX_ACTION_BTN,s.dataset.action="menu",e&&(s.dataset.hdTooltip=e),s.setAttribute("aria-label",o),s.innerHTML=zn;let r=document.createElement("div");r.className=i.INBOX_MENU,r.setAttribute("role","menu");let a=ee(s,r);for(let l of t){let c=document.createElement("button");c.type="button",c.className=i.INBOX_MENU_ITEM,c.setAttribute("role","menuitem"),c.textContent=l.label,c.addEventListener("click",async h=>{if(h.stopPropagation(),l.feedbackLabel){l.onSelect(),c.textContent=l.feedbackLabel,setTimeout(()=>{c.textContent=l.label,a.close()},1200);return}if(a.close(),l.confirm){let d=c.getRootNode();if(!await fe(d,l.confirm()))return}l.onSelect()}),r.appendChild(c)}return n.appendChild(s),n.appendChild(r),n},Ee=(o,{strings:e,onCopy:t,onCopyLink:n,onEdit:s,onSetStatus:r,onSetType:a,onSetPriority:l,onDelete:c})=>{let h=document.createElement("div");h.className=i.INBOX_CARD_ACTIONS;let d=document.createElement("button");return d.type="button",d.className=i.INBOX_ACTION_BTN,d.dataset.action="copy",d.dataset.hdTooltip=e.copyAgentContext,d.setAttribute("aria-label",e.copyAgentContext),d.innerHTML=Vt,d.addEventListener("click",p=>{p.stopPropagation(),t(o),d.innerHTML=Gn,d.dataset.hdTooltip=e.copied,setTimeout(()=>{d.innerHTML=Vt,d.dataset.hdTooltip=e.copyAgentContext},1500)}),h.appendChild(d),h.appendChild(F({action:"status",options:D,value:o.status||"open",colorOf:p=>ce[p]||"",labelOf:p=>V(p,e),tooltipLabel:e.statusLabel,onSelect:p=>r(o,p),showLabel:!0})),h.appendChild(F({action:"type",options:[null,...N],value:o.type||null,colorOf:p=>q[p]||"transparent",labelOf:p=>M(p,e),tooltipLabel:e.typeLabel,onSelect:p=>a?.(o,p),showLabel:!0})),h.appendChild(F({action:"priority",options:[null,...R],value:o.priority||null,colorOf:p=>K[p]||"transparent",labelOf:p=>$(p,e),tooltipLabel:e.priorityLabel,onSelect:p=>l?.(o,p),showLabel:!0})),h.appendChild(Fe({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>n?.(o)},{label:e.editComment,onSelect:()=>s?.(o)},{label:e.deleteComment,onSelect:()=>c(o),confirm:()=>({title:e.confirmDeleteCommentTitle,message:o.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),h};var G=({value:o,strings:e,onInput:t,onSave:n,onCancel:s})=>{let r=document.createElement("div");r.className=i.EDITOR;let a=document.createElement("textarea");a.className=i.EDITOR_INPUT,a.value=o,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=i.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=i.EDITOR_CANCEL,c.textContent=e.editCancel;let h=document.createElement("button");h.type="button",h.className=i.EDITOR_SAVE,h.textContent=e.editSave;let d=()=>{h.disabled=a.value.trim().length===0};return d(),a.addEventListener("input",()=>{d(),t(a.value)}),a.addEventListener("keydown",p=>{if(p.key==="Escape"){p.stopPropagation(),p.preventDefault(),s();return}p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&!h.disabled&&(p.preventDefault(),n(a.value))}),c.addEventListener("click",p=>{p.stopPropagation(),s()}),h.addEventListener("click",p=>{p.stopPropagation(),h.disabled||n(a.value)}),l.appendChild(c),l.appendChild(h),r.appendChild(a),r.appendChild(l),queueMicrotask(()=>{a.focus(),a.setSelectionRange(a.value.length,a.value.length)}),r},be=(o,e)=>fe(o,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var Yn=(o,e)=>{let t=Date.now()-new Date(o).getTime(),n=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return n<1?e.justNow:n<60?v(e.minutesAgoTemplate,n):s<24?v(e.hoursAgoTemplate,s):v(e.daysAgoTemplate,r)},zt=(o,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(o)),te=(o,e,t,n,s=null)=>{let r=document.createElement("div");r.className=i.THREAD_META;let a=document.createElement("span");a.className=i.THREAD_AUTHOR,a.textContent=o||t.anonymous;let l=document.createElement("span");return l.className=i.THREAD_TIME,l.textContent=Yn(e,t),l.dataset.fullDate=zt(e,n),r.appendChild(a),r.appendChild(l),s&&r.appendChild(Ue(s,t,n)),r},Ue=(o,e,t)=>{let n=document.createElement("span");return n.className=i.THREAD_EDITED,n.textContent=e.editedMark,n.dataset.fullDate=e.editedAtPrefix+zt(o,t),n},Ve=(o,e)=>{let t=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),n={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:"\u21E7"},s=n[o.shortcutModifier]||n.alt,r=o.shortcutKey?.toUpperCase()||"C";return`${s} + ${r}`},Wn='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',jn='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2L15 22L11 13M11 13L2 9L22 2"/></svg>',qn='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.8914 10.4028L2.98327 10.6318C3.22909 11.2445 3.5 12.1045 3.5 13C3.5 13.3588 3.4564 13.7131 3.38773 14.0495C3.69637 13.9446 4.01409 13.8159 4.32918 13.6584C4.87888 13.3835 5.33961 13.0611 5.70994 12.7521L6.22471 12.3226L6.88809 12.4196C7.24851 12.4724 7.61994 12.5 8 12.5C11.7843 12.5 14.5 9.85569 14.5 7C14.5 4.14431 11.7843 1.5 8 1.5C4.21574 1.5 1.5 4.14431 1.5 7C1.5 8.18175 1.94229 9.29322 2.73103 10.2153L2.8914 10.4028ZM2.8135 15.7653C1.76096 16 1 16 1 16C1 16 1.43322 15.3097 1.72937 14.4367C1.88317 13.9834 2 13.4808 2 13C2 12.3826 1.80733 11.7292 1.59114 11.1903C0.591845 10.0221 0 8.57152 0 7C0 3.13401 3.58172 0 8 0C12.4183 0 16 3.13401 16 7C16 10.866 12.4183 14 8 14C7.54721 14 7.10321 13.9671 6.67094 13.9038C6.22579 14.2753 5.66881 14.6656 5 15C4.23366 15.3832 3.46733 15.6195 2.8135 15.7653Z"/></svg>',Kn='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.67705 7.5L3.92705 3H12.0729L14.3229 7.5H10H9.25V8.25C9.25 8.94036 8.69036 9.5 8 9.5C7.30964 9.5 6.75 8.94036 6.75 8.25V7.5H6H1.67705ZM1.5 9V12C1.5 12.5523 1.94772 13 2.5 13H13.5C14.0523 13 14.5 12.5523 14.5 12V9H10.6465C10.32 10.1543 9.25878 11 8 11C6.74122 11 5.67998 10.1543 5.35352 9H1.5ZM3 1.5H13L15.8944 7.28885C15.9639 7.42771 16 7.58082 16 7.73607V12C16 13.3807 14.8807 14.5 13.5 14.5H2.5C1.11929 14.5 0 13.3807 0 12V7.73607C0 7.58082 0.0361451 7.42771 0.105573 7.28885L3 1.5Z"/></svg>',Ce=({areaClassName:o,inputTag:e="textarea",inputClassName:t,inputId:n,inputPlaceholder:s,submitBtnId:r,fileInputId:a},l)=>{let c=document.createElement("div");c.className=o;let h=document.createElement(e);n&&(h.id=n),t&&(h.className=t),h.placeholder=s,h.setAttribute("aria-label",s),e==="input"&&(h.type="text");let d=document.createElement("div");d.className=i.SCREENSHOTS_CONTAINER;let p=document.createElement("div");p.className=i.COMMENT_ACTIONS_BAR;let m=document.createElement("button");m.className=i.ATTACH_IMAGE_BTN,m.type="button",m.setAttribute("aria-label",l.attachImage),m.innerHTML=Wn;let u=document.createElement("input");u.type="file",a&&(u.id=a),u.accept="image/*",u.style.display="none";let g=document.createElement("button");return r&&(g.id=r),g.className=i.THREAD_SUBMIT,g.type="button",g.setAttribute("aria-label",l.send),g.innerHTML=jn,p.appendChild(m),p.appendChild(u),p.appendChild(g),c.appendChild(h),c.appendChild(d),c.appendChild(p),{container:c,inputEl:h,screenshotsContainer:d,attachBtn:m,fileInput:u,submitBtn:g}},Gt=(o,e,t,n)=>{let s=document.createElement("div");s.className=i.TOOLBAR_ACTION_WRAPPER;let r=document.createElement("div");r.className=i.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>r.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${i.TOOLBAR_ACTION_BTN} ${o}`,a.setAttribute("aria-label",n),a.innerHTML=e,s.appendChild(r),s.appendChild(a),s},Yt=(o={},e=I)=>{let t=document.createElement("div");t.id=y.TOOLBAR;let n=document.createElement("div");n.className=i.TOOLBAR_ACTIONS;let s=document.createElement("span");s.className=i.TOOLBAR_TEXT,s.textContent=e.toolbarComment;let r=document.createElement("span");r.className=i.SHORTCUT_HINT,r.textContent=Ve(o,e);let a=Gt(i.TOOLBAR_COMMENT_BTN,qn,[s,r],e.toolbarComment);a.querySelector(`.${i.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=i.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=Gt(i.TOOLBAR_MENU_BTN,Kn,[l],e.toolbarInbox);return n.appendChild(a),n.appendChild(c),t.appendChild(n),t},Ge=(o,e,{includeStatus:t=!1,includeClassification:n=!0}={})=>{let s=document.createElement("div");s.className=i.INBOX_BADGES;let r=(a,l,c)=>{let h=document.createElement("span");h.className=`${i.BADGE} ${l}`,h.textContent=a,c&&(h.style.borderColor=c),s.appendChild(h)};if(t){let a=o.status||"open";r(V(a,e),i.BADGE_STATUS,ce[a])}n&&o.type&&r(M(o.type,e),i.BADGE_TYPE,q[o.type]),n&&o.priority&&r($(o.priority,e),i.BADGE_PRIORITY,K[o.priority]);for(let a of o.tags||[])r(a,i.BADGE_TAG,null);if(o.status==="resolved"){let a=o.resolvedAt?he(new Date(o.resolvedAt).getTime()-new Date(o.createdAt).getTime(),e):"";r(v(e.resolvedInTemplate,a||"\u2014"),i.BADGE_DURATION,null)}return s.children.length?s:null},Zn=o=>{let e=document.createElement("div");e.className=i.CLASSIFY_ROW;let t=null,n=null,s=()=>{e.replaceChildren(),e.appendChild(F({action:"type",options:[null,...N],value:null,colorOf:r=>q[r]||"transparent",labelOf:r=>M(r,o),tooltipLabel:o.typeLabel,onSelect:r=>t=r,showLabel:!0})),e.appendChild(F({action:"priority",options:[null,...R],value:null,colorOf:r=>K[r]||"transparent",labelOf:r=>$(r,o),tooltipLabel:o.priorityLabel,onSelect:r=>n=r,showLabel:!0}))};return s(),{container:e,getType:()=>t,getPriority:()=>n,reset:()=>{t=null,n=null,s()}}},Wt=(o=I)=>{let e=document.createElement("div");e.id=y.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",o.commentBoxAriaLabel);let{container:t}=Ce({areaClassName:i.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:y.COMMENT_INPUT,inputPlaceholder:o.commentPlaceholder,submitBtnId:y.SUBMIT_COMMENT,fileInputId:y.ATTACH_IMAGE_INPUT},o),n=Zn(o);return e.appendChild(n.container),e.appendChild(t),e.style.display="none",e.classify=n,e},jt=(o,e=I)=>{let t=document.createElement("div");return t.className=i.CIRCLE,t.dataset.commentId=o.id,t.dataset.commentText=o.text,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${o.text}`),t.style.cssText=`
1464
- position: absolute;
1465
- pointer-events: auto;
1466
- `,t},oe=(o,e)=>{let t=document.createElement("div");return t.className=i.SCREENSHOTS_CONTAINER,t.classList.add(i.ACTIVE),o.forEach(n=>{let s=document.createElement("div");s.className=i.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=i.SCREENSHOT_IMG,r.src=n,r.alt=e.attachedScreenshot,s.appendChild(r),t.appendChild(s)}),t},qt=(o,e=I,t)=>{let n=document.createElement("div");n.className=i.TOOLTIP,n.dataset.for=o.id,n.setAttribute("role","dialog"),n.setAttribute("aria-label",e.tooltipAriaLabel);let s=document.createElement("div");s.className=i.THREAD_HEADER;let r=te(o.author,o.createdAt,e,t,o.editedAt),a=document.createElement("button");a.type="button",a.className=i.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="&times;",s.appendChild(r),s.appendChild(a);let l=document.createElement("div");l.className=i.THREAD_BODY,l.textContent=o.text,n.appendChild(s),n.appendChild(l);let c=Ge(o,e,{includeStatus:!0});c&&n.appendChild(c);let h=o.screenshots||(o.screenshot?[o.screenshot]:[]);h.length>0&&n.appendChild(oe(h,e));let d=o.replies?.length||0;if(d>0){let p=document.createElement("div");p.className=i.TOOLTIP_REPLY_COUNT,p.textContent=d===1?e.replyCountOne:v(e.replyCountTemplate,d),n.appendChild(p)}return n},ne=(o,e=I,t,{onDelete:n,onEdit:s,editing:r=null}={})=>{let a=document.createElement("div");a.className=i.THREAD_REPLY,a.dataset.replyId=String(o.id);let l=te(o.author,o.timestamp,e,t,o.editedAt),c=[];if(s&&c.push({label:e.editReply,onSelect:()=>s(o)}),n&&c.push({label:e.deleteReply,onSelect:()=>n(o,a),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}),c.length>0){let p=Fe({label:e.replyOptions,items:c});p.classList.add(i.THREAD_REPLY_ACTIONS),l.appendChild(p)}let h;r?h=G({value:r.draft,strings:e,onInput:r.onInput,onSave:r.onSave,onCancel:r.onCancel}):(h=document.createElement("div"),h.className=i.THREAD_BODY,h.textContent=o.text),a.appendChild(l),a.appendChild(h);let d=o.screenshots||(o.screenshot?[o.screenshot]:[]);return d.length>0&&a.appendChild(oe(d,e)),a},Kt=(o,e=I,t,{onDeleteReply:n,onEditReply:s}={})=>{let r=document.createElement("div");r.className=i.THREAD_POPOVER,r.dataset.for=o.id,r.setAttribute("role","dialog"),r.setAttribute("aria-label",e.popoverAriaLabel);let a=document.createElement("div");a.className=i.THREAD_HEADER;let l=te(o.author,o.createdAt,e,t,o.editedAt),c=document.createElement("button");c.type="button",c.className=i.CLOSE_TOOLTIP,c.setAttribute("aria-label",e.close),c.innerHTML="&times;",a.appendChild(l),a.appendChild(c);let h=document.createElement("div");h.className=i.THREAD_BODY,h.textContent=o.text;let d=document.createElement("div");d.className=i.THREAD_REPLIES,o.replies&&o.replies.forEach(g=>{d.appendChild(ne(g,e,t,{onDelete:n,onEdit:s}))});let{container:p}=Ce({areaClassName:i.THREAD_INPUT_AREA,inputTag:"input",inputClassName:i.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=i.THREAD_SCROLL,r.appendChild(a),m.appendChild(h);let u=o.screenshots||(o.screenshot?[o.screenshot]:[]);return u.length>0&&m.appendChild(oe(u,e)),m.appendChild(d),r.appendChild(m),r.appendChild(p),r};var Jn=o=>{let e=[...o.attributes].map(({name:t,value:n})=>`${t}="${n}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},Qn=o=>{if(!o?.tagName)return"(unknown)";let e=Object.entries(o.attributes||{}).map(([t,n])=>`${t}="${n}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},ei=o=>{let e=[],t=o;for(;t&&t!==document.documentElement;){let n=t.tagName.toLowerCase(),s=t.id?`#${t.id}`:"",r=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${n}${s}${r}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function Te(o,{viewportWidth:e,viewportHeight:t,strings:n}){let s=o.anchor,r=s?.fingerprint,a=o.container?.isConnected?o.container:null,l=o.hidden?"hidden":o.anchorState,c=a?Jn(a):Qn(r),h=a?ei(a):"(unavailable)",d=o.context?.viewport,p=d?.width??e,m=d?.height??t,u=[`Page: ${o.page}`,`Viewport: ${p}x${m}`,`Anchor state: ${l}`,`Status: ${o.status||"open"}`,`Selector: ${s?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${h}`,`Nearby text: "${r?.textSnippet??""}"`,`Comment by ${o.author} (${o.createdAt}):`,`"${o.text}"`];o.type&&u.push(`Type: ${o.type}`),o.priority&&u.push(`Priority: ${o.priority}`),o.tags?.length&&u.push(`Tags: ${o.tags.join(", ")}`);let g=o.context;if(g&&(g.url&&u.push(`URL: ${g.url}`),g.screen&&u.push(`Screen: ${g.screen.width}x${g.screen.height}`),g.browser?.name&&u.push(`Browser: ${`${g.browser.name} ${g.browser.version||""}`.trim()}`),g.os?.name&&u.push(`OS: ${`${g.os.name} ${g.os.version||""}`.trim()}`)),n&&o.status==="resolved"&&o.resolvedAt){let b=he(new Date(o.resolvedAt).getTime()-new Date(o.createdAt).getTime(),n);b&&u.push(`Resolution time: ${b}`)}let f=o.replies||[];if(f.length>0){u.push(`Replies (${f.length}):`);for(let b of f)u.push(`- ${b.author}: "${b.text}"`)}return u.join(`
1467
- `)}var ti='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',xe=(o,{strings:e,onShowLightbox:t,collapsible:n=!1})=>{let{context:s,contextScreenshot:r}=o;if(!s&&!r)return null;let a=document.createElement("div");a.className=i.CONTEXT_BLOCK;let l=document.createElement("div");if(l.className=i.CONTEXT_BODY,n){let c=document.createElement("button");c.type="button",c.className=i.CONTEXT_TOGGLE,c.setAttribute("aria-expanded","false"),c.innerHTML=`<span>${e.contextSection}</span>${ti}`,l.style.display="none",c.addEventListener("click",h=>{h.stopPropagation();let d=c.getAttribute("aria-expanded")==="true";c.setAttribute("aria-expanded",String(!d)),l.style.display=d?"none":""}),a.appendChild(c)}else{let c=document.createElement("div");c.className=i.CONTEXT_TITLE,c.textContent=e.contextSection,a.appendChild(c)}if(r){let c=document.createElement("div");c.className=i.CONTEXT_SCREENSHOT_CAPTION,c.textContent=e.autoScreenshotLabel,l.appendChild(c);let h=document.createElement("img");h.className=i.SCREENSHOT_IMG,h.src=r,h.alt=e.autoScreenshotLabel,h.addEventListener("click",d=>{d.stopPropagation(),t(r)}),l.appendChild(h)}if(s){let c=(p,m)=>{if(!m)return;let u=document.createElement("div");u.className=i.CONTEXT_ROW;let g=document.createElement("span");g.textContent=p;let f=document.createElement("span");f.textContent=m,u.appendChild(g),u.appendChild(f),l.appendChild(u)},h=p=>p?`${p.width}\xD7${p.height}`:"",d=p=>p?.name?`${p.name} ${p.version||""}`.trim():"";c(e.contextUrl,s.url),c(e.contextViewport,h(s.viewport)),c(e.contextScreen,h(s.screen)),c(e.contextBrowser,d(s.browser)),c(e.contextOs,d(s.os))}return a.appendChild(l),a};var oi='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',ni='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',ii='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="18 15 12 9 6 15"/></svg>',ri='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',_e=class{constructor({shadowRoot:e,strings:t,locale:n,currentPage:s,getComments:r,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=n,this.currentPage=s,this.getComments=r,this.callbacks=a,this.options=l,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.editing=null,this.notice=null,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=i.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.shadowRoot.appendChild(this.el),this.render())}close(){this._clearHighlight(),this._setActiveMarker(null),this.el?.remove(),this.el=null,this.detailId=null,this.editing=null,this.notice=null}refresh(){this.el&&this.render()}showNotice(e){this.notice=e,this.refresh()}clearNotice(){this.notice&&(this.notice=null,this.refresh())}isDirty(){return this.editing?this.editing.draft.trim()!==this._editingOriginalText().trim():!1}_editingOriginalText(){if(!this.editing)return"";let e=this.getComments().find(n=>String(n.id)===String(this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(n=>String(n.id)===String(this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await be(e,this.strings))return!1}return this.editing=null,!0}_editorHandlers(){return{draft:this.editing.draft,onInput:e=>{this.editing.draft=e},onSave:e=>{let{commentId:t,replyId:n}=this.editing;n==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,n,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return G({value:e.draft,strings:this.strings,onInput:e.onInput,onSave:e.onSave,onCancel:e.onCancel})}async startEditing(e,t=null){await this.releaseEditor()&&(this.detailId=e,this.editing={commentId:e,replyId:t,draft:""},this.editing.draft=this._editingOriginalText(),this.render())}_markerFor(e){return e.anchorState!=="anchored"||e.hidden||e.status==="resolved"?null:this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`)}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(i.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(i.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(i.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(i.CIRCLE_ACTIVE),this._activeMarkerEl=t)}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter!=="all"&&(e=e.filter(t=>(t.status||"open")===this.statusFilter)),this.typeFilter!=="all"&&(e=e.filter(t=>t.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(t=>t.priority===this.priorityFilter)),[...e.filter(t=>t.status!=="resolved"),...e.filter(t=>t.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight(),this.el.innerHTML="";let e=this.filteredComments(),t=this.detailId!=null?e.find(n=>n.id===this.detailId):null;this._setActiveMarker(t),t?this._renderDetail(t,e):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(n=>n.id===e);t&&this._openDetail(t)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render()}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=i.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="&times;",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_renderList(e){let t=document.createElement("div");t.className=i.INBOX_HEADER,t.appendChild(this._buildFilter()),t.appendChild(this._closeButton()),this.el.appendChild(t);let n=document.createElement("div");if(n.className=i.INBOX_LIST,this.el.appendChild(n),this.notice){let s=document.createElement("div");s.className=i.INBOX_NOTICE,s.setAttribute("role","status"),s.textContent=this.notice,n.appendChild(s)}if(e.length===0){n.appendChild(this._buildEmptyState());return}for(let s of e)n.appendChild(this._buildCard(s,{interactive:!0}))}_buildEmptyState(){let e=document.createElement("div");e.className=i.INBOX_EMPTY;let t=document.createElement("div");t.className=i.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let n=this.getComments().length>0,s=document.createElement("div");if(s.className=i.INBOX_EMPTY_TITLE,s.textContent=n?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(s),n){let d=document.createElement("button");return d.type="button",d.className=i.INBOX_EMPTY_ACTION,d.textContent=this.strings.filterClear,d.addEventListener("click",()=>{this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}),e.appendChild(d),e}let r=document.createElement("div");r.className=i.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=i.INBOX_EMPTY_KBD,c.textContent=Ve(this.options,this.strings),r.appendChild(document.createTextNode(a??"")),r.appendChild(c),r.appendChild(document.createTextNode(l??"")),e.appendChild(r);let h=document.createElement("button");return h.type="button",h.className=i.INBOX_EMPTY_ACTION,h.textContent=this.strings.inboxEmptyAction,h.addEventListener("click",()=>this.callbacks.onActivateCommentMode()),e.appendChild(h),e}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(V(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(M(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push($(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_isFilterActive(){return this.pageFilter!=="page"||this.statusFilter!=="all"||this.typeFilter!=="all"||this.priorityFilter!=="all"}_buildFilterGroup({title:e,dataAttr:t,values:n,labelOf:s,selected:r,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=i.INBOX_FILTER_GROUP;let h=document.createElement("div");h.className=i.INBOX_FILTER_SECTION,h.textContent=e,c.appendChild(h);let d=document.createElement("div");d.className=i.INBOX_FILTER_CHIPS;for(let p of n){let m=r===p,u=document.createElement("button");u.type="button",u.className=i.INBOX_FILTER_CHIP,u.dataset[t]=p,u.setAttribute("role",a?"switch":"radio"),u.setAttribute("aria-checked",String(m)),u.textContent=s(p),u.addEventListener("click",g=>{g.stopPropagation(),l(a&&m?"all":p),this.render()}),d.appendChild(u)}return c.appendChild(d),c}_buildFilter(){let e=document.createElement("div");e.className=i.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=i.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${oi}`;let n=document.createElement("div");n.className=i.INBOX_FILTER_MENU,n.setAttribute("role","group"),n.setAttribute("aria-label",this.strings.filterTitle),ee(t,n);let s=document.createElement("div");s.className=i.INBOX_FILTER_MENU_HEADER;let r=document.createElement("span");r.textContent=this.strings.filterTitle,s.appendChild(r);let a=document.createElement("button");return a.type="button",a.className=i.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}),s.appendChild(a),n.appendChild(s),n.appendChild(this._buildFilterGroup({title:this.strings.filterByPage,dataAttr:"filterPage",values:["page","all"],labelOf:l=>this._pageFilterLabel(l),selected:this.pageFilter,toggles:!1,onSelect:l=>this.pageFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...D],labelOf:l=>V(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...N],labelOf:l=>M(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...R],labelOf:l=>$(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(n),e}_buildCard(e,{interactive:t}){let n=document.createElement("div");n.className=i.INBOX_CARD,e.status==="resolved"&&n.classList.add(`${i.INBOX_CARD}--resolved`),n.dataset.commentId=e.id;let s=document.createElement("div");s.className=i.INBOX_CARD_HEADER,s.appendChild(te(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),n.appendChild(s);let r=document.createElement("div");if(r.className=i.THREAD_ACTIONS_ROW,r.appendChild(this._buildCardActions(e)),n.appendChild(r),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))n.appendChild(this._buildEditor());else{let h=document.createElement("div");h.className=i.INBOX_CARD_TEXT,h.textContent=e.text,n.appendChild(h)}if(e.screenshots?.length){let h=oe(e.screenshots,this.strings);h.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(d=>{d.addEventListener("click",p=>{p.stopPropagation(),this.callbacks.onShowLightbox(d.src)})}),n.appendChild(h)}let l=Ge(e,this.strings,{includeClassification:!1});l&&n.appendChild(l);let c=this._buildTag(e);if(c&&n.appendChild(c),t){n.setAttribute("role","button"),n.setAttribute("tabindex","0");let h=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),d=document.createElement("button");d.type="button",d.className=i.INBOX_CARD_REPLY_LINK,d.textContent=this.strings.replyLink,d.addEventListener("click",p=>{p.stopPropagation(),h()}),n.appendChild(d),n.addEventListener("click",h),n.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),h())}),n.addEventListener("mouseenter",()=>this._highlight(e)),n.addEventListener("mouseleave",()=>this._clearHighlight())}return n}_buildTag(e){let t=null;if(e.anchorState==="orphaned"?t=this.strings.orphanedBadge:e.hidden?t=this.strings.hiddenBadge:e.anchorState==="inactive"&&(t=e.page),!t)return null;let n=document.createElement("span");return n.className=i.INBOX_CARD_TAG,n.textContent=t,n}_buildCardActions(e){return Ee(e,{strings:this.strings,onCopy:t=>U(Te(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>U(J(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,n)=>this.callbacks.onSetStatus(t.id,n),onSetType:(t,n)=>this.callbacks.onSetType(t.id,n),onSetPriority:(t,n)=>this.callbacks.onSetPriority(t.id,n),onDelete:t=>{this.detailId===t.id&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let n=t.indexOf(e),s=document.createElement("div");s.className=i.INBOX_DETAIL_HEADER;let r=document.createElement("button");r.type="button",r.className=i.INBOX_BACK,r.innerHTML=`${ni}<span>${this.strings.back}</span>`,r.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.detailId=null,this.render())}),s.appendChild(r);let a=document.createElement("div");a.className=i.INBOX_CARD_ACTIONS;let l=(p,m,u)=>{let g=document.createElement("button");g.type="button",g.className=i.INBOX_NAV_BTN,g.setAttribute("aria-label",m),g.title=m,g.innerHTML=p;let f=t[u];return g.disabled=!f,f&&g.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(f)}),g};a.appendChild(l(ii,this.strings.prevComment,n-1)),a.appendChild(l(ri,this.strings.nextComment,n+1)),a.appendChild(this._closeButton()),s.appendChild(a),this.el.appendChild(s);let c=document.createElement("div");c.className=i.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let h=xe(e,{strings:this.strings,onShowLightbox:p=>this.callbacks.onShowLightbox(p)});h&&c.appendChild(h);let d=document.createElement("div");d.className=i.INBOX_REPLIES;for(let p of e.replies||[]){let m=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(p.id),u=ne(p,this.strings,this.locale,{onDelete:(g,f)=>{this.callbacks.onDeleteReply(e.id,g.id)&&f.remove()},onEdit:g=>this.startEditing(e.id,g.id),editing:m?this._editorHandlers():null});u.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(g=>{g.addEventListener("click",f=>{f.stopPropagation(),this.callbacks.onShowLightbox(g.src)})}),d.appendChild(u)}c.appendChild(d),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:n,screenshotsContainer:s,attachBtn:r,fileInput:a,submitBtn:l}=Ce({areaClassName:i.THREAD_INPUT_AREA,inputTag:"input",inputClassName:i.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],h=()=>{s.innerHTML="",s.classList.toggle(i.ACTIVE,c.length>0),c.forEach((p,m)=>{let u=document.createElement("div");u.className=i.SCREENSHOT_ITEM;let g=document.createElement("img");g.className=i.SCREENSHOT_IMG,g.src=p,g.alt=this.strings.attachedScreenshot,g.onclick=()=>this.callbacks.onShowLightbox(p);let f=document.createElement("button");f.type="button",f.className=i.SCREENSHOT_REMOVE,f.setAttribute("aria-label",this.strings.removeScreenshot),f.innerHTML="&times;",f.onclick=b=>{b.stopPropagation(),c.splice(m,1),h()},u.appendChild(g),u.appendChild(f),s.appendChild(u)})};r.addEventListener("click",()=>a.click()),a.addEventListener("change",p=>{let m=p.target.files[0];if(!m||c.length>=5)return;let u=new FileReader;u.onload=g=>{c.push(g.target.result),h()},u.readAsDataURL(m),a.value=""});let d=()=>{let p=n.value.trim();!p&&c.length===0||(this.callbacks.onReply(e,p,[...c]),c=[],this.render())};return l.addEventListener("click",d),n.addEventListener("keydown",p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),d())}),t}};var si=o=>{let e=new Set;for(let t of o){let n=String(t).trim().toLowerCase();n&&e.add(n)}return[...e]},ze=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,...e},this.locale=this.options.locale||vt(),this.strings=At(this.locale),this.resizeObservers=new Map,this.mutationObservers=new Map,this.positionValidationEnabled=!0,this._pendingRaf=null,this._pendingContextScreenshot=null,this._popoverEditing=null,this._pendingDetailId=null,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.initOverlay()):this.initOverlay()}initOverlay(){this.shadowRoot=gt(),this.toolbar=Yt(this.options,this.strings),this.commentBox=Wt(this.strings),this.overlay=document.createElement("div"),this.overlay.className=i.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${i.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${i.TOOLBAR_MENU_BTN}`),this.submitButton=this.shadowRoot.getElementById(y.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(y.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${i.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(y.ATTACH_IMAGE_INPUT),this.bindEventListeners(),this.setupKeyboardShortcut(),this.setupResizeHandlers(),this.injectStyles(),this._pendingDetailId=this._readPendingDetailId(),this.options.persistence==="localStorage"&&this.loadComments(ue()),this._openPendingDetail()}_navigateTo(e){location.assign(e)}_readPendingDetailId(){let e=Xt(this._linkParam()),t=null;try{t=sessionStorage.getItem(pe),t!=null&&sessionStorage.removeItem(pe)}catch{}return e??t}_linkParam(){return this.options.linkParam||me}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this.comments.find(n=>String(n.id)===String(e));if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound);return}this._pendingDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_popoverBodyEl(e=null){let t=this.activeThreadPopover;return t?e==null?t.querySelector(`.${i.THREAD_SCROLL} > .${i.THREAD_BODY}, .${i.THREAD_SCROLL} > .${i.EDITOR}`):t.querySelector(`.${i.THREAD_REPLY}[data-reply-id="${e}"]`)?.querySelector(`.${i.THREAD_BODY}, .${i.EDITOR}`)||null:null}_refreshCommentViews(e,t=null){if(this.activeThreadPopover?.dataset.for!==String(e))return;let n=this.comments.find(l=>String(l.id)===String(e));if(!n)return;let s=t==null?n:(n.replies||[]).find(l=>String(l.id)===String(t));if(!s)return;let r=document.createElement("div");r.className=i.THREAD_BODY,r.textContent=s.text,this._popoverBodyEl(t)?.replaceWith(r);let a=t==null?this.activeThreadPopover.querySelector(`.${i.THREAD_META}`):this.activeThreadPopover.querySelector(`.${i.THREAD_REPLY}[data-reply-id="${t}"]`)?.querySelector(`.${i.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${i.THREAD_EDITED}`)){let l=Ue(s.editedAt,this.strings,this.locale),c=a.querySelector(`.${i.THREAD_REPLY_ACTIONS}`);c?a.insertBefore(l,c):a.appendChild(l)}}_popoverEditorDirty(){if(!this._popoverEditing)return!1;let{commentId:e,replyId:t,draft:n}=this._popoverEditing,s=this.comments.find(a=>String(a.id)===String(e)),r=t==null?s:(s?.replies||[]).find(a=>String(a.id)===String(t));return n.trim()!==String(r?.text||"").trim()}async _releasePopoverEditor(){if(!this._popoverEditing)return!0;if(this._popoverEditorDirty()){let t=this.shadowRoot;if(!await be(t,this.strings))return!1}let{replyId:e}=this._popoverEditing;return this._popoverEditing=null,this._restorePopoverBody(e),!0}_restorePopoverBody(e){let t=this.comments.find(r=>String(r.id)===String(this.activeThreadPopover?.dataset.for));if(!t)return;let n=e==null?t:(t.replies||[]).find(r=>String(r.id)===String(e));if(!n)return;let s=document.createElement("div");s.className=i.THREAD_BODY,s.textContent=n.text,this._popoverBodyEl(e)?.replaceWith(s)}async _startPopoverEditing(e,t=null){if(!await this._releasePopoverEditor())return;let n=this.comments.find(a=>String(a.id)===String(e)),s=t==null?n:(n?.replies||[]).find(a=>String(a.id)===String(t));if(!s)return;this._popoverEditing={commentId:e,replyId:t,draft:s.text};let r=G({value:s.text,strings:this.strings,onInput:a=>{this._popoverEditing.draft=a},onSave:a=>{let l=t==null?this.editComment(e,a):this.editReply(e,t,a);this._popoverEditing=null,l?(this._refreshCommentViews(e,t),this.inboxView?.isOpen()&&this.inboxView.refresh()):this._restorePopoverBody(t)},onCancel:()=>{this._releasePopoverEditor()}});this._popoverBodyEl(t)?.replaceWith(r)}commentLink(e){let t=this.comments.find(n=>String(n.id)===String(e));return t?J(t,this._linkParam()):null}_syncStorage(){this.options.persistence==="localStorage"&&$e(ke(ue(),this.serializeComments(),location.pathname))}bindEventListeners(){this.commentBtn.addEventListener("click",()=>this.toggleCommentMode()),this.inboxBtn.addEventListener("click",()=>this.toggleInbox()),this.submitButton.addEventListener("click",()=>this.saveComment()),this.commentInput.addEventListener("keydown",e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.saveComment())}),this.attachImageBtn.addEventListener("click",()=>{this.attachImageInput.click()}),this.attachImageInput.addEventListener("change",e=>{let t=e.target.files[0];if(!t||(this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length>=5))return;let n=new FileReader;n.onload=s=>{this._pendingScreenshots.push(s.target.result),this._updateScreenshotsPreview()},n.readAsDataURL(t),this.attachImageInput.value=""}),this._handleDocumentClickBound=e=>this.handleDocumentClick(e),document.addEventListener("mousedown",this._handleDocumentClickBound)}setupKeyboardShortcut(){this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=e=>{if(e.key==="Escape"){this._activeLightbox?this.closeLightbox():this.activeThreadPopover?this._popoverEditing?this._releasePopoverEditor():this.closeThreadPopover():this.inboxView?.isOpen()?this.inboxView.editing?this.inboxView.releaseEditor().then(r=>r&&this.inboxView?.refresh()):this.closeInbox():this.commentBox.style.display!=="none"?(this.hideCommentBox(),this.toggleCommentMode()):this.commentMode&&this.toggleCommentMode();return}let t=this.isMac&&e.altKey&&(e.key==="\xE7"||e.key==="\xC7"),n=!this.isMac&&e.altKey&&e.key.toLowerCase()==="c",s=e.key.toLowerCase()===this.options.shortcutKey.toLowerCase()&&(this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey);if(t||n||s)return e.preventDefault(),e.stopPropagation(),this.toggleCommentMode(),!1},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let t=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(t)||t?.closest?.(`.${i.CIRCLE}`)||t?.closest?.(`.${i.TOOLTIP}`)||t?.closest?.(`.${i.THREAD_POPOVER}`)||t?.closest?.(`.${i.INBOX_PANEL}`)||t?.closest?.(`.${i.LIGHTBOX}`))&&!this.commentBox.contains(t)){if(this.commentBox.style.display!=="none"){this.hideCommentBox(),this.toggleCommentMode();return}e.button===0&&(e.preventDefault(),this._dragStart={x:e.clientX,y:e.clientY},this._isDragging=!1,this._boundDragMove=n=>this._onDragMove(n),this._boundDragEnd=n=>this._onDragEnd(n),document.addEventListener("mousemove",this._boundDragMove),document.addEventListener("mouseup",this._boundDragEnd))}}_onDragMove(e){let t=e.clientX-this._dragStart.x,n=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,n)<5)return;this._isDragging=!0;let s=Math.min(this._dragStart.x,e.clientX),r=Math.min(this._dragStart.y,e.clientY),a=Math.abs(t),l=Math.abs(n);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=i.SELECTION_RECT,this.shadowRoot.appendChild(this._selectionRect)),this._selectionRect.style.left=`${s}px`,this._selectionRect.style.top=`${r}px`,this._selectionRect.style.width=`${a}px`,this._selectionRect.style.height=`${l}px`}async _onDragEnd(e){if(document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._isDragging){let t=Math.min(this._dragStart.x,e.clientX),n=Math.min(this._dragStart.y,e.clientY),s=Math.abs(e.clientX-this._dragStart.x),r=Math.abs(e.clientY-this._dragStart.y);if(this._selectionRect?.remove(),this._selectionRect=null,s>10&&r>10)try{this._pendingScreenshots||(this._pendingScreenshots=[]);let a=await Re(()=>Ne({scale:1})),l=Et(a,{left:t,top:n,width:s,height:r});l&&this._pendingScreenshots.length<5&&this._pendingScreenshots.push(l),this.options.autoScreenshot&&(this._pendingContextScreenshot=Ie(a,{sourceScale:1}))}catch(a){console.warn("Screenshot capture failed:",a)}await this._placeCommentAtPoint(e.clientX,e.clientY)}else await this._placeCommentAtPoint(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}async _placeCommentAtPoint(e,t){if(this.options.autoScreenshot&&!this._pendingContextScreenshot)try{let d=await Re(()=>Ne({scale:le}));this._pendingContextScreenshot=Ie(d,{sourceScale:le})}catch(d){console.warn("HellDots: automatic screenshot failed",d),this._pendingContextScreenshot=null}let n=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let s=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=n||"";let r=s?.closest?.(xt.CONTAINER)||document.body,a=r.getBoundingClientRect(),l=a.width>0?(e-a.left)/a.width:0,c=a.height>0?(t-a.top)/a.height:0,h=Pt(r,l,c);h.targetSelector=s&&s!==r?Bt(s):null,this.currentPosition={container:r,relativeX:l,relativeY:c,anchor:h,target:s||r},this.createPreviewCircle(e,t),document.body.classList.remove(i.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${i.SCREENSHOTS_CONTAINER}`);if(e){if(e.innerHTML="",!this._pendingScreenshots||this._pendingScreenshots.length===0){e.classList.remove(i.ACTIVE);return}e.classList.add(i.ACTIVE),this._pendingScreenshots.forEach((t,n)=>{let s=document.createElement("div");s.className=i.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=i.SCREENSHOT_IMG,r.src=t,r.alt=this.strings.attachedScreenshot,r.onclick=()=>this.showLightbox(t);let a=document.createElement("button");a.type="button",a.className=i.SCREENSHOT_REMOVE,a.setAttribute("aria-label",this.strings.removeScreenshot),a.innerHTML="&times;",a.onclick=l=>{l.stopPropagation(),this._pendingScreenshots.splice(n,1),this._updateScreenshotsPreview()},s.appendChild(r),s.appendChild(a),e.appendChild(s)})}}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${i.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(i.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let s=28/2,r=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),h=c.width||400,d=e+s,p=t+s,m=d+r,u=p-s;m+h>a&&(m=d-r-h),m=Math.min(m,a-h-10),m=Math.max(10,m),u+c.height>l&&(u=l-c.height-10),u=Math.max(10,u),this.commentBox.style.left=`${m}px`,this.commentBox.style.top=`${u}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._pendingContextScreenshot=null,this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(i.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),this.commentBtn?.classList.toggle(i.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(i.ACTIVE,this.commentMode),document.body.classList.toggle(i.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox()}saveComment(){if(!this.commentInput.value.trim()||!this.currentPosition)return;let e={text:this.commentInput.value,container:this.currentPosition.container,relativeX:this.currentPosition.relativeX,relativeY:this.currentPosition.relativeY,anchor:this.currentPosition.anchor,anchorState:"anchored",target:this.currentPosition.target,hidden:!1,status:"open",page:location.pathname,id:He(),replies:[],author:this.options.user?.name||this.strings.anonymous,createdAt:new Date().toISOString(),screenshots:this._pendingScreenshots?[...this._pendingScreenshots]:[],type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:[],resolvedAt:null,context:Ct(),contextScreenshot:this._pendingContextScreenshot};this.comments.push(e),this._syncStorage(),this.options.onCommentCreated?.(this._serializeComment(e)),this.renderCommentCircle(e),this.hideCommentBox(),this.toggleCommentMode();let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&this.showThreadPopover(t,e)}renderCommentCircle(e){let t=jt(e,this.strings);t.addEventListener("mouseenter",()=>this.showCommentTooltip(t,e)),t.addEventListener("mouseleave",()=>{setTimeout(()=>{let n=this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${e.id}"]`);n&&!n.matches(":hover")&&n.remove()},250)}),t.addEventListener("click",n=>{n.stopPropagation();let s=this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${e.id}"]`);if(s&&s.remove(),this.activeThreadPopover?.dataset.for===String(e.id)){this.closeThreadPopover();return}this.showThreadPopover(t,e)}),t.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t.click())}),this.overlay.appendChild(t),this.updateCommentPosition(e,t),this.createResizeObserver(e,t),this.createMutationObserver(e)}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${i.THREAD_POPOVER}[data-for="${t.id}"]`)||this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${t.id}"]`))return;let r=qt(t,this.strings,this.locale);this.shadowRoot.appendChild(r),r.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(a=>{a.addEventListener("click",l=>{l.stopPropagation(),this.showLightbox(a.src)})}),setTimeout(()=>{this.positionPopoverAtCircle(r,e)},10),r.querySelector(`.${i.CLOSE_TOOLTIP}`).addEventListener("click",a=>{a.stopPropagation(),r.remove()}),r.addEventListener("mouseleave",()=>r.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new _e({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:{onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onReply:(e,t,n)=>this.addReply(e,t,n),onDelete:e=>this.deleteComment(e),onDeleteReply:(e,t)=>this.deleteReply(e,t),onEditComment:(e,t)=>{this.editComment(e,t)&&this._refreshCommentViews(e)},onEditReply:(e,t,n)=>{this.editReply(e,t,n)&&this._refreshCommentViews(e)},onSetStatus:(e,t)=>this.setCommentStatus(e,t),onSetType:(e,t)=>this.setCommentType(e,t),onSetPriority:(e,t)=>this.setCommentPriority(e,t),onNavigateToPage:e=>{try{sessionStorage.setItem(pe,String(e.id))}catch{}this._navigateTo(e.page)},onShowLightbox:e=>this.showLightbox(e),onClose:()=>this.closeInbox()}})),this.inboxView.open(),setTimeout(()=>{this._inboxClickHandler=e=>{let t=e.composedPath()[0]||e.target;if(!this.inboxView.el?.contains(t)&&!this.inboxBtn.contains(t)&&!this._isInsideLightbox(t)){if(this.inboxView.isDirty())return;this.closeInbox()}},document.addEventListener("mousedown",this._inboxClickHandler)},0)}closeInbox(){this.inboxView?.close(),this._inboxClickHandler&&(document.removeEventListener("mousedown",this._inboxClickHandler),this._inboxClickHandler=null)}showThreadPopover(e,t){this.closeThreadPopover();let n=this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${t.id}"]`);n&&n.remove(),e?.classList.add(i.CIRCLE_ACTIVE),this._activePopoverCircle=e||null;let s=(E,T)=>{this.deleteReply(t.id,E.id)&&(T.remove(),this.inboxView?.isOpen()&&this.inboxView.refresh())},r=Kt(t,this.strings,this.locale,{onDeleteReply:s,onEditReply:E=>this._startPopoverEditing(t.id,E.id)});this.shadowRoot.appendChild(r);let a=r.querySelector(`.${i.THREAD_HEADER}`),l=Ee(t,{strings:this.strings,onCopy:E=>U(Te(E,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:E=>U(J(E,this._linkParam())),onEdit:E=>this._startPopoverEditing(E.id),onSetStatus:(E,T)=>this.setCommentStatus(E.id,T),onSetType:(E,T)=>this.setCommentType(E.id,T),onSetPriority:(E,T)=>this.setCommentPriority(E.id,T),onDelete:E=>{this.closeThreadPopover(),this.deleteComment(E.id),this.inboxView?.isOpen()&&this.inboxView.refresh()}}),c=document.createElement("div");c.className=i.THREAD_ACTIONS_ROW,c.appendChild(l),a.insertAdjacentElement("afterend",c);let h=r.querySelector(`.${i.THREAD_SCROLL} > .${i.SCREENSHOTS_CONTAINER}`);h&&h.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(E=>{E.addEventListener("click",T=>{T.stopPropagation(),this.showLightbox(E.src)})});let d=xe(t,{strings:this.strings,onShowLightbox:E=>this.showLightbox(E),collapsible:!0});d&&r.querySelector(`.${i.THREAD_REPLIES}`).before(d),setTimeout(()=>{e?this.positionPopoverAtCircle(r,e):this.centerPopover(r)},10),r.querySelector(`.${i.CLOSE_TOOLTIP}`).addEventListener("click",async E=>{E.stopPropagation(),!(this._popoverEditing&&!await this._releasePopoverEditor())&&this.closeThreadPopover()});let p=r.querySelector(`.${i.THREAD_INPUT}`),m=r.querySelector(`.${i.THREAD_SUBMIT}`),u=r.querySelector(`.${i.THREAD_INPUT_AREA} .${i.ATTACH_IMAGE_BTN}`),g=r.querySelector(`.${i.THREAD_INPUT_AREA} input[type="file"]`),f=r.querySelector(`.${i.THREAD_INPUT_AREA} .${i.SCREENSHOTS_CONTAINER}`),b=[],C=()=>{if(f.innerHTML="",b.length===0){f.classList.remove(i.ACTIVE);return}f.classList.add(i.ACTIVE),b.forEach((E,T)=>{let w=document.createElement("div");w.className=i.SCREENSHOT_ITEM;let _=document.createElement("img");_.className=i.SCREENSHOT_IMG,_.src=E,_.alt=this.strings.attachedScreenshot,_.onclick=()=>this.showLightbox(E);let S=document.createElement("button");S.className=i.SCREENSHOT_REMOVE,S.innerHTML="&times;",S.onclick=P=>{P.stopPropagation(),b.splice(T,1),C()},w.appendChild(_),w.appendChild(S),f.appendChild(w)})};u.addEventListener("click",()=>{g.click()}),g.addEventListener("change",E=>{let T=E.target.files[0];if(!T||b.length>=5)return;let w=new FileReader;w.onload=_=>{b.push(_.target.result),C()},w.readAsDataURL(T),g.value=""});let x=()=>{let E=p.value.trim();if(!E&&b.length===0)return;let T=this.addReply(t,E,b.length>0?[...b]:[]),w=r.querySelector(`.${i.THREAD_REPLIES}`),_=ne(T,this.strings,this.locale,{onDelete:s});w.appendChild(_),_.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(P=>{P.addEventListener("click",Jt=>{Jt.stopPropagation(),this.showLightbox(P.src)})});let S=r.querySelector(`.${i.THREAD_SCROLL}`);S&&(S.scrollTop=S.scrollHeight),p.value="",b=[],C(),p.focus()};m.addEventListener("click",x),p.addEventListener("keydown",E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),x())}),this.activeThreadPopover=r,typeof ResizeObserver<"u"&&(this._popoverResizeObserver=new ResizeObserver(()=>this._repositionThreadPopover()),this._popoverResizeObserver.observe(r)),setTimeout(()=>p.focus(),50),setTimeout(()=>{this._threadClickHandler=E=>{let T=E.composedPath()[0]||E.target;if(!r.contains(T)&&!e?.contains(T)&&!this._isInsideLightbox(T)){if(this._popoverEditorDirty())return;this.closeThreadPopover()}},document.addEventListener("mousedown",this._threadClickHandler)},0)}closeThreadPopover(){this.shadowRoot?.querySelectorAll(`.${i.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(i.CIRCLE_ACTIVE)),this._popoverResizeObserver?.disconnect(),this._popoverResizeObserver=null,this._popoverEditing=null,this.activeThreadPopover&&(this.activeThreadPopover.remove(),this.activeThreadPopover=null),this._activePopoverCircle=null,this._threadClickHandler&&(document.removeEventListener("mousedown",this._threadClickHandler),this._threadClickHandler=null)}showLightbox(e){this.closeLightbox();let t=document.createElement("div");t.className=i.LIGHTBOX;let n=document.createElement("img");n.className=i.LIGHTBOX_IMG,n.src=e,n.alt=this.strings.screenshotPreview;let s=document.createElement("button");s.type="button",s.className=i.LIGHTBOX_CLOSE,s.setAttribute("aria-label",this.strings.close),s.innerHTML="&times;",s.addEventListener("click",()=>this.closeLightbox()),t.appendChild(n),t.appendChild(s),t.addEventListener("click",r=>{r.target===t&&this.closeLightbox()}),this.shadowRoot.appendChild(t),this._activeLightbox=t}closeLightbox(){this._activeLightbox?.remove(),this._activeLightbox=null}_isInsideLightbox(e){return!!e?.closest?.(`.${i.LIGHTBOX}`)}addReply(e,t,n=[]){e.replies||(e.replies=[]);let s={id:He(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:n};return e.replies.push(s),this._syncStorage(),this.options.onReplyAdded?.(this._serializeComment(e),this._serializeReply(s)),s}deleteReply(e,t){let n=this.comments.find(a=>a.id===e),s=n?.replies?.findIndex(a=>a.id===t)??-1;if(s<0)return!1;let[r]=n.replies.splice(s,1);return this._syncStorage(),this.options.onReplyDeleted?.(this._serializeComment(n),this._serializeReply(r)),!0}editComment(e,t){let n=this.comments.find(r=>String(r.id)===String(e)),s=String(t??"").trim();return!n||!s||s===n.text?!1:(n.text=s,n.editedAt=new Date().toISOString(),this._syncStorage(),this.options.onCommentEdited?.(this._serializeComment(n)),!0)}editReply(e,t,n){let s=this.comments.find(l=>String(l.id)===String(e)),r=s?.replies?.find(l=>String(l.id)===String(t)),a=String(n??"").trim();return!r||!a||a===r.text?!1:(r.text=a,r.editedAt=new Date().toISOString(),this._syncStorage(),this.options.onReplyEdited?.(this._serializeComment(s),this._serializeReply(r)),!0)}_serializeReply({id:e,text:t,author:n,timestamp:s,screenshots:r,editedAt:a}){return{id:e,text:t,author:n,timestamp:s,screenshots:r||[],editedAt:a||null}}_serializeComment(e){return{id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),author:e.author,createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!D.includes(t))return!1;let n=this.comments.find(r=>r.id===e);if(!n)return!1;if(n.status===t)return!0;n.status=t,n.resolvedAt=t==="resolved"?new Date().toISOString():null;let s=this.shadowRoot?.querySelector(`[data-comment-id="${e}"]`);return s&&this.updateCommentPosition(n,s),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this.options.onCommentStatusChanged?.(this._serializeComment(n)),!0}_commitUpdate(e){return this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this.options.onCommentUpdated?.(this._serializeComment(e)),!0}setCommentType(e,t){if(t!==null&&!N.includes(t))return!1;let n=this.comments.find(s=>s.id===e);return n?(n.type=t,this._commitUpdate(n)):!1}setCommentPriority(e,t){if(t!==null&&!R.includes(t))return!1;let n=this.comments.find(s=>s.id===e);return n?(n.priority=t,this._commitUpdate(n)):!1}setCommentTags(e,t){if(!Array.isArray(t))return!1;let n=this.comments.find(s=>s.id===e);return n?(n.tags=si(t),this._commitUpdate(n)):!1}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){return this.comments.some(t=>t.id===e)?(this._removeComment(e),this.options.persistence==="localStorage"&&$e(ke(ue().filter(t=>t.id!==e),this.serializeComments(),location.pathname)),this.options.onCommentDeleted?.(e),!0):!1}_removeComment(e){if(this.cleanupResizeObserver(e),this.mutationObservers.has(e)){try{this.mutationObservers.get(e).disconnect()}catch{}this.mutationObservers.delete(e)}this.shadowRoot.querySelector(`[data-comment-id="${e}"]`)?.remove(),this.comments=this.comments.filter(t=>t.id!==e)}loadComments(e){let t=0,n=0,s=0;if(!Array.isArray(e))return{anchored:t,orphaned:n,inactive:s};for(let r of e){if(!r||r.id==null||typeof r.text!="string"){console.warn("HellDots: skipping malformed serialized comment",r);continue}this._removeComment(r.id);let a={id:r.id,text:r.text,editedAt:r.editedAt||null,anchor:r.anchor||null,anchorState:"orphaned",target:null,hidden:!1,page:r.page||location.pathname,container:null,relativeX:0,relativeY:0,replies:Array.isArray(r.replies)?[...r.replies]:[],author:r.author||this.strings.anonymous,createdAt:r.createdAt||new Date().toISOString(),screenshots:Array.isArray(r.screenshots)?[...r.screenshots]:[],status:r.status==="closed"?"resolved":D.includes(r.status)?r.status:"open",type:N.includes(r.type)?r.type:null,priority:R.includes(r.priority)?r.priority:null,tags:Array.isArray(r.tags)?[...r.tags]:[],resolvedAt:r.resolvedAt||null,context:r.context||null,contextScreenshot:r.contextScreenshot||null};if(r.page&&r.page!==location.pathname){a.anchorState="inactive",this.comments.push(a),s++;continue}let l=r.anchor?Dt(r.anchor):null;l?(a.container=l.element,a.relativeX=r.anchor.relativeX,a.relativeY=r.anchor.relativeY,a.anchorState="anchored",this.comments.push(a),this.renderCommentCircle(a),t++):(this.comments.push(a),n++,this.options.onAnchorLost?.(this._serializeComment(a)))}return this._openPendingDetail(),{anchored:t,orphaned:n,inactive:s}}centerPopover(e){let t=e.getBoundingClientRect(),n=Math.max(10,(window.innerWidth-(t.width||400))/2),s=Math.max(10,(window.innerHeight-t.height)/2);e.style.left=`${n}px`,e.style.bottom="auto",e.style.top=`${s}px`}scrollMarkerIntoView(e){let t=this._markerViewportY(e);t!=null&&window.scrollTo({top:Math.max(0,window.scrollY+t-window.innerHeight/2)})}_markerViewportY(e){let t=e.container;if(!t?.isConnected)return null;let n=t.getBoundingClientRect();if(n.height<=0)return null;let s=28,r=Math.max(0,Math.min(e.relativeY*n.height,n.height-s));return n.top+r+s/2}_repositionThreadPopover(){let e=this.activeThreadPopover;!e||e.style.display==="none"||(this._activePopoverCircle?this.positionPopoverAtCircle(e,this._activePopoverCircle):this.centerPopover(e))}syncThreadPopoverToMarker(){let e=this.activeThreadPopover,t=this._activePopoverCircle;if(!e||!t)return;let n=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&n.bottom>0&&n.right>0&&n.top<window.innerHeight&&n.left<window.innerWidth)){e.style.display="none";return}e.style.display="",this.positionPopoverAtCircle(e,t)}positionPopoverAtCircle(e,t){let n=t.getBoundingClientRect(),s=n.left+n.width/2,r=n.top+n.height/2,a=28,l=a/2+10,c=e.getBoundingClientRect(),h=c.width||400,d=s+l;d+h>window.innerWidth&&(d=s-l-h),d=Math.min(d,window.innerWidth-h-10),d=Math.max(10,d),e.style.left=`${d}px`;let p=10,m=r-a/2,u=window.innerHeight-p-m;c.height>u?(e.style.top="auto",e.style.bottom=`${p}px`):(e.style.bottom="auto",e.style.top=`${Math.max(p,m)}px`)}createPreviewCircle(e,t){this.removePreviewCircle();let n=document.createElement("div");n.className=`${i.CIRCLE} ${i.PREVIEW_CIRCLE}`,n.style.position="absolute";let s=14;n.style.left=`${e+s}px`,n.style.top=`${t+s}px`,n.style.transform="translate(-50%, -50%)",n.style.pointerEvents="none",this.overlay.appendChild(n),this.previewCircle=n}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){if(this.resizeObservers&&this.resizeObservers.has(e)){let{circle:t,observer:n}=this.resizeObservers.get(e);n&&n.disconnect(),t&&t.parentNode&&t.parentNode.removeChild(t),this.resizeObservers.delete(e)}}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let n=e.container.getBoundingClientRect(),s=n.width,r=n.height;if(s<=0||r<=0)return null;let a=e.relativeX*s,l=e.relativeY*r,c=28,h=Math.max(0,Math.min(a,s-c)),d=Math.max(0,Math.min(l,r-c)),p=h/s,m=d/r;return{absoluteX:h,absoluteY:d,relativeX:p,relativeY:m,containerWidth:s,containerHeight:r,containerLeft:n.left,containerTop:n.top}}_isAnchorTargetVisible(e){let t=e.target;if((!t||!t.isConnected)&&e.anchor?.targetSelector){try{t=document.querySelector(e.anchor.targetSelector)}catch{t=null}e.target=t||null}if(!t||!t.isConnected)return!0;let n=t.getBoundingClientRect();return n.width>0&&n.height>0}_isMarkerOccluded(e,t,n){if(typeof document.elementsFromPoint!="function"||t<0||n<0||t>=window.innerWidth||n>=window.innerHeight)return!1;let r=document.elementsFromPoint(t,n).find(c=>c.tagName.toLowerCase()!==B.toLowerCase());if(!r)return!1;let a=e.target?.isConnected?e.target:null;if(a&&(a.contains(r)||r.contains(a)))return!1;let l=e.container;if(!l?.isConnected)return!1;if(!l.contains(r)&&!r.contains(l))return!0;if(l.contains(r)&&r!==l){for(let c=r;c&&c!==l;c=c.parentElement)if(this._looksLikeModalLayer(c,a))return!0}return!1}_looksLikeModalLayer(e,t){if(t&&e.contains(t))return!1;if(e.matches?.('dialog, [aria-modal="true"], [role="dialog"]'))return!0;if(getComputedStyle(e).position!=="fixed")return!1;let n=e.getBoundingClientRect();return n.width>=window.innerWidth*.5&&n.height>=window.innerHeight*.5}_dismissMarkerUi(e){this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${e.id}"]`)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}updateCommentPosition(e,t){if(e.status==="resolved"){t&&(t.style.display="none");return}let n=this.validateAndCalculatePosition(e,t);n&&!this._isAnchorTargetVisible(e)&&(n=null);let s=e.hidden===!0;if(!n){t&&e.container&&(e.hidden=!0,t.style.display="none",this._dismissMarkerUi(e),!s&&this.inboxView?.isOpen()&&this.inboxView.refresh());return}let r=14,a=n.containerLeft+n.absoluteX+r,l=n.containerTop+n.absoluteY+r;if(this._isMarkerOccluded(e,a,l)){e.hidden=!0,t.style.display="none",this._dismissMarkerUi(e),!s&&this.inboxView?.isOpen()&&this.inboxView.refresh();return}e.hidden=!1,t.style.display="",s&&this.inboxView?.isOpen()&&this.inboxView.refresh(),t.style.left=`${a}px`,t.style.top=`${l}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=n.relativeX,e.relativeY=n.relativeY}setupResizeHandlers(){this.scheduleUpdatePositions=()=>{this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.positionValidationEnabled&&this.comments.forEach(e=>{let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&this.updateCommentPosition(e,t)}),this.syncThreadPopoverToMarker()}))},this.windowResizeHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("resize",this.windowResizeHandler,{passive:!0}),this.scrollHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("scroll",this.scrollHandler,{capture:!0,passive:!0}),this.loadHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("load",this.loadHandler),window.MutationObserver&&(this._globalMutationObserver=new MutationObserver(()=>{this.scheduleUpdatePositions()}),this._globalMutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","open"]}))}debugPosition(e,t){if(!e||!t)return;let n=e.container.getBoundingClientRect(),s=t.getBoundingClientRect(),r=e.relativeX*n.width,a=e.relativeY*n.height;console.log("Position Debug:",{commentId:e.id,relativePosition:{x:e.relativeX,y:e.relativeY},containerRect:{left:n.left,top:n.top,width:n.width,height:n.height},circlePosition:{left:s.left,top:s.top,centerX:s.left+s.width/2,centerY:s.top+s.height/2},expectedPosition:{x:r,y:a},offset:{x:s.left+s.width/2-(n.left+r),y:s.top+s.height/2-(n.top+a)}})}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let n=new ResizeObserver(s=>{if(this.positionValidationEnabled)for(let r of s)r.target===e.container&&this.updateCommentPosition(e,t)});n.observe(e.container),this.resizeObservers.set(e.id,{circle:t,observer:n,container:e.container})}createMutationObserver(e){if(!window.MutationObserver)return;if(this.mutationObservers.has(e.id)){try{this.mutationObservers.get(e.id).disconnect()}catch{}this.mutationObservers.delete(e.id)}let t=new MutationObserver(()=>{this.scheduleUpdatePositions()});t.observe(e.container,{attributes:!0,attributeFilter:void 0,childList:!0,subtree:!0}),this.mutationObservers.set(e.id,t)}cleanup(){ge(),Ut(),this.closeThreadPopover(),this.closeInbox(),this.closeLightbox(),this.removePreviewCircle(),this._selectionRect?.remove(),this._pendingScreenshots=[],this._handleDocumentClickBound&&document.removeEventListener("mousedown",this._handleDocumentClickBound),this.windowResizeHandler&&window.removeEventListener("resize",this.windowResizeHandler),this.scrollHandler&&window.removeEventListener("scroll",this.scrollHandler,{capture:!0}),this.loadHandler&&window.removeEventListener("load",this.loadHandler),this._globalMutationObserver&&(this._globalMutationObserver.disconnect(),this._globalMutationObserver=null),this.resizeObservers&&(this.resizeObservers.forEach(({observer:e})=>{e&&e.disconnect()}),this.resizeObservers.clear()),this.mutationObservers&&(this.mutationObservers.forEach(e=>{try{e.disconnect()}catch{}}),this.mutationObservers.clear()),this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.toolbar&&this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),this.commentBox&&this.commentBox.parentNode&&this.commentBox.parentNode.removeChild(this.commentBox),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),document.body.classList.remove(i.COMMENT_CURSOR),document.getElementById(y.GLOBAL_STYLES)?.remove(),this.comments.forEach(e=>{let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&t.parentNode&&t.parentNode.removeChild(t)})}injectStyles(){let e=this.shadowRoot.getElementById(y.STYLES);e&&e.remove();let t=document.createElement("style");t.id=y.STYLES,t.textContent=wt(),this.shadowRoot.appendChild(t);let n=document.getElementById(y.GLOBAL_STYLES);n&&n.remove();let s=document.createElement("style");s.id=y.GLOBAL_STYLES,s.textContent=St(),document.head.appendChild(s)}},Ye=ze;function Zt(o={}){let{autoInit:e=!0,...t}=o,n=()=>new Ye(t);return e?n():n}var ai=Zt;return io(li);})();
1468
- if (typeof module !== 'undefined' && module.exports) { module.exports = HellDots.default; }
21
+ `,t},ce=(n,e)=>{let t=document.createElement("div");return t.className=s.SCREENSHOTS_CONTAINER,t.classList.add(s.ACTIVE),n.forEach(o=>{let r=document.createElement("div");r.className=s.SCREENSHOT_ITEM;let i=document.createElement("img");i.className=s.SCREENSHOT_IMG,i.src=o,i.alt=e.attachedScreenshot,r.appendChild(i),t.appendChild(r)}),t},_n=(n,e=D,t)=>{let o=document.createElement("div");o.className=s.TOOLTIP,o.dataset.for=n.id,o.setAttribute("role","dialog"),o.setAttribute("aria-label",e.tooltipAriaLabel);let r=document.createElement("div");r.className=s.THREAD_HEADER;let i=le(n.author,n.createdAt,e,t,n.editedAt),a=document.createElement("button");a.type="button",a.className=s.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="&times;",r.appendChild(i),r.appendChild(a);let l=document.createElement("div");l.className=s.THREAD_BODY,l.textContent=n.text,o.appendChild(r),o.appendChild(l);let c=lt(n,e,{includeStatus:!0});c&&o.appendChild(c);let d=ct(n);d.length>0&&o.appendChild(ce(d,e));let h=n.replies?.length||0;if(h>0){let p=document.createElement("div");p.className=s.TOOLTIP_REPLY_COUNT,p.textContent=h===1?e.replyCountOne:v(e.replyCountTemplate,h),o.appendChild(p)}return o},de=(n,e=D,t,{onDelete:o,onEdit:r,editing:i=null}={})=>{let a=document.createElement("div");a.className=s.THREAD_REPLY,a.dataset.replyId=String(n.id);let l=le(n.author,n.timestamp,e,t,n.editedAt),c=[];if(r&&c.push({label:e.editReply,onSelect:()=>r(n)}),o&&c.push({label:e.deleteReply,onSelect:()=>o(n,a),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}),c.length>0){let p=it({label:e.replyOptions,items:c});p.classList.add(s.THREAD_REPLY_ACTIONS),l.appendChild(p)}let d;i?d=q({value:i.draft,strings:e,onInput:i.onInput,onSave:i.onSave,onCancel:i.onCancel}):(d=document.createElement("div"),d.className=s.THREAD_BODY,d.textContent=n.text),a.appendChild(l),a.appendChild(d);let h=ct(n);return h.length>0&&a.appendChild(ce(h,e)),a},Tn=(n,e=D,t,{onDeleteReply:o,onEditReply:r}={})=>{let i=document.createElement("div");i.className=s.THREAD_POPOVER,i.dataset.for=n.id,i.setAttribute("role","dialog"),i.setAttribute("aria-label",e.popoverAriaLabel);let a=document.createElement("div");a.className=s.THREAD_HEADER;let l=le(n.author,n.createdAt,e,t,n.editedAt),c=document.createElement("button");c.type="button",c.className=s.CLOSE_TOOLTIP,c.setAttribute("aria-label",e.close),c.innerHTML="&times;",a.appendChild(l),a.appendChild(c);let d=document.createElement("div");d.className=s.THREAD_BODY,d.textContent=n.text;let h=document.createElement("div");h.className=s.THREAD_REPLIES,n.replies&&n.replies.forEach(f=>{h.appendChild(de(f,e,t,{onDelete:o,onEdit:r}))});let{container:p}=Be({areaClassName:s.THREAD_INPUT_AREA,inputTag:"input",inputClassName:s.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=s.THREAD_SCROLL,i.appendChild(a),m.appendChild(d);let u=ct(n);return u.length>0&&m.appendChild(ce(u,e)),m.appendChild(h),i.appendChild(m),i.appendChild(p),i};var De=(n,{strings:e,onShowLightbox:t,collapsible:o=!1,expanded:r=!1,onToggle:i})=>{let{context:a,contextScreenshot:l}=n;if(!a&&!l)return null;let c=document.createElement("div");c.className=s.CONTEXT_BLOCK;let d=document.createElement("div");if(d.className=s.CONTEXT_BODY,o){let h=document.createElement("button");h.type="button",h.className=s.CONTEXT_TOGGLE,h.setAttribute("aria-expanded",String(r)),h.innerHTML=`<span>${e.contextSection}</span>${Le}`,d.style.display=r?"":"none",h.addEventListener("click",p=>{p.stopPropagation();let m=h.getAttribute("aria-expanded")==="true";h.setAttribute("aria-expanded",String(!m)),d.style.display=m?"none":"",i?.(!m)}),c.appendChild(h)}else{let h=document.createElement("div");h.className=s.CONTEXT_TITLE,h.textContent=e.contextSection,c.appendChild(h)}if(l){let h=document.createElement("div");h.className=s.CONTEXT_SCREENSHOT_CAPTION,h.textContent=e.autoScreenshotLabel,d.appendChild(h);let p=document.createElement("img");p.className=s.SCREENSHOT_IMG,p.src=l,p.alt=e.autoScreenshotLabel,d.appendChild(p),I(d,t)}if(a){let h=(u,f)=>{if(!f)return;let g=document.createElement("div");g.className=s.CONTEXT_ROW;let E=document.createElement("span");E.textContent=u;let b=document.createElement("span");b.textContent=f,g.appendChild(E),g.appendChild(b),d.appendChild(g)},p=u=>u?`${u.width}\xD7${u.height}`:"",m=u=>u?.name?`${u.name} ${u.version||""}`.trim():"";h(e.contextUrl,a.url),h(e.contextViewport,p(a.viewport)),h(e.contextScreen,p(a.screen)),h(e.contextBrowser,m(a.browser)),h(e.contextOs,m(a.os))}return c.appendChild(d),c};var Li=n=>{let e=[...n.attributes].map(({name:t,value:o})=>`${t}="${o}"`).join(" ");return`<${n.tagName.toLowerCase()}${e?` ${e}`:""}>`},Bi=n=>{if(!n?.tagName)return"(unknown)";let e=Object.entries(n.attributes||{}).map(([t,o])=>`${t}="${o}"`).join(" ");return`<${n.tagName.toLowerCase()}${e?` ${e}`:""}>`},Di=n=>{let e=[],t=n;for(;t&&t!==document.documentElement;){let o=t.tagName.toLowerCase(),r=t.id?`#${t.id}`:"",i=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${o}${r}${i}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function ke(n,{viewportWidth:e,viewportHeight:t,strings:o}){let r=n.anchor,i=r?.fingerprint,a=n.container?.isConnected?n.container:null,l=n.hidden?"hidden":n.anchorState,c=a?Li(a):Bi(i),d=a?Di(a):"(unavailable)",h=n.context?.viewport,p=h?.width??e,m=h?.height??t,u=[`Page: ${n.page}`,`Viewport: ${p}x${m}`,`Anchor state: ${l}`,`Status: ${n.status||"open"}`,`Selector: ${r?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${d}`,`Nearby text: "${i?.textSnippet??""}"`,`Comment by ${n.author} (${n.createdAt}):`,`"${n.text}"`];n.type&&u.push(`Type: ${n.type}`),n.priority&&u.push(`Priority: ${n.priority}`),n.tags?.length&&u.push(`Tags: ${n.tags.join(", ")}`);let f=n.context;if(f&&(f.url&&u.push(`URL: ${f.url}`),f.screen&&u.push(`Screen: ${f.screen.width}x${f.screen.height}`),f.browser?.name&&u.push(`Browser: ${`${f.browser.name} ${f.browser.version||""}`.trim()}`),f.os?.name&&u.push(`OS: ${`${f.os.name} ${f.os.version||""}`.trim()}`)),o&&n.status==="resolved"&&n.resolvedAt){let E=xe(new Date(n.resolvedAt).getTime()-new Date(n.createdAt).getTime(),o);E&&u.push(`Resolution time: ${E}`)}let g=n.replies||[];if(g.length>0){u.push(`Replies (${g.length}):`);for(let E of g)u.push(`- ${E.author}: "${E.text}"`)}return u.join(`
22
+ `)}var he=(n,e)=>{let t=e.getBoundingClientRect(),o=t.left+t.width/2,r=t.top+t.height/2,i=A,a=i/2+10,l=n.getBoundingClientRect(),c=l.width||400,d=o+a;d+c>window.innerWidth&&(d=o-a-c),d=Math.min(d,window.innerWidth-c-10),d=Math.max(10,d),n.style.left=`${d}px`;let h=10,p=r-i/2,m=window.innerHeight-h-p;l.height>m?(n.style.top="auto",n.style.bottom=`${h}px`):(n.style.bottom="auto",n.style.top=`${Math.max(h,p)}px`)},xn=n=>{let e=n.getBoundingClientRect(),t=Math.max(10,(window.innerWidth-(e.width||400))/2),o=Math.max(10,(window.innerHeight-e.height)/2);n.style.left=`${t}px`,n.style.bottom="auto",n.style.top=`${o}px`},Me=class{constructor(e){this.deps=e,this.active=null,this._activeCircle=null,this.editing=null,this._resizeObserver=null,this._clickHandler=null,this._armClickTimer=null}_bodyEl(e=null){let t=this.active;return t?e==null?t.querySelector(`.${s.THREAD_SCROLL} > .${s.THREAD_BODY}, .${s.THREAD_SCROLL} > .${s.EDITOR}`):t.querySelector(`.${s.THREAD_REPLY}[data-reply-id="${F(e)}"]`)?.querySelector(`.${s.THREAD_BODY}, .${s.EDITOR}`)||null:null}refreshCommentViews(e,t=null){if(this.active?.dataset.for!==String(e))return;let o=this.deps.findComment(e);if(!o)return;let r=t==null?o:(o.replies||[]).find(l=>w(l.id,t));if(!r)return;let i=document.createElement("div");i.className=s.THREAD_BODY,i.textContent=r.text,this._bodyEl(t)?.replaceWith(i);let a=t==null?this.active.querySelector(`.${s.THREAD_META}`):this.active.querySelector(`.${s.THREAD_REPLY}[data-reply-id="${F(t)}"]`)?.querySelector(`.${s.THREAD_META}`);if(a&&r.editedAt&&!a.querySelector(`.${s.THREAD_EDITED}`)){let l=rt(r.editedAt,this.deps.strings,this.deps.locale),c=a.querySelector(`.${s.THREAD_REPLY_ACTIONS}`);c?a.insertBefore(l,c):a.appendChild(l)}}isEditing(){return this.editing!=null}editorDirty(){if(!this.editing)return!1;let{commentId:e,replyId:t,draft:o}=this.editing,r=this.deps.findComment(e),i=t==null?r:(r?.replies||[]).find(a=>w(a.id,t));return o.trim()!==String(i?.text||"").trim()}async releaseEditor(){if(!this.editing)return!0;if(this.editorDirty()){let t=this.deps.shadowRoot;if(!await Ie(t,this.deps.strings))return!1}let{replyId:e}=this.editing;return this.editing=null,this._restoreBody(e),!0}_restoreBody(e){let t=this.deps.findComment(this.active?.dataset.for);if(!t)return;let o=e==null?t:(t.replies||[]).find(i=>w(i.id,e));if(!o)return;let r=document.createElement("div");r.className=s.THREAD_BODY,r.textContent=o.text,this._bodyEl(e)?.replaceWith(r)}async startEditing(e,t=null){if(!await this.releaseEditor())return;let o=this.deps.findComment(e),r=t==null?o:(o?.replies||[]).find(a=>w(a.id,t));if(!r)return;this.editing={commentId:e,replyId:t,draft:r.text};let i=q({value:r.text,strings:this.deps.strings,onInput:a=>{this.editing.draft=a},onSave:a=>{let l=t==null?this.deps.actions.editComment(e,a):this.deps.actions.editReply(e,t,a);this.editing=null,l?(this.refreshCommentViews(e,t),this.deps.refreshInbox()):this._restoreBody(t)},onCancel:()=>{this.releaseEditor()}});this._bodyEl(t)?.replaceWith(i)}show(e,t){this.close();let{strings:o,locale:r}=this.deps;this.deps.removeTooltip(t.id),e?.classList.add(s.CIRCLE_ACTIVE),this._activeCircle=e||null;let i=(C,x)=>{this.deps.actions.deleteReply(t.id,C.id)&&(x.remove(),this.deps.refreshInbox())},a=C=>this.startEditing(t.id,C.id),l=Tn(t,o,r,{onDeleteReply:i,onEditReply:a});this.deps.shadowRoot.appendChild(l);let c=l.querySelector(`.${s.THREAD_HEADER}`),d=Re(t,{strings:o,onCopy:C=>W(ke(C,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:o})),onCopyLink:C=>W(V(C,this.deps.linkParam())),onEdit:C=>this.startEditing(C.id),onSetStatus:(C,x)=>this.deps.actions.setStatus(C.id,x),onSetType:(C,x)=>this.deps.actions.setType(C.id,x),onSetPriority:(C,x)=>this.deps.actions.setPriority(C.id,x),onDelete:C=>{this.close(),this.deps.actions.deleteComment(C.id),this.deps.refreshInbox()}}),h=document.createElement("div");h.className=s.THREAD_ACTIONS_ROW,h.appendChild(d),c.insertAdjacentElement("afterend",h);let p=l.querySelector(`.${s.THREAD_SCROLL} > .${s.SCREENSHOTS_CONTAINER}`);p&&I(p,C=>this.deps.onShowLightbox(C));let m=De(t,{strings:o,onShowLightbox:C=>this.deps.onShowLightbox(C),collapsible:!0});m&&l.querySelector(`.${s.THREAD_REPLIES}`).before(m),setTimeout(()=>{e?he(l,e):xn(l)},10),l.querySelector(`.${s.CLOSE_TOOLTIP}`).addEventListener("click",async C=>{C.stopPropagation(),!(this.editing&&!await this.releaseEditor())&&this.close()});let u=l.querySelector(`.${s.THREAD_INPUT}`),f=l.querySelector(`.${s.THREAD_SUBMIT}`),g=l.querySelector(`.${s.THREAD_INPUT_AREA} .${s.ATTACH_IMAGE_BTN}`),E=l.querySelector(`.${s.THREAD_INPUT_AREA} input[type="file"]`),b=l.querySelector(`.${s.THREAD_INPUT_AREA} .${s.SCREENSHOTS_CONTAINER}`),T=[],_=()=>{K(b,T,{strings:o,onShow:C=>this.deps.onShowLightbox(C),rerender:()=>_()})};g.addEventListener("click",()=>{E.click()}),Z(E,()=>T,_);let y=()=>{let C=u.value.trim();if(!C&&T.length===0)return;let x=this.deps.actions.addReply(t,C,T.length>0?[...T]:[]),M=l.querySelector(`.${s.THREAD_REPLIES}`),J=de(x,o,r,{onDelete:i,onEdit:a});M.appendChild(J),I(J,On=>this.deps.onShowLightbox(On));let He=l.querySelector(`.${s.THREAD_SCROLL}`);He&&(He.scrollTop=He.scrollHeight),u.value="",T=[],_(),u.focus()};f.addEventListener("click",y),u.addEventListener("keydown",C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),y())}),this.active=l,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(l)),setTimeout(()=>u.focus(),50),this._armClickTimer=setTimeout(()=>{this._armClickTimer=null,this._clickHandler=C=>{let x=C.composedPath()[0]||C.target;if(!l.contains(x)&&!e?.contains(x)&&!this.deps.isInsideLightbox(x)){if(this.editorDirty())return;this.close()}},document.addEventListener("mousedown",this._clickHandler)},0)}close(){this.deps.shadowRoot?.querySelectorAll(`.${s.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(s.CIRCLE_ACTIVE)),this._resizeObserver?.disconnect(),this._resizeObserver=null,this.editing=null,this.active&&(this.active.remove(),this.active=null),this._activeCircle=null,this._armClickTimer&&(clearTimeout(this._armClickTimer),this._armClickTimer=null),this._clickHandler&&(document.removeEventListener("mousedown",this._clickHandler),this._clickHandler=null)}reposition(){let e=this.active;!e||e.style.display==="none"||(this._activeCircle?he(e,this._activeCircle):xn(e))}syncToMarker(){let e=this.active,t=this._activeCircle;if(!e||!t)return;let o=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&o.bottom>0&&o.right>0&&o.top<window.innerHeight&&o.left<window.innerWidth)){e.style.display="none";return}e.style.display="",he(e,t)}};var yn=150,dt=(n,e)=>Math.max(0,Math.min(n,e)),Pe=class{constructor(e){this.deps=e,this.circles=new Map,this.resizeObservers=new Map,this.enabled=!0,this._lastOcclusionPass=0,this._occlusionTrailingTimer=null,this._pendingRaf=null,this._globalMutationObserver=null,this._resizeHandler=null,this._scrollHandler=null,this._loadHandler=null}start(){this._resizeHandler=()=>this.scheduleUpdate(),window.addEventListener("resize",this._resizeHandler,{passive:!0}),this._scrollHandler=()=>this.scheduleUpdate(),window.addEventListener("scroll",this._scrollHandler,{capture:!0,passive:!0}),this._loadHandler=()=>this.scheduleUpdate(),window.addEventListener("load",this._loadHandler),window.MutationObserver&&(this._globalMutationObserver=new MutationObserver(()=>{this.scheduleUpdate()}),this._globalMutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","open"]}))}render(e){let t=Cn(e,this.deps.strings);this.deps.wireMarker(t,e),this.deps.container.appendChild(t),this.circles.set(String(e.id),t),this.updatePosition(e,t),this.createResizeObserver(e,t)}circleOf(e){return this.circles.get(String(e))??null}remove(e){this.cleanupResizeObserver(e),this.circles.get(String(e))?.remove(),this.circles.delete(String(e))}clear(){this.resizeObservers.forEach(({observer:e})=>e?.disconnect()),this.resizeObservers.clear(),this.circles.forEach(e=>e.remove()),this.circles.clear()}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let o=e.container.getBoundingClientRect(),r=o.width,i=o.height;if(r<=0||i<=0)return null;let a=e.relativeX*r,l=e.relativeY*i,c=dt(a,r),d=dt(l,i),h=c/r,p=d/i;return{absoluteX:c,absoluteY:d,relativeX:h,relativeY:p,containerWidth:r,containerHeight:i,containerLeft:o.left,containerTop:o.top}}_isAnchorTargetVisible(e){let t=e.target;if((!t||!t.isConnected)&&e.anchor?.targetSelector){try{t=document.querySelector(e.anchor.targetSelector)}catch{t=null}e.target=t||null}if(!t||!t.isConnected)return!0;let o=t.getBoundingClientRect();return o.width>0&&o.height>0}_isMarkerOccluded(e,t,o){if(typeof document.elementsFromPoint!="function"||t<0||o<0||t>=window.innerWidth||o>=window.innerHeight)return!1;let i=document.elementsFromPoint(t,o).find(c=>c.tagName.toLowerCase()!==R.toLowerCase());if(!i)return!1;let a=e.target?.isConnected?e.target:null;if(a&&(a.contains(i)||i.contains(a)))return!1;let l=e.container;if(!l?.isConnected)return!1;if(!l.contains(i)&&!i.contains(l))return!0;if(l.contains(i)&&i!==l){for(let c=i;c&&c!==l;c=c.parentElement)if(this._looksLikeModalLayer(c,a))return!0}return!1}_looksLikeModalLayer(e,t){if(t&&e.contains(t))return!1;if(e.matches?.('dialog, [aria-modal="true"], [role="dialog"]'))return!0;if(getComputedStyle(e).position!=="fixed")return!1;let o=e.getBoundingClientRect();return o.width>=window.innerWidth*.5&&o.height>=window.innerHeight*.5}_computeMarkerState(e,t,{checkOcclusion:o=!0}={}){if(e.status==="resolved")return{kind:"resolved"};let r=this.validateAndCalculatePosition(e,t);if(r&&!this._isAnchorTargetVisible(e)&&(r=null),!r)return e.container?{kind:"hidden"}:{kind:"noop"};let i=A/2,a=r.containerLeft+r.absoluteX+i,l=r.containerTop+r.absoluteY+i;return o&&(e._occluded=this._isMarkerOccluded(e,a,l)),e._occluded?{kind:"hidden"}:{kind:"visible",viewportX:a,viewportY:l,relativeX:r.relativeX,relativeY:r.relativeY}}_applyMarkerState(e,t,o){if(o.kind==="resolved")return t&&(t.style.display="none"),!1;if(o.kind==="noop")return!1;let r=e.hidden===!0;return o.kind==="hidden"?(e.hidden=!0,t.style.display="none",this.deps.onMarkerHidden(e),!r):(e.hidden=!1,t.style.display="",t.style.left=`${o.viewportX}px`,t.style.top=`${o.viewportY}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=o.relativeX,e.relativeY=o.relativeY,r)}updatePosition(e,t=this.circles.get(String(e.id))){if(!t)return;let o=this._computeMarkerState(e,t);this._applyMarkerState(e,t,o)&&this.deps.onVisibilityFlip()}_updateAllPositions(){let e=Date.now(),t=e-this._lastOcclusionPass>=yn;t?this._lastOcclusionPass=e:this._armOcclusionTrailingPass();let o=[];for(let i of this.deps.getComments()){let a=this.circles.get(String(i.id));a&&o.push([i,a,this._computeMarkerState(i,a,{checkOcclusion:t})])}let r=!1;for(let[i,a,l]of o)this._applyMarkerState(i,a,l)&&(r=!0);r&&this.deps.onVisibilityFlip()}_armOcclusionTrailingPass(){this._occlusionTrailingTimer&&clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=setTimeout(()=>{this._occlusionTrailingTimer=null,this.scheduleUpdate()},yn)}scheduleUpdate(){this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.enabled&&this._updateAllPositions(),this.deps.onAfterPass()}))}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let o=new ResizeObserver(r=>{if(this.enabled)for(let i of r)i.target===e.container&&this.updatePosition(e,t)});o.observe(e.container),this.resizeObservers.set(String(e.id),{circle:t,observer:o,container:e.container})}cleanupResizeObserver(e){let t=String(e);if(this.resizeObservers.has(t)){let{circle:o,observer:r}=this.resizeObservers.get(t);r&&r.disconnect(),o&&o.parentNode&&o.parentNode.removeChild(o),this.resizeObservers.delete(t)}}scrollMarkerIntoView(e){let t=this._markerViewportY(e);t!=null&&window.scrollTo({top:Math.max(0,window.scrollY+t-window.innerHeight/2)})}_markerViewportY(e){let t=e.container;if(!t?.isConnected)return null;let o=t.getBoundingClientRect();if(o.height<=0)return null;let r=dt(e.relativeY*o.height,o.height);return o.top+r+A/2}destroy(){this._pendingRaf&&(cancelAnimationFrame(this._pendingRaf),this._pendingRaf=null),this._occlusionTrailingTimer&&(clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollHandler&&(window.removeEventListener("scroll",this._scrollHandler,{capture:!0}),this._scrollHandler=null),this._loadHandler&&(window.removeEventListener("load",this._loadHandler),this._loadHandler=null),this._globalMutationObserver&&(this._globalMutationObserver.disconnect(),this._globalMutationObserver=null),this.clear()}};var ki='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',Mi='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="18 15 12 9 6 15"/></svg>',Pi='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',$e=class{constructor({shadowRoot:e,strings:t,locale:o,currentPage:r,getComments:i,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=o,this.currentPage=r,this.getComments=i,this.callbacks=a,this.options=l,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.contextExpanded=!0,this.editing=null,this.notice=null,this._cardBindings=new Map,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=s.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.el.setAttribute("tabindex","-1"),this.shadowRoot.appendChild(this.el),this.render(),this.el.focus())}close(){this._clearHighlight(),this._setActiveMarker(null),this.el?.remove(),this.el=null,this._cardBindings.clear(),this.detailId=null,this.editing=null,this.notice=null}refresh(){this.el&&this.render()}_resetFilters(){this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}showNotice(e){this.notice=e,this.refresh()}clearNotice(){this.notice&&(this.notice=null,this.refresh())}isDirty(){return this.editing?this.editing.draft.trim()!==this._editingOriginalText().trim():!1}_editingOriginalText(){if(!this.editing)return"";let e=this.getComments().find(o=>w(o.id,this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(o=>w(o.id,this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await Ie(e,this.strings))return!1}return this.editing=null,!0}_editorHandlers(){return{draft:this.editing.draft,onInput:e=>{this.editing.draft=e},onSave:e=>{let{commentId:t,replyId:o}=this.editing;o==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,o,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return q({value:e.draft,strings:this.strings,onInput:e.onInput,onSave:e.onSave,onCancel:e.onCancel})}async startEditing(e,t=null){await this.releaseEditor()&&(this.detailId=e,this.editing={commentId:e,replyId:t,draft:""},this.editing.draft=this._editingOriginalText(),this.render())}_markerFor(e){return e.anchorState!=="anchored"||e.hidden||e.status==="resolved"?null:this.shadowRoot.querySelector(En(e.id))}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(s.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(s.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(s.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(s.CIRCLE_ACTIVE),this._activeMarkerEl=t)}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter!=="all"&&(e=e.filter(t=>(t.status||"open")===this.statusFilter)),this.typeFilter!=="all"&&(e=e.filter(t=>t.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(t=>t.priority===this.priorityFilter)),[...e.filter(t=>t.status!=="resolved"),...e.filter(t=>t.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight();let e=this.filteredComments(),t=this.detailId!=null?e.find(o=>w(o.id,this.detailId)):null;this._setActiveMarker(t),t?(this._cardBindings.clear(),this.el.innerHTML="",this._renderDetail(t,e)):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(o=>w(o.id,e));t&&this._openDetail(t)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render()}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=s.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="&times;",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_renderList(e){let t=[...this.el.children].find(r=>r.classList.contains(s.INBOX_LIST));if(!t){this.el.innerHTML="",this._cardBindings.clear();let r=document.createElement("div");r.className=s.INBOX_HEADER,this.el.appendChild(r),t=document.createElement("div"),t.className=s.INBOX_LIST,this.el.appendChild(t)}[...this.el.children].find(r=>r.classList.contains(s.INBOX_HEADER)).replaceChildren(this._buildFilter(),this._closeButton()),this._reconcileCards(t,e)}_cardFingerprint(e){return JSON.stringify([e.text,e.editedAt??null,e.status??"open",e.type??null,e.priority??null,e.tags??[],e.resolvedAt??null,e.anchorState,e.hidden===!0,e.page,e.screenshots?.length??0])}_reconcileCards(e,t){for(let i of[...e.children])(i.classList.contains(s.INBOX_NOTICE)||i.classList.contains(s.INBOX_EMPTY))&&i.remove();let o=[];if(this.notice){let i=document.createElement("div");i.className=s.INBOX_NOTICE,i.setAttribute("role","status"),i.textContent=this.notice,o.push(i)}let r=new Set;if(t.length===0)o.push(this._buildEmptyState());else for(let i of t){let a=String(i.id),l=this._cardFingerprint(i),c=this._cardBindings.get(a),d;c&&c.comment===i&&c.fingerprint===l?d=c.card:(d=this._buildCard(i,{interactive:!0}),this._cardBindings.set(a,{comment:i,fingerprint:l,card:d})),r.add(a),o.push(d)}for(let i of[...this._cardBindings.keys()])r.has(i)||this._cardBindings.delete(i);for(o.forEach((i,a)=>{e.children[a]!==i&&e.insertBefore(i,e.children[a]??null)});e.children.length>o.length;)e.lastElementChild.remove()}_buildEmptyState(){let e=document.createElement("div");e.className=s.INBOX_EMPTY;let t=document.createElement("div");t.className=s.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let o=this.getComments().length>0,r=document.createElement("div");if(r.className=s.INBOX_EMPTY_TITLE,r.textContent=o?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(r),o){let h=document.createElement("button");return h.type="button",h.className=s.INBOX_EMPTY_ACTION,h.textContent=this.strings.filterClear,h.addEventListener("click",()=>{this._resetFilters()}),e.appendChild(h),e}let i=document.createElement("div");i.className=s.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=s.INBOX_EMPTY_KBD,c.textContent=at(this.options,this.strings),i.appendChild(document.createTextNode(a??"")),i.appendChild(c),i.appendChild(document.createTextNode(l??"")),e.appendChild(i);let d=document.createElement("button");return d.type="button",d.className=s.INBOX_EMPTY_ACTION,d.textContent=this.strings.inboxEmptyAction,d.addEventListener("click",()=>this.callbacks.onActivateCommentMode()),e.appendChild(d),e}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(j(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push($(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(H(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_isFilterActive(){return this.pageFilter!=="page"||this.statusFilter!=="all"||this.typeFilter!=="all"||this.priorityFilter!=="all"}_buildFilterGroup({title:e,dataAttr:t,values:o,labelOf:r,selected:i,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=s.INBOX_FILTER_GROUP;let d=document.createElement("div");d.className=s.INBOX_FILTER_SECTION,d.textContent=e,c.appendChild(d);let h=document.createElement("div");h.className=s.INBOX_FILTER_CHIPS,h.setAttribute("role",a?"group":"radiogroup"),h.setAttribute("aria-label",e);for(let p of o){let m=i===p,u=document.createElement("button");u.type="button",u.className=s.INBOX_FILTER_CHIP,u.dataset[t]=p,u.setAttribute("role",a?"switch":"radio"),u.setAttribute("aria-checked",String(m)),u.textContent=r(p),u.addEventListener("click",f=>{f.stopPropagation(),l(a&&m?"all":p),this.render()}),h.appendChild(u)}return c.appendChild(h),c}_buildFilter(){let e=document.createElement("div");e.className=s.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=s.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${Le}`;let o=document.createElement("div");o.className=s.INBOX_FILTER_MENU,o.setAttribute("role","group"),o.setAttribute("aria-label",this.strings.filterTitle),ae(t,o);let r=document.createElement("div");r.className=s.INBOX_FILTER_MENU_HEADER;let i=document.createElement("span");i.textContent=this.strings.filterTitle,r.appendChild(i);let a=document.createElement("button");return a.type="button",a.className=s.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this._resetFilters()}),r.appendChild(a),o.appendChild(r),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPage,dataAttr:"filterPage",values:["page","all"],labelOf:l=>this._pageFilterLabel(l),selected:this.pageFilter,toggles:!1,onSelect:l=>this.pageFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...P],labelOf:l=>j(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...L],labelOf:l=>$(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...B],labelOf:l=>H(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(o),e}_buildCard(e,{interactive:t}){let o=document.createElement("div");o.className=s.INBOX_CARD,e.status==="resolved"&&o.classList.add(`${s.INBOX_CARD}--resolved`),o.dataset.commentId=e.id;let r=document.createElement("div");r.className=s.INBOX_CARD_HEADER,r.appendChild(le(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),o.appendChild(r);let i=document.createElement("div");if(i.className=s.THREAD_ACTIONS_ROW,i.appendChild(this._buildCardActions(e)),o.appendChild(i),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))o.appendChild(this._buildEditor());else{let d=document.createElement("div");d.className=s.INBOX_CARD_TEXT,d.textContent=e.text,o.appendChild(d)}if(e.screenshots?.length){let d=ce(e.screenshots,this.strings);I(d,h=>this.callbacks.onShowLightbox(h)),o.appendChild(d)}let l=lt(e,this.strings,{includeClassification:!1});l&&o.appendChild(l);let c=this._buildTag(e);if(c&&o.appendChild(c),t){o.setAttribute("role","button"),o.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),h=document.createElement("button");h.type="button",h.className=s.INBOX_CARD_REPLY_LINK,h.textContent=this.strings.replyLink,h.addEventListener("click",p=>{p.stopPropagation(),d()}),o.appendChild(h),o.addEventListener("click",d),o.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),d())}),o.addEventListener("mouseenter",()=>this._highlight(e)),o.addEventListener("mouseleave",()=>this._clearHighlight())}return o}_buildTag(e){let t=null;if(e.anchorState==="orphaned"?t=this.strings.orphanedBadge:e.hidden?t=this.strings.hiddenBadge:e.anchorState==="inactive"&&(t=e.page),!t)return null;let o=document.createElement("span");return o.className=s.INBOX_CARD_TAG,o.textContent=t,o}_buildCardActions(e){return Re(e,{strings:this.strings,onCopy:t=>W(ke(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>W(V(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,o)=>this.callbacks.onSetStatus(t.id,o),onSetType:(t,o)=>this.callbacks.onSetType(t.id,o),onSetPriority:(t,o)=>this.callbacks.onSetPriority(t.id,o),onDelete:t=>{this.detailId!=null&&w(this.detailId,t.id)&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let o=t.indexOf(e),r=document.createElement("div");r.className=s.INBOX_DETAIL_HEADER;let i=document.createElement("button");i.type="button",i.className=s.INBOX_BACK,i.innerHTML=`${ki}<span>${this.strings.back}</span>`,i.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.detailId=null,this.render())}),r.appendChild(i);let a=document.createElement("div");a.className=s.INBOX_CARD_ACTIONS;let l=(p,m,u)=>{let f=document.createElement("button");f.type="button",f.className=s.INBOX_NAV_BTN,f.setAttribute("aria-label",m),f.title=m,f.innerHTML=p;let g=t[u];return f.disabled=!g,g&&f.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(g)}),f};a.appendChild(l(Mi,this.strings.prevComment,o-1)),a.appendChild(l(Pi,this.strings.nextComment,o+1)),a.appendChild(this._closeButton()),r.appendChild(a),this.el.appendChild(r);let c=document.createElement("div");c.className=s.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let d=De(e,{strings:this.strings,onShowLightbox:p=>this.callbacks.onShowLightbox(p),collapsible:!0,expanded:this.contextExpanded,onToggle:p=>{this.contextExpanded=p}});d&&c.appendChild(d);let h=document.createElement("div");h.className=s.INBOX_REPLIES;for(let p of e.replies||[]){let m=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(p.id),u=de(p,this.strings,this.locale,{onDelete:(f,g)=>{this.callbacks.onDeleteReply(e.id,f.id)&&g.remove()},onEdit:f=>this.startEditing(e.id,f.id),editing:m?this._editorHandlers():null});I(u,f=>this.callbacks.onShowLightbox(f)),h.appendChild(u)}c.appendChild(h),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:o,screenshotsContainer:r,attachBtn:i,fileInput:a,submitBtn:l}=Be({areaClassName:s.THREAD_INPUT_AREA,inputTag:"input",inputClassName:s.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],d=()=>{K(r,c,{strings:this.strings,onShow:p=>this.callbacks.onShowLightbox(p),rerender:()=>d()})};i.addEventListener("click",()=>a.click()),Z(a,()=>c,d);let h=()=>{let p=o.value.trim();!p&&c.length===0||(this.callbacks.onReply(e,p,[...c]),c=[],this.render())};return l.addEventListener("click",h),o.addEventListener("keydown",p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),h())}),t}};var $i=n=>{let e=new Set;for(let t of n){let o=String(t).trim().toLowerCase();o&&e.add(o)}return[...e]},Sn=n=>n.filter(e=>typeof e=="string"),Hi={"comment:created":"onCommentCreated","comment:edited":"onCommentEdited","comment:deleted":"onCommentDeleted","comment:status-changed":"onCommentStatusChanged","comment:updated":"onCommentUpdated","comment:anchor-lost":"onAnchorLost","reply:added":"onReplyAdded","reply:deleted":"onReplyDeleted","reply:edited":"onReplyEdited"},ht=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=st(),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,embedCrossOriginFonts:e.embedCrossOriginFonts===!0,...e},this.locale=this.options.locale||Kt(),this.strings=Zt(this.locale),this.markers=null,this._captureFlow=null,this._storedCache=null,this._popover=null,this._pendingDetailId=null,document.readyState==="loading"?(this._onDomReady=()=>this.initOverlay(),document.addEventListener("DOMContentLoaded",this._onDomReady)):this.initOverlay()}initOverlay(){this.shadowRoot=kt(),this.toolbar=fn(this.options,this.strings),this.commentBox=gn(this.strings),this.overlay=document.createElement("div"),this.overlay.className=s.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${s.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${s.TOOLBAR_MENU_BTN}`),this.submitButton=this.shadowRoot.getElementById(S.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(S.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${s.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(S.ATTACH_IMAGE_INPUT),this._captureFlow=new Ce({host:this.shadowRoot,autoScreenshot:this.options.autoScreenshot,embedCrossOriginFonts:this.options.embedCrossOriginFonts,onRegionCaptured:e=>{this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length<Ee&&this._pendingScreenshots.push(e)},onPlace:(e,t)=>this._placeCommentAtPoint(e,t)}),this._popover=new Me({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,findComment:e=>this._findComment(e),removeTooltip:e=>this._tooltipEl(e)?.remove(),onShowLightbox:e=>this.showLightbox(e),isInsideLightbox:e=>this._isInsideLightbox(e),linkParam:()=>this._linkParam(),refreshInbox:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},actions:{addReply:(e,t,o)=>this.addReply(e,t,o),deleteReply:(e,t)=>this.deleteReply(e,t),editComment:(e,t)=>this.editComment(e,t),editReply:(e,t,o)=>this.editReply(e,t,o),setStatus:(e,t)=>this.setCommentStatus(e,t),setType:(e,t)=>this.setCommentType(e,t),setPriority:(e,t)=>this.setCommentPriority(e,t),deleteComment:e=>this.deleteComment(e)}}),this.markers=new Pe({container:this.overlay,strings:this.strings,getComments:()=>this.comments,wireMarker:(e,t)=>this._wireMarker(e,t),onMarkerHidden:e=>this._dismissMarkerUi(e),onVisibilityFlip:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},onAfterPass:()=>this.syncThreadPopoverToMarker()}),this.markers.start(),this.bindEventListeners(),this.setupKeyboardShortcut(),this.injectStyles(),this._pendingDetailId=this._readPendingDetailId(),this.options.persistence==="localStorage"&&(this._storedCache=et(),this.loadComments(this._storedCache),this._storageHandler=e=>{(e.key===ye||e.key===null)&&(this._storedCache=null)},window.addEventListener("storage",this._storageHandler)),this._openPendingDetail(),this.options.autoDetectNavigation&&(this._popstateHandler=()=>this.notifyNavigation(),window.addEventListener("popstate",this._popstateHandler))}_navigateTo(e){if(typeof this.options.navigate=="function"){this.options.navigate(e);return}location.assign(e)}_readPendingDetailId(){let e=ln(this._linkParam()),t=null;try{t=sessionStorage.getItem(Se),t!=null&&sessionStorage.removeItem(Se)}catch{}return e??t}_linkParam(){return this.options.linkParam||Oe}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this._findComment(e);if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound);return}this._pendingDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_emit(e,t,o){let r=Hi[e],i=this.options[r];if(typeof i=="function")try{i(...t)}catch(a){console.warn(`HellDots: ${r} handler threw`,a)}if(typeof this.options.onChange=="function")try{this.options.onChange({type:e,...o})}catch(a){console.warn("HellDots: onChange handler threw",a)}}commentLink(e){let t=this._findComment(e);return t?V(t,this._linkParam()):null}_readStoredCached(){return this._storedCache||(this._storedCache=et()),this._storedCache}_syncStorage(){if(this.options.persistence!=="localStorage")return;let e=tt(this._readStoredCached(),this.serializeComments(),location.pathname);we(e),this._storedCache=e}bindEventListeners(){this.commentBtn.addEventListener("click",()=>this.toggleCommentMode()),this.inboxBtn.addEventListener("click",()=>this.toggleInbox()),this.submitButton.addEventListener("click",()=>this.saveComment()),this.commentInput.addEventListener("keydown",e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.saveComment())}),this.attachImageBtn.addEventListener("click",()=>{this.attachImageInput.click()}),Z(this.attachImageInput,()=>(this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots),()=>this._updateScreenshotsPreview()),this._handleDocumentClickBound=e=>this.handleDocumentClick(e),document.addEventListener("mousedown",this._handleDocumentClickBound)}setupKeyboardShortcut(){this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=e=>{if(e.key==="Escape"){this._activeLightbox?this.closeLightbox():this.activeThreadPopover?this._popover.isEditing()?this._popover.releaseEditor():this.closeThreadPopover():this.inboxView?.isOpen()?this.inboxView.editing?this.inboxView.releaseEditor().then(i=>i&&this.inboxView?.refresh()):this.closeInbox():this.commentBox.style.display!=="none"?(this.hideCommentBox(),this.toggleCommentMode()):this.commentMode&&this.toggleCommentMode();return}let t=this.options.shortcutKey.toLowerCase(),o=e.key.toLowerCase()===t||e.altKey&&/^[a-z]$/.test(t)&&e.code===`Key${t.toUpperCase()}`,r=this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey;o&&r&&(e.preventDefault(),e.stopPropagation(),this.toggleCommentMode())},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let t=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(t)||t?.closest?.(`.${s.CIRCLE}`)||t?.closest?.(`.${s.TOOLTIP}`)||t?.closest?.(`.${s.THREAD_POPOVER}`)||t?.closest?.(`.${s.INBOX_PANEL}`)||t?.closest?.(`.${s.LIGHTBOX}`))&&!this.commentBox.contains(t)){if(this.commentBox.style.display!=="none"){this.hideCommentBox(),this.toggleCommentMode();return}e.button===0&&(e.preventDefault(),this._captureFlow.beginDrag(e))}}async _placeCommentAtPoint(e,t){this._captureFlow.armClickCapture();let o=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let r=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=o||"";let i=r?.closest?.(Ut.CONTAINER)||document.body,a=i.getBoundingClientRect(),l=a.width>0?(e-a.left)/a.width:0,c=a.height>0?(t-a.top)/a.height:0,d=on(i,l,c);d.targetSelector=r&&r!==i?nn(r):null,this.currentPosition={container:i,relativeX:l,relativeY:c,anchor:d,target:r||i},this.createPreviewCircle(e,t),document.body.classList.remove(s.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${s.SCREENSHOTS_CONTAINER}`);e&&K(e,this._pendingScreenshots||[],{strings:this.strings,onShow:t=>this.showLightbox(t),rerender:()=>this._updateScreenshotsPreview()})}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${s.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(s.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let r=A/2,i=r+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),d=c.width||400,h=e+r,p=t+r,m=h+i,u=p-r;m+d>a&&(m=h-i-d),m=Math.min(m,a-d-10),m=Math.max(10,m),u+c.height>l&&(u=l-c.height-10),u=Math.max(10,u),this.commentBox.style.left=`${m}px`,this.commentBox.style.top=`${u}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._captureFlow?.clearPending(),this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(s.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),this.commentBtn?.classList.toggle(s.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(s.ACTIVE,this.commentMode),document.body.classList.toggle(s.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox()}async saveComment(){if(!this._saving&&!(!this.commentInput.value.trim()||!this.currentPosition)){this._saving=!0;try{await this._saveCommentNow()}finally{this._saving=!1}}}async _saveCommentNow(){let e=await this._captureFlow.consumePending();if(!this.currentPosition)return;let t={text:this.commentInput.value,container:this.currentPosition.container,relativeX:this.currentPosition.relativeX,relativeY:this.currentPosition.relativeY,anchor:this.currentPosition.anchor,anchorState:"anchored",target:this.currentPosition.target,hidden:!1,status:"open",page:location.pathname,id:nt(),replies:[],author:this.options.user?.name||this.strings.anonymous,createdAt:new Date().toISOString(),screenshots:this._pendingScreenshots?[...this._pendingScreenshots]:[],type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:[],resolvedAt:null,context:Yt(),contextScreenshot:e};this.comments.push(t),this._syncStorage();let o=this._serializeComment(t);this._emit("comment:created",[o],{comment:o}),this.renderCommentCircle(t),this.hideCommentBox(),this.toggleCommentMode();let r=this._circles.get(String(t.id));r&&this.showThreadPopover(r,t)}renderCommentCircle(e){this.markers.render(e)}_wireMarker(e,t){e.addEventListener("mouseenter",()=>this.showCommentTooltip(e,t)),e.addEventListener("mouseleave",()=>{setTimeout(()=>{let o=this._tooltipEl(t.id);o&&!o.matches(":hover")&&o.remove()},250)}),e.addEventListener("click",o=>{if(o.stopPropagation(),this._tooltipEl(t.id)?.remove(),this.activeThreadPopover?.dataset.for===String(t.id)){this.closeThreadPopover();return}this.showThreadPopover(e,t)}),e.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),e.click())})}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${s.THREAD_POPOVER}[data-for="${F(t.id)}"]`)||this._tooltipEl(t.id))return;let r=_n(t,this.strings,this.locale);this.shadowRoot.appendChild(r),I(r,i=>this.showLightbox(i)),setTimeout(()=>{he(r,e)},10),r.querySelector(`.${s.CLOSE_TOOLTIP}`).addEventListener("click",i=>{i.stopPropagation(),r.remove()}),r.addEventListener("mouseleave",()=>r.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new $e({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:{onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onReply:(e,t,o)=>this.addReply(e,t,o),onDelete:e=>this.deleteComment(e),onDeleteReply:(e,t)=>this.deleteReply(e,t),onEditComment:(e,t)=>{this.editComment(e,t)&&this._popover.refreshCommentViews(e)},onEditReply:(e,t,o)=>{this.editReply(e,t,o)&&this._popover.refreshCommentViews(e)},onSetStatus:(e,t)=>this.setCommentStatus(e,t),onSetType:(e,t)=>this.setCommentType(e,t),onSetPriority:(e,t)=>this.setCommentPriority(e,t),onNavigateToPage:e=>{try{sessionStorage.setItem(Se,String(e.id))}catch{}this._navigateTo(e.page)},onShowLightbox:e=>this.showLightbox(e),onClose:()=>this.closeInbox()}})),this.inboxView.open(),this._disarmInboxOutsideClick(),this._inboxClickTimer=setTimeout(()=>{this._inboxClickTimer=null,this._inboxClickHandler=e=>{let t=e.composedPath()[0]||e.target;if(!this.inboxView.el?.contains(t)&&!this.inboxBtn.contains(t)&&!this._isInsideLightbox(t)){if(this.inboxView.isDirty())return;this.closeInbox()}},document.addEventListener("mousedown",this._inboxClickHandler)},0)}closeInbox(){this.inboxView?.close(),this._disarmInboxOutsideClick()}_disarmInboxOutsideClick(){this._inboxClickTimer&&(clearTimeout(this._inboxClickTimer),this._inboxClickTimer=null),this._inboxClickHandler&&(document.removeEventListener("mousedown",this._inboxClickHandler),this._inboxClickHandler=null)}get activeThreadPopover(){return this._popover?.active??null}showThreadPopover(e,t){this._popover.show(e,t)}closeThreadPopover(){this._popover?.close()}syncThreadPopoverToMarker(){this._popover?.syncToMarker()}showLightbox(e){this.closeLightbox(),this._lightboxReturnFocus=this.shadowRoot.activeElement||document.activeElement;let t=document.createElement("div");t.className=s.LIGHTBOX,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",this.strings.screenshotPreview);let o=document.createElement("img");o.className=s.LIGHTBOX_IMG,o.src=e,o.alt=this.strings.screenshotPreview;let r=document.createElement("button");r.type="button",r.className=s.LIGHTBOX_CLOSE,r.setAttribute("aria-label",this.strings.close),r.innerHTML="&times;",r.addEventListener("click",()=>this.closeLightbox()),t.appendChild(o),t.appendChild(r),t.addEventListener("click",i=>{i.target===t&&this.closeLightbox()}),this.shadowRoot.appendChild(t),this._activeLightbox=t,this._lightboxKeydownHandler=i=>{i.key==="Tab"&&(i.preventDefault(),r.focus())},document.addEventListener("keydown",this._lightboxKeydownHandler,!0),r.focus()}closeLightbox(){if(!this._activeLightbox)return;this._lightboxKeydownHandler&&(document.removeEventListener("keydown",this._lightboxKeydownHandler,!0),this._lightboxKeydownHandler=null),this._activeLightbox.remove(),this._activeLightbox=null;let e=this._lightboxReturnFocus;this._lightboxReturnFocus=null,e?.isConnected&&e.focus?.()}_isInsideLightbox(e){return!!e?.closest?.(`.${s.LIGHTBOX}`)}_findComment(e){return this.comments.find(t=>w(t.id,e))}_tooltipEl(e){return this.shadowRoot?.querySelector(`.${s.TOOLTIP}[data-for="${F(e)}"]`)??null}addReply(e,t,o=[]){let r=typeof e=="object"&&e!==null?e:this._findComment(e);if(!r)return null;r.replies||(r.replies=[]);let i={id:nt(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:o};r.replies.push(i),this._syncStorage();let a=this._serializeComment(r),l=this._serializeReply(i);return this._emit("reply:added",[a,l],{comment:a,reply:l}),i}deleteReply(e,t){let o=this._findComment(e),r=o?.replies?.findIndex(c=>w(c.id,t))??-1;if(r<0)return!1;let[i]=o.replies.splice(r,1);this._syncStorage();let a=this._serializeComment(o),l=this._serializeReply(i);return this._emit("reply:deleted",[a,l],{comment:a,reply:l}),!0}editComment(e,t){let o=this._findComment(e),r=String(t??"").trim();if(!o||!r||r===o.text)return!1;o.text=r,o.editedAt=new Date().toISOString(),this._circles.get(String(o.id))?.setAttribute("aria-label",`${this.strings.commentAriaLabelPrefix}${o.text}`),this._syncStorage();let i=this._serializeComment(o);return this._emit("comment:edited",[i],{comment:i}),!0}editReply(e,t,o){let r=this._findComment(e),i=r?.replies?.find(d=>w(d.id,t)),a=String(o??"").trim();if(!i||!a||a===i.text)return!1;i.text=a,i.editedAt=new Date().toISOString(),this._syncStorage();let l=this._serializeComment(r),c=this._serializeReply(i);return this._emit("reply:edited",[l,c],{comment:l,reply:c}),!0}_serializeReply({id:e,text:t,author:o,timestamp:r,screenshots:i,editedAt:a}){return{id:e,text:t,author:o,timestamp:r,screenshots:i||[],editedAt:a||null}}_serializeComment(e){return{schemaVersion:1,id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),author:e.author,createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!P.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;if(o.status===t)return!0;o.status=t,o.resolvedAt=t==="resolved"?new Date().toISOString():null;let r=this._circles.get(String(o.id));r&&this.updateCommentPosition(o,r),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let i=this._serializeComment(o);return this._emit("comment:status-changed",[i],{comment:i}),!0}_commitUpdate(e){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let t=this._serializeComment(e);return this._emit("comment:updated",[t],{comment:t}),!0}setCommentType(e,t){if(t!==null&&!L.includes(t))return!1;let o=this._findComment(e);return o?(o.type=t,this._commitUpdate(o)):!1}setCommentPriority(e,t){if(t!==null&&!B.includes(t))return!1;let o=this._findComment(e);return o?(o.priority=t,this._commitUpdate(o)):!1}setCommentTags(e,t){if(!Array.isArray(t))return!1;let o=this._findComment(e);return o?(o.tags=$i(t),this._commitUpdate(o)):!1}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){if(!this._findComment(e))return!1;if(this._removeComment(e),this.options.persistence==="localStorage"){let t=tt(this._readStoredCached().filter(o=>!w(o.id,e)),this.serializeComments(),location.pathname);we(t),this._storedCache=t}return this._emit("comment:deleted",[e],{id:e}),!0}_removeComment(e){this.markers.remove(e),this.comments=this.comments.filter(t=>!w(t.id,e))}clearComments(){this.closeThreadPopover();let e=this.comments;if(this.markers.clear(),this.comments=[],this.options.persistence==="localStorage"&&e.length>0){let t=new Set(e.map(r=>String(r.id))),o=this._readStoredCached().filter(r=>!t.has(String(r.id)));we(o),this._storedCache=o}this.inboxView?.isOpen()&&this.inboxView.refresh()}loadComments(e){let t=0,o=0,r=0;if(!Array.isArray(e))return{anchored:t,orphaned:o,inactive:r};for(let i of e){if(!i||i.id==null||typeof i.text!="string"){console.warn("HellDots: skipping malformed serialized comment",i);continue}this._removeComment(i.id);let a={id:i.id,text:i.text,editedAt:i.editedAt||null,anchor:i.anchor||null,anchorState:"orphaned",target:null,hidden:!1,page:i.page||location.pathname,container:null,relativeX:0,relativeY:0,replies:Array.isArray(i.replies)?i.replies.filter(c=>c&&typeof c=="object"&&c.id!=null&&typeof c.text=="string").map(c=>Array.isArray(c.screenshots)?{...c,screenshots:Sn(c.screenshots)}:c):[],author:i.author||this.strings.anonymous,createdAt:i.createdAt||new Date().toISOString(),screenshots:Array.isArray(i.screenshots)?Sn(i.screenshots):[],status:i.status==="closed"?"resolved":P.includes(i.status)?i.status:"open",type:L.includes(i.type)?i.type:null,priority:B.includes(i.priority)?i.priority:null,tags:Array.isArray(i.tags)?[...i.tags]:[],resolvedAt:i.resolvedAt||null,context:i.context||null,contextScreenshot:i.contextScreenshot||null};if(i.page&&i.page!==location.pathname){a.anchorState="inactive",this.comments.push(a),r++;continue}let l=i.anchor?Qe(i.anchor):null;if(l)a.container=l.element,a.relativeX=i.anchor.relativeX,a.relativeY=i.anchor.relativeY,a.anchorState="anchored",this.comments.push(a),this.renderCommentCircle(a),t++;else{this.comments.push(a),o++;let c=this._serializeComment(a);this._emit("comment:anchor-lost",[c],{comment:c})}}return this._openPendingDetail(),{anchored:t,orphaned:o,inactive:r}}notifyNavigation(){let e=location.pathname,t=0,o=0,r=0;this.closeThreadPopover(),this.hideCommentBox(),this.inboxView&&(this.inboxView.currentPage=e);for(let i of this.comments){if(this.markers.remove(i.id),i.hidden=!1,i.target=null,i._occluded=!1,i.page&&i.page!==e){i.anchorState="inactive",i.container=null,r++;continue}let a=i.anchor?Qe(i.anchor):null;if(a)i.container=a.element,i.relativeX=i.anchor.relativeX,i.relativeY=i.anchor.relativeY,i.anchorState="anchored",this.renderCommentCircle(i),t++;else{i.container=null,i.anchorState="orphaned",o++;let l=this._serializeComment(i);this._emit("comment:anchor-lost",[l],{comment:l})}}return this._pendingDetailId=this._readPendingDetailId(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this._openPendingDetail(),{anchored:t,orphaned:o,inactive:r}}scrollMarkerIntoView(e){this.markers.scrollMarkerIntoView(e)}createPreviewCircle(e,t){this.removePreviewCircle();let o=document.createElement("div");o.className=`${s.CIRCLE} ${s.PREVIEW_CIRCLE}`,o.style.position="absolute";let r=A/2;o.style.left=`${e+r}px`,o.style.top=`${t+r}px`,o.style.transform="translate(-50%, -50%)",o.style.pointerEvents="none",this.overlay.appendChild(o),this.previewCircle=o}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){this.markers.cleanupResizeObserver(e)}validateAndCalculatePosition(e,t){return this.markers.validateAndCalculatePosition(e,t)}updateCommentPosition(e,t){this.markers.updatePosition(e,t)}scheduleUpdatePositions(){this.markers.scheduleUpdate()}get _circles(){return this.markers?.circles}get resizeObservers(){return this.markers?.resizeObservers}get positionValidationEnabled(){return this.markers?.enabled??!0}set positionValidationEnabled(e){this.markers&&(this.markers.enabled=e)}get _globalMutationObserver(){return this.markers?._globalMutationObserver??null}_dismissMarkerUi(e){this._tooltipEl(e.id)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}cleanup(){this._onDomReady&&(document.removeEventListener("DOMContentLoaded",this._onDomReady),this._onDomReady=null),this.markers?.destroy(),this._storageHandler&&(window.removeEventListener("storage",this._storageHandler),this._storageHandler=null),this._popstateHandler&&(window.removeEventListener("popstate",this._popstateHandler),this._popstateHandler=null),this._storedCache=null,ve(),hn(),this.closeThreadPopover(),this.closeInbox(),this.closeLightbox(),this.removePreviewCircle(),this._captureFlow?.destroy(),this._pendingScreenshots=[],this._handleDocumentClickBound&&document.removeEventListener("mousedown",this._handleDocumentClickBound),this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.toolbar&&this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),this.commentBox&&this.commentBox.parentNode&&this.commentBox.parentNode.removeChild(this.commentBox),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),document.body.classList.remove(s.COMMENT_CURSOR),this._detachStyles(),document.querySelector(R)?.remove()}injectStyles(){this._detachStyles(),this._styleDetachers=[qe(this.shadowRoot,Wt(),S.STYLES),qe(document,jt(),S.GLOBAL_STYLES)]}_detachStyles(){for(let e of this._styleDetachers??[])e();this._styleDetachers=[]}},pt=ht;function wn(n={}){let{autoInit:e=!0,...t}=n,o=()=>new pt(t);return e?o():o}var Fi=wn;return Ln(Xi);})();