@frigade/react 1.32.45 → 1.32.47

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/lib/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import ht,{createContext as Pa,useEffect as Xo,useState as Ne}from"react";import{ThemeProvider as va}from"styled-components";import gt,{useContext as Fa,useEffect as wo,useState as Yo}from"react";import{useCallback as dt,useContext as Qs,useEffect as Zs}from"react";import Lo,{useMemo as _s}from"react";var cr="1.32.45 ";var ke="https://api.frigade.com/v1/public/",Ie="NOT_STARTED_STEP",X="COMPLETED_FLOW",no="ABORTED_FLOW",pt="STARTED_FLOW",Le="NOT_STARTED_FLOW",Oe="COMPLETED_STEP",so="STARTED_STEP";function $e(){let{publicApiKey:e,userId:t}=Lo.useContext(q);return{config:_s(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":cr,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}var Ws="frigade-last-call-at-",zs="frigade-last-call-data-";function Tt(){let{shouldGracefullyDegrade:e}=Lo.useContext(q);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),Wt();let r=Ws+t,n=zs+t;if(window&&window.localStorage&&o&&o.body&&o.method==="POST"){let s=window.localStorage.getItem(r),p=window.localStorage.getItem(n);if(s&&p&&p==o.body){let d=new Date(s);if(new Date().getTime()-d.getTime()<1e3)return Wt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,o.body)}let i;try{i=await fetch(t,o)}catch(s){return Wt(s)}return i?i.ok?i:Wt(i.statusText):Wt()}}function Wt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ft(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Lo.useContext(q);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as Ys,useState as mr}from"react";import{useContext as js,useEffect as Gs,useState as Vs}from"react";import qs from"swr";import{useContext as Hs}from"react";function ve(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:r,completedFlowsToKeepOpenDuringSession:n}=Hs(q);function i(c,f=!1){return e[c]??f}function s(c,f){t(w=>({...w,[c]:f}))}function p(c){t(f=>{let{[c]:w,...T}=f;return{...T}})}function d(c){n.includes(c)||r(f=>[...f,c])}function a(c){return n.includes(c)}function u(){return Object.values(e).some(c=>c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:u,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var Ks="unknown";function Be(){let{config:e}=$e(),{publicApiKey:t,userId:o,flows:r,setShouldGracefullyDegrade:n}=js(q),{resetOpenFlowState:i}=ve(),[s,p]=Vs(!1),d={data:r.map(y=>({flowId:y.id,flowState:X,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},a=y=>fetch(y,e).then(C=>{if(C.ok)return C.json();throw new Error("Failed to fetch user flow states")}).catch(C=>(console.log(`Error fetching ${y}: ${C}. Will gracefully degrade and hide Frigade`),n(!0),d)),{data:u,isLoading:c,mutate:f,error:w}=qs(t&&r&&o?`${ke}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,a,{revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),T=u==null?void 0:u.data;Gs(()=>{!s&&!c&&T&&p(!0)},[T,s,c]);async function S(y){if(T){let C=T.find(m=>m.flowId===y);C&&C.flowState!==X&&(C.flowState=X),await f(Promise.resolve({...u,data:T}),{optimisticData:{...u,data:T},revalidate:!1,rollbackOnError:!1})}}async function h(y,C,m){if(T){let x=T.find(F=>F.flowId===y);x&&(x.stepStates[C]=m,x.flowState=pt),await f(Promise.resolve({...u,data:T}),{optimisticData:{...u,data:T},revalidate:!1,rollbackOnError:!1})}}async function E(y,C,m){if(T){let x=T.find(F=>F.flowId===y);x&&(x.lastStepId=C,x.stepStates[C]=m,x.flowState=pt),await f({...u,data:T},{optimisticData:{...u,data:T},revalidate:!1,rollbackOnError:!1})}}async function P(y){if(T){let C=T.find(m=>m.flowId===y);C&&C.flowState!==Le&&(C.flowState=Le,C.lastStepId=Ks,Object.keys(C.stepStates).forEach(m=>{C.stepStates[m].actionType=Ie,C.stepStates[m].createdAt=new Date().toISOString()}),await f({...u,data:T},{optimisticData:{...u,data:T},revalidate:!1,rollbackOnError:!1}),i(y))}}async function A(y,C){if(T){let m=T.find(x=>x.flowId===y);m&&m.stepStates[C]!==Ie&&(m.stepStates[C]=Ie),await f({...u,data:T},{optimisticData:{...u,data:T},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:T,isLoadingUserFlowStateData:!s,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:P,optimisticallyMarkStepCompleted:h,optimisticallyMarkStepNotStarted:A,optimisticallyMarkStepStarted:E,error:w}}function zt(){let{config:e}=$e(),{userFlowStatesData:t,mutateUserFlowState:o}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:i,setFlowResponses:s}=Ys(q),[p,d]=mr(new Set),[a,u]=mr(new Set),c=Tt();function f(S){let h=JSON.stringify(S);if(p.has(h))return null;p.add(h),d(p),a.add(S),u(a);let E=i==null?void 0:i.find(P=>P.flowSlug===S.flowSlug&&P.stepId===S.stepId&&P.actionType===S.actionType&&P.createdAt===S.createdAt);return c(`${ke}flowResponses`,{...e,method:"POST",body:h}).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+S.stepId+". Will retry again later."),n([...r,S])):E||s(A=>[...A??[],S])})}async function w(S){S.foreignUserId&&(S.actionType===pt||S.actionType===Le?await f(S):S.actionType===X?await f(S):S.actionType===so?await f(S):S.actionType===Oe?await f(S):S.actionType===no?await f(S):S.actionType===Ie&&await f(S))}function T(){let S=[];return t==null||t.forEach(h=>{if(h&&h.stepStates&&Object.keys(h.stepStates).length!==0)for(let E in h.stepStates){let P=h.stepStates[E];S.push({foreignUserId:h.foreignUserId,flowSlug:h.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...S,...i]}return{addResponse:w,setFlowResponses:s,getFlowResponses:T}}import Rs from"swr";var Xs=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ur=e=>{let t=Xs.exec(e);if(t===null)return null;let o=null;return t.forEach((r,n)=>{let i=Js(r,"'","");i.startsWith("flow_")&&(o=i)}),o},Js=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function J(){let{config:e}=$e(),{flows:t,setFlows:o,userId:r,publicApiKey:n,customVariables:i,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:a,setShouldGracefullyDegrade:u}=Qs(q),c={data:[]},{verifySDKInitiated:f}=Ft(),{addResponse:w,getFlowResponses:T}=zt(),S=g=>fetch(g,e).then(b=>b.ok?b.json():(console.log(`Error fetching ${g} (${b.status}): ${b.statusText}. .Will gracefully degrade and hide Frigade`),u(!0),c)).catch(b=>(console.log(`Error fetching ${g}: ${b}. Will gracefully degrade and hide Frigade`),u(!0),c)),{userFlowStatesData:h,isLoadingUserFlowStateData:E,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:y,optimisticallyMarkStepNotStarted:C,optimisticallyMarkStepStarted:m}=Be(),{data:x,error:F,isLoading:L}=Rs(n?`${ke}flows`:null,S,{keepPreviousData:!0});Zs(()=>{if(F){console.error(F);return}x&&x.data&&(x.data=o(x.data))},[x,F]);function U(g){if(L)return null;let b=t.find(v=>v.slug===g);return!b&&t.length>0&&!E&&!L?(console.log(`Flow with slug ${g} not found`),null):(b==null?void 0:b.active)===!1?null:b}function M(g){var H;if(!U(g))return[];let b=U(g).data;return b?(b=I(b),(((H=JSON.parse(b))==null?void 0:H.data)??[]).map(ce=>{let z=oe(ce);return{handleSecondaryButtonClick:()=>{ce.skippable===!0&&_(g,ce.id,{skipped:!0})},...ce,complete:O(g,ce.id)===Oe||z>=1,blocked:te(g,ce.id),hidden:xe(g,ce.id),handlePrimaryButtonClick:()=>{(!ce.completionCriteria&&(ce.autoMarkCompleted||ce.autoMarkCompleted===void 0)||ce.completionCriteria&&ce.autoMarkCompleted===!0)&&_(g,ce.id)},progress:z}}).filter(ce=>ce.hidden!==!0)):[]}function I(g){return g.replace(/\${(.*?)}/g,(b,v)=>i[v]!==void 0?String(i[v]):"")}function j(g){if(!U(g))return[];let b=U(g).data;return b?(b=I(b),JSON.parse(b)??{}):[]}function B(g,b){s(v=>({...v,[g]:b}))}function $(g){!E&&!L&&g&&JSON.stringify(i)!=JSON.stringify({...i,...g})&&Object.keys(g).forEach(b=>{B(b,g[b])})}let re=dt(async(g,b,v)=>{f();let H={foreignUserId:r,flowSlug:g,stepId:b,actionType:so,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};G(H)&&(await m(g,b,H),w(H))},[r,h]),R=dt(async(g,b,v)=>{f();let H={foreignUserId:r,flowSlug:g,stepId:b,actionType:Ie,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};G(H)&&(await C(g,b),w(H))},[r,h]),_=dt(async(g,b,v)=>{f();let H={foreignUserId:r,flowSlug:g,stepId:b,actionType:Oe,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};G(H)&&(await y(g,b,H),w(H))},[r,h]),he=dt(async(g,b)=>{if(f(),K(g)===Le)return;let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:Le,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};await A(g),G(v)&&w(v)},[r,h]),Fe=dt(async(g,b)=>{f();let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:pt,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};G(v)&&w(v)},[r,h]),W=dt(async(g,b)=>{f();let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:X,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};G(v)&&(await P(g),w(v))},[r,h]),se=dt(async(g,b)=>{f();let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:no,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};G(v)&&(await P(g),w(v))},[r,h]);function G(g){var b;if(!h&&g.actionType===Ie)return!1;if(h){let v=h.find(H=>H.flowId===g.flowSlug);if(g.actionType===Ie&&(!(v!=null&&v.stepStates[g.stepId])||v.stepStates[g.stepId].actionType===Ie)||v&&((b=v.stepStates[g.stepId])==null?void 0:b.actionType)===g.actionType||v&&v.flowState===X&&g.actionType===X)return!1}return!0}function O(g,b){let v=Ce(g,b);return E?null:v?v.actionType:Ie}function te(g,b){let v=Ce(g,b);return v?v.blocked:!1}function xe(g,b){let v=Ce(g,b);return v?v.hidden:!1}function Ce(g,b){if(E)return null;let v=h==null?void 0:h.find(H=>H.flowId===g);return!v||!v.stepStates[b]?null:v.stepStates[b]??null}function V(g){var v;if(E||!h)return null;if(K(g)===Le)return M(g)[0]??null;let b=(v=h.find(H=>H.flowId===g))==null?void 0:v.lastStepId;return b?M(g).find(H=>H.id===b):null}function de(g){let b=V(g);if(!b)return 0;let v=M(g).findIndex(H=>H.id===b.id)??0;return O(g,b.id)===Oe&&v<M(g).length-1?v+1:v}function oe(g){if(!g.completionCriteria)return;let b=ur(g.completionCriteria);if(b===null)return;let v=je(b),H=Ge(b);return H===0?void 0:v/H}function K(g){let b=h==null?void 0:h.find(v=>v.flowId===g);return b?b.flowState:null}function je(g){let b=M(g);return b.length===0?0:b.filter(H=>O(g,H.id)===Oe).length}function Ge(g){return M(g).length}function Y(g){return JSON.parse(t.find(b=>b.slug===g).data)}function Se(g){if(E)return!0;if(g!=null&&g.targetingLogic&&h){let b=h.find(v=>v.flowId===g.slug);if(b)return b.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&r&&r.startsWith("guest_"))}function lt(g){return!Se(U(g))}return{getFlow:U,getFlowData:Y,isLoading:E||L,getStepStatus:O,getFlowSteps:M,getCurrentStepIndex:de,markStepStarted:re,markStepCompleted:_,markFlowNotStarted:he,markFlowStarted:Fe,markFlowCompleted:W,markFlowAborted:se,markStepNotStarted:R,getFlowStatus:K,getNumberOfStepsCompleted:je,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:Se,setCustomVariable:B,updateCustomVariables:$,customVariables:i,getStepOptionalProgress:oe,getFlowMetadata:j,isStepBlocked:te,isStepHidden:xe,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:lt}}import{useCallback as fr,useContext as el,useEffect as tl}from"react";var kt="guest_";function Ht(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:r,shouldGracefullyDegrade:n}=el(q),{config:i}=$e(),{mutateUserFlowState:s}=Be(),p=Tt(),{verifySDKInitiated:d}=Ft();tl(()=>{if(e&&!t){if(e.startsWith(kt))return;let c=`frigade-user-registered-${e}`;localStorage.getItem(c)||(p(`${ke}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(c,"true"))}},[e,n,t]);let a=fr(async c=>{d();let f={foreignId:e,properties:c};await p(`${ke}users`,{...i,method:"POST",body:JSON.stringify(f)}),r(w=>({...w,...c})),s()},[e,i,n,s]),u=fr(async(c,f)=>{d();let T={foreignId:e,events:[{event:c,properties:f}]};await p(`${ke}users`,{...i,method:"POST",body:JSON.stringify(T)}),s()},[e,i,s]);return{userId:e,setUserId:o,addPropertiesToUser:a,trackEventForUser:u}}import{v4 as ka}from"uuid";import Ue,{useEffect as ya,useState as ba}from"react";import Ve,{useEffect as ll}from"react";import ao from"styled-components";import ol from"react";import rl from"styled-components";var gr="fr-",jt="cfr-";function l(e,t){let o=`${gr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+jt+e}return o}function k(e){if(!e.className||e.className.indexOf(jt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(gr)?"":`:not(${o.map(r=>`.${r}`).join(", ")})`}function Oo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ct(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Oo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function ye(...e){return e.filter(Boolean).join(" ")}function hr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var il=rl.div`
2
+ import ht,{createContext as Pa,useEffect as Xo,useState as Ne}from"react";import{ThemeProvider as va}from"styled-components";import gt,{useContext as Fa,useEffect as wo,useState as Yo}from"react";import{useCallback as dt,useContext as Qs,useEffect as Zs}from"react";import Lo,{useMemo as _s}from"react";var cr="1.32.47 ";var ke="https://api.frigade.com/v1/public/",Ie="NOT_STARTED_STEP",X="COMPLETED_FLOW",no="ABORTED_FLOW",pt="STARTED_FLOW",Le="NOT_STARTED_FLOW",Oe="COMPLETED_STEP",so="STARTED_STEP";function $e(){let{publicApiKey:e,userId:t}=Lo.useContext(q);return{config:_s(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":cr,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}var Ws="frigade-last-call-at-",zs="frigade-last-call-data-";function Tt(){let{shouldGracefullyDegrade:e}=Lo.useContext(q);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),Wt();let r=Ws+t,n=zs+t;if(window&&window.localStorage&&o&&o.body&&o.method==="POST"){let s=window.localStorage.getItem(r),p=window.localStorage.getItem(n);if(s&&p&&p==o.body){let d=new Date(s);if(new Date().getTime()-d.getTime()<1e3)return Wt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,o.body)}let i;try{i=await fetch(t,o)}catch(s){return Wt(s)}return i?i.ok?i:Wt(i.statusText):Wt()}}function Wt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ft(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Lo.useContext(q);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as Ys,useState as mr}from"react";import{useContext as js,useEffect as Gs,useState as Vs}from"react";import qs from"swr";import{useContext as Hs}from"react";function ve(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:r,completedFlowsToKeepOpenDuringSession:n}=Hs(q);function i(c,u=!1){return e[c]??u}function s(c,u){t(w=>({...w,[c]:u}))}function p(c){t(u=>{let{[c]:w,...T}=u;return{...T}})}function d(c){n.includes(c)||r(u=>[...u,c])}function a(c){return n.includes(c)}function f(){return Object.values(e).some(c=>c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:f,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var Ks="unknown";function Be(){let{config:e}=$e(),{publicApiKey:t,userId:o,flows:r,setShouldGracefullyDegrade:n}=js(q),{resetOpenFlowState:i}=ve(),[s,p]=Vs(!1),d={data:r.map(y=>({flowId:y.id,flowState:X,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},a=y=>fetch(y,e).then(C=>{if(C.ok)return C.json();throw new Error("Failed to fetch user flow states")}).catch(C=>(console.log(`Error fetching ${y}: ${C}. Will gracefully degrade and hide Frigade`),n(!0),d)),{data:f,isLoading:c,mutate:u,error:w}=qs(t&&r&&o?`${ke}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,a,{revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),T=f==null?void 0:f.data;Gs(()=>{!s&&!c&&T&&p(!0)},[T,s,c]);async function S(y){if(T){let C=T.find(m=>m.flowId===y);C&&C.flowState!==X&&(C.flowState=X),await u(Promise.resolve({...f,data:T}),{optimisticData:{...f,data:T},revalidate:!1,rollbackOnError:!1})}}async function h(y,C,m){if(T){let x=T.find(F=>F.flowId===y);x&&(x.stepStates[C]=m,x.flowState=pt),await u(Promise.resolve({...f,data:T}),{optimisticData:{...f,data:T},revalidate:!1,rollbackOnError:!1})}}async function E(y,C,m){if(T){let x=T.find(F=>F.flowId===y);x&&(x.lastStepId=C,x.stepStates[C]=m,x.flowState=pt),await u({...f,data:T},{optimisticData:{...f,data:T},revalidate:!1,rollbackOnError:!1})}}async function P(y){if(T){let C=T.find(m=>m.flowId===y);C&&C.flowState!==Le&&(C.flowState=Le,C.lastStepId=Ks,Object.keys(C.stepStates).forEach(m=>{C.stepStates[m].actionType=Ie,C.stepStates[m].createdAt=new Date().toISOString()}),await u({...f,data:T},{optimisticData:{...f,data:T},revalidate:!1,rollbackOnError:!1}),i(y))}}async function A(y,C){if(T){let m=T.find(x=>x.flowId===y);m&&m.stepStates[C]!==Ie&&(m.stepStates[C]=Ie),await u({...f,data:T},{optimisticData:{...f,data:T},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:T,isLoadingUserFlowStateData:!s,mutateUserFlowState:u,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:P,optimisticallyMarkStepCompleted:h,optimisticallyMarkStepNotStarted:A,optimisticallyMarkStepStarted:E,error:w}}function zt(){let{config:e}=$e(),{userFlowStatesData:t,mutateUserFlowState:o}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:i,setFlowResponses:s}=Ys(q),[p,d]=mr(new Set),[a,f]=mr(new Set),c=Tt();function u(S){let h=JSON.stringify(S);if(p.has(h))return null;p.add(h),d(p),a.add(S),f(a);let E=i==null?void 0:i.find(P=>P.flowSlug===S.flowSlug&&P.stepId===S.stepId&&P.actionType===S.actionType&&P.createdAt===S.createdAt);return c(`${ke}flowResponses`,{...e,method:"POST",body:h}).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+S.stepId+". Will retry again later."),n([...r,S])):E||s(A=>[...A??[],S])})}async function w(S){S.foreignUserId&&(S.actionType===pt||S.actionType===Le?await u(S):S.actionType===X?await u(S):S.actionType===so?await u(S):S.actionType===Oe?await u(S):S.actionType===no?await u(S):S.actionType===Ie&&await u(S))}function T(){let S=[];return t==null||t.forEach(h=>{if(h&&h.stepStates&&Object.keys(h.stepStates).length!==0)for(let E in h.stepStates){let P=h.stepStates[E];S.push({foreignUserId:h.foreignUserId,flowSlug:h.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...S,...i]}return{addResponse:w,setFlowResponses:s,getFlowResponses:T}}import Rs from"swr";var Xs=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ur=e=>{let t=Xs.exec(e);if(t===null)return null;let o=null;return t.forEach((r,n)=>{let i=Js(r,"'","");i.startsWith("flow_")&&(o=i)}),o},Js=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function J(){let{config:e}=$e(),{flows:t,setFlows:o,userId:r,publicApiKey:n,customVariables:i,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:a,setShouldGracefullyDegrade:f}=Qs(q),c={data:[]},{verifySDKInitiated:u}=Ft(),{addResponse:w,getFlowResponses:T}=zt(),S=g=>fetch(g,e).then(b=>b.ok?b.json():(console.log(`Error fetching ${g} (${b.status}): ${b.statusText}. .Will gracefully degrade and hide Frigade`),f(!0),c)).catch(b=>(console.log(`Error fetching ${g}: ${b}. Will gracefully degrade and hide Frigade`),f(!0),c)),{userFlowStatesData:h,isLoadingUserFlowStateData:E,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:y,optimisticallyMarkStepNotStarted:C,optimisticallyMarkStepStarted:m}=Be(),{data:x,error:F,isLoading:L}=Rs(n?`${ke}flows`:null,S,{keepPreviousData:!0});Zs(()=>{if(F){console.error(F);return}x&&x.data&&(x.data=o(x.data))},[x,F]);function U(g){if(L)return null;let b=t.find(v=>v.slug===g);return!b&&t.length>0&&!E&&!L?(console.log(`Flow with slug ${g} not found`),null):(b==null?void 0:b.active)===!1?null:b}function M(g){var H;if(!U(g))return[];let b=U(g).data;return b?(b=I(b),(((H=JSON.parse(b))==null?void 0:H.data)??[]).map(ce=>{let z=oe(ce);return{handleSecondaryButtonClick:()=>{ce.skippable===!0&&_(g,ce.id,{skipped:!0})},...ce,complete:O(g,ce.id)===Oe||z>=1,blocked:te(g,ce.id),hidden:xe(g,ce.id),handlePrimaryButtonClick:()=>{(!ce.completionCriteria&&(ce.autoMarkCompleted||ce.autoMarkCompleted===void 0)||ce.completionCriteria&&ce.autoMarkCompleted===!0)&&_(g,ce.id)},progress:z}}).filter(ce=>ce.hidden!==!0)):[]}function I(g){return g.replace(/\${(.*?)}/g,(b,v)=>i[v]!==void 0?String(i[v]):"")}function j(g){if(!U(g))return[];let b=U(g).data;return b?(b=I(b),JSON.parse(b)??{}):[]}function B(g,b){s(v=>({...v,[g]:b}))}function $(g){!E&&!L&&g&&JSON.stringify(i)!=JSON.stringify({...i,...g})&&Object.keys(g).forEach(b=>{B(b,g[b])})}let re=dt(async(g,b,v)=>{u();let H={foreignUserId:r,flowSlug:g,stepId:b,actionType:so,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};G(H)&&(await m(g,b,H),w(H))},[r,h]),R=dt(async(g,b,v)=>{u();let H={foreignUserId:r,flowSlug:g,stepId:b,actionType:Ie,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};G(H)&&(await C(g,b),w(H))},[r,h]),_=dt(async(g,b,v)=>{u();let H={foreignUserId:r,flowSlug:g,stepId:b,actionType:Oe,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};G(H)&&(await y(g,b,H),w(H))},[r,h]),he=dt(async(g,b)=>{if(u(),K(g)===Le)return;let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:Le,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};await A(g),G(v)&&w(v)},[r,h]),Fe=dt(async(g,b)=>{u();let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:pt,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};G(v)&&w(v)},[r,h]),W=dt(async(g,b)=>{u();let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:X,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};G(v)&&(await P(g),w(v))},[r,h]),se=dt(async(g,b)=>{u();let v={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:no,data:b??{},createdAt:new Date,blocked:!1,hidden:!1};G(v)&&(await P(g),w(v))},[r,h]);function G(g){var b;if(!h&&g.actionType===Ie)return!1;if(h){let v=h.find(H=>H.flowId===g.flowSlug);if(g.actionType===Ie&&(!(v!=null&&v.stepStates[g.stepId])||v.stepStates[g.stepId].actionType===Ie)||v&&((b=v.stepStates[g.stepId])==null?void 0:b.actionType)===g.actionType||v&&v.flowState===X&&g.actionType===X)return!1}return!0}function O(g,b){let v=Ce(g,b);return E?null:v?v.actionType:Ie}function te(g,b){let v=Ce(g,b);return v?v.blocked:!1}function xe(g,b){let v=Ce(g,b);return v?v.hidden:!1}function Ce(g,b){if(E)return null;let v=h==null?void 0:h.find(H=>H.flowId===g);return!v||!v.stepStates[b]?null:v.stepStates[b]??null}function V(g){var v;if(E||!h)return null;if(K(g)===Le)return M(g)[0]??null;let b=(v=h.find(H=>H.flowId===g))==null?void 0:v.lastStepId;return b?M(g).find(H=>H.id===b):null}function de(g){let b=V(g);if(!b)return 0;let v=M(g).findIndex(H=>H.id===b.id)??0;return O(g,b.id)===Oe&&v<M(g).length-1?v+1:v}function oe(g){if(!g.completionCriteria)return;let b=ur(g.completionCriteria);if(b===null)return;let v=je(b),H=Ge(b);return H===0?void 0:v/H}function K(g){let b=h==null?void 0:h.find(v=>v.flowId===g);return b?b.flowState:null}function je(g){let b=M(g);return b.length===0?0:b.filter(H=>O(g,H.id)===Oe).length}function Ge(g){return M(g).length}function Y(g){return JSON.parse(t.find(b=>b.slug===g).data)}function Se(g){if(E)return!0;if(g!=null&&g.targetingLogic&&h){let b=h.find(v=>v.flowId===g.slug);if(b)return b.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&r&&r.startsWith("guest_"))}function lt(g){return!Se(U(g))}return{getFlow:U,getFlowData:Y,isLoading:E||L,getStepStatus:O,getFlowSteps:M,getCurrentStepIndex:de,markStepStarted:re,markStepCompleted:_,markFlowNotStarted:he,markFlowStarted:Fe,markFlowCompleted:W,markFlowAborted:se,markStepNotStarted:R,getFlowStatus:K,getNumberOfStepsCompleted:je,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:Se,setCustomVariable:B,updateCustomVariables:$,customVariables:i,getStepOptionalProgress:oe,getFlowMetadata:j,isStepBlocked:te,isStepHidden:xe,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:lt}}import{useCallback as fr,useContext as el,useEffect as tl}from"react";var kt="guest_";function Ht(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:r,shouldGracefullyDegrade:n}=el(q),{config:i}=$e(),{mutateUserFlowState:s}=Be(),p=Tt(),{verifySDKInitiated:d}=Ft();tl(()=>{if(e&&!t){if(e.startsWith(kt))return;let c=`frigade-user-registered-${e}`;localStorage.getItem(c)||(p(`${ke}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(c,"true"))}},[e,n,t]);let a=fr(async c=>{d();let u={foreignId:e,properties:c};await p(`${ke}users`,{...i,method:"POST",body:JSON.stringify(u)}),r(w=>({...w,...c})),s()},[e,i,n,s]),f=fr(async(c,u)=>{d();let T={foreignId:e,events:[{event:c,properties:u}]};await p(`${ke}users`,{...i,method:"POST",body:JSON.stringify(T)}),s()},[e,i,s]);return{userId:e,setUserId:o,addPropertiesToUser:a,trackEventForUser:f}}import{v4 as ka}from"uuid";import Ue,{useEffect as ya,useState as ba}from"react";import Ve,{useEffect as ll}from"react";import ao from"styled-components";import ol from"react";import rl from"styled-components";var gr="fr-",jt="cfr-";function l(e,t){let o=`${gr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+jt+e}return o}function k(e){if(!e.className||e.className.indexOf(jt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(gr)?"":`:not(${o.map(r=>`.${r}`).join(", ")})`}function Oo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ct(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Oo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function ye(...e){return e.filter(Boolean).join(" ")}function hr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var il=rl.div`
3
3
  display: flex;
4
4
  justify-content: center;
5
5
  position: fixed;
@@ -193,7 +193,7 @@ import ht,{createContext as Pa,useEffect as Xo,useState as Ne}from"react";import
193
193
  min-height: 70px;
194
194
  box-sizing: border-box;
195
195
  margin-bottom: 10px;
196
- `;function _o({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:r,inputData:n}){let i=e,[s,p]=Fr((n==null?void 0:n.text)||""),[d,a]=Fr(!1),u=Uo;yl(()=>{s===""&&!d&&(a(!0),c(""))},[]);function c(w){if(p(w),o({text:w}),i.required===!0&&w.trim()===""){r([{id:i.id,message:`${i.title} is required`}]);return}let T=Tr(w,i.validation);if(T){r([{id:i.id,message:T}]);return}r([])}i.multiline&&(u=wl);function f(){var w;switch((w=i==null?void 0:i.validation)==null?void 0:w.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return uo.createElement(bl,null,uo.createElement(tt,{title:i.title,required:i.required,appearance:t.appearance}),uo.createElement(u,{className:l("inputComponent",t.appearance),value:s,onChange:w=>{c(w.target.value)},appearance:t.appearance,placeholder:i.placeholder,type:f()}),uo.createElement(Pt,{title:i.subtitle,appearance:t.appearance}))}import Me,{useEffect as kr,useState as Pr}from"react";import vr from"styled-components";var Tl=vr.div`
196
+ `;function _o({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:r,inputData:n}){let i=e,[s,p]=Fr((n==null?void 0:n.text)||""),[d,a]=Fr(!1),f=Uo;yl(()=>{s===""&&!d&&(a(!0),c(""))},[]);function c(w){if(p(w),o({text:w}),i.required===!0&&w.trim()===""){r([{id:i.id,message:`${i.title} is required`}]);return}let T=Tr(w,i.validation);if(T){r([{id:i.id,message:T}]);return}r([])}i.multiline&&(f=wl);function u(){var w;switch((w=i==null?void 0:i.validation)==null?void 0:w.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return uo.createElement(bl,null,uo.createElement(tt,{title:i.title,required:i.required,appearance:t.appearance}),uo.createElement(f,{className:l("inputComponent",t.appearance),value:s,onChange:w=>{c(w.target.value)},appearance:t.appearance,placeholder:i.placeholder,type:u()}),uo.createElement(Pt,{title:i.subtitle,appearance:t.appearance}))}import Me,{useEffect as kr,useState as Pr}from"react";import vr from"styled-components";var Tl=vr.div`
197
197
  display: flex;
198
198
  flex-direction: column;
199
199
  width: 100%;
@@ -223,7 +223,7 @@ import ht,{createContext as Pa,useEffect as Xo,useState as Ne}from"react";import
223
223
  background-repeat: no-repeat;
224
224
  background-size: 1.5em 1.5em;
225
225
  -webkit-print-color-adjust: exact;
226
- `,fo="null";function Er({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r,setFormValidationErrors:n}){var u,c,f,w,T,S;let i=e,[s,p]=Pr(((u=r==null?void 0:r.choice)==null?void 0:u[0])||""),[d,a]=Pr(!1);return kr(()=>{var h,E,P,A;if(s===""&&!d){if(a(!0),i.requireSelection){p(fo);return}if(i.defaultValue&&((h=i.props.options)!=null&&h.find(y=>y.id===i.defaultValue))){let y=(E=i.props.options)==null?void 0:E.find(C=>C.id===i.defaultValue);p(y.id),o({choice:[y.id]})}else p(((P=i.props.options)==null?void 0:P[0].id)||""),o({choice:[((A=i.props.options)==null?void 0:A[0].id)||""]})}},[]),kr(()=>{i.requireSelection&&s===fo?n([{message:"Please select an option",id:i.id}]):n([])},[s]),Me.createElement(Tl,null,Me.createElement(tt,{title:i.title,required:!1,appearance:t.appearance}),Me.createElement(Fl,{value:s,onChange:h=>{p(h.target.value),o({choice:[h.target.value]})},placeholder:i.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},i.requireSelection&&Me.createElement("option",{key:fo,value:fo},"Select an option"),(c=i.props.options)==null?void 0:c.map(h=>Me.createElement("option",{key:h.id,value:h.id},h.title))),((w=(f=i.props.options)==null?void 0:f.find(h=>h.id===s))==null?void 0:w.isOpenEnded)&&Me.createElement(Me.Fragment,null,Me.createElement(tt,{title:((S=(T=i.props.options)==null?void 0:T.find(h=>h.id===s))==null?void 0:S.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Me.createElement(Uo,{type:"text",placeholder:"Enter your answer here",onChange:h=>{o({choice:[h.target.value]})},appearance:t.appearance})),Me.createElement(Pt,{title:i.subtitle,appearance:t.appearance}))}import go,{useEffect as Ar,useState as Ir}from"react";import Br from"styled-components";var kl=Br.div`
226
+ `,fo="null";function Er({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r,setFormValidationErrors:n}){var f,c,u,w,T,S;let i=e,[s,p]=Pr(((f=r==null?void 0:r.choice)==null?void 0:f[0])||""),[d,a]=Pr(!1);return kr(()=>{var h,E,P,A;if(s===""&&!d){if(a(!0),i.requireSelection){p(fo);return}if(i.defaultValue&&((h=i.props.options)!=null&&h.find(y=>y.id===i.defaultValue))){let y=(E=i.props.options)==null?void 0:E.find(C=>C.id===i.defaultValue);p(y.id),o({choice:[y.id]})}else p(((P=i.props.options)==null?void 0:P[0].id)||""),o({choice:[((A=i.props.options)==null?void 0:A[0].id)||""]})}},[]),kr(()=>{i.requireSelection&&s===fo?n([{message:"Please select an option",id:i.id}]):n([])},[s]),Me.createElement(Tl,null,Me.createElement(tt,{title:i.title,required:!1,appearance:t.appearance}),Me.createElement(Fl,{value:s,onChange:h=>{p(h.target.value),o({choice:[h.target.value]})},placeholder:i.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},i.requireSelection&&Me.createElement("option",{key:fo,value:fo},"Select an option"),(c=i.props.options)==null?void 0:c.map(h=>Me.createElement("option",{key:h.id,value:h.id},h.title))),((w=(u=i.props.options)==null?void 0:u.find(h=>h.id===s))==null?void 0:w.isOpenEnded)&&Me.createElement(Me.Fragment,null,Me.createElement(tt,{title:((S=(T=i.props.options)==null?void 0:T.find(h=>h.id===s))==null?void 0:S.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Me.createElement(Uo,{type:"text",placeholder:"Enter your answer here",onChange:h=>{o({choice:[h.target.value]})},appearance:t.appearance})),Me.createElement(Pt,{title:i.subtitle,appearance:t.appearance}))}import go,{useEffect as Ar,useState as Ir}from"react";import Br from"styled-components";var kl=Br.div`
227
227
  display: flex;
228
228
  flex-direction: column;
229
229
  width: 100%;
@@ -251,7 +251,7 @@ import ht,{createContext as Pa,useEffect as Xo,useState as Ne}from"react";import
251
251
  height: 60px;
252
252
  padding: 0 18px;
253
253
  margin-bottom: 10px;
254
- `;function Nr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r}){var a;let n=e,[i,s]=Ir((r==null?void 0:r.choice)||[]),[p,d]=Ir(!1);return Ar(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[]),Ar(()=>{o({choice:i})},[i]),go.createElement(kl,null,go.createElement(tt,{title:n.title,required:n.required,appearance:t.appearance}),(a=n.props.options)==null?void 0:a.map(u=>go.createElement(Pl,{appearance:t.appearance,key:u.id,value:u.id,"data-selected":i.includes(u.id),onClick:()=>{if(i.includes(u.id)){s(i.filter(c=>c!==u.id));return}i.length<n.props.maxChoices?s([...i,u.id]):i.length==1&&n.props.maxChoices==1&&s([u.id])}},u.title)),go.createElement(Pt,{title:n.subtitle,appearance:t.appearance}))}import ho from"react";import Lr from"styled-components";import vl from"dompurify";function me(e){return{__html:vl.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var El=Lr.h1`
254
+ `;function Nr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r}){var a;let n=e,[i,s]=Ir((r==null?void 0:r.choice)||[]),[p,d]=Ir(!1);return Ar(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[]),Ar(()=>{o({choice:i})},[i]),go.createElement(kl,null,go.createElement(tt,{title:n.title,required:n.required,appearance:t.appearance}),(a=n.props.options)==null?void 0:a.map(f=>go.createElement(Pl,{appearance:t.appearance,key:f.id,value:f.id,"data-selected":i.includes(f.id),onClick:()=>{if(i.includes(f.id)){s(i.filter(c=>c!==f.id));return}i.length<n.props.maxChoices?s([...i,f.id]):i.length==1&&n.props.maxChoices==1&&s([f.id])}},f.title)),go.createElement(Pt,{title:n.subtitle,appearance:t.appearance}))}import ho from"react";import Lr from"styled-components";import vl from"dompurify";function me(e){return{__html:vl.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var El=Lr.h1`
255
255
  ${e=>k(e)} {
256
256
  font-style: normal;
257
257
  font-weight: 600;
@@ -283,10 +283,10 @@ import ht,{createContext as Pa,useEffect as Xo,useState as Ne}from"react";import
283
283
  `,Ll=zo.div`
284
284
  padding-left: 1px;
285
285
  padding-right: 1px;
286
- `,Ol={text:_o,multipleChoice:Er,multipleChoiceList:Nr};function Or({flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:n,appearance:i,customFormElements:s}){var A;let p=t.props,[d,a]=Wo([]),[u,c]=Wo([]),{userId:f}=Ht(),[w,T]=Wo(E()||{}),S={...Ol,...s};Il(()=>{r(d.length===0)},[d,r]);function h(y,C){let m={...w,[y.id]:C};T(m),n(m),window&&window.localStorage&&window.localStorage.setItem(P(),JSON.stringify(m))}function E(){if(window&&window.localStorage){let y=window.localStorage.getItem(P());if(y)return JSON.parse(y)}return{}}function P(){return`frigade-multiInputStepTypeData-${e}-${t.id}-${f}`}return Gt.createElement(Ll,{className:l("multiInput",i)},Gt.createElement(be,{appearance:i,title:t.title,subtitle:t.subtitle}),Gt.createElement(Bl,{className:l("multiInputContainer",i)},(A=p.data)==null?void 0:A.map(y=>{var m;let C=(m=d.reverse().find(x=>x.id===y.id))==null?void 0:m.message;return S[y.type]?Gt.createElement("span",{key:y.id},S[y.type]({formInput:y,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:n,appearance:i},onSaveInputData:x=>{!u.includes(y.id)&&x&&(x==null?void 0:x.text)!==""&&c(F=>[...F,y.id]),h(y,x)},inputData:w[y.id],setFormValidationErrors:x=>{a(F=>x.length===0?F.filter(L=>L.id!==y.id):[...F,...x])}}),C&&u.includes(y.id)&&Gt.createElement(Nl,{appearance:i,className:l("multiInputValidationError",i)},C)):null})))}import mt from"styled-components";var Dr=mt.div`
286
+ `,Ol={text:_o,multipleChoice:Er,multipleChoiceList:Nr};function Or({flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:n,appearance:i,customFormElements:s}){var A;let p=t.props,[d,a]=Wo([]),[f,c]=Wo([]),{userId:u}=Ht(),[w,T]=Wo(E()||{}),S={...Ol,...s};Il(()=>{r(d.length===0)},[d,r]);function h(y,C){let m={...w,[y.id]:C};T(m),n(m),window&&window.localStorage&&window.localStorage.setItem(P(),JSON.stringify(m))}function E(){if(window&&window.localStorage){let y=window.localStorage.getItem(P());if(y)return JSON.parse(y)}return{}}function P(){return`frigade-multiInputStepTypeData-${e}-${t.id}-${u}`}return Gt.createElement(Ll,{className:l("multiInput",i)},Gt.createElement(be,{appearance:i,title:t.title,subtitle:t.subtitle}),Gt.createElement(Bl,{className:l("multiInputContainer",i)},(A=p.data)==null?void 0:A.map(y=>{var m;let C=(m=d.reverse().find(x=>x.id===y.id))==null?void 0:m.message;return S[y.type]?Gt.createElement("span",{key:y.id},S[y.type]({formInput:y,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:n,appearance:i},onSaveInputData:x=>{!f.includes(y.id)&&x&&(x==null?void 0:x.text)!==""&&c(F=>[...F,y.id]),h(y,x)},inputData:w[y.id],setFormValidationErrors:x=>{a(F=>x.length===0?F.filter(L=>L.id!==y.id):[...F,...x])}}),C&&f.includes(y.id)&&Gt.createElement(Nl,{appearance:i,className:l("multiInputValidationError",i)},C)):null})))}import mt from"styled-components";var Dr=mt.div`
287
287
  align-items: center;
288
288
  display: flex;
289
- justify-content: space-between;
289
+ justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
290
290
  padding-top: 14px;
291
291
  `,$r=mt.div`
292
292
  color: ${e=>e.appearance.theme.colorTextError};
@@ -362,7 +362,7 @@ import ht,{createContext as Pa,useEffect as Xo,useState as Ne}from"react";import
362
362
  margin-right: 8px;
363
363
  }
364
364
  }
365
- `,ee=({onClick:e,title:t,style:o,disabled:r,type:n="inline",size:i="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a=""})=>{function u(){let c=s?"buttonSecondary":"button";return a===""?c:`${a}${hr(c)}`}return Dl.createElement($l,{secondary:s,appearance:p,disabled:r,onClick:e,style:o,type:n,withMargin:d,size:i,className:l(u(),p)},t)};var jr=({step:e,canContinue:t,appearance:o,onPrimaryClick:r,onSecondaryClick:n,formType:i,selectedStep:s,steps:p,onBack:d,allowBackNavigation:a,errorMessage:u})=>{let c=i==="inline"?"inline":"full-width";return ot.createElement(ot.Fragment,null,u&&ot.createElement($r,{appearance:o,className:l("formCTAError",o)},u),ot.createElement(Dr,{className:l("formCTAContainer",o)},p.length>1&&s!=0&&a&&ot.createElement(ee,{title:"\u2190",onClick:d,secondary:!0,withMargin:!1,type:c,appearance:o}),ot.createElement(Mr,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?ot.createElement(ee,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:c,appearance:o}):null," ",e.primaryButtonTitle?ot.createElement(ee,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:r,type:c,appearance:o}):null)))};import Ho from"react";import Ml from"styled-components";var Ul=Ml.div`
365
+ `,ee=({onClick:e,title:t,style:o,disabled:r,type:n="inline",size:i="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a=""})=>{function f(){let c=s?"buttonSecondary":"button";return a===""?c:`${a}${hr(c)}`}return Dl.createElement($l,{secondary:s,appearance:p,disabled:r,onClick:e,style:o,type:n,withMargin:d,size:i,className:l(f(),p)},t)};var jr=({step:e,canContinue:t,appearance:o,onPrimaryClick:r,onSecondaryClick:n,formType:i,selectedStep:s,steps:p,onBack:d,allowBackNavigation:a,errorMessage:f})=>{let c=i==="inline"?"inline":"full-width",u=p.length>1&&s!=0&&a;return ot.createElement(ot.Fragment,null,f&&ot.createElement($r,{appearance:o,className:l("formCTAError",o)},f),ot.createElement(Dr,{showBackButton:u,className:l("formCTAContainer",o)},u&&ot.createElement(ee,{title:"\u2190",onClick:d,secondary:!0,withMargin:!1,type:c,appearance:o}),ot.createElement(Mr,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?ot.createElement(ee,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:c,appearance:o}):null," ",e.primaryButtonTitle?ot.createElement(ee,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:r,type:c,appearance:o}):null)))};import Ho from"react";import Ml from"styled-components";var Ul=Ml.div`
366
366
  text-align: center;
367
367
  `,Gr=({stepCount:e=0,currentStep:t=0,className:o,appearance:r})=>{let{theme:n}=Q().mergeAppearanceWithDefault(r);return Ho.createElement(Ul,{className:o},Ho.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((i,s)=>Ho.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"#E6E6E6"}))))};import ut from"react";import vt from"styled-components";import{useContext as _l}from"react";function ne(){let e=_l(q);function t(n){r(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){r(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function r(n,i){if(!n)return;let s=n.startsWith("http")?"_blank":"_self";i&&i!=="_blank"&&(s="_self"),e.navigate(n,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:r}}var Wl=vt.div`
368
368
  display: flex;
@@ -528,8 +528,8 @@ import ht,{createContext as Pa,useEffect as Xo,useState as Ne}from"react";import
528
528
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
529
529
  display: flex;
530
530
  align-self: center;
531
- `;var oi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:r})=>{let n=e.props,[i,s]=Vo([]),[p,d]=Vo(!1),[a,u]=Vo(e.id);return Go(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Go(()=>{a!==e.id&&(u(e.id),s([]))},[e]),Go(()=>{o({choice:i}),i.length>=n.minChoices?t(!0):t(!1)},[i]),Ke.createElement(Yr,{className:l("selectListContainer",r)},Ke.createElement(Xr,null,Ke.createElement(Jr,{className:l("selectListTitle",r)},e.title),Ke.createElement(Qr,{appearance:r,className:l("selectListSubtitle",r)},e.subtitle)),n.options.map((c,f)=>{let w=i.includes(c.id);return Ke.createElement(Zr,{key:`select-item-${f}`,onClick:()=>{if(i.includes(c.id)){s(i.filter(T=>T!==c.id));return}i.length<n.maxChoices?s([...i,c.id]):i.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:f===n.options.length-1,className:l("selectListSelectItem",r)},Ke.createElement(Rr,{className:l("selectListItemImage",r)},c.imageUri&&Ke.createElement(ei,{src:c.imageUri,alt:`select-icon-${f}`}),Ke.createElement(ti,{appearance:r,className:l("selectListSelectItemText",r)},c.title)),Ke.createElement(ft,{appearance:r,value:w,primaryColor:r.theme.colorPrimary}))}))};import we,{useEffect as qo,useState as Yt}from"react";import{AnimatePresence as ha,motion as xa}from"framer-motion";var Ca=({children:e,id:t,shouldWrap:o=!1})=>we.createElement(we.Fragment,null,o?we.createElement(ha,{initial:!1},we.createElement(xa.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),bo=({appearance:e,steps:t,selectedStep:o,customStepTypes:r,customVariables:n,onButtonClick:i,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:a,onComplete:u,setVisible:c,setShowModal:f,onDismiss:w,showPagination:T=!1,customFormElements:S,allowBackNavigation:h,validationHandler:E})=>{var Ce;let A={...{linkCollection:Vr,multiInput:Or,callToAction:qr,selectList:oi},...r},{primaryCTAClickSideEffects:y,secondaryCTAClickSideEffects:C}=ne(),[m,x]=Yt(!1),[F,L]=Yt({}),[U,M]=Yt(!1),[I,j]=Yt(!1),[B,$]=Yt(null),re=t[o]??null,{markStepCompleted:R,markStepStarted:_,isLoading:he,updateCustomVariables:Fe,markFlowCompleted:W}=J();qo(()=>{Fe(n)},[n,he]),qo(()=>{window&&h&&!I&&(window.location.hash=t[o].id,j(!0))},[h,I,j]),qo(()=>{var V;if(window&&((V=window==null?void 0:window.location)!=null&&V.hash)&&window.location.hash.replace("#","")!==t[o].id){let de=window.location.hash.replace("#",""),oe=t.findIndex(K=>K.id===de);oe!==-1&&_(p,t[oe].id)}},[(Ce=window==null?void 0:window.location)==null?void 0:Ce.hash,_,o,t]);function se(){return{data:F[t[o].id]??{},stepId:t[o].id,customVariables:n}}function G(V,de,oe){let K=o+1<t.length?t[o+1]:null;i&&i(V,o,de,K),s&&s(V,oe,K,F,se())}function O(V,de){L(oe=>{let K={};return K[V.id]=de,{...oe,...K}})}function te(V){return V.selectedStep.imageUri?we.createElement(zr,{image:V.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let xe=we.createElement(jr,{step:t[o],canContinue:m&&!U,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(M(!0),E){let de=E(t[o],o,t[o+1],F,se());if(de){$(de),M(!1);return}else $(null)}let V={...se()};await R(p,t[o].id,V),o+1<t.length&&await _(p,t[o+1].id),G(t[o],"primary",o),o+1>=t.length&&(u&&u(),w&&w(),a&&(c&&c(!1),f(!1)),await W(p)),y(t[o]),M(!1),window&&h&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{G(t[o],"secondary",o),C(t[o])},onBack:async()=>{o-1>=0&&(M(!0),await _(p,t[o-1].id),M(!1))},steps:t,allowBackNavigation:h,errorMessage:B});return we.createElement(we.Fragment,null,we.createElement(Ur,{className:l("formContainer",e)},we.createElement(_r,null,we.createElement(Ca,{id:o,shouldWrap:d==="large-modal"},we.createElement(Wr,{key:re.id,type:d,className:l("formContent",e)},t.map(V=>{let de=A[V.type];return re.id!==V.id?null:we.createElement(de,{key:V.id,stepData:V,canContinue:m,setCanContinue:x,onSaveData:oe=>{O(V,oe)},appearance:e,customFormElements:S,flowId:p})}),T&&we.createElement(Gr,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),xe))),d=="large-modal"&&we.createElement(te,{selectedStep:t[o]})))};import Xt from"react";import{createGlobalStyle as Sa}from"styled-components";function ie({appearance:e}){if(!e||!e.styleOverrides)return Xt.createElement(Xt.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([r,n])=>typeof n=="object");if(t.length===0)return Xt.createElement(Xt.Fragment,null);let o=Sa`
532
- ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map(([s,p])=>`${Oo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Xt.createElement(o,{inlineStyles:t})}var ri=({flowId:e,customStepTypes:t={},type:o="inline",visible:r,setVisible:n,customVariables:i,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:a=!0,onStepCompletion:u,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:w=!1,modalPosition:T="center",repeatable:S=!1,onDismiss:h,showPagination:E=!1,allowBackNavigation:P=!1,validationHandler:A})=>{let{getFlow:y,getFlowSteps:C,isLoading:m,targetingLogicShouldHideFlow:x,getFlowStatus:F,getCurrentStepIndex:L,markFlowCompleted:U,markFlowNotStarted:M}=J(),I=L(e),{mergeAppearanceWithDefault:j}=Q(),[B,$]=ba(!1),{setOpenFlowState:re,getOpenFlowState:R}=ve();d=j(d);let[_,he]=r!==void 0&&n!==void 0?[r,n]:[R(e,!0),G=>re(e,G)];if(ya(()=>{!B&&!m&&($(!0),F(e)===X&&S&&M(e),$(!0))},[B,$,m]),m)return null;let Fe=y(e);if(!Fe||x(Fe))return null;let W=C(e);if(!W||r!==void 0&&r===!1||F(e)===X&&a)return null;let se=()=>{he(!1),h&&h(),w===!0&&U(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let G={padding:"24px"};return o==="large-modal"?(G.width="85%",G.height="90%",G.maxHeight="800px",G.minHeight="500px",G.padding="0"):G.width="400px",Ue.createElement(Re,{appearance:d,onClose:se,visible:_,style:G,dismissible:f},Ue.createElement(ie,{appearance:d}),Ue.createElement(bo,{appearance:d,steps:W,selectedStep:I,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:A}))}return o==="modal"&&T!=="center"?Ue.createElement(Cr,{appearance:d,onClose:se,visible:_},Ue.createElement(ie,{appearance:d}),Ue.createElement(bo,{appearance:d,steps:W,selectedStep:I,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:A})):Ue.createElement(Ue.Fragment,null,Ue.createElement(ie,{appearance:d}),Ue.createElement(bo,{appearance:d,steps:W,selectedStep:I,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:A}))},ii=ri;import{useCallback as ni,useContext as wa,useEffect as Ta}from"react";function Ko(){let{organizationId:e,userId:t,setOrganizationId:o}=wa(q),{mutateUserFlowState:r}=Be(),{config:n}=$e(),i=Tt(),{verifySDKInitiated:s}=Ft();Ta(()=>{if(t&&e){if(t.startsWith(kt))return;let a=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(a)||(i(`${ke}userGroups`,{...n,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(a,"true"))}},[t,e]);let p=ni(async a=>{if(s(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let u={foreignUserId:t,foreignUserGroupId:e,properties:a};await i(`${ke}userGroups`,{...n,method:"POST",body:JSON.stringify(u)}),r()},[e,t,n,r]),d=ni(async(a,u)=>{if(s(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let f={foreignUserId:t,foreignUserGroupId:e,events:[{event:a,properties:u}]};await i(`${ke}userGroups`,{...n,method:"POST",body:JSON.stringify(f)}),r()},[e,t,n,r]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:p,trackEventForOrganization:d}}var si="xFrigade_guestUserId",li="xFrigade_userId",ai=({})=>{let{setFlowResponses:e}=zt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:r}=Be(),{userId:n,setUserId:i}=Ht(),[s,p]=Yo(null),{getFlowStatus:d}=J(),{flows:a,userProperties:u,setIsNewGuestUser:c,flowResponses:f}=Fa(q),[w,T]=Yo([]),[S,h]=Yo([]),{organizationId:E}=Ko();wo(()=>{if(!o&&t)for(let C=0;C<t.length;C++){let m=t[C],x=a.find(F=>F.slug===(m==null?void 0:m.flowId));if(x&&m&&m.shouldTrigger===!0&&x.type=="FORM"&&x.triggerType==="AUTOMATIC"&&!S.includes(x.slug)){setTimeout(()=>{P(m.flowId)},500);break}}},[o,t]),wo(()=>{f.length>0&&r()},[f]);function P(C){let m=a.find(x=>x.slug===C);m&&m.triggerType==="AUTOMATIC"&&!S.includes(m.slug)&&(h([...S,m.slug]),T([m]))}function A(){if(!n){let C=localStorage.getItem(li);if(C){i(C);return}let m=localStorage.getItem(si);if(m){i(m);return}c(!0);let x=kt+ka();try{localStorage.setItem(si,x)}catch(F){console.log("Failed to save guest user id locally: Local storage unavailable",F)}i(F=>F||x)}}wo(()=>{try{if(a){let C=[];a.forEach(m=>{if(m.data){let x=m.data.match(/"imageUri":"(.*?)"/g);x&&x.forEach(F=>{let L=F.replace('"imageUri":"',"").replace('"',"");if(C.includes(L))return;let U=new Image;U.src=L,C.push(L)})}})}}catch{}},[a]),wo(()=>{if(n!==s&&e([]),p(n),n&&!n.startsWith(kt))try{localStorage.setItem(li,n)}catch(C){console.log("Failed to save user id locally: Local storage available",C)}n===null&&setTimeout(()=>{n===null&&A()},50)},[n,a,u]);function y(){return gt.createElement(gt.Fragment,null,w.map(C=>d(C.slug)!==Le?null:gt.createElement("span",{key:C.slug},gt.createElement(ii,{flowId:C.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return gt.createElement(gt.Fragment,null,gt.createElement(y,null))};import{ErrorBoundary as Ea}from"react-error-boundary";var q=Pa({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:qe,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{}}),Aa=({publicApiKey:e,userId:t,organizationId:o,config:r,children:n})=>{var re,R;let[i,s]=Ne(t||null),[p,d]=Ne(o||null),[a,u]=Ne([]),[c,f]=Ne([]),[w,T]=Ne([]),[S,h]=Ne({}),[E,P]=Ne({}),[A,y]=Ne([]),[C,m]=Ne({}),[x,F]=Ne(!1),[L,U]=Ne(!1),[M,I]=Ne(!$(e)),j=(_,he)=>{if(he==="_blank"){window.open(_,"_blank");return}setTimeout(()=>{window.location.href=_},50)},B={theme:{...qe.theme,...((re=r==null?void 0:r.defaultAppearance)==null?void 0:re.theme)??{}},styleOverrides:{...qe.styleOverrides,...((R=r==null?void 0:r.defaultAppearance)==null?void 0:R.styleOverrides)??{}}};function $(_){return!!(_&&_.length>10&&_.substring(0,10)==="api_public")}return Xo(()=>{t&&s(t)},[t]),Xo(()=>{o&&d(o)},[o]),Xo(()=>{if($(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]),M?ht.createElement(q.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:u,flows:a,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:w,setFlowResponses:T,userProperties:S,setUserProperties:h,openFlowStates:E,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:A,setCompletedFlowsToKeepOpenDuringSession:y,customVariables:C,setCustomVariables:m,isNewGuestUser:x,setIsNewGuestUser:F,hasActiveFullPageFlow:L,setHasActiveFullPageFlow:U,organizationId:p,setOrganizationId:d,navigate:r&&r.navigate?r.navigate:j,defaultAppearance:B,shouldGracefullyDegrade:M,setShouldGracefullyDegrade:I}},n):ht.createElement(Ea,{fallback:ht.createElement(ht.Fragment,null,n)},ht.createElement(q.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:u,flows:a,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:w,setFlowResponses:T,userProperties:S,setUserProperties:h,openFlowStates:E,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:A,setCompletedFlowsToKeepOpenDuringSession:y,customVariables:C,setCustomVariables:m,isNewGuestUser:x,setIsNewGuestUser:F,hasActiveFullPageFlow:L,setHasActiveFullPageFlow:U,organizationId:p,setOrganizationId:d,navigate:r&&r.navigate?r.navigate:j,defaultAppearance:B,shouldGracefullyDegrade:M,setShouldGracefullyDegrade:I}},ht.createElement(va,{theme:B.theme},n,ht.createElement(ai,null))))};import Pp from"react";import pe,{useEffect as _n,useState as Wn}from"react";import De,{useState as Qa}from"react";import St from"styled-components";import ko from"react";import xt from"react";import di from"styled-components";var pi=di.span`
531
+ `;var oi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:r})=>{let n=e.props,[i,s]=Vo([]),[p,d]=Vo(!1),[a,f]=Vo(e.id);return Go(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Go(()=>{a!==e.id&&(f(e.id),s([]))},[e]),Go(()=>{o({choice:i}),i.length>=n.minChoices?t(!0):t(!1)},[i]),Ke.createElement(Yr,{className:l("selectListContainer",r)},Ke.createElement(Xr,null,Ke.createElement(Jr,{className:l("selectListTitle",r)},e.title),Ke.createElement(Qr,{appearance:r,className:l("selectListSubtitle",r)},e.subtitle)),n.options.map((c,u)=>{let w=i.includes(c.id);return Ke.createElement(Zr,{key:`select-item-${u}`,onClick:()=>{if(i.includes(c.id)){s(i.filter(T=>T!==c.id));return}i.length<n.maxChoices?s([...i,c.id]):i.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:u===n.options.length-1,className:l("selectListSelectItem",r)},Ke.createElement(Rr,{className:l("selectListItemImage",r)},c.imageUri&&Ke.createElement(ei,{src:c.imageUri,alt:`select-icon-${u}`}),Ke.createElement(ti,{appearance:r,className:l("selectListSelectItemText",r)},c.title)),Ke.createElement(ft,{appearance:r,value:w,primaryColor:r.theme.colorPrimary}))}))};import we,{useEffect as qo,useState as Yt}from"react";import{AnimatePresence as ha,motion as xa}from"framer-motion";var Ca=({children:e,id:t,shouldWrap:o=!1})=>we.createElement(we.Fragment,null,o?we.createElement(ha,{initial:!1},we.createElement(xa.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),bo=({appearance:e,steps:t,selectedStep:o,customStepTypes:r,customVariables:n,onButtonClick:i,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:a,onComplete:f,setVisible:c,setShowModal:u,onDismiss:w,showPagination:T=!1,customFormElements:S,allowBackNavigation:h,validationHandler:E})=>{var Ce;let A={...{linkCollection:Vr,multiInput:Or,callToAction:qr,selectList:oi},...r},{primaryCTAClickSideEffects:y,secondaryCTAClickSideEffects:C}=ne(),[m,x]=Yt(!1),[F,L]=Yt({}),[U,M]=Yt(!1),[I,j]=Yt(!1),[B,$]=Yt(null),re=t[o]??null,{markStepCompleted:R,markStepStarted:_,isLoading:he,updateCustomVariables:Fe,markFlowCompleted:W}=J();qo(()=>{Fe(n)},[n,he]),qo(()=>{window&&h&&!I&&(window.location.hash=t[o].id,j(!0))},[h,I,j]),qo(()=>{var V;if(window&&((V=window==null?void 0:window.location)!=null&&V.hash)&&window.location.hash.replace("#","")!==t[o].id){let de=window.location.hash.replace("#",""),oe=t.findIndex(K=>K.id===de);oe!==-1&&_(p,t[oe].id)}},[(Ce=window==null?void 0:window.location)==null?void 0:Ce.hash,_,o,t]);function se(){return{data:F[t[o].id]??{},stepId:t[o].id,customVariables:n}}function G(V,de,oe){let K=o+1<t.length?t[o+1]:null;i&&i(V,o,de,K),s&&s(V,oe,K,F,se())}function O(V,de){L(oe=>{let K={};return K[V.id]=de,{...oe,...K}})}function te(V){return V.selectedStep.imageUri?we.createElement(zr,{image:V.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let xe=we.createElement(jr,{step:t[o],canContinue:m&&!U,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(M(!0),E){let de=await E(t[o],o,t[o+1],F,se());if(de){$(de),M(!1);return}else $(null)}let V={...se()};await R(p,t[o].id,V),o+1<t.length&&await _(p,t[o+1].id),G(t[o],"primary",o),o+1>=t.length&&(f&&f(),w&&w(),a&&(c&&c(!1),u(!1)),await W(p)),y(t[o]),M(!1),window&&h&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{G(t[o],"secondary",o),C(t[o])},onBack:async()=>{o-1>=0&&(M(!0),await _(p,t[o-1].id),M(!1))},steps:t,allowBackNavigation:h,errorMessage:B});return we.createElement(we.Fragment,null,we.createElement(Ur,{className:l("formContainer",e)},we.createElement(_r,null,we.createElement(Ca,{id:o,shouldWrap:d==="large-modal"},we.createElement(Wr,{key:re.id,type:d,className:l("formContent",e)},t.map(V=>{let de=A[V.type];return re.id!==V.id?null:we.createElement(de,{key:V.id,stepData:V,canContinue:m,setCanContinue:x,onSaveData:oe=>{O(V,oe)},appearance:e,customFormElements:S,flowId:p})}),T&&we.createElement(Gr,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),xe))),d=="large-modal"&&we.createElement(te,{selectedStep:t[o]})))};import Xt from"react";import{createGlobalStyle as Sa}from"styled-components";function ie({appearance:e}){if(!e||!e.styleOverrides)return Xt.createElement(Xt.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([r,n])=>typeof n=="object");if(t.length===0)return Xt.createElement(Xt.Fragment,null);let o=Sa`
532
+ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map(([s,p])=>`${Oo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Xt.createElement(o,{inlineStyles:t})}var ri=({flowId:e,customStepTypes:t={},type:o="inline",visible:r,setVisible:n,customVariables:i,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:a=!0,onStepCompletion:f,onButtonClick:c,dismissible:u=!0,endFlowOnDismiss:w=!1,modalPosition:T="center",repeatable:S=!1,onDismiss:h,showPagination:E=!1,allowBackNavigation:P=!1,validationHandler:A})=>{let{getFlow:y,getFlowSteps:C,isLoading:m,targetingLogicShouldHideFlow:x,getFlowStatus:F,getCurrentStepIndex:L,markFlowCompleted:U,markFlowNotStarted:M}=J(),I=L(e),{mergeAppearanceWithDefault:j}=Q(),[B,$]=ba(!1),{setOpenFlowState:re,getOpenFlowState:R}=ve();d=j(d);let[_,he]=r!==void 0&&n!==void 0?[r,n]:[R(e,!0),G=>re(e,G)];if(ya(()=>{!B&&!m&&($(!0),F(e)===X&&S&&M(e),$(!0))},[B,$,m]),m)return null;let Fe=y(e);if(!Fe||x(Fe))return null;let W=C(e);if(!W||r!==void 0&&r===!1||F(e)===X&&a)return null;let se=()=>{he(!1),h&&h(),w===!0&&U(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let G={padding:"24px"};return o==="large-modal"?(G.width="85%",G.height="90%",G.maxHeight="800px",G.minHeight="500px",G.padding="0"):G.width="400px",Ue.createElement(Re,{appearance:d,onClose:se,visible:_,style:G,dismissible:u},Ue.createElement(ie,{appearance:d}),Ue.createElement(bo,{appearance:d,steps:W,selectedStep:I,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:A}))}return o==="modal"&&T!=="center"?Ue.createElement(Cr,{appearance:d,onClose:se,visible:_},Ue.createElement(ie,{appearance:d}),Ue.createElement(bo,{appearance:d,steps:W,selectedStep:I,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:A})):Ue.createElement(Ue.Fragment,null,Ue.createElement(ie,{appearance:d}),Ue.createElement(bo,{appearance:d,steps:W,selectedStep:I,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:A}))},ii=ri;import{useCallback as ni,useContext as wa,useEffect as Ta}from"react";function Ko(){let{organizationId:e,userId:t,setOrganizationId:o}=wa(q),{mutateUserFlowState:r}=Be(),{config:n}=$e(),i=Tt(),{verifySDKInitiated:s}=Ft();Ta(()=>{if(t&&e){if(t.startsWith(kt))return;let a=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(a)||(i(`${ke}userGroups`,{...n,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(a,"true"))}},[t,e]);let p=ni(async a=>{if(s(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let f={foreignUserId:t,foreignUserGroupId:e,properties:a};await i(`${ke}userGroups`,{...n,method:"POST",body:JSON.stringify(f)}),r()},[e,t,n,r]),d=ni(async(a,f)=>{if(s(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let u={foreignUserId:t,foreignUserGroupId:e,events:[{event:a,properties:f}]};await i(`${ke}userGroups`,{...n,method:"POST",body:JSON.stringify(u)}),r()},[e,t,n,r]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:p,trackEventForOrganization:d}}var si="xFrigade_guestUserId",li="xFrigade_userId",ai=({})=>{let{setFlowResponses:e}=zt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:r}=Be(),{userId:n,setUserId:i}=Ht(),[s,p]=Yo(null),{getFlowStatus:d}=J(),{flows:a,userProperties:f,setIsNewGuestUser:c,flowResponses:u}=Fa(q),[w,T]=Yo([]),[S,h]=Yo([]),{organizationId:E}=Ko();wo(()=>{if(!o&&t)for(let C=0;C<t.length;C++){let m=t[C],x=a.find(F=>F.slug===(m==null?void 0:m.flowId));if(x&&m&&m.shouldTrigger===!0&&x.type=="FORM"&&x.triggerType==="AUTOMATIC"&&!S.includes(x.slug)){setTimeout(()=>{P(m.flowId)},500);break}}},[o,t]),wo(()=>{u.length>0&&r()},[u]);function P(C){let m=a.find(x=>x.slug===C);m&&m.triggerType==="AUTOMATIC"&&!S.includes(m.slug)&&(h([...S,m.slug]),T([m]))}function A(){if(!n){let C=localStorage.getItem(li);if(C){i(C);return}let m=localStorage.getItem(si);if(m){i(m);return}c(!0);let x=kt+ka();try{localStorage.setItem(si,x)}catch(F){console.log("Failed to save guest user id locally: Local storage unavailable",F)}i(F=>F||x)}}wo(()=>{try{if(a){let C=[];a.forEach(m=>{if(m.data){let x=m.data.match(/"imageUri":"(.*?)"/g);x&&x.forEach(F=>{let L=F.replace('"imageUri":"',"").replace('"',"");if(C.includes(L))return;let U=new Image;U.src=L,C.push(L)})}})}}catch{}},[a]),wo(()=>{if(n!==s&&e([]),p(n),n&&!n.startsWith(kt))try{localStorage.setItem(li,n)}catch(C){console.log("Failed to save user id locally: Local storage available",C)}n===null&&setTimeout(()=>{n===null&&A()},50)},[n,a,f]);function y(){return gt.createElement(gt.Fragment,null,w.map(C=>d(C.slug)!==Le?null:gt.createElement("span",{key:C.slug},gt.createElement(ii,{flowId:C.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return gt.createElement(gt.Fragment,null,gt.createElement(y,null))};import{ErrorBoundary as Ea}from"react-error-boundary";var q=Pa({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:qe,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{}}),Aa=({publicApiKey:e,userId:t,organizationId:o,config:r,children:n})=>{var re,R;let[i,s]=Ne(t||null),[p,d]=Ne(o||null),[a,f]=Ne([]),[c,u]=Ne([]),[w,T]=Ne([]),[S,h]=Ne({}),[E,P]=Ne({}),[A,y]=Ne([]),[C,m]=Ne({}),[x,F]=Ne(!1),[L,U]=Ne(!1),[M,I]=Ne(!$(e)),j=(_,he)=>{if(he==="_blank"){window.open(_,"_blank");return}setTimeout(()=>{window.location.href=_},50)},B={theme:{...qe.theme,...((re=r==null?void 0:r.defaultAppearance)==null?void 0:re.theme)??{}},styleOverrides:{...qe.styleOverrides,...((R=r==null?void 0:r.defaultAppearance)==null?void 0:R.styleOverrides)??{}}};function $(_){return!!(_&&_.length>10&&_.substring(0,10)==="api_public")}return Xo(()=>{t&&s(t)},[t]),Xo(()=>{o&&d(o)},[o]),Xo(()=>{if($(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]),M?ht.createElement(q.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:f,flows:a,failedFlowResponses:c,setFailedFlowResponses:u,flowResponses:w,setFlowResponses:T,userProperties:S,setUserProperties:h,openFlowStates:E,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:A,setCompletedFlowsToKeepOpenDuringSession:y,customVariables:C,setCustomVariables:m,isNewGuestUser:x,setIsNewGuestUser:F,hasActiveFullPageFlow:L,setHasActiveFullPageFlow:U,organizationId:p,setOrganizationId:d,navigate:r&&r.navigate?r.navigate:j,defaultAppearance:B,shouldGracefullyDegrade:M,setShouldGracefullyDegrade:I}},n):ht.createElement(Ea,{fallback:ht.createElement(ht.Fragment,null,n)},ht.createElement(q.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:f,flows:a,failedFlowResponses:c,setFailedFlowResponses:u,flowResponses:w,setFlowResponses:T,userProperties:S,setUserProperties:h,openFlowStates:E,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:A,setCompletedFlowsToKeepOpenDuringSession:y,customVariables:C,setCustomVariables:m,isNewGuestUser:x,setIsNewGuestUser:F,hasActiveFullPageFlow:L,setHasActiveFullPageFlow:U,organizationId:p,setOrganizationId:d,navigate:r&&r.navigate?r.navigate:j,defaultAppearance:B,shouldGracefullyDegrade:M,setShouldGracefullyDegrade:I}},ht.createElement(va,{theme:B.theme},n,ht.createElement(ai,null))))};import Pp from"react";import pe,{useEffect as _n,useState as Wn}from"react";import De,{useState as Qa}from"react";import St from"styled-components";import ko from"react";import xt from"react";import di from"styled-components";var pi=di.span`
533
533
  font-weight: 400;
534
534
  font-size: 15px;
535
535
  line-height: 20px;
@@ -593,7 +593,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
593
593
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
594
594
  margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
595
595
  ${e=>ct(e)}
596
- `,Ma={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},Ua={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},_e=({count:e,total:t,fillColor:o,bgColor:r=La.backgroundColor,display:n="count",textLocation:i="left",style:s={},textStyle:p={},appearance:d})=>{var T,S;if(t===0)return Ct.createElement(Ct.Fragment,null);let a=e===0?"10px":`${e/t*100}%`,u=n==="compact"?"5px":"10px",c=Math.round(e/t*100),f=n==="compact"?"5px":"20px",w;return n==="count"?w=`${e} of ${t}`:n==="compact"?w=`${c}%`:n==="percent"&&(w=`${c}% complete`),i==="top"&&(f="0px"),Ct.createElement(Oa,{className:l("progressBarContainer",d),textLocation:i,styleOverrides:s},Ct.createElement($a,{className:l("progressBarStepText",d),style:{...p,fontSize:n==="compact"?12:15,fontWeight:n==="compact"?400:500},appearance:d,padding:f,textLocation:i},w),Ct.createElement(Da,{textLocation:i,className:l("progressBar",d)},Ct.createElement(Na.div,{style:{...Ua,width:a,height:u,backgroundColor:((T=d==null?void 0:d.theme)==null?void 0:T.colorPrimary)??o,zIndex:n=="compact"?1:5},className:l("progressBarFill",d)}),Ct.createElement("div",{className:l("progressBarBackground",d),style:{...Ma,height:u,backgroundColor:((S=d==null?void 0:d.theme)==null?void 0:S.colorSecondary)??r}})))};import Zt from"react";import _a from"styled-components";import vo from"react";import Po from"react";var Bt=({stepData:e,appearance:t})=>Po.createElement(Po.Fragment,null,Po.createElement(mi,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:me(e.title)}),Po.createElement(ui,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:me(e.subtitle)}));import Qt from"react";var Nt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},r=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Qt.createElement(Qt.Fragment,null,Qt.createElement(xo,null,e.secondaryButtonTitle&&Qt.createElement(ee,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:r,style:{width:"auto",marginRight:"12px"}}),Qt.createElement(ee,{appearance:t,title:e.primaryButtonTitle,onClick:o})))};var Lt=({stepData:e,appearance:t})=>vo.createElement(vo.Fragment,null,vo.createElement(Bt,{stepData:e,appearance:t}),vo.createElement(Nt,{stepData:e,appearance:t}));import hi from"react";function xi(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),hi.createElement("iframe",{width:"480",height:"260",src:`https://www.youtube.com/embed/${t}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:l("checklistStepVideo",e.appearance)})}else return hi.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var Qo="default",Wa=_a.img`
596
+ `,Ma={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},Ua={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},_e=({count:e,total:t,fillColor:o,bgColor:r=La.backgroundColor,display:n="count",textLocation:i="left",style:s={},textStyle:p={},appearance:d})=>{var T,S;if(t===0)return Ct.createElement(Ct.Fragment,null);let a=e===0?"10px":`${e/t*100}%`,f=n==="compact"?"5px":"10px",c=Math.round(e/t*100),u=n==="compact"?"5px":"20px",w;return n==="count"?w=`${e} of ${t}`:n==="compact"?w=`${c}%`:n==="percent"&&(w=`${c}% complete`),i==="top"&&(u="0px"),Ct.createElement(Oa,{className:l("progressBarContainer",d),textLocation:i,styleOverrides:s},Ct.createElement($a,{className:l("progressBarStepText",d),style:{...p,fontSize:n==="compact"?12:15,fontWeight:n==="compact"?400:500},appearance:d,padding:u,textLocation:i},w),Ct.createElement(Da,{textLocation:i,className:l("progressBar",d)},Ct.createElement(Na.div,{style:{...Ua,width:a,height:f,backgroundColor:((T=d==null?void 0:d.theme)==null?void 0:T.colorPrimary)??o,zIndex:n=="compact"?1:5},className:l("progressBarFill",d)}),Ct.createElement("div",{className:l("progressBarBackground",d),style:{...Ma,height:f,backgroundColor:((S=d==null?void 0:d.theme)==null?void 0:S.colorSecondary)??r}})))};import Zt from"react";import _a from"styled-components";import vo from"react";import Po from"react";var Bt=({stepData:e,appearance:t})=>Po.createElement(Po.Fragment,null,Po.createElement(mi,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:me(e.title)}),Po.createElement(ui,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:me(e.subtitle)}));import Qt from"react";var Nt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},r=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Qt.createElement(Qt.Fragment,null,Qt.createElement(xo,null,e.secondaryButtonTitle&&Qt.createElement(ee,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:r,style:{width:"auto",marginRight:"12px"}}),Qt.createElement(ee,{appearance:t,title:e.primaryButtonTitle,onClick:o})))};var Lt=({stepData:e,appearance:t})=>vo.createElement(vo.Fragment,null,vo.createElement(Bt,{stepData:e,appearance:t}),vo.createElement(Nt,{stepData:e,appearance:t}));import hi from"react";function xi(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),hi.createElement("iframe",{width:"480",height:"260",src:`https://www.youtube.com/embed/${t}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:l("checklistStepVideo",e.appearance)})}else return hi.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var Qo="default",Wa=_a.img`
597
597
  border-radius: 4px;
598
598
  max-height: 260px;
599
599
  min-height: 200px;
@@ -698,7 +698,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
698
698
  `,rp=St.div`
699
699
  flex: 2;
700
700
  padding: 2rem;
701
- `,ip=({title:e,subtitle:t,steps:o=[],style:r={},selectedStep:n,setSelectedStep:i,className:s="",customStepTypes:p=new Map,appearance:d,type:a})=>{let{mergeAppearanceWithDefault:u}=Q();d=u(d);let f={...{[Qo]:Ci,[yi]:bi,[Ti]:Fi},...p},[w,T]=Qa(0),S=n??w,h=i??T,E=o.filter(A=>A.complete===!0).length,P=()=>{var A;return!((A=o[S])!=null&&A.type)||!f[o[S].type]?f[Qo]({stepData:o[S],appearance:d}):f[o[S].type]({stepData:o[S],appearance:d})};return De.createElement(Za,{type:a,style:r,className:s,appearance:d},De.createElement(ki,{style:{flex:1}},De.createElement(ki,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},De.createElement(Ra,{className:l("checklistTitle",d),appearance:d},e),De.createElement(ep,{className:l("checklistSubtitle",d),appearance:d},t),De.createElement(_e,{total:o.length,count:E,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),De.createElement(tp,{className:l("checklistStepsContainer",d)},o.map((A,y)=>De.createElement(gi,{data:A,index:y,key:y,listLength:o.length,isSelected:y===S,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{h(y)}})))),De.createElement(op,{appearance:d,className:l("checklistDivider",d)}),De.createElement(rp,null,De.createElement(P,null)))},Zo=ip;import N,{useState as dp}from"react";import Pi from"react";import np from"styled-components";var sp=np.svg`
701
+ `,ip=({title:e,subtitle:t,steps:o=[],style:r={},selectedStep:n,setSelectedStep:i,className:s="",customStepTypes:p=new Map,appearance:d,type:a})=>{let{mergeAppearanceWithDefault:f}=Q();d=f(d);let u={...{[Qo]:Ci,[yi]:bi,[Ti]:Fi},...p},[w,T]=Qa(0),S=n??w,h=i??T,E=o.filter(A=>A.complete===!0).length,P=()=>{var A;return!((A=o[S])!=null&&A.type)||!u[o[S].type]?u[Qo]({stepData:o[S],appearance:d}):u[o[S].type]({stepData:o[S],appearance:d})};return De.createElement(Za,{type:a,style:r,className:s,appearance:d},De.createElement(ki,{style:{flex:1}},De.createElement(ki,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},De.createElement(Ra,{className:l("checklistTitle",d),appearance:d},e),De.createElement(ep,{className:l("checklistSubtitle",d),appearance:d},t),De.createElement(_e,{total:o.length,count:E,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),De.createElement(tp,{className:l("checklistStepsContainer",d)},o.map((A,y)=>De.createElement(gi,{data:A,index:y,key:y,listLength:o.length,isSelected:y===S,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{h(y)}})))),De.createElement(op,{appearance:d,className:l("checklistDivider",d)}),De.createElement(rp,null,De.createElement(P,null)))},Zo=ip;import N,{useState as dp}from"react";import Pi from"react";import np from"styled-components";var sp=np.svg`
702
702
  transition: 'transform 0.35s ease-in-out';
703
703
  `,Dt=({color:e="#323232",style:t,className:o})=>Pi.createElement(sp,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},Pi.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as cp}from"framer-motion";import ue from"styled-components";var Ro={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},vi=ue.div`
704
704
  max-height: 350px;
@@ -913,7 +913,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
913
913
  line-height: 14px;
914
914
  font-weight: 400;
915
915
  cursor: pointer;
916
- `;var pp=({steps:e,style:t,title:o,primaryColor:r,appearance:n,onButtonClick:i})=>{let{primaryCTAClickSideEffects:s}=ne();return Je.createElement(qi,{style:t,className:l("guideContainer",n)},Je.createElement(Yi,{className:l("guideTitle",n)},o),Je.createElement(Ki,{className:l("guideItemContainer",n)},e.map((p,d)=>Je.createElement(Xi,{key:`guide-${p.id??d}`,as:ap.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:l("guideItem",n)},p.icon&&Je.createElement(Ji,{className:l("guideIcon",n)},Je.createElement(Qi,null,p.icon)),Je.createElement(Zi,{className:l("guideItemTitle",n),dangerouslySetInnerHTML:me(p.title)}),Je.createElement(Ri,{className:l("guideItemSubtitle",n),dangerouslySetInnerHTML:me(p.subtitle)}),Je.createElement(en,{className:l("guideItemLink",n),color:r,onClick:()=>{p.primaryButtonUri&&s(p),i&&i(p)}},p.primaryButtonTitle)))))},Rt=pp;var mp=({steps:e,title:t,subtitle:o,stepsTitle:r,visible:n,onClose:i,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:a,guideData:u,guideTitle:c,onGuideButtonClick:f})=>{let w=({stepData:m,handleSecondaryCTAClick:x,handleCTAClick:F})=>m?N.createElement($i,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},N.createElement(Mi,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:me(m.title)}),N.createElement(Ui,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:me(m.subtitle)}),N.createElement(_i,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&N.createElement(ee,{title:m.secondaryButtonTitle,onClick:x,appearance:a,secondary:!0}),N.createElement(ee,{title:m.primaryButtonTitle,onClick:F,appearance:a}))):N.createElement(N.Fragment,null),S={...{default:m=>{var U;if((U=e[P])!=null&&U.StepContent){let M=e[P].StepContent;return N.createElement("div",null,M)}let x=e[P];return N.createElement(w,{stepData:m,handleCTAClick:()=>{x.handlePrimaryButtonClick&&x.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{x.handleSecondaryButtonClick&&x.handleSecondaryButtonClick()}})}},...d},[h,E]=dp(0),P=s??h,A=p??E,y=()=>{var m;return e?!((m=e[P])!=null&&m.type)||!S[e[P].type]?S.default(e[P]):S[e[P].type]({stepData:e[P],primaryColor:a.theme.colorPrimary}):N.createElement(N.Fragment,null)},C=e.filter(m=>m.complete).length;return n?(a.theme.modalContainer||(a.theme.borderRadius&&(Ro.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=Ro),N.createElement(Re,{onClose:i,visible:n,appearance:a},N.createElement(Gi,null,N.createElement(Ei,null,N.createElement(Ai,{appearance:a,className:l("checklistTitle",a)},t),N.createElement(Ii,{appearance:a,className:l("checklistSubtitle",a)},o)),N.createElement(vi,null,e&&e.length>0&&N.createElement(Bi,{className:l("stepsContainer",a)},N.createElement(Ni,null,N.createElement("div",{style:{flex:3}},N.createElement(Li,{className:l("stepsTitle",a)},r)),N.createElement(ji,null,N.createElement(_e,{fillColor:a.theme.colorPrimary,style:{width:"100%"},count:C,total:e.length,appearance:a}))),N.createElement(Oi,null,N.createElement(Di,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,x)=>{let F=P===x;return N.createElement(Wi,{selected:F,className:l(`checklistStepListItem${F?"Selected":""}`,a),key:`checklist-guide-step-${m.id??x}`,disabled:m.blocked,onClick:()=>{m.blocked||A(x)},title:m.blocked?"Finish remaining steps to continue":void 0},F&&N.createElement(Fo,{className:l("checklistStepItemSelectedIndicator",a),as:cp.div,layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),N.createElement(zi,{selected:F,className:l(`checklistStepListStepName${F?"Selected":""}`,a)},m.stepName),N.createElement(Hi,null,N.createElement(ft,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),N.createElement(Vi,null,N.createElement(Dt,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),N.createElement(y,null))),u&&u.length>0&&N.createElement(Rt,{steps:u,title:c,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(f&&f(m),!0)}))))):N.createElement(N.Fragment,null)},er=mp;import{useEffect as up,useState as fp}from"react";var tn=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,r]=fp(t),n=null,i=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,a])=>{if(!window)return[d,!1];let u=window.matchMedia(a);return u.addEventListener("change",i),[d,u.matches]}));r(p)};return up(()=>{s()},[]),o};import Pe,{useEffect as xn,useState as xp}from"react";import fe from"react";import{AnimatePresence as gp,motion as hp}from"framer-motion";import Qe from"styled-components";var on=Qe.div`
916
+ `;var pp=({steps:e,style:t,title:o,primaryColor:r,appearance:n,onButtonClick:i})=>{let{primaryCTAClickSideEffects:s}=ne();return Je.createElement(qi,{style:t,className:l("guideContainer",n)},Je.createElement(Yi,{className:l("guideTitle",n)},o),Je.createElement(Ki,{className:l("guideItemContainer",n)},e.map((p,d)=>Je.createElement(Xi,{key:`guide-${p.id??d}`,as:ap.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:l("guideItem",n)},p.icon&&Je.createElement(Ji,{className:l("guideIcon",n)},Je.createElement(Qi,null,p.icon)),Je.createElement(Zi,{className:l("guideItemTitle",n),dangerouslySetInnerHTML:me(p.title)}),Je.createElement(Ri,{className:l("guideItemSubtitle",n),dangerouslySetInnerHTML:me(p.subtitle)}),Je.createElement(en,{className:l("guideItemLink",n),color:r,onClick:()=>{p.primaryButtonUri&&s(p),i&&i(p)}},p.primaryButtonTitle)))))},Rt=pp;var mp=({steps:e,title:t,subtitle:o,stepsTitle:r,visible:n,onClose:i,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:a,guideData:f,guideTitle:c,onGuideButtonClick:u})=>{let w=({stepData:m,handleSecondaryCTAClick:x,handleCTAClick:F})=>m?N.createElement($i,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},N.createElement(Mi,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:me(m.title)}),N.createElement(Ui,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:me(m.subtitle)}),N.createElement(_i,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&N.createElement(ee,{title:m.secondaryButtonTitle,onClick:x,appearance:a,secondary:!0}),N.createElement(ee,{title:m.primaryButtonTitle,onClick:F,appearance:a}))):N.createElement(N.Fragment,null),S={...{default:m=>{var U;if((U=e[P])!=null&&U.StepContent){let M=e[P].StepContent;return N.createElement("div",null,M)}let x=e[P];return N.createElement(w,{stepData:m,handleCTAClick:()=>{x.handlePrimaryButtonClick&&x.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{x.handleSecondaryButtonClick&&x.handleSecondaryButtonClick()}})}},...d},[h,E]=dp(0),P=s??h,A=p??E,y=()=>{var m;return e?!((m=e[P])!=null&&m.type)||!S[e[P].type]?S.default(e[P]):S[e[P].type]({stepData:e[P],primaryColor:a.theme.colorPrimary}):N.createElement(N.Fragment,null)},C=e.filter(m=>m.complete).length;return n?(a.theme.modalContainer||(a.theme.borderRadius&&(Ro.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=Ro),N.createElement(Re,{onClose:i,visible:n,appearance:a},N.createElement(Gi,null,N.createElement(Ei,null,N.createElement(Ai,{appearance:a,className:l("checklistTitle",a)},t),N.createElement(Ii,{appearance:a,className:l("checklistSubtitle",a)},o)),N.createElement(vi,null,e&&e.length>0&&N.createElement(Bi,{className:l("stepsContainer",a)},N.createElement(Ni,null,N.createElement("div",{style:{flex:3}},N.createElement(Li,{className:l("stepsTitle",a)},r)),N.createElement(ji,null,N.createElement(_e,{fillColor:a.theme.colorPrimary,style:{width:"100%"},count:C,total:e.length,appearance:a}))),N.createElement(Oi,null,N.createElement(Di,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,x)=>{let F=P===x;return N.createElement(Wi,{selected:F,className:l(`checklistStepListItem${F?"Selected":""}`,a),key:`checklist-guide-step-${m.id??x}`,disabled:m.blocked,onClick:()=>{m.blocked||A(x)},title:m.blocked?"Finish remaining steps to continue":void 0},F&&N.createElement(Fo,{className:l("checklistStepItemSelectedIndicator",a),as:cp.div,layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),N.createElement(zi,{selected:F,className:l(`checklistStepListStepName${F?"Selected":""}`,a)},m.stepName),N.createElement(Hi,null,N.createElement(ft,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),N.createElement(Vi,null,N.createElement(Dt,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),N.createElement(y,null))),f&&f.length>0&&N.createElement(Rt,{steps:f,title:c,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(u&&u(m),!0)}))))):N.createElement(N.Fragment,null)},er=mp;import{useEffect as up,useState as fp}from"react";var tn=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,r]=fp(t),n=null,i=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,a])=>{if(!window)return[d,!1];let f=window.matchMedia(a);return f.addEventListener("change",i),[d,f.matches]}));r(p)};return up(()=>{s()},[]),o};import Pe,{useEffect as xn,useState as xp}from"react";import fe from"react";import{AnimatePresence as gp,motion as hp}from"framer-motion";import Qe from"styled-components";var on=Qe.div`
917
917
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
918
918
  border: 1px solid;
919
919
  border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -960,7 +960,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
960
960
  flex-direction: row;
961
961
  justify-content: flex-start;
962
962
  align-items: center;
963
- `;var cn=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:r,onSecondaryButtonClick:n,appearance:i,customStepTypes:s})=>{var u,c;let p=t?{}:{transform:"rotate(90deg)"};function d(){return fe.createElement(fe.Fragment,null,e.imageUri||e.videoUri?fe.createElement(rn,{className:l("stepMediaContainer",i)},e.imageUri?fe.createElement(nn,{className:l("stepImage",i),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?fe.createElement(Et,{appearance:i,videoUri:e.videoUri}):null):null,fe.createElement(pn,{className:l("stepSubtitle",i),appearance:i,dangerouslySetInnerHTML:me(e.subtitle)}),fe.createElement(xo,{className:l("checklistCTAContainer",i)},e.secondaryButtonTitle?fe.createElement(ee,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:i}):null,fe.createElement(ee,{title:e.primaryButtonTitle??"Continue",onClick:()=>r(),appearance:i})))}function a(){if(!s)return null;let f=s[e.type];return f?f(e,i):null}return fe.createElement(on,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:l("checklistStepContainer",i),appearance:i},fe.createElement(sn,{className:l("stepHeader",i)},fe.createElement(dn,null,fe.createElement(To,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(u=i==null?void 0:i.theme)==null?void 0:u.colorPrimary,appearance:i}),fe.createElement(ln,{appearance:i,className:l("stepTitle",i),dangerouslySetInnerHTML:me(e.title)})),fe.createElement(an,{className:l("stepChevronContainer",i),onClick:()=>o()},fe.createElement(Dt,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(c=i==null?void 0:i.theme)==null?void 0:c.colorTextSecondary}))),fe.createElement(gp,null,!t&&fe.createElement(hp.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},a()??d())))};import $t from"styled-components";var tx=$t.div`
963
+ `;var cn=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:r,onSecondaryButtonClick:n,appearance:i,customStepTypes:s})=>{var f,c;let p=t?{}:{transform:"rotate(90deg)"};function d(){return fe.createElement(fe.Fragment,null,e.imageUri||e.videoUri?fe.createElement(rn,{className:l("stepMediaContainer",i)},e.imageUri?fe.createElement(nn,{className:l("stepImage",i),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?fe.createElement(Et,{appearance:i,videoUri:e.videoUri}):null):null,fe.createElement(pn,{className:l("stepSubtitle",i),appearance:i,dangerouslySetInnerHTML:me(e.subtitle)}),fe.createElement(xo,{className:l("checklistCTAContainer",i)},e.secondaryButtonTitle?fe.createElement(ee,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:i}):null,fe.createElement(ee,{title:e.primaryButtonTitle??"Continue",onClick:()=>r(),appearance:i})))}function a(){if(!s)return null;let u=s[e.type];return u?u(e,i):null}return fe.createElement(on,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:l("checklistStepContainer",i),appearance:i},fe.createElement(sn,{className:l("stepHeader",i)},fe.createElement(dn,null,fe.createElement(To,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(f=i==null?void 0:i.theme)==null?void 0:f.colorPrimary,appearance:i}),fe.createElement(ln,{appearance:i,className:l("stepTitle",i),dangerouslySetInnerHTML:me(e.title)})),fe.createElement(an,{className:l("stepChevronContainer",i),onClick:()=>o()},fe.createElement(Dt,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(c=i==null?void 0:i.theme)==null?void 0:c.colorTextSecondary}))),fe.createElement(gp,null,!t&&fe.createElement(hp.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},a()??d())))};import $t from"styled-components";var tx=$t.div`
964
964
  background: #ffffff;
965
965
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
966
966
  border-radius: 6px;
@@ -1000,7 +1000,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
1000
1000
  justify-content: space-between;
1001
1001
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1002
1002
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
1003
- `;var Cp=({title:e,subtitle:t,steps:o,onClose:r,visible:n,onCompleteStep:i,autoExpandFirstIncompleteStep:s=!0,autoCollapse:p=!0,autoExpandNextStep:d=!0,primaryColor:a="#000000",selectedStep:u,setSelectedStep:c,appearance:f,type:w,className:T,customStepTypes:S})=>{let h=o.filter(m=>m.complete).length,[E,P]=xp(Array(o.length).fill(!0));xn(()=>{let m=[...E];if(s){for(let x=0;x<o.length;x++)if(!o[x].complete){m[x]=!1;break}P(m)}},[]),xn(()=>{A(u)},[u]);let A=m=>{let x=[...E];if(p)for(let F=0;F<E.length;++F)F!==m&&(x[F]=!0);x[m]=!x[m],P(x)};if(!n&&w=="modal")return Pe.createElement(Pe.Fragment,null);let y=Pe.createElement(Pe.Fragment,null,Pe.createElement(mn,null,Pe.createElement(un,{appearance:f,className:l("checklistTitle",f),dangerouslySetInnerHTML:me(e)}),Pe.createElement(fn,{appearance:f,className:l("checklistSubtitle",f),dangerouslySetInnerHTML:me(t)})),Pe.createElement(_e,{display:"percent",count:h,total:o.length,fillColor:a,style:{margin:"14px 0px 8px 0px"},appearance:f})),C=Pe.createElement(gn,{className:ye(l("checklistContainer",f),T)},o.map((m,x)=>{let F=E[x];return Pe.createElement(cn,{appearance:f,stepData:m,collapsed:F,key:`modal-checklist-${m.id??x}`,onClick:()=>{if(u===x){A(x);return}c(x)},onPrimaryButtonClick:()=>{i&&i(x,m),m.handlePrimaryButtonClick&&m.handlePrimaryButtonClick(),d&&!m.completionCriteria&&x<E.length-1&&E[x+1]&&c(x+1)},onSecondaryButtonClick:()=>{m.handleSecondaryButtonClick&&m.handleSecondaryButtonClick()},customStepTypes:S})}));return w==="inline"?Pe.createElement(hn,{appearance:f,className:ye(l("checklistInlineContainer",f),T)},y,C):Pe.createElement(Pe.Fragment,null,Pe.createElement(Re,{onClose:r,visible:n,appearance:f,style:{maxWidth:"600px"},headerContent:y},C))},tr=Cp;import ae,{useEffect as or,useRef as Fp,useState as bt}from"react";import yt from"react";import le,{css as Cn,keyframes as Sn}from"styled-components";var yn=Cn`
1003
+ `;var Cp=({title:e,subtitle:t,steps:o,onClose:r,visible:n,onCompleteStep:i,autoExpandFirstIncompleteStep:s=!0,autoCollapse:p=!0,autoExpandNextStep:d=!0,primaryColor:a="#000000",selectedStep:f,setSelectedStep:c,appearance:u,type:w,className:T,customStepTypes:S})=>{let h=o.filter(m=>m.complete).length,[E,P]=xp(Array(o.length).fill(!0));xn(()=>{let m=[...E];if(s){for(let x=0;x<o.length;x++)if(!o[x].complete){m[x]=!1;break}P(m)}},[]),xn(()=>{A(f)},[f]);let A=m=>{let x=[...E];if(p)for(let F=0;F<E.length;++F)F!==m&&(x[F]=!0);x[m]=!x[m],P(x)};if(!n&&w=="modal")return Pe.createElement(Pe.Fragment,null);let y=Pe.createElement(Pe.Fragment,null,Pe.createElement(mn,null,Pe.createElement(un,{appearance:u,className:l("checklistTitle",u),dangerouslySetInnerHTML:me(e)}),Pe.createElement(fn,{appearance:u,className:l("checklistSubtitle",u),dangerouslySetInnerHTML:me(t)})),Pe.createElement(_e,{display:"percent",count:h,total:o.length,fillColor:a,style:{margin:"14px 0px 8px 0px"},appearance:u})),C=Pe.createElement(gn,{className:ye(l("checklistContainer",u),T)},o.map((m,x)=>{let F=E[x];return Pe.createElement(cn,{appearance:u,stepData:m,collapsed:F,key:`modal-checklist-${m.id??x}`,onClick:()=>{if(f===x){A(x);return}c(x)},onPrimaryButtonClick:()=>{i&&i(x,m),m.handlePrimaryButtonClick&&m.handlePrimaryButtonClick(),d&&!m.completionCriteria&&x<E.length-1&&E[x+1]&&c(x+1)},onSecondaryButtonClick:()=>{m.handleSecondaryButtonClick&&m.handleSecondaryButtonClick()},customStepTypes:S})}));return w==="inline"?Pe.createElement(hn,{appearance:u,className:ye(l("checklistInlineContainer",u),T)},y,C):Pe.createElement(Pe.Fragment,null,Pe.createElement(Re,{onClose:r,visible:n,appearance:u,style:{maxWidth:"600px"},headerContent:y},C))},tr=Cp;import ae,{useEffect as or,useRef as Fp,useState as bt}from"react";import yt from"react";import le,{css as Cn,keyframes as Sn}from"styled-components";var yn=Cn`
1004
1004
  border: 1px solid ${({theme:e})=>e.colorBorder};
1005
1005
  `,Sp=Cn`
1006
1006
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
@@ -1135,7 +1135,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
1135
1135
  color: ${({theme:e})=>e.colorTextSecondary};
1136
1136
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1137
1137
  `}
1138
- `;var Dn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:r}=Q(),{primaryCTAClickSideEffects:n}=ne(),{theme:i,styleOverrides:s}=r(o),{imageUri:p=null,subtitle:d=null,title:a=null,complete:u=!1,blocked:c=!1}=e,f=()=>{n(e)};return yt.createElement(Pn,{className:l("carouselCard",o),onClick:c?null:f,style:t,blocked:c,complete:u},yt.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&yt.createElement(vn,{className:l("carouselCardImage",o),src:p,alt:a,style:{opacity:u||c?.4:1}}),u&&yt.createElement(Bn,{className:l("carouselCompletedPill",o)},yt.createElement(On,{style:{color:"#108E0B"}},"Complete"))),a&&yt.createElement(Ln,{blocked:c,complete:u,className:l("carouselCardTitle",o)},a),d&&yt.createElement(We.Quiet,{blocked:c,complete:u,className:l("carouselCardSubtitle",o)},d))};import eo from"react";var $n=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let r=t>0?e/t:0,n=200,i=Math.min(n,Math.max(10,Math.round(n*r)));return eo.createElement(An,{className:l("carouselProgressBar",o)},eo.createElement(In,{as:We.Loud,style:{marginRight:8}},e," of ",t),eo.createElement("svg",{height:10,width:n},eo.createElement("rect",{x:0,y:0,rx:5,width:n,height:10,fill:"#E6E6E6"}),eo.createElement("rect",{x:0,y:0,rx:5,width:i,height:10,fill:"currentColor"})))};var kp=()=>ae.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ae.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ae.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Mn=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[r,n]=bt(!1),[i,s]=bt(!1);or(()=>{t===!0&&r===!1?n(!0):t===!1&&r===!0&&s(!0)},[t]);let p=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return r?ae.createElement(Tn,{style:d,reversed:i,onAnimationEnd:i?p:null},ae.createElement(Fn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ae.createElement(kp,null))):null},Un=({flowId:e,appearance:t,customVariables:o,className:r})=>{let n=Fp(null),[i,s]=bt(!1),[p,d]=bt(!1),[a,u]=bt(null),[c,f]=bt([]),[w,T]=bt(0),{getFlowMetadata:S,getFlowSteps:h,getNumberOfStepsCompleted:E,updateCustomVariables:P,getFlowStatus:A,isLoading:y,targetingLogicShouldHideFlow:C,getFlow:m}=J();or(()=>{P(o)},[o,y]),or(()=>{if(y)return;let I=S(e),j=E(e),B=h(e);u(I),I.data!==null&&(f(B.sort(($,re)=>Number($.complete)-Number(re.complete))),d(B.length>3),T(j))},[y]);let x=[];for(let I=0;I<c.length;I+=3)x.push(c.slice(I,I+3));let F=I=>{let j=I.target,B=j.scrollWidth-j.clientWidth,$=Math.ceil(j.scrollLeft);$>0&&i===!1&&s(!0),$===0&&i===!0&&s(!1),$<B&&p===!1&&d(!0),$===B&&p===!0&&d(!1)},L=(I=!0)=>{let j=I?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*j,behavior:"smooth"})},U=null,M=I=>{U!==null?clearTimeout(U):F(I),U=setTimeout(()=>{F(I)},16)};return y?null:ae.createElement(En,{className:ye(l("carouselContainer",t),r)},ae.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},ae.createElement("div",null,ae.createElement(Nn,{className:l("carouselTitle",t)},a==null?void 0:a.title),ae.createElement(We.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),ae.createElement($n,{numberOfStepsCompleted:w,numberOfSteps:c.length})),ae.createElement("div",{style:{position:"relative"}},ae.createElement(Mn,{show:i,onClick:()=>L(!1)}),ae.createElement(Mn,{side:"right",show:p,onClick:L}),ae.createElement(bn,{ref:n,onScroll:M},x.map((I,j)=>ae.createElement(wn,{key:j,style:{flex:`0 0 calc(100% - ${c.length>3?36:0}px)`}},I.map((B,$)=>ae.createElement(Dn,{key:$,stepData:B,style:{flex:c.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var rr=({flowId:e,title:t,subtitle:o,style:r,initialSelectedStep:n,className:i,type:s="inline",onDismiss:p,visible:d,customVariables:a,onStepCompletion:u,onButtonClick:c,appearance:f,hideOnFlowCompletion:w,setVisible:T,customStepTypes:S,checklistStyle:h="default",autoExpandFirstIncompleteStep:E,autoExpandNextStep:P,...A})=>{let{getFlow:y,getFlowSteps:C,markStepCompleted:m,getStepStatus:x,getNumberOfStepsCompleted:F,isLoading:L,targetingLogicShouldHideFlow:U,updateCustomVariables:M,getFlowMetadata:I,isStepBlocked:j,getFlowStatus:B,hasActiveFullPageFlow:$,setHasActiveFullPageFlow:re}=J(),{primaryCTAClickSideEffects:R,secondaryCTAClickSideEffects:_}=ne(),{getOpenFlowState:he,setOpenFlowState:Fe}=ve(),[W,se]=Wn(n||0),[G,O]=Wn(!1),te=d===void 0?he(e):d,xe=s==="modal",{mergeAppearanceWithDefault:Ce}=Q(),{isLarge:V}=tn();if(f=Ce(f),_n(()=>{M(a)},[a,L]),_n(()=>{d!==void 0&&(xe&&d===!0?re(!0):xe&&d===!1&&re(!1))},[d,T,$]),L)return null;let de=y(e);if(!de||U(de))return null;let oe=C(e);if(!oe||w===!0&&B(e)===X)return null;let K=I(e);if(K!=null&&K.title&&(t=K.title),K!=null&&K.subtitle&&(o=K.subtitle),!G&&n===void 0&&F(e)>0){let z=Math.min(F(e),oe.length-1);se(z),O(!0)}function je(){if(W+1>=oe.length){xe&&Fe(e,!1);return}j(e,oe[W+1].id)||se(W+1)}function Ge(z,at,io){let dr=W+1<oe.length?oe[W+1]:null;c&&c(z,W,at,dr)===!0&&xe&&g(),u&&u(z,io,dr),!u&&!c&&(z.primaryButtonUri||z.secondaryButtonUri)&&xe&&g()}function Y(){return oe.map((z,at)=>({...z,handleSecondaryButtonClick:()=>{je(),_(z),z.skippable===!0&&m(e,z.id,{skipped:!0}),Ge(z,"secondary",at)},handlePrimaryButtonClick:()=>{(!z.completionCriteria&&(z.autoMarkCompleted||z.autoMarkCompleted===void 0)||z.completionCriteria&&z.autoMarkCompleted===!0)&&(m(e,z.id),je()),Ge(z,"primary",at),R(z),x(e,z.id)===Oe&&je()}}))}function Se(){return pe.createElement(ie,{appearance:f})}let lt={steps:Y(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:S,type:s,className:i,autoExpandFirstIncompleteStep:E,autoExpandNextStep:P};function g(){Fe(e,!1),p&&p(),T&&T(!1)}function b(){return pe.createElement(pe.Fragment,null,pe.createElement(Se,null),pe.createElement(Un,{flowId:e,appearance:f,customVariables:a,className:i}))}function v(){return pe.createElement(pe.Fragment,null,pe.createElement(Se,null),pe.createElement(tr,{visible:te,onClose:()=>{g()},selectedStep:W,setSelectedStep:se,autoExpandNextStep:!0,appearance:f,...lt}))}function H(){if(!V)return v();let z=A.guideFlowId,at;return z&&y(z)&&(at=C(z)),pe.createElement(pe.Fragment,null,pe.createElement(Se,null),pe.createElement(er,{visible:te,stepsTitle:K.stepsTitle?K.stepsTitle:"Your quick start guide",onClose:()=>{g()},selectedStep:W,setSelectedStep:se,guideData:at,guideTitle:A.guideTitle??"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:io=>{Ge(io,"link",0)},customStepTypes:S,...lt}))}function ce(){if(!V)return v();let z=pe.createElement(Zo,{flowId:e,style:r,selectedStep:W,setSelectedStep:se,appearance:f,type:s,...lt});return xe?pe.createElement(Re,{onClose:()=>{g()},visible:te,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},pe.createElement(Se,null),z):pe.createElement(pe.Fragment,null,pe.createElement(Se,null),z)}switch(h){case"condensed":return v();case"with-guide":return H();case"default":return ce();case"carousel":return b();default:return ce()}};var vp=e=>Pp.createElement(rr,{type:"inline",...e});import nt,{useEffect as Ap}from"react";import ze from"react";import Ao from"styled-components";var zn=Ao.div`
1138
+ `;var Dn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:r}=Q(),{primaryCTAClickSideEffects:n}=ne(),{theme:i,styleOverrides:s}=r(o),{imageUri:p=null,subtitle:d=null,title:a=null,complete:f=!1,blocked:c=!1}=e,u=()=>{n(e)};return yt.createElement(Pn,{className:l("carouselCard",o),onClick:c?null:u,style:t,blocked:c,complete:f},yt.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&yt.createElement(vn,{className:l("carouselCardImage",o),src:p,alt:a,style:{opacity:f||c?.4:1}}),f&&yt.createElement(Bn,{className:l("carouselCompletedPill",o)},yt.createElement(On,{style:{color:"#108E0B"}},"Complete"))),a&&yt.createElement(Ln,{blocked:c,complete:f,className:l("carouselCardTitle",o)},a),d&&yt.createElement(We.Quiet,{blocked:c,complete:f,className:l("carouselCardSubtitle",o)},d))};import eo from"react";var $n=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let r=t>0?e/t:0,n=200,i=Math.min(n,Math.max(10,Math.round(n*r)));return eo.createElement(An,{className:l("carouselProgressBar",o)},eo.createElement(In,{as:We.Loud,style:{marginRight:8}},e," of ",t),eo.createElement("svg",{height:10,width:n},eo.createElement("rect",{x:0,y:0,rx:5,width:n,height:10,fill:"#E6E6E6"}),eo.createElement("rect",{x:0,y:0,rx:5,width:i,height:10,fill:"currentColor"})))};var kp=()=>ae.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ae.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ae.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Mn=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[r,n]=bt(!1),[i,s]=bt(!1);or(()=>{t===!0&&r===!1?n(!0):t===!1&&r===!0&&s(!0)},[t]);let p=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return r?ae.createElement(Tn,{style:d,reversed:i,onAnimationEnd:i?p:null},ae.createElement(Fn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ae.createElement(kp,null))):null},Un=({flowId:e,appearance:t,customVariables:o,className:r})=>{let n=Fp(null),[i,s]=bt(!1),[p,d]=bt(!1),[a,f]=bt(null),[c,u]=bt([]),[w,T]=bt(0),{getFlowMetadata:S,getFlowSteps:h,getNumberOfStepsCompleted:E,updateCustomVariables:P,getFlowStatus:A,isLoading:y,targetingLogicShouldHideFlow:C,getFlow:m}=J();or(()=>{P(o)},[o,y]),or(()=>{if(y)return;let I=S(e),j=E(e),B=h(e);f(I),I.data!==null&&(u(B.sort(($,re)=>Number($.complete)-Number(re.complete))),d(B.length>3),T(j))},[y]);let x=[];for(let I=0;I<c.length;I+=3)x.push(c.slice(I,I+3));let F=I=>{let j=I.target,B=j.scrollWidth-j.clientWidth,$=Math.ceil(j.scrollLeft);$>0&&i===!1&&s(!0),$===0&&i===!0&&s(!1),$<B&&p===!1&&d(!0),$===B&&p===!0&&d(!1)},L=(I=!0)=>{let j=I?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*j,behavior:"smooth"})},U=null,M=I=>{U!==null?clearTimeout(U):F(I),U=setTimeout(()=>{F(I)},16)};return y?null:ae.createElement(En,{className:ye(l("carouselContainer",t),r)},ae.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},ae.createElement("div",null,ae.createElement(Nn,{className:l("carouselTitle",t)},a==null?void 0:a.title),ae.createElement(We.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),ae.createElement($n,{numberOfStepsCompleted:w,numberOfSteps:c.length})),ae.createElement("div",{style:{position:"relative"}},ae.createElement(Mn,{show:i,onClick:()=>L(!1)}),ae.createElement(Mn,{side:"right",show:p,onClick:L}),ae.createElement(bn,{ref:n,onScroll:M},x.map((I,j)=>ae.createElement(wn,{key:j,style:{flex:`0 0 calc(100% - ${c.length>3?36:0}px)`}},I.map((B,$)=>ae.createElement(Dn,{key:$,stepData:B,style:{flex:c.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var rr=({flowId:e,title:t,subtitle:o,style:r,initialSelectedStep:n,className:i,type:s="inline",onDismiss:p,visible:d,customVariables:a,onStepCompletion:f,onButtonClick:c,appearance:u,hideOnFlowCompletion:w,setVisible:T,customStepTypes:S,checklistStyle:h="default",autoExpandFirstIncompleteStep:E,autoExpandNextStep:P,...A})=>{let{getFlow:y,getFlowSteps:C,markStepCompleted:m,getStepStatus:x,getNumberOfStepsCompleted:F,isLoading:L,targetingLogicShouldHideFlow:U,updateCustomVariables:M,getFlowMetadata:I,isStepBlocked:j,getFlowStatus:B,hasActiveFullPageFlow:$,setHasActiveFullPageFlow:re}=J(),{primaryCTAClickSideEffects:R,secondaryCTAClickSideEffects:_}=ne(),{getOpenFlowState:he,setOpenFlowState:Fe}=ve(),[W,se]=Wn(n||0),[G,O]=Wn(!1),te=d===void 0?he(e):d,xe=s==="modal",{mergeAppearanceWithDefault:Ce}=Q(),{isLarge:V}=tn();if(u=Ce(u),_n(()=>{M(a)},[a,L]),_n(()=>{d!==void 0&&(xe&&d===!0?re(!0):xe&&d===!1&&re(!1))},[d,T,$]),L)return null;let de=y(e);if(!de||U(de))return null;let oe=C(e);if(!oe||w===!0&&B(e)===X)return null;let K=I(e);if(K!=null&&K.title&&(t=K.title),K!=null&&K.subtitle&&(o=K.subtitle),!G&&n===void 0&&F(e)>0){let z=Math.min(F(e),oe.length-1);se(z),O(!0)}function je(){if(W+1>=oe.length){xe&&Fe(e,!1);return}j(e,oe[W+1].id)||se(W+1)}function Ge(z,at,io){let dr=W+1<oe.length?oe[W+1]:null;c&&c(z,W,at,dr)===!0&&xe&&g(),f&&f(z,io,dr),!f&&!c&&(z.primaryButtonUri||z.secondaryButtonUri)&&xe&&g()}function Y(){return oe.map((z,at)=>({...z,handleSecondaryButtonClick:()=>{je(),_(z),z.skippable===!0&&m(e,z.id,{skipped:!0}),Ge(z,"secondary",at)},handlePrimaryButtonClick:()=>{(!z.completionCriteria&&(z.autoMarkCompleted||z.autoMarkCompleted===void 0)||z.completionCriteria&&z.autoMarkCompleted===!0)&&(m(e,z.id),je()),Ge(z,"primary",at),R(z),x(e,z.id)===Oe&&je()}}))}function Se(){return pe.createElement(ie,{appearance:u})}let lt={steps:Y(),title:t,subtitle:o,primaryColor:u.theme.colorPrimary,appearance:u,customStepTypes:S,type:s,className:i,autoExpandFirstIncompleteStep:E,autoExpandNextStep:P};function g(){Fe(e,!1),p&&p(),T&&T(!1)}function b(){return pe.createElement(pe.Fragment,null,pe.createElement(Se,null),pe.createElement(Un,{flowId:e,appearance:u,customVariables:a,className:i}))}function v(){return pe.createElement(pe.Fragment,null,pe.createElement(Se,null),pe.createElement(tr,{visible:te,onClose:()=>{g()},selectedStep:W,setSelectedStep:se,autoExpandNextStep:!0,appearance:u,...lt}))}function H(){if(!V)return v();let z=A.guideFlowId,at;return z&&y(z)&&(at=C(z)),pe.createElement(pe.Fragment,null,pe.createElement(Se,null),pe.createElement(er,{visible:te,stepsTitle:K.stepsTitle?K.stepsTitle:"Your quick start guide",onClose:()=>{g()},selectedStep:W,setSelectedStep:se,guideData:at,guideTitle:A.guideTitle??"Guide",appearance:u,title:t,subtitle:o,onGuideButtonClick:io=>{Ge(io,"link",0)},customStepTypes:S,...lt}))}function ce(){if(!V)return v();let z=pe.createElement(Zo,{flowId:e,style:r,selectedStep:W,setSelectedStep:se,appearance:u,type:s,...lt});return xe?pe.createElement(Re,{onClose:()=>{g()},visible:te,appearance:u,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},pe.createElement(Se,null),z):pe.createElement(pe.Fragment,null,pe.createElement(Se,null),z)}switch(h){case"condensed":return v();case"with-guide":return H();case"default":return ce();case"carousel":return b();default:return ce()}};var vp=e=>Pp.createElement(rr,{type:"inline",...e});import nt,{useEffect as Ap}from"react";import ze from"react";import Ao from"styled-components";var zn=Ao.div`
1139
1139
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1140
1140
  border-radius: 8px;
1141
1141
  padding: 6px 10px 6px 10px;
@@ -1200,7 +1200,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
1200
1200
  :hover {
1201
1201
  opacity: 0.8;
1202
1202
  }
1203
- `;var Jn=({title:e,subtitle:t,icon:o,appearance:r,count:n,total:i,className:s,style:p})=>it.createElement(it.Fragment,null,it.createElement(qn,{appearance:r,className:ye(l("fullWidthProgressBadgeContainer",r),s??""),style:p},o&&it.createElement(Kn,{className:l("fullWidthProgressBadgeIcon",r)},o),it.createElement(Yn,null,it.createElement(be,{size:"small",appearance:r,title:e,subtitle:t})),it.createElement(Xn,{className:l("fullWidthProgressBadgeProgressContainer",r)},it.createElement(_e,{count:n,total:i,display:"percent",textLocation:"top",fillColor:r.theme.colorPrimary}))));var Ip=({flowId:e,title:t,subtitle:o,icon:r,style:n,onClick:i,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:a,type:u="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:w,getNumberOfStepsCompleted:T,isLoading:S,targetingLogicShouldHideFlow:h,updateCustomVariables:E}=J(),{mergeAppearanceWithDefault:P}=Q();a=P(a);let{setOpenFlowState:A,getOpenFlowState:y}=ve();if(Ap(()=>{E(p)},[p,S]),S)return null;let C=c(e);if(!C||h(C)||d===!0&&w(e)===X)return null;let m=f(e),x=T(e);return u==="full-width"?nt.createElement(nt.Fragment,null,nt.createElement(ie,{appearance:a}),nt.createElement(Jn,{title:t,subtitle:o,count:x,total:m.length,style:n,className:s,appearance:a,icon:r,onClick:()=>{}})):nt.createElement(nt.Fragment,null,nt.createElement(ie,{appearance:a}),nt.createElement(Vn,{count:x,total:m.length,title:t,style:n,onClick:()=>{A(e,!0),i&&i()},type:u,className:s,appearance:a}))};import Bp from"react";var Np=({flowId:e,style:t,appearance:o,...r})=>{let{getFlow:n,targetingLogicShouldHideFlow:i,getFlowSteps:s}=J(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let d=n(e);if(!d||i(d))return null;let a=s(e);return Bp.createElement(Rt,{steps:a,style:t,appearance:o,...r})};import Ut,{useContext as Gp,useEffect as Vp}from"react";import D,{useEffect as Io,useLayoutEffect as ls,useRef as Mp,useState as oo}from"react";import ro from"styled-components";import{useCallback as Lp,useEffect as Op,useState as Dp}from"react";var ir=(e,t,o,r={x:20,y:20},n)=>{let i=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return!e||!e.left||!e.top?{x:0,y:0}:t==="left"?{x:e.left-o+r.x+s,y:e.top-r.y+i}:t==="right"?{x:e.left+e.width+r.x+s,y:e.top-r.y+i}:{x:0,y:0}},Qn={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function $p(e){let t=Qn;return e&&(t=e.getBoundingClientRect()),t}function Zn(e,t){let[o,r]=Dp(Qn),n=Lp(()=>{e&&r($p(e))},[e]);return Op(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),o}import st from"styled-components";var Rn=st.div`
1203
+ `;var Jn=({title:e,subtitle:t,icon:o,appearance:r,count:n,total:i,className:s,style:p})=>it.createElement(it.Fragment,null,it.createElement(qn,{appearance:r,className:ye(l("fullWidthProgressBadgeContainer",r),s??""),style:p},o&&it.createElement(Kn,{className:l("fullWidthProgressBadgeIcon",r)},o),it.createElement(Yn,null,it.createElement(be,{size:"small",appearance:r,title:e,subtitle:t})),it.createElement(Xn,{className:l("fullWidthProgressBadgeProgressContainer",r)},it.createElement(_e,{count:n,total:i,display:"percent",textLocation:"top",fillColor:r.theme.colorPrimary}))));var Ip=({flowId:e,title:t,subtitle:o,icon:r,style:n,onClick:i,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:a,type:f="default"})=>{let{getFlow:c,getFlowSteps:u,getFlowStatus:w,getNumberOfStepsCompleted:T,isLoading:S,targetingLogicShouldHideFlow:h,updateCustomVariables:E}=J(),{mergeAppearanceWithDefault:P}=Q();a=P(a);let{setOpenFlowState:A,getOpenFlowState:y}=ve();if(Ap(()=>{E(p)},[p,S]),S)return null;let C=c(e);if(!C||h(C)||d===!0&&w(e)===X)return null;let m=u(e),x=T(e);return f==="full-width"?nt.createElement(nt.Fragment,null,nt.createElement(ie,{appearance:a}),nt.createElement(Jn,{title:t,subtitle:o,count:x,total:m.length,style:n,className:s,appearance:a,icon:r,onClick:()=>{}})):nt.createElement(nt.Fragment,null,nt.createElement(ie,{appearance:a}),nt.createElement(Vn,{count:x,total:m.length,title:t,style:n,onClick:()=>{A(e,!0),i&&i()},type:f,className:s,appearance:a}))};import Bp from"react";var Np=({flowId:e,style:t,appearance:o,...r})=>{let{getFlow:n,targetingLogicShouldHideFlow:i,getFlowSteps:s}=J(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let d=n(e);if(!d||i(d))return null;let a=s(e);return Bp.createElement(Rt,{steps:a,style:t,appearance:o,...r})};import Ut,{useContext as Gp,useEffect as Vp}from"react";import D,{useEffect as Io,useLayoutEffect as ls,useRef as Mp,useState as oo}from"react";import ro from"styled-components";import{useCallback as Lp,useEffect as Op,useState as Dp}from"react";var ir=(e,t,o,r={x:20,y:20},n)=>{let i=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return!e||!e.left||!e.top?{x:0,y:0}:t==="left"?{x:e.left-o+r.x+s,y:e.top-r.y+i}:t==="right"?{x:e.left+e.width+r.x+s,y:e.top-r.y+i}:{x:0,y:0}},Qn={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function $p(e){let t=Qn;return e&&(t=e.getBoundingClientRect()),t}function Zn(e,t){let[o,r]=Dp(Qn),n=Lp(()=>{e&&r($p(e))},[e]);return Op(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),o}import st from"styled-components";var Rn=st.div`
1204
1204
  ${e=>k(e)} {
1205
1205
  background: ${e=>e.appearance.theme.colorBackground};
1206
1206
  }
@@ -1307,7 +1307,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
1307
1307
  `,Hp=ro(ds)`
1308
1308
  width: ${Mt+12}px;
1309
1309
  height: ${Mt+12}px;
1310
- `,jp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:r="auto",showHighlight:n=!0,primaryColor:i="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:a=0,customStepTypes:u,appearance:c,dismissible:f=!1,showHighlightOnly:w,showStepCount:T=!0,completedStepsCount:S=0})=>{var oe,K,je,Ge;let[h,E]=oo(),[P,A]=oo(new Date),y=Mp(null),[C,m]=oo(document.querySelector(e[a].selector)),x=Zn(C,P),[F,L]=oo(),[U,M]=oo(!w),I=(K=(oe=e[a])==null?void 0:oe.props)!=null&&K.position?e[a].props.position:"absolute",j=((Ge=(je=e[a])==null?void 0:je.props)==null?void 0:Ge.zIndex)??90,B=(h==null?void 0:h.width)??as,$=(h==null?void 0:h.height)??ps;ls(()=>{y.current&&E({width:y.current.clientWidth,height:y.current.clientHeight})},[a,P,I]),Io(()=>{w||M(!0)},[a]);let re=r==="auto"?"right":r,R=ir(x,re,B,s,I),_=x.right+B>(window.innerWidth||document.documentElement.clientWidth),he=x.bottom+ps>(window.innerHeight||document.documentElement.clientHeight);_&&r==="auto"&&(R=ir(x,"left",B,s,I),re="left");let Fe=window.location.pathname.split("/").pop(),W=()=>{let Y=document.querySelector(e[a].selector);F&&F===JSON.stringify(Y==null?void 0:Y.getBoundingClientRect())||(m(Y),A(new Date),Y&&L(JSON.stringify(Y.getBoundingClientRect())))};if(Io(()=>{let Y=new MutationObserver(W);return Y.observe(document.body,{subtree:!0,childList:!0}),()=>Y.disconnect()},[W]),Io(()=>{let Y=new MutationObserver(W);return Y.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>Y.disconnect()},[W]),Io(()=>{let Y=setInterval(()=>{W()},10);return()=>clearInterval(Y)},[W]),ls(()=>{setTimeout(()=>{W()},Up),W()},[a,Fe]),C===null)return D.createElement(D.Fragment,null);if(R.x==0&&R.y==0)return D.createElement(D.Fragment,null);if(!p)return D.createElement(D.Fragment,null);let se=()=>{let Y=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),M(!1),setTimeout(()=>{W()},30)),S===e.length-1)return o()},Se=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),w&&M(!1))};return D.createElement(D.Fragment,null,T&&D.createElement(is,null,D.createElement(ss,{className:l("tooltipStepCounter",c)},a+1," of ",e.length)),D.createElement(ns,{showStepCount:T,className:l("tooltipCTAContainer",c)},e[a].secondaryButtonTitle&&D.createElement(ee,{title:e[a].secondaryButtonTitle,appearance:c,onClick:Se,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&D.createElement(ee,{title:e[a].primaryButtonTitle,appearance:c,onClick:Y,withMargin:!1,size:"small"})))},G=()=>D.createElement(D.Fragment,null,f&&D.createElement(es,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",c)},D.createElement(Ee,null)),e[a].imageUri&&D.createElement(ts,{dismissible:f,appearance:c,src:e[a].imageUri,className:l("tooltipImageContainer",c)}),e[a].videoUri&&!e[a].imageUri&&D.createElement(os,{dismissible:f,appearance:c,className:l("tooltipVideoContainer",c)},D.createElement(Et,{appearance:c,videoUri:e[a].videoUri})),D.createElement(be,{appearance:c,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),D.createElement(rs,{className:l("tooltipFooter",c)},D.createElement(se,null))),te={...{default:Y=>{var Se;if((Se=e[a])!=null&&Se.StepContent){let lt=e[a].StepContent;return D.createElement("div",null,lt)}return D.createElement(G,null)}},...u},xe=()=>{var Y;return e?!((Y=e[a])!=null&&Y.type)||!te[e[a].type]?te.default(e[a]):te[e[a].type]({stepData:e[a],primaryColor:i}):D.createElement(D.Fragment,null)};if(w&&e[a].complete===!0)return null;let Ce={top:(R==null?void 0:R.y)-Mt,left:(re=="left"?x.x+s.x:(R==null?void 0:R.x)-Mt)??0,cursor:w?"pointer":"default",position:I},V=()=>{let Se=Ce.left+(re=="left"?-B:24);return Math.min(Math.max(Se,20),window.innerWidth-B-20)},de=()=>{w&&(A(new Date),M(!U))};return D.createElement(zp,null,D.createElement(Hp,{style:Ce,zIndex:j,className:l("tourHighlightContainer",c)},n&&e[a].showHighlight!==!1&&D.createElement(D.Fragment,null,D.createElement(Wp,{style:{position:I},onClick:de,primaryColor:c.theme.colorPrimary}),D.createElement(_p,{style:{position:"absolute"},onClick:de,primaryColor:c.theme.colorPrimary}))),D.createElement(ds,{style:{...Ce,left:V()},zIndex:j+1,className:l("tooltipContainerWrapper",c)},U&&D.createElement(Rn,{ref:y,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:c,className:l("tooltipContainer",c),maxWidth:as,zIndex:j+10},D.createElement(xe,null))))},Bo=jp;import{Portal as qp}from"react-portal";var Kp=({flowId:e,customVariables:t,appearance:o,onStepCompletion:r,onButtonClick:n,showTooltipsSimultaneously:i=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:a=!1,dismissBehavior:u="complete-flow",onComplete:c,...f})=>{let{getFlow:w,getFlowSteps:T,isLoading:S,targetingLogicShouldHideFlow:h,markStepCompleted:E,markStepStarted:P,markFlowCompleted:A,updateCustomVariables:y,getCurrentStepIndex:C,getStepStatus:m,isStepBlocked:x,getFlowStatus:F,getNumberOfStepsCompleted:L}=J(),{isLoadingUserFlowStateData:U}=Be(),{primaryCTAClickSideEffects:M,secondaryCTAClickSideEffects:I}=ne(),{hasOpenModals:j}=ve(),B=C(e),{openFlowStates:$}=Gp(q),{mergeAppearanceWithDefault:re}=Q();if(o=re(o),Vp(()=>{y(t)},[t,S]),U)return null;let R=w(e);if(!R||h(R)||F(e)==X||j())return null;let _=T(e);if(Object.keys($).length>0){let O=Object.keys($).find(te=>$[te]===!0);if(O!==void 0&&O!==e)return Ut.createElement(Ut.Fragment,null)}async function he(O){if(await E(e,O.id),_.map(te=>m(e,te.id)).every(te=>te===Oe)){await A(e);return}if(!a&&B+1<_.length){if(x(e,_[B+1].id))return;await P(e,_[B+1].id)}}function Fe(O,te,xe){let Ce=B+1<_.length?_[B+1]:null;n&&n(O,B,te,Ce),r&&r(O,xe,Ce)}function W(){return _.map(O=>({...O,handleSecondaryButtonClick:async()=>{I(O),O.skippable===!0&&await E(e,O.id,{skipped:!0}),Fe(O,"secondary",B)},handlePrimaryButtonClick:async()=>{(!O.completionCriteria&&(O.autoMarkCompleted||O.autoMarkCompleted===void 0)||O.completionCriteria&&O.autoMarkCompleted===!0)&&await he(O),Fe(O,"primary",B),M(O)}}))}async function se(O){s&&s(),u==="complete-flow"?await A(e):await E(e,O.id)}function G(){c&&c()}return Ut.createElement(qp,null,Ut.createElement(ie,{appearance:o}),i?_.map((O,te)=>Ut.createElement(Bo,{key:O.id,appearance:o,steps:W(),selectedStep:te,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>se(O),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:L(e),onComplete:G,...f})):Ut.createElement(Bo,{appearance:o,steps:W(),selectedStep:B,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>se(_[B]),tooltipPosition:d,completedStepsCount:L(e),showHighlightOnly:a,onComplete:G,...f}))};import Te,{useEffect as Yp,useRef as Xp,useState as Jp}from"react";import{Portal as Qp}from"react-portal";import wt from"styled-components";var cs=wt.button`
1310
+ `,jp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:r="auto",showHighlight:n=!0,primaryColor:i="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:a=0,customStepTypes:f,appearance:c,dismissible:u=!1,showHighlightOnly:w,showStepCount:T=!0,completedStepsCount:S=0})=>{var oe,K,je,Ge;let[h,E]=oo(),[P,A]=oo(new Date),y=Mp(null),[C,m]=oo(document.querySelector(e[a].selector)),x=Zn(C,P),[F,L]=oo(),[U,M]=oo(!w),I=(K=(oe=e[a])==null?void 0:oe.props)!=null&&K.position?e[a].props.position:"absolute",j=((Ge=(je=e[a])==null?void 0:je.props)==null?void 0:Ge.zIndex)??90,B=(h==null?void 0:h.width)??as,$=(h==null?void 0:h.height)??ps;ls(()=>{y.current&&E({width:y.current.clientWidth,height:y.current.clientHeight})},[a,P,I]),Io(()=>{w||M(!0)},[a]);let re=r==="auto"?"right":r,R=ir(x,re,B,s,I),_=x.right+B>(window.innerWidth||document.documentElement.clientWidth),he=x.bottom+ps>(window.innerHeight||document.documentElement.clientHeight);_&&r==="auto"&&(R=ir(x,"left",B,s,I),re="left");let Fe=window.location.pathname.split("/").pop(),W=()=>{let Y=document.querySelector(e[a].selector);F&&F===JSON.stringify(Y==null?void 0:Y.getBoundingClientRect())||(m(Y),A(new Date),Y&&L(JSON.stringify(Y.getBoundingClientRect())))};if(Io(()=>{let Y=new MutationObserver(W);return Y.observe(document.body,{subtree:!0,childList:!0}),()=>Y.disconnect()},[W]),Io(()=>{let Y=new MutationObserver(W);return Y.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>Y.disconnect()},[W]),Io(()=>{let Y=setInterval(()=>{W()},10);return()=>clearInterval(Y)},[W]),ls(()=>{setTimeout(()=>{W()},Up),W()},[a,Fe]),C===null)return D.createElement(D.Fragment,null);if(R.x==0&&R.y==0)return D.createElement(D.Fragment,null);if(!p)return D.createElement(D.Fragment,null);let se=()=>{let Y=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),M(!1),setTimeout(()=>{W()},30)),S===e.length-1)return o()},Se=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),w&&M(!1))};return D.createElement(D.Fragment,null,T&&D.createElement(is,null,D.createElement(ss,{className:l("tooltipStepCounter",c)},a+1," of ",e.length)),D.createElement(ns,{showStepCount:T,className:l("tooltipCTAContainer",c)},e[a].secondaryButtonTitle&&D.createElement(ee,{title:e[a].secondaryButtonTitle,appearance:c,onClick:Se,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&D.createElement(ee,{title:e[a].primaryButtonTitle,appearance:c,onClick:Y,withMargin:!1,size:"small"})))},G=()=>D.createElement(D.Fragment,null,u&&D.createElement(es,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",c)},D.createElement(Ee,null)),e[a].imageUri&&D.createElement(ts,{dismissible:u,appearance:c,src:e[a].imageUri,className:l("tooltipImageContainer",c)}),e[a].videoUri&&!e[a].imageUri&&D.createElement(os,{dismissible:u,appearance:c,className:l("tooltipVideoContainer",c)},D.createElement(Et,{appearance:c,videoUri:e[a].videoUri})),D.createElement(be,{appearance:c,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),D.createElement(rs,{className:l("tooltipFooter",c)},D.createElement(se,null))),te={...{default:Y=>{var Se;if((Se=e[a])!=null&&Se.StepContent){let lt=e[a].StepContent;return D.createElement("div",null,lt)}return D.createElement(G,null)}},...f},xe=()=>{var Y;return e?!((Y=e[a])!=null&&Y.type)||!te[e[a].type]?te.default(e[a]):te[e[a].type]({stepData:e[a],primaryColor:i}):D.createElement(D.Fragment,null)};if(w&&e[a].complete===!0)return null;let Ce={top:(R==null?void 0:R.y)-Mt,left:(re=="left"?x.x+s.x:(R==null?void 0:R.x)-Mt)??0,cursor:w?"pointer":"default",position:I},V=()=>{let Se=Ce.left+(re=="left"?-B:24);return Math.min(Math.max(Se,20),window.innerWidth-B-20)},de=()=>{w&&(A(new Date),M(!U))};return D.createElement(zp,null,D.createElement(Hp,{style:Ce,zIndex:j,className:l("tourHighlightContainer",c)},n&&e[a].showHighlight!==!1&&D.createElement(D.Fragment,null,D.createElement(Wp,{style:{position:I},onClick:de,primaryColor:c.theme.colorPrimary}),D.createElement(_p,{style:{position:"absolute"},onClick:de,primaryColor:c.theme.colorPrimary}))),D.createElement(ds,{style:{...Ce,left:V()},zIndex:j+1,className:l("tooltipContainerWrapper",c)},U&&D.createElement(Rn,{ref:y,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:c,className:l("tooltipContainer",c),maxWidth:as,zIndex:j+10},D.createElement(xe,null))))},Bo=jp;import{Portal as qp}from"react-portal";var Kp=({flowId:e,customVariables:t,appearance:o,onStepCompletion:r,onButtonClick:n,showTooltipsSimultaneously:i=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:a=!1,dismissBehavior:f="complete-flow",onComplete:c,...u})=>{let{getFlow:w,getFlowSteps:T,isLoading:S,targetingLogicShouldHideFlow:h,markStepCompleted:E,markStepStarted:P,markFlowCompleted:A,updateCustomVariables:y,getCurrentStepIndex:C,getStepStatus:m,isStepBlocked:x,getFlowStatus:F,getNumberOfStepsCompleted:L}=J(),{isLoadingUserFlowStateData:U}=Be(),{primaryCTAClickSideEffects:M,secondaryCTAClickSideEffects:I}=ne(),{hasOpenModals:j}=ve(),B=C(e),{openFlowStates:$}=Gp(q),{mergeAppearanceWithDefault:re}=Q();if(o=re(o),Vp(()=>{y(t)},[t,S]),U)return null;let R=w(e);if(!R||h(R)||F(e)==X||j())return null;let _=T(e);if(Object.keys($).length>0){let O=Object.keys($).find(te=>$[te]===!0);if(O!==void 0&&O!==e)return Ut.createElement(Ut.Fragment,null)}async function he(O){if(await E(e,O.id),_.map(te=>m(e,te.id)).every(te=>te===Oe)){await A(e);return}if(!a&&B+1<_.length){if(x(e,_[B+1].id))return;await P(e,_[B+1].id)}}function Fe(O,te,xe){let Ce=B+1<_.length?_[B+1]:null;n&&n(O,B,te,Ce),r&&r(O,xe,Ce)}function W(){return _.map(O=>({...O,handleSecondaryButtonClick:async()=>{I(O),O.skippable===!0&&await E(e,O.id,{skipped:!0}),Fe(O,"secondary",B)},handlePrimaryButtonClick:async()=>{(!O.completionCriteria&&(O.autoMarkCompleted||O.autoMarkCompleted===void 0)||O.completionCriteria&&O.autoMarkCompleted===!0)&&await he(O),Fe(O,"primary",B),M(O)}}))}async function se(O){s&&s(),f==="complete-flow"?await A(e):await E(e,O.id)}function G(){c&&c()}return Ut.createElement(qp,null,Ut.createElement(ie,{appearance:o}),i?_.map((O,te)=>Ut.createElement(Bo,{key:O.id,appearance:o,steps:W(),selectedStep:te,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>se(O),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:L(e),onComplete:G,...u})):Ut.createElement(Bo,{appearance:o,steps:W(),selectedStep:B,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>se(_[B]),tooltipPosition:d,completedStepsCount:L(e),showHighlightOnly:a,onComplete:G,...u}))};import Te,{useEffect as Yp,useRef as Xp,useState as Jp}from"react";import{Portal as Qp}from"react-portal";import wt from"styled-components";var cs=wt.button`
1311
1311
  ${e=>k(e)} {
1312
1312
  // Anything inside this block will be ignored if the user provides a custom class
1313
1313
 
@@ -1395,7 +1395,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
1395
1395
  font-size: 14px;
1396
1396
 
1397
1397
  padding: 8px 12px;
1398
- `;import{AnimatePresence as ws,motion as Ts}from"framer-motion";import Cs from"react";var Ss=({style:e,className:t})=>Cs.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Cs.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import ys from"react";var bs=({style:e,className:t})=>ys.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},ys.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Zp=({flowId:e,style:t,onStepCompletion:o,visible:r=!0,type:n="inline",title:i="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:a,getStepStatus:u,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:w}=J(),{primaryCTAClickSideEffects:T}=ne(),S=Xp(null),[h,E]=Jp(!1),{mergeAppearanceWithDefault:P}=Q();s=P(s),Yp(()=>(document.addEventListener("click",A,!1),()=>{document.removeEventListener("click",A,!1)}),[]);let A=F=>{S.current&&!S.current.contains(F.target)&&E(!1)};if(f)return null;let y=p(e);if(!y||w(y))return null;let C=d(e);if(!C||!r)return null;function m(F,L){!F.completionCriteria&&(F.autoMarkCompleted||F.autoMarkCompleted===void 0)&&a(e,F.id),T(F),o&&o(F,L),E(!1)}function x(){return h&&Te.createElement(hs,{className:l("floatingWidgetMenu",s),as:Ts.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},C.map((F,L)=>Te.createElement(xs,{className:l("floatingWidgetMenuItem",s),key:L,onClick:()=>m(F,L)},F.title)))}return n=="inline"?Te.createElement("span",{ref:S},Te.createElement(cs,{style:t,onClick:()=>{E(!h)},className:l("supportButton",s)},Te.createElement(us,{className:l("supportIconContainer",s)},Te.createElement(bs,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),Te.createElement(ms,{className:l("supportButtonTitle",s)},i)),Te.createElement(ws,null,Te.createElement(x,null))):Te.createElement(Qp,null,Te.createElement(fs,{style:t,ref:S},Te.createElement(ws,null,Te.createElement(x,null)),Te.createElement(gs,{onClick:()=>{E(!h)},as:Ts.button,whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},Te.createElement(Ss,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import He,{useEffect as Rp}from"react";import No from"styled-components";var Fs=No.div`
1398
+ `;import{AnimatePresence as ws,motion as Ts}from"framer-motion";import Cs from"react";var Ss=({style:e,className:t})=>Cs.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Cs.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import ys from"react";var bs=({style:e,className:t})=>ys.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},ys.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Zp=({flowId:e,style:t,onStepCompletion:o,visible:r=!0,type:n="inline",title:i="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:a,getStepStatus:f,getNumberOfStepsCompleted:c,isLoading:u,targetingLogicShouldHideFlow:w}=J(),{primaryCTAClickSideEffects:T}=ne(),S=Xp(null),[h,E]=Jp(!1),{mergeAppearanceWithDefault:P}=Q();s=P(s),Yp(()=>(document.addEventListener("click",A,!1),()=>{document.removeEventListener("click",A,!1)}),[]);let A=F=>{S.current&&!S.current.contains(F.target)&&E(!1)};if(u)return null;let y=p(e);if(!y||w(y))return null;let C=d(e);if(!C||!r)return null;function m(F,L){!F.completionCriteria&&(F.autoMarkCompleted||F.autoMarkCompleted===void 0)&&a(e,F.id),T(F),o&&o(F,L),E(!1)}function x(){return h&&Te.createElement(hs,{className:l("floatingWidgetMenu",s),as:Ts.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},C.map((F,L)=>Te.createElement(xs,{className:l("floatingWidgetMenuItem",s),key:L,onClick:()=>m(F,L)},F.title)))}return n=="inline"?Te.createElement("span",{ref:S},Te.createElement(cs,{style:t,onClick:()=>{E(!h)},className:l("supportButton",s)},Te.createElement(us,{className:l("supportIconContainer",s)},Te.createElement(bs,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),Te.createElement(ms,{className:l("supportButtonTitle",s)},i)),Te.createElement(ws,null,Te.createElement(x,null))):Te.createElement(Qp,null,Te.createElement(fs,{style:t,ref:S},Te.createElement(ws,null,Te.createElement(x,null)),Te.createElement(gs,{onClick:()=>{E(!h)},as:Ts.button,whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},Te.createElement(Ss,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import He,{useEffect as Rp}from"react";import No from"styled-components";var Fs=No.div`
1399
1399
  ${e=>k(e)} {
1400
1400
  display: flex;
1401
1401
  flex-direction: column;
@@ -1431,7 +1431,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
1431
1431
  opacity: 0.8;
1432
1432
  }
1433
1433
  }
1434
- `;var ed=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:n,className:i,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:a,markStepCompleted:u,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:w,getFlowSteps:T,getFlowStatus:S,getCurrentStepIndex:h}=J(),{primaryCTAClickSideEffects:E}=ne(),{mergeAppearanceWithDefault:P}=Q();if(n=P(n),Rp(()=>{w(o)},[o,c]),c)return null;let A=d(e);if(!A||f(A)||S(e)===X)return null;let C=T(e)[h(e)];return He.createElement(He.Fragment,null,He.createElement(ie,{appearance:n}),He.createElement(Fs,{appearance:n,className:ye(l("embeddedTipContainer",n),i),style:s},(p===!0||C.dismissible)&&He.createElement(vs,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",n)},He.createElement(Ee,null)),He.createElement(ks,null,He.createElement(be,{size:"small",appearance:n,title:C.title,subtitle:C.subtitle})),C.primaryButtonTitle&&He.createElement(Ps,{className:l("embeddedTipCallToActionContainer",n)},He.createElement(ee,{classPrefix:"embeddedTip",title:C.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"inline",onClick:async()=>{C.handlePrimaryButtonClick(),E(C),!(r&&r(C,h(e),"primary")===!1)&&(await u(e,C.id),await a(e))}}))))};import ge,{useEffect as td}from"react";import _t from"styled-components";var Es=_t.div`
1434
+ `;var ed=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:n,className:i,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:a,markStepCompleted:f,isLoading:c,targetingLogicShouldHideFlow:u,updateCustomVariables:w,getFlowSteps:T,getFlowStatus:S,getCurrentStepIndex:h}=J(),{primaryCTAClickSideEffects:E}=ne(),{mergeAppearanceWithDefault:P}=Q();if(n=P(n),Rp(()=>{w(o)},[o,c]),c)return null;let A=d(e);if(!A||u(A)||S(e)===X)return null;let C=T(e)[h(e)];return He.createElement(He.Fragment,null,He.createElement(ie,{appearance:n}),He.createElement(Fs,{appearance:n,className:ye(l("embeddedTipContainer",n),i),style:s},(p===!0||C.dismissible)&&He.createElement(vs,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",n)},He.createElement(Ee,null)),He.createElement(ks,null,He.createElement(be,{size:"small",appearance:n,title:C.title,subtitle:C.subtitle})),C.primaryButtonTitle&&He.createElement(Ps,{className:l("embeddedTipCallToActionContainer",n)},He.createElement(ee,{classPrefix:"embeddedTip",title:C.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"inline",onClick:async()=>{C.handlePrimaryButtonClick(),E(C),!(r&&r(C,h(e),"primary")===!1)&&(await f(e,C.id),await a(e))}}))))};import ge,{useEffect as td}from"react";import _t from"styled-components";var Es=_t.div`
1435
1435
  // use the :not annotation
1436
1436
  ${e=>k(e)} {
1437
1437
  display: flex;
@@ -1476,7 +1476,7 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
1476
1476
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1477
1477
  align-items: flex-end;
1478
1478
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1479
- `;import Ns from"react";var Ls=({style:e,className:t})=>Ns.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor"},Ns.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}));var od=({flowId:e,title:t,subtitle:o,onDismiss:r,customVariables:n,onButtonClick:i,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:a,markFlowCompleted:u,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:w,getFlowMetadata:T,getFlowStatus:S,getFlowSteps:h,getCurrentStepIndex:E}=J(),{primaryCTAClickSideEffects:P}=ne(),{mergeAppearanceWithDefault:A}=Q();if(s=A(s),td(()=>{w(n)},[n,c]),c)return null;let y=a(e);if(!y||f(y)||S(e)===X)return null;let C=h(e),m=C.length>0?C[E(e)]:T(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),ge.createElement(ge.Fragment,null,ge.createElement(ie,{appearance:s}),ge.createElement(Es,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&ge.createElement(As,{className:l("bannerIconContainer",s)},d||ge.createElement(Ls,null)),p==="square"&&m.dismissible&&ge.createElement(sr,{type:p,className:l("bannerDismissButtonContainer",s)},ge.createElement(nr,{type:p,onClick:async()=>{await u(e),r&&r()},className:l("bannerDismissButton",s)},ge.createElement(Ee,null))),ge.createElement(Is,{type:p},ge.createElement(be,{appearance:s,title:t,subtitle:o})),ge.createElement(Bs,{type:p,className:l("bannerCallToActionContainer",s)},ge.createElement(ee,{title:(m==null?void 0:m.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{P(m),i&&i(m,0,"primary")}})),p!=="square"&&m.dismissible&&ge.createElement(sr,{type:p,className:l("bannerDismissButtonContainer",s)},ge.createElement(nr,{type:p,onClick:async()=>{await u(e),r&&r()},className:l("bannerDismissButton",s)},ge.createElement(Ee,null)))))};import Z,{useEffect as rd}from"react";import{Portal as id}from"react-portal";import Ze from"styled-components";var Os=Ze.div`
1479
+ `;import Ns from"react";var Ls=({style:e,className:t})=>Ns.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor"},Ns.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}));var od=({flowId:e,title:t,subtitle:o,onDismiss:r,customVariables:n,onButtonClick:i,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:a,markFlowCompleted:f,isLoading:c,targetingLogicShouldHideFlow:u,updateCustomVariables:w,getFlowMetadata:T,getFlowStatus:S,getFlowSteps:h,getCurrentStepIndex:E}=J(),{primaryCTAClickSideEffects:P}=ne(),{mergeAppearanceWithDefault:A}=Q();if(s=A(s),td(()=>{w(n)},[n,c]),c)return null;let y=a(e);if(!y||u(y)||S(e)===X)return null;let C=h(e),m=C.length>0?C[E(e)]:T(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),ge.createElement(ge.Fragment,null,ge.createElement(ie,{appearance:s}),ge.createElement(Es,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&ge.createElement(As,{className:l("bannerIconContainer",s)},d||ge.createElement(Ls,null)),p==="square"&&m.dismissible&&ge.createElement(sr,{type:p,className:l("bannerDismissButtonContainer",s)},ge.createElement(nr,{type:p,onClick:async()=>{await f(e),r&&r()},className:l("bannerDismissButton",s)},ge.createElement(Ee,null))),ge.createElement(Is,{type:p},ge.createElement(be,{appearance:s,title:t,subtitle:o})),ge.createElement(Bs,{type:p,className:l("bannerCallToActionContainer",s)},ge.createElement(ee,{title:(m==null?void 0:m.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{P(m),i&&i(m,0,"primary")}})),p!=="square"&&m.dismissible&&ge.createElement(sr,{type:p,className:l("bannerDismissButtonContainer",s)},ge.createElement(nr,{type:p,onClick:async()=>{await f(e),r&&r()},className:l("bannerDismissButton",s)},ge.createElement(Ee,null)))))};import Z,{useEffect as rd}from"react";import{Portal as id}from"react-portal";import Ze from"styled-components";var Os=Ze.div`
1480
1480
  ${e=>k(e)} {
1481
1481
  display: flex;
1482
1482
  flex-direction: column;
@@ -1563,5 +1563,5 @@ ${r=>r.inlineStyles.map(([n,i])=>`.${jt}${n}.${jt}${n} { ${Object.entries(i).map
1563
1563
  opacity: 0.8;
1564
1564
  }
1565
1565
  }
1566
- `;var nd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:n,className:i,style:s})=>{let{getFlow:p,markFlowCompleted:d,markStepCompleted:a,getNumberOfStepsCompleted:u,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:w,getFlowSteps:T,getFlowStatus:S,getCurrentStepIndex:h}=J(),{primaryCTAClickSideEffects:E}=ne(),{mergeAppearanceWithDefault:P}=Q(),[A,y]=Z.useState(null),[C,m]=Z.useState(""),{hasOpenModals:x,setKeepCompletedFlowOpenDuringSession:F,shouldKeepCompletedFlowOpenDuringSession:L}=ve();if(n=P(n),rd(()=>{w(o)},[o,c]),c)return null;let U=p(e);if(!U||f(U)||S(e)===X||u(e)===1&&!L(e)||x())return null;let I=T(e)[h(e)];function j(){return Z.createElement(Z.Fragment,null,Z.createElement(pr,null,Z.createElement(be,{size:"large",appearance:n,title:I.title,subtitle:I.subtitle})),Z.createElement(lr,{className:l("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map($=>Z.createElement(Ds,{className:l("npsNumberButton",n),selected:A===$+1,key:$,onClick:async()=>{F(e),y($+1),await a(e,I.id,{score:$+1})},appearance:n},$+1))),Z.createElement($s,{appearance:n},Z.createElement(ar,{appearance:n},"Not likely at all"),Z.createElement(ar,{appearance:n},"Extremely likely")))}function B(){return Z.createElement(Z.Fragment,null,Z.createElement(pr,null,Z.createElement(be,{appearance:n,title:"Why did you choose this score?",size:"large"})),Z.createElement(Ms,{appearance:n,value:C,onChange:$=>{m($.target.value)},placeHolder:"Add your optional fedback here..."}),Z.createElement(lr,{appearance:n,className:l("npsNumberButtonContainer",n)},Z.createElement(ee,{size:"large",withMargin:!1,onClick:async()=>{await d(e),r&&r(I,1,"primary")},appearance:n,title:I.secondaryButtonTitle||"Skip",secondary:!0}),Z.createElement(ee,{size:"large",withMargin:!1,onClick:async()=>{await a(e,I.id,{feedbackText:C}),await d(e),r&&r(I,1,"primary")},appearance:n,title:I.primaryButtonTitle||"Submit"})))}return Z.createElement(id,null,Z.createElement(ie,{appearance:n}),Z.createElement(Os,{appearance:n,className:ye(l("npsSurveyContainer",n),i),style:s},Z.createElement(Us,{onClick:async()=>{await d(e),t&&t()},className:l("npsSurveyDismissButton",n)},Z.createElement(Ee,null)),u(e)==0&&j(),u(e)==1&&B()))};export{ft as CheckBox,tt as FormLabel,_o as FormTextField,od as FrigadeBanner,rr as FrigadeChecklist,qe as FrigadeDefaultAppearance,ed as FrigadeEmbeddedTip,ri as FrigadeForm,Np as FrigadeGuide,vp as FrigadeHeroChecklist,nd as FrigadeNPSSurvey,Ip as FrigadeProgressBadge,Aa as FrigadeProvider,Zp as FrigadeSupportWidget,Kp as FrigadeTour,It as ProgressRing,ve as useFlowOpens,zt as useFlowResponses,J as useFlows,Ko as useOrganization,Ht as useUser};
1566
+ `;var nd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:n,className:i,style:s})=>{let{getFlow:p,markFlowCompleted:d,markStepCompleted:a,getNumberOfStepsCompleted:f,isLoading:c,targetingLogicShouldHideFlow:u,updateCustomVariables:w,getFlowSteps:T,getFlowStatus:S,getCurrentStepIndex:h}=J(),{primaryCTAClickSideEffects:E}=ne(),{mergeAppearanceWithDefault:P}=Q(),[A,y]=Z.useState(null),[C,m]=Z.useState(""),{hasOpenModals:x,setKeepCompletedFlowOpenDuringSession:F,shouldKeepCompletedFlowOpenDuringSession:L}=ve();if(n=P(n),rd(()=>{w(o)},[o,c]),c)return null;let U=p(e);if(!U||u(U)||S(e)===X||f(e)===1&&!L(e)||x())return null;let I=T(e)[h(e)];function j(){return Z.createElement(Z.Fragment,null,Z.createElement(pr,null,Z.createElement(be,{size:"large",appearance:n,title:I.title,subtitle:I.subtitle})),Z.createElement(lr,{className:l("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map($=>Z.createElement(Ds,{className:l("npsNumberButton",n),selected:A===$+1,key:$,onClick:async()=>{F(e),y($+1),await a(e,I.id,{score:$+1})},appearance:n},$+1))),Z.createElement($s,{appearance:n},Z.createElement(ar,{appearance:n},"Not likely at all"),Z.createElement(ar,{appearance:n},"Extremely likely")))}function B(){return Z.createElement(Z.Fragment,null,Z.createElement(pr,null,Z.createElement(be,{appearance:n,title:"Why did you choose this score?",size:"large"})),Z.createElement(Ms,{appearance:n,value:C,onChange:$=>{m($.target.value)},placeHolder:"Add your optional fedback here..."}),Z.createElement(lr,{appearance:n,className:l("npsNumberButtonContainer",n)},Z.createElement(ee,{size:"large",withMargin:!1,onClick:async()=>{await d(e),r&&r(I,1,"primary")},appearance:n,title:I.secondaryButtonTitle||"Skip",secondary:!0}),Z.createElement(ee,{size:"large",withMargin:!1,onClick:async()=>{await a(e,I.id,{feedbackText:C}),await d(e),r&&r(I,1,"primary")},appearance:n,title:I.primaryButtonTitle||"Submit"})))}return Z.createElement(id,null,Z.createElement(ie,{appearance:n}),Z.createElement(Os,{appearance:n,className:ye(l("npsSurveyContainer",n),i),style:s},Z.createElement(Us,{onClick:async()=>{await d(e),t&&t()},className:l("npsSurveyDismissButton",n)},Z.createElement(Ee,null)),f(e)==0&&j(),f(e)==1&&B()))};export{ft as CheckBox,tt as FormLabel,_o as FormTextField,od as FrigadeBanner,rr as FrigadeChecklist,qe as FrigadeDefaultAppearance,ed as FrigadeEmbeddedTip,ri as FrigadeForm,Np as FrigadeGuide,vp as FrigadeHeroChecklist,nd as FrigadeNPSSurvey,Ip as FrigadeProgressBadge,Aa as FrigadeProvider,Zp as FrigadeSupportWidget,Kp as FrigadeTour,It as ProgressRing,ve as useFlowOpens,zt as useFlowResponses,J as useFlows,Ko as useOrganization,Ht as useUser};
1567
1567
  //# sourceMappingURL=index.mjs.map