@frigade/react 1.32.37 → 1.32.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +158 -158
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +198 -198
- 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 mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import{ThemeProvider as Ta}from"styled-components";import ct,{useContext as ya,useEffect as yo,useState as jo}from"react";import{useCallback as lt,useContext as qs,useEffect as Ys}from"react";import Io,{useMemo as Ds}from"react";var sr="1.32.37 ";var Se="https://api.frigade.com/v1/public/",Ee="NOT_STARTED_STEP",X="COMPLETED_FLOW",oo="ABORTED_FLOW",st="STARTED_FLOW",Ie="NOT_STARTED_FLOW",Ne="COMPLETED_STEP",ro="STARTED_STEP";function Oe(){let{publicApiKey:e,userId:t}=Io.useContext(K);return{config:Ds(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":sr,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}var $s="frigade-last-call-at-",Ms="frigade-last-call-data-";function yt(){let{shouldGracefullyDegrade:e}=Io.useContext(K);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),_t();let n=$s+t,r=Ms+t;if(window&&window.localStorage&&o&&o.body&&o.method==="POST"){let s=window.localStorage.getItem(n),p=window.localStorage.getItem(r);if(s&&p&&p==o.body){let d=new Date(s);if(new Date().getTime()-d.getTime()<1e3)return _t()}window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,o.body)}let i;try{i=await fetch(t,o)}catch(s){return _t(s)}return i?i.ok?i:_t(i.statusText):_t()}}function _t(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function bt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Io.useContext(K);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as Gs,useState as lr}from"react";import{useContext as _s,useEffect as Ws,useState as zs}from"react";import Hs from"swr";import{useContext as Us}from"react";function Fe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:r}=Us(K);function i(c,f=!1){return e[c]??f}function s(c,f){t(b=>({...b,[c]:f}))}function p(c){t(f=>{let{[c]:b,...w}=f;return{...w}})}function d(c){r.includes(c)||n(f=>[...f,c])}function a(c){return r.includes(c)}function u(){return Object.values(e).some(c=>c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:u,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var js="unknown";function Ae(){let{config:e}=Oe(),{publicApiKey:t,userId:o,flows:n,setShouldGracefullyDegrade:r}=_s(K),{resetOpenFlowState:i}=Fe(),[s,p]=zs(!1),d={data:n.map(k=>({flowId:k.id,flowState:X,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},a=k=>fetch(k,e).then(x=>{if(x.ok)return x.json();throw new Error("Failed to fetch user flow states")}).catch(x=>(console.log(`Error fetching ${k}: ${x}. Will gracefully degrade and hide Frigade`),r(!0),d)),{data:u,isLoading:c,mutate:f,error:b}=Hs(t&&n&&o?`${Se}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,a,{revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=u==null?void 0:u.data;Ws(()=>{!s&&!c&&w&&p(!0)},[w,s,c]);async function S(k){if(w){let x=w.find(m=>m.flowId===k);x&&x.flowState!==X&&(x.flowState=X),await f(Promise.resolve({...u,data:w}),{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function g(k,x,m){if(w){let C=w.find(E=>E.flowId===k);C&&(C.stepStates[x]=m,C.flowState=st),await f(Promise.resolve({...u,data:w}),{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function P(k,x,m){if(w){let C=w.find(E=>E.flowId===k);C&&(C.lastStepId=x,C.stepStates[x]=m,C.flowState=st),await f({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function T(k){if(w){let x=w.find(m=>m.flowId===k);x&&x.flowState!==Ie&&(x.flowState=Ie,x.lastStepId=js,Object.keys(x.stepStates).forEach(m=>{x.stepStates[m].actionType=Ee,x.stepStates[m].createdAt=new Date().toISOString()}),await f({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1}),i(k))}}async function A(k,x){if(w){let m=w.find(C=>C.flowId===k);m&&m.stepStates[x]!==Ee&&(m.stepStates[x]=Ee),await f({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!s,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:g,optimisticallyMarkStepNotStarted:A,optimisticallyMarkStepStarted:P,error:b}}function Wt(){let{config:e}=Oe(),{userFlowStatesData:t,mutateUserFlowState:o}=Ae(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:i,setFlowResponses:s}=Gs(K),[p,d]=lr(new Set),[a,u]=lr(new Set),c=yt();function f(S){let g=JSON.stringify(S);if(p.has(g))return null;p.add(g),d(p),a.add(S),u(a);let P=i==null?void 0:i.find(T=>T.flowSlug===S.flowSlug&&T.stepId===S.stepId&&T.actionType===S.actionType&&T.createdAt===S.createdAt);return c(`${Se}flowResponses`,{...e,method:"POST",body:g}).then(T=>{T.status!==200&&T.status!==201?(console.log("Failed to send flow response for step "+S.stepId+". Will retry again later."),r([...n,S])):P||s(A=>[...A??[],S])})}async function b(S){S.foreignUserId&&(S.actionType===st||S.actionType===Ie?await f(S):S.actionType===X?await f(S):S.actionType===ro?await f(S):S.actionType===Ne?await f(S):S.actionType===oo?await f(S):S.actionType===Ee&&await f(S))}function w(){let S=[];return t==null||t.forEach(g=>{if(g&&g.stepStates&&Object.keys(g.stepStates).length!==0)for(let P in g.stepStates){let T=g.stepStates[P];S.push({foreignUserId:g.foreignUserId,flowSlug:g.flowId,stepId:T.stepId,actionType:T.actionType,data:{},createdAt:new Date(T.createdAt),blocked:T.blocked,hidden:T.hidden})}}),[...S,...i]}return{addResponse:b,setFlowResponses:s,getFlowResponses:w}}import Xs from"swr";var Vs=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ar=e=>{let t=Vs.exec(e);if(t===null)return null;let o=null;return t.forEach((n,r)=>{let i=Ks(n,"'","");i.startsWith("flow_")&&(o=i)}),o},Ks=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function J(){let{config:e}=Oe(),{flows:t,setFlows:o,userId:n,publicApiKey:r,customVariables:i,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:a,setShouldGracefullyDegrade:u}=qs(K),c={data:[]},{verifySDKInitiated:f}=bt(),{addResponse:b,getFlowResponses:w}=Wt(),S=h=>fetch(h,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${h} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),u(!0),c)).catch(y=>(console.log(`Error fetching ${h}: ${y}. Will gracefully degrade and hide Frigade`),u(!0),c)),{userFlowStatesData:g,isLoadingUserFlowStateData:P,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:k,optimisticallyMarkStepNotStarted:x,optimisticallyMarkStepStarted:m}=Ae(),{data:C,error:E,isLoading:M}=Xs(r?`${Se}flows`:null,S,{keepPreviousData:!0});Ys(()=>{if(E){console.error(E);return}C&&C.data&&(C.data=o(C.data))},[C,E]);function $(h){if(M)return null;let y=t.find(v=>v.slug===h);return!y&&t.length>0&&!P&&!M?(console.log(`Flow with slug ${h} not found`),null):(y==null?void 0:y.active)===!1?null:y}function U(h){var j;if(!$(h))return[];let y=$(h).data;return y?(y=B(y),(((j=JSON.parse(y))==null?void 0:j.data)??[]).map(le=>{let z=Te(le);return{handleSecondaryButtonClick:()=>{le.skippable===!0&&W(h,le.id,{skipped:!0})},...le,complete:N(h,le.id)===Ne||z>=1,blocked:V(h,le.id),hidden:we(h,le.id),handlePrimaryButtonClick:()=>{(!le.completionCriteria&&(le.autoMarkCompleted||le.autoMarkCompleted===void 0)||le.completionCriteria&&le.autoMarkCompleted===!0)&&W(h,le.id)},progress:z}}).filter(le=>le.hidden!==!0)):[]}function B(h){return h.replace(/\${(.*?)}/g,(y,v)=>i[v]!==void 0?String(i[v]):"")}function H(h){if(!$(h))return[];let y=$(h).data;return y?(y=B(y),JSON.parse(y)??{}):[]}function I(h,y){s(v=>({...v,[h]:y}))}function _(h){!P&&!M&&h&&JSON.stringify(i)!=JSON.stringify({...i,...h})&&Object.keys(h).forEach(y=>{I(y,h[y])})}let te=lt(async(h,y,v)=>{f();let j={foreignUserId:n,flowSlug:h,stepId:y,actionType:ro,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};oe(j)&&(await m(h,y,j),b(j))},[n,g]),q=lt(async(h,y,v)=>{f();let j={foreignUserId:n,flowSlug:h,stepId:y,actionType:Ee,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};oe(j)&&(await x(h,y),b(j))},[n,g]),W=lt(async(h,y,v)=>{f();let j={foreignUserId:n,flowSlug:h,stepId:y,actionType:Ne,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};oe(j)&&(await k(h,y,j),b(j))},[n,g]),be=lt(async(h,y)=>{if(f(),ce(h)===Ie)return;let v={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:Ie,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await A(h),oe(v)&&b(v)},[n,g]),me=lt(async(h,y)=>{f();let v={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:st,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};oe(v)&&b(v)},[n,g]),G=lt(async(h,y)=>{f();let v={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:X,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};oe(v)&&(await T(h),b(v))},[n,g]),L=lt(async(h,y)=>{f();let v={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:oo,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};oe(v)&&(await T(h),b(v))},[n,g]);function oe(h){var y;if(!g&&h.actionType===Ee)return!1;if(g){let v=g.find(j=>j.flowId===h.flowSlug);if(h.actionType===Ee&&(!(v!=null&&v.stepStates[h.stepId])||v.stepStates[h.stepId].actionType===Ee)||v&&((y=v.stepStates[h.stepId])==null?void 0:y.actionType)===h.actionType||v&&v.flowState===X&&h.actionType===X)return!1}return!0}function N(h,y){let v=ve(h,y);return P?null:v?v.actionType:Ee}function V(h,y){let v=ve(h,y);return v?v.blocked:!1}function we(h,y){let v=ve(h,y);return v?v.hidden:!1}function ve(h,y){if(P)return null;let v=g==null?void 0:g.find(j=>j.flowId===h);return!v||!v.stepStates[y]?null:v.stepStates[y]??null}function St(h){var v;if(P||!g)return null;if(ce(h)===Ie)return U(h)[0]??null;let y=(v=g.find(j=>j.flowId===h))==null?void 0:v.lastStepId;return y?U(h).find(j=>j.id===y):null}function rt(h){let y=St(h);if(!y)return 0;let v=U(h).findIndex(j=>j.id===y.id)??0;return N(h,y.id)===Ne&&v<U(h).length-1?v+1:v}function Te(h){if(!h.completionCriteria)return;let y=ar(h.completionCriteria);if(y===null)return;let v=ze(y),j=He(y);return j===0?void 0:v/j}function ce(h){let y=g==null?void 0:g.find(v=>v.flowId===h);return y?y.flowState:null}function ze(h){let y=U(h);return y.length===0?0:y.filter(j=>N(h,j.id)===Ne).length}function He(h){return U(h).length}function Y(h){return JSON.parse(t.find(y=>y.slug===h).data)}function fe(h){if(P)return!0;if(h!=null&&h.targetingLogic&&g){let y=g.find(v=>v.flowId===h.slug);if(y)return y.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function it(h){return!fe($(h))}return{getFlow:$,getFlowData:Y,isLoading:P||M,getStepStatus:N,getFlowSteps:U,getCurrentStepIndex:rt,markStepStarted:te,markStepCompleted:W,markFlowNotStarted:be,markFlowStarted:me,markFlowCompleted:G,markFlowAborted:L,markStepNotStarted:q,getFlowStatus:ce,getNumberOfStepsCompleted:ze,getNumberOfSteps:He,targetingLogicShouldHideFlow:fe,setCustomVariable:I,updateCustomVariables:_,customVariables:i,getStepOptionalProgress:Te,getFlowMetadata:H,isStepBlocked:V,isStepHidden:we,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:it}}import{useCallback as pr,useContext as Js,useEffect as Qs}from"react";var wt="guest_";function No(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:r}=Js(K),{config:i}=Oe(),{mutateUserFlowState:s}=Ae(),p=yt(),{verifySDKInitiated:d}=bt();Qs(()=>{if(e&&!t){if(e.startsWith(wt))return;let c=`frigade-user-registered-${e}`;localStorage.getItem(c)||(p(`${Se}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(c,"true"))}},[e,r,t]);let a=pr(async c=>{d();let f={foreignId:e,properties:c};await p(`${Se}users`,{...i,method:"POST",body:JSON.stringify(f)}),n(b=>({...b,...c})),s()},[e,i,r,s]),u=pr(async(c,f)=>{d();let w={foreignId:e,events:[{event:c,properties:f}]};await p(`${Se}users`,{...i,method:"POST",body:JSON.stringify(w)}),s()},[e,i,s]);return{userId:e,setUserId:o,addPropertiesToUser:a,trackEventForUser:u}}import{v4 as ba}from"uuid";import $e,{useEffect as ha,useState as xa}from"react";import je,{useEffect as rl}from"react";import no from"styled-components";import Zs from"react";import Rs from"styled-components";var dr="fr-",zt="cfr-";function l(e,t){let o=`${dr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+zt+e}return o}function F(e){if(!e.className||e.className.indexOf(zt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(dr)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function Lo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function at(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Lo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function ge(...e){return e.filter(Boolean).join(" ")}function cr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var el=Rs.div`
|
|
2
|
+
import ut,{createContext as wa,useEffect as Vo,useState as Be}from"react";import{ThemeProvider as Ta}from"styled-components";import mt,{useContext as ya,useEffect as bo,useState as jo}from"react";import{useCallback as at,useContext as Ys,useEffect as Xs}from"react";import No,{useMemo as $s}from"react";var lr="1.32.38 ";var Te="https://api.frigade.com/v1/public/",Ae="NOT_STARTED_STEP",q="COMPLETED_FLOW",oo="ABORTED_FLOW",lt="STARTED_FLOW",Ne="NOT_STARTED_FLOW",Le="COMPLETED_STEP",ro="STARTED_STEP";function De(){let{publicApiKey:e,userId:t}=No.useContext(V);return{config:$s(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":lr,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}var Ms="frigade-last-call-at-",Us="frigade-last-call-data-";function yt(){let{shouldGracefullyDegrade:e}=No.useContext(V);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),_t();let n=Ms+t,r=Us+t;if(window&&window.localStorage&&o&&o.body&&o.method==="POST"){let s=window.localStorage.getItem(n),p=window.localStorage.getItem(r);if(s&&p&&p==o.body){let d=new Date(s);if(new Date().getTime()-d.getTime()<1e3)return _t()}window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,o.body)}let i;try{i=await fetch(t,o)}catch(s){return _t(s)}return i?i.ok?i:_t(i.statusText):_t()}}function _t(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function bt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=No.useContext(V);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as Vs,useState as ar}from"react";import{useContext as Ws,useEffect as zs,useState as Hs}from"react";import Gs from"swr";import{useContext as _s}from"react";function Pe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:r}=_s(V);function i(c,f=!1){return e[c]??f}function s(c,f){t(b=>({...b,[c]:f}))}function p(c){t(f=>{let{[c]:b,...w}=f;return{...w}})}function d(c){r.includes(c)||n(f=>[...f,c])}function a(c){return r.includes(c)}function u(){return Object.values(e).some(c=>c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:u,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var js="unknown";function Ie(){let{config:e}=De(),{publicApiKey:t,userId:o,flows:n,setShouldGracefullyDegrade:r}=Ws(V),{resetOpenFlowState:i}=Pe(),[s,p]=Hs(!1),d={data:n.map(k=>({flowId:k.id,flowState:q,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},a=k=>fetch(k,e).then(x=>{if(x.ok)return x.json();throw new Error("Failed to fetch user flow states")}).catch(x=>(console.log(`Error fetching ${k}: ${x}. Will gracefully degrade and hide Frigade`),r(!0),d)),{data:u,isLoading:c,mutate:f,error:b}=Gs(t&&n&&o?`${Te}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,a,{revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=u==null?void 0:u.data;zs(()=>{!s&&!c&&w&&p(!0)},[w,s,c]);async function S(k){if(w){let x=w.find(m=>m.flowId===k);x&&x.flowState!==q&&(x.flowState=q),await f(Promise.resolve({...u,data:w}),{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function g(k,x,m){if(w){let C=w.find(E=>E.flowId===k);C&&(C.stepStates[x]=m,C.flowState=lt),await f(Promise.resolve({...u,data:w}),{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function P(k,x,m){if(w){let C=w.find(E=>E.flowId===k);C&&(C.lastStepId=x,C.stepStates[x]=m,C.flowState=lt),await f({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function T(k){if(w){let x=w.find(m=>m.flowId===k);x&&x.flowState!==Ne&&(x.flowState=Ne,x.lastStepId=js,Object.keys(x.stepStates).forEach(m=>{x.stepStates[m].actionType=Ae,x.stepStates[m].createdAt=new Date().toISOString()}),await f({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1}),i(k))}}async function A(k,x){if(w){let m=w.find(C=>C.flowId===k);m&&m.stepStates[x]!==Ae&&(m.stepStates[x]=Ae),await f({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!s,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:g,optimisticallyMarkStepNotStarted:A,optimisticallyMarkStepStarted:P,error:b}}function Wt(){let{config:e}=De(),{userFlowStatesData:t,mutateUserFlowState:o}=Ie(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:i,setFlowResponses:s}=Vs(V),[p,d]=ar(new Set),[a,u]=ar(new Set),c=yt();function f(S){let g=JSON.stringify(S);if(p.has(g))return null;p.add(g),d(p),a.add(S),u(a);let P=i==null?void 0:i.find(T=>T.flowSlug===S.flowSlug&&T.stepId===S.stepId&&T.actionType===S.actionType&&T.createdAt===S.createdAt);return c(`${Te}flowResponses`,{...e,method:"POST",body:g}).then(T=>{T.status!==200&&T.status!==201?(console.log("Failed to send flow response for step "+S.stepId+". Will retry again later."),r([...n,S])):P||s(A=>[...A??[],S])})}async function b(S){S.foreignUserId&&(S.actionType===lt||S.actionType===Ne?await f(S):S.actionType===q?await f(S):S.actionType===ro?await f(S):S.actionType===Le?await f(S):S.actionType===oo?await f(S):S.actionType===Ae&&await f(S))}function w(){let S=[];return t==null||t.forEach(g=>{if(g&&g.stepStates&&Object.keys(g.stepStates).length!==0)for(let P in g.stepStates){let T=g.stepStates[P];S.push({foreignUserId:g.foreignUserId,flowSlug:g.flowId,stepId:T.stepId,actionType:T.actionType,data:{},createdAt:new Date(T.createdAt),blocked:T.blocked,hidden:T.hidden})}}),[...S,...i]}return{addResponse:b,setFlowResponses:s,getFlowResponses:w}}import Js from"swr";var Ks=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,pr=e=>{let t=Ks.exec(e);if(t===null)return null;let o=null;return t.forEach((n,r)=>{let i=qs(n,"'","");i.startsWith("flow_")&&(o=i)}),o},qs=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Y(){let{config:e}=De(),{flows:t,setFlows:o,userId:n,publicApiKey:r,customVariables:i,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:a,setShouldGracefullyDegrade:u}=Ys(V),c={data:[]},{verifySDKInitiated:f}=bt(),{addResponse:b,getFlowResponses:w}=Wt(),S=h=>fetch(h,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${h} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),u(!0),c)).catch(y=>(console.log(`Error fetching ${h}: ${y}. Will gracefully degrade and hide Frigade`),u(!0),c)),{userFlowStatesData:g,isLoadingUserFlowStateData:P,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:k,optimisticallyMarkStepNotStarted:x,optimisticallyMarkStepStarted:m}=Ie(),{data:C,error:E,isLoading:U}=Js(r?`${Te}flows`:null,S,{keepPreviousData:!0});Xs(()=>{if(E){console.error(E);return}C&&C.data&&(C.data=o(C.data))},[C,E]);function $(h){if(U)return null;let y=t.find(v=>v.slug===h);return!y&&t.length>0&&!P&&!U?(console.log(`Flow with slug ${h} not found`),null):(y==null?void 0:y.active)===!1?null:y}function _(h){var G;if(!$(h))return[];let y=$(h).data;return y?(y=I(y),(((G=JSON.parse(y))==null?void 0:G.data)??[]).map(ae=>{let z=ke(ae);return{handleSecondaryButtonClick:()=>{ae.skippable===!0&&W(h,ae.id,{skipped:!0})},...ae,complete:L(h,ae.id)===Le||z>=1,blocked:N(h,ae.id),hidden:ee(h,ae.id),handlePrimaryButtonClick:()=>{(!ae.completionCriteria&&(ae.autoMarkCompleted||ae.autoMarkCompleted===void 0)||ae.completionCriteria&&ae.autoMarkCompleted===!0)&&W(h,ae.id)},progress:z}}).filter(ae=>ae.hidden!==!0)):[]}function I(h){return h.replace(/\${(.*?)}/g,(y,v)=>i[v]!==void 0?String(i[v]):"")}function H(h){if(!$(h))return[];let y=$(h).data;return y?(y=I(y),JSON.parse(y)??{}):[]}function B(h,y){s(v=>({...v,[h]:y}))}function M(h){!P&&!U&&h&&JSON.stringify(i)!=JSON.stringify({...i,...h})&&Object.keys(h).forEach(y=>{B(y,h[y])})}let re=at(async(h,y,v)=>{f();let G={foreignUserId:n,flowSlug:h,stepId:y,actionType:ro,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};fe(G)&&(await m(h,y,G),b(G))},[n,g]),X=at(async(h,y,v)=>{f();let G={foreignUserId:n,flowSlug:h,stepId:y,actionType:Ae,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};fe(G)&&(await x(h,y),b(G))},[n,g]),W=at(async(h,y,v)=>{f();let G={foreignUserId:n,flowSlug:h,stepId:y,actionType:Le,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};fe(G)&&(await k(h,y,G),b(G))},[n,g]),be=at(async(h,y)=>{if(f(),ue(h)===Ne)return;let v={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:Ne,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await A(h),fe(v)&&b(v)},[n,g]),me=at(async(h,y)=>{f();let v={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:lt,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};fe(v)&&b(v)},[n,g]),j=at(async(h,y)=>{f();let v={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:q,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};fe(v)&&(await T(h),b(v))},[n,g]),J=at(async(h,y)=>{f();let v={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:oo,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};fe(v)&&(await T(h),b(v))},[n,g]);function fe(h){var y;if(!g&&h.actionType===Ae)return!1;if(g){let v=g.find(G=>G.flowId===h.flowSlug);if(h.actionType===Ae&&(!(v!=null&&v.stepStates[h.stepId])||v.stepStates[h.stepId].actionType===Ae)||v&&((y=v.stepStates[h.stepId])==null?void 0:y.actionType)===h.actionType||v&&v.flowState===q&&h.actionType===q)return!1}return!0}function L(h,y){let v=te(h,y);return P?null:v?v.actionType:Ae}function N(h,y){let v=te(h,y);return v?v.blocked:!1}function ee(h,y){let v=te(h,y);return v?v.hidden:!1}function te(h,y){if(P)return null;let v=g==null?void 0:g.find(G=>G.flowId===h);return!v||!v.stepStates[y]?null:v.stepStates[y]??null}function we(h){var v;if(P||!g)return null;if(ue(h)===Ne)return _(h)[0]??null;let y=(v=g.find(G=>G.flowId===h))==null?void 0:v.lastStepId;return y?_(h).find(G=>G.id===y):null}function it(h){let y=we(h);if(!y)return 0;let v=_(h).findIndex(G=>G.id===y.id)??0;return L(h,y.id)===Le&&v<_(h).length-1?v+1:v}function ke(h){if(!h.completionCriteria)return;let y=pr(h.completionCriteria);if(y===null)return;let v=He(y),G=Ge(y);return G===0?void 0:v/G}function ue(h){let y=g==null?void 0:g.find(v=>v.flowId===h);return y?y.flowState:null}function He(h){let y=_(h);return y.length===0?0:y.filter(G=>L(h,G.id)===Le).length}function Ge(h){return _(h).length}function K(h){return JSON.parse(t.find(y=>y.slug===h).data)}function he(h){if(P)return!0;if(h!=null&&h.targetingLogic&&g){let y=g.find(v=>v.flowId===h.slug);if(y)return y.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function nt(h){return!he($(h))}return{getFlow:$,getFlowData:K,isLoading:P||U,getStepStatus:L,getFlowSteps:_,getCurrentStepIndex:it,markStepStarted:re,markStepCompleted:W,markFlowNotStarted:be,markFlowStarted:me,markFlowCompleted:j,markFlowAborted:J,markStepNotStarted:X,getFlowStatus:ue,getNumberOfStepsCompleted:He,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:he,setCustomVariable:B,updateCustomVariables:M,customVariables:i,getStepOptionalProgress:ke,getFlowMetadata:H,isStepBlocked:N,isStepHidden:ee,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:nt}}import{useCallback as dr,useContext as Qs,useEffect as Zs}from"react";var wt="guest_";function Lo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:r}=Qs(V),{config:i}=De(),{mutateUserFlowState:s}=Ie(),p=yt(),{verifySDKInitiated:d}=bt();Zs(()=>{if(e&&!t){if(e.startsWith(wt))return;let c=`frigade-user-registered-${e}`;localStorage.getItem(c)||(p(`${Te}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(c,"true"))}},[e,r,t]);let a=dr(async c=>{d();let f={foreignId:e,properties:c};await p(`${Te}users`,{...i,method:"POST",body:JSON.stringify(f)}),n(b=>({...b,...c})),s()},[e,i,r,s]),u=dr(async(c,f)=>{d();let w={foreignId:e,events:[{event:c,properties:f}]};await p(`${Te}users`,{...i,method:"POST",body:JSON.stringify(w)}),s()},[e,i,s]);return{userId:e,setUserId:o,addPropertiesToUser:a,trackEventForUser:u}}import{v4 as ba}from"uuid";import Me,{useEffect as ha,useState as xa}from"react";import je,{useEffect as il}from"react";import no from"styled-components";import Rs from"react";import el from"styled-components";var cr="fr-",zt="cfr-";function l(e,t){let o=`${cr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+zt+e}return o}function F(e){if(!e.className||e.className.indexOf(zt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(cr)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function Oo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function pt(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Oo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function mr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var tl=el.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,ur=({onClose:e,appearance:t})=>Rs.createElement(tl,{className:l("modalBackground",t),onClick:()=>e()});import io from"react";import ol from"styled-components";var rl=ol.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,ve=()=>io.createElement(rl,null,io.createElement("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io.createElement("rect",{y:"1.39844",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(-45 0 1.39844)",fill:"currentColor"}),io.createElement("rect",{x:"12.6023",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(45 12.6023 0)",fill:"currentColor"})));import{Portal as nl}from"react-portal";var sl=no.div`
|
|
31
31
|
${e=>F(e)} {
|
|
32
32
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
33
33
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -45,7 +45,7 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
45
45
|
|
|
46
46
|
border-radius: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)??8}}px;
|
|
47
47
|
|
|
48
|
-
${e=>
|
|
48
|
+
${e=>pt(e)}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
padding: 32px;
|
|
@@ -72,10 +72,10 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
72
72
|
opacity: 1;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
`,
|
|
75
|
+
`,ll=no.div`
|
|
76
76
|
position: relative;
|
|
77
77
|
flex: 0 1 auto;
|
|
78
|
-
`,
|
|
78
|
+
`,al=no.div`
|
|
79
79
|
position: absolute;
|
|
80
80
|
top: 24px;
|
|
81
81
|
right: 24px;
|
|
@@ -85,14 +85,14 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
85
85
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
86
86
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
87
87
|
}
|
|
88
|
-
`,
|
|
88
|
+
`,pl=no.div`
|
|
89
89
|
overflow: scroll;
|
|
90
90
|
flex: 1 1;
|
|
91
91
|
display: flex;
|
|
92
92
|
::-webkit-scrollbar {
|
|
93
93
|
display: none;
|
|
94
94
|
}
|
|
95
|
-
`,
|
|
95
|
+
`,Qe=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:r,appearance:i,dismissible:s=!0})=>(il(()=>{let p=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",p),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",p)}},[e,t]),t?je.createElement(nl,null,je.createElement(ur,{appearance:i,onClose:()=>{s&&e()}}),je.createElement(sl,{appearance:i,className:l("modalContainer",i),styleOverrides:n},s&&je.createElement(al,{className:l("modalClose",i),onClick:()=>e(),appearance:i},je.createElement(ve,null)),o&&je.createElement(ll,null,o),je.createElement(pl,null,r))):je.createElement(je.Fragment,null));import Ze,{useEffect as dl}from"react";import so from"styled-components";import{Portal as cl}from"react-portal";var ml=so.div`
|
|
96
96
|
${e=>F(e)} {
|
|
97
97
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
98
98
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -110,10 +110,10 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
110
110
|
bottom: 0;
|
|
111
111
|
margin-right: 28px;
|
|
112
112
|
margin-bottom: 28px;
|
|
113
|
-
`,
|
|
113
|
+
`,ul=so.div`
|
|
114
114
|
position: relative;
|
|
115
115
|
flex: 1;
|
|
116
|
-
`,
|
|
116
|
+
`,fl=so.div`
|
|
117
117
|
position: absolute;
|
|
118
118
|
top: 24px;
|
|
119
119
|
right: 24px;
|
|
@@ -123,13 +123,13 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
123
123
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
124
124
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
125
125
|
}
|
|
126
|
-
`,
|
|
126
|
+
`,gl=so.div`
|
|
127
127
|
overflow: scroll;
|
|
128
128
|
flex: 5;
|
|
129
129
|
::-webkit-scrollbar {
|
|
130
130
|
display: none;
|
|
131
131
|
}
|
|
132
|
-
`,
|
|
132
|
+
`,fr=({onClose:e,visible:t,headerContent:o=null,children:n,appearance:r})=>(dl(()=>{let i=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",i),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",i)}},[e,t]),t?Ze.createElement(cl,null,Ze.createElement(ml,{appearance:r,className:l("cornerModalContainer",r)},Ze.createElement(fl,{className:l("cornerModalClose",r),onClick:()=>e()},Ze.createElement(ve,null)),o&&Ze.createElement(ul,null,o),Ze.createElement(gl,null,n))):Ze.createElement(Ze.Fragment,null));import{useContext as hl}from"react";function Q(){let{defaultAppearance:e}=hl(V);function t(o){let n=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(n.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(n.theme,o.theme??{})}:n}return{mergeAppearanceWithDefault:t}}import fo,{useEffect as vl,useState as Ir}from"react";import Br from"styled-components";import po,{useEffect as xl,useState as Sr}from"react";import $o from"styled-components";import lo from"styled-components";var gr=lo.label`
|
|
133
133
|
${e=>F(e)} {
|
|
134
134
|
font-size: 14px;
|
|
135
135
|
line-height: 20px;
|
|
@@ -137,14 +137,14 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
137
137
|
margin-top: 10px;
|
|
138
138
|
}
|
|
139
139
|
display: flex;
|
|
140
|
-
`,
|
|
140
|
+
`,hr=lo.label`
|
|
141
141
|
${e=>F(e)} {
|
|
142
142
|
font-size: 12px;
|
|
143
143
|
line-height: 20px;
|
|
144
144
|
margin-bottom: 5px;
|
|
145
145
|
}
|
|
146
146
|
display: flex;
|
|
147
|
-
`,
|
|
147
|
+
`,xr=lo.span`
|
|
148
148
|
font-weight: 400;
|
|
149
149
|
font-size: 14px;
|
|
150
150
|
line-height: 22px;
|
|
@@ -157,11 +157,11 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
157
157
|
align-items: flex-start;
|
|
158
158
|
justify-content: left;
|
|
159
159
|
margin-bottom: 10px;
|
|
160
|
-
`;import
|
|
160
|
+
`;import Do from"react";function Re({title:e,required:t,appearance:o}){return Do.createElement(ao,null,t?Do.createElement(xr,null,"*"):null,Do.createElement(gr,{className:l("formLabel",o)},e))}import Cr from"react";function Tt({title:e,appearance:t}){return e?Cr.createElement(ao,null,Cr.createElement(hr,{className:l("formSubLabel",t)},e)):null}var Cl=$o.div`
|
|
161
161
|
display: flex;
|
|
162
162
|
flex-direction: column;
|
|
163
163
|
width: 100%;
|
|
164
|
-
|
|
164
|
+
`,Mo=$o.input`
|
|
165
165
|
${e=>F(e)} {
|
|
166
166
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
167
167
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -177,7 +177,7 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
177
177
|
box-sizing: border-box;
|
|
178
178
|
padding: 0 10px;
|
|
179
179
|
margin-bottom: 10px;
|
|
180
|
-
`,
|
|
180
|
+
`,Sl=$o.textarea`
|
|
181
181
|
${e=>F(e)} {
|
|
182
182
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
183
183
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -193,13 +193,13 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
193
193
|
min-height: 70px;
|
|
194
194
|
box-sizing: border-box;
|
|
195
195
|
margin-bottom: 10px;
|
|
196
|
-
`;function
|
|
196
|
+
`;function yr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:n,inputData:r}){let i=e,[s,p]=Sr((r==null?void 0:r.text)||""),[d,a]=Sr(!1),u=Mo;xl(()=>{s===""&&!d&&(a(!0),c(""))},[]);function c(b){if(p(b),i.required===!0&&b.trim()===""){n([{id:i.id,message:`${i.title} is required`}]);return}n([]),o({text:b})}i.multiline&&(u=Sl);function f(){var b;switch((b=i==null?void 0:i.validation)==null?void 0:b.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return po.createElement(Cl,null,po.createElement(Re,{title:i.title,required:i.required,appearance:t.appearance}),po.createElement(u,{className:l("inputComponent",t.appearance),value:s,onChange:b=>{c(b.target.value)},appearance:t.appearance,placeholder:i.placeholder,type:f()}),po.createElement(Tt,{title:i.subtitle,appearance:t.appearance}))}import $e,{useEffect as br,useState as wr}from"react";import Tr from"styled-components";var yl=Tr.div`
|
|
197
197
|
display: flex;
|
|
198
198
|
flex-direction: column;
|
|
199
199
|
width: 100%;
|
|
200
200
|
-webkit-appearance: none;
|
|
201
201
|
appearance: none;
|
|
202
|
-
`,
|
|
202
|
+
`,bl=Tr.select`
|
|
203
203
|
${e=>F(e)} {
|
|
204
204
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
205
205
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -223,13 +223,13 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
223
223
|
background-repeat: no-repeat;
|
|
224
224
|
background-size: 1.5em 1.5em;
|
|
225
225
|
-webkit-print-color-adjust: exact;
|
|
226
|
-
`,co="null";function
|
|
226
|
+
`,co="null";function Fr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:r}){var u,c,f,b,w,S;let i=e,[s,p]=wr(((u=n==null?void 0:n.choice)==null?void 0:u[0])||""),[d,a]=wr(!1);return br(()=>{var g,P,T,A;if(s===""&&!d){if(a(!0),i.requireSelection){p(co);return}if(i.defaultValue&&((g=i.props.options)!=null&&g.find(k=>k.id===i.defaultValue))){let k=(P=i.props.options)==null?void 0:P.find(x=>x.id===i.defaultValue);p(k.id),o({choice:[k.id]})}else p(((T=i.props.options)==null?void 0:T[0].id)||""),o({choice:[((A=i.props.options)==null?void 0:A[0].id)||""]})}},[]),br(()=>{i.requireSelection&&s===co?r([{message:"Please select an option",id:i.id}]):r([])},[s]),$e.createElement(yl,null,$e.createElement(Re,{title:i.title,required:!1,appearance:t.appearance}),$e.createElement(bl,{value:s,onChange:g=>{p(g.target.value),o({choice:[g.target.value]})},placeholder:i.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},i.requireSelection&&$e.createElement("option",{key:co,value:co},"Select an option"),(c=i.props.options)==null?void 0:c.map(g=>$e.createElement("option",{key:g.id,value:g.id},g.title))),((b=(f=i.props.options)==null?void 0:f.find(g=>g.id===s))==null?void 0:b.isOpenEnded)&&$e.createElement($e.Fragment,null,$e.createElement(Re,{title:((S=(w=i.props.options)==null?void 0:w.find(g=>g.id===s))==null?void 0:S.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),$e.createElement(Mo,{type:"text",placeholder:"Enter your answer here",onChange:g=>{o({choice:[g.target.value]})},appearance:t.appearance})),$e.createElement(Tt,{title:i.subtitle,appearance:t.appearance}))}import mo,{useEffect as kr,useState as Pr}from"react";import vr from"styled-components";var wl=vr.div`
|
|
227
227
|
display: flex;
|
|
228
228
|
flex-direction: column;
|
|
229
229
|
width: 100%;
|
|
230
230
|
-webkit-appearance: none;
|
|
231
231
|
appearance: none;
|
|
232
|
-
`,
|
|
232
|
+
`,Tl=vr.button`
|
|
233
233
|
${e=>F(e)} {
|
|
234
234
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
235
235
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -251,7 +251,7 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
251
251
|
height: 60px;
|
|
252
252
|
padding: 0 18px;
|
|
253
253
|
margin-bottom: 10px;
|
|
254
|
-
`;function
|
|
254
|
+
`;function Er({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n}){var a;let r=e,[i,s]=Pr((n==null?void 0:n.choice)||[]),[p,d]=Pr(!1);return kr(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[]),kr(()=>{o({choice:i})},[i]),mo.createElement(wl,null,mo.createElement(Re,{title:r.title,required:r.required,appearance:t.appearance}),(a=r.props.options)==null?void 0:a.map(u=>mo.createElement(Tl,{appearance:t.appearance,key:u.id,value:u.id,"data-selected":i.includes(u.id),onClick:()=>{if(i.includes(u.id)){s(i.filter(c=>c!==u.id));return}i.length<r.props.maxChoices?s([...i,u.id]):i.length==1&&r.props.maxChoices==1&&s([u.id])}},u.title)),mo.createElement(Tt,{title:r.subtitle,appearance:t.appearance}))}import uo from"react";import Ar from"styled-components";import Fl from"dompurify";function pe(e){return{__html:Fl.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var kl=Ar.h1`
|
|
255
255
|
${e=>F(e)} {
|
|
256
256
|
font-style: normal;
|
|
257
257
|
font-weight: 600;
|
|
@@ -262,7 +262,7 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
262
262
|
margin-bottom: 4px;
|
|
263
263
|
color: ${e=>e.appearance.theme.colorText};
|
|
264
264
|
}
|
|
265
|
-
`,
|
|
265
|
+
`,Pl=Ar.h2`
|
|
266
266
|
${e=>F(e)} {
|
|
267
267
|
font-style: normal;
|
|
268
268
|
font-weight: 400;
|
|
@@ -270,28 +270,28 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
270
270
|
line-height: 20px;
|
|
271
271
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
272
272
|
}
|
|
273
|
-
`;function
|
|
273
|
+
`;function Ce({appearance:e,title:t,subtitle:o,size:n="medium"}){return uo.createElement(uo.Fragment,null,uo.createElement(kl,{appearance:e,className:l(`${n}Title`,e),dangerouslySetInnerHTML:pe(t),size:n}),o&&uo.createElement(Pl,{appearance:e,className:l(`${n}Subtitle`,e),dangerouslySetInnerHTML:pe(o),size:n}))}var El=Br.div`
|
|
274
274
|
display: flex;
|
|
275
275
|
flex-direction: column;
|
|
276
276
|
justify-content: flex-end;
|
|
277
277
|
padding-bottom: 14px;
|
|
278
278
|
overflow: visible;
|
|
279
|
-
`,
|
|
279
|
+
`,Al=Br.div`
|
|
280
280
|
padding-left: 1px;
|
|
281
281
|
padding-right: 1px;
|
|
282
|
-
`,
|
|
282
|
+
`,Il={text:yr,multipleChoice:Fr,multipleChoiceList:Er};function Nr({stepData:e,canContinue:t,setCanContinue:o,onSaveData:n,appearance:r,customFormElements:i}){var S;let s=e.props,[p,d]=Ir(b()||{}),[a,u]=Ir([]),c={...Il,...i};vl(()=>{o(a.length===0)},[a,o]);function f(g,P){let T={...p,[g.id]:P};d(T),n(T),window&&window.localStorage&&window.localStorage.setItem(w(),JSON.stringify(T))}function b(){if(window&&window.localStorage){let g=window.localStorage.getItem(w());if(g)return JSON.parse(g)}return{}}function w(){return`frigade-multiInputStepTypeData-${e.id}`}return fo.createElement(Al,{className:l("multiInput",r)},fo.createElement(Ce,{appearance:r,title:e.title,subtitle:e.subtitle}),fo.createElement(El,{className:l("multiInputContainer",r)},(S=s.data)==null?void 0:S.map(g=>c[g.type]?fo.createElement("span",{key:g.id},c[g.type]({formInput:g,customFormTypeProps:{stepData:e,canContinue:t,setCanContinue:o,onSaveData:n,appearance:r},onSaveInputData:P=>{f(g,P)},inputData:p[g.id],setFormValidationErrors:P=>{u(T=>P.length===0?T.filter(A=>A.id!==g.id):[...T,...P])}})):null)))}import Ft from"styled-components";var Lr=Ft.div`
|
|
283
283
|
align-items: center;
|
|
284
284
|
display: flex;
|
|
285
285
|
justify-content: space-between;
|
|
286
286
|
padding-top: 14px;
|
|
287
|
-
`,
|
|
287
|
+
`,Or=Ft.div`
|
|
288
288
|
display: flex;
|
|
289
289
|
gap: 12px;
|
|
290
|
-
`,
|
|
290
|
+
`,Dr=Ft.div`
|
|
291
291
|
display: flex;
|
|
292
292
|
flex-direction: row;
|
|
293
293
|
flex: 1 1;
|
|
294
|
-
|
|
294
|
+
`,$r=Ft.div`
|
|
295
295
|
display: flex;
|
|
296
296
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
297
297
|
// Otherwise, use 4px padding
|
|
@@ -299,11 +299,11 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
299
299
|
flex-grow: 1;
|
|
300
300
|
flex-basis: 0;
|
|
301
301
|
position: relative;
|
|
302
|
-
|
|
302
|
+
`,Mr=Ft.div`
|
|
303
303
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
304
304
|
position: relative;
|
|
305
305
|
overflow-y: auto;
|
|
306
|
-
`,
|
|
306
|
+
`,Ur=Ft.div`
|
|
307
307
|
display: flex;
|
|
308
308
|
align-self: stretch;
|
|
309
309
|
flex-grow: 1;
|
|
@@ -315,7 +315,7 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
315
315
|
background-position: center;
|
|
316
316
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
317
317
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
318
|
-
`;import Ht from"react";import Bl from"react";import
|
|
318
|
+
`;import Ht from"react";import Bl from"react";import _r from"styled-components";var Nl=_r.button`
|
|
319
319
|
justify-content: center;
|
|
320
320
|
align-content: center;
|
|
321
321
|
${e=>F(e)} {
|
|
@@ -345,7 +345,7 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
345
345
|
opacity: 0.3;
|
|
346
346
|
cursor: not-allowed;
|
|
347
347
|
}
|
|
348
|
-
`,go=
|
|
348
|
+
`,go=_r.div`
|
|
349
349
|
${e=>F(e)} {
|
|
350
350
|
display: flex;
|
|
351
351
|
flex-direction: row;
|
|
@@ -355,14 +355,14 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
355
355
|
margin-right: 8px;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
`,R=({onClick:e,title:t,style:o,disabled:n,type:r="inline",size:i="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a=""})=>{function u(){let c=s?"buttonSecondary":"button";return a===""?c:`${a}${
|
|
358
|
+
`,R=({onClick:e,title:t,style:o,disabled:n,type:r="inline",size:i="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a=""})=>{function u(){let c=s?"buttonSecondary":"button";return a===""?c:`${a}${mr(c)}`}return Bl.createElement(Nl,{secondary:s,appearance:p,disabled:n,onClick:e,style:o,type:r,withMargin:d,size:i,className:l(u(),p)},t)};var Wr=({step:e,canContinue:t,appearance:o,onPrimaryClick:n,onSecondaryClick:r,formType:i,selectedStep:s,steps:p,onBack:d,allowBackNavigation:a})=>{let u=i==="inline"?"inline":"full-width";return Ht.createElement(Lr,{className:l("formCTAContainer",o)},p.length>1&&s!=0&&a&&Ht.createElement(R,{title:"\u2190",onClick:d,secondary:!0,withMargin:!1,type:u,appearance:o}),Ht.createElement(Or,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?Ht.createElement(R,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:u,appearance:o}):null," ",e.primaryButtonTitle?Ht.createElement(R,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:n,type:u,appearance:o}):null))};import Uo from"react";import Ll from"styled-components";var Ol=Ll.div`
|
|
359
359
|
text-align: center;
|
|
360
|
-
`,
|
|
360
|
+
`,zr=({stepCount:e=0,currentStep:t=0,className:o,appearance:n})=>{let{theme:r}=Q().mergeAppearanceWithDefault(n);return Uo.createElement(Ol,{className:o},Uo.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((i,s)=>Uo.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import dt from"react";import kt from"styled-components";import{useContext as Dl}from"react";function ie(){let e=Dl(V);function t(r){n(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){n(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function n(r,i){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";i&&i!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:n}}var $l=kt.div`
|
|
361
361
|
display: flex;
|
|
362
362
|
flex-wrap: wrap;
|
|
363
363
|
align-content: center;
|
|
364
364
|
justify-content: center;
|
|
365
|
-
|
|
365
|
+
`,Ml=kt.div`
|
|
366
366
|
align-content: center;
|
|
367
367
|
align-items: center;
|
|
368
368
|
display: flex;
|
|
@@ -376,10 +376,10 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
376
376
|
flex-basis: 255px;
|
|
377
377
|
flex-grow: 0;
|
|
378
378
|
flex-shrink: 0;
|
|
379
|
-
`,
|
|
379
|
+
`,Ul=kt.img`
|
|
380
380
|
width: 78px;
|
|
381
381
|
height: auto;
|
|
382
|
-
`,
|
|
382
|
+
`,_l=kt.button`
|
|
383
383
|
font-style: normal;
|
|
384
384
|
font-weight: 600;
|
|
385
385
|
font-size: 13px;
|
|
@@ -392,11 +392,11 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
392
392
|
border-radius: 100px;
|
|
393
393
|
padding: 8px 12px;
|
|
394
394
|
margin-top: 16px;
|
|
395
|
-
`,
|
|
395
|
+
`,Wl=kt.h1`
|
|
396
396
|
font-weight: 700;
|
|
397
397
|
font-size: 28px;
|
|
398
398
|
line-height: 34px;
|
|
399
|
-
`,
|
|
399
|
+
`,zl=kt.h2`
|
|
400
400
|
font-style: normal;
|
|
401
401
|
font-weight: 400;
|
|
402
402
|
font-size: 16px;
|
|
@@ -405,7 +405,7 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
405
405
|
margin-top: 12px;
|
|
406
406
|
margin-bottom: 16px;
|
|
407
407
|
max-width: 70%;
|
|
408
|
-
`;function
|
|
408
|
+
`;function Hr({stepData:e,appearance:t}){var n,r;let{handleUrl:o}=ie();return dt.createElement("div",null,dt.createElement(Wl,null,e.title),dt.createElement(zl,null,e.subtitle),dt.createElement($l,null,(r=(n=e.props)==null?void 0:n.links)==null?void 0:r.map(i=>dt.createElement(Ml,{key:i.title},dt.createElement(Ul,{src:i.imageUri}),dt.createElement(_l,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{i.uri&&o(i.uri,i.uriTarget??"_blank")}},i.title)))))}import vt,{useEffect as Yl}from"react";import Co from"styled-components";import _o from"react";var ho=({style:e,className:t})=>_o.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},_o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),_o.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 Gt,{useRef as Hl,useState as Gl}from"react";import xo from"styled-components";var jl=xo.div`
|
|
409
409
|
display: flex;
|
|
410
410
|
align-items: center;
|
|
411
411
|
justify-content: flex-start;
|
|
@@ -413,7 +413,7 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
413
413
|
width: 100%;
|
|
414
414
|
height: 100%;
|
|
415
415
|
position: relative;
|
|
416
|
-
`,
|
|
416
|
+
`,Vl=xo.div`
|
|
417
417
|
position: absolute;
|
|
418
418
|
display: flex;
|
|
419
419
|
align-items: center;
|
|
@@ -432,59 +432,59 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
432
432
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
433
433
|
border-radius: 50%;
|
|
434
434
|
}
|
|
435
|
-
`,
|
|
435
|
+
`,Kl=xo.video`
|
|
436
436
|
width: 100%;
|
|
437
437
|
height: 100%;
|
|
438
438
|
min-height: 200px;
|
|
439
439
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
440
|
-
`,
|
|
440
|
+
`,ql=xo.iframe`
|
|
441
441
|
width: 100%;
|
|
442
442
|
height: 100%;
|
|
443
443
|
min-height: 200px;
|
|
444
444
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
445
|
-
`;function Pt({appearance:e,videoUri:t}){let o=
|
|
445
|
+
`;function Pt({appearance:e,videoUri:t}){let o=Hl(),[n,r]=Gl(!1);if(t.includes("youtube")){let i=t.split("v=")[1],s=i.indexOf("&");return s!==-1&&(i=i.substring(0,s)),Gt.createElement(ql,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${i}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Gt.createElement(jl,{appearance:e},!n&&Gt.createElement(Vl,{onClick:()=>{r(!0),o.current.play()},appearance:e},Gt.createElement(ho,null)),Gt.createElement(Kl,{appearance:e,controls:n,ref:o,play:n,src:t}))}var Xl=Co.div`
|
|
446
446
|
${e=>F(e)} {
|
|
447
447
|
display: flex;
|
|
448
448
|
flex-direction: column;
|
|
449
449
|
justify-content: center;
|
|
450
450
|
}
|
|
451
|
-
`,
|
|
451
|
+
`,Jl=Co.img`
|
|
452
452
|
${e=>F(e)} {
|
|
453
453
|
width: 100%;
|
|
454
454
|
height: auto;
|
|
455
455
|
max-height: 250px;
|
|
456
456
|
margin-bottom: 24px;
|
|
457
457
|
}
|
|
458
|
-
`,
|
|
458
|
+
`,Ql=Co.div`
|
|
459
459
|
${e=>F(e)} {
|
|
460
460
|
margin-bottom: 24px;
|
|
461
461
|
}
|
|
462
|
-
`,
|
|
462
|
+
`,Zl=Co.div`
|
|
463
463
|
${e=>F(e)} {
|
|
464
464
|
width: 100%;
|
|
465
465
|
height: auto;
|
|
466
466
|
max-height: 250px;
|
|
467
467
|
margin-bottom: 24px;
|
|
468
468
|
}
|
|
469
|
-
`;function
|
|
470
|
-
${e=>
|
|
471
|
-
`,
|
|
469
|
+
`;function Gr({stepData:e,appearance:t,setCanContinue:o}){return Yl(()=>{o(!0)},[]),vt.createElement(Xl,{className:l("callToActionContainer",t)},vt.createElement(Ql,{className:l("callToActionTextContainer",t)},vt.createElement(Ce,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&vt.createElement(Jl,{className:l("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&vt.createElement(Zl,{appearance:t,className:l("callToActionVideo",t)},vt.createElement(Pt,{appearance:t,videoUri:e.videoUri})))}import Ve,{useEffect as Wo,useState as zo}from"react";import Vt from"react";import jt from"react";import{motion as Rl}from"framer-motion";var jr=({color:e,percentage:t,size:o})=>{let n=o*.5-2,r=2*Math.PI*n,i=(1-t)*r,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:r,transition:s},show:{strokeDashoffset:i,transition:s}};return jt.createElement(Rl.circle,{r:n,cx:o*.5,cy:o*.5,fill:"transparent",stroke:i!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?i:0,variants:p,transition:s,initial:"hidden",animate:"show"})},ea=({fillColor:e,size:t,percentage:o,children:n,bgColor:r="#D9D9D9",className:i,style:s})=>jt.createElement("svg",{style:s,className:i,width:t,height:t,overflow:"visible"},jt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},jt.createElement(jr,{color:r,size:t}),jt.createElement(jr,{color:e,percentage:o,size:t})),n),Et=ea;var At={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#999999",colorBorder:"#E5E5E5",borderRadius:20}};import ta from"styled-components";var oa=({color:e="#FFFFFF"})=>Vt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Vt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ra={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ia={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},na={border:"1px solid #000000",color:"#FFFFFF"},sa={border:"1px solid #E6E6E6"},la={color:"#FFFFFF"},aa={border:"3px solid #D9D9D9"},pa=e=>e==="square"?ra:ia,da=(e,t)=>e==="square"?t?na:sa:t?la:aa,ca=ta.div`
|
|
470
|
+
${e=>pt(e)}
|
|
471
|
+
`,ct=({value:e,type:t="square",primaryColor:o="#000000",progress:n,appearance:r=At,style:i,className:s})=>{let p=pa(t),d=da(t,e);return e===!0?p={...p,...d,backgroundColor:o,borderColor:t==="square"?o:"none"}:p={...p,...d},e!==!0&&t==="round"&&n!==void 0&&n!==1?Vt.createElement(Et,{fillColor:o,percentage:n,size:22}):Vt.createElement(ca,{styleOverrides:p,style:i,role:"checkbox",className:xe(l("checkIconContainer",r),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Vt.createElement(oa,{color:"#FFFFFF"}))};import et from"styled-components";var Vr=et.div`
|
|
472
472
|
width: auto;
|
|
473
473
|
display: flex;
|
|
474
474
|
flex-direction: column;
|
|
475
475
|
justify-content: center;
|
|
476
476
|
align-items: center;
|
|
477
477
|
padding: 4px;
|
|
478
|
-
`,
|
|
478
|
+
`,Kr=et.div`
|
|
479
479
|
width: 100%;
|
|
480
480
|
text-align: left;
|
|
481
|
-
`,
|
|
481
|
+
`,qr=et.h1`
|
|
482
482
|
font-style: normal;
|
|
483
483
|
font-weight: 700;
|
|
484
484
|
font-size: 32px;
|
|
485
485
|
line-height: 38px;
|
|
486
486
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
487
|
-
`,
|
|
487
|
+
`,Yr=et.h1`
|
|
488
488
|
font-style: normal;
|
|
489
489
|
font-weight: 400;
|
|
490
490
|
font-size: 16px;
|
|
@@ -492,7 +492,7 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
492
492
|
margin-top: 16px;
|
|
493
493
|
margin-bottom: 16px;
|
|
494
494
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
495
|
-
`,
|
|
495
|
+
`,Xr=et.div`
|
|
496
496
|
padding-top: 12px;
|
|
497
497
|
padding-bottom: 12px;
|
|
498
498
|
flex-direction: row;
|
|
@@ -503,17 +503,17 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
503
503
|
cursor: pointer;
|
|
504
504
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
505
505
|
width: 100%;
|
|
506
|
-
`,
|
|
506
|
+
`,Jr=et.div`
|
|
507
507
|
padding-top: 10px;
|
|
508
508
|
padding-bottom: 10px;
|
|
509
509
|
flex-direction: row;
|
|
510
510
|
display: flex;
|
|
511
511
|
justify-content: flex-start;
|
|
512
|
-
`,
|
|
512
|
+
`,Qr=et.img`
|
|
513
513
|
width: 42px;
|
|
514
514
|
height: 42px;
|
|
515
515
|
margin-right: 12px;
|
|
516
|
-
`,
|
|
516
|
+
`,Zr=et.p`
|
|
517
517
|
font-style: normal;
|
|
518
518
|
font-weight: 500;
|
|
519
519
|
font-size: 17px;
|
|
@@ -521,8 +521,8 @@ import mt,{createContext as wa,useEffect as Go,useState as Be}from"react";import
|
|
|
521
521
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
522
522
|
display: flex;
|
|
523
523
|
align-self: center;
|
|
524
|
-
`;var
|
|
525
|
-
${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map(([s,p])=>`${
|
|
524
|
+
`;var Rr=({stepData:e,setCanContinue:t,onSaveData:o,appearance:n})=>{let r=e.props,[i,s]=zo([]),[p,d]=zo(!1),[a,u]=zo(e.id);return Wo(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Wo(()=>{a!==e.id&&(u(e.id),s([]))},[e]),Wo(()=>{o({choice:i}),i.length>=r.minChoices?t(!0):t(!1)},[i]),Ve.createElement(Vr,{className:l("selectListContainer",n)},Ve.createElement(Kr,null,Ve.createElement(qr,{className:l("selectListTitle",n)},e.title),Ve.createElement(Yr,{appearance:n,className:l("selectListSubtitle",n)},e.subtitle)),r.options.map((c,f)=>{let b=i.includes(c.id);return Ve.createElement(Xr,{key:`select-item-${f}`,onClick:()=>{if(i.includes(c.id)){s(i.filter(w=>w!==c.id));return}i.length<r.maxChoices?s([...i,c.id]):i.length==1&&r.maxChoices==1&&s([c.id])},hideBottomBorder:f===r.options.length-1,className:l("selectListSelectItem",n)},Ve.createElement(Jr,{className:l("selectListItemImage",n)},c.imageUri&&Ve.createElement(Qr,{src:c.imageUri,alt:`select-icon-${f}`}),Ve.createElement(Zr,{appearance:n,className:l("selectListSelectItemText",n)},c.title)),Ve.createElement(ct,{appearance:n,value:b,primaryColor:n.theme.colorPrimary}))}))};import Se,{useEffect as Ho,useState as So}from"react";import{AnimatePresence as ma,motion as ua}from"framer-motion";var fa=({children:e,id:t,shouldWrap:o=!1})=>Se.createElement(Se.Fragment,null,o?Se.createElement(ma,{initial:!1},Se.createElement(ua.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),yo=({appearance:e,steps:t,selectedStep:o,customStepTypes:n,customVariables:r,onButtonClick:i,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:a,onComplete:u,setVisible:c,setShowModal:f,onDismiss:b,showPagination:w=!1,customFormElements:S,allowBackNavigation:g})=>{var L;let T={...{linkCollection:Hr,multiInput:Nr,callToAction:Gr,selectList:Rr},...n},{primaryCTAClickSideEffects:A,secondaryCTAClickSideEffects:k}=ie(),[x,m]=So(!1),[C,E]=So({}),[U,$]=So(!1),[_,I]=So(!1),H=t[o]??null,{markStepCompleted:B,markStepStarted:M,isLoading:re,updateCustomVariables:X,markFlowCompleted:W}=Y();Ho(()=>{X(r)},[r,re]),Ho(()=>{window&&g&&!_&&(window.location.hash=t[o].id,I(!0))},[g,_,I]),Ho(()=>{var N;if(window&&((N=window==null?void 0:window.location)!=null&&N.hash)&&window.location.hash.replace("#","")!==t[o].id){let ee=window.location.hash.replace("#",""),te=t.findIndex(we=>we.id===ee);te!==-1&&M(p,t[te].id)}},[(L=window==null?void 0:window.location)==null?void 0:L.hash,M,o,t]);function be(){return{data:C[t[o].id]??{},stepId:t[o].id,customVariables:r}}function me(N,ee,te){let we=o+1<t.length?t[o+1]:null;i&&i(N,o,ee,we),s&&s(N,te,we,C,be())}function j(N,ee){E(te=>{let we={};return we[N.id]=ee,{...te,...we}})}function J(N){return N.selectedStep.imageUri?Se.createElement(Ur,{image:N.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let fe=Se.createElement(Wr,{step:t[o],canContinue:x&&!U,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{$(!0);let N={...be()};await B(p,t[o].id,N),o+1<t.length&&await M(p,t[o+1].id),me(t[o],"primary",o),o+1>=t.length&&(u&&u(),b&&b(),a&&(c&&c(!1),f(!1)),await W(p)),A(t[o]),$(!1),window&&g&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{me(t[o],"secondary",o),k(t[o])},onBack:async()=>{o-1>=0&&($(!0),await M(p,t[o-1].id),$(!1))},steps:t,allowBackNavigation:g});return Se.createElement(Se.Fragment,null,Se.createElement(Dr,{className:l("formContainer",e)},Se.createElement($r,null,Se.createElement(fa,{id:o,shouldWrap:d==="large-modal"},Se.createElement(Mr,{key:H.id,type:d,className:l("formContent",e)},t.map(N=>{let ee=T[N.type];return H.id!==N.id?null:Se.createElement(ee,{key:N.id,stepData:N,canContinue:x,setCanContinue:m,onSaveData:te=>{j(N,te)},appearance:e,customFormElements:S})}),w&&Se.createElement(zr,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),fe))),d=="large-modal"&&Se.createElement(J,{selectedStep:t[o]})))};import Kt from"react";import{createGlobalStyle as ga}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return Kt.createElement(Kt.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([n,r])=>typeof r=="object");if(t.length===0)return Kt.createElement(Kt.Fragment,null);let o=ga`
|
|
525
|
+
${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map(([s,p])=>`${Oo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Kt.createElement(o,{inlineStyles:t})}var ei=({flowId:e,customStepTypes:t={},type:o="inline",visible:n,setVisible:r,customVariables:i,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:a=!0,onStepCompletion:u,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:b=!1,modalPosition:w="center",repeatable:S=!1,onDismiss:g,showPagination:P=!1,allowBackNavigation:T=!1})=>{let{getFlow:A,getFlowSteps:k,isLoading:x,targetingLogicShouldHideFlow:m,getFlowStatus:C,getCurrentStepIndex:E,markFlowCompleted:U,markFlowNotStarted:$}=Y(),_=E(e),{mergeAppearanceWithDefault:I}=Q(),[H,B]=xa(!1),{setOpenFlowState:M,getOpenFlowState:re}=Pe();d=I(d);let[X,W]=n!==void 0&&r!==void 0?[n,r]:[re(e,!0),J=>M(e,J)];if(ha(()=>{!H&&!x&&(B(!0),C(e)===q&&S&&$(e),B(!0))},[H,B,x]),x)return null;let be=A(e);if(!be||m(be))return null;let me=k(e);if(!me||n!==void 0&&n===!1||C(e)===q&&a)return null;let j=()=>{W(!1),g&&g(),b===!0&&U(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let J={padding:"24px"};return o==="large-modal"?(J.width="85%",J.height="90%",J.maxHeight="800px",J.minHeight="500px",J.padding="0"):J.width="400px",Me.createElement(Qe,{appearance:d,onClose:j,visible:X,style:J,dismissible:f},Me.createElement(oe,{appearance:d}),Me.createElement(yo,{appearance:d,steps:me,selectedStep:_,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:W,onDismiss:g,showPagination:P,customFormElements:s,allowBackNavigation:T}))}return o==="modal"&&w!=="center"?Me.createElement(fr,{appearance:d,onClose:j,visible:X},Me.createElement(oe,{appearance:d}),Me.createElement(yo,{appearance:d,steps:me,selectedStep:_,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:W,onDismiss:g,showPagination:P,customFormElements:s,allowBackNavigation:T})):Me.createElement(Me.Fragment,null,Me.createElement(oe,{appearance:d}),Me.createElement(yo,{appearance:d,steps:me,selectedStep:_,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:W,onDismiss:g,showPagination:P,customFormElements:s,allowBackNavigation:T}))},ti=ei;import{useCallback as oi,useContext as Ca,useEffect as Sa}from"react";function Go(){let{organizationId:e,userId:t,setOrganizationId:o}=Ca(V),{mutateUserFlowState:n}=Ie(),{config:r}=De(),i=yt(),{verifySDKInitiated:s}=bt();Sa(()=>{if(t&&e){if(t.startsWith(wt))return;let a=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(a)||(i(`${Te}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(a,"true"))}},[t,e]);let p=oi(async a=>{if(s(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let u={foreignUserId:t,foreignUserGroupId:e,properties:a};await i(`${Te}userGroups`,{...r,method:"POST",body:JSON.stringify(u)}),n()},[e,t,r,n]),d=oi(async(a,u)=>{if(s(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let f={foreignUserId:t,foreignUserGroupId:e,events:[{event:a,properties:u}]};await i(`${Te}userGroups`,{...r,method:"POST",body:JSON.stringify(f)}),n()},[e,t,r,n]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:p,trackEventForOrganization:d}}var ri="xFrigade_guestUserId",ii="xFrigade_userId",ni=({})=>{let{setFlowResponses:e}=Wt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=Ie(),{userId:r,setUserId:i}=Lo(),[s,p]=jo(null),{getFlowStatus:d}=Y(),{flows:a,userProperties:u,setIsNewGuestUser:c,flowResponses:f}=ya(V),[b,w]=jo([]),[S,g]=jo([]),{organizationId:P}=Go();bo(()=>{if(!o&&t)for(let x=0;x<t.length;x++){let m=t[x],C=a.find(E=>E.slug===(m==null?void 0:m.flowId));if(C&&m&&m.shouldTrigger===!0&&C.type=="FORM"&&C.triggerType==="AUTOMATIC"&&!S.includes(C.slug)){setTimeout(()=>{T(m.flowId)},500);break}}},[o,t]),bo(()=>{f.length>0&&n()},[f]);function T(x){let m=a.find(C=>C.slug===x);m&&m.triggerType==="AUTOMATIC"&&!S.includes(m.slug)&&(g([...S,m.slug]),w([m]))}function A(){if(!r){let x=localStorage.getItem(ii);if(x){i(x);return}let m=localStorage.getItem(ri);if(m){i(m);return}c(!0);let C=wt+ba();try{localStorage.setItem(ri,C)}catch(E){console.log("Failed to save guest user id locally: Local storage unavailable",E)}i(E=>E||C)}}bo(()=>{try{if(a){let x=[];a.forEach(m=>{if(m.data){let C=m.data.match(/"imageUri":"(.*?)"/g);C&&C.forEach(E=>{let U=E.replace('"imageUri":"',"").replace('"',"");if(x.includes(U))return;let $=new Image;$.src=U,x.push(U)})}})}}catch{}},[a]),bo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(wt))try{localStorage.setItem(ii,r)}catch(x){console.log("Failed to save user id locally: Local storage available",x)}r===null&&setTimeout(()=>{r===null&&A()},50)},[r,a,u]);function k(){return mt.createElement(mt.Fragment,null,b.map(x=>d(x.slug)!==Ne?null:mt.createElement("span",{key:x.slug},mt.createElement(ti,{flowId:x.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return mt.createElement(mt.Fragment,null,mt.createElement(k,null))};import{ErrorBoundary as Fa}from"react-error-boundary";var V=wa({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:At,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{}}),ka=({publicApiKey:e,userId:t,organizationId:o,config:n,children:r})=>{var re,X;let[i,s]=Be(t||null),[p,d]=Be(o||null),[a,u]=Be([]),[c,f]=Be([]),[b,w]=Be([]),[S,g]=Be({}),[P,T]=Be({}),[A,k]=Be([]),[x,m]=Be({}),[C,E]=Be(!1),[U,$]=Be(!1),[_,I]=Be(!M(e)),H=(W,be)=>{if(be==="_blank"){window.open(W,"_blank");return}setTimeout(()=>{window.location.href=W},50)},B={theme:{...At.theme,...((re=n==null?void 0:n.defaultAppearance)==null?void 0:re.theme)??{}},styleOverrides:{...At.styleOverrides,...((X=n==null?void 0:n.defaultAppearance)==null?void 0:X.styleOverrides)??{}}};function M(W){return!!(W&&W.length>10&&W.substring(0,10)==="api_public")}return Vo(()=>{t&&s(t)},[t]),Vo(()=>{o&&d(o)},[o]),Vo(()=>{if(M(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]),_?ut.createElement(V.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:u,flows:a,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:b,setFlowResponses:w,userProperties:S,setUserProperties:g,openFlowStates:P,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:A,setCompletedFlowsToKeepOpenDuringSession:k,customVariables:x,setCustomVariables:m,isNewGuestUser:C,setIsNewGuestUser:E,hasActiveFullPageFlow:U,setHasActiveFullPageFlow:$,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:H,defaultAppearance:B,shouldGracefullyDegrade:_,setShouldGracefullyDegrade:I}},r):ut.createElement(Fa,{fallback:ut.createElement(ut.Fragment,null,r)},ut.createElement(V.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:u,flows:a,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:b,setFlowResponses:w,userProperties:S,setUserProperties:g,openFlowStates:P,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:A,setCompletedFlowsToKeepOpenDuringSession:k,customVariables:x,setCustomVariables:m,isNewGuestUser:C,setIsNewGuestUser:E,hasActiveFullPageFlow:U,setHasActiveFullPageFlow:$,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:H,defaultAppearance:B,shouldGracefullyDegrade:_,setShouldGracefullyDegrade:I}},ut.createElement(Ta,{theme:B.theme},r,ut.createElement(ni,null))))};import wp from"react";import le,{useEffect as $n,useState as Mn}from"react";import Oe,{useState as qa}from"react";import ht from"styled-components";import Fo from"react";import ft from"react";import li from"styled-components";var si=li.span`
|
|
526
526
|
font-weight: 400;
|
|
527
527
|
font-size: 15px;
|
|
528
528
|
line-height: 20px;
|
|
@@ -531,7 +531,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
531
531
|
vertical-align: middle;
|
|
532
532
|
margin-left: 12px;
|
|
533
533
|
padding-right: 12px;
|
|
534
|
-
`,Pa=
|
|
534
|
+
`,Pa=li.div`
|
|
535
535
|
flex-direction: row;
|
|
536
536
|
justify-content: space-between;
|
|
537
537
|
display: flex;
|
|
@@ -539,24 +539,24 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
539
539
|
padding-bottom: 20px;
|
|
540
540
|
border-top: 1px solid ${e=>e.theme.colorBorder};
|
|
541
541
|
width: 100%;
|
|
542
|
-
`,
|
|
542
|
+
`,wo=({label:e,value:t,labelStyle:o={},labelPosition:n="right",style:r,primaryColor:i="#000000",checkBoxType:s="square",appearance:p})=>ft.createElement(ft.Fragment,null,ft.createElement(Pa,{className:l("checklistStepsContainer",p),appearance:p,style:{...r}},n==="left"&&e&&ft.createElement(si,{className:l("checklistStepLabel",p),style:o},e),ft.createElement(ct,{appearance:p,value:t,type:s,primaryColor:i}),n==="right"&&e&&ft.createElement(si,{className:l("checklistStepLabel",p),style:o},e)),ft.createElement(oe,{appearance:p}));import{motion as va}from"framer-motion";import qt from"styled-components";var ai=qt.div`
|
|
543
543
|
font-weight: 700;
|
|
544
544
|
font-size: 18px;
|
|
545
545
|
line-height: 22px;
|
|
546
|
-
`,
|
|
546
|
+
`,pi=qt.p`
|
|
547
547
|
font-weight: 700;
|
|
548
548
|
font-size: 18px;
|
|
549
549
|
line-height: 22px;
|
|
550
550
|
margin: 20px 0px 0px 0px;
|
|
551
551
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
552
|
-
`,
|
|
552
|
+
`,di=qt.p`
|
|
553
553
|
font-weight: 400;
|
|
554
554
|
font-size: 15px;
|
|
555
555
|
line-height: 28px;
|
|
556
556
|
max-width: 540px;
|
|
557
557
|
margin: 8px 0px 0px 0px;
|
|
558
558
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
559
|
-
`,
|
|
559
|
+
`,To=qt.div`
|
|
560
560
|
width: 4px;
|
|
561
561
|
position: absolute;
|
|
562
562
|
left: 0;
|
|
@@ -564,33 +564,33 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
564
564
|
height: 80%;
|
|
565
565
|
border-top-right-radius: 8px;
|
|
566
566
|
border-bottom-right-radius: 8px;
|
|
567
|
-
`,
|
|
567
|
+
`,ci=qt.div`
|
|
568
568
|
flex-direction: row;
|
|
569
569
|
justify-content: flex-start;
|
|
570
|
-
`;var
|
|
570
|
+
`;var mi=({data:e,index:t,isSelected:o,primaryColor:n,style:r,onClick:i,appearance:s})=>{var p,d;return Fo.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{i()}},o&&Fo.createElement(To,{className:l("checklistStepItemSelectedIndicator",s),as:va.div,layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??n}}),Fo.createElement(ci,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},Fo.createElement(wo,{value:e.complete,labelPosition:"left",label:e.stepName,style:r,primaryColor:((d=s==null?void 0:s.theme)==null?void 0:d.colorPrimary)??n,appearance:s})))};import gt from"react";import{motion as Ea}from"framer-motion";import Ko from"styled-components";var Aa={backgroundColor:"#E6E6E6"},Ia=Ko.div`
|
|
571
571
|
display: flex;
|
|
572
572
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
573
573
|
justify-content: flex-start;
|
|
574
574
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
575
575
|
|
|
576
|
-
${e=>
|
|
577
|
-
`,
|
|
576
|
+
${e=>pt(e)}
|
|
577
|
+
`,Ba=Ko.div`
|
|
578
578
|
flex-grow: 1;
|
|
579
579
|
position: relative;
|
|
580
580
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
581
|
-
`,Na=
|
|
581
|
+
`,Na=Ko.span`
|
|
582
582
|
font-weight: 500;
|
|
583
583
|
font-size: 15px;
|
|
584
584
|
line-height: 18px;
|
|
585
585
|
padding-right: ${e=>e.padding};
|
|
586
586
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
587
587
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
588
|
-
${e=>
|
|
589
|
-
`,La={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},Oa={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},
|
|
588
|
+
${e=>pt(e)}
|
|
589
|
+
`,La={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},Oa={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},Ue=({count:e,total:t,fillColor:o,bgColor:n=Aa.backgroundColor,display:r="count",textLocation:i="left",style:s={},textStyle:p={},appearance:d})=>{var w,S;if(t===0)return gt.createElement(gt.Fragment,null);let a=e===0?"10px":`${e/t*100}%`,u=r==="compact"?"5px":"10px",c=Math.round(e/t*100),f=r==="compact"?"5px":"20px",b;return r==="count"?b=`${e} of ${t}`:r==="compact"?b=`${c}%`:r==="percent"&&(b=`${c}% complete`),i==="top"&&(f="0px"),gt.createElement(Ia,{className:l("progressBarContainer",d),textLocation:i,styleOverrides:s},gt.createElement(Na,{className:l("progressBarStepText",d),style:{...p,fontSize:r==="compact"?12:15,fontWeight:r==="compact"?400:500},appearance:d,padding:f,textLocation:i},b),gt.createElement(Ba,{textLocation:i,className:l("progressBar",d)},gt.createElement(Ea.div,{style:{...Oa,width:a,height:u,backgroundColor:((w=d==null?void 0:d.theme)==null?void 0:w.colorPrimary)??o,zIndex:r=="compact"?1:5},className:l("progressBarFill",d)}),gt.createElement("div",{className:l("progressBarBackground",d),style:{...La,height:u,backgroundColor:((S=d==null?void 0:d.theme)==null?void 0:S.colorSecondary)??n}})))};import Xt from"react";import Da from"styled-components";import Po from"react";import ko from"react";var It=({stepData:e,appearance:t})=>ko.createElement(ko.Fragment,null,ko.createElement(pi,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:pe(e.title)}),ko.createElement(di,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:pe(e.subtitle)}));import Yt from"react";var Bt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},n=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Yt.createElement(Yt.Fragment,null,Yt.createElement(go,null,e.secondaryButtonTitle&&Yt.createElement(R,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:n,style:{width:"auto",marginRight:"12px"}}),Yt.createElement(R,{appearance:t,title:e.primaryButtonTitle,onClick:o})))};var Nt=({stepData:e,appearance:t})=>Po.createElement(Po.Fragment,null,Po.createElement(It,{stepData:e,appearance:t}),Po.createElement(Bt,{stepData:e,appearance:t}));import ui from"react";function fi(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),ui.createElement("iframe",{width:"480",height:"260",src:`https://www.youtube.com/embed/${t}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:l("checklistStepVideo",e.appearance)})}else return ui.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var qo="default",$a=Da.img`
|
|
590
590
|
border-radius: 4px;
|
|
591
591
|
max-height: 260px;
|
|
592
592
|
min-height: 200px;
|
|
593
|
-
`,
|
|
593
|
+
`,gi=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Xt.createElement("div",null,o)}return Xt.createElement(ai,{className:l("checklistStepContent",t)},e.imageUri?Xt.createElement($a,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Xt.createElement(fi,{videoUri:e.videoUri,appearance:t}):null,Xt.createElement(Nt,{stepData:e,appearance:t}))};import Ee,{useRef as Ma,useState as Ua}from"react";import Lt from"styled-components";var hi=Lt.div`
|
|
594
594
|
display: block;
|
|
595
595
|
`,_a=Lt.div`
|
|
596
596
|
display: flex;
|
|
@@ -615,7 +615,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
615
615
|
font-size: 14px;
|
|
616
616
|
line-height: 20px;
|
|
617
617
|
text-align: center;
|
|
618
|
-
`,
|
|
618
|
+
`,Ga=Lt.div`
|
|
619
619
|
position: absolute;
|
|
620
620
|
width: 200px;
|
|
621
621
|
height: 120px;
|
|
@@ -635,9 +635,9 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
635
635
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
636
636
|
border-radius: 50%;
|
|
637
637
|
}
|
|
638
|
-
`,
|
|
638
|
+
`,xi="videoCarousel",Ci=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ee.createElement(hi,null,Ee.createElement(Nt,{stepData:e,appearance:t}));function o({video:i}){let s=Ma(),[p,d]=Ua(!1);return Ee.createElement(Wa,null,!p&&Ee.createElement(Ga,{onClick:()=>{d(!0),s.current.play()},appearance:t},Ee.createElement(ho,null)),Ee.createElement(za,{controls:p,ref:s,play:p,src:i.uri}),Ee.createElement(Ha,null,i.title))}let n=e.props;return n.videos?Ee.createElement(hi,null,Ee.createElement(It,{stepData:e,appearance:t}),Ee.createElement(_a,null,n.videos.map((i,s)=>Ee.createElement("span",{key:`${i.uri}-${s}`},Ee.createElement(o,{video:i})))),Ee.createElement(Bt,{stepData:e,appearance:t})):null};import Ke from"react";import vo from"styled-components";var Si=vo.div`
|
|
639
639
|
display: block;
|
|
640
|
-
`,
|
|
640
|
+
`,ja=vo.pre`
|
|
641
641
|
display: block;
|
|
642
642
|
background-color: #2a2a2a;
|
|
643
643
|
color: #f8f8f8;
|
|
@@ -653,68 +653,68 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
653
653
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
654
654
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
655
655
|
margin-bottom: 24px;
|
|
656
|
-
`,Va=
|
|
656
|
+
`,Va=vo.div`
|
|
657
657
|
font-size: 15px;
|
|
658
658
|
line-height: 20px;
|
|
659
659
|
margin-bottom: 12px;
|
|
660
660
|
margin-top: 12px;
|
|
661
|
-
`,Ka=
|
|
661
|
+
`,Ka=vo.div`
|
|
662
662
|
margin-top: 24px;
|
|
663
|
-
`,
|
|
663
|
+
`,yi="codeSnippet",bi=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.codeSnippets))return Ke.createElement(Si,null,Ke.createElement(Nt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?Ke.createElement(Si,null,Ke.createElement(It,{stepData:e,appearance:t}),Ke.createElement(Ka,null,o.codeSnippets.map((r,i)=>Ke.createElement("div",{key:i},r.title?Ke.createElement(Va,null,r.title):null,r.code?Ke.createElement(ja,null,r.code):null))),Ke.createElement(Bt,{stepData:e,appearance:t})):null};var Ya=ht.div`
|
|
664
664
|
display: flex;
|
|
665
665
|
flex-direction: row;
|
|
666
666
|
min-width: ${e=>e.type!="modal"?"1000px":"100%"};
|
|
667
667
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
668
668
|
box-shadow: ${e=>e.type!="modal"?"0px 6px 25px rgba(0, 0, 0, 0.06)":"none"};
|
|
669
669
|
border-radius: 8px;
|
|
670
|
-
`,Xa=
|
|
670
|
+
`,Xa=ht.h1`
|
|
671
671
|
font-size: 24px;
|
|
672
672
|
font-weight: 600;
|
|
673
673
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
674
|
-
`,Ja=
|
|
674
|
+
`,Ja=ht.h2`
|
|
675
675
|
font-size: 15px;
|
|
676
676
|
line-height: 20px;
|
|
677
677
|
color: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary)??"#4d4d4d"}};
|
|
678
678
|
margin: 10px 0px 0px 0px;
|
|
679
|
-
`,
|
|
679
|
+
`,wi=ht.div`
|
|
680
680
|
padding-bottom: 16px;
|
|
681
|
-
`,Qa=
|
|
681
|
+
`,Qa=ht.div`
|
|
682
682
|
list-style: none;
|
|
683
683
|
padding: 0;
|
|
684
684
|
margin: 0;
|
|
685
685
|
cursor: pointer;
|
|
686
686
|
width: 300px;
|
|
687
|
-
`,Za=
|
|
687
|
+
`,Za=ht.div`
|
|
688
688
|
width: 1px;
|
|
689
689
|
margin: 40px;
|
|
690
690
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
691
|
-
`,Ra=
|
|
691
|
+
`,Ra=ht.div`
|
|
692
692
|
flex: 2;
|
|
693
693
|
padding: 2rem;
|
|
694
|
-
`,ep=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:r,setSelectedStep:i,className:s="",customStepTypes:p=new Map,appearance:d,type:a})=>{let{mergeAppearanceWithDefault:u}=Q();d=u(d);let f={...{[
|
|
694
|
+
`,ep=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:r,setSelectedStep:i,className:s="",customStepTypes:p=new Map,appearance:d,type:a})=>{let{mergeAppearanceWithDefault:u}=Q();d=u(d);let f={...{[qo]:gi,[xi]:Ci,[yi]:bi},...p},[b,w]=qa(0),S=r??b,g=i??w,P=o.filter(A=>A.complete===!0).length,T=()=>{var A;return!((A=o[S])!=null&&A.type)||!f[o[S].type]?f[qo]({stepData:o[S],appearance:d}):f[o[S].type]({stepData:o[S],appearance:d})};return Oe.createElement(Ya,{type:a,style:n,className:s,appearance:d},Oe.createElement(wi,{style:{flex:1}},Oe.createElement(wi,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},Oe.createElement(Xa,{className:l("checklistTitle",d),appearance:d},e),Oe.createElement(Ja,{className:l("checklistSubtitle",d),appearance:d},t),Oe.createElement(Ue,{total:o.length,count:P,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),Oe.createElement(Qa,{className:l("checklistStepsContainer",d)},o.map((A,k)=>Oe.createElement(mi,{data:A,index:k,key:k,listLength:o.length,isSelected:k===S,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{g(k)}})))),Oe.createElement(Za,{appearance:d,className:l("checklistDivider",d)}),Oe.createElement(Ra,null,Oe.createElement(T,null)))},Yo=ep;import O,{useState as sp}from"react";import Ti from"react";import tp from"styled-components";var op=tp.svg`
|
|
695
695
|
transition: 'transform 0.35s ease-in-out';
|
|
696
|
-
`,Ot=({color:e="#323232",style:t,className:o})=>
|
|
696
|
+
`,Ot=({color:e="#323232",style:t,className:o})=>Ti.createElement(op,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},Ti.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as lp}from"framer-motion";import de from"styled-components";var Xo={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Fi=de.div`
|
|
697
697
|
max-height: 350px;
|
|
698
698
|
padding-bottom: 40px;
|
|
699
|
-
`,
|
|
699
|
+
`,ki=de.div`
|
|
700
700
|
display: flex;
|
|
701
701
|
flex-direction: column;
|
|
702
702
|
margin-top: 20px;
|
|
703
|
-
`,
|
|
703
|
+
`,Pi=de.h1`
|
|
704
704
|
font-style: normal;
|
|
705
705
|
font-weight: 600;
|
|
706
706
|
font-size: 30px;
|
|
707
707
|
line-height: 36px;
|
|
708
708
|
margin-bottom: 16px;
|
|
709
709
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
710
|
-
`,
|
|
710
|
+
`,vi=de.h2`
|
|
711
711
|
font-weight: 400;
|
|
712
712
|
font-size: 16px;
|
|
713
713
|
line-height: 20px;
|
|
714
714
|
margin-bottom: 16px;
|
|
715
715
|
padding-left: 1px;
|
|
716
716
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
717
|
-
`,
|
|
717
|
+
`,Ei=de.div`
|
|
718
718
|
${e=>F(e)} {
|
|
719
719
|
border: 1px solid #fafafa;
|
|
720
720
|
}
|
|
@@ -724,11 +724,11 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
724
724
|
flex-direction: column;
|
|
725
725
|
min-height: 240px;
|
|
726
726
|
overflow: hidden;
|
|
727
|
-
`,
|
|
727
|
+
`,Ai=de.div`
|
|
728
728
|
display: flex;
|
|
729
729
|
flex-direction: row;
|
|
730
730
|
justify-content: space-between;
|
|
731
|
-
`,
|
|
731
|
+
`,Ii=de.p`
|
|
732
732
|
${e=>F(e)} {
|
|
733
733
|
font-weight: 400;
|
|
734
734
|
font-size: 10px;
|
|
@@ -737,12 +737,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
737
737
|
color: #8c8c8c;
|
|
738
738
|
margin: 20px;
|
|
739
739
|
}
|
|
740
|
-
`,Bi=
|
|
740
|
+
`,Bi=de.div`
|
|
741
741
|
display: flex;
|
|
742
742
|
flex-direction: row;
|
|
743
|
-
`,
|
|
743
|
+
`,Ni=de.div`
|
|
744
744
|
flex: 1;
|
|
745
|
-
`,
|
|
745
|
+
`,Li=de.div`
|
|
746
746
|
${e=>F(e)} {
|
|
747
747
|
display: flex;
|
|
748
748
|
justify-content: center;
|
|
@@ -752,7 +752,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
752
752
|
padding-left: 8px;
|
|
753
753
|
padding-right: 8px;
|
|
754
754
|
}
|
|
755
|
-
`,
|
|
755
|
+
`,Oi=de.p`
|
|
756
756
|
${e=>F(e)} {
|
|
757
757
|
font-style: normal;
|
|
758
758
|
font-weight: 600;
|
|
@@ -764,7 +764,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
764
764
|
margin-top: 20px;
|
|
765
765
|
margin-bottom: 16px;
|
|
766
766
|
}
|
|
767
|
-
`,
|
|
767
|
+
`,Di=de.p`
|
|
768
768
|
${e=>F(e)} {
|
|
769
769
|
font-weight: 400;
|
|
770
770
|
font-size: 14px;
|
|
@@ -773,14 +773,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
773
773
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
774
774
|
margin-bottom: 8px;
|
|
775
775
|
}
|
|
776
|
-
|
|
776
|
+
`,$i=de.div`
|
|
777
777
|
${e=>F(e)} {
|
|
778
778
|
display: flex;
|
|
779
779
|
flex-direction: row;
|
|
780
780
|
justify-content: center;
|
|
781
781
|
gap: 8px;
|
|
782
782
|
}
|
|
783
|
-
|
|
783
|
+
`,Mi=de.div`
|
|
784
784
|
${e=>F(e)} {
|
|
785
785
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
786
786
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -800,7 +800,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
800
800
|
justify-content: space-between;
|
|
801
801
|
position: relative;
|
|
802
802
|
cursor: pointer;
|
|
803
|
-
`,
|
|
803
|
+
`,Ui=de.p`
|
|
804
804
|
${e=>F(e)} {
|
|
805
805
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
806
806
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -809,12 +809,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
809
809
|
font-size: 14px;
|
|
810
810
|
line-height: 22px;
|
|
811
811
|
margin: 0;
|
|
812
|
-
`,
|
|
812
|
+
`,_i=de.div`
|
|
813
813
|
display: flex;
|
|
814
814
|
flex-direction: row;
|
|
815
815
|
justify-content: flex-end;
|
|
816
816
|
align-content: center;
|
|
817
|
-
`,
|
|
817
|
+
`,Wi=de.div`
|
|
818
818
|
display: flex;
|
|
819
819
|
flex: 1;
|
|
820
820
|
flex-direction: row;
|
|
@@ -822,14 +822,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
822
822
|
align-content: center;
|
|
823
823
|
align-items: center;
|
|
824
824
|
margin-right: 20px;
|
|
825
|
-
`,
|
|
825
|
+
`,zi=de.div`
|
|
826
826
|
display: block;
|
|
827
827
|
width: 100%;
|
|
828
|
-
`;import rp from"styled-components";var
|
|
828
|
+
`;import rp from"styled-components";var Hi=rp.div`
|
|
829
829
|
flex-direction: column;
|
|
830
830
|
justify-content: center;
|
|
831
831
|
display: flex;
|
|
832
|
-
`;import
|
|
832
|
+
`;import Ye from"react";import{motion as ip}from"framer-motion";import qe from"styled-components";var Gi=qe.div`
|
|
833
833
|
border: 1px solid #fafafa;
|
|
834
834
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
835
835
|
border-radius: 14px;
|
|
@@ -837,13 +837,13 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
837
837
|
display: flex;
|
|
838
838
|
flex-direction: column;
|
|
839
839
|
overflow: hidden;
|
|
840
|
-
`,ji=
|
|
840
|
+
`,ji=qe.div`
|
|
841
841
|
display: flex;
|
|
842
842
|
flex-wrap: wrap;
|
|
843
843
|
justify-content: space-between;
|
|
844
844
|
overflow: hidden;
|
|
845
845
|
row-gap: 10px;
|
|
846
|
-
`,
|
|
846
|
+
`,Vi=qe.div`
|
|
847
847
|
${e=>F(e)} {
|
|
848
848
|
color: #595959;
|
|
849
849
|
}
|
|
@@ -853,7 +853,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
853
853
|
line-height: 12px;
|
|
854
854
|
letter-spacing: 0.09em;
|
|
855
855
|
margin-bottom: 12px;
|
|
856
|
-
`,
|
|
856
|
+
`,Ki=qe.div`
|
|
857
857
|
${e=>F(e)} {
|
|
858
858
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
859
859
|
background: #ffffff;
|
|
@@ -866,7 +866,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
866
866
|
|
|
867
867
|
max-width: 150px;
|
|
868
868
|
min-width: 200px;
|
|
869
|
-
`,
|
|
869
|
+
`,qi=qe.div`
|
|
870
870
|
${e=>F(e)} {
|
|
871
871
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
872
872
|
}
|
|
@@ -878,13 +878,13 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
878
878
|
justify-content: center;
|
|
879
879
|
align-content: center;
|
|
880
880
|
align-items: center;
|
|
881
|
-
`,
|
|
881
|
+
`,Yi=qe.div`
|
|
882
882
|
font-weight: 600;
|
|
883
883
|
font-size: 20px;
|
|
884
884
|
line-height: 24px;
|
|
885
885
|
width: 20px;
|
|
886
886
|
height: 20px;
|
|
887
|
-
`,
|
|
887
|
+
`,Xi=qe.div`
|
|
888
888
|
${e=>F(e)} {
|
|
889
889
|
color: #434343;
|
|
890
890
|
}
|
|
@@ -893,20 +893,20 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
893
893
|
line-height: 17px;
|
|
894
894
|
margin-top: 12px;
|
|
895
895
|
margin-bottom: 8px;
|
|
896
|
-
`,
|
|
896
|
+
`,Ji=qe.div`
|
|
897
897
|
${e=>F(e)} {
|
|
898
898
|
color: #8c8c8c;
|
|
899
899
|
}
|
|
900
900
|
font-weight: 400;
|
|
901
901
|
font-size: 12px;
|
|
902
902
|
line-height: 14px;
|
|
903
|
-
`,
|
|
903
|
+
`,Qi=qe.a`
|
|
904
904
|
color: ${e=>e.color};
|
|
905
905
|
font-size: 12px;
|
|
906
906
|
line-height: 14px;
|
|
907
907
|
font-weight: 400;
|
|
908
908
|
cursor: pointer;
|
|
909
|
-
`;var np=({steps:e,style:t,title:o,primaryColor:n,appearance:r,onButtonClick:i})=>{let{primaryCTAClickSideEffects:s}=
|
|
909
|
+
`;var np=({steps:e,style:t,title:o,primaryColor:n,appearance:r,onButtonClick:i})=>{let{primaryCTAClickSideEffects:s}=ie();return Ye.createElement(Gi,{style:t,className:l("guideContainer",r)},Ye.createElement(Vi,{className:l("guideTitle",r)},o),Ye.createElement(ji,{className:l("guideItemContainer",r)},e.map((p,d)=>Ye.createElement(Ki,{key:`guide-${p.id??d}`,as:ip.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:l("guideItem",r)},p.icon&&Ye.createElement(qi,{className:l("guideIcon",r)},Ye.createElement(Yi,null,p.icon)),Ye.createElement(Xi,{className:l("guideItemTitle",r),dangerouslySetInnerHTML:pe(p.title)}),Ye.createElement(Ji,{className:l("guideItemSubtitle",r),dangerouslySetInnerHTML:pe(p.subtitle)}),Ye.createElement(Qi,{className:l("guideItemLink",r),color:n,onClick:()=>{p.primaryButtonUri&&s(p),i&&i(p)}},p.primaryButtonTitle)))))},Jt=np;var ap=({steps:e,title:t,subtitle:o,stepsTitle:n,visible:r,onClose:i,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:a,guideData:u,guideTitle:c,onGuideButtonClick:f})=>{let b=({stepData:m,handleSecondaryCTAClick:C,handleCTAClick:E})=>m?O.createElement(Li,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},O.createElement(Oi,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:pe(m.title)}),O.createElement(Di,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:pe(m.subtitle)}),O.createElement($i,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&O.createElement(R,{title:m.secondaryButtonTitle,onClick:C,appearance:a,secondary:!0}),O.createElement(R,{title:m.primaryButtonTitle,onClick:E,appearance:a}))):O.createElement(O.Fragment,null),S={...{default:m=>{var $;if(($=e[T])!=null&&$.StepContent){let _=e[T].StepContent;return O.createElement("div",null,_)}let C=e[T];return O.createElement(b,{stepData:m,handleCTAClick:()=>{C.handlePrimaryButtonClick&&C.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{C.handleSecondaryButtonClick&&C.handleSecondaryButtonClick()}})}},...d},[g,P]=sp(0),T=s??g,A=p??P,k=()=>{var m;return e?!((m=e[T])!=null&&m.type)||!S[e[T].type]?S.default(e[T]):S[e[T].type]({stepData:e[T],primaryColor:a.theme.colorPrimary}):O.createElement(O.Fragment,null)},x=e.filter(m=>m.complete).length;return r?(a.theme.modalContainer||(a.theme.borderRadius&&(Xo.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=Xo),O.createElement(Qe,{onClose:i,visible:r,appearance:a},O.createElement(zi,null,O.createElement(ki,null,O.createElement(Pi,{appearance:a,className:l("checklistTitle",a)},t),O.createElement(vi,{appearance:a,className:l("checklistSubtitle",a)},o)),O.createElement(Fi,null,e&&e.length>0&&O.createElement(Ei,{className:l("stepsContainer",a)},O.createElement(Ai,null,O.createElement("div",{style:{flex:3}},O.createElement(Ii,{className:l("stepsTitle",a)},n)),O.createElement(Wi,null,O.createElement(Ue,{fillColor:a.theme.colorPrimary,style:{width:"100%"},count:x,total:e.length,appearance:a}))),O.createElement(Bi,null,O.createElement(Ni,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,C)=>{let E=T===C;return O.createElement(Mi,{selected:E,className:l(`checklistStepListItem${E?"Selected":""}`,a),key:`checklist-guide-step-${m.id??C}`,disabled:m.blocked,onClick:()=>{m.blocked||A(C)},title:m.blocked?"Finish remaining steps to continue":void 0},E&&O.createElement(To,{className:l("checklistStepItemSelectedIndicator",a),as:lp.div,layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),O.createElement(Ui,{selected:E,className:l(`checklistStepListStepName${E?"Selected":""}`,a)},m.stepName),O.createElement(_i,null,O.createElement(ct,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),O.createElement(Hi,null,O.createElement(Ot,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),O.createElement(k,null))),u&&u.length>0&&O.createElement(Jt,{steps:u,title:c,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(f&&f(m),!0)}))))):O.createElement(O.Fragment,null)},Jo=ap;import{useEffect as pp,useState as dp}from"react";var Zi=()=>{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,n]=dp(t),r=null,i=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,a])=>{if(!window)return[d,!1];let u=window.matchMedia(a);return u.addEventListener("change",i),[d,u.matches]}));n(p)};return pp(()=>{s()},[]),o};import Fe,{useEffect as fn,useState as up}from"react";import ce from"react";import{AnimatePresence as cp,motion as mp}from"framer-motion";import Xe from"styled-components";var Ri=Xe.div`
|
|
910
910
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
911
911
|
border: 1px solid;
|
|
912
912
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -918,42 +918,42 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
918
918
|
display: flex;
|
|
919
919
|
flex-direction: column;
|
|
920
920
|
transition: max-height 0.25s;
|
|
921
|
-
`,
|
|
921
|
+
`,en=Xe.div`
|
|
922
922
|
display: flex;
|
|
923
923
|
margin-bottom: 20px;
|
|
924
|
-
`,
|
|
924
|
+
`,tn=Xe.img`
|
|
925
925
|
border-radius: 4px;
|
|
926
926
|
max-height: 260px;
|
|
927
927
|
min-height: 200px;
|
|
928
|
-
`,
|
|
928
|
+
`,on=Xe.div`
|
|
929
929
|
display: flex;
|
|
930
930
|
flex-direction: row;
|
|
931
931
|
justify-content: space-between;
|
|
932
932
|
align-items: center;
|
|
933
|
-
`,
|
|
933
|
+
`,rn=Xe.p`
|
|
934
934
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
935
935
|
font-style: normal;
|
|
936
936
|
font-weight: 500;
|
|
937
937
|
font-size: 16px;
|
|
938
938
|
line-height: 18px;
|
|
939
939
|
margin-left: 8px;
|
|
940
|
-
`,
|
|
940
|
+
`,nn=Xe.div`
|
|
941
941
|
padding: 20px;
|
|
942
942
|
cursor: pointer;
|
|
943
943
|
:hover {
|
|
944
944
|
opacity: 0.8;
|
|
945
945
|
}
|
|
946
|
-
`,
|
|
946
|
+
`,Bh=Xe.div``,sn=Xe.p`
|
|
947
947
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
948
948
|
font-weight: 400;
|
|
949
949
|
font-size: 14px;
|
|
950
950
|
line-height: 22px;
|
|
951
|
-
`,
|
|
951
|
+
`,ln=Xe.div`
|
|
952
952
|
display: flex;
|
|
953
953
|
flex-direction: row;
|
|
954
954
|
justify-content: flex-start;
|
|
955
955
|
align-items: center;
|
|
956
|
-
`;var
|
|
956
|
+
`;var an=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:r,appearance:i,customStepTypes:s})=>{var u,c;let p=t?{}:{transform:"rotate(90deg)"};function d(){return ce.createElement(ce.Fragment,null,e.imageUri||e.videoUri?ce.createElement(en,{className:l("stepMediaContainer",i)},e.imageUri?ce.createElement(tn,{className:l("stepImage",i),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ce.createElement(Pt,{appearance:i,videoUri:e.videoUri}):null):null,ce.createElement(sn,{className:l("stepSubtitle",i),appearance:i,dangerouslySetInnerHTML:pe(e.subtitle)}),ce.createElement(go,{className:l("checklistCTAContainer",i)},e.secondaryButtonTitle?ce.createElement(R,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:i}):null,ce.createElement(R,{title:e.primaryButtonTitle??"Continue",onClick:()=>n(),appearance:i})))}function a(){if(!s)return null;let f=s[e.type];return f?f(e,i):null}return ce.createElement(Ri,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:l("checklistStepContainer",i),appearance:i},ce.createElement(on,{className:l("stepHeader",i)},ce.createElement(ln,null,ce.createElement(wo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(u=i==null?void 0:i.theme)==null?void 0:u.colorPrimary,appearance:i}),ce.createElement(rn,{appearance:i,className:l("stepTitle",i),dangerouslySetInnerHTML:pe(e.title)})),ce.createElement(nn,{className:l("stepChevronContainer",i),onClick:()=>o()},ce.createElement(Ot,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(c=i==null?void 0:i.theme)==null?void 0:c.colorTextSecondary}))),ce.createElement(cp,null,!t&&ce.createElement(mp.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},a()??d())))};import Dt from"styled-components";var Vh=Dt.div`
|
|
957
957
|
background: #ffffff;
|
|
958
958
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
959
959
|
border-radius: 6px;
|
|
@@ -967,49 +967,49 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
967
967
|
|
|
968
968
|
max-width: 800px;
|
|
969
969
|
min-width: 350px;
|
|
970
|
-
`,
|
|
970
|
+
`,pn=Dt.div`
|
|
971
971
|
display: flex;
|
|
972
972
|
flex-direction: column;
|
|
973
|
-
`,
|
|
973
|
+
`,dn=Dt.h1`
|
|
974
974
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
975
975
|
font-style: normal;
|
|
976
976
|
font-weight: 700;
|
|
977
977
|
font-size: 20px;
|
|
978
978
|
line-height: 24px;
|
|
979
979
|
margin-bottom: 8px;
|
|
980
|
-
`,
|
|
980
|
+
`,cn=Dt.h2`
|
|
981
981
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
982
982
|
font-weight: 400;
|
|
983
983
|
font-size: 14px;
|
|
984
984
|
line-height: 23px;
|
|
985
985
|
margin: 2px 0 0 0;
|
|
986
|
-
`,
|
|
986
|
+
`,mn=Dt.div`
|
|
987
987
|
display: block;
|
|
988
988
|
width: 100%;
|
|
989
|
-
`,
|
|
989
|
+
`,un=Dt.div`
|
|
990
990
|
display: flex;
|
|
991
991
|
width: 100%;
|
|
992
992
|
flex-direction: column;
|
|
993
993
|
justify-content: space-between;
|
|
994
994
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
995
995
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
996
|
-
`;var fp=({title:e,subtitle:t,steps:o,onClose:n,visible:r,onCompleteStep:i,autoExpandFirstIncompleteStep:s=!0,autoCollapse:p=!0,autoExpandNextStep:d=!0,primaryColor:a="#000000",selectedStep:u,setSelectedStep:c,appearance:f,type:b,className:w,customStepTypes:S})=>{let g=o.filter(m=>m.complete).length,[P,T]=up(Array(o.length).fill(!0));
|
|
996
|
+
`;var fp=({title:e,subtitle:t,steps:o,onClose:n,visible:r,onCompleteStep:i,autoExpandFirstIncompleteStep:s=!0,autoCollapse:p=!0,autoExpandNextStep:d=!0,primaryColor:a="#000000",selectedStep:u,setSelectedStep:c,appearance:f,type:b,className:w,customStepTypes:S})=>{let g=o.filter(m=>m.complete).length,[P,T]=up(Array(o.length).fill(!0));fn(()=>{let m=[...P];if(s){for(let C=0;C<o.length;C++)if(!o[C].complete){m[C]=!1;break}T(m)}},[]),fn(()=>{A(u)},[u]);let A=m=>{let C=[...P];if(p)for(let E=0;E<P.length;++E)E!==m&&(C[E]=!0);C[m]=!C[m],T(C)};if(!r&&b=="modal")return Fe.createElement(Fe.Fragment,null);let k=Fe.createElement(Fe.Fragment,null,Fe.createElement(pn,null,Fe.createElement(dn,{appearance:f,className:l("checklistTitle",f),dangerouslySetInnerHTML:pe(e)}),Fe.createElement(cn,{appearance:f,className:l("checklistSubtitle",f),dangerouslySetInnerHTML:pe(t)})),Fe.createElement(Ue,{display:"percent",count:g,total:o.length,fillColor:a,style:{margin:"14px 0px 8px 0px"},appearance:f})),x=Fe.createElement(mn,{className:xe(l("checklistContainer",f),w)},o.map((m,C)=>{let E=P[C];return Fe.createElement(an,{appearance:f,stepData:m,collapsed:E,key:`modal-checklist-${m.id??C}`,onClick:()=>{if(u===C){A(C);return}c(C)},onPrimaryButtonClick:()=>{i&&i(C,m),m.handlePrimaryButtonClick&&m.handlePrimaryButtonClick(),d&&!m.completionCriteria&&C<P.length-1&&P[C+1]&&c(C+1)},onSecondaryButtonClick:()=>{m.handleSecondaryButtonClick&&m.handleSecondaryButtonClick()},customStepTypes:S})}));return b==="inline"?Fe.createElement(un,{appearance:f,className:xe(l("checklistInlineContainer",f),w)},k,x):Fe.createElement(Fe.Fragment,null,Fe.createElement(Qe,{onClose:n,visible:r,appearance:f,style:{maxWidth:"600px"},headerContent:k},x))},Qo=fp;import se,{useEffect as Zo,useRef as yp,useState as Ct}from"react";import xt from"react";import ne,{css as gn,keyframes as hn}from"styled-components";var xn=gn`
|
|
997
997
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
998
|
-
`,gp=
|
|
998
|
+
`,gp=gn`
|
|
999
999
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1000
|
-
`,hp=
|
|
1000
|
+
`,hp=hn`
|
|
1001
1001
|
from {
|
|
1002
1002
|
opacity: 0;
|
|
1003
1003
|
} to {
|
|
1004
1004
|
opacity: 1;
|
|
1005
1005
|
}
|
|
1006
|
-
`,xp=
|
|
1006
|
+
`,xp=hn`
|
|
1007
1007
|
from {
|
|
1008
1008
|
opacity: 1;
|
|
1009
1009
|
} to {
|
|
1010
1010
|
opacity: 0;
|
|
1011
1011
|
}
|
|
1012
|
-
`,
|
|
1012
|
+
`,Cn=ne.div`
|
|
1013
1013
|
margin: 0 -20px;
|
|
1014
1014
|
overflow-x: auto;
|
|
1015
1015
|
padding-left: 20px;
|
|
@@ -1026,13 +1026,13 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1026
1026
|
::-webkit-scrollbar {
|
|
1027
1027
|
display: none;
|
|
1028
1028
|
}
|
|
1029
|
-
`,
|
|
1029
|
+
`,Sn=ne.div`
|
|
1030
1030
|
display: flex;
|
|
1031
1031
|
flex-flow: row nowrap;
|
|
1032
1032
|
gap: 0 16px;
|
|
1033
1033
|
scroll-snap-align: center;
|
|
1034
1034
|
scroll-snap-stop: always;
|
|
1035
|
-
`,
|
|
1035
|
+
`,yn=ne.div`
|
|
1036
1036
|
animation: ${e=>e.reversed?xp:hp} 0.25s ease-out;
|
|
1037
1037
|
background: linear-gradient(
|
|
1038
1038
|
to right,
|
|
@@ -1041,8 +1041,8 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1041
1041
|
);
|
|
1042
1042
|
position: absolute;
|
|
1043
1043
|
width: 64px;
|
|
1044
|
-
`,
|
|
1045
|
-
${
|
|
1044
|
+
`,bn=ne.button`
|
|
1045
|
+
${xn}
|
|
1046
1046
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1047
1047
|
align-items: center;
|
|
1048
1048
|
border-radius: 50%;
|
|
@@ -1053,11 +1053,11 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1053
1053
|
justify-content: center;
|
|
1054
1054
|
position: absolute;
|
|
1055
1055
|
width: 48px;
|
|
1056
|
-
`,
|
|
1056
|
+
`,wn=ne.div`
|
|
1057
1057
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1058
1058
|
padding: 20px;
|
|
1059
|
-
`,
|
|
1060
|
-
${
|
|
1059
|
+
`,Tn=ne(wn)`
|
|
1060
|
+
${xn}
|
|
1061
1061
|
background: ${({theme:e})=>e.colorBackground};
|
|
1062
1062
|
|
|
1063
1063
|
&:active {
|
|
@@ -1068,94 +1068,94 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1068
1068
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1069
1069
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1070
1070
|
}
|
|
1071
|
-
`,
|
|
1071
|
+
`,Fn=ne.img`
|
|
1072
1072
|
border-radius: 50%;
|
|
1073
1073
|
height: 40px;
|
|
1074
1074
|
margin-bottom: 12px;
|
|
1075
1075
|
width: 40px;
|
|
1076
|
-
`,
|
|
1076
|
+
`,kn=ne(wn)`
|
|
1077
1077
|
${e=>F(e)} {
|
|
1078
1078
|
${gp}
|
|
1079
1079
|
|
|
1080
1080
|
background: ${({theme:e})=>e.colorBackground};
|
|
1081
1081
|
}
|
|
1082
|
-
`,
|
|
1082
|
+
`,Pn=ne.div`
|
|
1083
1083
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1084
1084
|
display: flex;
|
|
1085
1085
|
flex-flow: row nowrap;
|
|
1086
1086
|
align-items: center;
|
|
1087
1087
|
margin-left: 20px;
|
|
1088
|
-
`,
|
|
1088
|
+
`,vn=ne.div`
|
|
1089
1089
|
white-space: nowrap;
|
|
1090
|
-
`,
|
|
1090
|
+
`,En=ne.div`
|
|
1091
1091
|
background: #d8fed8;
|
|
1092
1092
|
border-radius: 6px;
|
|
1093
1093
|
margin-bottom: 12px;
|
|
1094
1094
|
padding: 4px 10px;
|
|
1095
|
-
`,Cp=
|
|
1095
|
+
`,Cp=ne.p`
|
|
1096
1096
|
font-weight: bold;
|
|
1097
1097
|
font-size: 18px;
|
|
1098
1098
|
line-height: 22px;
|
|
1099
1099
|
letter-spacing: calc(18px * -0.01);
|
|
1100
1100
|
margin: 0;
|
|
1101
|
-
`,
|
|
1101
|
+
`,An=ne(Cp)`
|
|
1102
1102
|
margin-bottom: 4px;
|
|
1103
|
-
`,Sp=
|
|
1103
|
+
`,Sp=ne.p`
|
|
1104
1104
|
font-weight: bold;
|
|
1105
1105
|
font-size: 16px;
|
|
1106
1106
|
line-height: 20px;
|
|
1107
1107
|
letter-spacing: calc(16px * -0.01);
|
|
1108
1108
|
margin: 0;
|
|
1109
|
-
`,
|
|
1109
|
+
`,In=ne(Sp)`
|
|
1110
1110
|
margin-bottom: 4px;
|
|
1111
1111
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1112
1112
|
`}
|
|
1113
|
-
`,
|
|
1113
|
+
`,_e=ne.p`
|
|
1114
1114
|
color: ${({theme:e})=>e.colorText};
|
|
1115
1115
|
font-weight: normal;
|
|
1116
1116
|
font-size: 14px;
|
|
1117
1117
|
line-height: 22px;
|
|
1118
1118
|
margin: 0;
|
|
1119
|
-
`,Bn=
|
|
1119
|
+
`,Bn=ne.p`
|
|
1120
1120
|
color: ${({theme:e})=>e.colorText};
|
|
1121
1121
|
font-weight: 600;
|
|
1122
1122
|
font-size: 12px;
|
|
1123
1123
|
line-height: 16px;
|
|
1124
1124
|
margin: 0;
|
|
1125
|
-
`;
|
|
1125
|
+
`;_e.Loud=ne(_e)`
|
|
1126
1126
|
font-weight: 600;
|
|
1127
|
-
`;
|
|
1127
|
+
`;_e.Quiet=ne(_e)`
|
|
1128
1128
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1129
1129
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1130
1130
|
`}
|
|
1131
|
-
`;var
|
|
1131
|
+
`;var Nn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=Q(),{primaryCTAClickSideEffects:r}=ie(),{theme:i,styleOverrides:s}=n(o),{imageUri:p=null,subtitle:d=null,title:a=null,complete:u=!1,blocked:c=!1}=e,f=()=>{r(e)};return xt.createElement(Tn,{className:l("carouselCard",o),onClick:c?null:f,style:t,blocked:c,complete:u},xt.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&xt.createElement(Fn,{className:l("carouselCardImage",o),src:p,alt:a,style:{opacity:u||c?.4:1}}),u&&xt.createElement(En,{className:l("carouselCompletedPill",o)},xt.createElement(Bn,{style:{color:"#108E0B"}},"Complete"))),a&&xt.createElement(In,{blocked:c,complete:u,className:l("carouselCardTitle",o)},a),d&&xt.createElement(_e.Quiet,{blocked:c,complete:u,className:l("carouselCardSubtitle",o)},d))};import Qt from"react";var Ln=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let n=t>0?e/t:0,r=200,i=Math.min(r,Math.max(10,Math.round(r*n)));return Qt.createElement(Pn,{className:l("carouselProgressBar",o)},Qt.createElement(vn,{as:_e.Loud,style:{marginRight:8}},e," of ",t),Qt.createElement("svg",{height:10,width:r},Qt.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"#E6E6E6"}),Qt.createElement("rect",{x:0,y:0,rx:5,width:i,height:10,fill:"currentColor"})))};var bp=()=>se.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},se.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),se.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),se.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),On=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[n,r]=Ct(!1),[i,s]=Ct(!1);Zo(()=>{t===!0&&n===!1?r(!0):t===!1&&n===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return n?se.createElement(yn,{style:d,reversed:i,onAnimationEnd:i?p:null},se.createElement(bn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},se.createElement(bp,null))):null},Dn=({flowId:e,appearance:t,customVariables:o,className:n})=>{let r=yp(null),[i,s]=Ct(!1),[p,d]=Ct(!1),[a,u]=Ct(null),[c,f]=Ct([]),[b,w]=Ct(0),{getFlowMetadata:S,getFlowSteps:g,getNumberOfStepsCompleted:P,updateCustomVariables:T,getFlowStatus:A,isLoading:k,targetingLogicShouldHideFlow:x,getFlow:m}=Y();Zo(()=>{T(o)},[o,k]),Zo(()=>{if(k)return;let I=S(e),H=P(e),B=g(e);u(I),I.data!==null&&(f(B.sort((M,re)=>Number(M.complete)-Number(re.complete))),d(B.length>3),w(H))},[k]);let C=[];for(let I=0;I<c.length;I+=3)C.push(c.slice(I,I+3));let E=I=>{let H=I.target,B=H.scrollWidth-H.clientWidth,M=Math.ceil(H.scrollLeft);M>0&&i===!1&&s(!0),M===0&&i===!0&&s(!1),M<B&&p===!1&&d(!0),M===B&&p===!0&&d(!1)},U=(I=!0)=>{let H=I?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*H,behavior:"smooth"})},$=null,_=I=>{$!==null?clearTimeout($):E(I),$=setTimeout(()=>{E(I)},16)};return k?null:se.createElement(kn,{className:xe(l("carouselContainer",t),n)},se.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},se.createElement("div",null,se.createElement(An,{className:l("carouselTitle",t)},a==null?void 0:a.title),se.createElement(_e.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),se.createElement(Ln,{numberOfStepsCompleted:b,numberOfSteps:c.length})),se.createElement("div",{style:{position:"relative"}},se.createElement(On,{show:i,onClick:()=>U(!1)}),se.createElement(On,{side:"right",show:p,onClick:U}),se.createElement(Cn,{ref:r,onScroll:_},C.map((I,H)=>se.createElement(Sn,{key:H,style:{flex:`0 0 calc(100% - ${c.length>3?36:0}px)`}},I.map((B,M)=>se.createElement(Nn,{key:M,stepData:B,style:{flex:c.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var Ro=({flowId:e,title:t,subtitle:o,style:n,initialSelectedStep:r,className:i,type:s="inline",onDismiss:p,visible:d,customVariables:a,onStepCompletion:u,onButtonClick:c,appearance:f,hideOnFlowCompletion:b,setVisible:w,customStepTypes:S,checklistStyle:g="default",autoExpandFirstIncompleteStep:P,autoExpandNextStep:T,...A})=>{let{getFlow:k,getFlowSteps:x,markStepCompleted:m,getStepStatus:C,getNumberOfStepsCompleted:E,isLoading:U,targetingLogicShouldHideFlow:$,updateCustomVariables:_,getFlowMetadata:I,isStepBlocked:H,getFlowStatus:B,hasActiveFullPageFlow:M,setHasActiveFullPageFlow:re}=Y(),{primaryCTAClickSideEffects:X,secondaryCTAClickSideEffects:W}=ie(),{getOpenFlowState:be,setOpenFlowState:me}=Pe(),[j,J]=Mn(r||0),[fe,L]=Mn(!1),N=d===void 0?be(e):d,ee=s==="modal",{mergeAppearanceWithDefault:te}=Q(),{isLarge:we}=Zi();if(f=te(f),$n(()=>{_(a)},[a,U]),$n(()=>{d!==void 0&&(ee&&d===!0?re(!0):ee&&d===!1&&re(!1))},[d,w,M]),U)return null;let it=k(e);if(!it||$(it))return null;let ke=x(e);if(!ke||b===!0&&B(e)===q)return null;let ue=I(e);if(ue!=null&&ue.title&&(t=ue.title),ue!=null&&ue.subtitle&&(o=ue.subtitle),!fe&&r===void 0&&E(e)>0){let z=Math.min(E(e),ke.length-1);J(z),L(!0)}function He(){if(j+1>=ke.length){ee&&me(e,!1);return}H(e,ke[j+1].id)||J(j+1)}function Ge(z,st,to){let sr=j+1<ke.length?ke[j+1]:null;c&&c(z,j,st,sr)===!0&&ee&&h(),u&&u(z,to,sr),!u&&!c&&(z.primaryButtonUri||z.secondaryButtonUri)&&ee&&h()}function K(){return ke.map((z,st)=>({...z,handleSecondaryButtonClick:()=>{He(),W(z),z.skippable===!0&&m(e,z.id,{skipped:!0}),Ge(z,"secondary",st)},handlePrimaryButtonClick:()=>{(!z.completionCriteria&&(z.autoMarkCompleted||z.autoMarkCompleted===void 0)||z.completionCriteria&&z.autoMarkCompleted===!0)&&(m(e,z.id),He()),Ge(z,"primary",st),X(z),C(e,z.id)===Le&&He()}}))}function he(){return le.createElement(oe,{appearance:f})}let nt={steps:K(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:S,type:s,className:i,autoExpandFirstIncompleteStep:P,autoExpandNextStep:T};function h(){me(e,!1),p&&p(),w&&w(!1)}function y(){return le.createElement(le.Fragment,null,le.createElement(he,null),le.createElement(Dn,{flowId:e,appearance:f,customVariables:a,className:i}))}function v(){return le.createElement(le.Fragment,null,le.createElement(he,null),le.createElement(Qo,{visible:N,onClose:()=>{h()},selectedStep:j,setSelectedStep:J,autoExpandNextStep:!0,appearance:f,...nt}))}function G(){if(!we)return v();let z=A.guideFlowId,st;return z&&k(z)&&(st=x(z)),le.createElement(le.Fragment,null,le.createElement(he,null),le.createElement(Jo,{visible:N,stepsTitle:ue.stepsTitle?ue.stepsTitle:"Your quick start guide",onClose:()=>{h()},selectedStep:j,setSelectedStep:J,guideData:st,guideTitle:A.guideTitle??"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:to=>{Ge(to,"link",0)},customStepTypes:S,...nt}))}function ae(){if(!we)return v();let z=le.createElement(Yo,{flowId:e,style:n,selectedStep:j,setSelectedStep:J,appearance:f,type:s,...nt});return ee?le.createElement(Qe,{onClose:()=>{h()},visible:N,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},le.createElement(he,null),z):le.createElement(le.Fragment,null,le.createElement(he,null),z)}switch(g){case"condensed":return v();case"with-guide":return G();case"default":return ae();case"carousel":return y();default:return ae()}};var Tp=e=>wp.createElement(Ro,{type:"inline",...e});import ot,{useEffect as kp}from"react";import We from"react";import Eo from"styled-components";var Un=Eo.div`
|
|
1132
1132
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1133
1133
|
border-radius: 8px;
|
|
1134
1134
|
padding: 6px 10px 6px 10px;
|
|
1135
1135
|
min-width: 160px;
|
|
1136
1136
|
cursor: pointer;
|
|
1137
1137
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1138
|
-
`,
|
|
1138
|
+
`,_n=Eo.div`
|
|
1139
1139
|
display: flex;
|
|
1140
1140
|
flex-direction: row;
|
|
1141
1141
|
justify-content: space-between;
|
|
1142
1142
|
align-items: center;
|
|
1143
1143
|
margin-bottom: 2px;
|
|
1144
1144
|
flex-grow: 2;
|
|
1145
|
-
`,
|
|
1145
|
+
`,Wn=Eo.div`
|
|
1146
1146
|
text-overflow: ellipsis;
|
|
1147
1147
|
font-weight: 600;
|
|
1148
1148
|
font-size: 12px;
|
|
1149
1149
|
line-height: 15px;
|
|
1150
1150
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1151
1151
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1152
|
-
`,
|
|
1152
|
+
`,zn=Eo.div`
|
|
1153
1153
|
width: 20px;
|
|
1154
1154
|
margin-right: 8px;
|
|
1155
1155
|
display: flex;
|
|
1156
1156
|
height: 100%;
|
|
1157
1157
|
align-items: center;
|
|
1158
|
-
`;import{motion as Fp}from"framer-motion";var
|
|
1158
|
+
`;import{motion as Fp}from"framer-motion";var Hn=({title:e,count:t,total:o,onClick:n,style:r={},className:i,appearance:s,type:p="default"})=>We.createElement(We.Fragment,null,We.createElement(oe,{appearance:s}),We.createElement(Un,{as:Fp.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>n!==void 0&&n(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:xe(i??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&We.createElement(zn,{className:l("progressRingContainer",s)},We.createElement(Et,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),We.createElement(_n,{type:p,className:l("badgeTitleContainer",s)},We.createElement(Wn,{type:p,appearance:s,className:l("badgeTitle",s)},e),n!==void 0&&We.createElement(Ot,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&We.createElement(Ue,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import tt from"react";import Zt from"styled-components";var Gn=Zt.div`
|
|
1159
1159
|
display: flex;
|
|
1160
1160
|
flex-direction: row;
|
|
1161
1161
|
width: 100%;
|
|
@@ -1173,12 +1173,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1173
1173
|
align-items: center;
|
|
1174
1174
|
margin-right: 16px;
|
|
1175
1175
|
}
|
|
1176
|
-
`,
|
|
1176
|
+
`,Vn=Zt.div`
|
|
1177
1177
|
display: flex;
|
|
1178
1178
|
flex-direction: column;
|
|
1179
1179
|
flex: 1;
|
|
1180
1180
|
margin-top: 0;
|
|
1181
|
-
`,
|
|
1181
|
+
`,Kn=Zt.div`
|
|
1182
1182
|
display: flex;
|
|
1183
1183
|
flex-direction: column;
|
|
1184
1184
|
justify-content: center;
|
|
@@ -1193,7 +1193,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1193
1193
|
:hover {
|
|
1194
1194
|
opacity: 0.8;
|
|
1195
1195
|
}
|
|
1196
|
-
`;var
|
|
1196
|
+
`;var qn=({title:e,subtitle:t,icon:o,appearance:n,count:r,total:i,className:s,style:p})=>tt.createElement(tt.Fragment,null,tt.createElement(Gn,{appearance:n,className:xe(l("fullWidthProgressBadgeContainer",n),s??""),style:p},o&&tt.createElement(jn,{className:l("fullWidthProgressBadgeIcon",n)},o),tt.createElement(Vn,null,tt.createElement(Ce,{size:"small",appearance:n,title:e,subtitle:t})),tt.createElement(Kn,{className:l("fullWidthProgressBadgeProgressContainer",n)},tt.createElement(Ue,{count:r,total:i,display:"percent",textLocation:"top",fillColor:n.theme.colorPrimary}))));var Pp=({flowId:e,title:t,subtitle:o,icon:n,style:r,onClick:i,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:a,type:u="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:b,getNumberOfStepsCompleted:w,isLoading:S,targetingLogicShouldHideFlow:g,updateCustomVariables:P}=Y(),{mergeAppearanceWithDefault:T}=Q();a=T(a);let{setOpenFlowState:A,getOpenFlowState:k}=Pe();if(kp(()=>{P(p)},[p,S]),S)return null;let x=c(e);if(!x||g(x)||d===!0&&b(e)===q)return null;let m=f(e),C=w(e);return u==="full-width"?ot.createElement(ot.Fragment,null,ot.createElement(oe,{appearance:a}),ot.createElement(qn,{title:t,subtitle:o,count:C,total:m.length,style:r,className:s,appearance:a,icon:n,onClick:()=>{}})):ot.createElement(ot.Fragment,null,ot.createElement(oe,{appearance:a}),ot.createElement(Hn,{count:C,total:m.length,title:t,style:r,onClick:()=>{A(e,!0),i&&i()},type:u,className:s,appearance:a}))};import vp from"react";var Ep=({flowId:e,style:t,appearance:o,...n})=>{let{getFlow:r,targetingLogicShouldHideFlow:i,getFlowSteps:s}=Y(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let d=r(e);if(!d||i(d))return null;let a=s(e);return vp.createElement(Jt,{steps:a,style:t,appearance:o,...n})};import Mt,{useContext as Wp,useEffect as zp}from"react";import D,{useEffect as Ao,useLayoutEffect as is,useRef as Lp,useState as Rt}from"react";import eo from"styled-components";import{useCallback as Ap,useEffect as Ip,useState as Bp}from"react";var er=(e,t,o,n={x:20,y:20},r)=>{let i=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return!e||!e.left||!e.top?{x:0,y:0}:t==="left"?{x:e.left-o+n.x+s,y:e.top-n.y+i}:t==="right"?{x:e.left+e.width+n.x+s,y:e.top-n.y+i}:{x:0,y:0}},Yn={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Np(e){let t=Yn;return e&&(t=e.getBoundingClientRect()),t}function Xn(e,t){let[o,n]=Bp(Yn),r=Ap(()=>{e&&n(Np(e))},[e]);return Ip(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),o}import rt from"styled-components";var Jn=rt.div`
|
|
1197
1197
|
${e=>F(e)} {
|
|
1198
1198
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
1199
1199
|
}
|
|
@@ -1204,13 +1204,13 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1204
1204
|
min-width: 300px;
|
|
1205
1205
|
padding: 22px 22px 12px;
|
|
1206
1206
|
z-index: ${e=>e.zIndex};
|
|
1207
|
-
`,
|
|
1207
|
+
`,Qn=rt.div`
|
|
1208
1208
|
display: block;
|
|
1209
1209
|
cursor: pointer;
|
|
1210
1210
|
position: absolute;
|
|
1211
1211
|
top: 25px;
|
|
1212
1212
|
right: 22px;
|
|
1213
|
-
`,
|
|
1213
|
+
`,Zn=rt.img`
|
|
1214
1214
|
${e=>F(e)} {
|
|
1215
1215
|
display: block;
|
|
1216
1216
|
width: 100%;
|
|
@@ -1219,7 +1219,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1219
1219
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
1220
1220
|
margin-bottom: 16px;
|
|
1221
1221
|
}
|
|
1222
|
-
`,
|
|
1222
|
+
`,Rn=rt.div`
|
|
1223
1223
|
${e=>F(e)} {
|
|
1224
1224
|
display: block;
|
|
1225
1225
|
width: 100%;
|
|
@@ -1228,17 +1228,17 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1228
1228
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
1229
1229
|
margin-bottom: 16px;
|
|
1230
1230
|
}
|
|
1231
|
-
`,
|
|
1231
|
+
`,es=rt.div`
|
|
1232
1232
|
display: flex;
|
|
1233
1233
|
flex-direction: row;
|
|
1234
1234
|
justify-content: space-between;
|
|
1235
1235
|
align-content: center;
|
|
1236
|
-
`,
|
|
1236
|
+
`,ts=rt.div`
|
|
1237
1237
|
display: flex;
|
|
1238
1238
|
flex: 1;
|
|
1239
1239
|
flex-direction: column;
|
|
1240
1240
|
justify-content: center;
|
|
1241
|
-
`,
|
|
1241
|
+
`,os=rt.div`
|
|
1242
1242
|
display: flex;
|
|
1243
1243
|
flex: 2;
|
|
1244
1244
|
flex-shrink: 1;
|
|
@@ -1250,7 +1250,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1250
1250
|
align-content: center;
|
|
1251
1251
|
align-items: center;
|
|
1252
1252
|
}
|
|
1253
|
-
`,
|
|
1253
|
+
`,rs=rt.p`
|
|
1254
1254
|
${e=>F(e)} {
|
|
1255
1255
|
font-style: normal;
|
|
1256
1256
|
font-weight: 600;
|
|
@@ -1259,7 +1259,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1259
1259
|
color: #808080;
|
|
1260
1260
|
}
|
|
1261
1261
|
margin: 0;
|
|
1262
|
-
`;var
|
|
1262
|
+
`;var ns=300,ss=100,Op=500,$t=12,Dp=eo.div`
|
|
1263
1263
|
width: 100%;
|
|
1264
1264
|
height: 100%;
|
|
1265
1265
|
border-radius: 9999px;
|
|
@@ -1291,16 +1291,16 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1291
1291
|
opacity: 1;
|
|
1292
1292
|
`,Mp=eo.div`
|
|
1293
1293
|
pointer-events: all;
|
|
1294
|
-
`,
|
|
1294
|
+
`,ls=eo.div`
|
|
1295
1295
|
display: flex;
|
|
1296
1296
|
align-content: center;
|
|
1297
1297
|
justify-content: center;
|
|
1298
1298
|
align-items: center;
|
|
1299
1299
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1300
|
-
`,Up=eo(
|
|
1300
|
+
`,Up=eo(ls)`
|
|
1301
1301
|
width: ${$t+12}px;
|
|
1302
1302
|
height: ${$t+12}px;
|
|
1303
|
-
`,_p=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:n="auto",showHighlight:r=!0,primaryColor:i="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:a=0,customStepTypes:u,appearance:c,dismissible:f=!1,showHighlightOnly:b,showStepCount:w=!0,completedStepsCount:S=0})=>{var
|
|
1303
|
+
`,_p=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:n="auto",showHighlight:r=!0,primaryColor:i="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:a=0,customStepTypes:u,appearance:c,dismissible:f=!1,showHighlightOnly:b,showStepCount:w=!0,completedStepsCount:S=0})=>{var ke,ue,He,Ge;let[g,P]=Rt(),[T,A]=Rt(new Date),k=Lp(null),[x,m]=Rt(document.querySelector(e[a].selector)),C=Xn(x,T),[E,U]=Rt(),[$,_]=Rt(!b),I=(ue=(ke=e[a])==null?void 0:ke.props)!=null&&ue.position?e[a].props.position:"absolute",H=((Ge=(He=e[a])==null?void 0:He.props)==null?void 0:Ge.zIndex)??90,B=(g==null?void 0:g.width)??ns,M=(g==null?void 0:g.height)??ss;is(()=>{k.current&&P({width:k.current.clientWidth,height:k.current.clientHeight})},[a,T,I]),Ao(()=>{b||_(!0)},[a]);let re=n==="auto"?"right":n,X=er(C,re,B,s,I),W=C.right+B>(window.innerWidth||document.documentElement.clientWidth),be=C.bottom+ss>(window.innerHeight||document.documentElement.clientHeight);W&&n==="auto"&&(X=er(C,"left",B,s,I),re="left");let me=window.location.pathname.split("/").pop(),j=()=>{let K=document.querySelector(e[a].selector);E&&E===JSON.stringify(K==null?void 0:K.getBoundingClientRect())||(m(K),A(new Date),K&&U(JSON.stringify(K.getBoundingClientRect())))};if(Ao(()=>{let K=new MutationObserver(j);return K.observe(document.body,{subtree:!0,childList:!0}),()=>K.disconnect()},[j]),Ao(()=>{let K=new MutationObserver(j);return K.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>K.disconnect()},[j]),Ao(()=>{let K=setInterval(()=>{j()},10);return()=>clearInterval(K)},[j]),is(()=>{setTimeout(()=>{j()},Op),j()},[a,me]),x===null)return D.createElement(D.Fragment,null);if(X.x==0&&X.y==0)return D.createElement(D.Fragment,null);if(!p)return D.createElement(D.Fragment,null);let J=()=>{let K=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),_(!1),setTimeout(()=>{j()},30)),S===e.length-1)return o()},he=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),b&&_(!1))};return D.createElement(D.Fragment,null,w&&D.createElement(ts,null,D.createElement(rs,{className:l("tooltipStepCounter",c)},a+1," of ",e.length)),D.createElement(os,{showStepCount:w,className:l("tooltipCTAContainer",c)},e[a].secondaryButtonTitle&&D.createElement(R,{title:e[a].secondaryButtonTitle,appearance:c,onClick:he,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&D.createElement(R,{title:e[a].primaryButtonTitle,appearance:c,onClick:K,withMargin:!1,size:"small"})))},fe=()=>D.createElement(D.Fragment,null,f&&D.createElement(Qn,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",c)},D.createElement(ve,null)),e[a].imageUri&&D.createElement(Zn,{dismissible:f,appearance:c,src:e[a].imageUri,className:l("tooltipImageContainer",c)}),e[a].videoUri&&!e[a].imageUri&&D.createElement(Rn,{dismissible:f,appearance:c,className:l("tooltipVideoContainer",c)},D.createElement(Pt,{appearance:c,videoUri:e[a].videoUri})),D.createElement(Ce,{appearance:c,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),D.createElement(es,{className:l("tooltipFooter",c)},D.createElement(J,null))),N={...{default:K=>{var he;if((he=e[a])!=null&&he.StepContent){let nt=e[a].StepContent;return D.createElement("div",null,nt)}return D.createElement(fe,null)}},...u},ee=()=>{var K;return e?!((K=e[a])!=null&&K.type)||!N[e[a].type]?N.default(e[a]):N[e[a].type]({stepData:e[a],primaryColor:i}):D.createElement(D.Fragment,null)};if(b&&e[a].complete===!0)return null;let te={top:(X==null?void 0:X.y)-$t,left:(re=="left"?C.x+s.x:(X==null?void 0:X.x)-$t)??0,cursor:b?"pointer":"default",position:I},we=()=>{let he=te.left+(re=="left"?-B:24);return Math.min(Math.max(he,20),window.innerWidth-B-20)},it=()=>{b&&(A(new Date),_(!$))};return D.createElement(Mp,null,D.createElement(Up,{style:te,zIndex:H,className:l("tourHighlightContainer",c)},r&&e[a].showHighlight!==!1&&D.createElement(D.Fragment,null,D.createElement($p,{style:{position:I},onClick:it,primaryColor:c.theme.colorPrimary}),D.createElement(Dp,{style:{position:"absolute"},onClick:it,primaryColor:c.theme.colorPrimary}))),D.createElement(ls,{style:{...te,left:we()},zIndex:H+1,className:l("tooltipContainerWrapper",c)},$&&D.createElement(Jn,{ref:k,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:c,className:l("tooltipContainer",c),maxWidth:ns,zIndex:H+10},D.createElement(ee,null))))},Io=_p;import{Portal as Hp}from"react-portal";var Gp=({flowId:e,customVariables:t,appearance:o,onStepCompletion:n,onButtonClick:r,showTooltipsSimultaneously:i=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:a=!1,dismissBehavior:u="complete-flow",onComplete:c,...f})=>{let{getFlow:b,getFlowSteps:w,isLoading:S,targetingLogicShouldHideFlow:g,markStepCompleted:P,markStepStarted:T,markFlowCompleted:A,updateCustomVariables:k,getCurrentStepIndex:x,getStepStatus:m,isStepBlocked:C,getFlowStatus:E,getNumberOfStepsCompleted:U}=Y(),{isLoadingUserFlowStateData:$}=Ie(),{primaryCTAClickSideEffects:_,secondaryCTAClickSideEffects:I}=ie(),{hasOpenModals:H}=Pe(),B=x(e),{openFlowStates:M}=Wp(V),{mergeAppearanceWithDefault:re}=Q();if(o=re(o),zp(()=>{k(t)},[t,S]),$)return null;let X=b(e);if(!X||g(X)||E(e)==q||H())return null;let W=w(e);if(Object.keys(M).length>0){let L=Object.keys(M).find(N=>M[N]===!0);if(L!==void 0&&L!==e)return Mt.createElement(Mt.Fragment,null)}async function be(L){if(await P(e,L.id),W.map(N=>m(e,N.id)).every(N=>N===Le)){await A(e);return}if(!a&&B+1<W.length){if(C(e,W[B+1].id))return;await T(e,W[B+1].id)}}function me(L,N,ee){let te=B+1<W.length?W[B+1]:null;r&&r(L,B,N,te),n&&n(L,ee,te)}function j(){return W.map(L=>({...L,handleSecondaryButtonClick:async()=>{I(L),L.skippable===!0&&await P(e,L.id,{skipped:!0}),me(L,"secondary",B)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await be(L),me(L,"primary",B),_(L)}}))}async function J(L){s&&s(),u==="complete-flow"?await A(e):await P(e,L.id)}function fe(){c&&c()}return Mt.createElement(Hp,null,Mt.createElement(oe,{appearance:o}),i?W.map((L,N)=>Mt.createElement(Io,{key:L.id,appearance:o,steps:j(),selectedStep:N,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>J(L),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:U(e),onComplete:fe,...f})):Mt.createElement(Io,{appearance:o,steps:j(),selectedStep:B,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>J(W[B]),tooltipPosition:d,completedStepsCount:U(e),showHighlightOnly:a,onComplete:fe,...f}))};import ye,{useEffect as jp,useRef as Vp,useState as Kp}from"react";import{Portal as qp}from"react-portal";import St from"styled-components";var as=St.button`
|
|
1304
1304
|
${e=>F(e)} {
|
|
1305
1305
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1306
1306
|
|
|
@@ -1318,17 +1318,17 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1318
1318
|
opacity: 0.8;
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
|
-
`,
|
|
1321
|
+
`,ps=St.span`
|
|
1322
1322
|
${e=>F(e)} {
|
|
1323
1323
|
font-size: 12px;
|
|
1324
1324
|
display: inline-block;
|
|
1325
1325
|
}
|
|
1326
|
-
`,
|
|
1326
|
+
`,ds=St.span`
|
|
1327
1327
|
${e=>F(e)} {
|
|
1328
1328
|
font-size: 12px;
|
|
1329
1329
|
display: inline-block;
|
|
1330
1330
|
}
|
|
1331
|
-
`,
|
|
1331
|
+
`,cs=St.div`
|
|
1332
1332
|
position: fixed;
|
|
1333
1333
|
right: 0;
|
|
1334
1334
|
bottom: 0;
|
|
@@ -1338,7 +1338,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1338
1338
|
flex-direction: column;
|
|
1339
1339
|
align-items: flex-end;
|
|
1340
1340
|
z-index: 50;
|
|
1341
|
-
`,
|
|
1341
|
+
`,ms=St.button`
|
|
1342
1342
|
${e=>F(e)} {
|
|
1343
1343
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1344
1344
|
background-color: #ffffff;
|
|
@@ -1354,7 +1354,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1354
1354
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1355
1355
|
border-radius: 45px;
|
|
1356
1356
|
cursor: pointer;
|
|
1357
|
-
`,
|
|
1357
|
+
`,us=St.div`
|
|
1358
1358
|
${e=>F(e)} {
|
|
1359
1359
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1360
1360
|
background: #ffffff;
|
|
@@ -1371,7 +1371,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1371
1371
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1372
1372
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1373
1373
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1374
|
-
`,
|
|
1374
|
+
`,fs=St.button`
|
|
1375
1375
|
${e=>F(e)} {
|
|
1376
1376
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1377
1377
|
color: #434343;
|
|
@@ -1388,7 +1388,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1388
1388
|
font-size: 14px;
|
|
1389
1389
|
|
|
1390
1390
|
padding: 8px 12px;
|
|
1391
|
-
`;import{AnimatePresence as
|
|
1391
|
+
`;import{AnimatePresence as Ss,motion as ys}from"framer-motion";import gs from"react";var hs=({style:e,className:t})=>gs.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},gs.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 xs from"react";var Cs=({style:e,className:t})=>xs.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"},xs.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 Yp=({flowId:e,style:t,onStepCompletion:o,visible:n=!0,type:r="inline",title:i="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:a,getStepStatus:u,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:b}=Y(),{primaryCTAClickSideEffects:w}=ie(),S=Vp(null),[g,P]=Kp(!1),{mergeAppearanceWithDefault:T}=Q();s=T(s),jp(()=>(document.addEventListener("click",A,!1),()=>{document.removeEventListener("click",A,!1)}),[]);let A=E=>{S.current&&!S.current.contains(E.target)&&P(!1)};if(f)return null;let k=p(e);if(!k||b(k))return null;let x=d(e);if(!x||!n)return null;function m(E,U){!E.completionCriteria&&(E.autoMarkCompleted||E.autoMarkCompleted===void 0)&&a(e,E.id),w(E),o&&o(E,U),P(!1)}function C(){return g&&ye.createElement(us,{className:l("floatingWidgetMenu",s),as:ys.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},x.map((E,U)=>ye.createElement(fs,{className:l("floatingWidgetMenuItem",s),key:U,onClick:()=>m(E,U)},E.title)))}return r=="inline"?ye.createElement("span",{ref:S},ye.createElement(as,{style:t,onClick:()=>{P(!g)},className:l("supportButton",s)},ye.createElement(ds,{className:l("supportIconContainer",s)},ye.createElement(Cs,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),ye.createElement(ps,{className:l("supportButtonTitle",s)},i)),ye.createElement(Ss,null,ye.createElement(C,null))):ye.createElement(qp,null,ye.createElement(cs,{style:t,ref:S},ye.createElement(Ss,null,ye.createElement(C,null)),ye.createElement(ms,{onClick:()=>{P(!g)},as:ys.button,whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},ye.createElement(hs,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import ze,{useEffect as Xp}from"react";import Bo from"styled-components";var bs=Bo.div`
|
|
1392
1392
|
${e=>F(e)} {
|
|
1393
1393
|
display: flex;
|
|
1394
1394
|
flex-direction: column;
|
|
@@ -1403,17 +1403,17 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1403
1403
|
border-radius: 12px;
|
|
1404
1404
|
position: relative;
|
|
1405
1405
|
}
|
|
1406
|
-
`,
|
|
1406
|
+
`,ws=Bo.div`
|
|
1407
1407
|
display: flex;
|
|
1408
1408
|
flex-direction: column;
|
|
1409
1409
|
flex: 1;
|
|
1410
|
-
`,
|
|
1410
|
+
`,Ts=Bo.div`
|
|
1411
1411
|
display: flex;
|
|
1412
1412
|
flex-direction: column;
|
|
1413
1413
|
justify-content: center;
|
|
1414
1414
|
align-items: flex-start;
|
|
1415
1415
|
margin-top: 16px;
|
|
1416
|
-
`,
|
|
1416
|
+
`,Fs=Bo.div`
|
|
1417
1417
|
${e=>F(e)} {
|
|
1418
1418
|
position: absolute;
|
|
1419
1419
|
top: 16px;
|
|
@@ -1424,7 +1424,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1424
1424
|
opacity: 0.8;
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
1427
|
-
`;var Jp=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:a,markStepCompleted:u,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:b,getFlowSteps:w,getFlowStatus:S,getCurrentStepIndex:g}=
|
|
1427
|
+
`;var Jp=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:a,markStepCompleted:u,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:b,getFlowSteps:w,getFlowStatus:S,getCurrentStepIndex:g}=Y(),{primaryCTAClickSideEffects:P}=ie(),{mergeAppearanceWithDefault:T}=Q();if(r=T(r),Xp(()=>{b(o)},[o,c]),c)return null;let A=d(e);if(!A||f(A)||S(e)===q)return null;let x=w(e)[g(e)];return ze.createElement(ze.Fragment,null,ze.createElement(oe,{appearance:r}),ze.createElement(bs,{appearance:r,className:xe(l("embeddedTipContainer",r),i),style:s},(p===!0||x.dismissible)&&ze.createElement(Fs,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",r)},ze.createElement(ve,null)),ze.createElement(ws,null,ze.createElement(Ce,{size:"small",appearance:r,title:x.title,subtitle:x.subtitle})),x.primaryButtonTitle&&ze.createElement(Ts,{className:l("embeddedTipCallToActionContainer",r)},ze.createElement(R,{classPrefix:"embeddedTip",title:x.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"inline",onClick:async()=>{x.handlePrimaryButtonClick(),P(x),!(n&&n(x,g(e),"primary")===!1)&&(await u(e,x.id),await a(e))}}))))};import ge,{useEffect as Qp}from"react";import Ut from"styled-components";var ks=Ut.div`
|
|
1428
1428
|
// use the :not annotation
|
|
1429
1429
|
${e=>F(e)} {
|
|
1430
1430
|
display: flex;
|
|
@@ -1438,24 +1438,24 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1438
1438
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1439
1439
|
border-radius: 12px;
|
|
1440
1440
|
}
|
|
1441
|
-
`,
|
|
1441
|
+
`,Ps=Ut.div`
|
|
1442
1442
|
${e=>F(e)} {
|
|
1443
1443
|
display: flex;
|
|
1444
1444
|
width: 36px;
|
|
1445
1445
|
height: 36px;
|
|
1446
1446
|
}
|
|
1447
|
-
`,
|
|
1447
|
+
`,vs=Ut.div`
|
|
1448
1448
|
display: flex;
|
|
1449
1449
|
flex-direction: column;
|
|
1450
1450
|
flex: 1;
|
|
1451
1451
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1452
1452
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1453
|
-
`,
|
|
1453
|
+
`,Es=Ut.div`
|
|
1454
1454
|
display: flex;
|
|
1455
1455
|
flex-direction: column;
|
|
1456
1456
|
justify-content: center;
|
|
1457
1457
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1458
|
-
`,
|
|
1458
|
+
`,tr=Ut.div`
|
|
1459
1459
|
display: flex;
|
|
1460
1460
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1461
1461
|
align-items: flex-end;
|
|
@@ -1464,12 +1464,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1464
1464
|
:hover {
|
|
1465
1465
|
opacity: 0.8;
|
|
1466
1466
|
}
|
|
1467
|
-
`,
|
|
1467
|
+
`,or=Ut.div`
|
|
1468
1468
|
display: flex;
|
|
1469
1469
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1470
1470
|
align-items: flex-end;
|
|
1471
1471
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1472
|
-
`;import
|
|
1472
|
+
`;import As from"react";var Is=({style:e,className:t})=>As.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"},As.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}));var Zp=({flowId:e,title:t,subtitle:o,onDismiss:n,customVariables:r,onButtonClick:i,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:a,markFlowCompleted:u,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:b,getFlowMetadata:w,getFlowStatus:S,getFlowSteps:g,getCurrentStepIndex:P}=Y(),{primaryCTAClickSideEffects:T}=ie(),{mergeAppearanceWithDefault:A}=Q();if(s=A(s),Qp(()=>{b(r)},[r,c]),c)return null;let k=a(e);if(!k||f(k)||S(e)===q)return null;let x=g(e),m=x.length>0?x[P(e)]:w(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),ge.createElement(ge.Fragment,null,ge.createElement(oe,{appearance:s}),ge.createElement(ks,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&ge.createElement(Ps,{className:l("bannerIconContainer",s)},d||ge.createElement(Is,null)),p==="square"&&m.dismissible&&ge.createElement(or,{type:p,className:l("bannerDismissButtonContainer",s)},ge.createElement(tr,{type:p,onClick:async()=>{await u(e),n&&n()},className:l("bannerDismissButton",s)},ge.createElement(ve,null))),ge.createElement(vs,{type:p},ge.createElement(Ce,{appearance:s,title:t,subtitle:o})),ge.createElement(Es,{type:p,className:l("bannerCallToActionContainer",s)},ge.createElement(R,{title:(m==null?void 0:m.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{T(m),i&&i(m,0,"primary")}})),p!=="square"&&m.dismissible&&ge.createElement(or,{type:p,className:l("bannerDismissButtonContainer",s)},ge.createElement(tr,{type:p,onClick:async()=>{await u(e),n&&n()},className:l("bannerDismissButton",s)},ge.createElement(ve,null)))))};import Z,{useEffect as Rp}from"react";import{Portal as ed}from"react-portal";import Je from"styled-components";var Bs=Je.div`
|
|
1473
1473
|
${e=>F(e)} {
|
|
1474
1474
|
display: flex;
|
|
1475
1475
|
flex-direction: column;
|
|
@@ -1490,7 +1490,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1490
1490
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1491
1491
|
min-width: 550px;
|
|
1492
1492
|
}
|
|
1493
|
-
`,
|
|
1493
|
+
`,Ns=Je.button`
|
|
1494
1494
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1495
1495
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1496
1496
|
// If selected make border color primary and text color color priamry
|
|
@@ -1511,30 +1511,30 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1511
1511
|
display: flex;
|
|
1512
1512
|
justify-content: center;
|
|
1513
1513
|
align-items: center;
|
|
1514
|
-
`,
|
|
1514
|
+
`,rr=Je.div`
|
|
1515
1515
|
display: flex;
|
|
1516
1516
|
justify-content: flex-end;
|
|
1517
1517
|
margin-top: 24px;
|
|
1518
1518
|
gap: 8px;
|
|
1519
|
-
`,
|
|
1519
|
+
`,Ls=Je.div`
|
|
1520
1520
|
display: flex;
|
|
1521
1521
|
justify-content: space-between;
|
|
1522
1522
|
margin-top: 24px;
|
|
1523
|
-
`,
|
|
1523
|
+
`,ir=Je.div`
|
|
1524
1524
|
font-size: 12px;
|
|
1525
1525
|
line-height: 16px;
|
|
1526
1526
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1527
|
-
`,
|
|
1527
|
+
`,nr=Je.div`
|
|
1528
1528
|
display: flex;
|
|
1529
1529
|
flex-direction: column;
|
|
1530
1530
|
flex: 1;
|
|
1531
|
-
`,Sy=
|
|
1531
|
+
`,Sy=Je.div`
|
|
1532
1532
|
display: flex;
|
|
1533
1533
|
flex-direction: column;
|
|
1534
1534
|
justify-content: center;
|
|
1535
1535
|
align-items: flex-start;
|
|
1536
1536
|
margin-top: 16px;
|
|
1537
|
-
`,
|
|
1537
|
+
`,Os=Je.textarea`
|
|
1538
1538
|
${e=>F(e)} {
|
|
1539
1539
|
margin-top: 16px;
|
|
1540
1540
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1545,7 +1545,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1545
1545
|
width: 100%;
|
|
1546
1546
|
height: 100px;
|
|
1547
1547
|
}
|
|
1548
|
-
`,
|
|
1548
|
+
`,Ds=Je.div`
|
|
1549
1549
|
${e=>F(e)} {
|
|
1550
1550
|
position: absolute;
|
|
1551
1551
|
top: 16px;
|
|
@@ -1556,5 +1556,5 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${zt}${r}.${zt}${r} { ${Object.entries(i).map
|
|
|
1556
1556
|
opacity: 0.8;
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
|
-
`;var td=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s})=>{let{getFlow:p,markFlowCompleted:d,markStepCompleted:a,getNumberOfStepsCompleted:u,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:b,getFlowSteps:w,getFlowStatus:S,getCurrentStepIndex:g}=
|
|
1559
|
+
`;var td=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s})=>{let{getFlow:p,markFlowCompleted:d,markStepCompleted:a,getNumberOfStepsCompleted:u,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:b,getFlowSteps:w,getFlowStatus:S,getCurrentStepIndex:g}=Y(),{primaryCTAClickSideEffects:P}=ie(),{mergeAppearanceWithDefault:T}=Q(),[A,k]=Z.useState(null),[x,m]=Z.useState(""),{hasOpenModals:C,setKeepCompletedFlowOpenDuringSession:E,shouldKeepCompletedFlowOpenDuringSession:U}=Pe();if(r=T(r),Rp(()=>{b(o)},[o,c]),c)return null;let $=p(e);if(!$||f($)||S(e)===q||u(e)===1&&!U(e)||C())return null;let I=w(e)[g(e)];function H(){return Z.createElement(Z.Fragment,null,Z.createElement(nr,null,Z.createElement(Ce,{size:"large",appearance:r,title:I.title,subtitle:I.subtitle})),Z.createElement(rr,{className:l("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(M=>Z.createElement(Ns,{className:l("npsNumberButton",r),selected:A===M+1,key:M,onClick:async()=>{E(e),k(M+1),await a(e,I.id,{score:M+1})},appearance:r},M+1))),Z.createElement(Ls,{appearance:r},Z.createElement(ir,{appearance:r},"Not likely at all"),Z.createElement(ir,{appearance:r},"Extremely likely")))}function B(){return Z.createElement(Z.Fragment,null,Z.createElement(nr,null,Z.createElement(Ce,{appearance:r,title:"Why did you choose this score?",size:"large"})),Z.createElement(Os,{appearance:r,value:x,onChange:M=>{m(M.target.value)},placeHolder:"Add your optional fedback here..."}),Z.createElement(rr,{appearance:r,className:l("npsNumberButtonContainer",r)},Z.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await d(e),n&&n(I,1,"primary")},appearance:r,title:I.secondaryButtonTitle||"Skip",secondary:!0}),Z.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await a(e,I.id,{feedbackText:x}),await d(e),n&&n(I,1,"primary")},appearance:r,title:I.primaryButtonTitle||"Submit"})))}return Z.createElement(ed,null,Z.createElement(oe,{appearance:r}),Z.createElement(Bs,{appearance:r,className:xe(l("npsSurveyContainer",r),i),style:s},Z.createElement(Ds,{onClick:async()=>{await d(e),t&&t()},className:l("npsSurveyDismissButton",r)},Z.createElement(ve,null)),u(e)==0&&H(),u(e)==1&&B()))};export{ct as CheckBox,Re as FormLabel,Zp as FrigadeBanner,Ro as FrigadeChecklist,Jp as FrigadeEmbeddedTip,ei as FrigadeForm,Ep as FrigadeGuide,Tp as FrigadeHeroChecklist,td as FrigadeNPSSurvey,Pp as FrigadeProgressBadge,ka as FrigadeProvider,Yp as FrigadeSupportWidget,Gp as FrigadeTour,Et as ProgressRing,Pe as useFlowOpens,Wt as useFlowResponses,Y as useFlows,Go as useOrganization,Lo as useUser};
|
|
1560
1560
|
//# sourceMappingURL=index.mjs.map
|