@frigade/react 1.35.17 → 1.35.19
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/README.md +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +89 -89
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +242 -242
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import{ThemeProvider as Kp}from"styled-components";import bt,{useContext as Sp,useEffect as Lo,useState as Sr}from"react";import{useCallback as ht,useContext as Vl,useEffect as Gl}from"react";import Yo,{useMemo as _r}from"react";var Wr="1.35.17 ";var Ne="NOT_STARTED_STEP",q="COMPLETED_FLOW",xo="ABORTED_FLOW",xt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",ho="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=Yo.useContext(K);return{config:_r(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Wr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:_r(()=>`${o}/v1/public/`,[o])}}var Nl="frigade-last-call-at-",Ol="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Yo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let r=Nl+o,n=Ol+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return It()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return It(p)}return s?s.ok?s:It(s.statusText):It()}}function It(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ot(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Yo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as _l,useState as Hr}from"react";import{useContext as Dl,useEffect as $l,useState as Ml}from"react";import Ul from"swr";import{useContext as Ll}from"react";function we(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Ll(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(b=>({...b,[d]:x}))}function p(d){t(x=>{let{[d]:b,...h}=x;return{...h}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,b])=>b&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import zl from"swr/immutable";var Wl="unknown";function Be(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Dl(K),{resetOpenFlowState:c}=we(),[l,g]=Ml(!1),d={data:n.map(k=>({flowId:k.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=k=>fetch(k,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${k}: ${P}. Will gracefully degrade and hide Frigade`),s(!0),d)),b=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:h,isLoading:T,mutate:f,error:B}=p?zl(b,x):Ul(b,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=h==null?void 0:h.data;$l(()=>{!l&&!T&&w&&g(!0)},[w,l,T]);async function S(k){if(w&&!p){let P=w.find(O=>O.flowId===k);P&&P.flowState!==q&&(P.flowState=q),await f(Promise.resolve({...h,data:w}),{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function A(k,P,O){if(w){let I=w.find(N=>N.flowId===k);I&&(I.stepStates[P]=O,I.flowState=xt),await f(Promise.resolve({...h,data:w}),{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function y(k,P,O){if(w){let I=w.find(N=>N.flowId===k);I&&(I.lastStepId=P,I.stepStates[P]=O,I.flowState=xt),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function m(k){if(w){let P=w.find(O=>O.flowId===k);P&&P.flowState!==Me&&(P.flowState=Me,P.lastStepId=Wl,Object.keys(P.stepStates).forEach(O=>{P.stepStates[O].actionType=Ne,P.stepStates[O].createdAt=new Date().toISOString()}),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1}),c(k))}}async function E(k,P){if(w){let O=w.find(I=>I.flowId===k);O&&O.stepStates[P]!==Ne&&(O.stepStates[P]=Ne),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!l,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:E,optimisticallyMarkStepStarted:y,error:B}}function Xt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=_l(K),[c,l]=Hr(new Set),[g,d]=Hr(new Set),x=Nt();function b(f){let B=JSON.stringify(f);if(c.has(B))return null;c.add(B),l(c),g.add(f),d(g);let w=s==null?void 0:s.find(S=>S.flowSlug===f.flowSlug&&S.stepId===f.stepId&&S.actionType===f.actionType&&S.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:B}).then(S=>{S.status!==200&&S.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):w||p(A=>[...A??[],f])})}async function h(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Me?await b(f):f.actionType===q?await b(f):f.actionType===ho?await b(f):f.actionType===Ue?await b(f):f.actionType===xo?await b(f):f.actionType===Ne&&await b(f))}function T(){let f=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let w in B.stepStates){let S=B.stepStates[w];f.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:S.stepId,actionType:S.actionType,data:{},createdAt:new Date(S.createdAt),blocked:S.blocked,hidden:S.hidden})}}),[...f,...s]}return{addResponse:h,setFlowResponses:p,getFlowResponses:T}}import Kl from"swr";var Hl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,jr=e=>{let t=Hl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=jl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},jl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Xo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Jo=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(Jo||{});function Y(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Vl(K),b={data:[]},{verifySDKInitiated:h}=Ot(),{addResponse:T,getFlowResponses:f}=Xt(),B=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),b)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),b)),{mutateUserFlowState:w,userFlowStatesData:S,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:k,optimisticallyMarkStepStarted:P}=Be(),{data:O,error:I,isLoading:N}=Kl(n?`${t}flows${x?"?readonly=true":""}`:null,B,{keepPreviousData:!0});Gl(()=>{if(I){console.error(I);return}O&&O.data&&i(O.data)},[O,I]);function $(u){if(N)return null;let C=o.find(v=>v.slug===u);return!C&&o.length>0&&!A&&!N?(console.log(`Flow with id ${u} not found`),null):(C==null?void 0:C.active)===!1?null:C}function D(u){var W;if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),(((W=Xo(C))==null?void 0:W.data)??[]).map(M=>{let $e=se(M);return{handleSecondaryButtonClick:()=>{M.skippable===!0&&j(u,M.id,{skipped:!0})},...M,complete:ge(u,M.id)===Ue||$e>=1,blocked:re(u,M.id),hidden:L(u,M.id),handlePrimaryButtonClick:()=>{(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&j(u,M.id)},progress:$e}}).filter(M=>M.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(C,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function U(u){if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),JSON.parse(C)??{}):[]}function te(u,C){p(v=>({...v,[u]:C}))}function fe(u){!A&&!N&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{te(C,u[C])})}let X=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:ho,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await P(u,C,W),T(W))},[r,S]),H=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ne,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await k(u,C),T(W))},[r,S]),j=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ue,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await E(u,C,W),T(W))},[r,S]),Ce=ht(async(u,C)=>{if(!h()||pe(u)===Me)return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),J(v)&&T(v)},[r,S]),Ie=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&T(v)},[r,S]),be=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await y(u),T(v))},[r,S]),me=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xo,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await y(u),T(v))},[r,S]);function J(u){var C;if(!S&&u.actionType===Ne)return!1;if(S){let v=S.find(W=>W.flowId===u.flowSlug);if(u.actionType===Ne&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Ne)||v&&((C=v.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType||v&&v.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,C){let v=V(u,C);return A?null:v?v.actionType:Ne}function re(u,C){let v=V(u,C);return v?v.blocked:!1}function L(u,C){let v=V(u,C);return v?v.hidden:!1}function V(u,C){if(A)return null;let v=S==null?void 0:S.find(W=>W.flowId===u);return!v||!v.stepStates[C]?null:v.stepStates[C]??null}function G(u){var v;if(A||!S)return null;if(pe(u)===Me)return D(u)[0]??null;let C=(v=S.find(W=>W.flowId===u))==null?void 0:v.lastStepId;return C?D(u).find(W=>W.id===C):null}function ne(u){let C=G(u);if(!C)return 0;let v=D(u).findIndex(W=>W.id===C.id)??0;return ge(u,C.id)===Ue&&v<D(u).length-1?v+1:v}function se(u){if(!u.completionCriteria)return;let C=jr(u.completionCriteria);if(C===null)return;let v=Ye(C),W=De(C);return W===0?void 0:v/W}function pe(u){let C=S==null?void 0:S.find(v=>v.flowId===u);return C?C.flowState:null}function Ye(u){let C=D(u);return C.length===0?0:C.filter(W=>ge(u,W.id)===Ue).length}function De(u){return D(u).length}function Et(u){let C=o.find(v=>v.slug===u);return C?Xo(C.data):null}function ft(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&S){let C=S.find(v=>v.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function At(u){return!ft($(u))}function gt(){r&&w()}return{getFlow:$,getFlowData:Et,isLoading:A||N,getStepStatus:ge,getFlowSteps:D,getCurrentStepIndex:ne,markStepStarted:X,markStepCompleted:j,markFlowNotStarted:Ce,markFlowStarted:Ie,markFlowCompleted:be,markFlowAborted:me,markStepNotStarted:H,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:De,targetingLogicShouldHideFlow:ft,setCustomVariable:te,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:U,isStepBlocked:re,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as Qo,useContext as ql,useEffect as Yl}from"react";var Lt="guest_";function Jt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=ql(K),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Be(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(h){return`frigade-user-registered-${h}`}Yl(()=>{if(e&&!t){if(e.startsWith(Lt))return;let h=g(e);localStorage.getItem(h)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(h,"true"))}},[e,r,t]);let d=Qo(async h=>{if(!l())return;let T={foreignId:e,properties:h};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(T)}),i(f=>({...f,...h})),p()},[e,n,r,p]),x=Qo(async(h,T)=>{if(!l())return;let B={foreignId:e,events:[{event:h,properties:T}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),p()},[e,n,p]),b=Qo(async(h,T)=>{if(l())if(T){let f=g(h);localStorage.setItem(f,"true"),o(h);let B={foreignId:h,properties:T};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),i(w=>({...w,...T})),p()}else o(h)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:b,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as bp}from"uuid";import Ge,{useEffect as xp,useState as hp}from"react";import ze,{useEffect as or,useState as ra}from"react";import So from"styled-components";import Xl from"react";import Jl from"styled-components";var Vr="fr-",Qt="cfr-";function a(e,t){let o=`${Vr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Qt+e}return o}function F(e){if(!e.className||e.className.indexOf(Qt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Vr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Zo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Zo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Zt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ql=Jl.div`
|
|
2
|
+
import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import{ThemeProvider as Kp}from"styled-components";import bt,{useContext as Sp,useEffect as Lo,useState as br}from"react";import{useCallback as ht,useContext as Gl,useEffect as Kl}from"react";import Yo,{useMemo as Hr}from"react";var _r="1.35.19 ";var Ne="NOT_STARTED_STEP",q="COMPLETED_FLOW",xo="ABORTED_FLOW",xt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",ho="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=Yo.useContext(K);return{config:Hr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":_r,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Hr(()=>`${o}/v1/public/`,[o])}}var Ol="frigade-last-call-at-",Ll="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Yo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let r=Ol+o,n=Ll+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return It()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return It(p)}return s?s.ok?s:It(s.statusText):It()}}function It(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ot(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Yo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Hl,useState as jr}from"react";import{useContext as $l,useEffect as Ml,useState as Ul}from"react";import zl from"swr";import{useContext as Dl}from"react";function we(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Dl(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(F=>({...F,[d]:x}))}function p(d){t(x=>{let{[d]:F,...C}=x;return{...C}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,F])=>F&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Wl from"swr/immutable";var _l="unknown";function Be(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=$l(K),{resetOpenFlowState:c}=we(),[l,g]=Ul(!1),d={data:n.map(T=>({flowId:T.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=T=>fetch(T,e).then(B=>{if(B.ok)return B.json();throw new Error("Failed to fetch user flow states")}).catch(B=>(console.log(`Error fetching ${T}: ${B}. Will gracefully degrade and hide Frigade`),s(!0),d)),F=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:C,isLoading:S,mutate:f,error:v}=p?Wl(F,x):zl(F,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=C==null?void 0:C.data;Ml(()=>{!l&&!S&&w&&g(!0)},[w,l,S]);async function b(T){if(w&&!p){let B=w.find(L=>L.flowId===T);B&&B.flowState!==q&&(B.flowState=q),await f(Promise.resolve({...C,data:w}),{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1})}}async function A(T,B,L){if(w){let N=w.find(I=>I.flowId===T);N&&(N.stepStates[B]=L,N.flowState=xt),await f(Promise.resolve({...C,data:w}),{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1})}}async function y(T,B,L){if(w){let N=w.find(I=>I.flowId===T);N&&(N.lastStepId=B,N.stepStates[B]=L,N.flowState=xt),await f({...C,data:w},{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1})}}async function m(T){if(w){let B=w.find(L=>L.flowId===T);B&&B.flowState!==Me&&(B.flowState=Me,B.lastStepId=_l,Object.keys(B.stepStates).forEach(L=>{B.stepStates[L].actionType=Ne,B.stepStates[L].createdAt=new Date().toISOString()}),await f({...C,data:w},{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1}),c(T))}}async function E(T,B){if(w){let L=w.find(N=>N.flowId===T);L&&L.stepStates[B]!==Ne&&(L.stepStates[B]=Ne),await f({...C,data:w},{optimisticData:{...C,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!l,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:b,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:E,optimisticallyMarkStepStarted:y,error:v}}function Xt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Hl(K),[c,l]=jr(new Set),[g,d]=jr(new Set),x=Nt();function F(f){let v=JSON.stringify(f);if(c.has(v))return null;c.add(v),l(c),g.add(f),d(g);let w=s==null?void 0:s.find(b=>b.flowSlug===f.flowSlug&&b.stepId===f.stepId&&b.actionType===f.actionType&&b.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:v}).then(b=>{b.status!==200&&b.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):w||p(A=>[...A??[],f])})}async function C(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Me?await F(f):f.actionType===q?await F(f):f.actionType===ho?await F(f):f.actionType===Ue?await F(f):f.actionType===xo?await F(f):f.actionType===Ne&&await F(f))}function S(){let f=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let w in v.stepStates){let b=v.stepStates[w];f.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:b.stepId,actionType:b.actionType,data:{},createdAt:new Date(b.createdAt),blocked:b.blocked,hidden:b.hidden})}}),[...f,...s]}return{addResponse:C,setFlowResponses:p,getFlowResponses:S}}import ql from"swr";var jl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Vr=e=>{let t=jl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Vl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Vl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Xo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Jo=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(Jo||{});function Y(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Gl(K),F={data:[]},{verifySDKInitiated:C}=Ot(),{addResponse:S,getFlowResponses:f}=Xt(),v=u=>fetch(u,e).then(h=>h.ok?h.json():(console.log(`Error fetching ${u} (${h.status}): ${h.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),F)).catch(h=>(console.log(`Error fetching ${u}: ${h}. Will gracefully degrade and hide Frigade`),d(!0),F)),{mutateUserFlowState:w,userFlowStatesData:b,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:T,optimisticallyMarkStepStarted:B}=Be(),{data:L,error:N,isLoading:I}=ql(n?`${t}flows${x?"?readonly=true":""}`:null,v,{keepPreviousData:!0});Kl(()=>{if(N){console.error(N);return}L&&L.data&&i(L.data)},[L,N]);function $(u){if(I)return null;let h=o.find(P=>P.slug===u);return!h&&o.length>0&&!A&&!I?(console.log(`Flow with id ${u} not found`),null):(h==null?void 0:h.active)===!1?null:h}function D(u){var W;if(!$(u))return[];let h=$(u).data;return h?(h=ee(h),(((W=Xo(h))==null?void 0:W.data)??[]).map(M=>{let $e=se(M);return{handleSecondaryButtonClick:()=>{M.skippable===!0&&j(u,M.id,{skipped:!0})},...M,complete:ge(u,M.id)===Ue||$e>=1,blocked:re(u,M.id),hidden:O(u,M.id),handlePrimaryButtonClick:()=>{(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&j(u,M.id)},progress:$e}}).filter(M=>M.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(h,P)=>s[P]===void 0?"":String(s[P]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function U(u){if(!$(u))return[];let h=$(u).data;return h?(h=ee(h),JSON.parse(h)??{}):[]}function te(u,h){p(P=>({...P,[u]:h}))}function fe(u){!A&&!I&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(h=>{te(h,u[h])})}let X=ht(async(u,h,P)=>{if(!C())return;let W={foreignUserId:r,flowSlug:u,stepId:h,actionType:ho,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await B(u,h,W),S(W))},[r,b]),H=ht(async(u,h,P)=>{if(!C())return;let W={foreignUserId:r,flowSlug:u,stepId:h,actionType:Ne,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await T(u,h),S(W))},[r,b]),j=ht(async(u,h,P)=>{if(!C())return;let W={foreignUserId:r,flowSlug:u,stepId:h,actionType:Ue,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await E(u,h,W),S(W))},[r,b]),Ce=ht(async(u,h)=>{if(!C()||pe(u)===Me)return;let P={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),J(P)&&S(P)},[r,b]),Ie=ht(async(u,h)=>{if(!C())return;let P={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&S(P)},[r,b]),be=ht(async(u,h)=>{if(!C())return;let P={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&(await y(u),S(P))},[r,b]),me=ht(async(u,h)=>{if(!C())return;let P={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xo,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};J(P)&&(await y(u),S(P))},[r,b]);function J(u){var h;if(!b&&u.actionType===Ne)return!1;if(b){let P=b.find(W=>W.flowId===u.flowSlug);if(u.actionType===Ne&&(!(P!=null&&P.stepStates[u.stepId])||P.stepStates[u.stepId].actionType===Ne)||P&&((h=P.stepStates[u.stepId])==null?void 0:h.actionType)===u.actionType||P&&P.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,h){let P=V(u,h);return A?null:P?P.actionType:Ne}function re(u,h){let P=V(u,h);return P?P.blocked:!1}function O(u,h){let P=V(u,h);return P?P.hidden:!1}function V(u,h){if(A)return null;let P=b==null?void 0:b.find(W=>W.flowId===u);return!P||!P.stepStates[h]?null:P.stepStates[h]??null}function G(u){var P;if(A||!b)return null;if(pe(u)===Me)return D(u)[0]??null;let h=(P=b.find(W=>W.flowId===u))==null?void 0:P.lastStepId;return h?D(u).find(W=>W.id===h):null}function ne(u){let h=G(u);if(!h)return 0;let P=D(u).findIndex(W=>W.id===h.id)??0;return ge(u,h.id)===Ue&&P<D(u).length-1?P+1:P}function se(u){if(!u.completionCriteria)return;let h=Vr(u.completionCriteria);if(h===null)return;let P=Ye(h),W=De(h);return W===0?void 0:P/W}function pe(u){let h=b==null?void 0:b.find(P=>P.flowId===u);return h?h.flowState:null}function Ye(u){let h=D(u);return h.length===0?0:h.filter(W=>ge(u,W.id)===Ue).length}function De(u){return D(u).length}function Et(u){let h=o.find(P=>P.slug===u);return h?Xo(h.data):null}function ft(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&b){let h=b.find(P=>P.flowId===u.slug);if(h)return h.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function At(u){return!ft($(u))}function gt(){r&&w()}return{getFlow:$,getFlowData:Et,isLoading:A||I,getStepStatus:ge,getFlowSteps:D,getCurrentStepIndex:ne,markStepStarted:X,markStepCompleted:j,markFlowNotStarted:Ce,markFlowStarted:Ie,markFlowCompleted:be,markFlowAborted:me,markStepNotStarted:H,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:De,targetingLogicShouldHideFlow:ft,setCustomVariable:te,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:U,isStepBlocked:re,isStepHidden:O,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as Qo,useContext as Yl,useEffect as Xl}from"react";var Lt="guest_";function Jt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Yl(K),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Be(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(C){return`frigade-user-registered-${C}`}Xl(()=>{if(e&&!t){if(e.startsWith(Lt))return;let C=g(e);localStorage.getItem(C)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(C,"true"))}},[e,r,t]);let d=Qo(async C=>{if(!l())return;let S={foreignId:e,properties:C};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),i(f=>({...f,...C})),p()},[e,n,r,p]),x=Qo(async(C,S)=>{if(!l())return;let v={foreignId:e,events:[{event:C,properties:S}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),p()},[e,n,p]),F=Qo(async(C,S)=>{if(l())if(S){let f=g(C);localStorage.setItem(f,"true"),o(C);let v={foreignId:C,properties:S};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(v)}),i(w=>({...w,...S})),p()}else o(C)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:F,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as bp}from"uuid";import Ge,{useEffect as xp,useState as hp}from"react";import ze,{useEffect as or,useState as ia}from"react";import So from"styled-components";import Jl from"react";import Ql from"styled-components";var Gr="fr-",Qt="cfr-";function a(e,t){let o=`${Gr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Qt+e}return o}function k(e){if(!e.className||e.className.indexOf(Qt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Gr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Zo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Zo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Zt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Zl=Ql.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>k(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -23,12 +23,12 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,Kr=({onClose:e,appearance:t})=>Jl.createElement(Zl,{className:a("modalBackground",t),onClick:()=>e()});import Ro from"react";import Rl from"styled-components";var ea=Rl.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Te=()=>Ro.createElement(
|
|
31
|
-
${e=>
|
|
30
|
+
`,Te=()=>Ro.createElement(ea,null,Ro.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Ro.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as na}from"react-portal";import ni from"react";import er from"react";function ta({style:e,className:t}){return er.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},er.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),er.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var qr=ta;import tr from"styled-components";import Xe from"styled-components";var Co=Xe.div`
|
|
31
|
+
${e=>k(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -38,7 +38,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
z-index: ${e=>e.zIndex};
|
|
40
40
|
overflow: hidden;
|
|
41
|
-
`,
|
|
41
|
+
`,oa=`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
@@ -50,58 +50,58 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
50
50
|
right: 12px;
|
|
51
51
|
:hover {
|
|
52
52
|
opacity: 0.8;
|
|
53
|
-
}`,
|
|
53
|
+
}`,ra=`
|
|
54
54
|
display: block;
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
position: absolute;
|
|
57
57
|
top: 12px;
|
|
58
58
|
right: 12px;
|
|
59
|
-
`,
|
|
60
|
-
${e=>
|
|
61
|
-
${e=>e.hasImage?
|
|
59
|
+
`,Yr=Xe.div`
|
|
60
|
+
${e=>k(e)} {
|
|
61
|
+
${e=>e.hasImage?oa:ra};
|
|
62
62
|
}
|
|
63
|
-
`,
|
|
64
|
-
${e=>
|
|
63
|
+
`,Xr=Xe.img`
|
|
64
|
+
${e=>k(e)} {
|
|
65
65
|
display: block;
|
|
66
66
|
width: 100%;
|
|
67
67
|
height: auto;
|
|
68
68
|
min-height: 200px;
|
|
69
69
|
object-fit: cover;
|
|
70
70
|
}
|
|
71
|
-
`,
|
|
72
|
-
${e=>
|
|
71
|
+
`,Jr=Xe.div`
|
|
72
|
+
${e=>k(e)} {
|
|
73
73
|
display: block;
|
|
74
74
|
width: 100%;
|
|
75
75
|
height: auto;
|
|
76
76
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
77
77
|
object-fit: cover;
|
|
78
78
|
}
|
|
79
|
-
`,
|
|
79
|
+
`,Qr=Xe.div`
|
|
80
80
|
display: flex;
|
|
81
81
|
flex-direction: row;
|
|
82
82
|
justify-content: space-between;
|
|
83
83
|
align-content: center;
|
|
84
|
-
`,Qr=Xe.div`
|
|
85
|
-
padding: 22px 22px 12px;
|
|
86
84
|
`,Zr=Xe.div`
|
|
85
|
+
padding: 22px 22px 12px;
|
|
86
|
+
`,Rr=Xe.div`
|
|
87
87
|
display: flex;
|
|
88
88
|
flex: 1;
|
|
89
89
|
flex-direction: column;
|
|
90
90
|
justify-content: center;
|
|
91
|
-
`,
|
|
91
|
+
`,ei=Xe.div`
|
|
92
92
|
display: flex;
|
|
93
93
|
flex: 2;
|
|
94
94
|
flex-shrink: 1;
|
|
95
95
|
gap: 8px;
|
|
96
96
|
height: 64px;
|
|
97
|
-
${e=>
|
|
97
|
+
${e=>k(e)} {
|
|
98
98
|
flex-direction: row;
|
|
99
99
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
100
100
|
align-content: center;
|
|
101
101
|
align-items: center;
|
|
102
102
|
}
|
|
103
|
-
`,
|
|
104
|
-
${e=>
|
|
103
|
+
`,ti=Xe.p`
|
|
104
|
+
${e=>k(e)} {
|
|
105
105
|
font-style: normal;
|
|
106
106
|
font-weight: 600;
|
|
107
107
|
font-size: 15px;
|
|
@@ -109,7 +109,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
109
109
|
color: #808080;
|
|
110
110
|
}
|
|
111
111
|
margin: 0;
|
|
112
|
-
`;var
|
|
112
|
+
`;var oi=tr.div`
|
|
113
113
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
114
114
|
position: absolute;
|
|
115
115
|
bottom: -47px;
|
|
@@ -120,7 +120,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
120
120
|
align-items: center;
|
|
121
121
|
justify-content: center;
|
|
122
122
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
123
|
-
`,
|
|
123
|
+
`,ri=tr(Co)`
|
|
124
124
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
125
125
|
position: absolute;
|
|
126
126
|
bottom: -60px;
|
|
@@ -133,7 +133,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
133
133
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
134
134
|
padding: 0;
|
|
135
135
|
z-index: ${e=>e.zIndex};
|
|
136
|
-
`,
|
|
136
|
+
`,ii=tr.div`
|
|
137
137
|
display: flex;
|
|
138
138
|
justify-content: center;
|
|
139
139
|
align-items: center;
|
|
@@ -142,8 +142,8 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
142
142
|
font-size: 12px;
|
|
143
143
|
line-height: 18px;
|
|
144
144
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
145
|
-
`;function yo({appearance:e}){return
|
|
146
|
-
${e=>
|
|
145
|
+
`;function yo({appearance:e}){return ni.createElement(ii,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",ni.createElement(qr,null))}var sa=So.div`
|
|
146
|
+
${e=>k(e)} {
|
|
147
147
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
148
148
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
149
149
|
/* Mobile */
|
|
@@ -184,27 +184,27 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
184
184
|
opacity: 1;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
`,
|
|
187
|
+
`,la=So.div`
|
|
188
188
|
position: relative;
|
|
189
189
|
flex: 0 1 auto;
|
|
190
|
-
`,
|
|
190
|
+
`,aa=So.div`
|
|
191
191
|
position: absolute;
|
|
192
192
|
top: 16px;
|
|
193
193
|
right: 16px;
|
|
194
194
|
cursor: pointer;
|
|
195
195
|
z-index: 1501;
|
|
196
|
-
${e=>
|
|
196
|
+
${e=>k(e)} {
|
|
197
197
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
198
198
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
199
199
|
}
|
|
200
|
-
`,
|
|
200
|
+
`,pa=So.div`
|
|
201
201
|
overflow: scroll;
|
|
202
202
|
flex: 1 1;
|
|
203
203
|
display: flex;
|
|
204
204
|
::-webkit-scrollbar {
|
|
205
205
|
display: none;
|
|
206
206
|
}
|
|
207
|
-
`,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=
|
|
207
|
+
`,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=ia("");return or(()=>{let g=getComputedStyle(document.body).getPropertyValue("overflow");l(g)},[]),or(()=>{let g=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[e]),or(()=>{let g=document.body.style;return t?g.setProperty("overflow","hidden"):g.setProperty("overflow",c),()=>{g.setProperty("overflow",c)}},[t]),t?ze.createElement(na,null,ze.createElement(Kr,{appearance:n,onClose:()=>{s&&e()}}),ze.createElement(sa,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&ze.createElement(aa,{className:a("modalClose",n),onClick:()=>e(),appearance:n},ze.createElement(Te,null)),o&&ze.createElement(la,null,o),ze.createElement(pa,null,r),p&&ze.createElement(oi,{appearance:n,className:a("poweredByFrigadeRibbon",n)},ze.createElement(yo,{appearance:n})))):ze.createElement(ze.Fragment,null)};import nt,{useEffect as rr,useState as da}from"react";import bo from"styled-components";import{Portal as ca}from"react-portal";function ma(e){switch(e){case"top-left":return`
|
|
208
208
|
top: 0;
|
|
209
209
|
left: 0;
|
|
210
210
|
`;case"top-right":return`
|
|
@@ -213,8 +213,8 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
213
213
|
`;case"bottom-left":return`
|
|
214
214
|
bottom: 0;
|
|
215
215
|
left: 0;
|
|
216
|
-
`}return"right: 0; bottom: 0;"}var
|
|
217
|
-
${e=>
|
|
216
|
+
`}return"right: 0; bottom: 0;"}var ua=bo.div`
|
|
217
|
+
${e=>k(e)} {
|
|
218
218
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
219
219
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
220
220
|
position: fixed;
|
|
@@ -227,29 +227,29 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
227
227
|
width: 350px;
|
|
228
228
|
padding: 24px;
|
|
229
229
|
}
|
|
230
|
-
${e=>
|
|
230
|
+
${e=>ma(e.modalPosition)}
|
|
231
231
|
margin: 28px;
|
|
232
|
-
`,
|
|
232
|
+
`,fa=bo.div`
|
|
233
233
|
position: relative;
|
|
234
234
|
flex: 1;
|
|
235
|
-
`,
|
|
235
|
+
`,ga=bo.div`
|
|
236
236
|
position: absolute;
|
|
237
237
|
top: 16px;
|
|
238
238
|
right: 16px;
|
|
239
239
|
cursor: pointer;
|
|
240
240
|
z-index: 1501;
|
|
241
|
-
${e=>
|
|
241
|
+
${e=>k(e)} {
|
|
242
242
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
243
243
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
244
244
|
}
|
|
245
|
-
`,
|
|
245
|
+
`,xa=bo.div`
|
|
246
246
|
overflow: scroll;
|
|
247
247
|
flex: 5;
|
|
248
248
|
::-webkit-scrollbar {
|
|
249
249
|
display: none;
|
|
250
250
|
}
|
|
251
|
-
`,wo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=
|
|
252
|
-
${e=>
|
|
251
|
+
`,wo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=da("");return rr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");c(l)},[]),rr(()=>{let l=g=>{g.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),rr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?nt.createElement(ca,null,nt.createElement(ua,{appearance:r,className:a("cornerModalContainer",r),modalPosition:n},s&&nt.createElement(ga,{className:a("cornerModalClose",r),onClick:()=>e()},nt.createElement(Te,null)),o&&nt.createElement(fa,null,o),nt.createElement(xa,null,i))):nt.createElement(nt.Fragment,null)};import{useContext as ha}from"react";function Q(){let{defaultAppearance:e}=ha(K);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import Ct,{useContext as za,useEffect as Wa,useState as ur}from"react";import vo from"styled-components";import ko,{useEffect as ci,useState as sr}from"react";import lr from"styled-components";import To from"styled-components";var si=To.label`
|
|
252
|
+
${e=>k(e)} {
|
|
253
253
|
font-size: 12px;
|
|
254
254
|
line-height: 18px;
|
|
255
255
|
margin-bottom: 5px;
|
|
@@ -259,14 +259,14 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
259
259
|
letter-spacing: 0.24px;
|
|
260
260
|
}
|
|
261
261
|
display: flex;
|
|
262
|
-
`,
|
|
263
|
-
${e=>
|
|
262
|
+
`,li=To.label`
|
|
263
|
+
${e=>k(e)} {
|
|
264
264
|
font-size: 12px;
|
|
265
265
|
line-height: 20px;
|
|
266
266
|
margin-bottom: 5px;
|
|
267
267
|
}
|
|
268
268
|
display: flex;
|
|
269
|
-
`,
|
|
269
|
+
`,ai=To.span`
|
|
270
270
|
font-weight: 400;
|
|
271
271
|
font-size: 14px;
|
|
272
272
|
line-height: 22px;
|
|
@@ -279,12 +279,12 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
279
279
|
align-items: flex-start;
|
|
280
280
|
justify-content: left;
|
|
281
281
|
margin-bottom: 10px;
|
|
282
|
-
`;import ir from"react";var Je={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function st({title:e,required:t,appearance:o=Je}){return e?ir.createElement(Fo,
|
|
282
|
+
`;import ir from"react";var Je={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function st({title:e,required:t,appearance:o=Je}){return e?ir.createElement(Fo,{className:a("formLabelWrapper",o)},t?ir.createElement(ai,{className:a("formLabelRequired",o),appearance:o},"*"):null,ir.createElement(si,{className:a("formLabel",o)},e)):null}import pi from"react";function Dt({title:e,appearance:t}){return e?pi.createElement(Fo,null,pi.createElement(li,{className:a("formSubLabel",t)},e)):null}import{z as nr}from"zod";function di(e,t){try{if(t){if(t.type=="number"){let o=nr.number();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too small"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too large"):i.requirement=="positive"?o=o.positive(i.message??"Value must be positive"):i.requirement=="negative"&&(o=o.nonpositive(i.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=nr.string();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too short"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too long"):i.requirement=="regex"&&(o=o.regex(new RegExp(String(i.value)),i.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof nr.ZodError)return o.issues&&o.issues.length>0?o.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,o)}return null}var Ca=lr.div`
|
|
283
283
|
display: flex;
|
|
284
284
|
flex-direction: column;
|
|
285
285
|
width: 100%;
|
|
286
|
-
`,lr
|
|
287
|
-
${e=>
|
|
286
|
+
`,ar=lr.input`
|
|
287
|
+
${e=>k(e)} {
|
|
288
288
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
289
289
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
290
290
|
font-size: 14px;
|
|
@@ -299,8 +299,8 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
299
299
|
box-sizing: border-box;
|
|
300
300
|
padding: 0 10px;
|
|
301
301
|
margin-bottom: 10px;
|
|
302
|
-
`,ya=
|
|
303
|
-
${e=>
|
|
302
|
+
`,ya=lr.textarea`
|
|
303
|
+
${e=>k(e)} {
|
|
304
304
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
305
305
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
306
306
|
font-size: 14px;
|
|
@@ -315,14 +315,14 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
315
315
|
min-height: 70px;
|
|
316
316
|
box-sizing: border-box;
|
|
317
317
|
margin-bottom: 10px;
|
|
318
|
-
`;function
|
|
318
|
+
`;function pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=sr((r==null?void 0:r.text)||""),[c,l]=sr(!1),[g,d]=sr(!1),x=ar;ci(()=>{s===""&&!c&&(l(!0),F(""))},[]),ci(()=>{if(g){F(s);return}},[g]);function F(S){if(p(S),o({text:S}),n.required===!0&&S.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`,hidden:!g}]);return}let f=di(S,n.validation);if(f&&n.required===!0){i([{id:n.id,message:f,hidden:!g}]);return}i([])}n.multiline&&(x=ya);function C(){var S;switch((S=n==null?void 0:n.validation)==null?void 0:S.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return ko.createElement(Ca,null,ko.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),ko.createElement(x,{className:a("inputComponent",t.appearance),value:s,onChange:S=>{F(S.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:C(),onBlur:()=>{d(!0)}}),ko.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import je,{useEffect as mi,useState as ui}from"react";import fi from"styled-components";var dr="",Sa=fi.div`
|
|
319
319
|
display: flex;
|
|
320
320
|
flex-direction: column;
|
|
321
321
|
width: 100%;
|
|
322
322
|
-webkit-appearance: none;
|
|
323
323
|
appearance: none;
|
|
324
|
-
`,ba=
|
|
325
|
-
${e=>
|
|
324
|
+
`,ba=fi.select`
|
|
325
|
+
${e=>k(e)} {
|
|
326
326
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
327
327
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
328
328
|
font-size: 14px;
|
|
@@ -342,16 +342,16 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
342
342
|
background-repeat: no-repeat;
|
|
343
343
|
background-size: 1.5em 1.5em;
|
|
344
344
|
-webkit-print-color-adjust: exact;
|
|
345
|
-
`;function
|
|
345
|
+
`;function gi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,F,C,S;let n=e,[s,p]=ui(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,l]=ui(!1);return mi(()=>{var f,v,w,b;if(s===""&&!c){if(l(!0),n.requireSelection){p(dr);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(A=>A.id===n.defaultValue))){let A=(v=n.props.options)==null?void 0:v.find(y=>y.id===n.defaultValue);p(A.id),o({choice:[A.id]})}else p(((w=n.props.options)==null?void 0:w[0].id)||""),o({choice:[((b=n.props.options)==null?void 0:b[0].id)||""]})}},[]),mi(()=>{n.requireSelection&&s===dr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),je.createElement(Sa,null,je.createElement(st,{title:n.title,required:!1,appearance:t.appearance}),je.createElement(ba,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},n.requireSelection&&je.createElement("option",{key:"null-value",value:dr,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(f=>je.createElement("option",{key:f.id,value:f.id},f.title))),((F=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:F.isOpenEnded)&&je.createElement(je.Fragment,null,je.createElement(st,{title:((S=(C=n.props.options)==null?void 0:C.find(f=>f.id===s))==null?void 0:S.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),je.createElement(ar,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),je.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import to,{useEffect as cr,useState as hi}from"react";import Ci from"styled-components";import eo from"react";import Rt from"react";var xi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return Rt.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},wa=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>Rt.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},Rt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Rt.createElement(xi,{color:r,size:t}),Rt.createElement(xi,{color:e,percentage:o,size:t})),i),$t=wa;import Ta from"styled-components";var Fa=({color:e="#FFFFFF"})=>eo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ka={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Pa={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},va={border:"1px solid #000000",color:"#FFFFFF"},Ba={border:"1px solid #C5CBD3"},Ea={color:"#FFFFFF"},Aa={border:"1px solid #C5CBD3"},Ia=e=>e==="square"?ka:Pa,Na=(e,t)=>e==="square"?t?va:Ba:t?Ea:Aa,Oa=Ta.div`
|
|
346
346
|
${e=>ke(e)}
|
|
347
|
-
`,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=Ia(t),c=Na(t,e);return e===!0?p={...p,...c,backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?eo.createElement($t,{fillColor:o,percentage:i,size:22}):eo.createElement(Oa,{styleOverrides:p,style:n,role:"checkbox",className:xe(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&eo.createElement(Fa,{color:"#FFFFFF"}))};var La=
|
|
347
|
+
`,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=Ia(t),c=Na(t,e);return e===!0?p={...p,...c,backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?eo.createElement($t,{fillColor:o,percentage:i,size:22}):eo.createElement(Oa,{styleOverrides:p,style:n,role:"checkbox",className:xe(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&eo.createElement(Fa,{color:"#FFFFFF"}))};var La=Ci.div`
|
|
348
348
|
display: flex;
|
|
349
349
|
flex-direction: column;
|
|
350
350
|
width: 100%;
|
|
351
351
|
-webkit-appearance: none;
|
|
352
352
|
appearance: none;
|
|
353
|
-
`,Da=
|
|
354
|
-
${e=>
|
|
353
|
+
`,Da=Ci.button`
|
|
354
|
+
${e=>k(e)} {
|
|
355
355
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
356
356
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
357
357
|
font-size: 14px;
|
|
@@ -375,8 +375,8 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
375
375
|
height: 48px;
|
|
376
376
|
padding: 0 18px;
|
|
377
377
|
margin-bottom: 10px;
|
|
378
|
-
`;function
|
|
379
|
-
${e=>
|
|
378
|
+
`;function yi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=hi((i==null?void 0:i.choice)||[]),[c,l]=hi(!1);return cr(()=>{s.length==0&&!c&&(l(!0),o({choice:[]}))},[]),cr(()=>{o({choice:s})},[s]),cr(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),to.createElement(La,null,to.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>to.createElement(Da,{appearance:t.appearance,className:a(s.includes(d.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,to.createElement(Qe,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),to.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import Po from"react";import Si from"styled-components";import $a from"dompurify";function le(e){return{__html:$a.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Ma=Si.h1`
|
|
379
|
+
${e=>k(e)} {
|
|
380
380
|
font-style: normal;
|
|
381
381
|
font-weight: 700;
|
|
382
382
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -387,8 +387,8 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
387
387
|
margin-bottom: 4px;
|
|
388
388
|
color: ${e=>e.appearance.theme.colorText};
|
|
389
389
|
}
|
|
390
|
-
`,Ua=
|
|
391
|
-
${e=>
|
|
390
|
+
`,Ua=Si.h2`
|
|
391
|
+
${e=>k(e)} {
|
|
392
392
|
font-style: normal;
|
|
393
393
|
font-weight: 400;
|
|
394
394
|
font-size: 14px;
|
|
@@ -396,7 +396,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
396
396
|
letter-spacing: 0.28px;
|
|
397
397
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
398
398
|
}
|
|
399
|
-
`;function Fe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Po.createElement(Po.Fragment,null,Po.createElement(Ma,{appearance:e,className:a(`${r}${r?Zt(i):i}Title`,e),dangerouslySetInnerHTML:le(t),size:i}),o&&Po.createElement(Ua,{appearance:e,className:a(`${r}${r?Zt(i):i}Subtitle`,e),dangerouslySetInnerHTML:le(o),size:i}))}import*as
|
|
399
|
+
`;function Fe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Po.createElement(Po.Fragment,null,Po.createElement(Ma,{appearance:e,className:a(`${r}${r?Zt(i):i}Title`,e),dangerouslySetInnerHTML:le(t),size:i}),o&&Po.createElement(Ua,{appearance:e,className:a(`${r}${r?Zt(i):i}Subtitle`,e),dangerouslySetInnerHTML:le(o),size:i}))}import*as mr from"react";var bi=e=>mr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},mr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var _a=vo.div`
|
|
400
400
|
display: flex;
|
|
401
401
|
flex-direction: column;
|
|
402
402
|
justify-content: flex-end;
|
|
@@ -414,24 +414,24 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
414
414
|
`,Va=vo.div`
|
|
415
415
|
padding-left: 1px;
|
|
416
416
|
padding-right: 1px;
|
|
417
|
-
`,Ga={text:
|
|
417
|
+
`,Ga={text:pr,multipleChoice:gi,multipleChoiceList:yi},fr="frigade-multiInputStepTypeData";function wi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var y;let c=t.props,[l,g]=ur([]),[d,x]=ur([]),{userId:F}=Jt(),[C,S]=ur(b()||(p?p[t.id]:null)||{}),{readonly:f}=za(K),v={...Ga,...s};Wa(()=>{i(l.length===0)},[l,i]);function w(m,E){let T={...C,[m.id]:E};S(T),r(T),window&&window.localStorage&&!f&&window.localStorage.setItem(A(),JSON.stringify(T))}function b(){if(window&&window.localStorage){let m=window.localStorage.getItem(A());if(m)return JSON.parse(m)}return null}function A(){return`${fr}-${e}-${t.id}-${F}`}return Ct.createElement(Va,{className:a("multiInput",n)},Ct.createElement(Fe,{appearance:n,title:t.title,subtitle:t.subtitle}),Ct.createElement(_a,{className:a("multiInputContainer",n)},(y=c.data)==null?void 0:y.map(m=>{let E=l.reverse().find(T=>T.id===m.id);return v[m.type]?Ct.createElement("span",{key:m.id,"data-field-id":m.id,className:a("multiInputField",n)},v[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:T=>{!d.includes(m.id)&&T&&(T==null?void 0:T.text)!==""&&x(B=>[...B,m.id]),w(m,T)},inputData:C[m.id],setFormValidationErrors:T=>{g(B=>T.length===0?B.filter(L=>L.id!==m.id):[...B,...T])}}),E&&d.includes(m.id)&&E.hidden!==!0&&Ct.createElement(Ha,{key:m.id,style:{overflow:"hidden"},appearance:n,className:a("multiInputValidationError",n)},Ct.createElement(ja,{appearance:n,className:a("multiInputValidationErrorIcon",n)},Ct.createElement(bi,null)),E.message)):null})))}import yt from"styled-components";var Ti=yt.div`
|
|
418
418
|
align-items: center;
|
|
419
419
|
display: flex;
|
|
420
420
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
421
421
|
padding-top: 14px;
|
|
422
|
-
`,
|
|
422
|
+
`,Fi=yt.div`
|
|
423
423
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
424
424
|
font-size: 12px;
|
|
425
|
-
`,
|
|
425
|
+
`,ki=yt.div`
|
|
426
426
|
display: flex;
|
|
427
427
|
gap: 12px;
|
|
428
428
|
width: 100%;
|
|
429
429
|
justify-content: flex-end;
|
|
430
|
-
`,
|
|
430
|
+
`,Pi=yt.div`
|
|
431
431
|
display: flex;
|
|
432
432
|
flex-direction: row;
|
|
433
433
|
flex: 1 1;
|
|
434
|
-
`,
|
|
434
|
+
`,vi=yt.div`
|
|
435
435
|
display: flex;
|
|
436
436
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
437
437
|
// Otherwise, use 4px padding
|
|
@@ -439,11 +439,11 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
439
439
|
flex-grow: 1;
|
|
440
440
|
flex-basis: 0;
|
|
441
441
|
position: relative;
|
|
442
|
-
`,
|
|
442
|
+
`,Bi=yt.div`
|
|
443
443
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
444
444
|
position: relative;
|
|
445
445
|
overflow-y: auto;
|
|
446
|
-
`,
|
|
446
|
+
`,Ei=yt.div`
|
|
447
447
|
display: flex;
|
|
448
448
|
align-self: stretch;
|
|
449
449
|
flex-grow: 1;
|
|
@@ -455,10 +455,10 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
455
455
|
background-position: center;
|
|
456
456
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
457
457
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
458
|
-
`;import lt from"react";import Ka from"react";import
|
|
458
|
+
`;import lt from"react";import Ka from"react";import Ai from"styled-components";var qa=Ai.button`
|
|
459
459
|
justify-content: center;
|
|
460
460
|
align-content: center;
|
|
461
|
-
${e=>
|
|
461
|
+
${e=>k(e)} {
|
|
462
462
|
display: flex;
|
|
463
463
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
464
464
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -486,8 +486,8 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
486
486
|
opacity: 0.3;
|
|
487
487
|
cursor: not-allowed;
|
|
488
488
|
}
|
|
489
|
-
`,Bo=
|
|
490
|
-
${e=>
|
|
489
|
+
`,Bo=Ai.div`
|
|
490
|
+
${e=>k(e)} {
|
|
491
491
|
display: flex;
|
|
492
492
|
flex-direction: row;
|
|
493
493
|
justify-content: flex-start;
|
|
@@ -497,9 +497,9 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
497
497
|
margin-right: 8px;
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
`,Z=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:l=""})=>{function g(){let d=s?"buttonSecondary":"button";return l===""?d:`${l}${Zt(d)}`}return Ka.createElement(qa,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:a(g(),p)},t??"Continue")};var
|
|
500
|
+
`,Z=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:l=""})=>{function g(){let d=s?"buttonSecondary":"button";return l===""?d:`${l}${Zt(d)}`}return Ka.createElement(qa,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:a(g(),p)},t??"Continue")};var Ii=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:l})=>{let g=s.length>1&&n!=0&&c,d=e.primaryButtonTitle&&e.secondaryButtonTitle||g?"inline":"full-width";return lt.createElement(lt.Fragment,null,l!==null&&l!=null&<.createElement(Fi,{appearance:o,className:a("formCTAError",o)},l),lt.createElement(Ti,{showBackButton:g,className:a("formCTAContainer",o)},g&<.createElement(Z,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),lt.createElement(ki,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?lt.createElement(Z,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?lt.createElement(Z,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import gr from"react";import Ya from"styled-components";var Xa=Ya.div`
|
|
501
501
|
text-align: center;
|
|
502
|
-
`,
|
|
502
|
+
`,Ni=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Q().mergeAppearanceWithDefault(i);return gr.createElement(Xa,{className:o},gr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>gr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import St from"react";import Mt from"styled-components";import{useContext as Ja}from"react";function ie(){let e=Ja(K);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Qa=Mt.div`
|
|
503
503
|
display: flex;
|
|
504
504
|
flex-wrap: wrap;
|
|
505
505
|
align-content: center;
|
|
@@ -547,7 +547,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
547
547
|
margin-top: 12px;
|
|
548
548
|
margin-bottom: 16px;
|
|
549
549
|
max-width: 70%;
|
|
550
|
-
`;function
|
|
550
|
+
`;function Oi({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return St.createElement("div",null,St.createElement(tp,null,e.title),St.createElement(op,null,e.subtitle),St.createElement(Qa,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>St.createElement(Za,{key:n.title},St.createElement(Ra,{src:n.imageUri}),St.createElement(ep,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import Ut,{useEffect as pp}from"react";import Io from"styled-components";import xr from"react";var Eo=({style:e,className:t})=>xr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,style:e},xr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),xr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import oo,{useRef as rp,useState as ip}from"react";import Ao from"styled-components";var np=Ao.div`
|
|
551
551
|
display: flex;
|
|
552
552
|
align-items: center;
|
|
553
553
|
justify-content: flex-start;
|
|
@@ -584,46 +584,46 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
584
584
|
min-height: 260px;
|
|
585
585
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
586
586
|
`;function Ve({appearance:e,videoUri:t}){let o=rp(),[i,r]=ip(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),oo.createElement(ap,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return oo.createElement(np,{className:a("videoPlayerWrapper",e),appearance:e},!i&&oo.createElement(sp,{onClick:()=>{r(!0),o.current.play()},appearance:e},oo.createElement(Eo,null)),oo.createElement(lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var dp=Io.div`
|
|
587
|
-
${e=>
|
|
587
|
+
${e=>k(e)} {
|
|
588
588
|
display: flex;
|
|
589
589
|
flex-direction: column;
|
|
590
590
|
justify-content: center;
|
|
591
591
|
}
|
|
592
592
|
`,cp=Io.img`
|
|
593
|
-
${e=>
|
|
593
|
+
${e=>k(e)} {
|
|
594
594
|
width: 100%;
|
|
595
595
|
height: auto;
|
|
596
596
|
max-height: 250px;
|
|
597
597
|
margin-bottom: 24px;
|
|
598
598
|
}
|
|
599
599
|
`,mp=Io.div`
|
|
600
|
-
${e=>
|
|
600
|
+
${e=>k(e)} {
|
|
601
601
|
margin-bottom: 24px;
|
|
602
602
|
}
|
|
603
603
|
`,up=Io.div`
|
|
604
|
-
${e=>
|
|
604
|
+
${e=>k(e)} {
|
|
605
605
|
width: 100%;
|
|
606
606
|
height: auto;
|
|
607
607
|
max-height: 250px;
|
|
608
608
|
margin-bottom: 24px;
|
|
609
609
|
}
|
|
610
|
-
`;function
|
|
610
|
+
`;function Li({stepData:e,appearance:t,setCanContinue:o}){return pp(()=>{o(!0)},[]),Ut.createElement(dp,{className:a("callToActionContainer",t)},Ut.createElement(mp,{className:a("callToActionTextContainer",t)},Ut.createElement(Fe,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Ut.createElement(cp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Ut.createElement(up,{appearance:t,className:a("callToActionVideo",t)},Ut.createElement(Ve,{appearance:t,videoUri:e.videoUri})))}import Ze,{useEffect as hr,useState as Cr}from"react";import at from"styled-components";var Di=at.div`
|
|
611
611
|
width: auto;
|
|
612
612
|
display: flex;
|
|
613
613
|
flex-direction: column;
|
|
614
614
|
justify-content: center;
|
|
615
615
|
align-items: center;
|
|
616
616
|
padding: 4px;
|
|
617
|
-
|
|
617
|
+
`,$i=at.div`
|
|
618
618
|
width: 100%;
|
|
619
619
|
text-align: left;
|
|
620
|
-
|
|
620
|
+
`,Mi=at.h1`
|
|
621
621
|
font-style: normal;
|
|
622
622
|
font-weight: 700;
|
|
623
623
|
font-size: 32px;
|
|
624
624
|
line-height: 38px;
|
|
625
625
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
626
|
-
`,
|
|
626
|
+
`,Ui=at.h1`
|
|
627
627
|
font-style: normal;
|
|
628
628
|
font-weight: 400;
|
|
629
629
|
font-size: 16px;
|
|
@@ -631,7 +631,7 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
631
631
|
margin-top: 16px;
|
|
632
632
|
margin-bottom: 16px;
|
|
633
633
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
634
|
-
`,
|
|
634
|
+
`,zi=at.div`
|
|
635
635
|
padding-top: 12px;
|
|
636
636
|
padding-bottom: 12px;
|
|
637
637
|
flex-direction: row;
|
|
@@ -642,17 +642,17 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
642
642
|
cursor: pointer;
|
|
643
643
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
644
644
|
width: 100%;
|
|
645
|
-
`,
|
|
645
|
+
`,Wi=at.div`
|
|
646
646
|
padding-top: 10px;
|
|
647
647
|
padding-bottom: 10px;
|
|
648
648
|
flex-direction: row;
|
|
649
649
|
display: flex;
|
|
650
650
|
justify-content: flex-start;
|
|
651
|
-
`,
|
|
651
|
+
`,_i=at.img`
|
|
652
652
|
width: 42px;
|
|
653
653
|
height: 42px;
|
|
654
654
|
margin-right: 12px;
|
|
655
|
-
`,
|
|
655
|
+
`,Hi=at.p`
|
|
656
656
|
font-style: normal;
|
|
657
657
|
font-weight: 500;
|
|
658
658
|
font-size: 17px;
|
|
@@ -660,8 +660,8 @@ import wt,{createContext as Gp,useEffect as $o,useState as Oe}from"react";import
|
|
|
660
660
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
661
661
|
display: flex;
|
|
662
662
|
align-self: center;
|
|
663
|
-
`;var
|
|
664
|
-
${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map(([s,p])=>`${Zo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return io.createElement(o,{inlineStyles:t})}var ji=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:b=!1,modalPosition:h="center",repeatable:T=!1,onDismiss:f,showPagination:B=!1,allowBackNavigation:w=!1,validationHandler:S,showFrigadeBranding:A=!1,onFormDataChange:y,showFooter:m=!0,prefillData:E={}})=>{let{getFlow:k,getFlowSteps:P,isLoading:O,targetingLogicShouldHideFlow:I,getFlowStatus:N,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:ee}=Y(),U=$(e),{mergeAppearanceWithDefault:te}=Q(),[fe,X]=hp(!1),{setOpenFlowState:H,getOpenFlowState:j,hasOpenModals:Ce}=we();c=te(c);let[Ie,be]=i!==void 0&&r!==void 0?[i,r]:[j(e,!0),re=>H(e,re)];if(xp(()=>{!fe&&!O&&(X(!0),N(e)===q&&T&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(L=>{L.startsWith(ur)&&window.localStorage.removeItem(L)})),X(!0))},[fe,X,O]),O)return null;let me=k(e);if(!me||I(me))return null;let J=P(e);if(!J||i!==void 0&&i===!1||N(e)===q&&l||(o=="modal"||o=="corner-modal")&&Ce(e))return null;let ge=()=>{be(!1),f&&f(),b===!0&&D(e)};if(h=="center"&&o==="modal"||o==="large-modal"){let re={padding:"24px"};return o==="large-modal"?(re.width="85%",re.height="90%",re.maxHeight="800px",re.minHeight="500px",re.padding="0"):re.width="400px",Ge.createElement(He,{appearance:c,onClose:ge,visible:Ie,style:re,dismissible:x,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E}))}return o==="modal"&&h!=="center"?Ge.createElement(wo,{appearance:c,onClose:ge,visible:Ie,modalPosition:h},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E}))},Vi=ji;import{useCallback as Cr,useContext as Cp,useEffect as yp}from"react";function yr(){let{organizationId:e,userId:t,setOrganizationId:o}=Cp(K),{mutateUserFlowState:i}=Be(),{config:r,apiUrl:n}=_e(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,b){return`frigade-user-group-registered-${x}-${b}`}yp(()=>{if(t&&e){if(t.startsWith(Lt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=Cr(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()},[e,t,r,i]),g=Cr(async(x,b)=>{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 T={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:b}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()},[e,t,r,i]),d=Cr(async(x,b)=>{if(p())if(b){let h=c(t,x);localStorage.setItem(h,"true"),o(x);let T={foreignUserId:t,foreignUserGroupId:x,properties:b};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var Gi="frigade-xFrigade_guestUserId",no="frigade-xFrigade_userId",Ki=({})=>{let{setFlowResponses:e}=Xt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Be(),{userId:r,setUserId:n}=Jt(),[s,p]=Sr(null),{getFlowStatus:c}=Y(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=Sp(K),[b,h]=Sr([]),[T,f]=Sr([]),{organizationId:B}=yr();Lo(()=>{if(!o&&t)for(let y=0;y<t.length;y++){let m=t[y],E=l.find(k=>k.slug===(m==null?void 0:m.flowId));if(E&&m&&m.shouldTrigger===!0&&E.type=="FORM"&&E.triggerType==="AUTOMATIC"&&!T.includes(E.slug)){setTimeout(()=>{w(m.flowId)},500);break}}},[o,t]),Lo(()=>{x.length>0&&i()},[x]);function w(y){let m=l.find(E=>E.slug===y);m&&m.triggerType==="AUTOMATIC"&&!T.includes(m.slug)&&(f([...T,m.slug]),h([m]))}function S(){if(!r){let y=localStorage.getItem(no);if(y){n(y);return}let m=localStorage.getItem(Gi);if(m){n(m);return}d(!0);let E=Lt+bp();try{localStorage.setItem(Gi,E)}catch(k){console.log("Failed to save guest user id locally: Local storage unavailable",k)}n(k=>k||E)}}Lo(()=>{try{if(l){let y=[];l.forEach(m=>{if(m.data){let E=m.data.match(/"imageUri":"(.*?)"/g);E&&E.forEach(k=>{let P=k.replace('"imageUri":"',"").replace('"',"");if(y.includes(P))return;let O=new Image;O.src=P,y.push(P)})}})}}catch{}},[l]),Lo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(no,r)}catch(y){console.log("Failed to save user id locally: Local storage available",y)}r===null&&setTimeout(()=>{r===null&&S()},50)},[r,l,g]);function A(){return bt.createElement(bt.Fragment,null,b.map(y=>c(y.slug)!==Me?null:bt.createElement("span",{key:y.slug},bt.createElement(Vi,{flowId:y.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return bt.createElement(bt.Fragment,null,bt.createElement(A,null))};import{ErrorBoundary as qp}from"react-error-boundary";import so from"core-js-pure/actual/structured-clone";function br(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pt(...e){let t=e.shift(),o=e.length===1?e[0]:pt(...e);if(!br(t)||!br(o))throw new Error("deepmerge can only merge Objects");let i=so(t);return Object.entries(o).forEach(([r,n])=>{br(n)?i[r]!==void 0?Object.assign(i,{[r]:pt(i[r],so(n))}):Object.assign(i,{[r]:so(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...so(n)]}):Object.assign(i,{[r]:so(n)}):Object.assign(i,{[r]:n})}),i}var qi={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function wp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(qi[o]){let r=qi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function Tp(e){if(!e)return;let t=pt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Yi(e){let{theme:t,styleOverrides:o}=e,i=wp(t),r=Tp(o);return{overrides:i,css:r}}import Mp from"styled-components";import{compose as Up,variant as Ji}from"styled-system";import Xi from"react";import Fp,{ThemeProvider as kp,useTheme as Pp}from"styled-components";import{border as vp,color as Bp,compose as Ep,get as Ap,shadow as Ip,space as Np,system as Op,typography as Lp}from"styled-system";var Dp={width:{property:"width",scale:"sizes",transform:(e,t)=>Ap(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},$p=Fp("div")(({css:e})=>e,Ep(vp,Bp,Ip,Np,Lp,Op(Dp))),lo=({as:e,children:t,overrides:o,...i})=>{let r=Pp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Xi.createElement($p,{as:e,...n,...i},t);if(o!==void 0){let p=pt(r,o);return Xi.createElement(kp,{theme:p},s())}return s()};var ao={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},zp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Qi=Mp(lo)(()=>({whiteSpace:"nowrap"}),Up(Ji({scale:"components.Button",variants:"components.Button"}),Ji({prop:"size",variants:zp})));import Wp from"styled-components";import{variant as _p,system as Hp}from"styled-system";var Do={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Zi=Wp(lo)(_p({scale:"components.Text",variants:"components.Text"}),Hp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Ri=4,en="px",jp=20,Vp=Object.fromEntries(Array.from(Array(jp+1),(e,t)=>t===0?[.5,`${.5*Ri}${en}`]:[t,`${t*Ri}${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"},wr={colors:{...zt,neutral:{foreground:zt.gray300},primary:{background:zt.blue500,foreground:zt.white,inverted:zt.blue500},negative:{foreground:zt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Vp,components:{Button:ao,Text:Do}};var tn="https://api.frigade.com",K=Gp({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:tn,readonly:!1});function Yp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Xp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,X;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[l,g]=Oe([]),[d,x]=Oe([]),[b,h]=Oe([]),[T,f]=Oe({}),[B,w]=Oe({}),[S,A]=Oe([]),[y,m]=Oe({}),[E,k]=Oe(!1),[P,O]=Oe(!1),[I,N]=Oe(!ee(e)),$=(H,j)=>{if(j==="_blank"){window.open(H,"_blank");return}setTimeout(()=>{window.location.href=H},50)},D={theme:{...Je.theme,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...Je.styleOverrides,...((X=i==null?void 0:i.defaultAppearance)==null?void 0:X.styleOverrides)??{}}};function ee(H){return!!(H&&H.length>10&&H.substring(0,10)==="api_public")}$o(()=>{t&&s(t)},[t]),$o(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(no)&&window.localStorage.getItem(no)!==n&&Yp()},[n]),$o(()=>{o&&c(o)},[o]),$o(()=>{if(ee(e))N(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),N(!0);return}},[e,N]);let U={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:b,setFlowResponses:h,userProperties:T,setUserProperties:f,openFlowStates:B,setOpenFlowStates:w,completedFlowsToKeepOpenDuringSession:S,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:y,setCustomVariables:m,isNewGuestUser:E,setIsNewGuestUser:k,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:I,setShouldGracefullyDegrade:N,apiUrl:i&&i.apiUrl?i.apiUrl:tn,readonly:i&&i.readonly?i.readonly:!1};if(I)return wt.createElement(K.Provider,{value:U},r);let{overrides:te}=Yi(D);return wt.createElement(qp,{fallback:wt.createElement(wt.Fragment,null,r)},wt.createElement(K.Provider,{value:U},wt.createElement(Kp,{theme:pt(D.theme,wr,te??{},(i==null?void 0:i.theme)??{})},r,wt.createElement(Ki,null))))};import Ud from"react";import ce,{useEffect as Is,useState as Ns}from"react";import We,{useState as ud}from"react";import kt from"styled-components";import zo from"react";import Tt from"react";import rn from"styled-components";var on=rn.span`
|
|
663
|
+
`;var ji=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=Cr([]),[p,c]=Cr(!1),[l,g]=Cr(e.id);return hr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),hr(()=>{l!==e.id&&(g(e.id),s([]))},[e]),hr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ze.createElement(Di,{className:a("selectListContainer",i)},Ze.createElement($i,null,Ze.createElement(Mi,{className:a("selectListTitle",i)},e.title),Ze.createElement(Ui,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let F=n.includes(d.id);return Ze.createElement(zi,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(C=>C!==d.id));return}n.length<r.maxChoices?s([...n,d.id]):n.length==1&&r.maxChoices==1&&s([d.id])},hideBottomBorder:x===r.options.length-1,className:a("selectListSelectItem",i)},Ze.createElement(Wi,{className:a("selectListItemImage",i)},d.imageUri&&Ze.createElement(_i,{src:d.imageUri,alt:`select-icon-${x}`}),Ze.createElement(Hi,{appearance:i,className:a("selectListSelectItemText",i)},d.title)),Ze.createElement(Qe,{appearance:i,value:F,primaryColor:i.theme.colorPrimary}))}))};import Pe,{useEffect as No,useState as ro}from"react";var fp=({children:e,id:t,shouldWrap:o=!1})=>Pe.createElement(Pe.Fragment,null,o?Pe.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Oo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:l,onComplete:g,setVisible:d,setShowModal:x,onDismiss:F,showPagination:C=!1,customFormElements:S,allowBackNavigation:f,validationHandler:v,onFormDataChange:w,showFooter:b,prefillData:A})=>{var V;let m={...{linkCollection:Oi,multiInput:wi,callToAction:Li,selectList:ji},...i},{primaryCTAClickSideEffects:E,secondaryCTAClickSideEffects:T}=ie(),[B,L]=ro(!1),[N,I]=ro({}),[$,D]=ro(!1),[ee,U]=ro(!1),[te,fe]=ro(null),X=t[o]??null,{markStepCompleted:H,markStepStarted:j,isLoading:Ce,updateCustomVariables:Ie,markFlowCompleted:be}=Y();No(()=>{Ie(r)},[r,Ce]),No(()=>{w&&w(N,me(),t[o],o)},[N]),No(()=>{window&&f&&!ee&&(window.location.hash=t[o].id,U(!0))},[f,ee,U]),No(()=>{var G;if(window&&((G=window==null?void 0:window.location)!=null&&G.hash)&&window.location.hash.replace("#","")!==t[o].id){let ne=window.location.hash.replace("#",""),se=t.findIndex(pe=>pe.id===ne);se!==-1&&j(p,t[se].id)}},[(V=window==null?void 0:window.location)==null?void 0:V.hash,j,o,t]);function me(){return{data:N[t[o].id]??{},stepId:t[o].id,customVariables:r}}function J(G,ne,se){let pe=o+1<t.length?t[o+1]:null;return s&&s(G,se,pe,N,me()),n?n(G,o,ne,pe):!0}function ge(G,ne){I(se=>{let pe={};return pe[G.id]=ne,{...se,...pe}})}function re(G){return G.selectedStep.imageUri?Pe.createElement(Ei,{image:G.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let O=b&&Pe.createElement(Ii,{step:t[o],canContinue:B&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(D(!0),v){let se=await v(t[o],o,t[o+1],N,me());if(se||se===!1){fe(typeof se=="string"?se:null),D(!1);return}else fe(null)}let G={...me()};await H(p,t[o].id,G),o+1<t.length&&await j(p,t[o+1].id);let ne=J(t[o],"primary",o);o+1>=t.length&&(g&&g(),F&&F(),l&&ne&&(d&&d(!1),x(!1)),await be(p)),E(t[o]),D(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{J(t[o],"secondary",o),T(t[o])},onBack:async()=>{o-1>=0&&(D(!0),await j(p,t[o-1].id),D(!1))},steps:t,allowBackNavigation:f,errorMessage:te});return Pe.createElement(Pe.Fragment,null,Pe.createElement(Pi,{className:a("formContainer",e)},Pe.createElement(vi,null,Pe.createElement(fp,{id:o,shouldWrap:c==="large-modal"},Pe.createElement(Bi,{key:X.id,type:c,className:a("formContent",e)},t.map(G=>{let ne=m[G.type];return X.id!==G.id?null:Pe.createElement(ne,{key:G.id,stepData:G,canContinue:B,setCanContinue:L,onSaveData:se=>{ge(G,se)},appearance:e,customFormElements:S,flowId:p,prefillData:A})}),C&&Pe.createElement(Ni,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),O))),c=="large-modal"&&Pe.createElement(re,{selectedStep:t[o]})))};import io from"react";import{createGlobalStyle as gp}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return io.createElement(io.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return io.createElement(io.Fragment,null);let o=gp`
|
|
664
|
+
${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map(([s,p])=>`${Zo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return io.createElement(o,{inlineStyles:t})}var Vi=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:F=!1,modalPosition:C="center",repeatable:S=!1,onDismiss:f,showPagination:v=!1,allowBackNavigation:w=!1,validationHandler:b,showFrigadeBranding:A=!1,onFormDataChange:y,showFooter:m=!0,prefillData:E={}})=>{let{getFlow:T,getFlowSteps:B,isLoading:L,targetingLogicShouldHideFlow:N,getFlowStatus:I,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:ee}=Y(),U=$(e),{mergeAppearanceWithDefault:te}=Q(),[fe,X]=hp(!1),{setOpenFlowState:H,getOpenFlowState:j,hasOpenModals:Ce}=we();c=te(c);let[Ie,be]=i!==void 0&&r!==void 0?[i,r]:[j(e,!0),re=>H(e,re)];if(xp(()=>{!fe&&!L&&(X(!0),I(e)===q&&S&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(O=>{O.startsWith(fr)&&window.localStorage.removeItem(O)})),X(!0))},[fe,X,L]),L)return null;let me=T(e);if(!me||N(me))return null;let J=B(e);if(!J||i!==void 0&&i===!1||I(e)===q&&l||(o=="modal"||o=="corner-modal")&&Ce(e))return null;let ge=()=>{be(!1),f&&f(),F===!0&&D(e)};if(C=="center"&&o==="modal"||o==="large-modal"){let re={padding:"24px"};return o==="large-modal"?(re.width="85%",re.height="90%",re.maxHeight="800px",re.minHeight="500px",re.padding="0"):re.width="400px",Ge.createElement(He,{appearance:c,onClose:ge,visible:Ie,style:re,dismissible:x,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:v,customFormElements:s,allowBackNavigation:w,validationHandler:b,onFormDataChange:y,showFooter:m,prefillData:E}))}return o==="modal"&&C!=="center"?Ge.createElement(wo,{appearance:c,onClose:ge,visible:Ie,modalPosition:C},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:v,customFormElements:s,allowBackNavigation:w,validationHandler:b,onFormDataChange:y,showFooter:m,prefillData:E})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:v,customFormElements:s,allowBackNavigation:w,validationHandler:b,onFormDataChange:y,showFooter:m,prefillData:E}))},Gi=Vi;import{useCallback as yr,useContext as Cp,useEffect as yp}from"react";function Sr(){let{organizationId:e,userId:t,setOrganizationId:o}=Cp(K),{mutateUserFlowState:i}=Be(),{config:r,apiUrl:n}=_e(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,F){return`frigade-user-group-registered-${x}-${F}`}yp(()=>{if(t&&e){if(t.startsWith(Lt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=yr(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let F={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(F)}),i()},[e,t,r,i]),g=yr(async(x,F)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:F}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()},[e,t,r,i]),d=yr(async(x,F)=>{if(p())if(F){let C=c(t,x);localStorage.setItem(C,"true"),o(x);let S={foreignUserId:t,foreignUserGroupId:x,properties:F};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var Ki="frigade-xFrigade_guestUserId",no="frigade-xFrigade_userId",qi=({})=>{let{setFlowResponses:e}=Xt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Be(),{userId:r,setUserId:n}=Jt(),[s,p]=br(null),{getFlowStatus:c}=Y(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=Sp(K),[F,C]=br([]),[S,f]=br([]),{organizationId:v}=Sr();Lo(()=>{if(!o&&t)for(let y=0;y<t.length;y++){let m=t[y],E=l.find(T=>T.slug===(m==null?void 0:m.flowId));if(E&&m&&m.shouldTrigger===!0&&E.type=="FORM"&&E.triggerType==="AUTOMATIC"&&!S.includes(E.slug)){setTimeout(()=>{w(m.flowId)},500);break}}},[o,t]),Lo(()=>{x.length>0&&i()},[x]);function w(y){let m=l.find(E=>E.slug===y);m&&m.triggerType==="AUTOMATIC"&&!S.includes(m.slug)&&(f([...S,m.slug]),C([m]))}function b(){if(!r){let y=localStorage.getItem(no);if(y){n(y);return}let m=localStorage.getItem(Ki);if(m){n(m);return}d(!0);let E=Lt+bp();try{localStorage.setItem(Ki,E)}catch(T){console.log("Failed to save guest user id locally: Local storage unavailable",T)}n(T=>T||E)}}Lo(()=>{try{if(l){let y=[];l.forEach(m=>{if(m.data){let E=m.data.match(/"imageUri":"(.*?)"/g);E&&E.forEach(T=>{let B=T.replace('"imageUri":"',"").replace('"',"");if(y.includes(B))return;let L=new Image;L.src=B,y.push(B)})}})}}catch{}},[l]),Lo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(no,r)}catch(y){console.log("Failed to save user id locally: Local storage available",y)}r===null&&setTimeout(()=>{r===null&&b()},50)},[r,l,g]);function A(){return bt.createElement(bt.Fragment,null,F.map(y=>c(y.slug)!==Me?null:bt.createElement("span",{key:y.slug},bt.createElement(Gi,{flowId:y.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return bt.createElement(bt.Fragment,null,bt.createElement(A,null))};import{ErrorBoundary as qp}from"react-error-boundary";import so from"core-js-pure/actual/structured-clone";function wr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pt(...e){let t=e.shift(),o=e.length===1?e[0]:pt(...e);if(!wr(t)||!wr(o))throw new Error("deepmerge can only merge Objects");let i=so(t);return Object.entries(o).forEach(([r,n])=>{wr(n)?i[r]!==void 0?Object.assign(i,{[r]:pt(i[r],so(n))}):Object.assign(i,{[r]:so(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...so(n)]}):Object.assign(i,{[r]:so(n)}):Object.assign(i,{[r]:n})}),i}var Yi={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function wp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Yi[o]){let r=Yi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function Tp(e){if(!e)return;let t=pt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Xi(e){let{theme:t,styleOverrides:o}=e,i=wp(t),r=Tp(o);return{overrides:i,css:r}}import Mp from"styled-components";import{compose as Up,variant as Qi}from"styled-system";import Ji from"react";import Fp,{ThemeProvider as kp,useTheme as Pp}from"styled-components";import{border as vp,color as Bp,compose as Ep,get as Ap,shadow as Ip,space as Np,system as Op,typography as Lp}from"styled-system";var Dp={width:{property:"width",scale:"sizes",transform:(e,t)=>Ap(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},$p=Fp("div")(({css:e})=>e,Ep(vp,Bp,Ip,Np,Lp,Op(Dp))),lo=({as:e,children:t,overrides:o,...i})=>{let r=Pp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Ji.createElement($p,{as:e,...n,...i},t);if(o!==void 0){let p=pt(r,o);return Ji.createElement(kp,{theme:p},s())}return s()};var ao={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},zp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Zi=Mp(lo)(()=>({whiteSpace:"nowrap"}),Up(Qi({scale:"components.Button",variants:"components.Button"}),Qi({prop:"size",variants:zp})));import Wp from"styled-components";import{variant as _p,system as Hp}from"styled-system";var Do={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Ri=Wp(lo)(_p({scale:"components.Text",variants:"components.Text"}),Hp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var en=4,tn="px",jp=20,Vp=Object.fromEntries(Array.from(Array(jp+1),(e,t)=>t===0?[.5,`${.5*en}${tn}`]:[t,`${t*en}${tn}`])),zt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Tr={colors:{...zt,neutral:{foreground:zt.gray300},primary:{background:zt.blue500,foreground:zt.white,inverted:zt.blue500},negative:{foreground:zt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Vp,components:{Button:ao,Text:Do}};var on="https://api.frigade.com",K=Gp({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:on,readonly:!1});function Yp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Xp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,X;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[l,g]=Oe([]),[d,x]=Oe([]),[F,C]=Oe([]),[S,f]=Oe({}),[v,w]=Oe({}),[b,A]=Oe([]),[y,m]=Oe({}),[E,T]=Oe(!1),[B,L]=Oe(!1),[N,I]=Oe(!ee(e)),$=(H,j)=>{if(j==="_blank"){window.open(H,"_blank");return}setTimeout(()=>{window.location.href=H},50)},D={theme:{...Je.theme,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...Je.styleOverrides,...((X=i==null?void 0:i.defaultAppearance)==null?void 0:X.styleOverrides)??{}}};function ee(H){return!!(H&&H.length>10&&H.substring(0,10)==="api_public")}$o(()=>{t&&s(t)},[t]),$o(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(no)&&window.localStorage.getItem(no)!==n&&Yp()},[n]),$o(()=>{o&&c(o)},[o]),$o(()=>{if(ee(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let U={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:F,setFlowResponses:C,userProperties:S,setUserProperties:f,openFlowStates:v,setOpenFlowStates:w,completedFlowsToKeepOpenDuringSession:b,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:y,setCustomVariables:m,isNewGuestUser:E,setIsNewGuestUser:T,hasActiveFullPageFlow:B,setHasActiveFullPageFlow:L,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:I,apiUrl:i&&i.apiUrl?i.apiUrl:on,readonly:i&&i.readonly?i.readonly:!1};if(N)return wt.createElement(K.Provider,{value:U},r);let{overrides:te}=Xi(D);return wt.createElement(qp,{fallback:wt.createElement(wt.Fragment,null,r)},wt.createElement(K.Provider,{value:U},wt.createElement(Kp,{theme:pt(D.theme,Tr,te??{},(i==null?void 0:i.theme)??{})},r,wt.createElement(qi,null))))};import Ud from"react";import ce,{useEffect as Ns,useState as Os}from"react";import We,{useState as ud}from"react";import kt from"styled-components";import zo from"react";import Tt from"react";import nn from"styled-components";var rn=nn.span`
|
|
665
665
|
font-weight: 600;
|
|
666
666
|
font-size: 14px;
|
|
667
667
|
font-style: normal;
|
|
@@ -673,7 +673,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
673
673
|
margin-left: 32px;
|
|
674
674
|
padding-right: 12px;
|
|
675
675
|
${e=>ke(e)}
|
|
676
|
-
`,Jp=
|
|
676
|
+
`,Jp=nn.div`
|
|
677
677
|
flex-direction: row;
|
|
678
678
|
justify-content: space-between;
|
|
679
679
|
display: flex;
|
|
@@ -682,11 +682,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
682
682
|
padding-right: 8px;
|
|
683
683
|
width: 100%;
|
|
684
684
|
${e=>ke(e)}
|
|
685
|
-
`,Mo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(Jp,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:{...r}},i==="left"&&e&&Tt.createElement(
|
|
685
|
+
`,Mo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(Jp,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:{...r}},i==="left"&&e&&Tt.createElement(rn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Tt.createElement(Qe,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&Tt.createElement(rn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Tt.createElement(oe,{appearance:p}));import po from"styled-components";var sn=po.div`
|
|
686
686
|
font-weight: 700;
|
|
687
687
|
font-size: 18px;
|
|
688
688
|
line-height: 22px;
|
|
689
|
-
`,
|
|
689
|
+
`,ln=po.p`
|
|
690
690
|
font-weight: 600;
|
|
691
691
|
font-size: 16px;
|
|
692
692
|
line-height: 24px;
|
|
@@ -694,7 +694,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
694
694
|
letter-spacing: 0.32px;
|
|
695
695
|
font-style: normal;
|
|
696
696
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
697
|
-
`,
|
|
697
|
+
`,an=po.p`
|
|
698
698
|
font-weight: 400;
|
|
699
699
|
font-size: 14px;
|
|
700
700
|
font-style: normal;
|
|
@@ -710,12 +710,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
710
710
|
height: 100%;
|
|
711
711
|
border-top-right-radius: 4px;
|
|
712
712
|
border-bottom-right-radius: 4px;
|
|
713
|
-
`,
|
|
713
|
+
`,pn=po.div`
|
|
714
714
|
flex-direction: row;
|
|
715
715
|
justify-content: flex-start;
|
|
716
716
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
717
717
|
padding-right: 16px;
|
|
718
|
-
`;var
|
|
718
|
+
`;var dn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return zo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&zo.createElement(Uo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),zo.createElement(pn,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},zo.createElement(Mo,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:r,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import Ft from"react";import Fr from"styled-components";import Re from"styled-components";var ph=Re.div`
|
|
719
719
|
background: #ffffff;
|
|
720
720
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
721
721
|
border-radius: 20px;
|
|
@@ -741,7 +741,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
741
741
|
display: flex;
|
|
742
742
|
justify-content: flex-start;
|
|
743
743
|
flex-direction: row;
|
|
744
|
-
`,
|
|
744
|
+
`,cn=Re.div`
|
|
745
745
|
position: absolute;
|
|
746
746
|
left: 0;
|
|
747
747
|
top: 0;
|
|
@@ -749,7 +749,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
749
749
|
width: ${e=>e.fgWidth};
|
|
750
750
|
border-radius: 20px;
|
|
751
751
|
background-color: ${e=>e.theme.colorPrimary};
|
|
752
|
-
`,
|
|
752
|
+
`,mn=Re.div`
|
|
753
753
|
position: relative;
|
|
754
754
|
left: 0;
|
|
755
755
|
top: 0;
|
|
@@ -759,7 +759,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
759
759
|
border-radius: 20px;
|
|
760
760
|
background-color: ${e=>e.theme.colorPrimary};
|
|
761
761
|
opacity: 0.12;
|
|
762
|
-
`;var Qp=
|
|
762
|
+
`;var Qp=Fr.div`
|
|
763
763
|
display: flex;
|
|
764
764
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
765
765
|
justify-content: flex-start;
|
|
@@ -767,11 +767,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
767
767
|
width: 100%;
|
|
768
768
|
|
|
769
769
|
${e=>ke(e)}
|
|
770
|
-
`,Zp=
|
|
770
|
+
`,Zp=Fr.div`
|
|
771
771
|
flex-grow: 1;
|
|
772
772
|
position: relative;
|
|
773
773
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
774
|
-
`,Rp=
|
|
774
|
+
`,Rp=Fr.span`
|
|
775
775
|
font-weight: 600;
|
|
776
776
|
font-size: 14px;
|
|
777
777
|
line-height: 18px;
|
|
@@ -779,11 +779,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
779
779
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
780
780
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
781
781
|
${e=>ke(e)}
|
|
782
|
-
`;var Le=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Ft.createElement(Ft.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Ft.createElement(Qp,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Ft.createElement(Rp,{className:a("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Ft.createElement(Zp,{textLocation:i,className:a("progressBar",s)},Ft.createElement(
|
|
782
|
+
`;var Le=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Ft.createElement(Ft.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Ft.createElement(Qp,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Ft.createElement(Rp,{className:a("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Ft.createElement(Zp,{textLocation:i,className:a("progressBar",s)},Ft.createElement(cn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:a("progressBarFill",s)}),Ft.createElement(mn,{className:a("progressBarBackground",s),barHeight:c,appearance:s})))};import co from"react";import td from"styled-components";import _o from"react";import Wo from"react";var Wt=({stepData:e,appearance:t})=>Wo.createElement(Wo.Fragment,null,Wo.createElement(ln,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:le(e.title)}),Wo.createElement(an,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:le(e.subtitle)}));import kr from"react";var _t=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return kr.createElement(Bo,{className:a("ctaContainer",t)},kr.createElement(Z,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&kr.createElement(Z,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var Ht=({stepData:e,appearance:t})=>_o.createElement(_o.Fragment,null,_o.createElement(Wt,{stepData:e,appearance:t}),_o.createElement(_t,{stepData:e,appearance:t}));import ed from"react";function un(e){return ed.createElement(Ve,{appearance:e.appearance,videoUri:e.videoUri})}var Pr="default",od=td.img`
|
|
783
783
|
border-radius: 4px;
|
|
784
784
|
max-height: 260px;
|
|
785
785
|
min-height: 200px;
|
|
786
|
-
`,
|
|
786
|
+
`,fn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return co.createElement("div",null,o)}return co.createElement(sn,{className:a("checklistStepContent",t)},e.imageUri?co.createElement(od,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?co.createElement(un,{videoUri:e.videoUri,appearance:t}):null,co.createElement(Ht,{stepData:e,appearance:t}))};import Ee,{useRef as rd,useState as id}from"react";import jt from"styled-components";var gn=jt.div`
|
|
787
787
|
display: block;
|
|
788
788
|
`,nd=jt.div`
|
|
789
789
|
display: flex;
|
|
@@ -828,7 +828,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
828
828
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
829
829
|
border-radius: 50%;
|
|
830
830
|
}
|
|
831
|
-
`,
|
|
831
|
+
`,xn="videoCarousel",hn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ee.createElement(gn,null,Ee.createElement(Ht,{stepData:e,appearance:t}));function o({video:n}){let s=rd(),[p,c]=id(!1);return Ee.createElement(sd,null,!p&&Ee.createElement(pd,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ee.createElement(Eo,null)),Ee.createElement(ld,{controls:p,ref:s,play:p,src:n.uri}),Ee.createElement(ad,null,n.title))}let i=e.props;return i.videos?Ee.createElement(gn,null,Ee.createElement(Wt,{stepData:e,appearance:t}),Ee.createElement(nd,null,i.videos.map((n,s)=>Ee.createElement("span",{key:`${n.uri}-${s}`},Ee.createElement(o,{video:n})))),Ee.createElement(_t,{stepData:e,appearance:t})):null};import et from"react";import Ho from"styled-components";var Cn=Ho.div`
|
|
832
832
|
display: block;
|
|
833
833
|
`,dd=Ho.pre`
|
|
834
834
|
display: block;
|
|
@@ -853,7 +853,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
853
853
|
margin-top: 12px;
|
|
854
854
|
`,md=Ho.div`
|
|
855
855
|
margin-top: 24px;
|
|
856
|
-
`,
|
|
856
|
+
`,yn="codeSnippet",Sn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return et.createElement(Cn,null,et.createElement(Ht,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?et.createElement(Cn,null,et.createElement(Wt,{stepData:e,appearance:t}),et.createElement(md,null,o.codeSnippets.map((r,n)=>et.createElement("div",{key:n},r.title?et.createElement(cd,null,r.title):null,r.code?et.createElement(dd,null,r.code):null))),et.createElement(_t,{stepData:e,appearance:t})):null};var fd=kt.div`
|
|
857
857
|
display: flex;
|
|
858
858
|
flex-direction: row;
|
|
859
859
|
overflow: hidden;
|
|
@@ -876,7 +876,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
876
876
|
letter-spacing: 0.28px;
|
|
877
877
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
878
878
|
margin: 10px 0px 0px 0px;
|
|
879
|
-
`,
|
|
879
|
+
`,bn=kt.div``,hd=kt.div`
|
|
880
880
|
list-style: none;
|
|
881
881
|
padding: 0;
|
|
882
882
|
margin: 0;
|
|
@@ -889,31 +889,31 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
889
889
|
`,yd=kt.div`
|
|
890
890
|
flex: 2;
|
|
891
891
|
padding: 2rem 2rem 2rem 0rem;
|
|
892
|
-
`,Sd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:l})=>{let{mergeAppearanceWithDefault:g}=Q();c=g(c);let x={...{[
|
|
892
|
+
`,Sd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:l})=>{let{mergeAppearanceWithDefault:g}=Q();c=g(c);let x={...{[Pr]:fn,[xn]:hn,[yn]:Sn},...p},[F,C]=ud(0),S=r??F,f=n??C,v=o.filter(b=>b.complete===!0).length,w=()=>{var b;return!((b=o[S])!=null&&b.type)||!x[o[S].type]?x[Pr]({stepData:o[S],appearance:c}):x[o[S].type]({stepData:o[S],appearance:c})};return We.createElement(fd,{type:l,styleOverrides:i,className:s,appearance:c},We.createElement(bn,{style:{flex:1}},We.createElement(bn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},We.createElement(gd,{className:a("checklistTitle",c),appearance:c},e),We.createElement(xd,{className:a("checklistSubtitle",c),appearance:c},t),We.createElement(Le,{total:o.length,count:v,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),We.createElement(hd,{className:a("checklistStepsContainer",c)},o.map((b,A)=>We.createElement(dn,{data:b,index:A,key:A,listLength:o.length,isSelected:A===S,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(A)},appearance:c})))),We.createElement(Cd,{appearance:c,className:a("checklistDivider",c)}),We.createElement(yd,null,We.createElement(w,null)))},vr=Sd;import z,{useState as kd}from"react";import wn from"react";import bd from"styled-components";var wd=bd.svg`
|
|
893
893
|
transition: 'transform 0.35s ease-in-out';
|
|
894
|
-
`,Vt=({style:e,className:t})=>
|
|
894
|
+
`,Vt=({style:e,className:t})=>wn.createElement(wd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},wn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ue from"styled-components";var Br={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Tn=ue.div`
|
|
895
895
|
max-height: 350px;
|
|
896
896
|
padding-bottom: 40px;
|
|
897
|
-
`,
|
|
897
|
+
`,Fn=ue.div`
|
|
898
898
|
display: flex;
|
|
899
899
|
flex-direction: column;
|
|
900
900
|
margin-top: 20px;
|
|
901
|
-
`,
|
|
901
|
+
`,kn=ue.h1`
|
|
902
902
|
font-style: normal;
|
|
903
903
|
font-weight: 600;
|
|
904
904
|
font-size: 30px;
|
|
905
905
|
line-height: 36px;
|
|
906
906
|
margin-bottom: 16px;
|
|
907
907
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
908
|
-
`,
|
|
908
|
+
`,Pn=ue.h2`
|
|
909
909
|
font-weight: 400;
|
|
910
910
|
font-size: 16px;
|
|
911
911
|
line-height: 20px;
|
|
912
912
|
margin-bottom: 16px;
|
|
913
913
|
padding-left: 1px;
|
|
914
914
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
915
|
-
`,
|
|
916
|
-
${e=>
|
|
915
|
+
`,vn=ue.div`
|
|
916
|
+
${e=>k(e)} {
|
|
917
917
|
border: 1px solid #fafafa;
|
|
918
918
|
}
|
|
919
919
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -922,12 +922,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
922
922
|
flex-direction: column;
|
|
923
923
|
min-height: 240px;
|
|
924
924
|
overflow: hidden;
|
|
925
|
-
`,
|
|
925
|
+
`,Bn=ue.div`
|
|
926
926
|
display: flex;
|
|
927
927
|
flex-direction: row;
|
|
928
928
|
justify-content: space-between;
|
|
929
|
-
`,
|
|
930
|
-
${e=>
|
|
929
|
+
`,En=ue.p`
|
|
930
|
+
${e=>k(e)} {
|
|
931
931
|
font-weight: 400;
|
|
932
932
|
font-size: 10px;
|
|
933
933
|
line-height: 12px;
|
|
@@ -935,13 +935,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
935
935
|
color: #8c8c8c;
|
|
936
936
|
margin: 20px;
|
|
937
937
|
}
|
|
938
|
-
`,
|
|
938
|
+
`,An=ue.div`
|
|
939
939
|
display: flex;
|
|
940
940
|
flex-direction: row;
|
|
941
|
-
`,An=ue.div`
|
|
942
|
-
flex: 1;
|
|
943
941
|
`,In=ue.div`
|
|
944
|
-
|
|
942
|
+
flex: 1;
|
|
943
|
+
`,Nn=ue.div`
|
|
944
|
+
${e=>k(e)} {
|
|
945
945
|
display: flex;
|
|
946
946
|
justify-content: center;
|
|
947
947
|
align-content: center;
|
|
@@ -950,8 +950,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
950
950
|
padding-left: 8px;
|
|
951
951
|
padding-right: 8px;
|
|
952
952
|
}
|
|
953
|
-
`,
|
|
954
|
-
${e=>
|
|
953
|
+
`,On=ue.p`
|
|
954
|
+
${e=>k(e)} {
|
|
955
955
|
font-style: normal;
|
|
956
956
|
font-weight: 600;
|
|
957
957
|
font-size: 22px;
|
|
@@ -962,8 +962,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
962
962
|
margin-top: 20px;
|
|
963
963
|
margin-bottom: 16px;
|
|
964
964
|
}
|
|
965
|
-
`,
|
|
966
|
-
${e=>
|
|
965
|
+
`,Ln=ue.p`
|
|
966
|
+
${e=>k(e)} {
|
|
967
967
|
font-weight: 400;
|
|
968
968
|
font-size: 14px;
|
|
969
969
|
line-height: 18px;
|
|
@@ -971,15 +971,15 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
971
971
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
972
972
|
margin-bottom: 8px;
|
|
973
973
|
}
|
|
974
|
-
`,
|
|
975
|
-
${e=>
|
|
974
|
+
`,Dn=ue.div`
|
|
975
|
+
${e=>k(e)} {
|
|
976
976
|
display: flex;
|
|
977
977
|
flex-direction: row;
|
|
978
978
|
justify-content: center;
|
|
979
979
|
gap: 8px;
|
|
980
980
|
}
|
|
981
|
-
|
|
982
|
-
${e=>
|
|
981
|
+
`,$n=ue.div`
|
|
982
|
+
${e=>k(e)} {
|
|
983
983
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
984
984
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
985
985
|
:hover {
|
|
@@ -998,8 +998,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
998
998
|
justify-content: space-between;
|
|
999
999
|
position: relative;
|
|
1000
1000
|
cursor: pointer;
|
|
1001
|
-
|
|
1002
|
-
${e=>
|
|
1001
|
+
`,Mn=ue.p`
|
|
1002
|
+
${e=>k(e)} {
|
|
1003
1003
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1004
1004
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
1005
1005
|
}
|
|
@@ -1007,12 +1007,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1007
1007
|
font-size: 14px;
|
|
1008
1008
|
line-height: 22px;
|
|
1009
1009
|
margin: 0;
|
|
1010
|
-
`,
|
|
1010
|
+
`,Un=ue.div`
|
|
1011
1011
|
display: flex;
|
|
1012
1012
|
flex-direction: row;
|
|
1013
1013
|
justify-content: flex-end;
|
|
1014
1014
|
align-content: center;
|
|
1015
|
-
`,
|
|
1015
|
+
`,zn=ue.div`
|
|
1016
1016
|
display: flex;
|
|
1017
1017
|
flex: 1;
|
|
1018
1018
|
flex-direction: row;
|
|
@@ -1020,14 +1020,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1020
1020
|
align-content: center;
|
|
1021
1021
|
align-items: center;
|
|
1022
1022
|
margin-right: 20px;
|
|
1023
|
-
`,
|
|
1023
|
+
`,Wn=ue.div`
|
|
1024
1024
|
display: block;
|
|
1025
1025
|
width: 100%;
|
|
1026
|
-
`;import Td from"styled-components";var
|
|
1026
|
+
`;import Td from"styled-components";var _n=Td.div`
|
|
1027
1027
|
flex-direction: column;
|
|
1028
1028
|
justify-content: center;
|
|
1029
1029
|
display: flex;
|
|
1030
|
-
`;import ot from"react";import tt from"styled-components";var
|
|
1030
|
+
`;import ot from"react";import tt from"styled-components";var Hn=tt.div`
|
|
1031
1031
|
border: 1px solid #fafafa;
|
|
1032
1032
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1033
1033
|
border-radius: 14px;
|
|
@@ -1035,14 +1035,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1035
1035
|
display: flex;
|
|
1036
1036
|
flex-direction: column;
|
|
1037
1037
|
overflow: hidden;
|
|
1038
|
-
`,
|
|
1038
|
+
`,jn=tt.div`
|
|
1039
1039
|
display: flex;
|
|
1040
1040
|
flex-wrap: wrap;
|
|
1041
1041
|
justify-content: space-between;
|
|
1042
1042
|
overflow: hidden;
|
|
1043
1043
|
row-gap: 10px;
|
|
1044
|
-
`,
|
|
1045
|
-
${e=>
|
|
1044
|
+
`,Vn=tt.div`
|
|
1045
|
+
${e=>k(e)} {
|
|
1046
1046
|
color: #595959;
|
|
1047
1047
|
}
|
|
1048
1048
|
text-transform: uppercase;
|
|
@@ -1051,8 +1051,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1051
1051
|
line-height: 12px;
|
|
1052
1052
|
letter-spacing: 0.09em;
|
|
1053
1053
|
margin-bottom: 12px;
|
|
1054
|
-
`,
|
|
1055
|
-
${e=>
|
|
1054
|
+
`,Gn=tt.div`
|
|
1055
|
+
${e=>k(e)} {
|
|
1056
1056
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1057
1057
|
background: #ffffff;
|
|
1058
1058
|
border: 1px solid #fafafa;
|
|
@@ -1064,8 +1064,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1064
1064
|
|
|
1065
1065
|
max-width: 150px;
|
|
1066
1066
|
min-width: 200px;
|
|
1067
|
-
`,
|
|
1068
|
-
${e=>
|
|
1067
|
+
`,Kn=tt.div`
|
|
1068
|
+
${e=>k(e)} {
|
|
1069
1069
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1070
1070
|
}
|
|
1071
1071
|
width: 40px;
|
|
@@ -1076,14 +1076,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1076
1076
|
justify-content: center;
|
|
1077
1077
|
align-content: center;
|
|
1078
1078
|
align-items: center;
|
|
1079
|
-
`,
|
|
1079
|
+
`,qn=tt.div`
|
|
1080
1080
|
font-weight: 600;
|
|
1081
1081
|
font-size: 20px;
|
|
1082
1082
|
line-height: 24px;
|
|
1083
1083
|
width: 20px;
|
|
1084
1084
|
height: 20px;
|
|
1085
|
-
`,
|
|
1086
|
-
${e=>
|
|
1085
|
+
`,Yn=tt.div`
|
|
1086
|
+
${e=>k(e)} {
|
|
1087
1087
|
color: #434343;
|
|
1088
1088
|
}
|
|
1089
1089
|
font-weight: 600;
|
|
@@ -1091,20 +1091,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1091
1091
|
line-height: 17px;
|
|
1092
1092
|
margin-top: 12px;
|
|
1093
1093
|
margin-bottom: 8px;
|
|
1094
|
-
`,
|
|
1095
|
-
${e=>
|
|
1094
|
+
`,Xn=tt.div`
|
|
1095
|
+
${e=>k(e)} {
|
|
1096
1096
|
color: #8c8c8c;
|
|
1097
1097
|
}
|
|
1098
1098
|
font-weight: 400;
|
|
1099
1099
|
font-size: 12px;
|
|
1100
1100
|
line-height: 14px;
|
|
1101
|
-
`,
|
|
1101
|
+
`,Jn=tt.a`
|
|
1102
1102
|
color: ${e=>e.color};
|
|
1103
1103
|
font-size: 12px;
|
|
1104
1104
|
line-height: 14px;
|
|
1105
1105
|
font-weight: 400;
|
|
1106
1106
|
cursor: pointer;
|
|
1107
|
-
`;var Fd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return ot.createElement(
|
|
1107
|
+
`;var Fd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return ot.createElement(Hn,{style:t,className:a("guideContainer",r)},ot.createElement(Vn,{className:a("guideTitle",r)},o),ot.createElement(jn,{className:a("guideItemContainer",r)},e.map((p,c)=>ot.createElement(Gn,{key:`guide-${p.id??c}`,className:a("guideItem",r)},p.icon&&ot.createElement(Kn,{className:a("guideIcon",r)},ot.createElement(qn,null,p.icon)),ot.createElement(Yn,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:le(p.title)}),ot.createElement(Xn,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:le(p.subtitle)}),ot.createElement(Jn,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},mo=Fd;var Pd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:l,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let F=({stepData:m,handleSecondaryCTAClick:E,handleCTAClick:T})=>m?z.createElement(Nn,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},z.createElement(On,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:le(m.title)}),z.createElement(Ln,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:le(m.subtitle)}),z.createElement(Dn,{className:a("checklistCTAContainer",l)},m.secondaryButtonTitle&&z.createElement(Z,{title:m.secondaryButtonTitle,onClick:E,appearance:l,secondary:!0}),z.createElement(Z,{title:m.primaryButtonTitle,onClick:T,appearance:l}))):z.createElement(z.Fragment,null),S={...{default:m=>{var L;if((L=e[w])!=null&&L.StepContent){let N=e[w].StepContent;return z.createElement("div",null,N)}let E=e[w];return z.createElement(F,{stepData:m,handleCTAClick:()=>{E.handlePrimaryButtonClick&&E.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{E.handleSecondaryButtonClick&&E.handleSecondaryButtonClick()}})}},...c},[f,v]=kd(0),w=s??f,b=p??v,A=()=>{var m;return e?!((m=e[w])!=null&&m.type)||!S[e[w].type]?S.default(e[w]):S[e[w].type]({stepData:e[w],primaryColor:l.theme.colorPrimary}):z.createElement(z.Fragment,null)},y=e.filter(m=>m.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(Br.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Br),z.createElement(He,{onClose:n,visible:r,appearance:l},z.createElement(Wn,null,z.createElement(Fn,null,z.createElement(kn,{appearance:l,className:a("checklistTitle",l)},t),z.createElement(Pn,{appearance:l,className:a("checklistSubtitle",l)},o)),z.createElement(Tn,null,e&&e.length>0&&z.createElement(vn,{className:a("stepsContainer",l)},z.createElement(Bn,null,z.createElement("div",{style:{flex:3}},z.createElement(En,{className:a("stepsTitle",l)},i)),z.createElement(zn,null,z.createElement(Le,{style:{width:"100%"},count:y,total:e.length,appearance:l}))),z.createElement(An,null,z.createElement(In,{className:a("checklistStepListContainer",l),appearance:l},e.map((m,E)=>{let T=w===E;return z.createElement($n,{selected:T,className:a(`checklistStepListItem${T?"Selected":""}`,l),key:`checklist-guide-step-${m.id??E}`,disabled:m.blocked,onClick:()=>{m.blocked||b(E)},title:m.blocked?"Finish remaining steps to continue":void 0},T&&z.createElement(Uo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),z.createElement(Mn,{selected:T,className:a(`checklistStepListStepName${T?"Selected":""}`,l)},m.stepName),z.createElement(Un,null,z.createElement(Qe,{value:m.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:m.progress,appearance:l}),z.createElement(_n,null,z.createElement(Vt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),z.createElement(A,null))),g&&g.length>0&&z.createElement(mo,{steps:g,title:d,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:m=>(x&&x(m),!0)}))))):z.createElement(z.Fragment,null)},Er=Pd;import ve,{useEffect as cs,useState as vd}from"react";import he from"react";import rt from"styled-components";var Qn=rt.div`
|
|
1108
1108
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1109
1109
|
border: 1px solid;
|
|
1110
1110
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1116,19 +1116,19 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1116
1116
|
display: flex;
|
|
1117
1117
|
flex-direction: column;
|
|
1118
1118
|
transition: max-height 0.25s;
|
|
1119
|
-
`,
|
|
1119
|
+
`,Zn=rt.div`
|
|
1120
1120
|
display: flex;
|
|
1121
1121
|
margin-bottom: 20px;
|
|
1122
|
-
`,
|
|
1122
|
+
`,Rn=rt.img`
|
|
1123
1123
|
border-radius: 4px;
|
|
1124
1124
|
max-height: 260px;
|
|
1125
1125
|
min-height: 200px;
|
|
1126
|
-
`,
|
|
1126
|
+
`,es=rt.div`
|
|
1127
1127
|
display: flex;
|
|
1128
1128
|
flex-direction: row;
|
|
1129
1129
|
justify-content: space-between;
|
|
1130
1130
|
align-items: center;
|
|
1131
|
-
`,
|
|
1131
|
+
`,ts=rt.p`
|
|
1132
1132
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1133
1133
|
font-style: normal;
|
|
1134
1134
|
font-weight: 500;
|
|
@@ -1139,23 +1139,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1139
1139
|
:hover {
|
|
1140
1140
|
opacity: 0.8;
|
|
1141
1141
|
}
|
|
1142
|
-
`,
|
|
1142
|
+
`,os=rt.div`
|
|
1143
1143
|
cursor: pointer;
|
|
1144
1144
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1145
1145
|
:hover {
|
|
1146
1146
|
opacity: 0.8;
|
|
1147
1147
|
}
|
|
1148
|
-
`,ay=rt.div``,
|
|
1148
|
+
`,ay=rt.div``,rs=rt.p`
|
|
1149
1149
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1150
1150
|
font-weight: 400;
|
|
1151
1151
|
font-size: 14px;
|
|
1152
1152
|
line-height: 22px;
|
|
1153
|
-
`,
|
|
1153
|
+
`,is=rt.div`
|
|
1154
1154
|
display: flex;
|
|
1155
1155
|
flex-direction: row;
|
|
1156
1156
|
justify-content: flex-start;
|
|
1157
1157
|
align-items: center;
|
|
1158
|
-
`;var
|
|
1158
|
+
`;var ns=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function l(){return he.createElement(he.Fragment,null,e.imageUri||e.videoUri?he.createElement(Zn,{className:a("stepMediaContainer",n)},e.imageUri?he.createElement(Rn,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?he.createElement(Ve,{appearance:n,videoUri:e.videoUri}):null):null,he.createElement(rs,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:le(e.subtitle)}),he.createElement(Bo,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?he.createElement(Z,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,he.createElement(Z,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let x=s[e.type];return x?x(e,n):null}return he.createElement(Qn,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},he.createElement(es,{className:a("stepHeader",n)},he.createElement(is,null,he.createElement(Mo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),he.createElement(ts,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:le(e.title),onClick:()=>o()})),he.createElement(os,{className:a("stepChevronContainer",n),onClick:()=>o(),appearance:n},he.createElement(Vt,{style:{...p,transition:"transform 0.2s ease-in-out"}}))),he.createElement("div",{key:e.id,style:{...c}},g()??l()))};import Gt from"styled-components";var by=Gt.div`
|
|
1159
1159
|
background: #ffffff;
|
|
1160
1160
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1161
1161
|
border-radius: 6px;
|
|
@@ -1169,26 +1169,26 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1169
1169
|
|
|
1170
1170
|
max-width: 800px;
|
|
1171
1171
|
min-width: 350px;
|
|
1172
|
-
`,
|
|
1172
|
+
`,ss=Gt.div`
|
|
1173
1173
|
display: flex;
|
|
1174
1174
|
flex-direction: column;
|
|
1175
|
-
`,
|
|
1175
|
+
`,ls=Gt.h1`
|
|
1176
1176
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1177
1177
|
font-style: normal;
|
|
1178
1178
|
font-weight: 700;
|
|
1179
1179
|
font-size: 20px;
|
|
1180
1180
|
line-height: 24px;
|
|
1181
1181
|
margin-bottom: 8px;
|
|
1182
|
-
`,
|
|
1182
|
+
`,as=Gt.h2`
|
|
1183
1183
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1184
1184
|
font-weight: 400;
|
|
1185
1185
|
font-size: 14px;
|
|
1186
1186
|
line-height: 23px;
|
|
1187
1187
|
margin: 2px 0 0 0;
|
|
1188
|
-
`,
|
|
1188
|
+
`,ps=Gt.div`
|
|
1189
1189
|
display: block;
|
|
1190
1190
|
width: 100%;
|
|
1191
|
-
`,
|
|
1191
|
+
`,ds=Gt.div`
|
|
1192
1192
|
display: flex;
|
|
1193
1193
|
width: 100%;
|
|
1194
1194
|
flex-direction: column;
|
|
@@ -1196,23 +1196,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1196
1196
|
padding: 24px;
|
|
1197
1197
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1198
1198
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1199
|
-
`;var Bd=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:l,appearance:g,type:d,className:x,customStepTypes:
|
|
1199
|
+
`;var Bd=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:l,appearance:g,type:d,className:x,customStepTypes:F,style:C})=>{let S=o.filter(y=>y.complete).length,[f,v]=vd(Array(o.length).fill(!0));cs(()=>{let y=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){y[m]=!1;break}v(y)}},[]),cs(()=>{w(c)},[c]);let w=y=>{let m=[...f];if(s)for(let E=0;E<f.length;++E)E!==y&&(m[E]=!0);m[y]=!m[y],v(m)};if(!r&&d=="modal")return ve.createElement(ve.Fragment,null);let b=ve.createElement(ve.Fragment,null,ve.createElement(ss,null,ve.createElement(ls,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:le(e)}),ve.createElement(as,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:le(t)})),ve.createElement(Le,{display:"percent",count:S,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),A=ve.createElement(ps,{className:xe(a("checklistContainer",g),x)},o.map((y,m)=>{let E=f[m];return ve.createElement(ns,{appearance:g,stepData:y,collapsed:E,key:`modal-checklist-${y.id??m}`,onClick:()=>{if(c===m){w(m);return}l(m)},onPrimaryButtonClick:()=>{y.handlePrimaryButtonClick&&y.handlePrimaryButtonClick(),p&&!y.completionCriteria&&m<f.length-1&&f[m+1]&&l(m+1)},onSecondaryButtonClick:()=>{y.handleSecondaryButtonClick&&y.handleSecondaryButtonClick()},customStepTypes:F})}));return d==="inline"?ve.createElement(ds,{appearance:g,className:xe(a("checklistInlineContainer",g),x),style:C},b,A):ve.createElement(ve.Fragment,null,ve.createElement(He,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:b},A))},Ar=Bd;import ae,{useEffect as Ir,useRef as $d,useState as Pt}from"react";import{useEffect as Ed,useState as Ad}from"react";var ms=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=Ad(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,l])=>{if(!window)return[c,!1];let g=window.matchMedia(l);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return Ed(()=>{s()},[]),o};import Kt from"react";import de,{css as us,keyframes as fs}from"styled-components";var gs=us`
|
|
1200
1200
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1201
|
-
`,Id=
|
|
1201
|
+
`,Id=us`
|
|
1202
1202
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1203
|
-
`,Nd=
|
|
1203
|
+
`,Nd=fs`
|
|
1204
1204
|
from {
|
|
1205
1205
|
opacity: 0;
|
|
1206
1206
|
} to {
|
|
1207
1207
|
opacity: 1;
|
|
1208
1208
|
}
|
|
1209
|
-
`,Od=
|
|
1209
|
+
`,Od=fs`
|
|
1210
1210
|
from {
|
|
1211
1211
|
opacity: 1;
|
|
1212
1212
|
} to {
|
|
1213
1213
|
opacity: 0;
|
|
1214
1214
|
}
|
|
1215
|
-
`,
|
|
1215
|
+
`,xs=de.div`
|
|
1216
1216
|
margin: 0 -20px;
|
|
1217
1217
|
overflow-x: auto;
|
|
1218
1218
|
padding-left: 20px;
|
|
@@ -1229,13 +1229,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1229
1229
|
::-webkit-scrollbar {
|
|
1230
1230
|
display: none;
|
|
1231
1231
|
}
|
|
1232
|
-
`,
|
|
1232
|
+
`,hs=de.div`
|
|
1233
1233
|
display: flex;
|
|
1234
1234
|
flex-flow: row nowrap;
|
|
1235
1235
|
gap: 0 16px;
|
|
1236
1236
|
scroll-snap-align: center;
|
|
1237
1237
|
scroll-snap-stop: always;
|
|
1238
|
-
`,
|
|
1238
|
+
`,Cs=de.div`
|
|
1239
1239
|
animation: ${e=>e.reversed?Od:Nd} 0.25s ease-out;
|
|
1240
1240
|
background: linear-gradient(
|
|
1241
1241
|
to right,
|
|
@@ -1245,8 +1245,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1245
1245
|
position: absolute;
|
|
1246
1246
|
width: 64px;
|
|
1247
1247
|
z-index: 10;
|
|
1248
|
-
`,
|
|
1249
|
-
${
|
|
1248
|
+
`,ys=de.button`
|
|
1249
|
+
${gs}
|
|
1250
1250
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1251
1251
|
align-items: center;
|
|
1252
1252
|
border-radius: 50%;
|
|
@@ -1257,11 +1257,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1257
1257
|
justify-content: center;
|
|
1258
1258
|
position: absolute;
|
|
1259
1259
|
width: 48px;
|
|
1260
|
-
`,
|
|
1260
|
+
`,Ss=de.div`
|
|
1261
1261
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1262
1262
|
padding: 20px;
|
|
1263
|
-
`,
|
|
1264
|
-
${
|
|
1263
|
+
`,bs=de(Ss)`
|
|
1264
|
+
${gs}
|
|
1265
1265
|
background: ${({theme:e})=>e.colorBackground};
|
|
1266
1266
|
position: relative;
|
|
1267
1267
|
|
|
@@ -1273,13 +1273,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1273
1273
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1274
1274
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1275
1275
|
}
|
|
1276
|
-
`,
|
|
1276
|
+
`,ws=de.img`
|
|
1277
1277
|
border-radius: 50%;
|
|
1278
1278
|
height: 40px;
|
|
1279
1279
|
margin-bottom: 12px;
|
|
1280
1280
|
width: 40px;
|
|
1281
|
-
`,
|
|
1282
|
-
${e=>
|
|
1281
|
+
`,Ts=de(Ss)`
|
|
1282
|
+
${e=>k(e)} {
|
|
1283
1283
|
${Id}
|
|
1284
1284
|
|
|
1285
1285
|
background: ${({theme:e})=>e.colorBackground};
|
|
@@ -1291,7 +1291,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1291
1291
|
align-items: center;
|
|
1292
1292
|
`,zy=de.div`
|
|
1293
1293
|
white-space: nowrap;
|
|
1294
|
-
`,
|
|
1294
|
+
`,Fs=de.div`
|
|
1295
1295
|
background: #d8fed8;
|
|
1296
1296
|
border-radius: 6px;
|
|
1297
1297
|
float: right;
|
|
@@ -1303,9 +1303,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1303
1303
|
line-height: 22px;
|
|
1304
1304
|
letter-spacing: calc(18px * -0.01);
|
|
1305
1305
|
margin: 0;
|
|
1306
|
-
`,
|
|
1306
|
+
`,ks=de(Ld)`
|
|
1307
1307
|
margin-bottom: 4px;
|
|
1308
|
-
`,
|
|
1308
|
+
`,Ps=de.div`
|
|
1309
1309
|
display: flex;
|
|
1310
1310
|
flex-flow: row nowrap;
|
|
1311
1311
|
align-items: center;
|
|
@@ -1316,7 +1316,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1316
1316
|
line-height: 20px;
|
|
1317
1317
|
letter-spacing: calc(16px * -0.01);
|
|
1318
1318
|
margin: 0;
|
|
1319
|
-
`,
|
|
1319
|
+
`,vs=de(Dd)`
|
|
1320
1320
|
margin-bottom: 4px;
|
|
1321
1321
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1322
1322
|
`}
|
|
@@ -1326,7 +1326,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1326
1326
|
font-size: 14px;
|
|
1327
1327
|
line-height: 22px;
|
|
1328
1328
|
margin: 0;
|
|
1329
|
-
`,
|
|
1329
|
+
`,Bs=de.p`
|
|
1330
1330
|
color: ${({theme:e})=>e.colorText};
|
|
1331
1331
|
font-weight: 600;
|
|
1332
1332
|
font-size: 12px;
|
|
@@ -1338,21 +1338,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1338
1338
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1339
1339
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1340
1340
|
`}
|
|
1341
|
-
`;var
|
|
1341
|
+
`;var Es=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Q(),{primaryCTAClickSideEffects:r}=ie();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:l=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return Kt.createElement(bs,{className:a("carouselCard",o),onClick:l?null:d,style:t,blocked:l,complete:c},n&&Kt.createElement(ws,{className:a("carouselCardImage",o),src:n,alt:p,style:{opacity:c||l?.4:1}}),c&&Kt.createElement(Fs,{className:a("carouselCompletedPill",o)},Kt.createElement(Bs,{style:{color:"#108E0B"}},"Complete")),p&&Kt.createElement(vs,{blocked:l,complete:c,className:a("carouselCardTitle",o)},p),s&&Kt.createElement(dt.Quiet,{blocked:l,complete:c,className:a("carouselCardSubtitle",o)},s))};var Md=()=>ae.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ae.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ae.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ae.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),As=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=Pt(!1),[n,s]=Pt(!1);Ir(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ae.createElement(Cs,{style:c,reversed:n,onAnimationEnd:n?p:null},ae.createElement(ys,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ae.createElement(Md,null))):null},Is=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=$d(null),[n,s]=Pt(!1),[p,c]=Pt(!1),[l,g]=Pt(null),[d,x]=Pt([]),[F,C]=Pt(0),{isSmall:S}=ms(),f=S?1:3,{getFlowMetadata:v,getFlowSteps:w,getNumberOfStepsCompleted:b,updateCustomVariables:A,isLoading:y}=Y();Ir(()=>{A(o)},[o,y]),Ir(()=>{if(y)return;let N=v(e),I=b(e),$=w(e);g(N),N.data!==null&&(x($.sort((D,ee)=>Number(D.complete)-Number(ee.complete))),c($.length>f),C(I))},[y]);let m=[];for(let N=0;N<d.length;N+=f)m.push(d.slice(N,N+f));let E=N=>{let I=N.target,$=I.scrollWidth-I.clientWidth,D=Math.ceil(I.scrollLeft);D>0&&n===!1&&s(!0),D===0&&n===!0&&s(!1),D<$&&p===!1&&c(!0),D===$&&p===!0&&c(!1)},T=(N=!0)=>{let I=N?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*I,behavior:"smooth"})},B=null,L=N=>{B!==null?clearTimeout(B):E(N),B=setTimeout(()=>{E(N)},16)};return y?null:ae.createElement(Ts,{className:xe(a("carouselContainer",t),i)},ae.createElement("div",{style:{display:"flex",justifyContent:S?"center":"space-between",marginBottom:20,flexWrap:S?"wrap":"nowrap",gap:S?16:20}},ae.createElement("div",null,ae.createElement(ks,{className:a("carouselTitle",t)},l==null?void 0:l.title),ae.createElement(dt.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ae.createElement(Ps,{className:a("progressWrapper",t)},ae.createElement(Le,{count:F,total:d.length,appearance:t}))),ae.createElement("div",{style:{position:"relative"}},ae.createElement(As,{show:n,onClick:()=>T(!1)}),ae.createElement(As,{side:"right",show:p,onClick:T}),ae.createElement(xs,{ref:r,onScroll:L},m.map((N,I)=>ae.createElement(hs,{key:I,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},N.map(($,D)=>ae.createElement(Es,{key:D,stepData:$,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),ae.createElement(oe,{appearance:t}))};var Nr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:l,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:F,setVisible:C,customStepTypes:S,checklistStyle:f="default",autoExpandFirstIncompleteStep:v,autoExpandNextStep:w,...b})=>{let{getFlow:A,getFlowSteps:y,markStepCompleted:m,getStepStatus:E,getNumberOfStepsCompleted:T,isLoading:B,targetingLogicShouldHideFlow:L,updateCustomVariables:N,getFlowMetadata:I,isStepBlocked:$,getFlowStatus:D,hasActiveFullPageFlow:ee,setHasActiveFullPageFlow:U}=Y(),{primaryCTAClickSideEffects:te,secondaryCTAClickSideEffects:fe}=ie(),{getOpenFlowState:X,setOpenFlowState:H}=we(),[j,Ce]=Os(r||0),[Ie,be]=Os(!1),me=c===void 0?X(e):c,J=s==="modal",{mergeAppearanceWithDefault:ge}=Q();if(x=ge(x),Ns(()=>{N(l)},[l,B]),Ns(()=>{c!==void 0&&(J&&c===!0?U(!0):J&&c===!1&&U(!1))},[c,C,ee]),B)return null;let re=A(e);if(!re||L(re))return null;let O=y(e);if(!O||F===!0&&D(e)===q)return null;let V=I(e);if(V!=null&&V.title&&(t=V.title),V!=null&&V.subtitle&&(o=V.subtitle),!Ie&&r===void 0&&T(e)>0){let u=O.findIndex(h=>h.complete===!1);Ce(u>-1?u:O.length-1),be(!0)}function G(){if(j+1>=O.length){J&&H(e,!1);return}$(e,O[j+1].id)||Ce(j+1)}function ne(u,h,P){let W=j+1<O.length?O[j+1]:null;d&&d(u,j,h,W)===!0&&J&&De(),g&&g(u,P,W),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&J&&De()}function se(){return O.map((u,h)=>({...u,handleSecondaryButtonClick:()=>{G(),fe(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ne(u,"secondary",h)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),G()),ne(u,"primary",h),te(u),E(e,u.id)===Ue&&G()}}))}function pe(){return ce.createElement(oe,{appearance:x})}let Ye={steps:se(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:S,type:s,className:n,autoExpandFirstIncompleteStep:v,autoExpandNextStep:w};function De(){H(e,!1),p&&p(),C&&C(!1)}function Et(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Is,{flowId:e,appearance:x,customVariables:l,className:n}))}function ft(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Ar,{visible:me,onClose:()=>{De()},selectedStep:j,setSelectedStep:Ce,autoExpandNextStep:!0,appearance:x,...Ye}))}function At(){let u=b.guideFlowId,h;return u&&A(u)&&(h=y(u)),ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Er,{visible:me,stepsTitle:V.stepsTitle?V.stepsTitle:"Your quick start guide",onClose:()=>{De()},selectedStep:j,setSelectedStep:Ce,guideData:h,guideTitle:b.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:P=>{ne(P,"link",0)},customStepTypes:S,...Ye}))}function gt(){let u=ce.createElement(vr,{flowId:e,style:i,selectedStep:j,setSelectedStep:Ce,appearance:x,type:s,...Ye});return J?ce.createElement(He,{onClose:()=>{De()},visible:me,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ce.createElement(pe,null),u):ce.createElement(ce.Fragment,null,ce.createElement(pe,null),u)}switch(f){case"condensed":return ft();case"with-guide":return At();case"default":return gt();case"carousel":return Et();default:return gt()}};var zd=e=>Ud.createElement(Nr,{type:"inline",...e});import mt,{useEffect as Wd}from"react";import Ke from"react";import jo from"styled-components";var Ls=jo.div`
|
|
1342
1342
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1343
1343
|
border-radius: 8px;
|
|
1344
1344
|
padding: 6px 10px 6px 10px;
|
|
1345
1345
|
min-width: 160px;
|
|
1346
1346
|
cursor: pointer;
|
|
1347
1347
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1348
|
-
`,
|
|
1348
|
+
`,Ds=jo.div`
|
|
1349
1349
|
display: flex;
|
|
1350
1350
|
flex-direction: row;
|
|
1351
1351
|
justify-content: space-between;
|
|
1352
1352
|
align-items: center;
|
|
1353
1353
|
margin-bottom: 2px;
|
|
1354
1354
|
flex-grow: 2;
|
|
1355
|
-
|
|
1355
|
+
`,$s=jo.div`
|
|
1356
1356
|
text-overflow: ellipsis;
|
|
1357
1357
|
font-weight: 600;
|
|
1358
1358
|
font-size: 12px;
|
|
@@ -1360,13 +1360,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1360
1360
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1361
1361
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1362
1362
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1363
|
-
|
|
1363
|
+
`,Ms=jo.div`
|
|
1364
1364
|
width: 20px;
|
|
1365
1365
|
margin-right: 8px;
|
|
1366
1366
|
display: flex;
|
|
1367
1367
|
height: 100%;
|
|
1368
1368
|
align-items: center;
|
|
1369
|
-
`;var
|
|
1369
|
+
`;var Us=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Ke.createElement(Ke.Fragment,null,Ke.createElement(oe,{appearance:s}),Ke.createElement(Ls,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:xe(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ke.createElement(Ms,{className:a("progressRingContainer",s)},Ke.createElement($t,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ke.createElement(Ds,{type:p,className:a("badgeTitleContainer",s)},Ke.createElement($s,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&Ke.createElement(Vt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ke.createElement(Le,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import ct from"react";import uo from"styled-components";var zs=uo.div`
|
|
1370
1370
|
display: flex;
|
|
1371
1371
|
flex-direction: row;
|
|
1372
1372
|
width: 100%;
|
|
@@ -1377,19 +1377,19 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1377
1377
|
border-width: 1px;
|
|
1378
1378
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1379
1379
|
border-radius: 12px;
|
|
1380
|
-
`,
|
|
1381
|
-
${e=>
|
|
1380
|
+
`,Ws=uo.div`
|
|
1381
|
+
${e=>k(e)} {
|
|
1382
1382
|
display: flex;
|
|
1383
1383
|
justify-content: center;
|
|
1384
1384
|
align-items: center;
|
|
1385
1385
|
margin-right: 16px;
|
|
1386
1386
|
}
|
|
1387
|
-
`,
|
|
1387
|
+
`,_s=uo.div`
|
|
1388
1388
|
display: flex;
|
|
1389
1389
|
flex-direction: column;
|
|
1390
1390
|
flex: 1;
|
|
1391
1391
|
margin-top: 0;
|
|
1392
|
-
`,
|
|
1392
|
+
`,Hs=uo.div`
|
|
1393
1393
|
display: flex;
|
|
1394
1394
|
flex-direction: column;
|
|
1395
1395
|
justify-content: center;
|
|
@@ -1404,7 +1404,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1404
1404
|
:hover {
|
|
1405
1405
|
opacity: 0.8;
|
|
1406
1406
|
}
|
|
1407
|
-
`;var
|
|
1407
|
+
`;var js=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>ct.createElement(ct.Fragment,null,ct.createElement(zs,{appearance:i,className:xe(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&ct.createElement(Ws,{className:a("fullWidthProgressBadgeIcon",i)},o),ct.createElement(_s,null,ct.createElement(Fe,{size:"small",appearance:i,title:e,subtitle:t})),ct.createElement(Hs,{className:a("fullWidthProgressBadgeProgressContainer",i)},ct.createElement(Le,{count:r,total:n,display:"percent",textLocation:"top"}))));var _d=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:l,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:F,getNumberOfStepsCompleted:C,isLoading:S,targetingLogicShouldHideFlow:f,updateCustomVariables:v}=Y(),{mergeAppearanceWithDefault:w}=Q();l=w(l);let{setOpenFlowState:b,getOpenFlowState:A}=we();if(Wd(()=>{v(p)},[p,S]),S)return null;let y=d(e);if(!y||f(y)||c===!0&&F(e)===q)return null;let m=x(e),E=C(e);return g==="full-width"?mt.createElement(mt.Fragment,null,mt.createElement(oe,{appearance:l}),mt.createElement(js,{title:t,subtitle:o,count:E,total:m.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):mt.createElement(mt.Fragment,null,mt.createElement(oe,{appearance:l}),mt.createElement(Us,{count:E,total:m.length,title:t,style:r,onClick:()=>{b(e,!0),n&&n()},type:g,className:s,appearance:l}))};import Hd from"react";var jd=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=Y(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let c=r(e);if(!c||n(c))return null;let l=s(e);return Hd.createElement(mo,{steps:l,style:t,appearance:o,...i})};import ut,{useContext as ec,useEffect as tc}from"react";import _,{useEffect as Vo,useLayoutEffect as Gs,useRef as qd,useState as fo}from"react";import go from"styled-components";import{useCallback as Vd,useEffect as Gd,useState as Kd}from"react";var Or=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function Vs(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,r]=Kd(o),n=Vd(()=>{e&&r(e.getBoundingClientRect())},[e]);return Gd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}var Ks=300,qs=100,Yd=500,qt=12,Xd=go.div`
|
|
1408
1408
|
width: 100%;
|
|
1409
1409
|
height: 100%;
|
|
1410
1410
|
border-radius: 9999px;
|
|
@@ -1436,17 +1436,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1436
1436
|
opacity: 1;
|
|
1437
1437
|
`,Qd=go.div`
|
|
1438
1438
|
pointer-events: all;
|
|
1439
|
-
`,
|
|
1439
|
+
`,Ys=go.div`
|
|
1440
1440
|
display: flex;
|
|
1441
1441
|
align-content: center;
|
|
1442
1442
|
justify-content: center;
|
|
1443
1443
|
align-items: center;
|
|
1444
1444
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1445
|
-
`,Zd=go(
|
|
1445
|
+
`,Zd=go(Ys)`
|
|
1446
1446
|
width: ${qt+12}px;
|
|
1447
1447
|
height: ${qt+12}px;
|
|
1448
|
-
`,Rd=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:l=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:
|
|
1449
|
-
${e=>
|
|
1448
|
+
`,Rd=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:l=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:F,showStepCount:C=!0,completedStepsCount:S=0,showFrigadeBranding:f=!1,cssPosition:v="absolute"})=>{var se,pe,Ye,De,Et,ft,At,gt,u,h,P,W;let[w,b]=fo(),[A,y]=fo(new Date),m=qd(null),[E,T]=fo(document.querySelector(e[l].selector)),B=Vs(E,A),[L,N]=fo(),[I,$]=fo(!F),D=(pe=(se=e[l])==null?void 0:se.props)!=null&&pe.position?e[l].props.position:v,ee=((De=(Ye=e[l])==null?void 0:Ye.props)==null?void 0:De.zIndex)??90,U=(w==null?void 0:w.width)??Ks,te=(w==null?void 0:w.height)??qs,fe=window.location.pathname.split("/").pop();Gs(()=>{m.current&&b({width:m.current.clientWidth,height:m.current.clientHeight})},[l,A,D]),Vo(()=>{F||$(!0)},[l]);let X=()=>{let M=document.querySelector(e[l].selector);if(!M){N(void 0),T(null);return}L&&L===JSON.stringify(M==null?void 0:M.getBoundingClientRect())||(T(M),y(new Date),M&&N(JSON.stringify(M.getBoundingClientRect())))};if(Vo(()=>{let M=new MutationObserver(X);return M.observe(document.body,{subtree:!0,childList:!0}),()=>M.disconnect()},[X]),Vo(()=>{let M=new MutationObserver(X);return M.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>M.disconnect()},[X]),Vo(()=>{let M=setInterval(()=>{X()},10);return()=>clearInterval(M)},[X]),Gs(()=>{setTimeout(()=>{X()},Yd),X()},[l,fe]),E===null||!p||B.height===0&&B.width===0&&D!=="fixed"&&v!=="static")return null;let H=i==="auto"?"right":i,j=Or(B,H,U,s,D),Ce=B.right+U>(window.innerWidth||document.documentElement.clientWidth),Ie=B.bottom+qs>(window.innerHeight||document.documentElement.clientHeight);Ce&&i==="auto"&&(j=Or(B,"left",U,s,D),H="left"),(ft=(Et=e[l])==null?void 0:Et.props)!=null&&ft.tooltipPosition&&((gt=(At=e[l])==null?void 0:At.props)==null?void 0:gt.tooltipPosition)!=="auto"&&(((h=(u=e[l])==null?void 0:u.props)==null?void 0:h.tooltipPosition)==="left"||((W=(P=e[l])==null?void 0:P.props)==null?void 0:W.tooltipPosition)==="right")&&(H=e[l].props.tooltipPosition);let be=()=>{let M=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),$(!1),setTimeout(()=>{X()},30)),S===e.length-1)return o()},$e=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),F&&!e[l].secondaryButtonUri&&$(!1))};return _.createElement(_.Fragment,null,C&&e.length>1&&_.createElement(Rr,null,_.createElement(ti,{className:a("tooltipStepCounter",d)},l+1," of ",e.length)),_.createElement(ei,{showStepCount:C,className:a("tooltipCTAContainer",d)},e[l].secondaryButtonTitle&&_.createElement(Z,{title:e[l].secondaryButtonTitle,appearance:d,onClick:$e,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&_.createElement(Z,{title:e[l].primaryButtonTitle,appearance:d,onClick:M,withMargin:!1,size:"small"})))},me=()=>_.createElement(_.Fragment,null,x&&_.createElement(Yr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",d),hasImage:!!e[l].imageUri||!!e[l].videoUri},_.createElement(Te,null)),e[l].imageUri&&_.createElement(Xr,{dismissible:x,appearance:d,src:e[l].imageUri,className:a("tooltipImageContainer",d)}),e[l].videoUri&&!e[l].imageUri&&_.createElement(Jr,{dismissible:x,appearance:d,className:a("tooltipVideoContainer",d)},_.createElement(Ve,{appearance:d,videoUri:e[l].videoUri})),_.createElement(Zr,{className:a("tooltipContentContainer",d)},_.createElement(Fe,{appearance:d,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),_.createElement(Qr,{className:a("tooltipFooter",d)},_.createElement(be,null)))),ge={...{default:M=>{var $e;if(($e=e[l])!=null&&$e.StepContent){let Nl=e[l].StepContent;return _.createElement("div",null,Nl)}return _.createElement(me,null)}},...g},re=()=>{var M;return e?!((M=e[l])!=null&&M.type)||!ge[e[l].type]?ge.default(e[l]):ge[e[l].type]({stepData:e[l],primaryColor:n}):_.createElement(_.Fragment,null)};if(F&&e[l].complete===!0)return null;let O={top:(j==null?void 0:j.y)-qt,left:(H=="left"?B.x+s.x:(j==null?void 0:j.x)-qt)??0,cursor:F?"pointer":"default",position:D},V=()=>{let $e=O.left+(H=="left"?-U:24);return Math.min(Math.max($e,20),window.innerWidth-U-20)},G=()=>{if(D==="fixed")return O.top;let M=O.top+te,$e=20;return M>window.innerHeight-$e?O.top+-te:O.top},ne=()=>{F&&(y(new Date),$(!I))};return _.createElement(Qd,null,_.createElement(Zd,{style:O,zIndex:ee,className:a("tourHighlightContainer",d)},r&&e[l].showHighlight!==!1&&v!=="static"&&_.createElement(_.Fragment,null,_.createElement(Jd,{style:{position:D},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightInnerCircle",d)}),_.createElement(Xd,{style:{position:"absolute"},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightOuterCircle",d)}))),_.createElement(Ys,{style:{...O,left:V(),top:G()},zIndex:ee+1,className:a("tooltipContainerWrapper",d)},I&&_.createElement(_.Fragment,null,_.createElement(Co,{ref:m,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:v!=="static"?12:0,...c},appearance:d,className:a("tooltipContainer",d),maxWidth:Ks,zIndex:ee+10},_.createElement(re,null)),f&&_.createElement(ri,{className:a("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:ee+10},_.createElement(yo,{appearance:d})))))},Go=Rd;import{Portal as oc}from"react-portal";var rc=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:l=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:F="absolute",...C})=>{let{getFlow:S,getFlowSteps:f,isLoading:v,targetingLogicShouldHideFlow:w,markStepCompleted:b,markStepStarted:A,markFlowCompleted:y,updateCustomVariables:m,getCurrentStepIndex:E,getStepStatus:T,isStepBlocked:B,getFlowStatus:L,getNumberOfStepsCompleted:N}=Y(),{isLoadingUserFlowStateData:I}=Be(),{primaryCTAClickSideEffects:$,secondaryCTAClickSideEffects:D}=ie(),{hasOpenModals:ee}=we(),U=E(e),{openFlowStates:te}=ec(K),{mergeAppearanceWithDefault:fe}=Q();if(o=fe(o),tc(()=>{m(t)},[t,v]),I)return null;let X=S(e);if(!X||w(X)||L(e)==q||ee())return null;let H=f(e);if(Object.keys(te).length>0){let O=Object.keys(te).find(V=>te[V]===!0);if(O!==void 0&&O!==e)return ut.createElement(ut.Fragment,null)}async function j(O){if(await b(e,O.id),H.map(V=>T(e,V.id)).every(V=>V===Ue)){await y(e);return}if(!l&&U+1<H.length){if(B(e,H[U+1].id))return;await A(e,H[U+1].id)}}function Ce(O,V,G){let ne=U+1<H.length?H[U+1]:null;r&&r(O,U,V,ne),i&&i(O,G,ne)}function Ie(){return H.map(O=>({...O,handleSecondaryButtonClick:async()=>{D(O),O.skippable===!0&&await b(e,O.id,{skipped:!0}),Ce(O,"secondary",U)},handlePrimaryButtonClick:async()=>{(!O.completionCriteria&&(O.autoMarkCompleted||O.autoMarkCompleted===void 0)||O.completionCriteria&&O.autoMarkCompleted===!0)&&await j(O),Ce(O,"primary",U),$(O)}}))}async function be(O){s&&s(),g==="complete-flow"?await y(e):await b(e,O.id)}function me(){d&&d()}let J=!document.querySelector(H[U].selector);function ge(){let O=H.findIndex(V=>!!document.querySelector(V.selector));return H.map((V,G)=>J&&!n&&G!==O&&x?null:ut.createElement(Go,{key:V.id,appearance:o,steps:Ie(),selectedStep:G,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>be(V),tooltipPosition:c,showHighlightOnly:l,completedStepsCount:N(e),onComplete:me,cssPosition:F,...C}))}function re(){return ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:o}),n||J&&x?ge():ut.createElement(Go,{appearance:o,steps:Ie(),selectedStep:U,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>be(H[U]),tooltipPosition:c,completedStepsCount:N(e),showHighlightOnly:l,onComplete:me,cssPosition:F,...C}))}return F==="static"?re():ut.createElement(oc,null,re())};import Ae,{useEffect as ic,useRef as nc,useState as sc}from"react";import{Portal as lc}from"react-portal";import vt from"styled-components";var Xs=vt.button`
|
|
1449
|
+
${e=>k(e)} {
|
|
1450
1450
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1451
1451
|
|
|
1452
1452
|
display: flex;
|
|
@@ -1463,17 +1463,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1463
1463
|
opacity: 0.8;
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
1466
|
-
`,
|
|
1467
|
-
${e=>
|
|
1466
|
+
`,Js=vt.span`
|
|
1467
|
+
${e=>k(e)} {
|
|
1468
1468
|
font-size: 12px;
|
|
1469
1469
|
display: inline-block;
|
|
1470
1470
|
}
|
|
1471
|
-
`,
|
|
1472
|
-
${e=>
|
|
1471
|
+
`,Qs=vt.span`
|
|
1472
|
+
${e=>k(e)} {
|
|
1473
1473
|
font-size: 12px;
|
|
1474
1474
|
display: inline-block;
|
|
1475
1475
|
}
|
|
1476
|
-
`,
|
|
1476
|
+
`,Zs=vt.div`
|
|
1477
1477
|
position: fixed;
|
|
1478
1478
|
right: 0;
|
|
1479
1479
|
bottom: 0;
|
|
@@ -1483,8 +1483,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1483
1483
|
flex-direction: column;
|
|
1484
1484
|
align-items: flex-end;
|
|
1485
1485
|
z-index: 50;
|
|
1486
|
-
`,
|
|
1487
|
-
${e=>
|
|
1486
|
+
`,Rs=vt.button`
|
|
1487
|
+
${e=>k(e)} {
|
|
1488
1488
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1489
1489
|
background-color: #ffffff;
|
|
1490
1490
|
border: 1px solid #f5f5f5;
|
|
@@ -1499,8 +1499,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1499
1499
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1500
1500
|
border-radius: 45px;
|
|
1501
1501
|
cursor: pointer;
|
|
1502
|
-
`,
|
|
1503
|
-
${e=>
|
|
1502
|
+
`,el=vt.div`
|
|
1503
|
+
${e=>k(e)} {
|
|
1504
1504
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1505
1505
|
background: #ffffff;
|
|
1506
1506
|
}
|
|
@@ -1516,8 +1516,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1516
1516
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1517
1517
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1518
1518
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1519
|
-
`,
|
|
1520
|
-
${e=>
|
|
1519
|
+
`,tl=vt.button`
|
|
1520
|
+
${e=>k(e)} {
|
|
1521
1521
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1522
1522
|
color: #434343;
|
|
1523
1523
|
:hover {
|
|
@@ -1533,8 +1533,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1533
1533
|
font-size: 14px;
|
|
1534
1534
|
|
|
1535
1535
|
padding: 8px 12px;
|
|
1536
|
-
`;import
|
|
1537
|
-
${e=>
|
|
1536
|
+
`;import ol from"react";var rl=({style:e,className:t})=>ol.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},ol.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import il from"react";var nl=({style:e,className:t})=>il.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},il.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var ac=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:l,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F}=Y(),{primaryCTAClickSideEffects:C}=ie(),S=nc(null),[f,v]=sc(!1),{mergeAppearanceWithDefault:w}=Q();s=w(s),ic(()=>(document.addEventListener("click",b,!1),()=>{document.removeEventListener("click",b,!1)}),[]);let b=T=>{S.current&&!S.current.contains(T.target)&&v(!1)};if(x)return null;let A=p(e);if(!A||F(A))return null;let y=c(e);if(!y||!i)return null;function m(T,B){!T.completionCriteria&&(T.autoMarkCompleted||T.autoMarkCompleted===void 0)&&l(e,T.id),C(T),o&&o(T,B),v(!1)}function E(){return f&&Ae.createElement(el,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},y.map((T,B)=>Ae.createElement(tl,{className:a("floatingWidgetMenuItem",s),key:B,onClick:()=>m(T,B)},T.title)))}return r=="inline"?Ae.createElement("span",{ref:S},Ae.createElement(Xs,{style:t,onClick:()=>{v(!f)},className:a("supportButton",s)},Ae.createElement(Qs,{className:a("supportIconContainer",s)},Ae.createElement(nl,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ae.createElement(Js,{className:a("supportButtonTitle",s)},n)),Ae.createElement(E,null)):Ae.createElement(lc,null,Ae.createElement(Zs,{style:t,ref:S},Ae.createElement(E,null),Ae.createElement(Rs,{onClick:()=>{v(!f)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ae.createElement(rl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import qe,{useEffect as pc}from"react";import Ko from"styled-components";var sl=Ko.div`
|
|
1537
|
+
${e=>k(e)} {
|
|
1538
1538
|
display: flex;
|
|
1539
1539
|
flex-direction: column;
|
|
1540
1540
|
width: 100%;
|
|
@@ -1548,18 +1548,18 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1548
1548
|
border-radius: 12px;
|
|
1549
1549
|
position: relative;
|
|
1550
1550
|
}
|
|
1551
|
-
`,
|
|
1551
|
+
`,ll=Ko.div`
|
|
1552
1552
|
display: flex;
|
|
1553
1553
|
flex-direction: column;
|
|
1554
1554
|
flex: 1;
|
|
1555
|
-
`,
|
|
1555
|
+
`,al=Ko.div`
|
|
1556
1556
|
display: flex;
|
|
1557
1557
|
flex-direction: column;
|
|
1558
1558
|
justify-content: center;
|
|
1559
1559
|
align-items: flex-start;
|
|
1560
1560
|
margin-top: 16px;
|
|
1561
|
-
`,
|
|
1562
|
-
${e=>
|
|
1561
|
+
`,pl=Ko.div`
|
|
1562
|
+
${e=>k(e)} {
|
|
1563
1563
|
position: absolute;
|
|
1564
1564
|
top: 16px;
|
|
1565
1565
|
right: 16px;
|
|
@@ -1569,9 +1569,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1569
1569
|
opacity: 0.8;
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
`;var dc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:
|
|
1572
|
+
`;var dc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowSteps:C,getFlowStatus:S,getCurrentStepIndex:f}=Y(),{primaryCTAClickSideEffects:v}=ie(),{mergeAppearanceWithDefault:w}=Q();if(r=w(r),pc(()=>{F(o)},[o,d]),d)return null;let b=c(e);if(!b||x(b)||S(e)===q)return null;let y=C(e)[f(e)];return qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:r}),qe.createElement(sl,{appearance:r,className:xe(a("embeddedTipContainer",r),n),style:s},(p===!0||y.dismissible)&&qe.createElement(pl,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},qe.createElement(Te,null)),qe.createElement(ll,null,qe.createElement(Fe,{size:"small",appearance:r,title:y.title,subtitle:y.subtitle})),y.primaryButtonTitle&&qe.createElement(al,{className:a("embeddedTipCallToActionContainer",r)},qe.createElement(Z,{classPrefix:"embeddedTip",title:y.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{y.handlePrimaryButtonClick(),v(y),!(i&&i(y,f(e),"primary")===!1)&&(await g(e,y.id),await l(e))}}))))};import ye,{useEffect as cc}from"react";import Yt from"styled-components";var dl=Yt.div`
|
|
1573
1573
|
// use the :not annotation
|
|
1574
|
-
${e=>
|
|
1574
|
+
${e=>k(e)} {
|
|
1575
1575
|
display: flex;
|
|
1576
1576
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1577
1577
|
width: 100%;
|
|
@@ -1581,24 +1581,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1581
1581
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1582
1582
|
border-radius: 12px;
|
|
1583
1583
|
}
|
|
1584
|
-
`,
|
|
1585
|
-
${e=>
|
|
1584
|
+
`,cl=Yt.div`
|
|
1585
|
+
${e=>k(e)} {
|
|
1586
1586
|
display: flex;
|
|
1587
1587
|
width: 46px;
|
|
1588
1588
|
height: 46px;
|
|
1589
1589
|
}
|
|
1590
|
-
`,
|
|
1590
|
+
`,ml=Yt.div`
|
|
1591
1591
|
display: flex;
|
|
1592
1592
|
flex-direction: column;
|
|
1593
1593
|
flex: 1;
|
|
1594
1594
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1595
1595
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1596
|
-
`,
|
|
1596
|
+
`,ul=Yt.div`
|
|
1597
1597
|
display: flex;
|
|
1598
1598
|
flex-direction: column;
|
|
1599
1599
|
justify-content: center;
|
|
1600
1600
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1601
|
-
`,
|
|
1601
|
+
`,Lr=Yt.div`
|
|
1602
1602
|
display: flex;
|
|
1603
1603
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1604
1604
|
align-items: flex-end;
|
|
@@ -1606,12 +1606,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1606
1606
|
:hover {
|
|
1607
1607
|
opacity: 0.8;
|
|
1608
1608
|
}
|
|
1609
|
-
`,
|
|
1609
|
+
`,Dr=Yt.div`
|
|
1610
1610
|
display: flex;
|
|
1611
1611
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1612
1612
|
align-items: flex-end;
|
|
1613
1613
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1614
|
-
`;import
|
|
1614
|
+
`;import $r from"react";var fl=({style:e,className:t})=>$r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},$r.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),$r.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var mc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:l,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:F,getFlowMetadata:C,getFlowStatus:S,getFlowSteps:f,getCurrentStepIndex:v}=Y(),{primaryCTAClickSideEffects:w}=ie(),{mergeAppearanceWithDefault:b}=Q();if(s=b(s),cc(()=>{F(r)},[r,d]),d)return null;let A=l(e);if(!A||x(A)||S(e)===q)return null;let y=f(e),m=y.length>0?y[v(e)]:C(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),ye.createElement(ye.Fragment,null,ye.createElement(oe,{appearance:s}),ye.createElement(dl,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ye.createElement(cl,{className:a("bannerIconContainer",s)},c||ye.createElement(fl,null)),p==="square"&&m.dismissible&&ye.createElement(Dr,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Lr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(Te,null))),ye.createElement(ml,{type:p},ye.createElement(Fe,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&ye.createElement(ul,{type:p,className:a("bannerCallToActionContainer",s)},ye.createElement(Z,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{w(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&ye.createElement(Dr,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Lr,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(Te,null)))))};import R,{useEffect as uc}from"react";import{Portal as fc}from"react-portal";import it from"styled-components";var gl=it.div`
|
|
1615
1615
|
display: flex;
|
|
1616
1616
|
flex-direction: column;
|
|
1617
1617
|
width: 100%;
|
|
@@ -1630,7 +1630,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1630
1630
|
z-index: 1000;
|
|
1631
1631
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1632
1632
|
min-width: 550px;
|
|
1633
|
-
`,
|
|
1633
|
+
`,xl=it.button`
|
|
1634
1634
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1635
1635
|
border-radius: 8px;
|
|
1636
1636
|
// If selected make border color primary and text color color priamry
|
|
@@ -1651,23 +1651,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1651
1651
|
display: flex;
|
|
1652
1652
|
justify-content: center;
|
|
1653
1653
|
align-items: center;
|
|
1654
|
-
|
|
1654
|
+
`,Mr=it.div`
|
|
1655
1655
|
display: flex;
|
|
1656
1656
|
justify-content: space-between;
|
|
1657
1657
|
margin-top: 16px;
|
|
1658
1658
|
gap: 8px;
|
|
1659
|
-
`,
|
|
1659
|
+
`,hl=it.div`
|
|
1660
1660
|
display: flex;
|
|
1661
1661
|
justify-content: space-between;
|
|
1662
1662
|
margin-top: 8px;
|
|
1663
|
-
`,
|
|
1663
|
+
`,Ur=it.div`
|
|
1664
1664
|
font-size: 12px;
|
|
1665
1665
|
line-height: 18px;
|
|
1666
1666
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1667
1667
|
font-style: normal;
|
|
1668
1668
|
font-weight: 400;
|
|
1669
1669
|
letter-spacing: 0.24px;
|
|
1670
|
-
`,
|
|
1670
|
+
`,zr=it.div`
|
|
1671
1671
|
display: flex;
|
|
1672
1672
|
flex-direction: column;
|
|
1673
1673
|
flex: 1;
|
|
@@ -1677,8 +1677,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1677
1677
|
justify-content: center;
|
|
1678
1678
|
align-items: flex-start;
|
|
1679
1679
|
margin-top: 16px;
|
|
1680
|
-
`,
|
|
1681
|
-
${e=>
|
|
1680
|
+
`,Cl=it.textarea`
|
|
1681
|
+
${e=>k(e)} {
|
|
1682
1682
|
margin-top: 16px;
|
|
1683
1683
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1684
1684
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
@@ -1688,8 +1688,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1688
1688
|
width: 100%;
|
|
1689
1689
|
height: 100px;
|
|
1690
1690
|
}
|
|
1691
|
-
`,
|
|
1692
|
-
${e=>
|
|
1691
|
+
`,yl=it.div`
|
|
1692
|
+
${e=>k(e)} {
|
|
1693
1693
|
position: absolute;
|
|
1694
1694
|
top: 16px;
|
|
1695
1695
|
right: 16px;
|
|
@@ -1699,8 +1699,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1699
1699
|
opacity: 0.8;
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
-
`;var gc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:
|
|
1703
|
-
${e=>
|
|
1702
|
+
`;var gc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:C,getFlowSteps:S,getFlowStatus:f,getCurrentStepIndex:v}=Y(),{primaryCTAClickSideEffects:w}=ie(),{mergeAppearanceWithDefault:b}=Q(),[A,y]=R.useState(null),[m,E]=R.useState(""),{hasOpenModals:T,setKeepCompletedFlowOpenDuringSession:B,shouldKeepCompletedFlowOpenDuringSession:L}=we();if(r=b(r),uc(()=>{C(o)},[o,x]),x)return null;let N=c(e);if(!N||F(N)||f(e)===q||d(e)===1&&!L(e)||T())return null;let $=S(e)[d(e)];function D(){return R.createElement(R.Fragment,null,R.createElement(zr,null,R.createElement(Fe,{size:"large",appearance:r,title:$.title,subtitle:$.subtitle})),R.createElement(Mr,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(te=>R.createElement(xl,{className:a("npsNumberButton",r),selected:A===te+1,key:te,onClick:async()=>{B(e),y(te+1),await g(e,$.id,{score:te+1})},appearance:r},te+1))),R.createElement(hl,{appearance:r},R.createElement(Ur,{appearance:r},"Not likely at all"),R.createElement(Ur,{appearance:r},"Extremely likely")))}function ee(){return R.createElement(R.Fragment,null,R.createElement(zr,null,R.createElement(Fe,{appearance:r,title:$.title??"Why did you choose this score?",size:"large"})),R.createElement(Cl,{appearance:r,value:m,onChange:te=>{E(te.target.value)},placeHolder:"Add your optional fedback here..."}),R.createElement(Mr,{appearance:r,className:a("npsNumberButtonContainer",r)},R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await l(e),i&&i($,1,"primary")},appearance:r,title:$.secondaryButtonTitle||"Skip",secondary:!0}),R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await g(e,$.id,{feedbackText:m}),await l(e),i&&i($,1,"primary")},appearance:r,title:$.primaryButtonTitle||"Submit"})))}function U(){return d(e)>=2?null:R.createElement(R.Fragment,null,R.createElement(oe,{appearance:r}),R.createElement(gl,{appearance:r,className:xe(a("npsSurveyContainer",r),n),style:s,type:p},R.createElement(yl,{onClick:async()=>{await l(e),t&&t()},className:a("npsSurveyDismissButton",r)},R.createElement(Te,null)),d(e)==0&&D(),d(e)==1&&ee()))}return p==="inline"?U():R.createElement(fc,null,U())};import Se,{useEffect as Cc}from"react";import Bt from"styled-components";var Sl=Bt.div`
|
|
1703
|
+
${e=>k(e)} {
|
|
1704
1704
|
display: flex;
|
|
1705
1705
|
flex-direction: column;
|
|
1706
1706
|
width: 100%;
|
|
@@ -1710,22 +1710,22 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1710
1710
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1711
1711
|
position: relative;
|
|
1712
1712
|
}
|
|
1713
|
-
`,
|
|
1713
|
+
`,bl=Bt.div`
|
|
1714
1714
|
display: flex;
|
|
1715
1715
|
flex-direction: column;
|
|
1716
1716
|
flex: 1;
|
|
1717
|
-
`,
|
|
1717
|
+
`,wl=Bt.div`
|
|
1718
1718
|
display: flex;
|
|
1719
1719
|
flex-direction: row;
|
|
1720
1720
|
justify-content: center;
|
|
1721
1721
|
align-items: stretch;
|
|
1722
1722
|
gap: 16px;
|
|
1723
1723
|
margin-top: 8px;
|
|
1724
|
-
`,
|
|
1724
|
+
`,Tl=Bt.div`
|
|
1725
1725
|
margin-top: 16px;
|
|
1726
1726
|
margin-bottom: 16px;
|
|
1727
|
-
`,
|
|
1728
|
-
${e=>
|
|
1727
|
+
`,Fl=Bt.div`
|
|
1728
|
+
${e=>k(e)} {
|
|
1729
1729
|
position: absolute;
|
|
1730
1730
|
top: -16px;
|
|
1731
1731
|
right: -16px;
|
|
@@ -1735,8 +1735,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1735
1735
|
opacity: 0.8;
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
|
-
`,
|
|
1739
|
-
${e=>
|
|
1738
|
+
`,kl=Bt.h1`
|
|
1739
|
+
${e=>k(e)} {
|
|
1740
1740
|
font-style: normal;
|
|
1741
1741
|
justify-content: center;
|
|
1742
1742
|
text-align: center;
|
|
@@ -1749,8 +1749,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1749
1749
|
color: ${e=>e.appearance.theme.colorText};
|
|
1750
1750
|
margin-bottom: 8px;
|
|
1751
1751
|
}
|
|
1752
|
-
`,
|
|
1753
|
-
${e=>
|
|
1752
|
+
`,Pl=Bt.h2`
|
|
1753
|
+
${e=>k(e)} {
|
|
1754
1754
|
font-style: normal;
|
|
1755
1755
|
justify-content: center;
|
|
1756
1756
|
text-align: center;
|
|
@@ -1761,10 +1761,10 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1761
1761
|
letter-spacing: 0.28px;
|
|
1762
1762
|
margin-bottom: 8px;
|
|
1763
1763
|
}
|
|
1764
|
-
`;import
|
|
1764
|
+
`;import vl from"react";import xc from"styled-components";var hc=xc.img`
|
|
1765
1765
|
width: 100%;
|
|
1766
1766
|
height: 100%;
|
|
1767
1767
|
min-height: 200px;
|
|
1768
1768
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1769
|
-
`;function
|
|
1769
|
+
`;function Bl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?vl.createElement(Ve,{appearance:t,videoUri:e.videoUri}):e.imageUri?vl.createElement(hc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:l,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:F,updateCustomVariables:C,getFlowSteps:S,getFlowStatus:f,getCurrentStepIndex:v}=Y(),{primaryCTAClickSideEffects:w,secondaryCTAClickSideEffects:b}=ie(),{mergeAppearanceWithDefault:A}=Q(),{setOpenFlowState:y,getOpenFlowState:m,hasOpenModals:E}=we(),[T,B]=[m(e,!0),U=>y(e,U)];if(r=A(r),Cc(()=>{C(o)},[o,x]),x)return null;let L=l(e);if(!L||F(L)||f(e)===q||E())return null;let I=S(e)[v(e)],$=()=>{B(!1),t&&t(),g(e)};function D(){return Se.createElement(Se.Fragment,null,Se.createElement(oe,{appearance:r}),Se.createElement(Sl,{appearance:r,className:xe(a("announcementContainer",r),n),style:s},(p===!0||I.dismissible)&&c=="inline"&&Se.createElement(Fl,{onClick:async()=>{await g(e),t&&t()},className:a("announcementDismissButton",r)},Se.createElement(Te,null)),Se.createElement(bl,null,Se.createElement(kl,{appearance:r,className:a("announcementTitle",r),dangerouslySetInnerHTML:le(I.title)}),I.subtitle&&Se.createElement(Pl,{appearance:r,className:a("announcementSubtitle",r),dangerouslySetInnerHTML:le(I.subtitle)})),(I.imageUri||I.videoUri)&&Se.createElement(Tl,{className:a("announcementMediaContainer",r)},Se.createElement(Bl,{appearance:r,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&Se.createElement(wl,{className:a("announcementCTAContainer",r)},I.secondaryButtonTitle&&Se.createElement(Z,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handleSecondaryButtonClick(),b(I),i&&i(I,v(e),"secondary")},secondary:!0}),I.primaryButtonTitle&&Se.createElement(Z,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{I.handlePrimaryButtonClick(),w(I),!(i&&i(I,v(e),"primary")===!1)&&(await d(e,I.id),await g(e))}}))))}let ee={padding:"24px",maxWidth:"400px"};return c==="inline"?D():c!=="center"?Se.createElement(wo,{modalPosition:c,onClose:$,visible:T,dismissible:p,appearance:r},D()):Se.createElement(He,{appearance:r,onClose:$,visible:T,style:ee,dismissible:p},D())};import*as qo from"react";import El from"react";var Al=({as:e="span",children:t,variant:o="Body1",...i})=>El.createElement(Ri,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),Sc=Object.fromEntries(Object.keys(Do).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>El.createElement(Al,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),Wr=Object.assign(Al,Sc);var Il=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return qo.createElement(Zi,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},qo.createElement(Wr,{color:(s=ao[r])==null?void 0:s.color,fontWeight:"semibold"},i))},bc=Object.fromEntries(Object.keys(ao).map(e=>{let t=o=>qo.createElement(Il,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),wc=Object.assign(Il,bc);export{lo as Box,wc as Button,Qe as CheckBox,Jo as FlowType,st as FormLabel,pr as FormTextField,yc as FrigadeAnnouncement,mc as FrigadeBanner,Nr as FrigadeChecklist,Je as FrigadeDefaultAppearance,dc as FrigadeEmbeddedTip,Vi as FrigadeForm,jd as FrigadeGuide,zd as FrigadeHeroChecklist,gc as FrigadeNPSSurvey,_d as FrigadeProgressBadge,Xp as FrigadeProvider,ac as FrigadeSupportWidget,rc as FrigadeTour,$t as ProgressRing,Wr as Text,Tr as tokens,we as useFlowOpens,Xt as useFlowResponses,Y as useFlows,Sr as useOrganization,Jt as useUser,Be as useUserFlowStates};
|
|
1770
1770
|
//# sourceMappingURL=index.mjs.map
|