@frigade/react 1.35.5 → 1.35.6

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 bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import{ThemeProvider as Up}from"styled-components";import St,{useContext as mp,useEffect as Oo,useState as ur}from"react";import{useCallback as xt,useContext as Ul,useEffect as zl}from"react";import qo,{useMemo as Dr}from"react";var Lr="1.35.5 ";var Oe="NOT_STARTED_STEP",q="COMPLETED_FLOW",go="ABORTED_FLOW",gt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",xo="STARTED_STEP";function We(){let{publicApiKey:e,userId:t,apiUrl:o}=qo.useContext(K);return{config:Dr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Lr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Dr(()=>`${o}/v1/public/`,[o])}}var Pl="frigade-last-call-at-",vl="frigade-last-call-data-";function Et(){let{shouldGracefullyDegrade:e,readonly:t}=qo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Bt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Bt();let r=Pl+o,n=vl+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return Bt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return Bt(p)}return s?s.ok?s:Bt(s.statusText):Bt()}}function Bt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function At(){let{publicApiKey:e,shouldGracefullyDegrade:t}=qo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Dl,useState as $r}from"react";import{useContext as El,useEffect as Al,useState as Nl}from"react";import Il from"swr";import{useContext as Bl}from"react";function Te(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Bl(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(S=>({...S,[d]:x}))}function p(d){t(x=>{let{[d]:S,...w}=x;return{...w}})}function c(d){r.includes(d)||i(x=>[...x,d])}function a(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,S])=>S&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:a}}import Ol from"swr/immutable";var Ll="unknown";function Ee(){let{config:e,apiUrl:t}=We(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=El(K),{resetOpenFlowState:c}=Te(),[a,g]=Nl(!1),d={data:n.map(T=>({flowId:T.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=T=>fetch(T,e).then(F=>{if(F.ok)return F.json();throw new Error("Failed to fetch user flow states")}).catch(F=>(console.log(`Error fetching ${T}: ${F}. Will gracefully degrade and hide Frigade`),s(!0),d)),S=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:w,isLoading:P,mutate:f,error:E}=p?Ol(S,x):Il(S,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),b=w==null?void 0:w.data;Al(()=>{!a&&!P&&b&&g(!0)},[b,a,P]);async function y(T){if(b&&!p){let F=b.find(O=>O.flowId===T);F&&F.flowState!==q&&(F.flowState=q),await f(Promise.resolve({...w,data:b}),{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function A(T,F,O){if(b){let N=b.find(I=>I.flowId===T);N&&(N.stepStates[F]=O,N.flowState=gt),await f(Promise.resolve({...w,data:b}),{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function h(T,F,O){if(b){let N=b.find(I=>I.flowId===T);N&&(N.lastStepId=F,N.stepStates[F]=O,N.flowState=gt),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function m(T){if(b){let F=b.find(O=>O.flowId===T);F&&F.flowState!==Me&&(F.flowState=Me,F.lastStepId=Ll,Object.keys(F.stepStates).forEach(O=>{F.stepStates[O].actionType=Oe,F.stepStates[O].createdAt=new Date().toISOString()}),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1}),c(T))}}async function B(T,F){if(b){let O=b.find(N=>N.flowId===T);O&&O.stepStates[F]!==Oe&&(O.stepStates[F]=Oe),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:b,isLoadingUserFlowStateData:!a,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:h,error:E}}function qt(){let{config:e,apiUrl:t}=We(),{userFlowStatesData:o,mutateUserFlowState:i}=Ee(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Dl(K),[c,a]=$r(new Set),[g,d]=$r(new Set),x=Et();function S(f){let E=JSON.stringify(f);if(c.has(E))return null;c.add(E),a(c),g.add(f),d(g);let b=s==null?void 0:s.find(y=>y.flowSlug===f.flowSlug&&y.stepId===f.stepId&&y.actionType===f.actionType&&y.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:E}).then(y=>{y.status!==200&&y.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):b||p(A=>[...A??[],f])})}async function w(f){f.foreignUserId&&(f.actionType===gt||f.actionType===Me?await S(f):f.actionType===q?await S(f):f.actionType===xo?await S(f):f.actionType===Ue?await S(f):f.actionType===go?await S(f):f.actionType===Oe&&await S(f))}function P(){let f=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let b in E.stepStates){let y=E.stepStates[b];f.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:y.stepId,actionType:y.actionType,data:{},createdAt:new Date(y.createdAt),blocked:y.blocked,hidden:y.hidden})}}),[...f,...s]}return{addResponse:w,setFlowResponses:p,getFlowResponses:P}}import _l from"swr";var $l=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Mr=e=>{let t=$l.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Ml(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Ml=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Y(){let{config:e,apiUrl:t}=We(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Ul(K),S={data:[]},{verifySDKInitiated:w}=At(),{addResponse:P,getFlowResponses:f}=qt(),E=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),S)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),S)),{mutateUserFlowState:b,userFlowStatesData:y,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:B,optimisticallyMarkStepNotStarted:T,optimisticallyMarkStepStarted:F}=Ee(),{data:O,error:N,isLoading:I}=_l(n?`${t}flows${x?"?readonly=true":""}`:null,E,{keepPreviousData:!0});zl(()=>{if(N){console.error(N);return}O&&O.data&&i(O.data)},[O,N]);function $(u){if(I)return null;let C=o.find(v=>v.slug===u);return!C&&o.length>0&&!A&&!I?(console.log(`Flow with slug ${u} not found`),null):(C==null?void 0:C.active)===!1?null:C}function D(u){var _;if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),(((_=JSON.parse(C))==null?void 0:_.data)??[]).map(ye=>{let Or=se(ye);return{handleSecondaryButtonClick:()=>{ye.skippable===!0&&H(u,ye.id,{skipped:!0})},...ye,complete:ge(u,ye.id)===Ue||Or>=1,blocked:re(u,ye.id),hidden:L(u,ye.id),handlePrimaryButtonClick:()=>{(!ye.completionCriteria&&(ye.autoMarkCompleted||ye.autoMarkCompleted===void 0)||ye.completionCriteria&&ye.autoMarkCompleted===!0)&&H(u,ye.id)},progress:Or}}).filter(ye=>ye.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(C,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(_){return"&#"+_.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function M(u){if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),JSON.parse(C)??{}):[]}function te(u,C){p(v=>({...v,[u]:C}))}function fe(u){!A&&!I&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{te(C,u[C])})}let X=xt(async(u,C,v)=>{if(!w())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:xo,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(_)&&(await F(u,C,_),P(_))},[r,y]),W=xt(async(u,C,v)=>{if(!w())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Oe,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(_)&&(await T(u,C),P(_))},[r,y]),H=xt(async(u,C,v)=>{if(!w())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ue,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(_)&&(await B(u,C,_),P(_))},[r,y]),Ce=xt(async(u,C)=>{if(!w()||pe(u)===Me)return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),J(v)&&P(v)},[r,y]),Ie=xt(async(u,C)=>{if(!w())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:gt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&P(v)},[r,y]),we=xt(async(u,C)=>{if(!w())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await h(u),P(v))},[r,y]),me=xt(async(u,C)=>{if(!w())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:go,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await h(u),P(v))},[r,y]);function J(u){var C;if(!y&&u.actionType===Oe)return!1;if(y){let v=y.find(_=>_.flowId===u.flowSlug);if(u.actionType===Oe&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Oe)||v&&((C=v.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType||v&&v.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,C){let v=j(u,C);return A?null:v?v.actionType:Oe}function re(u,C){let v=j(u,C);return v?v.blocked:!1}function L(u,C){let v=j(u,C);return v?v.hidden:!1}function j(u,C){if(A)return null;let v=y==null?void 0:y.find(_=>_.flowId===u);return!v||!v.stepStates[C]?null:v.stepStates[C]??null}function V(u){var v;if(A||!y)return null;if(pe(u)===Me)return D(u)[0]??null;let C=(v=y.find(_=>_.flowId===u))==null?void 0:v.lastStepId;return C?D(u).find(_=>_.id===C):null}function ne(u){let C=V(u);if(!C)return 0;let v=D(u).findIndex(_=>_.id===C.id)??0;return ge(u,C.id)===Ue&&v<D(u).length-1?v+1:v}function se(u){if(!u.completionCriteria)return;let C=Mr(u.completionCriteria);if(C===null)return;let v=Ye(C),_=$e(C);return _===0?void 0:v/_}function pe(u){let C=y==null?void 0:y.find(v=>v.flowId===u);return C?C.flowState:null}function Ye(u){let C=D(u);return C.length===0?0:C.filter(_=>ge(u,_.id)===Ue).length}function $e(u){return D(u).length}function G(u){let C=o.find(v=>v.slug===u);return C?JSON.parse(C.data):null}function Be(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&y){let C=y.find(v=>v.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function Kt(u){return!Be($(u))}function fo(){r&&b()}return{getFlow:$,getFlowData:G,isLoading:A||I,getStepStatus:ge,getFlowSteps:D,getCurrentStepIndex:ne,markStepStarted:X,markStepCompleted:H,markFlowNotStarted:Ce,markFlowStarted:Ie,markFlowCompleted:we,markFlowAborted:me,markStepNotStarted:W,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:$e,targetingLogicShouldHideFlow:Be,setCustomVariable:te,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:M,isStepBlocked:re,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,isFlowAvailableToUser:Kt,refresh:fo}}import{useCallback as Ur,useContext as Wl,useEffect as Hl}from"react";var Nt="guest_";function Yt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Wl(K),{config:n,apiUrl:s}=We(),{mutateUserFlowState:p}=Ee(),c=Et(),{verifySDKInitiated:a}=At();Hl(()=>{if(e&&!t){if(e.startsWith(Nt))return;let x=`frigade-user-registered-${e}`;localStorage.getItem(x)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(x,"true"))}},[e,r,t]);let g=Ur(async x=>{if(!a())return;let S={foreignId:e,properties:x};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),i(w=>({...w,...x})),p()},[e,n,r,p]),d=Ur(async(x,S)=>{if(!a())return;let P={foreignId:e,events:[{event:x,properties:S}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(P)}),p()},[e,n,p]);return{userId:e,setUserId:o,addPropertiesToUser:g,trackEventForUser:d}}import{v4 as up}from"uuid";import Ge,{useEffect as ap,useState as pp}from"react";import ze,{useEffect as Xl}from"react";import yo from"styled-components";import jl from"react";import Vl from"styled-components";var zr="fr-",Xt="cfr-";function l(e,t){let o=`${zr}${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+" "+Xt+e}return o}function k(e){if(!e.className||e.className.indexOf(Xt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(zr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Yo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Xe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Yo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Jt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Gl=Vl.div`
2
+ import bt,{createContext as Wp,useEffect as Do,useState as Le}from"react";import{ThemeProvider as _p}from"styled-components";import St,{useContext as gp,useEffect as Oo,useState as ur}from"react";import{useCallback as xt,useContext as zl,useEffect as Wl}from"react";import qo,{useMemo as Dr}from"react";var Lr="1.35.6 ";var Oe="NOT_STARTED_STEP",q="COMPLETED_FLOW",go="ABORTED_FLOW",gt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",xo="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=qo.useContext(K);return{config:Dr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Lr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Dr(()=>`${o}/v1/public/`,[o])}}var vl="frigade-last-call-at-",Bl="frigade-last-call-data-";function Et(){let{shouldGracefullyDegrade:e,readonly:t}=qo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Bt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Bt();let r=vl+o,n=Bl+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return Bt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return Bt(p)}return s?s.ok?s:Bt(s.statusText):Bt()}}function Bt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function At(){let{publicApiKey:e,shouldGracefullyDegrade:t}=qo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as $l,useState as $r}from"react";import{useContext as Al,useEffect as Nl,useState as Il}from"react";import Ol from"swr";import{useContext as El}from"react";function Te(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=El(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(S=>({...S,[d]:x}))}function p(d){t(x=>{let{[d]:S,...w}=x;return{...w}})}function c(d){r.includes(d)||i(x=>[...x,d])}function a(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,S])=>S&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:a}}import Ll from"swr/immutable";var Dl="unknown";function Ee(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Al(K),{resetOpenFlowState:c}=Te(),[a,g]=Il(!1),d={data:n.map(F=>({flowId:F.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=F=>fetch(F,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${F}: ${k}. Will gracefully degrade and hide Frigade`),s(!0),d)),S=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:w,isLoading:P,mutate:f,error:E}=p?Ll(S,x):Ol(S,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),b=w==null?void 0:w.data;Nl(()=>{!a&&!P&&b&&g(!0)},[b,a,P]);async function y(F){if(b&&!p){let k=b.find(O=>O.flowId===F);k&&k.flowState!==q&&(k.flowState=q),await f(Promise.resolve({...w,data:b}),{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function A(F,k,O){if(b){let N=b.find(I=>I.flowId===F);N&&(N.stepStates[k]=O,N.flowState=gt),await f(Promise.resolve({...w,data:b}),{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function h(F,k,O){if(b){let N=b.find(I=>I.flowId===F);N&&(N.lastStepId=k,N.stepStates[k]=O,N.flowState=gt),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function m(F){if(b){let k=b.find(O=>O.flowId===F);k&&k.flowState!==Me&&(k.flowState=Me,k.lastStepId=Dl,Object.keys(k.stepStates).forEach(O=>{k.stepStates[O].actionType=Oe,k.stepStates[O].createdAt=new Date().toISOString()}),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1}),c(F))}}async function B(F,k){if(b){let O=b.find(N=>N.flowId===F);O&&O.stepStates[k]!==Oe&&(O.stepStates[k]=Oe),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:b,isLoadingUserFlowStateData:!a,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:h,error:E}}function qt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Ee(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=$l(K),[c,a]=$r(new Set),[g,d]=$r(new Set),x=Et();function S(f){let E=JSON.stringify(f);if(c.has(E))return null;c.add(E),a(c),g.add(f),d(g);let b=s==null?void 0:s.find(y=>y.flowSlug===f.flowSlug&&y.stepId===f.stepId&&y.actionType===f.actionType&&y.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:E}).then(y=>{y.status!==200&&y.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):b||p(A=>[...A??[],f])})}async function w(f){f.foreignUserId&&(f.actionType===gt||f.actionType===Me?await S(f):f.actionType===q?await S(f):f.actionType===xo?await S(f):f.actionType===Ue?await S(f):f.actionType===go?await S(f):f.actionType===Oe&&await S(f))}function P(){let f=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let b in E.stepStates){let y=E.stepStates[b];f.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:y.stepId,actionType:y.actionType,data:{},createdAt:new Date(y.createdAt),blocked:y.blocked,hidden:y.hidden})}}),[...f,...s]}return{addResponse:w,setFlowResponses:p,getFlowResponses:P}}import _l from"swr";var Ml=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Mr=e=>{let t=Ml.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Ul(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Ul=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Y(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=zl(K),S={data:[]},{verifySDKInitiated:w}=At(),{addResponse:P,getFlowResponses:f}=qt(),E=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),S)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),S)),{mutateUserFlowState:b,userFlowStatesData:y,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:B,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:k}=Ee(),{data:O,error:N,isLoading:I}=_l(n?`${t}flows${x?"?readonly=true":""}`:null,E,{keepPreviousData:!0});Wl(()=>{if(N){console.error(N);return}O&&O.data&&i(O.data)},[O,N]);function $(u){if(I)return null;let C=o.find(v=>v.slug===u);return!C&&o.length>0&&!A&&!I?(console.log(`Flow with slug ${u} not found`),null):(C==null?void 0:C.active)===!1?null:C}function D(u){var W;if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),(((W=JSON.parse(C))==null?void 0:W.data)??[]).map(ye=>{let Or=se(ye);return{handleSecondaryButtonClick:()=>{ye.skippable===!0&&H(u,ye.id,{skipped:!0})},...ye,complete:ge(u,ye.id)===Ue||Or>=1,blocked:re(u,ye.id),hidden:L(u,ye.id),handlePrimaryButtonClick:()=>{(!ye.completionCriteria&&(ye.autoMarkCompleted||ye.autoMarkCompleted===void 0)||ye.completionCriteria&&ye.autoMarkCompleted===!0)&&H(u,ye.id)},progress:Or}}).filter(ye=>ye.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(C,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function M(u){if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),JSON.parse(C)??{}):[]}function te(u,C){p(v=>({...v,[u]:C}))}function fe(u){!A&&!I&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{te(C,u[C])})}let X=xt(async(u,C,v)=>{if(!w())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:xo,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await k(u,C,W),P(W))},[r,y]),_=xt(async(u,C,v)=>{if(!w())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Oe,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await F(u,C),P(W))},[r,y]),H=xt(async(u,C,v)=>{if(!w())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ue,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await B(u,C,W),P(W))},[r,y]),Ce=xt(async(u,C)=>{if(!w()||pe(u)===Me)return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),J(v)&&P(v)},[r,y]),Ie=xt(async(u,C)=>{if(!w())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:gt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&P(v)},[r,y]),we=xt(async(u,C)=>{if(!w())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await h(u),P(v))},[r,y]),me=xt(async(u,C)=>{if(!w())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:go,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await h(u),P(v))},[r,y]);function J(u){var C;if(!y&&u.actionType===Oe)return!1;if(y){let v=y.find(W=>W.flowId===u.flowSlug);if(u.actionType===Oe&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Oe)||v&&((C=v.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType||v&&v.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,C){let v=j(u,C);return A?null:v?v.actionType:Oe}function re(u,C){let v=j(u,C);return v?v.blocked:!1}function L(u,C){let v=j(u,C);return v?v.hidden:!1}function j(u,C){if(A)return null;let v=y==null?void 0:y.find(W=>W.flowId===u);return!v||!v.stepStates[C]?null:v.stepStates[C]??null}function V(u){var v;if(A||!y)return null;if(pe(u)===Me)return D(u)[0]??null;let C=(v=y.find(W=>W.flowId===u))==null?void 0:v.lastStepId;return C?D(u).find(W=>W.id===C):null}function ne(u){let C=V(u);if(!C)return 0;let v=D(u).findIndex(W=>W.id===C.id)??0;return ge(u,C.id)===Ue&&v<D(u).length-1?v+1:v}function se(u){if(!u.completionCriteria)return;let C=Mr(u.completionCriteria);if(C===null)return;let v=Ye(C),W=$e(C);return W===0?void 0:v/W}function pe(u){let C=y==null?void 0:y.find(v=>v.flowId===u);return C?C.flowState:null}function Ye(u){let C=D(u);return C.length===0?0:C.filter(W=>ge(u,W.id)===Ue).length}function $e(u){return D(u).length}function G(u){let C=o.find(v=>v.slug===u);return C?JSON.parse(C.data):null}function Be(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&y){let C=y.find(v=>v.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function Kt(u){return!Be($(u))}function fo(){r&&b()}return{getFlow:$,getFlowData:G,isLoading:A||I,getStepStatus:ge,getFlowSteps:D,getCurrentStepIndex:ne,markStepStarted:X,markStepCompleted:H,markFlowNotStarted:Ce,markFlowStarted:Ie,markFlowCompleted:we,markFlowAborted:me,markStepNotStarted:_,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:$e,targetingLogicShouldHideFlow:Be,setCustomVariable:te,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:M,isStepBlocked:re,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,isFlowAvailableToUser:Kt,refresh:fo}}import{useCallback as Ur,useContext as Hl,useEffect as jl}from"react";var Nt="guest_";function Yt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Hl(K),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Ee(),c=Et(),{verifySDKInitiated:a}=At();jl(()=>{if(e&&!t){if(e.startsWith(Nt))return;let x=`frigade-user-registered-${e}`;localStorage.getItem(x)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(x,"true"))}},[e,r,t]);let g=Ur(async x=>{if(!a())return;let S={foreignId:e,properties:x};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),i(w=>({...w,...x})),p()},[e,n,r,p]),d=Ur(async(x,S)=>{if(!a())return;let P={foreignId:e,events:[{event:x,properties:S}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(P)}),p()},[e,n,p]);return{userId:e,setUserId:o,addPropertiesToUser:g,trackEventForUser:d}}import{v4 as xp}from"uuid";import Ge,{useEffect as cp,useState as mp}from"react";import ze,{useEffect as Zl}from"react";import yo from"styled-components";import Vl from"react";import Gl from"styled-components";var zr="fr-",Xt="cfr-";function l(e,t){let o=`${zr}${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+" "+Xt+e}return o}function T(e){if(!e.className||e.className.indexOf(Xt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(zr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Yo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Xe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Yo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Jt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Kl=Gl.div`
3
3
  display: flex;
4
4
  justify-content: center;
5
5
  position: fixed;
@@ -7,7 +7,7 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
7
7
  left: 0;
8
8
  bottom: 0;
9
9
  right: 0;
10
- ${e=>k(e)} {
10
+ ${e=>T(e)} {
11
11
  background-color: rgba(0, 0, 0, 0.6);
12
12
  z-index: 1400;
13
13
  }
@@ -23,12 +23,12 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
23
23
  opacity: 1;
24
24
  }
25
25
  }
26
- `,_r=({onClose:e,appearance:t})=>jl.createElement(Gl,{className:l("modalBackground",t),onClick:()=>e()});import Xo from"react";import Kl from"styled-components";var ql=Kl.div`
26
+ `,Wr=({onClose:e,appearance:t})=>Vl.createElement(Kl,{className:l("modalBackground",t),onClick:()=>e()});import Xo from"react";import ql from"styled-components";var Yl=ql.div`
27
27
  :hover {
28
28
  opacity: 0.8;
29
29
  }
30
- `,Fe=()=>Xo.createElement(ql,null,Xo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Xo.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Jl}from"react-portal";import Zr from"react";import Jo from"react";function Yl({style:e,className:t}){return Jo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Jo.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),Jo.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var Wr=Yl;import Qo from"styled-components";import nt from"styled-components";var ho=nt.div`
31
- ${e=>k(e)} {
30
+ `,Fe=()=>Xo.createElement(Yl,null,Xo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Xo.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Rl}from"react-portal";import Rr from"react";import Jo from"react";function Xl({style:e,className:t}){return Jo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Jo.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),Jo.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var _r=Xl;import Qo from"styled-components";import Je from"styled-components";var ho=Je.div`
31
+ ${e=>T(e)} {
32
32
  background: ${e=>e.appearance.theme.colorBackground};
33
33
  }
34
34
 
@@ -36,55 +36,72 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
36
36
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
37
37
  max-width: ${e=>e.maxWidth}px;
38
38
  min-width: 300px;
39
- padding: 22px 22px 12px;
40
39
  z-index: ${e=>e.zIndex};
41
- `,Hr=nt.div`
40
+ overflow: hidden;
41
+ `,Jl=`
42
+ display: block;
43
+ cursor: pointer;
44
+ position: absolute;
45
+ background-color: rgba(0, 0, 0, 0.2);
46
+ color: #ffffff;
47
+ padding: 4px;
48
+ border-radius: 100px;
49
+ top: 12px;
50
+ right: 12px;
51
+ :hover {
52
+ opacity: 0.8;
53
+ }`,Ql=`
42
54
  display: block;
43
55
  cursor: pointer;
44
56
  position: absolute;
45
57
  top: 12px;
46
58
  right: 12px;
47
- `,jr=nt.img`
48
- ${e=>k(e)} {
59
+ `,Hr=Je.div`
60
+ ${e=>T(e)} {
61
+ ${e=>e.hasImage?Jl:Ql};
62
+ }
63
+ `,jr=Je.img`
64
+ ${e=>T(e)} {
49
65
  display: block;
50
66
  width: 100%;
51
67
  height: auto;
52
68
  min-height: 200px;
53
- margin-top: ${e=>e.dismissible?"24px":"0px"};
54
- margin-bottom: 16px;
69
+ object-fit: cover;
55
70
  }
56
- `,Vr=nt.div`
57
- ${e=>k(e)} {
71
+ `,Vr=Je.div`
72
+ ${e=>T(e)} {
58
73
  display: block;
59
74
  width: 100%;
60
75
  height: auto;
61
76
  margin-top: ${e=>e.dismissible?"24px":"0px"};
62
- margin-bottom: 16px;
77
+ object-fit: cover;
63
78
  }
64
- `,Gr=nt.div`
79
+ `,Gr=Je.div`
65
80
  display: flex;
66
81
  flex-direction: row;
67
82
  justify-content: space-between;
68
83
  align-content: center;
69
- `,Kr=nt.div`
84
+ `,Kr=Je.div`
85
+ padding: 22px 22px 12px;
86
+ `,qr=Je.div`
70
87
  display: flex;
71
88
  flex: 1;
72
89
  flex-direction: column;
73
90
  justify-content: center;
74
- `,qr=nt.div`
91
+ `,Yr=Je.div`
75
92
  display: flex;
76
93
  flex: 2;
77
94
  flex-shrink: 1;
78
95
  gap: 8px;
79
96
  height: 64px;
80
- ${e=>k(e)} {
97
+ ${e=>T(e)} {
81
98
  flex-direction: row;
82
99
  justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
83
100
  align-content: center;
84
101
  align-items: center;
85
102
  }
86
- `,Yr=nt.p`
87
- ${e=>k(e)} {
103
+ `,Xr=Je.p`
104
+ ${e=>T(e)} {
88
105
  font-style: normal;
89
106
  font-weight: 600;
90
107
  font-size: 15px;
@@ -92,7 +109,7 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
92
109
  color: #808080;
93
110
  }
94
111
  margin: 0;
95
- `;var Xr=Qo.div`
112
+ `;var Jr=Qo.div`
96
113
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
97
114
  position: absolute;
98
115
  bottom: -47px;
@@ -103,7 +120,7 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
103
120
  align-items: center;
104
121
  justify-content: center;
105
122
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
106
- `,Jr=Qo(ho)`
123
+ `,Qr=Qo(ho)`
107
124
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
108
125
  position: absolute;
109
126
  bottom: -60px;
@@ -116,7 +133,7 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
116
133
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
117
134
  padding: 0;
118
135
  z-index: ${e=>e.zIndex};
119
- `,Qr=Qo.div`
136
+ `,Zr=Qo.div`
120
137
  display: flex;
121
138
  justify-content: center;
122
139
  align-items: center;
@@ -125,8 +142,8 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
125
142
  font-size: 12px;
126
143
  line-height: 18px;
127
144
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
128
- `;function Co({appearance:e}){return Zr.createElement(Qr,{className:l("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Zr.createElement(Wr,null))}var Ql=yo.div`
129
- ${e=>k(e)} {
145
+ `;function Co({appearance:e}){return Rr.createElement(Zr,{className:l("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Rr.createElement(_r,null))}var ea=yo.div`
146
+ ${e=>T(e)} {
130
147
  // Anything inside this block will be ignored if the user provides a custom class
131
148
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
132
149
  /* Mobile */
@@ -167,27 +184,27 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
167
184
  opacity: 1;
168
185
  }
169
186
  }
170
- `,Zl=yo.div`
187
+ `,ta=yo.div`
171
188
  position: relative;
172
189
  flex: 0 1 auto;
173
- `,Rl=yo.div`
190
+ `,oa=yo.div`
174
191
  position: absolute;
175
192
  top: 16px;
176
193
  right: 16px;
177
194
  cursor: pointer;
178
195
  z-index: 1501;
179
- ${e=>k(e)} {
196
+ ${e=>T(e)} {
180
197
  // Anything inside this block will be ignored if the user provides a custom class
181
198
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
182
199
  }
183
- `,ea=yo.div`
200
+ `,ra=yo.div`
184
201
  overflow: scroll;
185
202
  flex: 1 1;
186
203
  display: flex;
187
204
  ::-webkit-scrollbar {
188
205
  display: none;
189
206
  }
190
- `,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>(Xl(()=>{let c=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",c),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",c)}},[e,t]),t?ze.createElement(Jl,null,ze.createElement(_r,{appearance:n,onClose:()=>{s&&e()}}),ze.createElement(Ql,{appearance:n,className:l("modalContainer",n),styleOverrides:i},s&&ze.createElement(Rl,{className:l("modalClose",n),onClick:()=>e(),appearance:n},ze.createElement(Fe,null)),o&&ze.createElement(Zl,null,o),ze.createElement(ea,null,r),p&&ze.createElement(Xr,{appearance:n,className:l("poweredByFrigadeRibbon",n)},ze.createElement(Co,{appearance:n})))):ze.createElement(ze.Fragment,null));import st,{useEffect as ta}from"react";import So from"styled-components";import{Portal as oa}from"react-portal";function ra(e){switch(e){case"top-left":return`
207
+ `,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>(Zl(()=>{let c=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",c),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",c)}},[e,t]),t?ze.createElement(Rl,null,ze.createElement(Wr,{appearance:n,onClose:()=>{s&&e()}}),ze.createElement(ea,{appearance:n,className:l("modalContainer",n),styleOverrides:i},s&&ze.createElement(oa,{className:l("modalClose",n),onClick:()=>e(),appearance:n},ze.createElement(Fe,null)),o&&ze.createElement(ta,null,o),ze.createElement(ra,null,r),p&&ze.createElement(Jr,{appearance:n,className:l("poweredByFrigadeRibbon",n)},ze.createElement(Co,{appearance:n})))):ze.createElement(ze.Fragment,null));import st,{useEffect as ia}from"react";import So from"styled-components";import{Portal as na}from"react-portal";function sa(e){switch(e){case"top-left":return`
191
208
  top: 0;
192
209
  left: 0;
193
210
  `;case"top-right":return`
@@ -196,8 +213,8 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
196
213
  `;case"bottom-left":return`
197
214
  bottom: 0;
198
215
  left: 0;
199
- `}return"right: 0; bottom: 0;"}var ia=So.div`
200
- ${e=>k(e)} {
216
+ `}return"right: 0; bottom: 0;"}var la=So.div`
217
+ ${e=>T(e)} {
201
218
  // Anything inside this block will be ignored if the user provides a custom class
202
219
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
203
220
  position: fixed;
@@ -210,29 +227,29 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
210
227
  width: 350px;
211
228
  padding: 24px;
212
229
  }
213
- ${e=>ra(e.modalPosition)}
230
+ ${e=>sa(e.modalPosition)}
214
231
  margin: 28px;
215
- `,na=So.div`
232
+ `,aa=So.div`
216
233
  position: relative;
217
234
  flex: 1;
218
- `,sa=So.div`
235
+ `,pa=So.div`
219
236
  position: absolute;
220
237
  top: 16px;
221
238
  right: 16px;
222
239
  cursor: pointer;
223
240
  z-index: 1501;
224
- ${e=>k(e)} {
241
+ ${e=>T(e)} {
225
242
  // Anything inside this block will be ignored if the user provides a custom class
226
243
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
227
244
  }
228
- `,la=So.div`
245
+ `,da=So.div`
229
246
  overflow: scroll;
230
247
  flex: 5;
231
248
  ::-webkit-scrollbar {
232
249
  display: none;
233
250
  }
234
- `,bo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>(ta(()=>{if(!s)return;let p=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",p),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",p)}},[e,t]),t?st.createElement(oa,null,st.createElement(ia,{appearance:r,className:l("cornerModalContainer",r),modalPosition:n},s&&st.createElement(sa,{className:l("cornerModalClose",r),onClick:()=>e()},st.createElement(Fe,null)),o&&st.createElement(na,null,o),st.createElement(la,null,i))):st.createElement(st.Fragment,null));import{useContext as aa}from"react";function Q(){let{defaultAppearance:e}=aa(K);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import ht,{useContext as Na,useEffect as Ia,useState as sr}from"react";import Po from"styled-components";import Fo,{useEffect as pa,useState as ii}from"react";import er from"styled-components";import wo from"styled-components";var Rr=wo.label`
235
- ${e=>k(e)} {
251
+ `,bo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>(ia(()=>{if(!s)return;let p=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",p),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",p)}},[e,t]),t?st.createElement(na,null,st.createElement(la,{appearance:r,className:l("cornerModalContainer",r),modalPosition:n},s&&st.createElement(pa,{className:l("cornerModalClose",r),onClick:()=>e()},st.createElement(Fe,null)),o&&st.createElement(aa,null,o),st.createElement(da,null,i))):st.createElement(st.Fragment,null));import{useContext as ca}from"react";function Q(){let{defaultAppearance:e}=ca(K);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import ht,{useContext as La,useEffect as Da,useState as sr}from"react";import Po from"styled-components";import Fo,{useEffect as ma,useState as ni}from"react";import er from"styled-components";import wo from"styled-components";var ei=wo.label`
252
+ ${e=>T(e)} {
236
253
  font-size: 12px;
237
254
  line-height: 18px;
238
255
  margin-bottom: 5px;
@@ -242,14 +259,14 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
242
259
  letter-spacing: 0.24px;
243
260
  }
244
261
  display: flex;
245
- `,ei=wo.label`
246
- ${e=>k(e)} {
262
+ `,ti=wo.label`
263
+ ${e=>T(e)} {
247
264
  font-size: 12px;
248
265
  line-height: 20px;
249
266
  margin-bottom: 5px;
250
267
  }
251
268
  display: flex;
252
- `,ti=wo.span`
269
+ `,oi=wo.span`
253
270
  font-weight: 400;
254
271
  font-size: 14px;
255
272
  line-height: 22px;
@@ -262,12 +279,12 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
262
279
  align-items: flex-start;
263
280
  justify-content: left;
264
281
  margin-bottom: 10px;
265
- `;import Zo from"react";var Je={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function lt({title:e,required:t,appearance:o=Je}){return e?Zo.createElement(To,null,t?Zo.createElement(ti,{className:l("formLabelRequired",o),appearance:o},"*"):null,Zo.createElement(Rr,{className:l("formLabel",o)},e)):null}import oi from"react";function It({title:e,appearance:t}){return e?oi.createElement(To,null,oi.createElement(ei,{className:l("formSubLabel",t)},e)):null}import{z as Ro}from"zod";function ri(e,t){try{if(t){if(t.type=="number"){let o=Ro.number();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too small"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too large"):i.requirement=="positive"?o=o.positive(i.message??"Value must be positive"):i.requirement=="negative"&&(o=o.nonpositive(i.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=Ro.string();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too short"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too long"):i.requirement=="regex"&&(o=o.regex(new RegExp(String(i.value)),i.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof Ro.ZodError)return o.issues&&o.issues.length>0?o.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,o)}return null}var da=er.div`
282
+ `;import Zo from"react";var Qe={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function lt({title:e,required:t,appearance:o=Qe}){return e?Zo.createElement(To,null,t?Zo.createElement(oi,{className:l("formLabelRequired",o),appearance:o},"*"):null,Zo.createElement(ei,{className:l("formLabel",o)},e)):null}import ri from"react";function It({title:e,appearance:t}){return e?ri.createElement(To,null,ri.createElement(ti,{className:l("formSubLabel",t)},e)):null}import{z as Ro}from"zod";function ii(e,t){try{if(t){if(t.type=="number"){let o=Ro.number();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too small"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too large"):i.requirement=="positive"?o=o.positive(i.message??"Value must be positive"):i.requirement=="negative"&&(o=o.nonpositive(i.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=Ro.string();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too short"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too long"):i.requirement=="regex"&&(o=o.regex(new RegExp(String(i.value)),i.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof Ro.ZodError)return o.issues&&o.issues.length>0?o.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,o)}return null}var ua=er.div`
266
283
  display: flex;
267
284
  flex-direction: column;
268
285
  width: 100%;
269
286
  `,tr=er.input`
270
- ${e=>k(e)} {
287
+ ${e=>T(e)} {
271
288
  // Anything inside this block will be ignored if the user provides a custom class
272
289
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
273
290
  font-size: 14px;
@@ -282,8 +299,8 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
282
299
  box-sizing: border-box;
283
300
  padding: 0 10px;
284
301
  margin-bottom: 10px;
285
- `,ca=er.textarea`
286
- ${e=>k(e)} {
302
+ `,fa=er.textarea`
303
+ ${e=>T(e)} {
287
304
  // Anything inside this block will be ignored if the user provides a custom class
288
305
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
289
306
  font-size: 14px;
@@ -298,14 +315,14 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
298
315
  min-height: 70px;
299
316
  box-sizing: border-box;
300
317
  margin-bottom: 10px;
301
- `;function or({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=ii((r==null?void 0:r.text)||""),[c,a]=ii(!1),g=tr;pa(()=>{s===""&&!c&&(a(!0),d(""))},[]);function d(S){if(p(S),o({text:S}),n.required===!0&&S.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`}]);return}let w=ri(S,n.validation);if(w){i([{id:n.id,message:w}]);return}i([])}n.multiline&&(g=ca);function x(){var S;switch((S=n==null?void 0:n.validation)==null?void 0:S.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Fo.createElement(da,null,Fo.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),Fo.createElement(g,{className:l("inputComponent",t.appearance),value:s,onChange:S=>{d(S.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:x()}),Fo.createElement(It,{title:n.subtitle,appearance:t.appearance}))}import je,{useEffect as ni,useState as si}from"react";import li from"styled-components";var rr="",ma=li.div`
318
+ `;function or({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=ni((r==null?void 0:r.text)||""),[c,a]=ni(!1),g=tr;ma(()=>{s===""&&!c&&(a(!0),d(""))},[]);function d(S){if(p(S),o({text:S}),n.required===!0&&S.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`}]);return}let w=ii(S,n.validation);if(w){i([{id:n.id,message:w}]);return}i([])}n.multiline&&(g=fa);function x(){var S;switch((S=n==null?void 0:n.validation)==null?void 0:S.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Fo.createElement(ua,null,Fo.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),Fo.createElement(g,{className:l("inputComponent",t.appearance),value:s,onChange:S=>{d(S.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:x()}),Fo.createElement(It,{title:n.subtitle,appearance:t.appearance}))}import je,{useEffect as si,useState as li}from"react";import ai from"styled-components";var rr="",ga=ai.div`
302
319
  display: flex;
303
320
  flex-direction: column;
304
321
  width: 100%;
305
322
  -webkit-appearance: none;
306
323
  appearance: none;
307
- `,ua=li.select`
308
- ${e=>k(e)} {
324
+ `,xa=ai.select`
325
+ ${e=>T(e)} {
309
326
  // Anything inside this block will be ignored if the user provides a custom class
310
327
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
311
328
  font-size: 14px;
@@ -325,16 +342,16 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
325
342
  background-repeat: no-repeat;
326
343
  background-size: 1.5em 1.5em;
327
344
  -webkit-print-color-adjust: exact;
328
- `;function ai({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,S,w,P;let n=e,[s,p]=si(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,a]=si(!1);return ni(()=>{var f,E,b,y;if(s===""&&!c){if(a(!0),n.requireSelection){p(rr);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(A=>A.id===n.defaultValue))){let A=(E=n.props.options)==null?void 0:E.find(h=>h.id===n.defaultValue);p(A.id),o({choice:[A.id]})}else p(((b=n.props.options)==null?void 0:b[0].id)||""),o({choice:[((y=n.props.options)==null?void 0:y[0].id)||""]})}},[]),ni(()=>{n.requireSelection&&s===rr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),je.createElement(ma,null,je.createElement(lt,{title:n.title,required:!1,appearance:t.appearance}),je.createElement(ua,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},n.requireSelection&&je.createElement("option",{key:"null-value",value:rr,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(f=>je.createElement("option",{key:f.id,value:f.id},f.title))),((S=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:S.isOpenEnded)&&je.createElement(je.Fragment,null,je.createElement(lt,{title:((P=(w=n.props.options)==null?void 0:w.find(f=>f.id===s))==null?void 0:P.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),je.createElement(tr,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),je.createElement(It,{title:n.subtitle,appearance:t.appearance}))}import Rt,{useEffect as ir,useState as di}from"react";import ci from"styled-components";import Zt from"react";import Qt from"react";var pi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return Qt.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},fa=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>Qt.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},Qt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Qt.createElement(pi,{color:r,size:t}),Qt.createElement(pi,{color:e,percentage:o,size:t})),i),Ot=fa;import ga from"styled-components";var xa=({color:e="#FFFFFF"})=>Zt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ha={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Ca={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},ya={border:"1px solid #000000",color:"#FFFFFF"},Sa={border:"1px solid #C5CBD3"},ba={color:"#FFFFFF"},wa={border:"1px solid #C5CBD3"},Ta=e=>e==="square"?ha:Ca,Fa=(e,t)=>e==="square"?t?ya:Sa:t?ba:wa,ka=ga.div`
345
+ `;function pi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,S,w,P;let n=e,[s,p]=li(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,a]=li(!1);return si(()=>{var f,E,b,y;if(s===""&&!c){if(a(!0),n.requireSelection){p(rr);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(A=>A.id===n.defaultValue))){let A=(E=n.props.options)==null?void 0:E.find(h=>h.id===n.defaultValue);p(A.id),o({choice:[A.id]})}else p(((b=n.props.options)==null?void 0:b[0].id)||""),o({choice:[((y=n.props.options)==null?void 0:y[0].id)||""]})}},[]),si(()=>{n.requireSelection&&s===rr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),je.createElement(ga,null,je.createElement(lt,{title:n.title,required:!1,appearance:t.appearance}),je.createElement(xa,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},n.requireSelection&&je.createElement("option",{key:"null-value",value:rr,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(f=>je.createElement("option",{key:f.id,value:f.id},f.title))),((S=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:S.isOpenEnded)&&je.createElement(je.Fragment,null,je.createElement(lt,{title:((P=(w=n.props.options)==null?void 0:w.find(f=>f.id===s))==null?void 0:P.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),je.createElement(tr,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),je.createElement(It,{title:n.subtitle,appearance:t.appearance}))}import Rt,{useEffect as ir,useState as ci}from"react";import mi from"styled-components";import Zt from"react";import Qt from"react";var di=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return Qt.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},ha=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>Qt.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},Qt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Qt.createElement(di,{color:r,size:t}),Qt.createElement(di,{color:e,percentage:o,size:t})),i),Ot=ha;import Ca from"styled-components";var ya=({color:e="#FFFFFF"})=>Zt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Sa={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ba={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},wa={border:"1px solid #000000",color:"#FFFFFF"},Ta={border:"1px solid #C5CBD3"},Fa={color:"#FFFFFF"},ka={border:"1px solid #C5CBD3"},Pa=e=>e==="square"?Sa:ba,va=(e,t)=>e==="square"?t?wa:Ta:t?Fa:ka,Ba=Ca.div`
329
346
  ${e=>Xe(e)}
330
- `,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=Ta(t),c=Fa(t,e);return e===!0?p={...p,...c,backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?Zt.createElement(Ot,{fillColor:o,percentage:i,size:22}):Zt.createElement(ka,{styleOverrides:p,style:n,role:"checkbox",className:xe(l("checkIconContainer",r),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Zt.createElement(xa,{color:"#FFFFFF"}))};var Pa=ci.div`
347
+ `,Ze=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Qe,style:n,className:s})=>{let p=Pa(t),c=va(t,e);return e===!0?p={...p,...c,backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?Zt.createElement(Ot,{fillColor:o,percentage:i,size:22}):Zt.createElement(Ba,{styleOverrides:p,style:n,role:"checkbox",className:xe(l("checkIconContainer",r),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Zt.createElement(ya,{color:"#FFFFFF"}))};var Ea=mi.div`
331
348
  display: flex;
332
349
  flex-direction: column;
333
350
  width: 100%;
334
351
  -webkit-appearance: none;
335
352
  appearance: none;
336
- `,va=ci.button`
337
- ${e=>k(e)} {
353
+ `,Aa=mi.button`
354
+ ${e=>T(e)} {
338
355
  // Anything inside this block will be ignored if the user provides a custom class
339
356
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
340
357
  font-size: 14px;
@@ -358,8 +375,8 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
358
375
  height: 48px;
359
376
  padding: 0 18px;
360
377
  margin-bottom: 10px;
361
- `;function mi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=di((i==null?void 0:i.choice)||[]),[c,a]=di(!1);return ir(()=>{s.length==0&&!c&&(a(!0),o({choice:[]}))},[]),ir(()=>{o({choice:s})},[s]),ir(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),Rt.createElement(Pa,null,Rt.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>Rt.createElement(va,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,Rt.createElement(Qe,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),Rt.createElement(It,{title:n.subtitle,appearance:t.appearance}))}import ko from"react";import ui from"styled-components";import Ba from"dompurify";function le(e){return{__html:Ba.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Ea=ui.h1`
362
- ${e=>k(e)} {
378
+ `;function ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=ci((i==null?void 0:i.choice)||[]),[c,a]=ci(!1);return ir(()=>{s.length==0&&!c&&(a(!0),o({choice:[]}))},[]),ir(()=>{o({choice:s})},[s]),ir(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),Rt.createElement(Ea,null,Rt.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>Rt.createElement(Aa,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,Rt.createElement(Ze,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),Rt.createElement(It,{title:n.subtitle,appearance:t.appearance}))}import ko from"react";import fi from"styled-components";import Na from"dompurify";function le(e){return{__html:Na.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Ia=fi.h1`
379
+ ${e=>T(e)} {
363
380
  font-style: normal;
364
381
  font-weight: 700;
365
382
  font-size: ${e=>e.size=="small"?"15px":"18px"};
@@ -370,8 +387,8 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
370
387
  margin-bottom: 4px;
371
388
  color: ${e=>e.appearance.theme.colorText};
372
389
  }
373
- `,Aa=ui.h2`
374
- ${e=>k(e)} {
390
+ `,Oa=fi.h2`
391
+ ${e=>T(e)} {
375
392
  font-style: normal;
376
393
  font-weight: 400;
377
394
  font-size: 14px;
@@ -379,42 +396,42 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
379
396
  letter-spacing: 0.28px;
380
397
  color: ${e=>e.appearance.theme.colorTextSecondary};
381
398
  }
382
- `;function ke({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return ko.createElement(ko.Fragment,null,ko.createElement(Ea,{appearance:e,className:l(`${r}${r?Jt(i):i}Title`,e),dangerouslySetInnerHTML:le(t),size:i}),o&&ko.createElement(Aa,{appearance:e,className:l(`${r}${r?Jt(i):i}Subtitle`,e),dangerouslySetInnerHTML:le(o),size:i}))}import*as nr from"react";var fi=e=>nr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},nr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var Oa=Po.div`
399
+ `;function ke({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return ko.createElement(ko.Fragment,null,ko.createElement(Ia,{appearance:e,className:l(`${r}${r?Jt(i):i}Title`,e),dangerouslySetInnerHTML:le(t),size:i}),o&&ko.createElement(Oa,{appearance:e,className:l(`${r}${r?Jt(i):i}Subtitle`,e),dangerouslySetInnerHTML:le(o),size:i}))}import*as nr from"react";var gi=e=>nr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},nr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var $a=Po.div`
383
400
  display: flex;
384
401
  flex-direction: column;
385
402
  justify-content: flex-end;
386
403
  overflow: visible;
387
404
  padding-top: 14px;
388
- `,La=Po.div`
405
+ `,Ma=Po.div`
389
406
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
390
407
  font-size: 12px;
391
408
  margin-bottom: 12px;
392
409
  display: flex;
393
410
  align-items: center;
394
- `,Da=Po.div`
411
+ `,Ua=Po.div`
395
412
  margin-right: 4px;
396
413
  display: inline-flex;
397
- `,$a=Po.div`
414
+ `,za=Po.div`
398
415
  padding-left: 1px;
399
416
  padding-right: 1px;
400
- `,Ma={text:or,multipleChoice:ai,multipleChoiceList:mi},lr="frigade-multiInputStepTypeData";function gi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var h;let c=t.props,[a,g]=sr([]),[d,x]=sr([]),{userId:S}=Yt(),[w,P]=sr(y()||(p?p[t.id]:null)||{}),{readonly:f}=Na(K),E={...Ma,...s};Ia(()=>{i(a.length===0)},[a,i]);function b(m,B){let T={...w,[m.id]:B};P(T),r(T),window&&window.localStorage&&!f&&window.localStorage.setItem(A(),JSON.stringify(T))}function y(){if(window&&window.localStorage){let m=window.localStorage.getItem(A());if(m)return JSON.parse(m)}return null}function A(){return`${lr}-${e}-${t.id}-${S}`}return ht.createElement($a,{className:l("multiInput",n)},ht.createElement(ke,{appearance:n,title:t.title,subtitle:t.subtitle}),ht.createElement(Oa,{className:l("multiInputContainer",n)},(h=c.data)==null?void 0:h.map(m=>{var T;let B=(T=a.reverse().find(F=>F.id===m.id))==null?void 0:T.message;return E[m.type]?ht.createElement("span",{key:m.id,"data-field-id":m.id,className:l("multiInputField",n)},E[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:F=>{!d.includes(m.id)&&F&&(F==null?void 0:F.text)!==""&&x(O=>[...O,m.id]),b(m,F)},inputData:w[m.id],setFormValidationErrors:F=>{g(O=>F.length===0?O.filter(N=>N.id!==m.id):[...O,...F])}}),B&&d.includes(m.id)&&ht.createElement(La,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:m.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:n,className:l("multiInputValidationError",n)},ht.createElement(Da,{appearance:n,className:l("multiInputValidationErrorIcon",n)},ht.createElement(fi,null)),B)):null})))}import Ct from"styled-components";var xi=Ct.div`
417
+ `,Wa={text:or,multipleChoice:pi,multipleChoiceList:ui},lr="frigade-multiInputStepTypeData";function xi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var h;let c=t.props,[a,g]=sr([]),[d,x]=sr([]),{userId:S}=Yt(),[w,P]=sr(y()||(p?p[t.id]:null)||{}),{readonly:f}=La(K),E={...Wa,...s};Da(()=>{i(a.length===0)},[a,i]);function b(m,B){let F={...w,[m.id]:B};P(F),r(F),window&&window.localStorage&&!f&&window.localStorage.setItem(A(),JSON.stringify(F))}function y(){if(window&&window.localStorage){let m=window.localStorage.getItem(A());if(m)return JSON.parse(m)}return null}function A(){return`${lr}-${e}-${t.id}-${S}`}return ht.createElement(za,{className:l("multiInput",n)},ht.createElement(ke,{appearance:n,title:t.title,subtitle:t.subtitle}),ht.createElement($a,{className:l("multiInputContainer",n)},(h=c.data)==null?void 0:h.map(m=>{var F;let B=(F=a.reverse().find(k=>k.id===m.id))==null?void 0:F.message;return E[m.type]?ht.createElement("span",{key:m.id,"data-field-id":m.id,className:l("multiInputField",n)},E[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:k=>{!d.includes(m.id)&&k&&(k==null?void 0:k.text)!==""&&x(O=>[...O,m.id]),b(m,k)},inputData:w[m.id],setFormValidationErrors:k=>{g(O=>k.length===0?O.filter(N=>N.id!==m.id):[...O,...k])}}),B&&d.includes(m.id)&&ht.createElement(Ma,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:m.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:n,className:l("multiInputValidationError",n)},ht.createElement(Ua,{appearance:n,className:l("multiInputValidationErrorIcon",n)},ht.createElement(gi,null)),B)):null})))}import Ct from"styled-components";var hi=Ct.div`
401
418
  align-items: center;
402
419
  display: flex;
403
420
  justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
404
421
  padding-top: 14px;
405
- `,hi=Ct.div`
422
+ `,Ci=Ct.div`
406
423
  color: ${e=>e.appearance.theme.colorTextError};
407
424
  font-size: 12px;
408
- `,Ci=Ct.div`
425
+ `,yi=Ct.div`
409
426
  display: flex;
410
427
  gap: 12px;
411
428
  width: 100%;
412
429
  justify-content: flex-end;
413
- `,yi=Ct.div`
430
+ `,Si=Ct.div`
414
431
  display: flex;
415
432
  flex-direction: row;
416
433
  flex: 1 1;
417
- `,Si=Ct.div`
434
+ `,bi=Ct.div`
418
435
  display: flex;
419
436
  // If type is set to large-modal, use padding 60px horizontal, 80px vertical
420
437
  // Otherwise, use 4px padding
@@ -422,11 +439,11 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
422
439
  flex-grow: 1;
423
440
  flex-basis: 0;
424
441
  position: relative;
425
- `,bi=Ct.div`
442
+ `,wi=Ct.div`
426
443
  padding: ${e=>e.type==="large-modal"?"50px":"0px"};
427
444
  position: relative;
428
445
  overflow-y: auto;
429
- `,wi=Ct.div`
446
+ `,Ti=Ct.div`
430
447
  display: flex;
431
448
  align-self: stretch;
432
449
  flex-grow: 1;
@@ -438,10 +455,10 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
438
455
  background-position: center;
439
456
  border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
440
457
  border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
441
- `;import at from"react";import Ua from"react";import Ti from"styled-components";var za=Ti.button`
458
+ `;import at from"react";import _a from"react";import Fi from"styled-components";var Ha=Fi.button`
442
459
  justify-content: center;
443
460
  align-content: center;
444
- ${e=>k(e)} {
461
+ ${e=>T(e)} {
445
462
  display: flex;
446
463
  // Anything inside this block will be ignored if the user provides a custom class
447
464
  width: ${e=>e.type==="full-width"?"100%":"auto"};
@@ -469,8 +486,8 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
469
486
  opacity: 0.3;
470
487
  cursor: not-allowed;
471
488
  }
472
- `,vo=Ti.div`
473
- ${e=>k(e)} {
489
+ `,vo=Fi.div`
490
+ ${e=>T(e)} {
474
491
  display: flex;
475
492
  flex-direction: row;
476
493
  justify-content: flex-start;
@@ -480,14 +497,14 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
480
497
  margin-right: 8px;
481
498
  }
482
499
  }
483
- `,Z=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:a=""})=>{function g(){let d=s?"buttonSecondary":"button";return a===""?d:`${a}${Jt(d)}`}return Ua.createElement(za,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:l(g(),p)},t??"Continue")};var Fi=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:a})=>{let g=s.length>1&&n!=0&&c,d=e.primaryButtonTitle&&e.secondaryButtonTitle||g?"inline":"full-width";return at.createElement(at.Fragment,null,a!==null&&a!=null&&at.createElement(hi,{appearance:o,className:l("formCTAError",o)},a),at.createElement(xi,{showBackButton:g,className:l("formCTAContainer",o)},g&&at.createElement(Z,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),at.createElement(Ci,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?at.createElement(Z,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?at.createElement(Z,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import ar from"react";import _a from"styled-components";var Wa=_a.div`
500
+ `,Z=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:a=""})=>{function g(){let d=s?"buttonSecondary":"button";return a===""?d:`${a}${Jt(d)}`}return _a.createElement(Ha,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:l(g(),p)},t??"Continue")};var ki=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:a})=>{let g=s.length>1&&n!=0&&c,d=e.primaryButtonTitle&&e.secondaryButtonTitle||g?"inline":"full-width";return at.createElement(at.Fragment,null,a!==null&&a!=null&&at.createElement(Ci,{appearance:o,className:l("formCTAError",o)},a),at.createElement(hi,{showBackButton:g,className:l("formCTAContainer",o)},g&&at.createElement(Z,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),at.createElement(yi,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?at.createElement(Z,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?at.createElement(Z,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import ar from"react";import ja from"styled-components";var Va=ja.div`
484
501
  text-align: center;
485
- `,ki=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Q().mergeAppearanceWithDefault(i);return ar.createElement(Wa,{className:o},ar.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>ar.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import yt from"react";import Lt from"styled-components";import{useContext as Ha}from"react";function ie(){let e=Ha(K);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var ja=Lt.div`
502
+ `,Pi=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Q().mergeAppearanceWithDefault(i);return ar.createElement(Va,{className:o},ar.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>ar.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import yt from"react";import Lt from"styled-components";import{useContext as Ga}from"react";function ie(){let e=Ga(K);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Ka=Lt.div`
486
503
  display: flex;
487
504
  flex-wrap: wrap;
488
505
  align-content: center;
489
506
  justify-content: center;
490
- `,Va=Lt.div`
507
+ `,qa=Lt.div`
491
508
  align-content: center;
492
509
  align-items: center;
493
510
  display: flex;
@@ -501,10 +518,10 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
501
518
  flex-basis: 255px;
502
519
  flex-grow: 0;
503
520
  flex-shrink: 0;
504
- `,Ga=Lt.img`
521
+ `,Ya=Lt.img`
505
522
  width: 78px;
506
523
  height: auto;
507
- `,Ka=Lt.button`
524
+ `,Xa=Lt.button`
508
525
  font-style: normal;
509
526
  font-weight: 600;
510
527
  font-size: 13px;
@@ -517,11 +534,11 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
517
534
  border-radius: 100px;
518
535
  padding: 8px 12px;
519
536
  margin-top: 16px;
520
- `,qa=Lt.h1`
537
+ `,Ja=Lt.h1`
521
538
  font-weight: 700;
522
539
  font-size: 28px;
523
540
  line-height: 34px;
524
- `,Ya=Lt.h2`
541
+ `,Qa=Lt.h2`
525
542
  font-style: normal;
526
543
  font-weight: 400;
527
544
  font-size: 16px;
@@ -530,7 +547,7 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
530
547
  margin-top: 12px;
531
548
  margin-bottom: 16px;
532
549
  max-width: 70%;
533
- `;function Pi({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return yt.createElement("div",null,yt.createElement(qa,null,e.title),yt.createElement(Ya,null,e.subtitle),yt.createElement(ja,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>yt.createElement(Va,{key:n.title},yt.createElement(Ga,{src:n.imageUri}),yt.createElement(Ka,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import Dt,{useEffect as tp}from"react";import Ao from"styled-components";import pr from"react";var Bo=({style:e,className:t})=>pr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,style:e},pr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),pr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import eo,{useRef as Xa,useState as Ja}from"react";import Eo from"styled-components";var Qa=Eo.div`
550
+ `;function vi({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return yt.createElement("div",null,yt.createElement(Ja,null,e.title),yt.createElement(Qa,null,e.subtitle),yt.createElement(Ka,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>yt.createElement(qa,{key:n.title},yt.createElement(Ya,{src:n.imageUri}),yt.createElement(Xa,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import Dt,{useEffect as ip}from"react";import Ao from"styled-components";import pr from"react";var Bo=({style:e,className:t})=>pr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,style:e},pr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),pr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import eo,{useRef as Za,useState as Ra}from"react";import Eo from"styled-components";var ep=Eo.div`
534
551
  display: flex;
535
552
  align-items: center;
536
553
  justify-content: flex-start;
@@ -538,7 +555,7 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
538
555
  width: 100%;
539
556
  height: 100%;
540
557
  position: relative;
541
- `,Za=Eo.div`
558
+ `,tp=Eo.div`
542
559
  position: absolute;
543
560
  display: flex;
544
561
  align-items: center;
@@ -557,56 +574,56 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
557
574
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
558
575
  border-radius: 50%;
559
576
  }
560
- `,Ra=Eo.video`
577
+ `,op=Eo.video`
561
578
  width: 100%;
562
579
  height: 100%;
563
580
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
564
- `,ep=Eo.iframe`
581
+ `,rp=Eo.iframe`
565
582
  width: 100%;
566
583
  height: 100%;
567
584
  min-height: 260px;
568
585
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
569
- `;function Ve({appearance:e,videoUri:t}){let o=Xa(),[i,r]=Ja(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),eo.createElement(ep,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return eo.createElement(Qa,{className:l("videoPlayerWrapper",e),appearance:e},!i&&eo.createElement(Za,{onClick:()=>{r(!0),o.current.play()},appearance:e},eo.createElement(Bo,null)),eo.createElement(Ra,{appearance:e,controls:i,ref:o,play:i,src:t}))}var op=Ao.div`
570
- ${e=>k(e)} {
586
+ `;function Ve({appearance:e,videoUri:t}){let o=Za(),[i,r]=Ra(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),eo.createElement(rp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return eo.createElement(ep,{className:l("videoPlayerWrapper",e),appearance:e},!i&&eo.createElement(tp,{onClick:()=>{r(!0),o.current.play()},appearance:e},eo.createElement(Bo,null)),eo.createElement(op,{appearance:e,controls:i,ref:o,play:i,src:t}))}var np=Ao.div`
587
+ ${e=>T(e)} {
571
588
  display: flex;
572
589
  flex-direction: column;
573
590
  justify-content: center;
574
591
  }
575
- `,rp=Ao.img`
576
- ${e=>k(e)} {
592
+ `,sp=Ao.img`
593
+ ${e=>T(e)} {
577
594
  width: 100%;
578
595
  height: auto;
579
596
  max-height: 250px;
580
597
  margin-bottom: 24px;
581
598
  }
582
- `,ip=Ao.div`
583
- ${e=>k(e)} {
599
+ `,lp=Ao.div`
600
+ ${e=>T(e)} {
584
601
  margin-bottom: 24px;
585
602
  }
586
- `,np=Ao.div`
587
- ${e=>k(e)} {
603
+ `,ap=Ao.div`
604
+ ${e=>T(e)} {
588
605
  width: 100%;
589
606
  height: auto;
590
607
  max-height: 250px;
591
608
  margin-bottom: 24px;
592
609
  }
593
- `;function vi({stepData:e,appearance:t,setCanContinue:o}){return tp(()=>{o(!0)},[]),Dt.createElement(op,{className:l("callToActionContainer",t)},Dt.createElement(ip,{className:l("callToActionTextContainer",t)},Dt.createElement(ke,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Dt.createElement(rp,{className:l("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Dt.createElement(np,{appearance:t,className:l("callToActionVideo",t)},Dt.createElement(Ve,{appearance:t,videoUri:e.videoUri})))}import Ze,{useEffect as dr,useState as cr}from"react";import pt from"styled-components";var Bi=pt.div`
610
+ `;function Bi({stepData:e,appearance:t,setCanContinue:o}){return ip(()=>{o(!0)},[]),Dt.createElement(np,{className:l("callToActionContainer",t)},Dt.createElement(lp,{className:l("callToActionTextContainer",t)},Dt.createElement(ke,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Dt.createElement(sp,{className:l("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Dt.createElement(ap,{appearance:t,className:l("callToActionVideo",t)},Dt.createElement(Ve,{appearance:t,videoUri:e.videoUri})))}import Re,{useEffect as dr,useState as cr}from"react";import pt from"styled-components";var Ei=pt.div`
594
611
  width: auto;
595
612
  display: flex;
596
613
  flex-direction: column;
597
614
  justify-content: center;
598
615
  align-items: center;
599
616
  padding: 4px;
600
- `,Ei=pt.div`
617
+ `,Ai=pt.div`
601
618
  width: 100%;
602
619
  text-align: left;
603
- `,Ai=pt.h1`
620
+ `,Ni=pt.h1`
604
621
  font-style: normal;
605
622
  font-weight: 700;
606
623
  font-size: 32px;
607
624
  line-height: 38px;
608
625
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
609
- `,Ni=pt.h1`
626
+ `,Ii=pt.h1`
610
627
  font-style: normal;
611
628
  font-weight: 400;
612
629
  font-size: 16px;
@@ -614,7 +631,7 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
614
631
  margin-top: 16px;
615
632
  margin-bottom: 16px;
616
633
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
617
- `,Ii=pt.div`
634
+ `,Oi=pt.div`
618
635
  padding-top: 12px;
619
636
  padding-bottom: 12px;
620
637
  flex-direction: row;
@@ -625,17 +642,17 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
625
642
  cursor: pointer;
626
643
  border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
627
644
  width: 100%;
628
- `,Oi=pt.div`
645
+ `,Li=pt.div`
629
646
  padding-top: 10px;
630
647
  padding-bottom: 10px;
631
648
  flex-direction: row;
632
649
  display: flex;
633
650
  justify-content: flex-start;
634
- `,Li=pt.img`
651
+ `,Di=pt.img`
635
652
  width: 42px;
636
653
  height: 42px;
637
654
  margin-right: 12px;
638
- `,Di=pt.p`
655
+ `,$i=pt.p`
639
656
  font-style: normal;
640
657
  font-weight: 500;
641
658
  font-size: 17px;
@@ -643,8 +660,8 @@ import bt,{createContext as Mp,useEffect as Do,useState as Le}from"react";import
643
660
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
644
661
  display: flex;
645
662
  align-self: center;
646
- `;var $i=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=cr([]),[p,c]=cr(!1),[a,g]=cr(e.id);return dr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),dr(()=>{a!==e.id&&(g(e.id),s([]))},[e]),dr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ze.createElement(Bi,{className:l("selectListContainer",i)},Ze.createElement(Ei,null,Ze.createElement(Ai,{className:l("selectListTitle",i)},e.title),Ze.createElement(Ni,{appearance:i,className:l("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let S=n.includes(d.id);return Ze.createElement(Ii,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(w=>w!==d.id));return}n.length<r.maxChoices?s([...n,d.id]):n.length==1&&r.maxChoices==1&&s([d.id])},hideBottomBorder:x===r.options.length-1,className:l("selectListSelectItem",i)},Ze.createElement(Oi,{className:l("selectListItemImage",i)},d.imageUri&&Ze.createElement(Li,{src:d.imageUri,alt:`select-icon-${x}`}),Ze.createElement(Di,{appearance:i,className:l("selectListSelectItemText",i)},d.title)),Ze.createElement(Qe,{appearance:i,value:S,primaryColor:i.theme.colorPrimary}))}))};import Pe,{useEffect as No,useState as to}from"react";var sp=({children:e,id:t,shouldWrap:o=!1})=>Pe.createElement(Pe.Fragment,null,o?Pe.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Io=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:a,onComplete:g,setVisible:d,setShowModal:x,onDismiss:S,showPagination:w=!1,customFormElements:P,allowBackNavigation:f,validationHandler:E,onFormDataChange:b,showFooter:y,prefillData:A})=>{var j;let m={...{linkCollection:Pi,multiInput:gi,callToAction:vi,selectList:$i},...i},{primaryCTAClickSideEffects:B,secondaryCTAClickSideEffects:T}=ie(),[F,O]=to(!1),[N,I]=to({}),[$,D]=to(!1),[ee,M]=to(!1),[te,fe]=to(null),X=t[o]??null,{markStepCompleted:W,markStepStarted:H,isLoading:Ce,updateCustomVariables:Ie,markFlowCompleted:we}=Y();No(()=>{Ie(r)},[r,Ce]),No(()=>{b&&b(N,me(),t[o],o)},[N]),No(()=>{window&&f&&!ee&&(window.location.hash=t[o].id,M(!0))},[f,ee,M]),No(()=>{var V;if(window&&((V=window==null?void 0:window.location)!=null&&V.hash)&&window.location.hash.replace("#","")!==t[o].id){let ne=window.location.hash.replace("#",""),se=t.findIndex(pe=>pe.id===ne);se!==-1&&H(p,t[se].id)}},[(j=window==null?void 0:window.location)==null?void 0:j.hash,H,o,t]);function me(){return{data:N[t[o].id]??{},stepId:t[o].id,customVariables:r}}function J(V,ne,se){let pe=o+1<t.length?t[o+1]:null;return s&&s(V,se,pe,N,me()),n?n(V,o,ne,pe):!0}function ge(V,ne){I(se=>{let pe={};return pe[V.id]=ne,{...se,...pe}})}function re(V){return V.selectedStep.imageUri?Pe.createElement(wi,{image:V.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let L=y&&Pe.createElement(Fi,{step:t[o],canContinue:F&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(D(!0),E){let se=await E(t[o],o,t[o+1],N,me());if(se||se===!1){fe(typeof se=="string"?se:null),D(!1);return}else fe(null)}let V={...me()};await W(p,t[o].id,V),o+1<t.length&&await H(p,t[o+1].id);let ne=J(t[o],"primary",o);o+1>=t.length&&(g&&g(),S&&S(),a&&ne&&(d&&d(!1),x(!1)),await we(p)),B(t[o]),D(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{J(t[o],"secondary",o),T(t[o])},onBack:async()=>{o-1>=0&&(D(!0),await H(p,t[o-1].id),D(!1))},steps:t,allowBackNavigation:f,errorMessage:te});return Pe.createElement(Pe.Fragment,null,Pe.createElement(yi,{className:l("formContainer",e)},Pe.createElement(Si,null,Pe.createElement(sp,{id:o,shouldWrap:c==="large-modal"},Pe.createElement(bi,{key:X.id,type:c,className:l("formContent",e)},t.map(V=>{let ne=m[V.type];return X.id!==V.id?null:Pe.createElement(ne,{key:V.id,stepData:V,canContinue:F,setCanContinue:O,onSaveData:se=>{ge(V,se)},appearance:e,customFormElements:P,flowId:p,prefillData:A})}),w&&Pe.createElement(ki,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),L))),c=="large-modal"&&Pe.createElement(re,{selectedStep:t[o]})))};import oo from"react";import{createGlobalStyle as lp}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return oo.createElement(oo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return oo.createElement(oo.Fragment,null);let o=lp`
647
- ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map(([s,p])=>`${Yo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return oo.createElement(o,{inlineStyles:t})}var Mi=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:a=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:S=!1,modalPosition:w="center",repeatable:P=!1,onDismiss:f,showPagination:E=!1,allowBackNavigation:b=!1,validationHandler:y,showFrigadeBranding:A=!1,onFormDataChange:h,showFooter:m=!0,prefillData:B={}})=>{let{getFlow:T,getFlowSteps:F,isLoading:O,targetingLogicShouldHideFlow:N,getFlowStatus:I,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:ee}=Y(),M=$(e),{mergeAppearanceWithDefault:te}=Q(),[fe,X]=pp(!1),{setOpenFlowState:W,getOpenFlowState:H,hasOpenModals:Ce}=Te();c=te(c);let[Ie,we]=i!==void 0&&r!==void 0?[i,r]:[H(e,!0),re=>W(e,re)];if(ap(()=>{!fe&&!O&&(X(!0),I(e)===q&&P&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(L=>{L.startsWith(lr)&&window.localStorage.removeItem(L)})),X(!0))},[fe,X,O]),O)return null;let me=T(e);if(!me||N(me))return null;let J=F(e);if(!J||i!==void 0&&i===!1||I(e)===q&&a||(o=="modal"||o=="corner-modal")&&Ce(e))return null;let ge=()=>{we(!1),f&&f(),S===!0&&D(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let re={padding:"24px"};return o==="large-modal"?(re.width="85%",re.height="90%",re.maxHeight="800px",re.minHeight="500px",re.padding="0"):re.width="400px",Ge.createElement(He,{appearance:c,onClose:ge,visible:Ie,style:re,dismissible:x,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Io,{appearance:c,steps:J,selectedStep:M,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:we,onDismiss:f,showPagination:E,customFormElements:s,allowBackNavigation:b,validationHandler:y,onFormDataChange:h,showFooter:m,prefillData:B}))}return o==="modal"&&w!=="center"?Ge.createElement(bo,{appearance:c,onClose:ge,visible:Ie,modalPosition:w},Ge.createElement(oe,{appearance:c}),Ge.createElement(Io,{appearance:c,steps:J,selectedStep:M,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:we,onDismiss:f,showPagination:E,customFormElements:s,allowBackNavigation:b,validationHandler:y,onFormDataChange:h,showFooter:m,prefillData:B})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Io,{appearance:c,steps:J,selectedStep:M,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:we,onDismiss:f,showPagination:E,customFormElements:s,allowBackNavigation:b,validationHandler:y,onFormDataChange:h,showFooter:m,prefillData:B}))},Ui=Mi;import{useCallback as zi,useContext as dp,useEffect as cp}from"react";function mr(){let{organizationId:e,userId:t,setOrganizationId:o}=dp(K),{mutateUserFlowState:i}=Ee(),{config:r,apiUrl:n}=We(),s=Et(),{verifySDKInitiated:p}=At();cp(()=>{if(t&&e){if(t.startsWith(Nt))return;let g=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(g)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(g,"true"))}},[t,e]);let c=zi(async g=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let d={foreignUserId:t,foreignUserGroupId:e,properties:g};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(d)}),i()},[e,t,r,i]),a=zi(async(g,d)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:d}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()},[e,t,r,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:c,trackEventForOrganization:a}}var _i="frigade-xFrigade_guestUserId",ro="frigade-xFrigade_userId",Wi=({})=>{let{setFlowResponses:e}=qt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ee(),{userId:r,setUserId:n}=Yt(),[s,p]=ur(null),{getFlowStatus:c}=Y(),{flows:a,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=mp(K),[S,w]=ur([]),[P,f]=ur([]),{organizationId:E}=mr();Oo(()=>{if(!o&&t)for(let h=0;h<t.length;h++){let m=t[h],B=a.find(T=>T.slug===(m==null?void 0:m.flowId));if(B&&m&&m.shouldTrigger===!0&&B.type=="FORM"&&B.triggerType==="AUTOMATIC"&&!P.includes(B.slug)){setTimeout(()=>{b(m.flowId)},500);break}}},[o,t]),Oo(()=>{x.length>0&&i()},[x]);function b(h){let m=a.find(B=>B.slug===h);m&&m.triggerType==="AUTOMATIC"&&!P.includes(m.slug)&&(f([...P,m.slug]),w([m]))}function y(){if(!r){let h=localStorage.getItem(ro);if(h){n(h);return}let m=localStorage.getItem(_i);if(m){n(m);return}d(!0);let B=Nt+up();try{localStorage.setItem(_i,B)}catch(T){console.log("Failed to save guest user id locally: Local storage unavailable",T)}n(T=>T||B)}}Oo(()=>{try{if(a){let h=[];a.forEach(m=>{if(m.data){let B=m.data.match(/"imageUri":"(.*?)"/g);B&&B.forEach(T=>{let F=T.replace('"imageUri":"',"").replace('"',"");if(h.includes(F))return;let O=new Image;O.src=F,h.push(F)})}})}}catch{}},[a]),Oo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Nt))try{localStorage.setItem(ro,r)}catch(h){console.log("Failed to save user id locally: Local storage available",h)}r===null&&setTimeout(()=>{r===null&&y()},50)},[r,a,g]);function A(){return St.createElement(St.Fragment,null,S.map(h=>c(h.slug)!==Me?null:St.createElement("span",{key:h.slug},St.createElement(Ui,{flowId:h.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return St.createElement(St.Fragment,null,St.createElement(A,null))};import{ErrorBoundary as zp}from"react-error-boundary";import io from"core-js-pure/actual/structured-clone";function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dt(...e){let t=e.shift(),o=e.length===1?e[0]:dt(...e);if(!fr(t)||!fr(o))throw new Error("deepmerge can only merge Objects");let i=io(t);return Object.entries(o).forEach(([r,n])=>{fr(n)?i[r]!==void 0?Object.assign(i,{[r]:dt(i[r],io(n))}):Object.assign(i,{[r]:io(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...io(n)]}):Object.assign(i,{[r]:io(n)}):Object.assign(i,{[r]:n})}),i}var Hi={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function fp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Hi[o]){let r=Hi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function gp(e){if(!e)return;let t=dt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function ji(e){let{theme:t,styleOverrides:o}=e,i=fp(t),r=gp(o);return{overrides:i,css:r}}import Ep from"styled-components";import{compose as Ap,variant as Gi}from"styled-system";import Vi from"react";import xp,{ThemeProvider as hp,useTheme as Cp}from"styled-components";import{border as yp,color as Sp,compose as bp,get as wp,shadow as Tp,space as Fp,system as kp,typography as Pp}from"styled-system";var vp={width:{property:"width",scale:"sizes",transform:(e,t)=>wp(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},Bp=xp("div")(({css:e})=>e,bp(yp,Sp,Tp,Fp,Pp,kp(vp))),no=({as:e,children:t,overrides:o,...i})=>{let r=Cp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Vi.createElement(Bp,{as:e,...n,...i},t);if(o!==void 0){let p=dt(r,o);return Vi.createElement(hp,{theme:p},s())}return s()};var so={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Np={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Ki=Ep(no)(()=>({whiteSpace:"nowrap"}),Ap(Gi({scale:"components.Button",variants:"components.Button"}),Gi({prop:"size",variants:Np})));import Ip from"styled-components";import{variant as Op,system as Lp}from"styled-system";var Lo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var qi=Ip(no)(Op({scale:"components.Text",variants:"components.Text"}),Lp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Yi=4,Xi="px",Dp=20,$p=Object.fromEntries(Array.from(Array(Dp+1),(e,t)=>t===0?[.5,`${.5*Yi}${Xi}`]:[t,`${t*Yi}${Xi}`])),$t={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},gr={colors:{...$t,neutral:{foreground:$t.gray300},primary:{background:$t.blue500,foreground:$t.white,inverted:$t.blue500},negative:{foreground:$t.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:$p,components:{Button:so,Text:Lo}};var Ji="https://api.frigade.com",K=Mp({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:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Ji,readonly:!1});function _p(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Wp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,X;let[n,s]=Le(t||null),[p,c]=Le(o||null),[a,g]=Le([]),[d,x]=Le([]),[S,w]=Le([]),[P,f]=Le({}),[E,b]=Le({}),[y,A]=Le([]),[h,m]=Le({}),[B,T]=Le(!1),[F,O]=Le(!1),[N,I]=Le(!ee(e)),$=(W,H)=>{if(H==="_blank"){window.open(W,"_blank");return}setTimeout(()=>{window.location.href=W},50)},D={theme:{...Je.theme,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...Je.styleOverrides,...((X=i==null?void 0:i.defaultAppearance)==null?void 0:X.styleOverrides)??{}}};function ee(W){return!!(W&&W.length>10&&W.substring(0,10)==="api_public")}Do(()=>{t&&s(t)},[t]),Do(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(ro)&&window.localStorage.getItem(ro)!==n&&_p()},[n]),Do(()=>{o&&c(o)},[o]),Do(()=>{if(ee(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let M={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:a,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:S,setFlowResponses:w,userProperties:P,setUserProperties:f,openFlowStates:E,setOpenFlowStates:b,completedFlowsToKeepOpenDuringSession:y,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:h,setCustomVariables:m,isNewGuestUser:B,setIsNewGuestUser:T,hasActiveFullPageFlow:F,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:I,apiUrl:i&&i.apiUrl?i.apiUrl:Ji,readonly:i&&i.readonly?i.readonly:!1};if(N)return bt.createElement(K.Provider,{value:M},r);let{overrides:te}=ji(D);return bt.createElement(zp,{fallback:bt.createElement(bt.Fragment,null,r)},bt.createElement(K.Provider,{value:M},bt.createElement(Up,{theme:dt(D.theme,gr,te??{},(i==null?void 0:i.theme)??{})},r,bt.createElement(Wi,null))))};import Ad from"react";import ce,{useEffect as Ps,useState as vs}from"react";import _e,{useState as nd}from"react";import Ft from"styled-components";import Uo from"react";import wt from"react";import Zi from"styled-components";var Qi=Zi.span`
663
+ `;var Mi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=cr([]),[p,c]=cr(!1),[a,g]=cr(e.id);return dr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),dr(()=>{a!==e.id&&(g(e.id),s([]))},[e]),dr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Re.createElement(Ei,{className:l("selectListContainer",i)},Re.createElement(Ai,null,Re.createElement(Ni,{className:l("selectListTitle",i)},e.title),Re.createElement(Ii,{appearance:i,className:l("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let S=n.includes(d.id);return Re.createElement(Oi,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(w=>w!==d.id));return}n.length<r.maxChoices?s([...n,d.id]):n.length==1&&r.maxChoices==1&&s([d.id])},hideBottomBorder:x===r.options.length-1,className:l("selectListSelectItem",i)},Re.createElement(Li,{className:l("selectListItemImage",i)},d.imageUri&&Re.createElement(Di,{src:d.imageUri,alt:`select-icon-${x}`}),Re.createElement($i,{appearance:i,className:l("selectListSelectItemText",i)},d.title)),Re.createElement(Ze,{appearance:i,value:S,primaryColor:i.theme.colorPrimary}))}))};import Pe,{useEffect as No,useState as to}from"react";var pp=({children:e,id:t,shouldWrap:o=!1})=>Pe.createElement(Pe.Fragment,null,o?Pe.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Io=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:a,onComplete:g,setVisible:d,setShowModal:x,onDismiss:S,showPagination:w=!1,customFormElements:P,allowBackNavigation:f,validationHandler:E,onFormDataChange:b,showFooter:y,prefillData:A})=>{var j;let m={...{linkCollection:vi,multiInput:xi,callToAction:Bi,selectList:Mi},...i},{primaryCTAClickSideEffects:B,secondaryCTAClickSideEffects:F}=ie(),[k,O]=to(!1),[N,I]=to({}),[$,D]=to(!1),[ee,M]=to(!1),[te,fe]=to(null),X=t[o]??null,{markStepCompleted:_,markStepStarted:H,isLoading:Ce,updateCustomVariables:Ie,markFlowCompleted:we}=Y();No(()=>{Ie(r)},[r,Ce]),No(()=>{b&&b(N,me(),t[o],o)},[N]),No(()=>{window&&f&&!ee&&(window.location.hash=t[o].id,M(!0))},[f,ee,M]),No(()=>{var V;if(window&&((V=window==null?void 0:window.location)!=null&&V.hash)&&window.location.hash.replace("#","")!==t[o].id){let ne=window.location.hash.replace("#",""),se=t.findIndex(pe=>pe.id===ne);se!==-1&&H(p,t[se].id)}},[(j=window==null?void 0:window.location)==null?void 0:j.hash,H,o,t]);function me(){return{data:N[t[o].id]??{},stepId:t[o].id,customVariables:r}}function J(V,ne,se){let pe=o+1<t.length?t[o+1]:null;return s&&s(V,se,pe,N,me()),n?n(V,o,ne,pe):!0}function ge(V,ne){I(se=>{let pe={};return pe[V.id]=ne,{...se,...pe}})}function re(V){return V.selectedStep.imageUri?Pe.createElement(Ti,{image:V.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let L=y&&Pe.createElement(ki,{step:t[o],canContinue:k&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(D(!0),E){let se=await E(t[o],o,t[o+1],N,me());if(se||se===!1){fe(typeof se=="string"?se:null),D(!1);return}else fe(null)}let V={...me()};await _(p,t[o].id,V),o+1<t.length&&await H(p,t[o+1].id);let ne=J(t[o],"primary",o);o+1>=t.length&&(g&&g(),S&&S(),a&&ne&&(d&&d(!1),x(!1)),await we(p)),B(t[o]),D(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{J(t[o],"secondary",o),F(t[o])},onBack:async()=>{o-1>=0&&(D(!0),await H(p,t[o-1].id),D(!1))},steps:t,allowBackNavigation:f,errorMessage:te});return Pe.createElement(Pe.Fragment,null,Pe.createElement(Si,{className:l("formContainer",e)},Pe.createElement(bi,null,Pe.createElement(pp,{id:o,shouldWrap:c==="large-modal"},Pe.createElement(wi,{key:X.id,type:c,className:l("formContent",e)},t.map(V=>{let ne=m[V.type];return X.id!==V.id?null:Pe.createElement(ne,{key:V.id,stepData:V,canContinue:k,setCanContinue:O,onSaveData:se=>{ge(V,se)},appearance:e,customFormElements:P,flowId:p,prefillData:A})}),w&&Pe.createElement(Pi,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),L))),c=="large-modal"&&Pe.createElement(re,{selectedStep:t[o]})))};import oo from"react";import{createGlobalStyle as dp}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return oo.createElement(oo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return oo.createElement(oo.Fragment,null);let o=dp`
664
+ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map(([s,p])=>`${Yo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return oo.createElement(o,{inlineStyles:t})}var Ui=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:a=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:S=!1,modalPosition:w="center",repeatable:P=!1,onDismiss:f,showPagination:E=!1,allowBackNavigation:b=!1,validationHandler:y,showFrigadeBranding:A=!1,onFormDataChange:h,showFooter:m=!0,prefillData:B={}})=>{let{getFlow:F,getFlowSteps:k,isLoading:O,targetingLogicShouldHideFlow:N,getFlowStatus:I,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:ee}=Y(),M=$(e),{mergeAppearanceWithDefault:te}=Q(),[fe,X]=mp(!1),{setOpenFlowState:_,getOpenFlowState:H,hasOpenModals:Ce}=Te();c=te(c);let[Ie,we]=i!==void 0&&r!==void 0?[i,r]:[H(e,!0),re=>_(e,re)];if(cp(()=>{!fe&&!O&&(X(!0),I(e)===q&&P&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(L=>{L.startsWith(lr)&&window.localStorage.removeItem(L)})),X(!0))},[fe,X,O]),O)return null;let me=F(e);if(!me||N(me))return null;let J=k(e);if(!J||i!==void 0&&i===!1||I(e)===q&&a||(o=="modal"||o=="corner-modal")&&Ce(e))return null;let ge=()=>{we(!1),f&&f(),S===!0&&D(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let re={padding:"24px"};return o==="large-modal"?(re.width="85%",re.height="90%",re.maxHeight="800px",re.minHeight="500px",re.padding="0"):re.width="400px",Ge.createElement(He,{appearance:c,onClose:ge,visible:Ie,style:re,dismissible:x,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Io,{appearance:c,steps:J,selectedStep:M,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:we,onDismiss:f,showPagination:E,customFormElements:s,allowBackNavigation:b,validationHandler:y,onFormDataChange:h,showFooter:m,prefillData:B}))}return o==="modal"&&w!=="center"?Ge.createElement(bo,{appearance:c,onClose:ge,visible:Ie,modalPosition:w},Ge.createElement(oe,{appearance:c}),Ge.createElement(Io,{appearance:c,steps:J,selectedStep:M,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:we,onDismiss:f,showPagination:E,customFormElements:s,allowBackNavigation:b,validationHandler:y,onFormDataChange:h,showFooter:m,prefillData:B})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Io,{appearance:c,steps:J,selectedStep:M,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:we,onDismiss:f,showPagination:E,customFormElements:s,allowBackNavigation:b,validationHandler:y,onFormDataChange:h,showFooter:m,prefillData:B}))},zi=Ui;import{useCallback as Wi,useContext as up,useEffect as fp}from"react";function mr(){let{organizationId:e,userId:t,setOrganizationId:o}=up(K),{mutateUserFlowState:i}=Ee(),{config:r,apiUrl:n}=_e(),s=Et(),{verifySDKInitiated:p}=At();fp(()=>{if(t&&e){if(t.startsWith(Nt))return;let g=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(g)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(g,"true"))}},[t,e]);let c=Wi(async g=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let d={foreignUserId:t,foreignUserGroupId:e,properties:g};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(d)}),i()},[e,t,r,i]),a=Wi(async(g,d)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:d}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()},[e,t,r,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:c,trackEventForOrganization:a}}var _i="frigade-xFrigade_guestUserId",ro="frigade-xFrigade_userId",Hi=({})=>{let{setFlowResponses:e}=qt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ee(),{userId:r,setUserId:n}=Yt(),[s,p]=ur(null),{getFlowStatus:c}=Y(),{flows:a,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=gp(K),[S,w]=ur([]),[P,f]=ur([]),{organizationId:E}=mr();Oo(()=>{if(!o&&t)for(let h=0;h<t.length;h++){let m=t[h],B=a.find(F=>F.slug===(m==null?void 0:m.flowId));if(B&&m&&m.shouldTrigger===!0&&B.type=="FORM"&&B.triggerType==="AUTOMATIC"&&!P.includes(B.slug)){setTimeout(()=>{b(m.flowId)},500);break}}},[o,t]),Oo(()=>{x.length>0&&i()},[x]);function b(h){let m=a.find(B=>B.slug===h);m&&m.triggerType==="AUTOMATIC"&&!P.includes(m.slug)&&(f([...P,m.slug]),w([m]))}function y(){if(!r){let h=localStorage.getItem(ro);if(h){n(h);return}let m=localStorage.getItem(_i);if(m){n(m);return}d(!0);let B=Nt+xp();try{localStorage.setItem(_i,B)}catch(F){console.log("Failed to save guest user id locally: Local storage unavailable",F)}n(F=>F||B)}}Oo(()=>{try{if(a){let h=[];a.forEach(m=>{if(m.data){let B=m.data.match(/"imageUri":"(.*?)"/g);B&&B.forEach(F=>{let k=F.replace('"imageUri":"',"").replace('"',"");if(h.includes(k))return;let O=new Image;O.src=k,h.push(k)})}})}}catch{}},[a]),Oo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Nt))try{localStorage.setItem(ro,r)}catch(h){console.log("Failed to save user id locally: Local storage available",h)}r===null&&setTimeout(()=>{r===null&&y()},50)},[r,a,g]);function A(){return St.createElement(St.Fragment,null,S.map(h=>c(h.slug)!==Me?null:St.createElement("span",{key:h.slug},St.createElement(zi,{flowId:h.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return St.createElement(St.Fragment,null,St.createElement(A,null))};import{ErrorBoundary as Hp}from"react-error-boundary";import io from"core-js-pure/actual/structured-clone";function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dt(...e){let t=e.shift(),o=e.length===1?e[0]:dt(...e);if(!fr(t)||!fr(o))throw new Error("deepmerge can only merge Objects");let i=io(t);return Object.entries(o).forEach(([r,n])=>{fr(n)?i[r]!==void 0?Object.assign(i,{[r]:dt(i[r],io(n))}):Object.assign(i,{[r]:io(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...io(n)]}):Object.assign(i,{[r]:io(n)}):Object.assign(i,{[r]:n})}),i}var ji={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function hp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(ji[o]){let r=ji[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function Cp(e){if(!e)return;let t=dt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Vi(e){let{theme:t,styleOverrides:o}=e,i=hp(t),r=Cp(o);return{overrides:i,css:r}}import Ip from"styled-components";import{compose as Op,variant as Ki}from"styled-system";import Gi from"react";import yp,{ThemeProvider as Sp,useTheme as bp}from"styled-components";import{border as wp,color as Tp,compose as Fp,get as kp,shadow as Pp,space as vp,system as Bp,typography as Ep}from"styled-system";var Ap={width:{property:"width",scale:"sizes",transform:(e,t)=>kp(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},Np=yp("div")(({css:e})=>e,Fp(wp,Tp,Pp,vp,Ep,Bp(Ap))),no=({as:e,children:t,overrides:o,...i})=>{let r=bp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Gi.createElement(Np,{as:e,...n,...i},t);if(o!==void 0){let p=dt(r,o);return Gi.createElement(Sp,{theme:p},s())}return s()};var so={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Lp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},qi=Ip(no)(()=>({whiteSpace:"nowrap"}),Op(Ki({scale:"components.Button",variants:"components.Button"}),Ki({prop:"size",variants:Lp})));import Dp from"styled-components";import{variant as $p,system as Mp}from"styled-system";var Lo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Yi=Dp(no)($p({scale:"components.Text",variants:"components.Text"}),Mp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Xi=4,Ji="px",Up=20,zp=Object.fromEntries(Array.from(Array(Up+1),(e,t)=>t===0?[.5,`${.5*Xi}${Ji}`]:[t,`${t*Xi}${Ji}`])),$t={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},gr={colors:{...$t,neutral:{foreground:$t.gray300},primary:{background:$t.blue500,foreground:$t.white,inverted:$t.blue500},negative:{foreground:$t.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:zp,components:{Button:so,Text:Lo}};var Qi="https://api.frigade.com",K=Wp({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:()=>{},apiUrl:Qi,readonly:!1});function jp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Vp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,X;let[n,s]=Le(t||null),[p,c]=Le(o||null),[a,g]=Le([]),[d,x]=Le([]),[S,w]=Le([]),[P,f]=Le({}),[E,b]=Le({}),[y,A]=Le([]),[h,m]=Le({}),[B,F]=Le(!1),[k,O]=Le(!1),[N,I]=Le(!ee(e)),$=(_,H)=>{if(H==="_blank"){window.open(_,"_blank");return}setTimeout(()=>{window.location.href=_},50)},D={theme:{...Qe.theme,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...Qe.styleOverrides,...((X=i==null?void 0:i.defaultAppearance)==null?void 0:X.styleOverrides)??{}}};function ee(_){return!!(_&&_.length>10&&_.substring(0,10)==="api_public")}Do(()=>{t&&s(t)},[t]),Do(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(ro)&&window.localStorage.getItem(ro)!==n&&jp()},[n]),Do(()=>{o&&c(o)},[o]),Do(()=>{if(ee(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let M={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:a,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:S,setFlowResponses:w,userProperties:P,setUserProperties:f,openFlowStates:E,setOpenFlowStates:b,completedFlowsToKeepOpenDuringSession:y,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:h,setCustomVariables:m,isNewGuestUser:B,setIsNewGuestUser:F,hasActiveFullPageFlow:k,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:I,apiUrl:i&&i.apiUrl?i.apiUrl:Qi,readonly:i&&i.readonly?i.readonly:!1};if(N)return bt.createElement(K.Provider,{value:M},r);let{overrides:te}=Vi(D);return bt.createElement(Hp,{fallback:bt.createElement(bt.Fragment,null,r)},bt.createElement(K.Provider,{value:M},bt.createElement(_p,{theme:dt(D.theme,gr,te??{},(i==null?void 0:i.theme)??{})},r,bt.createElement(Hi,null))))};import Od from"react";import ce,{useEffect as vs,useState as Bs}from"react";import We,{useState as ad}from"react";import Ft from"styled-components";import Uo from"react";import wt from"react";import Ri from"styled-components";var Zi=Ri.span`
648
665
  font-weight: 600;
649
666
  font-size: 14px;
650
667
  font-style: normal;
@@ -655,7 +672,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
655
672
  vertical-align: middle;
656
673
  margin-left: 32px;
657
674
  padding-right: 12px;
658
- `,Hp=Zi.div`
675
+ `,Gp=Ri.div`
659
676
  flex-direction: row;
660
677
  justify-content: space-between;
661
678
  display: flex;
@@ -663,11 +680,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
663
680
  padding-bottom: 20px;
664
681
  padding-right: 8px;
665
682
  width: 100%;
666
- `,$o=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>wt.createElement(wt.Fragment,null,wt.createElement(Hp,{className:l("checklistStepsContainer",p),appearance:p,style:{...r}},i==="left"&&e&&wt.createElement(Qi,{className:l("checklistStepLabel",p),style:o},e),wt.createElement(Qe,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&wt.createElement(Qi,{className:l("checklistStepLabel",p),style:o},e)),wt.createElement(oe,{appearance:p}));import lo from"styled-components";var Ri=lo.div`
683
+ `,$o=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>wt.createElement(wt.Fragment,null,wt.createElement(Gp,{className:l("checklistStepsContainer",p),appearance:p,style:{...r}},i==="left"&&e&&wt.createElement(Zi,{className:l("checklistStepLabel",p),style:o},e),wt.createElement(Ze,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&wt.createElement(Zi,{className:l("checklistStepLabel",p),style:o},e)),wt.createElement(oe,{appearance:p}));import lo from"styled-components";var en=lo.div`
667
684
  font-weight: 700;
668
685
  font-size: 18px;
669
686
  line-height: 22px;
670
- `,en=lo.p`
687
+ `,tn=lo.p`
671
688
  font-weight: 600;
672
689
  font-size: 16px;
673
690
  line-height: 24px;
@@ -675,7 +692,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
675
692
  letter-spacing: 0.32px;
676
693
  font-style: normal;
677
694
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
678
- `,tn=lo.p`
695
+ `,on=lo.p`
679
696
  font-weight: 400;
680
697
  font-size: 14px;
681
698
  font-style: normal;
@@ -691,38 +708,38 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
691
708
  height: 100%;
692
709
  border-top-right-radius: 4px;
693
710
  border-bottom-right-radius: 4px;
694
- `,on=lo.div`
711
+ `,rn=lo.div`
695
712
  flex-direction: row;
696
713
  justify-content: flex-start;
697
714
  border-bottom: 1px solid ${e=>e.theme.colorBorder};
698
715
  padding-right: 16px;
699
- `;var rn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return Uo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&Uo.createElement(Mo,{className:l("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),Uo.createElement(on,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Uo.createElement($o,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:r,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import Tt from"react";import xr from"styled-components";import Re from"styled-components";var eh=Re.div`
716
+ `;var nn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return Uo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&Uo.createElement(Mo,{className:l("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),Uo.createElement(rn,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Uo.createElement($o,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:r,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import Tt from"react";import xr from"styled-components";import et from"styled-components";var rh=et.div`
700
717
  background: #ffffff;
701
718
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
702
719
  border-radius: 20px;
703
720
  width: 385px;
704
721
  padding: 24px 16px 16px 16px;
705
- `,th=Re.div`
722
+ `,ih=et.div`
706
723
  /* Border bottom only on collapsable */
707
- `,oh=Re.div`
724
+ `,nh=et.div`
708
725
  display: flex;
709
726
  flex-direction: row;
710
727
  justify-content: space-between;
711
728
  align-content: flex-start;
712
- `,rh=Re.h1`
729
+ `,sh=et.h1`
713
730
  display: flex;
714
731
  margin: 0;
715
732
  font-size: 18px;
716
- `,ih=Re.h2`
733
+ `,lh=et.h2`
717
734
  font-size: 15px;
718
735
  color: #4d4d4d;
719
- `,nh=Re.ul`
736
+ `,ah=et.ul`
720
737
  list-style: none;
721
- `,sh=Re.li`
738
+ `,ph=et.li`
722
739
  display: flex;
723
740
  justify-content: flex-start;
724
741
  flex-direction: row;
725
- `,nn=Re.div`
742
+ `,sn=et.div`
726
743
  position: absolute;
727
744
  left: 0;
728
745
  top: 0;
@@ -730,7 +747,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
730
747
  width: ${e=>e.fgWidth};
731
748
  border-radius: 20px;
732
749
  background-color: ${e=>e.theme.colorPrimary};
733
- `,sn=Re.div`
750
+ `,ln=et.div`
734
751
  position: relative;
735
752
  left: 0;
736
753
  top: 0;
@@ -740,7 +757,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
740
757
  border-radius: 20px;
741
758
  background-color: ${e=>e.theme.colorPrimary};
742
759
  opacity: 0.12;
743
- `;var jp=xr.div`
760
+ `;var Kp=xr.div`
744
761
  display: flex;
745
762
  flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
746
763
  justify-content: flex-start;
@@ -748,11 +765,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
748
765
  width: 100%;
749
766
 
750
767
  ${e=>Xe(e)}
751
- `,Vp=xr.div`
768
+ `,qp=xr.div`
752
769
  flex-grow: 1;
753
770
  position: relative;
754
771
  ${e=>e.textLocation=="top"?"width: 100%;":""}
755
- `,Gp=xr.span`
772
+ `,Yp=xr.span`
756
773
  font-weight: 600;
757
774
  font-size: 14px;
758
775
  line-height: 18px;
@@ -760,13 +777,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
760
777
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
761
778
  margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
762
779
  ${e=>Xe(e)}
763
- `;var De=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Tt.createElement(Tt.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",a=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${a}%`:o==="percent"&&(d=`${a}% complete`),i==="top"&&(g="0px"),Tt.createElement(jp,{className:l("progressBarContainer",s),textLocation:i,styleOverrides:r},Tt.createElement(Gp,{className:l("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Tt.createElement(Vp,{textLocation:i,className:l("progressBar",s)},Tt.createElement(nn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:l("progressBarFill",s)}),Tt.createElement(sn,{className:l("progressBarBackground",s),barHeight:c,appearance:s})))};import ao from"react";import qp from"styled-components";import _o from"react";import zo from"react";var Mt=({stepData:e,appearance:t})=>zo.createElement(zo.Fragment,null,zo.createElement(en,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:le(e.title)}),zo.createElement(tn,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:le(e.subtitle)}));import hr from"react";var Ut=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return hr.createElement(vo,{className:l("ctaContainer",t)},hr.createElement(Z,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&hr.createElement(Z,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var zt=({stepData:e,appearance:t})=>_o.createElement(_o.Fragment,null,_o.createElement(Mt,{stepData:e,appearance:t}),_o.createElement(Ut,{stepData:e,appearance:t}));import Kp from"react";function ln(e){return Kp.createElement(Ve,{appearance:e.appearance,videoUri:e.videoUri})}var Cr="default",Yp=qp.img`
780
+ `;var De=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Tt.createElement(Tt.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",a=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${a}%`:o==="percent"&&(d=`${a}% complete`),i==="top"&&(g="0px"),Tt.createElement(Kp,{className:l("progressBarContainer",s),textLocation:i,styleOverrides:r},Tt.createElement(Yp,{className:l("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Tt.createElement(qp,{textLocation:i,className:l("progressBar",s)},Tt.createElement(sn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:l("progressBarFill",s)}),Tt.createElement(ln,{className:l("progressBarBackground",s),barHeight:c,appearance:s})))};import ao from"react";import Jp from"styled-components";import Wo from"react";import zo from"react";var Mt=({stepData:e,appearance:t})=>zo.createElement(zo.Fragment,null,zo.createElement(tn,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:le(e.title)}),zo.createElement(on,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:le(e.subtitle)}));import hr from"react";var Ut=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return hr.createElement(vo,{className:l("ctaContainer",t)},hr.createElement(Z,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&hr.createElement(Z,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var zt=({stepData:e,appearance:t})=>Wo.createElement(Wo.Fragment,null,Wo.createElement(Mt,{stepData:e,appearance:t}),Wo.createElement(Ut,{stepData:e,appearance:t}));import Xp from"react";function an(e){return Xp.createElement(Ve,{appearance:e.appearance,videoUri:e.videoUri})}var Cr="default",Qp=Jp.img`
764
781
  border-radius: 4px;
765
782
  max-height: 260px;
766
783
  min-height: 200px;
767
- `,an=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return ao.createElement("div",null,o)}return ao.createElement(Ri,{className:l("checklistStepContent",t)},e.imageUri?ao.createElement(Yp,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ao.createElement(ln,{videoUri:e.videoUri,appearance:t}):null,ao.createElement(zt,{stepData:e,appearance:t}))};import Ae,{useRef as Xp,useState as Jp}from"react";import _t from"styled-components";var pn=_t.div`
784
+ `,pn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return ao.createElement("div",null,o)}return ao.createElement(en,{className:l("checklistStepContent",t)},e.imageUri?ao.createElement(Qp,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ao.createElement(an,{videoUri:e.videoUri,appearance:t}):null,ao.createElement(zt,{stepData:e,appearance:t}))};import Ae,{useRef as Zp,useState as Rp}from"react";import Wt from"styled-components";var dn=Wt.div`
768
785
  display: block;
769
- `,Qp=_t.div`
786
+ `,ed=Wt.div`
770
787
  display: flex;
771
788
  flex-direction: row;
772
789
  flex-wrap: wrap;
@@ -776,20 +793,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
776
793
  align-content: center;
777
794
  margin-top: 24px;
778
795
  margin-bottom: 24px;
779
- `,Zp=_t.div`
796
+ `,td=Wt.div`
780
797
  display: flex;
781
798
  align-items: center;
782
799
  justify-content: flex-start;
783
800
  flex-direction: column;
784
801
  margin-right: 16px;
785
- `,Rp=_t.video`
802
+ `,od=Wt.video`
786
803
  width: 200px;
787
804
  height: 120px;
788
- `,ed=_t.div`
805
+ `,rd=Wt.div`
789
806
  font-size: 14px;
790
807
  line-height: 20px;
791
808
  text-align: center;
792
- `,td=_t.div`
809
+ `,id=Wt.div`
793
810
  position: absolute;
794
811
  width: 200px;
795
812
  height: 120px;
@@ -809,9 +826,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
809
826
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
810
827
  border-radius: 50%;
811
828
  }
812
- `,dn="videoCarousel",cn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ae.createElement(pn,null,Ae.createElement(zt,{stepData:e,appearance:t}));function o({video:n}){let s=Xp(),[p,c]=Jp(!1);return Ae.createElement(Zp,null,!p&&Ae.createElement(td,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ae.createElement(Bo,null)),Ae.createElement(Rp,{controls:p,ref:s,play:p,src:n.uri}),Ae.createElement(ed,null,n.title))}let i=e.props;return i.videos?Ae.createElement(pn,null,Ae.createElement(Mt,{stepData:e,appearance:t}),Ae.createElement(Qp,null,i.videos.map((n,s)=>Ae.createElement("span",{key:`${n.uri}-${s}`},Ae.createElement(o,{video:n})))),Ae.createElement(Ut,{stepData:e,appearance:t})):null};import et from"react";import Wo from"styled-components";var mn=Wo.div`
829
+ `,cn="videoCarousel",mn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ae.createElement(dn,null,Ae.createElement(zt,{stepData:e,appearance:t}));function o({video:n}){let s=Zp(),[p,c]=Rp(!1);return Ae.createElement(td,null,!p&&Ae.createElement(id,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ae.createElement(Bo,null)),Ae.createElement(od,{controls:p,ref:s,play:p,src:n.uri}),Ae.createElement(rd,null,n.title))}let i=e.props;return i.videos?Ae.createElement(dn,null,Ae.createElement(Mt,{stepData:e,appearance:t}),Ae.createElement(ed,null,i.videos.map((n,s)=>Ae.createElement("span",{key:`${n.uri}-${s}`},Ae.createElement(o,{video:n})))),Ae.createElement(Ut,{stepData:e,appearance:t})):null};import tt from"react";import _o from"styled-components";var un=_o.div`
813
830
  display: block;
814
- `,od=Wo.pre`
831
+ `,nd=_o.pre`
815
832
  display: block;
816
833
  background-color: #2a2a2a;
817
834
  color: #f8f8f8;
@@ -827,27 +844,28 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
827
844
  white-space: -o-pre-wrap; /* Opera 7 */
828
845
  word-wrap: break-word; /* Internet Explorer 5.5+ */
829
846
  margin-bottom: 24px;
830
- `,rd=Wo.div`
847
+ `,sd=_o.div`
831
848
  font-size: 15px;
832
849
  line-height: 20px;
833
850
  margin-bottom: 12px;
834
851
  margin-top: 12px;
835
- `,id=Wo.div`
852
+ `,ld=_o.div`
836
853
  margin-top: 24px;
837
- `,un="codeSnippet",fn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return et.createElement(mn,null,et.createElement(zt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?et.createElement(mn,null,et.createElement(Mt,{stepData:e,appearance:t}),et.createElement(id,null,o.codeSnippets.map((r,n)=>et.createElement("div",{key:n},r.title?et.createElement(rd,null,r.title):null,r.code?et.createElement(od,null,r.code):null))),et.createElement(Ut,{stepData:e,appearance:t})):null};var sd=Ft.div`
854
+ `,fn="codeSnippet",gn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return tt.createElement(un,null,tt.createElement(zt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?tt.createElement(un,null,tt.createElement(Mt,{stepData:e,appearance:t}),tt.createElement(ld,null,o.codeSnippets.map((r,n)=>tt.createElement("div",{key:n},r.title?tt.createElement(sd,null,r.title):null,r.code?tt.createElement(nd,null,r.code):null))),tt.createElement(Ut,{stepData:e,appearance:t})):null};var pd=Ft.div`
838
855
  display: flex;
839
856
  flex-direction: row;
857
+ overflow: hidden;
840
858
  min-width: ${e=>e.type!="modal"?"600px":"100%"};
841
859
  background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
842
860
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
843
- `,ld=Ft.h1`
861
+ `,dd=Ft.h1`
844
862
  font-size: 18px;
845
863
  font-style: normal;
846
864
  font-weight: 700;
847
865
  line-height: 24px;
848
866
  letter-spacing: 0.36px;
849
867
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
850
- `,ad=Ft.h2`
868
+ `,cd=Ft.h2`
851
869
  font-size: 14px;
852
870
  font-style: normal;
853
871
  font-weight: 400;
@@ -855,44 +873,44 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
855
873
  letter-spacing: 0.28px;
856
874
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
857
875
  margin: 10px 0px 0px 0px;
858
- `,gn=Ft.div``,pd=Ft.div`
876
+ `,xn=Ft.div``,md=Ft.div`
859
877
  list-style: none;
860
878
  padding: 0;
861
879
  margin: 0;
862
880
  cursor: pointer;
863
881
  width: 300px;
864
- `,dd=Ft.div`
882
+ `,ud=Ft.div`
865
883
  width: 1px;
866
884
  margin-right: 40px;
867
885
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
868
- `,cd=Ft.div`
886
+ `,fd=Ft.div`
869
887
  flex: 2;
870
888
  padding: 2rem 2rem 2rem 0rem;
871
- `,md=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:a})=>{let{mergeAppearanceWithDefault:g}=Q();c=g(c);let x={...{[Cr]:an,[dn]:cn,[un]:fn},...p},[S,w]=nd(0),P=r??S,f=n??w,E=o.filter(y=>y.complete===!0).length,b=()=>{var y;return!((y=o[P])!=null&&y.type)||!x[o[P].type]?x[Cr]({stepData:o[P],appearance:c}):x[o[P].type]({stepData:o[P],appearance:c})};return _e.createElement(sd,{type:a,style:i,className:s,appearance:c},_e.createElement(gn,{style:{flex:1}},_e.createElement(gn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},_e.createElement(ld,{className:l("checklistTitle",c),appearance:c},e),_e.createElement(ad,{className:l("checklistSubtitle",c),appearance:c},t),_e.createElement(De,{total:o.length,count:E,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),_e.createElement(pd,{className:l("checklistStepsContainer",c)},o.map((y,A)=>_e.createElement(rn,{data:y,index:A,key:A,listLength:o.length,isSelected:A===P,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(A)}})))),_e.createElement(dd,{appearance:c,className:l("checklistDivider",c)}),_e.createElement(cd,null,_e.createElement(b,null)))},yr=md;import U,{useState as hd}from"react";import xn from"react";import ud from"styled-components";var fd=ud.svg`
889
+ `,gd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:a})=>{let{mergeAppearanceWithDefault:g}=Q();c=g(c);let x={...{[Cr]:pn,[cn]:mn,[fn]:gn},...p},[S,w]=ad(0),P=r??S,f=n??w,E=o.filter(y=>y.complete===!0).length,b=()=>{var y;return!((y=o[P])!=null&&y.type)||!x[o[P].type]?x[Cr]({stepData:o[P],appearance:c}):x[o[P].type]({stepData:o[P],appearance:c})};return We.createElement(pd,{type:a,style:i,className:s,appearance:c},We.createElement(xn,{style:{flex:1}},We.createElement(xn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},We.createElement(dd,{className:l("checklistTitle",c),appearance:c},e),We.createElement(cd,{className:l("checklistSubtitle",c),appearance:c},t),We.createElement(De,{total:o.length,count:E,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),We.createElement(md,{className:l("checklistStepsContainer",c)},o.map((y,A)=>We.createElement(nn,{data:y,index:A,key:A,listLength:o.length,isSelected:A===P,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(A)}})))),We.createElement(ud,{appearance:c,className:l("checklistDivider",c)}),We.createElement(fd,null,We.createElement(b,null)))},yr=gd;import U,{useState as Sd}from"react";import hn from"react";import xd from"styled-components";var hd=xd.svg`
872
890
  transition: 'transform 0.35s ease-in-out';
873
- `,Wt=({color:e="#323232",style:t,className:o})=>xn.createElement(fd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},xn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ue from"styled-components";var Sr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},hn=ue.div`
891
+ `,_t=({color:e="#323232",style:t,className:o})=>hn.createElement(hd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},hn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ue from"styled-components";var Sr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Cn=ue.div`
874
892
  max-height: 350px;
875
893
  padding-bottom: 40px;
876
- `,Cn=ue.div`
894
+ `,yn=ue.div`
877
895
  display: flex;
878
896
  flex-direction: column;
879
897
  margin-top: 20px;
880
- `,yn=ue.h1`
898
+ `,Sn=ue.h1`
881
899
  font-style: normal;
882
900
  font-weight: 600;
883
901
  font-size: 30px;
884
902
  line-height: 36px;
885
903
  margin-bottom: 16px;
886
904
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
887
- `,Sn=ue.h2`
905
+ `,bn=ue.h2`
888
906
  font-weight: 400;
889
907
  font-size: 16px;
890
908
  line-height: 20px;
891
909
  margin-bottom: 16px;
892
910
  padding-left: 1px;
893
911
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
894
- `,bn=ue.div`
895
- ${e=>k(e)} {
912
+ `,wn=ue.div`
913
+ ${e=>T(e)} {
896
914
  border: 1px solid #fafafa;
897
915
  }
898
916
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
@@ -901,12 +919,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
901
919
  flex-direction: column;
902
920
  min-height: 240px;
903
921
  overflow: hidden;
904
- `,wn=ue.div`
922
+ `,Tn=ue.div`
905
923
  display: flex;
906
924
  flex-direction: row;
907
925
  justify-content: space-between;
908
- `,Tn=ue.p`
909
- ${e=>k(e)} {
926
+ `,Fn=ue.p`
927
+ ${e=>T(e)} {
910
928
  font-weight: 400;
911
929
  font-size: 10px;
912
930
  line-height: 12px;
@@ -914,13 +932,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
914
932
  color: #8c8c8c;
915
933
  margin: 20px;
916
934
  }
917
- `,Fn=ue.div`
935
+ `,kn=ue.div`
918
936
  display: flex;
919
937
  flex-direction: row;
920
- `,kn=ue.div`
921
- flex: 1;
922
938
  `,Pn=ue.div`
923
- ${e=>k(e)} {
939
+ flex: 1;
940
+ `,vn=ue.div`
941
+ ${e=>T(e)} {
924
942
  display: flex;
925
943
  justify-content: center;
926
944
  align-content: center;
@@ -929,8 +947,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
929
947
  padding-left: 8px;
930
948
  padding-right: 8px;
931
949
  }
932
- `,vn=ue.p`
933
- ${e=>k(e)} {
950
+ `,Bn=ue.p`
951
+ ${e=>T(e)} {
934
952
  font-style: normal;
935
953
  font-weight: 600;
936
954
  font-size: 22px;
@@ -941,8 +959,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
941
959
  margin-top: 20px;
942
960
  margin-bottom: 16px;
943
961
  }
944
- `,Bn=ue.p`
945
- ${e=>k(e)} {
962
+ `,En=ue.p`
963
+ ${e=>T(e)} {
946
964
  font-weight: 400;
947
965
  font-size: 14px;
948
966
  line-height: 18px;
@@ -950,15 +968,15 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
950
968
  color: ${e=>e.appearance.theme.colorTextSecondary};
951
969
  margin-bottom: 8px;
952
970
  }
953
- `,En=ue.div`
954
- ${e=>k(e)} {
971
+ `,An=ue.div`
972
+ ${e=>T(e)} {
955
973
  display: flex;
956
974
  flex-direction: row;
957
975
  justify-content: center;
958
976
  gap: 8px;
959
977
  }
960
- `,An=ue.div`
961
- ${e=>k(e)} {
978
+ `,Nn=ue.div`
979
+ ${e=>T(e)} {
962
980
  // Anything inside this block will be ignored if the user provides a custom class
963
981
  background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
964
982
  :hover {
@@ -977,8 +995,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
977
995
  justify-content: space-between;
978
996
  position: relative;
979
997
  cursor: pointer;
980
- `,Nn=ue.p`
981
- ${e=>k(e)} {
998
+ `,In=ue.p`
999
+ ${e=>T(e)} {
982
1000
  // Anything inside this block will be ignored if the user provides a custom class
983
1001
  color: ${e=>e.selected?"#434343":"#BFBFBF"};
984
1002
  }
@@ -986,12 +1004,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
986
1004
  font-size: 14px;
987
1005
  line-height: 22px;
988
1006
  margin: 0;
989
- `,In=ue.div`
1007
+ `,On=ue.div`
990
1008
  display: flex;
991
1009
  flex-direction: row;
992
1010
  justify-content: flex-end;
993
1011
  align-content: center;
994
- `,On=ue.div`
1012
+ `,Ln=ue.div`
995
1013
  display: flex;
996
1014
  flex: 1;
997
1015
  flex-direction: row;
@@ -999,14 +1017,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
999
1017
  align-content: center;
1000
1018
  align-items: center;
1001
1019
  margin-right: 20px;
1002
- `,Ln=ue.div`
1020
+ `,Dn=ue.div`
1003
1021
  display: block;
1004
1022
  width: 100%;
1005
- `;import gd from"styled-components";var Dn=gd.div`
1023
+ `;import Cd from"styled-components";var $n=Cd.div`
1006
1024
  flex-direction: column;
1007
1025
  justify-content: center;
1008
1026
  display: flex;
1009
- `;import ot from"react";import tt from"styled-components";var $n=tt.div`
1027
+ `;import rt from"react";import ot from"styled-components";var Mn=ot.div`
1010
1028
  border: 1px solid #fafafa;
1011
1029
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
1012
1030
  border-radius: 14px;
@@ -1014,14 +1032,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1014
1032
  display: flex;
1015
1033
  flex-direction: column;
1016
1034
  overflow: hidden;
1017
- `,Mn=tt.div`
1035
+ `,Un=ot.div`
1018
1036
  display: flex;
1019
1037
  flex-wrap: wrap;
1020
1038
  justify-content: space-between;
1021
1039
  overflow: hidden;
1022
1040
  row-gap: 10px;
1023
- `,Un=tt.div`
1024
- ${e=>k(e)} {
1041
+ `,zn=ot.div`
1042
+ ${e=>T(e)} {
1025
1043
  color: #595959;
1026
1044
  }
1027
1045
  text-transform: uppercase;
@@ -1030,8 +1048,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1030
1048
  line-height: 12px;
1031
1049
  letter-spacing: 0.09em;
1032
1050
  margin-bottom: 12px;
1033
- `,zn=tt.div`
1034
- ${e=>k(e)} {
1051
+ `,Wn=ot.div`
1052
+ ${e=>T(e)} {
1035
1053
  // Anything inside this block will be ignored if the user provides a custom class
1036
1054
  background: #ffffff;
1037
1055
  border: 1px solid #fafafa;
@@ -1043,8 +1061,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1043
1061
 
1044
1062
  max-width: 150px;
1045
1063
  min-width: 200px;
1046
- `,_n=tt.div`
1047
- ${e=>k(e)} {
1064
+ `,_n=ot.div`
1065
+ ${e=>T(e)} {
1048
1066
  background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
1049
1067
  }
1050
1068
  width: 40px;
@@ -1055,14 +1073,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1055
1073
  justify-content: center;
1056
1074
  align-content: center;
1057
1075
  align-items: center;
1058
- `,Wn=tt.div`
1076
+ `,Hn=ot.div`
1059
1077
  font-weight: 600;
1060
1078
  font-size: 20px;
1061
1079
  line-height: 24px;
1062
1080
  width: 20px;
1063
1081
  height: 20px;
1064
- `,Hn=tt.div`
1065
- ${e=>k(e)} {
1082
+ `,jn=ot.div`
1083
+ ${e=>T(e)} {
1066
1084
  color: #434343;
1067
1085
  }
1068
1086
  font-weight: 600;
@@ -1070,20 +1088,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1070
1088
  line-height: 17px;
1071
1089
  margin-top: 12px;
1072
1090
  margin-bottom: 8px;
1073
- `,jn=tt.div`
1074
- ${e=>k(e)} {
1091
+ `,Vn=ot.div`
1092
+ ${e=>T(e)} {
1075
1093
  color: #8c8c8c;
1076
1094
  }
1077
1095
  font-weight: 400;
1078
1096
  font-size: 12px;
1079
1097
  line-height: 14px;
1080
- `,Vn=tt.a`
1098
+ `,Gn=ot.a`
1081
1099
  color: ${e=>e.color};
1082
1100
  font-size: 12px;
1083
1101
  line-height: 14px;
1084
1102
  font-weight: 400;
1085
1103
  cursor: pointer;
1086
- `;var xd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return ot.createElement($n,{style:t,className:l("guideContainer",r)},ot.createElement(Un,{className:l("guideTitle",r)},o),ot.createElement(Mn,{className:l("guideItemContainer",r)},e.map((p,c)=>ot.createElement(zn,{key:`guide-${p.id??c}`,className:l("guideItem",r)},p.icon&&ot.createElement(_n,{className:l("guideIcon",r)},ot.createElement(Wn,null,p.icon)),ot.createElement(Hn,{className:l("guideItemTitle",r),dangerouslySetInnerHTML:le(p.title)}),ot.createElement(jn,{className:l("guideItemSubtitle",r),dangerouslySetInnerHTML:le(p.subtitle)}),ot.createElement(Vn,{className:l("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},po=xd;var Cd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:a,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let S=({stepData:m,handleSecondaryCTAClick:B,handleCTAClick:T})=>m?U.createElement(Pn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},U.createElement(vn,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:le(m.title)}),U.createElement(Bn,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:le(m.subtitle)}),U.createElement(En,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&U.createElement(Z,{title:m.secondaryButtonTitle,onClick:B,appearance:a,secondary:!0}),U.createElement(Z,{title:m.primaryButtonTitle,onClick:T,appearance:a}))):U.createElement(U.Fragment,null),P={...{default:m=>{var O;if((O=e[b])!=null&&O.StepContent){let N=e[b].StepContent;return U.createElement("div",null,N)}let B=e[b];return U.createElement(S,{stepData:m,handleCTAClick:()=>{B.handlePrimaryButtonClick&&B.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{B.handleSecondaryButtonClick&&B.handleSecondaryButtonClick()}})}},...c},[f,E]=hd(0),b=s??f,y=p??E,A=()=>{var m;return e?!((m=e[b])!=null&&m.type)||!P[e[b].type]?P.default(e[b]):P[e[b].type]({stepData:e[b],primaryColor:a.theme.colorPrimary}):U.createElement(U.Fragment,null)},h=e.filter(m=>m.complete).length;return r?(a.theme.modalContainer||(a.theme.borderRadius&&(Sr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=Sr),U.createElement(He,{onClose:n,visible:r,appearance:a},U.createElement(Ln,null,U.createElement(Cn,null,U.createElement(yn,{appearance:a,className:l("checklistTitle",a)},t),U.createElement(Sn,{appearance:a,className:l("checklistSubtitle",a)},o)),U.createElement(hn,null,e&&e.length>0&&U.createElement(bn,{className:l("stepsContainer",a)},U.createElement(wn,null,U.createElement("div",{style:{flex:3}},U.createElement(Tn,{className:l("stepsTitle",a)},i)),U.createElement(On,null,U.createElement(De,{style:{width:"100%"},count:h,total:e.length,appearance:a}))),U.createElement(Fn,null,U.createElement(kn,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,B)=>{let T=b===B;return U.createElement(An,{selected:T,className:l(`checklistStepListItem${T?"Selected":""}`,a),key:`checklist-guide-step-${m.id??B}`,disabled:m.blocked,onClick:()=>{m.blocked||y(B)},title:m.blocked?"Finish remaining steps to continue":void 0},T&&U.createElement(Mo,{className:l("checklistStepItemSelectedIndicator",a),layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),U.createElement(Nn,{selected:T,className:l(`checklistStepListStepName${T?"Selected":""}`,a)},m.stepName),U.createElement(In,null,U.createElement(Qe,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),U.createElement(Dn,null,U.createElement(Wt,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),U.createElement(A,null))),g&&g.length>0&&U.createElement(po,{steps:g,title:d,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(x&&x(m),!0)}))))):U.createElement(U.Fragment,null)},br=Cd;import ve,{useEffect as ns,useState as yd}from"react";import he from"react";import rt from"styled-components";var Gn=rt.div`
1104
+ `;var yd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return rt.createElement(Mn,{style:t,className:l("guideContainer",r)},rt.createElement(zn,{className:l("guideTitle",r)},o),rt.createElement(Un,{className:l("guideItemContainer",r)},e.map((p,c)=>rt.createElement(Wn,{key:`guide-${p.id??c}`,className:l("guideItem",r)},p.icon&&rt.createElement(_n,{className:l("guideIcon",r)},rt.createElement(Hn,null,p.icon)),rt.createElement(jn,{className:l("guideItemTitle",r),dangerouslySetInnerHTML:le(p.title)}),rt.createElement(Vn,{className:l("guideItemSubtitle",r),dangerouslySetInnerHTML:le(p.subtitle)}),rt.createElement(Gn,{className:l("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},po=yd;var bd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:a,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let S=({stepData:m,handleSecondaryCTAClick:B,handleCTAClick:F})=>m?U.createElement(vn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},U.createElement(Bn,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:le(m.title)}),U.createElement(En,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:le(m.subtitle)}),U.createElement(An,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&U.createElement(Z,{title:m.secondaryButtonTitle,onClick:B,appearance:a,secondary:!0}),U.createElement(Z,{title:m.primaryButtonTitle,onClick:F,appearance:a}))):U.createElement(U.Fragment,null),P={...{default:m=>{var O;if((O=e[b])!=null&&O.StepContent){let N=e[b].StepContent;return U.createElement("div",null,N)}let B=e[b];return U.createElement(S,{stepData:m,handleCTAClick:()=>{B.handlePrimaryButtonClick&&B.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{B.handleSecondaryButtonClick&&B.handleSecondaryButtonClick()}})}},...c},[f,E]=Sd(0),b=s??f,y=p??E,A=()=>{var m;return e?!((m=e[b])!=null&&m.type)||!P[e[b].type]?P.default(e[b]):P[e[b].type]({stepData:e[b],primaryColor:a.theme.colorPrimary}):U.createElement(U.Fragment,null)},h=e.filter(m=>m.complete).length;return r?(a.theme.modalContainer||(a.theme.borderRadius&&(Sr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=Sr),U.createElement(He,{onClose:n,visible:r,appearance:a},U.createElement(Dn,null,U.createElement(yn,null,U.createElement(Sn,{appearance:a,className:l("checklistTitle",a)},t),U.createElement(bn,{appearance:a,className:l("checklistSubtitle",a)},o)),U.createElement(Cn,null,e&&e.length>0&&U.createElement(wn,{className:l("stepsContainer",a)},U.createElement(Tn,null,U.createElement("div",{style:{flex:3}},U.createElement(Fn,{className:l("stepsTitle",a)},i)),U.createElement(Ln,null,U.createElement(De,{style:{width:"100%"},count:h,total:e.length,appearance:a}))),U.createElement(kn,null,U.createElement(Pn,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,B)=>{let F=b===B;return U.createElement(Nn,{selected:F,className:l(`checklistStepListItem${F?"Selected":""}`,a),key:`checklist-guide-step-${m.id??B}`,disabled:m.blocked,onClick:()=>{m.blocked||y(B)},title:m.blocked?"Finish remaining steps to continue":void 0},F&&U.createElement(Mo,{className:l("checklistStepItemSelectedIndicator",a),layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),U.createElement(In,{selected:F,className:l(`checklistStepListStepName${F?"Selected":""}`,a)},m.stepName),U.createElement(On,null,U.createElement(Ze,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),U.createElement($n,null,U.createElement(_t,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),U.createElement(A,null))),g&&g.length>0&&U.createElement(po,{steps:g,title:d,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(x&&x(m),!0)}))))):U.createElement(U.Fragment,null)},br=bd;import ve,{useEffect as ss,useState as wd}from"react";import he from"react";import it from"styled-components";var Kn=it.div`
1087
1105
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1088
1106
  border: 1px solid;
1089
1107
  border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -1095,19 +1113,19 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1095
1113
  display: flex;
1096
1114
  flex-direction: column;
1097
1115
  transition: max-height 0.25s;
1098
- `,Kn=rt.div`
1116
+ `,qn=it.div`
1099
1117
  display: flex;
1100
1118
  margin-bottom: 20px;
1101
- `,qn=rt.img`
1119
+ `,Yn=it.img`
1102
1120
  border-radius: 4px;
1103
1121
  max-height: 260px;
1104
1122
  min-height: 200px;
1105
- `,Yn=rt.div`
1123
+ `,Xn=it.div`
1106
1124
  display: flex;
1107
1125
  flex-direction: row;
1108
1126
  justify-content: space-between;
1109
1127
  align-items: center;
1110
- `,Xn=rt.p`
1128
+ `,Jn=it.p`
1111
1129
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1112
1130
  font-style: normal;
1113
1131
  font-weight: 500;
@@ -1118,22 +1136,22 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1118
1136
  :hover {
1119
1137
  opacity: 0.8;
1120
1138
  }
1121
- `,Jn=rt.div`
1139
+ `,Qn=it.div`
1122
1140
  cursor: pointer;
1123
1141
  :hover {
1124
1142
  opacity: 0.8;
1125
1143
  }
1126
- `,RC=rt.div``,Qn=rt.p`
1144
+ `,o0=it.div``,Zn=it.p`
1127
1145
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1128
1146
  font-weight: 400;
1129
1147
  font-size: 14px;
1130
1148
  line-height: 22px;
1131
- `,Zn=rt.div`
1149
+ `,Rn=it.div`
1132
1150
  display: flex;
1133
1151
  flex-direction: row;
1134
1152
  justify-content: flex-start;
1135
1153
  align-items: center;
1136
- `;var Rn=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d,x;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function a(){return he.createElement(he.Fragment,null,e.imageUri||e.videoUri?he.createElement(Kn,{className:l("stepMediaContainer",n)},e.imageUri?he.createElement(qn,{className:l("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?he.createElement(Ve,{appearance:n,videoUri:e.videoUri}):null):null,he.createElement(Qn,{className:l("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:le(e.subtitle)}),he.createElement(vo,{className:l("checklistCTAContainer",n)},e.secondaryButtonTitle?he.createElement(Z,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,he.createElement(Z,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let S=s[e.type];return S?S(e,n):null}return he.createElement(Gn,{"data-testid":`step-${e.id}`,className:l("checklistStepContainer",n),appearance:n},he.createElement(Yn,{className:l("stepHeader",n)},he.createElement(Zn,null,he.createElement($o,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),he.createElement(Xn,{appearance:n,className:l("stepTitle",n),dangerouslySetInnerHTML:le(e.title),onClick:()=>o()})),he.createElement(Jn,{className:l("stepChevronContainer",n),onClick:()=>o()},he.createElement(Wt,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(x=n==null?void 0:n.theme)==null?void 0:x.colorTextSecondary}))),he.createElement("div",{key:e.id,style:{...c}},g()??a()))};import Ht from"styled-components";var m0=Ht.div`
1154
+ `;var es=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d,x;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function a(){return he.createElement(he.Fragment,null,e.imageUri||e.videoUri?he.createElement(qn,{className:l("stepMediaContainer",n)},e.imageUri?he.createElement(Yn,{className:l("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?he.createElement(Ve,{appearance:n,videoUri:e.videoUri}):null):null,he.createElement(Zn,{className:l("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:le(e.subtitle)}),he.createElement(vo,{className:l("checklistCTAContainer",n)},e.secondaryButtonTitle?he.createElement(Z,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,he.createElement(Z,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let S=s[e.type];return S?S(e,n):null}return he.createElement(Kn,{"data-testid":`step-${e.id}`,className:l("checklistStepContainer",n),appearance:n},he.createElement(Xn,{className:l("stepHeader",n)},he.createElement(Rn,null,he.createElement($o,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),he.createElement(Jn,{appearance:n,className:l("stepTitle",n),dangerouslySetInnerHTML:le(e.title),onClick:()=>o()})),he.createElement(Qn,{className:l("stepChevronContainer",n),onClick:()=>o()},he.createElement(_t,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(x=n==null?void 0:n.theme)==null?void 0:x.colorTextSecondary}))),he.createElement("div",{key:e.id,style:{...c}},g()??a()))};import Ht from"styled-components";var g0=Ht.div`
1137
1155
  background: #ffffff;
1138
1156
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
1139
1157
  border-radius: 6px;
@@ -1147,26 +1165,26 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1147
1165
 
1148
1166
  max-width: 800px;
1149
1167
  min-width: 350px;
1150
- `,es=Ht.div`
1168
+ `,ts=Ht.div`
1151
1169
  display: flex;
1152
1170
  flex-direction: column;
1153
- `,ts=Ht.h1`
1171
+ `,os=Ht.h1`
1154
1172
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1155
1173
  font-style: normal;
1156
1174
  font-weight: 700;
1157
1175
  font-size: 20px;
1158
1176
  line-height: 24px;
1159
1177
  margin-bottom: 8px;
1160
- `,os=Ht.h2`
1178
+ `,rs=Ht.h2`
1161
1179
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
1162
1180
  font-weight: 400;
1163
1181
  font-size: 14px;
1164
1182
  line-height: 23px;
1165
1183
  margin: 2px 0 0 0;
1166
- `,rs=Ht.div`
1184
+ `,is=Ht.div`
1167
1185
  display: block;
1168
1186
  width: 100%;
1169
- `,is=Ht.div`
1187
+ `,ns=Ht.div`
1170
1188
  display: flex;
1171
1189
  width: 100%;
1172
1190
  flex-direction: column;
@@ -1174,23 +1192,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1174
1192
  padding: 24px;
1175
1193
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
1176
1194
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1177
- `;var Sd=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:a,appearance:g,type:d,className:x,customStepTypes:S,style:w})=>{let P=o.filter(h=>h.complete).length,[f,E]=yd(Array(o.length).fill(!0));ns(()=>{let h=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){h[m]=!1;break}E(h)}},[]),ns(()=>{b(c)},[c]);let b=h=>{let m=[...f];if(s)for(let B=0;B<f.length;++B)B!==h&&(m[B]=!0);m[h]=!m[h],E(m)};if(!r&&d=="modal")return ve.createElement(ve.Fragment,null);let y=ve.createElement(ve.Fragment,null,ve.createElement(es,null,ve.createElement(ts,{appearance:g,className:l("checklistTitle",g),dangerouslySetInnerHTML:le(e)}),ve.createElement(os,{appearance:g,className:l("checklistSubtitle",g),dangerouslySetInnerHTML:le(t)})),ve.createElement(De,{display:"percent",count:P,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),A=ve.createElement(rs,{className:xe(l("checklistContainer",g),x)},o.map((h,m)=>{let B=f[m];return ve.createElement(Rn,{appearance:g,stepData:h,collapsed:B,key:`modal-checklist-${h.id??m}`,onClick:()=>{if(c===m){b(m);return}a(m)},onPrimaryButtonClick:()=>{h.handlePrimaryButtonClick&&h.handlePrimaryButtonClick(),p&&!h.completionCriteria&&m<f.length-1&&f[m+1]&&a(m+1)},onSecondaryButtonClick:()=>{h.handleSecondaryButtonClick&&h.handleSecondaryButtonClick()},customStepTypes:S})}));return d==="inline"?ve.createElement(is,{appearance:g,className:xe(l("checklistInlineContainer",g),x),style:w},y,A):ve.createElement(ve.Fragment,null,ve.createElement(He,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:y},A))},wr=Sd;import ae,{useEffect as Tr,useRef as Bd,useState as kt}from"react";import{useEffect as bd,useState as wd}from"react";var ss=()=>{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,i]=wd(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,a])=>{if(!window)return[c,!1];let g=window.matchMedia(a);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return bd(()=>{s()},[]),o};import jt from"react";import de,{css as ls,keyframes as as}from"styled-components";var ps=ls`
1195
+ `;var Td=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:a,appearance:g,type:d,className:x,customStepTypes:S,style:w})=>{let P=o.filter(h=>h.complete).length,[f,E]=wd(Array(o.length).fill(!0));ss(()=>{let h=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){h[m]=!1;break}E(h)}},[]),ss(()=>{b(c)},[c]);let b=h=>{let m=[...f];if(s)for(let B=0;B<f.length;++B)B!==h&&(m[B]=!0);m[h]=!m[h],E(m)};if(!r&&d=="modal")return ve.createElement(ve.Fragment,null);let y=ve.createElement(ve.Fragment,null,ve.createElement(ts,null,ve.createElement(os,{appearance:g,className:l("checklistTitle",g),dangerouslySetInnerHTML:le(e)}),ve.createElement(rs,{appearance:g,className:l("checklistSubtitle",g),dangerouslySetInnerHTML:le(t)})),ve.createElement(De,{display:"percent",count:P,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),A=ve.createElement(is,{className:xe(l("checklistContainer",g),x)},o.map((h,m)=>{let B=f[m];return ve.createElement(es,{appearance:g,stepData:h,collapsed:B,key:`modal-checklist-${h.id??m}`,onClick:()=>{if(c===m){b(m);return}a(m)},onPrimaryButtonClick:()=>{h.handlePrimaryButtonClick&&h.handlePrimaryButtonClick(),p&&!h.completionCriteria&&m<f.length-1&&f[m+1]&&a(m+1)},onSecondaryButtonClick:()=>{h.handleSecondaryButtonClick&&h.handleSecondaryButtonClick()},customStepTypes:S})}));return d==="inline"?ve.createElement(ns,{appearance:g,className:xe(l("checklistInlineContainer",g),x),style:w},y,A):ve.createElement(ve.Fragment,null,ve.createElement(He,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:y},A))},wr=Td;import ae,{useEffect as Tr,useRef as Nd,useState as kt}from"react";import{useEffect as Fd,useState as kd}from"react";var ls=()=>{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,i]=kd(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,a])=>{if(!window)return[c,!1];let g=window.matchMedia(a);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return Fd(()=>{s()},[]),o};import jt from"react";import de,{css as as,keyframes as ps}from"styled-components";var ds=as`
1178
1196
  border: 1px solid ${({theme:e})=>e.colorBorder};
1179
- `,Td=ls`
1197
+ `,Pd=as`
1180
1198
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
1181
- `,Fd=as`
1199
+ `,vd=ps`
1182
1200
  from {
1183
1201
  opacity: 0;
1184
1202
  } to {
1185
1203
  opacity: 1;
1186
1204
  }
1187
- `,kd=as`
1205
+ `,Bd=ps`
1188
1206
  from {
1189
1207
  opacity: 1;
1190
1208
  } to {
1191
1209
  opacity: 0;
1192
1210
  }
1193
- `,ds=de.div`
1211
+ `,cs=de.div`
1194
1212
  margin: 0 -20px;
1195
1213
  overflow-x: auto;
1196
1214
  padding-left: 20px;
@@ -1207,14 +1225,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1207
1225
  ::-webkit-scrollbar {
1208
1226
  display: none;
1209
1227
  }
1210
- `,cs=de.div`
1228
+ `,ms=de.div`
1211
1229
  display: flex;
1212
1230
  flex-flow: row nowrap;
1213
1231
  gap: 0 16px;
1214
1232
  scroll-snap-align: center;
1215
1233
  scroll-snap-stop: always;
1216
- `,ms=de.div`
1217
- animation: ${e=>e.reversed?kd:Fd} 0.25s ease-out;
1234
+ `,us=de.div`
1235
+ animation: ${e=>e.reversed?Bd:vd} 0.25s ease-out;
1218
1236
  background: linear-gradient(
1219
1237
  to right,
1220
1238
  ${({theme:e})=>e.colorBackground}00,
@@ -1223,8 +1241,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1223
1241
  position: absolute;
1224
1242
  width: 64px;
1225
1243
  z-index: 10;
1226
- `,us=de.button`
1227
- ${ps}
1244
+ `,fs=de.button`
1245
+ ${ds}
1228
1246
  box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
1229
1247
  align-items: center;
1230
1248
  border-radius: 50%;
@@ -1235,11 +1253,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1235
1253
  justify-content: center;
1236
1254
  position: absolute;
1237
1255
  width: 48px;
1238
- `,fs=de.div`
1256
+ `,gs=de.div`
1239
1257
  border-radius: ${({theme:e})=>e.borderRadius}px;
1240
1258
  padding: 20px;
1241
- `,gs=de(fs)`
1242
- ${ps}
1259
+ `,xs=de(gs)`
1260
+ ${ds}
1243
1261
  background: ${({theme:e})=>e.colorBackground};
1244
1262
  position: relative;
1245
1263
 
@@ -1251,50 +1269,50 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1251
1269
  ${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
1252
1270
  ${e=>e.blocked?"cursor: default":"cursor: pointer"}
1253
1271
  }
1254
- `,xs=de.img`
1272
+ `,hs=de.img`
1255
1273
  border-radius: 50%;
1256
1274
  height: 40px;
1257
1275
  margin-bottom: 12px;
1258
1276
  width: 40px;
1259
- `,hs=de(fs)`
1260
- ${e=>k(e)} {
1261
- ${Td}
1277
+ `,Cs=de(gs)`
1278
+ ${e=>T(e)} {
1279
+ ${Pd}
1262
1280
 
1263
1281
  background: ${({theme:e})=>e.colorBackground};
1264
1282
  }
1265
- `,E0=de.div`
1283
+ `,I0=de.div`
1266
1284
  color: ${({theme:e})=>e.colorPrimary};
1267
1285
  display: flex;
1268
1286
  flex-flow: row nowrap;
1269
1287
  align-items: center;
1270
- `,A0=de.div`
1288
+ `,O0=de.div`
1271
1289
  white-space: nowrap;
1272
- `,Cs=de.div`
1290
+ `,ys=de.div`
1273
1291
  background: #d8fed8;
1274
1292
  border-radius: 6px;
1275
1293
  float: right;
1276
1294
  margin-bottom: 12px;
1277
1295
  padding: 4px 10px;
1278
- `,Pd=de.p`
1296
+ `,Ed=de.p`
1279
1297
  font-weight: bold;
1280
1298
  font-size: 18px;
1281
1299
  line-height: 22px;
1282
1300
  letter-spacing: calc(18px * -0.01);
1283
1301
  margin: 0;
1284
- `,ys=de(Pd)`
1302
+ `,Ss=de(Ed)`
1285
1303
  margin-bottom: 4px;
1286
- `,Ss=de.div`
1304
+ `,bs=de.div`
1287
1305
  display: flex;
1288
1306
  flex-flow: row nowrap;
1289
1307
  align-items: center;
1290
1308
  min-width: 50%;
1291
- `,vd=de.p`
1309
+ `,Ad=de.p`
1292
1310
  font-weight: bold;
1293
1311
  font-size: 16px;
1294
1312
  line-height: 20px;
1295
1313
  letter-spacing: calc(16px * -0.01);
1296
1314
  margin: 0;
1297
- `,bs=de(vd)`
1315
+ `,ws=de(Ad)`
1298
1316
  margin-bottom: 4px;
1299
1317
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1300
1318
  `}
@@ -1304,7 +1322,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1304
1322
  font-size: 14px;
1305
1323
  line-height: 22px;
1306
1324
  margin: 0;
1307
- `,ws=de.p`
1325
+ `,Ts=de.p`
1308
1326
  color: ${({theme:e})=>e.colorText};
1309
1327
  font-weight: 600;
1310
1328
  font-size: 12px;
@@ -1316,21 +1334,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1316
1334
  color: ${({theme:e})=>e.colorTextSecondary};
1317
1335
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1318
1336
  `}
1319
- `;var Ts=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Q(),{primaryCTAClickSideEffects:r}=ie();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:a=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return jt.createElement(gs,{className:l("carouselCard",o),onClick:a?null:d,style:t,blocked:a,complete:c},n&&jt.createElement(xs,{className:l("carouselCardImage",o),src:n,alt:p,style:{opacity:c||a?.4:1}}),c&&jt.createElement(Cs,{className:l("carouselCompletedPill",o)},jt.createElement(ws,{style:{color:"#108E0B"}},"Complete")),p&&jt.createElement(bs,{blocked:a,complete:c,className:l("carouselCardTitle",o)},p),s&&jt.createElement(ct.Quiet,{blocked:a,complete:c,className:l("carouselCardSubtitle",o)},s))};var Ed=()=>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"})),Fs=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=kt(!1),[n,s]=kt(!1);Tr(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ae.createElement(ms,{style:c,reversed:n,onAnimationEnd:n?p:null},ae.createElement(us,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ae.createElement(Ed,null))):null},ks=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=Bd(null),[n,s]=kt(!1),[p,c]=kt(!1),[a,g]=kt(null),[d,x]=kt([]),[S,w]=kt(0),{isSmall:P}=ss(),f=P?1:3,{getFlowMetadata:E,getFlowSteps:b,getNumberOfStepsCompleted:y,updateCustomVariables:A,isLoading:h}=Y();Tr(()=>{A(o)},[o,h]),Tr(()=>{if(h)return;let N=E(e),I=y(e),$=b(e);g(N),N.data!==null&&(x($.sort((D,ee)=>Number(D.complete)-Number(ee.complete))),c($.length>f),w(I))},[h]);let m=[];for(let N=0;N<d.length;N+=f)m.push(d.slice(N,N+f));let B=N=>{let I=N.target,$=I.scrollWidth-I.clientWidth,D=Math.ceil(I.scrollLeft);D>0&&n===!1&&s(!0),D===0&&n===!0&&s(!1),D<$&&p===!1&&c(!0),D===$&&p===!0&&c(!1)},T=(N=!0)=>{let I=N?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*I,behavior:"smooth"})},F=null,O=N=>{F!==null?clearTimeout(F):B(N),F=setTimeout(()=>{B(N)},16)};return h?null:ae.createElement(hs,{className:xe(l("carouselContainer",t),i)},ae.createElement("div",{style:{display:"flex",justifyContent:P?"center":"space-between",marginBottom:20,flexWrap:P?"wrap":"nowrap",gap:P?16:20}},ae.createElement("div",null,ae.createElement(ys,{className:l("carouselTitle",t)},a==null?void 0:a.title),ae.createElement(ct.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),ae.createElement(Ss,{className:l("progressWrapper",t)},ae.createElement(De,{count:S,total:d.length,appearance:t}))),ae.createElement("div",{style:{position:"relative"}},ae.createElement(Fs,{show:n,onClick:()=>T(!1)}),ae.createElement(Fs,{side:"right",show:p,onClick:T}),ae.createElement(ds,{ref:r,onScroll:O},m.map((N,I)=>ae.createElement(cs,{key:I,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},N.map(($,D)=>ae.createElement(Ts,{key:D,stepData:$,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),ae.createElement(oe,{appearance:t}))};var Fr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:a,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:S,setVisible:w,customStepTypes:P,checklistStyle:f="default",autoExpandFirstIncompleteStep:E,autoExpandNextStep:b,...y})=>{let{getFlow:A,getFlowSteps:h,markStepCompleted:m,getStepStatus:B,getNumberOfStepsCompleted:T,isLoading:F,targetingLogicShouldHideFlow:O,updateCustomVariables:N,getFlowMetadata:I,isStepBlocked:$,getFlowStatus:D,hasActiveFullPageFlow:ee,setHasActiveFullPageFlow:M}=Y(),{primaryCTAClickSideEffects:te,secondaryCTAClickSideEffects:fe}=ie(),{getOpenFlowState:X,setOpenFlowState:W}=Te(),[H,Ce]=vs(r||0),[Ie,we]=vs(!1),me=c===void 0?X(e):c,J=s==="modal",{mergeAppearanceWithDefault:ge}=Q();if(x=ge(x),Ps(()=>{N(a)},[a,F]),Ps(()=>{c!==void 0&&(J&&c===!0?M(!0):J&&c===!1&&M(!1))},[c,w,ee]),F)return null;let re=A(e);if(!re||O(re))return null;let L=h(e);if(!L||S===!0&&D(e)===q)return null;let j=I(e);if(j!=null&&j.title&&(t=j.title),j!=null&&j.subtitle&&(o=j.subtitle),!Ie&&r===void 0&&T(e)>0){let u=L.findIndex(C=>C.complete===!1);Ce(u>-1?u:L.length-1),we(!0)}function V(){if(H+1>=L.length){J&&W(e,!1);return}$(e,L[H+1].id)||Ce(H+1)}function ne(u,C,v){let _=H+1<L.length?L[H+1]:null;d&&d(u,H,C,_)===!0&&J&&$e(),g&&g(u,v,_),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&J&&$e()}function se(){return L.map((u,C)=>({...u,handleSecondaryButtonClick:()=>{V(),fe(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ne(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),V()),ne(u,"primary",C),te(u),B(e,u.id)===Ue&&V()}}))}function pe(){return ce.createElement(oe,{appearance:x})}let Ye={steps:se(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:P,type:s,className:n,autoExpandFirstIncompleteStep:E,autoExpandNextStep:b};function $e(){W(e,!1),p&&p(),w&&w(!1)}function G(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(ks,{flowId:e,appearance:x,customVariables:a,className:n}))}function Be(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(wr,{visible:me,onClose:()=>{$e()},selectedStep:H,setSelectedStep:Ce,autoExpandNextStep:!0,appearance:x,...Ye}))}function Kt(){let u=y.guideFlowId,C;return u&&A(u)&&(C=h(u)),ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(br,{visible:me,stepsTitle:j.stepsTitle?j.stepsTitle:"Your quick start guide",onClose:()=>{$e()},selectedStep:H,setSelectedStep:Ce,guideData:C,guideTitle:y.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:v=>{ne(v,"link",0)},customStepTypes:P,...Ye}))}function fo(){let u=ce.createElement(yr,{flowId:e,style:i,selectedStep:H,setSelectedStep:Ce,appearance:x,type:s,...Ye});return J?ce.createElement(He,{onClose:()=>{$e()},visible:me,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ce.createElement(pe,null),u):ce.createElement(ce.Fragment,null,ce.createElement(pe,null),u)}switch(f){case"condensed":return Be();case"with-guide":return Kt();case"default":return fo();case"carousel":return G();default:return fo()}};var Nd=e=>Ad.createElement(Fr,{type:"inline",...e});import ut,{useEffect as Id}from"react";import Ke from"react";import Ho from"styled-components";var Bs=Ho.div`
1337
+ `;var Fs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Q(),{primaryCTAClickSideEffects:r}=ie();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:a=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return jt.createElement(xs,{className:l("carouselCard",o),onClick:a?null:d,style:t,blocked:a,complete:c},n&&jt.createElement(hs,{className:l("carouselCardImage",o),src:n,alt:p,style:{opacity:c||a?.4:1}}),c&&jt.createElement(ys,{className:l("carouselCompletedPill",o)},jt.createElement(Ts,{style:{color:"#108E0B"}},"Complete")),p&&jt.createElement(ws,{blocked:a,complete:c,className:l("carouselCardTitle",o)},p),s&&jt.createElement(ct.Quiet,{blocked:a,complete:c,className:l("carouselCardSubtitle",o)},s))};var Id=()=>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"})),ks=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=kt(!1),[n,s]=kt(!1);Tr(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ae.createElement(us,{style:c,reversed:n,onAnimationEnd:n?p:null},ae.createElement(fs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ae.createElement(Id,null))):null},Ps=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=Nd(null),[n,s]=kt(!1),[p,c]=kt(!1),[a,g]=kt(null),[d,x]=kt([]),[S,w]=kt(0),{isSmall:P}=ls(),f=P?1:3,{getFlowMetadata:E,getFlowSteps:b,getNumberOfStepsCompleted:y,updateCustomVariables:A,isLoading:h}=Y();Tr(()=>{A(o)},[o,h]),Tr(()=>{if(h)return;let N=E(e),I=y(e),$=b(e);g(N),N.data!==null&&(x($.sort((D,ee)=>Number(D.complete)-Number(ee.complete))),c($.length>f),w(I))},[h]);let m=[];for(let N=0;N<d.length;N+=f)m.push(d.slice(N,N+f));let B=N=>{let I=N.target,$=I.scrollWidth-I.clientWidth,D=Math.ceil(I.scrollLeft);D>0&&n===!1&&s(!0),D===0&&n===!0&&s(!1),D<$&&p===!1&&c(!0),D===$&&p===!0&&c(!1)},F=(N=!0)=>{let I=N?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*I,behavior:"smooth"})},k=null,O=N=>{k!==null?clearTimeout(k):B(N),k=setTimeout(()=>{B(N)},16)};return h?null:ae.createElement(Cs,{className:xe(l("carouselContainer",t),i)},ae.createElement("div",{style:{display:"flex",justifyContent:P?"center":"space-between",marginBottom:20,flexWrap:P?"wrap":"nowrap",gap:P?16:20}},ae.createElement("div",null,ae.createElement(Ss,{className:l("carouselTitle",t)},a==null?void 0:a.title),ae.createElement(ct.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),ae.createElement(bs,{className:l("progressWrapper",t)},ae.createElement(De,{count:S,total:d.length,appearance:t}))),ae.createElement("div",{style:{position:"relative"}},ae.createElement(ks,{show:n,onClick:()=>F(!1)}),ae.createElement(ks,{side:"right",show:p,onClick:F}),ae.createElement(cs,{ref:r,onScroll:O},m.map((N,I)=>ae.createElement(ms,{key:I,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},N.map(($,D)=>ae.createElement(Fs,{key:D,stepData:$,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),ae.createElement(oe,{appearance:t}))};var Fr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:a,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:S,setVisible:w,customStepTypes:P,checklistStyle:f="default",autoExpandFirstIncompleteStep:E,autoExpandNextStep:b,...y})=>{let{getFlow:A,getFlowSteps:h,markStepCompleted:m,getStepStatus:B,getNumberOfStepsCompleted:F,isLoading:k,targetingLogicShouldHideFlow:O,updateCustomVariables:N,getFlowMetadata:I,isStepBlocked:$,getFlowStatus:D,hasActiveFullPageFlow:ee,setHasActiveFullPageFlow:M}=Y(),{primaryCTAClickSideEffects:te,secondaryCTAClickSideEffects:fe}=ie(),{getOpenFlowState:X,setOpenFlowState:_}=Te(),[H,Ce]=Bs(r||0),[Ie,we]=Bs(!1),me=c===void 0?X(e):c,J=s==="modal",{mergeAppearanceWithDefault:ge}=Q();if(x=ge(x),vs(()=>{N(a)},[a,k]),vs(()=>{c!==void 0&&(J&&c===!0?M(!0):J&&c===!1&&M(!1))},[c,w,ee]),k)return null;let re=A(e);if(!re||O(re))return null;let L=h(e);if(!L||S===!0&&D(e)===q)return null;let j=I(e);if(j!=null&&j.title&&(t=j.title),j!=null&&j.subtitle&&(o=j.subtitle),!Ie&&r===void 0&&F(e)>0){let u=L.findIndex(C=>C.complete===!1);Ce(u>-1?u:L.length-1),we(!0)}function V(){if(H+1>=L.length){J&&_(e,!1);return}$(e,L[H+1].id)||Ce(H+1)}function ne(u,C,v){let W=H+1<L.length?L[H+1]:null;d&&d(u,H,C,W)===!0&&J&&$e(),g&&g(u,v,W),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&J&&$e()}function se(){return L.map((u,C)=>({...u,handleSecondaryButtonClick:()=>{V(),fe(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ne(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),V()),ne(u,"primary",C),te(u),B(e,u.id)===Ue&&V()}}))}function pe(){return ce.createElement(oe,{appearance:x})}let Ye={steps:se(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:P,type:s,className:n,autoExpandFirstIncompleteStep:E,autoExpandNextStep:b};function $e(){_(e,!1),p&&p(),w&&w(!1)}function G(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Ps,{flowId:e,appearance:x,customVariables:a,className:n}))}function Be(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(wr,{visible:me,onClose:()=>{$e()},selectedStep:H,setSelectedStep:Ce,autoExpandNextStep:!0,appearance:x,...Ye}))}function Kt(){let u=y.guideFlowId,C;return u&&A(u)&&(C=h(u)),ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(br,{visible:me,stepsTitle:j.stepsTitle?j.stepsTitle:"Your quick start guide",onClose:()=>{$e()},selectedStep:H,setSelectedStep:Ce,guideData:C,guideTitle:y.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:v=>{ne(v,"link",0)},customStepTypes:P,...Ye}))}function fo(){let u=ce.createElement(yr,{flowId:e,style:i,selectedStep:H,setSelectedStep:Ce,appearance:x,type:s,...Ye});return J?ce.createElement(He,{onClose:()=>{$e()},visible:me,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ce.createElement(pe,null),u):ce.createElement(ce.Fragment,null,ce.createElement(pe,null),u)}switch(f){case"condensed":return Be();case"with-guide":return Kt();case"default":return fo();case"carousel":return G();default:return fo()}};var Ld=e=>Od.createElement(Fr,{type:"inline",...e});import ut,{useEffect as Dd}from"react";import Ke from"react";import Ho from"styled-components";var Es=Ho.div`
1320
1338
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1321
1339
  border-radius: 8px;
1322
1340
  padding: 6px 10px 6px 10px;
1323
1341
  min-width: 160px;
1324
1342
  cursor: pointer;
1325
1343
  background-color: ${e=>e.appearance.theme.colorBackground}};
1326
- `,Es=Ho.div`
1344
+ `,As=Ho.div`
1327
1345
  display: flex;
1328
1346
  flex-direction: row;
1329
1347
  justify-content: space-between;
1330
1348
  align-items: center;
1331
1349
  margin-bottom: 2px;
1332
1350
  flex-grow: 2;
1333
- `,As=Ho.div`
1351
+ `,Ns=Ho.div`
1334
1352
  text-overflow: ellipsis;
1335
1353
  font-weight: 600;
1336
1354
  font-size: 12px;
@@ -1338,13 +1356,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1338
1356
  margin-right: ${e=>e.type==="condensed"?"8px":"0"};
1339
1357
  text-align: ${e=>e.type==="condensed"?"left":"right"};
1340
1358
  color: ${e=>e.appearance.theme.colorPrimary};
1341
- `,Ns=Ho.div`
1359
+ `,Is=Ho.div`
1342
1360
  width: 20px;
1343
1361
  margin-right: 8px;
1344
1362
  display: flex;
1345
1363
  height: 100%;
1346
1364
  align-items: center;
1347
- `;var Is=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Ke.createElement(Ke.Fragment,null,Ke.createElement(oe,{appearance:s}),Ke.createElement(Bs,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:xe(n??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ke.createElement(Ns,{className:l("progressRingContainer",s)},Ke.createElement(Ot,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ke.createElement(Es,{type:p,className:l("badgeTitleContainer",s)},Ke.createElement(As,{type:p,appearance:s,className:l("badgeTitle",s)},e),i!==void 0&&Ke.createElement(Wt,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ke.createElement(De,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import mt from"react";import co from"styled-components";var Os=co.div`
1365
+ `;var Os=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Ke.createElement(Ke.Fragment,null,Ke.createElement(oe,{appearance:s}),Ke.createElement(Es,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:xe(n??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ke.createElement(Is,{className:l("progressRingContainer",s)},Ke.createElement(Ot,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ke.createElement(As,{type:p,className:l("badgeTitleContainer",s)},Ke.createElement(Ns,{type:p,appearance:s,className:l("badgeTitle",s)},e),i!==void 0&&Ke.createElement(_t,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ke.createElement(De,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import mt from"react";import co from"styled-components";var Ls=co.div`
1348
1366
  display: flex;
1349
1367
  flex-direction: row;
1350
1368
  width: 100%;
@@ -1355,25 +1373,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1355
1373
  border-width: 1px;
1356
1374
  border-color: ${e=>e.appearance.theme.colorPrimary};
1357
1375
  border-radius: 12px;
1358
- `,Ls=co.div`
1359
- ${e=>k(e)} {
1376
+ `,Ds=co.div`
1377
+ ${e=>T(e)} {
1360
1378
  display: flex;
1361
1379
  justify-content: center;
1362
1380
  align-items: center;
1363
1381
  margin-right: 16px;
1364
1382
  }
1365
- `,Ds=co.div`
1383
+ `,$s=co.div`
1366
1384
  display: flex;
1367
1385
  flex-direction: column;
1368
1386
  flex: 1;
1369
1387
  margin-top: 0;
1370
- `,$s=co.div`
1388
+ `,Ms=co.div`
1371
1389
  display: flex;
1372
1390
  flex-direction: column;
1373
1391
  justify-content: center;
1374
1392
  margin-left: 16px;
1375
1393
  min-width: 200px;
1376
- `,vy=co.div`
1394
+ `,Ay=co.div`
1377
1395
  display: flex;
1378
1396
  justify-content: center;
1379
1397
  align-items: flex-end;
@@ -1382,7 +1400,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1382
1400
  :hover {
1383
1401
  opacity: 0.8;
1384
1402
  }
1385
- `;var Ms=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>mt.createElement(mt.Fragment,null,mt.createElement(Os,{appearance:i,className:xe(l("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&mt.createElement(Ls,{className:l("fullWidthProgressBadgeIcon",i)},o),mt.createElement(Ds,null,mt.createElement(ke,{size:"small",appearance:i,title:e,subtitle:t})),mt.createElement($s,{className:l("fullWidthProgressBadgeProgressContainer",i)},mt.createElement(De,{count:r,total:n,display:"percent",textLocation:"top"}))));var Od=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:a,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:S,getNumberOfStepsCompleted:w,isLoading:P,targetingLogicShouldHideFlow:f,updateCustomVariables:E}=Y(),{mergeAppearanceWithDefault:b}=Q();a=b(a);let{setOpenFlowState:y,getOpenFlowState:A}=Te();if(Id(()=>{E(p)},[p,P]),P)return null;let h=d(e);if(!h||f(h)||c===!0&&S(e)===q)return null;let m=x(e),B=w(e);return g==="full-width"?ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:a}),ut.createElement(Ms,{title:t,subtitle:o,count:B,total:m.length,style:r,className:s,appearance:a,icon:i,onClick:()=>{}})):ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:a}),ut.createElement(Is,{count:B,total:m.length,title:t,style:r,onClick:()=>{y(e,!0),n&&n()},type:g,className:s,appearance:a}))};import Ld from"react";var Dd=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=Y(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let c=r(e);if(!c||n(c))return null;let a=s(e);return Ld.createElement(po,{steps:a,style:t,appearance:o,...i})};import ft,{useContext as Kd,useEffect as qd}from"react";import z,{useEffect as jo,useLayoutEffect as zs,useRef as zd,useState as mo}from"react";import uo from"styled-components";import{useCallback as $d,useEffect as Md,useState as Ud}from"react";var kr=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function Us(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,r]=Ud(o),n=$d(()=>{e&&r(e.getBoundingClientRect())},[e]);return Md(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}var _s=300,Ws=100,_d=500,Vt=12,Wd=uo.div`
1403
+ `;var Us=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>mt.createElement(mt.Fragment,null,mt.createElement(Ls,{appearance:i,className:xe(l("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&mt.createElement(Ds,{className:l("fullWidthProgressBadgeIcon",i)},o),mt.createElement($s,null,mt.createElement(ke,{size:"small",appearance:i,title:e,subtitle:t})),mt.createElement(Ms,{className:l("fullWidthProgressBadgeProgressContainer",i)},mt.createElement(De,{count:r,total:n,display:"percent",textLocation:"top"}))));var $d=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:a,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:S,getNumberOfStepsCompleted:w,isLoading:P,targetingLogicShouldHideFlow:f,updateCustomVariables:E}=Y(),{mergeAppearanceWithDefault:b}=Q();a=b(a);let{setOpenFlowState:y,getOpenFlowState:A}=Te();if(Dd(()=>{E(p)},[p,P]),P)return null;let h=d(e);if(!h||f(h)||c===!0&&S(e)===q)return null;let m=x(e),B=w(e);return g==="full-width"?ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:a}),ut.createElement(Us,{title:t,subtitle:o,count:B,total:m.length,style:r,className:s,appearance:a,icon:i,onClick:()=>{}})):ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:a}),ut.createElement(Os,{count:B,total:m.length,title:t,style:r,onClick:()=>{y(e,!0),n&&n()},type:g,className:s,appearance:a}))};import Md from"react";var Ud=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=Y(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let c=r(e);if(!c||n(c))return null;let a=s(e);return Md.createElement(po,{steps:a,style:t,appearance:o,...i})};import ft,{useContext as Xd,useEffect as Jd}from"react";import z,{useEffect as jo,useLayoutEffect as Ws,useRef as Hd,useState as mo}from"react";import uo from"styled-components";import{useCallback as zd,useEffect as Wd,useState as _d}from"react";var kr=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function zs(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,r]=_d(o),n=zd(()=>{e&&r(e.getBoundingClientRect())},[e]);return Wd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}var _s=300,Hs=100,jd=500,Vt=12,Vd=uo.div`
1386
1404
  width: 100%;
1387
1405
  height: 100%;
1388
1406
  border-radius: 9999px;
@@ -1405,26 +1423,26 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1405
1423
  opacity: 0;
1406
1424
  }
1407
1425
  }
1408
- `,Hd=uo.div`
1426
+ `,Gd=uo.div`
1409
1427
  width: ${Vt}px;
1410
1428
  height: ${Vt}px;
1411
1429
  border-radius: 100px;
1412
1430
  background-color: ${e=>e.primaryColor};
1413
1431
  z-index: 20;
1414
1432
  opacity: 1;
1415
- `,jd=uo.div`
1433
+ `,Kd=uo.div`
1416
1434
  pointer-events: all;
1417
- `,Hs=uo.div`
1435
+ `,js=uo.div`
1418
1436
  display: flex;
1419
1437
  align-content: center;
1420
1438
  justify-content: center;
1421
1439
  align-items: center;
1422
1440
  z-index: ${e=>e.zIndex?e.zIndex:90};
1423
- `,Vd=uo(Hs)`
1441
+ `,qd=uo(js)`
1424
1442
  width: ${Vt+12}px;
1425
1443
  height: ${Vt+12}px;
1426
- `,Gd=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:a=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:S,showStepCount:w=!0,completedStepsCount:P=0,showFrigadeBranding:f=!1,cssPosition:E="absolute"})=>{var se,pe,Ye,$e;let[b,y]=mo(),[A,h]=mo(new Date),m=zd(null),[B,T]=mo(document.querySelector(e[a].selector)),F=Us(B,A),[O,N]=mo(),[I,$]=mo(!S),D=(pe=(se=e[a])==null?void 0:se.props)!=null&&pe.position?e[a].props.position:E,ee=(($e=(Ye=e[a])==null?void 0:Ye.props)==null?void 0:$e.zIndex)??90,M=(b==null?void 0:b.width)??_s,te=(b==null?void 0:b.height)??Ws,fe=window.location.pathname.split("/").pop();zs(()=>{m.current&&y({width:m.current.clientWidth,height:m.current.clientHeight})},[a,A,D]),jo(()=>{S||$(!0)},[a]);let X=()=>{let G=document.querySelector(e[a].selector);if(!G){N(void 0),T(null);return}O&&O===JSON.stringify(G==null?void 0:G.getBoundingClientRect())||(T(G),h(new Date),G&&N(JSON.stringify(G.getBoundingClientRect())))};if(jo(()=>{let G=new MutationObserver(X);return G.observe(document.body,{subtree:!0,childList:!0}),()=>G.disconnect()},[X]),jo(()=>{let G=new MutationObserver(X);return G.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>G.disconnect()},[X]),jo(()=>{let G=setInterval(()=>{X()},10);return()=>clearInterval(G)},[X]),zs(()=>{setTimeout(()=>{X()},_d),X()},[a,fe]),B===null||!p||F.height===0&&F.width===0&&D!=="fixed"&&E!=="static")return null;let W=i==="auto"?"right":i,H=kr(F,W,M,s,D),Ce=F.right+M>(window.innerWidth||document.documentElement.clientWidth),Ie=F.bottom+Ws>(window.innerHeight||document.documentElement.clientHeight);Ce&&i==="auto"&&(H=kr(F,"left",M,s,D),W="left");let we=()=>{let G=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),$(!1),setTimeout(()=>{X()},30)),P===e.length-1)return o()},Be=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),S&&!e[a].secondaryButtonUri&&$(!1))};return z.createElement(z.Fragment,null,w&&e.length>1&&z.createElement(Kr,null,z.createElement(Yr,{className:l("tooltipStepCounter",d)},a+1," of ",e.length)),z.createElement(qr,{showStepCount:w,className:l("tooltipCTAContainer",d)},e[a].secondaryButtonTitle&&z.createElement(Z,{title:e[a].secondaryButtonTitle,appearance:d,onClick:Be,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&z.createElement(Z,{title:e[a].primaryButtonTitle,appearance:d,onClick:G,withMargin:!1,size:"small"})))},me=()=>z.createElement(z.Fragment,null,x&&z.createElement(Hr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",d)},z.createElement(Fe,null)),e[a].imageUri&&z.createElement(jr,{dismissible:x,appearance:d,src:e[a].imageUri,className:l("tooltipImageContainer",d)}),e[a].videoUri&&!e[a].imageUri&&z.createElement(Vr,{dismissible:x,appearance:d,className:l("tooltipVideoContainer",d)},z.createElement(Ve,{appearance:d,videoUri:e[a].videoUri})),z.createElement(ke,{appearance:d,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),z.createElement(Gr,{className:l("tooltipFooter",d)},z.createElement(we,null))),ge={...{default:G=>{var Be;if((Be=e[a])!=null&&Be.StepContent){let Kt=e[a].StepContent;return z.createElement("div",null,Kt)}return z.createElement(me,null)}},...g},re=()=>{var G;return e?!((G=e[a])!=null&&G.type)||!ge[e[a].type]?ge.default(e[a]):ge[e[a].type]({stepData:e[a],primaryColor:n}):z.createElement(z.Fragment,null)};if(S&&e[a].complete===!0)return null;let L={top:(H==null?void 0:H.y)-Vt,left:(W=="left"?F.x+s.x:(H==null?void 0:H.x)-Vt)??0,cursor:S?"pointer":"default",position:D},j=()=>{let Be=L.left+(W=="left"?-M:24);return Math.min(Math.max(Be,20),window.innerWidth-M-20)},V=()=>{if(D==="fixed")return L.top;let G=L.top+te,Be=20;return G>window.innerHeight-Be?L.top+-te:L.top},ne=()=>{S&&(h(new Date),$(!I))};return z.createElement(jd,null,z.createElement(Vd,{style:L,zIndex:ee,className:l("tourHighlightContainer",d)},r&&e[a].showHighlight!==!1&&E!=="static"&&z.createElement(z.Fragment,null,z.createElement(Hd,{style:{position:D},onClick:ne,primaryColor:d.theme.colorPrimary,className:l("tourHighlightInnerCircle",d)}),z.createElement(Wd,{style:{position:"absolute"},onClick:ne,primaryColor:d.theme.colorPrimary,className:l("tourHighlightOuterCircle",d)}))),z.createElement(Hs,{style:{...L,left:j(),top:V()},zIndex:ee+1,className:l("tooltipContainerWrapper",d)},I&&z.createElement(z.Fragment,null,z.createElement(ho,{ref:m,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:E!=="static"?12:0,...c},appearance:d,className:l("tooltipContainer",d),maxWidth:_s,zIndex:ee+10},z.createElement(re,null)),f&&z.createElement(Jr,{className:l("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:ee+10},z.createElement(Co,{appearance:d})))))},Vo=Gd;import{Portal as Yd}from"react-portal";var Xd=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:a=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:S="absolute",...w})=>{let{getFlow:P,getFlowSteps:f,isLoading:E,targetingLogicShouldHideFlow:b,markStepCompleted:y,markStepStarted:A,markFlowCompleted:h,updateCustomVariables:m,getCurrentStepIndex:B,getStepStatus:T,isStepBlocked:F,getFlowStatus:O,getNumberOfStepsCompleted:N}=Y(),{isLoadingUserFlowStateData:I}=Ee(),{primaryCTAClickSideEffects:$,secondaryCTAClickSideEffects:D}=ie(),{hasOpenModals:ee}=Te(),M=B(e),{openFlowStates:te}=Kd(K),{mergeAppearanceWithDefault:fe}=Q();if(o=fe(o),qd(()=>{m(t)},[t,E]),I)return null;let X=P(e);if(!X||b(X)||O(e)==q||ee())return null;let W=f(e);if(Object.keys(te).length>0){let L=Object.keys(te).find(j=>te[j]===!0);if(L!==void 0&&L!==e)return ft.createElement(ft.Fragment,null)}async function H(L){if(await y(e,L.id),W.map(j=>T(e,j.id)).every(j=>j===Ue)){await h(e);return}if(!a&&M+1<W.length){if(F(e,W[M+1].id))return;await A(e,W[M+1].id)}}function Ce(L,j,V){let ne=M+1<W.length?W[M+1]:null;r&&r(L,M,j,ne),i&&i(L,V,ne)}function Ie(){return W.map(L=>({...L,handleSecondaryButtonClick:async()=>{D(L),L.skippable===!0&&await y(e,L.id,{skipped:!0}),Ce(L,"secondary",M)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await H(L),Ce(L,"primary",M),$(L)}}))}async function we(L){s&&s(),g==="complete-flow"?await h(e):await y(e,L.id)}function me(){d&&d()}let J=!document.querySelector(W[M].selector);function ge(){let L=W.findIndex(j=>!!document.querySelector(j.selector));return W.map((j,V)=>J&&!n&&V!==L&&x?null:ft.createElement(Vo,{key:j.id,appearance:o,steps:Ie(),selectedStep:V,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>we(j),tooltipPosition:c,showHighlightOnly:a,completedStepsCount:N(e),onComplete:me,cssPosition:S,...w}))}function re(){return ft.createElement(ft.Fragment,null,ft.createElement(oe,{appearance:o}),n||J&&x?ge():ft.createElement(Vo,{appearance:o,steps:Ie(),selectedStep:M,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>we(W[M]),tooltipPosition:c,completedStepsCount:N(e),showHighlightOnly:a,onComplete:me,cssPosition:S,...w}))}return S==="static"?re():ft.createElement(Yd,null,re())};import Ne,{useEffect as Jd,useRef as Qd,useState as Zd}from"react";import{Portal as Rd}from"react-portal";import Pt from"styled-components";var js=Pt.button`
1427
- ${e=>k(e)} {
1444
+ `,Yd=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:a=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:S,showStepCount:w=!0,completedStepsCount:P=0,showFrigadeBranding:f=!1,cssPosition:E="absolute"})=>{var se,pe,Ye,$e;let[b,y]=mo(),[A,h]=mo(new Date),m=Hd(null),[B,F]=mo(document.querySelector(e[a].selector)),k=zs(B,A),[O,N]=mo(),[I,$]=mo(!S),D=(pe=(se=e[a])==null?void 0:se.props)!=null&&pe.position?e[a].props.position:E,ee=(($e=(Ye=e[a])==null?void 0:Ye.props)==null?void 0:$e.zIndex)??90,M=(b==null?void 0:b.width)??_s,te=(b==null?void 0:b.height)??Hs,fe=window.location.pathname.split("/").pop();Ws(()=>{m.current&&y({width:m.current.clientWidth,height:m.current.clientHeight})},[a,A,D]),jo(()=>{S||$(!0)},[a]);let X=()=>{let G=document.querySelector(e[a].selector);if(!G){N(void 0),F(null);return}O&&O===JSON.stringify(G==null?void 0:G.getBoundingClientRect())||(F(G),h(new Date),G&&N(JSON.stringify(G.getBoundingClientRect())))};if(jo(()=>{let G=new MutationObserver(X);return G.observe(document.body,{subtree:!0,childList:!0}),()=>G.disconnect()},[X]),jo(()=>{let G=new MutationObserver(X);return G.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>G.disconnect()},[X]),jo(()=>{let G=setInterval(()=>{X()},10);return()=>clearInterval(G)},[X]),Ws(()=>{setTimeout(()=>{X()},jd),X()},[a,fe]),B===null||!p||k.height===0&&k.width===0&&D!=="fixed"&&E!=="static")return null;let _=i==="auto"?"right":i,H=kr(k,_,M,s,D),Ce=k.right+M>(window.innerWidth||document.documentElement.clientWidth),Ie=k.bottom+Hs>(window.innerHeight||document.documentElement.clientHeight);Ce&&i==="auto"&&(H=kr(k,"left",M,s,D),_="left");let we=()=>{let G=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),$(!1),setTimeout(()=>{X()},30)),P===e.length-1)return o()},Be=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),S&&!e[a].secondaryButtonUri&&$(!1))};return z.createElement(z.Fragment,null,w&&e.length>1&&z.createElement(qr,null,z.createElement(Xr,{className:l("tooltipStepCounter",d)},a+1," of ",e.length)),z.createElement(Yr,{showStepCount:w,className:l("tooltipCTAContainer",d)},e[a].secondaryButtonTitle&&z.createElement(Z,{title:e[a].secondaryButtonTitle,appearance:d,onClick:Be,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&z.createElement(Z,{title:e[a].primaryButtonTitle,appearance:d,onClick:G,withMargin:!1,size:"small"})))},me=()=>z.createElement(z.Fragment,null,x&&z.createElement(Hr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",d),hasImage:!!e[a].imageUri||!!e[a].videoUri},z.createElement(Fe,null)),e[a].imageUri&&z.createElement(jr,{dismissible:x,appearance:d,src:e[a].imageUri,className:l("tooltipImageContainer",d)}),e[a].videoUri&&!e[a].imageUri&&z.createElement(Vr,{dismissible:x,appearance:d,className:l("tooltipVideoContainer",d)},z.createElement(Ve,{appearance:d,videoUri:e[a].videoUri})),z.createElement(Kr,{className:l("tooltipContentContainer",d)},z.createElement(ke,{appearance:d,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),z.createElement(Gr,{className:l("tooltipFooter",d)},z.createElement(we,null)))),ge={...{default:G=>{var Be;if((Be=e[a])!=null&&Be.StepContent){let Kt=e[a].StepContent;return z.createElement("div",null,Kt)}return z.createElement(me,null)}},...g},re=()=>{var G;return e?!((G=e[a])!=null&&G.type)||!ge[e[a].type]?ge.default(e[a]):ge[e[a].type]({stepData:e[a],primaryColor:n}):z.createElement(z.Fragment,null)};if(S&&e[a].complete===!0)return null;let L={top:(H==null?void 0:H.y)-Vt,left:(_=="left"?k.x+s.x:(H==null?void 0:H.x)-Vt)??0,cursor:S?"pointer":"default",position:D},j=()=>{let Be=L.left+(_=="left"?-M:24);return Math.min(Math.max(Be,20),window.innerWidth-M-20)},V=()=>{if(D==="fixed")return L.top;let G=L.top+te,Be=20;return G>window.innerHeight-Be?L.top+-te:L.top},ne=()=>{S&&(h(new Date),$(!I))};return z.createElement(Kd,null,z.createElement(qd,{style:L,zIndex:ee,className:l("tourHighlightContainer",d)},r&&e[a].showHighlight!==!1&&E!=="static"&&z.createElement(z.Fragment,null,z.createElement(Gd,{style:{position:D},onClick:ne,primaryColor:d.theme.colorPrimary,className:l("tourHighlightInnerCircle",d)}),z.createElement(Vd,{style:{position:"absolute"},onClick:ne,primaryColor:d.theme.colorPrimary,className:l("tourHighlightOuterCircle",d)}))),z.createElement(js,{style:{...L,left:j(),top:V()},zIndex:ee+1,className:l("tooltipContainerWrapper",d)},I&&z.createElement(z.Fragment,null,z.createElement(ho,{ref:m,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:E!=="static"?12:0,...c},appearance:d,className:l("tooltipContainer",d),maxWidth:_s,zIndex:ee+10},z.createElement(re,null)),f&&z.createElement(Qr,{className:l("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:ee+10},z.createElement(Co,{appearance:d})))))},Vo=Yd;import{Portal as Qd}from"react-portal";var Zd=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:a=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:S="absolute",...w})=>{let{getFlow:P,getFlowSteps:f,isLoading:E,targetingLogicShouldHideFlow:b,markStepCompleted:y,markStepStarted:A,markFlowCompleted:h,updateCustomVariables:m,getCurrentStepIndex:B,getStepStatus:F,isStepBlocked:k,getFlowStatus:O,getNumberOfStepsCompleted:N}=Y(),{isLoadingUserFlowStateData:I}=Ee(),{primaryCTAClickSideEffects:$,secondaryCTAClickSideEffects:D}=ie(),{hasOpenModals:ee}=Te(),M=B(e),{openFlowStates:te}=Xd(K),{mergeAppearanceWithDefault:fe}=Q();if(o=fe(o),Jd(()=>{m(t)},[t,E]),I)return null;let X=P(e);if(!X||b(X)||O(e)==q||ee())return null;let _=f(e);if(Object.keys(te).length>0){let L=Object.keys(te).find(j=>te[j]===!0);if(L!==void 0&&L!==e)return ft.createElement(ft.Fragment,null)}async function H(L){if(await y(e,L.id),_.map(j=>F(e,j.id)).every(j=>j===Ue)){await h(e);return}if(!a&&M+1<_.length){if(k(e,_[M+1].id))return;await A(e,_[M+1].id)}}function Ce(L,j,V){let ne=M+1<_.length?_[M+1]:null;r&&r(L,M,j,ne),i&&i(L,V,ne)}function Ie(){return _.map(L=>({...L,handleSecondaryButtonClick:async()=>{D(L),L.skippable===!0&&await y(e,L.id,{skipped:!0}),Ce(L,"secondary",M)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await H(L),Ce(L,"primary",M),$(L)}}))}async function we(L){s&&s(),g==="complete-flow"?await h(e):await y(e,L.id)}function me(){d&&d()}let J=!document.querySelector(_[M].selector);function ge(){let L=_.findIndex(j=>!!document.querySelector(j.selector));return _.map((j,V)=>J&&!n&&V!==L&&x?null:ft.createElement(Vo,{key:j.id,appearance:o,steps:Ie(),selectedStep:V,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>we(j),tooltipPosition:c,showHighlightOnly:a,completedStepsCount:N(e),onComplete:me,cssPosition:S,...w}))}function re(){return ft.createElement(ft.Fragment,null,ft.createElement(oe,{appearance:o}),n||J&&x?ge():ft.createElement(Vo,{appearance:o,steps:Ie(),selectedStep:M,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>we(_[M]),tooltipPosition:c,completedStepsCount:N(e),showHighlightOnly:a,onComplete:me,cssPosition:S,...w}))}return S==="static"?re():ft.createElement(Qd,null,re())};import Ne,{useEffect as Rd,useRef as ec,useState as tc}from"react";import{Portal as oc}from"react-portal";import Pt from"styled-components";var Vs=Pt.button`
1445
+ ${e=>T(e)} {
1428
1446
  // Anything inside this block will be ignored if the user provides a custom class
1429
1447
 
1430
1448
  display: flex;
@@ -1441,17 +1459,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1441
1459
  opacity: 0.8;
1442
1460
  }
1443
1461
  }
1444
- `,Vs=Pt.span`
1445
- ${e=>k(e)} {
1462
+ `,Gs=Pt.span`
1463
+ ${e=>T(e)} {
1446
1464
  font-size: 12px;
1447
1465
  display: inline-block;
1448
1466
  }
1449
- `,Gs=Pt.span`
1450
- ${e=>k(e)} {
1467
+ `,Ks=Pt.span`
1468
+ ${e=>T(e)} {
1451
1469
  font-size: 12px;
1452
1470
  display: inline-block;
1453
1471
  }
1454
- `,Ks=Pt.div`
1472
+ `,qs=Pt.div`
1455
1473
  position: fixed;
1456
1474
  right: 0;
1457
1475
  bottom: 0;
@@ -1461,8 +1479,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1461
1479
  flex-direction: column;
1462
1480
  align-items: flex-end;
1463
1481
  z-index: 50;
1464
- `,qs=Pt.button`
1465
- ${e=>k(e)} {
1482
+ `,Ys=Pt.button`
1483
+ ${e=>T(e)} {
1466
1484
  // Anything inside this block will be ignored if the user provides a custom class
1467
1485
  background-color: #ffffff;
1468
1486
  border: 1px solid #f5f5f5;
@@ -1477,8 +1495,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1477
1495
  0px 3px 6px -4px rgba(0, 0, 0, 0.12);
1478
1496
  border-radius: 45px;
1479
1497
  cursor: pointer;
1480
- `,Ys=Pt.div`
1481
- ${e=>k(e)} {
1498
+ `,Xs=Pt.div`
1499
+ ${e=>T(e)} {
1482
1500
  // Anything inside this block will be ignored if the user provides a custom class
1483
1501
  background: #ffffff;
1484
1502
  }
@@ -1494,8 +1512,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1494
1512
  position: ${e=>e.type=="inline"?"absolute":"relative"};
1495
1513
  top: ${e=>e.type=="inline"?"68px":0};
1496
1514
  margin-left: ${e=>e.type=="inline"?"-127px":0};
1497
- `,Xs=Pt.button`
1498
- ${e=>k(e)} {
1515
+ `,Js=Pt.button`
1516
+ ${e=>T(e)} {
1499
1517
  // Anything inside this block will be ignored if the user provides a custom class
1500
1518
  color: #434343;
1501
1519
  :hover {
@@ -1511,8 +1529,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1511
1529
  font-size: 14px;
1512
1530
 
1513
1531
  padding: 8px 12px;
1514
- `;import Js from"react";var Qs=({style:e,className:t})=>Js.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Js.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 Zs from"react";var Rs=({style:e,className:t})=>Zs.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"},Zs.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 ec=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:a,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:S}=Y(),{primaryCTAClickSideEffects:w}=ie(),P=Qd(null),[f,E]=Zd(!1),{mergeAppearanceWithDefault:b}=Q();s=b(s),Jd(()=>(document.addEventListener("click",y,!1),()=>{document.removeEventListener("click",y,!1)}),[]);let y=T=>{P.current&&!P.current.contains(T.target)&&E(!1)};if(x)return null;let A=p(e);if(!A||S(A))return null;let h=c(e);if(!h||!i)return null;function m(T,F){!T.completionCriteria&&(T.autoMarkCompleted||T.autoMarkCompleted===void 0)&&a(e,T.id),w(T),o&&o(T,F),E(!1)}function B(){return f&&Ne.createElement(Ys,{className:l("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},h.map((T,F)=>Ne.createElement(Xs,{className:l("floatingWidgetMenuItem",s),key:F,onClick:()=>m(T,F)},T.title)))}return r=="inline"?Ne.createElement("span",{ref:P},Ne.createElement(js,{style:t,onClick:()=>{E(!f)},className:l("supportButton",s)},Ne.createElement(Gs,{className:l("supportIconContainer",s)},Ne.createElement(Rs,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),Ne.createElement(Vs,{className:l("supportButtonTitle",s)},n)),Ne.createElement(B,null)):Ne.createElement(Rd,null,Ne.createElement(Ks,{style:t,ref:P},Ne.createElement(B,null),Ne.createElement(qs,{onClick:()=>{E(!f)},whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},Ne.createElement(Qs,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import qe,{useEffect as tc}from"react";import Go from"styled-components";var el=Go.div`
1515
- ${e=>k(e)} {
1532
+ `;import Qs from"react";var Zs=({style:e,className:t})=>Qs.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Qs.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 Rs from"react";var el=({style:e,className:t})=>Rs.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"},Rs.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 rc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:a,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:S}=Y(),{primaryCTAClickSideEffects:w}=ie(),P=ec(null),[f,E]=tc(!1),{mergeAppearanceWithDefault:b}=Q();s=b(s),Rd(()=>(document.addEventListener("click",y,!1),()=>{document.removeEventListener("click",y,!1)}),[]);let y=F=>{P.current&&!P.current.contains(F.target)&&E(!1)};if(x)return null;let A=p(e);if(!A||S(A))return null;let h=c(e);if(!h||!i)return null;function m(F,k){!F.completionCriteria&&(F.autoMarkCompleted||F.autoMarkCompleted===void 0)&&a(e,F.id),w(F),o&&o(F,k),E(!1)}function B(){return f&&Ne.createElement(Xs,{className:l("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},h.map((F,k)=>Ne.createElement(Js,{className:l("floatingWidgetMenuItem",s),key:k,onClick:()=>m(F,k)},F.title)))}return r=="inline"?Ne.createElement("span",{ref:P},Ne.createElement(Vs,{style:t,onClick:()=>{E(!f)},className:l("supportButton",s)},Ne.createElement(Ks,{className:l("supportIconContainer",s)},Ne.createElement(el,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),Ne.createElement(Gs,{className:l("supportButtonTitle",s)},n)),Ne.createElement(B,null)):Ne.createElement(oc,null,Ne.createElement(qs,{style:t,ref:P},Ne.createElement(B,null),Ne.createElement(Ys,{onClick:()=>{E(!f)},whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},Ne.createElement(Zs,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import qe,{useEffect as ic}from"react";import Go from"styled-components";var tl=Go.div`
1533
+ ${e=>T(e)} {
1516
1534
  display: flex;
1517
1535
  flex-direction: column;
1518
1536
  width: 100%;
@@ -1526,18 +1544,18 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1526
1544
  border-radius: 12px;
1527
1545
  position: relative;
1528
1546
  }
1529
- `,tl=Go.div`
1547
+ `,ol=Go.div`
1530
1548
  display: flex;
1531
1549
  flex-direction: column;
1532
1550
  flex: 1;
1533
- `,ol=Go.div`
1551
+ `,rl=Go.div`
1534
1552
  display: flex;
1535
1553
  flex-direction: column;
1536
1554
  justify-content: center;
1537
1555
  align-items: flex-start;
1538
1556
  margin-top: 16px;
1539
- `,rl=Go.div`
1540
- ${e=>k(e)} {
1557
+ `,il=Go.div`
1558
+ ${e=>T(e)} {
1541
1559
  position: absolute;
1542
1560
  top: 16px;
1543
1561
  right: 16px;
@@ -1547,9 +1565,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1547
1565
  opacity: 0.8;
1548
1566
  }
1549
1567
  }
1550
- `;var oc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:S,getFlowSteps:w,getFlowStatus:P,getCurrentStepIndex:f}=Y(),{primaryCTAClickSideEffects:E}=ie(),{mergeAppearanceWithDefault:b}=Q();if(r=b(r),tc(()=>{S(o)},[o,d]),d)return null;let y=c(e);if(!y||x(y)||P(e)===q)return null;let h=w(e)[f(e)];return qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:r}),qe.createElement(el,{appearance:r,className:xe(l("embeddedTipContainer",r),n),style:s},(p===!0||h.dismissible)&&qe.createElement(rl,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",r)},qe.createElement(Fe,null)),qe.createElement(tl,null,qe.createElement(ke,{size:"small",appearance:r,title:h.title,subtitle:h.subtitle})),h.primaryButtonTitle&&qe.createElement(ol,{className:l("embeddedTipCallToActionContainer",r)},qe.createElement(Z,{classPrefix:"embeddedTip",title:h.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{h.handlePrimaryButtonClick(),E(h),!(i&&i(h,f(e),"primary")===!1)&&(await g(e,h.id),await a(e))}}))))};import Se,{useEffect as rc}from"react";import Gt from"styled-components";var il=Gt.div`
1568
+ `;var nc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:S,getFlowSteps:w,getFlowStatus:P,getCurrentStepIndex:f}=Y(),{primaryCTAClickSideEffects:E}=ie(),{mergeAppearanceWithDefault:b}=Q();if(r=b(r),ic(()=>{S(o)},[o,d]),d)return null;let y=c(e);if(!y||x(y)||P(e)===q)return null;let h=w(e)[f(e)];return qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:r}),qe.createElement(tl,{appearance:r,className:xe(l("embeddedTipContainer",r),n),style:s},(p===!0||h.dismissible)&&qe.createElement(il,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",r)},qe.createElement(Fe,null)),qe.createElement(ol,null,qe.createElement(ke,{size:"small",appearance:r,title:h.title,subtitle:h.subtitle})),h.primaryButtonTitle&&qe.createElement(rl,{className:l("embeddedTipCallToActionContainer",r)},qe.createElement(Z,{classPrefix:"embeddedTip",title:h.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{h.handlePrimaryButtonClick(),E(h),!(i&&i(h,f(e),"primary")===!1)&&(await g(e,h.id),await a(e))}}))))};import Se,{useEffect as sc}from"react";import Gt from"styled-components";var nl=Gt.div`
1551
1569
  // use the :not annotation
1552
- ${e=>k(e)} {
1570
+ ${e=>T(e)} {
1553
1571
  display: flex;
1554
1572
  flex-direction: ${e=>e.type==="square"?"column":"row"};
1555
1573
  width: 100%;
@@ -1559,19 +1577,19 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1559
1577
  background-color: ${e=>e.appearance.theme.colorBackground};
1560
1578
  border-radius: 12px;
1561
1579
  }
1562
- `,nl=Gt.div`
1563
- ${e=>k(e)} {
1580
+ `,sl=Gt.div`
1581
+ ${e=>T(e)} {
1564
1582
  display: flex;
1565
1583
  width: 46px;
1566
1584
  height: 46px;
1567
1585
  }
1568
- `,sl=Gt.div`
1586
+ `,ll=Gt.div`
1569
1587
  display: flex;
1570
1588
  flex-direction: column;
1571
1589
  flex: 1;
1572
1590
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1573
1591
  margin-top: ${e=>e.type==="square"?"12px":"0"};
1574
- `,ll=Gt.div`
1592
+ `,al=Gt.div`
1575
1593
  display: flex;
1576
1594
  flex-direction: column;
1577
1595
  justify-content: center;
@@ -1589,7 +1607,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1589
1607
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1590
1608
  align-items: flex-end;
1591
1609
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1592
- `;import Br from"react";var al=({style:e,className:t})=>Br.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Br.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Br.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var ic=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:a,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:S,getFlowMetadata:w,getFlowStatus:P,getFlowSteps:f,getCurrentStepIndex:E}=Y(),{primaryCTAClickSideEffects:b}=ie(),{mergeAppearanceWithDefault:y}=Q();if(s=y(s),rc(()=>{S(r)},[r,d]),d)return null;let A=a(e);if(!A||x(A)||P(e)===q)return null;let h=f(e),m=h.length>0?h[E(e)]:w(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),Se.createElement(Se.Fragment,null,Se.createElement(oe,{appearance:s}),Se.createElement(il,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&Se.createElement(nl,{className:l("bannerIconContainer",s)},c||Se.createElement(al,null)),p==="square"&&m.dismissible&&Se.createElement(vr,{type:p,className:l("bannerDismissButtonContainer",s)},Se.createElement(Pr,{type:p,onClick:async()=>{await g(e),i&&i()},className:l("bannerDismissButton",s)},Se.createElement(Fe,null))),Se.createElement(sl,{type:p},Se.createElement(ke,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&Se.createElement(ll,{type:p,className:l("bannerCallToActionContainer",s)},Se.createElement(Z,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{b(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&Se.createElement(vr,{type:p,className:l("bannerDismissButtonContainer",s)},Se.createElement(Pr,{type:p,onClick:async()=>{await g(e),i&&i()},className:l("bannerDismissButton",s)},Se.createElement(Fe,null)))))};import R,{useEffect as nc}from"react";import{Portal as sc}from"react-portal";import it from"styled-components";var pl=it.div`
1610
+ `;import Br from"react";var pl=({style:e,className:t})=>Br.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Br.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Br.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var lc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:a,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:S,getFlowMetadata:w,getFlowStatus:P,getFlowSteps:f,getCurrentStepIndex:E}=Y(),{primaryCTAClickSideEffects:b}=ie(),{mergeAppearanceWithDefault:y}=Q();if(s=y(s),sc(()=>{S(r)},[r,d]),d)return null;let A=a(e);if(!A||x(A)||P(e)===q)return null;let h=f(e),m=h.length>0?h[E(e)]:w(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),Se.createElement(Se.Fragment,null,Se.createElement(oe,{appearance:s}),Se.createElement(nl,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&Se.createElement(sl,{className:l("bannerIconContainer",s)},c||Se.createElement(pl,null)),p==="square"&&m.dismissible&&Se.createElement(vr,{type:p,className:l("bannerDismissButtonContainer",s)},Se.createElement(Pr,{type:p,onClick:async()=>{await g(e),i&&i()},className:l("bannerDismissButton",s)},Se.createElement(Fe,null))),Se.createElement(ll,{type:p},Se.createElement(ke,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&Se.createElement(al,{type:p,className:l("bannerCallToActionContainer",s)},Se.createElement(Z,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{b(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&Se.createElement(vr,{type:p,className:l("bannerDismissButtonContainer",s)},Se.createElement(Pr,{type:p,onClick:async()=>{await g(e),i&&i()},className:l("bannerDismissButton",s)},Se.createElement(Fe,null)))))};import R,{useEffect as ac}from"react";import{Portal as pc}from"react-portal";import nt from"styled-components";var dl=nt.div`
1593
1611
  display: flex;
1594
1612
  flex-direction: column;
1595
1613
  width: 100%;
@@ -1608,7 +1626,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1608
1626
  z-index: 1000;
1609
1627
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
1610
1628
  min-width: 550px;
1611
- `,dl=it.button`
1629
+ `,cl=nt.button`
1612
1630
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1613
1631
  border-radius: 8px;
1614
1632
  // If selected make border color primary and text color color priamry
@@ -1629,34 +1647,34 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1629
1647
  display: flex;
1630
1648
  justify-content: center;
1631
1649
  align-items: center;
1632
- `,Er=it.div`
1650
+ `,Er=nt.div`
1633
1651
  display: flex;
1634
1652
  justify-content: space-between;
1635
1653
  margin-top: 16px;
1636
1654
  gap: 8px;
1637
- `,cl=it.div`
1655
+ `,ml=nt.div`
1638
1656
  display: flex;
1639
1657
  justify-content: space-between;
1640
1658
  margin-top: 8px;
1641
- `,Ar=it.div`
1659
+ `,Ar=nt.div`
1642
1660
  font-size: 12px;
1643
1661
  line-height: 18px;
1644
1662
  color: ${e=>e.appearance.theme.colorTextDisabled};
1645
1663
  font-style: normal;
1646
1664
  font-weight: 400;
1647
1665
  letter-spacing: 0.24px;
1648
- `,Nr=it.div`
1666
+ `,Nr=nt.div`
1649
1667
  display: flex;
1650
1668
  flex-direction: column;
1651
1669
  flex: 1;
1652
- `,Mb=it.div`
1670
+ `,Wb=nt.div`
1653
1671
  display: flex;
1654
1672
  flex-direction: column;
1655
1673
  justify-content: center;
1656
1674
  align-items: flex-start;
1657
1675
  margin-top: 16px;
1658
- `,ml=it.textarea`
1659
- ${e=>k(e)} {
1676
+ `,ul=nt.textarea`
1677
+ ${e=>T(e)} {
1660
1678
  margin-top: 16px;
1661
1679
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1662
1680
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
@@ -1666,8 +1684,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1666
1684
  width: 100%;
1667
1685
  height: 100px;
1668
1686
  }
1669
- `,ul=it.div`
1670
- ${e=>k(e)} {
1687
+ `,fl=nt.div`
1688
+ ${e=>T(e)} {
1671
1689
  position: absolute;
1672
1690
  top: 16px;
1673
1691
  right: 16px;
@@ -1677,8 +1695,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1677
1695
  opacity: 0.8;
1678
1696
  }
1679
1697
  }
1680
- `;var lc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:P,getFlowStatus:f,getCurrentStepIndex:E}=Y(),{primaryCTAClickSideEffects:b}=ie(),{mergeAppearanceWithDefault:y}=Q(),[A,h]=R.useState(null),[m,B]=R.useState(""),{hasOpenModals:T,setKeepCompletedFlowOpenDuringSession:F,shouldKeepCompletedFlowOpenDuringSession:O}=Te();if(r=y(r),nc(()=>{w(o)},[o,x]),x)return null;let N=c(e);if(!N||S(N)||f(e)===q||d(e)===1&&!O(e)||T())return null;let $=P(e)[d(e)];function D(){return R.createElement(R.Fragment,null,R.createElement(Nr,null,R.createElement(ke,{size:"large",appearance:r,title:$.title,subtitle:$.subtitle})),R.createElement(Er,{className:l("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(te=>R.createElement(dl,{className:l("npsNumberButton",r),selected:A===te+1,key:te,onClick:async()=>{F(e),h(te+1),await g(e,$.id,{score:te+1})},appearance:r},te+1))),R.createElement(cl,{appearance:r},R.createElement(Ar,{appearance:r},"Not likely at all"),R.createElement(Ar,{appearance:r},"Extremely likely")))}function ee(){return R.createElement(R.Fragment,null,R.createElement(Nr,null,R.createElement(ke,{appearance:r,title:$.title??"Why did you choose this score?",size:"large"})),R.createElement(ml,{appearance:r,value:m,onChange:te=>{B(te.target.value)},placeHolder:"Add your optional fedback here..."}),R.createElement(Er,{appearance:r,className:l("npsNumberButtonContainer",r)},R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await a(e),i&&i($,1,"primary")},appearance:r,title:$.secondaryButtonTitle||"Skip",secondary:!0}),R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await g(e,$.id,{feedbackText:m}),await a(e),i&&i($,1,"primary")},appearance:r,title:$.primaryButtonTitle||"Submit"})))}function M(){return d(e)>=2?null:R.createElement(R.Fragment,null,R.createElement(oe,{appearance:r}),R.createElement(pl,{appearance:r,className:xe(l("npsSurveyContainer",r),n),style:s,type:p},R.createElement(ul,{onClick:async()=>{await a(e),t&&t()},className:l("npsSurveyDismissButton",r)},R.createElement(Fe,null)),d(e)==0&&D(),d(e)==1&&ee()))}return p==="inline"?M():R.createElement(sc,null,M())};import be,{useEffect as dc}from"react";import vt from"styled-components";var fl=vt.div`
1681
- ${e=>k(e)} {
1698
+ `;var dc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:P,getFlowStatus:f,getCurrentStepIndex:E}=Y(),{primaryCTAClickSideEffects:b}=ie(),{mergeAppearanceWithDefault:y}=Q(),[A,h]=R.useState(null),[m,B]=R.useState(""),{hasOpenModals:F,setKeepCompletedFlowOpenDuringSession:k,shouldKeepCompletedFlowOpenDuringSession:O}=Te();if(r=y(r),ac(()=>{w(o)},[o,x]),x)return null;let N=c(e);if(!N||S(N)||f(e)===q||d(e)===1&&!O(e)||F())return null;let $=P(e)[d(e)];function D(){return R.createElement(R.Fragment,null,R.createElement(Nr,null,R.createElement(ke,{size:"large",appearance:r,title:$.title,subtitle:$.subtitle})),R.createElement(Er,{className:l("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(te=>R.createElement(cl,{className:l("npsNumberButton",r),selected:A===te+1,key:te,onClick:async()=>{k(e),h(te+1),await g(e,$.id,{score:te+1})},appearance:r},te+1))),R.createElement(ml,{appearance:r},R.createElement(Ar,{appearance:r},"Not likely at all"),R.createElement(Ar,{appearance:r},"Extremely likely")))}function ee(){return R.createElement(R.Fragment,null,R.createElement(Nr,null,R.createElement(ke,{appearance:r,title:$.title??"Why did you choose this score?",size:"large"})),R.createElement(ul,{appearance:r,value:m,onChange:te=>{B(te.target.value)},placeHolder:"Add your optional fedback here..."}),R.createElement(Er,{appearance:r,className:l("npsNumberButtonContainer",r)},R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await a(e),i&&i($,1,"primary")},appearance:r,title:$.secondaryButtonTitle||"Skip",secondary:!0}),R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await g(e,$.id,{feedbackText:m}),await a(e),i&&i($,1,"primary")},appearance:r,title:$.primaryButtonTitle||"Submit"})))}function M(){return d(e)>=2?null:R.createElement(R.Fragment,null,R.createElement(oe,{appearance:r}),R.createElement(dl,{appearance:r,className:xe(l("npsSurveyContainer",r),n),style:s,type:p},R.createElement(fl,{onClick:async()=>{await a(e),t&&t()},className:l("npsSurveyDismissButton",r)},R.createElement(Fe,null)),d(e)==0&&D(),d(e)==1&&ee()))}return p==="inline"?M():R.createElement(pc,null,M())};import be,{useEffect as uc}from"react";import vt from"styled-components";var gl=vt.div`
1699
+ ${e=>T(e)} {
1682
1700
  display: flex;
1683
1701
  flex-direction: column;
1684
1702
  width: 100%;
@@ -1688,22 +1706,22 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1688
1706
  background-color: ${e=>e.appearance.theme.colorBackground};
1689
1707
  position: relative;
1690
1708
  }
1691
- `,gl=vt.div`
1709
+ `,xl=vt.div`
1692
1710
  display: flex;
1693
1711
  flex-direction: column;
1694
1712
  flex: 1;
1695
- `,xl=vt.div`
1713
+ `,hl=vt.div`
1696
1714
  display: flex;
1697
1715
  flex-direction: row;
1698
1716
  justify-content: center;
1699
1717
  align-items: stretch;
1700
1718
  gap: 16px;
1701
1719
  margin-top: 8px;
1702
- `,hl=vt.div`
1720
+ `,Cl=vt.div`
1703
1721
  margin-top: 16px;
1704
1722
  margin-bottom: 16px;
1705
- `,Cl=vt.div`
1706
- ${e=>k(e)} {
1723
+ `,yl=vt.div`
1724
+ ${e=>T(e)} {
1707
1725
  position: absolute;
1708
1726
  top: -16px;
1709
1727
  right: -16px;
@@ -1713,8 +1731,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1713
1731
  opacity: 0.8;
1714
1732
  }
1715
1733
  }
1716
- `,yl=vt.h1`
1717
- ${e=>k(e)} {
1734
+ `,Sl=vt.h1`
1735
+ ${e=>T(e)} {
1718
1736
  font-style: normal;
1719
1737
  justify-content: center;
1720
1738
  text-align: center;
@@ -1727,8 +1745,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1727
1745
  color: ${e=>e.appearance.theme.colorText};
1728
1746
  margin-bottom: 8px;
1729
1747
  }
1730
- `,Sl=vt.h2`
1731
- ${e=>k(e)} {
1748
+ `,bl=vt.h2`
1749
+ ${e=>T(e)} {
1732
1750
  font-style: normal;
1733
1751
  justify-content: center;
1734
1752
  text-align: center;
@@ -1739,10 +1757,10 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Xt}${r}.${Xt}${r} { ${Object.entries(n).map
1739
1757
  letter-spacing: 0.28px;
1740
1758
  margin-bottom: 8px;
1741
1759
  }
1742
- `;import bl from"react";import ac from"styled-components";var pc=ac.img`
1760
+ `;import wl from"react";import cc from"styled-components";var mc=cc.img`
1743
1761
  width: 100%;
1744
1762
  height: 100%;
1745
1763
  min-height: 200px;
1746
1764
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
1747
- `;function wl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?bl.createElement(Ve,{appearance:t,videoUri:e.videoUri}):e.imageUri?bl.createElement(pc,{className:l(`${o}image`,t),appearance:t,src:e.imageUri}):null}var cc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:a,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:P,getFlowStatus:f,getCurrentStepIndex:E}=Y(),{primaryCTAClickSideEffects:b,secondaryCTAClickSideEffects:y}=ie(),{mergeAppearanceWithDefault:A}=Q(),{setOpenFlowState:h,getOpenFlowState:m,hasOpenModals:B}=Te(),[T,F]=[m(e,!0),M=>h(e,M)];if(r=A(r),dc(()=>{w(o)},[o,x]),x)return null;let O=a(e);if(!O||S(O)||f(e)===q||B())return null;let I=P(e)[E(e)],$=()=>{F(!1),t&&t(),g(e)};function D(){return be.createElement(be.Fragment,null,be.createElement(oe,{appearance:r}),be.createElement(fl,{appearance:r,className:xe(l("announcementContainer",r),n),style:s},(p===!0||I.dismissible)&&c=="inline"&&be.createElement(Cl,{onClick:async()=>{await g(e),t&&t()},className:l("announcementDismissButton",r)},be.createElement(Fe,null)),be.createElement(gl,null,be.createElement(yl,{appearance:r,className:l("announcementTitle",r),dangerouslySetInnerHTML:le(I.title)}),I.subtitle&&be.createElement(Sl,{appearance:r,className:l("announcementSubtitle",r),dangerouslySetInnerHTML:le(I.subtitle)})),(I.imageUri||I.videoUri)&&be.createElement(hl,{className:l("announcementMediaContainer",r)},be.createElement(wl,{appearance:r,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&be.createElement(xl,{className:l("announcementCTAContainer",r)},I.secondaryButtonTitle&&be.createElement(Z,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handleSecondaryButtonClick(),y(I),i&&i(I,E(e),"secondary")},secondary:!0}),I.primaryButtonTitle&&be.createElement(Z,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handlePrimaryButtonClick(),b(I),!(i&&i(I,E(e),"primary")===!1)&&(await d(e,I.id),await g(e))}}))))}let ee={padding:"24px",maxWidth:"400px"};return c==="inline"?D():c!=="center"?be.createElement(bo,{modalPosition:c,onClose:$,visible:T,dismissible:p,appearance:r},D()):be.createElement(He,{appearance:r,onClose:$,visible:T,style:ee,dismissible:p},D())};import*as Ko from"react";import Tl from"react";var Fl=({as:e="span",children:t,variant:o="Body1",...i})=>Tl.createElement(qi,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),mc=Object.fromEntries(Object.keys(Lo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>Tl.createElement(Fl,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),Ir=Object.assign(Fl,mc);var kl=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return Ko.createElement(Ki,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},Ko.createElement(Ir,{color:(s=so[r])==null?void 0:s.color,fontWeight:"semibold"},i))},uc=Object.fromEntries(Object.keys(so).map(e=>{let t=o=>Ko.createElement(kl,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),fc=Object.assign(kl,uc);export{no as Box,fc as Button,Qe as CheckBox,lt as FormLabel,or as FormTextField,cc as FrigadeAnnouncement,ic as FrigadeBanner,Fr as FrigadeChecklist,Je as FrigadeDefaultAppearance,oc as FrigadeEmbeddedTip,Mi as FrigadeForm,Dd as FrigadeGuide,Nd as FrigadeHeroChecklist,lc as FrigadeNPSSurvey,Od as FrigadeProgressBadge,Wp as FrigadeProvider,ec as FrigadeSupportWidget,Xd as FrigadeTour,Ot as ProgressRing,Ir as Text,gr as tokens,Te as useFlowOpens,qt as useFlowResponses,Y as useFlows,mr as useOrganization,Yt as useUser,Ee as useUserFlowStates};
1765
+ `;function Tl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?wl.createElement(Ve,{appearance:t,videoUri:e.videoUri}):e.imageUri?wl.createElement(mc,{className:l(`${o}image`,t),appearance:t,src:e.imageUri}):null}var fc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:a,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:P,getFlowStatus:f,getCurrentStepIndex:E}=Y(),{primaryCTAClickSideEffects:b,secondaryCTAClickSideEffects:y}=ie(),{mergeAppearanceWithDefault:A}=Q(),{setOpenFlowState:h,getOpenFlowState:m,hasOpenModals:B}=Te(),[F,k]=[m(e,!0),M=>h(e,M)];if(r=A(r),uc(()=>{w(o)},[o,x]),x)return null;let O=a(e);if(!O||S(O)||f(e)===q||B())return null;let I=P(e)[E(e)],$=()=>{k(!1),t&&t(),g(e)};function D(){return be.createElement(be.Fragment,null,be.createElement(oe,{appearance:r}),be.createElement(gl,{appearance:r,className:xe(l("announcementContainer",r),n),style:s},(p===!0||I.dismissible)&&c=="inline"&&be.createElement(yl,{onClick:async()=>{await g(e),t&&t()},className:l("announcementDismissButton",r)},be.createElement(Fe,null)),be.createElement(xl,null,be.createElement(Sl,{appearance:r,className:l("announcementTitle",r),dangerouslySetInnerHTML:le(I.title)}),I.subtitle&&be.createElement(bl,{appearance:r,className:l("announcementSubtitle",r),dangerouslySetInnerHTML:le(I.subtitle)})),(I.imageUri||I.videoUri)&&be.createElement(Cl,{className:l("announcementMediaContainer",r)},be.createElement(Tl,{appearance:r,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&be.createElement(hl,{className:l("announcementCTAContainer",r)},I.secondaryButtonTitle&&be.createElement(Z,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handleSecondaryButtonClick(),y(I),i&&i(I,E(e),"secondary")},secondary:!0}),I.primaryButtonTitle&&be.createElement(Z,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handlePrimaryButtonClick(),b(I),!(i&&i(I,E(e),"primary")===!1)&&(await d(e,I.id),await g(e))}}))))}let ee={padding:"24px",maxWidth:"400px"};return c==="inline"?D():c!=="center"?be.createElement(bo,{modalPosition:c,onClose:$,visible:F,dismissible:p,appearance:r},D()):be.createElement(He,{appearance:r,onClose:$,visible:F,style:ee,dismissible:p},D())};import*as Ko from"react";import Fl from"react";var kl=({as:e="span",children:t,variant:o="Body1",...i})=>Fl.createElement(Yi,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),gc=Object.fromEntries(Object.keys(Lo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>Fl.createElement(kl,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),Ir=Object.assign(kl,gc);var Pl=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return Ko.createElement(qi,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},Ko.createElement(Ir,{color:(s=so[r])==null?void 0:s.color,fontWeight:"semibold"},i))},xc=Object.fromEntries(Object.keys(so).map(e=>{let t=o=>Ko.createElement(Pl,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),hc=Object.assign(Pl,xc);export{no as Box,hc as Button,Ze as CheckBox,lt as FormLabel,or as FormTextField,fc as FrigadeAnnouncement,lc as FrigadeBanner,Fr as FrigadeChecklist,Qe as FrigadeDefaultAppearance,nc as FrigadeEmbeddedTip,Ui as FrigadeForm,Ud as FrigadeGuide,Ld as FrigadeHeroChecklist,dc as FrigadeNPSSurvey,$d as FrigadeProgressBadge,Vp as FrigadeProvider,rc as FrigadeSupportWidget,Zd as FrigadeTour,Ot as ProgressRing,Ir as Text,gr as tokens,Te as useFlowOpens,qt as useFlowResponses,Y as useFlows,mr as useOrganization,Yt as useUser,Ee as useUserFlowStates};
1748
1766
  //# sourceMappingURL=index.mjs.map