@frigade/react 1.38.12 → 1.38.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +425 -353
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +369 -353
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnPropertyDescriptors;var Wo=Object.getOwnPropertySymbols;var ci=Object.prototype.hasOwnProperty,mi=Object.prototype.propertyIsEnumerable;var di=(e,t,o)=>t in e?sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))ci.call(t,o)&&di(e,o,t[o]);if(Wo)for(var o of Wo(t))mi.call(t,o)&&di(e,o,t[o]);return e},V=(e,t)=>la(e,aa(t));var ui=e=>typeof e=="symbol"?e:e+"",$e=(e,t)=>{var o={};for(var i in e)ci.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Wo)for(var i of Wo(e))t.indexOf(i)<0&&mi.call(e,i)&&(o[i]=e[i]);return o};var L=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import Oo,{createContext as Td,useEffect as lr,useState as qe}from"react";import{ThemeProvider as Nn}from"styled-components";import _t,{useContext as Zp,useEffect as ro,useState as Eo}from"react";import{useCallback as Lt,useContext as ba,useEffect as wa}from"react";import Sr,{useMemo as gi}from"react";var fi="1.38.12";var st="NOT_STARTED_STEP",de="COMPLETED_FLOW",Nt="SKIPPED_FLOW",Ot="STARTED_FLOW",De="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",yo="STARTED_STEP";function Re(){let{publicApiKey:e,userId:t,apiUrl:o}=Sr.useContext(re);return{config:gi(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":fi,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:gi(()=>`${o}/v1/public/`,[o])}}var pa="frigade-last-call-at-",da="frigade-last-call-data-";function qt(){let{shouldGracefullyDegrade:e,readonly:t}=Sr.useContext(re);return(o,i)=>L(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Kt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Kt();let n=pa+o,r=da+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Kt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let l;try{l=yield fetch(o,i)}catch(p){return Kt(p)}return l?l.ok?l:Kt(l.statusText):Kt()})}function Kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Yt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Sr.useContext(re);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Ca,useState as hi}from"react";import{useContext as ma,useEffect as ua,useState as fa}from"react";import ga from"swr";import{useContext as ca}from"react";function Ie(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=ca(re);function r(c,g=!1){var S;return(S=e[c])!=null?S:g}function l(c,g){t(S=>V(w({},S),{[c]:g}))}function p(c){t(g=>{let h=g,{[c]:S}=h,F=$e(h,[ui(c)]);return w({},F)})}function d(c){n.includes(c)||i(g=>[...g,c])}function s(c){return n.includes(c)}function u(c){return Object.entries(e).some(([g,S])=>S&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:u,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import ha from"swr/immutable";import So from"core-js-pure/actual/structured-clone";function br(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ue(...e){let t=e.shift(),o=e.length===1?e[0]:ue(...e);if(!br(t)||!br(o))throw new Error("deepmerge can only merge Objects");let i=So(t);return Object.entries(o).forEach(([n,r])=>{br(r)?i[n]!==void 0?Object.assign(i,{[n]:ue(i[n],So(r))}):Object.assign(i,{[n]:So(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...So(r)]}):Object.assign(i,{[n]:So(r)}):Object.assign(i,{[n]:r})}),i}function Jt(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var xa="unknown";function _e(){let{config:e,apiUrl:t}=Re(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ma(re),{resetOpenFlowState:d}=Ie(),[s,u]=fa(!1),c={data:r.map(T=>({flowId:T.id,flowState:de,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=T=>fetch(T,e).then(I=>{if(I.ok)return I.json();throw new Error("Failed to fetch user flow states")}).catch(I=>(console.log(`Error fetching ${T}: ${I}. Will gracefully degrade and hide Frigade`),l(!0),c)),S=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:F,isLoading:h,mutate:x,error:k}=p?ha(S,g):ga(S,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),b=F==null?void 0:F.data;ua(()=>{!s&&!h&&b&&u(!0)},[b,s,h]);function v(T){return L(this,null,function*(){if(b&&!p){let I=b.find(N=>N.flowId===T);I&&I.flowState!==de&&(I.flowState=de),yield x(Promise.resolve(ue(F,{data:b})),{optimisticData:ue(F,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function $(T){return L(this,null,function*(){if(b&&!p){let I=b.find(N=>N.flowId===T);I&&I.flowState!==Nt&&(I.flowState=Nt),yield x(Promise.resolve(ue(F,{data:b})),{optimisticData:ue(F,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function E(T,I,N){return L(this,null,function*(){var D,z;if(b){let j=b.find(_=>_.flowId===T);if(j){let _=r.find(q=>q.slug===T),G=Jt(_==null?void 0:_.data),K=(z=(D=G==null?void 0:G.steps)!=null?D:G==null?void 0:G.data)!=null?z:[],O=K.findIndex(q=>q.id===I),ee=K&&K.length>O+1?K[O+1]:null;ee&&(j.lastStepId=ee.id),j.stepStates[I]=N,j.flowState=Ot}p||(yield x(Promise.resolve(ue(F,{data:b})),{optimisticData:ue(F,{data:b}),revalidate:!1,rollbackOnError:!1}))}})}function f(T,I,N){return L(this,null,function*(){if(b){let D=b.find(z=>z.flowId===T);D&&(D.lastStepId=I,D.stepStates[I]=N,D.flowState=Ot),p||(yield x(ue(F,{data:b}),{optimisticData:ue(F,{data:b}),revalidate:!1,rollbackOnError:!1}))}})}function A(T){return L(this,null,function*(){if(b){let I=b.find(N=>N.flowId===T);I&&I.flowState!==De&&(I.flowState=De,I.lastStepId=xa,Object.keys(I.stepStates).forEach(N=>{I.stepStates[N].actionType=st,I.stepStates[N].createdAt=new Date().toISOString()}),yield x(ue(F,{data:b}),{optimisticData:ue(F,{data:b}),revalidate:!1,rollbackOnError:!1}),d(T))}})}function y(T,I,N){return L(this,null,function*(){if(b){let D=b.find(z=>z.flowId===T);D&&(D.stepStates[I]=N),yield x(Promise.resolve(ue(F,{data:b})),{optimisticData:ue(F,{data:b}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:b,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:v,optimisticallyMarkFlowSkipped:$,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:y,optimisticallyMarkStepStarted:f,error:k}}function bo(){let{config:e,apiUrl:t}=Re(),{userFlowStatesData:o,mutateUserFlowState:i}=_e(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=Ca(re),[d,s]=hi(new Set),[u,c]=hi(new Set),g=qt();function S(x){let k=JSON.stringify(x);if(d.has(k))return null;d.add(k),s(d),u.add(x),c(u);let b=l==null?void 0:l.find(v=>v.flowSlug===x.flowSlug&&v.stepId===x.stepId&&v.actionType===x.actionType&&v.createdAt===x.createdAt);return g(`${t}flowResponses`,V(w({},e),{method:"POST",body:k})).then(v=>{v.status!==200&&v.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):b||p($=>[...$!=null?$:[],x])})}function F(x){return L(this,null,function*(){x.foreignUserId&&(x.actionType===Ot||x.actionType===De?yield S(x):x.actionType===de?yield S(x):x.actionType===yo?yield S(x):x.actionType===Ue?yield S(x):x.actionType===Nt?yield S(x):x.actionType===st&&(yield S(x)))})}function h(){let x=[];return o==null||o.forEach(k=>{if(k&&k.stepStates&&Object.keys(k.stepStates).length!==0)for(let b in k.stepStates){let v=k.stepStates[b];x.push({foreignUserId:k.foreignUserId,flowSlug:k.flowId,stepId:v.stepId,actionType:v.actionType,data:{},createdAt:new Date(v.createdAt),blocked:v.blocked,hidden:v.hidden})}}),[...x,...l]}return{addResponse:F,setFlowResponses:p,getFlowResponses:h}}import Ta from"swr";var ya=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,xi=e=>{let t=ya.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Sa(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Sa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};var wr=(s=>(s.CHECKLIST="CHECKLIST",s.FORM="FORM",s.TOUR="TOUR",s.SUPPORT="SUPPORT",s.CUSTOM="CUSTOM",s.BANNER="BANNER",s.EMBEDDED_TIP="EMBEDDED_TIP",s.NPS_SURVEY="NPS_SURVEY",s.ANNOUNCEMENT="ANNOUNCEMENT",s))(wr||{});function ne(){let{config:e,apiUrl:t}=Re(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:u,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:S,readonly:F,flowDataOverrides:h}=ba(re),x={data:[]},{verifySDKInitiated:k}=Yt(),{addResponse:b,getFlowResponses:v}=bo(),$=m=>fetch(m,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${m} (${C.status}): ${C.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(C=>(console.log(`Error fetching ${m}: ${C}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:E,userFlowStatesData:f,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowSkipped:T,optimisticallyMarkFlowNotStarted:I,optimisticallyMarkStepCompleted:N,optimisticallyMarkStepNotStarted:D,optimisticallyMarkStepStarted:z}=_e(),{data:j,error:_,isLoading:G}=Ta(l?`${t}flows${F?"?readonly=true":""}`:null,$,{keepPreviousData:!0});wa(()=>{if(_){console.error(_);return}j&&j.data&&i(j.data)},[j,_]);function K(m){if(G)return null;let C=o.find(P=>P.slug===m);return!C&&o.length>0&&!A&&!G?(console.log(`Flow with id ${m} not found`),null):(C&&h&&h[m]&&(C.data=h[m]),(C==null?void 0:C.active)===!1&&!F?null:C)}function O(m){var W,Be,Et,At,It;if(!K(m))return[];let C=(W=K(m))==null?void 0:W.data;return C?(C=ee(C),((It=(At=(Be=Jt(C))==null?void 0:Be.data)!=null?At:(Et=Jt(C))==null?void 0:Et.steps)!=null?It:[]).map(ge=>{let xo=Ge(ge);return V(w({handleSecondaryButtonClick:()=>{ge.skippable===!0&&U(m,ge.id,{skipped:!0})}},ge),{complete:H(m,ge.id)===Ue||xo>=1,started:H(m,ge.id)===yo||H(m,ge.id)===Ue,currentlyActive:f==null?void 0:f.some(Co=>Co.flowId==m&&Co.lastStepId===ge.id),blocked:J(m,ge.id),hidden:te(m,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&U(m,ge.id)},progress:xo})}).filter(ge=>ge.hidden!==!0)):[]}function ee(m){return m.replaceAll(/\${(.*?)}/g,(C,P)=>p[P]===void 0?"":String(p[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 q(m){var P;if(!K(m))return[];let C=K(m).data;return C?(C=ee(C),(P=JSON.parse(C))!=null?P:{}):[]}function se(m,C){d(P=>V(w({},P),{[m]:C}))}function Se(m){!A&&!G&&m&&JSON.stringify(p)!=JSON.stringify(w(w({},p),m))&&Object.keys(m).forEach(C=>{se(C,m[C])})}let ke=Lt((m,C,P)=>L(this,null,function*(){if(!k())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:C,actionType:yo,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};pe(W)&&(yield z(m,C,W),b(W))}),[n,r,f]),R=Lt((m,C,P)=>L(this,null,function*(){if(!k())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:C,actionType:st,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};pe(W)&&(yield D(m,C,W),b(W))}),[n,r,f]),U=Lt((m,C,P)=>L(this,null,function*(){if(!k())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:C,actionType:Ue,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};pe(W)&&(yield N(m,C,W),b(W))}),[n,r,f]),ie=Lt((m,C)=>L(this,null,function*(){if(!k()||xt(m)===De)return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:De,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};yield I(m),pe(P)&&b(P)}),[n,r,f]),Pe=Lt((m,C)=>L(this,null,function*(){if(!k())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:Ot,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};pe(P)&&b(P)}),[n,r,f]),je=Lt((m,C)=>L(this,null,function*(){if(!k())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:de,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};pe(P)&&(yield y(m),b(P))}),[n,r,f]),ve=Lt((m,C)=>L(this,null,function*(){if(!k())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:Nt,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};pe(P)&&(yield T(m),b(P))}),[n,r,f]);function pe(m){var C;if(f===void 0)return!1;if(f){let P=f.find(W=>W.flowId===m.flowSlug);if(m.actionType===st&&(!(P!=null&&P.stepStates[m.stepId])||P.stepStates[m.stepId].actionType===st))return!1;if(P&&((C=P.stepStates[m.stepId])==null?void 0:C.actionType)===m.actionType){if(m.actionType===Ue&&(!m.data||JSON.stringify(m.data)===JSON.stringify({})))return!1;let W=Object.keys(P.stepStates).sort((Be,Et)=>{let At=new Date(P.stepStates[Be].createdAt),It=new Date(P.stepStates[Et].createdAt);return At.getTime()-It.getTime()});if(P.stepStates[W[W.length-1]].actionType===m.actionType&&m.stepId===W[W.length-1])return!1}if(P&&P.flowState===de&&m.actionType===de)return!1}return!0}function H(m,C){let P=M(m,C);return A?null:P?P.actionType:st}function J(m,C){let P=M(m,C);return P?P.blocked:!1}function te(m,C){let P=M(m,C);return P?P.hidden:!1}function M(m,C){var W;if(A)return null;let P=f==null?void 0:f.find(Be=>Be.flowId===m);return!P||!P.stepStates[C]?null:(W=P.stepStates[C])!=null?W:null}function Z(m){var P,W;if(A||!f)return null;if(xt(m)===De)return(P=O(m)[0])!=null?P:null;let C=(W=f.find(Be=>Be.flowId===m))==null?void 0:W.lastStepId;return C?O(m).find(Be=>Be.id===C):null}function we(m){var W;let C=Z(m);if(!C)return 0;let P=(W=O(m).findIndex(Be=>Be.id===C.id))!=null?W:0;return H(m,C.id)===Ue&&P<O(m).length-1?P+1:P}function Ge(m){if(!m.completionCriteria)return;let C=xi(m.completionCriteria);if(C===null)return;let P=Ye(C),W=nt(C);return W===0?void 0:P/W}function xt(m){let C=f==null?void 0:f.find(P=>P.flowId===m);return C?C.flowState:null}function Ye(m){let C=O(m);return C.length===0?0:C.filter(W=>H(m,W.id)===Ue).length}function nt(m){return O(m).length}function Qe(m){let C=o.find(P=>P.slug===m);return C?(h&&h[m]&&(C.data=h[m]),Jt(C.data)):null}function vt(m){if(F)return!1;if(A||S)return!0;if(m!=null&&m.targetingLogic&&f){let C=f.find(P=>P.flowId===m.slug);if(C)return C.shouldTrigger===!1}return!!(m!=null&&m.targetingLogic&&n&&n.startsWith("guest_"))}function jt(m){let C=K(m);return(C==null?void 0:C.active)===!1?!1:!vt(K(m))}function Gt(){n&&E()}function Bt(){return o}return{getAllFlows:Bt,getFlow:K,getFlowData:Qe,isLoading:A||G,getStepStatus:H,getFlowSteps:O,getCurrentStepIndex:we,markStepStarted:ke,markStepCompleted:U,markFlowNotStarted:ie,markFlowStarted:Pe,markFlowCompleted:je,markFlowSkipped:ve,markStepNotStarted:R,getFlowStatus:xt,getNumberOfStepsCompleted:Ye,getNumberOfSteps:nt,targetingLogicShouldHideFlow:vt,setCustomVariable:se,updateCustomVariables:Se,customVariables:p,getStepOptionalProgress:Ge,getFlowMetadata:q,isStepBlocked:J,isStepHidden:te,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:u,isFlowAvailableToUser:jt,refresh:Gt}}import{useCallback as zo,useContext as Fa,useEffect as ka}from"react";var Xt="guest_";function wo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Fa(re),{config:r,apiUrl:l}=Re(),{mutateUserFlowState:p}=_e(),d=qt(),{verifySDKInitiated:s}=Yt();function u(h){return`frigade-user-registered-${h}`}ka(()=>{if(e&&!t){if(e.startsWith(Xt))return;let h=u(e);localStorage.getItem(h)||(d(`${l}users`,V(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(h,"true"))}},[e,n,t]);let c=zo(h=>L(this,null,function*(){if(!s())return;let x={foreignId:e,properties:h};yield d(`${l}users`,V(w({},r),{method:"POST",body:JSON.stringify(x)})),i(k=>w(w({},k),h)),p()}),[e,r,n,p]),g=zo((h,x)=>L(this,null,function*(){if(!s())return;let b={foreignId:e,events:[{event:h,properties:x}]};yield d(`${l}users`,V(w({},r),{method:"POST",body:JSON.stringify(b)})),p()}),[e,r,p]),S=zo((h,x)=>L(this,null,function*(){if(s())if(x&&Object.keys(x).length>0){let k=u(h);localStorage.setItem(k,"true"),o(h);let b={foreignId:h,properties:x};yield d(`${l}users`,V(w({},r),{method:"POST",body:JSON.stringify(b)})),i(v=>w(w({},v),x)),p()}else o(h)}),[r,n,p]),F=zo(h=>L(this,null,function*(){if(!s())return;let x=typeof window!="undefined"?localStorage.getItem($t):null;if(console.log("id",localStorage.getItem($t)),!x)return;let k={foreignId:h,linkGuestId:x};yield d(`${l}users`,V(w({},r),{method:"POST",body:JSON.stringify(k)})),p()}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:g,linkExistingGuestSessionToUser:F}}import{v4 as Rp}from"uuid";import rt,{useEffect as Sn,useState as Jp}from"react";import Je,{useEffect as Pr,useState as La}from"react";import Go from"styled-components";import Pa from"react";import va from"styled-components";var Ci="fr-",To="cfr-";function a(e,t){let o=`${Ci}${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+" "+To+e}return o}function B(e){if(!e.className||e.className.indexOf(To)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Ci)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Ho(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ee(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Ho(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function Fo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ba=va.div`
|
|
1
|
+
'use client';
|
|
2
|
+
import * as V from 'react';
|
|
3
|
+
import V__default, { createContext, useContext, useState, useEffect, useCallback, useRef, useMemo, useLayoutEffect } from 'react';
|
|
4
|
+
import me, { createGlobalStyle, css, keyframes, useTheme, ThemeProvider } from 'styled-components';
|
|
5
|
+
import Xa from 'swr';
|
|
6
|
+
import Qa from 'swr/immutable';
|
|
7
|
+
import oo from 'core-js-pure/actual/structured-clone';
|
|
8
|
+
import { v4 } from 'uuid';
|
|
9
|
+
import { Portal } from 'react-portal';
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import ql from 'dompurify';
|
|
12
|
+
import { compose, border, color, shadow, space, typography, system, variant, get } from 'styled-system';
|
|
13
|
+
|
|
14
|
+
var Zr="1.38.14";var Ze="NOT_STARTED_STEP",re="COMPLETED_FLOW",Ct="SKIPPED_FLOW",yt="STARTED_FLOW",Ae="NOT_STARTED_FLOW",Ne="COMPLETED_STEP",to="STARTED_STEP";function Ke(){let{publicApiKey:e,userId:t,apiUrl:o}=V__default.useContext(Z);return {config:useMemo(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Zr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:useMemo(()=>`${o}/v1/public/`,[o])}}var ja="frigade-last-call-at-",Ga="frigade-last-call-data-";function At(){let{shouldGracefullyDegrade:e,readonly:t}=V__default.useContext(Z);return async(o,r)=>{if(t&&(r.method==="POST"||r.method==="PUT"||r.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let i=ja+o,n=Ga+o;if(typeof window<"u"&&window.localStorage&&r&&r.body&&r.method==="POST"){let p=window.localStorage.getItem(i),d=window.localStorage.getItem(n);if(p&&d&&d==r.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return It()}typeof window<"u"&&(window.localStorage.setItem(i,new Date().toISOString()),window.localStorage.setItem(n,r.body));}let s;try{s=await fetch(o,r);}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 Nt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=V__default.useContext(Z);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return {verifySDKInitiated:o}}function Pe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:r,completedFlowsToKeepOpenDuringSession:i}=useContext(Z);function n(c,g=!1){return e[c]??g}function s(c,g){t(b=>({...b,[c]:g}));}function p(c){t(g=>{let{[c]:b,...T}=g;return {...T}});}function d(c){i.includes(c)||r(g=>[...g,c]);}function a(c){return i.includes(c)}function m(c){return Object.entries(e).some(([g,b])=>b&&g!=c)||o}return {getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}function pr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function le(...e){let t=e.shift(),o=e.length===1?e[0]:le(...e);if(!pr(t)||!pr(o))throw new Error("deepmerge can only merge Objects");let r=oo(t);return Object.entries(o).forEach(([i,n])=>{pr(n)?r[i]!==void 0?Object.assign(r,{[i]:le(r[i],oo(n))}):Object.assign(r,{[i]:oo(n)}):Array.isArray(n)?r[i]!==void 0?Object.assign(r,{[i]:[...r[i],...oo(n)]}):Object.assign(r,{[i]:oo(n)}):Object.assign(r,{[i]:n});}),r}function Ot(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Za="unknown";function Oe(){let{config:e,apiUrl:t}=Ke(),{publicApiKey:o,userId:r,organizationId:i,flows:n,setShouldGracefullyDegrade:s,readonly:p}=useContext(Z),{resetOpenFlowState:d}=Pe(),[a,m]=useState(!1),c={data:n.map(P=>({flowId:P.id,flowState:re,lastStepId:null,userId:r,foreignUserId:r,stepStates:{},shouldTrigger:!1}))},g=P=>fetch(P,e).then(E=>{if(E.ok)return E.json();throw new Error("Failed to fetch user flow states")}).catch(E=>(console.log(`Error fetching ${P}: ${E}. Will gracefully degrade and hide Frigade`),s(!0),c)),b=o&&n&&r?`${t}userFlowStates?foreignUserId=${encodeURIComponent(r)}${i?`&foreignUserGroupId=${encodeURIComponent(i)}`:""}`:null,{data:T,isLoading:x,mutate:u,error:F}=p?Qa(b,g):Xa(b,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),C=T?.data;useEffect(()=>{!a&&!x&&C&&m(!0);},[C,a,x]);async function N(P){if(C&&!p){let E=C.find(I=>I.flowId===P);E&&E.flowState!==re&&(E.flowState=re),await u(Promise.resolve(le(T,{data:C})),{optimisticData:le(T,{data:C}),revalidate:!1,rollbackOnError:!1});}}async function D(P){if(C&&!p){let E=C.find(I=>I.flowId===P);E&&E.flowState!==Ct&&(E.flowState=Ct),await u(Promise.resolve(le(T,{data:C})),{optimisticData:le(T,{data:C}),revalidate:!1,rollbackOnError:!1});}}async function w(P,E,I){if(C){let L=C.find($=>$.flowId===P);if(L){let $=n.find(B=>B.slug===P),G=Ot($?.data),M=G?.steps??G?.data??[],q=M.findIndex(B=>B.id===E),Y=M&&M.length>q+1?M[q+1]:null;Y&&(L.lastStepId=Y.id),L.stepStates[E]=I,L.flowState=yt;}p||await u(Promise.resolve(le(T,{data:C})),{optimisticData:le(T,{data:C}),revalidate:!1,rollbackOnError:!1});}}async function h(P,E,I){if(C){let L=C.find($=>$.flowId===P);L&&(L.lastStepId=E,L.stepStates[E]=I,L.flowState=yt),p||await u(le(T,{data:C}),{optimisticData:le(T,{data:C}),revalidate:!1,rollbackOnError:!1});}}async function v(P){if(C){let E=C.find(I=>I.flowId===P);E&&E.flowState!==Ae&&(E.flowState=Ae,E.lastStepId=Za,Object.keys(E.stepStates).forEach(I=>{E.stepStates[I].actionType=Ze,E.stepStates[I].createdAt=new Date().toISOString();}),await u(le(T,{data:C}),{optimisticData:le(T,{data:C}),revalidate:!1,rollbackOnError:!1}),d(P));}}async function S(P,E,I){if(C){let L=C.find($=>$.flowId===P);L&&(L.stepStates[E]=I),await u(Promise.resolve(le(T,{data:C})),{optimisticData:le(T,{data:C}),revalidate:!1,rollbackOnError:!1});}}return {userFlowStatesData:C,isLoadingUserFlowStateData:!a,mutateUserFlowState:u,optimisticallyMarkFlowCompleted:N,optimisticallyMarkFlowSkipped:D,optimisticallyMarkFlowNotStarted:v,optimisticallyMarkStepCompleted:w,optimisticallyMarkStepNotStarted:S,optimisticallyMarkStepStarted:h,error:F}}function ro(){let{config:e,apiUrl:t}=Ke(),{userFlowStatesData:o,mutateUserFlowState:r}=Oe(),{failedFlowResponses:i,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=useContext(Z),[d,a]=useState(new Set),[m,c]=useState(new Set),g=At();function b(u){let F=JSON.stringify(u);if(d.has(F))return null;d.add(F),a(d),m.add(u),c(m);let C=s?.find(N=>N.flowSlug===u.flowSlug&&N.stepId===u.stepId&&N.actionType===u.actionType&&N.createdAt===u.createdAt);return g(`${t}flowResponses`,{...e,method:"POST",body:F}).then(N=>{N.status!==200&&N.status!==201?(console.log("Failed to send flow response for step "+u.stepId+". Will retry again later."),n([...i,u])):C||p(D=>[...D??[],u]);})}async function T(u){u.foreignUserId&&(u.actionType===yt||u.actionType===Ae?await b(u):u.actionType===re?await b(u):u.actionType===to?await b(u):u.actionType===Ne?await b(u):u.actionType===Ct?await b(u):u.actionType===Ze&&await b(u));}function x(){let u=[];return o?.forEach(F=>{if(F&&F.stepStates&&Object.keys(F.stepStates).length!==0)for(let C in F.stepStates){let N=F.stepStates[C];u.push({foreignUserId:F.foreignUserId,flowSlug:F.flowId,stepId:N.stepId,actionType:N.actionType,data:{},createdAt:new Date(N.createdAt),blocked:N.blocked,hidden:N.hidden});}}),[...u,...s]}return {addResponse:T,setFlowResponses:p,getFlowResponses:x}}var el=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ti=e=>{let t=el.exec(e);if(t===null)return null;let o=null;return t.forEach((r,i)=>{let n=tl(r,"'","");n.startsWith("flow_")&&(o=n);}),o},tl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};var dr=(a=>(a.CHECKLIST="CHECKLIST",a.FORM="FORM",a.TOUR="TOUR",a.SUPPORT="SUPPORT",a.CUSTOM="CUSTOM",a.BANNER="BANNER",a.EMBEDDED_TIP="EMBEDDED_TIP",a.NPS_SURVEY="NPS_SURVEY",a.ANNOUNCEMENT="ANNOUNCEMENT",a))(dr||{});function R(){let{config:e,apiUrl:t}=Ke(),{flows:o,setFlows:r,userId:i,organizationId:n,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:a,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:b,readonly:T,flowDataOverrides:x}=useContext(Z),u={data:[]},{verifySDKInitiated:F}=Nt(),{addResponse:C,getFlowResponses:N}=ro(),D=f=>fetch(f,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${f} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),g(!0),u)).catch(y=>(console.log(`Error fetching ${f}: ${y}. Will gracefully degrade and hide Frigade`),g(!0),u)),{mutateUserFlowState:w,userFlowStatesData:h,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowSkipped:P,optimisticallyMarkFlowNotStarted:E,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:L,optimisticallyMarkStepStarted:$}=Oe(),{data:G,error:M,isLoading:q}=Xa(s?`${t}flows${T?"?readonly=true":""}`:null,D,{keepPreviousData:!0});useEffect(()=>{if(M){console.error(M);return}G&&G.data&&r(G.data);},[G,M]);function Y(f){if(q)return null;let y=o.find(A=>A.slug===f);return !y&&o.length>0&&!v&&!q?(console.log(`Flow with id ${f} not found`),null):(y&&x&&x[f]&&(y.data=x[f]),y?.active===!1&&!T?null:y)}function B(f){if(!Y(f))return [];let y=Y(f)?.data;return y?(y=H(y),(Ot(y)?.data??Ot(y)?.steps??[]).map(U=>{let Po=We(U);return {handleSecondaryButtonClick:()=>{U.skippable===!0&&j(f,U.id,{skipped:!0});},...U,complete:_(f,U.id)===Ne||Po>=1,started:_(f,U.id)===to||_(f,U.id)===Ne,currentlyActive:h?.some(vo=>vo.flowId==f&&vo.lastStepId===U.id),blocked:O(f,U.id),hidden:W(f,U.id),handlePrimaryButtonClick:()=>{(!U.completionCriteria&&(U.autoMarkCompleted||U.autoMarkCompleted===void 0)||U.completionCriteria&&U.autoMarkCompleted===!0)&&j(f,U.id);},progress:Po}}).filter(U=>U.hidden!==!0)):[]}function H(f){return f.replaceAll(/\${(.*?)}/g,(y,A)=>p[A]===void 0?"":String(p[A]).replace(/[\u00A0-\u9999<>\&]/g,function(U){return "&#"+U.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 he(f){if(!Y(f))return [];let y=Y(f).data;return y?(y=H(y),JSON.parse(y)??{}):[]}function xe(f,y){d(A=>({...A,[f]:y}));}function ae(f){!v&&!q&&f&&JSON.stringify(p)!=JSON.stringify({...p,...f})&&Object.keys(f).forEach(y=>{xe(y,f[y]);});}let ce=useCallback(async(f,y,A)=>{if(!F())return;let U={foreignUserId:i,foreignUserGroupId:n??null,flowSlug:f,stepId:y,actionType:to,data:A??{},createdAt:new Date,blocked:!1,hidden:!1};z(U)&&(await $(f,y,U),C(U));},[i,n,h]),se=useCallback(async(f,y,A)=>{if(!F())return;let U={foreignUserId:i,foreignUserGroupId:n??null,flowSlug:f,stepId:y,actionType:Ze,data:A??{},createdAt:new Date,blocked:!1,hidden:!1};z(U)&&(await L(f,y,U),C(U));},[i,n,h]),j=useCallback(async(f,y,A)=>{if(!F())return;let U={foreignUserId:i,foreignUserGroupId:n??null,flowSlug:f,stepId:y,actionType:Ne,data:A??{},createdAt:new Date,blocked:!1,hidden:!1};z(U)&&(await I(f,y,U),C(U));},[i,n,h]),ue=useCallback(async(f,y)=>{if(!F()||Q(f)===Ae)return;let A={foreignUserId:i,foreignUserGroupId:n??null,flowSlug:f,stepId:"unknown",actionType:Ae,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await E(f),z(A)&&C(A);},[i,n,h]),Ce=useCallback(async(f,y)=>{if(!F())return;let A={foreignUserId:i,foreignUserGroupId:n??null,flowSlug:f,stepId:"unknown",actionType:yt,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};z(A)&&C(A);},[i,n,h]),be=useCallback(async(f,y)=>{if(!F())return;let A={foreignUserId:i,foreignUserGroupId:n??null,flowSlug:f,stepId:"unknown",actionType:re,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};z(A)&&(await S(f),C(A));},[i,n,h]),Ue=useCallback(async(f,y)=>{if(!F())return;let A={foreignUserId:i,foreignUserGroupId:n??null,flowSlug:f,stepId:"unknown",actionType:Ct,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};z(A)&&(await P(f),C(A));},[i,n,h]);function z(f){if(h===void 0)return !1;if(h){let y=h.find(A=>A.flowId===f.flowSlug);if(f.actionType===Ze&&(!y?.stepStates[f.stepId]||y.stepStates[f.stepId].actionType===Ze))return !1;if(y&&y.stepStates[f.stepId]?.actionType===f.actionType){if(f.actionType===Ne&&(!f.data||JSON.stringify(f.data)===JSON.stringify({})))return !1;let A=Object.keys(y.stepStates).sort((U,Po)=>{let vo=new Date(y.stepStates[U].createdAt),Va=new Date(y.stepStates[Po].createdAt);return vo.getTime()-Va.getTime()});if(y.stepStates[A[A.length-1]].actionType===f.actionType&&f.stepId===A[A.length-1])return !1}if(y&&y.flowState===re&&f.actionType===re)return !1}return !0}function _(f,y){let A=oe(f,y);return v?null:A?A.actionType:Ze}function O(f,y){let A=oe(f,y);return A?A.blocked:!1}function W(f,y){let A=oe(f,y);return A?A.hidden:!1}function oe(f,y){if(v)return null;let A=h?.find(U=>U.flowId===f);return !A||!A.stepStates[y]?null:A.stepStates[y]??null}function Ge(f){if(v||!h)return null;if(Q(f)===Ae)return B(f)[0]??null;let y=h.find(A=>A.flowId===f)?.lastStepId;return y?B(f).find(A=>A.id===y):null}function eo(f){let y=Ge(f);if(!y)return 0;let A=B(f).findIndex(U=>U.id===y.id)??0;return _(f,y.id)===Ne&&A<B(f).length-1?A+1:A}function We(f){if(!f.completionCriteria)return;let y=ti(f.completionCriteria);if(y===null)return;let A=ye(y),U=To(y);return U===0?void 0:A/U}function Q(f){let y=h?.find(A=>A.flowId===f);return y?y.flowState:null}function ye(f){let y=B(f);return y.length===0?0:y.filter(U=>_(f,U.id)===Ne).length}function To(f){return B(f).length}function ar(f){let y=o.find(A=>A.slug===f);return y?(x&&x[f]&&(y.data=x[f]),Ot(y.data)):null}function Fo(f){if(T)return !1;if(v||b)return !0;if(f?.targetingLogic&&h){let y=h.find(A=>A.flowId===f.slug);if(y)return y.shouldTrigger===!1}return !!(f?.targetingLogic&&i&&i.startsWith("guest_"))}function ko(f){return Y(f)?.active===!1?!1:!Fo(Y(f))}function X(){i&&w();}function He(){return o}return {getAllFlows:He,getFlow:Y,getFlowData:ar,isLoading:v||q,getStepStatus:_,getFlowSteps:B,getCurrentStepIndex:eo,markStepStarted:ce,markStepCompleted:j,markFlowNotStarted:ue,markFlowStarted:Ce,markFlowCompleted:be,markFlowSkipped:Ue,markStepNotStarted:se,getFlowStatus:Q,getNumberOfStepsCompleted:ye,getNumberOfSteps:To,targetingLogicShouldHideFlow:Fo,setCustomVariable:xe,updateCustomVariables:ae,customVariables:p,getStepOptionalProgress:We,getFlowMetadata:he,isStepBlocked:O,isStepHidden:W,hasActiveFullPageFlow:a,setHasActiveFullPageFlow:m,isFlowAvailableToUser:ko,refresh:X}}var Lt="guest_";function io(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:r,shouldGracefullyDegrade:i}=useContext(Z),{config:n,apiUrl:s}=Ke(),{mutateUserFlowState:p}=Oe(),d=At(),{verifySDKInitiated:a}=Nt();function m(x){return `frigade-user-registered-${x}`}useEffect(()=>{if(e&&!t){if(e.startsWith(Lt))return;let x=m(e);localStorage.getItem(x)||(d(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(x,"true"));}},[e,i,t]);let c=useCallback(async x=>{if(!a())return;let u={foreignId:e,properties:x};await d(`${s}users`,{...n,method:"POST",body:JSON.stringify(u)}),r(F=>({...F,...x})),p();},[e,n,i,p]),g=useCallback(async(x,u)=>{if(!a())return;let C={foreignId:e,events:[{event:x,properties:u}]};await d(`${s}users`,{...n,method:"POST",body:JSON.stringify(C)}),p();},[e,n,p]),b=useCallback(async(x,u)=>{if(a())if(u&&Object.keys(u).length>0){let F=m(x);localStorage.setItem(F,"true"),o(x);let C={foreignId:x,properties:u};await d(`${s}users`,{...n,method:"POST",body:JSON.stringify(C)}),r(N=>({...N,...u})),p();}else o(x);},[n,i,p]),T=useCallback(async x=>{if(!a())return;let u=typeof window<"u"?localStorage.getItem(bt):null;if(console.log("id",localStorage.getItem(bt)),!u)return;let F={foreignId:x,linkGuestId:u};await d(`${s}users`,{...n,method:"POST",body:JSON.stringify(F)}),p();},[n,i,p]);return {userId:e,setUserId:o,setUserIdWithProperties:b,addPropertiesToUser:c,trackEventForUser:g,linkExistingGuestSessionToUser:T}}var oi="fr-",no="cfr-";function l(e,t){let o=`${oi}${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+" "+no+e}return o}function k(e){if(!e.className||e.className.indexOf(no)!==-1)return "";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(oi)?"":`:not(${o.map(r=>`.${r}`).join(", ")})`}function Eo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Fe(e){return e?.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Eo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function we(...e){return e.filter(Boolean).join(" ")}function so(e){return e.charAt(0).toUpperCase()+e.slice(1)}var pl=me.div`
|
|
3
15
|
display: flex;
|
|
4
16
|
justify-content: center;
|
|
5
17
|
position: fixed;
|
|
@@ -7,7 +19,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
7
19
|
left: 0;
|
|
8
20
|
bottom: 0;
|
|
9
21
|
right: 0;
|
|
10
|
-
${e=>
|
|
22
|
+
${e=>k(e)} {
|
|
11
23
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
24
|
z-index: 1400;
|
|
13
25
|
}
|
|
@@ -23,12 +35,12 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
23
35
|
opacity: 1;
|
|
24
36
|
}
|
|
25
37
|
}
|
|
26
|
-
`,
|
|
38
|
+
`,ri=({onClose:e,appearance:t})=>V__default.createElement(pl,{className:l("modalBackground",t),onClick:()=>e()});var cl=me.div`
|
|
27
39
|
:hover {
|
|
28
40
|
opacity: 0.8;
|
|
29
41
|
}
|
|
30
|
-
`,
|
|
31
|
-
${e=>
|
|
42
|
+
`,ve=()=>V__default.createElement(cl,null,V__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},V__default.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));function ml({style:e,className:t}){return V__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},V__default.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"}),V__default.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 ii=ml;var Io=me.div`
|
|
43
|
+
${e=>k(e)} {
|
|
32
44
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
45
|
}
|
|
34
46
|
|
|
@@ -38,7 +50,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
38
50
|
min-width: 300px;
|
|
39
51
|
z-index: ${e=>e.zIndex};
|
|
40
52
|
overflow: hidden;
|
|
41
|
-
`,
|
|
53
|
+
`,ul=`
|
|
42
54
|
display: block;
|
|
43
55
|
cursor: pointer;
|
|
44
56
|
position: absolute;
|
|
@@ -52,7 +64,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
52
64
|
box-sizing: border-box;
|
|
53
65
|
:hover {
|
|
54
66
|
opacity: 0.8;
|
|
55
|
-
}`,
|
|
67
|
+
}`,fl=`
|
|
56
68
|
display: block;
|
|
57
69
|
cursor: pointer;
|
|
58
70
|
position: absolute;
|
|
@@ -60,52 +72,52 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
60
72
|
right: 12px;
|
|
61
73
|
background-color: transparent;
|
|
62
74
|
border: none;
|
|
63
|
-
`,
|
|
64
|
-
${e=>
|
|
65
|
-
${e=>e.hasImage?
|
|
75
|
+
`,ni=me.button`
|
|
76
|
+
${e=>k(e)} {
|
|
77
|
+
${e=>e.hasImage?ul:fl};
|
|
66
78
|
}
|
|
67
|
-
`,
|
|
68
|
-
${e=>
|
|
79
|
+
`,si=me.img`
|
|
80
|
+
${e=>k(e)} {
|
|
69
81
|
display: block;
|
|
70
82
|
width: 100%;
|
|
71
83
|
height: auto;
|
|
72
84
|
min-height: 200px;
|
|
73
85
|
object-fit: cover;
|
|
74
86
|
}
|
|
75
|
-
`,
|
|
76
|
-
${e=>
|
|
87
|
+
`,ai=me.div`
|
|
88
|
+
${e=>k(e)} {
|
|
77
89
|
display: block;
|
|
78
90
|
width: 100%;
|
|
79
91
|
height: auto;
|
|
80
92
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
81
93
|
object-fit: cover;
|
|
82
94
|
}
|
|
83
|
-
`,
|
|
95
|
+
`,li=me.div`
|
|
84
96
|
display: flex;
|
|
85
97
|
flex-direction: row;
|
|
86
98
|
justify-content: space-between;
|
|
87
99
|
align-content: center;
|
|
88
|
-
`,
|
|
100
|
+
`,pi=me.div`
|
|
89
101
|
padding: 22px 22px 12px;
|
|
90
|
-
`,
|
|
102
|
+
`,di=me.div`
|
|
91
103
|
display: flex;
|
|
92
104
|
flex: 1;
|
|
93
105
|
flex-direction: column;
|
|
94
106
|
justify-content: center;
|
|
95
|
-
`,
|
|
107
|
+
`,ci=me.div`
|
|
96
108
|
display: flex;
|
|
97
109
|
flex: 2;
|
|
98
110
|
flex-shrink: 1;
|
|
99
111
|
gap: 8px;
|
|
100
112
|
height: 64px;
|
|
101
|
-
${e=>
|
|
113
|
+
${e=>k(e)} {
|
|
102
114
|
flex-direction: row;
|
|
103
115
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
104
116
|
align-content: center;
|
|
105
117
|
align-items: center;
|
|
106
118
|
}
|
|
107
|
-
`,
|
|
108
|
-
${e=>
|
|
119
|
+
`,mi=me.p`
|
|
120
|
+
${e=>k(e)} {
|
|
109
121
|
font-style: normal;
|
|
110
122
|
font-weight: 600;
|
|
111
123
|
font-size: 15px;
|
|
@@ -113,8 +125,8 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
113
125
|
color: #808080;
|
|
114
126
|
}
|
|
115
127
|
margin: 0;
|
|
116
|
-
`;var
|
|
117
|
-
background-color: ${e=>
|
|
128
|
+
`;var ui=me.div`
|
|
129
|
+
background-color: ${e=>e.appearance?.theme.colorBackground};
|
|
118
130
|
position: absolute;
|
|
119
131
|
bottom: -47px;
|
|
120
132
|
left: 0;
|
|
@@ -123,9 +135,9 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
123
135
|
display: inline-flex;
|
|
124
136
|
align-items: center;
|
|
125
137
|
justify-content: center;
|
|
126
|
-
border-radius: ${e=>
|
|
127
|
-
`,
|
|
128
|
-
background-color: ${e=>
|
|
138
|
+
border-radius: ${e=>e.appearance?.theme.borderRadius}px;
|
|
139
|
+
`,fi=me(Io)`
|
|
140
|
+
background-color: ${e=>e.appearance?.theme.colorBackground};
|
|
129
141
|
position: absolute;
|
|
130
142
|
bottom: -60px;
|
|
131
143
|
left: 0;
|
|
@@ -134,10 +146,10 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
134
146
|
display: inline-flex;
|
|
135
147
|
align-items: center;
|
|
136
148
|
justify-content: center;
|
|
137
|
-
border-radius: ${e=>
|
|
149
|
+
border-radius: ${e=>e.appearance?.theme.borderRadius}px;
|
|
138
150
|
padding: 0;
|
|
139
151
|
z-index: ${e=>e.zIndex};
|
|
140
|
-
`,
|
|
152
|
+
`,gi=me.div`
|
|
141
153
|
display: flex;
|
|
142
154
|
justify-content: center;
|
|
143
155
|
align-items: center;
|
|
@@ -145,11 +157,11 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
145
157
|
font-weight: 500;
|
|
146
158
|
font-size: 12px;
|
|
147
159
|
line-height: 18px;
|
|
148
|
-
color: ${e=>
|
|
149
|
-
`;function
|
|
150
|
-
${e=>
|
|
160
|
+
color: ${e=>e.appearance?.theme?.colorTextSecondary};
|
|
161
|
+
`;function Ao({appearance:e}){return V__default.createElement(gi,{className:l("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",V__default.createElement(ii,null))}var xl=me.div`
|
|
162
|
+
${e=>k(e)} {
|
|
151
163
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
152
|
-
background-color: ${e=>
|
|
164
|
+
background-color: ${e=>e.appearance?.theme?.colorBackground};
|
|
153
165
|
/* Mobile */
|
|
154
166
|
@media (max-width: 500px) {
|
|
155
167
|
width: 90%;
|
|
@@ -158,10 +170,10 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
158
170
|
left: 50%;
|
|
159
171
|
}
|
|
160
172
|
|
|
161
|
-
width: ${e=>
|
|
173
|
+
width: ${e=>e.width??"1000px"};
|
|
162
174
|
z-index: 1500;
|
|
163
|
-
border-radius: ${e=>
|
|
164
|
-
${e=>
|
|
175
|
+
border-radius: ${e=>e.appearance?.theme?.borderRadius??8}px;
|
|
176
|
+
${e=>Fe(e)}
|
|
165
177
|
}
|
|
166
178
|
|
|
167
179
|
padding: 32px;
|
|
@@ -188,39 +200,39 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
188
200
|
opacity: 1;
|
|
189
201
|
}
|
|
190
202
|
}
|
|
191
|
-
`,
|
|
203
|
+
`,Cl=me.div`
|
|
192
204
|
position: relative;
|
|
193
205
|
flex: 0 1 auto;
|
|
194
|
-
`,
|
|
206
|
+
`,yl=me.div`
|
|
195
207
|
position: absolute;
|
|
196
208
|
top: 16px;
|
|
197
209
|
right: 16px;
|
|
198
210
|
cursor: pointer;
|
|
199
211
|
z-index: 1501;
|
|
200
|
-
${e=>
|
|
212
|
+
${e=>k(e)} {
|
|
201
213
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
202
|
-
color: ${e=>
|
|
214
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
203
215
|
}
|
|
204
|
-
`,
|
|
216
|
+
`,Sl=me.div`
|
|
205
217
|
overflow: scroll;
|
|
206
218
|
flex: 1 1;
|
|
207
219
|
display: flex;
|
|
208
220
|
::-webkit-scrollbar {
|
|
209
221
|
display: none;
|
|
210
222
|
}
|
|
211
|
-
`,
|
|
223
|
+
`,qe=({onClose:e,visible:t,headerContent:o=null,style:r=null,children:i,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[d,a]=useState("");return useEffect(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");a(m);},[]),useEffect(()=>{let m=c=>{c.key==="Escape"&&e();};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m);}},[e]),useEffect(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d);}},[t]),t?V__default.createElement(Portal,null,V__default.createElement(ri,{appearance:n,onClose:()=>{s&&e();}}),V__default.createElement(xl,{appearance:n,className:l("modalContainer",n),styleOverrides:r},s&&V__default.createElement(yl,{className:l("modalClose",n),onClick:()=>e(),appearance:n},V__default.createElement(ve,null)),o&&V__default.createElement(Cl,null,o),V__default.createElement(Sl,null,i),p&&V__default.createElement(ui,{appearance:n,className:l("poweredByFrigadeRibbon",n)},V__default.createElement(Ao,{appearance:n})))):V__default.createElement(V__default.Fragment,null)};function Tl(e){switch(e){case"top-left":return `
|
|
212
224
|
top: 0;
|
|
213
225
|
left: 0;
|
|
214
|
-
`;case"top-right":return`
|
|
226
|
+
`;case"top-right":return `
|
|
215
227
|
top: 0;
|
|
216
228
|
right: 0;
|
|
217
|
-
`;case"bottom-left":return`
|
|
229
|
+
`;case"bottom-left":return `
|
|
218
230
|
bottom: 0;
|
|
219
231
|
left: 0;
|
|
220
|
-
`}return"right: 0; bottom: 0;"}var
|
|
221
|
-
${e=>
|
|
232
|
+
`}return "right: 0; bottom: 0;"}var Fl=me.div`
|
|
233
|
+
${e=>k(e)} {
|
|
222
234
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
223
|
-
background: ${e=>
|
|
235
|
+
background: ${e=>e.appearance?.theme?.colorBackground};
|
|
224
236
|
position: fixed;
|
|
225
237
|
display: flex;
|
|
226
238
|
flex-direction: column;
|
|
@@ -231,29 +243,29 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
231
243
|
width: 350px;
|
|
232
244
|
padding: 24px;
|
|
233
245
|
}
|
|
234
|
-
${e=>
|
|
246
|
+
${e=>Tl(e.modalPosition)}
|
|
235
247
|
margin: 28px;
|
|
236
|
-
`,
|
|
248
|
+
`,kl=me.div`
|
|
237
249
|
position: relative;
|
|
238
250
|
flex: 1;
|
|
239
|
-
`,
|
|
251
|
+
`,Pl=me.div`
|
|
240
252
|
position: absolute;
|
|
241
253
|
top: 16px;
|
|
242
254
|
right: 16px;
|
|
243
255
|
cursor: pointer;
|
|
244
256
|
z-index: 1501;
|
|
245
|
-
${e=>
|
|
257
|
+
${e=>k(e)} {
|
|
246
258
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
247
|
-
color: ${e=>
|
|
259
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
248
260
|
}
|
|
249
|
-
`,
|
|
261
|
+
`,vl=me.div`
|
|
250
262
|
overflow: scroll;
|
|
251
263
|
flex: 5;
|
|
252
264
|
::-webkit-scrollbar {
|
|
253
265
|
display: none;
|
|
254
266
|
}
|
|
255
|
-
`,
|
|
256
|
-
${e=>
|
|
267
|
+
`,Lo=({onClose:e,visible:t,headerContent:o=null,children:r,appearance:i,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,d]=useState("");return useEffect(()=>{let a=getComputedStyle(document.body).getPropertyValue("overflow");d(a);},[]),useEffect(()=>{let a=m=>{m.key==="Escape"&&e();};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a);}},[e]),useEffect(()=>{let a=document.body.style;return t?a.setProperty("overflow","hidden"):a.setProperty("overflow",p),()=>{a.setProperty("overflow",p);}},[t]),t?V__default.createElement(Portal,null,V__default.createElement(Fl,{appearance:i,className:l("cornerModalContainer",i),modalPosition:n},s&&V__default.createElement(Pl,{className:l("cornerModalClose",i),onClick:()=>e()},V__default.createElement(ve,null)),o&&V__default.createElement(kl,null,o),V__default.createElement(vl,null,r))):V__default.createElement(V__default.Fragment,null)};function ie(){let{defaultAppearance:e}=useContext(Z);function t(o){let r=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(r.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(r.theme,o.theme??{})}:r}return {mergeAppearanceWithDefault:t}}var xi=me.label`
|
|
268
|
+
${e=>k(e)} {
|
|
257
269
|
font-size: 12px;
|
|
258
270
|
line-height: 18px;
|
|
259
271
|
margin-bottom: 5px;
|
|
@@ -263,37 +275,37 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
263
275
|
letter-spacing: 0.24px;
|
|
264
276
|
}
|
|
265
277
|
display: flex;
|
|
266
|
-
`,
|
|
267
|
-
${e=>
|
|
278
|
+
`,Ci=me.label`
|
|
279
|
+
${e=>k(e)} {
|
|
268
280
|
font-size: 12px;
|
|
269
281
|
line-height: 20px;
|
|
270
282
|
margin-bottom: 5px;
|
|
271
283
|
}
|
|
272
284
|
display: flex;
|
|
273
|
-
|
|
285
|
+
`,yi=me.span`
|
|
274
286
|
font-weight: 400;
|
|
275
287
|
font-size: 14px;
|
|
276
288
|
line-height: 22px;
|
|
277
|
-
color: ${e=>
|
|
289
|
+
color: ${e=>e.appearance?.theme?.colorTextError};
|
|
278
290
|
display: flex;
|
|
279
291
|
margin-right: 5px;
|
|
280
292
|
margin-top: 10px;
|
|
281
|
-
|
|
293
|
+
`,$o=me.div`
|
|
282
294
|
display: flex;
|
|
283
295
|
align-items: flex-start;
|
|
284
296
|
justify-content: left;
|
|
285
297
|
margin-bottom: 10px;
|
|
286
|
-
`;
|
|
298
|
+
`;var et={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 dt({title:e,required:t,appearance:o=et}){return e?V__default.createElement($o,{className:l("formLabelWrapper",o)},t?V__default.createElement(yi,{className:l("formLabelRequired",o),appearance:o},"*"):null,V__default.createElement(xi,{className:l("formLabel",o)},e)):null}function Dt({title:e,appearance:t}){return e?V__default.createElement($o,null,V__default.createElement(Ci,{className:l("formSubLabel",t)},e)):null}function bi(e,t){try{if(t){if(t.type=="number"){let o=z.number();if(t.props)for(let r of t.props)r.requirement=="min"?o=o.min(Number(r.value),r.message??"Value is too small"):r.requirement=="max"?o=o.max(Number(r.value),r.message??"Value is too large"):r.requirement=="positive"?o=o.positive(r.message??"Value must be positive"):r.requirement=="negative"&&(o=o.nonpositive(r.message??"Value must be negative"));o.parse(Number(e));}if(t.type=="string"){let o=z.string();if(t.props)for(let r of t.props)r.requirement=="min"?o=o.min(Number(r.value),r.message??"Value is too short"):r.requirement=="max"?o=o.max(Number(r.value),r.message??"Value is too long"):r.requirement=="regex"&&(o=o.regex(new RegExp(String(r.value)),r.message??"Value does not match requirements"));o.parse(e);}return}}catch(o){if(o instanceof z.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 El=me.div`
|
|
287
299
|
display: flex;
|
|
288
300
|
flex-direction: column;
|
|
289
301
|
width: 100%;
|
|
290
|
-
`,
|
|
291
|
-
${e=>
|
|
302
|
+
`,Sr=me.input`
|
|
303
|
+
${e=>k(e)} {
|
|
292
304
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
293
|
-
border: 1px solid ${e=>
|
|
305
|
+
border: 1px solid ${e=>e.appearance?.theme?.colorBorder};
|
|
294
306
|
font-size: 14px;
|
|
295
307
|
::placeholder {
|
|
296
|
-
color: ${e=>
|
|
308
|
+
color: ${e=>e.appearance?.theme?.colorTextDisabled};
|
|
297
309
|
font-size: 14px;
|
|
298
310
|
}
|
|
299
311
|
border-radius: 6px;
|
|
@@ -303,10 +315,10 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
303
315
|
box-sizing: border-box;
|
|
304
316
|
padding: 0 10px;
|
|
305
317
|
margin-bottom: 10px;
|
|
306
|
-
`,
|
|
307
|
-
${e=>
|
|
318
|
+
`,Il=me.textarea`
|
|
319
|
+
${e=>k(e)} {
|
|
308
320
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
309
|
-
border: 1px solid ${e=>
|
|
321
|
+
border: 1px solid ${e=>e.appearance?.theme?.colorBorder};
|
|
310
322
|
font-size: 14px;
|
|
311
323
|
padding: 10px;
|
|
312
324
|
::placeholder {
|
|
@@ -320,16 +332,16 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
320
332
|
box-sizing: border-box;
|
|
321
333
|
margin-bottom: 10px;
|
|
322
334
|
resize: none;
|
|
323
|
-
`;function
|
|
335
|
+
`;function br({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:r,inputData:i}){let n=e,[s,p]=useState(i?.text||""),[d,a]=useState(!1),[m,c]=useState(!1),g=Sr;useEffect(()=>{s===""&&!d&&(a(!0),b(""));},[]),useEffect(()=>{if(m){b(s);return}},[m]);function b(x){if(p(x),o({text:x}),n.required===!0&&x.trim()===""){r([{id:n.id,message:`${n.title??"Field"} is required`,hidden:!m}]);return}let u=bi(x,n.validation);if(u&&(x.trim()!==""||n.required===!0)){r([{id:n.id,message:u,hidden:!m}]);return}r([]);}n.multiline&&(g=Il);function T(){switch(n?.validation?.type){case"email":return "email";case"number":return "number";case"password":return "password"}return null}return V__default.createElement(El,null,V__default.createElement(dt,{title:n.title,required:n.required,appearance:t.appearance}),V__default.createElement(g,{className:l("inputComponent",t.appearance),value:s,onChange:x=>{b(x.target.value);},appearance:t.appearance,placeholder:n.placeholder,type:T(),onBlur:()=>{c(!0);}}),V__default.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}var wr="",Al=me.div`
|
|
324
336
|
display: flex;
|
|
325
337
|
flex-direction: column;
|
|
326
338
|
width: 100%;
|
|
327
339
|
-webkit-appearance: none;
|
|
328
340
|
appearance: none;
|
|
329
|
-
`,
|
|
330
|
-
${e=>
|
|
341
|
+
`,Nl=me.select`
|
|
342
|
+
${e=>k(e)} {
|
|
331
343
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
332
|
-
border: 1px solid ${e=>
|
|
344
|
+
border: 1px solid ${e=>e.appearance?.theme?.colorBorder};
|
|
333
345
|
font-size: 14px;
|
|
334
346
|
border-radius: 6px;
|
|
335
347
|
}
|
|
@@ -339,7 +351,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
339
351
|
|
|
340
352
|
padding: 0 10px;
|
|
341
353
|
margin-bottom: 10px;
|
|
342
|
-
color: ${e=>
|
|
354
|
+
color: ${e=>e.value==""?e.appearance?.theme?.colorTextDisabled:e.appearance?.theme?.colorText};
|
|
343
355
|
|
|
344
356
|
appearance: none;
|
|
345
357
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'><path stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/></svg>");
|
|
@@ -347,18 +359,19 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
347
359
|
background-repeat: no-repeat;
|
|
348
360
|
background-size: 1.5em 1.5em;
|
|
349
361
|
-webkit-print-color-adjust: exact;
|
|
350
|
-
`;function
|
|
351
|
-
${e=>
|
|
352
|
-
|
|
362
|
+
`;function Pi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r,setFormValidationErrors:i}){let n=e,[s,p]=useState(!1),[d,a]=useState(!1);return useEffect(()=>{if(!r?.choice?.[0]&&!s){if(p(!0),n.requireSelection){o({choice:[wr]});return}if(n.defaultValue&&n.props.options?.find(m=>m.id===n.defaultValue)){let m=n.props.options?.find(c=>c.id===n.defaultValue);o({choice:[m.id]});}else o({choice:[n.props.options?.[0].id||""]});}},[]),useEffect(()=>{d&&(n.requireSelection&&r?.choice?.[0]===wr?i([{message:"Please select an option",id:n.id}]):i([]));},[r?.choice?.[0],d]),V__default.createElement(Al,null,V__default.createElement(dt,{title:n.title,required:!1,appearance:t.appearance}),V__default.createElement(Nl,{value:r?.choice?.[0],onChange:m=>{a(!0),o({choice:[m.target.value]});},placeholder:n.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},n.requireSelection&&V__default.createElement("option",{key:"null-value",value:wr,disabled:!0},n.placeholder??"Select an option"),n.props.options?.map(m=>V__default.createElement("option",{key:m.id,value:m.id},m.title))),n.props.options?.find(m=>m.id===r?.choice?.[0])?.isOpenEnded&&V__default.createElement(V__default.Fragment,null,V__default.createElement(dt,{title:n.props.options?.find(m=>m.id===r?.choice?.[0])?.openEndedLabel??"Please specify",required:!1,appearance:t.appearance}),V__default.createElement(Sr,{type:"text",placeholder:"Enter your answer here",onChange:m=>{o({choice:[m.target.value]});},appearance:t.appearance})),V__default.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}var vi=({color:e,percentage:t,size:o})=>{let r=o*.5-2,i=2*Math.PI*r,n=(1-t)*i;return V__default.createElement("circle",{r,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==i?e:"",strokeWidth:"3px",strokeDasharray:i,strokeDashoffset:t?n:0})},Ol=({fillColor:e,size:t,percentage:o,children:r,bgColor:i="#D9D9D9",className:n,style:s})=>V__default.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},V__default.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},V__default.createElement(vi,{color:i,size:t}),V__default.createElement(vi,{color:e,percentage:Math.max(o,.1),size:t})),r),$t=Ol;var Dl=({color:e="#FFFFFF"})=>V__default.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V__default.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),$l={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Ml={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Ul={border:"1px solid #000000",color:"#FFFFFF"},zl={border:"1px solid #C5CBD3"},_l={color:"#FFFFFF"},Wl={border:"1px solid #C5CBD3"},Hl=e=>e==="square"?$l:Ml,Vl=(e,t)=>e==="square"?t?Ul:zl:t?_l:Wl,jl=me.div`
|
|
363
|
+
${e=>Fe(e)}
|
|
364
|
+
flex-shrink: 0;
|
|
365
|
+
`,tt=({value:e,type:t="round",primaryColor:o="#000000",progress:r,appearance:i=et,style:n,className:s})=>{let p=Hl(t),d=Vl(t,e);return e===!0?p={...p,...d,backgroundColor:i.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...d},e!==!0&&t==="round"&&r!==void 0&&r!==1?V__default.createElement($t,{fillColor:o,percentage:r,size:22}):V__default.createElement(jl,{styleOverrides:p,style:n,role:"checkbox",className:we(l("checkIconContainer",i),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",i),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&V__default.createElement(Dl,{color:"#FFFFFF"}))};var Gl=me.div`
|
|
353
366
|
display: flex;
|
|
354
367
|
flex-direction: column;
|
|
355
368
|
width: 100%;
|
|
356
369
|
-webkit-appearance: none;
|
|
357
370
|
appearance: none;
|
|
358
|
-
`,
|
|
359
|
-
${e=>
|
|
371
|
+
`,Kl=me.button`
|
|
372
|
+
${e=>k(e)} {
|
|
360
373
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
361
|
-
border: 1px solid ${e=>
|
|
374
|
+
border: 1px solid ${e=>e.appearance?.theme?.colorBorder};
|
|
362
375
|
font-size: 14px;
|
|
363
376
|
// Selector for when selected=true
|
|
364
377
|
&[data-selected='true'] {
|
|
@@ -377,11 +390,11 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
377
390
|
align-items: center;
|
|
378
391
|
cursor: pointer;
|
|
379
392
|
width: 100%;
|
|
380
|
-
height:
|
|
381
|
-
padding:
|
|
393
|
+
line-height: 18px;
|
|
394
|
+
padding: 18px;
|
|
382
395
|
margin-bottom: 10px;
|
|
383
|
-
`;function
|
|
384
|
-
${e=>
|
|
396
|
+
`;function Ii({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r,setFormValidationErrors:i}){let n=e,[s,p]=useState(r?.choice||[]),[d,a]=useState(!1);return useEffect(()=>{s.length==0&&!d&&(a(!0),o({choice:[]}));},[]),useEffect(()=>{o({choice:s});},[s]),useEffect(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?i([{message:"",id:n.id}]):i([]);},[s]),V__default.createElement(Gl,null,V__default.createElement(dt,{title:n.title,required:n.required,appearance:t.appearance}),n.props.options?.map(m=>V__default.createElement(Kl,{appearance:t.appearance,className:l(s.includes(m.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:m.id,value:m.id,"data-selected":s.includes(m.id),onClick:()=>{if(s.includes(m.id)){p(s.filter(c=>c!==m.id));return}s.length<n.props.maxChoices?p([...s,m.id]):s.length==1&&n.props.maxChoices==1&&p([m.id]);}},m.title,V__default.createElement(tt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(m.id),appearance:t.appearance}))),V__default.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}function J(e){return e?{__html:ql.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}:{__html:""}}var Yl=me.h1`
|
|
397
|
+
${e=>k(e)} {
|
|
385
398
|
font-style: normal;
|
|
386
399
|
font-weight: 700;
|
|
387
400
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -392,8 +405,8 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
392
405
|
margin-bottom: 4px;
|
|
393
406
|
color: ${e=>e.appearance.theme.colorText};
|
|
394
407
|
}
|
|
395
|
-
`,
|
|
396
|
-
${e=>
|
|
408
|
+
`,Jl=me.h2`
|
|
409
|
+
${e=>k(e)} {
|
|
397
410
|
font-style: normal;
|
|
398
411
|
font-weight: 400;
|
|
399
412
|
font-size: 14px;
|
|
@@ -401,38 +414,38 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
401
414
|
letter-spacing: 0.28px;
|
|
402
415
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
403
416
|
}
|
|
404
|
-
`;function
|
|
417
|
+
`;function Be({appearance:e,title:t,subtitle:o,size:r="medium",classPrefix:i="",ariaPrefix:n=""}){return V__default.createElement(V__default.Fragment,null,V__default.createElement(Yl,{appearance:e,id:n?`frigade${n}Title`:"frigadeTitle",className:l(`${i}${i?so(r):r}Title`,e),dangerouslySetInnerHTML:J(t),size:r}),o&&V__default.createElement(Jl,{id:n?`frigade${n}Subtitle`:"frigadeSubtitle",appearance:e,className:l(`${i}${i?so(r):r}Subtitle`,e),dangerouslySetInnerHTML:J(o),size:r}))}var Ni=e=>V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},V.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 Ql=me.div`
|
|
405
418
|
display: flex;
|
|
406
419
|
flex-direction: column;
|
|
407
420
|
justify-content: flex-end;
|
|
408
421
|
overflow: visible;
|
|
409
422
|
padding-top: 14px;
|
|
410
|
-
`,
|
|
411
|
-
color: ${e=>
|
|
423
|
+
`,Zl=me.div`
|
|
424
|
+
color: ${e=>e.appearance?.theme?.colorTextError};
|
|
412
425
|
font-size: 12px;
|
|
413
426
|
margin-bottom: 12px;
|
|
414
427
|
display: flex;
|
|
415
428
|
align-items: center;
|
|
416
|
-
`,
|
|
429
|
+
`,Rl=me.div`
|
|
417
430
|
margin-right: 4px;
|
|
418
431
|
display: inline-flex;
|
|
419
|
-
`,
|
|
432
|
+
`,ep=me.div`
|
|
420
433
|
padding-left: 1px;
|
|
421
434
|
padding-right: 1px;
|
|
422
|
-
`,
|
|
435
|
+
`,tp={text:br,multipleChoice:Pi,multipleChoiceList:Ii},Pr="frigade-multiInputStepTypeData";function Li({flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:i,appearance:n,customFormElements:s,prefillData:p}){let d=t.props,[a,m]=useState([]),[c,g]=useState([]),{userId:b}=io(),[T,x]=useState(N()||(p?p[t.id]:null)||{}),{readonly:u}=useContext(Z),F={...tp,...s};useEffect(()=>{r(a.length===0);},[a,r]),useEffect(()=>{i(T);},[T]);function C(w,h){x(v=>{let S={...v,[w.id]:h};return typeof window<"u"&&window.localStorage&&!u&&window.localStorage.setItem(D(),JSON.stringify(S)),S});}function N(){if(typeof window<"u"&&window.localStorage){let w=window.localStorage.getItem(D());if(w)return JSON.parse(w)}return null}function D(){return `${Pr}-${e}-${t.id}-${b}`}return V__default.createElement(ep,{className:l("multiInput",n)},V__default.createElement(Be,{appearance:n,title:t.title,subtitle:t.subtitle}),V__default.createElement(Ql,{className:l("multiInputContainer",n)},d?.data?.map(w=>{let h=a.reverse().find(v=>v.id===w.id);return F[w.type]?V__default.createElement("span",{key:w.id,"data-field-id":w.id,className:l("multiInputField",n)},F[w.type]({formInput:w,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:i,appearance:n},onSaveInputData:v=>{!c.includes(w.id)&&v&&v?.text!==""&&g(S=>[...S,w.id]),C(w,v);},inputData:T[w.id],setFormValidationErrors:v=>{v.length===0&&a.length===0||m(S=>v.length===0?S.filter(P=>P.id!==w.id):[...S,...v]);}}),h&&h.message&&c.includes(w.id)&&h.hidden!==!0&&V__default.createElement(Zl,{key:w.id,style:{overflow:"hidden"},appearance:n,className:l("multiInputValidationError",n)},V__default.createElement(Rl,{appearance:n,className:l("multiInputValidationErrorIcon",n)},V__default.createElement(Ni,null)),h.message)):null})))}var Di=me.div`
|
|
423
436
|
align-items: center;
|
|
424
437
|
display: flex;
|
|
425
438
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
426
439
|
padding-top: 14px;
|
|
427
|
-
|
|
440
|
+
`,$i=me.div`
|
|
428
441
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
429
442
|
font-size: 12px;
|
|
430
|
-
`,
|
|
443
|
+
`,Mi=me.div`
|
|
431
444
|
display: flex;
|
|
432
445
|
gap: 12px;
|
|
433
446
|
width: 100%;
|
|
434
447
|
justify-content: flex-end;
|
|
435
|
-
`,
|
|
448
|
+
`,Ui=me.div`
|
|
436
449
|
display: flex;
|
|
437
450
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
438
451
|
// Otherwise, use 4px padding
|
|
@@ -440,11 +453,11 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
440
453
|
flex-grow: 1;
|
|
441
454
|
flex-basis: 0;
|
|
442
455
|
position: relative;
|
|
443
|
-
`,
|
|
456
|
+
`,zi=me.div`
|
|
444
457
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
445
458
|
position: relative;
|
|
446
459
|
overflow-y: auto;
|
|
447
|
-
`,
|
|
460
|
+
`,_i=me.div`
|
|
448
461
|
display: flex;
|
|
449
462
|
align-self: stretch;
|
|
450
463
|
flex-grow: 1;
|
|
@@ -456,7 +469,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
456
469
|
background-position: center;
|
|
457
470
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
458
471
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
459
|
-
`;
|
|
472
|
+
`;var Wi=me.div`
|
|
460
473
|
width: 24px;
|
|
461
474
|
height: 24px;
|
|
462
475
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -474,26 +487,26 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
474
487
|
transform: rotate(360deg);
|
|
475
488
|
}
|
|
476
489
|
}
|
|
477
|
-
`;var
|
|
490
|
+
`;var Hi=me.button`
|
|
478
491
|
justify-content: center;
|
|
479
492
|
align-content: center;
|
|
480
493
|
align-items: center;
|
|
481
|
-
${e=>
|
|
494
|
+
${e=>k(e)} {
|
|
482
495
|
display: flex;
|
|
483
496
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
484
497
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
485
498
|
// Only add margin if prop withMargin is true
|
|
486
499
|
${e=>e.withMargin?"margin: 16px 0px 16px 0px;":""}
|
|
487
500
|
|
|
488
|
-
border: 1px solid ${e=>
|
|
489
|
-
color: ${e=>
|
|
490
|
-
background-color: ${e=>
|
|
491
|
-
border-radius: ${e=>
|
|
501
|
+
border: 1px solid ${e=>e.secondary?"#C5CBD3":e?.appearance?.theme?.colorPrimary};
|
|
502
|
+
color: ${e=>e.secondary?e.appearance?.theme?.colorText:e.appearance?.theme?.colorTextOnPrimaryBackground};
|
|
503
|
+
background-color: ${e=>e.secondary?e.appearance?.theme?.colorBackground:e?.appearance?.theme?.colorPrimary};
|
|
504
|
+
border-radius: ${e=>e.appearance?.theme?.borderRadius}px;
|
|
492
505
|
padding: ${e=>e.size=="small"?"6px 14px 6px 14px":"8px 20px 8px 20px"};
|
|
493
506
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
494
507
|
line-height: 20px;
|
|
495
508
|
font-weight: 500;
|
|
496
|
-
${e=>
|
|
509
|
+
${e=>Fe(e)}
|
|
497
510
|
}
|
|
498
511
|
|
|
499
512
|
font-family: inherit;
|
|
@@ -507,8 +520,8 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
507
520
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
508
521
|
cursor: not-allowed;
|
|
509
522
|
}
|
|
510
|
-
`,
|
|
511
|
-
${e=>
|
|
523
|
+
`,_o=me.div`
|
|
524
|
+
${e=>k(e)} {
|
|
512
525
|
display: flex;
|
|
513
526
|
flex-direction: row;
|
|
514
527
|
justify-content: flex-start;
|
|
@@ -518,15 +531,15 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
518
531
|
margin-right: 8px;
|
|
519
532
|
}
|
|
520
533
|
}
|
|
521
|
-
`,
|
|
534
|
+
`,ee=({onClick:e,title:t,style:o,disabled:r,type:i="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a="",loading:m=!1,autoFocus:c=!1})=>{function g(){let T=s?"buttonSecondary":"button";return a===""?T:`${a}${so(T)}`}let b={tabindex:s?"0":"1",secondary:s,appearance:p,disabled:r||m,loading:m?.toString()??"",onClick:e,styleOverrides:o,type:i,withMargin:d,size:n,className:l(g(),p),autoFocus:c};return m?V__default.createElement(Hi,{...b},V__default.createElement(Wi,{className:l("buttonLoader",p)})):V__default.createElement(Hi,{...b,dangerouslySetInnerHTML:J(t??"Continue")})};var ji=({step:e,canContinue:t,appearance:o,onPrimaryClick:r,onSecondaryClick:i,selectedStep:n,steps:s,onBack:p,allowBackNavigation:d,errorMessage:a,isSaving:m})=>{let c=s.length>1&&n!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return V__default.createElement(V__default.Fragment,null,a!==null&&a!=null&&V__default.createElement($i,{appearance:o,className:l("formCTAError",o)},a),V__default.createElement(Di,{showBackButton:c,className:l("formCTAContainer",o)},c&&V__default.createElement(ee,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),V__default.createElement(Mi,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?V__default.createElement(ee,{title:e.secondaryButtonTitle,onClick:i,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?V__default.createElement(ee,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:r,type:g,appearance:o,loading:m}):null)))};var ip=me.div`
|
|
522
535
|
text-align: center;
|
|
523
536
|
color: #e6e6e6;
|
|
524
|
-
`,
|
|
537
|
+
`,Wo=({stepCount:e=0,currentStep:t=0,className:o,appearance:r})=>{let{theme:i}=ie().mergeAppearanceWithDefault(r);return V__default.createElement(ip,{className:o},V__default.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>V__default.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?i.colorPrimary:"currentColor"}))))};function pe(){let e=useContext(Z);function t(i){r(i.primaryButtonUri,i.primaryButtonUriTarget);}function o(i){r(i.secondaryButtonUri,i.secondaryButtonUriTarget);}function r(i,n){if(!i)return;let s=i.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(i,s);}return {primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:r}}var sp=me.div`
|
|
525
538
|
display: flex;
|
|
526
539
|
flex-wrap: wrap;
|
|
527
540
|
align-content: center;
|
|
528
541
|
justify-content: center;
|
|
529
|
-
`,
|
|
542
|
+
`,ap=me.div`
|
|
530
543
|
align-content: center;
|
|
531
544
|
align-items: center;
|
|
532
545
|
display: flex;
|
|
@@ -540,10 +553,10 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
540
553
|
flex-basis: 255px;
|
|
541
554
|
flex-grow: 0;
|
|
542
555
|
flex-shrink: 0;
|
|
543
|
-
`,
|
|
556
|
+
`,lp=me.img`
|
|
544
557
|
width: 78px;
|
|
545
558
|
height: auto;
|
|
546
|
-
`,
|
|
559
|
+
`,pp=me.button`
|
|
547
560
|
font-style: normal;
|
|
548
561
|
font-weight: 600;
|
|
549
562
|
font-size: 13px;
|
|
@@ -556,11 +569,11 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
556
569
|
border-radius: 100px;
|
|
557
570
|
padding: 8px 12px;
|
|
558
571
|
margin-top: 16px;
|
|
559
|
-
`,
|
|
572
|
+
`,dp=me.h1`
|
|
560
573
|
font-weight: 700;
|
|
561
574
|
font-size: 28px;
|
|
562
575
|
line-height: 34px;
|
|
563
|
-
`,
|
|
576
|
+
`,cp=me.h2`
|
|
564
577
|
font-style: normal;
|
|
565
578
|
font-weight: 400;
|
|
566
579
|
font-size: 16px;
|
|
@@ -569,7 +582,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
569
582
|
margin-top: 12px;
|
|
570
583
|
margin-bottom: 16px;
|
|
571
584
|
max-width: 70%;
|
|
572
|
-
`;function
|
|
585
|
+
`;function Gi({stepData:e,appearance:t}){let{handleUrl:o}=pe();return V__default.createElement("div",null,V__default.createElement(dp,{dangerouslySetInnerHTML:J(e.title)}),V__default.createElement(cp,{dangerouslySetInnerHTML:J(e.subtitle)}),V__default.createElement(sp,null,e.props?.links?.map(r=>V__default.createElement(ap,{key:r.title},V__default.createElement(lp,{src:r.imageUri}),V__default.createElement(pp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{r.uri&&o(r.uri,r.uriTarget??"_blank");}},r.title)))))}var Ho=({style:e,className:t})=>V__default.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},V__default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),V__default.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"}));var fp=me.div`
|
|
573
586
|
display: flex;
|
|
574
587
|
align-items: center;
|
|
575
588
|
justify-content: flex-start;
|
|
@@ -577,7 +590,7 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
577
590
|
width: 100%;
|
|
578
591
|
height: 100%;
|
|
579
592
|
position: relative;
|
|
580
|
-
`,
|
|
593
|
+
`,gp=me.div`
|
|
581
594
|
position: absolute;
|
|
582
595
|
display: flex;
|
|
583
596
|
align-items: center;
|
|
@@ -596,74 +609,74 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
596
609
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
597
610
|
border-radius: 50%;
|
|
598
611
|
}
|
|
599
|
-
|
|
612
|
+
`,hp=me.video`
|
|
600
613
|
width: 100%;
|
|
601
614
|
height: 100%;
|
|
602
615
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
603
|
-
`,
|
|
616
|
+
`,xp=me.iframe`
|
|
604
617
|
width: 100%;
|
|
605
618
|
height: 100%;
|
|
606
619
|
min-height: 260px;
|
|
607
620
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
608
|
-
`,
|
|
621
|
+
`,Cp=me.iframe`
|
|
609
622
|
width: 100%;
|
|
610
623
|
height: 100%;
|
|
611
624
|
min-height: 400px;
|
|
612
625
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
613
|
-
`,
|
|
626
|
+
`,yp=me.iframe`
|
|
614
627
|
width: 100%;
|
|
615
628
|
height: 100%;
|
|
616
629
|
min-height: 400px;
|
|
617
630
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
618
|
-
`;function
|
|
619
|
-
${e=>
|
|
631
|
+
`;function Je({appearance:e,videoUri:t,autoplay:o=!1}){let r=useRef(),[i,n]=useState(o);if(t.includes("youtube")){let s=t.split("v=")[1],p=s.indexOf("&");return p!==-1&&(s=s.substring(0,p)),V__default.createElement(xp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${s}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:l("youtubePlayer",e)})}if(t.includes("vimeo")){let s=t.split("vimeo.com/")[1],p=s.indexOf("&");return p!==-1&&(s=s.substring(0,p)),V__default.createElement(Cp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${s}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:l("vimeoPlayer",e)})}if(t.includes("wistia")){let s=t.split("wistia.com/medias/")[1],p=s.indexOf("&");return p!==-1&&(s=s.substring(0,p)),V__default.createElement(yp,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${s}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:l("wistiaPlayer",e)})}return V__default.createElement(fp,{className:l("videoPlayerWrapper",e),appearance:e},!i&&V__default.createElement(gp,{onClick:()=>{n(!0),r.current.play();},appearance:e,className:l("playIconWrapper",e)},V__default.createElement(Ho,null)),V__default.createElement(hp,{appearance:e,controls:i,ref:r,play:i,src:t,autoPlay:o,muted:o}))}var bp=me.div`
|
|
632
|
+
${e=>k(e)} {
|
|
620
633
|
display: flex;
|
|
621
634
|
flex-direction: column;
|
|
622
635
|
justify-content: center;
|
|
623
636
|
}
|
|
624
|
-
`,
|
|
625
|
-
${e=>
|
|
637
|
+
`,wp=me.img`
|
|
638
|
+
${e=>k(e)} {
|
|
626
639
|
width: 100%;
|
|
627
640
|
height: auto;
|
|
628
641
|
max-height: 250px;
|
|
629
642
|
margin-bottom: 24px;
|
|
630
643
|
}
|
|
631
|
-
`,
|
|
632
|
-
${e=>
|
|
644
|
+
`,Tp=me.div`
|
|
645
|
+
${e=>k(e)} {
|
|
633
646
|
margin-bottom: 24px;
|
|
634
647
|
}
|
|
635
|
-
`,
|
|
636
|
-
${e=>
|
|
648
|
+
`,Fp=me.div`
|
|
649
|
+
${e=>k(e)} {
|
|
637
650
|
width: 100%;
|
|
638
651
|
height: auto;
|
|
639
652
|
max-height: 250px;
|
|
640
653
|
margin-bottom: 24px;
|
|
641
654
|
}
|
|
642
|
-
`;function
|
|
655
|
+
`;function Ki({stepData:e,appearance:t,setCanContinue:o}){return useEffect(()=>{o(!0);},[]),V__default.createElement(bp,{className:l("callToActionContainer",t)},V__default.createElement(Tp,{className:l("callToActionTextContainer",t)},V__default.createElement(Be,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&V__default.createElement(wp,{className:l("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&V__default.createElement(Fp,{appearance:t,className:l("callToActionVideo",t)},V__default.createElement(Je,{appearance:t,videoUri:e.videoUri})))}var qi=me.div`
|
|
643
656
|
width: auto;
|
|
644
657
|
display: flex;
|
|
645
658
|
flex-direction: column;
|
|
646
659
|
justify-content: center;
|
|
647
660
|
align-items: center;
|
|
648
661
|
padding: 4px;
|
|
649
|
-
`,
|
|
662
|
+
`,Yi=me.div`
|
|
650
663
|
width: 100%;
|
|
651
664
|
text-align: left;
|
|
652
|
-
`,
|
|
665
|
+
`,Ji=me.h1`
|
|
653
666
|
font-style: normal;
|
|
654
667
|
font-weight: 700;
|
|
655
668
|
font-size: 32px;
|
|
656
669
|
line-height: 38px;
|
|
657
|
-
color: ${e=>
|
|
658
|
-
`,
|
|
670
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
671
|
+
`,Xi=me.h1`
|
|
659
672
|
font-style: normal;
|
|
660
673
|
font-weight: 400;
|
|
661
674
|
font-size: 16px;
|
|
662
675
|
line-height: 27px;
|
|
663
676
|
margin-top: 16px;
|
|
664
677
|
margin-bottom: 16px;
|
|
665
|
-
color: ${e=>
|
|
666
|
-
`,
|
|
678
|
+
color: ${e=>e.appearance?.theme?.colorTextSecondary};
|
|
679
|
+
`,Qi=me.div`
|
|
667
680
|
padding-top: 12px;
|
|
668
681
|
padding-bottom: 12px;
|
|
669
682
|
flex-direction: row;
|
|
@@ -674,26 +687,26 @@ var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnProp
|
|
|
674
687
|
cursor: pointer;
|
|
675
688
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
676
689
|
width: 100%;
|
|
677
|
-
`,
|
|
690
|
+
`,Zi=me.div`
|
|
678
691
|
padding-top: 10px;
|
|
679
692
|
padding-bottom: 10px;
|
|
680
693
|
flex-direction: row;
|
|
681
694
|
display: flex;
|
|
682
695
|
justify-content: flex-start;
|
|
683
|
-
`,
|
|
696
|
+
`,Ri=me.img`
|
|
684
697
|
width: 42px;
|
|
685
698
|
height: 42px;
|
|
686
699
|
margin-right: 12px;
|
|
687
|
-
`,
|
|
700
|
+
`,en=me.p`
|
|
688
701
|
font-style: normal;
|
|
689
702
|
font-weight: 500;
|
|
690
703
|
font-size: 17px;
|
|
691
704
|
line-height: 21px;
|
|
692
|
-
color: ${e=>
|
|
705
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
693
706
|
display: flex;
|
|
694
707
|
align-self: center;
|
|
695
|
-
`;var
|
|
696
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${Ho(l)}: ${p};`).join(" ")} }`:`${Ho(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ae({appearance:e}){if(!e||!e.styleOverrides)return Bo.createElement(Bo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Bo.createElement(Bo.Fragment,null):Bo.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ke(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:u}=ne(),c=p(e);function g(){return L(this,null,function*(){!o&&!r&&l(e)===De&&s(u(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{g()},[r,e,t]),{}}var bn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:u,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:S=!1,modalPosition:F="center",repeatable:h=!1,onDismiss:x,showPagination:k=!1,allowBackNavigation:b=!1,validationHandler:v,showFrigadeBranding:$=!1,onFormDataChange:E,showFooter:f=!0,prefillData:A={},updateUrlOnPageChange:y=!1})=>{let{getFlow:T,getFlowSteps:I,isLoading:N,targetingLogicShouldHideFlow:D,getFlowStatus:z,getCurrentStepIndex:j,markFlowCompleted:_,markFlowNotStarted:G,markStepStarted:K}=ne(),O=j(e),{mergeAppearanceWithDefault:ee}=ce(),[q,se]=Jp(null),{setOpenFlowState:Se,getOpenFlowState:ke,hasOpenModals:R}=Ie();Ke(e,i);let U=I(e);d=ee(d);let[ie,Pe]=i!==void 0&&n!==void 0?[i,n]:[ke(e,!0),H=>Se(e,H)],je=typeof window!="undefined"?window.location.hash:null;if(Sn(()=>{var H;if(U&&U.length>0&&b){let J=typeof window!="undefined"&&((H=window==null?void 0:window.location)!=null&&H.hash)?window.location.hash.replace("#",""):"";if(U&&(U==null?void 0:U.length)>0){let te=-1;if(J){let M=J;te=U.findIndex(Z=>Z.id===M),q===J&&(te=-1)}te!==-1&&(se(J),K(e,U[te].id))}}},[je]),Sn(()=>{!N&&U&&U.length&&typeof window!="undefined"&&b&&(se(U[O].id),window.location.hash=U[O].id)},[N,O,U]),N)return null;let ve=T(e);if(!ve||D(ve)||!U||i!==void 0&&i===!1||z(e)===de&&s&&!h||(o=="modal"||o=="corner-modal")&&R(e))return null;let pe=()=>{Pe(!1),x&&x(),S===!0&&_(e)};if(F=="center"&&o==="modal"||o==="large-modal"){let H={padding:"24px"};return o==="large-modal"?(H.width="85%",H.height="90%",H.maxHeight="800px",H.minHeight="500px",H.padding="0"):H.width="400px",rt.createElement(et,{appearance:d,onClose:pe,visible:ie,style:H,dismissible:g,showFrigadeBranding:$},rt.createElement(ae,{appearance:d}),rt.createElement(ir,{appearance:d,steps:U,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Pe,onDismiss:x,showPagination:k,customFormElements:l,allowBackNavigation:b,validationHandler:v,onFormDataChange:E,showFooter:f,prefillData:A,updateUrlOnPageChange:y,repeatable:h}))}return o==="modal"&&F!=="center"?rt.createElement(qo,{appearance:d,onClose:pe,visible:ie,modalPosition:F},rt.createElement(ae,{appearance:d}),rt.createElement(ir,{appearance:d,steps:U,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Pe,onDismiss:x,showPagination:k,customFormElements:l,allowBackNavigation:b,validationHandler:v,onFormDataChange:E,showFooter:f,prefillData:A,updateUrlOnPageChange:y,repeatable:h})):rt.createElement(rt.Fragment,null,rt.createElement(ae,{appearance:d}),rt.createElement(ir,{appearance:d,steps:U,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Pe,onDismiss:x,showPagination:k,customFormElements:l,allowBackNavigation:b,validationHandler:v,onFormDataChange:E,showFooter:f,prefillData:A,updateUrlOnPageChange:y,repeatable:h}))},wn=bn;import{useCallback as jr,useContext as Xp,useEffect as Qp}from"react";function Gr(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(re),{mutateUserFlowState:i}=_e(),{config:n,apiUrl:r}=Re(),l=qt(),{verifySDKInitiated:p}=Yt();function d(g,S){return`frigade-user-group-registered-${g}-${S}`}Qp(()=>{if(t&&e){if(t.startsWith(Xt))return;let g=d(t,e);localStorage.getItem(g)||(l(`${r}userGroups`,V(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let s=jr(g=>L(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,properties:g};yield l(`${r}userGroups`,V(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),u=jr((g,S)=>L(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let h={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:S}]};yield l(`${r}userGroups`,V(w({},n),{method:"POST",body:JSON.stringify(h)})),i()}),[e,t,n,i]),c=jr((g,S)=>L(this,null,function*(){if(p())if(S){let F=d(t,g);localStorage.setItem(F,"true"),o(g);let h={foreignUserId:t,foreignUserGroupId:g,properties:S};yield l(`${r}userGroups`,V(w({},n),{method:"POST",body:JSON.stringify(h)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:u}}var $t="frigade-xFrigade_guestUserId",Ao="frigade-xFrigade_userId",Tn=({})=>{let{setFlowResponses:e}=bo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=_e(),{userId:n,setUserId:r}=wo(),[l,p]=Eo(n),{getFlowStatus:d}=ne(),{flows:s,userProperties:u,setIsNewGuestUser:c,flowResponses:g}=Zp(re),[S,F]=Eo([]),[h,x]=Eo([]),{organizationId:k}=Gr(),[b,v]=Eo(k),[$,E]=Eo(!1);ro(()=>{if(!o&&t)for(let T=0;T<t.length;T++){let I=t[T],N=s.find(D=>D.slug===(I==null?void 0:I.flowId));if(N&&I&&I.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!h.includes(N.slug)){setTimeout(()=>{f(I.flowId)},500);break}}},[o,t]),ro(()=>{g.length>0&&i()},[g]),ro(()=>{$||(E(!0),i())},[o,E]);function f(T){let I=s.find(N=>N.slug===T);I&&I.triggerType==="AUTOMATIC"&&!h.includes(I.slug)&&(x([...h,I.slug]),F([I]))}function A(){if(!n){let T=localStorage.getItem(Ao);if(T){r(T);return}let I=localStorage.getItem($t);if(I){r(I);return}c(!0);let N=Xt+Rp();try{localStorage.setItem($t,N)}catch(D){console.log("Failed to save guest user id locally: Local storage unavailable",D)}r(D=>D||N)}}ro(()=>{try{if(s){let T=[];s.forEach(I=>{if(I.data){let N=I.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(D=>{let z=D.replace('"imageUri":"',"").replace('"',"");if(T.includes(z))return;let j=new Image;j.src=z,T.push(z)})}})}}catch(T){}},[s]),ro(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Xt))try{localStorage.setItem(Ao,n)}catch(T){console.log("Failed to save user id locally: Local storage available",T)}n===null&&setTimeout(()=>{n===null&&A()},50)},[n,s,u]),ro(()=>{k!=b&&(v(k),e([]),i())},[k,b,v]);function y(){return _t.createElement(_t.Fragment,null,S.map(T=>d(T.slug)!==De?null:_t.createElement("span",{key:T.slug},_t.createElement(wn,{flowId:T.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return _t.createElement(_t.Fragment,null,_t.createElement(y,null))};var Fn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Fn[o]){let n=Fn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function td(e){if(!e)return;let t=ue({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function kn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as vn}from"styled-system";import Pn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),Io=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=$e(r,["as","children","overrides"]);let l=id(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Pn.createElement(fd,w(w({as:e},p),i),t);if(o!==void 0){let s=ue(l,o);return Pn.createElement(rd,{theme:s},d())}return d()};var No={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Bn=gd(Io)(()=>({whiteSpace:"nowrap"}),hd(vn({scale:"components.Button",variants:"components.Button"}),vn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var nr={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 En=Cd(Io)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var An=4,In="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*An}${In}`]:[t,`${t*An}${In}`])),io={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"},sr={colors:V(w({},io),{neutral:{foreground:io.gray300},primary:{background:io.blue500,foreground:io.white,inverted:io.blue500},negative:{foreground:io.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:wd,components:{Button:No,Text:nr}};var On="https://api.frigade.com",re=Td({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:at,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:On,readonly:!1,debug:!1});function Fd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var kd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var ee,q,se,Se,ke,R;let r=typeof window!="undefined"?localStorage.getItem($t):null,[l,p]=qe(t||r),[d,s]=qe(o||null),[u,c]=qe([]),[g,S]=qe([]),[F,h]=qe([]),[x,k]=qe({}),[b,v]=qe({}),[$,E]=qe([]),[f,A]=qe({}),[y,T]=qe(!1),[I,N]=qe(!1),[D,z]=qe(!G(e)),j=(U,ie)=>{if(ie==="_blank"){window.open(U,"_blank");return}setTimeout(()=>{window.location.href=U},50)},_={theme:w(w({},at.theme),(q=(ee=i==null?void 0:i.defaultAppearance)==null?void 0:ee.theme)!=null?q:{}),styleOverrides:w(w({},at.styleOverrides),(Se=(se=i==null?void 0:i.defaultAppearance)==null?void 0:se.styleOverrides)!=null?Se:{})};function G(U){return!!(U&&U.length>10&&U.substring(0,10)==="api_public")}lr(()=>{t&&p(t)},[t]),lr(()=>{l&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Ao)&&window.localStorage.getItem(Ao)!==l&&Fd()},[l]),lr(()=>{o&&s(o)},[o]),lr(()=>{if(G(e))z(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or invalid."),z(!0);return}},[e,z]);let K={publicApiKey:e,userId:l,setUserId:p,setFlows:c,flows:u,failedFlowResponses:g,setFailedFlowResponses:S,flowResponses:F,setFlowResponses:h,userProperties:x,setUserProperties:k,openFlowStates:b,setOpenFlowStates:v,completedFlowsToKeepOpenDuringSession:$,setCompletedFlowsToKeepOpenDuringSession:E,customVariables:f,setCustomVariables:A,isNewGuestUser:y,setIsNewGuestUser:T,hasActiveFullPageFlow:I,setHasActiveFullPageFlow:N,organizationId:d,setOrganizationId:s,navigate:i&&i.navigate?i.navigate:j,defaultAppearance:_,shouldGracefullyDegrade:D,setShouldGracefullyDegrade:z,apiUrl:i&&i.apiUrl?i.apiUrl:On,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0},{overrides:O}=kn(_);return D?Oo.createElement(re.Provider,{value:K},Oo.createElement(Nn,{theme:ue(_.theme,sr,O!=null?O:{},(ke=i==null?void 0:i.theme)!=null?ke:{})},n)):Oo.createElement(re.Provider,{value:K},Oo.createElement(Nn,{theme:ue(_.theme,sr,O!=null?O:{},(R=i==null?void 0:i.theme)!=null?R:{})},n,Oo.createElement(Tn,null)))};import xc from"react";import Ce,{useEffect as ei,useState as sl}from"react";import Xe,{useState as Vd}from"react";import wt from"styled-components";import dr from"react";import Wt from"react";import $n from"styled-components";var Ln=$n.span`
|
|
708
|
+
`;var tn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:r})=>{let i=e.props,[n,s]=useState([]),[p,d]=useState(!1),[a,m]=useState(e.id);return useEffect(()=>{n.length==0&&!p&&(d(!0),o({choice:[]}));},[p]),useEffect(()=>{a!==e.id&&(m(e.id),s([]));},[e]),useEffect(()=>{o({choice:n}),n.length>=i.minChoices?t(!0):t(!1);},[n]),V__default.createElement(qi,{className:l("selectListContainer",r)},V__default.createElement(Yi,null,V__default.createElement(Ji,{className:l("selectListTitle",r)},e.title),V__default.createElement(Xi,{appearance:r,className:l("selectListSubtitle",r)},e.subtitle)),i.options.map((c,g)=>{let b=n.includes(c.id);return V__default.createElement(Qi,{key:`select-item-${g}`,onClick:()=>{if(n.includes(c.id)){s(n.filter(T=>T!==c.id));return}n.length<i.maxChoices?s([...n,c.id]):n.length==1&&i.maxChoices==1&&s([c.id]);},hideBottomBorder:g===i.options.length-1,className:l("selectListSelectItem",r)},V__default.createElement(Zi,{className:l("selectListItemImage",r)},c.imageUri&&V__default.createElement(Ri,{src:c.imageUri,alt:`select-icon-${g}`}),V__default.createElement(en,{appearance:r,className:l("selectListSelectItemText",r)},c.title)),V__default.createElement(tt,{appearance:r,value:b,primaryColor:r.theme.colorPrimary}))}))};var kp=({children:e,id:t,shouldWrap:o=!1})=>V__default.createElement(V__default.Fragment,null,o?V__default.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Go=({appearance:e,steps:t,selectedStep:o,customStepTypes:r,customVariables:i,onButtonClick:n,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:a,onComplete:m,setVisible:c,setShowModal:g,onDismiss:b,showPagination:T=!1,customFormElements:x,allowBackNavigation:u,validationHandler:F,onFormDataChange:C,showFooter:N,prefillData:D,updateUrlOnPageChange:w,repeatable:h})=>{let S={...{linkCollection:Gi,multiInput:Li,callToAction:Ki,selectList:tn},...r},{primaryCTAClickSideEffects:P,secondaryCTAClickSideEffects:E}=pe(),[I,L]=useState(!1),[$,G]=useState({}),[M,q]=useState(!1),[Y,B]=useState(null),H=t[o]??null,{markStepCompleted:he,markStepStarted:xe,isLoading:ae,updateCustomVariables:ce,markFlowCompleted:se}=R();useEffect(()=>{ce(i);},[i,ae]),useEffect(()=>{C&&C($,j(),t[o],o);},[$]);function j(){return {data:$[t[o].id]??{},stepId:t[o].id,customVariables:i}}function ue(z,_,O){let W=o+1<t.length?t[o+1]:null;return s&&s(z,O,W,$,j()),n?n(z,o,_,W):!0}function Ce(z,_){G(O=>{let W={};return W[z.id]=_,{...O,...W}});}function be(z){return z.selectedStep.imageUri?V__default.createElement(_i,{image:z.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let Ue=N&&V__default.createElement(ji,{step:t[o],canContinue:I&&!M,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(q(!0),F){let O=await F(t[o],o,t[o+1],$,j());if(O!==!0){B(typeof O=="string"?O:null),q(!1);return}else B(null);}let z={...j()};await he(p,t[o].id,z),o+1<t.length&&!u&&await xe(p,t[o+1].id);let _=ue(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),b&&b(),a&&_&&(c&&c(!1),g(!1)),await se(p),h&&(await xe(p,t[0].id),typeof window<"u"&&window.localStorage&&Object.keys(window.localStorage).forEach(W=>{W.startsWith(Pr)&&window.localStorage.removeItem(W);}))),P(t[o]),q(!1),typeof window<"u"&&!u&&w&&o+1<t.length){let O=new URL(window.location.href);O.searchParams.set("p",t[o+1].id),window.history.pushState({},"",O.toString());}},onSecondaryClick:()=>{ue(t[o],"secondary",o),E(t[o]);},onBack:async()=>{o-1>=0&&(q(!0),await xe(p,t[o-1].id),q(!1));},steps:t,allowBackNavigation:u,errorMessage:Y,isSaving:M});return V__default.createElement(V__default.Fragment,null,V__default.createElement(Ui,{className:l("formContainer",e)},V__default.createElement(kp,{id:o,shouldWrap:d==="large-modal"},V__default.createElement(zi,{key:H.id,type:d,className:l("formContent",e)},t.map(z=>{let _=S[z.type??"multiInput"];return H.id!==z.id?null:typeof _!="function"?_:V__default.createElement(_,{key:z.id,stepData:z,canContinue:I,setCanContinue:L,onSaveData:O=>{Ce(z,O);},appearance:e,customFormElements:x,flowId:p,prefillData:D})}),T&&V__default.createElement(Wo,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),Ue)),d=="large-modal"&&V__default.createElement(be,{selectedStep:t[o]})))};var vp=createGlobalStyle`
|
|
709
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${no}${t}.${no}${t} { ${Object.entries(o).map(([r,i])=>typeof i=="object"?`${r} { ${Object.entries(i).map(([s,p])=>`${Eo(s)}: ${p};`).join(" ")} }`:`${Eo(r)}: ${i};`).join(" ")} }`).join(" ")}`;function te({appearance:e}){if(!e||!e.styleOverrides)return V__default.createElement(V__default.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,r])=>typeof r=="object");return t.length===0?V__default.createElement(V__default.Fragment,null):V__default.createElement(vp,{inlineStyles:t})}function ze(e,t=!0){let[o,r]=useState(!1),{markStepStarted:i,isLoading:n,getFlowStatus:s,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:a,getFlow:m}=R(),c=p(e);async function g(){!o&&!n&&s(e)===Ae&&a(m(e))===!1&&t&&c&&c.length>0&&(r(!0),await i(e,c[d(e)].id));}return useEffect(()=>{g();},[n,e,t]),{}}var nn=({flowId:e,customStepTypes:t={},type:o="inline",visible:r,setVisible:i,customVariables:n,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:a=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:b=!1,modalPosition:T="center",repeatable:x=!1,onDismiss:u,showPagination:F=!1,allowBackNavigation:C=!1,validationHandler:N,showFrigadeBranding:D=!1,onFormDataChange:w,showFooter:h=!0,prefillData:v={},updateUrlOnPageChange:S=!1})=>{let{getFlow:P,getFlowSteps:E,isLoading:I,targetingLogicShouldHideFlow:L,getFlowStatus:$,getCurrentStepIndex:G,markFlowCompleted:M,markFlowNotStarted:q,markStepStarted:Y}=R(),B=G(e),{mergeAppearanceWithDefault:H}=ie(),[he,xe]=useState(null),{setOpenFlowState:ae,getOpenFlowState:ce,hasOpenModals:se}=Pe();ze(e,r);let j=E(e);d=H(d);let[ue,Ce]=r!==void 0&&i!==void 0?[r,i]:[ce(e,!0),_=>ae(e,_)],be=typeof window<"u"?window.location.hash:null;if(useEffect(()=>{if(j&&j.length>0&&C){let _=typeof window<"u"&&window?.location?.hash?window.location.hash.replace("#",""):"";if(j&&j?.length>0){let O=-1;if(_){let W=_;O=j.findIndex(oe=>oe.id===W),he===_&&(O=-1);}O!==-1&&(xe(_),Y(e,j[O].id));}}},[be]),useEffect(()=>{!I&&j&&j.length&&typeof window<"u"&&C&&(xe(j[B].id),window.location.hash=j[B].id);},[I,B,j]),I)return null;let Ue=P(e);if(!Ue||L(Ue)||!j||r!==void 0&&r===!1||$(e)===re&&a&&!x||(o=="modal"||o=="corner-modal")&&se(e))return null;let z=()=>{Ce(!1),u&&u(),b===!0&&M(e);};if(T=="center"&&o==="modal"||o==="large-modal"){let _={padding:"24px"};return o==="large-modal"?(_.width="85%",_.height="90%",_.maxHeight="800px",_.minHeight="500px",_.padding="0"):_.width="400px",V__default.createElement(qe,{appearance:d,onClose:z,visible:ue,style:_,dismissible:g,showFrigadeBranding:D},V__default.createElement(te,{appearance:d}),V__default.createElement(Go,{appearance:d,steps:j,selectedStep:B,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:i,setShowModal:Ce,onDismiss:u,showPagination:F,customFormElements:s,allowBackNavigation:C,validationHandler:N,onFormDataChange:w,showFooter:h,prefillData:v,updateUrlOnPageChange:S,repeatable:x}))}return o==="modal"&&T!=="center"?V__default.createElement(Lo,{appearance:d,onClose:z,visible:ue,modalPosition:T},V__default.createElement(te,{appearance:d}),V__default.createElement(Go,{appearance:d,steps:j,selectedStep:B,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:i,setShowModal:Ce,onDismiss:u,showPagination:F,customFormElements:s,allowBackNavigation:C,validationHandler:N,onFormDataChange:w,showFooter:h,prefillData:v,updateUrlOnPageChange:S,repeatable:x})):V__default.createElement(V__default.Fragment,null,V__default.createElement(te,{appearance:d}),V__default.createElement(Go,{appearance:d,steps:j,selectedStep:B,customStepTypes:t,customVariables:n,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:i,setShowModal:Ce,onDismiss:u,showPagination:F,customFormElements:s,allowBackNavigation:C,validationHandler:N,onFormDataChange:w,showFooter:h,prefillData:v,updateUrlOnPageChange:S,repeatable:x}))},sn=nn;function Or(){let{organizationId:e,userId:t,setOrganizationId:o}=useContext(Z),{mutateUserFlowState:r}=Oe(),{config:i,apiUrl:n}=Ke(),s=At(),{verifySDKInitiated:p}=Nt();function d(g,b){return `frigade-user-group-registered-${g}-${b}`}useEffect(()=>{if(t&&e){if(t.startsWith(Lt))return;let g=d(t,e);localStorage.getItem(g)||(s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(g,"true"));}},[t,e]);let a=useCallback(async g=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,properties:g};await s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify(b)}),r();},[e,t,i,r]),m=useCallback(async(g,b)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let x={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:b}]};await s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify(x)}),r();},[e,t,i,r]),c=useCallback(async(g,b)=>{if(p())if(b){let T=d(t,g);localStorage.setItem(T,"true"),o(g);let x={foreignUserId:t,foreignUserGroupId:g,properties:b};await s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify(x)}),r();}else o(g);},[t,i,r]);return {organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:a,trackEventForOrganization:m}}var bt="frigade-xFrigade_guestUserId",uo="frigade-xFrigade_userId",an=({})=>{let{setFlowResponses:e}=ro(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:r}=Oe(),{userId:i,setUserId:n}=io(),[s,p]=useState(i),{getFlowStatus:d}=R(),{flows:a,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=useContext(Z),[b,T]=useState([]),[x,u]=useState([]),{organizationId:F}=Or(),[C,N]=useState(F),[D,w]=useState(!1);useEffect(()=>{if(!o&&t)for(let P=0;P<t.length;P++){let E=t[P],I=a.find(L=>L.slug===E?.flowId);if(I&&E&&E.shouldTrigger===!0&&I.type=="FORM"&&I.triggerType==="AUTOMATIC"&&!x.includes(I.slug)){setTimeout(()=>{h(E.flowId);},500);break}}},[o,t]),useEffect(()=>{g.length>0&&r();},[g]),useEffect(()=>{D||(w(!0),r());},[o,w]);function h(P){let E=a.find(I=>I.slug===P);E&&E.triggerType==="AUTOMATIC"&&!x.includes(E.slug)&&(u([...x,E.slug]),T([E]));}function v(){if(!i){let P=localStorage.getItem(uo);if(P){n(P);return}let E=localStorage.getItem(bt);if(E){n(E);return}c(!0);let I=Lt+v4();try{localStorage.setItem(bt,I);}catch(L){console.log("Failed to save guest user id locally: Local storage unavailable",L);}n(L=>L||I);}}useEffect(()=>{try{if(a){let P=[];a.forEach(E=>{if(E.data){let I=E.data.match(/"imageUri":"(.*?)"/g);I&&I.forEach(L=>{let $=L.replace('"imageUri":"',"").replace('"',"");if(P.includes($))return;let G=new Image;G.src=$,P.push($);});}});}}catch{}},[a]),useEffect(()=>{if(i!==s&&(e([]),r()),p(i),i&&!i.startsWith(Lt))try{localStorage.setItem(uo,i);}catch(P){console.log("Failed to save user id locally: Local storage available",P);}i===null&&setTimeout(()=>{i===null&&v();},50);},[i,a,m]),useEffect(()=>{F!=C&&(N(F),e([]),r());},[F,C,N]);function S(){return V__default.createElement(V__default.Fragment,null,b.map(P=>d(P.slug)!==Ae?null:V__default.createElement("span",{key:P.slug},V__default.createElement(sn,{flowId:P.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return V__default.createElement(V__default.Fragment,null,V__default.createElement(S,null))};var ln={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 Dp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,r])=>{if(ln[o]){let i=ln[o].split("."),n=t;i.forEach((s,p)=>{n[s]||(n[s]=p===i.length-1?r:{}),n=n[s];});}}),t}function $p(e){if(!e)return;let t=le({},e),o={};return Object.keys(t).forEach(r=>{let i=`.fr-${r}`;o[i]=t[r];}),o}function pn(e){let{theme:t,styleOverrides:o}=e,r=Dp(t),i=$p(o);return {overrides:r,css:i}}var Yp={width:{property:"width",scale:"sizes",transform:(e,t)=>get(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},Jp=me("div")(({css:e})=>e,compose(border,color,shadow,space,typography,system(Yp))),fo=({as:e,children:t,overrides:o,...r})=>{let i=useTheme(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>V__default.createElement(Jp,{as:e,...n,...r},t);if(o!==void 0){let p=le(i,o);return V__default.createElement(ThemeProvider,{theme:p},s())}return s()};var go={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}},mn=me(fo)(()=>({whiteSpace:"nowrap"}),compose(variant({scale:"components.Button",variants:"components.Button"}),variant({prop:"size",variants:Zp})));var Ko={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 un=me(fo)(variant({scale:"components.Text",variants:"components.Text"}),system({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var fn=4,gn="px",od=20,rd=Object.fromEntries(Array.from(Array(od+1),(e,t)=>t===0?[.5,`${.5*fn}${gn}`]:[t,`${t*fn}${gn}`])),Ht={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"},qo={colors:{...Ht,neutral:{foreground:Ht.gray300},primary:{background:Ht.blue500,foreground:Ht.white,inverted:Ht.blue500},negative:{foreground:Ht.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:rd,components:{Button:go,Text:Ko}};var xn="https://api.frigade.com",Z=createContext({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:et,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:xn,readonly:!1,debug:!1});function nd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e);});}var sd=({publicApiKey:e,userId:t,organizationId:o,config:r,children:i})=>{let n=typeof window<"u"?localStorage.getItem(bt):null,[s,p]=useState(t||n),[d,a]=useState(o||null),[m,c]=useState([]),[g,b]=useState([]),[T,x]=useState([]),[u,F]=useState({}),[C,N]=useState({}),[D,w]=useState([]),[h,v]=useState({}),[S,P]=useState(!1),[E,I]=useState(!1),[L,$]=useState(!q(e)),G=(H,he)=>{if(he==="_blank"){window.open(H,"_blank");return}setTimeout(()=>{window.location.href=H;},50);},M={theme:{...et.theme,...r?.defaultAppearance?.theme??{}},styleOverrides:{...et.styleOverrides,...r?.defaultAppearance?.styleOverrides??{}}};function q(H){return !!(H&&H.length>10&&H.substring(0,10)==="api_public")}useEffect(()=>{t&&p(t);},[t]),useEffect(()=>{s&&typeof window<"u"&&window.localStorage&&window.localStorage.getItem(uo)&&window.localStorage.getItem(uo)!==s&&nd();},[s]),useEffect(()=>{o&&a(o);},[o]),useEffect(()=>{if(q(e))$(!1);else {console.error("Frigade SDK failed to initialize. API key provided is either missing or invalid."),$(!0);return}},[e,$]);let Y={publicApiKey:e,userId:s,setUserId:p,setFlows:c,flows:m,failedFlowResponses:g,setFailedFlowResponses:b,flowResponses:T,setFlowResponses:x,userProperties:u,setUserProperties:F,openFlowStates:C,setOpenFlowStates:N,completedFlowsToKeepOpenDuringSession:D,setCompletedFlowsToKeepOpenDuringSession:w,customVariables:h,setCustomVariables:v,isNewGuestUser:S,setIsNewGuestUser:P,hasActiveFullPageFlow:E,setHasActiveFullPageFlow:I,organizationId:d,setOrganizationId:a,navigate:r&&r.navigate?r.navigate:G,defaultAppearance:M,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:$,apiUrl:r&&r.apiUrl?r.apiUrl:xn,readonly:r&&r.readonly?r.readonly:!1,debug:r&&r.debug?r.debug:!1,flowDataOverrides:r&&r.__internal__?r.__internal__:void 0},{overrides:B}=pn(M);return L?V__default.createElement(Z.Provider,{value:Y},V__default.createElement(ThemeProvider,{theme:le(M.theme,qo,B??{},r?.theme??{})},i)):V__default.createElement(Z.Provider,{value:Y},V__default.createElement(ThemeProvider,{theme:le(M.theme,qo,B??{},r?.theme??{})},i,V__default.createElement(an,null)))};var Cn=me.span`
|
|
697
710
|
font-weight: 600;
|
|
698
711
|
font-size: 14px;
|
|
699
712
|
font-style: normal;
|
|
@@ -704,8 +717,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
704
717
|
vertical-align: middle;
|
|
705
718
|
margin-left: 32px;
|
|
706
719
|
padding-right: 12px;
|
|
707
|
-
${e=>
|
|
708
|
-
`,
|
|
720
|
+
${e=>Fe(e)}
|
|
721
|
+
`,ad=me.div`
|
|
709
722
|
flex-direction: row;
|
|
710
723
|
justify-content: space-between;
|
|
711
724
|
display: flex;
|
|
@@ -713,20 +726,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
713
726
|
padding-bottom: 20px;
|
|
714
727
|
padding-right: 8px;
|
|
715
728
|
width: 100%;
|
|
716
|
-
${e=>
|
|
717
|
-
`,
|
|
729
|
+
${e=>Fe(e)}
|
|
730
|
+
`,Jo=({label:e,value:t,labelStyle:o={},labelPosition:r="right",style:i,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>V__default.createElement(V__default.Fragment,null,V__default.createElement(ad,{className:l("checklistStepsContainer",p),appearance:p,styleOverrides:{...i}},r==="left"&&e&&V__default.createElement(Cn,{className:l("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),V__default.createElement(tt,{appearance:p,value:t,type:s,primaryColor:n}),r==="right"&&e&&V__default.createElement(Cn,{className:l("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),V__default.createElement(te,{appearance:p}));var Sn=me.div`
|
|
718
731
|
font-weight: 700;
|
|
719
732
|
font-size: 18px;
|
|
720
733
|
line-height: 22px;
|
|
721
|
-
`,
|
|
734
|
+
`,bn=me.p`
|
|
722
735
|
font-weight: 600;
|
|
723
736
|
font-size: 16px;
|
|
724
737
|
line-height: 24px;
|
|
725
738
|
margin: 20px 0px 0px 0px;
|
|
726
739
|
letter-spacing: 0.32px;
|
|
727
740
|
font-style: normal;
|
|
728
|
-
color: ${e=>
|
|
729
|
-
`,
|
|
741
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
742
|
+
`,wn=me.p`
|
|
730
743
|
font-weight: 400;
|
|
731
744
|
font-size: 14px;
|
|
732
745
|
font-style: normal;
|
|
@@ -734,27 +747,27 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
734
747
|
max-width: 540px;
|
|
735
748
|
letter-spacing: 0.28px;
|
|
736
749
|
margin: 8px 0px 0px 0px;
|
|
737
|
-
color: ${e=>
|
|
738
|
-
`,
|
|
750
|
+
color: ${e=>e.appearance?.theme?.colorTextSecondary};
|
|
751
|
+
`,Xo=me.div`
|
|
739
752
|
width: 6px;
|
|
740
753
|
position: absolute;
|
|
741
754
|
left: 0;
|
|
742
755
|
height: 100%;
|
|
743
756
|
border-top-right-radius: 4px;
|
|
744
757
|
border-bottom-right-radius: 4px;
|
|
745
|
-
`,
|
|
758
|
+
`,Tn=me.div`
|
|
746
759
|
flex-direction: row;
|
|
747
760
|
justify-content: flex-start;
|
|
748
761
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
749
762
|
padding-right: 16px;
|
|
750
|
-
`;var
|
|
763
|
+
`;var Fn=({data:e,index:t,isSelected:o,primaryColor:r,style:i,onClick:n,appearance:s})=>V__default.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n();}},o&&V__default.createElement(Xo,{className:l("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:s?.theme?.colorPrimary??r}}),V__default.createElement(Tn,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},V__default.createElement(Jo,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:i,primaryColor:s?.theme?.colorPrimary??r,appearance:s})));me.h1`
|
|
751
764
|
display: flex;
|
|
752
765
|
margin: 0;
|
|
753
766
|
font-size: 18px;
|
|
754
|
-
|
|
767
|
+
`;me.h2`
|
|
755
768
|
font-size: 15px;
|
|
756
769
|
color: #4d4d4d;
|
|
757
|
-
|
|
770
|
+
`;var kn=me.div`
|
|
758
771
|
position: absolute;
|
|
759
772
|
left: 0;
|
|
760
773
|
top: 0;
|
|
@@ -763,7 +776,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
763
776
|
border-radius: 20px;
|
|
764
777
|
background-color: ${e=>e.theme.colorPrimary};
|
|
765
778
|
transition: width 0.5s;
|
|
766
|
-
`,
|
|
779
|
+
`,Pn=me.div`
|
|
767
780
|
position: relative;
|
|
768
781
|
left: 0;
|
|
769
782
|
top: 0;
|
|
@@ -773,33 +786,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
773
786
|
border-radius: 20px;
|
|
774
787
|
background-color: ${e=>e.theme.colorPrimary};
|
|
775
788
|
opacity: 0.12;
|
|
776
|
-
`;var
|
|
789
|
+
`;var ld=me.div`
|
|
777
790
|
display: flex;
|
|
778
791
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
779
792
|
justify-content: flex-start;
|
|
780
793
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
781
794
|
width: 100%;
|
|
782
795
|
|
|
783
|
-
${e=>
|
|
784
|
-
`,
|
|
796
|
+
${e=>Fe(e)}
|
|
797
|
+
`,pd=me.div`
|
|
785
798
|
flex-grow: 1;
|
|
786
799
|
position: relative;
|
|
787
800
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
788
|
-
`,
|
|
801
|
+
`,dd=me.span`
|
|
789
802
|
font-weight: 600;
|
|
790
803
|
font-size: 14px;
|
|
791
804
|
line-height: 18px;
|
|
792
805
|
padding-right: ${e=>e.padding};
|
|
793
806
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
794
|
-
${e=>
|
|
795
|
-
`;var
|
|
796
|
-
border-radius: ${e=>
|
|
807
|
+
${e=>Fe(e)}
|
|
808
|
+
`;var De=({count:e,total:t,display:o="count",textLocation:r="left",style:i={},textStyle:n={},appearance:s})=>{if(t===0)return V__default.createElement(V__default.Fragment,null);Object.keys(n).length===0&&n.constructor===Object&&(n={color:s?.theme?.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",a=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${a}% complete`),r==="top"&&(m="0px"),V__default.createElement(ld,{className:l("progressBarContainer",s),textLocation:r,styleOverrides:i},V__default.createElement(dd,{className:l("progressBarStepText",s),styleOverrides:{...n,fontSize:o==="compact"?12:14,fontWeight:600},appearance:s,padding:m,textLocation:r},c),V__default.createElement(pd,{textLocation:r,className:l("progressBar",s)},V__default.createElement(kn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:s,className:l("progressBarFill",s)}),V__default.createElement(Pn,{className:l("progressBarBackground",s),barHeight:d,appearance:s})))};var Vt=({stepData:e,appearance:t})=>V__default.createElement(V__default.Fragment,null,V__default.createElement(bn,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:J(e.title)}),V__default.createElement(wn,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:J(e.subtitle)}));var jt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick();},r=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick();};return V__default.createElement(_o,{className:l("ctaContainer",t)},V__default.createElement(ee,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&V__default.createElement(ee,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:r,style:{width:"auto",marginRight:"12px"}}))};var Gt=({stepData:e,appearance:t})=>V__default.createElement(V__default.Fragment,null,V__default.createElement(Vt,{stepData:e,appearance:t}),V__default.createElement(jt,{stepData:e,appearance:t}));function vn(e){return V__default.createElement(Je,{appearance:e.appearance,videoUri:e.videoUri,autoplay:e.autoplay})}var $r="default",ud=me.img`
|
|
809
|
+
border-radius: ${e=>e.appearance?.theme.borderRadius}px;
|
|
797
810
|
width: 100%;
|
|
798
811
|
height: auto;
|
|
799
812
|
min-height: 200px;
|
|
800
|
-
`,
|
|
813
|
+
`,Bn=({stepData:e,appearance:t})=>{if(e?.StepContent){let o=e.StepContent;return V__default.createElement("div",null,o)}return V__default.createElement(Sn,{className:l("checklistStepContent",t)},e.imageUri?V__default.createElement(ud,{className:l("checklistStepImage",t),src:e.imageUri,appearance:t}):null,e.videoUri?V__default.createElement(vn,{videoUri:e.videoUri,appearance:t,autoplay:e.props?.autoplayVideo}):null,V__default.createElement(Gt,{stepData:e,appearance:t}))};var En=me.div`
|
|
801
814
|
display: block;
|
|
802
|
-
|
|
815
|
+
`,hd=me.div`
|
|
803
816
|
display: flex;
|
|
804
817
|
flex-direction: row;
|
|
805
818
|
flex-wrap: wrap;
|
|
@@ -809,20 +822,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
809
822
|
align-content: center;
|
|
810
823
|
margin-top: 24px;
|
|
811
824
|
margin-bottom: 24px;
|
|
812
|
-
`,
|
|
825
|
+
`,xd=me.div`
|
|
813
826
|
display: flex;
|
|
814
827
|
align-items: center;
|
|
815
828
|
justify-content: flex-start;
|
|
816
829
|
flex-direction: column;
|
|
817
830
|
margin-right: 16px;
|
|
818
|
-
`,
|
|
831
|
+
`,Cd=me.video`
|
|
819
832
|
width: 200px;
|
|
820
833
|
height: 120px;
|
|
821
|
-
`,
|
|
834
|
+
`,yd=me.div`
|
|
822
835
|
font-size: 14px;
|
|
823
836
|
line-height: 20px;
|
|
824
837
|
text-align: center;
|
|
825
|
-
`,
|
|
838
|
+
`,Sd=me.div`
|
|
826
839
|
position: absolute;
|
|
827
840
|
width: 200px;
|
|
828
841
|
height: 120px;
|
|
@@ -842,9 +855,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
842
855
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
843
856
|
border-radius: 50%;
|
|
844
857
|
}
|
|
845
|
-
`,
|
|
858
|
+
`,In="videoCarousel",An=({stepData:e,appearance:t})=>{if(!e.props?.videos)return V__default.createElement(En,null,V__default.createElement(Gt,{stepData:e,appearance:t}));function o({video:i}){let n=useRef(),[s,p]=useState(!1);return V__default.createElement(xd,null,!s&&V__default.createElement(Sd,{onClick:()=>{p(!0),n.current.play();},appearance:t},V__default.createElement(Ho,null)),V__default.createElement(Cd,{controls:s,ref:n,play:s,src:i.uri}),V__default.createElement(yd,null,i.title))}let r=e.props;return r.videos?V__default.createElement(En,null,V__default.createElement(Vt,{stepData:e,appearance:t}),V__default.createElement(hd,null,r.videos.map((i,n)=>V__default.createElement("span",{key:`${i.uri}-${n}`},V__default.createElement(o,{video:i})))),V__default.createElement(jt,{stepData:e,appearance:t})):null};var Nn=me.div`
|
|
846
859
|
display: block;
|
|
847
|
-
`,
|
|
860
|
+
`,bd=me.pre`
|
|
848
861
|
display: block;
|
|
849
862
|
background-color: #2a2a2a;
|
|
850
863
|
color: #f8f8f8;
|
|
@@ -860,79 +873,79 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
860
873
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
861
874
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
862
875
|
margin-bottom: 24px;
|
|
863
|
-
`,
|
|
876
|
+
`,wd=me.div`
|
|
864
877
|
font-size: 15px;
|
|
865
878
|
line-height: 20px;
|
|
866
879
|
margin-bottom: 12px;
|
|
867
880
|
margin-top: 12px;
|
|
868
|
-
`,
|
|
881
|
+
`,Td=me.div`
|
|
869
882
|
margin-top: 24px;
|
|
870
|
-
`,
|
|
883
|
+
`,On="codeSnippet",Ln=({stepData:e,appearance:t})=>{if(!e.props?.codeSnippets)return V__default.createElement(Nn,null,V__default.createElement(Gt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?V__default.createElement(Nn,{className:l("codeSnippetContainer",t)},V__default.createElement(Vt,{stepData:e,appearance:t}),V__default.createElement(Td,null,o.codeSnippets.map((r,i)=>V__default.createElement("div",{key:i},r.title?V__default.createElement(wd,{dangerouslySetInnerHTML:J(r.title)}):null,r.code?V__default.createElement(bd,null,r.code):null))),V__default.createElement(jt,{stepData:e,appearance:t})):null};var kd=me.div`
|
|
871
884
|
display: flex;
|
|
872
885
|
flex-direction: row;
|
|
873
886
|
overflow: hidden;
|
|
874
887
|
min-width: ${e=>e.type!="modal"?"600px":"100%"};
|
|
875
|
-
background: ${e=>
|
|
876
|
-
border-radius: ${e=>
|
|
877
|
-
${e=>
|
|
878
|
-
`,
|
|
888
|
+
background: ${e=>e.appearance?.theme.colorBackground};
|
|
889
|
+
border-radius: ${e=>e.appearance?.theme.borderRadius}px;
|
|
890
|
+
${e=>Fe(e)}
|
|
891
|
+
`,Pd=me.h1`
|
|
879
892
|
font-size: 18px;
|
|
880
893
|
font-style: normal;
|
|
881
894
|
font-weight: 700;
|
|
882
895
|
line-height: 24px;
|
|
883
896
|
letter-spacing: 0.36px;
|
|
884
|
-
color: ${e=>
|
|
885
|
-
`,
|
|
897
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
898
|
+
`,vd=me.h2`
|
|
886
899
|
font-size: 14px;
|
|
887
900
|
font-style: normal;
|
|
888
901
|
font-weight: 400;
|
|
889
902
|
line-height: 22px;
|
|
890
903
|
letter-spacing: 0.28px;
|
|
891
|
-
color: ${e=>
|
|
904
|
+
color: ${e=>e.appearance?.theme?.colorTextSecondary};
|
|
892
905
|
margin: 10px 0px 0px 0px;
|
|
893
|
-
`,
|
|
906
|
+
`,Bd=me.div`
|
|
894
907
|
padding: 28px 0px 28px 28px;
|
|
895
|
-
border-bottom: 1px solid ${e=>
|
|
896
|
-
`,
|
|
908
|
+
border-bottom: 1px solid ${e=>e.appearance?.theme?.colorBorder};
|
|
909
|
+
`,Ed=me.div`
|
|
897
910
|
flex: 1;
|
|
898
|
-
`,
|
|
911
|
+
`,Id=me.div`
|
|
899
912
|
list-style: none;
|
|
900
913
|
padding: 0;
|
|
901
914
|
margin: 0;
|
|
902
915
|
cursor: pointer;
|
|
903
916
|
min-width: 300px;
|
|
904
|
-
`,
|
|
917
|
+
`,Ad=me.div`
|
|
905
918
|
width: 1px;
|
|
906
919
|
margin-right: 40px;
|
|
907
|
-
background: ${e=>
|
|
908
|
-
`,
|
|
920
|
+
background: ${e=>e.appearance?.theme?.colorBorder};
|
|
921
|
+
`,Nd=me.div`
|
|
909
922
|
flex: 2;
|
|
910
923
|
padding: 40px 40px 40px 0px;
|
|
911
|
-
`,
|
|
924
|
+
`,Od=({title:e,subtitle:t,steps:o=[],style:r={},selectedStep:i,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:d,type:a})=>{let{mergeAppearanceWithDefault:m}=ie();d=m(d);let g={...{[$r]:Bn,[In]:An,[On]:Ln},...p},[b,T]=useState(0),x=i??b,u=n??T,F=o.filter(N=>N.complete===!0).length,C=()=>!o[x]?.type||!g[o[x].type]?g[$r]({stepData:o[x],appearance:d}):typeof g[o[x].type]!="function"?g[o[x].type]:g[o[x].type]({stepData:o[x],appearance:d});return V__default.createElement(kd,{type:a,styleOverrides:r,className:s,appearance:d},V__default.createElement(Ed,{className:l("checklistHeaderContainer",d),appearance:d},V__default.createElement(Bd,{className:l("checklistHeader",d),appearance:d},V__default.createElement(Pd,{className:l("checklistTitle",d),appearance:d},e),V__default.createElement(vd,{className:l("checklistSubtitle",d),appearance:d},t),V__default.createElement(De,{total:o.length,count:F,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),V__default.createElement(Id,{className:l("checklistStepsContainer",d)},o.map((N,D)=>V__default.createElement(Fn,{data:N,index:D,key:D,listLength:o.length,isSelected:D===x,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{u(D);},appearance:d})))),V__default.createElement(Ad,{appearance:d,className:l("checklistDivider",d)}),V__default.createElement(Nd,null,V__default.createElement(C,null)))},Mr=Od;var Dd=me.svg`
|
|
912
925
|
transition: 'transform 0.35s ease-in-out';
|
|
913
|
-
`,
|
|
926
|
+
`,qt=({style:e,className:t})=>V__default.createElement(Dd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},V__default.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));var Ur={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},$n=me.div`
|
|
914
927
|
max-height: 350px;
|
|
915
928
|
padding-bottom: 40px;
|
|
916
|
-
`,
|
|
929
|
+
`,Mn=me.div`
|
|
917
930
|
display: flex;
|
|
918
931
|
flex-direction: column;
|
|
919
932
|
margin-top: 20px;
|
|
920
|
-
`,
|
|
933
|
+
`,Un=me.h1`
|
|
921
934
|
font-style: normal;
|
|
922
935
|
font-weight: 600;
|
|
923
936
|
font-size: 30px;
|
|
924
937
|
line-height: 36px;
|
|
925
938
|
margin-bottom: 16px;
|
|
926
|
-
color: ${e=>
|
|
927
|
-
`,
|
|
939
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
940
|
+
`,zn=me.h2`
|
|
928
941
|
font-weight: 400;
|
|
929
942
|
font-size: 16px;
|
|
930
943
|
line-height: 20px;
|
|
931
944
|
margin-bottom: 16px;
|
|
932
945
|
padding-left: 1px;
|
|
933
|
-
color: ${e=>
|
|
934
|
-
`,
|
|
935
|
-
${e=>
|
|
946
|
+
color: ${e=>e.appearance?.theme?.colorTextSecondary};
|
|
947
|
+
`,_n=me.div`
|
|
948
|
+
${e=>k(e)} {
|
|
936
949
|
border: 1px solid #fafafa;
|
|
937
950
|
}
|
|
938
951
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -941,12 +954,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
941
954
|
flex-direction: column;
|
|
942
955
|
min-height: 240px;
|
|
943
956
|
overflow: hidden;
|
|
944
|
-
`,
|
|
957
|
+
`,Wn=me.div`
|
|
945
958
|
display: flex;
|
|
946
959
|
flex-direction: row;
|
|
947
960
|
justify-content: space-between;
|
|
948
|
-
`,
|
|
949
|
-
${e=>
|
|
961
|
+
`,Hn=me.p`
|
|
962
|
+
${e=>k(e)} {
|
|
950
963
|
font-weight: 400;
|
|
951
964
|
font-size: 10px;
|
|
952
965
|
line-height: 12px;
|
|
@@ -954,13 +967,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
954
967
|
color: #8c8c8c;
|
|
955
968
|
margin: 20px;
|
|
956
969
|
}
|
|
957
|
-
`,
|
|
970
|
+
`,Vn=me.div`
|
|
958
971
|
display: flex;
|
|
959
972
|
flex-direction: row;
|
|
960
|
-
`,
|
|
973
|
+
`,jn=me.div`
|
|
961
974
|
flex: 1;
|
|
962
|
-
`,
|
|
963
|
-
${e=>
|
|
975
|
+
`,Gn=me.div`
|
|
976
|
+
${e=>k(e)} {
|
|
964
977
|
display: flex;
|
|
965
978
|
justify-content: center;
|
|
966
979
|
align-content: center;
|
|
@@ -969,8 +982,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
969
982
|
padding-left: 8px;
|
|
970
983
|
padding-right: 8px;
|
|
971
984
|
}
|
|
972
|
-
`,
|
|
973
|
-
${e=>
|
|
985
|
+
`,Kn=me.p`
|
|
986
|
+
${e=>k(e)} {
|
|
974
987
|
font-style: normal;
|
|
975
988
|
font-weight: 600;
|
|
976
989
|
font-size: 22px;
|
|
@@ -981,8 +994,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
981
994
|
margin-top: 20px;
|
|
982
995
|
margin-bottom: 16px;
|
|
983
996
|
}
|
|
984
|
-
`,
|
|
985
|
-
${e=>
|
|
997
|
+
`,qn=me.p`
|
|
998
|
+
${e=>k(e)} {
|
|
986
999
|
font-weight: 400;
|
|
987
1000
|
font-size: 14px;
|
|
988
1001
|
line-height: 18px;
|
|
@@ -990,15 +1003,15 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
990
1003
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
991
1004
|
margin-bottom: 8px;
|
|
992
1005
|
}
|
|
993
|
-
`,
|
|
994
|
-
${e=>
|
|
1006
|
+
`,Yn=me.div`
|
|
1007
|
+
${e=>k(e)} {
|
|
995
1008
|
display: flex;
|
|
996
1009
|
flex-direction: row;
|
|
997
1010
|
justify-content: center;
|
|
998
1011
|
gap: 8px;
|
|
999
1012
|
}
|
|
1000
|
-
`,
|
|
1001
|
-
${e=>
|
|
1013
|
+
`,Jn=me.div`
|
|
1014
|
+
${e=>k(e)} {
|
|
1002
1015
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1003
1016
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
1004
1017
|
:hover {
|
|
@@ -1017,8 +1030,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1017
1030
|
justify-content: space-between;
|
|
1018
1031
|
position: relative;
|
|
1019
1032
|
cursor: pointer;
|
|
1020
|
-
`,
|
|
1021
|
-
${e=>
|
|
1033
|
+
`,Xn=me.p`
|
|
1034
|
+
${e=>k(e)} {
|
|
1022
1035
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1023
1036
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
1024
1037
|
}
|
|
@@ -1026,12 +1039,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1026
1039
|
font-size: 14px;
|
|
1027
1040
|
line-height: 22px;
|
|
1028
1041
|
margin: 0;
|
|
1029
|
-
`,
|
|
1042
|
+
`,Qn=me.div`
|
|
1030
1043
|
display: flex;
|
|
1031
1044
|
flex-direction: row;
|
|
1032
1045
|
justify-content: flex-end;
|
|
1033
1046
|
align-content: center;
|
|
1034
|
-
`,
|
|
1047
|
+
`,Zn=me.div`
|
|
1035
1048
|
display: flex;
|
|
1036
1049
|
flex: 1;
|
|
1037
1050
|
flex-direction: row;
|
|
@@ -1039,14 +1052,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1039
1052
|
align-content: center;
|
|
1040
1053
|
align-items: center;
|
|
1041
1054
|
margin-right: 20px;
|
|
1042
|
-
`,
|
|
1055
|
+
`,Rn=me.div`
|
|
1043
1056
|
display: block;
|
|
1044
1057
|
width: 100%;
|
|
1045
|
-
`;
|
|
1058
|
+
`;var es=me.div`
|
|
1046
1059
|
flex-direction: column;
|
|
1047
1060
|
justify-content: center;
|
|
1048
1061
|
display: flex;
|
|
1049
|
-
`;
|
|
1062
|
+
`;var ts=me.div`
|
|
1050
1063
|
border: 1px solid #fafafa;
|
|
1051
1064
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1052
1065
|
border-radius: 14px;
|
|
@@ -1054,14 +1067,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1054
1067
|
display: flex;
|
|
1055
1068
|
flex-direction: column;
|
|
1056
1069
|
overflow: hidden;
|
|
1057
|
-
`,
|
|
1070
|
+
`,os=me.div`
|
|
1058
1071
|
display: flex;
|
|
1059
1072
|
flex-wrap: wrap;
|
|
1060
1073
|
justify-content: space-between;
|
|
1061
1074
|
overflow: hidden;
|
|
1062
1075
|
row-gap: 10px;
|
|
1063
|
-
`,
|
|
1064
|
-
${e=>
|
|
1076
|
+
`,rs=me.div`
|
|
1077
|
+
${e=>k(e)} {
|
|
1065
1078
|
color: #595959;
|
|
1066
1079
|
}
|
|
1067
1080
|
text-transform: uppercase;
|
|
@@ -1070,8 +1083,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1070
1083
|
line-height: 12px;
|
|
1071
1084
|
letter-spacing: 0.09em;
|
|
1072
1085
|
margin-bottom: 12px;
|
|
1073
|
-
`,
|
|
1074
|
-
${e=>
|
|
1086
|
+
`,is=me.div`
|
|
1087
|
+
${e=>k(e)} {
|
|
1075
1088
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1076
1089
|
background: #ffffff;
|
|
1077
1090
|
border: 1px solid #fafafa;
|
|
@@ -1083,8 +1096,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1083
1096
|
|
|
1084
1097
|
max-width: 150px;
|
|
1085
1098
|
min-width: 200px;
|
|
1086
|
-
`,
|
|
1087
|
-
${e=>
|
|
1099
|
+
`,ns=me.div`
|
|
1100
|
+
${e=>k(e)} {
|
|
1088
1101
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1089
1102
|
}
|
|
1090
1103
|
width: 40px;
|
|
@@ -1095,14 +1108,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1095
1108
|
justify-content: center;
|
|
1096
1109
|
align-content: center;
|
|
1097
1110
|
align-items: center;
|
|
1098
|
-
`,
|
|
1111
|
+
`,ss=me.div`
|
|
1099
1112
|
font-weight: 600;
|
|
1100
1113
|
font-size: 20px;
|
|
1101
1114
|
line-height: 24px;
|
|
1102
1115
|
width: 20px;
|
|
1103
1116
|
height: 20px;
|
|
1104
|
-
`,
|
|
1105
|
-
${e=>
|
|
1117
|
+
`,as=me.div`
|
|
1118
|
+
${e=>k(e)} {
|
|
1106
1119
|
color: #434343;
|
|
1107
1120
|
}
|
|
1108
1121
|
font-weight: 600;
|
|
@@ -1110,23 +1123,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1110
1123
|
line-height: 17px;
|
|
1111
1124
|
margin-top: 12px;
|
|
1112
1125
|
margin-bottom: 8px;
|
|
1113
|
-
`,
|
|
1114
|
-
${e=>
|
|
1126
|
+
`,ls=me.div`
|
|
1127
|
+
${e=>k(e)} {
|
|
1115
1128
|
color: #8c8c8c;
|
|
1116
1129
|
}
|
|
1117
1130
|
font-weight: 400;
|
|
1118
1131
|
font-size: 12px;
|
|
1119
1132
|
line-height: 14px;
|
|
1120
|
-
`,
|
|
1133
|
+
`,ps=me.a`
|
|
1121
1134
|
color: ${e=>e.color};
|
|
1122
1135
|
font-size: 12px;
|
|
1123
1136
|
line-height: 14px;
|
|
1124
1137
|
font-weight: 400;
|
|
1125
1138
|
cursor: pointer;
|
|
1126
|
-
`;var
|
|
1127
|
-
background-color: ${e=>
|
|
1139
|
+
`;var Md=({steps:e,style:t,title:o,primaryColor:r,appearance:i,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=pe();return V__default.createElement(ts,{style:t,className:l("guideContainer",i)},V__default.createElement(rs,{className:l("guideTitle",i)},o),V__default.createElement(os,{className:l("guideItemContainer",i)},e.map((p,d)=>V__default.createElement(is,{key:`guide-${p.id??d}`,className:l("guideItem",i)},p.icon&&V__default.createElement(ns,{className:l("guideIcon",i)},V__default.createElement(ss,null,p.icon)),V__default.createElement(as,{className:l("guideItemTitle",i),dangerouslySetInnerHTML:J(p.title)}),V__default.createElement(ls,{className:l("guideItemSubtitle",i),dangerouslySetInnerHTML:J(p.subtitle)}),V__default.createElement(ps,{className:l("guideItemLink",i),color:r,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p);}},p.primaryButtonTitle)))))},yo=Md;var zd=({steps:e,title:t,subtitle:o,stepsTitle:r,visible:i,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:a,guideData:m,guideTitle:c,onGuideButtonClick:g})=>{let b=({stepData:h,handleSecondaryCTAClick:v,handleCTAClick:S})=>h?V__default.createElement(Gn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},V__default.createElement(Kn,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:J(h.title)}),V__default.createElement(qn,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:J(h.subtitle)}),V__default.createElement(Yn,{className:l("checklistCTAContainer",a)},h.secondaryButtonTitle&&V__default.createElement(ee,{title:h.secondaryButtonTitle,onClick:v,appearance:a,secondary:!0}),V__default.createElement(ee,{title:h.primaryButtonTitle,onClick:S,appearance:a}))):V__default.createElement(V__default.Fragment,null),x={...{default:h=>{if(e[C]?.StepContent){let E=e[C].StepContent;return V__default.createElement("div",null,E)}let v=e[C];return V__default.createElement(b,{stepData:h,handleCTAClick:()=>{v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick();},handleSecondaryCTAClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick();}})}},...d},[u,F]=useState(0),C=s??u,N=p??F,D=()=>e?!e[C]?.type||!x[e[C].type]?x.default(e[C]):typeof x[e[C].type]!="function"?x[e[C].type]:x[e[C].type]({stepData:e[C],primaryColor:a.theme.colorPrimary}):V__default.createElement(V__default.Fragment,null),w=e.filter(h=>h.complete).length;return i?(a.theme.modalContainer||(a.theme.borderRadius&&(Ur.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=Ur),V__default.createElement(qe,{onClose:n,visible:i,appearance:a},V__default.createElement(Rn,null,V__default.createElement(Mn,null,V__default.createElement(Un,{appearance:a,className:l("checklistTitle",a)},t),V__default.createElement(zn,{appearance:a,className:l("checklistSubtitle",a)},o)),V__default.createElement($n,null,e&&e.length>0&&V__default.createElement(_n,{className:l("stepsContainer",a)},V__default.createElement(Wn,null,V__default.createElement("div",{style:{flex:3}},V__default.createElement(Hn,{className:l("stepsTitle",a)},r)),V__default.createElement(Zn,null,V__default.createElement(De,{style:{width:"100%"},count:w,total:e.length,appearance:a}))),V__default.createElement(Vn,null,V__default.createElement(jn,{className:l("checklistStepListContainer",a),appearance:a},e.map((h,v)=>{let S=C===v;return V__default.createElement(Jn,{selected:S,className:l(`checklistStepListItem${S?"Selected":""}`,a),key:`checklist-guide-step-${h.id??v}`,disabled:h.blocked,onClick:()=>{h.blocked||N(v);},title:h.blocked?"Finish remaining steps to continue":void 0},S&&V__default.createElement(Xo,{className:l("checklistStepItemSelectedIndicator",a),layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),V__default.createElement(Xn,{selected:S,className:l(`checklistStepListStepName${S?"Selected":""}`,a)},h.stepName),V__default.createElement(Qn,null,V__default.createElement(tt,{value:h.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:h.progress,appearance:a}),V__default.createElement(es,null,V__default.createElement(qt,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),V__default.createElement(D,null))),m&&m.length>0&&V__default.createElement(yo,{steps:m,title:c,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:h=>(g&&g(h),!0)}))))):V__default.createElement(V__default.Fragment,null)},zr=zd;var ds=me.div`
|
|
1140
|
+
background-color: ${e=>e.appearance?.theme?.colorBackground};
|
|
1128
1141
|
border: 1px solid;
|
|
1129
|
-
border-color: ${e=>
|
|
1142
|
+
border-color: ${e=>e.appearance?.theme?.colorBorder};
|
|
1130
1143
|
border-radius: 6px;
|
|
1131
1144
|
padding: 2px 20px 2px 20px;
|
|
1132
1145
|
display: flex;
|
|
@@ -1135,14 +1148,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1135
1148
|
display: flex;
|
|
1136
1149
|
flex-direction: column;
|
|
1137
1150
|
transition: max-height 0.25s;
|
|
1138
|
-
`,
|
|
1151
|
+
`,cs=me.div`
|
|
1139
1152
|
display: flex;
|
|
1140
1153
|
margin-bottom: 20px;
|
|
1141
|
-
`,
|
|
1154
|
+
`,ms=me.img`
|
|
1142
1155
|
border-radius: 4px;
|
|
1143
1156
|
max-height: 260px;
|
|
1144
1157
|
min-height: 200px;
|
|
1145
|
-
`,
|
|
1158
|
+
`,us=me.div`
|
|
1146
1159
|
display: flex;
|
|
1147
1160
|
flex-direction: row;
|
|
1148
1161
|
justify-content: space-between;
|
|
@@ -1151,8 +1164,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1151
1164
|
:hover {
|
|
1152
1165
|
opacity: 0.8;
|
|
1153
1166
|
}
|
|
1154
|
-
`,
|
|
1155
|
-
color: ${e=>
|
|
1167
|
+
`,fs=me.p`
|
|
1168
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
1156
1169
|
font-style: normal;
|
|
1157
1170
|
font-weight: 500;
|
|
1158
1171
|
font-size: 16px;
|
|
@@ -1162,23 +1175,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1162
1175
|
:hover {
|
|
1163
1176
|
opacity: 0.8;
|
|
1164
1177
|
}
|
|
1165
|
-
`,
|
|
1178
|
+
`,gs=me.div`
|
|
1166
1179
|
cursor: pointer;
|
|
1167
1180
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1168
1181
|
:hover {
|
|
1169
1182
|
opacity: 0.8;
|
|
1170
1183
|
}
|
|
1171
|
-
|
|
1172
|
-
color: ${e=>
|
|
1184
|
+
`;me.div``;var hs=me.p`
|
|
1185
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
1173
1186
|
font-weight: 400;
|
|
1174
1187
|
font-size: 14px;
|
|
1175
1188
|
line-height: 22px;
|
|
1176
|
-
`,
|
|
1189
|
+
`,xs=me.div`
|
|
1177
1190
|
display: flex;
|
|
1178
1191
|
flex-direction: row;
|
|
1179
1192
|
justify-content: flex-start;
|
|
1180
1193
|
align-items: center;
|
|
1181
|
-
`;var
|
|
1194
|
+
`;var Cs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:r,onSecondaryButtonClick:i,appearance:n,customStepTypes:s})=>{let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function a(){return V__default.createElement(V__default.Fragment,null,e.imageUri||e.videoUri?V__default.createElement(cs,{className:l("stepMediaContainer",n)},e.imageUri?V__default.createElement(ms,{className:l("stepImage",n),src:e.imageUri}):null,e.videoUri?V__default.createElement(Je,{appearance:n,videoUri:e.videoUri,autoplay:e.props?.autoplayVideo}):null):null,V__default.createElement(hs,{className:l("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:J(e.subtitle)}),V__default.createElement(_o,{className:l("checklistCTAContainer",n)},e.secondaryButtonTitle?V__default.createElement(ee,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>i(),appearance:n}):null,V__default.createElement(ee,{title:e.primaryButtonTitle??"Continue",onClick:()=>r(),appearance:n})))}function m(){if(!s)return null;let c=s[e.type];return c?typeof c!="function"?c:c(e,n):null}return V__default.createElement(ds,{"data-testid":`step-${e.id}`,className:l("checklistStepContainer",n),appearance:n},V__default.createElement(us,{className:l("stepHeader",n),onClick:()=>o()},V__default.createElement(xs,{className:l("stepHeaderContent",n)},V__default.createElement(Jo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:n?.theme?.colorPrimary,appearance:n}),V__default.createElement(fs,{appearance:n,className:l("stepTitle",n),dangerouslySetInnerHTML:J(e.title)})),V__default.createElement(gs,{className:l("stepChevronContainer",n),appearance:n},V__default.createElement(qt,{style:{...p,transition:"transform 0.2s ease-in-out"}}))),V__default.createElement("div",{key:e.id,style:{...d},className:l("stepContent",n)},m()??a()))};me.div`
|
|
1182
1195
|
background: #ffffff;
|
|
1183
1196
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1184
1197
|
border-radius: 6px;
|
|
@@ -1192,50 +1205,50 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1192
1205
|
|
|
1193
1206
|
max-width: 800px;
|
|
1194
1207
|
min-width: 350px;
|
|
1195
|
-
|
|
1208
|
+
`;var ys=me.div`
|
|
1196
1209
|
display: flex;
|
|
1197
1210
|
flex-direction: column;
|
|
1198
|
-
`,
|
|
1199
|
-
color: ${e=>
|
|
1211
|
+
`,Ss=me.h1`
|
|
1212
|
+
color: ${e=>e.appearance?.theme?.colorText};
|
|
1200
1213
|
font-style: normal;
|
|
1201
1214
|
font-weight: 700;
|
|
1202
1215
|
font-size: 20px;
|
|
1203
1216
|
line-height: 24px;
|
|
1204
1217
|
margin-bottom: 8px;
|
|
1205
|
-
`,
|
|
1206
|
-
color: ${e=>
|
|
1218
|
+
`,bs=me.h2`
|
|
1219
|
+
color: ${e=>e.appearance?.theme?.colorTextSecondary};
|
|
1207
1220
|
font-weight: 400;
|
|
1208
1221
|
font-size: 14px;
|
|
1209
1222
|
line-height: 23px;
|
|
1210
1223
|
margin: 2px 0 0 0;
|
|
1211
|
-
`,
|
|
1224
|
+
`,ws=me.div`
|
|
1212
1225
|
display: block;
|
|
1213
1226
|
width: 100%;
|
|
1214
|
-
`,
|
|
1227
|
+
`,Ts=me.div`
|
|
1215
1228
|
display: flex;
|
|
1216
1229
|
width: 100%;
|
|
1217
1230
|
flex-direction: column;
|
|
1218
1231
|
justify-content: space-between;
|
|
1219
1232
|
padding: 24px;
|
|
1220
|
-
border-radius: ${e=>
|
|
1221
|
-
background-color: ${e=>
|
|
1222
|
-
`;var
|
|
1233
|
+
border-radius: ${e=>e.appearance?.theme?.borderRadius}px;
|
|
1234
|
+
background-color: ${e=>e.appearance?.theme?.colorBackground};
|
|
1235
|
+
`;var Hd=({title:e,subtitle:t,steps:o,onClose:r,visible:i,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,setSelectedStep:d,appearance:a,type:m,className:c,customStepTypes:g,style:b,onButtonClick:T})=>{let x=o.filter(w=>w.complete).length,[u,F]=useState(Array(o.length).fill(!0));useEffect(()=>{let w=[...u];if(n){for(let h=0;h<o.length;h++)if(!o[h].complete){w[h]=!1;break}F(w);}},[]);let C=w=>{let h=[...u];if(s)for(let v=0;v<u.length;++v)v!=w&&h[w]&&(h[v]=!0);h[w]=!u[w],F(h);};if(!i&&m=="modal")return V__default.createElement(V__default.Fragment,null);let N=V__default.createElement(V__default.Fragment,null,V__default.createElement(ys,null,V__default.createElement(Ss,{appearance:a,className:l("checklistTitle",a),dangerouslySetInnerHTML:J(e)}),V__default.createElement(bs,{appearance:a,className:l("checklistSubtitle",a),dangerouslySetInnerHTML:J(t)})),V__default.createElement(De,{display:"percent",count:x,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:a})),D=V__default.createElement(ws,{className:we(l("checklistContainer",a),c)},o.map((w,h)=>{let v=u[h];return V__default.createElement(Cs,{appearance:a,stepData:w,collapsed:v,key:`modal-checklist-${w.id??h}`,onClick:()=>{C(h),d(h),T&&T(o[h],h,u[h]?"expand":"collapse");},onPrimaryButtonClick:()=>{C(h),p&&h<o.length-1&&d(h+1),w.handlePrimaryButtonClick&&w.handlePrimaryButtonClick();},onSecondaryButtonClick:()=>{w.handleSecondaryButtonClick&&w.handleSecondaryButtonClick();},customStepTypes:g})}));return m==="inline"?V__default.createElement(Ts,{appearance:a,className:we(l("checklistInlineContainer",a),c),style:b},N,D):V__default.createElement(V__default.Fragment,null,V__default.createElement(qe,{onClose:r,visible:i,appearance:a,style:{maxWidth:"600px"},headerContent:N},D))},_r=Hd;var Fs=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,r]=useState(t),i=null,n=()=>{i!==null?clearTimeout(i):s(),i=setTimeout(()=>{s();},16);},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,a])=>{if(!window)return [d,!1];let m=window.matchMedia(a);return m.addEventListener("change",n),[d,m.matches]}));r(p);};return useEffect(()=>{s();},[]),o};var vs=css`
|
|
1223
1236
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1224
|
-
`,
|
|
1237
|
+
`,Gd=css`
|
|
1225
1238
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1226
|
-
`,
|
|
1239
|
+
`,Kd=keyframes`
|
|
1227
1240
|
from {
|
|
1228
1241
|
opacity: 0;
|
|
1229
1242
|
} to {
|
|
1230
1243
|
opacity: 1;
|
|
1231
1244
|
}
|
|
1232
|
-
`,
|
|
1245
|
+
`,qd=keyframes`
|
|
1233
1246
|
from {
|
|
1234
1247
|
opacity: 1;
|
|
1235
1248
|
} to {
|
|
1236
1249
|
opacity: 0;
|
|
1237
1250
|
}
|
|
1238
|
-
`,
|
|
1251
|
+
`,Bs=me.div`
|
|
1239
1252
|
margin: 0 -20px;
|
|
1240
1253
|
overflow-x: auto;
|
|
1241
1254
|
padding-left: 20px;
|
|
@@ -1252,14 +1265,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1252
1265
|
::-webkit-scrollbar {
|
|
1253
1266
|
display: none;
|
|
1254
1267
|
}
|
|
1255
|
-
`,
|
|
1268
|
+
`,Es=me.div`
|
|
1256
1269
|
display: flex;
|
|
1257
1270
|
flex-flow: row nowrap;
|
|
1258
1271
|
gap: 0 16px;
|
|
1259
1272
|
scroll-snap-align: center;
|
|
1260
1273
|
scroll-snap-stop: always;
|
|
1261
|
-
`,
|
|
1262
|
-
animation: ${e=>e.reversed?
|
|
1274
|
+
`,Is=me.div`
|
|
1275
|
+
animation: ${e=>e.reversed?qd:Kd} 0.25s ease-out;
|
|
1263
1276
|
background: linear-gradient(
|
|
1264
1277
|
to right,
|
|
1265
1278
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1268,8 +1281,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1268
1281
|
position: absolute;
|
|
1269
1282
|
width: 64px;
|
|
1270
1283
|
z-index: 10;
|
|
1271
|
-
`,
|
|
1272
|
-
${
|
|
1284
|
+
`,As=me.button`
|
|
1285
|
+
${vs}
|
|
1273
1286
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1274
1287
|
align-items: center;
|
|
1275
1288
|
border-radius: 50%;
|
|
@@ -1280,11 +1293,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1280
1293
|
justify-content: center;
|
|
1281
1294
|
position: absolute;
|
|
1282
1295
|
width: 48px;
|
|
1283
|
-
`,
|
|
1296
|
+
`,Ns=me.div`
|
|
1284
1297
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1285
1298
|
padding: 20px;
|
|
1286
|
-
`,
|
|
1287
|
-
${
|
|
1299
|
+
`,Os=me(Ns)`
|
|
1300
|
+
${vs}
|
|
1288
1301
|
background: ${({theme:e})=>e.colorBackground};
|
|
1289
1302
|
position: relative;
|
|
1290
1303
|
|
|
@@ -1296,104 +1309,104 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1296
1309
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1297
1310
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1298
1311
|
}
|
|
1299
|
-
`,
|
|
1312
|
+
`,Ls=me.img`
|
|
1300
1313
|
border-radius: 50%;
|
|
1301
1314
|
height: 40px;
|
|
1302
1315
|
margin-bottom: 12px;
|
|
1303
1316
|
width: 40px;
|
|
1304
|
-
`,
|
|
1305
|
-
${e=>
|
|
1306
|
-
${
|
|
1317
|
+
`,Ds=me(Ns)`
|
|
1318
|
+
${e=>k(e)} {
|
|
1319
|
+
${Gd}
|
|
1307
1320
|
|
|
1308
1321
|
background: ${({theme:e})=>e.colorBackground};
|
|
1309
1322
|
}
|
|
1310
|
-
|
|
1323
|
+
`;me.div`
|
|
1311
1324
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1312
1325
|
display: flex;
|
|
1313
1326
|
flex-flow: row nowrap;
|
|
1314
1327
|
align-items: center;
|
|
1315
|
-
|
|
1328
|
+
`;me.div`
|
|
1316
1329
|
white-space: nowrap;
|
|
1317
|
-
|
|
1330
|
+
`;var $s=me.div`
|
|
1318
1331
|
background: #d8fed8;
|
|
1319
1332
|
border-radius: 6px;
|
|
1320
1333
|
float: right;
|
|
1321
1334
|
margin-bottom: 12px;
|
|
1322
1335
|
padding: 4px 10px;
|
|
1323
|
-
`,
|
|
1336
|
+
`,Yd=me.p`
|
|
1324
1337
|
font-weight: bold;
|
|
1325
1338
|
font-size: 18px;
|
|
1326
1339
|
line-height: 22px;
|
|
1327
1340
|
letter-spacing: calc(18px * -0.01);
|
|
1328
1341
|
margin: 0;
|
|
1329
|
-
`,
|
|
1342
|
+
`,Ms=me(Yd)`
|
|
1330
1343
|
margin-bottom: 4px;
|
|
1331
|
-
`,
|
|
1344
|
+
`,Us=me.div`
|
|
1332
1345
|
display: flex;
|
|
1333
1346
|
flex-flow: row nowrap;
|
|
1334
1347
|
align-items: center;
|
|
1335
1348
|
min-width: 50%;
|
|
1336
|
-
`,
|
|
1349
|
+
`,Jd=me.p`
|
|
1337
1350
|
font-weight: bold;
|
|
1338
1351
|
font-size: 16px;
|
|
1339
1352
|
line-height: 20px;
|
|
1340
1353
|
letter-spacing: calc(16px * -0.01);
|
|
1341
1354
|
margin: 0;
|
|
1342
|
-
`,
|
|
1355
|
+
`,zs=me(Jd)`
|
|
1343
1356
|
margin-bottom: 4px;
|
|
1344
1357
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1345
1358
|
`}
|
|
1346
|
-
`,
|
|
1359
|
+
`,ft=me.p`
|
|
1347
1360
|
color: ${({theme:e})=>e.colorText};
|
|
1348
1361
|
font-weight: normal;
|
|
1349
1362
|
font-size: 14px;
|
|
1350
1363
|
line-height: 22px;
|
|
1351
1364
|
margin: 0;
|
|
1352
|
-
`,
|
|
1365
|
+
`,_s=me.p`
|
|
1353
1366
|
color: ${({theme:e})=>e.colorText};
|
|
1354
1367
|
font-weight: 600;
|
|
1355
1368
|
font-size: 12px;
|
|
1356
1369
|
line-height: 16px;
|
|
1357
1370
|
margin: 0;
|
|
1358
|
-
`;
|
|
1371
|
+
`;ft.Loud=me(ft)`
|
|
1359
1372
|
font-weight: 600;
|
|
1360
|
-
`;
|
|
1373
|
+
`;ft.Quiet=me(ft)`
|
|
1361
1374
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1362
1375
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1363
1376
|
`}
|
|
1364
|
-
`;var
|
|
1377
|
+
`;var Ws=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:r}=ie(),{primaryCTAClickSideEffects:i}=pe();o=r(o);let {imageUri:n=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:a=!1}=e;e.primaryButtonTitle||e.secondaryButtonTitle;let c=()=>{i(e);};return V__default.createElement(Os,{className:l("carouselCard",o),onClick:a?null:c,style:t,blocked:a,complete:d},n&&V__default.createElement(Ls,{className:l("carouselCardImage",o),src:n,alt:p,style:{opacity:d||a?.4:1}}),d&&V__default.createElement($s,{className:l("carouselCompletedPill",o)},V__default.createElement(_s,{style:{color:"#108E0B"}},"Complete")),p&&V__default.createElement(zs,{blocked:a,complete:d,className:l("carouselCardTitle",o),dangerouslySetInnerHTML:J(p)}),s&&V__default.createElement(ft.Quiet,{blocked:a,complete:d,className:l("carouselCardSubtitle",o),dangerouslySetInnerHTML:J(s)}))};var Qd=()=>V__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V__default.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),V__default.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),V__default.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Hs=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[r,i]=useState(!1),[n,s]=useState(!1);useEffect(()=>{t===!0&&r===!1?i(!0):t===!1&&r===!0&&s(!0);},[t]);let p=()=>{i(!1),s(!1);},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return r?V__default.createElement(Is,{style:d,reversed:n,onAnimationEnd:n?p:null},V__default.createElement(As,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},V__default.createElement(Qd,null))):null},Vs=({flowId:e,appearance:t,customVariables:o,className:r})=>{let i=useRef(null),[n,s]=useState(!1),[p,d]=useState(!1),[a,m]=useState(null),[c,g]=useState([]),[b,T]=useState(0),{isSmall:x}=Fs(),u=x?1:3,{getFlowMetadata:F,getFlowSteps:C,getNumberOfStepsCompleted:N,updateCustomVariables:D,isLoading:w}=R();useEffect(()=>{D(o);},[o,w]),useEffect(()=>{if(w)return;let I=F(e),L=N(e),$=C(e);m(I),(I.data!==null||I.steps!==null)&&(g($.sort((G,M)=>Number(G.complete)-Number(M.complete))),d($.length>u),T(L));},[w]);let h=[];for(let I=0;I<c.length;I+=u)h.push(c.slice(I,I+u));let v=I=>{let L=I.target,$=L.scrollWidth-L.clientWidth,G=Math.ceil(L.scrollLeft);G>0&&n===!1&&s(!0),G===0&&n===!0&&s(!1),G<$&&p===!1&&d(!0),G===$&&p===!0&&d(!1);},S=(I=!0)=>{let L=I?1:-1;i.current!==null&&i.current.scrollBy({left:i.current.clientWidth*L,behavior:"smooth"});},P=null,E=I=>{P!==null?clearTimeout(P):v(I),P=setTimeout(()=>{v(I);},16);};return w?null:V__default.createElement(Ds,{className:we(l("carouselContainer",t),r)},V__default.createElement("div",{style:{display:"flex",justifyContent:x?"center":"space-between",marginBottom:20,flexWrap:x?"wrap":"nowrap",gap:x?16:20}},V__default.createElement("div",null,V__default.createElement(Ms,{className:l("carouselTitle",t),dangerouslySetInnerHTML:J(a?.title)}),V__default.createElement(ft.Quiet,{className:l("carouselSubtitle",t),dangerouslySetInnerHTML:J(a?.subtitle)})),V__default.createElement(Us,{className:l("progressWrapper",t)},V__default.createElement(De,{count:b,total:c.length,appearance:t}))),V__default.createElement("div",{style:{position:"relative"}},V__default.createElement(Hs,{show:n,onClick:()=>S(!1)}),V__default.createElement(Hs,{side:"right",show:p,onClick:S}),V__default.createElement(Bs,{ref:i,onScroll:E},h.map((I,L)=>V__default.createElement(Es,{key:L,style:{flex:`0 0 calc(100% - ${c.length>u?36:0}px)`}},I.map(($,G)=>V__default.createElement(Ws,{key:G,stepData:$,style:{flex:c.length>u?`0 1 calc(100% / ${u} - 16px * 2 / ${u})`:1},appearance:t})))))),V__default.createElement(te,{appearance:t}))};var Vr=({flowId:e,title:t,subtitle:o,style:r,initialSelectedStep:i,className:n,type:s="inline",onDismiss:p,visible:d,customVariables:a,onStepCompletion:m,onButtonClick:c,appearance:g,hideOnFlowCompletion:b,setVisible:T,customStepTypes:x,checklistStyle:u="default",autoExpandFirstIncompleteStep:F,autoExpandNextStep:C,...N})=>{let{getFlow:D,getFlowSteps:w,markStepCompleted:h,getStepStatus:v,getNumberOfStepsCompleted:S,isLoading:P,targetingLogicShouldHideFlow:E,updateCustomVariables:I,getFlowMetadata:L,isStepBlocked:$,getFlowStatus:G,hasActiveFullPageFlow:M,setHasActiveFullPageFlow:q,markStepStarted:Y,getCurrentStepIndex:B}=R(),{primaryCTAClickSideEffects:H,secondaryCTAClickSideEffects:he}=pe(),{getOpenFlowState:xe,setOpenFlowState:ae}=Pe(),[ce,se]=useState(i||0),[j,ue]=useState(!1),Ce=d===void 0?xe(e):d,be=s==="modal",{mergeAppearanceWithDefault:Ue}=ie();ze(e,d);let z=w(e),_=B(e);if(g=Ue(g),useEffect(()=>{I(a);},[a,P]),useEffect(()=>{d!==void 0&&(be&&d===!0?q(!0):be&&d===!1&&q(!1));},[d,T,M]),useEffect(()=>{ce!==_&&se(_);},[_]),P)return null;let O=D(e);if(!O||E(O)||!z||b===!0&&G(e)===re)return null;let W=L(e);if(W?.title&&(t=W.title),W?.subtitle&&(o=W.subtitle),!j&&i===void 0&&S(e)>0){let X=z.findIndex(He=>He.complete===!1);se(X>-1?X:z.length-1),ue(!0);}function oe(){if(ce+1>=z.length){be&&ae(e,!1);return}$(e,z[ce+1].id)||se(ce+1);}function Ge(X,He,f){let y=ce+1<z.length?z[ce+1]:null;c&&c(X,ce,He,y)===!0&&be&&ye(),m&&m(X,f,y),!m&&!c&&(X.primaryButtonUri||X.secondaryButtonUri)&&be&&ye();}function eo(){return z.map((X,He)=>({...X,handleSecondaryButtonClick:()=>{oe(),he(X),X.skippable===!0&&h(e,X.id,{skipped:!0}),Ge(X,"secondary",He);},handlePrimaryButtonClick:()=>{(!X.completionCriteria&&(X.autoMarkCompleted||X.autoMarkCompleted===void 0)||X.completionCriteria&&X.autoMarkCompleted===!0)&&(h(e,X.id),oe()),Ge(X,"primary",He),H(X),v(e,X.id)===Ne&&oe();}}))}function We(){return V__default.createElement(te,{appearance:g})}let Q={steps:eo(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:x,type:s,className:n,autoExpandFirstIncompleteStep:F,autoExpandNextStep:C};function ye(){ae(e,!1),p&&p(),T&&T(!1);}function To(){return V__default.createElement(V__default.Fragment,null,V__default.createElement(We,null),V__default.createElement(Vs,{flowId:e,appearance:g,customVariables:a,className:n}))}function ar(){return V__default.createElement(V__default.Fragment,null,V__default.createElement(We,null),V__default.createElement(_r,{visible:Ce,onClose:()=>{ye();},selectedStep:ce,setSelectedStep:se,autoExpandNextStep:!0,appearance:g,onButtonClick:c,...Q}))}function Fo(){let X=N.guideFlowId,He;return X&&D(X)&&(He=w(X)),V__default.createElement(V__default.Fragment,null,V__default.createElement(We,null),V__default.createElement(zr,{visible:Ce,stepsTitle:W.stepsTitle?W.stepsTitle:"Your quick start guide",onClose:()=>{ye();},selectedStep:ce,setSelectedStep:se,guideData:He,guideTitle:N.guideTitle??"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:f=>{Ge(f,"link",0);},customStepTypes:x,...Q}))}function ko(){let X=V__default.createElement(Mr,{flowId:e,style:r,selectedStep:ce,setSelectedStep:se,appearance:g,type:s,...Q});return be?V__default.createElement(qe,{onClose:()=>{ye();},visible:Ce,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},V__default.createElement(We,null),X):V__default.createElement(V__default.Fragment,null,V__default.createElement(We,null),X)}switch(u){case"condensed":return ar();case"with-guide":return Fo();case"default":return ko();case"carousel":return To();default:return ko()}};var Rd=e=>V__default.createElement(Vr,{type:"inline",...e});var Gs=me.div`
|
|
1365
1378
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1366
1379
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1367
1380
|
padding: 10px 12px 10px 12px;
|
|
1368
1381
|
min-width: 160px;
|
|
1369
1382
|
cursor: pointer;
|
|
1370
1383
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1371
|
-
${e=>
|
|
1384
|
+
${e=>Fe(e)}
|
|
1372
1385
|
|
|
1373
1386
|
&:hover {
|
|
1374
1387
|
filter: brightness(.99);
|
|
1375
1388
|
}
|
|
1376
|
-
`,
|
|
1389
|
+
`,Ks=me.div`
|
|
1377
1390
|
display: flex;
|
|
1378
1391
|
flex-direction: row;
|
|
1379
1392
|
justify-content: space-between;
|
|
1380
1393
|
align-items: center;
|
|
1381
1394
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1382
1395
|
flex-grow: 2;
|
|
1383
|
-
`,
|
|
1396
|
+
`,qs=me.div`
|
|
1384
1397
|
text-overflow: ellipsis;
|
|
1385
1398
|
font-weight: 600;
|
|
1386
1399
|
font-size: 14px;
|
|
1387
1400
|
line-height: 16px;
|
|
1388
1401
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1389
1402
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1390
|
-
`,
|
|
1403
|
+
`,Ys=me.div`
|
|
1391
1404
|
width: 20px;
|
|
1392
1405
|
margin-right: 8px;
|
|
1393
1406
|
display: flex;
|
|
1394
1407
|
height: 100%;
|
|
1395
1408
|
align-items: center;
|
|
1396
|
-
`;var
|
|
1409
|
+
`;var Js=({title:e,count:t,total:o,onClick:r,style:i={},className:n,appearance:s,type:p="default"})=>V__default.createElement(V__default.Fragment,null,V__default.createElement(te,{appearance:s}),V__default.createElement(Gs,{onClick:()=>r!==void 0&&r(),styleOverrides:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...i},className:we(n??"",l("progressBadgeContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&V__default.createElement(Ys,{className:l("progressRingContainer",s)},V__default.createElement($t,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),V__default.createElement(Ks,{type:p,className:l("badgeTitleContainer",s)},V__default.createElement(qs,{type:p,appearance:s,className:l("badgeTitle",s)},e),r!==void 0&&V__default.createElement(qt,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&V__default.createElement(De,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));var Xs=me.div`
|
|
1397
1410
|
display: flex;
|
|
1398
1411
|
flex-direction: row;
|
|
1399
1412
|
width: 100%;
|
|
@@ -1403,25 +1416,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1403
1416
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1404
1417
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1405
1418
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1406
|
-
`,
|
|
1407
|
-
${e=>
|
|
1419
|
+
`,Qs=me.div`
|
|
1420
|
+
${e=>k(e)} {
|
|
1408
1421
|
display: flex;
|
|
1409
1422
|
justify-content: center;
|
|
1410
1423
|
align-items: center;
|
|
1411
1424
|
margin-right: 16px;
|
|
1412
1425
|
}
|
|
1413
|
-
`,
|
|
1426
|
+
`,Zs=me.div`
|
|
1414
1427
|
display: flex;
|
|
1415
1428
|
flex-direction: column;
|
|
1416
1429
|
flex: 1;
|
|
1417
1430
|
margin-top: 0;
|
|
1418
|
-
`,
|
|
1431
|
+
`,Rs=me.div`
|
|
1419
1432
|
display: flex;
|
|
1420
1433
|
flex-direction: column;
|
|
1421
1434
|
justify-content: center;
|
|
1422
1435
|
margin-left: 16px;
|
|
1423
1436
|
min-width: 200px;
|
|
1424
|
-
|
|
1437
|
+
`;me.div`
|
|
1425
1438
|
display: flex;
|
|
1426
1439
|
justify-content: center;
|
|
1427
1440
|
align-items: flex-end;
|
|
@@ -1430,7 +1443,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1430
1443
|
:hover {
|
|
1431
1444
|
opacity: 0.8;
|
|
1432
1445
|
}
|
|
1433
|
-
`;var
|
|
1446
|
+
`;var ea=({title:e,subtitle:t,icon:o,appearance:r,count:i,total:n,className:s,style:p,onClick:d})=>V__default.createElement(V__default.Fragment,null,V__default.createElement(Xs,{appearance:r,className:we(l("fullWidthProgressBadgeContainer",r),s??""),style:p,onClick:()=>d!==void 0&&d()},o&&V__default.createElement(Qs,{className:l("fullWidthProgressBadgeIcon",r)},o),V__default.createElement(Zs,null,V__default.createElement(Be,{size:"small",appearance:r,title:e,subtitle:t})),V__default.createElement(Rs,{className:l("fullWidthProgressBadgeProgressContainer",r)},V__default.createElement(De,{count:i,total:n,display:"percent",textLocation:"top"}))));var tc=({flowId:e,title:t,subtitle:o,icon:r,style:i,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:a,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:b,getNumberOfStepsCompleted:T,isLoading:x,targetingLogicShouldHideFlow:u,updateCustomVariables:F}=R(),{mergeAppearanceWithDefault:C}=ie();a=C(a);let{setOpenFlowState:N,getOpenFlowState:D}=Pe();if(useEffect(()=>{F(p);},[p,x]),x)return null;let w=c(e);if(!w||u(w)||d===!0&&b(e)===re)return null;let h=g(e),v=T(e);return m==="full-width"?V__default.createElement(V__default.Fragment,null,V__default.createElement(te,{appearance:a}),V__default.createElement(ea,{title:t,subtitle:o,count:v,total:h.length,style:i,className:s,appearance:a,icon:r,onClick:n})):V__default.createElement(V__default.Fragment,null,V__default.createElement(te,{appearance:a}),V__default.createElement(Js,{count:v,total:h.length,title:t,style:i,onClick:()=>{N(e,!0),n&&n();},type:m,className:s,appearance:a}))};var rc=({flowId:e,style:t,appearance:o,...r})=>{let{getFlow:i,targetingLogicShouldHideFlow:n,getFlowSteps:s}=R(),{mergeAppearanceWithDefault:p}=ie();o=p(o);let d=i(e);if(!d||n(d))return null;let a=s(e);return V__default.createElement(yo,{steps:a,style:t,appearance:o,...r})};var jr=(e,t,o,r={x:20,y:20},i)=>{let n=i=="fixed"?0:window.scrollY,s=i=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+r.x+s,y:e.top-r.y+n}:t==="right"?{x:e.left+e.width+r.x+s,y:e.top-r.y+n}:{x:0,y:0}};function ta(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:()=>{}},[r,i]=useState(o),n=useCallback(()=>{e&&i(e.getBoundingClientRect());},[e]);return useEffect(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),r}function oa(){let{debug:e}=useContext(Z),[t,o]=useState([]);function r(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.log(n)));}function i(n){e&&(t.find(s=>s===n)||(o([...t,n]),console.warn(n)));}return {logIfDebugMode:r,logErrorIfDebugMode:i}}var ia=300,na=100,dc=500,Zt=12,cc=me.div`
|
|
1434
1447
|
width: 100%;
|
|
1435
1448
|
height: 100%;
|
|
1436
1449
|
border-radius: 9999px;
|
|
@@ -1453,26 +1466,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1453
1466
|
opacity: 0;
|
|
1454
1467
|
}
|
|
1455
1468
|
}
|
|
1456
|
-
`,
|
|
1457
|
-
width: ${
|
|
1458
|
-
height: ${
|
|
1469
|
+
`,mc=me.div`
|
|
1470
|
+
width: ${Zt}px;
|
|
1471
|
+
height: ${Zt}px;
|
|
1459
1472
|
border-radius: 100px;
|
|
1460
1473
|
background-color: ${e=>e.primaryColor};
|
|
1461
1474
|
z-index: 20;
|
|
1462
1475
|
opacity: 1;
|
|
1463
|
-
`,
|
|
1476
|
+
`,uc=me.div`
|
|
1464
1477
|
pointer-events: all;
|
|
1465
|
-
`,
|
|
1478
|
+
`,sa=me.div`
|
|
1466
1479
|
display: flex;
|
|
1467
1480
|
align-content: center;
|
|
1468
1481
|
justify-content: center;
|
|
1469
1482
|
align-items: center;
|
|
1470
1483
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1471
|
-
`,
|
|
1472
|
-
width: ${
|
|
1473
|
-
height: ${
|
|
1474
|
-
`,
|
|
1475
|
-
${e=>
|
|
1484
|
+
`,fc=me(sa)`
|
|
1485
|
+
width: ${Zt+12}px;
|
|
1486
|
+
height: ${Zt+12}px;
|
|
1487
|
+
`,gc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:r="auto",showHighlight:i=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:a=0,customStepTypes:m,appearance:c,dismissible:g=!1,showHighlightOnly:b,showStepCount:T=!0,completedStepsCount:x=0,showFrigadeBranding:u=!1,cssPosition:F="absolute",onViewTooltip:C,className:N})=>{let{logErrorIfDebugMode:D}=oa(),[w,h]=useState(),[v,S]=useState(new Date),P=useRef(null),[E,I]=useState(document.querySelector(e[a].selector)),L=ta(E,v),[$,G]=useState(),[M,q]=useState(!b),Y=e[a]?.props?.position?e[a].props.position:F,B=e[a]?.props?.zIndex??90,H=w?.width??ia,he=w?.height??na,[xe,ae]=useState(new Date().getTime());s=e[a]?.props?.offset??s;let ce=window.location.pathname.split("/").pop();useLayoutEffect(()=>{P.current&&h({width:P.current.clientWidth,height:P.current.clientHeight});},[a,v,Y]),useEffect(()=>{b||q(!0);},[a]),useEffect(()=>{p&&M&&C(a);},[M]);let se=()=>{if(Y==="static")return;let Q=document.querySelector(e[a].selector);if(!Q){G(void 0),I(null),D(`FrigadeTour: Could not find element with selector "${e[a].selector}" for step ${e[a].id}`);return}$&&$===JSON.stringify(Q?.getBoundingClientRect())||(I(Q),S(new Date),Q&&G(JSON.stringify(Q.getBoundingClientRect())));};if(useEffect(()=>{let Q=new MutationObserver(se);return Q.observe(document.body,{subtree:!0,childList:!0}),()=>Q.disconnect()},[se]),useEffect(()=>{let Q=new MutationObserver(se);return Q.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>Q.disconnect()},[se]),useEffect(()=>{let Q=setInterval(()=>{se();},10);return ()=>clearInterval(Q)},[se]),useLayoutEffect(()=>{setTimeout(()=>{se();},dc),se();},[a,ce]),useEffect(()=>{if(!p)return;let Q=ye=>{ye.key==="Escape"&&t();};return document.addEventListener("keydown",Q),()=>{document.removeEventListener("keydown",Q);}},[]),E===null||!p)return null;let j=r==="auto"?"right":r,ue=jr(L,j,H,s,Y),Ce=L.right+H>(window.innerWidth||document.documentElement.clientWidth);L.bottom+na>(window.innerHeight||document.documentElement.clientHeight);Ce&&r==="auto"&&(ue=jr(L,"left",H,s,Y),j="left"),e[a]?.props?.tooltipPosition&&e[a]?.props?.tooltipPosition!=="auto"&&(e[a]?.props?.tooltipPosition==="left"||e[a]?.props?.tooltipPosition==="right")&&(j=e[a].props.tooltipPosition);let Ue=()=>{let Q=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),q(!1),setTimeout(()=>{se();},30)),x===e.length-1)return o()},ye=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),b&&!e[a].secondaryButtonUri&&q(!1));};return V__default.createElement(V__default.Fragment,null,T&&e.length>1&&V__default.createElement(di,null,V__default.createElement(mi,{role:"status",className:l("tooltipStepCounter",c)},a+1," of ",e.length)),(e[a].primaryButtonTitle||e[a].secondaryButtonTitle)&&V__default.createElement(ci,{showStepCount:T,className:l("tooltipCTAContainer",c)},e[a].secondaryButtonTitle&&V__default.createElement(ee,{title:e[a].secondaryButtonTitle,appearance:c,onClick:ye,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&V__default.createElement(ee,{title:e[a].primaryButtonTitle,appearance:c,onClick:Q,autoFocus:!0,withMargin:!1,size:"small"})))},z=()=>V__default.createElement(V__default.Fragment,null,g&&V__default.createElement(ni,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t();},className:l("tooltipClose",c),hasImage:!!e[a].imageUri||!!e[a].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},V__default.createElement(ve,null)),e[a].imageUri&&V__default.createElement(si,{dismissible:g,appearance:c,role:"img","aria-label":e[a].title,src:e[a].imageUri,className:l("tooltipImageContainer",c)}),e[a].videoUri&&!e[a].imageUri&&V__default.createElement(ai,{dismissible:g,appearance:c,role:"video","aria-label":e[a].title,className:l("tooltipVideoContainer",c)},V__default.createElement(Je,{appearance:c,videoUri:e[a].videoUri,autoplay:e[a].props?.autoplayVideo})),V__default.createElement(pi,{className:l("tooltipContentContainer",c)},V__default.createElement(Be,{appearance:c,title:e[a].title,subtitle:e[a].subtitle,size:"small",ariaPrefix:`Tooltip${e[a].id}`}),V__default.createElement(li,{className:l("tooltipFooter",c)},V__default.createElement(Ue,null)))),O={...{default:Q=>{if(e[a]?.StepContent){let ye=e[a].StepContent;return V__default.createElement("div",null,ye)}return V__default.createElement(z,null)}},...m},W=()=>e?!e[a]?.type||!O[e[a].type]?O.default(e[a]):O[e[a].type]({stepData:e[a],primaryColor:n}):V__default.createElement(V__default.Fragment,null);if(e[a].complete===!0||ue.x==0&&ue.y==0&&new Date().getTime()-xe<100)return null;let oe={top:ue?.y-Zt,left:(j=="left"?L.x+s.x:ue?.x-Zt)??0,cursor:b?"pointer":"default",position:Y},Ge=()=>{let ye=oe.left+(j=="left"?-H:24);return Math.min(Math.max(ye,20),window.innerWidth-H-20)},eo=()=>{if(Y==="fixed")return oe.top;let Q=oe.top+he,ye=20;return Q>window.innerHeight-ye?oe.top+-he:oe.top},We=()=>{b&&(S(new Date),q(!M));};return V__default.createElement(uc,{className:N},V__default.createElement(fc,{style:oe,zIndex:B,className:l("tourHighlightContainer",c)},i&&e[a].showHighlight!==!1&&F!=="static"&&V__default.createElement(V__default.Fragment,null,V__default.createElement(mc,{style:{position:Y},onClick:We,primaryColor:c.theme.colorPrimary,className:l("tourHighlightInnerCircle",c)}),V__default.createElement(cc,{style:{position:"absolute"},onClick:We,primaryColor:c.theme.colorPrimary,className:l("tourHighlightOuterCircle",c)}))),V__default.createElement(sa,{style:{...oe,left:Ge(),top:eo()},zIndex:B+1,className:l("tooltipContainerWrapper",c)},M&&V__default.createElement(V__default.Fragment,null,V__default.createElement(Io,{ref:P,role:"dialog","aria-labelledby":`frigadeTooltip${e[a].id}Title`,"aria-describedby":`frigadeTooltip${e[a].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:{position:"relative",width:"max-content",right:0,top:F!=="static"?12:0,...d},appearance:c,className:l("tooltipContainer",c),maxWidth:ia,zIndex:B+10},V__default.createElement(W,null)),u&&V__default.createElement(fi,{className:l("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:B+10},V__default.createElement(Ao,{appearance:c})))))},wo=gc;var yc=({flowId:e,customVariables:t,appearance:o,onStepCompletion:r,onButtonClick:i,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:a=!1,dismissBehavior:m="skip-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:b="absolute",className:T,...x})=>{let{getFlow:u,getFlowSteps:F,isLoading:C,targetingLogicShouldHideFlow:N,markStepCompleted:D,markStepStarted:w,markFlowCompleted:h,markFlowSkipped:v,updateCustomVariables:S,getCurrentStepIndex:P,getStepStatus:E,isStepBlocked:I,getFlowStatus:L,getNumberOfStepsCompleted:$}=R(),{isLoadingUserFlowStateData:G}=Oe(),{primaryCTAClickSideEffects:M,secondaryCTAClickSideEffects:q}=pe(),{hasOpenModals:Y}=Pe(),B=P(e),{openFlowStates:H}=useContext(Z),{mergeAppearanceWithDefault:he}=ie();if(o=he(o),useEffect(()=>{S(t);},[t,C]),G)return null;let xe=u(e);if(!xe||N(xe)||L(e)==re||Y())return null;let ae=F(e);if(Object.keys(H).length>0){let O=Object.keys(H).find(W=>H[W]===!0);if(O!==void 0&&O!==e)return V__default.createElement(V__default.Fragment,null)}async function ce(O){if(await D(e,O.id),ae.map(W=>E(e,W.id)).every(W=>W===Ne)){await h(e);return}!a&&B+1<ae.length&&!n&&I(e,ae[B+1].id);}function se(O,W,oe){let Ge=B+1<ae.length?ae[B+1]:null;i&&i(O,B,W,Ge),r&&r(O,oe,Ge);}function j(){return ae.map(O=>({...O,handleSecondaryButtonClick:async()=>{q(O),O.skippable===!0&&await D(e,O.id,{skipped:!0}),se(O,"secondary",B);},handlePrimaryButtonClick:async()=>{(!O.completionCriteria&&(O.autoMarkCompleted||O.autoMarkCompleted===void 0)||O.completionCriteria&&O.autoMarkCompleted===!0)&&await ce(O),se(O,"primary",B),M(O);}}))}async function ue(O){s&&s(),m==="skip-flow"?await v(e):await D(e,O.id);}function Ce(){c&&c();}async function be(O){await w(e,ae[O].id);}let Ue=!document.querySelector(ae[B].selector);function z(){let O=ae.findIndex((W,oe)=>!!document.querySelector(W.selector)&&oe>=B);return ae.map((W,oe)=>n?V__default.createElement(wo,{key:W.id,appearance:o,steps:j(),selectedStep:oe,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>ue(W),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:$(e),onComplete:Ce,cssPosition:b,onViewTooltip:be,className:T,...x}):g&&Ue&&oe===O?V__default.createElement(wo,{key:W.id,appearance:o,steps:j(),selectedStep:oe,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>ue(W),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:$(e),onComplete:Ce,cssPosition:b,onViewTooltip:be,className:T,...x}):oe!=B?null:V__default.createElement(wo,{key:W.id,appearance:o,steps:j(),selectedStep:oe,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>ue(W),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:$(e),onComplete:Ce,cssPosition:b,onViewTooltip:be,className:T,...x}))}function _(){return V__default.createElement(V__default.Fragment,null,V__default.createElement(te,{appearance:o}),z())}return b==="static"?_():V__default.createElement(Portal,null,_())};var aa=me.button`
|
|
1488
|
+
${e=>k(e)} {
|
|
1476
1489
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1477
1490
|
|
|
1478
1491
|
display: flex;
|
|
@@ -1489,17 +1502,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1489
1502
|
opacity: 0.8;
|
|
1490
1503
|
}
|
|
1491
1504
|
}
|
|
1492
|
-
`,
|
|
1493
|
-
${e=>
|
|
1505
|
+
`,la=me.span`
|
|
1506
|
+
${e=>k(e)} {
|
|
1494
1507
|
font-size: 12px;
|
|
1495
1508
|
display: inline-block;
|
|
1496
1509
|
}
|
|
1497
|
-
`,
|
|
1498
|
-
${e=>
|
|
1510
|
+
`,pa=me.span`
|
|
1511
|
+
${e=>k(e)} {
|
|
1499
1512
|
font-size: 12px;
|
|
1500
1513
|
display: inline-block;
|
|
1501
1514
|
}
|
|
1502
|
-
`,
|
|
1515
|
+
`,da=me.div`
|
|
1503
1516
|
position: fixed;
|
|
1504
1517
|
right: 0;
|
|
1505
1518
|
bottom: 0;
|
|
@@ -1509,8 +1522,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1509
1522
|
flex-direction: column;
|
|
1510
1523
|
align-items: flex-end;
|
|
1511
1524
|
z-index: 50;
|
|
1512
|
-
`,
|
|
1513
|
-
${e=>
|
|
1525
|
+
`,ca=me.button`
|
|
1526
|
+
${e=>k(e)} {
|
|
1514
1527
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1515
1528
|
background-color: #ffffff;
|
|
1516
1529
|
border: 1px solid #f5f5f5;
|
|
@@ -1525,8 +1538,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1525
1538
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1526
1539
|
border-radius: 45px;
|
|
1527
1540
|
cursor: pointer;
|
|
1528
|
-
`,
|
|
1529
|
-
${e=>
|
|
1541
|
+
`,ma=me.div`
|
|
1542
|
+
${e=>k(e)} {
|
|
1530
1543
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1531
1544
|
background: #ffffff;
|
|
1532
1545
|
}
|
|
@@ -1542,8 +1555,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1542
1555
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1543
1556
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1544
1557
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1545
|
-
`,
|
|
1546
|
-
${e=>
|
|
1558
|
+
`,ua=me.button`
|
|
1559
|
+
${e=>k(e)} {
|
|
1547
1560
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1548
1561
|
color: #434343;
|
|
1549
1562
|
:hover {
|
|
@@ -1559,8 +1572,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1559
1572
|
font-size: 14px;
|
|
1560
1573
|
|
|
1561
1574
|
padding: 8px 12px;
|
|
1562
|
-
`;
|
|
1563
|
-
${e=>
|
|
1575
|
+
`;var ga=({style:e,className:t})=>V__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},V__default.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"}));var xa=({style:e,className:t})=>V__default.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"},V__default.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 Fc=({flowId:e,style:t,onStepCompletion:o,visible:r=!0,type:i="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:a,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:b}=R(),{primaryCTAClickSideEffects:T}=pe(),x=useRef(null),[u,F]=useState(!1),{mergeAppearanceWithDefault:C}=ie();s=C(s),useEffect(()=>(document.addEventListener("click",N,!1),()=>{document.removeEventListener("click",N,!1);}),[]);let N=S=>{x.current&&!x.current.contains(S.target)&&F(!1);};if(g)return null;let D=p(e);if(!D||b(D))return null;let w=d(e);if(!w||!r)return null;function h(S,P){!S.completionCriteria&&(S.autoMarkCompleted||S.autoMarkCompleted===void 0)&&a(e,S.id),T(S),o&&o(S,P),F(!1);}function v(){return u&&V__default.createElement(ma,{className:l("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:i},w.map((S,P)=>V__default.createElement(ua,{className:l("floatingWidgetMenuItem",s),key:P,onClick:()=>h(S,P)},S.title)))}return i=="inline"?V__default.createElement("span",{ref:x},V__default.createElement(te,{appearance:s}),V__default.createElement(aa,{style:t,onClick:()=>{F(!u);},className:l("supportButton",s)},V__default.createElement(pa,{className:l("supportIconContainer",s)},V__default.createElement(xa,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),V__default.createElement(la,{className:l("supportButtonTitle",s)},n)),V__default.createElement(v,null)):V__default.createElement(Portal,null,V__default.createElement(te,{appearance:s}),V__default.createElement(da,{style:t,ref:x},V__default.createElement(v,null),V__default.createElement(ca,{onClick:()=>{F(!u);},whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},V__default.createElement(ga,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};var Ca=me.div`
|
|
1576
|
+
${e=>k(e)} {
|
|
1564
1577
|
display: flex;
|
|
1565
1578
|
flex-direction: column;
|
|
1566
1579
|
width: 100%;
|
|
@@ -1574,19 +1587,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1574
1587
|
border-radius: 12px;
|
|
1575
1588
|
position: relative;
|
|
1576
1589
|
}
|
|
1577
|
-
|
|
1590
|
+
`,ya=me.div`
|
|
1578
1591
|
display: flex;
|
|
1579
1592
|
flex-direction: column;
|
|
1580
1593
|
flex: 1;
|
|
1581
|
-
`,
|
|
1594
|
+
`,Sa=me.div`
|
|
1582
1595
|
display: flex;
|
|
1583
1596
|
flex-direction: row;
|
|
1584
1597
|
justify-content: flex-start;
|
|
1585
1598
|
align-items: center;
|
|
1586
1599
|
margin-top: 16px;
|
|
1587
1600
|
gap: 12px;
|
|
1588
|
-
`,
|
|
1589
|
-
${e=>
|
|
1601
|
+
`,ba=me.div`
|
|
1602
|
+
${e=>k(e)} {
|
|
1590
1603
|
position: absolute;
|
|
1591
1604
|
top: 16px;
|
|
1592
1605
|
right: 16px;
|
|
@@ -1596,8 +1609,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1596
1609
|
opacity: 0.8;
|
|
1597
1610
|
}
|
|
1598
1611
|
}
|
|
1599
|
-
`;
|
|
1600
|
-
${e=>
|
|
1612
|
+
`;var wa=me.div`
|
|
1613
|
+
${e=>k(e)} {
|
|
1601
1614
|
display: flex;
|
|
1602
1615
|
flex-direction: column;
|
|
1603
1616
|
width: 100%;
|
|
@@ -1607,29 +1620,29 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1607
1620
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1608
1621
|
position: relative;
|
|
1609
1622
|
}
|
|
1610
|
-
`,
|
|
1623
|
+
`,Ta=me.div`
|
|
1611
1624
|
display: flex;
|
|
1612
1625
|
flex-direction: column;
|
|
1613
1626
|
flex: 1;
|
|
1614
|
-
`,
|
|
1627
|
+
`,Fa=me.div`
|
|
1615
1628
|
display: flex;
|
|
1616
1629
|
flex-direction: column;
|
|
1617
1630
|
justify-content: center;
|
|
1618
1631
|
align-items: center;
|
|
1619
1632
|
margin-bottom: 12px;
|
|
1620
1633
|
margin-top: 4px;
|
|
1621
|
-
`,
|
|
1634
|
+
`,ka=me.div`
|
|
1622
1635
|
display: flex;
|
|
1623
1636
|
flex-direction: row;
|
|
1624
1637
|
justify-content: center;
|
|
1625
1638
|
align-items: stretch;
|
|
1626
1639
|
gap: 16px;
|
|
1627
1640
|
margin-top: 8px;
|
|
1628
|
-
`,
|
|
1641
|
+
`,ir=me.div`
|
|
1629
1642
|
margin-top: 16px;
|
|
1630
1643
|
margin-bottom: 16px;
|
|
1631
|
-
`,
|
|
1632
|
-
${e=>
|
|
1644
|
+
`,Pa=me.div`
|
|
1645
|
+
${e=>k(e)} {
|
|
1633
1646
|
position: absolute;
|
|
1634
1647
|
top: -16px;
|
|
1635
1648
|
right: -16px;
|
|
@@ -1639,8 +1652,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1639
1652
|
opacity: 0.8;
|
|
1640
1653
|
}
|
|
1641
1654
|
}
|
|
1642
|
-
`,
|
|
1643
|
-
${e=>
|
|
1655
|
+
`,va=me.h1`
|
|
1656
|
+
${e=>k(e)} {
|
|
1644
1657
|
font-style: normal;
|
|
1645
1658
|
justify-content: center;
|
|
1646
1659
|
text-align: center;
|
|
@@ -1653,8 +1666,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1653
1666
|
color: ${e=>e.appearance.theme.colorText};
|
|
1654
1667
|
margin-bottom: 8px;
|
|
1655
1668
|
}
|
|
1656
|
-
`,
|
|
1657
|
-
${e=>
|
|
1669
|
+
`,Ba=me.h2`
|
|
1670
|
+
${e=>k(e)} {
|
|
1658
1671
|
font-style: normal;
|
|
1659
1672
|
justify-content: center;
|
|
1660
1673
|
text-align: center;
|
|
@@ -1665,14 +1678,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1665
1678
|
letter-spacing: 0.28px;
|
|
1666
1679
|
margin-bottom: 8px;
|
|
1667
1680
|
}
|
|
1668
|
-
`;
|
|
1681
|
+
`;var Pc=me.img`
|
|
1669
1682
|
width: 100%;
|
|
1670
1683
|
height: 100%;
|
|
1671
1684
|
min-height: 200px;
|
|
1672
1685
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1673
|
-
`;function
|
|
1686
|
+
`;function nr({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?V__default.createElement(Je,{appearance:t,videoUri:e.videoUri,autoplay:e.props?.autoplayVideo}):e.imageUri?V__default.createElement(Pc,{className:l(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Bc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:i,className:n,style:s,dismissible:p,onClick:d})=>{let{getFlow:a,markFlowCompleted:m,markFlowSkipped:c,markStepCompleted:g,isLoading:b,targetingLogicShouldHideFlow:T,updateCustomVariables:x,getFlowSteps:u,getFlowStatus:F,getCurrentStepIndex:C}=R(),{primaryCTAClickSideEffects:N,secondaryCTAClickSideEffects:D}=pe(),{mergeAppearanceWithDefault:w}=ie();if(ze(e),i=w(i),useEffect(()=>{x(o);},[o,b]),b)return null;let h=a(e);if(!h||T(h)||F(e)===re)return null;let S=u(e)[C(e)];return V__default.createElement(V__default.Fragment,null,V__default.createElement(te,{appearance:i}),V__default.createElement(Ca,{appearance:i,className:we(l("embeddedTipContainer",i),n),style:s,onClick:d},(p===!0||S.dismissible)&&V__default.createElement(ba,{onClick:async()=>{await c(e),t&&t();},className:l("embeddedTipDismissButton",i)},V__default.createElement(ve,null)),(S.imageUri||S.videoUri)&&V__default.createElement(ir,{className:l("embeddedTipMediaContainer",i)},V__default.createElement(nr,{appearance:i,stepData:S})),V__default.createElement(ya,null,V__default.createElement(Be,{size:"small",appearance:i,title:S.title,subtitle:S.subtitle})),(S.primaryButtonTitle||S.secondaryButtonTitle)&&V__default.createElement(Sa,{className:l("embeddedTipCallToActionContainer",i)},S.primaryButtonTitle&&V__default.createElement(ee,{classPrefix:"embeddedTip",title:S.primaryButtonTitle,appearance:i,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{S.handlePrimaryButtonClick(),N(S),!(r&&r(S,C(e),"primary")===!1)&&(await g(e,S.id),await m(e));}}),S.secondaryButtonTitle&&V__default.createElement(ee,{classPrefix:"embeddedTip",title:S.secondaryButtonTitle,appearance:i,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{S.handleSecondaryButtonClick(),D(S),r&&r(S,C(e),"secondary");},secondary:!0}))))};var Ia=me.div`
|
|
1674
1687
|
// use the :not annotation
|
|
1675
|
-
${e=>
|
|
1688
|
+
${e=>k(e)} {
|
|
1676
1689
|
display: flex;
|
|
1677
1690
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1678
1691
|
width: 100%;
|
|
@@ -1682,24 +1695,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1682
1695
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1683
1696
|
border-radius: 12px;
|
|
1684
1697
|
}
|
|
1685
|
-
`,
|
|
1686
|
-
${e=>
|
|
1698
|
+
`,Aa=me.div`
|
|
1699
|
+
${e=>k(e)} {
|
|
1687
1700
|
display: flex;
|
|
1688
1701
|
width: 46px;
|
|
1689
1702
|
height: 46px;
|
|
1690
1703
|
}
|
|
1691
|
-
`,
|
|
1704
|
+
`,Na=me.div`
|
|
1692
1705
|
display: flex;
|
|
1693
1706
|
flex-direction: column;
|
|
1694
1707
|
flex: 1;
|
|
1695
1708
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1696
1709
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1697
|
-
`,
|
|
1710
|
+
`,Oa=me.div`
|
|
1698
1711
|
display: flex;
|
|
1699
1712
|
flex-direction: column;
|
|
1700
1713
|
justify-content: center;
|
|
1701
1714
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1702
|
-
`,
|
|
1715
|
+
`,Gr=me.div`
|
|
1703
1716
|
display: flex;
|
|
1704
1717
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1705
1718
|
align-items: flex-end;
|
|
@@ -1707,12 +1720,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1707
1720
|
:hover {
|
|
1708
1721
|
opacity: 0.8;
|
|
1709
1722
|
}
|
|
1710
|
-
`,
|
|
1723
|
+
`,Kr=me.div`
|
|
1711
1724
|
display: flex;
|
|
1712
1725
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1713
1726
|
align-items: flex-end;
|
|
1714
1727
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1715
|
-
`;
|
|
1728
|
+
`;var La=({style:e,className:t})=>V__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},V__default.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),V__default.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 Ic=({flowId:e,title:t,subtitle:o,onDismiss:r,customVariables:i,onButtonClick:n,appearance:s,type:p="full-width",icon:d,onClick:a})=>{let{getFlow:m,markFlowCompleted:c,markFlowSkipped:g,isLoading:b,targetingLogicShouldHideFlow:T,updateCustomVariables:x,getFlowMetadata:u,getFlowStatus:F,getFlowSteps:C,getCurrentStepIndex:N}=R(),{primaryCTAClickSideEffects:D}=pe(),{mergeAppearanceWithDefault:w}=ie();if(ze(e),s=w(s),useEffect(()=>{x(i);},[i,b]),b)return null;let h=m(e);if(!h||T(h)||F(e)===re)return null;let v=C(e),S=v.length>0?v[N(e)]:u(e);return S?.title&&(t=S.title),S?.subtitle&&(o=S.subtitle),V__default.createElement(V__default.Fragment,null,V__default.createElement(te,{appearance:s}),V__default.createElement(Ia,{type:p,appearance:s,className:l("bannerContainer",s),onClick:a},p!="square"&&V__default.createElement(Aa,{className:l("bannerIconContainer",s)},d||V__default.createElement(La,null)),p==="square"&&S.dismissible&&V__default.createElement(Kr,{type:p,className:l("bannerDismissButtonContainer",s)},V__default.createElement(Gr,{type:p,onClick:async()=>{await g(e),r&&r();},className:l("bannerDismissButton",s)},V__default.createElement(ve,null))),V__default.createElement(Na,{type:p},V__default.createElement(Be,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),S?.primaryButtonTitle&&V__default.createElement(Oa,{type:p,className:l("bannerCallToActionContainer",s)},V__default.createElement(ee,{title:S?.primaryButtonTitle,appearance:s,onClick:()=>{D(S),n&&n(S,0,"primary");},classPrefix:"banner"})),p!=="square"&&S.dismissible&&V__default.createElement(Kr,{type:p,className:l("bannerDismissButtonContainer",s)},V__default.createElement(Gr,{type:p,onClick:async()=>{await g(e),r&&r();},className:l("bannerDismissButton",s)},V__default.createElement(ve,null)))))};var Da=me.div`
|
|
1716
1729
|
display: flex;
|
|
1717
1730
|
flex-direction: column;
|
|
1718
1731
|
width: 100%;
|
|
@@ -1734,7 +1747,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1734
1747
|
border-width: 1px;
|
|
1735
1748
|
border-color: ${t=>t.appearance.theme.colorBorder};
|
|
1736
1749
|
border-radius: ${t=>t.appearance.theme.borderRadius}px;`:""}
|
|
1737
|
-
|
|
1750
|
+
`,$a=me.button`
|
|
1738
1751
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1739
1752
|
border-radius: 8px;
|
|
1740
1753
|
// If selected make border color primary and text color color priamry
|
|
@@ -1755,34 +1768,34 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1755
1768
|
display: flex;
|
|
1756
1769
|
justify-content: center;
|
|
1757
1770
|
align-items: center;
|
|
1758
|
-
`,
|
|
1771
|
+
`,Yr=me.div`
|
|
1759
1772
|
display: flex;
|
|
1760
1773
|
justify-content: space-between;
|
|
1761
1774
|
margin-top: 16px;
|
|
1762
1775
|
gap: 8px;
|
|
1763
|
-
`,
|
|
1776
|
+
`,Ma=me.div`
|
|
1764
1777
|
display: flex;
|
|
1765
1778
|
justify-content: space-between;
|
|
1766
1779
|
margin-top: 8px;
|
|
1767
|
-
`,
|
|
1780
|
+
`,Jr=me.div`
|
|
1768
1781
|
font-size: 12px;
|
|
1769
1782
|
line-height: 18px;
|
|
1770
1783
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1771
1784
|
font-style: normal;
|
|
1772
1785
|
font-weight: 400;
|
|
1773
1786
|
letter-spacing: 0.24px;
|
|
1774
|
-
`,
|
|
1787
|
+
`,Xr=me.div`
|
|
1775
1788
|
display: flex;
|
|
1776
1789
|
flex-direction: column;
|
|
1777
1790
|
flex: 1;
|
|
1778
|
-
|
|
1791
|
+
`;me.div`
|
|
1779
1792
|
display: flex;
|
|
1780
1793
|
flex-direction: column;
|
|
1781
1794
|
justify-content: center;
|
|
1782
1795
|
align-items: flex-start;
|
|
1783
1796
|
margin-top: 16px;
|
|
1784
|
-
|
|
1785
|
-
${e=>
|
|
1797
|
+
`;var Ua=me.textarea`
|
|
1798
|
+
${e=>k(e)} {
|
|
1786
1799
|
color: ${e=>e.appearance.theme.colorText};
|
|
1787
1800
|
margin-top: 16px;
|
|
1788
1801
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1794,8 +1807,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1794
1807
|
height: 100px;
|
|
1795
1808
|
resize: none;
|
|
1796
1809
|
}
|
|
1797
|
-
`,
|
|
1798
|
-
${e=>
|
|
1810
|
+
`,za=me.div`
|
|
1811
|
+
${e=>k(e)} {
|
|
1799
1812
|
position: absolute;
|
|
1800
1813
|
top: 16px;
|
|
1801
1814
|
right: 16px;
|
|
@@ -1805,5 +1818,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${To}${t}.${To}${t} { ${Object.entries(o).map
|
|
|
1805
1818
|
opacity: 0.8;
|
|
1806
1819
|
}
|
|
1807
1820
|
}
|
|
1808
|
-
`;var
|
|
1821
|
+
`;var Oc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:i,className:n,style:s,type:p="modal"})=>{let {getFlow:d,markFlowCompleted:a,markFlowSkipped:m,markStepCompleted:c,getNumberOfStepsCompleted:g,isLoading:b,targetingLogicShouldHideFlow:T,updateCustomVariables:x,getFlowSteps:u,getFlowStatus:F,getFlowMetadata:C}=R();pe();let {mergeAppearanceWithDefault:D}=ie(),[w,h]=V__default.useState(null),[v,S]=V__default.useState(""),P=C(e),{hasOpenModals:E,setKeepCompletedFlowOpenDuringSession:I,shouldKeepCompletedFlowOpenDuringSession:L}=Pe();if(ze(e),i=D(i),useEffect(()=>{x(o);},[o,b]),b)return null;let $=d(e);if(!$||T($)||F(e)===re||g(e)===1&&!L(e)||E())return null;let M=u(e)[g(e)];function q(){return V__default.createElement(V__default.Fragment,null,V__default.createElement(Xr,null,V__default.createElement(Be,{size:"large",appearance:i,title:M.title,subtitle:M.subtitle})),V__default.createElement(Yr,{className:l("npsNumberButtonContainer",i),appearance:i},Array.from(Array(10).keys()).map(H=>V__default.createElement($a,{className:l("npsNumberButton",i),selected:w===H+1,key:H,onClick:async()=>{I(e),h(H+1),await c(e,M.id,{score:H+1});},appearance:i},H+1))),V__default.createElement(Ma,{appearance:i},V__default.createElement(Jr,{appearance:i},P?.negativeLabel??"Not likely at all"),V__default.createElement(Jr,{appearance:i},P?.positiveLabel??"Extremely likely")))}function Y(){return V__default.createElement(V__default.Fragment,null,V__default.createElement(Xr,null,V__default.createElement(Be,{appearance:i,title:M.title??"Why did you choose this score?",size:"large"})),V__default.createElement(Ua,{appearance:i,value:v,onChange:H=>{S(H.target.value);},placeholder:"Add your optional feedback here..."}),V__default.createElement(Yr,{appearance:i,className:l("npsNumberButtonContainer",i)},V__default.createElement(ee,{size:"large",withMargin:!1,onClick:async()=>{await a(e),r&&r(M,1,"primary");},appearance:i,title:M.secondaryButtonTitle||"Skip",secondary:!0}),V__default.createElement(ee,{size:"large",withMargin:!1,onClick:async()=>{await c(e,M.id,{feedbackText:v}),await a(e),r&&r(M,1,"primary");},appearance:i,title:M.primaryButtonTitle||"Submit"})))}function B(){return g(e)>=2?null:V__default.createElement(V__default.Fragment,null,V__default.createElement(te,{appearance:i}),V__default.createElement(Da,{appearance:i,className:we(l("npsSurveyContainer",i),n),style:s,type:p},V__default.createElement(za,{onClick:async()=>{await m(e),t&&t();},className:l("npsSurveyDismissButton",i)},V__default.createElement(ve,null)),g(e)==0&&q(),g(e)==1&&Y()))}return p==="inline"?B():V__default.createElement(Portal,null,B())};var Dc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:i,className:n,style:s,dismissible:p=!0,modalPosition:d="center",showPagination:a=!0,allowBackNavigation:m})=>{let{getFlow:c,markFlowCompleted:g,markFlowSkipped:b,markStepCompleted:T,markStepStarted:x,isLoading:u,targetingLogicShouldHideFlow:F,updateCustomVariables:C,getFlowSteps:N,getFlowStatus:D,getCurrentStepIndex:w}=R(),{primaryCTAClickSideEffects:h,secondaryCTAClickSideEffects:v}=pe(),{mergeAppearanceWithDefault:S}=ie(),{setOpenFlowState:P,getOpenFlowState:E,hasOpenModals:I}=Pe();ze(e);let[L,$]=[E(e,!0),ae=>P(e,ae)];if(i=S(i),useEffect(()=>{C(o);},[o,u]),u)return null;let G=c(e);if(!G||F(G)||D(e)===re||I())return null;let M=N(e),q=w(e),Y=M.length,B=M[q],H=async()=>{$(!1),await b(e),t&&t();};function he(){return V__default.createElement(V__default.Fragment,null,V__default.createElement(te,{appearance:i}),V__default.createElement(wa,{appearance:i,className:we(l("announcementContainer",i),n),style:s},(p===!0||B.dismissible)&&d=="inline"&&V__default.createElement(Pa,{onClick:async()=>{await b(e),t&&t();},className:l("announcementDismissButton",i)},V__default.createElement(ve,null)),V__default.createElement(Ta,null,V__default.createElement(va,{appearance:i,className:l("announcementTitle",i),dangerouslySetInnerHTML:J(B.title)}),B.subtitle&&V__default.createElement(Ba,{appearance:i,className:l("announcementSubtitle",i),dangerouslySetInnerHTML:J(B.subtitle)})),(B.imageUri||B.videoUri)&&V__default.createElement(ir,{className:l("announcementMediaContainer",i)},V__default.createElement(nr,{appearance:i,stepData:B})),a&&Y>1&&V__default.createElement(Fa,{className:l("announcementPaginationContainer",i)},V__default.createElement(Wo,{className:l("announcementPagination",i),appearance:i,stepCount:Y,currentStep:q})),(B.primaryButtonTitle||B.secondaryButtonTitle)&&V__default.createElement(ka,{allowBackNavigation:m,className:l("announcementCTAContainer",i)},m&&q>0&&V__default.createElement(ee,{classPrefix:"announcementBack",title:B.backButtonTitle??"Back",appearance:i,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{r&&r(B,w(e),"back"),await x(e,M[q-1].id);},secondary:!0}),B.secondaryButtonTitle&&V__default.createElement(ee,{classPrefix:"announcement",title:B.secondaryButtonTitle,appearance:i,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{B.handleSecondaryButtonClick(),v(B),r&&r(B,w(e),"secondary");},secondary:!0}),B.primaryButtonTitle&&V__default.createElement(ee,{classPrefix:"announcement",title:B.primaryButtonTitle,appearance:i,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{h(B),!(r&&r(B,w(e),"primary")===!1)&&(w(e)===Y-1?(B.handlePrimaryButtonClick(),await g(e)):B.handlePrimaryButtonClick());}}))))}let xe={padding:"24px",maxWidth:"400px"};return d==="inline"?he():d!=="center"?V__default.createElement(Lo,{modalPosition:d,onClose:H,visible:L,dismissible:p,appearance:i},he()):V__default.createElement(qe,{appearance:i,onClose:H,visible:L,style:xe,dismissible:p},he())};var Wa=({as:e="span",children:t,variant:o="Body1",...r})=>V__default.createElement(un,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...r},t),$c=Object.fromEntries(Object.keys(Ko).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>V__default.createElement(Wa,{as:t,...r,variant:e},r.children);return o.displayName=`Text.${e}`,[e,o]})),Qr=Object.assign(Wa,$c);var Ha=({as:e="button",className:t,size:o="md",title:r,variant:i="Primary",...n})=>V.createElement(mn,{className:`fr-button-${i.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:i,size:o,borderRadius:"md",...n},V.createElement(Qr,{color:go[i]?.color,fontWeight:"semibold"},r)),Mc=Object.fromEntries(Object.keys(go).map(e=>{let t=o=>V.createElement(Ha,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),Uc=Object.assign(Ha,Mc);
|
|
1822
|
+
|
|
1823
|
+
export { fo as Box, Uc as Button, tt as CheckBox, dr as FlowType, dt as FormLabel, br as FormTextField, Dc as FrigadeAnnouncement, Ic as FrigadeBanner, Vr as FrigadeChecklist, et as FrigadeDefaultAppearance, Bc as FrigadeEmbeddedTip, nn as FrigadeForm, rc as FrigadeGuide, Rd as FrigadeHeroChecklist, Oc as FrigadeNPSSurvey, tc as FrigadeProgressBadge, sd as FrigadeProvider, Fc as FrigadeSupportWidget, yc as FrigadeTour, De as ProgressBar, $t as ProgressRing, Qr as Text, qo as tokens, Pe as useFlowOpens, ro as useFlowResponses, R as useFlows, Or as useOrganization, io as useUser, Oe as useUserFlowStates };
|
|
1824
|
+
//# sourceMappingURL=out.js.map
|
|
1809
1825
|
//# sourceMappingURL=index.mjs.map
|