@frigade/react 1.35.19 → 1.35.21

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 wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import{ThemeProvider as Kp}from"styled-components";import bt,{useContext as Sp,useEffect as Lo,useState as br}from"react";import{useCallback as ht,useContext as Gl,useEffect as Kl}from"react";import Yo,{useMemo as Hr}from"react";var _r="1.35.19 ";var Ne="NOT_STARTED_STEP",q="COMPLETED_FLOW",xo="ABORTED_FLOW",xt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",ho="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=Yo.useContext(K);return{config:Hr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":_r,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Hr(()=>`${o}/v1/public/`,[o])}}var Ol="frigade-last-call-at-",Ll="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Yo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let r=Ol+o,n=Ll+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 l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return It()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return It(p)}return s?s.ok?s:It(s.statusText):It()}}function It(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ot(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Yo.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 Hl,useState as jr}from"react";import{useContext as $l,useEffect as Ml,useState as Ul}from"react";import zl from"swr";import{useContext as Dl}from"react";function we(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Dl(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(F=>({...F,[d]:x}))}function p(d){t(x=>{let{[d]:F,...C}=x;return{...C}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,F])=>F&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Wl from"swr/immutable";var _l="unknown";function Be(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=$l(K),{resetOpenFlowState:c}=we(),[l,g]=Ul(!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(B=>{if(B.ok)return B.json();throw new Error("Failed to fetch user flow states")}).catch(B=>(console.log(`Error fetching ${T}: ${B}. Will gracefully degrade and hide Frigade`),s(!0),d)),F=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:C,isLoading:S,mutate:f,error:v}=p?Wl(F,x):zl(F,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=C==null?void 0:C.data;Ml(()=>{!l&&!S&&w&&g(!0)},[w,l,S]);async function b(T){if(w&&!p){let B=w.find(L=>L.flowId===T);B&&B.flowState!==q&&(B.flowState=q),await f(Promise.resolve({...C,data:w}),{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1})}}async function A(T,B,L){if(w){let N=w.find(I=>I.flowId===T);N&&(N.stepStates[B]=L,N.flowState=xt),await f(Promise.resolve({...C,data:w}),{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1})}}async function y(T,B,L){if(w){let N=w.find(I=>I.flowId===T);N&&(N.lastStepId=B,N.stepStates[B]=L,N.flowState=xt),await f({...C,data:w},{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1})}}async function m(T){if(w){let B=w.find(L=>L.flowId===T);B&&B.flowState!==Me&&(B.flowState=Me,B.lastStepId=_l,Object.keys(B.stepStates).forEach(L=>{B.stepStates[L].actionType=Ne,B.stepStates[L].createdAt=new Date().toISOString()}),await f({...C,data:w},{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1}),c(T))}}async function E(T,B){if(w){let L=w.find(N=>N.flowId===T);L&&L.stepStates[B]!==Ne&&(L.stepStates[B]=Ne),await f({...C,data:w},{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!l,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:b,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:E,optimisticallyMarkStepStarted:y,error:v}}function Xt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Hl(K),[c,l]=jr(new Set),[g,d]=jr(new Set),x=Nt();function F(f){let v=JSON.stringify(f);if(c.has(v))return null;c.add(v),l(c),g.add(f),d(g);let w=s==null?void 0:s.find(b=>b.flowSlug===f.flowSlug&&b.stepId===f.stepId&&b.actionType===f.actionType&&b.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:v}).then(b=>{b.status!==200&&b.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):w||p(A=>[...A??[],f])})}async function C(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Me?await F(f):f.actionType===q?await F(f):f.actionType===ho?await F(f):f.actionType===Ue?await F(f):f.actionType===xo?await F(f):f.actionType===Ne&&await F(f))}function S(){let f=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let w in v.stepStates){let b=v.stepStates[w];f.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:b.stepId,actionType:b.actionType,data:{},createdAt:new Date(b.createdAt),blocked:b.blocked,hidden:b.hidden})}}),[...f,...s]}return{addResponse:C,setFlowResponses:p,getFlowResponses:S}}import ql from"swr";var jl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Vr=e=>{let t=jl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Vl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Vl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Xo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Jo=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(Jo||{});function Y(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Gl(K),F={data:[]},{verifySDKInitiated:C}=Ot(),{addResponse:S,getFlowResponses:f}=Xt(),v=u=>fetch(u,e).then(h=>h.ok?h.json():(console.log(`Error fetching ${u} (${h.status}): ${h.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),F)).catch(h=>(console.log(`Error fetching ${u}: ${h}. Will gracefully degrade and hide Frigade`),d(!0),F)),{mutateUserFlowState:w,userFlowStatesData:b,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:T,optimisticallyMarkStepStarted:B}=Be(),{data:L,error:N,isLoading:I}=ql(n?`${t}flows${x?"?readonly=true":""}`:null,v,{keepPreviousData:!0});Kl(()=>{if(N){console.error(N);return}L&&L.data&&i(L.data)},[L,N]);function $(u){if(I)return null;let h=o.find(P=>P.slug===u);return!h&&o.length>0&&!A&&!I?(console.log(`Flow with id ${u} not found`),null):(h==null?void 0:h.active)===!1?null:h}function D(u){var W;if(!$(u))return[];let h=$(u).data;return h?(h=ee(h),(((W=Xo(h))==null?void 0:W.data)??[]).map(M=>{let $e=se(M);return{handleSecondaryButtonClick:()=>{M.skippable===!0&&j(u,M.id,{skipped:!0})},...M,complete:ge(u,M.id)===Ue||$e>=1,blocked:re(u,M.id),hidden:O(u,M.id),handlePrimaryButtonClick:()=>{(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&j(u,M.id)},progress:$e}}).filter(M=>M.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(h,P)=>s[P]===void 0?"":String(s[P]).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 U(u){if(!$(u))return[];let h=$(u).data;return h?(h=ee(h),JSON.parse(h)??{}):[]}function te(u,h){p(P=>({...P,[u]:h}))}function fe(u){!A&&!I&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(h=>{te(h,u[h])})}let X=ht(async(u,h,P)=>{if(!C())return;let W={foreignUserId:r,flowSlug:u,stepId:h,actionType:ho,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await B(u,h,W),S(W))},[r,b]),H=ht(async(u,h,P)=>{if(!C())return;let W={foreignUserId:r,flowSlug:u,stepId:h,actionType:Ne,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await T(u,h),S(W))},[r,b]),j=ht(async(u,h,P)=>{if(!C())return;let W={foreignUserId:r,flowSlug:u,stepId:h,actionType:Ue,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await E(u,h,W),S(W))},[r,b]),Ce=ht(async(u,h)=>{if(!C()||pe(u)===Me)return;let P={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),J(P)&&S(P)},[r,b]),Ie=ht(async(u,h)=>{if(!C())return;let P={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&S(P)},[r,b]),be=ht(async(u,h)=>{if(!C())return;let P={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&(await y(u),S(P))},[r,b]),me=ht(async(u,h)=>{if(!C())return;let P={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xo,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&(await y(u),S(P))},[r,b]);function J(u){var h;if(!b&&u.actionType===Ne)return!1;if(b){let P=b.find(W=>W.flowId===u.flowSlug);if(u.actionType===Ne&&(!(P!=null&&P.stepStates[u.stepId])||P.stepStates[u.stepId].actionType===Ne)||P&&((h=P.stepStates[u.stepId])==null?void 0:h.actionType)===u.actionType||P&&P.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,h){let P=V(u,h);return A?null:P?P.actionType:Ne}function re(u,h){let P=V(u,h);return P?P.blocked:!1}function O(u,h){let P=V(u,h);return P?P.hidden:!1}function V(u,h){if(A)return null;let P=b==null?void 0:b.find(W=>W.flowId===u);return!P||!P.stepStates[h]?null:P.stepStates[h]??null}function G(u){var P;if(A||!b)return null;if(pe(u)===Me)return D(u)[0]??null;let h=(P=b.find(W=>W.flowId===u))==null?void 0:P.lastStepId;return h?D(u).find(W=>W.id===h):null}function ne(u){let h=G(u);if(!h)return 0;let P=D(u).findIndex(W=>W.id===h.id)??0;return ge(u,h.id)===Ue&&P<D(u).length-1?P+1:P}function se(u){if(!u.completionCriteria)return;let h=Vr(u.completionCriteria);if(h===null)return;let P=Ye(h),W=De(h);return W===0?void 0:P/W}function pe(u){let h=b==null?void 0:b.find(P=>P.flowId===u);return h?h.flowState:null}function Ye(u){let h=D(u);return h.length===0?0:h.filter(W=>ge(u,W.id)===Ue).length}function De(u){return D(u).length}function Et(u){let h=o.find(P=>P.slug===u);return h?Xo(h.data):null}function ft(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&b){let h=b.find(P=>P.flowId===u.slug);if(h)return h.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function At(u){return!ft($(u))}function gt(){r&&w()}return{getFlow:$,getFlowData:Et,isLoading:A||I,getStepStatus:ge,getFlowSteps:D,getCurrentStepIndex:ne,markStepStarted:X,markStepCompleted:j,markFlowNotStarted:Ce,markFlowStarted:Ie,markFlowCompleted:be,markFlowAborted:me,markStepNotStarted:H,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:De,targetingLogicShouldHideFlow:ft,setCustomVariable:te,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:U,isStepBlocked:re,isStepHidden:O,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as Qo,useContext as Yl,useEffect as Xl}from"react";var Lt="guest_";function Jt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Yl(K),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Be(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(C){return`frigade-user-registered-${C}`}Xl(()=>{if(e&&!t){if(e.startsWith(Lt))return;let C=g(e);localStorage.getItem(C)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(C,"true"))}},[e,r,t]);let d=Qo(async C=>{if(!l())return;let S={foreignId:e,properties:C};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),i(f=>({...f,...C})),p()},[e,n,r,p]),x=Qo(async(C,S)=>{if(!l())return;let v={foreignId:e,events:[{event:C,properties:S}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),p()},[e,n,p]),F=Qo(async(C,S)=>{if(l())if(S){let f=g(C);localStorage.setItem(f,"true"),o(C);let v={foreignId:C,properties:S};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),i(w=>({...w,...S})),p()}else o(C)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:F,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as bp}from"uuid";import Ge,{useEffect as xp,useState as hp}from"react";import ze,{useEffect as or,useState as ia}from"react";import So from"styled-components";import Jl from"react";import Ql from"styled-components";var Gr="fr-",Qt="cfr-";function a(e,t){let o=`${Gr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Qt+e}return o}function k(e){if(!e.className||e.className.indexOf(Qt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Gr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Zo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Zo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Zt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Zl=Ql.div`
2
+ import wt,{createContext as qp,useEffect as Mo,useState as Le}from"react";import{ThemeProvider as Yp}from"styled-components";import bt,{useContext as wp,useEffect as Do,useState as br}from"react";import{useCallback as ht,useContext as ql,useEffect as Yl}from"react";import Yo,{useMemo as jr}from"react";var Hr="1.35.21 ";var Oe="NOT_STARTED_STEP",X="COMPLETED_FLOW",ho="ABORTED_FLOW",xt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",Co="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=Yo.useContext(G);return{config:jr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Hr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:jr(()=>`${o}/v1/public/`,[o])}}var Dl="frigade-last-call-at-",$l="frigade-last-call-data-";function Ot(){let{shouldGracefullyDegrade:e,readonly:t}=Yo.useContext(G);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Nt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Nt();let r=Dl+o,n=$l+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 l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return Nt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return Nt(p)}return s?s.ok?s:Nt(s.statusText):Nt()}}function Nt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Lt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Yo.useContext(G);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 Vl,useState as Vr}from"react";import{useContext as Ul,useEffect as zl,useState as Wl}from"react";import _l from"swr";import{useContext as Ml}from"react";function be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Ml(G);function n(d,x=!1){return e[d]??x}function s(d,x){t(F=>({...F,[d]:x}))}function p(d){t(x=>{let{[d]:F,...y}=x;return{...y}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,F])=>F&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Hl from"swr/immutable";var jl="unknown";function Ee(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Ul(G),{resetOpenFlowState:c}=be(),[l,g]=Wl(!1),d={data:n.map(w=>({flowId:w.id,flowState:X,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=w=>fetch(w,e).then(E=>{if(E.ok)return E.json();throw new Error("Failed to fetch user flow states")}).catch(E=>(console.log(`Error fetching ${w}: ${E}. Will gracefully degrade and hide Frigade`),s(!0),d)),F=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:y,isLoading:S,mutate:f,error:B}=p?Hl(F,x):_l(F,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),T=y==null?void 0:y.data;zl(()=>{!l&&!S&&T&&g(!0)},[T,l,S]);async function h(w){if(T&&!p){let E=T.find(O=>O.flowId===w);E&&E.flowState!==X&&(E.flowState=X),await f(Promise.resolve({...y,data:T}),{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1})}}async function A(w,E,O){if(T){let N=T.find(I=>I.flowId===w);N&&(N.stepStates[E]=O,N.flowState=xt),await f(Promise.resolve({...y,data:T}),{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1})}}async function b(w,E,O){if(T){let N=T.find(I=>I.flowId===w);N&&(N.lastStepId=E,N.stepStates[E]=O,N.flowState=xt),await f({...y,data:T},{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1})}}async function m(w){if(T){let E=T.find(O=>O.flowId===w);E&&E.flowState!==Me&&(E.flowState=Me,E.lastStepId=jl,Object.keys(E.stepStates).forEach(O=>{E.stepStates[O].actionType=Oe,E.stepStates[O].createdAt=new Date().toISOString()}),await f({...y,data:T},{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1}),c(w))}}async function P(w,E){if(T){let O=T.find(N=>N.flowId===w);O&&O.stepStates[E]!==Oe&&(O.stepStates[E]=Oe),await f({...y,data:T},{optimisticData:{...y,data:T},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:T,isLoadingUserFlowStateData:!l,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:P,optimisticallyMarkStepStarted:b,error:B}}function Jt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Ee(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Vl(G),[c,l]=Vr(new Set),[g,d]=Vr(new Set),x=Ot();function F(f){let B=JSON.stringify(f);if(c.has(B))return null;c.add(B),l(c),g.add(f),d(g);let T=s==null?void 0:s.find(h=>h.flowSlug===f.flowSlug&&h.stepId===f.stepId&&h.actionType===f.actionType&&h.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:B}).then(h=>{h.status!==200&&h.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):T||p(A=>[...A??[],f])})}async function y(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Me?await F(f):f.actionType===X?await F(f):f.actionType===Co?await F(f):f.actionType===Ue?await F(f):f.actionType===ho?await F(f):f.actionType===Oe&&await F(f))}function S(){let f=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let T in B.stepStates){let h=B.stepStates[T];f.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:h.stepId,actionType:h.actionType,data:{},createdAt:new Date(h.createdAt),blocked:h.blocked,hidden:h.hidden})}}),[...f,...s]}return{addResponse:y,setFlowResponses:p,getFlowResponses:S}}import Xl from"swr";var Gl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Gr=e=>{let t=Gl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Kl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Kl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Xo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Jo=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(Jo||{});function J(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=ql(G),F={data:[]},{verifySDKInitiated:y}=Lt(),{addResponse:S,getFlowResponses:f}=Jt(),B=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),F)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),F)),{mutateUserFlowState:T,userFlowStatesData:h,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:b,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:w,optimisticallyMarkStepStarted:E}=Ee(),{data:O,error:N,isLoading:I}=Xl(n?`${t}flows${x?"?readonly=true":""}`:null,B,{keepPreviousData:!0});Yl(()=>{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 id ${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=K(C),(((_=Xo(C))==null?void 0:_.data)??[]).map(ce=>{let Y=ne(ce);return{handleSecondaryButtonClick:()=>{ce.skippable===!0&&V(u,ce.id,{skipped:!0})},...ce,complete:Fe(u,ce.id)===Ue||Y>=1,blocked:te(u,ce.id),hidden:L(u,ce.id),handlePrimaryButtonClick:()=>{(!ce.completionCriteria&&(ce.autoMarkCompleted||ce.autoMarkCompleted===void 0)||ce.completionCriteria&&ce.autoMarkCompleted===!0)&&V(u,ce.id)},progress:Y}}).filter(ce=>ce.hidden!==!0)):[]}function K(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 z(u){if(!$(u))return[];let C=$(u).data;return C?(C=K(C),JSON.parse(C)??{}):[]}function q(u,C){p(v=>({...v,[u]:C}))}function ue(u){!A&&!I&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{q(C,u[C])})}let fe=ht(async(u,C,v)=>{if(!y())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Co,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};Q(_)&&(await E(u,C,_),S(_))},[r,h]),W=ht(async(u,C,v)=>{if(!y())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Oe,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};Q(_)&&(await w(u,C),S(_))},[r,h]),V=ht(async(u,C,v)=>{if(!y())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ue,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};Q(_)&&(await P(u,C,_),S(_))},[r,h]),re=ht(async(u,C)=>{if(!y()||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),Q(v)&&S(v)},[r,h]),Ne=ht(async(u,C)=>{if(!y())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};Q(v)&&S(v)},[r,h]),Be=ht(async(u,C)=>{if(!y())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:X,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};Q(v)&&(await b(u),S(v))},[r,h]),xe=ht(async(u,C)=>{if(!y())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:ho,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};Q(v)&&(await b(u),S(v))},[r,h]);function Q(u){var C;if(!h&&u.actionType===Oe)return!1;if(h){let v=h.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===X&&u.actionType===X)return!1}return!0}function Fe(u,C){let v=M(u,C);return A?null:v?v.actionType:Oe}function te(u,C){let v=M(u,C);return v?v.blocked:!1}function L(u,C){let v=M(u,C);return v?v.hidden:!1}function M(u,C){if(A)return null;let v=h==null?void 0:h.find(_=>_.flowId===u);return!v||!v.stepStates[C]?null:v.stepStates[C]??null}function j(u){var v;if(A||!h)return null;if(pe(u)===Me)return D(u)[0]??null;let C=(v=h.find(_=>_.flowId===u))==null?void 0:v.lastStepId;return C?D(u).find(_=>_.id===C):null}function ae(u){let C=j(u);if(!C)return 0;let v=D(u).findIndex(_=>_.id===C.id)??0;return Fe(u,C.id)===Ue&&v<D(u).length-1?v+1:v}function ne(u){if(!u.completionCriteria)return;let C=Gr(u.completionCriteria);if(C===null)return;let v=Ye(C),_=$e(C);return _===0?void 0:v/_}function pe(u){let C=h==null?void 0:h.find(v=>v.flowId===u);return C?C.flowState:null}function Ye(u){let C=D(u);return C.length===0?0:C.filter(_=>Fe(u,_.id)===Ue).length}function $e(u){return D(u).length}function At(u){let C=o.find(v=>v.slug===u);return C?Xo(C.data):null}function ft(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&h){let C=h.find(v=>v.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function It(u){return!ft($(u))}function gt(){r&&T()}return{getFlow:$,getFlowData:At,isLoading:A||I,getStepStatus:Fe,getFlowSteps:D,getCurrentStepIndex:ae,markStepStarted:fe,markStepCompleted:V,markFlowNotStarted:re,markFlowStarted:Ne,markFlowCompleted:Be,markFlowAborted:xe,markStepNotStarted:W,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:$e,targetingLogicShouldHideFlow:ft,setCustomVariable:q,updateCustomVariables:ue,customVariables:s,getStepOptionalProgress:ne,getFlowMetadata:z,isStepBlocked:te,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:It,refresh:gt}}import{useCallback as Qo,useContext as Jl,useEffect as Ql}from"react";var Dt="guest_";function Qt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Jl(G),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Ee(),c=Ot(),{verifySDKInitiated:l}=Lt();function g(y){return`frigade-user-registered-${y}`}Ql(()=>{if(e&&!t){if(e.startsWith(Dt))return;let y=g(e);localStorage.getItem(y)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(y,"true"))}},[e,r,t]);let d=Qo(async y=>{if(!l())return;let S={foreignId:e,properties:y};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),i(f=>({...f,...y})),p()},[e,n,r,p]),x=Qo(async(y,S)=>{if(!l())return;let B={foreignId:e,events:[{event:y,properties:S}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),p()},[e,n,p]),F=Qo(async(y,S)=>{if(l())if(S){let f=g(y);localStorage.setItem(f,"true"),o(y);let B={foreignId:y,properties:S};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),i(T=>({...T,...S})),p()}else o(y)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:F,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as Tp}from"uuid";import Ge,{useEffect as Cp,useState as yp}from"react";import ze,{useEffect as or,useState as sa}from"react";import bo from"styled-components";import Zl from"react";import Rl from"styled-components";var Kr="fr-",Zt="cfr-";function a(e,t){let o=`${Kr}${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+" "+Zt+e}return o}function k(e){if(!e.className||e.className.indexOf(Zt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Kr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Zo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Zo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function he(...e){return e.filter(Boolean).join(" ")}function Rt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ea=Rl.div`
3
3
  display: flex;
4
4
  justify-content: center;
5
5
  position: fixed;
@@ -23,11 +23,11 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
23
23
  opacity: 1;
24
24
  }
25
25
  }
26
- `,Kr=({onClose:e,appearance:t})=>Jl.createElement(Zl,{className:a("modalBackground",t),onClick:()=>e()});import Ro from"react";import Rl from"styled-components";var ea=Rl.div`
26
+ `,qr=({onClose:e,appearance:t})=>Zl.createElement(ea,{className:a("modalBackground",t),onClick:()=>e()});import Ro from"react";import ta from"styled-components";var oa=ta.div`
27
27
  :hover {
28
28
  opacity: 0.8;
29
29
  }
30
- `,Te=()=>Ro.createElement(ea,null,Ro.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Ro.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as na}from"react-portal";import ni from"react";import er from"react";function ta({style:e,className:t}){return er.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},er.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"}),er.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 qr=ta;import tr from"styled-components";import Xe from"styled-components";var Co=Xe.div`
30
+ `,we=()=>Ro.createElement(oa,null,Ro.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Ro.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as la}from"react-portal";import si from"react";import er from"react";function ra({style:e,className:t}){return er.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},er.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"}),er.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 Yr=ra;import tr from"styled-components";import Xe from"styled-components";var yo=Xe.div`
31
31
  ${e=>k(e)} {
32
32
  background: ${e=>e.appearance.theme.colorBackground};
33
33
  }
@@ -38,7 +38,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
38
38
  min-width: 300px;
39
39
  z-index: ${e=>e.zIndex};
40
40
  overflow: hidden;
41
- `,oa=`
41
+ `,ia=`
42
42
  display: block;
43
43
  cursor: pointer;
44
44
  position: absolute;
@@ -48,19 +48,20 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
48
48
  border-radius: 100px;
49
49
  top: 12px;
50
50
  right: 12px;
51
+ box-sizing: border-box;
51
52
  :hover {
52
53
  opacity: 0.8;
53
- }`,ra=`
54
+ }`,na=`
54
55
  display: block;
55
56
  cursor: pointer;
56
57
  position: absolute;
57
58
  top: 12px;
58
59
  right: 12px;
59
- `,Yr=Xe.div`
60
+ `,Xr=Xe.div`
60
61
  ${e=>k(e)} {
61
- ${e=>e.hasImage?oa:ra};
62
+ ${e=>e.hasImage?ia:na};
62
63
  }
63
- `,Xr=Xe.img`
64
+ `,Jr=Xe.img`
64
65
  ${e=>k(e)} {
65
66
  display: block;
66
67
  width: 100%;
@@ -68,7 +69,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
68
69
  min-height: 200px;
69
70
  object-fit: cover;
70
71
  }
71
- `,Jr=Xe.div`
72
+ `,Qr=Xe.div`
72
73
  ${e=>k(e)} {
73
74
  display: block;
74
75
  width: 100%;
@@ -76,19 +77,19 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
76
77
  margin-top: ${e=>e.dismissible?"24px":"0px"};
77
78
  object-fit: cover;
78
79
  }
79
- `,Qr=Xe.div`
80
+ `,Zr=Xe.div`
80
81
  display: flex;
81
82
  flex-direction: row;
82
83
  justify-content: space-between;
83
84
  align-content: center;
84
- `,Zr=Xe.div`
85
- padding: 22px 22px 12px;
86
85
  `,Rr=Xe.div`
86
+ padding: 22px 22px 12px;
87
+ `,ei=Xe.div`
87
88
  display: flex;
88
89
  flex: 1;
89
90
  flex-direction: column;
90
91
  justify-content: center;
91
- `,ei=Xe.div`
92
+ `,ti=Xe.div`
92
93
  display: flex;
93
94
  flex: 2;
94
95
  flex-shrink: 1;
@@ -100,7 +101,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
100
101
  align-content: center;
101
102
  align-items: center;
102
103
  }
103
- `,ti=Xe.p`
104
+ `,oi=Xe.p`
104
105
  ${e=>k(e)} {
105
106
  font-style: normal;
106
107
  font-weight: 600;
@@ -109,7 +110,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
109
110
  color: #808080;
110
111
  }
111
112
  margin: 0;
112
- `;var oi=tr.div`
113
+ `;var ri=tr.div`
113
114
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
114
115
  position: absolute;
115
116
  bottom: -47px;
@@ -120,7 +121,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
120
121
  align-items: center;
121
122
  justify-content: center;
122
123
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
123
- `,ri=tr(Co)`
124
+ `,ii=tr(yo)`
124
125
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
125
126
  position: absolute;
126
127
  bottom: -60px;
@@ -133,7 +134,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
133
134
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
134
135
  padding: 0;
135
136
  z-index: ${e=>e.zIndex};
136
- `,ii=tr.div`
137
+ `,ni=tr.div`
137
138
  display: flex;
138
139
  justify-content: center;
139
140
  align-items: center;
@@ -142,7 +143,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
142
143
  font-size: 12px;
143
144
  line-height: 18px;
144
145
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
145
- `;function yo({appearance:e}){return ni.createElement(ii,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",ni.createElement(qr,null))}var sa=So.div`
146
+ `;function So({appearance:e}){return si.createElement(ni,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",si.createElement(Yr,null))}var aa=bo.div`
146
147
  ${e=>k(e)} {
147
148
  // Anything inside this block will be ignored if the user provides a custom class
148
149
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
@@ -184,10 +185,10 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
184
185
  opacity: 1;
185
186
  }
186
187
  }
187
- `,la=So.div`
188
+ `,pa=bo.div`
188
189
  position: relative;
189
190
  flex: 0 1 auto;
190
- `,aa=So.div`
191
+ `,da=bo.div`
191
192
  position: absolute;
192
193
  top: 16px;
193
194
  right: 16px;
@@ -197,14 +198,14 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
197
198
  // Anything inside this block will be ignored if the user provides a custom class
198
199
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
199
200
  }
200
- `,pa=So.div`
201
+ `,ca=bo.div`
201
202
  overflow: scroll;
202
203
  flex: 1 1;
203
204
  display: flex;
204
205
  ::-webkit-scrollbar {
205
206
  display: none;
206
207
  }
207
- `,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=ia("");return or(()=>{let g=getComputedStyle(document.body).getPropertyValue("overflow");l(g)},[]),or(()=>{let g=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[e]),or(()=>{let g=document.body.style;return t?g.setProperty("overflow","hidden"):g.setProperty("overflow",c),()=>{g.setProperty("overflow",c)}},[t]),t?ze.createElement(na,null,ze.createElement(Kr,{appearance:n,onClose:()=>{s&&e()}}),ze.createElement(sa,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&ze.createElement(aa,{className:a("modalClose",n),onClick:()=>e(),appearance:n},ze.createElement(Te,null)),o&&ze.createElement(la,null,o),ze.createElement(pa,null,r),p&&ze.createElement(oi,{appearance:n,className:a("poweredByFrigadeRibbon",n)},ze.createElement(yo,{appearance:n})))):ze.createElement(ze.Fragment,null)};import nt,{useEffect as rr,useState as da}from"react";import bo from"styled-components";import{Portal as ca}from"react-portal";function ma(e){switch(e){case"top-left":return`
208
+ `,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=sa("");return or(()=>{let g=getComputedStyle(document.body).getPropertyValue("overflow");l(g)},[]),or(()=>{let g=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[e]),or(()=>{let g=document.body.style;return t?g.setProperty("overflow","hidden"):g.setProperty("overflow",c),()=>{g.setProperty("overflow",c)}},[t]),t?ze.createElement(la,null,ze.createElement(qr,{appearance:n,onClose:()=>{s&&e()}}),ze.createElement(aa,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&ze.createElement(da,{className:a("modalClose",n),onClick:()=>e(),appearance:n},ze.createElement(we,null)),o&&ze.createElement(pa,null,o),ze.createElement(ca,null,r),p&&ze.createElement(ri,{appearance:n,className:a("poweredByFrigadeRibbon",n)},ze.createElement(So,{appearance:n})))):ze.createElement(ze.Fragment,null)};import st,{useEffect as rr,useState as ma}from"react";import wo from"styled-components";import{Portal as ua}from"react-portal";function fa(e){switch(e){case"top-left":return`
208
209
  top: 0;
209
210
  left: 0;
210
211
  `;case"top-right":return`
@@ -213,7 +214,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
213
214
  `;case"bottom-left":return`
214
215
  bottom: 0;
215
216
  left: 0;
216
- `}return"right: 0; bottom: 0;"}var ua=bo.div`
217
+ `}return"right: 0; bottom: 0;"}var ga=wo.div`
217
218
  ${e=>k(e)} {
218
219
  // Anything inside this block will be ignored if the user provides a custom class
219
220
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
@@ -227,12 +228,12 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
227
228
  width: 350px;
228
229
  padding: 24px;
229
230
  }
230
- ${e=>ma(e.modalPosition)}
231
+ ${e=>fa(e.modalPosition)}
231
232
  margin: 28px;
232
- `,fa=bo.div`
233
+ `,xa=wo.div`
233
234
  position: relative;
234
235
  flex: 1;
235
- `,ga=bo.div`
236
+ `,ha=wo.div`
236
237
  position: absolute;
237
238
  top: 16px;
238
239
  right: 16px;
@@ -242,13 +243,13 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
242
243
  // Anything inside this block will be ignored if the user provides a custom class
243
244
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
244
245
  }
245
- `,xa=bo.div`
246
+ `,Ca=wo.div`
246
247
  overflow: scroll;
247
248
  flex: 5;
248
249
  ::-webkit-scrollbar {
249
250
  display: none;
250
251
  }
251
- `,wo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=da("");return rr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");c(l)},[]),rr(()=>{let l=g=>{g.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),rr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?nt.createElement(ca,null,nt.createElement(ua,{appearance:r,className:a("cornerModalContainer",r),modalPosition:n},s&&nt.createElement(ga,{className:a("cornerModalClose",r),onClick:()=>e()},nt.createElement(Te,null)),o&&nt.createElement(fa,null,o),nt.createElement(xa,null,i))):nt.createElement(nt.Fragment,null)};import{useContext as ha}from"react";function Q(){let{defaultAppearance:e}=ha(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 Ct,{useContext as za,useEffect as Wa,useState as ur}from"react";import vo from"styled-components";import ko,{useEffect as ci,useState as sr}from"react";import lr from"styled-components";import To from"styled-components";var si=To.label`
252
+ `,To=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=ma("");return rr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");c(l)},[]),rr(()=>{let l=g=>{g.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),rr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?st.createElement(ua,null,st.createElement(ga,{appearance:r,className:a("cornerModalContainer",r),modalPosition:n},s&&st.createElement(ha,{className:a("cornerModalClose",r),onClick:()=>e()},st.createElement(we,null)),o&&st.createElement(xa,null,o),st.createElement(Ca,null,i))):st.createElement(st.Fragment,null)};import{useContext as ya}from"react";function Z(){let{defaultAppearance:e}=ya(G);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 Ct,{useContext as _a,useEffect as Ha,useState as ur}from"react";import Bo from"styled-components";import Po,{useEffect as mi,useState as sr}from"react";import lr from"styled-components";import Fo from"styled-components";var li=Fo.label`
252
253
  ${e=>k(e)} {
253
254
  font-size: 12px;
254
255
  line-height: 18px;
@@ -259,14 +260,14 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
259
260
  letter-spacing: 0.24px;
260
261
  }
261
262
  display: flex;
262
- `,li=To.label`
263
+ `,ai=Fo.label`
263
264
  ${e=>k(e)} {
264
265
  font-size: 12px;
265
266
  line-height: 20px;
266
267
  margin-bottom: 5px;
267
268
  }
268
269
  display: flex;
269
- `,ai=To.span`
270
+ `,pi=Fo.span`
270
271
  font-weight: 400;
271
272
  font-size: 14px;
272
273
  line-height: 22px;
@@ -274,12 +275,12 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
274
275
  display: flex;
275
276
  margin-right: 5px;
276
277
  margin-top: 10px;
277
- `,Fo=To.div`
278
+ `,ko=Fo.div`
278
279
  display: flex;
279
280
  align-items: flex-start;
280
281
  justify-content: left;
281
282
  margin-bottom: 10px;
282
- `;import ir 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 st({title:e,required:t,appearance:o=Je}){return e?ir.createElement(Fo,{className:a("formLabelWrapper",o)},t?ir.createElement(ai,{className:a("formLabelRequired",o),appearance:o},"*"):null,ir.createElement(si,{className:a("formLabel",o)},e)):null}import pi from"react";function Dt({title:e,appearance:t}){return e?pi.createElement(Fo,null,pi.createElement(li,{className:a("formSubLabel",t)},e)):null}import{z as nr}from"zod";function di(e,t){try{if(t){if(t.type=="number"){let o=nr.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=nr.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 nr.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 Ca=lr.div`
283
+ `;import ir 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?ir.createElement(ko,{className:a("formLabelWrapper",o)},t?ir.createElement(pi,{className:a("formLabelRequired",o),appearance:o},"*"):null,ir.createElement(li,{className:a("formLabel",o)},e)):null}import di from"react";function $t({title:e,appearance:t}){return e?di.createElement(ko,null,di.createElement(ai,{className:a("formSubLabel",t)},e)):null}import{z as nr}from"zod";function ci(e,t){try{if(t){if(t.type=="number"){let o=nr.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=nr.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 nr.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 Sa=lr.div`
283
284
  display: flex;
284
285
  flex-direction: column;
285
286
  width: 100%;
@@ -299,7 +300,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
299
300
  box-sizing: border-box;
300
301
  padding: 0 10px;
301
302
  margin-bottom: 10px;
302
- `,ya=lr.textarea`
303
+ `,ba=lr.textarea`
303
304
  ${e=>k(e)} {
304
305
  // Anything inside this block will be ignored if the user provides a custom class
305
306
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -315,13 +316,13 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
315
316
  min-height: 70px;
316
317
  box-sizing: border-box;
317
318
  margin-bottom: 10px;
318
- `;function pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=sr((r==null?void 0:r.text)||""),[c,l]=sr(!1),[g,d]=sr(!1),x=ar;ci(()=>{s===""&&!c&&(l(!0),F(""))},[]),ci(()=>{if(g){F(s);return}},[g]);function F(S){if(p(S),o({text:S}),n.required===!0&&S.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`,hidden:!g}]);return}let f=di(S,n.validation);if(f&&n.required===!0){i([{id:n.id,message:f,hidden:!g}]);return}i([])}n.multiline&&(x=ya);function C(){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 ko.createElement(Ca,null,ko.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),ko.createElement(x,{className:a("inputComponent",t.appearance),value:s,onChange:S=>{F(S.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:C(),onBlur:()=>{d(!0)}}),ko.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import je,{useEffect as mi,useState as ui}from"react";import fi from"styled-components";var dr="",Sa=fi.div`
319
+ `;function pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=sr((r==null?void 0:r.text)||""),[c,l]=sr(!1),[g,d]=sr(!1),x=ar;mi(()=>{s===""&&!c&&(l(!0),F(""))},[]),mi(()=>{if(g){F(s);return}},[g]);function F(S){if(p(S),o({text:S}),n.required===!0&&S.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`,hidden:!g}]);return}let f=ci(S,n.validation);if(f&&(S.trim()!==""||n.required===!0)){i([{id:n.id,message:f,hidden:!g}]);return}i([])}n.multiline&&(x=ba);function y(){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 Po.createElement(Sa,null,Po.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),Po.createElement(x,{className:a("inputComponent",t.appearance),value:s,onChange:S=>{F(S.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:y(),onBlur:()=>{d(!0)}}),Po.createElement($t,{title:n.subtitle,appearance:t.appearance}))}import je,{useEffect as ui,useState as fi}from"react";import gi from"styled-components";var dr="",wa=gi.div`
319
320
  display: flex;
320
321
  flex-direction: column;
321
322
  width: 100%;
322
323
  -webkit-appearance: none;
323
324
  appearance: none;
324
- `,ba=fi.select`
325
+ `,Ta=gi.select`
325
326
  ${e=>k(e)} {
326
327
  // Anything inside this block will be ignored if the user provides a custom class
327
328
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -342,15 +343,15 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
342
343
  background-repeat: no-repeat;
343
344
  background-size: 1.5em 1.5em;
344
345
  -webkit-print-color-adjust: exact;
345
- `;function gi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,F,C,S;let n=e,[s,p]=ui(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,l]=ui(!1);return mi(()=>{var f,v,w,b;if(s===""&&!c){if(l(!0),n.requireSelection){p(dr);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(A=>A.id===n.defaultValue))){let A=(v=n.props.options)==null?void 0:v.find(y=>y.id===n.defaultValue);p(A.id),o({choice:[A.id]})}else p(((w=n.props.options)==null?void 0:w[0].id)||""),o({choice:[((b=n.props.options)==null?void 0:b[0].id)||""]})}},[]),mi(()=>{n.requireSelection&&s===dr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),je.createElement(Sa,null,je.createElement(st,{title:n.title,required:!1,appearance:t.appearance}),je.createElement(ba,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},n.requireSelection&&je.createElement("option",{key:"null-value",value:dr,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))),((F=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:F.isOpenEnded)&&je.createElement(je.Fragment,null,je.createElement(st,{title:((S=(C=n.props.options)==null?void 0:C.find(f=>f.id===s))==null?void 0:S.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),je.createElement(ar,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),je.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import to,{useEffect as cr,useState as hi}from"react";import Ci from"styled-components";import eo from"react";import Rt from"react";var xi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return Rt.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},wa=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>Rt.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},Rt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Rt.createElement(xi,{color:r,size:t}),Rt.createElement(xi,{color:e,percentage:o,size:t})),i),$t=wa;import Ta from"styled-components";var Fa=({color:e="#FFFFFF"})=>eo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ka={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Pa={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},va={border:"1px solid #000000",color:"#FFFFFF"},Ba={border:"1px solid #C5CBD3"},Ea={color:"#FFFFFF"},Aa={border:"1px solid #C5CBD3"},Ia=e=>e==="square"?ka:Pa,Na=(e,t)=>e==="square"?t?va:Ba:t?Ea:Aa,Oa=Ta.div`
346
+ `;function xi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,F,y,S;let n=e,[s,p]=fi(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,l]=fi(!1);return ui(()=>{var f,B,T,h;if(s===""&&!c){if(l(!0),n.requireSelection){p(dr);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(A=>A.id===n.defaultValue))){let A=(B=n.props.options)==null?void 0:B.find(b=>b.id===n.defaultValue);p(A.id),o({choice:[A.id]})}else p(((T=n.props.options)==null?void 0:T[0].id)||""),o({choice:[((h=n.props.options)==null?void 0:h[0].id)||""]})}},[]),ui(()=>{n.requireSelection&&s===dr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),je.createElement(wa,null,je.createElement(lt,{title:n.title,required:!1,appearance:t.appearance}),je.createElement(Ta,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},n.requireSelection&&je.createElement("option",{key:"null-value",value:dr,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))),((F=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:F.isOpenEnded)&&je.createElement(je.Fragment,null,je.createElement(lt,{title:((S=(y=n.props.options)==null?void 0:y.find(f=>f.id===s))==null?void 0:S.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),je.createElement(ar,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),je.createElement($t,{title:n.subtitle,appearance:t.appearance}))}import oo,{useEffect as cr,useState as Ci}from"react";import yi from"styled-components";import to from"react";import eo from"react";var hi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return eo.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})=>eo.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},eo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},eo.createElement(hi,{color:r,size:t}),eo.createElement(hi,{color:e,percentage:o,size:t})),i),Mt=Fa;import ka from"styled-components";var Pa=({color:e="#FFFFFF"})=>to.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},to.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),va={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"},Ea={border:"1px solid #000000",color:"#FFFFFF"},Aa={border:"1px solid #C5CBD3"},Ia={color:"#FFFFFF"},Na={border:"1px solid #C5CBD3"},Oa=e=>e==="square"?va:Ba,La=(e,t)=>e==="square"?t?Ea:Aa:t?Ia:Na,Da=ka.div`
346
347
  ${e=>ke(e)}
347
- `,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=Ia(t),c=Na(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?eo.createElement($t,{fillColor:o,percentage:i,size:22}):eo.createElement(Oa,{styleOverrides:p,style:n,role:"checkbox",className:xe(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&eo.createElement(Fa,{color:"#FFFFFF"}))};var La=Ci.div`
348
+ `,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=Oa(t),c=La(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?to.createElement(Mt,{fillColor:o,percentage:i,size:22}):to.createElement(Da,{styleOverrides:p,style:n,role:"checkbox",className:he(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&to.createElement(Pa,{color:"#FFFFFF"}))};var $a=yi.div`
348
349
  display: flex;
349
350
  flex-direction: column;
350
351
  width: 100%;
351
352
  -webkit-appearance: none;
352
353
  appearance: none;
353
- `,Da=Ci.button`
354
+ `,Ma=yi.button`
354
355
  ${e=>k(e)} {
355
356
  // Anything inside this block will be ignored if the user provides a custom class
356
357
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -375,7 +376,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
375
376
  height: 48px;
376
377
  padding: 0 18px;
377
378
  margin-bottom: 10px;
378
- `;function yi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=hi((i==null?void 0:i.choice)||[]),[c,l]=hi(!1);return cr(()=>{s.length==0&&!c&&(l(!0),o({choice:[]}))},[]),cr(()=>{o({choice:s})},[s]),cr(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),to.createElement(La,null,to.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>to.createElement(Da,{appearance:t.appearance,className:a(s.includes(d.id)?"multipleChoiceListItemSelected":"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,to.createElement(Qe,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),to.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import Po from"react";import Si from"styled-components";import $a from"dompurify";function le(e){return{__html:$a.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Ma=Si.h1`
379
+ `;function Si({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,l]=Ci(!1);return cr(()=>{s.length==0&&!c&&(l(!0),o({choice:[]}))},[]),cr(()=>{o({choice:s})},[s]),cr(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),oo.createElement($a,null,oo.createElement(lt,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>oo.createElement(Ma,{appearance:t.appearance,className:a(s.includes(d.id)?"multipleChoiceListItemSelected":"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,oo.createElement(Qe,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),oo.createElement($t,{title:n.subtitle,appearance:t.appearance}))}import vo from"react";import bi from"styled-components";import Ua from"dompurify";function se(e){return{__html:Ua.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var za=bi.h1`
379
380
  ${e=>k(e)} {
380
381
  font-style: normal;
381
382
  font-weight: 700;
@@ -387,7 +388,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
387
388
  margin-bottom: 4px;
388
389
  color: ${e=>e.appearance.theme.colorText};
389
390
  }
390
- `,Ua=Si.h2`
391
+ `,Wa=bi.h2`
391
392
  ${e=>k(e)} {
392
393
  font-style: normal;
393
394
  font-weight: 400;
@@ -396,42 +397,42 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
396
397
  letter-spacing: 0.28px;
397
398
  color: ${e=>e.appearance.theme.colorTextSecondary};
398
399
  }
399
- `;function Fe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Po.createElement(Po.Fragment,null,Po.createElement(Ma,{appearance:e,className:a(`${r}${r?Zt(i):i}Title`,e),dangerouslySetInnerHTML:le(t),size:i}),o&&Po.createElement(Ua,{appearance:e,className:a(`${r}${r?Zt(i):i}Subtitle`,e),dangerouslySetInnerHTML:le(o),size:i}))}import*as mr from"react";var bi=e=>mr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},mr.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=vo.div`
400
+ `;function Te({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return vo.createElement(vo.Fragment,null,vo.createElement(za,{appearance:e,className:a(`${r}${r?Rt(i):i}Title`,e),dangerouslySetInnerHTML:se(t),size:i}),o&&vo.createElement(Wa,{appearance:e,className:a(`${r}${r?Rt(i):i}Subtitle`,e),dangerouslySetInnerHTML:se(o),size:i}))}import*as mr from"react";var wi=e=>mr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},mr.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 ja=Bo.div`
400
401
  display: flex;
401
402
  flex-direction: column;
402
403
  justify-content: flex-end;
403
404
  overflow: visible;
404
405
  padding-top: 14px;
405
- `,Ha=vo.div`
406
+ `,Va=Bo.div`
406
407
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
407
408
  font-size: 12px;
408
409
  margin-bottom: 12px;
409
410
  display: flex;
410
411
  align-items: center;
411
- `,ja=vo.div`
412
+ `,Ga=Bo.div`
412
413
  margin-right: 4px;
413
414
  display: inline-flex;
414
- `,Va=vo.div`
415
+ `,Ka=Bo.div`
415
416
  padding-left: 1px;
416
417
  padding-right: 1px;
417
- `,Ga={text:pr,multipleChoice:gi,multipleChoiceList:yi},fr="frigade-multiInputStepTypeData";function wi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var y;let c=t.props,[l,g]=ur([]),[d,x]=ur([]),{userId:F}=Jt(),[C,S]=ur(b()||(p?p[t.id]:null)||{}),{readonly:f}=za(K),v={...Ga,...s};Wa(()=>{i(l.length===0)},[l,i]);function w(m,E){let T={...C,[m.id]:E};S(T),r(T),window&&window.localStorage&&!f&&window.localStorage.setItem(A(),JSON.stringify(T))}function b(){if(window&&window.localStorage){let m=window.localStorage.getItem(A());if(m)return JSON.parse(m)}return null}function A(){return`${fr}-${e}-${t.id}-${F}`}return Ct.createElement(Va,{className:a("multiInput",n)},Ct.createElement(Fe,{appearance:n,title:t.title,subtitle:t.subtitle}),Ct.createElement(_a,{className:a("multiInputContainer",n)},(y=c.data)==null?void 0:y.map(m=>{let E=l.reverse().find(T=>T.id===m.id);return v[m.type]?Ct.createElement("span",{key:m.id,"data-field-id":m.id,className:a("multiInputField",n)},v[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:T=>{!d.includes(m.id)&&T&&(T==null?void 0:T.text)!==""&&x(B=>[...B,m.id]),w(m,T)},inputData:C[m.id],setFormValidationErrors:T=>{g(B=>T.length===0?B.filter(L=>L.id!==m.id):[...B,...T])}}),E&&d.includes(m.id)&&E.hidden!==!0&&Ct.createElement(Ha,{key:m.id,style:{overflow:"hidden"},appearance:n,className:a("multiInputValidationError",n)},Ct.createElement(ja,{appearance:n,className:a("multiInputValidationErrorIcon",n)},Ct.createElement(bi,null)),E.message)):null})))}import yt from"styled-components";var Ti=yt.div`
418
+ `,qa={text:pr,multipleChoice:xi,multipleChoiceList:Si},fr="frigade-multiInputStepTypeData";function Ti({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var b;let c=t.props,[l,g]=ur([]),[d,x]=ur([]),{userId:F}=Qt(),[y,S]=ur(h()||(p?p[t.id]:null)||{}),{readonly:f}=_a(G),B={...qa,...s};Ha(()=>{i(l.length===0)},[l,i]);function T(m,P){let w={...y,[m.id]:P};S(w),r(w),window&&window.localStorage&&!f&&window.localStorage.setItem(A(),JSON.stringify(w))}function h(){if(window&&window.localStorage){let m=window.localStorage.getItem(A());if(m)return JSON.parse(m)}return null}function A(){return`${fr}-${e}-${t.id}-${F}`}return Ct.createElement(Ka,{className:a("multiInput",n)},Ct.createElement(Te,{appearance:n,title:t.title,subtitle:t.subtitle}),Ct.createElement(ja,{className:a("multiInputContainer",n)},(b=c.data)==null?void 0:b.map(m=>{let P=l.reverse().find(w=>w.id===m.id);return B[m.type]?Ct.createElement("span",{key:m.id,"data-field-id":m.id,className:a("multiInputField",n)},B[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:w=>{!d.includes(m.id)&&w&&(w==null?void 0:w.text)!==""&&x(E=>[...E,m.id]),T(m,w)},inputData:y[m.id],setFormValidationErrors:w=>{g(E=>w.length===0?E.filter(O=>O.id!==m.id):[...E,...w])}}),P&&P.message&&d.includes(m.id)&&P.hidden!==!0&&Ct.createElement(Va,{key:m.id,style:{overflow:"hidden"},appearance:n,className:a("multiInputValidationError",n)},Ct.createElement(Ga,{appearance:n,className:a("multiInputValidationErrorIcon",n)},Ct.createElement(wi,null)),P.message)):null})))}import yt from"styled-components";var Fi=yt.div`
418
419
  align-items: center;
419
420
  display: flex;
420
421
  justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
421
422
  padding-top: 14px;
422
- `,Fi=yt.div`
423
+ `,ki=yt.div`
423
424
  color: ${e=>e.appearance.theme.colorTextError};
424
425
  font-size: 12px;
425
- `,ki=yt.div`
426
+ `,Pi=yt.div`
426
427
  display: flex;
427
428
  gap: 12px;
428
429
  width: 100%;
429
430
  justify-content: flex-end;
430
- `,Pi=yt.div`
431
+ `,vi=yt.div`
431
432
  display: flex;
432
433
  flex-direction: row;
433
434
  flex: 1 1;
434
- `,vi=yt.div`
435
+ `,Bi=yt.div`
435
436
  display: flex;
436
437
  // If type is set to large-modal, use padding 60px horizontal, 80px vertical
437
438
  // Otherwise, use 4px padding
@@ -439,11 +440,11 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
439
440
  flex-grow: 1;
440
441
  flex-basis: 0;
441
442
  position: relative;
442
- `,Bi=yt.div`
443
+ `,Ei=yt.div`
443
444
  padding: ${e=>e.type==="large-modal"?"50px":"0px"};
444
445
  position: relative;
445
446
  overflow-y: auto;
446
- `,Ei=yt.div`
447
+ `,Ai=yt.div`
447
448
  display: flex;
448
449
  align-self: stretch;
449
450
  flex-grow: 1;
@@ -455,7 +456,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
455
456
  background-position: center;
456
457
  border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
457
458
  border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
458
- `;import lt from"react";import Ka from"react";import Ai from"styled-components";var qa=Ai.button`
459
+ `;import at from"react";import Ya from"react";import Ii from"styled-components";var Xa=Ii.button`
459
460
  justify-content: center;
460
461
  align-content: center;
461
462
  ${e=>k(e)} {
@@ -486,7 +487,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
486
487
  opacity: 0.3;
487
488
  cursor: not-allowed;
488
489
  }
489
- `,Bo=Ai.div`
490
+ `,Eo=Ii.div`
490
491
  ${e=>k(e)} {
491
492
  display: flex;
492
493
  flex-direction: row;
@@ -497,14 +498,14 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
497
498
  margin-right: 8px;
498
499
  }
499
500
  }
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:l=""})=>{function g(){let d=s?"buttonSecondary":"button";return l===""?d:`${l}${Zt(d)}`}return Ka.createElement(qa,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:a(g(),p)},t??"Continue")};var Ii=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:l})=>{let g=s.length>1&&n!=0&&c,d=e.primaryButtonTitle&&e.secondaryButtonTitle||g?"inline":"full-width";return lt.createElement(lt.Fragment,null,l!==null&&l!=null&&lt.createElement(Fi,{appearance:o,className:a("formCTAError",o)},l),lt.createElement(Ti,{showBackButton:g,className:a("formCTAContainer",o)},g&&lt.createElement(Z,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),lt.createElement(ki,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?lt.createElement(Z,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?lt.createElement(Z,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import gr from"react";import Ya from"styled-components";var Xa=Ya.div`
501
+ `,R=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:l=""})=>{function g(){let d=s?"buttonSecondary":"button";return l===""?d:`${l}${Rt(d)}`}return Ya.createElement(Xa,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:a(g(),p)},t??"Continue")};var Ni=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:l})=>{let g=s.length>1&&n!=0&&c,d=e.primaryButtonTitle&&e.secondaryButtonTitle||g?"inline":"full-width";return at.createElement(at.Fragment,null,l!==null&&l!=null&&at.createElement(ki,{appearance:o,className:a("formCTAError",o)},l),at.createElement(Fi,{showBackButton:g,className:a("formCTAContainer",o)},g&&at.createElement(R,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),at.createElement(Pi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?at.createElement(R,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?at.createElement(R,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import gr from"react";import Ja from"styled-components";var Qa=Ja.div`
501
502
  text-align: center;
502
- `,Ni=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Q().mergeAppearanceWithDefault(i);return gr.createElement(Xa,{className:o},gr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>gr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import St from"react";import Mt from"styled-components";import{useContext as Ja}from"react";function ie(){let e=Ja(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 Qa=Mt.div`
503
+ `,Oi=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Z().mergeAppearanceWithDefault(i);return gr.createElement(Qa,{className:o},gr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>gr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import St from"react";import Ut from"styled-components";import{useContext as Za}from"react";function ie(){let e=Za(G);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 Ra=Ut.div`
503
504
  display: flex;
504
505
  flex-wrap: wrap;
505
506
  align-content: center;
506
507
  justify-content: center;
507
- `,Za=Mt.div`
508
+ `,ep=Ut.div`
508
509
  align-content: center;
509
510
  align-items: center;
510
511
  display: flex;
@@ -518,10 +519,10 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
518
519
  flex-basis: 255px;
519
520
  flex-grow: 0;
520
521
  flex-shrink: 0;
521
- `,Ra=Mt.img`
522
+ `,tp=Ut.img`
522
523
  width: 78px;
523
524
  height: auto;
524
- `,ep=Mt.button`
525
+ `,op=Ut.button`
525
526
  font-style: normal;
526
527
  font-weight: 600;
527
528
  font-size: 13px;
@@ -534,11 +535,11 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
534
535
  border-radius: 100px;
535
536
  padding: 8px 12px;
536
537
  margin-top: 16px;
537
- `,tp=Mt.h1`
538
+ `,rp=Ut.h1`
538
539
  font-weight: 700;
539
540
  font-size: 28px;
540
541
  line-height: 34px;
541
- `,op=Mt.h2`
542
+ `,ip=Ut.h2`
542
543
  font-style: normal;
543
544
  font-weight: 400;
544
545
  font-size: 16px;
@@ -547,7 +548,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
547
548
  margin-top: 12px;
548
549
  margin-bottom: 16px;
549
550
  max-width: 70%;
550
- `;function Oi({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return St.createElement("div",null,St.createElement(tp,null,e.title),St.createElement(op,null,e.subtitle),St.createElement(Qa,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>St.createElement(Za,{key:n.title},St.createElement(Ra,{src:n.imageUri}),St.createElement(ep,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import Ut,{useEffect as pp}from"react";import Io from"styled-components";import xr from"react";var Eo=({style:e,className:t})=>xr.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},xr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),xr.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 oo,{useRef as rp,useState as ip}from"react";import Ao from"styled-components";var np=Ao.div`
551
+ `;function Li({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return St.createElement("div",null,St.createElement(rp,null,e.title),St.createElement(ip,null,e.subtitle),St.createElement(Ra,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>St.createElement(ep,{key:n.title},St.createElement(tp,{src:n.imageUri}),St.createElement(op,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import zt,{useEffect as cp}from"react";import No from"styled-components";import xr from"react";var Ao=({style:e,className:t})=>xr.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},xr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),xr.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 ro,{useRef as np,useState as sp}from"react";import Io from"styled-components";var lp=Io.div`
551
552
  display: flex;
552
553
  align-items: center;
553
554
  justify-content: flex-start;
@@ -555,7 +556,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
555
556
  width: 100%;
556
557
  height: 100%;
557
558
  position: relative;
558
- `,sp=Ao.div`
559
+ `,ap=Io.div`
559
560
  position: absolute;
560
561
  display: flex;
561
562
  align-items: center;
@@ -574,56 +575,56 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
574
575
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
575
576
  border-radius: 50%;
576
577
  }
577
- `,lp=Ao.video`
578
+ `,pp=Io.video`
578
579
  width: 100%;
579
580
  height: 100%;
580
581
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
581
- `,ap=Ao.iframe`
582
+ `,dp=Io.iframe`
582
583
  width: 100%;
583
584
  height: 100%;
584
585
  min-height: 260px;
585
586
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
586
- `;function Ve({appearance:e,videoUri:t}){let o=rp(),[i,r]=ip(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),oo.createElement(ap,{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 oo.createElement(np,{className:a("videoPlayerWrapper",e),appearance:e},!i&&oo.createElement(sp,{onClick:()=>{r(!0),o.current.play()},appearance:e},oo.createElement(Eo,null)),oo.createElement(lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var dp=Io.div`
587
+ `;function Ve({appearance:e,videoUri:t}){let o=np(),[i,r]=sp(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),ro.createElement(dp,{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 ro.createElement(lp,{className:a("videoPlayerWrapper",e),appearance:e},!i&&ro.createElement(ap,{onClick:()=>{r(!0),o.current.play()},appearance:e},ro.createElement(Ao,null)),ro.createElement(pp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var mp=No.div`
587
588
  ${e=>k(e)} {
588
589
  display: flex;
589
590
  flex-direction: column;
590
591
  justify-content: center;
591
592
  }
592
- `,cp=Io.img`
593
+ `,up=No.img`
593
594
  ${e=>k(e)} {
594
595
  width: 100%;
595
596
  height: auto;
596
597
  max-height: 250px;
597
598
  margin-bottom: 24px;
598
599
  }
599
- `,mp=Io.div`
600
+ `,fp=No.div`
600
601
  ${e=>k(e)} {
601
602
  margin-bottom: 24px;
602
603
  }
603
- `,up=Io.div`
604
+ `,gp=No.div`
604
605
  ${e=>k(e)} {
605
606
  width: 100%;
606
607
  height: auto;
607
608
  max-height: 250px;
608
609
  margin-bottom: 24px;
609
610
  }
610
- `;function Li({stepData:e,appearance:t,setCanContinue:o}){return pp(()=>{o(!0)},[]),Ut.createElement(dp,{className:a("callToActionContainer",t)},Ut.createElement(mp,{className:a("callToActionTextContainer",t)},Ut.createElement(Fe,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Ut.createElement(cp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Ut.createElement(up,{appearance:t,className:a("callToActionVideo",t)},Ut.createElement(Ve,{appearance:t,videoUri:e.videoUri})))}import Ze,{useEffect as hr,useState as Cr}from"react";import at from"styled-components";var Di=at.div`
611
+ `;function Di({stepData:e,appearance:t,setCanContinue:o}){return cp(()=>{o(!0)},[]),zt.createElement(mp,{className:a("callToActionContainer",t)},zt.createElement(fp,{className:a("callToActionTextContainer",t)},zt.createElement(Te,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&zt.createElement(up,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&zt.createElement(gp,{appearance:t,className:a("callToActionVideo",t)},zt.createElement(Ve,{appearance:t,videoUri:e.videoUri})))}import Ze,{useEffect as hr,useState as Cr}from"react";import pt from"styled-components";var $i=pt.div`
611
612
  width: auto;
612
613
  display: flex;
613
614
  flex-direction: column;
614
615
  justify-content: center;
615
616
  align-items: center;
616
617
  padding: 4px;
617
- `,$i=at.div`
618
+ `,Mi=pt.div`
618
619
  width: 100%;
619
620
  text-align: left;
620
- `,Mi=at.h1`
621
+ `,Ui=pt.h1`
621
622
  font-style: normal;
622
623
  font-weight: 700;
623
624
  font-size: 32px;
624
625
  line-height: 38px;
625
626
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
626
- `,Ui=at.h1`
627
+ `,zi=pt.h1`
627
628
  font-style: normal;
628
629
  font-weight: 400;
629
630
  font-size: 16px;
@@ -631,7 +632,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
631
632
  margin-top: 16px;
632
633
  margin-bottom: 16px;
633
634
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
634
- `,zi=at.div`
635
+ `,Wi=pt.div`
635
636
  padding-top: 12px;
636
637
  padding-bottom: 12px;
637
638
  flex-direction: row;
@@ -642,17 +643,17 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
642
643
  cursor: pointer;
643
644
  border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
644
645
  width: 100%;
645
- `,Wi=at.div`
646
+ `,_i=pt.div`
646
647
  padding-top: 10px;
647
648
  padding-bottom: 10px;
648
649
  flex-direction: row;
649
650
  display: flex;
650
651
  justify-content: flex-start;
651
- `,_i=at.img`
652
+ `,Hi=pt.img`
652
653
  width: 42px;
653
654
  height: 42px;
654
655
  margin-right: 12px;
655
- `,Hi=at.p`
656
+ `,ji=pt.p`
656
657
  font-style: normal;
657
658
  font-weight: 500;
658
659
  font-size: 17px;
@@ -660,8 +661,8 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
660
661
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
661
662
  display: flex;
662
663
  align-self: center;
663
- `;var ji=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=Cr([]),[p,c]=Cr(!1),[l,g]=Cr(e.id);return hr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),hr(()=>{l!==e.id&&(g(e.id),s([]))},[e]),hr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ze.createElement(Di,{className:a("selectListContainer",i)},Ze.createElement($i,null,Ze.createElement(Mi,{className:a("selectListTitle",i)},e.title),Ze.createElement(Ui,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let F=n.includes(d.id);return Ze.createElement(zi,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(C=>C!==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:a("selectListSelectItem",i)},Ze.createElement(Wi,{className:a("selectListItemImage",i)},d.imageUri&&Ze.createElement(_i,{src:d.imageUri,alt:`select-icon-${x}`}),Ze.createElement(Hi,{appearance:i,className:a("selectListSelectItemText",i)},d.title)),Ze.createElement(Qe,{appearance:i,value:F,primaryColor:i.theme.colorPrimary}))}))};import Pe,{useEffect as No,useState as ro}from"react";var fp=({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),Oo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:l,onComplete:g,setVisible:d,setShowModal:x,onDismiss:F,showPagination:C=!1,customFormElements:S,allowBackNavigation:f,validationHandler:v,onFormDataChange:w,showFooter:b,prefillData:A})=>{var V;let m={...{linkCollection:Oi,multiInput:wi,callToAction:Li,selectList:ji},...i},{primaryCTAClickSideEffects:E,secondaryCTAClickSideEffects:T}=ie(),[B,L]=ro(!1),[N,I]=ro({}),[$,D]=ro(!1),[ee,U]=ro(!1),[te,fe]=ro(null),X=t[o]??null,{markStepCompleted:H,markStepStarted:j,isLoading:Ce,updateCustomVariables:Ie,markFlowCompleted:be}=Y();No(()=>{Ie(r)},[r,Ce]),No(()=>{w&&w(N,me(),t[o],o)},[N]),No(()=>{window&&f&&!ee&&(window.location.hash=t[o].id,U(!0))},[f,ee,U]),No(()=>{var G;if(window&&((G=window==null?void 0:window.location)!=null&&G.hash)&&window.location.hash.replace("#","")!==t[o].id){let ne=window.location.hash.replace("#",""),se=t.findIndex(pe=>pe.id===ne);se!==-1&&j(p,t[se].id)}},[(V=window==null?void 0:window.location)==null?void 0:V.hash,j,o,t]);function me(){return{data:N[t[o].id]??{},stepId:t[o].id,customVariables:r}}function J(G,ne,se){let pe=o+1<t.length?t[o+1]:null;return s&&s(G,se,pe,N,me()),n?n(G,o,ne,pe):!0}function ge(G,ne){I(se=>{let pe={};return pe[G.id]=ne,{...se,...pe}})}function re(G){return G.selectedStep.imageUri?Pe.createElement(Ei,{image:G.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let O=b&&Pe.createElement(Ii,{step:t[o],canContinue:B&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(D(!0),v){let se=await v(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 G={...me()};await H(p,t[o].id,G),o+1<t.length&&await j(p,t[o+1].id);let ne=J(t[o],"primary",o);o+1>=t.length&&(g&&g(),F&&F(),l&&ne&&(d&&d(!1),x(!1)),await be(p)),E(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 j(p,t[o-1].id),D(!1))},steps:t,allowBackNavigation:f,errorMessage:te});return Pe.createElement(Pe.Fragment,null,Pe.createElement(Pi,{className:a("formContainer",e)},Pe.createElement(vi,null,Pe.createElement(fp,{id:o,shouldWrap:c==="large-modal"},Pe.createElement(Bi,{key:X.id,type:c,className:a("formContent",e)},t.map(G=>{let ne=m[G.type];return X.id!==G.id?null:Pe.createElement(ne,{key:G.id,stepData:G,canContinue:B,setCanContinue:L,onSaveData:se=>{ge(G,se)},appearance:e,customFormElements:S,flowId:p,prefillData:A})}),C&&Pe.createElement(Ni,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),O))),c=="large-modal"&&Pe.createElement(re,{selectedStep:t[o]})))};import io from"react";import{createGlobalStyle as gp}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return io.createElement(io.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return io.createElement(io.Fragment,null);let o=gp`
664
- ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map(([s,p])=>`${Zo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return io.createElement(o,{inlineStyles:t})}var Vi=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:F=!1,modalPosition:C="center",repeatable:S=!1,onDismiss:f,showPagination:v=!1,allowBackNavigation:w=!1,validationHandler:b,showFrigadeBranding:A=!1,onFormDataChange:y,showFooter:m=!0,prefillData:E={}})=>{let{getFlow:T,getFlowSteps:B,isLoading:L,targetingLogicShouldHideFlow:N,getFlowStatus:I,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:ee}=Y(),U=$(e),{mergeAppearanceWithDefault:te}=Q(),[fe,X]=hp(!1),{setOpenFlowState:H,getOpenFlowState:j,hasOpenModals:Ce}=we();c=te(c);let[Ie,be]=i!==void 0&&r!==void 0?[i,r]:[j(e,!0),re=>H(e,re)];if(xp(()=>{!fe&&!L&&(X(!0),I(e)===q&&S&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(O=>{O.startsWith(fr)&&window.localStorage.removeItem(O)})),X(!0))},[fe,X,L]),L)return null;let me=T(e);if(!me||N(me))return null;let J=B(e);if(!J||i!==void 0&&i===!1||I(e)===q&&l||(o=="modal"||o=="corner-modal")&&Ce(e))return null;let ge=()=>{be(!1),f&&f(),F===!0&&D(e)};if(C=="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(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:v,customFormElements:s,allowBackNavigation:w,validationHandler:b,onFormDataChange:y,showFooter:m,prefillData:E}))}return o==="modal"&&C!=="center"?Ge.createElement(wo,{appearance:c,onClose:ge,visible:Ie,modalPosition:C},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:v,customFormElements:s,allowBackNavigation:w,validationHandler:b,onFormDataChange:y,showFooter:m,prefillData:E})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:v,customFormElements:s,allowBackNavigation:w,validationHandler:b,onFormDataChange:y,showFooter:m,prefillData:E}))},Gi=Vi;import{useCallback as yr,useContext as Cp,useEffect as yp}from"react";function Sr(){let{organizationId:e,userId:t,setOrganizationId:o}=Cp(K),{mutateUserFlowState:i}=Be(),{config:r,apiUrl:n}=_e(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,F){return`frigade-user-group-registered-${x}-${F}`}yp(()=>{if(t&&e){if(t.startsWith(Lt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=yr(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let F={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(F)}),i()},[e,t,r,i]),g=yr(async(x,F)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:F}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()},[e,t,r,i]),d=yr(async(x,F)=>{if(p())if(F){let C=c(t,x);localStorage.setItem(C,"true"),o(x);let S={foreignUserId:t,foreignUserGroupId:x,properties:F};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var Ki="frigade-xFrigade_guestUserId",no="frigade-xFrigade_userId",qi=({})=>{let{setFlowResponses:e}=Xt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Be(),{userId:r,setUserId:n}=Jt(),[s,p]=br(null),{getFlowStatus:c}=Y(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=Sp(K),[F,C]=br([]),[S,f]=br([]),{organizationId:v}=Sr();Lo(()=>{if(!o&&t)for(let y=0;y<t.length;y++){let m=t[y],E=l.find(T=>T.slug===(m==null?void 0:m.flowId));if(E&&m&&m.shouldTrigger===!0&&E.type=="FORM"&&E.triggerType==="AUTOMATIC"&&!S.includes(E.slug)){setTimeout(()=>{w(m.flowId)},500);break}}},[o,t]),Lo(()=>{x.length>0&&i()},[x]);function w(y){let m=l.find(E=>E.slug===y);m&&m.triggerType==="AUTOMATIC"&&!S.includes(m.slug)&&(f([...S,m.slug]),C([m]))}function b(){if(!r){let y=localStorage.getItem(no);if(y){n(y);return}let m=localStorage.getItem(Ki);if(m){n(m);return}d(!0);let E=Lt+bp();try{localStorage.setItem(Ki,E)}catch(T){console.log("Failed to save guest user id locally: Local storage unavailable",T)}n(T=>T||E)}}Lo(()=>{try{if(l){let y=[];l.forEach(m=>{if(m.data){let E=m.data.match(/"imageUri":"(.*?)"/g);E&&E.forEach(T=>{let B=T.replace('"imageUri":"',"").replace('"',"");if(y.includes(B))return;let L=new Image;L.src=B,y.push(B)})}})}}catch{}},[l]),Lo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(no,r)}catch(y){console.log("Failed to save user id locally: Local storage available",y)}r===null&&setTimeout(()=>{r===null&&b()},50)},[r,l,g]);function A(){return bt.createElement(bt.Fragment,null,F.map(y=>c(y.slug)!==Me?null:bt.createElement("span",{key:y.slug},bt.createElement(Gi,{flowId:y.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return bt.createElement(bt.Fragment,null,bt.createElement(A,null))};import{ErrorBoundary as qp}from"react-error-boundary";import so from"core-js-pure/actual/structured-clone";function wr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pt(...e){let t=e.shift(),o=e.length===1?e[0]:pt(...e);if(!wr(t)||!wr(o))throw new Error("deepmerge can only merge Objects");let i=so(t);return Object.entries(o).forEach(([r,n])=>{wr(n)?i[r]!==void 0?Object.assign(i,{[r]:pt(i[r],so(n))}):Object.assign(i,{[r]:so(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...so(n)]}):Object.assign(i,{[r]:so(n)}):Object.assign(i,{[r]:n})}),i}var Yi={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 wp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Yi[o]){let r=Yi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function Tp(e){if(!e)return;let t=pt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Xi(e){let{theme:t,styleOverrides:o}=e,i=wp(t),r=Tp(o);return{overrides:i,css:r}}import Mp from"styled-components";import{compose as Up,variant as Qi}from"styled-system";import Ji from"react";import Fp,{ThemeProvider as kp,useTheme as Pp}from"styled-components";import{border as vp,color as Bp,compose as Ep,get as Ap,shadow as Ip,space as Np,system as Op,typography as Lp}from"styled-system";var Dp={width:{property:"width",scale:"sizes",transform:(e,t)=>Ap(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},$p=Fp("div")(({css:e})=>e,Ep(vp,Bp,Ip,Np,Lp,Op(Dp))),lo=({as:e,children:t,overrides:o,...i})=>{let r=Pp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Ji.createElement($p,{as:e,...n,...i},t);if(o!==void 0){let p=pt(r,o);return Ji.createElement(kp,{theme:p},s())}return s()};var ao={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"}},zp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Zi=Mp(lo)(()=>({whiteSpace:"nowrap"}),Up(Qi({scale:"components.Button",variants:"components.Button"}),Qi({prop:"size",variants:zp})));import Wp from"styled-components";import{variant as _p,system as Hp}from"styled-system";var Do={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 Ri=Wp(lo)(_p({scale:"components.Text",variants:"components.Text"}),Hp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var en=4,tn="px",jp=20,Vp=Object.fromEntries(Array.from(Array(jp+1),(e,t)=>t===0?[.5,`${.5*en}${tn}`]:[t,`${t*en}${tn}`])),zt={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"},Tr={colors:{...zt,neutral:{foreground:zt.gray300},primary:{background:zt.blue500,foreground:zt.white,inverted:zt.blue500},negative:{foreground:zt.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:Vp,components:{Button:ao,Text:Do}};var on="https://api.frigade.com",K=Gp({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:on,readonly:!1});function Yp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Xp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,X;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[l,g]=Oe([]),[d,x]=Oe([]),[F,C]=Oe([]),[S,f]=Oe({}),[v,w]=Oe({}),[b,A]=Oe([]),[y,m]=Oe({}),[E,T]=Oe(!1),[B,L]=Oe(!1),[N,I]=Oe(!ee(e)),$=(H,j)=>{if(j==="_blank"){window.open(H,"_blank");return}setTimeout(()=>{window.location.href=H},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(H){return!!(H&&H.length>10&&H.substring(0,10)==="api_public")}$o(()=>{t&&s(t)},[t]),$o(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(no)&&window.localStorage.getItem(no)!==n&&Yp()},[n]),$o(()=>{o&&c(o)},[o]),$o(()=>{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 U={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:F,setFlowResponses:C,userProperties:S,setUserProperties:f,openFlowStates:v,setOpenFlowStates:w,completedFlowsToKeepOpenDuringSession:b,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:y,setCustomVariables:m,isNewGuestUser:E,setIsNewGuestUser:T,hasActiveFullPageFlow:B,setHasActiveFullPageFlow:L,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:I,apiUrl:i&&i.apiUrl?i.apiUrl:on,readonly:i&&i.readonly?i.readonly:!1};if(N)return wt.createElement(K.Provider,{value:U},r);let{overrides:te}=Xi(D);return wt.createElement(qp,{fallback:wt.createElement(wt.Fragment,null,r)},wt.createElement(K.Provider,{value:U},wt.createElement(Kp,{theme:pt(D.theme,Tr,te??{},(i==null?void 0:i.theme)??{})},r,wt.createElement(qi,null))))};import Ud from"react";import ce,{useEffect as Ns,useState as Os}from"react";import We,{useState as ud}from"react";import kt from"styled-components";import zo from"react";import Tt from"react";import nn from"styled-components";var rn=nn.span`
664
+ `;var Vi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=Cr([]),[p,c]=Cr(!1),[l,g]=Cr(e.id);return hr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),hr(()=>{l!==e.id&&(g(e.id),s([]))},[e]),hr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ze.createElement($i,{className:a("selectListContainer",i)},Ze.createElement(Mi,null,Ze.createElement(Ui,{className:a("selectListTitle",i)},e.title),Ze.createElement(zi,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let F=n.includes(d.id);return Ze.createElement(Wi,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(y=>y!==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:a("selectListSelectItem",i)},Ze.createElement(_i,{className:a("selectListItemImage",i)},d.imageUri&&Ze.createElement(Hi,{src:d.imageUri,alt:`select-icon-${x}`}),Ze.createElement(ji,{appearance:i,className:a("selectListSelectItemText",i)},d.title)),Ze.createElement(Qe,{appearance:i,value:F,primaryColor:i.theme.colorPrimary}))}))};import Pe,{useEffect as Oo,useState as io}from"react";var xp=({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),Lo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:l,onComplete:g,setVisible:d,setShowModal:x,onDismiss:F,showPagination:y=!1,customFormElements:S,allowBackNavigation:f,validationHandler:B,onFormDataChange:T,showFooter:h,prefillData:A})=>{var M;let m={...{linkCollection:Li,multiInput:Ti,callToAction:Di,selectList:Vi},...i},{primaryCTAClickSideEffects:P,secondaryCTAClickSideEffects:w}=ie(),[E,O]=io(!1),[N,I]=io({}),[$,D]=io(!1),[K,z]=io(!1),[q,ue]=io(null),fe=t[o]??null,{markStepCompleted:W,markStepStarted:V,isLoading:re,updateCustomVariables:Ne,markFlowCompleted:Be}=J();Oo(()=>{Ne(r)},[r,re]),Oo(()=>{T&&T(N,xe(),t[o],o)},[N]),Oo(()=>{window&&f&&!K&&(window.location.hash=t[o].id,z(!0))},[f,K,z]),Oo(()=>{var j;if(window&&((j=window==null?void 0:window.location)!=null&&j.hash)&&window.location.hash.replace("#","")!==t[o].id){let ae=window.location.hash.replace("#",""),ne=t.findIndex(pe=>pe.id===ae);ne!==-1&&V(p,t[ne].id)}},[(M=window==null?void 0:window.location)==null?void 0:M.hash,V,o,t]);function xe(){return{data:N[t[o].id]??{},stepId:t[o].id,customVariables:r}}function Q(j,ae,ne){let pe=o+1<t.length?t[o+1]:null;return s&&s(j,ne,pe,N,xe()),n?n(j,o,ae,pe):!0}function Fe(j,ae){I(ne=>{let pe={};return pe[j.id]=ae,{...ne,...pe}})}function te(j){return j.selectedStep.imageUri?Pe.createElement(Ai,{image:j.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let L=h&&Pe.createElement(Ni,{step:t[o],canContinue:E&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(D(!0),B){let ne=await B(t[o],o,t[o+1],N,xe());if(ne||ne===!1){ue(typeof ne=="string"?ne:null),D(!1);return}else ue(null)}let j={...xe()};await W(p,t[o].id,j),o+1<t.length&&await V(p,t[o+1].id);let ae=Q(t[o],"primary",o);o+1>=t.length&&(g&&g(),F&&F(),l&&ae&&(d&&d(!1),x(!1)),await Be(p)),P(t[o]),D(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{Q(t[o],"secondary",o),w(t[o])},onBack:async()=>{o-1>=0&&(D(!0),await V(p,t[o-1].id),D(!1))},steps:t,allowBackNavigation:f,errorMessage:q});return Pe.createElement(Pe.Fragment,null,Pe.createElement(vi,{className:a("formContainer",e)},Pe.createElement(Bi,null,Pe.createElement(xp,{id:o,shouldWrap:c==="large-modal"},Pe.createElement(Ei,{key:fe.id,type:c,className:a("formContent",e)},t.map(j=>{let ae=m[j.type];return fe.id!==j.id?null:Pe.createElement(ae,{key:j.id,stepData:j,canContinue:E,setCanContinue:O,onSaveData:ne=>{Fe(j,ne)},appearance:e,customFormElements:S,flowId:p,prefillData:A})}),y&&Pe.createElement(Oi,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),L))),c=="large-modal"&&Pe.createElement(te,{selectedStep:t[o]})))};import no from"react";import{createGlobalStyle as hp}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return no.createElement(no.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return no.createElement(no.Fragment,null);let o=hp`
665
+ ${i=>i.inlineStyles.map(([r,n])=>`.${Zt}${r}.${Zt}${r} { ${Object.entries(n).map(([s,p])=>`${Zo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return no.createElement(o,{inlineStyles:t})}var Gi=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:F=!1,modalPosition:y="center",repeatable:S=!1,onDismiss:f,showPagination:B=!1,allowBackNavigation:T=!1,validationHandler:h,showFrigadeBranding:A=!1,onFormDataChange:b,showFooter:m=!0,prefillData:P={}})=>{let{getFlow:w,getFlowSteps:E,isLoading:O,targetingLogicShouldHideFlow:N,getFlowStatus:I,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:K}=J(),z=$(e),{mergeAppearanceWithDefault:q}=Z(),[ue,fe]=yp(!1),{setOpenFlowState:W,getOpenFlowState:V,hasOpenModals:re}=be();c=q(c);let[Ne,Be]=i!==void 0&&r!==void 0?[i,r]:[V(e,!0),te=>W(e,te)];if(Cp(()=>{!ue&&!O&&(fe(!0),I(e)===X&&S&&(K(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(L=>{L.startsWith(fr)&&window.localStorage.removeItem(L)})),fe(!0))},[ue,fe,O]),O)return null;let xe=w(e);if(!xe||N(xe))return null;let Q=E(e);if(!Q||i!==void 0&&i===!1||I(e)===X&&l||(o=="modal"||o=="corner-modal")&&re(e))return null;let Fe=()=>{Be(!1),f&&f(),F===!0&&D(e)};if(y=="center"&&o==="modal"||o==="large-modal"){let te={padding:"24px"};return o==="large-modal"?(te.width="85%",te.height="90%",te.maxHeight="800px",te.minHeight="500px",te.padding="0"):te.width="400px",Ge.createElement(He,{appearance:c,onClose:Fe,visible:Ne,style:te,dismissible:x,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Lo,{appearance:c,steps:Q,selectedStep:z,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:Be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:T,validationHandler:h,onFormDataChange:b,showFooter:m,prefillData:P}))}return o==="modal"&&y!=="center"?Ge.createElement(To,{appearance:c,onClose:Fe,visible:Ne,modalPosition:y},Ge.createElement(oe,{appearance:c}),Ge.createElement(Lo,{appearance:c,steps:Q,selectedStep:z,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:Be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:T,validationHandler:h,onFormDataChange:b,showFooter:m,prefillData:P})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Lo,{appearance:c,steps:Q,selectedStep:z,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:Be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:T,validationHandler:h,onFormDataChange:b,showFooter:m,prefillData:P}))},Ki=Gi;import{useCallback as yr,useContext as Sp,useEffect as bp}from"react";function Sr(){let{organizationId:e,userId:t,setOrganizationId:o}=Sp(G),{mutateUserFlowState:i}=Ee(),{config:r,apiUrl:n}=_e(),s=Ot(),{verifySDKInitiated:p}=Lt();function c(x,F){return`frigade-user-group-registered-${x}-${F}`}bp(()=>{if(t&&e){if(t.startsWith(Dt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=yr(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let F={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(F)}),i()},[e,t,r,i]),g=yr(async(x,F)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:F}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()},[e,t,r,i]),d=yr(async(x,F)=>{if(p())if(F){let y=c(t,x);localStorage.setItem(y,"true"),o(x);let S={foreignUserId:t,foreignUserGroupId:x,properties:F};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var qi="frigade-xFrigade_guestUserId",so="frigade-xFrigade_userId",Yi=({})=>{let{setFlowResponses:e}=Jt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ee(),{userId:r,setUserId:n}=Qt(),[s,p]=br(null),{getFlowStatus:c}=J(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=wp(G),[F,y]=br([]),[S,f]=br([]),{organizationId:B}=Sr();Do(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let m=t[b],P=l.find(w=>w.slug===(m==null?void 0:m.flowId));if(P&&m&&m.shouldTrigger===!0&&P.type=="FORM"&&P.triggerType==="AUTOMATIC"&&!S.includes(P.slug)){setTimeout(()=>{T(m.flowId)},500);break}}},[o,t]),Do(()=>{x.length>0&&i()},[x]);function T(b){let m=l.find(P=>P.slug===b);m&&m.triggerType==="AUTOMATIC"&&!S.includes(m.slug)&&(f([...S,m.slug]),y([m]))}function h(){if(!r){let b=localStorage.getItem(so);if(b){n(b);return}let m=localStorage.getItem(qi);if(m){n(m);return}d(!0);let P=Dt+Tp();try{localStorage.setItem(qi,P)}catch(w){console.log("Failed to save guest user id locally: Local storage unavailable",w)}n(w=>w||P)}}Do(()=>{try{if(l){let b=[];l.forEach(m=>{if(m.data){let P=m.data.match(/"imageUri":"(.*?)"/g);P&&P.forEach(w=>{let E=w.replace('"imageUri":"',"").replace('"',"");if(b.includes(E))return;let O=new Image;O.src=E,b.push(E)})}})}}catch{}},[l]),Do(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Dt))try{localStorage.setItem(so,r)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}r===null&&setTimeout(()=>{r===null&&h()},50)},[r,l,g]);function A(){return bt.createElement(bt.Fragment,null,F.map(b=>c(b.slug)!==Me?null:bt.createElement("span",{key:b.slug},bt.createElement(Ki,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return bt.createElement(bt.Fragment,null,bt.createElement(A,null))};import{ErrorBoundary as Xp}from"react-error-boundary";import lo from"core-js-pure/actual/structured-clone";function wr(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(!wr(t)||!wr(o))throw new Error("deepmerge can only merge Objects");let i=lo(t);return Object.entries(o).forEach(([r,n])=>{wr(n)?i[r]!==void 0?Object.assign(i,{[r]:dt(i[r],lo(n))}):Object.assign(i,{[r]:lo(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...lo(n)]}):Object.assign(i,{[r]:lo(n)}):Object.assign(i,{[r]:n})}),i}var Xi={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(Xi[o]){let r=Xi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function kp(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=kp(o);return{overrides:i,css:r}}import zp from"styled-components";import{compose as Wp,variant as Zi}from"styled-system";import Qi from"react";import Pp,{ThemeProvider as vp,useTheme as Bp}from"styled-components";import{border as Ep,color as Ap,compose as Ip,get as Np,shadow as Op,space as Lp,system as Dp,typography as $p}from"styled-system";var Mp={width:{property:"width",scale:"sizes",transform:(e,t)=>Np(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},Up=Pp("div")(({css:e})=>e,Ip(Ep,Ap,Op,Lp,$p,Dp(Mp))),ao=({as:e,children:t,overrides:o,...i})=>{let r=Bp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Qi.createElement(Up,{as:e,...n,...i},t);if(o!==void 0){let p=dt(r,o);return Qi.createElement(vp,{theme:p},s())}return s()};var po={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"}},_p={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Ri=zp(ao)(()=>({whiteSpace:"nowrap"}),Wp(Zi({scale:"components.Button",variants:"components.Button"}),Zi({prop:"size",variants:_p})));import Hp from"styled-components";import{variant as jp,system as Vp}from"styled-system";var $o={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 en=Hp(ao)(jp({scale:"components.Text",variants:"components.Text"}),Vp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var tn=4,on="px",Gp=20,Kp=Object.fromEntries(Array.from(Array(Gp+1),(e,t)=>t===0?[.5,`${.5*tn}${on}`]:[t,`${t*tn}${on}`])),Wt={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"},Tr={colors:{...Wt,neutral:{foreground:Wt.gray300},primary:{background:Wt.blue500,foreground:Wt.white,inverted:Wt.blue500},negative:{foreground:Wt.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:Kp,components:{Button:po,Text:$o}};var rn="https://api.frigade.com",G=qp({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:rn,readonly:!1,debug:!1});function Jp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Qp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var ue,fe;let[n,s]=Le(t||null),[p,c]=Le(o||null),[l,g]=Le([]),[d,x]=Le([]),[F,y]=Le([]),[S,f]=Le({}),[B,T]=Le({}),[h,A]=Le([]),[b,m]=Le({}),[P,w]=Le(!1),[E,O]=Le(!1),[N,I]=Le(!K(e)),$=(W,V)=>{if(V==="_blank"){window.open(W,"_blank");return}setTimeout(()=>{window.location.href=W},50)},D={theme:{...Je.theme,...((ue=i==null?void 0:i.defaultAppearance)==null?void 0:ue.theme)??{}},styleOverrides:{...Je.styleOverrides,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.styleOverrides)??{}}};function K(W){return!!(W&&W.length>10&&W.substring(0,10)==="api_public")}Mo(()=>{t&&s(t)},[t]),Mo(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(so)&&window.localStorage.getItem(so)!==n&&Jp()},[n]),Mo(()=>{o&&c(o)},[o]),Mo(()=>{if(K(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 z={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:F,setFlowResponses:y,userProperties:S,setUserProperties:f,openFlowStates:B,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:h,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:b,setCustomVariables:m,isNewGuestUser:P,setIsNewGuestUser:w,hasActiveFullPageFlow:E,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:I,apiUrl:i&&i.apiUrl?i.apiUrl:rn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(N)return wt.createElement(G.Provider,{value:z},r);let{overrides:q}=Ji(D);return wt.createElement(Xp,{fallback:wt.createElement(wt.Fragment,null,r)},wt.createElement(G.Provider,{value:z},wt.createElement(Yp,{theme:dt(D.theme,Tr,q??{},(i==null?void 0:i.theme)??{})},r,wt.createElement(Yi,null))))};import Wd from"react";import me,{useEffect as Os,useState as Ls}from"react";import We,{useState as gd}from"react";import kt from"styled-components";import Wo from"react";import Tt from"react";import sn from"styled-components";var nn=sn.span`
665
666
  font-weight: 600;
666
667
  font-size: 14px;
667
668
  font-style: normal;
@@ -673,7 +674,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
673
674
  margin-left: 32px;
674
675
  padding-right: 12px;
675
676
  ${e=>ke(e)}
676
- `,Jp=nn.div`
677
+ `,Zp=sn.div`
677
678
  flex-direction: row;
678
679
  justify-content: space-between;
679
680
  display: flex;
@@ -682,11 +683,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
682
683
  padding-right: 8px;
683
684
  width: 100%;
684
685
  ${e=>ke(e)}
685
- `,Mo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(Jp,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:{...r}},i==="left"&&e&&Tt.createElement(rn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Tt.createElement(Qe,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&Tt.createElement(rn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Tt.createElement(oe,{appearance:p}));import po from"styled-components";var sn=po.div`
686
+ `,Uo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(Zp,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:{...r}},i==="left"&&e&&Tt.createElement(nn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Tt.createElement(Qe,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&Tt.createElement(nn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Tt.createElement(oe,{appearance:p}));import co from"styled-components";var ln=co.div`
686
687
  font-weight: 700;
687
688
  font-size: 18px;
688
689
  line-height: 22px;
689
- `,ln=po.p`
690
+ `,an=co.p`
690
691
  font-weight: 600;
691
692
  font-size: 16px;
692
693
  line-height: 24px;
@@ -694,7 +695,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
694
695
  letter-spacing: 0.32px;
695
696
  font-style: normal;
696
697
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
697
- `,an=po.p`
698
+ `,pn=co.p`
698
699
  font-weight: 400;
699
700
  font-size: 14px;
700
701
  font-style: normal;
@@ -703,45 +704,45 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
703
704
  letter-spacing: 0.28px;
704
705
  margin: 8px 0px 0px 0px;
705
706
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
706
- `,Uo=po.div`
707
+ `,zo=co.div`
707
708
  width: 6px;
708
709
  position: absolute;
709
710
  left: 0;
710
711
  height: 100%;
711
712
  border-top-right-radius: 4px;
712
713
  border-bottom-right-radius: 4px;
713
- `,pn=po.div`
714
+ `,dn=co.div`
714
715
  flex-direction: row;
715
716
  justify-content: flex-start;
716
717
  border-bottom: 1px solid ${e=>e.theme.colorBorder};
717
718
  padding-right: 16px;
718
- `;var dn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return zo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&zo.createElement(Uo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),zo.createElement(pn,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},zo.createElement(Mo,{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 Ft from"react";import Fr from"styled-components";import Re from"styled-components";var ph=Re.div`
719
+ `;var cn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return Wo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&Wo.createElement(zo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),Wo.createElement(dn,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Wo.createElement(Uo,{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 Ft from"react";import Fr from"styled-components";import Re from"styled-components";var uh=Re.div`
719
720
  background: #ffffff;
720
721
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
721
722
  border-radius: 20px;
722
723
  width: 385px;
723
724
  padding: 24px 16px 16px 16px;
724
- `,dh=Re.div`
725
+ `,fh=Re.div`
725
726
  /* Border bottom only on collapsable */
726
- `,ch=Re.div`
727
+ `,gh=Re.div`
727
728
  display: flex;
728
729
  flex-direction: row;
729
730
  justify-content: space-between;
730
731
  align-content: flex-start;
731
- `,mh=Re.h1`
732
+ `,xh=Re.h1`
732
733
  display: flex;
733
734
  margin: 0;
734
735
  font-size: 18px;
735
- `,uh=Re.h2`
736
+ `,hh=Re.h2`
736
737
  font-size: 15px;
737
738
  color: #4d4d4d;
738
- `,fh=Re.ul`
739
+ `,Ch=Re.ul`
739
740
  list-style: none;
740
- `,gh=Re.li`
741
+ `,yh=Re.li`
741
742
  display: flex;
742
743
  justify-content: flex-start;
743
744
  flex-direction: row;
744
- `,cn=Re.div`
745
+ `,mn=Re.div`
745
746
  position: absolute;
746
747
  left: 0;
747
748
  top: 0;
@@ -749,7 +750,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
749
750
  width: ${e=>e.fgWidth};
750
751
  border-radius: 20px;
751
752
  background-color: ${e=>e.theme.colorPrimary};
752
- `,mn=Re.div`
753
+ `,un=Re.div`
753
754
  position: relative;
754
755
  left: 0;
755
756
  top: 0;
@@ -759,7 +760,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
759
760
  border-radius: 20px;
760
761
  background-color: ${e=>e.theme.colorPrimary};
761
762
  opacity: 0.12;
762
- `;var Qp=Fr.div`
763
+ `;var Rp=Fr.div`
763
764
  display: flex;
764
765
  flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
765
766
  justify-content: flex-start;
@@ -767,11 +768,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
767
768
  width: 100%;
768
769
 
769
770
  ${e=>ke(e)}
770
- `,Zp=Fr.div`
771
+ `,ed=Fr.div`
771
772
  flex-grow: 1;
772
773
  position: relative;
773
774
  ${e=>e.textLocation=="top"?"width: 100%;":""}
774
- `,Rp=Fr.span`
775
+ `,td=Fr.span`
775
776
  font-weight: 600;
776
777
  font-size: 14px;
777
778
  line-height: 18px;
@@ -779,13 +780,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
779
780
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
780
781
  margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
781
782
  ${e=>ke(e)}
782
- `;var Le=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Ft.createElement(Ft.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Ft.createElement(Qp,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Ft.createElement(Rp,{className:a("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Ft.createElement(Zp,{textLocation:i,className:a("progressBar",s)},Ft.createElement(cn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:a("progressBarFill",s)}),Ft.createElement(mn,{className:a("progressBarBackground",s),barHeight:c,appearance:s})))};import co from"react";import td from"styled-components";import _o from"react";import Wo from"react";var Wt=({stepData:e,appearance:t})=>Wo.createElement(Wo.Fragment,null,Wo.createElement(ln,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:le(e.title)}),Wo.createElement(an,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:le(e.subtitle)}));import kr from"react";var _t=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return kr.createElement(Bo,{className:a("ctaContainer",t)},kr.createElement(Z,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&kr.createElement(Z,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var Ht=({stepData:e,appearance:t})=>_o.createElement(_o.Fragment,null,_o.createElement(Wt,{stepData:e,appearance:t}),_o.createElement(_t,{stepData:e,appearance:t}));import ed from"react";function un(e){return ed.createElement(Ve,{appearance:e.appearance,videoUri:e.videoUri})}var Pr="default",od=td.img`
783
+ `;var De=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Ft.createElement(Ft.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Ft.createElement(Rp,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Ft.createElement(td,{className:a("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Ft.createElement(ed,{textLocation:i,className:a("progressBar",s)},Ft.createElement(mn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:a("progressBarFill",s)}),Ft.createElement(un,{className:a("progressBarBackground",s),barHeight:c,appearance:s})))};import mo from"react";import rd from"styled-components";import Ho from"react";import _o from"react";var _t=({stepData:e,appearance:t})=>_o.createElement(_o.Fragment,null,_o.createElement(an,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:se(e.title)}),_o.createElement(pn,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:se(e.subtitle)}));import kr from"react";var Ht=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return kr.createElement(Eo,{className:a("ctaContainer",t)},kr.createElement(R,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&kr.createElement(R,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var jt=({stepData:e,appearance:t})=>Ho.createElement(Ho.Fragment,null,Ho.createElement(_t,{stepData:e,appearance:t}),Ho.createElement(Ht,{stepData:e,appearance:t}));import od from"react";function fn(e){return od.createElement(Ve,{appearance:e.appearance,videoUri:e.videoUri})}var Pr="default",id=rd.img`
783
784
  border-radius: 4px;
784
785
  max-height: 260px;
785
786
  min-height: 200px;
786
- `,fn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return co.createElement("div",null,o)}return co.createElement(sn,{className:a("checklistStepContent",t)},e.imageUri?co.createElement(od,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?co.createElement(un,{videoUri:e.videoUri,appearance:t}):null,co.createElement(Ht,{stepData:e,appearance:t}))};import Ee,{useRef as rd,useState as id}from"react";import jt from"styled-components";var gn=jt.div`
787
+ `,gn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return mo.createElement("div",null,o)}return mo.createElement(ln,{className:a("checklistStepContent",t)},e.imageUri?mo.createElement(id,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?mo.createElement(fn,{videoUri:e.videoUri,appearance:t}):null,mo.createElement(jt,{stepData:e,appearance:t}))};import Ae,{useRef as nd,useState as sd}from"react";import Vt from"styled-components";var xn=Vt.div`
787
788
  display: block;
788
- `,nd=jt.div`
789
+ `,ld=Vt.div`
789
790
  display: flex;
790
791
  flex-direction: row;
791
792
  flex-wrap: wrap;
@@ -795,20 +796,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
795
796
  align-content: center;
796
797
  margin-top: 24px;
797
798
  margin-bottom: 24px;
798
- `,sd=jt.div`
799
+ `,ad=Vt.div`
799
800
  display: flex;
800
801
  align-items: center;
801
802
  justify-content: flex-start;
802
803
  flex-direction: column;
803
804
  margin-right: 16px;
804
- `,ld=jt.video`
805
+ `,pd=Vt.video`
805
806
  width: 200px;
806
807
  height: 120px;
807
- `,ad=jt.div`
808
+ `,dd=Vt.div`
808
809
  font-size: 14px;
809
810
  line-height: 20px;
810
811
  text-align: center;
811
- `,pd=jt.div`
812
+ `,cd=Vt.div`
812
813
  position: absolute;
813
814
  width: 200px;
814
815
  height: 120px;
@@ -828,9 +829,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
828
829
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
829
830
  border-radius: 50%;
830
831
  }
831
- `,xn="videoCarousel",hn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ee.createElement(gn,null,Ee.createElement(Ht,{stepData:e,appearance:t}));function o({video:n}){let s=rd(),[p,c]=id(!1);return Ee.createElement(sd,null,!p&&Ee.createElement(pd,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ee.createElement(Eo,null)),Ee.createElement(ld,{controls:p,ref:s,play:p,src:n.uri}),Ee.createElement(ad,null,n.title))}let i=e.props;return i.videos?Ee.createElement(gn,null,Ee.createElement(Wt,{stepData:e,appearance:t}),Ee.createElement(nd,null,i.videos.map((n,s)=>Ee.createElement("span",{key:`${n.uri}-${s}`},Ee.createElement(o,{video:n})))),Ee.createElement(_t,{stepData:e,appearance:t})):null};import et from"react";import Ho from"styled-components";var Cn=Ho.div`
832
+ `,hn="videoCarousel",Cn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ae.createElement(xn,null,Ae.createElement(jt,{stepData:e,appearance:t}));function o({video:n}){let s=nd(),[p,c]=sd(!1);return Ae.createElement(ad,null,!p&&Ae.createElement(cd,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ae.createElement(Ao,null)),Ae.createElement(pd,{controls:p,ref:s,play:p,src:n.uri}),Ae.createElement(dd,null,n.title))}let i=e.props;return i.videos?Ae.createElement(xn,null,Ae.createElement(_t,{stepData:e,appearance:t}),Ae.createElement(ld,null,i.videos.map((n,s)=>Ae.createElement("span",{key:`${n.uri}-${s}`},Ae.createElement(o,{video:n})))),Ae.createElement(Ht,{stepData:e,appearance:t})):null};import et from"react";import jo from"styled-components";var yn=jo.div`
832
833
  display: block;
833
- `,dd=Ho.pre`
834
+ `,md=jo.pre`
834
835
  display: block;
835
836
  background-color: #2a2a2a;
836
837
  color: #f8f8f8;
@@ -846,14 +847,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
846
847
  white-space: -o-pre-wrap; /* Opera 7 */
847
848
  word-wrap: break-word; /* Internet Explorer 5.5+ */
848
849
  margin-bottom: 24px;
849
- `,cd=Ho.div`
850
+ `,ud=jo.div`
850
851
  font-size: 15px;
851
852
  line-height: 20px;
852
853
  margin-bottom: 12px;
853
854
  margin-top: 12px;
854
- `,md=Ho.div`
855
+ `,fd=jo.div`
855
856
  margin-top: 24px;
856
- `,yn="codeSnippet",Sn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return et.createElement(Cn,null,et.createElement(Ht,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?et.createElement(Cn,null,et.createElement(Wt,{stepData:e,appearance:t}),et.createElement(md,null,o.codeSnippets.map((r,n)=>et.createElement("div",{key:n},r.title?et.createElement(cd,null,r.title):null,r.code?et.createElement(dd,null,r.code):null))),et.createElement(_t,{stepData:e,appearance:t})):null};var fd=kt.div`
857
+ `,Sn="codeSnippet",bn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return et.createElement(yn,null,et.createElement(jt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?et.createElement(yn,null,et.createElement(_t,{stepData:e,appearance:t}),et.createElement(fd,null,o.codeSnippets.map((r,n)=>et.createElement("div",{key:n},r.title?et.createElement(ud,null,r.title):null,r.code?et.createElement(md,null,r.code):null))),et.createElement(Ht,{stepData:e,appearance:t})):null};var xd=kt.div`
857
858
  display: flex;
858
859
  flex-direction: row;
859
860
  overflow: hidden;
@@ -861,14 +862,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
861
862
  background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
862
863
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
863
864
  ${e=>ke(e)}
864
- `,gd=kt.h1`
865
+ `,hd=kt.h1`
865
866
  font-size: 18px;
866
867
  font-style: normal;
867
868
  font-weight: 700;
868
869
  line-height: 24px;
869
870
  letter-spacing: 0.36px;
870
871
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
871
- `,xd=kt.h2`
872
+ `,Cd=kt.h2`
872
873
  font-size: 14px;
873
874
  font-style: normal;
874
875
  font-weight: 400;
@@ -876,43 +877,43 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
876
877
  letter-spacing: 0.28px;
877
878
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
878
879
  margin: 10px 0px 0px 0px;
879
- `,bn=kt.div``,hd=kt.div`
880
+ `,wn=kt.div``,yd=kt.div`
880
881
  list-style: none;
881
882
  padding: 0;
882
883
  margin: 0;
883
884
  cursor: pointer;
884
885
  width: 300px;
885
- `,Cd=kt.div`
886
+ `,Sd=kt.div`
886
887
  width: 1px;
887
888
  margin-right: 40px;
888
889
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
889
- `,yd=kt.div`
890
+ `,bd=kt.div`
890
891
  flex: 2;
891
892
  padding: 2rem 2rem 2rem 0rem;
892
- `,Sd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:l})=>{let{mergeAppearanceWithDefault:g}=Q();c=g(c);let x={...{[Pr]:fn,[xn]:hn,[yn]:Sn},...p},[F,C]=ud(0),S=r??F,f=n??C,v=o.filter(b=>b.complete===!0).length,w=()=>{var b;return!((b=o[S])!=null&&b.type)||!x[o[S].type]?x[Pr]({stepData:o[S],appearance:c}):x[o[S].type]({stepData:o[S],appearance:c})};return We.createElement(fd,{type:l,styleOverrides:i,className:s,appearance:c},We.createElement(bn,{style:{flex:1}},We.createElement(bn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},We.createElement(gd,{className:a("checklistTitle",c),appearance:c},e),We.createElement(xd,{className:a("checklistSubtitle",c),appearance:c},t),We.createElement(Le,{total:o.length,count:v,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),We.createElement(hd,{className:a("checklistStepsContainer",c)},o.map((b,A)=>We.createElement(dn,{data:b,index:A,key:A,listLength:o.length,isSelected:A===S,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(A)},appearance:c})))),We.createElement(Cd,{appearance:c,className:a("checklistDivider",c)}),We.createElement(yd,null,We.createElement(w,null)))},vr=Sd;import z,{useState as kd}from"react";import wn from"react";import bd from"styled-components";var wd=bd.svg`
893
+ `,wd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:l})=>{let{mergeAppearanceWithDefault:g}=Z();c=g(c);let x={...{[Pr]:gn,[hn]:Cn,[Sn]:bn},...p},[F,y]=gd(0),S=r??F,f=n??y,B=o.filter(h=>h.complete===!0).length,T=()=>{var h;return!((h=o[S])!=null&&h.type)||!x[o[S].type]?x[Pr]({stepData:o[S],appearance:c}):x[o[S].type]({stepData:o[S],appearance:c})};return We.createElement(xd,{type:l,styleOverrides:i,className:s,appearance:c},We.createElement(wn,{style:{flex:1}},We.createElement(wn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},We.createElement(hd,{className:a("checklistTitle",c),appearance:c},e),We.createElement(Cd,{className:a("checklistSubtitle",c),appearance:c},t),We.createElement(De,{total:o.length,count:B,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),We.createElement(yd,{className:a("checklistStepsContainer",c)},o.map((h,A)=>We.createElement(cn,{data:h,index:A,key:A,listLength:o.length,isSelected:A===S,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(A)},appearance:c})))),We.createElement(Sd,{appearance:c,className:a("checklistDivider",c)}),We.createElement(bd,null,We.createElement(T,null)))},vr=wd;import U,{useState as vd}from"react";import Tn from"react";import Td from"styled-components";var Fd=Td.svg`
893
894
  transition: 'transform 0.35s ease-in-out';
894
- `,Vt=({style:e,className:t})=>wn.createElement(wd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},wn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ue from"styled-components";var Br={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Tn=ue.div`
895
+ `,Gt=({style:e,className:t})=>Tn.createElement(Fd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Tn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ge from"styled-components";var Br={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Fn=ge.div`
895
896
  max-height: 350px;
896
897
  padding-bottom: 40px;
897
- `,Fn=ue.div`
898
+ `,kn=ge.div`
898
899
  display: flex;
899
900
  flex-direction: column;
900
901
  margin-top: 20px;
901
- `,kn=ue.h1`
902
+ `,Pn=ge.h1`
902
903
  font-style: normal;
903
904
  font-weight: 600;
904
905
  font-size: 30px;
905
906
  line-height: 36px;
906
907
  margin-bottom: 16px;
907
908
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
908
- `,Pn=ue.h2`
909
+ `,vn=ge.h2`
909
910
  font-weight: 400;
910
911
  font-size: 16px;
911
912
  line-height: 20px;
912
913
  margin-bottom: 16px;
913
914
  padding-left: 1px;
914
915
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
915
- `,vn=ue.div`
916
+ `,Bn=ge.div`
916
917
  ${e=>k(e)} {
917
918
  border: 1px solid #fafafa;
918
919
  }
@@ -922,11 +923,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
922
923
  flex-direction: column;
923
924
  min-height: 240px;
924
925
  overflow: hidden;
925
- `,Bn=ue.div`
926
+ `,En=ge.div`
926
927
  display: flex;
927
928
  flex-direction: row;
928
929
  justify-content: space-between;
929
- `,En=ue.p`
930
+ `,An=ge.p`
930
931
  ${e=>k(e)} {
931
932
  font-weight: 400;
932
933
  font-size: 10px;
@@ -935,12 +936,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
935
936
  color: #8c8c8c;
936
937
  margin: 20px;
937
938
  }
938
- `,An=ue.div`
939
+ `,In=ge.div`
939
940
  display: flex;
940
941
  flex-direction: row;
941
- `,In=ue.div`
942
+ `,Nn=ge.div`
942
943
  flex: 1;
943
- `,Nn=ue.div`
944
+ `,On=ge.div`
944
945
  ${e=>k(e)} {
945
946
  display: flex;
946
947
  justify-content: center;
@@ -950,7 +951,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
950
951
  padding-left: 8px;
951
952
  padding-right: 8px;
952
953
  }
953
- `,On=ue.p`
954
+ `,Ln=ge.p`
954
955
  ${e=>k(e)} {
955
956
  font-style: normal;
956
957
  font-weight: 600;
@@ -962,7 +963,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
962
963
  margin-top: 20px;
963
964
  margin-bottom: 16px;
964
965
  }
965
- `,Ln=ue.p`
966
+ `,Dn=ge.p`
966
967
  ${e=>k(e)} {
967
968
  font-weight: 400;
968
969
  font-size: 14px;
@@ -971,14 +972,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
971
972
  color: ${e=>e.appearance.theme.colorTextSecondary};
972
973
  margin-bottom: 8px;
973
974
  }
974
- `,Dn=ue.div`
975
+ `,$n=ge.div`
975
976
  ${e=>k(e)} {
976
977
  display: flex;
977
978
  flex-direction: row;
978
979
  justify-content: center;
979
980
  gap: 8px;
980
981
  }
981
- `,$n=ue.div`
982
+ `,Mn=ge.div`
982
983
  ${e=>k(e)} {
983
984
  // Anything inside this block will be ignored if the user provides a custom class
984
985
  background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
@@ -998,7 +999,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
998
999
  justify-content: space-between;
999
1000
  position: relative;
1000
1001
  cursor: pointer;
1001
- `,Mn=ue.p`
1002
+ `,Un=ge.p`
1002
1003
  ${e=>k(e)} {
1003
1004
  // Anything inside this block will be ignored if the user provides a custom class
1004
1005
  color: ${e=>e.selected?"#434343":"#BFBFBF"};
@@ -1007,12 +1008,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1007
1008
  font-size: 14px;
1008
1009
  line-height: 22px;
1009
1010
  margin: 0;
1010
- `,Un=ue.div`
1011
+ `,zn=ge.div`
1011
1012
  display: flex;
1012
1013
  flex-direction: row;
1013
1014
  justify-content: flex-end;
1014
1015
  align-content: center;
1015
- `,zn=ue.div`
1016
+ `,Wn=ge.div`
1016
1017
  display: flex;
1017
1018
  flex: 1;
1018
1019
  flex-direction: row;
@@ -1020,14 +1021,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1020
1021
  align-content: center;
1021
1022
  align-items: center;
1022
1023
  margin-right: 20px;
1023
- `,Wn=ue.div`
1024
+ `,_n=ge.div`
1024
1025
  display: block;
1025
1026
  width: 100%;
1026
- `;import Td from"styled-components";var _n=Td.div`
1027
+ `;import kd from"styled-components";var Hn=kd.div`
1027
1028
  flex-direction: column;
1028
1029
  justify-content: center;
1029
1030
  display: flex;
1030
- `;import ot from"react";import tt from"styled-components";var Hn=tt.div`
1031
+ `;import ot from"react";import tt from"styled-components";var jn=tt.div`
1031
1032
  border: 1px solid #fafafa;
1032
1033
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
1033
1034
  border-radius: 14px;
@@ -1035,13 +1036,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1035
1036
  display: flex;
1036
1037
  flex-direction: column;
1037
1038
  overflow: hidden;
1038
- `,jn=tt.div`
1039
+ `,Vn=tt.div`
1039
1040
  display: flex;
1040
1041
  flex-wrap: wrap;
1041
1042
  justify-content: space-between;
1042
1043
  overflow: hidden;
1043
1044
  row-gap: 10px;
1044
- `,Vn=tt.div`
1045
+ `,Gn=tt.div`
1045
1046
  ${e=>k(e)} {
1046
1047
  color: #595959;
1047
1048
  }
@@ -1051,7 +1052,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1051
1052
  line-height: 12px;
1052
1053
  letter-spacing: 0.09em;
1053
1054
  margin-bottom: 12px;
1054
- `,Gn=tt.div`
1055
+ `,Kn=tt.div`
1055
1056
  ${e=>k(e)} {
1056
1057
  // Anything inside this block will be ignored if the user provides a custom class
1057
1058
  background: #ffffff;
@@ -1064,7 +1065,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1064
1065
 
1065
1066
  max-width: 150px;
1066
1067
  min-width: 200px;
1067
- `,Kn=tt.div`
1068
+ `,qn=tt.div`
1068
1069
  ${e=>k(e)} {
1069
1070
  background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
1070
1071
  }
@@ -1076,13 +1077,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1076
1077
  justify-content: center;
1077
1078
  align-content: center;
1078
1079
  align-items: center;
1079
- `,qn=tt.div`
1080
+ `,Yn=tt.div`
1080
1081
  font-weight: 600;
1081
1082
  font-size: 20px;
1082
1083
  line-height: 24px;
1083
1084
  width: 20px;
1084
1085
  height: 20px;
1085
- `,Yn=tt.div`
1086
+ `,Xn=tt.div`
1086
1087
  ${e=>k(e)} {
1087
1088
  color: #434343;
1088
1089
  }
@@ -1091,20 +1092,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1091
1092
  line-height: 17px;
1092
1093
  margin-top: 12px;
1093
1094
  margin-bottom: 8px;
1094
- `,Xn=tt.div`
1095
+ `,Jn=tt.div`
1095
1096
  ${e=>k(e)} {
1096
1097
  color: #8c8c8c;
1097
1098
  }
1098
1099
  font-weight: 400;
1099
1100
  font-size: 12px;
1100
1101
  line-height: 14px;
1101
- `,Jn=tt.a`
1102
+ `,Qn=tt.a`
1102
1103
  color: ${e=>e.color};
1103
1104
  font-size: 12px;
1104
1105
  line-height: 14px;
1105
1106
  font-weight: 400;
1106
1107
  cursor: pointer;
1107
- `;var Fd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return ot.createElement(Hn,{style:t,className:a("guideContainer",r)},ot.createElement(Vn,{className:a("guideTitle",r)},o),ot.createElement(jn,{className:a("guideItemContainer",r)},e.map((p,c)=>ot.createElement(Gn,{key:`guide-${p.id??c}`,className:a("guideItem",r)},p.icon&&ot.createElement(Kn,{className:a("guideIcon",r)},ot.createElement(qn,null,p.icon)),ot.createElement(Yn,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:le(p.title)}),ot.createElement(Xn,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:le(p.subtitle)}),ot.createElement(Jn,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},mo=Fd;var Pd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:l,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let F=({stepData:m,handleSecondaryCTAClick:E,handleCTAClick:T})=>m?z.createElement(Nn,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},z.createElement(On,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:le(m.title)}),z.createElement(Ln,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:le(m.subtitle)}),z.createElement(Dn,{className:a("checklistCTAContainer",l)},m.secondaryButtonTitle&&z.createElement(Z,{title:m.secondaryButtonTitle,onClick:E,appearance:l,secondary:!0}),z.createElement(Z,{title:m.primaryButtonTitle,onClick:T,appearance:l}))):z.createElement(z.Fragment,null),S={...{default:m=>{var L;if((L=e[w])!=null&&L.StepContent){let N=e[w].StepContent;return z.createElement("div",null,N)}let E=e[w];return z.createElement(F,{stepData:m,handleCTAClick:()=>{E.handlePrimaryButtonClick&&E.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{E.handleSecondaryButtonClick&&E.handleSecondaryButtonClick()}})}},...c},[f,v]=kd(0),w=s??f,b=p??v,A=()=>{var m;return e?!((m=e[w])!=null&&m.type)||!S[e[w].type]?S.default(e[w]):S[e[w].type]({stepData:e[w],primaryColor:l.theme.colorPrimary}):z.createElement(z.Fragment,null)},y=e.filter(m=>m.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(Br.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Br),z.createElement(He,{onClose:n,visible:r,appearance:l},z.createElement(Wn,null,z.createElement(Fn,null,z.createElement(kn,{appearance:l,className:a("checklistTitle",l)},t),z.createElement(Pn,{appearance:l,className:a("checklistSubtitle",l)},o)),z.createElement(Tn,null,e&&e.length>0&&z.createElement(vn,{className:a("stepsContainer",l)},z.createElement(Bn,null,z.createElement("div",{style:{flex:3}},z.createElement(En,{className:a("stepsTitle",l)},i)),z.createElement(zn,null,z.createElement(Le,{style:{width:"100%"},count:y,total:e.length,appearance:l}))),z.createElement(An,null,z.createElement(In,{className:a("checklistStepListContainer",l),appearance:l},e.map((m,E)=>{let T=w===E;return z.createElement($n,{selected:T,className:a(`checklistStepListItem${T?"Selected":""}`,l),key:`checklist-guide-step-${m.id??E}`,disabled:m.blocked,onClick:()=>{m.blocked||b(E)},title:m.blocked?"Finish remaining steps to continue":void 0},T&&z.createElement(Uo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),z.createElement(Mn,{selected:T,className:a(`checklistStepListStepName${T?"Selected":""}`,l)},m.stepName),z.createElement(Un,null,z.createElement(Qe,{value:m.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:m.progress,appearance:l}),z.createElement(_n,null,z.createElement(Vt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),z.createElement(A,null))),g&&g.length>0&&z.createElement(mo,{steps:g,title:d,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:m=>(x&&x(m),!0)}))))):z.createElement(z.Fragment,null)},Er=Pd;import ve,{useEffect as cs,useState as vd}from"react";import he from"react";import rt from"styled-components";var Qn=rt.div`
1108
+ `;var Pd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return ot.createElement(jn,{style:t,className:a("guideContainer",r)},ot.createElement(Gn,{className:a("guideTitle",r)},o),ot.createElement(Vn,{className:a("guideItemContainer",r)},e.map((p,c)=>ot.createElement(Kn,{key:`guide-${p.id??c}`,className:a("guideItem",r)},p.icon&&ot.createElement(qn,{className:a("guideIcon",r)},ot.createElement(Yn,null,p.icon)),ot.createElement(Xn,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:se(p.title)}),ot.createElement(Jn,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:se(p.subtitle)}),ot.createElement(Qn,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},uo=Pd;var Bd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:l,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let F=({stepData:m,handleSecondaryCTAClick:P,handleCTAClick:w})=>m?U.createElement(On,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},U.createElement(Ln,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:se(m.title)}),U.createElement(Dn,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:se(m.subtitle)}),U.createElement($n,{className:a("checklistCTAContainer",l)},m.secondaryButtonTitle&&U.createElement(R,{title:m.secondaryButtonTitle,onClick:P,appearance:l,secondary:!0}),U.createElement(R,{title:m.primaryButtonTitle,onClick:w,appearance:l}))):U.createElement(U.Fragment,null),S={...{default:m=>{var O;if((O=e[T])!=null&&O.StepContent){let N=e[T].StepContent;return U.createElement("div",null,N)}let P=e[T];return U.createElement(F,{stepData:m,handleCTAClick:()=>{P.handlePrimaryButtonClick&&P.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{P.handleSecondaryButtonClick&&P.handleSecondaryButtonClick()}})}},...c},[f,B]=vd(0),T=s??f,h=p??B,A=()=>{var m;return e?!((m=e[T])!=null&&m.type)||!S[e[T].type]?S.default(e[T]):S[e[T].type]({stepData:e[T],primaryColor:l.theme.colorPrimary}):U.createElement(U.Fragment,null)},b=e.filter(m=>m.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(Br.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Br),U.createElement(He,{onClose:n,visible:r,appearance:l},U.createElement(_n,null,U.createElement(kn,null,U.createElement(Pn,{appearance:l,className:a("checklistTitle",l)},t),U.createElement(vn,{appearance:l,className:a("checklistSubtitle",l)},o)),U.createElement(Fn,null,e&&e.length>0&&U.createElement(Bn,{className:a("stepsContainer",l)},U.createElement(En,null,U.createElement("div",{style:{flex:3}},U.createElement(An,{className:a("stepsTitle",l)},i)),U.createElement(Wn,null,U.createElement(De,{style:{width:"100%"},count:b,total:e.length,appearance:l}))),U.createElement(In,null,U.createElement(Nn,{className:a("checklistStepListContainer",l),appearance:l},e.map((m,P)=>{let w=T===P;return U.createElement(Mn,{selected:w,className:a(`checklistStepListItem${w?"Selected":""}`,l),key:`checklist-guide-step-${m.id??P}`,disabled:m.blocked,onClick:()=>{m.blocked||h(P)},title:m.blocked?"Finish remaining steps to continue":void 0},w&&U.createElement(zo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),U.createElement(Un,{selected:w,className:a(`checklistStepListStepName${w?"Selected":""}`,l)},m.stepName),U.createElement(zn,null,U.createElement(Qe,{value:m.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:m.progress,appearance:l}),U.createElement(Hn,null,U.createElement(Gt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),U.createElement(A,null))),g&&g.length>0&&U.createElement(uo,{steps:g,title:d,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:m=>(x&&x(m),!0)}))))):U.createElement(U.Fragment,null)},Er=Bd;import ve,{useEffect as ms,useState as Ed}from"react";import Ce from"react";import rt from"styled-components";var Zn=rt.div`
1108
1109
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1109
1110
  border: 1px solid;
1110
1111
  border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -1116,19 +1117,19 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1116
1117
  display: flex;
1117
1118
  flex-direction: column;
1118
1119
  transition: max-height 0.25s;
1119
- `,Zn=rt.div`
1120
+ `,Rn=rt.div`
1120
1121
  display: flex;
1121
1122
  margin-bottom: 20px;
1122
- `,Rn=rt.img`
1123
+ `,es=rt.img`
1123
1124
  border-radius: 4px;
1124
1125
  max-height: 260px;
1125
1126
  min-height: 200px;
1126
- `,es=rt.div`
1127
+ `,ts=rt.div`
1127
1128
  display: flex;
1128
1129
  flex-direction: row;
1129
1130
  justify-content: space-between;
1130
1131
  align-items: center;
1131
- `,ts=rt.p`
1132
+ `,os=rt.p`
1132
1133
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1133
1134
  font-style: normal;
1134
1135
  font-weight: 500;
@@ -1139,23 +1140,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1139
1140
  :hover {
1140
1141
  opacity: 0.8;
1141
1142
  }
1142
- `,os=rt.div`
1143
+ `,rs=rt.div`
1143
1144
  cursor: pointer;
1144
1145
  color: ${e=>e.appearance.theme.colorTextSecondary};
1145
1146
  :hover {
1146
1147
  opacity: 0.8;
1147
1148
  }
1148
- `,ay=rt.div``,rs=rt.p`
1149
+ `,my=rt.div``,is=rt.p`
1149
1150
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1150
1151
  font-weight: 400;
1151
1152
  font-size: 14px;
1152
1153
  line-height: 22px;
1153
- `,is=rt.div`
1154
+ `,ns=rt.div`
1154
1155
  display: flex;
1155
1156
  flex-direction: row;
1156
1157
  justify-content: flex-start;
1157
1158
  align-items: center;
1158
- `;var ns=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d;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 l(){return he.createElement(he.Fragment,null,e.imageUri||e.videoUri?he.createElement(Zn,{className:a("stepMediaContainer",n)},e.imageUri?he.createElement(Rn,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?he.createElement(Ve,{appearance:n,videoUri:e.videoUri}):null):null,he.createElement(rs,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:le(e.subtitle)}),he.createElement(Bo,{className:a("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 x=s[e.type];return x?x(e,n):null}return he.createElement(Qn,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},he.createElement(es,{className:a("stepHeader",n)},he.createElement(is,null,he.createElement(Mo,{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(ts,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:le(e.title),onClick:()=>o()})),he.createElement(os,{className:a("stepChevronContainer",n),onClick:()=>o(),appearance:n},he.createElement(Vt,{style:{...p,transition:"transform 0.2s ease-in-out"}}))),he.createElement("div",{key:e.id,style:{...c}},g()??l()))};import Gt from"styled-components";var by=Gt.div`
1159
+ `;var ss=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d;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 l(){return Ce.createElement(Ce.Fragment,null,e.imageUri||e.videoUri?Ce.createElement(Rn,{className:a("stepMediaContainer",n)},e.imageUri?Ce.createElement(es,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Ce.createElement(Ve,{appearance:n,videoUri:e.videoUri}):null):null,Ce.createElement(is,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:se(e.subtitle)}),Ce.createElement(Eo,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?Ce.createElement(R,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,Ce.createElement(R,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let x=s[e.type];return x?x(e,n):null}return Ce.createElement(Zn,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},Ce.createElement(ts,{className:a("stepHeader",n)},Ce.createElement(ns,null,Ce.createElement(Uo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),Ce.createElement(os,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:se(e.title),onClick:()=>o()})),Ce.createElement(rs,{className:a("stepChevronContainer",n),onClick:()=>o(),appearance:n},Ce.createElement(Gt,{style:{...p,transition:"transform 0.2s ease-in-out"}}))),Ce.createElement("div",{key:e.id,style:{...c}},g()??l()))};import Kt from"styled-components";var ky=Kt.div`
1159
1160
  background: #ffffff;
1160
1161
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
1161
1162
  border-radius: 6px;
@@ -1169,26 +1170,26 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1169
1170
 
1170
1171
  max-width: 800px;
1171
1172
  min-width: 350px;
1172
- `,ss=Gt.div`
1173
+ `,ls=Kt.div`
1173
1174
  display: flex;
1174
1175
  flex-direction: column;
1175
- `,ls=Gt.h1`
1176
+ `,as=Kt.h1`
1176
1177
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1177
1178
  font-style: normal;
1178
1179
  font-weight: 700;
1179
1180
  font-size: 20px;
1180
1181
  line-height: 24px;
1181
1182
  margin-bottom: 8px;
1182
- `,as=Gt.h2`
1183
+ `,ps=Kt.h2`
1183
1184
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
1184
1185
  font-weight: 400;
1185
1186
  font-size: 14px;
1186
1187
  line-height: 23px;
1187
1188
  margin: 2px 0 0 0;
1188
- `,ps=Gt.div`
1189
+ `,ds=Kt.div`
1189
1190
  display: block;
1190
1191
  width: 100%;
1191
- `,ds=Gt.div`
1192
+ `,cs=Kt.div`
1192
1193
  display: flex;
1193
1194
  width: 100%;
1194
1195
  flex-direction: column;
@@ -1196,23 +1197,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1196
1197
  padding: 24px;
1197
1198
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
1198
1199
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1199
- `;var Bd=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:l,appearance:g,type:d,className:x,customStepTypes:F,style:C})=>{let S=o.filter(y=>y.complete).length,[f,v]=vd(Array(o.length).fill(!0));cs(()=>{let y=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){y[m]=!1;break}v(y)}},[]),cs(()=>{w(c)},[c]);let w=y=>{let m=[...f];if(s)for(let E=0;E<f.length;++E)E!==y&&(m[E]=!0);m[y]=!m[y],v(m)};if(!r&&d=="modal")return ve.createElement(ve.Fragment,null);let b=ve.createElement(ve.Fragment,null,ve.createElement(ss,null,ve.createElement(ls,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:le(e)}),ve.createElement(as,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:le(t)})),ve.createElement(Le,{display:"percent",count:S,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),A=ve.createElement(ps,{className:xe(a("checklistContainer",g),x)},o.map((y,m)=>{let E=f[m];return ve.createElement(ns,{appearance:g,stepData:y,collapsed:E,key:`modal-checklist-${y.id??m}`,onClick:()=>{if(c===m){w(m);return}l(m)},onPrimaryButtonClick:()=>{y.handlePrimaryButtonClick&&y.handlePrimaryButtonClick(),p&&!y.completionCriteria&&m<f.length-1&&f[m+1]&&l(m+1)},onSecondaryButtonClick:()=>{y.handleSecondaryButtonClick&&y.handleSecondaryButtonClick()},customStepTypes:F})}));return d==="inline"?ve.createElement(ds,{appearance:g,className:xe(a("checklistInlineContainer",g),x),style:C},b,A):ve.createElement(ve.Fragment,null,ve.createElement(He,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:b},A))},Ar=Bd;import ae,{useEffect as Ir,useRef as $d,useState as Pt}from"react";import{useEffect as Ed,useState as Ad}from"react";var ms=()=>{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]=Ad(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,l])=>{if(!window)return[c,!1];let g=window.matchMedia(l);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return Ed(()=>{s()},[]),o};import Kt from"react";import de,{css as us,keyframes as fs}from"styled-components";var gs=us`
1200
+ `;var Ad=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:l,appearance:g,type:d,className:x,customStepTypes:F,style:y})=>{let S=o.filter(b=>b.complete).length,[f,B]=Ed(Array(o.length).fill(!0));ms(()=>{let b=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){b[m]=!1;break}B(b)}},[]),ms(()=>{T(c)},[c]);let T=b=>{let m=[...f];if(s)for(let P=0;P<f.length;++P)P!==b&&(m[P]=!0);m[b]=!m[b],B(m)};if(!r&&d=="modal")return ve.createElement(ve.Fragment,null);let h=ve.createElement(ve.Fragment,null,ve.createElement(ls,null,ve.createElement(as,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:se(e)}),ve.createElement(ps,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:se(t)})),ve.createElement(De,{display:"percent",count:S,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),A=ve.createElement(ds,{className:he(a("checklistContainer",g),x)},o.map((b,m)=>{let P=f[m];return ve.createElement(ss,{appearance:g,stepData:b,collapsed:P,key:`modal-checklist-${b.id??m}`,onClick:()=>{if(c===m){T(m);return}l(m)},onPrimaryButtonClick:()=>{b.handlePrimaryButtonClick&&b.handlePrimaryButtonClick(),p&&!b.completionCriteria&&m<f.length-1&&f[m+1]&&l(m+1)},onSecondaryButtonClick:()=>{b.handleSecondaryButtonClick&&b.handleSecondaryButtonClick()},customStepTypes:F})}));return d==="inline"?ve.createElement(cs,{appearance:g,className:he(a("checklistInlineContainer",g),x),style:y},h,A):ve.createElement(ve.Fragment,null,ve.createElement(He,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:h},A))},Ar=Ad;import le,{useEffect as Ir,useRef as Ud,useState as Pt}from"react";import{useEffect as Id,useState as Nd}from"react";var us=()=>{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]=Nd(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,l])=>{if(!window)return[c,!1];let g=window.matchMedia(l);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return Id(()=>{s()},[]),o};import qt from"react";import de,{css as fs,keyframes as gs}from"styled-components";var xs=fs`
1200
1201
  border: 1px solid ${({theme:e})=>e.colorBorder};
1201
- `,Id=us`
1202
+ `,Od=fs`
1202
1203
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
1203
- `,Nd=fs`
1204
+ `,Ld=gs`
1204
1205
  from {
1205
1206
  opacity: 0;
1206
1207
  } to {
1207
1208
  opacity: 1;
1208
1209
  }
1209
- `,Od=fs`
1210
+ `,Dd=gs`
1210
1211
  from {
1211
1212
  opacity: 1;
1212
1213
  } to {
1213
1214
  opacity: 0;
1214
1215
  }
1215
- `,xs=de.div`
1216
+ `,hs=de.div`
1216
1217
  margin: 0 -20px;
1217
1218
  overflow-x: auto;
1218
1219
  padding-left: 20px;
@@ -1229,14 +1230,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1229
1230
  ::-webkit-scrollbar {
1230
1231
  display: none;
1231
1232
  }
1232
- `,hs=de.div`
1233
+ `,Cs=de.div`
1233
1234
  display: flex;
1234
1235
  flex-flow: row nowrap;
1235
1236
  gap: 0 16px;
1236
1237
  scroll-snap-align: center;
1237
1238
  scroll-snap-stop: always;
1238
- `,Cs=de.div`
1239
- animation: ${e=>e.reversed?Od:Nd} 0.25s ease-out;
1239
+ `,ys=de.div`
1240
+ animation: ${e=>e.reversed?Dd:Ld} 0.25s ease-out;
1240
1241
  background: linear-gradient(
1241
1242
  to right,
1242
1243
  ${({theme:e})=>e.colorBackground}00,
@@ -1245,8 +1246,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1245
1246
  position: absolute;
1246
1247
  width: 64px;
1247
1248
  z-index: 10;
1248
- `,ys=de.button`
1249
- ${gs}
1249
+ `,Ss=de.button`
1250
+ ${xs}
1250
1251
  box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
1251
1252
  align-items: center;
1252
1253
  border-radius: 50%;
@@ -1257,11 +1258,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1257
1258
  justify-content: center;
1258
1259
  position: absolute;
1259
1260
  width: 48px;
1260
- `,Ss=de.div`
1261
+ `,bs=de.div`
1261
1262
  border-radius: ${({theme:e})=>e.borderRadius}px;
1262
1263
  padding: 20px;
1263
- `,bs=de(Ss)`
1264
- ${gs}
1264
+ `,ws=de(bs)`
1265
+ ${xs}
1265
1266
  background: ${({theme:e})=>e.colorBackground};
1266
1267
  position: relative;
1267
1268
 
@@ -1273,86 +1274,86 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1273
1274
  ${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
1274
1275
  ${e=>e.blocked?"cursor: default":"cursor: pointer"}
1275
1276
  }
1276
- `,ws=de.img`
1277
+ `,Ts=de.img`
1277
1278
  border-radius: 50%;
1278
1279
  height: 40px;
1279
1280
  margin-bottom: 12px;
1280
1281
  width: 40px;
1281
- `,Ts=de(Ss)`
1282
+ `,Fs=de(bs)`
1282
1283
  ${e=>k(e)} {
1283
- ${Id}
1284
+ ${Od}
1284
1285
 
1285
1286
  background: ${({theme:e})=>e.colorBackground};
1286
1287
  }
1287
- `,Uy=de.div`
1288
+ `,Hy=de.div`
1288
1289
  color: ${({theme:e})=>e.colorPrimary};
1289
1290
  display: flex;
1290
1291
  flex-flow: row nowrap;
1291
1292
  align-items: center;
1292
- `,zy=de.div`
1293
+ `,jy=de.div`
1293
1294
  white-space: nowrap;
1294
- `,Fs=de.div`
1295
+ `,ks=de.div`
1295
1296
  background: #d8fed8;
1296
1297
  border-radius: 6px;
1297
1298
  float: right;
1298
1299
  margin-bottom: 12px;
1299
1300
  padding: 4px 10px;
1300
- `,Ld=de.p`
1301
+ `,$d=de.p`
1301
1302
  font-weight: bold;
1302
1303
  font-size: 18px;
1303
1304
  line-height: 22px;
1304
1305
  letter-spacing: calc(18px * -0.01);
1305
1306
  margin: 0;
1306
- `,ks=de(Ld)`
1307
+ `,Ps=de($d)`
1307
1308
  margin-bottom: 4px;
1308
- `,Ps=de.div`
1309
+ `,vs=de.div`
1309
1310
  display: flex;
1310
1311
  flex-flow: row nowrap;
1311
1312
  align-items: center;
1312
1313
  min-width: 50%;
1313
- `,Dd=de.p`
1314
+ `,Md=de.p`
1314
1315
  font-weight: bold;
1315
1316
  font-size: 16px;
1316
1317
  line-height: 20px;
1317
1318
  letter-spacing: calc(16px * -0.01);
1318
1319
  margin: 0;
1319
- `,vs=de(Dd)`
1320
+ `,Bs=de(Md)`
1320
1321
  margin-bottom: 4px;
1321
1322
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1322
1323
  `}
1323
- `,dt=de.p`
1324
+ `,ct=de.p`
1324
1325
  color: ${({theme:e})=>e.colorText};
1325
1326
  font-weight: normal;
1326
1327
  font-size: 14px;
1327
1328
  line-height: 22px;
1328
1329
  margin: 0;
1329
- `,Bs=de.p`
1330
+ `,Es=de.p`
1330
1331
  color: ${({theme:e})=>e.colorText};
1331
1332
  font-weight: 600;
1332
1333
  font-size: 12px;
1333
1334
  line-height: 16px;
1334
1335
  margin: 0;
1335
- `;dt.Loud=de(dt)`
1336
+ `;ct.Loud=de(ct)`
1336
1337
  font-weight: 600;
1337
- `;dt.Quiet=de(dt)`
1338
+ `;ct.Quiet=de(ct)`
1338
1339
  color: ${({theme:e})=>e.colorTextSecondary};
1339
1340
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1340
1341
  `}
1341
- `;var Es=({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:l=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return Kt.createElement(bs,{className:a("carouselCard",o),onClick:l?null:d,style:t,blocked:l,complete:c},n&&Kt.createElement(ws,{className:a("carouselCardImage",o),src:n,alt:p,style:{opacity:c||l?.4:1}}),c&&Kt.createElement(Fs,{className:a("carouselCompletedPill",o)},Kt.createElement(Bs,{style:{color:"#108E0B"}},"Complete")),p&&Kt.createElement(vs,{blocked:l,complete:c,className:a("carouselCardTitle",o)},p),s&&Kt.createElement(dt.Quiet,{blocked:l,complete:c,className:a("carouselCardSubtitle",o)},s))};var Md=()=>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"})),As=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=Pt(!1),[n,s]=Pt(!1);Ir(()=>{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(Cs,{style:c,reversed:n,onAnimationEnd:n?p:null},ae.createElement(ys,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ae.createElement(Md,null))):null},Is=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=$d(null),[n,s]=Pt(!1),[p,c]=Pt(!1),[l,g]=Pt(null),[d,x]=Pt([]),[F,C]=Pt(0),{isSmall:S}=ms(),f=S?1:3,{getFlowMetadata:v,getFlowSteps:w,getNumberOfStepsCompleted:b,updateCustomVariables:A,isLoading:y}=Y();Ir(()=>{A(o)},[o,y]),Ir(()=>{if(y)return;let N=v(e),I=b(e),$=w(e);g(N),N.data!==null&&(x($.sort((D,ee)=>Number(D.complete)-Number(ee.complete))),c($.length>f),C(I))},[y]);let m=[];for(let N=0;N<d.length;N+=f)m.push(d.slice(N,N+f));let E=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"})},B=null,L=N=>{B!==null?clearTimeout(B):E(N),B=setTimeout(()=>{E(N)},16)};return y?null:ae.createElement(Ts,{className:xe(a("carouselContainer",t),i)},ae.createElement("div",{style:{display:"flex",justifyContent:S?"center":"space-between",marginBottom:20,flexWrap:S?"wrap":"nowrap",gap:S?16:20}},ae.createElement("div",null,ae.createElement(ks,{className:a("carouselTitle",t)},l==null?void 0:l.title),ae.createElement(dt.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ae.createElement(Ps,{className:a("progressWrapper",t)},ae.createElement(Le,{count:F,total:d.length,appearance:t}))),ae.createElement("div",{style:{position:"relative"}},ae.createElement(As,{show:n,onClick:()=>T(!1)}),ae.createElement(As,{side:"right",show:p,onClick:T}),ae.createElement(xs,{ref:r,onScroll:L},m.map((N,I)=>ae.createElement(hs,{key:I,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},N.map(($,D)=>ae.createElement(Es,{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 Nr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:l,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:F,setVisible:C,customStepTypes:S,checklistStyle:f="default",autoExpandFirstIncompleteStep:v,autoExpandNextStep:w,...b})=>{let{getFlow:A,getFlowSteps:y,markStepCompleted:m,getStepStatus:E,getNumberOfStepsCompleted:T,isLoading:B,targetingLogicShouldHideFlow:L,updateCustomVariables:N,getFlowMetadata:I,isStepBlocked:$,getFlowStatus:D,hasActiveFullPageFlow:ee,setHasActiveFullPageFlow:U}=Y(),{primaryCTAClickSideEffects:te,secondaryCTAClickSideEffects:fe}=ie(),{getOpenFlowState:X,setOpenFlowState:H}=we(),[j,Ce]=Os(r||0),[Ie,be]=Os(!1),me=c===void 0?X(e):c,J=s==="modal",{mergeAppearanceWithDefault:ge}=Q();if(x=ge(x),Ns(()=>{N(l)},[l,B]),Ns(()=>{c!==void 0&&(J&&c===!0?U(!0):J&&c===!1&&U(!1))},[c,C,ee]),B)return null;let re=A(e);if(!re||L(re))return null;let O=y(e);if(!O||F===!0&&D(e)===q)return null;let V=I(e);if(V!=null&&V.title&&(t=V.title),V!=null&&V.subtitle&&(o=V.subtitle),!Ie&&r===void 0&&T(e)>0){let u=O.findIndex(h=>h.complete===!1);Ce(u>-1?u:O.length-1),be(!0)}function G(){if(j+1>=O.length){J&&H(e,!1);return}$(e,O[j+1].id)||Ce(j+1)}function ne(u,h,P){let W=j+1<O.length?O[j+1]:null;d&&d(u,j,h,W)===!0&&J&&De(),g&&g(u,P,W),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&J&&De()}function se(){return O.map((u,h)=>({...u,handleSecondaryButtonClick:()=>{G(),fe(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ne(u,"secondary",h)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),G()),ne(u,"primary",h),te(u),E(e,u.id)===Ue&&G()}}))}function pe(){return ce.createElement(oe,{appearance:x})}let Ye={steps:se(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:S,type:s,className:n,autoExpandFirstIncompleteStep:v,autoExpandNextStep:w};function De(){H(e,!1),p&&p(),C&&C(!1)}function Et(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Is,{flowId:e,appearance:x,customVariables:l,className:n}))}function ft(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Ar,{visible:me,onClose:()=>{De()},selectedStep:j,setSelectedStep:Ce,autoExpandNextStep:!0,appearance:x,...Ye}))}function At(){let u=b.guideFlowId,h;return u&&A(u)&&(h=y(u)),ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Er,{visible:me,stepsTitle:V.stepsTitle?V.stepsTitle:"Your quick start guide",onClose:()=>{De()},selectedStep:j,setSelectedStep:Ce,guideData:h,guideTitle:b.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:P=>{ne(P,"link",0)},customStepTypes:S,...Ye}))}function gt(){let u=ce.createElement(vr,{flowId:e,style:i,selectedStep:j,setSelectedStep:Ce,appearance:x,type:s,...Ye});return J?ce.createElement(He,{onClose:()=>{De()},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 ft();case"with-guide":return At();case"default":return gt();case"carousel":return Et();default:return gt()}};var zd=e=>Ud.createElement(Nr,{type:"inline",...e});import mt,{useEffect as Wd}from"react";import Ke from"react";import jo from"styled-components";var Ls=jo.div`
1342
+ `;var As=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Z(),{primaryCTAClickSideEffects:r}=ie();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:l=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return qt.createElement(ws,{className:a("carouselCard",o),onClick:l?null:d,style:t,blocked:l,complete:c},n&&qt.createElement(Ts,{className:a("carouselCardImage",o),src:n,alt:p,style:{opacity:c||l?.4:1}}),c&&qt.createElement(ks,{className:a("carouselCompletedPill",o)},qt.createElement(Es,{style:{color:"#108E0B"}},"Complete")),p&&qt.createElement(Bs,{blocked:l,complete:c,className:a("carouselCardTitle",o)},p),s&&qt.createElement(ct.Quiet,{blocked:l,complete:c,className:a("carouselCardSubtitle",o)},s))};var zd=()=>le.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},le.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),le.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),le.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Is=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=Pt(!1),[n,s]=Pt(!1);Ir(()=>{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?le.createElement(ys,{style:c,reversed:n,onAnimationEnd:n?p:null},le.createElement(Ss,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},le.createElement(zd,null))):null},Ns=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=Ud(null),[n,s]=Pt(!1),[p,c]=Pt(!1),[l,g]=Pt(null),[d,x]=Pt([]),[F,y]=Pt(0),{isSmall:S}=us(),f=S?1:3,{getFlowMetadata:B,getFlowSteps:T,getNumberOfStepsCompleted:h,updateCustomVariables:A,isLoading:b}=J();Ir(()=>{A(o)},[o,b]),Ir(()=>{if(b)return;let N=B(e),I=h(e),$=T(e);g(N),N.data!==null&&(x($.sort((D,K)=>Number(D.complete)-Number(K.complete))),c($.length>f),y(I))},[b]);let m=[];for(let N=0;N<d.length;N+=f)m.push(d.slice(N,N+f));let P=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)},w=(N=!0)=>{let I=N?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*I,behavior:"smooth"})},E=null,O=N=>{E!==null?clearTimeout(E):P(N),E=setTimeout(()=>{P(N)},16)};return b?null:le.createElement(Fs,{className:he(a("carouselContainer",t),i)},le.createElement("div",{style:{display:"flex",justifyContent:S?"center":"space-between",marginBottom:20,flexWrap:S?"wrap":"nowrap",gap:S?16:20}},le.createElement("div",null,le.createElement(Ps,{className:a("carouselTitle",t)},l==null?void 0:l.title),le.createElement(ct.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),le.createElement(vs,{className:a("progressWrapper",t)},le.createElement(De,{count:F,total:d.length,appearance:t}))),le.createElement("div",{style:{position:"relative"}},le.createElement(Is,{show:n,onClick:()=>w(!1)}),le.createElement(Is,{side:"right",show:p,onClick:w}),le.createElement(hs,{ref:r,onScroll:O},m.map((N,I)=>le.createElement(Cs,{key:I,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},N.map(($,D)=>le.createElement(As,{key:D,stepData:$,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),le.createElement(oe,{appearance:t}))};var Nr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:l,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:F,setVisible:y,customStepTypes:S,checklistStyle:f="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:T,...h})=>{let{getFlow:A,getFlowSteps:b,markStepCompleted:m,getStepStatus:P,getNumberOfStepsCompleted:w,isLoading:E,targetingLogicShouldHideFlow:O,updateCustomVariables:N,getFlowMetadata:I,isStepBlocked:$,getFlowStatus:D,hasActiveFullPageFlow:K,setHasActiveFullPageFlow:z}=J(),{primaryCTAClickSideEffects:q,secondaryCTAClickSideEffects:ue}=ie(),{getOpenFlowState:fe,setOpenFlowState:W}=be(),[V,re]=Ls(r||0),[Ne,Be]=Ls(!1),xe=c===void 0?fe(e):c,Q=s==="modal",{mergeAppearanceWithDefault:Fe}=Z();if(x=Fe(x),Os(()=>{N(l)},[l,E]),Os(()=>{c!==void 0&&(Q&&c===!0?z(!0):Q&&c===!1&&z(!1))},[c,y,K]),E)return null;let te=A(e);if(!te||O(te))return null;let L=b(e);if(!L||F===!0&&D(e)===X)return null;let M=I(e);if(M!=null&&M.title&&(t=M.title),M!=null&&M.subtitle&&(o=M.subtitle),!Ne&&r===void 0&&w(e)>0){let u=L.findIndex(C=>C.complete===!1);re(u>-1?u:L.length-1),Be(!0)}function j(){if(V+1>=L.length){Q&&W(e,!1);return}$(e,L[V+1].id)||re(V+1)}function ae(u,C,v){let _=V+1<L.length?L[V+1]:null;d&&d(u,V,C,_)===!0&&Q&&$e(),g&&g(u,v,_),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&Q&&$e()}function ne(){return L.map((u,C)=>({...u,handleSecondaryButtonClick:()=>{j(),ue(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ae(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),j()),ae(u,"primary",C),q(u),P(e,u.id)===Ue&&j()}}))}function pe(){return me.createElement(oe,{appearance:x})}let Ye={steps:ne(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:S,type:s,className:n,autoExpandFirstIncompleteStep:B,autoExpandNextStep:T};function $e(){W(e,!1),p&&p(),y&&y(!1)}function At(){return me.createElement(me.Fragment,null,me.createElement(pe,null),me.createElement(Ns,{flowId:e,appearance:x,customVariables:l,className:n}))}function ft(){return me.createElement(me.Fragment,null,me.createElement(pe,null),me.createElement(Ar,{visible:xe,onClose:()=>{$e()},selectedStep:V,setSelectedStep:re,autoExpandNextStep:!0,appearance:x,...Ye}))}function It(){let u=h.guideFlowId,C;return u&&A(u)&&(C=b(u)),me.createElement(me.Fragment,null,me.createElement(pe,null),me.createElement(Er,{visible:xe,stepsTitle:M.stepsTitle?M.stepsTitle:"Your quick start guide",onClose:()=>{$e()},selectedStep:V,setSelectedStep:re,guideData:C,guideTitle:h.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:v=>{ae(v,"link",0)},customStepTypes:S,...Ye}))}function gt(){let u=me.createElement(vr,{flowId:e,style:i,selectedStep:V,setSelectedStep:re,appearance:x,type:s,...Ye});return Q?me.createElement(He,{onClose:()=>{$e()},visible:xe,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},me.createElement(pe,null),u):me.createElement(me.Fragment,null,me.createElement(pe,null),u)}switch(f){case"condensed":return ft();case"with-guide":return It();case"default":return gt();case"carousel":return At();default:return gt()}};var _d=e=>Wd.createElement(Nr,{type:"inline",...e});import ut,{useEffect as Hd}from"react";import Ke from"react";import Vo from"styled-components";var Ds=Vo.div`
1342
1343
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1343
1344
  border-radius: 8px;
1344
1345
  padding: 6px 10px 6px 10px;
1345
1346
  min-width: 160px;
1346
1347
  cursor: pointer;
1347
1348
  background-color: ${e=>e.appearance.theme.colorBackground}};
1348
- `,Ds=jo.div`
1349
+ `,$s=Vo.div`
1349
1350
  display: flex;
1350
1351
  flex-direction: row;
1351
1352
  justify-content: space-between;
1352
1353
  align-items: center;
1353
1354
  margin-bottom: 2px;
1354
1355
  flex-grow: 2;
1355
- `,$s=jo.div`
1356
+ `,Ms=Vo.div`
1356
1357
  text-overflow: ellipsis;
1357
1358
  font-weight: 600;
1358
1359
  font-size: 12px;
@@ -1360,13 +1361,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1360
1361
  margin-right: ${e=>e.type==="condensed"?"8px":"0"};
1361
1362
  text-align: ${e=>e.type==="condensed"?"left":"right"};
1362
1363
  color: ${e=>e.appearance.theme.colorPrimary};
1363
- `,Ms=jo.div`
1364
+ `,Us=Vo.div`
1364
1365
  width: 20px;
1365
1366
  margin-right: 8px;
1366
1367
  display: flex;
1367
1368
  height: 100%;
1368
1369
  align-items: center;
1369
- `;var Us=({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(Ls,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:xe(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ke.createElement(Ms,{className:a("progressRingContainer",s)},Ke.createElement($t,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ke.createElement(Ds,{type:p,className:a("badgeTitleContainer",s)},Ke.createElement($s,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&Ke.createElement(Vt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ke.createElement(Le,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import ct from"react";import uo from"styled-components";var zs=uo.div`
1370
+ `;var zs=({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(Ds,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:he(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ke.createElement(Us,{className:a("progressRingContainer",s)},Ke.createElement(Mt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ke.createElement($s,{type:p,className:a("badgeTitleContainer",s)},Ke.createElement(Ms,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&Ke.createElement(Gt,{className:a("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 fo from"styled-components";var Ws=fo.div`
1370
1371
  display: flex;
1371
1372
  flex-direction: row;
1372
1373
  width: 100%;
@@ -1377,25 +1378,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1377
1378
  border-width: 1px;
1378
1379
  border-color: ${e=>e.appearance.theme.colorPrimary};
1379
1380
  border-radius: 12px;
1380
- `,Ws=uo.div`
1381
+ `,_s=fo.div`
1381
1382
  ${e=>k(e)} {
1382
1383
  display: flex;
1383
1384
  justify-content: center;
1384
1385
  align-items: center;
1385
1386
  margin-right: 16px;
1386
1387
  }
1387
- `,_s=uo.div`
1388
+ `,Hs=fo.div`
1388
1389
  display: flex;
1389
1390
  flex-direction: column;
1390
1391
  flex: 1;
1391
1392
  margin-top: 0;
1392
- `,Hs=uo.div`
1393
+ `,js=fo.div`
1393
1394
  display: flex;
1394
1395
  flex-direction: column;
1395
1396
  justify-content: center;
1396
1397
  margin-left: 16px;
1397
1398
  min-width: 200px;
1398
- `,$0=uo.div`
1399
+ `,W0=fo.div`
1399
1400
  display: flex;
1400
1401
  justify-content: center;
1401
1402
  align-items: flex-end;
@@ -1404,7 +1405,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1404
1405
  :hover {
1405
1406
  opacity: 0.8;
1406
1407
  }
1407
- `;var js=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>ct.createElement(ct.Fragment,null,ct.createElement(zs,{appearance:i,className:xe(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&ct.createElement(Ws,{className:a("fullWidthProgressBadgeIcon",i)},o),ct.createElement(_s,null,ct.createElement(Fe,{size:"small",appearance:i,title:e,subtitle:t})),ct.createElement(Hs,{className:a("fullWidthProgressBadgeProgressContainer",i)},ct.createElement(Le,{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:l,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:F,getNumberOfStepsCompleted:C,isLoading:S,targetingLogicShouldHideFlow:f,updateCustomVariables:v}=Y(),{mergeAppearanceWithDefault:w}=Q();l=w(l);let{setOpenFlowState:b,getOpenFlowState:A}=we();if(Wd(()=>{v(p)},[p,S]),S)return null;let y=d(e);if(!y||f(y)||c===!0&&F(e)===q)return null;let m=x(e),E=C(e);return g==="full-width"?mt.createElement(mt.Fragment,null,mt.createElement(oe,{appearance:l}),mt.createElement(js,{title:t,subtitle:o,count:E,total:m.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):mt.createElement(mt.Fragment,null,mt.createElement(oe,{appearance:l}),mt.createElement(Us,{count:E,total:m.length,title:t,style:r,onClick:()=>{b(e,!0),n&&n()},type:g,className:s,appearance:l}))};import Hd from"react";var jd=({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 l=s(e);return Hd.createElement(mo,{steps:l,style:t,appearance:o,...i})};import ut,{useContext as ec,useEffect as tc}from"react";import _,{useEffect as Vo,useLayoutEffect as Gs,useRef as qd,useState as fo}from"react";import go from"styled-components";import{useCallback as Vd,useEffect as Gd,useState as Kd}from"react";var Or=(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 Vs(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]=Kd(o),n=Vd(()=>{e&&r(e.getBoundingClientRect())},[e]);return Gd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}var Ks=300,qs=100,Yd=500,qt=12,Xd=go.div`
1408
+ `;var Vs=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>mt.createElement(mt.Fragment,null,mt.createElement(Ws,{appearance:i,className:he(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&mt.createElement(_s,{className:a("fullWidthProgressBadgeIcon",i)},o),mt.createElement(Hs,null,mt.createElement(Te,{size:"small",appearance:i,title:e,subtitle:t})),mt.createElement(js,{className:a("fullWidthProgressBadgeProgressContainer",i)},mt.createElement(De,{count:r,total:n,display:"percent",textLocation:"top"}))));var jd=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:l,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:F,getNumberOfStepsCompleted:y,isLoading:S,targetingLogicShouldHideFlow:f,updateCustomVariables:B}=J(),{mergeAppearanceWithDefault:T}=Z();l=T(l);let{setOpenFlowState:h,getOpenFlowState:A}=be();if(Hd(()=>{B(p)},[p,S]),S)return null;let b=d(e);if(!b||f(b)||c===!0&&F(e)===X)return null;let m=x(e),P=y(e);return g==="full-width"?ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:l}),ut.createElement(Vs,{title:t,subtitle:o,count:P,total:m.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:l}),ut.createElement(zs,{count:P,total:m.length,title:t,style:r,onClick:()=>{h(e,!0),n&&n()},type:g,className:s,appearance:l}))};import Vd from"react";var Gd=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=J(),{mergeAppearanceWithDefault:p}=Z();o=p(o);let c=r(e);if(!c||n(c))return null;let l=s(e);return Vd.createElement(uo,{steps:l,style:t,appearance:o,...i})};import vt,{useContext as ic,useEffect as nc}from"react";import H,{useEffect as Go,useLayoutEffect as qs,useRef as Qd,useState as go}from"react";import xo from"styled-components";import{useCallback as Kd,useEffect as qd,useState as Yd}from"react";var Or=(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 Gs(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]=Yd(o),n=Kd(()=>{e&&r(e.getBoundingClientRect())},[e]);return qd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}import{useContext as Xd,useState as Jd}from"react";function Ks(){let{debug:e}=Xd(G),[t,o]=Jd([]);function i(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.log(n)))}function r(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.warn(n)))}return{logIfDebugMode:i,logErrorIfDebugMode:r}}var Ys=300,Xs=100,Zd=500,Yt=12,Rd=xo.div`
1408
1409
  width: 100%;
1409
1410
  height: 100%;
1410
1411
  border-radius: 9999px;
@@ -1427,25 +1428,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1427
1428
  opacity: 0;
1428
1429
  }
1429
1430
  }
1430
- `,Jd=go.div`
1431
- width: ${qt}px;
1432
- height: ${qt}px;
1431
+ `,ec=xo.div`
1432
+ width: ${Yt}px;
1433
+ height: ${Yt}px;
1433
1434
  border-radius: 100px;
1434
1435
  background-color: ${e=>e.primaryColor};
1435
1436
  z-index: 20;
1436
1437
  opacity: 1;
1437
- `,Qd=go.div`
1438
+ `,tc=xo.div`
1438
1439
  pointer-events: all;
1439
- `,Ys=go.div`
1440
+ `,Js=xo.div`
1440
1441
  display: flex;
1441
1442
  align-content: center;
1442
1443
  justify-content: center;
1443
1444
  align-items: center;
1444
1445
  z-index: ${e=>e.zIndex?e.zIndex:90};
1445
- `,Zd=go(Ys)`
1446
- width: ${qt+12}px;
1447
- height: ${qt+12}px;
1448
- `,Rd=({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:l=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:F,showStepCount:C=!0,completedStepsCount:S=0,showFrigadeBranding:f=!1,cssPosition:v="absolute"})=>{var se,pe,Ye,De,Et,ft,At,gt,u,h,P,W;let[w,b]=fo(),[A,y]=fo(new Date),m=qd(null),[E,T]=fo(document.querySelector(e[l].selector)),B=Vs(E,A),[L,N]=fo(),[I,$]=fo(!F),D=(pe=(se=e[l])==null?void 0:se.props)!=null&&pe.position?e[l].props.position:v,ee=((De=(Ye=e[l])==null?void 0:Ye.props)==null?void 0:De.zIndex)??90,U=(w==null?void 0:w.width)??Ks,te=(w==null?void 0:w.height)??qs,fe=window.location.pathname.split("/").pop();Gs(()=>{m.current&&b({width:m.current.clientWidth,height:m.current.clientHeight})},[l,A,D]),Vo(()=>{F||$(!0)},[l]);let X=()=>{let M=document.querySelector(e[l].selector);if(!M){N(void 0),T(null);return}L&&L===JSON.stringify(M==null?void 0:M.getBoundingClientRect())||(T(M),y(new Date),M&&N(JSON.stringify(M.getBoundingClientRect())))};if(Vo(()=>{let M=new MutationObserver(X);return M.observe(document.body,{subtree:!0,childList:!0}),()=>M.disconnect()},[X]),Vo(()=>{let M=new MutationObserver(X);return M.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>M.disconnect()},[X]),Vo(()=>{let M=setInterval(()=>{X()},10);return()=>clearInterval(M)},[X]),Gs(()=>{setTimeout(()=>{X()},Yd),X()},[l,fe]),E===null||!p||B.height===0&&B.width===0&&D!=="fixed"&&v!=="static")return null;let H=i==="auto"?"right":i,j=Or(B,H,U,s,D),Ce=B.right+U>(window.innerWidth||document.documentElement.clientWidth),Ie=B.bottom+qs>(window.innerHeight||document.documentElement.clientHeight);Ce&&i==="auto"&&(j=Or(B,"left",U,s,D),H="left"),(ft=(Et=e[l])==null?void 0:Et.props)!=null&&ft.tooltipPosition&&((gt=(At=e[l])==null?void 0:At.props)==null?void 0:gt.tooltipPosition)!=="auto"&&(((h=(u=e[l])==null?void 0:u.props)==null?void 0:h.tooltipPosition)==="left"||((W=(P=e[l])==null?void 0:P.props)==null?void 0:W.tooltipPosition)==="right")&&(H=e[l].props.tooltipPosition);let be=()=>{let M=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),$(!1),setTimeout(()=>{X()},30)),S===e.length-1)return o()},$e=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),F&&!e[l].secondaryButtonUri&&$(!1))};return _.createElement(_.Fragment,null,C&&e.length>1&&_.createElement(Rr,null,_.createElement(ti,{className:a("tooltipStepCounter",d)},l+1," of ",e.length)),_.createElement(ei,{showStepCount:C,className:a("tooltipCTAContainer",d)},e[l].secondaryButtonTitle&&_.createElement(Z,{title:e[l].secondaryButtonTitle,appearance:d,onClick:$e,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&_.createElement(Z,{title:e[l].primaryButtonTitle,appearance:d,onClick:M,withMargin:!1,size:"small"})))},me=()=>_.createElement(_.Fragment,null,x&&_.createElement(Yr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",d),hasImage:!!e[l].imageUri||!!e[l].videoUri},_.createElement(Te,null)),e[l].imageUri&&_.createElement(Xr,{dismissible:x,appearance:d,src:e[l].imageUri,className:a("tooltipImageContainer",d)}),e[l].videoUri&&!e[l].imageUri&&_.createElement(Jr,{dismissible:x,appearance:d,className:a("tooltipVideoContainer",d)},_.createElement(Ve,{appearance:d,videoUri:e[l].videoUri})),_.createElement(Zr,{className:a("tooltipContentContainer",d)},_.createElement(Fe,{appearance:d,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),_.createElement(Qr,{className:a("tooltipFooter",d)},_.createElement(be,null)))),ge={...{default:M=>{var $e;if(($e=e[l])!=null&&$e.StepContent){let Nl=e[l].StepContent;return _.createElement("div",null,Nl)}return _.createElement(me,null)}},...g},re=()=>{var M;return e?!((M=e[l])!=null&&M.type)||!ge[e[l].type]?ge.default(e[l]):ge[e[l].type]({stepData:e[l],primaryColor:n}):_.createElement(_.Fragment,null)};if(F&&e[l].complete===!0)return null;let O={top:(j==null?void 0:j.y)-qt,left:(H=="left"?B.x+s.x:(j==null?void 0:j.x)-qt)??0,cursor:F?"pointer":"default",position:D},V=()=>{let $e=O.left+(H=="left"?-U:24);return Math.min(Math.max($e,20),window.innerWidth-U-20)},G=()=>{if(D==="fixed")return O.top;let M=O.top+te,$e=20;return M>window.innerHeight-$e?O.top+-te:O.top},ne=()=>{F&&(y(new Date),$(!I))};return _.createElement(Qd,null,_.createElement(Zd,{style:O,zIndex:ee,className:a("tourHighlightContainer",d)},r&&e[l].showHighlight!==!1&&v!=="static"&&_.createElement(_.Fragment,null,_.createElement(Jd,{style:{position:D},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightInnerCircle",d)}),_.createElement(Xd,{style:{position:"absolute"},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightOuterCircle",d)}))),_.createElement(Ys,{style:{...O,left:V(),top:G()},zIndex:ee+1,className:a("tooltipContainerWrapper",d)},I&&_.createElement(_.Fragment,null,_.createElement(Co,{ref:m,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:v!=="static"?12:0,...c},appearance:d,className:a("tooltipContainer",d),maxWidth:Ks,zIndex:ee+10},_.createElement(re,null)),f&&_.createElement(ri,{className:a("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:ee+10},_.createElement(yo,{appearance:d})))))},Go=Rd;import{Portal as oc}from"react-portal";var rc=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:l=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:F="absolute",...C})=>{let{getFlow:S,getFlowSteps:f,isLoading:v,targetingLogicShouldHideFlow:w,markStepCompleted:b,markStepStarted:A,markFlowCompleted:y,updateCustomVariables:m,getCurrentStepIndex:E,getStepStatus:T,isStepBlocked:B,getFlowStatus:L,getNumberOfStepsCompleted:N}=Y(),{isLoadingUserFlowStateData:I}=Be(),{primaryCTAClickSideEffects:$,secondaryCTAClickSideEffects:D}=ie(),{hasOpenModals:ee}=we(),U=E(e),{openFlowStates:te}=ec(K),{mergeAppearanceWithDefault:fe}=Q();if(o=fe(o),tc(()=>{m(t)},[t,v]),I)return null;let X=S(e);if(!X||w(X)||L(e)==q||ee())return null;let H=f(e);if(Object.keys(te).length>0){let O=Object.keys(te).find(V=>te[V]===!0);if(O!==void 0&&O!==e)return ut.createElement(ut.Fragment,null)}async function j(O){if(await b(e,O.id),H.map(V=>T(e,V.id)).every(V=>V===Ue)){await y(e);return}if(!l&&U+1<H.length){if(B(e,H[U+1].id))return;await A(e,H[U+1].id)}}function Ce(O,V,G){let ne=U+1<H.length?H[U+1]:null;r&&r(O,U,V,ne),i&&i(O,G,ne)}function Ie(){return H.map(O=>({...O,handleSecondaryButtonClick:async()=>{D(O),O.skippable===!0&&await b(e,O.id,{skipped:!0}),Ce(O,"secondary",U)},handlePrimaryButtonClick:async()=>{(!O.completionCriteria&&(O.autoMarkCompleted||O.autoMarkCompleted===void 0)||O.completionCriteria&&O.autoMarkCompleted===!0)&&await j(O),Ce(O,"primary",U),$(O)}}))}async function be(O){s&&s(),g==="complete-flow"?await y(e):await b(e,O.id)}function me(){d&&d()}let J=!document.querySelector(H[U].selector);function ge(){let O=H.findIndex(V=>!!document.querySelector(V.selector));return H.map((V,G)=>J&&!n&&G!==O&&x?null:ut.createElement(Go,{key:V.id,appearance:o,steps:Ie(),selectedStep:G,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>be(V),tooltipPosition:c,showHighlightOnly:l,completedStepsCount:N(e),onComplete:me,cssPosition:F,...C}))}function re(){return ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:o}),n||J&&x?ge():ut.createElement(Go,{appearance:o,steps:Ie(),selectedStep:U,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>be(H[U]),tooltipPosition:c,completedStepsCount:N(e),showHighlightOnly:l,onComplete:me,cssPosition:F,...C}))}return F==="static"?re():ut.createElement(oc,null,re())};import Ae,{useEffect as ic,useRef as nc,useState as sc}from"react";import{Portal as lc}from"react-portal";import vt from"styled-components";var Xs=vt.button`
1446
+ `,oc=xo(Js)`
1447
+ width: ${Yt+12}px;
1448
+ height: ${Yt+12}px;
1449
+ `,rc=({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:l=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:F,showStepCount:y=!0,completedStepsCount:S=0,showFrigadeBranding:f=!1,cssPosition:B="absolute"})=>{var pe,Ye,$e,At,ft,It,gt,u,C,v,_,ce;let{logErrorIfDebugMode:T}=Ks(),[h,A]=go(),[b,m]=go(new Date),P=Qd(null),[w,E]=go(document.querySelector(e[l].selector)),O=Gs(w,b),[N,I]=go(),[$,D]=go(!F),K=(Ye=(pe=e[l])==null?void 0:pe.props)!=null&&Ye.position?e[l].props.position:B,z=((At=($e=e[l])==null?void 0:$e.props)==null?void 0:At.zIndex)??90,q=(h==null?void 0:h.width)??Ys,ue=(h==null?void 0:h.height)??Xs,fe=window.location.pathname.split("/").pop();qs(()=>{P.current&&A({width:P.current.clientWidth,height:P.current.clientHeight})},[l,b,K]),Go(()=>{F||D(!0)},[l]);let W=()=>{let Y=document.querySelector(e[l].selector);if(!Y){I(void 0),E(null),T(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}N&&N===JSON.stringify(Y==null?void 0:Y.getBoundingClientRect())||(E(Y),m(new Date),Y&&I(JSON.stringify(Y.getBoundingClientRect())))};if(Go(()=>{let Y=new MutationObserver(W);return Y.observe(document.body,{subtree:!0,childList:!0}),()=>Y.disconnect()},[W]),Go(()=>{let Y=new MutationObserver(W);return Y.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>Y.disconnect()},[W]),Go(()=>{let Y=setInterval(()=>{W()},10);return()=>clearInterval(Y)},[W]),qs(()=>{setTimeout(()=>{W()},Zd),W()},[l,fe]),w===null||!p||O.height===0&&O.width===0&&K!=="fixed"&&B!=="static")return null;let V=i==="auto"?"right":i,re=Or(O,V,q,s,K),Ne=O.right+q>(window.innerWidth||document.documentElement.clientWidth),Be=O.bottom+Xs>(window.innerHeight||document.documentElement.clientHeight);Ne&&i==="auto"&&(re=Or(O,"left",q,s,K),V="left"),(It=(ft=e[l])==null?void 0:ft.props)!=null&&It.tooltipPosition&&((u=(gt=e[l])==null?void 0:gt.props)==null?void 0:u.tooltipPosition)!=="auto"&&(((v=(C=e[l])==null?void 0:C.props)==null?void 0:v.tooltipPosition)==="left"||((ce=(_=e[l])==null?void 0:_.props)==null?void 0:ce.tooltipPosition)==="right")&&(V=e[l].props.tooltipPosition);let xe=()=>{let Y=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),D(!1),setTimeout(()=>{W()},30)),S===e.length-1)return o()},nt=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),F&&!e[l].secondaryButtonUri&&D(!1))};return H.createElement(H.Fragment,null,y&&e.length>1&&H.createElement(ei,null,H.createElement(oi,{className:a("tooltipStepCounter",d)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&H.createElement(ti,{showStepCount:y,className:a("tooltipCTAContainer",d)},e[l].secondaryButtonTitle&&H.createElement(R,{title:e[l].secondaryButtonTitle,appearance:d,onClick:nt,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&H.createElement(R,{title:e[l].primaryButtonTitle,appearance:d,onClick:Y,withMargin:!1,size:"small"})))},Q=()=>H.createElement(H.Fragment,null,x&&H.createElement(Xr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",d),hasImage:!!e[l].imageUri||!!e[l].videoUri},H.createElement(we,null)),e[l].imageUri&&H.createElement(Jr,{dismissible:x,appearance:d,src:e[l].imageUri,className:a("tooltipImageContainer",d)}),e[l].videoUri&&!e[l].imageUri&&H.createElement(Qr,{dismissible:x,appearance:d,className:a("tooltipVideoContainer",d)},H.createElement(Ve,{appearance:d,videoUri:e[l].videoUri})),H.createElement(Rr,{className:a("tooltipContentContainer",d)},H.createElement(Te,{appearance:d,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),H.createElement(Zr,{className:a("tooltipFooter",d)},H.createElement(xe,null)))),te={...{default:Y=>{var nt;if((nt=e[l])!=null&&nt.StepContent){let Ll=e[l].StepContent;return H.createElement("div",null,Ll)}return H.createElement(Q,null)}},...g},L=()=>{var Y;return e?!((Y=e[l])!=null&&Y.type)||!te[e[l].type]?te.default(e[l]):te[e[l].type]({stepData:e[l],primaryColor:n}):H.createElement(H.Fragment,null)};if(F&&e[l].complete===!0)return null;let M={top:(re==null?void 0:re.y)-Yt,left:(V=="left"?O.x+s.x:(re==null?void 0:re.x)-Yt)??0,cursor:F?"pointer":"default",position:K},j=()=>{let nt=M.left+(V=="left"?-q:24);return Math.min(Math.max(nt,20),window.innerWidth-q-20)},ae=()=>{if(K==="fixed")return M.top;let Y=M.top+ue,nt=20;return Y>window.innerHeight-nt?M.top+-ue:M.top},ne=()=>{F&&(m(new Date),D(!$))};return H.createElement(tc,null,H.createElement(oc,{style:M,zIndex:z,className:a("tourHighlightContainer",d)},r&&e[l].showHighlight!==!1&&B!=="static"&&H.createElement(H.Fragment,null,H.createElement(ec,{style:{position:K},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightInnerCircle",d)}),H.createElement(Rd,{style:{position:"absolute"},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightOuterCircle",d)}))),H.createElement(Js,{style:{...M,left:j(),top:ae()},zIndex:z+1,className:a("tooltipContainerWrapper",d)},$&&H.createElement(H.Fragment,null,H.createElement(yo,{ref:P,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:B!=="static"?12:0,...c},appearance:d,className:a("tooltipContainer",d),maxWidth:Ys,zIndex:z+10},H.createElement(L,null)),f&&H.createElement(ii,{className:a("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:z+10},H.createElement(So,{appearance:d})))))},Lr=rc;import{Portal as sc}from"react-portal";var lc=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:l=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:F="absolute",...y})=>{let{getFlow:S,getFlowSteps:f,isLoading:B,targetingLogicShouldHideFlow:T,markStepCompleted:h,markStepStarted:A,markFlowCompleted:b,updateCustomVariables:m,getCurrentStepIndex:P,getStepStatus:w,isStepBlocked:E,getFlowStatus:O,getNumberOfStepsCompleted:N}=J(),{isLoadingUserFlowStateData:I}=Ee(),{primaryCTAClickSideEffects:$,secondaryCTAClickSideEffects:D}=ie(),{hasOpenModals:K}=be(),z=P(e),{openFlowStates:q}=ic(G),{mergeAppearanceWithDefault:ue}=Z();if(o=ue(o),nc(()=>{m(t)},[t,B]),I)return null;let fe=S(e);if(!fe||T(fe)||O(e)==X||K())return null;let W=f(e);if(Object.keys(q).length>0){let L=Object.keys(q).find(M=>q[M]===!0);if(L!==void 0&&L!==e)return vt.createElement(vt.Fragment,null)}async function V(L){if(await h(e,L.id),W.map(M=>w(e,M.id)).every(M=>M===Ue)){await b(e);return}if(!l&&z+1<W.length){if(E(e,W[z+1].id))return;await A(e,W[z+1].id)}}function re(L,M,j){let ae=z+1<W.length?W[z+1]:null;r&&r(L,z,M,ae),i&&i(L,j,ae)}function Ne(){return W.map(L=>({...L,handleSecondaryButtonClick:async()=>{D(L),L.skippable===!0&&await h(e,L.id,{skipped:!0}),re(L,"secondary",z)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await V(L),re(L,"primary",z),$(L)}}))}async function Be(L){s&&s(),g==="complete-flow"?await b(e):await h(e,L.id)}function xe(){d&&d()}let Q=!document.querySelector(W[z].selector);function Fe(){let L=W.findIndex(M=>!!document.querySelector(M.selector));return W.map((M,j)=>Q&&!n&&j!==L&&x||!n&&j!==z?null:vt.createElement(Lr,{key:M.id,appearance:o,steps:Ne(),selectedStep:j,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>Be(M),tooltipPosition:c,showHighlightOnly:l,completedStepsCount:N(e),onComplete:xe,cssPosition:F,...y}))}function te(){return vt.createElement(vt.Fragment,null,vt.createElement(oe,{appearance:o}),Fe())}return F==="static"?te():vt.createElement(sc,null,te())};import Ie,{useEffect as ac,useRef as pc,useState as dc}from"react";import{Portal as cc}from"react-portal";import Bt from"styled-components";var Qs=Bt.button`
1449
1450
  ${e=>k(e)} {
1450
1451
  // Anything inside this block will be ignored if the user provides a custom class
1451
1452
 
@@ -1463,17 +1464,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1463
1464
  opacity: 0.8;
1464
1465
  }
1465
1466
  }
1466
- `,Js=vt.span`
1467
+ `,Zs=Bt.span`
1467
1468
  ${e=>k(e)} {
1468
1469
  font-size: 12px;
1469
1470
  display: inline-block;
1470
1471
  }
1471
- `,Qs=vt.span`
1472
+ `,Rs=Bt.span`
1472
1473
  ${e=>k(e)} {
1473
1474
  font-size: 12px;
1474
1475
  display: inline-block;
1475
1476
  }
1476
- `,Zs=vt.div`
1477
+ `,el=Bt.div`
1477
1478
  position: fixed;
1478
1479
  right: 0;
1479
1480
  bottom: 0;
@@ -1483,7 +1484,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1483
1484
  flex-direction: column;
1484
1485
  align-items: flex-end;
1485
1486
  z-index: 50;
1486
- `,Rs=vt.button`
1487
+ `,tl=Bt.button`
1487
1488
  ${e=>k(e)} {
1488
1489
  // Anything inside this block will be ignored if the user provides a custom class
1489
1490
  background-color: #ffffff;
@@ -1499,7 +1500,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1499
1500
  0px 3px 6px -4px rgba(0, 0, 0, 0.12);
1500
1501
  border-radius: 45px;
1501
1502
  cursor: pointer;
1502
- `,el=vt.div`
1503
+ `,ol=Bt.div`
1503
1504
  ${e=>k(e)} {
1504
1505
  // Anything inside this block will be ignored if the user provides a custom class
1505
1506
  background: #ffffff;
@@ -1516,7 +1517,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1516
1517
  position: ${e=>e.type=="inline"?"absolute":"relative"};
1517
1518
  top: ${e=>e.type=="inline"?"68px":0};
1518
1519
  margin-left: ${e=>e.type=="inline"?"-127px":0};
1519
- `,tl=vt.button`
1520
+ `,rl=Bt.button`
1520
1521
  ${e=>k(e)} {
1521
1522
  // Anything inside this block will be ignored if the user provides a custom class
1522
1523
  color: #434343;
@@ -1533,7 +1534,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1533
1534
  font-size: 14px;
1534
1535
 
1535
1536
  padding: 8px 12px;
1536
- `;import ol from"react";var rl=({style:e,className:t})=>ol.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},ol.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 il from"react";var nl=({style:e,className:t})=>il.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"},il.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 ac=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:l,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F}=Y(),{primaryCTAClickSideEffects:C}=ie(),S=nc(null),[f,v]=sc(!1),{mergeAppearanceWithDefault:w}=Q();s=w(s),ic(()=>(document.addEventListener("click",b,!1),()=>{document.removeEventListener("click",b,!1)}),[]);let b=T=>{S.current&&!S.current.contains(T.target)&&v(!1)};if(x)return null;let A=p(e);if(!A||F(A))return null;let y=c(e);if(!y||!i)return null;function m(T,B){!T.completionCriteria&&(T.autoMarkCompleted||T.autoMarkCompleted===void 0)&&l(e,T.id),C(T),o&&o(T,B),v(!1)}function E(){return f&&Ae.createElement(el,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},y.map((T,B)=>Ae.createElement(tl,{className:a("floatingWidgetMenuItem",s),key:B,onClick:()=>m(T,B)},T.title)))}return r=="inline"?Ae.createElement("span",{ref:S},Ae.createElement(Xs,{style:t,onClick:()=>{v(!f)},className:a("supportButton",s)},Ae.createElement(Qs,{className:a("supportIconContainer",s)},Ae.createElement(nl,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ae.createElement(Js,{className:a("supportButtonTitle",s)},n)),Ae.createElement(E,null)):Ae.createElement(lc,null,Ae.createElement(Zs,{style:t,ref:S},Ae.createElement(E,null),Ae.createElement(Rs,{onClick:()=>{v(!f)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ae.createElement(rl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import qe,{useEffect as pc}from"react";import Ko from"styled-components";var sl=Ko.div`
1537
+ `;import il from"react";var nl=({style:e,className:t})=>il.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},il.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 sl from"react";var ll=({style:e,className:t})=>sl.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"},sl.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 mc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:l,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F}=J(),{primaryCTAClickSideEffects:y}=ie(),S=pc(null),[f,B]=dc(!1),{mergeAppearanceWithDefault:T}=Z();s=T(s),ac(()=>(document.addEventListener("click",h,!1),()=>{document.removeEventListener("click",h,!1)}),[]);let h=w=>{S.current&&!S.current.contains(w.target)&&B(!1)};if(x)return null;let A=p(e);if(!A||F(A))return null;let b=c(e);if(!b||!i)return null;function m(w,E){!w.completionCriteria&&(w.autoMarkCompleted||w.autoMarkCompleted===void 0)&&l(e,w.id),y(w),o&&o(w,E),B(!1)}function P(){return f&&Ie.createElement(ol,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},b.map((w,E)=>Ie.createElement(rl,{className:a("floatingWidgetMenuItem",s),key:E,onClick:()=>m(w,E)},w.title)))}return r=="inline"?Ie.createElement("span",{ref:S},Ie.createElement(Qs,{style:t,onClick:()=>{B(!f)},className:a("supportButton",s)},Ie.createElement(Rs,{className:a("supportIconContainer",s)},Ie.createElement(ll,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ie.createElement(Zs,{className:a("supportButtonTitle",s)},n)),Ie.createElement(P,null)):Ie.createElement(cc,null,Ie.createElement(el,{style:t,ref:S},Ie.createElement(P,null),Ie.createElement(tl,{onClick:()=>{B(!f)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ie.createElement(nl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import qe,{useEffect as uc}from"react";import Ko from"styled-components";var al=Ko.div`
1537
1538
  ${e=>k(e)} {
1538
1539
  display: flex;
1539
1540
  flex-direction: column;
@@ -1548,17 +1549,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1548
1549
  border-radius: 12px;
1549
1550
  position: relative;
1550
1551
  }
1551
- `,ll=Ko.div`
1552
+ `,pl=Ko.div`
1552
1553
  display: flex;
1553
1554
  flex-direction: column;
1554
1555
  flex: 1;
1555
- `,al=Ko.div`
1556
+ `,dl=Ko.div`
1556
1557
  display: flex;
1557
1558
  flex-direction: column;
1558
1559
  justify-content: center;
1559
1560
  align-items: flex-start;
1560
1561
  margin-top: 16px;
1561
- `,pl=Ko.div`
1562
+ `,cl=Ko.div`
1562
1563
  ${e=>k(e)} {
1563
1564
  position: absolute;
1564
1565
  top: 16px;
@@ -1569,7 +1570,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1569
1570
  opacity: 0.8;
1570
1571
  }
1571
1572
  }
1572
- `;var dc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowSteps:C,getFlowStatus:S,getCurrentStepIndex:f}=Y(),{primaryCTAClickSideEffects:v}=ie(),{mergeAppearanceWithDefault:w}=Q();if(r=w(r),pc(()=>{F(o)},[o,d]),d)return null;let b=c(e);if(!b||x(b)||S(e)===q)return null;let y=C(e)[f(e)];return qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:r}),qe.createElement(sl,{appearance:r,className:xe(a("embeddedTipContainer",r),n),style:s},(p===!0||y.dismissible)&&qe.createElement(pl,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},qe.createElement(Te,null)),qe.createElement(ll,null,qe.createElement(Fe,{size:"small",appearance:r,title:y.title,subtitle:y.subtitle})),y.primaryButtonTitle&&qe.createElement(al,{className:a("embeddedTipCallToActionContainer",r)},qe.createElement(Z,{classPrefix:"embeddedTip",title:y.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{y.handlePrimaryButtonClick(),v(y),!(i&&i(y,f(e),"primary")===!1)&&(await g(e,y.id),await l(e))}}))))};import ye,{useEffect as cc}from"react";import Yt from"styled-components";var dl=Yt.div`
1573
+ `;var fc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowSteps:y,getFlowStatus:S,getCurrentStepIndex:f}=J(),{primaryCTAClickSideEffects:B}=ie(),{mergeAppearanceWithDefault:T}=Z();if(r=T(r),uc(()=>{F(o)},[o,d]),d)return null;let h=c(e);if(!h||x(h)||S(e)===X)return null;let b=y(e)[f(e)];return qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:r}),qe.createElement(al,{appearance:r,className:he(a("embeddedTipContainer",r),n),style:s},(p===!0||b.dismissible)&&qe.createElement(cl,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},qe.createElement(we,null)),qe.createElement(pl,null,qe.createElement(Te,{size:"small",appearance:r,title:b.title,subtitle:b.subtitle})),b.primaryButtonTitle&&qe.createElement(dl,{className:a("embeddedTipCallToActionContainer",r)},qe.createElement(R,{classPrefix:"embeddedTip",title:b.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{b.handlePrimaryButtonClick(),B(b),!(i&&i(b,f(e),"primary")===!1)&&(await g(e,b.id),await l(e))}}))))};import ye,{useEffect as gc}from"react";import Xt from"styled-components";var ml=Xt.div`
1573
1574
  // use the :not annotation
1574
1575
  ${e=>k(e)} {
1575
1576
  display: flex;
@@ -1581,24 +1582,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1581
1582
  background-color: ${e=>e.appearance.theme.colorBackground};
1582
1583
  border-radius: 12px;
1583
1584
  }
1584
- `,cl=Yt.div`
1585
+ `,ul=Xt.div`
1585
1586
  ${e=>k(e)} {
1586
1587
  display: flex;
1587
1588
  width: 46px;
1588
1589
  height: 46px;
1589
1590
  }
1590
- `,ml=Yt.div`
1591
+ `,fl=Xt.div`
1591
1592
  display: flex;
1592
1593
  flex-direction: column;
1593
1594
  flex: 1;
1594
1595
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1595
1596
  margin-top: ${e=>e.type==="square"?"12px":"0"};
1596
- `,ul=Yt.div`
1597
+ `,gl=Xt.div`
1597
1598
  display: flex;
1598
1599
  flex-direction: column;
1599
1600
  justify-content: center;
1600
1601
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1601
- `,Lr=Yt.div`
1602
+ `,Dr=Xt.div`
1602
1603
  display: flex;
1603
1604
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1604
1605
  align-items: flex-end;
@@ -1606,12 +1607,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1606
1607
  :hover {
1607
1608
  opacity: 0.8;
1608
1609
  }
1609
- `,Dr=Yt.div`
1610
+ `,$r=Xt.div`
1610
1611
  display: flex;
1611
1612
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1612
1613
  align-items: flex-end;
1613
1614
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1614
- `;import $r from"react";var fl=({style:e,className:t})=>$r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},$r.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),$r.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 mc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:l,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowMetadata:C,getFlowStatus:S,getFlowSteps:f,getCurrentStepIndex:v}=Y(),{primaryCTAClickSideEffects:w}=ie(),{mergeAppearanceWithDefault:b}=Q();if(s=b(s),cc(()=>{F(r)},[r,d]),d)return null;let A=l(e);if(!A||x(A)||S(e)===q)return null;let y=f(e),m=y.length>0?y[v(e)]:C(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),ye.createElement(ye.Fragment,null,ye.createElement(oe,{appearance:s}),ye.createElement(dl,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ye.createElement(cl,{className:a("bannerIconContainer",s)},c||ye.createElement(fl,null)),p==="square"&&m.dismissible&&ye.createElement(Dr,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Lr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(Te,null))),ye.createElement(ml,{type:p},ye.createElement(Fe,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&ye.createElement(ul,{type:p,className:a("bannerCallToActionContainer",s)},ye.createElement(Z,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{w(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&ye.createElement(Dr,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Lr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(Te,null)))))};import R,{useEffect as uc}from"react";import{Portal as fc}from"react-portal";import it from"styled-components";var gl=it.div`
1615
+ `;import Mr from"react";var xl=({style:e,className:t})=>Mr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Mr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Mr.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 xc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:l,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowMetadata:y,getFlowStatus:S,getFlowSteps:f,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:T}=ie(),{mergeAppearanceWithDefault:h}=Z();if(s=h(s),gc(()=>{F(r)},[r,d]),d)return null;let A=l(e);if(!A||x(A)||S(e)===X)return null;let b=f(e),m=b.length>0?b[B(e)]:y(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),ye.createElement(ye.Fragment,null,ye.createElement(oe,{appearance:s}),ye.createElement(ml,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ye.createElement(ul,{className:a("bannerIconContainer",s)},c||ye.createElement(xl,null)),p==="square"&&m.dismissible&&ye.createElement($r,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Dr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(we,null))),ye.createElement(fl,{type:p},ye.createElement(Te,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&ye.createElement(gl,{type:p,className:a("bannerCallToActionContainer",s)},ye.createElement(R,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{T(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&ye.createElement($r,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Dr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(we,null)))))};import ee,{useEffect as hc}from"react";import{Portal as Cc}from"react-portal";import it from"styled-components";var hl=it.div`
1615
1616
  display: flex;
1616
1617
  flex-direction: column;
1617
1618
  width: 100%;
@@ -1630,7 +1631,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1630
1631
  z-index: 1000;
1631
1632
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
1632
1633
  min-width: 550px;
1633
- `,xl=it.button`
1634
+ `,Cl=it.button`
1634
1635
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1635
1636
  border-radius: 8px;
1636
1637
  // If selected make border color primary and text color color priamry
@@ -1651,33 +1652,33 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1651
1652
  display: flex;
1652
1653
  justify-content: center;
1653
1654
  align-items: center;
1654
- `,Mr=it.div`
1655
+ `,Ur=it.div`
1655
1656
  display: flex;
1656
1657
  justify-content: space-between;
1657
1658
  margin-top: 16px;
1658
1659
  gap: 8px;
1659
- `,hl=it.div`
1660
+ `,yl=it.div`
1660
1661
  display: flex;
1661
1662
  justify-content: space-between;
1662
1663
  margin-top: 8px;
1663
- `,Ur=it.div`
1664
+ `,zr=it.div`
1664
1665
  font-size: 12px;
1665
1666
  line-height: 18px;
1666
1667
  color: ${e=>e.appearance.theme.colorTextDisabled};
1667
1668
  font-style: normal;
1668
1669
  font-weight: 400;
1669
1670
  letter-spacing: 0.24px;
1670
- `,zr=it.div`
1671
+ `,Wr=it.div`
1671
1672
  display: flex;
1672
1673
  flex-direction: column;
1673
1674
  flex: 1;
1674
- `,Kb=it.div`
1675
+ `,e1=it.div`
1675
1676
  display: flex;
1676
1677
  flex-direction: column;
1677
1678
  justify-content: center;
1678
1679
  align-items: flex-start;
1679
1680
  margin-top: 16px;
1680
- `,Cl=it.textarea`
1681
+ `,Sl=it.textarea`
1681
1682
  ${e=>k(e)} {
1682
1683
  margin-top: 16px;
1683
1684
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
@@ -1688,7 +1689,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1688
1689
  width: 100%;
1689
1690
  height: 100px;
1690
1691
  }
1691
- `,yl=it.div`
1692
+ `,bl=it.div`
1692
1693
  ${e=>k(e)} {
1693
1694
  position: absolute;
1694
1695
  top: 16px;
@@ -1699,7 +1700,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1699
1700
  opacity: 0.8;
1700
1701
  }
1701
1702
  }
1702
- `;var gc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:C,getFlowSteps:S,getFlowStatus:f,getCurrentStepIndex:v}=Y(),{primaryCTAClickSideEffects:w}=ie(),{mergeAppearanceWithDefault:b}=Q(),[A,y]=R.useState(null),[m,E]=R.useState(""),{hasOpenModals:T,setKeepCompletedFlowOpenDuringSession:B,shouldKeepCompletedFlowOpenDuringSession:L}=we();if(r=b(r),uc(()=>{C(o)},[o,x]),x)return null;let N=c(e);if(!N||F(N)||f(e)===q||d(e)===1&&!L(e)||T())return null;let $=S(e)[d(e)];function D(){return R.createElement(R.Fragment,null,R.createElement(zr,null,R.createElement(Fe,{size:"large",appearance:r,title:$.title,subtitle:$.subtitle})),R.createElement(Mr,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(te=>R.createElement(xl,{className:a("npsNumberButton",r),selected:A===te+1,key:te,onClick:async()=>{B(e),y(te+1),await g(e,$.id,{score:te+1})},appearance:r},te+1))),R.createElement(hl,{appearance:r},R.createElement(Ur,{appearance:r},"Not likely at all"),R.createElement(Ur,{appearance:r},"Extremely likely")))}function ee(){return R.createElement(R.Fragment,null,R.createElement(zr,null,R.createElement(Fe,{appearance:r,title:$.title??"Why did you choose this score?",size:"large"})),R.createElement(Cl,{appearance:r,value:m,onChange:te=>{E(te.target.value)},placeHolder:"Add your optional fedback here..."}),R.createElement(Mr,{appearance:r,className:a("npsNumberButtonContainer",r)},R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await l(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 l(e),i&&i($,1,"primary")},appearance:r,title:$.primaryButtonTitle||"Submit"})))}function U(){return d(e)>=2?null:R.createElement(R.Fragment,null,R.createElement(oe,{appearance:r}),R.createElement(gl,{appearance:r,className:xe(a("npsSurveyContainer",r),n),style:s,type:p},R.createElement(yl,{onClick:async()=>{await l(e),t&&t()},className:a("npsSurveyDismissButton",r)},R.createElement(Te,null)),d(e)==0&&D(),d(e)==1&&ee()))}return p==="inline"?U():R.createElement(fc,null,U())};import Se,{useEffect as Cc}from"react";import Bt from"styled-components";var Sl=Bt.div`
1703
+ `;var yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:y,getFlowSteps:S,getFlowStatus:f,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:T}=ie(),{mergeAppearanceWithDefault:h}=Z(),[A,b]=ee.useState(null),[m,P]=ee.useState(""),{hasOpenModals:w,setKeepCompletedFlowOpenDuringSession:E,shouldKeepCompletedFlowOpenDuringSession:O}=be();if(r=h(r),hc(()=>{y(o)},[o,x]),x)return null;let N=c(e);if(!N||F(N)||f(e)===X||d(e)===1&&!O(e)||w())return null;let $=S(e)[d(e)];function D(){return ee.createElement(ee.Fragment,null,ee.createElement(Wr,null,ee.createElement(Te,{size:"large",appearance:r,title:$.title,subtitle:$.subtitle})),ee.createElement(Ur,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(q=>ee.createElement(Cl,{className:a("npsNumberButton",r),selected:A===q+1,key:q,onClick:async()=>{E(e),b(q+1),await g(e,$.id,{score:q+1})},appearance:r},q+1))),ee.createElement(yl,{appearance:r},ee.createElement(zr,{appearance:r},"Not likely at all"),ee.createElement(zr,{appearance:r},"Extremely likely")))}function K(){return ee.createElement(ee.Fragment,null,ee.createElement(Wr,null,ee.createElement(Te,{appearance:r,title:$.title??"Why did you choose this score?",size:"large"})),ee.createElement(Sl,{appearance:r,value:m,onChange:q=>{P(q.target.value)},placeHolder:"Add your optional fedback here..."}),ee.createElement(Ur,{appearance:r,className:a("npsNumberButtonContainer",r)},ee.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await l(e),i&&i($,1,"primary")},appearance:r,title:$.secondaryButtonTitle||"Skip",secondary:!0}),ee.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await g(e,$.id,{feedbackText:m}),await l(e),i&&i($,1,"primary")},appearance:r,title:$.primaryButtonTitle||"Submit"})))}function z(){return d(e)>=2?null:ee.createElement(ee.Fragment,null,ee.createElement(oe,{appearance:r}),ee.createElement(hl,{appearance:r,className:he(a("npsSurveyContainer",r),n),style:s,type:p},ee.createElement(bl,{onClick:async()=>{await l(e),t&&t()},className:a("npsSurveyDismissButton",r)},ee.createElement(we,null)),d(e)==0&&D(),d(e)==1&&K()))}return p==="inline"?z():ee.createElement(Cc,null,z())};import Se,{useEffect as wc}from"react";import Et from"styled-components";var wl=Et.div`
1703
1704
  ${e=>k(e)} {
1704
1705
  display: flex;
1705
1706
  flex-direction: column;
@@ -1710,21 +1711,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1710
1711
  background-color: ${e=>e.appearance.theme.colorBackground};
1711
1712
  position: relative;
1712
1713
  }
1713
- `,bl=Bt.div`
1714
+ `,Tl=Et.div`
1714
1715
  display: flex;
1715
1716
  flex-direction: column;
1716
1717
  flex: 1;
1717
- `,wl=Bt.div`
1718
+ `,Fl=Et.div`
1718
1719
  display: flex;
1719
1720
  flex-direction: row;
1720
1721
  justify-content: center;
1721
1722
  align-items: stretch;
1722
1723
  gap: 16px;
1723
1724
  margin-top: 8px;
1724
- `,Tl=Bt.div`
1725
+ `,kl=Et.div`
1725
1726
  margin-top: 16px;
1726
1727
  margin-bottom: 16px;
1727
- `,Fl=Bt.div`
1728
+ `,Pl=Et.div`
1728
1729
  ${e=>k(e)} {
1729
1730
  position: absolute;
1730
1731
  top: -16px;
@@ -1735,7 +1736,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1735
1736
  opacity: 0.8;
1736
1737
  }
1737
1738
  }
1738
- `,kl=Bt.h1`
1739
+ `,vl=Et.h1`
1739
1740
  ${e=>k(e)} {
1740
1741
  font-style: normal;
1741
1742
  justify-content: center;
@@ -1749,7 +1750,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1749
1750
  color: ${e=>e.appearance.theme.colorText};
1750
1751
  margin-bottom: 8px;
1751
1752
  }
1752
- `,Pl=Bt.h2`
1753
+ `,Bl=Et.h2`
1753
1754
  ${e=>k(e)} {
1754
1755
  font-style: normal;
1755
1756
  justify-content: center;
@@ -1761,10 +1762,10 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
1761
1762
  letter-spacing: 0.28px;
1762
1763
  margin-bottom: 8px;
1763
1764
  }
1764
- `;import vl from"react";import xc from"styled-components";var hc=xc.img`
1765
+ `;import El from"react";import Sc from"styled-components";var bc=Sc.img`
1765
1766
  width: 100%;
1766
1767
  height: 100%;
1767
1768
  min-height: 200px;
1768
1769
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
1769
- `;function Bl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?vl.createElement(Ve,{appearance:t,videoUri:e.videoUri}):e.imageUri?vl.createElement(hc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:l,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:C,getFlowSteps:S,getFlowStatus:f,getCurrentStepIndex:v}=Y(),{primaryCTAClickSideEffects:w,secondaryCTAClickSideEffects:b}=ie(),{mergeAppearanceWithDefault:A}=Q(),{setOpenFlowState:y,getOpenFlowState:m,hasOpenModals:E}=we(),[T,B]=[m(e,!0),U=>y(e,U)];if(r=A(r),Cc(()=>{C(o)},[o,x]),x)return null;let L=l(e);if(!L||F(L)||f(e)===q||E())return null;let I=S(e)[v(e)],$=()=>{B(!1),t&&t(),g(e)};function D(){return Se.createElement(Se.Fragment,null,Se.createElement(oe,{appearance:r}),Se.createElement(Sl,{appearance:r,className:xe(a("announcementContainer",r),n),style:s},(p===!0||I.dismissible)&&c=="inline"&&Se.createElement(Fl,{onClick:async()=>{await g(e),t&&t()},className:a("announcementDismissButton",r)},Se.createElement(Te,null)),Se.createElement(bl,null,Se.createElement(kl,{appearance:r,className:a("announcementTitle",r),dangerouslySetInnerHTML:le(I.title)}),I.subtitle&&Se.createElement(Pl,{appearance:r,className:a("announcementSubtitle",r),dangerouslySetInnerHTML:le(I.subtitle)})),(I.imageUri||I.videoUri)&&Se.createElement(Tl,{className:a("announcementMediaContainer",r)},Se.createElement(Bl,{appearance:r,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&Se.createElement(wl,{className:a("announcementCTAContainer",r)},I.secondaryButtonTitle&&Se.createElement(Z,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handleSecondaryButtonClick(),b(I),i&&i(I,v(e),"secondary")},secondary:!0}),I.primaryButtonTitle&&Se.createElement(Z,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handlePrimaryButtonClick(),w(I),!(i&&i(I,v(e),"primary")===!1)&&(await d(e,I.id),await g(e))}}))))}let ee={padding:"24px",maxWidth:"400px"};return c==="inline"?D():c!=="center"?Se.createElement(wo,{modalPosition:c,onClose:$,visible:T,dismissible:p,appearance:r},D()):Se.createElement(He,{appearance:r,onClose:$,visible:T,style:ee,dismissible:p},D())};import*as qo from"react";import El from"react";var Al=({as:e="span",children:t,variant:o="Body1",...i})=>El.createElement(Ri,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),Sc=Object.fromEntries(Object.keys(Do).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>El.createElement(Al,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),Wr=Object.assign(Al,Sc);var Il=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return qo.createElement(Zi,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},qo.createElement(Wr,{color:(s=ao[r])==null?void 0:s.color,fontWeight:"semibold"},i))},bc=Object.fromEntries(Object.keys(ao).map(e=>{let t=o=>qo.createElement(Il,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),wc=Object.assign(Il,bc);export{lo as Box,wc as Button,Qe as CheckBox,Jo as FlowType,st as FormLabel,pr as FormTextField,yc as FrigadeAnnouncement,mc as FrigadeBanner,Nr as FrigadeChecklist,Je as FrigadeDefaultAppearance,dc as FrigadeEmbeddedTip,Vi as FrigadeForm,jd as FrigadeGuide,zd as FrigadeHeroChecklist,gc as FrigadeNPSSurvey,_d as FrigadeProgressBadge,Xp as FrigadeProvider,ac as FrigadeSupportWidget,rc as FrigadeTour,$t as ProgressRing,Wr as Text,Tr as tokens,we as useFlowOpens,Xt as useFlowResponses,Y as useFlows,Sr as useOrganization,Jt as useUser,Be as useUserFlowStates};
1770
+ `;function Al({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?El.createElement(Ve,{appearance:t,videoUri:e.videoUri}):e.imageUri?El.createElement(bc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Tc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:l,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:y,getFlowSteps:S,getFlowStatus:f,getCurrentStepIndex:B}=J(),{primaryCTAClickSideEffects:T,secondaryCTAClickSideEffects:h}=ie(),{mergeAppearanceWithDefault:A}=Z(),{setOpenFlowState:b,getOpenFlowState:m,hasOpenModals:P}=be(),[w,E]=[m(e,!0),z=>b(e,z)];if(r=A(r),wc(()=>{y(o)},[o,x]),x)return null;let O=l(e);if(!O||F(O)||f(e)===X||P())return null;let I=S(e)[B(e)],$=()=>{E(!1),t&&t(),g(e)};function D(){return Se.createElement(Se.Fragment,null,Se.createElement(oe,{appearance:r}),Se.createElement(wl,{appearance:r,className:he(a("announcementContainer",r),n),style:s},(p===!0||I.dismissible)&&c=="inline"&&Se.createElement(Pl,{onClick:async()=>{await g(e),t&&t()},className:a("announcementDismissButton",r)},Se.createElement(we,null)),Se.createElement(Tl,null,Se.createElement(vl,{appearance:r,className:a("announcementTitle",r),dangerouslySetInnerHTML:se(I.title)}),I.subtitle&&Se.createElement(Bl,{appearance:r,className:a("announcementSubtitle",r),dangerouslySetInnerHTML:se(I.subtitle)})),(I.imageUri||I.videoUri)&&Se.createElement(kl,{className:a("announcementMediaContainer",r)},Se.createElement(Al,{appearance:r,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&Se.createElement(Fl,{className:a("announcementCTAContainer",r)},I.secondaryButtonTitle&&Se.createElement(R,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handleSecondaryButtonClick(),h(I),i&&i(I,B(e),"secondary")},secondary:!0}),I.primaryButtonTitle&&Se.createElement(R,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handlePrimaryButtonClick(),T(I),!(i&&i(I,B(e),"primary")===!1)&&(await d(e,I.id),await g(e))}}))))}let K={padding:"24px",maxWidth:"400px"};return c==="inline"?D():c!=="center"?Se.createElement(To,{modalPosition:c,onClose:$,visible:w,dismissible:p,appearance:r},D()):Se.createElement(He,{appearance:r,onClose:$,visible:w,style:K,dismissible:p},D())};import*as qo from"react";import Il from"react";var Nl=({as:e="span",children:t,variant:o="Body1",...i})=>Il.createElement(en,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),Fc=Object.fromEntries(Object.keys($o).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>Il.createElement(Nl,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),_r=Object.assign(Nl,Fc);var Ol=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return qo.createElement(Ri,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},qo.createElement(_r,{color:(s=po[r])==null?void 0:s.color,fontWeight:"semibold"},i))},kc=Object.fromEntries(Object.keys(po).map(e=>{let t=o=>qo.createElement(Ol,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),Pc=Object.assign(Ol,kc);export{ao as Box,Pc as Button,Qe as CheckBox,Jo as FlowType,lt as FormLabel,pr as FormTextField,Tc as FrigadeAnnouncement,xc as FrigadeBanner,Nr as FrigadeChecklist,Je as FrigadeDefaultAppearance,fc as FrigadeEmbeddedTip,Gi as FrigadeForm,Gd as FrigadeGuide,_d as FrigadeHeroChecklist,yc as FrigadeNPSSurvey,jd as FrigadeProgressBadge,Qp as FrigadeProvider,mc as FrigadeSupportWidget,lc as FrigadeTour,Mt as ProgressRing,_r as Text,Tr as tokens,be as useFlowOpens,Jt as useFlowResponses,J as useFlows,Sr as useOrganization,Qt as useUser,Ee as useUserFlowStates};
1770
1771
  //# sourceMappingURL=index.mjs.map