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