@qaiddev/thumbs-embed 1.6.2 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,40 +2,40 @@ const V = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none"
2
2
  <path stroke-linecap="round" stroke-linejoin="round" d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"/>
3
3
  </svg>`, N = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
4
4
  <path stroke-linecap="round" stroke-linejoin="round" d="M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.737 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.095c.5 0 .905-.405.905-.905 0-.714.211-1.412.608-2.006L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5"/>
5
- </svg>`, Nt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
5
+ </svg>`, Xt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
6
6
  <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 10.5l4.72-4.72a.75.75 0 011.28.53v11.38a.75.75 0 01-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25h-9A2.25 2.25 0 002.25 7.5v9a2.25 2.25 0 002.25 2.25z"/>
7
- </svg>`, pt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
7
+ </svg>`, gt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
8
8
  <path stroke-linecap="round" stroke-linejoin="round" d="M8 10h8M8 14h5m-9 6l3.5-3.5H18a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v14z"/>
9
- </svg>`, Ut = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
9
+ </svg>`, Yt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
10
10
  <rect x="4" y="6" width="16" height="12" rx="1" stroke-linejoin="round"/>
11
- </svg>`, jt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
11
+ </svg>`, Qt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
12
12
  <path stroke-linecap="round" stroke-linejoin="round" d="M5 19L19 5m0 0h-8m8 0v8"/>
13
- </svg>`, Kt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
13
+ </svg>`, Gt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
14
14
  <path stroke-linecap="round" stroke-linejoin="round" d="M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/>
15
- </svg>`, Wt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
15
+ </svg>`, Jt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
16
16
  <path stroke-linecap="round" stroke-linejoin="round" d="M12 3s6 6.4 6 10a6 6 0 01-12 0c0-3.6 6-10 6-10z"/>
17
- </svg>`, Xt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
17
+ </svg>`, Zt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
18
18
  <path stroke-linecap="round" stroke-linejoin="round" d="M9 14L4 9l5-5M4 9h11a5 5 0 010 10h-4"/>
19
- </svg>`, Yt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
19
+ </svg>`, vt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
20
20
  <path stroke-linecap="round" stroke-linejoin="round" d="M20 6L9 17l-5-5"/>
21
- </svg>`, Qt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
21
+ </svg>`, te = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
22
22
  <path stroke-linecap="round" stroke-linejoin="round" d="M6 6l12 12M18 6L6 18"/>
23
- </svg>`, Gt = "button{cursor:pointer}.qaid-buttons{display:flex;gap:.5rem}.qaid-buttons.qaid-vertical{flex-direction:column}.qaid-buttons.qaid-auto-container{position:fixed;z-index:50}.qaid-buttons.qaid-auto-container.qaid-bottom-right{bottom:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-bottom-left{bottom:1rem;left:1rem}.qaid-buttons.qaid-auto-container.qaid-top-right{top:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-top-left{top:1rem;left:1rem}.qaid-buttons.qaid-incognito{opacity:0;transition:opacity .2s ease-in-out}.qaid-buttons.qaid-incognito:hover{opacity:1}.qaid-buttons.qaid-dismissed{display:none!important}.qaid-dismiss-btn{width:20px;height:20px;padding:0;border:none;border-radius:50%;background:#0006;color:#fff;display:flex;align-items:center;justify-content:center;align-self:center;opacity:0;transition:opacity .15s,background .15s;cursor:pointer;pointer-events:auto;-webkit-appearance:none;appearance:none}.qaid-dismiss-btn:hover{background:#0009}.qaid-buttons:hover .qaid-dismiss-btn{opacity:1}button.qaid-btn-structural{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-appearance:none;appearance:none}.qaid-icon{width:24px;height:24px}.qaid-btn-structural:not(:has(svg)),.qaid-btn:not(:has(svg)){font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-emoji-icon{font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-buttons,.qaid-buttons *,.qaid-modal-container,.qaid-modal-container *{cursor:pointer!important}.qaid-tooltip-wrapper{position:relative}.qaid-tooltip-text{position:fixed;padding:.5rem .75rem;background:#1f2937;color:#fff;font-size:1rem;font-weight:600;border-radius:.5rem;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:99999}.qaid-tooltip-text.qaid-tooltip-visible{opacity:1}.qaid-targeting-overlay{position:fixed;inset:0;z-index:40;pointer-events:none}.qaid-capture-layer{position:fixed;inset:0;pointer-events:none;z-index:9999}@keyframes qaid-slideDown{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.qaid-vignette{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,transparent 30%,rgba(0,0,0,.3) 70%,rgba(0,0,0,.6) 100%);z-index:41}.qaid-crosshair-h,.qaid-crosshair-v{position:fixed;pointer-events:none;z-index:42}.qaid-crosshair-h{left:0;right:0;height:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-crosshair-v{top:0;bottom:0;width:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-type-up .qaid-crosshair-h,.qaid-type-up .qaid-crosshair-v{background:color-mix(in srgb,var(--qaid-positive) 60%,transparent)}.qaid-highlight-box{position:fixed;top:0;left:0;pointer-events:none;z-index:41;display:none;border:3px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:2px;background:color-mix(in srgb,var(--qaid-negative) 8%,transparent);will-change:transform,width,height}.qaid-type-up .qaid-highlight-box{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent);background:color-mix(in srgb,var(--qaid-positive) 8%,transparent)}.qaid-scope{position:fixed;width:80px;height:80px;pointer-events:none;z-index:43;transform:translate(-50%,-50%)}.qaid-scope-ring{position:absolute;inset:10px;border:2px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent)}.qaid-scope-ring-inner{position:absolute;inset:20px;border:1px solid color-mix(in srgb,var(--qaid-negative) 50%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring-inner{border-color:color-mix(in srgb,var(--qaid-positive) 50%,transparent)}.qaid-scope-dot{position:absolute;top:50%;left:50%;width:4px;height:4px;background:var(--qaid-negative);border-radius:50%;transform:translate(-50%,-50%)}.qaid-type-up .qaid-scope-dot{background:var(--qaid-positive)}.qaid-selected-marker{position:fixed;border:3px solid var(--qaid-marker, #6366f1);border-radius:50%;pointer-events:none;z-index:44;animation:qaid-markerPulse 1.5s ease-in-out infinite}@keyframes qaid-markerPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.05)}}.qaid-backdrop{position:fixed;inset:0;z-index:45;background:#0000004d}.qaid-modal-container{position:fixed;z-index:50;display:flex;flex-direction:column;align-items:flex-start;max-height:calc(100vh - 32px);font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-modal-container.qaid-above{flex-direction:column-reverse}.qaid-modal-arrow{width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;position:relative;align-self:flex-start}.qaid-modal-container.qaid-below .qaid-modal-arrow{border-bottom:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-container.qaid-above .qaid-modal-arrow{border-top:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5));width:var(--qaid-modal-width, 400px);max-width:calc(100vw - 32px);max-height:calc(100vh - 60px);overflow-y:auto}.qaid-modal-header{display:flex;align-items:flex-start;gap:.75rem;margin-bottom:1rem}button.qaid-type-toggle{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;flex-shrink:0;-webkit-appearance:none;appearance:none}button.qaid-type-toggle:hover{transform:scale(1.1)}button.qaid-type-toggle:not(.qaid-type-toggle-custom){width:2.5rem;height:2.5rem;border-radius:50%}button.qaid-type-toggle:not(.qaid-type-toggle-custom) svg{width:1.25rem;height:1.25rem}button.qaid-type-toggle.qaid-type-up{background:var(--qaid-positive);color:#fff}button.qaid-type-toggle.qaid-type-down{background:var(--qaid-negative);color:#fff}.qaid-type-static{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--qaid-marker, #6366f1);color:var(--qaid-marker-text, white)}.qaid-type-static svg{width:1.25rem;height:1.25rem}.qaid-modal-header-text{flex:1;min-width:0}.qaid-modal-title{font-size:1.125rem;font-weight:700;margin:0 0 .25rem;color:light-dark(#1f2937,#f9fafb)}.qaid-modal-subtitle{color:light-dark(#6b7280,#9ca3af);margin:0;font-size:.875rem}.qaid-textarea{width:100%;height:6rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:1rem;resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-btn-row{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-btn-submit{padding:.5rem 1rem;background:var(--qaid-marker);color:var(--qaid-marker-text, white);border:none;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-btn-submit:hover{filter:brightness(.85)}button.qaid-btn-submit:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 30%,transparent)}.qaid-bottom-sheet{position:fixed;bottom:0;left:0;right:0;z-index:50;animation:qaid-slideUpSheet .3s ease-out;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-bottom-sheet-content{background:light-dark(#ffffff,#1f2937);border-radius:1rem 1rem 0 0;padding:1.5rem;padding-bottom:max(1.5rem,env(safe-area-inset-bottom))}.qaid-bottom-sheet-handle{width:36px;height:4px;background:light-dark(rgba(0,0,0,.2),rgba(255,255,255,.2));border-radius:2px;margin:0 auto 1rem}@keyframes qaid-slideUpSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}button.qaid-btn-record:hover{background:#dc2626;color:#fff}.qaid-recording-indicator{position:fixed;top:12px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:light-dark(#1f2937,#374151);color:#fff;border-radius:9999px;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:.875rem;font-weight:500;box-shadow:0 4px 12px #0000004d;z-index:99999;animation:qaid-slideDown .2s ease-out}.qaid-recording-dot{width:10px;height:10px;background:#dc2626;border-radius:50%;animation:qaid-dotPulse 1.5s ease-in-out infinite}@keyframes qaid-dotPulse{0%,to{opacity:1}50%{opacity:.3}}.qaid-recording-time{font-variant-numeric:tabular-nums;min-width:2.5rem;text-align:center}button.qaid-recording-stop{padding:.25rem .75rem;background:#dc2626;color:#fff;border:none;border-radius:9999px;font-size:.75rem;font-weight:600;cursor:pointer;transition:background-color .2s;-webkit-appearance:none;appearance:none}button.qaid-recording-stop:hover{background:#b91c1c}.qaid-video-preview{position:fixed;inset:0 0 auto;height:100vh;height:100dvh;display:flex;align-items:center;justify-content:center;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#0009;z-index:99998;animation:qaid-fadeIn .2s ease-out}@keyframes qaid-fadeIn{0%{opacity:0}to{opacity:1}}.qaid-video-preview-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px #00000080;width:560px;max-width:100%;max-height:100%;overflow-y:auto;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-video-preview-box h3{font-size:1.125rem;font-weight:700;margin:0 0 1rem;color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box video{width:100%;max-height:50vh;max-height:50dvh;object-fit:contain;border-radius:.5rem;background:#000;margin-bottom:1rem}.qaid-video-preview-box textarea{width:100%;height:4rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:.875rem;resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-video-preview-actions{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-video-btn{padding:.5rem 1rem;border:none;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-video-btn-cancel{background:light-dark(#f3f4f6,#374151);color:light-dark(#374151,#d1d5db)}button.qaid-video-btn-cancel:hover{background:light-dark(#e5e7eb,#4b5563)}button.qaid-video-btn-rerecord{background:light-dark(#fef3c7,#78350f);color:light-dark(#92400e,#fde68a)}button.qaid-video-btn-rerecord:hover{filter:brightness(.9)}button.qaid-video-btn-send{background:var(--qaid-marker);color:var(--qaid-marker-text, white)}button.qaid-video-btn-send:hover{filter:brightness(.85)}button.qaid-video-btn-send:disabled{opacity:.5;cursor:not-allowed}.qaid-video-sending{display:flex;align-items:center;gap:.5rem;font-size:.875rem;color:light-dark(#6b7280,#9ca3af)}.qaid-annotate{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;gap:.75rem;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#000000d9;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px);animation:qaid-fadeIn .2s ease-out}.qaid-annotate-title{margin:0;font-size:1rem;font-weight:700;text-align:center;color:#f9fafb}.qaid-annotate-desc{margin:0;font-size:.8125rem;line-height:1.4;text-align:center;color:#f9fafbbf}.qaid-annotate-stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto}.qaid-annotate-canvas{max-width:100%;max-height:100%;object-fit:contain;background:light-dark(#ffffff,#111827);border-radius:.5rem;box-shadow:0 10px 30px #00000080;touch-action:none;cursor:crosshair}.qaid-annotate-toolbar{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:center;padding:.5rem .75rem;background:light-dark(#ffffff,#1f2937);border-radius:.75rem;box-shadow:0 10px 30px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5))}.qaid-annotate-tools,.qaid-annotate-actions{display:flex;gap:.375rem;align-items:center}button.qaid-annotate-tool,button.qaid-annotate-action{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;min-width:44px;min-height:44px;padding:0 .75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;background:light-dark(#f9fafb,#111827);color:light-dark(#1f2937,#f9fafb);font-family:inherit;font-size:.8125rem;font-weight:600;cursor:pointer;-webkit-appearance:none;appearance:none;transition:background-color .15s,color .15s,border-color .15s,filter .15s}button.qaid-annotate-tool svg,button.qaid-annotate-action svg{width:20px;height:20px}.qaid-annotate-colors{display:flex;gap:.25rem;align-items:center}button.qaid-annotate-swatch{width:28px;height:28px;min-width:28px;padding:0;border-radius:9999px;border:2px solid light-dark(#d1d5db,#4b5563);background:var(--qaid-swatch, #000);cursor:pointer;-webkit-appearance:none;appearance:none;transition:transform .1s,box-shadow .15s,border-color .15s}button.qaid-annotate-swatch:hover{transform:scale(1.12)}button.qaid-annotate-swatch[aria-pressed=true]{border-color:light-dark(#111827,#f9fafb);box-shadow:0 0 0 2px var(--qaid-swatch)}@media(forced-colors:active){button.qaid-annotate-swatch[aria-pressed=true]{outline:2px solid Highlight;outline-offset:1px}}button.qaid-annotate-tool:hover,button.qaid-annotate-action:hover{background:light-dark(#eef2ff,#312e81)}button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{background:var(--qaid-marker, #6366f1);color:var(--qaid-marker-text, #fff);border-color:var(--qaid-marker, #6366f1)}button.qaid-annotate-done:hover{filter:brightness(.9);background:var(--qaid-marker, #6366f1)}button.qaid-annotate-action:disabled{opacity:.45;cursor:not-allowed}@media(forced-colors:active){button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{border:2px solid Highlight}.qaid-annotate-canvas{border:1px solid CanvasText}}button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible{outline:2px solid var(--qaid-marker, #6366f1);outline-offset:2px}.qaid-textarea:focus-visible,button.qaid-btn-submit:focus-visible,.qaid-video-preview-box textarea:focus-visible{outline:2px solid var(--qaid-marker, #6366f1);outline-offset:2px}.qaid-buttons.qaid-incognito:focus-within{opacity:1}.qaid-buttons:focus-within .qaid-dismiss-btn,.qaid-dismiss-btn:focus-visible{opacity:1}.qaid-dismiss-btn{min-width:24px;min-height:24px}button.qaid-recording-stop{min-height:24px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}@media(forced-colors:active){button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible,.qaid-textarea:focus,button.qaid-btn-submit:focus,.qaid-video-preview-box textarea:focus{outline:2px solid CanvasText;outline-offset:2px}.qaid-selected-marker,.qaid-highlight-box{border-color:Highlight}}", Jt = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}";
23
+ </svg>`, ee = "button{cursor:pointer}.qaid-buttons{display:flex;gap:.5rem}.qaid-buttons.qaid-vertical{flex-direction:column}.qaid-buttons.qaid-auto-container{position:fixed;z-index:50}.qaid-buttons.qaid-auto-container.qaid-bottom-right{bottom:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-bottom-left{bottom:1rem;left:1rem}.qaid-buttons.qaid-auto-container.qaid-top-right{top:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-top-left{top:1rem;left:1rem}.qaid-buttons.qaid-incognito{opacity:0;transition:opacity .2s ease-in-out}.qaid-buttons.qaid-incognito:hover{opacity:1}.qaid-buttons.qaid-dismissed{display:none!important}.qaid-dismiss-btn{width:20px;height:20px;padding:0;border:none;border-radius:50%;background:#0006;color:#fff;display:flex;align-items:center;justify-content:center;align-self:center;opacity:0;transition:opacity .15s,background .15s;cursor:pointer;pointer-events:auto;-webkit-appearance:none;appearance:none}.qaid-dismiss-btn:hover{background:#0009}.qaid-buttons:hover .qaid-dismiss-btn{opacity:1}button.qaid-btn-structural{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-appearance:none;appearance:none}.qaid-icon{width:24px;height:24px}.qaid-btn-structural:not(:has(svg)),.qaid-btn:not(:has(svg)){font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-emoji-icon{font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-buttons,.qaid-buttons *,.qaid-modal-container,.qaid-modal-container *{cursor:pointer!important}.qaid-tooltip-wrapper{position:relative}.qaid-tooltip-text{position:fixed;padding:.5rem .75rem;background:#1f2937;color:#fff;font-size:1rem;font-weight:600;border-radius:.5rem;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:99999}.qaid-tooltip-text.qaid-tooltip-visible{opacity:1}.qaid-targeting-overlay{position:fixed;inset:0;z-index:40;pointer-events:none}.qaid-capture-layer{position:fixed;inset:0;pointer-events:none;z-index:9999}@keyframes qaid-slideDown{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.qaid-vignette{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,transparent 30%,rgba(0,0,0,.3) 70%,rgba(0,0,0,.6) 100%);z-index:41}.qaid-crosshair-h,.qaid-crosshair-v{position:fixed;pointer-events:none;z-index:42}.qaid-crosshair-h{left:0;right:0;height:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-crosshair-v{top:0;bottom:0;width:1px;background:color-mix(in srgb,var(--qaid-negative) 60%,transparent)}.qaid-type-up .qaid-crosshair-h,.qaid-type-up .qaid-crosshair-v{background:color-mix(in srgb,var(--qaid-positive) 60%,transparent)}.qaid-highlight-box{position:fixed;top:0;left:0;pointer-events:none;z-index:41;display:none;border:3px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:2px;background:color-mix(in srgb,var(--qaid-negative) 8%,transparent);will-change:transform,width,height}.qaid-type-up .qaid-highlight-box{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent);background:color-mix(in srgb,var(--qaid-positive) 8%,transparent)}.qaid-scope{position:fixed;width:80px;height:80px;pointer-events:none;z-index:43;transform:translate(-50%,-50%)}.qaid-scope-ring{position:absolute;inset:10px;border:2px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring{border-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent)}.qaid-scope-ring-inner{position:absolute;inset:20px;border:1px solid color-mix(in srgb,var(--qaid-negative) 50%,transparent);border-radius:50%}.qaid-type-up .qaid-scope-ring-inner{border-color:color-mix(in srgb,var(--qaid-positive) 50%,transparent)}.qaid-scope-dot{position:absolute;top:50%;left:50%;width:4px;height:4px;background:var(--qaid-negative);border-radius:50%;transform:translate(-50%,-50%)}.qaid-type-up .qaid-scope-dot{background:var(--qaid-positive)}.qaid-selected-marker{position:fixed;border:3px solid var(--qaid-marker, #6366f1);border-radius:50%;pointer-events:none;z-index:44;animation:qaid-markerPulse 1.5s ease-in-out infinite}@keyframes qaid-markerPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.05)}}.qaid-backdrop{position:fixed;inset:0;z-index:45;background:#0000004d}.qaid-modal-container{position:fixed;z-index:50;display:flex;flex-direction:column;align-items:flex-start;max-height:calc(100vh - 32px);font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-modal-container.qaid-above{flex-direction:column-reverse}.qaid-modal-arrow{width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;position:relative;align-self:flex-start}.qaid-modal-container.qaid-below .qaid-modal-arrow{border-bottom:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-container.qaid-above .qaid-modal-arrow{border-top:12px solid light-dark(#ffffff,#1f2937)}.qaid-modal-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5));width:var(--qaid-modal-width, 400px);max-width:calc(100vw - 32px);max-height:calc(100vh - 60px);overflow-y:auto}.qaid-modal-header{display:flex;align-items:flex-start;gap:.75rem;margin-bottom:1rem}button.qaid-type-toggle{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;flex-shrink:0;-webkit-appearance:none;appearance:none}button.qaid-type-toggle:hover{transform:scale(1.1)}button.qaid-type-toggle:not(.qaid-type-toggle-custom){width:2.5rem;height:2.5rem;border-radius:50%}button.qaid-type-toggle:not(.qaid-type-toggle-custom) svg{width:1.25rem;height:1.25rem}button.qaid-type-toggle.qaid-type-up{background:var(--qaid-positive);color:#fff}button.qaid-type-toggle.qaid-type-down{background:var(--qaid-negative);color:#fff}.qaid-type-static{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--qaid-marker, #6366f1);color:var(--qaid-marker-text, white)}.qaid-type-static svg{width:1.25rem;height:1.25rem}.qaid-modal-header-text{flex:1;min-width:0}.qaid-modal-title{font-size:1.125rem;font-weight:700;margin:0 0 .25rem;color:light-dark(#1f2937,#f9fafb)}.qaid-modal-subtitle{color:light-dark(#6b7280,#9ca3af);margin:0;font-size:.875rem}.qaid-textarea{width:100%;height:6rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:1rem;resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-btn-row{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-btn-submit{padding:.5rem 1rem;background:var(--qaid-marker);color:var(--qaid-marker-text, white);border:none;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-btn-submit:hover{filter:brightness(.85)}button.qaid-btn-submit:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 30%,transparent)}.qaid-bottom-sheet{position:fixed;bottom:0;left:0;right:0;z-index:50;animation:qaid-slideUpSheet .3s ease-out;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-bottom-sheet-content{background:light-dark(#ffffff,#1f2937);border-radius:1rem 1rem 0 0;padding:1.5rem;padding-bottom:max(1.5rem,env(safe-area-inset-bottom))}.qaid-bottom-sheet-handle{width:36px;height:4px;background:light-dark(rgba(0,0,0,.2),rgba(255,255,255,.2));border-radius:2px;margin:0 auto 1rem}@keyframes qaid-slideUpSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}button.qaid-btn-record:hover{background:#dc2626;color:#fff}.qaid-recording-indicator{position:fixed;top:12px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:light-dark(#1f2937,#374151);color:#fff;border-radius:9999px;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:.875rem;font-weight:500;box-shadow:0 4px 12px #0000004d;z-index:99999;animation:qaid-slideDown .2s ease-out}.qaid-recording-dot{width:10px;height:10px;background:#dc2626;border-radius:50%;animation:qaid-dotPulse 1.5s ease-in-out infinite}@keyframes qaid-dotPulse{0%,to{opacity:1}50%{opacity:.3}}.qaid-recording-time{font-variant-numeric:tabular-nums;min-width:2.5rem;text-align:center}button.qaid-recording-stop{padding:.25rem .75rem;background:#dc2626;color:#fff;border:none;border-radius:9999px;font-size:.75rem;font-weight:600;cursor:pointer;transition:background-color .2s;-webkit-appearance:none;appearance:none}button.qaid-recording-stop:hover{background:#b91c1c}.qaid-video-preview{position:fixed;inset:0 0 auto;height:100vh;height:100dvh;display:flex;align-items:center;justify-content:center;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#0009;z-index:99998;animation:qaid-fadeIn .2s ease-out}@keyframes qaid-fadeIn{0%{opacity:0}to{opacity:1}}.qaid-video-preview-box{color-scheme:inherit;background:light-dark(#ffffff,#1f2937);border-radius:1rem;padding:1.5rem;box-shadow:0 25px 50px -12px #00000080;width:560px;max-width:100%;max-height:100%;overflow-y:auto;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px)}.qaid-video-preview-box h3{font-size:1.125rem;font-weight:700;margin:0 0 1rem;color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box video{width:100%;max-height:50vh;max-height:50dvh;object-fit:contain;border-radius:.5rem;background:#000;margin-bottom:1rem}.qaid-video-preview-box textarea{width:100%;height:4rem;padding:.75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;font-family:inherit;font-size:.875rem;resize:vertical;margin-bottom:1rem;box-sizing:border-box;background:light-dark(#ffffff,#111827);color:light-dark(#1f2937,#f9fafb)}.qaid-video-preview-box textarea:focus{outline:none;border-color:var(--qaid-marker);box-shadow:0 0 0 3px color-mix(in srgb,var(--qaid-marker) 20%,transparent)}.qaid-video-preview-actions{display:flex;gap:.5rem;justify-content:flex-end}button.qaid-video-btn{padding:.5rem 1rem;border:none;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:background-color .2s,filter .2s;-webkit-appearance:none;appearance:none}button.qaid-video-btn-cancel{background:light-dark(#f3f4f6,#374151);color:light-dark(#374151,#d1d5db)}button.qaid-video-btn-cancel:hover{background:light-dark(#e5e7eb,#4b5563)}button.qaid-video-btn-rerecord{background:light-dark(#fef3c7,#78350f);color:light-dark(#92400e,#fde68a)}button.qaid-video-btn-rerecord:hover{filter:brightness(.9)}button.qaid-video-btn-send{background:var(--qaid-marker);color:var(--qaid-marker-text, white)}button.qaid-video-btn-send:hover{filter:brightness(.85)}button.qaid-video-btn-send:disabled{opacity:.5;cursor:not-allowed}.qaid-video-sending{display:flex;align-items:center;gap:.5rem;font-size:.875rem;color:light-dark(#6b7280,#9ca3af)}.qaid-annotate{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;gap:.75rem;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:#000000d9;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px);animation:qaid-fadeIn .2s ease-out}.qaid-annotate-title{margin:0;font-size:1rem;font-weight:700;text-align:center;color:#f9fafb}.qaid-annotate-desc{margin:0;font-size:.8125rem;line-height:1.4;text-align:center;color:#f9fafbbf}.qaid-annotate-stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto}.qaid-annotate-canvas{max-width:100%;max-height:100%;object-fit:contain;background:light-dark(#ffffff,#111827);border-radius:.5rem;box-shadow:0 10px 30px #00000080;touch-action:none;cursor:crosshair}.qaid-annotate-toolbar{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:center;padding:.5rem .75rem;background:light-dark(#ffffff,#1f2937);border-radius:.75rem;box-shadow:0 10px 30px light-dark(rgba(0,0,0,.25),rgba(0,0,0,.5))}.qaid-annotate-tools,.qaid-annotate-actions{display:flex;gap:.375rem;align-items:center}button.qaid-annotate-tool,button.qaid-annotate-action{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;min-width:44px;min-height:44px;padding:0 .75rem;border:1px solid light-dark(#d1d5db,#374151);border-radius:.5rem;background:light-dark(#f9fafb,#111827);color:light-dark(#1f2937,#f9fafb);font-family:inherit;font-size:.8125rem;font-weight:600;cursor:pointer;-webkit-appearance:none;appearance:none;transition:background-color .15s,color .15s,border-color .15s,filter .15s}button.qaid-annotate-tool svg,button.qaid-annotate-action svg{width:20px;height:20px}.qaid-annotate-colors{display:flex;gap:.25rem;align-items:center}button.qaid-annotate-swatch{width:28px;height:28px;min-width:28px;padding:0;border-radius:9999px;border:2px solid light-dark(#d1d5db,#4b5563);background:var(--qaid-swatch, #000);cursor:pointer;-webkit-appearance:none;appearance:none;transition:transform .1s,box-shadow .15s,border-color .15s}button.qaid-annotate-swatch:hover{transform:scale(1.12)}button.qaid-annotate-swatch[aria-pressed=true]{border-color:light-dark(#111827,#f9fafb);box-shadow:0 0 0 2px var(--qaid-swatch)}@media(forced-colors:active){button.qaid-annotate-swatch[aria-pressed=true]{outline:2px solid Highlight;outline-offset:1px}}button.qaid-annotate-tool:hover,button.qaid-annotate-action:hover{background:light-dark(#eef2ff,#312e81)}button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{background:var(--qaid-marker, #6366f1);color:var(--qaid-marker-text, #fff);border-color:var(--qaid-marker, #6366f1)}button.qaid-annotate-done:hover{filter:brightness(.9);background:var(--qaid-marker, #6366f1)}button.qaid-annotate-action:disabled{opacity:.45;cursor:not-allowed}@media(forced-colors:active){button.qaid-annotate-tool[aria-pressed=true],button.qaid-annotate-done{border:2px solid Highlight}.qaid-annotate-canvas{border:1px solid CanvasText}}button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible{outline:2px solid var(--qaid-marker, #6366f1);outline-offset:2px}.qaid-textarea:focus-visible,button.qaid-btn-submit:focus-visible,.qaid-video-preview-box textarea:focus-visible{outline:2px solid var(--qaid-marker, #6366f1);outline-offset:2px}.qaid-buttons.qaid-incognito:focus-within{opacity:1}.qaid-buttons:focus-within .qaid-dismiss-btn,.qaid-dismiss-btn:focus-visible{opacity:1}.qaid-dismiss-btn{min-width:24px;min-height:24px}button.qaid-recording-stop{min-height:24px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}@media(forced-colors:active){button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible,.qaid-textarea:focus,button.qaid-btn-submit:focus,.qaid-video-preview-box textarea:focus{outline:2px solid CanvasText;outline-offset:2px}.qaid-selected-marker,.qaid-highlight-box{border-color:Highlight}}.qaid-confirm{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.5rem;padding:.5rem 0}.qaid-confirm-icon{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:9999px;color:#fff;background:var(--qaid-success, #22c55e);margin-bottom:.25rem;animation:qaid-confirm-pop .28s cubic-bezier(.34,1.56,.64,1)}.qaid-confirm-icon .qaid-icon{width:24px;height:24px}.qaid-confirm-title{margin:0;font-size:1rem;font-weight:600;color:var(--qaid-text, #111827)}.qaid-confirm-title:focus-visible{outline:2px solid var(--qaid-primary, #6366f1);outline-offset:3px;border-radius:4px}.qaid-confirm-message{margin:0;font-size:.875rem;color:var(--qaid-text-muted, #6b7280)}.qaid-confirm .qaid-confirm-close{margin-top:.5rem;min-width:96px}@keyframes qaid-confirm-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.qaid-confirm-icon{animation:none}}", ie = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}";
24
24
  let I = 0;
25
- const Zt = "button.qaid-btn{width:var(--qaid-btn-size);height:var(--qaid-btn-size);border-radius:50%;border:none;background:#f3f4f6;color:#374151;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);transition:background-color .2s,color .2s,transform .2s;-webkit-appearance:none;appearance:none;--qaid-hover-up-bg:var(--qaid-positive);--qaid-hover-up-color:#fff;--qaid-hover-down-bg:var(--qaid-negative);--qaid-hover-down-color:#fff}button.qaid-btn:hover{transform:scale(1.05)}button.qaid-btn-up:hover{background:var(--qaid-hover-up-bg);color:var(--qaid-hover-up-color)}button.qaid-btn-down:hover{background:var(--qaid-hover-down-bg);color:var(--qaid-hover-down-color)}button.qaid-btn-feedback:hover{background:var(--qaid-marker,#6366f1);color:var(--qaid-marker-text,#fff)}button.qaid-btn svg{width:var(--qaid-icon-size);height:var(--qaid-icon-size)}", te = {
25
+ const oe = "button.qaid-btn{width:var(--qaid-btn-size);height:var(--qaid-btn-size);border-radius:50%;border:none;background:#f3f4f6;color:#374151;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);transition:background-color .2s,color .2s,transform .2s;-webkit-appearance:none;appearance:none;--qaid-hover-up-bg:var(--qaid-positive);--qaid-hover-up-color:#fff;--qaid-hover-down-bg:var(--qaid-negative);--qaid-hover-down-color:#fff}button.qaid-btn:hover{transform:scale(1.05)}button.qaid-btn-up:hover{background:var(--qaid-hover-up-bg);color:var(--qaid-hover-up-color)}button.qaid-btn-down:hover{background:var(--qaid-hover-down-bg);color:var(--qaid-hover-down-color)}button.qaid-btn-feedback:hover{background:var(--qaid-marker,#6366f1);color:var(--qaid-marker-text,#fff)}button.qaid-btn svg{width:var(--qaid-icon-size);height:var(--qaid-icon-size)}", ne = {
26
26
  small: 36,
27
27
  medium: 48,
28
28
  large: 64
29
- }, ee = {
29
+ }, se = {
30
30
  small: 18,
31
31
  medium: 24,
32
32
  large: 32
33
33
  };
34
- function ie(i, t, e) {
34
+ function ae(i, t, e) {
35
35
  const [o, n, s] = [i, t, e].map((a) => (a = a / 255, a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4)));
36
36
  return 0.2126 * o + 0.7152 * n + 0.0722 * s;
37
37
  }
38
- function oe(i) {
38
+ function re(i) {
39
39
  if (i.startsWith("#")) {
40
40
  const e = i.slice(1), o = e.length === 3 ? e.split("").map((s) => s + s).join("") : e, n = parseInt(o, 16);
41
41
  return {
@@ -51,11 +51,11 @@ function oe(i) {
51
51
  b: parseInt(t[3])
52
52
  } : null;
53
53
  }
54
- function ne(i) {
55
- const t = oe(i);
56
- return t && ie(t.r, t.g, t.b) > 0.4 ? "black" : "white";
54
+ function de(i) {
55
+ const t = re(i);
56
+ return t && ae(t.r, t.g, t.b) > 0.4 ? "black" : "white";
57
57
  }
58
- function se(i = {}) {
58
+ function ce(i = {}) {
59
59
  const {
60
60
  positiveColor: t = "rgb(0, 200, 83)",
61
61
  negativeColor: e = "rgb(255, 0, 0)",
@@ -65,7 +65,7 @@ function se(i = {}) {
65
65
  backdropOpacity: a = 0.3,
66
66
  fontFamily: c = "system-ui, -apple-system, sans-serif",
67
67
  fontSize: l = 16
68
- } = i, d = te[n], r = ee[n], h = ne(o);
68
+ } = i, d = ne[n], r = se[n], h = de(o);
69
69
  return {
70
70
  "--qaid-positive": t,
71
71
  "--qaid-negative": e,
@@ -79,22 +79,22 @@ function se(i = {}) {
79
79
  "--qaid-font-size": `${l}px`
80
80
  };
81
81
  }
82
- function ae(i, t) {
82
+ function le(i, t) {
83
83
  for (const [e, o] of Object.entries(t))
84
84
  i.style.setProperty(e, o);
85
85
  }
86
- function Y() {
87
- return Gt + Zt;
86
+ function Z() {
87
+ return ee + oe;
88
88
  }
89
- function re() {
89
+ function he() {
90
90
  if (I++, I > 1) return;
91
91
  const i = document.createElement("style");
92
- i.id = "qaid-styles", i.textContent = Jt, document.head.appendChild(i);
92
+ i.id = "qaid-styles", i.textContent = ie, document.head.appendChild(i);
93
93
  }
94
- function de() {
95
- I <= 0 || (I--, I === 0 && document.getElementById("qaid-styles").remove());
94
+ function ue() {
95
+ I <= 0 || (I--, I === 0 && document.getElementById("qaid-styles")?.remove());
96
96
  }
97
- const Q = "data-qaid-a11y-live", ce = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;", le = [
97
+ const tt = "data-qaid-a11y-live", pe = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;", fe = [
98
98
  "a[href]",
99
99
  "button",
100
100
  "input",
@@ -102,25 +102,25 @@ const Q = "data-qaid-a11y-live", ce = "position:absolute;width:1px;height:1px;ma
102
102
  "select",
103
103
  "[tabindex]"
104
104
  ].join(",");
105
- function he(i) {
105
+ function me(i) {
106
106
  return i.ownerDocument || document;
107
107
  }
108
- function ue(i, t) {
108
+ function be(i, t) {
109
109
  const e = t ? "assertive" : "polite", o = i.querySelector(
110
- `[${Q}="${e}"]`
110
+ `[${tt}="${e}"]`
111
111
  );
112
112
  if (o) return o;
113
- const s = he(i).createElement("div");
114
- return s.setAttribute(Q, e), s.setAttribute("role", t ? "alert" : "status"), s.setAttribute("aria-live", t ? "assertive" : "polite"), s.setAttribute("aria-atomic", "true"), s.style.cssText = ce, i.appendChild(s), s;
113
+ const s = me(i).createElement("div");
114
+ return s.setAttribute(tt, e), s.setAttribute("role", t ? "alert" : "status"), s.setAttribute("aria-live", t ? "assertive" : "polite"), s.setAttribute("aria-atomic", "true"), s.style.cssText = pe, i.appendChild(s), s;
115
115
  }
116
- function pe(i, t, e = {}) {
117
- const o = ue(i, !!e.assertive);
116
+ function ge(i, t, e = {}) {
117
+ const o = be(i, !!e.assertive);
118
118
  o.textContent = "", o.textContent = t;
119
119
  }
120
- function fe(i) {
120
+ function ve(i) {
121
121
  return i.hasAttribute("disabled") ? !0 : i.disabled === !0;
122
122
  }
123
- function be(i) {
123
+ function ye(i) {
124
124
  let t = i;
125
125
  for (; t; ) {
126
126
  if (t.hasAttribute("hidden")) return !0;
@@ -131,52 +131,52 @@ function be(i) {
131
131
  }
132
132
  return !1;
133
133
  }
134
- function G(i) {
134
+ function et(i) {
135
135
  return Array.from(
136
- i.querySelectorAll(le)
137
- ).filter((e) => !(e.getAttribute("tabindex") === "-1" || e instanceof HTMLInputElement && e.type === "hidden" || e instanceof HTMLAnchorElement && !e.getAttribute("href") || fe(e) || be(e)));
136
+ i.querySelectorAll(fe)
137
+ ).filter((e) => !(e.getAttribute("tabindex") === "-1" || e instanceof HTMLInputElement && e.type === "hidden" || e instanceof HTMLAnchorElement && !e.getAttribute("href") || ve(e) || ye(e)));
138
138
  }
139
- function ft(i) {
139
+ function yt(i) {
140
140
  let t = i.activeElement;
141
141
  for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
142
142
  t = t.shadowRoot.activeElement;
143
143
  return t instanceof HTMLElement ? t : null;
144
144
  }
145
- function ge(i) {
145
+ function we(i) {
146
146
  const t = i.ownerDocument || document;
147
147
  let e = !1;
148
148
  const o = (s) => {
149
149
  if (s.key !== "Tab") return;
150
- const a = G(i);
150
+ const a = et(i);
151
151
  if (a.length === 0) {
152
152
  s.preventDefault(), i.focus();
153
153
  return;
154
154
  }
155
- const c = a[0], l = a[a.length - 1], d = ft(t), r = d ? a.indexOf(d) !== -1 : !1;
155
+ const c = a[0], l = a[a.length - 1], d = yt(t), r = d ? a.indexOf(d) !== -1 : !1;
156
156
  s.shiftKey ? (!r || d === c) && (s.preventDefault(), l.focus()) : (!r || d === l) && (s.preventDefault(), c.focus());
157
157
  };
158
158
  i.addEventListener("keydown", o);
159
- const n = G(i);
159
+ const n = et(i);
160
160
  return n.length > 0 ? n[0].focus() : (i.hasAttribute("tabindex") || (i.setAttribute("tabindex", "-1"), e = !0), i.focus()), {
161
161
  release() {
162
162
  i.removeEventListener("keydown", o), e && (i.removeAttribute("tabindex"), e = !1);
163
163
  }
164
164
  };
165
165
  }
166
- function me() {
167
- return ft(document);
166
+ function ke() {
167
+ return yt(document);
168
168
  }
169
- function ve(i) {
169
+ function xe(i) {
170
170
  if (!(!i || typeof i.focus != "function"))
171
171
  try {
172
172
  i.focus();
173
173
  } catch {
174
174
  }
175
175
  }
176
- function ye(i, t = {}) {
176
+ function qe(i, t = {}) {
177
177
  i.setAttribute("role", "dialog"), i.setAttribute("aria-modal", "true"), t.labelledbyId && i.setAttribute("aria-labelledby", t.labelledbyId), t.describedbyId && i.setAttribute("aria-describedby", t.describedbyId), t.label && i.setAttribute("aria-label", t.label);
178
178
  }
179
- function we(i, t) {
179
+ function Ce(i, t) {
180
180
  let e = i;
181
181
  for (; e && e !== t; ) {
182
182
  const o = e.parentNode;
@@ -190,11 +190,11 @@ function we(i, t) {
190
190
  }
191
191
  return null;
192
192
  }
193
- function ke(i) {
193
+ function Se(i) {
194
194
  const e = (i.ownerDocument || document).body;
195
195
  if (!e) return () => {
196
196
  };
197
- const o = we(i, e), n = [];
197
+ const o = Ce(i, e), n = [];
198
198
  return Array.from(e.children).forEach((s) => {
199
199
  if (!(s instanceof HTMLElement) || o && s === o) return;
200
200
  const a = s.inert === !0, c = s.getAttribute("aria-hidden");
@@ -206,14 +206,14 @@ function ke(i) {
206
206
  }
207
207
  };
208
208
  }
209
- const bt = {
209
+ const wt = {
210
210
  width: 400,
211
211
  height: 280,
212
212
  arrowHeight: 12,
213
213
  gap: 8,
214
214
  viewportPadding: 16
215
215
  };
216
- function xe(i, t, e, o, n) {
216
+ function Ee(i, t, e, o, n) {
217
217
  const s = i.y, a = t - (i.y + i.height);
218
218
  if (a >= e + o)
219
219
  return {
@@ -232,22 +232,22 @@ function xe(i, t, e, o, n) {
232
232
  t - e - n
233
233
  ) : l = Math.max(n, i.y - e - o), { top: l, position: c };
234
234
  }
235
- function qe(i, t, e, o) {
235
+ function Te(i, t, e, o) {
236
236
  let s = i.x + i.width / 2 - e / 2;
237
237
  return s = Math.max(o, Math.min(s, t - e - o)), s;
238
238
  }
239
- function Ce(i, t, e, o = 24, n = 24) {
239
+ function Ae(i, t, e, o = 24, n = 24) {
240
240
  const a = i.clickX - t - n / 2;
241
241
  return Math.max(o, Math.min(a, e - o - n / 2));
242
242
  }
243
- function Se(i, t, e, o = bt) {
244
- const n = o.height + o.arrowHeight, s = xe(
243
+ function Le(i, t, e, o = wt) {
244
+ const n = o.height + o.arrowHeight, s = Ee(
245
245
  i,
246
246
  e,
247
247
  n,
248
248
  o.gap,
249
249
  o.viewportPadding
250
- ), a = qe(
250
+ ), a = Te(
251
251
  i,
252
252
  t,
253
253
  o.width,
@@ -259,15 +259,15 @@ function Se(i, t, e, o = bt) {
259
259
  position: s.position
260
260
  };
261
261
  }
262
- function Ee(i, t, e, o = {}) {
262
+ function Ie(i, t, e, o = {}) {
263
263
  const n = o.gap ?? 8;
264
264
  let s = i.bottom + n;
265
265
  s + t.height > e.height - n && (s = i.top - t.height - n);
266
266
  let a = i.left;
267
267
  return a < n ? a = n : a + t.width > e.width - n && (a = e.width - t.width - n), s < n ? s = n : s + t.height > e.height - n && (s = e.height - t.height - n), { top: s, left: a };
268
268
  }
269
- function Te(i, t, e, o = bt) {
270
- const n = Se(i, t, e, o), s = Ce(
269
+ function De(i, t, e, o = wt) {
270
+ const n = Le(i, t, e, o), s = Ae(
271
271
  i,
272
272
  n.left,
273
273
  o.width
@@ -277,15 +277,15 @@ function Te(i, t, e, o = bt) {
277
277
  arrow: { left: s }
278
278
  };
279
279
  }
280
- const Ae = 20;
281
- function Le(i) {
280
+ const Me = 20;
281
+ function Re(i) {
282
282
  const t = [], e = console.error, o = console.warn, n = console.log, s = (a, c) => {
283
283
  const l = {
284
284
  message: c.map((d) => String(d)).join(" "),
285
285
  timestamp: Date.now(),
286
286
  level: a
287
287
  };
288
- t.length >= Ae && t.shift(), t.push(l), i && i(l);
288
+ t.length >= Me && t.shift(), t.push(l), i && i(l);
289
289
  };
290
290
  return console.error = function(...a) {
291
291
  s("error", a), e.apply(console, a);
@@ -307,10 +307,10 @@ function q(i, t, e) {
307
307
  n === "className" ? o.className = s : o.setAttribute(n, s);
308
308
  return o;
309
309
  }
310
- function Ie(i = 640) {
310
+ function Pe(i = 640) {
311
311
  return typeof window < "u" && window.innerWidth < i;
312
312
  }
313
- function J(i, t, e) {
313
+ function it(i, t, e) {
314
314
  const o = e.map((s) => s.style.visibility);
315
315
  e.forEach((s) => s.style.visibility = "hidden");
316
316
  const n = document.elementFromPoint(i, t);
@@ -319,7 +319,7 @@ function J(i, t, e) {
319
319
  function M(i) {
320
320
  return i ? i.hasAttribute("data-qaid-embed") || i.hasAttribute("data-qaid-embed-overlay") ? !0 : !!i.closest("[data-qaid-embed], [data-qaid-embed-overlay]") : !1;
321
321
  }
322
- function Z(i, t = 0) {
322
+ function ot(i, t = 0) {
323
323
  const e = i.getBoundingClientRect();
324
324
  return {
325
325
  x: e.left - t,
@@ -328,7 +328,7 @@ function Z(i, t = 0) {
328
328
  height: e.height + t * 2
329
329
  };
330
330
  }
331
- const De = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", Me = (i) => (
331
+ const Be = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", He = (i) => (
332
332
  // The URL is a runtime value, not a static specifier — keep Vite from
333
333
  // trying to analyze/bundle it.
334
334
  import(
@@ -336,9 +336,9 @@ const De = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", Me =
336
336
  i
337
337
  )
338
338
  );
339
- let Re = Me, A = null, _ = null;
340
- function Pe(i) {
341
- return A && _ === i || (_ = i, A = Promise.resolve(Re(i)).then((t) => {
339
+ let Oe = He, A = null, _ = null;
340
+ function $e(i) {
341
+ return A && _ === i || (_ = i, A = Promise.resolve(Oe(i)).then((t) => {
342
342
  const e = t;
343
343
  if (!e || typeof e.QaidQuests != "function")
344
344
  throw new Error("quests module has no QaidQuests export");
@@ -347,8 +347,8 @@ function Pe(i) {
347
347
  throw A = null, _ = null, t;
348
348
  })), A;
349
349
  }
350
- async function Be(i) {
351
- const t = await Pe(i.moduleUrl), e = i.base.replace(/\/+$/, ""), o = i.feedbackId != null ? { feedbackId: i.feedbackId } : void 0;
350
+ async function ze(i) {
351
+ const t = await $e(i.moduleUrl), e = i.base.replace(/\/+$/, ""), o = i.feedbackId != null ? { feedbackId: i.feedbackId } : void 0;
352
352
  return new t.QaidQuests({
353
353
  endpoint: `${e}/responses`,
354
354
  configUrl: `${e}/${encodeURIComponent(i.questId)}/definition`,
@@ -357,7 +357,7 @@ async function Be(i) {
357
357
  onClose: i.onClose
358
358
  });
359
359
  }
360
- const tt = "qaid_visitor_id", et = "qaid_hide_feedback", He = [
360
+ const nt = "qaid_visitor_id", st = "qaid_hide_feedback", _e = [
361
361
  "#ef4444",
362
362
  "#f59e0b",
363
363
  "#22c55e",
@@ -365,34 +365,34 @@ const tt = "qaid_visitor_id", et = "qaid_hide_feedback", He = [
365
365
  "#111827",
366
366
  "#ffffff"
367
367
  ];
368
- function Oe() {
368
+ function Fe() {
369
369
  return typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches;
370
370
  }
371
371
  function U(i) {
372
- return i ? `${et}_${i}` : et;
372
+ return i ? `${st}_${i}` : st;
373
373
  }
374
- function $e(i) {
374
+ function Ve(i) {
375
375
  try {
376
376
  return localStorage.getItem(U(i)) === "1";
377
377
  } catch {
378
378
  return !1;
379
379
  }
380
380
  }
381
- function it(i, t = !0) {
381
+ function at(i, t = !0) {
382
382
  try {
383
383
  t ? localStorage.setItem(U(i), "1") : localStorage.removeItem(U(i));
384
384
  } catch {
385
385
  }
386
386
  }
387
- function ze() {
387
+ function Ne() {
388
388
  try {
389
- let i = localStorage.getItem(tt);
390
- return i || (i = crypto.randomUUID(), localStorage.setItem(tt, i)), i;
389
+ let i = localStorage.getItem(nt);
390
+ return i || (i = crypto.randomUUID(), localStorage.setItem(nt, i)), i;
391
391
  } catch {
392
392
  return crypto.randomUUID();
393
393
  }
394
394
  }
395
- class _e {
395
+ class Ue {
396
396
  config;
397
397
  state = "IDLE";
398
398
  feedbackData = {
@@ -495,8 +495,12 @@ class _e {
495
495
  negativeLabel: t.text?.negativeLabel ?? "Send negative feedback",
496
496
  recordLabel: t.text?.recordLabel ?? "Record a screen recording",
497
497
  dismissLabel: t.text?.dismissLabel ?? "Hide Feedback",
498
- feedbackLabel: t.text?.feedbackLabel ?? "Send feedback"
498
+ feedbackLabel: t.text?.feedbackLabel ?? "Send feedback",
499
+ confirmationTitle: t.text?.confirmationTitle ?? "Thank you!",
500
+ confirmationMessage: t.text?.confirmationMessage ?? "Your feedback has been received.",
501
+ confirmationClose: t.text?.confirmationClose ?? "Close"
499
502
  },
503
+ hideConfirmation: t.hideConfirmation ?? !1,
500
504
  modalWidth: t.modalWidth ?? 400,
501
505
  backdropOpacity: t.backdropOpacity ?? 0.3,
502
506
  fontFamily: t.fontFamily ?? "system-ui, -apple-system, sans-serif",
@@ -504,7 +508,7 @@ class _e {
504
508
  captureScreenshot: t.captureScreenshot ?? !1,
505
509
  annotate: t.annotate ?? !0,
506
510
  annotationColor: t.annotationColor ?? t.colors?.marker ?? "#6366f1",
507
- annotationPalette: t.annotationPalette ?? He,
511
+ annotationPalette: t.annotationPalette ?? _e,
508
512
  screenshotMethod: t.screenshotMethod ?? "permission",
509
513
  screenshotOptions: {
510
514
  quality: t.screenshotOptions?.quality ?? 0.8,
@@ -531,12 +535,12 @@ class _e {
531
535
  video: t.quests?.video ?? "",
532
536
  // Quest service reuses the feedback API key unless overridden.
533
537
  apiKey: t.quests?.apiKey ?? t.apiKey ?? "",
534
- moduleUrl: t.quests?.moduleUrl ?? De
538
+ moduleUrl: t.quests?.moduleUrl ?? Be
535
539
  }
536
- }, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = ze(), this.init();
540
+ }, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = Ne(), this.init();
537
541
  }
538
542
  applyVars(t) {
539
- ae(t, this.cssVars);
543
+ le(t, this.cssVars);
540
544
  }
541
545
  /**
542
546
  * Announce a message via the shared visually-hidden live regions.
@@ -546,7 +550,7 @@ class _e {
546
550
  */
547
551
  announceMsg(t, e = !1) {
548
552
  const o = this.overlayShadowRoot ?? this.shadowRoot;
549
- o && pe(o, t, { assertive: e });
553
+ o && ge(o, t, { assertive: e });
550
554
  }
551
555
  /**
552
556
  * Turn a transient surface into an accessible modal dialog: save the
@@ -554,16 +558,16 @@ class _e {
554
558
  * background. Paired with closeDialogA11y() on every close path.
555
559
  */
556
560
  openDialogA11y(t, e) {
557
- this.dialogTrigger = me(), ye(t, e), this.dialogTrap = ge(t), this.dialogRestoreInert = ke(t);
561
+ this.dialogTrigger = ke(), qe(t, e), this.dialogTrap = we(t), this.dialogRestoreInert = Se(t);
558
562
  }
559
563
  closeDialogA11y() {
560
- this.dialogTrap?.release(), this.dialogTrap = null, this.dialogRestoreInert && (this.dialogRestoreInert(), this.dialogRestoreInert = null), ve(this.dialogTrigger), this.dialogTrigger = null;
564
+ this.dialogTrap?.release(), this.dialogTrap = null, this.dialogRestoreInert && (this.dialogRestoreInert(), this.dialogRestoreInert = null), xe(this.dialogTrigger), this.dialogTrigger = null;
561
565
  }
562
566
  clearActiveThumb() {
563
567
  this.activeThumbBtn && (this.activeThumbBtn.setAttribute("aria-pressed", "false"), this.activeThumbBtn = null);
564
568
  }
565
569
  init() {
566
- re(), this.cssVars = se({
570
+ he(), this.cssVars = ce({
567
571
  positiveColor: this.config.colors.positive,
568
572
  negativeColor: this.config.colors.negative,
569
573
  markerColor: this.config.colors.marker,
@@ -572,7 +576,7 @@ class _e {
572
576
  backdropOpacity: this.config.backdropOpacity,
573
577
  fontFamily: this.config.fontFamily,
574
578
  fontSize: this.config.fontSize
575
- }), !this.config.hideDismiss && $e(this.config.apiKey) && (this._startDismissed = !0), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = Le((t) => {
579
+ }), !this.config.hideDismiss && Ve(this.config.apiKey) && (this._startDismissed = !0), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = Re((t) => {
576
580
  this.feedbackData.consoleErrors = this.consoleCapture?.errors ?? [];
577
581
  }), this.feedbackData.consoleErrors = this.consoleCapture.errors, this.observeDom(), (this.config.captureVideo && this.videoSupported() || this.config.captureScreenshot) && this.schedulePrewarm(() => {
578
582
  this.config.captureVideo && this.videoSupported() && this.prewarmVideo(), this.config.captureScreenshot && this.prewarmScreenshot();
@@ -585,13 +589,13 @@ class _e {
585
589
  * swallowed — a failed preload just falls back to an on-demand load.
586
590
  */
587
591
  prewarmVideo() {
588
- this.videoPrewarmed || (this.videoPrewarmed = !0, Promise.resolve().then(() => ct).catch(() => {
589
- }), Promise.resolve().then(() => wt).catch(() => {
592
+ this.videoPrewarmed || (this.videoPrewarmed = !0, Promise.resolve().then(() => pt).catch(() => {
593
+ }), Promise.resolve().then(() => St).catch(() => {
590
594
  }));
591
595
  }
592
596
  prewarmScreenshot() {
593
- this.screenshotPrewarmed || (this.screenshotPrewarmed = !0, (this.shouldCaptureViaDom() ? Promise.resolve().then(() => at) : Promise.resolve().then(() => lt)).catch(() => {
594
- }), this.config.annotate && Promise.resolve().then(() => dt).catch(() => {
597
+ this.screenshotPrewarmed || (this.screenshotPrewarmed = !0, (this.shouldCaptureViaDom() ? Promise.resolve().then(() => lt) : Promise.resolve().then(() => ft)).catch(() => {
598
+ }), this.config.annotate && Promise.resolve().then(() => ut).catch(() => {
595
599
  }));
596
600
  }
597
601
  /** Run fn when the main thread is idle; cancelled by destroy(). */
@@ -620,7 +624,7 @@ class _e {
620
624
  }), this.domObserver.observe(document.body, { childList: !0 });
621
625
  }
622
626
  checkMobile() {
623
- this.isMobile = Ie();
627
+ this.isMobile = Pe();
624
628
  }
625
629
  handleResize() {
626
630
  this.checkMobile();
@@ -630,7 +634,7 @@ class _e {
630
634
  let t = null;
631
635
  this.config.container && (t = document.querySelector(this.config.container)), t ? (t.appendChild(this.shadowHost), this.isUserProvidedContainer = !0, this.config.hideDismiss = !0) : (this.shadowHost.style.position = "fixed", this.shadowHost.style.display = "block", this.shadowHost.style.inset = "0", this.shadowHost.style.pointerEvents = "none", this.shadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.shadowHost)), this.shadowRoot = this.shadowHost.attachShadow({ mode: "open" });
632
636
  const e = document.createElement("style");
633
- if (e.textContent = Y(), this.shadowRoot.appendChild(e), this.config.css) {
637
+ if (e.textContent = Z(), this.shadowRoot.appendChild(e), this.config.css) {
634
638
  const d = document.createElement("style");
635
639
  d.textContent = this.config.css, this.shadowRoot.appendChild(d);
636
640
  }
@@ -654,20 +658,20 @@ class _e {
654
658
  const d = document.createElement("div");
655
659
  d.className = "qaid-tooltip-wrapper";
656
660
  const r = document.createElement("button");
657
- r.type = "button", r.className = n ? `${s} qaid-btn-feedback` : "qaid-btn qaid-btn-feedback", r.setAttribute("aria-label", this.config.text.feedbackLabel), r.innerHTML = this.config.feedbackIcon || pt, r.addEventListener("click", (h) => this.handleThumbClick("neutral", h.currentTarget, h)), r.addEventListener("mouseenter", () => {
661
+ r.type = "button", r.className = n ? `${s} qaid-btn-feedback` : "qaid-btn qaid-btn-feedback", r.setAttribute("aria-label", this.config.text.feedbackLabel), r.innerHTML = this.config.feedbackIcon || gt, r.addEventListener("click", (h) => this.handleThumbClick("neutral", h.currentTarget, h)), r.addEventListener("mouseenter", () => {
658
662
  this.prewarmTargeting(), this.showTooltip(r);
659
663
  }), r.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(r), this.buttonsContainer.appendChild(d);
660
664
  } else if (!this.config.hideThumbs) {
661
665
  const d = document.createElement("div");
662
666
  d.className = "qaid-tooltip-wrapper";
663
667
  const r = document.createElement("button");
664
- r.type = "button", r.className = n ? `${s} qaid-btn-up` : "qaid-btn qaid-btn-up", r.setAttribute("aria-label", this.config.text.positiveLabel), r.innerHTML = this.config.positiveIcon || V, r.addEventListener("click", (g) => this.handleThumbClick("up", g.currentTarget, g)), r.addEventListener("mouseenter", () => {
668
+ r.type = "button", r.className = n ? `${s} qaid-btn-up` : "qaid-btn qaid-btn-up", r.setAttribute("aria-label", this.config.text.positiveLabel), r.innerHTML = this.config.positiveIcon || V, r.addEventListener("click", (b) => this.handleThumbClick("up", b.currentTarget, b)), r.addEventListener("mouseenter", () => {
665
669
  this.prewarmTargeting(), this.showTooltip(r);
666
670
  }), r.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(r);
667
671
  const h = document.createElement("div");
668
672
  h.className = "qaid-tooltip-wrapper";
669
673
  const p = document.createElement("button");
670
- p.type = "button", p.className = n ? `${s} qaid-btn-down` : "qaid-btn qaid-btn-down", p.setAttribute("aria-label", this.config.text.negativeLabel), p.innerHTML = this.config.negativeIcon || N, p.addEventListener("click", (g) => this.handleThumbClick("down", g.currentTarget, g)), p.addEventListener("mouseenter", () => {
674
+ p.type = "button", p.className = n ? `${s} qaid-btn-down` : "qaid-btn qaid-btn-down", p.setAttribute("aria-label", this.config.text.negativeLabel), p.innerHTML = this.config.negativeIcon || N, p.addEventListener("click", (b) => this.handleThumbClick("down", b.currentTarget, b)), p.addEventListener("mouseenter", () => {
671
675
  this.prewarmTargeting(), this.showTooltip(p);
672
676
  }), p.addEventListener("mouseleave", () => this.hideTooltip()), h.appendChild(p), this.buttonsContainer.appendChild(d), this.buttonsContainer.appendChild(h);
673
677
  }
@@ -675,7 +679,7 @@ class _e {
675
679
  const d = document.createElement("div");
676
680
  d.className = "qaid-tooltip-wrapper";
677
681
  const r = document.createElement("button");
678
- r.type = "button", r.className = n ? `${s} qaid-btn-record` : "qaid-btn qaid-btn-record", r.setAttribute("aria-label", this.config.text.recordLabel), r.innerHTML = this.config.recordIcon || Nt, r.addEventListener("click", () => {
682
+ r.type = "button", r.className = n ? `${s} qaid-btn-record` : "qaid-btn qaid-btn-record", r.setAttribute("aria-label", this.config.text.recordLabel), r.innerHTML = this.config.recordIcon || Xt, r.addEventListener("click", () => {
679
683
  this.ensureRecording().then(
680
684
  (p) => this.config.videoOptions.redaction ? p.startPicking() : p.startRecording()
681
685
  );
@@ -699,7 +703,7 @@ class _e {
699
703
  if (this.overlayShadowRoot) return this.overlayShadowRoot;
700
704
  this.overlayShadowHost = document.createElement("div"), this.overlayShadowHost.setAttribute("data-qaid-embed-overlay", ""), this.overlayShadowHost.style.position = "fixed", this.overlayShadowHost.style.inset = "0", this.overlayShadowHost.style.pointerEvents = "none", this.overlayShadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.overlayShadowHost), this.overlayShadowRoot = this.overlayShadowHost.attachShadow({ mode: "open" });
701
705
  const t = document.createElement("style");
702
- if (t.textContent = Y(), this.overlayShadowRoot.appendChild(t), this.config.css) {
706
+ if (t.textContent = Z(), this.overlayShadowRoot.appendChild(t), this.config.css) {
703
707
  const e = document.createElement("style");
704
708
  e.textContent = this.config.css, this.overlayShadowRoot.appendChild(e);
705
709
  }
@@ -709,7 +713,7 @@ class _e {
709
713
  showTooltip(t) {
710
714
  const e = this.tooltipElement;
711
715
  e.style.visibility = "hidden", e.classList.add("qaid-tooltip-visible");
712
- const o = t.getBoundingClientRect(), n = e.getBoundingClientRect(), { top: s, left: a } = Ee(
716
+ const o = t.getBoundingClientRect(), n = e.getBoundingClientRect(), { top: s, left: a } = Ie(
713
717
  o,
714
718
  n,
715
719
  { width: window.innerWidth, height: window.innerHeight }
@@ -720,10 +724,10 @@ class _e {
720
724
  this.tooltipElement.classList.remove("qaid-tooltip-visible");
721
725
  }
722
726
  handleDismiss() {
723
- this.buttonsContainer.classList.add("qaid-dismissed"), it(this.config.apiKey, !0);
727
+ this.buttonsContainer.classList.add("qaid-dismissed"), at(this.config.apiKey, !0);
724
728
  }
725
729
  handleThumbClick(t, e, o) {
726
- if (this.buttonsContainer?.classList.contains("qaid-incognito") && (this.buttonsContainer.classList.remove("qaid-incognito"), it(this.config.apiKey, !1)), this.prewarmModal(), this.config.skipTargeting || this.config.feedbackMode === "annotate")
730
+ if (this.buttonsContainer?.classList.contains("qaid-incognito") && (this.buttonsContainer.classList.remove("qaid-incognito"), at(this.config.apiKey, !1)), this.prewarmModal(), this.config.skipTargeting || this.config.feedbackMode === "annotate")
727
731
  this.submitDirectFeedback(t, e);
728
732
  else {
729
733
  this.activeThumbBtn = e, e.setAttribute("aria-pressed", "true");
@@ -756,7 +760,7 @@ class _e {
756
760
  * instead of the permission-based Screen Capture API. Explicit "dom" wins;
757
761
  * otherwise DOM is used on touch devices to avoid the getDisplayMedia prompt. */
758
762
  shouldCaptureViaDom() {
759
- return this.config.screenshotMethod === "dom" || Oe();
763
+ return this.config.screenshotMethod === "dom" || Fe();
760
764
  }
761
765
  /**
762
766
  * Open the full-screen annotation editor over the captured screenshot,
@@ -769,7 +773,7 @@ class _e {
769
773
  const e = this.ensureOverlayHost(), o = this.overlayShadowHost, n = o.style.pointerEvents;
770
774
  o.style.pointerEvents = "auto";
771
775
  try {
772
- const { openAnnotationEditor: s } = await Promise.resolve().then(() => dt);
776
+ const { openAnnotationEditor: s } = await Promise.resolve().then(() => ut);
773
777
  return await s({
774
778
  dataUrl: t,
775
779
  root: e,
@@ -792,10 +796,10 @@ class _e {
792
796
  if (this.config.captureScreenshot || this.config.feedbackMode === "annotate")
793
797
  try {
794
798
  if (this.shouldCaptureViaDom()) {
795
- const { captureDomScreenshot: a } = await Promise.resolve().then(() => at);
799
+ const { captureDomScreenshot: a } = await Promise.resolve().then(() => lt);
796
800
  t = await a(this.config.screenshotOptions);
797
801
  } else {
798
- const { captureScreenshot: a } = await Promise.resolve().then(() => lt);
802
+ const { captureScreenshot: a } = await Promise.resolve().then(() => ft);
799
803
  t = await a(this.config.screenshotOptions);
800
804
  }
801
805
  t && this.announceMsg("Screenshot captured");
@@ -873,7 +877,7 @@ class _e {
873
877
  const o = this.questIdFor(t);
874
878
  if (!o) return !1;
875
879
  try {
876
- return this.activeQuest?.destroy(), this.activeQuest = await Be({
880
+ return this.activeQuest?.destroy(), this.activeQuest = await ze({
877
881
  questId: o,
878
882
  base: this.config.quests.base,
879
883
  apiKey: this.config.quests.apiKey || void 0,
@@ -902,7 +906,7 @@ class _e {
902
906
  */
903
907
  async ensureModal() {
904
908
  if (!this.modal) {
905
- const { ModalController: t } = await Promise.resolve().then(() => ht);
909
+ const { ModalController: t } = await Promise.resolve().then(() => mt);
906
910
  this.modal = new t(this.makeModalHost());
907
911
  }
908
912
  return this.modal;
@@ -948,7 +952,7 @@ class _e {
948
952
  }
949
953
  /** Warm the modal chunk while the user is targeting, so it opens instantly. */
950
954
  prewarmModal() {
951
- this.modalPrewarmed || (this.modalPrewarmed = !0, Promise.resolve().then(() => ht).catch(() => {
955
+ this.modalPrewarmed || (this.modalPrewarmed = !0, Promise.resolve().then(() => mt).catch(() => {
952
956
  }));
953
957
  }
954
958
  /**
@@ -958,7 +962,7 @@ class _e {
958
962
  */
959
963
  async ensureTargeting() {
960
964
  if (!this.targeting) {
961
- const { TargetingController: t } = await Promise.resolve().then(() => ut);
965
+ const { TargetingController: t } = await Promise.resolve().then(() => bt);
962
966
  this.targeting = new t(this.makeTargetingHost());
963
967
  }
964
968
  return this.targeting;
@@ -1003,7 +1007,7 @@ class _e {
1003
1007
  }
1004
1008
  /** Warm the targeting chunk on thumb-button hover, before the click. */
1005
1009
  prewarmTargeting() {
1006
- this.targetingPrewarmed || this.config.skipTargeting || (this.targetingPrewarmed = !0, Promise.resolve().then(() => ut).catch(() => {
1010
+ this.targetingPrewarmed || this.config.skipTargeting || (this.targetingPrewarmed = !0, Promise.resolve().then(() => bt).catch(() => {
1007
1011
  }));
1008
1012
  }
1009
1013
  // ==================== Video Recording ====================
@@ -1022,7 +1026,7 @@ class _e {
1022
1026
  */
1023
1027
  async ensureRecording() {
1024
1028
  if (!this.recording) {
1025
- const { RecordingController: t } = await Promise.resolve().then(() => ct);
1029
+ const { RecordingController: t } = await Promise.resolve().then(() => pt);
1026
1030
  this.recording = new t(this.makeRecordingHost());
1027
1031
  }
1028
1032
  return this.recording;
@@ -1078,13 +1082,13 @@ class _e {
1078
1082
  const t = window;
1079
1083
  this.prewarmIsTimeout ? clearTimeout(this.prewarmHandle) : t.cancelIdleCallback?.(this.prewarmHandle), this.prewarmHandle = null;
1080
1084
  }
1081
- this.recording?.destroy(), this.recording = null, this.modal?.destroy(), this.modal = null, this.activeQuest?.destroy(), this.activeQuest = null, this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.shadowHost && (this.shadowHost.remove(), this.shadowHost = null, this.shadowRoot = null), this.overlayShadowHost && (this.overlayShadowHost.remove(), this.overlayShadowHost = null, this.overlayShadowRoot = null), this.buttonsContainer = null, this.dismissBtn = null, this.tooltipElement = null, de();
1085
+ this.recording?.destroy(), this.recording = null, this.modal?.destroy(), this.modal = null, this.activeQuest?.destroy(), this.activeQuest = null, this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.shadowHost && (this.shadowHost.remove(), this.shadowHost = null, this.shadowRoot = null), this.overlayShadowHost && (this.overlayShadowHost.remove(), this.overlayShadowHost = null, this.overlayShadowRoot = null), this.buttonsContainer = null, this.dismissBtn = null, this.tooltipElement = null, ue();
1082
1086
  }
1083
1087
  }
1084
- function gt(i) {
1088
+ function kt(i) {
1085
1089
  return document.querySelector(i)?.textContent?.trim() ?? "";
1086
1090
  }
1087
- function Fe() {
1091
+ function je() {
1088
1092
  const i = document.querySelector(
1089
1093
  'script[type="application/json"][data-feedback-config]'
1090
1094
  );
@@ -1093,23 +1097,23 @@ function Fe() {
1093
1097
  if (!t) return null;
1094
1098
  try {
1095
1099
  const e = JSON.parse(t);
1096
- return e.cssSelector && !e.css && (e.css = gt(e.cssSelector), delete e.cssSelector), e;
1100
+ return e.cssSelector && !e.css && (e.css = kt(e.cssSelector), delete e.cssSelector), e;
1097
1101
  } catch {
1098
1102
  return null;
1099
1103
  }
1100
1104
  }
1101
- function Ve(i) {
1105
+ function Ke(i) {
1102
1106
  const t = i.getAttribute("data-endpoint");
1103
1107
  if (!t) return null;
1104
- const e = i.getAttribute("data-position"), o = i.getAttribute("data-zindex"), n = i.getAttribute("data-positive-color"), s = i.getAttribute("data-negative-color"), a = i.getAttribute("data-marker-color"), c = i.getAttribute("data-container"), l = i.getAttribute("data-button-class"), d = i.getAttribute("data-skip-targeting"), r = i.getAttribute("data-single-button"), h = i.getAttribute("data-feedback-mode"), p = i.getAttribute("data-incognito"), g = i.getAttribute("data-button-size"), v = i.getAttribute("data-offset-x"), m = i.getAttribute("data-offset-y"), k = i.getAttribute("data-modal-width"), x = i.getAttribute("data-backdrop-opacity"), u = i.getAttribute("data-font-family"), y = i.getAttribute("data-font-size"), w = i.getAttribute("data-tooltip"), C = i.getAttribute("data-modal-title"), T = i.getAttribute("data-modal-subtitle"), S = i.getAttribute("data-placeholder"), f = i.getAttribute("data-submit-button"), D = i.getAttribute("data-skip-button"), Et = i.getAttribute("data-positive-icon"), Tt = i.getAttribute("data-negative-icon"), At = i.getAttribute("data-feedback-icon"), j = i.getAttribute("data-feedback-label"), Lt = i.getAttribute("data-api-key"), It = i.getAttribute("data-capture-screenshot"), Dt = i.getAttribute("data-annotate"), Mt = i.getAttribute("data-annotation-color"), H = i.getAttribute("data-screenshot-quality"), O = i.getAttribute("data-screenshot-max-width"), $ = i.getAttribute("data-screenshot-max-height"), Rt = i.getAttribute("data-capture-video"), K = i.getAttribute("data-video-redaction"), Pt = i.getAttribute("data-hide-thumbs"), Bt = i.getAttribute("data-hide-dismiss"), z = i.getAttribute("data-video-max-duration"), Ht = i.getAttribute("data-screenshot-method"), Ot = i.getAttribute("data-direction"), W = i.getAttribute("data-css-selector"), X = i.getAttribute("data-quest-base"), $t = i.getAttribute("data-quest-up"), zt = i.getAttribute("data-quest-down"), _t = i.getAttribute("data-quest-video"), Ft = i.getAttribute("data-quest-api-key"), Vt = i.getAttribute("data-quest-module-url");
1108
+ const e = i.getAttribute("data-position"), o = i.getAttribute("data-zindex"), n = i.getAttribute("data-positive-color"), s = i.getAttribute("data-negative-color"), a = i.getAttribute("data-marker-color"), c = i.getAttribute("data-container"), l = i.getAttribute("data-button-class"), d = i.getAttribute("data-skip-targeting"), r = i.getAttribute("data-hide-confirmation"), h = i.getAttribute("data-single-button"), p = i.getAttribute("data-feedback-mode"), b = i.getAttribute("data-incognito"), y = i.getAttribute("data-button-size"), g = i.getAttribute("data-offset-x"), w = i.getAttribute("data-offset-y"), x = i.getAttribute("data-modal-width"), u = i.getAttribute("data-backdrop-opacity"), k = i.getAttribute("data-font-family"), v = i.getAttribute("data-font-size"), C = i.getAttribute("data-tooltip"), T = i.getAttribute("data-modal-title"), S = i.getAttribute("data-confirmation-title"), f = i.getAttribute("data-confirmation-message"), D = i.getAttribute("data-confirmation-close"), j = i.getAttribute("data-modal-subtitle"), K = i.getAttribute("data-placeholder"), W = i.getAttribute("data-submit-button"), X = i.getAttribute("data-skip-button"), Dt = i.getAttribute("data-positive-icon"), Mt = i.getAttribute("data-negative-icon"), Rt = i.getAttribute("data-feedback-icon"), Y = i.getAttribute("data-feedback-label"), Pt = i.getAttribute("data-api-key"), Bt = i.getAttribute("data-capture-screenshot"), Ht = i.getAttribute("data-annotate"), Ot = i.getAttribute("data-annotation-color"), H = i.getAttribute("data-screenshot-quality"), O = i.getAttribute("data-screenshot-max-width"), $ = i.getAttribute("data-screenshot-max-height"), $t = i.getAttribute("data-capture-video"), Q = i.getAttribute("data-video-redaction"), zt = i.getAttribute("data-hide-thumbs"), _t = i.getAttribute("data-hide-dismiss"), z = i.getAttribute("data-video-max-duration"), Ft = i.getAttribute("data-screenshot-method"), Vt = i.getAttribute("data-direction"), G = i.getAttribute("data-css-selector"), J = i.getAttribute("data-quest-base"), Nt = i.getAttribute("data-quest-up"), Ut = i.getAttribute("data-quest-down"), jt = i.getAttribute("data-quest-video"), Kt = i.getAttribute("data-quest-api-key"), Wt = i.getAttribute("data-quest-module-url");
1105
1109
  return {
1106
1110
  endpoint: t,
1107
- css: W ? gt(W) : void 0,
1108
- apiKey: Lt ?? void 0,
1109
- captureScreenshot: It === "true" ? !0 : void 0,
1111
+ css: G ? kt(G) : void 0,
1112
+ apiKey: Pt ?? void 0,
1113
+ captureScreenshot: Bt === "true" ? !0 : void 0,
1110
1114
  // Annotation is on by default; only an explicit "false" disables it.
1111
- annotate: Dt === "false" ? !1 : void 0,
1112
- annotationColor: Mt ?? void 0,
1115
+ annotate: Ht === "false" ? !1 : void 0,
1116
+ annotationColor: Ot ?? void 0,
1113
1117
  screenshotOptions: H || O || $ ? {
1114
1118
  quality: H ? parseFloat(H) : void 0,
1115
1119
  maxWidth: O ? parseInt(O, 10) : void 0,
@@ -1117,74 +1121,78 @@ function Ve(i) {
1117
1121
  } : void 0,
1118
1122
  container: c ?? void 0,
1119
1123
  buttonClass: l ?? void 0,
1120
- direction: Ot ?? void 0,
1124
+ direction: Vt ?? void 0,
1121
1125
  position: e ?? void 0,
1122
1126
  zIndex: o ? parseInt(o, 10) : void 0,
1123
1127
  skipTargeting: d === "true" ? !0 : void 0,
1124
- singleButton: r === "true" ? !0 : void 0,
1125
- feedbackMode: h ?? void 0,
1126
- incognito: p === "true" ? !0 : void 0,
1127
- buttonSize: g ?? void 0,
1128
- offset: v || m ? {
1129
- x: v ? parseInt(v, 10) : void 0,
1130
- y: m ? parseInt(m, 10) : void 0
1128
+ hideConfirmation: r === "true" ? !0 : void 0,
1129
+ singleButton: h === "true" ? !0 : void 0,
1130
+ feedbackMode: p ?? void 0,
1131
+ incognito: b === "true" ? !0 : void 0,
1132
+ buttonSize: y ?? void 0,
1133
+ offset: g || w ? {
1134
+ x: g ? parseInt(g, 10) : void 0,
1135
+ y: w ? parseInt(w, 10) : void 0
1131
1136
  } : void 0,
1132
- modalWidth: k ? parseInt(k, 10) : void 0,
1133
- backdropOpacity: x ? parseFloat(x) : void 0,
1134
- fontFamily: u ?? void 0,
1135
- fontSize: y ? parseInt(y, 10) : void 0,
1137
+ modalWidth: x ? parseInt(x, 10) : void 0,
1138
+ backdropOpacity: u ? parseFloat(u) : void 0,
1139
+ fontFamily: k ?? void 0,
1140
+ fontSize: v ? parseInt(v, 10) : void 0,
1136
1141
  colors: {
1137
1142
  positive: n ?? void 0,
1138
1143
  negative: s ?? void 0,
1139
1144
  marker: a ?? void 0
1140
1145
  },
1141
- text: w || C || T || S || f || D || j ? {
1142
- tooltip: w ?? void 0,
1143
- modalTitle: C ?? void 0,
1144
- modalSubtitle: T ?? void 0,
1145
- placeholder: S ?? void 0,
1146
- submitButton: f ?? void 0,
1147
- skipButton: D ?? void 0,
1148
- feedbackLabel: j ?? void 0
1146
+ text: C || T || j || K || W || X || Y || S || f || D ? {
1147
+ tooltip: C ?? void 0,
1148
+ modalTitle: T ?? void 0,
1149
+ modalSubtitle: j ?? void 0,
1150
+ placeholder: K ?? void 0,
1151
+ submitButton: W ?? void 0,
1152
+ skipButton: X ?? void 0,
1153
+ feedbackLabel: Y ?? void 0,
1154
+ confirmationTitle: S ?? void 0,
1155
+ confirmationMessage: f ?? void 0,
1156
+ confirmationClose: D ?? void 0
1149
1157
  } : void 0,
1150
- positiveIcon: Et ?? void 0,
1151
- negativeIcon: Tt ?? void 0,
1152
- feedbackIcon: At ?? void 0,
1153
- screenshotMethod: Ht ?? void 0,
1154
- captureVideo: Rt === "true" ? !0 : void 0,
1155
- hideThumbs: Pt === "true" ? !0 : void 0,
1156
- hideDismiss: Bt === "true" ? !0 : void 0,
1157
- videoOptions: z || K ? {
1158
+ positiveIcon: Dt ?? void 0,
1159
+ negativeIcon: Mt ?? void 0,
1160
+ feedbackIcon: Rt ?? void 0,
1161
+ screenshotMethod: Ft ?? void 0,
1162
+ captureVideo: $t === "true" ? !0 : void 0,
1163
+ hideThumbs: zt === "true" ? !0 : void 0,
1164
+ hideDismiss: _t === "true" ? !0 : void 0,
1165
+ videoOptions: z || Q ? {
1158
1166
  maxDuration: z ? parseInt(z, 10) : void 0,
1159
- redaction: K === "true" ? !0 : void 0
1167
+ redaction: Q === "true" ? !0 : void 0
1160
1168
  } : void 0,
1161
- quests: X ? {
1162
- base: X,
1163
- up: $t ?? void 0,
1164
- down: zt ?? void 0,
1165
- video: _t ?? void 0,
1166
- apiKey: Ft ?? void 0,
1167
- moduleUrl: Vt ?? void 0
1169
+ quests: J ? {
1170
+ base: J,
1171
+ up: Nt ?? void 0,
1172
+ down: Ut ?? void 0,
1173
+ video: jt ?? void 0,
1174
+ apiKey: Kt ?? void 0,
1175
+ moduleUrl: Wt ?? void 0
1168
1176
  } : void 0
1169
1177
  };
1170
1178
  }
1171
- function Ne() {
1179
+ function We() {
1172
1180
  if (typeof document > "u") return;
1173
1181
  const i = () => {
1174
- const t = document.currentScript ?? document.querySelector("script[data-endpoint]"), e = Fe(), o = t ? Ve(t) : null, n = e ?? o;
1175
- n?.endpoint && new _e(n);
1182
+ const t = document.currentScript ?? document.querySelector("script[data-endpoint]"), e = je(), o = t ? Ke(t) : null, n = e ?? o;
1183
+ n?.endpoint && new Ue(n);
1176
1184
  };
1177
1185
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", i) : i();
1178
1186
  }
1179
- const Ue = 20, ot = 4096;
1187
+ const Xe = 20, rt = 4096;
1180
1188
  function R(i) {
1181
1189
  const t = typeof i == "string" ? i : JSON.stringify(i);
1182
- return t.length > ot ? t.slice(0, ot) + "…[truncated]" : t;
1190
+ return t.length > rt ? t.slice(0, rt) + "…[truncated]" : t;
1183
1191
  }
1184
- function nt(i, t) {
1185
- i.length >= Ue && i.shift(), i.push(t);
1192
+ function dt(i, t) {
1193
+ i.length >= Xe && i.shift(), i.push(t);
1186
1194
  }
1187
- async function je(i) {
1195
+ async function Ye(i) {
1188
1196
  try {
1189
1197
  const t = await i.clone().text();
1190
1198
  return R(t);
@@ -1192,7 +1200,7 @@ async function je(i) {
1192
1200
  return;
1193
1201
  }
1194
1202
  }
1195
- function Ke() {
1203
+ function Qe() {
1196
1204
  const i = [], t = window.fetch;
1197
1205
  window.fetch = async function(n, s) {
1198
1206
  const a = typeof n == "string" ? n : n instanceof URL ? n.toString() : n.url, c = s?.method ?? (typeof n == "object" && "method" in n ? n.method : "GET");
@@ -1200,8 +1208,8 @@ function Ke() {
1200
1208
  s?.body && (l = R(s.body));
1201
1209
  const d = await t.apply(window, [n, s]);
1202
1210
  if (d.status >= 400) {
1203
- const r = await je(d);
1204
- nt(i, {
1211
+ const r = await Ye(d);
1212
+ dt(i, {
1205
1213
  url: a,
1206
1214
  method: c.toUpperCase(),
1207
1215
  status: d.status,
@@ -1219,7 +1227,7 @@ function Ke() {
1219
1227
  }, XMLHttpRequest.prototype.send = function(n) {
1220
1228
  const s = this, a = n ? R(n) : void 0;
1221
1229
  return s.addEventListener("load", function() {
1222
- s.status >= 400 && nt(i, {
1230
+ s.status >= 400 && dt(i, {
1223
1231
  url: s._qaid_url,
1224
1232
  method: s._qaid_method.toUpperCase(),
1225
1233
  status: s.status,
@@ -1236,27 +1244,27 @@ function Ke() {
1236
1244
  }
1237
1245
  };
1238
1246
  }
1239
- function We() {
1247
+ function Ge() {
1240
1248
  const i = navigator.userAgent || "";
1241
1249
  return /iP(hone|ad|od)/.test(i) || // iPadOS 13+ masquerades as "MacIntel" but is a multi-touch device.
1242
1250
  navigator.platform === "MacIntel" && (navigator.maxTouchPoints || 0) > 1;
1243
1251
  }
1244
- function Xe(i, t, e, o, n) {
1252
+ function Je(i, t, e, o, n) {
1245
1253
  const s = i >= t, a = e >= o;
1246
1254
  return s === a ? { width: i, height: t, rotate: 0 } : { width: t, height: i, rotate: n === 270 ? -90 : 90 };
1247
1255
  }
1248
- function Ye(i, t, e) {
1256
+ function Ze(i, t, e) {
1249
1257
  if (e.rotate === 0) {
1250
1258
  i.drawImage(t, 0, 0, e.width, e.height);
1251
1259
  return;
1252
1260
  }
1253
1261
  i.save(), e.rotate === 90 ? (i.translate(e.width, 0), i.rotate(Math.PI / 2)) : (i.translate(0, e.height), i.rotate(-Math.PI / 2)), i.drawImage(t, 0, 0, e.height, e.width), i.restore();
1254
1262
  }
1255
- function Qe() {
1263
+ function ti() {
1256
1264
  const i = typeof screen < "u" ? screen.orientation : void 0;
1257
1265
  return i && typeof i.angle == "number" ? i.angle : 0;
1258
1266
  }
1259
- function mt(i) {
1267
+ function xt(i) {
1260
1268
  return new Promise((t) => {
1261
1269
  if (i.videoWidth > 0) {
1262
1270
  t();
@@ -1265,30 +1273,30 @@ function mt(i) {
1265
1273
  i.addEventListener("loadedmetadata", () => t(), { once: !0 });
1266
1274
  });
1267
1275
  }
1268
- async function vt(i) {
1276
+ async function qt(i) {
1269
1277
  try {
1270
1278
  await i.play();
1271
1279
  } catch {
1272
1280
  }
1273
1281
  }
1274
- async function Ge(i, t = 15) {
1282
+ async function ei(i, t = 15) {
1275
1283
  const e = document.createElement("canvas");
1276
1284
  if (typeof e.captureStream != "function") return null;
1277
1285
  const o = e.getContext("2d");
1278
1286
  if (!o) return null;
1279
1287
  const n = document.createElement("video");
1280
- n.muted = !0, n.playsInline = !0, n.srcObject = i, await mt(n);
1281
- const s = Xe(
1288
+ n.muted = !0, n.playsInline = !0, n.srcObject = i, await xt(n);
1289
+ const s = Je(
1282
1290
  n.videoWidth,
1283
1291
  n.videoHeight,
1284
1292
  window.innerWidth,
1285
1293
  window.innerHeight,
1286
- Qe()
1294
+ ti()
1287
1295
  );
1288
- e.width = s.width, e.height = s.height, await vt(n);
1296
+ e.width = s.width, e.height = s.height, await qt(n);
1289
1297
  let a = 0;
1290
1298
  const c = () => {
1291
- Ye(o, n, s), a = requestAnimationFrame(c);
1299
+ Ze(o, n, s), a = requestAnimationFrame(c);
1292
1300
  };
1293
1301
  c();
1294
1302
  const l = e.captureStream(t);
@@ -1299,15 +1307,15 @@ async function Ge(i, t = 15) {
1299
1307
  }
1300
1308
  };
1301
1309
  }
1302
- function Je(i, t, e, o, n) {
1310
+ function ii(i, t, e, o, n) {
1303
1311
  const s = Math.max(0, Math.min(o, i.left * t)), a = Math.max(0, Math.min(n, i.top * e)), c = Math.max(0, Math.min(o, (i.left + i.width) * t)), l = Math.max(0, Math.min(n, (i.top + i.height) * e)), d = c - s, r = l - a;
1304
1312
  return d <= 0 || r <= 0 ? null : { x: s, y: a, w: d, h: r };
1305
1313
  }
1306
- function Ze(i, t, e, o, n, s, a) {
1314
+ function oi(i, t, e, o, n, s, a) {
1307
1315
  i.drawImage(t, 0, 0, o, n);
1308
1316
  const c = o / Math.max(1, window.innerWidth), l = n / Math.max(1, window.innerHeight);
1309
1317
  for (const d of e) {
1310
- const r = Je(
1318
+ const r = ii(
1311
1319
  d.getBoundingClientRect(),
1312
1320
  c,
1313
1321
  l,
@@ -1317,16 +1325,16 @@ function Ze(i, t, e, o, n, s, a) {
1317
1325
  r && (i.save(), a ? (i.filter = `blur(${s}px)`, i.drawImage(t, r.x, r.y, r.w, r.h, r.x, r.y, r.w, r.h)) : (i.fillStyle = "#0b0b0b", i.fillRect(r.x, r.y, r.w, r.h)), i.restore());
1318
1326
  }
1319
1327
  }
1320
- async function ti(i, t, e = {}) {
1328
+ async function ni(i, t, e = {}) {
1321
1329
  const o = e.frameRate ?? 15, n = e.blurRadius ?? 12, s = document.createElement("canvas");
1322
1330
  if (typeof s.captureStream != "function") return null;
1323
1331
  const a = s.getContext("2d");
1324
1332
  if (!a) return null;
1325
1333
  const c = "filter" in a, l = document.createElement("video");
1326
- l.muted = !0, l.playsInline = !0, l.srcObject = i, await mt(l), s.width = l.videoWidth, s.height = l.videoHeight, await vt(l);
1334
+ l.muted = !0, l.playsInline = !0, l.srcObject = i, await xt(l), s.width = l.videoWidth, s.height = l.videoHeight, await qt(l);
1327
1335
  let d = 0;
1328
1336
  const r = () => {
1329
- Ze(
1337
+ oi(
1330
1338
  a,
1331
1339
  l,
1332
1340
  t,
@@ -1345,10 +1353,10 @@ async function ti(i, t, e = {}) {
1345
1353
  }
1346
1354
  };
1347
1355
  }
1348
- function ei() {
1356
+ function si() {
1349
1357
  return typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function" && typeof MediaRecorder < "u";
1350
1358
  }
1351
- function yt() {
1359
+ function Ct() {
1352
1360
  if (typeof MediaRecorder > "u") return "";
1353
1361
  const i = [
1354
1362
  "video/webm;codecs=vp9",
@@ -1361,20 +1369,20 @@ function yt() {
1361
1369
  return t;
1362
1370
  return "";
1363
1371
  }
1364
- function ii(i = {}) {
1372
+ function ai(i = {}) {
1365
1373
  const t = i.maxDuration ?? 15, e = i.videoBitsPerSecond ?? 8e5, o = i.redactionElements ?? [], n = i.redactionBlurRadius;
1366
- let s = null, a = null, c = null, l = null, d = [], r = null, h = null, p = null, g = 0, v = null, m = null, k = !1, x = null;
1374
+ let s = null, a = null, c = null, l = null, d = [], r = null, h = null, p = null, b = 0, y = null, g = null, w = !1, x = null;
1367
1375
  function u() {
1368
- p !== null && (clearInterval(p), p = null), x !== null && (clearTimeout(x), x = null), a && (a.stop(), a = null), c && (c.stop(), c = null), s && (s.getTracks().forEach((w) => w.stop()), s = null), l = null, d = [], r = null, h = null, v = null, m = null;
1376
+ p !== null && (clearInterval(p), p = null), x !== null && (clearTimeout(x), x = null), a && (a.stop(), a = null), c && (c.stop(), c = null), s && (s.getTracks().forEach((v) => v.stop()), s = null), l = null, d = [], r = null, h = null, y = null, g = null;
1369
1377
  }
1370
- function y() {
1371
- k || (k = !0, l && l.state !== "inactive" && l.stop());
1378
+ function k() {
1379
+ w || (w = !0, l && l.state !== "inactive" && l.stop());
1372
1380
  }
1373
1381
  return {
1374
1382
  async start() {
1375
- k = !1, d = [];
1376
- const w = yt();
1377
- if (!w)
1383
+ w = !1, d = [];
1384
+ const v = Ct();
1385
+ if (!v)
1378
1386
  throw new Error("No supported video MIME type found");
1379
1387
  s = await navigator.mediaDevices.getDisplayMedia({
1380
1388
  video: {
@@ -1394,90 +1402,90 @@ function ii(i = {}) {
1394
1402
  "qaid records only the current tab — please share this tab, not a window or your whole screen."
1395
1403
  );
1396
1404
  C && C.addEventListener("ended", () => {
1397
- y();
1405
+ k();
1398
1406
  });
1399
1407
  let S = s;
1400
- if (We()) {
1401
- const f = await Ge(s);
1408
+ if (Ge()) {
1409
+ const f = await ei(s);
1402
1410
  f && (a = f, S = f.stream);
1403
1411
  } else if (o.length > 0) {
1404
- const f = await ti(s, o, {
1412
+ const f = await ni(s, o, {
1405
1413
  blurRadius: n
1406
1414
  });
1407
1415
  f && (c = f, S = f.stream);
1408
1416
  }
1409
1417
  l = new MediaRecorder(S, {
1410
- mimeType: w,
1418
+ mimeType: v,
1411
1419
  videoBitsPerSecond: e
1412
1420
  }), l.ondataavailable = (f) => {
1413
1421
  f.data.size > 0 && d.push(f.data);
1414
1422
  }, l.onstop = () => {
1415
- const f = new Blob(d, { type: w });
1416
- v && v(f), h && h(f), a && (a.stop(), a = null), c && (c.stop(), c = null), s && s.getTracks().forEach((D) => D.stop());
1423
+ const f = new Blob(d, { type: v });
1424
+ y && y(f), h && h(f), a && (a.stop(), a = null), c && (c.stop(), c = null), s && s.getTracks().forEach((D) => D.stop());
1417
1425
  }, l.onerror = () => {
1418
- m && m(new Error("MediaRecorder error"));
1419
- }, l.start(1e3), g = Date.now(), p = setInterval(() => {
1420
- const f = Math.floor((Date.now() - g) / 1e3);
1426
+ g && g(new Error("MediaRecorder error"));
1427
+ }, l.start(1e3), b = Date.now(), p = setInterval(() => {
1428
+ const f = Math.floor((Date.now() - b) / 1e3);
1421
1429
  r && r(f);
1422
1430
  }, 1e3), x = setTimeout(() => {
1423
- y();
1431
+ k();
1424
1432
  }, t * 1e3);
1425
1433
  },
1426
1434
  stop() {
1427
- return new Promise((w, C) => {
1428
- v = w, m = C, y();
1435
+ return new Promise((v, C) => {
1436
+ y = v, g = C, k();
1429
1437
  });
1430
1438
  },
1431
- onTick(w) {
1432
- r = w;
1439
+ onTick(v) {
1440
+ r = v;
1433
1441
  },
1434
- onStop(w) {
1435
- h = w;
1442
+ onStop(v) {
1443
+ h = v;
1436
1444
  },
1437
1445
  destroy() {
1438
- y(), u();
1446
+ k(), u();
1439
1447
  }
1440
1448
  };
1441
1449
  }
1442
- const wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1450
+ const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1443
1451
  __proto__: null,
1444
- createVideoRecorder: ii,
1445
- getSupportedMimeType: yt,
1446
- isVideoRecordingSupported: ei
1447
- }, Symbol.toStringTag, { value: "Module" })), st = "https://qaid.dev/lib/html2canvas.min.js", oi = 1e4, ni = 50;
1452
+ createVideoRecorder: ai,
1453
+ getSupportedMimeType: Ct,
1454
+ isVideoRecordingSupported: si
1455
+ }, Symbol.toStringTag, { value: "Module" })), ct = "https://qaid.dev/lib/html2canvas.min.js", ri = 1e4, di = 50;
1448
1456
  let L = null;
1449
- function si() {
1457
+ function ci() {
1450
1458
  if (typeof document > "u" || typeof window > "u")
1451
1459
  return !1;
1452
1460
  const i = document.createElement("canvas");
1453
1461
  return typeof i.getContext == "function" && !!i.getContext("2d");
1454
1462
  }
1455
- function ai() {
1463
+ function li() {
1456
1464
  return window.html2canvas ? Promise.resolve(!0) : L || (L = new Promise((i) => {
1457
1465
  if (!document.querySelector(
1458
- `script[src="${st}"]`
1466
+ `script[src="${ct}"]`
1459
1467
  )) {
1460
1468
  const n = document.createElement("script");
1461
- n.src = st, n.async = !0, document.head.appendChild(n);
1469
+ n.src = ct, n.async = !0, document.head.appendChild(n);
1462
1470
  }
1463
1471
  const e = Date.now(), o = () => {
1464
1472
  if (window.html2canvas) {
1465
1473
  i(!0);
1466
1474
  return;
1467
1475
  }
1468
- if (Date.now() - e > oi) {
1476
+ if (Date.now() - e > ri) {
1469
1477
  L = null, i(!1);
1470
1478
  return;
1471
1479
  }
1472
- setTimeout(o, ni);
1480
+ setTimeout(o, di);
1473
1481
  };
1474
1482
  o();
1475
1483
  }), L);
1476
1484
  }
1477
- async function ri(i = {}) {
1485
+ async function hi(i = {}) {
1478
1486
  const { quality: t = 0.8, maxWidth: e = 1280, maxHeight: o = 800 } = i;
1479
1487
  try {
1480
- if (!await ai() || !window.html2canvas)
1488
+ if (!await li() || !window.html2canvas)
1481
1489
  return console.warn("html2canvas failed to load"), null;
1482
1490
  const s = await window.html2canvas(document.body, {
1483
1491
  useCORS: !0,
@@ -1502,11 +1510,11 @@ async function ri(i = {}) {
1502
1510
  return console.warn("DOM screenshot capture failed:", n), null;
1503
1511
  }
1504
1512
  }
1505
- const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1513
+ const lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1506
1514
  __proto__: null,
1507
- captureDomScreenshot: ri,
1508
- isDomScreenshotSupported: si
1509
- }, Symbol.toStringTag, { value: "Module" })), E = 12, di = "#ef4444", ci = ["#ef4444", "#f59e0b", "#22c55e", "#3b82f6", "#111827", "#ffffff"], li = {
1515
+ captureDomScreenshot: hi,
1516
+ isDomScreenshotSupported: ci
1517
+ }, Symbol.toStringTag, { value: "Module" })), E = 12, ui = "#ef4444", pi = ["#ef4444", "#f59e0b", "#22c55e", "#3b82f6", "#111827", "#ffffff"], fi = {
1510
1518
  "#ef4444": "red",
1511
1519
  "#f59e0b": "amber",
1512
1520
  "#22c55e": "green",
@@ -1515,10 +1523,10 @@ const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1515
1523
  "#ffffff": "white",
1516
1524
  "#6366f1": "indigo"
1517
1525
  };
1518
- function rt(i) {
1519
- return li[i.toLowerCase()] ?? i;
1526
+ function ht(i) {
1527
+ return fi[i.toLowerCase()] ?? i;
1520
1528
  }
1521
- const hi = 4, ui = 0.8, pi = {
1529
+ const mi = 4, bi = 0.8, gi = {
1522
1530
  title: "Annotate screenshot",
1523
1531
  instructions: "Draw on the screenshot to highlight or hide details, then choose Done to attach it or Skip to send the original.",
1524
1532
  rectangle: "Rectangle",
@@ -1538,12 +1546,12 @@ function P(i, t) {
1538
1546
  h: Math.abs(i.y - t.y)
1539
1547
  };
1540
1548
  }
1541
- function fi(i) {
1549
+ function vi(i) {
1542
1550
  if (i.type === "pen") return i.points.length < 2;
1543
1551
  const t = P(i.points[0], i.points[1]);
1544
1552
  return t.w < 3 && t.h < 3;
1545
1553
  }
1546
- function bi(i, t, e, o) {
1554
+ function yi(i, t, e, o) {
1547
1555
  i.beginPath(), i.moveTo(t.x, t.y), i.lineTo(e.x, e.y), i.stroke();
1548
1556
  const n = Math.atan2(e.y - t.y, e.x - t.x), s = Math.max(10, o * 3);
1549
1557
  i.beginPath(), i.moveTo(e.x, e.y), i.lineTo(
@@ -1554,7 +1562,7 @@ function bi(i, t, e, o) {
1554
1562
  e.y - s * Math.sin(n + Math.PI / 6)
1555
1563
  ), i.stroke();
1556
1564
  }
1557
- function gi(i, t) {
1565
+ function wi(i, t) {
1558
1566
  if (t.length !== 0) {
1559
1567
  i.beginPath(), i.moveTo(t[0].x, t[0].y);
1560
1568
  for (let e = 1; e < t.length; e++)
@@ -1562,7 +1570,7 @@ function gi(i, t) {
1562
1570
  i.stroke();
1563
1571
  }
1564
1572
  }
1565
- function mi(i, t, e, o, n) {
1573
+ function ki(i, t, e, o, n) {
1566
1574
  i.fillStyle = "rgb(15, 23, 42)", i.fillRect(t, e, o, n), i.fillStyle = "rgb(37, 47, 63)";
1567
1575
  for (let s = e; s < e + n; s += E)
1568
1576
  for (let a = t; a < t + o; a += E)
@@ -1581,30 +1589,30 @@ function B(i, t) {
1581
1589
  break;
1582
1590
  }
1583
1591
  case "arrow":
1584
- bi(i, t.points[0], t.points[1], t.strokeWidth);
1592
+ yi(i, t.points[0], t.points[1], t.strokeWidth);
1585
1593
  break;
1586
1594
  case "pen":
1587
- gi(i, t.points);
1595
+ wi(i, t.points);
1588
1596
  break;
1589
1597
  case "blur": {
1590
1598
  const e = P(t.points[0], t.points[1]);
1591
- mi(i, e.x, e.y, e.w, e.h);
1599
+ ki(i, e.x, e.y, e.w, e.h);
1592
1600
  break;
1593
1601
  }
1594
1602
  }
1595
1603
  i.restore();
1596
1604
  }
1597
- function kt(i) {
1605
+ function Et(i) {
1598
1606
  return new Promise((t, e) => {
1599
1607
  const o = new Image();
1600
1608
  o.onload = () => t(o), o.onerror = () => e(new Error("Failed to load screenshot")), o.src = i;
1601
1609
  });
1602
1610
  }
1603
- async function xt(i, t, e = {}) {
1604
- const o = e.quality ?? ui;
1611
+ async function Tt(i, t, e = {}) {
1612
+ const o = e.quality ?? bi;
1605
1613
  let n;
1606
1614
  try {
1607
- n = await kt(i);
1615
+ n = await Et(i);
1608
1616
  } catch {
1609
1617
  return i;
1610
1618
  }
@@ -1617,8 +1625,8 @@ async function xt(i, t, e = {}) {
1617
1625
  B(a, c);
1618
1626
  return s.toDataURL("image/webp", o);
1619
1627
  }
1620
- let vi = 0;
1621
- class qt {
1628
+ let xi = 0;
1629
+ class At {
1622
1630
  shapes = [];
1623
1631
  tool = "rect";
1624
1632
  opts;
@@ -1626,7 +1634,7 @@ class qt {
1626
1634
  color;
1627
1635
  palette;
1628
1636
  strokeWidth;
1629
- uid = `qaid-annotate-${++vi}`;
1637
+ uid = `qaid-annotate-${++xi}`;
1630
1638
  container;
1631
1639
  canvas;
1632
1640
  ctx = null;
@@ -1640,7 +1648,7 @@ class qt {
1640
1648
  // after the editor is mounted).
1641
1649
  resolveResult;
1642
1650
  constructor(t) {
1643
- this.opts = t, this.labels = { ...pi, ...t.labels ?? {} }, this.color = t.color ?? di, this.palette = (t.palette && t.palette.length ? t.palette : ci).slice(), this.palette.some((e) => e.toLowerCase() === this.color.toLowerCase()) || this.palette.unshift(this.color), this.strokeWidth = t.strokeWidth ?? hi;
1651
+ this.opts = t, this.labels = { ...gi, ...t.labels ?? {} }, this.color = t.color ?? ui, this.palette = (t.palette && t.palette.length ? t.palette : pi).slice(), this.palette.some((e) => e.toLowerCase() === this.color.toLowerCase()) || this.palette.unshift(this.color), this.strokeWidth = t.strokeWidth ?? mi;
1644
1652
  }
1645
1653
  /** Mount the editor and resolve when the user commits (Done) or skips. */
1646
1654
  open() {
@@ -1662,7 +1670,7 @@ class qt {
1662
1670
  }
1663
1671
  /** A round colour swatch button for the toolbar's colour group. */
1664
1672
  swatchButton(t) {
1665
- const e = rt(t), o = q("button", {
1673
+ const e = ht(t), o = q("button", {
1666
1674
  type: "button",
1667
1675
  class: "qaid-annotate-swatch",
1668
1676
  "data-qaid-color": t,
@@ -1702,19 +1710,19 @@ class qt {
1702
1710
  "aria-label": this.labels.title
1703
1711
  });
1704
1712
  const a = q("div", { class: "qaid-annotate-tools" });
1705
- a.appendChild(this.toolButton("rect", Ut, this.labels.rectangle)), a.appendChild(this.toolButton("arrow", jt, this.labels.arrow)), a.appendChild(this.toolButton("pen", Kt, this.labels.pen)), a.appendChild(this.toolButton("blur", Wt, this.labels.blur));
1713
+ a.appendChild(this.toolButton("rect", Yt, this.labels.rectangle)), a.appendChild(this.toolButton("arrow", Qt, this.labels.arrow)), a.appendChild(this.toolButton("pen", Gt, this.labels.pen)), a.appendChild(this.toolButton("blur", Jt, this.labels.blur));
1706
1714
  const c = q("div", {
1707
1715
  class: "qaid-annotate-colors",
1708
1716
  role: "group",
1709
1717
  "aria-label": this.labels.colors
1710
1718
  });
1711
1719
  for (const h of this.palette) c.appendChild(this.swatchButton(h));
1712
- this.undoBtn = this.actionButton("undo", Xt, this.labels.undo, "qaid-annotate-undo"), this.undoBtn.disabled = !0;
1713
- const l = this.actionButton("skip", Qt, this.labels.skip, "qaid-annotate-skip"), d = this.actionButton("done", Yt, this.labels.done, "qaid-annotate-done"), r = q("div", { class: "qaid-annotate-actions" });
1720
+ this.undoBtn = this.actionButton("undo", Zt, this.labels.undo, "qaid-annotate-undo"), this.undoBtn.disabled = !0;
1721
+ const l = this.actionButton("skip", te, this.labels.skip, "qaid-annotate-skip"), d = this.actionButton("done", vt, this.labels.done, "qaid-annotate-done"), r = q("div", { class: "qaid-annotate-actions" });
1714
1722
  r.appendChild(this.undoBtn), r.appendChild(l), r.appendChild(d), this.toolbar.appendChild(a), this.toolbar.appendChild(c), this.toolbar.appendChild(r), this.container.appendChild(o), this.container.appendChild(n), this.container.appendChild(s), this.container.appendChild(this.toolbar), this.opts.root.appendChild(this.container), this.toolbar.addEventListener("click", this.onToolbarClick), this.canvas.addEventListener("pointerdown", this.onPointerDown), this.container.addEventListener("pointermove", this.onPointerMove), this.container.addEventListener("pointerup", this.onPointerUp), this.container.addEventListener("keydown", this.onKeyDown), this.opts.openDialog?.(this.container, {
1715
1723
  labelledbyId: t,
1716
1724
  describedbyId: e
1717
- }), this.opts.announce?.(this.labels.instructions), kt(this.opts.dataUrl).then((h) => {
1725
+ }), this.opts.announce?.(this.labels.instructions), Et(this.opts.dataUrl).then((h) => {
1718
1726
  this.img = h, this.canvas.width = h.naturalWidth || h.width || 1, this.canvas.height = h.naturalHeight || h.height || 1, this.redraw();
1719
1727
  }).catch(() => {
1720
1728
  this.img = null, this.redraw();
@@ -1746,7 +1754,7 @@ class qt {
1746
1754
  n.getAttribute("data-qaid-tool") === t ? "true" : "false"
1747
1755
  );
1748
1756
  });
1749
- const o = this.labels[yi[t]];
1757
+ const o = this.labels[qi[t]];
1750
1758
  this.opts.announce?.(`${o} tool selected`);
1751
1759
  }
1752
1760
  /** Set the active drawing colour; subsequent shapes use it. */
@@ -1756,7 +1764,7 @@ class qt {
1756
1764
  "aria-pressed",
1757
1765
  (o.getAttribute("data-qaid-color") ?? "").toLowerCase() === t.toLowerCase() ? "true" : "false"
1758
1766
  );
1759
- }), this.opts.announce?.(`${rt(t)} colour selected`);
1767
+ }), this.opts.announce?.(`${ht(t)} colour selected`);
1760
1768
  }
1761
1769
  onToolbarClick = (t) => {
1762
1770
  const o = t.target?.closest(
@@ -1795,7 +1803,7 @@ class qt {
1795
1803
  if (!this.drawing || !this.current) return;
1796
1804
  this.drawing = !1;
1797
1805
  const t = this.current;
1798
- if (this.current = null, fi(t)) {
1806
+ if (this.current = null, vi(t)) {
1799
1807
  this.redraw();
1800
1808
  return;
1801
1809
  }
@@ -1824,7 +1832,7 @@ class qt {
1824
1832
  /** Composite the annotations and resolve with the new WebP data URL. */
1825
1833
  async done() {
1826
1834
  if (this.settled) return;
1827
- const t = await xt(this.opts.dataUrl, this.shapes, {
1835
+ const t = await Tt(this.opts.dataUrl, this.shapes, {
1828
1836
  quality: this.opts.quality
1829
1837
  });
1830
1838
  this.opts.announce?.("Annotated screenshot attached"), this.settle(t);
@@ -1840,27 +1848,27 @@ class qt {
1840
1848
  this.toolbar.removeEventListener("click", this.onToolbarClick), this.canvas.removeEventListener("pointerdown", this.onPointerDown), this.container.removeEventListener("pointermove", this.onPointerMove), this.container.removeEventListener("pointerup", this.onPointerUp), this.container.removeEventListener("keydown", this.onKeyDown), this.opts.closeDialog?.(), this.container.remove();
1841
1849
  }
1842
1850
  }
1843
- const yi = {
1851
+ const qi = {
1844
1852
  rect: "rectangle",
1845
1853
  arrow: "arrow",
1846
1854
  pen: "pen",
1847
1855
  blur: "blur"
1848
1856
  };
1849
- function wi(i) {
1850
- return new qt(i).open();
1857
+ function Ci(i) {
1858
+ return new At(i).open();
1851
1859
  }
1852
- const dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1860
+ const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1853
1861
  __proto__: null,
1854
- AnnotationEditor: qt,
1855
- compositeAnnotations: xt,
1862
+ AnnotationEditor: At,
1863
+ compositeAnnotations: Tt,
1856
1864
  drawShape: B,
1857
- openAnnotationEditor: wi,
1865
+ openAnnotationEditor: Ci,
1858
1866
  rectFromPoints: P
1859
1867
  }, Symbol.toStringTag, { value: "Module" }));
1860
- Ne();
1861
- const ki = document;
1862
- function b(i, t, ...e) {
1863
- const o = ki.createElement(i);
1868
+ We();
1869
+ const Si = document;
1870
+ function m(i, t, ...e) {
1871
+ const o = Si.createElement(i);
1864
1872
  if (t) {
1865
1873
  if (t.class && (o.className = t.class), t.style && (o.style.cssText = t.style), t.html != null && (o.innerHTML = t.html), t.text != null && (o.textContent = t.text), t.attrs)
1866
1874
  for (const n in t.attrs) o.setAttribute(n, t.attrs[n]);
@@ -1871,10 +1879,11 @@ function b(i, t, ...e) {
1871
1879
  n != null && n !== !1 && o.append(n);
1872
1880
  return o;
1873
1881
  }
1874
- class xi {
1882
+ class Ei {
1875
1883
  constructor(t) {
1876
1884
  this.host = t;
1877
1885
  }
1886
+ host;
1878
1887
  videoRecorder = null;
1879
1888
  networkCapture = null;
1880
1889
  recordedBlob = null;
@@ -1897,8 +1906,8 @@ class xi {
1897
1906
  async startRecording(t = []) {
1898
1907
  if (!(this.isRecording || this.host.state !== "IDLE"))
1899
1908
  try {
1900
- this.networkCapture = Ke();
1901
- const { createVideoRecorder: e } = await Promise.resolve().then(() => wt);
1909
+ this.networkCapture = Qe();
1910
+ const { createVideoRecorder: e } = await Promise.resolve().then(() => St);
1902
1911
  this.videoRecorder = e({
1903
1912
  maxDuration: this.host.config.videoOptions.maxDuration,
1904
1913
  redactionElements: t
@@ -1928,27 +1937,27 @@ class xi {
1928
1937
  startPicking() {
1929
1938
  if (this.isRecording || this.host.state !== "IDLE") return;
1930
1939
  this.host.setState("REDACT_PICKING"), this.redactPicks = [];
1931
- const t = this.host.ensureOverlayHost(), e = b("div", { style: "position:absolute;inset:0;" }), o = b(
1940
+ const t = this.host.ensureOverlayHost(), e = m("div", { style: "position:absolute;inset:0;" }), o = m(
1932
1941
  "div",
1933
1942
  { class: "qaid-redact-picker", style: "position:fixed;inset:0;pointer-events:none;" },
1934
1943
  e,
1935
1944
  // Control bar — the only pointer-interactive part of the overlay.
1936
- b(
1945
+ m(
1937
1946
  "div",
1938
1947
  {
1939
1948
  style: "position:fixed;left:50%;bottom:24px;transform:translateX(-50%);display:flex;gap:12px;align-items:center;pointer-events:auto;background:#0b1220;color:#fff;border:1px solid #ff6b6b;border-radius:9999px;padding:10px 16px;font:600 13px system-ui,sans-serif;box-shadow:0 8px 30px rgba(0,0,0,.5);"
1940
1949
  },
1941
- b("span", {
1950
+ m("span", {
1942
1951
  text: "Click sensitive areas to blur",
1943
1952
  attrs: { "data-qaid-redact-label": "" }
1944
1953
  }),
1945
- b("button", {
1954
+ m("button", {
1946
1955
  text: "Start recording",
1947
1956
  attrs: { type: "button" },
1948
1957
  style: "cursor:pointer;border:0;border-radius:9999px;padding:8px 14px;background:#ff6b6b;color:#0b1220;font:inherit;",
1949
1958
  on: { click: () => this.finishRedactionPicking(!0) }
1950
1959
  }),
1951
- b("button", {
1960
+ m("button", {
1952
1961
  text: "Cancel",
1953
1962
  attrs: { type: "button" },
1954
1963
  style: "cursor:pointer;border:0;background:transparent;color:#9fb3c8;font:inherit;",
@@ -1979,7 +1988,7 @@ class xi {
1979
1988
  for (const e of this.redactPicks) {
1980
1989
  const o = e.getBoundingClientRect();
1981
1990
  o.width <= 0 || o.height <= 0 || t.appendChild(
1982
- b("div", {
1991
+ m("div", {
1983
1992
  style: `position:fixed;left:${o.left}px;top:${o.top}px;width:${o.width}px;height:${o.height}px;border:2px solid #ff6b6b;border-radius:4px;background:rgba(255,107,107,.18);pointer-events:none;`
