makethisbetter 1.28.0 → 1.28.2

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.
Files changed (47) hide show
  1. package/dist/i18n/de.d.ts +2 -0
  2. package/dist/i18n/de.d.ts.map +1 -1
  3. package/dist/i18n/en.d.ts +2 -0
  4. package/dist/i18n/en.d.ts.map +1 -1
  5. package/dist/i18n/es.d.ts +2 -0
  6. package/dist/i18n/es.d.ts.map +1 -1
  7. package/dist/i18n/fr.d.ts +2 -0
  8. package/dist/i18n/fr.d.ts.map +1 -1
  9. package/dist/i18n/ja.d.ts +2 -0
  10. package/dist/i18n/ja.d.ts.map +1 -1
  11. package/dist/i18n/ko.d.ts +2 -0
  12. package/dist/i18n/ko.d.ts.map +1 -1
  13. package/dist/i18n/zh-CN.d.ts +2 -0
  14. package/dist/i18n/zh-CN.d.ts.map +1 -1
  15. package/dist/makethisbetter.cjs +16 -27
  16. package/dist/makethisbetter.cjs.map +1 -1
  17. package/dist/makethisbetter.esm.js +380 -388
  18. package/dist/makethisbetter.esm.js.map +1 -1
  19. package/dist/makethisbetter.js +24 -35
  20. package/dist/makethisbetter.js.map +1 -1
  21. package/dist/makethisbetter.standalone.js +1206 -1214
  22. package/dist/makethisbetter.standalone.js.map +1 -1
  23. package/dist/popup/chat-popup.d.ts +6 -2
  24. package/dist/popup/chat-popup.d.ts.map +1 -1
  25. package/dist/widget/controller.d.ts.map +1 -1
  26. package/dist/widget/submission-lifecycle.d.ts +3 -5
  27. package/dist/widget/submission-lifecycle.d.ts.map +1 -1
  28. package/dist/widget/tab.d.ts +1 -0
  29. package/dist/widget/tab.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/src/i18n/de.ts +2 -0
  32. package/src/i18n/en.ts +2 -0
  33. package/src/i18n/es.ts +2 -0
  34. package/src/i18n/fr.ts +2 -0
  35. package/src/i18n/ja.ts +2 -0
  36. package/src/i18n/ko.ts +2 -0
  37. package/src/i18n/zh-CN.ts +2 -0
  38. package/src/popup/chat-popup.ts +59 -18
  39. package/src/styles/widget.css +76 -64
  40. package/src/widget/controller.ts +12 -14
  41. package/src/widget/submission-lifecycle.ts +6 -22
  42. package/src/widget/tab.ts +6 -0
  43. package/dist/popup/failure.d.ts +0 -12
  44. package/dist/popup/failure.d.ts.map +0 -1
  45. package/dist/screenshot/html-to-image-fallback.test.d.ts +0 -2
  46. package/dist/screenshot/html-to-image-fallback.test.d.ts.map +0 -1
  47. package/src/popup/failure.ts +0 -57
