gotcha-feedback 1.1.12 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,105 +1,67 @@
1
- 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');var xr=Object.defineProperty;var Wt=(e,t)=>()=>(e&&(t=e(e=0)),t);var vr=(e,t)=>{for(var o in t)xr(e,o,{get:t[o],enumerable:true});};function Qr(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function Xr(){let e=new Int32Array(256);for(let t=0;t<256;t++){let o=t;for(let r=0;r<8;r++)o=o&1?3988292384^o>>>1:o>>>1;e[t]=o;}return e}function Jr(e){let t=-1;St||(St=Xr());for(let o=0;o<e.length;o++)t=St[(t^e[o])&255]^t>>>8;return t^-1}function Zr(e){let t=e.length-1;for(let o=t;o>=4;o--)if(e[o-4]===9&&e[o-3]===Ro&&e[o-2]===Ao&&e[o-1]===Io&&e[o]===Bo)return o-3;return 0}function en(e,t,o=false){let r=new Uint8Array(13);t*=39.3701,r[0]=Ro,r[1]=Ao,r[2]=Io,r[3]=Bo,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let s=Jr(r),a=new Uint8Array(4);if(a[0]=s>>>24,a[1]=s>>>16,a[2]=s>>>8,a[3]=s&255,o){let l=Zr(e);return e.set(r,l),e.set(a,l+13),e}else {let l=new Uint8Array(4);l[0]=0,l[1]=0,l[2]=0,l[3]=9;let n=new Uint8Array(54);return n.set(e,0),n.set(l,33),n.set(r,37),n.set(a,50),n}}function nn(e){let t=e.indexOf(tn);return t===-1&&(t=e.indexOf(on)),t===-1&&(t=e.indexOf(rn)),t}function kn(e){let t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}function Po(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(se&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!se)return e;let o=ot().implementation.createHTMLDocument(),r=o.createElement("base"),s=o.createElement("a");return o.head.appendChild(r),o.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}function ot(e){return (e&&j(e)?e?.ownerDocument:e)??window.document}function Cn(e,t,o){let r=ot(o).createElementNS(rt,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function Rn(e,t){let o=new XMLSerializer().serializeToString(e);return t&&(o=o.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o)}`}function An(e,t){return new Promise((o,r)=>{let s=new FileReader;s.onload=()=>o(s.result),s.onerror=()=>r(s.error),s.onabort=()=>r(new Error(`Failed read blob to ${t}`)),s.readAsDataURL(e);})}function he(e,t){let o=ot(t).createElement("img");return o.decoding="sync",o.loading="eager",o.src=e,o}function Fe(e,t){return new Promise(o=>{let{timeout:r,ownerDocument:s,onError:a,onWarn:l}=t??{},n=typeof e=="string"?he(e,ot(s)):e,g=null,c=null;function i(){o(n),g&&clearTimeout(g),c?.();}if(r&&(g=setTimeout(i,r)),tt(n)){let p=n.currentSrc||n.src;if(!p)return n.poster?Fe(n.poster,t).then(o):i();if(n.readyState>=2)return i();let u=i,d=m=>{l?.("Failed video load",p,m),a?.(m),i();};c=()=>{n.removeEventListener("loadeddata",u),n.removeEventListener("error",d);},n.addEventListener("loadeddata",u,{once:true}),n.addEventListener("error",d,{once:true});}else {let p=Fo(n)?n.href.baseVal:n.currentSrc||n.src;if(!p)return i();let u=async()=>{if(be(n)&&"decode"in n)try{await n.decode();}catch(m){l?.("Failed to decode image, trying to render anyway",n.dataset.originalSrc||p,m);}i();},d=m=>{l?.("Failed image load",n.dataset.originalSrc||p,m),i();};if(be(n)&&n.complete)return u();c=()=>{n.removeEventListener("load",u),n.removeEventListener("error",d);},n.addEventListener("load",u,{once:true}),n.addEventListener("error",d,{once:true});}})}async function Bn(e,t){De(e)&&(be(e)||tt(e)?await Fe(e,t):await Promise.all(["img","video"].flatMap(o=>Array.from(e.querySelectorAll(o)).map(r=>Fe(r,t)))));}function Go(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function Mn(e){let t=`${Mo}[#${xo}]`;return xo++,{time:o=>e&&console.time(`${t} ${o}`),timeEnd:o=>e&&console.timeEnd(`${t} ${o}`),warn:(...o)=>e&&En(...o)}}function Dn(e){return {cache:e?"no-cache":"force-cache"}}async function nt(e,t){return cn(e)?e:Fn(e,{...t,autoDestruct:true})}async function Fn(e,t){let{scale:o=1,workerUrl:r,workerNumber:s=1}=t||{},a=!!t?.debug,l=t?.features??true,n=e.ownerDocument??(se?window.document:void 0),g=e.ownerDocument?.defaultView??(se?window:void 0),c=new Map,i={width:0,height:0,quality:1,type:"image/png",scale:o,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:Dn(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:false,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:s,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:false,...t,__CONTEXT__:true,log:Mn(a),node:e,ownerDocument:n,ownerWindow:g,dpi:o===1?null:96*o,svgStyleElement:No(n),svgDefsElement:n?.createElementNS(rt,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:sn&&r&&s?s:0})].map(()=>{try{let d=new Worker(r);return d.onmessage=async m=>{let{url:f,result:h}=m.data;h?c.get(f)?.resolve?.(h):c.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`));},d.onmessageerror=m=>{let{url:f}=m.data;c.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`));},d}catch(d){return i.log.warn("Failed to new Worker",d),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[kn(n)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:c,drawImageCount:0,tasks:[],features:l,isEnable:d=>d==="restoreScrollPosition"?typeof l=="boolean"?false:l[d]??false:typeof l=="boolean"?l:l[d]??true,shadowRoots:[]};i.log.time("wait until load"),await Bn(e,{timeout:i.timeout,onWarn:i.log.warn}),i.log.timeEnd("wait until load");let{width:p,height:u}=Pn(e,i);return i.width=p,i.height=u,i}function No(e){if(!e)return;let t=e.createElement("style"),o=t.ownerDocument.createTextNode(`
1
+ 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');var Fr=Object.defineProperty;var jt=(e,o)=>()=>(e&&(o=e(e=0)),o);var Rr=(e,o)=>{for(var t in o)Fr(e,t,{get:o[t],enumerable:true});};function nn(e,o){return e[13]=1,e[14]=o>>8,e[15]=o&255,e[16]=o>>8,e[17]=o&255,e}function sn(){let e=new Int32Array(256);for(let o=0;o<256;o++){let t=o;for(let r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[o]=t;}return e}function an(e){let o=-1;kt||(kt=sn());for(let t=0;t<e.length;t++)o=kt[(o^e[t])&255]^o>>>8;return o^-1}function ln(e){let o=e.length-1;for(let t=o;t>=4;t--)if(e[t-4]===9&&e[t-3]===Bo&&e[t-2]===Do&&e[t-1]===Mo&&e[t]===Io)return t-3;return 0}function cn(e,o,t=false){let r=new Uint8Array(13);o*=39.3701,r[0]=Bo,r[1]=Do,r[2]=Mo,r[3]=Io,r[4]=o>>>24,r[5]=o>>>16,r[6]=o>>>8,r[7]=o&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let a=an(r),s=new Uint8Array(4);if(s[0]=a>>>24,s[1]=a>>>16,s[2]=a>>>8,s[3]=a&255,t){let i=ln(e);return e.set(r,i),e.set(s,i+13),e}else {let i=new Uint8Array(4);i[0]=0,i[1]=0,i[2]=0,i[3]=9;let n=new Uint8Array(54);return n.set(e,0),n.set(i,33),n.set(r,37),n.set(s,50),n}}function fn(e){let o=e.indexOf(un);return o===-1&&(o=e.indexOf(dn)),o===-1&&(o=e.indexOf(pn)),o}function In(e){let o=e?.createElement?.("canvas");return o&&(o.height=o.width=1),!!o&&"toDataURL"in o&&!!o.toDataURL("image/webp").includes("image/webp")}function Go(e,o){if(e.match(/^[a-z]+:\/\//i))return e;if(de&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!de)return e;let t=ct().implementation.createHTMLDocument(),r=t.createElement("base"),a=t.createElement("a");return t.head.appendChild(r),t.body.appendChild(a),o&&(r.href=o),a.href=e,a.href}function ct(e){return (e&&$(e)?e?.ownerDocument:e)??window.document}function Ln(e,o,t){let r=ct(t).createElementNS(ut,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",o.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${o}`),r}function Pn(e,o){let t=new XMLSerializer().serializeToString(e);return o&&(t=t.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Nn(e,o){return new Promise((t,r)=>{let a=new FileReader;a.onload=()=>t(a.result),a.onerror=()=>r(a.error),a.onabort=()=>r(new Error(`Failed read blob to ${o}`)),a.readAsDataURL(e);})}function Ae(e,o){let t=ct(o).createElement("img");return t.decoding="sync",t.loading="eager",t.src=e,t}function We(e,o){return new Promise(t=>{let{timeout:r,ownerDocument:a,onError:s,onWarn:i}=o??{},n=typeof e=="string"?Ae(e,ct(a)):e,p=null,c=null;function l(){t(n),p&&clearTimeout(p),c?.();}if(r&&(p=setTimeout(l,r)),lt(n)){let d=n.currentSrc||n.src;if(!d)return n.poster?We(n.poster,o).then(t):l();if(n.readyState>=2)return l();let u=l,f=b=>{i?.("Failed video load",d,b),s?.(b),l();};c=()=>{n.removeEventListener("loadeddata",u),n.removeEventListener("error",f);},n.addEventListener("loadeddata",u,{once:true}),n.addEventListener("error",f,{once:true});}else {let d=No(n)?n.href.baseVal:n.currentSrc||n.src;if(!d)return l();let u=async()=>{if(Fe(n)&&"decode"in n)try{await n.decode();}catch(b){i?.("Failed to decode image, trying to render anyway",n.dataset.originalSrc||d,b);}l();},f=b=>{i?.("Failed image load",n.dataset.originalSrc||d,b),l();};if(Fe(n)&&n.complete)return u();c=()=>{n.removeEventListener("load",u),n.removeEventListener("error",f);},n.addEventListener("load",u,{once:true}),n.addEventListener("error",f,{once:true});}})}async function Un(e,o){He(e)&&(Fe(e)||lt(e)?await We(e,o):await Promise.all(["img","video"].flatMap(t=>Array.from(e.querySelectorAll(t)).map(r=>We(r,o)))));}function zo(e){return e?.split(",").map(o=>o.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function zn(e){let o=`${Lo}[#${To}]`;return To++,{time:t=>e&&console.time(`${o} ${t}`),timeEnd:t=>e&&console.timeEnd(`${o} ${t}`),warn:(...t)=>e&&Mn(...t)}}function On(e){return {cache:e?"no-cache":"force-cache"}}async function dt(e,o){return bn(e)?e:Hn(e,{...o,autoDestruct:true})}async function Hn(e,o){let{scale:t=1,workerUrl:r,workerNumber:a=1}=o||{},s=!!o?.debug,i=o?.features??true,n=e.ownerDocument??(de?window.document:void 0),p=e.ownerDocument?.defaultView??(de?window:void 0),c=new Map,l={width:0,height:0,quality:1,type:"image/png",scale:t,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:s,fetch:{requestInit:On(o?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:false,...o?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:a,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:false,...o,__CONTEXT__:true,log:zn(s),node:e,ownerDocument:n,ownerWindow:p,dpi:t===1?null:96*t,svgStyleElement:Oo(n),svgDefsElement:n?.createElementNS(ut,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:gn&&r&&a?a:0})].map(()=>{try{let f=new Worker(r);return f.onmessage=async b=>{let{url:g,result:m}=b.data;m?c.get(g)?.resolve?.(m):c.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`));},f.onmessageerror=b=>{let{url:g}=b.data;c.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`));},f}catch(f){return l.log.warn("Failed to new Worker",f),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[In(n)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:c,drawImageCount:0,tasks:[],features:i,isEnable:f=>f==="restoreScrollPosition"?typeof i=="boolean"?false:i[f]??false:typeof i=="boolean"?i:i[f]??true,shadowRoots:[]};l.log.time("wait until load"),await Un(e,{timeout:l.timeout,onWarn:l.log.warn}),l.log.timeEnd("wait until load");let{width:d,height:u}=Wn(e,l);return l.width=d,l.height=u,l}function Oo(e){if(!e)return;let o=e.createElement("style"),t=o.ownerDocument.createTextNode(`
2
2
  .______background-clip--text {
3
3
  background-clip: text;
4
4
  -webkit-background-clip: text;
5
5
  }
