@qaiddev/thumbs-embed 1.0.6 → 1.0.7

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/qaid.js CHANGED
@@ -1,291 +1,313 @@
1
- var Z = Object.defineProperty;
2
- var Q = (i, t, e) => t in i ? Z(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var h = (i, t, e) => Q(i, typeof t != "symbol" ? t + "" : t, e);
1
+ var tt = Object.defineProperty;
2
+ var et = (e, t, o) => t in e ? tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var h = (e, t, o) => et(e, typeof t != "symbol" ? t + "" : t, o);
4
4
  const T = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
5
5
  <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"/>
6
- </svg>`, S = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
6
+ </svg>`, I = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
7
7
  <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"/>
8
- </svg>`, tt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
8
+ </svg>`, it = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
9
9
  <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"/>
10
- </svg>`, et = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}.qaid-widget,.qaid-widget *,.qaid-modal-container,.qaid-modal-container *{cursor:pointer!important}.qaid-widget.qaid-auto-container{position:fixed;z-index:50;display:flex;gap:.5rem}.qaid-widget.qaid-auto-container.qaid-bottom-right{bottom:1rem;right:1rem}.qaid-widget.qaid-auto-container.qaid-bottom-left{bottom:1rem;left:1rem}.qaid-widget.qaid-auto-container.qaid-top-right{top:1rem;right:1rem}.qaid-widget.qaid-auto-container.qaid-top-left{top:1rem;left:1rem}.qaid-widget.qaid-incognito{opacity:0;transition:opacity .2s ease-in-out}.qaid-widget.qaid-incognito:hover{opacity:1}button.qaid-btn-structural{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-appearance:none;-moz-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-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;top:0;right:0;bottom:0;left:0;z-index:40;pointer-events:none}.qaid-capture-layer{position:fixed;top:0;right:0;bottom:0;left:0;cursor:crosshair;pointer-events:auto;z-index:9999}.qaid-banner{position:fixed;top:0;left:0;right:0;padding:.75rem 1rem;text-align:center;z-index:10000;font-family:var(--qaid-font-family, system-ui, -apple-system, sans-serif);font-size:var(--qaid-font-size, 16px);animation:qaid-slideDown .2s ease-out}.qaid-banner-up{background:color-mix(in srgb,var(--qaid-positive) 90%,transparent);color:#fff}.qaid-banner-down{background:color-mix(in srgb,var(--qaid-negative) 90%,transparent);color:#fff}.qaid-banner-text{font-weight:500}.qaid-banner-hint{margin-left:.5rem;opacity:.75}@keyframes qaid-slideDown{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.qaid-vignette{position:fixed;top:0;right:0;bottom:0;left: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-scope{position:fixed;width:80px;height:80px;pointer-events:none;z-index:43;transform:translate(-50%,-50%)}.qaid-scope-ring{position:absolute;top:10px;right:10px;bottom:10px;left: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;top:20px;right:20px;bottom:20px;left: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-highlight{outline:3px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent)!important;outline-offset:2px!important;background-color:color-mix(in srgb,var(--qaid-negative) 10%,transparent)!important;transition:outline .1s ease,background-color .1s ease}body.qaid-targeting.qaid-type-up .qaid-highlight{outline-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent)!important;background-color:color-mix(in srgb,var(--qaid-positive) 10%,transparent)!important}.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;top:0;right:0;bottom:0;left: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;-moz-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-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;-moz-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;-moz-appearance:none;appearance:none}button.qaid-recording-stop:hover{background:#b91c1c}.qaid-video-preview{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;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:calc(100vw - 32px);max-height:calc(100vh - 32px);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%;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;-moz-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)}";
11
- let L = !1;
12
- const it = {
10
+ </svg>`, ot = ".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}button.qaid-btn-structural{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-appearance:none;-moz-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;top:0;right:0;bottom:0;left:0;z-index:40;pointer-events:none}.qaid-capture-layer{position:fixed;top:0;right:0;bottom:0;left:0;cursor:crosshair;pointer-events:auto;z-index:9999}@keyframes qaid-slideDown{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.qaid-vignette{position:fixed;top:0;right:0;bottom:0;left: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-scope{position:fixed;width:80px;height:80px;pointer-events:none;z-index:43;transform:translate(-50%,-50%)}.qaid-scope-ring{position:absolute;top:10px;right:10px;bottom:10px;left: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;top:20px;right:20px;bottom:20px;left: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;top:0;right:0;bottom:0;left: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;-moz-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-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;-moz-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;-moz-appearance:none;appearance:none}button.qaid-recording-stop:hover{background:#b91c1c}.qaid-video-preview{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;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:calc(100vw - 32px);max-height:calc(100vh - 32px);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%;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;-moz-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)}", nt = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}.qaid-highlight{outline:3px solid color-mix(in srgb,var(--qaid-negative) 80%,transparent)!important;outline-offset:2px!important;box-shadow:inset 0 0 0 9999px color-mix(in srgb,var(--qaid-negative) 8%,transparent)!important;transition:outline .1s ease!important}body.qaid-targeting.qaid-type-up .qaid-highlight{outline-color:color-mix(in srgb,var(--qaid-positive) 80%,transparent)!important;box-shadow:inset 0 0 0 9999px color-mix(in srgb,var(--qaid-positive) 8%,transparent)!important}";
11
+ let q = 0;
12
+ const at = "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 svg{width:var(--qaid-icon-size);height:var(--qaid-icon-size)}", st = {
13
13
  small: 36,
14
14
  medium: 48,
15
15
  large: 64
16
- }, ot = {
16
+ }, rt = {
17
17
  small: 18,
18
18
  medium: 24,
19
19
  large: 32
20
20
  };
21
- function nt(i, t, e) {
22
- const [o, n, a] = [i, t, e].map((r) => (r = r / 255, r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4)));
23
- return 0.2126 * o + 0.7152 * n + 0.0722 * a;
21
+ function dt(e, t, o) {
22
+ const [i, n, a] = [e, t, o].map((s) => (s = s / 255, s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4)));
23
+ return 0.2126 * i + 0.7152 * n + 0.0722 * a;
24
24
  }
