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