@@ -1,15 +1,15 @@
1
- const Ee = `*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{all:initial;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:14px;line-height:1.5;color:#191a1c;-webkit-font-smoothing:antialiased}:host{--mtb-brand-primary: #059669;--mtb-brand-hover: #047857;--mtb-brand-active: #065f46;--mtb-brand-on-primary: #fff;--mtb-brand-rgb: 5, 150, 105;--mtb-brand-on-primary-rgb: 255, 255, 255;--mtb-brand-emphasis: #10b981;--mtb-brand-emphasis-rgb: 16, 185, 129;--mtb-brand-gradient-start: #10b981;--mtb-brand-gradient-end: #059669;--mtb-panel-bg: #fff;--mtb-panel-border: rgba(0, 0, 0, .1);--mtb-panel-divider: rgba(0, 0, 0, .06);--mtb-fg: #191a1c;--mtb-field-bg: #fff;--mtb-field-bg-subtle: #fafafa;--mtb-field-border: rgba(0, 0, 0, .12);--mtb-field-border-soft: rgba(0, 0, 0, .09);--mtb-placeholder-fg: rgba(0, 0, 0, .34);--mtb-action-bg: #fff;--mtb-action-border: rgba(0, 0, 0, .12);--mtb-action-fg: rgba(0, 0, 0, .55);--mtb-action-hover-bg: rgba(0, 0, 0, .04);--mtb-clarify-close-fg: rgba(0, 0, 0, .38);--mtb-clarify-close-hover-fg: rgba(0, 0, 0, .7);--mtb-dismiss-fg: rgba(0, 0, 0, .4);--mtb-dismiss-hover-fg: rgba(0, 0, 0, .7);--mtb-quick-hover-bg: rgba(var(--mtb-brand-emphasis-rgb), .06);--mtb-quick-hover-border: rgba(var(--mtb-brand-emphasis-rgb), .3);--mtb-quick-selected-bg: rgba(var(--mtb-brand-emphasis-rgb), .1);--mtb-quick-selected-border: rgba(var(--mtb-brand-emphasis-rgb), .5);--mtb-field-focus-border: var(--mtb-brand-emphasis);--mtb-chat-card-bg: #FFFFFF;--mtb-chat-card-shadow: 0 24px 64px rgba(0, 0, 0, .18);--mtb-chat-raised-bg: #F9FAFB;--mtb-chat-write-bg: #FFFFFF;--mtb-chat-title-fg: #111827;--mtb-chat-body-fg: #1f2937;--mtb-chat-muted-fg: #6b7280;--mtb-chat-placeholder-fg: #9ca3af;--mtb-chat-pill-fg: #374151;--mtb-chat-pill-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04);--mtb-chat-pill-hover-shadow: 0 3px 10px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .05);--mtb-chat-close-hover-bg: #F3F4F6;--mtb-chat-close-hover-fg: #111827;--mtb-chat-composer-shadow: 0 -1px 6px rgba(0, 0, 0, .06);--mtb-chat-skip-fg: #9ca3af;--mtb-chat-skip-hover-fg: #4b5563;--mtb-chat-camera-lens: #fff;--mtb-chat-accent: var(--mtb-brand-primary);--mtb-chat-accent-fg: var(--mtb-brand-on-primary);--mtb-chat-accent-rgb: var(--mtb-brand-rgb);--mtb-chat-accent-fg-rgb: var(--mtb-brand-on-primary-rgb);--mtb-chat-link-fg: var(--mtb-brand-primary);--mtb-chat-send-shadow: 0 2px 8px rgba(var(--mtb-chat-accent-rgb), .35);--mtb-chat-success-icon-shadow: 0 4px 14px rgba(var(--mtb-chat-accent-rgb), .35);--mtb-chat-logo-start: #10b981;--mtb-chat-logo-end: #059669;--mtb-chat-logo-fg: #fff}:host([data-mtb-theme="dark"]){--mtb-panel-bg: #151719;--mtb-panel-border: rgba(255, 255, 255, .12);--mtb-panel-divider: rgba(255, 255, 255, .1);--mtb-fg: #f9fafb;--mtb-field-bg: #1f2327;--mtb-field-bg-subtle: #1f2327;--mtb-field-border: rgba(255, 255, 255, .12);--mtb-field-border-soft: rgba(255, 255, 255, .12);--mtb-placeholder-fg: rgba(255, 255, 255, .4);--mtb-action-bg: #1f2327;--mtb-action-border: rgba(255, 255, 255, .14);--mtb-action-fg: rgba(255, 255, 255, .7);--mtb-action-hover-bg: rgba(255, 255, 255, .06);--mtb-clarify-close-fg: rgba(255, 255, 255, .45);--mtb-clarify-close-hover-fg: rgba(255, 255, 255, .75);--mtb-dismiss-fg: rgba(255, 255, 255, .4);--mtb-dismiss-hover-fg: rgba(255, 255, 255, .7);--mtb-quick-hover-bg: rgba(var(--mtb-brand-emphasis-rgb), .12);--mtb-quick-hover-border: rgba(var(--mtb-brand-emphasis-rgb), .45);--mtb-quick-selected-bg: rgba(var(--mtb-brand-emphasis-rgb), .18);--mtb-quick-selected-border: var(--mtb-brand-primary);--mtb-field-focus-border: var(--mtb-brand-emphasis);--mtb-chat-card-bg: #17191C;--mtb-chat-card-shadow: 0 24px 64px rgba(0, 0, 0, .55);--mtb-chat-raised-bg: #202327;--mtb-chat-write-bg: #23272C;--mtb-chat-title-fg: #E8EAED;--mtb-chat-body-fg: #DCE0E4;--mtb-chat-muted-fg: #B0B6BD;--mtb-chat-placeholder-fg: #A3AAB2;--mtb-chat-pill-fg: #DDE1E5;--mtb-chat-pill-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);--mtb-chat-pill-hover-shadow: 0 4px 14px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .14);--mtb-chat-close-hover-bg: rgba(255, 255, 255, .08);--mtb-chat-close-hover-fg: #FFFFFF;--mtb-chat-composer-shadow: 0 -1px 6px rgba(0, 0, 0, .45);--mtb-chat-skip-fg: #A3AAB2;--mtb-chat-skip-hover-fg: #E8EAED;--mtb-chat-camera-lens: #EAF7EE;--mtb-chat-accent: #4ADE80;--mtb-chat-accent-fg: #0D1210;--mtb-chat-accent-rgb: 74, 222, 128;--mtb-chat-accent-fg-rgb: 13, 18, 16;--mtb-chat-link-fg: #5BD98A;--mtb-chat-send-shadow: 0 1px 3px rgba(0, 0, 0, .5);--mtb-chat-success-icon-shadow: 0 2px 10px rgba(0, 0, 0, .5);--mtb-chat-logo-start: #1E9E4A;--mtb-chat-logo-end: #0B8AA0;--mtb-chat-logo-fg: #EAF7EE}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]){--mtb-panel-bg: #151719;--mtb-panel-border: rgba(255, 255, 255, .12);--mtb-panel-divider: rgba(255, 255, 255, .1);--mtb-fg: #f9fafb;--mtb-field-bg: #1f2327;--mtb-field-bg-subtle: #1f2327;--mtb-field-border: rgba(255, 255, 255, .12);--mtb-field-border-soft: rgba(255, 255, 255, .12);--mtb-placeholder-fg: rgba(255, 255, 255, .4);--mtb-action-bg: #1f2327;--mtb-action-border: rgba(255, 255, 255, .14);--mtb-action-fg: rgba(255, 255, 255, .7);--mtb-action-hover-bg: rgba(255, 255, 255, .06);--mtb-clarify-close-fg: rgba(255, 255, 255, .45);--mtb-clarify-close-hover-fg: rgba(255, 255, 255, .75);--mtb-dismiss-fg: rgba(255, 255, 255, .4);--mtb-dismiss-hover-fg: rgba(255, 255, 255, .7);--mtb-quick-hover-bg: rgba(var(--mtb-brand-emphasis-rgb), .12);--mtb-quick-hover-border: rgba(var(--mtb-brand-emphasis-rgb), .45);--mtb-quick-selected-bg: rgba(var(--mtb-brand-emphasis-rgb), .18);--mtb-quick-selected-border: var(--mtb-brand-primary);--mtb-field-focus-border: var(--mtb-brand-emphasis);--mtb-chat-card-bg: #17191C;--mtb-chat-card-shadow: 0 24px 64px rgba(0, 0, 0, .55);--mtb-chat-raised-bg: #202327;--mtb-chat-write-bg: #23272C;--mtb-chat-title-fg: #E8EAED;--mtb-chat-body-fg: #DCE0E4;--mtb-chat-muted-fg: #B0B6BD;--mtb-chat-placeholder-fg: #A3AAB2;--mtb-chat-pill-fg: #DDE1E5;--mtb-chat-pill-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);--mtb-chat-pill-hover-shadow: 0 4px 14px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .14);--mtb-chat-close-hover-bg: rgba(255, 255, 255, .08);--mtb-chat-close-hover-fg: #FFFFFF;--mtb-chat-composer-shadow: 0 -1px 6px rgba(0, 0, 0, .45);--mtb-chat-skip-fg: #A3AAB2;--mtb-chat-skip-hover-fg: #E8EAED;--mtb-chat-camera-lens: #EAF7EE;--mtb-chat-accent: #4ADE80;--mtb-chat-accent-fg: #0D1210;--mtb-chat-accent-rgb: 74, 222, 128;--mtb-chat-accent-fg-rgb: 13, 18, 16;--mtb-chat-link-fg: #5BD98A;--mtb-chat-send-shadow: 0 1px 3px rgba(0, 0, 0, .5);--mtb-chat-success-icon-shadow: 0 2px 10px rgba(0, 0, 0, .5);--mtb-chat-logo-start: #1E9E4A;--mtb-chat-logo-end: #0B8AA0;--mtb-chat-logo-fg: #EAF7EE}}.mtb-tab{--mtb-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Ccircle cx='12' cy='12' r='2.4' fill='%23000' stroke='none'/%3E%3Cpath d='M12 1.8v3.4M12 18.8v3.4M1.8 12h3.4M18.8 12h3.4'/%3E%3C/svg%3E");--mtb-tab-bg: var(--mtb-brand-primary);--mtb-tab-hover-bg: var(--mtb-brand-hover);--mtb-tab-active-bg: var(--mtb-brand-active);--mtb-tab-shadow-color: var(--mtb-brand-rgb);--mtb-tab-fg: var(--mtb-brand-on-primary);position:fixed;top:50%;right:0;transform:translateY(-50%);z-index:2147483646;display:flex;align-items:center;justify-content:center;width:32px;padding:14px 0;background:var(--mtb-tab-bg);color:var(--mtb-tab-fg);border-radius:8px 0 0 8px;cursor:pointer;box-shadow:-2px 0 14px rgba(var(--mtb-tab-shadow-color),.35);transition:background .15s,box-shadow .15s,width .15s;writing-mode:vertical-lr;text-orientation:mixed;font-size:12px;font-weight:600;letter-spacing:.04em;user-select:none;border:none;outline:none}.mtb-tab.left{right:auto;left:0;border-radius:0 8px 8px 0;box-shadow:2px 0 14px rgba(var(--mtb-tab-shadow-color),.35)}.mtb-tab:hover{background:var(--mtb-tab-hover-bg);box-shadow:-3px 0 20px rgba(var(--mtb-tab-shadow-color),.45)}.mtb-tab.active{background:var(--mtb-tab-active-bg)}.mtb-hint-bar{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;height:38px;padding:0 16px;border-radius:13px;background:linear-gradient(120deg,var(--mtb-brand-gradient-start),var(--mtb-brand-gradient-end));color:var(--mtb-brand-on-primary);box-shadow:0 10px 26px #0f172a38;animation:mtbHintIn .2s ease;white-space:nowrap;transition:opacity .15s ease;pointer-events:none}.mtb-hint-bar--under-pointer{opacity:.3}.mtb-hint-bar.mtb-hint-bar--dismissed{display:none}@keyframes mtbHintIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}.mtb-toolbar{position:fixed;top:50%;right:8px;transform:translateY(-50%);z-index:2147483647;display:flex;flex-direction:column;align-items:center;gap:6px;width:38px;padding:6px 0;max-height:calc(100vh - 24px);border-radius:19px;background:linear-gradient(160deg,var(--mtb-brand-gradient-start),var(--mtb-brand-gradient-end));color:var(--mtb-brand-on-primary);box-shadow:0 8px 22px #0f172a33;animation:mtbEdgeBarIn .2s ease;white-space:nowrap;pointer-events:none}.mtb-toolbar.left{right:auto;left:8px;animation:mtbEdgeBarInLeft .2s ease}@keyframes mtbBarIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}@keyframes mtbEdgeBarIn{0%{transform:translate(12px,-50%);opacity:0}to{transform:translateY(-50%);opacity:1}}@keyframes mtbEdgeBarInLeft{0%{transform:translate(-12px,-50%);opacity:0}to{transform:translateY(-50%);opacity:1}}.mtb-toolbar-label{display:none}:host([data-mtb-toolbar]) .mtb-tab{display:none}.mtb-toolbar-modes{display:flex;align-items:center;gap:3px;background:rgba(var(--mtb-brand-on-primary-rgb),.16);border-radius:9px;padding:3px}.mtb-toolbar-mode-btn{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border-radius:7px;border:none;cursor:pointer;font-family:inherit;font-size:12px;font-weight:550;white-space:nowrap;background:transparent;color:var(--mtb-brand-on-primary);transition:all .12s}.mtb-toolbar-mode-btn.active{background:#fff;color:var(--mtb-brand-active)}.mtb-toolbar-hint{font-size:12px;color:var(--mtb-brand-on-primary);white-space:nowrap}.mtb-toolbar-sep{width:20px;height:1px;align-self:center;background:rgba(var(--mtb-brand-on-primary-rgb),.22)}.mtb-exit-btn{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 12px;border-radius:8px;font-size:11.5px;font-weight:500;color:var(--mtb-brand-on-primary);cursor:pointer;background:rgba(var(--mtb-brand-on-primary-rgb),.16);border:none;font-family:inherit;transition:background .12s}.mtb-toolbar-modes{flex-direction:column;gap:6px;padding:0;background:none;border-radius:0}.mtb-toolbar-mode-btn,.mtb-exit-btn{pointer-events:auto;display:flex;align-items:center;justify-content:center;gap:0;width:30px;height:30px;padding:0;border-radius:50%;background:none;color:var(--mtb-brand-on-primary)}.mtb-toolbar-mode-btn{opacity:.72}.mtb-exit-btn{opacity:1}.mtb-toolbar-mode-btn:hover,.mtb-exit-btn:hover{background:rgba(var(--mtb-brand-on-primary-rgb),.16);color:var(--mtb-brand-on-primary);opacity:1}.mtb-toolbar-mode-btn.active,.mtb-toolbar-mode-btn.active:hover{background:var(--mtb-brand-on-primary);color:var(--mtb-brand-hover);opacity:1}.mtb-exit-btn{color:var(--mtb-brand-on-primary)}.mtb-toolbar-sep{width:16px;height:1px;margin:1px 0;align-self:center;background:rgba(var(--mtb-brand-on-primary-rgb),.28)}.mtb-exit-btn:hover{background:rgba(var(--mtb-brand-on-primary-rgb),.28)}.mtb-overlay{position:fixed;inset:0;z-index:2147483640;cursor:crosshair;touch-action:none}.mtb-dim{position:fixed;inset:0;z-index:2147483639;background:#00000014}.mtb-highlight{position:fixed;z-index:2147483641;pointer-events:none;border:2px solid var(--mtb-brand-emphasis);border-radius:6px;background:rgba(var(--mtb-brand-emphasis-rgb),.06);transition:all .08s ease}.mtb-highlight-tooltip{position:fixed;z-index:2147483642;pointer-events:none;transform:translate(-50%,-100%);max-width:240px;overflow:hidden;text-overflow:ellipsis;background:var(--mtb-brand-active);color:var(--mtb-brand-on-primary);padding:4px 10px;border-radius:6px;font-size:11px;font-weight:500;white-space:nowrap;box-shadow:0 4px 12px #0000002e;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-highlight-tooltip.below{transform:translate(-50%)}.mtb-highlight-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:var(--mtb-brand-active)}.mtb-highlight-tooltip.below:after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:var(--mtb-brand-active)}.mtb-draw-svg{position:fixed;inset:0;z-index:2147483643;pointer-events:none;width:100%;height:100%;overflow:visible}.mtb-pin{position:fixed;z-index:2147483644;pointer-events:none;width:22px;height:22px;border-radius:50% 50% 50% 2px;background:var(--mtb-brand-primary);border:2px solid #fff;display:flex;align-items:center;justify-content:center;font-size:10px;color:var(--mtb-brand-on-primary);font-weight:700;box-shadow:0 0 0 1px #0f172aad,0 2px 8px rgba(var(--mtb-brand-rgb),.45);animation:mtbPinPop .25s cubic-bezier(.34,1.56,.64,1);transform:translate(-50%,-50%)}@keyframes mtbPinPop{0%{transform:translate(-50%,-50%) scale(.4)}to{transform:translate(-50%,-50%) scale(1)}}@keyframes mtbSlideUp{0%{transform:translateY(14px) scale(.97);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.mtb-draw-shot input:disabled{appearance:none;-webkit-appearance:none;border:none;border-radius:4px;background-color:var(--mtb-placeholder-fg);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center;background-size:contain;opacity:1}.mtb-draw-shot input:disabled{background-color:#0000004d}.mtb-btn-loading{pointer-events:none;opacity:.8}.mtb-btn-loading:after{content:"";display:inline-block;width:10px;height:10px;margin-left:6px;border:1.5px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:mtbSpin .7s linear infinite;vertical-align:middle}.mtb-chat{position:fixed;z-index:2147483645;display:flex;flex-direction:column;width:min(320px,calc(100vw - 56px));max-height:420px;background:var(--mtb-chat-card-bg);border-radius:16px;color:var(--mtb-chat-title-fg);box-shadow:var(--mtb-chat-card-shadow);overflow:hidden;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-chat.mtb-chat-receipt{inset:auto 20px 20px auto;width:min(320px,calc(100vw - 40px));animation:none}.mtb-chat-header{display:flex;align-items:center;gap:7px;padding:11px 12px;background:var(--mtb-chat-raised-bg);flex-shrink:0}.mtb-chat-brand{display:flex;align-items:center;gap:7px;text-decoration:none;opacity:.9;transition:opacity .16s}.mtb-chat-brand:hover{opacity:1}.mtb-chat-brand:hover .mtb-chat-brand-name{text-decoration:underline;text-underline-offset:2px}.mtb-chat-logo{width:20px;height:20px;border-radius:6px;overflow:hidden;flex:none}.mtb-chat-logo svg{width:100%;height:100%;display:block}.mtb-chat-brand-name{font-size:12px;font-weight:600;color:var(--mtb-chat-title-fg)}.mtb-chat-header-row{display:flex;align-items:center;gap:7px;width:100%}.mtb-chat-header-gap{flex:1}.mtb-chat-close{width:28px;height:28px;border-radius:99px;display:flex;align-items:center;justify-content:center;background:none;border:none;padding:0;color:var(--mtb-chat-muted-fg);cursor:pointer;flex:none;transition:background .16s,color .16s}.mtb-chat-close:hover{background:var(--mtb-chat-close-hover-bg);color:var(--mtb-chat-close-hover-fg)}.mtb-chat-messages{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px;min-height:0;background:var(--mtb-chat-card-bg)}.mtb-chat-messages:empty{display:none}.mtb-chat-bubble{font-size:13px;max-width:85%;word-break:break-word}.mtb-chat-bubble-user{align-self:flex-end;background:var(--mtb-chat-accent);color:var(--mtb-chat-accent-fg);line-height:1.45;padding:8px 11px;border-radius:12px 12px 4px}.mtb-chat-bubble-ai{background:var(--mtb-chat-raised-bg);color:var(--mtb-chat-body-fg);line-height:1.5;padding:9px 12px;border-radius:12px 12px 12px 4px}.mtb-chat-ai-row{display:flex;align-items:flex-end;gap:7px}.mtb-chat-avatar{width:22px;height:22px;border-radius:7px;overflow:hidden;flex:none}.mtb-chat-avatar svg{width:100%;height:100%;display:block}.mtb-chat-dots{display:flex;align-items:center;gap:4px;padding:10px 12px;background:var(--mtb-chat-raised-bg);border-radius:12px 12px 12px 4px}.mtb-chat-dots span{width:5px;height:5px;background:var(--mtb-chat-accent);border-radius:99px;animation:mtbChatDot 1.1s infinite}.mtb-chat-dots span:nth-child(2){animation-delay:.15s}.mtb-chat-dots span:nth-child(3){animation-delay:.3s}@keyframes mtbChatDot{0%,60%,to{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1}}.mtb-chat-suggestions{display:flex;flex-wrap:wrap;gap:6px;padding-left:29px}.mtb-chat-sg{background:var(--mtb-chat-write-bg);border:none;border-radius:99px;padding:5px 10px;font-size:11px;font-weight:500;font-family:inherit;color:var(--mtb-chat-pill-fg);cursor:pointer;box-shadow:var(--mtb-chat-pill-shadow);transition:box-shadow .16s,transform .16s}.mtb-chat-sg:hover{box-shadow:var(--mtb-chat-pill-hover-shadow);transform:translateY(-1px)}.mtb-chat-quick-replies{display:flex;flex-wrap:wrap;gap:6px;padding:12px;background:var(--mtb-chat-card-bg)}.mtb-chat-qr{display:flex;align-items:center;gap:5px;background:var(--mtb-chat-write-bg);border:none;border-radius:99px;padding:7px 12px;font-size:12px;font-weight:500;font-family:inherit;color:var(--mtb-chat-pill-fg);cursor:pointer;box-shadow:var(--mtb-chat-pill-shadow);transition:box-shadow .16s,transform .16s}.mtb-chat-qr:hover{box-shadow:var(--mtb-chat-pill-hover-shadow);transform:translateY(-1px)}.mtb-chat-qr:disabled{opacity:.5;pointer-events:none;cursor:default;transform:none!important;box-shadow:var(--mtb-chat-pill-shadow)!important}.mtb-chat-composer{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--mtb-chat-raised-bg);box-shadow:var(--mtb-chat-composer-shadow);flex-shrink:0}.mtb-chat-composer-disabled{pointer-events:none}.mtb-chat-composer-disabled .mtb-chat-input{opacity:.3}.mtb-chat-input{box-sizing:border-box;width:100%;min-height:64px;max-height:132px;padding:10px 12px;background:var(--mtb-chat-write-bg);border:none;border-radius:10px;font-size:13px;line-height:1.5;font-family:inherit;color:var(--mtb-chat-title-fg);outline:none;resize:none}.mtb-chat-input::placeholder{color:var(--mtb-chat-placeholder-fg)}.mtb-chat-input:disabled{opacity:.5;cursor:default}.mtb-chat-actions{display:flex;align-items:center;gap:10px}.mtb-chat-actions-gap{flex:1}.mtb-chat-screenshot,.mtb-chat-attachment{display:flex;align-items:center;gap:6px;background:none;border:none;padding:0;font-family:inherit;color:var(--mtb-chat-accent);cursor:pointer;transition:opacity .16s}.mtb-chat-screenshot svg,.mtb-chat-attachment svg{display:flex;flex:none}.mtb-chat-icon-lens{fill:var(--mtb-chat-camera-lens)}.mtb-chat-screenshot:hover{opacity:.75}.mtb-chat-attachment{cursor:default}.mtb-chat-capture-label{font-size:11px;color:var(--mtb-chat-muted-fg)}.mtb-chat-screenshot[aria-pressed=false],.mtb-chat-screenshot-off{opacity:.4;color:var(--mtb-chat-muted-fg)}.mtb-chat-screenshot:disabled{opacity:.3;pointer-events:none;cursor:default}.mtb-chat-skip{height:26px;border:none;border-radius:6px;background:none;display:flex;align-items:center;padding:0 4px;font-size:11px;font-weight:500;font-family:inherit;color:var(--mtb-chat-skip-fg);cursor:pointer;flex:none;transition:color .16s}.mtb-chat-skip:hover{color:var(--mtb-chat-skip-hover-fg)}.mtb-chat-send{position:relative;height:34px;padding:0 14px;border:none;border-radius:10px;background:var(--mtb-chat-accent);font-size:12px;font-weight:600;font-family:inherit;color:var(--mtb-chat-accent-fg);display:flex;align-items:center;justify-content:center;flex:none;cursor:pointer;box-shadow:var(--mtb-chat-send-shadow)}.mtb-chat-send:disabled{opacity:.3;box-shadow:none;cursor:default}.mtb-chat-error-row{display:flex;align-items:center;justify-content:center;gap:8px;padding:4px 0}.mtb-chat-error-text{font-size:11px;color:var(--mtb-danger, #ef4444)}.mtb-chat-error-retry{font-size:11px;font-weight:600;font-family:inherit;color:var(--mtb-chat-pill-fg);background:var(--mtb-chat-write-bg);border:none;border-radius:999px;padding:4px 11px;box-shadow:var(--mtb-chat-pill-shadow);cursor:pointer}.mtb-chat-error-retry:hover{box-shadow:var(--mtb-chat-pill-hover-shadow)}.mtb-chat-success{padding:30px 20px 26px;display:flex;flex-direction:column;align-items:center;gap:10px;background:var(--mtb-chat-card-bg);animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1) both}.mtb-chat-success-simple{padding-top:34px;padding-bottom:22px}.mtb-chat-success-icon{width:40px;height:40px;border-radius:99px;background:var(--mtb-chat-accent);color:var(--mtb-chat-accent-fg);display:flex;align-items:center;justify-content:center;box-shadow:var(--mtb-chat-success-icon-shadow)}.mtb-chat-success-title{font-size:15px;font-weight:600;color:var(--mtb-chat-title-fg);margin-top:2px;text-align:center}.mtb-chat-success-link{display:inline-flex;align-items:center;font-size:12px;font-weight:500;color:var(--mtb-chat-link-fg);text-decoration:none;margin-top:4px;cursor:pointer}.mtb-chat-success-link-pending{color:var(--mtb-chat-muted-fg);cursor:default;pointer-events:none}.mtb-chat-email-card{align-self:stretch;margin-top:10px;background:var(--mtb-chat-raised-bg);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:7px}.mtb-chat-email-row{display:flex;align-items:center;gap:7px}.mtb-chat-email-field{flex:1;background:var(--mtb-chat-write-bg);border-radius:8px;box-sizing:border-box;min-height:40px;display:flex;align-items:center;padding:0 10px;min-width:0}.mtb-chat-email-input{flex:1;min-width:0;background:none;border:none;outline:none;font-size:12px;font-family:inherit;color:var(--mtb-chat-title-fg)}.mtb-chat-email-input::placeholder{color:var(--mtb-chat-placeholder-fg)}.mtb-chat-email-submit{height:30px;padding:0 10px;border:none;border-radius:8px;background:var(--mtb-chat-accent);font-size:11px;font-weight:600;font-family:inherit;color:var(--mtb-chat-accent-fg);display:flex;align-items:center;justify-content:center;flex:none;cursor:pointer}.mtb-chat-email-submit:disabled{opacity:.3;cursor:default}.mtb-chat-email-note{font-size:12px;color:var(--mtb-chat-muted-fg);text-align:center}.mtb-chat-email-error{font-size:11px;color:var(--mtb-danger, #ef4444);text-align:center}.mtb-failure{position:fixed;z-index:2147483645;width:332px;background:var(--mtb-panel-bg);border:1px solid var(--mtb-panel-border);border-radius:16px;color:var(--mtb-fg);box-shadow:0 24px 64px #0000003d;padding:24px 22px;text-align:center;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-failure-icon{width:46px;height:46px;border-radius:50%;background:#dc262617;display:flex;align-items:center;justify-content:center;margin:0 auto 12px}.mtb-failure-title{font-size:15px;font-weight:600;margin-bottom:14px;letter-spacing:-.01em;line-height:1.45;color:var(--mtb-fg)}.mtb-failure-title:last-child{margin-bottom:0}.mtb-failure-actions{display:flex;align-items:center;justify-content:center}.mtb-failure-close{position:absolute;top:12px;right:12px;background:none;border:none;cursor:pointer;padding:3px;color:var(--mtb-clarify-close-fg);display:flex;transition:color .12s}.mtb-failure-close:hover{color:var(--mtb-clarify-close-hover-fg)}.mtb-pet{position:fixed;bottom:20px;right:20px;z-index:2147483646;cursor:pointer;width:52px;height:52px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:transparent;animation:mtbPetBounce 3s ease-in-out infinite;transition:transform .2s;user-select:none;outline:none;filter:drop-shadow(0 4px 12px rgba(var(--mtb-brand-rgb),.35))}.mtb-pet:hover{transform:scale(1.12);animation-play-state:paused}.mtb-pet:hover .mtb-pet-bubble{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet.active{animation:none;opacity:.6}.mtb-pet-svg{display:block}@keyframes mtbPetBounce{0%,to{transform:translateY(0)}50%{transform:translateY(-6px)}}.mtb-pet-bubble{position:absolute;bottom:100%;left:50%;transform:translate(-50%) translateY(4px);margin-bottom:8px;background:#064e3b;color:#fff;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:500;white-space:nowrap;box-shadow:0 4px 14px #0000002e;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}.mtb-pet-bubble.visible{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet-bubble.hidden{opacity:0;pointer-events:none}.mtb-pet-bubble:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-top-color:#064e3b}.mtb-frustration-prompt{position:fixed;bottom:20px;right:20px;z-index:2147483645;display:flex;align-items:center;gap:10px;padding:12px 16px;background:var(--mtb-panel-bg);border:1px solid var(--mtb-panel-border);border-radius:12px;color:var(--mtb-fg);box-shadow:0 8px 30px #0000001f;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-frustration-icon{width:32px;height:32px;border-radius:50%;background:#eab3081a;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:16px;line-height:1}.mtb-frustration-text{font-size:13px;font-weight:500;color:inherit;line-height:1.4}.mtb-frustration-actions{display:flex;gap:6px;flex-shrink:0}.mtb-frustration-tell{height:28px;padding:0 12px;border:none;border-radius:7px;background:var(--mtb-brand-primary);color:var(--mtb-brand-on-primary);cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-frustration-tell:hover{background:var(--mtb-brand-hover)}.mtb-frustration-tell:active{background:var(--mtb-brand-active)}.mtb-frustration-dismiss{height:28px;padding:0 8px;border:none;border-radius:7px;background:transparent;color:var(--mtb-dismiss-fg);cursor:pointer;font-family:inherit;font-size:12px;transition:color .12s}.mtb-frustration-dismiss:hover{color:var(--mtb-dismiss-hover-fg)}.mtb-record-bar{position:fixed;bottom:48px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:12px;height:42px;padding:0 8px 0 14px;border-radius:12px;background:#0f172aeb;box-shadow:0 8px 24px #00000040;animation:mtbBarIn .2s ease}.mtb-record-dot{width:8px;height:8px;border-radius:50%;background:#dc2626;animation:mtbRecordPulse 1.2s ease-in-out infinite;flex-shrink:0}@keyframes mtbRecordPulse{0%,to{opacity:1}50%{opacity:.3}}.mtb-record-timer{font-family:JetBrains Mono,SF Mono,Fira Code,Cascadia Code,monospace;font-size:13px;font-weight:500;color:#fff;font-variant-numeric:tabular-nums;letter-spacing:.02em;min-width:38px}.mtb-record-stop{height:28px;padding:0 14px;border:none;border-radius:7px;background:var(--mtb-brand-primary);color:var(--mtb-brand-on-primary);cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-record-stop:hover{background:var(--mtb-brand-hover)}.mtb-record-stop:active{background:var(--mtb-brand-active)}.mtb-click-ripple{position:fixed;z-index:2147483644;width:24px;height:24px;border-radius:50%;border:2px solid var(--mtb-brand-emphasis);background:rgba(var(--mtb-brand-emphasis-rgb),.25);pointer-events:none;transform:translate(-50%,-50%) scale(.5);animation:mtbClickRipple .3s ease-out forwards}@keyframes mtbClickRipple{0%{transform:translate(-50%,-50%) scale(.5);opacity:1}to{transform:translate(-50%,-50%) scale(2);opacity:0}}@keyframes mtbDot{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}.mtb-clarify-retry{flex:1;height:30px;display:inline-flex;align-items:center;justify-content:center;gap:5px;border:none;border-radius:8px;background:var(--mtb-brand-primary);color:var(--mtb-brand-on-primary);cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-clarify-retry:not(:disabled):hover{background:var(--mtb-brand-hover)}.mtb-clarify-retry:not(:disabled):active{background:var(--mtb-brand-active)}.mtb-clarify-retry:disabled{background:#00000026;cursor:not-allowed}@keyframes mtbSpin{to{transform:rotate(360deg)}}.mtb-dim-clickable{z-index:2147483643;pointer-events:auto;cursor:default;background:#0000001f}.mtb-draw-bar{position:fixed;bottom:48px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:8px;height:46px;padding:0 8px 0 12px;border-radius:13px;background:#fff;border:1px solid rgba(0,0,0,.08);box-shadow:0 10px 30px #0f172a38;animation:mtbBarIn .2s ease;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-draw-input{width:220px;height:32px;padding:0 10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;font-family:inherit;font-size:13px;color:#191a1c;outline:none;background:#fafafa;transition:border-color .12s,box-shadow .12s,background .12s}.mtb-draw-input:focus{border-color:var(--mtb-brand-emphasis);box-shadow:0 0 0 3px rgba(var(--mtb-brand-emphasis-rgb),.15);background:#fff}.mtb-draw-input::placeholder{color:#00000057}.mtb-draw-icon-btn{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:8px;background:transparent;color:#374151;cursor:pointer;transition:background .12s,color .12s}.mtb-draw-icon-btn:hover:not(:disabled){background:#0000000f}.mtb-draw-icon-btn:disabled{color:#00000038;cursor:default}.mtb-draw-shot{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:#0000008c;white-space:nowrap;cursor:default;user-select:none}.mtb-draw-shot input{width:14px;height:14px;margin:0;accent-color:var(--mtb-brand-primary);cursor:default}.mtb-draw-sep{width:1px;height:22px;background:#0000001a}.mtb-draw-cancel{height:32px;padding:0 12px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;color:#0000008c;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:550;transition:background .12s}.mtb-draw-cancel:hover{background:#0000000a}.mtb-draw-submit{height:32px;padding:0 14px;border:none;border-radius:8px;background:var(--mtb-brand-primary);color:var(--mtb-brand-on-primary);cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:600;transition:background .12s}.mtb-draw-submit:hover:not(:disabled){background:var(--mtb-brand-hover)}.mtb-draw-submit:active:not(:disabled){background:var(--mtb-brand-active)}.mtb-draw-submit:disabled{opacity:.6;cursor:default}.mtb-record-preview{margin-bottom:12px}.mtb-record-preview-stage{position:relative;width:100%;height:132px;border-radius:10px;overflow:hidden;background:#0f172a;display:flex;align-items:center;justify-content:center}.mtb-record-preview-stage.playing{align-items:flex-start;justify-content:flex-start}.mtb-record-preview-play{width:44px;height:44px;border-radius:50%;border:none;background:#ffffffeb;color:var(--mtb-brand-primary);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .12s,background .12s}.mtb-record-preview-play:hover:not(:disabled){transform:scale(1.06);background:#fff}.mtb-record-preview-play:disabled{cursor:default;opacity:.6}.mtb-record-preview-badge{position:absolute;right:8px;bottom:8px;padding:2px 7px;border-radius:6px;background:#0009;color:#fff;font-size:11px;font-variant-numeric:tabular-nums;font-family:JetBrains Mono,SF Mono,monospace}.mtb-record-preview-fallback{color:#ffffffd9;font-size:12px}.mtb-record-preview-name{display:block;margin-top:5px;font-size:11px;color:#0000006b}@media (pointer: coarse){.mtb-tab:after{content:"";position:absolute;inset:-6px 0 -6px -12px}.mtb-tab.left:after{inset:-6px -12px -6px 0}.mtb-toolbar{min-height:56px;border-radius:16px}.mtb-toolbar-mode-btn,.mtb-exit-btn{min-height:44px}.mtb-chat-input,.mtb-chat-email-input,.mtb-draw-input{font-size:16px}}@media (max-width: 480px){.mtb-tab{width:36px;height:40px;padding:0;font-size:0;writing-mode:horizontal-tb;border-radius:12px 0 0 12px;right:env(safe-area-inset-right,0px)}.mtb-tab.left{left:env(safe-area-inset-left,0px);border-radius:0 12px 12px 0}.mtb-tab:before{content:"";width:18px;height:18px;background:currentColor;-webkit-mask:var(--mtb-tab-icon) center / contain no-repeat;mask:var(--mtb-tab-icon) center / contain no-repeat}.mtb-toolbar{inset:0 0 auto;width:100%;max-width:none;max-height:none;transform:none;flex-direction:row;align-items:center;border-radius:0;gap:8px;justify-content:center;padding:env(safe-area-inset-top,0px) 8px 0;height:calc(44px + env(safe-area-inset-top,0px));min-height:calc(44px + env(safe-area-inset-top,0px));border-bottom:1px solid rgba(60,60,67,.16);background:#f8f8f8f5;box-shadow:0 1px 3px #00000014;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);animation:none}.mtb-toolbar-modes{flex-direction:row;gap:0;padding:2px;background:#7676801f;border-radius:8px}.mtb-toolbar-sep{display:none}.mtb-hint-bar{top:calc(44px + env(safe-area-inset-top,0px));right:0;bottom:0;left:0;transform:none;justify-content:center;height:auto;padding:0 24px;border-radius:0;background:#0000001a;box-shadow:none;animation:none;white-space:normal;text-align:center;transition:none}.mtb-hint-bar .mtb-toolbar-hint{max-width:280px;color:#fffffff5;font-size:17px;font-weight:600;line-height:1.4;letter-spacing:0;white-space:normal;text-shadow:0 1px 3px rgba(0,0,0,.45)}.mtb-toolbar-mode-btn,.mtb-exit-btn{position:relative;width:auto;height:32px;min-height:32px;gap:6px;border-radius:6px;padding-right:8px;padding-left:8px;color:#3c3c43d1;transition:none}.mtb-toolbar-mode-btn:hover{background:transparent;color:#3c3c43d1}.mtb-toolbar-mode-btn.active,.mtb-toolbar-mode-btn.active:hover{background:var(--mtb-brand-on-primary);color:var(--mtb-brand-hover);box-shadow:0 1px 3px #0000001f}.mtb-toolbar-mode-btn:after,.mtb-exit-btn:after{content:"";position:absolute;inset:-6px 0}.mtb-exit-btn{width:32px;padding:0;border-radius:50%;background:#7676801f}.mtb-exit-btn:hover{background:#7676801f;color:#3c3c43d1}.mtb-toolbar-label{display:inline}.mtb-exit-btn .mtb-toolbar-label{display:none}.mtb-draw-bar{left:0;right:0;bottom:0;transform:none;height:auto;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));border-radius:16px 16px 0 0}.mtb-frustration-prompt{left:0;right:0;bottom:0;flex-direction:column;align-items:stretch;gap:12px;padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px));border-radius:16px 16px 0 0;border-width:1px 0 0;animation:none}.mtb-frustration-actions{display:flex;gap:8px}.mtb-frustration-tell,.mtb-frustration-dismiss{flex:1;min-height:44px}.mtb-chat{position:fixed;left:0!important;right:0;bottom:0;top:auto!important;width:100%;max-width:none;max-height:85vh;border-radius:20px 20px 0 0;box-shadow:0 -18px 60px #0003;animation:none}.mtb-chat-handle{width:36px;height:4px;border-radius:99px;background:#0000001f;margin:0 auto;flex-shrink:0}.mtb-chat-header{flex-direction:column;align-items:center;gap:8px;border-radius:20px 20px 0 0;padding:10px 16px 12px}.mtb-chat-header-row{width:100%;display:flex;align-items:center}.mtb-chat-messages,.mtb-chat-quick-replies{padding:14px 16px 12px}.mtb-chat-qr{padding:8px 13px}.mtb-chat-suggestions{padding-left:45px}.mtb-chat-sg{padding:8px 13px;font-size:12px}.mtb-chat-composer{padding:10px 12px calc(10px + env(safe-area-inset-bottom,12px))}.mtb-chat-success{padding:30px 20px}.mtb-chat-success-simple{padding-top:36px;padding-bottom:calc(44px + env(safe-area-inset-bottom,0px))}.mtb-chat-email-card{margin-top:12px;padding:12px;gap:8px}}:host([data-mtb-theme="dark"]) .mtb-chat-handle{background:#fff3}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-chat-handle{background:#fff3}}@media (max-width: 480px){:host([data-mtb-theme="dark"]) .mtb-chat{box-shadow:0 -18px 60px #0000008c}}@media (max-width: 480px) and (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-chat{box-shadow:0 -18px 60px #0000008c}}.mtb-chat-handle{display:none}@media (max-width: 480px){.mtb-chat-handle{display:block}}`, y = "mtb-widget-host";
1
+ const Ee = `*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{all:initial;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:14px;line-height:1.5;color:#191a1c;-webkit-font-smoothing:antialiased}:host{--mtb-brand-primary: #059669;--mtb-brand-hover: #047857;--mtb-brand-active: #065f46;--mtb-brand-on-primary: #fff;--mtb-brand-rgb: 5, 150, 105;--mtb-brand-on-primary-rgb: 255, 255, 255;--mtb-brand-emphasis: #10b981;--mtb-brand-emphasis-rgb: 16, 185, 129;--mtb-brand-gradient-start: #10b981;--mtb-brand-gradient-end: #059669;--mtb-panel-bg: #fff;--mtb-panel-border: rgba(0, 0, 0, .1);--mtb-panel-divider: rgba(0, 0, 0, .06);--mtb-fg: #191a1c;--mtb-field-bg: #fff;--mtb-field-bg-subtle: #fafafa;--mtb-field-border: rgba(0, 0, 0, .12);--mtb-field-border-soft: rgba(0, 0, 0, .09);--mtb-placeholder-fg: rgba(0, 0, 0, .34);--mtb-action-bg: #fff;--mtb-action-border: rgba(0, 0, 0, .12);--mtb-action-fg: rgba(0, 0, 0, .55);--mtb-action-hover-bg: rgba(0, 0, 0, .04);--mtb-clarify-close-fg: rgba(0, 0, 0, .38);--mtb-clarify-close-hover-fg: rgba(0, 0, 0, .7);--mtb-dismiss-fg: rgba(0, 0, 0, .4);--mtb-dismiss-hover-fg: rgba(0, 0, 0, .7);--mtb-quick-hover-bg: rgba(var(--mtb-brand-emphasis-rgb), .06);--mtb-quick-hover-border: rgba(var(--mtb-brand-emphasis-rgb), .3);--mtb-quick-selected-bg: rgba(var(--mtb-brand-emphasis-rgb), .1);--mtb-quick-selected-border: rgba(var(--mtb-brand-emphasis-rgb), .5);--mtb-field-focus-border: var(--mtb-brand-emphasis);--mtb-chat-card-bg: #FFFFFF;--mtb-chat-card-shadow: 0 24px 64px rgba(0, 0, 0, .18);--mtb-chat-raised-bg: #F9FAFB;--mtb-chat-write-bg: #FFFFFF;--mtb-chat-title-fg: #111827;--mtb-chat-body-fg: #1f2937;--mtb-chat-muted-fg: #6b7280;--mtb-chat-placeholder-fg: #9ca3af;--mtb-chat-pill-fg: #374151;--mtb-chat-pill-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04);--mtb-chat-pill-hover-shadow: 0 3px 10px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .05);--mtb-chat-close-hover-bg: #F3F4F6;--mtb-chat-close-hover-fg: #111827;--mtb-chat-composer-shadow: 0 -1px 6px rgba(0, 0, 0, .06);--mtb-chat-skip-fg: #9ca3af;--mtb-chat-skip-hover-fg: #4b5563;--mtb-chat-camera-lens: #fff;--mtb-chat-accent: var(--mtb-brand-primary);--mtb-chat-accent-hover: var(--mtb-brand-hover);--mtb-chat-accent-fg: var(--mtb-brand-on-primary);--mtb-chat-accent-rgb: var(--mtb-brand-rgb);--mtb-chat-accent-fg-rgb: var(--mtb-brand-on-primary-rgb);--mtb-chat-link-fg: var(--mtb-brand-primary);--mtb-chat-send-shadow: 0 2px 8px rgba(var(--mtb-chat-accent-rgb), .35);--mtb-chat-success-icon-shadow: 0 4px 14px rgba(var(--mtb-chat-accent-rgb), .35);--mtb-chat-danger: #EF4444;--mtb-chat-logo-start: #10b981;--mtb-chat-logo-end: #059669;--mtb-chat-logo-fg: #fff}:host([data-mtb-theme="dark"]){--mtb-panel-bg: #151719;--mtb-panel-border: rgba(255, 255, 255, .12);--mtb-panel-divider: rgba(255, 255, 255, .1);--mtb-fg: #f9fafb;--mtb-field-bg: #1f2327;--mtb-field-bg-subtle: #1f2327;--mtb-field-border: rgba(255, 255, 255, .12);--mtb-field-border-soft: rgba(255, 255, 255, .12);--mtb-placeholder-fg: rgba(255, 255, 255, .4);--mtb-action-bg: #1f2327;--mtb-action-border: rgba(255, 255, 255, .14);--mtb-action-fg: rgba(255, 255, 255, .7);--mtb-action-hover-bg: rgba(255, 255, 255, .06);--mtb-clarify-close-fg: rgba(255, 255, 255, .45);--mtb-clarify-close-hover-fg: rgba(255, 255, 255, .75);--mtb-dismiss-fg: rgba(255, 255, 255, .4);--mtb-dismiss-hover-fg: rgba(255, 255, 255, .7);--mtb-quick-hover-bg: rgba(var(--mtb-brand-emphasis-rgb), .12);--mtb-quick-hover-border: rgba(var(--mtb-brand-emphasis-rgb), .45);--mtb-quick-selected-bg: rgba(var(--mtb-brand-emphasis-rgb), .18);--mtb-quick-selected-border: var(--mtb-brand-primary);--mtb-field-focus-border: var(--mtb-brand-emphasis);--mtb-chat-card-bg: #17191C;--mtb-chat-card-shadow: 0 24px 64px rgba(0, 0, 0, .55);--mtb-chat-raised-bg: #202327;--mtb-chat-write-bg: #23272C;--mtb-chat-title-fg: #E8EAED;--mtb-chat-body-fg: #DCE0E4;--mtb-chat-muted-fg: #B0B6BD;--mtb-chat-placeholder-fg: #A3AAB2;--mtb-chat-pill-fg: #DDE1E5;--mtb-chat-pill-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);--mtb-chat-pill-hover-shadow: 0 4px 14px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .14);--mtb-chat-close-hover-bg: rgba(255, 255, 255, .08);--mtb-chat-close-hover-fg: #FFFFFF;--mtb-chat-composer-shadow: 0 -1px 6px rgba(0, 0, 0, .45);--mtb-chat-skip-fg: #A3AAB2;--mtb-chat-skip-hover-fg: #E8EAED;--mtb-chat-camera-lens: #EAF7EE;--mtb-chat-accent: #4ADE80;--mtb-chat-accent-hover: #34D399;--mtb-chat-accent-fg: #0D1210;--mtb-chat-accent-rgb: 74, 222, 128;--mtb-chat-accent-fg-rgb: 13, 18, 16;--mtb-chat-link-fg: #5BD98A;--mtb-chat-send-shadow: 0 1px 3px rgba(0, 0, 0, .5);--mtb-chat-success-icon-shadow: 0 2px 10px rgba(0, 0, 0, .5);--mtb-chat-danger: #F87171;--mtb-chat-logo-start: #1E9E4A;--mtb-chat-logo-end: #0B8AA0;--mtb-chat-logo-fg: #EAF7EE}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]){--mtb-panel-bg: #151719;--mtb-panel-border: rgba(255, 255, 255, .12);--mtb-panel-divider: rgba(255, 255, 255, .1);--mtb-fg: #f9fafb;--mtb-field-bg: #1f2327;--mtb-field-bg-subtle: #1f2327;--mtb-field-border: rgba(255, 255, 255, .12);--mtb-field-border-soft: rgba(255, 255, 255, .12);--mtb-placeholder-fg: rgba(255, 255, 255, .4);--mtb-action-bg: #1f2327;--mtb-action-border: rgba(255, 255, 255, .14);--mtb-action-fg: rgba(255, 255, 255, .7);--mtb-action-hover-bg: rgba(255, 255, 255, .06);--mtb-clarify-close-fg: rgba(255, 255, 255, .45);--mtb-clarify-close-hover-fg: rgba(255, 255, 255, .75);--mtb-dismiss-fg: rgba(255, 255, 255, .4);--mtb-dismiss-hover-fg: rgba(255, 255, 255, .7);--mtb-quick-hover-bg: rgba(var(--mtb-brand-emphasis-rgb), .12);--mtb-quick-hover-border: rgba(var(--mtb-brand-emphasis-rgb), .45);--mtb-quick-selected-bg: rgba(var(--mtb-brand-emphasis-rgb), .18);--mtb-quick-selected-border: var(--mtb-brand-primary);--mtb-field-focus-border: var(--mtb-brand-emphasis);--mtb-chat-card-bg: #17191C;--mtb-chat-card-shadow: 0 24px 64px rgba(0, 0, 0, .55);--mtb-chat-raised-bg: #202327;--mtb-chat-write-bg: #23272C;--mtb-chat-title-fg: #E8EAED;--mtb-chat-body-fg: #DCE0E4;--mtb-chat-muted-fg: #B0B6BD;--mtb-chat-placeholder-fg: #A3AAB2;--mtb-chat-pill-fg: #DDE1E5;--mtb-chat-pill-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);--mtb-chat-pill-hover-shadow: 0 4px 14px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .14);--mtb-chat-close-hover-bg: rgba(255, 255, 255, .08);--mtb-chat-close-hover-fg: #FFFFFF;--mtb-chat-composer-shadow: 0 -1px 6px rgba(0, 0, 0, .45);--mtb-chat-skip-fg: #A3AAB2;--mtb-chat-skip-hover-fg: #E8EAED;--mtb-chat-camera-lens: #EAF7EE;--mtb-chat-accent: #4ADE80;--mtb-chat-accent-hover: #34D399;--mtb-chat-accent-fg: #0D1210;--mtb-chat-accent-rgb: 74, 222, 128;--mtb-chat-accent-fg-rgb: 13, 18, 16;--mtb-chat-link-fg: #5BD98A;--mtb-chat-send-shadow: 0 1px 3px rgba(0, 0, 0, .5);--mtb-chat-success-icon-shadow: 0 2px 10px rgba(0, 0, 0, .5);--mtb-chat-danger: #F87171;--mtb-chat-logo-start: #1E9E4A;--mtb-chat-logo-end: #0B8AA0;--mtb-chat-logo-fg: #EAF7EE}}.mtb-tab{--mtb-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Ccircle cx='12' cy='12' r='2.4' fill='%23000' stroke='none'/%3E%3Cpath d='M12 1.8v3.4M12 18.8v3.4M1.8 12h3.4M18.8 12h3.4'/%3E%3C/svg%3E");--mtb-tab-bg: var(--mtb-brand-primary);--mtb-tab-hover-bg: var(--mtb-brand-hover);--mtb-tab-active-bg: var(--mtb-brand-active);--mtb-tab-shadow-color: var(--mtb-brand-rgb);--mtb-tab-fg: var(--mtb-brand-on-primary);position:fixed;top:50%;right:0;transform:translateY(-50%);z-index:2147483646;display:flex;align-items:center;justify-content:center;width:32px;padding:14px 0;background:var(--mtb-tab-bg);color:var(--mtb-tab-fg);border-radius:8px 0 0 8px;cursor:pointer;box-shadow:-2px 0 14px rgba(var(--mtb-tab-shadow-color),.35);transition:background .15s,box-shadow .15s,width .15s;writing-mode:vertical-lr;text-orientation:mixed;font-size:12px;font-weight:600;letter-spacing:.04em;user-select:none;border:none;outline:none}.mtb-tab.left{right:auto;left:0;border-radius:0 8px 8px 0;box-shadow:2px 0 14px rgba(var(--mtb-tab-shadow-color),.35)}.mtb-tab:hover{background:var(--mtb-tab-hover-bg);box-shadow:-3px 0 20px rgba(var(--mtb-tab-shadow-color),.45)}.mtb-tab.active{background:var(--mtb-tab-active-bg)}.mtb-hint-bar{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;height:38px;padding:0 16px;border-radius:13px;background:linear-gradient(120deg,var(--mtb-brand-gradient-start),var(--mtb-brand-gradient-end));color:var(--mtb-brand-on-primary);box-shadow:0 10px 26px #0f172a38;animation:mtbHintIn .2s ease;white-space:nowrap;transition:opacity .15s ease;pointer-events:none}.mtb-hint-bar--under-pointer{opacity:.3}.mtb-hint-bar.mtb-hint-bar--dismissed{display:none}@keyframes mtbHintIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}.mtb-toolbar{position:fixed;top:50%;right:8px;transform:translateY(-50%);z-index:2147483647;display:flex;flex-direction:column;align-items:center;gap:6px;width:38px;padding:6px 0;max-height:calc(100vh - 24px);border-radius:19px;background:linear-gradient(160deg,var(--mtb-brand-gradient-start),var(--mtb-brand-gradient-end));color:var(--mtb-brand-on-primary);box-shadow:0 8px 22px #0f172a33;animation:mtbEdgeBarIn .2s ease;white-space:nowrap;pointer-events:none}.mtb-toolbar.left{right:auto;left:8px;animation:mtbEdgeBarInLeft .2s ease}@keyframes mtbBarIn{0%{transform:translate(-50%,12px);opacity:0}to{transform:translate(-50%);opacity:1}}@keyframes mtbEdgeBarIn{0%{transform:translate(12px,-50%);opacity:0}to{transform:translateY(-50%);opacity:1}}@keyframes mtbEdgeBarInLeft{0%{transform:translate(-12px,-50%);opacity:0}to{transform:translateY(-50%);opacity:1}}.mtb-toolbar-label{display:none}:host([data-mtb-toolbar]) .mtb-tab{display:none}.mtb-toolbar-modes{display:flex;align-items:center;gap:3px;background:rgba(var(--mtb-brand-on-primary-rgb),.16);border-radius:9px;padding:3px}.mtb-toolbar-mode-btn{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border-radius:7px;border:none;cursor:pointer;font-family:inherit;font-size:12px;font-weight:550;white-space:nowrap;background:transparent;color:var(--mtb-brand-on-primary);transition:all .12s}.mtb-toolbar-mode-btn.active{background:#fff;color:var(--mtb-brand-active)}.mtb-toolbar-hint{font-size:12px;color:var(--mtb-brand-on-primary);white-space:nowrap}.mtb-toolbar-sep{width:20px;height:1px;align-self:center;background:rgba(var(--mtb-brand-on-primary-rgb),.22)}.mtb-exit-btn{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 12px;border-radius:8px;font-size:11.5px;font-weight:500;color:var(--mtb-brand-on-primary);cursor:pointer;background:rgba(var(--mtb-brand-on-primary-rgb),.16);border:none;font-family:inherit;transition:background .12s}.mtb-toolbar-modes{flex-direction:column;gap:6px;padding:0;background:none;border-radius:0}.mtb-toolbar-mode-btn,.mtb-exit-btn{pointer-events:auto;display:flex;align-items:center;justify-content:center;gap:0;width:30px;height:30px;padding:0;border-radius:50%;background:none;color:var(--mtb-brand-on-primary)}.mtb-toolbar-mode-btn{opacity:.72}.mtb-exit-btn{opacity:1}.mtb-toolbar-mode-btn:hover,.mtb-exit-btn:hover{background:rgba(var(--mtb-brand-on-primary-rgb),.16);color:var(--mtb-brand-on-primary);opacity:1}.mtb-toolbar-mode-btn.active,.mtb-toolbar-mode-btn.active:hover{background:var(--mtb-brand-on-primary);color:var(--mtb-brand-hover);opacity:1}.mtb-exit-btn{color:var(--mtb-brand-on-primary)}.mtb-toolbar-sep{width:16px;height:1px;margin:1px 0;align-self:center;background:rgba(var(--mtb-brand-on-primary-rgb),.28)}.mtb-exit-btn:hover{background:rgba(var(--mtb-brand-on-primary-rgb),.28)}.mtb-overlay{position:fixed;inset:0;z-index:2147483640;cursor:crosshair;touch-action:none}.mtb-dim{position:fixed;inset:0;z-index:2147483639;background:#00000014}.mtb-highlight{position:fixed;z-index:2147483641;pointer-events:none;border:2px solid var(--mtb-brand-emphasis);border-radius:6px;background:rgba(var(--mtb-brand-emphasis-rgb),.06);transition:all .08s ease}.mtb-highlight-tooltip{position:fixed;z-index:2147483642;pointer-events:none;transform:translate(-50%,-100%);max-width:240px;overflow:hidden;text-overflow:ellipsis;background:var(--mtb-brand-active);color:var(--mtb-brand-on-primary);padding:4px 10px;border-radius:6px;font-size:11px;font-weight:500;white-space:nowrap;box-shadow:0 4px 12px #0000002e;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-highlight-tooltip.below{transform:translate(-50%)}.mtb-highlight-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:var(--mtb-brand-active)}.mtb-highlight-tooltip.below:after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:var(--mtb-brand-active)}.mtb-draw-svg{position:fixed;inset:0;z-index:2147483643;pointer-events:none;width:100%;height:100%;overflow:visible}.mtb-pin{position:fixed;z-index:2147483644;pointer-events:none;width:22px;height:22px;border-radius:50% 50% 50% 2px;background:var(--mtb-brand-primary);border:2px solid #fff;display:flex;align-items:center;justify-content:center;font-size:10px;color:var(--mtb-brand-on-primary);font-weight:700;box-shadow:0 0 0 1px #0f172aad,0 2px 8px rgba(var(--mtb-brand-rgb),.45);animation:mtbPinPop .25s cubic-bezier(.34,1.56,.64,1);transform:translate(-50%,-50%)}@keyframes mtbPinPop{0%{transform:translate(-50%,-50%) scale(.4)}to{transform:translate(-50%,-50%) scale(1)}}@keyframes mtbSlideUp{0%{transform:translateY(14px) scale(.97);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.mtb-draw-shot input:disabled{appearance:none;-webkit-appearance:none;border:none;border-radius:4px;background-color:var(--mtb-placeholder-fg);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center;background-size:contain;opacity:1}.mtb-draw-shot input:disabled{background-color:#0000004d}.mtb-btn-loading{pointer-events:none;opacity:.8}.mtb-btn-loading:after{content:"";display:inline-block;width:10px;height:10px;margin-left:6px;border:1.5px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:mtbSpin .7s linear infinite;vertical-align:middle}.mtb-chat{position:fixed;z-index:2147483645;display:flex;flex-direction:column;width:min(320px,calc(100vw - 56px));max-height:420px;background:var(--mtb-chat-card-bg);border-radius:16px;color:var(--mtb-chat-title-fg);box-shadow:var(--mtb-chat-card-shadow);overflow:hidden;animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-chat.mtb-chat-receipt{inset:auto 20px 20px auto;width:min(320px,calc(100vw - 40px));animation:none}.mtb-chat-header{display:flex;align-items:center;gap:7px;padding:11px 12px;background:var(--mtb-chat-raised-bg);flex-shrink:0}.mtb-chat-brand{display:flex;align-items:center;gap:7px;text-decoration:none;opacity:.9;transition:opacity .16s}.mtb-chat-brand:hover{opacity:1}.mtb-chat-brand:hover .mtb-chat-brand-name{text-decoration:underline;text-underline-offset:2px}.mtb-chat-logo{width:20px;height:20px;border-radius:6px;overflow:hidden;flex:none}.mtb-chat-logo svg{width:100%;height:100%;display:block}.mtb-chat-brand-name{font-size:12px;font-weight:600;color:var(--mtb-chat-title-fg)}.mtb-chat-header-row{display:flex;align-items:center;gap:7px;width:100%}.mtb-chat-header-gap{flex:1}.mtb-chat-close{width:28px;height:28px;border-radius:99px;display:flex;align-items:center;justify-content:center;background:none;border:none;padding:0;color:var(--mtb-chat-muted-fg);cursor:pointer;flex:none;transition:background .16s,color .16s}.mtb-chat-close:hover{background:var(--mtb-chat-close-hover-bg);color:var(--mtb-chat-close-hover-fg)}.mtb-chat-messages{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px;min-height:0;background:var(--mtb-chat-card-bg)}.mtb-chat-messages:empty{display:none}.mtb-chat-bubble{font-size:13px;max-width:85%;word-break:break-word}.mtb-chat-bubble-user{align-self:flex-end;background:var(--mtb-chat-accent);color:var(--mtb-chat-accent-fg);line-height:1.45;padding:8px 11px;border-radius:12px 12px 4px}.mtb-chat-bubble-ai{background:var(--mtb-chat-raised-bg);color:var(--mtb-chat-body-fg);line-height:1.5;padding:9px 12px;border-radius:12px 12px 12px 4px}.mtb-chat-ai-row{display:flex;align-items:flex-end;gap:7px}.mtb-chat-avatar{width:22px;height:22px;border-radius:7px;overflow:hidden;flex:none}.mtb-chat-avatar svg{width:100%;height:100%;display:block}.mtb-chat-dots{display:flex;align-items:center;gap:4px;padding:10px 12px;background:var(--mtb-chat-raised-bg);border-radius:12px 12px 12px 4px}.mtb-chat-dots span{width:5px;height:5px;background:var(--mtb-chat-accent);border-radius:99px;animation:mtbChatDot 1.1s infinite}.mtb-chat-dots span:nth-child(2){animation-delay:.15s}.mtb-chat-dots span:nth-child(3){animation-delay:.3s}@keyframes mtbChatDot{0%,60%,to{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1}}.mtb-chat-suggestions{display:flex;flex-wrap:wrap;gap:6px;padding-left:29px}.mtb-chat-sg{background:var(--mtb-chat-write-bg);border:none;border-radius:99px;padding:5px 10px;font-size:11px;font-weight:500;font-family:inherit;color:var(--mtb-chat-pill-fg);cursor:pointer;box-shadow:var(--mtb-chat-pill-shadow);transition:box-shadow .16s,transform .16s}.mtb-chat-sg:hover{box-shadow:var(--mtb-chat-pill-hover-shadow);transform:translateY(-1px)}.mtb-chat-quick-replies{display:flex;flex-wrap:wrap;gap:6px;padding:12px;background:var(--mtb-chat-card-bg)}.mtb-chat-qr{display:flex;align-items:center;gap:5px;background:var(--mtb-chat-write-bg);border:none;border-radius:99px;padding:7px 12px;font-size:12px;font-weight:500;font-family:inherit;color:var(--mtb-chat-pill-fg);cursor:pointer;box-shadow:var(--mtb-chat-pill-shadow);transition:box-shadow .16s,transform .16s}.mtb-chat-qr:hover{box-shadow:var(--mtb-chat-pill-hover-shadow);transform:translateY(-1px)}.mtb-chat-qr:disabled{opacity:.5;pointer-events:none;cursor:default;transform:none!important;box-shadow:var(--mtb-chat-pill-shadow)!important}.mtb-chat-composer{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--mtb-chat-raised-bg);box-shadow:var(--mtb-chat-composer-shadow);flex-shrink:0}.mtb-chat-composer-disabled{pointer-events:none}.mtb-chat-composer-disabled .mtb-chat-input{opacity:.3}.mtb-chat-input{box-sizing:border-box;width:100%;min-height:64px;max-height:132px;padding:10px 12px;background:var(--mtb-chat-write-bg);border:none;border-radius:10px;font-size:13px;line-height:1.5;font-family:inherit;color:var(--mtb-chat-title-fg);outline:none;resize:none}.mtb-chat-input::placeholder{color:var(--mtb-chat-placeholder-fg)}.mtb-chat-input:disabled{opacity:.5;cursor:default}.mtb-chat-actions{display:flex;align-items:center;gap:10px}.mtb-chat-actions-gap{flex:1}.mtb-chat-screenshot,.mtb-chat-attachment{display:flex;align-items:center;gap:6px;background:none;border:none;padding:0;font-family:inherit;color:var(--mtb-chat-accent);cursor:pointer;transition:opacity .16s}.mtb-chat-screenshot svg,.mtb-chat-attachment svg{display:flex;flex:none}.mtb-chat-icon-lens{fill:var(--mtb-chat-camera-lens)}.mtb-chat-screenshot:hover{opacity:.75}.mtb-chat-attachment{cursor:default}.mtb-chat-capture-label{font-size:11px;color:var(--mtb-chat-muted-fg)}.mtb-chat-screenshot[aria-pressed=false],.mtb-chat-screenshot-off{opacity:.4;color:var(--mtb-chat-muted-fg)}.mtb-chat-screenshot:disabled{opacity:.3;pointer-events:none;cursor:default}.mtb-chat-skip{height:26px;border:none;border-radius:6px;background:none;display:flex;align-items:center;padding:0 4px;font-size:11px;font-weight:500;font-family:inherit;color:var(--mtb-chat-skip-fg);cursor:pointer;flex:none;transition:color .16s}.mtb-chat-skip:hover{color:var(--mtb-chat-skip-hover-fg)}.mtb-chat-send{position:relative;height:34px;padding:0 14px;border:none;border-radius:10px;background:var(--mtb-chat-accent);font-size:12px;font-weight:600;font-family:inherit;color:var(--mtb-chat-accent-fg);display:flex;align-items:center;justify-content:center;flex:none;cursor:pointer;box-shadow:var(--mtb-chat-send-shadow)}.mtb-chat-send:disabled{opacity:.3;box-shadow:none;cursor:default}.mtb-chat-error-row{display:flex;align-items:center;justify-content:center;gap:8px;padding:4px 0}.mtb-chat-error-text{font-size:11px;color:var(--mtb-danger, #ef4444)}.mtb-chat-error-retry{font-size:11px;font-weight:600;font-family:inherit;color:var(--mtb-chat-pill-fg);background:var(--mtb-chat-write-bg);border:none;border-radius:999px;padding:4px 11px;box-shadow:var(--mtb-chat-pill-shadow);cursor:pointer}.mtb-chat-error-retry:hover{box-shadow:var(--mtb-chat-pill-hover-shadow)}.mtb-chat-success{padding:30px 20px 26px;display:flex;flex-direction:column;align-items:center;gap:10px;background:var(--mtb-chat-card-bg);animation:mtbSlideUp .28s cubic-bezier(.34,1.56,.64,1) both}.mtb-chat-success-simple{padding-top:34px;padding-bottom:22px}.mtb-chat-success-icon{width:40px;height:40px;border-radius:99px;background:var(--mtb-chat-accent);color:var(--mtb-chat-accent-fg);display:flex;align-items:center;justify-content:center;box-shadow:var(--mtb-chat-success-icon-shadow)}.mtb-chat-success-title{font-size:15px;font-weight:600;color:var(--mtb-chat-title-fg);margin-top:2px;text-align:center}.mtb-chat-finalize-failure .mtb-chat-failure-icon{background:#ef44441a;color:var(--mtb-chat-danger, #ef4444);box-shadow:none;font-size:20px;font-weight:700}.mtb-chat-finalize-failure{padding:26px 24px;gap:8px}.mtb-chat-finalize-message{color:var(--mtb-chat-muted-fg);font-size:12px;line-height:1.5;text-align:center}.mtb-chat-finalize-retry{margin-top:12px;width:100%;height:34px;border:none;border-radius:10px;background:var(--mtb-chat-accent);box-shadow:var(--mtb-chat-send-shadow);color:var(--mtb-chat-accent-fg);cursor:pointer;font-family:inherit;font-size:12px;font-weight:600}.mtb-chat-finalize-retry:hover:not(:disabled){background:var(--mtb-chat-accent-hover)}.mtb-chat-finalize-retry:disabled{cursor:wait;opacity:.8}.mtb-chat-finalize-spinner{width:14px;height:14px;display:inline-block;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:mtbSpin .7s linear infinite}.mtb-chat-finalize-close{margin-top:8px;padding:0;border:0;background:transparent;color:var(--mtb-chat-muted-fg);cursor:pointer;font-family:inherit;font-size:12px;font-weight:500}.mtb-chat-finalize-close:hover{color:var(--mtb-chat-title-fg)}.mtb-chat-success-link{display:inline-flex;align-items:center;font-size:12px;font-weight:500;color:var(--mtb-chat-link-fg);text-decoration:none;margin-top:4px;cursor:pointer}.mtb-chat-success-link-pending{color:var(--mtb-chat-muted-fg);cursor:default;pointer-events:none}.mtb-chat-email-card{align-self:stretch;margin-top:10px;background:var(--mtb-chat-raised-bg);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:7px}.mtb-chat-email-row{display:flex;align-items:center;gap:7px}.mtb-chat-email-field{flex:1;background:var(--mtb-chat-write-bg);border-radius:8px;box-sizing:border-box;min-height:40px;display:flex;align-items:center;padding:0 10px;min-width:0}.mtb-chat-email-input{flex:1;min-width:0;background:none;border:none;outline:none;font-size:12px;font-family:inherit;color:var(--mtb-chat-title-fg)}.mtb-chat-email-input::placeholder{color:var(--mtb-chat-placeholder-fg)}.mtb-chat-email-submit{height:30px;padding:0 10px;border:none;border-radius:8px;background:var(--mtb-chat-accent);font-size:11px;font-weight:600;font-family:inherit;color:var(--mtb-chat-accent-fg);display:flex;align-items:center;justify-content:center;flex:none;cursor:pointer}.mtb-chat-email-submit:disabled{opacity:.3;cursor:default}.mtb-chat-email-note{font-size:12px;color:var(--mtb-chat-muted-fg);text-align:center}.mtb-chat-email-error{font-size:11px;color:var(--mtb-danger, #ef4444);text-align:center}.mtb-pet{position:fixed;bottom:20px;right:20px;z-index:2147483646;cursor:pointer;width:52px;height:52px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:transparent;animation:mtbPetBounce 3s ease-in-out infinite;transition:transform .2s;user-select:none;outline:none;filter:drop-shadow(0 4px 12px rgba(var(--mtb-brand-rgb),.35))}.mtb-pet:hover{transform:scale(1.12);animation-play-state:paused}.mtb-pet:hover .mtb-pet-bubble{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet.active{animation:none;opacity:.6}.mtb-pet-svg{display:block}@keyframes mtbPetBounce{0%,to{transform:translateY(0)}50%{transform:translateY(-6px)}}.mtb-pet-bubble{position:absolute;bottom:100%;left:50%;transform:translate(-50%) translateY(4px);margin-bottom:8px;background:#064e3b;color:#fff;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:500;white-space:nowrap;box-shadow:0 4px 14px #0000002e;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}.mtb-pet-bubble.visible{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mtb-pet-bubble.hidden{opacity:0;pointer-events:none}.mtb-pet-bubble:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-top-color:#064e3b}.mtb-frustration-prompt{position:fixed;bottom:20px;right:20px;z-index:2147483645;display:flex;align-items:center;gap:10px;padding:12px 16px;background:var(--mtb-panel-bg);border:1px solid var(--mtb-panel-border);border-radius:12px;color:var(--mtb-fg);box-shadow:0 8px 30px #0000001f;animation:mtbSlideUp .35s cubic-bezier(.34,1.56,.64,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-frustration-icon{width:32px;height:32px;border-radius:50%;background:#eab3081a;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:16px;line-height:1}.mtb-frustration-text{font-size:13px;font-weight:500;color:inherit;line-height:1.4}.mtb-frustration-actions{display:flex;gap:6px;flex-shrink:0}.mtb-frustration-tell{height:28px;padding:0 12px;border:none;border-radius:7px;background:var(--mtb-brand-primary);color:var(--mtb-brand-on-primary);cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-frustration-tell:hover{background:var(--mtb-brand-hover)}.mtb-frustration-tell:active{background:var(--mtb-brand-active)}.mtb-frustration-dismiss{height:28px;padding:0 8px;border:none;border-radius:7px;background:transparent;color:var(--mtb-dismiss-fg);cursor:pointer;font-family:inherit;font-size:12px;transition:color .12s}.mtb-frustration-dismiss:hover{color:var(--mtb-dismiss-hover-fg)}.mtb-record-bar{position:fixed;bottom:48px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:12px;height:42px;padding:0 8px 0 14px;border-radius:12px;background:#0f172aeb;box-shadow:0 8px 24px #00000040;animation:mtbBarIn .2s ease}.mtb-record-dot{width:8px;height:8px;border-radius:50%;background:#dc2626;animation:mtbRecordPulse 1.2s ease-in-out infinite;flex-shrink:0}@keyframes mtbRecordPulse{0%,to{opacity:1}50%{opacity:.3}}.mtb-record-timer{font-family:JetBrains Mono,SF Mono,Fira Code,Cascadia Code,monospace;font-size:13px;font-weight:500;color:#fff;font-variant-numeric:tabular-nums;letter-spacing:.02em;min-width:38px}.mtb-record-stop{height:28px;padding:0 14px;border:none;border-radius:7px;background:var(--mtb-brand-primary);color:var(--mtb-brand-on-primary);cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-record-stop:hover{background:var(--mtb-brand-hover)}.mtb-record-stop:active{background:var(--mtb-brand-active)}.mtb-click-ripple{position:fixed;z-index:2147483644;width:24px;height:24px;border-radius:50%;border:2px solid var(--mtb-brand-emphasis);background:rgba(var(--mtb-brand-emphasis-rgb),.25);pointer-events:none;transform:translate(-50%,-50%) scale(.5);animation:mtbClickRipple .3s ease-out forwards}@keyframes mtbClickRipple{0%{transform:translate(-50%,-50%) scale(.5);opacity:1}to{transform:translate(-50%,-50%) scale(2);opacity:0}}@keyframes mtbDot{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}.mtb-clarify-retry{flex:1;height:30px;display:inline-flex;align-items:center;justify-content:center;gap:5px;border:none;border-radius:8px;background:var(--mtb-brand-primary);color:var(--mtb-brand-on-primary);cursor:pointer;font-family:inherit;font-size:12px;font-weight:600;transition:background .12s}.mtb-clarify-retry:not(:disabled):hover{background:var(--mtb-brand-hover)}.mtb-clarify-retry:not(:disabled):active{background:var(--mtb-brand-active)}.mtb-clarify-retry:disabled{background:#00000026;cursor:not-allowed}@keyframes mtbSpin{to{transform:rotate(360deg)}}.mtb-dim-clickable{z-index:2147483643;pointer-events:auto;cursor:default;background:#0000001f}.mtb-draw-bar{position:fixed;bottom:48px;left:50%;transform:translate(-50%);z-index:2147483647;display:flex;align-items:center;gap:8px;height:46px;padding:0 8px 0 12px;border-radius:13px;background:#fff;border:1px solid rgba(0,0,0,.08);box-shadow:0 10px 30px #0f172a38;animation:mtbBarIn .2s ease;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}.mtb-draw-input{width:220px;height:32px;padding:0 10px;border:1px solid rgba(0,0,0,.12);border-radius:8px;font-family:inherit;font-size:13px;color:#191a1c;outline:none;background:#fafafa;transition:border-color .12s,box-shadow .12s,background .12s}.mtb-draw-input:focus{border-color:var(--mtb-brand-emphasis);box-shadow:0 0 0 3px rgba(var(--mtb-brand-emphasis-rgb),.15);background:#fff}.mtb-draw-input::placeholder{color:#00000057}.mtb-draw-icon-btn{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:8px;background:transparent;color:#374151;cursor:pointer;transition:background .12s,color .12s}.mtb-draw-icon-btn:hover:not(:disabled){background:#0000000f}.mtb-draw-icon-btn:disabled{color:#00000038;cursor:default}.mtb-draw-shot{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:#0000008c;white-space:nowrap;cursor:default;user-select:none}.mtb-draw-shot input{width:14px;height:14px;margin:0;accent-color:var(--mtb-brand-primary);cursor:default}.mtb-draw-sep{width:1px;height:22px;background:#0000001a}.mtb-draw-cancel{height:32px;padding:0 12px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;color:#0000008c;cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:550;transition:background .12s}.mtb-draw-cancel:hover{background:#0000000a}.mtb-draw-submit{height:32px;padding:0 14px;border:none;border-radius:8px;background:var(--mtb-brand-primary);color:var(--mtb-brand-on-primary);cursor:pointer;font-family:inherit;font-size:12.5px;font-weight:600;transition:background .12s}.mtb-draw-submit:hover:not(:disabled){background:var(--mtb-brand-hover)}.mtb-draw-submit:active:not(:disabled){background:var(--mtb-brand-active)}.mtb-draw-submit:disabled{opacity:.6;cursor:default}.mtb-record-preview{margin-bottom:12px}.mtb-record-preview-stage{position:relative;width:100%;height:132px;border-radius:10px;overflow:hidden;background:#0f172a;display:flex;align-items:center;justify-content:center}.mtb-record-preview-stage.playing{align-items:flex-start;justify-content:flex-start}.mtb-record-preview-play{width:44px;height:44px;border-radius:50%;border:none;background:#ffffffeb;color:var(--mtb-brand-primary);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .12s,background .12s}.mtb-record-preview-play:hover:not(:disabled){transform:scale(1.06);background:#fff}.mtb-record-preview-play:disabled{cursor:default;opacity:.6}.mtb-record-preview-badge{position:absolute;right:8px;bottom:8px;padding:2px 7px;border-radius:6px;background:#0009;color:#fff;font-size:11px;font-variant-numeric:tabular-nums;font-family:JetBrains Mono,SF Mono,monospace}.mtb-record-preview-fallback{color:#ffffffd9;font-size:12px}.mtb-record-preview-name{display:block;margin-top:5px;font-size:11px;color:#0000006b}@media (pointer: coarse){.mtb-tab:after{content:"";position:absolute;inset:-6px 0 -6px -12px}.mtb-tab.left:after{inset:-6px -12px -6px 0}.mtb-toolbar{min-height:56px;border-radius:16px}.mtb-toolbar-mode-btn,.mtb-exit-btn{min-height:44px}.mtb-chat-input,.mtb-chat-email-input,.mtb-draw-input{font-size:16px}}@media (max-width: 480px){.mtb-tab{width:36px;height:40px;padding:0;font-size:0;writing-mode:horizontal-tb;border-radius:12px 0 0 12px;right:env(safe-area-inset-right,0px)}.mtb-tab.left{left:env(safe-area-inset-left,0px);border-radius:0 12px 12px 0}.mtb-tab:before{content:"";width:18px;height:18px;background:currentColor;-webkit-mask:var(--mtb-tab-icon) center / contain no-repeat;mask:var(--mtb-tab-icon) center / contain no-repeat}.mtb-toolbar{inset:0 0 auto;width:100%;max-width:none;max-height:none;transform:none;flex-direction:row;align-items:center;border-radius:0;gap:8px;justify-content:center;padding:env(safe-area-inset-top,0px) 8px 0;height:calc(44px + env(safe-area-inset-top,0px));min-height:calc(44px + env(safe-area-inset-top,0px));border-bottom:1px solid rgba(60,60,67,.16);background:#f8f8f8f5;box-shadow:0 1px 3px #00000014;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);animation:none}.mtb-toolbar-modes{flex-direction:row;gap:0;padding:2px;background:#7676801f;border-radius:8px}.mtb-toolbar-sep{display:none}.mtb-hint-bar{top:calc(44px + env(safe-area-inset-top,0px));right:0;bottom:0;left:0;transform:none;justify-content:center;height:auto;padding:0 24px;border-radius:0;background:#0000001a;box-shadow:none;animation:none;white-space:normal;text-align:center;transition:none}.mtb-hint-bar .mtb-toolbar-hint{max-width:280px;color:#fffffff5;font-size:17px;font-weight:600;line-height:1.4;letter-spacing:0;white-space:normal;text-shadow:0 1px 3px rgba(0,0,0,.45)}.mtb-toolbar-mode-btn,.mtb-exit-btn{position:relative;width:auto;height:32px;min-height:32px;gap:6px;border-radius:6px;padding-right:8px;padding-left:8px;color:#3c3c43d1;transition:none}.mtb-toolbar-mode-btn:hover{background:transparent;color:#3c3c43d1}.mtb-toolbar-mode-btn.active,.mtb-toolbar-mode-btn.active:hover{background:var(--mtb-brand-on-primary);color:var(--mtb-brand-hover);box-shadow:0 1px 3px #0000001f}.mtb-toolbar-mode-btn:after,.mtb-exit-btn:after{content:"";position:absolute;inset:-6px 0}.mtb-exit-btn{width:32px;padding:0;border-radius:50%;background:#7676801f}.mtb-exit-btn:hover{background:#7676801f;color:#3c3c43d1}.mtb-toolbar-label{display:inline}.mtb-exit-btn .mtb-toolbar-label{display:none}.mtb-draw-bar{left:0;right:0;bottom:0;transform:none;height:auto;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));border-radius:16px 16px 0 0}.mtb-frustration-prompt{left:0;right:0;bottom:0;flex-direction:column;align-items:stretch;gap:12px;padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px));border-radius:16px 16px 0 0;border-width:1px 0 0;animation:none}.mtb-frustration-actions{display:flex;gap:8px}.mtb-frustration-tell,.mtb-frustration-dismiss{flex:1;min-height:44px}.mtb-chat{position:fixed;left:0!important;right:0;bottom:0;top:auto!important;width:100%;max-width:none;max-height:85vh;border-radius:20px 20px 0 0;box-shadow:0 -18px 60px #0003;animation:none}.mtb-chat-handle{width:36px;height:4px;border-radius:99px;background:#0000001f;margin:0 auto;flex-shrink:0}.mtb-chat-header{flex-direction:column;align-items:center;gap:8px;border-radius:20px 20px 0 0;padding:10px 16px 12px}.mtb-chat-header-row{width:100%;display:flex;align-items:center}.mtb-chat-messages,.mtb-chat-quick-replies{padding:14px 16px 12px}.mtb-chat-qr{padding:8px 13px}.mtb-chat-suggestions{padding-left:45px}.mtb-chat-sg{padding:8px 13px;font-size:12px}.mtb-chat-composer{padding:10px 12px calc(10px + env(safe-area-inset-bottom,12px))}.mtb-chat-success{padding:30px 20px}.mtb-chat-success-simple{padding-top:36px;padding-bottom:calc(44px + env(safe-area-inset-bottom,0px))}.mtb-chat-email-card{margin-top:12px;padding:12px;gap:8px}}:host([data-mtb-theme="dark"]) .mtb-chat-handle{background:#fff3}@media (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-chat-handle{background:#fff3}}@media (max-width: 480px){:host([data-mtb-theme="dark"]) .mtb-chat{box-shadow:0 -18px 60px #0000008c}}@media (max-width: 480px) and (prefers-color-scheme: dark){:host([data-mtb-theme="auto"]) .mtb-chat{box-shadow:0 -18px 60px #0000008c}}.mtb-chat-handle{display:none}@media (max-width: 480px){.mtb-chat-handle{display:block}}`, w = "mtb-widget-host";
2
2
  function k(i) {
3
- const t = document.getElementById(y);
3
+ const t = document.getElementById(w);
4
4
  return t ? t === i || t.contains(i) : !1;
5
5
  }