25
- function at(i) {
26
- if (i.startsWith("#")) {
27
- const e = i.slice(1), o = e.length === 3 ? e.split("").map((a) => a + a).join("") : e, n = parseInt(o, 16);
25
+ function ct(e) {
26
+ if (e.startsWith("#")) {
27
+ const o = e.slice(1), i = o.length === 3 ? o.split("").map((a) => a + a).join("") : o, n = parseInt(i, 16);
28
28
  return {
29
29
  r: n >> 16 & 255,
30
30
  g: n >> 8 & 255,
31
31
  b: n & 255
32
32
  };
33
33
  }
34
- const t = i.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
34
+ const t = e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
35
35
  return t ? {
36
36
  r: parseInt(t[1]),
37
37
  g: parseInt(t[2]),
38
38
  b: parseInt(t[3])
39
39
  } : null;
40
40
  }
41
- function rt(i) {
42
- const t = at(i);
43
- return t && nt(t.r, t.g, t.b) > 0.4 ? "black" : "white";
41
+ function lt(e) {
42
+ const t = ct(e);
43
+ return t && dt(t.r, t.g, t.b) > 0.4 ? "black" : "white";
44
44
  }
45
- function st(i = {}) {
46
- if (L) return;
47
- L = !0;
45
+ function ht(e = {}) {
48
46
  const {
49
47
  positiveColor: t = "rgb(0, 200, 83)",
50
- negativeColor: e = "rgb(255, 0, 0)",
51
- markerColor: o = "#6366f1",
52
- // skipButtonStyles kept for backwards compatibility but no longer used
48
+ negativeColor: o = "rgb(255, 0, 0)",
49
+ markerColor: i = "#6366f1",
53
50
  buttonSize: n = "medium",
54
51
  modalWidth: a = 400,
55
- backdropOpacity: r = 0.3,
52
+ backdropOpacity: s = 0.3,
56
53
  fontFamily: l = "system-ui, -apple-system, sans-serif",
57
54
  fontSize: d = 16
58
- } = i, s = it[n], c = ot[n], p = rt(o), u = `:root{--qaid-positive:${t};--qaid-negative:${e};--qaid-marker:${o};--qaid-marker-text:${p};--qaid-btn-size:${s}px;--qaid-icon-size:${c}px;--qaid-modal-width:${a}px;--qaid-backdrop-opacity:${r};--qaid-font-family:${l};--qaid-font-size:${d}px}`, f = "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}button.qaid-btn:hover{transform:scale(1.05)}button.qaid-btn-up:hover{background:var(--qaid-positive);color:#fff}button.qaid-btn-down:hover{background:var(--qaid-negative);color:#fff}button.qaid-btn svg{width:var(--qaid-icon-size);height:var(--qaid-icon-size)}", g = document.createElement("style");
59
- g.id = "qaid-styles", g.textContent = u + et + f, document.head.appendChild(g);
55
+ } = e, r = st[n], c = rt[n], u = lt(i);
56
+ return {
57
+ "--qaid-positive": t,
58
+ "--qaid-negative": o,
59
+ "--qaid-marker": i,
60
+ "--qaid-marker-text": u,
61
+ "--qaid-btn-size": `${r}px`,
62
+ "--qaid-icon-size": `${c}px`,
63
+ "--qaid-modal-width": `${a}px`,
64
+ "--qaid-backdrop-opacity": String(s),
65
+ "--qaid-font-family": l,
66
+ "--qaid-font-size": `${d}px`
67
+ };
68
+ }
69
+ function ut(e, t) {
70
+ for (const [o, i] of Object.entries(t))
71
+ e.style.setProperty(o, i);
60
72
  }
61
- function dt() {
62
- const i = document.getElementById("qaid-styles");
63
- i && (i.remove(), L = !1);
73
+ function A() {
74
+ return ot + at;
75
+ }
76
+ function pt() {
77
+ if (q++, q > 1) return;
78
+ const e = document.createElement("style");
79
+ e.id = "qaid-styles", e.textContent = nt, document.head.appendChild(e);
80
+ }
81
+ function mt() {
82
+ if (!(q <= 0) && (q--, q === 0)) {
83
+ const e = document.getElementById("qaid-styles");
84
+ e && e.remove();
85
+ }
64
86
  }
65
- const ct = ["data-comp", "data-qa", "data-testid", "data-id"];
66
- function W(i, t = document.body) {
67
- let e = i;
68
- for (; e && e !== t; ) {
69
- for (const o of ct) {
70
- const n = e.getAttribute(o);
87
+ const ft = ["data-comp", "data-qa", "data-testid", "data-id"];
88
+ function F(e, t = document.body) {
89
+ let o = e;
90
+ for (; o && o !== t; ) {
91
+ for (const i of ft) {
92
+ const n = o.getAttribute(i);
71
93
  if (n)
72
- return `${o}="${n}"`;
94
+ return `${i}="${n}"`;
73
95
  }
74
- e = e.parentElement;
96
+ o = o.parentElement;
75
97
  }
76
98
  return null;
77
99
  }
78
- function lt(i, t = 100) {
79
- var o;
80
- const e = ((o = i.textContent) == null ? void 0 : o.trim().slice(0, t)) || "";
81
- return e.length === t ? e + "..." : e;
100
+ function gt(e, t = 100) {
101
+ var i;
102
+ const o = ((i = e.textContent) == null ? void 0 : i.trim().slice(0, t)) || "";
103
+ return o.length === t ? o + "..." : o;
82
104
  }
83
- function ht(i) {
84
- let t = 1, e = i.previousElementSibling;
85
- for (; e; )
86
- t++, e = e.previousElementSibling;
105
+ function bt(e) {
106
+ let t = 1, o = e.previousElementSibling;
107
+ for (; o; )
108
+ t++, o = o.previousElementSibling;
87
109
  return t;
88
110
  }
89
- function ut(i) {
111
+ function vt(e) {
90
112
  const t = [];
91
- let e = i;
92
- for (; e && e !== document.body && e !== document.documentElement; ) {
93
- const o = e.tagName.toLowerCase(), n = ht(e);
94
- t.unshift(`${o}:nth-child(${n})`), e = e.parentElement;
113
+ let o = e;
114
+ for (; o && o !== document.body && o !== document.documentElement; ) {
115
+ const i = o.tagName.toLowerCase(), n = bt(o);
116
+ t.unshift(`${i}:nth-child(${n})`), o = o.parentElement;
95
117
  }
96
118
  return t.length > 0 ? `body > ${t.join(" > ")}` : "body";
97
119
  }
98
- function pt(i) {
99
- return i.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
120
+ function yt(e) {
121
+ return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
100
122
  }
101
- function mt(i) {
102
- const t = W(i);
103
- return t ? `[${t}]` : i.id ? `#${pt(i.id)}` : ut(i);
123
+ function wt(e) {
124
+ const t = F(e);
125
+ return t ? `[${t}]` : e.id ? `#${yt(e.id)}` : vt(e);
104
126
  }
105
- function ft(i) {
106
- const t = lt(i), e = W(i);
107
- return { selector: mt(i), text: t, dataAttr: e };
127
+ function qt(e) {
128
+ const t = gt(e), o = F(e);
129
+ return { selector: wt(e), text: t, dataAttr: o };
108
130
  }
109
- const U = {
131
+ const W = {
110
132
  width: 400,
111
133
  height: 280,
112
134
  arrowHeight: 12,
113
135
  gap: 8,
114
136
  viewportPadding: 16
115
137
  };
116
- function gt(i, t, e, o, n) {
117
- const a = i.y, r = t - (i.y + i.height);
118
- if (r >= e + o)
138
+ function xt(e, t, o, i, n) {
139
+ const a = e.y, s = t - (e.y + e.height);
140
+ if (s >= o + i)
119
141
  return {
120
- top: i.y + i.height + o,
142
+ top: e.y + e.height + i,
121
143
  position: "below"
122
144
  };
123
- if (a >= e + o)
145
+ if (a >= o + i)
124
146
  return {
125
- top: i.y - e - o,
147
+ top: e.y - o - i,
126
148
  position: "above"
127
149
  };
128
- const l = r > a ? "below" : "above";
150
+ const l = s > a ? "below" : "above";
129
151
  let d;
130
152
  return l === "below" ? d = Math.min(
131
- i.y + i.height + o,
132
- t - e - n
133
- ) : d = Math.max(n, i.y - e - o), { top: d, position: l };
153
+ e.y + e.height + i,
154
+ t - o - n
155
+ ) : d = Math.max(n, e.y - o - i), { top: d, position: l };
134
156
  }
135
- function bt(i, t, e, o) {
136
- let a = i.x + i.width / 2 - e / 2;
137
- return a = Math.max(o, Math.min(a, t - e - o)), a;
157
+ function kt(e, t, o, i) {
158
+ let a = e.x + e.width / 2 - o / 2;
159
+ return a = Math.max(i, Math.min(a, t - o - i)), a;
138
160
  }
139
- function vt(i, t, e, o = 24, n = 24) {
140
- const r = i.clickX - t - n / 2;
141
- return Math.max(o, Math.min(r, e - o - n / 2));
161
+ function Ct(e, t, o, i = 24, n = 24) {
162
+ const s = e.clickX - t - n / 2;
163
+ return Math.max(i, Math.min(s, o - i - n / 2));
142
164
  }
143
- function yt(i, t, e, o = U) {
144
- const n = o.height + o.arrowHeight, a = gt(
145
- i,
165
+ function St(e, t, o, i = W) {
166
+ const n = i.height + i.arrowHeight, a = xt(
146
167
  e,
168
+ o,
147
169
  n,
148
- o.gap,
149
- o.viewportPadding
150
- ), r = bt(
151
- i,
170
+ i.gap,
171
+ i.viewportPadding
172
+ ), s = kt(
173
+ e,
152
174
  t,
153
- o.width,
154
- o.viewportPadding
175
+ i.width,
176
+ i.viewportPadding
155
177
  );
156
178
  return {
157
179
  top: a.top,
158
- left: r,
180
+ left: s,
159
181
  position: a.position
160
182
  };
161
183
  }
162
- function wt(i, t, e, o = U) {
163
- const n = yt(i, t, e, o), a = vt(
164
- i,
184
+ function Et(e, t, o, i = W) {
185
+ const n = St(e, t, o, i), a = Ct(
186
+ e,
165
187
  n.left,
166
- o.width
188
+ i.width
167
189
  );
168
190
  return {
169
191
  modal: n,
170
192
  arrow: { left: a }
171
193
  };
172
194
  }
173
- const qt = 20;
174
- function xt(i) {
175
- const t = [], e = console.error, o = console.warn, n = console.log, a = (r, l) => {
195
+ const Tt = 20;
196
+ function It(e) {
197
+ const t = [], o = console.error, i = console.warn, n = console.log, a = (s, l) => {
176
198
  const d = {
177
- message: l.map((s) => String(s)).join(" "),
199
+ message: l.map((r) => String(r)).join(" "),
178
200
  timestamp: Date.now(),
179
- level: r
201
+ level: s
180
202
  };
181
- t.length >= qt && t.shift(), t.push(d), i && i(d);
203
+ t.length >= Tt && t.shift(), t.push(d), e && e(d);
182
204
  };
183
- return console.error = function(...r) {
184
- a("error", r), e.apply(console, r);
185
- }, console.warn = function(...r) {
186
- a("warn", r), o.apply(console, r);
187
- }, console.log = function(...r) {
188
- a("log", r), n.apply(console, r);
205
+ return console.error = function(...s) {
206
+ a("error", s), o.apply(console, s);
207
+ }, console.warn = function(...s) {
208
+ a("warn", s), i.apply(console, s);
209
+ }, console.log = function(...s) {
210
+ a("log", s), n.apply(console, s);
189
211
  }, {
190
212
  errors: t,
191
213
  restore: () => {
192
- console.error = e, console.warn = o, console.log = n;
214
+ console.error = o, console.warn = i, console.log = n;
193
215
  }
194
216
  };
195
217
  }
196
- const kt = 20, P = 4096;
197
- function x(i) {
198
- if (i == null) return;
199
- const t = typeof i == "string" ? i : JSON.stringify(i);
200
- return t.length > P ? t.slice(0, P) + "…[truncated]" : t;
218
+ const Lt = 20, O = 4096;
219
+ function k(e) {
220
+ if (e == null) return;
221
+ const t = typeof e == "string" ? e : JSON.stringify(e);
222
+ return t.length > O ? t.slice(0, O) + "…[truncated]" : t;
201
223
  }
202
- function H(i, t) {
203
- i.length >= kt && i.shift(), i.push(t);
224
+ function P(e, t) {
225
+ e.length >= Lt && e.shift(), e.push(t);
204
226
  }
205
- async function Ct(i) {
227
+ async function Ht(e) {
206
228
  try {
207
- const t = await i.clone().text();
208
- return x(t);
229
+ const t = await e.clone().text();
230
+ return k(t);
209
231
  } catch {
210
232
  return;
211
233
  }
212
234
  }
213
- function Et() {
214
- const i = [], t = window.fetch;
235
+ function Rt() {
236
+ const e = [], t = window.fetch;
215
237
  window.fetch = async function(n, a) {
216
- const r = typeof n == "string" ? n : n instanceof URL ? n.toString() : n.url, l = (a == null ? void 0 : a.method) ?? (typeof n == "object" && "method" in n ? n.method : "GET");
238
+ const s = typeof n == "string" ? n : n instanceof URL ? n.toString() : n.url, l = (a == null ? void 0 : a.method) ?? (typeof n == "object" && "method" in n ? n.method : "GET");
217
239
  let d;
218
- a != null && a.body && (d = x(a.body));
219
- const s = await t.apply(window, [n, a]);
220
- if (s.status >= 400) {
221
- const c = await Ct(s);
222
- H(i, {
223
- url: r,
240
+ a != null && a.body && (d = k(a.body));
241
+ const r = await t.apply(window, [n, a]);
242
+ if (r.status >= 400) {
243
+ const c = await Ht(r);
244
+ P(e, {
245
+ url: s,
224
246
  method: l.toUpperCase(),
225
- status: s.status,
226
- statusText: s.statusText,
247
+ status: r.status,
248
+ statusText: r.statusText,
227
249
  requestBody: d,
228
250
  responseBody: c,
229
251
  timestamp: Date.now()
230
252
  });
231
253
  }
232
- return s;
254
+ return r;
233
255
  };
234
- const e = XMLHttpRequest.prototype.open, o = XMLHttpRequest.prototype.send;
235
- return XMLHttpRequest.prototype.open = function(n, a, ...r) {
236
- return this._qaid_method = n, this._qaid_url = typeof a == "string" ? a : a.toString(), e.apply(this, [n, a, ...r]);
256
+ const o = XMLHttpRequest.prototype.open, i = XMLHttpRequest.prototype.send;
257
+ return XMLHttpRequest.prototype.open = function(n, a, ...s) {
258
+ return this._qaid_method = n, this._qaid_url = typeof a == "string" ? a : a.toString(), o.apply(this, [n, a, ...s]);
237
259
  }, XMLHttpRequest.prototype.send = function(n) {
238
- const a = this, r = n ? x(n) : void 0;
260
+ const a = this, s = n ? k(n) : void 0;
239
261
  return a.addEventListener("load", function() {
240
- a.status >= 400 && H(i, {
262
+ a.status >= 400 && P(e, {
241
263
  url: a._qaid_url,
242
264
  method: a._qaid_method.toUpperCase(),
243
265
  status: a.status,
244
266
  statusText: a.statusText,
245
- requestBody: r,
246
- responseBody: x(a.responseText),
267
+ requestBody: s,
268
+ responseBody: k(a.responseText),
247
269
  timestamp: Date.now()
248
270
  });
249
- }), o.apply(this, [n]);
271
+ }), i.apply(this, [n]);
250
272
  }, {
251
- errors: i,
273
+ errors: e,
252
274
  restore: () => {
253
- window.fetch = t, XMLHttpRequest.prototype.open = e, XMLHttpRequest.prototype.send = o;
275
+ window.fetch = t, XMLHttpRequest.prototype.open = o, XMLHttpRequest.prototype.send = i;
254
276
  }
255
277
  };
256
278
  }
257
- function Tt() {
279
+ function Dt() {
258
280
  return typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function" && typeof MediaRecorder < "u";
259
281
  }
260
- function St() {
282
+ function Mt() {
261
283
  if (typeof MediaRecorder > "u") return "";
262
- const i = [
284
+ const e = [
263
285
  "video/webm;codecs=vp9",
264
286
  "video/webm;codecs=vp8",
265
287
  "video/webm",
266
288
  "video/mp4"
267
289
  ];
268
- for (const t of i)
290
+ for (const t of e)
269
291
  if (MediaRecorder.isTypeSupported(t))
270
292
  return t;
271
293
  return "";
272
294
  }
273
- function It(i = {}) {
274
- const t = i.maxDuration ?? 15, e = i.videoBitsPerSecond ?? 8e5;
275
- let o = null, n = null, a = [], r = null, l = null, d = null, s = 0, c = null, p = null, u = !1, f = null;
276
- function g() {
277
- d !== null && (clearInterval(d), d = null), f !== null && (clearTimeout(f), f = null), o && (o.getTracks().forEach((m) => m.stop()), o = null), n = null, a = [], r = null, l = null, c = null, p = null;
278
- }
295
+ function zt(e = {}) {
296
+ const t = e.maxDuration ?? 15, o = e.videoBitsPerSecond ?? 8e5;
297
+ let i = null, n = null, a = [], s = null, l = null, d = null, r = 0, c = null, u = null, p = !1, f = null;
279
298
  function b() {
280
- u || (u = !0, n && n.state !== "inactive" && n.stop());
299
+ d !== null && (clearInterval(d), d = null), f !== null && (clearTimeout(f), f = null), i && (i.getTracks().forEach((m) => m.stop()), i = null), n = null, a = [], s = null, l = null, c = null, u = null;
300
+ }
301
+ function g() {
302
+ p || (p = !0, n && n.state !== "inactive" && n.stop());
281
303
  }
282
304
  return {
283
305
  async start() {
284
- u = !1, a = [];
285
- const m = St();
306
+ p = !1, a = [];
307
+ const m = Mt();
286
308
  if (!m)
287
309
  throw new Error("No supported video MIME type found");
288
- o = await navigator.mediaDevices.getDisplayMedia({
310
+ i = await navigator.mediaDevices.getDisplayMedia({
289
311
  video: {
290
312
  frameRate: 15
291
313
  },
@@ -293,71 +315,71 @@ function It(i = {}) {
293
315
  // @ts-expect-error preferCurrentTab is not in the TS types yet
294
316
  preferCurrentTab: !0
295
317
  });
296
- const v = o.getVideoTracks()[0];
318
+ const v = i.getVideoTracks()[0];
297
319
  v && v.addEventListener("ended", () => {
298
- b();
299
- }), n = new MediaRecorder(o, {
320
+ g();
321
+ }), n = new MediaRecorder(i, {
300
322
  mimeType: m,
301
- videoBitsPerSecond: e
323
+ videoBitsPerSecond: o
302
324
  }), n.ondataavailable = (y) => {
303
325
  y.data.size > 0 && a.push(y.data);
304
326
  }, n.onstop = () => {
305
327
  const y = new Blob(a, { type: m });
306
- c && c(y), l && l(y), o && o.getTracks().forEach((q) => q.stop());
328
+ c && c(y), l && l(y), i && i.getTracks().forEach((x) => x.stop());
307
329
  }, n.onerror = () => {
308
- p && p(new Error("MediaRecorder error"));
309
- }, n.start(1e3), s = Date.now(), d = setInterval(() => {
310
- const y = Math.floor((Date.now() - s) / 1e3);
311
- r && r(y);
330
+ u && u(new Error("MediaRecorder error"));
331
+ }, n.start(1e3), r = Date.now(), d = setInterval(() => {
332
+ const y = Math.floor((Date.now() - r) / 1e3);
333
+ s && s(y);
312
334
  }, 1e3), f = setTimeout(() => {
313
- b();
335
+ g();
314
336
  }, t * 1e3);
315
337
  },
316
338
  stop() {
317
339
  return new Promise((m, v) => {
318
- c = m, p = v, b();
340
+ c = m, u = v, g();
319
341
  });
320
342
  },
321
343
  onTick(m) {
322
- r = m;
344
+ s = m;
323
345
  },
324
346
  onStop(m) {
325
347
  l = m;
326
348
  },
327
349
  destroy() {
328
- b(), g();
350
+ g(), b();
329
351
  }
330
352
  };
331
353
  }
332
- function Lt(i = 640) {
333
- return typeof window < "u" && window.innerWidth < i;
354
+ function Bt(e = 640) {
355
+ return typeof window < "u" && window.innerWidth < e;
334
356
  }
335
- function O(i, t, e) {
336
- const o = e.style.pointerEvents;
337
- e.style.pointerEvents = "none";
338
- const n = document.elementFromPoint(i, t);
339
- return e.style.pointerEvents = o, n;
357
+ function $(e, t, o) {
358
+ const i = o.map((a) => a.style.visibility);
359
+ o.forEach((a) => a.style.visibility = "hidden");
360
+ const n = document.elementFromPoint(e, t);
361
+ return o.forEach((a, s) => a.style.visibility = i[s]), n;
340
362
  }
341
- function N(i) {
342
- return i ? !!(i.closest(".qaid-widget") || i.closest(".qaid-targeting-overlay") || i.closest(".qaid-modal-container") || i.closest(".qaid-bottom-sheet")) : !1;
363
+ function N(e) {
364
+ return e ? e.hasAttribute("data-qaid-embed") || e.hasAttribute("data-qaid-embed-overlay") ? !0 : !!e.closest("[data-qaid-embed], [data-qaid-embed-overlay]") : !1;
343
365
  }
344
- function Mt(i, t = 0) {
345
- const e = i.getBoundingClientRect();
366
+ function At(e, t = 0) {
367
+ const o = e.getBoundingClientRect();
346
368
  return {
347
- x: e.left - t,
348
- y: e.top - t,
349
- width: e.width + t * 2,
350
- height: e.height + t * 2
369
+ x: o.left - t,
370
+ y: o.top - t,
371
+ width: o.width + t * 2,
372
+ height: o.height + t * 2
351
373
  };
352
374
  }
353
- function I(i) {
354
- document.querySelectorAll(`.${i}`).forEach((t) => {
355
- t.classList.remove(i);
375
+ function L(e) {
376
+ document.querySelectorAll(`.${e}`).forEach((t) => {
377
+ t.classList.remove(e);
356
378
  });
357
379
  }
358
- async function Dt(i = {}) {
380
+ async function Ot(e = {}) {
359
381
  var n;
360
- const { quality: t = 1, maxWidth: e = 1280, maxHeight: o = 800 } = i;
382
+ const { quality: t = 1, maxWidth: o = 1280, maxHeight: i = 800 } = e;
361
383
  try {
362
384
  if (!((n = navigator.mediaDevices) != null && n.getDisplayMedia))
363
385
  return console.warn("Screen Capture API not available"), null;
@@ -366,7 +388,7 @@ async function Dt(i = {}) {
366
388
  video: {
367
389
  displaySurface: "browser"
368
390
  }
369
- }), r = a.getVideoTracks()[0], l = r.getSettings(), d = document.createElement("video");
391
+ }), s = a.getVideoTracks()[0], l = s.getSettings(), d = document.createElement("video");
370
392
  d.srcObject = a, d.muted = !0, await new Promise((m) => {
371
393
  d.onloadedmetadata = () => {
372
394
  d.play(), m();
@@ -377,48 +399,48 @@ async function Dt(i = {}) {
377
399
  };
378
400
  v();
379
401
  }), await new Promise((m) => setTimeout(m, 100));
380
- const s = l.width || d.videoWidth, c = l.height || d.videoHeight, p = Math.min(e / s, o / c, 1), u = Math.round(s * p), f = Math.round(c * p), g = document.createElement("canvas");
381
- g.width = u, g.height = f;
382
- const b = g.getContext("2d");
383
- return b ? (b.drawImage(d, 0, 0, u, f), r.stop(), g.toDataURL("image/webp", t)) : (r.stop(), null);
402
+ const r = l.width || d.videoWidth, c = l.height || d.videoHeight, u = Math.min(o / r, i / c, 1), p = Math.round(r * u), f = Math.round(c * u), b = document.createElement("canvas");
403
+ b.width = p, b.height = f;
404
+ const g = b.getContext("2d");
405
+ return g ? (g.drawImage(d, 0, 0, p, f), s.stop(), b.toDataURL("image/webp", t)) : (s.stop(), null);
384
406
  } catch (a) {
385
407
  return console.warn("Screenshot capture failed:", a), null;
386
408
  }
387
409
  }
388
- const F = "https://qaid.dev/lib/html2canvas.min.js", zt = 1e4, Rt = 50;
410
+ const V = "https://qaid.dev/lib/html2canvas.min.js", Pt = 1e4, $t = 50;
389
411
  let w = null;
390
- function Ft() {
412
+ function jt() {
391
413
  if (typeof document > "u" || typeof window > "u")
392
414
  return !1;
393
- const i = document.createElement("canvas");
394
- return typeof i.getContext == "function" && !!i.getContext("2d");
415
+ const e = document.createElement("canvas");
416
+ return typeof e.getContext == "function" && !!e.getContext("2d");
395
417
  }
396
- function Bt() {
397
- return window.html2canvas ? Promise.resolve(!0) : w || (w = new Promise((i) => {
418
+ function Nt() {
419
+ return window.html2canvas ? Promise.resolve(!0) : w || (w = new Promise((e) => {
398
420
  if (!document.querySelector(
399
- `script[src="${F}"]`
421
+ `script[src="${V}"]`
400
422
  )) {
401
423
  const n = document.createElement("script");
402
- n.src = F, n.async = !0, document.head.appendChild(n);
424
+ n.src = V, n.async = !0, document.head.appendChild(n);
403
425
  }
404
- const e = Date.now(), o = () => {
426
+ const o = Date.now(), i = () => {
405
427
  if (window.html2canvas) {
406
- i(!0);
428
+ e(!0);
407
429
  return;
408
430
  }
409
- if (Date.now() - e > zt) {
410
- w = null, i(!1);
431
+ if (Date.now() - o > Pt) {
432
+ w = null, e(!1);
411
433
  return;
412
434
  }
413
- setTimeout(o, Rt);
435
+ setTimeout(i, $t);
414
436
  };
415
- o();
437
+ i();
416
438
  }), w);
417
439
  }
418
- async function At(i = {}) {
419
- const { quality: t = 0.8, maxWidth: e = 1280, maxHeight: o = 800 } = i;
440
+ async function Vt(e = {}) {
441
+ const { quality: t = 0.8, maxWidth: o = 1280, maxHeight: i = 800 } = e;
420
442
  try {
421
- if (!await Bt() || !window.html2canvas)
443
+ if (!await Nt() || !window.html2canvas)
422
444
  return console.warn("html2canvas failed to load"), null;
423
445
  const a = await window.html2canvas(document.body, {
424
446
  useCORS: !0,
@@ -430,32 +452,32 @@ async function At(i = {}) {
430
452
  height: document.documentElement.clientHeight,
431
453
  x: window.scrollX,
432
454
  y: window.scrollY,
433
- ignoreElements: (s) => {
434
- var c, p, u;
435
- return s instanceof HTMLElement ? s.classList.contains("qaid-widget") || s.classList.contains("qaid-targeting-overlay") || s.classList.contains("qaid-modal-container") || s.classList.contains("qaid-bottom-sheet") || s.classList.contains("qaid-backdrop") || s.classList.contains("qaid-selected-marker") || s.classList.contains("qaid-tooltip-text") || s.classList.contains("qaid-recording-indicator") || s.classList.contains("qaid-video-preview") || ((u = (c = s.className) == null ? void 0 : (p = c.toString()).startsWith) == null ? void 0 : u.call(p, "qaid-")) : !1;
455
+ ignoreElements: (r) => {
456
+ var c, u, p;
457
+ return r instanceof HTMLElement ? r.classList.contains("qaid-buttons") || r.classList.contains("qaid-targeting-overlay") || r.classList.contains("qaid-modal-container") || r.classList.contains("qaid-bottom-sheet") || r.classList.contains("qaid-backdrop") || r.classList.contains("qaid-selected-marker") || r.classList.contains("qaid-tooltip-text") || r.classList.contains("qaid-recording-indicator") || r.classList.contains("qaid-video-preview") || ((p = (c = r.className) == null ? void 0 : (u = c.toString()).startsWith) == null ? void 0 : p.call(u, "qaid-")) : !1;
436
458
  }
437
- }), r = a.width, l = a.height, d = Math.min(e / r, o / l, 1);
459
+ }), s = a.width, l = a.height, d = Math.min(o / s, i / l, 1);
438
460
  if (d < 1) {
439
- const s = Math.round(r * d), c = Math.round(l * d), p = document.createElement("canvas");
440
- p.width = s, p.height = c;
441
- const u = p.getContext("2d");
442
- return u ? (u.drawImage(a, 0, 0, s, c), p.toDataURL("image/webp", t)) : null;
461
+ const r = Math.round(s * d), c = Math.round(l * d), u = document.createElement("canvas");
462
+ u.width = r, u.height = c;
463
+ const p = u.getContext("2d");
464
+ return p ? (p.drawImage(a, 0, 0, r, c), u.toDataURL("image/webp", t)) : null;
443
465
  }
444
466
  return a.toDataURL("image/webp", t);
445
467
  } catch (n) {
446
468
  return console.warn("DOM screenshot capture failed:", n), null;
447
469
  }
448
470
  }
449
- const V = "qaid_visitor_id";
450
- function $t() {
471
+ const U = "qaid_visitor_id";
472
+ function Ut() {
451
473
  try {
452
- let i = localStorage.getItem(V);
453
- return i || (i = crypto.randomUUID(), localStorage.setItem(V, i)), i;
474
+ let e = localStorage.getItem(U);
475
+ return e || (e = crypto.randomUUID(), localStorage.setItem(U, e)), e;
454
476
  } catch {
455
477
  return crypto.randomUUID();
456
478
  }
457
479
  }
458
- class Pt {
480
+ class Ft {
459
481
  constructor(t) {
460
482
  h(this, "config");
461
483
  h(this, "state", "IDLE");
@@ -489,8 +511,14 @@ class Pt {
489
511
  h(this, "videoPreview", null);
490
512
  h(this, "isRecording", !1);
491
513
  h(this, "isSendingVideo", !1);
492
- // DOM elements
493
- h(this, "container", null);
514
+ // Shadow DOM
515
+ h(this, "shadowHost", null);
516
+ h(this, "shadowRoot", null);
517
+ // Overlay shadow DOM (always on document.body for full-page coverage)
518
+ h(this, "overlayShadowHost", null);
519
+ h(this, "overlayShadowRoot", null);
520
+ // DOM elements (inside shadow root)
521
+ h(this, "buttonsContainer", null);
494
522
  h(this, "isUserProvidedContainer", !1);
495
523
  h(this, "overlayContainer", null);
496
524
  h(this, "captureLayer", null);
@@ -500,40 +528,41 @@ class Pt {
500
528
  h(this, "marker", null);
501
529
  h(this, "modalContainer", null);
502
530
  h(this, "backdrop", null);
531
+ // Per-instance CSS variables
532
+ h(this, "cssVars", {});
503
533
  // Bound event handlers
504
534
  h(this, "boundKeyDown");
505
535
  h(this, "boundMouseMove");
506
536
  h(this, "boundClick");
507
537
  h(this, "boundResize");
508
538
  h(this, "tooltipElement", null);
509
- var e, o, n, a, r, l, d, s, c, p, u, f, g, b, m, v, y;
539
+ var o, i, n, a, s, l, d, r, c, u, p, f, b, g, m;
510
540
  this.config = {
511
541
  endpoint: t.endpoint,
512
542
  apiKey: t.apiKey ?? "",
513
543
  container: t.container ?? "",
514
544
  buttonClass: t.buttonClass ?? "",
545
+ direction: t.direction ?? "horizontal",
515
546
  position: t.position ?? "bottom-right",
516
547
  offset: {
517
- x: ((e = t.offset) == null ? void 0 : e.x) ?? 16,
518
- y: ((o = t.offset) == null ? void 0 : o.y) ?? 16
548
+ x: ((o = t.offset) == null ? void 0 : o.x) ?? 16,
549
+ y: ((i = t.offset) == null ? void 0 : i.y) ?? 16
519
550
  },
520
551
  zIndex: t.zIndex ?? 50,
521
552
  skipTargeting: t.skipTargeting ?? !1,
522
553
  colors: {
523
554
  positive: ((n = t.colors) == null ? void 0 : n.positive) ?? "rgb(0, 200, 83)",
524
555
  negative: ((a = t.colors) == null ? void 0 : a.negative) ?? "rgb(255, 0, 0)",
525
- marker: ((r = t.colors) == null ? void 0 : r.marker) ?? "#6366f1"
556
+ marker: ((s = t.colors) == null ? void 0 : s.marker) ?? "#6366f1"
526
557
  },
527
558
  buttonSize: t.buttonSize ?? "medium",
528
559
  text: {
529
560
  tooltip: ((l = t.text) == null ? void 0 : l.tooltip) ?? "",
530
- bannerText: ((d = t.text) == null ? void 0 : d.bannerText) ?? "Click on any element to target it with your feedback",
531
- bannerHint: ((s = t.text) == null ? void 0 : s.bannerHint) ?? "(Press Escape to cancel)",
532
- modalTitle: ((c = t.text) == null ? void 0 : c.modalTitle) ?? "Thank you for your feedback!",
533
- modalSubtitle: ((p = t.text) == null ? void 0 : p.modalSubtitle) ?? "Would you like to add a message to help us understand your feedback better?",
534
- placeholder: ((u = t.text) == null ? void 0 : u.placeholder) ?? "Optional: Tell us more about your experience...",
535
- submitButton: ((f = t.text) == null ? void 0 : f.submitButton) ?? "Submit",
536
- skipButton: ((g = t.text) == null ? void 0 : g.skipButton) ?? "Skip"
561
+ modalTitle: ((d = t.text) == null ? void 0 : d.modalTitle) ?? "Thank you for your feedback!",
562
+ modalSubtitle: ((r = t.text) == null ? void 0 : r.modalSubtitle) ?? "Would you like to add a message to help us understand your feedback better?",
563
+ placeholder: ((c = t.text) == null ? void 0 : c.placeholder) ?? "Optional: Tell us more about your experience...",
564
+ submitButton: ((u = t.text) == null ? void 0 : u.submitButton) ?? "Submit",
565
+ skipButton: ((p = t.text) == null ? void 0 : p.skipButton) ?? "Skip"
537
566
  },
538
567
  modalWidth: t.modalWidth ?? 400,
539
568
  backdropOpacity: t.backdropOpacity ?? 0.3,
@@ -542,159 +571,181 @@ class Pt {
542
571
  captureScreenshot: t.captureScreenshot ?? !1,
543
572
  screenshotMethod: t.screenshotMethod ?? "permission",
544
573
  screenshotOptions: {
545
- quality: ((b = t.screenshotOptions) == null ? void 0 : b.quality) ?? 0.8,
546
- maxWidth: ((m = t.screenshotOptions) == null ? void 0 : m.maxWidth) ?? 1280,
547
- maxHeight: ((v = t.screenshotOptions) == null ? void 0 : v.maxHeight) ?? 800
574
+ quality: ((f = t.screenshotOptions) == null ? void 0 : f.quality) ?? 0.8,
575
+ maxWidth: ((b = t.screenshotOptions) == null ? void 0 : b.maxWidth) ?? 1280,
576
+ maxHeight: ((g = t.screenshotOptions) == null ? void 0 : g.maxHeight) ?? 800
548
577
  },
549
578
  incognito: t.incognito ?? !1,
550
579
  positiveIcon: t.positiveIcon ?? "",
551
580
  negativeIcon: t.negativeIcon ?? "",
552
581
  hideThumbs: t.hideThumbs ?? !1,
582
+ css: t.css ?? "",
553
583
  captureVideo: t.captureVideo ?? !1,
554
584
  videoOptions: {
555
- maxDuration: ((y = t.videoOptions) == null ? void 0 : y.maxDuration) ?? 15
585
+ maxDuration: ((m = t.videoOptions) == null ? void 0 : m.maxDuration) ?? 15
556
586
  },
557
587
  recordIcon: t.recordIcon ?? ""
558
- }, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundMouseMove = this.handleMouseMove.bind(this), this.boundClick = this.handleClick.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = $t(), this.init();
588
+ }, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundMouseMove = this.handleMouseMove.bind(this), this.boundClick = this.handleClick.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = Ut(), this.init();
589
+ }
590
+ applyVars(t) {
591
+ ut(t, this.cssVars);
559
592
  }
560
593
  init() {
561
- st({
594
+ pt(), this.cssVars = ht({
562
595
  positiveColor: this.config.colors.positive,
563
596
  negativeColor: this.config.colors.negative,
564
597
  markerColor: this.config.colors.marker,
565
- skipButtonStyles: !!this.config.buttonClass,
566
598
  buttonSize: this.config.buttonSize,
567
599
  modalWidth: this.config.modalWidth,
568
600
  backdropOpacity: this.config.backdropOpacity,
569
601
  fontFamily: this.config.fontFamily,
570
602
  fontSize: this.config.fontSize
571
- }), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = xt((t) => {
572
- var e;
573
- this.feedbackData.consoleErrors = ((e = this.consoleCapture) == null ? void 0 : e.errors) ?? [];
603
+ }), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = It((t) => {
604
+ var o;
605
+ this.feedbackData.consoleErrors = ((o = this.consoleCapture) == null ? void 0 : o.errors) ?? [];
574
606
  }), this.feedbackData.consoleErrors = this.consoleCapture.errors;
575
607
  }
576
608
  checkMobile() {
577
- this.isMobile = Lt();
609
+ this.isMobile = Bt();
578
610
  }
579
611
  handleResize() {
580
612
  this.checkMobile();
581
613
  }
582
614
  createEmbed() {
615
+ this.shadowHost = document.createElement("div"), this.shadowHost.setAttribute("data-qaid-embed", ""), this.shadowHost.style.position = "static", this.shadowHost.style.display = "contents";
583
616
  let t = null;
584
- if (this.config.container && (t = document.querySelector(this.config.container)), t)
585
- this.container = t, this.container.classList.add("qaid-widget", `qaid-${this.config.position}`), this.config.incognito && this.container.classList.add("qaid-incognito"), this.isUserProvidedContainer = !0;
617
+ this.config.container && (t = document.querySelector(this.config.container)), t ? (t.appendChild(this.shadowHost), this.isUserProvidedContainer = !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" });
618
+ const o = document.createElement("style");
619
+ if (o.textContent = A(), this.shadowRoot.appendChild(o), this.config.css) {
620
+ const r = document.createElement("style");
621
+ r.textContent = this.config.css, this.shadowRoot.appendChild(r);
622
+ }
623
+ const i = this.config.direction === "vertical" ? "qaid-vertical" : "";
624
+ if (this.isUserProvidedContainer)
625
+ this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-${this.config.position} ${i}`.trim(), this.config.incognito && this.buttonsContainer.classList.add("qaid-incognito");
586
626
  else {
587
- this.container = document.createElement("div"), this.container.className = `qaid-widget qaid-auto-container qaid-${this.config.position}${this.config.incognito ? " qaid-incognito" : ""}`, this.container.style.zIndex = String(this.config.zIndex);
588
- const { x: s, y: c } = this.config.offset;
589
- this.config.position.includes("right") ? this.container.style.right = `${s}px` : this.container.style.left = `${s}px`, this.config.position.includes("bottom") ? this.container.style.bottom = `${c}px` : this.container.style.top = `${c}px`, document.body.appendChild(this.container);
627
+ this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-auto-container qaid-${this.config.position} ${i}${this.config.incognito ? " qaid-incognito" : ""}`.trim(), this.buttonsContainer.style.pointerEvents = "auto";
628
+ const { x: r, y: c } = this.config.offset;
629
+ this.config.position.includes("right") ? this.buttonsContainer.style.right = `${r}px` : this.buttonsContainer.style.left = `${r}px`, this.config.position.includes("bottom") ? this.buttonsContainer.style.bottom = `${c}px` : this.buttonsContainer.style.top = `${c}px`;
590
630
  }
591
- const e = this.config.fontFamily, o = e && e !== "system-ui, -apple-system, sans-serif";
592
- o && (this.container.style.fontFamily = e);
593
- const n = !!this.config.buttonClass, a = n ? `qaid-btn-structural ${this.config.buttonClass}` : "qaid-btn", r = (this.config.skipTargeting, "Feedback for us?"), l = this.config.text.tooltip || r, d = document.createElement("div");
594
- if (d.className = "qaid-tooltip-text", d.textContent = l, o && (d.style.fontFamily = e), document.body.appendChild(d), this.tooltipElement = d, !this.config.hideThumbs) {
595
- const s = document.createElement("div");
596
- s.className = "qaid-tooltip-wrapper";
631
+ this.applyVars(this.buttonsContainer), this.shadowRoot.appendChild(this.buttonsContainer);
632
+ const n = !!this.config.buttonClass, a = n ? `qaid-btn-structural ${this.config.buttonClass}` : "qaid-btn", l = this.config.text.tooltip || "Feedback for us?", d = document.createElement("div");
633
+ if (d.className = "qaid-tooltip-text", d.textContent = l, this.applyVars(d), this.shadowRoot.appendChild(d), this.tooltipElement = d, !this.config.hideThumbs) {
634
+ const r = document.createElement("div");
635
+ r.className = "qaid-tooltip-wrapper";
597
636
  const c = document.createElement("button");
598
- c.type = "button", c.className = n ? `${a} qaid-btn-up` : "qaid-btn qaid-btn-up", c.innerHTML = this.config.positiveIcon || T, c.addEventListener("click", (f) => this.handleThumbClick("up", f.currentTarget)), c.addEventListener("mouseenter", () => this.showTooltip(c)), c.addEventListener("mouseleave", () => this.hideTooltip()), s.appendChild(c);
599
- const p = document.createElement("div");
600
- p.className = "qaid-tooltip-wrapper";
601
- const u = document.createElement("button");
602
- u.type = "button", u.className = n ? `${a} qaid-btn-down` : "qaid-btn qaid-btn-down", u.innerHTML = this.config.negativeIcon || S, u.addEventListener("click", (f) => this.handleThumbClick("down", f.currentTarget)), u.addEventListener("mouseenter", () => this.showTooltip(u)), u.addEventListener("mouseleave", () => this.hideTooltip()), p.appendChild(u), this.container.appendChild(s), this.container.appendChild(p);
637
+ c.type = "button", c.className = n ? `${a} qaid-btn-up` : "qaid-btn qaid-btn-up", c.innerHTML = this.config.positiveIcon || T, c.addEventListener("click", (f) => this.handleThumbClick("up", f.currentTarget)), c.addEventListener("mouseenter", () => this.showTooltip(c)), c.addEventListener("mouseleave", () => this.hideTooltip()), r.appendChild(c);
638
+ const u = document.createElement("div");
639
+ u.className = "qaid-tooltip-wrapper";
640
+ const p = document.createElement("button");
641
+ p.type = "button", p.className = n ? `${a} qaid-btn-down` : "qaid-btn qaid-btn-down", p.innerHTML = this.config.negativeIcon || I, p.addEventListener("click", (f) => this.handleThumbClick("down", f.currentTarget)), p.addEventListener("mouseenter", () => this.showTooltip(p)), p.addEventListener("mouseleave", () => this.hideTooltip()), u.appendChild(p), this.buttonsContainer.appendChild(r), this.buttonsContainer.appendChild(u);
603
642
  }
604
- if (this.config.captureVideo && Tt()) {
605
- const s = document.createElement("div");
606
- s.className = "qaid-tooltip-wrapper";
643
+ if (this.config.captureVideo && Dt()) {
644
+ const r = document.createElement("div");
645
+ r.className = "qaid-tooltip-wrapper";
607
646
  const c = document.createElement("button");
608
- c.type = "button", c.className = n ? `${a} qaid-btn-record` : "qaid-btn qaid-btn-record", c.innerHTML = this.config.recordIcon || tt, c.addEventListener("click", () => this.startRecording()), c.addEventListener("mouseenter", () => this.showTooltip(c)), c.addEventListener("mouseleave", () => this.hideTooltip()), s.appendChild(c), this.container.appendChild(s);
647
+ c.type = "button", c.className = n ? `${a} qaid-btn-record` : "qaid-btn qaid-btn-record", c.innerHTML = this.config.recordIcon || it, c.addEventListener("click", () => this.startRecording()), c.addEventListener("mouseenter", () => this.showTooltip(c)), c.addEventListener("mouseleave", () => this.hideTooltip()), r.appendChild(c), this.buttonsContainer.appendChild(r);
648
+ }
649
+ }
650
+ /**
651
+ * Lazily create a separate overlay shadow host on document.body.
652
+ * This host contains all full-page elements (targeting overlay, marker,
653
+ * backdrop, modal, recording indicator, video preview) so they escape
654
+ * clip-path / transform containing blocks in user containers.
655
+ */
656
+ ensureOverlayHost() {
657
+ if (this.overlayShadowRoot) return this.overlayShadowRoot;
658
+ 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" });
659
+ const t = document.createElement("style");
660
+ if (t.textContent = A(), this.overlayShadowRoot.appendChild(t), this.config.css) {
661
+ const o = document.createElement("style");
662
+ o.textContent = this.config.css, this.overlayShadowRoot.appendChild(o);
609
663
  }
664
+ return this.overlayShadowRoot;
610
665
  }
611
666
  showTooltip(t) {
612
667
  if (!this.tooltipElement) return;
613
- const e = this.tooltipElement, o = 8;
614
- e.style.visibility = "hidden", e.classList.add("qaid-tooltip-visible");
615
- const n = t.getBoundingClientRect(), a = e.getBoundingClientRect(), r = window.innerWidth, l = window.innerHeight;
616
- let d, s;
617
- d = n.bottom + o, d + a.height > l - o && (d = n.top - a.height - o), s = n.left, s < o ? s = o : s + a.width > r - o && (s = r - a.width - o), d < o ? d = o : d + a.height > l - o && (d = l - a.height - o), e.style.top = `${d}px`, e.style.left = `${s}px`, e.style.visibility = "visible";
668
+ const o = this.tooltipElement, i = 8;
669
+ o.style.visibility = "hidden", o.classList.add("qaid-tooltip-visible");
670
+ const n = t.getBoundingClientRect(), a = o.getBoundingClientRect(), s = window.innerWidth, l = window.innerHeight;
671
+ let d, r;
672
+ d = n.bottom + i, d + a.height > l - i && (d = n.top - a.height - i), r = n.left, r < i ? r = i : r + a.width > s - i && (r = s - a.width - i), d < i ? d = i : d + a.height > l - i && (d = l - a.height - i), o.style.top = `${d}px`, o.style.left = `${r}px`, o.style.visibility = "visible";
618
673
  }
619
674
  hideTooltip() {
620
675
  this.tooltipElement && this.tooltipElement.classList.remove("qaid-tooltip-visible");
621
676
  }
622
- handleThumbClick(t, e) {
623
- this.config.skipTargeting ? this.submitDirectFeedback(t, e) : this.startTargeting(t);
677
+ handleThumbClick(t, o) {
678
+ this.config.skipTargeting ? this.submitDirectFeedback(t, o) : this.startTargeting(t);
624
679
  }
625
- submitDirectFeedback(t, e) {
680
+ submitDirectFeedback(t, o) {
626
681
  this.feedbackData.feedbackType = t, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null;
627
- const o = e.getBoundingClientRect();
682
+ const i = o.getBoundingClientRect();
628
683
  this.selectedBounds = {
629
- x: o.left,
630
- y: o.top,
631
- width: o.width,
632
- height: o.height,
633
- clickX: o.left + o.width / 2,
634
- clickY: o.top + o.height / 2,
684
+ x: i.left,
685
+ y: i.top,
686
+ width: i.width,
687
+ height: i.height,
688
+ clickX: i.left + i.width / 2,
689
+ clickY: i.top + i.height / 2,
635
690
  visible: !1
636
691
  }, this.submitFeedback();
637
692
  }
638
693
  startTargeting(t) {
639
- this.state = "TARGETING", this.feedbackData.feedbackType = t, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1, document.body.classList.add("qaid-targeting"), t === "up" ? document.body.classList.add("qaid-type-up") : document.body.classList.remove("qaid-type-up"), this.createTargetingOverlay(), document.addEventListener("keydown", this.boundKeyDown);
694
+ this.state = "TARGETING", this.feedbackData.feedbackType = t, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1, document.body.classList.add("qaid-targeting"), t === "up" ? document.body.classList.add("qaid-type-up") : document.body.classList.remove("qaid-type-up"), document.body.style.setProperty("--qaid-positive", this.cssVars["--qaid-positive"]), document.body.style.setProperty("--qaid-negative", this.cssVars["--qaid-negative"]), this.createTargetingOverlay(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "auto"), document.addEventListener("keydown", this.boundKeyDown);
640
695
  }
641
696
  createTargetingOverlay() {
697
+ const t = this.ensureOverlayHost();
642
698
  this.overlayContainer = document.createElement("div"), this.overlayContainer.className = `qaid-targeting-overlay qaid-type-${this.feedbackData.feedbackType}`, this.captureLayer = document.createElement("div"), this.captureLayer.className = "qaid-capture-layer", this.captureLayer.addEventListener("mousemove", this.boundMouseMove), this.captureLayer.addEventListener("click", this.boundClick);
643
- const t = document.createElement("div");
644
- t.className = `qaid-banner qaid-banner-${this.feedbackData.feedbackType}`;
645
- const e = this.config.fontFamily;
646
- e && e !== "system-ui, -apple-system, sans-serif" && (t.style.fontFamily = e), t.innerHTML = `
647
- <span class="qaid-banner-text">${this.config.text.bannerText}</span>
648
- <span class="qaid-banner-hint">${this.config.text.bannerHint}</span>
649
- `;
650
699
  const o = document.createElement("div");
651
700
  o.className = "qaid-vignette", this.crosshairH = document.createElement("div"), this.crosshairH.className = "qaid-crosshair-h", this.crosshairV = document.createElement("div"), this.crosshairV.className = "qaid-crosshair-v", this.scope = document.createElement("div"), this.scope.className = "qaid-scope", this.scope.innerHTML = `
652
701
  <div class="qaid-scope-ring"></div>
653
702
  <div class="qaid-scope-ring-inner"></div>
654
703
  <div class="qaid-scope-dot"></div>
655
- `, this.overlayContainer.appendChild(this.captureLayer), this.overlayContainer.appendChild(t), this.overlayContainer.appendChild(o), this.overlayContainer.appendChild(this.crosshairH), this.overlayContainer.appendChild(this.crosshairV), this.overlayContainer.appendChild(this.scope), document.body.appendChild(this.overlayContainer);
704
+ `, this.overlayContainer.appendChild(this.captureLayer), this.overlayContainer.appendChild(o), this.overlayContainer.appendChild(this.crosshairH), this.overlayContainer.appendChild(this.crosshairV), this.overlayContainer.appendChild(this.scope), this.applyVars(this.overlayContainer), t.appendChild(this.overlayContainer);
656
705
  }
657
706
  handleKeyDown(t) {
658
707
  t.key === "Escape" && (this.isRecording ? this.stopRecording() : this.videoPreview ? this.cancelRecordingPreview() : this.state === "TARGETING" ? this.cancelTargeting() : this.state === "MODAL_OPEN" && this.closeModal());
659
708
  }
660
709
  handleMouseMove(t) {
661
- if (this.mousePos.x = t.clientX, this.mousePos.y = t.clientY, this.crosshairH && (this.crosshairH.style.top = `${t.clientY}px`), this.crosshairV && (this.crosshairV.style.left = `${t.clientX}px`), this.scope && (this.scope.style.left = `${t.clientX}px`, this.scope.style.top = `${t.clientY}px`), this.captureLayer) {
662
- const e = O(
710
+ if (this.mousePos.x = t.clientX, this.mousePos.y = t.clientY, this.crosshairH && (this.crosshairH.style.top = `${t.clientY}px`), this.crosshairV && (this.crosshairV.style.left = `${t.clientX}px`), this.scope && (this.scope.style.left = `${t.clientX}px`, this.scope.style.top = `${t.clientY}px`), this.captureLayer && this.shadowHost) {
711
+ const o = [this.shadowHost, this.overlayShadowHost].filter(Boolean), i = $(
663
712
  t.clientX,
664
713
  t.clientY,
665
- this.captureLayer
714
+ o
666
715
  );
667
- e && !N(e) ? (this.lastHighlighted && this.lastHighlighted !== e && this.lastHighlighted.classList.remove("qaid-highlight"), e.classList.add("qaid-highlight"), this.lastHighlighted = e) : this.lastHighlighted && (this.lastHighlighted.classList.remove("qaid-highlight"), this.lastHighlighted = null);
716
+ i && !N(i) ? (this.lastHighlighted && this.lastHighlighted !== i && this.lastHighlighted.classList.remove("qaid-highlight"), i.classList.add("qaid-highlight"), this.lastHighlighted = i) : this.lastHighlighted && (this.lastHighlighted.classList.remove("qaid-highlight"), this.lastHighlighted = null);
668
717
  }
669
718
  }
670
719
  handleClick(t) {
671
- if (!this.captureLayer) return;
672
- const e = O(
720
+ if (!this.captureLayer || !this.shadowHost) return;
721
+ const o = [this.shadowHost, this.overlayShadowHost].filter(Boolean), i = $(
673
722
  t.clientX,
674
723
  t.clientY,
675
- this.captureLayer
724
+ o
676
725
  );
677
- if (!e || N(e))
726
+ if (!i || N(i))
678
727
  return;
679
- e.classList.remove("qaid-highlight");
680
- const o = Mt(e, 8);
728
+ i.classList.remove("qaid-highlight");
729
+ const n = At(i, 8);
681
730
  this.selectedBounds = {
682
- ...o,
731
+ ...n,
683
732
  clickX: t.clientX,
684
733
  clickY: t.clientY,
685
734
  visible: !0
686
735
  };
687
- const { selector: n, text: a } = ft(e);
688
- this.feedbackData.elementSelector = n, this.feedbackData.elementText = a, I("qaid-highlight"), this.removeTargetingOverlay(), document.body.classList.remove("qaid-targeting", "qaid-type-up"), this.state = "SELECTED", this.showSelectedMarker(), this.submitFeedback();
736
+ const { selector: a, text: s } = qt(i);
737
+ this.feedbackData.elementSelector = a, this.feedbackData.elementText = s, L("qaid-highlight"), this.removeTargetingOverlay(), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "none"), this.state = "SELECTED", this.showSelectedMarker(), this.submitFeedback();
689
738
  }
690
739
  cancelTargeting() {
691
- I("qaid-highlight"), this.removeTargetingOverlay(), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.removeEventListener("keydown", this.boundKeyDown), this.state = "IDLE", this.feedbackData.feedbackType = null, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1, this.lastHighlighted = null;
740
+ L("qaid-highlight"), this.removeTargetingOverlay(), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), document.removeEventListener("keydown", this.boundKeyDown), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "none"), this.state = "IDLE", this.feedbackData.feedbackType = null, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1, this.lastHighlighted = null;
692
741
  }
693
742
  removeTargetingOverlay() {
694
743
  this.overlayContainer && (this.overlayContainer.remove(), this.overlayContainer = null), this.captureLayer = null, this.crosshairH = null, this.crosshairV = null, this.scope = null;
695
744
  }
696
745
  showSelectedMarker() {
697
- this.selectedBounds.visible && (this.marker = document.createElement("div"), this.marker.className = "qaid-selected-marker", this.marker.style.left = `${this.selectedBounds.x}px`, this.marker.style.top = `${this.selectedBounds.y}px`, this.marker.style.width = `${this.selectedBounds.width}px`, this.marker.style.height = `${this.selectedBounds.height}px`, this.marker.style.zIndex = String(this.config.zIndex + 1), document.body.appendChild(this.marker));
746
+ if (!this.selectedBounds.visible) return;
747
+ const t = this.ensureOverlayHost();
748
+ this.marker = document.createElement("div"), this.marker.className = "qaid-selected-marker", this.marker.style.left = `${this.selectedBounds.x}px`, this.marker.style.top = `${this.selectedBounds.y}px`, this.marker.style.width = `${this.selectedBounds.width}px`, this.marker.style.height = `${this.selectedBounds.height}px`, this.marker.style.zIndex = String(this.config.zIndex + 1), this.applyVars(this.marker), t.appendChild(this.marker);
698
749
  }
699
750
  hideSelectedMarker() {
700
751
  this.marker && (this.marker.remove(), this.marker = null);
@@ -702,13 +753,13 @@ class Pt {
702
753
  async submitFeedback() {
703
754
  if (!this.feedbackData.feedbackType) return;
704
755
  let t = null;
705
- this.config.captureScreenshot && (this.config.screenshotMethod === "dom" ? t = await At(this.config.screenshotOptions) : t = await Dt(this.config.screenshotOptions));
706
- const e = this.feedbackData.elementSelector ? {
756
+ this.config.captureScreenshot && (this.config.screenshotMethod === "dom" ? t = await Vt(this.config.screenshotOptions) : t = await Ot(this.config.screenshotOptions));
757
+ const o = this.feedbackData.elementSelector ? {
707
758
  x: this.selectedBounds.x,
708
759
  y: this.selectedBounds.y,
709
760
  width: this.selectedBounds.width,
710
761
  height: this.selectedBounds.height
711
- } : null, o = {
762
+ } : null, i = {
712
763
  feedbackType: this.feedbackData.feedbackType,
713
764
  pageUrl: window.location.href,
714
765
  apiKey: this.config.apiKey || void 0,
@@ -724,14 +775,14 @@ class Pt {
724
775
  screenshot: t,
725
776
  visitorId: this.visitorId,
726
777
  // Include element bounds and user agent for server-side screenshot fallback
727
- elementBounds: e,
778
+ elementBounds: o,
728
779
  userAgent: navigator.userAgent
729
780
  };
730
781
  try {
731
782
  const n = await fetch(this.config.endpoint, {
732
783
  method: "POST",
733
784
  headers: { "Content-Type": "application/json" },
734
- body: JSON.stringify(o)
785
+ body: JSON.stringify(i)
735
786
  });
736
787
  if (n.ok) {
737
788
  const a = await n.json();
@@ -740,24 +791,23 @@ class Pt {
740
791
  } catch (n) {
741
792
  console.error("Failed to submit feedback:", n);
742
793
  }
743
- this.state = "MODAL_OPEN", this.showModal();
794
+ this.state = "MODAL_OPEN", this.showModal(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "auto");
744
795
  }
745
796
  showModal() {
746
- this.backdrop = document.createElement("div"), this.backdrop.className = "qaid-backdrop", this.backdrop.style.zIndex = String(this.config.zIndex + 2), this.backdrop.style.background = `rgba(0, 0, 0, ${this.config.backdropOpacity})`, this.backdrop.addEventListener("click", () => this.closeModal()), this.isMobile ? this.showBottomSheet() : this.showPositionedModal(), document.body.appendChild(this.backdrop), document.addEventListener("keydown", this.boundKeyDown);
797
+ const t = this.ensureOverlayHost();
798
+ this.backdrop = document.createElement("div"), this.backdrop.className = "qaid-backdrop", this.backdrop.style.zIndex = String(this.config.zIndex + 2), this.backdrop.style.background = `rgba(0, 0, 0, ${this.config.backdropOpacity})`, this.backdrop.addEventListener("click", () => this.closeModal()), this.applyVars(this.backdrop), this.isMobile ? this.showBottomSheet() : this.showPositionedModal(), t.appendChild(this.backdrop), document.addEventListener("keydown", this.boundKeyDown);
747
799
  }
748
800
  showBottomSheet() {
749
- const t = document.createElement("div");
750
- t.className = "qaid-bottom-sheet", t.style.zIndex = String(this.config.zIndex + 3);
751
- const e = this.config.fontFamily;
752
- e && e !== "system-ui, -apple-system, sans-serif" && (t.style.fontFamily = e), t.innerHTML = `
801
+ const t = this.ensureOverlayHost(), o = document.createElement("div");
802
+ o.className = "qaid-bottom-sheet", o.style.zIndex = String(this.config.zIndex + 3), o.innerHTML = `
753
803
  <div class="qaid-bottom-sheet-content">
754
804
  <div class="qaid-bottom-sheet-handle"></div>
755
805
  ${this.getModalContent()}
756
806
  </div>
757
- `, document.body.appendChild(t), this.modalContainer = t, this.setupModalInteractions();
807
+ `, this.applyVars(o), t.appendChild(o), this.modalContainer = o, this.setupModalInteractions();
758
808
  }
759
809
  showPositionedModal() {
760
- const { modal: t, arrow: e } = wt(
810
+ const t = this.ensureOverlayHost(), { modal: o, arrow: i } = Et(
761
811
  this.selectedBounds,
762
812
  window.innerWidth,
763
813
  window.innerHeight,
@@ -769,20 +819,18 @@ class Pt {
769
819
  viewportPadding: 16
770
820
  }
771
821
  );
772
- this.modalContainer = document.createElement("div"), this.modalContainer.className = `qaid-modal-container qaid-${t.position}`, this.modalContainer.style.top = `${t.top}px`, this.modalContainer.style.left = `${t.left}px`, this.modalContainer.style.zIndex = String(this.config.zIndex + 3);
773
- const o = this.config.fontFamily;
774
- o && o !== "system-ui, -apple-system, sans-serif" && (this.modalContainer.style.fontFamily = o);
822
+ this.modalContainer = document.createElement("div"), this.modalContainer.className = `qaid-modal-container qaid-${o.position}`, this.modalContainer.style.top = `${o.top}px`, this.modalContainer.style.left = `${o.left}px`, this.modalContainer.style.zIndex = String(this.config.zIndex + 3);
775
823
  const n = document.createElement("div");
776
- n.className = "qaid-modal-arrow", n.style.left = `${e.left}px`;
824
+ n.className = "qaid-modal-arrow", n.style.left = `${i.left}px`;
777
825
  const a = document.createElement("div");
778
- a.className = "qaid-modal-box", a.innerHTML = this.getModalContent(), this.modalContainer.appendChild(n), this.modalContainer.appendChild(a), document.body.appendChild(this.modalContainer), this.setupModalInteractions();
826
+ a.className = "qaid-modal-box", a.innerHTML = this.getModalContent(), this.modalContainer.appendChild(n), this.modalContainer.appendChild(a), this.applyVars(this.modalContainer), t.appendChild(this.modalContainer), this.setupModalInteractions();
779
827
  }
780
828
  getModalContent() {
781
- const t = this.feedbackData.feedbackType === "up", e = this.config.positiveIcon || T, o = this.config.negativeIcon || S;
829
+ const t = this.feedbackData.feedbackType === "up", o = this.config.positiveIcon || T, i = this.config.negativeIcon || I;
782
830
  return `
783
831
  <div class="qaid-modal-header">
784
832
  <button type="button" class="${this.config.buttonClass ? `qaid-type-toggle qaid-type-toggle-custom ${this.config.buttonClass} ${t ? "qaid-btn-up" : "qaid-btn-down"}` : `qaid-type-toggle ${t ? "qaid-type-up" : "qaid-type-down"}`}" title="Click to switch">
785
- ${t ? e : o}
833
+ ${t ? o : i}
786
834
  </button>
787
835
  <div class="qaid-modal-header-text">
788
836
  <h3 class="qaid-modal-title">${this.config.text.modalTitle}</h3>
@@ -797,19 +845,19 @@ class Pt {
797
845
  }
798
846
  setupModalInteractions() {
799
847
  if (!this.modalContainer) return;
800
- const t = this.modalContainer.querySelector(".qaid-textarea"), e = this.modalContainer.querySelector(".qaid-btn-submit");
848
+ const t = this.modalContainer.querySelector(".qaid-textarea"), o = this.modalContainer.querySelector(".qaid-btn-submit");
801
849
  t && (setTimeout(() => t.focus(), 100), t.addEventListener("input", () => {
802
- e && (e.textContent = t.value.trim() ? this.config.text.submitButton : this.config.text.skipButton);
803
- })), e && e.addEventListener("click", () => {
850
+ o && (o.textContent = t.value.trim() ? this.config.text.submitButton : this.config.text.skipButton);
851
+ })), o && o.addEventListener("click", () => {
804
852
  const n = (t == null ? void 0 : t.value.trim()) || null;
805
853
  this.submitMessage(n);
806
854
  });
807
- const o = this.modalContainer.querySelector(".qaid-type-toggle");
808
- o && o.addEventListener("click", () => {
855
+ const i = this.modalContainer.querySelector(".qaid-type-toggle");
856
+ i && i.addEventListener("click", () => {
809
857
  const n = this.feedbackData.feedbackType === "up" ? "down" : "up";
810
- this.feedbackData.feedbackType = n, this.config.buttonClass ? (o.classList.toggle("qaid-btn-up", n === "up"), o.classList.toggle("qaid-btn-down", n === "down")) : (o.classList.toggle("qaid-type-up", n === "up"), o.classList.toggle("qaid-type-down", n === "down"));
811
- const a = this.config.positiveIcon || T, r = this.config.negativeIcon || S;
812
- o.innerHTML = n === "up" ? a : r, this.feedbackId && fetch(`${this.config.endpoint}/${this.feedbackId}`, {
858
+ this.feedbackData.feedbackType = n, this.config.buttonClass ? (i.classList.toggle("qaid-btn-up", n === "up"), i.classList.toggle("qaid-btn-down", n === "down")) : (i.classList.toggle("qaid-type-up", n === "up"), i.classList.toggle("qaid-type-down", n === "down"));
859
+ const a = this.config.positiveIcon || T, s = this.config.negativeIcon || I;
860
+ i.innerHTML = n === "up" ? a : s, this.feedbackId && fetch(`${this.config.endpoint}/${this.feedbackId}`, {
813
861
  method: "PATCH",
814
862
  headers: { "Content-Type": "application/json" },
815
863
  body: JSON.stringify({ feedbackType: n })
@@ -824,8 +872,8 @@ class Pt {
824
872
  headers: { "Content-Type": "application/json" },
825
873
  body: JSON.stringify({ message: t })
826
874
  });
827
- } catch (e) {
828
- console.error("Failed to submit feedback message:", e);
875
+ } catch (o) {
876
+ console.error("Failed to submit feedback message:", o);
829
877
  }
830
878
  this.feedbackId = null;
831
879
  }
@@ -836,13 +884,13 @@ class Pt {
836
884
  method: "PATCH",
837
885
  headers: { "Content-Type": "application/json" },
838
886
  body: JSON.stringify({ message: null })
839
- }).catch((t) => console.error("Failed to finalize feedback:", t)), this.modalContainer && (this.modalContainer.remove(), this.modalContainer = null), this.backdrop && (this.backdrop.remove(), this.backdrop = null), document.removeEventListener("keydown", this.boundKeyDown), this.hideSelectedMarker(), this.state = "IDLE", this.feedbackId = null, this.feedbackData.feedbackType = null, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1;
887
+ }).catch((t) => console.error("Failed to finalize feedback:", t)), this.modalContainer && (this.modalContainer.remove(), this.modalContainer = null), this.backdrop && (this.backdrop.remove(), this.backdrop = null), document.removeEventListener("keydown", this.boundKeyDown), this.hideSelectedMarker(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "none"), this.state = "IDLE", this.feedbackId = null, this.feedbackData.feedbackType = null, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1;
840
888
  }
841
889
  // ==================== Video Recording ====================
842
890
  async startRecording() {
843
891
  if (!(this.isRecording || this.state !== "IDLE"))
844
892
  try {
845
- this.networkCapture = Et(), this.videoRecorder = It({
893
+ this.networkCapture = Rt(), this.videoRecorder = zt({
846
894
  maxDuration: this.config.videoOptions.maxDuration
847
895
  }), this.videoRecorder.onTick((t) => {
848
896
  this.updateRecordingTimer(t);
@@ -864,54 +912,55 @@ class Pt {
864
912
  }
865
913
  }
866
914
  showRecordingIndicator() {
915
+ const t = this.ensureOverlayHost();
867
916
  this.recordingIndicator = document.createElement("div"), this.recordingIndicator.className = "qaid-recording-indicator", this.recordingIndicator.style.zIndex = String(this.config.zIndex + 100);
868
- const t = document.createElement("div");
869
- t.className = "qaid-recording-dot";
870
- const e = document.createElement("span");
871
- e.className = "qaid-recording-time", e.textContent = this.formatTime(this.config.videoOptions.maxDuration);
872
- const o = document.createElement("button");
873
- o.type = "button", o.className = "qaid-recording-stop", o.textContent = "Stop", o.addEventListener("click", () => this.stopRecording()), this.recordingIndicator.appendChild(t), this.recordingIndicator.appendChild(e), this.recordingIndicator.appendChild(o), document.body.appendChild(this.recordingIndicator);
917
+ const o = document.createElement("div");
918
+ o.className = "qaid-recording-dot";
919
+ const i = document.createElement("span");
920
+ i.className = "qaid-recording-time", i.textContent = this.formatTime(this.config.videoOptions.maxDuration);
921
+ const n = document.createElement("button");
922
+ n.type = "button", n.className = "qaid-recording-stop", n.textContent = "Stop", n.addEventListener("click", () => this.stopRecording()), this.recordingIndicator.appendChild(o), this.recordingIndicator.appendChild(i), this.recordingIndicator.appendChild(n), this.applyVars(this.recordingIndicator), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "auto"), t.appendChild(this.recordingIndicator);
874
923
  }
875
924
  updateRecordingTimer(t) {
876
925
  if (!this.recordingIndicator) return;
877
- const e = this.recordingIndicator.querySelector(".qaid-recording-time");
878
- if (e) {
879
- const o = Math.max(0, this.config.videoOptions.maxDuration - t);
880
- e.textContent = this.formatTime(o);
926
+ const o = this.recordingIndicator.querySelector(".qaid-recording-time");
927
+ if (o) {
928
+ const i = Math.max(0, this.config.videoOptions.maxDuration - t);
929
+ o.textContent = this.formatTime(i);
881
930
  }
882
931
  }
883
932
  formatTime(t) {
884
- const e = Math.floor(t / 60), o = t % 60;
885
- return `${e}:${o.toString().padStart(2, "0")}`;
933
+ const o = Math.floor(t / 60), i = t % 60;
934
+ return `${o}:${i.toString().padStart(2, "0")}`;
886
935
  }
887
936
  removeRecordingIndicator() {
888
937
  this.recordingIndicator && (this.recordingIndicator.remove(), this.recordingIndicator = null);
889
938
  }
890
939
  showRecordingPreview() {
891
940
  if (!this.recordedBlob) return;
892
- const t = URL.createObjectURL(this.recordedBlob);
941
+ const t = this.ensureOverlayHost(), o = URL.createObjectURL(this.recordedBlob);
893
942
  this.videoPreview = document.createElement("div"), this.videoPreview.className = "qaid-video-preview", this.videoPreview.style.zIndex = String(this.config.zIndex + 100);
894
- const e = document.createElement("div");
895
- e.className = "qaid-video-preview-box";
896
- const o = document.createElement("h3");
897
- o.textContent = "Review your recording";
898
- const n = document.createElement("video");
899
- n.src = t, n.controls = !0, n.autoplay = !0, n.muted = !0;
900
- const a = document.createElement("textarea");
901
- a.placeholder = "Optional: Describe the issue you recorded...";
902
- const r = document.createElement("div");
903
- r.className = "qaid-video-preview-actions";
904
- const l = document.createElement("button");
905
- l.type = "button", l.className = "qaid-video-btn qaid-video-btn-cancel", l.textContent = "Cancel", l.addEventListener("click", () => this.cancelRecordingPreview());
943
+ const i = document.createElement("div");
944
+ i.className = "qaid-video-preview-box";
945
+ const n = document.createElement("h3");
946
+ n.textContent = "Review your recording";
947
+ const a = document.createElement("video");
948
+ a.src = o, a.controls = !0, a.autoplay = !0, a.muted = !0;
949
+ const s = document.createElement("textarea");
950
+ s.placeholder = "Optional: Describe the issue you recorded...";
951
+ const l = document.createElement("div");
952
+ l.className = "qaid-video-preview-actions";
906
953
  const d = document.createElement("button");
907
- d.type = "button", d.className = "qaid-video-btn qaid-video-btn-rerecord", d.textContent = "Re-record", d.addEventListener("click", () => {
954
+ d.type = "button", d.className = "qaid-video-btn qaid-video-btn-cancel", d.textContent = "Cancel", d.addEventListener("click", () => this.cancelRecordingPreview());
955
+ const r = document.createElement("button");
956
+ r.type = "button", r.className = "qaid-video-btn qaid-video-btn-rerecord", r.textContent = "Re-record", r.addEventListener("click", () => {
908
957
  this.cancelRecordingPreview(), this.startRecording();
909
958
  });
910
- const s = document.createElement("button");
911
- s.type = "button", s.className = "qaid-video-btn qaid-video-btn-send", s.textContent = "Send", s.addEventListener("click", () => {
912
- const c = a.value.trim() || null;
913
- this.submitVideoFeedback(c, s);
914
- }), r.appendChild(l), r.appendChild(d), r.appendChild(s), e.appendChild(o), e.appendChild(n), e.appendChild(a), e.appendChild(r), this.videoPreview.appendChild(e), document.body.appendChild(this.videoPreview), document.addEventListener("keydown", this.boundKeyDown);
959
+ const c = document.createElement("button");
960
+ c.type = "button", c.className = "qaid-video-btn qaid-video-btn-send", c.textContent = "Send", c.addEventListener("click", () => {
961
+ const u = s.value.trim() || null;
962
+ this.submitVideoFeedback(u, c);
963
+ }), l.appendChild(d), l.appendChild(r), l.appendChild(c), i.appendChild(n), i.appendChild(a), i.appendChild(s), i.appendChild(l), this.videoPreview.appendChild(i), this.applyVars(this.videoPreview), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "auto"), t.appendChild(this.videoPreview), document.addEventListener("keydown", this.boundKeyDown);
915
964
  }
916
965
  cancelRecordingPreview() {
917
966
  this.removeVideoPreview(), this.cleanupRecording();
@@ -923,15 +972,15 @@ class Pt {
923
972
  }
924
973
  document.removeEventListener("keydown", this.boundKeyDown);
925
974
  }
926
- async submitVideoFeedback(t, e) {
975
+ async submitVideoFeedback(t, o) {
927
976
  if (!this.recordedBlob || this.isSendingVideo) return;
928
- this.isSendingVideo = !0, e.disabled = !0, e.textContent = "Sending...";
929
- const o = new FormData();
930
- o.append("video", this.recordedBlob, `recording.${this.recordedBlob.type.includes("mp4") ? "mp4" : "webm"}`), o.append("pageUrl", window.location.href), o.append("visitorId", this.visitorId), this.config.apiKey && o.append("apiKey", this.config.apiKey), t && o.append("message", t), this.consoleCapture && o.append("consoleErrors", JSON.stringify(this.consoleCapture.errors)), this.networkCapture && o.append("networkErrors", JSON.stringify(this.networkCapture.errors));
977
+ this.isSendingVideo = !0, o.disabled = !0, o.textContent = "Sending...";
978
+ const i = new FormData();
979
+ i.append("video", this.recordedBlob, `recording.${this.recordedBlob.type.includes("mp4") ? "mp4" : "webm"}`), i.append("pageUrl", window.location.href), i.append("visitorId", this.visitorId), this.config.apiKey && i.append("apiKey", this.config.apiKey), t && i.append("message", t), this.consoleCapture && i.append("consoleErrors", JSON.stringify(this.consoleCapture.errors)), this.networkCapture && i.append("networkErrors", JSON.stringify(this.networkCapture.errors));
931
980
  try {
932
981
  const n = await fetch(`${this.config.endpoint}/video`, {
933
982
  method: "POST",
934
- body: o
983
+ body: i
935
984
  });
936
985
  n.ok || console.error("Failed to submit video feedback:", await n.text());
937
986
  } catch (n) {
@@ -940,102 +989,108 @@ class Pt {
940
989
  this.isSendingVideo = !1, this.removeVideoPreview(), this.cleanupRecording();
941
990
  }
942
991
  cleanupRecording() {
943
- 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.setButtonsDisabled(!1);
992
+ 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.setButtonsDisabled(!1), this.overlayShadowHost && this.state === "IDLE" && (this.overlayShadowHost.style.pointerEvents = "none");
944
993
  }
945
994
  setButtonsDisabled(t) {
946
- if (!this.container) return;
947
- this.container.querySelectorAll("button.qaid-btn, button.qaid-btn-structural").forEach((o) => {
948
- t ? o.classList.contains("qaid-btn-record") || (o.disabled = !0, o.style.opacity = "0.5") : (o.disabled = !1, o.style.opacity = "");
995
+ if (!this.buttonsContainer) return;
996
+ this.buttonsContainer.querySelectorAll("button.qaid-btn, button.qaid-btn-structural").forEach((i) => {
997
+ t ? i.classList.contains("qaid-btn-record") || (i.disabled = !0, i.style.opacity = "0.5") : (i.disabled = !1, i.style.opacity = "");
949
998
  });
950
999
  }
951
1000
  /**
952
1001
  * Destroy the embed and clean up all resources
953
1002
  */
954
1003
  destroy() {
955
- this.cleanupRecording(), this.removeVideoPreview(), this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), I("qaid-highlight"), document.body.classList.remove("qaid-targeting", "qaid-type-up"), this.container && (this.isUserProvidedContainer ? (this.container.innerHTML = "", this.container.classList.remove("qaid-widget", `qaid-${this.config.position}`, "qaid-incognito")) : this.container.remove(), this.container = null), this.removeTargetingOverlay(), this.hideSelectedMarker(), this.modalContainer && (this.modalContainer.remove(), this.modalContainer = null), this.backdrop && (this.backdrop.remove(), this.backdrop = null), this.tooltipElement && (this.tooltipElement.remove(), this.tooltipElement = null), dt();
1004
+ this.cleanupRecording(), this.removeVideoPreview(), this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), L("qaid-highlight"), 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.overlayContainer = null, this.captureLayer = null, this.crosshairH = null, this.crosshairV = null, this.scope = null, this.marker = null, this.modalContainer = null, this.backdrop = null, this.tooltipElement = null, mt();
956
1005
  }
957
1006
  }
958
- function Ht() {
959
- var e;
960
- const i = document.querySelector(
1007
+ function _(e) {
1008
+ var o;
1009
+ const t = document.querySelector(e);
1010
+ return ((o = t == null ? void 0 : t.textContent) == null ? void 0 : o.trim()) ?? "";
1011
+ }
1012
+ function Wt() {
1013
+ var o;
1014
+ const e = document.querySelector(
961
1015
  'script[type="application/json"][data-feedback-config]'
962
1016
  );
963
- if (!i) return null;
964
- const t = (e = i.textContent) == null ? void 0 : e.trim();
1017
+ if (!e) return null;
1018
+ const t = (o = e.textContent) == null ? void 0 : o.trim();
965
1019
  if (!t) return null;
966
1020
  try {
967
- return JSON.parse(t);
1021
+ const i = JSON.parse(t);
1022
+ return i.cssSelector && !i.css && (i.css = _(i.cssSelector), delete i.cssSelector), i;
968
1023
  } catch {
969
1024
  return null;
970
1025
  }
971
1026
  }
972
- function Ot(i) {
973
- const t = i.getAttribute("data-endpoint");
1027
+ function _t(e) {
1028
+ const t = e.getAttribute("data-endpoint");
974
1029
  if (!t) return null;
975
- const e = i.getAttribute("data-position"), o = i.getAttribute("data-zindex"), n = i.getAttribute("data-positive-color"), a = i.getAttribute("data-negative-color"), r = i.getAttribute("data-marker-color"), l = i.getAttribute("data-container"), d = i.getAttribute("data-button-class"), s = i.getAttribute("data-skip-targeting"), c = i.getAttribute("data-incognito"), p = i.getAttribute("data-button-size"), u = i.getAttribute("data-offset-x"), f = i.getAttribute("data-offset-y"), g = i.getAttribute("data-modal-width"), b = i.getAttribute("data-backdrop-opacity"), m = i.getAttribute("data-font-family"), v = i.getAttribute("data-font-size"), y = i.getAttribute("data-tooltip"), q = i.getAttribute("data-banner-text"), M = i.getAttribute("data-banner-hint"), D = i.getAttribute("data-modal-title"), z = i.getAttribute("data-modal-subtitle"), R = i.getAttribute("data-placeholder"), B = i.getAttribute("data-submit-button"), A = i.getAttribute("data-skip-button"), X = i.getAttribute("data-positive-icon"), _ = i.getAttribute("data-negative-icon"), j = i.getAttribute("data-api-key"), K = i.getAttribute("data-capture-screenshot"), k = i.getAttribute("data-screenshot-quality"), C = i.getAttribute("data-screenshot-max-width"), E = i.getAttribute("data-screenshot-max-height"), Y = i.getAttribute("data-capture-video"), J = i.getAttribute("data-hide-thumbs"), $ = i.getAttribute("data-video-max-duration"), G = i.getAttribute("data-screenshot-method");
1030
+ const o = e.getAttribute("data-position"), i = e.getAttribute("data-zindex"), n = e.getAttribute("data-positive-color"), a = e.getAttribute("data-negative-color"), s = e.getAttribute("data-marker-color"), l = e.getAttribute("data-container"), d = e.getAttribute("data-button-class"), r = e.getAttribute("data-skip-targeting"), c = e.getAttribute("data-incognito"), u = e.getAttribute("data-button-size"), p = e.getAttribute("data-offset-x"), f = e.getAttribute("data-offset-y"), b = e.getAttribute("data-modal-width"), g = e.getAttribute("data-backdrop-opacity"), m = e.getAttribute("data-font-family"), v = e.getAttribute("data-font-size"), y = e.getAttribute("data-tooltip"), x = e.getAttribute("data-modal-title"), H = e.getAttribute("data-modal-subtitle"), R = e.getAttribute("data-placeholder"), D = e.getAttribute("data-submit-button"), M = e.getAttribute("data-skip-button"), X = e.getAttribute("data-positive-icon"), j = e.getAttribute("data-negative-icon"), K = e.getAttribute("data-api-key"), Y = e.getAttribute("data-capture-screenshot"), C = e.getAttribute("data-screenshot-quality"), S = e.getAttribute("data-screenshot-max-width"), E = e.getAttribute("data-screenshot-max-height"), J = e.getAttribute("data-capture-video"), G = e.getAttribute("data-hide-thumbs"), z = e.getAttribute("data-video-max-duration"), Z = e.getAttribute("data-screenshot-method"), Q = e.getAttribute("data-direction"), B = e.getAttribute("data-css-selector");
976
1031
  return {
977
1032
  endpoint: t,
978
- apiKey: j ?? void 0,
979
- captureScreenshot: K === "true" ? !0 : void 0,
980
- screenshotOptions: k || C || E ? {
981
- quality: k ? parseFloat(k) : void 0,
982
- maxWidth: C ? parseInt(C, 10) : void 0,
1033
+ css: B ? _(B) : void 0,
1034
+ apiKey: K ?? void 0,
1035
+ captureScreenshot: Y === "true" ? !0 : void 0,
1036
+ screenshotOptions: C || S || E ? {
1037
+ quality: C ? parseFloat(C) : void 0,
1038
+ maxWidth: S ? parseInt(S, 10) : void 0,
983
1039
  maxHeight: E ? parseInt(E, 10) : void 0
984
1040
  } : void 0,
985
1041
  container: l ?? void 0,
986
1042
  buttonClass: d ?? void 0,
987
- position: e ?? void 0,
988
- zIndex: o ? parseInt(o, 10) : void 0,
989
- skipTargeting: s === "true" ? !0 : void 0,
1043
+ direction: Q ?? void 0,
1044
+ position: o ?? void 0,
1045
+ zIndex: i ? parseInt(i, 10) : void 0,
1046
+ skipTargeting: r === "true" ? !0 : void 0,
990
1047
  incognito: c === "true" ? !0 : void 0,
991
- buttonSize: p ?? void 0,
992
- offset: u || f ? {
993
- x: u ? parseInt(u, 10) : void 0,
1048
+ buttonSize: u ?? void 0,
1049
+ offset: p || f ? {
1050
+ x: p ? parseInt(p, 10) : void 0,
994
1051
  y: f ? parseInt(f, 10) : void 0
995
1052
  } : void 0,
996
- modalWidth: g ? parseInt(g, 10) : void 0,
997
- backdropOpacity: b ? parseFloat(b) : void 0,
1053
+ modalWidth: b ? parseInt(b, 10) : void 0,
1054
+ backdropOpacity: g ? parseFloat(g) : void 0,
998
1055
  fontFamily: m ?? void 0,
999
1056
  fontSize: v ? parseInt(v, 10) : void 0,
1000
1057
  colors: {
1001
1058
  positive: n ?? void 0,
1002
1059
  negative: a ?? void 0,
1003
- marker: r ?? void 0
1060
+ marker: s ?? void 0
1004
1061
  },
1005
- text: y || q || M || D || z || R || B || A ? {
1062
+ text: y || x || H || R || D || M ? {
1006
1063
  tooltip: y ?? void 0,
1007
- bannerText: q ?? void 0,
1008
- bannerHint: M ?? void 0,
1009
- modalTitle: D ?? void 0,
1010
- modalSubtitle: z ?? void 0,
1064
+ modalTitle: x ?? void 0,
1065
+ modalSubtitle: H ?? void 0,
1011
1066
  placeholder: R ?? void 0,
1012
- submitButton: B ?? void 0,
1013
- skipButton: A ?? void 0
1067
+ submitButton: D ?? void 0,
1068
+ skipButton: M ?? void 0
1014
1069
  } : void 0,
1015
1070
  positiveIcon: X ?? void 0,
1016
- negativeIcon: _ ?? void 0,
1017
- screenshotMethod: G ?? void 0,
1018
- captureVideo: Y === "true" ? !0 : void 0,
1019
- hideThumbs: J === "true" ? !0 : void 0,
1020
- videoOptions: $ ? {
1021
- maxDuration: parseInt($, 10)
1071
+ negativeIcon: j ?? void 0,
1072
+ screenshotMethod: Z ?? void 0,
1073
+ captureVideo: J === "true" ? !0 : void 0,
1074
+ hideThumbs: G === "true" ? !0 : void 0,
1075
+ videoOptions: z ? {
1076
+ maxDuration: parseInt(z, 10)
1022
1077
  } : void 0
1023
1078
  };
1024
1079
  }
1025
1080
  if (typeof document < "u") {
1026
- const i = () => {
1027
- const t = document.currentScript, e = Ht(), o = t ? Ot(t) : null, n = e ?? o;
1028
- n != null && n.endpoint && new Pt(n);
1081
+ const e = () => {
1082
+ const t = document.currentScript, o = Wt(), i = t ? _t(t) : null, n = o ?? i;
1083
+ n != null && n.endpoint && new Ft(n);
1029
1084
  };
1030
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", i) : i();
1085
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : e();
1031
1086
  }
1032
1087
  export {
1033
- Pt as FeedbackEmbed,
1034
- At as captureDomScreenshot,
1035
- Et as captureNetworkErrors,
1036
- It as createVideoRecorder,
1037
- St as getSupportedMimeType,
1038
- Ft as isDomScreenshotSupported,
1039
- Tt as isVideoRecordingSupported
1088
+ Ft as QaidFeedback,
1089
+ Vt as captureDomScreenshot,
1090
+ Rt as captureNetworkErrors,
1091
+ zt as createVideoRecorder,
1092
+ Mt as getSupportedMimeType,
1093
+ jt as isDomScreenshotSupported,
1094
+ Dt as isVideoRecordingSupported
1040
1095
  };
1041
1096
  //# sourceMappingURL=qaid.js.map