helldots 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,38 @@
1
- var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var Ot=Object.getOwnPropertyNames;var vt=Object.prototype.hasOwnProperty;var At=(t,e)=>{for(var o in e)ce(t,o,{get:e[o],enumerable:!0})},Nt=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ot(e))!vt.call(t,r)&&r!==o&&ce(t,r,{get:()=>e[r],enumerable:!(n=wt(e,r))||n.enumerable});return t};var Rt=t=>Nt(ce({},"__esModule",{value:!0}),t);var Nn={};At(Nn,{CommentOverlay:()=>we,createCommentOverlay:()=>St,default:()=>An});var Be="[modern-screenshot]",I=typeof window<"u",It=I&&"Worker"in window,In=I&&"atob"in window,Ln=I&&"btoa"in window,pe=I?window.navigator?.userAgent:"",Pe=pe.includes("Chrome"),K=pe.includes("AppleWebKit")&&!Pe,ue=pe.includes("Firefox"),Lt=t=>t&&"__CONTEXT__"in t,Bt=t=>t.constructor.name==="CSSFontFaceRule",Pt=t=>t.constructor.name==="CSSImportRule",Mt=t=>t.constructor.name==="CSSLayerBlockRule",O=t=>t.nodeType===1,G=t=>typeof t.className=="object",Me=t=>t.tagName==="image",$t=t=>t.tagName==="use",X=t=>O(t)&&typeof t.style<"u"&&!G(t),Dt=t=>t.nodeType===8,kt=t=>t.nodeType===3,$=t=>t.tagName==="IMG",Z=t=>t.tagName==="VIDEO",Ht=t=>t.tagName==="CANVAS",Xt=t=>t.tagName==="TEXTAREA",Ut=t=>t.tagName==="INPUT",Ft=t=>t.tagName==="STYLE",Gt=t=>t.tagName==="SCRIPT",Vt=t=>t.tagName==="SELECT",zt=t=>t.tagName==="SLOT",Yt=t=>t.tagName==="IFRAME",Wt=(...t)=>console.warn(Be,...t);function jt(t){let e=t?.createElement?.("canvas");return e&&(e.height=e.width=1),!!e&&"toDataURL"in e&&!!e.toDataURL("image/webp").includes("image/webp")}var de=t=>t.startsWith("data:");function $e(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(I&&t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i)||!I)return t;let o=Q().implementation.createHTMLDocument(),n=o.createElement("base"),r=o.createElement("a");return o.head.appendChild(n),o.body.appendChild(r),e&&(n.href=e),r.href=t,r.href}function Q(t){return(t&&O(t)?t?.ownerDocument:t)??window.document}var J="http://www.w3.org/2000/svg";function qt(t,e,o){let n=Q(o).createElementNS(J,"svg");return n.setAttributeNS(null,"width",t.toString()),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"viewBox",`0 0 ${t} ${e}`),n}function Kt(t,e){let o=new XMLSerializer().serializeToString(t);return e&&(o=o.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o)}`}function Zt(t,e){return new Promise((o,n)=>{let r=new FileReader;r.onload=()=>o(r.result),r.onerror=()=>n(r.error),r.onabort=()=>n(new Error(`Failed read blob to ${e}`)),e==="dataUrl"?r.readAsDataURL(t):e==="arrayBuffer"&&r.readAsArrayBuffer(t)})}var Qt=t=>Zt(t,"dataUrl");function M(t,e){let o=Q(e).createElement("img");return o.decoding="sync",o.loading="eager",o.src=t,o}function U(t,e){return new Promise(o=>{let{timeout:n,ownerDocument:r,onError:i,onWarn:l}=e??{},a=typeof t=="string"?M(t,Q(r)):t,d=null,p=null;function c(){o(a),d&&clearTimeout(d),p?.()}if(n&&(d=setTimeout(c,n)),Z(a)){let m=a.currentSrc||a.src;if(!m)return a.poster?U(a.poster,e).then(o):c();if(a.readyState>=2)return c();let u=c,h=g=>{l?.("Failed video load",m,g),i?.(g),c()};p=()=>{a.removeEventListener("loadeddata",u),a.removeEventListener("error",h)},a.addEventListener("loadeddata",u,{once:!0}),a.addEventListener("error",h,{once:!0})}else{let m=Me(a)?a.href.baseVal:a.currentSrc||a.src;if(!m)return c();let u=async()=>{if($(a)&&"decode"in a)try{await a.decode()}catch(g){l?.("Failed to decode image, trying to render anyway",a.dataset.originalSrc||m,g)}c()},h=g=>{l?.("Failed image load",a.dataset.originalSrc||m,g),c()};if($(a)&&a.complete)return u();p=()=>{a.removeEventListener("load",u),a.removeEventListener("error",h)},a.addEventListener("load",u,{once:!0}),a.addEventListener("error",h,{once:!0})}})}async function Jt(t,e){X(t)&&($(t)||Z(t)?await U(t,e):await Promise.all(["img","video"].flatMap(o=>Array.from(t.querySelectorAll(o)).map(n=>U(n,e)))))}var De=(function(){let e=0,o=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${o()}${e}`)})();function ke(t){return t?.split(",").map(e=>e.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var ve=0;function eo(t){let e=`${Be}[#${ve}]`;return ve++,{time:o=>t&&console.time(`${e} ${o}`),timeEnd:o=>t&&console.timeEnd(`${e} ${o}`),warn:(...o)=>t&&Wt(...o)}}function to(t){return{cache:t?"no-cache":"force-cache"}}async function He(t,e){return Lt(t)?t:oo(t,{...e,autoDestruct:!0})}async function oo(t,e){let{scale:o=1,workerUrl:n,workerNumber:r=1}=e||{},i=!!e?.debug,l=e?.features??!0,a=t.ownerDocument??(I?window.document:void 0),d=t.ownerDocument?.defaultView??(I?window:void 0),p=new Map,c={width:0,height:0,quality:1,type:"image/png",scale:o,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:to(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:eo(i),node:t,ownerDocument:a,ownerWindow:d,dpi:o===1?null:96*o,svgStyleElement:Xe(a),svgDefsElement:a?.createElementNS(J,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:It&&n&&r?r:0})].map(()=>{try{let h=new Worker(n);return h.onmessage=async g=>{let{url:f,result:E}=g.data;E?p.get(f)?.resolve?.(E):p.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`))},h.onmessageerror=g=>{let{url:f}=g.data;p.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`))},h}catch(h){return c.log.warn("Failed to new Worker",h),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[jt(a)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:p,drawImageCount:0,tasks:[],features:l,isEnable:h=>h==="restoreScrollPosition"?typeof l=="boolean"?!1:l[h]??!1:typeof l=="boolean"?l:l[h]??!0,shadowRoots:[]};c.log.time("wait until load"),await Jt(t,{timeout:c.timeout,onWarn:c.log.warn}),c.log.timeEnd("wait until load");let{width:m,height:u}=no(t,c);return c.width=m,c.height=u,c}function Xe(t){if(!t)return;let e=t.createElement("style"),o=e.ownerDocument.createTextNode(`
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
3
  .______background-clip--text {
3
4
  background-clip: text;
4
5
  -webkit-background-clip: text;
5
6
  }
6
- `);return e.appendChild(o),e}function no(t,e){let{width:o,height:n}=e;if(O(t)&&(!o||!n)){let r=t.getBoundingClientRect();o=o||r.width||Number(t.getAttribute("width"))||0,n=n||r.height||Number(t.getAttribute("height"))||0}return{width:o,height:n}}async function ro(t,e){let{log:o,timeout:n,drawImageCount:r,drawImageInterval:i}=e;o.time("image to canvas");let l=await U(t,{timeout:n,onWarn:e.log.warn}),{canvas:a,context2d:d}=io(t.ownerDocument,e),p=()=>{try{d?.drawImage(l,0,0,a.width,a.height)}catch(c){e.log.warn("Failed to drawImage",c)}};if(p(),e.isEnable("fixSvgXmlDecode"))for(let c=0;c<r;c++)await new Promise(m=>{setTimeout(()=>{d?.clearRect(0,0,a.width,a.height),p(),m()},c+i)});return e.drawImageCount=0,o.timeEnd("image to canvas"),a}function io(t,e){let{width:o,height:n,scale:r,backgroundColor:i,maximumCanvasSize:l}=e,a=t.createElement("canvas");a.width=Math.floor(o*r),a.height=Math.floor(n*r),a.style.width=`${o}px`,a.style.height=`${n}px`,l&&(a.width>l||a.height>l)&&(a.width>l&&a.height>l?a.width>a.height?(a.height*=l/a.width,a.width=l):(a.width*=l/a.height,a.height=l):a.width>l?(a.height*=l/a.width,a.width=l):(a.width*=l/a.height,a.height=l));let d=a.getContext("2d");return d&&i&&(d.fillStyle=i,d.fillRect(0,0,a.width,a.height)),{canvas:a,context2d:d}}function Ue(t,e){if(t.ownerDocument)try{let i=t.toDataURL();if(i!=="data:,")return M(i,t.ownerDocument)}catch(i){e.log.warn("Failed to clone canvas",i)}let o=t.cloneNode(!1),n=t.getContext("2d"),r=o.getContext("2d");try{return n&&r&&r.putImageData(n.getImageData(0,0,t.width,t.height),0,0),o}catch(i){e.log.warn("Failed to clone canvas",i)}return o}function so(t,e){try{if(t?.contentDocument?.documentElement)return me(t.contentDocument.documentElement,e)}catch(o){e.log.warn("Failed to clone iframe",o)}return t.cloneNode(!1)}function ao(t){let e=t.cloneNode(!1);return t.currentSrc&&t.currentSrc!==t.src&&(e.src=t.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager"),e}async function lo(t,e){if(t.ownerDocument&&!t.currentSrc&&t.poster)return M(t.poster,t.ownerDocument);let o=t.cloneNode(!1);o.crossOrigin="anonymous",t.currentSrc&&t.currentSrc!==t.src&&(o.src=t.currentSrc);let n=o.ownerDocument;if(n){let r=!0;if(await U(o,{onError:()=>r=!1,onWarn:e.log.warn}),!r)return t.poster?M(t.poster,t.ownerDocument):o;o.currentTime=t.currentTime,await new Promise(l=>{o.addEventListener("seeked",l,{once:!0})});let i=n.createElement("canvas");i.width=t.offsetWidth,i.height=t.offsetHeight;try{let l=i.getContext("2d");l&&l.drawImage(o,0,0,i.width,i.height)}catch(l){return e.log.warn("Failed to clone video",l),t.poster?M(t.poster,t.ownerDocument):o}return Ue(i,e)}return o}function co(t,e){return Ht(t)?Ue(t,e):Yt(t)?so(t,e):$(t)?ao(t):Z(t)?lo(t,e):t.cloneNode(!1)}function ho(t){let e=t.sandbox;if(!e){let{ownerDocument:o}=t;try{o&&(e=o.createElement("iframe"),e.id=`__SANDBOX__${De()}`,e.width="0",e.height="0",e.style.visibility="hidden",e.style.position="fixed",o.body.appendChild(e),e.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',t.sandbox=e)}catch(n){t.log.warn("Failed to getSandBox",n)}}return e}var po=["width","height","-webkit-text-fill-color"],uo=["stroke","fill"];function Fe(t,e,o){let{defaultComputedStyles:n}=o,r=t.nodeName.toLowerCase(),i=G(t)&&r!=="svg",l=i?uo.map(f=>[f,t.getAttribute(f)]).filter(([,f])=>f!==null):[],a=[i&&"svg",r,l.map((f,E)=>`${f}=${E}`).join(","),e].filter(Boolean).join(":");if(n.has(a))return n.get(a);let p=ho(o)?.contentWindow;if(!p)return new Map;let c=p?.document,m,u;i?(m=c.createElementNS(J,"svg"),u=m.ownerDocument.createElementNS(m.namespaceURI,r),l.forEach(([f,E])=>{u.setAttributeNS(null,f,E)}),m.appendChild(u)):m=u=c.createElement(r),u.textContent=" ",c.body.appendChild(m);let h=p.getComputedStyle(u,e),g=new Map;for(let f=h.length,E=0;E<f;E++){let b=h.item(E);po.includes(b)||g.set(b,h.getPropertyValue(b))}return c.body.removeChild(m),n.set(a,g),g}function Ge(t,e,o){let n=new Map,r=[],i=new Map;if(o)for(let a of o)l(a);else for(let a=t.length,d=0;d<a;d++){let p=t.item(d);l(p)}for(let a=r.length,d=0;d<a;d++)i.get(r[d])?.forEach((p,c)=>n.set(c,p));function l(a){let d=t.getPropertyValue(a),p=t.getPropertyPriority(a),c=a.lastIndexOf("-"),m=c>-1?a.substring(0,c):void 0;if(m){let u=i.get(m);u||(u=new Map,i.set(m,u)),u.set(a,[d,p])}e.get(a)===d&&!p||(m?r.push(m):n.set(a,[d,p]))}return n}function mo(t,e,o,n){let{ownerWindow:r,includeStyleProperties:i,currentParentNodeStyle:l}=n,a=e.style,d=r.getComputedStyle(t),p=Fe(t,null,n);l?.forEach((m,u)=>{p.delete(u)});let c=Ge(d,p,i);c.delete("transition-property"),c.delete("all"),c.delete("d"),c.delete("content"),o&&(c.delete("position"),c.delete("margin-top"),c.delete("margin-right"),c.delete("margin-bottom"),c.delete("margin-left"),c.delete("margin-block-start"),c.delete("margin-block-end"),c.delete("margin-inline-start"),c.delete("margin-inline-end"),c.set("box-sizing",["border-box",""])),c.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text"),Pe&&(c.has("font-kerning")||c.set("font-kerning",["normal",""]),(c.get("overflow-x")?.[0]==="hidden"||c.get("overflow-y")?.[0]==="hidden")&&c.get("text-overflow")?.[0]==="ellipsis"&&t.scrollWidth===t.clientWidth&&c.set("text-overflow",["clip",""]));for(let m=a.length,u=0;u<m;u++)a.removeProperty(a.item(u));return c.forEach(([m,u],h)=>{a.setProperty(h,m,u)}),c}function go(t,e){(Xt(t)||Ut(t)||Vt(t))&&e.setAttribute("value",t.value)}var fo=["::before","::after"],Eo=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function bo(t,e,o,n,r){let{ownerWindow:i,svgStyleElement:l,svgStyles:a,currentNodeStyle:d}=n;if(!l||!i)return;function p(c){let m=i.getComputedStyle(t,c),u=m.getPropertyValue("content");if(!u||u==="none")return;r?.(u),u=u.replace(/(')|(")|(counter\(.+\))/g,"");let h=[De()],g=Fe(t,c,n);d?.forEach((T,y)=>{g.delete(y)});let f=Ge(m,g,n.includeStyleProperties);f.delete("content"),f.delete("-webkit-locale"),f.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text");let E=[`content: '${u}';`];if(f.forEach(([T,y],_)=>{E.push(`${_}: ${T}${y?" !important":""};`)}),E.length===1)return;try{e.className=[e.className,...h].join(" ")}catch(T){n.log.warn("Failed to copyPseudoClass",T);return}let b=E.join(`
7
- `),C=a.get(b);C||(C=[],a.set(b,C)),C.push(`.${h[0]}${c}`)}fo.forEach(p),o&&Eo.forEach(p)}var Ae=new Set(["symbol"]);async function Ne(t,e,o,n,r){if(O(o)&&(Ft(o)||Gt(o))||n.filter&&!n.filter(o))return;Ae.has(e.nodeName)||Ae.has(o.nodeName)?n.currentParentNodeStyle=void 0:n.currentParentNodeStyle=n.currentNodeStyle;let i=await me(o,n,!1,r);n.isEnable("restoreScrollPosition")&&Co(t,i),e.appendChild(i)}async function Re(t,e,o,n){let r=t.firstChild;O(t)&&t.shadowRoot&&(r=t.shadowRoot?.firstChild,o.shadowRoots.push(t.shadowRoot));for(let i=r;i;i=i.nextSibling)if(!Dt(i))if(O(i)&&zt(i)&&typeof i.assignedNodes=="function"){let l=i.assignedNodes();for(let a=0;a<l.length;a++)await Ne(t,e,l[a],o,n)}else await Ne(t,e,i,o,n)}function Co(t,e){if(!X(t)||!X(e))return;let{scrollTop:o,scrollLeft:n}=t;if(!o&&!n)return;let{transform:r}=e.style,i=new DOMMatrix(r),{a:l,b:a,c:d,d:p}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-n,-o),i.a=l,i.b=a,i.c=d,i.d=p,e.style.transform=i.toString()}function To(t,e){let{backgroundColor:o,width:n,height:r,style:i}=e,l=t.style;if(o&&l.setProperty("background-color",o,"important"),n&&l.setProperty("width",`${n}px`,"important"),r&&l.setProperty("height",`${r}px`,"important"),i)for(let a in i)l[a]=i[a]}var yo=/^[\w-:]+$/;async function me(t,e,o=!1,n){let{ownerDocument:r,ownerWindow:i,fontFamilies:l,onCloneEachNode:a}=e;if(r&&kt(t))return n&&/\S/.test(t.data)&&n(t.data),r.createTextNode(t.data);if(r&&i&&O(t)&&(X(t)||G(t))){let p=await co(t,e);if(e.isEnable("removeAbnormalAttributes")){let f=p.getAttributeNames();for(let E=f.length,b=0;b<E;b++){let C=f[b];yo.test(C)||p.removeAttribute(C)}}let c=e.currentNodeStyle=mo(t,p,o,e);o&&To(p,e);let m=!1;if(e.isEnable("copyScrollbar")){let f=[c.get("overflow-x")?.[0],c.get("overflow-y")?.[0]];m=f.includes("scroll")||(f.includes("auto")||f.includes("overlay"))&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)}let u=c.get("text-transform")?.[0],h=ke(c.get("font-family")?.[0]),g=h?f=>{u==="uppercase"?f=f.toUpperCase():u==="lowercase"?f=f.toLowerCase():u==="capitalize"&&(f=f[0].toUpperCase()+f.substring(1)),h.forEach(E=>{let b=l.get(E);b||l.set(E,b=new Set),f.split("").forEach(C=>b.add(C))})}:void 0;return bo(t,p,m,e,g),go(t,p),Z(t)||await Re(t,p,e,g),await a?.(p),p}let d=t.cloneNode(!1);return await Re(t,d,e),await a?.(d),d}function xo(t){if(t.ownerDocument=void 0,t.ownerWindow=void 0,t.svgStyleElement=void 0,t.svgDefsElement=void 0,t.svgStyles.clear(),t.defaultComputedStyles.clear(),t.sandbox){try{t.sandbox.remove()}catch(e){t.log.warn("Failed to destroyContext",e)}t.sandbox=void 0}t.workers=[],t.fontFamilies.clear(),t.fontCssTexts.clear(),t.requests.clear(),t.tasks=[],t.shadowRoots=[]}function _o(t){let{url:e,timeout:o,responseType:n,...r}=t,i=new AbortController,l=o?setTimeout(()=>i.abort(),o):void 0;return fetch(e,{signal:i.signal,...r}).then(a=>{if(!a.ok)throw new Error("Failed fetch, not 2xx response",{cause:a});switch(n){case"arrayBuffer":return a.arrayBuffer();case"dataUrl":return a.blob().then(Qt);default:return a.text()}}).finally(()=>clearTimeout(l))}function F(t,e){let{url:o,requestType:n="text",responseType:r="text",imageDom:i}=e,l=o,{timeout:a,acceptOfImage:d,requests:p,fetchFn:c,fetch:{requestInit:m,bypassingCache:u,placeholderImage:h},font:g,workers:f,fontFamilies:E}=t;n==="image"&&(K||ue)&&t.drawImageCount++;let b=p.get(o);if(!b){u&&u instanceof RegExp&&u.test(l)&&(l+=(/\?/.test(l)?"&":"?")+new Date().getTime());let C=n.startsWith("font")&&g&&g.minify,T=new Set;C&&n.split(";")[1].split(",").forEach(q=>{E.has(q)&&E.get(q).forEach(Oe=>T.add(Oe))});let y=C&&T.size,_={url:l,timeout:a,responseType:y?"arrayBuffer":r,headers:n==="image"?{accept:d}:void 0,...m};b={type:n,resolve:void 0,reject:void 0,response:null},b.response=(async()=>{if(c&&n==="image"){let v=await c(o);if(v)return v}return!K&&o.startsWith("http")&&f.length?new Promise((v,q)=>{f[p.size&f.length-1].postMessage({rawUrl:o,..._}),b.resolve=v,b.reject=q}):_o(_)})().catch(v=>{if(p.delete(o),n==="image"&&h)return t.log.warn("Failed to fetch image base64, trying to use placeholder image",l),typeof h=="string"?h:h(i);throw v}),p.set(o,b)}return b.response}async function Ve(t,e,o,n){if(!ze(t))return t;for(let[r,i]of So(t,e))try{let l=await F(o,{url:i,requestType:n?"image":"text",responseType:"dataUrl"});t=t.replace(wo(r),`$1${l}$3`)}catch(l){o.log.warn("Failed to fetch css data url",r,l)}return t}function ze(t){return/url\((['"]?)([^'"]+?)\1\)/.test(t)}var Ye=/url\((['"]?)([^'"]+?)\1\)/g;function So(t,e){let o=[];return t.replace(Ye,(n,r,i)=>(o.push([i,$e(i,e)]),n)),o.filter(([n])=>!de(n))}function wo(t){let e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}var Oo=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function vo(t,e){return Oo.map(o=>{let n=t.getPropertyValue(o);return!n||n==="none"?null:((K||ue)&&e.drawImageCount++,Ve(n,null,e,!0).then(r=>{!r||n===r||t.setProperty(o,r,t.getPropertyPriority(o))}))}).filter(Boolean)}function Ao(t,e){if($(t)){let o=t.currentSrc||t.src;if(!de(o))return[F(e,{url:o,imageDom:t,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(t.srcset="",t.dataset.originalSrc=o,t.src=n||"")})];(K||ue)&&e.drawImageCount++}else if(G(t)&&!de(t.href.baseVal)){let o=t.href.baseVal;return[F(e,{url:o,imageDom:t,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(t.dataset.originalSrc=o,t.href.baseVal=n||"")})]}return[]}function No(t,e){let{ownerDocument:o,svgDefsElement:n}=e,r=t.getAttribute("href")??t.getAttribute("xlink:href");if(!r)return[];let[i,l]=r.split("#");if(l){let a=`#${l}`,d=e.shadowRoots.reduce((p,c)=>p??c.querySelector(`svg ${a}`),o?.querySelector(`svg ${a}`));if(i&&t.setAttribute("href",a),n?.querySelector(a))return[];if(d)return n?.appendChild(d.cloneNode(!0)),[];if(i)return[F(e,{url:i,responseType:"text"}).then(p=>{n?.insertAdjacentHTML("beforeend",p)})]}return[]}function We(t,e){let{tasks:o}=e;O(t)&&(($(t)||Me(t))&&o.push(...Ao(t,e)),$t(t)&&o.push(...No(t,e))),X(t)&&o.push(...vo(t.style,e)),t.childNodes.forEach(n=>{We(n,e)})}async function Ro(t,e){let{ownerDocument:o,svgStyleElement:n,fontFamilies:r,fontCssTexts:i,tasks:l,font:a}=e;if(!(!o||!n||!r.size))if(a&&a.cssText){let d=Le(a.cssText,e);n.appendChild(o.createTextNode(`${d}
8
- `))}else{let d=Array.from(o.styleSheets).filter(h=>{try{return"cssRules"in h&&!!h.cssRules.length}catch(g){return e.log.warn(`Error while reading CSS rules from ${h.href}`,g),!1}}),p=o.implementation.createHTMLDocument(""),c=p.createElement("style");p.head.appendChild(c);let m=c.sheet;await Promise.all(d.flatMap(h=>Array.from(h.cssRules).map(async g=>{if(Pt(g)){let f=g.href,E="";try{E=await F(e,{url:f,requestType:"text",responseType:"text"})}catch(C){e.log.warn(`Error fetch remote css import from ${f}`,C)}let b=E.replace(Ye,(C,T,y)=>C.replace(y,$e(y,f)));for(let C of Lo(b))try{m.insertRule(C,m.cssRules.length)}catch(T){e.log.warn("Error inserting rule from remote css import",{rule:C,error:T})}}}))),m.cssRules.length&&d.push(m);let u=[];d.forEach(h=>{he(h.cssRules,u)}),u.filter(h=>Bt(h)&&ze(h.style.getPropertyValue("src"))&&ke(h.style.getPropertyValue("font-family"))?.some(g=>r.has(g))).forEach(h=>{let g=h,f=i.get(g.cssText);f?n.appendChild(o.createTextNode(`${f}
9
- `)):l.push(Ve(g.cssText,g.parentStyleSheet?g.parentStyleSheet.href:null,e).then(E=>{E=Le(E,e),i.set(g.cssText,E),n.appendChild(o.createTextNode(`${E}
10
- `))}))})}}var Io=/(\/\*[\s\S]*?\*\/)/g,Ie=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Lo(t){if(t==null)return[];let e=[],o=t.replace(Io,"");for(;;){let i=Ie.exec(o);if(!i)break;e.push(i[0])}o=o.replace(Ie,"");let n=/@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=n.exec(o);if(i)r.lastIndex=n.lastIndex;else if(i=r.exec(o),i)n.lastIndex=r.lastIndex;else break;e.push(i[0])}return e}var Bo=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Po=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Le(t,e){let{font:o}=e,n=o?o?.preferredFormat:void 0;return n?t.replace(Po,r=>{for(;;){let[i,,l]=Bo.exec(r)||[];if(!l)return"";if(l===n)return`src: ${i};`}}):t}function he(t,e=[]){for(let o of Array.from(t))Mt(o)?e.push(...he(o.cssRules)):"cssRules"in o?he(o.cssRules,e):e.push(o);return e}var Mo=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function $o(t){return Mo.test(t.innerHTML)}async function Do(t,e){let o=await He(t,e);if(O(o.node)&&G(o.node)&&!$o(o.node))return o.node;let{ownerDocument:n,log:r,tasks:i,svgStyleElement:l,svgDefsElement:a,svgStyles:d,font:p,progress:c,autoDestruct:m,onCloneNode:u,onEmbedNode:h,onCreateForeignObjectSvg:g}=o;r.time("clone node");let f=await me(o.node,o,!0);if(l&&n){let y="";d.forEach((_,v)=>{y+=`${_.join(`,
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(`,
11
12
  `)} {
12
- ${v}
13
+ ${_}
13
14
  }
14
- `}),l.appendChild(n.createTextNode(y))}r.timeEnd("clone node"),await u?.(f),p!==!1&&O(f)&&(r.time("embed web font"),await Ro(f,o),r.timeEnd("embed web font")),r.time("embed node"),We(f,o);let E=i.length,b=0,C=async()=>{for(;;){let y=i.pop();if(!y)break;try{await y}catch(_){o.log.warn("Failed to run task",_)}c?.(++b,E)}};c?.(b,E),await Promise.all([...Array.from({length:4})].map(C)),r.timeEnd("embed node"),await h?.(f);let T=ko(f,o);return a&&T.insertBefore(a,T.children[0]),l&&T.insertBefore(l,T.children[0]),m&&xo(o),await g?.(T),T}function ko(t,e){let{width:o,height:n}=e,r=qt(o,n,t.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(t),r.appendChild(i),r}async function je(t,e){let o=await He(t,e),n=await Do(o),r=Kt(n,o.isEnable("removeControlCharacter"));o.autoDestruct||(o.svgStyleElement=Xe(o.ownerDocument),o.svgDefsElement=o.ownerDocument?.createElementNS(J,"defs"),o.svgStyles.clear());let i=M(r,n.ownerDocument);return await ro(i,o)}var L="helldots-root",Ho=()=>{customElements.get(L)||customElements.define(L,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function qe(){Ho();let t=document.querySelector(L);return t||(t=document.createElement(L),document.body.appendChild(t)),t.shadowRoot}var ee=.5,Xo=.7,Ke=t=>!t||t==="transparent"||t==="rgba(0, 0, 0, 0)",Uo=()=>{let t=getComputedStyle(document.documentElement).backgroundColor;if(!Ke(t))return t;let e=getComputedStyle(document.body).backgroundColor;return Ke(e)?"#ffffff":e};async function ge({scale:t=1}={}){return je(document.body,{scale:t,backgroundColor:Uo()})}async function fe(t){let e=document.querySelector(L),o=e?.style.display;e&&(e.style.display="none");try{return await t()}finally{e&&(e.style.display=o||"")}}function Ze(t,{left:e,top:o,width:n,height:r}){let i=document.createElement("canvas");i.width=n,i.height=r;let l=i.getContext("2d");return l?(l.drawImage(t,e+window.scrollX,o+window.scrollY,n,r,0,0,n,r),i.toDataURL("image/png")):null}function Ee(t,{sourceScale:e=1,outputScale:o=ee,quality:n=Xo}={}){let r=document.createElement("canvas");r.width=Math.round(window.innerWidth*o),r.height=Math.round(window.innerHeight*o);let i=r.getContext("2d");return i?(i.drawImage(t,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,r.width,r.height),r.toDataURL("image/jpeg",n)):null}var Fo=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],Go=[{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/}],Vo={name:"unknown",version:""},zo=t=>/not[\W_]*a[\W_]*brand/i.test(t),Qe=(t,e)=>{for(let{name:o,re:n}of t){let r=e.match(n);if(r)return{name:o,version:(r[1]||"").replace(/_/g,".")}}return{...Vo}};function Je(t=window){let e=t.navigator||{},o=e.userAgent||"",n=e.userAgentData,r=Qe(Fo,o),i=n?.brands?.find(a=>!zo(a.brand));i&&(r={name:i.brand,version:i.version||""});let l=Qe(Go,o);return n?.platform&&(l.name=n.platform),{version:1,url:t.location?.href||"",viewport:{width:t.innerWidth,height:t.innerHeight},screen:{width:t.screen?.width??0,height:t.screen?.height??0},devicePixelRatio:t.devicePixelRatio??1,userAgent:o,browser:r,os:l,language:e.language||""}}var s={CIRCLE:"comment-circle",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_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",THREAD_TIME:"thread-time",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",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_OPTION:"inbox-filter-option",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",INBOX_EMPTY:"inbox-empty",CLASSIFY_ROW:"classify-row",TAGS_INPUT:"tags-input",TAG_CHIP:"tag-chip",TAG_CHIP_REMOVE:"tag-chip-remove",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",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_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",HIGHLIGHT:"helldots-highlight"},x={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"},V=["open","in_progress","resolved"],et={open:"#2E90FA",in_progress:"#FF9F0A",resolved:"#30D158"},A=["bug","suggestion","question","improvement"],D={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},N=["high","medium","low"],k={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},tt={CONTAINER:'section, div[class*="container"], div[class*="content"]'},S={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001},ot='data:image/svg+xml;utf8,<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><g filter="url(%23filter0_d_4_97)"><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><filter id="filter0_d_4_97" x="0" y="0" width="48" height="48" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="4" dy="4"/><feGaussianBlur stdDeviation="5"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0.180392 0 0 0 0 0.564706 0 0 0 0 0.980392 0 0 0 0.16 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4_97"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4_97" result="shape"/></filter></svg>';var nt=()=>`
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=()=>`
15
36
 
16
37
  :host {
17
38
  all: initial;
@@ -34,19 +55,19 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
34
55
  color: inherit;
35
56
  }
36
57
 
37
- #${x.TOOLBAR} {
58
+ #${y.TOOLBAR} {
38
59
  position: fixed;
39
60
  bottom: 20px;
40
61
  left: 50%;
41
62
  transform: translateX(-50%);
42
- z-index: ${S.TOOLBAR};
63
+ z-index: ${O.TOOLBAR};
43
64
  }
44
65
 
45
- .${s.TOOLBAR_ACTION_WRAPPER} {
66
+ .${i.TOOLBAR_ACTION_WRAPPER} {
46
67
  position: relative;
47
68
  }
48
69
 
49
- .${s.TOOLBAR_ACTION_TOOLTIP} {
70
+ .${i.TOOLBAR_ACTION_TOOLTIP} {
50
71
  position: absolute;
51
72
  bottom: calc(100% + 10px);
52
73
  left: 50%;
@@ -68,19 +89,19 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
68
89
  transition: opacity 0.15s ease, transform 0.15s ease;
69
90
  }
70
91
 
71
- .${s.TOOLBAR_ACTION_WRAPPER}:hover .${s.TOOLBAR_ACTION_TOOLTIP} {
92
+ .${i.TOOLBAR_ACTION_WRAPPER}:hover .${i.TOOLBAR_ACTION_TOOLTIP} {
72
93
  opacity: 1;
73
94
  pointer-events: auto;
74
95
  transform: translateX(-50%) translateY(0);
75
96
  }
76
97
 
77
- .${s.TOOLBAR_TEXT} {
98
+ .${i.TOOLBAR_TEXT} {
78
99
  font-size: 13px;
79
100
  font-weight: 500;
80
101
  letter-spacing: -0.01em;
81
102
  }
82
103
 
83
- .${s.SHORTCUT_HINT} {
104
+ .${i.SHORTCUT_HINT} {
84
105
  font-size: 11px;
85
106
  font-weight: 500;
86
107
  color: rgba(255, 255, 255, 0.5);
@@ -92,7 +113,7 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
92
113
  white-space: nowrap;
93
114
  }
94
115
 
95
- .${s.TOOLBAR_ACTIONS} {
116
+ .${i.TOOLBAR_ACTIONS} {
96
117
  display: flex;
97
118
  flex-direction: row;
98
119
  background: rgba(20, 20, 23, 0.95);
@@ -102,7 +123,7 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
102
123
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
103
124
  }
104
125
 
105
- .${s.TOOLBAR_ACTION_BTN} {
126
+ .${i.TOOLBAR_ACTION_BTN} {
106
127
  width: 42px;
107
128
  height: 42px;
108
129
  display: flex;
@@ -117,85 +138,69 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
117
138
  padding: 0;
118
139
  }
119
140
 
120
- .${s.TOOLBAR_ACTION_WRAPPER}:first-child .${s.TOOLBAR_ACTION_BTN} {
141
+ .${i.TOOLBAR_ACTION_WRAPPER}:first-child .${i.TOOLBAR_ACTION_BTN} {
121
142
  border-radius: 12px 0 0 12px;
122
143
  }
123
144
 
124
- .${s.TOOLBAR_ACTION_WRAPPER}:last-child .${s.TOOLBAR_ACTION_BTN} {
145
+ .${i.TOOLBAR_ACTION_WRAPPER}:last-child .${i.TOOLBAR_ACTION_BTN} {
125
146
  border-radius: 0 12px 12px 0;
126
147
  }
127
148
 
128
- .${s.TOOLBAR_ACTION_BTN}:hover {
149
+ .${i.TOOLBAR_ACTION_BTN}:hover {
129
150
  background: rgba(255, 255, 255, 0.08);
130
151
  color: white;
131
152
  }
132
153
 
133
- .${s.TOOLBAR_COMMENT_BTN}.${s.ACTIVE} {
154
+ .${i.TOOLBAR_COMMENT_BTN}.${i.ACTIVE} {
134
155
  color: #2E90FA;
135
156
  background: rgba(46, 144, 250, 0.1);
136
157
  }
137
158
 
138
159
 
139
- #${x.COMMENT_BOX} {
160
+ #${y.COMMENT_BOX} {
140
161
  position: fixed;
141
162
  background: #1C1C1E;
142
163
  border-radius: 12px;
143
164
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
144
165
  padding: 16px;
145
- z-index: ${S.COMMENT_BOX};
146
- width: 400px;
166
+ z-index: ${O.COMMENT_BOX};
167
+ width: min(400px, calc(100vw - 24px));
147
168
  display: none;
148
169
  box-sizing: border-box;
149
170
  }
150
-
151
- #${x.COMMENT_BOX} .${s.COMMENT_INPUT_AREA} {
171
+
172
+ #${y.COMMENT_BOX} .${i.COMMENT_INPUT_AREA} {
152
173
  display: flex;
153
174
  flex-direction: column;
154
175
  gap: 0;
155
176
  }
156
177
 
157
- .${s.CLASSIFY_ROW} {
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} {
158
182
  display: flex;
159
183
  align-items: center;
160
184
  flex-wrap: wrap;
161
- gap: 6px;
162
- padding: 8px 10px 0;
163
- }
164
- .${s.TAGS_INPUT} {
165
- flex: 1 1 90px;
166
- min-width: 90px;
167
- background: transparent;
168
- border: none;
169
- outline: none;
170
- color: inherit;
171
- font-size: 12px;
172
- padding: 2px 0;
173
- }
174
- .${s.TAG_CHIP} {
175
- display: inline-flex;
176
- align-items: center;
177
- gap: 4px;
178
- padding: 2px 6px;
179
- border-radius: 10px;
180
- background: rgba(255, 255, 255, 0.1);
181
- font-size: 11px;
182
- line-height: 1.4;
185
+ gap: 8px;
186
+ padding: 0 0 10px;
187
+ border-bottom: 1px solid rgba(255, 255, 255, 0.08);
183
188
  }
184
- .${s.TAG_CHIP_REMOVE} {
185
- background: none;
186
- border: none;
187
- color: inherit;
188
- cursor: pointer;
189
- padding: 0;
190
- font-size: 13px;
191
- line-height: 1;
192
- opacity: 0.6;
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;
193
197
  }
194
- .${s.TAG_CHIP_REMOVE}:hover {
195
- opacity: 1;
198
+
199
+ .${i.CLASSIFY_ROW} .${i.INBOX_ACTION_BTN}:hover {
200
+ border-color: rgba(255, 255, 255, 0.28);
196
201
  }
197
202
 
198
- #${x.COMMENT_INPUT} {
203
+ #${y.COMMENT_INPUT} {
199
204
  flex: 1;
200
205
  min-height: 20px;
201
206
  background: #1C1C1E;
@@ -207,27 +212,26 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
207
212
  line-height: 1.4;
208
213
  box-sizing: border-box;
209
214
  field-sizing: content;
210
- padding-top: 4px;
211
- padding-bottom: 8px;
215
+ padding: 8px 0;
212
216
  }
213
217
 
214
- #${x.COMMENT_INPUT}::placeholder {
218
+ #${y.COMMENT_INPUT}::placeholder {
215
219
  color: rgba(255, 255, 255, 0.5);
216
220
  }
217
221
 
218
- #${x.COMMENT_INPUT}:focus {
222
+ #${y.COMMENT_INPUT}:focus {
219
223
  outline: none;
220
224
  box-shadow: none;
221
225
  }
222
226
 
223
- .${s.COMMENT_ACTIONS_BAR} {
227
+ .${i.COMMENT_ACTIONS_BAR} {
224
228
  display: flex;
225
229
  align-items: center;
226
230
  justify-content: space-between;
227
231
  padding-top: 12px;
228
232
  }
229
233
 
230
- .${s.ATTACH_IMAGE_BTN} {
234
+ .${i.ATTACH_IMAGE_BTN} {
231
235
  background: none;
232
236
  border: none;
233
237
  color: rgba(255, 255, 255, 0.5);
@@ -239,12 +243,12 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
239
243
  transition: background 0.2s, color 0.2s;
240
244
  }
241
245
 
242
- .${s.ATTACH_IMAGE_BTN}:hover {
246
+ .${i.ATTACH_IMAGE_BTN}:hover {
243
247
  background: rgba(255, 255, 255, 0.1);
244
248
  color: rgba(255, 255, 255, 0.8);
245
249
  }
246
250
 
247
- .${s.CIRCLE} {
251
+ .${i.CIRCLE} {
248
252
  position: absolute;
249
253
  width: 28px;
250
254
  height: 28px;
@@ -254,68 +258,101 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
254
258
  cursor: pointer;
255
259
  box-shadow: 0 1px 5px rgba(0,0,0,0.2);
256
260
  transition: transform 0.2s, background 0.2s;
257
- z-index: ${S.CIRCLE};
261
+ z-index: ${O.CIRCLE};
258
262
  transform: translate(-50%, -50%);
259
263
  }
260
264
 
261
- .${s.CIRCLE}:hover {
265
+ .${i.CIRCLE}:hover {
262
266
  transform: translate(-50%, -50%) scale(1.2) !important;
263
267
  background: rgb(0, 123, 255);
264
268
  }
265
269
 
266
- .${s.CIRCLE}.${s.HIGHLIGHT} {
270
+ .${i.CIRCLE}.${i.HIGHLIGHT} {
267
271
  transform: translate(-50%, -50%) scale(1.2) !important;
268
272
  background: rgb(0, 123, 255);
269
273
  box-shadow: 0 0 0 4px rgba(46, 144, 250, 0.35), 0 1px 5px rgba(0,0,0,0.2);
270
274
  }
271
275
 
272
- .${s.CIRCLE_WRAPPER} {
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} {
273
287
  position: absolute;
274
288
  left: 0;
275
289
  top: 0;
276
290
  width: 100%;
277
291
  height: 100%;
278
292
  pointer-events: none;
279
- z-index: ${S.CIRCLE};
293
+ z-index: ${O.CIRCLE};
280
294
  }
281
295
 
282
- .${s.TOOLTIP} {
296
+ .${i.TOOLTIP} {
283
297
  position: fixed;
284
298
  background: #1C1C1E;
285
299
  border-radius: 12px;
286
300
  padding: 16px;
287
301
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
288
- width: 400px;
289
- z-index: ${S.TOOLTIP};
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};
290
307
  color: white;
291
308
  font-size: 14px;
292
309
  line-height: 1.5;
293
310
  box-sizing: border-box;
294
311
  }
295
312
 
296
- .${s.TOOLTIP} .${s.THREAD_HEADER} {
313
+ .${i.TOOLTIP} .${i.THREAD_HEADER} {
297
314
  padding: 0 0 0;
298
315
  }
299
316
 
300
- .${s.TOOLTIP} .${s.THREAD_BODY} {
317
+ .${i.TOOLTIP} .${i.THREAD_BODY} {
301
318
  padding: 8px 0;
302
319
  }
303
320
 
304
- .${s.THREAD_POPOVER} {
321
+ .${i.THREAD_POPOVER} {
305
322
  position: fixed;
306
323
  background: #1C1C1E;
307
324
  border-radius: 12px;
308
325
  padding: 16px;
309
326
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
310
- width: 400px;
311
- z-index: ${S.TOOLTIP};
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};
312
332
  color: white;
313
333
  font-size: 14px;
314
334
  line-height: 1.5;
315
335
  box-sizing: border-box;
316
336
  }
317
337
 
318
- .${s.INBOX_PANEL} {
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} {
319
356
  position: fixed;
320
357
  top: 16px;
321
358
  right: 16px;
@@ -327,7 +364,7 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
327
364
  border: 1px solid rgba(255,255,255,0.08);
328
365
  border-radius: 14px;
329
366
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
330
- z-index: ${S.COMMENT_BOX};
367
+ z-index: ${O.COMMENT_BOX};
331
368
  color: white;
332
369
  font-size: 14px;
333
370
  line-height: 1.5;
@@ -335,15 +372,17 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
335
372
  overflow: hidden;
336
373
  }
337
374
 
338
- @media (max-width: 420px) {
339
- .${s.INBOX_PANEL} {
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} {
340
379
  left: 16px;
341
380
  width: auto;
342
381
  }
343
382
  }
344
383
 
345
- .${s.INBOX_HEADER},
346
- .${s.INBOX_DETAIL_HEADER} {
384
+ .${i.INBOX_HEADER},
385
+ .${i.INBOX_DETAIL_HEADER} {
347
386
  display: flex;
348
387
  align-items: center;
349
388
  justify-content: space-between;
@@ -353,11 +392,11 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
353
392
  flex: none;
354
393
  }
355
394
 
356
- .${s.INBOX_FILTER}-wrapper {
395
+ .${i.INBOX_FILTER}-wrapper {
357
396
  position: relative;
358
397
  }
359
398
 
360
- .${s.INBOX_FILTER} {
399
+ .${i.INBOX_FILTER} {
361
400
  display: flex;
362
401
  align-items: center;
363
402
  gap: 6px;
@@ -371,46 +410,97 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
371
410
  border-radius: 6px;
372
411
  }
373
412
 
374
- .${s.INBOX_FILTER}:hover {
413
+ .${i.INBOX_FILTER}:hover {
375
414
  background: rgba(255,255,255,0.08);
376
415
  }
377
416
 
378
- .${s.INBOX_FILTER_MENU} {
417
+ .${i.INBOX_FILTER_MENU} {
379
418
  position: absolute;
380
- top: calc(100% + 4px);
419
+ top: calc(100% + 6px);
381
420
  left: 0;
382
421
  background: #2C2C2E;
383
422
  border: 1px solid rgba(255,255,255,0.1);
384
- border-radius: 8px;
385
- padding: 4px;
386
- min-width: 190px;
423
+ border-radius: 12px;
424
+ padding: 14px;
425
+ width: 300px;
426
+ max-width: calc(100vw - 40px);
387
427
  z-index: 1;
388
- box-shadow: 0 4px 16px rgba(0,0,0,0.4);
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;
389
462
  }
390
463
 
391
- .${s.INBOX_FILTER_SECTION} {
392
- padding: 8px 10px 4px;
464
+ .${i.INBOX_FILTER_SECTION} {
393
465
  font-size: 11px;
394
466
  font-weight: 600;
395
467
  color: rgba(255,255,255,0.45);
396
- text-transform: none;
468
+ margin-bottom: 8px;
397
469
  }
398
470
 
399
- .${s.INBOX_FILTER_SECTION}:not(:first-child) {
400
- margin-top: 4px;
401
- border-top: 1px solid rgba(255,255,255,0.1);
402
- padding-top: 10px;
471
+ .${i.INBOX_FILTER_CHIPS} {
472
+ display: flex;
473
+ flex-wrap: wrap;
474
+ gap: 6px;
403
475
  }
404
476
 
405
- .${s.INBOX_FILTER_OPTION} {
406
- display: flex;
407
- justify-content: space-between;
408
- align-items: center;
409
- gap: 12px;
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;
410
492
  }
411
493
 
412
- .${s.INBOX_FILTER_OPTION},
413
- .${s.INBOX_MENU_ITEM} {
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} {
414
504
  display: block;
415
505
  width: 100%;
416
506
  text-align: left;
@@ -423,14 +513,13 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
423
513
  cursor: pointer;
424
514
  }
425
515
 
426
- .${s.INBOX_FILTER_OPTION}:hover,
427
- .${s.INBOX_MENU_ITEM}:hover {
516
+ .${i.INBOX_MENU_ITEM}:hover {
428
517
  background: rgba(255,255,255,0.08);
429
518
  }
430
519
 
431
- .${s.INBOX_CLOSE},
432
- .${s.INBOX_NAV_BTN},
433
- .${s.INBOX_BACK} {
520
+ .${i.INBOX_CLOSE},
521
+ .${i.INBOX_NAV_BTN},
522
+ .${i.INBOX_BACK} {
434
523
  display: flex;
435
524
  align-items: center;
436
525
  gap: 4px;
@@ -443,34 +532,34 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
443
532
  font-size: 14px;
444
533
  }
445
534
 
446
- .${s.INBOX_CLOSE} {
535
+ .${i.INBOX_CLOSE} {
447
536
  font-size: 20px;
448
537
  line-height: 1;
449
538
  }
450
539
 
451
- .${s.INBOX_CLOSE}:hover,
452
- .${s.INBOX_NAV_BTN}:not(:disabled):hover,
453
- .${s.INBOX_BACK}:hover {
540
+ .${i.INBOX_CLOSE}:hover,
541
+ .${i.INBOX_NAV_BTN}:not(:disabled):hover,
542
+ .${i.INBOX_BACK}:hover {
454
543
  background: rgba(255,255,255,0.08);
455
544
  color: white;
456
545
  }
457
546
 
458
- .${s.INBOX_NAV_BTN}:disabled {
547
+ .${i.INBOX_NAV_BTN}:disabled {
459
548
  opacity: 0.35;
460
549
  cursor: default;
461
550
  }
462
551
 
463
- .${s.INBOX_LIST},
464
- .${s.INBOX_DETAIL} {
552
+ .${i.INBOX_LIST},
553
+ .${i.INBOX_DETAIL} {
465
554
  flex: 1;
466
- overflow-y: auto;
555
+ overflow-y: auto;${de}
467
556
  padding: 12px;
468
557
  display: flex;
469
558
  flex-direction: column;
470
559
  gap: 12px;
471
560
  }
472
561
 
473
- .${s.INBOX_CARD} {
562
+ .${i.INBOX_CARD} {
474
563
  border: 1px solid rgba(255,255,255,0.1);
475
564
  border-radius: 10px;
476
565
  padding: 12px;
@@ -479,38 +568,43 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
479
568
  gap: 8px;
480
569
  }
481
570
 
482
- .${s.INBOX_LIST} .${s.INBOX_CARD} {
571
+ .${i.INBOX_LIST} .${i.INBOX_CARD} {
483
572
  cursor: pointer;
484
573
  }
485
574
 
486
- .${s.INBOX_LIST} .${s.INBOX_CARD}:hover {
575
+ .${i.INBOX_LIST} .${i.INBOX_CARD}:hover {
487
576
  border-color: rgba(255,255,255,0.22);
488
577
  }
489
578
 
490
- .${s.INBOX_CARD}--resolved {
579
+ .${i.INBOX_CARD}--resolved {
491
580
  border-color: rgba(48, 209, 88, 0.4);
492
581
  opacity: 0.75;
493
582
  }
494
583
 
495
- .${s.INBOX_LIST} .${s.INBOX_CARD}--resolved:hover {
584
+ .${i.INBOX_LIST} .${i.INBOX_CARD}--resolved:hover {
496
585
  border-color: rgba(48, 209, 88, 0.7);
497
586
  opacity: 1;
498
587
  }
499
588
 
500
- .${s.INBOX_CARD_HEADER} {
589
+ .${i.INBOX_CARD_HEADER} {
501
590
  display: flex;
502
591
  align-items: center;
503
592
  justify-content: space-between;
504
593
  gap: 8px;
505
594
  }
506
595
 
507
- .${s.INBOX_CARD_ACTIONS} {
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} {
508
600
  display: flex;
509
601
  align-items: center;
602
+ flex-wrap: wrap;
603
+ justify-content: flex-end;
510
604
  gap: 6px;
511
605
  }
512
606
 
513
- .${s.INBOX_ACTION_BTN} {
607
+ .${i.INBOX_ACTION_BTN} {
514
608
  display: flex;
515
609
  align-items: center;
516
610
  justify-content: center;
@@ -523,32 +617,30 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
523
617
  cursor: pointer;
524
618
  }
525
619
 
526
- .${s.INBOX_ACTION_BTN}:hover {
620
+ .${i.INBOX_ACTION_BTN}:hover {
527
621
  background: rgba(255,255,255,0.08);
528
622
  color: white;
529
623
  }
530
624
 
531
- /* Type/priority pickers show their current value as text next to the
532
- dot (colour alone can't tell bug/high apart \u2014 same hex, and there's
533
- no hover on touch). Grow from the square icon-button width but stay
534
- bounded so the strip doesn't crowd out copy/status/\u22EF next to it. */
535
- .${s.INBOX_ACTION_BTN_LABELED} {
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} {
536
630
  width: auto;
537
- max-width: 72px;
538
631
  padding: 0 8px 0 6px;
539
632
  gap: 5px;
540
633
  justify-content: flex-start;
634
+ flex: none;
541
635
  }
542
636
 
543
- .${s.INBOX_ACTION_LABEL} {
637
+ .${i.INBOX_ACTION_LABEL} {
544
638
  font-size: 11px;
545
639
  line-height: 1;
546
640
  white-space: nowrap;
547
- overflow: hidden;
548
- text-overflow: ellipsis;
549
641
  }
550
642
 
551
- .${s.INBOX_STATUS_DOT} {
643
+ .${i.INBOX_STATUS_DOT} {
552
644
  width: 12px;
553
645
  height: 12px;
554
646
  border-radius: 50%;
@@ -557,7 +649,7 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
557
649
  flex: none;
558
650
  }
559
651
 
560
- .${s.INBOX_MENU_ITEM} .${s.INBOX_STATUS_DOT} {
652
+ .${i.INBOX_MENU_ITEM} .${i.INBOX_STATUS_DOT} {
561
653
  width: 9px;
562
654
  height: 9px;
563
655
  border: none;
@@ -565,13 +657,21 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
565
657
  vertical-align: baseline;
566
658
  }
567
659
 
568
- .${s.INBOX_MENU_ITEM}[aria-checked="true"] {
660
+ .${i.INBOX_MENU_ITEM}[aria-checked="true"] {
569
661
  background: rgba(255,255,255,0.08);
570
662
  }
571
663
 
572
- .${s.THREAD_HEADER} .${s.INBOX_CARD_ACTIONS} {
573
- margin-left: auto;
574
- margin-right: 8px;
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;
575
675
  }
576
676
 
577
677
  /* Generic hover tooltip, same look as .thread-time[data-full-date] */
@@ -601,7 +701,7 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
601
701
  opacity: 1;
602
702
  }
603
703
 
604
- .${s.INBOX_MENU} {
704
+ .${i.INBOX_MENU} {
605
705
  position: absolute;
606
706
  top: calc(100% + 4px);
607
707
  right: 0;
@@ -614,12 +714,12 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
614
714
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
615
715
  }
616
716
 
617
- .${s.INBOX_CARD_TEXT} {
717
+ .${i.INBOX_CARD_TEXT} {
618
718
  white-space: pre-wrap;
619
719
  word-break: break-word;
620
720
  }
621
721
 
622
- .${s.INBOX_CARD_TAG} {
722
+ .${i.INBOX_CARD_TAG} {
623
723
  align-self: flex-start;
624
724
  padding: 1px 8px;
625
725
  border-radius: 999px;
@@ -629,7 +729,7 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
629
729
  font-weight: 600;
630
730
  }
631
731
 
632
- .${s.INBOX_BADGES} {
732
+ .${i.INBOX_BADGES} {
633
733
  display: flex;
634
734
  flex-wrap: wrap;
635
735
  gap: 4px;
@@ -640,10 +740,13 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
640
740
  the tags input, and the classify row's own gap already spaces it
641
741
  from its siblings, so an extra margin here would nudge it out of
642
742
  alignment with them. */
643
- .${s.INBOX_CARD} .${s.INBOX_BADGES} {
743
+ .${i.INBOX_CARD} .${i.INBOX_BADGES} {
644
744
  margin-top: 6px;
645
745
  }
646
- .${s.BADGE} {
746
+ .${i.TOOLTIP} .${i.INBOX_BADGES} {
747
+ margin-bottom: 4px;
748
+ }
749
+ .${i.BADGE} {
647
750
  display: inline-flex;
648
751
  align-items: center;
649
752
  padding: 1px 6px;
@@ -654,36 +757,75 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
654
757
  letter-spacing: 0.01em;
655
758
  white-space: nowrap;
656
759
  }
657
- .${s.BADGE_TYPE},
658
- .${s.BADGE_PRIORITY} {
760
+ .${i.BADGE_STATUS},
761
+ .${i.BADGE_TYPE},
762
+ .${i.BADGE_PRIORITY} {
659
763
  font-weight: 600;
660
764
  }
661
- .${s.BADGE_TAG} {
765
+ .${i.BADGE_TAG} {
662
766
  opacity: 0.75;
663
767
  }
664
- .${s.BADGE_DURATION} {
768
+ .${i.BADGE_DURATION} {
665
769
  opacity: 0.75;
666
770
  border-style: dashed;
667
771
  }
668
772
 
669
- .${s.CONTEXT_BLOCK} {
773
+ .${i.CONTEXT_BLOCK} {
670
774
  display: flex;
671
775
  flex-direction: column;
672
- gap: 4px;
673
776
  padding: 10px 12px;
674
777
  border-top: 1px solid rgba(255, 255, 255, 0.08);
675
778
  font-size: 11px;
676
779
  }
677
- .${s.CONTEXT_BLOCK} img {
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 {
678
820
  width: 100%;
679
821
  border-radius: 6px;
680
822
  margin-bottom: 6px;
681
823
  cursor: zoom-in;
682
824
  }
683
- .${s.CONTEXT_SCREENSHOT_CAPTION} {
825
+ .${i.CONTEXT_SCREENSHOT_CAPTION} {
684
826
  opacity: 0.75;
685
827
  }
686
- .${s.CONTEXT_ROW} {
828
+ .${i.CONTEXT_ROW} {
687
829
  display: flex;
688
830
  justify-content: space-between;
689
831
  gap: 12px;
@@ -691,12 +833,12 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
691
833
  }
692
834
  /* URLs and user agents have no spaces to break on, so the value column
693
835
  would otherwise push the row wider than the panel. */
694
- .${s.CONTEXT_ROW} span:last-child {
836
+ .${i.CONTEXT_ROW} span:last-child {
695
837
  text-align: right;
696
838
  word-break: break-all;
697
839
  }
698
840
 
699
- .${s.INBOX_CARD_REPLY_LINK} {
841
+ .${i.INBOX_CARD_REPLY_LINK} {
700
842
  align-self: flex-start;
701
843
  background: transparent;
702
844
  border: none;
@@ -706,49 +848,128 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
706
848
  padding: 0;
707
849
  }
708
850
 
709
- .${s.INBOX_CARD_REPLY_LINK}:hover {
851
+ .${i.INBOX_CARD_REPLY_LINK}:hover {
710
852
  color: white;
711
853
  }
712
854
 
713
- .${s.INBOX_REPLIES} {
855
+ .${i.INBOX_REPLIES} {
714
856
  display: flex;
715
857
  flex-direction: column;
716
858
  gap: 10px;
717
859
  padding: 0 4px;
718
860
  }
719
861
 
720
- .${s.INBOX_EMPTY} {
721
- padding: 24px 12px;
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;
722
880
  color: rgba(255,255,255,0.55);
723
881
  text-align: center;
724
882
  }
725
883
 
726
- .${s.THREAD_HEADER} {
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} {
727
939
  display: flex;
728
940
  justify-content: space-between;
729
941
  align-items: center;
730
942
  padding: 0 0 0;
731
943
  }
732
944
 
733
- .${s.THREAD_META} {
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} {
734
949
  display: flex;
735
950
  align-items: center;
736
951
  gap: 6px;
952
+ flex: 1;
953
+ min-width: 0;
737
954
  }
738
955
 
739
- .${s.THREAD_AUTHOR} {
956
+ .${i.THREAD_AUTHOR} {
740
957
  font-weight: 600;
741
958
  font-size: 13px;
959
+ overflow: hidden;
960
+ text-overflow: ellipsis;
961
+ white-space: nowrap;
742
962
  }
743
963
 
744
- .${s.THREAD_TIME} {
964
+ .${i.THREAD_TIME} {
745
965
  font-size: 12px;
746
966
  color: rgba(255,255,255,0.5);
747
967
  cursor: default;
748
968
  position: relative;
969
+ flex: none;
749
970
  }
750
971
 
751
- .${s.THREAD_TIME}::after {
972
+ .${i.THREAD_TIME}::after {
752
973
  content: attr(data-full-date);
753
974
  position: absolute;
754
975
  bottom: calc(100% + 6px);
@@ -766,25 +987,25 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
766
987
  z-index: 1;
767
988
  }
768
989
 
769
- .${s.THREAD_TIME}:hover::after {
990
+ .${i.THREAD_TIME}:hover::after {
770
991
  opacity: 1;
771
992
  }
772
993
 
773
- .${s.THREAD_BODY} {
994
+ .${i.THREAD_BODY} {
774
995
  padding: 8px 0;
775
996
  white-space: pre-wrap;
776
997
  word-break: break-word;
777
998
  }
778
999
 
779
- .${s.THREAD_REPLIES} {
1000
+ .${i.THREAD_REPLIES} {
780
1001
  padding: 0;
781
1002
  }
782
1003
 
783
- .${s.THREAD_REPLIES}:empty {
1004
+ .${i.THREAD_REPLIES}:empty {
784
1005
  display: none;
785
1006
  }
786
1007
 
787
- .${s.THREAD_REPLY} {
1008
+ .${i.THREAD_REPLY} {
788
1009
  padding: 16px 0 0 0;
789
1010
  border-top: 1px solid rgba(255,255,255,0.1);
790
1011
  white-space: pre-wrap;
@@ -793,11 +1014,19 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
793
1014
  color: rgba(255,255,255,0.85);
794
1015
  }
795
1016
 
796
- .${s.THREAD_REPLY} .${s.THREAD_META} {
1017
+ .${i.THREAD_REPLY} .${i.THREAD_META} {
797
1018
  margin-bottom: 2px;
798
1019
  }
799
1020
 
800
- .${s.THREAD_REPLY} .${s.SCREENSHOT_IMG} {
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} {
801
1030
  width: 144px;
802
1031
  height: 100px;
803
1032
  object-fit: cover;
@@ -807,7 +1036,7 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
807
1036
  display: block;
808
1037
  }
809
1038
 
810
- .${s.THREAD_INPUT_AREA} {
1039
+ .${i.THREAD_INPUT_AREA} {
811
1040
  display: flex;
812
1041
  flex-direction: column;
813
1042
  gap: 0;
@@ -815,7 +1044,7 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
815
1044
  border-top: 1px solid rgba(255,255,255,0.1);
816
1045
  }
817
1046
 
818
- .${s.THREAD_INPUT} {
1047
+ .${i.THREAD_INPUT} {
819
1048
  width: 100%;
820
1049
  background: transparent;
821
1050
  border: none;
@@ -827,16 +1056,16 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
827
1056
  box-sizing: border-box;
828
1057
  }
829
1058
 
830
- .${s.THREAD_INPUT}::placeholder {
1059
+ .${i.THREAD_INPUT}::placeholder {
831
1060
  color: rgba(255,255,255,0.5);
832
1061
  }
833
1062
 
834
- .${s.THREAD_INPUT}:focus {
1063
+ .${i.THREAD_INPUT}:focus {
835
1064
  outline: none;
836
1065
  box-shadow: none;
837
1066
  }
838
1067
 
839
- .${s.THREAD_SUBMIT} {
1068
+ .${i.THREAD_SUBMIT} {
840
1069
  background: none;
841
1070
  border: none;
842
1071
  color: #2E90FA;
@@ -848,12 +1077,12 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
848
1077
  transition: background 0.2s;
849
1078
  }
850
1079
 
851
- .${s.THREAD_SUBMIT}:hover {
1080
+ .${i.THREAD_SUBMIT}:hover {
852
1081
  background: rgba(46, 144, 250, 0.15);
853
1082
  color: #1570D6;
854
1083
  }
855
1084
 
856
- .${s.CLOSE_TOOLTIP} {
1085
+ .${i.CLOSE_TOOLTIP} {
857
1086
  background: none;
858
1087
  border: none;
859
1088
  font-size: 18px;
@@ -862,11 +1091,11 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
862
1091
  line-height: 1;
863
1092
  }
864
1093
 
865
- .${s.CLOSE_TOOLTIP}:hover {
1094
+ .${i.CLOSE_TOOLTIP}:hover {
866
1095
  color: white;
867
1096
  }
868
1097
 
869
- .${s.PREVIEW_CIRCLE} {
1098
+ .${i.PREVIEW_CIRCLE} {
870
1099
  animation: helldots-pulse 1.5s ease-in-out infinite;
871
1100
  }
872
1101
 
@@ -875,7 +1104,7 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
875
1104
  50% { box-shadow: 0 0 0 8px rgba(46, 144, 250, 0), 0 1px 5px rgba(0,0,0,0.2); }
876
1105
  }
877
1106
 
878
- .${s.COMMENT_OVERLAY} {
1107
+ .${i.COMMENT_OVERLAY} {
879
1108
  position: fixed;
880
1109
  top: 0;
881
1110
  left: 0;
@@ -883,24 +1112,24 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
883
1112
  bottom: 0;
884
1113
  background: transparent;
885
1114
  pointer-events: none;
886
- z-index: ${S.TOOLBAR-1};
1115
+ z-index: ${O.TOOLBAR-1};
887
1116
  }
888
1117
 
889
- .${s.COMMENT_OVERLAY}.${s.ACTIVE} {
1118
+ .${i.COMMENT_OVERLAY}.${i.ACTIVE} {
890
1119
  pointer-events: auto;
891
1120
  background: rgba(0, 0, 0, 0.1);
892
1121
  }
893
1122
 
894
- .${s.SELECTION_RECT} {
1123
+ .${i.SELECTION_RECT} {
895
1124
  position: fixed;
896
1125
  border: 2px solid #2E90FA;
897
1126
  background: rgba(46, 144, 250, 0.1);
898
1127
  pointer-events: none;
899
- z-index: ${S.TOOLTIP};
1128
+ z-index: ${O.TOOLTIP};
900
1129
  box-sizing: border-box;
901
1130
  }
902
1131
 
903
- .${s.SCREENSHOTS_CONTAINER} {
1132
+ .${i.SCREENSHOTS_CONTAINER} {
904
1133
  display: none;
905
1134
  overflow-x: auto;
906
1135
  gap: 8px;
@@ -908,23 +1137,23 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
908
1137
  padding: 4px 0;
909
1138
  scrollbar-width: none;
910
1139
  -ms-overflow-style: none;
911
- margin-bottom: 16px;
1140
+ margin-bottom: 8px;
912
1141
  }
913
1142
 
914
- .${s.SCREENSHOTS_CONTAINER}::-webkit-scrollbar {
1143
+ .${i.SCREENSHOTS_CONTAINER}::-webkit-scrollbar {
915
1144
  display: none;
916
1145
  }
917
1146
 
918
- .${s.SCREENSHOTS_CONTAINER}.${s.ACTIVE} {
1147
+ .${i.SCREENSHOTS_CONTAINER}.${i.ACTIVE} {
919
1148
  display: flex;
920
1149
  }
921
1150
 
922
- .${s.SCREENSHOT_ITEM} {
1151
+ .${i.SCREENSHOT_ITEM} {
923
1152
  position: relative;
924
1153
  flex-shrink: 0;
925
1154
  }
926
1155
 
927
- .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG} {
1156
+ .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG} {
928
1157
  width: 50px;
929
1158
  height: 50px;
930
1159
  object-fit: cover;
@@ -934,11 +1163,11 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
934
1163
  margin: 0;
935
1164
  }
936
1165
 
937
- .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG}:hover {
1166
+ .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG}:hover {
938
1167
  opacity: 0.85;
939
1168
  }
940
1169
 
941
- .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_REMOVE} {
1170
+ .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_REMOVE} {
942
1171
  position: absolute;
943
1172
  top: -5px;
944
1173
  right: -5px;
@@ -957,29 +1186,116 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
957
1186
  z-index: 1;
958
1187
  }
959
1188
 
960
- .${s.SCREENSHOT_ITEM}:hover .${s.SCREENSHOT_REMOVE} {
1189
+ .${i.SCREENSHOT_ITEM}:hover .${i.SCREENSHOT_REMOVE} {
961
1190
  display: flex;
962
1191
  }
963
1192
 
964
- .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_REMOVE}:hover {
1193
+ .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_REMOVE}:hover {
965
1194
  background: rgba(0,0,0,0.9);
966
1195
  }
967
1196
 
968
- .${s.TOOLTIP} > .${s.SCREENSHOTS_CONTAINER} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG},
969
- .${s.THREAD_POPOVER} > .${s.SCREENSHOTS_CONTAINER} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG},
970
- .${s.THREAD_REPLY} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG} {
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} {
971
1200
  width: 144px;
972
1201
  height: 100px;
973
1202
  }
974
1203
 
975
- .${s.LIGHTBOX} {
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} {
976
1292
  position: fixed;
977
1293
  top: 0;
978
1294
  left: 0;
979
1295
  right: 0;
980
1296
  bottom: 0;
981
1297
  background: rgba(0,0,0,0.92);
982
- z-index: ${S.LIGHTBOX};
1298
+ z-index: ${O.LIGHTBOX};
983
1299
  display: flex;
984
1300
  align-items: center;
985
1301
  justify-content: center;
@@ -991,14 +1307,14 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
991
1307
  to { opacity: 1; }
992
1308
  }
993
1309
 
994
- .${s.LIGHTBOX_IMG} {
1310
+ .${i.LIGHTBOX_IMG} {
995
1311
  max-width: 90vw;
996
1312
  max-height: 90vh;
997
1313
  object-fit: contain;
998
1314
  border-radius: 8px;
999
1315
  }
1000
1316
 
1001
- .${s.LIGHTBOX_CLOSE} {
1317
+ .${i.LIGHTBOX_CLOSE} {
1002
1318
  position: absolute;
1003
1319
  top: 16px;
1004
1320
  right: 16px;
@@ -1016,17 +1332,137 @@ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDesc
1016
1332
  transition: background 0.2s;
1017
1333
  }
1018
1334
 
1019
- .${s.LIGHTBOX_CLOSE}:hover {
1335
+ .${i.LIGHTBOX_CLOSE}:hover {
1020
1336
  background: rgba(255,255,255,0.3);
1021
1337
  }
1022
- `,rt=()=>`
1023
- .${s.COMMENT_CURSOR},
1024
- .${s.COMMENT_CURSOR} * {
1025
- cursor: url('${ot}') 6 6, auto !important;
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;
1026
1456
  }
1027
- `;var R={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",inboxEmpty:"No comments yet",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All comments",filterCurrentPage:"Current page",filterByPage:"Filter by Page",filterByStatus:"Filter by Status",filterStatusAll:"All",filterUnresolved:"Unresolved",filterResolved:"Resolved",back:"Back",deleteComment:"Delete",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",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",tagsPlaceholder:"Add tags...",removeTag:"Remove tag",filterByType:"Filter by Type",filterByPriority:"Filter by Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var it={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",inboxEmpty:"A\xFAn no hay comentarios",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todos los comentarios",filterCurrentPage:"P\xE1gina actual",filterByPage:"Filtrar por p\xE1gina",filterByStatus:"Filtrar por estado",filterStatusAll:"Todos",filterUnresolved:"Sin resolver",filterResolved:"Resueltos",back:"Volver",deleteComment:"Eliminar",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",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",tagsPlaceholder:"A\xF1adir etiquetas...",removeTag:"Quitar etiqueta",filterByType:"Filtrar por tipo",filterByPriority:"Filtrar por prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var be={en:R,es:it},Ce="en";function st(){let t=(navigator.language||Ce).slice(0,2).toLowerCase();return t in be?t:Ce}function at(t){return be[t]||be[Ce]}function w(t,e){return t.replace("{n}",String(e))}var Yo=6e4;function te(t,e){if(!Number.isFinite(t)||t<0)return"";let o=Math.floor(t/Yo);if(o<1)return e.durationLessThanMinute;if(o<60)return w(e.minutesAgoTemplate,o);let n=Math.floor(o/60);if(n<24){let a=o%60,d=w(e.hoursAgoTemplate,n);return a?`${d} ${w(e.minutesAgoTemplate,a)}`:d}let r=Math.floor(n/24),i=n%24,l=w(e.daysAgoTemplate,r);return i?`${l} ${w(e.hoursAgoTemplate,i)}`:l}var Wo=/^(css|sc|jsx|emotion)-/i,jo=/^data-(reactid|react-|v-|svelte-)/,qo=["id","name","role","aria-label"],Ko=["data-testid","name","aria-label"],Te=t=>typeof CSS<"u"&&CSS.escape?CSS.escape(t):String(t).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),Zo=t=>String(t).replace(/["\\]/g,"\\$&"),z=(t,e)=>{try{return e.querySelectorAll(t).length===1}catch{return!1}},dt=t=>(t||"").replace(/\s+/g," ").trim().slice(0,64),Qo=t=>Wo.test(t)?!1:!t.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),Jo=t=>[...t.classList].filter(Qo),en=t=>{let e={};for(let{name:o,value:n}of t.attributes)(qo.includes(o)||o.startsWith("data-")&&!jo.test(o))&&n&&(e[o]=n.slice(0,64));return e},ye=t=>{let e=t.parentElement;if(!e)return{index:0,count:1};let o=[...e.children].filter(n=>n.tagName===t.tagName);return{index:o.indexOf(t),count:o.length}},tn=(t,e)=>{if(!t.id)return null;let o=`#${Te(t.id)}`;return z(o,e)?o:null},on=(t,e)=>{let o=t.tagName.toLowerCase();for(let n of Ko){let r=t.getAttribute(n);if(!r)continue;let i=`${o}[${n}="${Zo(r)}"]`;if(z(i,e))return i}return null},nn=(t,e)=>{let o=[],n=t;for(let r=0;r<3&&n;r++){let i=Jo(n),l=n.tagName.toLowerCase();if(o.unshift(i.length?`${l}.${i.map(Te).join(".")}`:l),r===0&&!i.length)return null;let a=o.join(" > ");if(z(a,e))return a;n=n.parentElement}return null},rn=(t,e)=>{if(t===e.body)return"body";let o=[],n=t;for(let i=0;i<5&&n;i++){if(n===e.body){o.unshift("body");break}if(n.id){let a=[`#${Te(n.id)}`,...o].join(" > ");if(z(a,e))return a}let{index:l}=ye(n);o.unshift(`${n.tagName.toLowerCase()}:nth-of-type(${l+1})`),n=n.parentElement}let r=o.join(" > ");return z(r,e)?r:null},ht=(t,e)=>tn(t,e)||on(t,e)||nn(t,e)||rn(t,e);function pt(t){return ht(t,t.ownerDocument)}function ut(t,e,o){let n=t.ownerDocument,{index:r,count:i}=ye(t);return{version:1,selector:ht(t,n),fingerprint:{tagName:t.tagName,textSnippet:dt(t.textContent),attributes:en(t),siblingIndex:r,siblingCount:i},relativeX:e,relativeY:o}}var sn=(t,e)=>{if(!t&&!e)return 1;if(!t||!e)return 0;if(t===e)return 1;if(t.startsWith(e)||e.startsWith(t))return .8;let o=new Set(t.split(" ")),n=new Set(e.split(" ")),r=0;for(let i of o)n.has(i)&&r++;return 2*r/(o.size+n.size)},an=(t,e)=>{let o=Object.keys(e);if(!o.length)return 1;let n=0;for(let r of o)(t.getAttribute(r)||"").slice(0,64)===e[r]&&n++;return n/o.length},lt=(t,e)=>{let{index:o,count:n}=ye(t),r=Math.abs(o-e.siblingIndex),i=Math.max(e.siblingCount,n,1);return Math.max(0,1-r/i)},ln=(t,e)=>{if(t.tagName!==e.tagName)return 0;let o=!!e.textSnippet,n=Object.keys(e.attributes||{}).length>0,r=.5,i=.3,l=.2;return n?o||(i+=r,r=0):(r+=i,i=0),!o&&!n?lt(t,e):r*sn(dt(t.textContent),e.textSnippet)+i*an(t,e.attributes||{})+l*lt(t,e)},ct=(t,e)=>{let o=null;for(let n of t){let r=ln(n,e);(!o||r>o.confidence)&&(o={element:n,confidence:r})}return o};function mt(t,e=document){let o=t?.fingerprint;if(!o||!o.tagName)return null;if(t.selector){let l=[];try{l=[...e.querySelectorAll(t.selector)]}catch{}let a=ct(l,o);if(a&&a.confidence>=.6)return a}if(!(!!o.textSnippet||Object.keys(o.attributes||{}).length>0))return null;let r;try{r=[...e.querySelectorAll(o.tagName)]}catch{return null}let i=ct(r,o);return i&&i.confidence>=.7?i:null}var ft="helldots-comments",oe="helldots-pending-detail";function ne(){try{let t=localStorage.getItem(ft);if(!t)return[];let e=JSON.parse(t);return Array.isArray(e)?e:[]}catch(t){return console.warn("HellDots: could not read stored comments",t),[]}}function gt(t){try{return localStorage.setItem(ft,JSON.stringify(t)),!0}catch{return!1}}function xe(t){if(gt(t))return!0;let e=t.map((r,i)=>({comment:r,index:i})).filter(({comment:r})=>r?.contextScreenshot).sort((r,i)=>{let l=Date.parse(r.comment.createdAt),a=Date.parse(i.comment.createdAt);return Number.isFinite(l)&&Number.isFinite(a)&&l!==a?l-a: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 o=[...t],n=0;for(let{index:r}of e)if(o[r]={...o[r],contextScreenshot:null},n++,gt(o))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 _e(t,e,o){let n=new Set(e.map(i=>i.id));return[...t.filter(i=>!n.has(i.id)&&i.page!==o),...e]}var Et='<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>',cn='<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>',dn='<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>',re=t=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(t).catch(()=>{});let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},hn=(t,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,resolved:e.statusResolved})[t]||e.statusOpen,B=(t,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[t]||e.unset,P=(t,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[t]||e.unset,H=({action:t,options:e,value:o,colorOf:n,labelOf:r,tooltipLabel:i,onSelect:l,showLabel:a=!1})=>{let d=document.createElement("div");d.style.position="relative";let p=document.createElement("button");p.type="button",p.className=s.INBOX_ACTION_BTN,a&&p.classList.add(s.INBOX_ACTION_BTN_LABELED),p.dataset.action=t,p.setAttribute("aria-haspopup","true");let c=document.createElement("span");c.className=s.INBOX_STATUS_DOT,p.appendChild(c);let m=null;a&&(m=document.createElement("span"),m.className=s.INBOX_ACTION_LABEL,p.appendChild(m));let u=document.createElement("div");u.className=s.INBOX_MENU,u.style.display="none",u.setAttribute("role","menu");let h=o,g=()=>{let f=`${i}: ${r(h)}`;c.style.backgroundColor=n(h),p.dataset.hdTooltip=f,p.setAttribute("aria-label",f),m&&(m.textContent=r(h)),u.querySelectorAll("[data-picker-option]").forEach(E=>{let b=E.dataset.pickerOption,C=b===""?null:b;E.setAttribute("aria-checked",String(C===h))})};for(let f of e){let E=document.createElement("button");E.type="button",E.className=s.INBOX_MENU_ITEM,E.dataset.pickerOption=f===null?"":f,E.setAttribute("role","menuitemradio");let b=document.createElement("span");b.className=s.INBOX_STATUS_DOT,b.style.backgroundColor=n(f),E.appendChild(b),E.appendChild(document.createTextNode(r(f))),E.addEventListener("click",C=>{C.stopPropagation(),u.style.display="none",f!==h&&(h=f,l(f),g())}),u.appendChild(E)}return p.addEventListener("click",f=>{f.stopPropagation(),u.style.display=u.style.display==="none"?"block":"none"}),d.appendChild(p),d.appendChild(u),g(),d},ie=(t,{strings:e,onCopy:o,onSetStatus:n,onSetType:r,onSetPriority:i,onDelete:l})=>{let a=document.createElement("div");a.className=s.INBOX_CARD_ACTIONS;let d=document.createElement("button");d.type="button",d.className=s.INBOX_ACTION_BTN,d.dataset.action="copy",d.dataset.hdTooltip=e.copyAgentContext,d.setAttribute("aria-label",e.copyAgentContext),d.innerHTML=Et,d.addEventListener("click",h=>{h.stopPropagation(),o(t),d.innerHTML=cn,d.dataset.hdTooltip=e.copied,setTimeout(()=>{d.innerHTML=Et,d.dataset.hdTooltip=e.copyAgentContext},1500)}),a.appendChild(d),a.appendChild(H({action:"status",options:V,value:t.status||"open",colorOf:h=>et[h]||"",labelOf:h=>hn(h,e),tooltipLabel:e.statusLabel,onSelect:h=>n(t,h)})),a.appendChild(H({action:"type",options:[null,...A],value:t.type||null,colorOf:h=>D[h]||"transparent",labelOf:h=>B(h,e),tooltipLabel:e.typeLabel,onSelect:h=>r?.(t,h),showLabel:!0})),a.appendChild(H({action:"priority",options:[null,...N],value:t.priority||null,colorOf:h=>k[h]||"transparent",labelOf:h=>P(h,e),tooltipLabel:e.priorityLabel,onSelect:h=>i?.(t,h),showLabel:!0}));let p=document.createElement("div");p.style.position="relative";let c=document.createElement("button");c.type="button",c.className=s.INBOX_ACTION_BTN,c.dataset.action="menu",c.dataset.hdTooltip=e.moreOptions,c.setAttribute("aria-label",e.commentOptions),c.innerHTML=dn;let m=document.createElement("div");m.className=s.INBOX_MENU,m.style.display="none";let u=document.createElement("button");return u.type="button",u.className=s.INBOX_MENU_ITEM,u.textContent=e.deleteComment,u.addEventListener("click",h=>{h.stopPropagation(),m.style.display="none",l(t)}),m.appendChild(u),c.addEventListener("click",h=>{h.stopPropagation(),m.style.display=m.style.display==="none"?"block":"none"}),p.appendChild(c),p.appendChild(m),a.appendChild(p),a};var pn=(t,e)=>{let o=Date.now()-new Date(t).getTime(),n=Math.floor(o/6e4),r=Math.floor(o/36e5),i=Math.floor(o/864e5);return n<1?e.justNow:n<60?w(e.minutesAgoTemplate,n):r<24?w(e.hoursAgoTemplate,r):w(e.daysAgoTemplate,i)},un=(t,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(t)),Y=(t,e,o,n)=>{let r=document.createElement("div");r.className=s.THREAD_META;let i=document.createElement("span");i.className=s.THREAD_AUTHOR,i.textContent=t||o.anonymous;let l=document.createElement("span");return l.className=s.THREAD_TIME,l.textContent=pn(e,o),l.dataset.fullDate=un(e,n),r.appendChild(i),r.appendChild(l),r},mn=(t,e)=>{let o=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),n={alt:o?"\u2325":e.modifierAlt,ctrl:o?"\u2318":e.modifierCtrl,shift:"\u21E7"},r=n[t.shortcutModifier]||n.alt,i=t.shortcutKey?.toUpperCase()||"C";return`${r} + ${i}`},gn='<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>',fn='<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>',En='<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>',bn='<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>',se=({areaClassName:t,inputTag:e="textarea",inputClassName:o,inputId:n,inputPlaceholder:r,submitBtnId:i,fileInputId:l},a)=>{let d=document.createElement("div");d.className=t;let p=document.createElement(e);n&&(p.id=n),o&&(p.className=o),p.placeholder=r,p.setAttribute("aria-label",r),e==="input"&&(p.type="text");let c=document.createElement("div");c.className=s.SCREENSHOTS_CONTAINER;let m=document.createElement("div");m.className=s.COMMENT_ACTIONS_BAR;let u=document.createElement("button");u.className=s.ATTACH_IMAGE_BTN,u.type="button",u.setAttribute("aria-label",a.attachImage),u.innerHTML=gn;let h=document.createElement("input");h.type="file",l&&(h.id=l),h.accept="image/*",h.style.display="none";let g=document.createElement("button");return i&&(g.id=i),g.className=s.THREAD_SUBMIT,g.type="button",g.setAttribute("aria-label",a.send),g.innerHTML=fn,m.appendChild(u),m.appendChild(h),m.appendChild(g),d.appendChild(p),d.appendChild(c),d.appendChild(m),{container:d,inputEl:p,screenshotsContainer:c,attachBtn:u,fileInput:h,submitBtn:g}},bt=(t,e,o,n)=>{let r=document.createElement("div");r.className=s.TOOLBAR_ACTION_WRAPPER;let i=document.createElement("div");i.className=s.TOOLBAR_ACTION_TOOLTIP,o.forEach(a=>i.appendChild(a));let l=document.createElement("button");return l.type="button",l.className=`${s.TOOLBAR_ACTION_BTN} ${t}`,l.setAttribute("aria-label",n),l.innerHTML=e,r.appendChild(i),r.appendChild(l),r},Ct=(t={},e=R)=>{let o=document.createElement("div");o.id=x.TOOLBAR;let n=document.createElement("div");n.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=mn(t,e);let l=bt(s.TOOLBAR_COMMENT_BTN,En,[r,i],e.toolbarComment);l.querySelector(`.${s.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let a=document.createElement("span");a.className=s.TOOLBAR_TEXT,a.textContent=e.toolbarInbox;let d=bt(s.TOOLBAR_MENU_BTN,bn,[a],e.toolbarInbox);return n.appendChild(l),n.appendChild(d),o.appendChild(n),o},Cn=t=>{let e=document.createElement("div");e.className=s.CLASSIFY_ROW;let o=null,n=null,r=[],i=document.createElement("div");i.className=s.INBOX_BADGES;let l=document.createElement("input");l.type="text",l.className=s.TAGS_INPUT,l.placeholder=t.tagsPlaceholder,l.setAttribute("aria-label",t.tagsPlaceholder);let a=()=>{i.innerHTML="",r.forEach((c,m)=>{let u=document.createElement("span");u.className=s.TAG_CHIP,u.appendChild(document.createTextNode(c));let h=document.createElement("button");h.type="button",h.className=s.TAG_CHIP_REMOVE,h.setAttribute("aria-label",`${t.removeTag}: ${c}`),h.innerHTML="&times;",h.addEventListener("click",g=>{g.stopPropagation(),r.splice(m,1),a()}),u.appendChild(h),i.appendChild(u)})},d=()=>{let c=l.value.trim().toLowerCase();c&&!r.includes(c)&&(r.push(c),a()),l.value=""};l.addEventListener("keydown",c=>{c.key!=="Enter"&&c.key!==","||(c.preventDefault(),d())});let p=()=>{e.replaceChildren(),e.appendChild(H({action:"type",options:[null,...A],value:null,colorOf:c=>D[c]||"transparent",labelOf:c=>B(c,t),tooltipLabel:t.typeLabel,onSelect:c=>o=c,showLabel:!0})),e.appendChild(H({action:"priority",options:[null,...N],value:null,colorOf:c=>k[c]||"transparent",labelOf:c=>P(c,t),tooltipLabel:t.priorityLabel,onSelect:c=>n=c,showLabel:!0})),e.appendChild(l),e.appendChild(i)};return p(),{container:e,getType:()=>o,getPriority:()=>n,getTags:()=>(d(),[...r]),reset:()=>{o=null,n=null,r.length=0,l.value="",a(),p()}}},Tt=(t=R)=>{let e=document.createElement("div");e.id=x.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",t.commentBoxAriaLabel);let{container:o}=se({areaClassName:s.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:x.COMMENT_INPUT,inputPlaceholder:t.commentPlaceholder,submitBtnId:x.SUBMIT_COMMENT,fileInputId:x.ATTACH_IMAGE_INPUT},t),n=Cn(t);return e.appendChild(n.container),e.appendChild(o),e.style.display="none",e.classify=n,e},yt=(t,e=R)=>{let o=document.createElement("div");return o.className=s.CIRCLE,o.dataset.commentId=t.id,o.dataset.commentText=t.text,o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${t.text}`),o.style.cssText=`
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=`
1028
1464
  position: absolute;
1029
1465
  pointer-events: auto;
1030
- `,o},W=(t,e)=>{let o=document.createElement("div");return o.className=s.SCREENSHOTS_CONTAINER,o.classList.add(s.ACTIVE),t.forEach(n=>{let r=document.createElement("div");r.className=s.SCREENSHOT_ITEM;let i=document.createElement("img");i.className=s.SCREENSHOT_IMG,i.src=n,i.alt=e.attachedScreenshot,r.appendChild(i),o.appendChild(r)}),o},xt=(t,e=R,o)=>{let n=document.createElement("div");n.className=s.TOOLTIP,n.dataset.for=t.id,n.setAttribute("role","dialog"),n.setAttribute("aria-label",e.tooltipAriaLabel);let r=document.createElement("div");r.className=s.THREAD_HEADER;let i=Y(t.author,t.createdAt,e,o),l=document.createElement("button");l.type="button",l.className=s.CLOSE_TOOLTIP,l.setAttribute("aria-label",e.close),l.innerHTML="&times;",r.appendChild(i),r.appendChild(l);let a=document.createElement("div");a.className=s.THREAD_BODY,a.textContent=t.text,n.appendChild(r),n.appendChild(a);let d=t.screenshots||(t.screenshot?[t.screenshot]:[]);return d.length>0&&n.appendChild(W(d,e)),n},j=(t,e=R,o)=>{let n=document.createElement("div");n.className=s.THREAD_REPLY;let r=Y(t.author,t.timestamp,e,o),i=document.createElement("div");i.className=s.THREAD_BODY,i.textContent=t.text,n.appendChild(r),n.appendChild(i);let l=t.screenshots||(t.screenshot?[t.screenshot]:[]);return l.length>0&&n.appendChild(W(l,e)),n},_t=(t,e=R,o)=>{let n=document.createElement("div");n.className=s.THREAD_POPOVER,n.dataset.for=t.id,n.setAttribute("role","dialog"),n.setAttribute("aria-label",e.popoverAriaLabel);let r=document.createElement("div");r.className=s.THREAD_HEADER;let i=Y(t.author,t.createdAt,e,o),l=document.createElement("button");l.type="button",l.className=s.CLOSE_TOOLTIP,l.setAttribute("aria-label",e.close),l.innerHTML="&times;",r.appendChild(i),r.appendChild(l);let a=document.createElement("div");a.className=s.THREAD_BODY,a.textContent=t.text;let d=document.createElement("div");d.className=s.THREAD_REPLIES,t.replies&&t.replies.forEach(m=>{d.appendChild(j(m,e,o))});let{container:p}=se({areaClassName:s.THREAD_INPUT_AREA,inputTag:"input",inputClassName:s.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e);n.appendChild(r),n.appendChild(a);let c=t.screenshots||(t.screenshot?[t.screenshot]:[]);return c.length>0&&n.appendChild(W(c,e)),n.appendChild(d),n.appendChild(p),n};var Tn=t=>{let e=[...t.attributes].map(({name:o,value:n})=>`${o}="${n}"`).join(" ");return`<${t.tagName.toLowerCase()}${e?` ${e}`:""}>`},yn=t=>{if(!t?.tagName)return"(unknown)";let e=Object.entries(t.attributes||{}).map(([o,n])=>`${o}="${n}"`).join(" ");return`<${t.tagName.toLowerCase()}${e?` ${e}`:""}>`},xn=t=>{let e=[],o=t;for(;o&&o!==document.documentElement;){let n=o.tagName.toLowerCase(),r=o.id?`#${o.id}`:"",i=[...o.classList].slice(0,2).map(l=>`.${l}`).join("");if(e.unshift(`${n}${r}${i}`),o===document.body)break;o=o.parentElement}return e.join(" > ")};function ae(t,{viewportWidth:e,viewportHeight:o,strings:n}){let r=t.anchor,i=r?.fingerprint,l=t.container?.isConnected?t.container:null,a=t.hidden?"hidden":t.anchorState,d=l?Tn(l):yn(i),p=l?xn(l):"(unavailable)",c=t.context?.viewport,m=c?.width??e,u=c?.height??o,h=[`Page: ${t.page}`,`Viewport: ${m}x${u}`,`Anchor state: ${a}`,`Status: ${t.status||"open"}`,`Selector: ${r?.selector||"(none)"}`,`Element: ${d}`,`DOM path: ${p}`,`Nearby text: "${i?.textSnippet??""}"`,`Comment by ${t.author} (${t.createdAt}):`,`"${t.text}"`];t.type&&h.push(`Type: ${t.type}`),t.priority&&h.push(`Priority: ${t.priority}`),t.tags?.length&&h.push(`Tags: ${t.tags.join(", ")}`);let g=t.context;if(g&&(g.url&&h.push(`URL: ${g.url}`),g.screen&&h.push(`Screen: ${g.screen.width}x${g.screen.height}`),g.browser?.name&&h.push(`Browser: ${`${g.browser.name} ${g.browser.version||""}`.trim()}`),g.os?.name&&h.push(`OS: ${`${g.os.name} ${g.os.version||""}`.trim()}`)),n&&t.status==="resolved"&&t.resolvedAt){let E=te(new Date(t.resolvedAt).getTime()-new Date(t.createdAt).getTime(),n);E&&h.push(`Resolution time: ${E}`)}let f=t.replies||[];if(f.length>0){h.push(`Replies (${f.length}):`);for(let E of f)h.push(`- ${E.author}: "${E.text}"`)}return h.join(`
1031
- `)}var _n='<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>',Sn='<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>',wn='<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>',On='<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>',le=class{constructor({shadowRoot:e,strings:o,locale:n,currentPage:r,getComments:i,callbacks:l}){this.shadowRoot=e,this.strings=o,this.locale=n,this.currentPage=r,this.getComments=i,this.callbacks=l,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.el=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.shadowRoot.appendChild(this.el),this.render())}close(){this._clearHighlight(),this.el?.remove(),this.el=null,this.detailId=null}refresh(){this.el&&this.render()}_highlight(e){if(this._clearHighlight(),e.anchorState!=="anchored"||e.hidden||e.status==="resolved")return;let o=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);o&&(o.classList.add(s.HIGHLIGHT),this._highlightedEl=o)}_clearHighlight(){this._highlightedEl?.classList.remove(s.HIGHLIGHT),this._highlightedEl=null}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(o=>o.page===this.currentPage)),this.statusFilter==="resolved"?e=e.filter(o=>o.status==="resolved"):this.statusFilter==="unresolved"&&(e=e.filter(o=>o.status!=="resolved")),this.typeFilter!=="all"&&(e=e.filter(o=>o.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(o=>o.priority===this.priorityFilter)),[...e.filter(o=>o.status!=="resolved"),...e.filter(o=>o.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight(),this.el.innerHTML="";let e=this.filteredComments(),o=this.detailId!=null?e.find(n=>n.id===this.detailId):null;o?this._renderDetail(o,e):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let o=this.getComments().find(n=>n.id===e);o&&this._openDetail(o)}_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",()=>this.callbacks.onClose()),e}_renderList(e){let o=document.createElement("div");o.className=s.INBOX_HEADER,o.appendChild(this._buildFilter()),o.appendChild(this._closeButton()),this.el.appendChild(o);let n=document.createElement("div");if(n.className=s.INBOX_LIST,this.el.appendChild(n),e.length===0){let r=document.createElement("div");r.className=s.INBOX_EMPTY,r.textContent=this.strings.inboxEmpty,n.appendChild(r);return}for(let r of e)n.appendChild(this._buildCard(r,{interactive:!0}))}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_statusFilterLabel(e){return e==="unresolved"?this.strings.filterUnresolved:e==="resolved"?this.strings.filterResolved:this.strings.filterStatusAll}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(this._statusFilterLabel(this.statusFilter)),this.typeFilter!=="all"&&e.push(B(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(P(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_buildFilter(){let e=document.createElement("div");e.className=s.INBOX_FILTER+"-wrapper";let o=this._filterSummaryLabel(),n=document.createElement("button");n.type="button",n.className=s.INBOX_FILTER,n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false"),n.innerHTML=`<span>${o}</span>${_n}`;let r=document.createElement("div");r.className=s.INBOX_FILTER_MENU,r.style.display="none";let i=a=>{let d=document.createElement("div");d.className=s.INBOX_FILTER_SECTION,d.textContent=a,r.appendChild(d)},l=(a,d,p,c,m)=>{let u=document.createElement("button");u.type="button",u.className=s.INBOX_FILTER_OPTION,u.dataset[p]=c,u.setAttribute("role","menuitemradio"),u.setAttribute("aria-checked",String(d)),u.innerHTML=`<span>${a}</span>${d?"\u2713":""}`,u.addEventListener("click",h=>{h.stopPropagation(),m(),this.render()}),r.appendChild(u)};i(this.strings.filterByPage);for(let a of["all","page"])l(this._pageFilterLabel(a),this.pageFilter===a,"filterPage",a,()=>this.pageFilter=a);i(this.strings.filterByStatus);for(let a of["all","unresolved","resolved"])l(this._statusFilterLabel(a),this.statusFilter===a,"filterStatus",a,()=>this.statusFilter=a);i(this.strings.filterByType);for(let a of["all",...A])l(a==="all"?this.strings.filterStatusAll:B(a,this.strings),this.typeFilter===a,"filterType",a,()=>this.typeFilter=a);i(this.strings.filterByPriority);for(let a of["all",...N])l(a==="all"?this.strings.filterStatusAll:P(a,this.strings),this.priorityFilter===a,"filterPriority",a,()=>this.priorityFilter=a);return n.addEventListener("click",a=>{a.stopPropagation();let d=r.style.display!=="none";r.style.display=d?"none":"block",n.setAttribute("aria-expanded",String(!d))}),e.appendChild(n),e.appendChild(r),e}_buildCard(e,{interactive:o}){let n=document.createElement("div");n.className=s.INBOX_CARD,e.status==="resolved"&&n.classList.add(`${s.INBOX_CARD}--resolved`),n.dataset.commentId=e.id;let r=document.createElement("div");r.className=s.INBOX_CARD_HEADER,r.appendChild(Y(e.author,e.createdAt,this.strings,this.locale)),r.appendChild(this._buildCardActions(e)),n.appendChild(r);let i=document.createElement("div");if(i.className=s.INBOX_CARD_TEXT,i.textContent=e.text,n.appendChild(i),e.screenshots?.length){let d=W(e.screenshots,this.strings);d.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(p=>{p.addEventListener("click",c=>{c.stopPropagation(),this.callbacks.onShowLightbox(p.src)})}),n.appendChild(d)}let l=this._buildBadges(e);l&&n.appendChild(l);let a=this._buildTag(e);if(a&&n.appendChild(a),o){n.setAttribute("role","button"),n.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=s.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",c=>{c.stopPropagation(),d()}),n.appendChild(p),n.addEventListener("click",d),n.addEventListener("keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),d())}),n.addEventListener("mouseenter",()=>this._highlight(e)),n.addEventListener("mouseleave",()=>this._clearHighlight())}return n}_buildTag(e){let o=null;if(e.anchorState==="orphaned"?o=this.strings.orphanedBadge:e.hidden?o=this.strings.hiddenBadge:e.anchorState==="inactive"&&(o=e.page),!o)return null;let n=document.createElement("span");return n.className=s.INBOX_CARD_TAG,n.textContent=o,n}_buildBadges(e){let o=document.createElement("div");o.className=s.INBOX_BADGES;let n=(r,i,l)=>{let a=document.createElement("span");a.className=`${s.BADGE} ${i}`,a.textContent=r,l&&(a.style.borderColor=l),o.appendChild(a)};e.type&&n(B(e.type,this.strings),s.BADGE_TYPE,D[e.type]),e.priority&&n(P(e.priority,this.strings),s.BADGE_PRIORITY,k[e.priority]);for(let r of e.tags||[])n(r,s.BADGE_TAG,null);if(e.status==="resolved"){let r=e.resolvedAt?te(new Date(e.resolvedAt).getTime()-new Date(e.createdAt).getTime(),this.strings):"";n(w(this.strings.resolvedInTemplate,r||"\u2014"),s.BADGE_DURATION,null)}return o.children.length?o:null}_buildContextBlock(e){let{context:o,contextScreenshot:n}=e;if(!o&&!n)return null;let r=document.createElement("div");r.className=s.CONTEXT_BLOCK;let i=document.createElement("div");if(i.className=s.INBOX_FILTER_SECTION,i.textContent=this.strings.contextSection,r.appendChild(i),n){let l=document.createElement("div");l.className=s.CONTEXT_SCREENSHOT_CAPTION,l.textContent=this.strings.autoScreenshotLabel,r.appendChild(l);let a=document.createElement("img");a.className=s.SCREENSHOT_IMG,a.src=n,a.alt=this.strings.autoScreenshotLabel,a.addEventListener("click",d=>{d.stopPropagation(),this.callbacks.onShowLightbox(n)}),r.appendChild(a)}if(o){let l=(p,c)=>{if(!c)return;let m=document.createElement("div");m.className=s.CONTEXT_ROW;let u=document.createElement("span");u.textContent=p;let h=document.createElement("span");h.textContent=c,m.appendChild(u),m.appendChild(h),r.appendChild(m)},a=p=>p?`${p.width}\xD7${p.height}`:"",d=p=>p?.name?`${p.name} ${p.version||""}`.trim():"";l(this.strings.contextUrl,o.url),l(this.strings.contextViewport,a(o.viewport)),l(this.strings.contextScreen,a(o.screen)),l(this.strings.contextBrowser,d(o.browser)),l(this.strings.contextOs,d(o.os))}return r}_buildCardActions(e){return ie(e,{strings:this.strings,onCopy:o=>re(ae(o,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onSetStatus:(o,n)=>this.callbacks.onSetStatus(o.id,n),onSetType:(o,n)=>this.callbacks.onSetType(o.id,n),onSetPriority:(o,n)=>this.callbacks.onSetPriority(o.id,n),onDelete:o=>{this.detailId===o.id&&(this.detailId=null),this.callbacks.onDelete(o.id),this.render()}})}_renderDetail(e,o){let n=o.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=`${Sn}<span>${this.strings.back}</span>`,i.addEventListener("click",()=>{this.detailId=null,this.render()}),r.appendChild(i);let l=document.createElement("div");l.className=s.INBOX_CARD_ACTIONS;let a=(m,u,h)=>{let g=document.createElement("button");g.type="button",g.className=s.INBOX_NAV_BTN,g.setAttribute("aria-label",u),g.title=u,g.innerHTML=m;let f=o[h];return g.disabled=!f,f&&g.addEventListener("click",()=>this._openDetail(f)),g};l.appendChild(a(wn,this.strings.prevComment,n-1)),l.appendChild(a(On,this.strings.nextComment,n+1)),l.appendChild(this._closeButton()),r.appendChild(l),this.el.appendChild(r);let d=document.createElement("div");d.className=s.INBOX_DETAIL,d.appendChild(this._buildCard(e,{interactive:!1}));let p=this._buildContextBlock(e);p&&d.appendChild(p);let c=document.createElement("div");c.className=s.INBOX_REPLIES;for(let m of e.replies||[]){let u=j(m,this.strings,this.locale);u.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(h=>{h.addEventListener("click",g=>{g.stopPropagation(),this.callbacks.onShowLightbox(h.src)})}),c.appendChild(u)}d.appendChild(c),d.appendChild(this._buildReplyInput(e)),this.el.appendChild(d)}_buildReplyInput(e){let{container:o,inputEl:n,screenshotsContainer:r,attachBtn:i,fileInput:l,submitBtn:a}=se({areaClassName:s.THREAD_INPUT_AREA,inputTag:"input",inputClassName:s.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),d=[],p=()=>{r.innerHTML="",r.classList.toggle(s.ACTIVE,d.length>0),d.forEach((m,u)=>{let h=document.createElement("div");h.className=s.SCREENSHOT_ITEM;let g=document.createElement("img");g.className=s.SCREENSHOT_IMG,g.src=m,g.alt=this.strings.attachedScreenshot,g.onclick=()=>this.callbacks.onShowLightbox(m);let f=document.createElement("button");f.type="button",f.className=s.SCREENSHOT_REMOVE,f.setAttribute("aria-label",this.strings.removeScreenshot),f.innerHTML="&times;",f.onclick=E=>{E.stopPropagation(),d.splice(u,1),p()},h.appendChild(g),h.appendChild(f),r.appendChild(h)})};i.addEventListener("click",()=>l.click()),l.addEventListener("change",m=>{let u=m.target.files[0];if(!u||d.length>=5)return;let h=new FileReader;h.onload=g=>{d.push(g.target.result),p()},h.readAsDataURL(u),l.value=""});let c=()=>{let m=n.value.trim();!m&&d.length===0||(this.callbacks.onReply(e,m,[...d]),d=[],this.render())};return a.addEventListener("click",c),n.addEventListener("keydown",m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),c())}),o}};var vn=t=>{let e=new Set;for(let o of t){let n=String(o).trim().toLowerCase();n&&e.add(n)}return[...e]},Se=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||st(),this.strings=at(this.locale),this.resizeObservers=new Map,this.mutationObservers=new Map,this.positionValidationEnabled=!0,this._pendingRaf=null,this._pendingContextScreenshot=null,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.initOverlay()):this.initOverlay()}initOverlay(){this.shadowRoot=qe(),this.toolbar=Ct(this.options,this.strings),this.commentBox=Tt(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(x.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(x.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${s.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(x.ATTACH_IMAGE_INPUT),this.bindEventListeners(),this.setupKeyboardShortcut(),this.setupResizeHandlers(),this.injectStyles(),this.options.persistence==="localStorage"&&(this.loadComments(ne()),this._openPendingDetail())}_navigateTo(e){location.assign(e)}_openPendingDetail(){let e=null;try{e=sessionStorage.getItem(oe),e!=null&&sessionStorage.removeItem(oe)}catch{return}if(!e)return;let o=this.comments.find(n=>String(n.id)===e);o&&(this.showInbox(),this.inboxView.openDetail(o.id))}_syncStorage(){this.options.persistence==="localStorage"&&xe(_e(ne(),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 o=e.target.files[0];if(!o||(this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length>=5))return;let n=new FileReader;n.onload=r=>{this._pendingScreenshots.push(r.target.result),this._updateScreenshotsPreview()},n.readAsDataURL(o),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.closeThreadPopover():this.inboxView?.isOpen()?this.closeInbox():this.commentBox.style.display!=="none"?(this.hideCommentBox(),this.toggleCommentMode()):this.commentMode&&this.toggleCommentMode();return}let o=this.isMac&&e.altKey&&(e.key==="\xE7"||e.key==="\xC7"),n=!this.isMac&&e.altKey&&e.key.toLowerCase()==="c",r=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(o||n||r)return e.preventDefault(),e.stopPropagation(),this.toggleCommentMode(),!1},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let o=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(o)||o?.closest?.(`.${s.CIRCLE}`)||o?.closest?.(`.${s.TOOLTIP}`)||o?.closest?.(`.${s.THREAD_POPOVER}`)||o?.closest?.(`.${s.INBOX_PANEL}`)||o?.closest?.(`.${s.LIGHTBOX}`))&&!this.commentBox.contains(o)){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 o=e.clientX-this._dragStart.x,n=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(o,n)<5)return;this._isDragging=!0;let r=Math.min(this._dragStart.x,e.clientX),i=Math.min(this._dragStart.y,e.clientY),l=Math.abs(o),a=Math.abs(n);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=s.SELECTION_RECT,this.shadowRoot.appendChild(this._selectionRect)),this._selectionRect.style.left=`${r}px`,this._selectionRect.style.top=`${i}px`,this._selectionRect.style.width=`${l}px`,this._selectionRect.style.height=`${a}px`}async _onDragEnd(e){if(document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._isDragging){let o=Math.min(this._dragStart.x,e.clientX),n=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{this._pendingScreenshots||(this._pendingScreenshots=[]);let l=await fe(()=>ge({scale:1})),a=Ze(l,{left:o,top:n,width:r,height:i});a&&this._pendingScreenshots.length<5&&this._pendingScreenshots.push(a),this.options.autoScreenshot&&(this._pendingContextScreenshot=Ee(l,{sourceScale:1}))}catch(l){console.warn("Screenshot capture failed:",l)}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,o){if(this.options.autoScreenshot&&!this._pendingContextScreenshot)try{let c=await fe(()=>ge({scale:ee}));this._pendingContextScreenshot=Ee(c,{sourceScale:ee})}catch(c){console.warn("HellDots: automatic screenshot failed",c),this._pendingContextScreenshot=null}let n=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let r=document.elementFromPoint(e,o);this.overlay.style.pointerEvents=n||"";let i=r?.closest?.(tt.CONTAINER)||document.body,l=i.getBoundingClientRect(),a=l.width>0?(e-l.left)/l.width:0,d=l.height>0?(o-l.top)/l.height:0,p=ut(i,a,d);p.targetSelector=r&&r!==i?pt(r):null,this.currentPosition={container:i,relativeX:a,relativeY:d,anchor:p,target:r||i},this.createPreviewCircle(e,o),document.body.classList.remove(s.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,o)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${s.SCREENSHOTS_CONTAINER}`);if(e){if(e.innerHTML="",!this._pendingScreenshots||this._pendingScreenshots.length===0){e.classList.remove(s.ACTIVE);return}e.classList.add(s.ACTIVE),this._pendingScreenshots.forEach((o,n)=>{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=this.strings.attachedScreenshot,i.onclick=()=>this.showLightbox(o);let l=document.createElement("button");l.type="button",l.className=s.SCREENSHOT_REMOVE,l.setAttribute("aria-label",this.strings.removeScreenshot),l.innerHTML="&times;",l.onclick=a=>{a.stopPropagation(),this._pendingScreenshots.splice(n,1),this._updateScreenshotsPreview()},r.appendChild(i),r.appendChild(l),e.appendChild(r)})}}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${s.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(s.ACTIVE))}showCommentBox(e,o){this.commentBox.style.display="block";let n=300,i=28/2,l=i+10,a=window.innerWidth,d=window.innerHeight,p=e+i,c=o+i,m=p+l,u=c-i;m+n>a&&(m=p-l-n),m=Math.max(10,m);let h=this.commentBox.getBoundingClientRect();u+h.height>d&&(u=d-h.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(s.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,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()}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:Date.now(),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:this.commentBox.classify?.getTags()??[],resolvedAt:null,context:Je(),contextScreenshot:this._pendingContextScreenshot};this.comments.push(e),this._syncStorage(),this.options.onCommentCreated?.(this._serializeComment(e)),this.renderCommentCircle(e),this.hideCommentBox(),this.toggleCommentMode();let o=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);o&&this.showThreadPopover(o,e)}renderCommentCircle(e){let o=yt(e,this.strings);o.addEventListener("mouseenter",()=>this.showCommentTooltip(o,e)),o.addEventListener("mouseleave",()=>{setTimeout(()=>{let n=this.shadowRoot.querySelector(`.${s.TOOLTIP}[data-for="${e.id}"]`);n&&!n.matches(":hover")&&n.remove()},250)}),o.addEventListener("click",n=>{n.stopPropagation();let r=this.shadowRoot.querySelector(`.${s.TOOLTIP}[data-for="${e.id}"]`);r&&r.remove(),this.showThreadPopover(o,e)}),o.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),o.click())}),this.overlay.appendChild(o),this.updateCommentPosition(e,o),this.createResizeObserver(e,o),this.createMutationObserver(e)}showCommentTooltip(e,o){if(this.shadowRoot.querySelector(`.${s.THREAD_POPOVER}[data-for="${o.id}"]`)||this.shadowRoot.querySelector(`.${s.TOOLTIP}[data-for="${o.id}"]`))return;let i=xt(o,this.strings,this.locale);this.shadowRoot.appendChild(i),i.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(l=>{l.addEventListener("click",a=>{a.stopPropagation(),this.showLightbox(l.src)})}),setTimeout(()=>{this.positionPopoverAtCircle(i,e)},10),i.querySelector(`.${s.CLOSE_TOOLTIP}`).addEventListener("click",l=>{l.stopPropagation(),i.remove()}),i.addEventListener("mouseleave",()=>i.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new le({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,callbacks:{onOpenDetailScroll:e=>e.container?.scrollIntoView?.({block:"center"}),onReply:(e,o,n)=>this.addReply(e,o,n),onDelete:e=>this.deleteComment(e),onSetStatus:(e,o)=>this.setCommentStatus(e,o),onSetType:(e,o)=>this.setCommentType(e,o),onSetPriority:(e,o)=>this.setCommentPriority(e,o),onNavigateToPage:e=>{try{sessionStorage.setItem(oe,String(e.id))}catch{}this._navigateTo(e.page)},onShowLightbox:e=>this.showLightbox(e),onClose:()=>this.closeInbox()}})),this.inboxView.open(),setTimeout(()=>{this._inboxClickHandler=e=>{let o=e.composedPath()[0]||e.target;!this.inboxView.el?.contains(o)&&!this.inboxBtn.contains(o)&&this.closeInbox()},document.addEventListener("mousedown",this._inboxClickHandler)},0)}closeInbox(){this.inboxView?.close(),this._inboxClickHandler&&(document.removeEventListener("mousedown",this._inboxClickHandler),this._inboxClickHandler=null)}showThreadPopover(e,o){this.closeThreadPopover();let n=this.shadowRoot.querySelector(`.${s.TOOLTIP}[data-for="${o.id}"]`);n&&n.remove();let r=_t(o,this.strings,this.locale);this.shadowRoot.appendChild(r);let i=r.querySelector(`.${s.THREAD_HEADER}`),l=ie(o,{strings:this.strings,onCopy:E=>re(ae(E,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onSetStatus:(E,b)=>this.setCommentStatus(E.id,b),onSetType:(E,b)=>this.setCommentType(E.id,b),onSetPriority:(E,b)=>this.setCommentPriority(E.id,b),onDelete:E=>{this.closeThreadPopover(),this.deleteComment(E.id),this.inboxView?.isOpen()&&this.inboxView.refresh()}});i.insertBefore(l,i.querySelector(`.${s.CLOSE_TOOLTIP}`));let a=Array.from(r.children).find(E=>E.classList.contains(s.SCREENSHOTS_CONTAINER));a&&a.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(E=>{E.addEventListener("click",b=>{b.stopPropagation(),this.showLightbox(E.src)})}),setTimeout(()=>{e?this.positionPopoverAtCircle(r,e):this.centerPopover(r)},10),r.querySelector(`.${s.CLOSE_TOOLTIP}`).addEventListener("click",E=>{E.stopPropagation(),this.closeThreadPopover()});let d=r.querySelector(`.${s.THREAD_INPUT}`),p=r.querySelector(`.${s.THREAD_SUBMIT}`),c=r.querySelector(`.${s.THREAD_INPUT_AREA} .${s.ATTACH_IMAGE_BTN}`),m=r.querySelector(`.${s.THREAD_INPUT_AREA} input[type="file"]`),u=r.querySelector(`.${s.THREAD_INPUT_AREA} .${s.SCREENSHOTS_CONTAINER}`),h=[],g=()=>{if(u.innerHTML="",h.length===0){u.classList.remove(s.ACTIVE);return}u.classList.add(s.ACTIVE),h.forEach((E,b)=>{let C=document.createElement("div");C.className=s.SCREENSHOT_ITEM;let T=document.createElement("img");T.className=s.SCREENSHOT_IMG,T.src=E,T.alt=this.strings.attachedScreenshot,T.onclick=()=>this.showLightbox(E);let y=document.createElement("button");y.className=s.SCREENSHOT_REMOVE,y.innerHTML="&times;",y.onclick=_=>{_.stopPropagation(),h.splice(b,1),g()},C.appendChild(T),C.appendChild(y),u.appendChild(C)})};c.addEventListener("click",()=>{m.click()}),m.addEventListener("change",E=>{let b=E.target.files[0];if(!b||h.length>=5)return;let C=new FileReader;C.onload=T=>{h.push(T.target.result),g()},C.readAsDataURL(b),m.value=""});let f=()=>{let E=d.value.trim();if(!E&&h.length===0)return;let b=this.addReply(o,E,h.length>0?[...h]:[]),C=r.querySelector(`.${s.THREAD_REPLIES}`),T=j(b,this.strings,this.locale);C.appendChild(T),T.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(y=>{y.addEventListener("click",_=>{_.stopPropagation(),this.showLightbox(y.src)})}),d.value="",h=[],g(),d.focus()};p.addEventListener("click",f),d.addEventListener("keydown",E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),f())}),this.activeThreadPopover=r,setTimeout(()=>d.focus(),50),setTimeout(()=>{this._threadClickHandler=E=>{let b=E.composedPath()[0]||E.target;!r.contains(b)&&!e?.contains(b)&&this.closeThreadPopover()},document.addEventListener("mousedown",this._threadClickHandler)},0)}closeThreadPopover(){this.activeThreadPopover&&(this.activeThreadPopover.remove(),this.activeThreadPopover=null),this._threadClickHandler&&(document.removeEventListener("mousedown",this._threadClickHandler),this._threadClickHandler=null)}showLightbox(e){this.closeLightbox();let o=document.createElement("div");o.className=s.LIGHTBOX;let n=document.createElement("img");n.className=s.LIGHTBOX_IMG,n.src=e,n.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()),o.appendChild(n),o.appendChild(r),o.addEventListener("click",i=>{i.target===o&&this.closeLightbox()}),this.shadowRoot.appendChild(o),this._activeLightbox=o}closeLightbox(){this._activeLightbox?.remove(),this._activeLightbox=null}addReply(e,o,n=[]){e.replies||(e.replies=[]);let r={id:Date.now(),text:o,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:n};return e.replies.push(r),this._syncStorage(),this.options.onReplyAdded?.(this._serializeComment(e),this._serializeReply(r)),r}_serializeReply({id:e,text:o,author:n,timestamp:r,screenshots:i}){return{id:e,text:o,author:n,timestamp:r,screenshots:i||[]}}_serializeComment(e){return{id:e.id,text:e.text,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(o=>this._serializeReply(o)),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,o){if(!V.includes(o))return!1;let n=this.comments.find(i=>i.id===e);if(!n)return!1;if(n.status===o)return!0;n.status=o,n.resolvedAt=o==="resolved"?new Date().toISOString():null;let r=this.shadowRoot?.querySelector(`[data-comment-id="${e}"]`);return r&&this.updateCommentPosition(n,r),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,o){if(o!==null&&!A.includes(o))return!1;let n=this.comments.find(r=>r.id===e);return n?(n.type=o,this._commitUpdate(n)):!1}setCommentPriority(e,o){if(o!==null&&!N.includes(o))return!1;let n=this.comments.find(r=>r.id===e);return n?(n.priority=o,this._commitUpdate(n)):!1}setCommentTags(e,o){if(!Array.isArray(o))return!1;let n=this.comments.find(r=>r.id===e);return n?(n.tags=vn(o),this._commitUpdate(n)):!1}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){return this.comments.some(o=>o.id===e)?(this._removeComment(e),this.options.persistence==="localStorage"&&xe(_e(ne().filter(o=>o.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(o=>o.id!==e)}loadComments(e){let o=0,n=0,r=0;if(!Array.isArray(e))return{anchored:o,orphaned:n,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 l={id:i.id,text:i.text,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]:[],author:i.author||this.strings.anonymous,createdAt:i.createdAt||new Date().toISOString(),screenshots:Array.isArray(i.screenshots)?[...i.screenshots]:[],status:i.status==="closed"?"resolved":V.includes(i.status)?i.status:"open",type:A.includes(i.type)?i.type:null,priority:N.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){l.anchorState="inactive",this.comments.push(l),r++;continue}let a=i.anchor?mt(i.anchor):null;a?(l.container=a.element,l.relativeX=i.anchor.relativeX,l.relativeY=i.anchor.relativeY,l.anchorState="anchored",this.comments.push(l),this.renderCommentCircle(l),o++):(this.comments.push(l),n++,this.options.onAnchorLost?.(this._serializeComment(l)))}return{anchored:o,orphaned:n,inactive:r}}centerPopover(e){let o=e.getBoundingClientRect(),n=Math.max(10,(window.innerWidth-(o.width||400))/2),r=Math.max(10,(window.innerHeight-o.height)/2);e.style.left=`${n}px`,e.style.top=`${r}px`}positionPopoverAtCircle(e,o){let n=o.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,l=28,a=l/2+10,d=r+a,p=i-l/2;d+400>window.innerWidth&&(d=r-a-400),d=Math.max(10,d);let c=e.getBoundingClientRect();p+c.height>window.innerHeight&&(p=window.innerHeight-c.height-10),p=Math.max(10,p),e.style.left=`${d}px`,e.style.top=`${p}px`}createPreviewCircle(e,o){this.removePreviewCircle();let n=document.createElement("div");n.className=`${s.CIRCLE} ${s.PREVIEW_CIRCLE}`,n.style.position="absolute";let r=14;n.style.left=`${e+r}px`,n.style.top=`${o+r}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:o,observer:n}=this.resizeObservers.get(e);n&&n.disconnect(),o&&o.parentNode&&o.parentNode.removeChild(o),this.resizeObservers.delete(e)}}validateAndCalculatePosition(e,o){if(!e.container||!o)return null;let n=e.container.getBoundingClientRect(),r=n.width,i=n.height;if(r<=0||i<=0)return null;let l=e.relativeX*r,a=e.relativeY*i,d=28,p=Math.max(0,Math.min(l,r-d)),c=Math.max(0,Math.min(a,i-d)),m=p/r,u=c/i;return{absoluteX:p,absoluteY:c,relativeX:m,relativeY:u,containerWidth:r,containerHeight:i,containerLeft:n.left,containerTop:n.top}}_isAnchorTargetVisible(e){let o=e.target;if((!o||!o.isConnected)&&e.anchor?.targetSelector){try{o=document.querySelector(e.anchor.targetSelector)}catch{o=null}e.target=o||null}if(!o||!o.isConnected)return!0;let n=o.getBoundingClientRect();return n.width>0&&n.height>0}_isMarkerOccluded(e,o,n){if(typeof document.elementsFromPoint!="function"||o<0||n<0||o>=window.innerWidth||n>=window.innerHeight)return!1;let i=document.elementsFromPoint(o,n).find(d=>d.tagName.toLowerCase()!==L.toLowerCase());if(!i)return!1;let l=e.target?.isConnected?e.target:null;if(l&&(l.contains(i)||i.contains(l)))return!1;let a=e.container;if(!a?.isConnected)return!1;if(!a.contains(i)&&!i.contains(a))return!0;if(a.contains(i)&&i!==a){for(let d=i;d&&d!==a;d=d.parentElement)if(this._looksLikeModalLayer(d,l))return!0}return!1}_looksLikeModalLayer(e,o){if(o&&e.contains(o))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(`.${s.TOOLTIP}[data-for="${e.id}"]`)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}updateCommentPosition(e,o){if(e.status==="resolved"){o&&(o.style.display="none");return}let n=this.validateAndCalculatePosition(e,o);n&&!this._isAnchorTargetVisible(e)&&(n=null);let r=e.hidden===!0;if(!n){o&&e.container&&(e.hidden=!0,o.style.display="none",this._dismissMarkerUi(e),!r&&this.inboxView?.isOpen()&&this.inboxView.refresh());return}let i=14,l=n.containerLeft+n.absoluteX+i,a=n.containerTop+n.absoluteY+i;if(this._isMarkerOccluded(e,l,a)){e.hidden=!0,o.style.display="none",this._dismissMarkerUi(e),!r&&this.inboxView?.isOpen()&&this.inboxView.refresh();return}e.hidden=!1,o.style.display="",r&&this.inboxView?.isOpen()&&this.inboxView.refresh(),o.style.left=`${l}px`,o.style.top=`${a}px`,o.style.transform="translate(-50%, -50%)",o.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 o=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);o&&this.updateCommentPosition(e,o)})}))},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,o){if(!e||!o)return;let n=e.container.getBoundingClientRect(),r=o.getBoundingClientRect(),i=e.relativeX*n.width,l=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:r.left,top:r.top,centerX:r.left+r.width/2,centerY:r.top+r.height/2},expectedPosition:{x:i,y:l},offset:{x:r.left+r.width/2-(n.left+i),y:r.top+r.height/2-(n.top+l)}})}createResizeObserver(e,o){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let n=new ResizeObserver(r=>{if(this.positionValidationEnabled)for(let i of r)i.target===e.container&&this.updateCommentPosition(e,o)});n.observe(e.container),this.resizeObservers.set(e.id,{circle:o,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 o=new MutationObserver(()=>{this.scheduleUpdatePositions()});o.observe(e.container,{attributes:!0,attributeFilter:void 0,childList:!0,subtree:!0}),this.mutationObservers.set(e.id,o)}cleanup(){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(s.COMMENT_CURSOR),document.getElementById(x.GLOBAL_STYLES)?.remove(),this.comments.forEach(e=>{let o=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);o&&o.parentNode&&o.parentNode.removeChild(o)})}injectStyles(){let e=this.shadowRoot.getElementById(x.STYLES);e&&e.remove();let o=document.createElement("style");o.id=x.STYLES,o.textContent=nt(),this.shadowRoot.appendChild(o);let n=document.getElementById(x.GLOBAL_STYLES);n&&n.remove();let r=document.createElement("style");r.id=x.GLOBAL_STYLES,r.textContent=rt(),document.head.appendChild(r)}},we=Se;function St(t={}){let{autoInit:e=!0,...o}=t,n=()=>new we(o);return e?n():n}var An=St;return Rt(Nn);})();
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);})();
1032
1468
  if (typeof module !== 'undefined' && module.exports) { module.exports = HellDots.default; }