6
- function Y(i, t) {
7
- return document.elementsFromPoint?.(i, t).find((e) => e.id !== y) ?? null;
6
+ function V(i, t) {
7
+ return document.elementsFromPoint?.(i, t).find((e) => e.id !== w) ?? null;
8
8
  }
9
9
  function d(i) {
10
10
  return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
11
11
  }
12
- function wt(i) {
12
+ function xt(i) {
13
13
  return i.isComposing || i.keyCode === 229;
14
14
  }
15
15
  const Se = /^(script|style|noscript|template)$/i;
@@ -21,7 +21,7 @@ function Gt(i, t = 80) {
21
21
  }
22
22
  return e;
23
23
  }
24
- function xt(i) {
24
+ function kt(i) {
25
25
  if (i instanceof HTMLElement) {
26
26
  const t = i.getAttribute("aria-label");
27
27
  if (t) return t;
@@ -63,18 +63,18 @@ function Zt(i) {
63
63
  }
64
64
  return t.join(" > ");
65
65
  }
66
- const O = class O {
66
+ const B = class B {
67
67
  constructor(t = "auto", e) {
68
68
  this.stopHostInteraction = (s) => {
69
69
  s.stopPropagation();
70
70
  };
71
- const r = document.getElementById(y);
72
- if (this.ownsHost = !r, this.host = r ?? document.createElement("div"), this.root = this.host.shadowRoot ?? this.host.attachShadow({ mode: "open" }), this.root.replaceChildren(), this.originalInlineStyle = this.host.getAttribute("style"), this.originalTheme = this.host.getAttribute("data-mtb-theme"), this.host.id = y, this.host.style.cssText = "position:fixed;top:0;left:0;width:0;height:0;overflow:visible;z-index:2147483646;", e) {
71
+ const r = document.getElementById(w);
72
+ if (this.ownsHost = !r, this.host = r ?? document.createElement("div"), this.root = this.host.shadowRoot ?? this.host.attachShadow({ mode: "open" }), this.root.replaceChildren(), this.originalInlineStyle = this.host.getAttribute("style"), this.originalTheme = this.host.getAttribute("data-mtb-theme"), this.host.id = w, this.host.style.cssText = "position:fixed;top:0;left:0;width:0;height:0;overflow:visible;z-index:2147483646;", e) {
73
73
  const s = [1, 3, 5].map((a) => parseInt(e.primary.slice(a, a + 2), 16)), o = [1, 3, 5].map((a) => parseInt(e.onPrimary.slice(a, a + 2), 16));
74
74
  this.host.style.setProperty("--mtb-brand-primary", e.primary.toLowerCase()), this.host.style.setProperty("--mtb-brand-hover", e.hover.toLowerCase()), this.host.style.setProperty("--mtb-brand-active", e.active.toLowerCase()), this.host.style.setProperty("--mtb-brand-on-primary", e.onPrimary.toLowerCase()), this.host.style.setProperty("--mtb-brand-rgb", s.join(", ")), this.host.style.setProperty("--mtb-brand-on-primary-rgb", o.join(", ")), this.host.style.setProperty("--mtb-brand-emphasis", e.primary.toLowerCase()), this.host.style.setProperty("--mtb-brand-emphasis-rgb", s.join(", ")), this.host.style.setProperty("--mtb-brand-gradient-start", e.primary.toLowerCase()), this.host.style.setProperty("--mtb-brand-gradient-end", e.hover.toLowerCase());
75
75
  }
76
76
  this.host.setAttribute("data-mtb-theme", t), this.ownsHost && document.body.appendChild(this.host);
77
- for (const s of O.HOST_INTERACTION_EVENTS)
77
+ for (const s of B.HOST_INTERACTION_EVENTS)
78
78
  this.root.addEventListener(s, this.stopHostInteraction);
79
79
  const n = document.createElement("style");
80
80
  n.textContent = Ee, this.root.appendChild(n);
@@ -91,7 +91,7 @@ const O = class O {
91
91
  e.parentNode === this.root && this.root.removeChild(e);
92
92
  }
93
93
  destroy() {
94
- for (const t of O.HOST_INTERACTION_EVENTS)
94
+ for (const t of B.HOST_INTERACTION_EVENTS)
95
95
  this.root.removeEventListener(t, this.stopHostInteraction);
96
96
  if (!this.ownsHost) {
97
97
  this.root.replaceChildren(), this.host.removeAttribute("data-mtb-toolbar"), this.originalInlineStyle === null ? this.host.removeAttribute("style") : this.host.setAttribute("style", this.originalInlineStyle), this.originalTheme === null ? this.host.removeAttribute("data-mtb-theme") : this.host.setAttribute("data-mtb-theme", this.originalTheme);
@@ -100,7 +100,7 @@ const O = class O {
100
100
  this.host.remove();
101
101
  }
102
102
  };
103
- O.HOST_INTERACTION_EVENTS = [
103
+ B.HOST_INTERACTION_EVENTS = [
104
104
  "pointerdown",
105
105
  "pointerup",
106
106
  "pointercancel",
@@ -111,10 +111,12 @@ O.HOST_INTERACTION_EVENTS = [
111
111
  "touchcancel",
112
112
  "click"
113
113
  ];
114
- let pt = O;
115
- class Ce {
114
+ let ft = B;
115
+ class _e {
116
116
  constructor(t, e, r, n, s) {
117
- this.active = !1, this.onClick = n, this.customText = s, this.el = t.el("button", "mtb-tab"), r === "left" && this.el.classList.add("left"), this.idleLabel = s ?? e.tab, this.activeLabel = e.toolbar.exit, this.setLabel(this.idleLabel), this.el.addEventListener("click", n), t.append(this.el);
117
+ this.active = !1, this.preserveHostFocus = (o) => {
118
+ o.preventDefault();
119
+ }, this.onClick = n, this.customText = s, this.el = t.el("button", "mtb-tab"), r === "left" && this.el.classList.add("left"), this.idleLabel = s ?? e.tab, this.activeLabel = e.toolbar.exit, this.setLabel(this.idleLabel), this.el.addEventListener("mousedown", this.preserveHostFocus), this.el.addEventListener("click", n), t.append(this.el);
118
120
  }
119
121
  setLabel(t) {
120
122
  this.el.textContent = t, this.el.setAttribute("aria-label", t);
@@ -126,10 +128,10 @@ class Ce {
126
128
  this.active = t, this.el.classList.toggle("active", t), this.setLabel(t ? this.activeLabel : this.idleLabel);
127
129
  }
128
130
  destroy() {
129
- this.el.removeEventListener("click", this.onClick), this.el.remove();
131
+ this.el.removeEventListener("mousedown", this.preserveHostFocus), this.el.removeEventListener("click", this.onClick), this.el.remove();
130
132
  }
131
133
  }
132
- const _e = 8e3;
134
+ const Ce = 8e3;
133
135
  class Te {
134
136
  constructor(t, e, r) {
135
137
  this.autoHideTimer = null, this.el = t.el("div", "mtb-frustration-prompt"), this.el.innerHTML = `
@@ -139,14 +141,14 @@ class Te {
139
141
  <button class="mtb-frustration-tell">${d(e.frustration.action)}</button>
140
142
  <button class="mtb-frustration-dismiss">${d(e.frustration.dismiss)}</button>
141
143
  </div>
142
- `, this.el.querySelector(".mtb-frustration-tell").addEventListener("click", r.onTell), this.el.querySelector(".mtb-frustration-dismiss").addEventListener("click", r.onDismiss), t.append(this.el), this.autoHideTimer = setTimeout(r.onAutoHide, _e);
144
+ `, this.el.querySelector(".mtb-frustration-tell").addEventListener("click", r.onTell), this.el.querySelector(".mtb-frustration-dismiss").addEventListener("click", r.onDismiss), t.append(this.el), this.autoHideTimer = setTimeout(r.onAutoHide, Ce);
143
145
  }
144
146
  destroy() {
145
147
  this.autoHideTimer && (clearTimeout(this.autoHideTimer), this.autoHideTimer = null), this.el.remove();
146
148
  }
147
149
  }
148
150
  const Ae = 400;
149
- class Tt {
151
+ class At {
150
152
  constructor(t, e, r = () => Date.now()) {
151
153
  this.bornAt = Date.now(), this.bornAt = r(), this.onClick = () => {
152
154
  r() - this.bornAt < Ae || e();
@@ -181,7 +183,7 @@ class Le {
181
183
  return this.applied;
182
184
  }
183
185
  }
184
- const At = ["wheel", "touchmove"], Pe = /* @__PURE__ */ new Set([
186
+ const Lt = ["wheel", "touchmove"], Pe = /* @__PURE__ */ new Set([
185
187
  "ArrowUp",
186
188
  "ArrowDown",
187
189
  "ArrowLeft",
@@ -213,18 +215,18 @@ function Re() {
213
215
  const r = e.composedPath()[0];
214
216
  r instanceof Element && Me(r, e.key) || e.cancelable && e.preventDefault();
215
217
  };
216
- for (const e of At)
218
+ for (const e of Lt)
217
219
  window.addEventListener(e, i, { capture: !0, passive: !1 });
218
220
  return window.addEventListener("keydown", t, { capture: !0 }), {
219
221
  release() {
220
- for (const e of At)
222
+ for (const e of Lt)
221
223
  window.removeEventListener(e, i, { capture: !0 });
222
224
  window.removeEventListener("keydown", t, { capture: !0 });
223
225
  }
224
226
  };
225
227
  }
226
228
  const Ie = 44;
227
- class Ne {
229
+ class He {
228
230
  constructor(t, e, r, n, s = "right", o = !0) {
229
231
  this.currentMode = "markup", this.handlePointerMove = (a) => {
230
232
  if (a.pointerType !== "mouse") return;
@@ -283,7 +285,7 @@ class Ne {
283
285
  document.removeEventListener("pointermove", this.handlePointerMove), this.stopTouchHintDismissListening(), this.host.removeAttribute("data-mtb-toolbar"), this.hintBarEl.remove(), this.el.remove();
284
286
  }
285
287
  }
286
- class He {
288
+ class Ne {
287
289
  constructor(t, e) {
288
290
  this.handlers = e, this.overlayEl = t.el("div", "mtb-overlay"), this.onPointerDown = (r) => {
289
291
  const n = r;
@@ -324,7 +326,7 @@ class Fe {
324
326
  this.highlightEl.style.top = `${e.top - 2}px`, this.highlightEl.style.left = `${e.left - 2}px`, this.highlightEl.style.width = `${e.width + 4}px`, this.highlightEl.style.height = `${e.height + 4}px`, this.highlightEl.style.display = "block", this.showTooltip(t, e);
325
327
  }
326
328
  showTooltip(t, e) {
327
- this.tooltipEl.textContent = xt(t);
329
+ this.tooltipEl.textContent = kt(t);
328
330
  const r = e.top < 30;
329
331
  this.tooltipEl.classList.toggle("below", r), this.tooltipEl.style.left = `${e.left + e.width / 2}px`, this.tooltipEl.style.top = r ? `${e.bottom + 8}px` : `${e.top - 8}px`, this.tooltipEl.style.display = "block";
330
332
  }
@@ -346,27 +348,27 @@ function Be(i, t, e) {
346
348
  scaleY: e / i.height
347
349
  };
348
350
  }
349
- function K(i, t) {
351
+ function G(i, t) {
350
352
  return (t - i.left) * i.scaleX;
351
353
  }
352
- function G(i, t) {
354
+ function Z(i, t) {
353
355
  return (t - i.top) * i.scaleY;
354
356
  }
355
- function Oe(i, t) {
357
+ function ze(i, t) {
356
358
  return {
357
- left: K(i, t.left),
358
- top: G(i, t.top),
359
+ left: G(i, t.left),
360
+ top: Z(i, t.top),
359
361
  width: t.width * i.scaleX,
360
362
  height: t.height * i.scaleY
361
363
  };
362
364
  }
363
- function Ue() {
365
+ function Oe() {
364
366
  return { left: 0, top: 0, width: window.innerWidth, height: window.innerHeight };
365
367
  }
366
- function ze(i, t) {
368
+ function Ue(i, t) {
367
369
  return { x: i.x - t.x, y: i.y - t.y };
368
370
  }
369
- function j(i) {
371
+ function $(i) {
370
372
  let t = 0, e = 0, r = i;
371
373
  for (; r && r !== document.body; )
372
374
  r instanceof HTMLElement && (t += r.scrollLeft, e += r.scrollTop), r = Jt(r);
@@ -377,8 +379,8 @@ function Jt(i) {
377
379
  const t = i.getRootNode();
378
380
  return t instanceof ShadowRoot ? t.host : null;
379
381
  }
380
- function Lt(i) {
381
- const t = j(i);
382
+ function Pt(i) {
383
+ const t = $(i);
382
384
  return { x: t.x + window.scrollX, y: t.y + window.scrollY };
383
385
  }
384
386
  class $e {
@@ -412,7 +414,7 @@ class je {
412
414
  this.isDrawing = !0, this.currentPoints = [[t, e]], this.currentAnchor = We(t, e), this.currentPath = this.createPath(), this.svg.appendChild(this.currentPath);
413
415
  }
414
416
  continueDraw(t, e) {
415
- !this.isDrawing || !this.currentPath || (this.currentPoints.push([t, e]), this.currentPath.setAttribute("d", at(this.currentPoints)));
417
+ !this.isDrawing || !this.currentPath || (this.currentPoints.push([t, e]), this.currentPath.setAttribute("d", lt(this.currentPoints)));
416
418
  }
417
419
  /**
418
420
  * How far the pointer has wandered from where it went down, in pixels.
@@ -435,7 +437,7 @@ class je {
435
437
  commitStroke() {
436
438
  return !this.isDrawing || !this.currentPath ? !1 : (this.isDrawing = !1, this.committed.push({
437
439
  path: this.currentPath,
438
- d: at(this.currentPoints),
440
+ d: lt(this.currentPoints),
439
441
  points: this.currentPoints,
440
442
  anchor: this.currentAnchor
441
443
  }), this.redoStack = [], this.currentPath = null, this.currentPoints = [], !0);
@@ -473,7 +475,7 @@ class je {
473
475
  type: "draw",
474
476
  x: r,
475
477
  y: n,
476
- drawPath: e.map(at).join(" "),
478
+ drawPath: e.map(lt).join(" "),
477
479
  captureOffsetX: t.anchor.offset.x,
478
480
  captureOffsetY: t.anchor.offset.y
479
481
  };
@@ -505,7 +507,7 @@ class je {
505
507
  return t.setAttribute("fill", "none"), t.setAttribute("stroke", T.color), t.setAttribute("stroke-width", T.width), t.setAttribute("stroke-linecap", T.linecap), t.setAttribute("stroke-linejoin", T.linejoin), t.setAttribute("style", `filter:${T.filter}`), t;
506
508
  }
507
509
  }
508
- function at(i) {
510
+ function lt(i) {
509
511
  if (i.length === 0) return "";
510
512
  const [t, e] = i[0];
511
513
  let r = `M ${t} ${e}`;
@@ -519,7 +521,7 @@ function qe() {
519
521
  return { offset: { x: 0, y: 0 }, pageScroll: { x: 0, y: 0 } };
520
522
  }
521
523
  function We(i, t) {
522
- const e = { x: window.scrollX, y: window.scrollY }, r = j(Y(i, t));
524
+ const e = { x: window.scrollX, y: window.scrollY }, r = $(V(i, t));
523
525
  return {
524
526
  offset: { x: r.x + e.x, y: r.y + e.y },
525
527
  pageScroll: e
@@ -532,11 +534,11 @@ function Ve(i) {
532
534
  const t = i.map((s) => s[0]), e = i.map((s) => s[1]), r = (Math.min(...t) + Math.max(...t)) / 2, n = (Math.min(...e) + Math.max(...e)) / 2;
533
535
  return [r, n];
534
536
  }
535
- const rt = "rr-block", z = "rr-mask", Xe = `.${rt}, .${z}`;
536
- function nt(i) {
537
+ const nt = "rr-block", O = "rr-mask", Xe = `.${nt}, .${O}`;
538
+ function st(i) {
537
539
  return i.closest(Xe) !== null;
538
540
  }
539
- function kt(i) {
541
+ function Et(i) {
540
542
  const t = i.getAttribute("role")?.trim().split(/\s+/)[0];
541
543
  return t && /^[a-z][a-z0-9-]*$/i.test(t) ? t : i.tagName.toLowerCase();
542
544
  }
@@ -544,20 +546,20 @@ function te(i) {
544
546
  return i.tagName.toLowerCase();
545
547
  }
546
548
  const Ke = 10;
547
- function Pt(i) {
548
- return nt(i) ? {
549
- name: kt(i),
549
+ function Dt(i) {
550
+ return st(i) ? {
551
+ name: Et(i),
550
552
  text: "",
551
553
  selector: te(i)
552
554
  } : {
553
- name: xt(i),
555
+ name: kt(i),
554
556
  text: i.textContent?.trim().slice(0, 200) ?? "",
555
557
  selector: Zt(i)
556
558
  };
557
559
  }
558
560
  class Ge {
559
561
  constructor(t, e, r) {
560
- this.messages = e, this.handlers = r, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.touch = S(), this.highlighter = new Fe(t), this.pinMarker = new $e(t), this.drawLayer = new je(t), this.overlay = new He(t, {
562
+ this.messages = e, this.handlers = r, this.interactionActive = !0, this.pendingHighlightFrame = null, this.lastMoveX = 0, this.lastMoveY = 0, this.touch = S(), this.highlighter = new Fe(t), this.pinMarker = new $e(t), this.drawLayer = new je(t), this.overlay = new Ne(t, {
561
563
  onPointerDown: (n) => this.handlePointerDown(n),
562
564
  onPointerMove: (n) => this.handlePointerMove(n),
563
565
  onPointerUp: (n) => this.handlePointerUp(n),
@@ -583,7 +585,7 @@ class Ge {
583
585
  }
584
586
  updateHighlight() {
585
587
  if (!this.interactionActive || this.drawLayer.isCurrentlyDrawing() || this.drawSessionActive()) return;
586
- const t = Y(this.lastMoveX, this.lastMoveY);
588
+ const t = V(this.lastMoveX, this.lastMoveY);
587
589
  t ? this.highlighter.highlight(t) : this.highlighter.hide();
588
590
  }
589
591
  cancelPendingHighlight() {
@@ -601,7 +603,7 @@ class Ge {
601
603
  return;
602
604
  }
603
605
  if (this.drawLayer.cancelCurrentDraw(), this.touch || this.drawLayer.hasStrokes() || !t) return;
604
- const e = Y(t.clientX, t.clientY), r = e ? Pt(e) : null, n = r?.name ?? this.messages.annotation.element, s = e?.getBoundingClientRect(), o = Lt(e), a = {
606
+ const e = V(t.clientX, t.clientY), r = e ? Dt(e) : null, n = r?.name ?? this.messages.annotation.element, s = e?.getBoundingClientRect(), o = Pt(e), a = {
605
607
  type: "pin",
606
608
  x: t.clientX,
607
609
  y: t.clientY,
@@ -642,9 +644,9 @@ class Ge {
642
644
  getDrawAnnotation() {
643
645
  const t = this.drawLayer.getAnnotation();
644
646
  if (!t) return null;
645
- const e = this.drawLayer.viewportDrift(), r = Y(t.x - e.x, t.y - e.y);
647
+ const e = this.drawLayer.viewportDrift(), r = V(t.x - e.x, t.y - e.y);
646
648
  if (!r) return t;
647
- const n = r.getBoundingClientRect(), s = Lt(r), o = s.x - (t.captureOffsetX ?? 0), a = s.y - (t.captureOffsetY ?? 0), l = Pt(r);
649
+ const n = r.getBoundingClientRect(), s = Pt(r), o = s.x - (t.captureOffsetX ?? 0), a = s.y - (t.captureOffsetY ?? 0), l = Dt(r);
648
650
  return {
649
651
  ...t,
650
652
  targetSelector: l.selector,
@@ -734,7 +736,7 @@ class ee {
734
736
  class ei {
735
737
  constructor(t, e) {
736
738
  this.onSubmit = e.onSubmit, this.submitLabel = e.messages.draw.submit, this.messages = e.messages, this.el = t.el("div", "mtb-draw-bar"), this.el.innerHTML = this.buildHTML(e.messages), t.append(this.el), this.sheet = new ee(this.el), this.sheet.apply(), this.input = this.el.querySelector(".mtb-draw-input"), this.undoBtn = this.el.querySelector(".mtb-draw-undo"), this.redoBtn = this.el.querySelector(".mtb-draw-redo"), this.submitBtn = this.el.querySelector(".mtb-draw-submit"), this.undoBtn.addEventListener("click", e.onUndo), this.redoBtn.addEventListener("click", e.onRedo), this.el.querySelector(".mtb-draw-cancel").addEventListener("click", e.onCancel), this.submitBtn.addEventListener("click", () => this.submit()), e.onActivity && this.input.addEventListener("input", e.onActivity), this.input.addEventListener("keydown", (r) => {
737
- wt(r) || r.key === "Enter" && !r.shiftKey && (r.preventDefault(), this.submit());
739
+ xt(r) || r.key === "Enter" && !r.shiftKey && (r.preventDefault(), this.submit());
738
740
  }), this.input.focus({ preventScroll: !0 });
739
741
  }
740
742
  buildHTML(t) {
@@ -767,18 +769,18 @@ class ei {
767
769
  this.sheet.release(), this.el.remove();
768
770
  }
769
771
  }
770
- const Z = 12, ft = 32;
772
+ const J = 12, gt = 32;
771
773
  function ii(i) {
772
774
  const t = window.innerWidth, e = window.innerHeight;
773
775
  return {
774
776
  vw: t,
775
777
  vh: e,
776
- minLeft: Z + (i === "left" ? ft : 0),
777
- maxRight: t - Z - (i === "right" ? ft : 0)
778
+ minLeft: J + (i === "left" ? gt : 0),
779
+ maxRight: t - J - (i === "right" ? gt : 0)
778
780
  };
779
781
  }
780
782
  function ri(i, t) {
781
- return Math.min(i, t.vw - 2 * Z - ft);
783
+ return Math.min(i, t.vw - 2 * J - gt);
782
784
  }
783
785
  const ni = [
784
786
  "button:not([disabled])",
@@ -805,8 +807,8 @@ function ie(i) {
805
807
  }
806
808
  };
807
809
  }
808
- const si = 320, Dt = 5e3, oi = "https://makethisbetter.dev", q = '<svg viewBox="0 0 512 512" fill="none"><defs><linearGradient id="mtb-bg" x1=".3" y1="0" x2=".7" y2="1"><stop offset="0%" stop-color="var(--mtb-chat-logo-start, #10b981)"/><stop offset="100%" stop-color="var(--mtb-chat-logo-end, #059669)"/></linearGradient></defs><rect width="512" height="512" rx="96" fill="url(#mtb-bg)"/><g transform="translate(89,89) scale(13.9)" stroke="var(--mtb-chat-logo-fg, #fff)" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"><path d="M21 2v6h-6"/><path d="M21 13a9 9 0 1 1-3-7.7L21 8"/><circle cx="12" cy="12" r="2.2" fill="var(--mtb-chat-logo-fg, #fff)" stroke="none"/></g></svg>', ai = '<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M8.9 8l3.3-3.3-.9-.9L8 7.1 4.7 3.8l-.9.9L7.1 8l-3.3 3.3.9.9L8 8.9l3.3 3.3.9-.9z"/></svg>', li = '<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M6.2 2.6h3.6l.9 1.4H14a1 1 0 011 1v7.4a1 1 0 01-1 1H2a1 1 0 01-1-1V5a1 1 0 011-1h3.3l.9-1.4z"/><circle cx="8" cy="9" r="2.5" class="mtb-chat-icon-lens"/></svg>', ci = '<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><circle cx="8" cy="8" r="6.6"/><polygon points="6.4,5.2 11,8 6.4,10.8" class="mtb-chat-icon-lens"/></svg>', hi = '<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path d="M8.1 14.6L3.8 10.3l1.5-1.5 2.8 2.8 6.6-6.6 1.5 1.5z"/></svg>';
809
- class lt {
810
+ const si = 320, Mt = 5e3, oi = "https://makethisbetter.dev", j = '<svg viewBox="0 0 512 512" fill="none"><defs><linearGradient id="mtb-bg" x1=".3" y1="0" x2=".7" y2="1"><stop offset="0%" stop-color="var(--mtb-chat-logo-start, #10b981)"/><stop offset="100%" stop-color="var(--mtb-chat-logo-end, #059669)"/></linearGradient></defs><rect width="512" height="512" rx="96" fill="url(#mtb-bg)"/><g transform="translate(89,89) scale(13.9)" stroke="var(--mtb-chat-logo-fg, #fff)" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"><path d="M21 2v6h-6"/><path d="M21 13a9 9 0 1 1-3-7.7L21 8"/><circle cx="12" cy="12" r="2.2" fill="var(--mtb-chat-logo-fg, #fff)" stroke="none"/></g></svg>', ai = '<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M8.9 8l3.3-3.3-.9-.9L8 7.1 4.7 3.8l-.9.9L7.1 8l-3.3 3.3.9.9L8 8.9l3.3 3.3.9-.9z"/></svg>', li = '<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M6.2 2.6h3.6l.9 1.4H14a1 1 0 011 1v7.4a1 1 0 01-1 1H2a1 1 0 01-1-1V5a1 1 0 011-1h3.3l.9-1.4z"/><circle cx="8" cy="9" r="2.5" class="mtb-chat-icon-lens"/></svg>', ci = '<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><circle cx="8" cy="8" r="6.6"/><polygon points="6.4,5.2 11,8 6.4,10.8" class="mtb-chat-icon-lens"/></svg>', hi = '<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path d="M8.1 14.6L3.8 10.3l1.5-1.5 2.8 2.8 6.6-6.6 1.5 1.5z"/></svg>';
811
+ class ct {
810
812
  constructor(t, e) {
811
813
  this.state = "idle", this.autoCloseTimer = null, this.session = null, this.clarifyAbort = null, this.streamingBubbleEl = null, this.opts = e, this.i18n = e.messages, this.el = t.el("div", "mtb-chat"), this.el.setAttribute("role", "dialog"), this.el.setAttribute("aria-modal", "true"), this.el.setAttribute("aria-label", e.targetName), this.el.innerHTML = this.buildHTML(), t.append(this.el), this.focusTrap = ie(this.el), this.sheet = new ee(this.el), this.sheet.apply() || this.positionCard(e.x, e.y, e.targetRect, e.position ?? "right"), this.messagesEl = this.el.querySelector(".mtb-chat-messages"), this.composerEl = this.el.querySelector(".mtb-chat-composer"), this.actionsEl = this.el.querySelector(".mtb-chat-actions"), this.inputEl = this.el.querySelector(".mtb-chat-input"), this.sendBtn = this.el.querySelector(".mtb-chat-send"), this.quickRepliesEl = this.el.querySelector(".mtb-chat-quick-replies"), this.bindEvents(), this.handleEscape = this.handleEscape.bind(this), window.addEventListener("keydown", this.handleEscape), this.inputEl.focus({ preventScroll: !0 });
812
814
  }
@@ -826,7 +828,7 @@ class lt {
826
828
  <div class="mtb-chat-handle"></div>
827
829
  <div class="mtb-chat-header-row">
828
830
  <a class="mtb-chat-brand" href="${oi}" target="_blank" rel="noopener">
829
- <span class="mtb-chat-logo">${q}</span>
831
+ <span class="mtb-chat-logo">${j}</span>
830
832
  <span class="mtb-chat-brand-name">Make This Better</span>
831
833
  </a>
832
834
  <span class="mtb-chat-header-gap"></span>
@@ -856,7 +858,7 @@ class lt {
856
858
  }), this.inputEl.addEventListener("input", () => {
857
859
  this.sendBtn.disabled = !this.inputEl.value.trim(), this.opts.onActivity?.();
858
860
  }), this.inputEl.addEventListener("keydown", (e) => {
859
- if (!wt(e) && e.key === "Enter" && !e.shiftKey) {
861
+ if (!xt(e) && e.key === "Enter" && !e.shiftKey) {
860
862
  e.preventDefault();
861
863
  const r = this.inputEl.value.trim();
862
864
  r ? this.sendMessage(r) : this.state === "clarifying" && this.skipAndSend();
@@ -894,29 +896,22 @@ class lt {
894
896
  this.removeThinking(), this.showDone();
895
897
  return;
896
898
  }
897
- let r = null;
898
- const n = [];
899
+ let r = null, n = !1;
899
900
  this.clarifyAbort = new AbortController();
900
901
  try {
901
902
  r = await this.opts.onClarify(e.id, e.token, (o) => {
902
- n.push(o);
903
+ n || (this.removeThinking(), this.startStreamingBubble(), n = !0), this.appendStreamDelta(o);
903
904
  }, this.clarifyAbort.signal);
904
905
  } catch {
905
- this.removeThinking(), this.showDone();
906
+ n ? this.endStreamingBubble() : this.removeThinking(), this.showDone();
906
907
  return;
907
908
  }
908
- if (this.removeThinking(), r.done || !r.messages.length) {
909
+ if (n ? this.endStreamingBubble() : this.removeThinking(), r.done || !r.messages.length) {
909
910
  this.showDone();
910
911
  return;
911
912
  }
912
- if (n.length) {
913
- this.startStreamingBubble();
914
- for (const o of n)
915
- this.appendStreamDelta(o), await new Promise((a) => setTimeout(a, 15));
916
- this.endStreamingBubble();
917
- }
918
913
  const s = r.messages.find((o) => o.role === "assistant");
919
- !n.length && s && this.appendAiBubble(s.content), this.renderSuggestions(r.suggestions), this.state = "clarifying", this.setComposerDisabled(!1), this.inputEl.value = "", this.inputEl.placeholder = this.i18n.clarify.placeholder, this.sendBtn.textContent = this.i18n.clarify.submit ?? this.i18n.clarify.send, this.sendBtn.disabled = !0, this.showSkip(), this.inputEl.focus({ preventScroll: !0 }), this.opts.onConversationOpen?.();
914
+ !n && s && this.appendAiBubble(s.content), this.renderSuggestions(r.suggestions), this.state = "clarifying", this.setComposerDisabled(!1), this.inputEl.value = "", this.inputEl.placeholder = this.i18n.clarify.placeholder, this.sendBtn.textContent = this.i18n.clarify.submit ?? this.i18n.clarify.send, this.sendBtn.disabled = !0, this.showSkip(), this.inputEl.focus({ preventScroll: !0 }), this.opts.onConversationOpen?.();
920
915
  }
921
916
  handleAnswer(t) {
922
917
  const e = this.session;
@@ -926,8 +921,8 @@ class lt {
926
921
  /**
927
922
  * The receipt goes up the moment the reporter is done rather than waiting on
928
923
  * the finalize round trip; the hand-off it returns is patched into the card
929
- * when it lands, and a failed finalize takes this card down in favour of its
930
- * own error card.
924
+ * when it lands. A failed finalize replaces this receipt with an in-card
925
+ * retry state so the reporter stays in the conversation they used.
931
926
  */
932
927
  showDone() {
933
928
  this.state = "done", this.hideSkip(), this.setComposerDisabled(!0), this.renderSuccess(), this.finalizeInBackground();
@@ -940,14 +935,33 @@ class lt {
940
935
  renderSuccess() {
941
936
  const t = this.i18n.success;
942
937
  this.messagesEl.remove(), this.quickRepliesEl.remove(), this.composerEl.remove();
943
- const e = document.createElement("div");
944
- e.className = "mtb-chat-success mtb-chat-success-simple";
938
+ const e = this.el.querySelector(".mtb-chat-success") ?? document.createElement("div");
939
+ e.className = "mtb-chat-success mtb-chat-success-simple", e.replaceChildren();
945
940
  const r = document.createElement("div");
946
941
  r.className = "mtb-chat-success-icon", r.innerHTML = hi, e.appendChild(r);
947
942
  const n = document.createElement("div");
948
943
  n.className = "mtb-chat-success-title", n.textContent = this.session?.ai_clarify_available === !1 ? t.title_no_ai : t.title, e.appendChild(n);
949
944
  const s = document.createElement("a");
950
- s.className = "mtb-chat-success-link mtb-chat-success-link-pending", s.href = "#", s.textContent = t.track_feedback, s.addEventListener("click", (o) => o.preventDefault()), e.appendChild(s), this.el.appendChild(e), this.attachHandoff();
945
+ s.className = "mtb-chat-success-link mtb-chat-success-link-pending", s.href = "#", s.textContent = t.track_feedback, s.addEventListener("click", (o) => o.preventDefault()), e.appendChild(s), e.parentElement || this.el.appendChild(e), this.attachHandoff();
946
+ }
947
+ /** Keep a failed background finalize in the conversation the reporter used. */
948
+ showFinalizeFailure(t) {
949
+ this.autoCloseTimer && (clearTimeout(this.autoCloseTimer), this.autoCloseTimer = null);
950
+ let e = this.el.querySelector(".mtb-chat-success");
951
+ e || (this.messagesEl.remove(), this.quickRepliesEl.remove(), this.composerEl.remove(), e = document.createElement("div"), this.el.appendChild(e)), e.className = "mtb-chat-success mtb-chat-finalize-failure", e.innerHTML = `
952
+ <div class="mtb-chat-success-icon mtb-chat-failure-icon">!</div>
953
+ <div class="mtb-chat-success-title">${d(this.i18n.error.finalize_title)}</div>
954
+ <div class="mtb-chat-finalize-message">${d(this.i18n.error.finalize_message)}</div>
955
+ ${t ? `<button class="mtb-chat-finalize-retry" type="button">${d(this.i18n.clarify.retry)}</button>` : ""}
956
+ <button class="mtb-chat-finalize-close" type="button">${d(this.i18n.success.close)}</button>
957
+ `, t && e.querySelector(".mtb-chat-finalize-retry").addEventListener("click", () => {
958
+ const r = e.querySelector(".mtb-chat-finalize-retry");
959
+ r.disabled = !0, r.innerHTML = '<span class="mtb-chat-finalize-spinner" aria-label="Retrying"></span>', t();
960
+ }), e.querySelector(".mtb-chat-finalize-close").addEventListener("click", () => this.opts.onCancel());
961
+ }
962
+ /** Restore the receipt after a retry reaches the final endpoint. */
963
+ showFinalizeSuccess() {
964
+ this.state = "done", this.renderSuccess();
951
965
  }
952
966
  /**
953
967
  * The board link and the email form are both built from the hand-off that
@@ -964,7 +978,7 @@ class lt {
964
978
  s.preventDefault(), e();
965
979
  }));
966
980
  const n = this.opts.resolveEmailCapture?.();
967
- n && !t.querySelector(".mtb-chat-email-card") ? (this.autoCloseTimer && (clearTimeout(this.autoCloseTimer), this.autoCloseTimer = null), t.classList.remove("mtb-chat-success-simple"), t.appendChild(this.buildEmailCard(n))) : !n && !this.autoCloseTimer && !t.querySelector(".mtb-chat-email-card") && (this.autoCloseTimer = setTimeout(() => this.destroy(), Dt));
981
+ n && !t.querySelector(".mtb-chat-email-card") ? (this.autoCloseTimer && (clearTimeout(this.autoCloseTimer), this.autoCloseTimer = null), t.classList.remove("mtb-chat-success-simple"), t.appendChild(this.buildEmailCard(n))) : !n && !this.autoCloseTimer && !t.querySelector(".mtb-chat-email-card") && (this.autoCloseTimer = setTimeout(() => this.destroy(), Mt));
968
982
  }
969
983
  finalizeInBackground() {
970
984
  Promise.resolve(this.opts.onFinalize()).then(() => this.attachHandoff()).catch(() => {
@@ -985,8 +999,8 @@ class lt {
985
999
  const c = o.value.trim();
986
1000
  if (!c) return;
987
1001
  if (a.disabled = !0, o.disabled = !0, await t.onSubmit(c)) {
988
- const m = document.createElement("div");
989
- m.className = "mtb-chat-email-note", m.textContent = e.email_saved, r.replaceChildren(m), this.autoCloseTimer = setTimeout(() => this.destroy(), Dt);
1002
+ const b = document.createElement("div");
1003
+ b.className = "mtb-chat-email-note", b.textContent = e.email_saved, r.replaceChildren(b), this.autoCloseTimer = setTimeout(() => this.destroy(), Mt);
990
1004
  return;
991
1005
  }
992
1006
  o.disabled = !1, a.disabled = !1;
@@ -1005,7 +1019,7 @@ class lt {
1005
1019
  }
1006
1020
  startStreamingBubble() {
1007
1021
  const t = document.createElement("div");
1008
- t.className = "mtb-chat-ai-row", t.innerHTML = `<div class="mtb-chat-avatar">${q}</div><div class="mtb-chat-bubble mtb-chat-bubble-ai"></div>`, this.messagesEl.appendChild(t), this.streamingBubbleEl = t.querySelector(".mtb-chat-bubble-ai");
1022
+ t.className = "mtb-chat-ai-row", t.innerHTML = `<div class="mtb-chat-avatar">${j}</div><div class="mtb-chat-bubble mtb-chat-bubble-ai"></div>`, this.messagesEl.appendChild(t), this.streamingBubbleEl = t.querySelector(".mtb-chat-bubble-ai");
1009
1023
  }
1010
1024
  appendStreamDelta(t) {
1011
1025
  this.streamingBubbleEl && (this.streamingBubbleEl.textContent = (this.streamingBubbleEl.textContent ?? "") + t, this.messagesEl.scrollTop = this.messagesEl.scrollHeight);
@@ -1015,7 +1029,7 @@ class lt {
1015
1029
  }
1016
1030
  appendAiBubble(t) {
1017
1031
  const e = document.createElement("div");
1018
- e.className = "mtb-chat-ai-row", e.innerHTML = `<div class="mtb-chat-avatar">${q}</div><div class="mtb-chat-bubble mtb-chat-bubble-ai"></div>`, e.querySelector(".mtb-chat-bubble-ai").textContent = t, this.messagesEl.appendChild(e), this.messagesEl.scrollTop = this.messagesEl.scrollHeight;
1032
+ e.className = "mtb-chat-ai-row", e.innerHTML = `<div class="mtb-chat-avatar">${j}</div><div class="mtb-chat-bubble mtb-chat-bubble-ai"></div>`, e.querySelector(".mtb-chat-bubble-ai").textContent = t, this.messagesEl.appendChild(e), this.messagesEl.scrollTop = this.messagesEl.scrollHeight;
1019
1033
  }
1020
1034
  renderSuggestions(t) {
1021
1035
  if (this.clearSuggestions(), !t?.length) return;
@@ -1035,7 +1049,7 @@ class lt {
1035
1049
  showThinking() {
1036
1050
  if (this.messagesEl.querySelector(".mtb-chat-thinking")) return;
1037
1051
  const t = document.createElement("div");
1038
- t.className = "mtb-chat-ai-row mtb-chat-thinking", t.innerHTML = `<div class="mtb-chat-avatar">${q}</div><div class="mtb-chat-dots"><span></span><span></span><span></span></div>`, this.messagesEl.appendChild(t), this.messagesEl.scrollTop = this.messagesEl.scrollHeight;
1052
+ t.className = "mtb-chat-ai-row mtb-chat-thinking", t.innerHTML = `<div class="mtb-chat-avatar">${j}</div><div class="mtb-chat-dots"><span></span><span></span><span></span></div>`, this.messagesEl.appendChild(t), this.messagesEl.scrollTop = this.messagesEl.scrollHeight;
1039
1053
  }
1040
1054
  removeThinking() {
1041
1055
  this.messagesEl.querySelector(".mtb-chat-thinking")?.remove();
@@ -1070,10 +1084,10 @@ class lt {
1070
1084
  this.inputEl.disabled = t, this.sendBtn.disabled = t, this.composerEl.classList.toggle("mtb-chat-composer-disabled", t);
1071
1085
  }
1072
1086
  positionCard(t, e, r, n) {
1073
- const s = ii(n), { vw: o, vh: a, minLeft: l, maxRight: c } = s, h = Z, u = 8, m = ri(si, s), g = (this.el.offsetHeight || 280) + 80;
1074
- let f, b;
1075
- const ot = r && r.width < o * 0.6 && r.height < a * 0.6;
1076
- r && ot ? (f = r.left, b = r.bottom + u, b + g > a - h && (b = r.top - g - u), b < h && (b = Math.min(r.bottom + u, a - g - h))) : (f = t + 12, b = e + 12), f + m > c && (f = c - m), f < l && (f = l), b < h && (b = h), b + g > a - h && (b = a - g - h), b < h && (b = h), this.el.style.left = `${f}px`, this.el.style.top = `${b}px`, this.el.style.maxHeight = `${a - b - h}px`;
1087
+ const s = ii(n), { vw: o, vh: a, minLeft: l, maxRight: c } = s, h = J, u = 8, b = ri(si, s), g = (this.el.offsetHeight || 280) + 80;
1088
+ let f, m;
1089
+ const at = r && r.width < o * 0.6 && r.height < a * 0.6;
1090
+ r && at ? (f = r.left, m = r.bottom + u, m + g > a - h && (m = r.top - g - u), m < h && (m = Math.min(r.bottom + u, a - g - h))) : (f = t + 12, m = e + 12), f + b > c && (f = c - b), f < l && (f = l), m < h && (m = h), m + g > a - h && (m = a - g - h), m < h && (m = h), this.el.style.left = `${f}px`, this.el.style.top = `${m}px`, this.el.style.maxHeight = `${a - m - h}px`;
1077
1091
  }
1078
1092
  submit(t) {
1079
1093
  this.sendMessage(t);
@@ -1087,7 +1101,7 @@ class lt {
1087
1101
  }
1088
1102
  }
1089
1103
  const di = 5e3, ui = '<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path d="M8.1 14.6L3.8 10.3l1.5-1.5 2.8 2.8 6.6-6.6 1.5 1.5z"/></svg>';
1090
- class bi {
1104
+ class mi {
1091
1105
  constructor(t, e, r, n) {
1092
1106
  const s = e.success, o = n?.skipFollowup ? s.title_no_ai : s.title;
1093
1107
  this.el = t.el("div", "mtb-chat mtb-chat-receipt"), this.el.setAttribute("role", "dialog"), this.el.setAttribute("aria-modal", "true"), this.el.setAttribute("aria-label", o);
@@ -1108,13 +1122,13 @@ class bi {
1108
1122
  clearTimeout(this.autoCloseTimer), this.focusTrap.release(), this.el.remove(), this.focusTrap.restoreFocus();
1109
1123
  }
1110
1124
  }
1111
- const p = "[Filtered]", mi = /-----BEGIN ((?:[A-Z0-9]+ )*PRIVATE KEY)-----[\s\S]*?-----END \1-----/g, pi = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, fi = [
1125
+ const p = "[Filtered]", bi = /-----BEGIN ((?:[A-Z0-9]+ )*PRIVATE KEY)-----[\s\S]*?-----END \1-----/g, pi = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, fi = [
1112
1126
  /\bsk-(?:proj-)?[A-Za-z0-9_-]{20,}\b/g,
1113
1127
  /\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{20,}\b/g,
1114
1128
  /\bgh[pousr]_[A-Za-z0-9]{30,}\b/g,
1115
1129
  /\bAKIA[0-9A-Z]{16}\b/g,
1116
1130
  /\bxox[baprs]-[A-Za-z0-9-]{20,}\b/g
1117
- ], gi = /\b(?:\d[ -]?){12,18}\d\b/g, vi = /\bhttps?:\/\/[^\s<>"']+/gi, yi = /* @__PURE__ */ new Set(["type", "autocomplete", "name", "id", "aria_label", "placeholder"]), wi = /* @__PURE__ */ new Set(["value", "content"]), xi = /* @__PURE__ */ new Set(["password", "hidden", "file"]), ki = /* @__PURE__ */ new Set([
1131
+ ], gi = /\b(?:\d[ -]?){12,18}\d\b/g, vi = /\bhttps?:\/\/[^\s<>"']+/gi, wi = /* @__PURE__ */ new Set(["type", "autocomplete", "name", "id", "aria_label", "placeholder"]), yi = /* @__PURE__ */ new Set(["value", "content"]), xi = /* @__PURE__ */ new Set(["password", "hidden", "file"]), ki = /* @__PURE__ */ new Set([
1118
1132
  "current_password",
1119
1133
  "new_password",
1120
1134
  "one_time_code",
@@ -1124,13 +1138,13 @@ const p = "[Filtered]", mi = /-----BEGIN ((?:[A-Z0-9]+ )*PRIVATE KEY)-----[\s\S]
1124
1138
  "cc_exp_month",
1125
1139
  "cc_exp_year"
1126
1140
  ]), Ei = /(?:^|_)(?:password|passwd|passcode|card_(?:number|no)(?:_[0-9]+)?|credit_card|cc_(?:number|num|csc|cvv|cvc|exp|expiry)|cvv|cvc|csc|security_code|one_time_(?:code|password)|otp(?:_code)?|verification_code|auth(?:entication)?_token|access_token|refresh_token|id_token|token|api_key|client_secret|secret|authorization|cookie|set_cookie|credential|private_key|hidden_value|file_name|filename)(?:$|_(?:value|field|input|confirmation|confirm|header|data|pem)$)/;
1127
- function _(i) {
1128
- let t = i.replace(mi, p).replace(pi, p);
1141
+ function C(i) {
1142
+ let t = i.replace(bi, p).replace(pi, p);
1129
1143
  for (const e of fi)
1130
1144
  t = t.replace(e, p);
1131
- return t = t.replace(gi, (e) => Si(e) ? p : e), t.replace(vi, (e) => $(e) || p);
1145
+ return t = t.replace(gi, (e) => Si(e) ? p : e), t.replace(vi, (e) => U(e) || p);
1132
1146
  }
1133
- function $(i) {
1147
+ function U(i) {
1134
1148
  try {
1135
1149
  const t = new URL(i);
1136
1150
  return `${t.origin}${t.pathname}`;
@@ -1138,32 +1152,32 @@ function $(i) {
1138
1152
  return "";
1139
1153
  }
1140
1154
  }
1141
- function J(i, t) {
1155
+ function Q(i, t) {
1142
1156
  if (t && re(t) && i != null) return p;
1143
- if (typeof i == "string") return _(i);
1144
- if (Array.isArray(i)) return i.map((e) => J(e));
1157
+ if (typeof i == "string") return C(i);
1158
+ if (Array.isArray(i)) return i.map((e) => Q(e));
1145
1159
  if (i && typeof i == "object") {
1146
1160
  const e = ne(i);
1147
1161
  return Object.fromEntries(
1148
1162
  Object.entries(i).map(([n, s]) => {
1149
- const o = e && wi.has(I(n)) && s != null ? p : J(s, n);
1150
- return [_(n), o];
1163
+ const o = e && yi.has(R(n)) && s != null ? p : Q(s, n);
1164
+ return [C(n), o];
1151
1165
  })
1152
1166
  );
1153
1167
  }
1154
1168
  return i;
1155
1169
  }
1156
1170
  function re(i) {
1157
- return Ei.test(I(i));
1171
+ return Ei.test(R(i));
1158
1172
  }
1159
1173
  function ne(i) {
1160
1174
  return Object.entries(i).some(([t, e]) => {
1161
1175
  if (typeof e != "string") return !1;
1162
- const r = I(t);
1163
- return yi.has(r) ? r === "type" ? xi.has(I(e)) : r === "autocomplete" ? e.split(/\s+/).some((n) => ki.has(I(n))) : re(e) : !1;
1176
+ const r = R(t);
1177
+ return wi.has(r) ? r === "type" ? xi.has(R(e)) : r === "autocomplete" ? e.split(/\s+/).some((n) => ki.has(R(n))) : re(e) : !1;
1164
1178
  });
1165
1179
  }
1166
- function I(i) {
1180
+ function R(i) {
1167
1181
  return i.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
1168
1182
  }
1169
1183
  function Si(i) {
@@ -1186,10 +1200,10 @@ function se(i) {
1186
1200
  placeholder: i.getAttribute("placeholder")
1187
1201
  });
1188
1202
  }
1189
- function Q(i, t) {
1190
- return i && (se(t) ? p : _(i));
1203
+ function tt(i, t) {
1204
+ return i && (se(t) ? p : C(i));
1191
1205
  }
1192
- const Ci = 512;
1206
+ const _i = 512;
1193
1207
  function oe() {
1194
1208
  return /* @__PURE__ */ new WeakMap();
1195
1209
  }
@@ -1208,12 +1222,12 @@ function le(i, t) {
1208
1222
  if (e) return e;
1209
1223
  const r = i.textContent ?? "";
1210
1224
  let n = "none";
1211
- return r.length > Ci ? n = "too-large" : _(r) !== r && (n = Array.from(i.children).some((o) => {
1225
+ return r.length > _i ? n = "too-large" : C(r) !== r && (n = Array.from(i.children).some((o) => {
1212
1226
  const a = le(o, t);
1213
1227
  return a === "sensitive" || a === "contains-sensitive-child";
1214
1228
  }) ? "contains-sensitive-child" : "sensitive"), t.set(i, n), n;
1215
1229
  }
1216
- function _i(i) {
1230
+ function Ci(i) {
1217
1231
  return new Promise((t) => {
1218
1232
  const e = new Image();
1219
1233
  e.onload = () => t(e), e.onerror = () => t(null), e.src = i;
@@ -1240,24 +1254,24 @@ function he() {
1240
1254
  throw A = null, i;
1241
1255
  }), A);
1242
1256
  }
1243
- let ct, ht = null;
1244
- function Et() {
1245
- return ct !== void 0 ? Promise.resolve(ct) : (ht ?? (ht = he().then(({ getFontEmbedCSS: i }) => i(document.body)).then((i) => (ct = i, i)).catch(() => {
1246
- ht = null;
1247
- })), ht);
1257
+ let ht, dt = null;
1258
+ function St() {
1259
+ return ht !== void 0 ? Promise.resolve(ht) : (dt ?? (dt = he().then(({ getFontEmbedCSS: i }) => i(document.body)).then((i) => (ht = i, i)).catch(() => {
1260
+ dt = null;
1261
+ })), dt);
1248
1262
  }
1249
1263
  const Ai = 200, Li = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
1250
1264
  async function Pi(i, t) {
1251
1265
  try {
1252
1266
  if (t?.aborted) return null;
1253
- const [{ toJpeg: e }, r] = await Promise.all([he(), Et()]), n = document.body.getBoundingClientRect(), s = Ue(), o = { x: window.scrollX, y: window.scrollY }, a = Hi(document.body), l = await e(document.body, {
1267
+ const [{ toJpeg: e }, r] = await Promise.all([he(), St()]), n = document.body.getBoundingClientRect(), s = Oe(), o = { x: window.scrollX, y: window.scrollY }, a = Ni(document.body), l = await e(document.body, {
1254
1268
  quality: 0.85,
1255
1269
  imagePlaceholder: Li,
1256
1270
  resourceUrlResolver: i,
1257
1271
  fetchRequestInit: t ? { signal: t } : void 0,
1258
1272
  width: s.width,
1259
1273
  height: s.height,
1260
- pixelRatio: Oi(s),
1274
+ pixelRatio: zi(s),
1261
1275
  backgroundColor: "#ffffff",
1262
1276
  skipFonts: !1,
1263
1277
  skipAutoScale: !1,
@@ -1270,7 +1284,7 @@ async function Pi(i, t) {
1270
1284
  transformOrigin: "top left"
1271
1285
  },
1272
1286
  filter: (c) => {
1273
- if (c instanceof HTMLElement && c.id === y) return !1;
1287
+ if (c instanceof HTMLElement && c.id === w) return !1;
1274
1288
  if (!(c instanceof Element)) return !0;
1275
1289
  const h = c.getBoundingClientRect();
1276
1290
  return h.width === 0 && h.height === 0 ? !0 : h.top + window.scrollY - o.y <= s.height + Ai;
@@ -1286,7 +1300,7 @@ async function Di(i, t = [], e) {
1286
1300
  const r = t.map(
1287
1301
  (n) => Mi(n, i.pageScroll)
1288
1302
  );
1289
- return await Ni(i.dataUrl, r, i.metrics, i.redactions, e);
1303
+ return await Hi(i.dataUrl, r, i.metrics, i.redactions, e);
1290
1304
  } catch {
1291
1305
  return null;
1292
1306
  }
@@ -1307,10 +1321,10 @@ function Mi(i, t) {
1307
1321
  };
1308
1322
  }
1309
1323
  function Ri(i, t) {
1310
- return i.captureOffsetX !== void 0 && i.captureOffsetY !== void 0 ? ze(
1324
+ return i.captureOffsetX !== void 0 && i.captureOffsetY !== void 0 ? Ue(
1311
1325
  { x: i.captureOffsetX, y: i.captureOffsetY },
1312
1326
  t
1313
- ) : j(Ii(i));
1327
+ ) : $(Ii(i));
1314
1328
  }
1315
1329
  function Ii(i) {
1316
1330
  if (i.targetSelector)
@@ -1321,61 +1335,61 @@ function Ii(i) {
1321
1335
  }
1322
1336
  return document.elementsFromPoint?.(i.x, i.y)[0] ?? null;
1323
1337
  }
1324
- async function Ni(i, t, e, r, n) {
1338
+ async function Hi(i, t, e, r, n) {
1325
1339
  const s = document.createElement("canvas"), o = s.getContext("2d");
1326
1340
  if (!o) return null;
1327
- const a = await _i(i);
1341
+ const a = await Ci(i);
1328
1342
  if (!a) return null;
1329
1343
  s.width = a.naturalWidth || window.innerWidth, s.height = a.naturalHeight || window.innerHeight, o.drawImage(a, 0, 0);
1330
1344
  const l = Be(e, s.width, s.height);
1331
1345
  o.fillStyle = "#e5e7eb";
1332
1346
  for (const c of r) {
1333
- const h = Oe(l, c);
1347
+ const h = ze(l, c);
1334
1348
  o.fillRect(h.left, h.top, h.width, h.height);
1335
1349
  }
1336
1350
  for (const c of t)
1337
- c.type === "draw" && c.drawPath ? Bi(o, c.drawPath, l, n?.primary) : c.type === "pin" && Ui(
1351
+ c.type === "draw" && c.drawPath ? Bi(o, c.drawPath, l, n?.primary) : c.type === "pin" && Oi(
1338
1352
  o,
1339
- K(l, c.x),
1340
- G(l, c.y),
1353
+ G(l, c.x),
1354
+ Z(l, c.y),
1341
1355
  n
1342
1356
  );
1343
- return zi(s);
1357
+ return Ui(s);
1344
1358
  }
1345
- function Hi(i) {
1359
+ function Ni(i) {
1346
1360
  const t = [];
1347
- for (const s of Fi(i, `.${rt}`))
1348
- dt(t, s.getBoundingClientRect(), Mt(s));
1361
+ for (const s of Fi(i, `.${nt}`))
1362
+ ut(t, s.getBoundingClientRect(), Rt(s));
1349
1363
  for (const s of i.querySelectorAll("input, textarea, select")) {
1350
- if (Rt(s)) continue;
1351
- const o = s instanceof HTMLInputElement || s instanceof HTMLTextAreaElement || s instanceof HTMLSelectElement ? s.value : "", a = s.closest(`.${z}`) !== null, l = se(s) || Q(o, s) !== o;
1352
- !a && !l || dt(t, s.getBoundingClientRect(), Mt(s), Nt);
1364
+ if (It(s)) continue;
1365
+ const o = s instanceof HTMLInputElement || s instanceof HTMLTextAreaElement || s instanceof HTMLSelectElement ? s.value : "", a = s.closest(`.${O}`) !== null, l = se(s) || tt(o, s) !== o;
1366
+ !a && !l || ut(t, s.getBoundingClientRect(), Rt(s), Nt);
1353
1367
  }
1354
1368
  const e = document.createTreeWalker(i, NodeFilter.SHOW_TEXT), r = oe();
1355
1369
  let n = e.nextNode();
1356
1370
  for (; n; ) {
1357
- const s = n.parentElement, o = n.textContent ?? "", a = s?.closest(`.${z}`) !== null, l = _(o) !== o || ae(n, r);
1358
- if (s && !Rt(s) && (a || l)) {
1359
- const c = j(s), h = document.createRange();
1371
+ const s = n.parentElement, o = n.textContent ?? "", a = s?.closest(`.${O}`) !== null, l = C(o) !== o || ae(n, r);
1372
+ if (s && !It(s) && (a || l)) {
1373
+ const c = $(s), h = document.createRange();
1360
1374
  h.selectNodeContents(n);
1361
1375
  for (const u of Array.from(h.getClientRects()))
1362
- dt(t, u, c, Nt);
1376
+ ut(t, u, c, Nt);
1363
1377
  }
1364
1378
  n = e.nextNode();
1365
1379
  }
1366
1380
  return t;
1367
1381
  }
1368
- function Mt(i) {
1369
- return j(Jt(i));
1382
+ function Rt(i) {
1383
+ return $(Jt(i));
1370
1384
  }
1371
1385
  function Fi(i, t) {
1372
1386
  const e = Array.from(i.querySelectorAll(t));
1373
1387
  return i.matches(t) ? [i, ...e] : e;
1374
1388
  }
1375
- function Rt(i) {
1376
- return i.closest(`#${y}`) !== null || i.closest(`.${rt}`) !== null;
1389
+ function It(i) {
1390
+ return i.closest(`#${w}`) !== null || i.closest(`.${nt}`) !== null;
1377
1391
  }
1378
- function dt(i, t, e, r = 0) {
1392
+ function ut(i, t, e, r = 0) {
1379
1393
  if (![t.left, t.top, t.width, t.height].every(Number.isFinite))
1380
1394
  throw new Error("Invalid privacy redaction geometry");
1381
1395
  t.width <= 0 || t.height <= 0 || i.push({
@@ -1390,28 +1404,28 @@ function Bi(i, t, e, r = Qt) {
1390
1404
  for (const n of ce(t))
1391
1405
  if (n.length !== 0) {
1392
1406
  i.beginPath(), i.moveTo(
1393
- K(e, n[0][0]),
1394
- G(e, n[0][1])
1407
+ G(e, n[0][0]),
1408
+ Z(e, n[0][1])
1395
1409
  );
1396
1410
  for (let s = 1; s < n.length; s++)
1397
1411
  i.lineTo(
1398
- K(e, n[s][0]),
1399
- G(e, n[s][1])
1412
+ G(e, n[s][0]),
1413
+ Z(e, n[s][1])
1400
1414
  );
1401
1415
  i.shadowColor = "transparent", i.strokeStyle = "rgba(15, 23, 42, 0.72)", i.lineWidth = 7, i.stroke(), i.strokeStyle = "#ffffff", i.lineWidth = 5.5, i.stroke(), i.strokeStyle = r, i.lineWidth = 3.5, i.stroke();
1402
1416
  }
1403
1417
  i.restore();
1404
1418
  }
1405
- const It = 16e6, Nt = 2;
1406
- function Oi(i) {
1419
+ const Ht = 16e6, Nt = 2;
1420
+ function zi(i) {
1407
1421
  const t = i.width * i.height;
1408
- return !Number.isFinite(t) || t <= It ? 1 : Math.sqrt(It / t);
1422
+ return !Number.isFinite(t) || t <= Ht ? 1 : Math.sqrt(Ht / t);
1409
1423
  }
1410
- function Ui(i, t, e, r) {
1424
+ function Oi(i, t, e, r) {
1411
1425
  const n = r?.primary ?? Qt;
1412
1426
  i.save(), i.shadowColor = "rgba(15, 23, 42, 0.68)", i.shadowOffsetY = 2, i.shadowBlur = 8, i.fillStyle = n, i.beginPath(), i.arc(t, e, 11, 0, Math.PI * 2), i.fill(), i.shadowColor = "transparent", i.lineWidth = 2, i.strokeStyle = "#ffffff", i.stroke(), i.restore();
1413
1427
  }
1414
- function zi(i) {
1428
+ function Ui(i) {
1415
1429
  return new Promise((t) => {
1416
1430
  try {
1417
1431
  i.toBlob((e) => t(e), "image/jpeg", 0.85);
@@ -1442,7 +1456,7 @@ class $i {
1442
1456
  for (const e of this.listeners) e(t);
1443
1457
  }
1444
1458
  }
1445
- const St = new $i();
1459
+ const _t = new $i();
1446
1460
  function ji(i) {
1447
1461
  return !i || typeof i != "object" || !("name" in i) ? void 0 : String(i.name) || void 0;
1448
1462
  }
@@ -1471,7 +1485,7 @@ class Xi {
1471
1485
  this.errors = [], this.unsubscribe = null;
1472
1486
  }
1473
1487
  start() {
1474
- this.unsubscribe || (this.unsubscribe = St.subscribe((t) => this.record(t)));
1488
+ this.unsubscribe || (this.unsubscribe = _t.subscribe((t) => this.record(t)));
1475
1489
  }
1476
1490
  record(t) {
1477
1491
  this.addError(de(t));
@@ -1486,52 +1500,52 @@ class Xi {
1486
1500
  this.unsubscribe?.(), this.unsubscribe = null;
1487
1501
  }
1488
1502
  }
1489
- const V = /* @__PURE__ */ new Set();
1490
- let N = null, H = null, F = null, tt = null, B = null, et = null;
1503
+ const X = /* @__PURE__ */ new Set();
1504
+ let I = null, H = null, N = null, et = null, F = null, it = null;
1491
1505
  function ue(i) {
1492
- V.add(i), Ki();
1506
+ X.add(i), Ki();
1493
1507
  let t = !1;
1494
1508
  return () => {
1495
- t || (t = !0, V.delete(i), V.size === 0 && Gi());
1509
+ t || (t = !0, X.delete(i), X.size === 0 && Gi());
1496
1510
  };
1497
1511
  }
1498
- function ut(i, t) {
1512
+ function mt(i, t) {
1499
1513
  const e = { type: i, fromUrl: t, toUrl: location.href };
1500
- et = e.toUrl;
1501
- for (const r of [...V])
1514
+ it = e.toUrl;
1515
+ for (const r of [...X])
1502
1516
  try {
1503
1517
  r(e);
1504
1518
  } catch {
1505
1519
  }
1506
1520
  }
1507
1521
  function Ki() {
1508
- if (F) return;
1509
- et = location.href, B = () => ut("pop", et ?? location.href), window.addEventListener("popstate", B), N = history.pushState, H = history.replaceState;
1510
- const i = N, t = H;
1511
- F = function(e, r, n) {
1522
+ if (N) return;
1523
+ it = location.href, F = () => mt("pop", it ?? location.href), window.addEventListener("popstate", F), I = history.pushState, H = history.replaceState;
1524
+ const i = I, t = H;
1525
+ N = function(e, r, n) {
1512
1526
  const s = location.href;
1513
- i.call(history, e, r, n), ut("push", s);
1514
- }, tt = function(e, r, n) {
1527
+ i.call(history, e, r, n), mt("push", s);
1528
+ }, et = function(e, r, n) {
1515
1529
  const s = location.href;
1516
- t.call(history, e, r, n), ut("replace", s);
1517
- }, history.pushState = F, history.replaceState = tt;
1530
+ t.call(history, e, r, n), mt("replace", s);
1531
+ }, history.pushState = N, history.replaceState = et;
1518
1532
  }
1519
1533
  function Gi() {
1520
- B && (window.removeEventListener("popstate", B), B = null), N && history.pushState === F && (history.pushState = N), H && history.replaceState === tt && (history.replaceState = H), N = null, H = null, F = null, tt = null, et = null;
1534
+ F && (window.removeEventListener("popstate", F), F = null), I && history.pushState === N && (history.pushState = I), H && history.replaceState === et && (history.replaceState = H), I = null, H = null, N = null, et = null, it = null;
1521
1535
  }
1522
1536
  const Zi = 20;
1523
1537
  function Ji(i) {
1524
- return nt(i) ? kt(i) : xt(i);
1538
+ return st(i) ? Et(i) : kt(i);
1525
1539
  }
1526
1540
  function Qi(i) {
1527
- return nt(i) ? te(i) : Zt(i);
1541
+ return st(i) ? te(i) : Zt(i);
1528
1542
  }
1529
1543
  class tr {
1530
1544
  constructor() {
1531
1545
  this.breadcrumbs = [], this.active = !1, this.unsubscribeErrors = null, this.unsubscribeNavigation = null, this.lastUrl = "", this.boundClickHandler = (t) => this.handleClick(t), this.boundChangeHandler = (t) => this.handleChange(t);
1532
1546
  }
1533
1547
  start() {
1534
- this.active || (this.active = !0, this.lastUrl = location.href, document.addEventListener("click", this.boundClickHandler, { capture: !0, passive: !0 }), document.addEventListener("change", this.boundChangeHandler, { capture: !0, passive: !0 }), this.unsubscribeErrors = St.subscribe((t) => this.recordError(t)), this.unsubscribeNavigation = ue(() => this.handleNavigation()));
1548
+ this.active || (this.active = !0, this.lastUrl = location.href, document.addEventListener("click", this.boundClickHandler, { capture: !0, passive: !0 }), document.addEventListener("change", this.boundChangeHandler, { capture: !0, passive: !0 }), this.unsubscribeErrors = _t.subscribe((t) => this.recordError(t)), this.unsubscribeNavigation = ue(() => this.handleNavigation()));
1535
1549
  }
1536
1550
  stop() {
1537
1551
  this.active && (this.active = !1, document.removeEventListener("click", this.boundClickHandler, !0), document.removeEventListener("change", this.boundChangeHandler, !0), this.unsubscribeErrors?.(), this.unsubscribeErrors = null, this.unsubscribeNavigation?.(), this.unsubscribeNavigation = null);
@@ -1560,7 +1574,7 @@ class tr {
1560
1574
  const e = t.target;
1561
1575
  if (e && !k(e))
1562
1576
  try {
1563
- const r = e, n = nt(e) ? kt(e) : r.name || r.placeholder || e.getAttribute("aria-label") || e.tagName;
1577
+ const r = e, n = st(e) ? Et(e) : r.name || r.placeholder || e.getAttribute("aria-label") || e.tagName;
1564
1578
  this.add({
1565
1579
  type: "ui",
1566
1580
  category: "ui.input",
@@ -1586,7 +1600,7 @@ class tr {
1586
1600
  const t = this.lastUrl, e = location.href;
1587
1601
  if (t === e) return;
1588
1602
  this.lastUrl = e;
1589
- const r = $(t), n = $(e);
1603
+ const r = U(t), n = U(e);
1590
1604
  this.add({
1591
1605
  type: "navigation",
1592
1606
  category: "navigation",
@@ -1596,31 +1610,31 @@ class tr {
1596
1610
  });
1597
1611
  }
1598
1612
  }
1599
- const be = "mtb_frustration_state";
1600
- let gt = null;
1601
- function it() {
1613
+ const me = "mtb_frustration_state";
1614
+ let vt = null;
1615
+ function rt() {
1602
1616
  try {
1603
- const i = window.sessionStorage.getItem(be);
1604
- return X(i ? JSON.parse(i) : gt);
1617
+ const i = window.sessionStorage.getItem(me);
1618
+ return K(i ? JSON.parse(i) : vt);
1605
1619
  } catch {
1606
- return X(gt);
1620
+ return K(vt);
1607
1621
  }
1608
1622
  }
1609
- function me(i) {
1610
- const t = X(i);
1611
- gt = t;
1623
+ function be(i) {
1624
+ const t = K(i);
1625
+ vt = t;
1612
1626
  try {
1613
- window.sessionStorage.setItem(be, JSON.stringify(t));
1627
+ window.sessionStorage.setItem(me, JSON.stringify(t));
1614
1628
  } catch {
1615
1629
  }
1616
1630
  }
1617
1631
  function er() {
1618
- return it().dismissedByUser;
1632
+ return rt().dismissedByUser;
1619
1633
  }
1620
1634
  function ir() {
1621
- me({ ...it(), dismissedByUser: !0 });
1635
+ be({ ...rt(), dismissedByUser: !0 });
1622
1636
  }
1623
- function X(i) {
1637
+ function K(i) {
1624
1638
  const t = i ?? {};
1625
1639
  return {
1626
1640
  navTimestamps: Array.isArray(t.navTimestamps) ? t.navTimestamps.filter((e) => typeof e == "number") : [],
@@ -1638,7 +1652,7 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1638
1652
  "LABEL",
1639
1653
  "SUMMARY",
1640
1654
  "DETAILS"
1641
- ]), br = /* @__PURE__ */ new Set([
1655
+ ]), mr = /* @__PURE__ */ new Set([
1642
1656
  "button",
1643
1657
  "link",
1644
1658
  "checkbox",
@@ -1652,24 +1666,24 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1652
1666
  "listbox",
1653
1667
  "slider",
1654
1668
  "spinbutton"
1655
- ]), mr = /* @__PURE__ */ new Set(["A", "BUTTON", "SUMMARY"]), pr = /* @__PURE__ */ new Set(["button", "link", "tab", "menuitem"]), Ht = [
1669
+ ]), br = /* @__PURE__ */ new Set(["A", "BUTTON", "SUMMARY"]), pr = /* @__PURE__ */ new Set(["button", "link", "tab", "menuitem"]), Ft = [
1656
1670
  /\bnot found\b/,
1657
1671
  /\bserver error\b/,
1658
1672
  /^\s*(?:http\s*)?[45]\d{2}\s*$/,
1659
1673
  /\b(?:error|http|status)\s*[:-]?\s*[45]\d{2}\b/,
1660
1674
  /\b[45]\d{2}\s*[:-]?\s*error\b/
1661
- ], U = class U {
1675
+ ], z = class z {
1662
1676
  constructor(t) {
1663
1677
  this.clickHistory = [], this.unsubscribeErrors = null, this.active = !1, this.lastInteraction = null, this.cooldownUntil = 0, this.navTimestamps = [], this.unsubscribeNavigation = null, this.boundPageLeaveHandler = null, this.boundTurboNavigationHandler = null, this.lastNavigationAt = -1, this.boundSubmitHandler = null, this.boundInvalidHandler = null, this.recentSubmitForms = /* @__PURE__ */ new WeakSet(), this.recentFailedForms = /* @__PURE__ */ new WeakSet(), this.formFailureTimestamps = /* @__PURE__ */ new WeakMap(), this.errorPageUrls = /* @__PURE__ */ new Set(), this.domObserver = null, this.pendingDomChecks = 0, this.lastMutationAt = -1, this.pendingTimers = /* @__PURE__ */ new Set(), this.onFrustration = t, this.boundClickHandler = (e) => this.handleClick(e);
1664
1678
  }
1665
1679
  start() {
1666
- this.active || (this.active = !0, this.restoreState(), document.addEventListener("click", this.boundClickHandler, !0), this.unsubscribeErrors = St.subscribe(() => {
1680
+ this.active || (this.active = !0, this.restoreState(), document.addEventListener("click", this.boundClickHandler, !0), this.unsubscribeErrors = _t.subscribe(() => {
1667
1681
  const t = Date.now();
1668
1682
  if (!this.lastInteraction || t - this.lastInteraction.time > cr) return;
1669
1683
  const e = this.lastInteraction;
1670
1684
  this.lastInteraction = null, this.emitIfReady({
1671
1685
  signal: "dead_click",
1672
- target: W(e.target),
1686
+ target: q(e.target),
1673
1687
  detail: "Uncaught error after interaction",
1674
1688
  timestamp: t
1675
1689
  });
@@ -1702,12 +1716,12 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1702
1716
  // `rapid_navigation` can never reach its 3-in-5s threshold), no cooldown, and no
1703
1717
  // memory of which error pages it already reported.
1704
1718
  restoreState() {
1705
- const t = it();
1719
+ const t = rt();
1706
1720
  this.navTimestamps = t.navTimestamps, this.cooldownUntil = t.cooldownUntil, this.errorPageUrls = new Set(t.errorPageUrls);
1707
1721
  }
1708
1722
  persistState() {
1709
- const t = it();
1710
- me({
1723
+ const t = rt();
1724
+ be({
1711
1725
  ...t,
1712
1726
  navTimestamps: this.navTimestamps,
1713
1727
  cooldownUntil: this.cooldownUntil,
@@ -1730,7 +1744,7 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1730
1744
  if (this.clickHistory = this.clickHistory.filter((a) => a.time > s), this.clickHistory.filter((a) => a.target === r).length >= rr) {
1731
1745
  this.clickHistory = [], this.emitHighPriority({
1732
1746
  signal: "rage_click",
1733
- target: W(r),
1747
+ target: q(r),
1734
1748
  timestamp: n
1735
1749
  });
1736
1750
  return;
@@ -1777,7 +1791,7 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1777
1791
  const e = Date.now(), r = e - lr, n = (this.formFailureTimestamps.get(t) ?? []).filter((s) => s > r);
1778
1792
  n.push(e), this.formFailureTimestamps.set(t, n), !(n.length < ar) && (this.formFailureTimestamps.set(t, []), this.emitIfReady({
1779
1793
  signal: "form_failure",
1780
- target: W(t),
1794
+ target: q(t),
1781
1795
  timestamp: e
1782
1796
  }));
1783
1797
  }
@@ -1791,7 +1805,7 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1791
1805
  const t = location.href;
1792
1806
  if (this.errorPageUrls.has(t)) return;
1793
1807
  const e = document.title.toLowerCase();
1794
- if (Ht.some((n) => n.test(e))) {
1808
+ if (Ft.some((n) => n.test(e))) {
1795
1809
  this.errorPageUrls.add(t), this.emitHighPriority({
1796
1810
  signal: "error_page",
1797
1811
  detail: document.title,
@@ -1804,7 +1818,7 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1804
1818
  );
1805
1819
  for (const n of r) {
1806
1820
  const s = n.textContent ?? "";
1807
- if (s.length < 200 && Ht.some((o) => o.test(s.toLowerCase()))) {
1821
+ if (s.length < 200 && Ft.some((o) => o.test(s.toLowerCase()))) {
1808
1822
  this.errorPageUrls.add(t), this.emitHighPriority({
1809
1823
  signal: "error_page",
1810
1824
  detail: s.trim().slice(0, 60),
@@ -1823,7 +1837,7 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1823
1837
  const r = this.lastMutationAt >= e, n = this.lastNavigationAt >= e;
1824
1838
  this.pendingDomChecks === 0 && this.disconnectDomObserver(), !r && !n && this.active && this.emitIfReady({
1825
1839
  signal: "dead_click_dom",
1826
- target: W(t),
1840
+ target: q(t),
1827
1841
  timestamp: e
1828
1842
  });
1829
1843
  }, hr));
@@ -1842,7 +1856,7 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1842
1856
  this.domObserver?.disconnect(), this.domObserver = null;
1843
1857
  }
1844
1858
  looksInteractive(t) {
1845
- if (mr.has(t.tagName) || t.hasAttribute("onclick")) return !0;
1859
+ if (br.has(t.tagName) || t.hasAttribute("onclick")) return !0;
1846
1860
  const e = t.getAttribute("role");
1847
1861
  if (e && pr.has(e) || window.getComputedStyle(t).cursor === "pointer") return !0;
1848
1862
  if (t.classList)
@@ -1866,19 +1880,19 @@ const rr = 4, nr = 1500, sr = 3, or = 5e3, bt = 500, ar = 2, lr = 3e4, cr = 2e3,
1866
1880
  isIntrinsicInteractive(t) {
1867
1881
  if (ur.has(t.tagName)) return !0;
1868
1882
  const e = t.getAttribute("role");
1869
- return e && br.has(e) || t.hasAttribute("onclick") || t.hasAttribute("tabindex") ? !0 : t.contentEditable === "true";
1883
+ return e && mr.has(e) || t.hasAttribute("onclick") || t.hasAttribute("tabindex") ? !0 : t.contentEditable === "true";
1870
1884
  }
1871
1885
  emitIfReady(t) {
1872
1886
  const e = Date.now();
1873
- e < this.cooldownUntil || (this.cooldownUntil = e + U.COOLDOWN_MS, this.persistState(), this.onFrustration(t));
1887
+ e < this.cooldownUntil || (this.cooldownUntil = e + z.COOLDOWN_MS, this.persistState(), this.onFrustration(t));
1874
1888
  }
1875
1889
  emitHighPriority(t) {
1876
- this.cooldownUntil = Date.now() + U.COOLDOWN_MS, this.persistState(), this.onFrustration(t);
1890
+ this.cooldownUntil = Date.now() + z.COOLDOWN_MS, this.persistState(), this.onFrustration(t);
1877
1891
  }
1878
1892
  };
1879
- U.COOLDOWN_MS = 6e4;
1880
- let vt = U;
1881
- function W(i) {
1893
+ z.COOLDOWN_MS = 6e4;
1894
+ let wt = z;
1895
+ function q(i) {
1882
1896
  const t = i.tagName.toLowerCase(), e = i.id ? `#${i.id}` : "", r = i.className && typeof i.className == "string" ? "." + i.className.trim().split(/\s+/).slice(0, 2).join(".") : "", n = i.textContent?.trim().slice(0, 30) ?? "";
1883
1897
  return `<${t}${e}${r}>${n ? ` "${n}"` : ""}`;
1884
1898
  }
@@ -1887,8 +1901,8 @@ class fr extends Error {
1887
1901
  super(`HTTP ${t}`), this.name = "ApiError", this.status = t;
1888
1902
  }
1889
1903
  }
1890
- const gr = 25e3, vr = "https://makethisbetter.dev/api/v1", yr = "sensitive-data-v1";
1891
- class wr {
1904
+ const gr = 25e3, vr = "https://makethisbetter.dev/api/v1", wr = "sensitive-data-v1";
1905
+ class yr {
1892
1906
  constructor(t) {
1893
1907
  this.projectKey = t.projectKey, this.apiUrl = (t.apiUrl ?? vr).replace(/\/$/, ""), this.retryDelayMs = t.retryDelayMs ?? 1e3, this.userToken = t.userToken, this.userTokenFn = t.userTokenFn;
1894
1908
  }
@@ -1933,7 +1947,7 @@ class wr {
1933
1947
  n.append("feedback[screenshot]", e, `screenshot.${l}`);
1934
1948
  }
1935
1949
  const s = await this.authHeaders();
1936
- return s["X-Submission-Token"] = r, s["X-MTB-Capture-Policy"] = yr, s["X-Idempotency-Key"] = kr(), { ...(await (await this.fetchWithRetry(`${this.apiUrl}/widget/feedback_submission_sessions`, {
1950
+ return s["X-Submission-Token"] = r, s["X-MTB-Capture-Policy"] = wr, s["X-Idempotency-Key"] = kr(), { ...(await (await this.fetchWithRetry(`${this.apiUrl}/widget/feedback_submission_sessions`, {
1937
1951
  method: "POST",
1938
1952
  headers: s,
1939
1953
  body: n
@@ -1968,7 +1982,7 @@ class wr {
1968
1982
  // before finalize: finalizing deactivates the session and the server then
1969
1983
  // rejects the answer as terminal.
1970
1984
  async answerClarification(t, e, r) {
1971
- return this.requestClarification(t, e, { message: _(r) });
1985
+ return this.requestClarification(t, e, { message: C(r) });
1972
1986
  }
1973
1987
  async requestClarification(t, e, r) {
1974
1988
  const n = await this.submissionHeaders(e, "application/json");
@@ -2033,16 +2047,16 @@ class wr {
2033
2047
  n = await fetch(t, e);
2034
2048
  } catch (s) {
2035
2049
  if (r > 0 && !e.signal?.aborted)
2036
- return await Ft(this.retryDelayMs), this.fetchWithRetry(t, e, r - 1);
2050
+ return await Bt(this.retryDelayMs), this.fetchWithRetry(t, e, r - 1);
2037
2051
  throw s;
2038
2052
  }
2039
2053
  if (n.ok) return n;
2040
2054
  if (n.status >= 500 && r > 0)
2041
- return await Ft(this.retryDelayMs), this.fetchWithRetry(t, e, r - 1);
2055
+ return await Bt(this.retryDelayMs), this.fetchWithRetry(t, e, r - 1);
2042
2056
  throw new fr(n.status);
2043
2057
  }
2044
2058
  }
2045
- function Ft(i) {
2059
+ function Bt(i) {
2046
2060
  return i <= 0 ? Promise.resolve() : new Promise((t) => setTimeout(t, i));
2047
2061
  }
2048
2062
  async function xr(i, t) {
@@ -2050,13 +2064,13 @@ async function xr(i, t) {
2050
2064
  let n = "", s = null;
2051
2065
  const o = (a) => {
2052
2066
  const l = a.split(`
2053
- `).find((m) => m.startsWith("event:")), c = a.split(`
2054
- `).find((m) => m.startsWith("data:"));
2067
+ `).find((b) => b.startsWith("event:")), c = a.split(`
2068
+ `).find((b) => b.startsWith("data:"));
2055
2069
  if (!c) return;
2056
2070
  const h = l?.slice(6).trim(), u = JSON.parse(c.slice(5).trim());
2057
2071
  h === "delta" && typeof u.text == "string" ? t(u.text) : h === "done" && (s = {
2058
2072
  messages: Array.isArray(u.messages) ? u.messages : [],
2059
- suggestions: Array.isArray(u.suggestions) ? u.suggestions.filter((m) => typeof m == "string") : [],
2073
+ suggestions: Array.isArray(u.suggestions) ? u.suggestions.filter((b) => typeof b == "string") : [],
2060
2074
  done: u.done !== !1,
2061
2075
  failed: u.error === !0
2062
2076
  });
@@ -2094,19 +2108,19 @@ function Er() {
2094
2108
  const i = crypto.getRandomValues(new Uint8Array(32));
2095
2109
  return Array.from(i, (t) => t.toString(16).padStart(2, "0")).join("");
2096
2110
  }
2097
- const Bt = "mtb_anon_id", pe = "mtb_reporter_email", fe = "mtb_board_url";
2111
+ const zt = "mtb_anon_id", pe = "mtb_reporter_email", fe = "mtb_board_url";
2098
2112
  let Ot = null, ge = null, ve = null;
2099
- function ye() {
2113
+ function we() {
2100
2114
  try {
2101
- const i = window.localStorage.getItem(Bt);
2115
+ const i = window.localStorage.getItem(zt);
2102
2116
  if (i?.startsWith("anon_")) return i;
2103
2117
  const t = Ut();
2104
- return window.localStorage.setItem(Bt, t), t;
2118
+ return window.localStorage.setItem(zt, t), t;
2105
2119
  } catch {
2106
2120
  return Ot ?? (Ot = Ut()), Ot;
2107
2121
  }
2108
2122
  }
2109
- function we() {
2123
+ function ye() {
2110
2124
  try {
2111
2125
  return window.localStorage.getItem(pe) ?? void 0;
2112
2126
  } catch {
@@ -2120,7 +2134,7 @@ function Sr(i) {
2120
2134
  } catch {
2121
2135
  }
2122
2136
  }
2123
- function Cr() {
2137
+ function _r() {
2124
2138
  try {
2125
2139
  return window.localStorage.getItem(fe) ?? void 0;
2126
2140
  } catch {
@@ -2137,7 +2151,7 @@ function L(i) {
2137
2151
  function Ut() {
2138
2152
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `anon_${crypto.randomUUID()}` : `anon_${`${Date.now().toString(16)}-${Math.random().toString(16).slice(2, 10)}`}`;
2139
2153
  }
2140
- const _r = {
2154
+ const Cr = {
2141
2155
  tab: "Feedback",
2142
2156
  toolbar: {
2143
2157
  markup: "Mark up",
@@ -2178,7 +2192,9 @@ const _r = {
2178
2192
  notify: "Notify"
2179
2193
  },
2180
2194
  error: {
2181
- submit: "Failed to submit. Please try again."
2195
+ submit: "Failed to submit. Please try again.",
2196
+ finalize_title: "We couldn't send this yet.",
2197
+ finalize_message: "Your feedback is still saved. Please try again."
2182
2198
  },
2183
2199
  pet: {
2184
2200
  bubble: "Need help?"
@@ -2264,7 +2280,9 @@ const _r = {
2264
2280
  notify: "通知我"
2265
2281
  },
2266
2282
  error: {
2267
- submit: "提交失败,请重试。"
2283
+ submit: "提交失败,请重试。",
2284
+ finalize_title: "暂时无法发送。",
2285
+ finalize_message: "你的反馈仍已保存,请重试。"
2268
2286
  },
2269
2287
  pet: {
2270
2288
  bubble: "需要帮助吗?"
@@ -2350,7 +2368,9 @@ const _r = {
2350
2368
  notify: "通知"
2351
2369
  },
2352
2370
  error: {
2353
- submit: "送信に失敗しました。もう一度お試しください。"
2371
+ submit: "送信に失敗しました。もう一度お試しください。",
2372
+ finalize_title: "まだ送信できませんでした。",
2373
+ finalize_message: "フィードバックは保存されています。もう一度お試しください。"
2354
2374
  },
2355
2375
  pet: {
2356
2376
  bubble: "お困りですか?"
@@ -2436,7 +2456,9 @@ const _r = {
2436
2456
  notify: "알림"
2437
2457
  },
2438
2458
  error: {
2439
- submit: "제출에 실패했습니다. 다시 시도해 주세요."
2459
+ submit: "제출에 실패했습니다. 다시 시도해 주세요.",
2460
+ finalize_title: "아직 전송하지 못했습니다.",
2461
+ finalize_message: "피드백은 저장되어 있습니다. 다시 시도해 주세요."
2440
2462
  },
2441
2463
  pet: {
2442
2464
  bubble: "도움이 필요하신가요?"
@@ -2522,7 +2544,9 @@ const _r = {
2522
2544
  notify: "Avisarme"
2523
2545
  },
2524
2546
  error: {
2525
- submit: "Error al enviar. Por favor, inténtalo de nuevo."
2547
+ submit: "Error al enviar. Por favor, inténtalo de nuevo.",
2548
+ finalize_title: "Aún no pudimos enviarlo.",
2549
+ finalize_message: "Tu comentario sigue guardado. Inténtalo de nuevo."
2526
2550
  },
2527
2551
  pet: {
2528
2552
  bubble: "¿Necesitas ayuda?"
@@ -2608,7 +2632,9 @@ const _r = {
2608
2632
  notify: "Avertir"
2609
2633
  },
2610
2634
  error: {
2611
- submit: "Échec de l'envoi. Veuillez réessayer."
2635
+ submit: "Échec de l'envoi. Veuillez réessayer.",
2636
+ finalize_title: "Nous n'avons pas encore pu l'envoyer.",
2637
+ finalize_message: "Votre retour est toujours enregistré. Veuillez réessayer."
2612
2638
  },
2613
2639
  pet: {
2614
2640
  bubble: "Besoin d'aide ?"
@@ -2694,7 +2720,9 @@ const _r = {
2694
2720
  notify: "Melden"
2695
2721
  },
2696
2722
  error: {
2697
- submit: "Senden fehlgeschlagen. Bitte versuchen Sie es erneut."
2723
+ submit: "Senden fehlgeschlagen. Bitte versuchen Sie es erneut.",
2724
+ finalize_title: "Wir konnten dies noch nicht senden.",
2725
+ finalize_message: "Ihr Feedback ist weiterhin gespeichert. Bitte versuchen Sie es erneut."
2698
2726
  },
2699
2727
  pet: {
2700
2728
  bubble: "Brauchen Sie Hilfe?"
@@ -2740,7 +2768,7 @@ const _r = {
2740
2768
  expired: "Diese Feedback-Sitzung ist abgelaufen, bevor sie gesendet werden konnte. Bitte schließe das Widget und sende erneut."
2741
2769
  }
2742
2770
  }, P = {
2743
- en: _r,
2771
+ en: Cr,
2744
2772
  "zh-CN": Tr,
2745
2773
  ja: Ar,
2746
2774
  ko: Lr,
@@ -2748,12 +2776,12 @@ const _r = {
2748
2776
  fr: Dr,
2749
2777
  de: Mr
2750
2778
  };
2751
- function zt(i) {
2779
+ function $t(i) {
2752
2780
  if (P[i]) return P[i];
2753
2781
  const t = i.split("-")[0];
2754
2782
  return P[t] ? P[t] : P.en;
2755
2783
  }
2756
- const Rr = 60, $t = ["value", "content"], Ir = Object.fromEntries([
2784
+ const Rr = 60, jt = ["value", "content"], Ir = Object.fromEntries([
2757
2785
  "button",
2758
2786
  "checkbox",
2759
2787
  "color",
@@ -2778,15 +2806,15 @@ const Rr = 60, $t = ["value", "content"], Ir = Object.fromEntries([
2778
2806
  "time",
2779
2807
  "url",
2780
2808
  "week"
2781
- ].map((i) => [i, !0])), Nr = "https://cdn.jsdelivr.net/npm/@rrweb/record@2.1.0/umd/record.min.js", Hr = "sha384-MrD66HBNSykaP2N95+6hQCFlF5oH2tvL3TD/zyvHNkP/sAFWZx98DX9MEDy8MdVT";
2809
+ ].map((i) => [i, !0])), Hr = "https://cdn.jsdelivr.net/npm/@rrweb/record@2.1.0/umd/record.min.js", Nr = "sha384-MrD66HBNSykaP2N95+6hQCFlF5oH2tvL3TD/zyvHNkP/sAFWZx98DX9MEDy8MdVT";
2782
2810
  let D = null;
2783
2811
  function Fr() {
2784
- return D || (D = Or().catch(() => Ur()).catch((t) => {
2812
+ return D || (D = zr().catch(() => Or()).catch((t) => {
2785
2813
  throw D = null, t;
2786
2814
  }), D);
2787
2815
  }
2788
2816
  function Br(i, t) {
2789
- const e = J(i);
2817
+ const e = Q(i);
2790
2818
  return yt(e, t, oe()), e;
2791
2819
  }
2792
2820
  function yt(i, t, e) {
@@ -2794,42 +2822,42 @@ function yt(i, t, e) {
2794
2822
  i.forEach((a) => yt(a, t, e));
2795
2823
  return;
2796
2824
  }
2797
- if (!jt(i)) return;
2798
- const r = jt(i.attributes) ? i.attributes : null, n = r && $t.some((a) => typeof r[a] == "string"), o = (typeof i.text == "string" || typeof i.textContent == "string" || typeof i.value == "string" || n) && typeof i.id == "number" ? t.mirror.getNode(i.id) : null;
2825
+ if (!qt(i)) return;
2826
+ const r = qt(i.attributes) ? i.attributes : null, n = r && jt.some((a) => typeof r[a] == "string"), o = (typeof i.text == "string" || typeof i.textContent == "string" || typeof i.value == "string" || n) && typeof i.id == "number" ? t.mirror.getNode(i.id) : null;
2799
2827
  if (o instanceof Element) {
2800
- if (typeof i.text == "string" && (i.text = Q(i.text, o)), r)
2801
- for (const a of $t) {
2828
+ if (typeof i.text == "string" && (i.text = tt(i.text, o)), r)
2829
+ for (const a of jt) {
2802
2830
  const l = r[a];
2803
- typeof l == "string" && (r[a] = Q(l, o));
2831
+ typeof l == "string" && (r[a] = tt(l, o));
2804
2832
  }
2805
2833
  } else o?.nodeType === Node.TEXT_NODE && ae(o, e) && (typeof i.textContent == "string" && (i.textContent = p), typeof i.value == "string" && (i.value = p));
2806
2834
  Object.values(i).forEach((a) => yt(a, t, e));
2807
2835
  }
2808
- function jt(i) {
2836
+ function qt(i) {
2809
2837
  return !!i && typeof i == "object" && !Array.isArray(i);
2810
2838
  }
2811
- async function Or() {
2839
+ async function zr() {
2812
2840
  return (await import("@rrweb/record")).record;
2813
2841
  }
2814
- function qt() {
2842
+ function Wt() {
2815
2843
  const i = globalThis;
2816
2844
  return i.rrwebRecord?.record ?? i.rrweb?.record;
2817
2845
  }
2818
- function Ur() {
2846
+ function Or() {
2819
2847
  return new Promise((i, t) => {
2820
- const e = qt();
2848
+ const e = Wt();
2821
2849
  if (e) {
2822
2850
  i(e);
2823
2851
  return;
2824
2852
  }
2825
2853
  const r = document.createElement("script");
2826
- r.src = Nr, r.integrity = Hr, r.crossOrigin = "anonymous", r.onload = () => {
2827
- const n = qt();
2854
+ r.src = Hr, r.integrity = Nr, r.crossOrigin = "anonymous", r.onload = () => {
2855
+ const n = Wt();
2828
2856
  n ? i(n) : t(new Error("rrweb record global not found after script load"));
2829
2857
  }, r.onerror = () => t(new Error("Failed to load rrweb from CDN")), document.head.appendChild(r);
2830
2858
  });
2831
2859
  }
2832
- class zr {
2860
+ class Ur {
2833
2861
  constructor(t, e) {
2834
2862
  this.events = [], this.stopFn = null, this.startedAt = 0, this.timer = null, this.clickHandler = null, this.stopped = !1, this.destroyed = !1, this.shadow = t, this.onMaxReached = e;
2835
2863
  }
@@ -2848,10 +2876,10 @@ class zr {
2848
2876
  // ordinary values are returned unchanged.
2849
2877
  maskAllInputs: !1,
2850
2878
  maskInputOptions: Ir,
2851
- maskInputFn: (e, r) => r.closest(`.${z}`) ? p : Q(e, r),
2879
+ maskInputFn: (e, r) => r.closest(`.${O}`) ? p : tt(e, r),
2852
2880
  maskTextFn: () => p,
2853
- blockClass: rt,
2854
- maskTextClass: z
2881
+ blockClass: nt,
2882
+ maskTextClass: O
2855
2883
  }), this.clickHandler = (e) => {
2856
2884
  this.showClickRipple(e.clientX, e.clientY), t.addCustomEvent?.("mtb-click", {
2857
2885
  x: e.clientX,
@@ -2906,7 +2934,7 @@ class jr {
2906
2934
  this.session = null, this.bar = null, this.result = null;
2907
2935
  }
2908
2936
  async start(t, e, r) {
2909
- this.session = new zr(t, r), this.bar = new $r(
2937
+ this.session = new Ur(t, r), this.bar = new $r(
2910
2938
  t,
2911
2939
  e,
2912
2940
  () => this.session?.getDuration() ?? 0,
@@ -2926,58 +2954,31 @@ class jr {
2926
2954
  this.session?.destroy(), this.session = null, this.bar?.destroy(), this.bar = null;
2927
2955
  }
2928
2956
  }
2929
- class qr {
2930
- constructor(t, e, r) {
2931
- this.el = t.el("div", "mtb-failure"), this.el.style.right = "20px", this.el.style.bottom = "20px", this.el.setAttribute("role", "alert");
2932
- const n = r.onRetry ? `<div class="mtb-failure-actions">
2933
- <button class="mtb-clarify-retry mtb-failure-retry" type="button">${d(e.clarify.retry)}</button>
2934
- </div>` : "";
2935
- this.el.innerHTML = `
2936
- <button class="mtb-failure-close" type="button" title="${d(e.success.close)}" aria-label="${d(e.success.close)}">
2937
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
2938
- <path d="M18 6L6 18M6 6l12 12"/>
2939
- </svg>
2940
- </button>
2941
- <div class="mtb-failure-icon">
2942
- <svg width="23" height="23" viewBox="0 0 24 24" fill="none" stroke="#dc2626" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
2943
- <path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>
2944
- <line x1="12" y1="9" x2="12" y2="13"/>
2945
- <line x1="12" y1="17" x2="12.01" y2="17"/>
2946
- </svg>
2947
- </div>
2948
- <div class="mtb-failure-title">${d(e.error.submit)}</div>
2949
- ${n}
2950
- `, t.append(this.el), r.onRetry && this.el.querySelector(".mtb-failure-retry").addEventListener("click", r.onRetry), this.el.querySelector(".mtb-failure-close").addEventListener("click", r.onClose);
2951
- }
2952
- destroy() {
2953
- this.el.remove();
2954
- }
2955
- }
2956
- function Wr() {
2957
+ function qr() {
2957
2958
  return {
2958
- page_url: $(window.location.href),
2959
+ page_url: U(window.location.href),
2959
2960
  user_agent: navigator.userAgent,
2960
- browser: Yr(),
2961
- os: Vr(),
2961
+ browser: Wr(),
2962
+ os: Yr(),
2962
2963
  screen_width: window.screen.width,
2963
2964
  screen_height: window.screen.height
2964
2965
  };
2965
2966
  }
2966
- function Yr() {
2967
+ function Wr() {
2967
2968
  const i = navigator.userAgent;
2968
2969
  return /Edg\//.test(i) ? `Edge ${i.match(/Edg\/(\S+)/)?.[1] ?? ""}` : /OPR\//.test(i) ? `Opera ${i.match(/OPR\/(\S+)/)?.[1] ?? ""}` : /Chrome\//.test(i) ? `Chrome ${i.match(/Chrome\/(\S+)/)?.[1] ?? ""}` : /Safari\//.test(i) && /Version\//.test(i) ? `Safari ${i.match(/Version\/(\S+)/)?.[1] ?? ""}` : /Firefox\//.test(i) ? `Firefox ${i.match(/Firefox\/(\S+)/)?.[1] ?? ""}` : "Unknown";
2969
2970
  }
2970
- function Vr() {
2971
+ function Yr() {
2971
2972
  const i = navigator.userAgent;
2972
2973
  return /Windows NT 10/.test(i) ? "Windows 10/11" : /Windows NT/.test(i) ? "Windows" : /Mac OS X 10_15|macOS 1[56789]/.test(i) || /Mac OS X/.test(i) ? "macOS" : /Android/.test(i) ? `Android ${i.match(/Android (\d+)/)?.[1] ?? ""}` : /iPhone|iPad|iPod/.test(i) ? "iOS" : /Linux/.test(i) ? "Linux" : "Unknown";
2973
2974
  }
2974
- function Xr(i) {
2975
+ function Vr(i) {
2975
2976
  const { description: t, pageContext: e, consoleErrors: r, annotation: n, user: s, recording: o, anonId: a, anonEmail: l, breadcrumbs: c } = i;
2976
2977
  return {
2977
- ...J({
2978
+ ...Q({
2978
2979
  description: t,
2979
2980
  ...e,
2980
- page_url: $(e.page_url),
2981
+ page_url: U(e.page_url),
2981
2982
  console_errors: r,
2982
2983
  annotations: n ? [n] : [],
2983
2984
  target_element: n?.targetSelector ? {
@@ -2999,10 +3000,10 @@ function Xr(i) {
2999
3000
  reporter_email: s ? void 0 : l
3000
3001
  };
3001
3002
  }
3002
- const Kr = 300, Gr = 5e3;
3003
- class Zr {
3003
+ const Xr = 300, Kr = 5e3;
3004
+ class Gr {
3004
3005
  constructor(t, e) {
3005
- this.deps = t, this.host = e, this.activeSubmission = null, this.pendingSubmissionRequest = null, this.submissionAttempt = 0, this.pendingScreenshotTask = null, this.screenshotAbortController = null, this.failure = null, this.screenshotEnabled = !0;
3006
+ this.deps = t, this.host = e, this.activeSubmission = null, this.pendingSubmissionRequest = null, this.submissionAttempt = 0, this.pendingScreenshotTask = null, this.screenshotAbortController = null, this.screenshotEnabled = !0;
3006
3007
  }
3007
3008
  /**
3008
3009
  * What the note surface must render. Reading it back rather than assuming
@@ -3039,23 +3040,23 @@ class Zr {
3039
3040
  // Load the screenshot dependency and font CSS ahead of submit. Bitmap capture
3040
3041
  // starts alongside Session creation; only cross-origin fallback waits for it.
3041
3042
  warmScreenshotDeps() {
3042
- this.screenshotEnabled && Et();
3043
+ this.screenshotEnabled && St();
3043
3044
  }
3044
3045
  start(t, e, r) {
3045
3046
  const n = ++this.submissionAttempt, s = this.createSubmission(t, e, r, n);
3046
3047
  return this.pendingSubmissionRequest = s, s;
3047
3048
  }
3048
3049
  async createSubmission(t, e, r, n) {
3049
- if (await Wt(), n !== this.submissionAttempt) return null;
3050
- const s = Wr(), o = Xr({
3050
+ if (await Yt(), n !== this.submissionAttempt) return null;
3051
+ const s = qr(), o = Vr({
3051
3052
  description: t,
3052
3053
  pageContext: s,
3053
3054
  consoleErrors: this.deps.consoleCollector.getErrors(),
3054
3055
  annotation: e,
3055
3056
  user: this.deps.user(),
3056
3057
  recording: r,
3057
- anonId: ye(),
3058
- anonEmail: we(),
3058
+ anonId: we(),
3059
+ anonEmail: ye(),
3059
3060
  breadcrumbs: this.deps.breadcrumbCollector.getBreadcrumbs()
3060
3061
  });
3061
3062
  let a;
@@ -3068,15 +3069,15 @@ class Zr {
3068
3069
  if (this.screenshotEnabled) {
3069
3070
  const h = new AbortController();
3070
3071
  l = h, this.screenshotAbortController?.abort(), this.screenshotAbortController = h;
3071
- const m = (async () => {
3072
+ const b = (async () => {
3072
3073
  try {
3073
- const g = await Pi(async (ot, ke) => {
3074
- const _t = await a;
3074
+ const g = await Pi(async (at, ke) => {
3075
+ const Tt = await a;
3075
3076
  if (!(h.signal.aborted || n !== this.submissionAttempt))
3076
3077
  return this.deps.apiClient.resolveScreenshotResourceUrl(
3077
- _t.id,
3078
- _t.token,
3079
- ot,
3078
+ Tt.id,
3079
+ Tt.token,
3080
+ at,
3080
3081
  ke,
3081
3082
  h.signal
3082
3083
  );
@@ -3084,15 +3085,15 @@ class Zr {
3084
3085
  if (h.signal.aborted || n !== this.submissionAttempt || !g) return;
3085
3086
  const f = await Di(g, e ? [e] : [], this.deps.brandColors);
3086
3087
  if (h.signal.aborted || n !== this.submissionAttempt || !f) return;
3087
- const b = await a;
3088
+ const m = await a;
3088
3089
  if (h.signal.aborted || n !== this.submissionAttempt) return;
3089
- await this.deps.apiClient.uploadScreenshot(b.id, b.token, f, h.signal);
3090
+ await this.deps.apiClient.uploadScreenshot(m.id, m.token, f, h.signal);
3090
3091
  } catch {
3091
3092
  }
3092
3093
  })().finally(() => {
3093
- this.pendingScreenshotTask === m && (this.pendingScreenshotTask = null), this.screenshotAbortController === h && (this.screenshotAbortController = null);
3094
+ this.pendingScreenshotTask === b && (this.pendingScreenshotTask = null), this.screenshotAbortController === h && (this.screenshotAbortController = null);
3094
3095
  });
3095
- this.pendingScreenshotTask = m;
3096
+ this.pendingScreenshotTask = b;
3096
3097
  }
3097
3098
  let c;
3098
3099
  try {
@@ -3115,7 +3116,7 @@ class Zr {
3115
3116
  throw new Error("No active submission session");
3116
3117
  }
3117
3118
  if (await this.waitForScreenshot(), t !== this.submissionAttempt) return;
3118
- const n = e ? Promise.resolve() : new Promise((o) => setTimeout(o, Kr));
3119
+ const n = e ? Promise.resolve() : new Promise((o) => setTimeout(o, Xr));
3119
3120
  let s;
3120
3121
  try {
3121
3122
  s = await this.deps.apiClient.finalizeSubmissionSession(r.id, r.token);
@@ -3123,7 +3124,7 @@ class Zr {
3123
3124
  if (e) return this.showFinalizeFailure({ canRetry: !0 });
3124
3125
  throw o;
3125
3126
  }
3126
- await Promise.all([n, Wt()]), !(t !== this.submissionAttempt || this.activeSubmission !== r) && (this.activeSubmission = null, this.pendingSubmissionRequest = null, this.host.onFinalized(s, r));
3127
+ await Promise.all([n, Yt()]), !(t !== this.submissionAttempt || this.activeSubmission !== r) && (this.activeSubmission = null, this.pendingSubmissionRequest = null, this.host.onFinalized(s, r));
3127
3128
  }
3128
3129
  async waitForScreenshot() {
3129
3130
  const t = this.pendingScreenshotTask;
@@ -3132,22 +3133,16 @@ class Zr {
3132
3133
  const r = await Promise.race([
3133
3134
  t.then(() => !0),
3134
3135
  new Promise((n) => {
3135
- e = setTimeout(() => n(!1), Gr);
3136
+ e = setTimeout(() => n(!1), Kr);
3136
3137
  })
3137
3138
  ]);
3138
3139
  e !== void 0 && clearTimeout(e), r || (this.screenshotAbortController?.abort(), this.pendingScreenshotTask === t && (this.pendingScreenshotTask = null));
3139
3140
  }
3140
3141
  showFinalizeFailure(t) {
3141
- this.host.onReleaseForFailureCard(), this.failure?.destroy(), this.failure = new qr(this.deps.shadow(), this.deps.messages(), {
3142
- onRetry: t.canRetry ? () => this.retryBackgroundFinalization() : void 0,
3143
- onClose: () => this.dismissFinalizeFailure()
3144
- });
3142
+ this.host.onFinalizeFailure(t.canRetry ? () => this.retryBackgroundFinalization() : void 0);
3145
3143
  }
3146
3144
  retryBackgroundFinalization() {
3147
- this.dismissFinalizeFailure(), this.host.onReenterBackground(), this.finalize().catch(() => this.showFinalizeFailure({ canRetry: !0 }));
3148
- }
3149
- dismissFinalizeFailure() {
3150
- this.failure?.destroy(), this.failure = null;
3145
+ this.host.onReenterBackground(), this.finalize().catch(() => this.showFinalizeFailure({ canRetry: !0 }));
3151
3146
  }
3152
3147
  /**
3153
3148
  * Invalidate every in-flight attempt and abandon what already reached the
@@ -3160,13 +3155,13 @@ class Zr {
3160
3155
  });
3161
3156
  }
3162
3157
  }
3163
- function Wt() {
3158
+ function Yt() {
3164
3159
  return new Promise((i) => requestAnimationFrame(() => setTimeout(i, 0)));
3165
3160
  }
3166
- function st(i) {
3161
+ function ot(i) {
3167
3162
  i.preventDefault(), i.stopPropagation();
3168
3163
  }
3169
- class w {
3164
+ class y {
3170
3165
  constructor(t) {
3171
3166
  this.host = t, this.launcherLit = !0, this.acceptsFrustrationPrompt = !1;
3172
3167
  }
@@ -3189,7 +3184,7 @@ class w {
3189
3184
  handleDrawStroke() {
3190
3185
  }
3191
3186
  }
3192
- class M extends w {
3187
+ class W extends y {
3193
3188
  constructor() {
3194
3189
  super(...arguments), this.kind = "idle", this.launcherLit = !1, this.acceptsFrustrationPrompt = !0;
3195
3190
  }
@@ -3204,7 +3199,7 @@ class M extends w {
3204
3199
  this.handleOpen();
3205
3200
  }
3206
3201
  }
3207
- class x extends w {
3202
+ class x extends y {
3208
3203
  constructor() {
3209
3204
  super(...arguments), this.kind = "annotating";
3210
3205
  }
@@ -3218,16 +3213,16 @@ class x extends w {
3218
3213
  // exit: the toolbar and session deliberately outlive this state — they span
3219
3214
  // the whole flow and are released by the flow-ending paths, not per mode.
3220
3215
  handleEscape(t) {
3221
- st(t), this.host.exitAll();
3216
+ ot(t), this.host.exitAll();
3222
3217
  }
3223
3218
  handleToolbarModeChange(t) {
3224
3219
  t === "record" ? this.host.transitionTo(new Ct(this.host)) : this.host.transitionTo(new x(this.host));
3225
3220
  }
3226
3221
  handleDrawStroke() {
3227
- this.host.transitionTo(new Jr(this.host, S() ? "sheet" : "bar"));
3222
+ this.host.transitionTo(new Zr(this.host, S() ? "sheet" : "bar"));
3228
3223
  }
3229
3224
  }
3230
- class Ct extends w {
3225
+ class Ct extends y {
3231
3226
  constructor() {
3232
3227
  super(...arguments), this.kind = "recording";
3233
3228
  }
@@ -3235,13 +3230,13 @@ class Ct extends w {
3235
3230
  this.host.clearCurrentAnnotation(), this.host.teardownDrawBar(), this.host.destroySession(), this.host.startRecorder();
3236
3231
  }
3237
3232
  handleEscape(t) {
3238
- st(t), this.host.stopRecordingIntoNote();
3233
+ ot(t), this.host.stopRecordingIntoNote();
3239
3234
  }
3240
3235
  handleToolbarModeChange(t) {
3241
3236
  t !== "record" && this.host.transitionTo(new x(this.host));
3242
3237
  }
3243
3238
  }
3244
- class Jr extends w {
3239
+ class Zr extends y {
3245
3240
  // Which note surface collects the drawing's note: the inline bar on a
3246
3241
  // desktop, the bottom sheet on touch.
3247
3242
  constructor(t, e) {
@@ -3251,7 +3246,7 @@ class Jr extends w {
3251
3246
  this.surface === "sheet" ? this.host.mountDrawSheet() : (this.host.mountDrawBar(), this.host.refreshDrawBar());
3252
3247
  }
3253
3248
  handleEscape(t) {
3254
- st(t), this.host.cancelDraw();
3249
+ ot(t), this.host.cancelDraw();
3255
3250
  }
3256
3251
  handleToolbarModeChange(t) {
3257
3252
  t === "record" ? this.host.transitionTo(new Ct(this.host)) : this.host.transitionTo(new x(this.host));
@@ -3260,7 +3255,7 @@ class Jr extends w {
3260
3255
  this.surface === "bar" && this.host.refreshDrawBar();
3261
3256
  }
3262
3257
  }
3263
- class Yt extends w {
3258
+ class Vt extends y {
3264
3259
  constructor(t, e) {
3265
3260
  super(t), this.opts = e, this.kind = "popup";
3266
3261
  }
@@ -3268,13 +3263,13 @@ class Yt extends w {
3268
3263
  this.host.mountNotePopup(this.opts);
3269
3264
  }
3270
3265
  handleEscape(t) {
3271
- st(t), this.host.exitAll();
3266
+ ot(t), this.host.exitAll();
3272
3267
  }
3273
3268
  handleToolbarModeChange(t) {
3274
3269
  t === "record" ? this.host.transitionTo(new Ct(this.host)) : (this.host.dismissNotePopup(), this.host.transitionTo(new x(this.host)));
3275
3270
  }
3276
3271
  }
3277
- class mt extends w {
3272
+ class pt extends y {
3278
3273
  constructor() {
3279
3274
  super(...arguments), this.kind = "clarifying";
3280
3275
  }
@@ -3285,7 +3280,7 @@ class mt extends w {
3285
3280
  this.host.revertToolbarDuringClarify();
3286
3281
  }
3287
3282
  }
3288
- class Vt extends w {
3283
+ class Y extends y {
3289
3284
  constructor() {
3290
3285
  super(...arguments), this.kind = "submitting", this.launcherLit = !1;
3291
3286
  }
@@ -3297,9 +3292,9 @@ class Vt extends w {
3297
3292
  // Escape falls through unconsumed: nothing is on screen to dismiss, and the
3298
3293
  // background finalize must not be cancellable by a stray keypress.
3299
3294
  }
3300
- const Qr = /^#[0-9a-f]{6}$/i;
3301
- function tn(i) {
3302
- return i === void 0 ? void 0 : typeof i != "object" || i === null || ![i.primary, i.hover, i.active, i.onPrimary].every((e) => typeof e == "string" && Qr.test(e)) ? Xt() : {
3295
+ const Jr = /^#[0-9a-f]{6}$/i;
3296
+ function Qr(i) {
3297
+ return i === void 0 ? void 0 : typeof i != "object" || i === null || ![i.primary, i.hover, i.active, i.onPrimary].every((e) => typeof e == "string" && Jr.test(e)) ? Xt() : {
3303
3298
  primary: i.primary.toLowerCase(),
3304
3299
  hover: i.hover.toLowerCase(),
3305
3300
  active: i.active.toLowerCase(),
@@ -3315,22 +3310,22 @@ function Kt() {
3315
3310
  const { hostname: i } = window.location;
3316
3311
  return i === "localhost" || i === "127.0.0.1" || i === "[::1]" || i.endsWith(".localhost") || i.endsWith(".local") || i.endsWith(".test");
3317
3312
  }
3318
- class en {
3313
+ class tn {
3319
3314
  constructor(t) {
3320
- this.tab = null, this.toolbar = null, this.session = null, this.drawBar = null, this.dim = null, this.pageOffset = new Le(), this.chatPopup = null, this.scrollLock = null, this.success = null, this.frustrationPrompt = null, this.frustrationDetector = null, this.state = new M(this), this.via = "pin", this.currentAnnotation = null, this.lastPopupPos = null, this.recordingManager = null, this.touchHintShown = !1, this.lastHandoff = {}, this.handleKeydown = (e) => {
3321
- e.key === "Escape" && (wt(e) || this.state.handleEscape(e));
3315
+ this.tab = null, this.toolbar = null, this.session = null, this.drawBar = null, this.dim = null, this.pageOffset = new Le(), this.chatPopup = null, this.scrollLock = null, this.success = null, this.frustrationPrompt = null, this.frustrationDetector = null, this.state = new W(this), this.via = "pin", this.currentAnnotation = null, this.lastPopupPos = null, this.recordingManager = null, this.touchHintShown = !1, this.lastHandoff = {}, this.handleKeydown = (e) => {
3316
+ e.key === "Escape" && (xt(e) || this.state.handleEscape(e));
3322
3317
  }, this.stopRecordingIntoNote = () => {
3323
- this.recordingManager && (this.recordingManager.stop(), this.via = "record", this.transitionTo(new Yt(this, {
3318
+ this.recordingManager && (this.recordingManager.stop(), this.via = "record", this.transitionTo(new Vt(this, {
3324
3319
  x: window.innerWidth / 2,
3325
3320
  y: window.innerHeight / 2,
3326
3321
  targetName: this.messages.record.timer_label
3327
3322
  })));
3328
- }, this.config = t, t.projectKey || console.warn("[MakeThisBetter] projectKey is missing. Feedback submission will be rejected."), this.brandColors = tn(t.brandColors), this.messages = zt(t.locale ?? document.documentElement.lang ?? "en"), this.apiClient = new wr({
3323
+ }, this.config = t, t.projectKey || console.warn("[MakeThisBetter] projectKey is missing. Feedback submission will be rejected."), this.brandColors = Qr(t.brandColors), this.messages = $t(t.locale ?? document.documentElement.lang ?? "en"), this.apiClient = new yr({
3329
3324
  projectKey: t.projectKey,
3330
3325
  apiUrl: t.apiUrl,
3331
3326
  userToken: t.userToken,
3332
3327
  userTokenFn: t.userTokenFn
3333
- }), this.consoleCollector = new Xi(), this.consoleCollector.start(), this.breadcrumbCollector = new tr(), this.breadcrumbCollector.start(), this.lifecycle = new Zr(
3328
+ }), this.consoleCollector = new Xi(), this.consoleCollector.start(), this.breadcrumbCollector = new tr(), this.breadcrumbCollector.start(), this.lifecycle = new Gr(
3334
3329
  {
3335
3330
  apiClient: this.apiClient,
3336
3331
  consoleCollector: this.consoleCollector,
@@ -3342,10 +3337,8 @@ class en {
3342
3337
  },
3343
3338
  {
3344
3339
  isBackground: () => this.state.kind === "submitting",
3345
- onReleaseForFailureCard: () => {
3346
- this.chatPopup?.destroy(), this.chatPopup = null, this.transitionTo(new M(this));
3347
- },
3348
- onReenterBackground: () => this.transitionTo(new Vt(this)),
3340
+ onFinalizeFailure: (e) => this.chatPopup?.showFinalizeFailure(e),
3341
+ onReenterBackground: () => this.transitionTo(new Y(this)),
3349
3342
  onFinalized: (e, r) => this.handleFinalized(e, r)
3350
3343
  }
3351
3344
  );
@@ -3355,7 +3348,7 @@ class en {
3355
3348
  this.consoleCollector.stop(), this.breadcrumbCollector.stop(), console.warn("[MakeThisBetter] Widget failed to start:", e);
3356
3349
  return;
3357
3350
  }
3358
- t.frustrationDetection !== !1 && (this.frustrationDetector = new vt(() => this.handleFrustration()), this.frustrationDetector.start()), document.addEventListener("keydown", this.handleKeydown, !0);
3351
+ t.frustrationDetection !== !1 && (this.frustrationDetector = new wt(() => this.handleFrustration()), this.frustrationDetector.start()), document.addEventListener("keydown", this.handleKeydown, !0);
3359
3352
  }
3360
3353
  /**
3361
3354
  * The single mutation point of the mode machine: the outgoing state exits,
@@ -3366,7 +3359,7 @@ class en {
3366
3359
  this.state = t, e.exit(), t.enter(), this.tab?.setActive(t.launcherLit);
3367
3360
  }
3368
3361
  buildUI() {
3369
- if (this.shadow = new pt(this.config.theme ?? "auto", this.brandColors), this.config.entryMode === "api") {
3362
+ if (this.shadow = new ft(this.config.theme ?? "auto", this.brandColors), this.config.entryMode === "api") {
3370
3363
  Kt() && console.warn(
3371
3364
  '[MakeThisBetter] entryMode: "api" renders no launcher. Call MakeThisBetter.open() from your own UI.'
3372
3365
  );
@@ -3381,7 +3374,7 @@ class en {
3381
3374
  this.mountTab();
3382
3375
  }
3383
3376
  mountTab() {
3384
- this.tab || !this.shadow || (this.tab = new Ce(
3377
+ this.tab || !this.shadow || (this.tab = new _e(
3385
3378
  this.shadow,
3386
3379
  this.messages,
3387
3380
  this.config.position ?? "right",
@@ -3406,7 +3399,7 @@ class en {
3406
3399
  // the language they were opened in rather than being re-rendered underneath a
3407
3400
  // reporter who may be mid-sentence.
3408
3401
  setLocale(t) {
3409
- this.config.locale = t, this.messages = zt(t), this.tab?.setMessages(this.messages);
3402
+ this.config.locale = t, this.messages = $t(t), this.tab?.setMessages(this.messages);
3410
3403
  }
3411
3404
  handleFrustration() {
3412
3405
  !this.state.acceptsFrustrationPrompt || this.frustrationPrompt || er() || (this.frustrationPrompt = new Te(this.shadow, this.messages, {
@@ -3431,9 +3424,9 @@ class en {
3431
3424
  return this.toolbar !== null;
3432
3425
  }
3433
3426
  mountAnnotationChrome() {
3434
- Et();
3427
+ St();
3435
3428
  const t = S();
3436
- this.toolbar = new Ne(
3429
+ this.toolbar = new He(
3437
3430
  this.shadow,
3438
3431
  this.messages,
3439
3432
  () => this.exitAll(),
@@ -3448,7 +3441,7 @@ class en {
3448
3441
  ensureSession() {
3449
3442
  this.session || (this.session = new Ge(this.shadow, this.messages, {
3450
3443
  onPin: (t, e) => {
3451
- this.currentAnnotation = t, this.via = "pin", this.transitionTo(new Yt(this, {
3444
+ this.currentAnnotation = t, this.via = "pin", this.transitionTo(new Vt(this, {
3452
3445
  x: t.x,
3453
3446
  y: t.y,
3454
3447
  targetName: e,
@@ -3496,7 +3489,7 @@ class en {
3496
3489
  mountDrawSheet() {
3497
3490
  this.engageScrollLock();
3498
3491
  let t = !1;
3499
- this.chatPopup = new lt(this.shadow, {
3492
+ this.chatPopup = new ct(this.shadow, {
3500
3493
  targetName: this.messages.annotation.drawing,
3501
3494
  x: window.innerWidth / 2,
3502
3495
  y: window.innerHeight / 2,
@@ -3516,9 +3509,9 @@ class en {
3516
3509
  },
3517
3510
  onClarify: async (e, r, n, s) => this.apiClient.streamClarification(e, r, n, s),
3518
3511
  onAnswer: (e, r, n) => this.apiClient.answerClarification(e, r, n),
3519
- onFinalize: () => this.lifecycle.finalize(),
3512
+ onFinalize: () => (this.transitionTo(new Y(this)), this.lifecycle.finalize()),
3520
3513
  onCancel: () => t ? this.exitAll() : this.cancelDraw(),
3521
- onConversationOpen: () => this.transitionTo(new mt(this)),
3514
+ onConversationOpen: () => this.transitionTo(new pt(this)),
3522
3515
  onActivity: () => this.lifecycle.warmScreenshotDeps(),
3523
3516
  resolveBoardLink: () => this.buildViewFeedbackHandler() ?? this.buildMyFeedbackHandler(),
3524
3517
  resolveEmailCapture: () => this.buildEmailCapture()
@@ -3547,7 +3540,7 @@ class en {
3547
3540
  this.teardownDrawBar(), this.releaseScrollLock(), this.dim?.destroy(), this.dim = null, this.mountChatAfterSubmit(r, e, n);
3548
3541
  }
3549
3542
  mountChatAfterSubmit(t, e, r) {
3550
- this.dim = new Tt(this.shadow, () => this.exitAll()), this.engageScrollLock(), this.chatPopup = new lt(this.shadow, {
3543
+ this.dim = new At(this.shadow, () => this.exitAll()), this.engageScrollLock(), this.chatPopup = new ct(this.shadow, {
3551
3544
  targetName: e?.targetName ?? this.messages.annotation.drawing,
3552
3545
  x: this.lastPopupPos?.x ?? window.innerWidth / 2,
3553
3546
  y: this.lastPopupPos?.y ?? window.innerHeight / 2,
@@ -3559,19 +3552,19 @@ class en {
3559
3552
  },
3560
3553
  onClarify: async (n, s, o, a) => this.apiClient.streamClarification(n, s, o, a),
3561
3554
  onAnswer: (n, s, o) => this.apiClient.answerClarification(n, s, o),
3562
- onFinalize: () => this.lifecycle.finalize(),
3555
+ onFinalize: () => (this.transitionTo(new Y(this)), this.lifecycle.finalize()),
3563
3556
  onCancel: () => this.exitAll(),
3564
- onConversationOpen: () => this.transitionTo(new mt(this)),
3557
+ onConversationOpen: () => this.transitionTo(new pt(this)),
3565
3558
  resolveBoardLink: () => this.buildViewFeedbackHandler() ?? this.buildMyFeedbackHandler(),
3566
3559
  resolveEmailCapture: () => this.buildEmailCapture()
3567
3560
  }), this.chatPopup.submit(t);
3568
3561
  }
3569
3562
  mountNotePopup({ x: t, y: e, targetName: r, targetRect: n }) {
3570
- this.lastPopupPos = { x: t, y: e }, this.teardownDrawBar(), this.session?.dismissInteraction(), this.chatPopup?.destroy(), this.chatPopup = null, this.dim?.destroy(), this.dim = null, this.dim = new Tt(this.shadow, () => this.exitAll());
3563
+ this.lastPopupPos = { x: t, y: e }, this.teardownDrawBar(), this.session?.dismissInteraction(), this.chatPopup?.destroy(), this.chatPopup = null, this.dim?.destroy(), this.dim = null, this.dim = new At(this.shadow, () => this.exitAll());
3571
3564
  const s = this.recordingManager?.getRecording();
3572
3565
  s && this.lifecycle.setScreenshotEnabled(!0);
3573
3566
  const o = this.currentAnnotation, a = this.recordingManager?.getRecording() ?? void 0;
3574
- this.chatPopup = new lt(this.shadow, {
3567
+ this.chatPopup = new ct(this.shadow, {
3575
3568
  targetName: r,
3576
3569
  x: t,
3577
3570
  y: e,
@@ -3586,12 +3579,11 @@ class en {
3586
3579
  onClarify: async (l, c, h, u) => this.apiClient.streamClarification(l, c, h, u),
3587
3580
  onAnswer: (l, c, h) => this.apiClient.answerClarification(l, c, h),
3588
3581
  // The chat card turns into a receipt at this point: the pin, the scrim
3589
- // and the scroll lock have nothing left to hold, and a failure from here
3590
- // on has to reach the reporter through its own card rather than a
3591
- // conversation that has already said thank you.
3592
- onFinalize: () => (this.teardownSubmittingUi(), this.transitionTo(new Vt(this)), this.lifecycle.finalize()),
3582
+ // and the scroll lock have nothing left to hold. A finalization failure
3583
+ // remains in this card as a retryable receipt state.
3584
+ onFinalize: () => (this.teardownSubmittingUi(), this.transitionTo(new Y(this)), this.lifecycle.finalize()),
3593
3585
  onCancel: () => this.exitAll(),
3594
- onConversationOpen: () => this.transitionTo(new mt(this)),
3586
+ onConversationOpen: () => this.transitionTo(new pt(this)),
3595
3587
  onActivity: () => this.lifecycle.warmScreenshotDeps(),
3596
3588
  resolveBoardLink: () => this.buildViewFeedbackHandler() ?? this.buildMyFeedbackHandler(),
3597
3589
  resolveEmailCapture: () => this.buildEmailCapture(),
@@ -3617,9 +3609,9 @@ class en {
3617
3609
  this.scrollLock?.release(), this.scrollLock = null;
3618
3610
  }
3619
3611
  buildMyFeedbackHandler() {
3620
- if (!this.config.user && Cr())
3612
+ if (!this.config.user && _r())
3621
3613
  return async () => {
3622
- const t = await this.apiClient.createIdentityToken(ye());
3614
+ const t = await this.apiClient.createIdentityToken(we());
3623
3615
  !t?.identity_token || !t.board_url || (L(t.board_url), window.open(`${t.board_url}?identity=${encodeURIComponent(t.identity_token)}`, "_blank"));
3624
3616
  };
3625
3617
  }
@@ -3639,21 +3631,21 @@ class en {
3639
3631
  identityToken: t.identity_token
3640
3632
  }, t.board_url && L(t.board_url), !(this.chatPopup && this.chatPopup.sessionId() !== e.id) && !(!this.chatPopup && this.state.kind !== "submitting" && this.state.kind !== "clarifying")) {
3641
3633
  if (this.chatPopup) {
3642
- this.teardownSubmittingUi(), this.teardownToolbar(), this.lifecycle.resetScreenshotConsent(), this.transitionTo(new M(this));
3634
+ this.chatPopup.showFinalizeSuccess(), this.teardownSubmittingUi(), this.teardownToolbar(), this.lifecycle.resetScreenshotConsent(), this.transitionTo(new W(this));
3643
3635
  return;
3644
3636
  }
3645
3637
  this.teardownToolbar(), this.lifecycle.resetScreenshotConsent(), this.showSuccess({ skipFollowup: e.ai_clarify_available === !1 });
3646
3638
  }
3647
3639
  }
3648
3640
  showSuccess(t) {
3649
- this.lifecycle.dismissFinalizeFailure(), this.transitionTo(new M(this)), this.success = new bi(this.shadow, this.messages, () => {
3641
+ this.transitionTo(new W(this)), this.success = new mi(this.shadow, this.messages, () => {
3650
3642
  this.success?.destroy(), this.success = null;
3651
3643
  }, { ...t, onViewFeedback: this.buildViewFeedbackHandler() });
3652
3644
  }
3653
3645
  buildEmailCapture() {
3654
3646
  if (this.config.user) return;
3655
3647
  const { feedbackId: t, identityToken: e } = this.lastHandoff;
3656
- if (!(!t || !e) && !we())
3648
+ if (!(!t || !e) && !ye())
3657
3649
  return {
3658
3650
  onSubmit: async (r) => {
3659
3651
  const n = await this.apiClient.updateReporter(t, r, e);
@@ -3688,27 +3680,27 @@ class en {
3688
3680
  this.pageOffset.release(), this.toolbar?.destroy(), this.toolbar = null;
3689
3681
  }
3690
3682
  exitAll() {
3691
- this.lifecycle.abandon(), this.via = "pin", this.transitionTo(new M(this)), this.teardownToolbar(), this.teardownDrawBar(), this.releaseScrollLock(), this.session?.hideHighlight(), this.session?.destroy(), this.session = null, this.dim?.destroy(), this.dim = null, this.chatPopup?.destroy(), this.chatPopup = null, this.currentAnnotation = null, this.recordingManager?.destroy(), this.recordingManager = null;
3683
+ this.lifecycle.abandon(), this.via = "pin", this.transitionTo(new W(this)), this.teardownToolbar(), this.teardownDrawBar(), this.releaseScrollLock(), this.session?.hideHighlight(), this.session?.destroy(), this.session = null, this.dim?.destroy(), this.dim = null, this.chatPopup?.destroy(), this.chatPopup = null, this.currentAnnotation = null, this.recordingManager?.destroy(), this.recordingManager = null;
3692
3684
  }
3693
3685
  destroy() {
3694
- document.removeEventListener("keydown", this.handleKeydown, !0), this.exitAll(), this.consoleCollector.stop(), this.breadcrumbCollector.stop(), this.frustrationDetector?.stop(), this.dismissFrustrationPrompt(), this.success?.destroy(), this.lifecycle.dismissFinalizeFailure(), this.tab?.destroy(), this.recordingManager?.destroy(), this.shadow?.destroy();
3686
+ document.removeEventListener("keydown", this.handleKeydown, !0), this.exitAll(), this.consoleCollector.stop(), this.breadcrumbCollector.stop(), this.frustrationDetector?.stop(), this.dismissFrustrationPrompt(), this.success?.destroy(), this.tab?.destroy(), this.recordingManager?.destroy(), this.shadow?.destroy();
3695
3687
  }
3696
3688
  }
3697
- let v = null, E = null, C = null;
3698
- function rn() {
3699
- C && (document.removeEventListener("DOMContentLoaded", C), C = null);
3689
+ let v = null, E = null, _ = null;
3690
+ function en() {
3691
+ _ && (document.removeEventListener("DOMContentLoaded", _), _ = null);
3700
3692
  }
3701
- function R(i) {
3702
- rn(), v?.destroy(), v = i ? new en(i) : null;
3693
+ function M(i) {
3694
+ en(), v?.destroy(), v = i ? new tn(i) : null;
3703
3695
  }
3704
- const nn = {
3696
+ const rn = {
3705
3697
  init(i) {
3706
- typeof document > "u" || (R(), E = i, document.readyState === "loading" ? (C = () => {
3707
- C = null, R(i);
3708
- }, document.addEventListener("DOMContentLoaded", C, { once: !0 })) : R(i));
3698
+ typeof document > "u" || (M(), E = i, document.readyState === "loading" ? (_ = () => {
3699
+ _ = null, M(i);
3700
+ }, document.addEventListener("DOMContentLoaded", _, { once: !0 })) : M(i));
3709
3701
  },
3710
3702
  destroy() {
3711
- R(), E = null;
3703
+ M(), E = null;
3712
3704
  },
3713
3705
  setLocale(i) {
3714
3706
  E && (E.locale = i), v?.setLocale(i);
@@ -3732,11 +3724,11 @@ const nn = {
3732
3724
  v?.hideLauncher();
3733
3725
  }
3734
3726
  };
3735
- typeof window < "u" && (window.MakeThisBetter = nn, document.addEventListener("turbo:load", () => {
3736
- const i = document.getElementById(y);
3737
- E && (!i || !i.shadowRoot) && (i?.remove(), R(E));
3727
+ typeof window < "u" && (window.MakeThisBetter = rn, document.addEventListener("turbo:load", () => {
3728
+ const i = document.getElementById(w);
3729
+ E && (!i || !i.shadowRoot) && (i?.remove(), M(E));
3738
3730
  }));
3739
3731
  export {
3740
- nn as MakeThisBetter
3732
+ rn as MakeThisBetter
3741
3733
  };
3742
3734
  //# sourceMappingURL=makethisbetter.esm.js.map