helldots 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /*! HellDots — MIT. Bundles nanoid (MIT) © 2017 Andrey Sitnik <andrey@sitnik.es> — https://github.com/ai/nanoid */
2
- import{domToCanvas as Di}from"modern-screenshot";var P="helldots-root",Bi=()=>{customElements.get(P)||customElements.define(P,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function _t(){Bi();let i=document.querySelector(P);return i||(i=document.createElement(P),document.body.appendChild(i)),i.shadowRoot}var Ee=.5,Pi=.7,Tt=i=>!i||i==="transparent"||i==="rgba(0, 0, 0, 0)",xt=()=>{let i=getComputedStyle(document.documentElement).backgroundColor;if(!Tt(i))return i;let e=getComputedStyle(document.body).backgroundColor;return Tt(e)?"#ffffff":e},Ot=()=>{try{let i=document.implementation.createHTMLDocument(""),e=i.createElement("style");return i.head.appendChild(e),e.sheet!==null}catch{return!1}},ki=i=>{let e=[],t=i.indexOf("@font-face");for(;t!==-1;){let o=i.indexOf("{",t),s=o===-1?-1:i.indexOf("}",o);if(s===-1)break;e.push(i.slice(t,s+1)),t=i.indexOf("@font-face",s)}return e.join(`
3
- `)},Fe=new Map,$i=i=>(Fe.has(i)||Fe.set(i,fetch(i,{mode:"cors",credentials:"omit"}).then(e=>e.ok?e.text():"").then(ki).catch(()=>"")),Fe.get(i)),Hi=i=>{try{return!!i.cssRules}catch{return!1}},Xi=async i=>{let e=()=>{};if(!i||!Ot())return e;let t=Array.from(document.styleSheets).filter(r=>r.href&&!Hi(r)).map(r=>r.href);if(!t.length)return e;let o=(await Promise.all(t.map($i))).filter(Boolean).join(`
4
- `);if(!o)return e;let s=document.createElement("style");return s.textContent=o,document.head.appendChild(s),()=>s.remove()};async function Ge({scale:i=1,embedCrossOriginFonts:e=!1}={}){let t=await Xi(e);try{return await Di(document.documentElement,{scale:i,backgroundColor:xt(),...Ot()?{}:{font:!1},filter:o=>o.nodeName?.toLowerCase()!==P})}finally{t()}}var yt=(i,e,t)=>{i.fillStyle=xt(),i.fillRect(0,0,e,t)};function It(i,{left:e,top:t,width:o,height:s}){let r=document.createElement("canvas");r.width=o,r.height=s;let a=r.getContext("2d");return a?(yt(a,o,s),a.drawImage(i,e+window.scrollX,t+window.scrollY,o,s,0,0,o,s),r.toDataURL("image/png")):null}function ze(i,{sourceScale:e=1,outputScale:t=Ee,quality:o=Pi}={}){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?(yt(r,s.width,s.height),r.drawImage(i,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,s.width,s.height),s.toDataURL("image/jpeg",o)):null}var n={CIRCLE:"comment-circle",CIRCLE_ACTIVE:"comment-circle--active",TOOLTIP:"comment-tooltip",TOOLBAR_TEXT:"toolbar-text",SHORTCUT_HINT:"shortcut-hint",COMMENT_INPUT_AREA:"comment-input-area",CLOSE_TOOLTIP:"close-tooltip",ACTIVE:"active",COMMENT_CURSOR:"comment-cursor",COMMENT_OVERLAY:"comment-overlay",THREAD_POPOVER:"comment-thread-popover",THREAD_HEADER:"thread-header",THREAD_BODY:"thread-body",THREAD_REPLIES:"thread-replies",THREAD_REPLY:"thread-reply",THREAD_REPLY_ACTIONS:"thread-reply-actions",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_ACTIONS_ROW:"thread-actions-row",THREAD_SCROLL:"thread-scroll",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",INBOX_HEADER_ACTIONS:"inbox-header-actions",INBOX_METRICS_BTN:"inbox-metrics-btn",METRICS_VIEW:"metrics-view",METRICS_TILES:"metrics-tiles",METRICS_TILE:"metrics-tile",METRICS_TILE_VALUE:"metrics-tile-value",METRICS_TILE_LABEL:"metrics-tile-label",METRICS_GROUP:"metrics-group",METRICS_HEADING:"metrics-heading",METRICS_ROW:"metrics-row",METRICS_ROW_LABEL:"metrics-row-label",METRICS_TRACK:"metrics-track",METRICS_BAR:"metrics-bar",METRICS_ROW_COUNT:"metrics-row-count",METRICS_CHART:"metrics-chart",METRICS_AXIS:"metrics-axis",METRICS_EXPORTS:"metrics-exports",METRICS_EXPORT_BTN:"metrics-export-btn",METRICS_EMPTY:"metrics-empty",AUDIT_BLOCK:"audit-block",AUDIT_TOGGLE:"audit-toggle",AUDIT_BODY:"audit-body",AUDIT_LIST:"audit-list",AUDIT_ROW:"audit-row",AUDIT_ACTION:"audit-action",AUDIT_ACTOR:"audit-actor",AUDIT_TIME:"audit-time",AUDIT_HEADING:"audit-heading",AUDIT_RESOLUTIONS:"audit-resolutions",THREAD_TIME:"thread-time",THREAD_EDITED:"thread-edited",EDITOR:"helldots-editor",EDITOR_INPUT:"helldots-editor-input",EDITOR_ACTIONS:"helldots-editor-actions",EDITOR_SAVE:"helldots-editor-save",EDITOR_CANCEL:"helldots-editor-cancel",INBOX_NOTICE:"inbox-notice",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",CONFIRM:"helldots-confirm",CONFIRM_PANEL:"helldots-confirm-panel",CONFIRM_TITLE:"helldots-confirm-title",CONFIRM_MESSAGE:"helldots-confirm-message",CONFIRM_ACTIONS:"helldots-confirm-actions",CONFIRM_CANCEL:"helldots-confirm-cancel",CONFIRM_ACCEPT:"helldots-confirm-accept",LIGHTBOX:"helldots-lightbox",LIGHTBOX_IMG:"helldots-lightbox-img",LIGHTBOX_CLOSE:"helldots-lightbox-close",COMMENT_ACTIONS_BAR:"comment-actions-bar",ATTACH_IMAGE_BTN:"attach-image-btn",TOOLBAR_ACTIONS:"toolbar-actions",TOOLBAR_ACTION_BTN:"toolbar-action-btn",TOOLBAR_ACTION_WRAPPER:"toolbar-action-wrapper",TOOLBAR_ACTION_TOOLTIP:"toolbar-action-tooltip",TOOLBAR_COMMENT_BTN:"toolbar-comment-btn",TOOLBAR_MENU_BTN:"toolbar-menu-btn",INBOX_PANEL:"inbox-panel",INBOX_HEADER:"inbox-header",INBOX_FILTER:"inbox-filter",INBOX_FILTER_MENU:"inbox-filter-menu",INBOX_FILTER_MENU_HEADER:"inbox-filter-menu-header",INBOX_FILTER_CLEAR:"inbox-filter-clear",INBOX_FILTER_GROUP:"inbox-filter-group",INBOX_FILTER_CHIPS:"inbox-filter-chips",INBOX_FILTER_CHIP:"inbox-filter-chip",INBOX_FILTER_SECTION:"inbox-filter-section",INBOX_CLOSE:"inbox-close",INBOX_LIST:"inbox-list",INBOX_CARD:"inbox-card",INBOX_CARD_HEADER:"inbox-card-header",INBOX_CARD_ACTIONS:"inbox-card-actions",INBOX_CARD_TEXT:"inbox-card-text",INBOX_CARD_TAG:"inbox-card-tag",INBOX_CARD_REPLY_LINK:"inbox-card-reply-link",INBOX_ACTION_BTN:"inbox-action-btn",INBOX_ACTION_BTN_LABELED:"inbox-action-btn--labeled",INBOX_ACTION_LABEL:"inbox-action-label",INBOX_STATUS_DOT:"inbox-status-dot",INBOX_MENU:"inbox-menu",INBOX_MENU_UP:"inbox-menu--up",INBOX_MENU_START:"inbox-menu--start",INBOX_MENU_ITEM:"inbox-menu-item",INBOX_DETAIL:"inbox-detail",INBOX_DETAIL_HEADER:"inbox-detail-header",INBOX_BACK:"inbox-back",INBOX_NAV_BTN:"inbox-nav-btn",INBOX_REPLIES:"inbox-replies",TOOLTIP_REPLY_COUNT:"comment-tooltip-reply-count",INBOX_EMPTY:"inbox-empty",INBOX_EMPTY_ICON:"inbox-empty-icon",INBOX_EMPTY_TITLE:"inbox-empty-title",INBOX_EMPTY_TEXT:"inbox-empty-text",INBOX_EMPTY_KBD:"inbox-empty-kbd",INBOX_EMPTY_ACTION:"inbox-empty-action",CLASSIFY_ROW:"classify-row",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",BADGE_STATUS:"helldots-badge--status",BADGE_TYPE:"helldots-badge--type",BADGE_PRIORITY:"helldots-badge--priority",BADGE_TAG:"helldots-badge--tag",BADGE_DURATION:"helldots-badge--duration",CONTEXT_BLOCK:"inbox-context",CONTEXT_TITLE:"inbox-context-title",CONTEXT_BODY:"inbox-context-body",CONTEXT_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",CONTEXT_TOGGLE:"inbox-context-toggle",HIGHLIGHT:"helldots-highlight",REACTION_BAR:"reaction-bar",REACTION_PILL:"reaction-pill",REACTION_PILL_MINE:"reaction-pill--mine",REACTION_PILL_EMOJI:"reaction-pill-emoji",REACTION_PILL_COUNT:"reaction-pill-count",REACTION_ADD:"reaction-add",REACTION_TRIGGER:"reaction-trigger",REACTION_PALETTE:"reaction-palette",REACTION_PALETTE_ITEM:"reaction-palette-item",ACTIONS_GROUP:"actions-group",ACTIONS_GROUP_END:"actions-group--end"},At=[n.COMMENT_CURSOR],x={TOOLBAR:"comment-toolbar",COMMENT_BOX:"comment-box",COMMENT_INPUT:"comment-input",SUBMIT_COMMENT:"submit-comment",STYLES:"comment-overlay-styles",GLOBAL_STYLES:"comment-overlay-global-styles",ATTACH_IMAGE_INPUT:"attach-image-input"},D=28,Ce=5,S=["open","in_progress","in_review","resolved"],F={open:"#D1D1D6",in_progress:"#FF9F0A",in_review:"#2E90FA",resolved:"#30D158"},A=["bug","suggestion","question","improvement"],G={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},R=["high","medium","low"],z={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},le=["\u{1F44D}","\u{1F44E}","\u2764\uFE0F","\u{1F389}","\u{1F440}","\u{1F680}"],Rt={CONTAINER:'section, div[class*="container"], div[class*="content"]'},M={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},St='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 be=class{constructor({host:e,autoScreenshot:t,embedCrossOriginFonts:o=!1,onRegionCaptured:s,onPlace:r}){this.host=e,this.autoScreenshot=t,this.embedCrossOriginFonts=o,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,o=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,o)<5)return;this._isDragging=!0;let s=Math.min(this._dragStart.x,e.clientX),r=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.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),o=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 Ge({scale:1,embedCrossOriginFonts:this.embedCrossOriginFonts}),l=It(a,{left:t,top:o,width:s,height:r});l&&this.onRegionCaptured(l),this.autoScreenshot&&(this.pendingCapture=Promise.resolve(ze(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=Ge({scale:Ee,embedCrossOriginFonts:this.embedCrossOriginFonts}).then(e=>ze(e,{sourceScale:Ee})).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 Ui=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],Fi=[{name:"iOS",re:/(?:iPhone|iPad).*OS ([\d_]+) like Mac OS X/},{name:"Android",re:/Android ([\d.]+)/},{name:"Windows",re:/Windows NT ([\d.]+)/},{name:"macOS",re:/Mac OS X ([\d_.]+)/},{name:"Linux",re:/Linux/}],Gi={name:"unknown",version:""},zi=i=>/not[\W_]*a[\W_]*brand/i.test(i),vt=(i,e)=>{for(let{name:t,re:o}of i){let s=e.match(o);if(s)return{name:t,version:(s[1]||"").replace(/_/g,".")}}return{...Gi}};function Lt(i=window){let e=i.navigator||{},t=e.userAgent||"",o=e.userAgentData,s=vt(Ui,t),r=o?.brands?.find(l=>!zi(l.brand));r&&(s={name:r.brand,version:r.version||""});let a=vt(Fi,t);return o?.platform&&(a.name=o.platform),{version:1,url:i.location?.href||"",viewport:{width:i.innerWidth,height:i.innerHeight},screen:{width:i.screen?.width??0,height:i.screen?.height??0},devicePixelRatio:i.devicePixelRatio??1,userAgent:t,browser:s,os:a,language:e.language||""}}var _e=" scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;",Vi=(...i)=>i.map(e=>` ${e}::-webkit-scrollbar{width:8px;height:8px;}${e}::-webkit-scrollbar-track{background:transparent;}${e}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}${e}::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.35);}`).join(""),wt=()=>` :host{all:initial;display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;line-height:1.5;color-scheme:light;}:host *,:host *::before,:host *::after{box-sizing:border-box;font-family:inherit;}button{padding:0;font:inherit;color:inherit;}#${x.TOOLBAR}{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:${M.TOOLBAR};}.${n.TOOLBAR_ACTION_WRAPPER}{position:relative;}.${n.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;}.${n.TOOLBAR_ACTION_WRAPPER}:hover .${n.TOOLBAR_ACTION_TOOLTIP}{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}.${n.TOOLBAR_TEXT}{font-size:13px;font-weight:500;letter-spacing:-0.01em;}.${n.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;}.${n.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);}.${n.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;}.${n.TOOLBAR_ACTION_WRAPPER}:first-child .${n.TOOLBAR_ACTION_BTN}{border-radius:12px 0 0 12px;}.${n.TOOLBAR_ACTION_WRAPPER}:last-child .${n.TOOLBAR_ACTION_BTN}{border-radius:0 12px 12px 0;}.${n.TOOLBAR_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.TOOLBAR_COMMENT_BTN}.${n.ACTIVE}{color:#2E90FA;background:rgba(46,144,250,0.1);}#${x.COMMENT_BOX}{position:fixed;background:#1C1C1E;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.4);padding:16px;z-index:${M.COMMENT_BOX};width:min(400px,calc(100vw - 24px));display:none;box-sizing:border-box;}#${x.COMMENT_BOX} .${n.COMMENT_INPUT_AREA}{display:flex;flex-direction:column;gap:0;}.${n.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);}.${n.CLASSIFY_ROW} .${n.INBOX_ACTION_BTN}{height:26px;border:1px solid rgba(255,255,255,0.12);border-radius:8px;}.${n.CLASSIFY_ROW} .${n.INBOX_ACTION_BTN}:hover{border-color:rgba(255,255,255,0.28);}#${x.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;}#${x.COMMENT_INPUT}::placeholder{color:rgba(255,255,255,0.5);}#${x.COMMENT_INPUT}:focus{outline:none;box-shadow:none;}.${n.COMMENT_ACTIONS_BAR}{display:flex;align-items:center;justify-content:space-between;padding-top:12px;}.${n.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;}.${n.ATTACH_IMAGE_BTN}:hover{background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.8);}.${n.CIRCLE}{position:absolute;width:${D}px;height:${D}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:${M.CIRCLE};transform:translate(-50%,-50%);}.${n.CIRCLE}:hover{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);}.${n.CIRCLE}.${n.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);}.${n.CIRCLE}.${n.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);}.${n.TOOLTIP}{position:fixed;background:#1C1C1E;border-radius:12px;padding:16px;box-shadow:0 4px 20px rgba(0,0,0,0.4);width:min(400px,calc(100vw - 24px));max-height:calc(100vh - 20px);overflow-y:auto;overscroll-behavior:contain;${_e} z-index:${M.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${n.TOOLTIP} .${n.THREAD_BODY}{padding:8px 0;}.${n.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:${M.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${n.THREAD_POPOVER}>.${n.THREAD_HEADER},.${n.THREAD_POPOVER}>.${n.THREAD_ACTIONS_ROW},.${n.THREAD_POPOVER}>.${n.THREAD_INPUT_AREA}{flex:none;}.${n.THREAD_SCROLL}{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;${_e}}${Vi(`.${n.THREAD_SCROLL}`,`.${n.TOOLTIP}`,`.${n.INBOX_LIST}`,`.${n.INBOX_DETAIL}`,`.${n.EDITOR_INPUT}`)} .${n.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:${M.COMMENT_BOX};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;overflow:hidden;}@media (max-width:480px){.${n.INBOX_PANEL}{left:16px;width:auto;}}.${n.INBOX_HEADER},.${n.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;}.${n.INBOX_FILTER}-wrapper{position:relative;}.${n.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;}.${n.INBOX_FILTER}:hover{background:rgba(255,255,255,0.08);}.${n.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);}.${n.INBOX_FILTER_MENU_HEADER}{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:12px;}.${n.INBOX_FILTER_CLEAR}{background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:12px;font-weight:500;cursor:pointer;padding:0;}.${n.INBOX_FILTER_CLEAR}:hover:not(:disabled){color:white;}.${n.INBOX_FILTER_CLEAR}:disabled{opacity:0.35;cursor:default;}.${n.INBOX_FILTER_GROUP} + .${n.INBOX_FILTER_GROUP}{margin-top:14px;}.${n.INBOX_FILTER_SECTION}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);margin-bottom:8px;}.${n.INBOX_FILTER_CHIPS}{display:flex;flex-wrap:wrap;gap:6px;}.${n.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;}.${n.INBOX_FILTER_CHIP}:hover{border-color:rgba(255,255,255,0.4);color:white;}.${n.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;}.${n.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;}.${n.INBOX_MENU_ITEM}:hover{background:rgba(255,255,255,0.08);}.${n.INBOX_CLOSE},.${n.INBOX_NAV_BTN},.${n.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;}.${n.INBOX_CLOSE}{font-size:20px;line-height:1;}.${n.INBOX_CLOSE}:hover,.${n.INBOX_NAV_BTN}:not(:disabled):hover,.${n.INBOX_BACK}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.INBOX_NAV_BTN}:disabled{opacity:0.35;cursor:default;}.${n.INBOX_LIST},.${n.INBOX_DETAIL}{flex:1;overflow-y:auto;${_e} padding:12px;display:flex;flex-direction:column;gap:12px;}.${n.INBOX_CARD}{border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}.${n.INBOX_LIST} .${n.INBOX_CARD}{cursor:pointer;}.${n.INBOX_LIST} .${n.INBOX_CARD}:hover{border-color:rgba(255,255,255,0.22);}.${n.INBOX_CARD}--resolved{border-color:rgba(48,209,88,0.4);opacity:0.75;}.${n.INBOX_LIST} .${n.INBOX_CARD}--resolved:hover{border-color:rgba(48,209,88,0.7);opacity:1;}.${n.INBOX_CARD}--resolved:has([aria-expanded="true"]){opacity:1;}.${n.INBOX_CARD_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;}.${n.INBOX_CARD_ACTIONS}{display:flex;align-items:center;justify-content:space-between;width:100%;gap:8px;}.${n.INBOX_DETAIL_HEADER} .${n.INBOX_CARD_ACTIONS}{justify-content:flex-end;gap:2px;}.${n.ACTIONS_GROUP}{display:flex;align-items:center;flex-wrap:wrap;gap:5px;}.${n.ACTIONS_GROUP_END}{flex-wrap:nowrap;gap:2px;}.${n.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;}.${n.INBOX_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.INBOX_ACTION_BTN_LABELED}{width:auto;padding:0 8px 0 6px;gap:5px;justify-content:flex-start;flex:none;}.${n.INBOX_ACTION_LABEL}{font-size:11px;line-height:1;white-space:nowrap;}.${n.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;}.${n.INBOX_MENU_ITEM} .${n.INBOX_STATUS_DOT}{width:9px;height:9px;border:none;margin-right:8px;vertical-align:baseline;}.${n.INBOX_MENU_ITEM}[aria-checked="true"]{background:rgba(255,255,255,0.08);}.${n.THREAD_ACTIONS_ROW}{display:flex;justify-content:flex-end;}.${n.THREAD_POPOVER}>.${n.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;}.${n.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);}.${n.INBOX_MENU}.${n.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${n.INBOX_MENU}.${n.INBOX_MENU_START}{right:auto;left:0;}.${n.INBOX_CARD_TEXT}{white-space:pre-wrap;word-break:break-word;}.${n.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;}.${n.INBOX_BADGES}{display:flex;flex-wrap:wrap;gap:4px;}.${n.INBOX_CARD} .${n.INBOX_BADGES}{margin-top:6px;}.${n.TOOLTIP} .${n.INBOX_BADGES}{margin-bottom:4px;}.${n.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;}.${n.BADGE_STATUS},.${n.BADGE_TYPE},.${n.BADGE_PRIORITY}{font-weight:600;}.${n.BADGE_TAG}{opacity:0.75;}.${n.BADGE_DURATION}{opacity:0.75;border-style:dashed;}.${n.REACTION_BAR}{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:2px;margin-bottom:12px;}.${n.REACTION_BAR}[hidden]{display:none;}.${n.REACTION_TRIGGER}{position:relative;display:inline-flex;}.${n.REACTION_PILL}{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 8px;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#F2F2F7;font-family:inherit;font-size:12px;line-height:1;cursor:pointer;transition:background 0.12s ease,border-color 0.12s ease;}.${n.REACTION_PILL}:hover{background:rgba(255,255,255,0.08);}.${n.REACTION_PILL_MINE}{border-color:#2E90FA;background:rgba(46,144,250,0.16);}.${n.REACTION_PILL_MINE}:hover{background:rgba(46,144,250,0.24);}.${n.REACTION_PILL_EMOJI}{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:13px;}.${n.REACTION_PILL_COUNT}{font-variant-numeric:tabular-nums;}.${n.REACTION_ADD}{display:inline-flex;align-items:center;justify-content:center;width:28px;height:24px;padding:0;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#8E8E93;cursor:pointer;}.${n.REACTION_ADD}:hover{color:#F2F2F7;border-color:rgba(255,255,255,0.35);}.${n.REACTION_PALETTE}{position:absolute;top:calc(100% + 4px);left:0;white-space:nowrap;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:4px;z-index:1;box-shadow:0 4px 16px rgba(0,0,0,0.4);}.${n.ACTIONS_GROUP_END} .${n.REACTION_PALETTE},.${n.THREAD_REPLY_ACTIONS} .${n.REACTION_PALETTE}{left:auto;right:0;}.${n.REACTION_PALETTE}.${n.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${n.REACTION_PALETTE_ITEM}{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:6px;background:transparent;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:15px;cursor:pointer;}.${n.REACTION_PALETTE_ITEM}:hover{background:rgba(255,255,255,0.12);}.${n.CONTEXT_BLOCK}{display:flex;flex-direction:column;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.08);font-size:11px;}.${n.CONTEXT_BODY}{display:flex;flex-direction:column;gap:4px;}.${n.CONTEXT_TITLE}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);padding-bottom:4px;}.${n.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;}.${n.CONTEXT_TOGGLE}:hover{color:rgba(255,255,255,0.75);}.${n.CONTEXT_TOGGLE} svg{flex:none;transition:transform 0.15s ease;}.${n.CONTEXT_TOGGLE}[aria-expanded="true"] svg{transform:rotate(180deg);}.${n.CONTEXT_TOGGLE}[aria-expanded="true"] + .${n.CONTEXT_BODY}{padding-top:8px;}.${n.CONTEXT_BLOCK} img{width:100%;border-radius:6px;margin-bottom:6px;cursor:zoom-in;}.${n.CONTEXT_SCREENSHOT_CAPTION}{opacity:0.75;}.${n.CONTEXT_ROW}{display:flex;justify-content:space-between;gap:12px;opacity:0.75;}.${n.CONTEXT_ROW} span:last-child{text-align:right;word-break:break-all;}.${n.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;}.${n.INBOX_CARD_REPLY_LINK}:hover{color:white;}.${n.INBOX_REPLIES}{display:flex;flex-direction:column;gap:10px;padding:0 4px;}.${n.INBOX_REPLIES}:empty{display:none;}.${n.TOOLTIP_REPLY_COUNT}{font-size:12px;color:rgba(255,255,255,0.45);padding-top:4px;}.${n.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;}.${n.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;}.${n.INBOX_EMPTY_TITLE}{color:white;font-size:14px;font-weight:600;}.${n.INBOX_EMPTY_TEXT}{font-size:13px;line-height:1.5;max-width:30ch;}.${n.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;}.${n.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;}.${n.INBOX_EMPTY_ACTION}:hover{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.35);}.${n.THREAD_HEADER}{display:flex;justify-content:space-between;align-items:center;padding:0;}.${n.THREAD_META}{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}.${n.THREAD_AUTHOR}{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${n.THREAD_TIME}{font-size:12px;color:rgba(255,255,255,0.5);cursor:default;position:relative;flex:none;}.${n.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;}.${n.THREAD_TIME}:hover::after{opacity:1;}.${n.THREAD_BODY}{padding:8px 0;white-space:pre-wrap;word-break:break-word;}.${n.THREAD_REPLIES}{padding:0;}.${n.THREAD_REPLIES}:empty{display:none;}.${n.THREAD_REPLY}{padding:16px 0 0 0;border-top:1px solid rgba(255,255,255,0.1);white-space:pre-wrap;word-break:break-word;font-size:14px;color:rgba(255,255,255,0.85);}.${n.THREAD_REPLY} .${n.THREAD_META}{margin-bottom:2px;}.${n.THREAD_REPLY_ACTIONS}{margin-left:auto;flex:none;}.${n.THREAD_REPLY} .${n.SCREENSHOT_IMG}{width:144px;height:100px;object-fit:cover;border-radius:8px;margin-top:4px;cursor:pointer;display:block;}.${n.THREAD_INPUT_AREA}{display:flex;flex-direction:column;gap:0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,0.1);}.${n.THREAD_INPUT}{width:100%;background:transparent;border:none;padding:0;color:white;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;}.${n.THREAD_INPUT}::placeholder{color:rgba(255,255,255,0.5);}.${n.THREAD_INPUT}:focus{outline:none;box-shadow:none;}.${n.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;}.${n.THREAD_SUBMIT}:hover{background:rgba(46,144,250,0.15);color:#1570D6;}.${n.CLOSE_TOOLTIP}{background:none;border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.5);line-height:1;}.${n.CLOSE_TOOLTIP}:hover{color:white;}.${n.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);}}.${n.COMMENT_OVERLAY}{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;pointer-events:none;z-index:${M.TOOLBAR-1};}.${n.COMMENT_OVERLAY}.${n.ACTIVE}{pointer-events:auto;background:rgba(0,0,0,0.1);}.${n.SELECTION_RECT}{position:fixed;border:2px solid #2E90FA;background:rgba(46,144,250,0.1);pointer-events:none;z-index:${M.TOOLTIP};box-sizing:border-box;}.${n.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;}.${n.SCREENSHOTS_CONTAINER}::-webkit-scrollbar{display:none;}.${n.SCREENSHOTS_CONTAINER}.${n.ACTIVE}{display:flex;}.${n.SCREENSHOT_ITEM}{position:relative;flex-shrink:0;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}{width:50px;height:50px;object-fit:cover;border-radius:8px;cursor:pointer;display:block;margin:0;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}:hover{opacity:0.85;}.${n.SCREENSHOT_ITEM} .${n.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;}.${n.SCREENSHOT_ITEM}:hover .${n.SCREENSHOT_REMOVE}{display:flex;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_REMOVE}:hover{background:rgba(0,0,0,0.9);}.${n.TOOLTIP}>.${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},.${n.THREAD_SCROLL}>.${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},.${n.THREAD_REPLY} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}{width:144px;height:100px;}.${n.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;}.${n.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;}.${n.CONFIRM_TITLE}{margin:0 0 8px;font-size:15px;font-weight:600;}.${n.CONFIRM_MESSAGE}{margin:0 0 20px;font-size:13px;color:rgba(255,255,255,0.65);}.${n.CONFIRM_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${n.CONFIRM_CANCEL},.${n.CONFIRM_ACCEPT}{padding:7px 14px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}.${n.CONFIRM_CANCEL}:focus-visible,.${n.CONFIRM_ACCEPT}:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}.${n.CONFIRM_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${n.CONFIRM_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${n.CONFIRM_ACCEPT}{background:#FF453A;color:white;}.${n.CONFIRM_ACCEPT}:hover{background:#FF6961;}.${n.LIGHTBOX}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.92);z-index:${M.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;}}.${n.LIGHTBOX_IMG}{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:8px;}.${n.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;}.${n.LIGHTBOX_CLOSE}:hover{background:rgba(255,255,255,0.3);}.${n.EDITOR}{display:flex;flex-direction:column;gap:8px;margin:4px 0 2px;}.${n.EDITOR_INPUT}{width:100%;box-sizing:border-box;resize:vertical;min-height:60px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.14);border-radius:8px;padding:8px 10px;color:white;font-size:14px;font-family:inherit;line-height:1.45;outline:none;${_e}}.${n.EDITOR_INPUT}:focus{border-color:rgba(46,144,250,0.7);}.${n.EDITOR_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${n.EDITOR_CANCEL},.${n.EDITOR_SAVE}{padding:5px 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;}.${n.EDITOR_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${n.EDITOR_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${n.EDITOR_SAVE}{background:#2E90FA;color:white;}.${n.EDITOR_SAVE}:hover:not(:disabled){background:#57A6FB;}.${n.EDITOR_SAVE}:disabled{background:rgba(255,255,255,0.10);color:rgba(255,255,255,0.4);cursor:not-allowed;}.${n.THREAD_EDITED}{font-size:12px;color:rgba(255,255,255,0.4);cursor:default;position:relative;flex:none;}.${n.THREAD_EDITED}::before{content:"\xB7";margin-right:4px;}.${n.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;}.${n.THREAD_EDITED}:hover::after{opacity:1;}.${n.AUDIT_BLOCK}{margin-top:10px;border-top:1px solid rgba(255,255,255,0.08);padding-top:8px;}.${n.AUDIT_TOGGLE}{display:flex;align-items:center;gap:6px;width:100%;padding:4px 0;border:0;background:none;color:rgba(255,255,255,0.55);font-family:inherit;font-size:12px;text-align:left;cursor:pointer;}.${n.AUDIT_TOGGLE}:hover{color:rgba(255,255,255,0.85);}.${n.AUDIT_TOGGLE}::before{content:"";width:0;height:0;border-left:4px solid currentColor;border-top:4px solid transparent;border-bottom:4px solid transparent;transition:transform 0.15s ease;}.${n.AUDIT_TOGGLE}[aria-expanded="true"]::before{transform:rotate(90deg);}.${n.AUDIT_BODY}{padding:4px 0 2px;}.${n.AUDIT_LIST}{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:7px;}.${n.AUDIT_ROW}{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:8px;font-size:12px;line-height:1.4;}.${n.AUDIT_ACTION}{grid-column:1;color:rgba(255,255,255,0.78);}.${n.AUDIT_ACTOR}{grid-column:1;color:rgba(255,255,255,0.48);font-size:11px;}.${n.AUDIT_TIME}{grid-row:1;grid-column:2;color:rgba(255,255,255,0.42);font-size:11px;white-space:nowrap;}.${n.AUDIT_HEADING}{margin:0 0 6px;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${n.AUDIT_RESOLUTIONS}{margin-top:10px;padding-top:8px;border-top:1px solid rgba(255,255,255,0.06);}.${n.INBOX_HEADER_ACTIONS}{display:flex;align-items:center;gap:12px;}.${n.INBOX_METRICS_BTN}{padding:5px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.75);font-family:inherit;font-size:12px;white-space:nowrap;cursor:pointer;}.${n.INBOX_METRICS_BTN}:hover{background:rgba(255,255,255,0.11);color:#fff;}.${n.METRICS_VIEW}{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:16px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;}.${n.METRICS_VIEW}::-webkit-scrollbar{width:8px;}.${n.METRICS_VIEW}::-webkit-scrollbar-track{background:transparent;}.${n.METRICS_VIEW}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}.${n.METRICS_TILES}{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:8px;}.${n.METRICS_TILE}{display:flex;flex-direction:column;gap:2px;padding:10px;border-radius:9px;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.08);}.${n.METRICS_TILE_VALUE}{color:#fff;font-size:18px;font-weight:600;line-height:1.1;}.${n.METRICS_TILE_LABEL}{color:rgba(255,255,255,0.5);font-size:11px;line-height:1.3;}.${n.METRICS_GROUP}{display:flex;flex-direction:column;gap:7px;}.${n.METRICS_HEADING}{margin:0;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${n.METRICS_ROW}{display:grid;grid-template-columns:76px 1fr 26px;align-items:center;gap:8px;font-size:12px;}.${n.METRICS_ROW_LABEL}{color:rgba(255,255,255,0.72);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${n.METRICS_TRACK}{height:8px;border-radius:4px;background:rgba(255,255,255,0.07);overflow:hidden;}.${n.METRICS_BAR}{height:100%;border-radius:4px;background:rgba(255,255,255,0.42);min-width:2px;}.${n.METRICS_ROW_COUNT}{color:rgba(255,255,255,0.85);font-variant-numeric:tabular-nums;text-align:right;}.${n.METRICS_CHART}{width:100%;height:96px;display:block;fill:rgba(255,255,255,0.42);}.${n.METRICS_AXIS}{display:flex;justify-content:space-between;color:rgba(255,255,255,0.42);font-size:10px;font-variant-numeric:tabular-nums;}.${n.METRICS_EXPORTS}{display:flex;flex-wrap:wrap;gap:6px;padding-top:4px;border-top:1px solid rgba(255,255,255,0.08);}.${n.METRICS_EXPORT_BTN}{padding:6px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.78);font-family:inherit;font-size:12px;cursor:pointer;}.${n.METRICS_EXPORT_BTN}:hover{background:rgba(255,255,255,0.12);color:#fff;}.${n.METRICS_EMPTY}{margin:0;padding:24px 0;color:rgba(255,255,255,0.5);font-size:13px;text-align:center;}.${n.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;}`,Mt=()=>` .${n.COMMENT_CURSOR},.${n.COMMENT_CURSOR} *{cursor:url('${St}') ${Nt},auto !important;}`,Bt=()=>' .report{margin:0;padding:24px;background:#fff;color:#111;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:12px;line-height:1.45;}.report-title{margin:0 0 4px;font-size:20px;}.report-meta{margin:0 0 2px;color:#555;font-size:11px;}.report-table{width:100%;margin-top:18px;border-collapse:collapse;break-inside:avoid;}.report-table caption{margin-bottom:4px;font-size:12px;font-weight:600;text-align:left;}.report-table th,.report-table td{padding:5px 8px;border:1px solid #d5d5d5;text-align:left;font-weight:400;}.report-table thead th{background:#f2f2f2;font-weight:600;}.report-table td{text-align:right;font-variant-numeric:tabular-nums;}@page{margin:14mm;}';function ce(i,e,t){let o=Yi(e,i);if(o)return i.adoptedStyleSheets=[...i.adoptedStyleSheets??[],o],()=>{i.adoptedStyleSheets=(i.adoptedStyleSheets??[]).filter(a=>a!==o)};let s=i.head??i;s.querySelector?.(`#${t}`)?.remove();let r=document.createElement("style");return r.id=t,r.textContent=e,s.appendChild(r),()=>r.remove()}function Yi(i,e){let o=(e.defaultView??e.ownerDocument?.defaultView??globalThis).CSSStyleSheet;if(typeof o!="function"||!("adoptedStyleSheets"in e))return null;try{let s=new o;return s.replaceSync(i),s}catch{return null}}var H={metricsTitle:"Metrics",metricsOpen:"Metrics",metricsTotal:"Total comments",metricsAverageResolution:"Average resolution",metricsMedianResolution:"Median resolution",metricsReopened:"Reopened",metricsByStatus:"By status",metricsByType:"By type",metricsByPriority:"By priority",metricsOverTime:"Comments per day",metricsEmpty:"No comments to measure yet",metricsCategory:"Category",metricsCount:"Count",metricsDate:"Date",metricsExportComments:"Comments (CSV)",metricsExportMetrics:"Metrics (CSV)",metricsPrint:"Print / Save as PDF",metricsExportLabel:"Export",metricsGeneratedTemplate:"Generated {n}",metricsScope:"Scope",auditToggleTemplate:"History ({n})",auditTrailLabel:"Activity history",auditCreated:"Created the comment",auditEdited:"Edited the text",auditTagsChanged:"Updated the tags",auditPreviousResolutions:"Previous resolutions",auditResolvedInTemplate:"Resolved in {n}",commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"Shift",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusInReview:"In review",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",filterByType:"Type",filterByPriority:"Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS",reactionsLabel:"Reactions",addReaction:"Add reaction",reactionToggleOn:"Add your reaction",reactionToggleOff:"Remove your reaction",reactionPickerLabel:"Choose a reaction"};var Dt={metricsTitle:"M\xE9tricas",metricsOpen:"M\xE9tricas",metricsTotal:"Comentarios totales",metricsAverageResolution:"Resoluci\xF3n media",metricsMedianResolution:"Resoluci\xF3n mediana",metricsReopened:"Reabiertos",metricsByStatus:"Por estado",metricsByType:"Por tipo",metricsByPriority:"Por prioridad",metricsOverTime:"Comentarios por d\xEDa",metricsEmpty:"A\xFAn no hay comentarios que medir",metricsCategory:"Categor\xEDa",metricsCount:"Cantidad",metricsDate:"Fecha",metricsExportComments:"Comentarios (CSV)",metricsExportMetrics:"M\xE9tricas (CSV)",metricsPrint:"Imprimir / Guardar como PDF",metricsExportLabel:"Exportar",metricsGeneratedTemplate:"Generado {n}",metricsScope:"Alcance",auditToggleTemplate:"Historial ({n})",auditTrailLabel:"Historial de actividad",auditCreated:"Cre\xF3 el comentario",auditEdited:"Edit\xF3 el texto",auditTagsChanged:"Actualiz\xF3 las etiquetas",auditPreviousResolutions:"Resoluciones anteriores",auditResolvedInTemplate:"Resuelto en {n}",commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"May\xFAs",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusInReview:"En revisi\xF3n",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",filterByType:"Tipo",filterByPriority:"Prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO",reactionsLabel:"Reacciones",addReaction:"A\xF1adir reacci\xF3n",reactionToggleOn:"A\xF1adir tu reacci\xF3n",reactionToggleOff:"Quitar tu reacci\xF3n",reactionPickerLabel:"Elegir una reacci\xF3n"};var Te={en:H,es:Dt},de="en";function Pt(){let i=(navigator.language||de).slice(0,2).toLowerCase();return i in Te?i:de}function kt(i){let e=Te[i];return!e||i===de?Te[de]:{...Te[de],...e}}function I(i,e){return i.replace("{n}",String(e))}var ji=6e4;function X(i,e){if(!Number.isFinite(i)||i<0)return"";let t=Math.floor(i/ji);if(t<1)return e.durationLessThanMinute;if(t<60)return I(e.minutesAgoTemplate,t);let o=Math.floor(t/60);if(o<24){let l=t%60,c=I(e.hoursAgoTemplate,o);return l?`${c} ${I(e.minutesAgoTemplate,l)}`:c}let s=Math.floor(o/24),r=o%24,a=I(e.daysAgoTemplate,s);return r?`${a} ${I(e.hoursAgoTemplate,r)}`:a}var Ve=64,Wi=3,Ki=5,qi=.6,Zi=.7,Ji=/^(css|sc|jsx|emotion)-/i,Qi=/^data-(reactid|react-|v-|svelte-)/,eo=["id","name","role","aria-label"],to=["data-testid","name","aria-label"],Ye=i=>typeof CSS<"u"&&CSS.escape?CSS.escape(i):String(i).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),io=i=>String(i).replace(/["\\]/g,"\\$&"),pe=(i,e)=>{try{return e.querySelectorAll(i).length===1}catch{return!1}},Xt=i=>(i||"").replace(/\s+/g," ").trim().slice(0,Ve),oo=i=>At.includes(i)||Ji.test(i)?!1:!i.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),no=i=>[...i.classList].filter(oo),ro=i=>{let e={};for(let{name:t,value:o}of i.attributes)(eo.includes(t)||t.startsWith("data-")&&!Qi.test(t))&&o&&(e[t]=o.slice(0,Ve));return e},je=i=>{let e=i.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(o=>o.tagName===i.tagName);return{index:t.indexOf(i),count:t.length}},so=(i,e)=>{if(!i.id)return null;let t=`#${Ye(i.id)}`;return pe(t,e)?t:null},ao=(i,e)=>{let t=i.tagName.toLowerCase();for(let o of to){let s=i.getAttribute(o);if(!s)continue;let r=`${t}[${o}="${io(s)}"]`;if(pe(r,e))return r}return null},lo=(i,e)=>{let t=[],o=i;for(let s=0;s<Wi&&o;s++){let r=no(o),a=o.tagName.toLowerCase();if(t.unshift(r.length?`${a}.${r.map(Ye).join(".")}`:a),s===0&&!r.length)return null;let l=t.join(" > ");if(pe(l,e))return l;o=o.parentElement}return null},co=(i,e)=>{if(i===e.body)return"body";let t=[],o=i;for(let r=0;r<Ki&&o;r++){if(o===e.body){t.unshift("body");break}if(o.id){let l=[`#${Ye(o.id)}`,...t].join(" > ");if(pe(l,e))return l}let{index:a}=je(o);t.unshift(`${o.tagName.toLowerCase()}:nth-of-type(${a+1})`),o=o.parentElement}let s=t.join(" > ");return pe(s,e)?s:null},Ut=(i,e)=>so(i,e)||ao(i,e)||lo(i,e)||co(i,e);function Ft(i){return Ut(i,i.ownerDocument)}function Gt(i,e,t){let o=i.ownerDocument,{index:s,count:r}=je(i);return{version:1,selector:Ut(i,o),fingerprint:{tagName:i.tagName,textSnippet:Xt(i.textContent),attributes:ro(i),siblingIndex:s,siblingCount:r},relativeX:e,relativeY:t}}var po=(i,e)=>{if(!i&&!e)return 1;if(!i||!e)return 0;if(i===e)return 1;if(i.startsWith(e)||e.startsWith(i))return .8;let t=new Set(i.split(" ")),o=new Set(e.split(" ")),s=0;for(let r of t)o.has(r)&&s++;return 2*s/(t.size+o.size)},ho=(i,e)=>{let t=Object.keys(e);if(!t.length)return 1;let o=0;for(let s of t)(i.getAttribute(s)||"").slice(0,Ve)===e[s]&&o++;return o/t.length},$t=(i,e)=>{let{index:t,count:o}=je(i),s=Math.abs(t-e.siblingIndex),r=Math.max(e.siblingCount,o,1);return Math.max(0,1-s/r)},uo=(i,e)=>{if(i.tagName!==e.tagName)return 0;let t=!!e.textSnippet,o=Object.keys(e.attributes||{}).length>0,s=.5,r=.3,a=.2;return o?t||(r+=s,s=0):(s+=r,r=0),!t&&!o?$t(i,e):s*po(Xt(i.textContent),e.textSnippet)+r*ho(i,e.attributes||{})+a*$t(i,e)},Ht=(i,e)=>{let t=null;for(let o of i){let s=uo(o,e);(!t||s>t.confidence)&&(t={element:o,confidence:s})}return t};function We(i,e=document){if(i?.version!=null&&i.version>1)return null;let t=i?.fingerprint;if(!t||!t.tagName)return null;if(i.selector){let a=[];try{a=[...e.querySelectorAll(i.selector)]}catch{}let l=Ht(a,t);if(l&&l.confidence>=qi)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=Ht(s,t);return r&&r.confidence>=Zi?r:null}var xe="helldots-comments",Oe="helldots-pending-detail";function Ke(){try{let i=localStorage.getItem(xe);if(!i)return[];let e=JSON.parse(i);return Array.isArray(e)?e:[]}catch(i){return console.warn("HellDots: could not read stored comments",i),[]}}function zt(i){try{return localStorage.setItem(xe,JSON.stringify(i)),!0}catch{return!1}}function ye(i){if(zt(i))return!0;let e=i.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=[...i],o=0;for(let{index:s}of e)if(t[s]={...t[s],contextScreenshot:null},o++,zt(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 qe(i,e,t){let o=new Set(e.map(r=>String(r.id)));return[...i.filter(r=>!o.has(String(r.id))&&r.page!==t),...e]}var Vt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Yt=(i=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(i|=0));for(;i--;)e+=Vt[t[i]&63];return e};var Ze=()=>Yt(),k=i=>typeof i=="string"?i.trim():"",O=(i,e)=>String(i)===String(e);var Z=new Set,J=null,Ie=null,mo=i=>[...i.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')],jt=4,fo=i=>{for(let e=i.parentElement;e;e=e.parentElement){let{overflowX:t,overflowY:o}=getComputedStyle(e);if(t!=="visible"||o!=="visible")return e.getBoundingClientRect()}return null},go=(i,e)=>{e.classList.remove(n.INBOX_MENU_UP),e.classList.remove(n.INBOX_MENU_START);let t=fo(e),o=Math.min(t?.bottom??1/0,window.innerHeight),s=Math.max(t?.top??0,0),r=Math.max(t?.left??0,0),a=Math.min(t?.right??1/0,window.innerWidth),{height:l,width:c,left:d}=e.getBoundingClientRect(),p=i.getBoundingClientRect(),h=p.bottom+jt+l,u=p.top-jt-l;h>o&&u>=s&&e.classList.add(n.INBOX_MENU_UP),d<r&&p.left+c<=a&&e.classList.add(n.INBOX_MENU_START)},Wt=(i,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(i)||i.contains(e.target),Eo=()=>{J||(J=i=>{for(let e of[...Z])Wt(e.menu,i)||Wt(e.button,i)||e.close()},document.addEventListener("mousedown",J,!0),Ie=i=>{let e=[...Z].pop();if(e){if(i.key==="Escape"){i.preventDefault(),i.stopPropagation(),e.close(),e.button.focus();return}if(["ArrowDown","ArrowUp","Home","End"].includes(i.key)){let t=mo(e.menu);if(t.length===0)return;i.preventDefault(),i.stopPropagation();let o=e.menu.getRootNode(),s=t.indexOf(o.activeElement),r;if(i.key==="Home")r=0;else if(i.key==="End")r=t.length-1;else if(s===-1)r=i.key==="ArrowDown"?0:t.length-1;else{let a=i.key==="ArrowDown"?1:-1;r=(s+a+t.length)%t.length}t[r].focus()}}},document.addEventListener("keydown",Ie,!0))},Co=()=>{J&&(document.removeEventListener("mousedown",J,!0),J=null,document.removeEventListener("keydown",Ie,!0),Ie=null)},Ae=()=>{for(let i of[...Z])i.close()},V=(i,e)=>{let t={button:i,menu:e,close:()=>{e.style.display="none",i.setAttribute("aria-expanded","false"),Z.delete(t),Z.size===0&&Co()}},o=()=>{Ae(),e.style.display="block",go(i,e),i.setAttribute("aria-expanded","true"),Z.add(t),Eo()},s=()=>e.style.display!=="none";return e.style.display="none",i.setAttribute("aria-expanded","false"),i.addEventListener("click",r=>{r.stopPropagation();let a=s();Ae(),a||o()}),{open:o,close:t.close,isOpen:s}};var Kt=(i,e)=>k(i?.id)||i?.name||e.anonymous,Je=i=>{let e=i?.reactions;return!e||typeof e!="object"?[]:le.filter(t=>e[t]?.length>0).map(t=>({emoji:t,authors:[...e[t]]}))},Qe=i=>{if(!i||typeof i!="object")return null;let e={};for(let t of le){let o=i[t];if(!Array.isArray(o))continue;let s=[];for(let r of o){if(typeof r!="string")continue;let a=r.trim();a&&!s.includes(a)&&s.push(a)}s.length>0&&(e[t]=s)}return Object.keys(e).length>0?e:null},et=(i,e,t)=>{if(!le.includes(e)||!t)return!1;i.reactions||(i.reactions={});let o=i.reactions[e]||[],s=o.indexOf(t);return s>=0?o.splice(s,1):o.push(t),o.length>0?i.reactions[e]=o:delete i.reactions[e],!0},tt=i=>{let e=Object.entries(i||{}).filter(([,t])=>t?.length>0);return e.length>0?Object.fromEntries(e.map(([t,o])=>[t,[...o]])):null},bo='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20.94 11.08A9 9 0 1 1 12.92 3.06"/><path d="M8.5 14.2a4.6 4.6 0 0 0 7 0"/><path d="M9 9.5h.01M15 9.5h.01"/><path d="M19 2.6v4M17 4.6h4"/></svg>',Re=({actorKey:i,strings:e,onToggle:t})=>{let o=new WeakMap,s=c=>{let d=o.get(c);if(d)for(let p of d)p.el.isConnected?p.repaint():d.delete(p)},r=(c,d)=>{t(c,d),s(c)},a=(c,{className:d,tooltip:p=!0})=>{let h=document.createElement("div");h.className=n.REACTION_TRIGGER;let u=document.createElement("button");u.type="button",u.className=d,u.dataset.action="react",p&&(u.dataset.hdTooltip=e.addReaction),u.setAttribute("aria-label",e.addReaction),u.innerHTML=bo;let m=document.createElement("div");m.className=n.REACTION_PALETTE,m.setAttribute("role","menu"),m.setAttribute("aria-label",e.reactionPickerLabel);let f=V(u,m);for(let g of le){let E=document.createElement("button");E.type="button",E.className=n.REACTION_PALETTE_ITEM,E.setAttribute("role","menuitem"),E.dataset.reactionEmoji=g,E.textContent=g,E.setAttribute("aria-label",g),E.addEventListener("click",b=>{b.stopPropagation(),f.close(),r(c,g)}),m.appendChild(E)}return h.appendChild(u),h.appendChild(m),h};return{bar:c=>{let d=document.createElement("div");d.className=n.REACTION_BAR,d.setAttribute("role","group"),d.setAttribute("aria-label",e.reactionsLabel);let p=()=>{d.replaceChildren();let u=Je(c),m=i();if(d.hidden=u.length===0,!d.hidden){for(let{emoji:f,authors:g}of u){let E=g.includes(m),b=document.createElement("button");b.type="button",b.className=n.REACTION_PILL,E&&b.classList.add(n.REACTION_PILL_MINE),b.dataset.reactionEmoji=f;let w=E?e.reactionToggleOff:e.reactionToggleOn;b.setAttribute("aria-pressed",String(E)),E||(b.dataset.hdTooltip=w),b.setAttribute("aria-label",`${w}: ${f} (${g.length})`),b.addEventListener("click",q=>{q.stopPropagation(),r(c,f)});let _=document.createElement("span");_.className=n.REACTION_PILL_EMOJI,_.textContent=f,_.setAttribute("aria-hidden","true");let N=document.createElement("span");N.className=n.REACTION_PILL_COUNT,N.textContent=String(g.length),b.appendChild(_),b.appendChild(N),d.appendChild(b)}d.appendChild(a(c,{className:n.REACTION_ADD}))}},h=o.get(c);return h||o.set(c,h=new Set),h.add({el:d,repaint:p}),p(),d},trigger:a,refresh:s}};var Se="helldotsComment",Q=(i,e=Se,t=location.href)=>{let o=new URL(t),s=i.page||o.pathname,r=s===o.pathname?o:new URL(s,o);return r.searchParams.set(e,String(i.id)),r.href},qt=(i=Se,e=location.href)=>{try{return new URL(e).searchParams.get(i)}catch{return null}};var Zt=["created","edited","status","classified"],Jt=["type","priority","tags"],_o=64,Ne=i=>typeof i=="string"?i.trim().slice(0,_o):"",ve=i=>i===null?{present:!0,value:null}:typeof i=="string"?{present:!0,value:Ne(i)}:{present:!1,value:void 0};function Qt(i,e){let t=Ne(i?.name)||e.anonymous,o=k(i?.id);return o?{id:o,name:t}:{name:t}}function Y(i,e,t,o){if(!Zt.includes(e))return null;let s={type:e,at:new Date().toISOString(),actor:t};o?.field&&Jt.includes(o.field)&&(s.field=o.field);let r=ve(o?.from);r.present&&(s.from=r.value);let a=ve(o?.to);return a.present&&(s.to=a.value),Array.isArray(i.history)||(i.history=[]),i.history.push(s),s}function ei(i){if(!Array.isArray(i))return null;let e=[];for(let t of i){if(!t||typeof t!="object"||!Zt.includes(t.type))continue;let o=Ne(t.at);if(!Number.isFinite(Date.parse(o)))continue;let s=Ne(t.actor?.name),r=k(t.actor?.id),a={type:t.type,at:o,actor:r?{id:r,name:s}:{name:s}};Jt.includes(t.field)&&(a.field=t.field);let l=ve(t.from);l.present&&(a.from=l.value);let c=ve(t.to);c.present&&(a.to=c.value),e.push(a)}return e.length===0?null:(e.sort((t,o)=>Date.parse(t.at)-Date.parse(o.at)),e)}function ti(i){return!Array.isArray(i)||i.length===0?null:i.map(e=>({...e,actor:{...e.actor}}))}function j(i){if(!Array.isArray(i?.history))return[];let e=[],t=null;for(let s of i.history)s.type==="status"&&(s.to==="resolved"?t=s.at:t&&(e.push({resolvedAt:t,reopenedAt:s.at,ms:0}),t=null));t&&e.push({resolvedAt:t,reopenedAt:null,ms:0});let o=Date.parse(i.createdAt);for(let s of e){let r=Date.parse(s.resolvedAt);s.ms=Number.isFinite(o)&&Number.isFinite(r)?Math.max(0,r-o):0}return e}function ee(i){if(i?.status!=="resolved")return null;let e=j(i),t=e[e.length-1];if(t&&!t.reopenedAt)return t.ms;let o=Date.parse(i.resolvedAt),s=Date.parse(i.createdAt);return!Number.isFinite(o)||!Number.isFinite(s)?null:Math.max(0,o-s)}var it=new Set,ii=()=>{for(let i of[...it])i(!1)},Le=(i,{title:e,message:t,confirmLabel:o,cancelLabel:s})=>new Promise(r=>{let a=document.createElement("div");a.className=n.CONFIRM,a.style.zIndex=String(M.CONFIRM);let l=document.createElement("div");l.className=n.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=n.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=n.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=n.CONFIRM_ACTIONS;let h=document.createElement("button");h.type="button",h.className=n.CONFIRM_CANCEL,h.textContent=s;let u=document.createElement("button");u.type="button",u.className=n.CONFIRM_ACCEPT,u.textContent=o,p.appendChild(h),p.appendChild(u),l.appendChild(c),l.appendChild(d),l.appendChild(p),a.appendChild(l);let m=i.activeElement||document.activeElement,f=!1,g=_=>{f||(f=!0,it.delete(g),document.removeEventListener("keydown",E,!0),a.remove(),m?.focus?.(),r(_))},E=_=>{if(_.key==="Escape"){_.stopPropagation(),_.preventDefault(),g(!1);return}if(_.key!=="Tab")return;let N=[h,u],q=i.activeElement||document.activeElement,C=N.indexOf(q);_.preventDefault(),(_.shiftKey?N[(C<=0?N.length:C)-1]:N[(C+1)%N.length]).focus()};h.addEventListener("click",()=>g(!1)),u.addEventListener("click",()=>g(!0));let b=!1;a.addEventListener("mousedown",_=>{b=_.target===a,_.stopPropagation()}),a.addEventListener("click",_=>{_.target===a&&b&&g(!1),b=!1}),it.add(g),document.addEventListener("keydown",E,!0),(i.body||i).appendChild(a),h.focus()});var oi='<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>',To='<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>',xo='<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>',ie=i=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(i).catch(()=>{});let e=document.createElement("textarea");e.value=i,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},B=(i,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,in_review:e.statusInReview,resolved:e.statusResolved})[i]||e.statusOpen,v=(i,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[i]||e.unset,L=(i,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[i]||e.unset,te=({action:i,options:e,value:t,colorOf:o,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=n.INBOX_ACTION_BTN,l&&d.classList.add(n.INBOX_ACTION_BTN_LABELED),d.dataset.action=i,d.setAttribute("aria-haspopup","true");let p=document.createElement("span");p.className=n.INBOX_STATUS_DOT,d.appendChild(p);let h=null;l&&(h=document.createElement("span"),h.className=n.INBOX_ACTION_LABEL,d.appendChild(h));let u=document.createElement("div");u.className=n.INBOX_MENU,u.setAttribute("role","menu");let m=V(d,u),f=t,g=()=>{let E=`${r}: ${s(f)}`;p.style.backgroundColor=o(f),d.dataset.hdTooltip=E,d.setAttribute("aria-label",E),h&&(h.textContent=s(f)),u.querySelectorAll("[data-picker-option]").forEach(b=>{let w=b.dataset.pickerOption,_=w===""?null:w;b.setAttribute("aria-checked",String(_===f))})};for(let E of e){let b=document.createElement("button");b.type="button",b.className=n.INBOX_MENU_ITEM,b.dataset.pickerOption=E===null?"":E,b.setAttribute("role","menuitemradio");let w=document.createElement("span");w.className=n.INBOX_STATUS_DOT,w.style.backgroundColor=o(E),b.appendChild(w),b.appendChild(document.createTextNode(s(E))),b.addEventListener("click",_=>{_.stopPropagation(),m.close(),E!==f&&(f=E,a(E),g())}),u.appendChild(b)}return c.appendChild(d),c.appendChild(u),g(),c},ot=({label:i,tooltip:e,items:t})=>{let o=document.createElement("div");o.style.position="relative";let s=document.createElement("button");s.type="button",s.className=n.INBOX_ACTION_BTN,s.dataset.action="menu",e&&(s.dataset.hdTooltip=e),s.setAttribute("aria-label",i),s.innerHTML=xo;let r=document.createElement("div");r.className=n.INBOX_MENU,r.setAttribute("role","menu");let a=V(s,r);for(let l of t){let c=document.createElement("button");c.type="button",c.className=n.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 Le(p,l.confirm()))return}l.onSelect()}),r.appendChild(c)}return o.appendChild(s),o.appendChild(r),o},we=(i,{strings:e,reactions:t,onCopy:o,onCopyLink:s,onEdit:r,onSetStatus:a,onSetType:l,onSetPriority:c,onDelete:d})=>{let p=document.createElement("div");p.className=n.INBOX_CARD_ACTIONS;let h=document.createElement("div");h.className=n.ACTIONS_GROUP;let u=document.createElement("div");u.className=`${n.ACTIONS_GROUP} ${n.ACTIONS_GROUP_END}`,p.appendChild(h),p.appendChild(u),t&&u.appendChild(t.trigger(i,{className:n.INBOX_ACTION_BTN}));let m=document.createElement("button");return m.type="button",m.className=n.INBOX_ACTION_BTN,m.dataset.action="copy",m.dataset.hdTooltip=e.copyAgentContext,m.setAttribute("aria-label",e.copyAgentContext),m.innerHTML=oi,m.addEventListener("click",f=>{f.stopPropagation(),o(i),m.innerHTML=To,m.dataset.hdTooltip=e.copied,setTimeout(()=>{m.innerHTML=oi,m.dataset.hdTooltip=e.copyAgentContext},1500)}),u.appendChild(m),h.appendChild(te({action:"status",options:S,value:i.status||"open",colorOf:f=>F[f]||F.open,labelOf:f=>B(f,e),tooltipLabel:e.statusLabel,onSelect:f=>a(i,f),showLabel:!0})),h.appendChild(te({action:"type",options:[null,...A],value:i.type||null,colorOf:f=>G[f]||"transparent",labelOf:f=>v(f,e),tooltipLabel:e.typeLabel,onSelect:f=>l?.(i,f),showLabel:!0})),h.appendChild(te({action:"priority",options:[null,...R],value:i.priority||null,colorOf:f=>z[f]||"transparent",labelOf:f=>L(f,e),tooltipLabel:e.priorityLabel,onSelect:f=>c?.(i,f),showLabel:!0})),u.appendChild(ot({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>s?.(i)},{label:e.editComment,onSelect:()=>r?.(i)},{label:e.deleteComment,onSelect:()=>d(i),confirm:()=>({title:e.confirmDeleteCommentTitle,message:i.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),p};var oe=({value:i,strings:e,onInput:t,onSave:o,onCancel:s})=>{let r=document.createElement("div");r.className=n.EDITOR;let a=document.createElement("textarea");a.className=n.EDITOR_INPUT,a.value=i,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=n.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=n.EDITOR_CANCEL,c.textContent=e.editCancel;let d=document.createElement("button");d.type="button",d.className=n.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(),o(a.value))}),c.addEventListener("click",h=>{h.stopPropagation(),s()}),d.addEventListener("click",h=>{h.stopPropagation(),d.disabled||o(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},Me=(i,e)=>Le(i,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var Oo=(i,e)=>{let t=Date.now()-new Date(i).getTime(),o=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return o<1?e.justNow:o<60?I(e.minutesAgoTemplate,o):s<24?I(e.hoursAgoTemplate,s):I(e.daysAgoTemplate,r)},ri=(i,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(i)),he=(i,e,t,o,s=null)=>{let r=document.createElement("div");r.className=n.THREAD_META;let a=document.createElement("span");a.className=n.THREAD_AUTHOR,a.textContent=i||t.anonymous;let l=document.createElement("span");return l.className=n.THREAD_TIME,l.textContent=Oo(e,t),l.dataset.fullDate=ri(e,o),r.appendChild(a),r.appendChild(l),s&&r.appendChild(nt(s,t,o)),r},nt=(i,e,t)=>{let o=document.createElement("span");return o.className=n.THREAD_EDITED,o.textContent=e.editedMark,o.dataset.fullDate=e.editedAtPrefix+ri(i,t),o},rt=()=>/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),st=(i,e)=>{let t=rt(),o={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:t?"\u21E7":e.modifierShift},s=o[i.shortcutModifier]||o.alt,r=i.shortcutKey?.toUpperCase()||"C";return`${s} + ${r}`},Be='<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>',yo='<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>',Io='<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>',Ao='<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>',Ro='<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>',De=({areaClassName:i,inputTag:e="textarea",inputClassName:t,inputId:o,inputPlaceholder:s,submitBtnId:r,fileInputId:a},l)=>{let c=document.createElement("div");c.className=i;let d=document.createElement(e);o&&(d.id=o),t&&(d.className=t),d.placeholder=s,d.setAttribute("aria-label",s),e==="input"&&(d.type="text");let p=document.createElement("div");p.className=n.SCREENSHOTS_CONTAINER;let h=document.createElement("div");h.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=yo;let m=document.createElement("input");m.type="file",a&&(m.id=a),m.accept="image/*",m.style.display="none";let f=document.createElement("button");return r&&(f.id=r),f.className=n.THREAD_SUBMIT,f.type="button",f.setAttribute("aria-label",l.send),f.innerHTML=Io,h.appendChild(u),h.appendChild(m),h.appendChild(f),c.appendChild(d),c.appendChild(p),c.appendChild(h),{container:c,inputEl:d,screenshotsContainer:p,attachBtn:u,fileInput:m,submitBtn:f}},ni=(i,e,t,o)=>{let s=document.createElement("div");s.className=n.TOOLBAR_ACTION_WRAPPER;let r=document.createElement("div");r.className=n.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>r.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${n.TOOLBAR_ACTION_BTN} ${i}`,a.setAttribute("aria-label",o),a.innerHTML=e,s.appendChild(r),s.appendChild(a),s},si=(i={},e=H)=>{let t=document.createElement("div");t.id=x.TOOLBAR;let o=document.createElement("div");o.className=n.TOOLBAR_ACTIONS;let s=document.createElement("span");s.className=n.TOOLBAR_TEXT,s.textContent=e.toolbarComment;let r=document.createElement("span");r.className=n.SHORTCUT_HINT,r.textContent=st(i,e);let a=ni(n.TOOLBAR_COMMENT_BTN,Ao,[s,r],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=ni(n.TOOLBAR_MENU_BTN,Ro,[l],e.toolbarInbox);return o.appendChild(a),o.appendChild(c),t.appendChild(o),t},at=(i,e,{includeStatus:t=!1,includeClassification:o=!0}={})=>{let s=document.createElement("div");s.className=n.INBOX_BADGES;let r=(a,l,c)=>{let d=document.createElement("span");d.className=`${n.BADGE} ${l}`,d.textContent=a,c&&(d.style.borderColor=c),s.appendChild(d)};if(t){let a=i.status||"open";r(B(a,e),n.BADGE_STATUS,F[a])}o&&i.type&&r(v(i.type,e),n.BADGE_TYPE,G[i.type]),o&&i.priority&&r(L(i.priority,e),n.BADGE_PRIORITY,z[i.priority]);for(let a of i.tags||[])r(a,n.BADGE_TAG,null);if(i.status==="resolved"){let a=ee(i),l=a===null?"":X(a,e);r(I(e.resolvedInTemplate,l||"\u2014"),n.BADGE_DURATION,null)}return s.children.length?s:null},So=i=>{let e=document.createElement("div");e.className=n.CLASSIFY_ROW;let t=null,o=null,s=()=>{e.replaceChildren(),e.appendChild(te({action:"type",options:[null,...A],value:null,colorOf:r=>G[r]||"transparent",labelOf:r=>v(r,i),tooltipLabel:i.typeLabel,onSelect:r=>t=r,showLabel:!0})),e.appendChild(te({action:"priority",options:[null,...R],value:null,colorOf:r=>z[r]||"transparent",labelOf:r=>L(r,i),tooltipLabel:i.priorityLabel,onSelect:r=>o=r,showLabel:!0}))};return s(),{container:e,getType:()=>t,getPriority:()=>o,reset:()=>{t=null,o=null,s()}}},ai=(i=H)=>{let e=document.createElement("div");e.id=x.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",i.commentBoxAriaLabel);let{container:t}=De({areaClassName:n.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:x.COMMENT_INPUT,inputPlaceholder:i.commentPlaceholder,submitBtnId:x.SUBMIT_COMMENT,fileInputId:x.ATTACH_IMAGE_INPUT},i),o=So(i);return e.appendChild(o.container),e.appendChild(t),e.style.display="none",e.classify=o,e},W=i=>String(i).replace(/[\\"]/g,"\\$&"),li=i=>`[data-comment-id="${W(i)}"]`,lt=i=>i.screenshots||(i.screenshot?[i.screenshot]:[]),ne=(i,e,{strings:t,onShow:o,rerender:s})=>{i.innerHTML="",i.classList.toggle(n.ACTIVE,e.length>0),e.forEach((r,a)=>{let l=document.createElement("div");l.className=n.SCREENSHOT_ITEM;let c=document.createElement("img");c.className=n.SCREENSHOT_IMG,c.src=r,c.alt=t.attachedScreenshot,ci(c,()=>o(r));let d=document.createElement("button");d.type="button",d.className=n.SCREENSHOT_REMOVE,d.setAttribute("aria-label",t.removeScreenshot),d.innerHTML="&times;",d.onclick=p=>{p.stopPropagation(),e.splice(a,1),s()},l.appendChild(c),l.appendChild(d),i.appendChild(l)})},re=(i,e,t)=>{i.addEventListener("change",o=>{let s=o.target.files[0];if(!s||s.type&&!s.type.startsWith("image/"))return;let r=e();if(r.length>=Ce)return;let a=new FileReader;a.onload=l=>{r.push(l.target.result),t()},a.readAsDataURL(s),i.value=""})},$=(i,e)=>{i.querySelectorAll(`.${n.SCREENSHOT_IMG}`).forEach(t=>{ci(t,()=>e(t.src))})},ci=(i,e)=>{i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.addEventListener("click",t=>{t.stopPropagation(),e()}),i.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())})},di=(i,e=H)=>{let t=document.createElement("div");return t.className=n.CIRCLE,t.dataset.commentId=i.id,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${i.text}`),t.style.cssText=`
2
+ import{domToCanvas as jo}from"modern-screenshot";var k="helldots-root",Uo=()=>{customElements.get(k)||customElements.define(k,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function yt(){Uo();let i=document.querySelector(k);return i||(i=document.createElement(k),document.body.appendChild(i)),i.shadowRoot}var Fe=()=>typeof performance?.now=="function"?performance.now():Date.now(),Fo=()=>new Promise(i=>{if(typeof MessageChannel!="function"){setTimeout(i);return}let e=new MessageChannel;e.port1.onmessage=()=>{e.port1.close(),i()},e.port2.postMessage(null)}),zo=()=>{let i=globalThis.scheduler;return typeof i?.yield=="function"?i.yield():Fo()};function Ot({budgetMs:i=8}={}){let e=Fe(),t=()=>{e=Fe()};return()=>{if(!(Fe()-e<i))return zo().then(t,t)}}var Go=["background-clip","font-family","font-kerning","overflow-x","overflow-y","text-overflow","text-transform"],It=[...Go,"aspect-ratio","border-collapse","border-spacing","bottom","box-sizing","caption-side","clear","display","empty-cells","float","height","isolation","left","margin-bottom","margin-left","margin-right","margin-top","max-height","max-width","min-height","min-width","padding-bottom","padding-left","padding-right","padding-top","position","right","table-layout","top","vertical-align","visibility","width","z-index","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left-color","border-left-style","border-left-width","border-right-color","border-right-style","border-right-width","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","outline-color","outline-offset","outline-style","outline-width","align-content","align-items","align-self","column-count","column-fill","column-gap","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","flex-basis","flex-direction","flex-grow","flex-shrink","flex-wrap","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column-end","grid-column-start","grid-row-end","grid-row-start","grid-template-areas","grid-template-columns","grid-template-rows","justify-content","justify-items","justify-self","order","row-gap","color","direction","font-feature-settings","font-size","font-stretch","font-style","font-variant","font-variation-settings","font-weight","hyphens","letter-spacing","line-height","list-style-image","list-style-position","list-style-type","overflow-wrap","tab-size","text-align","text-align-last","text-decoration-color","text-decoration-line","text-decoration-style","text-decoration-thickness","text-indent","text-orientation","text-shadow","text-underline-offset","text-underline-position","unicode-bidi","white-space","word-break","word-spacing","writing-mode","-webkit-box-orient","-webkit-line-clamp","-webkit-text-fill-color","-webkit-text-stroke-color","-webkit-text-stroke-width","backdrop-filter","backface-visibility","background-attachment","background-blend-mode","background-color","background-image","background-origin","background-position-x","background-position-y","background-repeat","background-size","box-shadow","clip-path","filter","mask-image","mask-mode","mask-position","mask-repeat","mask-size","mix-blend-mode","object-fit","object-position","opacity","perspective","perspective-origin","rotate","scale","transform","transform-origin","transform-style","translate","accent-color","appearance","dominant-baseline","fill","fill-opacity","fill-rule","paint-order","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-width","text-anchor"];var Vo=(i,e)=>{try{let t=document.createElement("canvas");if(t.width=i,t.height=e,t.width!==i||t.height!==e)return!1;let o=t.getContext("2d");return o?(o.fillStyle="#ffffff",o.fillRect(0,0,1,1),o.getImageData(0,0,1,1).data[3]!==0):!1}catch{return!1}},Ce=null,Yo=()=>(Ce!==null||(Ce=[65535,32767,16384,8192,4096].find(i=>Vo(1,i))??4096),Ce),Rt=(i,e,t,o={})=>{if(!(i>0)||!(e>0))return t;let{maxDimension:s=Yo(),maxArea:r=268435456}=o;return Math.min(t,s/i,s/e,Math.sqrt(r/(i*e)))},At=i=>{try{let e=i?.getContext?.("2d");return!!e&&e.getImageData(0,0,1,1).data[3]!==0}catch{return!1}};var Ge=.5,Wo=.7,St=i=>!i||i==="transparent"||i==="rgba(0, 0, 0, 0)",Nt=()=>{let i=getComputedStyle(document.documentElement).backgroundColor;if(!St(i))return i;let e=getComputedStyle(document.body).backgroundColor;return St(e)?"#ffffff":e},vt=()=>{try{let i=document.implementation.createHTMLDocument(""),e=i.createElement("style");return i.head.appendChild(e),e.sheet!==null}catch{return!1}},Ko=i=>{let e=[],t=i.indexOf("@font-face");for(;t!==-1;){let o=i.indexOf("{",t),s=o===-1?-1:i.indexOf("}",o);if(s===-1)break;e.push(i.slice(t,s+1)),t=i.indexOf("@font-face",s)}return e.join(`
3
+ `)},ze=new Map,qo=i=>(ze.has(i)||ze.set(i,fetch(i,{mode:"cors",credentials:"omit"}).then(e=>e.ok?e.text():"").then(Ko).catch(()=>"")),ze.get(i)),Zo=i=>{try{return!!i.cssRules}catch{return!1}},Jo=async i=>{let e=()=>{};if(!i||!vt())return e;let t=Array.from(document.styleSheets).filter(r=>r.href&&!Zo(r)).map(r=>r.href);if(!t.length)return e;let o=(await Promise.all(t.map(qo))).filter(Boolean).join(`
4
+ `);if(!o)return e;let s=document.createElement("style");return s.textContent=o,document.head.appendChild(s),()=>s.remove()},Qo=i=>e=>!(e.nodeName?.toLowerCase()===k||i&&e.ownerDocument!==document);async function Ve({scale:i=1,embedCrossOriginFonts:e=!1,fastCapture:t=!1,skipIframeContent:o=!1,captureTimeout:s}={}){let r=await Jo(e),{width:a,height:l}=document.documentElement.getBoundingClientRect(),c=Rt(a,l,i);try{for(let d=3;;d--){let p=await jo(document.documentElement,{scale:c,backgroundColor:Nt(),...vt()?{}:{font:!1},filter:Qo(o),onCloneEachNode:Ot(),...t?{includeStyleProperties:It}:{},...Number.isFinite(s)&&s>0?{timeout:s}:{}});if(At(p))return{canvas:p,scale:c};if(d<=0)throw new Error(`HellDots: the page render came back holding no pixels. ${Math.round(a)}x${Math.round(l)} CSS pixels is most likely past this browser's canvas limit.`);c/=2}}finally{r()}}var wt=(i,e,t)=>{i.fillStyle=Nt(),i.fillRect(0,0,e,t)};function Lt(i,{left:e,top:t,width:o,height:s},{sourceScale:r=1}={}){let a=document.createElement("canvas");a.width=o,a.height=s;let l=a.getContext("2d");return l?(wt(l,o,s),l.drawImage(i,(e+window.scrollX)*r,(t+window.scrollY)*r,o*r,s*r,0,0,o,s),a.toDataURL("image/png")):null}function Ye(i,{sourceScale:e=1,outputScale:t=Ge,quality:o=Wo}={}){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?(wt(r,s.width,s.height),r.drawImage(i,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,s.width,s.height),s.toDataURL("image/jpeg",o)):null}var n={CIRCLE:"comment-circle",CIRCLE_ACTIVE:"comment-circle--active",TOOLTIP:"comment-tooltip",TOOLBAR_TEXT:"toolbar-text",SHORTCUT_HINT:"shortcut-hint",COMMENT_INPUT_AREA:"comment-input-area",CLOSE_TOOLTIP:"close-tooltip",ACTIVE:"active",COMMENT_CURSOR:"comment-cursor",COMMENT_OVERLAY:"comment-overlay",THREAD_POPOVER:"comment-thread-popover",THREAD_HEADER:"thread-header",THREAD_BODY:"thread-body",THREAD_REPLIES:"thread-replies",THREAD_REPLY:"thread-reply",THREAD_REPLY_ACTIONS:"thread-reply-actions",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_ACTIONS_ROW:"thread-actions-row",THREAD_SCROLL:"thread-scroll",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",INBOX_HEADER_ACTIONS:"inbox-header-actions",INBOX_METRICS_BTN:"inbox-metrics-btn",METRICS_VIEW:"metrics-view",METRICS_TILES:"metrics-tiles",METRICS_TILE:"metrics-tile",METRICS_TILE_VALUE:"metrics-tile-value",METRICS_TILE_LABEL:"metrics-tile-label",METRICS_GROUP:"metrics-group",METRICS_HEADING:"metrics-heading",METRICS_ROW:"metrics-row",METRICS_ROW_LABEL:"metrics-row-label",METRICS_TRACK:"metrics-track",METRICS_BAR:"metrics-bar",METRICS_ROW_COUNT:"metrics-row-count",METRICS_CHART:"metrics-chart",METRICS_AXIS:"metrics-axis",METRICS_EXPORTS:"metrics-exports",METRICS_EXPORT_BTN:"metrics-export-btn",METRICS_EMPTY:"metrics-empty",AUDIT_BLOCK:"audit-block",AUDIT_TOGGLE:"audit-toggle",AUDIT_BODY:"audit-body",AUDIT_LIST:"audit-list",AUDIT_ROW:"audit-row",AUDIT_ACTION:"audit-action",AUDIT_ACTOR:"audit-actor",AUDIT_TIME:"audit-time",AUDIT_HEADING:"audit-heading",AUDIT_RESOLUTIONS:"audit-resolutions",THREAD_TIME:"thread-time",THREAD_EDITED:"thread-edited",EDITOR:"helldots-editor",EDITOR_INPUT:"helldots-editor-input",EDITOR_ACTIONS:"helldots-editor-actions",EDITOR_SAVE:"helldots-editor-save",EDITOR_CANCEL:"helldots-editor-cancel",INBOX_NOTICE:"inbox-notice",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",SCREENSHOT_PENDING:"screenshot-pending",CONFIRM:"helldots-confirm",CONFIRM_PANEL:"helldots-confirm-panel",CONFIRM_TITLE:"helldots-confirm-title",CONFIRM_MESSAGE:"helldots-confirm-message",CONFIRM_ACTIONS:"helldots-confirm-actions",CONFIRM_CANCEL:"helldots-confirm-cancel",CONFIRM_ACCEPT:"helldots-confirm-accept",LIGHTBOX:"helldots-lightbox",LIGHTBOX_IMG:"helldots-lightbox-img",LIGHTBOX_CLOSE:"helldots-lightbox-close",COMMENT_ACTIONS_BAR:"comment-actions-bar",ATTACH_IMAGE_BTN:"attach-image-btn",TOOLBAR_ACTIONS:"toolbar-actions",TOOLBAR_ACTION_BTN:"toolbar-action-btn",TOOLBAR_ACTION_WRAPPER:"toolbar-action-wrapper",TOOLBAR_ACTION_TOOLTIP:"toolbar-action-tooltip",TOOLBAR_COMMENT_BTN:"toolbar-comment-btn",TOOLBAR_MENU_BTN:"toolbar-menu-btn",INBOX_PANEL:"inbox-panel",INBOX_HEADER:"inbox-header",INBOX_FILTER:"inbox-filter",INBOX_FILTER_MENU:"inbox-filter-menu",INBOX_FILTER_MENU_HEADER:"inbox-filter-menu-header",INBOX_FILTER_CLEAR:"inbox-filter-clear",INBOX_FILTER_GROUP:"inbox-filter-group",INBOX_FILTER_CHIPS:"inbox-filter-chips",INBOX_FILTER_CHIP:"inbox-filter-chip",INBOX_FILTER_SECTION:"inbox-filter-section",INBOX_CLOSE:"inbox-close",INBOX_LIST:"inbox-list",INBOX_CARD:"inbox-card",INBOX_CARD_HEADER:"inbox-card-header",INBOX_CARD_ACTIONS:"inbox-card-actions",INBOX_CARD_TEXT:"inbox-card-text",INBOX_CARD_TAG:"inbox-card-tag",INBOX_CARD_REPLY_LINK:"inbox-card-reply-link",INBOX_ACTION_BTN:"inbox-action-btn",INBOX_ACTION_BTN_LABELED:"inbox-action-btn--labeled",INBOX_ACTION_LABEL:"inbox-action-label",INBOX_STATUS_DOT:"inbox-status-dot",INBOX_MENU:"inbox-menu",INBOX_MENU_UP:"inbox-menu--up",INBOX_MENU_START:"inbox-menu--start",INBOX_MENU_ITEM:"inbox-menu-item",INBOX_DETAIL:"inbox-detail",INBOX_DETAIL_HEADER:"inbox-detail-header",INBOX_BACK:"inbox-back",INBOX_NAV_BTN:"inbox-nav-btn",INBOX_REPLIES:"inbox-replies",TOOLTIP_REPLY_COUNT:"comment-tooltip-reply-count",INBOX_EMPTY:"inbox-empty",INBOX_EMPTY_ICON:"inbox-empty-icon",INBOX_EMPTY_TITLE:"inbox-empty-title",INBOX_EMPTY_TEXT:"inbox-empty-text",INBOX_EMPTY_KBD:"inbox-empty-kbd",INBOX_EMPTY_ACTION:"inbox-empty-action",CLASSIFY_ROW:"classify-row",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",BADGE_STATUS:"helldots-badge--status",BADGE_TYPE:"helldots-badge--type",BADGE_PRIORITY:"helldots-badge--priority",BADGE_TAG:"helldots-badge--tag",BADGE_DURATION:"helldots-badge--duration",CONTEXT_BLOCK:"inbox-context",CONTEXT_TITLE:"inbox-context-title",CONTEXT_BODY:"inbox-context-body",CONTEXT_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",CONTEXT_TOGGLE:"inbox-context-toggle",HIGHLIGHT:"helldots-highlight",REACTION_BAR:"reaction-bar",REACTION_PILL:"reaction-pill",REACTION_PILL_MINE:"reaction-pill--mine",REACTION_PILL_EMOJI:"reaction-pill-emoji",REACTION_PILL_COUNT:"reaction-pill-count",REACTION_ADD:"reaction-add",REACTION_TRIGGER:"reaction-trigger",REACTION_PALETTE:"reaction-palette",REACTION_PALETTE_ITEM:"reaction-palette-item",ACTIONS_GROUP:"actions-group",ACTIONS_GROUP_END:"actions-group--end"},Mt=[n.COMMENT_CURSOR],x={TOOLBAR:"comment-toolbar",COMMENT_BOX:"comment-box",COMMENT_INPUT:"comment-input",SUBMIT_COMMENT:"submit-comment",STYLES:"comment-overlay-styles",GLOBAL_STYLES:"comment-overlay-global-styles",ATTACH_IMAGE_INPUT:"attach-image-input"},B=28,le=5,S=["open","in_progress","in_review","resolved"],F={open:"#D1D1D6",in_progress:"#FF9F0A",in_review:"#2E90FA",resolved:"#30D158"},R=["bug","suggestion","question","improvement"],z={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},A=["high","medium","low"],G={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},ce=["\u{1F44D}","\u{1F44E}","\u2764\uFE0F","\u{1F389}","\u{1F440}","\u{1F680}"],Dt={CONTAINER:'section, div[class*="container"], div[class*="content"]'},M={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},Bt='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>',kt="2 2";var _e=class{constructor({host:e,autoScreenshot:t,embedCrossOriginFonts:o=!1,fastCapture:s=!1,skipIframeContent:r=!1,captureTimeout:a,onRegionCaptured:l,onRegionPending:c,onPlace:d,onError:p}){this.host=e,this.autoScreenshot=t,this.embedCrossOriginFonts=o,this.fastCapture=s,this.skipIframeContent=r,this.captureTimeout=a,this.onRegionCaptured=l,this.onRegionPending=c,this.onPlace=d,this.onError=p,this.pendingCapture=null,this.pendingRegion=null,this._regionToken=null,this._dragStart=null,this._isDragging=!1,this._selectionRect=null,this._boundDragMove=h=>this.onDragMove(h),this._boundDragEnd=h=>this.onDragEnd(h)}beginDrag(e){this._dragStart={x:e.clientX,y:e.clientY},this._isDragging=!1,document.addEventListener("mousemove",this._boundDragMove),document.addEventListener("mouseup",this._boundDragEnd)}onDragMove(e){let t=e.clientX-this._dragStart.x,o=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,o)<5)return;this._isDragging=!0;let s=Math.min(this._dragStart.x,e.clientX),r=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.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),o=Math.min(this._dragStart.y,e.clientY),s=Math.abs(e.clientX-this._dragStart.x),r=Math.abs(e.clientY-this._dragStart.y);this._selectionRect?.remove(),this._selectionRect=null,s>10&&r>10&&this.startRegionCapture({left:t,top:o,width:s,height:r}),await this.onPlace(e.clientX,e.clientY)}else await this.onPlace(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}startRegionCapture(e){let t={};this._regionToken=t;let o=()=>this._regionToken===t,s=Ve({scale:1,embedCrossOriginFonts:this.embedCrossOriginFonts,fastCapture:this.fastCapture,skipIframeContent:this.skipIframeContent,captureTimeout:this.captureTimeout});this.autoScreenshot&&(this.pendingCapture=s.then(({canvas:r,scale:a})=>o()?Ye(r,{sourceScale:a}):null).catch(()=>null)),this.onRegionPending?.(!0),this.pendingRegion=s.then(({canvas:r,scale:a})=>{if(!o())return;let l=Lt(r,e,{sourceScale:a});l&&this.onRegionCaptured(l)}).catch(r=>{console.warn("HellDots: screenshot capture failed:",r),this.onError?.(r)}).finally(()=>{o()&&this.onRegionPending?.(!1)})}armClickCapture(){!this.autoScreenshot||this.pendingCapture||(this.pendingCapture=Ve({scale:Ge,embedCrossOriginFonts:this.embedCrossOriginFonts,fastCapture:this.fastCapture,skipIframeContent:this.skipIframeContent,captureTimeout:this.captureTimeout}).then(({canvas:e,scale:t})=>Ye(e,{sourceScale:t})).catch(e=>(console.warn("HellDots: automatic screenshot failed",e),this.onError?.(e),null)))}async consumePending(){return await this.pendingRegion,this.pendingCapture?await this.pendingCapture:null}clearPending(){this.pendingCapture=null,this.pendingRegion=null,this._regionToken=null}destroy(){document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._selectionRect?.remove(),this._selectionRect=null,this.pendingCapture=null,this.pendingRegion=null,this._regionToken=null,this._dragStart=null,this._isDragging=!1}};var ei=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],ti=[{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/}],oi={name:"unknown",version:""},ii=i=>/not[\W_]*a[\W_]*brand/i.test(i),Pt=(i,e)=>{for(let{name:t,re:o}of i){let s=e.match(o);if(s)return{name:t,version:(s[1]||"").replace(/_/g,".")}}return{...oi}};function $t(i=window){let e=i.navigator||{},t=e.userAgent||"",o=e.userAgentData,s=Pt(ei,t),r=o?.brands?.find(l=>!ii(l.brand));r&&(s={name:r.brand,version:r.version||""});let a=Pt(ti,t);return o?.platform&&(a.name=o.platform),{version:1,url:i.location?.href||"",viewport:{width:i.innerWidth,height:i.innerHeight},screen:{width:i.screen?.width??0,height:i.screen?.height??0},devicePixelRatio:i.devicePixelRatio??1,userAgent:t,browser:s,os:a,language:e.language||""}}var Te=" scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;",ni=(...i)=>i.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(""),Ht=()=>` :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;}#${x.TOOLBAR}{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:${M.TOOLBAR};}.${n.TOOLBAR_ACTION_WRAPPER}{position:relative;}.${n.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;}.${n.TOOLBAR_ACTION_WRAPPER}:hover .${n.TOOLBAR_ACTION_TOOLTIP}{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}.${n.TOOLBAR_TEXT}{font-size:13px;font-weight:500;letter-spacing:-0.01em;}.${n.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;}.${n.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);}.${n.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;}.${n.TOOLBAR_ACTION_WRAPPER}:first-child .${n.TOOLBAR_ACTION_BTN}{border-radius:12px 0 0 12px;}.${n.TOOLBAR_ACTION_WRAPPER}:last-child .${n.TOOLBAR_ACTION_BTN}{border-radius:0 12px 12px 0;}.${n.TOOLBAR_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.TOOLBAR_COMMENT_BTN}.${n.ACTIVE}{color:#2E90FA;background:rgba(46,144,250,0.1);}#${x.COMMENT_BOX}{position:fixed;background:#1C1C1E;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.4);padding:16px;z-index:${M.COMMENT_BOX};width:min(400px,calc(100vw - 24px));display:none;box-sizing:border-box;}#${x.COMMENT_BOX} .${n.COMMENT_INPUT_AREA}{display:flex;flex-direction:column;gap:0;}.${n.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);}.${n.CLASSIFY_ROW} .${n.INBOX_ACTION_BTN}{height:26px;border:1px solid rgba(255,255,255,0.12);border-radius:8px;}.${n.CLASSIFY_ROW} .${n.INBOX_ACTION_BTN}:hover{border-color:rgba(255,255,255,0.28);}#${x.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;}#${x.COMMENT_INPUT}::placeholder{color:rgba(255,255,255,0.5);}#${x.COMMENT_INPUT}:focus{outline:none;box-shadow:none;}.${n.COMMENT_ACTIONS_BAR}{display:flex;align-items:center;justify-content:space-between;padding-top:12px;}.${n.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;}.${n.ATTACH_IMAGE_BTN}:hover{background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.8);}.${n.CIRCLE}{position:absolute;width:${B}px;height:${B}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:${M.CIRCLE};transform:translate(-50%,-50%);}.${n.CIRCLE}:hover{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);}.${n.CIRCLE}.${n.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);}.${n.CIRCLE}.${n.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);}.${n.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;${Te} z-index:${M.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${n.TOOLTIP} .${n.THREAD_BODY}{padding:8px 0;}.${n.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:${M.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${n.THREAD_POPOVER}>.${n.THREAD_HEADER},.${n.THREAD_POPOVER}>.${n.THREAD_ACTIONS_ROW},.${n.THREAD_POPOVER}>.${n.THREAD_INPUT_AREA}{flex:none;}.${n.THREAD_SCROLL}{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;${Te}}${ni(`.${n.THREAD_SCROLL}`,`.${n.TOOLTIP}`,`.${n.INBOX_LIST}`,`.${n.INBOX_DETAIL}`,`.${n.EDITOR_INPUT}`)} .${n.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:${M.COMMENT_BOX};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;overflow:hidden;}@media (max-width:480px){.${n.INBOX_PANEL}{left:16px;width:auto;}}.${n.INBOX_HEADER},.${n.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;}.${n.INBOX_FILTER}-wrapper{position:relative;}.${n.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;}.${n.INBOX_FILTER}:hover{background:rgba(255,255,255,0.08);}.${n.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);}.${n.INBOX_FILTER_MENU_HEADER}{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:12px;}.${n.INBOX_FILTER_CLEAR}{background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:12px;font-weight:500;cursor:pointer;padding:0;}.${n.INBOX_FILTER_CLEAR}:hover:not(:disabled){color:white;}.${n.INBOX_FILTER_CLEAR}:disabled{opacity:0.35;cursor:default;}.${n.INBOX_FILTER_GROUP} + .${n.INBOX_FILTER_GROUP}{margin-top:14px;}.${n.INBOX_FILTER_SECTION}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);margin-bottom:8px;}.${n.INBOX_FILTER_CHIPS}{display:flex;flex-wrap:wrap;gap:6px;}.${n.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;}.${n.INBOX_FILTER_CHIP}:hover{border-color:rgba(255,255,255,0.4);color:white;}.${n.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;}.${n.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;}.${n.INBOX_MENU_ITEM}:hover{background:rgba(255,255,255,0.08);}.${n.INBOX_CLOSE},.${n.INBOX_NAV_BTN},.${n.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;}.${n.INBOX_CLOSE}{font-size:20px;line-height:1;}.${n.INBOX_CLOSE}:hover,.${n.INBOX_NAV_BTN}:not(:disabled):hover,.${n.INBOX_BACK}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.INBOX_NAV_BTN}:disabled{opacity:0.35;cursor:default;}.${n.INBOX_LIST},.${n.INBOX_DETAIL}{flex:1;overflow-y:auto;${Te} padding:12px;display:flex;flex-direction:column;gap:12px;}.${n.INBOX_CARD}{border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}.${n.INBOX_LIST} .${n.INBOX_CARD}{cursor:pointer;}.${n.INBOX_LIST} .${n.INBOX_CARD}:hover{border-color:rgba(255,255,255,0.22);}.${n.INBOX_CARD}--resolved{border-color:rgba(48,209,88,0.4);opacity:0.75;}.${n.INBOX_LIST} .${n.INBOX_CARD}--resolved:hover{border-color:rgba(48,209,88,0.7);opacity:1;}.${n.INBOX_CARD}--resolved:has([aria-expanded="true"]){opacity:1;}.${n.INBOX_CARD_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;}.${n.INBOX_CARD_ACTIONS}{display:flex;align-items:center;justify-content:space-between;width:100%;gap:8px;}.${n.INBOX_DETAIL_HEADER} .${n.INBOX_CARD_ACTIONS}{justify-content:flex-end;gap:2px;}.${n.ACTIONS_GROUP}{display:flex;align-items:center;flex-wrap:wrap;gap:5px;}.${n.ACTIONS_GROUP_END}{flex-wrap:nowrap;gap:2px;}.${n.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;}.${n.INBOX_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${n.INBOX_ACTION_BTN_LABELED}{width:auto;padding:0 8px 0 6px;gap:5px;justify-content:flex-start;flex:none;}.${n.INBOX_ACTION_LABEL}{font-size:11px;line-height:1;white-space:nowrap;}.${n.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;}.${n.INBOX_MENU_ITEM} .${n.INBOX_STATUS_DOT}{width:9px;height:9px;border:none;margin-right:8px;vertical-align:baseline;}.${n.INBOX_MENU_ITEM}[aria-checked="true"]{background:rgba(255,255,255,0.08);}.${n.THREAD_ACTIONS_ROW}{display:flex;justify-content:flex-end;}.${n.THREAD_POPOVER}>.${n.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;}.${n.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);}.${n.INBOX_MENU}.${n.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${n.INBOX_MENU}.${n.INBOX_MENU_START}{right:auto;left:0;}.${n.INBOX_CARD_TEXT}{white-space:pre-wrap;word-break:break-word;}.${n.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;}.${n.INBOX_BADGES}{display:flex;flex-wrap:wrap;gap:4px;}.${n.INBOX_CARD} .${n.INBOX_BADGES}{margin-top:6px;}.${n.TOOLTIP} .${n.INBOX_BADGES}{margin-bottom:4px;}.${n.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;}.${n.BADGE_STATUS},.${n.BADGE_TYPE},.${n.BADGE_PRIORITY}{font-weight:600;}.${n.BADGE_TAG}{opacity:0.75;}.${n.BADGE_DURATION}{opacity:0.75;border-style:dashed;}.${n.REACTION_BAR}{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:2px;margin-bottom:12px;}.${n.REACTION_BAR}[hidden]{display:none;}.${n.REACTION_TRIGGER}{position:relative;display:inline-flex;}.${n.REACTION_PILL}{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 8px;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#F2F2F7;font-family:inherit;font-size:12px;line-height:1;cursor:pointer;transition:background 0.12s ease,border-color 0.12s ease;}.${n.REACTION_PILL}:hover{background:rgba(255,255,255,0.08);}.${n.REACTION_PILL_MINE}{border-color:#2E90FA;background:rgba(46,144,250,0.16);}.${n.REACTION_PILL_MINE}:hover{background:rgba(46,144,250,0.24);}.${n.REACTION_PILL_EMOJI}{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:13px;}.${n.REACTION_PILL_COUNT}{font-variant-numeric:tabular-nums;}.${n.REACTION_ADD}{display:inline-flex;align-items:center;justify-content:center;width:28px;height:24px;padding:0;border:1px solid rgba(255,255,255,0.18);border-radius:8px;background:transparent;color:#8E8E93;cursor:pointer;}.${n.REACTION_ADD}:hover{color:#F2F2F7;border-color:rgba(255,255,255,0.35);}.${n.REACTION_PALETTE}{position:absolute;top:calc(100% + 4px);left:0;white-space:nowrap;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:4px;z-index:1;box-shadow:0 4px 16px rgba(0,0,0,0.4);}.${n.ACTIONS_GROUP_END} .${n.REACTION_PALETTE},.${n.THREAD_REPLY_ACTIONS} .${n.REACTION_PALETTE}{left:auto;right:0;}.${n.REACTION_PALETTE}.${n.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${n.REACTION_PALETTE_ITEM}{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:6px;background:transparent;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:15px;cursor:pointer;}.${n.REACTION_PALETTE_ITEM}:hover{background:rgba(255,255,255,0.12);}.${n.CONTEXT_BLOCK}{display:flex;flex-direction:column;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.08);font-size:11px;}.${n.CONTEXT_BODY}{display:flex;flex-direction:column;gap:4px;}.${n.CONTEXT_TITLE}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);padding-bottom:4px;}.${n.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;}.${n.CONTEXT_TOGGLE}:hover{color:rgba(255,255,255,0.75);}.${n.CONTEXT_TOGGLE} svg{flex:none;transition:transform 0.15s ease;}.${n.CONTEXT_TOGGLE}[aria-expanded="true"] svg{transform:rotate(180deg);}.${n.CONTEXT_TOGGLE}[aria-expanded="true"] + .${n.CONTEXT_BODY}{padding-top:8px;}.${n.CONTEXT_BLOCK} img{width:100%;border-radius:6px;margin-bottom:6px;cursor:zoom-in;}.${n.CONTEXT_SCREENSHOT_CAPTION}{opacity:0.75;}.${n.CONTEXT_ROW}{display:flex;justify-content:space-between;gap:12px;opacity:0.75;}.${n.CONTEXT_ROW} span:last-child{text-align:right;word-break:break-all;}.${n.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;}.${n.INBOX_CARD_REPLY_LINK}:hover{color:white;}.${n.INBOX_REPLIES}{display:flex;flex-direction:column;gap:10px;padding:0 4px;}.${n.INBOX_REPLIES}:empty{display:none;}.${n.TOOLTIP_REPLY_COUNT}{font-size:12px;color:rgba(255,255,255,0.45);padding-top:4px;}.${n.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;}.${n.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;}.${n.INBOX_EMPTY_TITLE}{color:white;font-size:14px;font-weight:600;}.${n.INBOX_EMPTY_TEXT}{font-size:13px;line-height:1.5;max-width:30ch;}.${n.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;}.${n.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;}.${n.INBOX_EMPTY_ACTION}:hover{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.35);}.${n.THREAD_HEADER}{display:flex;justify-content:space-between;align-items:center;padding:0;}.${n.THREAD_META}{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}.${n.THREAD_AUTHOR}{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${n.THREAD_TIME}{font-size:12px;color:rgba(255,255,255,0.5);cursor:default;position:relative;flex:none;}.${n.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;}.${n.THREAD_TIME}:hover::after{opacity:1;}.${n.THREAD_BODY}{padding:8px 0;white-space:pre-wrap;word-break:break-word;}.${n.THREAD_REPLIES}{padding:0;}.${n.THREAD_REPLIES}:empty{display:none;}.${n.THREAD_REPLY}{padding:16px 0 0 0;border-top:1px solid rgba(255,255,255,0.1);white-space:pre-wrap;word-break:break-word;font-size:14px;color:rgba(255,255,255,0.85);}.${n.THREAD_REPLY} .${n.THREAD_META}{margin-bottom:2px;}.${n.THREAD_REPLY_ACTIONS}{margin-left:auto;flex:none;}.${n.THREAD_REPLY} .${n.SCREENSHOT_IMG}{width:144px;height:100px;object-fit:cover;border-radius:8px;margin-top:4px;cursor:pointer;display:block;}.${n.THREAD_INPUT_AREA}{display:flex;flex-direction:column;gap:0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,0.1);}.${n.THREAD_INPUT}{width:100%;background:transparent;border:none;padding:0;color:white;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;}.${n.THREAD_INPUT}::placeholder{color:rgba(255,255,255,0.5);}.${n.THREAD_INPUT}:focus{outline:none;box-shadow:none;}.${n.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;}.${n.THREAD_SUBMIT}:hover{background:rgba(46,144,250,0.15);color:#1570D6;}.${n.CLOSE_TOOLTIP}{background:none;border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.5);line-height:1;}.${n.CLOSE_TOOLTIP}:hover{color:white;}.${n.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);}}.${n.COMMENT_OVERLAY}{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;pointer-events:none;z-index:${M.TOOLBAR-1};}.${n.COMMENT_OVERLAY}.${n.ACTIVE}{pointer-events:auto;background:rgba(0,0,0,0.1);}.${n.SELECTION_RECT}{position:fixed;border:2px solid #2E90FA;background:rgba(46,144,250,0.1);pointer-events:none;z-index:${M.TOOLTIP};box-sizing:border-box;}.${n.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;}.${n.SCREENSHOTS_CONTAINER}::-webkit-scrollbar{display:none;}.${n.SCREENSHOTS_CONTAINER}.${n.ACTIVE}{display:flex;}.${n.SCREENSHOT_ITEM}{position:relative;flex-shrink:0;}.${n.SCREENSHOT_PENDING}{min-width:50px;height:50px;padding:0 8px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;text-align:center;border:1px dashed rgba(255,255,255,0.35);border-radius:8px;font-size:10px;line-height:1.2;color:rgba(255,255,255,0.7);white-space:nowrap;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}{width:50px;height:50px;object-fit:cover;border-radius:8px;cursor:pointer;display:block;margin:0;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}:hover{opacity:0.85;}.${n.SCREENSHOT_ITEM} .${n.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;}.${n.SCREENSHOT_ITEM}:hover .${n.SCREENSHOT_REMOVE}{display:flex;}.${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_REMOVE}:hover{background:rgba(0,0,0,0.9);}.${n.TOOLTIP}>.${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},.${n.THREAD_SCROLL}>.${n.SCREENSHOTS_CONTAINER} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG},.${n.THREAD_REPLY} .${n.SCREENSHOT_ITEM} .${n.SCREENSHOT_IMG}{width:144px;height:100px;}.${n.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;}.${n.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;}.${n.CONFIRM_TITLE}{margin:0 0 8px;font-size:15px;font-weight:600;}.${n.CONFIRM_MESSAGE}{margin:0 0 20px;font-size:13px;color:rgba(255,255,255,0.65);}.${n.CONFIRM_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${n.CONFIRM_CANCEL},.${n.CONFIRM_ACCEPT}{padding:7px 14px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}.${n.CONFIRM_CANCEL}:focus-visible,.${n.CONFIRM_ACCEPT}:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}.${n.CONFIRM_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${n.CONFIRM_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${n.CONFIRM_ACCEPT}{background:#FF453A;color:white;}.${n.CONFIRM_ACCEPT}:hover{background:#FF6961;}.${n.LIGHTBOX}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.92);z-index:${M.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;}}.${n.LIGHTBOX_IMG}{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:8px;}.${n.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;}.${n.LIGHTBOX_CLOSE}:hover{background:rgba(255,255,255,0.3);}.${n.EDITOR}{display:flex;flex-direction:column;gap:8px;margin:4px 0 2px;}.${n.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;${Te}}.${n.EDITOR_INPUT}:focus{border-color:rgba(46,144,250,0.7);}.${n.EDITOR_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${n.EDITOR_CANCEL},.${n.EDITOR_SAVE}{padding:5px 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;}.${n.EDITOR_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${n.EDITOR_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${n.EDITOR_SAVE}{background:#2E90FA;color:white;}.${n.EDITOR_SAVE}:hover:not(:disabled){background:#57A6FB;}.${n.EDITOR_SAVE}:disabled{background:rgba(255,255,255,0.10);color:rgba(255,255,255,0.4);cursor:not-allowed;}.${n.THREAD_EDITED}{font-size:12px;color:rgba(255,255,255,0.4);cursor:default;position:relative;flex:none;}.${n.THREAD_EDITED}::before{content:"\xB7";margin-right:4px;}.${n.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;}.${n.THREAD_EDITED}:hover::after{opacity:1;}.${n.AUDIT_BLOCK}{margin-top:10px;border-top:1px solid rgba(255,255,255,0.08);padding-top:8px;}.${n.AUDIT_TOGGLE}{display:flex;align-items:center;gap:6px;width:100%;padding:4px 0;border:0;background:none;color:rgba(255,255,255,0.55);font-family:inherit;font-size:12px;text-align:left;cursor:pointer;}.${n.AUDIT_TOGGLE}:hover{color:rgba(255,255,255,0.85);}.${n.AUDIT_TOGGLE}::before{content:"";width:0;height:0;border-left:4px solid currentColor;border-top:4px solid transparent;border-bottom:4px solid transparent;transition:transform 0.15s ease;}.${n.AUDIT_TOGGLE}[aria-expanded="true"]::before{transform:rotate(90deg);}.${n.AUDIT_BODY}{padding:4px 0 2px;}.${n.AUDIT_LIST}{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:7px;}.${n.AUDIT_ROW}{display:grid;grid-template-columns:1fr auto;align-items:baseline;column-gap:8px;font-size:12px;line-height:1.4;}.${n.AUDIT_ACTION}{grid-column:1;color:rgba(255,255,255,0.78);}.${n.AUDIT_ACTOR}{grid-column:1;color:rgba(255,255,255,0.48);font-size:11px;}.${n.AUDIT_TIME}{grid-row:1;grid-column:2;color:rgba(255,255,255,0.42);font-size:11px;white-space:nowrap;}.${n.AUDIT_HEADING}{margin:0 0 6px;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${n.AUDIT_RESOLUTIONS}{margin-top:10px;padding-top:8px;border-top:1px solid rgba(255,255,255,0.06);}.${n.INBOX_HEADER_ACTIONS}{display:flex;align-items:center;gap:12px;}.${n.INBOX_METRICS_BTN}{padding:5px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.75);font-family:inherit;font-size:12px;white-space:nowrap;cursor:pointer;}.${n.INBOX_METRICS_BTN}:hover{background:rgba(255,255,255,0.11);color:#fff;}.${n.METRICS_VIEW}{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:16px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;}.${n.METRICS_VIEW}::-webkit-scrollbar{width:8px;}.${n.METRICS_VIEW}::-webkit-scrollbar-track{background:transparent;}.${n.METRICS_VIEW}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}.${n.METRICS_TILES}{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:8px;}.${n.METRICS_TILE}{display:flex;flex-direction:column;gap:2px;padding:10px;border-radius:9px;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.08);}.${n.METRICS_TILE_VALUE}{color:#fff;font-size:18px;font-weight:600;line-height:1.1;}.${n.METRICS_TILE_LABEL}{color:rgba(255,255,255,0.5);font-size:11px;line-height:1.3;}.${n.METRICS_GROUP}{display:flex;flex-direction:column;gap:7px;}.${n.METRICS_HEADING}{margin:0;color:rgba(255,255,255,0.5);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;}.${n.METRICS_ROW}{display:grid;grid-template-columns:76px 1fr 26px;align-items:center;gap:8px;font-size:12px;}.${n.METRICS_ROW_LABEL}{color:rgba(255,255,255,0.72);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${n.METRICS_TRACK}{height:8px;border-radius:4px;background:rgba(255,255,255,0.07);overflow:hidden;}.${n.METRICS_BAR}{height:100%;border-radius:4px;background:rgba(255,255,255,0.42);min-width:2px;}.${n.METRICS_ROW_COUNT}{color:rgba(255,255,255,0.85);font-variant-numeric:tabular-nums;text-align:right;}.${n.METRICS_CHART}{width:100%;height:96px;display:block;fill:rgba(255,255,255,0.42);}.${n.METRICS_AXIS}{display:flex;justify-content:space-between;color:rgba(255,255,255,0.42);font-size:10px;font-variant-numeric:tabular-nums;}.${n.METRICS_EXPORTS}{display:flex;flex-wrap:wrap;gap:6px;padding-top:4px;border-top:1px solid rgba(255,255,255,0.08);}.${n.METRICS_EXPORT_BTN}{padding:6px 10px;border-radius:7px;border:1px solid rgba(255,255,255,0.12);background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.78);font-family:inherit;font-size:12px;cursor:pointer;}.${n.METRICS_EXPORT_BTN}:hover{background:rgba(255,255,255,0.12);color:#fff;}.${n.METRICS_EMPTY}{margin:0;padding:24px 0;color:rgba(255,255,255,0.5);font-size:13px;text-align:center;}.${n.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;}`,Xt=()=>` .${n.COMMENT_CURSOR},.${n.COMMENT_CURSOR} *{cursor:url('${Bt}') ${kt},auto !important;}`,Ut=()=>' .report{margin:0;padding:24px;background:#fff;color:#111;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:12px;line-height:1.45;}.report-title{margin:0 0 4px;font-size:20px;}.report-meta{margin:0 0 2px;color:#555;font-size:11px;}.report-table{width:100%;margin-top:18px;border-collapse:collapse;break-inside:avoid;}.report-table caption{margin-bottom:4px;font-size:12px;font-weight:600;text-align:left;}.report-table th,.report-table td{padding:5px 8px;border:1px solid #d5d5d5;text-align:left;font-weight:400;}.report-table thead th{background:#f2f2f2;font-weight:600;}.report-table td{text-align:right;font-variant-numeric:tabular-nums;}@page{margin:14mm;}';function de(i,e,t){let o=ri(e,i);if(o)return i.adoptedStyleSheets=[...i.adoptedStyleSheets??[],o],()=>{i.adoptedStyleSheets=(i.adoptedStyleSheets??[]).filter(a=>a!==o)};let s=i.head??i;s.querySelector?.(`#${t}`)?.remove();let r=document.createElement("style");return r.id=t,r.textContent=e,s.appendChild(r),()=>r.remove()}function ri(i,e){let o=(e.defaultView??e.ownerDocument?.defaultView??globalThis).CSSStyleSheet;if(typeof o!="function"||!("adoptedStyleSheets"in e))return null;try{let s=new o;return s.replaceSync(i),s}catch{return null}}var H={metricsTitle:"Metrics",metricsOpen:"Metrics",metricsTotal:"Total comments",metricsAverageResolution:"Average resolution",metricsMedianResolution:"Median resolution",metricsReopened:"Reopened",metricsByStatus:"By status",metricsByType:"By type",metricsByPriority:"By priority",metricsOverTime:"Comments per day",metricsEmpty:"No comments to measure yet",metricsCategory:"Category",metricsCount:"Count",metricsDate:"Date",metricsExportComments:"Comments (CSV)",metricsExportMetrics:"Metrics (CSV)",metricsPrint:"Print / Save as PDF",metricsExportLabel:"Export",metricsGeneratedTemplate:"Generated {n}",metricsScope:"Scope",auditToggleTemplate:"History ({n})",auditTrailLabel:"Activity history",auditCreated:"Created the comment",auditEdited:"Edited the text",auditTagsChanged:"Updated the tags",auditPreviousResolutions:"Previous resolutions",auditResolvedInTemplate:"Resolved in {n}",commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"Shift",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",capturingScreenshot:"Capturing\u2026",inboxAriaLabel:"Comments inbox",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusInReview:"In review",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",filterByType:"Type",filterByPriority:"Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS",reactionsLabel:"Reactions",addReaction:"Add reaction",reactionToggleOn:"Add your reaction",reactionToggleOff:"Remove your reaction",reactionPickerLabel:"Choose a reaction"};var Ft={metricsTitle:"M\xE9tricas",metricsOpen:"M\xE9tricas",metricsTotal:"Comentarios totales",metricsAverageResolution:"Resoluci\xF3n media",metricsMedianResolution:"Resoluci\xF3n mediana",metricsReopened:"Reabiertos",metricsByStatus:"Por estado",metricsByType:"Por tipo",metricsByPriority:"Por prioridad",metricsOverTime:"Comentarios por d\xEDa",metricsEmpty:"A\xFAn no hay comentarios que medir",metricsCategory:"Categor\xEDa",metricsCount:"Cantidad",metricsDate:"Fecha",metricsExportComments:"Comentarios (CSV)",metricsExportMetrics:"M\xE9tricas (CSV)",metricsPrint:"Imprimir / Guardar como PDF",metricsExportLabel:"Exportar",metricsGeneratedTemplate:"Generado {n}",metricsScope:"Alcance",auditToggleTemplate:"Historial ({n})",auditTrailLabel:"Historial de actividad",auditCreated:"Cre\xF3 el comentario",auditEdited:"Edit\xF3 el texto",auditTagsChanged:"Actualiz\xF3 las etiquetas",auditPreviousResolutions:"Resoluciones anteriores",auditResolvedInTemplate:"Resuelto en {n}",commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"May\xFAs",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",capturingScreenshot:"Capturando\u2026",inboxAriaLabel:"Bandeja de comentarios",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusInReview:"En revisi\xF3n",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",filterByType:"Tipo",filterByPriority:"Prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO",reactionsLabel:"Reacciones",addReaction:"A\xF1adir reacci\xF3n",reactionToggleOn:"A\xF1adir tu reacci\xF3n",reactionToggleOff:"Quitar tu reacci\xF3n",reactionPickerLabel:"Elegir una reacci\xF3n"};var xe={en:H,es:Ft},pe="en";function zt(){let i=(navigator.language||pe).slice(0,2).toLowerCase();return i in xe?i:pe}function Gt(i){let e=xe[i];return!e||i===pe?xe[pe]:{...xe[pe],...e}}function I(i,e){return i.replace("{n}",String(e))}var si=6e4;function X(i,e){if(!Number.isFinite(i)||i<0)return"";let t=Math.floor(i/si);if(t<1)return e.durationLessThanMinute;if(t<60)return I(e.minutesAgoTemplate,t);let o=Math.floor(t/60);if(o<24){let l=t%60,c=I(e.hoursAgoTemplate,o);return l?`${c} ${I(e.minutesAgoTemplate,l)}`:c}let s=Math.floor(o/24),r=o%24,a=I(e.daysAgoTemplate,s);return r?`${a} ${I(e.hoursAgoTemplate,r)}`:a}var je=64,ai=3,li=5,ci=.6,di=.7,pi=/^(css|sc|jsx|emotion)-/i,hi=/^data-(reactid|react-|v-|svelte-)/,ui=["id","name","role","aria-label"],mi=["data-testid","name","aria-label"],We=i=>typeof CSS<"u"&&CSS.escape?CSS.escape(i):String(i).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),fi=i=>String(i).replace(/["\\]/g,"\\$&"),he=(i,e)=>{try{return e.querySelectorAll(i).length===1}catch{return!1}},jt=i=>(i||"").replace(/\s+/g," ").trim().slice(0,je),gi=i=>Mt.includes(i)||pi.test(i)?!1:!i.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),Ei=i=>[...i.classList].filter(gi),bi=i=>{let e={};for(let{name:t,value:o}of i.attributes)(ui.includes(t)||t.startsWith("data-")&&!hi.test(t))&&o&&(e[t]=o.slice(0,je));return e},Ke=i=>{let e=i.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(o=>o.tagName===i.tagName);return{index:t.indexOf(i),count:t.length}},Ci=(i,e)=>{if(!i.id)return null;let t=`#${We(i.id)}`;return he(t,e)?t:null},_i=(i,e)=>{let t=i.tagName.toLowerCase();for(let o of mi){let s=i.getAttribute(o);if(!s)continue;let r=`${t}[${o}="${fi(s)}"]`;if(he(r,e))return r}return null},Ti=(i,e)=>{let t=[],o=i;for(let s=0;s<ai&&o;s++){let r=Ei(o),a=o.tagName.toLowerCase();if(t.unshift(r.length?`${a}.${r.map(We).join(".")}`:a),s===0&&!r.length)return null;let l=t.join(" > ");if(he(l,e))return l;o=o.parentElement}return null},xi=(i,e)=>{if(i===e.body)return"body";let t=[],o=i;for(let r=0;r<li&&o;r++){if(o===e.body){t.unshift("body");break}if(o.id){let l=[`#${We(o.id)}`,...t].join(" > ");if(he(l,e))return l}let{index:a}=Ke(o);t.unshift(`${o.tagName.toLowerCase()}:nth-of-type(${a+1})`),o=o.parentElement}let s=t.join(" > ");return he(s,e)?s:null},Wt=(i,e)=>Ci(i,e)||_i(i,e)||Ti(i,e)||xi(i,e);function Kt(i){return Wt(i,i.ownerDocument)}function qt(i,e,t){let o=i.ownerDocument,{index:s,count:r}=Ke(i);return{version:1,selector:Wt(i,o),fingerprint:{tagName:i.tagName,textSnippet:jt(i.textContent),attributes:bi(i),siblingIndex:s,siblingCount:r},relativeX:e,relativeY:t}}var yi=(i,e)=>{if(!i&&!e)return 1;if(!i||!e)return 0;if(i===e)return 1;if(i.startsWith(e)||e.startsWith(i))return .8;let t=new Set(i.split(" ")),o=new Set(e.split(" ")),s=0;for(let r of t)o.has(r)&&s++;return 2*s/(t.size+o.size)},Oi=(i,e)=>{let t=Object.keys(e);if(!t.length)return 1;let o=0;for(let s of t)(i.getAttribute(s)||"").slice(0,je)===e[s]&&o++;return o/t.length},Vt=(i,e)=>{let{index:t,count:o}=Ke(i),s=Math.abs(t-e.siblingIndex),r=Math.max(e.siblingCount,o,1);return Math.max(0,1-s/r)},Ii=(i,e)=>{if(i.tagName!==e.tagName)return 0;let t=!!e.textSnippet,o=Object.keys(e.attributes||{}).length>0,s=.5,r=.3,a=.2;return o?t||(r+=s,s=0):(s+=r,r=0),!t&&!o?Vt(i,e):s*yi(jt(i.textContent),e.textSnippet)+r*Oi(i,e.attributes||{})+a*Vt(i,e)},Yt=(i,e)=>{let t=null;for(let o of i){let s=Ii(o,e);(!t||s>t.confidence)&&(t={element:o,confidence:s})}return t};function qe(i,e=document){if(i?.version!=null&&i.version>1)return null;let t=i?.fingerprint;if(!t||!t.tagName)return null;if(i.selector){let a=[];try{a=[...e.querySelectorAll(i.selector)]}catch{}let l=Yt(a,t);if(l&&l.confidence>=ci)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=Yt(s,t);return r&&r.confidence>=di?r:null}var ye="helldots-comments",Oe="helldots-pending-detail";function Ze(){try{let i=localStorage.getItem(ye);if(!i)return[];let e=JSON.parse(i);return Array.isArray(e)?e:[]}catch(i){return console.warn("HellDots: could not read stored comments",i),[]}}function Zt(i){try{return localStorage.setItem(ye,JSON.stringify(i)),!0}catch{return!1}}function Ie(i){if(Zt(i))return!0;let e=i.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=[...i],o=0;for(let{index:s}of e)if(t[s]={...t[s],contextScreenshot:null},o++,Zt(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 Je(i,e,t){let o=new Set(e.map(r=>String(r.id)));return[...i.filter(r=>!o.has(String(r.id))&&r.page!==t),...e]}var Jt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Qt=(i=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(i|=0));for(;i--;)e+=Jt[t[i]&63];return e};var Qe=()=>Qt(),P=i=>typeof i=="string"?i.trim():"",y=(i,e)=>String(i)===String(e);var Z=new Set,J=null,Re=null,Ri=i=>[...i.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')],eo=4,Ai=i=>{for(let e=i.parentElement;e;e=e.parentElement){let{overflowX:t,overflowY:o}=getComputedStyle(e);if(t!=="visible"||o!=="visible")return e.getBoundingClientRect()}return null},Si=(i,e)=>{e.classList.remove(n.INBOX_MENU_UP),e.classList.remove(n.INBOX_MENU_START);let t=Ai(e),o=Math.min(t?.bottom??1/0,window.innerHeight),s=Math.max(t?.top??0,0),r=Math.max(t?.left??0,0),a=Math.min(t?.right??1/0,window.innerWidth),{height:l,width:c,left:d}=e.getBoundingClientRect(),p=i.getBoundingClientRect(),h=p.bottom+eo+l,u=p.top-eo-l;h>o&&u>=s&&e.classList.add(n.INBOX_MENU_UP),d<r&&p.left+c<=a&&e.classList.add(n.INBOX_MENU_START)},to=(i,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(i)||i.contains(e.target),Ni=()=>{J||(J=i=>{for(let e of[...Z])to(e.menu,i)||to(e.button,i)||e.close()},document.addEventListener("mousedown",J,!0),Re=i=>{let e=[...Z].pop();if(e){if(i.key==="Escape"){i.preventDefault(),i.stopPropagation(),e.close(),e.button.focus();return}if(["ArrowDown","ArrowUp","Home","End"].includes(i.key)){let t=Ri(e.menu);if(t.length===0)return;i.preventDefault(),i.stopPropagation();let o=e.menu.getRootNode(),s=t.indexOf(o.activeElement),r;if(i.key==="Home")r=0;else if(i.key==="End")r=t.length-1;else if(s===-1)r=i.key==="ArrowDown"?0:t.length-1;else{let a=i.key==="ArrowDown"?1:-1;r=(s+a+t.length)%t.length}t[r].focus()}}},document.addEventListener("keydown",Re,!0))},vi=()=>{J&&(document.removeEventListener("mousedown",J,!0),J=null,document.removeEventListener("keydown",Re,!0),Re=null)},Ae=()=>{for(let i of[...Z])i.close()},V=(i,e)=>{let t={button:i,menu:e,close:()=>{e.style.display="none",i.setAttribute("aria-expanded","false"),Z.delete(t),Z.size===0&&vi()}},o=()=>{Ae(),e.style.display="block",Si(i,e),i.setAttribute("aria-expanded","true"),Z.add(t),Ni()},s=()=>e.style.display!=="none";return e.style.display="none",i.setAttribute("aria-expanded","false"),i.addEventListener("click",r=>{r.stopPropagation();let a=s();Ae(),a||o()}),{open:o,close:t.close,isOpen:s}};var oo=(i,e)=>P(i?.id)||i?.name||e.anonymous,et=i=>{let e=i?.reactions;return!e||typeof e!="object"?[]:ce.filter(t=>e[t]?.length>0).map(t=>({emoji:t,authors:[...e[t]]}))},tt=i=>{if(!i||typeof i!="object")return null;let e={};for(let t of ce){let o=i[t];if(!Array.isArray(o))continue;let s=[];for(let r of o){if(typeof r!="string")continue;let a=r.trim();a&&!s.includes(a)&&s.push(a)}s.length>0&&(e[t]=s)}return Object.keys(e).length>0?e:null},ot=(i,e,t)=>{if(!ce.includes(e)||!t)return!1;i.reactions||(i.reactions={});let o=i.reactions[e]||[],s=o.indexOf(t);return s>=0?o.splice(s,1):o.push(t),o.length>0?i.reactions[e]=o:delete i.reactions[e],!0},it=i=>{let e=Object.entries(i||{}).filter(([,t])=>t?.length>0);return e.length>0?Object.fromEntries(e.map(([t,o])=>[t,[...o]])):null},wi='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20.94 11.08A9 9 0 1 1 12.92 3.06"/><path d="M8.5 14.2a4.6 4.6 0 0 0 7 0"/><path d="M9 9.5h.01M15 9.5h.01"/><path d="M19 2.6v4M17 4.6h4"/></svg>',Se=({actorKey:i,strings:e,onToggle:t})=>{let o=new WeakMap,s=c=>{let d=o.get(c);if(d)for(let p of d)p.el.isConnected?p.repaint():d.delete(p)},r=(c,d)=>{t(c,d),s(c)},a=(c,{className:d,tooltip:p=!0})=>{let h=document.createElement("div");h.className=n.REACTION_TRIGGER;let u=document.createElement("button");u.type="button",u.className=d,u.dataset.action="react",p&&(u.dataset.hdTooltip=e.addReaction),u.setAttribute("aria-label",e.addReaction),u.innerHTML=wi;let m=document.createElement("div");m.className=n.REACTION_PALETTE,m.setAttribute("role","menu"),m.setAttribute("aria-label",e.reactionPickerLabel);let f=V(u,m);for(let g of ce){let E=document.createElement("button");E.type="button",E.className=n.REACTION_PALETTE_ITEM,E.setAttribute("role","menuitem"),E.dataset.reactionEmoji=g,E.textContent=g,E.setAttribute("aria-label",g),E.addEventListener("click",C=>{C.stopPropagation(),f.close(),r(c,g)}),m.appendChild(E)}return h.appendChild(u),h.appendChild(m),h};return{bar:c=>{let d=document.createElement("div");d.className=n.REACTION_BAR,d.setAttribute("role","group"),d.setAttribute("aria-label",e.reactionsLabel);let p=()=>{d.replaceChildren();let u=et(c),m=i();if(d.hidden=u.length===0,!d.hidden){for(let{emoji:f,authors:g}of u){let E=g.includes(m),C=document.createElement("button");C.type="button",C.className=n.REACTION_PILL,E&&C.classList.add(n.REACTION_PILL_MINE),C.dataset.reactionEmoji=f;let L=E?e.reactionToggleOff:e.reactionToggleOn;C.setAttribute("aria-pressed",String(E)),E||(C.dataset.hdTooltip=L),C.setAttribute("aria-label",`${L}: ${f} (${g.length})`),C.addEventListener("click",q=>{q.stopPropagation(),r(c,f)});let _=document.createElement("span");_.className=n.REACTION_PILL_EMOJI,_.textContent=f,_.setAttribute("aria-hidden","true");let N=document.createElement("span");N.className=n.REACTION_PILL_COUNT,N.textContent=String(g.length),C.appendChild(_),C.appendChild(N),d.appendChild(C)}d.appendChild(a(c,{className:n.REACTION_ADD}))}},h=o.get(c);return h||o.set(c,h=new Set),h.add({el:d,repaint:p}),p(),d},trigger:a,refresh:s}};var ue="helldotsComment",Q=(i,e=ue,t=location.href)=>{let o=new URL(t),s=i.page||o.pathname,r=s===o.pathname?o:new URL(s,o);return r.searchParams.set(e,String(i.id)),r.href},nt=(i=ue,e=location.href)=>{try{return new URL(e).searchParams.get(i)}catch{return null}};var io=["created","edited","status","classified"],no=["type","priority","tags"],Li=64,Ne=i=>typeof i=="string"?i.trim().slice(0,Li):"",ve=i=>i===null?{present:!0,value:null}:typeof i=="string"?{present:!0,value:Ne(i)}:{present:!1,value:void 0};function ro(i,e){let t=Ne(i?.name)||e.anonymous,o=P(i?.id);return o?{id:o,name:t}:{name:t}}function Y(i,e,t,o){if(!io.includes(e))return null;let s={type:e,at:new Date().toISOString(),actor:t};o?.field&&no.includes(o.field)&&(s.field=o.field);let r=ve(o?.from);r.present&&(s.from=r.value);let a=ve(o?.to);return a.present&&(s.to=a.value),Array.isArray(i.history)||(i.history=[]),i.history.push(s),s}function so(i){if(!Array.isArray(i))return null;let e=[];for(let t of i){if(!t||typeof t!="object"||!io.includes(t.type))continue;let o=Ne(t.at);if(!Number.isFinite(Date.parse(o)))continue;let s=Ne(t.actor?.name),r=P(t.actor?.id),a={type:t.type,at:o,actor:r?{id:r,name:s}:{name:s}};no.includes(t.field)&&(a.field=t.field);let l=ve(t.from);l.present&&(a.from=l.value);let c=ve(t.to);c.present&&(a.to=c.value),e.push(a)}return e.length===0?null:(e.sort((t,o)=>Date.parse(t.at)-Date.parse(o.at)),e)}function ao(i){return!Array.isArray(i)||i.length===0?null:i.map(e=>({...e,actor:{...e.actor}}))}function j(i){if(!Array.isArray(i?.history))return[];let e=[],t=null;for(let s of i.history)s.type==="status"&&(s.to==="resolved"?t=s.at:t&&(e.push({resolvedAt:t,reopenedAt:s.at,ms:0}),t=null));t&&e.push({resolvedAt:t,reopenedAt:null,ms:0});let o=Date.parse(i.createdAt);for(let s of e){let r=Date.parse(s.resolvedAt);s.ms=Number.isFinite(o)&&Number.isFinite(r)?Math.max(0,r-o):0}return e}function ee(i){if(i?.status!=="resolved")return null;let e=j(i),t=e[e.length-1];if(t&&!t.reopenedAt)return t.ms;let o=Date.parse(i.resolvedAt),s=Date.parse(i.createdAt);return!Number.isFinite(o)||!Number.isFinite(s)?null:Math.max(0,o-s)}var rt=new Set,lo=()=>{for(let i of[...rt])i(!1)},we=(i,{title:e,message:t,confirmLabel:o,cancelLabel:s})=>new Promise(r=>{let a=document.createElement("div");a.className=n.CONFIRM,a.style.zIndex=String(M.CONFIRM);let l=document.createElement("div");l.className=n.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=n.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=n.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=n.CONFIRM_ACTIONS;let h=document.createElement("button");h.type="button",h.className=n.CONFIRM_CANCEL,h.textContent=s;let u=document.createElement("button");u.type="button",u.className=n.CONFIRM_ACCEPT,u.textContent=o,p.appendChild(h),p.appendChild(u),l.appendChild(c),l.appendChild(d),l.appendChild(p),a.appendChild(l);let m=i.activeElement||document.activeElement,f=!1,g=_=>{f||(f=!0,rt.delete(g),document.removeEventListener("keydown",E,!0),a.remove(),m?.focus?.(),r(_))},E=_=>{if(_.key==="Escape"){_.stopPropagation(),_.preventDefault(),g(!1);return}if(_.key!=="Tab")return;let N=[h,u],q=i.activeElement||document.activeElement,b=N.indexOf(q);_.preventDefault(),(_.shiftKey?N[(b<=0?N.length:b)-1]:N[(b+1)%N.length]).focus()};h.addEventListener("click",()=>g(!1)),u.addEventListener("click",()=>g(!0));let C=!1;a.addEventListener("mousedown",_=>{C=_.target===a,_.stopPropagation()}),a.addEventListener("click",_=>{_.target===a&&C&&g(!1),C=!1}),rt.add(g),document.addEventListener("keydown",E,!0),(i.body||i).appendChild(a),h.focus()});var co='<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>',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="20 6 9 17 4 12"/></svg>',Di='<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>',oe=i=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(i).catch(()=>{});let e=document.createElement("textarea");e.value=i,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},D=(i,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,in_review:e.statusInReview,resolved:e.statusResolved})[i]||e.statusOpen,v=(i,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[i]||e.unset,w=(i,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[i]||e.unset,te=({action:i,options:e,value:t,colorOf:o,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=n.INBOX_ACTION_BTN,l&&d.classList.add(n.INBOX_ACTION_BTN_LABELED),d.dataset.action=i,d.setAttribute("aria-haspopup","true");let p=document.createElement("span");p.className=n.INBOX_STATUS_DOT,d.appendChild(p);let h=null;l&&(h=document.createElement("span"),h.className=n.INBOX_ACTION_LABEL,d.appendChild(h));let u=document.createElement("div");u.className=n.INBOX_MENU,u.setAttribute("role","menu");let m=V(d,u),f=t,g=()=>{let E=`${r}: ${s(f)}`;p.style.backgroundColor=o(f),d.dataset.hdTooltip=E,d.setAttribute("aria-label",E),h&&(h.textContent=s(f)),u.querySelectorAll("[data-picker-option]").forEach(C=>{let L=C.dataset.pickerOption,_=L===""?null:L;C.setAttribute("aria-checked",String(_===f))})};for(let E of e){let C=document.createElement("button");C.type="button",C.className=n.INBOX_MENU_ITEM,C.dataset.pickerOption=E===null?"":E,C.setAttribute("role","menuitemradio");let L=document.createElement("span");L.className=n.INBOX_STATUS_DOT,L.style.backgroundColor=o(E),C.appendChild(L),C.appendChild(document.createTextNode(s(E))),C.addEventListener("click",_=>{_.stopPropagation(),m.close(),E!==f&&(f=E,a(E),g())}),u.appendChild(C)}return c.appendChild(d),c.appendChild(u),g(),c},st=({label:i,tooltip:e,items:t})=>{let o=document.createElement("div");o.style.position="relative";let s=document.createElement("button");s.type="button",s.className=n.INBOX_ACTION_BTN,s.dataset.action="menu",e&&(s.dataset.hdTooltip=e),s.setAttribute("aria-label",i),s.innerHTML=Di;let r=document.createElement("div");r.className=n.INBOX_MENU,r.setAttribute("role","menu");let a=V(s,r);for(let l of t){let c=document.createElement("button");c.type="button",c.className=n.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 we(p,l.confirm()))return}l.onSelect()}),r.appendChild(c)}return o.appendChild(s),o.appendChild(r),o},Le=(i,{strings:e,reactions:t,onCopy:o,onCopyLink:s,onEdit:r,onSetStatus:a,onSetType:l,onSetPriority:c,onDelete:d})=>{let p=document.createElement("div");p.className=n.INBOX_CARD_ACTIONS;let h=document.createElement("div");h.className=n.ACTIONS_GROUP;let u=document.createElement("div");u.className=`${n.ACTIONS_GROUP} ${n.ACTIONS_GROUP_END}`,p.appendChild(h),p.appendChild(u),t&&u.appendChild(t.trigger(i,{className:n.INBOX_ACTION_BTN}));let m=document.createElement("button");return m.type="button",m.className=n.INBOX_ACTION_BTN,m.dataset.action="copy",m.dataset.hdTooltip=e.copyAgentContext,m.setAttribute("aria-label",e.copyAgentContext),m.innerHTML=co,m.addEventListener("click",f=>{f.stopPropagation(),o(i),m.innerHTML=Mi,m.dataset.hdTooltip=e.copied,setTimeout(()=>{m.innerHTML=co,m.dataset.hdTooltip=e.copyAgentContext},1500)}),u.appendChild(m),h.appendChild(te({action:"status",options:S,value:i.status||"open",colorOf:f=>F[f]||F.open,labelOf:f=>D(f,e),tooltipLabel:e.statusLabel,onSelect:f=>a(i,f),showLabel:!0})),h.appendChild(te({action:"type",options:[null,...R],value:i.type||null,colorOf:f=>z[f]||"transparent",labelOf:f=>v(f,e),tooltipLabel:e.typeLabel,onSelect:f=>l?.(i,f),showLabel:!0})),h.appendChild(te({action:"priority",options:[null,...A],value:i.priority||null,colorOf:f=>G[f]||"transparent",labelOf:f=>w(f,e),tooltipLabel:e.priorityLabel,onSelect:f=>c?.(i,f),showLabel:!0})),u.appendChild(st({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>s?.(i)},{label:e.editComment,onSelect:()=>r?.(i)},{label:e.deleteComment,onSelect:()=>d(i),confirm:()=>({title:e.confirmDeleteCommentTitle,message:i.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),p};var ie=({value:i,strings:e,onInput:t,onSave:o,onCancel:s})=>{let r=document.createElement("div");r.className=n.EDITOR;let a=document.createElement("textarea");a.className=n.EDITOR_INPUT,a.value=i,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=n.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=n.EDITOR_CANCEL,c.textContent=e.editCancel;let d=document.createElement("button");d.type="button",d.className=n.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(),o(a.value))}),c.addEventListener("click",h=>{h.stopPropagation(),s()}),d.addEventListener("click",h=>{h.stopPropagation(),d.disabled||o(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},Me=(i,e)=>we(i,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var Bi=(i,e)=>{let t=Date.now()-new Date(i).getTime(),o=Math.floor(t/6e4),s=Math.floor(t/36e5),r=Math.floor(t/864e5);return o<1?e.justNow:o<60?I(e.minutesAgoTemplate,o):s<24?I(e.hoursAgoTemplate,s):I(e.daysAgoTemplate,r)},ho=(i,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(i)),me=(i,e,t,o,s=null)=>{let r=document.createElement("div");r.className=n.THREAD_META;let a=document.createElement("span");a.className=n.THREAD_AUTHOR,a.textContent=i||t.anonymous;let l=document.createElement("span");return l.className=n.THREAD_TIME,l.textContent=Bi(e,t),l.dataset.fullDate=ho(e,o),r.appendChild(a),r.appendChild(l),s&&r.appendChild(at(s,t,o)),r},at=(i,e,t)=>{let o=document.createElement("span");return o.className=n.THREAD_EDITED,o.textContent=e.editedMark,o.dataset.fullDate=e.editedAtPrefix+ho(i,t),o},lt=()=>/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),ct=(i,e)=>{let t=lt(),o={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:t?"\u21E7":e.modifierShift},s=o[i.shortcutModifier]||o.alt,r=i.shortcutKey?.toUpperCase()||"C";return`${s} + ${r}`},De='<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>',ki='<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>',Pi='<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>',$i='<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>',Hi='<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:i,inputTag:e="textarea",inputClassName:t,inputId:o,inputPlaceholder:s,submitBtnId:r,fileInputId:a},l)=>{let c=document.createElement("div");c.className=i;let d=document.createElement(e);o&&(d.id=o),t&&(d.className=t),d.placeholder=s,d.setAttribute("aria-label",s),e==="input"&&(d.type="text");let p=document.createElement("div");p.className=n.SCREENSHOTS_CONTAINER;let h=document.createElement("div");h.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=ki;let m=document.createElement("input");m.type="file",a&&(m.id=a),m.accept="image/*",m.style.display="none";let f=document.createElement("button");return r&&(f.id=r),f.className=n.THREAD_SUBMIT,f.type="button",f.setAttribute("aria-label",l.send),f.innerHTML=Pi,h.appendChild(u),h.appendChild(m),h.appendChild(f),c.appendChild(d),c.appendChild(p),c.appendChild(h),{container:c,inputEl:d,screenshotsContainer:p,attachBtn:u,fileInput:m,submitBtn:f}},po=(i,e,t,o)=>{let s=document.createElement("div");s.className=n.TOOLBAR_ACTION_WRAPPER;let r=document.createElement("div");r.className=n.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>r.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${n.TOOLBAR_ACTION_BTN} ${i}`,a.setAttribute("aria-label",o),a.innerHTML=e,s.appendChild(r),s.appendChild(a),s},uo=(i={},e=H)=>{let t=document.createElement("div");t.id=x.TOOLBAR;let o=document.createElement("div");o.className=n.TOOLBAR_ACTIONS;let s=document.createElement("span");s.className=n.TOOLBAR_TEXT,s.textContent=e.toolbarComment;let r=document.createElement("span");r.className=n.SHORTCUT_HINT,r.textContent=ct(i,e);let a=po(n.TOOLBAR_COMMENT_BTN,$i,[s,r],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=po(n.TOOLBAR_MENU_BTN,Hi,[l],e.toolbarInbox);return o.appendChild(a),o.appendChild(c),t.appendChild(o),t},dt=(i,e,{includeStatus:t=!1,includeClassification:o=!0}={})=>{let s=document.createElement("div");s.className=n.INBOX_BADGES;let r=(a,l,c)=>{let d=document.createElement("span");d.className=`${n.BADGE} ${l}`,d.textContent=a,c&&(d.style.borderColor=c),s.appendChild(d)};if(t){let a=i.status||"open";r(D(a,e),n.BADGE_STATUS,F[a])}o&&i.type&&r(v(i.type,e),n.BADGE_TYPE,z[i.type]),o&&i.priority&&r(w(i.priority,e),n.BADGE_PRIORITY,G[i.priority]);for(let a of i.tags||[])r(a,n.BADGE_TAG,null);if(i.status==="resolved"){let a=ee(i),l=a===null?"":X(a,e);r(I(e.resolvedInTemplate,l||"\u2014"),n.BADGE_DURATION,null)}return s.children.length?s:null},Xi=i=>{let e=document.createElement("div");e.className=n.CLASSIFY_ROW;let t=null,o=null,s=()=>{e.replaceChildren(),e.appendChild(te({action:"type",options:[null,...R],value:null,colorOf:r=>z[r]||"transparent",labelOf:r=>v(r,i),tooltipLabel:i.typeLabel,onSelect:r=>t=r,showLabel:!0})),e.appendChild(te({action:"priority",options:[null,...A],value:null,colorOf:r=>G[r]||"transparent",labelOf:r=>w(r,i),tooltipLabel:i.priorityLabel,onSelect:r=>o=r,showLabel:!0}))};return s(),{container:e,getType:()=>t,getPriority:()=>o,reset:()=>{t=null,o=null,s()}}},mo=(i=H)=>{let e=document.createElement("div");e.id=x.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",i.commentBoxAriaLabel);let{container:t}=Be({areaClassName:n.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:x.COMMENT_INPUT,inputPlaceholder:i.commentPlaceholder,submitBtnId:x.SUBMIT_COMMENT,fileInputId:x.ATTACH_IMAGE_INPUT},i),o=Xi(i);return e.appendChild(o.container),e.appendChild(t),e.style.display="none",e.classify=o,e},W=i=>String(i).replace(/[\\"]/g,"\\$&"),fo=i=>`[data-comment-id="${W(i)}"]`,pt=i=>i.screenshots||(i.screenshot?[i.screenshot]:[]),ne=(i,e,{strings:t,onShow:o,rerender:s,pending:r=0})=>{i.innerHTML="",i.classList.toggle(n.ACTIVE,e.length>0||r>0),e.forEach((a,l)=>{let c=document.createElement("div");c.className=n.SCREENSHOT_ITEM;let d=document.createElement("img");d.className=n.SCREENSHOT_IMG,d.src=a,d.alt=t.attachedScreenshot,go(d,()=>o(a));let p=document.createElement("button");p.type="button",p.className=n.SCREENSHOT_REMOVE,p.setAttribute("aria-label",t.removeScreenshot),p.innerHTML="&times;",p.onclick=h=>{h.stopPropagation(),e.splice(l,1),s()},c.appendChild(d),c.appendChild(p),i.appendChild(c)});for(let a=0;a<r;a++){let l=document.createElement("div");l.className=`${n.SCREENSHOT_ITEM} ${n.SCREENSHOT_PENDING}`,l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),l.textContent=t.capturingScreenshot,i.appendChild(l)}},Ui=i=>new Promise(e=>{let t=new FileReader;t.onload=o=>e(o.target.result),t.onerror=()=>e(null),t.readAsDataURL(i)}),re=(i,e,t,o)=>{i.addEventListener("change",async s=>{let r=s.target.files[0];if(!r||r.type&&!r.type.startsWith("image/")||e().length>=le)return;let a=Ui(r);i.value="";let l=await a;if(!l)return;let c=e();if(c.length>=le||(c.push(l),t(),!o))return;let d=await o(l),p=c.indexOf(l);p!==-1&&(c[p]=d,t())})},$=(i,e)=>{i.querySelectorAll(`.${n.SCREENSHOT_IMG}`).forEach(t=>{go(t,()=>e(t.src))})},go=(i,e)=>{i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.addEventListener("click",t=>{t.stopPropagation(),e()}),i.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())})},Eo=(i,e=H)=>{let t=document.createElement("div");return t.className=n.CIRCLE,t.dataset.commentId=i.id,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${i.text}`),t.style.cssText=`
5
5
  position: absolute;
6
6
  pointer-events: auto;
7
- `,t},ue=(i,e)=>{let t=document.createElement("div");return t.className=n.SCREENSHOTS_CONTAINER,t.classList.add(n.ACTIVE),i.forEach(o=>{let s=document.createElement("div");s.className=n.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=n.SCREENSHOT_IMG,r.src=o,r.alt=e.attachedScreenshot,s.appendChild(r),t.appendChild(s)}),t},pi=(i,e=H,t)=>{let o=document.createElement("div");o.className=n.TOOLTIP,o.dataset.for=i.id,o.setAttribute("role","dialog"),o.setAttribute("aria-label",e.tooltipAriaLabel);let s=document.createElement("div");s.className=n.THREAD_HEADER;let r=he(i.author,i.createdAt,e,t,i.editedAt),a=document.createElement("button");a.type="button",a.className=n.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="&times;",s.appendChild(r),s.appendChild(a);let l=document.createElement("div");l.className=n.THREAD_BODY,l.textContent=i.text,o.appendChild(s),o.appendChild(l);let c=at(i,e,{includeStatus:!0});c&&o.appendChild(c);let d=lt(i);d.length>0&&o.appendChild(ue(d,e));let p=i.replies?.length||0;if(p>0){let h=document.createElement("div");h.className=n.TOOLTIP_REPLY_COUNT,h.textContent=p===1?e.replyCountOne:I(e.replyCountTemplate,p),o.appendChild(h)}return o},me=(i,e=H,t,{onDelete:o,onEdit:s,editing:r=null,reactions:a=null}={})=>{let l=document.createElement("div");l.className=n.THREAD_REPLY,l.dataset.replyId=String(i.id);let c=he(i.author,i.timestamp,e,t,i.editedAt),d=[];s&&d.push({label:e.editReply,onSelect:()=>s(i)}),o&&d.push({label:e.deleteReply,onSelect:()=>o(i,l),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})});let p=document.createElement("div");p.className=`${n.ACTIONS_GROUP} ${n.THREAD_REPLY_ACTIONS}`,a&&p.appendChild(a.trigger(i,{className:n.INBOX_ACTION_BTN})),d.length>0&&p.appendChild(ot({label:e.replyOptions,items:d})),p.children.length>0&&c.appendChild(p);let h;r?h=oe({value:r.draft,strings:e,onInput:r.onInput,onSave:r.onSave,onCancel:r.onCancel}):(h=document.createElement("div"),h.className=n.THREAD_BODY,h.textContent=i.text),l.appendChild(c),l.appendChild(h);let u=lt(i);return u.length>0&&l.appendChild(ue(u,e)),a&&l.appendChild(a.bar(i)),l},hi=(i,e=H,t,{onDeleteReply:o,onEditReply:s,reactions:r=null}={})=>{let a=document.createElement("div");a.className=n.THREAD_POPOVER,a.dataset.for=i.id,a.setAttribute("role","dialog"),a.setAttribute("aria-label",e.popoverAriaLabel);let l=document.createElement("div");l.className=n.THREAD_HEADER;let c=he(i.author,i.createdAt,e,t,i.editedAt),d=document.createElement("button");d.type="button",d.className=n.CLOSE_TOOLTIP,d.setAttribute("aria-label",e.close),d.innerHTML="&times;",l.appendChild(c),l.appendChild(d);let p=document.createElement("div");p.className=n.THREAD_BODY,p.textContent=i.text;let h=document.createElement("div");h.className=n.THREAD_REPLIES,i.replies&&i.replies.forEach(g=>{h.appendChild(me(g,e,t,{onDelete:o,onEdit:s,reactions:r}))});let{container:u}=De({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=n.THREAD_SCROLL,a.appendChild(l),m.appendChild(p);let f=lt(i);return f.length>0&&m.appendChild(ue(f,e)),r&&m.appendChild(r.bar(i)),m.appendChild(h),a.appendChild(m),a.appendChild(u),a};var Pe=(i,{strings:e,onShowLightbox:t,collapsible:o=!1,expanded:s=!1,onToggle:r})=>{let{context:a,contextScreenshot:l}=i;if(!a&&!l)return null;let c=document.createElement("div");c.className=n.CONTEXT_BLOCK;let d=document.createElement("div");if(d.className=n.CONTEXT_BODY,o){let p=document.createElement("button");p.type="button",p.className=n.CONTEXT_TOGGLE,p.setAttribute("aria-expanded",String(s)),p.innerHTML=`<span>${e.contextSection}</span>${Be}`,d.style.display=s?"":"none",p.addEventListener("click",h=>{h.stopPropagation();let u=p.getAttribute("aria-expanded")==="true";p.setAttribute("aria-expanded",String(!u)),d.style.display=u?"none":"",r?.(!u)}),c.appendChild(p)}else{let p=document.createElement("div");p.className=n.CONTEXT_TITLE,p.textContent=e.contextSection,c.appendChild(p)}if(l){let p=document.createElement("div");p.className=n.CONTEXT_SCREENSHOT_CAPTION,p.textContent=e.autoScreenshotLabel,d.appendChild(p);let h=document.createElement("img");h.className=n.SCREENSHOT_IMG,h.src=l,h.alt=e.autoScreenshotLabel,d.appendChild(h),$(d,t)}if(a){let p=(m,f)=>{if(!f)return;let g=document.createElement("div");g.className=n.CONTEXT_ROW;let E=document.createElement("span");E.textContent=m;let b=document.createElement("span");b.textContent=f,g.appendChild(E),g.appendChild(b),d.appendChild(g)},h=m=>m?`${m.width}\xD7${m.height}`:"",u=m=>m?.name?`${m.name} ${m.version||""}`.trim():"";p(e.contextUrl,a.url),p(e.contextViewport,h(a.viewport)),p(e.contextScreen,h(a.screen)),p(e.contextBrowser,u(a.browser)),p(e.contextOs,u(a.os))}return c.appendChild(d),c};var No=i=>{let e=[...i.attributes].map(({name:t,value:o})=>`${t}="${o}"`).join(" ");return`<${i.tagName.toLowerCase()}${e?` ${e}`:""}>`},vo=i=>{if(!i?.tagName)return"(unknown)";let e=Object.entries(i.attributes||{}).map(([t,o])=>`${t}="${o}"`).join(" ");return`<${i.tagName.toLowerCase()}${e?` ${e}`:""}>`},Lo=i=>{let e=[],t=i;for(;t&&t!==document.documentElement;){let o=t.tagName.toLowerCase(),s=t.id?`#${t.id}`:"",r=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${o}${s}${r}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function ke(i,{viewportWidth:e,viewportHeight:t,strings:o}){let s=i.anchor,r=s?.fingerprint,a=i.container?.isConnected?i.container:null,l=i.hidden?"hidden":i.anchorState,c=a?No(a):vo(r),d=a?Lo(a):"(unavailable)",p=i.context?.viewport,h=p?.width??e,u=p?.height??t,m=[`Page: ${i.page}`,`Viewport: ${h}x${u}`,`Anchor state: ${l}`,`Status: ${i.status||"open"}`,`Selector: ${s?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${d}`,`Nearby text: "${r?.textSnippet??""}"`,`Comment by ${i.author} (${i.createdAt}):`,`"${i.text}"`];i.type&&m.push(`Type: ${i.type}`),i.priority&&m.push(`Priority: ${i.priority}`),i.tags?.length&&m.push(`Tags: ${i.tags.join(", ")}`);let f=i.context;if(f&&(f.url&&m.push(`URL: ${f.url}`),f.screen&&m.push(`Screen: ${f.screen.width}x${f.screen.height}`),f.browser?.name&&m.push(`Browser: ${`${f.browser.name} ${f.browser.version||""}`.trim()}`),f.os?.name&&m.push(`OS: ${`${f.os.name} ${f.os.version||""}`.trim()}`)),o&&i.status==="resolved"&&i.resolvedAt){let E=X(new Date(i.resolvedAt).getTime()-new Date(i.createdAt).getTime(),o);E&&m.push(`Resolution time: ${E}`)}let g=i.replies||[];if(g.length>0){m.push(`Replies (${g.length}):`);for(let E of g)m.push(`- ${E.author}: "${E.text}"`)}return m.join(`
8
- `)}var fe=(i,e)=>{let t=e.getBoundingClientRect(),o=t.left+t.width/2,s=t.top+t.height/2,r=D,a=r/2+10,l=i.getBoundingClientRect(),c=l.width||400,d=o+a;d+c>window.innerWidth&&(d=o-a-c),d=Math.min(d,window.innerWidth-c-10),d=Math.max(10,d),i.style.left=`${d}px`;let p=10,h=s-r/2,u=window.innerHeight-p-h;l.height>u?(i.style.top="auto",i.style.bottom=`${p}px`):(i.style.bottom="auto",i.style.top=`${Math.max(p,h)}px`)},ui=i=>{let e=i.getBoundingClientRect(),t=Math.max(10,(window.innerWidth-(e.width||400))/2),o=Math.max(10,(window.innerHeight-e.height)/2);i.style.left=`${t}px`,i.style.bottom="auto",i.style.top=`${o}px`},$e=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(`.${n.THREAD_SCROLL} > .${n.THREAD_BODY}, .${n.THREAD_SCROLL} > .${n.EDITOR}`):t.querySelector(`.${n.THREAD_REPLY}[data-reply-id="${W(e)}"]`)?.querySelector(`.${n.THREAD_BODY}, .${n.EDITOR}`)||null:null}refreshCommentViews(e,t=null){if(this.active?.dataset.for!==String(e))return;let o=this.deps.findComment(e);if(!o)return;let s=t==null?o:(o.replies||[]).find(l=>O(l.id,t));if(!s)return;let r=document.createElement("div");r.className=n.THREAD_BODY,r.textContent=s.text,this._bodyEl(t)?.replaceWith(r);let a=t==null?this.active.querySelector(`.${n.THREAD_META}`):this.active.querySelector(`.${n.THREAD_REPLY}[data-reply-id="${W(t)}"]`)?.querySelector(`.${n.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${n.THREAD_EDITED}`)){let l=nt(s.editedAt,this.deps.strings,this.deps.locale),c=a.querySelector(`.${n.THREAD_REPLY_ACTIONS}`);c?a.insertBefore(l,c):a.appendChild(l)}}isEditing(){return this.editing!=null}editorDirty(){if(!this.editing)return!1;let{commentId:e,replyId:t,draft:o}=this.editing,s=this.deps.findComment(e),r=t==null?s:(s?.replies||[]).find(a=>O(a.id,t));return o.trim()!==String(r?.text||"").trim()}async releaseEditor(){if(!this.editing)return!0;if(this.editorDirty()){let t=this.deps.shadowRoot;if(!await Me(t,this.deps.strings))return!1}let{replyId:e}=this.editing;return this.editing=null,this._restoreBody(e),!0}_restoreBody(e){let t=this.deps.findComment(this.active?.dataset.for);if(!t)return;let o=e==null?t:(t.replies||[]).find(r=>O(r.id,e));if(!o)return;let s=document.createElement("div");s.className=n.THREAD_BODY,s.textContent=o.text,this._bodyEl(e)?.replaceWith(s)}async startEditing(e,t=null){if(!await this.releaseEditor())return;let o=this.deps.findComment(e),s=t==null?o:(o?.replies||[]).find(a=>O(a.id,t));if(!s)return;this.editing={commentId:e,replyId:t,draft:s.text};let r=oe({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:o,locale:s}=this.deps;this.deps.removeTooltip(t.id),e?.classList.add(n.CIRCLE_ACTIVE),this._activeCircle=e||null;let r=(C,y)=>{this.deps.actions.deleteReply(t.id,C.id)&&(y.remove(),this.deps.refreshInbox())},a=C=>this.startEditing(t.id,C.id),l=Re({actorKey:this.deps.actorKey,strings:o,onToggle:(C,y)=>C===t?this.deps.actions.toggleCommentReaction(t.id,y):this.deps.actions.toggleReplyReaction(t.id,C.id,y)}),c=hi(t,o,s,{onDeleteReply:r,onEditReply:a,reactions:l});this.deps.shadowRoot.appendChild(c);let d=c.querySelector(`.${n.THREAD_HEADER}`),p=we(t,{strings:o,reactions:l,onCopy:C=>ie(ke(C,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:o})),onCopyLink:C=>ie(Q(C,this.deps.linkParam())),onEdit:C=>this.startEditing(C.id),onSetStatus:(C,y)=>this.deps.actions.setStatus(C.id,y),onSetType:(C,y)=>this.deps.actions.setType(C.id,y),onSetPriority:(C,y)=>this.deps.actions.setPriority(C.id,y),onDelete:C=>{this.close(),this.deps.actions.deleteComment(C.id),this.deps.refreshInbox()}}),h=document.createElement("div");h.className=n.THREAD_ACTIONS_ROW,h.appendChild(p),d.insertAdjacentElement("afterend",h);let u=c.querySelector(`.${n.THREAD_SCROLL} > .${n.SCREENSHOTS_CONTAINER}`);u&&$(u,C=>this.deps.onShowLightbox(C));let m=Pe(t,{strings:o,onShowLightbox:C=>this.deps.onShowLightbox(C),collapsible:!0});m&&c.querySelector(`.${n.THREAD_REPLIES}`).before(m),setTimeout(()=>{e?fe(c,e):ui(c)},10),c.querySelector(`.${n.CLOSE_TOOLTIP}`).addEventListener("click",async C=>{C.stopPropagation(),!(this.editing&&!await this.releaseEditor())&&this.close()});let f=c.querySelector(`.${n.THREAD_INPUT}`),g=c.querySelector(`.${n.THREAD_SUBMIT}`),E=c.querySelector(`.${n.THREAD_INPUT_AREA} .${n.ATTACH_IMAGE_BTN}`),b=c.querySelector(`.${n.THREAD_INPUT_AREA} input[type="file"]`),w=c.querySelector(`.${n.THREAD_INPUT_AREA} .${n.SCREENSHOTS_CONTAINER}`),_=[],N=()=>{ne(w,_,{strings:o,onShow:C=>this.deps.onShowLightbox(C),rerender:()=>N()})};E.addEventListener("click",()=>{b.click()}),re(b,()=>_,N);let q=()=>{let C=f.value.trim();if(!C&&_.length===0)return;let y=this.deps.actions.addReply(t,C,_.length>0?[..._]:[]),wi=c.querySelector(`.${n.THREAD_REPLIES}`),bt=me(y,o,s,{onDelete:r,onEdit:a,reactions:l});wi.appendChild(bt),$(bt,Mi=>this.deps.onShowLightbox(Mi));let Ue=c.querySelector(`.${n.THREAD_SCROLL}`);Ue&&(Ue.scrollTop=Ue.scrollHeight),f.value="",_=[],N(),f.focus()};g.addEventListener("click",q),f.addEventListener("keydown",C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),q())}),this.active=c,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(c)),setTimeout(()=>f.focus(),50),this._armClickTimer=setTimeout(()=>{this._armClickTimer=null,this._clickHandler=C=>{let y=C.composedPath()[0]||C.target;if(!c.contains(y)&&!e?.contains(y)&&!this.deps.isInsideLightbox(y)){if(this.editorDirty())return;this.close()}},document.addEventListener("mousedown",this._clickHandler)},0)}close(){this.deps.shadowRoot?.querySelectorAll(`.${n.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(n.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?fe(e,this._activeCircle):ui(e))}syncToMarker(){let e=this.active,t=this._activeCircle;if(!e||!t)return;let o=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&o.bottom>0&&o.right>0&&o.top<window.innerHeight&&o.left<window.innerWidth)){e.style.display="none";return}e.style.display="",fe(e,t)}};var mi=150,ct=(i,e)=>Math.max(0,Math.min(i,e)),He=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=di(e,this.deps.strings);this.deps.wireMarker(t,e),this.deps.container.appendChild(t),this.circles.set(String(e.id),t),this.updatePosition(e,t),this.createResizeObserver(e,t)}circleOf(e){return this.circles.get(String(e))??null}remove(e){this.cleanupResizeObserver(e),this.circles.get(String(e))?.remove(),this.circles.delete(String(e))}clear(){this.resizeObservers.forEach(({observer:e})=>e?.disconnect()),this.resizeObservers.clear(),this.circles.forEach(e=>e.remove()),this.circles.clear()}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let o=e.container.getBoundingClientRect(),s=o.width,r=o.height;if(s<=0||r<=0)return null;let a=e.relativeX*s,l=e.relativeY*r,c=ct(a,s),d=ct(l,r),p=c/s,h=d/r;return{absoluteX:c,absoluteY:d,relativeX:p,relativeY:h,containerWidth:s,containerHeight:r,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 r=document.elementsFromPoint(t,o).find(c=>c.tagName.toLowerCase()!==P.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 o=e.getBoundingClientRect();return o.width>=window.innerWidth*.5&&o.height>=window.innerHeight*.5}_computeMarkerState(e,t,{checkOcclusion:o=!0}={}){if(e.status==="resolved")return{kind:"resolved"};let s=this.validateAndCalculatePosition(e,t);if(s&&!this._isAnchorTargetVisible(e)&&(s=null),!s)return e.container?{kind:"hidden"}:{kind:"noop"};let r=D/2,a=s.containerLeft+s.absoluteX+r,l=s.containerTop+s.absoluteY+r;return o&&(e._occluded=this._isMarkerOccluded(e,a,l)),e._occluded?{kind:"hidden"}:{kind:"visible",viewportX:a,viewportY:l,relativeX:s.relativeX,relativeY:s.relativeY}}_applyMarkerState(e,t,o){if(o.kind==="resolved")return t&&(t.style.display="none"),!1;if(o.kind==="noop")return!1;let s=e.hidden===!0;return o.kind==="hidden"?(e.hidden=!0,t.style.display="none",this.deps.onMarkerHidden(e),!s):(e.hidden=!1,t.style.display="",t.style.left=`${o.viewportX}px`,t.style.top=`${o.viewportY}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=o.relativeX,e.relativeY=o.relativeY,s)}updatePosition(e,t=this.circles.get(String(e.id))){if(!t)return;let o=this._computeMarkerState(e,t);this._applyMarkerState(e,t,o)&&this.deps.onVisibilityFlip()}_updateAllPositions(){let e=Date.now(),t=e-this._lastOcclusionPass>=mi;t?this._lastOcclusionPass=e:this._armOcclusionTrailingPass();let o=[];for(let r of this.deps.getComments()){let a=this.circles.get(String(r.id));a&&o.push([r,a,this._computeMarkerState(r,a,{checkOcclusion:t})])}let s=!1;for(let[r,a,l]of o)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()},mi)}scheduleUpdate(){this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.enabled&&this._updateAllPositions(),this.deps.onAfterPass()}))}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let o=new ResizeObserver(s=>{if(this.enabled)for(let r of s)r.target===e.container&&this.updatePosition(e,t)});o.observe(e.container),this.resizeObservers.set(String(e.id),{circle:t,observer:o,container:e.container})}cleanupResizeObserver(e){let t=String(e);if(this.resizeObservers.has(t)){let{circle:o,observer:s}=this.resizeObservers.get(t);s&&s.disconnect(),o&&o.parentNode&&o.parentNode.removeChild(o),this.resizeObservers.delete(t)}}scrollMarkerIntoView(e){let t=this._markerViewportY(e);t!=null&&window.scrollTo({top:Math.max(0,window.scrollY+t-window.innerHeight/2)})}_markerViewportY(e){let t=e.container;if(!t?.isConnected)return null;let o=t.getBoundingClientRect();if(o.height<=0)return null;let s=ct(e.relativeY*o.height,o.height);return o.top+s+D/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 gi=(i,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(i)),wo={status:i=>[i.statusLabel,e=>B(e,i)],type:i=>[i.typeLabel,e=>v(e,i)],priority:i=>[i.priorityLabel,e=>L(e,i)]},fi=(i,e,t)=>{let o=wo[i];if(!o)return"";let[s,r]=o(t);return`${s}: ${r(e.from??null)} \u2192 ${r(e.to??null)}`},Mo=(i,e)=>{switch(i.type){case"created":return e.auditCreated;case"edited":return e.auditEdited;case"status":return fi("status",i,e);case"classified":return i.field==="tags"?e.auditTagsChanged:fi(i.field,i,e);default:return""}},Bo=(i,e,t)=>{let o=document.createElement("li");o.className=n.AUDIT_ROW;let s=document.createElement("span");s.className=n.AUDIT_ACTION,s.textContent=Mo(i,e);let r=document.createElement("span");r.className=n.AUDIT_ACTOR,r.textContent=i.actor?.name||e.anonymous;let a=document.createElement("time");return a.className=n.AUDIT_TIME,a.dateTime=i.at,a.textContent=gi(i.at,t),o.append(s,r,a),o},Do=(i,e,t)=>{let o=j(i).filter(l=>l.reopenedAt);if(o.length===0)return null;let s=document.createElement("div");s.className=n.AUDIT_RESOLUTIONS,s.dataset.auditResolutions="";let r=document.createElement("h4");r.className=n.AUDIT_HEADING,r.textContent=e.auditPreviousResolutions,s.appendChild(r);let a=document.createElement("ul");a.className=n.AUDIT_LIST;for(let l of o){let c=document.createElement("li");c.className=n.AUDIT_ROW;let d=document.createElement("span");d.className=n.AUDIT_ACTION,d.textContent=I(e.auditResolvedInTemplate,X(l.ms,e)||"\u2014");let p=document.createElement("time");p.className=n.AUDIT_TIME,p.dateTime=l.resolvedAt,p.textContent=gi(l.resolvedAt,t),c.append(d,p),a.appendChild(c)}return s.appendChild(a),s};function Ei(i,{strings:e,locale:t,open:o,onToggle:s}){let r=i?.history;if(!Array.isArray(r)||r.length===0)return null;let a=document.createElement("div");a.className=n.AUDIT_BLOCK;let l=document.createElement("button");l.type="button",l.className=n.AUDIT_TOGGLE,l.setAttribute("aria-expanded",String(o)),l.textContent=I(e.auditToggleTemplate,r.length);let c=document.createElement("div");c.className=n.AUDIT_BODY,c.hidden=!o;let d=document.createElement("ul");d.className=n.AUDIT_LIST,d.setAttribute("aria-label",e.auditTrailLabel);for(let h of[...r].reverse())d.appendChild(Bo(h,e,t));c.appendChild(d);let p=Do(i,e,t);return p&&c.appendChild(p),l.addEventListener("click",()=>{let h=l.getAttribute("aria-expanded")!=="true";l.setAttribute("aria-expanded",String(h)),c.hidden=!h,s?.(h)}),a.append(l,c),a}var K="unset",Po=36e5,dt=(i,e)=>{let t={};for(let o of i)t[o]=0;return e&&(t[e]=0),t},ko=i=>{if(i.length===0)return null;let e=Math.floor(i.length/2);return i.length%2?i[e]:(i[e-1]+i[e])/2};function se(i){let e=Array.isArray(i)?i:[],t=dt(S),o=dt(A,K),s=dt(R,K),r=new Map,a=[],l=0;for(let d of e){let p=S.includes(d.status)?d.status:"open";t[p]++,o[A.includes(d.type)?d.type:K]++,s[R.includes(d.priority)?d.priority:K]++;let h=String(d.createdAt||"").slice(0,10);h&&r.set(h,(r.get(h)||0)+1);let u=ee(d);u!==null&&a.push(u),j(d).length>1&&l++}a.sort((d,p)=>d-p);let c=a.reduce((d,p)=>d+p,0);return{total:e.length,byStatus:t,byType:o,byPriority:s,overTime:[...r.entries()].sort(([d],[p])=>d<p?-1:1).map(([d,p])=>({date:d,count:p})),resolution:{resolvedCount:a.length,averageMs:a.length?c/a.length:null,medianMs:ko(a),reopenedCount:l}}}var ae=i=>i==null?null:Math.round(i/Po*10)/10;var Ci="rgba(255,255,255,0.42)",bi=300,pt=96,$o="http://www.w3.org/2000/svg",T=(i,e,t)=>{let o=document.createElement(i);return e&&(o.className=e),t!==void 0&&(o.textContent=String(t)),o},ht=(i,e={})=>{let t=document.createElementNS($o,i);for(let[o,s]of Object.entries(e))t.setAttribute(o,String(s));return t},ge=(i,e)=>{let t=T("div",n.METRICS_TILE);return t.appendChild(T("span",n.METRICS_TILE_VALUE,e)),t.appendChild(T("span",n.METRICS_TILE_LABEL,i)),t},ut=(i,e,t)=>{let o=T("div",n.METRICS_GROUP);o.dataset.metricsGroup=i,o.appendChild(T("h4",n.METRICS_HEADING,e));let s=Math.max(1,...t.map(r=>r.count));for(let{label:r,count:a,color:l}of t){let c=T("div",n.METRICS_ROW);c.dataset.metricsRow="",c.appendChild(T("span",n.METRICS_ROW_LABEL,r));let d=T("div",n.METRICS_TRACK),p=T("div",n.METRICS_BAR);p.dataset.metricsBar="",p.style.width=`${Math.round(a/s*100)}%`,p.style.background=l,d.appendChild(p),c.appendChild(d),c.appendChild(T("span",n.METRICS_ROW_COUNT,a)),o.appendChild(c)}return o},Ho=(i,e)=>{let t=T("div",n.METRICS_GROUP);t.dataset.metricsGroup="overTime",t.appendChild(T("h4",n.METRICS_HEADING,e.metricsOverTime));let o=Math.max(1,...i.map(({count:c})=>c)),s=ht("svg",{class:n.METRICS_CHART,viewBox:`0 0 ${bi} ${pt}`,preserveAspectRatio:"none",role:"img","aria-label":`${e.metricsOverTime}: ${i.map(({date:c,count:d})=>`${c} ${d}`).join(", ")}`}),r=bi/i.length,a=Math.max(2,Math.min(r-3,28));i.forEach(({date:c,count:d},p)=>{let h=Math.max(2,d/o*(pt-6)),u=ht("rect",{x:p*r+(r-a)/2,y:pt-h,width:a,height:h,rx:2});u.appendChild(Object.assign(ht("title"),{textContent:`${c}: ${d}`})),s.appendChild(u)}),t.appendChild(s);let l=T("div",n.METRICS_AXIS);return l.appendChild(T("span",null,i[0].date)),i.length>1&&l.appendChild(T("span",null,i[i.length-1].date)),t.appendChild(l),t},Xo=(i,e)=>{let t=T("div",n.METRICS_EXPORTS);t.setAttribute("aria-label",i.metricsExportLabel);let o=(s,r,a)=>{let l=T("button",n.METRICS_EXPORT_BTN,r);return l.type="button",l.dataset.export=s,l.addEventListener("click",a),l};return t.appendChild(o("comments",i.metricsExportComments,e.onExportComments)),t.appendChild(o("metrics",i.metricsExportMetrics,e.onExportMetrics)),t.appendChild(o("print",i.metricsPrint,e.onPrint)),t};function _i(i,e){let{strings:t}=e,o=T("div",n.METRICS_VIEW);if(i.total===0)return o.appendChild(T("p",n.METRICS_EMPTY,t.metricsEmpty)),o;let s=a=>a===null?"\u2014":X(a,t),r=T("div",n.METRICS_TILES);return r.appendChild(ge(t.metricsTotal,i.total)),r.appendChild(ge(t.statusResolved,i.resolution.resolvedCount)),r.appendChild(ge(t.metricsReopened,i.resolution.reopenedCount)),r.appendChild(ge(t.metricsAverageResolution,s(i.resolution.averageMs))),r.appendChild(ge(t.metricsMedianResolution,s(i.resolution.medianMs))),o.appendChild(r),o.appendChild(ut("status",t.metricsByStatus,S.map(a=>({label:B(a,t),count:i.byStatus[a],color:F[a]})))),o.appendChild(ut("type",t.metricsByType,[...A.map(a=>({label:v(a,t),count:i.byType[a],color:G[a]})),{label:t.unset,count:i.byType[K],color:Ci}])),o.appendChild(ut("priority",t.metricsByPriority,[...R.map(a=>({label:L(a,t),count:i.byPriority[a],color:z[a]})),{label:t.unset,count:i.byPriority[K],color:Ci}])),i.overTime.length&&o.appendChild(Ho(i.overTime,t)),o.appendChild(Xo(t,e)),o}var Ti='<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>',Uo='<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>',Fo='<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>',Xe=class{constructor({shadowRoot:e,strings:t,locale:o,currentPage:s,getComments:r,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=o,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.auditExpanded=!1,this.showMetrics=!1,this.editing=null,this.notice=null,this._cardBindings=new Map,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null,this._reactions=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=n.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.el.setAttribute("tabindex","-1"),this.shadowRoot.appendChild(this.el),this.render(),this.el.focus())}close(){this._clearHighlight(),this._setActiveMarker(null),this.el?.remove(),this.el=null,this._cardBindings.clear(),this.detailId=null,this.editing=null,this.notice=null}refresh(){this.el&&this.render()}_resetFilters(){this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}showNotice(e){this.notice=e,this.refresh()}clearNotice(){this.notice&&(this.notice=null,this.refresh())}isDirty(){return this.editing?this.editing.draft.trim()!==this._editingOriginalText().trim():!1}_editingOriginalText(){if(!this.editing)return"";let e=this.getComments().find(o=>O(o.id,this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(o=>O(o.id,this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await Me(e,this.strings))return!1}return this.editing=null,!0}_editorHandlers(){return{draft:this.editing.draft,onInput:e=>{this.editing.draft=e},onSave:e=>{let{commentId:t,replyId:o}=this.editing;o==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,o,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return oe({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(li(e.id))}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(n.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(n.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(n.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(n.CIRCLE_ACTIVE),this._activeMarkerEl=t)}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter!=="all"&&(e=e.filter(t=>(t.status||"open")===this.statusFilter)),this.typeFilter!=="all"&&(e=e.filter(t=>t.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(t=>t.priority===this.priorityFilter)),[...e.filter(t=>t.status!=="resolved"),...e.filter(t=>t.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight();let e=this.filteredComments(),t=this.detailId!=null?e.find(o=>O(o.id,this.detailId)):null;if(this._setActiveMarker(t),this.showMetrics){this._cardBindings.clear(),this.el.innerHTML="",this._renderMetrics(e);return}t?(this._cardBindings.clear(),this.el.innerHTML="",this._renderDetail(t,e)):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(o=>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="&times;",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_metricsButton(){let e=document.createElement("button");return e.type="button",e.className=n.INBOX_METRICS_BTN,e.textContent=this.strings.metricsOpen,e.setAttribute("aria-label",this.strings.metricsTitle),e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.showMetrics=!0,this.detailId=null,this.render())}),e}_renderMetrics(e){let t=document.createElement("div");t.className=n.INBOX_DETAIL_HEADER;let o=document.createElement("button");o.type="button",o.className=n.INBOX_BACK,o.innerHTML=`${Ti}<span>${this.strings.back}</span>`,o.addEventListener("click",()=>{this.showMetrics=!1,this.render()}),t.appendChild(o);let s=document.createElement("div");s.className=n.INBOX_CARD_ACTIONS,s.appendChild(this._closeButton()),t.appendChild(s),this.el.appendChild(t);let r=this._filterSummaryLabel();this.el.appendChild(_i(se(e),{strings:this.strings,locale:this.locale,onExportComments:()=>this.callbacks.onExportComments(e),onExportMetrics:()=>this.callbacks.onExportMetrics(e),onPrint:()=>this.callbacks.onPrintReport(e,r)}))}_renderList(e){let t=[...this.el.children].find(r=>r.classList.contains(n.INBOX_LIST));if(!t){this.el.innerHTML="",this._cardBindings.clear();let r=document.createElement("div");r.className=n.INBOX_HEADER,this.el.appendChild(r),t=document.createElement("div"),t.className=n.INBOX_LIST,this.el.appendChild(t)}let o=[...this.el.children].find(r=>r.classList.contains(n.INBOX_HEADER)),s=document.createElement("div");s.className=n.INBOX_HEADER_ACTIONS,s.append(this._metricsButton(),this._closeButton()),o.replaceChildren(this._buildFilter(),s),this._reconcileCards(t,e)}_reactionsUi(){return this._reactions||(this._reactions=Re({actorKey:()=>this.callbacks.actorKey(),strings:this.strings,onToggle:(e,t)=>{let o=this.getComments().find(s=>(s.replies||[]).includes(e));o?this.callbacks.onToggleReplyReaction(o.id,e.id,t):this.callbacks.onToggleCommentReaction(e.id,t)}})),this._reactions}_cardFingerprint(e){return JSON.stringify([e.text,e.editedAt??null,e.status??"open",e.type??null,e.priority??null,e.tags??[],e.resolvedAt??null,e.history?.length??0,e.history?.at(-1)?.at??null,e.anchorState,e.hidden===!0,e.page,e.screenshots?.length??0,Je(e).map(({emoji:t,authors:o})=>[t,o.length])])}_reconcileCards(e,t){for(let r of[...e.children])(r.classList.contains(n.INBOX_NOTICE)||r.classList.contains(n.INBOX_EMPTY))&&r.remove();let o=[];if(this.notice){let r=document.createElement("div");r.className=n.INBOX_NOTICE,r.setAttribute("role","status"),r.textContent=this.notice,o.push(r)}let s=new Set;if(t.length===0)o.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),o.push(d)}for(let r of[...this._cardBindings.keys()])s.has(r)||this._cardBindings.delete(r);for(o.forEach((r,a)=>{e.children[a]!==r&&e.insertBefore(r,e.children[a]??null)});e.children.length>o.length;)e.lastElementChild.remove()}_buildEmptyState(){let e=document.createElement("div");e.className=n.INBOX_EMPTY;let t=document.createElement("div");t.className=n.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let o=this.getComments().length>0,s=document.createElement("div");if(s.className=n.INBOX_EMPTY_TITLE,s.textContent=o?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(s),o){let p=document.createElement("button");return p.type="button",p.className=n.INBOX_EMPTY_ACTION,p.textContent=this.strings.filterClear,p.addEventListener("click",()=>{this._resetFilters()}),e.appendChild(p),e}let r=document.createElement("div");r.className=n.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=n.INBOX_EMPTY_KBD,c.textContent=st(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=n.INBOX_EMPTY_ACTION,d.textContent=this.strings.inboxEmptyAction,d.addEventListener("click",()=>this.callbacks.onActivateCommentMode()),e.appendChild(d),e}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(B(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(v(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(L(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_isFilterActive(){return this.pageFilter!=="page"||this.statusFilter!=="all"||this.typeFilter!=="all"||this.priorityFilter!=="all"}_buildFilterGroup({title:e,dataAttr:t,values:o,labelOf:s,selected:r,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=n.INBOX_FILTER_GROUP;let d=document.createElement("div");d.className=n.INBOX_FILTER_SECTION,d.textContent=e,c.appendChild(d);let p=document.createElement("div");p.className=n.INBOX_FILTER_CHIPS,p.setAttribute("role",a?"group":"radiogroup"),p.setAttribute("aria-label",e);for(let h of o){let u=r===h,m=document.createElement("button");m.type="button",m.className=n.INBOX_FILTER_CHIP,m.dataset[t]=h,m.setAttribute("role",a?"switch":"radio"),m.setAttribute("aria-checked",String(u)),m.textContent=s(h),m.addEventListener("click",f=>{f.stopPropagation(),l(a&&u?"all":h),this.render()}),p.appendChild(m)}return c.appendChild(p),c}_buildFilter(){let e=document.createElement("div");e.className=n.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=n.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${Be}`;let o=document.createElement("div");o.className=n.INBOX_FILTER_MENU,o.setAttribute("role","group"),o.setAttribute("aria-label",this.strings.filterTitle),V(t,o);let s=document.createElement("div");s.className=n.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=n.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this._resetFilters()}),s.appendChild(a),o.appendChild(s),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPage,dataAttr:"filterPage",values:["page","all"],labelOf:l=>this._pageFilterLabel(l),selected:this.pageFilter,toggles:!1,onSelect:l=>this.pageFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...S],labelOf:l=>B(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...A],labelOf:l=>v(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...R],labelOf:l=>L(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(o),e}_buildCard(e,{interactive:t}){let o=document.createElement("div");o.className=n.INBOX_CARD,e.status==="resolved"&&o.classList.add(`${n.INBOX_CARD}--resolved`),o.dataset.commentId=e.id;let s=document.createElement("div");s.className=n.INBOX_CARD_HEADER,s.appendChild(he(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),o.appendChild(s);let r=document.createElement("div");if(r.className=n.THREAD_ACTIONS_ROW,r.appendChild(this._buildCardActions(e)),o.appendChild(r),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))o.appendChild(this._buildEditor());else{let d=document.createElement("div");d.className=n.INBOX_CARD_TEXT,d.textContent=e.text,o.appendChild(d)}if(e.screenshots?.length){let d=ue(e.screenshots,this.strings);$(d,p=>this.callbacks.onShowLightbox(p)),o.appendChild(d)}let l=at(e,this.strings,{includeClassification:!1});l&&o.appendChild(l),o.appendChild(this._reactionsUi().bar(e));let c=this._buildTag(e);if(c&&o.appendChild(c),t){o.setAttribute("role","button"),o.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=n.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",h=>{h.stopPropagation(),d()}),o.appendChild(p),o.addEventListener("click",d),o.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),d())}),o.addEventListener("mouseenter",()=>this._highlight(e)),o.addEventListener("mouseleave",()=>this._clearHighlight())}return o}_buildTag(e){let t=null;if(e.anchorState==="orphaned"?t=this.strings.orphanedBadge:e.hidden?t=this.strings.hiddenBadge:e.anchorState==="inactive"&&(t=e.page),!t)return null;let o=document.createElement("span");return o.className=n.INBOX_CARD_TAG,o.textContent=t,o}_buildCardActions(e){return we(e,{strings:this.strings,reactions:this._reactionsUi(),onCopy:t=>ie(ke(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>ie(Q(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,o)=>this.callbacks.onSetStatus(t.id,o),onSetType:(t,o)=>this.callbacks.onSetType(t.id,o),onSetPriority:(t,o)=>this.callbacks.onSetPriority(t.id,o),onDelete:t=>{this.detailId!=null&&O(this.detailId,t.id)&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let o=t.indexOf(e),s=document.createElement("div");s.className=n.INBOX_DETAIL_HEADER;let r=document.createElement("button");r.type="button",r.className=n.INBOX_BACK,r.innerHTML=`${Ti}<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=n.INBOX_CARD_ACTIONS;let l=(u,m,f)=>{let g=document.createElement("button");g.type="button",g.className=n.INBOX_NAV_BTN,g.setAttribute("aria-label",m),g.title=m,g.innerHTML=u;let E=t[f];return g.disabled=!E,E&&g.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(E)}),g};a.appendChild(l(Uo,this.strings.prevComment,o-1)),a.appendChild(l(Fo,this.strings.nextComment,o+1)),a.appendChild(this._closeButton()),s.appendChild(a),this.el.appendChild(s);let c=document.createElement("div");c.className=n.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let d=Pe(e,{strings:this.strings,onShowLightbox:u=>this.callbacks.onShowLightbox(u),collapsible:!0,expanded:this.contextExpanded,onToggle:u=>{this.contextExpanded=u}});d&&c.appendChild(d);let p=Ei(e,{strings:this.strings,locale:this.locale,open:this.auditExpanded,onToggle:u=>{this.auditExpanded=u}});p&&c.appendChild(p);let h=document.createElement("div");h.className=n.INBOX_REPLIES;for(let u of e.replies||[]){let m=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(u.id),f=me(u,this.strings,this.locale,{onDelete:(g,E)=>{this.callbacks.onDeleteReply(e.id,g.id)&&E.remove()},onEdit:g=>this.startEditing(e.id,g.id),editing:m?this._editorHandlers():null,reactions:this._reactionsUi()});$(f,g=>this.callbacks.onShowLightbox(g)),h.appendChild(f)}c.appendChild(h),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:o,screenshotsContainer:s,attachBtn:r,fileInput:a,submitBtn:l}=De({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],d=()=>{ne(s,c,{strings:this.strings,onShow:h=>this.callbacks.onShowLightbox(h),rerender:()=>d()})};r.addEventListener("click",()=>a.click()),re(a,()=>c,d);let p=()=>{let h=o.value.trim();!h&&c.length===0||(this.callbacks.onReply(e,h,[...c]),c=[],this.render())};return l.addEventListener("click",p),o.addEventListener("keydown",h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),p())}),t}};var xi=",",Go=`\r
9
- `,zo=/^[=+\-@\t\r]/,Oi=i=>{if(i==null)return"";let e=String(i),t=zo.test(e)?`'${e}`:e;return/["\n\r,]/.test(t)?`"${t.replace(/"/g,'""')}"`:t};function mt(i,e){let t=e.map(s=>Oi(s.label)).join(xi),o=i.map(s=>e.map(r=>Oi(s[r.key])).join(xi));return[t,...o].join(Go)}var yi=["id","page","author","authorId","text","status","type","priority","tags","createdAt","resolvedAt","resolutionHours","reopened","replies"],ft=i=>i.map(e=>({key:e,label:e})),Ii=["section","key","value"];function Ai(i){return(i||[]).map(e=>({id:String(e.id),page:e.page||"",author:e.author||"",authorId:e.authorId||"",text:e.text||"",status:e.status||"open",type:e.type||"",priority:e.priority||"",tags:(e.tags||[]).join(" "),createdAt:e.createdAt||"",resolvedAt:e.resolvedAt||"",resolutionHours:ae(ee(e)),reopened:j(e).length>1?"yes":"no",replies:(e.replies||[]).length}))}function Ri(i){let e=[{section:"total",key:"",value:i.total}],t=(o,s)=>{for(let[r,a]of Object.entries(s))e.push({section:o,key:r,value:a})};t("status",i.byStatus),t("type",i.byType),t("priority",i.byPriority);for(let{date:o,count:s}of i.overTime)e.push({section:"perDay",key:o,value:s});return e.push({section:"resolution",key:"resolvedCount",value:i.resolution.resolvedCount},{section:"resolution",key:"reopenedCount",value:i.resolution.reopenedCount},{section:"resolution",key:"averageHours",value:ae(i.resolution.averageMs)},{section:"resolution",key:"medianHours",value:ae(i.resolution.medianMs)}),e}function gt(i,e){let t=new Blob(["\uFEFF",e],{type:"text/csv;charset=utf-8"}),o=URL.createObjectURL(t),s=document.createElement("a");s.href=o,s.download=i,s.click(),URL.revokeObjectURL(o)}var Vo="helldots-report-styles",U=(i,e,t,o)=>{let s=i.createElement(e);return t&&(s.className=t),o!==void 0&&(s.textContent=String(o)),s},Et=(i,e,t,o)=>{let s=U(i,"table","report-table");s.appendChild(U(i,"caption",null,e));let r=i.createElement("thead"),a=i.createElement("tr");for(let c of o)a.appendChild(U(i,"th",null,c));r.appendChild(a),s.appendChild(r);let l=i.createElement("tbody");for(let[c,d]of t){let p=i.createElement("tr");p.appendChild(U(i,"th",null,c)),p.appendChild(U(i,"td",null,d)),l.appendChild(p)}return s.appendChild(l),s},Si=i=>i===null?"\u2014":I("{n} h",ae(i)),Yo=(i,e,{strings:t,locale:o,scope:s})=>{let r=i.body;r.className="report",r.appendChild(U(i,"h1","report-title",t.metricsTitle));let a=U(i,"p","report-meta");if(a.textContent=I(t.metricsGeneratedTemplate,new Intl.DateTimeFormat(o,{dateStyle:"long",timeStyle:"short"}).format(new Date)),r.appendChild(a),s){let c=U(i,"p","report-meta");c.textContent=`${t.metricsScope}: ${s}`,r.appendChild(c)}r.appendChild(Et(i,t.metricsTitle,[[t.metricsTotal,e.total],[t.statusResolved,e.resolution.resolvedCount],[t.metricsReopened,e.resolution.reopenedCount],[t.metricsAverageResolution,Si(e.resolution.averageMs)],[t.metricsMedianResolution,Si(e.resolution.medianMs)]],[t.metricsCategory,t.metricsCount]));let l=(c,d,p,h)=>Et(i,c,d.map(u=>[h(u),p[u]??0]),[t.metricsCategory,t.metricsCount]);r.appendChild(l(t.metricsByStatus,S,e.byStatus,c=>B(c,t))),r.appendChild(l(t.metricsByType,[...A,"unset"],e.byType,c=>c==="unset"?t.unset:v(c,t))),r.appendChild(l(t.metricsByPriority,[...R,"unset"],e.byPriority,c=>c==="unset"?t.unset:L(c,t))),e.overTime.length&&r.appendChild(Et(i,t.metricsOverTime,e.overTime.map(({date:c,count:d})=>[c,d]),[t.metricsDate,t.metricsCount]))};function Ni(i,{strings:e,locale:t,css:o,scope:s}){let r=document.createElement("iframe");r.setAttribute("aria-hidden","true"),r.setAttribute("title",e.metricsTitle),r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.border="0",r.style.left="-9999px",document.body.appendChild(r);let a=r.contentDocument,l=r.contentWindow;a.title=e.metricsTitle,ce(a,o,Vo),Yo(a,i,{strings:e,locale:t,scope:s});let c=()=>r.remove();return l.addEventListener("afterprint",c,{once:!0}),setTimeout(()=>l.print?.(),0),r}var jo=i=>{let e=new Set;for(let t of i){let o=String(t).trim().toLowerCase();o&&e.add(o)}return[...e]},vi=i=>i.filter(e=>typeof e=="string"),Wo={"comment:created":"onCommentCreated","comment:edited":"onCommentEdited","comment:deleted":"onCommentDeleted","comment:status-changed":"onCommentStatusChanged","comment:updated":"onCommentUpdated","comment:anchor-lost":"onAnchorLost","reply:added":"onReplyAdded","reply:deleted":"onReplyDeleted","reply:edited":"onReplyEdited","reaction:toggled":"onReactionToggled"},Ct=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=rt(),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||Pt(),this.strings=kt(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=_t(),this.toolbar=si(this.options,this.strings),this.commentBox=ai(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(x.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(x.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${n.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(x.ATTACH_IMAGE_INPUT),this._captureFlow=new be({host:this.shadowRoot,autoScreenshot:this.options.autoScreenshot,embedCrossOriginFonts:this.options.embedCrossOriginFonts,onRegionCaptured:e=>{this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length<Ce&&this._pendingScreenshots.push(e)},onPlace:(e,t)=>this._placeCommentAtPoint(e,t)}),this._popover=new $e({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,findComment:e=>this._findComment(e),removeTooltip:e=>this._tooltipEl(e)?.remove(),onShowLightbox:e=>this.showLightbox(e),isInsideLightbox:e=>this._isInsideLightbox(e),linkParam:()=>this._linkParam(),refreshInbox:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},actorKey:()=>this._actorKey(),actions:{addReply:(e,t,o)=>this.addReply(e,t,o),deleteReply:(e,t)=>this.deleteReply(e,t),editComment:(e,t)=>this.editComment(e,t),editReply:(e,t,o)=>this.editReply(e,t,o),setStatus:(e,t)=>this.setCommentStatus(e,t),setType:(e,t)=>this.setCommentType(e,t),setPriority:(e,t)=>this.setCommentPriority(e,t),deleteComment:e=>this.deleteComment(e),toggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),toggleReplyReaction:(e,t,o)=>this.toggleReplyReaction(e,t,o)}}),this.markers=new He({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=Ke(),this.loadComments(this._storedCache),this._storageHandler=e=>{(e.key===xe||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=qt(this._linkParam()),t=null;try{t=sessionStorage.getItem(Oe),t!=null&&sessionStorage.removeItem(Oe)}catch{}return e??t}_linkParam(){return this.options.linkParam||Se}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this._findComment(e);if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound);return}this._pendingDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_emit(e,t,o){let s=Wo[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,...o})}catch(a){console.warn("HellDots: onChange handler threw",a)}}commentLink(e){let t=this._findComment(e);return t?Q(t,this._linkParam()):null}_readStoredCached(){return this._storedCache||(this._storedCache=Ke()),this._storedCache}_syncStorage(){if(this.options.persistence!=="localStorage")return;let e=qe(this._readStoredCached(),this.serializeComments(),location.pathname);ye(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()}),re(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(),o=e.key.toLowerCase()===t||e.altKey&&/^[a-z]$/.test(t)&&e.code===`Key${t.toUpperCase()}`,s=this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey;o&&s&&(e.preventDefault(),e.stopPropagation(),this.toggleCommentMode())},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let t=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(t)||t?.closest?.(`.${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._captureFlow.beginDrag(e))}}async _placeCommentAtPoint(e,t){this._captureFlow.armClickCapture();let o=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let s=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=o||"";let r=s?.closest?.(Rt.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=Gt(r,l,c);d.targetSelector=s&&s!==r?Ft(s):null,this.currentPosition={container:r,relativeX:l,relativeY:c,anchor:d,target:s||r},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}`);e&&ne(e,this._pendingScreenshots||[],{strings:this.strings,onShow:t=>this.showLightbox(t),rerender:()=>this._updateScreenshotsPreview()})}_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 s=D/2,r=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),d=c.width||400,p=e+s,h=t+s,u=p+r,m=h-s;u+d>a&&(u=p-r-d),u=Math.min(u,a-d-10),u=Math.max(10,u),m+c.height>l&&(m=l-c.height-10),m=Math.max(10,m),this.commentBox.style.left=`${u}px`,this.commentBox.style.top=`${m}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._captureFlow?.clearPending(),this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(n.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),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()}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:Ze(),replies:[],author:this.options.user?.name||this.strings.anonymous,authorId:k(this.options.user?.id)||null,createdAt:new Date().toISOString(),screenshots:this._pendingScreenshots?[...this._pendingScreenshots]:[],type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:[],resolvedAt:null,context:Lt(),contextScreenshot:e};Y(t,"created",this._actor()),this.comments.push(t),this._syncStorage();let o=this._serializeComment(t);this._emit("comment:created",[o],{comment:o}),this.renderCommentCircle(t),this.hideCommentBox(),this.toggleCommentMode();let s=this._circles.get(String(t.id));s&&this.showThreadPopover(s,t)}renderCommentCircle(e){this.markers.render(e)}_wireMarker(e,t){e.addEventListener("mouseenter",()=>this.showCommentTooltip(e,t)),e.addEventListener("mouseleave",()=>{setTimeout(()=>{let o=this._tooltipEl(t.id);o&&!o.matches(":hover")&&o.remove()},250)}),e.addEventListener("click",o=>{if(o.stopPropagation(),this._tooltipEl(t.id)?.remove(),this.activeThreadPopover?.dataset.for===String(t.id)){this.closeThreadPopover();return}this.showThreadPopover(e,t)}),e.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),e.click())})}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${n.THREAD_POPOVER}[data-for="${W(t.id)}"]`)||this._tooltipEl(t.id))return;let s=pi(t,this.strings,this.locale);this.shadowRoot.appendChild(s),$(s,r=>this.showLightbox(r)),setTimeout(()=>{fe(s,e)},10),s.querySelector(`.${n.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 Xe({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:{onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onReply:(e,t,o)=>this.addReply(e,t,o),onDelete:e=>this.deleteComment(e),onDeleteReply:(e,t)=>this.deleteReply(e,t),onEditComment:(e,t)=>{this.editComment(e,t)&&this._popover.refreshCommentViews(e)},onEditReply:(e,t,o)=>{this.editReply(e,t,o)&&this._popover.refreshCommentViews(e)},actorKey:()=>this._actorKey(),onToggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),onToggleReplyReaction:(e,t,o)=>this.toggleReplyReaction(e,t,o),onExportComments:e=>this.exportCommentsCsv(e),onExportMetrics:e=>this.exportMetricsCsv(e),onPrintReport:(e,t)=>this.printMetricsReport(e,t),onSetStatus:(e,t)=>this.setCommentStatus(e,t),onSetType:(e,t)=>this.setCommentType(e,t),onSetPriority:(e,t)=>this.setCommentPriority(e,t),onNavigateToPage:e=>{try{sessionStorage.setItem(Oe,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=n.LIGHTBOX,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",this.strings.screenshotPreview);let o=document.createElement("img");o.className=n.LIGHTBOX_IMG,o.src=e,o.alt=this.strings.screenshotPreview;let s=document.createElement("button");s.type="button",s.className=n.LIGHTBOX_CLOSE,s.setAttribute("aria-label",this.strings.close),s.innerHTML="&times;",s.addEventListener("click",()=>this.closeLightbox()),t.appendChild(o),t.appendChild(s),t.addEventListener("click",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?.(`.${n.LIGHTBOX}`)}_findComment(e){return this.comments.find(t=>O(t.id,e))}_tooltipEl(e){return this.shadowRoot?.querySelector(`.${n.TOOLTIP}[data-for="${W(e)}"]`)??null}addReply(e,t,o=[]){let s=typeof e=="object"&&e!==null?e:this._findComment(e);if(!s)return null;s.replies||(s.replies=[]);let r={id:Ze(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,authorId:k(this.options.user?.id)||null,timestamp:new Date().toISOString(),screenshots:o};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 o=this._findComment(e),s=o?.replies?.findIndex(c=>O(c.id,t))??-1;if(s<0)return!1;let[r]=o.replies.splice(s,1);this._syncStorage();let a=this._serializeComment(o),l=this._serializeReply(r);return this._emit("reply:deleted",[a,l],{comment:a,reply:l}),!0}editComment(e,t){let o=this._findComment(e),s=String(t??"").trim();if(!o||!s||s===o.text)return!1;o.text=s,o.editedAt=new Date().toISOString(),Y(o,"edited",this._actor()),this._circles.get(String(o.id))?.setAttribute("aria-label",`${this.strings.commentAriaLabelPrefix}${o.text}`),this._syncStorage();let r=this._serializeComment(o);return this._emit("comment:edited",[r],{comment:r}),!0}editReply(e,t,o){let s=this._findComment(e),r=s?.replies?.find(d=>O(d.id,t)),a=String(o??"").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:o,authorId:s,timestamp:r,screenshots:a,editedAt:l,reactions:c=null}){return{id:e,text:t,author:o,authorId:s||null,timestamp:r,screenshots:a||[],editedAt:l||null,reactions:tt(c)}}_serializeComment(e){return{schemaVersion:1,id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),author:e.author,authorId:e.authorId||null,history:ti(e.history),createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],reactions:tt(e.reactions),resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!S.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;if(o.status===t)return!0;let s=o.status;o.status=t,o.resolvedAt=t==="resolved"?new Date().toISOString():null,Y(o,"status",this._actor(),{from:s,to:t});let r=this._circles.get(String(o.id));r&&this.updateCommentPosition(o,r),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let a=this._serializeComment(o);return this._emit("comment:status-changed",[a],{comment:a}),!0}_actor(){return Qt(this.options.user,this.strings)}_actorKey(){return Kt(this.options.user,this.strings)}_commitReaction(e,t){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let o=this._serializeComment(e),s=t?this._serializeReply(t):null;return this._emit("reaction:toggled",[o,s],{comment:o,reply:s}),!0}toggleCommentReaction(e,t){let o=this._findComment(e);return!o||!et(o,t,this._actorKey())?!1:this._commitReaction(o,null)}toggleReplyReaction(e,t,o){let s=this._findComment(e),r=s?.replies?.find(a=>O(a.id,t));return!r||!et(r,o,this._actorKey())?!1:this._commitReaction(s,r)}_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&&!A.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=o.type??null;return o.type=t,s!==t&&Y(o,"classified",this._actor(),{field:"type",from:s,to:t}),this._commitUpdate(o)}setCommentPriority(e,t){if(t!==null&&!R.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=o.priority??null;return o.priority=t,s!==t&&Y(o,"classified",this._actor(),{field:"priority",from:s,to:t}),this._commitUpdate(o)}setCommentTags(e,t){if(!Array.isArray(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=(o.tags||[]).join("\0");return o.tags=jo(t),o.tags.join("\0")!==s&&Y(o,"classified",this._actor(),{field:"tags"}),this._commitUpdate(o)}getMetrics(){return se(this.serializeComments())}exportCommentsCsv(e){let t=Ai(e||this.serializeComments());gt("helldots-comments.csv",mt(t,ft(yi)))}exportMetricsCsv(e){let t=se(e||this.serializeComments());gt("helldots-metrics.csv",mt(Ri(t),ft(Ii)))}printMetricsReport(e,t){let o=se(e||this.serializeComments());Ni(o,{strings:this.strings,locale:this.locale,css:Bt(),scope:t})}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){if(!this._findComment(e))return!1;if(this._removeComment(e),this.options.persistence==="localStorage"){let t=qe(this._readStoredCached().filter(o=>!O(o.id,e)),this.serializeComments(),location.pathname);ye(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))),o=this._readStoredCached().filter(s=>!t.has(String(s.id)));ye(o),this._storedCache=o}this.inboxView?.isOpen()&&this.inboxView.refresh()}loadComments(e){let t=0,o=0,s=0;if(!Array.isArray(e))return{anchored:t,orphaned:o,inactive:s};for(let 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=>({...c,authorId:k(c.authorId)||null,...Array.isArray(c.screenshots)?{screenshots:vi(c.screenshots)}:{},reactions:Qe(c.reactions)})):[],author:r.author||this.strings.anonymous,authorId:k(r.authorId)||null,history:ei(r.history),createdAt:r.createdAt||new Date().toISOString(),screenshots:Array.isArray(r.screenshots)?vi(r.screenshots):[],status:r.status==="closed"?"resolved":S.includes(r.status)?r.status:"open",type:A.includes(r.type)?r.type:null,priority:R.includes(r.priority)?r.priority:null,tags:Array.isArray(r.tags)?[...r.tags]:[],resolvedAt:r.resolvedAt||null,reactions:Qe(r.reactions),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?We(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),o++;let c=this._serializeComment(a);this._emit("comment:anchor-lost",[c],{comment:c})}}return this._openPendingDetail(),{anchored:t,orphaned:o,inactive:s}}notifyNavigation(){let e=location.pathname,t=0,o=0,s=0;this.closeThreadPopover(),this.hideCommentBox(),this.inboxView&&(this.inboxView.currentPage=e);for(let 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?We(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",o++;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:o,inactive:s}}scrollMarkerIntoView(e){this.markers.scrollMarkerIntoView(e)}createPreviewCircle(e,t){this.removePreviewCircle();let o=document.createElement("div");o.className=`${n.CIRCLE} ${n.PREVIEW_CIRCLE}`,o.style.position="absolute";let s=D/2;o.style.left=`${e+s}px`,o.style.top=`${t+s}px`,o.style.transform="translate(-50%, -50%)",o.style.pointerEvents="none",this.overlay.appendChild(o),this.previewCircle=o}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){this.markers.cleanupResizeObserver(e)}validateAndCalculatePosition(e,t){return this.markers.validateAndCalculatePosition(e,t)}updateCommentPosition(e,t){this.markers.updatePosition(e,t)}scheduleUpdatePositions(){this.markers.scheduleUpdate()}get _circles(){return this.markers?.circles}get resizeObservers(){return this.markers?.resizeObservers}get positionValidationEnabled(){return this.markers?.enabled??!0}set positionValidationEnabled(e){this.markers&&(this.markers.enabled=e)}get _globalMutationObserver(){return this.markers?._globalMutationObserver??null}_dismissMarkerUi(e){this._tooltipEl(e.id)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}cleanup(){this._onDomReady&&(document.removeEventListener("DOMContentLoaded",this._onDomReady),this._onDomReady=null),this.markers?.destroy(),this._storageHandler&&(window.removeEventListener("storage",this._storageHandler),this._storageHandler=null),this._popstateHandler&&(window.removeEventListener("popstate",this._popstateHandler),this._popstateHandler=null),this._storedCache=null,Ae(),ii(),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(n.COMMENT_CURSOR),this._detachStyles(),document.querySelector(P)?.remove()}injectStyles(){this._detachStyles(),this._styleDetachers=[ce(this.shadowRoot,wt(),x.STYLES),ce(document,Mt(),x.GLOBAL_STYLES)]}_detachStyles(){for(let e of this._styleDetachers??[])e();this._styleDetachers=[]}},Li=Ct;function Ko(i={}){let{autoInit:e=!0,...t}=i,o=()=>new Li(t);return e?o():o}var Ts=Ko;export{Li as CommentOverlay,Ko as createCommentOverlay,Ts as default};
7
+ `,t},fe=(i,e)=>{let t=document.createElement("div");return t.className=n.SCREENSHOTS_CONTAINER,t.classList.add(n.ACTIVE),i.forEach(o=>{let s=document.createElement("div");s.className=n.SCREENSHOT_ITEM;let r=document.createElement("img");r.className=n.SCREENSHOT_IMG,r.src=o,r.alt=e.attachedScreenshot,s.appendChild(r),t.appendChild(s)}),t},bo=(i,e=H,t)=>{let o=document.createElement("div");o.className=n.TOOLTIP,o.dataset.for=i.id,o.setAttribute("role","dialog"),o.setAttribute("aria-label",e.tooltipAriaLabel);let s=document.createElement("div");s.className=n.THREAD_HEADER;let r=me(i.author,i.createdAt,e,t,i.editedAt),a=document.createElement("button");a.type="button",a.className=n.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="&times;",s.appendChild(r),s.appendChild(a);let l=document.createElement("div");l.className=n.THREAD_BODY,l.textContent=i.text,o.appendChild(s),o.appendChild(l);let c=dt(i,e,{includeStatus:!0});c&&o.appendChild(c);let d=pt(i);d.length>0&&o.appendChild(fe(d,e));let p=i.replies?.length||0;if(p>0){let h=document.createElement("div");h.className=n.TOOLTIP_REPLY_COUNT,h.textContent=p===1?e.replyCountOne:I(e.replyCountTemplate,p),o.appendChild(h)}return o},ge=(i,e=H,t,{onDelete:o,onEdit:s,editing:r=null,reactions:a=null}={})=>{let l=document.createElement("div");l.className=n.THREAD_REPLY,l.dataset.replyId=String(i.id);let c=me(i.author,i.timestamp,e,t,i.editedAt),d=[];s&&d.push({label:e.editReply,onSelect:()=>s(i)}),o&&d.push({label:e.deleteReply,onSelect:()=>o(i,l),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})});let p=document.createElement("div");p.className=`${n.ACTIONS_GROUP} ${n.THREAD_REPLY_ACTIONS}`,a&&p.appendChild(a.trigger(i,{className:n.INBOX_ACTION_BTN})),d.length>0&&p.appendChild(st({label:e.replyOptions,items:d})),p.children.length>0&&c.appendChild(p);let h;r?h=ie({value:r.draft,strings:e,onInput:r.onInput,onSave:r.onSave,onCancel:r.onCancel}):(h=document.createElement("div"),h.className=n.THREAD_BODY,h.textContent=i.text),l.appendChild(c),l.appendChild(h);let u=pt(i);return u.length>0&&l.appendChild(fe(u,e)),a&&l.appendChild(a.bar(i)),l},Co=(i,e=H,t,{onDeleteReply:o,onEditReply:s,reactions:r=null}={})=>{let a=document.createElement("div");a.className=n.THREAD_POPOVER,a.dataset.for=i.id,a.setAttribute("role","dialog"),a.setAttribute("aria-label",e.popoverAriaLabel);let l=document.createElement("div");l.className=n.THREAD_HEADER;let c=me(i.author,i.createdAt,e,t,i.editedAt),d=document.createElement("button");d.type="button",d.className=n.CLOSE_TOOLTIP,d.setAttribute("aria-label",e.close),d.innerHTML="&times;",l.appendChild(c),l.appendChild(d);let p=document.createElement("div");p.className=n.THREAD_BODY,p.textContent=i.text;let h=document.createElement("div");h.className=n.THREAD_REPLIES,i.replies&&i.replies.forEach(g=>{h.appendChild(ge(g,e,t,{onDelete:o,onEdit:s,reactions:r}))});let{container:u}=Be({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=n.THREAD_SCROLL,a.appendChild(l),m.appendChild(p);let f=pt(i);return f.length>0&&m.appendChild(fe(f,e)),r&&m.appendChild(r.bar(i)),m.appendChild(h),a.appendChild(m),a.appendChild(u),a};var ke=(i,{strings:e,onShowLightbox:t,collapsible:o=!1,expanded:s=!1,onToggle:r})=>{let{context:a,contextScreenshot:l}=i;if(!a&&!l)return null;let c=document.createElement("div");c.className=n.CONTEXT_BLOCK;let d=document.createElement("div");if(d.className=n.CONTEXT_BODY,o){let p=document.createElement("button");p.type="button",p.className=n.CONTEXT_TOGGLE,p.setAttribute("aria-expanded",String(s)),p.innerHTML=`<span>${e.contextSection}</span>${De}`,d.style.display=s?"":"none",p.addEventListener("click",h=>{h.stopPropagation();let u=p.getAttribute("aria-expanded")==="true";p.setAttribute("aria-expanded",String(!u)),d.style.display=u?"none":"",r?.(!u)}),c.appendChild(p)}else{let p=document.createElement("div");p.className=n.CONTEXT_TITLE,p.textContent=e.contextSection,c.appendChild(p)}if(l){let p=document.createElement("div");p.className=n.CONTEXT_SCREENSHOT_CAPTION,p.textContent=e.autoScreenshotLabel,d.appendChild(p);let h=document.createElement("img");h.className=n.SCREENSHOT_IMG,h.src=l,h.alt=e.autoScreenshotLabel,d.appendChild(h),$(d,t)}if(a){let p=(m,f)=>{if(!f)return;let g=document.createElement("div");g.className=n.CONTEXT_ROW;let E=document.createElement("span");E.textContent=m;let C=document.createElement("span");C.textContent=f,g.appendChild(E),g.appendChild(C),d.appendChild(g)},h=m=>m?`${m.width}\xD7${m.height}`:"",u=m=>m?.name?`${m.name} ${m.version||""}`.trim():"";p(e.contextUrl,a.url),p(e.contextViewport,h(a.viewport)),p(e.contextScreen,h(a.screen)),p(e.contextBrowser,u(a.browser)),p(e.contextOs,u(a.os))}return c.appendChild(d),c};var Fi=i=>{let e=[...i.attributes].map(({name:t,value:o})=>`${t}="${o}"`).join(" ");return`<${i.tagName.toLowerCase()}${e?` ${e}`:""}>`},zi=i=>{if(!i?.tagName)return"(unknown)";let e=Object.entries(i.attributes||{}).map(([t,o])=>`${t}="${o}"`).join(" ");return`<${i.tagName.toLowerCase()}${e?` ${e}`:""}>`},Gi=i=>{let e=[],t=i;for(;t&&t!==document.documentElement;){let o=t.tagName.toLowerCase(),s=t.id?`#${t.id}`:"",r=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${o}${s}${r}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function Pe(i,{viewportWidth:e,viewportHeight:t,strings:o}){let s=i.anchor,r=s?.fingerprint,a=i.container?.isConnected?i.container:null,l=i.hidden?"hidden":i.anchorState,c=a?Fi(a):zi(r),d=a?Gi(a):"(unavailable)",p=i.context?.viewport,h=p?.width??e,u=p?.height??t,m=[`Page: ${i.page}`,`Viewport: ${h}x${u}`,`Anchor state: ${l}`,`Status: ${i.status||"open"}`,`Selector: ${s?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${d}`,`Nearby text: "${r?.textSnippet??""}"`,`Comment by ${i.author} (${i.createdAt}):`,`"${i.text}"`];i.type&&m.push(`Type: ${i.type}`),i.priority&&m.push(`Priority: ${i.priority}`),i.tags?.length&&m.push(`Tags: ${i.tags.join(", ")}`);let f=i.context;if(f&&(f.url&&m.push(`URL: ${f.url}`),f.screen&&m.push(`Screen: ${f.screen.width}x${f.screen.height}`),f.browser?.name&&m.push(`Browser: ${`${f.browser.name} ${f.browser.version||""}`.trim()}`),f.os?.name&&m.push(`OS: ${`${f.os.name} ${f.os.version||""}`.trim()}`)),o&&i.status==="resolved"&&i.resolvedAt){let E=X(new Date(i.resolvedAt).getTime()-new Date(i.createdAt).getTime(),o);E&&m.push(`Resolution time: ${E}`)}let g=i.replies||[];if(g.length>0){m.push(`Replies (${g.length}):`);for(let E of g)m.push(`- ${E.author}: "${E.text}"`)}return m.join(`
8
+ `)}var Ee=(i,e)=>{let t=e.getBoundingClientRect(),o=t.left+t.width/2,s=t.top+t.height/2,r=B,a=r/2+10,l=i.getBoundingClientRect(),c=l.width||400,d=o+a;d+c>window.innerWidth&&(d=o-a-c),d=Math.min(d,window.innerWidth-c-10),d=Math.max(10,d),i.style.left=`${d}px`;let p=10,h=s-r/2,u=window.innerHeight-p-h;l.height>u?(i.style.top="auto",i.style.bottom=`${p}px`):(i.style.bottom="auto",i.style.top=`${Math.max(p,h)}px`)},_o=i=>{let e=i.getBoundingClientRect(),t=Math.max(10,(window.innerWidth-(e.width||400))/2),o=Math.max(10,(window.innerHeight-e.height)/2);i.style.left=`${t}px`,i.style.bottom="auto",i.style.top=`${o}px`},$e=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(`.${n.THREAD_SCROLL} > .${n.THREAD_BODY}, .${n.THREAD_SCROLL} > .${n.EDITOR}`):t.querySelector(`.${n.THREAD_REPLY}[data-reply-id="${W(e)}"]`)?.querySelector(`.${n.THREAD_BODY}, .${n.EDITOR}`)||null:null}refreshCommentViews(e,t=null){if(this.active?.dataset.for!==String(e))return;let o=this.deps.findComment(e);if(!o)return;let s=t==null?o:(o.replies||[]).find(l=>y(l.id,t));if(!s)return;let r=document.createElement("div");r.className=n.THREAD_BODY,r.textContent=s.text,this._bodyEl(t)?.replaceWith(r);let a=t==null?this.active.querySelector(`.${n.THREAD_META}`):this.active.querySelector(`.${n.THREAD_REPLY}[data-reply-id="${W(t)}"]`)?.querySelector(`.${n.THREAD_META}`);if(a&&s.editedAt&&!a.querySelector(`.${n.THREAD_EDITED}`)){let l=at(s.editedAt,this.deps.strings,this.deps.locale),c=a.querySelector(`.${n.THREAD_REPLY_ACTIONS}`);c?a.insertBefore(l,c):a.appendChild(l)}}isEditing(){return this.editing!=null}editorDirty(){if(!this.editing)return!1;let{commentId:e,replyId:t,draft:o}=this.editing,s=this.deps.findComment(e),r=t==null?s:(s?.replies||[]).find(a=>y(a.id,t));return o.trim()!==String(r?.text||"").trim()}async releaseEditor(){if(!this.editing)return!0;if(this.editorDirty()){let t=this.deps.shadowRoot;if(!await Me(t,this.deps.strings))return!1}let{replyId:e}=this.editing;return this.editing=null,this._restoreBody(e),!0}_restoreBody(e){let t=this.deps.findComment(this.active?.dataset.for);if(!t)return;let o=e==null?t:(t.replies||[]).find(r=>y(r.id,e));if(!o)return;let s=document.createElement("div");s.className=n.THREAD_BODY,s.textContent=o.text,this._bodyEl(e)?.replaceWith(s)}async startEditing(e,t=null){if(!await this.releaseEditor())return;let o=this.deps.findComment(e),s=t==null?o:(o?.replies||[]).find(a=>y(a.id,t));if(!s)return;this.editing={commentId:e,replyId:t,draft:s.text};let r=ie({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:o,locale:s}=this.deps;this.deps.removeTooltip(t.id),e?.classList.add(n.CIRCLE_ACTIVE),this._activeCircle=e||null;let r=(b,O)=>{this.deps.actions.deleteReply(t.id,b.id)&&(O.remove(),this.deps.refreshInbox())},a=b=>this.startEditing(t.id,b.id),l=Se({actorKey:this.deps.actorKey,strings:o,onToggle:(b,O)=>b===t?this.deps.actions.toggleCommentReaction(t.id,O):this.deps.actions.toggleReplyReaction(t.id,b.id,O)}),c=Co(t,o,s,{onDeleteReply:r,onEditReply:a,reactions:l});this.deps.shadowRoot.appendChild(c);let d=c.querySelector(`.${n.THREAD_HEADER}`),p=Le(t,{strings:o,reactions:l,onCopy:b=>oe(Pe(b,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:o})),onCopyLink:b=>oe(Q(b,this.deps.linkParam())),onEdit:b=>this.startEditing(b.id),onSetStatus:(b,O)=>this.deps.actions.setStatus(b.id,O),onSetType:(b,O)=>this.deps.actions.setType(b.id,O),onSetPriority:(b,O)=>this.deps.actions.setPriority(b.id,O),onDelete:b=>{this.close(),this.deps.actions.deleteComment(b.id),this.deps.refreshInbox()}}),h=document.createElement("div");h.className=n.THREAD_ACTIONS_ROW,h.appendChild(p),d.insertAdjacentElement("afterend",h);let u=c.querySelector(`.${n.THREAD_SCROLL} > .${n.SCREENSHOTS_CONTAINER}`);u&&$(u,b=>this.deps.onShowLightbox(b));let m=ke(t,{strings:o,onShowLightbox:b=>this.deps.onShowLightbox(b),collapsible:!0});m&&c.querySelector(`.${n.THREAD_REPLIES}`).before(m),setTimeout(()=>{e?Ee(c,e):_o(c)},10),c.querySelector(`.${n.CLOSE_TOOLTIP}`).addEventListener("click",async b=>{b.stopPropagation(),!(this.editing&&!await this.releaseEditor())&&this.close()});let f=c.querySelector(`.${n.THREAD_INPUT}`),g=c.querySelector(`.${n.THREAD_SUBMIT}`),E=c.querySelector(`.${n.THREAD_INPUT_AREA} .${n.ATTACH_IMAGE_BTN}`),C=c.querySelector(`.${n.THREAD_INPUT_AREA} input[type="file"]`),L=c.querySelector(`.${n.THREAD_INPUT_AREA} .${n.SCREENSHOTS_CONTAINER}`),_=[],N=()=>{ne(L,_,{strings:o,onShow:b=>this.deps.onShowLightbox(b),rerender:()=>N()})};E.addEventListener("click",()=>{C.click()}),re(C,()=>_,N,b=>this.deps.transformScreenshot(b,t.id));let q=()=>{let b=f.value.trim();if(!b&&_.length===0)return;let O=this.deps.actions.addReply(t,b,_.length>0?[..._]:[]),Ho=c.querySelector(`.${n.THREAD_REPLIES}`),xt=ge(O,o,s,{onDelete:r,onEdit:a,reactions:l});Ho.appendChild(xt),$(xt,Xo=>this.deps.onShowLightbox(Xo));let Ue=c.querySelector(`.${n.THREAD_SCROLL}`);Ue&&(Ue.scrollTop=Ue.scrollHeight),f.value="",_=[],N(),f.focus()};g.addEventListener("click",q),f.addEventListener("keydown",b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),q())}),this.active=c,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(c)),setTimeout(()=>f.focus(),50),this._armClickTimer=setTimeout(()=>{this._armClickTimer=null,this._clickHandler=b=>{let O=b.composedPath()[0]||b.target;if(!c.contains(O)&&!e?.contains(O)&&!this.deps.isInsideLightbox(O)){if(this.editorDirty())return;this.close()}},document.addEventListener("mousedown",this._clickHandler)},0)}close(){this.deps.shadowRoot?.querySelectorAll(`.${n.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(n.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?Ee(e,this._activeCircle):_o(e))}syncToMarker(){let e=this.active,t=this._activeCircle;if(!e||!t)return;let o=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&o.bottom>0&&o.right>0&&o.top<window.innerHeight&&o.left<window.innerWidth)){e.style.display="none";return}e.style.display="",Ee(e,t)}};var To=150,ht=(i,e)=>Math.max(0,Math.min(i,e)),He=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=Eo(e,this.deps.strings);this.deps.wireMarker(t,e),this.deps.container.appendChild(t),this.circles.set(String(e.id),t),this.updatePosition(e,t),this.createResizeObserver(e,t)}circleOf(e){return this.circles.get(String(e))??null}remove(e){this.cleanupResizeObserver(e),this.circles.get(String(e))?.remove(),this.circles.delete(String(e))}clear(){this.resizeObservers.forEach(({observer:e})=>e?.disconnect()),this.resizeObservers.clear(),this.circles.forEach(e=>e.remove()),this.circles.clear()}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let o=e.container.getBoundingClientRect(),s=o.width,r=o.height;if(s<=0||r<=0)return null;let a=e.relativeX*s,l=e.relativeY*r,c=ht(a,s),d=ht(l,r),p=c/s,h=d/r;return{absoluteX:c,absoluteY:d,relativeX:p,relativeY:h,containerWidth:s,containerHeight:r,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 r=document.elementsFromPoint(t,o).find(c=>c.tagName.toLowerCase()!==k.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 o=e.getBoundingClientRect();return o.width>=window.innerWidth*.5&&o.height>=window.innerHeight*.5}_computeMarkerState(e,t,{checkOcclusion:o=!0}={}){if(e.status==="resolved")return{kind:"resolved"};let s=this.validateAndCalculatePosition(e,t);if(s&&!this._isAnchorTargetVisible(e)&&(s=null),!s)return e.container?{kind:"hidden"}:{kind:"noop"};let r=B/2,a=s.containerLeft+s.absoluteX+r,l=s.containerTop+s.absoluteY+r;return o&&(e._occluded=this._isMarkerOccluded(e,a,l)),e._occluded?{kind:"hidden"}:{kind:"visible",viewportX:a,viewportY:l,relativeX:s.relativeX,relativeY:s.relativeY}}_applyMarkerState(e,t,o){if(o.kind==="resolved")return t&&(t.style.display="none"),!1;if(o.kind==="noop")return!1;let s=e.hidden===!0;return o.kind==="hidden"?(e.hidden=!0,t.style.display="none",this.deps.onMarkerHidden(e),!s):(e.hidden=!1,t.style.display="",t.style.left=`${o.viewportX}px`,t.style.top=`${o.viewportY}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=o.relativeX,e.relativeY=o.relativeY,s)}updatePosition(e,t=this.circles.get(String(e.id))){if(!t)return;let o=this._computeMarkerState(e,t);this._applyMarkerState(e,t,o)&&this.deps.onVisibilityFlip()}_updateAllPositions(){let e=Date.now(),t=e-this._lastOcclusionPass>=To;t?this._lastOcclusionPass=e:this._armOcclusionTrailingPass();let o=[];for(let r of this.deps.getComments()){let a=this.circles.get(String(r.id));a&&o.push([r,a,this._computeMarkerState(r,a,{checkOcclusion:t})])}let s=!1;for(let[r,a,l]of o)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()},To)}scheduleUpdate(){this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.enabled&&this._updateAllPositions(),this.deps.onAfterPass()}))}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let o=new ResizeObserver(s=>{if(this.enabled)for(let r of s)r.target===e.container&&this.updatePosition(e,t)});o.observe(e.container),this.resizeObservers.set(String(e.id),{circle:t,observer:o,container:e.container})}cleanupResizeObserver(e){let t=String(e);if(this.resizeObservers.has(t)){let{circle:o,observer:s}=this.resizeObservers.get(t);s&&s.disconnect(),o&&o.parentNode&&o.parentNode.removeChild(o),this.resizeObservers.delete(t)}}scrollMarkerIntoView(e){let t=this._markerViewportY(e);t!=null&&window.scrollTo({top:Math.max(0,window.scrollY+t-window.innerHeight/2)})}_markerViewportY(e){let t=e.container;if(!t?.isConnected)return null;let o=t.getBoundingClientRect();if(o.height<=0)return null;let s=ht(e.relativeY*o.height,o.height);return o.top+s+B/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 yo=(i,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(i)),Vi={status:i=>[i.statusLabel,e=>D(e,i)],type:i=>[i.typeLabel,e=>v(e,i)],priority:i=>[i.priorityLabel,e=>w(e,i)]},xo=(i,e,t)=>{let o=Vi[i];if(!o)return"";let[s,r]=o(t);return`${s}: ${r(e.from??null)} \u2192 ${r(e.to??null)}`},Yi=(i,e)=>{switch(i.type){case"created":return e.auditCreated;case"edited":return e.auditEdited;case"status":return xo("status",i,e);case"classified":return i.field==="tags"?e.auditTagsChanged:xo(i.field,i,e);default:return""}},ji=(i,e,t)=>{let o=document.createElement("li");o.className=n.AUDIT_ROW;let s=document.createElement("span");s.className=n.AUDIT_ACTION,s.textContent=Yi(i,e);let r=document.createElement("span");r.className=n.AUDIT_ACTOR,r.textContent=i.actor?.name||e.anonymous;let a=document.createElement("time");return a.className=n.AUDIT_TIME,a.dateTime=i.at,a.textContent=yo(i.at,t),o.append(s,r,a),o},Wi=(i,e,t)=>{let o=j(i).filter(l=>l.reopenedAt);if(o.length===0)return null;let s=document.createElement("div");s.className=n.AUDIT_RESOLUTIONS,s.dataset.auditResolutions="";let r=document.createElement("h4");r.className=n.AUDIT_HEADING,r.textContent=e.auditPreviousResolutions,s.appendChild(r);let a=document.createElement("ul");a.className=n.AUDIT_LIST;for(let l of o){let c=document.createElement("li");c.className=n.AUDIT_ROW;let d=document.createElement("span");d.className=n.AUDIT_ACTION,d.textContent=I(e.auditResolvedInTemplate,X(l.ms,e)||"\u2014");let p=document.createElement("time");p.className=n.AUDIT_TIME,p.dateTime=l.resolvedAt,p.textContent=yo(l.resolvedAt,t),c.append(d,p),a.appendChild(c)}return s.appendChild(a),s};function Oo(i,{strings:e,locale:t,open:o,onToggle:s}){let r=i?.history;if(!Array.isArray(r)||r.length===0)return null;let a=document.createElement("div");a.className=n.AUDIT_BLOCK;let l=document.createElement("button");l.type="button",l.className=n.AUDIT_TOGGLE,l.setAttribute("aria-expanded",String(o)),l.textContent=I(e.auditToggleTemplate,r.length);let c=document.createElement("div");c.className=n.AUDIT_BODY,c.hidden=!o;let d=document.createElement("ul");d.className=n.AUDIT_LIST,d.setAttribute("aria-label",e.auditTrailLabel);for(let h of[...r].reverse())d.appendChild(ji(h,e,t));c.appendChild(d);let p=Wi(i,e,t);return p&&c.appendChild(p),l.addEventListener("click",()=>{let h=l.getAttribute("aria-expanded")!=="true";l.setAttribute("aria-expanded",String(h)),c.hidden=!h,s?.(h)}),a.append(l,c),a}var K="unset",Ki=36e5,ut=(i,e)=>{let t={};for(let o of i)t[o]=0;return e&&(t[e]=0),t},qi=i=>{if(i.length===0)return null;let e=Math.floor(i.length/2);return i.length%2?i[e]:(i[e-1]+i[e])/2};function se(i){let e=Array.isArray(i)?i:[],t=ut(S),o=ut(R,K),s=ut(A,K),r=new Map,a=[],l=0;for(let d of e){let p=S.includes(d.status)?d.status:"open";t[p]++,o[R.includes(d.type)?d.type:K]++,s[A.includes(d.priority)?d.priority:K]++;let h=String(d.createdAt||"").slice(0,10);h&&r.set(h,(r.get(h)||0)+1);let u=ee(d);u!==null&&a.push(u),j(d).length>1&&l++}a.sort((d,p)=>d-p);let c=a.reduce((d,p)=>d+p,0);return{total:e.length,byStatus:t,byType:o,byPriority:s,overTime:[...r.entries()].sort(([d],[p])=>d<p?-1:1).map(([d,p])=>({date:d,count:p})),resolution:{resolvedCount:a.length,averageMs:a.length?c/a.length:null,medianMs:qi(a),reopenedCount:l}}}var ae=i=>i==null?null:Math.round(i/Ki*10)/10;var Io="rgba(255,255,255,0.42)",Ro=300,mt=96,Zi="http://www.w3.org/2000/svg",T=(i,e,t)=>{let o=document.createElement(i);return e&&(o.className=e),t!==void 0&&(o.textContent=String(t)),o},ft=(i,e={})=>{let t=document.createElementNS(Zi,i);for(let[o,s]of Object.entries(e))t.setAttribute(o,String(s));return t},be=(i,e)=>{let t=T("div",n.METRICS_TILE);return t.appendChild(T("span",n.METRICS_TILE_VALUE,e)),t.appendChild(T("span",n.METRICS_TILE_LABEL,i)),t},gt=(i,e,t)=>{let o=T("div",n.METRICS_GROUP);o.dataset.metricsGroup=i,o.appendChild(T("h4",n.METRICS_HEADING,e));let s=Math.max(1,...t.map(r=>r.count));for(let{label:r,count:a,color:l}of t){let c=T("div",n.METRICS_ROW);c.dataset.metricsRow="",c.appendChild(T("span",n.METRICS_ROW_LABEL,r));let d=T("div",n.METRICS_TRACK),p=T("div",n.METRICS_BAR);p.dataset.metricsBar="",p.style.width=`${Math.round(a/s*100)}%`,p.style.background=l,d.appendChild(p),c.appendChild(d),c.appendChild(T("span",n.METRICS_ROW_COUNT,a)),o.appendChild(c)}return o},Ji=(i,e)=>{let t=T("div",n.METRICS_GROUP);t.dataset.metricsGroup="overTime",t.appendChild(T("h4",n.METRICS_HEADING,e.metricsOverTime));let o=Math.max(1,...i.map(({count:c})=>c)),s=ft("svg",{class:n.METRICS_CHART,viewBox:`0 0 ${Ro} ${mt}`,preserveAspectRatio:"none",role:"img","aria-label":`${e.metricsOverTime}: ${i.map(({date:c,count:d})=>`${c} ${d}`).join(", ")}`}),r=Ro/i.length,a=Math.max(2,Math.min(r-3,28));i.forEach(({date:c,count:d},p)=>{let h=Math.max(2,d/o*(mt-6)),u=ft("rect",{x:p*r+(r-a)/2,y:mt-h,width:a,height:h,rx:2});u.appendChild(Object.assign(ft("title"),{textContent:`${c}: ${d}`})),s.appendChild(u)}),t.appendChild(s);let l=T("div",n.METRICS_AXIS);return l.appendChild(T("span",null,i[0].date)),i.length>1&&l.appendChild(T("span",null,i[i.length-1].date)),t.appendChild(l),t},Qi=(i,e)=>{let t=T("div",n.METRICS_EXPORTS);t.setAttribute("aria-label",i.metricsExportLabel);let o=(s,r,a)=>{let l=T("button",n.METRICS_EXPORT_BTN,r);return l.type="button",l.dataset.export=s,l.addEventListener("click",a),l};return t.appendChild(o("comments",i.metricsExportComments,e.onExportComments)),t.appendChild(o("metrics",i.metricsExportMetrics,e.onExportMetrics)),t.appendChild(o("print",i.metricsPrint,e.onPrint)),t};function Ao(i,e){let{strings:t}=e,o=T("div",n.METRICS_VIEW);if(i.total===0)return o.appendChild(T("p",n.METRICS_EMPTY,t.metricsEmpty)),o;let s=a=>a===null?"\u2014":X(a,t),r=T("div",n.METRICS_TILES);return r.appendChild(be(t.metricsTotal,i.total)),r.appendChild(be(t.statusResolved,i.resolution.resolvedCount)),r.appendChild(be(t.metricsReopened,i.resolution.reopenedCount)),r.appendChild(be(t.metricsAverageResolution,s(i.resolution.averageMs))),r.appendChild(be(t.metricsMedianResolution,s(i.resolution.medianMs))),o.appendChild(r),o.appendChild(gt("status",t.metricsByStatus,S.map(a=>({label:D(a,t),count:i.byStatus[a],color:F[a]})))),o.appendChild(gt("type",t.metricsByType,[...R.map(a=>({label:v(a,t),count:i.byType[a],color:z[a]})),{label:t.unset,count:i.byType[K],color:Io}])),o.appendChild(gt("priority",t.metricsByPriority,[...A.map(a=>({label:w(a,t),count:i.byPriority[a],color:G[a]})),{label:t.unset,count:i.byPriority[K],color:Io}])),i.overTime.length&&o.appendChild(Ji(i.overTime,t)),o.appendChild(Qi(t,e)),o}var So='<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>',en='<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>',tn='<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>',Xe=class{constructor({shadowRoot:e,strings:t,locale:o,currentPage:s,getComments:r,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=o,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.auditExpanded=!1,this.showMetrics=!1,this.editing=null,this.notice=null,this._cardBindings=new Map,this.el=null,this._highlightedEl=null,this._activeMarkerEl=null,this._reactions=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=n.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.el.setAttribute("tabindex","-1"),this.shadowRoot.appendChild(this.el),this.render(),this.el.focus())}close(){this._clearHighlight(),this._setActiveMarker(null),this.el?.remove(),this.el=null,this._cardBindings.clear(),this.detailId=null,this.editing=null,this.notice=null}refresh(){this.el&&this.render()}_resetFilters(){this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}showNotice(e){this.notice=e,this.refresh()}clearNotice(){this.notice&&(this.notice=null,this.refresh())}isDirty(){return this.editing?this.editing.draft.trim()!==this._editingOriginalText().trim():!1}_editingOriginalText(){if(!this.editing)return"";let e=this.getComments().find(o=>y(o.id,this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(o=>y(o.id,this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await Me(e,this.strings))return!1}return this.editing=null,!0}_editorHandlers(){return{draft:this.editing.draft,onInput:e=>{this.editing.draft=e},onSave:e=>{let{commentId:t,replyId:o}=this.editing;o==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,o,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return ie({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(fo(e.id))}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(n.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(n.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(n.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(n.CIRCLE_ACTIVE),this._activeMarkerEl=t)}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter!=="all"&&(e=e.filter(t=>(t.status||"open")===this.statusFilter)),this.typeFilter!=="all"&&(e=e.filter(t=>t.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(t=>t.priority===this.priorityFilter)),[...e.filter(t=>t.status!=="resolved"),...e.filter(t=>t.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight();let e=this.filteredComments(),t=this.detailId!=null?e.find(o=>y(o.id,this.detailId)):null;if(this._setActiveMarker(t),this.showMetrics){this._cardBindings.clear(),this.el.innerHTML="",this._renderMetrics(e);return}t?(this._cardBindings.clear(),this.el.innerHTML="",this._renderDetail(t,e)):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(o=>y(o.id,e));t&&this._openDetail(t)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render(),this.callbacks.onOpenDetail?.(e)}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=n.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="&times;",e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_metricsButton(){let e=document.createElement("button");return e.type="button",e.className=n.INBOX_METRICS_BTN,e.textContent=this.strings.metricsOpen,e.setAttribute("aria-label",this.strings.metricsTitle),e.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.showMetrics=!0,this.detailId=null,this.render())}),e}_renderMetrics(e){let t=document.createElement("div");t.className=n.INBOX_DETAIL_HEADER;let o=document.createElement("button");o.type="button",o.className=n.INBOX_BACK,o.innerHTML=`${So}<span>${this.strings.back}</span>`,o.addEventListener("click",()=>{this.showMetrics=!1,this.render()}),t.appendChild(o);let s=document.createElement("div");s.className=n.INBOX_CARD_ACTIONS,s.appendChild(this._closeButton()),t.appendChild(s),this.el.appendChild(t);let r=this._filterSummaryLabel();this.el.appendChild(Ao(se(e),{strings:this.strings,locale:this.locale,onExportComments:()=>this.callbacks.onExportComments(e),onExportMetrics:()=>this.callbacks.onExportMetrics(e),onPrint:()=>this.callbacks.onPrintReport(e,r)}))}_renderList(e){let t=[...this.el.children].find(r=>r.classList.contains(n.INBOX_LIST));if(!t){this.el.innerHTML="",this._cardBindings.clear();let r=document.createElement("div");r.className=n.INBOX_HEADER,this.el.appendChild(r),t=document.createElement("div"),t.className=n.INBOX_LIST,this.el.appendChild(t)}let o=[...this.el.children].find(r=>r.classList.contains(n.INBOX_HEADER)),s=document.createElement("div");s.className=n.INBOX_HEADER_ACTIONS,s.append(this._metricsButton(),this._closeButton()),o.replaceChildren(this._buildFilter(),s),this._reconcileCards(t,e)}_reactionsUi(){return this._reactions||(this._reactions=Se({actorKey:()=>this.callbacks.actorKey(),strings:this.strings,onToggle:(e,t)=>{let o=this.getComments().find(s=>(s.replies||[]).includes(e));o?this.callbacks.onToggleReplyReaction(o.id,e.id,t):this.callbacks.onToggleCommentReaction(e.id,t)}})),this._reactions}_cardFingerprint(e){return JSON.stringify([e.text,e.editedAt??null,e.status??"open",e.type??null,e.priority??null,e.tags??[],e.resolvedAt??null,e.history?.length??0,e.history?.at(-1)?.at??null,e.anchorState,e.hidden===!0,e.page,e.screenshots?.length??0,et(e).map(({emoji:t,authors:o})=>[t,o.length])])}_reconcileCards(e,t){for(let r of[...e.children])(r.classList.contains(n.INBOX_NOTICE)||r.classList.contains(n.INBOX_EMPTY))&&r.remove();let o=[];if(this.notice){let r=document.createElement("div");r.className=n.INBOX_NOTICE,r.setAttribute("role","status"),r.textContent=this.notice,o.push(r)}let s=new Set;if(t.length===0)o.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),o.push(d)}for(let r of[...this._cardBindings.keys()])s.has(r)||this._cardBindings.delete(r);for(o.forEach((r,a)=>{e.children[a]!==r&&e.insertBefore(r,e.children[a]??null)});e.children.length>o.length;)e.lastElementChild.remove()}_buildEmptyState(){let e=document.createElement("div");e.className=n.INBOX_EMPTY;let t=document.createElement("div");t.className=n.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let o=this.getComments().length>0,s=document.createElement("div");if(s.className=n.INBOX_EMPTY_TITLE,s.textContent=o?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(s),o){let p=document.createElement("button");return p.type="button",p.className=n.INBOX_EMPTY_ACTION,p.textContent=this.strings.filterClear,p.addEventListener("click",()=>{this._resetFilters()}),e.appendChild(p),e}let r=document.createElement("div");r.className=n.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=n.INBOX_EMPTY_KBD,c.textContent=ct(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=n.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(D(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push(v(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(w(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_isFilterActive(){return this.pageFilter!=="page"||this.statusFilter!=="all"||this.typeFilter!=="all"||this.priorityFilter!=="all"}_buildFilterGroup({title:e,dataAttr:t,values:o,labelOf:s,selected:r,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=n.INBOX_FILTER_GROUP;let d=document.createElement("div");d.className=n.INBOX_FILTER_SECTION,d.textContent=e,c.appendChild(d);let p=document.createElement("div");p.className=n.INBOX_FILTER_CHIPS,p.setAttribute("role",a?"group":"radiogroup"),p.setAttribute("aria-label",e);for(let h of o){let u=r===h,m=document.createElement("button");m.type="button",m.className=n.INBOX_FILTER_CHIP,m.dataset[t]=h,m.setAttribute("role",a?"switch":"radio"),m.setAttribute("aria-checked",String(u)),m.textContent=s(h),m.addEventListener("click",f=>{f.stopPropagation(),l(a&&u?"all":h),this.render()}),p.appendChild(m)}return c.appendChild(p),c}_buildFilter(){let e=document.createElement("div");e.className=n.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=n.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${De}`;let o=document.createElement("div");o.className=n.INBOX_FILTER_MENU,o.setAttribute("role","group"),o.setAttribute("aria-label",this.strings.filterTitle),V(t,o);let s=document.createElement("div");s.className=n.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=n.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this._resetFilters()}),s.appendChild(a),o.appendChild(s),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPage,dataAttr:"filterPage",values:["page","all"],labelOf:l=>this._pageFilterLabel(l),selected:this.pageFilter,toggles:!1,onSelect:l=>this.pageFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...S],labelOf:l=>D(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...R],labelOf:l=>v(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...A],labelOf:l=>w(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(o),e}_buildCard(e,{interactive:t}){let o=document.createElement("div");o.className=n.INBOX_CARD,e.status==="resolved"&&o.classList.add(`${n.INBOX_CARD}--resolved`),o.dataset.commentId=e.id;let s=document.createElement("div");s.className=n.INBOX_CARD_HEADER,s.appendChild(me(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),o.appendChild(s);let r=document.createElement("div");if(r.className=n.THREAD_ACTIONS_ROW,r.appendChild(this._buildCardActions(e)),o.appendChild(r),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))o.appendChild(this._buildEditor());else{let d=document.createElement("div");d.className=n.INBOX_CARD_TEXT,d.textContent=e.text,o.appendChild(d)}if(e.screenshots?.length){let d=fe(e.screenshots,this.strings);$(d,p=>this.callbacks.onShowLightbox(p)),o.appendChild(d)}let l=dt(e,this.strings,{includeClassification:!1});l&&o.appendChild(l),o.appendChild(this._reactionsUi().bar(e));let c=this._buildTag(e);if(c&&o.appendChild(c),t){o.setAttribute("role","button"),o.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=n.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",h=>{h.stopPropagation(),d()}),o.appendChild(p),o.addEventListener("click",d),o.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),d())}),o.addEventListener("mouseenter",()=>this._highlight(e)),o.addEventListener("mouseleave",()=>this._clearHighlight())}return o}_buildTag(e){let t=null;if(e.anchorState==="orphaned"?t=this.strings.orphanedBadge:e.hidden?t=this.strings.hiddenBadge:e.anchorState==="inactive"&&(t=e.page),!t)return null;let o=document.createElement("span");return o.className=n.INBOX_CARD_TAG,o.textContent=t,o}_buildCardActions(e){return Le(e,{strings:this.strings,reactions:this._reactionsUi(),onCopy:t=>oe(Pe(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>oe(Q(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,o)=>this.callbacks.onSetStatus(t.id,o),onSetType:(t,o)=>this.callbacks.onSetType(t.id,o),onSetPriority:(t,o)=>this.callbacks.onSetPriority(t.id,o),onDelete:t=>{this.detailId!=null&&y(this.detailId,t.id)&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let o=t.indexOf(e),s=document.createElement("div");s.className=n.INBOX_DETAIL_HEADER;let r=document.createElement("button");r.type="button",r.className=n.INBOX_BACK,r.innerHTML=`${So}<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=n.INBOX_CARD_ACTIONS;let l=(u,m,f)=>{let g=document.createElement("button");g.type="button",g.className=n.INBOX_NAV_BTN,g.setAttribute("aria-label",m),g.title=m,g.innerHTML=u;let E=t[f];return g.disabled=!E,E&&g.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(E)}),g};a.appendChild(l(en,this.strings.prevComment,o-1)),a.appendChild(l(tn,this.strings.nextComment,o+1)),a.appendChild(this._closeButton()),s.appendChild(a),this.el.appendChild(s);let c=document.createElement("div");c.className=n.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let d=ke(e,{strings:this.strings,onShowLightbox:u=>this.callbacks.onShowLightbox(u),collapsible:!0,expanded:this.contextExpanded,onToggle:u=>{this.contextExpanded=u}});d&&c.appendChild(d);let p=Oo(e,{strings:this.strings,locale:this.locale,open:this.auditExpanded,onToggle:u=>{this.auditExpanded=u}});p&&c.appendChild(p);let h=document.createElement("div");h.className=n.INBOX_REPLIES;for(let u of e.replies||[]){let m=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(u.id),f=ge(u,this.strings,this.locale,{onDelete:(g,E)=>{this.callbacks.onDeleteReply(e.id,g.id)&&E.remove()},onEdit:g=>this.startEditing(e.id,g.id),editing:m?this._editorHandlers():null,reactions:this._reactionsUi()});$(f,g=>this.callbacks.onShowLightbox(g)),h.appendChild(f)}c.appendChild(h),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:o,screenshotsContainer:s,attachBtn:r,fileInput:a,submitBtn:l}=Be({areaClassName:n.THREAD_INPUT_AREA,inputTag:"input",inputClassName:n.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],d=()=>{ne(s,c,{strings:this.strings,onShow:h=>this.callbacks.onShowLightbox(h),rerender:()=>d()})};r.addEventListener("click",()=>a.click()),re(a,()=>c,d,h=>this.callbacks.onTransformScreenshot(h,e.id));let p=()=>{let h=o.value.trim();!h&&c.length===0||(this.callbacks.onReply(e,h,[...c]),c=[],this.render())};return l.addEventListener("click",p),o.addEventListener("keydown",h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),p())}),t}};var No=",",on=`\r
9
+ `,nn=/^[=+\-@\t\r]/,vo=i=>{if(i==null)return"";let e=String(i),t=nn.test(e)?`'${e}`:e;return/["\n\r,]/.test(t)?`"${t.replace(/"/g,'""')}"`:t};function Et(i,e){let t=e.map(s=>vo(s.label)).join(No),o=i.map(s=>e.map(r=>vo(s[r.key])).join(No));return[t,...o].join(on)}var wo=["id","page","author","authorId","text","status","type","priority","tags","createdAt","resolvedAt","resolutionHours","reopened","replies"],bt=i=>i.map(e=>({key:e,label:e})),Lo=["section","key","value"];function Mo(i){return(i||[]).map(e=>({id:String(e.id),page:e.page||"",author:e.author||"",authorId:e.authorId||"",text:e.text||"",status:e.status||"open",type:e.type||"",priority:e.priority||"",tags:(e.tags||[]).join(" "),createdAt:e.createdAt||"",resolvedAt:e.resolvedAt||"",resolutionHours:ae(ee(e)),reopened:j(e).length>1?"yes":"no",replies:(e.replies||[]).length}))}function Do(i){let e=[{section:"total",key:"",value:i.total}],t=(o,s)=>{for(let[r,a]of Object.entries(s))e.push({section:o,key:r,value:a})};t("status",i.byStatus),t("type",i.byType),t("priority",i.byPriority);for(let{date:o,count:s}of i.overTime)e.push({section:"perDay",key:o,value:s});return e.push({section:"resolution",key:"resolvedCount",value:i.resolution.resolvedCount},{section:"resolution",key:"reopenedCount",value:i.resolution.reopenedCount},{section:"resolution",key:"averageHours",value:ae(i.resolution.averageMs)},{section:"resolution",key:"medianHours",value:ae(i.resolution.medianMs)}),e}function Ct(i,e){let t=new Blob(["\uFEFF",e],{type:"text/csv;charset=utf-8"}),o=URL.createObjectURL(t),s=document.createElement("a");s.href=o,s.download=i,s.click(),URL.revokeObjectURL(o)}var rn="helldots-report-styles",U=(i,e,t,o)=>{let s=i.createElement(e);return t&&(s.className=t),o!==void 0&&(s.textContent=String(o)),s},_t=(i,e,t,o)=>{let s=U(i,"table","report-table");s.appendChild(U(i,"caption",null,e));let r=i.createElement("thead"),a=i.createElement("tr");for(let c of o)a.appendChild(U(i,"th",null,c));r.appendChild(a),s.appendChild(r);let l=i.createElement("tbody");for(let[c,d]of t){let p=i.createElement("tr");p.appendChild(U(i,"th",null,c)),p.appendChild(U(i,"td",null,d)),l.appendChild(p)}return s.appendChild(l),s},Bo=i=>i===null?"\u2014":I("{n} h",ae(i)),sn=(i,e,{strings:t,locale:o,scope:s})=>{let r=i.body;r.className="report",r.appendChild(U(i,"h1","report-title",t.metricsTitle));let a=U(i,"p","report-meta");if(a.textContent=I(t.metricsGeneratedTemplate,new Intl.DateTimeFormat(o,{dateStyle:"long",timeStyle:"short"}).format(new Date)),r.appendChild(a),s){let c=U(i,"p","report-meta");c.textContent=`${t.metricsScope}: ${s}`,r.appendChild(c)}r.appendChild(_t(i,t.metricsTitle,[[t.metricsTotal,e.total],[t.statusResolved,e.resolution.resolvedCount],[t.metricsReopened,e.resolution.reopenedCount],[t.metricsAverageResolution,Bo(e.resolution.averageMs)],[t.metricsMedianResolution,Bo(e.resolution.medianMs)]],[t.metricsCategory,t.metricsCount]));let l=(c,d,p,h)=>_t(i,c,d.map(u=>[h(u),p[u]??0]),[t.metricsCategory,t.metricsCount]);r.appendChild(l(t.metricsByStatus,S,e.byStatus,c=>D(c,t))),r.appendChild(l(t.metricsByType,[...R,"unset"],e.byType,c=>c==="unset"?t.unset:v(c,t))),r.appendChild(l(t.metricsByPriority,[...A,"unset"],e.byPriority,c=>c==="unset"?t.unset:w(c,t))),e.overTime.length&&r.appendChild(_t(i,t.metricsOverTime,e.overTime.map(({date:c,count:d})=>[c,d]),[t.metricsDate,t.metricsCount]))};function ko(i,{strings:e,locale:t,css:o,scope:s}){let r=document.createElement("iframe");r.setAttribute("aria-hidden","true"),r.setAttribute("title",e.metricsTitle),r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.border="0",r.style.left="-9999px",document.body.appendChild(r);let a=r.contentDocument,l=r.contentWindow;a.title=e.metricsTitle,de(a,o,rn),sn(a,i,{strings:e,locale:t,scope:s});let c=()=>r.remove();return l.addEventListener("afterprint",c,{once:!0}),setTimeout(()=>l.print?.(),0),r}var an=i=>{let e=new Set;for(let t of i){let o=String(t).trim().toLowerCase();o&&e.add(o)}return[...e]},Po=i=>i.filter(e=>typeof e=="string"),ln={"comment:created":"onCommentCreated","comment:edited":"onCommentEdited","comment:deleted":"onCommentDeleted","comment:status-changed":"onCommentStatusChanged","comment:updated":"onCommentUpdated","comment:anchor-lost":"onAnchorLost","reply:added":"onReplyAdded","reply:deleted":"onReplyDeleted","reply:edited":"onReplyEdited","reaction:toggled":"onReactionToggled"},Tt=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=lt(),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,embedCrossOriginFonts:e.embedCrossOriginFonts===!0,fastCapture:e.fastCapture===!0,skipIframeContent:e.skipIframeContent===!0,...e},this.locale=this.options.locale||zt(),this.strings=Gt(this.locale),this.markers=null,this._captureFlow=null,this._regionCapturePending=!1,this._storedCache=null,this._popover=null,this._pendingDetailId=null,this._requestedDetailId=null,this._origin="host",this._deferredLoad=null,document.readyState==="loading"?(this._onDomReady=()=>this.initOverlay(),document.addEventListener("DOMContentLoaded",this._onDomReady)):this.initOverlay()}initOverlay(){if(this.shadowRoot=yt(),this.toolbar=uo(this.options,this.strings),this.commentBox=mo(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(x.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(x.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${n.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(x.ATTACH_IMAGE_INPUT),this._captureFlow=new _e({host:this.shadowRoot,autoScreenshot:this.options.autoScreenshot,embedCrossOriginFonts:this.options.embedCrossOriginFonts,fastCapture:this.options.fastCapture,skipIframeContent:this.options.skipIframeContent,captureTimeout:this.options.captureTimeout,onRegionCaptured:e=>{this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length<le&&this._pendingScreenshots.push(e)},onRegionPending:e=>{this._regionCapturePending=e,this._updateScreenshotsPreview()},onPlace:(e,t)=>this._placeCommentAtPoint(e,t),onError:e=>this._reportError(e,"capture")}),this._popover=new $e({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,findComment:e=>this._findComment(e),removeTooltip:e=>this._tooltipEl(e)?.remove(),onShowLightbox:e=>this.showLightbox(e),isInsideLightbox:e=>this._isInsideLightbox(e),linkParam:()=>this._linkParam(),refreshInbox:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},actorKey:()=>this._actorKey(),transformScreenshot:(e,t)=>this._transformScreenshot(e,"attachment",t),actions:this._userActions({addReply:(e,t,o)=>this.addReply(e,t,o),deleteReply:(e,t)=>this.deleteReply(e,t),editComment:(e,t)=>this.editComment(e,t),editReply:(e,t,o)=>this.editReply(e,t,o),setStatus:(e,t)=>this.setCommentStatus(e,t),setType:(e,t)=>this.setCommentType(e,t),setPriority:(e,t)=>this.setCommentPriority(e,t),deleteComment:e=>this.deleteComment(e),toggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),toggleReplyReaction:(e,t,o)=>this.toggleReplyReaction(e,t,o)})}),this.markers=new He({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=Ze(),this.loadComments(this._storedCache),this._storageHandler=e=>{(e.key===ye||e.key===null)&&(this._storedCache=null)},window.addEventListener("storage",this._storageHandler)),this._deferredLoad){let e=this._deferredLoad;this._deferredLoad=null,this.loadComments(e)}this._openPendingDetail(),this.options.autoDetectNavigation&&(this._popstateHandler=()=>this.notifyNavigation(),window.addEventListener("popstate",this._popstateHandler)),this._notifyReady()}_navigateTo(e){if(typeof this.options.navigate=="function"){this.options.navigate(e);return}location.assign(e)}_readPendingDetailId(){let e=nt(this._linkParam()),t=null;try{t=sessionStorage.getItem(Oe),t!=null&&sessionStorage.removeItem(Oe)}catch{}return e??t}_linkParam(){return this.options.linkParam||ue}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this._findComment(e);if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound),this._requestPendingDetail(e);return}this._pendingDetailId=null,this._requestedDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_requestPendingDetail(e){let t=this.options.onCommentRequested;if(typeof t!="function"||this._requestedDetailId!==null&&y(this._requestedDetailId,e))return;this._requestedDetailId=e;let o;try{o=t(e)}catch(s){this._reportError(s,"link");return}!o||typeof o.then!="function"||o.then(()=>this._openPendingDetail(),s=>{this._reportError(s,"link"),this._openPendingDetail()})}_notifyReady(){let e=this.options.onReady;if(typeof e=="function")try{e(this)}catch(t){console.warn("HellDots: onReady handler threw",t)}}_asUser(e){let t=this._origin;this._origin="user";try{return e()}finally{this._origin=t}}_userActions(e){let t={};for(let[o,s]of Object.entries(e))t[o]=typeof s=="function"?(...r)=>this._asUser(()=>s(...r)):s;return t}_reportError(e,t){let o=this.options.onError;if(typeof o=="function")try{o(e,t)}catch(s){console.warn("HellDots: onError handler threw",s)}}async _transformScreenshot(e,t,o){let s=this.options.transformScreenshot;if(typeof s!="function"||!e)return e;try{let r=await s(e,{kind:t,commentId:o});if(typeof r!="string"||!r)throw new Error("HellDots: transformScreenshot resolved to no usable string");return r}catch(r){return this._reportError(r,"transform"),e}}_emit(e,t,o,s){let r={origin:this._origin,...s},a=ln[e],l=this.options[a];if(typeof l=="function")try{l(...t,r)}catch(c){console.warn(`HellDots: ${a} handler threw`,c)}if(typeof this.options.onChange=="function")try{this.options.onChange({type:e,...o,...r})}catch(c){console.warn("HellDots: onChange handler threw",c)}}commentLink(e){let t=this._findComment(e);return t?Q(t,this._linkParam()):null}_readStoredCached(){return this._storedCache||(this._storedCache=Ze()),this._storedCache}_syncStorage(){if(this.options.persistence!=="localStorage")return;let e=Je(this._readStoredCached(),this.serializeComments(),location.pathname);Ie(e)||this._reportError(new Error("HellDots: comments could not be persisted to localStorage"),"storage"),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()}),re(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(),o=e.key.toLowerCase()===t||e.altKey&&/^[a-z]$/.test(t)&&e.code===`Key${t.toUpperCase()}`,s=this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey;o&&s&&(e.preventDefault(),e.stopPropagation(),this.toggleCommentMode())},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let t=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(t)||t?.closest?.(`.${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._captureFlow.beginDrag(e))}}async _placeCommentAtPoint(e,t){this._captureFlow.armClickCapture();let o=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let s=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=o||"";let r=s?.closest?.(Dt.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=qt(r,l,c);d.targetSelector=s&&s!==r?Kt(s):null,this.currentPosition={container:r,relativeX:l,relativeY:c,anchor:d,target:s||r},this.createPreviewCircle(e,t),document.body.classList.remove(n.COMMENT_CURSOR),(this._pendingScreenshots?.length>0||this._regionCapturePending)&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${n.SCREENSHOTS_CONTAINER}`);e&&ne(e,this._pendingScreenshots||[],{strings:this.strings,onShow:t=>this.showLightbox(t),rerender:()=>this._updateScreenshotsPreview(),pending:this._regionCapturePending?1:0})}_clearScreenshotPreview(){this._pendingScreenshots=[],this._regionCapturePending=!1;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 s=B/2,r=s+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),d=c.width||400,p=e+s,h=t+s,u=p+r,m=h-s;u+d>a&&(u=p-r-d),u=Math.min(u,a-d-10),u=Math.max(10,u),m+c.height>l&&(m=l-c.height-10),m=Math.max(10,m),this.commentBox.style.left=`${u}px`,this.commentBox.style.top=`${m}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._captureFlow?.clearPending(),this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(n.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),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(),this._notify("onCommentModeChanged",[this.commentMode])}async saveComment(){if(!this._saving&&!(!this.commentInput.value.trim()||!this.currentPosition)){this._saving=!0,this.submitButton&&(this.submitButton.disabled=!0);try{await this._saveCommentNow()}finally{this._saving=!1,this.submitButton&&(this.submitButton.disabled=!1)}}}async _saveCommentNow(){let e=this.currentPosition,t=this.commentInput.value,o=await this._captureFlow.consumePending();if(this.currentPosition!==e)return;let s=Qe(),r=this._pendingScreenshots?[...this._pendingScreenshots]:[],[a,l]=await Promise.all([this._transformScreenshot(o,"context",s),Promise.all(r.map(h=>this._transformScreenshot(h,"attachment",s)))]);if(this.currentPosition!==e)return;let c={text:t,container:e.container,relativeX:e.relativeX,relativeY:e.relativeY,anchor:e.anchor,anchorState:"anchored",target:e.target,hidden:!1,status:"open",page:location.pathname,id:s,replies:[],author:this.options.user?.name||this.strings.anonymous,authorId:P(this.options.user?.id)||null,createdAt:new Date().toISOString(),screenshots:l,type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:[],resolvedAt:null,context:$t(),contextScreenshot:a};Y(c,"created",this._actor()),this.comments.push(c),this._syncStorage();let d=this._serializeComment(c);this._asUser(()=>this._emit("comment:created",[d],{comment:d})),this.renderCommentCircle(c),this.hideCommentBox(),this.toggleCommentMode();let p=this._circles.get(String(c.id));p&&this.showThreadPopover(p,c)}renderCommentCircle(e){this.markers.render(e)}_wireMarker(e,t){e.addEventListener("mouseenter",()=>this.showCommentTooltip(e,t)),e.addEventListener("mouseleave",()=>{setTimeout(()=>{let o=this._tooltipEl(t.id);o&&!o.matches(":hover")&&o.remove()},250)}),e.addEventListener("click",o=>{if(o.stopPropagation(),this._tooltipEl(t.id)?.remove(),this.activeThreadPopover?.dataset.for===String(t.id)){this.closeThreadPopover();return}this.showThreadPopover(e,t)}),e.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),e.click())})}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${n.THREAD_POPOVER}[data-for="${W(t.id)}"]`)||this._tooltipEl(t.id))return;let s=bo(t,this.strings,this.locale);this.shadowRoot.appendChild(s),$(s,r=>this.showLightbox(r)),setTimeout(()=>{Ee(s,e)},10),s.querySelector(`.${n.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 Xe({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:this._userActions({onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onOpenDetail:e=>this._notifyCommentOpened(e),onTransformScreenshot:(e,t)=>this._transformScreenshot(e,"attachment",t),onReply:(e,t,o)=>this.addReply(e,t,o),onDelete:e=>this.deleteComment(e),onDeleteReply:(e,t)=>this.deleteReply(e,t),onEditComment:(e,t)=>{this.editComment(e,t)&&this._popover.refreshCommentViews(e)},onEditReply:(e,t,o)=>{this.editReply(e,t,o)&&this._popover.refreshCommentViews(e)},actorKey:()=>this._actorKey(),onToggleCommentReaction:(e,t)=>this.toggleCommentReaction(e,t),onToggleReplyReaction:(e,t,o)=>this.toggleReplyReaction(e,t,o),onExportComments:e=>this.exportCommentsCsv(e),onExportMetrics:e=>this.exportMetricsCsv(e),onPrintReport:(e,t)=>this.printMetricsReport(e,t),onSetStatus:(e,t)=>this.setCommentStatus(e,t),onSetType:(e,t)=>this.setCommentType(e,t),onSetPriority:(e,t)=>this.setCommentPriority(e,t),onNavigateToPage:e=>{try{sessionStorage.setItem(Oe,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),this._notifyCommentOpened(t)}_notifyCommentOpened(e){e&&this._notify("onCommentOpened",[this._serializeComment(e)])}_notify(e,t){let o=this.options[e];if(typeof o=="function")try{o(...t)}catch(s){console.warn(`HellDots: ${e} handler threw`,s)}}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=n.LIGHTBOX,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",this.strings.screenshotPreview);let o=document.createElement("img");o.className=n.LIGHTBOX_IMG,o.src=e,o.alt=this.strings.screenshotPreview;let s=document.createElement("button");s.type="button",s.className=n.LIGHTBOX_CLOSE,s.setAttribute("aria-label",this.strings.close),s.innerHTML="&times;",s.addEventListener("click",()=>this.closeLightbox()),t.appendChild(o),t.appendChild(s),t.addEventListener("click",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?.(`.${n.LIGHTBOX}`)}_findComment(e){return this.comments.find(t=>y(t.id,e))}_tooltipEl(e){return this.shadowRoot?.querySelector(`.${n.TOOLTIP}[data-for="${W(e)}"]`)??null}addReply(e,t,o=[]){let s=typeof e=="object"&&e!==null?e:this._findComment(e);if(!s)return null;s.replies||(s.replies=[]);let r={id:Qe(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,authorId:P(this.options.user?.id)||null,timestamp:new Date().toISOString(),screenshots:o};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 o=this._findComment(e),s=o?.replies?.findIndex(c=>y(c.id,t))??-1;if(s<0)return!1;let[r]=o.replies.splice(s,1);this._syncStorage();let a=this._serializeComment(o),l=this._serializeReply(r);return this._emit("reply:deleted",[a,l],{comment:a,reply:l}),!0}editComment(e,t){let o=this._findComment(e),s=String(t??"").trim();if(!o||!s||s===o.text)return!1;o.text=s,o.editedAt=new Date().toISOString(),Y(o,"edited",this._actor()),this._circles.get(String(o.id))?.setAttribute("aria-label",`${this.strings.commentAriaLabelPrefix}${o.text}`),this._syncStorage();let r=this._serializeComment(o);return this._emit("comment:edited",[r],{comment:r}),!0}editReply(e,t,o){let s=this._findComment(e),r=s?.replies?.find(d=>y(d.id,t)),a=String(o??"").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:o,authorId:s,timestamp:r,screenshots:a,editedAt:l,reactions:c=null}){return{id:e,text:t,author:o,authorId:s||null,timestamp:r,screenshots:a||[],editedAt:l||null,reactions:it(c)}}_serializeComment(e){return{schemaVersion:1,id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),author:e.author,authorId:e.authorId||null,history:ao(e.history),createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],reactions:it(e.reactions),resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,t){if(!S.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;if(o.status===t)return!0;let s=o.status;o.status=t,o.resolvedAt=t==="resolved"?new Date().toISOString():null,Y(o,"status",this._actor(),{from:s,to:t});let r=this._circles.get(String(o.id));r&&this.updateCommentPosition(o,r),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let a=this._serializeComment(o);return this._emit("comment:status-changed",[a],{comment:a},{from:s,to:t}),!0}setUser(e){return e!=null&&(typeof e!="object"||typeof e.name!="string"||!e.name.trim())?!1:(this.options.user=e??void 0,this._popover?.close(),this.inboxView?.isOpen()&&this.inboxView.refresh(),!0)}_actor(){return ro(this.options.user,this.strings)}_actorKey(){return oo(this.options.user,this.strings)}_commitReaction(e,t){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let o=this._serializeComment(e),s=t?this._serializeReply(t):null;return this._emit("reaction:toggled",[o,s],{comment:o,reply:s}),!0}toggleCommentReaction(e,t){let o=this._findComment(e);return!o||!ot(o,t,this._actorKey())?!1:this._commitReaction(o,null)}toggleReplyReaction(e,t,o){let s=this._findComment(e),r=s?.replies?.find(a=>y(a.id,t));return!r||!ot(r,o,this._actorKey())?!1:this._commitReaction(s,r)}_commitUpdate(e,t){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let o=this._serializeComment(e);return this._emit("comment:updated",[o],{comment:o},t),!0}setCommentType(e,t){if(t!==null&&!R.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=o.type??null;return s===t?!0:(o.type=t,Y(o,"classified",this._actor(),{field:"type",from:s,to:t}),this._commitUpdate(o,{field:"type",from:s,to:t}))}setCommentPriority(e,t){if(t!==null&&!A.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=o.priority??null;return s===t?!0:(o.priority=t,Y(o,"classified",this._actor(),{field:"priority",from:s,to:t}),this._commitUpdate(o,{field:"priority",from:s,to:t}))}setCommentTags(e,t){if(!Array.isArray(t))return!1;let o=this._findComment(e);if(!o)return!1;let s=[...o.tags||[]],r=s.join("\0"),a=an(t);return a.join("\0")===r?!0:(o.tags=a,Y(o,"classified",this._actor(),{field:"tags"}),this._commitUpdate(o,{field:"tags",from:s,to:[...a]}))}getMetrics(){return se(this.serializeComments())}exportCommentsCsv(e){let t=Mo(e||this.serializeComments()),o=Et(t,bt(wo));return Ct("helldots-comments.csv",o),o}exportMetricsCsv(e){let t=se(e||this.serializeComments()),o=Et(Do(t),bt(Lo));return Ct("helldots-metrics.csv",o),o}printMetricsReport(e,t){let o=se(e||this.serializeComments());ko(o,{strings:this.strings,locale:this.locale,css:Ut(),scope:t})}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){if(!this._findComment(e))return!1;if(this._removeComment(e),this.options.persistence==="localStorage"){let t=Je(this._readStoredCached().filter(o=>!y(o.id,e)),this.serializeComments(),location.pathname);Ie(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=>!y(t.id,e))}clearComments(){this.closeThreadPopover();let e=this.comments;if(this.markers?.clear(),this.comments=[],this.options.persistence==="localStorage"&&e.length>0){let t=new Set(e.map(s=>String(s.id))),o=this._readStoredCached().filter(s=>!t.has(String(s.id)));Ie(o),this._storedCache=o}this.inboxView?.isOpen()&&this.inboxView.refresh()}loadComments(e){let t=0,o=0,s=0;if(!Array.isArray(e))return{anchored:t,orphaned:o,inactive:s};if(!this.markers)return this._deferredLoad=[...this._deferredLoad||[],...e],{anchored:t,orphaned:o,inactive:s};for(let r of e){if(!r||r.id==null||typeof r.text!="string"){console.warn("HellDots: skipping malformed serialized comment",r),this._reportError(new Error("HellDots: skipping malformed serialized comment"),"load");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=>({...c,authorId:P(c.authorId)||null,...Array.isArray(c.screenshots)?{screenshots:Po(c.screenshots)}:{},reactions:tt(c.reactions)})):[],author:r.author||this.strings.anonymous,authorId:P(r.authorId)||null,history:so(r.history),createdAt:r.createdAt||new Date().toISOString(),screenshots:Array.isArray(r.screenshots)?Po(r.screenshots):[],status:r.status==="closed"?"resolved":S.includes(r.status)?r.status:"open",type:R.includes(r.type)?r.type:null,priority:A.includes(r.priority)?r.priority:null,tags:Array.isArray(r.tags)?[...r.tags]:[],resolvedAt:r.resolvedAt||null,reactions:tt(r.reactions),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?qe(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),o++;let c=this._serializeComment(a);this._emit("comment:anchor-lost",[c],{comment:c})}}return this._openPendingDetail(),{anchored:t,orphaned:o,inactive:s}}notifyNavigation(){let e=location.pathname,t=0,o=0,s=0;if(!this.markers)return{anchored:t,orphaned:o,inactive:s};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?qe(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",o++;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:o,inactive:s}}scrollMarkerIntoView(e){this.markers.scrollMarkerIntoView(e)}createPreviewCircle(e,t){this.removePreviewCircle();let o=document.createElement("div");o.className=`${n.CIRCLE} ${n.PREVIEW_CIRCLE}`,o.style.position="absolute";let s=B/2;o.style.left=`${e+s}px`,o.style.top=`${t+s}px`,o.style.transform="translate(-50%, -50%)",o.style.pointerEvents="none",this.overlay.appendChild(o),this.previewCircle=o}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){this.markers.cleanupResizeObserver(e)}validateAndCalculatePosition(e,t){return this.markers.validateAndCalculatePosition(e,t)}updateCommentPosition(e,t){this.markers.updatePosition(e,t)}scheduleUpdatePositions(){this.markers.scheduleUpdate()}get _circles(){return this.markers?.circles}get resizeObservers(){return this.markers?.resizeObservers}get positionValidationEnabled(){return this.markers?.enabled??!0}set positionValidationEnabled(e){this.markers&&(this.markers.enabled=e)}get _globalMutationObserver(){return this.markers?._globalMutationObserver??null}_dismissMarkerUi(e){this._tooltipEl(e.id)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}cleanup(){this._onDomReady&&(document.removeEventListener("DOMContentLoaded",this._onDomReady),this._onDomReady=null),this.markers?.destroy(),this._storageHandler&&(window.removeEventListener("storage",this._storageHandler),this._storageHandler=null),this._popstateHandler&&(window.removeEventListener("popstate",this._popstateHandler),this._popstateHandler=null),this._storedCache=null,this._deferredLoad=null,Ae(),lo(),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(n.COMMENT_CURSOR),this._detachStyles(),document.querySelector(k)?.remove()}injectStyles(){this._detachStyles(),this._styleDetachers=[de(this.shadowRoot,Ht(),x.STYLES),de(document,Xt(),x.GLOBAL_STYLES)]}_detachStyles(){for(let e of this._styleDetachers??[])e();this._styleDetachers=[]}},$o=Tt;function cn(i={}){let{autoInit:e=!0,...t}=i,o=()=>new $o(t);return e?o():o}var Xs=cn;export{$o as CommentOverlay,ue as DEFAULT_LINK_PARAM,cn as createCommentOverlay,Xs as default,nt as readCommentLinkParam};
10
10
  //# sourceMappingURL=helldots.esm.js.map