gotcha-feedback 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');var
|
|
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 o.appendChild(t),o}function
|
|
7
|
-
`),w=n.get(h);w||(w=[],n.set(h,w)),w.push(`.${
|
|
8
|
-
`));}else {let
|
|
9
|
-
`)):i.push(
|
|
10
|
-
`));}));});}}function
|
|
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
|
-
${
|
|
12
|
+
${E}
|
|
13
13
|
}
|
|
14
|
-
`;}),i.appendChild(r.createTextNode(C));}a.timeEnd("clone node"),await u?.(m),c!==false&&$(m)&&(a.time("embed web font"),await as(m,t),a.timeEnd("embed web font")),a.time("embed node"),Wo(m,t);let g=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,g);}};l?.(h,g),await Promise.all([...Array.from({length:4})].map(w)),a.timeEnd("embed node"),await p?.(m);let y=fs(m,t);return n&&y.insertBefore(n,y.children[0]),i&&y.insertBefore(i,y.children[0]),d&&_n(t),await b?.(y),y}function fs(e,o){let{width:t,height:r}=o,a=An(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 ps(e,o){let t=await st(e,o),r=await ds(t),a=kn(r,t.isEnable("removeControlCharacter"));t.autoDestruct||(t.svgStyleElement=Po(t.ownerDocument),t.svgDefsElement=t.ownerDocument?.createElementNS(nt,"defs"),t.svgStyles.clear());let s=Ce(a,r.ownerDocument);return await Pn(s,t)}async function ms(e,o){let t=await st(e,o),{log:r,quality:a,type:s,dpi:i}=t,n=await ps(t);r.time("canvas to data url");let f=n.toDataURL(s,a);if(["image/png","image/jpeg"].includes(s)&&i&&an&&ln){let[c,l]=f.split(","),d=0,u=false;if(s==="image/png"){let y=nn(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 p=l.substring(0,d),b=l.substring(d),m=window.atob(p),g=new Uint8Array(m.length);for(let y=0;y<g.length;y++)g[y]=m.charCodeAt(y);let h=s==="image/png"?en(g,i,u):Zr(g,i),w=window.btoa(String.fromCharCode(...h));f=[c,",",w,b].join("");}return r.timeEnd("canvas to data url"),f}async function Ft(e,o){return ms(await st(e,{...o,type:"image/jpeg"}))}var Co,Ao,ko,Fo,xt,tn,on,rn,Ro,le,sn,an,ln,Ct,Bo,tt,At,cn,un,dn,fn,$,ze,Mo,pn,Ne,mn,gn,Ae,ot,hn,bn,yn,wn,Sn,vn,xn,En,Tn,Et,nt,Rn,Io,wo,Wn,Yn,Vn,jn,So,$n,Ho,os,is,Eo,cs,us,Yo=Wt(()=>{Co=112,Ao=72,ko=89,Fo=115;tn="AAlwSFlz",on="AAAJcEhZ",rn="AAAACXBI";Ro="[modern-screenshot]",le=typeof window<"u",sn=le&&"Worker"in window,an=le&&"atob"in window,ln=le&&"btoa"in window,Ct=le?window.navigator?.userAgent:"",Bo=Ct.includes("Chrome"),tt=Ct.includes("AppleWebKit")&&!Bo,At=Ct.includes("Firefox"),cn=e=>e&&"__CONTEXT__"in e,un=e=>e.constructor.name==="CSSFontFaceRule",dn=e=>e.constructor.name==="CSSImportRule",fn=e=>e.constructor.name==="CSSLayerBlockRule",$=e=>e.nodeType===1,ze=e=>typeof e.className=="object",Mo=e=>e.tagName==="image",pn=e=>e.tagName==="use",Ne=e=>$(e)&&typeof e.style<"u"&&!ze(e),mn=e=>e.nodeType===8,gn=e=>e.nodeType===3,Ae=e=>e.tagName==="IMG",ot=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",vn=e=>e.tagName==="SELECT",xn=e=>e.tagName==="SLOT",En=e=>e.tagName==="IFRAME",Tn=(...e)=>console.warn(Ro,...e);Et=e=>e.startsWith("data:");nt="http://www.w3.org/2000/svg";Rn=e=>Fn(e,"dataUrl");Io=(function(){let o=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return ()=>(o+=1,`u${t()}${o}`)})();wo=0;Wn=["width","height","-webkit-text-fill-color"],Yn=["stroke","fill"];Vn=["::before","::after"],jn=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];So=new Set(["symbol"]);$n=/^[\w-:]+$/;Ho=/url\((['"]?)([^'"]+?)\1\)/g;os=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];is=/(\/\*[\s\S]*?\*\/)/g,Eo=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;cs=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,us=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;});var qo={};vr(qo,{captureScreenshot:()=>hs});async function hs(){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 Ft(document.documentElement,{scale:1,quality:.7,width:o,height:t,style:s});return i.length>gs&&(i=await Ft(document.documentElement,{scale:.5,quality:.5,width:o,height:t,style:s})),i}catch{return null}}var gs,Xo=Wt(()=>{Yo();gs=2*1024*1024;});var Yt="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"},re={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 ne(e){if(typeof window>"u")return null;try{return localStorage.getItem(e)}catch{return null}}function se(e,o){if(!(typeof window>"u"))try{localStorage.setItem(e,o);}catch{}}function ae(){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 Qe(){let e=ne(Z.ANONYMOUS_ID);if(e)return e;let o=`anon_${ae()}`;return se(Z.ANONYMOUS_ID,o),o}var Ke=[],Ze=false;function qt(e,o){let t={message:e.slice(0,200),source:o?.slice(0,200),timestamp:Date.now()};Ke.push(t),Ke.length>10&&Ke.shift();}function Xt(e){qt(e.message,e.filename);}function Vt(e){let o=e.reason instanceof Error?e.reason.message:String(e.reason);qt(o);}function jt(){typeof window>"u"||Ze||(window.addEventListener("error",Xt),window.addEventListener("unhandledrejection",Vt),Ze=true);}function Qt(){typeof window>"u"||!Ze||(window.removeEventListener("error",Xt),window.removeEventListener("unhandledrejection",Vt),Ze=false);}function Kt(){return [...Ke].reverse()}function Zt(){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:Kt()}}var xr=50,Er=10080*60*1e3;function Le(){let e=ne(Z.OFFLINE_QUEUE);if(!e)return [];try{let o=JSON.parse(e),t=Date.now();return o.filter(r=>t-r.queuedAt<Er)}catch{return []}}function ft(e){se(Z.OFFLINE_QUEUE,JSON.stringify(e));}function pt(e,o="create"){let t=Le();t.length>=xr||(t.push({id:ae(),payload:e,type:o,queuedAt:Date.now(),retries:0}),ft(t));}function $t(e){let o=Le().filter(t=>t.id!==e);ft(o);}function _t(){return Le()}function Jt(){return Le().length}function eo(e){let o=Le().map(t=>t.id===e?{...t,retries:t.retries+1}:t);ft(o.filter(t=>t.retries<=5));}var Ee={maxRetries:je.MAX_RETRIES,baseDelayMs:je.BASE_DELAY_MS,maxDelayMs:je.MAX_DELAY_MS};async function Pe(e,o,t=Ee,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 to(e){let{apiKey:o,baseUrl:t=Yt,debug:r=false}=e,a=false,s={"Content-Type":"application/json",Authorization:`Bearer ${o}`};async function i(n,f,c){let l=`${t}${f}`,d=ae();r&&console.log(`[Gotcha] ${n} ${f}`,c);let u=await Pe(l,{method:n,headers:{...s,"Idempotency-Key":d},body:c?JSON.stringify(c):void 0},Ee,r),p;try{p=await u.json();}catch{throw {code:"PARSE_ERROR",message:"Invalid response from server",status:u.status}}if(!u.ok){let b=p.error;throw r&&console.error(`[Gotcha] Error: ${b.code} - ${b.message}`),b}return r&&console.log("[Gotcha] Response:",p),p}return {async submitResponse(n){let f=n.user||{};f.id||(f.id=Qe());let c={...n,user:f,context:Zt(),...n.isBug?{isBug:true}:{}};if(typeof navigator<"u"&&!navigator.onLine)return pt(c,"create"),{id:ae(),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 pt(c,"create"),{id:ae(),status:"queued",createdAt:new Date().toISOString()};throw l}},async checkExistingResponse(n,f){let c=`${t}/responses/check?elementId=${encodeURIComponent(n)}&userId=${encodeURIComponent(f)}`;r&&console.log("[Gotcha] GET /responses/check");let l=await Pe(c,{method:"GET",headers:s},Ee,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,f,c){let l=`${t}/responses/${n}${c?`?userId=${encodeURIComponent(c)}`:""}`;r&&console.log(`[Gotcha] PATCH /responses/${n}`,f);let d=await Pe(l,{method:"PATCH",headers:s,body:JSON.stringify(f)},Ee,r),u=await d.json();if(!d.ok){let p=u.error;throw r&&console.error(`[Gotcha] Error: ${p.code} - ${p.message}`),p}return r&&console.log("[Gotcha] Response updated:",u),u},async getScore(n){let f=`${t}/scores/${encodeURIComponent(n)}`;r&&console.log(`[Gotcha] GET /scores/${n}`);let c=await Pe(f,{method:"GET",headers:s},Ee,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 f=`${t}/responses/${encodeURIComponent(n)}/bug`;r&&console.log(`[Gotcha] POST /responses/${n}/bug`);let c=await Pe(f,{method:"POST",headers:s},Ee,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=_t();for(let f of n)try{if(f.type==="update"&&f.payload.responseId){let{responseId:c,...l}=f.payload;await i("PATCH",`/responses/${c}`,l);}else await i("POST","/responses",f.payload);$t(f.id);}catch{eo(f.id);}}finally{a=false;}}},getQueueLength:Jt,getBaseUrl(){return t}}}var Tr=new Set(["__proto__","constructor","prototype"]);function he(e,o){let t={...e};for(let r of Object.keys(o)){if(Tr.has(r))continue;let a=o[r];a!=null&&typeof a=="object"&&!Array.isArray(a)?t[r]=he(e[r]??{},a):a!==void 0&&(t[r]=a);}return t}var Cr=Array(11).fill("#1A1714"),Ar=Array(11).fill("#F2EEE6"),oo="'Gotcha Fraunces', 'Fraunces 144', 'Fraunces', Georgia, 'Iowan Old Style', Charter, 'Source Serif Pro', serif",ro="-apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",mt={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:Cr,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:ro,fontFamilyDisplay:oo,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)"}}},gt={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:Ar,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:ro,fontFamilyDisplay:oo,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 kr(e,o){return he(e==="dark"?gt:mt,o)}function ie(e,o,t){let a=(e==="auto"||e==="custom"?o:e)==="dark"?he({},gt):he({},mt);return t&&(a=he(a,t)),a}var Fr="Gotcha Fraunces",Rr="d09GMgABAAAAACR8AA4AAAAARLQAACQkAAEAxQAAAAAAAAAAAAAAAAAAAAAAAAAAGjYbjRAcegZgAIEmEQgK7GTXUwE2AiQDgyQLgVQABCAFg3wHIBtaOLOiZrNeyoiiVG3mkv8qgZ6y5y0yGqmhHLtlmXfUcoGdzh3hXvbbfZJEgn8M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bIVKq9PrpT8Y+oWYQdFObZPezdQ+4viho3eR2t4qrv4l7JVye5+4CEDObcj1HeNAQVen6HBGf5uDwkz2YHhG169qvqcqF5H1Fj6+4xNneU+/O7KMAnvs3ZC79Wyap52VbSwELRBmz1VZ0oOBtDUAYByAF0JgjV8IhXT8Qhg/Cxea8fD1QnO6oO+YBXo0UilRqk65PDlyVSLxwosViVbEWTzIkpuhSjGjxCsy1hgl8mVBMaVQxXmuLMo5WQ858tDcKpk4jGpVEW412MTLs8pQccpUqlOKO+cK3ZWntPJVeuex4DkaLzSc3OX4OHh4BPzFU9HyL0xPd8K2+UncGeksdK3OVMhTYr8jSZSTItlK2TJU4CWD59lEpRXVbO5DWNiUT4wtSyZ/NoQ82+nBBDcKfCXACwAAAA==",no=`
|
|
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="d09GMgABAAAAACR8AA4AAAAARLQAACQkAAEAxQAAAAAAAAAAAAAAAAAAAAAAAAAAGjYbjRAcegZgAIEmEQgK7GTXUwE2AiQDgyQLgVQABCAFg3wHIBtaOLOiZrNeyoiiVG3mkv8qgZ6y5y0yGqmhHLtlmXfUcoGdzh3hXvbbfZJEgn8MFN8cycS0Q5JKdniY179tejOcWWNW2NpCbi16mGHTm8g+XMsLXIVLl+rKpR/X4fJXXlv/a/t+4rmjWROPKDpLnD1CvZqAh/+/73Wf6f2/PBaaPAKT6DQbxwrYArXgFShoa82drzb92daHqgBxYspSMZndTbwiBnOB3xt5/1YBIoZYQpJCxHR2J1KT/O+/0tqB+d8l9PICEx1FgQwkSyZdGNb/LU3pjHRuZYIKuk0tgLkVlqAAHEBWf2fnNJo93exe0+zJrSg6F+215skqrVfkVjpKOj3TQBuQtMdDw6GpXwAMYKDAPMt5MpM6IYQaNerbvtMxVONtdx6jlSGwbTjb9vTV66QQNEEqtzSACLojZJHMYY+YKKFoYpKrIGyES1qwAckXl5rzIMDmUnmBXlxFaAHy47ayGCCZAQB8Uq71/lheDKwAiA0zUEDZUELY8y8Jg0dCj50MS1FiCpnLIO6iiYfdeQRlolaIhQ/t5qJfzuz3NCNwEpR+q5QAYPidiklPjB71N95uA7ng6JmxybcQXu3gGd4CHYSzNA8nZkHkVm2B/Fa41ZsEAcXAMTELuVMU9b4tNK/+j/zt3oVA/qeo112jXBcNQ4weAOg7x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QDG3kAkQLBJNYOcLSuquwSv9npRgZ/gEgk54n//vCM0bFxA14nlu+gAxMHdBduLOBuD7qnMfuLFhXLGB2dKYHQPY6sbq6Gb/mY5IfKHKtyY7NXn9cq+e1gmrN6Z2NfNoheqZaCmD+aw6ZbhU571n+wcDGgCCbDCAu/O/T3bvuAv7mdpbXAABeEdGCbdkt/xXe2rcrhKFQyAH/Nkv4IaO7BgX1YFvz6i1TLADmn0gTpWwq6DdX5WMHynsv579K825Sml+V1mGJ86e2IdeV7uBAvGFkbD70I1TuvhkjSntM7oTxnpsM08J1j4aZfdwmAa2/CG2FnN6OVF9o+7S4xojLF1I6g7Kf02RqPGGp96HQRLNLAu/2gH1dzpP2DtpaQVOTIvMRtnxsBB0LsSVDtAfnToKoU6RzTXI9FZXFtsU76fFFWvwjO+HAmMcM07ytc7XdOQJVCNCcDN96xn79bdPBbIVKq9PrpT8Y+oWYQdFObZPezdQ+4viho3eR2t4qrv4l7JVye5+4CEDObcj1HeNAQVen6HBGf5uDwkz2YHhG169qvqcqF5H1Fj6+4xNneU+/O7KMAnvs3ZC79Wyap52VbSwELRBmz1VZ0oOBtDUAYByAF0JgjV8IhXT8Qhg/Cxea8fD1QnO6oO+YBXo0UilRqk65PDlyVSLxwosViVbEWTzIkpuhSjGjxCsy1hgl8mVBMaVQxXmuLMo5WQ858tDcKpk4jGpVEW412MTLs8pQccpUqlOKO+cK3ZWntPJVeuex4DkaLzSc3OX4OHh4BPzFU9HyL0xPd8K2+UncGeksdK3OVMhTYr8jSZSTItlK2TJU4CWD59lEpRXVbO5DWNiUT4wtSyZ/NoQ82+nBBDcKfCXACwAAAA==",co=`
|
|
15
15
|
@font-face {
|
|
16
|
-
font-family: '${
|
|
16
|
+
font-family: '${Nr}';
|
|
17
17
|
font-weight: 400;
|
|
18
18
|
font-style: normal;
|
|
19
19
|
font-display: block;
|
|
20
|
-
src: url(data:font/woff2;base64,${
|
|
20
|
+
src: url(data:font/woff2;base64,${Gr}) format('woff2');
|
|
21
21
|
}
|
|
22
|
-
`;var
|
|
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
23
|
/* \u2500\u2500 Embedded Fraunces 144 SemiBold (OFL, subsetted to ASCII) \u2500\u2500 */
|
|
24
|
-
${
|
|
24
|
+
${co}
|
|
25
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 */
|
|
26
26
|
|
|
27
27
|
@keyframes gotcha-fade-up {
|
|
@@ -144,6 +144,6 @@ ${no}
|
|
|
144
144
|
opacity: 1 !important;
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
`.trim()}function $e(e){if(typeof document>"u")return;let o=document.getElementById(so);o||(o=document.createElement("style"),o.id=so,document.head.appendChild(o)),o.textContent=Br(e);}var io=react.createContext(null),Lr={};function Pr({apiKey:e,children:o,baseUrl:t,debug:r=false,disabled:a=false,defaultUser:s,defaultUserEmail:i,themeConfig:n}){let[f,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(()=>to({apiKey:e,baseUrl:t,debug:r}),[e,t,r]),d=react.useMemo(()=>s??Lr,[JSON.stringify(s)]);react.useEffect(()=>{let m=ie("light","light",n);$e(m);},[n]),react.useEffect(()=>(jt(),()=>Qt()),[]),react.useEffect(()=>{l.flushQueue();let m=()=>l.flushQueue();return window.addEventListener("online",m),()=>window.removeEventListener("online",m)},[l]);let u=react.useCallback(m=>{c(m);},[]),p=react.useCallback(()=>{c(null);},[]),b=react.useMemo(()=>({client:l,disabled:a,defaultUser:d,defaultUserEmail:i,debug:r,activeModalId:f,openModal:u,closeModal:p,themeConfig:n}),[l,a,d,i,r,f,u,p,n]);return jsxRuntime.jsx(io.Provider,{value:b,children:o})}function G(){let e=react.useContext(io);if(!e)throw new Error("useGotchaContext must be used within a GotchaProvider");return e}function zr(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 lo(e){let{client:o,defaultUser:t}=G(),[r,a]=react.useState(false),[s,i]=react.useState(false),[n,f]=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 p=false;return (async()=>{i(true);try{let m=await o.checkExistingResponse(e.elementId,u);p||(m&&e.cooldownDays&&e.cooldownDays>0&&zr(m.createdAt,e.cooldownDays)?l(null):l(m));}catch{p||l(null);}finally{p||i(false);}})(),()=>{p=true;}},[o,e.elementId,e.user?.id,t?.id,e.onePerUser,e.cooldownDays]),{submit:react.useCallback(async u=>{a(true),f(null);try{let p=e.user?.id||t?.id,b;return e.onePerUser&&c&&p?b=await o.updateResponse(c.id,{content:u.content,title:u.title,rating:u.rating,vote:u.vote,pollSelected:u.pollSelected},p):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(p){let b=p instanceof Error?p.message:"Something went wrong";throw f(b),e.onError?.(p instanceof Error?p:new Error(b)),p}finally{a(false);}},[o,t,e,c]),isLoading:r,isCheckingExisting:s,error:n,existingResponse:c,isEditing:!!c,clearError:()=>f(null)}}function uo(e,o){return `${Z.HIDDEN_UNTIL}_${e}_${o}`}function co(e,o,t){if(!t||t<=0)return false;let r=uo(e,o),a=ne(r);return a?new Date(a).getTime()>Date.now():false}function fo(e){let{elementId:o,userId:t,hideAfterSubmitDays:r}=e,a=react.useMemo(()=>t||Qe(),[t]),[s,i]=react.useState(()=>co(o,a,r));react.useEffect(()=>{i(co(o,a,r));},[o,a,r]);let n=react.useCallback(()=>{if(!r||r<=0)return;let f=uo(o,a),c=new Date(Date.now()+r*24*60*60*1e3);se(f,c.toISOString()),i(true);},[o,a,r]);return {isHidden:s,markHidden:n}}function qr(e){return `${Z.VISIT_COUNT}_${e}`}function mo(e){let{elementId:o,showAfterSeconds:t,showAfterScrollPercent:r,showAfterVisits:a}=e,s=t!=null||r!=null||a!=null,[i,n]=react.useState(!t),[f,c]=react.useState(!r),[l]=react.useState(()=>{if(!a)return true;let d=qr(o),p=parseInt(ne(d)||"0",10)+1;return se(d,String(p)),p>=a});return react.useEffect(()=>{if(!t||t<=0)return;let d=Date.now(),u=t*1e3,p=()=>{Date.now()-d>=u?n(true):b=setTimeout(p,Math.min(1e3,u-(Date.now()-d)));},b=setTimeout(p,Math.min(1e3,u));return ()=>clearTimeout(b)},[t]),react.useEffect(()=>{if(!r||r<=0)return;let d=()=>{let u=document.documentElement.scrollHeight,p=window.innerHeight;if(u<=p){c(true);return}(window.scrollY+p)/u*100>=r&&c(true);};if(d(),!f)return window.addEventListener("scroll",d,{passive:true}),()=>window.removeEventListener("scroll",d)},[r,f]),{conditionsMet:!s||i&&f&&l}}function Je(...e){return e.filter(Boolean).join(" ")}var W=()=>typeof window>"u"?false:"ontouchstart"in window||navigator.maxTouchPoints>0,go=(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 Vr(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ho({size:e,theme:o,customStyles:t,showOnHover:r,touchBehavior:a,onClick:s,isOpen:i,isParentHovered:n=false,animated:f=true,queuedCount:c=0}){let[l,d]=react.useState(false),[u,p]=react.useState(false),[b,m]=react.useState(Vr),[g,h]=react.useState(false),[w,y]=react.useState(false),[C,v]=react.useState(false),{themeConfig:x}=G();react.useEffect(()=>{if(d(W()),typeof window>"u")return;let Q=window.matchMedia("(prefers-color-scheme: dark)"),fe=Se=>m(Se.matches?"dark":"light");return Q.addEventListener("change",fe),()=>Q.removeEventListener("change",fe)},[]);let A=i?true:!l&&r?n:l&&a==="tap-to-reveal"?u:true;react.useEffect(()=>{if(A&&!C){let Q=setTimeout(()=>v(true),320);return ()=>clearTimeout(Q)}},[A,C]);let L=()=>{if(l&&a==="tap-to-reveal"&&!u){p(true);return}s();},z=go(e,l),k=react.useMemo(()=>ie(o,b,x),[o,b,x]),F=i?k.colors.warning:k.colors.border,M=i?k.colors.warning:k.colors.glassColor,O=()=>A?w?"scale(0.97)":"scale(1)":"scale(0.96)",Y=w?"80ms":"160ms",E=k.animation.easing.default,H=g&&!i?k.colors.surfaceHover:k.colors.glassBackground,Re={position:"relative",width:z,height:z,borderRadius:k.borders.radius.full,border:`1px solid ${F}`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",background:H,color:M,boxShadow:g?k.colors.glassHoverShadow:k.colors.glassShadow,transition:C?`transform ${Y} ${E}, background-color 180ms ${E}, box-shadow 180ms ${E}, border-color 240ms ${E}, color 240ms ${E}`:`opacity 320ms ${E}, transform 320ms ${E}`,opacity:A?1:0,transform:O(),pointerEvents:A?"auto":"none",...t?.button};return jsxRuntime.jsxs("button",{type:"button",onClick:L,onMouseEnter:()=>h(true),onMouseLeave:()=>{h(false),y(false);},onMouseDown:()=>y(true),onMouseUp:()=>y(false),onTouchStart:()=>y(true),onTouchEnd:()=>y(false),style:Re,className:Je("gotcha-button",i&&"gotcha-button--open"),"aria-label":"Give feedback on this feature","aria-expanded":i,"aria-haspopup":"dialog",children:[jsxRuntime.jsx(jr,{size:z*.62,color:M,fontFamilyDisplay:k.typography.fontFamilyDisplay,animated:f&&!C}),c>0&&jsxRuntime.jsx("span",{"aria-label":`${c} queued`,style:{position:"absolute",top:-2,right:-2,width:8,height:8,borderRadius:"50%",backgroundColor:k.colors.warning,border:`1.5px solid ${k.colors.background}`}})]})}function jr({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 yo({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 f=e.indexOf(",");if(f<0)return null;let c=e.slice(f+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 jo({resolvedTheme:e,placeholder:o,submitText:t,isLoading:r,onSubmit:a,customStyles:s,initialValues:i,isEditing:n=false,showText:f=true,showRating:c=true,enableBugFlag:l=false,bugFlagLabel:d,enableScreenshot:u=false}){let[p,b]=react.useState(i?.content||""),[m,g]=react.useState(i?.rating??null),[h,w]=react.useState(false),[y,C]=react.useState(false),[v,x]=react.useState(null),[A,L]=react.useState(false),[z,k]=react.useState(false);react.useEffect(()=>{C(W());},[]),react.useEffect(()=>{i?.content!==void 0&&b(i.content||""),i?.rating!==void 0&&g(i.rating??null);},[i?.content,i?.rating]);let F=f&&c?p.trim().length>0||m!==null:f?p.trim().length>0:c?m!==null:false,M=async()=>{L(true),k(false);try{let{captureScreenshot:E}=await Promise.resolve().then(()=>(Xo(),qo)),H=await E();H?x(H):k(!0);}catch{k(true);}finally{L(false);}},O=E=>{E.preventDefault(),!(!F||r)&&a({content:f&&p.trim()?p.trim():void 0,rating:c&&m!==null?m:void 0,isBug:h||void 0,screenshot:v||void 0});},Y={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:f?y?18:16:0,...f?{}:{display:"flex",justifyContent:"center",padding:"6px 0"}},children:jsxRuntime.jsx(bs,{value:m,onChange:g,theme:e,isTouch:y,large:!f})}),f&&jsxRuntime.jsx("textarea",{value:p,onChange:E=>b(E.target.value),placeholder:o||"Share your thoughts\u2026",maxLength:5e3,style:Y,disabled:r,"aria-label":"Your feedback",onFocus:E=>{E.currentTarget.style.borderBottomColor=e.colors.inputBorderFocus;},onBlur:E=>{E.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:M,disabled:A,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:A?"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:E=>{E.currentTarget.style.borderColor=e.colors.inputBorderFocus,E.currentTarget.style.color=e.colors.text;},onMouseLeave:E=>{E.currentTarget.style.borderColor=e.colors.border,E.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"})]}),A?"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:M,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(yo,{src:v,onRemove:()=>x(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:E=>{E.currentTarget.disabled||(E.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:E=>{E.currentTarget.disabled||(E.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:r?n?"Updating\u2026":"Sending\u2026":n?"Update":t})]})}function bs({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,f=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:f},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 Qo({resolvedTheme:e,isLoading:o,onSubmit:t,initialVote:r,isEditing:a=false,labels:s}){let[i,n]=react.useState(false),[f,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=g=>{c(g),t({vote:g});},p=i?24:20,b=g=>{let h=l===g,w=g==="up"?e.colors.voteUp:e.colors.voteDown,y=g==="up"?e.colors.voteUpSurface:e.colors.voteDownSurface,C=g==="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"}},m=(g,h)=>s?.[g]?s[g]:g==="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(g=>{let h=l===g,w=o&&f===g,y=m(g,h),C=w?`${y}, submitting`:y,v=g==="up"?e.colors.voteUpBorder:e.colors.voteDownBorder;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>u(g),disabled:o,style:b(g),"aria-label":C,"aria-pressed":h,onMouseEnter:x=>{o||h||(x.currentTarget.style.borderColor=e.colors.inputBorderFocus);},onMouseLeave:x=>{h||(x.currentTarget.style.borderColor=v);},children:[g==="up"?jsxRuntime.jsx(ys,{size:p}):jsxRuntime.jsx(ws,{size:p}),jsxRuntime.jsx("span",{style:{fontStyle:w?"italic":"normal"},children:w?a?"Updating\u2026":"Sending\u2026":y})]},g)})})}function ys({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 ws({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 Zo({resolvedTheme:e,options:o,allowMultiple:t,isLoading:r,onSubmit:a,initialSelected:s,isEditing:i=false}){let[n,f]=react.useState(s||[]),[c,l]=react.useState(false),[d,u]=react.useState(null);react.useEffect(()=>{l(W());},[]),react.useEffect(()=>{s&&f(s);},[s]);let p=g=>{r||f(t?h=>h.includes(g)?h.filter(w=>w!==g):[...h,g]:h=>h.includes(g)?[]:[g]);},b=()=>{n.length===0||r||a({pollSelected:n});},m=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((g,h)=>{let w=n.includes(g),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:()=>p(g),onMouseEnter:()=>u(h),onMouseLeave:()=>u(null),disabled:r,"aria-pressed":w,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:m,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:g}),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"})})})]})]},g)})}),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:g=>{g.currentTarget.disabled||(g.currentTarget.style.backgroundColor=e.colors.buttonBackgroundHover);},onMouseLeave:g=>{g.currentTarget.disabled||(g.currentTarget.style.backgroundColor=e.colors.buttonBackground);},children:r?i?"Updating\u2026":"Sending\u2026":i?"Update":"Submit"})]})}function _o({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 er({resolvedTheme:e,submitText:o,isLoading:t,onSubmit:r,customStyles:a,showFollowUp:s=true,followUpPlaceholder:i,lowLabel:n="Not likely",highLabel:f="Very likely",initialValues:c,isEditing:l=false}){let[d,u]=react.useState(c?.rating??null),[p,b]=react.useState(c?.content||""),[m,g]=react.useState(false),[h,w]=react.useState(null);react.useEffect(()=>{g(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&&p.trim()?p.trim():void 0});},children:[jsxRuntime.jsx("div",{style:{position:"relative",display:"flex",gap:m?4:5,justifyContent:"center"},role:"group","aria-label":"NPS Score",onMouseLeave:()=>w(null),children:Array.from({length:11},(v,x)=>{let A=d===x,L=h===x;return jsxRuntime.jsx("button",{type:"button",onClick:()=>u(x),onMouseEnter:()=>w(x),"aria-label":`Score ${x} out of 10`,"aria-pressed":A,style:{flex:1,minWidth:0,aspectRatio:"1",borderRadius:e.borders.radius.sm,border:`1px solid ${A?e.colors.buttonBackground:L?e.colors.inputBorderFocus:e.colors.border}`,backgroundColor:A?e.colors.buttonBackground:"transparent",color:A?e.colors.buttonColor:e.colors.text,fontSize:15,fontWeight:A?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,...A?a?.npsButtonSelected:{}},children:x},x)})}),jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:12,padding:"0 2px",...a?.npsLabels},children:[n,f].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:p,onChange:v=>b(v.target.value),placeholder:i||"What's the main reason for your score?",maxLength:5e3,style:{width:"100%",padding:m?"12px 0":"10px 0",marginTop:18,border:"none",borderBottom:`1px solid ${e.colors.inputBorder}`,borderRadius:0,backgroundColor:"transparent",color:e.colors.text,fontSize:m?e.typography.fontSize.lg:e.typography.fontSize.md,resize:"none",minHeight:m?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:m?"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 or({resolvedTheme:e,promptText:o,placeholder:t,isLoading:r,onSubmit:a}){let[s,i]=react.useState(""),[n,f]=react.useState(false);return react.useEffect(()=>{f(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 As={feedback:"Feedback",vote:"Vote",poll:"Poll",nps:"Rate"};function ks(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 Fs=4e3;function nr({mode:e,theme:o,customStyles:t,promptText:r,placeholder:a,submitText:s,thankYouMessage:i,isLoading:n,isCheckingExisting:f=false,isSubmitted:c,phase:l="form",followUpConfig:d,followUpLoading:u=false,onFollowUpSubmit:p,error:b,existingResponse:m,isEditing:g=false,showText:h=true,showRating:w=true,voteLabels:y,options:C,allowMultiple:v=false,npsQuestion:x,npsFollowUp:A=true,npsFollowUpPlaceholder:L,npsLowLabel:z,npsHighLabel:k,enableBugFlag:F=false,bugFlagLabel:M,enableScreenshot:O=false,onSubmit:Y,onClose:E,anchorRect:H,useFixedPosition:Re=false,isMobile:Q}){let fe=react.useRef(null),Se=react.useRef(null),Be=react.useRef(E);Be.current=E;let[He,ct]=react.useState(false),U=Q??He,[We,Ye]=react.useState("light"),{themeConfig:ee}=G();react.useEffect(()=>{if(typeof window>"u")return;let P=window.matchMedia("(prefers-color-scheme: dark)"),V=N=>Ye(N.matches?"dark":"light");V(P);let q=N=>V(N);P.addEventListener("change",q);let j=[()=>P.removeEventListener("change",q)];if(Q===void 0){let N=window.matchMedia("(max-width: 1023px)"),_=()=>ct(N.matches);_(),N.addEventListener("change",_),j.push(()=>N.removeEventListener("change",_));}return ()=>{for(let N of j)N();}},[Q]);let S=react.useMemo(()=>ie(o,We,ee),[o,We,ee]);react.useEffect(()=>{$e(S);},[S]);let Me=typeof window>"u"||!H?false:window.innerHeight-H.bottom<340;react.useEffect(()=>{let P=fe.current;if(!P)return;Se.current?.focus();let V=q=>{if(q.key==="Escape"){Be.current();return}if(q.key==="Tab"){let j=P.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),N=j[0],_=j[j.length-1];q.shiftKey&&document.activeElement===N?(q.preventDefault(),_?.focus()):!q.shiftKey&&document.activeElement===_&&(q.preventDefault(),N?.focus());}};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[]);let pe=r||ks(e,x),ut=As[e],me=e==="nps"?420:e==="poll"?400:360,qe=U?"gotcha-modal-enter-center":Me?"gotcha-modal-enter-above":"gotcha-modal-enter",K=typeof window<"u"?window.innerHeight:0,ge={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"},dt=U?{...ge,position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100vw - 32px)",maxWidth:me,zIndex:9999,...t?.modal}:Re&&H&&K?(()=>{let P=window.innerWidth,V=24,j=H.left+H.width/2-me/2,N=Math.max(V,Math.min(j,P-me-V));return {...ge,position:"fixed",left:N,width:me,zIndex:99999,...Me?{bottom:K-H.top+10}:{top:H.bottom+10},...t?.modal}})():{...ge,position:"absolute",left:"50%",width:me,zIndex:9999,...Me?{bottom:"100%",marginBottom:10,transform:"translateX(-50%)"}:{top:"100%",marginTop:10,transform:"translateX(-50%)"},...t?.modal},te=P=>U?{}:{animation:`gotcha-fade-up ${S.animation.duration.normal} ${S.animation.easing.default} both`,animationDelay:`${P*.04}s`},Xe=U?"20px 24px 24px":"20px 28px 24px";return jsxRuntime.jsxs("div",{ref:fe,role:"dialog","aria-modal":"true","aria-label":c?"Feedback submitted":void 0,"aria-labelledby":c?void 0:"gotcha-modal-title","data-gotcha":true,style:dt,className:Je("gotcha-modal","gotcha-root",qe),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,...te(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:ut})]}),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,...te(1),...t?.title},children:pe}),jsxRuntime.jsx("button",{ref:Se,type:"button",onClick:E,"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:P=>{P.currentTarget.style.color=S.colors.closeButtonHover;},onMouseLeave:P=>{P.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:Xe,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,...te(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 ${Fs}ms linear forwards`}})]}),l==="followUp"&&d&&p&&!c&&jsxRuntime.jsx("div",{style:te(2),children:jsxRuntime.jsx(or,{resolvedTheme:S,promptText:d.promptText,placeholder:d.placeholder,isLoading:u,onSubmit:p})}),l==="form"&&f&&jsxRuntime.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"24px 0",...te(2)},children:jsxRuntime.jsx(_o,{size:20,color:S.colors.textSecondary})}),l==="form"&&!f&&!c&&jsxRuntime.jsxs("div",{style:te(2),children:[e==="feedback"&&jsxRuntime.jsx(jo,{resolvedTheme:S,placeholder:a,submitText:s,isLoading:n,onSubmit:Y,customStyles:t,initialValues:m?{content:m.content,rating:m.rating}:void 0,isEditing:g,showText:h,showRating:w,enableBugFlag:F,bugFlagLabel:M,enableScreenshot:O}),e==="vote"&&jsxRuntime.jsx(Qo,{resolvedTheme:S,isLoading:n,onSubmit:Y,initialVote:m?.vote||void 0,isEditing:g,labels:y}),e==="nps"&&jsxRuntime.jsx(er,{resolvedTheme:S,submitText:s,isLoading:n,onSubmit:Y,showFollowUp:A,followUpPlaceholder:L,lowLabel:z,highLabel:k,customStyles:t,initialValues:m?{rating:m.rating,content:m.content}:void 0,isEditing:g}),e==="poll"&&C&&C.length>0&&jsxRuntime.jsx(Zo,{resolvedTheme:S,options:C,allowMultiple:v,isLoading:n,onSubmit:Y,initialSelected:m?.pollSelected||void 0,isEditing:g})]})]}),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 Bs({elementId:e,user:o,userEmail:t,mode:r="feedback",showText:a=true,showRating:s=true,voteLabels:i,options:n,allowMultiple:f=false,npsQuestion:c,npsFollowUp:l=true,npsFollowUpPlaceholder:d,npsLowLabel:u,npsHighLabel:p,enableBugFlag:b=false,bugFlagLabel:m,enableScreenshot:g=false,onePerUser:h=false,cooldownDays:w,hideAfterSubmitDays:y,showAfterSeconds:C,showAfterScrollPercent:v,showAfterVisits:x,followUp:A,animated:L=true,position:z=re.POSITION,size:k=re.SIZE,theme:F=re.THEME,customStyles:M,visible:O=true,showOnHover:Y=re.SHOW_ON_HOVER,touchBehavior:E=re.TOUCH_BEHAVIOR,promptText:H,placeholder:Re,submitText:Q=re.SUBMIT_TEXT,thankYouMessage:fe=re.THANK_YOU_MESSAGE,onSubmit:Se,onOpen:Be,onClose:He,onError:ct}){let{disabled:U,activeModalId:We,openModal:Ye,closeModal:ee,defaultUser:S,defaultUserEmail:Me,client:pe}=G(),{conditionsMet:ut}=mo({elementId:e,showAfterSeconds:C,showAfterScrollPercent:v,showAfterVisits:x}),{isHidden:Ut,markHidden:me}=fo({elementId:e,userId:o?.id||S?.id,hideAfterSubmitDays:y}),[qe,K]=react.useState("form"),[ge,dt]=react.useState(null),[te,Xe]=react.useState(false),[P,V]=react.useState(0),[q,j]=react.useState(false),[N,_]=react.useState(null),[X,ir]=react.useState(false),[lr,cr]=react.useState(false),ve=react.useRef(null),De=react.useRef(),Ie=react.useRef(null);react.useEffect(()=>{if(cr(true),typeof window>"u")return;let T=window.matchMedia("(max-width: 1023px)"),D=()=>ir(T.matches);return D(),T.addEventListener("change",D),()=>{T.removeEventListener("change",D),clearTimeout(De.current);}},[]),react.useEffect(()=>{V(pe.getQueueLength());let T=()=>{setTimeout(()=>V(pe.getQueueLength()),2e3);};return window.addEventListener("online",T),()=>window.removeEventListener("online",T)},[pe]);let oe=We===e;react.useEffect(()=>{if(!oe||X)return;let T=0,D=()=>{T||(T=requestAnimationFrame(()=>{T=0;let xe=ve.current;if(!xe)return;let Ve=xe.querySelector("button");_((Ve??xe).getBoundingClientRect());}));};return window.addEventListener("resize",D),window.addEventListener("scroll",D,{passive:true}),()=>{T&&cancelAnimationFrame(T),window.removeEventListener("resize",D),window.removeEventListener("scroll",D);}},[oe,X]),react.useEffect(()=>{oe||(K("form"),clearTimeout(De.current));},[oe]),react.useEffect(()=>{if(!oe||!X)return;let T=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=T;}},[oe,X]),react.useEffect(()=>{if(!Y)return;let T=ve.current;if(!T)return;let D=T.parentElement;if(!D)return;let xe=()=>j(true),Ve=()=>j(false);return D.addEventListener("mouseenter",xe),D.addEventListener("mouseleave",Ve),()=>{D.removeEventListener("mouseenter",xe),D.removeEventListener("mouseleave",Ve);}},[Y]);let{submit:zt,isLoading:ur,isCheckingExisting:dr,error:fr,existingResponse:pr,isEditing:Ot}=lo({elementId:e,mode:r,pollOptions:n,user:o,userEmail:t??Me,onePerUser:h,cooldownDays:w,onSuccess:T=>{dt(T.id),y&&me(),Se?.(T),A&&Ie.current&&(A.ratingThreshold!=null&&Ie.current.rating!=null&&Ie.current.rating<=A.ratingThreshold||A.onNegativeVote&&Ie.current.vote==="down")&&r!=="poll"?K("followUp"):(K("success"),De.current=setTimeout(()=>{ee(),K("form");},4e3));},onError:T=>{console.warn("[Gotcha] Submission failed:",T instanceof Error?T.message:T),ct?.(T);}}),mr=react.useCallback(()=>{if(ve.current){let T=ve.current.querySelector("button");_((T??ve.current).getBoundingClientRect());}Ye(e),Be?.();},[e,Ye,Be]),Ht=react.useCallback(()=>{clearTimeout(De.current),ee(),K("form"),He?.();},[ee,He]),gr=react.useCallback(T=>{Ie.current={rating:T.rating,vote:T.vote},zt(T);},[zt]),hr=react.useCallback(async T=>{if(ge){Xe(true);try{await pe.updateResponse(ge,{content:T});}catch(D){console.warn("[Gotcha] Follow-up submission failed:",D instanceof Error?D.message:D);}finally{Xe(false),K("success"),De.current=setTimeout(()=>{ee(),K("form");},4e3);}}},[ge,ee,pe]),br=h&&Ot?"Update":Q;if(U||!O||Ut||!ut)return null;let yr={"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"}},wr={mode:r,theme:F,customStyles:M,promptText:H,placeholder:Re,submitText:br,thankYouMessage:fe,isLoading:ur,isCheckingExisting:h&&dr,isSubmitted:qe==="success",phase:qe,followUpConfig:A,followUpLoading:te,onFollowUpSubmit:hr,error:fr,existingResponse:h?pr:null,isEditing:h&&Ot,showText:a,showRating:s,voteLabels:i,options:n,allowMultiple:f,npsQuestion:c,npsFollowUp:l,npsFollowUpPlaceholder:d,npsLowLabel:u,npsHighLabel:p,enableBugFlag:b,bugFlagLabel:m,enableScreenshot:g,onSubmit:gr,onClose:Ht,anchorRect:N||void 0,useFixedPosition:!X,isMobile:X};return jsxRuntime.jsxs("div",{ref:ve,style:{...yr[z],zIndex:"auto"},className:"gotcha-container","data-gotcha-element":e,children:[jsxRuntime.jsx(ho,{size:k,theme:F,customStyles:M,showOnHover:Y,touchBehavior:E,onClick:mr,isOpen:oe,isParentHovered:q,animated:L,queuedCount:P}),oe&&lr&&reactDom.createPortal(jsxRuntime.jsx("div",{role:"presentation",onClick:X?Ht: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?T=>T.stopPropagation():void 0,style:{pointerEvents:"auto"},children:jsxRuntime.jsx(nr,{...wr})})}),document.body)]})}function sr({elementId:e,refreshInterval:o}){let{client:t}=G(),[r,a]=react.useState(null),[s,i]=react.useState(true),[n,f]=react.useState(null);return react.useEffect(()=>{let c=false,l=async()=>{try{let u=await t.getScore(e);c||(a(u),f(null));}catch(u){c||f(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 Ns={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 Gs({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))),f=`${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:f,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(#${f})`})]},i));}return jsxRuntime.jsx("span",{style:{display:"inline-flex",gap:Math.max(1,o*.08),alignItems:"center"},children:s})}function Us({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 zs({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 Os({elementId:e,variant:o="stars",showCount:t=true,size:r="md",theme:a="auto",refreshInterval:s,style:i}){let{score:n,isLoading:f}=sr({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 M=O=>l(O.matches?"dark":"light");return F.addEventListener("change",M),()=>F.removeEventListener("change",M)},[]);let{themeConfig:d}=G(),u=react.useMemo(()=>ie(a,c,d),[a,c,d]);if(f||!n)return null;let p=Ns[r],b=u.colors.text,m=u.colors.textDisabled,g=u.colors.starFilled,h=u.colors.starEmpty,w=u.colors.voteUp,y=u.colors.starEmpty,C={display:"inline-flex",alignItems:"center",gap:p.gap,fontFamily:u.typography.fontFamily,lineHeight:1,WebkitFontSmoothing:"antialiased",...i},v={fontFamily:u.typography.fontFamily,fontSize:p.ratingFontSize,fontWeight:700,color:b,fontVariantNumeric:"tabular-nums",letterSpacing:"-0.01em",lineHeight:1},x={fontFamily:"ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:Math.max(9,p.fontSize-1),color:m,fontWeight:400,letterSpacing:"0.1em",textTransform:"uppercase"},A=(F,M)=>{let O=F===1?M:`${M}s`;return `${F.toLocaleString()} ${O}`};if(o==="votes"){let{voteCount:F,positiveRate:M}=n,O=F.up+F.down;return O===0?null:jsxRuntime.jsxs("span",{style:C,children:[jsxRuntime.jsx(zs,{size:p.iconSize,color:w}),jsxRuntime.jsxs("span",{style:{...v,color:w},children:[M,"%"]}),jsxRuntime.jsx(Us,{rate:M??0,height:p.barHeight,filledColor:w,trackColor:y}),t&&jsxRuntime.jsx("span",{style:x,children:A(O,"vote")})]})}let{averageRating:L,totalResponses:z}=n;if(L===null||z===0)return null;let k=L.toFixed(1);return o==="compact"?jsxRuntime.jsxs("span",{style:C,children:[jsxRuntime.jsx("svg",{width:p.starSize,height:p.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:g})}),jsxRuntime.jsx("span",{style:v,children:k}),t&&jsxRuntime.jsxs("span",{style:x,children:["(",z.toLocaleString(),")"]})]}):o==="number"?jsxRuntime.jsxs("span",{style:C,children:[jsxRuntime.jsx("span",{style:v,children:k}),jsxRuntime.jsx("span",{style:{...x,marginLeft:2},children:"/ 5"}),t&&jsxRuntime.jsxs("span",{style:{...x,marginLeft:2},children:["(",A(z,"response"),")"]})]}):jsxRuntime.jsxs("span",{style:C,children:[jsxRuntime.jsx(Gs,{rating:L,size:p.starSize,filledColor:g,emptyColor:h}),jsxRuntime.jsx("span",{style:v,children:k}),t&&jsxRuntime.jsxs("span",{style:x,children:["(",A(z,"response"),")"]})]})}function Hs(){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 Ws(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=
|
|
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",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
|
|
149
149
|
//# sourceMappingURL=index.js.map
|