helldots 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -14
- package/dist/helldots.esm.js +6 -1016
- package/dist/helldots.esm.js.map +4 -4
- package/dist/helldots.umd.js +14 -1024
- package/dist/index.d.ts +153 -12
- package/package.json +3 -1
package/dist/helldots.esm.js
CHANGED
|
@@ -1,1019 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
all: initial;
|
|
5
|
-
display: block;
|
|
6
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
7
|
-
line-height: 1.5;
|
|
8
|
-
color-scheme: light;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
:host *,
|
|
12
|
-
:host *::before,
|
|
13
|
-
:host *::after {
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
font-family: inherit;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
button {
|
|
19
|
-
padding: 0;
|
|
20
|
-
font: inherit;
|
|
21
|
-
color: inherit;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
#${T.TOOLBAR} {
|
|
25
|
-
position: fixed;
|
|
26
|
-
bottom: 20px;
|
|
27
|
-
left: 50%;
|
|
28
|
-
transform: translateX(-50%);
|
|
29
|
-
z-index: ${x.TOOLBAR};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.${n.TOOLBAR_ACTION_WRAPPER} {
|
|
33
|
-
position: relative;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.${n.TOOLBAR_ACTION_TOOLTIP} {
|
|
1
|
+
/*! HellDots — MIT. Bundles nanoid (MIT) © 2017 Andrey Sitnik <andrey@sitnik.es> — https://github.com/ai/nanoid */
|
|
2
|
+
import{domToCanvas as Xt}from"modern-screenshot";var I="helldots-root",Ht=()=>{customElements.get(I)||customElements.define(I,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function We(){Ht();let o=document.querySelector(I);return o||(o=document.createElement(I),document.body.appendChild(o)),o.shadowRoot}var ie=.5,Ft=.7,Ke=o=>!o||o==="transparent"||o==="rgba(0, 0, 0, 0)",qe=()=>{let o=getComputedStyle(document.documentElement).backgroundColor;if(!Ke(o))return o;let e=getComputedStyle(document.body).backgroundColor;return Ke(e)?"#ffffff":e},Ze=()=>{try{let o=document.implementation.createHTMLDocument(""),e=o.createElement("style");return o.head.appendChild(e),e.sheet!==null}catch{return!1}},Ut=o=>{let e=[],t=o.indexOf("@font-face");for(;t!==-1;){let n=o.indexOf("{",t),s=n===-1?-1:o.indexOf("}",n);if(s===-1)break;e.push(o.slice(t,s+1)),t=o.indexOf("@font-face",s)}return e.join(`
|
|
3
|
+
`)},Ae=new Map,Vt=o=>(Ae.has(o)||Ae.set(o,fetch(o,{mode:"cors",credentials:"omit"}).then(e=>e.ok?e.text():"").then(Ut).catch(()=>"")),Ae.get(o)),zt=o=>{try{return!!o.cssRules}catch{return!1}},Gt=async o=>{let e=()=>{};if(!o||!Ze())return e;let t=Array.from(document.styleSheets).filter(r=>r.href&&!zt(r)).map(r=>r.href);if(!t.length)return e;let n=(await Promise.all(t.map(Vt))).filter(Boolean).join(`
|
|
4
|
+
`);if(!n)return e;let s=document.createElement("style");return s.textContent=n,document.head.appendChild(s),()=>s.remove()};async function ve({scale:o=1,embedCrossOriginFonts:e=!1}={}){let t=await Gt(e);try{return await Xt(document.documentElement,{scale:o,backgroundColor:qe(),...Ze()?{}:{font:!1},filter:n=>n.nodeName?.toLowerCase()!==I})}finally{t()}}var Qe=(o,e,t)=>{o.fillStyle=qe(),o.fillRect(0,0,e,t)};function Je(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?(Qe(a,n,s),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=ie,quality:n=Ft}={}){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?(Qe(r,s.width,s.height),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 i={CIRCLE:"comment-circle",CIRCLE_ACTIVE:"comment-circle--active",TOOLTIP:"comment-tooltip",TOOLBAR_TEXT:"toolbar-text",SHORTCUT_HINT:"shortcut-hint",COMMENT_INPUT_AREA:"comment-input-area",CLOSE_TOOLTIP:"close-tooltip",ACTIVE:"active",COMMENT_CURSOR:"comment-cursor",COMMENT_OVERLAY:"comment-overlay",THREAD_POPOVER:"comment-thread-popover",THREAD_HEADER:"thread-header",THREAD_BODY:"thread-body",THREAD_REPLIES:"thread-replies",THREAD_REPLY:"thread-reply",THREAD_REPLY_ACTIONS:"thread-reply-actions",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_ACTIONS_ROW:"thread-actions-row",THREAD_SCROLL:"thread-scroll",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",THREAD_TIME:"thread-time",THREAD_EDITED:"thread-edited",EDITOR:"helldots-editor",EDITOR_INPUT:"helldots-editor-input",EDITOR_ACTIONS:"helldots-editor-actions",EDITOR_SAVE:"helldots-editor-save",EDITOR_CANCEL:"helldots-editor-cancel",INBOX_NOTICE:"inbox-notice",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",CONFIRM:"helldots-confirm",CONFIRM_PANEL:"helldots-confirm-panel",CONFIRM_TITLE:"helldots-confirm-title",CONFIRM_MESSAGE:"helldots-confirm-message",CONFIRM_ACTIONS:"helldots-confirm-actions",CONFIRM_CANCEL:"helldots-confirm-cancel",CONFIRM_ACCEPT:"helldots-confirm-accept",LIGHTBOX:"helldots-lightbox",LIGHTBOX_IMG:"helldots-lightbox-img",LIGHTBOX_CLOSE:"helldots-lightbox-close",COMMENT_ACTIONS_BAR:"comment-actions-bar",ATTACH_IMAGE_BTN:"attach-image-btn",TOOLBAR_ACTIONS:"toolbar-actions",TOOLBAR_ACTION_BTN:"toolbar-action-btn",TOOLBAR_ACTION_WRAPPER:"toolbar-action-wrapper",TOOLBAR_ACTION_TOOLTIP:"toolbar-action-tooltip",TOOLBAR_COMMENT_BTN:"toolbar-comment-btn",TOOLBAR_MENU_BTN:"toolbar-menu-btn",INBOX_PANEL:"inbox-panel",INBOX_HEADER:"inbox-header",INBOX_FILTER:"inbox-filter",INBOX_FILTER_MENU:"inbox-filter-menu",INBOX_FILTER_MENU_HEADER:"inbox-filter-menu-header",INBOX_FILTER_CLEAR:"inbox-filter-clear",INBOX_FILTER_GROUP:"inbox-filter-group",INBOX_FILTER_CHIPS:"inbox-filter-chips",INBOX_FILTER_CHIP:"inbox-filter-chip",INBOX_FILTER_SECTION:"inbox-filter-section",INBOX_CLOSE:"inbox-close",INBOX_LIST:"inbox-list",INBOX_CARD:"inbox-card",INBOX_CARD_HEADER:"inbox-card-header",INBOX_CARD_ACTIONS:"inbox-card-actions",INBOX_CARD_TEXT:"inbox-card-text",INBOX_CARD_TAG:"inbox-card-tag",INBOX_CARD_REPLY_LINK:"inbox-card-reply-link",INBOX_ACTION_BTN:"inbox-action-btn",INBOX_ACTION_BTN_LABELED:"inbox-action-btn--labeled",INBOX_ACTION_LABEL:"inbox-action-label",INBOX_STATUS_DOT:"inbox-status-dot",INBOX_MENU:"inbox-menu",INBOX_MENU_UP:"inbox-menu--up",INBOX_MENU_ITEM:"inbox-menu-item",INBOX_DETAIL:"inbox-detail",INBOX_DETAIL_HEADER:"inbox-detail-header",INBOX_BACK:"inbox-back",INBOX_NAV_BTN:"inbox-nav-btn",INBOX_REPLIES:"inbox-replies",TOOLTIP_REPLY_COUNT:"comment-tooltip-reply-count",INBOX_EMPTY:"inbox-empty",INBOX_EMPTY_ICON:"inbox-empty-icon",INBOX_EMPTY_TITLE:"inbox-empty-title",INBOX_EMPTY_TEXT:"inbox-empty-text",INBOX_EMPTY_KBD:"inbox-empty-kbd",INBOX_EMPTY_ACTION:"inbox-empty-action",CLASSIFY_ROW:"classify-row",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",BADGE_STATUS:"helldots-badge--status",BADGE_TYPE:"helldots-badge--type",BADGE_PRIORITY:"helldots-badge--priority",BADGE_TAG:"helldots-badge--tag",BADGE_DURATION:"helldots-badge--duration",CONTEXT_BLOCK:"inbox-context",CONTEXT_TITLE:"inbox-context-title",CONTEXT_BODY:"inbox-context-body",CONTEXT_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",CONTEXT_TOGGLE:"inbox-context-toggle",HIGHLIGHT:"helldots-highlight"},et=[i.COMMENT_CURSOR],T={TOOLBAR:"comment-toolbar",COMMENT_BOX:"comment-box",COMMENT_INPUT:"comment-input",SUBMIT_COMMENT:"submit-comment",STYLES:"comment-overlay-styles",GLOBAL_STYLES:"comment-overlay-global-styles",ATTACH_IMAGE_INPUT:"attach-image-input"},A=28,ne=5,M=["open","in_progress","resolved"],oe={open:"#2E90FA",in_progress:"#FF9F0A",resolved:"#30D158"},N=["bug","suggestion","question","improvement"],j={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},w=["high","medium","low"],W={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},tt={CONTAINER:'section, div[class*="container"], div[class*="content"]'},S={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},it='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>',nt="2 2";var re=class{constructor({host:e,autoScreenshot:t,embedCrossOriginFonts:n=!1,onRegionCaptured:s,onPlace:r}){this.host=e,this.autoScreenshot=t,this.embedCrossOriginFonts=n,this.onRegionCaptured=s,this.onPlace=r,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,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.host.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{let a=await ve({scale:1,embedCrossOriginFonts:this.embedCrossOriginFonts}),l=Je(a,{left:t,top:n,width:s,height:r});l&&this.onRegionCaptured(l),this.autoScreenshot&&(this.pendingCapture=Promise.resolve(Ie(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=ve({scale:ie,embedCrossOriginFonts:this.embedCrossOriginFonts}).then(e=>Ie(e,{sourceScale:ie})).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 Yt=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],jt=[{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/}],Wt={name:"unknown",version:""},Kt=o=>/not[\W_]*a[\W_]*brand/i.test(o),ot=(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{...Wt}};function rt(o=window){let e=o.navigator||{},t=e.userAgent||"",n=e.userAgentData,s=ot(Yt,t),r=n?.brands?.find(l=>!Kt(l.brand));r&&(s={name:r.brand,version:r.version||""});let a=ot(jt,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 se=" scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;",qt=(...o)=>o.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(""),st=()=>` :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;}#${T.TOOLBAR}{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:${S.TOOLBAR};}.${i.TOOLBAR_ACTION_WRAPPER}{position:relative;}.${i.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;}.${i.TOOLBAR_ACTION_WRAPPER}:hover .${i.TOOLBAR_ACTION_TOOLTIP}{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}.${i.TOOLBAR_TEXT}{font-size:13px;font-weight:500;letter-spacing:-0.01em;}.${i.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;}.${i.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);}.${i.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;}.${i.TOOLBAR_ACTION_WRAPPER}:first-child .${i.TOOLBAR_ACTION_BTN}{border-radius:12px 0 0 12px;}.${i.TOOLBAR_ACTION_WRAPPER}:last-child .${i.TOOLBAR_ACTION_BTN}{border-radius:0 12px 12px 0;}.${i.TOOLBAR_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${i.TOOLBAR_COMMENT_BTN}.${i.ACTIVE}{color:#2E90FA;background:rgba(46,144,250,0.1);}#${T.COMMENT_BOX}{position:fixed;background:#1C1C1E;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.4);padding:16px;z-index:${S.COMMENT_BOX};width:min(400px,calc(100vw - 24px));display:none;box-sizing:border-box;}#${T.COMMENT_BOX} .${i.COMMENT_INPUT_AREA}{display:flex;flex-direction:column;gap:0;}.${i.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);}.${i.CLASSIFY_ROW} .${i.INBOX_ACTION_BTN}{height:26px;border:1px solid rgba(255,255,255,0.12);border-radius:8px;}.${i.CLASSIFY_ROW} .${i.INBOX_ACTION_BTN}:hover{border-color:rgba(255,255,255,0.28);}#${T.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;}#${T.COMMENT_INPUT}::placeholder{color:rgba(255,255,255,0.5);}#${T.COMMENT_INPUT}:focus{outline:none;box-shadow:none;}.${i.COMMENT_ACTIONS_BAR}{display:flex;align-items:center;justify-content:space-between;padding-top:12px;}.${i.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;}.${i.ATTACH_IMAGE_BTN}:hover{background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.8);}.${i.CIRCLE}{position:absolute;width:${A}px;height:${A}px;background:#2E90FA;border-radius:0% 100% 100% 100%;border:2px solid #FFF;cursor:pointer;box-shadow:0 1px 5px rgba(0,0,0,0.2);transition:transform 0.2s,background 0.2s;z-index:${S.CIRCLE};transform:translate(-50%,-50%);}.${i.CIRCLE}:hover{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);}.${i.CIRCLE}.${i.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);}.${i.CIRCLE}.${i.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);}.${i.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;${se} z-index:${S.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${i.TOOLTIP} .${i.THREAD_BODY}{padding:8px 0;}.${i.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:${S.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${i.THREAD_POPOVER}>.${i.THREAD_HEADER},.${i.THREAD_POPOVER}>.${i.THREAD_ACTIONS_ROW},.${i.THREAD_POPOVER}>.${i.THREAD_INPUT_AREA}{flex:none;}.${i.THREAD_SCROLL}{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;${se}}${qt(`.${i.THREAD_SCROLL}`,`.${i.TOOLTIP}`,`.${i.INBOX_LIST}`,`.${i.INBOX_DETAIL}`,`.${i.EDITOR_INPUT}`)} .${i.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:${S.COMMENT_BOX};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;overflow:hidden;}@media (max-width:480px){.${i.INBOX_PANEL}{left:16px;width:auto;}}.${i.INBOX_HEADER},.${i.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;}.${i.INBOX_FILTER}-wrapper{position:relative;}.${i.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;}.${i.INBOX_FILTER}:hover{background:rgba(255,255,255,0.08);}.${i.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);}.${i.INBOX_FILTER_MENU_HEADER}{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:12px;}.${i.INBOX_FILTER_CLEAR}{background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:12px;font-weight:500;cursor:pointer;padding:0;}.${i.INBOX_FILTER_CLEAR}:hover:not(:disabled){color:white;}.${i.INBOX_FILTER_CLEAR}:disabled{opacity:0.35;cursor:default;}.${i.INBOX_FILTER_GROUP} + .${i.INBOX_FILTER_GROUP}{margin-top:14px;}.${i.INBOX_FILTER_SECTION}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);margin-bottom:8px;}.${i.INBOX_FILTER_CHIPS}{display:flex;flex-wrap:wrap;gap:6px;}.${i.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;}.${i.INBOX_FILTER_CHIP}:hover{border-color:rgba(255,255,255,0.4);color:white;}.${i.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;}.${i.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;}.${i.INBOX_MENU_ITEM}:hover{background:rgba(255,255,255,0.08);}.${i.INBOX_CLOSE},.${i.INBOX_NAV_BTN},.${i.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;}.${i.INBOX_CLOSE}{font-size:20px;line-height:1;}.${i.INBOX_CLOSE}:hover,.${i.INBOX_NAV_BTN}:not(:disabled):hover,.${i.INBOX_BACK}:hover{background:rgba(255,255,255,0.08);color:white;}.${i.INBOX_NAV_BTN}:disabled{opacity:0.35;cursor:default;}.${i.INBOX_LIST},.${i.INBOX_DETAIL}{flex:1;overflow-y:auto;${se} padding:12px;display:flex;flex-direction:column;gap:12px;}.${i.INBOX_CARD}{border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}.${i.INBOX_LIST} .${i.INBOX_CARD}{cursor:pointer;}.${i.INBOX_LIST} .${i.INBOX_CARD}:hover{border-color:rgba(255,255,255,0.22);}.${i.INBOX_CARD}--resolved{border-color:rgba(48,209,88,0.4);opacity:0.75;}.${i.INBOX_LIST} .${i.INBOX_CARD}--resolved:hover{border-color:rgba(48,209,88,0.7);opacity:1;}.${i.INBOX_CARD_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;}.${i.INBOX_CARD_ACTIONS}{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:6px;}.${i.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;}.${i.INBOX_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${i.INBOX_ACTION_BTN_LABELED}{width:auto;padding:0 8px 0 6px;gap:5px;justify-content:flex-start;flex:none;}.${i.INBOX_ACTION_LABEL}{font-size:11px;line-height:1;white-space:nowrap;}.${i.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;}.${i.INBOX_MENU_ITEM} .${i.INBOX_STATUS_DOT}{width:9px;height:9px;border:none;margin-right:8px;vertical-align:baseline;}.${i.INBOX_MENU_ITEM}[aria-checked="true"]{background:rgba(255,255,255,0.08);}.${i.THREAD_ACTIONS_ROW}{display:flex;justify-content:flex-end;}.${i.THREAD_POPOVER}>.${i.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;}.${i.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);}.${i.INBOX_MENU}.${i.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${i.INBOX_CARD_TEXT}{white-space:pre-wrap;word-break:break-word;}.${i.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;}.${i.INBOX_BADGES}{display:flex;flex-wrap:wrap;gap:4px;}.${i.INBOX_CARD} .${i.INBOX_BADGES}{margin-top:6px;}.${i.TOOLTIP} .${i.INBOX_BADGES}{margin-bottom:4px;}.${i.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;}.${i.BADGE_STATUS},.${i.BADGE_TYPE},.${i.BADGE_PRIORITY}{font-weight:600;}.${i.BADGE_TAG}{opacity:0.75;}.${i.BADGE_DURATION}{opacity:0.75;border-style:dashed;}.${i.CONTEXT_BLOCK}{display:flex;flex-direction:column;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.08);font-size:11px;}.${i.CONTEXT_BODY}{display:flex;flex-direction:column;gap:4px;}.${i.CONTEXT_TITLE}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);padding-bottom:4px;}.${i.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;}.${i.CONTEXT_TOGGLE}:hover{color:rgba(255,255,255,0.75);}.${i.CONTEXT_TOGGLE} svg{flex:none;transition:transform 0.15s ease;}.${i.CONTEXT_TOGGLE}[aria-expanded="true"] svg{transform:rotate(180deg);}.${i.CONTEXT_TOGGLE}[aria-expanded="true"] + .${i.CONTEXT_BODY}{padding-top:8px;}.${i.CONTEXT_BLOCK} img{width:100%;border-radius:6px;margin-bottom:6px;cursor:zoom-in;}.${i.CONTEXT_SCREENSHOT_CAPTION}{opacity:0.75;}.${i.CONTEXT_ROW}{display:flex;justify-content:space-between;gap:12px;opacity:0.75;}.${i.CONTEXT_ROW} span:last-child{text-align:right;word-break:break-all;}.${i.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;}.${i.INBOX_CARD_REPLY_LINK}:hover{color:white;}.${i.INBOX_REPLIES}{display:flex;flex-direction:column;gap:10px;padding:0 4px;}.${i.TOOLTIP_REPLY_COUNT}{font-size:12px;color:rgba(255,255,255,0.45);padding-top:4px;}.${i.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;}.${i.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;}.${i.INBOX_EMPTY_TITLE}{color:white;font-size:14px;font-weight:600;}.${i.INBOX_EMPTY_TEXT}{font-size:13px;line-height:1.5;max-width:30ch;}.${i.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;}.${i.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;}.${i.INBOX_EMPTY_ACTION}:hover{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.35);}.${i.THREAD_HEADER}{display:flex;justify-content:space-between;align-items:center;padding:0;}.${i.THREAD_META}{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}.${i.THREAD_AUTHOR}{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${i.THREAD_TIME}{font-size:12px;color:rgba(255,255,255,0.5);cursor:default;position:relative;flex:none;}.${i.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;}.${i.THREAD_TIME}:hover::after{opacity:1;}.${i.THREAD_BODY}{padding:8px 0;white-space:pre-wrap;word-break:break-word;}.${i.THREAD_REPLIES}{padding:0;}.${i.THREAD_REPLIES}:empty{display:none;}.${i.THREAD_REPLY}{padding:16px 0 0 0;border-top:1px solid rgba(255,255,255,0.1);white-space:pre-wrap;word-break:break-word;font-size:13px;color:rgba(255,255,255,0.85);}.${i.THREAD_REPLY} .${i.THREAD_META}{margin-bottom:2px;}.${i.THREAD_REPLY_ACTIONS}{margin-left:auto;flex:none;}.${i.THREAD_REPLY} .${i.SCREENSHOT_IMG}{width:144px;height:100px;object-fit:cover;border-radius:8px;margin-top:4px;cursor:pointer;display:block;}.${i.THREAD_INPUT_AREA}{display:flex;flex-direction:column;gap:0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,0.1);}.${i.THREAD_INPUT}{width:100%;background:transparent;border:none;padding:0;color:white;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;}.${i.THREAD_INPUT}::placeholder{color:rgba(255,255,255,0.5);}.${i.THREAD_INPUT}:focus{outline:none;box-shadow:none;}.${i.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;}.${i.THREAD_SUBMIT}:hover{background:rgba(46,144,250,0.15);color:#1570D6;}.${i.CLOSE_TOOLTIP}{background:none;border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.5);line-height:1;}.${i.CLOSE_TOOLTIP}:hover{color:white;}.${i.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);}}.${i.COMMENT_OVERLAY}{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;pointer-events:none;z-index:${S.TOOLBAR-1};}.${i.COMMENT_OVERLAY}.${i.ACTIVE}{pointer-events:auto;background:rgba(0,0,0,0.1);}.${i.SELECTION_RECT}{position:fixed;border:2px solid #2E90FA;background:rgba(46,144,250,0.1);pointer-events:none;z-index:${S.TOOLTIP};box-sizing:border-box;}.${i.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;}.${i.SCREENSHOTS_CONTAINER}::-webkit-scrollbar{display:none;}.${i.SCREENSHOTS_CONTAINER}.${i.ACTIVE}{display:flex;}.${i.SCREENSHOT_ITEM}{position:relative;flex-shrink:0;}.${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG}{width:50px;height:50px;object-fit:cover;border-radius:8px;cursor:pointer;display:block;margin:0;}.${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG}:hover{opacity:0.85;}.${i.SCREENSHOT_ITEM} .${i.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;}.${i.SCREENSHOT_ITEM}:hover .${i.SCREENSHOT_REMOVE}{display:flex;}.${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_REMOVE}:hover{background:rgba(0,0,0,0.9);}.${i.TOOLTIP}>.${i.SCREENSHOTS_CONTAINER} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG},.${i.THREAD_SCROLL}>.${i.SCREENSHOTS_CONTAINER} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG},.${i.THREAD_REPLY} .${i.SCREENSHOT_ITEM} .${i.SCREENSHOT_IMG}{width:144px;height:100px;}.${i.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;}.${i.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;}.${i.CONFIRM_TITLE}{margin:0 0 8px;font-size:15px;font-weight:600;}.${i.CONFIRM_MESSAGE}{margin:0 0 20px;font-size:13px;color:rgba(255,255,255,0.65);}.${i.CONFIRM_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${i.CONFIRM_CANCEL},.${i.CONFIRM_ACCEPT}{padding:7px 14px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}.${i.CONFIRM_CANCEL}:focus-visible,.${i.CONFIRM_ACCEPT}:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}.${i.CONFIRM_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${i.CONFIRM_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${i.CONFIRM_ACCEPT}{background:#FF453A;color:white;}.${i.CONFIRM_ACCEPT}:hover{background:#FF6961;}.${i.LIGHTBOX}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.92);z-index:${S.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;}}.${i.LIGHTBOX_IMG}{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:8px;}.${i.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;}.${i.LIGHTBOX_CLOSE}:hover{background:rgba(255,255,255,0.3);}.${i.EDITOR}{display:flex;flex-direction:column;gap:8px;margin:4px 0 2px;}.${i.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;${se}}.${i.EDITOR_INPUT}:focus{border-color:rgba(46,144,250,0.7);}.${i.EDITOR_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${i.EDITOR_CANCEL},.${i.EDITOR_SAVE}{padding:5px 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;}.${i.EDITOR_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${i.EDITOR_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${i.EDITOR_SAVE}{background:#2E90FA;color:white;}.${i.EDITOR_SAVE}:hover:not(:disabled){background:#57A6FB;}.${i.EDITOR_SAVE}:disabled{background:rgba(255,255,255,0.10);color:rgba(255,255,255,0.4);cursor:not-allowed;}.${i.THREAD_EDITED}{font-size:12px;color:rgba(255,255,255,0.4);cursor:default;position:relative;flex:none;}.${i.THREAD_EDITED}::before{content:"\xB7";margin-right:4px;}.${i.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;}.${i.THREAD_EDITED}:hover::after{opacity:1;}.${i.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;}`,at=()=>` .${i.COMMENT_CURSOR},.${i.COMMENT_CURSOR} *{cursor:url('${it}') ${nt},auto !important;}`;function Re(o,e,t){let n=Zt(e,o);if(n)return o.adoptedStyleSheets=[...o.adoptedStyleSheets??[],n],()=>{o.adoptedStyleSheets=(o.adoptedStyleSheets??[]).filter(a=>a!==n)};let s=o.head??o;s.querySelector?.(`#${t}`)?.remove();let r=document.createElement("style");return r.id=t,r.textContent=e,s.appendChild(r),()=>r.remove()}function Zt(o,e){if(typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in e))return null;try{let t=new CSSStyleSheet;return t.replaceSync(o),t}catch{return null}}var L={commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"Shift",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",filterByType:"Type",filterByPriority:"Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var lt={commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"May\xFAs",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",filterByType:"Tipo",filterByPriority:"Prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var ae={en:L,es:lt},K="en";function ct(){let o=(navigator.language||K).slice(0,2).toLowerCase();return o in ae?o:K}function dt(o){let e=ae[o];return!e||o===K?ae[K]:{...ae[K],...e}}function v(o,e){return o.replace("{n}",String(e))}var Qt=6e4;function le(o,e){if(!Number.isFinite(o)||o<0)return"";let t=Math.floor(o/Qt);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 Ne=64,Jt=3,ei=5,ti=.6,ii=.7,ni=/^(css|sc|jsx|emotion)-/i,oi=/^data-(reactid|react-|v-|svelte-)/,ri=["id","name","role","aria-label"],si=["data-testid","name","aria-label"],we=o=>typeof CSS<"u"&&CSS.escape?CSS.escape(o):String(o).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),ai=o=>String(o).replace(/["\\]/g,"\\$&"),q=(o,e)=>{try{return e.querySelectorAll(o).length===1}catch{return!1}},ut=o=>(o||"").replace(/\s+/g," ").trim().slice(0,Ne),li=o=>et.includes(o)||ni.test(o)?!1:!o.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),ci=o=>[...o.classList].filter(li),di=o=>{let e={};for(let{name:t,value:n}of o.attributes)(ri.includes(t)||t.startsWith("data-")&&!oi.test(t))&&n&&(e[t]=n.slice(0,Ne));return e},Le=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}},hi=(o,e)=>{if(!o.id)return null;let t=`#${we(o.id)}`;return q(t,e)?t:null},pi=(o,e)=>{let t=o.tagName.toLowerCase();for(let n of si){let s=o.getAttribute(n);if(!s)continue;let r=`${t}[${n}="${ai(s)}"]`;if(q(r,e))return r}return null},ui=(o,e)=>{let t=[],n=o;for(let s=0;s<Jt&&n;s++){let r=ci(n),a=n.tagName.toLowerCase();if(t.unshift(r.length?`${a}.${r.map(we).join(".")}`:a),s===0&&!r.length)return null;let l=t.join(" > ");if(q(l,e))return l;n=n.parentElement}return null},mi=(o,e)=>{if(o===e.body)return"body";let t=[],n=o;for(let r=0;r<ei&&n;r++){if(n===e.body){t.unshift("body");break}if(n.id){let l=[`#${we(n.id)}`,...t].join(" > ");if(q(l,e))return l}let{index:a}=Le(n);t.unshift(`${n.tagName.toLowerCase()}:nth-of-type(${a+1})`),n=n.parentElement}let s=t.join(" > ");return q(s,e)?s:null},mt=(o,e)=>hi(o,e)||pi(o,e)||ui(o,e)||mi(o,e);function gt(o){return mt(o,o.ownerDocument)}function ft(o,e,t){let n=o.ownerDocument,{index:s,count:r}=Le(o);return{version:1,selector:mt(o,n),fingerprint:{tagName:o.tagName,textSnippet:ut(o.textContent),attributes:di(o),siblingIndex:s,siblingCount:r},relativeX:e,relativeY:t}}var gi=(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)},fi=(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,Ne)===e[s]&&n++;return n/t.length},ht=(o,e)=>{let{index:t,count:n}=Le(o),s=Math.abs(t-e.siblingIndex),r=Math.max(e.siblingCount,n,1);return Math.max(0,1-s/r)},Ei=(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?ht(o,e):s*gi(ut(o.textContent),e.textSnippet)+r*fi(o,e.attributes||{})+a*ht(o,e)},pt=(o,e)=>{let t=null;for(let n of o){let s=Ei(n,e);(!t||s>t.confidence)&&(t={element:n,confidence:s})}return t};function Be(o,e=document){if(o?.version!=null&&o.version>1)return null;let t=o?.fingerprint;if(!t||!t.tagName)return null;if(o.selector){let a=[];try{a=[...e.querySelectorAll(o.selector)]}catch{}let l=pt(a,t);if(l&&l.confidence>=ti)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=pt(s,t);return r&&r.confidence>=ii?r:null}var ce="helldots-comments",de="helldots-pending-detail";function Me(){try{let o=localStorage.getItem(ce);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 Et(o){try{return localStorage.setItem(ce,JSON.stringify(o)),!0}catch{return!1}}function he(o){if(Et(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++,Et(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 De(o,e,t){let n=new Set(e.map(r=>String(r.id)));return[...o.filter(r=>!n.has(String(r.id))&&r.page!==t),...e]}var _t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var bt=(o=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(o|=0));for(;o--;)e+=_t[t[o]&63];return e};var ke=()=>bt(),O=(o,e)=>String(o)===String(e);var pe="helldotsComment",$=(o,e=pe,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},Ct=(o=pe,e=location.href)=>{try{return new URL(e).searchParams.get(o)}catch{return null}};var H=new Set,X=null,ue=null,_i=o=>[...o.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')],Tt=4,bi=o=>{for(let e=o.parentElement;e;e=e.parentElement){let{overflowX:t,overflowY:n}=getComputedStyle(e);if(t!=="visible"||n!=="visible")return e.getBoundingClientRect()}return null},Ci=(o,e)=>{e.classList.remove(i.INBOX_MENU_UP);let t=bi(e),n=Math.min(t?.bottom??1/0,window.innerHeight),s=Math.max(t?.top??0,0),{height:r}=e.getBoundingClientRect(),a=o.getBoundingClientRect(),l=a.bottom+Tt+r,c=a.top-Tt-r;l>n&&c>=s&&e.classList.add(i.INBOX_MENU_UP)},xt=(o,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(o)||o.contains(e.target),Ti=()=>{X||(X=o=>{for(let e of[...H])xt(e.menu,o)||xt(e.button,o)||e.close()},document.addEventListener("mousedown",X,!0),ue=o=>{let e=[...H].pop();if(e){if(o.key==="Escape"){o.preventDefault(),o.stopPropagation(),e.close(),e.button.focus();return}if(["ArrowDown","ArrowUp","Home","End"].includes(o.key)){let t=_i(e.menu);if(t.length===0)return;o.preventDefault(),o.stopPropagation();let n=e.menu.getRootNode(),s=t.indexOf(n.activeElement),r;if(o.key==="Home")r=0;else if(o.key==="End")r=t.length-1;else if(s===-1)r=o.key==="ArrowDown"?0:t.length-1;else{let a=o.key==="ArrowDown"?1:-1;r=(s+a+t.length)%t.length}t[r].focus()}}},document.addEventListener("keydown",ue,!0))},xi=()=>{X&&(document.removeEventListener("mousedown",X,!0),X=null,document.removeEventListener("keydown",ue,!0),ue=null)},me=()=>{for(let o of[...H])o.close()},Z=(o,e)=>{let t={button:o,menu:e,close:()=>{e.style.display="none",o.setAttribute("aria-expanded","false"),H.delete(t),H.size===0&&xi()}},n=()=>{me(),e.style.display="block",Ci(o,e),o.setAttribute("aria-expanded","true"),H.add(t),Ti()},s=()=>e.style.display!=="none";return e.style.display="none",o.setAttribute("aria-expanded","false"),o.addEventListener("click",r=>{r.stopPropagation();let a=s();me(),a||n()}),{open:n,close:t.close,isOpen:s}};var Pe=new Set,Ot=()=>{for(let o of[...Pe])o(!1)},ge=(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(S.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 d=document.createElement("p");d.className=i.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=i.CONFIRM_ACTIONS;let h=document.createElement("button");h.type="button",h.className=i.CONFIRM_CANCEL,h.textContent=s;let m=document.createElement("button");m.type="button",m.className=i.CONFIRM_ACCEPT,m.textContent=n,p.appendChild(h),p.appendChild(m),l.appendChild(c),l.appendChild(d),l.appendChild(p),a.appendChild(l);let u=o.activeElement||document.activeElement,g=!1,E=b=>{g||(g=!0,Pe.delete(E),document.removeEventListener("keydown",_,!0),a.remove(),u?.focus?.(),r(b))},_=b=>{if(b.key==="Escape"){b.stopPropagation(),b.preventDefault(),E(!1);return}if(b.key!=="Tab")return;let B=[h,m],f=o.activeElement||document.activeElement,x=B.indexOf(f);b.preventDefault(),(b.shiftKey?B[(x<=0?B.length:x)-1]:B[(x+1)%B.length]).focus()};h.addEventListener("click",()=>E(!1)),m.addEventListener("click",()=>E(!0));let C=!1;a.addEventListener("mousedown",b=>{C=b.target===a,b.stopPropagation()}),a.addEventListener("click",b=>{b.target===a&&C&&E(!1),C=!1}),Pe.add(E),document.addEventListener("keydown",_,!0),(o.body||o).appendChild(a),h.focus()});var yt='<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>',Oi='<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>',yi='<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,D=(o,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[o]||e.unset,k=(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 d=document.createElement("button");d.type="button",d.className=i.INBOX_ACTION_BTN,l&&d.classList.add(i.INBOX_ACTION_BTN_LABELED),d.dataset.action=o,d.setAttribute("aria-haspopup","true");let p=document.createElement("span");p.className=i.INBOX_STATUS_DOT,d.appendChild(p);let h=null;l&&(h=document.createElement("span"),h.className=i.INBOX_ACTION_LABEL,d.appendChild(h));let m=document.createElement("div");m.className=i.INBOX_MENU,m.setAttribute("role","menu");let u=Z(d,m),g=t,E=()=>{let _=`${r}: ${s(g)}`;p.style.backgroundColor=n(g),d.dataset.hdTooltip=_,d.setAttribute("aria-label",_),h&&(h.textContent=s(g)),m.querySelectorAll("[data-picker-option]").forEach(C=>{let y=C.dataset.pickerOption,b=y===""?null:y;C.setAttribute("aria-checked",String(b===g))})};for(let _ of e){let C=document.createElement("button");C.type="button",C.className=i.INBOX_MENU_ITEM,C.dataset.pickerOption=_===null?"":_,C.setAttribute("role","menuitemradio");let y=document.createElement("span");y.className=i.INBOX_STATUS_DOT,y.style.backgroundColor=n(_),C.appendChild(y),C.appendChild(document.createTextNode(s(_))),C.addEventListener("click",b=>{b.stopPropagation(),u.close(),_!==g&&(g=_,a(_),E())}),m.appendChild(C)}return c.appendChild(d),c.appendChild(m),E(),c},$e=({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=yi;let r=document.createElement("div");r.className=i.INBOX_MENU,r.setAttribute("role","menu");let a=Z(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 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()}),r.appendChild(c)}return n.appendChild(s),n.appendChild(r),n},fe=(o,{strings:e,onCopy:t,onCopyLink:n,onEdit:s,onSetStatus:r,onSetType:a,onSetPriority:l,onDelete:c})=>{let d=document.createElement("div");d.className=i.INBOX_CARD_ACTIONS;let p=document.createElement("button");return p.type="button",p.className=i.INBOX_ACTION_BTN,p.dataset.action="copy",p.dataset.hdTooltip=e.copyAgentContext,p.setAttribute("aria-label",e.copyAgentContext),p.innerHTML=yt,p.addEventListener("click",h=>{h.stopPropagation(),t(o),p.innerHTML=Oi,p.dataset.hdTooltip=e.copied,setTimeout(()=>{p.innerHTML=yt,p.dataset.hdTooltip=e.copyAgentContext},1500)}),d.appendChild(p),d.appendChild(F({action:"status",options:M,value:o.status||"open",colorOf:h=>oe[h]||"",labelOf:h=>V(h,e),tooltipLabel:e.statusLabel,onSelect:h=>r(o,h),showLabel:!0})),d.appendChild(F({action:"type",options:[null,...N],value:o.type||null,colorOf:h=>j[h]||"transparent",labelOf:h=>D(h,e),tooltipLabel:e.typeLabel,onSelect:h=>a?.(o,h),showLabel:!0})),d.appendChild(F({action:"priority",options:[null,...w],value:o.priority||null,colorOf:h=>W[h]||"transparent",labelOf:h=>k(h,e),tooltipLabel:e.priorityLabel,onSelect:h=>l?.(o,h),showLabel:!0})),d.appendChild($e({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})}]})),d};var z=({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 d=document.createElement("button");d.type="button",d.className=i.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",h=>{if(h.key==="Escape"){h.stopPropagation(),h.preventDefault(),s();return}h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&!d.disabled&&(h.preventDefault(),n(a.value))}),c.addEventListener("click",h=>{h.stopPropagation(),s()}),d.addEventListener("click",h=>{h.stopPropagation(),d.disabled||n(a.value)}),l.appendChild(c),l.appendChild(d),r.appendChild(a),r.appendChild(l),queueMicrotask(()=>{a.focus(),a.setSelectionRange(a.value.length,a.value.length)}),r},Ee=(o,e)=>ge(o,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var Si=(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)},At=(o,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(o)),Q=(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=Si(e,t),l.dataset.fullDate=At(e,n),r.appendChild(a),r.appendChild(l),s&&r.appendChild(He(s,t,n)),r},He=(o,e,t)=>{let n=document.createElement("span");return n.className=i.THREAD_EDITED,n.textContent=e.editedMark,n.dataset.fullDate=e.editedAtPrefix+At(o,t),n},Xe=()=>/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),Fe=(o,e)=>{let t=Xe(),n={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:t?"\u21E7":e.modifierShift},s=n[o.shortcutModifier]||n.alt,r=o.shortcutKey?.toUpperCase()||"C";return`${s} + ${r}`},_e='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',Ai='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',vi='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2L15 22L11 13M11 13L2 9L22 2"/></svg>',Ii='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.8914 10.4028L2.98327 10.6318C3.22909 11.2445 3.5 12.1045 3.5 13C3.5 13.3588 3.4564 13.7131 3.38773 14.0495C3.69637 13.9446 4.01409 13.8159 4.32918 13.6584C4.87888 13.3835 5.33961 13.0611 5.70994 12.7521L6.22471 12.3226L6.88809 12.4196C7.24851 12.4724 7.61994 12.5 8 12.5C11.7843 12.5 14.5 9.85569 14.5 7C14.5 4.14431 11.7843 1.5 8 1.5C4.21574 1.5 1.5 4.14431 1.5 7C1.5 8.18175 1.94229 9.29322 2.73103 10.2153L2.8914 10.4028ZM2.8135 15.7653C1.76096 16 1 16 1 16C1 16 1.43322 15.3097 1.72937 14.4367C1.88317 13.9834 2 13.4808 2 13C2 12.3826 1.80733 11.7292 1.59114 11.1903C0.591845 10.0221 0 8.57152 0 7C0 3.13401 3.58172 0 8 0C12.4183 0 16 3.13401 16 7C16 10.866 12.4183 14 8 14C7.54721 14 7.10321 13.9671 6.67094 13.9038C6.22579 14.2753 5.66881 14.6656 5 15C4.23366 15.3832 3.46733 15.6195 2.8135 15.7653Z"/></svg>',Ri='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.67705 7.5L3.92705 3H12.0729L14.3229 7.5H10H9.25V8.25C9.25 8.94036 8.69036 9.5 8 9.5C7.30964 9.5 6.75 8.94036 6.75 8.25V7.5H6H1.67705ZM1.5 9V12C1.5 12.5523 1.94772 13 2.5 13H13.5C14.0523 13 14.5 12.5523 14.5 12V9H10.6465C10.32 10.1543 9.25878 11 8 11C6.74122 11 5.67998 10.1543 5.35352 9H1.5ZM3 1.5H13L15.8944 7.28885C15.9639 7.42771 16 7.58082 16 7.73607V12C16 13.3807 14.8807 14.5 13.5 14.5H2.5C1.11929 14.5 0 13.3807 0 12V7.73607C0 7.58082 0.0361451 7.42771 0.105573 7.28885L3 1.5Z"/></svg>',be=({areaClassName:o,inputTag:e="textarea",inputClassName:t,inputId:n,inputPlaceholder:s,submitBtnId:r,fileInputId:a},l)=>{let c=document.createElement("div");c.className=o;let d=document.createElement(e);n&&(d.id=n),t&&(d.className=t),d.placeholder=s,d.setAttribute("aria-label",s),e==="input"&&(d.type="text");let p=document.createElement("div");p.className=i.SCREENSHOTS_CONTAINER;let h=document.createElement("div");h.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=Ai;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=vi,h.appendChild(m),h.appendChild(u),h.appendChild(g),c.appendChild(d),c.appendChild(p),c.appendChild(h),{container:c,inputEl:d,screenshotsContainer:p,attachBtn:m,fileInput:u,submitBtn:g}},St=(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},vt=(o={},e=L)=>{let t=document.createElement("div");t.id=T.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=Fe(o,e);let a=St(i.TOOLBAR_COMMENT_BTN,Ii,[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=St(i.TOOLBAR_MENU_BTN,Ri,[l],e.toolbarInbox);return n.appendChild(a),n.appendChild(c),t.appendChild(n),t},Ue=(o,e,{includeStatus:t=!1,includeClassification:n=!0}={})=>{let s=document.createElement("div");s.className=i.INBOX_BADGES;let r=(a,l,c)=>{let d=document.createElement("span");d.className=`${i.BADGE} ${l}`,d.textContent=a,c&&(d.style.borderColor=c),s.appendChild(d)};if(t){let a=o.status||"open";r(V(a,e),i.BADGE_STATUS,oe[a])}n&&o.type&&r(D(o.type,e),i.BADGE_TYPE,j[o.type]),n&&o.priority&&r(k(o.priority,e),i.BADGE_PRIORITY,W[o.priority]);for(let a of o.tags||[])r(a,i.BADGE_TAG,null);if(o.status==="resolved"){let a=o.resolvedAt?le(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},Ni=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=>j[r]||"transparent",labelOf:r=>D(r,o),tooltipLabel:o.typeLabel,onSelect:r=>t=r,showLabel:!0})),e.appendChild(F({action:"priority",options:[null,...w],value:null,colorOf:r=>W[r]||"transparent",labelOf:r=>k(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()}}},It=(o=L)=>{let e=document.createElement("div");e.id=T.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",o.commentBoxAriaLabel);let{container:t}=be({areaClassName:i.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:T.COMMENT_INPUT,inputPlaceholder:o.commentPlaceholder,submitBtnId:T.SUBMIT_COMMENT,fileInputId:T.ATTACH_IMAGE_INPUT},o),n=Ni(o);return e.appendChild(n.container),e.appendChild(t),e.style.display="none",e.classify=n,e},P=o=>String(o).replace(/[\\"]/g,"\\$&"),Rt=o=>`[data-comment-id="${P(o)}"]`,Ve=o=>o.screenshots||(o.screenshot?[o.screenshot]:[]),G=(o,e,{strings:t,onShow:n,rerender:s})=>{o.innerHTML="",o.classList.toggle(i.ACTIVE,e.length>0),e.forEach((r,a)=>{let l=document.createElement("div");l.className=i.SCREENSHOT_ITEM;let c=document.createElement("img");c.className=i.SCREENSHOT_IMG,c.src=r,c.alt=t.attachedScreenshot,Nt(c,()=>n(r));let d=document.createElement("button");d.type="button",d.className=i.SCREENSHOT_REMOVE,d.setAttribute("aria-label",t.removeScreenshot),d.innerHTML="×",d.onclick=p=>{p.stopPropagation(),e.splice(a,1),s()},l.appendChild(c),l.appendChild(d),o.appendChild(l)})},Y=(o,e,t)=>{o.addEventListener("change",n=>{let s=n.target.files[0];if(!s||s.type&&!s.type.startsWith("image/"))return;let r=e();if(r.length>=ne)return;let a=new FileReader;a.onload=l=>{r.push(l.target.result),t()},a.readAsDataURL(s),o.value=""})},R=(o,e)=>{o.querySelectorAll(`.${i.SCREENSHOT_IMG}`).forEach(t=>{Nt(t,()=>e(t.src))})},Nt=(o,e)=>{o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.addEventListener("click",t=>{t.stopPropagation(),e()}),o.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())})},wt=(o,e=L)=>{let t=document.createElement("div");return t.className=i.CIRCLE,t.dataset.commentId=o.id,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${o.text}`),t.style.cssText=`
|
|
37
5
|
position: absolute;
|
|
38
|
-
bottom: calc(100% + 10px);
|
|
39
|
-
left: 50%;
|
|
40
|
-
transform: translateX(-50%) translateY(4px);
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
gap: 8px;
|
|
44
|
-
background: rgba(20, 20, 23, 0.95);
|
|
45
|
-
backdrop-filter: blur(16px);
|
|
46
|
-
-webkit-backdrop-filter: blur(16px);
|
|
47
|
-
padding: 8px 12px;
|
|
48
|
-
border-radius: 10px;
|
|
49
|
-
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
50
|
-
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
|
|
51
|
-
color: white;
|
|
52
|
-
white-space: nowrap;
|
|
53
|
-
opacity: 0;
|
|
54
|
-
pointer-events: none;
|
|
55
|
-
transition: opacity 0.15s ease, transform 0.15s ease;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.${n.TOOLBAR_ACTION_WRAPPER}:hover .${n.TOOLBAR_ACTION_TOOLTIP} {
|
|
59
|
-
opacity: 1;
|
|
60
6
|
pointer-events: auto;
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.${n.TOOLBAR_TEXT} {
|
|
65
|
-
font-size: 13px;
|
|
66
|
-
font-weight: 500;
|
|
67
|
-
letter-spacing: -0.01em;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.${n.SHORTCUT_HINT} {
|
|
71
|
-
font-size: 11px;
|
|
72
|
-
font-weight: 500;
|
|
73
|
-
color: rgba(255, 255, 255, 0.5);
|
|
74
|
-
background: rgba(255, 255, 255, 0.06);
|
|
75
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
76
|
-
padding: 2px 6px;
|
|
77
|
-
border-radius: 5px;
|
|
78
|
-
line-height: 1;
|
|
79
|
-
white-space: nowrap;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.${n.TOOLBAR_ACTIONS} {
|
|
83
|
-
display: flex;
|
|
84
|
-
flex-direction: row;
|
|
85
|
-
background: rgba(20, 20, 23, 0.95);
|
|
86
|
-
backdrop-filter: blur(16px);
|
|
87
|
-
-webkit-backdrop-filter: blur(16px);
|
|
88
|
-
border-radius: 12px;
|
|
89
|
-
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.${n.TOOLBAR_ACTION_BTN} {
|
|
93
|
-
width: 42px;
|
|
94
|
-
height: 42px;
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: center;
|
|
98
|
-
background: none;
|
|
99
|
-
border: none;
|
|
100
|
-
outline: none;
|
|
101
|
-
color: rgba(255, 255, 255, 0.65);
|
|
102
|
-
cursor: pointer;
|
|
103
|
-
transition: background 0.2s, color 0.2s;
|
|
104
|
-
padding: 0;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.${n.TOOLBAR_ACTION_WRAPPER}:first-child .${n.TOOLBAR_ACTION_BTN} {
|
|
108
|
-
border-radius: 12px 0 0 12px;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.${n.TOOLBAR_ACTION_WRAPPER}:last-child .${n.TOOLBAR_ACTION_BTN} {
|
|
112
|
-
border-radius: 0 12px 12px 0;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.${n.TOOLBAR_ACTION_BTN}:hover {
|
|
116
|
-
background: rgba(255, 255, 255, 0.08);
|
|
117
|
-
color: white;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.${n.TOOLBAR_COMMENT_BTN}.${n.ACTIVE} {
|
|
121
|
-
color: #2E90FA;
|
|
122
|
-
background: rgba(46, 144, 250, 0.1);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
#${T.COMMENT_BOX} {
|
|
127
|
-
position: fixed;
|
|
128
|
-
background: #1C1C1E;
|
|
129
|
-
border-radius: 12px;
|
|
130
|
-
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
|
|
131
|
-
padding: 16px;
|
|
132
|
-
z-index: ${x.COMMENT_BOX};
|
|
133
|
-
width: 400px;
|
|
134
|
-
display: none;
|
|
135
|
-
box-sizing: border-box;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
#${T.COMMENT_BOX} .${n.COMMENT_INPUT_AREA} {
|
|
139
|
-
display: flex;
|
|
140
|
-
flex-direction: column;
|
|
141
|
-
gap: 0;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.${n.CLASSIFY_ROW} {
|
|
145
|
-
display: flex;
|
|
146
|
-
align-items: center;
|
|
147
|
-
flex-wrap: wrap;
|
|
148
|
-
gap: 6px;
|
|
149
|
-
padding: 8px 10px 0;
|
|
150
|
-
}
|
|
151
|
-
.${n.TAGS_INPUT} {
|
|
152
|
-
flex: 1 1 90px;
|
|
153
|
-
min-width: 90px;
|
|
154
|
-
background: transparent;
|
|
155
|
-
border: none;
|
|
156
|
-
outline: none;
|
|
157
|
-
color: inherit;
|
|
158
|
-
font-size: 12px;
|
|
159
|
-
padding: 2px 0;
|
|
160
|
-
}
|
|
161
|
-
.${n.TAG_CHIP} {
|
|
162
|
-
display: inline-flex;
|
|
163
|
-
align-items: center;
|
|
164
|
-
gap: 4px;
|
|
165
|
-
padding: 2px 6px;
|
|
166
|
-
border-radius: 10px;
|
|
167
|
-
background: rgba(255, 255, 255, 0.1);
|
|
168
|
-
font-size: 11px;
|
|
169
|
-
line-height: 1.4;
|
|
170
|
-
}
|
|
171
|
-
.${n.TAG_CHIP_REMOVE} {
|
|
172
|
-
background: none;
|
|
173
|
-
border: none;
|
|
174
|
-
color: inherit;
|
|
175
|
-
cursor: pointer;
|
|
176
|
-
padding: 0;
|
|
177
|
-
font-size: 13px;
|
|
178
|
-
line-height: 1;
|
|
179
|
-
opacity: 0.6;
|
|
180
|
-
}
|
|
181
|
-
.${n.TAG_CHIP_REMOVE}:hover {
|
|
182
|
-
opacity: 1;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
#${T.COMMENT_INPUT} {
|
|
186
|
-
flex: 1;
|
|
187
|
-
min-height: 20px;
|
|
188
|
-
background: #1C1C1E;
|
|
189
|
-
border: none;
|
|
190
|
-
resize: none;
|
|
191
|
-
font-family: inherit;
|
|
192
|
-
color: white;
|
|
193
|
-
font-size: 14px;
|
|
194
|
-
line-height: 1.4;
|
|
195
|
-
box-sizing: border-box;
|
|
196
|
-
field-sizing: content;
|
|
197
|
-
padding-top: 4px;
|
|
198
|
-
padding-bottom: 8px;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
#${T.COMMENT_INPUT}::placeholder {
|
|
202
|
-
color: rgba(255, 255, 255, 0.5);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
#${T.COMMENT_INPUT}:focus {
|
|
206
|
-
outline: none;
|
|
207
|
-
box-shadow: none;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.${n.COMMENT_ACTIONS_BAR} {
|
|
211
|
-
display: flex;
|
|
212
|
-
align-items: center;
|
|
213
|
-
justify-content: space-between;
|
|
214
|
-
padding-top: 12px;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.${n.ATTACH_IMAGE_BTN} {
|
|
218
|
-
background: none;
|
|
219
|
-
border: none;
|
|
220
|
-
color: rgba(255, 255, 255, 0.5);
|
|
221
|
-
cursor: pointer;
|
|
222
|
-
display: flex;
|
|
223
|
-
align-items: center;
|
|
224
|
-
justify-content: center;
|
|
225
|
-
border-radius: 6px;
|
|
226
|
-
transition: background 0.2s, color 0.2s;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.${n.ATTACH_IMAGE_BTN}:hover {
|
|
230
|
-
background: rgba(255, 255, 255, 0.1);
|
|
231
|
-
color: rgba(255, 255, 255, 0.8);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.${n.CIRCLE} {
|
|
235
|
-
position: absolute;
|
|
236
|
-
width: 28px;
|
|
237
|
-
height: 28px;
|
|
238
|
-
background: #2E90FA;
|
|
239
|
-
border-radius: 0% 100% 100% 100%;
|
|
240
|
-
border: 2px solid #FFF;
|
|
241
|
-
cursor: pointer;
|
|
242
|
-
box-shadow: 0 1px 5px rgba(0,0,0,0.2);
|
|
243
|
-
transition: transform 0.2s, background 0.2s;
|
|
244
|
-
z-index: ${x.CIRCLE};
|
|
245
|
-
transform: translate(-50%, -50%);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.${n.CIRCLE}:hover {
|
|
249
|
-
transform: translate(-50%, -50%) scale(1.2) !important;
|
|
250
|
-
background: rgb(0, 123, 255);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.${n.CIRCLE}.${n.HIGHLIGHT} {
|
|
254
|
-
transform: translate(-50%, -50%) scale(1.2) !important;
|
|
255
|
-
background: rgb(0, 123, 255);
|
|
256
|
-
box-shadow: 0 0 0 4px rgba(46, 144, 250, 0.35), 0 1px 5px rgba(0,0,0,0.2);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.${n.CIRCLE_WRAPPER} {
|
|
260
|
-
position: absolute;
|
|
261
|
-
left: 0;
|
|
262
|
-
top: 0;
|
|
263
|
-
width: 100%;
|
|
264
|
-
height: 100%;
|
|
265
|
-
pointer-events: none;
|
|
266
|
-
z-index: ${x.CIRCLE};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.${n.TOOLTIP} {
|
|
270
|
-
position: fixed;
|
|
271
|
-
background: #1C1C1E;
|
|
272
|
-
border-radius: 12px;
|
|
273
|
-
padding: 16px;
|
|
274
|
-
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
|
|
275
|
-
width: 400px;
|
|
276
|
-
z-index: ${x.TOOLTIP};
|
|
277
|
-
color: white;
|
|
278
|
-
font-size: 14px;
|
|
279
|
-
line-height: 1.5;
|
|
280
|
-
box-sizing: border-box;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.${n.TOOLTIP} .${n.THREAD_HEADER} {
|
|
284
|
-
padding: 0 0 0;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.${n.TOOLTIP} .${n.THREAD_BODY} {
|
|
288
|
-
padding: 8px 0;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.${n.THREAD_POPOVER} {
|
|
292
|
-
position: fixed;
|
|
293
|
-
background: #1C1C1E;
|
|
294
|
-
border-radius: 12px;
|
|
295
|
-
padding: 16px;
|
|
296
|
-
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
|
|
297
|
-
width: 400px;
|
|
298
|
-
z-index: ${x.TOOLTIP};
|
|
299
|
-
color: white;
|
|
300
|
-
font-size: 14px;
|
|
301
|
-
line-height: 1.5;
|
|
302
|
-
box-sizing: border-box;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.${n.INBOX_PANEL} {
|
|
306
|
-
position: fixed;
|
|
307
|
-
top: 16px;
|
|
308
|
-
right: 16px;
|
|
309
|
-
bottom: 16px;
|
|
310
|
-
width: 380px;
|
|
311
|
-
display: flex;
|
|
312
|
-
flex-direction: column;
|
|
313
|
-
background: #1C1C1E;
|
|
314
|
-
border: 1px solid rgba(255,255,255,0.08);
|
|
315
|
-
border-radius: 14px;
|
|
316
|
-
box-shadow: 0 8px 32px rgba(0,0,0,0.5);
|
|
317
|
-
z-index: ${x.COMMENT_BOX};
|
|
318
|
-
color: white;
|
|
319
|
-
font-size: 14px;
|
|
320
|
-
line-height: 1.5;
|
|
321
|
-
box-sizing: border-box;
|
|
322
|
-
overflow: hidden;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
@media (max-width: 420px) {
|
|
326
|
-
.${n.INBOX_PANEL} {
|
|
327
|
-
left: 16px;
|
|
328
|
-
width: auto;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.${n.INBOX_HEADER},
|
|
333
|
-
.${n.INBOX_DETAIL_HEADER} {
|
|
334
|
-
display: flex;
|
|
335
|
-
align-items: center;
|
|
336
|
-
justify-content: space-between;
|
|
337
|
-
gap: 8px;
|
|
338
|
-
padding: 12px 14px;
|
|
339
|
-
border-bottom: 1px solid rgba(255,255,255,0.08);
|
|
340
|
-
flex: none;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
.${n.INBOX_FILTER}-wrapper {
|
|
344
|
-
position: relative;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.${n.INBOX_FILTER} {
|
|
348
|
-
display: flex;
|
|
349
|
-
align-items: center;
|
|
350
|
-
gap: 6px;
|
|
351
|
-
background: transparent;
|
|
352
|
-
border: none;
|
|
353
|
-
color: white;
|
|
354
|
-
font-size: 13px;
|
|
355
|
-
font-weight: 600;
|
|
356
|
-
cursor: pointer;
|
|
357
|
-
padding: 4px 6px;
|
|
358
|
-
border-radius: 6px;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.${n.INBOX_FILTER}:hover {
|
|
362
|
-
background: rgba(255,255,255,0.08);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.${n.INBOX_FILTER_MENU} {
|
|
366
|
-
position: absolute;
|
|
367
|
-
top: calc(100% + 4px);
|
|
368
|
-
left: 0;
|
|
369
|
-
background: #2C2C2E;
|
|
370
|
-
border: 1px solid rgba(255,255,255,0.1);
|
|
371
|
-
border-radius: 8px;
|
|
372
|
-
padding: 4px;
|
|
373
|
-
min-width: 190px;
|
|
374
|
-
z-index: 1;
|
|
375
|
-
box-shadow: 0 4px 16px rgba(0,0,0,0.4);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
.${n.INBOX_FILTER_SECTION} {
|
|
379
|
-
padding: 8px 10px 4px;
|
|
380
|
-
font-size: 11px;
|
|
381
|
-
font-weight: 600;
|
|
382
|
-
color: rgba(255,255,255,0.45);
|
|
383
|
-
text-transform: none;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.${n.INBOX_FILTER_SECTION}:not(:first-child) {
|
|
387
|
-
margin-top: 4px;
|
|
388
|
-
border-top: 1px solid rgba(255,255,255,0.1);
|
|
389
|
-
padding-top: 10px;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.${n.INBOX_FILTER_OPTION} {
|
|
393
|
-
display: flex;
|
|
394
|
-
justify-content: space-between;
|
|
395
|
-
align-items: center;
|
|
396
|
-
gap: 12px;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.${n.INBOX_FILTER_OPTION},
|
|
400
|
-
.${n.INBOX_MENU_ITEM} {
|
|
401
|
-
display: block;
|
|
402
|
-
width: 100%;
|
|
403
|
-
text-align: left;
|
|
404
|
-
background: transparent;
|
|
405
|
-
border: none;
|
|
406
|
-
color: white;
|
|
407
|
-
font-size: 13px;
|
|
408
|
-
padding: 7px 10px;
|
|
409
|
-
border-radius: 6px;
|
|
410
|
-
cursor: pointer;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
.${n.INBOX_FILTER_OPTION}:hover,
|
|
414
|
-
.${n.INBOX_MENU_ITEM}:hover {
|
|
415
|
-
background: rgba(255,255,255,0.08);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.${n.INBOX_CLOSE},
|
|
419
|
-
.${n.INBOX_NAV_BTN},
|
|
420
|
-
.${n.INBOX_BACK} {
|
|
421
|
-
display: flex;
|
|
422
|
-
align-items: center;
|
|
423
|
-
gap: 4px;
|
|
424
|
-
background: transparent;
|
|
425
|
-
border: none;
|
|
426
|
-
color: rgba(255,255,255,0.75);
|
|
427
|
-
cursor: pointer;
|
|
428
|
-
padding: 4px 6px;
|
|
429
|
-
border-radius: 6px;
|
|
430
|
-
font-size: 14px;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
.${n.INBOX_CLOSE} {
|
|
434
|
-
font-size: 20px;
|
|
435
|
-
line-height: 1;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.${n.INBOX_CLOSE}:hover,
|
|
439
|
-
.${n.INBOX_NAV_BTN}:not(:disabled):hover,
|
|
440
|
-
.${n.INBOX_BACK}:hover {
|
|
441
|
-
background: rgba(255,255,255,0.08);
|
|
442
|
-
color: white;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
.${n.INBOX_NAV_BTN}:disabled {
|
|
446
|
-
opacity: 0.35;
|
|
447
|
-
cursor: default;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
.${n.INBOX_LIST},
|
|
451
|
-
.${n.INBOX_DETAIL} {
|
|
452
|
-
flex: 1;
|
|
453
|
-
overflow-y: auto;
|
|
454
|
-
padding: 12px;
|
|
455
|
-
display: flex;
|
|
456
|
-
flex-direction: column;
|
|
457
|
-
gap: 12px;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
.${n.INBOX_CARD} {
|
|
461
|
-
border: 1px solid rgba(255,255,255,0.1);
|
|
462
|
-
border-radius: 10px;
|
|
463
|
-
padding: 12px;
|
|
464
|
-
display: flex;
|
|
465
|
-
flex-direction: column;
|
|
466
|
-
gap: 8px;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
.${n.INBOX_LIST} .${n.INBOX_CARD} {
|
|
470
|
-
cursor: pointer;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
.${n.INBOX_LIST} .${n.INBOX_CARD}:hover {
|
|
474
|
-
border-color: rgba(255,255,255,0.22);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
.${n.INBOX_CARD}--resolved {
|
|
478
|
-
border-color: rgba(48, 209, 88, 0.4);
|
|
479
|
-
opacity: 0.75;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
.${n.INBOX_LIST} .${n.INBOX_CARD}--resolved:hover {
|
|
483
|
-
border-color: rgba(48, 209, 88, 0.7);
|
|
484
|
-
opacity: 1;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
.${n.INBOX_CARD_HEADER} {
|
|
488
|
-
display: flex;
|
|
489
|
-
align-items: center;
|
|
490
|
-
justify-content: space-between;
|
|
491
|
-
gap: 8px;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
.${n.INBOX_CARD_ACTIONS} {
|
|
495
|
-
display: flex;
|
|
496
|
-
align-items: center;
|
|
497
|
-
gap: 6px;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
.${n.INBOX_ACTION_BTN} {
|
|
501
|
-
display: flex;
|
|
502
|
-
align-items: center;
|
|
503
|
-
justify-content: center;
|
|
504
|
-
width: 24px;
|
|
505
|
-
height: 24px;
|
|
506
|
-
background: transparent;
|
|
507
|
-
border: none;
|
|
508
|
-
border-radius: 6px;
|
|
509
|
-
color: rgba(255,255,255,0.65);
|
|
510
|
-
cursor: pointer;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
.${n.INBOX_ACTION_BTN}:hover {
|
|
514
|
-
background: rgba(255,255,255,0.08);
|
|
515
|
-
color: white;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
/* Type/priority pickers show their current value as text next to the
|
|
519
|
-
dot (colour alone can't tell bug/high apart \u2014 same hex, and there's
|
|
520
|
-
no hover on touch). Grow from the square icon-button width but stay
|
|
521
|
-
bounded so the strip doesn't crowd out copy/status/\u22EF next to it. */
|
|
522
|
-
.${n.INBOX_ACTION_BTN_LABELED} {
|
|
523
|
-
width: auto;
|
|
524
|
-
max-width: 72px;
|
|
525
|
-
padding: 0 8px 0 6px;
|
|
526
|
-
gap: 5px;
|
|
527
|
-
justify-content: flex-start;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
.${n.INBOX_ACTION_LABEL} {
|
|
531
|
-
font-size: 11px;
|
|
532
|
-
line-height: 1;
|
|
533
|
-
white-space: nowrap;
|
|
534
|
-
overflow: hidden;
|
|
535
|
-
text-overflow: ellipsis;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
.${n.INBOX_STATUS_DOT} {
|
|
539
|
-
width: 12px;
|
|
540
|
-
height: 12px;
|
|
541
|
-
border-radius: 50%;
|
|
542
|
-
border: 1.5px solid rgba(255,255,255,0.45);
|
|
543
|
-
display: inline-block;
|
|
544
|
-
flex: none;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
.${n.INBOX_MENU_ITEM} .${n.INBOX_STATUS_DOT} {
|
|
548
|
-
width: 9px;
|
|
549
|
-
height: 9px;
|
|
550
|
-
border: none;
|
|
551
|
-
margin-right: 8px;
|
|
552
|
-
vertical-align: baseline;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
.${n.INBOX_MENU_ITEM}[aria-checked="true"] {
|
|
556
|
-
background: rgba(255,255,255,0.08);
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
.${n.THREAD_HEADER} .${n.INBOX_CARD_ACTIONS} {
|
|
560
|
-
margin-left: auto;
|
|
561
|
-
margin-right: 8px;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
/* Generic hover tooltip, same look as .thread-time[data-full-date] */
|
|
565
|
-
[data-hd-tooltip] {
|
|
566
|
-
position: relative;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
[data-hd-tooltip]::after {
|
|
570
|
-
content: attr(data-hd-tooltip);
|
|
571
|
-
position: absolute;
|
|
572
|
-
bottom: calc(100% + 6px);
|
|
573
|
-
left: 50%;
|
|
574
|
-
transform: translateX(-50%);
|
|
575
|
-
background: #000;
|
|
576
|
-
color: white;
|
|
577
|
-
padding: 4px 8px;
|
|
578
|
-
border-radius: 6px;
|
|
579
|
-
font-size: 11px;
|
|
580
|
-
white-space: nowrap;
|
|
581
|
-
opacity: 0;
|
|
582
|
-
pointer-events: none;
|
|
583
|
-
transition: opacity 0.12s ease;
|
|
584
|
-
z-index: 2;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
[data-hd-tooltip]:hover::after {
|
|
588
|
-
opacity: 1;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
.${n.INBOX_MENU} {
|
|
592
|
-
position: absolute;
|
|
593
|
-
top: calc(100% + 4px);
|
|
594
|
-
right: 0;
|
|
595
|
-
background: #2C2C2E;
|
|
596
|
-
border: 1px solid rgba(255,255,255,0.1);
|
|
597
|
-
border-radius: 8px;
|
|
598
|
-
padding: 4px;
|
|
599
|
-
min-width: 130px;
|
|
600
|
-
z-index: 1;
|
|
601
|
-
box-shadow: 0 4px 16px rgba(0,0,0,0.4);
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
.${n.INBOX_CARD_TEXT} {
|
|
605
|
-
white-space: pre-wrap;
|
|
606
|
-
word-break: break-word;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
.${n.INBOX_CARD_TAG} {
|
|
610
|
-
align-self: flex-start;
|
|
611
|
-
padding: 1px 8px;
|
|
612
|
-
border-radius: 999px;
|
|
613
|
-
background: rgba(255, 159, 10, 0.2);
|
|
614
|
-
color: #FF9F0A;
|
|
615
|
-
font-size: 11px;
|
|
616
|
-
font-weight: 600;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
.${n.INBOX_BADGES} {
|
|
620
|
-
display: flex;
|
|
621
|
-
flex-wrap: wrap;
|
|
622
|
-
gap: 4px;
|
|
623
|
-
}
|
|
624
|
-
/* Vertical separation from the card text above only applies to the
|
|
625
|
-
badge row on inbox cards -- inside the comment-box classify row,
|
|
626
|
-
.inbox-badges is one flex item among the type/priority pickers and
|
|
627
|
-
the tags input, and the classify row's own gap already spaces it
|
|
628
|
-
from its siblings, so an extra margin here would nudge it out of
|
|
629
|
-
alignment with them. */
|
|
630
|
-
.${n.INBOX_CARD} .${n.INBOX_BADGES} {
|
|
631
|
-
margin-top: 6px;
|
|
632
|
-
}
|
|
633
|
-
.${n.BADGE} {
|
|
634
|
-
display: inline-flex;
|
|
635
|
-
align-items: center;
|
|
636
|
-
padding: 1px 6px;
|
|
637
|
-
border: 1px solid rgba(255, 255, 255, 0.18);
|
|
638
|
-
border-radius: 10px;
|
|
639
|
-
font-size: 10px;
|
|
640
|
-
line-height: 1.6;
|
|
641
|
-
letter-spacing: 0.01em;
|
|
642
|
-
white-space: nowrap;
|
|
643
|
-
}
|
|
644
|
-
.${n.BADGE_TYPE},
|
|
645
|
-
.${n.BADGE_PRIORITY} {
|
|
646
|
-
font-weight: 600;
|
|
647
|
-
}
|
|
648
|
-
.${n.BADGE_TAG} {
|
|
649
|
-
opacity: 0.75;
|
|
650
|
-
}
|
|
651
|
-
.${n.BADGE_DURATION} {
|
|
652
|
-
opacity: 0.75;
|
|
653
|
-
border-style: dashed;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
.${n.CONTEXT_BLOCK} {
|
|
657
|
-
display: flex;
|
|
658
|
-
flex-direction: column;
|
|
659
|
-
gap: 4px;
|
|
660
|
-
padding: 10px 12px;
|
|
661
|
-
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
|
662
|
-
font-size: 11px;
|
|
663
|
-
}
|
|
664
|
-
.${n.CONTEXT_BLOCK} img {
|
|
665
|
-
width: 100%;
|
|
666
|
-
border-radius: 6px;
|
|
667
|
-
margin-bottom: 6px;
|
|
668
|
-
cursor: zoom-in;
|
|
669
|
-
}
|
|
670
|
-
.${n.CONTEXT_SCREENSHOT_CAPTION} {
|
|
671
|
-
opacity: 0.75;
|
|
672
|
-
}
|
|
673
|
-
.${n.CONTEXT_ROW} {
|
|
674
|
-
display: flex;
|
|
675
|
-
justify-content: space-between;
|
|
676
|
-
gap: 12px;
|
|
677
|
-
opacity: 0.75;
|
|
678
|
-
}
|
|
679
|
-
/* URLs and user agents have no spaces to break on, so the value column
|
|
680
|
-
would otherwise push the row wider than the panel. */
|
|
681
|
-
.${n.CONTEXT_ROW} span:last-child {
|
|
682
|
-
text-align: right;
|
|
683
|
-
word-break: break-all;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
.${n.INBOX_CARD_REPLY_LINK} {
|
|
687
|
-
align-self: flex-start;
|
|
688
|
-
background: transparent;
|
|
689
|
-
border: none;
|
|
690
|
-
color: rgba(255,255,255,0.55);
|
|
691
|
-
font-size: 13px;
|
|
692
|
-
cursor: pointer;
|
|
693
|
-
padding: 0;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
.${n.INBOX_CARD_REPLY_LINK}:hover {
|
|
697
|
-
color: white;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
.${n.INBOX_REPLIES} {
|
|
701
|
-
display: flex;
|
|
702
|
-
flex-direction: column;
|
|
703
|
-
gap: 10px;
|
|
704
|
-
padding: 0 4px;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
.${n.INBOX_EMPTY} {
|
|
708
|
-
padding: 24px 12px;
|
|
709
|
-
color: rgba(255,255,255,0.55);
|
|
710
|
-
text-align: center;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
.${n.THREAD_HEADER} {
|
|
714
|
-
display: flex;
|
|
715
|
-
justify-content: space-between;
|
|
716
|
-
align-items: center;
|
|
717
|
-
padding: 0 0 0;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
.${n.THREAD_META} {
|
|
721
|
-
display: flex;
|
|
722
|
-
align-items: center;
|
|
723
|
-
gap: 6px;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
.${n.THREAD_AUTHOR} {
|
|
727
|
-
font-weight: 600;
|
|
728
|
-
font-size: 13px;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
.${n.THREAD_TIME} {
|
|
732
|
-
font-size: 12px;
|
|
733
|
-
color: rgba(255,255,255,0.5);
|
|
734
|
-
cursor: default;
|
|
735
|
-
position: relative;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
.${n.THREAD_TIME}::after {
|
|
739
|
-
content: attr(data-full-date);
|
|
740
|
-
position: absolute;
|
|
741
|
-
bottom: calc(100% + 6px);
|
|
742
|
-
left: 50%;
|
|
743
|
-
transform: translateX(-50%);
|
|
744
|
-
background: #000;
|
|
745
|
-
color: white;
|
|
746
|
-
padding: 4px 8px;
|
|
747
|
-
border-radius: 6px;
|
|
748
|
-
font-size: 11px;
|
|
749
|
-
white-space: nowrap;
|
|
750
|
-
opacity: 0;
|
|
751
|
-
pointer-events: none;
|
|
752
|
-
transition: opacity 0.15s ease;
|
|
753
|
-
z-index: 1;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
.${n.THREAD_TIME}:hover::after {
|
|
757
|
-
opacity: 1;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
.${n.THREAD_BODY} {
|
|
761
|
-
padding: 8px 0;
|
|
762
|
-
white-space: pre-wrap;
|
|
763
|
-
word-break: break-word;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
.${n.THREAD_REPLIES} {
|
|
767
|
-
padding: 0;
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
.${n.THREAD_REPLIES}:empty {
|
|
771
|
-
display: none;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
.${n.THREAD_REPLY} {
|
|
775
|
-
padding: 16px 0 0 0;
|
|
776
|
-
border-top: 1px solid rgba(255,255,255,0.1);
|
|
777
|
-
white-space: pre-wrap;
|
|
778
|
-
word-break: break-word;
|
|
779
|
-
font-size: 13px;
|
|
780
|
-
color: rgba(255,255,255,0.85);
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
.${n.THREAD_REPLY} .${n.THREAD_META} {
|
|
784
|
-
margin-bottom: 2px;
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
.${n.THREAD_REPLY} .${n.SCREENSHOT_IMG} {
|
|
788
|
-
width: 144px;
|
|
789
|
-
height: 100px;
|
|
790
|
-
object-fit: cover;
|
|
791
|
-
border-radius: 8px;
|
|
792
|
-
margin-top: 4px;
|
|
793
|
-
cursor: pointer;
|
|
794
|
-
display: block;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
.${n.THREAD_INPUT_AREA} {
|
|
798
|
-
display: flex;
|
|
799
|
-
flex-direction: column;
|
|
800
|
-
gap: 0;
|
|
801
|
-
padding: 12px 0 0;
|
|
802
|
-
border-top: 1px solid rgba(255,255,255,0.1);
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
.${n.THREAD_INPUT} {
|
|
806
|
-
width: 100%;
|
|
807
|
-
background: transparent;
|
|
808
|
-
border: none;
|
|
809
|
-
padding: 0;
|
|
810
|
-
color: white;
|
|
811
|
-
font-size: 14px;
|
|
812
|
-
font-family: inherit;
|
|
813
|
-
outline: none;
|
|
814
|
-
box-sizing: border-box;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
.${n.THREAD_INPUT}::placeholder {
|
|
818
|
-
color: rgba(255,255,255,0.5);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
.${n.THREAD_INPUT}:focus {
|
|
822
|
-
outline: none;
|
|
823
|
-
box-shadow: none;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
.${n.THREAD_SUBMIT} {
|
|
827
|
-
background: none;
|
|
828
|
-
border: none;
|
|
829
|
-
color: #2E90FA;
|
|
830
|
-
cursor: pointer;
|
|
831
|
-
display: flex;
|
|
832
|
-
align-items: center;
|
|
833
|
-
justify-content: center;
|
|
834
|
-
border-radius: 6px;
|
|
835
|
-
transition: background 0.2s;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
.${n.THREAD_SUBMIT}:hover {
|
|
839
|
-
background: rgba(46, 144, 250, 0.15);
|
|
840
|
-
color: #1570D6;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
.${n.CLOSE_TOOLTIP} {
|
|
844
|
-
background: none;
|
|
845
|
-
border: none;
|
|
846
|
-
font-size: 18px;
|
|
847
|
-
cursor: pointer;
|
|
848
|
-
color: rgba(255,255,255,0.5);
|
|
849
|
-
line-height: 1;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
.${n.CLOSE_TOOLTIP}:hover {
|
|
853
|
-
color: white;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
.${n.PREVIEW_CIRCLE} {
|
|
857
|
-
animation: helldots-pulse 1.5s ease-in-out infinite;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
@keyframes helldots-pulse {
|
|
861
|
-
0%, 100% { box-shadow: 0 0 0 0 rgba(46, 144, 250, 0.4), 0 1px 5px rgba(0,0,0,0.2); }
|
|
862
|
-
50% { box-shadow: 0 0 0 8px rgba(46, 144, 250, 0), 0 1px 5px rgba(0,0,0,0.2); }
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
.${n.COMMENT_OVERLAY} {
|
|
866
|
-
position: fixed;
|
|
867
|
-
top: 0;
|
|
868
|
-
left: 0;
|
|
869
|
-
right: 0;
|
|
870
|
-
bottom: 0;
|
|
871
|
-
background: transparent;
|
|
872
|
-
pointer-events: none;
|
|
873
|
-
z-index: ${x.TOOLBAR-1};
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
.${n.COMMENT_OVERLAY}.${n.ACTIVE} {
|
|
877
|
-
pointer-events: auto;
|
|
878
|
-
background: rgba(0, 0, 0, 0.1);
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
.${n.SELECTION_RECT} {
|
|
882
|
-
position: fixed;
|
|
883
|
-
border: 2px solid #2E90FA;
|
|
884
|
-
background: rgba(46, 144, 250, 0.1);
|
|
885
|
-
pointer-events: none;
|
|
886
|
-
z-index: ${x.TOOLTIP};
|
|
887
|
-
box-sizing: border-box;
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
.${n.SCREENSHOTS_CONTAINER} {
|
|
891
|
-
display: none;
|
|
892
|
-
overflow-x: auto;
|
|
893
|
-
gap: 8px;
|
|
894
|
-
margin-top: 4px;
|
|
895
|
-
padding: 4px 0;
|
|
896
|
-
scrollbar-width: none;
|
|
897
|
-
-ms-overflow-style: none;
|
|
898
|
-
margin-bottom: 16px;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
.${n.SCREENSHOTS_CONTAINER}::-webkit-scrollbar {
|
|
902
|
-
display: none;
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
.${n.SCREENSHOTS_CONTAINER}.${n.ACTIVE} {
|
|
906
|
-
display: flex;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
.${n.SCREENSHOT_ITEM} {
|
|
910
|
-
position: relative;
|
|
911
|
-
flex-shrink: 0;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG} {
|
|
915
|
-
width: 50px;
|
|
916
|
-
height: 50px;
|
|
917
|
-
object-fit: cover;
|
|
918
|
-
border-radius: 8px;
|
|
919
|
-
cursor: pointer;
|
|
920
|
-
display: block;
|
|
921
|
-
margin: 0;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}:hover {
|
|
925
|
-
opacity: 0.85;
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_REMOVE} {
|
|
929
|
-
position: absolute;
|
|
930
|
-
top: -5px;
|
|
931
|
-
right: -5px;
|
|
932
|
-
width: 18px;
|
|
933
|
-
height: 18px;
|
|
934
|
-
background: rgba(0,0,0,0.7);
|
|
935
|
-
border: none;
|
|
936
|
-
border-radius: 50%;
|
|
937
|
-
color: white;
|
|
938
|
-
font-size: 12px;
|
|
939
|
-
line-height: 1;
|
|
940
|
-
cursor: pointer;
|
|
941
|
-
display: none;
|
|
942
|
-
align-items: center;
|
|
943
|
-
justify-content: center;
|
|
944
|
-
z-index: 1;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
.${n.SCREENSHOT_ITEM}:hover .${n.SCREENSHOT_REMOVE} {
|
|
948
|
-
display: flex;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_REMOVE}:hover {
|
|
952
|
-
background: rgba(0,0,0,0.9);
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
.${n.TOOLTIP} > .${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},
|
|
956
|
-
.${n.THREAD_POPOVER} > .${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},
|
|
957
|
-
.${n.THREAD_REPLY} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG} {
|
|
958
|
-
width: 144px;
|
|
959
|
-
height: 100px;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
.${n.LIGHTBOX} {
|
|
963
|
-
position: fixed;
|
|
964
|
-
top: 0;
|
|
965
|
-
left: 0;
|
|
966
|
-
right: 0;
|
|
967
|
-
bottom: 0;
|
|
968
|
-
background: rgba(0,0,0,0.92);
|
|
969
|
-
z-index: ${x.LIGHTBOX};
|
|
970
|
-
display: flex;
|
|
971
|
-
align-items: center;
|
|
972
|
-
justify-content: center;
|
|
973
|
-
animation: helldots-fade-in 0.2s ease;
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
@keyframes helldots-fade-in {
|
|
977
|
-
from { opacity: 0; }
|
|
978
|
-
to { opacity: 1; }
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
.${n.LIGHTBOX_IMG} {
|
|
982
|
-
max-width: 90vw;
|
|
983
|
-
max-height: 90vh;
|
|
984
|
-
object-fit: contain;
|
|
985
|
-
border-radius: 8px;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
.${n.LIGHTBOX_CLOSE} {
|
|
989
|
-
position: absolute;
|
|
990
|
-
top: 16px;
|
|
991
|
-
right: 16px;
|
|
992
|
-
background: rgba(255,255,255,0.15);
|
|
993
|
-
border: none;
|
|
994
|
-
color: white;
|
|
995
|
-
font-size: 24px;
|
|
996
|
-
width: 40px;
|
|
997
|
-
height: 40px;
|
|
998
|
-
border-radius: 50%;
|
|
999
|
-
cursor: pointer;
|
|
1000
|
-
display: flex;
|
|
1001
|
-
align-items: center;
|
|
1002
|
-
justify-content: center;
|
|
1003
|
-
transition: background 0.2s;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
.${n.LIGHTBOX_CLOSE}:hover {
|
|
1007
|
-
background: rgba(255,255,255,0.3);
|
|
1008
|
-
}
|
|
1009
|
-
`,me=()=>`
|
|
1010
|
-
.${n.COMMENT_CURSOR},
|
|
1011
|
-
.${n.COMMENT_CURSOR} * {
|
|
1012
|
-
cursor: url('${pe}') 6 6, auto !important;
|
|
1013
|
-
}
|
|
1014
|
-
`;var v={commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmpty:"No comments yet",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All comments",filterCurrentPage:"Current page",filterByPage:"Filter by Page",filterByStatus:"Filter by Status",filterStatusAll:"All",filterUnresolved:"Unresolved",filterResolved:"Resolved",back:"Back",deleteComment:"Delete",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",tagsPlaceholder:"Add tags...",removeTag:"Remove tag",filterByType:"Filter by Type",filterByPriority:"Filter by Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var ge={commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmpty:"A\xFAn no hay comentarios",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todos los comentarios",filterCurrentPage:"P\xE1gina actual",filterByPage:"Filtrar por p\xE1gina",filterByStatus:"Filtrar por estado",filterStatusAll:"Todos",filterUnresolved:"Sin resolver",filterResolved:"Resueltos",back:"Volver",deleteComment:"Eliminar",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",tagsPlaceholder:"A\xF1adir etiquetas...",removeTag:"Quitar etiqueta",filterByType:"Filtrar por tipo",filterByPriority:"Filtrar por prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var Q={en:v,es:ge},J="en";function Ee(){let r=(navigator.language||J).slice(0,2).toLowerCase();return r in Q?r:J}function fe(r){return Q[r]||Q[J]}function _(r,e){return r.replace("{n}",String(e))}var Ge=6e4;function X(r,e){if(!Number.isFinite(r)||r<0)return"";let t=Math.floor(r/Ge);if(t<1)return e.durationLessThanMinute;if(t<60)return _(e.minutesAgoTemplate,t);let o=Math.floor(t/60);if(o<24){let l=t%60,c=_(e.hoursAgoTemplate,o);return l?`${c} ${_(e.minutesAgoTemplate,l)}`:c}let i=Math.floor(o/24),s=o%24,a=_(e.daysAgoTemplate,i);return s?`${a} ${_(e.hoursAgoTemplate,s)}`:a}var Ve=/^(css|sc|jsx|emotion)-/i,ze=/^data-(reactid|react-|v-|svelte-)/,Ye=["id","name","role","aria-label"],je=["data-testid","name","aria-label"],ee=r=>typeof CSS<"u"&&CSS.escape?CSS.escape(r):String(r).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),We=r=>String(r).replace(/["\\]/g,"\\$&"),P=(r,e)=>{try{return e.querySelectorAll(r).length===1}catch{return!1}},Ce=r=>(r||"").replace(/\s+/g," ").trim().slice(0,64),qe=r=>Ve.test(r)?!1:!r.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),Ke=r=>[...r.classList].filter(qe),Ze=r=>{let e={};for(let{name:t,value:o}of r.attributes)(Ye.includes(t)||t.startsWith("data-")&&!ze.test(t))&&o&&(e[t]=o.slice(0,64));return e},te=r=>{let e=r.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(o=>o.tagName===r.tagName);return{index:t.indexOf(r),count:t.length}},Qe=(r,e)=>{if(!r.id)return null;let t=`#${ee(r.id)}`;return P(t,e)?t:null},Je=(r,e)=>{let t=r.tagName.toLowerCase();for(let o of je){let i=r.getAttribute(o);if(!i)continue;let s=`${t}[${o}="${We(i)}"]`;if(P(s,e))return s}return null},et=(r,e)=>{let t=[],o=r;for(let i=0;i<3&&o;i++){let s=Ke(o),a=o.tagName.toLowerCase();if(t.unshift(s.length?`${a}.${s.map(ee).join(".")}`:a),i===0&&!s.length)return null;let l=t.join(" > ");if(P(l,e))return l;o=o.parentElement}return null},tt=(r,e)=>{if(r===e.body)return"body";let t=[],o=r;for(let s=0;s<5&&o;s++){if(o===e.body){t.unshift("body");break}if(o.id){let l=[`#${ee(o.id)}`,...t].join(" > ");if(P(l,e))return l}let{index:a}=te(o);t.unshift(`${o.tagName.toLowerCase()}:nth-of-type(${a+1})`),o=o.parentElement}let i=t.join(" > ");return P(i,e)?i:null},xe=(r,e)=>Qe(r,e)||Je(r,e)||et(r,e)||tt(r,e);function _e(r){return xe(r,r.ownerDocument)}function Oe(r,e,t){let o=r.ownerDocument,{index:i,count:s}=te(r);return{version:1,selector:xe(r,o),fingerprint:{tagName:r.tagName,textSnippet:Ce(r.textContent),attributes:Ze(r),siblingIndex:i,siblingCount:s},relativeX:e,relativeY:t}}var ot=(r,e)=>{if(!r&&!e)return 1;if(!r||!e)return 0;if(r===e)return 1;if(r.startsWith(e)||e.startsWith(r))return .8;let t=new Set(r.split(" ")),o=new Set(e.split(" ")),i=0;for(let s of t)o.has(s)&&i++;return 2*i/(t.size+o.size)},nt=(r,e)=>{let t=Object.keys(e);if(!t.length)return 1;let o=0;for(let i of t)(r.getAttribute(i)||"").slice(0,64)===e[i]&&o++;return o/t.length},be=(r,e)=>{let{index:t,count:o}=te(r),i=Math.abs(t-e.siblingIndex),s=Math.max(e.siblingCount,o,1);return Math.max(0,1-i/s)},it=(r,e)=>{if(r.tagName!==e.tagName)return 0;let t=!!e.textSnippet,o=Object.keys(e.attributes||{}).length>0,i=.5,s=.3,a=.2;return o?t||(s+=i,i=0):(i+=s,s=0),!t&&!o?be(r,e):i*ot(Ce(r.textContent),e.textSnippet)+s*nt(r,e.attributes||{})+a*be(r,e)},Te=(r,e)=>{let t=null;for(let o of r){let i=it(o,e);(!t||i>t.confidence)&&(t={element:o,confidence:i})}return t};function ye(r,e=document){let t=r?.fingerprint;if(!t||!t.tagName)return null;if(r.selector){let a=[];try{a=[...e.querySelectorAll(r.selector)]}catch{}let l=Te(a,t);if(l&&l.confidence>=.6)return l}if(!(!!t.textSnippet||Object.keys(t.attributes||{}).length>0))return null;let i;try{i=[...e.querySelectorAll(t.tagName)]}catch{return null}let s=Te(i,t);return s&&s.confidence>=.7?s:null}var ve="helldots-comments",U="helldots-pending-detail";function F(){try{let r=localStorage.getItem(ve);if(!r)return[];let e=JSON.parse(r);return Array.isArray(e)?e:[]}catch(r){return console.warn("HellDots: could not read stored comments",r),[]}}function Se(r){try{return localStorage.setItem(ve,JSON.stringify(r)),!0}catch{return!1}}function oe(r){if(Se(r))return!0;let e=r.map((i,s)=>({comment:i,index:s})).filter(({comment:i})=>i?.contextScreenshot).sort((i,s)=>{let a=Date.parse(i.comment.createdAt),l=Date.parse(s.comment.createdAt);return Number.isFinite(a)&&Number.isFinite(l)&&a!==l?a-l:i.index-s.index});if(e.length===0)return console.warn("HellDots: could not persist comments (storage quota exceeded, nothing left to shed)"),!1;let t=[...r],o=0;for(let{index:i}of e)if(t[i]={...t[i],contextScreenshot:null},o++,Se(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 ne(r,e,t){let o=new Set(e.map(s=>s.id));return[...r.filter(s=>!o.has(s.id)&&s.page!==t),...e]}var Ae='<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>',rt='<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>',st='<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>',G=r=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(r).catch(()=>{});let e=document.createElement("textarea");e.value=r,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},at=(r,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,resolved:e.statusResolved})[r]||e.statusOpen,I=(r,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[r]||e.unset,R=(r,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[r]||e.unset,B=({action:r,options:e,value:t,colorOf:o,labelOf:i,tooltipLabel:s,onSelect:a,showLabel:l=!1})=>{let c=document.createElement("div");c.style.position="relative";let p=document.createElement("button");p.type="button",p.className=n.INBOX_ACTION_BTN,l&&p.classList.add(n.INBOX_ACTION_BTN_LABELED),p.dataset.action=r,p.setAttribute("aria-haspopup","true");let h=document.createElement("span");h.className=n.INBOX_STATUS_DOT,p.appendChild(h);let m=null;l&&(m=document.createElement("span"),m.className=n.INBOX_ACTION_LABEL,p.appendChild(m));let u=document.createElement("div");u.className=n.INBOX_MENU,u.style.display="none",u.setAttribute("role","menu");let d=t,E=()=>{let f=`${s}: ${i(d)}`;h.style.backgroundColor=o(d),p.dataset.hdTooltip=f,p.setAttribute("aria-label",f),m&&(m.textContent=i(d)),u.querySelectorAll("[data-picker-option]").forEach(g=>{let b=g.dataset.pickerOption,C=b===""?null:b;g.setAttribute("aria-checked",String(C===d))})};for(let f of e){let g=document.createElement("button");g.type="button",g.className=n.INBOX_MENU_ITEM,g.dataset.pickerOption=f===null?"":f,g.setAttribute("role","menuitemradio");let b=document.createElement("span");b.className=n.INBOX_STATUS_DOT,b.style.backgroundColor=o(f),g.appendChild(b),g.appendChild(document.createTextNode(i(f))),g.addEventListener("click",C=>{C.stopPropagation(),u.style.display="none",f!==d&&(d=f,a(f),E())}),u.appendChild(g)}return p.addEventListener("click",f=>{f.stopPropagation(),u.style.display=u.style.display==="none"?"block":"none"}),c.appendChild(p),c.appendChild(u),E(),c},V=(r,{strings:e,onCopy:t,onSetStatus:o,onSetType:i,onSetPriority:s,onDelete:a})=>{let l=document.createElement("div");l.className=n.INBOX_CARD_ACTIONS;let c=document.createElement("button");c.type="button",c.className=n.INBOX_ACTION_BTN,c.dataset.action="copy",c.dataset.hdTooltip=e.copyAgentContext,c.setAttribute("aria-label",e.copyAgentContext),c.innerHTML=Ae,c.addEventListener("click",d=>{d.stopPropagation(),t(r),c.innerHTML=rt,c.dataset.hdTooltip=e.copied,setTimeout(()=>{c.innerHTML=Ae,c.dataset.hdTooltip=e.copyAgentContext},1500)}),l.appendChild(c),l.appendChild(B({action:"status",options:M,value:r.status||"open",colorOf:d=>de[d]||"",labelOf:d=>at(d,e),tooltipLabel:e.statusLabel,onSelect:d=>o(r,d)})),l.appendChild(B({action:"type",options:[null,...y],value:r.type||null,colorOf:d=>w[d]||"transparent",labelOf:d=>I(d,e),tooltipLabel:e.typeLabel,onSelect:d=>i?.(r,d),showLabel:!0})),l.appendChild(B({action:"priority",options:[null,...S],value:r.priority||null,colorOf:d=>L[d]||"transparent",labelOf:d=>R(d,e),tooltipLabel:e.priorityLabel,onSelect:d=>s?.(r,d),showLabel:!0}));let p=document.createElement("div");p.style.position="relative";let h=document.createElement("button");h.type="button",h.className=n.INBOX_ACTION_BTN,h.dataset.action="menu",h.dataset.hdTooltip=e.moreOptions,h.setAttribute("aria-label",e.commentOptions),h.innerHTML=st;let m=document.createElement("div");m.className=n.INBOX_MENU,m.style.display="none";let u=document.createElement("button");return u.type="button",u.className=n.INBOX_MENU_ITEM,u.textContent=e.deleteComment,u.addEventListener("click",d=>{d.stopPropagation(),m.style.display="none",a(r)}),m.appendChild(u),h.addEventListener("click",d=>{d.stopPropagation(),m.style.display=m.style.display==="none"?"block":"none"}),p.appendChild(h),p.appendChild(m),l.appendChild(p),l};var lt=(r,e)=>{let t=Date.now()-new Date(r).getTime(),o=Math.floor(t/6e4),i=Math.floor(t/36e5),s=Math.floor(t/864e5);return o<1?e.justNow:o<60?_(e.minutesAgoTemplate,o):i<24?_(e.hoursAgoTemplate,i):_(e.daysAgoTemplate,s)},ct=(r,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(r)),$=(r,e,t,o)=>{let i=document.createElement("div");i.className=n.THREAD_META;let s=document.createElement("span");s.className=n.THREAD_AUTHOR,s.textContent=r||t.anonymous;let a=document.createElement("span");return a.className=n.THREAD_TIME,a.textContent=lt(e,t),a.dataset.fullDate=ct(e,o),i.appendChild(s),i.appendChild(a),i},dt=(r,e)=>{let t=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),o={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:"\u21E7"},i=o[r.shortcutModifier]||o.alt,s=r.shortcutKey?.toUpperCase()||"C";return`${i} + ${s}`},ht='<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>',pt='<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>',ut='<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>',mt='<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>',z=({areaClassName:r,inputTag:e="textarea",inputClassName:t,inputId:o,inputPlaceholder:i,submitBtnId:s,fileInputId:a},l)=>{let c=document.createElement("div");c.className=r;let p=document.createElement(e);o&&(p.id=o),t&&(p.className=t),p.placeholder=i,p.setAttribute("aria-label",i),e==="input"&&(p.type="text");let h=document.createElement("div");h.className=n.SCREENSHOTS_CONTAINER;let m=document.createElement("div");m.className=n.COMMENT_ACTIONS_BAR;let u=document.createElement("button");u.className=n.ATTACH_IMAGE_BTN,u.type="button",u.setAttribute("aria-label",l.attachImage),u.innerHTML=ht;let d=document.createElement("input");d.type="file",a&&(d.id=a),d.accept="image/*",d.style.display="none";let E=document.createElement("button");return s&&(E.id=s),E.className=n.THREAD_SUBMIT,E.type="button",E.setAttribute("aria-label",l.send),E.innerHTML=pt,m.appendChild(u),m.appendChild(d),m.appendChild(E),c.appendChild(p),c.appendChild(h),c.appendChild(m),{container:c,inputEl:p,screenshotsContainer:h,attachBtn:u,fileInput:d,submitBtn:E}},Ne=(r,e,t,o)=>{let i=document.createElement("div");i.className=n.TOOLBAR_ACTION_WRAPPER;let s=document.createElement("div");s.className=n.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>s.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${n.TOOLBAR_ACTION_BTN} ${r}`,a.setAttribute("aria-label",o),a.innerHTML=e,i.appendChild(s),i.appendChild(a),i},Ie=(r={},e=v)=>{let t=document.createElement("div");t.id=T.TOOLBAR;let o=document.createElement("div");o.className=n.TOOLBAR_ACTIONS;let i=document.createElement("span");i.className=n.TOOLBAR_TEXT,i.textContent=e.toolbarComment;let s=document.createElement("span");s.className=n.SHORTCUT_HINT,s.textContent=dt(r,e);let a=Ne(n.TOOLBAR_COMMENT_BTN,ut,[i,s],e.toolbarComment);a.querySelector(`.${n.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=n.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=Ne(n.TOOLBAR_MENU_BTN,mt,[l],e.toolbarInbox);return o.appendChild(a),o.appendChild(c),t.appendChild(o),t},gt=r=>{let e=document.createElement("div");e.className=n.CLASSIFY_ROW;let t=null,o=null,i=[],s=document.createElement("div");s.className=n.INBOX_BADGES;let a=document.createElement("input");a.type="text",a.className=n.TAGS_INPUT,a.placeholder=r.tagsPlaceholder,a.setAttribute("aria-label",r.tagsPlaceholder);let l=()=>{s.innerHTML="",i.forEach((h,m)=>{let u=document.createElement("span");u.className=n.TAG_CHIP,u.appendChild(document.createTextNode(h));let d=document.createElement("button");d.type="button",d.className=n.TAG_CHIP_REMOVE,d.setAttribute("aria-label",`${r.removeTag}: ${h}`),d.innerHTML="×",d.addEventListener("click",E=>{E.stopPropagation(),i.splice(m,1),l()}),u.appendChild(d),s.appendChild(u)})},c=()=>{let h=a.value.trim().toLowerCase();h&&!i.includes(h)&&(i.push(h),l()),a.value=""};a.addEventListener("keydown",h=>{h.key!=="Enter"&&h.key!==","||(h.preventDefault(),c())});let p=()=>{e.replaceChildren(),e.appendChild(B({action:"type",options:[null,...y],value:null,colorOf:h=>w[h]||"transparent",labelOf:h=>I(h,r),tooltipLabel:r.typeLabel,onSelect:h=>t=h,showLabel:!0})),e.appendChild(B({action:"priority",options:[null,...S],value:null,colorOf:h=>L[h]||"transparent",labelOf:h=>R(h,r),tooltipLabel:r.priorityLabel,onSelect:h=>o=h,showLabel:!0})),e.appendChild(a),e.appendChild(s)};return p(),{container:e,getType:()=>t,getPriority:()=>o,getTags:()=>(c(),[...i]),reset:()=>{t=null,o=null,i.length=0,a.value="",l(),p()}}},Re=(r=v)=>{let e=document.createElement("div");e.id=T.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",r.commentBoxAriaLabel);let{container:t}=z({areaClassName:n.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:T.COMMENT_INPUT,inputPlaceholder:r.commentPlaceholder,submitBtnId:T.SUBMIT_COMMENT,fileInputId:T.ATTACH_IMAGE_INPUT},r),o=gt(r);return e.appendChild(o.container),e.appendChild(t),e.style.display="none",e.classify=o,e},we=(r,e=v)=>{let t=document.createElement("div");return t.className=n.CIRCLE,t.dataset.commentId=r.id,t.dataset.commentText=r.text,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${r.text}`),t.style.cssText=`
|
|
1015
|
-
position: absolute;
|
|
1016
|
-
pointer-events: auto;
|
|
1017
|
-
`,t},H=(r,e)=>{let t=document.createElement("div");return t.className=n.SCREENSHOTS_CONTAINER,t.classList.add(n.ACTIVE),r.forEach(o=>{let i=document.createElement("div");i.className=n.SCREENSHOT_ITEM;let s=document.createElement("img");s.className=n.SCREENSHOT_IMG,s.src=o,s.alt=e.attachedScreenshot,i.appendChild(s),t.appendChild(i)}),t},Le=(r,e=v,t)=>{let o=document.createElement("div");o.className=n.TOOLTIP,o.dataset.for=r.id,o.setAttribute("role","dialog"),o.setAttribute("aria-label",e.tooltipAriaLabel);let i=document.createElement("div");i.className=n.THREAD_HEADER;let s=$(r.author,r.createdAt,e,t),a=document.createElement("button");a.type="button",a.className=n.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="×",i.appendChild(s),i.appendChild(a);let l=document.createElement("div");l.className=n.THREAD_BODY,l.textContent=r.text,o.appendChild(i),o.appendChild(l);let c=r.screenshots||(r.screenshot?[r.screenshot]:[]);return c.length>0&&o.appendChild(H(c,e)),o},k=(r,e=v,t)=>{let o=document.createElement("div");o.className=n.THREAD_REPLY;let i=$(r.author,r.timestamp,e,t),s=document.createElement("div");s.className=n.THREAD_BODY,s.textContent=r.text,o.appendChild(i),o.appendChild(s);let a=r.screenshots||(r.screenshot?[r.screenshot]:[]);return a.length>0&&o.appendChild(H(a,e)),o},Be=(r,e=v,t)=>{let o=document.createElement("div");o.className=n.THREAD_POPOVER,o.dataset.for=r.id,o.setAttribute("role","dialog"),o.setAttribute("aria-label",e.popoverAriaLabel);let i=document.createElement("div");i.className=n.THREAD_HEADER;let s=$(r.author,r.createdAt,e,t),a=document.createElement("button");a.type="button",a.className=n.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="×",i.appendChild(s),i.appendChild(a);let l=document.createElement("div");l.className=n.THREAD_BODY,l.textContent=r.text;let c=document.createElement("div");c.className=n.THREAD_REPLIES,r.replies&&r.replies.forEach(m=>{c.appendChild(k(m,e,t))});let{container:p}=z({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e);o.appendChild(i),o.appendChild(l);let h=r.screenshots||(r.screenshot?[r.screenshot]:[]);return h.length>0&&o.appendChild(H(h,e)),o.appendChild(c),o.appendChild(p),o};var Et=r=>{let e=[...r.attributes].map(({name:t,value:o})=>`${t}="${o}"`).join(" ");return`<${r.tagName.toLowerCase()}${e?` ${e}`:""}>`},ft=r=>{if(!r?.tagName)return"(unknown)";let e=Object.entries(r.attributes||{}).map(([t,o])=>`${t}="${o}"`).join(" ");return`<${r.tagName.toLowerCase()}${e?` ${e}`:""}>`},bt=r=>{let e=[],t=r;for(;t&&t!==document.documentElement;){let o=t.tagName.toLowerCase(),i=t.id?`#${t.id}`:"",s=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${o}${i}${s}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function Y(r,{viewportWidth:e,viewportHeight:t,strings:o}){let i=r.anchor,s=i?.fingerprint,a=r.container?.isConnected?r.container:null,l=r.hidden?"hidden":r.anchorState,c=a?Et(a):ft(s),p=a?bt(a):"(unavailable)",h=r.context?.viewport,m=h?.width??e,u=h?.height??t,d=[`Page: ${r.page}`,`Viewport: ${m}x${u}`,`Anchor state: ${l}`,`Status: ${r.status||"open"}`,`Selector: ${i?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${p}`,`Nearby text: "${s?.textSnippet??""}"`,`Comment by ${r.author} (${r.createdAt}):`,`"${r.text}"`];r.type&&d.push(`Type: ${r.type}`),r.priority&&d.push(`Priority: ${r.priority}`),r.tags?.length&&d.push(`Tags: ${r.tags.join(", ")}`);let E=r.context;if(E&&(E.url&&d.push(`URL: ${E.url}`),E.screen&&d.push(`Screen: ${E.screen.width}x${E.screen.height}`),E.browser?.name&&d.push(`Browser: ${`${E.browser.name} ${E.browser.version||""}`.trim()}`),E.os?.name&&d.push(`OS: ${`${E.os.name} ${E.os.version||""}`.trim()}`)),o&&r.status==="resolved"&&r.resolvedAt){let g=X(new Date(r.resolvedAt).getTime()-new Date(r.createdAt).getTime(),o);g&&d.push(`Resolution time: ${g}`)}let f=r.replies||[];if(f.length>0){d.push(`Replies (${f.length}):`);for(let g of f)d.push(`- ${g.author}: "${g.text}"`)}return d.join(`
|
|
1018
|
-
`)}var Tt='<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>',Ct='<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>',xt='<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>',_t='<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>',j=class{constructor({shadowRoot:e,strings:t,locale:o,currentPage:i,getComments:s,callbacks:a}){this.shadowRoot=e,this.strings=t,this.locale=o,this.currentPage=i,this.getComments=s,this.callbacks=a,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.el=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=n.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.shadowRoot.appendChild(this.el),this.render())}close(){this._clearHighlight(),this.el?.remove(),this.el=null,this.detailId=null}refresh(){this.el&&this.render()}_highlight(e){if(this._clearHighlight(),e.anchorState!=="anchored"||e.hidden||e.status==="resolved")return;let t=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);t&&(t.classList.add(n.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(n.HIGHLIGHT),this._highlightedEl=null}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter==="resolved"?e=e.filter(t=>t.status==="resolved"):this.statusFilter==="unresolved"&&(e=e.filter(t=>t.status!=="resolved")),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(o=>o.id===this.detailId):null;t?this._renderDetail(t,e):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(o=>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=n.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="×",e.addEventListener("click",()=>this.callbacks.onClose()),e}_renderList(e){let t=document.createElement("div");t.className=n.INBOX_HEADER,t.appendChild(this._buildFilter()),t.appendChild(this._closeButton()),this.el.appendChild(t);let o=document.createElement("div");if(o.className=n.INBOX_LIST,this.el.appendChild(o),e.length===0){let i=document.createElement("div");i.className=n.INBOX_EMPTY,i.textContent=this.strings.inboxEmpty,o.appendChild(i);return}for(let i of e)o.appendChild(this._buildCard(i,{interactive:!0}))}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_statusFilterLabel(e){return e==="unresolved"?this.strings.filterUnresolved:e==="resolved"?this.strings.filterResolved:this.strings.filterStatusAll}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(this._statusFilterLabel(this.statusFilter)),this.typeFilter!=="all"&&e.push(I(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(R(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_buildFilter(){let e=document.createElement("div");e.className=n.INBOX_FILTER+"-wrapper";let t=this._filterSummaryLabel(),o=document.createElement("button");o.type="button",o.className=n.INBOX_FILTER,o.setAttribute("aria-haspopup","true"),o.setAttribute("aria-expanded","false"),o.innerHTML=`<span>${t}</span>${Tt}`;let i=document.createElement("div");i.className=n.INBOX_FILTER_MENU,i.style.display="none";let s=l=>{let c=document.createElement("div");c.className=n.INBOX_FILTER_SECTION,c.textContent=l,i.appendChild(c)},a=(l,c,p,h,m)=>{let u=document.createElement("button");u.type="button",u.className=n.INBOX_FILTER_OPTION,u.dataset[p]=h,u.setAttribute("role","menuitemradio"),u.setAttribute("aria-checked",String(c)),u.innerHTML=`<span>${l}</span>${c?"\u2713":""}`,u.addEventListener("click",d=>{d.stopPropagation(),m(),this.render()}),i.appendChild(u)};s(this.strings.filterByPage);for(let l of["all","page"])a(this._pageFilterLabel(l),this.pageFilter===l,"filterPage",l,()=>this.pageFilter=l);s(this.strings.filterByStatus);for(let l of["all","unresolved","resolved"])a(this._statusFilterLabel(l),this.statusFilter===l,"filterStatus",l,()=>this.statusFilter=l);s(this.strings.filterByType);for(let l of["all",...y])a(l==="all"?this.strings.filterStatusAll:I(l,this.strings),this.typeFilter===l,"filterType",l,()=>this.typeFilter=l);s(this.strings.filterByPriority);for(let l of["all",...S])a(l==="all"?this.strings.filterStatusAll:R(l,this.strings),this.priorityFilter===l,"filterPriority",l,()=>this.priorityFilter=l);return o.addEventListener("click",l=>{l.stopPropagation();let c=i.style.display!=="none";i.style.display=c?"none":"block",o.setAttribute("aria-expanded",String(!c))}),e.appendChild(o),e.appendChild(i),e}_buildCard(e,{interactive:t}){let o=document.createElement("div");o.className=n.INBOX_CARD,e.status==="resolved"&&o.classList.add(`${n.INBOX_CARD}--resolved`),o.dataset.commentId=e.id;let i=document.createElement("div");i.className=n.INBOX_CARD_HEADER,i.appendChild($(e.author,e.createdAt,this.strings,this.locale)),i.appendChild(this._buildCardActions(e)),o.appendChild(i);let s=document.createElement("div");if(s.className=n.INBOX_CARD_TEXT,s.textContent=e.text,o.appendChild(s),e.screenshots?.length){let c=H(e.screenshots,this.strings);c.querySelectorAll(`.${n.SCREENSHOT_IMG}`).forEach(p=>{p.addEventListener("click",h=>{h.stopPropagation(),this.callbacks.onShowLightbox(p.src)})}),o.appendChild(c)}let a=this._buildBadges(e);a&&o.appendChild(a);let l=this._buildTag(e);if(l&&o.appendChild(l),t){o.setAttribute("role","button"),o.setAttribute("tabindex","0");let c=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=n.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",h=>{h.stopPropagation(),c()}),o.appendChild(p),o.addEventListener("click",c),o.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),c())}),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=n.INBOX_CARD_TAG,o.textContent=t,o}_buildBadges(e){let t=document.createElement("div");t.className=n.INBOX_BADGES;let o=(i,s,a)=>{let l=document.createElement("span");l.className=`${n.BADGE} ${s}`,l.textContent=i,a&&(l.style.borderColor=a),t.appendChild(l)};e.type&&o(I(e.type,this.strings),n.BADGE_TYPE,w[e.type]),e.priority&&o(R(e.priority,this.strings),n.BADGE_PRIORITY,L[e.priority]);for(let i of e.tags||[])o(i,n.BADGE_TAG,null);if(e.status==="resolved"){let i=e.resolvedAt?X(new Date(e.resolvedAt).getTime()-new Date(e.createdAt).getTime(),this.strings):"";o(_(this.strings.resolvedInTemplate,i||"\u2014"),n.BADGE_DURATION,null)}return t.children.length?t:null}_buildContextBlock(e){let{context:t,contextScreenshot:o}=e;if(!t&&!o)return null;let i=document.createElement("div");i.className=n.CONTEXT_BLOCK;let s=document.createElement("div");if(s.className=n.INBOX_FILTER_SECTION,s.textContent=this.strings.contextSection,i.appendChild(s),o){let a=document.createElement("div");a.className=n.CONTEXT_SCREENSHOT_CAPTION,a.textContent=this.strings.autoScreenshotLabel,i.appendChild(a);let l=document.createElement("img");l.className=n.SCREENSHOT_IMG,l.src=o,l.alt=this.strings.autoScreenshotLabel,l.addEventListener("click",c=>{c.stopPropagation(),this.callbacks.onShowLightbox(o)}),i.appendChild(l)}if(t){let a=(p,h)=>{if(!h)return;let m=document.createElement("div");m.className=n.CONTEXT_ROW;let u=document.createElement("span");u.textContent=p;let d=document.createElement("span");d.textContent=h,m.appendChild(u),m.appendChild(d),i.appendChild(m)},l=p=>p?`${p.width}\xD7${p.height}`:"",c=p=>p?.name?`${p.name} ${p.version||""}`.trim():"";a(this.strings.contextUrl,t.url),a(this.strings.contextViewport,l(t.viewport)),a(this.strings.contextScreen,l(t.screen)),a(this.strings.contextBrowser,c(t.browser)),a(this.strings.contextOs,c(t.os))}return i}_buildCardActions(e){return V(e,{strings:this.strings,onCopy:t=>G(Y(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),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===t.id&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let o=t.indexOf(e),i=document.createElement("div");i.className=n.INBOX_DETAIL_HEADER;let s=document.createElement("button");s.type="button",s.className=n.INBOX_BACK,s.innerHTML=`${Ct}<span>${this.strings.back}</span>`,s.addEventListener("click",()=>{this.detailId=null,this.render()}),i.appendChild(s);let a=document.createElement("div");a.className=n.INBOX_CARD_ACTIONS;let l=(m,u,d)=>{let E=document.createElement("button");E.type="button",E.className=n.INBOX_NAV_BTN,E.setAttribute("aria-label",u),E.title=u,E.innerHTML=m;let f=t[d];return E.disabled=!f,f&&E.addEventListener("click",()=>this._openDetail(f)),E};a.appendChild(l(xt,this.strings.prevComment,o-1)),a.appendChild(l(_t,this.strings.nextComment,o+1)),a.appendChild(this._closeButton()),i.appendChild(a),this.el.appendChild(i);let c=document.createElement("div");c.className=n.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let p=this._buildContextBlock(e);p&&c.appendChild(p);let h=document.createElement("div");h.className=n.INBOX_REPLIES;for(let m of e.replies||[]){let u=k(m,this.strings,this.locale);u.querySelectorAll(`.${n.SCREENSHOT_IMG}`).forEach(d=>{d.addEventListener("click",E=>{E.stopPropagation(),this.callbacks.onShowLightbox(d.src)})}),h.appendChild(u)}c.appendChild(h),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:o,screenshotsContainer:i,attachBtn:s,fileInput:a,submitBtn:l}=z({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],p=()=>{i.innerHTML="",i.classList.toggle(n.ACTIVE,c.length>0),c.forEach((m,u)=>{let d=document.createElement("div");d.className=n.SCREENSHOT_ITEM;let E=document.createElement("img");E.className=n.SCREENSHOT_IMG,E.src=m,E.alt=this.strings.attachedScreenshot,E.onclick=()=>this.callbacks.onShowLightbox(m);let f=document.createElement("button");f.type="button",f.className=n.SCREENSHOT_REMOVE,f.setAttribute("aria-label",this.strings.removeScreenshot),f.innerHTML="×",f.onclick=g=>{g.stopPropagation(),c.splice(u,1),p()},d.appendChild(E),d.appendChild(f),i.appendChild(d)})};s.addEventListener("click",()=>a.click()),a.addEventListener("change",m=>{let u=m.target.files[0];if(!u||c.length>=5)return;let d=new FileReader;d.onload=E=>{c.push(E.target.result),p()},d.readAsDataURL(u),a.value=""});let h=()=>{let m=o.value.trim();!m&&c.length===0||(this.callbacks.onReply(e,m,[...c]),c=[],this.render())};return l.addEventListener("click",h),o.addEventListener("keydown",m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),h())}),t}};var Ot=r=>{let e=new Set;for(let t of r){let o=String(t).trim().toLowerCase();o&&e.add(o)}return[...e]},ie=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||Ee(),this.strings=fe(this.locale),this.resizeObservers=new Map,this.mutationObservers=new Map,this.positionValidationEnabled=!0,this._pendingRaf=null,this._pendingContextScreenshot=null,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.initOverlay()):this.initOverlay()}initOverlay(){this.shadowRoot=re(),this.toolbar=Ie(this.options,this.strings),this.commentBox=Re(this.strings),this.overlay=document.createElement("div"),this.overlay.className=n.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${n.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${n.TOOLBAR_MENU_BTN}`),this.submitButton=this.shadowRoot.getElementById(T.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(T.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${n.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(T.ATTACH_IMAGE_INPUT),this.bindEventListeners(),this.setupKeyboardShortcut(),this.setupResizeHandlers(),this.injectStyles(),this.options.persistence==="localStorage"&&(this.loadComments(F()),this._openPendingDetail())}_navigateTo(e){location.assign(e)}_openPendingDetail(){let e=null;try{e=sessionStorage.getItem(U),e!=null&&sessionStorage.removeItem(U)}catch{return}if(!e)return;let t=this.comments.find(o=>String(o.id)===e);t&&(this.showInbox(),this.inboxView.openDetail(t.id))}_syncStorage(){this.options.persistence==="localStorage"&&oe(ne(F(),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 o=new FileReader;o.onload=i=>{this._pendingScreenshots.push(i.target.result),this._updateScreenshotsPreview()},o.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.closeThreadPopover():this.inboxView?.isOpen()?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"),o=!this.isMac&&e.altKey&&e.key.toLowerCase()==="c",i=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||o||i)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?.(`.${n.CIRCLE}`)||t?.closest?.(`.${n.TOOLTIP}`)||t?.closest?.(`.${n.THREAD_POPOVER}`)||t?.closest?.(`.${n.INBOX_PANEL}`)||t?.closest?.(`.${n.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=o=>this._onDragMove(o),this._boundDragEnd=o=>this._onDragEnd(o),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 i=Math.min(this._dragStart.x,e.clientX),s=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=n.SELECTION_RECT,this.shadowRoot.appendChild(this._selectionRect)),this._selectionRect.style.left=`${i}px`,this._selectionRect.style.top=`${s}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),i=Math.abs(e.clientX-this._dragStart.x),s=Math.abs(e.clientY-this._dragStart.y);if(this._selectionRect?.remove(),this._selectionRect=null,i>10&&s>10)try{this._pendingScreenshots||(this._pendingScreenshots=[]);let a=await K(()=>q({scale:1})),l=ae(a,{left:t,top:o,width:i,height:s});l&&this._pendingScreenshots.length<5&&this._pendingScreenshots.push(l),this.options.autoScreenshot&&(this._pendingContextScreenshot=Z(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 h=await K(()=>q({scale:D}));this._pendingContextScreenshot=Z(h,{sourceScale:D})}catch(h){console.warn("HellDots: automatic screenshot failed",h),this._pendingContextScreenshot=null}let o=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let i=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=o||"";let s=i?.closest?.(he.CONTAINER)||document.body,a=s.getBoundingClientRect(),l=a.width>0?(e-a.left)/a.width:0,c=a.height>0?(t-a.top)/a.height:0,p=Oe(s,l,c);p.targetSelector=i&&i!==s?_e(i):null,this.currentPosition={container:s,relativeX:l,relativeY:c,anchor:p,target:i||s},this.createPreviewCircle(e,t),document.body.classList.remove(n.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${n.SCREENSHOTS_CONTAINER}`);if(e){if(e.innerHTML="",!this._pendingScreenshots||this._pendingScreenshots.length===0){e.classList.remove(n.ACTIVE);return}e.classList.add(n.ACTIVE),this._pendingScreenshots.forEach((t,o)=>{let i=document.createElement("div");i.className=n.SCREENSHOT_ITEM;let s=document.createElement("img");s.className=n.SCREENSHOT_IMG,s.src=t,s.alt=this.strings.attachedScreenshot,s.onclick=()=>this.showLightbox(t);let a=document.createElement("button");a.type="button",a.className=n.SCREENSHOT_REMOVE,a.setAttribute("aria-label",this.strings.removeScreenshot),a.innerHTML="×",a.onclick=l=>{l.stopPropagation(),this._pendingScreenshots.splice(o,1),this._updateScreenshotsPreview()},i.appendChild(s),i.appendChild(a),e.appendChild(i)})}}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${n.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(n.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let o=300,s=28/2,a=s+10,l=window.innerWidth,c=window.innerHeight,p=e+s,h=t+s,m=p+a,u=h-s;m+o>l&&(m=p-a-o),m=Math.max(10,m);let d=this.commentBox.getBoundingClientRect();u+d.height>c&&(u=c-d.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(n.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentBtn?.classList.toggle(n.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(n.ACTIVE,this.commentMode),document.body.classList.toggle(n.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox()}saveComment(){if(!this.commentInput.value.trim()||!this.currentPosition)return;let e={text:this.commentInput.value,container:this.currentPosition.container,relativeX:this.currentPosition.relativeX,relativeY:this.currentPosition.relativeY,anchor:this.currentPosition.anchor,anchorState:"anchored",target:this.currentPosition.target,hidden:!1,status:"open",page:location.pathname,id:Date.now(),replies:[],author:this.options.user?.name||this.strings.anonymous,createdAt:new Date().toISOString(),screenshots:this._pendingScreenshots?[...this._pendingScreenshots]:[],type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:this.commentBox.classify?.getTags()??[],resolvedAt:null,context:ce(),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=we(e,this.strings);t.addEventListener("mouseenter",()=>this.showCommentTooltip(t,e)),t.addEventListener("mouseleave",()=>{setTimeout(()=>{let o=this.shadowRoot.querySelector(`.${n.TOOLTIP}[data-for="${e.id}"]`);o&&!o.matches(":hover")&&o.remove()},250)}),t.addEventListener("click",o=>{o.stopPropagation();let i=this.shadowRoot.querySelector(`.${n.TOOLTIP}[data-for="${e.id}"]`);i&&i.remove(),this.showThreadPopover(t,e)}),t.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.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(`.${n.THREAD_POPOVER}[data-for="${t.id}"]`)||this.shadowRoot.querySelector(`.${n.TOOLTIP}[data-for="${t.id}"]`))return;let s=Le(t,this.strings,this.locale);this.shadowRoot.appendChild(s),s.querySelectorAll(`.${n.SCREENSHOT_IMG}`).forEach(a=>{a.addEventListener("click",l=>{l.stopPropagation(),this.showLightbox(a.src)})}),setTimeout(()=>{this.positionPopoverAtCircle(s,e)},10),s.querySelector(`.${n.CLOSE_TOOLTIP}`).addEventListener("click",a=>{a.stopPropagation(),s.remove()}),s.addEventListener("mouseleave",()=>s.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new j({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,callbacks:{onOpenDetailScroll:e=>e.container?.scrollIntoView?.({block:"center"}),onReply:(e,t,o)=>this.addReply(e,t,o),onDelete:e=>this.deleteComment(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(U,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;!this.inboxView.el?.contains(t)&&!this.inboxBtn.contains(t)&&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 o=this.shadowRoot.querySelector(`.${n.TOOLTIP}[data-for="${t.id}"]`);o&&o.remove();let i=Be(t,this.strings,this.locale);this.shadowRoot.appendChild(i);let s=i.querySelector(`.${n.THREAD_HEADER}`),a=V(t,{strings:this.strings,onCopy:g=>G(Y(g,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onSetStatus:(g,b)=>this.setCommentStatus(g.id,b),onSetType:(g,b)=>this.setCommentType(g.id,b),onSetPriority:(g,b)=>this.setCommentPriority(g.id,b),onDelete:g=>{this.closeThreadPopover(),this.deleteComment(g.id),this.inboxView?.isOpen()&&this.inboxView.refresh()}});s.insertBefore(a,s.querySelector(`.${n.CLOSE_TOOLTIP}`));let l=Array.from(i.children).find(g=>g.classList.contains(n.SCREENSHOTS_CONTAINER));l&&l.querySelectorAll(`.${n.SCREENSHOT_IMG}`).forEach(g=>{g.addEventListener("click",b=>{b.stopPropagation(),this.showLightbox(g.src)})}),setTimeout(()=>{e?this.positionPopoverAtCircle(i,e):this.centerPopover(i)},10),i.querySelector(`.${n.CLOSE_TOOLTIP}`).addEventListener("click",g=>{g.stopPropagation(),this.closeThreadPopover()});let c=i.querySelector(`.${n.THREAD_INPUT}`),p=i.querySelector(`.${n.THREAD_SUBMIT}`),h=i.querySelector(`.${n.THREAD_INPUT_AREA} .${n.ATTACH_IMAGE_BTN}`),m=i.querySelector(`.${n.THREAD_INPUT_AREA} input[type="file"]`),u=i.querySelector(`.${n.THREAD_INPUT_AREA} .${n.SCREENSHOTS_CONTAINER}`),d=[],E=()=>{if(u.innerHTML="",d.length===0){u.classList.remove(n.ACTIVE);return}u.classList.add(n.ACTIVE),d.forEach((g,b)=>{let C=document.createElement("div");C.className=n.SCREENSHOT_ITEM;let O=document.createElement("img");O.className=n.SCREENSHOT_IMG,O.src=g,O.alt=this.strings.attachedScreenshot,O.onclick=()=>this.showLightbox(g);let N=document.createElement("button");N.className=n.SCREENSHOT_REMOVE,N.innerHTML="×",N.onclick=W=>{W.stopPropagation(),d.splice(b,1),E()},C.appendChild(O),C.appendChild(N),u.appendChild(C)})};h.addEventListener("click",()=>{m.click()}),m.addEventListener("change",g=>{let b=g.target.files[0];if(!b||d.length>=5)return;let C=new FileReader;C.onload=O=>{d.push(O.target.result),E()},C.readAsDataURL(b),m.value=""});let f=()=>{let g=c.value.trim();if(!g&&d.length===0)return;let b=this.addReply(t,g,d.length>0?[...d]:[]),C=i.querySelector(`.${n.THREAD_REPLIES}`),O=k(b,this.strings,this.locale);C.appendChild(O),O.querySelectorAll(`.${n.SCREENSHOT_IMG}`).forEach(N=>{N.addEventListener("click",W=>{W.stopPropagation(),this.showLightbox(N.src)})}),c.value="",d=[],E(),c.focus()};p.addEventListener("click",f),c.addEventListener("keydown",g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),f())}),this.activeThreadPopover=i,setTimeout(()=>c.focus(),50),setTimeout(()=>{this._threadClickHandler=g=>{let b=g.composedPath()[0]||g.target;!i.contains(b)&&!e?.contains(b)&&this.closeThreadPopover()},document.addEventListener("mousedown",this._threadClickHandler)},0)}closeThreadPopover(){this.activeThreadPopover&&(this.activeThreadPopover.remove(),this.activeThreadPopover=null),this._threadClickHandler&&(document.removeEventListener("mousedown",this._threadClickHandler),this._threadClickHandler=null)}showLightbox(e){this.closeLightbox();let t=document.createElement("div");t.className=n.LIGHTBOX;let o=document.createElement("img");o.className=n.LIGHTBOX_IMG,o.src=e,o.alt=this.strings.screenshotPreview;let i=document.createElement("button");i.type="button",i.className=n.LIGHTBOX_CLOSE,i.setAttribute("aria-label",this.strings.close),i.innerHTML="×",i.addEventListener("click",()=>this.closeLightbox()),t.appendChild(o),t.appendChild(i),t.addEventListener("click",s=>{s.target===t&&this.closeLightbox()}),this.shadowRoot.appendChild(t),this._activeLightbox=t}closeLightbox(){this._activeLightbox?.remove(),this._activeLightbox=null}addReply(e,t,o=[]){e.replies||(e.replies=[]);let i={id:Date.now(),text:t,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:o};return e.replies.push(i),this._syncStorage(),this.options.onReplyAdded?.(this._serializeComment(e),this._serializeReply(i)),i}_serializeReply({id:e,text:t,author:o,timestamp:i,screenshots:s}){return{id:e,text:t,author:o,timestamp:i,screenshots:s||[]}}_serializeComment(e){return{id:e.id,text:e.text,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(!M.includes(t))return!1;let o=this.comments.find(s=>s.id===e);if(!o)return!1;if(o.status===t)return!0;o.status=t,o.resolvedAt=t==="resolved"?new Date().toISOString():null;let i=this.shadowRoot?.querySelector(`[data-comment-id="${e}"]`);return i&&this.updateCommentPosition(o,i),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this.options.onCommentStatusChanged?.(this._serializeComment(o)),!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&&!y.includes(t))return!1;let o=this.comments.find(i=>i.id===e);return o?(o.type=t,this._commitUpdate(o)):!1}setCommentPriority(e,t){if(t!==null&&!S.includes(t))return!1;let o=this.comments.find(i=>i.id===e);return o?(o.priority=t,this._commitUpdate(o)):!1}setCommentTags(e,t){if(!Array.isArray(t))return!1;let o=this.comments.find(i=>i.id===e);return o?(o.tags=Ot(t),this._commitUpdate(o)):!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"&&oe(ne(F().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,o=0,i=0;if(!Array.isArray(e))return{anchored:t,orphaned:o,inactive:i};for(let s of e){if(!s||s.id==null||typeof s.text!="string"){console.warn("HellDots: skipping malformed serialized comment",s);continue}this._removeComment(s.id);let a={id:s.id,text:s.text,anchor:s.anchor||null,anchorState:"orphaned",target:null,hidden:!1,page:s.page||location.pathname,container:null,relativeX:0,relativeY:0,replies:Array.isArray(s.replies)?[...s.replies]:[],author:s.author||this.strings.anonymous,createdAt:s.createdAt||new Date().toISOString(),screenshots:Array.isArray(s.screenshots)?[...s.screenshots]:[],status:s.status==="closed"?"resolved":M.includes(s.status)?s.status:"open",type:y.includes(s.type)?s.type:null,priority:S.includes(s.priority)?s.priority:null,tags:Array.isArray(s.tags)?[...s.tags]:[],resolvedAt:s.resolvedAt||null,context:s.context||null,contextScreenshot:s.contextScreenshot||null};if(s.page&&s.page!==location.pathname){a.anchorState="inactive",this.comments.push(a),i++;continue}let l=s.anchor?ye(s.anchor):null;l?(a.container=l.element,a.relativeX=s.anchor.relativeX,a.relativeY=s.anchor.relativeY,a.anchorState="anchored",this.comments.push(a),this.renderCommentCircle(a),t++):(this.comments.push(a),o++,this.options.onAnchorLost?.(this._serializeComment(a)))}return{anchored:t,orphaned:o,inactive:i}}centerPopover(e){let t=e.getBoundingClientRect(),o=Math.max(10,(window.innerWidth-(t.width||400))/2),i=Math.max(10,(window.innerHeight-t.height)/2);e.style.left=`${o}px`,e.style.top=`${i}px`}positionPopoverAtCircle(e,t){let o=t.getBoundingClientRect(),i=o.left+o.width/2,s=o.top+o.height/2,a=28,l=a/2+10,c=i+l,p=s-a/2;c+400>window.innerWidth&&(c=i-l-400),c=Math.max(10,c);let h=e.getBoundingClientRect();p+h.height>window.innerHeight&&(p=window.innerHeight-h.height-10),p=Math.max(10,p),e.style.left=`${c}px`,e.style.top=`${p}px`}createPreviewCircle(e,t){this.removePreviewCircle();let o=document.createElement("div");o.className=`${n.CIRCLE} ${n.PREVIEW_CIRCLE}`,o.style.position="absolute";let i=14;o.style.left=`${e+i}px`,o.style.top=`${t+i}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){if(this.resizeObservers&&this.resizeObservers.has(e)){let{circle:t,observer:o}=this.resizeObservers.get(e);o&&o.disconnect(),t&&t.parentNode&&t.parentNode.removeChild(t),this.resizeObservers.delete(e)}}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let o=e.container.getBoundingClientRect(),i=o.width,s=o.height;if(i<=0||s<=0)return null;let a=e.relativeX*i,l=e.relativeY*s,c=28,p=Math.max(0,Math.min(a,i-c)),h=Math.max(0,Math.min(l,s-c)),m=p/i,u=h/s;return{absoluteX:p,absoluteY:h,relativeX:m,relativeY:u,containerWidth:i,containerHeight:s,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 s=document.elementsFromPoint(t,o).find(c=>c.tagName.toLowerCase()!==A.toLowerCase());if(!s)return!1;let a=e.target?.isConnected?e.target:null;if(a&&(a.contains(s)||s.contains(a)))return!1;let l=e.container;if(!l?.isConnected)return!1;if(!l.contains(s)&&!s.contains(l))return!0;if(l.contains(s)&&s!==l){for(let c=s;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}_dismissMarkerUi(e){this.shadowRoot.querySelector(`.${n.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 o=this.validateAndCalculatePosition(e,t);o&&!this._isAnchorTargetVisible(e)&&(o=null);let i=e.hidden===!0;if(!o){t&&e.container&&(e.hidden=!0,t.style.display="none",this._dismissMarkerUi(e),!i&&this.inboxView?.isOpen()&&this.inboxView.refresh());return}let s=14,a=o.containerLeft+o.absoluteX+s,l=o.containerTop+o.absoluteY+s;if(this._isMarkerOccluded(e,a,l)){e.hidden=!0,t.style.display="none",this._dismissMarkerUi(e),!i&&this.inboxView?.isOpen()&&this.inboxView.refresh();return}e.hidden=!1,t.style.display="",i&&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=o.relativeX,e.relativeY=o.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.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 o=e.container.getBoundingClientRect(),i=t.getBoundingClientRect(),s=e.relativeX*o.width,a=e.relativeY*o.height;console.log("Position Debug:",{commentId:e.id,relativePosition:{x:e.relativeX,y:e.relativeY},containerRect:{left:o.left,top:o.top,width:o.width,height:o.height},circlePosition:{left:i.left,top:i.top,centerX:i.left+i.width/2,centerY:i.top+i.height/2},expectedPosition:{x:s,y:a},offset:{x:i.left+i.width/2-(o.left+s),y:i.top+i.height/2-(o.top+a)}})}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let o=new ResizeObserver(i=>{if(this.positionValidationEnabled)for(let s of i)s.target===e.container&&this.updateCommentPosition(e,t)});o.observe(e.container),this.resizeObservers.set(e.id,{circle:t,observer:o,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(){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(n.COMMENT_CURSOR),document.getElementById(T.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(T.STYLES);e&&e.remove();let t=document.createElement("style");t.id=T.STYLES,t.textContent=ue(),this.shadowRoot.appendChild(t);let o=document.getElementById(T.GLOBAL_STYLES);o&&o.remove();let i=document.createElement("style");i.id=T.GLOBAL_STYLES,i.textContent=me(),document.head.appendChild(i)}},Me=ie;function yt(r={}){let{autoInit:e=!0,...t}=r,o=()=>new Me(t);return e?o():o}var fo=yt;export{Me as CommentOverlay,yt as createCommentOverlay,fo as default};
|
|
7
|
+
`,t},J=(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},Lt=(o,e=L,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=Q(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="×",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=Ue(o,e,{includeStatus:!0});c&&n.appendChild(c);let d=Ve(o);d.length>0&&n.appendChild(J(d,e));let p=o.replies?.length||0;if(p>0){let h=document.createElement("div");h.className=i.TOOLTIP_REPLY_COUNT,h.textContent=p===1?e.replyCountOne:v(e.replyCountTemplate,p),n.appendChild(h)}return n},ee=(o,e=L,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=Q(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 h=$e({label:e.replyOptions,items:c});h.classList.add(i.THREAD_REPLY_ACTIONS),l.appendChild(h)}let d;r?d=z({value:r.draft,strings:e,onInput:r.onInput,onSave:r.onSave,onCancel:r.onCancel}):(d=document.createElement("div"),d.className=i.THREAD_BODY,d.textContent=o.text),a.appendChild(l),a.appendChild(d);let p=Ve(o);return p.length>0&&a.appendChild(J(p,e)),a},Bt=(o,e=L,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=Q(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="×",a.appendChild(l),a.appendChild(c);let d=document.createElement("div");d.className=i.THREAD_BODY,d.textContent=o.text;let p=document.createElement("div");p.className=i.THREAD_REPLIES,o.replies&&o.replies.forEach(g=>{p.appendChild(ee(g,e,t,{onDelete:n,onEdit:s}))});let{container:h}=be({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(d);let u=Ve(o);return u.length>0&&m.appendChild(J(u,e)),m.appendChild(p),r.appendChild(m),r.appendChild(h),r};var Ce=(o,{strings:e,onShowLightbox:t,collapsible:n=!1,expanded:s=!1,onToggle:r})=>{let{context:a,contextScreenshot:l}=o;if(!a&&!l)return null;let c=document.createElement("div");c.className=i.CONTEXT_BLOCK;let d=document.createElement("div");if(d.className=i.CONTEXT_BODY,n){let p=document.createElement("button");p.type="button",p.className=i.CONTEXT_TOGGLE,p.setAttribute("aria-expanded",String(s)),p.innerHTML=`<span>${e.contextSection}</span>${_e}`,d.style.display=s?"":"none",p.addEventListener("click",h=>{h.stopPropagation();let m=p.getAttribute("aria-expanded")==="true";p.setAttribute("aria-expanded",String(!m)),d.style.display=m?"none":"",r?.(!m)}),c.appendChild(p)}else{let p=document.createElement("div");p.className=i.CONTEXT_TITLE,p.textContent=e.contextSection,c.appendChild(p)}if(l){let p=document.createElement("div");p.className=i.CONTEXT_SCREENSHOT_CAPTION,p.textContent=e.autoScreenshotLabel,d.appendChild(p);let h=document.createElement("img");h.className=i.SCREENSHOT_IMG,h.src=l,h.alt=e.autoScreenshotLabel,d.appendChild(h),R(d,t)}if(a){let p=(u,g)=>{if(!g)return;let E=document.createElement("div");E.className=i.CONTEXT_ROW;let _=document.createElement("span");_.textContent=u;let C=document.createElement("span");C.textContent=g,E.appendChild(_),E.appendChild(C),d.appendChild(E)},h=u=>u?`${u.width}\xD7${u.height}`:"",m=u=>u?.name?`${u.name} ${u.version||""}`.trim():"";p(e.contextUrl,a.url),p(e.contextViewport,h(a.viewport)),p(e.contextScreen,h(a.screen)),p(e.contextBrowser,m(a.browser)),p(e.contextOs,m(a.os))}return c.appendChild(d),c};var wi=o=>{let e=[...o.attributes].map(({name:t,value:n})=>`${t}="${n}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},Li=o=>{if(!o?.tagName)return"(unknown)";let e=Object.entries(o.attributes||{}).map(([t,n])=>`${t}="${n}"`).join(" ");return`<${o.tagName.toLowerCase()}${e?` ${e}`:""}>`},Bi=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?wi(a):Li(r),d=a?Bi(a):"(unavailable)",p=o.context?.viewport,h=p?.width??e,m=p?.height??t,u=[`Page: ${o.page}`,`Viewport: ${h}x${m}`,`Anchor state: ${l}`,`Status: ${o.status||"open"}`,`Selector: ${s?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${d}`,`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 _=le(new Date(o.resolvedAt).getTime()-new Date(o.createdAt).getTime(),n);_&&u.push(`Resolution time: ${_}`)}let E=o.replies||[];if(E.length>0){u.push(`Replies (${E.length}):`);for(let _ of E)u.push(`- ${_.author}: "${_.text}"`)}return u.join(`
|
|
8
|
+
`)}var te=(o,e)=>{let t=e.getBoundingClientRect(),n=t.left+t.width/2,s=t.top+t.height/2,r=A,a=r/2+10,l=o.getBoundingClientRect(),c=l.width||400,d=n+a;d+c>window.innerWidth&&(d=n-a-c),d=Math.min(d,window.innerWidth-c-10),d=Math.max(10,d),o.style.left=`${d}px`;let p=10,h=s-r/2,m=window.innerHeight-p-h;l.height>m?(o.style.top="auto",o.style.bottom=`${p}px`):(o.style.bottom="auto",o.style.top=`${Math.max(p,h)}px`)},Mt=o=>{let e=o.getBoundingClientRect(),t=Math.max(10,(window.innerWidth-(e.width||400))/2),n=Math.max(10,(window.innerHeight-e.height)/2);o.style.left=`${t}px`,o.style.bottom="auto",o.style.top=`${n}px`},xe=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(`.${i.THREAD_SCROLL} > .${i.THREAD_BODY}, .${i.THREAD_SCROLL} > .${i.EDITOR}`):t.querySelector(`.${i.THREAD_REPLY}[data-reply-id="${P(e)}"]`)?.querySelector(`.${i.THREAD_BODY}, .${i.EDITOR}`)||null:null}refreshCommentViews(e,t=null){if(this.active?.dataset.for!==String(e))return;let n=this.deps.findComment(e);if(!n)return;let s=t==null?n:(n.replies||[]).find(l=>O(l.id,t));if(!s)return;let r=document.createElement("div");r.className=i.THREAD_BODY,r.textContent=s.text,this._bodyEl(t)?.replaceWith(r);let a=t==null?this.active.querySelector(`.${i.THREAD_META}`):this.active.querySelector(`.${i.THREAD_REPLY}[data-reply-id="${P(t)}"]`)?.querySelector(`.${i.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${i.THREAD_EDITED}`)){let l=He(s.editedAt,this.deps.strings,this.deps.locale),c=a.querySelector(`.${i.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:n}=this.editing,s=this.deps.findComment(e),r=t==null?s:(s?.replies||[]).find(a=>O(a.id,t));return n.trim()!==String(r?.text||"").trim()}async releaseEditor(){if(!this.editing)return!0;if(this.editorDirty()){let t=this.deps.shadowRoot;if(!await Ee(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 n=e==null?t:(t.replies||[]).find(r=>O(r.id,e));if(!n)return;let s=document.createElement("div");s.className=i.THREAD_BODY,s.textContent=n.text,this._bodyEl(e)?.replaceWith(s)}async startEditing(e,t=null){if(!await this.releaseEditor())return;let n=this.deps.findComment(e),s=t==null?n:(n?.replies||[]).find(a=>O(a.id,t));if(!s)return;this.editing={commentId:e,replyId:t,draft:s.text};let r=z({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(r)}show(e,t){this.close();let{strings:n,locale:s}=this.deps;this.deps.removeTooltip(t.id),e?.classList.add(i.CIRCLE_ACTIVE),this._activeCircle=e||null;let r=(f,x)=>{this.deps.actions.deleteReply(t.id,f.id)&&(x.remove(),this.deps.refreshInbox())},a=f=>this.startEditing(t.id,f.id),l=Bt(t,n,s,{onDeleteReply:r,onEditReply:a});this.deps.shadowRoot.appendChild(l);let c=l.querySelector(`.${i.THREAD_HEADER}`),d=fe(t,{strings:n,onCopy:f=>U(Te(f,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:n})),onCopyLink:f=>U($(f,this.deps.linkParam())),onEdit:f=>this.startEditing(f.id),onSetStatus:(f,x)=>this.deps.actions.setStatus(f.id,x),onSetType:(f,x)=>this.deps.actions.setType(f.id,x),onSetPriority:(f,x)=>this.deps.actions.setPriority(f.id,x),onDelete:f=>{this.close(),this.deps.actions.deleteComment(f.id),this.deps.refreshInbox()}}),p=document.createElement("div");p.className=i.THREAD_ACTIONS_ROW,p.appendChild(d),c.insertAdjacentElement("afterend",p);let h=l.querySelector(`.${i.THREAD_SCROLL} > .${i.SCREENSHOTS_CONTAINER}`);h&&R(h,f=>this.deps.onShowLightbox(f));let m=Ce(t,{strings:n,onShowLightbox:f=>this.deps.onShowLightbox(f),collapsible:!0});m&&l.querySelector(`.${i.THREAD_REPLIES}`).before(m),setTimeout(()=>{e?te(l,e):Mt(l)},10),l.querySelector(`.${i.CLOSE_TOOLTIP}`).addEventListener("click",async f=>{f.stopPropagation(),!(this.editing&&!await this.releaseEditor())&&this.close()});let u=l.querySelector(`.${i.THREAD_INPUT}`),g=l.querySelector(`.${i.THREAD_SUBMIT}`),E=l.querySelector(`.${i.THREAD_INPUT_AREA} .${i.ATTACH_IMAGE_BTN}`),_=l.querySelector(`.${i.THREAD_INPUT_AREA} input[type="file"]`),C=l.querySelector(`.${i.THREAD_INPUT_AREA} .${i.SCREENSHOTS_CONTAINER}`),y=[],b=()=>{G(C,y,{strings:n,onShow:f=>this.deps.onShowLightbox(f),rerender:()=>b()})};E.addEventListener("click",()=>{_.click()}),Y(_,()=>y,b);let B=()=>{let f=u.value.trim();if(!f&&y.length===0)return;let x=this.deps.actions.addReply(t,f,y.length>0?[...y]:[]),Ye=l.querySelector(`.${i.THREAD_REPLIES}`),je=ee(x,n,s,{onDelete:r,onEdit:a});Ye.appendChild(je),R(je,$t=>this.deps.onShowLightbox($t));let Se=l.querySelector(`.${i.THREAD_SCROLL}`);Se&&(Se.scrollTop=Se.scrollHeight),u.value="",y=[],b(),u.focus()};g.addEventListener("click",B),u.addEventListener("keydown",f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),B())}),this.active=l,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(l)),setTimeout(()=>u.focus(),50),this._armClickTimer=setTimeout(()=>{this._armClickTimer=null,this._clickHandler=f=>{let x=f.composedPath()[0]||f.target;if(!l.contains(x)&&!e?.contains(x)&&!this.deps.isInsideLightbox(x)){if(this.editorDirty())return;this.close()}},document.addEventListener("mousedown",this._clickHandler)},0)}close(){this.deps.shadowRoot?.querySelectorAll(`.${i.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(i.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?te(e,this._activeCircle):Mt(e))}syncToMarker(){let e=this.active,t=this._activeCircle;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="",te(e,t)}};var Dt=150,ze=(o,e)=>Math.max(0,Math.min(o,e)),Oe=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=wt(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 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=ze(a,s),d=ze(l,r),p=c/s,h=d/r;return{absoluteX:c,absoluteY:d,relativeX:p,relativeY:h,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()!==I.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}_computeMarkerState(e,t,{checkOcclusion:n=!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 r=A/2,a=s.containerLeft+s.absoluteX+r,l=s.containerTop+s.absoluteY+r;return n&&(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,n){if(n.kind==="resolved")return t&&(t.style.display="none"),!1;if(n.kind==="noop")return!1;let s=e.hidden===!0;return n.kind==="hidden"?(e.hidden=!0,t.style.display="none",this.deps.onMarkerHidden(e),!s):(e.hidden=!1,t.style.display="",t.style.left=`${n.viewportX}px`,t.style.top=`${n.viewportY}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=n.relativeX,e.relativeY=n.relativeY,s)}updatePosition(e,t=this.circles.get(String(e.id))){if(!t)return;let n=this._computeMarkerState(e,t);this._applyMarkerState(e,t,n)&&this.deps.onVisibilityFlip()}_updateAllPositions(){let e=Date.now(),t=e-this._lastOcclusionPass>=Dt;t?this._lastOcclusionPass=e:this._armOcclusionTrailingPass();let n=[];for(let r of this.deps.getComments()){let a=this.circles.get(String(r.id));a&&n.push([r,a,this._computeMarkerState(r,a,{checkOcclusion:t})])}let s=!1;for(let[r,a,l]of n)this._applyMarkerState(r,a,l)&&(s=!0);s&&this.deps.onVisibilityFlip()}_armOcclusionTrailingPass(){this._occlusionTrailingTimer&&clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=setTimeout(()=>{this._occlusionTrailingTimer=null,this.scheduleUpdate()},Dt)}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 n=new ResizeObserver(s=>{if(this.enabled)for(let r of s)r.target===e.container&&this.updatePosition(e,t)});n.observe(e.container),this.resizeObservers.set(String(e.id),{circle:t,observer:n,container:e.container})}cleanupResizeObserver(e){let t=String(e);if(this.resizeObservers.has(t)){let{circle:n,observer:s}=this.resizeObservers.get(t);s&&s.disconnect(),n&&n.parentNode&&n.parentNode.removeChild(n),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 n=t.getBoundingClientRect();if(n.height<=0)return null;let s=ze(e.relativeY*n.height,n.height);return n.top+s+A/2}destroy(){this._pendingRaf&&(cancelAnimationFrame(this._pendingRaf),this._pendingRaf=null),this._occlusionTrailingTimer&&(clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollHandler&&(window.removeEventListener("scroll",this._scrollHandler,{capture:!0}),this._scrollHandler=null),this._loadHandler&&(window.removeEventListener("load",this._loadHandler),this._loadHandler=null),this._globalMutationObserver&&(this._globalMutationObserver.disconnect(),this._globalMutationObserver=null),this.clear()}};var Mi='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',Di='<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>',ki='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',ye=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.contextExpanded=!0,this.editing=null,this.notice=null,this._cardBindings=new Map,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=i.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(n=>O(n.id,this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(n=>O(n.id,this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await Ee(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 z({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(Rt(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();let e=this.filteredComments(),t=this.detailId!=null?e.find(n=>O(n.id,this.detailId)):null;this._setActiveMarker(t),t?(this._cardBindings.clear(),this.el.innerHTML="",this._renderDetail(t,e)):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(n=>O(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="×",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_renderList(e){let t=[...this.el.children].find(s=>s.classList.contains(i.INBOX_LIST));if(!t){this.el.innerHTML="",this._cardBindings.clear();let s=document.createElement("div");s.className=i.INBOX_HEADER,this.el.appendChild(s),t=document.createElement("div"),t.className=i.INBOX_LIST,this.el.appendChild(t)}[...this.el.children].find(s=>s.classList.contains(i.INBOX_HEADER)).replaceChildren(this._buildFilter(),this._closeButton()),this._reconcileCards(t,e)}_cardFingerprint(e){return JSON.stringify([e.text,e.editedAt??null,e.status??"open",e.type??null,e.priority??null,e.tags??[],e.resolvedAt??null,e.anchorState,e.hidden===!0,e.page,e.screenshots?.length??0])}_reconcileCards(e,t){for(let r of[...e.children])(r.classList.contains(i.INBOX_NOTICE)||r.classList.contains(i.INBOX_EMPTY))&&r.remove();let n=[];if(this.notice){let r=document.createElement("div");r.className=i.INBOX_NOTICE,r.setAttribute("role","status"),r.textContent=this.notice,n.push(r)}let s=new Set;if(t.length===0)n.push(this._buildEmptyState());else for(let r of t){let a=String(r.id),l=this._cardFingerprint(r),c=this._cardBindings.get(a),d;c&&c.comment===r&&c.fingerprint===l?d=c.card:(d=this._buildCard(r,{interactive:!0}),this._cardBindings.set(a,{comment:r,fingerprint:l,card:d})),s.add(a),n.push(d)}for(let r of[...this._cardBindings.keys()])s.has(r)||this._cardBindings.delete(r);for(n.forEach((r,a)=>{e.children[a]!==r&&e.insertBefore(r,e.children[a]??null)});e.children.length>n.length;)e.lastElementChild.remove()}_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 p=document.createElement("button");return p.type="button",p.className=i.INBOX_EMPTY_ACTION,p.textContent=this.strings.filterClear,p.addEventListener("click",()=>{this._resetFilters()}),e.appendChild(p),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=Fe(this.options,this.strings),r.appendChild(document.createTextNode(a??"")),r.appendChild(c),r.appendChild(document.createTextNode(l??"")),e.appendChild(r);let d=document.createElement("button");return d.type="button",d.className=i.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(V(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(D(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(k(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 d=document.createElement("div");d.className=i.INBOX_FILTER_SECTION,d.textContent=e,c.appendChild(d);let p=document.createElement("div");p.className=i.INBOX_FILTER_CHIPS,p.setAttribute("role",a?"group":"radiogroup"),p.setAttribute("aria-label",e);for(let h of n){let m=r===h,u=document.createElement("button");u.type="button",u.className=i.INBOX_FILTER_CHIP,u.dataset[t]=h,u.setAttribute("role",a?"switch":"radio"),u.setAttribute("aria-checked",String(m)),u.textContent=s(h),u.addEventListener("click",g=>{g.stopPropagation(),l(a&&m?"all":h),this.render()}),p.appendChild(u)}return c.appendChild(p),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>${_e}`;let n=document.createElement("div");n.className=i.INBOX_FILTER_MENU,n.setAttribute("role","group"),n.setAttribute("aria-label",this.strings.filterTitle),Z(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._resetFilters()}),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:[...M],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=>D(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),n.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...w],labelOf:l=>k(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(Q(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 d=document.createElement("div");d.className=i.INBOX_CARD_TEXT,d.textContent=e.text,n.appendChild(d)}if(e.screenshots?.length){let d=J(e.screenshots,this.strings);R(d,p=>this.callbacks.onShowLightbox(p)),n.appendChild(d)}let l=Ue(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 d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=i.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",h=>{h.stopPropagation(),d()}),n.appendChild(p),n.addEventListener("click",d),n.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),d())}),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 fe(e,{strings:this.strings,onCopy:t=>U(Te(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>U($(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!=null&&O(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=`${Mi}<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=(h,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=h;let E=t[u];return g.disabled=!E,E&&g.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(E)}),g};a.appendChild(l(Di,this.strings.prevComment,n-1)),a.appendChild(l(ki,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 d=Ce(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=document.createElement("div");p.className=i.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),u=ee(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});R(u,g=>this.callbacks.onShowLightbox(g)),p.appendChild(u)}c.appendChild(p),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:n,screenshotsContainer:s,attachBtn:r,fileInput:a,submitBtn:l}=be({areaClassName:i.THREAD_INPUT_AREA,inputTag:"input",inputClassName:i.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],d=()=>{G(s,c,{strings:this.strings,onShow:h=>this.callbacks.onShowLightbox(h),rerender:()=>d()})};r.addEventListener("click",()=>a.click()),Y(a,()=>c,d);let p=()=>{let h=n.value.trim();!h&&c.length===0||(this.callbacks.onReply(e,h,[...c]),c=[],this.render())};return l.addEventListener("click",p),n.addEventListener("keydown",h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),p())}),t}};var Pi=o=>{let e=new Set;for(let t of o){let n=String(t).trim().toLowerCase();n&&e.add(n)}return[...e]},kt=o=>o.filter(e=>typeof e=="string"),$i={"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"},Ge=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=Xe(),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||ct(),this.strings=dt(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=We(),this.toolbar=vt(this.options,this.strings),this.commentBox=It(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(T.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(T.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${i.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(T.ATTACH_IMAGE_INPUT),this._captureFlow=new re({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 xe({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,findComment:e=>this._findComment(e),removeTooltip:e=>this._tooltipEl(e)?.remove(),onShowLightbox:e=>this.showLightbox(e),isInsideLightbox:e=>this._isInsideLightbox(e),linkParam:()=>this._linkParam(),refreshInbox:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},actions:{addReply:(e,t,n)=>this.addReply(e,t,n),deleteReply:(e,t)=>this.deleteReply(e,t),editComment:(e,t)=>this.editComment(e,t),editReply:(e,t,n)=>this.editReply(e,t,n),setStatus:(e,t)=>this.setCommentStatus(e,t),setType:(e,t)=>this.setCommentType(e,t),setPriority:(e,t)=>this.setCommentPriority(e,t),deleteComment:e=>this.deleteComment(e)}}),this.markers=new Oe({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=Me(),this.loadComments(this._storedCache),this._storageHandler=e=>{(e.key===ce||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=Ct(this._linkParam()),t=null;try{t=sessionStorage.getItem(de),t!=null&&sessionStorage.removeItem(de)}catch{}return e??t}_linkParam(){return this.options.linkParam||pe}_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,n){let s=$i[e],r=this.options[s];if(typeof r=="function")try{r(...t)}catch(a){console.warn(`HellDots: ${s} handler threw`,a)}if(typeof this.options.onChange=="function")try{this.options.onChange({type:e,...n})}catch(a){console.warn("HellDots: onChange handler threw",a)}}commentLink(e){let t=this._findComment(e);return t?$(t,this._linkParam()):null}_readStoredCached(){return this._storedCache||(this._storedCache=Me()),this._storedCache}_syncStorage(){if(this.options.persistence!=="localStorage")return;let e=De(this._readStoredCached(),this.serializeComments(),location.pathname);he(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()}),Y(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(r=>r&&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(),n=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;n&&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?.(`.${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._captureFlow.beginDrag(e))}}async _placeCommentAtPoint(e,t){this._captureFlow.armClickCapture();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?.(tt.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,d=ft(r,l,c);d.targetSelector=s&&s!==r?gt(s):null,this.currentPosition={container:r,relativeX:l,relativeY:c,anchor:d,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}`);e&&G(e,this._pendingScreenshots||[],{strings:this.strings,onShow:t=>this.showLightbox(t),rerender:()=>this._updateScreenshotsPreview()})}_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=A/2,r=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),d=c.width||400,p=e+s,h=t+s,m=p+r,u=h-s;m+d>a&&(m=p-r-d),m=Math.min(m,a-d-10),m=Math.max(10,m),u+c.height>l&&(u=l-c.height-10),u=Math.max(10,u),this.commentBox.style.left=`${m}px`,this.commentBox.style.top=`${u}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._captureFlow?.clearPending(),this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(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()}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:ke(),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:rt(),contextScreenshot:e};this.comments.push(t),this._syncStorage();let n=this._serializeComment(t);this._emit("comment:created",[n],{comment:n}),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 n=this._tooltipEl(t.id);n&&!n.matches(":hover")&&n.remove()},250)}),e.addEventListener("click",n=>{if(n.stopPropagation(),this._tooltipEl(t.id)?.remove(),this.activeThreadPopover?.dataset.for===String(t.id)){this.closeThreadPopover();return}this.showThreadPopover(e,t)}),e.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),e.click())})}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${i.THREAD_POPOVER}[data-for="${P(t.id)}"]`)||this._tooltipEl(t.id))return;let s=Lt(t,this.strings,this.locale);this.shadowRoot.appendChild(s),R(s,r=>this.showLightbox(r)),setTimeout(()=>{te(s,e)},10),s.querySelector(`.${i.CLOSE_TOOLTIP}`).addEventListener("click",r=>{r.stopPropagation(),s.remove()}),s.addEventListener("mouseleave",()=>s.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new ye({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._popover.refreshCommentViews(e)},onEditReply:(e,t,n)=>{this.editReply(e,t,n)&&this._popover.refreshCommentViews(e)},onSetStatus:(e,t)=>this.setCommentStatus(e,t),onSetType:(e,t)=>this.setCommentType(e,t),onSetPriority:(e,t)=>this.setCommentPriority(e,t),onNavigateToPage:e=>{try{sessionStorage.setItem(de,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=i.LIGHTBOX,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",this.strings.screenshotPreview);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="×",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,this._lightboxKeydownHandler=r=>{r.key==="Tab"&&(r.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?.(`.${i.LIGHTBOX}`)}_findComment(e){return this.comments.find(t=>O(t.id,e))}_tooltipEl(e){return this.shadowRoot?.querySelector(`.${i.TOOLTIP}[data-for="${P(e)}"]`)??null}addReply(e,t,n=[]){let s=typeof e=="object"&&e!==null?e:this._findComment(e);if(!s)return null;s.replies||(s.replies=[]);let r={id:ke(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:n};s.replies.push(r),this._syncStorage();let a=this._serializeComment(s),l=this._serializeReply(r);return this._emit("reply:added",[a,l],{comment:a,reply:l}),r}deleteReply(e,t){let n=this._findComment(e),s=n?.replies?.findIndex(c=>O(c.id,t))??-1;if(s<0)return!1;let[r]=n.replies.splice(s,1);this._syncStorage();let a=this._serializeComment(n),l=this._serializeReply(r);return this._emit("reply:deleted",[a,l],{comment:a,reply:l}),!0}editComment(e,t){let n=this._findComment(e),s=String(t??"").trim();if(!n||!s||s===n.text)return!1;n.text=s,n.editedAt=new Date().toISOString(),this._circles.get(String(n.id))?.setAttribute("aria-label",`${this.strings.commentAriaLabelPrefix}${n.text}`),this._syncStorage();let r=this._serializeComment(n);return this._emit("comment:edited",[r],{comment:r}),!0}editReply(e,t,n){let s=this._findComment(e),r=s?.replies?.find(d=>O(d.id,t)),a=String(n??"").trim();if(!r||!a||a===r.text)return!1;r.text=a,r.editedAt=new Date().toISOString(),this._syncStorage();let l=this._serializeComment(s),c=this._serializeReply(r);return this._emit("reply:edited",[l,c],{comment:l,reply:c}),!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{schemaVersion:1,id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),author:e.author,createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!M.includes(t))return!1;let n=this._findComment(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._circles.get(String(n.id));s&&this.updateCommentPosition(n,s),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let r=this._serializeComment(n);return this._emit("comment:status-changed",[r],{comment:r}),!0}_commitUpdate(e){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let t=this._serializeComment(e);return this._emit("comment:updated",[t],{comment:t}),!0}setCommentType(e,t){if(t!==null&&!N.includes(t))return!1;let n=this._findComment(e);return n?(n.type=t,this._commitUpdate(n)):!1}setCommentPriority(e,t){if(t!==null&&!w.includes(t))return!1;let n=this._findComment(e);return n?(n.priority=t,this._commitUpdate(n)):!1}setCommentTags(e,t){if(!Array.isArray(t))return!1;let n=this._findComment(e);return n?(n.tags=Pi(t),this._commitUpdate(n)):!1}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){if(!this._findComment(e))return!1;if(this._removeComment(e),this.options.persistence==="localStorage"){let t=De(this._readStoredCached().filter(n=>!O(n.id,e)),this.serializeComments(),location.pathname);he(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=>!O(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))),n=this._readStoredCached().filter(s=>!t.has(String(s.id)));he(n),this._storedCache=n}this.inboxView?.isOpen()&&this.inboxView.refresh()}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.filter(c=>c&&typeof c=="object"&&c.id!=null&&typeof c.text=="string").map(c=>Array.isArray(c.screenshots)?{...c,screenshots:kt(c.screenshots)}:c):[],author:r.author||this.strings.anonymous,createdAt:r.createdAt||new Date().toISOString(),screenshots:Array.isArray(r.screenshots)?kt(r.screenshots):[],status:r.status==="closed"?"resolved":M.includes(r.status)?r.status:"open",type:N.includes(r.type)?r.type:null,priority:w.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?Be(r.anchor):null;if(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++;else{this.comments.push(a),n++;let c=this._serializeComment(a);this._emit("comment:anchor-lost",[c],{comment:c})}}return this._openPendingDetail(),{anchored:t,orphaned:n,inactive:s}}notifyNavigation(){let e=location.pathname,t=0,n=0,s=0;this.closeThreadPopover(),this.hideCommentBox(),this.inboxView&&(this.inboxView.currentPage=e);for(let r of this.comments){if(this.markers.remove(r.id),r.hidden=!1,r.target=null,r._occluded=!1,r.page&&r.page!==e){r.anchorState="inactive",r.container=null,s++;continue}let a=r.anchor?Be(r.anchor):null;if(a)r.container=a.element,r.relativeX=r.anchor.relativeX,r.relativeY=r.anchor.relativeY,r.anchorState="anchored",this.renderCommentCircle(r),t++;else{r.container=null,r.anchorState="orphaned",n++;let l=this._serializeComment(r);this._emit("comment:anchor-lost",[l],{comment:l})}}return this._pendingDetailId=this._readPendingDetailId(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this._openPendingDetail(),{anchored:t,orphaned:n,inactive:s}}scrollMarkerIntoView(e){this.markers.scrollMarkerIntoView(e)}createPreviewCircle(e,t){this.removePreviewCircle();let n=document.createElement("div");n.className=`${i.CIRCLE} ${i.PREVIEW_CIRCLE}`,n.style.position="absolute";let s=A/2;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){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,me(),Ot(),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(i.COMMENT_CURSOR),this._detachStyles(),document.querySelector(I)?.remove()}injectStyles(){this._detachStyles(),this._styleDetachers=[Re(this.shadowRoot,st(),T.STYLES),Re(document,at(),T.GLOBAL_STYLES)]}_detachStyles(){for(let e of this._styleDetachers??[])e();this._styleDetachers=[]}},Pt=Ge;function Hi(o={}){let{autoInit:e=!0,...t}=o,n=()=>new Pt(t);return e?n():n}var So=Hi;export{Pt as CommentOverlay,Hi as createCommentOverlay,So as default};
|
|
1019
9
|
//# sourceMappingURL=helldots.esm.js.map
|