6
- `);return t.appendChild(o),t}function Pn(e,t){let{width:o,height:r}=t;if(j(e)&&(!o||!r)){let s=e.getBoundingClientRect();o=o||s.width||Number(e.getAttribute("width"))||0,r=r||s.height||Number(e.getAttribute("height"))||0;}return {width:o,height:r}}async function Ln(e,t){let{log:o,timeout:r,drawImageCount:s,drawImageInterval:a}=t;o.time("image to canvas");let l=await Fe(e,{timeout:r,onWarn:t.log.warn}),{canvas:n,context2d:g}=Gn(e.ownerDocument,t),c=()=>{try{g?.drawImage(l,0,0,n.width,n.height);}catch(i){t.log.warn("Failed to drawImage",i);}};if(c(),t.isEnable("fixSvgXmlDecode"))for(let i=0;i<s;i++)await new Promise(p=>{setTimeout(()=>{g?.clearRect(0,0,n.width,n.height),c(),p();},i+a);});return t.drawImageCount=0,o.timeEnd("image to canvas"),n}function Gn(e,t){let{width:o,height:r,scale:s,backgroundColor:a,maximumCanvasSize:l}=t,n=e.createElement("canvas");n.width=Math.floor(o*s),n.height=Math.floor(r*s),n.style.width=`${o}px`,n.style.height=`${r}px`,l&&(n.width>l||n.height>l)&&(n.width>l&&n.height>l?n.width>n.height?(n.height*=l/n.width,n.width=l):(n.width*=l/n.height,n.height=l):n.width>l?(n.height*=l/n.width,n.width=l):(n.width*=l/n.height,n.height=l));let g=n.getContext("2d");return g&&a&&(g.fillStyle=a,g.fillRect(0,0,n.width,n.height)),{canvas:n,context2d:g}}function Uo(e,t){if(e.ownerDocument)try{let a=e.toDataURL();if(a!=="data:,")return he(a,e.ownerDocument)}catch(a){t.log.warn("Failed to clone canvas",a);}let o=e.cloneNode(false),r=e.getContext("2d"),s=o.getContext("2d");try{return r&&s&&s.putImageData(r.getImageData(0,0,e.width,e.height),0,0),o}catch(a){t.log.warn("Failed to clone canvas",a);}return o}function Nn(e,t){try{if(e?.contentDocument?.body)return kt(e.contentDocument.body,t)}catch(o){t.log.warn("Failed to clone iframe",o);}return e.cloneNode(false)}function Un(e){let t=e.cloneNode(false);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function $n(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return he(e.poster,e.ownerDocument);let o=e.cloneNode(false);o.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(o.src=e.currentSrc);let r=o.ownerDocument;if(r){let s=true;if(await Fe(o,{onError:()=>s=false,onWarn:t.log.warn}),!s)return e.poster?he(e.poster,e.ownerDocument):o;o.currentTime=e.currentTime,await new Promise(l=>{o.addEventListener("seeked",l,{once:true});});let a=r.createElement("canvas");a.width=e.offsetWidth,a.height=e.offsetHeight;try{let l=a.getContext("2d");l&&l.drawImage(o,0,0,a.width,a.height);}catch(l){return t.log.warn("Failed to clone video",l),e.poster?he(e.poster,e.ownerDocument):o}return Uo(a,t)}return o}function zn(e,t){return hn(e)?Uo(e,t):Tn(e)?Nn(e,t):be(e)?Un(e):tt(e)?$n(e,t):e.cloneNode(false)}function On(e){let t=e.sandbox;if(!t){let{ownerDocument:o}=e;try{o&&(t=o.createElement("iframe"),t.id=`__SANDBOX__${Lo()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",o.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t);}catch(r){e.log.warn("Failed to getSandBox",r);}}return t}function $o(e,t,o){let{defaultComputedStyles:r}=o,s=e.nodeName.toLowerCase(),a=Le(e)&&s!=="svg",l=a?Hn.map(f=>[f,e.getAttribute(f)]).filter(([,f])=>f!==null):[],n=[a&&"svg",s,l.map((f,h)=>`${f}=${h}`).join(","),t].filter(Boolean).join(":");if(r.has(n))return r.get(n);let c=On(o)?.contentWindow;if(!c)return new Map;let i=c?.document,p,u;a?(p=i.createElementNS(rt,"svg"),u=p.ownerDocument.createElementNS(p.namespaceURI,s),l.forEach(([f,h])=>{u.setAttributeNS(null,f,h);}),p.appendChild(u)):p=u=i.createElement(s),u.textContent=" ",i.body.appendChild(p);let d=c.getComputedStyle(u,t),m=new Map;for(let f=d.length,h=0;h<f;h++){let b=d.item(h);_n.includes(b)||m.set(b,d.getPropertyValue(b));}return i.body.removeChild(p),r.set(n,m),m}function zo(e,t,o){let r=new Map,s=[],a=new Map;if(o)for(let n of o)l(n);else for(let n=e.length,g=0;g<n;g++){let c=e.item(g);l(c);}for(let n=s.length,g=0;g<n;g++)a.get(s[g])?.forEach((c,i)=>r.set(i,c));function l(n){let g=e.getPropertyValue(n),c=e.getPropertyPriority(n),i=n.lastIndexOf("-"),p=i>-1?n.substring(0,i):void 0;if(p){let u=a.get(p);u||(u=new Map,a.set(p,u)),u.set(n,[g,c]);}t.get(n)===g&&!c||(p?s.push(p):r.set(n,[g,c]));}return r}function Wn(e,t,o,r){let{ownerWindow:s,includeStyleProperties:a,currentParentNodeStyle:l}=r,n=t.style,g=s.getComputedStyle(e),c=$o(e,null,r);l?.forEach((p,u)=>{c.delete(u);});let i=zo(g,c,a);i.delete("transition-property"),i.delete("all"),i.delete("d"),i.delete("content"),o&&(i.delete("margin-top"),i.delete("margin-right"),i.delete("margin-bottom"),i.delete("margin-left"),i.delete("margin-block-start"),i.delete("margin-block-end"),i.delete("margin-inline-start"),i.delete("margin-inline-end"),i.set("box-sizing",["border-box",""])),i.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),Do&&(i.has("font-kerning")||i.set("font-kerning",["normal",""]),(i.get("overflow-x")?.[0]==="hidden"||i.get("overflow-y")?.[0]==="hidden")&&i.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&i.set("text-overflow",["clip",""]));for(let p=n.length,u=0;u<p;u++)n.removeProperty(n.item(u));return i.forEach(([p,u],d)=>{n.setProperty(d,p,u);}),i}function Vn(e,t){(bn(e)||yn(e)||xn(e))&&t.setAttribute("value",e.value);}function qn(e,t,o,r,s){let{ownerWindow:a,svgStyleElement:l,svgStyles:n,currentNodeStyle:g}=r;if(!l||!a)return;function c(i){let p=a.getComputedStyle(e,i),u=p.getPropertyValue("content");if(!u||u==="none")return;s?.(u),u=u.replace(/(')|(")|(counter\(.+\))/g,"");let d=[Lo()],m=$o(e,i,r);g?.forEach((w,k)=>{m.delete(k);});let f=zo(p,m,r.includeStyleProperties);f.delete("content"),f.delete("-webkit-locale"),f.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let h=[`content: '${u}';`];if(f.forEach(([w,k],R)=>{h.push(`${R}: ${w}${k?" !important":""};`);}),h.length===1)return;try{t.className=[t.className,...d].join(" ");}catch(w){r.log.warn("Failed to copyPseudoClass",w);return}let b=h.join(`
7
- `),v=n.get(b);v||(v=[],n.set(b,v)),v.push(`.${d[0]}${i}`);}jn.forEach(c),o&&Yn.forEach(c);}async function To(e,t,o,r,s){if(j(o)&&(wn(o)||Sn(o))||r.filter&&!r.filter(o))return;vo.has(t.nodeName)||vo.has(o.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;let a=await kt(o,r,false,s);r.isEnable("restoreScrollPosition")&&Kn(e,a),t.appendChild(a);}async function Eo(e,t,o,r){let s=e.firstChild;j(e)&&e.shadowRoot&&(s=e.shadowRoot?.firstChild,o.shadowRoots.push(e.shadowRoot));for(let a=s;a;a=a.nextSibling)if(!pn(a))if(j(a)&&vn(a)&&typeof a.assignedNodes=="function"){let l=a.assignedNodes();for(let n=0;n<l.length;n++)await To(e,t,l[n],o,r);}else await To(e,t,a,o,r);}function Kn(e,t){if(!De(e)||!De(t))return;let{scrollTop:o,scrollLeft:r}=e;if(!o&&!r)return;let{transform:s}=t.style,a=new DOMMatrix(s),{a:l,b:n,c:g,d:c}=a;a.a=1,a.b=0,a.c=0,a.d=1,a.translateSelf(-r,-o),a.a=l,a.b=n,a.c=g,a.d=c,t.style.transform=a.toString();}function Qn(e,t){let{backgroundColor:o,width:r,height:s,style:a}=t,l=e.style;if(o&&l.setProperty("background-color",o,"important"),r&&l.setProperty("width",`${r}px`,"important"),s&&l.setProperty("height",`${s}px`,"important"),a)for(let n in a)l[n]=a[n];}async function kt(e,t,o=false,r){let{ownerDocument:s,ownerWindow:a,fontFamilies:l,onCloneEachNode:n}=t;if(s&&mn(e))return r&&/\S/.test(e.data)&&r(e.data),s.createTextNode(e.data);if(s&&a&&j(e)&&(De(e)||Le(e))){let c=await zn(e,t);if(t.isEnable("removeAbnormalAttributes")){let f=c.getAttributeNames();for(let h=f.length,b=0;b<h;b++){let v=f[b];Xn.test(v)||c.removeAttribute(v);}}let i=t.currentNodeStyle=Wn(e,c,o,t);o&&Qn(c,t);let p=false;if(t.isEnable("copyScrollbar")){let f=[i.get("overflow-x")?.[0],i.get("overflow-y")?.[0]];p=f.includes("scroll")||(f.includes("auto")||f.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);}let u=i.get("text-transform")?.[0],d=Go(i.get("font-family")?.[0]),m=d?f=>{u==="uppercase"?f=f.toUpperCase():u==="lowercase"?f=f.toLowerCase():u==="capitalize"&&(f=f[0].toUpperCase()+f.substring(1)),d.forEach(h=>{let b=l.get(h);b||l.set(h,b=new Set),f.split("").forEach(v=>b.add(v));});}:void 0;return qn(e,c,p,t,m),Vn(e,c),tt(e)||await Eo(e,c,t,m),await n?.(c),c}let g=e.cloneNode(false);return await Eo(e,g,t),await n?.(g),g}function Jn(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove();}catch(t){e.log.warn("Failed to destroyContext",t);}e.sandbox=void 0;}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[];}function Zn(e){let{url:t,timeout:o,responseType:r,...s}=e,a=new AbortController,l=o?setTimeout(()=>a.abort(),o):void 0;return fetch(t,{signal:a.signal,...s}).then(n=>{if(!n.ok)throw new Error("Failed fetch, not 2xx response",{cause:n});switch(r){case "arrayBuffer":return n.arrayBuffer();case "dataUrl":return n.blob().then(In);default:return n.text()}}).finally(()=>clearTimeout(l))}function Pe(e,t){let{url:o,requestType:r="text",responseType:s="text",imageDom:a}=t,l=o,{timeout:n,acceptOfImage:g,requests:c,fetchFn:i,fetch:{requestInit:p,bypassingCache:u,placeholderImage:d},font:m,workers:f,fontFamilies:h}=e;r==="image"&&(et||Et)&&e.drawImageCount++;let b=c.get(o);if(!b){u&&u instanceof RegExp&&u.test(l)&&(l+=(/\?/.test(l)?"&":"?")+new Date().getTime());let v=r.startsWith("font")&&m&&m.minify,w=new Set;v&&r.split(";")[1].split(",").forEach(E=>{h.has(E)&&h.get(E).forEach(A=>w.add(A));});let k=v&&w.size,R={url:l,timeout:n,responseType:k?"arrayBuffer":s,headers:r==="image"?{accept:g}:void 0,...p};b={type:r,resolve:void 0,reject:void 0,response:null},b.response=(async()=>{if(i&&r==="image"){let S=await i(o);if(S)return S}return !et&&o.startsWith("http")&&f.length?new Promise((S,E)=>{f[c.size&f.length-1].postMessage({rawUrl:o,...R}),b.resolve=S,b.reject=E;}):Zn(R)})().catch(S=>{if(c.delete(o),r==="image"&&d)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",l),typeof d=="string"?d:d(a);throw S}),c.set(o,b);}return b.response}async function Oo(e,t,o,r){if(!_o(e))return e;for(let[s,a]of es(e,t))try{let l=await Pe(o,{url:a,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(ts(s),`$1${l}$3`);}catch(l){o.log.warn("Failed to fetch css data url",s,l);}return e}function _o(e){return /url\((['"]?)([^'"]+?)\1\)/.test(e)}function es(e,t){let o=[];return e.replace(Ho,(r,s,a)=>(o.push([a,Po(a,t)]),r)),o.filter(([r])=>!xt(r))}function ts(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function rs(e,t){return os.map(o=>{let r=e.getPropertyValue(o);return !r||r==="none"?null:((et||Et)&&t.drawImageCount++,Oo(r,null,t,true).then(s=>{!s||r===s||e.setProperty(o,s,e.getPropertyPriority(o));}))}).filter(Boolean)}function ns(e,t){if(be(e)){let o=e.currentSrc||e.src;if(!xt(o))return [Pe(t,{url:o,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.srcset="",e.dataset.originalSrc=o,e.src=r||"");})];(et||Et)&&t.drawImageCount++;}else if(Le(e)&&!xt(e.href.baseVal)){let o=e.href.baseVal;return [Pe(t,{url:o,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.dataset.originalSrc=o,e.href.baseVal=r||"");})]}return []}function ss(e,t){let{ownerDocument:o,svgDefsElement:r}=t,s=e.getAttribute("href")??e.getAttribute("xlink:href");if(!s)return [];let[a,l]=s.split("#");if(l){let n=`#${l}`,g=t.shadowRoots.reduce((c,i)=>c??i.querySelector(`svg ${n}`),o?.querySelector(`svg ${n}`));if(a&&e.setAttribute("href",n),r?.querySelector(n))return [];if(g)return r?.appendChild(g.cloneNode(true)),[];if(a)return [Pe(t,{url:a,responseType:"text"}).then(c=>{r?.insertAdjacentHTML("beforeend",c);})]}return []}function Wo(e,t){let{tasks:o}=t;j(e)&&((be(e)||Fo(e))&&o.push(...ns(e,t)),fn(e)&&o.push(...ss(e,t))),De(e)&&o.push(...rs(e.style,t)),e.childNodes.forEach(r=>{Wo(r,t);});}async function as(e,t){let{ownerDocument:o,svgStyleElement:r,fontFamilies:s,fontCssTexts:a,tasks:l,font:n}=t;if(!(!o||!r||!s.size))if(n&&n.cssText){let g=Co(n.cssText,t);r.appendChild(o.createTextNode(`${g}
8
- `));}else {let g=Array.from(o.styleSheets).filter(i=>{try{return "cssRules"in i&&!!i.cssRules.length}catch(p){return t.log.warn(`Error while reading CSS rules from ${i.href}`,p),false}});await Promise.all(g.flatMap(i=>Array.from(i.cssRules).map(async(p,u)=>{if(dn(p)){let d=u+1,m=p.href,f="";try{f=await Pe(t,{url:m,requestType:"text",responseType:"text"});}catch(b){t.log.warn(`Error fetch remote css import from ${m}`,b);}let h=f.replace(Ho,(b,v,w)=>b.replace(w,Po(w,m)));for(let b of ls(h))try{i.insertRule(b,b.startsWith("@import")?d+=1:i.cssRules.length);}catch(v){t.log.warn("Error inserting rule from remote css import",{rule:b,error:v});}}})));let c=[];g.forEach(i=>{vt(i.cssRules,c);}),c.filter(i=>un(i)&&_o(i.style.getPropertyValue("src"))&&Go(i.style.getPropertyValue("font-family"))?.some(p=>s.has(p))).forEach(i=>{let p=i,u=a.get(p.cssText);u?r.appendChild(o.createTextNode(`${u}
9
- `)):l.push(Oo(p.cssText,p.parentStyleSheet?p.parentStyleSheet.href:null,t).then(d=>{d=Co(d,t),a.set(p.cssText,d),r.appendChild(o.createTextNode(`${d}
10
- `));}));});}}function ls(e){if(e==null)return [];let t=[],o=e.replace(is,"");for(;;){let a=ko.exec(o);if(!a)break;t.push(a[0]);}o=o.replace(ko,"");let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let a=r.exec(o);if(a)s.lastIndex=r.lastIndex;else if(a=s.exec(o),a)r.lastIndex=s.lastIndex;else break;t.push(a[0]);}return t}function Co(e,t){let{font:o}=t,r=o?o?.preferredFormat:void 0;return r?e.replace(us,s=>{for(;;){let[a,,l]=cs.exec(s)||[];if(!l)return "";if(l===r)return `src: ${a};`}}):e}function vt(e,t=[]){for(let o of Array.from(e))gn(o)?t.push(...vt(o.cssRules)):"cssRules"in o?vt(o.cssRules,t):t.push(o);return t}async function ds(e,t){let o=await nt(e,t);if(j(o.node)&&Le(o.node))return o.node;let{ownerDocument:r,log:s,tasks:a,svgStyleElement:l,svgDefsElement:n,svgStyles:g,font:c,progress:i,autoDestruct:p,onCloneNode:u,onEmbedNode:d,onCreateForeignObjectSvg:m}=o;s.time("clone node");let f=await kt(o.node,o,true);if(l&&r){let k="";g.forEach((R,S)=>{k+=`${R.join(`,
6
+ `);return o.appendChild(t),o}function Wn(e,o){let{width:t,height:r}=o;if($(e)&&(!t||!r)){let a=e.getBoundingClientRect();t=t||a.width||Number(e.getAttribute("width"))||0,r=r||a.height||Number(e.getAttribute("height"))||0;}return {width:t,height:r}}async function Yn(e,o){let{log:t,timeout:r,drawImageCount:a,drawImageInterval:s}=o;t.time("image to canvas");let i=await We(e,{timeout:r,onWarn:o.log.warn}),{canvas:n,context2d:p}=qn(e.ownerDocument,o),c=()=>{try{p?.drawImage(i,0,0,n.width,n.height);}catch(l){o.log.warn("Failed to drawImage",l);}};if(c(),o.isEnable("fixSvgXmlDecode"))for(let l=0;l<a;l++)await new Promise(d=>{setTimeout(()=>{p?.clearRect(0,0,n.width,n.height),c(),d();},l+s);});return o.drawImageCount=0,t.timeEnd("image to canvas"),n}function qn(e,o){let{width:t,height:r,scale:a,backgroundColor:s,maximumCanvasSize:i}=o,n=e.createElement("canvas");n.width=Math.floor(t*a),n.height=Math.floor(r*a),n.style.width=`${t}px`,n.style.height=`${r}px`,i&&(n.width>i||n.height>i)&&(n.width>i&&n.height>i?n.width>n.height?(n.height*=i/n.width,n.width=i):(n.width*=i/n.height,n.height=i):n.width>i?(n.height*=i/n.width,n.width=i):(n.width*=i/n.height,n.height=i));let p=n.getContext("2d");return p&&s&&(p.fillStyle=s,p.fillRect(0,0,n.width,n.height)),{canvas:n,context2d:p}}function Ho(e,o){if(e.ownerDocument)try{let s=e.toDataURL();if(s!=="data:,")return Ae(s,e.ownerDocument)}catch(s){o.log.warn("Failed to clone canvas",s);}let t=e.cloneNode(false),r=e.getContext("2d"),a=t.getContext("2d");try{return r&&a&&a.putImageData(r.getImageData(0,0,e.width,e.height),0,0),t}catch(s){o.log.warn("Failed to clone canvas",s);}return t}function Xn(e,o){try{if(e?.contentDocument?.body)return Dt(e.contentDocument.body,o)}catch(t){o.log.warn("Failed to clone iframe",t);}return e.cloneNode(false)}function Vn(e){let o=e.cloneNode(false);return e.currentSrc&&e.currentSrc!==e.src&&(o.src=e.currentSrc,o.srcset=""),o.loading==="lazy"&&(o.loading="eager"),o}async function jn(e,o){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Ae(e.poster,e.ownerDocument);let t=e.cloneNode(false);t.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc);let r=t.ownerDocument;if(r){let a=true;if(await We(t,{onError:()=>a=false,onWarn:o.log.warn}),!a)return e.poster?Ae(e.poster,e.ownerDocument):t;t.currentTime=e.currentTime,await new Promise(i=>{t.addEventListener("seeked",i,{once:true});});let s=r.createElement("canvas");s.width=e.offsetWidth,s.height=e.offsetHeight;try{let i=s.getContext("2d");i&&i.drawImage(t,0,0,s.width,s.height);}catch(i){return o.log.warn("Failed to clone video",i),e.poster?Ae(e.poster,e.ownerDocument):t}return Ho(s,o)}return t}function Qn(e,o){return Tn(e)?Ho(e,o):Dn(e)?Xn(e,o):Fe(e)?Vn(e):lt(e)?jn(e,o):e.cloneNode(false)}function Kn(e){let o=e.sandbox;if(!o){let{ownerDocument:t}=e;try{t&&(o=t.createElement("iframe"),o.id=`__SANDBOX__${Uo()}`,o.width="0",o.height="0",o.style.visibility="hidden",o.style.position="fixed",t.body.appendChild(o),o.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=o);}catch(r){e.log.warn("Failed to getSandBox",r);}}return o}function Wo(e,o,t){let{defaultComputedStyles:r}=t,a=e.nodeName.toLowerCase(),s=qe(e)&&a!=="svg",i=s?$n.map(g=>[g,e.getAttribute(g)]).filter(([,g])=>g!==null):[],n=[s&&"svg",a,i.map((g,m)=>`${g}=${m}`).join(","),o].filter(Boolean).join(":");if(r.has(n))return r.get(n);let c=Kn(t)?.contentWindow;if(!c)return new Map;let l=c?.document,d,u;s?(d=l.createElementNS(ut,"svg"),u=d.ownerDocument.createElementNS(d.namespaceURI,a),i.forEach(([g,m])=>{u.setAttributeNS(null,g,m);}),d.appendChild(u)):d=u=l.createElement(a),u.textContent=" ",l.body.appendChild(d);let f=c.getComputedStyle(u,o),b=new Map;for(let g=f.length,m=0;m<g;m++){let h=f.item(m);Zn.includes(h)||b.set(h,f.getPropertyValue(h));}return l.body.removeChild(d),r.set(n,b),b}function Yo(e,o,t){let r=new Map,a=[],s=new Map;if(t)for(let n of t)i(n);else for(let n=e.length,p=0;p<n;p++){let c=e.item(p);i(c);}for(let n=a.length,p=0;p<n;p++)s.get(a[p])?.forEach((c,l)=>r.set(l,c));function i(n){let p=e.getPropertyValue(n),c=e.getPropertyPriority(n),l=n.lastIndexOf("-"),d=l>-1?n.substring(0,l):void 0;if(d){let u=s.get(d);u||(u=new Map,s.set(d,u)),u.set(n,[p,c]);}o.get(n)===p&&!c||(d?a.push(d):r.set(n,[p,c]));}return r}function _n(e,o,t,r){let{ownerWindow:a,includeStyleProperties:s,currentParentNodeStyle:i}=r,n=o.style,p=a.getComputedStyle(e),c=Wo(e,null,r);i?.forEach((d,u)=>{c.delete(u);});let l=Yo(p,c,s);l.delete("transition-property"),l.delete("all"),l.delete("d"),l.delete("content"),t&&(l.delete("margin-top"),l.delete("margin-right"),l.delete("margin-bottom"),l.delete("margin-left"),l.delete("margin-block-start"),l.delete("margin-block-end"),l.delete("margin-inline-start"),l.delete("margin-inline-end"),l.set("box-sizing",["border-box",""])),l.get("background-clip")?.[0]==="text"&&o.classList.add("______background-clip--text"),Po&&(l.has("font-kerning")||l.set("font-kerning",["normal",""]),(l.get("overflow-x")?.[0]==="hidden"||l.get("overflow-y")?.[0]==="hidden")&&l.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&l.set("text-overflow",["clip",""]));for(let d=n.length,u=0;u<d;u++)n.removeProperty(n.item(u));return l.forEach(([d,u],f)=>{n.setProperty(f,d,u);}),l}function Jn(e,o){(Cn(e)||kn(e)||Rn(e))&&o.setAttribute("value",e.value);}function os(e,o,t,r,a){let{ownerWindow:s,svgStyleElement:i,svgStyles:n,currentNodeStyle:p}=r;if(!i||!s)return;function c(l){let d=s.getComputedStyle(e,l),u=d.getPropertyValue("content");if(!u||u==="none")return;a?.(u),u=u.replace(/(')|(")|(counter\(.+\))/g,"");let f=[Uo()],b=Wo(e,l,r);p?.forEach((y,C)=>{b.delete(C);});let g=Yo(d,b,r.includeStyleProperties);g.delete("content"),g.delete("-webkit-locale"),g.get("background-clip")?.[0]==="text"&&o.classList.add("______background-clip--text");let m=[`content: '${u}';`];if(g.forEach(([y,C],v)=>{m.push(`${v}: ${y}${C?" !important":""};`);}),m.length===1)return;try{o.className=[o.className,...f].join(" ");}catch(y){r.log.warn("Failed to copyPseudoClass",y);return}let h=m.join(`
7
+ `),w=n.get(h);w||(w=[],n.set(h,w)),w.push(`.${f[0]}${l}`);}es.forEach(c),t&&ts.forEach(c);}async function ko(e,o,t,r,a){if($(t)&&(An(t)||Fn(t))||r.filter&&!r.filter(t))return;Co.has(o.nodeName)||Co.has(t.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;let s=await Dt(t,r,false,a);r.isEnable("restoreScrollPosition")&&rs(e,s),o.appendChild(s);}async function Ao(e,o,t,r){let a=e.firstChild;$(e)&&e.shadowRoot&&(a=e.shadowRoot?.firstChild,t.shadowRoots.push(e.shadowRoot));for(let s=a;s;s=s.nextSibling)if(!xn(s))if($(s)&&Bn(s)&&typeof s.assignedNodes=="function"){let i=s.assignedNodes();for(let n=0;n<i.length;n++)await ko(e,o,i[n],t,r);}else await ko(e,o,s,t,r);}function rs(e,o){if(!He(e)||!He(o))return;let{scrollTop:t,scrollLeft:r}=e;if(!t&&!r)return;let{transform:a}=o.style,s=new DOMMatrix(a),{a:i,b:n,c:p,d:c}=s;s.a=1,s.b=0,s.c=0,s.d=1,s.translateSelf(-r,-t),s.a=i,s.b=n,s.c=p,s.d=c,o.style.transform=s.toString();}function ns(e,o){let{backgroundColor:t,width:r,height:a,style:s}=o,i=e.style;if(t&&i.setProperty("background-color",t,"important"),r&&i.setProperty("width",`${r}px`,"important"),a&&i.setProperty("height",`${a}px`,"important"),s)for(let n in s)i[n]=s[n];}async function Dt(e,o,t=false,r){let{ownerDocument:a,ownerWindow:s,fontFamilies:i,onCloneEachNode:n}=o;if(a&&En(e))return r&&/\S/.test(e.data)&&r(e.data),a.createTextNode(e.data);if(a&&s&&$(e)&&(He(e)||qe(e))){let c=await Qn(e,o);if(o.isEnable("removeAbnormalAttributes")){let g=c.getAttributeNames();for(let m=g.length,h=0;h<m;h++){let w=g[h];ss.test(w)||c.removeAttribute(w);}}let l=o.currentNodeStyle=_n(e,c,t,o);t&&ns(c,o);let d=false;if(o.isEnable("copyScrollbar")){let g=[l.get("overflow-x")?.[0],l.get("overflow-y")?.[0]];d=g.includes("scroll")||(g.includes("auto")||g.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);}let u=l.get("text-transform")?.[0],f=zo(l.get("font-family")?.[0]),b=f?g=>{u==="uppercase"?g=g.toUpperCase():u==="lowercase"?g=g.toLowerCase():u==="capitalize"&&(g=g[0].toUpperCase()+g.substring(1)),f.forEach(m=>{let h=i.get(m);h||i.set(m,h=new Set),g.split("").forEach(w=>h.add(w));});}:void 0;return os(e,c,d,o,b),Jn(e,c),lt(e)||await Ao(e,c,o,b),await n?.(c),c}let p=e.cloneNode(false);return await Ao(e,p,o),await n?.(p),p}function as(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove();}catch(o){e.log.warn("Failed to destroyContext",o);}e.sandbox=void 0;}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[];}function is(e){let{url:o,timeout:t,responseType:r,...a}=e,s=new AbortController,i=t?setTimeout(()=>s.abort(),t):void 0;return fetch(o,{signal:s.signal,...a}).then(n=>{if(!n.ok)throw new Error("Failed fetch, not 2xx response",{cause:n});switch(r){case "arrayBuffer":return n.arrayBuffer();case "dataUrl":return n.blob().then(Gn);default:return n.text()}}).finally(()=>clearTimeout(i))}function Ye(e,o){let{url:t,requestType:r="text",responseType:a="text",imageDom:s}=o,i=t,{timeout:n,acceptOfImage:p,requests:c,fetchFn:l,fetch:{requestInit:d,bypassingCache:u,placeholderImage:f},font:b,workers:g,fontFamilies:m}=e;r==="image"&&(it||Bt)&&e.drawImageCount++;let h=c.get(t);if(!h){u&&u instanceof RegExp&&u.test(i)&&(i+=(/\?/.test(i)?"&":"?")+new Date().getTime());let w=r.startsWith("font")&&b&&b.minify,y=new Set;w&&r.split(";")[1].split(",").forEach(k=>{m.has(k)&&m.get(k).forEach(P=>y.add(P));});let C=w&&y.size,v={url:i,timeout:n,responseType:C?"arrayBuffer":a,headers:r==="image"?{accept:p}:void 0,...d};h={type:r,resolve:void 0,reject:void 0,response:null},h.response=(async()=>{if(l&&r==="image"){let E=await l(t);if(E)return E}return !it&&t.startsWith("http")&&g.length?new Promise((E,k)=>{g[c.size&g.length-1].postMessage({rawUrl:t,...v}),h.resolve=E,h.reject=k;}):is(v)})().catch(E=>{if(c.delete(t),r==="image"&&f)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",i),typeof f=="string"?f:f(s);throw E}),c.set(t,h);}return h.response}async function qo(e,o,t,r){if(!Xo(e))return e;for(let[a,s]of ls(e,o))try{let i=await Ye(t,{url:s,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(cs(a),`$1${i}$3`);}catch(i){t.log.warn("Failed to fetch css data url",a,i);}return e}function Xo(e){return /url\((['"]?)([^'"]+?)\1\)/.test(e)}function ls(e,o){let t=[];return e.replace(Vo,(r,a,s)=>(t.push([s,Go(s,o)]),r)),t.filter(([r])=>!At(r))}function cs(e){let o=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${o})(['"]?\\))`,"g")}function ds(e,o){return us.map(t=>{let r=e.getPropertyValue(t);return !r||r==="none"?null:((it||Bt)&&o.drawImageCount++,qo(r,null,o,true).then(a=>{!a||r===a||e.setProperty(t,a,e.getPropertyPriority(t));}))}).filter(Boolean)}function ps(e,o){if(Fe(e)){let t=e.currentSrc||e.src;if(!At(t))return [Ye(o,{url:t,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.srcset="",e.dataset.originalSrc=t,e.src=r||"");})];(it||Bt)&&o.drawImageCount++;}else if(qe(e)&&!At(e.href.baseVal)){let t=e.href.baseVal;return [Ye(o,{url:t,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.dataset.originalSrc=t,e.href.baseVal=r||"");})]}return []}function fs(e,o){let{ownerDocument:t,svgDefsElement:r}=o,a=e.getAttribute("href")??e.getAttribute("xlink:href");if(!a)return [];let[s,i]=a.split("#");if(i){let n=`#${i}`,p=o.shadowRoots.reduce((c,l)=>c??l.querySelector(`svg ${n}`),t?.querySelector(`svg ${n}`));if(s&&e.setAttribute("href",n),r?.querySelector(n))return [];if(p)return r?.appendChild(p.cloneNode(true)),[];if(s)return [Ye(o,{url:s,responseType:"text"}).then(c=>{r?.insertAdjacentHTML("beforeend",c);})]}return []}function jo(e,o){let{tasks:t}=o;$(e)&&((Fe(e)||No(e))&&t.push(...ps(e,o)),vn(e)&&t.push(...fs(e,o))),He(e)&&t.push(...ds(e.style,o)),e.childNodes.forEach(r=>{jo(r,o);});}async function gs(e,o){let{ownerDocument:t,svgStyleElement:r,fontFamilies:a,fontCssTexts:s,tasks:i,font:n}=o;if(!(!t||!r||!a.size))if(n&&n.cssText){let p=Ro(n.cssText,o);r.appendChild(t.createTextNode(`${p}
8
+ `));}else {let p=Array.from(t.styleSheets).filter(l=>{try{return "cssRules"in l&&!!l.cssRules.length}catch(d){return o.log.warn(`Error while reading CSS rules from ${l.href}`,d),false}});await Promise.all(p.flatMap(l=>Array.from(l.cssRules).map(async(d,u)=>{if(wn(d)){let f=u+1,b=d.href,g="";try{g=await Ye(o,{url:b,requestType:"text",responseType:"text"});}catch(h){o.log.warn(`Error fetch remote css import from ${b}`,h);}let m=g.replace(Vo,(h,w,y)=>h.replace(y,Go(y,b)));for(let h of hs(m))try{l.insertRule(h,h.startsWith("@import")?f+=1:l.cssRules.length);}catch(w){o.log.warn("Error inserting rule from remote css import",{rule:h,error:w});}}})));let c=[];p.forEach(l=>{Ft(l.cssRules,c);}),c.filter(l=>yn(l)&&Xo(l.style.getPropertyValue("src"))&&zo(l.style.getPropertyValue("font-family"))?.some(d=>a.has(d))).forEach(l=>{let d=l,u=s.get(d.cssText);u?r.appendChild(t.createTextNode(`${u}
9
+ `)):i.push(qo(d.cssText,d.parentStyleSheet?d.parentStyleSheet.href:null,o).then(f=>{f=Ro(f,o),s.set(d.cssText,f),r.appendChild(t.createTextNode(`${f}
10
+ `));}));});}}function hs(e){if(e==null)return [];let o=[],t=e.replace(ms,"");for(;;){let s=Fo.exec(t);if(!s)break;o.push(s[0]);}t=t.replace(Fo,"");let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let s=r.exec(t);if(s)a.lastIndex=r.lastIndex;else if(s=a.exec(t),s)r.lastIndex=a.lastIndex;else break;o.push(s[0]);}return o}function Ro(e,o){let{font:t}=o,r=t?t?.preferredFormat:void 0;return r?e.replace(ys,a=>{for(;;){let[s,,i]=bs.exec(a)||[];if(!i)return "";if(i===r)return `src: ${s};`}}):e}function Ft(e,o=[]){for(let t of Array.from(e))Sn(t)?o.push(...Ft(t.cssRules)):"cssRules"in t?Ft(t.cssRules,o):o.push(t);return o}async function ws(e,o){let t=await dt(e,o);if($(t.node)&&qe(t.node))return t.node;let{ownerDocument:r,log:a,tasks:s,svgStyleElement:i,svgDefsElement:n,svgStyles:p,font:c,progress:l,autoDestruct:d,onCloneNode:u,onEmbedNode:f,onCreateForeignObjectSvg:b}=t;a.time("clone node");let g=await Dt(t.node,t,true);if(i&&r){let C="";p.forEach((v,E)=>{C+=`${v.join(`,
11
11
  `)} {
12
- ${S}
12
+ ${E}
13
13
  }
14
- `;}),l.appendChild(r.createTextNode(k));}s.timeEnd("clone node"),await u?.(f),c!==false&&j(f)&&(s.time("embed web font"),await as(f,o),s.timeEnd("embed web font")),s.time("embed node"),Wo(f,o);let h=a.length,b=0,v=async()=>{for(;;){let k=a.pop();if(!k)break;try{await k;}catch(R){o.log.warn("Failed to run task",R);}i?.(++b,h);}};i?.(b,h),await Promise.all([...Array.from({length:4})].map(v)),s.timeEnd("embed node"),await d?.(f);let w=gs(f,o);return n&&w.insertBefore(n,w.children[0]),l&&w.insertBefore(l,w.children[0]),p&&Jn(o),await m?.(w),w}function gs(e,t){let{width:o,height:r}=t,s=Cn(o,r,e.ownerDocument),a=s.ownerDocument.createElementNS(s.namespaceURI,"foreignObject");return a.setAttributeNS(null,"x","0%"),a.setAttributeNS(null,"y","0%"),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.append(e),s.appendChild(a),s}async function fs(e,t){let o=await nt(e,t),r=await ds(o),s=Rn(r,o.isEnable("removeControlCharacter"));o.autoDestruct||(o.svgStyleElement=No(o.ownerDocument),o.svgDefsElement=o.ownerDocument?.createElementNS(rt,"defs"),o.svgStyles.clear());let a=he(s,r.ownerDocument);return await Ln(a,o)}async function ps(e,t){let o=await nt(e,t),{log:r,quality:s,type:a,dpi:l}=o,n=await fs(o);r.time("canvas to data url");let g=n.toDataURL(a,s);if(["image/png","image/jpeg"].includes(a)&&l&&an&&ln){let[c,i]=g.split(","),p=0,u=false;if(a==="image/png"){let w=nn(i);w>=0?(p=Math.ceil((w+28)/3)*4,u=true):p=33/3*4;}else a==="image/jpeg"&&(p=18/3*4);let d=i.substring(0,p),m=i.substring(p),f=window.atob(d),h=new Uint8Array(f.length);for(let w=0;w<h.length;w++)h[w]=f.charCodeAt(w);let b=a==="image/png"?en(h,l,u):Qr(h,l),v=window.btoa(String.fromCharCode(...b));g=[c,",",v,m].join("");}return r.timeEnd("canvas to data url"),g}async function Ct(e,t){return ps(await nt(e,{...t,type:"image/jpeg"}))}var Ro,Ao,Io,Bo,St,tn,on,rn,Mo,se,sn,an,ln,Tt,Do,et,Et,cn,un,dn,gn,j,Le,Fo,fn,De,pn,mn,be,tt,hn,bn,yn,wn,Sn,xn,vn,Tn,En,xt,rt,In,Lo,xo,_n,Hn,jn,Yn,vo,Xn,Ho,os,is,ko,cs,us,Vo=Wt(()=>{Ro=112,Ao=72,Io=89,Bo=115;tn="AAlwSFlz",on="AAAJcEhZ",rn="AAAACXBI";Mo="[modern-screenshot]",se=typeof window<"u",sn=se&&"Worker"in window,an=se&&"atob"in window,ln=se&&"btoa"in window,Tt=se?window.navigator?.userAgent:"",Do=Tt.includes("Chrome"),et=Tt.includes("AppleWebKit")&&!Do,Et=Tt.includes("Firefox"),cn=e=>e&&"__CONTEXT__"in e,un=e=>e.constructor.name==="CSSFontFaceRule",dn=e=>e.constructor.name==="CSSImportRule",gn=e=>e.constructor.name==="CSSLayerBlockRule",j=e=>e.nodeType===1,Le=e=>typeof e.className=="object",Fo=e=>e.tagName==="image",fn=e=>e.tagName==="use",De=e=>j(e)&&typeof e.style<"u"&&!Le(e),pn=e=>e.nodeType===8,mn=e=>e.nodeType===3,be=e=>e.tagName==="IMG",tt=e=>e.tagName==="VIDEO",hn=e=>e.tagName==="CANVAS",bn=e=>e.tagName==="TEXTAREA",yn=e=>e.tagName==="INPUT",wn=e=>e.tagName==="STYLE",Sn=e=>e.tagName==="SCRIPT",xn=e=>e.tagName==="SELECT",vn=e=>e.tagName==="SLOT",Tn=e=>e.tagName==="IFRAME",En=(...e)=>console.warn(Mo,...e);xt=e=>e.startsWith("data:");rt="http://www.w3.org/2000/svg";In=e=>An(e,"dataUrl");Lo=(function(){let t=0,o=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return ()=>(t+=1,`u${o()}${t}`)})();xo=0;_n=["width","height","-webkit-text-fill-color"],Hn=["stroke","fill"];jn=["::before","::after"],Yn=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];vo=new Set(["symbol"]);Xn=/^[\w-:]+$/;Ho=/url\((['"]?)([^'"]+?)\1\)/g;os=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];is=/(\/\*[\s\S]*?\*\/)/g,ko=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;cs=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,us=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;});var jo={};vr(jo,{captureScreenshot:()=>hs});async function hs(){try{let e=await Ct(document.body,{scale:1,quality:.7,width:window.innerWidth,height:window.innerHeight});return e.length>ms&&(e=await Ct(document.body,{scale:.5,quality:.5,width:window.innerWidth,height:window.innerHeight})),e}catch{return null}}var ms,Yo=Wt(()=>{Vo();ms=2*1024*1024;});var Vt="https://gotcha.cx/api/v1";var V={ANONYMOUS_ID:"gotcha_anonymous_id",OFFLINE_QUEUE:"gotcha_offline_queue",HIDDEN_UNTIL:"gotcha_hidden",VISIT_COUNT:"gotcha_visits"},ee={POSITION:"top-right",SIZE:"md",THEME:"light",SHOW_ON_HOVER:true,TOUCH_BEHAVIOR:"always-visible",SUBMIT_TEXT:"Submit",THANK_YOU_MESSAGE:"Gotcha!"},je={MAX_RETRIES:2,BASE_DELAY_MS:500,MAX_DELAY_MS:5e3};function te(e){if(typeof window>"u")return null;try{return localStorage.getItem(e)}catch{return null}}function oe(e,t){if(!(typeof window>"u"))try{localStorage.setItem(e,t);}catch{}}function re(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return (e==="x"?t:t&3|8).toString(16)})}function Ye(){let e=te(V.ANONYMOUS_ID);if(e)return e;let t=`anon_${re()}`;return oe(V.ANONYMOUS_ID,t),t}var qe=[],Ke=false;function jt(e,t){let o={message:e.slice(0,200),source:t?.slice(0,200),timestamp:Date.now()};qe.push(o),qe.length>10&&qe.shift();}function Yt(e){jt(e.message,e.filename);}function qt(e){let t=e.reason instanceof Error?e.reason.message:String(e.reason);jt(t);}function Kt(){typeof window>"u"||Ke||(window.addEventListener("error",Yt),window.addEventListener("unhandledrejection",qt),Ke=true);}function Qt(){typeof window>"u"||!Ke||(window.removeEventListener("error",Yt),window.removeEventListener("unhandledrejection",qt),Ke=false);}function Xt(){return [...qe].reverse()}function Jt(){return typeof window>"u"?{}:{url:window.location.origin+window.location.pathname,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenResolution:{width:screen.width,height:screen.height},recentErrors:Xt()}}var Tr=50,Er=10080*60*1e3;function Be(){let e=te(V.OFFLINE_QUEUE);if(!e)return [];try{let t=JSON.parse(e),o=Date.now();return t.filter(r=>o-r.queuedAt<Er)}catch{return []}}function dt(e){oe(V.OFFLINE_QUEUE,JSON.stringify(e));}function gt(e,t="create"){let o=Be();o.length>=Tr||(o.push({id:re(),payload:e,type:t,queuedAt:Date.now(),retries:0}),dt(o));}function Zt(e){let t=Be().filter(o=>o.id!==e);dt(t);}function eo(){return Be()}function to(){return Be().length}function oo(e){let t=Be().map(o=>o.id===e?{...o,retries:o.retries+1}:o);dt(t.filter(o=>o.retries<=5));}var pe={maxRetries:je.MAX_RETRIES,baseDelayMs:je.BASE_DELAY_MS,maxDelayMs:je.MAX_DELAY_MS};async function Me(e,t,o=pe,r=false){let s=null;for(let a=0;a<=o.maxRetries;a++){try{r&&a>0&&console.log(`[Gotcha] Retry attempt ${a}/${o.maxRetries}`);let l=await fetch(e,t);if(l.status>=400&&l.status<500&&l.status!==429||l.ok)return l;s=new Error(`HTTP ${l.status}`);}catch(l){s=l,r&&console.log(`[Gotcha] Network error: ${s.message}`);}if(a<o.maxRetries){let l=Math.min(o.baseDelayMs*Math.pow(2,a),o.maxDelayMs);await new Promise(n=>setTimeout(n,l));}}throw s}function ro(e){let{apiKey:t,baseUrl:o=Vt,debug:r=false}=e,s=false,a={"Content-Type":"application/json",Authorization:`Bearer ${t}`};async function l(n,g,c){let i=`${o}${g}`,p=re();r&&console.log(`[Gotcha] ${n} ${g}`,c);let u=await Me(i,{method:n,headers:{...a,"Idempotency-Key":p},body:c?JSON.stringify(c):void 0},pe,r),d;try{d=await u.json();}catch{throw {code:"PARSE_ERROR",message:"Invalid response from server",status:u.status}}if(!u.ok){let m=d.error;throw r&&console.error(`[Gotcha] Error: ${m.code} - ${m.message}`),m}return r&&console.log("[Gotcha] Response:",d),d}return {async submitResponse(n){let g=n.user||{};g.id||(g.id=Ye());let c={...n,user:g,context:Jt(),...n.isBug?{isBug:true}:{}};if(typeof navigator<"u"&&!navigator.onLine)return gt(c,"create"),{id:re(),status:"queued",createdAt:new Date().toISOString()};try{return await l("POST","/responses",c)}catch(i){if(i instanceof TypeError&&typeof navigator<"u"&&!navigator.onLine)return gt(c,"create"),{id:re(),status:"queued",createdAt:new Date().toISOString()};throw i}},async checkExistingResponse(n,g){let c=`${o}/responses/check?elementId=${encodeURIComponent(n)}&userId=${encodeURIComponent(g)}`;r&&console.log("[Gotcha] GET /responses/check");let i=await Me(c,{method:"GET",headers:a},pe,r),p=await i.json();if(!i.ok){let u=p.error;throw r&&console.error(`[Gotcha] Error: ${u.code} - ${u.message}`),u}return p.exists?(r&&console.log("[Gotcha] Found existing response:",p.response),p.response):null},async updateResponse(n,g,c){let i=`${o}/responses/${n}${c?`?userId=${encodeURIComponent(c)}`:""}`;r&&console.log(`[Gotcha] PATCH /responses/${n}`,g);let p=await Me(i,{method:"PATCH",headers:a,body:JSON.stringify(g)},pe,r),u=await p.json();if(!p.ok){let d=u.error;throw r&&console.error(`[Gotcha] Error: ${d.code} - ${d.message}`),d}return r&&console.log("[Gotcha] Response updated:",u),u},async getScore(n){let g=`${o}/scores/${encodeURIComponent(n)}`;r&&console.log(`[Gotcha] GET /scores/${n}`);let c=await Me(g,{method:"GET",headers:a},pe,r),i=await c.json();if(!c.ok){let p=i.error;throw r&&console.error(`[Gotcha] Error: ${p.code} - ${p.message}`),p}return r&&console.log("[Gotcha] Score:",i),i},async flagAsBug(n){let g=`${o}/responses/${encodeURIComponent(n)}/bug`;r&&console.log(`[Gotcha] POST /responses/${n}/bug`);let c=await Me(g,{method:"POST",headers:a},pe,r),i=await c.json();if(!c.ok){let p=i.error;throw r&&console.error(`[Gotcha] Error: ${p.code} - ${p.message}`),p}return r&&console.log("[Gotcha] Bug flagged:",i),i},async flushQueue(){if(!s){s=true;try{let n=eo();for(let g of n)try{if(g.type==="update"&&g.payload.responseId){let{responseId:c,...i}=g.payload;await l("PATCH",`/responses/${c}`,i);}else await l("POST","/responses",g.payload);Zt(g.id);}catch{oo(g.id);}}finally{s=false;}}},getQueueLength:to,getBaseUrl(){return o}}}var kr=new Set(["__proto__","constructor","prototype"]);function de(e,t){let o={...e};for(let r of Object.keys(t)){if(kr.has(r))continue;let s=t[r];s!=null&&typeof s=="object"&&!Array.isArray(s)?o[r]=de(e[r]??{},s):s!==void 0&&(o[r]=s);}return o}var no=["#ef4444","#f05540","#f1663c","#f27738","#f38834","#f59e0b","#d4a30e","#b3a812","#79b841","#45c870","#10b981"],ft={colors:{primary:"#1e293b",primaryHover:"#334155",primaryText:"#ffffff",background:"#ffffff",backgroundGradient:"linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)",surface:"#fafbfc",surfaceHover:"#ffffff",text:"#111827",textSecondary:"#374151",textDisabled:"#94a3b8",border:"#e2e8f0",borderFocus:"#1e293b",success:"#059669",successSurface:"rgba(5,150,105,0.08)",error:"#dc2626",errorSurface:"#fef2f2",errorBorder:"rgba(220,38,38,0.1)",warning:"#d97706",warningActive:"#b45309",warningSurface:"rgba(251,191,36,0.08)",warningBorder:"rgba(217,119,6,0.25)",starFilled:"#f59e0b",starEmpty:"#e2e8f0",voteUp:"#10b981",voteUpSurface:"rgba(16,185,129,0.06)",voteUpBorder:"rgba(16,185,129,0.25)",voteDown:"#ef4444",voteDownSurface:"rgba(239,68,68,0.06)",voteDownBorder:"rgba(239,68,68,0.25)",npsColors:no,buttonBackground:"#1e293b",buttonBackgroundHover:"#334155",buttonBackgroundDisabled:"#e2e8f0",buttonColor:"#ffffff",buttonColorDisabled:"#94a3b8",buttonBorder:"none",buttonShadow:"none",backdropColor:"rgba(0,0,0,0.4)",closeButton:"#9ca3af",closeButtonHover:"#6b7280",closeButtonBg:"rgba(0,0,0,0.04)",glassBackground:"linear-gradient(160deg, rgba(255,255,255,0.7) 0%, rgba(200,210,230,0.4) 40%, rgba(180,192,220,0.5) 100%)",glassBorder:"none",glassColor:"rgba(0,0,0,0.75)",glassShadow:"0 3px 12px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.2)",glassHoverShadow:"0 6px 20px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.25)",inputBackground:"#fafbfc",inputBackgroundFocus:"#ffffff",inputBorder:"#e2e8f0",inputBorderFocus:"#1e293b",inputFocusRing:"rgba(30,41,59,0.15)",pollBorder:"#e2e8f0",pollSelectedBorder:"rgba(30,41,59,0.25)",pollBackground:"#fafbfc",pollSelectedBackground:"rgba(30,41,59,0.05)",pollColor:"#374151",pollSelectedColor:"#1e293b",pollCheckBorder:"#cbd5e1",pollCheckSelectedBorder:"#1e293b",pollCheckSelectedBg:"#1e293b"},typography:{fontFamily:"'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSize:{xs:11,sm:13,md:14,lg:16},fontWeight:{normal:400,medium:500,semibold:600,bold:700}},borders:{radius:{sm:8,md:10,lg:14,full:"50%"},width:1},shadows:{sm:"0 1px 2px rgba(0,0,0,0.04)",md:"0 4px 12px rgba(0,0,0,0.06)",lg:"0 12px 32px rgba(0,0,0,0.06)",modal:"0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.06), 0 24px 48px rgba(0,0,0,0.04)",button:"0 2px 8px rgba(0,0,0,0.06)"},animation:{duration:{fast:"0.15s",normal:"0.25s",slow:"0.4s"},easing:{default:"cubic-bezier(0.4, 0, 0.2, 1)",spring:"cubic-bezier(0.34, 1.56, 0.64, 1)"}}},pt={colors:{primary:"#e2e8f0",primaryHover:"#cbd5e1",primaryText:"#1e293b",background:"#1a1f2e",backgroundGradient:"linear-gradient(180deg, #1a1f2e 0%, #151925 100%)",surface:"rgba(55,65,81,0.5)",surfaceHover:"rgba(55,65,81,0.7)",text:"#f9fafb",textSecondary:"#d1d5db",textDisabled:"#6b7280",border:"rgba(255,255,255,0.08)",borderFocus:"rgba(255,255,255,0.2)",success:"#10b981",successSurface:"rgba(16,185,129,0.1)",error:"#fecaca",errorSurface:"rgba(127,29,29,0.3)",errorBorder:"rgba(254,202,202,0.1)",warning:"#fbbf24",warningActive:"#fbbf24",warningSurface:"rgba(245,158,11,0.08)",warningBorder:"rgba(245,158,11,0.3)",starFilled:"#f59e0b",starEmpty:"rgba(255,255,255,0.12)",voteUp:"#10b981",voteUpSurface:"rgba(16,185,129,0.08)",voteUpBorder:"rgba(16,185,129,0.3)",voteDown:"#ef4444",voteDownSurface:"rgba(239,68,68,0.08)",voteDownBorder:"rgba(239,68,68,0.3)",npsColors:no,buttonBackground:"#e2e8f0",buttonBackgroundHover:"#cbd5e1",buttonBackgroundDisabled:"#374151",buttonColor:"#1e293b",buttonColorDisabled:"#6b7280",buttonBorder:"none",buttonShadow:"none",backdropColor:"rgba(0,0,0,0.5)",closeButton:"#6b7280",closeButtonHover:"#9ca3af",closeButtonBg:"rgba(255,255,255,0.06)",glassBackground:"linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 60%, rgba(0,0,0,0.05) 100%)",glassBorder:"1px solid rgba(255,255,255,0.15)",glassColor:"rgba(255,255,255,0.88)",glassShadow:"0 4px 14px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.35)",glassHoverShadow:"0 8px 24px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.4)",inputBackground:"rgba(55,65,81,0.5)",inputBackgroundFocus:"rgba(55,65,81,0.7)",inputBorder:"rgba(255,255,255,0.08)",inputBorderFocus:"rgba(255,255,255,0.2)",inputFocusRing:"rgba(255,255,255,0.06)",pollBorder:"rgba(255,255,255,0.08)",pollSelectedBorder:"rgba(226,232,240,0.25)",pollBackground:"rgba(55,65,81,0.5)",pollSelectedBackground:"rgba(226,232,240,0.08)",pollColor:"#d1d5db",pollSelectedColor:"#e2e8f0",pollCheckBorder:"rgba(255,255,255,0.2)",pollCheckSelectedBorder:"#e2e8f0",pollCheckSelectedBg:"#e2e8f0"},typography:{fontFamily:"'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",fontSize:{xs:11,sm:13,md:14,lg:16},fontWeight:{normal:400,medium:500,semibold:600,bold:700}},borders:{radius:{sm:8,md:10,lg:14,full:"50%"},width:1},shadows:{sm:"0 1px 2px rgba(0,0,0,0.2)",md:"0 4px 12px rgba(0,0,0,0.3)",lg:"0 12px 32px rgba(0,0,0,0.2)",modal:"0 1px 2px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.2), 0 24px 48px rgba(0,0,0,0.15)",button:"0 2px 8px rgba(0,0,0,0.15)"},animation:{duration:{fast:"0.15s",normal:"0.25s",slow:"0.4s"},easing:{default:"cubic-bezier(0.4, 0, 0.2, 1)",spring:"cubic-bezier(0.34, 1.56, 0.64, 1)"}}};function Cr(e,t){return de(e==="dark"?pt:ft,t)}function ne(e,t,o){let s=(e==="auto"||e==="custom"?t:e)==="dark"?de({},pt):de({},ft);return o&&(s=de(s,o)),s}var so="gotcha-styles",ao="gotcha-dm-sans",io="gotcha-carter-one",Rr=`
14
+ `;}),i.appendChild(r.createTextNode(C));}a.timeEnd("clone node"),await u?.(g),c!==false&&$(g)&&(a.time("embed web font"),await gs(g,t),a.timeEnd("embed web font")),a.time("embed node"),jo(g,t);let m=s.length,h=0,w=async()=>{for(;;){let C=s.pop();if(!C)break;try{await C;}catch(v){t.log.warn("Failed to run task",v);}l?.(++h,m);}};l?.(h,m),await Promise.all([...Array.from({length:4})].map(w)),a.timeEnd("embed node"),await f?.(g);let y=Ss(g,t);return n&&y.insertBefore(n,y.children[0]),i&&y.insertBefore(i,y.children[0]),d&&as(t),await b?.(y),y}function Ss(e,o){let{width:t,height:r}=o,a=Ln(t,r,e.ownerDocument),s=a.ownerDocument.createElementNS(a.namespaceURI,"foreignObject");return s.setAttributeNS(null,"x","0%"),s.setAttributeNS(null,"y","0%"),s.setAttributeNS(null,"width","100%"),s.setAttributeNS(null,"height","100%"),s.append(e),a.appendChild(s),a}async function vs(e,o){let t=await dt(e,o),r=await ws(t),a=Pn(r,t.isEnable("removeControlCharacter"));t.autoDestruct||(t.svgStyleElement=Oo(t.ownerDocument),t.svgDefsElement=t.ownerDocument?.createElementNS(ut,"defs"),t.svgStyles.clear());let s=Ae(a,r.ownerDocument);return await Yn(s,t)}async function xs(e,o){let t=await dt(e,o),{log:r,quality:a,type:s,dpi:i}=t,n=await vs(t);r.time("canvas to data url");let p=n.toDataURL(s,a);if(["image/png","image/jpeg"].includes(s)&&i&&mn&&hn){let[c,l]=p.split(","),d=0,u=false;if(s==="image/png"){let y=fn(l);y>=0?(d=Math.ceil((y+28)/3)*4,u=true):d=33/3*4;}else s==="image/jpeg"&&(d=18/3*4);let f=l.substring(0,d),b=l.substring(d),g=window.atob(f),m=new Uint8Array(g.length);for(let y=0;y<m.length;y++)m[y]=g.charCodeAt(y);let h=s==="image/png"?cn(m,i,u):nn(m,i),w=window.btoa(String.fromCharCode(...h));p=[c,",",w,b].join("");}return r.timeEnd("canvas to data url"),p}async function Mt(e,o){return xs(await dt(e,{...o,type:"image/jpeg"}))}var Bo,Do,Mo,Io,kt,un,dn,pn,Lo,de,gn,mn,hn,Rt,Po,it,Bt,bn,yn,wn,Sn,$,qe,No,vn,He,xn,En,Fe,lt,Tn,Cn,kn,An,Fn,Rn,Bn,Dn,Mn,At,ut,Gn,Uo,To,Zn,$n,es,ts,Co,ss,Vo,us,ms,Fo,bs,ys,Qo=jt(()=>{Bo=112,Do=72,Mo=89,Io=115;un="AAlwSFlz",dn="AAAJcEhZ",pn="AAAACXBI";Lo="[modern-screenshot]",de=typeof window<"u",gn=de&&"Worker"in window,mn=de&&"atob"in window,hn=de&&"btoa"in window,Rt=de?window.navigator?.userAgent:"",Po=Rt.includes("Chrome"),it=Rt.includes("AppleWebKit")&&!Po,Bt=Rt.includes("Firefox"),bn=e=>e&&"__CONTEXT__"in e,yn=e=>e.constructor.name==="CSSFontFaceRule",wn=e=>e.constructor.name==="CSSImportRule",Sn=e=>e.constructor.name==="CSSLayerBlockRule",$=e=>e.nodeType===1,qe=e=>typeof e.className=="object",No=e=>e.tagName==="image",vn=e=>e.tagName==="use",He=e=>$(e)&&typeof e.style<"u"&&!qe(e),xn=e=>e.nodeType===8,En=e=>e.nodeType===3,Fe=e=>e.tagName==="IMG",lt=e=>e.tagName==="VIDEO",Tn=e=>e.tagName==="CANVAS",Cn=e=>e.tagName==="TEXTAREA",kn=e=>e.tagName==="INPUT",An=e=>e.tagName==="STYLE",Fn=e=>e.tagName==="SCRIPT",Rn=e=>e.tagName==="SELECT",Bn=e=>e.tagName==="SLOT",Dn=e=>e.tagName==="IFRAME",Mn=(...e)=>console.warn(Lo,...e);At=e=>e.startsWith("data:");ut="http://www.w3.org/2000/svg";Gn=e=>Nn(e,"dataUrl");Uo=(function(){let o=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return ()=>(o+=1,`u${t()}${o}`)})();To=0;Zn=["width","height","-webkit-text-fill-color"],$n=["stroke","fill"];es=["::before","::after"],ts=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];Co=new Set(["symbol"]);ss=/^[\w-:]+$/;Vo=/url\((['"]?)([^'"]+?)\1\)/g;us=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];ms=/(\/\*[\s\S]*?\*\/)/g,Fo=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;bs=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ys=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;});var Ko={};Rr(Ko,{captureScreenshot:()=>Ts});async function Ts(){try{let e=window.visualViewport,o=Math.max(1,Math.floor(e?.width??window.innerWidth)),t=Math.max(1,Math.floor(e?.height??window.innerHeight)),r=Math.max(0,Math.round(e?.pageLeft??window.scrollX)),a=Math.max(0,Math.round(e?.pageTop??window.scrollY)),s={transform:`translate(-${r}px, -${a}px)`,transformOrigin:"top left"},i=await Mt(document.documentElement,{scale:1,quality:.7,width:o,height:t,style:s});return i.length>Es&&(i=await Mt(document.documentElement,{scale:.5,quality:.5,width:o,height:t,style:s})),i}catch{return null}}var Es,Zo=jt(()=>{Qo();Es=2*1024*1024;});var Qt="https://gotcha.cx/api/v1";var Z={ANONYMOUS_ID:"gotcha_anonymous_id",OFFLINE_QUEUE:"gotcha_offline_queue",HIDDEN_UNTIL:"gotcha_hidden",VISIT_COUNT:"gotcha_visits"},ae={POSITION:"top-right",SIZE:"md",THEME:"light",SHOW_ON_HOVER:true,TOUCH_BEHAVIOR:"always-visible",SUBMIT_TEXT:"Submit",THANK_YOU_MESSAGE:"Gotcha!"},Je={MAX_RETRIES:2,BASE_DELAY_MS:500,MAX_DELAY_MS:5e3};function ie(e){if(typeof window>"u")return null;try{return localStorage.getItem(e)}catch{return null}}function le(e,o){if(!(typeof window>"u"))try{localStorage.setItem(e,o);}catch{}}function ce(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let o=Math.random()*16|0;return (e==="x"?o:o&3|8).toString(16)})}function et(){let e=ie(Z.ANONYMOUS_ID);if(e)return e;let o=`anon_${ce()}`;return le(Z.ANONYMOUS_ID,o),o}var tt=[],ot=false;function Kt(e,o){let t={message:e.slice(0,200),source:o?.slice(0,200),timestamp:Date.now()};tt.push(t),tt.length>10&&tt.shift();}function Zt(e){Kt(e.message,e.filename);}function $t(e){let o=e.reason instanceof Error?e.reason.message:String(e.reason);Kt(o);}function _t(){typeof window>"u"||ot||(window.addEventListener("error",Zt),window.addEventListener("unhandledrejection",$t),ot=true);}function Jt(){typeof window>"u"||!ot||(window.removeEventListener("error",Zt),window.removeEventListener("unhandledrejection",$t),ot=false);}function eo(){return [...tt].reverse()}function to(){return typeof window>"u"?{}:{url:window.location.origin+window.location.pathname,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,screenResolution:{width:screen.width,height:screen.height},recentErrors:eo()}}var Br=50,Dr=10080*60*1e3;function ze(){let e=ie(Z.OFFLINE_QUEUE);if(!e)return [];try{let o=JSON.parse(e),t=Date.now();return o.filter(r=>t-r.queuedAt<Dr)}catch{return []}}function ht(e){le(Z.OFFLINE_QUEUE,JSON.stringify(e));}function bt(e,o="create"){let t=ze();t.length>=Br||(t.push({id:ce(),payload:e,type:o,queuedAt:Date.now(),retries:0}),ht(t));}function oo(e){let o=ze().filter(t=>t.id!==e);ht(o);}function ro(){return ze()}function no(){return ze().length}function so(e){let o=ze().map(t=>t.id===e?{...t,retries:t.retries+1}:t);ht(o.filter(t=>t.retries<=5));}var Ce={maxRetries:Je.MAX_RETRIES,baseDelayMs:Je.BASE_DELAY_MS,maxDelayMs:Je.MAX_DELAY_MS};async function Oe(e,o,t=Ce,r=false){let a=null;for(let s=0;s<=t.maxRetries;s++){try{r&&s>0&&console.log(`[Gotcha] Retry attempt ${s}/${t.maxRetries}`);let i=await fetch(e,o);if(i.status>=400&&i.status<500&&i.status!==429||i.ok)return i;a=new Error(`HTTP ${i.status}`);}catch(i){a=i,r&&console.log(`[Gotcha] Network error: ${a.message}`);}if(s<t.maxRetries){let i=Math.min(t.baseDelayMs*Math.pow(2,s),t.maxDelayMs);await new Promise(n=>setTimeout(n,i));}}throw a}function ao(e){let{apiKey:o,baseUrl:t=Qt,debug:r=false}=e,a=false,s={"Content-Type":"application/json",Authorization:`Bearer ${o}`};async function i(n,p,c){let l=`${t}${p}`,d=ce();r&&console.log(`[Gotcha] ${n} ${p}`,c);let u=await Oe(l,{method:n,headers:{...s,"Idempotency-Key":d},body:c?JSON.stringify(c):void 0},Ce,r),f;try{f=await u.json();}catch{throw {code:"PARSE_ERROR",message:"Invalid response from server",status:u.status}}if(!u.ok){let b=f.error;throw r&&console.error(`[Gotcha] Error: ${b.code} - ${b.message}`),b}return r&&console.log("[Gotcha] Response:",f),f}return {async submitResponse(n){let p=n.user||{};p.id||(p.id=et());let c={...n,user:p,context:to(),...n.isBug?{isBug:true}:{}};if(typeof navigator<"u"&&!navigator.onLine)return bt(c,"create"),{id:ce(),status:"queued",createdAt:new Date().toISOString()};try{return await i("POST","/responses",c)}catch(l){if(l instanceof TypeError&&typeof navigator<"u"&&!navigator.onLine)return bt(c,"create"),{id:ce(),status:"queued",createdAt:new Date().toISOString()};throw l}},async checkExistingResponse(n,p){let c=`${t}/responses/check?elementId=${encodeURIComponent(n)}&userId=${encodeURIComponent(p)}`;r&&console.log("[Gotcha] GET /responses/check");let l=await Oe(c,{method:"GET",headers:s},Ce,r),d=await l.json();if(!l.ok){let u=d.error;throw r&&console.error(`[Gotcha] Error: ${u.code} - ${u.message}`),u}return d.exists?(r&&console.log("[Gotcha] Found existing response:",d.response),d.response):null},async updateResponse(n,p,c){let l=`${t}/responses/${n}${c?`?userId=${encodeURIComponent(c)}`:""}`;r&&console.log(`[Gotcha] PATCH /responses/${n}`,p);let d=await Oe(l,{method:"PATCH",headers:s,body:JSON.stringify(p)},Ce,r),u=await d.json();if(!d.ok){let f=u.error;throw r&&console.error(`[Gotcha] Error: ${f.code} - ${f.message}`),f}return r&&console.log("[Gotcha] Response updated:",u),u},async getScore(n){let p=`${t}/scores/${encodeURIComponent(n)}`;r&&console.log(`[Gotcha] GET /scores/${n}`);let c=await Oe(p,{method:"GET",headers:s},Ce,r),l=await c.json();if(!c.ok){let d=l.error;throw r&&console.error(`[Gotcha] Error: ${d.code} - ${d.message}`),d}return r&&console.log("[Gotcha] Score:",l),l},async flagAsBug(n){let p=`${t}/responses/${encodeURIComponent(n)}/bug`;r&&console.log(`[Gotcha] POST /responses/${n}/bug`);let c=await Oe(p,{method:"POST",headers:s},Ce,r),l=await c.json();if(!c.ok){let d=l.error;throw r&&console.error(`[Gotcha] Error: ${d.code} - ${d.message}`),d}return r&&console.log("[Gotcha] Bug flagged:",l),l},async flushQueue(){if(!a){a=true;try{let n=ro();for(let p of n)try{if(p.type==="update"&&p.payload.responseId){let{responseId:c,...l}=p.payload;await i("PATCH",`/responses/${c}`,l);}else await i("POST","/responses",p.payload);oo(p.id);}catch{so(p.id);}}finally{a=false;}}},getQueueLength:no,getBaseUrl(){return t}}}var Mr=new Set(["__proto__","constructor","prototype"]);function ye(e,o){let t={...e};for(let r of Object.keys(o)){if(Mr.has(r))continue;let a=o[r];a!=null&&typeof a=="object"&&!Array.isArray(a)?t[r]=ye(e[r]??{},a):a!==void 0&&(t[r]=a);}return t}var Ir=Array(11).fill("#1A1714"),Lr=Array(11).fill("#F2EEE6"),io="'Gotcha Fraunces', 'Fraunces 144', 'Fraunces', Georgia, 'Iowan Old Style', Charter, 'Source Serif Pro', serif",lo="-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",yt={colors:{primary:"#1A1714",primaryHover:"#2A2622",primaryText:"#FAF8F4",background:"#FAF8F4",backgroundGradient:"#FAF8F4",surface:"#FAF8F4",surfaceHover:"#F2EEE6",text:"#1A1714",textSecondary:"#6B6660",textDisabled:"#A8A098",border:"#E8E3DA",borderFocus:"#1A1714",success:"#6B8E6B",successSurface:"rgba(107,142,107,0.08)",error:"#B85A3F",errorSurface:"rgba(184,90,63,0.06)",errorBorder:"rgba(184,90,63,0.18)",warning:"#D4532A",warningActive:"#B8451F",warningSurface:"rgba(212,83,42,0.06)",warningBorder:"rgba(212,83,42,0.22)",starFilled:"#1A1714",starEmpty:"#C9C2B6",voteUp:"#1A1714",voteUpSurface:"#FAF8F4",voteUpBorder:"#E8E3DA",voteDown:"#1A1714",voteDownSurface:"#FAF8F4",voteDownBorder:"#E8E3DA",npsColors:Ir,buttonBackground:"#1A1714",buttonBackgroundHover:"#2A2622",buttonBackgroundDisabled:"#E8E3DA",buttonColor:"#FAF8F4",buttonColorDisabled:"#A8A098",buttonBorder:"none",buttonShadow:"none",backdropColor:"rgba(26,23,20,0.32)",closeButton:"#6B6660",closeButtonHover:"#1A1714",closeButtonBg:"rgba(26,23,20,0.04)",glassBackground:"#FAF8F4",glassBorder:"1px solid #E8E3DA",glassColor:"#1A1714",glassShadow:"0 1px 2px rgba(26,23,20,0.04), 0 12px 32px -8px rgba(26,23,20,0.12)",glassHoverShadow:"0 2px 4px rgba(26,23,20,0.06), 0 16px 40px -8px rgba(26,23,20,0.16)",inputBackground:"transparent",inputBackgroundFocus:"transparent",inputBorder:"#E8E3DA",inputBorderFocus:"#1A1714",inputFocusRing:"transparent",pollBorder:"#E8E3DA",pollSelectedBorder:"#D4532A",pollBackground:"#FAF8F4",pollSelectedBackground:"#FAF8F4",pollColor:"#1A1714",pollSelectedColor:"#1A1714",pollCheckBorder:"#C9C2B6",pollCheckSelectedBorder:"#1A1714",pollCheckSelectedBg:"#1A1714"},typography:{fontFamily:lo,fontFamilyDisplay:io,fontSize:{xs:11,sm:13,md:15,lg:17},fontWeight:{normal:400,medium:500,semibold:600,bold:700}},borders:{radius:{sm:6,md:10,lg:14,full:"999px"},width:1},shadows:{sm:"0 1px 2px rgba(26,23,20,0.04)",md:"0 2px 4px rgba(26,23,20,0.06), 0 8px 20px -6px rgba(26,23,20,0.08)",lg:"0 2px 4px rgba(26,23,20,0.06), 0 16px 40px -8px rgba(26,23,20,0.12)",modal:"0 2px 4px rgba(26,23,20,0.06), 0 24px 64px -12px rgba(26,23,20,0.18)",button:"0 1px 2px rgba(26,23,20,0.04), 0 12px 32px -8px rgba(26,23,20,0.12)"},animation:{duration:{fast:"0.18s",normal:"0.24s",slow:"0.32s"},easing:{default:"cubic-bezier(0.22, 0.61, 0.36, 1)",spring:"cubic-bezier(0.22, 0.61, 0.36, 1)"}}},wt={colors:{primary:"#F2EEE6",primaryHover:"#FAF8F4",primaryText:"#141210",background:"#1A1714",backgroundGradient:"#1A1714",surface:"#1A1714",surfaceHover:"#221E1A",text:"#F2EEE6",textSecondary:"#9A928A",textDisabled:"#5A5449",border:"#2A2622",borderFocus:"#F2EEE6",success:"#8FAE8F",successSurface:"rgba(143,174,143,0.1)",error:"#D17560",errorSurface:"rgba(209,117,96,0.06)",errorBorder:"rgba(209,117,96,0.22)",warning:"#DC6340",warningActive:"#E8704A",warningSurface:"rgba(220,99,64,0.08)",warningBorder:"rgba(220,99,64,0.28)",starFilled:"#F2EEE6",starEmpty:"#4A433A",voteUp:"#F2EEE6",voteUpSurface:"#1A1714",voteUpBorder:"#2A2622",voteDown:"#F2EEE6",voteDownSurface:"#1A1714",voteDownBorder:"#2A2622",npsColors:Lr,buttonBackground:"#F2EEE6",buttonBackgroundHover:"#FAF8F4",buttonBackgroundDisabled:"#2A2622",buttonColor:"#141210",buttonColorDisabled:"#5A5449",buttonBorder:"none",buttonShadow:"none",backdropColor:"rgba(0,0,0,0.52)",closeButton:"#9A928A",closeButtonHover:"#F2EEE6",closeButtonBg:"rgba(242,238,230,0.06)",glassBackground:"#1A1714",glassBorder:"1px solid #2A2622",glassColor:"#F2EEE6",glassShadow:"0 2px 4px rgba(0,0,0,0.4), 0 16px 40px -8px rgba(0,0,0,0.5)",glassHoverShadow:"0 4px 8px rgba(0,0,0,0.45), 0 20px 48px -8px rgba(0,0,0,0.55)",inputBackground:"transparent",inputBackgroundFocus:"transparent",inputBorder:"#2A2622",inputBorderFocus:"#F2EEE6",inputFocusRing:"transparent",pollBorder:"#2A2622",pollSelectedBorder:"#DC6340",pollBackground:"#1A1714",pollSelectedBackground:"#1A1714",pollColor:"#F2EEE6",pollSelectedColor:"#F2EEE6",pollCheckBorder:"#3A342E",pollCheckSelectedBorder:"#F2EEE6",pollCheckSelectedBg:"#F2EEE6"},typography:{fontFamily:lo,fontFamilyDisplay:io,fontSize:{xs:11,sm:13,md:15,lg:17},fontWeight:{normal:400,medium:500,semibold:600,bold:700}},borders:{radius:{sm:6,md:10,lg:14,full:"999px"},width:1},shadows:{sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 2px 4px rgba(0,0,0,0.35), 0 8px 20px -6px rgba(0,0,0,0.4)",lg:"0 2px 4px rgba(0,0,0,0.4), 0 16px 40px -8px rgba(0,0,0,0.5)",modal:"0 2px 4px rgba(0,0,0,0.4), 0 24px 64px -12px rgba(0,0,0,0.6)",button:"0 1px 2px rgba(0,0,0,0.3), 0 12px 32px -8px rgba(0,0,0,0.45)"},animation:{duration:{fast:"0.18s",normal:"0.24s",slow:"0.32s"},easing:{default:"cubic-bezier(0.22, 0.61, 0.36, 1)",spring:"cubic-bezier(0.22, 0.61, 0.36, 1)"}}};function Pr(e,o){return ye(e==="dark"?wt:yt,o)}function ue(e,o,t){let a=(e==="auto"||e==="custom"?o:e)==="dark"?ye({},wt):ye({},yt);return t&&(a=ye(a,t)),a}var Nr="Gotcha Fraunces",Gr="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",co=`
15
15
  @font-face {
16
- font-family: 'Carter One';
17
- font-style: normal;
16
+ font-family: '${Nr}';
18
17
  font-weight: 400;
18
+ font-style: normal;
19
19
  font-display: block;
20
- src: url(data:font/woff2;base64,d09GMgABAAAAAAK4AA4AAAAABOwAAAJlAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhQbXhwaBmAANBEICoFUgW8BNgIkAwgLBgAEIAWCUgcgGwoEUVQMHgC+OLCNaQVfBAoIrXGAIhjLIIM0CxavPfqMrzmLh6/9fufu20XEQyQzNNPOUEmimUZJpKLdIu3RKOU3O1hXc5D3YTdAbu+mRHU5AAIwC231R25qGGbpnwecyr34QQKM3gHMKMzOM4ogDSwQSreJE9bjISamQdCMwAAgeI0+S7qoy5j8TCDK8Ff4Fwm5+ecJhCwh9EgmsJiTo6S+/WkCPCU8DpCqr+hWKM/FBMRyfLPqV2LSlzBEIhqLxeGhIADg+rwoHxx58Oipm4301FUpgID4K8fAChoJFSYwAhNYKyDLAjudDimd9wA18hGDDvNkBE6AByBJiLpXVM2jgyht94hWK9yPQD+5lb948fAQKnfCK1PjBQWRayfW+hltCzAs9B8eX54Xd5g7vrzpiTswCeXB/VG5PNObmFr711KPrLKC6/mxys5avigCA+uFj8HGq+ErmaRDt/31k1XtfRtcI0pNluOCFEOOmVEOTg5eYn77Hq9Y0SJxu+bSBW5skqWS0VLXOvNJxgyRhVECycL7u2cb2pmOGdolPK+ORsLma1IHQCAY6I5NjWKsNzQVPeDnvzc7Pth+aTYMKHpqoEcCwSM4A6sVYPt/AIoeTckToLx4hELyieAj16Z4TKDbKYzIJOAW2JNhIptMhjyRlbXedjaymDv75i5jb1xkyVYiV4okyfIhmnG0EGNDIyMkVgmkUIJcmbJkQmLEi5Ehjz7iJF06pJeel1ETYiCBP/+OePouYuTKlyAX4iVTAl8JkhRIFyN3UpqAdTHa1nfVAy3Kk3LL2Ejf0Gch0McAqJNIAwAA) format('woff2');
21
- unicode-range: U+0047;
22
- }`.trim();function Ar(){if(typeof document>"u"||document.getElementById(io))return;let e=document.createElement("style");e.id=io,e.textContent=Rr,document.head.appendChild(e);}Ar();function me(e){return e.replace(/[{}<>;@\\]/g,"")}function Ir(e){let t={default:me(e.animation.easing.default),spring:me(e.animation.easing.spring)},o={normal:me(e.animation.duration.normal)},r=me(e.typography.fontFamily),s=me(e.colors.textDisabled),a=me(e.colors.border);return `
23
- /* \u2500\u2500 Gotcha Keyframe Animations \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
24
-
25
- @keyframes gotcha-modal-in {
26
- from { opacity: 0; transform: scale(0.92) translateY(-6px); }
27
- to { opacity: 1; transform: scale(1) translateY(0); }
28
- }
29
-
30
- @keyframes gotcha-modal-in-above {
31
- from { opacity: 0; transform: scale(0.92) translateY(6px); }
32
- to { opacity: 1; transform: scale(1) translateY(0); }
33
- }
34
-
35
- @keyframes gotcha-modal-in-center {
36
- from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
37
- to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
20
+ src: url(data:font/woff2;base64,${Gr}) format('woff2');
38
21
  }
22
+ `;var uo="gotcha-styles";function ke(e){return e.replace(/[{}<>;@\\]/g,"")}function Ur(e){let o=ke(e.animation.easing.default),t=ke(e.animation.duration.normal),r=ke(e.animation.duration.fast),a=ke(e.typography.fontFamily),s=ke(e.colors.textDisabled),i=ke(e.colors.borderFocus);return `
23
+ /* \u2500\u2500 Embedded Fraunces 144 SemiBold (OFL, subsetted to ASCII) \u2500\u2500 */
24
+ ${co}
25
+ /* \u2500\u2500 Gotcha keyframes (editorial) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
39
26
 
40
- @keyframes gotcha-success-pop {
41
- 0% { transform: scale(0); opacity: 0; }
42
- 50% { transform: scale(1.15); }
43
- 100% { transform: scale(1); opacity: 1; }
44
- }
45
-
46
- @keyframes gotcha-success-text {
47
- from { opacity: 0; transform: translateY(6px); }
27
+ @keyframes gotcha-fade-up {
28
+ from { opacity: 0; transform: translateY(8px); }
48
29
  to { opacity: 1; transform: translateY(0); }
49
30
  }
50
31
 
51
- @keyframes gotcha-check-draw {
52
- from { stroke-dashoffset: 24; }
53
- to { stroke-dashoffset: 0; }
54
- }
55
-
56
- @keyframes gotcha-glow-pulse {
57
- 0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.3); }
58
- 50% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
32
+ @keyframes gotcha-modal-in {
33
+ from { opacity: 0; transform: translateY(8px); }
34
+ to { opacity: 1; transform: translateY(0); }
59
35
  }
60
36
 
61
- @keyframes gotcha-star-pulse {
62
- 0% { transform: scale(1); }
63
- 40% { transform: scale(1.3); }
64
- 100% { transform: scale(1); }
37
+ @keyframes gotcha-modal-in-above {
38
+ from { opacity: 0; transform: translateY(-8px); }
39
+ to { opacity: 1; transform: translateY(0); }
65
40
  }
66
41
 
67
- @keyframes gotcha-shimmer {
68
- 0% { background-position: -200% 0; }
69
- 100% { background-position: 200% 0; }
42
+ @keyframes gotcha-modal-in-center {
43
+ from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); }
44
+ to { opacity: 1; transform: translate(-50%, -50%); }
70
45
  }
71
46
 
72
- @keyframes gotcha-fade-up {
47
+ @keyframes gotcha-overlay-in {
73
48
  from { opacity: 0; }
74
49
  to { opacity: 1; }
75
50
  }
76
51
 
77
- @keyframes gotcha-overlay-in {
78
- from { opacity: 0; }
79
- to { opacity: 1; }
52
+ @keyframes gotcha-check-draw {
53
+ from { stroke-dashoffset: 30; }
54
+ to { stroke-dashoffset: 0; }
80
55
  }
81
56
 
82
57
  @keyframes gotcha-expand-in {
83
58
  from { opacity: 0; max-height: 0; margin-top: 0; }
84
- to { opacity: 1; max-height: 200px; margin-top: 12px; }
85
- }
86
-
87
- @keyframes gotcha-bubble-pop {
88
- 0% { transform: scale(0); opacity: 0; filter: blur(4px); }
89
- 40% { opacity: 1; filter: blur(0px); }
90
- 65% { transform: scale(1.08); }
91
- 82% { transform: scale(0.97); }
92
- 100% { transform: scale(1); opacity: 1; filter: blur(0px); }
93
- }
94
-
95
- @keyframes gotcha-letter-in {
96
- 0% { opacity: 0; transform: scale(0.6) translateY(2px); filter: blur(3px); }
97
- 100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0px); }
59
+ to { opacity: 1; max-height: 240px; margin-top: 14px; }
98
60
  }
99
61
 
100
- @keyframes gotcha-arrive-glow {
101
- 0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.2); }
102
- 50% { box-shadow: 0 4px 16px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.25); }
62
+ @keyframes gotcha-progress {
63
+ from { transform: scaleX(0); }
64
+ to { transform: scaleX(1); }
103
65
  }
104
66
 
105
67
  @keyframes gotcha-spin {
@@ -107,18 +69,14 @@
107
69
  to { transform: rotate(360deg); }
108
70
  }
109
71
 
110
- @keyframes gotcha-dash {
111
- 0% { stroke-dasharray: 1, 62; stroke-dashoffset: 0; }
112
- 50% { stroke-dasharray: 40, 62; stroke-dashoffset: -12; }
113
- 100% { stroke-dasharray: 1, 62; stroke-dashoffset: -62; }
114
- }
115
-
116
- /* \u2500\u2500 Base Styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
72
+ /* \u2500\u2500 Base styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
117
73
 
118
74
  [data-gotcha] {
119
- font-family: ${r};
75
+ font-family: ${a};
120
76
  -webkit-font-smoothing: antialiased;
121
77
  -moz-osx-font-smoothing: grayscale;
78
+ text-rendering: optimizeLegibility;
79
+ font-feature-settings: 'kern' 1, 'liga' 1;
122
80
  }
123
81
 
124
82
  [data-gotcha] *, [data-gotcha] *::before, [data-gotcha] *::after {
@@ -131,44 +89,61 @@
131
89
 
132
90
  [data-gotcha] button:focus-visible {
133
91
  outline: none;
134
- box-shadow: 0 0 0 2px ${a};
92
+ box-shadow: 0 0 0 2px ${i};
135
93
  }
136
94
 
137
95
  .gotcha-root textarea::placeholder {
138
96
  color: ${s};
97
+ /* Upright, not italic \u2014 italic placeholders depress comprehension in
98
+ form inputs (Baymard). Italic is reserved for verb states like
99
+ "Sending\u2026" where it communicates motion/time. */
139
100
  }
140
101
 
141
- /* \u2500\u2500 Animation Utilities \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
102
+ /* \u2500\u2500 Animation utilities \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
142
103
 
143
104
  .gotcha-fade-up {
144
- animation: gotcha-fade-up ${o.normal} ${t.default} both;
105
+ animation: gotcha-fade-up ${t} ${o} both;
145
106
  }
146
107
 
147
108
  .gotcha-modal-enter {
148
- animation: gotcha-modal-in 0.3s ${t.spring} both;
109
+ animation: gotcha-modal-in ${t} ${o} both;
149
110
  }
150
111
 
151
112
  .gotcha-modal-enter-above {
152
- animation: gotcha-modal-in-above 0.3s ${t.spring} both;
113
+ animation: gotcha-modal-in-above ${t} ${o} both;
153
114
  }
154
115
 
155
116
  .gotcha-modal-enter-center {
156
- animation: gotcha-modal-in-center 0.3s ${t.spring} both;
117
+ animation: gotcha-modal-in-center ${t} ${o} both;
157
118
  }
158
119
 
159
120
  .gotcha-overlay-enter {
160
- animation: gotcha-overlay-in 0.2s ${t.default} both;
121
+ animation: gotcha-overlay-in ${r} ${o} both;
161
122
  }
162
123
 
163
- /* \u2500\u2500 Reduced Motion \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
164
-
124
+ /* \u2500\u2500 Reduced motion \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
125
+ Kill transforms and retime animations to near-instant. We carve out
126
+ the Spinner explicitly \u2014 it's the one widget surface where animation
127
+ communicates indeterminate status. Silencing it would leave reduced-
128
+ motion users staring at a static arc with no feedback that work is
129
+ in flight.
130
+ */
165
131
  @media (prefers-reduced-motion: reduce) {
166
- [data-gotcha] *, [data-gotcha] *::before, [data-gotcha] *::after {
132
+ [data-gotcha] *:not([role="img"]), [data-gotcha] *::before, [data-gotcha] *::after {
167
133
  animation-duration: 0.01ms !important;
168
134
  animation-iteration-count: 1 !important;
169
135
  transition-duration: 0.01ms !important;
136
+ transition-delay: 0ms !important;
137
+ transform: none !important;
138
+ }
139
+ [data-gotcha] .gotcha-fade-up,
140
+ [data-gotcha] .gotcha-modal-enter,
141
+ [data-gotcha] .gotcha-modal-enter-above,
142
+ [data-gotcha] .gotcha-modal-enter-center,
143
+ [data-gotcha] .gotcha-overlay-enter {
144
+ opacity: 1 !important;
170
145
  }
171
146
  }
172
- `.trim()}function Qe(e){if(typeof document>"u")return;if(!document.getElementById(ao)){let o=document.createElement("link");o.rel="preconnect",o.href="https://fonts.googleapis.com",document.head.appendChild(o);let r=document.createElement("link");r.rel="preconnect",r.href="https://fonts.gstatic.com",r.crossOrigin="anonymous",document.head.appendChild(r);let s=document.createElement("link");s.id=ao,s.rel="stylesheet",s.href="https://fonts.googleapis.com/css2?family=Carter+One&family=DM+Sans:wght@400;500;600;700&display=swap",document.head.appendChild(s);}let t=document.getElementById(so);t||(t=document.createElement("style"),t.id=so,document.head.appendChild(t)),t.textContent=Ir(e);}var co=react.createContext(null),Fr={};function Pr({apiKey:e,children:t,baseUrl:o,debug:r=false,disabled:s=false,defaultUser:a,themeConfig:l}){let[n,g]=react.useState(null);o&&!o.startsWith("https://")&&!o.startsWith("/")&&!o.includes("localhost")&&console.warn("[Gotcha] baseUrl should use HTTPS in production:",o);let c=react.useMemo(()=>ro({apiKey:e,baseUrl:o,debug:r}),[e,o,r]),i=react.useMemo(()=>a??Fr,[JSON.stringify(a)]);react.useEffect(()=>{let m=ne("light","light",l);Qe(m);},[l]),react.useEffect(()=>(Kt(),()=>Qt()),[]),react.useEffect(()=>{c.flushQueue();let m=()=>c.flushQueue();return window.addEventListener("online",m),()=>window.removeEventListener("online",m)},[c]);let p=react.useCallback(m=>{g(m);},[]),u=react.useCallback(()=>{g(null);},[]),d=react.useMemo(()=>({client:c,disabled:s,defaultUser:i,debug:r,activeModalId:n,openModal:p,closeModal:u,themeConfig:l}),[c,s,i,r,n,p,u,l]);return jsxRuntime.jsx(co.Provider,{value:d,children:t})}function L(){let e=react.useContext(co);if(!e)throw new Error("useGotchaContext must be used within a GotchaProvider");return e}function Ur(e,t){let o=new Date(e).getTime();if(isNaN(o))return true;let r=Date.now()-o,s=t*24*60*60*1e3;return r>=s}function uo(e){let{client:t,defaultUser:o}=L(),[r,s]=react.useState(false),[a,l]=react.useState(false),[n,g]=react.useState(null),[c,i]=react.useState(null);return react.useEffect(()=>{process.env.NODE_ENV!=="production"&&e.cooldownDays&&!e.onePerUser&&console.warn("[Gotcha] cooldownDays has no effect without onePerUser=true");let u=e.user?.id||o?.id;if(!u||!e.onePerUser){i(null);return}let d=false;return (async()=>{l(true);try{let f=await t.checkExistingResponse(e.elementId,u);d||(f&&e.cooldownDays&&e.cooldownDays>0&&Ur(f.createdAt,e.cooldownDays)?i(null):i(f));}catch{d||i(null);}finally{d||l(false);}})(),()=>{d=true;}},[t,e.elementId,e.user?.id,o?.id,e.onePerUser,e.cooldownDays]),{submit:react.useCallback(async u=>{s(true),g(null);try{let d=e.user?.id||o?.id,m;return e.onePerUser&&c&&d?m=await t.updateResponse(c.id,{content:u.content,title:u.title,rating:u.rating,vote:u.vote,pollSelected:u.pollSelected},d):m=await t.submitResponse({elementId:e.elementId,mode:e.mode,content:u.content,title:u.title,rating:u.rating,vote:u.vote,pollOptions:e.pollOptions,pollSelected:u.pollSelected,isBug:u.isBug,screenshot:u.screenshot,user:{...o,...e.user}}),e.onePerUser&&i({id:m.id,mode:e.mode,content:u.content??null,title:u.title??null,rating:u.rating??null,vote:u.vote??null,pollSelected:u.pollSelected??null,createdAt:m.createdAt}),e.onSuccess?.(m),m}catch(d){let m=d instanceof Error?d.message:"Something went wrong";throw g(m),e.onError?.(d instanceof Error?d:new Error(m)),d}finally{s(false);}},[t,o,e,c]),isLoading:r,isCheckingExisting:a,error:n,existingResponse:c,isEditing:!!c,clearError:()=>g(null)}}function fo(e,t){return `${V.HIDDEN_UNTIL}_${e}_${t}`}function go(e,t,o){if(!o||o<=0)return false;let r=fo(e,t),s=te(r);return s?new Date(s).getTime()>Date.now():false}function po(e){let{elementId:t,userId:o,hideAfterSubmitDays:r}=e,s=react.useMemo(()=>o||Ye(),[o]),[a,l]=react.useState(()=>go(t,s,r));react.useEffect(()=>{l(go(t,s,r));},[t,s,r]);let n=react.useCallback(()=>{if(!r||r<=0)return;let g=fo(t,s),c=new Date(Date.now()+r*24*60*60*1e3);oe(g,c.toISOString()),l(true);},[t,s,r]);return {isHidden:a,markHidden:n}}function Hr(e){return `${V.VISIT_COUNT}_${e}`}function ho(e){let{elementId:t,showAfterSeconds:o,showAfterScrollPercent:r,showAfterVisits:s}=e,a=o!=null||r!=null||s!=null,[l,n]=react.useState(!o),[g,c]=react.useState(!r),[i]=react.useState(()=>{if(!s)return true;let p=Hr(t),d=parseInt(te(p)||"0",10)+1;return oe(p,String(d)),d>=s});return react.useEffect(()=>{if(!o||o<=0)return;let p=Date.now(),u=o*1e3,d=()=>{Date.now()-p>=u?n(true):m=setTimeout(d,Math.min(1e3,u-(Date.now()-p)));},m=setTimeout(d,Math.min(1e3,u));return ()=>clearTimeout(m)},[o]),react.useEffect(()=>{if(!r||r<=0)return;let p=()=>{let u=document.documentElement.scrollHeight,d=window.innerHeight;if(u<=d){c(true);return}(window.scrollY+d)/u*100>=r&&c(true);};if(p(),!g)return window.addEventListener("scroll",p,{passive:true}),()=>window.removeEventListener("scroll",p)},[r,g]),{conditionsMet:!a||l&&g&&i}}function Je(...e){return e.filter(Boolean).join(" ")}var z=()=>typeof window>"u"?false:"ontouchstart"in window||navigator.maxTouchPoints>0,bo=(e,t)=>{let o={sm:{desktop:24,mobile:28},md:{desktop:32,mobile:34},lg:{desktop:40,mobile:40}};return t?o[e].mobile:o[e].desktop};function Vr(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function yo({size:e,theme:t,customStyles:o,showOnHover:r,touchBehavior:s,onClick:a,isOpen:l,isParentHovered:n=false,animated:g=true,queuedCount:c=0}){let[i,p]=react.useState(false),[u,d]=react.useState(false),[m,f]=react.useState(Vr),[h,b]=react.useState(false),[v,w]=react.useState(false),[k,R]=react.useState(false),{themeConfig:S}=L();react.useEffect(()=>{if(p(z()),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)"),O=Y=>f(Y.matches?"dark":"light");return $.addEventListener("change",O),()=>$.removeEventListener("change",O)},[]);let E=l?true:!i&&r?n:i&&s==="tap-to-reveal"?u:true;react.useEffect(()=>{if(E&&!k){let $=setTimeout(()=>R(true),600);return ()=>clearTimeout($)}},[E,k]);let A=()=>{if(i&&s==="tap-to-reveal"&&!u){d(true);return}a();},I=bo(e,i),T=react.useMemo(()=>ne(t,m,S),[t,m,S]),P=()=>E?v?"scale(0.95)":h?"scale(1.08)":"scale(1)":"scale(0.6)",ie={width:I,height:I,borderRadius:"50%",border:T.colors.glassBorder,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",background:T.colors.glassBackground,backdropFilter:"blur(20px) saturate(180%)",WebkitBackdropFilter:"blur(20px) saturate(180%)",color:T.colors.glassColor,boxShadow:h?T.colors.glassHoverShadow:T.colors.glassShadow,transition:k?`all 0.3s ${T.animation.easing.spring}`:"none",opacity:E?1:0,transform:P(),filter:v?"brightness(0.95)":"brightness(1)",pointerEvents:E?"auto":"none",...g&&E&&!k?{animation:"gotcha-bubble-pop 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275) both, gotcha-arrive-glow 1200ms ease-in-out 600ms both"}:{},...o?.button};return jsxRuntime.jsxs("button",{type:"button",onClick:A,onMouseEnter:()=>b(true),onMouseLeave:()=>{b(false),w(false);},onMouseDown:()=>w(true),onMouseUp:()=>w(false),onTouchStart:()=>w(true),onTouchEnd:()=>w(false),style:ie,className:Je("gotcha-button",l&&"gotcha-button--open"),"aria-label":"Give feedback on this feature","aria-expanded":l,"aria-haspopup":"dialog",children:[jsxRuntime.jsx(jr,{size:I*.65,animated:g}),c>0&&jsxRuntime.jsx("div",{"aria-label":`${c} queued`,style:{position:"absolute",top:-2,right:-2,width:8,height:8,borderRadius:"50%",backgroundColor:T.colors.warning,border:"1.5px solid rgba(255,255,255,0.9)"}})]})}function jr({size:e,animated:t=true}){let[o,r]=react.useState(false);return react.useEffect(()=>{r(true);},[]),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{fontFamily:"'Carter One', cursive",fontSize:e,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",marginTop:e*.05,marginRight:e*.05,userSelect:"none",opacity:t?0:o?1:0,...t&&o?{animation:"gotcha-letter-in 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 200ms both"}:{}},children:"G"})}function N({size:e=16,color:t="currentColor"}){return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",style:{animation:"gotcha-spin 0.8s linear infinite"},children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",strokeOpacity:"0.12"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",strokeLinecap:"round",style:{animation:"gotcha-dash 1.2s ease-in-out infinite"}})]})}function So({src:e,onRemove:t,resolvedTheme:o}){return jsxRuntime.jsxs("div",{style:{position:"relative",marginTop:10,borderRadius:o.borders.radius.md,overflow:"hidden",border:`1px solid ${o.colors.border}`},children:[jsxRuntime.jsx("img",{src:e,alt:"Screenshot",style:{display:"block",width:"100%",maxHeight:120,objectFit:"cover"}}),jsxRuntime.jsx("button",{type:"button",onClick:t,"aria-label":"Remove screenshot",style:{position:"absolute",top:4,right:4,width:22,height:22,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.6)",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,lineHeight:1},children:jsxRuntime.jsx("svg",{width:10,height:10,viewBox:"0 0 14 14",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 1L13 13M1 13L13 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]})}function qo({resolvedTheme:e,placeholder:t,submitText:o,isLoading:r,onSubmit:s,customStyles:a,initialValues:l,isEditing:n=false,showText:g=true,showRating:c=true,enableBugFlag:i=false,bugFlagLabel:p,enableScreenshot:u=false}){let[d,m]=react.useState(l?.content||""),[f,h]=react.useState(l?.rating??null),[b,v]=react.useState(false),[w,k]=react.useState(false),[R,S]=react.useState(null),[E,A]=react.useState(false),[I,T]=react.useState(false);react.useEffect(()=>{k(z());},[]),react.useEffect(()=>{l?.content!==void 0&&m(l.content||""),l?.rating!==void 0&&h(l.rating??null);},[l?.content,l?.rating]);let P=g&&c?d.trim().length>0||f!==null:g?d.trim().length>0:c?f!==null:false,ie=async()=>{A(true),T(false);try{let{captureScreenshot:x}=await Promise.resolve().then(()=>(Yo(),jo)),fe=await x();fe?S(fe):(T(!0),setTimeout(()=>T(!1),3e3));}catch{T(true),setTimeout(()=>T(false),3e3);}finally{A(false);}},$=x=>{x.preventDefault(),P&&s({content:g&&d.trim()?d.trim():void 0,rating:c&&f!==null?f:void 0,isBug:b||void 0,screenshot:R||void 0});},O={width:"100%",padding:w?"12px 14px":"10px 12px",border:`1px solid ${e.colors.inputBorder}`,borderRadius:e.borders.radius.md,backgroundColor:e.colors.inputBackground,color:e.colors.text,fontSize:w?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:w?100:80,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}, box-shadow ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.5,boxShadow:"inset 0 1px 2px rgba(0,0,0,0.04)",...a?.input},Y={width:"100%",padding:w?"14px 16px":"10px 16px",border:e.colors.buttonBorder,borderRadius:e.borders.radius.md,backgroundColor:e.colors.buttonBackground,color:e.colors.buttonColor,fontSize:w?e.typography.fontSize.lg:e.typography.fontSize.md,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:r?"not-allowed":"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,letterSpacing:"0.01em",...a?.submitButton};return jsxRuntime.jsxs("form",{onSubmit:$,children:[c&&jsxRuntime.jsx("div",{style:{marginBottom:g?w?16:12:0,...g?{}:{display:"flex",justifyContent:"center",padding:"8px 0"}},children:jsxRuntime.jsx(ys,{value:f,onChange:h,theme:e,isTouch:w,large:!g})}),g&&jsxRuntime.jsx("textarea",{value:d,onChange:x=>m(x.target.value),placeholder:t||"Share your thoughts...",maxLength:5e3,style:O,disabled:r,"aria-label":"Your feedback",onFocus:x=>{x.currentTarget.style.borderColor=e.colors.inputBorderFocus,x.currentTarget.style.boxShadow=`0 0 0 3px ${e.colors.inputFocusRing}`,x.currentTarget.style.backgroundColor=e.colors.inputBackgroundFocus;},onBlur:x=>{x.currentTarget.style.borderColor=e.colors.inputBorder,x.currentTarget.style.boxShadow="inset 0 1px 2px rgba(0,0,0,0.04)",x.currentTarget.style.backgroundColor=e.colors.inputBackground;}}),i&&jsxRuntime.jsxs("button",{type:"button",role:"switch","aria-checked":b,onClick:()=>v(!b),style:{display:"flex",alignItems:"center",gap:7,width:"100%",marginTop:10,padding:"7px 10px",border:`1px solid ${b?e.colors.warningBorder:e.colors.border}`,borderRadius:7,backgroundColor:b?e.colors.warningSurface:"transparent",cursor:"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,fontFamily:e.typography.fontFamily,...a?.bugFlag},onMouseEnter:x=>{b||(x.currentTarget.style.backgroundColor=e.colors.surfaceHover===e.colors.inputBackgroundFocus?"rgba(0,0,0,0.02)":e.colors.surfaceHover);},onMouseLeave:x=>{b||(x.currentTarget.style.backgroundColor="transparent");},children:[jsxRuntime.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:b?e.colors.warningActive:e.colors.textDisabled,strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,transition:`stroke ${e.animation.duration.fast}`},children:jsxRuntime.jsx("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})}),jsxRuntime.jsx("span",{style:{fontSize:12,fontWeight:b?e.typography.fontWeight.medium:e.typography.fontWeight.normal,color:b?e.colors.warningActive:e.colors.textDisabled,transition:`color ${e.animation.duration.fast}`,letterSpacing:"0.01em"},children:b?"Issue reported":p||"Report an issue"}),jsxRuntime.jsx("div",{style:{marginLeft:"auto",width:28,height:16,borderRadius:8,backgroundColor:b?e.colors.warning:e.colors.border,position:"relative",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,flexShrink:0},children:jsxRuntime.jsx("div",{style:{position:"absolute",top:2,left:b?14:2,width:12,height:12,borderRadius:"50%",backgroundColor:b?"#ffffff":e.colors.textDisabled,transition:`left ${e.animation.duration.fast} ${e.animation.easing.default}, background-color ${e.animation.duration.fast}`,boxShadow:"0 1px 2px rgba(0,0,0,0.15)"}})})]}),i&&u&&b&&!R&&jsxRuntime.jsxs("button",{type:"button",onClick:ie,disabled:E,style:{display:"flex",alignItems:"center",gap:6,width:"100%",marginTop:8,padding:"7px 10px",border:`1px solid ${e.colors.border}`,borderRadius:7,backgroundColor:"transparent",cursor:E?"not-allowed":"pointer",fontFamily:e.typography.fontFamily,fontSize:12,color:e.colors.textSecondary,transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`},onMouseEnter:x=>{x.currentTarget.style.backgroundColor=e.colors.surfaceHover;},onMouseLeave:x=>{x.currentTarget.style.backgroundColor="transparent";},children:[E?jsxRuntime.jsx(N,{size:14,color:e.colors.textSecondary}):jsxRuntime.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"10",r:"3"}),jsxRuntime.jsx("path",{d:"M2 17l4-4 3 3 4-4 9 9"})]}),E?"Capturing...":"Capture screenshot"]}),I&&jsxRuntime.jsx("div",{style:{fontSize:11,color:e.colors.textSecondary,marginTop:4,padding:"4px 0",fontFamily:e.typography.fontFamily},children:"Screenshot capture unavailable"}),i&&u&&b&&R&&jsxRuntime.jsx(So,{src:R,onRemove:()=>S(null),resolvedTheme:e}),jsxRuntime.jsxs("button",{type:"submit",disabled:r||!P,style:{...Y,marginTop:12,opacity:r?.8:1,backgroundColor:P?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:P?e.colors.buttonColor:e.colors.buttonColorDisabled,display:"flex",alignItems:"center",justifyContent:"center",gap:8,...r?{backgroundImage:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"gotcha-shimmer 1.5s ease infinite"}:{}},onMouseEnter:x=>{x.currentTarget.disabled||(x.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover,x.currentTarget.style.transform="translateY(-1px)",x.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:x=>{x.currentTarget.disabled||(x.currentTarget.style.backgroundColor=e.colors.buttonBackground,x.currentTarget.style.transform="translateY(0)",x.currentTarget.style.boxShadow="none");},children:[r&&jsxRuntime.jsx(N,{size:w?18:16,color:e.colors.buttonColor}),r?n?"Updating...":"Submitting...":n?"Update":o]})]})}function ys({value:e,onChange:t,theme:o,isTouch:r,large:s=false}){let[a,l]=react.useState(null),[n,g]=react.useState(null),c=react.useRef(),i=s?r?36:28:r?28:18,p=s?r?8:5:r?8:3;react.useEffect(()=>()=>{clearTimeout(c.current);},[]);let u=d=>{g(d),t(d),clearTimeout(c.current),c.current=setTimeout(()=>g(null),300);};return jsxRuntime.jsx("div",{style:{display:"flex",gap:s?r?8:6:r?6:2},role:"group","aria-label":"Rating",children:[1,2,3,4,5].map(d=>{let m=(a??e??0)>=d;return jsxRuntime.jsx("button",{type:"button",onClick:()=>u(d),onMouseEnter:()=>l(d),onMouseLeave:()=>l(null),"aria-label":`Rate ${d} out of 5`,"aria-pressed":e===d,style:{background:"none",border:"none",cursor:"pointer",padding:p,color:m?o.colors.starFilled:o.colors.starEmpty,transition:`color 0.15s ${o.animation.easing.default}`,transform:n===d?"scale(1)":a!==null&&a>=d?"scale(1.1)":"scale(1)",animation:n===d?`gotcha-star-pulse 0.3s ${o.animation.easing.spring}`:"none",filter:m?`drop-shadow(0 0 3px ${o.colors.starFilled}40)`:"none",transitionDelay:`${(d-1)*30}ms`},children:jsxRuntime.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})})},d)})})}function Ko({resolvedTheme:e,isLoading:t,onSubmit:o,initialVote:r,isEditing:s=false,labels:a}){let[l,n]=react.useState(false),[g,c]=react.useState(r||null),[i,p]=react.useState(r||null);react.useEffect(()=>{n(z());},[]),react.useEffect(()=>{r!==void 0&&(p(r),c(r));},[r]),react.useEffect(()=>{!t&&!s&&c(null);},[t,s]);let u=f=>{c(f),o({vote:f});},d=f=>{let h=i===f,b=f==="up"?e.colors.voteUp:e.colors.voteDown,v=f==="up"?e.colors.voteUpSurface:e.colors.voteDownSurface,w=f==="up"?e.colors.voteUpBorder:e.colors.voteDownBorder;return {flex:1,minWidth:0,overflow:"hidden",padding:l?"14px 18px":"10px 14px",border:h?`2px solid ${w}`:`1px solid ${e.colors.border}`,borderRadius:e.borders.radius.lg-2,background:h?`linear-gradient(135deg, ${v}, ${v})`:e.colors.surface,color:h?b:e.colors.textSecondary,fontSize:l?28:24,fontFamily:e.typography.fontFamily,cursor:t?"not-allowed":"pointer",transition:`all 0.2s ${e.animation.easing.default}`,display:"flex",alignItems:"center",justifyContent:"center",gap:l?10:8}},m=l?24:20;return jsxRuntime.jsxs("div",{style:{display:"flex",gap:l?12:10},role:"group","aria-label":"Vote",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>u("up"),disabled:t,style:d("up"),"aria-label":"Vote up - I like this","aria-pressed":i==="up",onMouseEnter:f=>{t||(f.currentTarget.style.transform="translateY(-2px) scale(1.02)",f.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:f=>{f.currentTarget.style.transform="translateY(0) scale(1)",f.currentTarget.style.boxShadow="none";},children:t&&g==="up"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(N,{size:m,color:e.colors.text}),jsxRuntime.jsx("span",{style:{fontSize:l?15:13,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.01em"},children:s?"Updating...":"Sending..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ws,{size:m}),jsxRuntime.jsx("span",{style:{fontSize:l?15:13,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.01em"},children:a?.up||(i==="up"?"Liked":"Like")})]})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>u("down"),disabled:t,style:d("down"),"aria-label":"Vote down - I don't like this","aria-pressed":i==="down",onMouseEnter:f=>{t||(f.currentTarget.style.transform="translateY(-2px) scale(1.02)",f.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:f=>{f.currentTarget.style.transform="translateY(0) scale(1)",f.currentTarget.style.boxShadow="none";},children:t&&g==="down"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(N,{size:m,color:e.colors.text}),jsxRuntime.jsx("span",{style:{fontSize:l?15:13,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.01em"},children:s?"Updating...":"Sending..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ss,{size:m}),jsxRuntime.jsx("span",{style:{fontSize:l?15:13,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.01em"},children:a?.down||(i==="down"?"Disliked":"Dislike")})]})})]})}function ws({size:e=24}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"})})}function Ss({size:e=24}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"})})}function Jo({resolvedTheme:e,options:t,allowMultiple:o,isLoading:r,onSubmit:s,initialSelected:a,isEditing:l=false}){let[n,g]=react.useState(a||[]),[c,i]=react.useState(false);react.useEffect(()=>{i(z());},[]),react.useEffect(()=>{a&&g(a);},[a]);let p=m=>{g(o?f=>f.includes(m)?f.filter(h=>h!==m):[...f,m]:f=>f.includes(m)?[]:[m]);},u=()=>{n.length!==0&&s({pollSelected:n});},d=(m,f)=>{let h=n.includes(m);return {width:"100%",padding:c?"12px 14px":"9px 12px",border:`1px solid ${h?e.colors.pollSelectedBorder:e.colors.pollBorder}`,borderRadius:e.borders.radius.lg-2,backgroundColor:h?e.colors.pollSelectedBackground:e.colors.pollBackground,color:h?e.colors.pollSelectedColor:e.colors.pollColor,fontSize:c?15:e.typography.fontSize.sm,fontWeight:h?e.typography.fontWeight.semibold:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:r?"not-allowed":"pointer",transition:`all 0.2s ${e.animation.easing.default}`,textAlign:"left",letterSpacing:"0.01em",display:"flex",alignItems:"center",gap:8,animation:`gotcha-fade-up ${e.animation.duration.normal} ${e.animation.easing.default} both`,animationDelay:`${f*.05}s`}};return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",gap:c?8:6},role:"group","aria-label":o?"Select one or more options":"Select an option",children:t.map((m,f)=>{let h=n.includes(m);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>p(m),disabled:r,style:d(m,f),"aria-pressed":h,onMouseEnter:b=>{r||(b.currentTarget.style.transform="translateX(2px)");},onMouseLeave:b=>{b.currentTarget.style.transform="translateX(0)";},children:[jsxRuntime.jsx("span",{style:{width:16,height:16,borderRadius:o?4:"50%",border:`2px solid ${h?e.colors.pollCheckSelectedBorder:e.colors.pollCheckBorder}`,backgroundColor:h?e.colors.pollCheckSelectedBg:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:`all ${e.animation.duration.fast}`},children:h&&jsxRuntime.jsx("svg",{width:10,height:10,viewBox:"0 0 12 12",fill:"none",children:jsxRuntime.jsx("path",{d:"M2 6l3 3 5-5",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),m]},m)})}),jsxRuntime.jsxs("button",{type:"button",onClick:u,disabled:r||n.length===0,style:{width:"100%",marginTop:12,padding:c?"14px 16px":"10px 16px",border:e.colors.buttonBorder,borderRadius:e.borders.radius.md,backgroundColor:n.length===0?e.colors.buttonBackgroundDisabled:e.colors.buttonBackground,color:n.length===0?e.colors.buttonColorDisabled:e.colors.buttonColor,fontSize:c?e.typography.fontSize.lg:e.typography.fontSize.md,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:r||n.length===0?"not-allowed":"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,letterSpacing:"0.01em",display:"flex",alignItems:"center",justifyContent:"center",gap:8,opacity:r?.8:1,...r?{backgroundImage:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"gotcha-shimmer 1.5s ease infinite"}:{}},onMouseEnter:m=>{m.currentTarget.disabled||(m.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover,m.currentTarget.style.transform="translateY(-1px)",m.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:m=>{m.currentTarget.disabled||(m.currentTarget.style.backgroundColor=n.length===0?e.colors.buttonBackgroundDisabled:e.colors.buttonBackground,m.currentTarget.style.transform="translateY(0)",m.currentTarget.style.boxShadow="none");},children:[r&&jsxRuntime.jsx(N,{size:c?18:16,color:e.colors.buttonColor}),r?l?"Updating...":"Submitting...":l?"Update":"Submit"]})]})}function er({resolvedTheme:e,submitText:t,isLoading:o,onSubmit:r,customStyles:s,showFollowUp:a=true,followUpPlaceholder:l,lowLabel:n="Not likely",highLabel:g="Very likely",initialValues:c,isEditing:i=false}){let[p,u]=react.useState(c?.rating??null),[d,m]=react.useState(c?.content||""),[f,h]=react.useState(false),[b,v]=react.useState(null);react.useEffect(()=>{h(z());},[]),react.useEffect(()=>{c?.rating!==void 0&&u(c.rating??null),c?.content!==void 0&&m(c.content||"");},[c?.rating,c?.content]);let w=p!==null,k=e.colors.npsColors;return jsxRuntime.jsxs("form",{onSubmit:S=>{S.preventDefault(),w&&r({rating:p??void 0,content:a&&d.trim()?d.trim():void 0});},children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{display:"flex",gap:f?4:6,justifyContent:"center"},role:"group","aria-label":"NPS Score",children:Array.from({length:11},(S,E)=>{let A=p===E,I=b===E,T=k[E];return jsxRuntime.jsx("button",{type:"button",onClick:()=>u(E),onMouseEnter:()=>v(E),onMouseLeave:()=>v(null),"aria-label":`Score ${E} out of 10`,"aria-pressed":A,style:{flex:1,minWidth:0,height:f?34:32,borderRadius:e.borders.radius.sm,border:A?`2px solid ${T}`:`1.5px solid ${T}25`,backgroundColor:A?T:I?`${T}25`:`${T}0c`,color:A?"#fff":I?T:`${T}bb`,fontSize:12,fontWeight:A?e.typography.fontWeight.bold:e.typography.fontWeight.semibold,fontFamily:e.typography.fontFamily,fontVariantNumeric:"tabular-nums",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center",transition:`all 0.2s ${e.animation.easing.spring}`,transform:A?"scale(1.08)":I?"scale(1.04)":"scale(1)",boxShadow:A?`0 0 12px ${T}40`:"none",...s?.npsButton,...A?s?.npsButtonSelected:{}},children:E},E)})}),jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:6,padding:"0 2px",...s?.npsLabels},children:[jsxRuntime.jsx("span",{style:{fontSize:e.typography.fontSize.xs,color:e.colors.textDisabled,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.02em"},children:n}),jsxRuntime.jsx("span",{style:{fontSize:e.typography.fontSize.xs,color:e.colors.textDisabled,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.02em"},children:g})]})]}),a&&p!==null&&jsxRuntime.jsx("textarea",{value:d,onChange:S=>m(S.target.value),placeholder:l||"What's the main reason for your score?",maxLength:5e3,style:{width:"100%",padding:f?"12px 14px":"10px 12px",border:`1px solid ${e.colors.inputBorder}`,borderRadius:e.borders.radius.md,backgroundColor:e.colors.inputBackground,color:e.colors.text,fontSize:f?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"vertical",minHeight:f?80:60,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}, box-shadow ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.5,animation:`gotcha-expand-in 0.3s ${e.animation.easing.default} both`,overflow:"hidden",...s?.input},disabled:o,"aria-label":"Follow-up feedback",onFocus:S=>{S.currentTarget.style.borderColor=e.colors.inputBorderFocus,S.currentTarget.style.boxShadow=`0 0 0 3px ${e.colors.inputFocusRing}`,S.currentTarget.style.backgroundColor=e.colors.inputBackgroundFocus;},onBlur:S=>{S.currentTarget.style.borderColor=e.colors.inputBorder,S.currentTarget.style.boxShadow="none",S.currentTarget.style.backgroundColor=e.colors.inputBackground;}}),jsxRuntime.jsxs("button",{type:"submit",disabled:o||!w,style:{width:"100%",padding:f?"14px 16px":"10px 16px",border:e.colors.buttonBorder,borderRadius:e.borders.radius.md,backgroundColor:w?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:w?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:f?e.typography.fontSize.lg:e.typography.fontSize.md,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:o?"not-allowed":"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,letterSpacing:"0.01em",opacity:o?.8:1,display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginTop:12,...o?{backgroundImage:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"gotcha-shimmer 1.5s ease infinite"}:{},...s?.submitButton},onMouseEnter:S=>{S.currentTarget.disabled||(S.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover,S.currentTarget.style.transform="translateY(-1px)",S.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:S=>{S.currentTarget.disabled||(S.currentTarget.style.backgroundColor=w?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,S.currentTarget.style.transform="translateY(0)",S.currentTarget.style.boxShadow="none");},children:[o&&jsxRuntime.jsx(N,{size:f?18:16,color:e.colors.buttonColor}),o?i?"Updating...":"Submitting...":i?"Update":t]})]})}function rr({resolvedTheme:e,promptText:t,placeholder:o,isLoading:r,onSubmit:s}){let[a,l]=react.useState(""),[n,g]=react.useState(false);return react.useEffect(()=>{g(z());},[]),jsxRuntime.jsxs("form",{onSubmit:i=>{i.preventDefault(),a.trim()&&s(a.trim());},children:[jsxRuntime.jsx("p",{style:{margin:"0 0 12px 0",fontSize:e.typography.fontSize.sm,color:e.colors.textSecondary,lineHeight:1.4,fontFamily:e.typography.fontFamily},children:t}),jsxRuntime.jsx("textarea",{value:a,onChange:i=>l(i.target.value),placeholder:o||"Tell us more...",maxLength:5e3,disabled:r,"aria-label":"Follow-up feedback",style:{width:"100%",padding:n?"12px 14px":"10px 12px",border:`1px solid ${e.colors.inputBorder}`,borderRadius:e.borders.radius.md,backgroundColor:e.colors.inputBackground,color:e.colors.text,fontSize:n?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:n?100:80,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}, box-shadow ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.5,boxShadow:"inset 0 1px 2px rgba(0,0,0,0.04)"},onFocus:i=>{i.currentTarget.style.borderColor=e.colors.inputBorderFocus,i.currentTarget.style.boxShadow=`0 0 0 3px ${e.colors.inputFocusRing}`,i.currentTarget.style.backgroundColor=e.colors.inputBackgroundFocus;},onBlur:i=>{i.currentTarget.style.borderColor=e.colors.inputBorder,i.currentTarget.style.boxShadow="inset 0 1px 2px rgba(0,0,0,0.04)",i.currentTarget.style.backgroundColor=e.colors.inputBackground;}}),jsxRuntime.jsxs("button",{type:"submit",disabled:r||!a.trim(),style:{width:"100%",marginTop:12,padding:n?"14px 16px":"10px 16px",border:e.colors.buttonBorder,borderRadius:e.borders.radius.md,backgroundColor:a.trim()?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:a.trim()?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:n?e.typography.fontSize.lg:e.typography.fontSize.md,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:r?"not-allowed":"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,letterSpacing:"0.01em",display:"flex",alignItems:"center",justifyContent:"center",gap:8,opacity:r?.8:1},onMouseEnter:i=>{i.currentTarget.disabled||(i.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover,i.currentTarget.style.transform="translateY(-1px)",i.currentTarget.style.boxShadow=e.shadows.button);},onMouseLeave:i=>{i.currentTarget.disabled||(i.currentTarget.style.backgroundColor=e.colors.buttonBackground,i.currentTarget.style.transform="translateY(0)",i.currentTarget.style.boxShadow="none");},children:[r&&jsxRuntime.jsx(N,{size:n?18:16,color:e.colors.buttonColor}),r?"Sending...":"Submit"]})]})}function Pt({mode:e,theme:t,customStyles:o,promptText:r,placeholder:s,submitText:a,thankYouMessage:l,isLoading:n,isCheckingExisting:g=false,isSubmitted:c,phase:i="form",followUpConfig:p,followUpLoading:u=false,onFollowUpSubmit:d,error:m,existingResponse:f,isEditing:h=false,showText:b=true,showRating:v=true,voteLabels:w,options:k,allowMultiple:R=false,npsQuestion:S,npsFollowUp:E=true,npsFollowUpPlaceholder:A,npsLowLabel:I,npsHighLabel:T,enableBugFlag:P=false,bugFlagLabel:ie,enableScreenshot:$=false,onSubmit:O,onClose:Y,anchorRect:x,useFixedPosition:fe=false}){let _e=react.useRef(null),He=react.useRef(null),we=react.useRef(Y);we.current=Y;let[G,ct]=react.useState(false),[We,Ve]=react.useState("light"),{themeConfig:Se}=L();react.useEffect(()=>{ct(window.innerWidth<640);let M=window.matchMedia("(prefers-color-scheme: dark)");Ve(M.matches?"dark":"light");let _=H=>Ve(H.matches?"dark":"light");return M.addEventListener("change",_),()=>M.removeEventListener("change",_)},[]);let y=react.useMemo(()=>ne(t,We,Se),[t,We,Se]);react.useEffect(()=>{Qe(y);},[y]);let xe=typeof window>"u"||!x?false:window.innerHeight-x.bottom<300;react.useEffect(()=>{let M=_e.current;if(!M)return;He.current?.focus();let _=H=>{if(H.key==="Escape"){we.current();return}if(H.key==="Tab"){let J=M.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),Ee=J[0],ke=J[J.length-1];H.shiftKey&&document.activeElement===Ee?(H.preventDefault(),ke?.focus()):!H.shiftKey&&document.activeElement===ke&&(H.preventDefault(),Ee?.focus());}};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[]);let le=e==="vote"?"What do you think?":e==="poll"?"Cast your vote":e==="nps"?S||"How likely are you to recommend us?":"What do you think of this feature?",ve=G?24:20,ce=e==="nps"?420:340,ut=G?"gotcha-modal-enter-center":xe?"gotcha-modal-enter-above":"gotcha-modal-enter",Te=typeof window<"u"?window.innerHeight:0,q=G?{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100vw - 32px)",maxWidth:ce,padding:ve,borderRadius:y.borders.radius.lg+2,background:y.colors.backgroundGradient,color:y.colors.text,boxShadow:y.shadows.modal,border:`${y.borders.width}px solid ${y.colors.border}`,zIndex:9999,fontFamily:y.typography.fontFamily,...o?.modal,textAlign:"left"}:fe&&x&&Te?(()=>{let M=window.innerWidth,_=24,J=x.left+x.width/2-ce/2;return {position:"fixed",left:Math.max(_,Math.min(J,M-ce-_)),width:ce,padding:ve,borderRadius:y.borders.radius.lg,background:y.colors.backgroundGradient,color:y.colors.text,boxShadow:y.shadows.modal,border:`${y.borders.width}px solid ${y.colors.border}`,zIndex:99999,fontFamily:y.typography.fontFamily,...xe?{bottom:Te-x.top+8}:{top:x.bottom+8},...o?.modal,textAlign:"left"}})():{position:"absolute",left:"50%",width:ce,padding:ve,borderRadius:y.borders.radius.lg,background:y.colors.backgroundGradient,color:y.colors.text,boxShadow:y.shadows.modal,border:`${y.borders.width}px solid ${y.colors.border}`,zIndex:9999,fontFamily:y.typography.fontFamily,...xe?{bottom:"100%",marginBottom:8,transform:"translateX(-50%)"}:{top:"100%",marginTop:8,transform:"translateX(-50%)"},...o?.modal,textAlign:"left"},K=M=>G?{}:{animation:`gotcha-fade-up ${y.animation.duration.normal} ${y.animation.easing.default} both`,animationDelay:`${M*.05}s`},ue=l==="Gotcha!"||l==="Thanks for your feedback!";return jsxRuntime.jsxs("div",{ref:_e,role:"dialog","aria-modal":"true","aria-label":c?"Feedback submitted":void 0,"aria-labelledby":c?void 0:"gotcha-modal-title","data-gotcha":true,style:q,className:Je("gotcha-modal",ut),children:[jsxRuntime.jsx("button",{ref:He,type:"button",onClick:Y,"aria-label":"Close feedback form",style:{position:"absolute",top:G?10:6,right:G?10:6,width:G?40:36,height:G?40:36,border:"none",background:"transparent",outline:"none",cursor:"pointer",zIndex:10,color:y.colors.closeButton,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:y.borders.radius.sm,transition:`all ${y.animation.duration.fast} ${y.animation.easing.default}`,...o?.closeButton},onMouseEnter:M=>{M.currentTarget.style.backgroundColor=y.colors.closeButtonBg,M.currentTarget.style.color=y.colors.closeButtonHover;},onMouseLeave:M=>{M.currentTarget.style.backgroundColor="transparent",M.currentTarget.style.color=y.colors.closeButton;},children:jsxRuntime.jsx("svg",{width:G?16:14,height:G?16:14,viewBox:"0 0 14 14",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 1L13 13M1 13L13 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),!c&&jsxRuntime.jsx("h2",{id:"gotcha-modal-title",style:{margin:"0 0 16px 0",fontSize:G?y.typography.fontSize.lg:y.typography.fontSize.md,fontWeight:y.typography.fontWeight.semibold,paddingRight:G?44:38,letterSpacing:"-0.02em",lineHeight:1.4,textAlign:"left",fontFamily:y.typography.fontFamily,...K(0),...o?.title},children:r||le}),c&&jsxRuntime.jsxs("div",{style:{textAlign:"center",padding:"28px 0 20px"},children:[jsxRuntime.jsx("div",{style:{width:52,height:52,borderRadius:"50%",backgroundColor:y.colors.successSurface,display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",animation:`gotcha-success-pop 0.4s ${y.animation.easing.spring} both, gotcha-glow-pulse 0.8s ease 0.4s`,...o?.successIcon},children:jsxRuntime.jsx("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M20 6L9 17L4 12",stroke:y.colors.success,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{strokeDasharray:24,strokeDashoffset:0,animation:"gotcha-check-draw 0.4s ease 0.2s both"}})})}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:ue?22:y.typography.fontSize.md,fontWeight:ue?y.typography.fontWeight.bold:y.typography.fontWeight.medium,color:y.colors.text,fontFamily:ue?"'Carter One', cursive":y.typography.fontFamily,animation:"gotcha-success-text 0.3s ease 0.3s both",...o?.successMessage},children:ue?"Gotcha!":l}),ue&&jsxRuntime.jsx("p",{style:{margin:"6px 0 0",fontSize:y.typography.fontSize.sm,fontWeight:y.typography.fontWeight.normal,color:y.colors.textSecondary,animation:"gotcha-success-text 0.3s ease 0.45s both"},children:"Thanks for your feedback!"})]}),m&&!c&&jsxRuntime.jsxs("div",{style:{padding:"8px 10px",marginBottom:12,borderRadius:y.borders.radius.sm,backgroundColor:y.colors.errorSurface,border:`1px solid ${y.colors.errorBorder}`,color:y.colors.error,fontSize:y.typography.fontSize.sm,lineHeight:1.4,display:"flex",alignItems:"center",gap:8,...K(1),...o?.errorMessage},children:[jsxRuntime.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",style:{flexShrink:0},children:jsxRuntime.jsx("path",{d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}),m]}),i==="followUp"&&p&&d&&jsxRuntime.jsx("div",{style:K(1),children:jsxRuntime.jsx(rr,{resolvedTheme:y,promptText:p.promptText,placeholder:p.placeholder,isLoading:u,onSubmit:d})}),i==="form"&&g&&jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"24px 0",...K(1)},children:jsxRuntime.jsx(N,{size:24,color:y.colors.textSecondary})}),i==="form"&&!g&&jsxRuntime.jsxs("div",{style:K(1),children:[e==="feedback"&&jsxRuntime.jsx(qo,{resolvedTheme:y,placeholder:s,submitText:a,isLoading:n,onSubmit:O,customStyles:o,initialValues:f?{content:f.content,rating:f.rating}:void 0,isEditing:h,showText:b,showRating:v,enableBugFlag:P,bugFlagLabel:ie,enableScreenshot:$}),e==="vote"&&jsxRuntime.jsx(Ko,{resolvedTheme:y,isLoading:n,onSubmit:O,initialVote:f?.vote||void 0,isEditing:h,labels:w}),e==="nps"&&jsxRuntime.jsx(er,{resolvedTheme:y,submitText:a,isLoading:n,onSubmit:O,showFollowUp:E,followUpPlaceholder:A,lowLabel:I,highLabel:T,customStyles:o,initialValues:f?{rating:f.rating,content:f.content}:void 0,isEditing:h}),e==="poll"&&k&&k.length>0&&jsxRuntime.jsx(Jo,{resolvedTheme:y,options:k,allowMultiple:R,isLoading:n,onSubmit:O,initialSelected:f?.pollSelected||void 0,isEditing:h})]}),jsxRuntime.jsxs("div",{"aria-live":"polite",className:"sr-only",style:{position:"absolute",left:-9999},children:[c&&"Thank you! Your feedback has been submitted.",m&&`Error: ${m}`]})]})}function Ts({elementId:e,user:t,mode:o="feedback",showText:r=true,showRating:s=true,voteLabels:a,options:l,allowMultiple:n=false,npsQuestion:g,npsFollowUp:c=true,npsFollowUpPlaceholder:i,npsLowLabel:p,npsHighLabel:u,enableBugFlag:d=false,bugFlagLabel:m,enableScreenshot:f=false,onePerUser:h=false,cooldownDays:b,hideAfterSubmitDays:v,showAfterSeconds:w,showAfterScrollPercent:k,showAfterVisits:R,followUp:S,animated:E=true,position:A=ee.POSITION,size:I=ee.SIZE,theme:T=ee.THEME,customStyles:P,visible:ie=true,showOnHover:$=ee.SHOW_ON_HOVER,touchBehavior:O=ee.TOUCH_BEHAVIOR,promptText:Y,placeholder:x,submitText:fe=ee.SUBMIT_TEXT,thankYouMessage:_e=ee.THANK_YOU_MESSAGE,onSubmit:He,onOpen:we,onClose:G,onError:ct}){let{disabled:We,activeModalId:Ve,openModal:Se,closeModal:y,defaultUser:xe,client:le}=L(),{conditionsMet:ve}=ho({elementId:e,showAfterSeconds:w,showAfterScrollPercent:k,showAfterVisits:R}),{isHidden:ce,markHidden:ut}=po({elementId:e,userId:t?.id||xe?.id,hideAfterSubmitDays:v}),[Te,q]=react.useState("form"),[K,ue]=react.useState(null),[M,_]=react.useState(false),[H,J]=react.useState(0),[Ee,ke]=react.useState(false),[lr,cr]=react.useState(null),[Ce,ur]=react.useState(false),[Nt,dr]=react.useState(false),Re=react.useRef(null),Ae=react.useRef(),Ie=react.useRef(null);react.useEffect(()=>(dr(true),ur(window.innerWidth<640),()=>{clearTimeout(Ae.current);}),[]),react.useEffect(()=>{J(le.getQueueLength());let C=()=>{setTimeout(()=>J(le.getQueueLength()),2e3);};return window.addEventListener("online",C),()=>window.removeEventListener("online",C)},[le]);let Z=Ve===e;react.useEffect(()=>{Z||(q("form"),clearTimeout(Ae.current));},[Z]),react.useEffect(()=>{if(!Z||!Ce)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C;}},[Z,Ce]),react.useEffect(()=>{if(!$)return;let C=Re.current;if(!C)return;let W=C.parentElement;if(!W)return;let _t=()=>ke(true),Ht=()=>ke(false);return W.addEventListener("mouseenter",_t),W.addEventListener("mouseleave",Ht),()=>{W.removeEventListener("mouseenter",_t),W.removeEventListener("mouseleave",Ht);}},[$]);let{submit:Ut,isLoading:gr,isCheckingExisting:fr,error:pr,existingResponse:mr,isEditing:$t}=uo({elementId:e,mode:o,pollOptions:l,user:t,onePerUser:h,cooldownDays:b,onSuccess:C=>{ue(C.id),v&&ut(),He?.(C),S&&Ie.current&&(S.ratingThreshold!=null&&Ie.current.rating!=null&&Ie.current.rating<=S.ratingThreshold||S.onNegativeVote&&Ie.current.vote==="down")&&o!=="poll"?q("followUp"):(q("success"),Ae.current=setTimeout(()=>{y(),q("form");},3e3));},onError:C=>{console.warn("[Gotcha] Submission failed:",C instanceof Error?C.message:C),ct?.(C);}}),hr=react.useCallback(()=>{if(Re.current){let C=Re.current.querySelector("button");cr((C??Re.current).getBoundingClientRect());}Se(e),we?.();},[e,Se,we]),zt=react.useCallback(()=>{clearTimeout(Ae.current),y(),q("form"),G?.();},[y,G]),br=react.useCallback(C=>{Ie.current={rating:C.rating,vote:C.vote},Ut(C);},[Ut]),yr=react.useCallback(async C=>{if(K){_(true);try{await le.updateResponse(K,{content:C});}catch(W){console.warn("[Gotcha] Follow-up submission failed:",W instanceof Error?W.message:W);}finally{_(false),q("success"),Ae.current=setTimeout(()=>{y(),q("form");},3e3);}}},[K,y,le]),wr=h&&$t?"Update":fe;if(We||!ie||ce||!ve)return null;let Sr={"top-right":{position:"absolute",top:0,right:0,transform:"translate(50%, -50%)"},"top-left":{position:"absolute",top:0,left:0,transform:"translate(-50%, -50%)"},"bottom-right":{position:"absolute",bottom:0,right:0,transform:"translate(50%, 50%)"},"bottom-left":{position:"absolute",bottom:0,left:0,transform:"translate(-50%, 50%)"},inline:{position:"relative",display:"inline-flex"}},Ot={mode:o,theme:T,customStyles:P,promptText:Y,placeholder:x,submitText:wr,thankYouMessage:_e,isLoading:gr,isCheckingExisting:h&&fr,isSubmitted:Te==="success",phase:Te,followUpConfig:S,followUpLoading:M,onFollowUpSubmit:yr,error:pr,existingResponse:h?mr:null,isEditing:h&&$t,showText:r,showRating:s,voteLabels:a,options:l,allowMultiple:n,npsQuestion:g,npsFollowUp:c,npsFollowUpPlaceholder:i,npsLowLabel:p,npsHighLabel:u,enableBugFlag:d,bugFlagLabel:m,enableScreenshot:f,onSubmit:br,onClose:zt,anchorRect:lr||void 0,useFixedPosition:!Ce};return jsxRuntime.jsxs("div",{ref:Re,style:{...Sr[A],zIndex:Z?1e4:"auto"},className:"gotcha-container","data-gotcha-element":e,children:[jsxRuntime.jsx(yo,{size:I,theme:T,customStyles:P,showOnHover:$,touchBehavior:O,onClick:hr,isOpen:Z,isParentHovered:Ee,animated:E,queuedCount:H}),Z&&!Ce&&Nt&&reactDom.createPortal(jsxRuntime.jsx(Pt,{...Ot}),document.body),Z&&Ce&&Nt&&reactDom.createPortal(jsxRuntime.jsx("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:99999,backgroundColor:"rgba(0,0,0,0.4)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},className:"gotcha-overlay-enter",onClick:zt,children:jsxRuntime.jsx("div",{onClick:C=>C.stopPropagation(),children:jsxRuntime.jsx(Pt,{...Ot})})}),document.body)]})}function ar({elementId:e,refreshInterval:t}){let{client:o}=L(),[r,s]=react.useState(null),[a,l]=react.useState(true),[n,g]=react.useState(null);return react.useEffect(()=>{let c=false,i=async()=>{try{let u=await o.getScore(e);c||(s(u),g(null));}catch(u){c||g(u instanceof Error?u.message:"Failed to load score");}finally{c||l(false);}};i();let p;return t&&t>0&&(p=setInterval(i,t)),()=>{c=true,p&&clearInterval(p);}},[o,e,t]),{score:r,isLoading:a,error:n}}var Is={sm:{fontSize:11,ratingFontSize:13,starSize:13,gap:5,pillPx:8,pillPy:4,barHeight:3,iconSize:12},md:{fontSize:12.5,ratingFontSize:15,starSize:15,gap:6,pillPx:10,pillPy:5,barHeight:4,iconSize:14},lg:{fontSize:14,ratingFontSize:18,starSize:18,gap:8,pillPx:12,pillPy:6,barHeight:5,iconSize:16}};function Bs({rating:e,size:t,filledColor:o,emptyColor:r}){let s=`gotcha-star-clip-${Math.random().toString(36).slice(2,8)}`,a=[];for(let l=1;l<=5;l++){let n=Math.min(1,Math.max(0,e-(l-1))),g=`${s}-${l}`;a.push(jsxRuntime.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",style:{display:"block"},children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:g,children:jsxRuntime.jsx("rect",{x:"0",y:"0",width:24*n,height:"24"})})}),jsxRuntime.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:r}),jsxRuntime.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:o,clipPath:`url(#${g})`})]},l));}return jsxRuntime.jsx("span",{style:{display:"inline-flex",gap:Math.max(1,t*.08),alignItems:"center"},children:a})}function Ms({rate:e,height:t,filledColor:o,trackColor:r}){return jsxRuntime.jsx("span",{style:{display:"inline-block",width:48,height:t,borderRadius:t,backgroundColor:r,overflow:"hidden",verticalAlign:"middle"},children:jsxRuntime.jsx("span",{style:{display:"block",width:`${e}%`,height:"100%",borderRadius:t,background:o,transition:"width 0.6s cubic-bezier(0.4, 0, 0.2, 1)"}})})}function Ds({size:e,color:t}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:t,style:{display:"block"},children:jsxRuntime.jsx("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66a4.8 4.8 0 00-.88-1.12L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})})}function Fs({elementId:e,variant:t="stars",showCount:o=true,size:r="md",theme:s="auto",refreshInterval:a,style:l}){let{score:n,isLoading:g}=ar({elementId:e,refreshInterval:a}),[c,i]=react.useState("light");react.useEffect(()=>{if(typeof window>"u")return;let I=window.matchMedia("(prefers-color-scheme: dark)");i(I.matches?"dark":"light");let T=P=>i(P.matches?"dark":"light");return I.addEventListener("change",T),()=>I.removeEventListener("change",T)},[]);let{themeConfig:p}=L(),u=react.useMemo(()=>ne(s,c,p),[s,c,p]);if(g||!n)return null;let d=Is[r],m=u.colors.text,f=u.colors.textDisabled,h=u.colors.starFilled,b=u.colors.starEmpty,v=u.colors.voteUp,w=u.colors.starEmpty,k={display:"inline-flex",alignItems:"center",gap:d.gap,fontFamily:u.typography.fontFamily,lineHeight:1,letterSpacing:"-0.01em",WebkitFontSmoothing:"antialiased",...l},R=(I,T)=>{let P=I===1?T:`${T}s`;return `${I.toLocaleString()} ${P}`};if(t==="votes"){let{voteCount:I,positiveRate:T}=n,P=I.up+I.down;return P===0?null:jsxRuntime.jsxs("span",{style:k,children:[jsxRuntime.jsx(Ds,{size:d.iconSize,color:v}),jsxRuntime.jsxs("span",{style:{fontSize:d.ratingFontSize,fontWeight:600,color:v,fontVariantNumeric:"tabular-nums"},children:[T,"%"]}),jsxRuntime.jsx(Ms,{rate:T??0,height:d.barHeight,filledColor:v,trackColor:w}),o&&jsxRuntime.jsx("span",{style:{fontSize:d.fontSize,color:f,fontWeight:400},children:R(P,"vote")})]})}let{averageRating:S,totalResponses:E}=n;if(S===null||E===0)return null;let A=S.toFixed(1);return t==="compact"?jsxRuntime.jsxs("span",{style:k,children:[jsxRuntime.jsx("svg",{width:d.starSize,height:d.starSize,viewBox:"0 0 24 24",style:{display:"block",flexShrink:0},children:jsxRuntime.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:h})}),jsxRuntime.jsx("span",{style:{fontSize:d.ratingFontSize,fontWeight:700,color:m,fontVariantNumeric:"tabular-nums"},children:A}),o&&jsxRuntime.jsxs("span",{style:{fontSize:d.fontSize,color:f,fontWeight:400},children:["(",E.toLocaleString(),")"]})]}):t==="number"?jsxRuntime.jsxs("span",{style:k,children:[jsxRuntime.jsx("span",{style:{fontSize:d.ratingFontSize,fontWeight:700,color:m,fontVariantNumeric:"tabular-nums"},children:A}),jsxRuntime.jsx("span",{style:{fontSize:d.fontSize,color:f,fontWeight:400},children:"/ 5"}),o&&jsxRuntime.jsxs("span",{style:{fontSize:d.fontSize,color:f,fontWeight:400,marginLeft:2},children:["(",R(E,"response"),")"]})]}):jsxRuntime.jsxs("span",{style:k,children:[jsxRuntime.jsx(Bs,{rating:S,size:d.starSize,filledColor:h,emptyColor:b}),jsxRuntime.jsx("span",{style:{fontSize:d.ratingFontSize,fontWeight:700,color:m,fontVariantNumeric:"tabular-nums"},children:A}),o&&jsxRuntime.jsxs("span",{style:{fontSize:d.fontSize,color:f,fontWeight:400},children:["(",R(E,"response"),")"]})]})}function Ps(){let{client:e,disabled:t,defaultUser:o,debug:r,openModal:s,closeModal:a,activeModalId:l}=L();return {client:e,disabled:t,defaultUser:o,debug:r,submitFeedback:e.submitResponse.bind(e),openModal:s,closeModal:a,activeModalId:l}}function Ls(e){let{activeModalId:t,openModal:o,closeModal:r}=L(),s=react.useCallback(()=>o(e),[o,e]),a=react.useCallback(()=>r(),[r]);return {open:s,close:a,isOpen:t===e}}
173
- exports.Gotcha=Ts;exports.GotchaProvider=Pr;exports.GotchaScore=Fs;exports.createTheme=Cr;exports.useGotcha=Ps;exports.useGotchaTrigger=Ls;//# sourceMappingURL=index.js.map
147
+ `.trim()}function rt(e){if(typeof document>"u")return;let o=document.getElementById(uo);o||(o=document.createElement("style"),o.id=uo,document.head.appendChild(o)),o.textContent=Ur(e);}var fo=react.createContext(null),Wr={};function Yr({apiKey:e,children:o,baseUrl:t,debug:r=false,disabled:a=false,defaultUser:s,defaultUserEmail:i,themeConfig:n}){let[p,c]=react.useState(null);t&&!t.startsWith("https://")&&!t.startsWith("/")&&!t.includes("localhost")&&console.warn("[Gotcha] baseUrl should use HTTPS in production:",t);let l=react.useMemo(()=>ao({apiKey:e,baseUrl:t,debug:r}),[e,t,r]),d=react.useMemo(()=>s??Wr,[JSON.stringify(s)]);react.useEffect(()=>{let g=ue("light","light",n);rt(g);},[n]),react.useEffect(()=>(_t(),()=>Jt()),[]),react.useEffect(()=>{l.flushQueue();let g=()=>l.flushQueue();return window.addEventListener("online",g),()=>window.removeEventListener("online",g)},[l]);let u=react.useCallback(g=>{c(g);},[]),f=react.useCallback(()=>{c(null);},[]),b=react.useMemo(()=>({client:l,disabled:a,defaultUser:d,defaultUserEmail:i,debug:r,activeModalId:p,openModal:u,closeModal:f,themeConfig:n}),[l,a,d,i,r,p,u,f,n]);return jsxRuntime.jsx(fo.Provider,{value:b,children:o})}function G(){let e=react.useContext(fo);if(!e)throw new Error("useGotchaContext must be used within a GotchaProvider");return e}function jr(e,o){let t=new Date(e).getTime();if(isNaN(t))return true;let r=Date.now()-t,a=o*24*60*60*1e3;return r>=a}function go(e){let{client:o,defaultUser:t}=G(),[r,a]=react.useState(false),[s,i]=react.useState(false),[n,p]=react.useState(null),[c,l]=react.useState(null);return react.useEffect(()=>{process.env.NODE_ENV!=="production"&&e.cooldownDays&&!e.onePerUser&&console.warn("[Gotcha] cooldownDays has no effect without onePerUser=true");let u=e.user?.id||t?.id;if(!u||!e.onePerUser){l(null);return}let f=false;return (async()=>{i(true);try{let g=await o.checkExistingResponse(e.elementId,u);f||(g&&e.cooldownDays&&e.cooldownDays>0&&jr(g.createdAt,e.cooldownDays)?l(null):l(g));}catch{f||l(null);}finally{f||i(false);}})(),()=>{f=true;}},[o,e.elementId,e.user?.id,t?.id,e.onePerUser,e.cooldownDays]),{submit:react.useCallback(async u=>{a(true),p(null);try{let f=e.user?.id||t?.id,b;return e.onePerUser&&c&&f?b=await o.updateResponse(c.id,{content:u.content,title:u.title,rating:u.rating,vote:u.vote,pollSelected:u.pollSelected},f):b=await o.submitResponse({elementId:e.elementId,mode:e.mode,content:u.content,title:u.title,rating:u.rating,vote:u.vote,pollOptions:e.pollOptions,pollSelected:u.pollSelected,isBug:u.isBug,screenshot:u.screenshot,user:{...t,...e.user},userEmail:e.userEmail}),e.onePerUser&&l({id:b.id,mode:e.mode,content:u.content??null,title:u.title??null,rating:u.rating??null,vote:u.vote??null,pollSelected:u.pollSelected??null,createdAt:b.createdAt}),e.onSuccess?.(b),b}catch(f){let b=f instanceof Error?f.message:"Something went wrong";throw p(b),e.onError?.(f instanceof Error?f:new Error(b)),f}finally{a(false);}},[o,t,e,c]),isLoading:r,isCheckingExisting:s,error:n,existingResponse:c,isEditing:!!c,clearError:()=>p(null)}}function ho(e,o){return `${Z.HIDDEN_UNTIL}_${e}_${o}`}function mo(e,o,t){if(!t||t<=0)return false;let r=ho(e,o),a=ie(r);return a?new Date(a).getTime()>Date.now():false}function bo(e){let{elementId:o,userId:t,hideAfterSubmitDays:r}=e,a=react.useMemo(()=>t||et(),[t]),[s,i]=react.useState(()=>mo(o,a,r));react.useEffect(()=>{i(mo(o,a,r));},[o,a,r]);let n=react.useCallback(()=>{if(!r||r<=0)return;let p=ho(o,a),c=new Date(Date.now()+r*24*60*60*1e3);le(p,c.toISOString()),i(true);},[o,a,r]);return {isHidden:s,markHidden:n}}function _r(e){return `${Z.VISIT_COUNT}_${e}`}function wo(e){let{elementId:o,showAfterSeconds:t,showAfterScrollPercent:r,showAfterVisits:a}=e,s=t!=null||r!=null||a!=null,[i,n]=react.useState(!t),[p,c]=react.useState(!r),[l]=react.useState(()=>{if(!a)return true;let d=_r(o),f=parseInt(ie(d)||"0",10)+1;return le(d,String(f)),f>=a});return react.useEffect(()=>{if(!t||t<=0)return;let d=Date.now(),u=t*1e3,f=()=>{Date.now()-d>=u?n(true):b=setTimeout(f,Math.min(1e3,u-(Date.now()-d)));},b=setTimeout(f,Math.min(1e3,u));return ()=>clearTimeout(b)},[t]),react.useEffect(()=>{if(!r||r<=0)return;let d=()=>{let u=document.documentElement.scrollHeight,f=window.innerHeight;if(u<=f){c(true);return}(window.scrollY+f)/u*100>=r&&c(true);};if(d(),!p)return window.addEventListener("scroll",d,{passive:true}),()=>window.removeEventListener("scroll",d)},[r,p]),{conditionsMet:!s||i&&p&&l}}function st(...e){return e.filter(Boolean).join(" ")}var W=()=>typeof window>"u"?false:"ontouchstart"in window||navigator.maxTouchPoints>0,So=(e,o)=>{let t={sm:{desktop:24,mobile:28},md:{desktop:32,mobile:34},lg:{desktop:40,mobile:40}};return o?t[e].mobile:t[e].desktop};function en(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function vo({size:e,theme:o,customStyles:t,showOnHover:r,touchBehavior:a,onClick:s,isOpen:i,isParentHovered:n=false,animated:p=true,queuedCount:c=0}){let[l,d]=react.useState(false),[u,f]=react.useState(false),[b,g]=react.useState(en),[m,h]=react.useState(false),[w,y]=react.useState(false),[C,v]=react.useState(false),{themeConfig:E}=G();react.useEffect(()=>{if(d(W()),typeof window>"u")return;let j=window.matchMedia("(prefers-color-scheme: dark)"),ge=xe=>g(xe.matches?"dark":"light");return j.addEventListener("change",ge),()=>j.removeEventListener("change",ge)},[]);let k=i?true:!l&&r?n:l&&a==="tap-to-reveal"?u:true;react.useEffect(()=>{if(k&&!C){let j=setTimeout(()=>v(true),320);return ()=>clearTimeout(j)}},[k,C]);let P=()=>{if(l&&a==="tap-to-reveal"&&!u){f(true);return}s();},z=So(e,l),A=react.useMemo(()=>ue(o,b,E),[o,b,E]),F=i?A.colors.warning:A.colors.border,D=i?A.colors.warning:A.colors.glassColor,O=()=>k?w?"scale(0.97)":"scale(1)":"scale(0.96)",q=w?"80ms":"160ms",T=A.animation.easing.default,H=m&&!i?A.colors.surfaceHover:A.colors.glassBackground,Me={position:"relative",width:z,height:z,borderRadius:A.borders.radius.full,border:`1px solid ${F}`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",background:H,color:D,boxShadow:m?A.colors.glassHoverShadow:A.colors.glassShadow,transition:C?`transform ${q} ${T}, background-color 180ms ${T}, box-shadow 180ms ${T}, border-color 240ms ${T}, color 240ms ${T}`:`opacity 320ms ${T}, transform 320ms ${T}`,opacity:k?1:0,transform:O(),pointerEvents:k?"auto":"none",...t?.button};return jsxRuntime.jsxs("button",{type:"button",onClick:P,onMouseEnter:()=>h(true),onMouseLeave:()=>{h(false),y(false);},onMouseDown:()=>y(true),onMouseUp:()=>y(false),onTouchStart:()=>y(true),onTouchEnd:()=>y(false),style:Me,className:st("gotcha-button",i&&"gotcha-button--open"),"aria-label":"Give feedback on this feature","aria-expanded":i,"aria-haspopup":"dialog",children:[jsxRuntime.jsx(tn,{size:z*.62,color:D,fontFamilyDisplay:A.typography.fontFamilyDisplay,animated:p&&!C}),c>0&&jsxRuntime.jsx("span",{"aria-label":`${c} queued`,style:{position:"absolute",top:-2,right:-2,width:8,height:8,borderRadius:"50%",backgroundColor:A.colors.warning,border:`1.5px solid ${A.colors.background}`}})]})}function tn({size:e,color:o,fontFamilyDisplay:t,animated:r}){let[a,s]=react.useState(false);return react.useEffect(()=>{s(true);},[]),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{fontFamily:t,fontWeight:400,fontSize:e,fontStyle:"normal",lineHeight:1,color:o,transform:"translateY(1px) translateZ(0)",willChange:"transform",letterSpacing:"normal",userSelect:"none",display:"inline-block",opacity:r?a?1:0:1,transition:r?"opacity 240ms cubic-bezier(0.22, 0.61, 0.36, 1) 120ms":"none"},children:"G"})}function Eo({src:e,onRemove:o,resolvedTheme:t}){let[r,a]=react.useState(false),[s,i]=react.useState(false);react.useEffect(()=>{a(W());},[]);let n=(()=>{if(!e.startsWith("data:"))return null;let p=e.indexOf(",");if(p<0)return null;let c=e.slice(p+1);return Math.round(c.length*3/4/1024)})();return jsxRuntime.jsxs("div",{style:{marginTop:12},children:[jsxRuntime.jsxs("div",{style:{position:"relative",borderRadius:t.borders.radius.sm,overflow:"hidden",border:`1px solid ${t.colors.border}`,padding:4,background:t.colors.background},children:[jsxRuntime.jsx("img",{src:e,alt:"Screenshot attached to the feedback",style:{display:"block",width:"100%",maxHeight:140,objectFit:"cover",borderRadius:Math.max(0,t.borders.radius.sm-2)}}),jsxRuntime.jsx("button",{type:"button",onClick:o,onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),"aria-label":"Remove screenshot",style:{position:"absolute",top:8,right:8,width:r?32:24,height:r?32:24,borderRadius:"50%",border:`1px solid ${s?t.colors.error:t.colors.border}`,backgroundColor:s?t.colors.error:t.colors.background,color:s?t.colors.primaryText:t.colors.textSecondary,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:`all ${t.animation.duration.fast} ${t.animation.easing.default}`},children:jsxRuntime.jsx("svg",{width:10,height:10,viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M1 1L13 13M1 13L13 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("p",{style:{margin:"6px 0 0",fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:t.colors.textSecondary},children:["screenshot.png",n!=null?` \xB7 ${n} KB`:""]})]})}function _o({resolvedTheme:e,placeholder:o,submitText:t,isLoading:r,onSubmit:a,customStyles:s,initialValues:i,isEditing:n=false,showText:p=true,showRating:c=true,enableBugFlag:l=false,bugFlagLabel:d,enableScreenshot:u=false}){let[f,b]=react.useState(i?.content||""),[g,m]=react.useState(i?.rating??null),[h,w]=react.useState(false),[y,C]=react.useState(false),[v,E]=react.useState(null),[k,P]=react.useState(false),[z,A]=react.useState(false);react.useEffect(()=>{C(W());},[]),react.useEffect(()=>{i?.content!==void 0&&b(i.content||""),i?.rating!==void 0&&m(i.rating??null);},[i?.content,i?.rating]);let F=p&&c?f.trim().length>0||g!==null:p?f.trim().length>0:c?g!==null:false,D=async()=>{P(true),A(false);try{let{captureScreenshot:T}=await Promise.resolve().then(()=>(Zo(),Ko)),H=await T();H?E(H):A(!0);}catch{A(true);}finally{P(false);}},O=T=>{T.preventDefault(),!(!F||r)&&a({content:p&&f.trim()?f.trim():void 0,rating:c&&g!==null?g:void 0,isBug:h||void 0,screenshot:v||void 0});},q={width:"100%",padding:y?"12px 0":"10px 0",border:"none",borderBottom:`1px solid ${e.colors.inputBorder}`,borderRadius:0,backgroundColor:"transparent",color:e.colors.text,fontSize:y?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:y?96:80,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.55,...s?.input};return jsxRuntime.jsxs("form",{onSubmit:O,children:[c&&jsxRuntime.jsx("div",{style:{marginBottom:p?y?18:16:0,...p?{}:{display:"flex",justifyContent:"center",padding:"6px 0"}},children:jsxRuntime.jsx(Cs,{value:g,onChange:m,theme:e,isTouch:y,large:!p})}),p&&jsxRuntime.jsx("textarea",{value:f,onChange:T=>b(T.target.value),placeholder:o||"Share your thoughts\u2026",maxLength:5e3,style:q,disabled:r,"aria-label":"Your feedback",onFocus:T=>{T.currentTarget.style.borderBottomColor=e.colors.inputBorderFocus;},onBlur:T=>{T.currentTarget.style.borderBottomColor=e.colors.inputBorder;}}),l&&jsxRuntime.jsxs("button",{type:"button",role:"switch","aria-checked":h,onClick:()=>w(!h),style:{display:"flex",alignItems:"center",gap:10,width:"100%",marginTop:16,padding:y?"12px 12px":"10px 12px",border:`1px solid ${h?e.colors.warningBorder:e.colors.border}`,borderRadius:e.borders.radius.sm,backgroundColor:h?e.colors.warningSurface:"transparent",cursor:"pointer",transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`,fontFamily:e.typography.fontFamily,...s?.bugFlag},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:{width:14,height:14,borderRadius:3,border:`1px solid ${h?e.colors.warningActive:e.colors.border}`,backgroundColor:h?e.colors.warning:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`},children:h&&jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M2 5L4 7L8 3",stroke:e.colors.primaryText,strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("span",{style:{fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.normal,color:h?e.colors.text:e.colors.textSecondary,letterSpacing:"0",textAlign:"left",flex:1},children:h?"Reported as an issue":d||"Report an issue"})]}),l&&u&&h&&!v&&jsxRuntime.jsxs("button",{type:"button",onClick:D,disabled:k,style:{display:"flex",alignItems:"center",gap:8,width:"100%",marginTop:8,padding:"9px 12px",border:`1px solid ${e.colors.border}`,borderRadius:e.borders.radius.sm,backgroundColor:"transparent",cursor:k?"progress":"pointer",fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize.xs,letterSpacing:"0.06em",textTransform:"uppercase",color:e.colors.textSecondary,transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`},onMouseEnter:T=>{T.currentTarget.style.borderColor=e.colors.inputBorderFocus,T.currentTarget.style.color=e.colors.text;},onMouseLeave:T=>{T.currentTarget.style.borderColor=e.colors.border,T.currentTarget.style.color=e.colors.textSecondary;},children:[jsxRuntime.jsxs("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"10",r:"3"}),jsxRuntime.jsx("path",{d:"M2 17l4-4 3 3 4-4 9 9"})]}),k?"Capturing\u2026":"Attach screenshot"]}),z&&jsxRuntime.jsxs("div",{role:"alert",style:{marginTop:8,padding:"6px 0 6px 10px",borderLeft:`2px solid ${e.colors.error}`,fontSize:e.typography.fontSize.xs,color:e.colors.text,fontFamily:e.typography.fontFamily,display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[jsxRuntime.jsx("span",{children:"Screenshot capture unavailable."}),jsxRuntime.jsx("button",{type:"button",onClick:D,style:{background:"none",border:"none",padding:0,color:e.colors.text,fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize.xs,textDecoration:"underline",textDecorationColor:e.colors.border,textUnderlineOffset:3,cursor:"pointer"},children:"Try again"})]}),l&&u&&h&&v&&jsxRuntime.jsx(Eo,{src:v,onRemove:()=>E(null),resolvedTheme:e}),jsxRuntime.jsx("button",{type:"submit",disabled:r||!F,style:{width:"100%",padding:y?"14px 16px":"11px 16px",marginTop:18,border:"none",borderRadius:e.borders.radius.sm,backgroundColor:F?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:F?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:r||!F?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,fontStyle:r?"italic":"normal",...s?.submitButton},onMouseEnter:T=>{T.currentTarget.disabled||(T.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:T=>{T.currentTarget.disabled||(T.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:r?n?"Updating\u2026":"Sending\u2026":n?"Update":t})]})}function Cs({value:e,onChange:o,theme:t,isTouch:r,large:a=false}){let[s,i]=react.useState(null),n=a?r?34:28:r?26:20,p=a?8:6,c=a?r?6:4:r?6:2,l=d=>s!==null&&s>=d?`${(d-1)*30}ms`:"0ms";return jsxRuntime.jsx("div",{style:{display:"flex",gap:p},role:"group","aria-label":"Rating",onMouseLeave:()=>i(null),children:[1,2,3,4,5].map(d=>{let u=(s??e??0)>=d;return jsxRuntime.jsx("button",{type:"button",onClick:()=>o(d),onMouseEnter:()=>i(d),"aria-label":`Rate ${d} out of 5`,"aria-pressed":e===d,style:{background:"none",border:"none",cursor:"pointer",padding:c,color:u?t.colors.starFilled:t.colors.starEmpty,transition:`color 180ms ${t.animation.easing.default}`,transitionDelay:l(d),outline:"none",WebkitTapHighlightColor:"transparent"},children:jsxRuntime.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:u?"currentColor":"none",stroke:"currentColor",strokeWidth:u?0:1.5,strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M12 3.5L14.472 8.506L20 9.308L16 13.205L16.944 18.706L12 16.107L7.056 18.706L8 13.205L4 9.308L9.528 8.506L12 3.5Z"})})},d)})})}function Jo({resolvedTheme:e,isLoading:o,onSubmit:t,initialVote:r,isEditing:a=false,labels:s}){let[i,n]=react.useState(false),[p,c]=react.useState(r||null),[l,d]=react.useState(r||null);react.useEffect(()=>{n(W());},[]),react.useEffect(()=>{r!==void 0&&(d(r),c(r));},[r]),react.useEffect(()=>{!o&&!a&&c(null);},[o,a]);let u=m=>{c(m),t({vote:m});},f=i?24:20,b=m=>{let h=l===m,w=m==="up"?e.colors.voteUp:e.colors.voteDown,y=m==="up"?e.colors.voteUpSurface:e.colors.voteDownSurface,C=m==="up"?e.colors.voteUpBorder:e.colors.voteDownBorder;return {flex:1,minWidth:0,padding:i?"14px 18px":"11px 16px",border:`1px solid ${h?w:C}`,borderRadius:e.borders.radius.full,background:h?w:y,color:h?e.colors.primaryText:e.colors.text,fontSize:i?15:13,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:o?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}, border-color ${e.animation.duration.fast} ${e.animation.easing.default}, color ${e.animation.duration.fast} ${e.animation.easing.default}`,display:"flex",alignItems:"center",justifyContent:"center",gap:i?10:8,outline:"none"}},g=(m,h)=>s?.[m]?s[m]:m==="up"?h?"Liked":"Like":h?"Disliked":"Dislike";return jsxRuntime.jsx("div",{style:{display:"flex",gap:i?12:10},role:"group","aria-label":"Vote",children:["up","down"].map(m=>{let h=l===m,w=o&&p===m,y=g(m,h),C=w?`${y}, submitting`:y,v=m==="up"?e.colors.voteUpBorder:e.colors.voteDownBorder;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>u(m),disabled:o,style:b(m),"aria-label":C,"aria-pressed":h,onMouseEnter:E=>{o||h||(E.currentTarget.style.borderColor=e.colors.inputBorderFocus);},onMouseLeave:E=>{h||(E.currentTarget.style.borderColor=v);},children:[m==="up"?jsxRuntime.jsx(ks,{size:f}):jsxRuntime.jsx(As,{size:f}),jsxRuntime.jsx("span",{style:{fontStyle:w?"italic":"normal"},children:w?a?"Updating\u2026":"Sending\u2026":y})]},m)})})}function ks({size:e=20}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"})})}function As({size:e=20}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"})})}function tr({resolvedTheme:e,options:o,allowMultiple:t,isLoading:r,onSubmit:a,initialSelected:s,isEditing:i=false}){let[n,p]=react.useState(s||[]),[c,l]=react.useState(false),[d,u]=react.useState(null);react.useEffect(()=>{l(W());},[]),react.useEffect(()=>{s&&p(s);},[s]);let f=m=>{r||p(t?h=>h.includes(m)?h.filter(w=>w!==m):[...h,m]:h=>h.includes(m)?[]:[m]);},b=()=>{n.length===0||r||a({pollSelected:n});},g=c?"14px 14px":"12px 14px";return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("ul",{role:"group","aria-label":t?"Select one or more options":"Select an option",style:{listStyle:"none",margin:0,padding:0,borderTop:`1px solid ${e.colors.border}`},children:o.map((m,h)=>{let w=n.includes(m),y=d===h;return jsxRuntime.jsxs("li",{style:{borderBottom:`1px solid ${e.colors.border}`,position:"relative",animation:`gotcha-fade-up ${e.animation.duration.normal} ${e.animation.easing.default} both`,animationDelay:`${h*.04}s`},children:[w&&jsxRuntime.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:8,bottom:8,width:2,backgroundColor:e.colors.pollSelectedBorder}}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>f(m),onMouseEnter:()=>u(h),onMouseLeave:()=>u(null),disabled:r,"aria-pressed":w,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:g,paddingLeft:w?16:14,border:"none",background:y&&!w?e.colors.surfaceHover:"transparent",color:e.colors.text,fontSize:c?15:e.typography.fontSize.md,fontWeight:w?e.typography.fontWeight.medium:e.typography.fontWeight.normal,fontFamily:e.typography.fontFamily,cursor:r?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,textAlign:"left",letterSpacing:"0",outline:"none"},children:[jsxRuntime.jsx("span",{style:{flex:1},children:m}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{width:14,height:14,borderRadius:t?3:"50%",border:`1px solid ${w?e.colors.pollCheckSelectedBorder:e.colors.pollCheckBorder}`,backgroundColor:w?e.colors.pollCheckSelectedBg:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:`all ${e.animation.duration.fast} ${e.animation.easing.default}`},children:w&&jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 10 10",fill:"none",children:jsxRuntime.jsx("path",{d:"M2 5L4 7L8 3",stroke:e.colors.primaryText,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},m)})}),jsxRuntime.jsx("button",{type:"button",onClick:b,disabled:r||n.length===0,style:{width:"100%",marginTop:18,padding:c?"14px 16px":"11px 16px",border:"none",borderRadius:e.borders.radius.sm,backgroundColor:n.length===0?e.colors.buttonBackgroundDisabled:e.colors.buttonBackground,color:n.length===0?e.colors.buttonColorDisabled:e.colors.buttonColor,fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:r||n.length===0?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,fontStyle:r?"italic":"normal"},onMouseEnter:m=>{m.currentTarget.disabled||(m.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:m=>{m.currentTarget.disabled||(m.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:r?i?"Updating\u2026":"Sending\u2026":i?"Update":"Submit"})]})}function rr({size:e=16,color:o="currentColor"}){let r=2*Math.PI*9,a=r*.25;return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading",style:{animation:"gotcha-spin 1.1s linear infinite",transformOrigin:"center"},children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:9,stroke:o,strokeOpacity:"0.18",strokeWidth:"1.25",fill:"none"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:9,stroke:o,strokeWidth:"1.25",strokeLinecap:"round",fill:"none",strokeDasharray:`${a} ${r}`,strokeDashoffset:"0"})]})}function sr({resolvedTheme:e,submitText:o,isLoading:t,onSubmit:r,customStyles:a,showFollowUp:s=true,followUpPlaceholder:i,lowLabel:n="Not likely",highLabel:p="Very likely",initialValues:c,isEditing:l=false}){let[d,u]=react.useState(c?.rating??null),[f,b]=react.useState(c?.content||""),[g,m]=react.useState(false),[h,w]=react.useState(null);react.useEffect(()=>{m(W());},[]),react.useEffect(()=>{c?.rating!==void 0&&u(c.rating??null),c?.content!==void 0&&b(c.content||"");},[c?.rating,c?.content]);let y=d!==null;return jsxRuntime.jsxs("form",{onSubmit:v=>{v.preventDefault(),!(!y||t)&&r({rating:d??void 0,content:s&&f.trim()?f.trim():void 0});},children:[jsxRuntime.jsx("div",{style:{position:"relative",display:"flex",gap:g?4:5,justifyContent:"center"},role:"group","aria-label":"NPS Score",onMouseLeave:()=>w(null),children:Array.from({length:11},(v,E)=>{let k=d===E,P=h===E;return jsxRuntime.jsx("button",{type:"button",onClick:()=>u(E),onMouseEnter:()=>w(E),"aria-label":`Score ${E} out of 10`,"aria-pressed":k,style:{flex:1,minWidth:0,aspectRatio:"1",borderRadius:e.borders.radius.sm,border:`1px solid ${k?e.colors.buttonBackground:P?e.colors.inputBorderFocus:e.colors.border}`,backgroundColor:k?e.colors.buttonBackground:"transparent",color:k?e.colors.buttonColor:e.colors.text,fontSize:15,fontWeight:k?e.typography.fontWeight.medium:e.typography.fontWeight.normal,fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontVariantNumeric:"tabular-nums",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}, border-color ${e.animation.duration.fast} ${e.animation.easing.default}, color ${e.animation.duration.fast} ${e.animation.easing.default}`,outline:"none",...a?.npsButton,...k?a?.npsButtonSelected:{}},children:E},E)})}),jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:12,padding:"0 2px",...a?.npsLabels},children:[n,p].map(v=>jsxRuntime.jsx("span",{style:{fontFamily:e.typography.fontFamily,fontSize:11,color:e.colors.text,fontWeight:e.typography.fontWeight.medium,letterSpacing:"0.14em",textTransform:"uppercase"},children:v},v))}),s&&d!==null&&jsxRuntime.jsx("textarea",{value:f,onChange:v=>b(v.target.value),placeholder:i||"What's the main reason for your score?",maxLength:5e3,style:{width:"100%",padding:g?"12px 0":"10px 0",marginTop:18,border:"none",borderBottom:`1px solid ${e.colors.inputBorder}`,borderRadius:0,backgroundColor:"transparent",color:e.colors.text,fontSize:g?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:g?72:56,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.55,animation:`gotcha-expand-in ${e.animation.duration.normal} ${e.animation.easing.default} both`,overflow:"hidden",...a?.input},disabled:t,"aria-label":"Follow-up feedback",onFocus:v=>{v.currentTarget.style.borderBottomColor=e.colors.inputBorderFocus;},onBlur:v=>{v.currentTarget.style.borderBottomColor=e.colors.inputBorder;}}),jsxRuntime.jsx("button",{type:"submit",disabled:t||!y,style:{width:"100%",marginTop:18,padding:g?"14px 16px":"11px 16px",border:"none",borderRadius:e.borders.radius.sm,backgroundColor:y?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:y?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:t||!y?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,fontStyle:t?"italic":"normal",...a?.submitButton},onMouseEnter:v=>{v.currentTarget.disabled||(v.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:v=>{v.currentTarget.disabled||(v.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:t?l?"Updating\u2026":"Sending\u2026":l?"Update":o})]})}function ir({resolvedTheme:e,promptText:o,placeholder:t,isLoading:r,onSubmit:a}){let[s,i]=react.useState(""),[n,p]=react.useState(false);return react.useEffect(()=>{p(W());},[]),jsxRuntime.jsxs("form",{onSubmit:l=>{l.preventDefault(),!(!s.trim()||r)&&a(s.trim());},children:[jsxRuntime.jsx("p",{style:{margin:"0 0 14px 0",fontFamily:e.typography.fontFamilyDisplay,fontSize:n?17:16,fontStyle:"italic",color:e.colors.text,lineHeight:1.45,letterSpacing:"-0.01em"},children:o}),jsxRuntime.jsx("textarea",{value:s,onChange:l=>i(l.target.value),placeholder:t||"Tell us more\u2026",maxLength:5e3,disabled:r,"aria-label":"Follow-up feedback",style:{width:"100%",padding:n?"12px 0":"10px 0",border:"none",borderBottom:`1px solid ${e.colors.inputBorder}`,borderRadius:0,backgroundColor:"transparent",color:e.colors.text,fontSize:n?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:n?96:72,fontFamily:e.typography.fontFamily,outline:"none",transition:`border-color ${e.animation.duration.fast} ${e.animation.easing.default}`,lineHeight:1.55},onFocus:l=>{l.currentTarget.style.borderBottomColor=e.colors.inputBorderFocus;},onBlur:l=>{l.currentTarget.style.borderBottomColor=e.colors.inputBorder;}}),jsxRuntime.jsx("button",{type:"submit",disabled:r||!s.trim(),style:{width:"100%",marginTop:16,padding:n?"14px 16px":"11px 16px",border:"none",borderRadius:e.borders.radius.sm,backgroundColor:s.trim()?e.colors.buttonBackground:e.colors.buttonBackgroundDisabled,color:s.trim()?e.colors.buttonColor:e.colors.buttonColorDisabled,fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.medium,fontFamily:e.typography.fontFamily,cursor:r||!s.trim()?"not-allowed":"pointer",transition:`background-color ${e.animation.duration.fast} ${e.animation.easing.default}`,fontStyle:r?"italic":"normal"},onMouseEnter:l=>{l.currentTarget.disabled||(l.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:l=>{l.currentTarget.disabled||(l.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:r?"Sending\u2026":"Submit"})]})}var Ls={feedback:"Feedback",vote:"Vote",poll:"Poll",nps:"Rate"};function Ps(e,o){switch(e){case "vote":return "What do you think?";case "poll":return "Cast your vote.";case "nps":return o||"How likely are you to recommend us?";default:return "What do you think of this feature?"}}var Ns=4e3;function cr({mode:e,theme:o,customStyles:t,promptText:r,placeholder:a,submitText:s,thankYouMessage:i,isLoading:n,isCheckingExisting:p=false,isSubmitted:c,phase:l="form",followUpConfig:d,followUpLoading:u=false,onFollowUpSubmit:f,error:b,existingResponse:g,isEditing:m=false,showText:h=true,showRating:w=true,voteLabels:y,options:C,allowMultiple:v=false,npsQuestion:E,npsFollowUp:k=true,npsFollowUpPlaceholder:P,npsLowLabel:z,npsHighLabel:A,enableBugFlag:F=false,bugFlagLabel:D,enableScreenshot:O=false,onSubmit:q,onClose:T,anchorRect:H,useFixedPosition:Me=false,isMobile:j}){let ge=react.useRef(null),xe=react.useRef(null),Ie=react.useRef(T);Ie.current=T;let[Ve,gt]=react.useState(false),U=j??Ve,[je,Qe]=react.useState("light"),{themeConfig:_}=G();react.useEffect(()=>{if(typeof window>"u")return;let I=window.matchMedia("(prefers-color-scheme: dark)"),Q=N=>Qe(N.matches?"dark":"light");Q(I);let Y=N=>Q(N);I.addEventListener("change",Y);let K=[()=>I.removeEventListener("change",Y)];if(j===void 0){let N=window.matchMedia("(max-width: 1023px)"),re=()=>gt(N.matches);re(),N.addEventListener("change",re),K.push(()=>N.removeEventListener("change",re));}return ()=>{for(let N of K)N();}},[j]);let S=react.useMemo(()=>ue(o,je,_),[o,je,_]);react.useEffect(()=>{rt(S);},[S]);let Le=typeof window>"u"||!H?false:window.innerHeight-H.bottom<340;react.useEffect(()=>{let I=ge.current;if(!I)return;xe.current?.focus();let Q=Y=>{if(Y.key==="Escape"){Ie.current();return}if(Y.key==="Tab"){let K=I.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),N=K[0],re=K[K.length-1];Y.shiftKey&&document.activeElement===N?(Y.preventDefault(),re?.focus()):!Y.shiftKey&&document.activeElement===re&&(Y.preventDefault(),N?.focus());}};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[]);let me=r||Ps(e,E),Ke=Ls[e],he=e==="nps"?420:e==="poll"?400:360,Ze=U?"gotcha-modal-enter-center":Le?"gotcha-modal-enter-above":"gotcha-modal-enter",Pe=typeof window<"u"?window.innerHeight:0,V={padding:0,borderRadius:S.borders.radius.lg,background:S.colors.background,color:S.colors.text,boxShadow:S.shadows.modal,border:`${S.borders.width}px solid ${S.colors.border}`,fontFamily:S.typography.fontFamily,textAlign:"left",overflow:"hidden"},Ne=U?{...V,position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100vw - 32px)",maxWidth:he,zIndex:9999,...t?.modal}:Me&&H&&Pe?(()=>{let I=window.innerWidth,Q=24,K=H.left+H.width/2-he/2,N=Math.max(Q,Math.min(K,I-he-Q));return {...V,position:"fixed",left:N,width:he,zIndex:99999,...Le?{bottom:Pe-H.top+10}:{top:H.bottom+10},...t?.modal}})():{...V,position:"absolute",left:"50%",width:he,zIndex:9999,...Le?{bottom:"100%",marginBottom:10,transform:"translateX(-50%)"}:{top:"100%",marginTop:10,transform:"translateX(-50%)"},...t?.modal},oe=I=>U?{}:{animation:`gotcha-fade-up ${S.animation.duration.normal} ${S.animation.easing.default} both`,animationDelay:`${I*.04}s`},mt=U?"20px 24px 24px":"20px 28px 24px";return jsxRuntime.jsxs("div",{ref:ge,role:"dialog","aria-modal":"true","aria-label":c?"Feedback submitted":void 0,"aria-labelledby":c?void 0:"gotcha-modal-title","data-gotcha":true,style:Ne,className:st("gotcha-modal","gotcha-root",Ze),children:[!c&&jsxRuntime.jsxs("header",{style:{padding:U?"20px 24px 16px":"22px 28px 16px",borderBottom:`${S.borders.width}px solid ${S.colors.border}`,position:"relative"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10,...oe(0)},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:{display:"inline-block",width:16,height:1,backgroundColor:S.colors.warning}}),jsxRuntime.jsx("span",{style:{fontFamily:S.typography.fontFamily,fontSize:10,fontWeight:S.typography.fontWeight.medium,letterSpacing:"0.16em",textTransform:"uppercase",color:S.colors.textSecondary},children:Ke})]}),jsxRuntime.jsx("h2",{id:"gotcha-modal-title",style:{margin:0,paddingRight:U?52:44,fontFamily:S.typography.fontFamilyDisplay,fontSize:U?22:20,fontWeight:S.typography.fontWeight.normal,letterSpacing:"-0.01em",lineHeight:1.25,color:S.colors.text,...oe(1),...t?.title},children:me}),jsxRuntime.jsx("button",{ref:xe,type:"button",onClick:T,"aria-label":"Close feedback form",style:{position:"absolute",top:U?14:16,right:U?14:18,width:U?44:32,height:U?44:32,border:"none",background:"transparent",outline:"none",cursor:"pointer",color:S.colors.closeButton,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:S.borders.radius.sm,transition:`color ${S.animation.duration.fast} ${S.animation.easing.default}`,...t?.closeButton},onMouseEnter:I=>{I.currentTarget.style.color=S.colors.closeButtonHover;},onMouseLeave:I=>{I.currentTarget.style.color=S.colors.closeButton;},children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 1L11 11M1 11L11 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("div",{style:{padding:c?0:mt,position:"relative"},children:[b&&!c&&jsxRuntime.jsxs("div",{role:"alert",style:{padding:"2px 0 2px 14px",marginBottom:16,borderLeft:`2px solid ${S.colors.error}`,color:S.colors.text,fontSize:S.typography.fontSize.sm,lineHeight:1.55,...oe(2),...t?.errorMessage},children:[b,jsxRuntime.jsx("span",{style:{color:S.colors.textSecondary},children:" \u2014 try again?"})]}),c&&jsxRuntime.jsxs("div",{style:{padding:U?"32px 24px 28px":"36px 28px 28px",textAlign:"center",position:"relative"},children:[jsxRuntime.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",style:{display:"block",margin:"0 auto 14px",...t?.successIcon},children:jsxRuntime.jsx("path",{d:"M10 20.5L17 27.5L31 13.5",stroke:S.colors.success,strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",style:{strokeDasharray:30,strokeDashoffset:30,animation:`gotcha-check-draw 320ms ${S.animation.easing.default} forwards`}})}),jsxRuntime.jsx("p",{style:{margin:0,fontFamily:S.typography.fontFamilyDisplay,fontSize:22,fontWeight:S.typography.fontWeight.normal,letterSpacing:"-0.01em",color:S.colors.text,...t?.successMessage},children:i}),jsxRuntime.jsx("p",{style:{margin:"8px 0 0",fontFamily:S.typography.fontFamily,fontSize:S.typography.fontSize.sm,color:S.colors.textSecondary,fontStyle:"italic"},children:"We\u2019ll close this in a moment."}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:1,right:1,bottom:1,height:1,backgroundColor:S.colors.success,transformOrigin:"left center",animation:`gotcha-progress ${Ns}ms linear forwards`}})]}),l==="followUp"&&d&&f&&!c&&jsxRuntime.jsx("div",{style:oe(2),children:jsxRuntime.jsx(ir,{resolvedTheme:S,promptText:d.promptText,placeholder:d.placeholder,isLoading:u,onSubmit:f})}),l==="form"&&p&&jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"24px 0",...oe(2)},children:jsxRuntime.jsx(rr,{size:20,color:S.colors.textSecondary})}),l==="form"&&!p&&!c&&jsxRuntime.jsxs("div",{style:oe(2),children:[e==="feedback"&&jsxRuntime.jsx(_o,{resolvedTheme:S,placeholder:a,submitText:s,isLoading:n,onSubmit:q,customStyles:t,initialValues:g?{content:g.content,rating:g.rating}:void 0,isEditing:m,showText:h,showRating:w,enableBugFlag:F,bugFlagLabel:D,enableScreenshot:O}),e==="vote"&&jsxRuntime.jsx(Jo,{resolvedTheme:S,isLoading:n,onSubmit:q,initialVote:g?.vote||void 0,isEditing:m,labels:y}),e==="nps"&&jsxRuntime.jsx(sr,{resolvedTheme:S,submitText:s,isLoading:n,onSubmit:q,showFollowUp:k,followUpPlaceholder:P,lowLabel:z,highLabel:A,customStyles:t,initialValues:g?{rating:g.rating,content:g.content}:void 0,isEditing:m}),e==="poll"&&C&&C.length>0&&jsxRuntime.jsx(tr,{resolvedTheme:S,options:C,allowMultiple:v,isLoading:n,onSubmit:q,initialSelected:g?.pollSelected||void 0,isEditing:m})]})]}),jsxRuntime.jsx("div",{"aria-live":"polite",className:"sr-only",style:{position:"absolute",left:-9999},children:c?"Thank you. Your feedback has been submitted.":b?`Error: ${b}`:""})]})}function Gs({elementId:e,user:o,userEmail:t,mode:r="feedback",showText:a=true,showRating:s=true,voteLabels:i,options:n,allowMultiple:p=false,npsQuestion:c,npsFollowUp:l=true,npsFollowUpPlaceholder:d,npsLowLabel:u,npsHighLabel:f,enableBugFlag:b=false,bugFlagLabel:g,enableScreenshot:m=false,onePerUser:h=false,cooldownDays:w,hideAfterSubmitDays:y,showAfterSeconds:C,showAfterScrollPercent:v,showAfterVisits:E,followUp:k,animated:P=true,position:z=ae.POSITION,size:A=ae.SIZE,theme:F=ae.THEME,customStyles:D,visible:O=true,showOnHover:q=ae.SHOW_ON_HOVER,touchBehavior:T=ae.TOUCH_BEHAVIOR,promptText:H,placeholder:Me,submitText:j=ae.SUBMIT_TEXT,thankYouMessage:ge=ae.THANK_YOU_MESSAGE,onSubmit:xe,onOpen:Ie,onClose:Ve,onError:gt}){let{disabled:U,activeModalId:je,openModal:Qe,closeModal:_,defaultUser:S,defaultUserEmail:Le,client:me,debug:Ke}=G(),{conditionsMet:Wt}=wo({elementId:e,showAfterSeconds:C,showAfterScrollPercent:v,showAfterVisits:E}),{isHidden:he,markHidden:Ze}=bo({elementId:e,userId:o?.id||S?.id,hideAfterSubmitDays:y}),[Pe,V]=react.useState("form"),[Ne,oe]=react.useState(null),[mt,I]=react.useState(false),[Q,Y]=react.useState(0),[K,N]=react.useState(false),[re,Yt]=react.useState(null),[X,fr]=react.useState(false),[qt,gr]=react.useState(false),Ee=react.useRef(null),Ge=react.useRef(),mr=react.useRef(null),Ue=react.useRef(null),[be,$e]=react.useState(null);react.useEffect(()=>{if(gr(true),typeof window>"u")return;let x=window.matchMedia("(max-width: 1023px)"),M=()=>fr(x.matches);return M(),x.addEventListener("change",M),()=>{x.removeEventListener("change",M),clearTimeout(Ge.current);}},[]),react.useEffect(()=>{Y(me.getQueueLength());let x=()=>{setTimeout(()=>Y(me.getQueueLength()),2e3);};return window.addEventListener("online",x),()=>window.removeEventListener("online",x)},[me]);let ne=je===e;react.useEffect(()=>{if(!ne||X)return;let x=0,M=()=>{x||(x=requestAnimationFrame(()=>{x=0;let se=Ee.current;if(!se)return;let Te=se.querySelector("button");Yt((Te??se).getBoundingClientRect());}));};return window.addEventListener("resize",M),window.addEventListener("scroll",M,{passive:true}),()=>{x&&cancelAnimationFrame(x),window.removeEventListener("resize",M),window.removeEventListener("scroll",M);}},[ne,X]),react.useEffect(()=>{ne||(V("form"),clearTimeout(Ge.current));},[ne]),react.useEffect(()=>{if(!ne||!X)return;let x=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=x;}},[ne,X]),react.useEffect(()=>{if(!q)return;let x=Ee.current;if(!x)return;let M=x.parentElement;if(!M)return;let se=()=>N(true),Te=()=>N(false);return M.addEventListener("mouseenter",se),M.addEventListener("mouseleave",Te),()=>{M.removeEventListener("mouseenter",se),M.removeEventListener("mouseleave",Te);}},[q]);let{submit:_e,isLoading:hr,isCheckingExisting:br,error:yr,existingResponse:wr,isEditing:Xt}=go({elementId:e,mode:r,pollOptions:n,user:o,userEmail:t??Le,onePerUser:h,cooldownDays:w,onSuccess:x=>{oe(x.id),xe?.(x),$e(null),Ue.current=null;},onError:x=>{console.warn("[Gotcha] Submission failed:",x instanceof Error?x.message:x),gt?.(x),Ue.current&&$e({message:x instanceof Error?x.message:"Something went wrong",retrying:false});}}),Sr=react.useCallback(()=>{if(Ee.current){let x=Ee.current.querySelector("button");Yt((x??Ee.current).getBoundingClientRect());}Qe(e),Ie?.();},[e,Qe,Ie]),Vt=react.useCallback(()=>{clearTimeout(Ge.current),_(),V("form"),Ve?.();},[_,Ve]),vr=react.useCallback(x=>{mr.current={rating:x.rating,vote:x.vote},Ue.current=x,k&&(k.ratingThreshold!=null&&x.rating!=null&&x.rating<=k.ratingThreshold||k.onNegativeVote&&x.vote==="down")&&r!=="poll"?V("followUp"):(V("success"),Ge.current=setTimeout(()=>{_(),V("form");},4e3)),y&&Ze();let se=typeof performance<"u"?performance.now():Date.now();_e(x).catch(()=>{}).finally(()=>{if(Ke){let Te=(typeof performance<"u"?performance.now():Date.now())-se;console.log(`[Gotcha] Server ack in ${Te.toFixed(0)}ms`);}});},[_e,k,r,y,Ze,_,Ke]),xr=react.useCallback(()=>{let x=Ue.current;!x||!be||be.retrying||($e({...be,retrying:true}),_e(x).catch(()=>{}));},[be,_e]),Er=react.useCallback(()=>{$e(null),Ue.current=null;},[]),Tr=react.useCallback(async x=>{if(Ne){I(true);try{await me.updateResponse(Ne,{content:x});}catch(M){console.warn("[Gotcha] Follow-up submission failed:",M instanceof Error?M.message:M);}finally{I(false),V("success"),Ge.current=setTimeout(()=>{_(),V("form");},4e3);}}},[Ne,_,me]),Cr=h&&Xt?"Update":j;if(U||!O||he||!Wt)return null;let kr={"top-right":{position:"absolute",top:0,right:0,transform:"translate(50%, -50%)"},"top-left":{position:"absolute",top:0,left:0,transform:"translate(-50%, -50%)"},"bottom-right":{position:"absolute",bottom:0,right:0,transform:"translate(50%, 50%)"},"bottom-left":{position:"absolute",bottom:0,left:0,transform:"translate(-50%, 50%)"},inline:{position:"relative",display:"inline-flex"}},Ar={mode:r,theme:F,customStyles:D,promptText:H,placeholder:Me,submitText:Cr,thankYouMessage:ge,isLoading:hr,isCheckingExisting:h&&br,isSubmitted:Pe==="success",phase:Pe,followUpConfig:k,followUpLoading:mt,onFollowUpSubmit:Tr,error:yr,existingResponse:h?wr:null,isEditing:h&&Xt,showText:a,showRating:s,voteLabels:i,options:n,allowMultiple:p,npsQuestion:c,npsFollowUp:l,npsFollowUpPlaceholder:d,npsLowLabel:u,npsHighLabel:f,enableBugFlag:b,bugFlagLabel:g,enableScreenshot:m,onSubmit:vr,onClose:Vt,anchorRect:re||void 0,useFixedPosition:!X,isMobile:X};return jsxRuntime.jsxs("div",{ref:Ee,style:{...kr[z],zIndex:"auto"},className:"gotcha-container","data-gotcha-element":e,children:[jsxRuntime.jsx(vo,{size:A,theme:F,customStyles:D,showOnHover:q,touchBehavior:T,onClick:Sr,isOpen:ne,isParentHovered:K,animated:P,queuedCount:Q}),be&&qt&&reactDom.createPortal(jsxRuntime.jsx(Us,{message:be.message,retrying:be.retrying,onRetry:xr,onDismiss:Er}),document.body),ne&&qt&&reactDom.createPortal(jsxRuntime.jsx("div",{role:"presentation",onClick:X?Vt:void 0,style:{position:"fixed",inset:0,zIndex:99999,backgroundColor:X?"rgba(26,23,20,0.32)":"transparent",backdropFilter:X?"blur(8px)":"none",WebkitBackdropFilter:X?"blur(8px)":"none",pointerEvents:X?"auto":"none",transition:"background-color 180ms cubic-bezier(0.22, 0.61, 0.36, 1)"},children:jsxRuntime.jsx("div",{onClick:X?x=>x.stopPropagation():void 0,style:{pointerEvents:"auto"},children:jsxRuntime.jsx(cr,{...Ar})})}),document.body)]})}function Us({message:e,retrying:o,onRetry:t,onDismiss:r}){return jsxRuntime.jsxs("div",{role:"status","aria-live":"polite",className:"editorial",style:{position:"fixed",bottom:16,right:16,zIndex:99998,maxWidth:360,borderRadius:6,border:"1px solid rgba(155, 58, 46, 0.35)",backgroundColor:"#FAF8F4",boxShadow:"0 4px 16px rgba(26, 23, 20, 0.12)",padding:"14px 16px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif",color:"#1A1714",animation:"gotcha-fade-up 240ms cubic-bezier(0.22, 0.61, 0.36, 1)"},children:[jsxRuntime.jsx("div",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, 'Courier New', monospace",fontSize:10,textTransform:"uppercase",letterSpacing:"0.18em",color:"#9B3A2E",marginBottom:6},children:"Couldn\u2019t save"}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:13,lineHeight:1.55,color:"#1A1714"},children:e||"Your feedback didn\u2019t reach us. Retry?"}),jsxRuntime.jsxs("div",{style:{marginTop:12,display:"flex",gap:8},children:[jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:o,style:{backgroundColor:"#1A1714",color:"#FAF8F4",border:"none",borderRadius:4,padding:"6px 14px",fontSize:12,fontWeight:500,cursor:o?"default":"pointer",opacity:o?.6:1,transition:"opacity 180ms"},children:o?"Retrying\u2026":"Retry"}),jsxRuntime.jsx("button",{type:"button",onClick:r,style:{backgroundColor:"transparent",color:"#6B655D",border:"1px solid #E8E2D9",borderRadius:4,padding:"6px 14px",fontSize:12,cursor:"pointer",transition:"color 180ms"},children:"Dismiss"})]})]})}function dr({elementId:e,refreshInterval:o}){let{client:t}=G(),[r,a]=react.useState(null),[s,i]=react.useState(true),[n,p]=react.useState(null);return react.useEffect(()=>{let c=false,l=async()=>{try{let u=await t.getScore(e);c||(a(u),p(null));}catch(u){c||p(u instanceof Error?u.message:"Failed to load score");}finally{c||i(false);}};l();let d;return o&&o>0&&(d=setInterval(l,o)),()=>{c=true,d&&clearInterval(d);}},[t,e,o]),{score:r,isLoading:s,error:n}}var Ys={sm:{fontSize:11,ratingFontSize:13,starSize:13,gap:5,pillPx:8,pillPy:4,barHeight:3,iconSize:12},md:{fontSize:12.5,ratingFontSize:15,starSize:15,gap:6,pillPx:10,pillPy:5,barHeight:4,iconSize:14},lg:{fontSize:14,ratingFontSize:18,starSize:18,gap:8,pillPx:12,pillPy:6,barHeight:5,iconSize:16}};function qs({rating:e,size:o,filledColor:t,emptyColor:r}){let a=`gotcha-star-clip-${Math.random().toString(36).slice(2,8)}`,s=[];for(let i=1;i<=5;i++){let n=Math.min(1,Math.max(0,e-(i-1))),p=`${a}-${i}`;s.push(jsxRuntime.jsxs("svg",{width:o,height:o,viewBox:"0 0 24 24",style:{display:"block"},children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:p,children:jsxRuntime.jsx("rect",{x:"0",y:"0",width:24*n,height:"24"})})}),jsxRuntime.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:r}),jsxRuntime.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:t,clipPath:`url(#${p})`})]},i));}return jsxRuntime.jsx("span",{style:{display:"inline-flex",gap:Math.max(1,o*.08),alignItems:"center"},children:s})}function Xs({rate:e,height:o,filledColor:t,trackColor:r}){return jsxRuntime.jsx("span",{style:{display:"inline-block",width:48,height:o,borderRadius:o,backgroundColor:r,overflow:"hidden",verticalAlign:"middle"},children:jsxRuntime.jsx("span",{style:{display:"block",width:`${e}%`,height:"100%",borderRadius:o,background:t,transition:"width 0.6s cubic-bezier(0.4, 0, 0.2, 1)"}})})}function Vs({size:e,color:o}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:jsxRuntime.jsx("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"})})}function js({elementId:e,variant:o="stars",showCount:t=true,size:r="md",theme:a="auto",refreshInterval:s,style:i}){let{score:n,isLoading:p}=dr({elementId:e,refreshInterval:s}),[c,l]=react.useState("light");react.useEffect(()=>{if(typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");l(F.matches?"dark":"light");let D=O=>l(O.matches?"dark":"light");return F.addEventListener("change",D),()=>F.removeEventListener("change",D)},[]);let{themeConfig:d}=G(),u=react.useMemo(()=>ue(a,c,d),[a,c,d]);if(p||!n)return null;let f=Ys[r],b=u.colors.text,g=u.colors.textDisabled,m=u.colors.starFilled,h=u.colors.starEmpty,w=u.colors.voteUp,y=u.colors.starEmpty,C={display:"inline-flex",alignItems:"center",gap:f.gap,fontFamily:u.typography.fontFamily,lineHeight:1,WebkitFontSmoothing:"antialiased",...i},v={fontFamily:u.typography.fontFamily,fontSize:f.ratingFontSize,fontWeight:700,color:b,fontVariantNumeric:"tabular-nums",letterSpacing:"-0.01em",lineHeight:1},E={fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:Math.max(9,f.fontSize-1),color:g,fontWeight:400,letterSpacing:"0.1em",textTransform:"uppercase"},k=(F,D)=>{let O=F===1?D:`${D}s`;return `${F.toLocaleString()} ${O}`};if(o==="votes"){let{voteCount:F,positiveRate:D}=n,O=F.up+F.down;return O===0?null:jsxRuntime.jsxs("span",{style:C,children:[jsxRuntime.jsx(Vs,{size:f.iconSize,color:w}),jsxRuntime.jsxs("span",{style:{...v,color:w},children:[D,"%"]}),jsxRuntime.jsx(Xs,{rate:D??0,height:f.barHeight,filledColor:w,trackColor:y}),t&&jsxRuntime.jsx("span",{style:E,children:k(O,"vote")})]})}let{averageRating:P,totalResponses:z}=n;if(P===null||z===0)return null;let A=P.toFixed(1);return o==="compact"?jsxRuntime.jsxs("span",{style:C,children:[jsxRuntime.jsx("svg",{width:f.starSize,height:f.starSize,viewBox:"0 0 24 24",style:{display:"block",flexShrink:0},children:jsxRuntime.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",fill:m})}),jsxRuntime.jsx("span",{style:v,children:A}),t&&jsxRuntime.jsxs("span",{style:E,children:["(",z.toLocaleString(),")"]})]}):o==="number"?jsxRuntime.jsxs("span",{style:C,children:[jsxRuntime.jsx("span",{style:v,children:A}),jsxRuntime.jsx("span",{style:{...E,marginLeft:2},children:"/ 5"}),t&&jsxRuntime.jsxs("span",{style:{...E,marginLeft:2},children:["(",k(z,"response"),")"]})]}):jsxRuntime.jsxs("span",{style:C,children:[jsxRuntime.jsx(qs,{rating:P,size:f.starSize,filledColor:m,emptyColor:h}),jsxRuntime.jsx("span",{style:v,children:A}),t&&jsxRuntime.jsxs("span",{style:E,children:["(",k(z,"response"),")"]})]})}function Qs(){let{client:e,disabled:o,defaultUser:t,debug:r,openModal:a,closeModal:s,activeModalId:i}=G();return {client:e,disabled:o,defaultUser:t,debug:r,submitFeedback:e.submitResponse.bind(e),openModal:a,closeModal:s,activeModalId:i}}function Ks(e){let{activeModalId:o,openModal:t,closeModal:r}=G(),a=react.useCallback(()=>t(e),[t,e]),s=react.useCallback(()=>r(),[r]);return {open:a,close:s,isOpen:o===e}}
148
+ exports.Gotcha=Gs;exports.GotchaProvider=Yr;exports.GotchaScore=js;exports.createTheme=Pr;exports.useGotcha=Qs;exports.useGotchaTrigger=Ks;//# sourceMappingURL=index.js.map
174
149
  //# sourceMappingURL=index.js.map