@frigade/react 1.37.3 → 1.37.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var Io=Object.getOwnPropertySymbols;var si=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable;var ni=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))si.call(t,o)&&ni(e,o,t[o]);if(Io)for(var o of Io(t))li.call(t,o)&&ni(e,o,t[o]);return e},j=(e,t)=>na(e,sa(t));var ai=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)si.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Io)for(var i of Io(e))t.indexOf(i)<0&&li.call(e,i)&&(o[i]=e[i]);return o};var U=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(l){n(l)}},s=d=>{try{p(o.throw(d))}catch(l){n(l)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);p((o=o.apply(e,t)).next())});import Nt,{createContext as wd,useEffect as Ro,useState as Ke}from"react";import{ThemeProvider as Td}from"styled-components";import Ot,{useContext as Qp,useEffect as Zt,useState as To}from"react";import{useCallback as vt,useContext as ya,useEffect as Sa}from"react";import mr,{useMemo as di}from"react";var pi="1.37.3";var st="NOT_STARTED_STEP",R="COMPLETED_FLOW",Lo="ABORTED_FLOW",Pt="STARTED_FLOW",Ue="NOT_STARTED_FLOW",$e="COMPLETED_STEP",uo="STARTED_STEP";function Qe(){let{publicApiKey:e,userId:t,apiUrl:o}=mr.useContext(Y);return{config:di(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":pi,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:di(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Vt(){let{shouldGracefullyDegrade:e,readonly:t}=mr.useContext(Y);return(o,i)=>U(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Ht();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Ht();let n=la+o,r=aa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return Ht()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(p){return Ht(p)}return s?s.ok?s:Ht(s.statusText):Ht()})}function Ht(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function jt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=mr.useContext(Y);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 ha,useState as ci}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function Oe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=pa(Y);function r(c,f=!1){var C;return(C=e[c])!=null?C:f}function s(c,f){t(C=>j(b({},C),{[c]:f}))}function p(c){t(f=>{let x=f,{[c]:C}=x,w=Le(x,[ai(c)]);return b({},w)})}function d(c){n.includes(c)||i(f=>[...f,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,C])=>C&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import fa from"swr/immutable";import fo from"core-js-pure/actual/structured-clone";function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ce(...e){let t=e.shift(),o=e.length===1?e[0]:Ce(...e);if(!ur(t)||!ur(o))throw new Error("deepmerge can only merge Objects");let i=fo(t);return Object.entries(o).forEach(([n,r])=>{ur(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],fo(r))}):Object.assign(i,{[n]:fo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...fo(r)]}):Object.assign(i,{[n]:fo(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function We(){let{config:e,apiUrl:t}=Qe(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:p}=da(Y),{resetOpenFlowState:d}=Oe(),[l,m]=ma(!1),c={data:r.map(S=>({flowId:S.id,flowState:R,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=S=>fetch(S,e).then(F=>{if(F.ok)return F.json();throw new Error("Failed to fetch user flow states")}).catch(F=>(console.log(`Error fetching ${S}: ${F}. Will gracefully degrade and hide Frigade`),s(!0),c)),C=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:w,isLoading:x,mutate:g,error:A}=p?fa(C,f):ua(C,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),T=w==null?void 0:w.data;ca(()=>{!l&&!x&&T&&m(!0)},[T,l,x]);function k(S){return U(this,null,function*(){if(T&&!p){let F=T.find(M=>M.flowId===S);F&&F.flowState!==R&&(F.flowState=R),yield g(Promise.resolve(Ce(w,{data:T})),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function P(S,F,M){return U(this,null,function*(){if(T){let O=T.find(I=>I.flowId===S);O&&(O.stepStates[F]=M,O.flowState=Pt),yield g(Promise.resolve(Ce(w,{data:T})),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function v(S,F,M){return U(this,null,function*(){if(T){let O=T.find(I=>I.flowId===S);O&&(O.lastStepId=F,O.stepStates[F]=M,O.flowState=Pt),yield g(Ce(w,{data:T}),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function u(S){return U(this,null,function*(){if(T){let F=T.find(M=>M.flowId===S);F&&F.flowState!==Ue&&(F.flowState=Ue,F.lastStepId=ga,Object.keys(F.stepStates).forEach(M=>{F.stepStates[M].actionType=st,F.stepStates[M].createdAt=new Date().toISOString()}),yield g(Ce(w,{data:T}),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1}),d(S))}})}function L(S,F,M){return U(this,null,function*(){if(T){let O=T.find(I=>I.flowId===S);O&&(O.stepStates[F]=M),yield g(Promise.resolve(Ce(w,{data:T})),{optimisticData:Ce(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:T,isLoadingUserFlowStateData:!l,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:k,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:L,optimisticallyMarkStepStarted:v,error:A}}function go(){let{config:e,apiUrl:t}=Qe(),{userFlowStatesData:o,mutateUserFlowState:i}=We(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=ha(Y),[d,l]=ci(new Set),[m,c]=ci(new Set),f=Vt();function C(g){let A=JSON.stringify(g);if(d.has(A))return null;d.add(A),l(d),m.add(g),c(m);let T=s==null?void 0:s.find(k=>k.flowSlug===g.flowSlug&&k.stepId===g.stepId&&k.actionType===g.actionType&&k.createdAt===g.createdAt);return f(`${t}flowResponses`,j(b({},e),{method:"POST",body:A})).then(k=>{k.status!==200&&k.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...n,g])):T||p(P=>[...P!=null?P:[],g])})}function w(g){return U(this,null,function*(){g.foreignUserId&&(g.actionType===Pt||g.actionType===Ue?yield C(g):g.actionType===R?yield C(g):g.actionType===uo?yield C(g):g.actionType===$e?yield C(g):g.actionType===Lo?yield C(g):g.actionType===st&&(yield C(g)))})}function x(){let g=[];return o==null||o.forEach(A=>{if(A&&A.stepStates&&Object.keys(A.stepStates).length!==0)for(let T in A.stepStates){let k=A.stepStates[T];g.push({foreignUserId:A.foreignUserId,flowSlug:A.flowId,stepId:k.stepId,actionType:k.actionType,data:{},createdAt:new Date(k.createdAt),blocked:k.blocked,hidden:k.hidden})}}),[...g,...s]}return{addResponse:w,setFlowResponses:p,getFlowResponses:x}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,mi=e=>{let t=xa.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Ca(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function $o(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var fr=(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))(fr||{});function J(){let{config:e,apiUrl:t}=Qe(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:C}=ya(Y),w={data:[]},{verifySDKInitiated:x}=jt(),{addResponse:g,getFlowResponses:A}=go(),T=h=>fetch(h,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${h} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),f(!0),w)).catch(y=>(console.log(`Error fetching ${h}: ${y}. Will gracefully degrade and hide Frigade`),f(!0),w)),{mutateUserFlowState:k,userFlowStatesData:P,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:u,optimisticallyMarkFlowNotStarted:L,optimisticallyMarkStepCompleted:S,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:M}=We(),{data:O,error:I,isLoading:V}=ba(s?`${t}flows${C?"?readonly=true":""}`:null,T,{keepPreviousData:!0});Sa(()=>{if(I){console.error(I);return}O&&O.data&&i(O.data)},[O,I]);function W(h){if(V)return null;let y=o.find(B=>B.slug===h);return!y&&o.length>0&&!v&&!V?(console.log(`Flow with id ${h} not found`),null):(y==null?void 0:y.active)===!1&&!C?null:y}function q(h){var N,ie,je,De,xt;if(!W(h))return[];let y=(N=W(h))==null?void 0:N.data;return y?(y=X(y),((xt=(De=(ie=$o(y))==null?void 0:ie.data)!=null?De:(je=$o(y))==null?void 0:je.steps)!=null?xt:[]).map(me=>{let co=Z(me);return j(b({handleSecondaryButtonClick:()=>{me.skippable===!0&&re(h,me.id,{skipped:!0})}},me),{complete:Pe(h,me.id)===$e||co>=1,started:Pe(h,me.id)===uo||Pe(h,me.id)===$e,currentlyActive:P==null?void 0:P.some(mo=>mo.flowId==h&&mo.lastStepId===me.id),blocked:Ae(h,me.id),hidden:be(h,me.id),handlePrimaryButtonClick:()=>{(!me.completionCriteria&&(me.autoMarkCompleted||me.autoMarkCompleted===void 0)||me.completionCriteria&&me.autoMarkCompleted===!0)&&re(h,me.id)},progress:co})}).filter(me=>me.hidden!==!0)):[]}function X(h){return h.replaceAll(/\${(.*?)}/g,(y,B)=>p[B]===void 0?"":String(p[B]).replace(/[\u00A0-\u9999<>\&]/g,function(N){return"&#"+N.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 de(h){var B;if(!W(h))return[];let y=W(h).data;return y?(y=X(y),(B=JSON.parse(y))!=null?B:{}):[]}function H(h,y){d(B=>j(b({},B),{[h]:y}))}function le(h){!v&&!V&&h&&JSON.stringify(p)!=JSON.stringify(b(b({},p),h))&&Object.keys(h).forEach(y=>{H(y,h[y])})}let fe=vt((h,y,B)=>U(this,null,function*(){if(!x())return;let N={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:uo,data:B!=null?B:{},createdAt:new Date,blocked:!1,hidden:!1};xe(N)&&(yield M(h,y,N),g(N))}),[n,r,P]),Te=vt((h,y,B)=>U(this,null,function*(){if(!x())return;let N={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:st,data:B!=null?B:{},createdAt:new Date,blocked:!1,hidden:!1};xe(N)&&(yield F(h,y,N),g(N))}),[n,r,P]),re=vt((h,y,B)=>U(this,null,function*(){if(!x())return;let N={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:$e,data:B!=null?B:{},createdAt:new Date,blocked:!1,hidden:!1};xe(N)&&(yield S(h,y,N),g(N))}),[n,r,P]),Q=vt((h,y)=>U(this,null,function*(){if(!x()||ce(h)===Ue)return;let B={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Ue,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};yield L(h),xe(B)&&g(B)}),[n,r,P]),he=vt((h,y)=>U(this,null,function*(){if(!x())return;let B={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Pt,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};xe(B)&&g(B)}),[n,r,P]),D=vt((h,y)=>U(this,null,function*(){if(!x())return;let B={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:R,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};xe(B)&&(yield u(h),g(B))}),[n,r,P]),Se=vt((h,y)=>U(this,null,function*(){if(!x())return;let B={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Lo,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};xe(B)&&(yield u(h),g(B))}),[n,r,P]);function xe(h){var y;if(P===void 0)return!1;if(P){let B=P.find(N=>N.flowId===h.flowSlug);if(h.actionType===st&&(!(B!=null&&B.stepStates[h.stepId])||B.stepStates[h.stepId].actionType===st))return!1;if(B&&((y=B.stepStates[h.stepId])==null?void 0:y.actionType)===h.actionType){if(h.actionType===$e&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let N=Object.keys(B.stepStates).sort((ie,je)=>{let De=new Date(B.stepStates[ie].createdAt),xt=new Date(B.stepStates[je].createdAt);return De.getTime()-xt.getTime()});if(B.stepStates[N[N.length-1]].actionType===h.actionType&&h.stepId===N[N.length-1])return!1}if(B&&B.flowState===R&&h.actionType===R)return!1}return!0}function Pe(h,y){let B=_(h,y);return v?null:B?B.actionType:st}function Ae(h,y){let B=_(h,y);return B?B.blocked:!1}function be(h,y){let B=_(h,y);return B?B.hidden:!1}function _(h,y){var N;if(v)return null;let B=P==null?void 0:P.find(ie=>ie.flowId===h);return!B||!B.stepStates[y]?null:(N=B.stepStates[y])!=null?N:null}function $(h){var B,N;if(v||!P)return null;if(ce(h)===Ue)return(B=q(h)[0])!=null?B:null;let y=(N=P.find(ie=>ie.flowId===h))==null?void 0:N.lastStepId;return y?q(h).find(ie=>ie.id===y):null}function z(h){var N;let y=$(h);if(!y)return 0;let B=(N=q(h).findIndex(ie=>ie.id===y.id))!=null?N:0;return Pe(h,y.id)===$e&&B<q(h).length-1?B+1:B}function Z(h){if(!h.completionCriteria)return;let y=mi(h.completionCriteria);if(y===null)return;let B=it(y),N=nt(y);return N===0?void 0:B/N}function ce(h){let y=P==null?void 0:P.find(B=>B.flowId===h);return y?y.flowState:null}function it(h){let y=q(h);return y.length===0?0:y.filter(N=>Pe(h,N.id)===$e).length}function nt(h){return q(h).length}function zt(h){let y=o.find(B=>B.slug===h);return y?$o(y.data):null}function qe(h){if(C)return!1;if(v)return!0;if(h!=null&&h.targetingLogic&&P){let y=P.find(B=>B.flowId===h.slug);if(y)return y.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function ht(h){return!qe(W(h))}function Xe(){n&&k()}function _t(){return o}return{getAllFlows:_t,getFlow:W,getFlowData:zt,isLoading:v||V,getStepStatus:Pe,getFlowSteps:q,getCurrentStepIndex:z,markStepStarted:fe,markStepCompleted:re,markFlowNotStarted:Q,markFlowStarted:he,markFlowCompleted:D,markFlowAborted:Se,markStepNotStarted:Te,getFlowStatus:ce,getNumberOfStepsCompleted:it,getNumberOfSteps:nt,targetingLogicShouldHideFlow:qe,setCustomVariable:H,updateCustomVariables:le,customVariables:p,getStepOptionalProgress:Z,getFlowMetadata:de,isStepBlocked:Ae,isStepHidden:be,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:ht,refresh:Xe}}import{useCallback as gr,useContext as wa,useEffect as Ta}from"react";var Gt="guest_";function ho(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(Y),{config:r,apiUrl:s}=Qe(),{mutateUserFlowState:p}=We(),d=Vt(),{verifySDKInitiated:l}=jt();function m(w){return`frigade-user-registered-${w}`}Ta(()=>{if(e&&!t){if(e.startsWith(Gt))return;let w=m(e);localStorage.getItem(w)||(d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(w,"true"))}},[e,n,t]);let c=gr(w=>U(this,null,function*(){if(!l())return;let x={foreignId:e,properties:w};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(x)})),i(g=>b(b({},g),w)),p()}),[e,r,n,p]),f=gr((w,x)=>U(this,null,function*(){if(!l())return;let A={foreignId:e,events:[{event:w,properties:x}]};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),p()}),[e,r,p]),C=gr((w,x)=>U(this,null,function*(){if(l())if(x){let g=m(w);localStorage.setItem(g,"true"),o(w);let A={foreignId:w,properties:x};yield d(`${s}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),i(T=>b(b({},T),x)),p()}else o(w)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:C,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Zp}from"uuid";import tt,{useEffect as hn,useState as Yp}from"react";import Ye,{useEffect as yr,useState as Na}from"react";import Wo from"styled-components";import Fa from"react";import ka from"styled-components";var ui="fr-",xo="cfr-";function a(e,t){let o=`${ui}${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+" "+xo+e}return o}function E(e){if(!e.className||e.className.indexOf(xo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(ui)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Mo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ve(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Mo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Fe(...e){return e.filter(Boolean).join(" ")}function Co(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
2
+ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Oo=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,S=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if(Oo)for(var o of Oo(t))ai.call(t,o)&&si(e,o,t[o]);return e},j=(e,t)=>sa(e,la(t));var pi=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Oo)for(var i of Oo(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var D=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(l){n(l)}},s=d=>{try{p(o.throw(d))}catch(l){n(l)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);p((o=o.apply(e,t)).next())});import Zo,{createContext as Td,useEffect as Ro,useState as Ke}from"react";import{ThemeProvider as Fd}from"styled-components";import Nt,{useContext as Zp,useEffect as Qt,useState as wo}from"react";import{useCallback as vt,useContext as Sa,useEffect as ba}from"react";import mr,{useMemo as ci}from"react";var di="1.37.5";var st="NOT_STARTED_STEP",te="COMPLETED_FLOW",Io="ABORTED_FLOW",Pt="STARTED_FLOW",Ue="NOT_STARTED_FLOW",$e="COMPLETED_STEP",mo="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=mr.useContext(X);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function Ht(){let{shouldGracefullyDegrade:e,readonly:t}=mr.useContext(X);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return _t();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),_t();let n=aa+o,r=pa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return _t()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(p){return _t(p)}return s?s.ok?s:_t(s.statusText):_t()})}function _t(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Vt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=mr.useContext(X);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 xa,useState as mi}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ne(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(X);function r(c,f=!1){var C;return(C=e[c])!=null?C:f}function s(c,f){t(C=>j(S({},C),{[c]:f}))}function p(c){t(f=>{let x=f,{[c]:C}=x,w=Le(x,[pi(c)]);return S({},w)})}function d(c){n.includes(c)||i(f=>[...f,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,C])=>C&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import ga from"swr/immutable";import uo from"core-js-pure/actual/structured-clone";function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ye(...e){let t=e.shift(),o=e.length===1?e[0]:ye(...e);if(!ur(t)||!ur(o))throw new Error("deepmerge can only merge Objects");let i=uo(t);return Object.entries(o).forEach(([n,r])=>{ur(r)?i[n]!==void 0?Object.assign(i,{[n]:ye(i[n],uo(r))}):Object.assign(i,{[n]:uo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...uo(r)]}):Object.assign(i,{[n]:uo(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function We(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:p}=ca(X),{resetOpenFlowState:d}=Ne(),[l,m]=ua(!1),c={data:r.map(b=>({flowId:b.id,flowState:te,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=b=>fetch(b,e).then(F=>{if(F.ok)return F.json();throw new Error("Failed to fetch user flow states")}).catch(F=>(console.log(`Error fetching ${b}: ${F}. Will gracefully degrade and hide Frigade`),s(!0),c)),C=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:w,isLoading:x,mutate:g,error:E}=p?ga(C,f):fa(C,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),T=w==null?void 0:w.data;ma(()=>{!l&&!x&&T&&m(!0)},[T,l,x]);function P(b){return D(this,null,function*(){if(T&&!p){let F=T.find($=>$.flowId===b);F&&F.flowState!==te&&(F.flowState=te),yield g(Promise.resolve(ye(w,{data:T})),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function B(b,F,$){return D(this,null,function*(){if(T){let N=T.find(O=>O.flowId===b);N&&(N.stepStates[F]=$,N.flowState=Pt),yield g(Promise.resolve(ye(w,{data:T})),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function k(b,F,$){return D(this,null,function*(){if(T){let N=T.find(O=>O.flowId===b);N&&(N.lastStepId=F,N.stepStates[F]=$,N.flowState=Pt),yield g(ye(w,{data:T}),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function u(b){return D(this,null,function*(){if(T){let F=T.find($=>$.flowId===b);F&&F.flowState!==Ue&&(F.flowState=Ue,F.lastStepId=ha,Object.keys(F.stepStates).forEach($=>{F.stepStates[$].actionType=st,F.stepStates[$].createdAt=new Date().toISOString()}),yield g(ye(w,{data:T}),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1}),d(b))}})}function L(b,F,$){return D(this,null,function*(){if(T){let N=T.find(O=>O.flowId===b);N&&(N.stepStates[F]=$),yield g(Promise.resolve(ye(w,{data:T})),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:T,isLoadingUserFlowStateData:!l,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:B,optimisticallyMarkStepNotStarted:L,optimisticallyMarkStepStarted:k,error:E}}function fo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=We(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=xa(X),[d,l]=mi(new Set),[m,c]=mi(new Set),f=Ht();function C(g){let E=JSON.stringify(g);if(d.has(E))return null;d.add(E),l(d),m.add(g),c(m);let T=s==null?void 0:s.find(P=>P.flowSlug===g.flowSlug&&P.stepId===g.stepId&&P.actionType===g.actionType&&P.createdAt===g.createdAt);return f(`${t}flowResponses`,j(S({},e),{method:"POST",body:E})).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...n,g])):T||p(B=>[...B!=null?B:[],g])})}function w(g){return D(this,null,function*(){g.foreignUserId&&(g.actionType===Pt||g.actionType===Ue?yield C(g):g.actionType===te?yield C(g):g.actionType===mo?yield C(g):g.actionType===$e?yield C(g):g.actionType===Io?yield C(g):g.actionType===st&&(yield C(g)))})}function x(){let g=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let T in E.stepStates){let P=E.stepStates[T];g.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...g,...s]}return{addResponse:w,setFlowResponses:p,getFlowResponses:x}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Lo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var fr=(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))(fr||{});function Q(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:C}=Sa(X),w={data:[]},{verifySDKInitiated:x}=Vt(),{addResponse:g,getFlowResponses:E}=fo(),T=h=>fetch(h,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${h} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),f(!0),w)).catch(y=>(console.log(`Error fetching ${h}: ${y}. Will gracefully degrade and hide Frigade`),f(!0),w)),{mutateUserFlowState:P,userFlowStatesData:B,isLoadingUserFlowStateData:k,optimisticallyMarkFlowCompleted:u,optimisticallyMarkFlowNotStarted:L,optimisticallyMarkStepCompleted:b,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:$}=We(),{data:N,error:O,isLoading:V}=wa(s?`${t}flows${C?"?readonly=true":""}`:null,T,{keepPreviousData:!0});ba(()=>{if(O){console.error(O);return}N&&N.data&&i(N.data)},[N,O]);function W(h){if(V)return null;let y=o.find(v=>v.slug===h);return!y&&o.length>0&&!k&&!V?(console.log(`Flow with id ${h} not found`),null):(y==null?void 0:y.active)===!1&&!C?null:y}function J(h){var I,ne,je,De,xt;if(!W(h))return[];let y=(I=W(h))==null?void 0:I.data;return y?(y=R(y),((xt=(De=(ne=Lo(y))==null?void 0:ne.data)!=null?De:(je=Lo(y))==null?void 0:je.steps)!=null?xt:[]).map(fe=>{let po=_(fe);return j(S({handleSecondaryButtonClick:()=>{fe.skippable===!0&&ke(h,fe.id,{skipped:!0})}},fe),{complete:Ee(h,fe.id)===$e||po>=1,started:Ee(h,fe.id)===mo||Ee(h,fe.id)===$e,currentlyActive:B==null?void 0:B.some(co=>co.flowId==h&&co.lastStepId===fe.id),blocked:Ae(h,fe.id),hidden:Ce(h,fe.id),handlePrimaryButtonClick:()=>{(!fe.completionCriteria&&(fe.autoMarkCompleted||fe.autoMarkCompleted===void 0)||fe.completionCriteria&&fe.autoMarkCompleted===!0)&&ke(h,fe.id)},progress:po})}).filter(fe=>fe.hidden!==!0)):[]}function R(h){return h.replaceAll(/\${(.*?)}/g,(y,v)=>p[v]===void 0?"":String(p[v]).replace(/[\u00A0-\u9999<>\&]/g,function(I){return"&#"+I.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 pe(h){var v;if(!W(h))return[];let y=W(h).data;return y?(y=R(y),(v=JSON.parse(y))!=null?v:{}):[]}function q(h,y){d(v=>j(S({},v),{[h]:y}))}function Y(h){!k&&!V&&h&&JSON.stringify(p)!=JSON.stringify(S(S({},p),h))&&Object.keys(h).forEach(y=>{q(y,h[y])})}let de=vt((h,y,v)=>D(this,null,function*(){if(!x())return;let I={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:mo,data:v!=null?v:{},createdAt:new Date,blocked:!1,hidden:!1};he(I)&&(yield $(h,y,I),g(I))}),[n,r,B]),we=vt((h,y,v)=>D(this,null,function*(){if(!x())return;let I={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:st,data:v!=null?v:{},createdAt:new Date,blocked:!1,hidden:!1};he(I)&&(yield F(h,y,I),g(I))}),[n,r,B]),ke=vt((h,y,v)=>D(this,null,function*(){if(!x())return;let I={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:$e,data:v!=null?v:{},createdAt:new Date,blocked:!1,hidden:!1};he(I)&&(yield b(h,y,I),g(I))}),[n,r,B]),Z=vt((h,y)=>D(this,null,function*(){if(!x()||le(h)===Ue)return;let v={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Ue,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};yield L(h),he(v)&&g(v)}),[n,r,B]),me=vt((h,y)=>D(this,null,function*(){if(!x())return;let v={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Pt,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};he(v)&&g(v)}),[n,r,B]),U=vt((h,y)=>D(this,null,function*(){if(!x())return;let v={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:te,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};he(v)&&(yield u(h),g(v))}),[n,r,B]),ee=vt((h,y)=>D(this,null,function*(){if(!x())return;let v={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Io,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};he(v)&&(yield u(h),g(v))}),[n,r,B]);function he(h){var y;if(B===void 0)return!1;if(B){let v=B.find(I=>I.flowId===h.flowSlug);if(h.actionType===st&&(!(v!=null&&v.stepStates[h.stepId])||v.stepStates[h.stepId].actionType===st))return!1;if(v&&((y=v.stepStates[h.stepId])==null?void 0:y.actionType)===h.actionType){if(h.actionType===$e&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let I=Object.keys(v.stepStates).sort((ne,je)=>{let De=new Date(v.stepStates[ne].createdAt),xt=new Date(v.stepStates[je].createdAt);return De.getTime()-xt.getTime()});if(v.stepStates[I[I.length-1]].actionType===h.actionType&&h.stepId===I[I.length-1])return!1}if(v&&v.flowState===te&&h.actionType===te)return!1}return!0}function Ee(h,y){let v=H(h,y);return k?null:v?v.actionType:st}function Ae(h,y){let v=H(h,y);return v?v.blocked:!1}function Ce(h,y){let v=H(h,y);return v?v.hidden:!1}function H(h,y){var I;if(k)return null;let v=B==null?void 0:B.find(ne=>ne.flowId===h);return!v||!v.stepStates[y]?null:(I=v.stepStates[y])!=null?I:null}function z(h){var v,I;if(k||!B)return null;if(le(h)===Ue)return(v=J(h)[0])!=null?v:null;let y=(I=B.find(ne=>ne.flowId===h))==null?void 0:I.lastStepId;return y?J(h).find(ne=>ne.id===y):null}function M(h){var I;let y=z(h);if(!y)return 0;let v=(I=J(h).findIndex(ne=>ne.id===y.id))!=null?I:0;return Ee(h,y.id)===$e&&v<J(h).length-1?v+1:v}function _(h){if(!h.completionCriteria)return;let y=ui(h.completionCriteria);if(y===null)return;let v=qe(y),I=nt(y);return I===0?void 0:v/I}function le(h){let y=B==null?void 0:B.find(v=>v.flowId===h);return y?y.flowState:null}function qe(h){let y=J(h);return y.length===0?0:y.filter(I=>Ee(h,I.id)===$e).length}function nt(h){return J(h).length}function Wt(h){let y=o.find(v=>v.slug===h);return y?Lo(y.data):null}function Ye(h){if(C)return!1;if(k)return!0;if(h!=null&&h.targetingLogic&&B){let y=B.find(v=>v.flowId===h.slug);if(y)return y.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function ht(h){return!Ye(W(h))}function Qe(){n&&P()}function zt(){return o}return{getAllFlows:zt,getFlow:W,getFlowData:Wt,isLoading:k||V,getStepStatus:Ee,getFlowSteps:J,getCurrentStepIndex:M,markStepStarted:de,markStepCompleted:ke,markFlowNotStarted:Z,markFlowStarted:me,markFlowCompleted:U,markFlowAborted:ee,markStepNotStarted:we,getFlowStatus:le,getNumberOfStepsCompleted:qe,getNumberOfSteps:nt,targetingLogicShouldHideFlow:Ye,setCustomVariable:q,updateCustomVariables:Y,customVariables:p,getStepOptionalProgress:_,getFlowMetadata:pe,isStepBlocked:Ae,isStepHidden:Ce,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:ht,refresh:Qe}}import{useCallback as gr,useContext as Ta,useEffect as Fa}from"react";var jt="guest_";function go(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(X),{config:r,apiUrl:s}=Ze(),{mutateUserFlowState:p}=We(),d=Ht(),{verifySDKInitiated:l}=Vt();function m(w){return`frigade-user-registered-${w}`}Fa(()=>{if(e&&!t){if(e.startsWith(jt))return;let w=m(e);localStorage.getItem(w)||(d(`${s}users`,j(S({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(w,"true"))}},[e,n,t]);let c=gr(w=>D(this,null,function*(){if(!l())return;let x={foreignId:e,properties:w};yield d(`${s}users`,j(S({},r),{method:"POST",body:JSON.stringify(x)})),i(g=>S(S({},g),w)),p()}),[e,r,n,p]),f=gr((w,x)=>D(this,null,function*(){if(!l())return;let E={foreignId:e,events:[{event:w,properties:x}]};yield d(`${s}users`,j(S({},r),{method:"POST",body:JSON.stringify(E)})),p()}),[e,r,p]),C=gr((w,x)=>D(this,null,function*(){if(l())if(x){let g=m(w);localStorage.setItem(g,"true"),o(w);let E={foreignId:w,properties:x};yield d(`${s}users`,j(S({},r),{method:"POST",body:JSON.stringify(E)})),i(T=>S(S({},T),x)),p()}else o(w)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:C,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Rp}from"uuid";import ot,{useEffect as xn,useState as Jp}from"react";import Je,{useEffect as yr,useState as Ia}from"react";import Uo from"styled-components";import ka from"react";import Pa from"styled-components";var fi="fr-",ho="cfr-";function a(e,t){let o=`${fi}${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+" "+ho+e}return o}function A(e){if(!e.className||e.className.indexOf(ho)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function $o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${$o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function xo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
3
3
  display: flex;
4
4
  justify-content: center;
5
5
  position: fixed;
@@ -7,7 +7,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
7
7
  left: 0;
8
8
  bottom: 0;
9
9
  right: 0;
10
- ${e=>E(e)} {
10
+ ${e=>A(e)} {
11
11
  background-color: rgba(0, 0, 0, 0.6);
12
12
  z-index: 1400;
13
13
  }
@@ -23,12 +23,12 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
23
23
  opacity: 1;
24
24
  }
25
25
  }
