helldots 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1468 +1,23 @@
1
1
  /*! HellDots — MIT. Bundles nanoid (MIT) © 2017 Andrey Sitnik <andrey@sitnik.es> — https://github.com/ai/nanoid */
2
- var HellDots=(()=>{var ye=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var eo=Object.getOwnPropertyNames;var to=Object.prototype.hasOwnProperty;var oo=(o,e)=>{for(var t in e)ye(o,t,{get:e[t],enumerable:!0})},no=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of eo(e))!to.call(o,s)&&s!==t&&ye(o,s,{get:()=>e[s],enumerable:!(n=Qt(e,s))||n.enumerable});return o};var io=o=>no(ye({},"__esModule",{value:!0}),o);var li={};oo(li,{CommentOverlay:()=>Ye,createCommentOverlay:()=>Zt,default:()=>ai});var Qe="[modern-screenshot]",L=typeof window<"u",ro=L&&"Worker"in window,di=L&&"atob"in window,hi=L&&"btoa"in window,Oe=L?window.navigator?.userAgent:"",et=Oe.includes("Chrome"),ie=Oe.includes("AppleWebKit")&&!et,ve=Oe.includes("Firefox"),so=o=>o&&"__CONTEXT__"in o,ao=o=>o.constructor.name==="CSSFontFaceRule",lo=o=>o.constructor.name==="CSSImportRule",co=o=>o.constructor.name==="CSSLayerBlockRule",A=o=>o.nodeType===1,j=o=>typeof o.className=="object",tt=o=>o.tagName==="image",ho=o=>o.tagName==="use",z=o=>A(o)&&typeof o.style<"u"&&!j(o),po=o=>o.nodeType===8,uo=o=>o.nodeType===3,H=o=>o.tagName==="IMG",re=o=>o.tagName==="VIDEO",mo=o=>o.tagName==="CANVAS",go=o=>o.tagName==="TEXTAREA",fo=o=>o.tagName==="INPUT",Eo=o=>o.tagName==="STYLE",bo=o=>o.tagName==="SCRIPT",Co=o=>o.tagName==="SELECT",To=o=>o.tagName==="SLOT",xo=o=>o.tagName==="IFRAME",_o=(...o)=>console.warn(Qe,...o);function yo(o){let e=o?.createElement?.("canvas");return e&&(e.height=e.width=1),!!e&&"toDataURL"in e&&!!e.toDataURL("image/webp").includes("image/webp")}var we=o=>o.startsWith("data:");function ot(o,e){if(o.match(/^[a-z]+:\/\//i))return o;if(L&&o.match(/^\/\//))return window.location.protocol+o;if(o.match(/^[a-z]+:/i)||!L)return o;let t=se().implementation.createHTMLDocument(),n=t.createElement("base"),s=t.createElement("a");return t.head.appendChild(n),t.body.appendChild(s),e&&(n.href=e),s.href=o,s.href}function se(o){return(o&&A(o)?o?.ownerDocument:o)??window.document}var ae="http://www.w3.org/2000/svg";function wo(o,e,t){let n=se(t).createElementNS(ae,"svg");return n.setAttributeNS(null,"width",o.toString()),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"viewBox",`0 0 ${o} ${e}`),n}function So(o,e){let t=new XMLSerializer().serializeToString(o);return e&&(t=t.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Oo(o,e){return new Promise((t,n)=>{let s=new FileReader;s.onload=()=>t(s.result),s.onerror=()=>n(s.error),s.onabort=()=>n(new Error(`Failed read blob to ${e}`)),e==="dataUrl"?s.readAsDataURL(o):e==="arrayBuffer"&&s.readAsArrayBuffer(o)})}var vo=o=>Oo(o,"dataUrl");function k(o,e){let t=se(e).createElement("img");return t.decoding="sync",t.loading="eager",t.src=o,t}function Y(o,e){return new Promise(t=>{let{timeout:n,ownerDocument:s,onError:r,onWarn:a}=e??{},l=typeof o=="string"?k(o,se(s)):o,c=null,h=null;function d(){t(l),c&&clearTimeout(c),h?.()}if(n&&(c=setTimeout(d,n)),re(l)){let p=l.currentSrc||l.src;if(!p)return l.poster?Y(l.poster,e).then(t):d();if(l.readyState>=2)return d();let m=d,u=g=>{a?.("Failed video load",p,g),r?.(g),d()};h=()=>{l.removeEventListener("loadeddata",m),l.removeEventListener("error",u)},l.addEventListener("loadeddata",m,{once:!0}),l.addEventListener("error",u,{once:!0})}else{let p=tt(l)?l.href.baseVal:l.currentSrc||l.src;if(!p)return d();let m=async()=>{if(H(l)&&"decode"in l)try{await l.decode()}catch(g){a?.("Failed to decode image, trying to render anyway",l.dataset.originalSrc||p,g)}d()},u=g=>{a?.("Failed image load",l.dataset.originalSrc||p,g),d()};if(H(l)&&l.complete)return m();h=()=>{l.removeEventListener("load",m),l.removeEventListener("error",u)},l.addEventListener("load",m,{once:!0}),l.addEventListener("error",u,{once:!0})}})}async function Ao(o,e){z(o)&&(H(o)||re(o)?await Y(o,e):await Promise.all(["img","video"].flatMap(t=>Array.from(o.querySelectorAll(t)).map(n=>Y(n,e)))))}var nt=(function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function it(o){return o?.split(",").map(e=>e.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var We=0;function No(o){let e=`${Qe}[#${We}]`;return We++,{time:t=>o&&console.time(`${e} ${t}`),timeEnd:t=>o&&console.timeEnd(`${e} ${t}`),warn:(...t)=>o&&_o(...t)}}function Ro(o){return{cache:o?"no-cache":"force-cache"}}async function rt(o,e){return so(o)?o:Io(o,{...e,autoDestruct:!0})}async function Io(o,e){let{scale:t=1,workerUrl:n,workerNumber:s=1}=e||{},r=!!e?.debug,a=e?.features??!0,l=o.ownerDocument??(L?window.document:void 0),c=o.ownerDocument?.defaultView??(L?window:void 0),h=new Map,d={width:0,height:0,quality:1,type:"image/png",scale:t,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:r,fetch:{requestInit:Ro(e?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...e?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:s,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...e,__CONTEXT__:!0,log:No(r),node:o,ownerDocument:l,ownerWindow:c,dpi:t===1?null:96*t,svgStyleElement:st(l),svgDefsElement:l?.createElementNS(ae,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:ro&&n&&s?s:0})].map(()=>{try{let u=new Worker(n);return u.onmessage=async g=>{let{url:f,result:b}=g.data;b?h.get(f)?.resolve?.(b):h.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`))},u.onmessageerror=g=>{let{url:f}=g.data;h.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`))},u}catch(u){return d.log.warn("Failed to new Worker",u),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[yo(l)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:h,drawImageCount:0,tasks:[],features:a,isEnable:u=>u==="restoreScrollPosition"?typeof a=="boolean"?!1:a[u]??!1:typeof a=="boolean"?a:a[u]??!0,shadowRoots:[]};d.log.time("wait until load"),await Ao(o,{timeout:d.timeout,onWarn:d.log.warn}),d.log.timeEnd("wait until load");let{width:p,height:m}=Lo(o,d);return d.width=p,d.height=m,d}function st(o){if(!o)return;let e=o.createElement("style"),t=e.ownerDocument.createTextNode(`
2
+ /*! Bundles modern-screenshot (MIT) © 2021-present wxm https://github.com/qq15725/modern-screenshot */
3
+ var HellDots=(()=>{var tt=Object.defineProperty;var yo=Object.getOwnPropertyDescriptor;var So=Object.getOwnPropertyNames;var Oo=Object.prototype.hasOwnProperty;var Ao=(n,e)=>{for(var t in e)tt(n,t,{get:e[t],enumerable:!0})},Io=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of So(e))!Oo.call(n,s)&&s!==t&&tt(n,s,{get:()=>e[s],enumerable:!(o=yo(e,s))||o.enumerable});return n};var Ro=n=>Io(tt({},"__esModule",{value:!0}),n);var qr={};Ao(qr,{CommentOverlay:()=>$t,createCommentOverlay:()=>_o,default:()=>Kr});var Yt="[modern-screenshot]",F=typeof window<"u",wo=F&&"Worker"in window,Jr=F&&"atob"in window,Qr=F&&"btoa"in window,it=F?window.navigator?.userAgent:"",Wt=it.includes("Chrome"),Ae=it.includes("AppleWebKit")&&!Wt,rt=it.includes("Firefox"),vo=n=>n&&"__CONTEXT__"in n,No=n=>n.constructor.name==="CSSFontFaceRule",Lo=n=>n.constructor.name==="CSSImportRule",Mo=n=>n.constructor.name==="CSSLayerBlockRule",k=n=>n.nodeType===1,fe=n=>typeof n.className=="object",jt=n=>n.tagName==="image",Do=n=>n.tagName==="use",ue=n=>k(n)&&typeof n.style<"u"&&!fe(n),Bo=n=>n.nodeType===8,Po=n=>n.nodeType===3,ee=n=>n.tagName==="IMG",Ie=n=>n.tagName==="VIDEO",ko=n=>n.tagName==="CANVAS",$o=n=>n.tagName==="TEXTAREA",Ho=n=>n.tagName==="INPUT",Uo=n=>n.tagName==="STYLE",Xo=n=>n.tagName==="SCRIPT",Fo=n=>n.tagName==="SELECT",zo=n=>n.tagName==="SLOT",Go=n=>n.tagName==="IFRAME",Vo=(...n)=>console.warn(Yt,...n);function Yo(n){let e=n?.createElement?.("canvas");return e&&(e.height=e.width=1),!!e&&"toDataURL"in e&&!!e.toDataURL("image/webp").includes("image/webp")}var nt=n=>n.startsWith("data:");function Kt(n,e){if(n.match(/^[a-z]+:\/\//i))return n;if(F&&n.match(/^\/\//))return window.location.protocol+n;if(n.match(/^[a-z]+:/i)||!F)return n;let t=Re().implementation.createHTMLDocument(),o=t.createElement("base"),s=t.createElement("a");return t.head.appendChild(o),t.body.appendChild(s),e&&(o.href=e),s.href=n,s.href}function Re(n){return(n&&k(n)?n?.ownerDocument:n)??window.document}var we="http://www.w3.org/2000/svg";function Wo(n,e,t){let o=Re(t).createElementNS(we,"svg");return o.setAttributeNS(null,"width",n.toString()),o.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${n} ${e}`),o}function jo(n,e){let t=new XMLSerializer().serializeToString(n);return e&&(t=t.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Ko(n,e){return new Promise((t,o)=>{let s=new FileReader;s.onload=()=>t(s.result),s.onerror=()=>o(s.error),s.onabort=()=>o(new Error(`Failed read blob to ${e}`)),e==="dataUrl"?s.readAsDataURL(n):e==="arrayBuffer"&&s.readAsArrayBuffer(n)})}var qo=n=>Ko(n,"dataUrl");function Q(n,e){let t=Re(e).createElement("img");return t.decoding="sync",t.loading="eager",t.src=n,t}function he(n,e){return new Promise(t=>{let{timeout:o,ownerDocument:s,onError:i,onWarn:a}=e??{},l=typeof n=="string"?Q(n,Re(s)):n,c=null,d=null;function p(){t(l),c&&clearTimeout(c),d?.()}if(o&&(c=setTimeout(p,o)),Ie(l)){let u=l.currentSrc||l.src;if(!u)return l.poster?he(l.poster,e).then(t):p();if(l.readyState>=2)return p();let h=p,m=f=>{a?.("Failed video load",u,f),i?.(f),p()};d=()=>{l.removeEventListener("loadeddata",h),l.removeEventListener("error",m)},l.addEventListener("loadeddata",h,{once:!0}),l.addEventListener("error",m,{once:!0})}else{let u=jt(l)?l.href.baseVal:l.currentSrc||l.src;if(!u)return p();let h=async()=>{if(ee(l)&&"decode"in l)try{await l.decode()}catch(f){a?.("Failed to decode image, trying to render anyway",l.dataset.originalSrc||u,f)}p()},m=f=>{a?.("Failed image load",l.dataset.originalSrc||u,f),p()};if(ee(l)&&l.complete)return h();d=()=>{l.removeEventListener("load",h),l.removeEventListener("error",m)},l.addEventListener("load",h,{once:!0}),l.addEventListener("error",m,{once:!0})}})}async function Zo(n,e){ue(n)&&(ee(n)||Ie(n)?await he(n,e):await Promise.all(["img","video"].flatMap(t=>Array.from(n.querySelectorAll(t)).map(o=>he(o,e)))))}var qt=(function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Zt(n){return n?.split(",").map(e=>e.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var Ut=0;function Jo(n){let e=`${Yt}[#${Ut}]`;return Ut++,{time:t=>n&&console.time(`${e} ${t}`),timeEnd:t=>n&&console.timeEnd(`${e} ${t}`),warn:(...t)=>n&&Vo(...t)}}function Qo(n){return{cache:n?"no-cache":"force-cache"}}async function Jt(n,e){return vo(n)?n:ei(n,{...e,autoDestruct:!0})}async function ei(n,e){let{scale:t=1,workerUrl:o,workerNumber:s=1}=e||{},i=!!e?.debug,a=e?.features??!0,l=n.ownerDocument??(F?window.document:void 0),c=n.ownerDocument?.defaultView??(F?window:void 0),d=new Map,p={width:0,height:0,quality:1,type:"image/png",scale:t,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:Qo(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:Jo(i),node:n,ownerDocument:l,ownerWindow:c,dpi:t===1?null:96*t,svgStyleElement:Qt(l),svgDefsElement:l?.createElementNS(we,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:wo&&o&&s?s:0})].map(()=>{try{let m=new Worker(o);return m.onmessage=async f=>{let{url:g,result:E}=f.data;E?d.get(g)?.resolve?.(E):d.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},m.onmessageerror=f=>{let{url:g}=f.data;d.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},m}catch(m){return p.log.warn("Failed to new Worker",m),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:d,drawImageCount:0,tasks:[],features:a,isEnable:m=>m==="restoreScrollPosition"?typeof a=="boolean"?!1:a[m]??!1:typeof a=="boolean"?a:a[m]??!0,shadowRoots:[]};p.log.time("wait until load"),await Zo(n,{timeout:p.timeout,onWarn:p.log.warn}),p.log.timeEnd("wait until load");let{width:u,height:h}=ti(n,p);return p.width=u,p.height=h,p}function Qt(n){if(!n)return;let e=n.createElement("style"),t=e.ownerDocument.createTextNode(`
3
4
  .______background-clip--text {
4
5
  background-clip: text;
5
6
  -webkit-background-clip: text;
6
7
  }
7
- `);return e.appendChild(t),e}function Lo(o,e){let{width:t,height:n}=e;if(A(o)&&(!t||!n)){let s=o.getBoundingClientRect();t=t||s.width||Number(o.getAttribute("width"))||0,n=n||s.height||Number(o.getAttribute("height"))||0}return{width:t,height:n}}async function Bo(o,e){let{log:t,timeout:n,drawImageCount:s,drawImageInterval:r}=e;t.time("image to canvas");let a=await Y(o,{timeout:n,onWarn:e.log.warn}),{canvas:l,context2d:c}=Po(o.ownerDocument,e),h=()=>{try{c?.drawImage(a,0,0,l.width,l.height)}catch(d){e.log.warn("Failed to drawImage",d)}};if(h(),e.isEnable("fixSvgXmlDecode"))for(let d=0;d<s;d++)await new Promise(p=>{setTimeout(()=>{c?.clearRect(0,0,l.width,l.height),h(),p()},d+r)});return e.drawImageCount=0,t.timeEnd("image to canvas"),l}function Po(o,e){let{width:t,height:n,scale:s,backgroundColor:r,maximumCanvasSize:a}=e,l=o.createElement("canvas");l.width=Math.floor(t*s),l.height=Math.floor(n*s),l.style.width=`${t}px`,l.style.height=`${n}px`,a&&(l.width>a||l.height>a)&&(l.width>a&&l.height>a?l.width>l.height?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a):l.width>a?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a));let c=l.getContext("2d");return c&&r&&(c.fillStyle=r,c.fillRect(0,0,l.width,l.height)),{canvas:l,context2d:c}}function at(o,e){if(o.ownerDocument)try{let r=o.toDataURL();if(r!=="data:,")return k(r,o.ownerDocument)}catch(r){e.log.warn("Failed to clone canvas",r)}let t=o.cloneNode(!1),n=o.getContext("2d"),s=t.getContext("2d");try{return n&&s&&s.putImageData(n.getImageData(0,0,o.width,o.height),0,0),t}catch(r){e.log.warn("Failed to clone canvas",r)}return t}function Do(o,e){try{if(o?.contentDocument?.documentElement)return Ae(o.contentDocument.documentElement,e)}catch(t){e.log.warn("Failed to clone iframe",t)}return o.cloneNode(!1)}function Mo(o){let e=o.cloneNode(!1);return o.currentSrc&&o.currentSrc!==o.src&&(e.src=o.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager"),e}async function $o(o,e){if(o.ownerDocument&&!o.currentSrc&&o.poster)return k(o.poster,o.ownerDocument);let t=o.cloneNode(!1);t.crossOrigin="anonymous",o.currentSrc&&o.currentSrc!==o.src&&(t.src=o.currentSrc);let n=t.ownerDocument;if(n){let s=!0;if(await Y(t,{onError:()=>s=!1,onWarn:e.log.warn}),!s)return o.poster?k(o.poster,o.ownerDocument):t;t.currentTime=o.currentTime,await new Promise(a=>{t.addEventListener("seeked",a,{once:!0})});let r=n.createElement("canvas");r.width=o.offsetWidth,r.height=o.offsetHeight;try{let a=r.getContext("2d");a&&a.drawImage(t,0,0,r.width,r.height)}catch(a){return e.log.warn("Failed to clone video",a),o.poster?k(o.poster,o.ownerDocument):t}return at(r,e)}return t}function ko(o,e){return mo(o)?at(o,e):xo(o)?Do(o,e):H(o)?Mo(o):re(o)?$o(o,e):o.cloneNode(!1)}function Ho(o){let e=o.sandbox;if(!e){let{ownerDocument:t}=o;try{t&&(e=t.createElement("iframe"),e.id=`__SANDBOX__${nt()}`,e.width="0",e.height="0",e.style.visibility="hidden",e.style.position="fixed",t.body.appendChild(e),e.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',o.sandbox=e)}catch(n){o.log.warn("Failed to getSandBox",n)}}return e}var Xo=["width","height","-webkit-text-fill-color"],Fo=["stroke","fill"];function lt(o,e,t){let{defaultComputedStyles:n}=t,s=o.nodeName.toLowerCase(),r=j(o)&&s!=="svg",a=r?Fo.map(f=>[f,o.getAttribute(f)]).filter(([,f])=>f!==null):[],l=[r&&"svg",s,a.map((f,b)=>`${f}=${b}`).join(","),e].filter(Boolean).join(":");if(n.has(l))return n.get(l);let h=Ho(t)?.contentWindow;if(!h)return new Map;let d=h?.document,p,m;r?(p=d.createElementNS(ae,"svg"),m=p.ownerDocument.createElementNS(p.namespaceURI,s),a.forEach(([f,b])=>{m.setAttributeNS(null,f,b)}),p.appendChild(m)):p=m=d.createElement(s),m.textContent=" ",d.body.appendChild(p);let u=h.getComputedStyle(m,e),g=new Map;for(let f=u.length,b=0;b<f;b++){let C=u.item(b);Xo.includes(C)||g.set(C,u.getPropertyValue(C))}return d.body.removeChild(p),n.set(l,g),g}function ct(o,e,t){let n=new Map,s=[],r=new Map;if(t)for(let l of t)a(l);else for(let l=o.length,c=0;c<l;c++){let h=o.item(c);a(h)}for(let l=s.length,c=0;c<l;c++)r.get(s[c])?.forEach((h,d)=>n.set(d,h));function a(l){let c=o.getPropertyValue(l),h=o.getPropertyPriority(l),d=l.lastIndexOf("-"),p=d>-1?l.substring(0,d):void 0;if(p){let m=r.get(p);m||(m=new Map,r.set(p,m)),m.set(l,[c,h])}e.get(l)===c&&!h||(p?s.push(p):n.set(l,[c,h]))}return n}function Uo(o,e,t,n){let{ownerWindow:s,includeStyleProperties:r,currentParentNodeStyle:a}=n,l=e.style,c=s.getComputedStyle(o),h=lt(o,null,n);a?.forEach((p,m)=>{h.delete(m)});let d=ct(c,h,r);d.delete("transition-property"),d.delete("all"),d.delete("d"),d.delete("content"),t&&(d.delete("position"),d.delete("margin-top"),d.delete("margin-right"),d.delete("margin-bottom"),d.delete("margin-left"),d.delete("margin-block-start"),d.delete("margin-block-end"),d.delete("margin-inline-start"),d.delete("margin-inline-end"),d.set("box-sizing",["border-box",""])),d.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text"),et&&(d.has("font-kerning")||d.set("font-kerning",["normal",""]),(d.get("overflow-x")?.[0]==="hidden"||d.get("overflow-y")?.[0]==="hidden")&&d.get("text-overflow")?.[0]==="ellipsis"&&o.scrollWidth===o.clientWidth&&d.set("text-overflow",["clip",""]));for(let p=l.length,m=0;m<p;m++)l.removeProperty(l.item(m));return d.forEach(([p,m],u)=>{l.setProperty(u,p,m)}),d}function Vo(o,e){(go(o)||fo(o)||Co(o))&&e.setAttribute("value",o.value)}var Go=["::before","::after"],zo=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function Yo(o,e,t,n,s){let{ownerWindow:r,svgStyleElement:a,svgStyles:l,currentNodeStyle:c}=n;if(!a||!r)return;function h(d){let p=r.getComputedStyle(o,d),m=p.getPropertyValue("content");if(!m||m==="none")return;s?.(m),m=m.replace(/(')|(")|(counter\(.+\))/g,"");let u=[nt()],g=lt(o,d,n);c?.forEach((E,T)=>{g.delete(T)});let f=ct(p,g,n.includeStyleProperties);f.delete("content"),f.delete("-webkit-locale"),f.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text");let b=[`content: '${m}';`];if(f.forEach(([E,T],w)=>{b.push(`${w}: ${E}${T?" !important":""};`)}),b.length===1)return;try{e.className=[e.className,...u].join(" ")}catch(E){n.log.warn("Failed to copyPseudoClass",E);return}let C=b.join(`
8
- `),x=l.get(C);x||(x=[],l.set(C,x)),x.push(`.${u[0]}${d}`)}Go.forEach(h),t&&zo.forEach(h)}var je=new Set(["symbol"]);async function qe(o,e,t,n,s){if(A(t)&&(Eo(t)||bo(t))||n.filter&&!n.filter(t))return;je.has(e.nodeName)||je.has(t.nodeName)?n.currentParentNodeStyle=void 0:n.currentParentNodeStyle=n.currentNodeStyle;let r=await Ae(t,n,!1,s);n.isEnable("restoreScrollPosition")&&Wo(o,r),e.appendChild(r)}async function Ke(o,e,t,n){let s=o.firstChild;A(o)&&o.shadowRoot&&(s=o.shadowRoot?.firstChild,t.shadowRoots.push(o.shadowRoot));for(let r=s;r;r=r.nextSibling)if(!po(r))if(A(r)&&To(r)&&typeof r.assignedNodes=="function"){let a=r.assignedNodes();for(let l=0;l<a.length;l++)await qe(o,e,a[l],t,n)}else await qe(o,e,r,t,n)}function Wo(o,e){if(!z(o)||!z(e))return;let{scrollTop:t,scrollLeft:n}=o;if(!t&&!n)return;let{transform:s}=e.style,r=new DOMMatrix(s),{a,b:l,c,d:h}=r;r.a=1,r.b=0,r.c=0,r.d=1,r.translateSelf(-n,-t),r.a=a,r.b=l,r.c=c,r.d=h,e.style.transform=r.toString()}function jo(o,e){let{backgroundColor:t,width:n,height:s,style:r}=e,a=o.style;if(t&&a.setProperty("background-color",t,"important"),n&&a.setProperty("width",`${n}px`,"important"),s&&a.setProperty("height",`${s}px`,"important"),r)for(let l in r)a[l]=r[l]}var qo=/^[\w-:]+$/;async function Ae(o,e,t=!1,n){let{ownerDocument:s,ownerWindow:r,fontFamilies:a,onCloneEachNode:l}=e;if(s&&uo(o))return n&&/\S/.test(o.data)&&n(o.data),s.createTextNode(o.data);if(s&&r&&A(o)&&(z(o)||j(o))){let h=await ko(o,e);if(e.isEnable("removeAbnormalAttributes")){let f=h.getAttributeNames();for(let b=f.length,C=0;C<b;C++){let x=f[C];qo.test(x)||h.removeAttribute(x)}}let d=e.currentNodeStyle=Uo(o,h,t,e);t&&jo(h,e);let p=!1;if(e.isEnable("copyScrollbar")){let f=[d.get("overflow-x")?.[0],d.get("overflow-y")?.[0]];p=f.includes("scroll")||(f.includes("auto")||f.includes("overlay"))&&(o.scrollHeight>o.clientHeight||o.scrollWidth>o.clientWidth)}let m=d.get("text-transform")?.[0],u=it(d.get("font-family")?.[0]),g=u?f=>{m==="uppercase"?f=f.toUpperCase():m==="lowercase"?f=f.toLowerCase():m==="capitalize"&&(f=f[0].toUpperCase()+f.substring(1)),u.forEach(b=>{let C=a.get(b);C||a.set(b,C=new Set),f.split("").forEach(x=>C.add(x))})}:void 0;return Yo(o,h,p,e,g),Vo(o,h),re(o)||await Ke(o,h,e,g),await l?.(h),h}let c=o.cloneNode(!1);return await Ke(o,c,e),await l?.(c),c}function Ko(o){if(o.ownerDocument=void 0,o.ownerWindow=void 0,o.svgStyleElement=void 0,o.svgDefsElement=void 0,o.svgStyles.clear(),o.defaultComputedStyles.clear(),o.sandbox){try{o.sandbox.remove()}catch(e){o.log.warn("Failed to destroyContext",e)}o.sandbox=void 0}o.workers=[],o.fontFamilies.clear(),o.fontCssTexts.clear(),o.requests.clear(),o.tasks=[],o.shadowRoots=[]}function Zo(o){let{url:e,timeout:t,responseType:n,...s}=o,r=new AbortController,a=t?setTimeout(()=>r.abort(),t):void 0;return fetch(e,{signal:r.signal,...s}).then(l=>{if(!l.ok)throw new Error("Failed fetch, not 2xx response",{cause:l});switch(n){case"arrayBuffer":return l.arrayBuffer();case"dataUrl":return l.blob().then(vo);default:return l.text()}}).finally(()=>clearTimeout(a))}function W(o,e){let{url:t,requestType:n="text",responseType:s="text",imageDom:r}=e,a=t,{timeout:l,acceptOfImage:c,requests:h,fetchFn:d,fetch:{requestInit:p,bypassingCache:m,placeholderImage:u},font:g,workers:f,fontFamilies:b}=o;n==="image"&&(ie||ve)&&o.drawImageCount++;let C=h.get(t);if(!C){m&&m instanceof RegExp&&m.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let x=n.startsWith("font")&&g&&g.minify,E=new Set;x&&n.split(";")[1].split(",").forEach(S=>{b.has(S)&&b.get(S).forEach(P=>E.add(P))});let T=x&&E.size,w={url:a,timeout:l,responseType:T?"arrayBuffer":s,headers:n==="image"?{accept:c}:void 0,...p};C={type:n,resolve:void 0,reject:void 0,response:null},C.response=(async()=>{if(d&&n==="image"){let _=await d(t);if(_)return _}return!ie&&t.startsWith("http")&&f.length?new Promise((_,S)=>{f[h.size&f.length-1].postMessage({rawUrl:t,...w}),C.resolve=_,C.reject=S}):Zo(w)})().catch(_=>{if(h.delete(t),n==="image"&&u)return o.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof u=="string"?u:u(r);throw _}),h.set(t,C)}return C.response}async function dt(o,e,t,n){if(!ht(o))return o;for(let[s,r]of Jo(o,e))try{let a=await W(t,{url:r,requestType:n?"image":"text",responseType:"dataUrl"});o=o.replace(Qo(s),`$1${a}$3`)}catch(a){t.log.warn("Failed to fetch css data url",s,a)}return o}function ht(o){return/url\((['"]?)([^'"]+?)\1\)/.test(o)}var pt=/url\((['"]?)([^'"]+?)\1\)/g;function Jo(o,e){let t=[];return o.replace(pt,(n,s,r)=>(t.push([r,ot(r,e)]),n)),t.filter(([n])=>!we(n))}function Qo(o){let e=o.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}var en=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function tn(o,e){return en.map(t=>{let n=o.getPropertyValue(t);return!n||n==="none"?null:((ie||ve)&&e.drawImageCount++,dt(n,null,e,!0).then(s=>{!s||n===s||o.setProperty(t,s,o.getPropertyPriority(t))}))}).filter(Boolean)}function on(o,e){if(H(o)){let t=o.currentSrc||o.src;if(!we(t))return[W(e,{url:t,imageDom:o,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(o.srcset="",o.dataset.originalSrc=t,o.src=n||"")})];(ie||ve)&&e.drawImageCount++}else if(j(o)&&!we(o.href.baseVal)){let t=o.href.baseVal;return[W(e,{url:t,imageDom:o,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(o.dataset.originalSrc=t,o.href.baseVal=n||"")})]}return[]}function nn(o,e){let{ownerDocument:t,svgDefsElement:n}=e,s=o.getAttribute("href")??o.getAttribute("xlink:href");if(!s)return[];let[r,a]=s.split("#");if(a){let l=`#${a}`,c=e.shadowRoots.reduce((h,d)=>h??d.querySelector(`svg ${l}`),t?.querySelector(`svg ${l}`));if(r&&o.setAttribute("href",l),n?.querySelector(l))return[];if(c)return n?.appendChild(c.cloneNode(!0)),[];if(r)return[W(e,{url:r,responseType:"text"}).then(h=>{n?.insertAdjacentHTML("beforeend",h)})]}return[]}function ut(o,e){let{tasks:t}=e;A(o)&&((H(o)||tt(o))&&t.push(...on(o,e)),ho(o)&&t.push(...nn(o,e))),z(o)&&t.push(...tn(o.style,e)),o.childNodes.forEach(n=>{ut(n,e)})}async function rn(o,e){let{ownerDocument:t,svgStyleElement:n,fontFamilies:s,fontCssTexts:r,tasks:a,font:l}=e;if(!(!t||!n||!s.size))if(l&&l.cssText){let c=Je(l.cssText,e);n.appendChild(t.createTextNode(`${c}
9
- `))}else{let c=Array.from(t.styleSheets).filter(u=>{try{return"cssRules"in u&&!!u.cssRules.length}catch(g){return e.log.warn(`Error while reading CSS rules from ${u.href}`,g),!1}}),h=t.implementation.createHTMLDocument(""),d=h.createElement("style");h.head.appendChild(d);let p=d.sheet;await Promise.all(c.flatMap(u=>Array.from(u.cssRules).map(async g=>{if(lo(g)){let f=g.href,b="";try{b=await W(e,{url:f,requestType:"text",responseType:"text"})}catch(x){e.log.warn(`Error fetch remote css import from ${f}`,x)}let C=b.replace(pt,(x,E,T)=>x.replace(T,ot(T,f)));for(let x of an(C))try{p.insertRule(x,p.cssRules.length)}catch(E){e.log.warn("Error inserting rule from remote css import",{rule:x,error:E})}}}))),p.cssRules.length&&c.push(p);let m=[];c.forEach(u=>{Se(u.cssRules,m)}),m.filter(u=>ao(u)&&ht(u.style.getPropertyValue("src"))&&it(u.style.getPropertyValue("font-family"))?.some(g=>s.has(g))).forEach(u=>{let g=u,f=r.get(g.cssText);f?n.appendChild(t.createTextNode(`${f}
10
- `)):a.push(dt(g.cssText,g.parentStyleSheet?g.parentStyleSheet.href:null,e).then(b=>{b=Je(b,e),r.set(g.cssText,b),n.appendChild(t.createTextNode(`${b}
11
- `))}))})}}var sn=/(\/\*[\s\S]*?\*\/)/g,Ze=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function an(o){if(o==null)return[];let e=[],t=o.replace(sn,"");for(;;){let r=Ze.exec(t);if(!r)break;e.push(r[0])}t=t.replace(Ze,"");let n=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let r=n.exec(t);if(r)s.lastIndex=n.lastIndex;else if(r=s.exec(t),r)n.lastIndex=s.lastIndex;else break;e.push(r[0])}return e}var ln=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,cn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Je(o,e){let{font:t}=e,n=t?t?.preferredFormat:void 0;return n?o.replace(cn,s=>{for(;;){let[r,,a]=ln.exec(s)||[];if(!a)return"";if(a===n)return`src: ${r};`}}):o}function Se(o,e=[]){for(let t of Array.from(o))co(t)?e.push(...Se(t.cssRules)):"cssRules"in t?Se(t.cssRules,e):e.push(t);return e}var dn=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function hn(o){return dn.test(o.innerHTML)}async function pn(o,e){let t=await rt(o,e);if(A(t.node)&&j(t.node)&&!hn(t.node))return t.node;let{ownerDocument:n,log:s,tasks:r,svgStyleElement:a,svgDefsElement:l,svgStyles:c,font:h,progress:d,autoDestruct:p,onCloneNode:m,onEmbedNode:u,onCreateForeignObjectSvg:g}=t;s.time("clone node");let f=await Ae(t.node,t,!0);if(a&&n){let T="";c.forEach((w,_)=>{T+=`${w.join(`,
8
+ `);return e.appendChild(t),e}function ti(n,e){let{width:t,height:o}=e;if(k(n)&&(!t||!o)){let s=n.getBoundingClientRect();t=t||s.width||Number(n.getAttribute("width"))||0,o=o||s.height||Number(n.getAttribute("height"))||0}return{width:t,height:o}}async function ni(n,e){let{log:t,timeout:o,drawImageCount:s,drawImageInterval:i}=e;t.time("image to canvas");let a=await he(n,{timeout:o,onWarn:e.log.warn}),{canvas:l,context2d:c}=oi(n.ownerDocument,e),d=()=>{try{c?.drawImage(a,0,0,l.width,l.height)}catch(p){e.log.warn("Failed to drawImage",p)}};if(d(),e.isEnable("fixSvgXmlDecode"))for(let p=0;p<s;p++)await new Promise(u=>{setTimeout(()=>{c?.clearRect(0,0,l.width,l.height),d(),u()},p+i)});return e.drawImageCount=0,t.timeEnd("image to canvas"),l}function oi(n,e){let{width:t,height:o,scale:s,backgroundColor:i,maximumCanvasSize:a}=e,l=n.createElement("canvas");l.width=Math.floor(t*s),l.height=Math.floor(o*s),l.style.width=`${t}px`,l.style.height=`${o}px`,a&&(l.width>a||l.height>a)&&(l.width>a&&l.height>a?l.width>l.height?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a):l.width>a?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a));let c=l.getContext("2d");return c&&i&&(c.fillStyle=i,c.fillRect(0,0,l.width,l.height)),{canvas:l,context2d:c}}function en(n,e){if(n.ownerDocument)try{let i=n.toDataURL();if(i!=="data:,")return Q(i,n.ownerDocument)}catch(i){e.log.warn("Failed to clone canvas",i)}let t=n.cloneNode(!1),o=n.getContext("2d"),s=t.getContext("2d");try{return o&&s&&s.putImageData(o.getImageData(0,0,n.width,n.height),0,0),t}catch(i){e.log.warn("Failed to clone canvas",i)}return t}function ii(n,e){try{if(n?.contentDocument?.documentElement)return st(n.contentDocument.documentElement,e)}catch(t){e.log.warn("Failed to clone iframe",t)}return n.cloneNode(!1)}function ri(n){let e=n.cloneNode(!1);return n.currentSrc&&n.currentSrc!==n.src&&(e.src=n.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager"),e}async function si(n,e){if(n.ownerDocument&&!n.currentSrc&&n.poster)return Q(n.poster,n.ownerDocument);let t=n.cloneNode(!1);t.crossOrigin="anonymous",n.currentSrc&&n.currentSrc!==n.src&&(t.src=n.currentSrc);let o=t.ownerDocument;if(o){let s=!0;if(await he(t,{onError:()=>s=!1,onWarn:e.log.warn}),!s)return n.poster?Q(n.poster,n.ownerDocument):t;t.currentTime=n.currentTime,await new Promise(a=>{t.addEventListener("seeked",a,{once:!0})});let i=o.createElement("canvas");i.width=n.offsetWidth,i.height=n.offsetHeight;try{let a=i.getContext("2d");a&&a.drawImage(t,0,0,i.width,i.height)}catch(a){return e.log.warn("Failed to clone video",a),n.poster?Q(n.poster,n.ownerDocument):t}return en(i,e)}return t}function ai(n,e){return ko(n)?en(n,e):Go(n)?ii(n,e):ee(n)?ri(n):Ie(n)?si(n,e):n.cloneNode(!1)}function li(n){let e=n.sandbox;if(!e){let{ownerDocument:t}=n;try{t&&(e=t.createElement("iframe"),e.id=`__SANDBOX__${qt()}`,e.width="0",e.height="0",e.style.visibility="hidden",e.style.position="fixed",t.body.appendChild(e),e.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',n.sandbox=e)}catch(o){n.log.warn("Failed to getSandBox",o)}}return e}var ci=["width","height","-webkit-text-fill-color"],di=["stroke","fill"];function tn(n,e,t){let{defaultComputedStyles:o}=t,s=n.nodeName.toLowerCase(),i=fe(n)&&s!=="svg",a=i?di.map(g=>[g,n.getAttribute(g)]).filter(([,g])=>g!==null):[],l=[i&&"svg",s,a.map((g,E)=>`${g}=${E}`).join(","),e].filter(Boolean).join(":");if(o.has(l))return o.get(l);let d=li(t)?.contentWindow;if(!d)return new Map;let p=d?.document,u,h;i?(u=p.createElementNS(we,"svg"),h=u.ownerDocument.createElementNS(u.namespaceURI,s),a.forEach(([g,E])=>{h.setAttributeNS(null,g,E)}),u.appendChild(h)):u=h=p.createElement(s),h.textContent=" ",p.body.appendChild(u);let m=d.getComputedStyle(h,e),f=new Map;for(let g=m.length,E=0;E<g;E++){let b=m.item(E);ci.includes(b)||f.set(b,m.getPropertyValue(b))}return p.body.removeChild(u),o.set(l,f),f}function nn(n,e,t){let o=new Map,s=[],i=new Map;if(t)for(let l of t)a(l);else for(let l=n.length,c=0;c<l;c++){let d=n.item(c);a(d)}for(let l=s.length,c=0;c<l;c++)i.get(s[c])?.forEach((d,p)=>o.set(p,d));function a(l){let c=n.getPropertyValue(l),d=n.getPropertyPriority(l),p=l.lastIndexOf("-"),u=p>-1?l.substring(0,p):void 0;if(u){let h=i.get(u);h||(h=new Map,i.set(u,h)),h.set(l,[c,d])}e.get(l)===c&&!d||(u?s.push(u):o.set(l,[c,d]))}return o}function pi(n,e,t,o){let{ownerWindow:s,includeStyleProperties:i,currentParentNodeStyle:a}=o,l=e.style,c=s.getComputedStyle(n),d=tn(n,null,o);a?.forEach((u,h)=>{d.delete(h)});let p=nn(c,d,i);p.delete("transition-property"),p.delete("all"),p.delete("d"),p.delete("content"),t&&(p.delete("position"),p.delete("margin-top"),p.delete("margin-right"),p.delete("margin-bottom"),p.delete("margin-left"),p.delete("margin-block-start"),p.delete("margin-block-end"),p.delete("margin-inline-start"),p.delete("margin-inline-end"),p.set("box-sizing",["border-box",""])),p.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text"),Wt&&(p.has("font-kerning")||p.set("font-kerning",["normal",""]),(p.get("overflow-x")?.[0]==="hidden"||p.get("overflow-y")?.[0]==="hidden")&&p.get("text-overflow")?.[0]==="ellipsis"&&n.scrollWidth===n.clientWidth&&p.set("text-overflow",["clip",""]));for(let u=l.length,h=0;h<u;h++)l.removeProperty(l.item(h));return p.forEach(([u,h],m)=>{l.setProperty(m,u,h)}),p}function ui(n,e){($o(n)||Ho(n)||Fo(n))&&e.setAttribute("value",n.value)}var hi=["::before","::after"],mi=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function fi(n,e,t,o,s){let{ownerWindow:i,svgStyleElement:a,svgStyles:l,currentNodeStyle:c}=o;if(!a||!i)return;function d(p){let u=i.getComputedStyle(n,p),h=u.getPropertyValue("content");if(!h||h==="none")return;s?.(h),h=h.replace(/(')|(")|(counter\(.+\))/g,"");let m=[qt()],f=tn(n,p,o);c?.forEach((T,x)=>{f.delete(x)});let g=nn(u,f,o.includeStyleProperties);g.delete("content"),g.delete("-webkit-locale"),g.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text");let E=[`content: '${h}';`];if(g.forEach(([T,x],v)=>{E.push(`${v}: ${T}${x?" !important":""};`)}),E.length===1)return;try{e.className=[e.className,...m].join(" ")}catch(T){o.log.warn("Failed to copyPseudoClass",T);return}let b=E.join(`
9
+ `),_=l.get(b);_||(_=[],l.set(b,_)),_.push(`.${m[0]}${p}`)}hi.forEach(d),t&&mi.forEach(d)}var Xt=new Set(["symbol"]);async function Ft(n,e,t,o,s){if(k(t)&&(Uo(t)||Xo(t))||o.filter&&!o.filter(t))return;Xt.has(e.nodeName)||Xt.has(t.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;let i=await st(t,o,!1,s);o.isEnable("restoreScrollPosition")&&gi(n,i),e.appendChild(i)}async function zt(n,e,t,o){let s=n.firstChild;k(n)&&n.shadowRoot&&(s=n.shadowRoot?.firstChild,t.shadowRoots.push(n.shadowRoot));for(let i=s;i;i=i.nextSibling)if(!Bo(i))if(k(i)&&zo(i)&&typeof i.assignedNodes=="function"){let a=i.assignedNodes();for(let l=0;l<a.length;l++)await Ft(n,e,a[l],t,o)}else await Ft(n,e,i,t,o)}function gi(n,e){if(!ue(n)||!ue(e))return;let{scrollTop:t,scrollLeft:o}=n;if(!t&&!o)return;let{transform:s}=e.style,i=new DOMMatrix(s),{a,b:l,c,d}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-o,-t),i.a=a,i.b=l,i.c=c,i.d=d,e.style.transform=i.toString()}function Ei(n,e){let{backgroundColor:t,width:o,height:s,style:i}=e,a=n.style;if(t&&a.setProperty("background-color",t,"important"),o&&a.setProperty("width",`${o}px`,"important"),s&&a.setProperty("height",`${s}px`,"important"),i)for(let l in i)a[l]=i[l]}var bi=/^[\w-:]+$/;async function st(n,e,t=!1,o){let{ownerDocument:s,ownerWindow:i,fontFamilies:a,onCloneEachNode:l}=e;if(s&&Po(n))return o&&/\S/.test(n.data)&&o(n.data),s.createTextNode(n.data);if(s&&i&&k(n)&&(ue(n)||fe(n))){let d=await ai(n,e);if(e.isEnable("removeAbnormalAttributes")){let g=d.getAttributeNames();for(let E=g.length,b=0;b<E;b++){let _=g[b];bi.test(_)||d.removeAttribute(_)}}let p=e.currentNodeStyle=pi(n,d,t,e);t&&Ei(d,e);let u=!1;if(e.isEnable("copyScrollbar")){let g=[p.get("overflow-x")?.[0],p.get("overflow-y")?.[0]];u=g.includes("scroll")||(g.includes("auto")||g.includes("overlay"))&&(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)}let h=p.get("text-transform")?.[0],m=Zt(p.get("font-family")?.[0]),f=m?g=>{h==="uppercase"?g=g.toUpperCase():h==="lowercase"?g=g.toLowerCase():h==="capitalize"&&(g=g[0].toUpperCase()+g.substring(1)),m.forEach(E=>{let b=a.get(E);b||a.set(E,b=new Set),g.split("").forEach(_=>b.add(_))})}:void 0;return fi(n,d,u,e,f),ui(n,d),Ie(n)||await zt(n,d,e,f),await l?.(d),d}let c=n.cloneNode(!1);return await zt(n,c,e),await l?.(c),c}function Ci(n){if(n.ownerDocument=void 0,n.ownerWindow=void 0,n.svgStyleElement=void 0,n.svgDefsElement=void 0,n.svgStyles.clear(),n.defaultComputedStyles.clear(),n.sandbox){try{n.sandbox.remove()}catch(e){n.log.warn("Failed to destroyContext",e)}n.sandbox=void 0}n.workers=[],n.fontFamilies.clear(),n.fontCssTexts.clear(),n.requests.clear(),n.tasks=[],n.shadowRoots=[]}function Ti(n){let{url:e,timeout:t,responseType:o,...s}=n,i=new AbortController,a=t?setTimeout(()=>i.abort(),t):void 0;return fetch(e,{signal:i.signal,...s}).then(l=>{if(!l.ok)throw new Error("Failed fetch, not 2xx response",{cause:l});switch(o){case"arrayBuffer":return l.arrayBuffer();case"dataUrl":return l.blob().then(qo);default:return l.text()}}).finally(()=>clearTimeout(a))}function me(n,e){let{url:t,requestType:o="text",responseType:s="text",imageDom:i}=e,a=t,{timeout:l,acceptOfImage:c,requests:d,fetchFn:p,fetch:{requestInit:u,bypassingCache:h,placeholderImage:m},font:f,workers:g,fontFamilies:E}=n;o==="image"&&(Ae||rt)&&n.drawImageCount++;let b=d.get(t);if(!b){h&&h instanceof RegExp&&h.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let _=o.startsWith("font")&&f&&f.minify,T=new Set;_&&o.split(";")[1].split(",").forEach(y=>{E.has(y)&&E.get(y).forEach(Oe=>T.add(Oe))});let x=_&&T.size,v={url:a,timeout:l,responseType:x?"arrayBuffer":s,headers:o==="image"?{accept:c}:void 0,...u};b={type:o,resolve:void 0,reject:void 0,response:null},b.response=(async()=>{if(p&&o==="image"){let C=await p(t);if(C)return C}return!Ae&&t.startsWith("http")&&g.length?new Promise((C,y)=>{g[d.size&g.length-1].postMessage({rawUrl:t,...v}),b.resolve=C,b.reject=y}):Ti(v)})().catch(C=>{if(d.delete(t),o==="image"&&m)return n.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof m=="string"?m:m(i);throw C}),d.set(t,b)}return b.response}async function on(n,e,t,o){if(!rn(n))return n;for(let[s,i]of _i(n,e))try{let a=await me(t,{url:i,requestType:o?"image":"text",responseType:"dataUrl"});n=n.replace(xi(s),`$1${a}$3`)}catch(a){t.log.warn("Failed to fetch css data url",s,a)}return n}function rn(n){return/url\((['"]?)([^'"]+?)\1\)/.test(n)}var sn=/url\((['"]?)([^'"]+?)\1\)/g;function _i(n,e){let t=[];return n.replace(sn,(o,s,i)=>(t.push([i,Kt(i,e)]),o)),t.filter(([o])=>!nt(o))}function xi(n){let e=n.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}var yi=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function Si(n,e){return yi.map(t=>{let o=n.getPropertyValue(t);return!o||o==="none"?null:((Ae||rt)&&e.drawImageCount++,on(o,null,e,!0).then(s=>{!s||o===s||n.setProperty(t,s,n.getPropertyPriority(t))}))}).filter(Boolean)}function Oi(n,e){if(ee(n)){let t=n.currentSrc||n.src;if(!nt(t))return[me(e,{url:t,imageDom:n,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(n.srcset="",n.dataset.originalSrc=t,n.src=o||"")})];(Ae||rt)&&e.drawImageCount++}else if(fe(n)&&!nt(n.href.baseVal)){let t=n.href.baseVal;return[me(e,{url:t,imageDom:n,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(n.dataset.originalSrc=t,n.href.baseVal=o||"")})]}return[]}function Ai(n,e){let{ownerDocument:t,svgDefsElement:o}=e,s=n.getAttribute("href")??n.getAttribute("xlink:href");if(!s)return[];let[i,a]=s.split("#");if(a){let l=`#${a}`,c=e.shadowRoots.reduce((d,p)=>d??p.querySelector(`svg ${l}`),t?.querySelector(`svg ${l}`));if(i&&n.setAttribute("href",l),o?.querySelector(l))return[];if(c)return o?.appendChild(c.cloneNode(!0)),[];if(i)return[me(e,{url:i,responseType:"text"}).then(d=>{o?.insertAdjacentHTML("beforeend",d)})]}return[]}function an(n,e){let{tasks:t}=e;k(n)&&((ee(n)||jt(n))&&t.push(...Oi(n,e)),Do(n)&&t.push(...Ai(n,e))),ue(n)&&t.push(...Si(n.style,e)),n.childNodes.forEach(o=>{an(o,e)})}async function Ii(n,e){let{ownerDocument:t,svgStyleElement:o,fontFamilies:s,fontCssTexts:i,tasks:a,font:l}=e;if(!(!t||!o||!s.size))if(l&&l.cssText){let c=Vt(l.cssText,e);o.appendChild(t.createTextNode(`${c}
10
+ `))}else{let c=Array.from(t.styleSheets).filter(m=>{try{return"cssRules"in m&&!!m.cssRules.length}catch(f){return e.log.warn(`Error while reading CSS rules from ${m.href}`,f),!1}}),d=t.implementation.createHTMLDocument(""),p=d.createElement("style");d.head.appendChild(p);let u=p.sheet;await Promise.all(c.flatMap(m=>Array.from(m.cssRules).map(async f=>{if(Lo(f)){let g=f.href,E="";try{E=await me(e,{url:g,requestType:"text",responseType:"text"})}catch(_){e.log.warn(`Error fetch remote css import from ${g}`,_)}let b=E.replace(sn,(_,T,x)=>_.replace(x,Kt(x,g)));for(let _ of wi(b))try{u.insertRule(_,u.cssRules.length)}catch(T){e.log.warn("Error inserting rule from remote css import",{rule:_,error:T})}}}))),u.cssRules.length&&c.push(u);let h=[];c.forEach(m=>{ot(m.cssRules,h)}),h.filter(m=>No(m)&&rn(m.style.getPropertyValue("src"))&&Zt(m.style.getPropertyValue("font-family"))?.some(f=>s.has(f))).forEach(m=>{let f=m,g=i.get(f.cssText);g?o.appendChild(t.createTextNode(`${g}
11
+ `)):a.push(on(f.cssText,f.parentStyleSheet?f.parentStyleSheet.href:null,e).then(E=>{E=Vt(E,e),i.set(f.cssText,E),o.appendChild(t.createTextNode(`${E}
12
+ `))}))})}}var Ri=/(\/\*[\s\S]*?\*\/)/g,Gt=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function wi(n){if(n==null)return[];let e=[],t=n.replace(Ri,"");for(;;){let i=Gt.exec(t);if(!i)break;e.push(i[0])}t=t.replace(Gt,"");let o=/@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 i=o.exec(t);if(i)s.lastIndex=o.lastIndex;else if(i=s.exec(t),i)o.lastIndex=s.lastIndex;else break;e.push(i[0])}return e}var vi=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ni=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Vt(n,e){let{font:t}=e,o=t?t?.preferredFormat:void 0;return o?n.replace(Ni,s=>{for(;;){let[i,,a]=vi.exec(s)||[];if(!a)return"";if(a===o)return`src: ${i};`}}):n}function ot(n,e=[]){for(let t of Array.from(n))Mo(t)?e.push(...ot(t.cssRules)):"cssRules"in t?ot(t.cssRules,e):e.push(t);return e}var Li=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function Mi(n){return Li.test(n.innerHTML)}async function Di(n,e){let t=await Jt(n,e);if(k(t.node)&&fe(t.node)&&!Mi(t.node))return t.node;let{ownerDocument:o,log:s,tasks:i,svgStyleElement:a,svgDefsElement:l,svgStyles:c,font:d,progress:p,autoDestruct:u,onCloneNode:h,onEmbedNode:m,onCreateForeignObjectSvg:f}=t;s.time("clone node");let g=await st(t.node,t,!0);if(a&&o){let x="";c.forEach((v,C)=>{x+=`${v.join(`,
12
13
  `)} {
13
- ${_}
14
+ ${C}
14
15
  }
15
- `}),a.appendChild(n.createTextNode(T))}s.timeEnd("clone node"),await m?.(f),h!==!1&&A(f)&&(s.time("embed web font"),await rn(f,t),s.timeEnd("embed web font")),s.time("embed node"),ut(f,t);let b=r.length,C=0,x=async()=>{for(;;){let T=r.pop();if(!T)break;try{await T}catch(w){t.log.warn("Failed to run task",w)}d?.(++C,b)}};d?.(C,b),await Promise.all([...Array.from({length:4})].map(x)),s.timeEnd("embed node"),await u?.(f);let E=un(f,t);return l&&E.insertBefore(l,E.children[0]),a&&E.insertBefore(a,E.children[0]),p&&Ko(t),await g?.(E),E}function un(o,e){let{width:t,height:n}=e,s=wo(t,n,o.ownerDocument),r=s.ownerDocument.createElementNS(s.namespaceURI,"foreignObject");return r.setAttributeNS(null,"x","0%"),r.setAttributeNS(null,"y","0%"),r.setAttributeNS(null,"width","100%"),r.setAttributeNS(null,"height","100%"),r.append(o),s.appendChild(r),s}async function mt(o,e){let t=await rt(o,e),n=await pn(t),s=So(n,t.isEnable("removeControlCharacter"));t.autoDestruct||(t.svgStyleElement=st(t.ownerDocument),t.svgDefsElement=t.ownerDocument?.createElementNS(ae,"defs"),t.svgStyles.clear());let r=k(s,n.ownerDocument);return await Bo(r,t)}var B="helldots-root",mn=()=>{customElements.get(B)||customElements.define(B,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function gt(){mn();let o=document.querySelector(B);return o||(o=document.createElement(B),document.body.appendChild(o)),o.shadowRoot}var le=.5,gn=.7,ft=o=>!o||o==="transparent"||o==="rgba(0, 0, 0, 0)",fn=()=>{let o=getComputedStyle(document.documentElement).backgroundColor;if(!ft(o))return o;let e=getComputedStyle(document.body).backgroundColor;return ft(e)?"#ffffff":e};async function Ne({scale:o=1}={}){return mt(document.body,{scale:o,backgroundColor:fn()})}async function Re(o){let e=document.querySelector(B),t=e?.style.display;e&&(e.style.display="none");try{return await o()}finally{e&&(e.style.display=t||"")}}function Et(o,{left:e,top:t,width:n,height:s}){let r=document.createElement("canvas");r.width=n,r.height=s;let a=r.getContext("2d");return a?(a.drawImage(o,e+window.scrollX,t+window.scrollY,n,s,0,0,n,s),r.toDataURL("image/png")):null}function Ie(o,{sourceScale:e=1,outputScale:t=le,quality:n=gn}={}){let s=document.createElement("canvas");s.width=Math.round(window.innerWidth*t),s.height=Math.round(window.innerHeight*t);let r=s.getContext("2d");return r?(r.drawImage(o,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,s.width,s.height),s.toDataURL("image/jpeg",n)):null}var En=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],bn=[{name:"iOS",re:/(?:iPhone|iPad).*OS ([\d_]+) like Mac OS X/},{name:"Android",re:/Android ([\d.]+)/},{name:"Windows",re:/Windows NT ([\d.]+)/},{name:"macOS",re:/Mac OS X ([\d_.]+)/},{name:"Linux",re:/Linux/}],Cn={name:"unknown",version:""},Tn=o=>/not[\W_]*a[\W_]*brand/i.test(o),bt=(o,e)=>{for(let{name:t,re:n}of o){let s=e.match(n);if(s)return{name:t,version:(s[1]||"").replace(/_/g,".")}}return{...Cn}};function Ct(o=window){let e=o.navigator||{},t=e.userAgent||"",n=e.userAgentData,s=bt(En,t),r=n?.brands?.find(l=>!Tn(l.brand));r&&(s={name:r.brand,version:r.version||""});let a=bt(bn,t);return n?.platform&&(a.name=n.platform),{version:1,url:o.location?.href||"",viewport:{width:o.innerWidth,height:o.innerHeight},screen:{width:o.screen?.width??0,height:o.screen?.height??0},devicePixelRatio:o.devicePixelRatio??1,userAgent:t,browser:s,os:a,language:e.language||""}}var i={CIRCLE:"comment-circle",CIRCLE_ACTIVE:"comment-circle--active",CIRCLE_WRAPPER:"comment-circle-wrapper",TOOLTIP:"comment-tooltip",TOOLBAR_TEXT:"toolbar-text",SHORTCUT_HINT:"shortcut-hint",COMMENT_INPUT_AREA:"comment-input-area",CLOSE_TOOLTIP:"close-tooltip",ACTIVE:"active",COMMENT_CURSOR:"comment-cursor",COMMENT_OVERLAY:"comment-overlay",THREAD_POPOVER:"comment-thread-popover",THREAD_HEADER:"thread-header",THREAD_BODY:"thread-body",THREAD_REPLIES:"thread-replies",THREAD_REPLY:"thread-reply",THREAD_REPLY_ACTIONS:"thread-reply-actions",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_ACTIONS_ROW:"thread-actions-row",THREAD_SCROLL:"thread-scroll",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",THREAD_TIME:"thread-time",THREAD_EDITED:"thread-edited",EDITOR:"helldots-editor",EDITOR_INPUT:"helldots-editor-input",EDITOR_ACTIONS:"helldots-editor-actions",EDITOR_SAVE:"helldots-editor-save",EDITOR_CANCEL:"helldots-editor-cancel",INBOX_NOTICE:"inbox-notice",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",CONFIRM:"helldots-confirm",CONFIRM_PANEL:"helldots-confirm-panel",CONFIRM_TITLE:"helldots-confirm-title",CONFIRM_MESSAGE:"helldots-confirm-message",CONFIRM_ACTIONS:"helldots-confirm-actions",CONFIRM_CANCEL:"helldots-confirm-cancel",CONFIRM_ACCEPT:"helldots-confirm-accept",LIGHTBOX:"helldots-lightbox",LIGHTBOX_IMG:"helldots-lightbox-img",LIGHTBOX_CLOSE:"helldots-lightbox-close",COMMENT_ACTIONS_BAR:"comment-actions-bar",ATTACH_IMAGE_BTN:"attach-image-btn",TOOLBAR_ACTIONS:"toolbar-actions",TOOLBAR_ACTION_BTN:"toolbar-action-btn",TOOLBAR_ACTION_WRAPPER:"toolbar-action-wrapper",TOOLBAR_ACTION_TOOLTIP:"toolbar-action-tooltip",TOOLBAR_COMMENT_BTN:"toolbar-comment-btn",TOOLBAR_MENU_BTN:"toolbar-menu-btn",INBOX_PANEL:"inbox-panel",INBOX_HEADER:"inbox-header",INBOX_FILTER:"inbox-filter",INBOX_FILTER_MENU:"inbox-filter-menu",INBOX_FILTER_MENU_HEADER:"inbox-filter-menu-header",INBOX_FILTER_CLEAR:"inbox-filter-clear",INBOX_FILTER_GROUP:"inbox-filter-group",INBOX_FILTER_CHIPS:"inbox-filter-chips",INBOX_FILTER_CHIP:"inbox-filter-chip",INBOX_FILTER_SECTION:"inbox-filter-section",INBOX_CLOSE:"inbox-close",INBOX_LIST:"inbox-list",INBOX_CARD:"inbox-card",INBOX_CARD_HEADER:"inbox-card-header",INBOX_CARD_ACTIONS:"inbox-card-actions",INBOX_CARD_TEXT:"inbox-card-text",INBOX_CARD_TAG:"inbox-card-tag",INBOX_CARD_REPLY_LINK:"inbox-card-reply-link",INBOX_ACTION_BTN:"inbox-action-btn",INBOX_ACTION_BTN_LABELED:"inbox-action-btn--labeled",INBOX_ACTION_LABEL:"inbox-action-label",INBOX_STATUS_DOT:"inbox-status-dot",INBOX_MENU:"inbox-menu",INBOX_MENU_ITEM:"inbox-menu-item",INBOX_DETAIL:"inbox-detail",INBOX_DETAIL_HEADER:"inbox-detail-header",INBOX_BACK:"inbox-back",INBOX_NAV_BTN:"inbox-nav-btn",INBOX_REPLIES:"inbox-replies",TOOLTIP_REPLY_COUNT:"comment-tooltip-reply-count",INBOX_EMPTY:"inbox-empty",INBOX_EMPTY_ICON:"inbox-empty-icon",INBOX_EMPTY_TITLE:"inbox-empty-title",INBOX_EMPTY_TEXT:"inbox-empty-text",INBOX_EMPTY_KBD:"inbox-empty-kbd",INBOX_EMPTY_ACTION:"inbox-empty-action",CLASSIFY_ROW:"classify-row",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",BADGE_STATUS:"helldots-badge--status",BADGE_TYPE:"helldots-badge--type",BADGE_PRIORITY:"helldots-badge--priority",BADGE_TAG:"helldots-badge--tag",BADGE_DURATION:"helldots-badge--duration",CONTEXT_BLOCK:"inbox-context",CONTEXT_TITLE:"inbox-context-title",CONTEXT_BODY:"inbox-context-body",CONTEXT_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",CONTEXT_TOGGLE:"inbox-context-toggle",HIGHLIGHT:"helldots-highlight"},Tt=[i.COMMENT_CURSOR],y={TOOLBAR:"comment-toolbar",COMMENT_BOX:"comment-box",COMMENT_INPUT:"comment-input",SUBMIT_COMMENT:"submit-comment",STYLES:"comment-overlay-styles",GLOBAL_STYLES:"comment-overlay-global-styles",ATTACH_IMAGE_INPUT:"attach-image-input"},D=["open","in_progress","resolved"],ce={open:"#2E90FA",in_progress:"#FF9F0A",resolved:"#30D158"},N=["bug","suggestion","question","improvement"],q={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},R=["high","medium","low"],K={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},xt={CONTAINER:'section, div[class*="container"], div[class*="content"]'},O={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},_t='data:image/svg+xml;utf8,<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-4,-4)"><path d="M6 8C6 6.89543 6.89543 6 8 6H20C27.732 6 34 12.268 34 20V20C34 27.732 27.732 34 20 34V34C12.268 34 6 27.732 6 20V8Z" fill="%232E90FA"/><path d="M8 7H20C27.1797 7 33 12.8203 33 20C33 27.1797 27.1797 33 20 33C12.8203 33 7 27.1797 7 20V8C7 7.44772 7.44772 7 8 7Z" stroke="white" stroke-width="2"/></g></svg>',yt="2 2";var de=`
16
- scrollbar-width: thin;
17
- scrollbar-color: rgba(255,255,255,0.22) transparent;`,xn=(...o)=>o.map(e=>`
18
- ${e}::-webkit-scrollbar {
19
- width: 8px;
20
- height: 8px;
21
- }
22
-
23
- ${e}::-webkit-scrollbar-track {
24
- background: transparent;
25
- }
26
-
27
- ${e}::-webkit-scrollbar-thumb {
28
- background: rgba(255,255,255,0.22);
29
- border-radius: 4px;
30
- }
31
-
32
- ${e}::-webkit-scrollbar-thumb:hover {
33
- background: rgba(255,255,255,0.35);
34
- }
35
- `).join(""),wt=()=>`
36
-
37
- :host {
38
- all: initial;
39
- display: block;
40
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
41
- line-height: 1.5;
42
- color-scheme: light;
43
- }
44
-
45
- :host *,
46
- :host *::before,
47
- :host *::after {
48
- box-sizing: border-box;
49
- font-family: inherit;
50
- }
51
-
52
- button {
53
- padding: 0;
54
- font: inherit;
55
- color: inherit;
56
- }
57
-
58
- #${y.TOOLBAR} {
59
- position: fixed;
60
- bottom: 20px;
61
- left: 50%;
62
- transform: translateX(-50%);
63
- z-index: ${O.TOOLBAR};
64
- }
65
-
66
- .${i.TOOLBAR_ACTION_WRAPPER} {
67
- position: relative;
68
- }
69
-
70
- .${i.TOOLBAR_ACTION_TOOLTIP} {
16
+ `}),a.appendChild(o.createTextNode(x))}s.timeEnd("clone node"),await h?.(g),d!==!1&&k(g)&&(s.time("embed web font"),await Ii(g,t),s.timeEnd("embed web font")),s.time("embed node"),an(g,t);let E=i.length,b=0,_=async()=>{for(;;){let x=i.pop();if(!x)break;try{await x}catch(v){t.log.warn("Failed to run task",v)}p?.(++b,E)}};p?.(b,E),await Promise.all([...Array.from({length:4})].map(_)),s.timeEnd("embed node"),await m?.(g);let T=Bi(g,t);return l&&T.insertBefore(l,T.children[0]),a&&T.insertBefore(a,T.children[0]),u&&Ci(t),await f?.(T),T}function Bi(n,e){let{width:t,height:o}=e,s=Wo(t,o,n.ownerDocument),i=s.ownerDocument.createElementNS(s.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(n),s.appendChild(i),s}async function ln(n,e){let t=await Jt(n,e),o=await Di(t),s=jo(o,t.isEnable("removeControlCharacter"));t.autoDestruct||(t.svgStyleElement=Qt(t.ownerDocument),t.svgDefsElement=t.ownerDocument?.createElementNS(we,"defs"),t.svgStyles.clear());let i=Q(s,o.ownerDocument);return await ni(i,t)}var $="helldots-root",Pi=()=>{customElements.get($)||customElements.define($,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function cn(){Pi();let n=document.querySelector($);return n||(n=document.createElement($),document.body.appendChild(n)),n.shadowRoot}var ve=.5,ki=.7,dn=n=>!n||n==="transparent"||n==="rgba(0, 0, 0, 0)",pn=()=>{let n=getComputedStyle(document.documentElement).backgroundColor;if(!dn(n))return n;let e=getComputedStyle(document.body).backgroundColor;return dn(e)?"#ffffff":e},un=()=>{try{let n=document.implementation.createHTMLDocument(""),e=n.createElement("style");return n.head.appendChild(e),e.sheet!==null}catch{return!1}},$i=n=>{let e=[],t=n.indexOf("@font-face");for(;t!==-1;){let o=n.indexOf("{",t),s=o===-1?-1:n.indexOf("}",o);if(s===-1)break;e.push(n.slice(t,s+1)),t=n.indexOf("@font-face",s)}return e.join(`
17
+ `)},at=new Map,Hi=n=>(at.has(n)||at.set(n,fetch(n,{mode:"cors",credentials:"omit"}).then(e=>e.ok?e.text():"").then($i).catch(()=>"")),at.get(n)),Ui=n=>{try{return!!n.cssRules}catch{return!1}},Xi=async n=>{let e=()=>{};if(!n||!un())return e;let t=Array.from(document.styleSheets).filter(i=>i.href&&!Ui(i)).map(i=>i.href);if(!t.length)return e;let o=(await Promise.all(t.map(Hi))).filter(Boolean).join(`
18
+ `);if(!o)return e;let s=document.createElement("style");return s.textContent=o,document.head.appendChild(s),()=>s.remove()};async function lt({scale:n=1,embedCrossOriginFonts:e=!1}={}){let t=await Xi(e);try{return await ln(document.documentElement,{scale:n,backgroundColor:pn(),...un()?{}:{font:!1},filter:o=>o.nodeName?.toLowerCase()!==$})}finally{t()}}var hn=(n,e,t)=>{n.fillStyle=pn(),n.fillRect(0,0,e,t)};function mn(n,{left:e,top:t,width:o,height:s}){let i=document.createElement("canvas");i.width=o,i.height=s;let a=i.getContext("2d");return a?(hn(a,o,s),a.drawImage(n,e+window.scrollX,t+window.scrollY,o,s,0,0,o,s),i.toDataURL("image/png")):null}function ct(n,{sourceScale:e=1,outputScale:t=ve,quality:o=ki}={}){let s=document.createElement("canvas");s.width=Math.round(window.innerWidth*t),s.height=Math.round(window.innerHeight*t);let i=s.getContext("2d");return i?(hn(i,s.width,s.height),i.drawImage(n,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,s.width,s.height),s.toDataURL("image/jpeg",o)):null}var r={CIRCLE:"comment-circle",CIRCLE_ACTIVE:"comment-circle--active",TOOLTIP:"comment-tooltip",TOOLBAR_TEXT:"toolbar-text",SHORTCUT_HINT:"shortcut-hint",COMMENT_INPUT_AREA:"comment-input-area",CLOSE_TOOLTIP:"close-tooltip",ACTIVE:"active",COMMENT_CURSOR:"comment-cursor",COMMENT_OVERLAY:"comment-overlay",THREAD_POPOVER:"comment-thread-popover",THREAD_HEADER:"thread-header",THREAD_BODY:"thread-body",THREAD_REPLIES:"thread-replies",THREAD_REPLY:"thread-reply",THREAD_REPLY_ACTIONS:"thread-reply-actions",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_ACTIONS_ROW:"thread-actions-row",THREAD_SCROLL:"thread-scroll",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",INBOX_HEADER_ACTIONS:"inbox-header-actions",INBOX_METRICS_BTN:"inbox-metrics-btn",METRICS_VIEW:"metrics-view",METRICS_TILES:"metrics-tiles",METRICS_TILE:"metrics-tile",METRICS_TILE_VALUE:"metrics-tile-value",METRICS_TILE_LABEL:"metrics-tile-label",METRICS_GROUP:"metrics-group",METRICS_HEADING:"metrics-heading",METRICS_ROW:"metrics-row",METRICS_ROW_LABEL:"metrics-row-label",METRICS_TRACK:"metrics-track",METRICS_BAR:"metrics-bar",METRICS_ROW_COUNT:"metrics-row-count",METRICS_CHART:"metrics-chart",METRICS_AXIS:"metrics-axis",METRICS_EXPORTS:"metrics-exports",METRICS_EXPORT_BTN:"metrics-export-btn",METRICS_EMPTY:"metrics-empty",AUDIT_BLOCK:"audit-block",AUDIT_TOGGLE:"audit-toggle",AUDIT_BODY:"audit-body",AUDIT_LIST:"audit-list",AUDIT_ROW:"audit-row",AUDIT_ACTION:"audit-action",AUDIT_ACTOR:"audit-actor",AUDIT_TIME:"audit-time",AUDIT_HEADING:"audit-heading",AUDIT_RESOLUTIONS:"audit-resolutions",THREAD_TIME:"thread-time",THREAD_EDITED:"thread-edited",EDITOR:"helldots-editor",EDITOR_INPUT:"helldots-editor-input",EDITOR_ACTIONS:"helldots-editor-actions",EDITOR_SAVE:"helldots-editor-save",EDITOR_CANCEL:"helldots-editor-cancel",INBOX_NOTICE:"inbox-notice",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",CONFIRM:"helldots-confirm",CONFIRM_PANEL:"helldots-confirm-panel",CONFIRM_TITLE:"helldots-confirm-title",CONFIRM_MESSAGE:"helldots-confirm-message",CONFIRM_ACTIONS:"helldots-confirm-actions",CONFIRM_CANCEL:"helldots-confirm-cancel",CONFIRM_ACCEPT:"helldots-confirm-accept",LIGHTBOX:"helldots-lightbox",LIGHTBOX_IMG:"helldots-lightbox-img",LIGHTBOX_CLOSE:"helldots-lightbox-close",COMMENT_ACTIONS_BAR:"comment-actions-bar",ATTACH_IMAGE_BTN:"attach-image-btn",TOOLBAR_ACTIONS:"toolbar-actions",TOOLBAR_ACTION_BTN:"toolbar-action-btn",TOOLBAR_ACTION_WRAPPER:"toolbar-action-wrapper",TOOLBAR_ACTION_TOOLTIP:"toolbar-action-tooltip",TOOLBAR_COMMENT_BTN:"toolbar-comment-btn",TOOLBAR_MENU_BTN:"toolbar-menu-btn",INBOX_PANEL:"inbox-panel",INBOX_HEADER:"inbox-header",INBOX_FILTER:"inbox-filter",INBOX_FILTER_MENU:"inbox-filter-menu",INBOX_FILTER_MENU_HEADER:"inbox-filter-menu-header",INBOX_FILTER_CLEAR:"inbox-filter-clear",INBOX_FILTER_GROUP:"inbox-filter-group",INBOX_FILTER_CHIPS:"inbox-filter-chips",INBOX_FILTER_CHIP:"inbox-filter-chip",INBOX_FILTER_SECTION:"inbox-filter-section",INBOX_CLOSE:"inbox-close",INBOX_LIST:"inbox-list",INBOX_CARD:"inbox-card",INBOX_CARD_HEADER:"inbox-card-header",INBOX_CARD_ACTIONS:"inbox-card-actions",INBOX_CARD_TEXT:"inbox-card-text",INBOX_CARD_TAG:"inbox-card-tag",INBOX_CARD_REPLY_LINK:"inbox-card-reply-link",INBOX_ACTION_BTN:"inbox-action-btn",INBOX_ACTION_BTN_LABELED:"inbox-action-btn--labeled",INBOX_ACTION_LABEL:"inbox-action-label",INBOX_STATUS_DOT:"inbox-status-dot",INBOX_MENU:"inbox-menu",INBOX_MENU_UP:"inbox-menu--up",INBOX_MENU_START:"inbox-menu--start",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",REACTION_BAR:"reaction-bar",REACTION_PILL:"reaction-pill",REACTION_PILL_MINE:"reaction-pill--mine",REACTION_PILL_EMOJI:"reaction-pill-emoji",REACTION_PILL_COUNT:"reaction-pill-count",REACTION_ADD:"reaction-add",REACTION_TRIGGER:"reaction-trigger",REACTION_PALETTE:"reaction-palette",REACTION_PALETTE_ITEM:"reaction-palette-item",ACTIONS_GROUP:"actions-group",ACTIONS_GROUP_END:"actions-group--end"},fn=[r.COMMENT_CURSOR],O={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"},P=28,Ne=5,N=["open","in_progress","in_review","resolved"],V={open:"#D1D1D6",in_progress:"#FF9F0A",in_review:"#2E90FA",resolved:"#30D158"},R=["bug","suggestion","question","improvement"],Y={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},w=["high","medium","low"],W={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},ge=["\u{1F44D}","\u{1F44E}","\u2764\uFE0F","\u{1F389}","\u{1F440}","\u{1F680}"],gn={CONTAINER:'section, div[class*="container"], div[class*="content"]'},D={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},En='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>',bn="2 2";var Le=class{constructor({host:e,autoScreenshot:t,embedCrossOriginFonts:o=!1,onRegionCaptured:s,onPlace:i}){this.host=e,this.autoScreenshot=t,this.embedCrossOriginFonts=o,this.onRegionCaptured=s,this.onPlace=i,this.pendingCapture=null,this._dragStart=null,this._isDragging=!1,this._selectionRect=null,this._boundDragMove=a=>this.onDragMove(a),this._boundDragEnd=a=>this.onDragEnd(a)}beginDrag(e){this._dragStart={x:e.clientX,y:e.clientY},this._isDragging=!1,document.addEventListener("mousemove",this._boundDragMove),document.addEventListener("mouseup",this._boundDragEnd)}onDragMove(e){let t=e.clientX-this._dragStart.x,o=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,o)<5)return;this._isDragging=!0;let s=Math.min(this._dragStart.x,e.clientX),i=Math.min(this._dragStart.y,e.clientY),a=Math.abs(t),l=Math.abs(o);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=r.SELECTION_RECT,this.host.appendChild(this._selectionRect)),this._selectionRect.style.left=`${s}px`,this._selectionRect.style.top=`${i}px`,this._selectionRect.style.width=`${a}px`,this._selectionRect.style.height=`${l}px`}async onDragEnd(e){if(document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._isDragging){let t=Math.min(this._dragStart.x,e.clientX),o=Math.min(this._dragStart.y,e.clientY),s=Math.abs(e.clientX-this._dragStart.x),i=Math.abs(e.clientY-this._dragStart.y);if(this._selectionRect?.remove(),this._selectionRect=null,s>10&&i>10)try{let a=await lt({scale:1,embedCrossOriginFonts:this.embedCrossOriginFonts}),l=mn(a,{left:t,top:o,width:s,height:i});l&&this.onRegionCaptured(l),this.autoScreenshot&&(this.pendingCapture=Promise.resolve(ct(a,{sourceScale:1})))}catch(a){console.warn("HellDots: screenshot capture failed:",a)}await this.onPlace(e.clientX,e.clientY)}else await this.onPlace(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}armClickCapture(){!this.autoScreenshot||this.pendingCapture||(this.pendingCapture=lt({scale:ve,embedCrossOriginFonts:this.embedCrossOriginFonts}).then(e=>ct(e,{sourceScale:ve})).catch(e=>(console.warn("HellDots: automatic screenshot failed",e),null)))}async consumePending(){return this.pendingCapture?await this.pendingCapture:null}clearPending(){this.pendingCapture=null}destroy(){document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._selectionRect?.remove(),this._selectionRect=null,this.pendingCapture=null,this._dragStart=null,this._isDragging=!1}};var Fi=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],zi=[{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/}],Gi={name:"unknown",version:""},Vi=n=>/not[\W_]*a[\W_]*brand/i.test(n),Cn=(n,e)=>{for(let{name:t,re:o}of n){let s=e.match(o);if(s)return{name:t,version:(s[1]||"").replace(/_/g,".")}}return{...Gi}};function Tn(n=window){let e=n.navigator||{},t=e.userAgent||"",o=e.userAgentData,s=Cn(Fi,t),i=o?.brands?.find(l=>!Vi(l.brand));i&&(s={name:i.brand,version:i.version||""});let a=Cn(zi,t);return o?.platform&&(a.name=o.platform),{version:1,url:n.location?.href||"",viewport:{width:n.innerWidth,height:n.innerHeight},screen:{width:n.screen?.width??0,height:n.screen?.height??0},devicePixelRatio:n.devicePixelRatio??1,userAgent:t,browser:s,os:a,language:e.language||""}}var Me=" scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;",Yi=(...n)=>n.map(e=>` ${e}::-webkit-scrollbar{width:8px;height:8px;}${e}::-webkit-scrollbar-track{background:transparent;}${e}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}${e}::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.35);}`).join(""),_n=()=>` :host{all:initial;display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;line-height:1.5;color-scheme:light;}:host *,:host *::before,:host *::after{box-sizing:border-box;font-family:inherit;}button{padding:0;font:inherit;color:inherit;}#${O.TOOLBAR}{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:${D.TOOLBAR};}.${r.TOOLBAR_ACTION_WRAPPER}{position:relative;}.${r.TOOLBAR_ACTION_TOOLTIP}{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%) translateY(4px);display:flex;align-items:center;gap:8px;background:rgba(20,20,23,0.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);padding:8px 12px;border-radius:10px;border:1px solid rgba(255,255,255,0.08);box-shadow:0 4px 24px rgba(0,0,0,0.35);color:white;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease,transform 0.15s ease;}.${r.TOOLBAR_ACTION_WRAPPER}:hover .${r.TOOLBAR_ACTION_TOOLTIP}{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}.${r.TOOLBAR_TEXT}{font-size:13px;font-weight:500;letter-spacing:-0.01em;}.${r.SHORTCUT_HINT}{font-size:11px;font-weight:500;color:rgba(255,255,255,0.5);background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.1);padding:2px 6px;border-radius:5px;line-height:1;white-space:nowrap;}.${r.TOOLBAR_ACTIONS}{display:flex;flex-direction:row;background:rgba(20,20,23,0.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:12px;box-shadow:0 4px 24px rgba(0,0,0,0.35);}.${r.TOOLBAR_ACTION_BTN}{width:42px;height:42px;display:flex;align-items:center;justify-content:center;background:none;border:none;outline:none;color:rgba(255,255,255,0.65);cursor:pointer;transition:background 0.2s,color 0.2s;padding:0;}.${r.TOOLBAR_ACTION_WRAPPER}:first-child .${r.TOOLBAR_ACTION_BTN}{border-radius:12px 0 0 12px;}.${r.TOOLBAR_ACTION_WRAPPER}:last-child .${r.TOOLBAR_ACTION_BTN}{border-radius:0 12px 12px 0;}.${r.TOOLBAR_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${r.TOOLBAR_COMMENT_BTN}.${r.ACTIVE}{color:#2E90FA;background:rgba(46,144,250,0.1);}#${O.COMMENT_BOX}{position:fixed;background:#1C1C1E;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.4);padding:16px;z-index:${D.COMMENT_BOX};width:min(400px,calc(100vw - 24px));display:none;box-sizing:border-box;}#${O.COMMENT_BOX} .${r.COMMENT_INPUT_AREA}{display:flex;flex-direction:column;gap:0;}.${r.CLASSIFY_ROW}{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:0 0 10px;border-bottom:1px solid rgba(255,255,255,0.08);}.${r.CLASSIFY_ROW} .${r.INBOX_ACTION_BTN}{height:26px;border:1px solid rgba(255,255,255,0.12);border-radius:8px;}.${r.CLASSIFY_ROW} .${r.INBOX_ACTION_BTN}:hover{border-color:rgba(255,255,255,0.28);}#${O.COMMENT_INPUT}{flex:1;min-height:20px;background:#1C1C1E;border:none;resize:none;font-family:inherit;color:white;font-size:14px;line-height:1.4;box-sizing:border-box;field-sizing:content;padding:8px 0;}#${O.COMMENT_INPUT}::placeholder{color:rgba(255,255,255,0.5);}#${O.COMMENT_INPUT}:focus{outline:none;box-shadow:none;}.${r.COMMENT_ACTIONS_BAR}{display:flex;align-items:center;justify-content:space-between;padding-top:12px;}.${r.ATTACH_IMAGE_BTN}{background:none;border:none;color:rgba(255,255,255,0.5);cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background 0.2s,color 0.2s;}.${r.ATTACH_IMAGE_BTN}:hover{background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.8);}.${r.CIRCLE}{position:absolute;width:${P}px;height:${P}px;background:#2E90FA;border-radius:0% 100% 100% 100%;border:2px solid #FFF;cursor:pointer;box-shadow:0 1px 5px rgba(0,0,0,0.2);transition:transform 0.2s,background 0.2s;z-index:${D.CIRCLE};transform:translate(-50%,-50%);}.${r.CIRCLE}:hover{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);}.${r.CIRCLE}.${r.HIGHLIGHT}{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);box-shadow:0 0 0 4px rgba(46,144,250,0.35),0 1px 5px rgba(0,0,0,0.2);}.${r.CIRCLE}.${r.CIRCLE_ACTIVE}{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);box-shadow:0 0 0 5px rgba(46,144,250,0.5),0 1px 5px rgba(0,0,0,0.2);}.${r.TOOLTIP}{position:fixed;background:#1C1C1E;border-radius:12px;padding:16px;box-shadow:0 4px 20px rgba(0,0,0,0.4);width:min(400px,calc(100vw - 24px));max-height:calc(100vh - 20px);overflow-y:auto;overscroll-behavior:contain;${Me} z-index:${D.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${r.TOOLTIP} .${r.THREAD_BODY}{padding:8px 0;}.${r.THREAD_POPOVER}{position:fixed;background:#1C1C1E;border-radius:12px;padding:16px;box-shadow:0 4px 20px rgba(0,0,0,0.4);width:min(400px,calc(100vw - 24px));max-height:calc(100vh - 20px);display:flex;flex-direction:column;z-index:${D.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${r.THREAD_POPOVER}>.${r.THREAD_HEADER},.${r.THREAD_POPOVER}>.${r.THREAD_ACTIONS_ROW},.${r.THREAD_POPOVER}>.${r.THREAD_INPUT_AREA}{flex:none;}.${r.THREAD_SCROLL}{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;${Me}}${Yi(`.${r.THREAD_SCROLL}`,`.${r.TOOLTIP}`,`.${r.INBOX_LIST}`,`.${r.INBOX_DETAIL}`,`.${r.EDITOR_INPUT}`)} .${r.INBOX_PANEL}{position:fixed;top:16px;right:16px;bottom:16px;width:380px;display:flex;flex-direction:column;background:#1C1C1E;border:1px solid rgba(255,255,255,0.08);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,0.5);z-index:${D.COMMENT_BOX};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;overflow:hidden;}@media (max-width:480px){.${r.INBOX_PANEL}{left:16px;width:auto;}}.${r.INBOX_HEADER},.${r.INBOX_DETAIL_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;border-bottom:1px solid rgba(255,255,255,0.08);flex:none;}.${r.INBOX_FILTER}-wrapper{position:relative;}.${r.INBOX_FILTER}{display:flex;align-items:center;gap:6px;background:transparent;border:none;color:white;font-size:13px;font-weight:600;cursor:pointer;padding:4px 6px;border-radius:6px;}.${r.INBOX_FILTER}:hover{background:rgba(255,255,255,0.08);}.${r.INBOX_FILTER_MENU}{position:absolute;top:calc(100% + 6px);left:0;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:12px;padding:14px;width:300px;max-width:calc(100vw - 40px);z-index:1;box-shadow:0 8px 28px rgba(0,0,0,0.5);}.${r.INBOX_FILTER_MENU_HEADER}{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:12px;}.${r.INBOX_FILTER_CLEAR}{background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:12px;font-weight:500;cursor:pointer;padding:0;}.${r.INBOX_FILTER_CLEAR}:hover:not(:disabled){color:white;}.${r.INBOX_FILTER_CLEAR}:disabled{opacity:0.35;cursor:default;}.${r.INBOX_FILTER_GROUP} + .${r.INBOX_FILTER_GROUP}{margin-top:14px;}.${r.INBOX_FILTER_SECTION}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);margin-bottom:8px;}.${r.INBOX_FILTER_CHIPS}{display:flex;flex-wrap:wrap;gap:6px;}.${r.INBOX_FILTER_CHIP}{background:transparent;border:1px solid rgba(255,255,255,0.18);border-radius:999px;color:rgba(255,255,255,0.75);font-size:12px;line-height:1;padding:7px 12px;cursor:pointer;transition:background 0.15s,border-color 0.15s,color 0.15s;}.${r.INBOX_FILTER_CHIP}:hover{border-color:rgba(255,255,255,0.4);color:white;}.${r.INBOX_FILTER_CHIP}[aria-checked="true"]{background:rgba(255,255,255,0.92);border-color:rgba(255,255,255,0.92);color:#1C1C1E;font-weight:600;}.${r.INBOX_MENU_ITEM}{display:block;width:100%;text-align:left;background:transparent;border:none;color:white;font-size:13px;padding:7px 10px;border-radius:6px;cursor:pointer;}.${r.INBOX_MENU_ITEM}:hover{background:rgba(255,255,255,0.08);}.${r.INBOX_CLOSE},.${r.INBOX_NAV_BTN},.${r.INBOX_BACK}{display:flex;align-items:center;gap:4px;background:transparent;border:none;color:rgba(255,255,255,0.75);cursor:pointer;padding:4px 6px;border-radius:6px;font-size:14px;}.${r.INBOX_CLOSE}{font-size:20px;line-height:1;}.${r.INBOX_CLOSE}:hover,.${r.INBOX_NAV_BTN}:not(:disabled):hover,.${r.INBOX_BACK}:hover{background:rgba(255,255,255,0.08);color:white;}.${r.INBOX_NAV_BTN}:disabled{opacity:0.35;cursor:default;}.${r.INBOX_LIST},.${r.INBOX_DETAIL}{flex:1;overflow-y:auto;${Me} padding:12px;display:flex;flex-direction:column;gap:12px;}.${r.INBOX_CARD}{border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}.${r.INBOX_LIST} .${r.INBOX_CARD}{cursor:pointer;}.${r.INBOX_LIST} .${r.INBOX_CARD}:hover{border-color:rgba(255,255,255,0.22);}.${r.INBOX_CARD}--resolved{border-color:rgba(48,209,88,0.4);opacity:0.75;}.${r.INBOX_LIST} .${r.INBOX_CARD}--resolved:hover{border-color:rgba(48,209,88,0.7);opacity:1;}.${r.INBOX_CARD}--resolved:has([aria-expanded="true"]){opacity:1;}.${r.INBOX_CARD_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;}.${r.INBOX_CARD_ACTIONS}{display:flex;align-items:center;justify-content:space-between;width:100%;gap:8px;}.${r.INBOX_DETAIL_HEADER} .${r.INBOX_CARD_ACTIONS}{justify-content:flex-end;gap:2px;}.${r.ACTIONS_GROUP}{display:flex;align-items:center;flex-wrap:wrap;gap:5px;}.${r.ACTIONS_GROUP_END}{flex-wrap:nowrap;gap:2px;}.${r.INBOX_ACTION_BTN}{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:transparent;border:none;border-radius:6px;color:rgba(255,255,255,0.65);cursor:pointer;}.${r.INBOX_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${r.INBOX_ACTION_BTN_LABELED}{width:auto;padding:0 8px 0 6px;gap:5px;justify-content:flex-start;flex:none;}.${r.INBOX_ACTION_LABEL}{font-size:11px;line-height:1;white-space:nowrap;}.${r.INBOX_STATUS_DOT}{width:12px;height:12px;border-radius:50%;border:1.5px solid rgba(255,255,255,0.45);display:inline-block;flex:none;}.${r.INBOX_MENU_ITEM} .${r.INBOX_STATUS_DOT}{width:9px;height:9px;border:none;margin-right:8px;vertical-align:baseline;}.${r.INBOX_MENU_ITEM}[aria-checked="true"]{background:rgba(255,255,255,0.08);}.${r.THREAD_ACTIONS_ROW}{display:flex;justify-content:flex-end;}.${r.THREAD_POPOVER}>.${r.THREAD_ACTIONS_ROW}{padding-top:8px;}[data-hd-tooltip]{position:relative;}[data-hd-tooltip]::after{content:attr(data-hd-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.12s ease;z-index:2;}[data-hd-tooltip]:hover::after{opacity:1;}.${r.INBOX_MENU}{position:absolute;top:calc(100% + 4px);right:0;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:8px;padding:4px;min-width:130px;z-index:1;box-shadow:0 4px 16px rgba(0,0,0,0.4);}.${r.INBOX_MENU}.${r.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${r.INBOX_MENU}.${r.INBOX_MENU_START}{right:auto;left:0;}.${r.INBOX_CARD_TEXT}{white-space:pre-wrap;word-break:break-word;}.${r.INBOX_CARD_TAG}{align-self:flex-start;padding:1px 8px;border-radius:999px;background:rgba(255,159,10,0.2);color:#FF9F0A;font-size:11px;font-weight:600;}.${r.INBOX_BADGES}{display:flex;flex-wrap:wrap;gap:4px;}.${r.INBOX_CARD} .${r.INBOX_BADGES}{margin-top:6px;}.${r.TOOLTIP} .${r.INBOX_BADGES}{margin-bottom:4px;}.${r.BADGE}{display:inline-flex;align-items:center;padding:1px 6px;border:1px solid rgba(255,255,255,0.18);border-radius:10px;font-size:10px;line-height:1.6;letter-spacing:0.01em;white-space:nowrap;}.${r.BADGE_STATUS},.${r.BADGE_TYPE},.${r.BADGE_PRIORITY}{font-weight:600;}.${r.BADGE_TAG}{opacity:0.75;}.${r.BADGE_DURATION}{opacity:0.75;border-style:dashed;}.${r.REACTION_BAR}{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:2px;margin-bottom:12px;}.${r.REACTION_BAR}[hidden]{display:none;}.${r.REACTION_TRIGGER}{position:relative;display:inline-flex;}.${r.REACTION_PILL}{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 8px;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#F2F2F7;font-family:inherit;font-size:12px;line-height:1;cursor:pointer;transition:background 0.12s ease,border-color 0.12s ease;}.${r.REACTION_PILL}:hover{background:rgba(255,255,255,0.08);}.${r.REACTION_PILL_MINE}{border-color:#2E90FA;background:rgba(46,144,250,0.16);}.${r.REACTION_PILL_MINE}:hover{background:rgba(46,144,250,0.24);}.${r.REACTION_PILL_EMOJI}{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:13px;}.${r.REACTION_PILL_COUNT}{font-variant-numeric:tabular-nums;}.${r.REACTION_ADD}{display:inline-flex;align-items:center;justify-content:center;width:28px;height:24px;padding:0;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#8E8E93;cursor:pointer;}.${r.REACTION_ADD}:hover{color:#F2F2F7;border-color:rgba(255,255,255,0.35);}.${r.REACTION_PALETTE}{position:absolute;top:calc(100% + 4px);left:0;white-space:nowrap;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:4px;z-index:1;box-shadow:0 4px 16px rgba(0,0,0,0.4);}.${r.ACTIONS_GROUP_END} .${r.REACTION_PALETTE},.${r.THREAD_REPLY_ACTIONS} .${r.REACTION_PALETTE}{left:auto;right:0;}.${r.REACTION_PALETTE}.${r.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${r.REACTION_PALETTE_ITEM}{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:6px;background:transparent;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:15px;cursor:pointer;}.${r.REACTION_PALETTE_ITEM}:hover{background:rgba(255,255,255,0.12);}.${r.CONTEXT_BLOCK}{display:flex;flex-direction:column;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.08);font-size:11px;}.${r.CONTEXT_BODY}{display:flex;flex-direction:column;gap:4px;}.${r.CONTEXT_TITLE}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);padding-bottom:4px;}.${r.CONTEXT_TOGGLE}{display:flex;align-items:center;justify-content:space-between;width:100%;background:transparent;border:none;color:rgba(255,255,255,0.45);font-size:11px;font-weight:600;cursor:pointer;padding:2px 0;}.${r.CONTEXT_TOGGLE}:hover{color:rgba(255,255,255,0.75);}.${r.CONTEXT_TOGGLE} svg{flex:none;transition:transform 0.15s ease;}.${r.CONTEXT_TOGGLE}[aria-expanded="true"] svg{transform:rotate(180deg);}.${r.CONTEXT_TOGGLE}[aria-expanded="true"] + .${r.CONTEXT_BODY}{padding-top:8px;}.${r.CONTEXT_BLOCK} img{width:100%;border-radius:6px;margin-bottom:6px;cursor:zoom-in;}.${r.CONTEXT_SCREENSHOT_CAPTION}{opacity:0.75;}.${r.CONTEXT_ROW}{display:flex;justify-content:space-between;gap:12px;opacity:0.75;}.${r.CONTEXT_ROW} span:last-child{text-align:right;word-break:break-all;}.${r.INBOX_CARD_REPLY_LINK}{align-self:flex-start;background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:13px;cursor:pointer;padding:0;}.${r.INBOX_CARD_REPLY_LINK}:hover{color:white;}.${r.INBOX_REPLIES}{display:flex;flex-direction:column;gap:10px;padding:0 4px;}.${r.INBOX_REPLIES}:empty{display:none;}.${r.TOOLTIP_REPLY_COUNT}{font-size:12px;color:rgba(255,255,255,0.45);padding-top:4px;}.${r.INBOX_EMPTY}{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;color:rgba(255,255,255,0.55);text-align:center;}.${r.INBOX_EMPTY_ICON}{width:44px;height:44px;margin-bottom:6px;border:2px dashed rgba(255,255,255,0.25);border-radius:0% 100% 100% 100%;flex:none;}.${r.INBOX_EMPTY_TITLE}{color:white;font-size:14px;font-weight:600;}.${r.INBOX_EMPTY_TEXT}{font-size:13px;line-height:1.5;max-width:30ch;}.${r.INBOX_EMPTY_KBD}{font-family:inherit;font-size:12px;font-weight:500;color:rgba(255,255,255,0.8);background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.14);border-radius:5px;padding:1px 5px;white-space:nowrap;}.${r.INBOX_EMPTY_ACTION}{margin-top:6px;background:transparent;border:1px solid rgba(255,255,255,0.2);border-radius:8px;color:white;font-size:13px;font-weight:500;padding:8px 16px;cursor:pointer;transition:background 0.15s,border-color 0.15s;}.${r.INBOX_EMPTY_ACTION}:hover{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.35);}.${r.THREAD_HEADER}{display:flex;justify-content:space-between;align-items:center;padding:0;}.${r.THREAD_META}{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}.${r.THREAD_AUTHOR}{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${r.THREAD_TIME}{font-size:12px;color:rgba(255,255,255,0.5);cursor:default;position:relative;flex:none;}.${r.THREAD_TIME}::after{content:attr(data-full-date);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease;z-index:1;}.${r.THREAD_TIME}:hover::after{opacity:1;}.${r.THREAD_BODY}{padding:8px 0;white-space:pre-wrap;word-break:break-word;}.${r.THREAD_REPLIES}{padding:0;}.${r.THREAD_REPLIES}:empty{display:none;}.${r.THREAD_REPLY}{padding:16px 0 0 0;border-top:1px solid rgba(255,255,255,0.1);white-space:pre-wrap;word-break:break-word;font-size:14px;color:rgba(255,255,255,0.85);}.${r.THREAD_REPLY} .${r.THREAD_META}{margin-bottom:2px;}.${r.THREAD_REPLY_ACTIONS}{margin-left:auto;flex:none;}.${r.THREAD_REPLY} .${r.SCREENSHOT_IMG}{width:144px;height:100px;object-fit:cover;border-radius:8px;margin-top:4px;cursor:pointer;display:block;}.${r.THREAD_INPUT_AREA}{display:flex;flex-direction:column;gap:0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,0.1);}.${r.THREAD_INPUT}{width:100%;background:transparent;border:none;padding:0;color:white;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;}.${r.THREAD_INPUT}::placeholder{color:rgba(255,255,255,0.5);}.${r.THREAD_INPUT}:focus{outline:none;box-shadow:none;}.${r.THREAD_SUBMIT}{background:none;border:none;color:#2E90FA;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background 0.2s;}.${r.THREAD_SUBMIT}:hover{background:rgba(46,144,250,0.15);color:#1570D6;}.${r.CLOSE_TOOLTIP}{background:none;border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.5);line-height:1;}.${r.CLOSE_TOOLTIP}:hover{color:white;}.${r.PREVIEW_CIRCLE}{animation:helldots-pulse 1.5s ease-in-out infinite;}@keyframes helldots-pulse{0%,100%{box-shadow:0 0 0 0 rgba(46,144,250,0.4),0 1px 5px rgba(0,0,0,0.2);}50%{box-shadow:0 0 0 8px rgba(46,144,250,0),0 1px 5px rgba(0,0,0,0.2);}}.${r.COMMENT_OVERLAY}{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;pointer-events:none;z-index:${D.TOOLBAR-1};}.${r.COMMENT_OVERLAY}.${r.ACTIVE}{pointer-events:auto;background:rgba(0,0,0,0.1);}.${r.SELECTION_RECT}{position:fixed;border:2px solid #2E90FA;background:rgba(46,144,250,0.1);pointer-events:none;z-index:${D.TOOLTIP};box-sizing:border-box;}.${r.SCREENSHOTS_CONTAINER}{display:none;overflow-x:auto;gap:8px;margin-top:4px;padding:4px 0;scrollbar-width:none;-ms-overflow-style:none;margin-bottom:8px;}.${r.SCREENSHOTS_CONTAINER}::-webkit-scrollbar{display:none;}.${r.SCREENSHOTS_CONTAINER}.${r.ACTIVE}{display:flex;}.${r.SCREENSHOT_ITEM}{position:relative;flex-shrink:0;}.${r.SCREENSHOT_ITEM} .${r.SCREENSHOT_IMG}{width:50px;height:50px;object-fit:cover;border-radius:8px;cursor:pointer;display:block;margin:0;}.${r.SCREENSHOT_ITEM} .${r.SCREENSHOT_IMG}:hover{opacity:0.85;}.${r.SCREENSHOT_ITEM} .${r.SCREENSHOT_REMOVE}{position:absolute;top:-5px;right:-5px;width:18px;height:18px;background:rgba(0,0,0,0.7);border:none;border-radius:50%;color:white;font-size:12px;line-height:1;cursor:pointer;display:none;align-items:center;justify-content:center;z-index:1;}.${r.SCREENSHOT_ITEM}:hover .${r.SCREENSHOT_REMOVE}{display:flex;}.${r.SCREENSHOT_ITEM} .${r.SCREENSHOT_REMOVE}:hover{background:rgba(0,0,0,0.9);}.${r.TOOLTIP}>.${r.SCREENSHOTS_CONTAINER} .${r.SCREENSHOT_ITEM} .${r.SCREENSHOT_IMG},.${r.THREAD_SCROLL}>.${r.SCREENSHOTS_CONTAINER} .${r.SCREENSHOT_ITEM} .${r.SCREENSHOT_IMG},.${r.THREAD_REPLY} .${r.SCREENSHOT_ITEM} .${r.SCREENSHOT_IMG}{width:144px;height:100px;}.${r.CONFIRM}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.6);display:flex;align-items:center;justify-content:center;padding:16px;animation:helldots-fade-in 0.15s ease;}.${r.CONFIRM_PANEL}{width:min(360px,100%);background:#1C1C1E;border:1px solid rgba(255,255,255,0.1);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,0.5);padding:20px;color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${r.CONFIRM_TITLE}{margin:0 0 8px;font-size:15px;font-weight:600;}.${r.CONFIRM_MESSAGE}{margin:0 0 20px;font-size:13px;color:rgba(255,255,255,0.65);}.${r.CONFIRM_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${r.CONFIRM_CANCEL},.${r.CONFIRM_ACCEPT}{padding:7px 14px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}.${r.CONFIRM_CANCEL}:focus-visible,.${r.CONFIRM_ACCEPT}:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}.${r.CONFIRM_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${r.CONFIRM_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${r.CONFIRM_ACCEPT}{background:#FF453A;color:white;}.${r.CONFIRM_ACCEPT}:hover{background:#FF6961;}.${r.LIGHTBOX}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.92);z-index:${D.LIGHTBOX};display:flex;align-items:center;justify-content:center;animation:helldots-fade-in 0.2s ease;}@keyframes helldots-fade-in{from{opacity:0;}to{opacity:1;}}.${r.LIGHTBOX_IMG}{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:8px;}.${r.LIGHTBOX_CLOSE}{position:absolute;top:16px;right:16px;background:rgba(255,255,255,0.15);border:none;color:white;font-size:24px;width:40px;height:40px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background 0.2s;}.${r.LIGHTBOX_CLOSE}:hover{background:rgba(255,255,255,0.3);}.${r.EDITOR}{display:flex;flex-direction:column;gap:8px;margin:4px 0 2px;}.${r.EDITOR_INPUT}{width:100%;box-sizing:border-box;resize:vertical;min-height:60px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.14);border-radius:8px;padding:8px 10px;color:white;font-size:14px;font-family:inherit;line-height:1.45;outline:none;${Me}}.${r.EDITOR_INPUT}:focus{border-color:rgba(46,144,250,0.7);}.${r.EDITOR_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${r.EDITOR_CANCEL},.${r.EDITOR_SAVE}{padding:5px 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;}.${r.EDITOR_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${r.EDITOR_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${r.EDITOR_SAVE}{background:#2E90FA;color:white;}.${r.EDITOR_SAVE}:hover:not(:disabled){background:#57A6FB;}.${r.EDITOR_SAVE}:disabled{background:rgba(255,255,255,0.10);color:rgba(255,255,255,0.4);cursor:not-allowed;}.${r.THREAD_EDITED}{font-size:12px;color:rgba(255,255,255,0.4);cursor:default;position:relative;flex:none;}.${r.THREAD_EDITED}::before{content:"\xB7";margin-right:4px;}.${r.THREAD_EDITED}::after{content:attr(data-full-date);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease;}.${r.THREAD_EDITED}:hover::after{opacity:1;}.${r.AUDIT_BLOCK}{margin-top:10px;border-top:1px solid rgba(255,255,255,0.08);padding-top:8px;}.${r.AUDIT_TOGGLE}{display:flex;align-items:center;gap:6px;width:100%;padding:4px 0;border:0;background:none;color:rgba(255,255,255,0.55);font-family:inherit;font-size:12px;text-align:left;cursor:pointer;}.${r.AUDIT_TOGGLE}:hover{color:rgba(255,255,255,0.85);}.${r.AUDIT_TOGGLE}::before{content:"";width:0;height:0;border-left:4px solid currentColor;border-top:4px solid transparent;border-bottom:4px solid transparent;transition:transform 0.15s ease;}.${r.AUDIT_TOGGLE}[aria-expanded="true"]::before{transform:rotate(90deg);}.${r.AUDIT_BODY}{padding:4px 0 2px;}.${r.AUDIT_LIST}{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:7px;}.${r.AUDIT_ROW}{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:8px;font-size:12px;line-height:1.4;}.${r.AUDIT_ACTION}{grid-column:1;color:rgba(255,255,255,0.78);}.${r.AUDIT_ACTOR}{grid-column:1;color:rgba(255,255,255,0.48);font-size:11px;}.${r.AUDIT_TIME}{grid-row:1;grid-column:2;color:rgba(255,255,255,0.42);font-size:11px;white-space:nowrap;}.${r.AUDIT_HEADING}{margin:0 0 6px;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${r.AUDIT_RESOLUTIONS}{margin-top:10px;padding-top:8px;border-top:1px solid rgba(255,255,255,0.06);}.${r.INBOX_HEADER_ACTIONS}{display:flex;align-items:center;gap:12px;}.${r.INBOX_METRICS_BTN}{padding:5px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.75);font-family:inherit;font-size:12px;white-space:nowrap;cursor:pointer;}.${r.INBOX_METRICS_BTN}:hover{background:rgba(255,255,255,0.11);color:#fff;}.${r.METRICS_VIEW}{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:16px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;}.${r.METRICS_VIEW}::-webkit-scrollbar{width:8px;}.${r.METRICS_VIEW}::-webkit-scrollbar-track{background:transparent;}.${r.METRICS_VIEW}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}.${r.METRICS_TILES}{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:8px;}.${r.METRICS_TILE}{display:flex;flex-direction:column;gap:2px;padding:10px;border-radius:9px;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.08);}.${r.METRICS_TILE_VALUE}{color:#fff;font-size:18px;font-weight:600;line-height:1.1;}.${r.METRICS_TILE_LABEL}{color:rgba(255,255,255,0.5);font-size:11px;line-height:1.3;}.${r.METRICS_GROUP}{display:flex;flex-direction:column;gap:7px;}.${r.METRICS_HEADING}{margin:0;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${r.METRICS_ROW}{display:grid;grid-template-columns:76px 1fr 26px;align-items:center;gap:8px;font-size:12px;}.${r.METRICS_ROW_LABEL}{color:rgba(255,255,255,0.72);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${r.METRICS_TRACK}{height:8px;border-radius:4px;background:rgba(255,255,255,0.07);overflow:hidden;}.${r.METRICS_BAR}{height:100%;border-radius:4px;background:rgba(255,255,255,0.42);min-width:2px;}.${r.METRICS_ROW_COUNT}{color:rgba(255,255,255,0.85);font-variant-numeric:tabular-nums;text-align:right;}.${r.METRICS_CHART}{width:100%;height:96px;display:block;fill:rgba(255,255,255,0.42);}.${r.METRICS_AXIS}{display:flex;justify-content:space-between;color:rgba(255,255,255,0.42);font-size:10px;font-variant-numeric:tabular-nums;}.${r.METRICS_EXPORTS}{display:flex;flex-wrap:wrap;gap:6px;padding-top:4px;border-top:1px solid rgba(255,255,255,0.08);}.${r.METRICS_EXPORT_BTN}{padding:6px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.78);font-family:inherit;font-size:12px;cursor:pointer;}.${r.METRICS_EXPORT_BTN}:hover{background:rgba(255,255,255,0.12);color:#fff;}.${r.METRICS_EMPTY}{margin:0;padding:24px 0;color:rgba(255,255,255,0.5);font-size:13px;text-align:center;}.${r.INBOX_NOTICE}{margin:0 0 10px;padding:9px 11px;border-radius:8px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);color:rgba(255,255,255,0.75);font-size:13px;line-height:1.4;}`,xn=()=>` .${r.COMMENT_CURSOR},.${r.COMMENT_CURSOR} *{cursor:url('${En}') ${bn},auto !important;}`,yn=()=>' .report{margin:0;padding:24px;background:#fff;color:#111;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:12px;line-height:1.45;}.report-title{margin:0 0 4px;font-size:20px;}.report-meta{margin:0 0 2px;color:#555;font-size:11px;}.report-table{width:100%;margin-top:18px;border-collapse:collapse;break-inside:avoid;}.report-table caption{margin-bottom:4px;font-size:12px;font-weight:600;text-align:left;}.report-table th,.report-table td{padding:5px 8px;border:1px solid #d5d5d5;text-align:left;font-weight:400;}.report-table thead th{background:#f2f2f2;font-weight:600;}.report-table td{text-align:right;font-variant-numeric:tabular-nums;}@page{margin:14mm;}';function Ee(n,e,t){let o=Wi(e,n);if(o)return n.adoptedStyleSheets=[...n.adoptedStyleSheets??[],o],()=>{n.adoptedStyleSheets=(n.adoptedStyleSheets??[]).filter(a=>a!==o)};let s=n.head??n;s.querySelector?.(`#${t}`)?.remove();let i=document.createElement("style");return i.id=t,i.textContent=e,s.appendChild(i),()=>i.remove()}function Wi(n,e){let o=(e.defaultView??e.ownerDocument?.defaultView??globalThis).CSSStyleSheet;if(typeof o!="function"||!("adoptedStyleSheets"in e))return null;try{let s=new o;return s.replaceSync(n),s}catch{return null}}var X={metricsTitle:"Metrics",metricsOpen:"Metrics",metricsTotal:"Total comments",metricsAverageResolution:"Average resolution",metricsMedianResolution:"Median resolution",metricsReopened:"Reopened",metricsByStatus:"By status",metricsByType:"By type",metricsByPriority:"By priority",metricsOverTime:"Comments per day",metricsEmpty:"No comments to measure yet",metricsCategory:"Category",metricsCount:"Count",metricsDate:"Date",metricsExportComments:"Comments (CSV)",metricsExportMetrics:"Metrics (CSV)",metricsPrint:"Print / Save as PDF",metricsExportLabel:"Export",metricsGeneratedTemplate:"Generated {n}",metricsScope:"Scope",auditToggleTemplate:"History ({n})",auditTrailLabel:"Activity history",auditCreated:"Created the comment",auditEdited:"Edited the text",auditTagsChanged:"Updated the tags",auditPreviousResolutions:"Previous resolutions",auditResolvedInTemplate:"Resolved in {n}",commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"Shift",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusInReview:"In review",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",reactionsLabel:"Reactions",addReaction:"Add reaction",reactionToggleOn:"Add your reaction",reactionToggleOff:"Remove your reaction",reactionPickerLabel:"Choose a reaction"};var Sn={metricsTitle:"M\xE9tricas",metricsOpen:"M\xE9tricas",metricsTotal:"Comentarios totales",metricsAverageResolution:"Resoluci\xF3n media",metricsMedianResolution:"Resoluci\xF3n mediana",metricsReopened:"Reabiertos",metricsByStatus:"Por estado",metricsByType:"Por tipo",metricsByPriority:"Por prioridad",metricsOverTime:"Comentarios por d\xEDa",metricsEmpty:"A\xFAn no hay comentarios que medir",metricsCategory:"Categor\xEDa",metricsCount:"Cantidad",metricsDate:"Fecha",metricsExportComments:"Comentarios (CSV)",metricsExportMetrics:"M\xE9tricas (CSV)",metricsPrint:"Imprimir / Guardar como PDF",metricsExportLabel:"Exportar",metricsGeneratedTemplate:"Generado {n}",metricsScope:"Alcance",auditToggleTemplate:"Historial ({n})",auditTrailLabel:"Historial de actividad",auditCreated:"Cre\xF3 el comentario",auditEdited:"Edit\xF3 el texto",auditTagsChanged:"Actualiz\xF3 las etiquetas",auditPreviousResolutions:"Resoluciones anteriores",auditResolvedInTemplate:"Resuelto en {n}",commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"May\xFAs",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusInReview:"En revisi\xF3n",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",reactionsLabel:"Reacciones",addReaction:"A\xF1adir reacci\xF3n",reactionToggleOn:"A\xF1adir tu reacci\xF3n",reactionToggleOff:"Quitar tu reacci\xF3n",reactionPickerLabel:"Elegir una reacci\xF3n"};var De={en:X,es:Sn},be="en";function On(){let n=(navigator.language||be).slice(0,2).toLowerCase();return n in De?n:be}function An(n){let e=De[n];return!e||n===be?De[be]:{...De[be],...e}}function I(n,e){return n.replace("{n}",String(e))}var ji=6e4;function z(n,e){if(!Number.isFinite(n)||n<0)return"";let t=Math.floor(n/ji);if(t<1)return e.durationLessThanMinute;if(t<60)return I(e.minutesAgoTemplate,t);let o=Math.floor(t/60);if(o<24){let l=t%60,c=I(e.hoursAgoTemplate,o);return l?`${c} ${I(e.minutesAgoTemplate,l)}`:c}let s=Math.floor(o/24),i=o%24,a=I(e.daysAgoTemplate,s);return i?`${a} ${I(e.hoursAgoTemplate,i)}`:a}var dt=64,Ki=3,qi=5,Zi=.6,Ji=.7,Qi=/^(css|sc|jsx|emotion)-/i,er=/^data-(reactid|react-|v-|svelte-)/,tr=["id","name","role","aria-label"],nr=["data-testid","name","aria-label"],pt=n=>typeof CSS<"u"&&CSS.escape?CSS.escape(n):String(n).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),or=n=>String(n).replace(/["\\]/g,"\\$&"),Ce=(n,e)=>{try{return e.querySelectorAll(n).length===1}catch{return!1}},wn=n=>(n||"").replace(/\s+/g," ").trim().slice(0,dt),ir=n=>fn.includes(n)||Qi.test(n)?!1:!n.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),rr=n=>[...n.classList].filter(ir),sr=n=>{let e={};for(let{name:t,value:o}of n.attributes)(tr.includes(t)||t.startsWith("data-")&&!er.test(t))&&o&&(e[t]=o.slice(0,dt));return e},ut=n=>{let e=n.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(o=>o.tagName===n.tagName);return{index:t.indexOf(n),count:t.length}},ar=(n,e)=>{if(!n.id)return null;let t=`#${pt(n.id)}`;return Ce(t,e)?t:null},lr=(n,e)=>{let t=n.tagName.toLowerCase();for(let o of nr){let s=n.getAttribute(o);if(!s)continue;let i=`${t}[${o}="${or(s)}"]`;if(Ce(i,e))return i}return null},cr=(n,e)=>{let t=[],o=n;for(let s=0;s<Ki&&o;s++){let i=rr(o),a=o.tagName.toLowerCase();if(t.unshift(i.length?`${a}.${i.map(pt).join(".")}`:a),s===0&&!i.length)return null;let l=t.join(" > ");if(Ce(l,e))return l;o=o.parentElement}return null},dr=(n,e)=>{if(n===e.body)return"body";let t=[],o=n;for(let i=0;i<qi&&o;i++){if(o===e.body){t.unshift("body");break}if(o.id){let l=[`#${pt(o.id)}`,...t].join(" > ");if(Ce(l,e))return l}let{index:a}=ut(o);t.unshift(`${o.tagName.toLowerCase()}:nth-of-type(${a+1})`),o=o.parentElement}let s=t.join(" > ");return Ce(s,e)?s:null},vn=(n,e)=>ar(n,e)||lr(n,e)||cr(n,e)||dr(n,e);function Nn(n){return vn(n,n.ownerDocument)}function Ln(n,e,t){let o=n.ownerDocument,{index:s,count:i}=ut(n);return{version:1,selector:vn(n,o),fingerprint:{tagName:n.tagName,textSnippet:wn(n.textContent),attributes:sr(n),siblingIndex:s,siblingCount:i},relativeX:e,relativeY:t}}var pr=(n,e)=>{if(!n&&!e)return 1;if(!n||!e)return 0;if(n===e)return 1;if(n.startsWith(e)||e.startsWith(n))return .8;let t=new Set(n.split(" ")),o=new Set(e.split(" ")),s=0;for(let i of t)o.has(i)&&s++;return 2*s/(t.size+o.size)},ur=(n,e)=>{let t=Object.keys(e);if(!t.length)return 1;let o=0;for(let s of t)(n.getAttribute(s)||"").slice(0,dt)===e[s]&&o++;return o/t.length},In=(n,e)=>{let{index:t,count:o}=ut(n),s=Math.abs(t-e.siblingIndex),i=Math.max(e.siblingCount,o,1);return Math.max(0,1-s/i)},hr=(n,e)=>{if(n.tagName!==e.tagName)return 0;let t=!!e.textSnippet,o=Object.keys(e.attributes||{}).length>0,s=.5,i=.3,a=.2;return o?t||(i+=s,s=0):(s+=i,i=0),!t&&!o?In(n,e):s*pr(wn(n.textContent),e.textSnippet)+i*ur(n,e.attributes||{})+a*In(n,e)},Rn=(n,e)=>{let t=null;for(let o of n){let s=hr(o,e);(!t||s>t.confidence)&&(t={element:o,confidence:s})}return t};function ht(n,e=document){if(n?.version!=null&&n.version>1)return null;let t=n?.fingerprint;if(!t||!t.tagName)return null;if(n.selector){let a=[];try{a=[...e.querySelectorAll(n.selector)]}catch{}let l=Rn(a,t);if(l&&l.confidence>=Zi)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 i=Rn(s,t);return i&&i.confidence>=Ji?i:null}var Be="helldots-comments",Pe="helldots-pending-detail";function mt(){try{let n=localStorage.getItem(Be);if(!n)return[];let e=JSON.parse(n);return Array.isArray(e)?e:[]}catch(n){return console.warn("HellDots: could not read stored comments",n),[]}}function Mn(n){try{return localStorage.setItem(Be,JSON.stringify(n)),!0}catch{return!1}}function ke(n){if(Mn(n))return!0;let e=n.map((s,i)=>({comment:s,index:i})).filter(({comment:s})=>s?.contextScreenshot).sort((s,i)=>{let a=Date.parse(s.comment.createdAt),l=Date.parse(i.comment.createdAt);return Number.isFinite(a)&&Number.isFinite(l)&&a!==l?a-l:s.index-i.index});if(e.length===0)return console.warn("HellDots: could not persist comments (storage quota exceeded, nothing left to shed)"),!1;let t=[...n],o=0;for(let{index:s}of e)if(t[s]={...t[s],contextScreenshot:null},o++,Mn(t))return console.warn(`HellDots: localStorage quota exceeded \u2014 dropped the automatic context screenshot from the ${o} oldest comment(s) to keep all comments persisted. Comment text, replies and user-attached screenshots were not touched.`),!0;return console.warn(`HellDots: could not persist comments even after dropping all ${o} automatic context screenshot(s); storage quota exceeded`),!1}function ft(n,e,t){let o=new Set(e.map(i=>String(i.id)));return[...n.filter(i=>!o.has(String(i.id))&&i.page!==t),...e]}var Dn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Bn=(n=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(n|=0));for(;n--;)e+=Dn[t[n]&63];return e};var gt=()=>Bn(),H=n=>typeof n=="string"?n.trim():"",A=(n,e)=>String(n)===String(e);var te=new Set,ne=null,$e=null,mr=n=>[...n.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')],Pn=4,fr=n=>{for(let e=n.parentElement;e;e=e.parentElement){let{overflowX:t,overflowY:o}=getComputedStyle(e);if(t!=="visible"||o!=="visible")return e.getBoundingClientRect()}return null},gr=(n,e)=>{e.classList.remove(r.INBOX_MENU_UP),e.classList.remove(r.INBOX_MENU_START);let t=fr(e),o=Math.min(t?.bottom??1/0,window.innerHeight),s=Math.max(t?.top??0,0),i=Math.max(t?.left??0,0),a=Math.min(t?.right??1/0,window.innerWidth),{height:l,width:c,left:d}=e.getBoundingClientRect(),p=n.getBoundingClientRect(),u=p.bottom+Pn+l,h=p.top-Pn-l;u>o&&h>=s&&e.classList.add(r.INBOX_MENU_UP),d<i&&p.left+c<=a&&e.classList.add(r.INBOX_MENU_START)},kn=(n,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(n)||n.contains(e.target),Er=()=>{ne||(ne=n=>{for(let e of[...te])kn(e.menu,n)||kn(e.button,n)||e.close()},document.addEventListener("mousedown",ne,!0),$e=n=>{let e=[...te].pop();if(e){if(n.key==="Escape"){n.preventDefault(),n.stopPropagation(),e.close(),e.button.focus();return}if(["ArrowDown","ArrowUp","Home","End"].includes(n.key)){let t=mr(e.menu);if(t.length===0)return;n.preventDefault(),n.stopPropagation();let o=e.menu.getRootNode(),s=t.indexOf(o.activeElement),i;if(n.key==="Home")i=0;else if(n.key==="End")i=t.length-1;else if(s===-1)i=n.key==="ArrowDown"?0:t.length-1;else{let a=n.key==="ArrowDown"?1:-1;i=(s+a+t.length)%t.length}t[i].focus()}}},document.addEventListener("keydown",$e,!0))},br=()=>{ne&&(document.removeEventListener("mousedown",ne,!0),ne=null,document.removeEventListener("keydown",$e,!0),$e=null)},He=()=>{for(let n of[...te])n.close()},j=(n,e)=>{let t={button:n,menu:e,close:()=>{e.style.display="none",n.setAttribute("aria-expanded","false"),te.delete(t),te.size===0&&br()}},o=()=>{He(),e.style.display="block",gr(n,e),n.setAttribute("aria-expanded","true"),te.add(t),Er()},s=()=>e.style.display!=="none";return e.style.display="none",n.setAttribute("aria-expanded","false"),n.addEventListener("click",i=>{i.stopPropagation();let a=s();He(),a||o()}),{open:o,close:t.close,isOpen:s}};var $n=(n,e)=>H(n?.id)||n?.name||e.anonymous,Et=n=>{let e=n?.reactions;return!e||typeof e!="object"?[]:ge.filter(t=>e[t]?.length>0).map(t=>({emoji:t,authors:[...e[t]]}))},bt=n=>{if(!n||typeof n!="object")return null;let e={};for(let t of ge){let o=n[t];if(!Array.isArray(o))continue;let s=[];for(let i of o){if(typeof i!="string")continue;let a=i.trim();a&&!s.includes(a)&&s.push(a)}s.length>0&&(e[t]=s)}return Object.keys(e).length>0?e:null},Ct=(n,e,t)=>{if(!ge.includes(e)||!t)return!1;n.reactions||(n.reactions={});let o=n.reactions[e]||[],s=o.indexOf(t);return s>=0?o.splice(s,1):o.push(t),o.length>0?n.reactions[e]=o:delete n.reactions[e],!0},Tt=n=>{let e=Object.entries(n||{}).filter(([,t])=>t?.length>0);return e.length>0?Object.fromEntries(e.map(([t,o])=>[t,[...o]])):null},Cr='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20.94 11.08A9 9 0 1 1 12.92 3.06"/><path d="M8.5 14.2a4.6 4.6 0 0 0 7 0"/><path d="M9 9.5h.01M15 9.5h.01"/><path d="M19 2.6v4M17 4.6h4"/></svg>',Ue=({actorKey:n,strings:e,onToggle:t})=>{let o=new WeakMap,s=c=>{let d=o.get(c);if(d)for(let p of d)p.el.isConnected?p.repaint():d.delete(p)},i=(c,d)=>{t(c,d),s(c)},a=(c,{className:d,tooltip:p=!0})=>{let u=document.createElement("div");u.className=r.REACTION_TRIGGER;let h=document.createElement("button");h.type="button",h.className=d,h.dataset.action="react",p&&(h.dataset.hdTooltip=e.addReaction),h.setAttribute("aria-label",e.addReaction),h.innerHTML=Cr;let m=document.createElement("div");m.className=r.REACTION_PALETTE,m.setAttribute("role","menu"),m.setAttribute("aria-label",e.reactionPickerLabel);let f=j(h,m);for(let g of ge){let E=document.createElement("button");E.type="button",E.className=r.REACTION_PALETTE_ITEM,E.setAttribute("role","menuitem"),E.dataset.reactionEmoji=g,E.textContent=g,E.setAttribute("aria-label",g),E.addEventListener("click",b=>{b.stopPropagation(),f.close(),i(c,g)}),m.appendChild(E)}return u.appendChild(h),u.appendChild(m),u};return{bar:c=>{let d=document.createElement("div");d.className=r.REACTION_BAR,d.setAttribute("role","group"),d.setAttribute("aria-label",e.reactionsLabel);let p=()=>{d.replaceChildren();let h=Et(c),m=n();if(d.hidden=h.length===0,!d.hidden){for(let{emoji:f,authors:g}of h){let E=g.includes(m),b=document.createElement("button");b.type="button",b.className=r.REACTION_PILL,E&&b.classList.add(r.REACTION_PILL_MINE),b.dataset.reactionEmoji=f;let _=E?e.reactionToggleOff:e.reactionToggleOn;b.setAttribute("aria-pressed",String(E)),E||(b.dataset.hdTooltip=_),b.setAttribute("aria-label",`${_}: ${f} (${g.length})`),b.addEventListener("click",v=>{v.stopPropagation(),i(c,f)});let T=document.createElement("span");T.className=r.REACTION_PILL_EMOJI,T.textContent=f,T.setAttribute("aria-hidden","true");let x=document.createElement("span");x.className=r.REACTION_PILL_COUNT,x.textContent=String(g.length),b.appendChild(T),b.appendChild(x),d.appendChild(b)}d.appendChild(a(c,{className:r.REACTION_ADD}))}},u=o.get(c);return u||o.set(c,u=new Set),u.add({el:d,repaint:p}),p(),d},trigger:a,refresh:s}};var Xe="helldotsComment",oe=(n,e=Xe,t=location.href)=>{let o=new URL(t),s=n.page||o.pathname,i=s===o.pathname?o:new URL(s,o);return i.searchParams.set(e,String(n.id)),i.href},Hn=(n=Xe,e=location.href)=>{try{return new URL(e).searchParams.get(n)}catch{return null}};var Un=["created","edited","status","classified"],Xn=["type","priority","tags"],Tr=64,Fe=n=>typeof n=="string"?n.trim().slice(0,Tr):"",ze=n=>n===null?{present:!0,value:null}:typeof n=="string"?{present:!0,value:Fe(n)}:{present:!1,value:void 0};function Fn(n,e){let t=Fe(n?.name)||e.anonymous,o=H(n?.id);return o?{id:o,name:t}:{name:t}}function K(n,e,t,o){if(!Un.includes(e))return null;let s={type:e,at:new Date().toISOString(),actor:t};o?.field&&Xn.includes(o.field)&&(s.field=o.field);let i=ze(o?.from);i.present&&(s.from=i.value);let a=ze(o?.to);return a.present&&(s.to=a.value),Array.isArray(n.history)||(n.history=[]),n.history.push(s),s}function zn(n){if(!Array.isArray(n))return null;let e=[];for(let t of n){if(!t||typeof t!="object"||!Un.includes(t.type))continue;let o=Fe(t.at);if(!Number.isFinite(Date.parse(o)))continue;let s=Fe(t.actor?.name),i=H(t.actor?.id),a={type:t.type,at:o,actor:i?{id:i,name:s}:{name:s}};Xn.includes(t.field)&&(a.field=t.field);let l=ze(t.from);l.present&&(a.from=l.value);let c=ze(t.to);c.present&&(a.to=c.value),e.push(a)}return e.length===0?null:(e.sort((t,o)=>Date.parse(t.at)-Date.parse(o.at)),e)}function Gn(n){return!Array.isArray(n)||n.length===0?null:n.map(e=>({...e,actor:{...e.actor}}))}function q(n){if(!Array.isArray(n?.history))return[];let e=[],t=null;for(let s of n.history)s.type==="status"&&(s.to==="resolved"?t=s.at:t&&(e.push({resolvedAt:t,reopenedAt:s.at,ms:0}),t=null));t&&e.push({resolvedAt:t,reopenedAt:null,ms:0});let o=Date.parse(n.createdAt);for(let s of e){let i=Date.parse(s.resolvedAt);s.ms=Number.isFinite(o)&&Number.isFinite(i)?Math.max(0,i-o):0}return e}function ie(n){if(n?.status!=="resolved")return null;let e=q(n),t=e[e.length-1];if(t&&!t.reopenedAt)return t.ms;let o=Date.parse(n.resolvedAt),s=Date.parse(n.createdAt);return!Number.isFinite(o)||!Number.isFinite(s)?null:Math.max(0,o-s)}var _t=new Set,Vn=()=>{for(let n of[..._t])n(!1)},Ge=(n,{title:e,message:t,confirmLabel:o,cancelLabel:s})=>new Promise(i=>{let a=document.createElement("div");a.className=r.CONFIRM,a.style.zIndex=String(D.CONFIRM);let l=document.createElement("div");l.className=r.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=r.CONFIRM_TITLE,c.textContent=e,c.id=`hd-confirm-title-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-labelledby",c.id);let d=document.createElement("p");d.className=r.CONFIRM_MESSAGE,d.textContent=t,d.id=`hd-confirm-message-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-describedby",d.id);let p=document.createElement("div");p.className=r.CONFIRM_ACTIONS;let u=document.createElement("button");u.type="button",u.className=r.CONFIRM_CANCEL,u.textContent=s;let h=document.createElement("button");h.type="button",h.className=r.CONFIRM_ACCEPT,h.textContent=o,p.appendChild(u),p.appendChild(h),l.appendChild(c),l.appendChild(d),l.appendChild(p),a.appendChild(l);let m=n.activeElement||document.activeElement,f=!1,g=T=>{f||(f=!0,_t.delete(g),document.removeEventListener("keydown",E,!0),a.remove(),m?.focus?.(),i(T))},E=T=>{if(T.key==="Escape"){T.stopPropagation(),T.preventDefault(),g(!1);return}if(T.key!=="Tab")return;let x=[u,h],v=n.activeElement||document.activeElement,C=x.indexOf(v);T.preventDefault(),(T.shiftKey?x[(C<=0?x.length:C)-1]:x[(C+1)%x.length]).focus()};u.addEventListener("click",()=>g(!1)),h.addEventListener("click",()=>g(!0));let b=!1;a.addEventListener("mousedown",T=>{b=T.target===a,T.stopPropagation()}),a.addEventListener("click",T=>{T.target===a&&b&&g(!1),b=!1}),_t.add(g),document.addEventListener("keydown",E,!0),(n.body||n).appendChild(a),u.focus()});var Yn='<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>',_r='<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>',xr='<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>',se=n=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(n).catch(()=>{});let e=document.createElement("textarea");e.value=n,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},B=(n,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,in_review:e.statusInReview,resolved:e.statusResolved})[n]||e.statusOpen,L=(n,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[n]||e.unset,M=(n,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[n]||e.unset,re=({action:n,options:e,value:t,colorOf:o,labelOf:s,tooltipLabel:i,onSelect:a,showLabel:l=!1})=>{let c=document.createElement("div");c.style.position="relative";let d=document.createElement("button");d.type="button",d.className=r.INBOX_ACTION_BTN,l&&d.classList.add(r.INBOX_ACTION_BTN_LABELED),d.dataset.action=n,d.setAttribute("aria-haspopup","true");let p=document.createElement("span");p.className=r.INBOX_STATUS_DOT,d.appendChild(p);let u=null;l&&(u=document.createElement("span"),u.className=r.INBOX_ACTION_LABEL,d.appendChild(u));let h=document.createElement("div");h.className=r.INBOX_MENU,h.setAttribute("role","menu");let m=j(d,h),f=t,g=()=>{let E=`${i}: ${s(f)}`;p.style.backgroundColor=o(f),d.dataset.hdTooltip=E,d.setAttribute("aria-label",E),u&&(u.textContent=s(f)),h.querySelectorAll("[data-picker-option]").forEach(b=>{let _=b.dataset.pickerOption,T=_===""?null:_;b.setAttribute("aria-checked",String(T===f))})};for(let E of e){let b=document.createElement("button");b.type="button",b.className=r.INBOX_MENU_ITEM,b.dataset.pickerOption=E===null?"":E,b.setAttribute("role","menuitemradio");let _=document.createElement("span");_.className=r.INBOX_STATUS_DOT,_.style.backgroundColor=o(E),b.appendChild(_),b.appendChild(document.createTextNode(s(E))),b.addEventListener("click",T=>{T.stopPropagation(),m.close(),E!==f&&(f=E,a(E),g())}),h.appendChild(b)}return c.appendChild(d),c.appendChild(h),g(),c},xt=({label:n,tooltip:e,items:t})=>{let o=document.createElement("div");o.style.position="relative";let s=document.createElement("button");s.type="button",s.className=r.INBOX_ACTION_BTN,s.dataset.action="menu",e&&(s.dataset.hdTooltip=e),s.setAttribute("aria-label",n),s.innerHTML=xr;let i=document.createElement("div");i.className=r.INBOX_MENU,i.setAttribute("role","menu");let a=j(s,i);for(let l of t){let c=document.createElement("button");c.type="button",c.className=r.INBOX_MENU_ITEM,c.setAttribute("role","menuitem"),c.textContent=l.label,c.addEventListener("click",async d=>{if(d.stopPropagation(),l.feedbackLabel){l.onSelect(),c.textContent=l.feedbackLabel,setTimeout(()=>{c.textContent=l.label,a.close()},1200);return}if(a.close(),l.confirm){let p=c.getRootNode();if(!await Ge(p,l.confirm()))return}l.onSelect()}),i.appendChild(c)}return o.appendChild(s),o.appendChild(i),o},Ve=(n,{strings:e,reactions:t,onCopy:o,onCopyLink:s,onEdit:i,onSetStatus:a,onSetType:l,onSetPriority:c,onDelete:d})=>{let p=document.createElement("div");p.className=r.INBOX_CARD_ACTIONS;let u=document.createElement("div");u.className=r.ACTIONS_GROUP;let h=document.createElement("div");h.className=`${r.ACTIONS_GROUP} ${r.ACTIONS_GROUP_END}`,p.appendChild(u),p.appendChild(h),t&&h.appendChild(t.trigger(n,{className:r.INBOX_ACTION_BTN}));let m=document.createElement("button");return m.type="button",m.className=r.INBOX_ACTION_BTN,m.dataset.action="copy",m.dataset.hdTooltip=e.copyAgentContext,m.setAttribute("aria-label",e.copyAgentContext),m.innerHTML=Yn,m.addEventListener("click",f=>{f.stopPropagation(),o(n),m.innerHTML=_r,m.dataset.hdTooltip=e.copied,setTimeout(()=>{m.innerHTML=Yn,m.dataset.hdTooltip=e.copyAgentContext},1500)}),h.appendChild(m),u.appendChild(re({action:"status",options:N,value:n.status||"open",colorOf:f=>V[f]||V.open,labelOf:f=>B(f,e),tooltipLabel:e.statusLabel,onSelect:f=>a(n,f),showLabel:!0})),u.appendChild(re({action:"type",options:[null,...R],value:n.type||null,colorOf:f=>Y[f]||"transparent",labelOf:f=>L(f,e),tooltipLabel:e.typeLabel,onSelect:f=>l?.(n,f),showLabel:!0})),u.appendChild(re({action:"priority",options:[null,...w],value:n.priority||null,colorOf:f=>W[f]||"transparent",labelOf:f=>M(f,e),tooltipLabel:e.priorityLabel,onSelect:f=>c?.(n,f),showLabel:!0})),h.appendChild(xt({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>s?.(n)},{label:e.editComment,onSelect:()=>i?.(n)},{label:e.deleteComment,onSelect:()=>d(n),confirm:()=>({title:e.confirmDeleteCommentTitle,message:n.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),p};var ae=({value:n,strings:e,onInput:t,onSave:o,onCancel:s})=>{let i=document.createElement("div");i.className=r.EDITOR;let a=document.createElement("textarea");a.className=r.EDITOR_INPUT,a.value=n,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=r.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=r.EDITOR_CANCEL,c.textContent=e.editCancel;let d=document.createElement("button");d.type="button",d.className=r.EDITOR_SAVE,d.textContent=e.editSave;let p=()=>{d.disabled=a.value.trim().length===0};return p(),a.addEventListener("input",()=>{p(),t(a.value)}),a.addEventListener("keydown",u=>{if(u.key==="Escape"){u.stopPropagation(),u.preventDefault(),s();return}u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!d.disabled&&(u.preventDefault(),o(a.value))}),c.addEventListener("click",u=>{u.stopPropagation(),s()}),d.addEventListener("click",u=>{u.stopPropagation(),d.disabled||o(a.value)}),l.appendChild(c),l.appendChild(d),i.appendChild(a),i.appendChild(l),queueMicrotask(()=>{a.focus(),a.setSelectionRange(a.value.length,a.value.length)}),i},Ye=(n,e)=>Ge(n,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var yr=(n,e)=>{let t=Date.now()-new Date(n).getTime(),o=Math.floor(t/6e4),s=Math.floor(t/36e5),i=Math.floor(t/864e5);return o<1?e.justNow:o<60?I(e.minutesAgoTemplate,o):s<24?I(e.hoursAgoTemplate,s):I(e.daysAgoTemplate,i)},jn=(n,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(n)),Te=(n,e,t,o,s=null)=>{let i=document.createElement("div");i.className=r.THREAD_META;let a=document.createElement("span");a.className=r.THREAD_AUTHOR,a.textContent=n||t.anonymous;let l=document.createElement("span");return l.className=r.THREAD_TIME,l.textContent=yr(e,t),l.dataset.fullDate=jn(e,o),i.appendChild(a),i.appendChild(l),s&&i.appendChild(yt(s,t,o)),i},yt=(n,e,t)=>{let o=document.createElement("span");return o.className=r.THREAD_EDITED,o.textContent=e.editedMark,o.dataset.fullDate=e.editedAtPrefix+jn(n,t),o},St=()=>/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),Ot=(n,e)=>{let t=St(),o={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:t?"\u21E7":e.modifierShift},s=o[n.shortcutModifier]||o.alt,i=n.shortcutKey?.toUpperCase()||"C";return`${s} + ${i}`},We='<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>',Sr='<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>',Or='<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>',Ar='<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>',Ir='<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>',je=({areaClassName:n,inputTag:e="textarea",inputClassName:t,inputId:o,inputPlaceholder:s,submitBtnId:i,fileInputId:a},l)=>{let c=document.createElement("div");c.className=n;let d=document.createElement(e);o&&(d.id=o),t&&(d.className=t),d.placeholder=s,d.setAttribute("aria-label",s),e==="input"&&(d.type="text");let p=document.createElement("div");p.className=r.SCREENSHOTS_CONTAINER;let u=document.createElement("div");u.className=r.COMMENT_ACTIONS_BAR;let h=document.createElement("button");h.className=r.ATTACH_IMAGE_BTN,h.type="button",h.setAttribute("aria-label",l.attachImage),h.innerHTML=Sr;let m=document.createElement("input");m.type="file",a&&(m.id=a),m.accept="image/*",m.style.display="none";let f=document.createElement("button");return i&&(f.id=i),f.className=r.THREAD_SUBMIT,f.type="button",f.setAttribute("aria-label",l.send),f.innerHTML=Or,u.appendChild(h),u.appendChild(m),u.appendChild(f),c.appendChild(d),c.appendChild(p),c.appendChild(u),{container:c,inputEl:d,screenshotsContainer:p,attachBtn:h,fileInput:m,submitBtn:f}},Wn=(n,e,t,o)=>{let s=document.createElement("div");s.className=r.TOOLBAR_ACTION_WRAPPER;let i=document.createElement("div");i.className=r.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>i.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${r.TOOLBAR_ACTION_BTN} ${n}`,a.setAttribute("aria-label",o),a.innerHTML=e,s.appendChild(i),s.appendChild(a),s},Kn=(n={},e=X)=>{let t=document.createElement("div");t.id=O.TOOLBAR;let o=document.createElement("div");o.className=r.TOOLBAR_ACTIONS;let s=document.createElement("span");s.className=r.TOOLBAR_TEXT,s.textContent=e.toolbarComment;let i=document.createElement("span");i.className=r.SHORTCUT_HINT,i.textContent=Ot(n,e);let a=Wn(r.TOOLBAR_COMMENT_BTN,Ar,[s,i],e.toolbarComment);a.querySelector(`.${r.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=r.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=Wn(r.TOOLBAR_MENU_BTN,Ir,[l],e.toolbarInbox);return o.appendChild(a),o.appendChild(c),t.appendChild(o),t},At=(n,e,{includeStatus:t=!1,includeClassification:o=!0}={})=>{let s=document.createElement("div");s.className=r.INBOX_BADGES;let i=(a,l,c)=>{let d=document.createElement("span");d.className=`${r.BADGE} ${l}`,d.textContent=a,c&&(d.style.borderColor=c),s.appendChild(d)};if(t){let a=n.status||"open";i(B(a,e),r.BADGE_STATUS,V[a])}o&&n.type&&i(L(n.type,e),r.BADGE_TYPE,Y[n.type]),o&&n.priority&&i(M(n.priority,e),r.BADGE_PRIORITY,W[n.priority]);for(let a of n.tags||[])i(a,r.BADGE_TAG,null);if(n.status==="resolved"){let a=ie(n),l=a===null?"":z(a,e);i(I(e.resolvedInTemplate,l||"\u2014"),r.BADGE_DURATION,null)}return s.children.length?s:null},Rr=n=>{let e=document.createElement("div");e.className=r.CLASSIFY_ROW;let t=null,o=null,s=()=>{e.replaceChildren(),e.appendChild(re({action:"type",options:[null,...R],value:null,colorOf:i=>Y[i]||"transparent",labelOf:i=>L(i,n),tooltipLabel:n.typeLabel,onSelect:i=>t=i,showLabel:!0})),e.appendChild(re({action:"priority",options:[null,...w],value:null,colorOf:i=>W[i]||"transparent",labelOf:i=>M(i,n),tooltipLabel:n.priorityLabel,onSelect:i=>o=i,showLabel:!0}))};return s(),{container:e,getType:()=>t,getPriority:()=>o,reset:()=>{t=null,o=null,s()}}},qn=(n=X)=>{let e=document.createElement("div");e.id=O.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",n.commentBoxAriaLabel);let{container:t}=je({areaClassName:r.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:O.COMMENT_INPUT,inputPlaceholder:n.commentPlaceholder,submitBtnId:O.SUBMIT_COMMENT,fileInputId:O.ATTACH_IMAGE_INPUT},n),o=Rr(n);return e.appendChild(o.container),e.appendChild(t),e.style.display="none",e.classify=o,e},Z=n=>String(n).replace(/[\\"]/g,"\\$&"),Zn=n=>`[data-comment-id="${Z(n)}"]`,It=n=>n.screenshots||(n.screenshot?[n.screenshot]:[]),le=(n,e,{strings:t,onShow:o,rerender:s})=>{n.innerHTML="",n.classList.toggle(r.ACTIVE,e.length>0),e.forEach((i,a)=>{let l=document.createElement("div");l.className=r.SCREENSHOT_ITEM;let c=document.createElement("img");c.className=r.SCREENSHOT_IMG,c.src=i,c.alt=t.attachedScreenshot,Jn(c,()=>o(i));let d=document.createElement("button");d.type="button",d.className=r.SCREENSHOT_REMOVE,d.setAttribute("aria-label",t.removeScreenshot),d.innerHTML="&times;",d.onclick=p=>{p.stopPropagation(),e.splice(a,1),s()},l.appendChild(c),l.appendChild(d),n.appendChild(l)})},ce=(n,e,t)=>{n.addEventListener("change",o=>{let s=o.target.files[0];if(!s||s.type&&!s.type.startsWith("image/"))return;let i=e();if(i.length>=Ne)return;let a=new FileReader;a.onload=l=>{i.push(l.target.result),t()},a.readAsDataURL(s),n.value=""})},U=(n,e)=>{n.querySelectorAll(`.${r.SCREENSHOT_IMG}`).forEach(t=>{Jn(t,()=>e(t.src))})},Jn=(n,e)=>{n.setAttribute("role","button"),n.setAttribute("tabindex","0"),n.addEventListener("click",t=>{t.stopPropagation(),e()}),n.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())})},Qn=(n,e=X)=>{let t=document.createElement("div");return t.className=r.CIRCLE,t.dataset.commentId=n.id,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${n.text}`),t.style.cssText=`
71
19
  position: absolute;
72
- bottom: calc(100% + 10px);
73
- left: 50%;
74
- transform: translateX(-50%) translateY(4px);
75
- display: flex;
76
- align-items: center;
77
- gap: 8px;
78
- background: rgba(20, 20, 23, 0.95);
79
- backdrop-filter: blur(16px);
80
- -webkit-backdrop-filter: blur(16px);
81
- padding: 8px 12px;
82
- border-radius: 10px;
83
- border: 1px solid rgba(255, 255, 255, 0.08);
84
- box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
85
- color: white;
86
- white-space: nowrap;
87
- opacity: 0;
88
- pointer-events: none;
89
- transition: opacity 0.15s ease, transform 0.15s ease;
90
- }
91
-
92
- .${i.TOOLBAR_ACTION_WRAPPER}:hover .${i.TOOLBAR_ACTION_TOOLTIP} {
93
- opacity: 1;
94
20
  pointer-events: auto;
95
- transform: translateX(-50%) translateY(0);
96
- }
97
-
98
- .${i.TOOLBAR_TEXT} {
99
- font-size: 13px;
100
- font-weight: 500;
101
- letter-spacing: -0.01em;
102
- }
103
-
104
- .${i.SHORTCUT_HINT} {
105
- font-size: 11px;
106
- font-weight: 500;
107
- color: rgba(255, 255, 255, 0.5);
108
- background: rgba(255, 255, 255, 0.06);
109
- border: 1px solid rgba(255, 255, 255, 0.1);
110
- padding: 2px 6px;
111
- border-radius: 5px;
112
- line-height: 1;
113
- white-space: nowrap;
114
- }
115
-
116
- .${i.TOOLBAR_ACTIONS} {
117
- display: flex;
118
- flex-direction: row;
119
- background: rgba(20, 20, 23, 0.95);
120
- backdrop-filter: blur(16px);
121
- -webkit-backdrop-filter: blur(16px);
122
- border-radius: 12px;
123
- box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
124
- }
125
-
126
- .${i.TOOLBAR_ACTION_BTN} {
127
- width: 42px;
128
- height: 42px;
129
- display: flex;
130
- align-items: center;
131
- justify-content: center;
132
- background: none;
133
- border: none;
134
- outline: none;
135
- color: rgba(255, 255, 255, 0.65);
136
- cursor: pointer;
137
- transition: background 0.2s, color 0.2s;
138
- padding: 0;
139
- }
140
-
141
- .${i.TOOLBAR_ACTION_WRAPPER}:first-child .${i.TOOLBAR_ACTION_BTN} {
142
- border-radius: 12px 0 0 12px;
143
- }
144
-
145
- .${i.TOOLBAR_ACTION_WRAPPER}:last-child .${i.TOOLBAR_ACTION_BTN} {
146
- border-radius: 0 12px 12px 0;
147
- }
148
-
149
- .${i.TOOLBAR_ACTION_BTN}:hover {
150
- background: rgba(255, 255, 255, 0.08);
151
- color: white;
152
- }
153
-
154
- .${i.TOOLBAR_COMMENT_BTN}.${i.ACTIVE} {
155
- color: #2E90FA;
156
- background: rgba(46, 144, 250, 0.1);
157
- }
158
-
159
-
160
- #${y.COMMENT_BOX} {
161
- position: fixed;
162
- background: #1C1C1E;
163
- border-radius: 12px;
164
- box-shadow: 0 4px 20px rgba(0,0,0,0.4);
165
- padding: 16px;
166
- z-index: ${O.COMMENT_BOX};
167
- width: min(400px, calc(100vw - 24px));
168
- display: none;
169
- box-sizing: border-box;
170
- }
171
-
172
- #${y.COMMENT_BOX} .${i.COMMENT_INPUT_AREA} {
173
- display: flex;
174
- flex-direction: column;
175
- gap: 0;
176
- }
177
-
178
- /* Shares the comment box's own 16px inset instead of adding its own, so
179
- the pickers line up with the textarea below them. The hairline is the
180
- mirror of the one .thread-input-area carries on top. */
181
- .${i.CLASSIFY_ROW} {
182
- display: flex;
183
- align-items: center;
184
- flex-wrap: wrap;
185
- gap: 8px;
186
- padding: 0 0 10px;
187
- border-bottom: 1px solid rgba(255, 255, 255, 0.08);
188
- }
189
-
190
- /* In the inbox the pickers sit in a strip of other icon buttons and read
191
- as controls on their own. Alone at the top of an empty comment box
192
- they need an outline to do the same. */
193
- .${i.CLASSIFY_ROW} .${i.INBOX_ACTION_BTN} {
194
- height: 26px;
195
- border: 1px solid rgba(255, 255, 255, 0.12);
196
- border-radius: 8px;
197
- }
198
-
199
- .${i.CLASSIFY_ROW} .${i.INBOX_ACTION_BTN}:hover {
200
- border-color: rgba(255, 255, 255, 0.28);
201
- }
202
-
203
- #${y.COMMENT_INPUT} {
204
- flex: 1;
205
- min-height: 20px;
206
- background: #1C1C1E;
207
- border: none;
208
- resize: none;
209
- font-family: inherit;
210
- color: white;
211
- font-size: 14px;
212
- line-height: 1.4;
213
- box-sizing: border-box;
214
- field-sizing: content;
215
- padding: 8px 0;
216
- }
217
-
218
- #${y.COMMENT_INPUT}::placeholder {
219
- color: rgba(255, 255, 255, 0.5);
220
- }
221
-
222
- #${y.COMMENT_INPUT}:focus {
223
- outline: none;
224
- box-shadow: none;
225
- }
226
-
227
- .${i.COMMENT_ACTIONS_BAR} {
228
- display: flex;
229
- align-items: center;
230
- justify-content: space-between;
231
- padding-top: 12px;
232
- }
233
-
234
- .${i.ATTACH_IMAGE_BTN} {
235
- background: none;
236
- border: none;
237
- color: rgba(255, 255, 255, 0.5);
238
- cursor: pointer;
239
- display: flex;
240
- align-items: center;
241
- justify-content: center;
242
- border-radius: 6px;
243
- transition: background 0.2s, color 0.2s;
244
- }
245
-
246
- .${i.ATTACH_IMAGE_BTN}:hover {
247
- background: rgba(255, 255, 255, 0.1);
248
- color: rgba(255, 255, 255, 0.8);
249
- }
250
-
251
- .${i.CIRCLE} {
252
- position: absolute;
253
- width: 28px;
254
- height: 28px;
255
- background: #2E90FA;
256
- border-radius: 0% 100% 100% 100%;
257
- border: 2px solid #FFF;
258
- cursor: pointer;
259
- box-shadow: 0 1px 5px rgba(0,0,0,0.2);
260
- transition: transform 0.2s, background 0.2s;
261
- z-index: ${O.CIRCLE};
262
- transform: translate(-50%, -50%);
263
- }
264
-
265
- .${i.CIRCLE}:hover {
266
- transform: translate(-50%, -50%) scale(1.2) !important;
267
- background: rgb(0, 123, 255);
268
- }
269
-
270
- .${i.CIRCLE}.${i.HIGHLIGHT} {
271
- transform: translate(-50%, -50%) scale(1.2) !important;
272
- background: rgb(0, 123, 255);
273
- box-shadow: 0 0 0 4px rgba(46, 144, 250, 0.35), 0 1px 5px rgba(0,0,0,0.2);
274
- }
275
-
276
- /* The marker whose thread is open. Grows like hover does \u2014 the pointer
277
- has to leave the circle to reach the popover, so hover alone can't
278
- carry the selected state \u2014 and adds a heavier ring. Size and ring,
279
- not colour alone (WCAG 1.4.1). */
280
- .${i.CIRCLE}.${i.CIRCLE_ACTIVE} {
281
- transform: translate(-50%, -50%) scale(1.2) !important;
282
- background: rgb(0, 123, 255);
283
- box-shadow: 0 0 0 5px rgba(46, 144, 250, 0.5), 0 1px 5px rgba(0,0,0,0.2);
284
- }
285
-
286
- .${i.CIRCLE_WRAPPER} {
287
- position: absolute;
288
- left: 0;
289
- top: 0;
290
- width: 100%;
291
- height: 100%;
292
- pointer-events: none;
293
- z-index: ${O.CIRCLE};
294
- }
295
-
296
- .${i.TOOLTIP} {
297
- position: fixed;
298
- background: #1C1C1E;
299
- border-radius: 12px;
300
- padding: 16px;
301
- box-shadow: 0 4px 20px rgba(0,0,0,0.4);
302
- width: min(400px, calc(100vw - 24px));
303
- max-height: calc(100vh - 20px);
304
- overflow-y: auto;
305
- overscroll-behavior: contain;${de}
306
- z-index: ${O.TOOLTIP};
307
- color: white;
308
- font-size: 14px;
309
- line-height: 1.5;
310
- box-sizing: border-box;
311
- }
312
-
313
- .${i.TOOLTIP} .${i.THREAD_HEADER} {
314
- padding: 0 0 0;
315
- }
316
-
317
- .${i.TOOLTIP} .${i.THREAD_BODY} {
318
- padding: 8px 0;
319
- }
320
-
321
- .${i.THREAD_POPOVER} {
322
- position: fixed;
323
- background: #1C1C1E;
324
- border-radius: 12px;
325
- padding: 16px;
326
- box-shadow: 0 4px 20px rgba(0,0,0,0.4);
327
- width: min(400px, calc(100vw - 24px));
328
- max-height: calc(100vh - 20px);
329
- display: flex;
330
- flex-direction: column;
331
- z-index: ${O.TOOLTIP};
332
- color: white;
333
- font-size: 14px;
334
- line-height: 1.5;
335
- box-sizing: border-box;
336
- }
337
-
338
- /* The header, its action row and the reply box are pinned; the comment
339
- body, context block and replies scroll between them. The min-height: 0
340
- is required \u2014 a flex item's default minimum is its content height, so
341
- without it the popover grows past max-height instead of scrolling. */
342
- .${i.THREAD_POPOVER} > .${i.THREAD_HEADER},
343
- .${i.THREAD_POPOVER} > .${i.THREAD_ACTIONS_ROW},
344
- .${i.THREAD_POPOVER} > .${i.THREAD_INPUT_AREA} {
345
- flex: none;
346
- }
347
-
348
- .${i.THREAD_SCROLL} {
349
- flex: 1 1 auto;
350
- min-height: 0;
351
- overflow-y: auto;
352
- overscroll-behavior: contain;${de}
353
- }
354
- ${xn(`.${i.THREAD_SCROLL}`,`.${i.TOOLTIP}`,`.${i.INBOX_LIST}`,`.${i.INBOX_DETAIL}`,`.${i.EDITOR_INPUT}`)}
355
- .${i.INBOX_PANEL} {
356
- position: fixed;
357
- top: 16px;
358
- right: 16px;
359
- bottom: 16px;
360
- width: 380px;
361
- display: flex;
362
- flex-direction: column;
363
- background: #1C1C1E;
364
- border: 1px solid rgba(255,255,255,0.08);
365
- border-radius: 14px;
366
- box-shadow: 0 8px 32px rgba(0,0,0,0.5);
367
- z-index: ${O.COMMENT_BOX};
368
- color: white;
369
- font-size: 14px;
370
- line-height: 1.5;
371
- box-sizing: border-box;
372
- overflow: hidden;
373
- }
374
-
375
- /* 380px panel + 16px of gutter each side needs 412px to sit flush on
376
- the right; below that it spans the viewport instead. */
377
- @media (max-width: 480px) {
378
- .${i.INBOX_PANEL} {
379
- left: 16px;
380
- width: auto;
381
- }
382
- }
383
-
384
- .${i.INBOX_HEADER},
385
- .${i.INBOX_DETAIL_HEADER} {
386
- display: flex;
387
- align-items: center;
388
- justify-content: space-between;
389
- gap: 8px;
390
- padding: 12px 14px;
391
- border-bottom: 1px solid rgba(255,255,255,0.08);
392
- flex: none;
393
- }
394
-
395
- .${i.INBOX_FILTER}-wrapper {
396
- position: relative;
397
- }
398
-
399
- .${i.INBOX_FILTER} {
400
- display: flex;
401
- align-items: center;
402
- gap: 6px;
403
- background: transparent;
404
- border: none;
405
- color: white;
406
- font-size: 13px;
407
- font-weight: 600;
408
- cursor: pointer;
409
- padding: 4px 6px;
410
- border-radius: 6px;
411
- }
412
-
413
- .${i.INBOX_FILTER}:hover {
414
- background: rgba(255,255,255,0.08);
415
- }
416
-
417
- .${i.INBOX_FILTER_MENU} {
418
- position: absolute;
419
- top: calc(100% + 6px);
420
- left: 0;
421
- background: #2C2C2E;
422
- border: 1px solid rgba(255,255,255,0.1);
423
- border-radius: 12px;
424
- padding: 14px;
425
- width: 300px;
426
- max-width: calc(100vw - 40px);
427
- z-index: 1;
428
- box-shadow: 0 8px 28px rgba(0,0,0,0.5);
429
- }
430
-
431
- .${i.INBOX_FILTER_MENU_HEADER} {
432
- display: flex;
433
- align-items: baseline;
434
- justify-content: space-between;
435
- gap: 12px;
436
- font-size: 13px;
437
- font-weight: 600;
438
- margin-bottom: 12px;
439
- }
440
-
441
- .${i.INBOX_FILTER_CLEAR} {
442
- background: transparent;
443
- border: none;
444
- color: rgba(255,255,255,0.55);
445
- font-size: 12px;
446
- font-weight: 500;
447
- cursor: pointer;
448
- padding: 0;
449
- }
450
-
451
- .${i.INBOX_FILTER_CLEAR}:hover:not(:disabled) {
452
- color: white;
453
- }
454
-
455
- .${i.INBOX_FILTER_CLEAR}:disabled {
456
- opacity: 0.35;
457
- cursor: default;
458
- }
459
-
460
- .${i.INBOX_FILTER_GROUP} + .${i.INBOX_FILTER_GROUP} {
461
- margin-top: 14px;
462
- }
463
-
464
- .${i.INBOX_FILTER_SECTION} {
465
- font-size: 11px;
466
- font-weight: 600;
467
- color: rgba(255,255,255,0.45);
468
- margin-bottom: 8px;
469
- }
470
-
471
- .${i.INBOX_FILTER_CHIPS} {
472
- display: flex;
473
- flex-wrap: wrap;
474
- gap: 6px;
475
- }
476
-
477
- .${i.INBOX_FILTER_CHIP} {
478
- background: transparent;
479
- border: 1px solid rgba(255,255,255,0.18);
480
- border-radius: 999px;
481
- color: rgba(255,255,255,0.75);
482
- font-size: 12px;
483
- line-height: 1;
484
- padding: 7px 12px;
485
- cursor: pointer;
486
- transition: background 0.15s, border-color 0.15s, color 0.15s;
487
- }
488
-
489
- .${i.INBOX_FILTER_CHIP}:hover {
490
- border-color: rgba(255,255,255,0.4);
491
- color: white;
492
- }
493
-
494
- /* Selected chips are filled *and* carry aria-checked \u2014 the fill is a
495
- convenience, never the only way to tell them apart. */
496
- .${i.INBOX_FILTER_CHIP}[aria-checked="true"] {
497
- background: rgba(255,255,255,0.92);
498
- border-color: rgba(255,255,255,0.92);
499
- color: #1C1C1E;
500
- font-weight: 600;
501
- }
502
-
503
- .${i.INBOX_MENU_ITEM} {
504
- display: block;
505
- width: 100%;
506
- text-align: left;
507
- background: transparent;
508
- border: none;
509
- color: white;
510
- font-size: 13px;
511
- padding: 7px 10px;
512
- border-radius: 6px;
513
- cursor: pointer;
514
- }
515
-
516
- .${i.INBOX_MENU_ITEM}:hover {
517
- background: rgba(255,255,255,0.08);
518
- }
519
-
520
- .${i.INBOX_CLOSE},
521
- .${i.INBOX_NAV_BTN},
522
- .${i.INBOX_BACK} {
523
- display: flex;
524
- align-items: center;
525
- gap: 4px;
526
- background: transparent;
527
- border: none;
528
- color: rgba(255,255,255,0.75);
529
- cursor: pointer;
530
- padding: 4px 6px;
531
- border-radius: 6px;
532
- font-size: 14px;
533
- }
534
-
535
- .${i.INBOX_CLOSE} {
536
- font-size: 20px;
537
- line-height: 1;
538
- }
539
-
540
- .${i.INBOX_CLOSE}:hover,
541
- .${i.INBOX_NAV_BTN}:not(:disabled):hover,
542
- .${i.INBOX_BACK}:hover {
543
- background: rgba(255,255,255,0.08);
544
- color: white;
545
- }
546
-
547
- .${i.INBOX_NAV_BTN}:disabled {
548
- opacity: 0.35;
549
- cursor: default;
550
- }
551
-
552
- .${i.INBOX_LIST},
553
- .${i.INBOX_DETAIL} {
554
- flex: 1;
555
- overflow-y: auto;${de}
556
- padding: 12px;
557
- display: flex;
558
- flex-direction: column;
559
- gap: 12px;
560
- }
561
-
562
- .${i.INBOX_CARD} {
563
- border: 1px solid rgba(255,255,255,0.1);
564
- border-radius: 10px;
565
- padding: 12px;
566
- display: flex;
567
- flex-direction: column;
568
- gap: 8px;
569
- }
570
-
571
- .${i.INBOX_LIST} .${i.INBOX_CARD} {
572
- cursor: pointer;
573
- }
574
-
575
- .${i.INBOX_LIST} .${i.INBOX_CARD}:hover {
576
- border-color: rgba(255,255,255,0.22);
577
- }
578
-
579
- .${i.INBOX_CARD}--resolved {
580
- border-color: rgba(48, 209, 88, 0.4);
581
- opacity: 0.75;
582
- }
583
-
584
- .${i.INBOX_LIST} .${i.INBOX_CARD}--resolved:hover {
585
- border-color: rgba(48, 209, 88, 0.7);
586
- opacity: 1;
587
- }
588
-
589
- .${i.INBOX_CARD_HEADER} {
590
- display: flex;
591
- align-items: center;
592
- justify-content: space-between;
593
- gap: 8px;
594
- }
595
-
596
- /* Labels made the strip wide enough to overflow a narrow card in the
597
- worst case ("In progress" + "Improvement" + "Medium"), so it wraps to
598
- a second line rather than pushing the card sideways. */
599
- .${i.INBOX_CARD_ACTIONS} {
600
- display: flex;
601
- align-items: center;
602
- flex-wrap: wrap;
603
- justify-content: flex-end;
604
- gap: 6px;
605
- }
606
-
607
- .${i.INBOX_ACTION_BTN} {
608
- display: flex;
609
- align-items: center;
610
- justify-content: center;
611
- width: 24px;
612
- height: 24px;
613
- background: transparent;
614
- border: none;
615
- border-radius: 6px;
616
- color: rgba(255,255,255,0.65);
617
- cursor: pointer;
618
- }
619
-
620
- .${i.INBOX_ACTION_BTN}:hover {
621
- background: rgba(255,255,255,0.08);
622
- color: white;
623
- }
624
-
625
- /* Status/type/priority pickers show their current value as text next to
626
- the dot (colour alone can't tell bug/high apart \u2014 same hex, and
627
- there's no hover on touch). The 72px cap they used to carry is gone:
628
- the strip has its own row now, so labels show in full. */
629
- .${i.INBOX_ACTION_BTN_LABELED} {
630
- width: auto;
631
- padding: 0 8px 0 6px;
632
- gap: 5px;
633
- justify-content: flex-start;
634
- flex: none;
635
- }
636
-
637
- .${i.INBOX_ACTION_LABEL} {
638
- font-size: 11px;
639
- line-height: 1;
640
- white-space: nowrap;
641
- }
642
-
643
- .${i.INBOX_STATUS_DOT} {
644
- width: 12px;
645
- height: 12px;
646
- border-radius: 50%;
647
- border: 1.5px solid rgba(255,255,255,0.45);
648
- display: inline-block;
649
- flex: none;
650
- }
651
-
652
- .${i.INBOX_MENU_ITEM} .${i.INBOX_STATUS_DOT} {
653
- width: 9px;
654
- height: 9px;
655
- border: none;
656
- margin-right: 8px;
657
- vertical-align: baseline;
658
- }
659
-
660
- .${i.INBOX_MENU_ITEM}[aria-checked="true"] {
661
- background: rgba(255,255,255,0.08);
662
- }
663
-
664
- /* The action strip on its own row under the author. Shared by the inbox
665
- card and the thread popover so the two read the same; only the
666
- popover needs the extra top padding, since the card's column gap
667
- already spaces it. */
668
- .${i.THREAD_ACTIONS_ROW} {
669
- display: flex;
670
- justify-content: flex-end;
671
- }
672
-
673
- .${i.THREAD_POPOVER} > .${i.THREAD_ACTIONS_ROW} {
674
- padding-top: 8px;
675
- }
676
-
677
- /* Generic hover tooltip, same look as .thread-time[data-full-date] */
678
- [data-hd-tooltip] {
679
- position: relative;
680
- }
681
-
682
- [data-hd-tooltip]::after {
683
- content: attr(data-hd-tooltip);
684
- position: absolute;
685
- bottom: calc(100% + 6px);
686
- left: 50%;
687
- transform: translateX(-50%);
688
- background: #000;
689
- color: white;
690
- padding: 4px 8px;
691
- border-radius: 6px;
692
- font-size: 11px;
693
- white-space: nowrap;
694
- opacity: 0;
695
- pointer-events: none;
696
- transition: opacity 0.12s ease;
697
- z-index: 2;
698
- }
699
-
700
- [data-hd-tooltip]:hover::after {
701
- opacity: 1;
702
- }
703
-
704
- .${i.INBOX_MENU} {
705
- position: absolute;
706
- top: calc(100% + 4px);
707
- right: 0;
708
- background: #2C2C2E;
709
- border: 1px solid rgba(255,255,255,0.1);
710
- border-radius: 8px;
711
- padding: 4px;
712
- min-width: 130px;
713
- z-index: 1;
714
- box-shadow: 0 4px 16px rgba(0,0,0,0.4);
715
- }
716
-
717
- .${i.INBOX_CARD_TEXT} {
718
- white-space: pre-wrap;
719
- word-break: break-word;
720
- }
721
-
722
- .${i.INBOX_CARD_TAG} {
723
- align-self: flex-start;
724
- padding: 1px 8px;
725
- border-radius: 999px;
726
- background: rgba(255, 159, 10, 0.2);
727
- color: #FF9F0A;
728
- font-size: 11px;
729
- font-weight: 600;
730
- }
731
-
732
- .${i.INBOX_BADGES} {
733
- display: flex;
734
- flex-wrap: wrap;
735
- gap: 4px;
736
- }
737
- /* Vertical separation from the card text above only applies to the
738
- badge row on inbox cards -- inside the comment-box classify row,
739
- .inbox-badges is one flex item among the type/priority pickers and
740
- the tags input, and the classify row's own gap already spaces it
741
- from its siblings, so an extra margin here would nudge it out of
742
- alignment with them. */
743
- .${i.INBOX_CARD} .${i.INBOX_BADGES} {
744
- margin-top: 6px;
745
- }
746
- .${i.TOOLTIP} .${i.INBOX_BADGES} {
747
- margin-bottom: 4px;
748
- }
749
- .${i.BADGE} {
750
- display: inline-flex;
751
- align-items: center;
752
- padding: 1px 6px;
753
- border: 1px solid rgba(255, 255, 255, 0.18);
754
- border-radius: 10px;
755
- font-size: 10px;
756
- line-height: 1.6;
757
- letter-spacing: 0.01em;
758
- white-space: nowrap;
759
- }
760
- .${i.BADGE_STATUS},
761
- .${i.BADGE_TYPE},
762
- .${i.BADGE_PRIORITY} {
763
- font-weight: 600;
764
- }
765
- .${i.BADGE_TAG} {
766
- opacity: 0.75;
767
- }
768
- .${i.BADGE_DURATION} {
769
- opacity: 0.75;
770
- border-style: dashed;
771
- }
772
-
773
- .${i.CONTEXT_BLOCK} {
774
- display: flex;
775
- flex-direction: column;
776
- padding: 10px 12px;
777
- border-top: 1px solid rgba(255, 255, 255, 0.08);
778
- font-size: 11px;
779
- }
780
- .${i.CONTEXT_BODY} {
781
- display: flex;
782
- flex-direction: column;
783
- gap: 4px;
784
- }
785
- .${i.CONTEXT_TITLE} {
786
- font-size: 11px;
787
- font-weight: 600;
788
- color: rgba(255,255,255,0.45);
789
- padding-bottom: 4px;
790
- }
791
- /* The popover's collapsed variant. Same weight and colour as the inbox
792
- title so the two surfaces read as the same block. */
793
- .${i.CONTEXT_TOGGLE} {
794
- display: flex;
795
- align-items: center;
796
- justify-content: space-between;
797
- width: 100%;
798
- background: transparent;
799
- border: none;
800
- color: rgba(255,255,255,0.45);
801
- font-size: 11px;
802
- font-weight: 600;
803
- cursor: pointer;
804
- padding: 2px 0;
805
- }
806
- .${i.CONTEXT_TOGGLE}:hover {
807
- color: rgba(255,255,255,0.75);
808
- }
809
- .${i.CONTEXT_TOGGLE} svg {
810
- flex: none;
811
- transition: transform 0.15s ease;
812
- }
813
- .${i.CONTEXT_TOGGLE}[aria-expanded="true"] svg {
814
- transform: rotate(180deg);
815
- }
816
- .${i.CONTEXT_TOGGLE}[aria-expanded="true"] + .${i.CONTEXT_BODY} {
817
- padding-top: 8px;
818
- }
819
- .${i.CONTEXT_BLOCK} img {
820
- width: 100%;
821
- border-radius: 6px;
822
- margin-bottom: 6px;
823
- cursor: zoom-in;
824
- }
825
- .${i.CONTEXT_SCREENSHOT_CAPTION} {
826
- opacity: 0.75;
827
- }
828
- .${i.CONTEXT_ROW} {
829
- display: flex;
830
- justify-content: space-between;
831
- gap: 12px;
832
- opacity: 0.75;
833
- }
834
- /* URLs and user agents have no spaces to break on, so the value column
835
- would otherwise push the row wider than the panel. */
836
- .${i.CONTEXT_ROW} span:last-child {
837
- text-align: right;
838
- word-break: break-all;
839
- }
840
-
841
- .${i.INBOX_CARD_REPLY_LINK} {
842
- align-self: flex-start;
843
- background: transparent;
844
- border: none;
845
- color: rgba(255,255,255,0.55);
846
- font-size: 13px;
847
- cursor: pointer;
848
- padding: 0;
849
- }
850
-
851
- .${i.INBOX_CARD_REPLY_LINK}:hover {
852
- color: white;
853
- }
854
-
855
- .${i.INBOX_REPLIES} {
856
- display: flex;
857
- flex-direction: column;
858
- gap: 10px;
859
- padding: 0 4px;
860
- }
861
-
862
- /* Centred in whatever height the list has, so the state sits in the
863
- middle of the panel rather than clinging to the top. */
864
- /* Sits under the body as a quiet aside: the preview shows the root
865
- comment only, so this says "there is more" without competing with it. */
866
- .${i.TOOLTIP_REPLY_COUNT} {
867
- font-size: 12px;
868
- color: rgba(255,255,255,0.45);
869
- padding-top: 4px;
870
- }
871
-
872
- .${i.INBOX_EMPTY} {
873
- flex: 1;
874
- display: flex;
875
- flex-direction: column;
876
- align-items: center;
877
- justify-content: center;
878
- gap: 10px;
879
- padding: 32px 24px;
880
- color: rgba(255,255,255,0.55);
881
- text-align: center;
882
- }
883
-
884
- /* The marker's own silhouette, drawn as an outline: what the user is
885
- about to place, not a generic placeholder. Same border-radius as
886
- .comment-circle. */
887
- .${i.INBOX_EMPTY_ICON} {
888
- width: 44px;
889
- height: 44px;
890
- margin-bottom: 6px;
891
- border: 2px dashed rgba(255,255,255,0.25);
892
- border-radius: 0% 100% 100% 100%;
893
- flex: none;
894
- }
895
-
896
- .${i.INBOX_EMPTY_TITLE} {
897
- color: white;
898
- font-size: 14px;
899
- font-weight: 600;
900
- }
901
-
902
- .${i.INBOX_EMPTY_TEXT} {
903
- font-size: 13px;
904
- line-height: 1.5;
905
- max-width: 30ch;
906
- }
907
-
908
- .${i.INBOX_EMPTY_KBD} {
909
- font-family: inherit;
910
- font-size: 12px;
911
- font-weight: 500;
912
- color: rgba(255,255,255,0.8);
913
- background: rgba(255,255,255,0.08);
914
- border: 1px solid rgba(255,255,255,0.14);
915
- border-radius: 5px;
916
- padding: 1px 5px;
917
- white-space: nowrap;
918
- }
919
-
920
- .${i.INBOX_EMPTY_ACTION} {
921
- margin-top: 6px;
922
- background: transparent;
923
- border: 1px solid rgba(255,255,255,0.2);
924
- border-radius: 8px;
925
- color: white;
926
- font-size: 13px;
927
- font-weight: 500;
928
- padding: 8px 16px;
929
- cursor: pointer;
930
- transition: background 0.15s, border-color 0.15s;
931
- }
932
-
933
- .${i.INBOX_EMPTY_ACTION}:hover {
934
- background: rgba(255,255,255,0.08);
935
- border-color: rgba(255,255,255,0.35);
936
- }
937
-
938
- .${i.THREAD_HEADER} {
939
- display: flex;
940
- justify-content: space-between;
941
- align-items: center;
942
- padding: 0 0 0;
943
- }
944
-
945
- /* min-width:0 is what lets the author actually shrink: a flex item
946
- defaults to min-content, so without it the name pushes the row wider
947
- instead of truncating. */
948
- .${i.THREAD_META} {
949
- display: flex;
950
- align-items: center;
951
- gap: 6px;
952
- flex: 1;
953
- min-width: 0;
954
- }
955
-
956
- .${i.THREAD_AUTHOR} {
957
- font-weight: 600;
958
- font-size: 13px;
959
- overflow: hidden;
960
- text-overflow: ellipsis;
961
- white-space: nowrap;
962
- }
963
-
964
- .${i.THREAD_TIME} {
965
- font-size: 12px;
966
- color: rgba(255,255,255,0.5);
967
- cursor: default;
968
- position: relative;
969
- flex: none;
970
- }
971
-
972
- .${i.THREAD_TIME}::after {
973
- content: attr(data-full-date);
974
- position: absolute;
975
- bottom: calc(100% + 6px);
976
- left: 50%;
977
- transform: translateX(-50%);
978
- background: #000;
979
- color: white;
980
- padding: 4px 8px;
981
- border-radius: 6px;
982
- font-size: 11px;
983
- white-space: nowrap;
984
- opacity: 0;
985
- pointer-events: none;
986
- transition: opacity 0.15s ease;
987
- z-index: 1;
988
- }
989
-
990
- .${i.THREAD_TIME}:hover::after {
991
- opacity: 1;
992
- }
993
-
994
- .${i.THREAD_BODY} {
995
- padding: 8px 0;
996
- white-space: pre-wrap;
997
- word-break: break-word;
998
- }
999
-
1000
- .${i.THREAD_REPLIES} {
1001
- padding: 0;
1002
- }
1003
-
1004
- .${i.THREAD_REPLIES}:empty {
1005
- display: none;
1006
- }
1007
-
1008
- .${i.THREAD_REPLY} {
1009
- padding: 16px 0 0 0;
1010
- border-top: 1px solid rgba(255,255,255,0.1);
1011
- white-space: pre-wrap;
1012
- word-break: break-word;
1013
- font-size: 13px;
1014
- color: rgba(255,255,255,0.85);
1015
- }
1016
-
1017
- .${i.THREAD_REPLY} .${i.THREAD_META} {
1018
- margin-bottom: 2px;
1019
- }
1020
-
1021
- /* Pushed to the far edge of the reply's meta row, where the same \u22EF sits
1022
- on the comment above it. flex: none keeps it off the author's
1023
- truncation budget. */
1024
- .${i.THREAD_REPLY_ACTIONS} {
1025
- margin-left: auto;
1026
- flex: none;
1027
- }
1028
-
1029
- .${i.THREAD_REPLY} .${i.SCREENSHOT_IMG} {
1030
- width: 144px;
1031
- height: 100px;
1032
- object-fit: cover;
1033
- border-radius: 8px;
1034
- margin-top: 4px;
1035
- cursor: pointer;
1036
- display: block;
1037
- }
1038
-
1039
- .${i.THREAD_INPUT_AREA} {
1040
- display: flex;
1041
- flex-direction: column;
1042
- gap: 0;
1043
- padding: 12px 0 0;
1044
- border-top: 1px solid rgba(255,255,255,0.1);
1045
- }
1046
-
1047
- .${i.THREAD_INPUT} {
1048
- width: 100%;
1049
- background: transparent;
1050
- border: none;
1051
- padding: 0;
1052
- color: white;
1053
- font-size: 14px;
1054
- font-family: inherit;
1055
- outline: none;
1056
- box-sizing: border-box;
1057
- }
1058
-
1059
- .${i.THREAD_INPUT}::placeholder {
1060
- color: rgba(255,255,255,0.5);
1061
- }
1062
-
1063
- .${i.THREAD_INPUT}:focus {
1064
- outline: none;
1065
- box-shadow: none;
1066
- }
1067
-
1068
- .${i.THREAD_SUBMIT} {
1069
- background: none;
1070
- border: none;
1071
- color: #2E90FA;
1072
- cursor: pointer;
1073
- display: flex;
1074
- align-items: center;
1075
- justify-content: center;
1076
- border-radius: 6px;
1077
- transition: background 0.2s;
1078
- }
1079
-
1080
- .${i.THREAD_SUBMIT}:hover {
1081
- background: rgba(46, 144, 250, 0.15);
1082
- color: #1570D6;
1083
- }
1084
-
1085
- .${i.CLOSE_TOOLTIP} {
1086
- background: none;
1087
- border: none;
1088
- font-size: 18px;
1089
- cursor: pointer;
1090
- color: rgba(255,255,255,0.5);
1091
- line-height: 1;
1092
- }
1093
-
1094
- .${i.CLOSE_TOOLTIP}:hover {
1095
- color: white;
1096
- }
1097
-
1098
- .${i.PREVIEW_CIRCLE} {
1099
- animation: helldots-pulse 1.5s ease-in-out infinite;
1100
- }
1101
-
1102
- @keyframes helldots-pulse {
1103
- 0%, 100% { box-shadow: 0 0 0 0 rgba(46, 144, 250, 0.4), 0 1px 5px rgba(0,0,0,0.2); }
1104
- 50% { box-shadow: 0 0 0 8px rgba(46, 144, 250, 0), 0 1px 5px rgba(0,0,0,0.2); }
1105
- }
1106
-
1107
- .${i.COMMENT_OVERLAY} {
1108
- position: fixed;
1109
- top: 0;
1110
- left: 0;
1111
- right: 0;
1112
- bottom: 0;
1113
- background: transparent;
1114
- pointer-events: none;
1115
- z-index: ${O.TOOLBAR-1};
1116
- }
1117
-
1118
- .${i.COMMENT_OVERLAY}.${i.ACTIVE} {
1119
- pointer-events: auto;
1120
- background: rgba(0, 0, 0, 0.1);
1121
- }
1122
-
1123
- .${i.SELECTION_RECT} {
1124
- position: fixed;
1125
- border: 2px solid #2E90FA;
1126
- background: rgba(46, 144, 250, 0.1);
1127
- pointer-events: none;
1128
- z-index: ${O.TOOLTIP};
1129
- box-sizing: border-box;
1130
- }
1131
-
1132
- .${i.SCREENSHOTS_CONTAINER} {
1133
- display: none;
1134
- overflow-x: auto;
1135
- gap: 8px;
1136
- margin-top: 4px;
1137
- padding: 4px 0;
1138
- scrollbar-width: none;
1139
- -ms-overflow-style: none;
1140
- margin-bottom: 8px;
1141
- }
1142
-
1143
- .${i.SCREENSHOTS_CONTAINER}::-webkit-scrollbar {
1144
- display: none;
1145
- }
1146
-
1147
- .${i.SCREENSHOTS_CONTAINER}.${i.ACTIVE} {
1148
- display: flex;
1149
- }
1150
-
1151
- .${i.SCREENSHOT_ITEM} {
1152
- position: relative;
1153
- flex-shrink: 0;
1154
- }
1155
-
1156
- .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG} {
1157
- width: 50px;
1158
- height: 50px;
1159
- object-fit: cover;
1160
- border-radius: 8px;
1161
- cursor: pointer;
1162
- display: block;
1163
- margin: 0;
1164
- }
1165
-
1166
- .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG}:hover {
1167
- opacity: 0.85;
1168
- }
1169
-
1170
- .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_REMOVE} {
1171
- position: absolute;
1172
- top: -5px;
1173
- right: -5px;
1174
- width: 18px;
1175
- height: 18px;
1176
- background: rgba(0,0,0,0.7);
1177
- border: none;
1178
- border-radius: 50%;
1179
- color: white;
1180
- font-size: 12px;
1181
- line-height: 1;
1182
- cursor: pointer;
1183
- display: none;
1184
- align-items: center;
1185
- justify-content: center;
1186
- z-index: 1;
1187
- }
1188
-
1189
- .${i.SCREENSHOT_ITEM}:hover .${i.SCREENSHOT_REMOVE} {
1190
- display: flex;
1191
- }
1192
-
1193
- .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_REMOVE}:hover {
1194
- background: rgba(0,0,0,0.9);
1195
- }
1196
-
1197
- .${i.TOOLTIP} > .${i.SCREENSHOTS_CONTAINER} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG},
1198
- .${i.THREAD_SCROLL} > .${i.SCREENSHOTS_CONTAINER} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG},
1199
- .${i.THREAD_REPLY} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG} {
1200
- width: 144px;
1201
- height: 100px;
1202
- }
1203
-
1204
- .${i.CONFIRM} {
1205
- position: fixed;
1206
- top: 0;
1207
- left: 0;
1208
- right: 0;
1209
- bottom: 0;
1210
- background: rgba(0,0,0,0.6);
1211
- display: flex;
1212
- align-items: center;
1213
- justify-content: center;
1214
- padding: 16px;
1215
- animation: helldots-fade-in 0.15s ease;
1216
- }
1217
-
1218
- .${i.CONFIRM_PANEL} {
1219
- width: min(360px, 100%);
1220
- background: #1C1C1E;
1221
- border: 1px solid rgba(255,255,255,0.1);
1222
- border-radius: 14px;
1223
- box-shadow: 0 8px 32px rgba(0,0,0,0.5);
1224
- padding: 20px;
1225
- color: white;
1226
- font-size: 14px;
1227
- line-height: 1.5;
1228
- box-sizing: border-box;
1229
- }
1230
-
1231
- /* :host { all: initial } does not reach descendants, so the heading and
1232
- paragraph still arrive with UA margins. */
1233
- .${i.CONFIRM_TITLE} {
1234
- margin: 0 0 8px;
1235
- font-size: 15px;
1236
- font-weight: 600;
1237
- }
1238
-
1239
- .${i.CONFIRM_MESSAGE} {
1240
- margin: 0 0 20px;
1241
- font-size: 13px;
1242
- color: rgba(255,255,255,0.65);
1243
- }
1244
-
1245
- .${i.CONFIRM_ACTIONS} {
1246
- display: flex;
1247
- justify-content: flex-end;
1248
- gap: 8px;
1249
- }
1250
-
1251
- .${i.CONFIRM_CANCEL},
1252
- .${i.CONFIRM_ACCEPT} {
1253
- padding: 7px 14px;
1254
- border: 1px solid transparent;
1255
- border-radius: 8px;
1256
- font-size: 13px;
1257
- font-weight: 600;
1258
- cursor: pointer;
1259
- }
1260
-
1261
- /* The one place in the widget with visible focus rings. The dialog traps
1262
- Tab between exactly two buttons, one of them destructive, so a
1263
- keyboard user who cannot see which one is focused is being asked to
1264
- guess. Scoped here on purpose \u2014 see DECISIONS.md; it does not reopen
1265
- the rings that were reverted elsewhere for visual parity. */
1266
- .${i.CONFIRM_CANCEL}:focus-visible,
1267
- .${i.CONFIRM_ACCEPT}:focus-visible {
1268
- outline: 2px solid #2E90FA;
1269
- outline-offset: 2px;
1270
- }
1271
-
1272
- .${i.CONFIRM_CANCEL} {
1273
- background: rgba(255,255,255,0.08);
1274
- border-color: rgba(255,255,255,0.12);
1275
- color: white;
1276
- }
1277
-
1278
- .${i.CONFIRM_CANCEL}:hover {
1279
- background: rgba(255,255,255,0.14);
1280
- }
1281
-
1282
- .${i.CONFIRM_ACCEPT} {
1283
- background: #FF453A;
1284
- color: white;
1285
- }
1286
-
1287
- .${i.CONFIRM_ACCEPT}:hover {
1288
- background: #FF6961;
1289
- }
1290
-
1291
- .${i.LIGHTBOX} {
1292
- position: fixed;
1293
- top: 0;
1294
- left: 0;
1295
- right: 0;
1296
- bottom: 0;
1297
- background: rgba(0,0,0,0.92);
1298
- z-index: ${O.LIGHTBOX};
1299
- display: flex;
1300
- align-items: center;
1301
- justify-content: center;
1302
- animation: helldots-fade-in 0.2s ease;
1303
- }
1304
-
1305
- @keyframes helldots-fade-in {
1306
- from { opacity: 0; }
1307
- to { opacity: 1; }
1308
- }
1309
-
1310
- .${i.LIGHTBOX_IMG} {
1311
- max-width: 90vw;
1312
- max-height: 90vh;
1313
- object-fit: contain;
1314
- border-radius: 8px;
1315
- }
1316
-
1317
- .${i.LIGHTBOX_CLOSE} {
1318
- position: absolute;
1319
- top: 16px;
1320
- right: 16px;
1321
- background: rgba(255,255,255,0.15);
1322
- border: none;
1323
- color: white;
1324
- font-size: 24px;
1325
- width: 40px;
1326
- height: 40px;
1327
- border-radius: 50%;
1328
- cursor: pointer;
1329
- display: flex;
1330
- align-items: center;
1331
- justify-content: center;
1332
- transition: background 0.2s;
1333
- }
1334
-
1335
- .${i.LIGHTBOX_CLOSE}:hover {
1336
- background: rgba(255,255,255,0.3);
1337
- }
1338
- /* --- inline editor --- */
1339
-
1340
- .${i.EDITOR} {
1341
- display: flex;
1342
- flex-direction: column;
1343
- gap: 8px;
1344
- margin: 4px 0 2px;
1345
- }
1346
-
1347
- .${i.EDITOR_INPUT} {
1348
- width: 100%;
1349
- box-sizing: border-box;
1350
- resize: vertical;
1351
- min-height: 60px;
1352
- background: rgba(255,255,255,0.06);
1353
- border: 1px solid rgba(255,255,255,0.14);
1354
- border-radius: 8px;
1355
- padding: 8px 10px;
1356
- color: white;
1357
- font-size: 14px;
1358
- font-family: inherit;
1359
- line-height: 1.45;
1360
- outline: none;${de}
1361
- }
1362
-
1363
- .${i.EDITOR_INPUT}:focus {
1364
- border-color: rgba(46,144,250,0.7);
1365
- }
1366
-
1367
- .${i.EDITOR_ACTIONS} {
1368
- display: flex;
1369
- justify-content: flex-end;
1370
- gap: 8px;
1371
- }
1372
-
1373
- .${i.EDITOR_CANCEL},
1374
- .${i.EDITOR_SAVE} {
1375
- padding: 5px 12px;
1376
- border: 1px solid transparent;
1377
- border-radius: 7px;
1378
- font-size: 13px;
1379
- font-weight: 600;
1380
- font-family: inherit;
1381
- cursor: pointer;
1382
- }
1383
-
1384
- .${i.EDITOR_CANCEL} {
1385
- background: rgba(255,255,255,0.08);
1386
- border-color: rgba(255,255,255,0.12);
1387
- color: white;
1388
- }
1389
-
1390
- .${i.EDITOR_CANCEL}:hover {
1391
- background: rgba(255,255,255,0.14);
1392
- }
1393
-
1394
- .${i.EDITOR_SAVE} {
1395
- background: #2E90FA;
1396
- color: white;
1397
- }
1398
-
1399
- .${i.EDITOR_SAVE}:hover:not(:disabled) {
1400
- background: #57A6FB;
1401
- }
1402
-
1403
- /* Blanking a body is not a way to delete \u2014 the comment would keep its
1404
- marker, its replies and its inbox row while saying nothing. The
1405
- disabled state is carried by more than colour: the cursor changes and
1406
- the control stops responding (WCAG 1.4.1). */
1407
- .${i.EDITOR_SAVE}:disabled {
1408
- background: rgba(255,255,255,0.10);
1409
- color: rgba(255,255,255,0.4);
1410
- cursor: not-allowed;
1411
- }
1412
-
1413
- .${i.THREAD_EDITED} {
1414
- font-size: 12px;
1415
- color: rgba(255,255,255,0.4);
1416
- cursor: default;
1417
- position: relative;
1418
- flex: none;
1419
- }
1420
-
1421
- .${i.THREAD_EDITED}::before {
1422
- content: "\xB7";
1423
- margin-right: 4px;
1424
- }
1425
-
1426
- .${i.THREAD_EDITED}::after {
1427
- content: attr(data-full-date);
1428
- position: absolute;
1429
- bottom: calc(100% + 6px);
1430
- left: 50%;
1431
- transform: translateX(-50%);
1432
- background: #000;
1433
- color: white;
1434
- padding: 4px 8px;
1435
- border-radius: 6px;
1436
- font-size: 11px;
1437
- white-space: nowrap;
1438
- opacity: 0;
1439
- pointer-events: none;
1440
- transition: opacity 0.15s ease;
1441
- }
1442
-
1443
- .${i.THREAD_EDITED}:hover::after {
1444
- opacity: 1;
1445
- }
1446
-
1447
- .${i.INBOX_NOTICE} {
1448
- margin: 0 0 10px;
1449
- padding: 9px 11px;
1450
- border-radius: 8px;
1451
- background: rgba(255,255,255,0.06);
1452
- border: 1px solid rgba(255,255,255,0.12);
1453
- color: rgba(255,255,255,0.75);
1454
- font-size: 13px;
1455
- line-height: 1.4;
1456
- }
1457
- `,St=()=>`
1458
- .${i.COMMENT_CURSOR},
1459
- .${i.COMMENT_CURSOR} * {
1460
- cursor: url('${_t}') ${yt}, auto !important;
1461
- }
1462
-
1463
- `;var I={commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",filterByType:"Type",filterByPriority:"Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var Ot={commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",filterByType:"Tipo",filterByPriority:"Prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var Le={en:I,es:Ot},Be="en";function vt(){let o=(navigator.language||Be).slice(0,2).toLowerCase();return o in Le?o:Be}function At(o){return Le[o]||Le[Be]}function v(o,e){return o.replace("{n}",String(e))}var _n=6e4;function he(o,e){if(!Number.isFinite(o)||o<0)return"";let t=Math.floor(o/_n);if(t<1)return e.durationLessThanMinute;if(t<60)return v(e.minutesAgoTemplate,t);let n=Math.floor(t/60);if(n<24){let l=t%60,c=v(e.hoursAgoTemplate,n);return l?`${c} ${v(e.minutesAgoTemplate,l)}`:c}let s=Math.floor(n/24),r=n%24,a=v(e.daysAgoTemplate,s);return r?`${a} ${v(e.hoursAgoTemplate,r)}`:a}var Pe=64,yn=3,wn=5,Sn=.6,On=.7,vn=/^(css|sc|jsx|emotion)-/i,An=/^data-(reactid|react-|v-|svelte-)/,Nn=["id","name","role","aria-label"],Rn=["data-testid","name","aria-label"],De=o=>typeof CSS<"u"&&CSS.escape?CSS.escape(o):String(o).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),In=o=>String(o).replace(/["\\]/g,"\\$&"),Z=(o,e)=>{try{return e.querySelectorAll(o).length===1}catch{return!1}},It=o=>(o||"").replace(/\s+/g," ").trim().slice(0,Pe),Ln=o=>Tt.includes(o)||vn.test(o)?!1:!o.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),Bn=o=>[...o.classList].filter(Ln),Pn=o=>{let e={};for(let{name:t,value:n}of o.attributes)(Nn.includes(t)||t.startsWith("data-")&&!An.test(t))&&n&&(e[t]=n.slice(0,Pe));return e},Me=o=>{let e=o.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(n=>n.tagName===o.tagName);return{index:t.indexOf(o),count:t.length}},Dn=(o,e)=>{if(!o.id)return null;let t=`#${De(o.id)}`;return Z(t,e)?t:null},Mn=(o,e)=>{let t=o.tagName.toLowerCase();for(let n of Rn){let s=o.getAttribute(n);if(!s)continue;let r=`${t}[${n}="${In(s)}"]`;if(Z(r,e))return r}return null},$n=(o,e)=>{let t=[],n=o;for(let s=0;s<yn&&n;s++){let r=Bn(n),a=n.tagName.toLowerCase();if(t.unshift(r.length?`${a}.${r.map(De).join(".")}`:a),s===0&&!r.length)return null;let l=t.join(" > ");if(Z(l,e))return l;n=n.parentElement}return null},kn=(o,e)=>{if(o===e.body)return"body";let t=[],n=o;for(let r=0;r<wn&&n;r++){if(n===e.body){t.unshift("body");break}if(n.id){let l=[`#${De(n.id)}`,...t].join(" > ");if(Z(l,e))return l}let{index:a}=Me(n);t.unshift(`${n.tagName.toLowerCase()}:nth-of-type(${a+1})`),n=n.parentElement}let s=t.join(" > ");return Z(s,e)?s:null},Lt=(o,e)=>Dn(o,e)||Mn(o,e)||$n(o,e)||kn(o,e);function Bt(o){return Lt(o,o.ownerDocument)}function Pt(o,e,t){let n=o.ownerDocument,{index:s,count:r}=Me(o);return{version:1,selector:Lt(o,n),fingerprint:{tagName:o.tagName,textSnippet:It(o.textContent),attributes:Pn(o),siblingIndex:s,siblingCount:r},relativeX:e,relativeY:t}}var Hn=(o,e)=>{if(!o&&!e)return 1;if(!o||!e)return 0;if(o===e)return 1;if(o.startsWith(e)||e.startsWith(o))return .8;let t=new Set(o.split(" ")),n=new Set(e.split(" ")),s=0;for(let r of t)n.has(r)&&s++;return 2*s/(t.size+n.size)},Xn=(o,e)=>{let t=Object.keys(e);if(!t.length)return 1;let n=0;for(let s of t)(o.getAttribute(s)||"").slice(0,Pe)===e[s]&&n++;return n/t.length},Nt=(o,e)=>{let{index:t,count:n}=Me(o),s=Math.abs(t-e.siblingIndex),r=Math.max(e.siblingCount,n,1);return Math.max(0,1-s/r)},Fn=(o,e)=>{if(o.tagName!==e.tagName)return 0;let t=!!e.textSnippet,n=Object.keys(e.attributes||{}).length>0,s=.5,r=.3,a=.2;return n?t||(r+=s,s=0):(s+=r,r=0),!t&&!n?Nt(o,e):s*Hn(It(o.textContent),e.textSnippet)+r*Xn(o,e.attributes||{})+a*Nt(o,e)},Rt=(o,e)=>{let t=null;for(let n of o){let s=Fn(n,e);(!t||s>t.confidence)&&(t={element:n,confidence:s})}return t};function Dt(o,e=document){let t=o?.fingerprint;if(!t||!t.tagName)return null;if(o.selector){let a=[];try{a=[...e.querySelectorAll(o.selector)]}catch{}let l=Rt(a,t);if(l&&l.confidence>=Sn)return l}if(!(!!t.textSnippet||Object.keys(t.attributes||{}).length>0))return null;let s;try{s=[...e.querySelectorAll(t.tagName)]}catch{return null}let r=Rt(s,t);return r&&r.confidence>=On?r:null}var $t="helldots-comments",pe="helldots-pending-detail";function ue(){try{let o=localStorage.getItem($t);if(!o)return[];let e=JSON.parse(o);return Array.isArray(e)?e:[]}catch(o){return console.warn("HellDots: could not read stored comments",o),[]}}function Mt(o){try{return localStorage.setItem($t,JSON.stringify(o)),!0}catch{return!1}}function $e(o){if(Mt(o))return!0;let e=o.map((s,r)=>({comment:s,index:r})).filter(({comment:s})=>s?.contextScreenshot).sort((s,r)=>{let a=Date.parse(s.comment.createdAt),l=Date.parse(r.comment.createdAt);return Number.isFinite(a)&&Number.isFinite(l)&&a!==l?a-l:s.index-r.index});if(e.length===0)return console.warn("HellDots: could not persist comments (storage quota exceeded, nothing left to shed)"),!1;let t=[...o],n=0;for(let{index:s}of e)if(t[s]={...t[s],contextScreenshot:null},n++,Mt(t))return console.warn(`HellDots: localStorage quota exceeded \u2014 dropped the automatic context screenshot from the ${n} oldest comment(s) to keep all comments persisted. Comment text, replies and user-attached screenshots were not touched.`),!0;return console.warn(`HellDots: could not persist comments even after dropping all ${n} automatic context screenshot(s); storage quota exceeded`),!1}function ke(o,e,t){let n=new Set(e.map(r=>r.id));return[...o.filter(r=>!n.has(r.id)&&r.page!==t),...e]}var kt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ht=(o=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(o|=0));for(;o--;)e+=kt[t[o]&63];return e};var He=()=>Ht();var me="helldotsComment",J=(o,e=me,t=location.href)=>{let n=new URL(t),s=o.page||n.pathname,r=s===n.pathname?n:new URL(s,n);return r.searchParams.set(e,String(o.id)),r.href},Xt=(o=me,e=location.href)=>{try{return new URL(e).searchParams.get(o)}catch{return null}};var Q=new Set,X=null,Ft=(o,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(o)||o.contains(e.target),Un=()=>{X||(X=o=>{for(let e of[...Q])Ft(e.menu,o)||Ft(e.button,o)||e.close()},document.addEventListener("mousedown",X,!0))},Vn=()=>{X&&(document.removeEventListener("mousedown",X,!0),X=null)},ge=()=>{for(let o of[...Q])o.close()},ee=(o,e)=>{let t={button:o,menu:e,close:()=>{e.style.display="none",o.setAttribute("aria-expanded","false"),Q.delete(t),Q.size===0&&Vn()}},n=()=>{ge(),e.style.display="block",o.setAttribute("aria-expanded","true"),Q.add(t),Un()},s=()=>e.style.display!=="none";return e.style.display="none",o.setAttribute("aria-expanded","false"),o.addEventListener("click",r=>{r.stopPropagation();let a=s();ge(),a||n()}),{open:n,close:t.close,isOpen:s}};var Xe=new Set,Ut=()=>{for(let o of[...Xe])o(!1)},fe=(o,{title:e,message:t,confirmLabel:n,cancelLabel:s})=>new Promise(r=>{let a=document.createElement("div");a.className=i.CONFIRM,a.style.zIndex=String(O.CONFIRM);let l=document.createElement("div");l.className=i.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=i.CONFIRM_TITLE,c.textContent=e,c.id=`hd-confirm-title-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-labelledby",c.id);let h=document.createElement("p");h.className=i.CONFIRM_MESSAGE,h.textContent=t;let d=document.createElement("div");d.className=i.CONFIRM_ACTIONS;let p=document.createElement("button");p.type="button",p.className=i.CONFIRM_CANCEL,p.textContent=s;let m=document.createElement("button");m.type="button",m.className=i.CONFIRM_ACCEPT,m.textContent=n,d.appendChild(p),d.appendChild(m),l.appendChild(c),l.appendChild(h),l.appendChild(d),a.appendChild(l);let u=o.activeElement||document.activeElement,g=!1,f=E=>{g||(g=!0,Xe.delete(f),document.removeEventListener("keydown",b,!0),a.remove(),u?.focus?.(),r(E))},b=E=>{if(E.key==="Escape"){E.stopPropagation(),E.preventDefault(),f(!1);return}if(E.key!=="Tab")return;let T=[p,m],w=o.activeElement||document.activeElement,_=T.indexOf(w);E.preventDefault(),(E.shiftKey?T[(_<=0?T.length:_)-1]:T[(_+1)%T.length]).focus()};p.addEventListener("click",()=>f(!1)),m.addEventListener("click",()=>f(!0));let C=!1;a.addEventListener("mousedown",E=>{C=E.target===a,E.stopPropagation()}),a.addEventListener("click",E=>{E.target===a&&C&&f(!1),C=!1}),Xe.add(f),document.addEventListener("keydown",b,!0),(o.body||o).appendChild(a),p.focus()});var Vt='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',Gn='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',zn='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></svg>',U=o=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(o).catch(()=>{});let e=document.createElement("textarea");e.value=o,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},V=(o,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,resolved:e.statusResolved})[o]||e.statusOpen,M=(o,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[o]||e.unset,$=(o,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[o]||e.unset,F=({action:o,options:e,value:t,colorOf:n,labelOf:s,tooltipLabel:r,onSelect:a,showLabel:l=!1})=>{let c=document.createElement("div");c.style.position="relative";let h=document.createElement("button");h.type="button",h.className=i.INBOX_ACTION_BTN,l&&h.classList.add(i.INBOX_ACTION_BTN_LABELED),h.dataset.action=o,h.setAttribute("aria-haspopup","true");let d=document.createElement("span");d.className=i.INBOX_STATUS_DOT,h.appendChild(d);let p=null;l&&(p=document.createElement("span"),p.className=i.INBOX_ACTION_LABEL,h.appendChild(p));let m=document.createElement("div");m.className=i.INBOX_MENU,m.setAttribute("role","menu");let u=ee(h,m),g=t,f=()=>{let b=`${r}: ${s(g)}`;d.style.backgroundColor=n(g),h.dataset.hdTooltip=b,h.setAttribute("aria-label",b),p&&(p.textContent=s(g)),m.querySelectorAll("[data-picker-option]").forEach(C=>{let x=C.dataset.pickerOption,E=x===""?null:x;C.setAttribute("aria-checked",String(E===g))})};for(let b of e){let C=document.createElement("button");C.type="button",C.className=i.INBOX_MENU_ITEM,C.dataset.pickerOption=b===null?"":b,C.setAttribute("role","menuitemradio");let x=document.createElement("span");x.className=i.INBOX_STATUS_DOT,x.style.backgroundColor=n(b),C.appendChild(x),C.appendChild(document.createTextNode(s(b))),C.addEventListener("click",E=>{E.stopPropagation(),u.close(),b!==g&&(g=b,a(b),f())}),m.appendChild(C)}return c.appendChild(h),c.appendChild(m),f(),c},Fe=({label:o,tooltip:e,items:t})=>{let n=document.createElement("div");n.style.position="relative";let s=document.createElement("button");s.type="button",s.className=i.INBOX_ACTION_BTN,s.dataset.action="menu",e&&(s.dataset.hdTooltip=e),s.setAttribute("aria-label",o),s.innerHTML=zn;let r=document.createElement("div");r.className=i.INBOX_MENU,r.setAttribute("role","menu");let a=ee(s,r);for(let l of t){let c=document.createElement("button");c.type="button",c.className=i.INBOX_MENU_ITEM,c.setAttribute("role","menuitem"),c.textContent=l.label,c.addEventListener("click",async h=>{if(h.stopPropagation(),l.feedbackLabel){l.onSelect(),c.textContent=l.feedbackLabel,setTimeout(()=>{c.textContent=l.label,a.close()},1200);return}if(a.close(),l.confirm){let d=c.getRootNode();if(!await fe(d,l.confirm()))return}l.onSelect()}),r.appendChild(c)}return n.appendChild(s),n.appendChild(r),n},Ee=(o,{strings:e,onCopy:t,onCopyLink:n,onEdit:s,onSetStatus:r,onSetType:a,onSetPriority:l,onDelete:c})=>{let h=document.createElement("div");h.className=i.INBOX_CARD_ACTIONS;let d=document.createElement("button");return d.type="button",d.className=i.INBOX_ACTION_BTN,d.dataset.action="copy",d.dataset.hdTooltip=e.copyAgentContext,d.setAttribute("aria-label",e.copyAgentContext),d.innerHTML=Vt,d.addEventListener("click",p=>{p.stopPropagation(),t(o),d.innerHTML=Gn,d.dataset.hdTooltip=e.copied,setTimeout(()=>{d.innerHTML=Vt,d.dataset.hdTooltip=e.copyAgentContext},1500)}),h.appendChild(d),h.appendChild(F({action:"status",options:D,value:o.status||"open",colorOf:p=>ce[p]||"",labelOf:p=>V(p,e),tooltipLabel:e.statusLabel,onSelect:p=>r(o,p),showLabel:!0})),h.appendChild(F({action:"type",options:[null,...N],value:o.type||null,colorOf:p=>q[p]||"transparent",labelOf:p=>M(p,e),tooltipLabel:e.typeLabel,onSelect:p=>a?.(o,p),showLabel:!0})),h.appendChild(F({action:"priority",options:[null,...R],value:o.priority||null,colorOf:p=>K[p]||"transparent",labelOf:p=>$(p,e),tooltipLabel:e.priorityLabel,onSelect:p=>l?.(o,p),showLabel:!0})),h.appendChild(Fe({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>n?.(o)},{label:e.editComment,onSelect:()=>s?.(o)},{label:e.deleteComment,onSelect:()=>c(o),confirm:()=>({title:e.confirmDeleteCommentTitle,message:o.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),h};var G=({value:o,strings:e,onInput:t,onSave:n,onCancel:s})=>{let r=document.createElement("div");r.className=i.EDITOR;let a=document.createElement("textarea");a.className=i.EDITOR_INPUT,a.value=o,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=i.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=i.EDITOR_CANCEL,c.textContent=e.editCancel;let h=document.createElement("button");h.type="button",h.className=i.EDITOR_SAVE,h.textContent=e.editSave;let d=()=>{h.disabled=a.value.trim().length===0};return d(),a.addEventListener("input",()=>{d(),t(a.value)}),a.addEventListener("keydown",p=>{if(p.key==="Escape"){p.stopPropagation(),p.preventDefault(),s();return}p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&!h.disabled&&(p.preventDefault(),n(a.value))}),c.addEventListener("click",p=>{p.stopPropagation(),s()}),h.addEventListener("click",p=>{p.stopPropagation(),h.disabled||n(a.value)}),l.appendChild(c),l.appendChild(h),r.appendChild(a),r.appendChild(l),queueMicrotask(()=>{a.focus(),a.setSelectionRange(a.value.length,a.value.length)}),r},be=(o,e)=>fe(o,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var Yn=(o,e)=>{let t=Date.now()-new Date(o).getTime(),n=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return n<1?e.justNow:n<60?v(e.minutesAgoTemplate,n):s<24?v(e.hoursAgoTemplate,s):v(e.daysAgoTemplate,r)},zt=(o,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(o)),te=(o,e,t,n,s=null)=>{let r=document.createElement("div");r.className=i.THREAD_META;let a=document.createElement("span");a.className=i.THREAD_AUTHOR,a.textContent=o||t.anonymous;let l=document.createElement("span");return l.className=i.THREAD_TIME,l.textContent=Yn(e,t),l.dataset.fullDate=zt(e,n),r.appendChild(a),r.appendChild(l),s&&r.appendChild(Ue(s,t,n)),r},Ue=(o,e,t)=>{let n=document.createElement("span");return n.className=i.THREAD_EDITED,n.textContent=e.editedMark,n.dataset.fullDate=e.editedAtPrefix+zt(o,t),n},Ve=(o,e)=>{let t=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),n={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:"\u21E7"},s=n[o.shortcutModifier]||n.alt,r=o.shortcutKey?.toUpperCase()||"C";return`${s} + ${r}`},Wn='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',jn='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2L15 22L11 13M11 13L2 9L22 2"/></svg>',qn='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.8914 10.4028L2.98327 10.6318C3.22909 11.2445 3.5 12.1045 3.5 13C3.5 13.3588 3.4564 13.7131 3.38773 14.0495C3.69637 13.9446 4.01409 13.8159 4.32918 13.6584C4.87888 13.3835 5.33961 13.0611 5.70994 12.7521L6.22471 12.3226L6.88809 12.4196C7.24851 12.4724 7.61994 12.5 8 12.5C11.7843 12.5 14.5 9.85569 14.5 7C14.5 4.14431 11.7843 1.5 8 1.5C4.21574 1.5 1.5 4.14431 1.5 7C1.5 8.18175 1.94229 9.29322 2.73103 10.2153L2.8914 10.4028ZM2.8135 15.7653C1.76096 16 1 16 1 16C1 16 1.43322 15.3097 1.72937 14.4367C1.88317 13.9834 2 13.4808 2 13C2 12.3826 1.80733 11.7292 1.59114 11.1903C0.591845 10.0221 0 8.57152 0 7C0 3.13401 3.58172 0 8 0C12.4183 0 16 3.13401 16 7C16 10.866 12.4183 14 8 14C7.54721 14 7.10321 13.9671 6.67094 13.9038C6.22579 14.2753 5.66881 14.6656 5 15C4.23366 15.3832 3.46733 15.6195 2.8135 15.7653Z"/></svg>',Kn='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.67705 7.5L3.92705 3H12.0729L14.3229 7.5H10H9.25V8.25C9.25 8.94036 8.69036 9.5 8 9.5C7.30964 9.5 6.75 8.94036 6.75 8.25V7.5H6H1.67705ZM1.5 9V12C1.5 12.5523 1.94772 13 2.5 13H13.5C14.0523 13 14.5 12.5523 14.5 12V9H10.6465C10.32 10.1543 9.25878 11 8 11C6.74122 11 5.67998 10.1543 5.35352 9H1.5ZM3 1.5H13L15.8944 7.28885C15.9639 7.42771 16 7.58082 16 7.73607V12C16 13.3807 14.8807 14.5 13.5 14.5H2.5C1.11929 14.5 0 13.3807 0 12V7.73607C0 7.58082 0.0361451 7.42771 0.105573 7.28885L3 1.5Z"/></svg>',Ce=({areaClassName:o,inputTag:e="textarea",inputClassName:t,inputId:n,inputPlaceholder:s,submitBtnId:r,fileInputId:a},l)=>{let c=document.createElement("div");c.className=o;let h=document.createElement(e);n&&(h.id=n),t&&(h.className=t),h.placeholder=s,h.setAttribute("aria-label",s),e==="input"&&(h.type="text");let d=document.createElement("div");d.className=i.SCREENSHOTS_CONTAINER;let p=document.createElement("div");p.className=i.COMMENT_ACTIONS_BAR;let m=document.createElement("button");m.className=i.ATTACH_IMAGE_BTN,m.type="button",m.setAttribute("aria-label",l.attachImage),m.innerHTML=Wn;let u=document.createElement("input");u.type="file",a&&(u.id=a),u.accept="image/*",u.style.display="none";let g=document.createElement("button");return r&&(g.id=r),g.className=i.THREAD_SUBMIT,g.type="button",g.setAttribute("aria-label",l.send),g.innerHTML=jn,p.appendChild(m),p.appendChild(u),p.appendChild(g),c.appendChild(h),c.appendChild(d),c.appendChild(p),{container:c,inputEl:h,screenshotsContainer:d,attachBtn:m,fileInput:u,submitBtn:g}},Gt=(o,e,t,n)=>{let s=document.createElement("div");s.className=i.TOOLBAR_ACTION_WRAPPER;let r=document.createElement("div");r.className=i.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>r.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${i.TOOLBAR_ACTION_BTN} ${o}`,a.setAttribute("aria-label",n),a.innerHTML=e,s.appendChild(r),s.appendChild(a),s},Yt=(o={},e=I)=>{let t=document.createElement("div");t.id=y.TOOLBAR;let n=document.createElement("div");n.className=i.TOOLBAR_ACTIONS;let s=document.createElement("span");s.className=i.TOOLBAR_TEXT,s.textContent=e.toolbarComment;let r=document.createElement("span");r.className=i.SHORTCUT_HINT,r.textContent=Ve(o,e);let a=Gt(i.TOOLBAR_COMMENT_BTN,qn,[s,r],e.toolbarComment);a.querySelector(`.${i.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=i.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=Gt(i.TOOLBAR_MENU_BTN,Kn,[l],e.toolbarInbox);return n.appendChild(a),n.appendChild(c),t.appendChild(n),t},Ge=(o,e,{includeStatus:t=!1,includeClassification:n=!0}={})=>{let s=document.createElement("div");s.className=i.INBOX_BADGES;let r=(a,l,c)=>{let h=document.createElement("span");h.className=`${i.BADGE} ${l}`,h.textContent=a,c&&(h.style.borderColor=c),s.appendChild(h)};if(t){let a=o.status||"open";r(V(a,e),i.BADGE_STATUS,ce[a])}n&&o.type&&r(M(o.type,e),i.BADGE_TYPE,q[o.type]),n&&o.priority&&r($(o.priority,e),i.BADGE_PRIORITY,K[o.priority]);for(let a of o.tags||[])r(a,i.BADGE_TAG,null);if(o.status==="resolved"){let a=o.resolvedAt?he(new Date(o.resolvedAt).getTime()-new Date(o.createdAt).getTime(),e):"";r(v(e.resolvedInTemplate,a||"\u2014"),i.BADGE_DURATION,null)}return s.children.length?s:null},Zn=o=>{let e=document.createElement("div");e.className=i.CLASSIFY_ROW;let t=null,n=null,s=()=>{e.replaceChildren(),e.appendChild(F({action:"type",options:[null,...N],value:null,colorOf:r=>q[r]||"transparent",labelOf:r=>M(r,o),tooltipLabel:o.typeLabel,onSelect:r=>t=r,showLabel:!0})),e.appendChild(F({action:"priority",options:[null,...R],value:null,colorOf:r=>K[r]||"transparent",labelOf:r=>$(r,o),tooltipLabel:o.priorityLabel,onSelect:r=>n=r,showLabel:!0}))};return s(),{container:e,getType:()=>t,getPriority:()=>n,reset:()=>{t=null,n=null,s()}}},Wt=(o=I)=>{let e=document.createElement("div");e.id=y.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",o.commentBoxAriaLabel);let{container:t}=Ce({areaClassName:i.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:y.COMMENT_INPUT,inputPlaceholder:o.commentPlaceholder,submitBtnId:y.SUBMIT_COMMENT,fileInputId:y.ATTACH_IMAGE_INPUT},o),n=Zn(o);return e.appendChild(n.container),e.appendChild(t),e.style.display="none",e.classify=n,e},jt=(o,e=I)=>{let t=document.createElement("div");return t.className=i.CIRCLE,t.dataset.commentId=o.id,t.dataset.commentText=o.text,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${o.text}`),t.style.cssText=`
1464
- position: absolute;
1465
- pointer-events: auto;
1466
- `,t},oe=(o,e)=>{let t=document.createElement("div");return t.className=i.SCREENSHOTS_CONTAINER,t.classList.add(i.ACTIVE),o.forEach(n=>{let s=document.createElement("div");s.className=i.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=i.SCREENSHOT_IMG,r.src=n,r.alt=e.attachedScreenshot,s.appendChild(r),t.appendChild(s)}),t},qt=(o,e=I,t)=>{let n=document.createElement("div");n.className=i.TOOLTIP,n.dataset.for=o.id,n.setAttribute("role","dialog"),n.setAttribute("aria-label",e.tooltipAriaLabel);let s=document.createElement("div");s.className=i.THREAD_HEADER;let r=te(o.author,o.createdAt,e,t,o.editedAt),a=document.createElement("button");a.type="button",a.className=i.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="&times;",s.appendChild(r),s.appendChild(a);let l=document.createElement("div");l.className=i.THREAD_BODY,l.textContent=o.text,n.appendChild(s),n.appendChild(l);let c=Ge(o,e,{includeStatus:!0});c&&n.appendChild(c);let h=o.screenshots||(o.screenshot?[o.screenshot]:[]);h.length>0&&n.appendChild(oe(h,e));let d=o.replies?.length||0;if(d>0){let p=document.createElement("div");p.className=i.TOOLTIP_REPLY_COUNT,p.textContent=d===1?e.replyCountOne:v(e.replyCountTemplate,d),n.appendChild(p)}return n},ne=(o,e=I,t,{onDelete:n,onEdit:s,editing:r=null}={})=>{let a=document.createElement("div");a.className=i.THREAD_REPLY,a.dataset.replyId=String(o.id);let l=te(o.author,o.timestamp,e,t,o.editedAt),c=[];if(s&&c.push({label:e.editReply,onSelect:()=>s(o)}),n&&c.push({label:e.deleteReply,onSelect:()=>n(o,a),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}),c.length>0){let p=Fe({label:e.replyOptions,items:c});p.classList.add(i.THREAD_REPLY_ACTIONS),l.appendChild(p)}let h;r?h=G({value:r.draft,strings:e,onInput:r.onInput,onSave:r.onSave,onCancel:r.onCancel}):(h=document.createElement("div"),h.className=i.THREAD_BODY,h.textContent=o.text),a.appendChild(l),a.appendChild(h);let d=o.screenshots||(o.screenshot?[o.screenshot]:[]);return d.length>0&&a.appendChild(oe(d,e)),a},Kt=(o,e=I,t,{onDeleteReply:n,onEditReply:s}={})=>{let r=document.createElement("div");r.className=i.THREAD_POPOVER,r.dataset.for=o.id,r.setAttribute("role","dialog"),r.setAttribute("aria-label",e.popoverAriaLabel);let a=document.createElement("div");a.className=i.THREAD_HEADER;let l=te(o.author,o.createdAt,e,t,o.editedAt),c=document.createElement("button");c.type="button",c.className=i.CLOSE_TOOLTIP,c.setAttribute("aria-label",e.close),c.innerHTML="&times;",a.appendChild(l),a.appendChild(c);let h=document.createElement("div");h.className=i.THREAD_BODY,h.textContent=o.text;let d=document.createElement("div");d.className=i.THREAD_REPLIES,o.replies&&o.replies.forEach(g=>{d.appendChild(ne(g,e,t,{onDelete:n,onEdit:s}))});let{container:p}=Ce({areaClassName:i.THREAD_INPUT_AREA,inputTag:"input",inputClassName:i.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=i.THREAD_SCROLL,r.appendChild(a),m.appendChild(h);let u=o.screenshots||(o.screenshot?[o.screenshot]:[]);return u.length>0&&m.appendChild(oe(u,e)),m.appendChild(d),r.appendChild(m),r.appendChild(p),r};var Jn=o=>{let e=[...o.attributes].map(({name:t,value:n})=>`${t}="${n}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},Qn=o=>{if(!o?.tagName)return"(unknown)";let e=Object.entries(o.attributes||{}).map(([t,n])=>`${t}="${n}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},ei=o=>{let e=[],t=o;for(;t&&t!==document.documentElement;){let n=t.tagName.toLowerCase(),s=t.id?`#${t.id}`:"",r=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${n}${s}${r}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function Te(o,{viewportWidth:e,viewportHeight:t,strings:n}){let s=o.anchor,r=s?.fingerprint,a=o.container?.isConnected?o.container:null,l=o.hidden?"hidden":o.anchorState,c=a?Jn(a):Qn(r),h=a?ei(a):"(unavailable)",d=o.context?.viewport,p=d?.width??e,m=d?.height??t,u=[`Page: ${o.page}`,`Viewport: ${p}x${m}`,`Anchor state: ${l}`,`Status: ${o.status||"open"}`,`Selector: ${s?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${h}`,`Nearby text: "${r?.textSnippet??""}"`,`Comment by ${o.author} (${o.createdAt}):`,`"${o.text}"`];o.type&&u.push(`Type: ${o.type}`),o.priority&&u.push(`Priority: ${o.priority}`),o.tags?.length&&u.push(`Tags: ${o.tags.join(", ")}`);let g=o.context;if(g&&(g.url&&u.push(`URL: ${g.url}`),g.screen&&u.push(`Screen: ${g.screen.width}x${g.screen.height}`),g.browser?.name&&u.push(`Browser: ${`${g.browser.name} ${g.browser.version||""}`.trim()}`),g.os?.name&&u.push(`OS: ${`${g.os.name} ${g.os.version||""}`.trim()}`)),n&&o.status==="resolved"&&o.resolvedAt){let b=he(new Date(o.resolvedAt).getTime()-new Date(o.createdAt).getTime(),n);b&&u.push(`Resolution time: ${b}`)}let f=o.replies||[];if(f.length>0){u.push(`Replies (${f.length}):`);for(let b of f)u.push(`- ${b.author}: "${b.text}"`)}return u.join(`
1467
- `)}var ti='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',xe=(o,{strings:e,onShowLightbox:t,collapsible:n=!1})=>{let{context:s,contextScreenshot:r}=o;if(!s&&!r)return null;let a=document.createElement("div");a.className=i.CONTEXT_BLOCK;let l=document.createElement("div");if(l.className=i.CONTEXT_BODY,n){let c=document.createElement("button");c.type="button",c.className=i.CONTEXT_TOGGLE,c.setAttribute("aria-expanded","false"),c.innerHTML=`<span>${e.contextSection}</span>${ti}`,l.style.display="none",c.addEventListener("click",h=>{h.stopPropagation();let d=c.getAttribute("aria-expanded")==="true";c.setAttribute("aria-expanded",String(!d)),l.style.display=d?"none":""}),a.appendChild(c)}else{let c=document.createElement("div");c.className=i.CONTEXT_TITLE,c.textContent=e.contextSection,a.appendChild(c)}if(r){let c=document.createElement("div");c.className=i.CONTEXT_SCREENSHOT_CAPTION,c.textContent=e.autoScreenshotLabel,l.appendChild(c);let h=document.createElement("img");h.className=i.SCREENSHOT_IMG,h.src=r,h.alt=e.autoScreenshotLabel,h.addEventListener("click",d=>{d.stopPropagation(),t(r)}),l.appendChild(h)}if(s){let c=(p,m)=>{if(!m)return;let u=document.createElement("div");u.className=i.CONTEXT_ROW;let g=document.createElement("span");g.textContent=p;let f=document.createElement("span");f.textContent=m,u.appendChild(g),u.appendChild(f),l.appendChild(u)},h=p=>p?`${p.width}\xD7${p.height}`:"",d=p=>p?.name?`${p.name} ${p.version||""}`.trim():"";c(e.contextUrl,s.url),c(e.contextViewport,h(s.viewport)),c(e.contextScreen,h(s.screen)),c(e.contextBrowser,d(s.browser)),c(e.contextOs,d(s.os))}return a.appendChild(l),a};var oi='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',ni='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',ii='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="18 15 12 9 6 15"/></svg>',ri='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',_e=class{constructor({shadowRoot:e,strings:t,locale:n,currentPage:s,getComments:r,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=n,this.currentPage=s,this.getComments=r,this.callbacks=a,this.options=l,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.editing=null,this.notice=null,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=i.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.shadowRoot.appendChild(this.el),this.render())}close(){this._clearHighlight(),this._setActiveMarker(null),this.el?.remove(),this.el=null,this.detailId=null,this.editing=null,this.notice=null}refresh(){this.el&&this.render()}showNotice(e){this.notice=e,this.refresh()}clearNotice(){this.notice&&(this.notice=null,this.refresh())}isDirty(){return this.editing?this.editing.draft.trim()!==this._editingOriginalText().trim():!1}_editingOriginalText(){if(!this.editing)return"";let e=this.getComments().find(n=>String(n.id)===String(this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(n=>String(n.id)===String(this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await be(e,this.strings))return!1}return this.editing=null,!0}_editorHandlers(){return{draft:this.editing.draft,onInput:e=>{this.editing.draft=e},onSave:e=>{let{commentId:t,replyId:n}=this.editing;n==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,n,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return G({value:e.draft,strings:this.strings,onInput:e.onInput,onSave:e.onSave,onCancel:e.onCancel})}async startEditing(e,t=null){await this.releaseEditor()&&(this.detailId=e,this.editing={commentId:e,replyId:t,draft:""},this.editing.draft=this._editingOriginalText(),this.render())}_markerFor(e){return e.anchorState!=="anchored"||e.hidden||e.status==="resolved"?null:this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`)}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(i.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(i.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(i.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(i.CIRCLE_ACTIVE),this._activeMarkerEl=t)}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter!=="all"&&(e=e.filter(t=>(t.status||"open")===this.statusFilter)),this.typeFilter!=="all"&&(e=e.filter(t=>t.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(t=>t.priority===this.priorityFilter)),[...e.filter(t=>t.status!=="resolved"),...e.filter(t=>t.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight(),this.el.innerHTML="";let e=this.filteredComments(),t=this.detailId!=null?e.find(n=>n.id===this.detailId):null;this._setActiveMarker(t),t?this._renderDetail(t,e):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(n=>n.id===e);t&&this._openDetail(t)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render()}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=i.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="&times;",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_renderList(e){let t=document.createElement("div");t.className=i.INBOX_HEADER,t.appendChild(this._buildFilter()),t.appendChild(this._closeButton()),this.el.appendChild(t);let n=document.createElement("div");if(n.className=i.INBOX_LIST,this.el.appendChild(n),this.notice){let s=document.createElement("div");s.className=i.INBOX_NOTICE,s.setAttribute("role","status"),s.textContent=this.notice,n.appendChild(s)}if(e.length===0){n.appendChild(this._buildEmptyState());return}for(let s of e)n.appendChild(this._buildCard(s,{interactive:!0}))}_buildEmptyState(){let e=document.createElement("div");e.className=i.INBOX_EMPTY;let t=document.createElement("div");t.className=i.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let n=this.getComments().length>0,s=document.createElement("div");if(s.className=i.INBOX_EMPTY_TITLE,s.textContent=n?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(s),n){let d=document.createElement("button");return d.type="button",d.className=i.INBOX_EMPTY_ACTION,d.textContent=this.strings.filterClear,d.addEventListener("click",()=>{this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}),e.appendChild(d),e}let r=document.createElement("div");r.className=i.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=i.INBOX_EMPTY_KBD,c.textContent=Ve(this.options,this.strings),r.appendChild(document.createTextNode(a??"")),r.appendChild(c),r.appendChild(document.createTextNode(l??"")),e.appendChild(r);let h=document.createElement("button");return h.type="button",h.className=i.INBOX_EMPTY_ACTION,h.textContent=this.strings.inboxEmptyAction,h.addEventListener("click",()=>this.callbacks.onActivateCommentMode()),e.appendChild(h),e}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(V(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(M(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push($(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_isFilterActive(){return this.pageFilter!=="page"||this.statusFilter!=="all"||this.typeFilter!=="all"||this.priorityFilter!=="all"}_buildFilterGroup({title:e,dataAttr:t,values:n,labelOf:s,selected:r,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=i.INBOX_FILTER_GROUP;let h=document.createElement("div");h.className=i.INBOX_FILTER_SECTION,h.textContent=e,c.appendChild(h);let d=document.createElement("div");d.className=i.INBOX_FILTER_CHIPS;for(let p of n){let m=r===p,u=document.createElement("button");u.type="button",u.className=i.INBOX_FILTER_CHIP,u.dataset[t]=p,u.setAttribute("role",a?"switch":"radio"),u.setAttribute("aria-checked",String(m)),u.textContent=s(p),u.addEventListener("click",g=>{g.stopPropagation(),l(a&&m?"all":p),this.render()}),d.appendChild(u)}return c.appendChild(d),c}_buildFilter(){let e=document.createElement("div");e.className=i.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=i.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${oi}`;let n=document.createElement("div");n.className=i.INBOX_FILTER_MENU,n.setAttribute("role","group"),n.setAttribute("aria-label",this.strings.filterTitle),ee(t,n);let s=document.createElement("div");s.className=i.INBOX_FILTER_MENU_HEADER;let r=document.createElement("span");r.textContent=this.strings.filterTitle,s.appendChild(r);let a=document.createElement("button");return a.type="button",a.className=i.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}),s.appendChild(a),n.appendChild(s),n.appendChild(this._buildFilterGroup({title:this.strings.filterByPage,dataAttr:"filterPage",values:["page","all"],labelOf:l=>this._pageFilterLabel(l),selected:this.pageFilter,toggles:!1,onSelect:l=>this.pageFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...D],labelOf:l=>V(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...N],labelOf:l=>M(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...R],labelOf:l=>$(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(n),e}_buildCard(e,{interactive:t}){let n=document.createElement("div");n.className=i.INBOX_CARD,e.status==="resolved"&&n.classList.add(`${i.INBOX_CARD}--resolved`),n.dataset.commentId=e.id;let s=document.createElement("div");s.className=i.INBOX_CARD_HEADER,s.appendChild(te(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),n.appendChild(s);let r=document.createElement("div");if(r.className=i.THREAD_ACTIONS_ROW,r.appendChild(this._buildCardActions(e)),n.appendChild(r),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))n.appendChild(this._buildEditor());else{let h=document.createElement("div");h.className=i.INBOX_CARD_TEXT,h.textContent=e.text,n.appendChild(h)}if(e.screenshots?.length){let h=oe(e.screenshots,this.strings);h.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(d=>{d.addEventListener("click",p=>{p.stopPropagation(),this.callbacks.onShowLightbox(d.src)})}),n.appendChild(h)}let l=Ge(e,this.strings,{includeClassification:!1});l&&n.appendChild(l);let c=this._buildTag(e);if(c&&n.appendChild(c),t){n.setAttribute("role","button"),n.setAttribute("tabindex","0");let h=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),d=document.createElement("button");d.type="button",d.className=i.INBOX_CARD_REPLY_LINK,d.textContent=this.strings.replyLink,d.addEventListener("click",p=>{p.stopPropagation(),h()}),n.appendChild(d),n.addEventListener("click",h),n.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),h())}),n.addEventListener("mouseenter",()=>this._highlight(e)),n.addEventListener("mouseleave",()=>this._clearHighlight())}return n}_buildTag(e){let t=null;if(e.anchorState==="orphaned"?t=this.strings.orphanedBadge:e.hidden?t=this.strings.hiddenBadge:e.anchorState==="inactive"&&(t=e.page),!t)return null;let n=document.createElement("span");return n.className=i.INBOX_CARD_TAG,n.textContent=t,n}_buildCardActions(e){return Ee(e,{strings:this.strings,onCopy:t=>U(Te(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>U(J(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,n)=>this.callbacks.onSetStatus(t.id,n),onSetType:(t,n)=>this.callbacks.onSetType(t.id,n),onSetPriority:(t,n)=>this.callbacks.onSetPriority(t.id,n),onDelete:t=>{this.detailId===t.id&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let n=t.indexOf(e),s=document.createElement("div");s.className=i.INBOX_DETAIL_HEADER;let r=document.createElement("button");r.type="button",r.className=i.INBOX_BACK,r.innerHTML=`${ni}<span>${this.strings.back}</span>`,r.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.detailId=null,this.render())}),s.appendChild(r);let a=document.createElement("div");a.className=i.INBOX_CARD_ACTIONS;let l=(p,m,u)=>{let g=document.createElement("button");g.type="button",g.className=i.INBOX_NAV_BTN,g.setAttribute("aria-label",m),g.title=m,g.innerHTML=p;let f=t[u];return g.disabled=!f,f&&g.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(f)}),g};a.appendChild(l(ii,this.strings.prevComment,n-1)),a.appendChild(l(ri,this.strings.nextComment,n+1)),a.appendChild(this._closeButton()),s.appendChild(a),this.el.appendChild(s);let c=document.createElement("div");c.className=i.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let h=xe(e,{strings:this.strings,onShowLightbox:p=>this.callbacks.onShowLightbox(p)});h&&c.appendChild(h);let d=document.createElement("div");d.className=i.INBOX_REPLIES;for(let p of e.replies||[]){let m=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(p.id),u=ne(p,this.strings,this.locale,{onDelete:(g,f)=>{this.callbacks.onDeleteReply(e.id,g.id)&&f.remove()},onEdit:g=>this.startEditing(e.id,g.id),editing:m?this._editorHandlers():null});u.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(g=>{g.addEventListener("click",f=>{f.stopPropagation(),this.callbacks.onShowLightbox(g.src)})}),d.appendChild(u)}c.appendChild(d),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:n,screenshotsContainer:s,attachBtn:r,fileInput:a,submitBtn:l}=Ce({areaClassName:i.THREAD_INPUT_AREA,inputTag:"input",inputClassName:i.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],h=()=>{s.innerHTML="",s.classList.toggle(i.ACTIVE,c.length>0),c.forEach((p,m)=>{let u=document.createElement("div");u.className=i.SCREENSHOT_ITEM;let g=document.createElement("img");g.className=i.SCREENSHOT_IMG,g.src=p,g.alt=this.strings.attachedScreenshot,g.onclick=()=>this.callbacks.onShowLightbox(p);let f=document.createElement("button");f.type="button",f.className=i.SCREENSHOT_REMOVE,f.setAttribute("aria-label",this.strings.removeScreenshot),f.innerHTML="&times;",f.onclick=b=>{b.stopPropagation(),c.splice(m,1),h()},u.appendChild(g),u.appendChild(f),s.appendChild(u)})};r.addEventListener("click",()=>a.click()),a.addEventListener("change",p=>{let m=p.target.files[0];if(!m||c.length>=5)return;let u=new FileReader;u.onload=g=>{c.push(g.target.result),h()},u.readAsDataURL(m),a.value=""});let d=()=>{let p=n.value.trim();!p&&c.length===0||(this.callbacks.onReply(e,p,[...c]),c=[],this.render())};return l.addEventListener("click",d),n.addEventListener("keydown",p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),d())}),t}};var si=o=>{let e=new Set;for(let t of o){let n=String(t).trim().toLowerCase();n&&e.add(n)}return[...e]},ze=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,...e},this.locale=this.options.locale||vt(),this.strings=At(this.locale),this.resizeObservers=new Map,this.mutationObservers=new Map,this.positionValidationEnabled=!0,this._pendingRaf=null,this._pendingContextScreenshot=null,this._popoverEditing=null,this._pendingDetailId=null,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.initOverlay()):this.initOverlay()}initOverlay(){this.shadowRoot=gt(),this.toolbar=Yt(this.options,this.strings),this.commentBox=Wt(this.strings),this.overlay=document.createElement("div"),this.overlay.className=i.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${i.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${i.TOOLBAR_MENU_BTN}`),this.submitButton=this.shadowRoot.getElementById(y.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(y.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${i.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(y.ATTACH_IMAGE_INPUT),this.bindEventListeners(),this.setupKeyboardShortcut(),this.setupResizeHandlers(),this.injectStyles(),this._pendingDetailId=this._readPendingDetailId(),this.options.persistence==="localStorage"&&this.loadComments(ue()),this._openPendingDetail()}_navigateTo(e){location.assign(e)}_readPendingDetailId(){let e=Xt(this._linkParam()),t=null;try{t=sessionStorage.getItem(pe),t!=null&&sessionStorage.removeItem(pe)}catch{}return e??t}_linkParam(){return this.options.linkParam||me}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this.comments.find(n=>String(n.id)===String(e));if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound);return}this._pendingDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_popoverBodyEl(e=null){let t=this.activeThreadPopover;return t?e==null?t.querySelector(`.${i.THREAD_SCROLL} > .${i.THREAD_BODY}, .${i.THREAD_SCROLL} > .${i.EDITOR}`):t.querySelector(`.${i.THREAD_REPLY}[data-reply-id="${e}"]`)?.querySelector(`.${i.THREAD_BODY}, .${i.EDITOR}`)||null:null}_refreshCommentViews(e,t=null){if(this.activeThreadPopover?.dataset.for!==String(e))return;let n=this.comments.find(l=>String(l.id)===String(e));if(!n)return;let s=t==null?n:(n.replies||[]).find(l=>String(l.id)===String(t));if(!s)return;let r=document.createElement("div");r.className=i.THREAD_BODY,r.textContent=s.text,this._popoverBodyEl(t)?.replaceWith(r);let a=t==null?this.activeThreadPopover.querySelector(`.${i.THREAD_META}`):this.activeThreadPopover.querySelector(`.${i.THREAD_REPLY}[data-reply-id="${t}"]`)?.querySelector(`.${i.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${i.THREAD_EDITED}`)){let l=Ue(s.editedAt,this.strings,this.locale),c=a.querySelector(`.${i.THREAD_REPLY_ACTIONS}`);c?a.insertBefore(l,c):a.appendChild(l)}}_popoverEditorDirty(){if(!this._popoverEditing)return!1;let{commentId:e,replyId:t,draft:n}=this._popoverEditing,s=this.comments.find(a=>String(a.id)===String(e)),r=t==null?s:(s?.replies||[]).find(a=>String(a.id)===String(t));return n.trim()!==String(r?.text||"").trim()}async _releasePopoverEditor(){if(!this._popoverEditing)return!0;if(this._popoverEditorDirty()){let t=this.shadowRoot;if(!await be(t,this.strings))return!1}let{replyId:e}=this._popoverEditing;return this._popoverEditing=null,this._restorePopoverBody(e),!0}_restorePopoverBody(e){let t=this.comments.find(r=>String(r.id)===String(this.activeThreadPopover?.dataset.for));if(!t)return;let n=e==null?t:(t.replies||[]).find(r=>String(r.id)===String(e));if(!n)return;let s=document.createElement("div");s.className=i.THREAD_BODY,s.textContent=n.text,this._popoverBodyEl(e)?.replaceWith(s)}async _startPopoverEditing(e,t=null){if(!await this._releasePopoverEditor())return;let n=this.comments.find(a=>String(a.id)===String(e)),s=t==null?n:(n?.replies||[]).find(a=>String(a.id)===String(t));if(!s)return;this._popoverEditing={commentId:e,replyId:t,draft:s.text};let r=G({value:s.text,strings:this.strings,onInput:a=>{this._popoverEditing.draft=a},onSave:a=>{let l=t==null?this.editComment(e,a):this.editReply(e,t,a);this._popoverEditing=null,l?(this._refreshCommentViews(e,t),this.inboxView?.isOpen()&&this.inboxView.refresh()):this._restorePopoverBody(t)},onCancel:()=>{this._releasePopoverEditor()}});this._popoverBodyEl(t)?.replaceWith(r)}commentLink(e){let t=this.comments.find(n=>String(n.id)===String(e));return t?J(t,this._linkParam()):null}_syncStorage(){this.options.persistence==="localStorage"&&$e(ke(ue(),this.serializeComments(),location.pathname))}bindEventListeners(){this.commentBtn.addEventListener("click",()=>this.toggleCommentMode()),this.inboxBtn.addEventListener("click",()=>this.toggleInbox()),this.submitButton.addEventListener("click",()=>this.saveComment()),this.commentInput.addEventListener("keydown",e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.saveComment())}),this.attachImageBtn.addEventListener("click",()=>{this.attachImageInput.click()}),this.attachImageInput.addEventListener("change",e=>{let t=e.target.files[0];if(!t||(this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length>=5))return;let n=new FileReader;n.onload=s=>{this._pendingScreenshots.push(s.target.result),this._updateScreenshotsPreview()},n.readAsDataURL(t),this.attachImageInput.value=""}),this._handleDocumentClickBound=e=>this.handleDocumentClick(e),document.addEventListener("mousedown",this._handleDocumentClickBound)}setupKeyboardShortcut(){this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=e=>{if(e.key==="Escape"){this._activeLightbox?this.closeLightbox():this.activeThreadPopover?this._popoverEditing?this._releasePopoverEditor():this.closeThreadPopover():this.inboxView?.isOpen()?this.inboxView.editing?this.inboxView.releaseEditor().then(r=>r&&this.inboxView?.refresh()):this.closeInbox():this.commentBox.style.display!=="none"?(this.hideCommentBox(),this.toggleCommentMode()):this.commentMode&&this.toggleCommentMode();return}let t=this.isMac&&e.altKey&&(e.key==="\xE7"||e.key==="\xC7"),n=!this.isMac&&e.altKey&&e.key.toLowerCase()==="c",s=e.key.toLowerCase()===this.options.shortcutKey.toLowerCase()&&(this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey);if(t||n||s)return e.preventDefault(),e.stopPropagation(),this.toggleCommentMode(),!1},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let t=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(t)||t?.closest?.(`.${i.CIRCLE}`)||t?.closest?.(`.${i.TOOLTIP}`)||t?.closest?.(`.${i.THREAD_POPOVER}`)||t?.closest?.(`.${i.INBOX_PANEL}`)||t?.closest?.(`.${i.LIGHTBOX}`))&&!this.commentBox.contains(t)){if(this.commentBox.style.display!=="none"){this.hideCommentBox(),this.toggleCommentMode();return}e.button===0&&(e.preventDefault(),this._dragStart={x:e.clientX,y:e.clientY},this._isDragging=!1,this._boundDragMove=n=>this._onDragMove(n),this._boundDragEnd=n=>this._onDragEnd(n),document.addEventListener("mousemove",this._boundDragMove),document.addEventListener("mouseup",this._boundDragEnd))}}_onDragMove(e){let t=e.clientX-this._dragStart.x,n=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,n)<5)return;this._isDragging=!0;let s=Math.min(this._dragStart.x,e.clientX),r=Math.min(this._dragStart.y,e.clientY),a=Math.abs(t),l=Math.abs(n);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=i.SELECTION_RECT,this.shadowRoot.appendChild(this._selectionRect)),this._selectionRect.style.left=`${s}px`,this._selectionRect.style.top=`${r}px`,this._selectionRect.style.width=`${a}px`,this._selectionRect.style.height=`${l}px`}async _onDragEnd(e){if(document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._isDragging){let t=Math.min(this._dragStart.x,e.clientX),n=Math.min(this._dragStart.y,e.clientY),s=Math.abs(e.clientX-this._dragStart.x),r=Math.abs(e.clientY-this._dragStart.y);if(this._selectionRect?.remove(),this._selectionRect=null,s>10&&r>10)try{this._pendingScreenshots||(this._pendingScreenshots=[]);let a=await Re(()=>Ne({scale:1})),l=Et(a,{left:t,top:n,width:s,height:r});l&&this._pendingScreenshots.length<5&&this._pendingScreenshots.push(l),this.options.autoScreenshot&&(this._pendingContextScreenshot=Ie(a,{sourceScale:1}))}catch(a){console.warn("Screenshot capture failed:",a)}await this._placeCommentAtPoint(e.clientX,e.clientY)}else await this._placeCommentAtPoint(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}async _placeCommentAtPoint(e,t){if(this.options.autoScreenshot&&!this._pendingContextScreenshot)try{let d=await Re(()=>Ne({scale:le}));this._pendingContextScreenshot=Ie(d,{sourceScale:le})}catch(d){console.warn("HellDots: automatic screenshot failed",d),this._pendingContextScreenshot=null}let n=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let s=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=n||"";let r=s?.closest?.(xt.CONTAINER)||document.body,a=r.getBoundingClientRect(),l=a.width>0?(e-a.left)/a.width:0,c=a.height>0?(t-a.top)/a.height:0,h=Pt(r,l,c);h.targetSelector=s&&s!==r?Bt(s):null,this.currentPosition={container:r,relativeX:l,relativeY:c,anchor:h,target:s||r},this.createPreviewCircle(e,t),document.body.classList.remove(i.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${i.SCREENSHOTS_CONTAINER}`);if(e){if(e.innerHTML="",!this._pendingScreenshots||this._pendingScreenshots.length===0){e.classList.remove(i.ACTIVE);return}e.classList.add(i.ACTIVE),this._pendingScreenshots.forEach((t,n)=>{let s=document.createElement("div");s.className=i.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=i.SCREENSHOT_IMG,r.src=t,r.alt=this.strings.attachedScreenshot,r.onclick=()=>this.showLightbox(t);let a=document.createElement("button");a.type="button",a.className=i.SCREENSHOT_REMOVE,a.setAttribute("aria-label",this.strings.removeScreenshot),a.innerHTML="&times;",a.onclick=l=>{l.stopPropagation(),this._pendingScreenshots.splice(n,1),this._updateScreenshotsPreview()},s.appendChild(r),s.appendChild(a),e.appendChild(s)})}}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${i.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(i.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let s=28/2,r=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),h=c.width||400,d=e+s,p=t+s,m=d+r,u=p-s;m+h>a&&(m=d-r-h),m=Math.min(m,a-h-10),m=Math.max(10,m),u+c.height>l&&(u=l-c.height-10),u=Math.max(10,u),this.commentBox.style.left=`${m}px`,this.commentBox.style.top=`${u}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._pendingContextScreenshot=null,this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(i.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),this.commentBtn?.classList.toggle(i.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(i.ACTIVE,this.commentMode),document.body.classList.toggle(i.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox()}saveComment(){if(!this.commentInput.value.trim()||!this.currentPosition)return;let e={text:this.commentInput.value,container:this.currentPosition.container,relativeX:this.currentPosition.relativeX,relativeY:this.currentPosition.relativeY,anchor:this.currentPosition.anchor,anchorState:"anchored",target:this.currentPosition.target,hidden:!1,status:"open",page:location.pathname,id:He(),replies:[],author:this.options.user?.name||this.strings.anonymous,createdAt:new Date().toISOString(),screenshots:this._pendingScreenshots?[...this._pendingScreenshots]:[],type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:[],resolvedAt:null,context:Ct(),contextScreenshot:this._pendingContextScreenshot};this.comments.push(e),this._syncStorage(),this.options.onCommentCreated?.(this._serializeComment(e)),this.renderCommentCircle(e),this.hideCommentBox(),this.toggleCommentMode();let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&this.showThreadPopover(t,e)}renderCommentCircle(e){let t=jt(e,this.strings);t.addEventListener("mouseenter",()=>this.showCommentTooltip(t,e)),t.addEventListener("mouseleave",()=>{setTimeout(()=>{let n=this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${e.id}"]`);n&&!n.matches(":hover")&&n.remove()},250)}),t.addEventListener("click",n=>{n.stopPropagation();let s=this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${e.id}"]`);if(s&&s.remove(),this.activeThreadPopover?.dataset.for===String(e.id)){this.closeThreadPopover();return}this.showThreadPopover(t,e)}),t.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t.click())}),this.overlay.appendChild(t),this.updateCommentPosition(e,t),this.createResizeObserver(e,t),this.createMutationObserver(e)}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${i.THREAD_POPOVER}[data-for="${t.id}"]`)||this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${t.id}"]`))return;let r=qt(t,this.strings,this.locale);this.shadowRoot.appendChild(r),r.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(a=>{a.addEventListener("click",l=>{l.stopPropagation(),this.showLightbox(a.src)})}),setTimeout(()=>{this.positionPopoverAtCircle(r,e)},10),r.querySelector(`.${i.CLOSE_TOOLTIP}`).addEventListener("click",a=>{a.stopPropagation(),r.remove()}),r.addEventListener("mouseleave",()=>r.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new _e({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:{onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onReply:(e,t,n)=>this.addReply(e,t,n),onDelete:e=>this.deleteComment(e),onDeleteReply:(e,t)=>this.deleteReply(e,t),onEditComment:(e,t)=>{this.editComment(e,t)&&this._refreshCommentViews(e)},onEditReply:(e,t,n)=>{this.editReply(e,t,n)&&this._refreshCommentViews(e)},onSetStatus:(e,t)=>this.setCommentStatus(e,t),onSetType:(e,t)=>this.setCommentType(e,t),onSetPriority:(e,t)=>this.setCommentPriority(e,t),onNavigateToPage:e=>{try{sessionStorage.setItem(pe,String(e.id))}catch{}this._navigateTo(e.page)},onShowLightbox:e=>this.showLightbox(e),onClose:()=>this.closeInbox()}})),this.inboxView.open(),setTimeout(()=>{this._inboxClickHandler=e=>{let t=e.composedPath()[0]||e.target;if(!this.inboxView.el?.contains(t)&&!this.inboxBtn.contains(t)&&!this._isInsideLightbox(t)){if(this.inboxView.isDirty())return;this.closeInbox()}},document.addEventListener("mousedown",this._inboxClickHandler)},0)}closeInbox(){this.inboxView?.close(),this._inboxClickHandler&&(document.removeEventListener("mousedown",this._inboxClickHandler),this._inboxClickHandler=null)}showThreadPopover(e,t){this.closeThreadPopover();let n=this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${t.id}"]`);n&&n.remove(),e?.classList.add(i.CIRCLE_ACTIVE),this._activePopoverCircle=e||null;let s=(E,T)=>{this.deleteReply(t.id,E.id)&&(T.remove(),this.inboxView?.isOpen()&&this.inboxView.refresh())},r=Kt(t,this.strings,this.locale,{onDeleteReply:s,onEditReply:E=>this._startPopoverEditing(t.id,E.id)});this.shadowRoot.appendChild(r);let a=r.querySelector(`.${i.THREAD_HEADER}`),l=Ee(t,{strings:this.strings,onCopy:E=>U(Te(E,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:E=>U(J(E,this._linkParam())),onEdit:E=>this._startPopoverEditing(E.id),onSetStatus:(E,T)=>this.setCommentStatus(E.id,T),onSetType:(E,T)=>this.setCommentType(E.id,T),onSetPriority:(E,T)=>this.setCommentPriority(E.id,T),onDelete:E=>{this.closeThreadPopover(),this.deleteComment(E.id),this.inboxView?.isOpen()&&this.inboxView.refresh()}}),c=document.createElement("div");c.className=i.THREAD_ACTIONS_ROW,c.appendChild(l),a.insertAdjacentElement("afterend",c);let h=r.querySelector(`.${i.THREAD_SCROLL} > .${i.SCREENSHOTS_CONTAINER}`);h&&h.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(E=>{E.addEventListener("click",T=>{T.stopPropagation(),this.showLightbox(E.src)})});let d=xe(t,{strings:this.strings,onShowLightbox:E=>this.showLightbox(E),collapsible:!0});d&&r.querySelector(`.${i.THREAD_REPLIES}`).before(d),setTimeout(()=>{e?this.positionPopoverAtCircle(r,e):this.centerPopover(r)},10),r.querySelector(`.${i.CLOSE_TOOLTIP}`).addEventListener("click",async E=>{E.stopPropagation(),!(this._popoverEditing&&!await this._releasePopoverEditor())&&this.closeThreadPopover()});let p=r.querySelector(`.${i.THREAD_INPUT}`),m=r.querySelector(`.${i.THREAD_SUBMIT}`),u=r.querySelector(`.${i.THREAD_INPUT_AREA} .${i.ATTACH_IMAGE_BTN}`),g=r.querySelector(`.${i.THREAD_INPUT_AREA} input[type="file"]`),f=r.querySelector(`.${i.THREAD_INPUT_AREA} .${i.SCREENSHOTS_CONTAINER}`),b=[],C=()=>{if(f.innerHTML="",b.length===0){f.classList.remove(i.ACTIVE);return}f.classList.add(i.ACTIVE),b.forEach((E,T)=>{let w=document.createElement("div");w.className=i.SCREENSHOT_ITEM;let _=document.createElement("img");_.className=i.SCREENSHOT_IMG,_.src=E,_.alt=this.strings.attachedScreenshot,_.onclick=()=>this.showLightbox(E);let S=document.createElement("button");S.className=i.SCREENSHOT_REMOVE,S.innerHTML="&times;",S.onclick=P=>{P.stopPropagation(),b.splice(T,1),C()},w.appendChild(_),w.appendChild(S),f.appendChild(w)})};u.addEventListener("click",()=>{g.click()}),g.addEventListener("change",E=>{let T=E.target.files[0];if(!T||b.length>=5)return;let w=new FileReader;w.onload=_=>{b.push(_.target.result),C()},w.readAsDataURL(T),g.value=""});let x=()=>{let E=p.value.trim();if(!E&&b.length===0)return;let T=this.addReply(t,E,b.length>0?[...b]:[]),w=r.querySelector(`.${i.THREAD_REPLIES}`),_=ne(T,this.strings,this.locale,{onDelete:s});w.appendChild(_),_.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(P=>{P.addEventListener("click",Jt=>{Jt.stopPropagation(),this.showLightbox(P.src)})});let S=r.querySelector(`.${i.THREAD_SCROLL}`);S&&(S.scrollTop=S.scrollHeight),p.value="",b=[],C(),p.focus()};m.addEventListener("click",x),p.addEventListener("keydown",E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),x())}),this.activeThreadPopover=r,typeof ResizeObserver<"u"&&(this._popoverResizeObserver=new ResizeObserver(()=>this._repositionThreadPopover()),this._popoverResizeObserver.observe(r)),setTimeout(()=>p.focus(),50),setTimeout(()=>{this._threadClickHandler=E=>{let T=E.composedPath()[0]||E.target;if(!r.contains(T)&&!e?.contains(T)&&!this._isInsideLightbox(T)){if(this._popoverEditorDirty())return;this.closeThreadPopover()}},document.addEventListener("mousedown",this._threadClickHandler)},0)}closeThreadPopover(){this.shadowRoot?.querySelectorAll(`.${i.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(i.CIRCLE_ACTIVE)),this._popoverResizeObserver?.disconnect(),this._popoverResizeObserver=null,this._popoverEditing=null,this.activeThreadPopover&&(this.activeThreadPopover.remove(),this.activeThreadPopover=null),this._activePopoverCircle=null,this._threadClickHandler&&(document.removeEventListener("mousedown",this._threadClickHandler),this._threadClickHandler=null)}showLightbox(e){this.closeLightbox();let t=document.createElement("div");t.className=i.LIGHTBOX;let n=document.createElement("img");n.className=i.LIGHTBOX_IMG,n.src=e,n.alt=this.strings.screenshotPreview;let s=document.createElement("button");s.type="button",s.className=i.LIGHTBOX_CLOSE,s.setAttribute("aria-label",this.strings.close),s.innerHTML="&times;",s.addEventListener("click",()=>this.closeLightbox()),t.appendChild(n),t.appendChild(s),t.addEventListener("click",r=>{r.target===t&&this.closeLightbox()}),this.shadowRoot.appendChild(t),this._activeLightbox=t}closeLightbox(){this._activeLightbox?.remove(),this._activeLightbox=null}_isInsideLightbox(e){return!!e?.closest?.(`.${i.LIGHTBOX}`)}addReply(e,t,n=[]){e.replies||(e.replies=[]);let s={id:He(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:n};return e.replies.push(s),this._syncStorage(),this.options.onReplyAdded?.(this._serializeComment(e),this._serializeReply(s)),s}deleteReply(e,t){let n=this.comments.find(a=>a.id===e),s=n?.replies?.findIndex(a=>a.id===t)??-1;if(s<0)return!1;let[r]=n.replies.splice(s,1);return this._syncStorage(),this.options.onReplyDeleted?.(this._serializeComment(n),this._serializeReply(r)),!0}editComment(e,t){let n=this.comments.find(r=>String(r.id)===String(e)),s=String(t??"").trim();return!n||!s||s===n.text?!1:(n.text=s,n.editedAt=new Date().toISOString(),this._syncStorage(),this.options.onCommentEdited?.(this._serializeComment(n)),!0)}editReply(e,t,n){let s=this.comments.find(l=>String(l.id)===String(e)),r=s?.replies?.find(l=>String(l.id)===String(t)),a=String(n??"").trim();return!r||!a||a===r.text?!1:(r.text=a,r.editedAt=new Date().toISOString(),this._syncStorage(),this.options.onReplyEdited?.(this._serializeComment(s),this._serializeReply(r)),!0)}_serializeReply({id:e,text:t,author:n,timestamp:s,screenshots:r,editedAt:a}){return{id:e,text:t,author:n,timestamp:s,screenshots:r||[],editedAt:a||null}}_serializeComment(e){return{id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),author:e.author,createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!D.includes(t))return!1;let n=this.comments.find(r=>r.id===e);if(!n)return!1;if(n.status===t)return!0;n.status=t,n.resolvedAt=t==="resolved"?new Date().toISOString():null;let s=this.shadowRoot?.querySelector(`[data-comment-id="${e}"]`);return s&&this.updateCommentPosition(n,s),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this.options.onCommentStatusChanged?.(this._serializeComment(n)),!0}_commitUpdate(e){return this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this.options.onCommentUpdated?.(this._serializeComment(e)),!0}setCommentType(e,t){if(t!==null&&!N.includes(t))return!1;let n=this.comments.find(s=>s.id===e);return n?(n.type=t,this._commitUpdate(n)):!1}setCommentPriority(e,t){if(t!==null&&!R.includes(t))return!1;let n=this.comments.find(s=>s.id===e);return n?(n.priority=t,this._commitUpdate(n)):!1}setCommentTags(e,t){if(!Array.isArray(t))return!1;let n=this.comments.find(s=>s.id===e);return n?(n.tags=si(t),this._commitUpdate(n)):!1}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){return this.comments.some(t=>t.id===e)?(this._removeComment(e),this.options.persistence==="localStorage"&&$e(ke(ue().filter(t=>t.id!==e),this.serializeComments(),location.pathname)),this.options.onCommentDeleted?.(e),!0):!1}_removeComment(e){if(this.cleanupResizeObserver(e),this.mutationObservers.has(e)){try{this.mutationObservers.get(e).disconnect()}catch{}this.mutationObservers.delete(e)}this.shadowRoot.querySelector(`[data-comment-id="${e}"]`)?.remove(),this.comments=this.comments.filter(t=>t.id!==e)}loadComments(e){let t=0,n=0,s=0;if(!Array.isArray(e))return{anchored:t,orphaned:n,inactive:s};for(let r of e){if(!r||r.id==null||typeof r.text!="string"){console.warn("HellDots: skipping malformed serialized comment",r);continue}this._removeComment(r.id);let a={id:r.id,text:r.text,editedAt:r.editedAt||null,anchor:r.anchor||null,anchorState:"orphaned",target:null,hidden:!1,page:r.page||location.pathname,container:null,relativeX:0,relativeY:0,replies:Array.isArray(r.replies)?[...r.replies]:[],author:r.author||this.strings.anonymous,createdAt:r.createdAt||new Date().toISOString(),screenshots:Array.isArray(r.screenshots)?[...r.screenshots]:[],status:r.status==="closed"?"resolved":D.includes(r.status)?r.status:"open",type:N.includes(r.type)?r.type:null,priority:R.includes(r.priority)?r.priority:null,tags:Array.isArray(r.tags)?[...r.tags]:[],resolvedAt:r.resolvedAt||null,context:r.context||null,contextScreenshot:r.contextScreenshot||null};if(r.page&&r.page!==location.pathname){a.anchorState="inactive",this.comments.push(a),s++;continue}let l=r.anchor?Dt(r.anchor):null;l?(a.container=l.element,a.relativeX=r.anchor.relativeX,a.relativeY=r.anchor.relativeY,a.anchorState="anchored",this.comments.push(a),this.renderCommentCircle(a),t++):(this.comments.push(a),n++,this.options.onAnchorLost?.(this._serializeComment(a)))}return this._openPendingDetail(),{anchored:t,orphaned:n,inactive:s}}centerPopover(e){let t=e.getBoundingClientRect(),n=Math.max(10,(window.innerWidth-(t.width||400))/2),s=Math.max(10,(window.innerHeight-t.height)/2);e.style.left=`${n}px`,e.style.bottom="auto",e.style.top=`${s}px`}scrollMarkerIntoView(e){let t=this._markerViewportY(e);t!=null&&window.scrollTo({top:Math.max(0,window.scrollY+t-window.innerHeight/2)})}_markerViewportY(e){let t=e.container;if(!t?.isConnected)return null;let n=t.getBoundingClientRect();if(n.height<=0)return null;let s=28,r=Math.max(0,Math.min(e.relativeY*n.height,n.height-s));return n.top+r+s/2}_repositionThreadPopover(){let e=this.activeThreadPopover;!e||e.style.display==="none"||(this._activePopoverCircle?this.positionPopoverAtCircle(e,this._activePopoverCircle):this.centerPopover(e))}syncThreadPopoverToMarker(){let e=this.activeThreadPopover,t=this._activePopoverCircle;if(!e||!t)return;let n=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&n.bottom>0&&n.right>0&&n.top<window.innerHeight&&n.left<window.innerWidth)){e.style.display="none";return}e.style.display="",this.positionPopoverAtCircle(e,t)}positionPopoverAtCircle(e,t){let n=t.getBoundingClientRect(),s=n.left+n.width/2,r=n.top+n.height/2,a=28,l=a/2+10,c=e.getBoundingClientRect(),h=c.width||400,d=s+l;d+h>window.innerWidth&&(d=s-l-h),d=Math.min(d,window.innerWidth-h-10),d=Math.max(10,d),e.style.left=`${d}px`;let p=10,m=r-a/2,u=window.innerHeight-p-m;c.height>u?(e.style.top="auto",e.style.bottom=`${p}px`):(e.style.bottom="auto",e.style.top=`${Math.max(p,m)}px`)}createPreviewCircle(e,t){this.removePreviewCircle();let n=document.createElement("div");n.className=`${i.CIRCLE} ${i.PREVIEW_CIRCLE}`,n.style.position="absolute";let s=14;n.style.left=`${e+s}px`,n.style.top=`${t+s}px`,n.style.transform="translate(-50%, -50%)",n.style.pointerEvents="none",this.overlay.appendChild(n),this.previewCircle=n}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){if(this.resizeObservers&&this.resizeObservers.has(e)){let{circle:t,observer:n}=this.resizeObservers.get(e);n&&n.disconnect(),t&&t.parentNode&&t.parentNode.removeChild(t),this.resizeObservers.delete(e)}}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let n=e.container.getBoundingClientRect(),s=n.width,r=n.height;if(s<=0||r<=0)return null;let a=e.relativeX*s,l=e.relativeY*r,c=28,h=Math.max(0,Math.min(a,s-c)),d=Math.max(0,Math.min(l,r-c)),p=h/s,m=d/r;return{absoluteX:h,absoluteY:d,relativeX:p,relativeY:m,containerWidth:s,containerHeight:r,containerLeft:n.left,containerTop:n.top}}_isAnchorTargetVisible(e){let t=e.target;if((!t||!t.isConnected)&&e.anchor?.targetSelector){try{t=document.querySelector(e.anchor.targetSelector)}catch{t=null}e.target=t||null}if(!t||!t.isConnected)return!0;let n=t.getBoundingClientRect();return n.width>0&&n.height>0}_isMarkerOccluded(e,t,n){if(typeof document.elementsFromPoint!="function"||t<0||n<0||t>=window.innerWidth||n>=window.innerHeight)return!1;let r=document.elementsFromPoint(t,n).find(c=>c.tagName.toLowerCase()!==B.toLowerCase());if(!r)return!1;let a=e.target?.isConnected?e.target:null;if(a&&(a.contains(r)||r.contains(a)))return!1;let l=e.container;if(!l?.isConnected)return!1;if(!l.contains(r)&&!r.contains(l))return!0;if(l.contains(r)&&r!==l){for(let c=r;c&&c!==l;c=c.parentElement)if(this._looksLikeModalLayer(c,a))return!0}return!1}_looksLikeModalLayer(e,t){if(t&&e.contains(t))return!1;if(e.matches?.('dialog, [aria-modal="true"], [role="dialog"]'))return!0;if(getComputedStyle(e).position!=="fixed")return!1;let n=e.getBoundingClientRect();return n.width>=window.innerWidth*.5&&n.height>=window.innerHeight*.5}_dismissMarkerUi(e){this.shadowRoot.querySelector(`.${i.TOOLTIP}[data-for="${e.id}"]`)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}updateCommentPosition(e,t){if(e.status==="resolved"){t&&(t.style.display="none");return}let n=this.validateAndCalculatePosition(e,t);n&&!this._isAnchorTargetVisible(e)&&(n=null);let s=e.hidden===!0;if(!n){t&&e.container&&(e.hidden=!0,t.style.display="none",this._dismissMarkerUi(e),!s&&this.inboxView?.isOpen()&&this.inboxView.refresh());return}let r=14,a=n.containerLeft+n.absoluteX+r,l=n.containerTop+n.absoluteY+r;if(this._isMarkerOccluded(e,a,l)){e.hidden=!0,t.style.display="none",this._dismissMarkerUi(e),!s&&this.inboxView?.isOpen()&&this.inboxView.refresh();return}e.hidden=!1,t.style.display="",s&&this.inboxView?.isOpen()&&this.inboxView.refresh(),t.style.left=`${a}px`,t.style.top=`${l}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=n.relativeX,e.relativeY=n.relativeY}setupResizeHandlers(){this.scheduleUpdatePositions=()=>{this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.positionValidationEnabled&&this.comments.forEach(e=>{let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&this.updateCommentPosition(e,t)}),this.syncThreadPopoverToMarker()}))},this.windowResizeHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("resize",this.windowResizeHandler,{passive:!0}),this.scrollHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("scroll",this.scrollHandler,{capture:!0,passive:!0}),this.loadHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("load",this.loadHandler),window.MutationObserver&&(this._globalMutationObserver=new MutationObserver(()=>{this.scheduleUpdatePositions()}),this._globalMutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","open"]}))}debugPosition(e,t){if(!e||!t)return;let n=e.container.getBoundingClientRect(),s=t.getBoundingClientRect(),r=e.relativeX*n.width,a=e.relativeY*n.height;console.log("Position Debug:",{commentId:e.id,relativePosition:{x:e.relativeX,y:e.relativeY},containerRect:{left:n.left,top:n.top,width:n.width,height:n.height},circlePosition:{left:s.left,top:s.top,centerX:s.left+s.width/2,centerY:s.top+s.height/2},expectedPosition:{x:r,y:a},offset:{x:s.left+s.width/2-(n.left+r),y:s.top+s.height/2-(n.top+a)}})}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let n=new ResizeObserver(s=>{if(this.positionValidationEnabled)for(let r of s)r.target===e.container&&this.updateCommentPosition(e,t)});n.observe(e.container),this.resizeObservers.set(e.id,{circle:t,observer:n,container:e.container})}createMutationObserver(e){if(!window.MutationObserver)return;if(this.mutationObservers.has(e.id)){try{this.mutationObservers.get(e.id).disconnect()}catch{}this.mutationObservers.delete(e.id)}let t=new MutationObserver(()=>{this.scheduleUpdatePositions()});t.observe(e.container,{attributes:!0,attributeFilter:void 0,childList:!0,subtree:!0}),this.mutationObservers.set(e.id,t)}cleanup(){ge(),Ut(),this.closeThreadPopover(),this.closeInbox(),this.closeLightbox(),this.removePreviewCircle(),this._selectionRect?.remove(),this._pendingScreenshots=[],this._handleDocumentClickBound&&document.removeEventListener("mousedown",this._handleDocumentClickBound),this.windowResizeHandler&&window.removeEventListener("resize",this.windowResizeHandler),this.scrollHandler&&window.removeEventListener("scroll",this.scrollHandler,{capture:!0}),this.loadHandler&&window.removeEventListener("load",this.loadHandler),this._globalMutationObserver&&(this._globalMutationObserver.disconnect(),this._globalMutationObserver=null),this.resizeObservers&&(this.resizeObservers.forEach(({observer:e})=>{e&&e.disconnect()}),this.resizeObservers.clear()),this.mutationObservers&&(this.mutationObservers.forEach(e=>{try{e.disconnect()}catch{}}),this.mutationObservers.clear()),this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.toolbar&&this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),this.commentBox&&this.commentBox.parentNode&&this.commentBox.parentNode.removeChild(this.commentBox),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),document.body.classList.remove(i.COMMENT_CURSOR),document.getElementById(y.GLOBAL_STYLES)?.remove(),this.comments.forEach(e=>{let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&t.parentNode&&t.parentNode.removeChild(t)})}injectStyles(){let e=this.shadowRoot.getElementById(y.STYLES);e&&e.remove();let t=document.createElement("style");t.id=y.STYLES,t.textContent=wt(),this.shadowRoot.appendChild(t);let n=document.getElementById(y.GLOBAL_STYLES);n&&n.remove();let s=document.createElement("style");s.id=y.GLOBAL_STYLES,s.textContent=St(),document.head.appendChild(s)}},Ye=ze;function Zt(o={}){let{autoInit:e=!0,...t}=o,n=()=>new Ye(t);return e?n():n}var ai=Zt;return io(li);})();
1468
- if (typeof module !== 'undefined' && module.exports) { module.exports = HellDots.default; }
21
+ `,t},_e=(n,e)=>{let t=document.createElement("div");return t.className=r.SCREENSHOTS_CONTAINER,t.classList.add(r.ACTIVE),n.forEach(o=>{let s=document.createElement("div");s.className=r.SCREENSHOT_ITEM;let i=document.createElement("img");i.className=r.SCREENSHOT_IMG,i.src=o,i.alt=e.attachedScreenshot,s.appendChild(i),t.appendChild(s)}),t},eo=(n,e=X,t)=>{let o=document.createElement("div");o.className=r.TOOLTIP,o.dataset.for=n.id,o.setAttribute("role","dialog"),o.setAttribute("aria-label",e.tooltipAriaLabel);let s=document.createElement("div");s.className=r.THREAD_HEADER;let i=Te(n.author,n.createdAt,e,t,n.editedAt),a=document.createElement("button");a.type="button",a.className=r.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="&times;",s.appendChild(i),s.appendChild(a);let l=document.createElement("div");l.className=r.THREAD_BODY,l.textContent=n.text,o.appendChild(s),o.appendChild(l);let c=At(n,e,{includeStatus:!0});c&&o.appendChild(c);let d=It(n);d.length>0&&o.appendChild(_e(d,e));let p=n.replies?.length||0;if(p>0){let u=document.createElement("div");u.className=r.TOOLTIP_REPLY_COUNT,u.textContent=p===1?e.replyCountOne:I(e.replyCountTemplate,p),o.appendChild(u)}return o},xe=(n,e=X,t,{onDelete:o,onEdit:s,editing:i=null,reactions:a=null}={})=>{let l=document.createElement("div");l.className=r.THREAD_REPLY,l.dataset.replyId=String(n.id);let c=Te(n.author,n.timestamp,e,t,n.editedAt),d=[];s&&d.push({label:e.editReply,onSelect:()=>s(n)}),o&&d.push({label:e.deleteReply,onSelect:()=>o(n,l),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})});let p=document.createElement("div");p.className=`${r.ACTIONS_GROUP} ${r.THREAD_REPLY_ACTIONS}`,a&&p.appendChild(a.trigger(n,{className:r.INBOX_ACTION_BTN})),d.length>0&&p.appendChild(xt({label:e.replyOptions,items:d})),p.children.length>0&&c.appendChild(p);let u;i?u=ae({value:i.draft,strings:e,onInput:i.onInput,onSave:i.onSave,onCancel:i.onCancel}):(u=document.createElement("div"),u.className=r.THREAD_BODY,u.textContent=n.text),l.appendChild(c),l.appendChild(u);let h=It(n);return h.length>0&&l.appendChild(_e(h,e)),a&&l.appendChild(a.bar(n)),l},to=(n,e=X,t,{onDeleteReply:o,onEditReply:s,reactions:i=null}={})=>{let a=document.createElement("div");a.className=r.THREAD_POPOVER,a.dataset.for=n.id,a.setAttribute("role","dialog"),a.setAttribute("aria-label",e.popoverAriaLabel);let l=document.createElement("div");l.className=r.THREAD_HEADER;let c=Te(n.author,n.createdAt,e,t,n.editedAt),d=document.createElement("button");d.type="button",d.className=r.CLOSE_TOOLTIP,d.setAttribute("aria-label",e.close),d.innerHTML="&times;",l.appendChild(c),l.appendChild(d);let p=document.createElement("div");p.className=r.THREAD_BODY,p.textContent=n.text;let u=document.createElement("div");u.className=r.THREAD_REPLIES,n.replies&&n.replies.forEach(g=>{u.appendChild(xe(g,e,t,{onDelete:o,onEdit:s,reactions:i}))});let{container:h}=je({areaClassName:r.THREAD_INPUT_AREA,inputTag:"input",inputClassName:r.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=r.THREAD_SCROLL,a.appendChild(l),m.appendChild(p);let f=It(n);return f.length>0&&m.appendChild(_e(f,e)),i&&m.appendChild(i.bar(n)),m.appendChild(u),a.appendChild(m),a.appendChild(h),a};var Ke=(n,{strings:e,onShowLightbox:t,collapsible:o=!1,expanded:s=!1,onToggle:i})=>{let{context:a,contextScreenshot:l}=n;if(!a&&!l)return null;let c=document.createElement("div");c.className=r.CONTEXT_BLOCK;let d=document.createElement("div");if(d.className=r.CONTEXT_BODY,o){let p=document.createElement("button");p.type="button",p.className=r.CONTEXT_TOGGLE,p.setAttribute("aria-expanded",String(s)),p.innerHTML=`<span>${e.contextSection}</span>${We}`,d.style.display=s?"":"none",p.addEventListener("click",u=>{u.stopPropagation();let h=p.getAttribute("aria-expanded")==="true";p.setAttribute("aria-expanded",String(!h)),d.style.display=h?"none":"",i?.(!h)}),c.appendChild(p)}else{let p=document.createElement("div");p.className=r.CONTEXT_TITLE,p.textContent=e.contextSection,c.appendChild(p)}if(l){let p=document.createElement("div");p.className=r.CONTEXT_SCREENSHOT_CAPTION,p.textContent=e.autoScreenshotLabel,d.appendChild(p);let u=document.createElement("img");u.className=r.SCREENSHOT_IMG,u.src=l,u.alt=e.autoScreenshotLabel,d.appendChild(u),U(d,t)}if(a){let p=(m,f)=>{if(!f)return;let g=document.createElement("div");g.className=r.CONTEXT_ROW;let E=document.createElement("span");E.textContent=m;let b=document.createElement("span");b.textContent=f,g.appendChild(E),g.appendChild(b),d.appendChild(g)},u=m=>m?`${m.width}\xD7${m.height}`:"",h=m=>m?.name?`${m.name} ${m.version||""}`.trim():"";p(e.contextUrl,a.url),p(e.contextViewport,u(a.viewport)),p(e.contextScreen,u(a.screen)),p(e.contextBrowser,h(a.browser)),p(e.contextOs,h(a.os))}return c.appendChild(d),c};var wr=n=>{let e=[...n.attributes].map(({name:t,value:o})=>`${t}="${o}"`).join(" ");return`<${n.tagName.toLowerCase()}${e?` ${e}`:""}>`},vr=n=>{if(!n?.tagName)return"(unknown)";let e=Object.entries(n.attributes||{}).map(([t,o])=>`${t}="${o}"`).join(" ");return`<${n.tagName.toLowerCase()}${e?` ${e}`:""}>`},Nr=n=>{let e=[],t=n;for(;t&&t!==document.documentElement;){let o=t.tagName.toLowerCase(),s=t.id?`#${t.id}`:"",i=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${o}${s}${i}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function qe(n,{viewportWidth:e,viewportHeight:t,strings:o}){let s=n.anchor,i=s?.fingerprint,a=n.container?.isConnected?n.container:null,l=n.hidden?"hidden":n.anchorState,c=a?wr(a):vr(i),d=a?Nr(a):"(unavailable)",p=n.context?.viewport,u=p?.width??e,h=p?.height??t,m=[`Page: ${n.page}`,`Viewport: ${u}x${h}`,`Anchor state: ${l}`,`Status: ${n.status||"open"}`,`Selector: ${s?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${d}`,`Nearby text: "${i?.textSnippet??""}"`,`Comment by ${n.author} (${n.createdAt}):`,`"${n.text}"`];n.type&&m.push(`Type: ${n.type}`),n.priority&&m.push(`Priority: ${n.priority}`),n.tags?.length&&m.push(`Tags: ${n.tags.join(", ")}`);let f=n.context;if(f&&(f.url&&m.push(`URL: ${f.url}`),f.screen&&m.push(`Screen: ${f.screen.width}x${f.screen.height}`),f.browser?.name&&m.push(`Browser: ${`${f.browser.name} ${f.browser.version||""}`.trim()}`),f.os?.name&&m.push(`OS: ${`${f.os.name} ${f.os.version||""}`.trim()}`)),o&&n.status==="resolved"&&n.resolvedAt){let E=z(new Date(n.resolvedAt).getTime()-new Date(n.createdAt).getTime(),o);E&&m.push(`Resolution time: ${E}`)}let g=n.replies||[];if(g.length>0){m.push(`Replies (${g.length}):`);for(let E of g)m.push(`- ${E.author}: "${E.text}"`)}return m.join(`
22
+ `)}var ye=(n,e)=>{let t=e.getBoundingClientRect(),o=t.left+t.width/2,s=t.top+t.height/2,i=P,a=i/2+10,l=n.getBoundingClientRect(),c=l.width||400,d=o+a;d+c>window.innerWidth&&(d=o-a-c),d=Math.min(d,window.innerWidth-c-10),d=Math.max(10,d),n.style.left=`${d}px`;let p=10,u=s-i/2,h=window.innerHeight-p-u;l.height>h?(n.style.top="auto",n.style.bottom=`${p}px`):(n.style.bottom="auto",n.style.top=`${Math.max(p,u)}px`)},no=n=>{let e=n.getBoundingClientRect(),t=Math.max(10,(window.innerWidth-(e.width||400))/2),o=Math.max(10,(window.innerHeight-e.height)/2);n.style.left=`${t}px`,n.style.bottom="auto",n.style.top=`${o}px`},Ze=class{constructor(e){this.deps=e,this.active=null,this._activeCircle=null,this.editing=null,this._resizeObserver=null,this._clickHandler=null,this._armClickTimer=null}_bodyEl(e=null){let t=this.active;return t?e==null?t.querySelector(`.${r.THREAD_SCROLL} > .${r.THREAD_BODY}, .${r.THREAD_SCROLL} > .${r.EDITOR}`):t.querySelector(`.${r.THREAD_REPLY}[data-reply-id="${Z(e)}"]`)?.querySelector(`.${r.THREAD_BODY}, .${r.EDITOR}`)||null:null}refreshCommentViews(e,t=null){if(this.active?.dataset.for!==String(e))return;let o=this.deps.findComment(e);if(!o)return;let s=t==null?o:(o.replies||[]).find(l=>A(l.id,t));if(!s)return;let i=document.createElement("div");i.className=r.THREAD_BODY,i.textContent=s.text,this._bodyEl(t)?.replaceWith(i);let a=t==null?this.active.querySelector(`.${r.THREAD_META}`):this.active.querySelector(`.${r.THREAD_REPLY}[data-reply-id="${Z(t)}"]`)?.querySelector(`.${r.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${r.THREAD_EDITED}`)){let l=yt(s.editedAt,this.deps.strings,this.deps.locale),c=a.querySelector(`.${r.THREAD_REPLY_ACTIONS}`);c?a.insertBefore(l,c):a.appendChild(l)}}isEditing(){return this.editing!=null}editorDirty(){if(!this.editing)return!1;let{commentId:e,replyId:t,draft:o}=this.editing,s=this.deps.findComment(e),i=t==null?s:(s?.replies||[]).find(a=>A(a.id,t));return o.trim()!==String(i?.text||"").trim()}async releaseEditor(){if(!this.editing)return!0;if(this.editorDirty()){let t=this.deps.shadowRoot;if(!await Ye(t,this.deps.strings))return!1}let{replyId:e}=this.editing;return this.editing=null,this._restoreBody(e),!0}_restoreBody(e){let t=this.deps.findComment(this.active?.dataset.for);if(!t)return;let o=e==null?t:(t.replies||[]).find(i=>A(i.id,e));if(!o)return;let s=document.createElement("div");s.className=r.THREAD_BODY,s.textContent=o.text,this._bodyEl(e)?.replaceWith(s)}async startEditing(e,t=null){if(!await this.releaseEditor())return;let o=this.deps.findComment(e),s=t==null?o:(o?.replies||[]).find(a=>A(a.id,t));if(!s)return;this.editing={commentId:e,replyId:t,draft:s.text};let i=ae({value:s.text,strings:this.deps.strings,onInput:a=>{this.editing.draft=a},onSave:a=>{let l=t==null?this.deps.actions.editComment(e,a):this.deps.actions.editReply(e,t,a);this.editing=null,l?(this.refreshCommentViews(e,t),this.deps.refreshInbox()):this._restoreBody(t)},onCancel:()=>{this.releaseEditor()}});this._bodyEl(t)?.replaceWith(i)}show(e,t){this.close();let{strings:o,locale:s}=this.deps;this.deps.removeTooltip(t.id),e?.classList.add(r.CIRCLE_ACTIVE),this._activeCircle=e||null;let i=(C,y)=>{this.deps.actions.deleteReply(t.id,C.id)&&(y.remove(),this.deps.refreshInbox())},a=C=>this.startEditing(t.id,C.id),l=Ue({actorKey:this.deps.actorKey,strings:o,onToggle:(C,y)=>C===t?this.deps.actions.toggleCommentReaction(t.id,y):this.deps.actions.toggleReplyReaction(t.id,C.id,y)}),c=to(t,o,s,{onDeleteReply:i,onEditReply:a,reactions:l});this.deps.shadowRoot.appendChild(c);let d=c.querySelector(`.${r.THREAD_HEADER}`),p=Ve(t,{strings:o,reactions:l,onCopy:C=>se(qe(C,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:o})),onCopyLink:C=>se(oe(C,this.deps.linkParam())),onEdit:C=>this.startEditing(C.id),onSetStatus:(C,y)=>this.deps.actions.setStatus(C.id,y),onSetType:(C,y)=>this.deps.actions.setType(C.id,y),onSetPriority:(C,y)=>this.deps.actions.setPriority(C.id,y),onDelete:C=>{this.close(),this.deps.actions.deleteComment(C.id),this.deps.refreshInbox()}}),u=document.createElement("div");u.className=r.THREAD_ACTIONS_ROW,u.appendChild(p),d.insertAdjacentElement("afterend",u);let h=c.querySelector(`.${r.THREAD_SCROLL} > .${r.SCREENSHOTS_CONTAINER}`);h&&U(h,C=>this.deps.onShowLightbox(C));let m=Ke(t,{strings:o,onShowLightbox:C=>this.deps.onShowLightbox(C),collapsible:!0});m&&c.querySelector(`.${r.THREAD_REPLIES}`).before(m),setTimeout(()=>{e?ye(c,e):no(c)},10),c.querySelector(`.${r.CLOSE_TOOLTIP}`).addEventListener("click",async C=>{C.stopPropagation(),!(this.editing&&!await this.releaseEditor())&&this.close()});let f=c.querySelector(`.${r.THREAD_INPUT}`),g=c.querySelector(`.${r.THREAD_SUBMIT}`),E=c.querySelector(`.${r.THREAD_INPUT_AREA} .${r.ATTACH_IMAGE_BTN}`),b=c.querySelector(`.${r.THREAD_INPUT_AREA} input[type="file"]`),_=c.querySelector(`.${r.THREAD_INPUT_AREA} .${r.SCREENSHOTS_CONTAINER}`),T=[],x=()=>{le(_,T,{strings:o,onShow:C=>this.deps.onShowLightbox(C),rerender:()=>x()})};E.addEventListener("click",()=>{b.click()}),ce(b,()=>T,x);let v=()=>{let C=f.value.trim();if(!C&&T.length===0)return;let y=this.deps.actions.addReply(t,C,T.length>0?[...T]:[]),Oe=c.querySelector(`.${r.THREAD_REPLIES}`),Ht=xe(y,o,s,{onDelete:i,onEdit:a,reactions:l});Oe.appendChild(Ht),U(Ht,xo=>this.deps.onShowLightbox(xo));let et=c.querySelector(`.${r.THREAD_SCROLL}`);et&&(et.scrollTop=et.scrollHeight),f.value="",T=[],x(),f.focus()};g.addEventListener("click",v),f.addEventListener("keydown",C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),v())}),this.active=c,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(c)),setTimeout(()=>f.focus(),50),this._armClickTimer=setTimeout(()=>{this._armClickTimer=null,this._clickHandler=C=>{let y=C.composedPath()[0]||C.target;if(!c.contains(y)&&!e?.contains(y)&&!this.deps.isInsideLightbox(y)){if(this.editorDirty())return;this.close()}},document.addEventListener("mousedown",this._clickHandler)},0)}close(){this.deps.shadowRoot?.querySelectorAll(`.${r.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(r.CIRCLE_ACTIVE)),this._resizeObserver?.disconnect(),this._resizeObserver=null,this.editing=null,this.active&&(this.active.remove(),this.active=null),this._activeCircle=null,this._armClickTimer&&(clearTimeout(this._armClickTimer),this._armClickTimer=null),this._clickHandler&&(document.removeEventListener("mousedown",this._clickHandler),this._clickHandler=null)}reposition(){let e=this.active;!e||e.style.display==="none"||(this._activeCircle?ye(e,this._activeCircle):no(e))}syncToMarker(){let e=this.active,t=this._activeCircle;if(!e||!t)return;let o=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&o.bottom>0&&o.right>0&&o.top<window.innerHeight&&o.left<window.innerWidth)){e.style.display="none";return}e.style.display="",ye(e,t)}};var oo=150,Rt=(n,e)=>Math.max(0,Math.min(n,e)),Je=class{constructor(e){this.deps=e,this.circles=new Map,this.resizeObservers=new Map,this.enabled=!0,this._lastOcclusionPass=0,this._occlusionTrailingTimer=null,this._pendingRaf=null,this._globalMutationObserver=null,this._resizeHandler=null,this._scrollHandler=null,this._loadHandler=null}start(){this._resizeHandler=()=>this.scheduleUpdate(),window.addEventListener("resize",this._resizeHandler,{passive:!0}),this._scrollHandler=()=>this.scheduleUpdate(),window.addEventListener("scroll",this._scrollHandler,{capture:!0,passive:!0}),this._loadHandler=()=>this.scheduleUpdate(),window.addEventListener("load",this._loadHandler),window.MutationObserver&&(this._globalMutationObserver=new MutationObserver(()=>{this.scheduleUpdate()}),this._globalMutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","open"]}))}render(e){let t=Qn(e,this.deps.strings);this.deps.wireMarker(t,e),this.deps.container.appendChild(t),this.circles.set(String(e.id),t),this.updatePosition(e,t),this.createResizeObserver(e,t)}circleOf(e){return this.circles.get(String(e))??null}remove(e){this.cleanupResizeObserver(e),this.circles.get(String(e))?.remove(),this.circles.delete(String(e))}clear(){this.resizeObservers.forEach(({observer:e})=>e?.disconnect()),this.resizeObservers.clear(),this.circles.forEach(e=>e.remove()),this.circles.clear()}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let o=e.container.getBoundingClientRect(),s=o.width,i=o.height;if(s<=0||i<=0)return null;let a=e.relativeX*s,l=e.relativeY*i,c=Rt(a,s),d=Rt(l,i),p=c/s,u=d/i;return{absoluteX:c,absoluteY:d,relativeX:p,relativeY:u,containerWidth:s,containerHeight:i,containerLeft:o.left,containerTop:o.top}}_isAnchorTargetVisible(e){let t=e.target;if((!t||!t.isConnected)&&e.anchor?.targetSelector){try{t=document.querySelector(e.anchor.targetSelector)}catch{t=null}e.target=t||null}if(!t||!t.isConnected)return!0;let o=t.getBoundingClientRect();return o.width>0&&o.height>0}_isMarkerOccluded(e,t,o){if(typeof document.elementsFromPoint!="function"||t<0||o<0||t>=window.innerWidth||o>=window.innerHeight)return!1;let i=document.elementsFromPoint(t,o).find(c=>c.tagName.toLowerCase()!==$.toLowerCase());if(!i)return!1;let a=e.target?.isConnected?e.target:null;if(a&&(a.contains(i)||i.contains(a)))return!1;let l=e.container;if(!l?.isConnected)return!1;if(!l.contains(i)&&!i.contains(l))return!0;if(l.contains(i)&&i!==l){for(let c=i;c&&c!==l;c=c.parentElement)if(this._looksLikeModalLayer(c,a))return!0}return!1}_looksLikeModalLayer(e,t){if(t&&e.contains(t))return!1;if(e.matches?.('dialog, [aria-modal="true"], [role="dialog"]'))return!0;if(getComputedStyle(e).position!=="fixed")return!1;let o=e.getBoundingClientRect();return o.width>=window.innerWidth*.5&&o.height>=window.innerHeight*.5}_computeMarkerState(e,t,{checkOcclusion:o=!0}={}){if(e.status==="resolved")return{kind:"resolved"};let s=this.validateAndCalculatePosition(e,t);if(s&&!this._isAnchorTargetVisible(e)&&(s=null),!s)return e.container?{kind:"hidden"}:{kind:"noop"};let i=P/2,a=s.containerLeft+s.absoluteX+i,l=s.containerTop+s.absoluteY+i;return o&&(e._occluded=this._isMarkerOccluded(e,a,l)),e._occluded?{kind:"hidden"}:{kind:"visible",viewportX:a,viewportY:l,relativeX:s.relativeX,relativeY:s.relativeY}}_applyMarkerState(e,t,o){if(o.kind==="resolved")return t&&(t.style.display="none"),!1;if(o.kind==="noop")return!1;let s=e.hidden===!0;return o.kind==="hidden"?(e.hidden=!0,t.style.display="none",this.deps.onMarkerHidden(e),!s):(e.hidden=!1,t.style.display="",t.style.left=`${o.viewportX}px`,t.style.top=`${o.viewportY}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=o.relativeX,e.relativeY=o.relativeY,s)}updatePosition(e,t=this.circles.get(String(e.id))){if(!t)return;let o=this._computeMarkerState(e,t);this._applyMarkerState(e,t,o)&&this.deps.onVisibilityFlip()}_updateAllPositions(){let e=Date.now(),t=e-this._lastOcclusionPass>=oo;t?this._lastOcclusionPass=e:this._armOcclusionTrailingPass();let o=[];for(let i of this.deps.getComments()){let a=this.circles.get(String(i.id));a&&o.push([i,a,this._computeMarkerState(i,a,{checkOcclusion:t})])}let s=!1;for(let[i,a,l]of o)this._applyMarkerState(i,a,l)&&(s=!0);s&&this.deps.onVisibilityFlip()}_armOcclusionTrailingPass(){this._occlusionTrailingTimer&&clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=setTimeout(()=>{this._occlusionTrailingTimer=null,this.scheduleUpdate()},oo)}scheduleUpdate(){this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.enabled&&this._updateAllPositions(),this.deps.onAfterPass()}))}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let o=new ResizeObserver(s=>{if(this.enabled)for(let i of s)i.target===e.container&&this.updatePosition(e,t)});o.observe(e.container),this.resizeObservers.set(String(e.id),{circle:t,observer:o,container:e.container})}cleanupResizeObserver(e){let t=String(e);if(this.resizeObservers.has(t)){let{circle:o,observer:s}=this.resizeObservers.get(t);s&&s.disconnect(),o&&o.parentNode&&o.parentNode.removeChild(o),this.resizeObservers.delete(t)}}scrollMarkerIntoView(e){let t=this._markerViewportY(e);t!=null&&window.scrollTo({top:Math.max(0,window.scrollY+t-window.innerHeight/2)})}_markerViewportY(e){let t=e.container;if(!t?.isConnected)return null;let o=t.getBoundingClientRect();if(o.height<=0)return null;let s=Rt(e.relativeY*o.height,o.height);return o.top+s+P/2}destroy(){this._pendingRaf&&(cancelAnimationFrame(this._pendingRaf),this._pendingRaf=null),this._occlusionTrailingTimer&&(clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollHandler&&(window.removeEventListener("scroll",this._scrollHandler,{capture:!0}),this._scrollHandler=null),this._loadHandler&&(window.removeEventListener("load",this._loadHandler),this._loadHandler=null),this._globalMutationObserver&&(this._globalMutationObserver.disconnect(),this._globalMutationObserver=null),this.clear()}};var ro=(n,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(n)),Lr={status:n=>[n.statusLabel,e=>B(e,n)],type:n=>[n.typeLabel,e=>L(e,n)],priority:n=>[n.priorityLabel,e=>M(e,n)]},io=(n,e,t)=>{let o=Lr[n];if(!o)return"";let[s,i]=o(t);return`${s}: ${i(e.from??null)} \u2192 ${i(e.to??null)}`},Mr=(n,e)=>{switch(n.type){case"created":return e.auditCreated;case"edited":return e.auditEdited;case"status":return io("status",n,e);case"classified":return n.field==="tags"?e.auditTagsChanged:io(n.field,n,e);default:return""}},Dr=(n,e,t)=>{let o=document.createElement("li");o.className=r.AUDIT_ROW;let s=document.createElement("span");s.className=r.AUDIT_ACTION,s.textContent=Mr(n,e);let i=document.createElement("span");i.className=r.AUDIT_ACTOR,i.textContent=n.actor?.name||e.anonymous;let a=document.createElement("time");return a.className=r.AUDIT_TIME,a.dateTime=n.at,a.textContent=ro(n.at,t),o.append(s,i,a),o},Br=(n,e,t)=>{let o=q(n).filter(l=>l.reopenedAt);if(o.length===0)return null;let s=document.createElement("div");s.className=r.AUDIT_RESOLUTIONS,s.dataset.auditResolutions="";let i=document.createElement("h4");i.className=r.AUDIT_HEADING,i.textContent=e.auditPreviousResolutions,s.appendChild(i);let a=document.createElement("ul");a.className=r.AUDIT_LIST;for(let l of o){let c=document.createElement("li");c.className=r.AUDIT_ROW;let d=document.createElement("span");d.className=r.AUDIT_ACTION,d.textContent=I(e.auditResolvedInTemplate,z(l.ms,e)||"\u2014");let p=document.createElement("time");p.className=r.AUDIT_TIME,p.dateTime=l.resolvedAt,p.textContent=ro(l.resolvedAt,t),c.append(d,p),a.appendChild(c)}return s.appendChild(a),s};function so(n,{strings:e,locale:t,open:o,onToggle:s}){let i=n?.history;if(!Array.isArray(i)||i.length===0)return null;let a=document.createElement("div");a.className=r.AUDIT_BLOCK;let l=document.createElement("button");l.type="button",l.className=r.AUDIT_TOGGLE,l.setAttribute("aria-expanded",String(o)),l.textContent=I(e.auditToggleTemplate,i.length);let c=document.createElement("div");c.className=r.AUDIT_BODY,c.hidden=!o;let d=document.createElement("ul");d.className=r.AUDIT_LIST,d.setAttribute("aria-label",e.auditTrailLabel);for(let u of[...i].reverse())d.appendChild(Dr(u,e,t));c.appendChild(d);let p=Br(n,e,t);return p&&c.appendChild(p),l.addEventListener("click",()=>{let u=l.getAttribute("aria-expanded")!=="true";l.setAttribute("aria-expanded",String(u)),c.hidden=!u,s?.(u)}),a.append(l,c),a}var J="unset",Pr=36e5,wt=(n,e)=>{let t={};for(let o of n)t[o]=0;return e&&(t[e]=0),t},kr=n=>{if(n.length===0)return null;let e=Math.floor(n.length/2);return n.length%2?n[e]:(n[e-1]+n[e])/2};function de(n){let e=Array.isArray(n)?n:[],t=wt(N),o=wt(R,J),s=wt(w,J),i=new Map,a=[],l=0;for(let d of e){let p=N.includes(d.status)?d.status:"open";t[p]++,o[R.includes(d.type)?d.type:J]++,s[w.includes(d.priority)?d.priority:J]++;let u=String(d.createdAt||"").slice(0,10);u&&i.set(u,(i.get(u)||0)+1);let h=ie(d);h!==null&&a.push(h),q(d).length>1&&l++}a.sort((d,p)=>d-p);let c=a.reduce((d,p)=>d+p,0);return{total:e.length,byStatus:t,byType:o,byPriority:s,overTime:[...i.entries()].sort(([d],[p])=>d<p?-1:1).map(([d,p])=>({date:d,count:p})),resolution:{resolvedCount:a.length,averageMs:a.length?c/a.length:null,medianMs:kr(a),reopenedCount:l}}}var pe=n=>n==null?null:Math.round(n/Pr*10)/10;var ao="rgba(255,255,255,0.42)",lo=300,vt=96,$r="http://www.w3.org/2000/svg",S=(n,e,t)=>{let o=document.createElement(n);return e&&(o.className=e),t!==void 0&&(o.textContent=String(t)),o},Nt=(n,e={})=>{let t=document.createElementNS($r,n);for(let[o,s]of Object.entries(e))t.setAttribute(o,String(s));return t},Se=(n,e)=>{let t=S("div",r.METRICS_TILE);return t.appendChild(S("span",r.METRICS_TILE_VALUE,e)),t.appendChild(S("span",r.METRICS_TILE_LABEL,n)),t},Lt=(n,e,t)=>{let o=S("div",r.METRICS_GROUP);o.dataset.metricsGroup=n,o.appendChild(S("h4",r.METRICS_HEADING,e));let s=Math.max(1,...t.map(i=>i.count));for(let{label:i,count:a,color:l}of t){let c=S("div",r.METRICS_ROW);c.dataset.metricsRow="",c.appendChild(S("span",r.METRICS_ROW_LABEL,i));let d=S("div",r.METRICS_TRACK),p=S("div",r.METRICS_BAR);p.dataset.metricsBar="",p.style.width=`${Math.round(a/s*100)}%`,p.style.background=l,d.appendChild(p),c.appendChild(d),c.appendChild(S("span",r.METRICS_ROW_COUNT,a)),o.appendChild(c)}return o},Hr=(n,e)=>{let t=S("div",r.METRICS_GROUP);t.dataset.metricsGroup="overTime",t.appendChild(S("h4",r.METRICS_HEADING,e.metricsOverTime));let o=Math.max(1,...n.map(({count:c})=>c)),s=Nt("svg",{class:r.METRICS_CHART,viewBox:`0 0 ${lo} ${vt}`,preserveAspectRatio:"none",role:"img","aria-label":`${e.metricsOverTime}: ${n.map(({date:c,count:d})=>`${c} ${d}`).join(", ")}`}),i=lo/n.length,a=Math.max(2,Math.min(i-3,28));n.forEach(({date:c,count:d},p)=>{let u=Math.max(2,d/o*(vt-6)),h=Nt("rect",{x:p*i+(i-a)/2,y:vt-u,width:a,height:u,rx:2});h.appendChild(Object.assign(Nt("title"),{textContent:`${c}: ${d}`})),s.appendChild(h)}),t.appendChild(s);let l=S("div",r.METRICS_AXIS);return l.appendChild(S("span",null,n[0].date)),n.length>1&&l.appendChild(S("span",null,n[n.length-1].date)),t.appendChild(l),t},Ur=(n,e)=>{let t=S("div",r.METRICS_EXPORTS);t.setAttribute("aria-label",n.metricsExportLabel);let o=(s,i,a)=>{let l=S("button",r.METRICS_EXPORT_BTN,i);return l.type="button",l.dataset.export=s,l.addEventListener("click",a),l};return t.appendChild(o("comments",n.metricsExportComments,e.onExportComments)),t.appendChild(o("metrics",n.metricsExportMetrics,e.onExportMetrics)),t.appendChild(o("print",n.metricsPrint,e.onPrint)),t};function co(n,e){let{strings:t}=e,o=S("div",r.METRICS_VIEW);if(n.total===0)return o.appendChild(S("p",r.METRICS_EMPTY,t.metricsEmpty)),o;let s=a=>a===null?"\u2014":z(a,t),i=S("div",r.METRICS_TILES);return i.appendChild(Se(t.metricsTotal,n.total)),i.appendChild(Se(t.statusResolved,n.resolution.resolvedCount)),i.appendChild(Se(t.metricsReopened,n.resolution.reopenedCount)),i.appendChild(Se(t.metricsAverageResolution,s(n.resolution.averageMs))),i.appendChild(Se(t.metricsMedianResolution,s(n.resolution.medianMs))),o.appendChild(i),o.appendChild(Lt("status",t.metricsByStatus,N.map(a=>({label:B(a,t),count:n.byStatus[a],color:V[a]})))),o.appendChild(Lt("type",t.metricsByType,[...R.map(a=>({label:L(a,t),count:n.byType[a],color:Y[a]})),{label:t.unset,count:n.byType[J],color:ao}])),o.appendChild(Lt("priority",t.metricsByPriority,[...w.map(a=>({label:M(a,t),count:n.byPriority[a],color:W[a]})),{label:t.unset,count:n.byPriority[J],color:ao}])),n.overTime.length&&o.appendChild(Hr(n.overTime,t)),o.appendChild(Ur(t,e)),o}var po='<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>',Xr='<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>',Fr='<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>',Qe=class{constructor({shadowRoot:e,strings:t,locale:o,currentPage:s,getComments:i,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=o,this.currentPage=s,this.getComments=i,this.callbacks=a,this.options=l,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.contextExpanded=!0,this.auditExpanded=!1,this.showMetrics=!1,this.editing=null,this.notice=null,this._cardBindings=new Map,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null,this._reactions=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=r.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.el.setAttribute("tabindex","-1"),this.shadowRoot.appendChild(this.el),this.render(),this.el.focus())}close(){this._clearHighlight(),this._setActiveMarker(null),this.el?.remove(),this.el=null,this._cardBindings.clear(),this.detailId=null,this.editing=null,this.notice=null}refresh(){this.el&&this.render()}_resetFilters(){this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}showNotice(e){this.notice=e,this.refresh()}clearNotice(){this.notice&&(this.notice=null,this.refresh())}isDirty(){return this.editing?this.editing.draft.trim()!==this._editingOriginalText().trim():!1}_editingOriginalText(){if(!this.editing)return"";let e=this.getComments().find(o=>A(o.id,this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(o=>A(o.id,this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await Ye(e,this.strings))return!1}return this.editing=null,!0}_editorHandlers(){return{draft:this.editing.draft,onInput:e=>{this.editing.draft=e},onSave:e=>{let{commentId:t,replyId:o}=this.editing;o==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,o,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return ae({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(Zn(e.id))}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(r.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(r.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(r.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(r.CIRCLE_ACTIVE),this._activeMarkerEl=t)}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter!=="all"&&(e=e.filter(t=>(t.status||"open")===this.statusFilter)),this.typeFilter!=="all"&&(e=e.filter(t=>t.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(t=>t.priority===this.priorityFilter)),[...e.filter(t=>t.status!=="resolved"),...e.filter(t=>t.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight();let e=this.filteredComments(),t=this.detailId!=null?e.find(o=>A(o.id,this.detailId)):null;if(this._setActiveMarker(t),this.showMetrics){this._cardBindings.clear(),this.el.innerHTML="",this._renderMetrics(e);return}t?(this._cardBindings.clear(),this.el.innerHTML="",this._renderDetail(t,e)):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(o=>A(o.id,e));t&&this._openDetail(t)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render()}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=r.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}_metricsButton(){let e=document.createElement("button");return e.type="button",e.className=r.INBOX_METRICS_BTN,e.textContent=this.strings.metricsOpen,e.setAttribute("aria-label",this.strings.metricsTitle),e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.showMetrics=!0,this.detailId=null,this.render())}),e}_renderMetrics(e){let t=document.createElement("div");t.className=r.INBOX_DETAIL_HEADER;let o=document.createElement("button");o.type="button",o.className=r.INBOX_BACK,o.innerHTML=`${po}<span>${this.strings.back}</span>`,o.addEventListener("click",()=>{this.showMetrics=!1,this.render()}),t.appendChild(o);let s=document.createElement("div");s.className=r.INBOX_CARD_ACTIONS,s.appendChild(this._closeButton()),t.appendChild(s),this.el.appendChild(t);let i=this._filterSummaryLabel();this.el.appendChild(co(de(e),{strings:this.strings,locale:this.locale,onExportComments:()=>this.callbacks.onExportComments(e),onExportMetrics:()=>this.callbacks.onExportMetrics(e),onPrint:()=>this.callbacks.onPrintReport(e,i)}))}_renderList(e){let t=[...this.el.children].find(i=>i.classList.contains(r.INBOX_LIST));if(!t){this.el.innerHTML="",this._cardBindings.clear();let i=document.createElement("div");i.className=r.INBOX_HEADER,this.el.appendChild(i),t=document.createElement("div"),t.className=r.INBOX_LIST,this.el.appendChild(t)}let o=[...this.el.children].find(i=>i.classList.contains(r.INBOX_HEADER)),s=document.createElement("div");s.className=r.INBOX_HEADER_ACTIONS,s.append(this._metricsButton(),this._closeButton()),o.replaceChildren(this._buildFilter(),s),this._reconcileCards(t,e)}_reactionsUi(){return this._reactions||(this._reactions=Ue({actorKey:()=>this.callbacks.actorKey(),strings:this.strings,onToggle:(e,t)=>{let o=this.getComments().find(s=>(s.replies||[]).includes(e));o?this.callbacks.onToggleReplyReaction(o.id,e.id,t):this.callbacks.onToggleCommentReaction(e.id,t)}})),this._reactions}_cardFingerprint(e){return JSON.stringify([e.text,e.editedAt??null,e.status??"open",e.type??null,e.priority??null,e.tags??[],e.resolvedAt??null,e.history?.length??0,e.history?.at(-1)?.at??null,e.anchorState,e.hidden===!0,e.page,e.screenshots?.length??0,Et(e).map(({emoji:t,authors:o})=>[t,o.length])])}_reconcileCards(e,t){for(let i of[...e.children])(i.classList.contains(r.INBOX_NOTICE)||i.classList.contains(r.INBOX_EMPTY))&&i.remove();let o=[];if(this.notice){let i=document.createElement("div");i.className=r.INBOX_NOTICE,i.setAttribute("role","status"),i.textContent=this.notice,o.push(i)}let s=new Set;if(t.length===0)o.push(this._buildEmptyState());else for(let i of t){let a=String(i.id),l=this._cardFingerprint(i),c=this._cardBindings.get(a),d;c&&c.comment===i&&c.fingerprint===l?d=c.card:(d=this._buildCard(i,{interactive:!0}),this._cardBindings.set(a,{comment:i,fingerprint:l,card:d})),s.add(a),o.push(d)}for(let i of[...this._cardBindings.keys()])s.has(i)||this._cardBindings.delete(i);for(o.forEach((i,a)=>{e.children[a]!==i&&e.insertBefore(i,e.children[a]??null)});e.children.length>o.length;)e.lastElementChild.remove()}_buildEmptyState(){let e=document.createElement("div");e.className=r.INBOX_EMPTY;let t=document.createElement("div");t.className=r.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let o=this.getComments().length>0,s=document.createElement("div");if(s.className=r.INBOX_EMPTY_TITLE,s.textContent=o?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(s),o){let p=document.createElement("button");return p.type="button",p.className=r.INBOX_EMPTY_ACTION,p.textContent=this.strings.filterClear,p.addEventListener("click",()=>{this._resetFilters()}),e.appendChild(p),e}let i=document.createElement("div");i.className=r.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=r.INBOX_EMPTY_KBD,c.textContent=Ot(this.options,this.strings),i.appendChild(document.createTextNode(a??"")),i.appendChild(c),i.appendChild(document.createTextNode(l??"")),e.appendChild(i);let d=document.createElement("button");return d.type="button",d.className=r.INBOX_EMPTY_ACTION,d.textContent=this.strings.inboxEmptyAction,d.addEventListener("click",()=>this.callbacks.onActivateCommentMode()),e.appendChild(d),e}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(B(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(L(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(M(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_isFilterActive(){return this.pageFilter!=="page"||this.statusFilter!=="all"||this.typeFilter!=="all"||this.priorityFilter!=="all"}_buildFilterGroup({title:e,dataAttr:t,values:o,labelOf:s,selected:i,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=r.INBOX_FILTER_GROUP;let d=document.createElement("div");d.className=r.INBOX_FILTER_SECTION,d.textContent=e,c.appendChild(d);let p=document.createElement("div");p.className=r.INBOX_FILTER_CHIPS,p.setAttribute("role",a?"group":"radiogroup"),p.setAttribute("aria-label",e);for(let u of o){let h=i===u,m=document.createElement("button");m.type="button",m.className=r.INBOX_FILTER_CHIP,m.dataset[t]=u,m.setAttribute("role",a?"switch":"radio"),m.setAttribute("aria-checked",String(h)),m.textContent=s(u),m.addEventListener("click",f=>{f.stopPropagation(),l(a&&h?"all":u),this.render()}),p.appendChild(m)}return c.appendChild(p),c}_buildFilter(){let e=document.createElement("div");e.className=r.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=r.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${We}`;let o=document.createElement("div");o.className=r.INBOX_FILTER_MENU,o.setAttribute("role","group"),o.setAttribute("aria-label",this.strings.filterTitle),j(t,o);let s=document.createElement("div");s.className=r.INBOX_FILTER_MENU_HEADER;let i=document.createElement("span");i.textContent=this.strings.filterTitle,s.appendChild(i);let a=document.createElement("button");return a.type="button",a.className=r.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this._resetFilters()}),s.appendChild(a),o.appendChild(s),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPage,dataAttr:"filterPage",values:["page","all"],labelOf:l=>this._pageFilterLabel(l),selected:this.pageFilter,toggles:!1,onSelect:l=>this.pageFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...N],labelOf:l=>B(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...R],labelOf:l=>L(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...w],labelOf:l=>M(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(o),e}_buildCard(e,{interactive:t}){let o=document.createElement("div");o.className=r.INBOX_CARD,e.status==="resolved"&&o.classList.add(`${r.INBOX_CARD}--resolved`),o.dataset.commentId=e.id;let s=document.createElement("div");s.className=r.INBOX_CARD_HEADER,s.appendChild(Te(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),o.appendChild(s);let i=document.createElement("div");if(i.className=r.THREAD_ACTIONS_ROW,i.appendChild(this._buildCardActions(e)),o.appendChild(i),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))o.appendChild(this._buildEditor());else{let d=document.createElement("div");d.className=r.INBOX_CARD_TEXT,d.textContent=e.text,o.appendChild(d)}if(e.screenshots?.length){let d=_e(e.screenshots,this.strings);U(d,p=>this.callbacks.onShowLightbox(p)),o.appendChild(d)}let l=At(e,this.strings,{includeClassification:!1});l&&o.appendChild(l),o.appendChild(this._reactionsUi().bar(e));let c=this._buildTag(e);if(c&&o.appendChild(c),t){o.setAttribute("role","button"),o.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=r.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",u=>{u.stopPropagation(),d()}),o.appendChild(p),o.addEventListener("click",d),o.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),d())}),o.addEventListener("mouseenter",()=>this._highlight(e)),o.addEventListener("mouseleave",()=>this._clearHighlight())}return o}_buildTag(e){let t=null;if(e.anchorState==="orphaned"?t=this.strings.orphanedBadge:e.hidden?t=this.strings.hiddenBadge:e.anchorState==="inactive"&&(t=e.page),!t)return null;let o=document.createElement("span");return o.className=r.INBOX_CARD_TAG,o.textContent=t,o}_buildCardActions(e){return Ve(e,{strings:this.strings,reactions:this._reactionsUi(),onCopy:t=>se(qe(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>se(oe(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,o)=>this.callbacks.onSetStatus(t.id,o),onSetType:(t,o)=>this.callbacks.onSetType(t.id,o),onSetPriority:(t,o)=>this.callbacks.onSetPriority(t.id,o),onDelete:t=>{this.detailId!=null&&A(this.detailId,t.id)&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let o=t.indexOf(e),s=document.createElement("div");s.className=r.INBOX_DETAIL_HEADER;let i=document.createElement("button");i.type="button",i.className=r.INBOX_BACK,i.innerHTML=`${po}<span>${this.strings.back}</span>`,i.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.detailId=null,this.render())}),s.appendChild(i);let a=document.createElement("div");a.className=r.INBOX_CARD_ACTIONS;let l=(h,m,f)=>{let g=document.createElement("button");g.type="button",g.className=r.INBOX_NAV_BTN,g.setAttribute("aria-label",m),g.title=m,g.innerHTML=h;let E=t[f];return g.disabled=!E,E&&g.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(E)}),g};a.appendChild(l(Xr,this.strings.prevComment,o-1)),a.appendChild(l(Fr,this.strings.nextComment,o+1)),a.appendChild(this._closeButton()),s.appendChild(a),this.el.appendChild(s);let c=document.createElement("div");c.className=r.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let d=Ke(e,{strings:this.strings,onShowLightbox:h=>this.callbacks.onShowLightbox(h),collapsible:!0,expanded:this.contextExpanded,onToggle:h=>{this.contextExpanded=h}});d&&c.appendChild(d);let p=so(e,{strings:this.strings,locale:this.locale,open:this.auditExpanded,onToggle:h=>{this.auditExpanded=h}});p&&c.appendChild(p);let u=document.createElement("div");u.className=r.INBOX_REPLIES;for(let h of e.replies||[]){let m=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(h.id),f=xe(h,this.strings,this.locale,{onDelete:(g,E)=>{this.callbacks.onDeleteReply(e.id,g.id)&&E.remove()},onEdit:g=>this.startEditing(e.id,g.id),editing:m?this._editorHandlers():null,reactions:this._reactionsUi()});U(f,g=>this.callbacks.onShowLightbox(g)),u.appendChild(f)}c.appendChild(u),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:o,screenshotsContainer:s,attachBtn:i,fileInput:a,submitBtn:l}=je({areaClassName:r.THREAD_INPUT_AREA,inputTag:"input",inputClassName:r.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],d=()=>{le(s,c,{strings:this.strings,onShow:u=>this.callbacks.onShowLightbox(u),rerender:()=>d()})};i.addEventListener("click",()=>a.click()),ce(a,()=>c,d);let p=()=>{let u=o.value.trim();!u&&c.length===0||(this.callbacks.onReply(e,u,[...c]),c=[],this.render())};return l.addEventListener("click",p),o.addEventListener("keydown",u=>{u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),p())}),t}};var uo=",",zr=`\r
23
+ `,Gr=/^[=+\-@\t\r]/,ho=n=>{if(n==null)return"";let e=String(n),t=Gr.test(e)?`'${e}`:e;return/["\n\r,]/.test(t)?`"${t.replace(/"/g,'""')}"`:t};function Mt(n,e){let t=e.map(s=>ho(s.label)).join(uo),o=n.map(s=>e.map(i=>ho(s[i.key])).join(uo));return[t,...o].join(zr)}var mo=["id","page","author","authorId","text","status","type","priority","tags","createdAt","resolvedAt","resolutionHours","reopened","replies"],Dt=n=>n.map(e=>({key:e,label:e})),fo=["section","key","value"];function go(n){return(n||[]).map(e=>({id:String(e.id),page:e.page||"",author:e.author||"",authorId:e.authorId||"",text:e.text||"",status:e.status||"open",type:e.type||"",priority:e.priority||"",tags:(e.tags||[]).join(" "),createdAt:e.createdAt||"",resolvedAt:e.resolvedAt||"",resolutionHours:pe(ie(e)),reopened:q(e).length>1?"yes":"no",replies:(e.replies||[]).length}))}function Eo(n){let e=[{section:"total",key:"",value:n.total}],t=(o,s)=>{for(let[i,a]of Object.entries(s))e.push({section:o,key:i,value:a})};t("status",n.byStatus),t("type",n.byType),t("priority",n.byPriority);for(let{date:o,count:s}of n.overTime)e.push({section:"perDay",key:o,value:s});return e.push({section:"resolution",key:"resolvedCount",value:n.resolution.resolvedCount},{section:"resolution",key:"reopenedCount",value:n.resolution.reopenedCount},{section:"resolution",key:"averageHours",value:pe(n.resolution.averageMs)},{section:"resolution",key:"medianHours",value:pe(n.resolution.medianMs)}),e}function Bt(n,e){let t=new Blob(["\uFEFF",e],{type:"text/csv;charset=utf-8"}),o=URL.createObjectURL(t),s=document.createElement("a");s.href=o,s.download=n,s.click(),URL.revokeObjectURL(o)}var Vr="helldots-report-styles",G=(n,e,t,o)=>{let s=n.createElement(e);return t&&(s.className=t),o!==void 0&&(s.textContent=String(o)),s},Pt=(n,e,t,o)=>{let s=G(n,"table","report-table");s.appendChild(G(n,"caption",null,e));let i=n.createElement("thead"),a=n.createElement("tr");for(let c of o)a.appendChild(G(n,"th",null,c));i.appendChild(a),s.appendChild(i);let l=n.createElement("tbody");for(let[c,d]of t){let p=n.createElement("tr");p.appendChild(G(n,"th",null,c)),p.appendChild(G(n,"td",null,d)),l.appendChild(p)}return s.appendChild(l),s},bo=n=>n===null?"\u2014":I("{n} h",pe(n)),Yr=(n,e,{strings:t,locale:o,scope:s})=>{let i=n.body;i.className="report",i.appendChild(G(n,"h1","report-title",t.metricsTitle));let a=G(n,"p","report-meta");if(a.textContent=I(t.metricsGeneratedTemplate,new Intl.DateTimeFormat(o,{dateStyle:"long",timeStyle:"short"}).format(new Date)),i.appendChild(a),s){let c=G(n,"p","report-meta");c.textContent=`${t.metricsScope}: ${s}`,i.appendChild(c)}i.appendChild(Pt(n,t.metricsTitle,[[t.metricsTotal,e.total],[t.statusResolved,e.resolution.resolvedCount],[t.metricsReopened,e.resolution.reopenedCount],[t.metricsAverageResolution,bo(e.resolution.averageMs)],[t.metricsMedianResolution,bo(e.resolution.medianMs)]],[t.metricsCategory,t.metricsCount]));let l=(c,d,p,u)=>Pt(n,c,d.map(h=>[u(h),p[h]??0]),[t.metricsCategory,t.metricsCount]);i.appendChild(l(t.metricsByStatus,N,e.byStatus,c=>B(c,t))),i.appendChild(l(t.metricsByType,[...R,"unset"],e.byType,c=>c==="unset"?t.unset:L(c,t))),i.appendChild(l(t.metricsByPriority,[...w,"unset"],e.byPriority,c=>c==="unset"?t.unset:M(c,t))),e.overTime.length&&i.appendChild(Pt(n,t.metricsOverTime,e.overTime.map(({date:c,count:d})=>[c,d]),[t.metricsDate,t.metricsCount]))};function Co(n,{strings:e,locale:t,css:o,scope:s}){let i=document.createElement("iframe");i.setAttribute("aria-hidden","true"),i.setAttribute("title",e.metricsTitle),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.border="0",i.style.left="-9999px",document.body.appendChild(i);let a=i.contentDocument,l=i.contentWindow;a.title=e.metricsTitle,Ee(a,o,Vr),Yr(a,n,{strings:e,locale:t,scope:s});let c=()=>i.remove();return l.addEventListener("afterprint",c,{once:!0}),setTimeout(()=>l.print?.(),0),i}var Wr=n=>{let e=new Set;for(let t of n){let o=String(t).trim().toLowerCase();o&&e.add(o)}return[...e]},To=n=>n.filter(e=>typeof e=="string"),jr={"comment:created":"onCommentCreated","comment:edited":"onCommentEdited","comment:deleted":"onCommentDeleted","comment:status-changed":"onCommentStatusChanged","comment:updated":"onCommentUpdated","comment:anchor-lost":"onAnchorLost","reply:added":"onReplyAdded","reply:deleted":"onReplyDeleted","reply:edited":"onReplyEdited","reaction:toggled":"onReactionToggled"},kt=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=St(),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,embedCrossOriginFonts:e.embedCrossOriginFonts===!0,...e},this.locale=this.options.locale||On(),this.strings=An(this.locale),this.markers=null,this._captureFlow=null,this._storedCache=null,this._popover=null,this._pendingDetailId=null,document.readyState==="loading"?(this._onDomReady=()=>this.initOverlay(),document.addEventListener("DOMContentLoaded",this._onDomReady)):this.initOverlay()}initOverlay(){this.shadowRoot=cn(),this.toolbar=Kn(this.options,this.strings),this.commentBox=qn(this.strings),this.overlay=document.createElement("div"),this.overlay.className=r.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${r.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${r.TOOLBAR_MENU_BTN}`),this.submitButton=this.shadowRoot.getElementById(O.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(O.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${r.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(O.ATTACH_IMAGE_INPUT),this._captureFlow=new Le({host:this.shadowRoot,autoScreenshot:this.options.autoScreenshot,embedCrossOriginFonts:this.options.embedCrossOriginFonts,onRegionCaptured:e=>{this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length<Ne&&this._pendingScreenshots.push(e)},onPlace:(e,t)=>this._placeCommentAtPoint(e,t)}),this._popover=new Ze({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,findComment:e=>this._findComment(e),removeTooltip:e=>this._tooltipEl(e)?.remove(),onShowLightbox:e=>this.showLightbox(e),isInsideLightbox:e=>this._isInsideLightbox(e),linkParam:()=>this._linkParam(),refreshInbox:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},actorKey:()=>this._actorKey(),actions:{addReply:(e,t,o)=>this.addReply(e,t,o),deleteReply:(e,t)=>this.deleteReply(e,t),editComment:(e,t)=>this.editComment(e,t),editReply:(e,t,o)=>this.editReply(e,t,o),setStatus:(e,t)=>this.setCommentStatus(e,t),setType:(e,t)=>this.setCommentType(e,t),setPriority:(e,t)=>this.setCommentPriority(e,t),deleteComment:e=>this.deleteComment(e),toggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),toggleReplyReaction:(e,t,o)=>this.toggleReplyReaction(e,t,o)}}),this.markers=new Je({container:this.overlay,strings:this.strings,getComments:()=>this.comments,wireMarker:(e,t)=>this._wireMarker(e,t),onMarkerHidden:e=>this._dismissMarkerUi(e),onVisibilityFlip:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},onAfterPass:()=>this.syncThreadPopoverToMarker()}),this.markers.start(),this.bindEventListeners(),this.setupKeyboardShortcut(),this.injectStyles(),this._pendingDetailId=this._readPendingDetailId(),this.options.persistence==="localStorage"&&(this._storedCache=mt(),this.loadComments(this._storedCache),this._storageHandler=e=>{(e.key===Be||e.key===null)&&(this._storedCache=null)},window.addEventListener("storage",this._storageHandler)),this._openPendingDetail(),this.options.autoDetectNavigation&&(this._popstateHandler=()=>this.notifyNavigation(),window.addEventListener("popstate",this._popstateHandler))}_navigateTo(e){if(typeof this.options.navigate=="function"){this.options.navigate(e);return}location.assign(e)}_readPendingDetailId(){let e=Hn(this._linkParam()),t=null;try{t=sessionStorage.getItem(Pe),t!=null&&sessionStorage.removeItem(Pe)}catch{}return e??t}_linkParam(){return this.options.linkParam||Xe}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this._findComment(e);if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound);return}this._pendingDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_emit(e,t,o){let s=jr[e],i=this.options[s];if(typeof i=="function")try{i(...t)}catch(a){console.warn(`HellDots: ${s} handler threw`,a)}if(typeof this.options.onChange=="function")try{this.options.onChange({type:e,...o})}catch(a){console.warn("HellDots: onChange handler threw",a)}}commentLink(e){let t=this._findComment(e);return t?oe(t,this._linkParam()):null}_readStoredCached(){return this._storedCache||(this._storedCache=mt()),this._storedCache}_syncStorage(){if(this.options.persistence!=="localStorage")return;let e=ft(this._readStoredCached(),this.serializeComments(),location.pathname);ke(e),this._storedCache=e}bindEventListeners(){this.commentBtn.addEventListener("click",()=>this.toggleCommentMode()),this.inboxBtn.addEventListener("click",()=>this.toggleInbox()),this.submitButton.addEventListener("click",()=>this.saveComment()),this.commentInput.addEventListener("keydown",e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.saveComment())}),this.attachImageBtn.addEventListener("click",()=>{this.attachImageInput.click()}),ce(this.attachImageInput,()=>(this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots),()=>this._updateScreenshotsPreview()),this._handleDocumentClickBound=e=>this.handleDocumentClick(e),document.addEventListener("mousedown",this._handleDocumentClickBound)}setupKeyboardShortcut(){this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=e=>{if(e.key==="Escape"){this._activeLightbox?this.closeLightbox():this.activeThreadPopover?this._popover.isEditing()?this._popover.releaseEditor():this.closeThreadPopover():this.inboxView?.isOpen()?this.inboxView.editing?this.inboxView.releaseEditor().then(i=>i&&this.inboxView?.refresh()):this.closeInbox():this.commentBox.style.display!=="none"?(this.hideCommentBox(),this.toggleCommentMode()):this.commentMode&&this.toggleCommentMode();return}let t=this.options.shortcutKey.toLowerCase(),o=e.key.toLowerCase()===t||e.altKey&&/^[a-z]$/.test(t)&&e.code===`Key${t.toUpperCase()}`,s=this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey;o&&s&&(e.preventDefault(),e.stopPropagation(),this.toggleCommentMode())},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let t=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(t)||t?.closest?.(`.${r.CIRCLE}`)||t?.closest?.(`.${r.TOOLTIP}`)||t?.closest?.(`.${r.THREAD_POPOVER}`)||t?.closest?.(`.${r.INBOX_PANEL}`)||t?.closest?.(`.${r.LIGHTBOX}`))&&!this.commentBox.contains(t)){if(this.commentBox.style.display!=="none"){this.hideCommentBox(),this.toggleCommentMode();return}e.button===0&&(e.preventDefault(),this._captureFlow.beginDrag(e))}}async _placeCommentAtPoint(e,t){this._captureFlow.armClickCapture();let o=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let s=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=o||"";let i=s?.closest?.(gn.CONTAINER)||document.body,a=i.getBoundingClientRect(),l=a.width>0?(e-a.left)/a.width:0,c=a.height>0?(t-a.top)/a.height:0,d=Ln(i,l,c);d.targetSelector=s&&s!==i?Nn(s):null,this.currentPosition={container:i,relativeX:l,relativeY:c,anchor:d,target:s||i},this.createPreviewCircle(e,t),document.body.classList.remove(r.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${r.SCREENSHOTS_CONTAINER}`);e&&le(e,this._pendingScreenshots||[],{strings:this.strings,onShow:t=>this.showLightbox(t),rerender:()=>this._updateScreenshotsPreview()})}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${r.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(r.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let s=P/2,i=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),d=c.width||400,p=e+s,u=t+s,h=p+i,m=u-s;h+d>a&&(h=p-i-d),h=Math.min(h,a-d-10),h=Math.max(10,h),m+c.height>l&&(m=l-c.height-10),m=Math.max(10,m),this.commentBox.style.left=`${h}px`,this.commentBox.style.top=`${m}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._captureFlow?.clearPending(),this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(r.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),this.commentBtn?.classList.toggle(r.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(r.ACTIVE,this.commentMode),document.body.classList.toggle(r.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox()}async saveComment(){if(!this._saving&&!(!this.commentInput.value.trim()||!this.currentPosition)){this._saving=!0;try{await this._saveCommentNow()}finally{this._saving=!1}}}async _saveCommentNow(){let e=await this._captureFlow.consumePending();if(!this.currentPosition)return;let t={text:this.commentInput.value,container:this.currentPosition.container,relativeX:this.currentPosition.relativeX,relativeY:this.currentPosition.relativeY,anchor:this.currentPosition.anchor,anchorState:"anchored",target:this.currentPosition.target,hidden:!1,status:"open",page:location.pathname,id:gt(),replies:[],author:this.options.user?.name||this.strings.anonymous,authorId:H(this.options.user?.id)||null,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:Tn(),contextScreenshot:e};K(t,"created",this._actor()),this.comments.push(t),this._syncStorage();let o=this._serializeComment(t);this._emit("comment:created",[o],{comment:o}),this.renderCommentCircle(t),this.hideCommentBox(),this.toggleCommentMode();let s=this._circles.get(String(t.id));s&&this.showThreadPopover(s,t)}renderCommentCircle(e){this.markers.render(e)}_wireMarker(e,t){e.addEventListener("mouseenter",()=>this.showCommentTooltip(e,t)),e.addEventListener("mouseleave",()=>{setTimeout(()=>{let o=this._tooltipEl(t.id);o&&!o.matches(":hover")&&o.remove()},250)}),e.addEventListener("click",o=>{if(o.stopPropagation(),this._tooltipEl(t.id)?.remove(),this.activeThreadPopover?.dataset.for===String(t.id)){this.closeThreadPopover();return}this.showThreadPopover(e,t)}),e.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),e.click())})}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${r.THREAD_POPOVER}[data-for="${Z(t.id)}"]`)||this._tooltipEl(t.id))return;let s=eo(t,this.strings,this.locale);this.shadowRoot.appendChild(s),U(s,i=>this.showLightbox(i)),setTimeout(()=>{ye(s,e)},10),s.querySelector(`.${r.CLOSE_TOOLTIP}`).addEventListener("click",i=>{i.stopPropagation(),s.remove()}),s.addEventListener("mouseleave",()=>s.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new Qe({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:{onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onReply:(e,t,o)=>this.addReply(e,t,o),onDelete:e=>this.deleteComment(e),onDeleteReply:(e,t)=>this.deleteReply(e,t),onEditComment:(e,t)=>{this.editComment(e,t)&&this._popover.refreshCommentViews(e)},onEditReply:(e,t,o)=>{this.editReply(e,t,o)&&this._popover.refreshCommentViews(e)},actorKey:()=>this._actorKey(),onToggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),onToggleReplyReaction:(e,t,o)=>this.toggleReplyReaction(e,t,o),onExportComments:e=>this.exportCommentsCsv(e),onExportMetrics:e=>this.exportMetricsCsv(e),onPrintReport:(e,t)=>this.printMetricsReport(e,t),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(),this._disarmInboxOutsideClick(),this._inboxClickTimer=setTimeout(()=>{this._inboxClickTimer=null,this._inboxClickHandler=e=>{let t=e.composedPath()[0]||e.target;if(!this.inboxView.el?.contains(t)&&!this.inboxBtn.contains(t)&&!this._isInsideLightbox(t)){if(this.inboxView.isDirty())return;this.closeInbox()}},document.addEventListener("mousedown",this._inboxClickHandler)},0)}closeInbox(){this.inboxView?.close(),this._disarmInboxOutsideClick()}_disarmInboxOutsideClick(){this._inboxClickTimer&&(clearTimeout(this._inboxClickTimer),this._inboxClickTimer=null),this._inboxClickHandler&&(document.removeEventListener("mousedown",this._inboxClickHandler),this._inboxClickHandler=null)}get activeThreadPopover(){return this._popover?.active??null}showThreadPopover(e,t){this._popover.show(e,t)}closeThreadPopover(){this._popover?.close()}syncThreadPopoverToMarker(){this._popover?.syncToMarker()}showLightbox(e){this.closeLightbox(),this._lightboxReturnFocus=this.shadowRoot.activeElement||document.activeElement;let t=document.createElement("div");t.className=r.LIGHTBOX,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",this.strings.screenshotPreview);let o=document.createElement("img");o.className=r.LIGHTBOX_IMG,o.src=e,o.alt=this.strings.screenshotPreview;let s=document.createElement("button");s.type="button",s.className=r.LIGHTBOX_CLOSE,s.setAttribute("aria-label",this.strings.close),s.innerHTML="&times;",s.addEventListener("click",()=>this.closeLightbox()),t.appendChild(o),t.appendChild(s),t.addEventListener("click",i=>{i.target===t&&this.closeLightbox()}),this.shadowRoot.appendChild(t),this._activeLightbox=t,this._lightboxKeydownHandler=i=>{i.key==="Tab"&&(i.preventDefault(),s.focus())},document.addEventListener("keydown",this._lightboxKeydownHandler,!0),s.focus()}closeLightbox(){if(!this._activeLightbox)return;this._lightboxKeydownHandler&&(document.removeEventListener("keydown",this._lightboxKeydownHandler,!0),this._lightboxKeydownHandler=null),this._activeLightbox.remove(),this._activeLightbox=null;let e=this._lightboxReturnFocus;this._lightboxReturnFocus=null,e?.isConnected&&e.focus?.()}_isInsideLightbox(e){return!!e?.closest?.(`.${r.LIGHTBOX}`)}_findComment(e){return this.comments.find(t=>A(t.id,e))}_tooltipEl(e){return this.shadowRoot?.querySelector(`.${r.TOOLTIP}[data-for="${Z(e)}"]`)??null}addReply(e,t,o=[]){let s=typeof e=="object"&&e!==null?e:this._findComment(e);if(!s)return null;s.replies||(s.replies=[]);let i={id:gt(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,authorId:H(this.options.user?.id)||null,timestamp:new Date().toISOString(),screenshots:o};s.replies.push(i),this._syncStorage();let a=this._serializeComment(s),l=this._serializeReply(i);return this._emit("reply:added",[a,l],{comment:a,reply:l}),i}deleteReply(e,t){let o=this._findComment(e),s=o?.replies?.findIndex(c=>A(c.id,t))??-1;if(s<0)return!1;let[i]=o.replies.splice(s,1);this._syncStorage();let a=this._serializeComment(o),l=this._serializeReply(i);return this._emit("reply:deleted",[a,l],{comment:a,reply:l}),!0}editComment(e,t){let o=this._findComment(e),s=String(t??"").trim();if(!o||!s||s===o.text)return!1;o.text=s,o.editedAt=new Date().toISOString(),K(o,"edited",this._actor()),this._circles.get(String(o.id))?.setAttribute("aria-label",`${this.strings.commentAriaLabelPrefix}${o.text}`),this._syncStorage();let i=this._serializeComment(o);return this._emit("comment:edited",[i],{comment:i}),!0}editReply(e,t,o){let s=this._findComment(e),i=s?.replies?.find(d=>A(d.id,t)),a=String(o??"").trim();if(!i||!a||a===i.text)return!1;i.text=a,i.editedAt=new Date().toISOString(),this._syncStorage();let l=this._serializeComment(s),c=this._serializeReply(i);return this._emit("reply:edited",[l,c],{comment:l,reply:c}),!0}_serializeReply({id:e,text:t,author:o,authorId:s,timestamp:i,screenshots:a,editedAt:l,reactions:c=null}){return{id:e,text:t,author:o,authorId:s||null,timestamp:i,screenshots:a||[],editedAt:l||null,reactions:Tt(c)}}_serializeComment(e){return{schemaVersion:1,id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),author:e.author,authorId:e.authorId||null,history:Gn(e.history),createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],reactions:Tt(e.reactions),resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!N.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;if(o.status===t)return!0;let s=o.status;o.status=t,o.resolvedAt=t==="resolved"?new Date().toISOString():null,K(o,"status",this._actor(),{from:s,to:t});let i=this._circles.get(String(o.id));i&&this.updateCommentPosition(o,i),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let a=this._serializeComment(o);return this._emit("comment:status-changed",[a],{comment:a}),!0}_actor(){return Fn(this.options.user,this.strings)}_actorKey(){return $n(this.options.user,this.strings)}_commitReaction(e,t){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let o=this._serializeComment(e),s=t?this._serializeReply(t):null;return this._emit("reaction:toggled",[o,s],{comment:o,reply:s}),!0}toggleCommentReaction(e,t){let o=this._findComment(e);return!o||!Ct(o,t,this._actorKey())?!1:this._commitReaction(o,null)}toggleReplyReaction(e,t,o){let s=this._findComment(e),i=s?.replies?.find(a=>A(a.id,t));return!i||!Ct(i,o,this._actorKey())?!1:this._commitReaction(s,i)}_commitUpdate(e){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let t=this._serializeComment(e);return this._emit("comment:updated",[t],{comment:t}),!0}setCommentType(e,t){if(t!==null&&!R.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=o.type??null;return o.type=t,s!==t&&K(o,"classified",this._actor(),{field:"type",from:s,to:t}),this._commitUpdate(o)}setCommentPriority(e,t){if(t!==null&&!w.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=o.priority??null;return o.priority=t,s!==t&&K(o,"classified",this._actor(),{field:"priority",from:s,to:t}),this._commitUpdate(o)}setCommentTags(e,t){if(!Array.isArray(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=(o.tags||[]).join("\0");return o.tags=Wr(t),o.tags.join("\0")!==s&&K(o,"classified",this._actor(),{field:"tags"}),this._commitUpdate(o)}getMetrics(){return de(this.serializeComments())}exportCommentsCsv(e){let t=go(e||this.serializeComments());Bt("helldots-comments.csv",Mt(t,Dt(mo)))}exportMetricsCsv(e){let t=de(e||this.serializeComments());Bt("helldots-metrics.csv",Mt(Eo(t),Dt(fo)))}printMetricsReport(e,t){let o=de(e||this.serializeComments());Co(o,{strings:this.strings,locale:this.locale,css:yn(),scope:t})}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){if(!this._findComment(e))return!1;if(this._removeComment(e),this.options.persistence==="localStorage"){let t=ft(this._readStoredCached().filter(o=>!A(o.id,e)),this.serializeComments(),location.pathname);ke(t),this._storedCache=t}return this._emit("comment:deleted",[e],{id:e}),!0}_removeComment(e){this.markers.remove(e),this.comments=this.comments.filter(t=>!A(t.id,e))}clearComments(){this.closeThreadPopover();let e=this.comments;if(this.markers.clear(),this.comments=[],this.options.persistence==="localStorage"&&e.length>0){let t=new Set(e.map(s=>String(s.id))),o=this._readStoredCached().filter(s=>!t.has(String(s.id)));ke(o),this._storedCache=o}this.inboxView?.isOpen()&&this.inboxView.refresh()}loadComments(e){let t=0,o=0,s=0;if(!Array.isArray(e))return{anchored:t,orphaned:o,inactive:s};for(let i of e){if(!i||i.id==null||typeof i.text!="string"){console.warn("HellDots: skipping malformed serialized comment",i);continue}this._removeComment(i.id);let a={id:i.id,text:i.text,editedAt:i.editedAt||null,anchor:i.anchor||null,anchorState:"orphaned",target:null,hidden:!1,page:i.page||location.pathname,container:null,relativeX:0,relativeY:0,replies:Array.isArray(i.replies)?i.replies.filter(c=>c&&typeof c=="object"&&c.id!=null&&typeof c.text=="string").map(c=>({...c,authorId:H(c.authorId)||null,...Array.isArray(c.screenshots)?{screenshots:To(c.screenshots)}:{},reactions:bt(c.reactions)})):[],author:i.author||this.strings.anonymous,authorId:H(i.authorId)||null,history:zn(i.history),createdAt:i.createdAt||new Date().toISOString(),screenshots:Array.isArray(i.screenshots)?To(i.screenshots):[],status:i.status==="closed"?"resolved":N.includes(i.status)?i.status:"open",type:R.includes(i.type)?i.type:null,priority:w.includes(i.priority)?i.priority:null,tags:Array.isArray(i.tags)?[...i.tags]:[],resolvedAt:i.resolvedAt||null,reactions:bt(i.reactions),context:i.context||null,contextScreenshot:i.contextScreenshot||null};if(i.page&&i.page!==location.pathname){a.anchorState="inactive",this.comments.push(a),s++;continue}let l=i.anchor?ht(i.anchor):null;if(l)a.container=l.element,a.relativeX=i.anchor.relativeX,a.relativeY=i.anchor.relativeY,a.anchorState="anchored",this.comments.push(a),this.renderCommentCircle(a),t++;else{this.comments.push(a),o++;let c=this._serializeComment(a);this._emit("comment:anchor-lost",[c],{comment:c})}}return this._openPendingDetail(),{anchored:t,orphaned:o,inactive:s}}notifyNavigation(){let e=location.pathname,t=0,o=0,s=0;this.closeThreadPopover(),this.hideCommentBox(),this.inboxView&&(this.inboxView.currentPage=e);for(let i of this.comments){if(this.markers.remove(i.id),i.hidden=!1,i.target=null,i._occluded=!1,i.page&&i.page!==e){i.anchorState="inactive",i.container=null,s++;continue}let a=i.anchor?ht(i.anchor):null;if(a)i.container=a.element,i.relativeX=i.anchor.relativeX,i.relativeY=i.anchor.relativeY,i.anchorState="anchored",this.renderCommentCircle(i),t++;else{i.container=null,i.anchorState="orphaned",o++;let l=this._serializeComment(i);this._emit("comment:anchor-lost",[l],{comment:l})}}return this._pendingDetailId=this._readPendingDetailId(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this._openPendingDetail(),{anchored:t,orphaned:o,inactive:s}}scrollMarkerIntoView(e){this.markers.scrollMarkerIntoView(e)}createPreviewCircle(e,t){this.removePreviewCircle();let o=document.createElement("div");o.className=`${r.CIRCLE} ${r.PREVIEW_CIRCLE}`,o.style.position="absolute";let s=P/2;o.style.left=`${e+s}px`,o.style.top=`${t+s}px`,o.style.transform="translate(-50%, -50%)",o.style.pointerEvents="none",this.overlay.appendChild(o),this.previewCircle=o}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){this.markers.cleanupResizeObserver(e)}validateAndCalculatePosition(e,t){return this.markers.validateAndCalculatePosition(e,t)}updateCommentPosition(e,t){this.markers.updatePosition(e,t)}scheduleUpdatePositions(){this.markers.scheduleUpdate()}get _circles(){return this.markers?.circles}get resizeObservers(){return this.markers?.resizeObservers}get positionValidationEnabled(){return this.markers?.enabled??!0}set positionValidationEnabled(e){this.markers&&(this.markers.enabled=e)}get _globalMutationObserver(){return this.markers?._globalMutationObserver??null}_dismissMarkerUi(e){this._tooltipEl(e.id)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}cleanup(){this._onDomReady&&(document.removeEventListener("DOMContentLoaded",this._onDomReady),this._onDomReady=null),this.markers?.destroy(),this._storageHandler&&(window.removeEventListener("storage",this._storageHandler),this._storageHandler=null),this._popstateHandler&&(window.removeEventListener("popstate",this._popstateHandler),this._popstateHandler=null),this._storedCache=null,He(),Vn(),this.closeThreadPopover(),this.closeInbox(),this.closeLightbox(),this.removePreviewCircle(),this._captureFlow?.destroy(),this._pendingScreenshots=[],this._handleDocumentClickBound&&document.removeEventListener("mousedown",this._handleDocumentClickBound),this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.toolbar&&this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),this.commentBox&&this.commentBox.parentNode&&this.commentBox.parentNode.removeChild(this.commentBox),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),document.body.classList.remove(r.COMMENT_CURSOR),this._detachStyles(),document.querySelector($)?.remove()}injectStyles(){this._detachStyles(),this._styleDetachers=[Ee(this.shadowRoot,_n(),O.STYLES),Ee(document,xn(),O.GLOBAL_STYLES)]}_detachStyles(){for(let e of this._styleDetachers??[])e();this._styleDetachers=[]}},$t=kt;function _o(n={}){let{autoInit:e=!0,...t}=n,o=()=>new $t(t);return e?o():o}var Kr=_o;return Ro(qr);})();