@frigade/react 1.35.25 → 1.35.27

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