1984
1993
  })
1985
1994
  );
@@ -1992,15 +2001,15 @@ class xi {
1992
2001
  }
1993
2002
  showRecordingIndicator() {
1994
2003
  const t = this.host.ensureOverlayHost();
1995
- this.recordingIndicator = b(
2004
+ this.recordingIndicator = m(
1996
2005
  "div",
1997
2006
  { class: "qaid-recording-indicator", style: `z-index:${this.host.config.zIndex + 100}` },
1998
- b("div", { class: "qaid-recording-dot" }),
1999
- b("span", {
2007
+ m("div", { class: "qaid-recording-dot" }),
2008
+ m("span", {
2000
2009
  class: "qaid-recording-time",
2001
2010
  text: this.formatTime(this.host.config.videoOptions.maxDuration)
2002
2011
  }),
2003
- b("button", {
2012
+ m("button", {
2004
2013
  class: "qaid-recording-stop",
2005
2014
  text: "Stop",
2006
2015
  attrs: { type: "button" },
@@ -2024,34 +2033,34 @@ class xi {
2024
2033
  this.recordingIndicator && (this.recordingIndicator.remove(), this.recordingIndicator = null);
2025
2034
  }
2026
2035
  showRecordingPreview() {
2027
- const t = this.host.ensureOverlayHost(), e = URL.createObjectURL(this.recordedBlob), o = `qaid-video-title-${this.host.uid}`, n = b("h3", { text: "Review your recording", attrs: { id: o } }), s = b("video");
2036
+ const t = this.host.ensureOverlayHost(), e = URL.createObjectURL(this.recordedBlob), o = `qaid-video-title-${this.host.uid}`, n = m("h3", { text: "Review your recording", attrs: { id: o } }), s = m("video");
2028
2037
  s.src = e, s.controls = !0, s.autoplay = !0, s.muted = !0;
2029
- const a = b("textarea", {
2038
+ const a = m("textarea", {
2030
2039
  attrs: {
2031
2040
  placeholder: "Optional: Describe the issue you recorded...",
2032
2041
  "aria-label": "Describe the issue you recorded"
2033
2042
  }
2034
- }), c = b("button", {
2043
+ }), c = m("button", {
2035
2044
  class: "qaid-video-btn qaid-video-btn-send",
2036
2045
  text: "Send",
2037
2046
  attrs: { type: "button" },
2038
2047
  on: { click: () => this.submitVideoFeedback(a.value.trim() || null, c) }
2039
- }), l = b(
2048
+ }), l = m(
2040
2049
  "div",
2041
2050
  { class: "qaid-video-preview-box" },
2042
2051
  n,
2043
2052
  s,
2044
2053
  a,
2045
- b(
2054
+ m(
2046
2055
  "div",
2047
2056
  { class: "qaid-video-preview-actions" },
2048
- b("button", {
2057
+ m("button", {
2049
2058
  class: "qaid-video-btn qaid-video-btn-cancel",
2050
2059
  text: "Cancel",
2051
2060
  attrs: { type: "button" },
2052
2061
  on: { click: () => this.cancelRecordingPreview() }
2053
2062
  }),
2054
- b("button", {
2063
+ m("button", {
2055
2064
  class: "qaid-video-btn qaid-video-btn-rerecord",
2056
2065
  text: "Re-record",
2057
2066
  attrs: { type: "button" },
@@ -2064,7 +2073,7 @@ class xi {
2064
2073
  c
2065
2074
  )
2066
2075
  );
2067
- this.videoPreview = b(
2076
+ this.videoPreview = m(
2068
2077
  "div",
2069
2078
  { class: "qaid-video-preview", style: `z-index:${this.host.config.zIndex + 100}` },
2070
2079
  l
@@ -2108,11 +2117,11 @@ class xi {
2108
2117
  this.isRecording = !1, this.removeRecordingIndicator(), this.videoRecorder && (this.videoRecorder.destroy(), this.videoRecorder = null), this.networkCapture && (this.networkCapture.restore(), this.networkCapture = null), this.recordedBlob && (this.recordedBlob = null), this.host.setButtonsDisabled(!1), this.host.overlayShadowHost && this.host.state === "IDLE" && (this.host.overlayShadowHost.style.pointerEvents = "none");
2109
2118
  }
2110
2119
  }
2111
- const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2120
+ const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2112
2121
  __proto__: null,
2113
- RecordingController: xi
2122
+ RecordingController: Ei
2114
2123
  }, Symbol.toStringTag, { value: "Module" }));
2115
- async function qi(i = {}) {
2124
+ async function Ti(i = {}) {
2116
2125
  const { quality: t = 1, maxWidth: e = 1280, maxHeight: o = 800 } = i;
2117
2126
  try {
2118
2127
  if (!navigator.mediaDevices?.getDisplayMedia)
@@ -2123,32 +2132,33 @@ async function qi(i = {}) {
2123
2132
  displaySurface: "browser"
2124
2133
  }
2125
2134
  }), s = n.getVideoTracks()[0], a = s.getSettings(), c = document.createElement("video");
2126
- c.srcObject = n, c.muted = !0, await new Promise((m) => {
2135
+ c.srcObject = n, c.muted = !0, await new Promise((g) => {
2127
2136
  c.onloadedmetadata = () => {
2128
- c.play(), m();
2137
+ c.play(), g();
2129
2138
  };
2130
- }), await new Promise((m) => {
2131
- const k = () => {
2132
- c.readyState >= 2 ? m() : requestAnimationFrame(k);
2139
+ }), await new Promise((g) => {
2140
+ const w = () => {
2141
+ c.readyState >= 2 ? g() : requestAnimationFrame(w);
2133
2142
  };
2134
- k();
2135
- }), await new Promise((m) => setTimeout(m, 100));
2136
- const l = a.width || c.videoWidth, d = a.height || c.videoHeight, r = Math.min(e / l, o / d, 1), h = Math.round(l * r), p = Math.round(d * r), g = document.createElement("canvas");
2137
- g.width = h, g.height = p;
2138
- const v = g.getContext("2d");
2139
- return v ? (v.drawImage(c, 0, 0, h, p), s.stop(), g.toDataURL("image/webp", t)) : (s.stop(), null);
2143
+ w();
2144
+ }), await new Promise((g) => setTimeout(g, 100));
2145
+ const l = a.width || c.videoWidth, d = a.height || c.videoHeight, r = Math.min(e / l, o / d, 1), h = Math.round(l * r), p = Math.round(d * r), b = document.createElement("canvas");
2146
+ b.width = h, b.height = p;
2147
+ const y = b.getContext("2d");
2148
+ return y ? (y.drawImage(c, 0, 0, h, p), s.stop(), b.toDataURL("image/webp", t)) : (s.stop(), null);
2140
2149
  } catch (n) {
2141
2150
  return console.warn("Screenshot capture failed:", n), null;
2142
2151
  }
2143
2152
  }
2144
- const lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2153
+ const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2145
2154
  __proto__: null,
2146
- captureScreenshot: qi
2155
+ captureScreenshot: Ti
2147
2156
  }, Symbol.toStringTag, { value: "Module" }));
2148
- class Ci {
2157
+ class Ai {
2149
2158
  constructor(t) {
2150
2159
  this.host = t;
2151
2160
  }
2161
+ host;
2152
2162
  modalContainer = null;
2153
2163
  backdrop = null;
2154
2164
  open() {
@@ -2180,7 +2190,7 @@ class Ci {
2180
2190
  `, this.host.applyVars(e), t.appendChild(e), this.modalContainer = e, this.setupModalInteractions();
2181
2191
  }
2182
2192
  showPositionedModal() {
2183
- const t = this.host.ensureOverlayHost(), { modal: e, arrow: o } = Te(
2193
+ const t = this.host.ensureOverlayHost(), { modal: e, arrow: o } = De(
2184
2194
  this.host.selectedBounds,
2185
2195
  window.innerWidth,
2186
2196
  window.innerHeight,
@@ -2202,7 +2212,7 @@ class Ci {
2202
2212
  const t = this.host.feedbackData.feedbackType, e = t === "up", o = this.host.config.positiveIcon || V, n = this.host.config.negativeIcon || N, s = this.host.config.buttonClass ? `qaid-type-toggle qaid-type-toggle-custom ${this.host.config.buttonClass} ${e ? "qaid-btn-up" : "qaid-btn-down"}` : `qaid-type-toggle ${e ? "qaid-type-up" : "qaid-type-down"}`;
2203
2213
  return `
2204
2214
  <div class="qaid-modal-header">
2205
- ${t === "neutral" ? `<span class="qaid-type-static" aria-hidden="true">${this.host.config.feedbackIcon || pt}</span>` : `<button type="button" class="${s}" title="Click to switch" aria-pressed="${e}" aria-label="${e ? "Feedback type: positive" : "Feedback type: negative"}">
2215
+ ${t === "neutral" ? `<span class="qaid-type-static" aria-hidden="true">${this.host.config.feedbackIcon || gt}</span>` : `<button type="button" class="${s}" title="Click to switch" aria-pressed="${e}" aria-label="${e ? "Feedback type: positive" : "Feedback type: negative"}">
2206
2216
  ${e ? o : n}
2207
2217
  </button>`}
2208
2218
  <div class="qaid-modal-header-text">
@@ -2243,29 +2253,59 @@ class Ci {
2243
2253
  });
2244
2254
  }
2245
2255
  async submitMessage(t) {
2256
+ let e = !1;
2246
2257
  if (this.host.feedbackId) {
2247
2258
  try {
2248
2259
  await fetch(`${this.host.config.endpoint}/${this.host.feedbackId}`, {
2249
2260
  method: "PATCH",
2250
2261
  headers: { "Content-Type": "application/json" },
2251
2262
  body: JSON.stringify({ message: t })
2252
- });
2253
- } catch (e) {
2254
- console.error("Failed to submit feedback message:", e);
2263
+ }), e = !0;
2264
+ } catch (o) {
2265
+ console.error("Failed to submit feedback message:", o);
2255
2266
  }
2256
2267
  this.host.setFeedbackId(null);
2257
2268
  }
2269
+ if (e && !this.host.config.hideConfirmation) {
2270
+ this.showConfirmation();
2271
+ return;
2272
+ }
2258
2273
  this.close();
2259
2274
  }
2275
+ /**
2276
+ * Replace the modal's contents with a checkmark and a short acknowledgement.
2277
+ *
2278
+ * The submit button that had focus is gone by this point, so focus moves to
2279
+ * the heading (WCAG 2.4.3) and the message is announced. Mirrors the quests
2280
+ * embed's thank-you screen so the two products confirm the same way.
2281
+ */
2282
+ showConfirmation() {
2283
+ const t = this.modalContainer?.querySelector(".qaid-modal-box") ?? this.modalContainer?.querySelector(".qaid-bottom-sheet-content") ?? this.modalContainer;
2284
+ if (!t) {
2285
+ this.close();
2286
+ return;
2287
+ }
2288
+ const e = this.host.config.text, o = `qaid-confirm-title-${this.host.uid}`;
2289
+ t.innerHTML = `
2290
+ <div class="qaid-confirm">
2291
+ <span class="qaid-confirm-icon" aria-hidden="true">${vt}</span>
2292
+ <h3 class="qaid-confirm-title" id="${o}" tabindex="-1">${e.confirmationTitle}</h3>
2293
+ <p class="qaid-confirm-message">${e.confirmationMessage}</p>
2294
+ <button type="button" class="qaid-btn-submit qaid-confirm-close">${e.confirmationClose}</button>
2295
+ </div>
2296
+ `, t.querySelector(".qaid-confirm-close")?.addEventListener("click", () => this.close());
2297
+ const n = t.querySelector(`#${CSS.escape(o)}`);
2298
+ requestAnimationFrame(() => n?.focus()), this.host.announceMsg(`${e.confirmationTitle} ${e.confirmationMessage}`, !0);
2299
+ }
2260
2300
  }
2261
- const ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2301
+ const mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2262
2302
  __proto__: null,
2263
- ModalController: Ci
2264
- }, Symbol.toStringTag, { value: "Module" })), Ct = ["data-comp", "data-qa", "data-testid", "data-id"];
2265
- function St(i, t = document.body) {
2303
+ ModalController: Ai
2304
+ }, Symbol.toStringTag, { value: "Module" })), Lt = ["data-comp", "data-qa", "data-testid", "data-id"];
2305
+ function It(i, t = document.body) {
2266
2306
  let e = i;
2267
2307
  for (; e && e !== t; ) {
2268
- for (const o of Ct) {
2308
+ for (const o of Lt) {
2269
2309
  const n = e.getAttribute(o);
2270
2310
  if (n)
2271
2311
  return `${o}="${n}"`;
@@ -2274,37 +2314,37 @@ function St(i, t = document.body) {
2274
2314
  }
2275
2315
  return null;
2276
2316
  }
2277
- function Si(i, t = 100) {
2317
+ function Li(i, t = 100) {
2278
2318
  const e = i.textContent?.trim().slice(0, t) || "";
2279
2319
  return e.length === t ? e + "..." : e;
2280
2320
  }
2281
- function Ei(i) {
2321
+ function Ii(i) {
2282
2322
  let t = 1, e = i.previousElementSibling;
2283
2323
  for (; e; )
2284
2324
  t++, e = e.previousElementSibling;
2285
2325
  return t;
2286
2326
  }
2287
- function Ti(i) {
2327
+ function Di(i) {
2288
2328
  const t = [];
2289
2329
  let e = i;
2290
2330
  for (; e && e !== document.body && e !== document.documentElement; ) {
2291
- const o = e.tagName.toLowerCase(), n = Ei(e);
2331
+ const o = e.tagName.toLowerCase(), n = Ii(e);
2292
2332
  t.unshift(`${o}:nth-child(${n})`), e = e.parentElement;
2293
2333
  }
2294
2334
  return t.length > 0 ? `body > ${t.join(" > ")}` : "body";
2295
2335
  }
2296
- function Ai(i) {
2336
+ function Mi(i) {
2297
2337
  return i.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
2298
2338
  }
2299
- function Li(i) {
2300
- const t = St(i);
2301
- return t ? `[${t}]` : i.id ? `#${Ai(i.id)}` : Ti(i);
2339
+ function Ri(i) {
2340
+ const t = It(i);
2341
+ return t ? `[${t}]` : i.id ? `#${Mi(i.id)}` : Di(i);
2302
2342
  }
2303
2343
  function F(i) {
2304
- const t = Si(i), e = St(i);
2305
- return { selector: Li(i), text: t, dataAttr: e };
2344
+ const t = Li(i), e = It(i);
2345
+ return { selector: Ri(i), text: t, dataAttr: e };
2306
2346
  }
2307
- const Ii = [
2347
+ const Pi = [
2308
2348
  "a[href]",
2309
2349
  "button",
2310
2350
  "input:not([type=hidden])",
@@ -2323,9 +2363,9 @@ const Ii = [
2323
2363
  "p",
2324
2364
  "li",
2325
2365
  "label",
2326
- ...Ct.map((i) => `[${i}]`)
2327
- ].join(","), Di = /^(?:A|BUTTON|INPUT|SELECT|TEXTAREA|SUMMARY)$/;
2328
- function Mi(i) {
2366
+ ...Lt.map((i) => `[${i}]`)
2367
+ ].join(","), Bi = /^(?:A|BUTTON|INPUT|SELECT|TEXTAREA|SUMMARY)$/;
2368
+ function Hi(i) {
2329
2369
  if (i.hasAttribute("hidden") || i.getAttribute("aria-hidden") === "true") return !1;
2330
2370
  const t = i.ownerDocument?.defaultView;
2331
2371
  if (t && typeof t.getComputedStyle == "function") {
@@ -2334,14 +2374,14 @@ function Mi(i) {
2334
2374
  }
2335
2375
  return !0;
2336
2376
  }
2337
- function Ri(i = {}) {
2338
- const t = i.root ?? document.body, e = i.selector ?? Ii, o = i.isExcluded ?? (() => !1), n = i.isVisible ?? Mi;
2377
+ function Oi(i = {}) {
2378
+ const t = i.root ?? document.body, e = i.selector ?? Pi, o = i.isExcluded ?? (() => !1), n = i.isVisible ?? Hi;
2339
2379
  return Array.from(t.querySelectorAll(e)).filter(
2340
2380
  (s) => !o(s) && n(s)
2341
2381
  );
2342
2382
  }
2343
- function Pi(i) {
2344
- const t = i.candidates ?? Ri({
2383
+ function $i(i) {
2384
+ const t = i.candidates ?? Oi({
2345
2385
  root: i.root,
2346
2386
  selector: i.selector,
2347
2387
  isExcluded: i.isExcluded,
@@ -2356,11 +2396,11 @@ function Pi(i) {
2356
2396
  s < 0 && t.length > 0 && (s = 0);
2357
2397
  function l(u) {
2358
2398
  if (!e) return;
2359
- const y = u;
2360
- if (typeof y.focus == "function") {
2361
- u.getAttribute("tabindex") === null && !Di.test(u.tagName) && (u.setAttribute("tabindex", "-1"), n.add(u));
2399
+ const k = u;
2400
+ if (typeof k.focus == "function") {
2401
+ u.getAttribute("tabindex") === null && !Bi.test(u.tagName) && (u.setAttribute("tabindex", "-1"), n.add(u));
2362
2402
  try {
2363
- y.focus();
2403
+ k.focus();
2364
2404
  } catch {
2365
2405
  }
2366
2406
  }
@@ -2371,8 +2411,8 @@ function Pi(i) {
2371
2411
  }
2372
2412
  function r(u) {
2373
2413
  if (a || t.length === 0) return;
2374
- const y = t.length;
2375
- s = (u % y + y) % y, d();
2414
+ const k = t.length;
2415
+ s = (u % k + k) % k, d();
2376
2416
  }
2377
2417
  function h() {
2378
2418
  r(s + 1);
@@ -2380,19 +2420,19 @@ function Pi(i) {
2380
2420
  function p() {
2381
2421
  r(s - 1);
2382
2422
  }
2383
- function g() {
2423
+ function b() {
2384
2424
  return t[s] ?? null;
2385
2425
  }
2386
- function v() {
2426
+ function y() {
2387
2427
  a || (a = !0, o.removeEventListener("keydown", x, !0), n.forEach((u) => u.removeAttribute("tabindex")), n.clear());
2388
2428
  }
2389
- function m() {
2429
+ function g() {
2390
2430
  if (a) return;
2391
- const u = g();
2392
- v(), u && i.onSelect(u);
2431
+ const u = b();
2432
+ y(), u && i.onSelect(u);
2393
2433
  }
2394
- function k() {
2395
- a || (v(), i.onCancel?.());
2434
+ function w() {
2435
+ a || (y(), i.onCancel?.());
2396
2436
  }
2397
2437
  function x(u) {
2398
2438
  if (!a)
@@ -2411,32 +2451,33 @@ function Pi(i) {
2411
2451
  case "Enter":
2412
2452
  case " ":
2413
2453
  case "Spacebar":
2414
- u.preventDefault(), u.stopPropagation(), m();
2454
+ u.preventDefault(), u.stopPropagation(), g();
2415
2455
  break;
2416
2456
  case "Escape":
2417
2457
  case "Esc":
2418
- u.preventDefault(), u.stopPropagation(), k();
2458
+ u.preventDefault(), u.stopPropagation(), w();
2419
2459
  break;
2420
2460
  }
2421
2461
  }
2422
2462
  return o.addEventListener("keydown", x, !0), s >= 0 && d(), {
2423
2463
  candidates: t,
2424
2464
  getIndex: () => s,
2425
- getCurrent: g,
2465
+ getCurrent: b,
2426
2466
  next: h,
2427
2467
  prev: p,
2428
2468
  moveTo: r,
2429
- select: m,
2430
- cancel: k,
2469
+ select: g,
2470
+ cancel: w,
2431
2471
  handleKey: x,
2432
- stop: v
2472
+ stop: y
2433
2473
  };
2434
2474
  }
2435
- const Bi = 12;
2436
- class Hi {
2475
+ const zi = 12;
2476
+ class _i {
2437
2477
  constructor(t) {
2438
2478
  this.host = t;
2439
2479
  }
2480
+ host;
2440
2481
  mousePos = { x: 0, y: 0 };
2441
2482
  touchStartPos = null;
2442
2483
  overlayContainer = null;
@@ -2461,7 +2502,7 @@ class Hi {
2461
2502
  * KeyboardTargetingController owns Tab/Arrow/Enter/Space/Escape.
2462
2503
  */
2463
2504
  startKeyboard(t) {
2464
- this.host.setState("TARGETING"), this.host.feedbackData.feedbackType = t, this.host.feedbackData.elementSelector = null, this.host.feedbackData.elementText = null, this.host.selectedBounds.visible = !1, document.body.style.setProperty("--qaid-positive", this.host.cssVars["--qaid-positive"]), document.body.style.setProperty("--qaid-negative", this.host.cssVars["--qaid-negative"]), this.createTargetingOverlay(), this.crosshairH && (this.crosshairH.style.display = "none"), this.crosshairV && (this.crosshairV.style.display = "none"), this.scope && (this.scope.style.display = "none"), this.keyboardController = Pi({
2505
+ this.host.setState("TARGETING"), this.host.feedbackData.feedbackType = t, this.host.feedbackData.elementSelector = null, this.host.feedbackData.elementText = null, this.host.selectedBounds.visible = !1, document.body.style.setProperty("--qaid-positive", this.host.cssVars["--qaid-positive"]), document.body.style.setProperty("--qaid-negative", this.host.cssVars["--qaid-negative"]), this.createTargetingOverlay(), this.crosshairH && (this.crosshairH.style.display = "none"), this.crosshairV && (this.crosshairV.style.display = "none"), this.scope && (this.scope.style.display = "none"), this.keyboardController = $i({
2465
2506
  isExcluded: (e) => M(e),
2466
2507
  onHighlight: (e) => {
2467
2508
  const o = e.getBoundingClientRect(), n = this.highlightBox;
@@ -2474,7 +2515,7 @@ class Hi {
2474
2515
  });
2475
2516
  }
2476
2517
  selectKeyboardTarget(t) {
2477
- const e = Z(t, 8);
2518
+ const e = ot(t, 8);
2478
2519
  Object.assign(this.host.selectedBounds, e, {
2479
2520
  clickX: e.x + e.width / 2,
2480
2521
  clickY: e.y + e.height / 2,
@@ -2499,7 +2540,7 @@ class Hi {
2499
2540
  /** Move the crosshair/scope reticle and highlight the element under (x, y). */
2500
2541
  updateReticleAt(t, e) {
2501
2542
  if (this.mousePos.x = t, this.mousePos.y = e, this.crosshairH && (this.crosshairH.style.top = `${e}px`), this.crosshairV && (this.crosshairV.style.left = `${t}px`), this.scope && (this.scope.style.left = `${t}px`, this.scope.style.top = `${e}px`), this.captureLayer && this.host.shadowHost) {
2502
- const o = [this.host.shadowHost, this.host.overlayShadowHost].filter(Boolean), n = J(t, e, o);
2543
+ const o = [this.host.shadowHost, this.host.overlayShadowHost].filter(Boolean), n = it(t, e, o);
2503
2544
  if (n && !M(n)) {
2504
2545
  if (this.highlightBox) {
2505
2546
  const s = n.getBoundingClientRect();
@@ -2518,14 +2559,14 @@ class Hi {
2518
2559
  }
2519
2560
  handleTouchEnd(t) {
2520
2561
  const e = t.changedTouches[0], o = this.touchStartPos;
2521
- this.touchStartPos = null, !(!e || !o || Math.hypot(e.clientX - o.x, e.clientY - o.y) > Bi) && (t.preventDefault(), this.selectAt(e.clientX, e.clientY));
2562
+ this.touchStartPos = null, !(!e || !o || Math.hypot(e.clientX - o.x, e.clientY - o.y) > zi) && (t.preventDefault(), this.selectAt(e.clientX, e.clientY));
2522
2563
  }
2523
2564
  /** Select the element under (x, y) and tear down targeting. */
2524
2565
  selectAt(t, e) {
2525
- const o = [this.host.shadowHost, this.host.overlayShadowHost].filter(Boolean), n = J(t, e, o);
2566
+ const o = [this.host.shadowHost, this.host.overlayShadowHost].filter(Boolean), n = it(t, e, o);
2526
2567
  if (!n || M(n))
2527
2568
  return;
2528
- const s = Z(n, 8);
2569
+ const s = ot(n, 8);
2529
2570
  Object.assign(this.host.selectedBounds, s, { clickX: t, clickY: e, visible: !0 });
2530
2571
  const { selector: a, text: c } = F(n);
2531
2572
  this.host.feedbackData.elementSelector = a, this.host.feedbackData.elementText = c, this.stopTargetingListeners(), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.host.setState("SELECTED"), this.host.clearActiveThumb(), this.showSelectedMarker(), this.host.submitFeedback();
@@ -2551,22 +2592,22 @@ class Hi {
2551
2592
  this.keyboardController?.stop(), this.keyboardController = null, this.stopTargetingListeners(), this.hideMarker();
2552
2593
  }
2553
2594
  }
2554
- const ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2595
+ const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2555
2596
  __proto__: null,
2556
- TargetingController: Hi
2597
+ TargetingController: _i
2557
2598
  }, Symbol.toStringTag, { value: "Module" }));
2558
2599
  export {
2559
- qt as AnnotationEditor,
2560
- _e as QaidFeedback,
2561
- ri as captureDomScreenshot,
2562
- Ke as captureNetworkErrors,
2563
- xt as compositeAnnotations,
2564
- ii as createVideoRecorder,
2600
+ At as AnnotationEditor,
2601
+ Ue as QaidFeedback,
2602
+ hi as captureDomScreenshot,
2603
+ Qe as captureNetworkErrors,
2604
+ Tt as compositeAnnotations,
2605
+ ai as createVideoRecorder,
2565
2606
  B as drawShape,
2566
- yt as getSupportedMimeType,
2567
- si as isDomScreenshotSupported,
2568
- ei as isVideoRecordingSupported,
2569
- wi as openAnnotationEditor,
2607
+ Ct as getSupportedMimeType,
2608
+ ci as isDomScreenshotSupported,
2609
+ si as isVideoRecordingSupported,
2610
+ Ci as openAnnotationEditor,
2570
2611
  P as rectFromPoints
2571
2612
  };
2572
2613
  //# sourceMappingURL=index.js.map