gotcha-feedback 1.0.17 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -88,6 +88,10 @@ interface GotchaProps {
88
88
  experimentId?: string;
89
89
  /** Current A/B variant shown to user */
90
90
  variant?: string;
91
+ /** Show the text input in feedback mode (default: true) */
92
+ showText?: boolean;
93
+ /** Show the star rating in feedback mode (default: true) */
94
+ showRating?: boolean;
91
95
  /** Custom labels for vote buttons (default: Like/Dislike) */
92
96
  voteLabels?: {
93
97
  up: string;
@@ -130,7 +134,7 @@ interface GotchaProps {
130
134
  /** Called on error */
131
135
  onError?: (error: GotchaError) => void;
132
136
  }
133
- declare function Gotcha({ elementId, user, mode, experimentId, variant, voteLabels, options, allowMultiple, showResults, position, size, theme, customStyles, visible, showOnHover, touchBehavior, promptText, placeholder, submitText, thankYouMessage, onSubmit, onOpen, onClose, onError, }: GotchaProps): react_jsx_runtime.JSX.Element | null;
137
+ declare function Gotcha({ elementId, user, mode, showText, showRating, experimentId, variant, voteLabels, options, allowMultiple, showResults, position, size, theme, customStyles, visible, showOnHover, touchBehavior, promptText, placeholder, submitText, thankYouMessage, onSubmit, onOpen, onClose, onError, }: GotchaProps): react_jsx_runtime.JSX.Element | null;
134
138
 
135
139
  /**
136
140
  * Hook to access Gotcha context
package/dist/index.d.ts CHANGED
@@ -88,6 +88,10 @@ interface GotchaProps {
88
88
  experimentId?: string;
89
89
  /** Current A/B variant shown to user */
90
90
  variant?: string;
91
+ /** Show the text input in feedback mode (default: true) */
92
+ showText?: boolean;
93
+ /** Show the star rating in feedback mode (default: true) */
94
+ showRating?: boolean;
91
95
  /** Custom labels for vote buttons (default: Like/Dislike) */
92
96
  voteLabels?: {
93
97
  up: string;
@@ -130,7 +134,7 @@ interface GotchaProps {
130
134
  /** Called on error */
131
135
  onError?: (error: GotchaError) => void;
132
136
  }
133
- declare function Gotcha({ elementId, user, mode, experimentId, variant, voteLabels, options, allowMultiple, showResults, position, size, theme, customStyles, visible, showOnHover, touchBehavior, promptText, placeholder, submitText, thankYouMessage, onSubmit, onOpen, onClose, onError, }: GotchaProps): react_jsx_runtime.JSX.Element | null;
137
+ declare function Gotcha({ elementId, user, mode, showText, showRating, experimentId, variant, voteLabels, options, allowMultiple, showResults, position, size, theme, customStyles, visible, showOnHover, touchBehavior, promptText, placeholder, submitText, thankYouMessage, onSubmit, onOpen, onClose, onError, }: GotchaProps): react_jsx_runtime.JSX.Element | null;
134
138
 
135
139
  /**
136
140
  * Hook to access Gotcha context
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');var Te="https://gotcha.cx/api/v1";var ce={ANONYMOUS_ID:"gotcha_anonymous_id"},M={POSITION:"top-right",SIZE:"md",THEME:"light",SHOW_ON_HOVER:true,TOUCH_BEHAVIOR:"always-visible",SUBMIT_TEXT:"Submit",THANK_YOU_MESSAGE:"Thanks for your feedback!"};var q={MAX_RETRIES:2,BASE_DELAY_MS:500,MAX_DELAY_MS:5e3};function we(){if(typeof window>"u")return `anon_${crypto.randomUUID()}`;let e=localStorage.getItem(ce.ANONYMOUS_ID);if(e)return e;let a=`anon_${crypto.randomUUID()}`;return localStorage.setItem(ce.ANONYMOUS_ID,a),a}var Z={maxRetries:q.MAX_RETRIES,baseDelayMs:q.BASE_DELAY_MS,maxDelayMs:q.MAX_DELAY_MS};async function de(e,a,l=Z,o=false){let b=null;for(let m=0;m<=l.maxRetries;m++){try{o&&m>0&&console.log(`[Gotcha] Retry attempt ${m}/${l.maxRetries}`);let t=await fetch(e,a);if(t.status>=400&&t.status<500&&t.status!==429||t.ok)return t;b=new Error(`HTTP ${t.status}`);}catch(t){b=t,o&&console.log(`[Gotcha] Network error: ${b.message}`);}if(m<l.maxRetries){let t=Math.min(l.baseDelayMs*Math.pow(2,m),l.maxDelayMs);await new Promise(c=>setTimeout(c,t));}}throw b}function Ce(e){let{apiKey:a,baseUrl:l=Te,debug:o=false}=e,b={"Content-Type":"application/json",Authorization:`Bearer ${a}`};async function m(t,c,n){let u=`${l}${c}`,d=crypto.randomUUID();o&&console.log(`[Gotcha] ${t} ${c}`,n);let s=await de(u,{method:t,headers:{...b,"Idempotency-Key":d},body:n?JSON.stringify(n):void 0},Z,o),i=await s.json();if(!s.ok){let f=i.error;throw o&&console.error(`[Gotcha] Error: ${f.code} - ${f.message}`),f}return o&&console.log("[Gotcha] Response:",i),i}return {async submitResponse(t){let c=t.user||{};c.id||(c.id=we());let n={...t,user:c,context:{url:typeof window<"u"?window.location.href:void 0,userAgent:typeof navigator<"u"?navigator.userAgent:void 0}};return m("POST","/responses",n)},async checkExistingResponse(t,c){let n=`${l}/responses/check?elementId=${encodeURIComponent(t)}&userId=${encodeURIComponent(c)}`;o&&console.log("[Gotcha] GET /responses/check");let u=await de(n,{method:"GET",headers:b},Z,o),d=await u.json();if(!u.ok){let s=d.error;throw o&&console.error(`[Gotcha] Error: ${s.code} - ${s.message}`),s}return d.exists?(o&&console.log("[Gotcha] Found existing response:",d.response),d.response):null},async updateResponse(t,c,n){let u=`${l}/responses/${t}${n?`?userId=${encodeURIComponent(n)}`:""}`;o&&console.log(`[Gotcha] PATCH /responses/${t}`,c);let d=await de(u,{method:"PATCH",headers:b,body:JSON.stringify(c)},Z,o),s=await d.json();if(!d.ok){let i=s.error;throw o&&console.error(`[Gotcha] Error: ${i.code} - ${i.message}`),i}return o&&console.log("[Gotcha] Response updated:",s),s},getBaseUrl(){return l}}}var Ge=react.createContext(null);function je({apiKey:e,children:a,baseUrl:l,debug:o=false,disabled:b=false,defaultUser:m={}}){let[t,c]=react.useState(null),n=react.useMemo(()=>Ce({apiKey:e,baseUrl:l,debug:o}),[e,l,o]),u=react.useCallback(i=>{c(i);},[]),d=react.useCallback(()=>{c(null);},[]),s=react.useMemo(()=>({client:n,disabled:b,defaultUser:m,debug:o,activeModalId:t,openModal:u,closeModal:d}),[n,b,m,o,t,u,d]);return jsxRuntime.jsx(Ge.Provider,{value:s,children:a})}function L(){let e=react.useContext(Ge);if(!e)throw new Error("useGotchaContext must be used within a GotchaProvider");return e}function Pe(e){let{client:a,defaultUser:l}=L(),[o,b]=react.useState(false),[m,t]=react.useState(false),[c,n]=react.useState(null),[u,d]=react.useState(null);return react.useEffect(()=>{let i=e.user?.id||l?.id;if(!i){d(null);return}let f=false;return (async()=>{t(true);try{let g=await a.checkExistingResponse(e.elementId,i);f||d(g);}catch{f||d(null);}finally{f||t(false);}})(),()=>{f=true;}},[a,e.elementId,e.user?.id,l?.id]),{submit:react.useCallback(async i=>{b(true),n(null);try{let f=e.user?.id||l?.id,p;return u&&f?p=await a.updateResponse(u.id,{content:i.content,title:i.title,rating:i.rating,vote:i.vote,pollSelected:i.pollSelected},f):p=await a.submitResponse({elementId:e.elementId,mode:e.mode,content:i.content,title:i.title,rating:i.rating,vote:i.vote,pollOptions:e.pollOptions,pollSelected:i.pollSelected,experimentId:e.experimentId,variant:e.variant,user:{...l,...e.user}}),e.onSuccess?.(p),p}catch(f){let p=f instanceof Error?f.message:"Something went wrong";throw n(p),e.onError?.(f instanceof Error?f:new Error(p)),f}finally{b(false);}},[a,l,e,u]),isLoading:o,isCheckingExisting:m,error:c,existingResponse:u,isEditing:!!u,clearError:()=>n(null)}}function ee(...e){return e.filter(Boolean).join(" ")}var I=()=>typeof window>"u"?false:"ontouchstart"in window||navigator.maxTouchPoints>0,Ae=(e,a)=>{let l={sm:{desktop:24,mobile:32},md:{desktop:32,mobile:36},lg:{desktop:40,mobile:40}};return a?l[e].mobile:l[e].desktop};function Je(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function De({size:e,theme:a,customStyles:l,showOnHover:o,touchBehavior:b,onClick:m,isOpen:t,isParentHovered:c=false}){let[n,u]=react.useState(false),[d,s]=react.useState(false),[i,f]=react.useState(Je);react.useEffect(()=>{u(I());let C=window.matchMedia("(prefers-color-scheme: dark)"),A=S=>f(S.matches?"dark":"light");return C.addEventListener("change",A),()=>C.removeEventListener("change",A)},[]);let p=t?true:!n&&o?c:n&&b==="tap-to-reveal"?d:true,g=()=>{if(n&&b==="tap-to-reveal"&&!d){s(true);return}m();},r=Ae(e,n),h=(a==="auto"?i:a)==="dark",P={width:r,height:r,borderRadius:"50%",border:h?"1px solid rgba(255,255,255,0.15)":"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",background:h?"linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 60%, rgba(0,0,0,0.05) 100%)":"linear-gradient(160deg, rgba(255,255,255,0.7) 0%, rgba(200,210,230,0.4) 40%, rgba(180,192,220,0.5) 100%)",backdropFilter:"blur(16px) saturate(170%)",WebkitBackdropFilter:"blur(16px) saturate(170%)",color:h?"rgba(255,255,255,0.88)":"rgba(0,0,0,0.75)",boxShadow:h?"0 4px 14px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.35)":"0 3px 12px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.2)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",opacity:p?1:0,transform:p?"scale(1)":"scale(0.6)",pointerEvents:p?"auto":"none",...l?.button};return jsxRuntime.jsx("button",{type:"button",onClick:g,style:P,className:ee("gotcha-button",t&&"gotcha-button--open"),"aria-label":"Give feedback on this feature","aria-expanded":t,"aria-haspopup":"dialog",children:jsxRuntime.jsx(tt,{size:r*.65})})}var Oe="gotcha-carter-one";function et(){react.useEffect(()=>{if(document.getElementById(Oe))return;let e=document.createElement("link");e.id=Oe,e.rel="stylesheet",e.href="https://fonts.googleapis.com/css2?family=Carter+One&display=swap",document.head.appendChild(e);},[]);}function tt({size:e}){return et(),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"},children:"G"})}function _({size:e=16,color:a="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("style",{children:`
1
+ 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');var Ce="https://gotcha.cx/api/v1";var ue={ANONYMOUS_ID:"gotcha_anonymous_id"},P={POSITION:"top-right",SIZE:"md",THEME:"light",SHOW_ON_HOVER:true,TOUCH_BEHAVIOR:"always-visible",SUBMIT_TEXT:"Submit",THANK_YOU_MESSAGE:"Thanks for your feedback!"};var J={MAX_RETRIES:2,BASE_DELAY_MS:500,MAX_DELAY_MS:5e3};function Me(){if(typeof window>"u")return `anon_${crypto.randomUUID()}`;let e=localStorage.getItem(ue.ANONYMOUS_ID);if(e)return e;let a=`anon_${crypto.randomUUID()}`;return localStorage.setItem(ue.ANONYMOUS_ID,a),a}var ee={maxRetries:J.MAX_RETRIES,baseDelayMs:J.BASE_DELAY_MS,maxDelayMs:J.MAX_DELAY_MS};async function pe(e,a,l=ee,n=false){let g=null;for(let b=0;b<=l.maxRetries;b++){try{n&&b>0&&console.log(`[Gotcha] Retry attempt ${b}/${l.maxRetries}`);let t=await fetch(e,a);if(t.status>=400&&t.status<500&&t.status!==429||t.ok)return t;g=new Error(`HTTP ${t.status}`);}catch(t){g=t,n&&console.log(`[Gotcha] Network error: ${g.message}`);}if(b<l.maxRetries){let t=Math.min(l.baseDelayMs*Math.pow(2,b),l.maxDelayMs);await new Promise(i=>setTimeout(i,t));}}throw g}function Ie(e){let{apiKey:a,baseUrl:l=Ce,debug:n=false}=e,g={"Content-Type":"application/json",Authorization:`Bearer ${a}`};async function b(t,i,s){let r=`${l}${i}`,d=crypto.randomUUID();n&&console.log(`[Gotcha] ${t} ${i}`,s);let c=await pe(r,{method:t,headers:{...g,"Idempotency-Key":d},body:s?JSON.stringify(s):void 0},ee,n),u=await c.json();if(!c.ok){let p=u.error;throw n&&console.error(`[Gotcha] Error: ${p.code} - ${p.message}`),p}return n&&console.log("[Gotcha] Response:",u),u}return {async submitResponse(t){let i=t.user||{};i.id||(i.id=Me());let s={...t,user:i,context:{url:typeof window<"u"?window.location.href:void 0,userAgent:typeof navigator<"u"?navigator.userAgent:void 0}};return b("POST","/responses",s)},async checkExistingResponse(t,i){let s=`${l}/responses/check?elementId=${encodeURIComponent(t)}&userId=${encodeURIComponent(i)}`;n&&console.log("[Gotcha] GET /responses/check");let r=await pe(s,{method:"GET",headers:g},ee,n),d=await r.json();if(!r.ok){let c=d.error;throw n&&console.error(`[Gotcha] Error: ${c.code} - ${c.message}`),c}return d.exists?(n&&console.log("[Gotcha] Found existing response:",d.response),d.response):null},async updateResponse(t,i,s){let r=`${l}/responses/${t}${s?`?userId=${encodeURIComponent(s)}`:""}`;n&&console.log(`[Gotcha] PATCH /responses/${t}`,i);let d=await pe(r,{method:"PATCH",headers:g,body:JSON.stringify(i)},ee,n),c=await d.json();if(!d.ok){let u=c.error;throw n&&console.error(`[Gotcha] Error: ${u.code} - ${u.message}`),u}return n&&console.log("[Gotcha] Response updated:",c),c},getBaseUrl(){return l}}}var Ae=react.createContext(null);function qe({apiKey:e,children:a,baseUrl:l,debug:n=false,disabled:g=false,defaultUser:b={}}){let[t,i]=react.useState(null),s=react.useMemo(()=>Ie({apiKey:e,baseUrl:l,debug:n}),[e,l,n]),r=react.useCallback(u=>{i(u);},[]),d=react.useCallback(()=>{i(null);},[]),c=react.useMemo(()=>({client:s,disabled:g,defaultUser:b,debug:n,activeModalId:t,openModal:r,closeModal:d}),[s,g,b,n,t,r,d]);return jsxRuntime.jsx(Ae.Provider,{value:c,children:a})}function U(){let e=react.useContext(Ae);if(!e)throw new Error("useGotchaContext must be used within a GotchaProvider");return e}function Oe(e){let{client:a,defaultUser:l}=U(),[n,g]=react.useState(false),[b,t]=react.useState(false),[i,s]=react.useState(null),[r,d]=react.useState(null);return react.useEffect(()=>{let u=e.user?.id||l?.id;if(!u){d(null);return}let p=false;return (async()=>{t(true);try{let f=await a.checkExistingResponse(e.elementId,u);p||d(f);}catch{p||d(null);}finally{p||t(false);}})(),()=>{p=true;}},[a,e.elementId,e.user?.id,l?.id]),{submit:react.useCallback(async u=>{g(true),s(null);try{let p=e.user?.id||l?.id,m;return r&&p?m=await a.updateResponse(r.id,{content:u.content,title:u.title,rating:u.rating,vote:u.vote,pollSelected:u.pollSelected},p):m=await a.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,experimentId:e.experimentId,variant:e.variant,user:{...l,...e.user}}),e.onSuccess?.(m),m}catch(p){let m=p instanceof Error?p.message:"Something went wrong";throw s(m),e.onError?.(p instanceof Error?p:new Error(m)),p}finally{g(false);}},[a,l,e,r]),isLoading:n,isCheckingExisting:b,error:i,existingResponse:r,isEditing:!!r,clearError:()=>s(null)}}function oe(...e){return e.filter(Boolean).join(" ")}var A=()=>typeof window>"u"?false:"ontouchstart"in window||navigator.maxTouchPoints>0,_e=(e,a)=>{let l={sm:{desktop:24,mobile:32},md:{desktop:32,mobile:36},lg:{desktop:40,mobile:40}};return a?l[e].mobile:l[e].desktop};function tt(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ue({size:e,theme:a,customStyles:l,showOnHover:n,touchBehavior:g,onClick:b,isOpen:t,isParentHovered:i=false}){let[s,r]=react.useState(false),[d,c]=react.useState(false),[u,p]=react.useState(tt);react.useEffect(()=>{r(A());let C=window.matchMedia("(prefers-color-scheme: dark)"),h=G=>p(G.matches?"dark":"light");return C.addEventListener("change",h),()=>C.removeEventListener("change",h)},[]);let m=t?true:!s&&n?i:s&&g==="tap-to-reveal"?d:true,f=()=>{if(s&&g==="tap-to-reveal"&&!d){c(true);return}b();},o=_e(e,s),v=(a==="auto"?u:a)==="dark",I={width:o,height:o,borderRadius:"50%",border:v?"1px solid rgba(255,255,255,0.15)":"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",background:v?"linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 60%, rgba(0,0,0,0.05) 100%)":"linear-gradient(160deg, rgba(255,255,255,0.7) 0%, rgba(200,210,230,0.4) 40%, rgba(180,192,220,0.5) 100%)",backdropFilter:"blur(16px) saturate(170%)",WebkitBackdropFilter:"blur(16px) saturate(170%)",color:v?"rgba(255,255,255,0.88)":"rgba(0,0,0,0.75)",boxShadow:v?"0 4px 14px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.35)":"0 3px 12px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.2)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",opacity:m?1:0,transform:m?"scale(1)":"scale(0.6)",pointerEvents:m?"auto":"none",...l?.button};return jsxRuntime.jsx("button",{type:"button",onClick:f,style:I,className:oe("gotcha-button",t&&"gotcha-button--open"),"aria-label":"Give feedback on this feature","aria-expanded":t,"aria-haspopup":"dialog",children:jsxRuntime.jsx(nt,{size:o*.65})})}var De="gotcha-carter-one";function ot(){react.useEffect(()=>{if(document.getElementById(De))return;let e=document.createElement("link");e.id=De,e.rel="stylesheet",e.href="https://fonts.googleapis.com/css2?family=Carter+One&display=swap",document.head.appendChild(e);},[]);}function nt({size:e}){return ot(),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"},children:"G"})}function D({size:e=16,color:a="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("style",{children:`
2
2
  @keyframes gotcha-spin {
3
3
  from { transform: rotate(0deg); }
4
4
  to { transform: rotate(360deg); }
@@ -8,5 +8,5 @@
8
8
  50% { stroke-dasharray: 40, 62; stroke-dashoffset: -12; }
9
9
  100% { stroke-dasharray: 1, 62; stroke-dashoffset: -62; }
10
10
  }
11
- `}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:a,strokeWidth:"2",strokeOpacity:"0.12"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:a,strokeWidth:"2",strokeLinecap:"round",style:{animation:"gotcha-dash 1.2s ease-in-out infinite"}})]})}function ze({theme:e,placeholder:a,submitText:l,isLoading:o,onSubmit:b,customStyles:m,initialValues:t,isEditing:c=false}){let[n,u]=react.useState(t?.content||""),[d,s]=react.useState(t?.rating??null),[i,f]=react.useState(false);react.useEffect(()=>{f(I());},[]),react.useEffect(()=>{t?.content!==void 0&&u(t.content||""),t?.rating!==void 0&&s(t.rating??null);},[t?.content,t?.rating]);let p=e==="dark",g=h=>{h.preventDefault(),!(!n.trim()&&d===null)&&b({content:n.trim()||void 0,rating:d??void 0});},r={width:"100%",padding:i?"12px 14px":"10px 12px",border:`1px solid ${p?"rgba(255,255,255,0.08)":"#e2e8f0"}`,borderRadius:8,backgroundColor:p?"rgba(55,65,81,0.5)":"#fafbfc",color:p?"#f9fafb":"#111827",fontSize:i?16:14,resize:"vertical",minHeight:i?100:80,fontFamily:"inherit",outline:"none",transition:"border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1)",lineHeight:1.5,...m?.input},v={width:"100%",padding:i?"14px 16px":"10px 16px",border:"none",borderRadius:8,backgroundColor:p?"#e2e8f0":"#1e293b",color:p?"#1e293b":"#ffffff",fontSize:i?16:14,fontWeight:500,cursor:o?"not-allowed":"pointer",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",letterSpacing:"0.01em",...m?.submitButton};return jsxRuntime.jsxs("form",{onSubmit:g,children:[jsxRuntime.jsx("div",{style:{marginBottom:i?16:12},children:jsxRuntime.jsx(nt,{value:d,onChange:s,isDark:p,isTouch:i})}),jsxRuntime.jsx("textarea",{value:n,onChange:h=>u(h.target.value),placeholder:a||"Share your thoughts...",style:r,disabled:o,"aria-label":"Your feedback",onFocus:h=>{h.currentTarget.style.borderColor="#1e293b",h.currentTarget.style.boxShadow="0 0 0 2px rgba(30,41,59,0.15)",h.currentTarget.style.backgroundColor=p?"rgba(55,65,81,0.7)":"#ffffff";},onBlur:h=>{h.currentTarget.style.borderColor=p?"rgba(255,255,255,0.08)":"#e2e8f0",h.currentTarget.style.boxShadow="none",h.currentTarget.style.backgroundColor=p?"rgba(55,65,81,0.5)":"#fafbfc";}}),jsxRuntime.jsxs("button",{type:"submit",disabled:o||!n.trim()&&d===null,style:{...v,marginTop:12,opacity:o?.8:1,backgroundColor:!n.trim()&&d===null?p?"#374151":"#e2e8f0":p?"#e2e8f0":"#1e293b",color:!n.trim()&&d===null?p?"#6b7280":"#94a3b8":p?"#1e293b":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",gap:8},onMouseEnter:h=>{h.currentTarget.disabled||(h.currentTarget.style.backgroundColor=p?"#cbd5e1":"#334155");},onMouseLeave:h=>{h.currentTarget.disabled||(h.currentTarget.style.backgroundColor=p?"#e2e8f0":"#1e293b");},children:[o&&jsxRuntime.jsx(_,{size:i?18:16,color:p?"#1e293b":"#ffffff"}),o?c?"Updating...":"Submitting...":c?"Update":l]})]})}function nt({value:e,onChange:a,isDark:l,isTouch:o}){let[b,m]=react.useState(null),t=o?28:18,c=o?6:3;return jsxRuntime.jsx("div",{style:{display:"flex",gap:o?6:2},role:"group","aria-label":"Rating",children:[1,2,3,4,5].map(n=>{let u=(b??e??0)>=n;return jsxRuntime.jsx("button",{type:"button",onClick:()=>a(n),onMouseEnter:()=>m(n),onMouseLeave:()=>m(null),"aria-label":`Rate ${n} out of 5`,"aria-pressed":e===n,style:{background:"none",border:"none",cursor:"pointer",padding:c,color:u?"#f59e0b":l?"rgba(255,255,255,0.12)":"#e2e8f0",transition:"color 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1)",transform:b!==null&&b>=n?"scale(1.1)":"scale(1)"},children:jsxRuntime.jsx("svg",{width:t,height:t,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"})})},n)})})}function Ne({theme:e,isLoading:a,onSubmit:l,initialVote:o,isEditing:b=false,labels:m}){let[t,c]=react.useState(false),[n,u]=react.useState(o||null),[d,s]=react.useState(o||null);react.useEffect(()=>{c(I());},[]),react.useEffect(()=>{o!==void 0&&(s(o),u(o));},[o]),react.useEffect(()=>{!a&&!b&&u(null);},[a,b]);let i=r=>{u(r),l({vote:r});},f=e==="dark",p=r=>{let v=d===r;return {flex:1,minWidth:0,overflow:"hidden",padding:t?"14px 18px":"10px 14px",border:`1px solid ${v?r==="up"?f?"rgba(16,185,129,0.3)":"rgba(16,185,129,0.25)":f?"rgba(239,68,68,0.3)":"rgba(239,68,68,0.25)":f?"rgba(255,255,255,0.08)":"#e2e8f0"}`,borderRadius:t?10:8,backgroundColor:v?r==="up"?f?"rgba(16,185,129,0.08)":"rgba(16,185,129,0.06)":f?"rgba(239,68,68,0.08)":"rgba(239,68,68,0.06)":f?"rgba(55,65,81,0.5)":"#fafbfc",color:v?r==="up"?"#10b981":"#ef4444":f?"#d1d5db":"#64748b",fontSize:t?28:24,cursor:a?"not-allowed":"pointer",transition:"background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:t?10:8}},g=t?24:20;return jsxRuntime.jsxs("div",{style:{display:"flex",gap:t?12:10},role:"group","aria-label":"Vote",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i("up"),disabled:a,style:p("up"),"aria-label":"Vote up - I like this","aria-pressed":d==="up",onMouseEnter:r=>{a||(r.currentTarget.style.transform="translateY(-1px)",r.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.06)");},onMouseLeave:r=>{r.currentTarget.style.transform="translateY(0)",r.currentTarget.style.boxShadow="none";},children:a&&n==="up"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(_,{size:g,color:f?"#f9fafb":"#111827"}),jsxRuntime.jsx("span",{style:{fontSize:t?15:13,fontWeight:500,letterSpacing:"0.01em"},children:b?"Updating...":"Sending..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(rt,{size:g}),jsxRuntime.jsx("span",{style:{fontSize:t?15:13,fontWeight:500,letterSpacing:"0.01em"},children:m?.up||(d==="up"?"Liked":"Like")})]})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>i("down"),disabled:a,style:p("down"),"aria-label":"Vote down - I don't like this","aria-pressed":d==="down",onMouseEnter:r=>{a||(r.currentTarget.style.transform="translateY(-1px)",r.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.06)");},onMouseLeave:r=>{r.currentTarget.style.transform="translateY(0)",r.currentTarget.style.boxShadow="none";},children:a&&n==="down"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(_,{size:g,color:f?"#f9fafb":"#111827"}),jsxRuntime.jsx("span",{style:{fontSize:t?15:13,fontWeight:500,letterSpacing:"0.01em"},children:b?"Updating...":"Sending..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(st,{size:g}),jsxRuntime.jsx("span",{style:{fontSize:t?15:13,fontWeight:500,letterSpacing:"0.01em"},children:m?.down||(d==="down"?"Disliked":"Dislike")})]})})]})}function rt({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 st({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 $e({theme:e,options:a,allowMultiple:l,isLoading:o,onSubmit:b,initialSelected:m,isEditing:t=false}){let[c,n]=react.useState(m||[]),[u,d]=react.useState(false);react.useEffect(()=>{d(I());},[]),react.useEffect(()=>{m&&n(m);},[m]);let s=e==="dark",i=g=>{n(l?r=>r.includes(g)?r.filter(v=>v!==g):[...r,g]:r=>r.includes(g)?[]:[g]);},f=()=>{c.length!==0&&b({pollSelected:c});},p=g=>{let r=c.includes(g);return {width:"100%",padding:u?"12px 14px":"9px 12px",border:`1px solid ${r?s?"rgba(226,232,240,0.25)":"rgba(30,41,59,0.25)":s?"rgba(255,255,255,0.08)":"#e2e8f0"}`,borderRadius:u?10:8,backgroundColor:r?s?"rgba(226,232,240,0.08)":"rgba(30,41,59,0.05)":s?"rgba(55,65,81,0.5)":"#fafbfc",color:r?s?"#e2e8f0":"#1e293b":s?"#d1d5db":"#374151",fontSize:u?15:13,fontWeight:500,cursor:o?"not-allowed":"pointer",transition:"background-color 0.2s, border-color 0.2s, color 0.2s",textAlign:"left",letterSpacing:"0.01em",display:"flex",alignItems:"center",gap:8}};return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",gap:u?8:6},role:"group","aria-label":l?"Select one or more options":"Select an option",children:a.map(g=>{let r=c.includes(g);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(g),disabled:o,style:p(g),"aria-pressed":r,children:[jsxRuntime.jsx("span",{style:{width:16,height:16,borderRadius:l?4:"50%",border:`2px solid ${r?s?"#e2e8f0":"#1e293b":s?"rgba(255,255,255,0.2)":"#cbd5e1"}`,backgroundColor:r?s?"#e2e8f0":"#1e293b":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.15s"},children:r&&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"})})}),g]},g)})}),jsxRuntime.jsxs("button",{type:"button",onClick:f,disabled:o||c.length===0,style:{width:"100%",marginTop:12,padding:u?"14px 16px":"10px 16px",border:"none",borderRadius:8,backgroundColor:c.length===0?s?"#374151":"#e2e8f0":s?"#e2e8f0":"#1e293b",color:c.length===0?s?"#6b7280":"#94a3b8":s?"#1e293b":"#ffffff",fontSize:u?16:14,fontWeight:500,cursor:o||c.length===0?"not-allowed":"pointer",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",letterSpacing:"0.01em",display:"flex",alignItems:"center",justifyContent:"center",gap:8,opacity:o?.8:1},onMouseEnter:g=>{g.currentTarget.disabled||(g.currentTarget.style.backgroundColor=s?"#cbd5e1":"#334155");},onMouseLeave:g=>{g.currentTarget.disabled||(g.currentTarget.style.backgroundColor=c.length===0?s?"#374151":"#e2e8f0":s?"#e2e8f0":"#1e293b");},children:[o&&jsxRuntime.jsx(_,{size:u?18:16,color:s?"#1e293b":"#ffffff"}),o?t?"Updating...":"Submitting...":t?"Update":"Submit"]})]})}function xe({mode:e,theme:a,customStyles:l,promptText:o,placeholder:b,submitText:m,thankYouMessage:t,isLoading:c,isSubmitted:n,error:u,existingResponse:d,isEditing:s=false,voteLabels:i,options:f,allowMultiple:p=false,onSubmit:g,onClose:r,anchorRect:v}){let h=react.useRef(null),P=react.useRef(null),[C,A]=react.useState(false),[S,se]=react.useState(false),[ae,F]=react.useState("light");react.useEffect(()=>{se(window.innerWidth<640);let x=window.matchMedia("(prefers-color-scheme: dark)");F(x.matches?"dark":"light");let w=E=>F(E.matches?"dark":"light");return x.addEventListener("change",w),()=>x.removeEventListener("change",w)},[]),react.useEffect(()=>{let x=requestAnimationFrame(()=>A(true));return ()=>cancelAnimationFrame(x)},[]);let O=a==="auto"?ae:a,y=O==="dark",V=(v?window.innerHeight-v.bottom:window.innerHeight/2)<280+20;react.useEffect(()=>{let x=h.current;if(!x)return;P.current?.focus();let w=E=>{if(E.key==="Escape"){r();return}if(E.key==="Tab"){let D=x.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),z=D[0],N=D[D.length-1];E.shiftKey&&document.activeElement===z?(E.preventDefault(),N?.focus()):!E.shiftKey&&document.activeElement===N&&(E.preventDefault(),z?.focus());}};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]);let K=e==="vote"?"What do you think?":e==="poll"?"Cast your vote":"What do you think of this feature?",U=S?20:16,X=y?"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 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)",j=S?{position:"fixed",left:"50%",top:"50%",width:"calc(100vw - 32px)",maxWidth:320,padding:U,borderRadius:12,backgroundColor:y?"#1f2937":"#ffffff",color:y?"#f9fafb":"#111827",boxShadow:X,border:`1px solid ${y?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,zIndex:9999,transition:"opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)",opacity:C?1:0,transform:C?"translate(-50%, -50%) scale(1)":"translate(-50%, -50%) scale(0.96)",...l?.modal,textAlign:"left"}:{position:"absolute",left:"50%",width:320,padding:U,borderRadius:10,backgroundColor:y?"#1f2937":"#ffffff",color:y?"#f9fafb":"#111827",boxShadow:X,border:`1px solid ${y?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,zIndex:9999,...V?{bottom:"100%",marginBottom:8}:{top:"100%",marginTop:8},transition:"opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)",opacity:C?1:0,transform:C?"translateX(-50%) scale(1) translateY(0)":`translateX(-50%) scale(0.96) translateY(${V?"6px":"-6px"})`,...l?.modal,textAlign:"left"};return jsxRuntime.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-labelledby":"gotcha-modal-title",style:j,className:ee("gotcha-modal",y&&"gotcha-modal--dark"),children:[jsxRuntime.jsx("button",{ref:P,type:"button",onClick:r,"aria-label":"Close feedback form",style:{position:"absolute",top:S?12:8,right:S?12:8,width:S?36:28,height:S?36:28,border:"none",background:"transparent",cursor:"pointer",color:y?"#6b7280":"#9ca3af",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseEnter:x=>{x.currentTarget.style.backgroundColor=y?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)",x.currentTarget.style.color=y?"#9ca3af":"#6b7280";},onMouseLeave:x=>{x.currentTarget.style.backgroundColor="transparent",x.currentTarget.style.color=y?"#6b7280":"#9ca3af";},children:jsxRuntime.jsx("svg",{width:S?16:12,height:S?16:12,viewBox:"0 0 14 14",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 1L13 13M1 13L13 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),jsxRuntime.jsx("h2",{id:"gotcha-modal-title",style:{margin:"0 0 16px 0",fontSize:S?16:14,fontWeight:600,paddingRight:S?40:32,letterSpacing:"-0.01em",lineHeight:1.4,textAlign:"left"},children:o||K}),n&&jsxRuntime.jsxs("div",{style:{textAlign:"center",padding:"24px 0",color:y?"#10b981":"#059669"},children:[jsxRuntime.jsx("div",{style:{width:44,height:44,borderRadius:"50%",backgroundColor:y?"rgba(16,185,129,0.1)":"rgba(5,150,105,0.08)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 12px"},children:jsxRuntime.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M20 6L9 17L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:13,fontWeight:500,color:y?"#d1d5db":"#374151"},children:t})]}),u&&!n&&jsxRuntime.jsx("div",{style:{padding:"8px 10px",marginBottom:12,borderRadius:8,backgroundColor:y?"rgba(127,29,29,0.3)":"#fef2f2",border:`1px solid ${y?"rgba(254,202,202,0.1)":"rgba(220,38,38,0.1)"}`,color:y?"#fecaca":"#dc2626",fontSize:13,lineHeight:1.4},children:u}),!n&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e==="feedback"&&jsxRuntime.jsx(ze,{theme:O,placeholder:b,submitText:m,isLoading:c,onSubmit:g,customStyles:l,initialValues:d?{content:d.content,rating:d.rating}:void 0,isEditing:s}),e==="vote"&&jsxRuntime.jsx(Ne,{theme:O,isLoading:c,onSubmit:g,initialVote:d?.vote||void 0,isEditing:s,labels:i}),e==="poll"&&f&&f.length>0&&jsxRuntime.jsx($e,{theme:O,options:f,allowMultiple:p,isLoading:c,onSubmit:g,initialSelected:d?.pollSelected||void 0,isEditing:s})]}),jsxRuntime.jsxs("div",{"aria-live":"polite",className:"sr-only",style:{position:"absolute",left:-9999},children:[n&&"Thank you! Your feedback has been submitted.",u&&`Error: ${u}`]})]})}function ct({elementId:e,user:a,mode:l="feedback",experimentId:o,variant:b,voteLabels:m,options:t,allowMultiple:c=false,showResults:n=true,position:u=M.POSITION,size:d=M.SIZE,theme:s=M.THEME,customStyles:i,visible:f=true,showOnHover:p=M.SHOW_ON_HOVER,touchBehavior:g=M.TOUCH_BEHAVIOR,promptText:r,placeholder:v,submitText:h=M.SUBMIT_TEXT,thankYouMessage:P=M.THANK_YOU_MESSAGE,onSubmit:C,onOpen:A,onClose:S,onError:se}){let{disabled:ae,activeModalId:F,openModal:O,closeModal:y}=L(),[ie,W]=react.useState(false),[V,K]=react.useState(false),[U,X]=react.useState(null),[j,x]=react.useState(false),w=react.useRef(null);react.useEffect(()=>{x(window.innerWidth<640);},[]);let E=F===e;react.useEffect(()=>{if(!p)return;let R=w.current;if(!R)return;let B=R.parentElement;if(!B)return;let Ee=()=>K(true),Re=()=>K(false);return B.addEventListener("mouseenter",Ee),B.addEventListener("mouseleave",Re),()=>{B.removeEventListener("mouseenter",Ee),B.removeEventListener("mouseleave",Re);}},[p]);let{submit:D,isLoading:z,error:N,existingResponse:ve,isEditing:Q}=Pe({elementId:e,mode:l,experimentId:o,variant:b,pollOptions:t,user:a,onSuccess:R=>{W(true),C?.(R),setTimeout(()=>{y(),W(false);},3e3);},onError:R=>{console.warn("[Gotcha] Submission failed:",R instanceof Error?R.message:R),se?.(R);}}),We=react.useCallback(()=>{w.current&&X(w.current.getBoundingClientRect()),O(e),A?.();},[e,O,A]),le=react.useCallback(()=>{y(),W(false),S?.();},[y,S]),ke=react.useCallback(R=>{D(R);},[D]);return ae||!f?null:jsxRuntime.jsxs("div",{ref:w,style:{...{"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"}}[u],zIndex:E?1e4:"auto"},className:"gotcha-container","data-gotcha-element":e,children:[jsxRuntime.jsx(De,{size:d,theme:s,customStyles:i,showOnHover:p,touchBehavior:g,onClick:We,isOpen:E,isParentHovered:V}),E&&!j&&jsxRuntime.jsx(xe,{mode:l,theme:s,customStyles:i,promptText:r,placeholder:v,submitText:h,thankYouMessage:Q?"Your feedback has been updated!":P,isLoading:z,isSubmitted:ie,error:N,existingResponse:ve,isEditing:Q,voteLabels:m,options:t,allowMultiple:c,onSubmit:ke,onClose:le,anchorRect:U||void 0}),E&&j&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",inset:0,zIndex:99999,backgroundColor:"rgba(0, 0, 0, 0.3)"},onClick:le,"aria-hidden":"true",children:jsxRuntime.jsx("div",{onClick:R=>R.stopPropagation(),children:jsxRuntime.jsx(xe,{mode:l,theme:s,customStyles:i,promptText:r,placeholder:v,submitText:h,thankYouMessage:Q?"Your feedback has been updated!":P,isLoading:z,isSubmitted:ie,error:N,existingResponse:ve,isEditing:Q,voteLabels:m,options:t,allowMultiple:c,onSubmit:ke,onClose:le,anchorRect:U||void 0})})}),document.body)]})}function ut(){let{client:e,disabled:a,defaultUser:l,debug:o}=L();return {client:e,disabled:a,defaultUser:l,debug:o,submitFeedback:e.submitResponse.bind(e)}}exports.Gotcha=ct;exports.GotchaProvider=je;exports.useGotcha=ut;//# sourceMappingURL=index.js.map
11
+ `}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:a,strokeWidth:"2",strokeOpacity:"0.12"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:a,strokeWidth:"2",strokeLinecap:"round",style:{animation:"gotcha-dash 1.2s ease-in-out infinite"}})]})}function Be({theme:e,placeholder:a,submitText:l,isLoading:n,onSubmit:g,customStyles:b,initialValues:t,isEditing:i=false,showText:s=true,showRating:r=true}){let[d,c]=react.useState(t?.content||""),[u,p]=react.useState(t?.rating??null),[m,f]=react.useState(false);react.useEffect(()=>{f(A());},[]),react.useEffect(()=>{t?.content!==void 0&&c(t.content||""),t?.rating!==void 0&&p(t.rating??null);},[t?.content,t?.rating]);let o=e==="dark",x=s&&r?d.trim().length>0||u!==null:s?d.trim().length>0:r?u!==null:false,v=h=>{h.preventDefault(),x&&g({content:s&&d.trim()?d.trim():void 0,rating:r&&u!==null?u:void 0});},I={width:"100%",padding:m?"12px 14px":"10px 12px",border:`1px solid ${o?"rgba(255,255,255,0.08)":"#e2e8f0"}`,borderRadius:8,backgroundColor:o?"rgba(55,65,81,0.5)":"#fafbfc",color:o?"#f9fafb":"#111827",fontSize:m?16:14,resize:"vertical",minHeight:m?100:80,fontFamily:"inherit",outline:"none",transition:"border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1)",lineHeight:1.5,...b?.input},C={width:"100%",padding:m?"14px 16px":"10px 16px",border:"none",borderRadius:8,backgroundColor:o?"#e2e8f0":"#1e293b",color:o?"#1e293b":"#ffffff",fontSize:m?16:14,fontWeight:500,cursor:n?"not-allowed":"pointer",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",letterSpacing:"0.01em",...b?.submitButton};return jsxRuntime.jsxs("form",{onSubmit:v,children:[r&&jsxRuntime.jsx("div",{style:{marginBottom:s?m?16:12:0,...s?{}:{display:"flex",justifyContent:"center",padding:"8px 0"}},children:jsxRuntime.jsx(st,{value:u,onChange:p,isDark:o,isTouch:m,large:!s})}),s&&jsxRuntime.jsx("textarea",{value:d,onChange:h=>c(h.target.value),placeholder:a||"Share your thoughts...",style:I,disabled:n,"aria-label":"Your feedback",onFocus:h=>{h.currentTarget.style.borderColor="#1e293b",h.currentTarget.style.boxShadow="0 0 0 2px rgba(30,41,59,0.15)",h.currentTarget.style.backgroundColor=o?"rgba(55,65,81,0.7)":"#ffffff";},onBlur:h=>{h.currentTarget.style.borderColor=o?"rgba(255,255,255,0.08)":"#e2e8f0",h.currentTarget.style.boxShadow="none",h.currentTarget.style.backgroundColor=o?"rgba(55,65,81,0.5)":"#fafbfc";}}),jsxRuntime.jsxs("button",{type:"submit",disabled:n||!x,style:{...C,marginTop:12,opacity:n?.8:1,backgroundColor:x?o?"#e2e8f0":"#1e293b":o?"#374151":"#e2e8f0",color:x?o?"#1e293b":"#ffffff":o?"#6b7280":"#94a3b8",display:"flex",alignItems:"center",justifyContent:"center",gap:8},onMouseEnter:h=>{h.currentTarget.disabled||(h.currentTarget.style.backgroundColor=o?"#cbd5e1":"#334155");},onMouseLeave:h=>{h.currentTarget.disabled||(h.currentTarget.style.backgroundColor=o?"#e2e8f0":"#1e293b");},children:[n&&jsxRuntime.jsx(D,{size:m?18:16,color:o?"#1e293b":"#ffffff"}),n?i?"Updating...":"Submitting...":i?"Update":l]})]})}function st({value:e,onChange:a,isDark:l,isTouch:n,large:g=false}){let[b,t]=react.useState(null),i=g?n?36:28:n?28:18,s=g?n?8:5:n?6:3;return jsxRuntime.jsx("div",{style:{display:"flex",gap:g?n?8:6:n?6:2},role:"group","aria-label":"Rating",children:[1,2,3,4,5].map(r=>{let d=(b??e??0)>=r;return jsxRuntime.jsx("button",{type:"button",onClick:()=>a(r),onMouseEnter:()=>t(r),onMouseLeave:()=>t(null),"aria-label":`Rate ${r} out of 5`,"aria-pressed":e===r,style:{background:"none",border:"none",cursor:"pointer",padding:s,color:d?"#f59e0b":l?"rgba(255,255,255,0.12)":"#e2e8f0",transition:"color 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1)",transform:b!==null&&b>=r?"scale(1.1)":"scale(1)"},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"})})},r)})})}function He({theme:e,isLoading:a,onSubmit:l,initialVote:n,isEditing:g=false,labels:b}){let[t,i]=react.useState(false),[s,r]=react.useState(n||null),[d,c]=react.useState(n||null);react.useEffect(()=>{i(A());},[]),react.useEffect(()=>{n!==void 0&&(c(n),r(n));},[n]),react.useEffect(()=>{!a&&!g&&r(null);},[a,g]);let u=o=>{r(o),l({vote:o});},p=e==="dark",m=o=>{let x=d===o;return {flex:1,minWidth:0,overflow:"hidden",padding:t?"14px 18px":"10px 14px",border:`1px solid ${x?o==="up"?p?"rgba(16,185,129,0.3)":"rgba(16,185,129,0.25)":p?"rgba(239,68,68,0.3)":"rgba(239,68,68,0.25)":p?"rgba(255,255,255,0.08)":"#e2e8f0"}`,borderRadius:t?10:8,backgroundColor:x?o==="up"?p?"rgba(16,185,129,0.08)":"rgba(16,185,129,0.06)":p?"rgba(239,68,68,0.08)":"rgba(239,68,68,0.06)":p?"rgba(55,65,81,0.5)":"#fafbfc",color:x?o==="up"?"#10b981":"#ef4444":p?"#d1d5db":"#64748b",fontSize:t?28:24,cursor:a?"not-allowed":"pointer",transition:"background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:t?10:8}},f=t?24:20;return jsxRuntime.jsxs("div",{style:{display:"flex",gap:t?12:10},role:"group","aria-label":"Vote",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>u("up"),disabled:a,style:m("up"),"aria-label":"Vote up - I like this","aria-pressed":d==="up",onMouseEnter:o=>{a||(o.currentTarget.style.transform="translateY(-1px)",o.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.06)");},onMouseLeave:o=>{o.currentTarget.style.transform="translateY(0)",o.currentTarget.style.boxShadow="none";},children:a&&s==="up"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(D,{size:f,color:p?"#f9fafb":"#111827"}),jsxRuntime.jsx("span",{style:{fontSize:t?15:13,fontWeight:500,letterSpacing:"0.01em"},children:g?"Updating...":"Sending..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(at,{size:f}),jsxRuntime.jsx("span",{style:{fontSize:t?15:13,fontWeight:500,letterSpacing:"0.01em"},children:b?.up||(d==="up"?"Liked":"Like")})]})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>u("down"),disabled:a,style:m("down"),"aria-label":"Vote down - I don't like this","aria-pressed":d==="down",onMouseEnter:o=>{a||(o.currentTarget.style.transform="translateY(-1px)",o.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.06)");},onMouseLeave:o=>{o.currentTarget.style.transform="translateY(0)",o.currentTarget.style.boxShadow="none";},children:a&&s==="down"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(D,{size:f,color:p?"#f9fafb":"#111827"}),jsxRuntime.jsx("span",{style:{fontSize:t?15:13,fontWeight:500,letterSpacing:"0.01em"},children:g?"Updating...":"Sending..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(it,{size:f}),jsxRuntime.jsx("span",{style:{fontSize:t?15:13,fontWeight:500,letterSpacing:"0.01em"},children:b?.down||(d==="down"?"Disliked":"Dislike")})]})})]})}function at({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 it({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 Fe({theme:e,options:a,allowMultiple:l,isLoading:n,onSubmit:g,initialSelected:b,isEditing:t=false}){let[i,s]=react.useState(b||[]),[r,d]=react.useState(false);react.useEffect(()=>{d(A());},[]),react.useEffect(()=>{b&&s(b);},[b]);let c=e==="dark",u=f=>{s(l?o=>o.includes(f)?o.filter(x=>x!==f):[...o,f]:o=>o.includes(f)?[]:[f]);},p=()=>{i.length!==0&&g({pollSelected:i});},m=f=>{let o=i.includes(f);return {width:"100%",padding:r?"12px 14px":"9px 12px",border:`1px solid ${o?c?"rgba(226,232,240,0.25)":"rgba(30,41,59,0.25)":c?"rgba(255,255,255,0.08)":"#e2e8f0"}`,borderRadius:r?10:8,backgroundColor:o?c?"rgba(226,232,240,0.08)":"rgba(30,41,59,0.05)":c?"rgba(55,65,81,0.5)":"#fafbfc",color:o?c?"#e2e8f0":"#1e293b":c?"#d1d5db":"#374151",fontSize:r?15:13,fontWeight:500,cursor:n?"not-allowed":"pointer",transition:"background-color 0.2s, border-color 0.2s, color 0.2s",textAlign:"left",letterSpacing:"0.01em",display:"flex",alignItems:"center",gap:8}};return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",gap:r?8:6},role:"group","aria-label":l?"Select one or more options":"Select an option",children:a.map(f=>{let o=i.includes(f);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>u(f),disabled:n,style:m(f),"aria-pressed":o,children:[jsxRuntime.jsx("span",{style:{width:16,height:16,borderRadius:l?4:"50%",border:`2px solid ${o?c?"#e2e8f0":"#1e293b":c?"rgba(255,255,255,0.2)":"#cbd5e1"}`,backgroundColor:o?c?"#e2e8f0":"#1e293b":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.15s"},children:o&&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"})})}),f]},f)})}),jsxRuntime.jsxs("button",{type:"button",onClick:p,disabled:n||i.length===0,style:{width:"100%",marginTop:12,padding:r?"14px 16px":"10px 16px",border:"none",borderRadius:8,backgroundColor:i.length===0?c?"#374151":"#e2e8f0":c?"#e2e8f0":"#1e293b",color:i.length===0?c?"#6b7280":"#94a3b8":c?"#1e293b":"#ffffff",fontSize:r?16:14,fontWeight:500,cursor:n||i.length===0?"not-allowed":"pointer",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",letterSpacing:"0.01em",display:"flex",alignItems:"center",justifyContent:"center",gap:8,opacity:n?.8:1},onMouseEnter:f=>{f.currentTarget.disabled||(f.currentTarget.style.backgroundColor=c?"#cbd5e1":"#334155");},onMouseLeave:f=>{f.currentTarget.disabled||(f.currentTarget.style.backgroundColor=i.length===0?c?"#374151":"#e2e8f0":c?"#e2e8f0":"#1e293b");},children:[n&&jsxRuntime.jsx(D,{size:r?18:16,color:c?"#1e293b":"#ffffff"}),n?t?"Updating...":"Submitting...":t?"Update":"Submit"]})]})}function ve({mode:e,theme:a,customStyles:l,promptText:n,placeholder:g,submitText:b,thankYouMessage:t,isLoading:i,isSubmitted:s,error:r,existingResponse:d,isEditing:c=false,showText:u=true,showRating:p=true,voteLabels:m,options:f,allowMultiple:o=false,onSubmit:x,onClose:v,anchorRect:I}){let C=react.useRef(null),h=react.useRef(null),[G,W]=react.useState(false),[E,ie]=react.useState(false),[le,V]=react.useState("light");react.useEffect(()=>{ie(window.innerWidth<640);let S=window.matchMedia("(prefers-color-scheme: dark)");V(S.matches?"dark":"light");let M=R=>V(R.matches?"dark":"light");return S.addEventListener("change",M),()=>S.removeEventListener("change",M)},[]),react.useEffect(()=>{let S=requestAnimationFrame(()=>W(true));return ()=>cancelAnimationFrame(S)},[]);let _=a==="auto"?le:a,y=_==="dark",j=(I?window.innerHeight-I.bottom:window.innerHeight/2)<280+20;react.useEffect(()=>{let S=C.current;if(!S)return;h.current?.focus();let M=R=>{if(R.key==="Escape"){v();return}if(R.key==="Tab"){let L=S.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),N=L[0],B=L[L.length-1];R.shiftKey&&document.activeElement===N?(R.preventDefault(),B?.focus()):!R.shiftKey&&document.activeElement===B&&(R.preventDefault(),N?.focus());}};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[v]);let X=e==="vote"?"What do you think?":e==="poll"?"Cast your vote":"What do you think of this feature?",z=E?20:16,Q=y?"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 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)",q=E?{position:"fixed",left:"50%",top:"50%",width:"calc(100vw - 32px)",maxWidth:320,padding:z,borderRadius:12,backgroundColor:y?"#1f2937":"#ffffff",color:y?"#f9fafb":"#111827",boxShadow:Q,border:`1px solid ${y?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,zIndex:9999,transition:"opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)",opacity:G?1:0,transform:G?"translate(-50%, -50%) scale(1)":"translate(-50%, -50%) scale(0.96)",...l?.modal,textAlign:"left"}:{position:"absolute",left:"50%",width:320,padding:z,borderRadius:10,backgroundColor:y?"#1f2937":"#ffffff",color:y?"#f9fafb":"#111827",boxShadow:Q,border:`1px solid ${y?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`,zIndex:9999,...j?{bottom:"100%",marginBottom:8}:{top:"100%",marginTop:8},transition:"opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)",opacity:G?1:0,transform:G?"translateX(-50%) scale(1) translateY(0)":`translateX(-50%) scale(0.96) translateY(${j?"6px":"-6px"})`,...l?.modal,textAlign:"left"};return jsxRuntime.jsxs("div",{ref:C,role:"dialog","aria-modal":"true","aria-labelledby":"gotcha-modal-title",style:q,className:oe("gotcha-modal",y&&"gotcha-modal--dark"),children:[jsxRuntime.jsx("button",{ref:h,type:"button",onClick:v,"aria-label":"Close feedback form",style:{position:"absolute",top:E?12:8,right:E?12:8,width:E?36:28,height:E?36:28,border:"none",background:"transparent",cursor:"pointer",color:y?"#6b7280":"#9ca3af",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseEnter:S=>{S.currentTarget.style.backgroundColor=y?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.04)",S.currentTarget.style.color=y?"#9ca3af":"#6b7280";},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent",S.currentTarget.style.color=y?"#6b7280":"#9ca3af";},children:jsxRuntime.jsx("svg",{width:E?16:12,height:E?16:12,viewBox:"0 0 14 14",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 1L13 13M1 13L13 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),jsxRuntime.jsx("h2",{id:"gotcha-modal-title",style:{margin:"0 0 16px 0",fontSize:E?16:14,fontWeight:600,paddingRight:E?40:32,letterSpacing:"-0.01em",lineHeight:1.4,textAlign:"left"},children:n||X}),s&&jsxRuntime.jsxs("div",{style:{textAlign:"center",padding:"24px 0",color:y?"#10b981":"#059669"},children:[jsxRuntime.jsx("div",{style:{width:44,height:44,borderRadius:"50%",backgroundColor:y?"rgba(16,185,129,0.1)":"rgba(5,150,105,0.08)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 12px"},children:jsxRuntime.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M20 6L9 17L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:13,fontWeight:500,color:y?"#d1d5db":"#374151"},children:t})]}),r&&!s&&jsxRuntime.jsx("div",{style:{padding:"8px 10px",marginBottom:12,borderRadius:8,backgroundColor:y?"rgba(127,29,29,0.3)":"#fef2f2",border:`1px solid ${y?"rgba(254,202,202,0.1)":"rgba(220,38,38,0.1)"}`,color:y?"#fecaca":"#dc2626",fontSize:13,lineHeight:1.4},children:r}),!s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e==="feedback"&&jsxRuntime.jsx(Be,{theme:_,placeholder:g,submitText:b,isLoading:i,onSubmit:x,customStyles:l,initialValues:d?{content:d.content,rating:d.rating}:void 0,isEditing:c,showText:u,showRating:p}),e==="vote"&&jsxRuntime.jsx(He,{theme:_,isLoading:i,onSubmit:x,initialVote:d?.vote||void 0,isEditing:c,labels:m}),e==="poll"&&f&&f.length>0&&jsxRuntime.jsx(Fe,{theme:_,options:f,allowMultiple:o,isLoading:i,onSubmit:x,initialSelected:d?.pollSelected||void 0,isEditing:c})]}),jsxRuntime.jsxs("div",{"aria-live":"polite",className:"sr-only",style:{position:"absolute",left:-9999},children:[s&&"Thank you! Your feedback has been submitted.",r&&`Error: ${r}`]})]})}function ut({elementId:e,user:a,mode:l="feedback",showText:n=true,showRating:g=true,experimentId:b,variant:t,voteLabels:i,options:s,allowMultiple:r=false,showResults:d=true,position:c=P.POSITION,size:u=P.SIZE,theme:p=P.THEME,customStyles:m,visible:f=true,showOnHover:o=P.SHOW_ON_HOVER,touchBehavior:x=P.TOUCH_BEHAVIOR,promptText:v,placeholder:I,submitText:C=P.SUBMIT_TEXT,thankYouMessage:h=P.THANK_YOU_MESSAGE,onSubmit:G,onOpen:W,onClose:E,onError:ie}){let{disabled:le,activeModalId:V,openModal:_,closeModal:y}=U(),[ce,K]=react.useState(false),[j,X]=react.useState(false),[z,Q]=react.useState(null),[q,S]=react.useState(false),M=react.useRef(null);react.useEffect(()=>{S(window.innerWidth<640);},[]);let R=V===e;react.useEffect(()=>{if(!o)return;let w=M.current;if(!w)return;let H=w.parentElement;if(!H)return;let we=()=>X(true),Te=()=>X(false);return H.addEventListener("mouseenter",we),H.addEventListener("mouseleave",Te),()=>{H.removeEventListener("mouseenter",we),H.removeEventListener("mouseleave",Te);}},[o]);let{submit:L,isLoading:N,error:B,existingResponse:Ee,isEditing:Z}=Oe({elementId:e,mode:l,experimentId:b,variant:t,pollOptions:s,user:a,onSuccess:w=>{K(true),G?.(w),setTimeout(()=>{y(),K(false);},3e3);},onError:w=>{console.warn("[Gotcha] Submission failed:",w instanceof Error?w.message:w),ie?.(w);}}),Ke=react.useCallback(()=>{M.current&&Q(M.current.getBoundingClientRect()),_(e),W?.();},[e,_,W]),de=react.useCallback(()=>{y(),K(false),E?.();},[y,E]),Re=react.useCallback(w=>{L(w);},[L]);return le||!f?null:jsxRuntime.jsxs("div",{ref:M,style:{...{"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"}}[c],zIndex:R?1e4:"auto"},className:"gotcha-container","data-gotcha-element":e,children:[jsxRuntime.jsx(Ue,{size:u,theme:p,customStyles:m,showOnHover:o,touchBehavior:x,onClick:Ke,isOpen:R,isParentHovered:j}),R&&!q&&jsxRuntime.jsx(ve,{mode:l,theme:p,customStyles:m,promptText:v,placeholder:I,submitText:C,thankYouMessage:Z?"Your feedback has been updated!":h,isLoading:N,isSubmitted:ce,error:B,existingResponse:Ee,isEditing:Z,showText:n,showRating:g,voteLabels:i,options:s,allowMultiple:r,onSubmit:Re,onClose:de,anchorRect:z||void 0}),R&&q&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",inset:0,zIndex:99999,backgroundColor:"rgba(0, 0, 0, 0.3)"},onClick:de,"aria-hidden":"true",children:jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),children:jsxRuntime.jsx(ve,{mode:l,theme:p,customStyles:m,promptText:v,placeholder:I,submitText:C,thankYouMessage:Z?"Your feedback has been updated!":h,isLoading:N,isSubmitted:ce,error:B,existingResponse:Ee,isEditing:Z,showText:n,showRating:g,voteLabels:i,options:s,allowMultiple:r,onSubmit:Re,onClose:de,anchorRect:z||void 0})})}),document.body)]})}function ft(){let{client:e,disabled:a,defaultUser:l,debug:n}=U();return {client:e,disabled:a,defaultUser:l,debug:n,submitFeedback:e.submitResponse.bind(e)}}exports.Gotcha=ut;exports.GotchaProvider=qe;exports.useGotcha=ft;//# sourceMappingURL=index.js.map
12
12
  //# sourceMappingURL=index.js.map