26
- `,fi=({onClose:e,appearance:t})=>Fa.createElement(Pa,{className:a("modalBackground",t),onClick:()=>e()});import hr from"react";import va from"styled-components";var Ba=va.div`
26
+ `,gi=({onClose:e,appearance:t})=>ka.createElement(va,{className:a("modalBackground",t),onClick:()=>e()});import hr from"react";import Ba from"styled-components";var Ea=Ba.div`
27
27
  :hover {
28
28
  opacity: 0.8;
29
29
  }
30
- `,Ne=()=>hr.createElement(Ba,null,hr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},hr.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Ia}from"react-portal";import vi from"react";import xr from"react";function Ea({style:e,className:t}){return xr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},xr.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"}),xr.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 gi=Ea;import Cr from"styled-components";import lt from"styled-components";var Do=lt.div`
31
- ${e=>E(e)} {
30
+ `,Oe=()=>hr.createElement(Ea,null,hr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},hr.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as La}from"react-portal";import Bi from"react";import xr from"react";function Aa({style:e,className:t}){return xr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},xr.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"}),xr.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 hi=Aa;import Cr from"styled-components";import lt from"styled-components";var Mo=lt.div`
31
+ ${e=>A(e)} {
32
32
  background: ${e=>e.appearance.theme.colorBackground};
33
33
  }
34
34
 
@@ -38,7 +38,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
38
38
  min-width: 300px;
39
39
  z-index: ${e=>e.zIndex};
40
40
  overflow: hidden;
41
- `,Aa=`
41
+ `,Na=`
42
42
  display: block;
43
43
  cursor: pointer;
44
44
  position: absolute;
@@ -57,52 +57,52 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
57
57
  position: absolute;
58
58
  top: 12px;
59
59
  right: 12px;
60
- `,hi=lt.div`
61
- ${e=>E(e)} {
62
- ${e=>e.hasImage?Aa:Oa};
60
+ `,xi=lt.div`
61
+ ${e=>A(e)} {
62
+ ${e=>e.hasImage?Na:Oa};
63
63
  }
64
- `,xi=lt.img`
65
- ${e=>E(e)} {
64
+ `,Ci=lt.img`
65
+ ${e=>A(e)} {
66
66
  display: block;
67
67
  width: 100%;
68
68
  height: auto;
69
69
  min-height: 200px;
70
70
  object-fit: cover;
71
71
  }
72
- `,Ci=lt.div`
73
- ${e=>E(e)} {
72
+ `,yi=lt.div`
73
+ ${e=>A(e)} {
74
74
  display: block;
75
75
  width: 100%;
76
76
  height: auto;
77
77
  margin-top: ${e=>e.dismissible?"24px":"0px"};
78
78
  object-fit: cover;
79
79
  }
80
- `,yi=lt.div`
80
+ `,Si=lt.div`
81
81
  display: flex;
82
82
  flex-direction: row;
83
83
  justify-content: space-between;
84
84
  align-content: center;
85
- `,Si=lt.div`
86
- padding: 22px 22px 12px;
87
85
  `,bi=lt.div`
86
+ padding: 22px 22px 12px;
87
+ `,wi=lt.div`
88
88
  display: flex;
89
89
  flex: 1;
90
90
  flex-direction: column;
91
91
  justify-content: center;
92
- `,wi=lt.div`
92
+ `,Ti=lt.div`
93
93
  display: flex;
94
94
  flex: 2;
95
95
  flex-shrink: 1;
96
96
  gap: 8px;
97
97
  height: 64px;
98
- ${e=>E(e)} {
98
+ ${e=>A(e)} {
99
99
  flex-direction: row;
100
100
  justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
101
101
  align-content: center;
102
102
  align-items: center;
103
103
  }
104
- `,Ti=lt.p`
105
- ${e=>E(e)} {
104
+ `,Fi=lt.p`
105
+ ${e=>A(e)} {
106
106
  font-style: normal;
107
107
  font-weight: 600;
108
108
  font-size: 15px;
@@ -110,7 +110,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
110
110
  color: #808080;
111
111
  }
112
112
  margin: 0;
113
- `;var Fi=Cr.div`
113
+ `;var ki=Cr.div`
114
114
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
115
115
  position: absolute;
116
116
  bottom: -47px;
@@ -121,7 +121,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
121
121
  align-items: center;
122
122
  justify-content: center;
123
123
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
124
- `,ki=Cr(Do)`
124
+ `,Pi=Cr(Mo)`
125
125
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
126
126
  position: absolute;
127
127
  bottom: -60px;
@@ -134,7 +134,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
134
134
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
135
135
  padding: 0;
136
136
  z-index: ${e=>e.zIndex};
137
- `,Pi=Cr.div`
137
+ `,vi=Cr.div`
138
138
  display: flex;
139
139
  justify-content: center;
140
140
  align-items: center;
@@ -143,8 +143,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
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 Uo({appearance:e}){return vi.createElement(Pi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",vi.createElement(gi,null))}var La=Wo.div`
147
- ${e=>E(e)} {
146
+ `;function Do({appearance:e}){return Bi.createElement(vi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Bi.createElement(hi,null))}var $a=Uo.div`
147
+ ${e=>A(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}};
150
150
  /* Mobile */
@@ -158,7 +158,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
158
158
  width: ${e=>{var t;return(t=e.width)!=null?t:"1000px"}};
159
159
  z-index: 1500;
160
160
  border-radius: ${e=>{var t,o,i;return(i=(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)!=null?i:8}}px;
161
- ${e=>ve(e)}
161
+ ${e=>Pe(e)}
162
162
  }
163
163
 
164
164
  padding: 32px;
@@ -185,27 +185,27 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
185
185
  opacity: 1;
186
186
  }
187
187
  }
188
- `,$a=Wo.div`
188
+ `,Ma=Uo.div`
189
189
  position: relative;
190
190
  flex: 0 1 auto;
191
- `,Ma=Wo.div`
191
+ `,Da=Uo.div`
192
192
  position: absolute;
193
193
  top: 16px;
194
194
  right: 16px;
195
195
  cursor: pointer;
196
196
  z-index: 1501;
197
- ${e=>E(e)} {
197
+ ${e=>A(e)} {
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
- `,Da=Wo.div`
201
+ `,Ua=Uo.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
- `,Ze=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[d,l]=Na("");return yr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");l(m)},[]),yr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),yr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?Ye.createElement(Ia,null,Ye.createElement(fi,{appearance:r,onClose:()=>{s&&e()}}),Ye.createElement(La,{appearance:r,className:a("modalContainer",r),styleOverrides:i},s&&Ye.createElement(Ma,{className:a("modalClose",r),onClick:()=>e(),appearance:r},Ye.createElement(Ne,null)),o&&Ye.createElement($a,null,o),Ye.createElement(Da,null,n),p&&Ye.createElement(Fi,{appearance:r,className:a("poweredByFrigadeRibbon",r)},Ye.createElement(Uo,{appearance:r})))):Ye.createElement(Ye.Fragment,null)};import yt,{useEffect as Sr,useState as Ua}from"react";import zo from"styled-components";import{Portal as Wa}from"react-portal";function za(e){switch(e){case"top-left":return`
208
+ `,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[d,l]=Ia("");return yr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");l(m)},[]),yr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),yr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?Je.createElement(La,null,Je.createElement(gi,{appearance:r,onClose:()=>{s&&e()}}),Je.createElement($a,{appearance:r,className:a("modalContainer",r),styleOverrides:i},s&&Je.createElement(Da,{className:a("modalClose",r),onClick:()=>e(),appearance:r},Je.createElement(Oe,null)),o&&Je.createElement(Ma,null,o),Je.createElement(Ua,null,n),p&&Je.createElement(ki,{appearance:r,className:a("poweredByFrigadeRibbon",r)},Je.createElement(Do,{appearance:r})))):Je.createElement(Je.Fragment,null)};import yt,{useEffect as Sr,useState as Wa}from"react";import Wo from"styled-components";import{Portal as za}from"react-portal";function _a(e){switch(e){case"top-left":return`
209
209
  top: 0;
210
210
  left: 0;
211
211
  `;case"top-right":return`
@@ -214,8 +214,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
214
214
  `;case"bottom-left":return`
215
215
  bottom: 0;
216
216
  left: 0;
217
- `}return"right: 0; bottom: 0;"}var _a=zo.div`
218
- ${e=>E(e)} {
217
+ `}return"right: 0; bottom: 0;"}var Ha=Wo.div`
218
+ ${e=>A(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}};
221
221
  position: fixed;
@@ -228,29 +228,29 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
228
228
  width: 350px;
229
229
  padding: 24px;
230
230
  }
231
- ${e=>za(e.modalPosition)}
231
+ ${e=>_a(e.modalPosition)}
232
232
  margin: 28px;
233
- `,Ha=zo.div`
233
+ `,Va=Wo.div`
234
234
  position: relative;
235
235
  flex: 1;
236
- `,Va=zo.div`
236
+ `,ja=Wo.div`
237
237
  position: absolute;
238
238
  top: 16px;
239
239
  right: 16px;
240
240
  cursor: pointer;
241
241
  z-index: 1501;
242
- ${e=>E(e)} {
242
+ ${e=>A(e)} {
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
- `,ja=zo.div`
246
+ `,Ga=Wo.div`
247
247
  overflow: scroll;
248
248
  flex: 5;
249
249
  ::-webkit-scrollbar {
250
250
  display: none;
251
251
  }
252
- `,_o=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[p,d]=Ua("");return Sr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),Sr(()=>{let l=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),Sr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?yt.createElement(Wa,null,yt.createElement(_a,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},s&&yt.createElement(Va,{className:a("cornerModalClose",n),onClick:()=>e()},yt.createElement(Ne,null)),o&&yt.createElement(Ha,null,o),yt.createElement(ja,null,i))):yt.createElement(yt.Fragment,null)};import{useContext as Ga}from"react";function ee(){let{defaultAppearance:e}=Ga(Y);function t(o){var n,r,s;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(s=o.theme)!=null?s:{})}:i}return{mergeAppearanceWithDefault:t}}import Bt,{useContext as up,useEffect as ji,useState as Ar}from"react";import Ko from"styled-components";import jo,{useEffect as Ii,useState as Tr}from"react";import Fr from"styled-components";import Ho from"styled-components";var Bi=Ho.label`
253
- ${e=>E(e)} {
252
+ `,zo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[p,d]=Wa("");return Sr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),Sr(()=>{let l=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),Sr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?yt.createElement(za,null,yt.createElement(Ha,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},s&&yt.createElement(ja,{className:a("cornerModalClose",n),onClick:()=>e()},yt.createElement(Oe,null)),o&&yt.createElement(Va,null,o),yt.createElement(Ga,null,i))):yt.createElement(yt.Fragment,null)};import{useContext as Ka}from"react";function oe(){let{defaultAppearance:e}=Ka(X);function t(o){var n,r,s;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(s=o.theme)!=null?s:{})}:i}return{mergeAppearanceWithDefault:t}}import Bt,{useContext as fp,useEffect as Gi,useState as Ar}from"react";import Go from"styled-components";import Vo,{useEffect as Li,useState as Tr}from"react";import Fr from"styled-components";import _o from"styled-components";var Ei=_o.label`
253
+ ${e=>A(e)} {
254
254
  font-size: 12px;
255
255
  line-height: 18px;
256
256
  margin-bottom: 5px;
@@ -260,14 +260,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
260
260
  letter-spacing: 0.24px;
261
261
  }
262
262
  display: flex;
263
- `,Ei=Ho.label`
264
- ${e=>E(e)} {
263
+ `,Ai=_o.label`
264
+ ${e=>A(e)} {
265
265
  font-size: 12px;
266
266
  line-height: 20px;
267
267
  margin-bottom: 5px;
268
268
  }
269
269
  display: flex;
270
- `,Ai=Ho.span`
270
+ `,Ni=_o.span`
271
271
  font-weight: 400;
272
272
  font-size: 14px;
273
273
  line-height: 22px;
@@ -275,17 +275,17 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
275
275
  display: flex;
276
276
  margin-right: 5px;
277
277
  margin-top: 10px;
278
- `,Vo=Ho.div`
278
+ `,Ho=_o.div`
279
279
  display: flex;
280
280
  align-items: flex-start;
281
281
  justify-content: left;
282
282
  margin-bottom: 10px;
283
- `;import br from"react";var at={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function St({title:e,required:t,appearance:o=at}){return e?br.createElement(Vo,{className:a("formLabelWrapper",o)},t?br.createElement(Ai,{className:a("formLabelRequired",o),appearance:o},"*"):null,br.createElement(Bi,{className:a("formLabel",o)},e)):null}import Oi from"react";function Kt({title:e,appearance:t}){return e?Oi.createElement(Vo,null,Oi.createElement(Ei,{className:a("formSubLabel",t)},e)):null}import{z as wr}from"zod";function Ni(e,t){var o,i,n,r,s,p,d;try{if(t){if(t.type=="number"){let l=wr.number();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?l=l.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?l=l.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(l=l.nonpositive((r=m.message)!=null?r:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=wr.string();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(s=m.message)!=null?s:"Value is too short"):m.requirement=="max"?l=l.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(l=l.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));l.parse(e)}return}}catch(l){if(l instanceof wr.ZodError)return l.issues&&l.issues.length>0?l.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,l)}return null}var Ka=Fr.div`
283
+ `;import br from"react";var at={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function St({title:e,required:t,appearance:o=at}){return e?br.createElement(Ho,{className:a("formLabelWrapper",o)},t?br.createElement(Ni,{className:a("formLabelRequired",o),appearance:o},"*"):null,br.createElement(Ei,{className:a("formLabel",o)},e)):null}import Oi from"react";function Gt({title:e,appearance:t}){return e?Oi.createElement(Ho,null,Oi.createElement(Ai,{className:a("formSubLabel",t)},e)):null}import{z as wr}from"zod";function Ii(e,t){var o,i,n,r,s,p,d;try{if(t){if(t.type=="number"){let l=wr.number();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?l=l.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?l=l.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(l=l.nonpositive((r=m.message)!=null?r:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=wr.string();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(s=m.message)!=null?s:"Value is too short"):m.requirement=="max"?l=l.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(l=l.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));l.parse(e)}return}}catch(l){if(l instanceof wr.ZodError)return l.issues&&l.issues.length>0?l.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,l)}return null}var qa=Fr.div`
284
284
  display: flex;
285
285
  flex-direction: column;
286
286
  width: 100%;
287
287
  `,kr=Fr.input`
288
- ${e=>E(e)} {
288
+ ${e=>A(e)} {
289
289
  // Anything inside this block will be ignored if the user provides a custom class
290
290
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
291
291
  font-size: 14px;
@@ -300,8 +300,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
300
300
  box-sizing: border-box;
301
301
  padding: 0 10px;
302
302
  margin-bottom: 10px;
303
- `,qa=Fr.textarea`
304
- ${e=>E(e)} {
303
+ `,Ya=Fr.textarea`
304
+ ${e=>A(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}};
307
307
  font-size: 14px;
@@ -317,14 +317,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
317
317
  box-sizing: border-box;
318
318
  margin-bottom: 10px;
319
319
  resize: none;
320
- `;function Pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,p]=Tr((n==null?void 0:n.text)||""),[d,l]=Tr(!1),[m,c]=Tr(!1),f=kr;Ii(()=>{s===""&&!d&&(l(!0),C(""))},[]),Ii(()=>{if(m){C(s);return}},[m]);function C(x){var A;if(p(x),o({text:x}),r.required===!0&&x.trim()===""){i([{id:r.id,message:`${(A=r.title)!=null?A:"Field"} is required`,hidden:!m}]);return}let g=Ni(x,r.validation);if(g&&(x.trim()!==""||r.required===!0)){i([{id:r.id,message:g,hidden:!m}]);return}i([])}r.multiline&&(f=qa);function w(){var x;switch((x=r==null?void 0:r.validation)==null?void 0:x.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return jo.createElement(Ka,null,jo.createElement(St,{title:r.title,required:r.required,appearance:t.appearance}),jo.createElement(f,{className:a("inputComponent",t.appearance),value:s,onChange:x=>{C(x.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:w(),onBlur:()=>{c(!0)}}),jo.createElement(Kt,{title:r.subtitle,appearance:t.appearance}))}import Re,{useEffect as Li,useState as $i}from"react";import Mi from"styled-components";var vr="",Ya=Mi.div`
320
+ `;function Pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,p]=Tr((n==null?void 0:n.text)||""),[d,l]=Tr(!1),[m,c]=Tr(!1),f=kr;Li(()=>{s===""&&!d&&(l(!0),C(""))},[]),Li(()=>{if(m){C(s);return}},[m]);function C(x){var E;if(p(x),o({text:x}),r.required===!0&&x.trim()===""){i([{id:r.id,message:`${(E=r.title)!=null?E:"Field"} is required`,hidden:!m}]);return}let g=Ii(x,r.validation);if(g&&(x.trim()!==""||r.required===!0)){i([{id:r.id,message:g,hidden:!m}]);return}i([])}r.multiline&&(f=Ya);function w(){var x;switch((x=r==null?void 0:r.validation)==null?void 0:x.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Vo.createElement(qa,null,Vo.createElement(St,{title:r.title,required:r.required,appearance:t.appearance}),Vo.createElement(f,{className:a("inputComponent",t.appearance),value:s,onChange:x=>{C(x.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:w(),onBlur:()=>{c(!0)}}),Vo.createElement(Gt,{title:r.subtitle,appearance:t.appearance}))}import et,{useEffect as $i,useState as Mi}from"react";import Di from"styled-components";var vr="",Ja=Di.div`
321
321
  display: flex;
322
322
  flex-direction: column;
323
323
  width: 100%;
324
324
  -webkit-appearance: none;
325
325
  appearance: none;
326
- `,Ja=Mi.select`
327
- ${e=>E(e)} {
326
+ `,Xa=Di.select`
327
+ ${e=>A(e)} {
328
328
  // Anything inside this block will be ignored if the user provides a custom class
329
329
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
330
330
  font-size: 14px;
@@ -344,16 +344,16 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
344
344
  background-repeat: no-repeat;
345
345
  background-size: 1.5em 1.5em;
346
346
  -webkit-print-color-adjust: exact;
347
- `;function Di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,f,C,w,x,g,A,T;let r=e,[s,p]=$i(!1),[d,l]=$i(!1);return Li(()=>{var k,P,v,u;if(!((k=i==null?void 0:i.choice)!=null&&k[0])&&!s){if(p(!0),r.requireSelection){o({choice:[vr]});return}if(r.defaultValue&&((P=r.props.options)!=null&&P.find(L=>L.id===r.defaultValue))){let L=(v=r.props.options)==null?void 0:v.find(S=>S.id===r.defaultValue);o({choice:[L.id]})}else o({choice:[((u=r.props.options)==null?void 0:u[0].id)||""]})}},[]),Li(()=>{var k;d&&(r.requireSelection&&((k=i==null?void 0:i.choice)==null?void 0:k[0])===vr?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),Re.createElement(Ya,null,Re.createElement(St,{title:r.title,required:!1,appearance:t.appearance}),Re.createElement(Ja,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:k=>{l(!0),o({choice:[k.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&Re.createElement("option",{key:"null-value",value:vr,disabled:!0},(f=r.placeholder)!=null?f:"Select an option"),(C=r.props.options)==null?void 0:C.map(k=>Re.createElement("option",{key:k.id,value:k.id},k.title))),((x=(w=r.props.options)==null?void 0:w.find(k=>{var P;return k.id===((P=i==null?void 0:i.choice)==null?void 0:P[0])}))==null?void 0:x.isOpenEnded)&&Re.createElement(Re.Fragment,null,Re.createElement(St,{title:(T=(A=(g=r.props.options)==null?void 0:g.find(k=>{var P;return k.id===((P=i==null?void 0:i.choice)==null?void 0:P[0])}))==null?void 0:A.openEndedLabel)!=null?T:"Please specify",required:!1,appearance:t.appearance}),Re.createElement(kr,{type:"text",placeholder:"Enter your answer here",onChange:k=>{o({choice:[k.target.value]})},appearance:t.appearance})),Re.createElement(Kt,{title:r.subtitle,appearance:t.appearance}))}import bo,{useEffect as Br,useState as Wi}from"react";import zi from"styled-components";import So from"react";import yo from"react";var Ui=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return yo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Xa=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>yo.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},yo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},yo.createElement(Ui,{color:n,size:t}),yo.createElement(Ui,{color:e,percentage:Math.max(o,.1),size:t})),i),qt=Xa;import Qa from"styled-components";var Za=({color:e="#FFFFFF"})=>So.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},So.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ra={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ep={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},tp={border:"1px solid #000000",color:"#FFFFFF"},op={border:"1px solid #C5CBD3"},rp={color:"#FFFFFF"},ip={border:"1px solid #C5CBD3"},np=e=>e==="square"?Ra:ep,sp=(e,t)=>e==="square"?t?tp:op:t?rp:ip,lp=Qa.div`
348
- ${e=>ve(e)}
349
- `,pt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=at,style:r,className:s})=>{let p=np(t),d=sp(t,e);return e===!0?p=j(b(b({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=b(b({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?So.createElement(qt,{fillColor:o,percentage:i,size:22}):So.createElement(lp,{styleOverrides:p,style:r,role:"checkbox",className:Fe(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&So.createElement(Za,{color:"#FFFFFF"}))};var ap=zi.div`
347
+ `;function Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,f,C,w,x,g,E,T;let r=e,[s,p]=Mi(!1),[d,l]=Mi(!1);return $i(()=>{var P,B,k,u;if(!((P=i==null?void 0:i.choice)!=null&&P[0])&&!s){if(p(!0),r.requireSelection){o({choice:[vr]});return}if(r.defaultValue&&((B=r.props.options)!=null&&B.find(L=>L.id===r.defaultValue))){let L=(k=r.props.options)==null?void 0:k.find(b=>b.id===r.defaultValue);o({choice:[L.id]})}else o({choice:[((u=r.props.options)==null?void 0:u[0].id)||""]})}},[]),$i(()=>{var P;d&&(r.requireSelection&&((P=i==null?void 0:i.choice)==null?void 0:P[0])===vr?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),et.createElement(Ja,null,et.createElement(St,{title:r.title,required:!1,appearance:t.appearance}),et.createElement(Xa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:P=>{l(!0),o({choice:[P.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&et.createElement("option",{key:"null-value",value:vr,disabled:!0},(f=r.placeholder)!=null?f:"Select an option"),(C=r.props.options)==null?void 0:C.map(P=>et.createElement("option",{key:P.id,value:P.id},P.title))),((x=(w=r.props.options)==null?void 0:w.find(P=>{var B;return P.id===((B=i==null?void 0:i.choice)==null?void 0:B[0])}))==null?void 0:x.isOpenEnded)&&et.createElement(et.Fragment,null,et.createElement(St,{title:(T=(E=(g=r.props.options)==null?void 0:g.find(P=>{var B;return P.id===((B=i==null?void 0:i.choice)==null?void 0:B[0])}))==null?void 0:E.openEndedLabel)!=null?T:"Please specify",required:!1,appearance:t.appearance}),et.createElement(kr,{type:"text",placeholder:"Enter your answer here",onChange:P=>{o({choice:[P.target.value]})},appearance:t.appearance})),et.createElement(Gt,{title:r.subtitle,appearance:t.appearance}))}import So,{useEffect as Br,useState as zi}from"react";import _i from"styled-components";import yo from"react";import Co from"react";var Wi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return Co.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Qa=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>Co.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},Co.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Co.createElement(Wi,{color:n,size:t}),Co.createElement(Wi,{color:e,percentage:Math.max(o,.1),size:t})),i),Kt=Qa;import Za from"styled-components";var Ra=({color:e="#FFFFFF"})=>yo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ep={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},tp={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},op={border:"1px solid #000000",color:"#FFFFFF"},rp={border:"1px solid #C5CBD3"},ip={color:"#FFFFFF"},np={border:"1px solid #C5CBD3"},sp=e=>e==="square"?ep:tp,lp=(e,t)=>e==="square"?t?op:rp:t?ip:np,ap=Za.div`
348
+ ${e=>Pe(e)}
349
+ `,pt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=at,style:r,className:s})=>{let p=sp(t),d=lp(t,e);return e===!0?p=j(S(S({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=S(S({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?yo.createElement(Kt,{fillColor:o,percentage:i,size:22}):yo.createElement(ap,{styleOverrides:p,style:r,role:"checkbox",className:Te(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&yo.createElement(Ra,{color:"#FFFFFF"}))};var pp=_i.div`
350
350
  display: flex;
351
351
  flex-direction: column;
352
352
  width: 100%;
353
353
  -webkit-appearance: none;
354
354
  appearance: none;
355
- `,pp=zi.button`
356
- ${e=>E(e)} {
355
+ `,dp=_i.button`
356
+ ${e=>A(e)} {
357
357
  // Anything inside this block will be ignored if the user provides a custom class
358
358
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
359
359
  font-size: 14px;
@@ -377,8 +377,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
377
377
  height: 48px;
378
378
  padding: 0 18px;
379
379
  margin-bottom: 10px;
380
- `;function _i({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[s,p]=Wi((i==null?void 0:i.choice)||[]),[d,l]=Wi(!1);return Br(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),Br(()=>{o({choice:s})},[s]),Br(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[s]),bo.createElement(ap,null,bo.createElement(St,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>bo.createElement(pp,{appearance:t.appearance,className:a(s.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(f=>f!==c.id));return}s.length<r.props.maxChoices?p([...s,c.id]):s.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,bo.createElement(pt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),bo.createElement(Kt,{title:r.subtitle,appearance:t.appearance}))}import Go from"react";import Hi from"styled-components";import dp from"dompurify";function ae(e){return{__html:dp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var cp=Hi.h1`
381
- ${e=>E(e)} {
380
+ `;function Hi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[s,p]=zi((i==null?void 0:i.choice)||[]),[d,l]=zi(!1);return Br(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),Br(()=>{o({choice:s})},[s]),Br(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[s]),So.createElement(pp,null,So.createElement(St,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>So.createElement(dp,{appearance:t.appearance,className:a(s.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(f=>f!==c.id));return}s.length<r.props.maxChoices?p([...s,c.id]):s.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,So.createElement(pt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),So.createElement(Gt,{title:r.subtitle,appearance:t.appearance}))}import jo from"react";import Vi from"styled-components";import cp from"dompurify";function ce(e){return{__html:cp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var mp=Vi.h1`
381
+ ${e=>A(e)} {
382
382
  font-style: normal;
383
383
  font-weight: 700;
384
384
  font-size: ${e=>e.size=="small"?"15px":"18px"};
@@ -389,8 +389,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
389
389
  margin-bottom: 4px;
390
390
  color: ${e=>e.appearance.theme.colorText};
391
391
  }
392
- `,mp=Hi.h2`
393
- ${e=>E(e)} {
392
+ `,up=Vi.h2`
393
+ ${e=>A(e)} {
394
394
  font-style: normal;
395
395
  font-weight: 400;
396
396
  font-size: 14px;
@@ -398,38 +398,38 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
398
398
  letter-spacing: 0.28px;
399
399
  color: ${e=>e.appearance.theme.colorTextSecondary};
400
400
  }
401
- `;function Ie({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return Go.createElement(Go.Fragment,null,Go.createElement(cp,{appearance:e,className:a(`${n}${n?Co(i):i}Title`,e),dangerouslySetInnerHTML:ae(t),size:i}),o&&Go.createElement(mp,{appearance:e,className:a(`${n}${n?Co(i):i}Subtitle`,e),dangerouslySetInnerHTML:ae(o),size:i}))}import*as Er from"react";var Vi=e=>Er.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Er.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 fp=Ko.div`
401
+ `;function Ie({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return jo.createElement(jo.Fragment,null,jo.createElement(mp,{appearance:e,className:a(`${n}${n?xo(i):i}Title`,e),dangerouslySetInnerHTML:ce(t),size:i}),o&&jo.createElement(up,{appearance:e,className:a(`${n}${n?xo(i):i}Subtitle`,e),dangerouslySetInnerHTML:ce(o),size:i}))}import*as Er from"react";var ji=e=>Er.createElement("svg",S({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Er.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 gp=Go.div`
402
402
  display: flex;
403
403
  flex-direction: column;
404
404
  justify-content: flex-end;
405
405
  overflow: visible;
406
406
  padding-top: 14px;
407
- `,gp=Ko.div`
407
+ `,hp=Go.div`
408
408
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
409
409
  font-size: 12px;
410
410
  margin-bottom: 12px;
411
411
  display: flex;
412
412
  align-items: center;
413
- `,hp=Ko.div`
413
+ `,xp=Go.div`
414
414
  margin-right: 4px;
415
415
  display: inline-flex;
416
- `,xp=Ko.div`
416
+ `,Cp=Go.div`
417
417
  padding-left: 1px;
418
418
  padding-right: 1px;
419
- `,Cp={text:Pr,multipleChoice:Di,multipleChoiceList:_i},Or="frigade-multiInputStepTypeData";function Gi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:s,prefillData:p}){var v;let d=t.props,[l,m]=Ar([]),[c,f]=Ar([]),{userId:C}=ho(),[w,x]=Ar(k()||(p?p[t.id]:null)||{}),{readonly:g}=up(Y),A=b(b({},Cp),s);ji(()=>{i(l.length===0)},[l,i]),ji(()=>{n(w)},[w]);function T(u,L){x(S=>{let F=j(b({},S),{[u.id]:L});return typeof window!="undefined"&&window.localStorage&&!g&&window.localStorage.setItem(P(),JSON.stringify(F)),F})}function k(){if(typeof window!="undefined"&&window.localStorage){let u=window.localStorage.getItem(P());if(u)return JSON.parse(u)}return null}function P(){return`${Or}-${e}-${t.id}-${C}`}return Bt.createElement(xp,{className:a("multiInput",r)},Bt.createElement(Ie,{appearance:r,title:t.title,subtitle:t.subtitle}),Bt.createElement(fp,{className:a("multiInputContainer",r)},(v=d==null?void 0:d.data)==null?void 0:v.map(u=>{let L=l.reverse().find(S=>S.id===u.id);return A[u.type]?Bt.createElement("span",{key:u.id,"data-field-id":u.id,className:a("multiInputField",r)},A[u.type]({formInput:u,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:S=>{!c.includes(u.id)&&S&&(S==null?void 0:S.text)!==""&&f(F=>[...F,u.id]),T(u,S)},inputData:w[u.id],setFormValidationErrors:S=>{S.length===0&&l.length===0||m(F=>S.length===0?F.filter(M=>M.id!==u.id):[...F,...S])}}),L&&L.message&&c.includes(u.id)&&L.hidden!==!0&&Bt.createElement(gp,{key:u.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},Bt.createElement(hp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},Bt.createElement(Vi,null)),L.message)):null})))}import Yt from"styled-components";var Ki=Yt.div`
419
+ `,yp={text:Pr,multipleChoice:Ui,multipleChoiceList:Hi},Nr="frigade-multiInputStepTypeData";function Ki({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:s,prefillData:p}){var k;let d=t.props,[l,m]=Ar([]),[c,f]=Ar([]),{userId:C}=go(),[w,x]=Ar(P()||(p?p[t.id]:null)||{}),{readonly:g}=fp(X),E=S(S({},yp),s);Gi(()=>{i(l.length===0)},[l,i]),Gi(()=>{n(w)},[w]);function T(u,L){x(b=>{let F=j(S({},b),{[u.id]:L});return typeof window!="undefined"&&window.localStorage&&!g&&window.localStorage.setItem(B(),JSON.stringify(F)),F})}function P(){if(typeof window!="undefined"&&window.localStorage){let u=window.localStorage.getItem(B());if(u)return JSON.parse(u)}return null}function B(){return`${Nr}-${e}-${t.id}-${C}`}return Bt.createElement(Cp,{className:a("multiInput",r)},Bt.createElement(Ie,{appearance:r,title:t.title,subtitle:t.subtitle}),Bt.createElement(gp,{className:a("multiInputContainer",r)},(k=d==null?void 0:d.data)==null?void 0:k.map(u=>{let L=l.reverse().find(b=>b.id===u.id);return E[u.type]?Bt.createElement("span",{key:u.id,"data-field-id":u.id,className:a("multiInputField",r)},E[u.type]({formInput:u,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:b=>{!c.includes(u.id)&&b&&(b==null?void 0:b.text)!==""&&f(F=>[...F,u.id]),T(u,b)},inputData:w[u.id],setFormValidationErrors:b=>{b.length===0&&l.length===0||m(F=>b.length===0?F.filter($=>$.id!==u.id):[...F,...b])}}),L&&L.message&&c.includes(u.id)&&L.hidden!==!0&&Bt.createElement(hp,{key:u.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},Bt.createElement(xp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},Bt.createElement(ji,null)),L.message)):null})))}import qt from"styled-components";var qi=qt.div`
420
420
  align-items: center;
421
421
  display: flex;
422
422
  justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
423
423
  padding-top: 14px;
424
- `,qi=Yt.div`
424
+ `,Yi=qt.div`
425
425
  color: ${e=>e.appearance.theme.colorTextError};
426
426
  font-size: 12px;
427
- `,Yi=Yt.div`
427
+ `,Ji=qt.div`
428
428
  display: flex;
429
429
  gap: 12px;
430
430
  width: 100%;
431
431
  justify-content: flex-end;
432
- `,Ji=Yt.div`
432
+ `,Xi=qt.div`
433
433
  display: flex;
434
434
  // If type is set to large-modal, use padding 60px horizontal, 80px vertical
435
435
  // Otherwise, use 4px padding
@@ -437,11 +437,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
437
437
  flex-grow: 1;
438
438
  flex-basis: 0;
439
439
  position: relative;
440
- `,Xi=Yt.div`
440
+ `,Qi=qt.div`
441
441
  padding: ${e=>e.type==="large-modal"?"50px":"0px"};
442
442
  position: relative;
443
443
  overflow-y: auto;
444
- `,Qi=Yt.div`
444
+ `,Zi=qt.div`
445
445
  display: flex;
446
446
  align-self: stretch;
447
447
  flex-grow: 1;
@@ -453,7 +453,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
453
453
  background-position: center;
454
454
  border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
455
455
  border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
456
- `;import bt from"react";import Ri from"react";import en from"styled-components";import yp from"styled-components";var Zi=yp.div`
456
+ `;import bt from"react";import en from"react";import tn from"styled-components";import Sp from"styled-components";var Ri=Sp.div`
457
457
  width: 24px;
458
458
  height: 24px;
459
459
  border: 3px solid rgba(255, 255, 255, 0.25);
@@ -471,11 +471,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
471
471
  transform: rotate(360deg);
472
472
  }
473
473
  }
474
- `;var Sp=en.button`
474
+ `;var bp=tn.button`
475
475
  justify-content: center;
476
476
  align-content: center;
477
477
  align-items: center;
478
- ${e=>E(e)} {
478
+ ${e=>A(e)} {
479
479
  display: flex;
480
480
  // Anything inside this block will be ignored if the user provides a custom class
481
481
  width: ${e=>e.type==="full-width"?"100%":"auto"};
@@ -490,7 +490,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
490
490
  font-size: ${e=>e.size=="small"?"14px":"15px"};
491
491
  line-height: 20px;
492
492
  font-weight: 500;
493
- ${e=>ve(e)}
493
+ ${e=>Pe(e)}
494
494
  }
495
495
 
496
496
  font-family: inherit;
@@ -504,8 +504,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
504
504
  opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
505
505
  cursor: not-allowed;
506
506
  }
507
- `,qo=en.div`
508
- ${e=>E(e)} {
507
+ `,Ko=tn.div`
508
+ ${e=>A(e)} {
509
509
  display: flex;
510
510
  flex-direction: row;
511
511
  justify-content: flex-start;
@@ -515,14 +515,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
515
515
  margin-right: 8px;
516
516
  }
517
517
  }
518
- `,te=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l="",loading:m=!1})=>{var f;function c(){let C=s?"buttonSecondary":"button";return l===""?C:`${l}${Co(C)}`}return Ri.createElement(Sp,{secondary:s,appearance:p,disabled:i||m,loading:(f=m==null?void 0:m.toString())!=null?f:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)},m?Ri.createElement(Zi,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var tn=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:s,onBack:p,allowBackNavigation:d,errorMessage:l,isSaving:m})=>{var C;let c=s.length>1&&r!=0&&d,f=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return bt.createElement(bt.Fragment,null,l!==null&&l!=null&&bt.createElement(qi,{appearance:o,className:a("formCTAError",o)},l),bt.createElement(Ki,{showBackButton:c,className:a("formCTAContainer",o)},c&&bt.createElement(te,{title:(C=e.backButtonTitle)!=null?C:"Back",onClick:p,secondary:!0,withMargin:!1,type:f,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),bt.createElement(Yi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?bt.createElement(te,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:f,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?bt.createElement(te,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:f,appearance:o,loading:m}):null)))};import Nr from"react";import bp from"styled-components";var wp=bp.div`
518
+ `,re=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l="",loading:m=!1})=>{var f;function c(){let C=s?"buttonSecondary":"button";return l===""?C:`${l}${xo(C)}`}return en.createElement(bp,{secondary:s,appearance:p,disabled:i||m,loading:(f=m==null?void 0:m.toString())!=null?f:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)},m?en.createElement(Ri,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var on=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:s,onBack:p,allowBackNavigation:d,errorMessage:l,isSaving:m})=>{var C;let c=s.length>1&&r!=0&&d,f=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return bt.createElement(bt.Fragment,null,l!==null&&l!=null&&bt.createElement(Yi,{appearance:o,className:a("formCTAError",o)},l),bt.createElement(qi,{showBackButton:c,className:a("formCTAContainer",o)},c&&bt.createElement(re,{title:(C=e.backButtonTitle)!=null?C:"Back",onClick:p,secondary:!0,withMargin:!1,type:f,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),bt.createElement(Ji,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?bt.createElement(re,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:f,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?bt.createElement(re,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:f,appearance:o,loading:m}):null)))};import Or from"react";import wp from"styled-components";var Tp=wp.div`
519
519
  text-align: center;
520
- `,on=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ee().mergeAppearanceWithDefault(i);return Nr.createElement(wp,{className:o},Nr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Nr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"#E6E6E6"}))))};import Et from"react";import Jt from"styled-components";import{useContext as Tp}from"react";function pe(){let e=Tp(Y);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let s=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(n,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Fp=Jt.div`
520
+ `,rn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=oe().mergeAppearanceWithDefault(i);return Or.createElement(Tp,{className:o},Or.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Or.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"#E6E6E6"}))))};import Et from"react";import Yt from"styled-components";import{useContext as Fp}from"react";function ue(){let e=Fp(X);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let s=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(n,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var kp=Yt.div`
521
521
  display: flex;
522
522
  flex-wrap: wrap;
523
523
  align-content: center;
524
524
  justify-content: center;
525
- `,kp=Jt.div`
525
+ `,Pp=Yt.div`
526
526
  align-content: center;
527
527
  align-items: center;
528
528
  display: flex;
@@ -536,10 +536,10 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
536
536
  flex-basis: 255px;
537
537
  flex-grow: 0;
538
538
  flex-shrink: 0;
539
- `,Pp=Jt.img`
539
+ `,vp=Yt.img`
540
540
  width: 78px;
541
541
  height: auto;
542
- `,vp=Jt.button`
542
+ `,Bp=Yt.button`
543
543
  font-style: normal;
544
544
  font-weight: 600;
545
545
  font-size: 13px;
@@ -552,11 +552,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
552
552
  border-radius: 100px;
553
553
  padding: 8px 12px;
554
554
  margin-top: 16px;
555
- `,Bp=Jt.h1`
555
+ `,Ep=Yt.h1`
556
556
  font-weight: 700;
557
557
  font-size: 28px;
558
558
  line-height: 34px;
559
- `,Ep=Jt.h2`
559
+ `,Ap=Yt.h2`
560
560
  font-style: normal;
561
561
  font-weight: 400;
562
562
  font-size: 16px;
@@ -565,7 +565,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
565
565
  margin-top: 12px;
566
566
  margin-bottom: 16px;
567
567
  max-width: 70%;
568
- `;function rn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=pe();return Et.createElement("div",null,Et.createElement(Bp,null,e.title),Et.createElement(Ep,null,e.subtitle),Et.createElement(Fp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Et.createElement(kp,{key:r.title},Et.createElement(Pp,{src:r.imageUri}),Et.createElement(vp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var s;r.uri&&o(r.uri,(s=r.uriTarget)!=null?s:"_blank")}},r.title)))))}import Qt,{useEffect as Up}from"react";import Jo from"styled-components";import Ir from"react";var Yo=({style:e,className:t})=>Ir.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},Ir.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Ir.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 At,{useRef as Ap,useState as Op}from"react";import Xt from"styled-components";var Np=Xt.div`
568
+ `;function nn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=ue();return Et.createElement("div",null,Et.createElement(Ep,null,e.title),Et.createElement(Ap,null,e.subtitle),Et.createElement(kp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Et.createElement(Pp,{key:r.title},Et.createElement(vp,{src:r.imageUri}),Et.createElement(Bp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var s;r.uri&&o(r.uri,(s=r.uriTarget)!=null?s:"_blank")}},r.title)))))}import Xt,{useEffect as Wp}from"react";import Yo from"styled-components";import Ir from"react";var qo=({style:e,className:t})=>Ir.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},Ir.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Ir.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 At,{useRef as Np,useState as Op}from"react";import Jt from"styled-components";var Ip=Jt.div`
569
569
  display: flex;
570
570
  align-items: center;
571
571
  justify-content: flex-start;
@@ -573,7 +573,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
573
573
  width: 100%;
574
574
  height: 100%;
575
575
  position: relative;
576
- `,Ip=Xt.div`
576
+ `,Lp=Jt.div`
577
577
  position: absolute;
578
578
  display: flex;
579
579
  align-items: center;
@@ -592,66 +592,66 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
592
592
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
593
593
  border-radius: 50%;
594
594
  }
595
- `,Lp=Xt.video`
595
+ `,$p=Jt.video`
596
596
  width: 100%;
597
597
  height: 100%;
598
598
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
599
- `,$p=Xt.iframe`
599
+ `,Mp=Jt.iframe`
600
600
  width: 100%;
601
601
  height: 100%;
602
602
  min-height: 260px;
603
603
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
604
- `,Mp=Xt.iframe`
604
+ `,Dp=Jt.iframe`
605
605
  width: 100%;
606
606
  height: 100%;
607
607
  min-height: 400px;
608
608
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
609
- }`,Dp=Xt.iframe`
609
+ }`,Up=Jt.iframe`
610
610
  width: 100%;
611
611
  height: 100%;
612
612
  min-height: 400px;
613
613
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
614
- `;function et({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),At.createElement($p,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("youtubePlayer",e)})}if(t.includes("vimeo")){let r=t.split("vimeo.com/")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),At.createElement(Mp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}if(t.includes("wistia")){let r=t.split("wistia.com/medias/")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),At.createElement(Dp,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("wistiaPlayer",e)})}return At.createElement(Np,{className:a("videoPlayerWrapper",e),appearance:e},!i&&At.createElement(Ip,{onClick:()=>{n(!0),o.current.play()},appearance:e},At.createElement(Yo,null)),At.createElement(Lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Wp=Jo.div`
615
- ${e=>E(e)} {
614
+ `;function tt({appearance:e,videoUri:t}){let o=Np(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),At.createElement(Mp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("youtubePlayer",e)})}if(t.includes("vimeo")){let r=t.split("vimeo.com/")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),At.createElement(Dp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}if(t.includes("wistia")){let r=t.split("wistia.com/medias/")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),At.createElement(Up,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("wistiaPlayer",e)})}return At.createElement(Ip,{className:a("videoPlayerWrapper",e),appearance:e},!i&&At.createElement(Lp,{onClick:()=>{n(!0),o.current.play()},appearance:e},At.createElement(qo,null)),At.createElement($p,{appearance:e,controls:i,ref:o,play:i,src:t}))}var zp=Yo.div`
615
+ ${e=>A(e)} {
616
616
  display: flex;
617
617
  flex-direction: column;
618
618
  justify-content: center;
619
619
  }
620
- `,zp=Jo.img`
621
- ${e=>E(e)} {
620
+ `,_p=Yo.img`
621
+ ${e=>A(e)} {
622
622
  width: 100%;
623
623
  height: auto;
624
624
  max-height: 250px;
625
625
  margin-bottom: 24px;
626
626
  }
627
- `,_p=Jo.div`
628
- ${e=>E(e)} {
627
+ `,Hp=Yo.div`
628
+ ${e=>A(e)} {
629
629
  margin-bottom: 24px;
630
630
  }
631
- `,Hp=Jo.div`
632
- ${e=>E(e)} {
631
+ `,Vp=Yo.div`
632
+ ${e=>A(e)} {
633
633
  width: 100%;
634
634
  height: auto;
635
635
  max-height: 250px;
636
636
  margin-bottom: 24px;
637
637
  }
638
- `;function nn({stepData:e,appearance:t,setCanContinue:o}){return Up(()=>{o(!0)},[]),Qt.createElement(Wp,{className:a("callToActionContainer",t)},Qt.createElement(_p,{className:a("callToActionTextContainer",t)},Qt.createElement(Ie,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Qt.createElement(zp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Qt.createElement(Hp,{appearance:t,className:a("callToActionVideo",t)},Qt.createElement(et,{appearance:t,videoUri:e.videoUri})))}import dt,{useEffect as Lr,useState as $r}from"react";import wt from"styled-components";var sn=wt.div`
638
+ `;function sn({stepData:e,appearance:t,setCanContinue:o}){return Wp(()=>{o(!0)},[]),Xt.createElement(zp,{className:a("callToActionContainer",t)},Xt.createElement(Hp,{className:a("callToActionTextContainer",t)},Xt.createElement(Ie,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Xt.createElement(_p,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Xt.createElement(Vp,{appearance:t,className:a("callToActionVideo",t)},Xt.createElement(tt,{appearance:t,videoUri:e.videoUri})))}import dt,{useEffect as Lr,useState as $r}from"react";import wt from"styled-components";var ln=wt.div`
639
639
  width: auto;
640
640
  display: flex;
641
641
  flex-direction: column;
642
642
  justify-content: center;
643
643
  align-items: center;
644
644
  padding: 4px;
645
- `,ln=wt.div`
645
+ `,an=wt.div`
646
646
  width: 100%;
647
647
  text-align: left;
648
- `,an=wt.h1`
648
+ `,pn=wt.h1`
649
649
  font-style: normal;
650
650
  font-weight: 700;
651
651
  font-size: 32px;
652
652
  line-height: 38px;
653
653
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
654
- `,pn=wt.h1`
654
+ `,dn=wt.h1`
655
655
  font-style: normal;
656
656
  font-weight: 400;
657
657
  font-size: 16px;
@@ -659,7 +659,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
659
659
  margin-top: 16px;
660
660
  margin-bottom: 16px;
661
661
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
662
- `,dn=wt.div`
662
+ `,cn=wt.div`
663
663
  padding-top: 12px;
664
664
  padding-bottom: 12px;
665
665
  flex-direction: row;
@@ -670,17 +670,17 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
670
670
  cursor: pointer;
671
671
  border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
672
672
  width: 100%;
673
- `,cn=wt.div`
673
+ `,mn=wt.div`
674
674
  padding-top: 10px;
675
675
  padding-bottom: 10px;
676
676
  flex-direction: row;
677
677
  display: flex;
678
678
  justify-content: flex-start;
679
- `,mn=wt.img`
679
+ `,un=wt.img`
680
680
  width: 42px;
681
681
  height: 42px;
682
682
  margin-right: 12px;
683
- `,un=wt.p`
683
+ `,fn=wt.p`
684
684
  font-style: normal;
685
685
  font-weight: 500;
686
686
  font-size: 17px;
@@ -688,8 +688,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
688
688
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
689
689
  display: flex;
690
690
  align-self: center;
691
- `;var fn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=$r([]),[p,d]=$r(!1),[l,m]=$r(e.id);return Lr(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Lr(()=>{l!==e.id&&(m(e.id),s([]))},[e]),Lr(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),dt.createElement(sn,{className:a("selectListContainer",i)},dt.createElement(ln,null,dt.createElement(an,{className:a("selectListTitle",i)},e.title),dt.createElement(pn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,f)=>{let C=r.includes(c.id);return dt.createElement(dn,{key:`select-item-${f}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(w=>w!==c.id));return}r.length<n.maxChoices?s([...r,c.id]):r.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:f===n.options.length-1,className:a("selectListSelectItem",i)},dt.createElement(cn,{className:a("selectListItemImage",i)},c.imageUri&&dt.createElement(mn,{src:c.imageUri,alt:`select-icon-${f}`}),dt.createElement(un,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),dt.createElement(pt,{appearance:i,value:C,primaryColor:i.theme.colorPrimary}))}))};import ze,{useEffect as gn,useState as Xo}from"react";var Vp=({children:e,id:t,shouldWrap:o=!1})=>ze.createElement(ze.Fragment,null,o?ze.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Qo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:m,setVisible:c,setShowModal:f,onDismiss:C,showPagination:w=!1,customFormElements:x,allowBackNavigation:g,validationHandler:A,onFormDataChange:T,showFooter:k,prefillData:P,updateUrlOnPageChange:v,repeatable:u})=>{var be;let S=b(b({},{linkCollection:rn,multiInput:Gi,callToAction:nn,selectList:fn}),i),{primaryCTAClickSideEffects:F,secondaryCTAClickSideEffects:M}=pe(),[O,I]=Xo(!1),[V,W]=Xo({}),[q,X]=Xo(!1),[de,H]=Xo(null),le=(be=t[o])!=null?be:null,{markStepCompleted:fe,markStepStarted:Te,isLoading:re,updateCustomVariables:Q,markFlowCompleted:he}=J();gn(()=>{Q(n)},[n,re]),gn(()=>{T&&T(V,D(),t[o],o)},[V]);function D(){var $;return{data:($=V[t[o].id])!=null?$:{},stepId:t[o].id,customVariables:n}}function Se(_,$,z){let Z=o+1<t.length?t[o+1]:null;return s&&s(_,z,Z,V,D()),r?r(_,o,$,Z):!0}function xe(_,$){W(z=>{let Z={};return Z[_.id]=$,b(b({},z),Z)})}function Pe(_){return _.selectedStep.imageUri?ze.createElement(Qi,{image:_.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let Ae=k&&ze.createElement(tn,{step:t[o],canContinue:O&&!q,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>U(void 0,null,function*(){if(X(!0),A){let z=yield A(t[o],o,t[o+1],V,D());if(z!==!0){H(typeof z=="string"?z:null),X(!1);return}else H(null)}let _=b({},D());yield fe(p,t[o].id,_),o+1<t.length&&!g&&(yield Te(p,t[o+1].id));let $=Se(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),C&&C(),l&&$&&(c&&c(!1),f(!1)),yield he(p),u&&(yield Te(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(Z=>{Z.startsWith(Or)&&window.localStorage.removeItem(Z)}))),F(t[o]),X(!1),typeof window!="undefined"&&!g&&v&&o+1<t.length){let z=new URL(window.location.href);z.searchParams.set("p",t[o+1].id),window.history.pushState({},"",z.toString())}}),onSecondaryClick:()=>{Se(t[o],"secondary",o),M(t[o])},onBack:()=>U(void 0,null,function*(){o-1>=0&&(X(!0),yield Te(p,t[o-1].id),X(!1))}),steps:t,allowBackNavigation:g,errorMessage:de,isSaving:q});return ze.createElement(ze.Fragment,null,ze.createElement(Ji,{className:a("formContainer",e)},ze.createElement(Vp,{id:o,shouldWrap:d==="large-modal"},ze.createElement(Xi,{key:le.id,type:d,className:a("formContent",e)},t.map(_=>{var z;let $=S[(z=_.type)!=null?z:"multiInput"];return le.id!==_.id?null:typeof $!="function"?$:ze.createElement($,{key:_.id,stepData:_,canContinue:O,setCanContinue:I,onSaveData:Z=>{xe(_,Z)},appearance:e,customFormElements:x,flowId:p,prefillData:P})}),w&&ze.createElement(on,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),Ae)),d=="large-modal"&&ze.createElement(Pe,{selectedStep:t[o]})))};import wo from"react";import{createGlobalStyle as jp}from"styled-components";var Gp=jp`
692
- ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,p])=>`${Mo(s)}: ${p};`).join(" ")} }`:`${Mo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ne({appearance:e}){if(!e||!e.styleOverrides)return wo.createElement(wo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?wo.createElement(wo.Fragment,null):wo.createElement(Gp,{inlineStyles:t})}import{useEffect as Kp,useState as qp}from"react";function Ge(e,t=!0){let[o,i]=qp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:s,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:l,getFlow:m}=J(),c=p(e);function f(){return U(this,null,function*(){!o&&!r&&s(e)===Ue&&l(m(e))===!1&&t&&(i(!0),yield n(e,c[d(e)].id))})}return Kp(()=>{f()},[r,e,t]),{}}var xn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:C=!1,modalPosition:w="center",repeatable:x=!1,onDismiss:g,showPagination:A=!1,allowBackNavigation:T=!1,validationHandler:k,showFrigadeBranding:P=!1,onFormDataChange:v,showFooter:u=!0,prefillData:L={},updateUrlOnPageChange:S=!1})=>{let{getFlow:F,getFlowSteps:M,isLoading:O,targetingLogicShouldHideFlow:I,getFlowStatus:V,getCurrentStepIndex:W,markFlowCompleted:q,markFlowNotStarted:X,markStepStarted:de}=J(),H=W(e),{mergeAppearanceWithDefault:le}=ee(),[fe,Te]=Yp(null),{setOpenFlowState:re,getOpenFlowState:Q,hasOpenModals:he}=Oe();Ge(e,i);let D=M(e);d=le(d);let[Se,xe]=i!==void 0&&n!==void 0?[i,n]:[Q(e,!0),_=>re(e,_)],Pe=typeof window!="undefined"?window.location.hash:null;if(hn(()=>{var _;if(D&&D.length>0&&T){let $=typeof window!="undefined"&&((_=window==null?void 0:window.location)!=null&&_.hash)?window.location.hash.replace("#",""):"";if(D&&(D==null?void 0:D.length)>0){let z=-1;if($){let Z=$;z=D.findIndex(ce=>ce.id===Z),fe===$&&(z=-1)}z!==-1&&(Te($),de(e,D[z].id))}}},[Pe]),hn(()=>{!O&&D&&D.length&&typeof window!="undefined"&&T&&(Te(D[H].id),window.location.hash=D[H].id)},[O,H,D]),O)return null;let Ae=F(e);if(!Ae||I(Ae)||!D||i!==void 0&&i===!1||V(e)===R&&l&&!x||(o=="modal"||o=="corner-modal")&&he(e))return null;let be=()=>{xe(!1),g&&g(),C===!0&&q(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let _={padding:"24px"};return o==="large-modal"?(_.width="85%",_.height="90%",_.maxHeight="800px",_.minHeight="500px",_.padding="0"):_.width="400px",tt.createElement(Ze,{appearance:d,onClose:be,visible:Se,style:_,dismissible:f,showFrigadeBranding:P},tt.createElement(ne,{appearance:d}),tt.createElement(Qo,{appearance:d,steps:D,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:xe,onDismiss:g,showPagination:A,customFormElements:s,allowBackNavigation:T,validationHandler:k,onFormDataChange:v,showFooter:u,prefillData:L,updateUrlOnPageChange:S,repeatable:x}))}return o==="modal"&&w!=="center"?tt.createElement(_o,{appearance:d,onClose:be,visible:Se,modalPosition:w},tt.createElement(ne,{appearance:d}),tt.createElement(Qo,{appearance:d,steps:D,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:xe,onDismiss:g,showPagination:A,customFormElements:s,allowBackNavigation:T,validationHandler:k,onFormDataChange:v,showFooter:u,prefillData:L,updateUrlOnPageChange:S,repeatable:x})):tt.createElement(tt.Fragment,null,tt.createElement(ne,{appearance:d}),tt.createElement(Qo,{appearance:d,steps:D,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:xe,onDismiss:g,showPagination:A,customFormElements:s,allowBackNavigation:T,validationHandler:k,onFormDataChange:v,showFooter:u,prefillData:L,updateUrlOnPageChange:S,repeatable:x}))},Cn=xn;import{useCallback as Mr,useContext as Jp,useEffect as Xp}from"react";function Dr(){let{organizationId:e,userId:t,setOrganizationId:o}=Jp(Y),{mutateUserFlowState:i}=We(),{config:n,apiUrl:r}=Qe(),s=Vt(),{verifySDKInitiated:p}=jt();function d(f,C){return`frigade-user-group-registered-${f}-${C}`}Xp(()=>{if(t&&e){if(t.startsWith(Gt))return;let f=d(t,e);localStorage.getItem(f)||(s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let l=Mr(f=>U(this,null,function*(){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 C={foreignUserId:t,foreignUserGroupId:e,properties:f};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),m=Mr((f,C)=>U(this,null,function*(){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 x={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:C}]};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(x)})),i()}),[e,t,n,i]),c=Mr((f,C)=>U(this,null,function*(){if(p())if(C){let w=d(t,f);localStorage.setItem(w,"true"),o(f);let x={foreignUserId:t,foreignUserGroupId:f,properties:C};yield s(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(x)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var yn="frigade-xFrigade_guestUserId",Fo="frigade-xFrigade_userId",Sn=({})=>{let{setFlowResponses:e}=go(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=We(),{userId:n,setUserId:r}=ho(),[s,p]=To(n),{getFlowStatus:d}=J(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=Qp(Y),[C,w]=To([]),[x,g]=To([]),{organizationId:A}=Dr(),[T,k]=To(A),[P,v]=To(!1);Zt(()=>{if(!o&&t)for(let F=0;F<t.length;F++){let M=t[F],O=l.find(I=>I.slug===(M==null?void 0:M.flowId));if(O&&M&&M.shouldTrigger===!0&&O.type=="FORM"&&O.triggerType==="AUTOMATIC"&&!x.includes(O.slug)){setTimeout(()=>{u(M.flowId)},500);break}}},[o,t]),Zt(()=>{f.length>0&&i()},[f]),Zt(()=>{P||(v(!0),i())},[o,v]);function u(F){let M=l.find(O=>O.slug===F);M&&M.triggerType==="AUTOMATIC"&&!x.includes(M.slug)&&(g([...x,M.slug]),w([M]))}function L(){if(!n){let F=localStorage.getItem(Fo);if(F){r(F);return}let M=localStorage.getItem(yn);if(M){r(M);return}c(!0);let O=Gt+Zp();try{localStorage.setItem(yn,O)}catch(I){console.log("Failed to save guest user id locally: Local storage unavailable",I)}r(I=>I||O)}}Zt(()=>{try{if(l){let F=[];l.forEach(M=>{if(M.data){let O=M.data.match(/"imageUri":"(.*?)"/g);O&&O.forEach(I=>{let V=I.replace('"imageUri":"',"").replace('"',"");if(F.includes(V))return;let W=new Image;W.src=V,F.push(V)})}})}}catch(F){}},[l]),Zt(()=>{if(n!==s&&(e([]),i()),p(n),n&&!n.startsWith(Gt))try{localStorage.setItem(Fo,n)}catch(F){console.log("Failed to save user id locally: Local storage available",F)}n===null&&setTimeout(()=>{n===null&&L()},50)},[n,l,m]),Zt(()=>{A!=T&&(k(A),e([]),i())},[A,T,k]);function S(){return Ot.createElement(Ot.Fragment,null,C.map(F=>d(F.slug)!==Ue?null:Ot.createElement("span",{key:F.slug},Ot.createElement(Cn,{flowId:F.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Ot.createElement(Ot.Fragment,null,Ot.createElement(S,null))};import{ErrorBoundary as Fd}from"react-error-boundary";var bn={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 Rp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(bn[o]){let n=bn[o].split("."),r=t;n.forEach((s,p)=>{r[s]||(r[s]=p===n.length-1?i:{}),r=r[s]})}}),t}function ed(e){if(!e)return;let t=Ce({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function wn(e){let{theme:t,styleOverrides:o}=e,i=Rp(t),n=ed(o);return{overrides:i,css:n}}import fd from"styled-components";import{compose as gd,variant as Fn}from"styled-system";import Tn from"react";import td,{ThemeProvider as od,useTheme as rd}from"styled-components";import{border as id,color as nd,compose as sd,get as ld,shadow as ad,space as pd,system as dd,typography as cd}from"styled-system";var md={width:{property:"width",scale:"sizes",transform:(e,t)=>ld(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},ud=td("div")(({css:e})=>e,sd(id,nd,ad,pd,cd,dd(md))),ko=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let s=rd(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Tn.createElement(ud,b(b({as:e},p),i),t);if(o!==void 0){let l=Ce(s,o);return Tn.createElement(od,{theme:l},d())}return d()};var Po={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},hd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},kn=fd(ko)(()=>({whiteSpace:"nowrap"}),gd(Fn({scale:"components.Button",variants:"components.Button"}),Fn({prop:"size",variants:hd})));import xd from"styled-components";import{variant as Cd,system as yd}from"styled-system";var Zo={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 Pn=xd(ko)(Cd({scale:"components.Text",variants:"components.Text"}),yd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var vn=4,Bn="px",Sd=20,bd=Object.fromEntries(Array.from(Array(Sd+1),(e,t)=>t===0?[.5,`${.5*vn}${Bn}`]:[t,`${t*vn}${Bn}`])),Rt={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"},Ur={colors:j(b({},Rt),{neutral:{foreground:Rt.gray300},primary:{background:Rt.blue500,foreground:Rt.white,inverted:Rt.blue500},negative:{foreground:Rt.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:bd,components:{Button:Po,Text:Zo}};var En="https://api.frigade.com",Y=wd({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:at,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:En,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var H,le,fe,Te,re;let[r,s]=Ke(t||null),[p,d]=Ke(o||null),[l,m]=Ke([]),[c,f]=Ke([]),[C,w]=Ke([]),[x,g]=Ke({}),[A,T]=Ke({}),[k,P]=Ke([]),[v,u]=Ke({}),[L,S]=Ke(!1),[F,M]=Ke(!1),[O,I]=Ke(!q(e)),V=(Q,he)=>{if(he==="_blank"){window.open(Q,"_blank");return}setTimeout(()=>{window.location.href=Q},50)},W={theme:b(b({},at.theme),(le=(H=i==null?void 0:i.defaultAppearance)==null?void 0:H.theme)!=null?le:{}),styleOverrides:b(b({},at.styleOverrides),(Te=(fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.styleOverrides)!=null?Te:{})};function q(Q){return!!(Q&&Q.length>10&&Q.substring(0,10)==="api_public")}Ro(()=>{t&&s(t)},[t]),Ro(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Fo)&&window.localStorage.getItem(Fo)!==r&&kd()},[r]),Ro(()=>{o&&d(o)},[o]),Ro(()=>{if(q(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let X={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:C,setFlowResponses:w,userProperties:x,setUserProperties:g,openFlowStates:A,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:k,setCompletedFlowsToKeepOpenDuringSession:P,customVariables:v,setCustomVariables:u,isNewGuestUser:L,setIsNewGuestUser:S,hasActiveFullPageFlow:F,setHasActiveFullPageFlow:M,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:V,defaultAppearance:W,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:I,apiUrl:i&&i.apiUrl?i.apiUrl:En,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(O)return Nt.createElement(Y.Provider,{value:X},n);let{overrides:de}=wn(W);return Nt.createElement(Fd,{fallback:Nt.createElement(Nt.Fragment,null,n)},Nt.createElement(Y.Provider,{value:X},Nt.createElement(Td,{theme:Ce(W.theme,Ur,de!=null?de:{},(re=i==null?void 0:i.theme)!=null?re:{})},n,Nt.createElement(Sn,null))))};import gc from"react";import ye,{useEffect as ar,useState as rl}from"react";import Je,{useState as jd}from"react";import $t from"styled-components";import or from"react";import It from"react";import On from"styled-components";var An=On.span`
691
+ `;var gn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=$r([]),[p,d]=$r(!1),[l,m]=$r(e.id);return Lr(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Lr(()=>{l!==e.id&&(m(e.id),s([]))},[e]),Lr(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),dt.createElement(ln,{className:a("selectListContainer",i)},dt.createElement(an,null,dt.createElement(pn,{className:a("selectListTitle",i)},e.title),dt.createElement(dn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,f)=>{let C=r.includes(c.id);return dt.createElement(cn,{key:`select-item-${f}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(w=>w!==c.id));return}r.length<n.maxChoices?s([...r,c.id]):r.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:f===n.options.length-1,className:a("selectListSelectItem",i)},dt.createElement(mn,{className:a("selectListItemImage",i)},c.imageUri&&dt.createElement(un,{src:c.imageUri,alt:`select-icon-${f}`}),dt.createElement(fn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),dt.createElement(pt,{appearance:i,value:C,primaryColor:i.theme.colorPrimary}))}))};import ze,{useEffect as hn,useState as Jo}from"react";var jp=({children:e,id:t,shouldWrap:o=!1})=>ze.createElement(ze.Fragment,null,o?ze.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Xo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:m,setVisible:c,setShowModal:f,onDismiss:C,showPagination:w=!1,customFormElements:x,allowBackNavigation:g,validationHandler:E,onFormDataChange:T,showFooter:P,prefillData:B,updateUrlOnPageChange:k,repeatable:u})=>{var Ce;let b=S(S({},{linkCollection:nn,multiInput:Ki,callToAction:sn,selectList:gn}),i),{primaryCTAClickSideEffects:F,secondaryCTAClickSideEffects:$}=ue(),[N,O]=Jo(!1),[V,W]=Jo({}),[J,R]=Jo(!1),[pe,q]=Jo(null),Y=(Ce=t[o])!=null?Ce:null,{markStepCompleted:de,markStepStarted:we,isLoading:ke,updateCustomVariables:Z,markFlowCompleted:me}=Q();hn(()=>{Z(n)},[n,ke]),hn(()=>{T&&T(V,U(),t[o],o)},[V]);function U(){var z;return{data:(z=V[t[o].id])!=null?z:{},stepId:t[o].id,customVariables:n}}function ee(H,z,M){let _=o+1<t.length?t[o+1]:null;return s&&s(H,M,_,V,U()),r?r(H,o,z,_):!0}function he(H,z){W(M=>{let _={};return _[H.id]=z,S(S({},M),_)})}function Ee(H){return H.selectedStep.imageUri?ze.createElement(Zi,{image:H.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let Ae=P&&ze.createElement(on,{step:t[o],canContinue:N&&!J,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>D(void 0,null,function*(){if(R(!0),E){let M=yield E(t[o],o,t[o+1],V,U());if(M!==!0){q(typeof M=="string"?M:null),R(!1);return}else q(null)}let H=S({},U());yield de(p,t[o].id,H),o+1<t.length&&!g&&(yield we(p,t[o+1].id));let z=ee(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),C&&C(),l&&z&&(c&&c(!1),f(!1)),yield me(p),u&&(yield we(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(_=>{_.startsWith(Nr)&&window.localStorage.removeItem(_)}))),F(t[o]),R(!1),typeof window!="undefined"&&!g&&k&&o+1<t.length){let M=new URL(window.location.href);M.searchParams.set("p",t[o+1].id),window.history.pushState({},"",M.toString())}}),onSecondaryClick:()=>{ee(t[o],"secondary",o),$(t[o])},onBack:()=>D(void 0,null,function*(){o-1>=0&&(R(!0),yield we(p,t[o-1].id),R(!1))}),steps:t,allowBackNavigation:g,errorMessage:pe,isSaving:J});return ze.createElement(ze.Fragment,null,ze.createElement(Xi,{className:a("formContainer",e)},ze.createElement(jp,{id:o,shouldWrap:d==="large-modal"},ze.createElement(Qi,{key:Y.id,type:d,className:a("formContent",e)},t.map(H=>{var M;let z=b[(M=H.type)!=null?M:"multiInput"];return Y.id!==H.id?null:typeof z!="function"?z:ze.createElement(z,{key:H.id,stepData:H,canContinue:N,setCanContinue:O,onSaveData:_=>{he(H,_)},appearance:e,customFormElements:x,flowId:p,prefillData:B})}),w&&ze.createElement(rn,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),Ae)),d=="large-modal"&&ze.createElement(Ee,{selectedStep:t[o]})))};import bo from"react";import{createGlobalStyle as Gp}from"styled-components";var Kp=Gp`
692
+ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,p])=>`${$o(s)}: ${p};`).join(" ")} }`:`${$o(i)}: ${n};`).join(" ")} }`).join(" ")}`;function se({appearance:e}){if(!e||!e.styleOverrides)return bo.createElement(bo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?bo.createElement(bo.Fragment,null):bo.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ge(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:s,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:l,getFlow:m}=Q(),c=p(e);function f(){return D(this,null,function*(){!o&&!r&&s(e)===Ue&&l(m(e))===!1&&t&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{f()},[r,e,t]),{}}var Cn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:C=!1,modalPosition:w="center",repeatable:x=!1,onDismiss:g,showPagination:E=!1,allowBackNavigation:T=!1,validationHandler:P,showFrigadeBranding:B=!1,onFormDataChange:k,showFooter:u=!0,prefillData:L={},updateUrlOnPageChange:b=!1})=>{let{getFlow:F,getFlowSteps:$,isLoading:N,targetingLogicShouldHideFlow:O,getFlowStatus:V,getCurrentStepIndex:W,markFlowCompleted:J,markFlowNotStarted:R,markStepStarted:pe}=Q(),q=W(e),{mergeAppearanceWithDefault:Y}=oe(),[de,we]=Jp(null),{setOpenFlowState:ke,getOpenFlowState:Z,hasOpenModals:me}=Ne();Ge(e,i);let U=$(e);d=Y(d);let[ee,he]=i!==void 0&&n!==void 0?[i,n]:[Z(e,!0),H=>ke(e,H)],Ee=typeof window!="undefined"?window.location.hash:null;if(xn(()=>{var H;if(U&&U.length>0&&T){let z=typeof window!="undefined"&&((H=window==null?void 0:window.location)!=null&&H.hash)?window.location.hash.replace("#",""):"";if(U&&(U==null?void 0:U.length)>0){let M=-1;if(z){let _=z;M=U.findIndex(le=>le.id===_),de===z&&(M=-1)}M!==-1&&(we(z),pe(e,U[M].id))}}},[Ee]),xn(()=>{!N&&U&&U.length&&typeof window!="undefined"&&T&&(we(U[q].id),window.location.hash=U[q].id)},[N,q,U]),N)return null;let Ae=F(e);if(!Ae||O(Ae)||!U||i!==void 0&&i===!1||V(e)===te&&l&&!x||(o=="modal"||o=="corner-modal")&&me(e))return null;let Ce=()=>{he(!1),g&&g(),C===!0&&J(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let H={padding:"24px"};return o==="large-modal"?(H.width="85%",H.height="90%",H.maxHeight="800px",H.minHeight="500px",H.padding="0"):H.width="400px",ot.createElement(Re,{appearance:d,onClose:Ce,visible:ee,style:H,dismissible:f,showFrigadeBranding:B},ot.createElement(se,{appearance:d}),ot.createElement(Xo,{appearance:d,steps:U,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:he,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:T,validationHandler:P,onFormDataChange:k,showFooter:u,prefillData:L,updateUrlOnPageChange:b,repeatable:x}))}return o==="modal"&&w!=="center"?ot.createElement(zo,{appearance:d,onClose:Ce,visible:ee,modalPosition:w},ot.createElement(se,{appearance:d}),ot.createElement(Xo,{appearance:d,steps:U,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:he,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:T,validationHandler:P,onFormDataChange:k,showFooter:u,prefillData:L,updateUrlOnPageChange:b,repeatable:x})):ot.createElement(ot.Fragment,null,ot.createElement(se,{appearance:d}),ot.createElement(Xo,{appearance:d,steps:U,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:he,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:T,validationHandler:P,onFormDataChange:k,showFooter:u,prefillData:L,updateUrlOnPageChange:b,repeatable:x}))},yn=Cn;import{useCallback as Mr,useContext as Xp,useEffect as Qp}from"react";function Dr(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(X),{mutateUserFlowState:i}=We(),{config:n,apiUrl:r}=Ze(),s=Ht(),{verifySDKInitiated:p}=Vt();function d(f,C){return`frigade-user-group-registered-${f}-${C}`}Qp(()=>{if(t&&e){if(t.startsWith(jt))return;let f=d(t,e);localStorage.getItem(f)||(s(`${r}userGroups`,j(S({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let l=Mr(f=>D(this,null,function*(){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 C={foreignUserId:t,foreignUserGroupId:e,properties:f};yield s(`${r}userGroups`,j(S({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),m=Mr((f,C)=>D(this,null,function*(){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 x={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:C}]};yield s(`${r}userGroups`,j(S({},n),{method:"POST",body:JSON.stringify(x)})),i()}),[e,t,n,i]),c=Mr((f,C)=>D(this,null,function*(){if(p())if(C){let w=d(t,f);localStorage.setItem(w,"true"),o(f);let x={foreignUserId:t,foreignUserGroupId:f,properties:C};yield s(`${r}userGroups`,j(S({},n),{method:"POST",body:JSON.stringify(x)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var Sn="frigade-xFrigade_guestUserId",To="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=fo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=We(),{userId:n,setUserId:r}=go(),[s,p]=wo(n),{getFlowStatus:d}=Q(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=Zp(X),[C,w]=wo([]),[x,g]=wo([]),{organizationId:E}=Dr(),[T,P]=wo(E),[B,k]=wo(!1);Qt(()=>{if(!o&&t)for(let F=0;F<t.length;F++){let $=t[F],N=l.find(O=>O.slug===($==null?void 0:$.flowId));if(N&&$&&$.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!x.includes(N.slug)){setTimeout(()=>{u($.flowId)},500);break}}},[o,t]),Qt(()=>{f.length>0&&i()},[f]),Qt(()=>{B||(k(!0),i())},[o,k]);function u(F){let $=l.find(N=>N.slug===F);$&&$.triggerType==="AUTOMATIC"&&!x.includes($.slug)&&(g([...x,$.slug]),w([$]))}function L(){if(!n){let F=localStorage.getItem(To);if(F){r(F);return}let $=localStorage.getItem(Sn);if($){r($);return}c(!0);let N=jt+Rp();try{localStorage.setItem(Sn,N)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||N)}}Qt(()=>{try{if(l){let F=[];l.forEach($=>{if($.data){let N=$.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(O=>{let V=O.replace('"imageUri":"',"").replace('"',"");if(F.includes(V))return;let W=new Image;W.src=V,F.push(V)})}})}}catch(F){}},[l]),Qt(()=>{if(n!==s&&(e([]),i()),p(n),n&&!n.startsWith(jt))try{localStorage.setItem(To,n)}catch(F){console.log("Failed to save user id locally: Local storage available",F)}n===null&&setTimeout(()=>{n===null&&L()},50)},[n,l,m]),Qt(()=>{E!=T&&(P(E),e([]),i())},[E,T,P]);function b(){return Nt.createElement(Nt.Fragment,null,C.map(F=>d(F.slug)!==Ue?null:Nt.createElement("span",{key:F.slug},Nt.createElement(yn,{flowId:F.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Nt.createElement(Nt.Fragment,null,Nt.createElement(b,null))};var wn={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 ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((s,p)=>{r[s]||(r[s]=p===n.length-1?i:{}),r=r[s]})}}),t}function td(e){if(!e)return;let t=ye({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(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},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),Fo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let s=id(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,S(S({as:e},p),i),t);if(o!==void 0){let l=ye(s,o);return Fn.createElement(rd,{theme:l},d())}return d()};var ko={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"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(Fo)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var Qo={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 vn=Cd(Fo)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),Zt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Ur={colors:j(S({},Zt),{neutral:{foreground:Zt.gray300},primary:{background:Zt.blue500,foreground:Zt.white,inverted:Zt.blue500},negative:{foreground:Zt.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:wd,components:{Button:ko,Text:Qo}};var An="https://api.frigade.com",X=Td({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:at,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:An,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var q,Y,de,we,ke;let[r,s]=Ke(t||null),[p,d]=Ke(o||null),[l,m]=Ke([]),[c,f]=Ke([]),[C,w]=Ke([]),[x,g]=Ke({}),[E,T]=Ke({}),[P,B]=Ke([]),[k,u]=Ke({}),[L,b]=Ke(!1),[F,$]=Ke(!1),[N,O]=Ke(!J(e)),V=(Z,me)=>{if(me==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},W={theme:S(S({},at.theme),(Y=(q=i==null?void 0:i.defaultAppearance)==null?void 0:q.theme)!=null?Y:{}),styleOverrides:S(S({},at.styleOverrides),(we=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?we:{})};function J(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}Ro(()=>{t&&s(t)},[t]),Ro(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(To)&&window.localStorage.getItem(To)!==r&&kd()},[r]),Ro(()=>{o&&d(o)},[o]),Ro(()=>{if(J(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let R={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:C,setFlowResponses:w,userProperties:x,setUserProperties:g,openFlowStates:E,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:B,customVariables:k,setCustomVariables:u,isNewGuestUser:L,setIsNewGuestUser:b,hasActiveFullPageFlow:F,setHasActiveFullPageFlow:$,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:V,defaultAppearance:W,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:An,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(N)return Zo.createElement(X.Provider,{value:R},n);let{overrides:pe}=Tn(W);return Zo.createElement(X.Provider,{value:R},Zo.createElement(Fd,{theme:ye(W.theme,Ur,pe!=null?pe:{},(ke=i==null?void 0:i.theme)!=null?ke:{})},n,Zo.createElement(bn,null)))};import gc from"react";import Se,{useEffect as ar,useState as il}from"react";import Xe,{useState as jd}from"react";import Lt from"styled-components";import or from"react";import Ot from"react";import On from"styled-components";var Nn=On.span`
693
693
  font-weight: 600;
694
694
  font-size: 14px;
695
695
  font-style: normal;
@@ -700,7 +700,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
700
700
  vertical-align: middle;
701
701
  margin-left: 32px;
702
702
  padding-right: 12px;
703
- ${e=>ve(e)}
703
+ ${e=>Pe(e)}
704
704
  `,vd=On.div`
705
705
  flex-direction: row;
706
706
  justify-content: space-between;
@@ -709,12 +709,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
709
709
  padding-bottom: 20px;
710
710
  padding-right: 8px;
711
711
  width: 100%;
712
- ${e=>ve(e)}
713
- `,er=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:p})=>It.createElement(It.Fragment,null,It.createElement(vd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:b({},n)},i==="left"&&e&&It.createElement(An,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),It.createElement(pt,{appearance:p,value:t,type:s,primaryColor:r}),i==="right"&&e&&It.createElement(An,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),It.createElement(ne,{appearance:p}));import vo from"styled-components";var Nn=vo.div`
712
+ ${e=>Pe(e)}
713
+ `,er=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:p})=>Ot.createElement(Ot.Fragment,null,Ot.createElement(vd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:S({},n)},i==="left"&&e&&Ot.createElement(Nn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Ot.createElement(pt,{appearance:p,value:t,type:s,primaryColor:r}),i==="right"&&e&&Ot.createElement(Nn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Ot.createElement(se,{appearance:p}));import Po from"styled-components";var In=Po.div`
714
714
  font-weight: 700;
715
715
  font-size: 18px;
716
716
  line-height: 22px;
717
- `,In=vo.p`
717
+ `,Ln=Po.p`
718
718
  font-weight: 600;
719
719
  font-size: 16px;
720
720
  line-height: 24px;
@@ -722,7 +722,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
722
722
  letter-spacing: 0.32px;
723
723
  font-style: normal;
724
724
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
725
- `,Ln=vo.p`
725
+ `,$n=Po.p`
726
726
  font-weight: 400;
727
727
  font-size: 14px;
728
728
  font-style: normal;
@@ -731,26 +731,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
731
731
  letter-spacing: 0.28px;
732
732
  margin: 8px 0px 0px 0px;
733
733
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
734
- `,tr=vo.div`
734
+ `,tr=Po.div`
735
735
  width: 6px;
736
736
  position: absolute;
737
737
  left: 0;
738
738
  height: 100%;
739
739
  border-top-right-radius: 4px;
740
740
  border-bottom-right-radius: 4px;
741
- `,$n=vo.div`
741
+ `,Mn=Po.div`
742
742
  flex-direction: row;
743
743
  justify-content: flex-start;
744
744
  border-bottom: 1px solid ${e=>e.theme.colorBorder};
745
745
  padding-right: 16px;
746
- `;var Mn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var p,d,l,m,c;return or.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&or.createElement(tr,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),or.createElement($n,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},or.createElement(er,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:n,primaryColor:(c=(m=s==null?void 0:s.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:s})))};import Lt from"react";import Wr from"styled-components";import rr from"styled-components";var uC=rr.h1`
746
+ `;var Dn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var p,d,l,m,c;return or.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&or.createElement(tr,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),or.createElement(Mn,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},or.createElement(er,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:n,primaryColor:(c=(m=s==null?void 0:s.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:s})))};import It from"react";import Wr from"styled-components";import rr from"styled-components";var mC=rr.h1`
747
747
  display: flex;
748
748
  margin: 0;
749
749
  font-size: 18px;
750
- `,fC=rr.h2`
750
+ `,uC=rr.h2`
751
751
  font-size: 15px;
752
752
  color: #4d4d4d;
753
- `,Dn=rr.div`
753
+ `,Un=rr.div`
754
754
  position: absolute;
755
755
  left: 0;
756
756
  top: 0;
@@ -759,7 +759,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
759
759
  border-radius: 20px;
760
760
  background-color: ${e=>e.theme.colorPrimary};
761
761
  transition: width 0.5s;
762
- `,Un=rr.div`
762
+ `,Wn=rr.div`
763
763
  position: relative;
764
764
  left: 0;
765
765
  top: 0;
@@ -776,7 +776,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
776
776
  align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
777
777
  width: 100%;
778
778
 
779
- ${e=>ve(e)}
779
+ ${e=>Pe(e)}
780
780
  `,Ed=Wr.div`
781
781
  flex-grow: 1;
782
782
  position: relative;
@@ -787,15 +787,15 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
787
787
  line-height: 18px;
788
788
  padding-right: ${e=>e.padding};
789
789
  margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
790
- ${e=>ve(e)}
791
- `;var _e=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var f;if(t===0)return Lt.createElement(Lt.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(f=s==null?void 0:s.theme)==null?void 0:f.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(m="0px"),Lt.createElement(Bd,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:n},Lt.createElement(Ad,{className:a("progressBarStepText",s),styleOverrides:j(b({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:m,textLocation:i},c),Lt.createElement(Ed,{textLocation:i,className:a("progressBar",s)},Lt.createElement(Dn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:s,className:a("progressBarFill",s)}),Lt.createElement(Un,{className:a("progressBarBackground",s),barHeight:d,appearance:s})))};import Bo from"react";import Nd from"styled-components";import nr from"react";import ir from"react";var eo=({stepData:e,appearance:t})=>ir.createElement(ir.Fragment,null,ir.createElement(In,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ae(e.title)}),ir.createElement(Ln,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ae(e.subtitle)}));import zr from"react";var to=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return zr.createElement(qo,{className:a("ctaContainer",t)},zr.createElement(te,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&zr.createElement(te,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var oo=({stepData:e,appearance:t})=>nr.createElement(nr.Fragment,null,nr.createElement(eo,{stepData:e,appearance:t}),nr.createElement(to,{stepData:e,appearance:t}));import Od from"react";function Wn(e){return Od.createElement(et,{appearance:e.appearance,videoUri:e.videoUri})}var _r="default",Id=Nd.img`
790
+ ${e=>Pe(e)}
791
+ `;var _e=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var f;if(t===0)return It.createElement(It.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(f=s==null?void 0:s.theme)==null?void 0:f.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(m="0px"),It.createElement(Bd,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:n},It.createElement(Ad,{className:a("progressBarStepText",s),styleOverrides:j(S({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:m,textLocation:i},c),It.createElement(Ed,{textLocation:i,className:a("progressBar",s)},It.createElement(Un,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:s,className:a("progressBarFill",s)}),It.createElement(Wn,{className:a("progressBarBackground",s),barHeight:d,appearance:s})))};import vo from"react";import Od from"styled-components";import nr from"react";import ir from"react";var Rt=({stepData:e,appearance:t})=>ir.createElement(ir.Fragment,null,ir.createElement(Ln,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ce(e.title)}),ir.createElement($n,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ce(e.subtitle)}));import zr from"react";var eo=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return zr.createElement(Ko,{className:a("ctaContainer",t)},zr.createElement(re,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&zr.createElement(re,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var to=({stepData:e,appearance:t})=>nr.createElement(nr.Fragment,null,nr.createElement(Rt,{stepData:e,appearance:t}),nr.createElement(eo,{stepData:e,appearance:t}));import Nd from"react";function zn(e){return Nd.createElement(tt,{appearance:e.appearance,videoUri:e.videoUri})}var _r="default",Id=Od.img`
792
792
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
793
793
  width: 100%;
794
794
  height: auto;
795
795
  min-height: 200px;
796
- `,zn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Bo.createElement("div",null,o)}return Bo.createElement(Nn,{className:a("checklistStepContent",t)},e.imageUri?Bo.createElement(Id,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle,appearance:t}):null,e.videoUri?Bo.createElement(Wn,{videoUri:e.videoUri,appearance:t}):null,Bo.createElement(oo,{stepData:e,appearance:t}))};import He,{useRef as Ld,useState as $d}from"react";import ro from"styled-components";var _n=ro.div`
796
+ `,_n=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return vo.createElement("div",null,o)}return vo.createElement(In,{className:a("checklistStepContent",t)},e.imageUri?vo.createElement(Id,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle,appearance:t}):null,e.videoUri?vo.createElement(zn,{videoUri:e.videoUri,appearance:t}):null,vo.createElement(to,{stepData:e,appearance:t}))};import He,{useRef as Ld,useState as $d}from"react";import oo from"styled-components";var Hn=oo.div`
797
797
  display: block;
798
- `,Md=ro.div`
798
+ `,Md=oo.div`
799
799
  display: flex;
800
800
  flex-direction: row;
801
801
  flex-wrap: wrap;
@@ -805,20 +805,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
805
805
  align-content: center;
806
806
  margin-top: 24px;
807
807
  margin-bottom: 24px;
808
- `,Dd=ro.div`
808
+ `,Dd=oo.div`
809
809
  display: flex;
810
810
  align-items: center;
811
811
  justify-content: flex-start;
812
812
  flex-direction: column;
813
813
  margin-right: 16px;
814
- `,Ud=ro.video`
814
+ `,Ud=oo.video`
815
815
  width: 200px;
816
816
  height: 120px;
817
- `,Wd=ro.div`
817
+ `,Wd=oo.div`
818
818
  font-size: 14px;
819
819
  line-height: 20px;
820
820
  text-align: center;
821
- `,zd=ro.div`
821
+ `,zd=oo.div`
822
822
  position: absolute;
823
823
  width: 200px;
824
824
  height: 120px;
@@ -838,7 +838,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
838
838
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
839
839
  border-radius: 50%;
840
840
  }
841
- `,Hn="videoCarousel",Vn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return He.createElement(_n,null,He.createElement(oo,{stepData:e,appearance:t}));function o({video:r}){let s=Ld(),[p,d]=$d(!1);return He.createElement(Dd,null,!p&&He.createElement(zd,{onClick:()=>{d(!0),s.current.play()},appearance:t},He.createElement(Yo,null)),He.createElement(Ud,{controls:p,ref:s,play:p,src:r.uri}),He.createElement(Wd,null,r.title))}let i=e.props;return i.videos?He.createElement(_n,null,He.createElement(eo,{stepData:e,appearance:t}),He.createElement(Md,null,i.videos.map((r,s)=>He.createElement("span",{key:`${r.uri}-${s}`},He.createElement(o,{video:r})))),He.createElement(to,{stepData:e,appearance:t})):null};import ct from"react";import sr from"styled-components";var jn=sr.div`
841
+ `,Vn="videoCarousel",jn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return He.createElement(Hn,null,He.createElement(to,{stepData:e,appearance:t}));function o({video:r}){let s=Ld(),[p,d]=$d(!1);return He.createElement(Dd,null,!p&&He.createElement(zd,{onClick:()=>{d(!0),s.current.play()},appearance:t},He.createElement(qo,null)),He.createElement(Ud,{controls:p,ref:s,play:p,src:r.uri}),He.createElement(Wd,null,r.title))}let i=e.props;return i.videos?He.createElement(Hn,null,He.createElement(Rt,{stepData:e,appearance:t}),He.createElement(Md,null,i.videos.map((r,s)=>He.createElement("span",{key:`${r.uri}-${s}`},He.createElement(o,{video:r})))),He.createElement(eo,{stepData:e,appearance:t})):null};import ct from"react";import sr from"styled-components";var Gn=sr.div`
842
842
  display: block;
843
843
  `,_d=sr.pre`
844
844
  display: block;
@@ -863,22 +863,22 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
863
863
  margin-top: 12px;
864
864
  `,Vd=sr.div`
865
865
  margin-top: 24px;
866
- `,Gn="codeSnippet",Kn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return ct.createElement(jn,null,ct.createElement(oo,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?ct.createElement(jn,{className:a("codeSnippetContainer",t)},ct.createElement(eo,{stepData:e,appearance:t}),ct.createElement(Vd,null,o.codeSnippets.map((n,r)=>ct.createElement("div",{key:r},n.title?ct.createElement(Hd,{dangerouslySetInnerHTML:ae(n.title)}):null,n.code?ct.createElement(_d,null,n.code):null))),ct.createElement(to,{stepData:e,appearance:t})):null};var Gd=$t.div`
866
+ `,Kn="codeSnippet",qn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return ct.createElement(Gn,null,ct.createElement(to,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?ct.createElement(Gn,{className:a("codeSnippetContainer",t)},ct.createElement(Rt,{stepData:e,appearance:t}),ct.createElement(Vd,null,o.codeSnippets.map((n,r)=>ct.createElement("div",{key:r},n.title?ct.createElement(Hd,{dangerouslySetInnerHTML:ce(n.title)}):null,n.code?ct.createElement(_d,null,n.code):null))),ct.createElement(eo,{stepData:e,appearance:t})):null};var Gd=Lt.div`
867
867
  display: flex;
868
868
  flex-direction: row;
869
869
  overflow: hidden;
870
870
  min-width: ${e=>e.type!="modal"?"600px":"100%"};
871
871
  background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
872
872
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
873
- ${e=>ve(e)}
874
- `,Kd=$t.h1`
873
+ ${e=>Pe(e)}
874
+ `,Kd=Lt.h1`
875
875
  font-size: 18px;
876
876
  font-style: normal;
877
877
  font-weight: 700;
878
878
  line-height: 24px;
879
879
  letter-spacing: 0.36px;
880
880
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
881
- `,qd=$t.h2`
881
+ `,qd=Lt.h2`
882
882
  font-size: 14px;
883
883
  font-style: normal;
884
884
  font-weight: 400;
@@ -886,44 +886,44 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
886
886
  letter-spacing: 0.28px;
887
887
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
888
888
  margin: 10px 0px 0px 0px;
889
- `,qn=$t.div``,Yd=$t.div`
889
+ `,Yn=Lt.div``,Yd=Lt.div`
890
890
  list-style: none;
891
891
  padding: 0;
892
892
  margin: 0;
893
893
  cursor: pointer;
894
894
  min-width: 300px;
895
- `,Jd=$t.div`
895
+ `,Jd=Lt.div`
896
896
  width: 1px;
897
897
  margin-right: 40px;
898
898
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
899
- `,Xd=$t.div`
899
+ `,Xd=Lt.div`
900
900
  flex: 2;
901
901
  padding: 40px 40px 40px 0px;
902
- `,Qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=ee();d=m(d);let c={[_r]:zn,[Hn]:Vn,[Gn]:Kn},f=b(b({},c),p),[C,w]=jd(0),x=n!=null?n:C,g=r!=null?r:w,A=o.filter(k=>k.complete===!0).length,T=()=>{var k;return!((k=o[x])!=null&&k.type)||!f[o[x].type]?f[_r]({stepData:o[x],appearance:d}):typeof f[o[x].type]!="function"?f[o[x].type]:f[o[x].type]({stepData:o[x],appearance:d})};return Je.createElement(Gd,{type:l,styleOverrides:i,className:s,appearance:d},Je.createElement(qn,{style:{flex:1}},Je.createElement(qn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Je.createElement(Kd,{className:a("checklistTitle",d),appearance:d},e),Je.createElement(qd,{className:a("checklistSubtitle",d),appearance:d},t),Je.createElement(_e,{total:o.length,count:A,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Je.createElement(Yd,{className:a("checklistStepsContainer",d)},o.map((k,P)=>Je.createElement(Mn,{data:k,index:P,key:P,listLength:o.length,isSelected:P===x,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{g(P)},appearance:d})))),Je.createElement(Jd,{appearance:d,className:a("checklistDivider",d)}),Je.createElement(Xd,null,Je.createElement(T,null)))},Hr=Qd;import G,{useState as oc}from"react";import Yn from"react";import Zd from"styled-components";var Rd=Zd.svg`
902
+ `,Qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=oe();d=m(d);let c={[_r]:_n,[Vn]:jn,[Kn]:qn},f=S(S({},c),p),[C,w]=jd(0),x=n!=null?n:C,g=r!=null?r:w,E=o.filter(P=>P.complete===!0).length,T=()=>{var P;return!((P=o[x])!=null&&P.type)||!f[o[x].type]?f[_r]({stepData:o[x],appearance:d}):typeof f[o[x].type]!="function"?f[o[x].type]:f[o[x].type]({stepData:o[x],appearance:d})};return Xe.createElement(Gd,{type:l,styleOverrides:i,className:s,appearance:d},Xe.createElement(Yn,{style:{flex:1}},Xe.createElement(Yn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Xe.createElement(Kd,{className:a("checklistTitle",d),appearance:d},e),Xe.createElement(qd,{className:a("checklistSubtitle",d),appearance:d},t),Xe.createElement(_e,{total:o.length,count:E,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Xe.createElement(Yd,{className:a("checklistStepsContainer",d)},o.map((P,B)=>Xe.createElement(Dn,{data:P,index:B,key:B,listLength:o.length,isSelected:B===x,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{g(B)},appearance:d})))),Xe.createElement(Jd,{appearance:d,className:a("checklistDivider",d)}),Xe.createElement(Xd,null,Xe.createElement(T,null)))},Hr=Qd;import G,{useState as oc}from"react";import Jn from"react";import Zd from"styled-components";var Rd=Zd.svg`
903
903
  transition: 'transform 0.35s ease-in-out';
904
- `,io=({style:e,className:t})=>Yn.createElement(Rd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Yn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import we from"styled-components";var Vr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Jn=we.div`
904
+ `,ro=({style:e,className:t})=>Jn.createElement(Rd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Jn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import be from"styled-components";var Vr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Xn=be.div`
905
905
  max-height: 350px;
906
906
  padding-bottom: 40px;
907
- `,Xn=we.div`
907
+ `,Qn=be.div`
908
908
  display: flex;
909
909
  flex-direction: column;
910
910
  margin-top: 20px;
911
- `,Qn=we.h1`
911
+ `,Zn=be.h1`
912
912
  font-style: normal;
913
913
  font-weight: 600;
914
914
  font-size: 30px;
915
915
  line-height: 36px;
916
916
  margin-bottom: 16px;
917
917
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
918
- `,Zn=we.h2`
918
+ `,Rn=be.h2`
919
919
  font-weight: 400;
920
920
  font-size: 16px;
921
921
  line-height: 20px;
922
922
  margin-bottom: 16px;
923
923
  padding-left: 1px;
924
924
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
925
- `,Rn=we.div`
926
- ${e=>E(e)} {
925
+ `,es=be.div`
926
+ ${e=>A(e)} {
927
927
  border: 1px solid #fafafa;
928
928
  }
929
929
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
@@ -932,12 +932,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
932
932
  flex-direction: column;
933
933
  min-height: 240px;
934
934
  overflow: hidden;
935
- `,es=we.div`
935
+ `,ts=be.div`
936
936
  display: flex;
937
937
  flex-direction: row;
938
938
  justify-content: space-between;
939
- `,ts=we.p`
940
- ${e=>E(e)} {
939
+ `,os=be.p`
940
+ ${e=>A(e)} {
941
941
  font-weight: 400;
942
942
  font-size: 10px;
943
943
  line-height: 12px;
@@ -945,13 +945,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
945
945
  color: #8c8c8c;
946
946
  margin: 20px;
947
947
  }
948
- `,os=we.div`
948
+ `,rs=be.div`
949
949
  display: flex;
950
950
  flex-direction: row;
951
- `,rs=we.div`
951
+ `,is=be.div`
952
952
  flex: 1;
953
- `,is=we.div`
954
- ${e=>E(e)} {
953
+ `,ns=be.div`
954
+ ${e=>A(e)} {
955
955
  display: flex;
956
956
  justify-content: center;
957
957
  align-content: center;
@@ -960,8 +960,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
960
960
  padding-left: 8px;
961
961
  padding-right: 8px;
962
962
  }
963
- `,ns=we.p`
964
- ${e=>E(e)} {
963
+ `,ss=be.p`
964
+ ${e=>A(e)} {
965
965
  font-style: normal;
966
966
  font-weight: 600;
967
967
  font-size: 22px;
@@ -972,8 +972,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
972
972
  margin-top: 20px;
973
973
  margin-bottom: 16px;
974
974
  }
975
- `,ss=we.p`
976
- ${e=>E(e)} {
975
+ `,ls=be.p`
976
+ ${e=>A(e)} {
977
977
  font-weight: 400;
978
978
  font-size: 14px;
979
979
  line-height: 18px;
@@ -981,15 +981,15 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
981
981
  color: ${e=>e.appearance.theme.colorTextSecondary};
982
982
  margin-bottom: 8px;
983
983
  }
984
- `,ls=we.div`
985
- ${e=>E(e)} {
984
+ `,as=be.div`
985
+ ${e=>A(e)} {
986
986
  display: flex;
987
987
  flex-direction: row;
988
988
  justify-content: center;
989
989
  gap: 8px;
990
990
  }
991
- `,as=we.div`
992
- ${e=>E(e)} {
991
+ `,ps=be.div`
992
+ ${e=>A(e)} {
993
993
  // Anything inside this block will be ignored if the user provides a custom class
994
994
  background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
995
995
  :hover {
@@ -1008,8 +1008,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1008
1008
  justify-content: space-between;
1009
1009
  position: relative;
1010
1010
  cursor: pointer;
1011
- `,ps=we.p`
1012
- ${e=>E(e)} {
1011
+ `,ds=be.p`
1012
+ ${e=>A(e)} {
1013
1013
  // Anything inside this block will be ignored if the user provides a custom class
1014
1014
  color: ${e=>e.selected?"#434343":"#BFBFBF"};
1015
1015
  }
@@ -1017,12 +1017,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1017
1017
  font-size: 14px;
1018
1018
  line-height: 22px;
1019
1019
  margin: 0;
1020
- `,ds=we.div`
1020
+ `,cs=be.div`
1021
1021
  display: flex;
1022
1022
  flex-direction: row;
1023
1023
  justify-content: flex-end;
1024
1024
  align-content: center;
1025
- `,cs=we.div`
1025
+ `,ms=be.div`
1026
1026
  display: flex;
1027
1027
  flex: 1;
1028
1028
  flex-direction: row;
@@ -1030,14 +1030,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1030
1030
  align-content: center;
1031
1031
  align-items: center;
1032
1032
  margin-right: 20px;
1033
- `,ms=we.div`
1033
+ `,us=be.div`
1034
1034
  display: block;
1035
1035
  width: 100%;
1036
- `;import ec from"styled-components";var us=ec.div`
1036
+ `;import ec from"styled-components";var fs=ec.div`
1037
1037
  flex-direction: column;
1038
1038
  justify-content: center;
1039
1039
  display: flex;
1040
- `;import ut from"react";import mt from"styled-components";var fs=mt.div`
1040
+ `;import ut from"react";import mt from"styled-components";var gs=mt.div`
1041
1041
  border: 1px solid #fafafa;
1042
1042
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
1043
1043
  border-radius: 14px;
@@ -1045,14 +1045,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1045
1045
  display: flex;
1046
1046
  flex-direction: column;
1047
1047
  overflow: hidden;
1048
- `,gs=mt.div`
1048
+ `,hs=mt.div`
1049
1049
  display: flex;
1050
1050
  flex-wrap: wrap;
1051
1051
  justify-content: space-between;
1052
1052
  overflow: hidden;
1053
1053
  row-gap: 10px;
1054
- `,hs=mt.div`
1055
- ${e=>E(e)} {
1054
+ `,xs=mt.div`
1055
+ ${e=>A(e)} {
1056
1056
  color: #595959;
1057
1057
  }
1058
1058
  text-transform: uppercase;
@@ -1061,8 +1061,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1061
1061
  line-height: 12px;
1062
1062
  letter-spacing: 0.09em;
1063
1063
  margin-bottom: 12px;
1064
- `,xs=mt.div`
1065
- ${e=>E(e)} {
1064
+ `,Cs=mt.div`
1065
+ ${e=>A(e)} {
1066
1066
  // Anything inside this block will be ignored if the user provides a custom class
1067
1067
  background: #ffffff;
1068
1068
  border: 1px solid #fafafa;
@@ -1074,8 +1074,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1074
1074
 
1075
1075
  max-width: 150px;
1076
1076
  min-width: 200px;
1077
- `,Cs=mt.div`
1078
- ${e=>E(e)} {
1077
+ `,ys=mt.div`
1078
+ ${e=>A(e)} {
1079
1079
  background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
1080
1080
  }
1081
1081
  width: 40px;
@@ -1086,14 +1086,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1086
1086
  justify-content: center;
1087
1087
  align-content: center;
1088
1088
  align-items: center;
1089
- `,ys=mt.div`
1089
+ `,Ss=mt.div`
1090
1090
  font-weight: 600;
1091
1091
  font-size: 20px;
1092
1092
  line-height: 24px;
1093
1093
  width: 20px;
1094
1094
  height: 20px;
1095
- `,Ss=mt.div`
1096
- ${e=>E(e)} {
1095
+ `,bs=mt.div`
1096
+ ${e=>A(e)} {
1097
1097
  color: #434343;
1098
1098
  }
1099
1099
  font-weight: 600;
@@ -1101,20 +1101,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1101
1101
  line-height: 17px;
1102
1102
  margin-top: 12px;
1103
1103
  margin-bottom: 8px;
1104
- `,bs=mt.div`
1105
- ${e=>E(e)} {
1104
+ `,ws=mt.div`
1105
+ ${e=>A(e)} {
1106
1106
  color: #8c8c8c;
1107
1107
  }
1108
1108
  font-weight: 400;
1109
1109
  font-size: 12px;
1110
1110
  line-height: 14px;
1111
- `,ws=mt.a`
1111
+ `,Ts=mt.a`
1112
1112
  color: ${e=>e.color};
1113
1113
  font-size: 12px;
1114
1114
  line-height: 14px;
1115
1115
  font-weight: 400;
1116
1116
  cursor: pointer;
1117
- `;var tc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=pe();return ut.createElement(fs,{style:t,className:a("guideContainer",n)},ut.createElement(hs,{className:a("guideTitle",n)},o),ut.createElement(gs,{className:a("guideItemContainer",n)},e.map((p,d)=>{var l;return ut.createElement(xs,{key:`guide-${(l=p.id)!=null?l:d}`,className:a("guideItem",n)},p.icon&&ut.createElement(Cs,{className:a("guideIcon",n)},ut.createElement(ys,null,p.icon)),ut.createElement(Ss,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:ae(p.title)}),ut.createElement(bs,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:ae(p.subtitle)}),ut.createElement(ws,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle))})))},Eo=tc;var rc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:m,guideTitle:c,onGuideButtonClick:f})=>{let C=({stepData:u,handleSecondaryCTAClick:L,handleCTAClick:S})=>u?G.createElement(is,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},G.createElement(ns,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:ae(u.title)}),G.createElement(ss,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:ae(u.subtitle)}),G.createElement(ls,{className:a("checklistCTAContainer",l)},u.secondaryButtonTitle&&G.createElement(te,{title:u.secondaryButtonTitle,onClick:L,appearance:l,secondary:!0}),G.createElement(te,{title:u.primaryButtonTitle,onClick:S,appearance:l}))):G.createElement(G.Fragment,null),x=b(b({},{default:u=>{var M;if((M=e[T])!=null&&M.StepContent){let O=e[T].StepContent;return G.createElement("div",null,O)}let L=e[T];return G.createElement(C,{stepData:u,handleCTAClick:()=>{L.handlePrimaryButtonClick&&L.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{L.handleSecondaryButtonClick&&L.handleSecondaryButtonClick()}})}}),d),[g,A]=oc(0),T=s!=null?s:g,k=p!=null?p:A,P=()=>{var u;return e?!((u=e[T])!=null&&u.type)||!x[e[T].type]?x.default(e[T]):typeof x[e[T].type]!="function"?x[e[T].type]:x[e[T].type]({stepData:e[T],primaryColor:l.theme.colorPrimary}):G.createElement(G.Fragment,null)},v=e.filter(u=>u.complete).length;return n?(l.theme.modalContainer||(l.theme.borderRadius&&(Vr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Vr),G.createElement(Ze,{onClose:r,visible:n,appearance:l},G.createElement(ms,null,G.createElement(Xn,null,G.createElement(Qn,{appearance:l,className:a("checklistTitle",l)},t),G.createElement(Zn,{appearance:l,className:a("checklistSubtitle",l)},o)),G.createElement(Jn,null,e&&e.length>0&&G.createElement(Rn,{className:a("stepsContainer",l)},G.createElement(es,null,G.createElement("div",{style:{flex:3}},G.createElement(ts,{className:a("stepsTitle",l)},i)),G.createElement(cs,null,G.createElement(_e,{style:{width:"100%"},count:v,total:e.length,appearance:l}))),G.createElement(os,null,G.createElement(rs,{className:a("checklistStepListContainer",l),appearance:l},e.map((u,L)=>{var F;let S=T===L;return G.createElement(as,{selected:S,className:a(`checklistStepListItem${S?"Selected":""}`,l),key:`checklist-guide-step-${(F=u.id)!=null?F:L}`,disabled:u.blocked,onClick:()=>{u.blocked||k(L)},title:u.blocked?"Finish remaining steps to continue":void 0},S&&G.createElement(tr,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),G.createElement(ps,{selected:S,className:a(`checklistStepListStepName${S?"Selected":""}`,l)},u.stepName),G.createElement(ds,null,G.createElement(pt,{value:u.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:u.progress,appearance:l}),G.createElement(us,null,G.createElement(io,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),G.createElement(P,null))),m&&m.length>0&&G.createElement(Eo,{steps:m,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:u=>(f&&f(u),!0)}))))):G.createElement(G.Fragment,null)},jr=rc;import Me,{useEffect as lr,useState as ic}from"react";import ke from"react";import ft from"styled-components";var Ts=ft.div`
1117
+ `;var tc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=ue();return ut.createElement(gs,{style:t,className:a("guideContainer",n)},ut.createElement(xs,{className:a("guideTitle",n)},o),ut.createElement(hs,{className:a("guideItemContainer",n)},e.map((p,d)=>{var l;return ut.createElement(Cs,{key:`guide-${(l=p.id)!=null?l:d}`,className:a("guideItem",n)},p.icon&&ut.createElement(ys,{className:a("guideIcon",n)},ut.createElement(Ss,null,p.icon)),ut.createElement(bs,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:ce(p.title)}),ut.createElement(ws,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:ce(p.subtitle)}),ut.createElement(Ts,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle))})))},Bo=tc;var rc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:m,guideTitle:c,onGuideButtonClick:f})=>{let C=({stepData:u,handleSecondaryCTAClick:L,handleCTAClick:b})=>u?G.createElement(ns,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},G.createElement(ss,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:ce(u.title)}),G.createElement(ls,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:ce(u.subtitle)}),G.createElement(as,{className:a("checklistCTAContainer",l)},u.secondaryButtonTitle&&G.createElement(re,{title:u.secondaryButtonTitle,onClick:L,appearance:l,secondary:!0}),G.createElement(re,{title:u.primaryButtonTitle,onClick:b,appearance:l}))):G.createElement(G.Fragment,null),x=S(S({},{default:u=>{var $;if(($=e[T])!=null&&$.StepContent){let N=e[T].StepContent;return G.createElement("div",null,N)}let L=e[T];return G.createElement(C,{stepData:u,handleCTAClick:()=>{L.handlePrimaryButtonClick&&L.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{L.handleSecondaryButtonClick&&L.handleSecondaryButtonClick()}})}}),d),[g,E]=oc(0),T=s!=null?s:g,P=p!=null?p:E,B=()=>{var u;return e?!((u=e[T])!=null&&u.type)||!x[e[T].type]?x.default(e[T]):typeof x[e[T].type]!="function"?x[e[T].type]:x[e[T].type]({stepData:e[T],primaryColor:l.theme.colorPrimary}):G.createElement(G.Fragment,null)},k=e.filter(u=>u.complete).length;return n?(l.theme.modalContainer||(l.theme.borderRadius&&(Vr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Vr),G.createElement(Re,{onClose:r,visible:n,appearance:l},G.createElement(us,null,G.createElement(Qn,null,G.createElement(Zn,{appearance:l,className:a("checklistTitle",l)},t),G.createElement(Rn,{appearance:l,className:a("checklistSubtitle",l)},o)),G.createElement(Xn,null,e&&e.length>0&&G.createElement(es,{className:a("stepsContainer",l)},G.createElement(ts,null,G.createElement("div",{style:{flex:3}},G.createElement(os,{className:a("stepsTitle",l)},i)),G.createElement(ms,null,G.createElement(_e,{style:{width:"100%"},count:k,total:e.length,appearance:l}))),G.createElement(rs,null,G.createElement(is,{className:a("checklistStepListContainer",l),appearance:l},e.map((u,L)=>{var F;let b=T===L;return G.createElement(ps,{selected:b,className:a(`checklistStepListItem${b?"Selected":""}`,l),key:`checklist-guide-step-${(F=u.id)!=null?F:L}`,disabled:u.blocked,onClick:()=>{u.blocked||P(L)},title:u.blocked?"Finish remaining steps to continue":void 0},b&&G.createElement(tr,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),G.createElement(ds,{selected:b,className:a(`checklistStepListStepName${b?"Selected":""}`,l)},u.stepName),G.createElement(cs,null,G.createElement(pt,{value:u.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:u.progress,appearance:l}),G.createElement(fs,null,G.createElement(ro,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),G.createElement(B,null))),m&&m.length>0&&G.createElement(Bo,{steps:m,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:u=>(f&&f(u),!0)}))))):G.createElement(G.Fragment,null)},jr=rc;import Me,{useEffect as lr,useState as ic}from"react";import Fe from"react";import ft from"styled-components";var Fs=ft.div`
1118
1118
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1119
1119
  border: 1px solid;
1120
1120
  border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -1126,19 +1126,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1126
1126
  display: flex;
1127
1127
  flex-direction: column;
1128
1128
  transition: max-height 0.25s;
1129
- `,Fs=ft.div`
1129
+ `,ks=ft.div`
1130
1130
  display: flex;
1131
1131
  margin-bottom: 20px;
1132
- `,ks=ft.img`
1132
+ `,Ps=ft.img`
1133
1133
  border-radius: 4px;
1134
1134
  max-height: 260px;
1135
1135
  min-height: 200px;
1136
- `,Ps=ft.div`
1136
+ `,vs=ft.div`
1137
1137
  display: flex;
1138
1138
  flex-direction: row;
1139
1139
  justify-content: space-between;
1140
1140
  align-items: center;
1141
- `,vs=ft.p`
1141
+ `,Bs=ft.p`
1142
1142
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1143
1143
  font-style: normal;
1144
1144
  font-weight: 500;
@@ -1149,23 +1149,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1149
1149
  :hover {
1150
1150
  opacity: 0.8;
1151
1151
  }
1152
- `,Bs=ft.div`
1152
+ `,Es=ft.div`
1153
1153
  cursor: pointer;
1154
1154
  color: ${e=>e.appearance.theme.colorTextSecondary};
1155
1155
  :hover {
1156
1156
  opacity: 0.8;
1157
1157
  }
1158
- `,m0=ft.div``,Es=ft.p`
1158
+ `,c0=ft.div``,As=ft.p`
1159
1159
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1160
1160
  font-weight: 400;
1161
1161
  font-size: 14px;
1162
1162
  line-height: 22px;
1163
- `,As=ft.div`
1163
+ `,Ns=ft.div`
1164
1164
  display: flex;
1165
1165
  flex-direction: row;
1166
1166
  justify-content: flex-start;
1167
1167
  align-items: center;
1168
- `;var Os=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,f;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function l(){var C;return ke.createElement(ke.Fragment,null,e.imageUri||e.videoUri?ke.createElement(Fs,{className:a("stepMediaContainer",r)},e.imageUri?ke.createElement(ks,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ke.createElement(et,{appearance:r,videoUri:e.videoUri}):null):null,ke.createElement(Es,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ae(e.subtitle)}),ke.createElement(qo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?ke.createElement(te,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,ke.createElement(te,{title:(C=e.primaryButtonTitle)!=null?C:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!s)return null;let C=s[e.type];return C?typeof C!="function"?C:C(e,r):null}return ke.createElement(Ts,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},ke.createElement(Ps,{className:a("stepHeader",r)},ke.createElement(As,null,ke.createElement(er,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),ke.createElement(vs,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:ae(e.title),onClick:()=>o()})),ke.createElement(Bs,{className:a("stepChevronContainer",r),onClick:()=>o(),appearance:r},ke.createElement(io,{style:j(b({},p),{transition:"transform 0.2s ease-in-out"})}))),ke.createElement("div",{key:e.id,style:b({},d)},(f=m())!=null?f:l()))};import no from"styled-components";var P0=no.div`
1168
+ `;var Os=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,f;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function l(){var C;return Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(ks,{className:a("stepMediaContainer",r)},e.imageUri?Fe.createElement(Ps,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Fe.createElement(tt,{appearance:r,videoUri:e.videoUri}):null):null,Fe.createElement(As,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ce(e.subtitle)}),Fe.createElement(Ko,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?Fe.createElement(re,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Fe.createElement(re,{title:(C=e.primaryButtonTitle)!=null?C:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!s)return null;let C=s[e.type];return C?typeof C!="function"?C:C(e,r):null}return Fe.createElement(Fs,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},Fe.createElement(vs,{className:a("stepHeader",r)},Fe.createElement(Ns,null,Fe.createElement(er,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),Fe.createElement(Bs,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:ce(e.title),onClick:()=>o()})),Fe.createElement(Es,{className:a("stepChevronContainer",r),onClick:()=>o(),appearance:r},Fe.createElement(ro,{style:j(S({},p),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:S({},d)},(f=m())!=null?f:l()))};import io from"styled-components";var k0=io.div`
1169
1169
  background: #ffffff;
1170
1170
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
1171
1171
  border-radius: 6px;
@@ -1179,26 +1179,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1179
1179
 
1180
1180
  max-width: 800px;
1181
1181
  min-width: 350px;
1182
- `,Ns=no.div`
1182
+ `,Is=io.div`
1183
1183
  display: flex;
1184
1184
  flex-direction: column;
1185
- `,Is=no.h1`
1185
+ `,Ls=io.h1`
1186
1186
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1187
1187
  font-style: normal;
1188
1188
  font-weight: 700;
1189
1189
  font-size: 20px;
1190
1190
  line-height: 24px;
1191
1191
  margin-bottom: 8px;
1192
- `,Ls=no.h2`
1192
+ `,$s=io.h2`
1193
1193
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
1194
1194
  font-weight: 400;
1195
1195
  font-size: 14px;
1196
1196
  line-height: 23px;
1197
1197
  margin: 2px 0 0 0;
1198
- `,$s=no.div`
1198
+ `,Ms=io.div`
1199
1199
  display: block;
1200
1200
  width: 100%;
1201
- `,Ms=no.div`
1201
+ `,Ds=io.div`
1202
1202
  display: flex;
1203
1203
  width: 100%;
1204
1204
  flex-direction: column;
@@ -1206,23 +1206,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1206
1206
  padding: 24px;
1207
1207
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
1208
1208
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1209
- `;var nc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:f,customStepTypes:C,style:w})=>{let x=o.filter(v=>v.complete).length,[g,A]=ic(Array(o.length).fill(!0));lr(()=>{let v=[...g];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){v[u]=!1;break}A(v)}},[]),lr(()=>{r&&T(d)},[d]),lr(()=>{p&&g[d]&&T(d)},[d]),lr(()=>{},[o]);let T=v=>{let u=[...g];if(s)for(let L=0;L<g.length;++L)L!=v&&u[v]&&(u[L]=!0);u[v]=!g[v],A(u)};if(!n&&c=="modal")return Me.createElement(Me.Fragment,null);let k=Me.createElement(Me.Fragment,null,Me.createElement(Ns,null,Me.createElement(Is,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:ae(e)}),Me.createElement(Ls,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:ae(t)})),Me.createElement(_e,{display:"percent",count:x,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),P=Me.createElement($s,{className:Fe(a("checklistContainer",m),f)},o.map((v,u)=>{var S;let L=g[u];return Me.createElement(Os,{appearance:m,stepData:v,collapsed:L,key:`modal-checklist-${(S=v.id)!=null?S:u}`,onClick:()=>{d==u?T(u):l(u)},onPrimaryButtonClick:()=>{p&&u<o.length-1&&l(u+1),v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick()},customStepTypes:C})}));return c==="inline"?Me.createElement(Ms,{appearance:m,className:Fe(a("checklistInlineContainer",m),f),style:w},k,P):Me.createElement(Me.Fragment,null,Me.createElement(Ze,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:k},P))},Gr=nc;import ue,{useEffect as Kr,useRef as uc,useState as Mt}from"react";import{useEffect as sc,useState as lc}from"react";var Ds=()=>{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]=lc(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let m=window.matchMedia(l);return m.addEventListener("change",r),[d,m.matches]}));i(p)};return sc(()=>{s()},[]),o};import so from"react";import ge,{css as Us,keyframes as Ws}from"styled-components";var zs=Us`
1209
+ `;var nc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:f,customStepTypes:C,style:w})=>{let x=o.filter(k=>k.complete).length,[g,E]=ic(Array(o.length).fill(!0));lr(()=>{let k=[...g];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){k[u]=!1;break}E(k)}},[]),lr(()=>{r&&T(d)},[d]),lr(()=>{p&&g[d]&&T(d)},[d]),lr(()=>{},[o]);let T=k=>{let u=[...g];if(s)for(let L=0;L<g.length;++L)L!=k&&u[k]&&(u[L]=!0);u[k]=!g[k],E(u)};if(!n&&c=="modal")return Me.createElement(Me.Fragment,null);let P=Me.createElement(Me.Fragment,null,Me.createElement(Is,null,Me.createElement(Ls,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:ce(e)}),Me.createElement($s,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:ce(t)})),Me.createElement(_e,{display:"percent",count:x,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),B=Me.createElement(Ms,{className:Te(a("checklistContainer",m),f)},o.map((k,u)=>{var b;let L=g[u];return Me.createElement(Os,{appearance:m,stepData:k,collapsed:L,key:`modal-checklist-${(b=k.id)!=null?b:u}`,onClick:()=>{d==u?T(u):l(u)},onPrimaryButtonClick:()=>{p&&u<o.length-1&&l(u+1),k.handlePrimaryButtonClick&&k.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{k.handleSecondaryButtonClick&&k.handleSecondaryButtonClick()},customStepTypes:C})}));return c==="inline"?Me.createElement(Ds,{appearance:m,className:Te(a("checklistInlineContainer",m),f),style:w},P,B):Me.createElement(Me.Fragment,null,Me.createElement(Re,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:P},B))},Gr=nc;import ge,{useEffect as Kr,useRef as uc,useState as $t}from"react";import{useEffect as sc,useState as lc}from"react";var Us=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=lc(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let m=window.matchMedia(l);return m.addEventListener("change",r),[d,m.matches]}));i(p)};return sc(()=>{s()},[]),o};import no from"react";import xe,{css as Ws,keyframes as zs}from"styled-components";var _s=Ws`
1210
1210
  border: 1px solid ${({theme:e})=>e.colorBorder};
1211
- `,ac=Us`
1211
+ `,ac=Ws`
1212
1212
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
1213
- `,pc=Ws`
1213
+ `,pc=zs`
1214
1214
  from {
1215
1215
  opacity: 0;
1216
1216
  } to {
1217
1217
  opacity: 1;
1218
1218
  }
1219
- `,dc=Ws`
1219
+ `,dc=zs`
1220
1220
  from {
1221
1221
  opacity: 1;
1222
1222
  } to {
1223
1223
  opacity: 0;
1224
1224
  }
1225
- `,_s=ge.div`
1225
+ `,Hs=xe.div`
1226
1226
  margin: 0 -20px;
1227
1227
  overflow-x: auto;
1228
1228
  padding-left: 20px;
@@ -1239,13 +1239,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1239
1239
  ::-webkit-scrollbar {
1240
1240
  display: none;
1241
1241
  }
1242
- `,Hs=ge.div`
1242
+ `,Vs=xe.div`
1243
1243
  display: flex;
1244
1244
  flex-flow: row nowrap;
1245
1245
  gap: 0 16px;
1246
1246
  scroll-snap-align: center;
1247
1247
  scroll-snap-stop: always;
1248
- `,Vs=ge.div`
1248
+ `,js=xe.div`
1249
1249
  animation: ${e=>e.reversed?dc:pc} 0.25s ease-out;
1250
1250
  background: linear-gradient(
1251
1251
  to right,
@@ -1255,8 +1255,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1255
1255
  position: absolute;
1256
1256
  width: 64px;
1257
1257
  z-index: 10;
1258
- `,js=ge.button`
1259
- ${zs}
1258
+ `,Gs=xe.button`
1259
+ ${_s}
1260
1260
  box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
1261
1261
  align-items: center;
1262
1262
  border-radius: 50%;
@@ -1267,11 +1267,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1267
1267
  justify-content: center;
1268
1268
  position: absolute;
1269
1269
  width: 48px;
1270
- `,Gs=ge.div`
1270
+ `,Ks=xe.div`
1271
1271
  border-radius: ${({theme:e})=>e.borderRadius}px;
1272
1272
  padding: 20px;
1273
- `,Ks=ge(Gs)`
1274
- ${zs}
1273
+ `,qs=xe(Ks)`
1274
+ ${_s}
1275
1275
  background: ${({theme:e})=>e.colorBackground};
1276
1276
  position: relative;
1277
1277
 
@@ -1283,104 +1283,104 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1283
1283
  ${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
1284
1284
  ${e=>e.blocked?"cursor: default":"cursor: pointer"}
1285
1285
  }
1286
- `,qs=ge.img`
1286
+ `,Ys=xe.img`
1287
1287
  border-radius: 50%;
1288
1288
  height: 40px;
1289
1289
  margin-bottom: 12px;
1290
1290
  width: 40px;
1291
- `,Ys=ge(Gs)`
1292
- ${e=>E(e)} {
1291
+ `,Js=xe(Ks)`
1292
+ ${e=>A(e)} {
1293
1293
  ${ac}
1294
1294
 
1295
1295
  background: ${({theme:e})=>e.colorBackground};
1296
1296
  }
1297
- `,V0=ge.div`
1297
+ `,H0=xe.div`
1298
1298
  color: ${({theme:e})=>e.colorPrimary};
1299
1299
  display: flex;
1300
1300
  flex-flow: row nowrap;
1301
1301
  align-items: center;
1302
- `,j0=ge.div`
1302
+ `,V0=xe.div`
1303
1303
  white-space: nowrap;
1304
- `,Js=ge.div`
1304
+ `,Xs=xe.div`
1305
1305
  background: #d8fed8;
1306
1306
  border-radius: 6px;
1307
1307
  float: right;
1308
1308
  margin-bottom: 12px;
1309
1309
  padding: 4px 10px;
1310
- `,cc=ge.p`
1310
+ `,cc=xe.p`
1311
1311
  font-weight: bold;
1312
1312
  font-size: 18px;
1313
1313
  line-height: 22px;
1314
1314
  letter-spacing: calc(18px * -0.01);
1315
1315
  margin: 0;
1316
- `,Xs=ge(cc)`
1316
+ `,Qs=xe(cc)`
1317
1317
  margin-bottom: 4px;
1318
- `,Qs=ge.div`
1318
+ `,Zs=xe.div`
1319
1319
  display: flex;
1320
1320
  flex-flow: row nowrap;
1321
1321
  align-items: center;
1322
1322
  min-width: 50%;
1323
- `,mc=ge.p`
1323
+ `,mc=xe.p`
1324
1324
  font-weight: bold;
1325
1325
  font-size: 16px;
1326
1326
  line-height: 20px;
1327
1327
  letter-spacing: calc(16px * -0.01);
1328
1328
  margin: 0;
1329
- `,Zs=ge(mc)`
1329
+ `,Rs=xe(mc)`
1330
1330
  margin-bottom: 4px;
1331
1331
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1332
1332
  `}
1333
- `,Tt=ge.p`
1333
+ `,Tt=xe.p`
1334
1334
  color: ${({theme:e})=>e.colorText};
1335
1335
  font-weight: normal;
1336
1336
  font-size: 14px;
1337
1337
  line-height: 22px;
1338
1338
  margin: 0;
1339
- `,Rs=ge.p`
1339
+ `,el=xe.p`
1340
1340
  color: ${({theme:e})=>e.colorText};
1341
1341
  font-weight: 600;
1342
1342
  font-size: 12px;
1343
1343
  line-height: 16px;
1344
1344
  margin: 0;
1345
- `;Tt.Loud=ge(Tt)`
1345
+ `;Tt.Loud=xe(Tt)`
1346
1346
  font-weight: 600;
1347
- `;Tt.Quiet=ge(Tt)`
1347
+ `;Tt.Quiet=xe(Tt)`
1348
1348
  color: ${({theme:e})=>e.colorTextSecondary};
1349
1349
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1350
1350
  `}
1351
- `;var el=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ee(),{primaryCTAClickSideEffects:n}=pe();o=i(o);let{imageUri:r=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return so.createElement(Ks,{className:a("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&so.createElement(qs,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||l?.4:1}}),d&&so.createElement(Js,{className:a("carouselCompletedPill",o)},so.createElement(Rs,{style:{color:"#108E0B"}},"Complete")),p&&so.createElement(Zs,{blocked:l,complete:d,className:a("carouselCardTitle",o)},p),s&&so.createElement(Tt.Quiet,{blocked:l,complete:d,className:a("carouselCardSubtitle",o)},s))};var fc=()=>ue.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ue.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ue.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ue.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),tl=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=Mt(!1),[r,s]=Mt(!1);Kr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ue.createElement(Vs,{style:d,reversed:r,onAnimationEnd:r?p:null},ue.createElement(js,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ue.createElement(fc,null))):null},ol=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=uc(null),[r,s]=Mt(!1),[p,d]=Mt(!1),[l,m]=Mt(null),[c,f]=Mt([]),[C,w]=Mt(0),{isSmall:x}=Ds(),g=x?1:3,{getFlowMetadata:A,getFlowSteps:T,getNumberOfStepsCompleted:k,updateCustomVariables:P,isLoading:v}=J();Kr(()=>{P(o)},[o,v]),Kr(()=>{if(v)return;let O=A(e),I=k(e),V=T(e);m(O),(O.data!==null||O.steps!==null)&&(f(V.sort((W,q)=>Number(W.complete)-Number(q.complete))),d(V.length>g),w(I))},[v]);let u=[];for(let O=0;O<c.length;O+=g)u.push(c.slice(O,O+g));let L=O=>{let I=O.target,V=I.scrollWidth-I.clientWidth,W=Math.ceil(I.scrollLeft);W>0&&r===!1&&s(!0),W===0&&r===!0&&s(!1),W<V&&p===!1&&d(!0),W===V&&p===!0&&d(!1)},S=(O=!0)=>{let I=O?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*I,behavior:"smooth"})},F=null,M=O=>{F!==null?clearTimeout(F):L(O),F=setTimeout(()=>{L(O)},16)};return v?null:ue.createElement(Ys,{className:Fe(a("carouselContainer",t),i)},ue.createElement("div",{style:{display:"flex",justifyContent:x?"center":"space-between",marginBottom:20,flexWrap:x?"wrap":"nowrap",gap:x?16:20}},ue.createElement("div",null,ue.createElement(Xs,{className:a("carouselTitle",t)},l==null?void 0:l.title),ue.createElement(Tt.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ue.createElement(Qs,{className:a("progressWrapper",t)},ue.createElement(_e,{count:C,total:c.length,appearance:t}))),ue.createElement("div",{style:{position:"relative"}},ue.createElement(tl,{show:r,onClick:()=>S(!1)}),ue.createElement(tl,{side:"right",show:p,onClick:S}),ue.createElement(_s,{ref:n,onScroll:M},u.map((O,I)=>ue.createElement(Hs,{key:I,style:{flex:`0 0 calc(100% - ${c.length>g?36:0}px)`}},O.map((V,W)=>ue.createElement(el,{key:W,stepData:V,style:{flex:c.length>g?`0 1 calc(100% / ${g} - 16px * 2 / ${g})`:1},appearance:t})))))),ue.createElement(ne,{appearance:t}))};var qr=P=>{var v=P,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:m,onButtonClick:c,appearance:f,hideOnFlowCompletion:C,setVisible:w,customStepTypes:x,checklistStyle:g="default",autoExpandFirstIncompleteStep:A,autoExpandNextStep:T}=v,k=Le(v,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:u,getFlowSteps:L,markStepCompleted:S,getStepStatus:F,getNumberOfStepsCompleted:M,isLoading:O,targetingLogicShouldHideFlow:I,updateCustomVariables:V,getFlowMetadata:W,isStepBlocked:q,getFlowStatus:X,hasActiveFullPageFlow:de,setHasActiveFullPageFlow:H,markStepStarted:le,getCurrentStepIndex:fe}=J(),{primaryCTAClickSideEffects:Te,secondaryCTAClickSideEffects:re}=pe(),{getOpenFlowState:Q,setOpenFlowState:he}=Oe(),[D,Se]=rl(n||0),[xe,Pe]=rl(!1),Ae=d===void 0?Q(e):d,be=s==="modal",{mergeAppearanceWithDefault:_}=ee();Ge(e,d);let $=L(e),z=fe(e);if(f=_(f),ar(()=>{V(l)},[l,O]),ar(()=>{d!==void 0&&(be&&d===!0?H(!0):be&&d===!1&&H(!1))},[d,w,de]),ar(()=>{!O&&$&&$[D]&&F(e,$[D].id)&&F(e,$[D].id)!==$e&&le(e,$[D].id)},[D]),ar(()=>{D!==z&&Se(z)},[z]),O)return null;let Z=u(e);if(!Z||I(Z)||!$||C===!0&&X(e)===R)return null;let ce=W(e);if(ce!=null&&ce.title&&(t=ce.title),ce!=null&&ce.subtitle&&(o=ce.subtitle),!xe&&n===void 0&&M(e)>0){let N=$.findIndex(ie=>ie.complete===!1);Se(N>-1?N:$.length-1),Pe(!0)}function it(){if(D+1>=$.length){be&&he(e,!1);return}q(e,$[D+1].id)||Se(D+1)}function nt(N,ie,je){let De=D+1<$.length?$[D+1]:null;c&&c(N,D,ie,De)===!0&&be&&Xe(),m&&m(N,je,De),!m&&!c&&(N.primaryButtonUri||N.secondaryButtonUri)&&be&&Xe()}function zt(){return $.map((N,ie)=>j(b({},N),{handleSecondaryButtonClick:()=>{it(),re(N),N.skippable===!0&&S(e,N.id,{skipped:!0}),nt(N,"secondary",ie)},handlePrimaryButtonClick:()=>{(!N.completionCriteria&&(N.autoMarkCompleted||N.autoMarkCompleted===void 0)||N.completionCriteria&&N.autoMarkCompleted===!0)&&(S(e,N.id),it()),nt(N,"primary",ie),Te(N),F(e,N.id)===$e&&it()}}))}function qe(){return ye.createElement(ne,{appearance:f})}let ht={steps:zt(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:x,type:s,className:r,autoExpandFirstIncompleteStep:A,autoExpandNextStep:T};function Xe(){he(e,!1),p&&p(),w&&w(!1)}function _t(){return ye.createElement(ye.Fragment,null,ye.createElement(qe,null),ye.createElement(ol,{flowId:e,appearance:f,customVariables:l,className:r}))}function h(){return ye.createElement(ye.Fragment,null,ye.createElement(qe,null),ye.createElement(Gr,b({visible:Ae,onClose:()=>{Xe()},selectedStep:D,setSelectedStep:Se,autoExpandNextStep:!0,appearance:f},ht)))}function y(){var je;let N=k.guideFlowId,ie;return N&&u(N)&&(ie=L(N)),ye.createElement(ye.Fragment,null,ye.createElement(qe,null),ye.createElement(jr,b({visible:Ae,stepsTitle:ce.stepsTitle?ce.stepsTitle:"Your quick start guide",onClose:()=>{Xe()},selectedStep:D,setSelectedStep:Se,guideData:ie,guideTitle:(je=k.guideTitle)!=null?je:"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:De=>{nt(De,"link",0)},customStepTypes:x},ht)))}function B(){let N=ye.createElement(Hr,b({flowId:e,style:i,selectedStep:D,setSelectedStep:Se,appearance:f,type:s},ht));return be?ye.createElement(Ze,{onClose:()=>{Xe()},visible:Ae,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ye.createElement(qe,null),N):ye.createElement(ye.Fragment,null,ye.createElement(qe,null),N)}switch(g){case"condensed":return h();case"with-guide":return y();case"default":return B();case"carousel":return _t();default:return B()}};var hc=e=>gc.createElement(qr,b({type:"inline"},e));import kt,{useEffect as xc}from"react";import ot from"react";import pr from"styled-components";var il=pr.div`
1351
+ `;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=oe(),{primaryCTAClickSideEffects:n}=ue();o=i(o);let{imageUri:r=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return no.createElement(qs,{className:a("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&no.createElement(Ys,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||l?.4:1}}),d&&no.createElement(Xs,{className:a("carouselCompletedPill",o)},no.createElement(el,{style:{color:"#108E0B"}},"Complete")),p&&no.createElement(Rs,{blocked:l,complete:d,className:a("carouselCardTitle",o)},p),s&&no.createElement(Tt.Quiet,{blocked:l,complete:d,className:a("carouselCardSubtitle",o)},s))};var fc=()=>ge.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ge.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ge.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ge.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),ol=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=$t(!1),[r,s]=$t(!1);Kr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ge.createElement(js,{style:d,reversed:r,onAnimationEnd:r?p:null},ge.createElement(Gs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ge.createElement(fc,null))):null},rl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=uc(null),[r,s]=$t(!1),[p,d]=$t(!1),[l,m]=$t(null),[c,f]=$t([]),[C,w]=$t(0),{isSmall:x}=Us(),g=x?1:3,{getFlowMetadata:E,getFlowSteps:T,getNumberOfStepsCompleted:P,updateCustomVariables:B,isLoading:k}=Q();Kr(()=>{B(o)},[o,k]),Kr(()=>{if(k)return;let N=E(e),O=P(e),V=T(e);m(N),(N.data!==null||N.steps!==null)&&(f(V.sort((W,J)=>Number(W.complete)-Number(J.complete))),d(V.length>g),w(O))},[k]);let u=[];for(let N=0;N<c.length;N+=g)u.push(c.slice(N,N+g));let L=N=>{let O=N.target,V=O.scrollWidth-O.clientWidth,W=Math.ceil(O.scrollLeft);W>0&&r===!1&&s(!0),W===0&&r===!0&&s(!1),W<V&&p===!1&&d(!0),W===V&&p===!0&&d(!1)},b=(N=!0)=>{let O=N?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*O,behavior:"smooth"})},F=null,$=N=>{F!==null?clearTimeout(F):L(N),F=setTimeout(()=>{L(N)},16)};return k?null:ge.createElement(Js,{className:Te(a("carouselContainer",t),i)},ge.createElement("div",{style:{display:"flex",justifyContent:x?"center":"space-between",marginBottom:20,flexWrap:x?"wrap":"nowrap",gap:x?16:20}},ge.createElement("div",null,ge.createElement(Qs,{className:a("carouselTitle",t)},l==null?void 0:l.title),ge.createElement(Tt.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ge.createElement(Zs,{className:a("progressWrapper",t)},ge.createElement(_e,{count:C,total:c.length,appearance:t}))),ge.createElement("div",{style:{position:"relative"}},ge.createElement(ol,{show:r,onClick:()=>b(!1)}),ge.createElement(ol,{side:"right",show:p,onClick:b}),ge.createElement(Hs,{ref:n,onScroll:$},u.map((N,O)=>ge.createElement(Vs,{key:O,style:{flex:`0 0 calc(100% - ${c.length>g?36:0}px)`}},N.map((V,W)=>ge.createElement(tl,{key:W,stepData:V,style:{flex:c.length>g?`0 1 calc(100% / ${g} - 16px * 2 / ${g})`:1},appearance:t})))))),ge.createElement(se,{appearance:t}))};var qr=B=>{var k=B,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:m,onButtonClick:c,appearance:f,hideOnFlowCompletion:C,setVisible:w,customStepTypes:x,checklistStyle:g="default",autoExpandFirstIncompleteStep:E,autoExpandNextStep:T}=k,P=Le(k,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:u,getFlowSteps:L,markStepCompleted:b,getStepStatus:F,getNumberOfStepsCompleted:$,isLoading:N,targetingLogicShouldHideFlow:O,updateCustomVariables:V,getFlowMetadata:W,isStepBlocked:J,getFlowStatus:R,hasActiveFullPageFlow:pe,setHasActiveFullPageFlow:q,markStepStarted:Y,getCurrentStepIndex:de}=Q(),{primaryCTAClickSideEffects:we,secondaryCTAClickSideEffects:ke}=ue(),{getOpenFlowState:Z,setOpenFlowState:me}=Ne(),[U,ee]=il(n||0),[he,Ee]=il(!1),Ae=d===void 0?Z(e):d,Ce=s==="modal",{mergeAppearanceWithDefault:H}=oe();Ge(e,d);let z=L(e),M=de(e);if(f=H(f),ar(()=>{V(l)},[l,N]),ar(()=>{d!==void 0&&(Ce&&d===!0?q(!0):Ce&&d===!1&&q(!1))},[d,w,pe]),ar(()=>{!N&&z&&z[U]&&F(e,z[U].id)&&F(e,z[U].id)!==$e&&Y(e,z[U].id)},[U]),ar(()=>{U!==M&&ee(M)},[M]),N)return null;let _=u(e);if(!_||O(_)||!z||C===!0&&R(e)===te)return null;let le=W(e);if(le!=null&&le.title&&(t=le.title),le!=null&&le.subtitle&&(o=le.subtitle),!he&&n===void 0&&$(e)>0){let I=z.findIndex(ne=>ne.complete===!1);ee(I>-1?I:z.length-1),Ee(!0)}function qe(){if(U+1>=z.length){Ce&&me(e,!1);return}J(e,z[U+1].id)||ee(U+1)}function nt(I,ne,je){let De=U+1<z.length?z[U+1]:null;c&&c(I,U,ne,De)===!0&&Ce&&Qe(),m&&m(I,je,De),!m&&!c&&(I.primaryButtonUri||I.secondaryButtonUri)&&Ce&&Qe()}function Wt(){return z.map((I,ne)=>j(S({},I),{handleSecondaryButtonClick:()=>{qe(),ke(I),I.skippable===!0&&b(e,I.id,{skipped:!0}),nt(I,"secondary",ne)},handlePrimaryButtonClick:()=>{(!I.completionCriteria&&(I.autoMarkCompleted||I.autoMarkCompleted===void 0)||I.completionCriteria&&I.autoMarkCompleted===!0)&&(b(e,I.id),qe()),nt(I,"primary",ne),we(I),F(e,I.id)===$e&&qe()}}))}function Ye(){return Se.createElement(se,{appearance:f})}let ht={steps:Wt(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:x,type:s,className:r,autoExpandFirstIncompleteStep:E,autoExpandNextStep:T};function Qe(){me(e,!1),p&&p(),w&&w(!1)}function zt(){return Se.createElement(Se.Fragment,null,Se.createElement(Ye,null),Se.createElement(rl,{flowId:e,appearance:f,customVariables:l,className:r}))}function h(){return Se.createElement(Se.Fragment,null,Se.createElement(Ye,null),Se.createElement(Gr,S({visible:Ae,onClose:()=>{Qe()},selectedStep:U,setSelectedStep:ee,autoExpandNextStep:!0,appearance:f},ht)))}function y(){var je;let I=P.guideFlowId,ne;return I&&u(I)&&(ne=L(I)),Se.createElement(Se.Fragment,null,Se.createElement(Ye,null),Se.createElement(jr,S({visible:Ae,stepsTitle:le.stepsTitle?le.stepsTitle:"Your quick start guide",onClose:()=>{Qe()},selectedStep:U,setSelectedStep:ee,guideData:ne,guideTitle:(je=P.guideTitle)!=null?je:"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:De=>{nt(De,"link",0)},customStepTypes:x},ht)))}function v(){let I=Se.createElement(Hr,S({flowId:e,style:i,selectedStep:U,setSelectedStep:ee,appearance:f,type:s},ht));return Ce?Se.createElement(Re,{onClose:()=>{Qe()},visible:Ae,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Se.createElement(Ye,null),I):Se.createElement(Se.Fragment,null,Se.createElement(Ye,null),I)}switch(g){case"condensed":return h();case"with-guide":return y();case"default":return v();case"carousel":return zt();default:return v()}};var hc=e=>gc.createElement(qr,S({type:"inline"},e));import kt,{useEffect as xc}from"react";import rt from"react";import pr from"styled-components";var nl=pr.div`
1352
1352
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1353
1353
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
1354
1354
  padding: 10px 12px 10px 12px;
1355
1355
  min-width: 160px;
1356
1356
  cursor: pointer;
1357
1357
  background-color: ${e=>e.appearance.theme.colorBackground}};
1358
- ${e=>ve(e)}
1358
+ ${e=>Pe(e)}
1359
1359
 
1360
1360
  &:hover {
1361
1361
  filter: brightness(.99);
1362
1362
  }
1363
- `,nl=pr.div`
1363
+ `,sl=pr.div`
1364
1364
  display: flex;
1365
1365
  flex-direction: row;
1366
1366
  justify-content: space-between;
1367
1367
  align-items: center;
1368
1368
  margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
1369
1369
  flex-grow: 2;
1370
- `,sl=pr.div`
1370
+ `,ll=pr.div`
1371
1371
  text-overflow: ellipsis;
1372
1372
  font-weight: 600;
1373
1373
  font-size: 14px;
1374
1374
  line-height: 16px;
1375
1375
  margin-right: ${e=>e.type==="condensed"?"8px":"0"};
1376
1376
  text-align: ${e=>e.type==="condensed"?"left":"right"};
1377
- `,ll=pr.div`
1377
+ `,al=pr.div`
1378
1378
  width: 20px;
1379
1379
  margin-right: 8px;
1380
1380
  display: flex;
1381
1381
  height: 100%;
1382
1382
  align-items: center;
1383
- `;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:p="default"})=>ot.createElement(ot.Fragment,null,ot.createElement(ne,{appearance:s}),ot.createElement(il,{onClick:()=>i!==void 0&&i(),styleOverrides:b(b({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Fe(r!=null?r:"",a("progressBadgeContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&ot.createElement(ll,{className:a("progressRingContainer",s)},ot.createElement(qt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),ot.createElement(nl,{type:p,className:a("badgeTitleContainer",s)},ot.createElement(sl,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&ot.createElement(io,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&ot.createElement(_e,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import Ft from"react";import Ao from"styled-components";var pl=Ao.div`
1383
+ `;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:p="default"})=>rt.createElement(rt.Fragment,null,rt.createElement(se,{appearance:s}),rt.createElement(nl,{onClick:()=>i!==void 0&&i(),styleOverrides:S(S({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Te(r!=null?r:"",a("progressBadgeContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&rt.createElement(al,{className:a("progressRingContainer",s)},rt.createElement(Kt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),rt.createElement(sl,{type:p,className:a("badgeTitleContainer",s)},rt.createElement(ll,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&rt.createElement(ro,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&rt.createElement(_e,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import Ft from"react";import Eo from"styled-components";var dl=Eo.div`
1384
1384
  display: flex;
1385
1385
  flex-direction: row;
1386
1386
  width: 100%;
@@ -1390,25 +1390,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1390
1390
  background-color: ${e=>e.appearance.theme.colorBackground};
1391
1391
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1392
1392
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
1393
- `,dl=Ao.div`
1394
- ${e=>E(e)} {
1393
+ `,cl=Eo.div`
1394
+ ${e=>A(e)} {
1395
1395
  display: flex;
1396
1396
  justify-content: center;
1397
1397
  align-items: center;
1398
1398
  margin-right: 16px;
1399
1399
  }
1400
- `,cl=Ao.div`
1400
+ `,ml=Eo.div`
1401
1401
  display: flex;
1402
1402
  flex-direction: column;
1403
1403
  flex: 1;
1404
1404
  margin-top: 0;
1405
- `,ml=Ao.div`
1405
+ `,ul=Eo.div`
1406
1406
  display: flex;
1407
1407
  flex-direction: column;
1408
1408
  justify-content: center;
1409
1409
  margin-left: 16px;
1410
1410
  min-width: 200px;
1411
- `,KS=Ao.div`
1411
+ `,GS=Eo.div`
1412
1412
  display: flex;
1413
1413
  justify-content: center;
1414
1414
  align-items: flex-end;
@@ -1417,7 +1417,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1417
1417
  :hover {
1418
1418
  opacity: 0.8;
1419
1419
  }
1420
- `;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:p})=>Ft.createElement(Ft.Fragment,null,Ft.createElement(pl,{appearance:i,className:Fe(a("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:p},o&&Ft.createElement(dl,{className:a("fullWidthProgressBadgeIcon",i)},o),Ft.createElement(cl,null,Ft.createElement(Ie,{size:"small",appearance:i,title:e,subtitle:t})),Ft.createElement(ml,{className:a("fullWidthProgressBadgeProgressContainer",i)},Ft.createElement(_e,{count:n,total:r,display:"percent",textLocation:"top"}))));var Cc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:m="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:C,getNumberOfStepsCompleted:w,isLoading:x,targetingLogicShouldHideFlow:g,updateCustomVariables:A}=J(),{mergeAppearanceWithDefault:T}=ee();l=T(l);let{setOpenFlowState:k,getOpenFlowState:P}=Oe();if(xc(()=>{A(p)},[p,x]),x)return null;let v=c(e);if(!v||g(v)||d===!0&&C(e)===R)return null;let u=f(e),L=w(e);return m==="full-width"?kt.createElement(kt.Fragment,null,kt.createElement(ne,{appearance:l}),kt.createElement(ul,{title:t,subtitle:o,count:L,total:u.length,style:n,className:s,appearance:l,icon:i,onClick:()=>{}})):kt.createElement(kt.Fragment,null,kt.createElement(ne,{appearance:l}),kt.createElement(al,{count:L,total:u.length,title:t,style:n,onClick:()=>{k(e,!0),r&&r()},type:m,className:s,appearance:l}))};import yc from"react";var Sc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Le(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:p,getFlowSteps:d}=J(),{mergeAppearanceWithDefault:l}=ee();o=l(o);let m=s(e);if(!m||p(m))return null;let c=d(e);return yc.createElement(Eo,b({steps:c,style:t,appearance:o},i))};import Dt,{useContext as Ic,useEffect as Lc}from"react";import K,{useEffect as Oo,useLayoutEffect as hl,useRef as Pc,useState as lo}from"react";import No from"styled-components";import{useCallback as bc,useEffect as wc,useState as Tc}from"react";var Yr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+r}:{x:0,y:0}};function fl(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,n]=Tc(o),r=bc(()=>{e&&n(e.getBoundingClientRect())},[e]);return wc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Fc,useState as kc}from"react";function gl(){let{debug:e}=Fc(Y),[t,o]=kc([]);function i(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var xl=300,Cl=100,vc=500,ao=12,Bc=No.div`
1420
+ `;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:p})=>Ft.createElement(Ft.Fragment,null,Ft.createElement(dl,{appearance:i,className:Te(a("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:p},o&&Ft.createElement(cl,{className:a("fullWidthProgressBadgeIcon",i)},o),Ft.createElement(ml,null,Ft.createElement(Ie,{size:"small",appearance:i,title:e,subtitle:t})),Ft.createElement(ul,{className:a("fullWidthProgressBadgeProgressContainer",i)},Ft.createElement(_e,{count:n,total:r,display:"percent",textLocation:"top"}))));var Cc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:m="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:C,getNumberOfStepsCompleted:w,isLoading:x,targetingLogicShouldHideFlow:g,updateCustomVariables:E}=Q(),{mergeAppearanceWithDefault:T}=oe();l=T(l);let{setOpenFlowState:P,getOpenFlowState:B}=Ne();if(xc(()=>{E(p)},[p,x]),x)return null;let k=c(e);if(!k||g(k)||d===!0&&C(e)===te)return null;let u=f(e),L=w(e);return m==="full-width"?kt.createElement(kt.Fragment,null,kt.createElement(se,{appearance:l}),kt.createElement(fl,{title:t,subtitle:o,count:L,total:u.length,style:n,className:s,appearance:l,icon:i,onClick:()=>{}})):kt.createElement(kt.Fragment,null,kt.createElement(se,{appearance:l}),kt.createElement(pl,{count:L,total:u.length,title:t,style:n,onClick:()=>{P(e,!0),r&&r()},type:m,className:s,appearance:l}))};import yc from"react";var Sc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Le(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:p,getFlowSteps:d}=Q(),{mergeAppearanceWithDefault:l}=oe();o=l(o);let m=s(e);if(!m||p(m))return null;let c=d(e);return yc.createElement(Bo,S({steps:c,style:t,appearance:o},i))};import Mt,{useContext as Ic,useEffect as Lc}from"react";import K,{useEffect as Ao,useLayoutEffect as xl,useRef as Pc,useState as so}from"react";import No from"styled-components";import{useCallback as bc,useEffect as wc,useState as Tc}from"react";var Yr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+r}:{x:0,y:0}};function gl(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,n]=Tc(o),r=bc(()=>{e&&n(e.getBoundingClientRect())},[e]);return wc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Fc,useState as kc}from"react";function hl(){let{debug:e}=Fc(X),[t,o]=kc([]);function i(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var Cl=300,yl=100,vc=500,lo=12,Bc=No.div`
1421
1421
  width: 100%;
1422
1422
  height: 100%;
1423
1423
  border-radius: 9999px;
@@ -1441,25 +1441,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1441
1441
  }
1442
1442
  }
1443
1443
  `,Ec=No.div`
1444
- width: ${ao}px;
1445
- height: ${ao}px;
1444
+ width: ${lo}px;
1445
+ height: ${lo}px;
1446
1446
  border-radius: 100px;
1447
1447
  background-color: ${e=>e.primaryColor};
1448
1448
  z-index: 20;
1449
1449
  opacity: 1;
1450
1450
  `,Ac=No.div`
1451
1451
  pointer-events: all;
1452
- `,yl=No.div`
1452
+ `,Sl=No.div`
1453
1453
  display: flex;
1454
1454
  align-content: center;
1455
1455
  justify-content: center;
1456
1456
  align-items: center;
1457
1457
  z-index: ${e=>e.zIndex?e.zIndex:90};
1458
- `,Oc=No(yl)`
1459
- width: ${ao+12}px;
1460
- height: ${ao+12}px;
1461
- `,Nc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:f=!1,showHighlightOnly:C,showStepCount:w=!0,completedStepsCount:x=0,showFrigadeBranding:g=!1,cssPosition:A="absolute",onViewTooltip:T})=>{var nt,zt,qe,ht,Xe,_t,h,y,B,N,ie,je,De,xt,me,co,mo,ri,ii;let{logErrorIfDebugMode:k}=gl(),[P,v]=lo(),[u,L]=lo(new Date),S=Pc(null),[F,M]=lo(document.querySelector(e[l].selector)),O=fl(F,u),[I,V]=lo(),[W,q]=lo(!C),X=(zt=(nt=e[l])==null?void 0:nt.props)!=null&&zt.position?e[l].props.position:A,de=(Xe=(ht=(qe=e[l])==null?void 0:qe.props)==null?void 0:ht.zIndex)!=null?Xe:90,H=(_t=P==null?void 0:P.width)!=null?_t:xl,le=(h=P==null?void 0:P.height)!=null?h:Cl,[fe,Te]=lo(new Date().getTime());s=(N=(B=(y=e[l])==null?void 0:y.props)==null?void 0:B.offset)!=null?N:s;let re=window.location.pathname.split("/").pop();hl(()=>{S.current&&v({width:S.current.clientWidth,height:S.current.clientHeight})},[l,u,X]),Oo(()=>{C||q(!0)},[l]),Oo(()=>{p&&W&&T(l)},[W]);let Q=()=>{let se=document.querySelector(e[l].selector);if(!se){V(void 0),M(null),k(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}I&&I===JSON.stringify(se==null?void 0:se.getBoundingClientRect())||(M(se),L(new Date),se&&V(JSON.stringify(se.getBoundingClientRect())))};if(Oo(()=>{let se=new MutationObserver(Q);return se.observe(document.body,{subtree:!0,childList:!0}),()=>se.disconnect()},[Q]),Oo(()=>{let se=new MutationObserver(Q);return se.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>se.disconnect()},[Q]),Oo(()=>{let se=setInterval(()=>{Q()},10);return()=>clearInterval(se)},[Q]),hl(()=>{setTimeout(()=>{Q()},vc),Q()},[l,re]),F===null||!p)return null;let he=i==="auto"?"right":i,D=Yr(O,he,H,s,X),Se=O.right+H>(window.innerWidth||document.documentElement.clientWidth),xe=O.bottom+Cl>(window.innerHeight||document.documentElement.clientHeight);Se&&i==="auto"&&(D=Yr(O,"left",H,s,X),he="left"),(je=(ie=e[l])==null?void 0:ie.props)!=null&&je.tooltipPosition&&((xt=(De=e[l])==null?void 0:De.props)==null?void 0:xt.tooltipPosition)!=="auto"&&(((co=(me=e[l])==null?void 0:me.props)==null?void 0:co.tooltipPosition)==="left"||((ri=(mo=e[l])==null?void 0:mo.props)==null?void 0:ri.tooltipPosition)==="right")&&(he=e[l].props.tooltipPosition);let Pe=()=>{let se=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),q(!1),setTimeout(()=>{Q()},30)),x===e.length-1)return o()},Ct=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),C&&!e[l].secondaryButtonUri&&q(!1))};return K.createElement(K.Fragment,null,w&&e.length>1&&K.createElement(bi,null,K.createElement(Ti,{className:a("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&K.createElement(wi,{showStepCount:w,className:a("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&K.createElement(te,{title:e[l].secondaryButtonTitle,appearance:c,onClick:Ct,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&K.createElement(te,{title:e[l].primaryButtonTitle,appearance:c,onClick:se,withMargin:!1,size:"small"})))},Ae=()=>K.createElement(K.Fragment,null,f&&K.createElement(hi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri},K.createElement(Ne,null)),e[l].imageUri&&K.createElement(xi,{dismissible:f,appearance:c,src:e[l].imageUri,className:a("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&K.createElement(Ci,{dismissible:f,appearance:c,className:a("tooltipVideoContainer",c)},K.createElement(et,{appearance:c,videoUri:e[l].videoUri})),K.createElement(Si,{className:a("tooltipContentContainer",c)},K.createElement(Ie,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),K.createElement(yi,{className:a("tooltipFooter",c)},K.createElement(Pe,null)))),_=b(b({},{default:se=>{var Ct;if((Ct=e[l])!=null&&Ct.StepContent){let ra=e[l].StepContent;return K.createElement("div",null,ra)}return K.createElement(Ae,null)}}),m),$=()=>{var se;return e?!((se=e[l])!=null&&se.type)||!_[e[l].type]?_.default(e[l]):_[e[l].type]({stepData:e[l],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[l].complete===!0||D.x==0&&D.y==0&&new Date().getTime()-fe<100)return null;let z={top:(D==null?void 0:D.y)-ao,left:(ii=he=="left"?O.x+s.x:(D==null?void 0:D.x)-ao)!=null?ii:0,cursor:C?"pointer":"default",position:X},Z=()=>{let Ct=z.left+(he=="left"?-H:24);return Math.min(Math.max(Ct,20),window.innerWidth-H-20)},ce=()=>{if(X==="fixed")return z.top;let se=z.top+le,Ct=20;return se>window.innerHeight-Ct?z.top+-le:z.top},it=()=>{C&&(L(new Date),q(!W))};return K.createElement(Ac,null,K.createElement(Oc,{style:z,zIndex:de,className:a("tourHighlightContainer",c)},n&&e[l].showHighlight!==!1&&A!=="static"&&K.createElement(K.Fragment,null,K.createElement(Ec,{style:{position:X},onClick:it,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Bc,{style:{position:"absolute"},onClick:it,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(yl,{style:j(b({},z),{left:Z(),top:ce()}),zIndex:de+1,className:a("tooltipContainerWrapper",c)},W&&K.createElement(K.Fragment,null,K.createElement(Do,{ref:S,layoutId:"tooltip-container",style:b({position:"relative",width:"max-content",right:0,top:A!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:xl,zIndex:de+10},K.createElement($,null)),g&&K.createElement(ki,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:de+10},K.createElement(Uo,{appearance:c})))))},Jr=Nc;import{Portal as $c}from"react-portal";var Mc=x=>{var g=x,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:f=!1,cssPosition:C="absolute"}=g,w=Le(g,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition"]);let{getFlow:A,getFlowSteps:T,isLoading:k,targetingLogicShouldHideFlow:P,markStepCompleted:v,markStepStarted:u,markFlowCompleted:L,updateCustomVariables:S,getCurrentStepIndex:F,getStepStatus:M,isStepBlocked:O,getFlowStatus:I,getNumberOfStepsCompleted:V}=J(),{isLoadingUserFlowStateData:W}=We(),{primaryCTAClickSideEffects:q,secondaryCTAClickSideEffects:X}=pe(),{hasOpenModals:de}=Oe(),H=F(e),{openFlowStates:le}=Ic(Y),{mergeAppearanceWithDefault:fe}=ee();if(o=fe(o),Lc(()=>{S(t)},[t,k]),W)return null;let Te=A(e);if(!Te||P(Te)||I(e)==R||de())return null;let re=T(e);if(Object.keys(le).length>0){let $=Object.keys(le).find(z=>le[z]===!0);if($!==void 0&&$!==e)return Dt.createElement(Dt.Fragment,null)}function Q($){return U(this,null,function*(){if(yield v(e,$.id),re.map(z=>M(e,z.id)).every(z=>z===$e)){yield L(e);return}!l&&H+1<re.length&&!r&&O(e,re[H+1].id)})}function he($,z,Z){let ce=H+1<re.length?re[H+1]:null;n&&n($,H,z,ce),i&&i($,Z,ce)}function D(){return re.map($=>j(b({},$),{handleSecondaryButtonClick:()=>U(this,null,function*(){X($),$.skippable===!0&&(yield v(e,$.id,{skipped:!0})),he($,"secondary",H)}),handlePrimaryButtonClick:()=>U(this,null,function*(){(!$.completionCriteria&&($.autoMarkCompleted||$.autoMarkCompleted===void 0)||$.completionCriteria&&$.autoMarkCompleted===!0)&&(yield Q($)),he($,"primary",H),q($)})}))}function Se($){return U(this,null,function*(){s&&s(),m==="complete-flow"?yield L(e):yield v(e,$.id)})}function xe(){c&&c()}function Pe($){return U(this,null,function*(){yield u(e,re[$].id)})}let Ae=!document.querySelector(re[H].selector);function be(){let $=re.findIndex(z=>!!document.querySelector(z.selector));return re.map((z,Z)=>Ae&&!r&&Z!==$&&f||!r&&Z!==H?null:Dt.createElement(Jr,b({key:z.id,appearance:o,steps:D(),selectedStep:Z,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Se(z),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:V(e),onComplete:xe,cssPosition:C,onViewTooltip:Pe},w)))}function _(){return Dt.createElement(Dt.Fragment,null,Dt.createElement(ne,{appearance:o}),be())}return C==="static"?_():Dt.createElement($c,null,_())};import Ve,{useEffect as Dc,useRef as Uc,useState as Wc}from"react";import{Portal as zc}from"react-portal";import Ut from"styled-components";var Sl=Ut.button`
1462
- ${e=>E(e)} {
1458
+ `,Nc=No(Sl)`
1459
+ width: ${lo+12}px;
1460
+ height: ${lo+12}px;
1461
+ `,Oc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:f=!1,showHighlightOnly:C,showStepCount:w=!0,completedStepsCount:x=0,showFrigadeBranding:g=!1,cssPosition:E="absolute",onViewTooltip:T,className:P})=>{var Wt,Ye,ht,Qe,zt,h,y,v,I,ne,je,De,xt,fe,po,co,ri,ii,ni;let{logErrorIfDebugMode:B}=hl(),[k,u]=so(),[L,b]=so(new Date),F=Pc(null),[$,N]=so(document.querySelector(e[l].selector)),O=gl($,L),[V,W]=so(),[J,R]=so(!C),pe=(Ye=(Wt=e[l])==null?void 0:Wt.props)!=null&&Ye.position?e[l].props.position:E,q=(zt=(Qe=(ht=e[l])==null?void 0:ht.props)==null?void 0:Qe.zIndex)!=null?zt:90,Y=(h=k==null?void 0:k.width)!=null?h:Cl,de=(y=k==null?void 0:k.height)!=null?y:yl,[we,ke]=so(new Date().getTime());s=(ne=(I=(v=e[l])==null?void 0:v.props)==null?void 0:I.offset)!=null?ne:s;let Z=window.location.pathname.split("/").pop();xl(()=>{F.current&&u({width:F.current.clientWidth,height:F.current.clientHeight})},[l,L,pe]),Ao(()=>{C||R(!0)},[l]),Ao(()=>{p&&J&&T(l)},[J]);let me=()=>{let ae=document.querySelector(e[l].selector);if(!ae){W(void 0),N(null),B(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}V&&V===JSON.stringify(ae==null?void 0:ae.getBoundingClientRect())||(N(ae),b(new Date),ae&&W(JSON.stringify(ae.getBoundingClientRect())))};if(Ao(()=>{let ae=new MutationObserver(me);return ae.observe(document.body,{subtree:!0,childList:!0}),()=>ae.disconnect()},[me]),Ao(()=>{let ae=new MutationObserver(me);return ae.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>ae.disconnect()},[me]),Ao(()=>{let ae=setInterval(()=>{me()},10);return()=>clearInterval(ae)},[me]),xl(()=>{setTimeout(()=>{me()},vc),me()},[l,Z]),$===null||!p)return null;let U=i==="auto"?"right":i,ee=Yr(O,U,Y,s,pe),he=O.right+Y>(window.innerWidth||document.documentElement.clientWidth),Ee=O.bottom+yl>(window.innerHeight||document.documentElement.clientHeight);he&&i==="auto"&&(ee=Yr(O,"left",Y,s,pe),U="left"),(De=(je=e[l])==null?void 0:je.props)!=null&&De.tooltipPosition&&((fe=(xt=e[l])==null?void 0:xt.props)==null?void 0:fe.tooltipPosition)!=="auto"&&(((co=(po=e[l])==null?void 0:po.props)==null?void 0:co.tooltipPosition)==="left"||((ii=(ri=e[l])==null?void 0:ri.props)==null?void 0:ii.tooltipPosition)==="right")&&(U=e[l].props.tooltipPosition);let Ae=()=>{let ae=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),R(!1),setTimeout(()=>{me()},30)),x===e.length-1)return o()},Ct=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),C&&!e[l].secondaryButtonUri&&R(!1))};return K.createElement(K.Fragment,null,w&&e.length>1&&K.createElement(wi,null,K.createElement(Fi,{className:a("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&K.createElement(Ti,{showStepCount:w,className:a("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&K.createElement(re,{title:e[l].secondaryButtonTitle,appearance:c,onClick:Ct,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&K.createElement(re,{title:e[l].primaryButtonTitle,appearance:c,onClick:ae,withMargin:!1,size:"small"})))},Ce=()=>K.createElement(K.Fragment,null,f&&K.createElement(xi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri},K.createElement(Oe,null)),e[l].imageUri&&K.createElement(Ci,{dismissible:f,appearance:c,src:e[l].imageUri,className:a("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&K.createElement(yi,{dismissible:f,appearance:c,className:a("tooltipVideoContainer",c)},K.createElement(tt,{appearance:c,videoUri:e[l].videoUri})),K.createElement(bi,{className:a("tooltipContentContainer",c)},K.createElement(Ie,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),K.createElement(Si,{className:a("tooltipFooter",c)},K.createElement(Ae,null)))),z=S(S({},{default:ae=>{var Ct;if((Ct=e[l])!=null&&Ct.StepContent){let ia=e[l].StepContent;return K.createElement("div",null,ia)}return K.createElement(Ce,null)}}),m),M=()=>{var ae;return e?!((ae=e[l])!=null&&ae.type)||!z[e[l].type]?z.default(e[l]):z[e[l].type]({stepData:e[l],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[l].complete===!0||ee.x==0&&ee.y==0&&new Date().getTime()-we<100)return null;let _={top:(ee==null?void 0:ee.y)-lo,left:(ni=U=="left"?O.x+s.x:(ee==null?void 0:ee.x)-lo)!=null?ni:0,cursor:C?"pointer":"default",position:pe},le=()=>{let Ct=_.left+(U=="left"?-Y:24);return Math.min(Math.max(Ct,20),window.innerWidth-Y-20)},qe=()=>{if(pe==="fixed")return _.top;let ae=_.top+de,Ct=20;return ae>window.innerHeight-Ct?_.top+-de:_.top},nt=()=>{C&&(b(new Date),R(!J))};return K.createElement(Ac,{className:P},K.createElement(Nc,{style:_,zIndex:q,className:a("tourHighlightContainer",c)},n&&e[l].showHighlight!==!1&&E!=="static"&&K.createElement(K.Fragment,null,K.createElement(Ec,{style:{position:pe},onClick:nt,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Bc,{style:{position:"absolute"},onClick:nt,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(Sl,{style:j(S({},_),{left:le(),top:qe()}),zIndex:q+1,className:a("tooltipContainerWrapper",c)},J&&K.createElement(K.Fragment,null,K.createElement(Mo,{ref:F,layoutId:"tooltip-container",style:S({position:"relative",width:"max-content",right:0,top:E!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:Cl,zIndex:q+10},K.createElement(M,null)),g&&K.createElement(Pi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:q+10},K.createElement(Do,{appearance:c})))))},Jr=Oc;import{Portal as $c}from"react-portal";var Mc=g=>{var E=g,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:f=!1,cssPosition:C="absolute",className:w}=E,x=Le(E,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:T,getFlowSteps:P,isLoading:B,targetingLogicShouldHideFlow:k,markStepCompleted:u,markStepStarted:L,markFlowCompleted:b,updateCustomVariables:F,getCurrentStepIndex:$,getStepStatus:N,isStepBlocked:O,getFlowStatus:V,getNumberOfStepsCompleted:W}=Q(),{isLoadingUserFlowStateData:J}=We(),{primaryCTAClickSideEffects:R,secondaryCTAClickSideEffects:pe}=ue(),{hasOpenModals:q}=Ne(),Y=$(e),{openFlowStates:de}=Ic(X),{mergeAppearanceWithDefault:we}=oe();if(o=we(o),Lc(()=>{F(t)},[t,B]),J)return null;let ke=T(e);if(!ke||k(ke)||V(e)==te||q())return null;let Z=P(e);if(Object.keys(de).length>0){let M=Object.keys(de).find(_=>de[_]===!0);if(M!==void 0&&M!==e)return Mt.createElement(Mt.Fragment,null)}function me(M){return D(this,null,function*(){if(yield u(e,M.id),Z.map(_=>N(e,_.id)).every(_=>_===$e)){yield b(e);return}!l&&Y+1<Z.length&&!r&&O(e,Z[Y+1].id)})}function U(M,_,le){let qe=Y+1<Z.length?Z[Y+1]:null;n&&n(M,Y,_,qe),i&&i(M,le,qe)}function ee(){return Z.map(M=>j(S({},M),{handleSecondaryButtonClick:()=>D(this,null,function*(){pe(M),M.skippable===!0&&(yield u(e,M.id,{skipped:!0})),U(M,"secondary",Y)}),handlePrimaryButtonClick:()=>D(this,null,function*(){(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&(yield me(M)),U(M,"primary",Y),R(M)})}))}function he(M){return D(this,null,function*(){s&&s(),m==="complete-flow"?yield b(e):yield u(e,M.id)})}function Ee(){c&&c()}function Ae(M){return D(this,null,function*(){yield L(e,Z[M].id)})}let Ce=!document.querySelector(Z[Y].selector);function H(){let M=Z.findIndex(_=>!!document.querySelector(_.selector));return Z.map((_,le)=>Ce&&!r&&le!==M&&f||!r&&le!==Y?null:Mt.createElement(Jr,S({key:_.id,appearance:o,steps:ee(),selectedStep:le,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>he(_),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:W(e),onComplete:Ee,cssPosition:C,onViewTooltip:Ae,className:w},x)))}function z(){return Mt.createElement(Mt.Fragment,null,Mt.createElement(se,{appearance:o}),H())}return C==="static"?z():Mt.createElement($c,null,z())};import Ve,{useEffect as Dc,useRef as Uc,useState as Wc}from"react";import{Portal as zc}from"react-portal";import Dt from"styled-components";var bl=Dt.button`
1462
+ ${e=>A(e)} {
1463
1463
  // Anything inside this block will be ignored if the user provides a custom class
1464
1464
 
1465
1465
  display: flex;
@@ -1476,17 +1476,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1476
1476
  opacity: 0.8;
1477
1477
  }
1478
1478
  }
1479
- `,bl=Ut.span`
1480
- ${e=>E(e)} {
1479
+ `,wl=Dt.span`
1480
+ ${e=>A(e)} {
1481
1481
  font-size: 12px;
1482
1482
  display: inline-block;
1483
1483
  }
1484
- `,wl=Ut.span`
1485
- ${e=>E(e)} {
1484
+ `,Tl=Dt.span`
1485
+ ${e=>A(e)} {
1486
1486
  font-size: 12px;
1487
1487
  display: inline-block;
1488
1488
  }
1489
- `,Tl=Ut.div`
1489
+ `,Fl=Dt.div`
1490
1490
  position: fixed;
1491
1491
  right: 0;
1492
1492
  bottom: 0;
@@ -1496,8 +1496,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1496
1496
  flex-direction: column;
1497
1497
  align-items: flex-end;
1498
1498
  z-index: 50;
1499
- `,Fl=Ut.button`
1500
- ${e=>E(e)} {
1499
+ `,kl=Dt.button`
1500
+ ${e=>A(e)} {
1501
1501
  // Anything inside this block will be ignored if the user provides a custom class
1502
1502
  background-color: #ffffff;
1503
1503
  border: 1px solid #f5f5f5;
@@ -1512,8 +1512,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1512
1512
  0px 3px 6px -4px rgba(0, 0, 0, 0.12);
1513
1513
  border-radius: 45px;
1514
1514
  cursor: pointer;
1515
- `,kl=Ut.div`
1516
- ${e=>E(e)} {
1515
+ `,Pl=Dt.div`
1516
+ ${e=>A(e)} {
1517
1517
  // Anything inside this block will be ignored if the user provides a custom class
1518
1518
  background: #ffffff;
1519
1519
  }
@@ -1529,8 +1529,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1529
1529
  position: ${e=>e.type=="inline"?"absolute":"relative"};
1530
1530
  top: ${e=>e.type=="inline"?"68px":0};
1531
1531
  margin-left: ${e=>e.type=="inline"?"-127px":0};
1532
- `,Pl=Ut.button`
1533
- ${e=>E(e)} {
1532
+ `,vl=Dt.button`
1533
+ ${e=>A(e)} {
1534
1534
  // Anything inside this block will be ignored if the user provides a custom class
1535
1535
  color: #434343;
1536
1536
  :hover {
@@ -1546,8 +1546,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1546
1546
  font-size: 14px;
1547
1547
 
1548
1548
  padding: 8px 12px;
1549
- `;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.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 El from"react";var Al=({style:e,className:t})=>El.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"},El.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 _c=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C}=J(),{primaryCTAClickSideEffects:w}=pe(),x=Uc(null),[g,A]=Wc(!1),{mergeAppearanceWithDefault:T}=ee();s=T(s),Dc(()=>(document.addEventListener("click",k,!1),()=>{document.removeEventListener("click",k,!1)}),[]);let k=S=>{x.current&&!x.current.contains(S.target)&&A(!1)};if(f)return null;let P=p(e);if(!P||C(P))return null;let v=d(e);if(!v||!i)return null;function u(S,F){!S.completionCriteria&&(S.autoMarkCompleted||S.autoMarkCompleted===void 0)&&l(e,S.id),w(S),o&&o(S,F),A(!1)}function L(){return g&&Ve.createElement(kl,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},v.map((S,F)=>Ve.createElement(Pl,{className:a("floatingWidgetMenuItem",s),key:F,onClick:()=>u(S,F)},S.title)))}return n=="inline"?Ve.createElement("span",{ref:x},Ve.createElement(Sl,{style:t,onClick:()=>{A(!g)},className:a("supportButton",s)},Ve.createElement(wl,{className:a("supportIconContainer",s)},Ve.createElement(Al,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ve.createElement(bl,{className:a("supportButtonTitle",s)},r)),Ve.createElement(L,null)):Ve.createElement(zc,null,Ve.createElement(Tl,{style:t,ref:x},Ve.createElement(L,null),Ve.createElement(Fl,{onClick:()=>{A(!g)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ve.createElement(Bl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import rt,{useEffect as Hc}from"react";import dr from"styled-components";var Ol=dr.div`
1550
- ${e=>E(e)} {
1549
+ `;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.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 Al from"react";var Nl=({style:e,className:t})=>Al.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"},Al.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 _c=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C}=Q(),{primaryCTAClickSideEffects:w}=ue(),x=Uc(null),[g,E]=Wc(!1),{mergeAppearanceWithDefault:T}=oe();s=T(s),Dc(()=>(document.addEventListener("click",P,!1),()=>{document.removeEventListener("click",P,!1)}),[]);let P=b=>{x.current&&!x.current.contains(b.target)&&E(!1)};if(f)return null;let B=p(e);if(!B||C(B))return null;let k=d(e);if(!k||!i)return null;function u(b,F){!b.completionCriteria&&(b.autoMarkCompleted||b.autoMarkCompleted===void 0)&&l(e,b.id),w(b),o&&o(b,F),E(!1)}function L(){return g&&Ve.createElement(Pl,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},k.map((b,F)=>Ve.createElement(vl,{className:a("floatingWidgetMenuItem",s),key:F,onClick:()=>u(b,F)},b.title)))}return n=="inline"?Ve.createElement("span",{ref:x},Ve.createElement(bl,{style:t,onClick:()=>{E(!g)},className:a("supportButton",s)},Ve.createElement(Tl,{className:a("supportIconContainer",s)},Ve.createElement(Nl,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ve.createElement(wl,{className:a("supportButtonTitle",s)},r)),Ve.createElement(L,null)):Ve.createElement(zc,null,Ve.createElement(Fl,{style:t,ref:x},Ve.createElement(L,null),Ve.createElement(kl,{onClick:()=>{E(!g)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ve.createElement(El,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import it,{useEffect as Hc}from"react";import dr from"styled-components";var Ol=dr.div`
1550
+ ${e=>A(e)} {
1551
1551
  display: flex;
1552
1552
  flex-direction: column;
1553
1553
  width: 100%;
@@ -1561,18 +1561,18 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1561
1561
  border-radius: 12px;
1562
1562
  position: relative;
1563
1563
  }
1564
- `,Nl=dr.div`
1564
+ `,Il=dr.div`
1565
1565
  display: flex;
1566
1566
  flex-direction: column;
1567
1567
  flex: 1;
1568
- `,Il=dr.div`
1568
+ `,Ll=dr.div`
1569
1569
  display: flex;
1570
1570
  flex-direction: column;
1571
1571
  justify-content: center;
1572
1572
  align-items: flex-start;
1573
1573
  margin-top: 16px;
1574
- `,Ll=dr.div`
1575
- ${e=>E(e)} {
1574
+ `,$l=dr.div`
1575
+ ${e=>A(e)} {
1576
1576
  position: absolute;
1577
1577
  top: 16px;
1578
1578
  right: 16px;
@@ -1582,9 +1582,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1582
1582
  opacity: 0.8;
1583
1583
  }
1584
1584
  }
1585
- `;var Vc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowSteps:w,getFlowStatus:x,getCurrentStepIndex:g}=J(),{primaryCTAClickSideEffects:A}=pe(),{mergeAppearanceWithDefault:T}=ee();if(Ge(e),n=T(n),Hc(()=>{C(o)},[o,c]),c)return null;let k=d(e);if(!k||f(k)||x(e)===R)return null;let v=w(e)[g(e)];return rt.createElement(rt.Fragment,null,rt.createElement(ne,{appearance:n}),rt.createElement(Ol,{appearance:n,className:Fe(a("embeddedTipContainer",n),r),style:s},(p===!0||v.dismissible)&&rt.createElement(Ll,{onClick:()=>U(void 0,null,function*(){yield l(e),t&&t()}),className:a("embeddedTipDismissButton",n)},rt.createElement(Ne,null)),rt.createElement(Nl,null,rt.createElement(Ie,{size:"small",appearance:n,title:v.title,subtitle:v.subtitle})),v.primaryButtonTitle&&rt.createElement(Il,{className:a("embeddedTipCallToActionContainer",n)},rt.createElement(te,{classPrefix:"embeddedTip",title:v.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>U(void 0,null,function*(){v.handlePrimaryButtonClick(),A(v),!(i&&i(v,g(e),"primary")===!1)&&(yield m(e,v.id),yield l(e))})}))))};import Be,{useEffect as jc}from"react";import po from"styled-components";var $l=po.div`
1585
+ `;var Vc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowSteps:w,getFlowStatus:x,getCurrentStepIndex:g}=Q(),{primaryCTAClickSideEffects:E}=ue(),{mergeAppearanceWithDefault:T}=oe();if(Ge(e),n=T(n),Hc(()=>{C(o)},[o,c]),c)return null;let P=d(e);if(!P||f(P)||x(e)===te)return null;let k=w(e)[g(e)];return it.createElement(it.Fragment,null,it.createElement(se,{appearance:n}),it.createElement(Ol,{appearance:n,className:Te(a("embeddedTipContainer",n),r),style:s},(p===!0||k.dismissible)&&it.createElement($l,{onClick:()=>D(void 0,null,function*(){yield l(e),t&&t()}),className:a("embeddedTipDismissButton",n)},it.createElement(Oe,null)),it.createElement(Il,null,it.createElement(Ie,{size:"small",appearance:n,title:k.title,subtitle:k.subtitle})),k.primaryButtonTitle&&it.createElement(Ll,{className:a("embeddedTipCallToActionContainer",n)},it.createElement(re,{classPrefix:"embeddedTip",title:k.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>D(void 0,null,function*(){k.handlePrimaryButtonClick(),E(k),!(i&&i(k,g(e),"primary")===!1)&&(yield m(e,k.id),yield l(e))})}))))};import ve,{useEffect as jc}from"react";import ao from"styled-components";var Ml=ao.div`
1586
1586
  // use the :not annotation
1587
- ${e=>E(e)} {
1587
+ ${e=>A(e)} {
1588
1588
  display: flex;
1589
1589
  flex-direction: ${e=>e.type==="square"?"column":"row"};
1590
1590
  width: 100%;
@@ -1594,24 +1594,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1594
1594
  background-color: ${e=>e.appearance.theme.colorBackground};
1595
1595
  border-radius: 12px;
1596
1596
  }
1597
- `,Ml=po.div`
1598
- ${e=>E(e)} {
1597
+ `,Dl=ao.div`
1598
+ ${e=>A(e)} {
1599
1599
  display: flex;
1600
1600
  width: 46px;
1601
1601
  height: 46px;
1602
1602
  }
1603
- `,Dl=po.div`
1603
+ `,Ul=ao.div`
1604
1604
  display: flex;
1605
1605
  flex-direction: column;
1606
1606
  flex: 1;
1607
1607
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1608
1608
  margin-top: ${e=>e.type==="square"?"12px":"0"};
1609
- `,Ul=po.div`
1609
+ `,Wl=ao.div`
1610
1610
  display: flex;
1611
1611
  flex-direction: column;
1612
1612
  justify-content: center;
1613
1613
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1614
- `,Xr=po.div`
1614
+ `,Xr=ao.div`
1615
1615
  display: flex;
1616
1616
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1617
1617
  align-items: flex-end;
@@ -1619,12 +1619,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1619
1619
  :hover {
1620
1620
  opacity: 0.8;
1621
1621
  }
1622
- `,Qr=po.div`
1622
+ `,Qr=ao.div`
1623
1623
  display: flex;
1624
1624
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1625
1625
  align-items: flex-end;
1626
1626
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1627
- `;import Zr from"react";var Wl=({style:e,className:t})=>Zr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Zr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Zr.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 Gc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowMetadata:w,getFlowStatus:x,getFlowSteps:g,getCurrentStepIndex:A}=J(),{primaryCTAClickSideEffects:T}=pe(),{mergeAppearanceWithDefault:k}=ee();if(Ge(e),s=k(s),jc(()=>{C(n)},[n,c]),c)return null;let P=l(e);if(!P||f(P)||x(e)===R)return null;let v=g(e),u=v.length>0?v[A(e)]:w(e);return u!=null&&u.title&&(t=u.title),u!=null&&u.subtitle&&(o=u.subtitle),Be.createElement(Be.Fragment,null,Be.createElement(ne,{appearance:s}),Be.createElement($l,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&Be.createElement(Ml,{className:a("bannerIconContainer",s)},d||Be.createElement(Wl,null)),p==="square"&&u.dismissible&&Be.createElement(Qr,{type:p,className:a("bannerDismissButtonContainer",s)},Be.createElement(Xr,{type:p,onClick:()=>U(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},Be.createElement(Ne,null))),Be.createElement(Dl,{type:p},Be.createElement(Ie,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(u==null?void 0:u.primaryButtonTitle)&&Be.createElement(Ul,{type:p,className:a("bannerCallToActionContainer",s)},Be.createElement(te,{title:u==null?void 0:u.primaryButtonTitle,appearance:s,onClick:()=>{T(u),r&&r(u,0,"primary")},classPrefix:"banner"})),p!=="square"&&u.dismissible&&Be.createElement(Qr,{type:p,className:a("bannerDismissButtonContainer",s)},Be.createElement(Xr,{type:p,onClick:()=>U(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},Be.createElement(Ne,null)))))};import oe,{useEffect as Kc}from"react";import{Portal as qc}from"react-portal";import gt from"styled-components";var zl=gt.div`
1627
+ `;import Zr from"react";var zl=({style:e,className:t})=>Zr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Zr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Zr.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 Gc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:C,getFlowMetadata:w,getFlowStatus:x,getFlowSteps:g,getCurrentStepIndex:E}=Q(),{primaryCTAClickSideEffects:T}=ue(),{mergeAppearanceWithDefault:P}=oe();if(Ge(e),s=P(s),jc(()=>{C(n)},[n,c]),c)return null;let B=l(e);if(!B||f(B)||x(e)===te)return null;let k=g(e),u=k.length>0?k[E(e)]:w(e);return u!=null&&u.title&&(t=u.title),u!=null&&u.subtitle&&(o=u.subtitle),ve.createElement(ve.Fragment,null,ve.createElement(se,{appearance:s}),ve.createElement(Ml,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ve.createElement(Dl,{className:a("bannerIconContainer",s)},d||ve.createElement(zl,null)),p==="square"&&u.dismissible&&ve.createElement(Qr,{type:p,className:a("bannerDismissButtonContainer",s)},ve.createElement(Xr,{type:p,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},ve.createElement(Oe,null))),ve.createElement(Ul,{type:p},ve.createElement(Ie,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(u==null?void 0:u.primaryButtonTitle)&&ve.createElement(Wl,{type:p,className:a("bannerCallToActionContainer",s)},ve.createElement(re,{title:u==null?void 0:u.primaryButtonTitle,appearance:s,onClick:()=>{T(u),r&&r(u,0,"primary")},classPrefix:"banner"})),p!=="square"&&u.dismissible&&ve.createElement(Qr,{type:p,className:a("bannerDismissButtonContainer",s)},ve.createElement(Xr,{type:p,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},ve.createElement(Oe,null)))))};import ie,{useEffect as Kc}from"react";import{Portal as qc}from"react-portal";import gt from"styled-components";var _l=gt.div`
1628
1628
  display: flex;
1629
1629
  flex-direction: column;
1630
1630
  width: 100%;
@@ -1646,7 +1646,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1646
1646
  border-width: 1px;
1647
1647
  border-color: ${t=>t.appearance.theme.colorBorder};
1648
1648
  border-radius: ${t=>t.appearance.theme.borderRadius}px;`:""}
1649
- `,_l=gt.button`
1649
+ `,Hl=gt.button`
1650
1650
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1651
1651
  border-radius: 8px;
1652
1652
  // If selected make border color primary and text color color priamry
@@ -1672,7 +1672,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1672
1672
  justify-content: space-between;
1673
1673
  margin-top: 16px;
1674
1674
  gap: 8px;
1675
- `,Hl=gt.div`
1675
+ `,Vl=gt.div`
1676
1676
  display: flex;
1677
1677
  justify-content: space-between;
1678
1678
  margin-top: 8px;
@@ -1687,14 +1687,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1687
1687
  display: flex;
1688
1688
  flex-direction: column;
1689
1689
  flex: 1;
1690
- `,uw=gt.div`
1690
+ `,mw=gt.div`
1691
1691
  display: flex;
1692
1692
  flex-direction: column;
1693
1693
  justify-content: center;
1694
1694
  align-items: flex-start;
1695
1695
  margin-top: 16px;
1696
- `,Vl=gt.textarea`
1697
- ${e=>E(e)} {
1696
+ `,jl=gt.textarea`
1697
+ ${e=>A(e)} {
1698
1698
  color: ${e=>e.appearance.theme.colorText};
1699
1699
  margin-top: 16px;
1700
1700
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
@@ -1706,8 +1706,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1706
1706
  height: 100px;
1707
1707
  resize: none;
1708
1708
  }
1709
- `,jl=gt.div`
1710
- ${e=>E(e)} {
1709
+ `,Gl=gt.div`
1710
+ ${e=>A(e)} {
1711
1711
  position: absolute;
1712
1712
  top: 16px;
1713
1713
  right: 16px;
@@ -1717,8 +1717,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1717
1717
  opacity: 0.8;
1718
1718
  }
1719
1719
  }
1720
- `;var Yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C,updateCustomVariables:w,getFlowSteps:x,getFlowStatus:g,getFlowMetadata:A}=J(),{primaryCTAClickSideEffects:T}=pe(),{mergeAppearanceWithDefault:k}=ee(),[P,v]=oe.useState(null),[u,L]=oe.useState(""),S=A(e),{hasOpenModals:F,setKeepCompletedFlowOpenDuringSession:M,shouldKeepCompletedFlowOpenDuringSession:O}=Oe();if(Ge(e),n=k(n),Kc(()=>{w(o)},[o,f]),f)return null;let I=d(e);if(!I||C(I)||g(e)===R||c(e)===1&&!O(e)||F())return null;let W=x(e)[c(e)];function q(){var H,le;return oe.createElement(oe.Fragment,null,oe.createElement(ti,null,oe.createElement(Ie,{size:"large",appearance:n,title:W.title,subtitle:W.subtitle})),oe.createElement(Rr,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(fe=>oe.createElement(_l,{className:a("npsNumberButton",n),selected:P===fe+1,key:fe,onClick:()=>U(this,null,function*(){M(e),v(fe+1),yield m(e,W.id,{score:fe+1})}),appearance:n},fe+1))),oe.createElement(Hl,{appearance:n},oe.createElement(ei,{appearance:n},(H=S==null?void 0:S.negativeLabel)!=null?H:"Not likely at all"),oe.createElement(ei,{appearance:n},(le=S==null?void 0:S.positiveLabel)!=null?le:"Extremely likely")))}function X(){var H;return oe.createElement(oe.Fragment,null,oe.createElement(ti,null,oe.createElement(Ie,{appearance:n,title:(H=W.title)!=null?H:"Why did you choose this score?",size:"large"})),oe.createElement(Vl,{appearance:n,value:u,onChange:le=>{L(le.target.value)},placeholder:"Add your optional feedback here..."}),oe.createElement(Rr,{appearance:n,className:a("npsNumberButtonContainer",n)},oe.createElement(te,{size:"large",withMargin:!1,onClick:()=>U(this,null,function*(){yield l(e),i&&i(W,1,"primary")}),appearance:n,title:W.secondaryButtonTitle||"Skip",secondary:!0}),oe.createElement(te,{size:"large",withMargin:!1,onClick:()=>U(this,null,function*(){yield m(e,W.id,{feedbackText:u}),yield l(e),i&&i(W,1,"primary")}),appearance:n,title:W.primaryButtonTitle||"Submit"})))}function de(){return c(e)>=2?null:oe.createElement(oe.Fragment,null,oe.createElement(ne,{appearance:n}),oe.createElement(zl,{appearance:n,className:Fe(a("npsSurveyContainer",n),r),style:s,type:p},oe.createElement(jl,{onClick:()=>U(this,null,function*(){yield l(e),t&&t()}),className:a("npsSurveyDismissButton",n)},oe.createElement(Ne,null)),c(e)==0&&q(),c(e)==1&&X()))}return p==="inline"?de():oe.createElement(qc,null,de())};import Ee,{useEffect as Qc}from"react";import Wt from"styled-components";var Gl=Wt.div`
1721
- ${e=>E(e)} {
1720
+ `;var Yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C,updateCustomVariables:w,getFlowSteps:x,getFlowStatus:g,getFlowMetadata:E}=Q(),{primaryCTAClickSideEffects:T}=ue(),{mergeAppearanceWithDefault:P}=oe(),[B,k]=ie.useState(null),[u,L]=ie.useState(""),b=E(e),{hasOpenModals:F,setKeepCompletedFlowOpenDuringSession:$,shouldKeepCompletedFlowOpenDuringSession:N}=Ne();if(Ge(e),n=P(n),Kc(()=>{w(o)},[o,f]),f)return null;let O=d(e);if(!O||C(O)||g(e)===te||c(e)===1&&!N(e)||F())return null;let W=x(e)[c(e)];function J(){var q,Y;return ie.createElement(ie.Fragment,null,ie.createElement(ti,null,ie.createElement(Ie,{size:"large",appearance:n,title:W.title,subtitle:W.subtitle})),ie.createElement(Rr,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(de=>ie.createElement(Hl,{className:a("npsNumberButton",n),selected:B===de+1,key:de,onClick:()=>D(this,null,function*(){$(e),k(de+1),yield m(e,W.id,{score:de+1})}),appearance:n},de+1))),ie.createElement(Vl,{appearance:n},ie.createElement(ei,{appearance:n},(q=b==null?void 0:b.negativeLabel)!=null?q:"Not likely at all"),ie.createElement(ei,{appearance:n},(Y=b==null?void 0:b.positiveLabel)!=null?Y:"Extremely likely")))}function R(){var q;return ie.createElement(ie.Fragment,null,ie.createElement(ti,null,ie.createElement(Ie,{appearance:n,title:(q=W.title)!=null?q:"Why did you choose this score?",size:"large"})),ie.createElement(jl,{appearance:n,value:u,onChange:Y=>{L(Y.target.value)},placeholder:"Add your optional feedback here..."}),ie.createElement(Rr,{appearance:n,className:a("npsNumberButtonContainer",n)},ie.createElement(re,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield l(e),i&&i(W,1,"primary")}),appearance:n,title:W.secondaryButtonTitle||"Skip",secondary:!0}),ie.createElement(re,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield m(e,W.id,{feedbackText:u}),yield l(e),i&&i(W,1,"primary")}),appearance:n,title:W.primaryButtonTitle||"Submit"})))}function pe(){return c(e)>=2?null:ie.createElement(ie.Fragment,null,ie.createElement(se,{appearance:n}),ie.createElement(_l,{appearance:n,className:Te(a("npsSurveyContainer",n),r),style:s,type:p},ie.createElement(Gl,{onClick:()=>D(this,null,function*(){yield l(e),t&&t()}),className:a("npsSurveyDismissButton",n)},ie.createElement(Oe,null)),c(e)==0&&J(),c(e)==1&&R()))}return p==="inline"?pe():ie.createElement(qc,null,pe())};import Be,{useEffect as Qc}from"react";import Ut from"styled-components";var Kl=Ut.div`
1721
+ ${e=>A(e)} {
1722
1722
  display: flex;
1723
1723
  flex-direction: column;
1724
1724
  width: 100%;
@@ -1728,22 +1728,22 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1728
1728
  background-color: ${e=>e.appearance.theme.colorBackground};
1729
1729
  position: relative;
1730
1730
  }
1731
- `,Kl=Wt.div`
1731
+ `,ql=Ut.div`
1732
1732
  display: flex;
1733
1733
  flex-direction: column;
1734
1734
  flex: 1;
1735
- `,ql=Wt.div`
1735
+ `,Yl=Ut.div`
1736
1736
  display: flex;
1737
1737
  flex-direction: row;
1738
1738
  justify-content: center;
1739
1739
  align-items: stretch;
1740
1740
  gap: 16px;
1741
1741
  margin-top: 8px;
1742
- `,Yl=Wt.div`
1742
+ `,Jl=Ut.div`
1743
1743
  margin-top: 16px;
1744
1744
  margin-bottom: 16px;
1745
- `,Jl=Wt.div`
1746
- ${e=>E(e)} {
1745
+ `,Xl=Ut.div`
1746
+ ${e=>A(e)} {
1747
1747
  position: absolute;
1748
1748
  top: -16px;
1749
1749
  right: -16px;
@@ -1753,8 +1753,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1753
1753
  opacity: 0.8;
1754
1754
  }
1755
1755
  }
1756
- `,Xl=Wt.h1`
1757
- ${e=>E(e)} {
1756
+ `,Ql=Ut.h1`
1757
+ ${e=>A(e)} {
1758
1758
  font-style: normal;
1759
1759
  justify-content: center;
1760
1760
  text-align: center;
@@ -1767,8 +1767,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1767
1767
  color: ${e=>e.appearance.theme.colorText};
1768
1768
  margin-bottom: 8px;
1769
1769
  }
1770
- `,Ql=Wt.h2`
1771
- ${e=>E(e)} {
1770
+ `,Zl=Ut.h2`
1771
+ ${e=>A(e)} {
1772
1772
  font-style: normal;
1773
1773
  justify-content: center;
1774
1774
  text-align: center;
@@ -1779,10 +1779,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map
1779
1779
  letter-spacing: 0.28px;
1780
1780
  margin-bottom: 8px;
1781
1781
  }
1782
- `;import Zl from"react";import Jc from"styled-components";var Xc=Jc.img`
1782
+ `;import Rl from"react";import Jc from"styled-components";var Xc=Jc.img`
1783
1783
  width: 100%;
1784
1784
  height: 100%;
1785
1785
  min-height: 200px;
1786
1786
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
1787
- `;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(et,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Xc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Zc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C,updateCustomVariables:w,getFlowSteps:x,getFlowStatus:g,getCurrentStepIndex:A}=J(),{primaryCTAClickSideEffects:T,secondaryCTAClickSideEffects:k}=pe(),{mergeAppearanceWithDefault:P}=ee(),{setOpenFlowState:v,getOpenFlowState:u,hasOpenModals:L}=Oe();Ge(e);let[S,F]=[u(e,!0),X=>v(e,X)];if(n=P(n),Qc(()=>{w(o)},[o,f]),f)return null;let M=l(e);if(!M||C(M)||g(e)===R||L())return null;let I=x(e)[A(e)],V=()=>{F(!1),t&&t(),m(e)};function W(){return Ee.createElement(Ee.Fragment,null,Ee.createElement(ne,{appearance:n}),Ee.createElement(Gl,{appearance:n,className:Fe(a("announcementContainer",n),r),style:s},(p===!0||I.dismissible)&&d=="inline"&&Ee.createElement(Jl,{onClick:()=>U(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},Ee.createElement(Ne,null)),Ee.createElement(Kl,null,Ee.createElement(Xl,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:ae(I.title)}),I.subtitle&&Ee.createElement(Ql,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:ae(I.subtitle)})),(I.imageUri||I.videoUri)&&Ee.createElement(Yl,{className:a("announcementMediaContainer",n)},Ee.createElement(Rl,{appearance:n,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&Ee.createElement(ql,{className:a("announcementCTAContainer",n)},I.secondaryButtonTitle&&Ee.createElement(te,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>U(this,null,function*(){I.handleSecondaryButtonClick(),k(I),i&&i(I,A(e),"secondary")}),secondary:!0}),I.primaryButtonTitle&&Ee.createElement(te,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>U(this,null,function*(){I.handlePrimaryButtonClick(),T(I),!(i&&i(I,A(e),"primary")===!1)&&(yield c(e,I.id),yield m(e))})}))))}let q={padding:"24px",maxWidth:"400px"};return d==="inline"?W():d!=="center"?Ee.createElement(_o,{modalPosition:d,onClose:V,visible:S,dismissible:p,appearance:n},W()):Ee.createElement(Ze,{appearance:n,onClose:V,visible:S,style:q,dismissible:p},W())};import*as cr from"react";import ea from"react";var ta=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Le(r,["as","children","variant"]);return ea.createElement(Pn,b({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Rc=Object.fromEntries(Object.keys(Zo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ea.createElement(ta,j(b({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),oi=Object.assign(ta,Rc);var oa=s=>{var p=s,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Le(p,["as","className","size","title","variant"]);var d;return cr.createElement(kn,b({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),cr.createElement(oi,{color:(d=Po[n])==null?void 0:d.color,fontWeight:"semibold"},i))},em=Object.fromEntries(Object.keys(Po).map(e=>{let t=o=>cr.createElement(oa,j(b({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),tm=Object.assign(oa,em);export{ko as Box,tm as Button,pt as CheckBox,fr as FlowType,St as FormLabel,Pr as FormTextField,Zc as FrigadeAnnouncement,Gc as FrigadeBanner,qr as FrigadeChecklist,at as FrigadeDefaultAppearance,Vc as FrigadeEmbeddedTip,xn as FrigadeForm,Sc as FrigadeGuide,hc as FrigadeHeroChecklist,Yc as FrigadeNPSSurvey,Cc as FrigadeProgressBadge,Pd as FrigadeProvider,_c as FrigadeSupportWidget,Mc as FrigadeTour,_e as ProgressBar,qt as ProgressRing,oi as Text,Ur as tokens,Oe as useFlowOpens,go as useFlowResponses,J as useFlows,Dr as useOrganization,ho as useUser,We as useUserFlowStates};
1787
+ `;function ea({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Rl.createElement(tt,{appearance:t,videoUri:e.videoUri}):e.imageUri?Rl.createElement(Xc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Zc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:f,targetingLogicShouldHideFlow:C,updateCustomVariables:w,getFlowSteps:x,getFlowStatus:g,getCurrentStepIndex:E}=Q(),{primaryCTAClickSideEffects:T,secondaryCTAClickSideEffects:P}=ue(),{mergeAppearanceWithDefault:B}=oe(),{setOpenFlowState:k,getOpenFlowState:u,hasOpenModals:L}=Ne();Ge(e);let[b,F]=[u(e,!0),R=>k(e,R)];if(n=B(n),Qc(()=>{w(o)},[o,f]),f)return null;let $=l(e);if(!$||C($)||g(e)===te||L())return null;let O=x(e)[E(e)],V=()=>{F(!1),t&&t(),m(e)};function W(){return Be.createElement(Be.Fragment,null,Be.createElement(se,{appearance:n}),Be.createElement(Kl,{appearance:n,className:Te(a("announcementContainer",n),r),style:s},(p===!0||O.dismissible)&&d=="inline"&&Be.createElement(Xl,{onClick:()=>D(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},Be.createElement(Oe,null)),Be.createElement(ql,null,Be.createElement(Ql,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:ce(O.title)}),O.subtitle&&Be.createElement(Zl,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:ce(O.subtitle)})),(O.imageUri||O.videoUri)&&Be.createElement(Jl,{className:a("announcementMediaContainer",n)},Be.createElement(ea,{appearance:n,stepData:O})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&Be.createElement(Yl,{className:a("announcementCTAContainer",n)},O.secondaryButtonTitle&&Be.createElement(re,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handleSecondaryButtonClick(),P(O),i&&i(O,E(e),"secondary")}),secondary:!0}),O.primaryButtonTitle&&Be.createElement(re,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handlePrimaryButtonClick(),T(O),!(i&&i(O,E(e),"primary")===!1)&&(yield c(e,O.id),yield m(e))})}))))}let J={padding:"24px",maxWidth:"400px"};return d==="inline"?W():d!=="center"?Be.createElement(zo,{modalPosition:d,onClose:V,visible:b,dismissible:p,appearance:n},W()):Be.createElement(Re,{appearance:n,onClose:V,visible:b,style:J,dismissible:p},W())};import*as cr from"react";import ta from"react";var oa=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Le(r,["as","children","variant"]);return ta.createElement(vn,S({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Rc=Object.fromEntries(Object.keys(Qo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ta.createElement(oa,j(S({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),oi=Object.assign(oa,Rc);var ra=s=>{var p=s,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Le(p,["as","className","size","title","variant"]);var d;return cr.createElement(Pn,S({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),cr.createElement(oi,{color:(d=ko[n])==null?void 0:d.color,fontWeight:"semibold"},i))},em=Object.fromEntries(Object.keys(ko).map(e=>{let t=o=>cr.createElement(ra,j(S({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),tm=Object.assign(ra,em);export{Fo as Box,tm as Button,pt as CheckBox,fr as FlowType,St as FormLabel,Pr as FormTextField,Zc as FrigadeAnnouncement,Gc as FrigadeBanner,qr as FrigadeChecklist,at as FrigadeDefaultAppearance,Vc as FrigadeEmbeddedTip,Cn as FrigadeForm,Sc as FrigadeGuide,hc as FrigadeHeroChecklist,Yc as FrigadeNPSSurvey,Cc as FrigadeProgressBadge,Pd as FrigadeProvider,_c as FrigadeSupportWidget,Mc as FrigadeTour,_e as ProgressBar,Kt as ProgressRing,oi as Text,Ur as tokens,Ne as useFlowOpens,fo as useFlowResponses,Q as useFlows,Dr as useOrganization,go as useUser,We as useUserFlowStates};
1788
1788
  //# sourceMappingURL=index.mjs.map