@frigade/react 1.37.18 → 1.37.20
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.d.ts +12 -2
- package/dist/index.js +80 -79
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +113 -112
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Mo=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if(Mo)for(var o of Mo(t))ai.call(t,o)&&si(e,o,t[o]);return e},j=(e,t)=>sa(e,la(t));var pi=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Mo)for(var i of Mo(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var M=(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 Eo,{createContext as Td,useEffect as rr,useState as je}from"react";import{ThemeProvider as An}from"styled-components";import Lt,{useContext as Zp,useEffect as Rt,useState as ko}from"react";import{useCallback as At,useContext as Sa,useEffect as ba}from"react";import hr,{useMemo as ci}from"react";var di="1.37.18";var nt="NOT_STARTED_STEP",ie="COMPLETED_FLOW",Do="ABORTED_FLOW",Et="STARTED_FLOW",Me="NOT_STARTED_FLOW",Le="COMPLETED_STEP",go="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=hr.useContext(Q);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function jt(){let{shouldGracefullyDegrade:e,readonly:t}=hr.useContext(Q);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Vt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Vt();let n=aa+o,r=pa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Vt()}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 Vt(p)}return l?l.ok?l:Vt(l.statusText):Vt()})}function Vt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=hr.useContext(Q);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 xa,useState as mi}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ee(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(Q);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>j(w({},y),{[c]:g}))}function p(c){t(g=>{let C=g,{[c]:y}=C,S=Ie(C,[pi(c)]);return w({},S)})}function d(c){n.includes(c)||i(g=>[...g,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import ga from"swr/immutable";import ho from"core-js-pure/actual/structured-clone";function xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ce(...e){let t=e.shift(),o=e.length===1?e[0]:Ce(...e);if(!xr(t)||!xr(o))throw new Error("deepmerge can only merge Objects");let i=ho(t);return Object.entries(o).forEach(([n,r])=>{xr(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],ho(r))}):Object.assign(i,{[n]:ho(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ho(r)]}):Object.assign(i,{[n]:ho(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function De(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ca(Q),{resetOpenFlowState:d}=Ee(),[s,m]=ua(!1),c={data:r.map(T=>({flowId:T.id,flowState:ie,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=T=>fetch(T,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${T}: ${k}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:S,isLoading:C,mutate:x,error:P}=p?ga(y,g):fa(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),b=S==null?void 0:S.data;ma(()=>{!s&&!C&&b&&m(!0)},[b,s,C]);function v(T){return M(this,null,function*(){if(b&&!p){let k=b.find(I=>I.flowId===T);k&&k.flowState!==ie&&(k.flowState=ie),yield x(Promise.resolve(Ce(S,{data:b})),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function $(T,k,I){return M(this,null,function*(){if(b){let N=b.find(A=>A.flowId===T);N&&(N.stepStates[k]=I,N.flowState=Et),yield x(Promise.resolve(Ce(S,{data:b})),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function B(T,k,I){return M(this,null,function*(){if(b){let N=b.find(A=>A.flowId===T);N&&(N.lastStepId=k,N.stepStates[k]=I,N.flowState=Et),yield x(Ce(S,{data:b}),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function u(T){return M(this,null,function*(){if(b){let k=b.find(I=>I.flowId===T);k&&k.flowState!==Me&&(k.flowState=Me,k.lastStepId=ha,Object.keys(k.stepStates).forEach(I=>{k.stepStates[I].actionType=nt,k.stepStates[I].createdAt=new Date().toISOString()}),yield x(Ce(S,{data:b}),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1}),d(T))}})}function O(T,k,I){return M(this,null,function*(){if(b){let N=b.find(A=>A.flowId===T);N&&(N.stepStates[k]=I),yield x(Promise.resolve(Ce(S,{data:b})),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:b,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:v,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:$,optimisticallyMarkStepNotStarted:O,optimisticallyMarkStepStarted:B,error:P}}function xo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=xa(Q),[d,s]=mi(new Set),[m,c]=mi(new Set),g=jt();function y(x){let P=JSON.stringify(x);if(d.has(P))return null;d.add(P),s(d),m.add(x),c(m);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`,j(w({},e),{method:"POST",body:P})).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 S(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===Et||x.actionType===Me?yield y(x):x.actionType===ie?yield y(x):x.actionType===go?yield y(x):x.actionType===Le?yield y(x):x.actionType===Do?yield y(x):x.actionType===nt&&(yield y(x)))})}function C(){let x=[];return o==null||o.forEach(P=>{if(P&&P.stepStates&&Object.keys(P.stepStates).length!==0)for(let b in P.stepStates){let v=P.stepStates[b];x.push({foreignUserId:P.foreignUserId,flowSlug:P.flowId,stepId:v.stepId,actionType:v.actionType,data:{},createdAt:new Date(v.createdAt),blocked:v.blocked,hidden:v.hidden})}}),[...x,...l]}return{addResponse:S,setFlowResponses:p,getFlowResponses:C}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Uo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Cr=(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))(Cr||{});function R(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:y,readonly:S,flowDataOverrides:C}=Sa(Q),x={data:[]},{verifySDKInitiated:P}=Gt(),{addResponse:b,getFlowResponses:v}=xo(),$=h=>fetch(h,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${h} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(f=>(console.log(`Error fetching ${h}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:B,userFlowStatesData:u,isLoadingUserFlowStateData:O,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:k,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:A}=De(),{data:H,error:U,isLoading:te}=wa(l?`${t}flows${S?"?readonly=true":""}`:null,$,{keepPreviousData:!0});ba(()=>{if(U){console.error(U);return}H&&H.data&&i(H.data)},[H,U]);function X(h){if(te)return null;let f=o.find(F=>F.slug===h);return!f&&o.length>0&&!O&&!te?(console.log(`Flow with id ${h} not found`),null):(f&&C&&C[h]&&(f.data=C[h]),(f==null?void 0:f.active)===!1&&!S?null:f)}function q(h){var _,ge,xt,vt,Bt;if(!X(h))return[];let f=(_=X(h))==null?void 0:_.data;return f?(f=J(f),((Bt=(vt=(ge=Uo(f))==null?void 0:ge.data)!=null?vt:(xt=Uo(f))==null?void 0:xt.steps)!=null?Bt:[]).map(he=>{let uo=Ge(he);return j(w({handleSecondaryButtonClick:()=>{he.skippable===!0&&Z(h,he.id,{skipped:!0})}},he),{complete:me(h,he.id)===Le||uo>=1,started:me(h,he.id)===go||me(h,he.id)===Le,currentlyActive:u==null?void 0:u.some(fo=>fo.flowId==h&&fo.lastStepId===he.id),blocked:V(h,he.id),hidden:z(h,he.id),handlePrimaryButtonClick:()=>{(!he.completionCriteria&&(he.autoMarkCompleted||he.autoMarkCompleted===void 0)||he.completionCriteria&&he.autoMarkCompleted===!0)&&Z(h,he.id)},progress:uo})}).filter(he=>he.hidden!==!0)):[]}function J(h){return h.replaceAll(/\${(.*?)}/g,(f,F)=>p[F]===void 0?"":String(p[F]).replace(/[\u00A0-\u9999<>\&]/g,function(_){return"&#"+_.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 Y(h){var F;if(!X(h))return[];let f=X(h).data;return f?(f=J(f),(F=JSON.parse(f))!=null?F:{}):[]}function de(h,f){d(F=>j(w({},F),{[h]:f}))}function we(h){!O&&!te&&h&&JSON.stringify(p)!=JSON.stringify(w(w({},p),h))&&Object.keys(h).forEach(f=>{de(f,h[f])})}let Ne=At((h,f,F)=>M(this,null,function*(){if(!P())return;let _={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:go,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};ue(_)&&(yield A(h,f,_),b(_))}),[n,r,u]),ce=At((h,f,F)=>M(this,null,function*(){if(!P())return;let _={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:nt,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};ue(_)&&(yield N(h,f,_),b(_))}),[n,r,u]),Z=At((h,f,F)=>M(this,null,function*(){if(!P())return;let _={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:Le,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};ue(_)&&(yield I(h,f,_),b(_))}),[n,r,u]),D=At((h,f)=>M(this,null,function*(){if(!P()||Xe(h)===Me)return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Me,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield k(h),ue(F)&&b(F)}),[n,r,u]),ee=At((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Et,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(F)&&b(F)}),[n,r,u]),ke=At((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:ie,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(F)&&(yield T(h),b(F))}),[n,r,u]),He=At((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Do,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(F)&&(yield T(h),b(F))}),[n,r,u]);function ue(h){var f;if(u===void 0)return!1;if(u){let F=u.find(_=>_.flowId===h.flowSlug);if(h.actionType===nt&&(!(F!=null&&F.stepStates[h.stepId])||F.stepStates[h.stepId].actionType===nt))return!1;if(F&&((f=F.stepStates[h.stepId])==null?void 0:f.actionType)===h.actionType){if(h.actionType===Le&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let _=Object.keys(F.stepStates).sort((ge,xt)=>{let vt=new Date(F.stepStates[ge].createdAt),Bt=new Date(F.stepStates[xt].createdAt);return vt.getTime()-Bt.getTime()});if(F.stepStates[_[_.length-1]].actionType===h.actionType&&h.stepId===_[_.length-1])return!1}if(F&&F.flowState===ie&&h.actionType===ie)return!1}return!0}function me(h,f){let F=L(h,f);return O?null:F?F.actionType:nt}function V(h,f){let F=L(h,f);return F?F.blocked:!1}function z(h,f){let F=L(h,f);return F?F.hidden:!1}function L(h,f){var _;if(O)return null;let F=u==null?void 0:u.find(ge=>ge.flowId===h);return!F||!F.stepStates[f]?null:(_=F.stepStates[f])!=null?_:null}function W(h){var F,_;if(O||!u)return null;if(Xe(h)===Me)return(F=q(h)[0])!=null?F:null;let f=(_=u.find(ge=>ge.flowId===h))==null?void 0:_.lastStepId;return f?q(h).find(ge=>ge.id===f):null}function re(h){var _;let f=W(h);if(!f)return 0;let F=(_=q(h).findIndex(ge=>ge.id===f.id))!=null?_:0;return me(h,f.id)===Le&&F<q(h).length-1?F+1:F}function Ge(h){if(!h.completionCriteria)return;let f=ui(h.completionCriteria);if(f===null)return;let F=Pt(f),_=Ke(f);return _===0?void 0:F/_}function Xe(h){let f=u==null?void 0:u.find(F=>F.flowId===h);return f?f.flowState:null}function Pt(h){let f=q(h);return f.length===0?0:f.filter(_=>me(h,_.id)===Le).length}function Ke(h){return q(h).length}function ht(h){let f=o.find(F=>F.slug===h);return f?(C&&C[h]&&(f.data=C[h]),Uo(f.data)):null}function qe(h){if(S)return!1;if(O||y)return!0;if(h!=null&&h.targetingLogic&&u){let f=u.find(F=>F.flowId===h.slug);if(f)return f.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function Wt(h){return!qe(X(h))}function zt(){n&&B()}function Ht(){return o}return{getAllFlows:Ht,getFlow:X,getFlowData:ht,isLoading:O||te,getStepStatus:me,getFlowSteps:q,getCurrentStepIndex:re,markStepStarted:Ne,markStepCompleted:Z,markFlowNotStarted:D,markFlowStarted:ee,markFlowCompleted:ke,markFlowAborted:He,markStepNotStarted:ce,getFlowStatus:Xe,getNumberOfStepsCompleted:Pt,getNumberOfSteps:Ke,targetingLogicShouldHideFlow:qe,setCustomVariable:de,updateCustomVariables:we,customVariables:p,getStepOptionalProgress:Ge,getFlowMetadata:Y,isStepBlocked:V,isStepHidden:z,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Wt,refresh:zt}}import{useCallback as yr,useContext as Ta,useEffect as Fa}from"react";var Kt="guest_";function Co(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(Q),{config:r,apiUrl:l}=Ze(),{mutateUserFlowState:p}=De(),d=jt(),{verifySDKInitiated:s}=Gt();function m(S){return`frigade-user-registered-${S}`}Fa(()=>{if(e&&!t){if(e.startsWith(Kt))return;let S=m(e);localStorage.getItem(S)||(d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(S,"true"))}},[e,n,t]);let c=yr(S=>M(this,null,function*(){if(!s())return;let C={foreignId:e,properties:S};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(C)})),i(x=>w(w({},x),S)),p()}),[e,r,n,p]),g=yr((S,C)=>M(this,null,function*(){if(!s())return;let P={foreignId:e,events:[{event:S,properties:C}]};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(P)})),p()}),[e,r,p]),y=yr((S,C)=>M(this,null,function*(){if(s())if(C){let x=m(S);localStorage.setItem(x,"true"),o(S);let P={foreignId:S,properties:C};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(P)})),i(b=>w(w({},b),C)),p()}else o(S)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as Rp}from"uuid";import ot,{useEffect as xn,useState as Jp}from"react";import Ye,{useEffect as Tr,useState as Ia}from"react";import Ho from"styled-components";import ka from"react";import Pa from"styled-components";var fi="fr-",yo="cfr-";function a(e,t){let o=`${fi}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+yo+e}return o}function E(e){if(!e.className||e.className.indexOf(yo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function _o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${_o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function So(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
2
|
+
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Mo=Object.getOwnPropertySymbols;var ai=Object.prototype.hasOwnProperty,pi=Object.prototype.propertyIsEnumerable;var li=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))ai.call(t,o)&&li(e,o,t[o]);if(Mo)for(var o of Mo(t))pi.call(t,o)&&li(e,o,t[o]);return e},V=(e,t)=>sa(e,la(t));var di=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)ai.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Mo)for(var i of Mo(e))t.indexOf(i)<0&&pi.call(e,i)&&(o[i]=e[i]);return o};var D=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{a(o.next(d))}catch(l){n(l)}},s=d=>{try{a(o.throw(d))}catch(l){n(l)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);a((o=o.apply(e,t)).next())});import Eo,{createContext as Td,useEffect as ir,useState as je}from"react";import{ThemeProvider as An}from"styled-components";import $t,{useContext as Zp,useEffect as Rt,useState as ko}from"react";import{useCallback as At,useContext as Sa,useEffect as ba}from"react";import xr,{useMemo as mi}from"react";var ci="1.37.20";var nt="NOT_STARTED_STEP",ie="COMPLETED_FLOW",Do="SKIPPED_FLOW",Et="STARTED_FLOW",De="NOT_STARTED_FLOW",$e="COMPLETED_STEP",go="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=xr.useContext(Z);return{config:mi(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ci,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:mi(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function Gt(){let{shouldGracefullyDegrade:e,readonly:t}=xr.useContext(Z);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return jt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),jt();let n=aa+o,r=pa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let a=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(a&&d&&d==i.body){let l=new Date(a);if(new Date().getTime()-l.getTime()<1e3)return jt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(a){return jt(a)}return s?s.ok?s:jt(s.statusText):jt()})}function jt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Kt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=xr.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}}import{useContext as xa,useState as ui}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ee(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(Z);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function s(c,g){t(y=>V(w({},y),{[c]:g}))}function a(c){t(g=>{let C=g,{[c]:y}=C,S=Le(C,[di(c)]);return w({},S)})}function d(c){n.includes(c)||i(g=>[...g,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:a,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import ga from"swr/immutable";import ho from"core-js-pure/actual/structured-clone";function Cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ce(...e){let t=e.shift(),o=e.length===1?e[0]:Ce(...e);if(!Cr(t)||!Cr(o))throw new Error("deepmerge can only merge Objects");let i=ho(t);return Object.entries(o).forEach(([n,r])=>{Cr(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],ho(r))}):Object.assign(i,{[n]:ho(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ho(r)]}):Object.assign(i,{[n]:ho(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function Ue(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:a}=ca(Z),{resetOpenFlowState:d}=Ee(),[l,m]=ua(!1),c={data:r.map(T=>({flowId:T.id,flowState:ie,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=T=>fetch(T,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${T}: ${P}. Will gracefully degrade and hide Frigade`),s(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:S,isLoading:C,mutate:x,error:v}=a?ga(y,g):fa(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),b=S==null?void 0:S.data;ma(()=>{!l&&!C&&b&&m(!0)},[b,l,C]);function k(T){return D(this,null,function*(){if(b&&!a){let P=b.find(L=>L.flowId===T);P&&P.flowState!==ie&&(P.flowState=ie),yield x(Promise.resolve(Ce(S,{data:b})),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function I(T,P,L){return D(this,null,function*(){if(b){let N=b.find(O=>O.flowId===T);N&&(N.stepStates[P]=L,N.flowState=Et),yield x(Promise.resolve(Ce(S,{data:b})),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function B(T,P,L){return D(this,null,function*(){if(b){let N=b.find(O=>O.flowId===T);N&&(N.lastStepId=P,N.stepStates[P]=L,N.flowState=Et),yield x(Ce(S,{data:b}),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function u(T){return D(this,null,function*(){if(b){let P=b.find(L=>L.flowId===T);P&&P.flowState!==De&&(P.flowState=De,P.lastStepId=ha,Object.keys(P.stepStates).forEach(L=>{P.stepStates[L].actionType=nt,P.stepStates[L].createdAt=new Date().toISOString()}),yield x(Ce(S,{data:b}),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1}),d(T))}})}function A(T,P,L){return D(this,null,function*(){if(b){let N=b.find(O=>O.flowId===T);N&&(N.stepStates[P]=L),yield x(Promise.resolve(Ce(S,{data:b})),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:b,isLoadingUserFlowStateData:!l,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:k,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:A,optimisticallyMarkStepStarted:B,error:v}}function xo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=Ue(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:a}=xa(Z),[d,l]=ui(new Set),[m,c]=ui(new Set),g=Gt();function y(x){let v=JSON.stringify(x);if(d.has(v))return null;d.add(v),l(d),m.add(x),c(m);let b=s==null?void 0:s.find(k=>k.flowSlug===x.flowSlug&&k.stepId===x.stepId&&k.actionType===x.actionType&&k.createdAt===x.createdAt);return g(`${t}flowResponses`,V(w({},e),{method:"POST",body:v})).then(k=>{k.status!==200&&k.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):b||a(I=>[...I!=null?I:[],x])})}function S(x){return D(this,null,function*(){x.foreignUserId&&(x.actionType===Et||x.actionType===De?yield y(x):x.actionType===ie?yield y(x):x.actionType===go?yield y(x):x.actionType===$e?yield y(x):x.actionType===Do?yield y(x):x.actionType===nt&&(yield y(x)))})}function C(){let x=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let b in v.stepStates){let k=v.stepStates[b];x.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:k.stepId,actionType:k.actionType,data:{},createdAt:new Date(k.createdAt),blocked:k.blocked,hidden:k.hidden})}}),[...x,...s]}return{addResponse:S,setFlowResponses:a,getFlowResponses:C}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,fi=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Uo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var yr=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(yr||{});function te(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:a,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:y,readonly:S,flowDataOverrides:C}=Sa(Z),x={data:[]},{verifySDKInitiated:v}=Kt(),{addResponse:b,getFlowResponses:k}=xo(),I=h=>fetch(h,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${h} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(f=>(console.log(`Error fetching ${h}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:B,userFlowStatesData:u,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:P,optimisticallyMarkStepCompleted:L,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:O}=Ue(),{data:H,error:_,isLoading:R}=wa(s?`${t}flows${S?"?readonly=true":""}`:null,I,{keepPreviousData:!0});ba(()=>{if(_){console.error(_);return}H&&H.data&&i(H.data)},[H,_]);function J(h){if(R)return null;let f=o.find(F=>F.slug===h);return!f&&o.length>0&&!A&&!R?(console.log(`Flow with id ${h} not found`),null):(f&&C&&C[h]&&(f.data=C[h]),(f==null?void 0:f.active)===!1&&!S?null:f)}function ee(h){var U,ge,xt,vt,Bt;if(!J(h))return[];let f=(U=J(h))==null?void 0:U.data;return f?(f=K(f),((Bt=(vt=(ge=Uo(f))==null?void 0:ge.data)!=null?vt:(xt=Uo(f))==null?void 0:xt.steps)!=null?Bt:[]).map(he=>{let uo=Ge(he);return V(w({handleSecondaryButtonClick:()=>{he.skippable===!0&&pe(h,he.id,{skipped:!0})}},he),{complete:me(h,he.id)===$e||uo>=1,started:me(h,he.id)===go||me(h,he.id)===$e,currentlyActive:u==null?void 0:u.some(fo=>fo.flowId==h&&fo.lastStepId===he.id),blocked:j(h,he.id),hidden:z(h,he.id),handlePrimaryButtonClick:()=>{(!he.completionCriteria&&(he.autoMarkCompleted||he.autoMarkCompleted===void 0)||he.completionCriteria&&he.autoMarkCompleted===!0)&&pe(h,he.id)},progress:uo})}).filter(he=>he.hidden!==!0)):[]}function K(h){return h.replaceAll(/\${(.*?)}/g,(f,F)=>a[F]===void 0?"":String(a[F]).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 Y(h){var F;if(!J(h))return[];let f=J(h).data;return f?(f=K(f),(F=JSON.parse(f))!=null?F:{}):[]}function de(h,f){d(F=>V(w({},F),{[h]:f}))}function we(h){!A&&!R&&h&&JSON.stringify(a)!=JSON.stringify(w(w({},a),h))&&Object.keys(h).forEach(f=>{de(f,h[f])})}let Ie=At((h,f,F)=>D(this,null,function*(){if(!v())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:go,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};ue(U)&&(yield O(h,f,U),b(U))}),[n,r,u]),ce=At((h,f,F)=>D(this,null,function*(){if(!v())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:nt,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};ue(U)&&(yield N(h,f,U),b(U))}),[n,r,u]),pe=At((h,f,F)=>D(this,null,function*(){if(!v())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:$e,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};ue(U)&&(yield L(h,f,U),b(U))}),[n,r,u]),M=At((h,f)=>D(this,null,function*(){if(!v()||Xe(h)===De)return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:De,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield P(h),ue(F)&&b(F)}),[n,r,u]),X=At((h,f)=>D(this,null,function*(){if(!v())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Et,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(F)&&b(F)}),[n,r,u]),ke=At((h,f)=>D(this,null,function*(){if(!v())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:ie,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(F)&&(yield T(h),b(F))}),[n,r,u]),He=At((h,f)=>D(this,null,function*(){if(!v())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Do,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(F)&&(yield T(h),b(F))}),[n,r,u]);function ue(h){var f;if(u===void 0)return!1;if(u){let F=u.find(U=>U.flowId===h.flowSlug);if(h.actionType===nt&&(!(F!=null&&F.stepStates[h.stepId])||F.stepStates[h.stepId].actionType===nt))return!1;if(F&&((f=F.stepStates[h.stepId])==null?void 0:f.actionType)===h.actionType){if(h.actionType===$e&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let U=Object.keys(F.stepStates).sort((ge,xt)=>{let vt=new Date(F.stepStates[ge].createdAt),Bt=new Date(F.stepStates[xt].createdAt);return vt.getTime()-Bt.getTime()});if(F.stepStates[U[U.length-1]].actionType===h.actionType&&h.stepId===U[U.length-1])return!1}if(F&&F.flowState===ie&&h.actionType===ie)return!1}return!0}function me(h,f){let F=$(h,f);return A?null:F?F.actionType:nt}function j(h,f){let F=$(h,f);return F?F.blocked:!1}function z(h,f){let F=$(h,f);return F?F.hidden:!1}function $(h,f){var U;if(A)return null;let F=u==null?void 0:u.find(ge=>ge.flowId===h);return!F||!F.stepStates[f]?null:(U=F.stepStates[f])!=null?U:null}function W(h){var F,U;if(A||!u)return null;if(Xe(h)===De)return(F=ee(h)[0])!=null?F:null;let f=(U=u.find(ge=>ge.flowId===h))==null?void 0:U.lastStepId;return f?ee(h).find(ge=>ge.id===f):null}function re(h){var U;let f=W(h);if(!f)return 0;let F=(U=ee(h).findIndex(ge=>ge.id===f.id))!=null?U:0;return me(h,f.id)===$e&&F<ee(h).length-1?F+1:F}function Ge(h){if(!h.completionCriteria)return;let f=fi(h.completionCriteria);if(f===null)return;let F=Pt(f),U=Ke(f);return U===0?void 0:F/U}function Xe(h){let f=u==null?void 0:u.find(F=>F.flowId===h);return f?f.flowState:null}function Pt(h){let f=ee(h);return f.length===0?0:f.filter(U=>me(h,U.id)===$e).length}function Ke(h){return ee(h).length}function ht(h){let f=o.find(F=>F.slug===h);return f?(C&&C[h]&&(f.data=C[h]),Uo(f.data)):null}function qe(h){if(S)return!1;if(A||y)return!0;if(h!=null&&h.targetingLogic&&u){let f=u.find(F=>F.flowId===h.slug);if(f)return f.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function zt(h){return!qe(J(h))}function Ht(){n&&B()}function Vt(){return o}return{getAllFlows:Vt,getFlow:J,getFlowData:ht,isLoading:A||R,getStepStatus:me,getFlowSteps:ee,getCurrentStepIndex:re,markStepStarted:Ie,markStepCompleted:pe,markFlowNotStarted:M,markFlowStarted:X,markFlowCompleted:ke,markFlowAborted:He,markStepNotStarted:ce,getFlowStatus:Xe,getNumberOfStepsCompleted:Pt,getNumberOfSteps:Ke,targetingLogicShouldHideFlow:qe,setCustomVariable:de,updateCustomVariables:we,customVariables:a,getStepOptionalProgress:Ge,getFlowMetadata:Y,isStepBlocked:j,isStepHidden:z,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:zt,refresh:Ht}}import{useCallback as Sr,useContext as Ta,useEffect as Fa}from"react";var Nt="guest_";function Co(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(Z),{config:r,apiUrl:s}=Ze(),{mutateUserFlowState:a}=Ue(),d=Gt(),{verifySDKInitiated:l}=Kt();function m(S){return`frigade-user-registered-${S}`}Fa(()=>{if(e&&!t){if(e.startsWith(Nt))return;let S=m(e);localStorage.getItem(S)||(d(`${s}users`,V(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(S,"true"))}},[e,n,t]);let c=Sr(S=>D(this,null,function*(){if(!l())return;let C={foreignId:e,properties:S};yield d(`${s}users`,V(w({},r),{method:"POST",body:JSON.stringify(C)})),i(x=>w(w({},x),S)),a()}),[e,r,n,a]),g=Sr((S,C)=>D(this,null,function*(){if(!l())return;let v={foreignId:e,events:[{event:S,properties:C}]};yield d(`${s}users`,V(w({},r),{method:"POST",body:JSON.stringify(v)})),a()}),[e,r,a]),y=Sr((S,C,x)=>D(this,null,function*(){if(!l())return;let v=`${e}`,b=x&&v.startsWith(Nt);if(console.log("shouldLinkGuestSession",b,v),C){let k=m(S);localStorage.setItem(k,"true"),o(S);let I={foreignId:S,properties:C};yield d(`${s}users`,V(w({},r),{method:"POST",body:JSON.stringify(I)})),i(B=>w(w({},B),C)),b||a()}else o(S);if(b){let k={foreignId:S,linkGuestId:v};yield d(`${s}users`,V(w({},r),{method:"POST",body:JSON.stringify(k)})),a()}}),[r,n,a]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as Rp}from"uuid";import ot,{useEffect as Cn,useState as Jp}from"react";import Ye,{useEffect as Fr,useState as Ia}from"react";import Ho from"styled-components";import ka from"react";import Pa from"styled-components";var gi="fr-",yo="cfr-";function p(e,t){let o=`${gi}${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+" "+yo+e}return o}function E(e){if(!e.className||e.className.indexOf(yo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(gi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function _o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${_o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function So(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,hi=({onClose:e,appearance:t})=>ka.createElement(va,{className:p("modalBackground",t),onClick:()=>e()});import br from"react";import Ba from"styled-components";var Ea=Ba.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Ae=()=>
|
|
30
|
+
`,Ae=()=>br.createElement(Ea,null,br.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},br.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as La}from"react-portal";import Ei from"react";import wr from"react";function Aa({style:e,className:t}){return wr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},wr.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"}),wr.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 xi=Aa;import Tr from"styled-components";import st from"styled-components";var Wo=st.div`
|
|
31
31
|
${e=>E(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -38,7 +38,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
z-index: ${e=>e.zIndex};
|
|
40
40
|
overflow: hidden;
|
|
41
|
-
`,
|
|
41
|
+
`,Na=`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
@@ -46,12 +46,13 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
46
46
|
color: #ffffff;
|
|
47
47
|
padding: 4px;
|
|
48
48
|
border-radius: 100px;
|
|
49
|
+
border-width: 0px;
|
|
49
50
|
top: 12px;
|
|
50
51
|
right: 12px;
|
|
51
52
|
box-sizing: border-box;
|
|
52
53
|
:hover {
|
|
53
54
|
opacity: 0.8;
|
|
54
|
-
}`,
|
|
55
|
+
}`,Oa=`
|
|
55
56
|
display: block;
|
|
56
57
|
cursor: pointer;
|
|
57
58
|
position: absolute;
|
|
@@ -59,11 +60,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
59
60
|
right: 12px;
|
|
60
61
|
background-color: transparent;
|
|
61
62
|
border: none;
|
|
62
|
-
`,
|
|
63
|
+
`,Ci=st.button`
|
|
63
64
|
${e=>E(e)} {
|
|
64
|
-
${e=>e.hasImage?Oa
|
|
65
|
+
${e=>e.hasImage?Na:Oa};
|
|
65
66
|
}
|
|
66
|
-
`,
|
|
67
|
+
`,yi=st.img`
|
|
67
68
|
${e=>E(e)} {
|
|
68
69
|
display: block;
|
|
69
70
|
width: 100%;
|
|
@@ -71,7 +72,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
71
72
|
min-height: 200px;
|
|
72
73
|
object-fit: cover;
|
|
73
74
|
}
|
|
74
|
-
`,
|
|
75
|
+
`,Si=st.div`
|
|
75
76
|
${e=>E(e)} {
|
|
76
77
|
display: block;
|
|
77
78
|
width: 100%;
|
|
@@ -79,19 +80,19 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
79
80
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
80
81
|
object-fit: cover;
|
|
81
82
|
}
|
|
82
|
-
`,
|
|
83
|
+
`,bi=st.div`
|
|
83
84
|
display: flex;
|
|
84
85
|
flex-direction: row;
|
|
85
86
|
justify-content: space-between;
|
|
86
87
|
align-content: center;
|
|
87
|
-
`,bi=st.div`
|
|
88
|
-
padding: 22px 22px 12px;
|
|
89
88
|
`,wi=st.div`
|
|
89
|
+
padding: 22px 22px 12px;
|
|
90
|
+
`,Ti=st.div`
|
|
90
91
|
display: flex;
|
|
91
92
|
flex: 1;
|
|
92
93
|
flex-direction: column;
|
|
93
94
|
justify-content: center;
|
|
94
|
-
`,
|
|
95
|
+
`,Fi=st.div`
|
|
95
96
|
display: flex;
|
|
96
97
|
flex: 2;
|
|
97
98
|
flex-shrink: 1;
|
|
@@ -103,7 +104,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
103
104
|
align-content: center;
|
|
104
105
|
align-items: center;
|
|
105
106
|
}
|
|
106
|
-
`,
|
|
107
|
+
`,ki=st.p`
|
|
107
108
|
${e=>E(e)} {
|
|
108
109
|
font-style: normal;
|
|
109
110
|
font-weight: 600;
|
|
@@ -112,7 +113,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
112
113
|
color: #808080;
|
|
113
114
|
}
|
|
114
115
|
margin: 0;
|
|
115
|
-
`;var
|
|
116
|
+
`;var Pi=Tr.div`
|
|
116
117
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
117
118
|
position: absolute;
|
|
118
119
|
bottom: -47px;
|
|
@@ -123,7 +124,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
123
124
|
align-items: center;
|
|
124
125
|
justify-content: center;
|
|
125
126
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
126
|
-
`,
|
|
127
|
+
`,vi=Tr(Wo)`
|
|
127
128
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
128
129
|
position: absolute;
|
|
129
130
|
bottom: -60px;
|
|
@@ -136,7 +137,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
136
137
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
137
138
|
padding: 0;
|
|
138
139
|
z-index: ${e=>e.zIndex};
|
|
139
|
-
`,
|
|
140
|
+
`,Bi=Tr.div`
|
|
140
141
|
display: flex;
|
|
141
142
|
justify-content: center;
|
|
142
143
|
align-items: center;
|
|
@@ -145,7 +146,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
145
146
|
font-size: 12px;
|
|
146
147
|
line-height: 18px;
|
|
147
148
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
148
|
-
`;function zo({appearance:e}){return
|
|
149
|
+
`;function zo({appearance:e}){return Ei.createElement(Bi,{className:p("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Ei.createElement(xi,null))}var $a=Ho.div`
|
|
149
150
|
${e=>E(e)} {
|
|
150
151
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
151
152
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -207,7 +208,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
207
208
|
::-webkit-scrollbar {
|
|
208
209
|
display: none;
|
|
209
210
|
}
|
|
210
|
-
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:
|
|
211
|
+
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:a=!1})=>{let[d,l]=Ia("");return Fr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");l(m)},[]),Fr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),Fr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?Ye.createElement(La,null,Ye.createElement(hi,{appearance:r,onClose:()=>{s&&e()}}),Ye.createElement($a,{appearance:r,className:p("modalContainer",r),styleOverrides:i},s&&Ye.createElement(Da,{className:p("modalClose",r),onClick:()=>e(),appearance:r},Ye.createElement(Ae,null)),o&&Ye.createElement(Ma,null,o),Ye.createElement(Ua,null,n),a&&Ye.createElement(Pi,{appearance:r,className:p("poweredByFrigadeRibbon",r)},Ye.createElement(zo,{appearance:r})))):Ye.createElement(Ye.Fragment,null)};import Ct,{useEffect as kr,useState as _a}from"react";import Vo from"styled-components";import{Portal as Wa}from"react-portal";function za(e){switch(e){case"top-left":return`
|
|
211
212
|
top: 0;
|
|
212
213
|
left: 0;
|
|
213
214
|
`;case"top-right":return`
|
|
@@ -251,7 +252,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
251
252
|
::-webkit-scrollbar {
|
|
252
253
|
display: none;
|
|
253
254
|
}
|
|
254
|
-
`,jo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:
|
|
255
|
+
`,jo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[a,d]=_a("");return kr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),kr(()=>{let l=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),kr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",a),()=>{l.setProperty("overflow",a)}},[t]),t?Ct.createElement(Wa,null,Ct.createElement(Ha,{appearance:n,className:p("cornerModalContainer",n),modalPosition:r},s&&Ct.createElement(ja,{className:p("cornerModalClose",n),onClick:()=>e()},Ct.createElement(Ae,null)),o&&Ct.createElement(Va,null,o),Ct.createElement(Ga,null,i))):Ct.createElement(Ct.Fragment,null)};import{useContext as Ka}from"react";function ne(){let{defaultAppearance:e}=Ka(Z);function t(o){var n,r,s;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(s=o.theme)!=null?s:{})}:i}return{mergeAppearanceWithDefault:t}}import Ot,{useContext as fp,useEffect as Ki,useState as $r}from"react";import Jo from"styled-components";import qo,{useEffect as $i,useState as Br}from"react";import Er from"styled-components";import Go from"styled-components";var Ai=Go.label`
|
|
255
256
|
${e=>E(e)} {
|
|
256
257
|
font-size: 12px;
|
|
257
258
|
line-height: 18px;
|
|
@@ -262,7 +263,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
262
263
|
letter-spacing: 0.24px;
|
|
263
264
|
}
|
|
264
265
|
display: flex;
|
|
265
|
-
`,
|
|
266
|
+
`,Ni=Go.label`
|
|
266
267
|
${e=>E(e)} {
|
|
267
268
|
font-size: 12px;
|
|
268
269
|
line-height: 20px;
|
|
@@ -282,11 +283,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
282
283
|
align-items: flex-start;
|
|
283
284
|
justify-content: left;
|
|
284
285
|
margin-bottom: 10px;
|
|
285
|
-
`;import
|
|
286
|
+
`;import Pr from"react";var lt={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 yt({title:e,required:t,appearance:o=lt}){return e?Pr.createElement(Ko,{className:p("formLabelWrapper",o)},t?Pr.createElement(Oi,{className:p("formLabelRequired",o),appearance:o},"*"):null,Pr.createElement(Ai,{className:p("formLabel",o)},e)):null}import Ii from"react";function qt({title:e,appearance:t}){return e?Ii.createElement(Ko,null,Ii.createElement(Ni,{className:p("formSubLabel",t)},e)):null}import{z as vr}from"zod";function Li(e,t){var o,i,n,r,s,a,d;try{if(t){if(t.type=="number"){let l=vr.number();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?l=l.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?l=l.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(l=l.nonpositive((r=m.message)!=null?r:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=vr.string();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(s=m.message)!=null?s:"Value is too short"):m.requirement=="max"?l=l.max(Number(m.value),(a=m.message)!=null?a:"Value is too long"):m.requirement=="regex"&&(l=l.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));l.parse(e)}return}}catch(l){if(l instanceof vr.ZodError)return l.issues&&l.issues.length>0?l.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,l)}return null}var qa=Er.div`
|
|
286
287
|
display: flex;
|
|
287
288
|
flex-direction: column;
|
|
288
289
|
width: 100%;
|
|
289
|
-
`,Er
|
|
290
|
+
`,Ar=Er.input`
|
|
290
291
|
${e=>E(e)} {
|
|
291
292
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
292
293
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -302,7 +303,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
302
303
|
box-sizing: border-box;
|
|
303
304
|
padding: 0 10px;
|
|
304
305
|
margin-bottom: 10px;
|
|
305
|
-
`,Ya=
|
|
306
|
+
`,Ya=Er.textarea`
|
|
306
307
|
${e=>E(e)} {
|
|
307
308
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
308
309
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -319,13 +320,13 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
319
320
|
box-sizing: border-box;
|
|
320
321
|
margin-bottom: 10px;
|
|
321
322
|
resize: none;
|
|
322
|
-
`;function
|
|
323
|
+
`;function Nr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,a]=Br((n==null?void 0:n.text)||""),[d,l]=Br(!1),[m,c]=Br(!1),g=Ar;$i(()=>{s===""&&!d&&(l(!0),y(""))},[]),$i(()=>{if(m){y(s);return}},[m]);function y(C){var v;if(a(C),o({text:C}),r.required===!0&&C.trim()===""){i([{id:r.id,message:`${(v=r.title)!=null?v:"Field"} is required`,hidden:!m}]);return}let x=Li(C,r.validation);if(x&&(C.trim()!==""||r.required===!0)){i([{id:r.id,message:x,hidden:!m}]);return}i([])}r.multiline&&(g=Ya);function S(){var C;switch((C=r==null?void 0:r.validation)==null?void 0:C.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return qo.createElement(qa,null,qo.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),qo.createElement(g,{className:p("inputComponent",t.appearance),value:s,onChange:C=>{y(C.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:S(),onBlur:()=>{c(!0)}}),qo.createElement(qt,{title:r.subtitle,appearance:t.appearance}))}import et,{useEffect as Mi,useState as Di}from"react";import Ui from"styled-components";var Or="",Ja=Ui.div`
|
|
323
324
|
display: flex;
|
|
324
325
|
flex-direction: column;
|
|
325
326
|
width: 100%;
|
|
326
327
|
-webkit-appearance: none;
|
|
327
328
|
appearance: none;
|
|
328
|
-
`,Xa=
|
|
329
|
+
`,Xa=Ui.select`
|
|
329
330
|
${e=>E(e)} {
|
|
330
331
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
331
332
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -346,15 +347,15 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
346
347
|
background-repeat: no-repeat;
|
|
347
348
|
background-size: 1.5em 1.5em;
|
|
348
349
|
-webkit-print-color-adjust: exact;
|
|
349
|
-
`;function
|
|
350
|
+
`;function _i({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,g,y,S,C,x,v,b;let r=e,[s,a]=Di(!1),[d,l]=Di(!1);return Mi(()=>{var k,I,B,u;if(!((k=i==null?void 0:i.choice)!=null&&k[0])&&!s){if(a(!0),r.requireSelection){o({choice:[Or]});return}if(r.defaultValue&&((I=r.props.options)!=null&&I.find(A=>A.id===r.defaultValue))){let A=(B=r.props.options)==null?void 0:B.find(T=>T.id===r.defaultValue);o({choice:[A.id]})}else o({choice:[((u=r.props.options)==null?void 0:u[0].id)||""]})}},[]),Mi(()=>{var k;d&&(r.requireSelection&&((k=i==null?void 0:i.choice)==null?void 0:k[0])===Or?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),et.createElement(Ja,null,et.createElement(yt,{title:r.title,required:!1,appearance:t.appearance}),et.createElement(Xa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:k=>{l(!0),o({choice:[k.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:p("multipleChoiceSelect",t.appearance)},r.requireSelection&&et.createElement("option",{key:"null-value",value:Or,disabled:!0},(g=r.placeholder)!=null?g:"Select an option"),(y=r.props.options)==null?void 0:y.map(k=>et.createElement("option",{key:k.id,value:k.id},k.title))),((C=(S=r.props.options)==null?void 0:S.find(k=>{var I;return k.id===((I=i==null?void 0:i.choice)==null?void 0:I[0])}))==null?void 0:C.isOpenEnded)&&et.createElement(et.Fragment,null,et.createElement(yt,{title:(b=(v=(x=r.props.options)==null?void 0:x.find(k=>{var I;return k.id===((I=i==null?void 0:i.choice)==null?void 0:I[0])}))==null?void 0:v.openEndedLabel)!=null?b:"Please specify",required:!1,appearance:t.appearance}),et.createElement(Ar,{type:"text",placeholder:"Enter your answer here",onChange:k=>{o({choice:[k.target.value]})},appearance:t.appearance})),et.createElement(qt,{title:r.subtitle,appearance:t.appearance}))}import To,{useEffect as Ir,useState as zi}from"react";import Hi from"styled-components";import wo from"react";import bo from"react";var Wi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return bo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Qa=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>bo.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},bo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},bo.createElement(Wi,{color:n,size:t}),bo.createElement(Wi,{color:e,percentage:Math.max(o,.1),size:t})),i),Yt=Qa;import Za from"styled-components";var Ra=({color:e="#FFFFFF"})=>wo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ep={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},tp={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},op={border:"1px solid #000000",color:"#FFFFFF"},rp={border:"1px solid #C5CBD3"},ip={color:"#FFFFFF"},np={border:"1px solid #C5CBD3"},sp=e=>e==="square"?ep:tp,lp=(e,t)=>e==="square"?t?op:rp:t?ip:np,ap=Za.div`
|
|
350
351
|
${e=>Pe(e)}
|
|
351
|
-
`,at=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=lt,style:r,className:
|
|
352
|
+
`,at=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=lt,style:r,className:s})=>{let a=sp(t),d=lp(t,e);return e===!0?a=V(w(w({},a),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):a=w(w({},a),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?wo.createElement(Yt,{fillColor:o,percentage:i,size:22}):wo.createElement(ap,{styleOverrides:a,style:r,role:"checkbox",className:Te(p("checkIconContainer",n),p(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&wo.createElement(Ra,{color:"#FFFFFF"}))};var pp=Hi.div`
|
|
352
353
|
display: flex;
|
|
353
354
|
flex-direction: column;
|
|
354
355
|
width: 100%;
|
|
355
356
|
-webkit-appearance: none;
|
|
356
357
|
appearance: none;
|
|
357
|
-
`,dp=
|
|
358
|
+
`,dp=Hi.button`
|
|
358
359
|
${e=>E(e)} {
|
|
359
360
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
360
361
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -379,7 +380,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
379
380
|
height: 48px;
|
|
380
381
|
padding: 0 18px;
|
|
381
382
|
margin-bottom: 10px;
|
|
382
|
-
`;function
|
|
383
|
+
`;function Vi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[s,a]=zi((i==null?void 0:i.choice)||[]),[d,l]=zi(!1);return Ir(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),Ir(()=>{o({choice:s})},[s]),Ir(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[s]),To.createElement(pp,null,To.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>To.createElement(dp,{appearance:t.appearance,className:p(s.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){a(s.filter(g=>g!==c.id));return}s.length<r.props.maxChoices?a([...s,c.id]):s.length==1&&r.props.maxChoices==1&&a([c.id])}},c.title,To.createElement(at,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),To.createElement(qt,{title:r.subtitle,appearance:t.appearance}))}import Yo from"react";import ji from"styled-components";import cp from"dompurify";function se(e){return{__html:cp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var mp=ji.h1`
|
|
383
384
|
${e=>E(e)} {
|
|
384
385
|
font-style: normal;
|
|
385
386
|
font-weight: 700;
|
|
@@ -391,7 +392,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
391
392
|
margin-bottom: 4px;
|
|
392
393
|
color: ${e=>e.appearance.theme.colorText};
|
|
393
394
|
}
|
|
394
|
-
`,up=
|
|
395
|
+
`,up=ji.h2`
|
|
395
396
|
${e=>E(e)} {
|
|
396
397
|
font-style: normal;
|
|
397
398
|
font-weight: 400;
|
|
@@ -400,7 +401,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
400
401
|
letter-spacing: 0.28px;
|
|
401
402
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
402
403
|
}
|
|
403
|
-
`;function
|
|
404
|
+
`;function Ne({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return Yo.createElement(Yo.Fragment,null,Yo.createElement(mp,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:p(`${n}${n?So(i):i}Title`,e),dangerouslySetInnerHTML:se(t),size:i}),o&&Yo.createElement(up,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:p(`${n}${n?So(i):i}Subtitle`,e),dangerouslySetInnerHTML:se(o),size:i}))}import*as Lr from"react";var Gi=e=>Lr.createElement("svg",w({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Lr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var gp=Jo.div`
|
|
404
405
|
display: flex;
|
|
405
406
|
flex-direction: column;
|
|
406
407
|
justify-content: flex-end;
|
|
@@ -418,20 +419,20 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
418
419
|
`,Cp=Jo.div`
|
|
419
420
|
padding-left: 1px;
|
|
420
421
|
padding-right: 1px;
|
|
421
|
-
`,yp={text:
|
|
422
|
+
`,yp={text:Nr,multipleChoice:_i,multipleChoiceList:Vi},Mr="frigade-multiInputStepTypeData";function qi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:s,prefillData:a}){var B;let d=t.props,[l,m]=$r([]),[c,g]=$r([]),{userId:y}=Co(),[S,C]=$r(k()||(a?a[t.id]:null)||{}),{readonly:x}=fp(Z),v=w(w({},yp),s);Ki(()=>{i(l.length===0)},[l,i]),Ki(()=>{n(S)},[S]);function b(u,A){C(T=>{let P=V(w({},T),{[u.id]:A});return typeof window!="undefined"&&window.localStorage&&!x&&window.localStorage.setItem(I(),JSON.stringify(P)),P})}function k(){if(typeof window!="undefined"&&window.localStorage){let u=window.localStorage.getItem(I());if(u)return JSON.parse(u)}return null}function I(){return`${Mr}-${e}-${t.id}-${y}`}return Ot.createElement(Cp,{className:p("multiInput",r)},Ot.createElement(Ne,{appearance:r,title:t.title,subtitle:t.subtitle}),Ot.createElement(gp,{className:p("multiInputContainer",r)},(B=d==null?void 0:d.data)==null?void 0:B.map(u=>{let A=l.reverse().find(T=>T.id===u.id);return v[u.type]?Ot.createElement("span",{key:u.id,"data-field-id":u.id,className:p("multiInputField",r)},v[u.type]({formInput:u,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:T=>{!c.includes(u.id)&&T&&(T==null?void 0:T.text)!==""&&g(P=>[...P,u.id]),b(u,T)},inputData:S[u.id],setFormValidationErrors:T=>{T.length===0&&l.length===0||m(P=>T.length===0?P.filter(L=>L.id!==u.id):[...P,...T])}}),A&&A.message&&c.includes(u.id)&&A.hidden!==!0&&Ot.createElement(hp,{key:u.id,style:{overflow:"hidden"},appearance:r,className:p("multiInputValidationError",r)},Ot.createElement(xp,{appearance:r,className:p("multiInputValidationErrorIcon",r)},Ot.createElement(Gi,null)),A.message)):null})))}import Jt from"styled-components";var Yi=Jt.div`
|
|
422
423
|
align-items: center;
|
|
423
424
|
display: flex;
|
|
424
425
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
425
426
|
padding-top: 14px;
|
|
426
|
-
`,
|
|
427
|
+
`,Ji=Jt.div`
|
|
427
428
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
428
429
|
font-size: 12px;
|
|
429
|
-
`,
|
|
430
|
+
`,Xi=Jt.div`
|
|
430
431
|
display: flex;
|
|
431
432
|
gap: 12px;
|
|
432
433
|
width: 100%;
|
|
433
434
|
justify-content: flex-end;
|
|
434
|
-
`,
|
|
435
|
+
`,Qi=Jt.div`
|
|
435
436
|
display: flex;
|
|
436
437
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
437
438
|
// Otherwise, use 4px padding
|
|
@@ -439,11 +440,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
439
440
|
flex-grow: 1;
|
|
440
441
|
flex-basis: 0;
|
|
441
442
|
position: relative;
|
|
442
|
-
`,
|
|
443
|
+
`,Zi=Jt.div`
|
|
443
444
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
444
445
|
position: relative;
|
|
445
446
|
overflow-y: auto;
|
|
446
|
-
`,
|
|
447
|
+
`,Ri=Jt.div`
|
|
447
448
|
display: flex;
|
|
448
449
|
align-self: stretch;
|
|
449
450
|
flex-grow: 1;
|
|
@@ -455,7 +456,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
455
456
|
background-position: center;
|
|
456
457
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
457
458
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
458
|
-
`;import St from"react";import
|
|
459
|
+
`;import St from"react";import tn from"react";import on from"styled-components";import Sp from"styled-components";var en=Sp.div`
|
|
459
460
|
width: 24px;
|
|
460
461
|
height: 24px;
|
|
461
462
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -473,7 +474,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
473
474
|
transform: rotate(360deg);
|
|
474
475
|
}
|
|
475
476
|
}
|
|
476
|
-
`;var bp=
|
|
477
|
+
`;var bp=on.button`
|
|
477
478
|
justify-content: center;
|
|
478
479
|
align-content: center;
|
|
479
480
|
align-items: center;
|
|
@@ -506,7 +507,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
506
507
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
507
508
|
cursor: not-allowed;
|
|
508
509
|
}
|
|
509
|
-
`,Xo=
|
|
510
|
+
`,Xo=on.div`
|
|
510
511
|
${e=>E(e)} {
|
|
511
512
|
display: flex;
|
|
512
513
|
flex-direction: row;
|
|
@@ -517,9 +518,9 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
517
518
|
margin-right: 8px;
|
|
518
519
|
}
|
|
519
520
|
}
|
|
520
|
-
`,le=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:
|
|
521
|
+
`,le=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:a,withMargin:d=!0,classPrefix:l="",loading:m=!1,autoFocus:c=!1})=>{var y;function g(){let S=s?"buttonSecondary":"button";return l===""?S:`${l}${So(S)}`}return tn.createElement(bp,{tabindex:s?"0":"1",secondary:s,appearance:a,disabled:i||m,loading:(y=m==null?void 0:m.toString())!=null?y:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:p(g(),a),autoFocus:c},m?tn.createElement(en,{className:p("buttonLoader",a)}):t!=null?t:"Continue")};var rn=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:s,onBack:a,allowBackNavigation:d,errorMessage:l,isSaving:m})=>{var y;let c=s.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return St.createElement(St.Fragment,null,l!==null&&l!=null&&St.createElement(Ji,{appearance:o,className:p("formCTAError",o)},l),St.createElement(Yi,{showBackButton:c,className:p("formCTAContainer",o)},c&&St.createElement(le,{title:(y=e.backButtonTitle)!=null?y:"Back",onClick:a,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),St.createElement(Xi,{className:p("ctaWrapper",o)},e.secondaryButtonTitle?St.createElement(le,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?St.createElement(le,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o,loading:m}):null)))};import Dr from"react";import wp from"styled-components";var Tp=wp.div`
|
|
521
522
|
text-align: center;
|
|
522
|
-
`,
|
|
523
|
+
`,nn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ne().mergeAppearanceWithDefault(i);return Dr.createElement(Tp,{className:o},Dr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Dr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"#E6E6E6"}))))};import It from"react";import Xt from"styled-components";import{useContext as Fp}from"react";function fe(){let e=Fp(Z);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let s=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(n,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var kp=Xt.div`
|
|
523
524
|
display: flex;
|
|
524
525
|
flex-wrap: wrap;
|
|
525
526
|
align-content: center;
|
|
@@ -567,7 +568,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
567
568
|
margin-top: 12px;
|
|
568
569
|
margin-bottom: 16px;
|
|
569
570
|
max-width: 70%;
|
|
570
|
-
`;function
|
|
571
|
+
`;function sn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=fe();return It.createElement("div",null,It.createElement(Ep,{dangerouslySetInnerHTML:se(e.title)}),It.createElement(Ap,{dangerouslySetInnerHTML:se(e.subtitle)}),It.createElement(kp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>It.createElement(Pp,{key:r.title},It.createElement(vp,{src:r.imageUri}),It.createElement(Bp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var s;r.uri&&o(r.uri,(s=r.uriTarget)!=null?s:"_blank")}},r.title)))))}import Zt,{useEffect as _p}from"react";import Zo from"styled-components";import Ur from"react";var Qo=({style:e,className:t})=>Ur.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},Ur.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Ur.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import Lt,{useRef as Np,useState as Op}from"react";import Qt from"styled-components";var Ip=Qt.div`
|
|
571
572
|
display: flex;
|
|
572
573
|
align-items: center;
|
|
573
574
|
justify-content: flex-start;
|
|
@@ -613,7 +614,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
613
614
|
height: 100%;
|
|
614
615
|
min-height: 400px;
|
|
615
616
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
616
|
-
`;function tt({appearance:e,videoUri:t}){let
|
|
617
|
+
`;function tt({appearance:e,videoUri:t,autoplay:o=!1}){let i=Np(),[n,r]=Op(o);if(t.includes("youtube")){let s=t.split("v=")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Lt.createElement(Mp,{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:p("youtubePlayer",e)})}if(t.includes("vimeo")){let s=t.split("vimeo.com/")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Lt.createElement(Dp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${s}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("vimeoPlayer",e)})}if(t.includes("wistia")){let s=t.split("wistia.com/medias/")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Lt.createElement(Up,{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:p("wistiaPlayer",e)})}return Lt.createElement(Ip,{className:p("videoPlayerWrapper",e),appearance:e},!n&&Lt.createElement(Lp,{onClick:()=>{r(!0),i.current.play()},appearance:e},Lt.createElement(Qo,null)),Lt.createElement($p,{appearance:e,controls:n,ref:i,play:n,src:t,autoplay:o,muted:o}))}var Wp=Zo.div`
|
|
617
618
|
${e=>E(e)} {
|
|
618
619
|
display: flex;
|
|
619
620
|
flex-direction: column;
|
|
@@ -637,23 +638,23 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
637
638
|
max-height: 250px;
|
|
638
639
|
margin-bottom: 24px;
|
|
639
640
|
}
|
|
640
|
-
`;function
|
|
641
|
+
`;function ln({stepData:e,appearance:t,setCanContinue:o}){return _p(()=>{o(!0)},[]),Zt.createElement(Wp,{className:p("callToActionContainer",t)},Zt.createElement(Hp,{className:p("callToActionTextContainer",t)},Zt.createElement(Ne,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Zt.createElement(zp,{className:p("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Zt.createElement(Vp,{appearance:t,className:p("callToActionVideo",t)},Zt.createElement(tt,{appearance:t,videoUri:e.videoUri})))}import pt,{useEffect as _r,useState as Wr}from"react";import bt from"styled-components";var an=bt.div`
|
|
641
642
|
width: auto;
|
|
642
643
|
display: flex;
|
|
643
644
|
flex-direction: column;
|
|
644
645
|
justify-content: center;
|
|
645
646
|
align-items: center;
|
|
646
647
|
padding: 4px;
|
|
647
|
-
`,
|
|
648
|
+
`,pn=bt.div`
|
|
648
649
|
width: 100%;
|
|
649
650
|
text-align: left;
|
|
650
|
-
`,
|
|
651
|
+
`,dn=bt.h1`
|
|
651
652
|
font-style: normal;
|
|
652
653
|
font-weight: 700;
|
|
653
654
|
font-size: 32px;
|
|
654
655
|
line-height: 38px;
|
|
655
656
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
656
|
-
`,
|
|
657
|
+
`,cn=bt.h1`
|
|
657
658
|
font-style: normal;
|
|
658
659
|
font-weight: 400;
|
|
659
660
|
font-size: 16px;
|
|
@@ -661,7 +662,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
661
662
|
margin-top: 16px;
|
|
662
663
|
margin-bottom: 16px;
|
|
663
664
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
664
|
-
`,
|
|
665
|
+
`,mn=bt.div`
|
|
665
666
|
padding-top: 12px;
|
|
666
667
|
padding-bottom: 12px;
|
|
667
668
|
flex-direction: row;
|
|
@@ -672,17 +673,17 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
672
673
|
cursor: pointer;
|
|
673
674
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
674
675
|
width: 100%;
|
|
675
|
-
`,
|
|
676
|
+
`,un=bt.div`
|
|
676
677
|
padding-top: 10px;
|
|
677
678
|
padding-bottom: 10px;
|
|
678
679
|
flex-direction: row;
|
|
679
680
|
display: flex;
|
|
680
681
|
justify-content: flex-start;
|
|
681
|
-
`,
|
|
682
|
+
`,fn=bt.img`
|
|
682
683
|
width: 42px;
|
|
683
684
|
height: 42px;
|
|
684
685
|
margin-right: 12px;
|
|
685
|
-
`,
|
|
686
|
+
`,gn=bt.p`
|
|
686
687
|
font-style: normal;
|
|
687
688
|
font-weight: 500;
|
|
688
689
|
font-size: 17px;
|
|
@@ -690,8 +691,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
690
691
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
691
692
|
display: flex;
|
|
692
693
|
align-self: center;
|
|
693
|
-
`;var
|
|
694
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${_o(l)}: ${p};`).join(" ")} }`:`${_o(i)}: ${n};`).join(" ")} }`).join(" ")}`;function pe({appearance:e}){if(!e||!e.styleOverrides)return Fo.createElement(Fo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Fo.createElement(Fo.Fragment,null):Fo.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ve(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:m}=R(),c=p(e);function g(){return M(this,null,function*(){!o&&!r&&l(e)===Me&&s(m(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{g()},[r,e,t]),{}}var Cn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:S="center",repeatable:C=!1,onDismiss:x,showPagination:P=!1,allowBackNavigation:b=!1,validationHandler:v,showFrigadeBranding:$=!1,onFormDataChange:B,showFooter:u=!0,prefillData:O={},updateUrlOnPageChange:T=!1})=>{let{getFlow:k,getFlowSteps:I,isLoading:N,targetingLogicShouldHideFlow:A,getFlowStatus:H,getCurrentStepIndex:U,markFlowCompleted:te,markFlowNotStarted:X,markStepStarted:q}=R(),J=U(e),{mergeAppearanceWithDefault:Y}=ne(),[de,we]=Jp(null),{setOpenFlowState:Ne,getOpenFlowState:ce,hasOpenModals:Z}=Ee();Ve(e,i);let D=I(e);d=Y(d);let[ee,ke]=i!==void 0&&n!==void 0?[i,n]:[ce(e,!0),V=>Ne(e,V)],He=typeof window!="undefined"?window.location.hash:null;if(xn(()=>{var V;if(D&&D.length>0&&b){let z=typeof window!="undefined"&&((V=window==null?void 0:window.location)!=null&&V.hash)?window.location.hash.replace("#",""):"";if(D&&(D==null?void 0:D.length)>0){let L=-1;if(z){let W=z;L=D.findIndex(re=>re.id===W),de===z&&(L=-1)}L!==-1&&(we(z),q(e,D[L].id))}}},[He]),xn(()=>{!N&&D&&D.length&&typeof window!="undefined"&&b&&(we(D[J].id),window.location.hash=D[J].id)},[N,J,D]),N)return null;let ue=k(e);if(!ue||A(ue)||!D||i!==void 0&&i===!1||H(e)===ie&&s&&!C||(o=="modal"||o=="corner-modal")&&Z(e))return null;let me=()=>{ke(!1),x&&x(),y===!0&&te(e)};if(S=="center"&&o==="modal"||o==="large-modal"){let V={padding:"24px"};return o==="large-modal"?(V.width="85%",V.height="90%",V.maxHeight="800px",V.minHeight="500px",V.padding="0"):V.width="400px",ot.createElement(Re,{appearance:d,onClose:me,visible:ee,style:V,dismissible:g,showFrigadeBranding:$},ot.createElement(pe,{appearance:d}),ot.createElement(er,{appearance:d,steps:D,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:ke,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:b,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:T,repeatable:C}))}return o==="modal"&&S!=="center"?ot.createElement(jo,{appearance:d,onClose:me,visible:ee,modalPosition:S},ot.createElement(pe,{appearance:d}),ot.createElement(er,{appearance:d,steps:D,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:ke,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:b,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:T,repeatable:C})):ot.createElement(ot.Fragment,null,ot.createElement(pe,{appearance:d}),ot.createElement(er,{appearance:d,steps:D,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:ke,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:b,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:T,repeatable:C}))},yn=Cn;import{useCallback as Wr,useContext as Xp,useEffect as Qp}from"react";function zr(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(Q),{mutateUserFlowState:i}=De(),{config:n,apiUrl:r}=Ze(),l=jt(),{verifySDKInitiated:p}=Gt();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Qp(()=>{if(t&&e){if(t.startsWith(Kt))return;let g=d(t,e);localStorage.getItem(g)||(l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let s=Wr(g=>M(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 y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Wr((g,y)=>M(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 C={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),c=Wr((g,y)=>M(this,null,function*(){if(p())if(y){let S=d(t,g);localStorage.setItem(S,"true"),o(g);let C={foreignUserId:t,foreignUserGroupId:g,properties:y};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(C)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var Sn="frigade-xFrigade_guestUserId",Po="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=xo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=Co(),[l,p]=ko(n),{getFlowStatus:d}=R(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Zp(Q),[y,S]=ko([]),[C,x]=ko([]),{organizationId:P}=zr(),[b,v]=ko(P),[$,B]=ko(!1);Rt(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let I=t[k],N=s.find(A=>A.slug===(I==null?void 0:I.flowId));if(N&&I&&I.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!C.includes(N.slug)){setTimeout(()=>{u(I.flowId)},500);break}}},[o,t]),Rt(()=>{g.length>0&&i()},[g]),Rt(()=>{$||(B(!0),i())},[o,B]);function u(k){let I=s.find(N=>N.slug===k);I&&I.triggerType==="AUTOMATIC"&&!C.includes(I.slug)&&(x([...C,I.slug]),S([I]))}function O(){if(!n){let k=localStorage.getItem(Po);if(k){r(k);return}let I=localStorage.getItem(Sn);if(I){r(I);return}c(!0);let N=Kt+Rp();try{localStorage.setItem(Sn,N)}catch(A){console.log("Failed to save guest user id locally: Local storage unavailable",A)}r(A=>A||N)}}Rt(()=>{try{if(s){let k=[];s.forEach(I=>{if(I.data){let N=I.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(A=>{let H=A.replace('"imageUri":"',"").replace('"',"");if(k.includes(H))return;let U=new Image;U.src=H,k.push(H)})}})}}catch(k){}},[s]),Rt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Kt))try{localStorage.setItem(Po,n)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}n===null&&setTimeout(()=>{n===null&&O()},50)},[n,s,m]),Rt(()=>{P!=b&&(v(P),e([]),i())},[P,b,v]);function T(){return Lt.createElement(Lt.Fragment,null,y.map(k=>d(k.slug)!==Me?null:Lt.createElement("span",{key:k.slug},Lt.createElement(yn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Lt.createElement(Lt.Fragment,null,Lt.createElement(T,null))};var wn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function td(e){if(!e)return;let t=Ce({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),vo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ie(r,["as","children","overrides"]);let l=id(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,w(w({as:e},p),i),t);if(o!==void 0){let s=Ce(l,o);return Fn.createElement(rd,{theme:s},d())}return d()};var Bo={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(vo)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var tr={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var vn=Cd(vo)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),eo={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"},or={colors:j(w({},eo),{neutral:{foreground:eo.gray300},primary:{background:eo.blue500,foreground:eo.white,inverted:eo.blue500},negative:{foreground:eo.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:Bo,Text:tr}};var On="https://api.frigade.com",Q=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:lt,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 J,Y,de,we,Ne,ce;let[r,l]=je(t||null),[p,d]=je(o||null),[s,m]=je([]),[c,g]=je([]),[y,S]=je([]),[C,x]=je({}),[P,b]=je({}),[v,$]=je([]),[B,u]=je({}),[O,T]=je(!1),[k,I]=je(!1),[N,A]=je(!te(e)),H=(Z,D)=>{if(D==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},U={theme:w(w({},lt.theme),(Y=(J=i==null?void 0:i.defaultAppearance)==null?void 0:J.theme)!=null?Y:{}),styleOverrides:w(w({},lt.styleOverrides),(we=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?we:{})};function te(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}rr(()=>{t&&l(t)},[t]),rr(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Po)&&window.localStorage.getItem(Po)!==r&&Fd()},[r]),rr(()=>{o&&d(o)},[o]),rr(()=>{if(te(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let X={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:S,userProperties:C,setUserProperties:x,openFlowStates:P,setOpenFlowStates:b,completedFlowsToKeepOpenDuringSession:v,setCompletedFlowsToKeepOpenDuringSession:$,customVariables:B,setCustomVariables:u,isNewGuestUser:O,setIsNewGuestUser:T,hasActiveFullPageFlow:k,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:H,defaultAppearance:U,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:On,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0},{overrides:q}=Tn(U);return N?Eo.createElement(Q.Provider,{value:X},Eo.createElement(An,{theme:Ce(U.theme,or,q!=null?q:{},(Ne=i==null?void 0:i.theme)!=null?Ne:{})},n)):Eo.createElement(Q.Provider,{value:X},Eo.createElement(An,{theme:Ce(U.theme,or,q!=null?q:{},(ce=i==null?void 0:i.theme)!=null?ce:{})},n,Eo.createElement(bn,null)))};import hc from"react";import Se,{useEffect as mr,useState as il}from"react";import Je,{useState as Vd}from"react";import wt from"styled-components";import sr from"react";import $t from"react";import In from"styled-components";var Nn=In.span`
|
|
694
|
+
`;var hn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=Wr([]),[a,d]=Wr(!1),[l,m]=Wr(e.id);return _r(()=>{r.length==0&&!a&&(d(!0),o({choice:[]}))},[a]),_r(()=>{l!==e.id&&(m(e.id),s([]))},[e]),_r(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),pt.createElement(an,{className:p("selectListContainer",i)},pt.createElement(pn,null,pt.createElement(dn,{className:p("selectListTitle",i)},e.title),pt.createElement(cn,{appearance:i,className:p("selectListSubtitle",i)},e.subtitle)),n.options.map((c,g)=>{let y=r.includes(c.id);return pt.createElement(mn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(S=>S!==c.id));return}r.length<n.maxChoices?s([...r,c.id]):r.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:g===n.options.length-1,className:p("selectListSelectItem",i)},pt.createElement(un,{className:p("selectListItemImage",i)},c.imageUri&&pt.createElement(fn,{src:c.imageUri,alt:`select-icon-${g}`}),pt.createElement(gn,{appearance:i,className:p("selectListSelectItemText",i)},c.title)),pt.createElement(at,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import _e,{useEffect as xn,useState as Ro}from"react";var jp=({children:e,id:t,shouldWrap:o=!1})=>_e.createElement(_e.Fragment,null,o?_e.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),er=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:a,type:d,hideOnFlowCompletion:l,onComplete:m,setVisible:c,setShowModal:g,onDismiss:y,showPagination:S=!1,customFormElements:C,allowBackNavigation:x,validationHandler:v,onFormDataChange:b,showFooter:k,prefillData:I,updateUrlOnPageChange:B,repeatable:u})=>{var me;let T=w(w({},{linkCollection:sn,multiInput:qi,callToAction:ln,selectList:hn}),i),{primaryCTAClickSideEffects:P,secondaryCTAClickSideEffects:L}=fe(),[N,O]=Ro(!1),[H,_]=Ro({}),[R,J]=Ro(!1),[ee,K]=Ro(null),Y=(me=t[o])!=null?me:null,{markStepCompleted:de,markStepStarted:we,isLoading:Ie,updateCustomVariables:ce,markFlowCompleted:pe}=te();xn(()=>{ce(n)},[n,Ie]),xn(()=>{b&&b(H,M(),t[o],o)},[H]);function M(){var z;return{data:(z=H[t[o].id])!=null?z:{},stepId:t[o].id,customVariables:n}}function X(j,z,$){let W=o+1<t.length?t[o+1]:null;return s&&s(j,$,W,H,M()),r?r(j,o,z,W):!0}function ke(j,z){_($=>{let W={};return W[j.id]=z,w(w({},$),W)})}function He(j){return j.selectedStep.imageUri?_e.createElement(Ri,{image:j.selectedStep.imageUri,appearance:e,className:p("formContainerSidebarImage",e)}):null}let ue=k&&_e.createElement(rn,{step:t[o],canContinue:N&&!R,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>D(void 0,null,function*(){if(J(!0),v){let $=yield v(t[o],o,t[o+1],H,M());if($!==!0){K(typeof $=="string"?$:null),J(!1);return}else K(null)}let j=w({},M());yield de(a,t[o].id,j),o+1<t.length&&!x&&(yield we(a,t[o+1].id));let z=X(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),y&&y(),l&&z&&(c&&c(!1),g(!1)),yield pe(a),u&&(yield we(a,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(W=>{W.startsWith(Mr)&&window.localStorage.removeItem(W)}))),P(t[o]),J(!1),typeof window!="undefined"&&!x&&B&&o+1<t.length){let $=new URL(window.location.href);$.searchParams.set("p",t[o+1].id),window.history.pushState({},"",$.toString())}}),onSecondaryClick:()=>{X(t[o],"secondary",o),L(t[o])},onBack:()=>D(void 0,null,function*(){o-1>=0&&(J(!0),yield we(a,t[o-1].id),J(!1))}),steps:t,allowBackNavigation:x,errorMessage:ee,isSaving:R});return _e.createElement(_e.Fragment,null,_e.createElement(Qi,{className:p("formContainer",e)},_e.createElement(jp,{id:o,shouldWrap:d==="large-modal"},_e.createElement(Zi,{key:Y.id,type:d,className:p("formContent",e)},t.map(j=>{var $;let z=T[($=j.type)!=null?$:"multiInput"];return Y.id!==j.id?null:typeof z!="function"?z:_e.createElement(z,{key:j.id,stepData:j,canContinue:N,setCanContinue:O,onSaveData:W=>{ke(j,W)},appearance:e,customFormElements:C,flowId:a,prefillData:I})}),S&&_e.createElement(nn,{className:p("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ue)),d=="large-modal"&&_e.createElement(He,{selectedStep:t[o]})))};import Fo from"react";import{createGlobalStyle as Gp}from"styled-components";var Kp=Gp`
|
|
695
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,a])=>`${_o(s)}: ${a};`).join(" ")} }`:`${_o(i)}: ${n};`).join(" ")} }`).join(" ")}`;function oe({appearance:e}){if(!e||!e.styleOverrides)return Fo.createElement(Fo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Fo.createElement(Fo.Fragment,null):Fo.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ve(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:s,getFlowSteps:a,getCurrentStepIndex:d,targetingLogicShouldHideFlow:l,getFlow:m}=te(),c=a(e);function g(){return D(this,null,function*(){!o&&!r&&s(e)===De&&l(m(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{g()},[r,e,t]),{}}var yn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:a,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:S="center",repeatable:C=!1,onDismiss:x,showPagination:v=!1,allowBackNavigation:b=!1,validationHandler:k,showFrigadeBranding:I=!1,onFormDataChange:B,showFooter:u=!0,prefillData:A={},updateUrlOnPageChange:T=!1})=>{let{getFlow:P,getFlowSteps:L,isLoading:N,targetingLogicShouldHideFlow:O,getFlowStatus:H,getCurrentStepIndex:_,markFlowCompleted:R,markFlowNotStarted:J,markStepStarted:ee}=te(),K=_(e),{mergeAppearanceWithDefault:Y}=ne(),[de,we]=Jp(null),{setOpenFlowState:Ie,getOpenFlowState:ce,hasOpenModals:pe}=Ee();Ve(e,i);let M=L(e);d=Y(d);let[X,ke]=i!==void 0&&n!==void 0?[i,n]:[ce(e,!0),j=>Ie(e,j)],He=typeof window!="undefined"?window.location.hash:null;if(Cn(()=>{var j;if(M&&M.length>0&&b){let z=typeof window!="undefined"&&((j=window==null?void 0:window.location)!=null&&j.hash)?window.location.hash.replace("#",""):"";if(M&&(M==null?void 0:M.length)>0){let $=-1;if(z){let W=z;$=M.findIndex(re=>re.id===W),de===z&&($=-1)}$!==-1&&(we(z),ee(e,M[$].id))}}},[He]),Cn(()=>{!N&&M&&M.length&&typeof window!="undefined"&&b&&(we(M[K].id),window.location.hash=M[K].id)},[N,K,M]),N)return null;let ue=P(e);if(!ue||O(ue)||!M||i!==void 0&&i===!1||H(e)===ie&&l&&!C||(o=="modal"||o=="corner-modal")&&pe(e))return null;let me=()=>{ke(!1),x&&x(),y===!0&&R(e)};if(S=="center"&&o==="modal"||o==="large-modal"){let j={padding:"24px"};return o==="large-modal"?(j.width="85%",j.height="90%",j.maxHeight="800px",j.minHeight="500px",j.padding="0"):j.width="400px",ot.createElement(Re,{appearance:d,onClose:me,visible:X,style:j,dismissible:g,showFrigadeBranding:I},ot.createElement(oe,{appearance:d}),ot.createElement(er,{appearance:d,steps:M,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:ke,onDismiss:x,showPagination:v,customFormElements:s,allowBackNavigation:b,validationHandler:k,onFormDataChange:B,showFooter:u,prefillData:A,updateUrlOnPageChange:T,repeatable:C}))}return o==="modal"&&S!=="center"?ot.createElement(jo,{appearance:d,onClose:me,visible:X,modalPosition:S},ot.createElement(oe,{appearance:d}),ot.createElement(er,{appearance:d,steps:M,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:ke,onDismiss:x,showPagination:v,customFormElements:s,allowBackNavigation:b,validationHandler:k,onFormDataChange:B,showFooter:u,prefillData:A,updateUrlOnPageChange:T,repeatable:C})):ot.createElement(ot.Fragment,null,ot.createElement(oe,{appearance:d}),ot.createElement(er,{appearance:d,steps:M,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:ke,onDismiss:x,showPagination:v,customFormElements:s,allowBackNavigation:b,validationHandler:k,onFormDataChange:B,showFooter:u,prefillData:A,updateUrlOnPageChange:T,repeatable:C}))},Sn=yn;import{useCallback as zr,useContext as Xp,useEffect as Qp}from"react";function Hr(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(Z),{mutateUserFlowState:i}=Ue(),{config:n,apiUrl:r}=Ze(),s=Gt(),{verifySDKInitiated:a}=Kt();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Qp(()=>{if(t&&e){if(t.startsWith(Nt))return;let g=d(t,e);localStorage.getItem(g)||(s(`${r}userGroups`,V(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let l=zr(g=>D(this,null,function*(){if(!a())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 y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield s(`${r}userGroups`,V(w({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=zr((g,y)=>D(this,null,function*(){if(!a())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 C={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield s(`${r}userGroups`,V(w({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),c=zr((g,y)=>D(this,null,function*(){if(a())if(y){let S=d(t,g);localStorage.setItem(S,"true"),o(g);let C={foreignUserId:t,foreignUserGroupId:g,properties:y};yield s(`${r}userGroups`,V(w({},n),{method:"POST",body:JSON.stringify(C)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var tr="frigade-xFrigade_guestUserId",Po="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=xo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ue(),{userId:n,setUserId:r}=Co(),[s,a]=ko(n),{getFlowStatus:d}=te(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Zp(Z),[y,S]=ko([]),[C,x]=ko([]),{organizationId:v}=Hr(),[b,k]=ko(v),[I,B]=ko(!1);Rt(()=>{if(!o&&t)for(let P=0;P<t.length;P++){let L=t[P],N=l.find(O=>O.slug===(L==null?void 0:L.flowId));if(N&&L&&L.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!C.includes(N.slug)){setTimeout(()=>{u(L.flowId)},500);break}}},[o,t]),Rt(()=>{g.length>0&&i()},[g]),Rt(()=>{I||(B(!0),i())},[o,B]);function u(P){let L=l.find(N=>N.slug===P);L&&L.triggerType==="AUTOMATIC"&&!C.includes(L.slug)&&(x([...C,L.slug]),S([L]))}function A(){if(!n){let P=localStorage.getItem(Po);if(P){r(P);return}let L=localStorage.getItem(tr);if(L){r(L);return}c(!0);let N=Nt+Rp();try{localStorage.setItem(tr,N)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||N)}}Rt(()=>{try{if(l){let P=[];l.forEach(L=>{if(L.data){let N=L.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(O=>{let H=O.replace('"imageUri":"',"").replace('"',"");if(P.includes(H))return;let _=new Image;_.src=H,P.push(H)})}})}}catch(P){}},[l]),Rt(()=>{if(n!==s&&(e([]),i()),a(n),n&&!n.startsWith(Nt))try{localStorage.setItem(Po,n)}catch(P){console.log("Failed to save user id locally: Local storage available",P)}n===null&&setTimeout(()=>{n===null&&A()},50)},[n,l,m]),Rt(()=>{v!=b&&(k(v),e([]),i())},[v,b,k]);function T(){return $t.createElement($t.Fragment,null,y.map(P=>d(P.slug)!==De?null:$t.createElement("span",{key:P.slug},$t.createElement(Sn,{flowId:P.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return $t.createElement($t.Fragment,null,$t.createElement(T,null))};var wn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((s,a)=>{r[s]||(r[s]=a===n.length-1?i:{}),r=r[s]})}}),t}function td(e){if(!e)return;let t=Ce({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),vo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let s=id(),a={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,w(w({as:e},a),i),t);if(o!==void 0){let l=Ce(s,o);return Fn.createElement(rd,{theme:l},d())}return d()};var Bo={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(vo)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var or={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var vn=Cd(vo)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),eo={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"},rr={colors:V(w({},eo),{neutral:{foreground:eo.gray300},primary:{background:eo.blue500,foreground:eo.white,inverted:eo.blue500},negative:{foreground:eo.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:Bo,Text:or}};var Nn="https://api.frigade.com",Z=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:lt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Nn,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 Y,de,we,Ie,ce,pe;let r=typeof window!="undefined"?localStorage.getItem(tr):null,[s,a]=je(t||r),[d,l]=je(o||null),[m,c]=je([]),[g,y]=je([]),[S,C]=je([]),[x,v]=je({}),[b,k]=je({}),[I,B]=je([]),[u,A]=je({}),[T,P]=je(!1),[L,N]=je(!1),[O,H]=je(!J(e)),_=(M,X)=>{if(X==="_blank"){window.open(M,"_blank");return}setTimeout(()=>{window.location.href=M},50)},R={theme:w(w({},lt.theme),(de=(Y=i==null?void 0:i.defaultAppearance)==null?void 0:Y.theme)!=null?de:{}),styleOverrides:w(w({},lt.styleOverrides),(Ie=(we=i==null?void 0:i.defaultAppearance)==null?void 0:we.styleOverrides)!=null?Ie:{})};function J(M){return!!(M&&M.length>10&&M.substring(0,10)==="api_public")}ir(()=>{t&&a(t)},[t]),ir(()=>{s&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Po)&&window.localStorage.getItem(Po)!==s&&Fd()},[s]),ir(()=>{o&&l(o)},[o]),ir(()=>{if(J(e))H(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),H(!0);return}},[e,H]);let ee={publicApiKey:e,userId:s,setUserId:a,setFlows:c,flows:m,failedFlowResponses:g,setFailedFlowResponses:y,flowResponses:S,setFlowResponses:C,userProperties:x,setUserProperties:v,openFlowStates:b,setOpenFlowStates:k,completedFlowsToKeepOpenDuringSession:I,setCompletedFlowsToKeepOpenDuringSession:B,customVariables:u,setCustomVariables:A,isNewGuestUser:T,setIsNewGuestUser:P,hasActiveFullPageFlow:L,setHasActiveFullPageFlow:N,organizationId:d,setOrganizationId:l,navigate:i&&i.navigate?i.navigate:_,defaultAppearance:R,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:H,apiUrl:i&&i.apiUrl?i.apiUrl:Nn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0},{overrides:K}=Tn(R);return O?Eo.createElement(Z.Provider,{value:ee},Eo.createElement(An,{theme:Ce(R.theme,rr,K!=null?K:{},(ce=i==null?void 0:i.theme)!=null?ce:{})},n)):Eo.createElement(Z.Provider,{value:ee},Eo.createElement(An,{theme:Ce(R.theme,rr,K!=null?K:{},(pe=i==null?void 0:i.theme)!=null?pe:{})},n,Eo.createElement(bn,null)))};import hc from"react";import Se,{useEffect as ur,useState as il}from"react";import Je,{useState as Vd}from"react";import wt from"styled-components";import lr from"react";import Mt from"react";import In from"styled-components";var On=In.span`
|
|
695
696
|
font-weight: 600;
|
|
696
697
|
font-size: 14px;
|
|
697
698
|
font-style: normal;
|
|
@@ -712,7 +713,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
712
713
|
padding-right: 8px;
|
|
713
714
|
width: 100%;
|
|
714
715
|
${e=>Pe(e)}
|
|
715
|
-
`,
|
|
716
|
+
`,nr=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:a})=>Mt.createElement(Mt.Fragment,null,Mt.createElement(Pd,{className:p("checklistStepsContainer",a),appearance:a,styleOverrides:w({},n)},i==="left"&&e&&Mt.createElement(On,{className:p("checklistStepLabel",a),styleOverrides:o,appearnace:a},e),Mt.createElement(at,{appearance:a,value:t,type:s,primaryColor:r}),i==="right"&&e&&Mt.createElement(On,{className:p("checklistStepLabel",a),styleOverrides:o,appearance:a},e)),Mt.createElement(oe,{appearance:a}));import Ao from"styled-components";var Ln=Ao.div`
|
|
716
717
|
font-weight: 700;
|
|
717
718
|
font-size: 18px;
|
|
718
719
|
line-height: 22px;
|
|
@@ -733,7 +734,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
733
734
|
letter-spacing: 0.28px;
|
|
734
735
|
margin: 8px 0px 0px 0px;
|
|
735
736
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
736
|
-
`,
|
|
737
|
+
`,sr=Ao.div`
|
|
737
738
|
width: 6px;
|
|
738
739
|
position: absolute;
|
|
739
740
|
left: 0;
|
|
@@ -745,14 +746,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
745
746
|
justify-content: flex-start;
|
|
746
747
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
747
748
|
padding-right: 16px;
|
|
748
|
-
`;var Un=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:
|
|
749
|
+
`;var Un=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var a,d,l,m,c;return lr.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&lr.createElement(sr,{className:p("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(a=s==null?void 0:s.theme)==null?void 0:a.colorPrimary)!=null?d:i}}),lr.createElement(Dn,{className:p("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},lr.createElement(nr,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:n,primaryColor:(c=(m=s==null?void 0:s.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:s})))};import Dt from"react";import Vr from"styled-components";import ar from"styled-components";var fC=ar.h1`
|
|
749
750
|
display: flex;
|
|
750
751
|
margin: 0;
|
|
751
752
|
font-size: 18px;
|
|
752
|
-
`,gC=
|
|
753
|
+
`,gC=ar.h2`
|
|
753
754
|
font-size: 15px;
|
|
754
755
|
color: #4d4d4d;
|
|
755
|
-
`,_n=
|
|
756
|
+
`,_n=ar.div`
|
|
756
757
|
position: absolute;
|
|
757
758
|
left: 0;
|
|
758
759
|
top: 0;
|
|
@@ -761,7 +762,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
761
762
|
border-radius: 20px;
|
|
762
763
|
background-color: ${e=>e.theme.colorPrimary};
|
|
763
764
|
transition: width 0.5s;
|
|
764
|
-
`,Wn=
|
|
765
|
+
`,Wn=ar.div`
|
|
765
766
|
position: relative;
|
|
766
767
|
left: 0;
|
|
767
768
|
top: 0;
|
|
@@ -771,7 +772,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
771
772
|
border-radius: 20px;
|
|
772
773
|
background-color: ${e=>e.theme.colorPrimary};
|
|
773
774
|
opacity: 0.12;
|
|
774
|
-
`;var vd=
|
|
775
|
+
`;var vd=Vr.div`
|
|
775
776
|
display: flex;
|
|
776
777
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
777
778
|
justify-content: flex-start;
|
|
@@ -779,23 +780,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
779
780
|
width: 100%;
|
|
780
781
|
|
|
781
782
|
${e=>Pe(e)}
|
|
782
|
-
`,Bd=
|
|
783
|
+
`,Bd=Vr.div`
|
|
783
784
|
flex-grow: 1;
|
|
784
785
|
position: relative;
|
|
785
786
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
786
|
-
`,Ed=
|
|
787
|
+
`,Ed=Vr.span`
|
|
787
788
|
font-weight: 600;
|
|
788
789
|
font-size: 14px;
|
|
789
790
|
line-height: 18px;
|
|
790
791
|
padding-right: ${e=>e.padding};
|
|
791
792
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
792
793
|
${e=>Pe(e)}
|
|
793
|
-
`;var
|
|
794
|
+
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var g;if(t===0)return Dt.createElement(Dt.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=s==null?void 0:s.theme)==null?void 0:g.colorText});let a=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(m="0px"),Dt.createElement(vd,{className:p("progressBarContainer",s),textLocation:i,styleOverrides:n},Dt.createElement(Ed,{className:p("progressBarStepText",s),styleOverrides:V(w({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:m,textLocation:i},c),Dt.createElement(Bd,{textLocation:i,className:p("progressBar",s)},Dt.createElement(_n,{style:{zIndex:o=="compact"?1:5},fgWidth:a,barHeight:d,appearance:s,className:p("progressBarFill",s)}),Dt.createElement(Wn,{className:p("progressBarBackground",s),barHeight:d,appearance:s})))};import No from"react";import Nd from"styled-components";import dr from"react";import pr from"react";var to=({stepData:e,appearance:t})=>pr.createElement(pr.Fragment,null,pr.createElement($n,{appearance:t,className:p("checklistStepTitle",t),dangerouslySetInnerHTML:se(e.title)}),pr.createElement(Mn,{appearance:t,className:p("checklistStepSubtitle",t),dangerouslySetInnerHTML:se(e.subtitle)}));import jr from"react";var oo=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return jr.createElement(Xo,{className:p("ctaContainer",t)},jr.createElement(le,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&jr.createElement(le,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var ro=({stepData:e,appearance:t})=>dr.createElement(dr.Fragment,null,dr.createElement(to,{stepData:e,appearance:t}),dr.createElement(oo,{stepData:e,appearance:t}));import Ad from"react";function zn(e){return Ad.createElement(tt,{appearance:e.appearance,videoUri:e.videoUri,autoplay:e.autoplay})}var Gr="default",Od=Nd.img`
|
|
794
795
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
795
796
|
width: 100%;
|
|
796
797
|
height: auto;
|
|
797
798
|
min-height: 200px;
|
|
798
|
-
`,Hn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let
|
|
799
|
+
`,Hn=({stepData:e,appearance:t})=>{var o;if(e!=null&&e.StepContent){let i=e.StepContent;return No.createElement("div",null,i)}return No.createElement(Ln,{className:p("checklistStepContent",t)},e.imageUri?No.createElement(Od,{className:p("checklistStepImage",t),src:e.imageUri,style:e.imageStyle,appearance:t}):null,e.videoUri?No.createElement(zn,{videoUri:e.videoUri,appearance:t,autoplay:(o=e.props)==null?void 0:o.autoplayVideo}):null,No.createElement(ro,{stepData:e,appearance:t}))};import ze,{useRef as Id,useState as Ld}from"react";import io from"styled-components";var Vn=io.div`
|
|
799
800
|
display: block;
|
|
800
801
|
`,$d=io.div`
|
|
801
802
|
display: flex;
|
|
@@ -840,9 +841,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
840
841
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
841
842
|
border-radius: 50%;
|
|
842
843
|
}
|
|
843
|
-
`,jn="videoCarousel",Gn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return
|
|
844
|
+
`,jn="videoCarousel",Gn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return ze.createElement(Vn,null,ze.createElement(ro,{stepData:e,appearance:t}));function o({video:r}){let s=Id(),[a,d]=Ld(!1);return ze.createElement(Md,null,!a&&ze.createElement(_d,{onClick:()=>{d(!0),s.current.play()},appearance:t},ze.createElement(Qo,null)),ze.createElement(Dd,{controls:a,ref:s,play:a,src:r.uri}),ze.createElement(Ud,null,r.title))}let i=e.props;return i.videos?ze.createElement(Vn,null,ze.createElement(to,{stepData:e,appearance:t}),ze.createElement($d,null,i.videos.map((r,s)=>ze.createElement("span",{key:`${r.uri}-${s}`},ze.createElement(o,{video:r})))),ze.createElement(oo,{stepData:e,appearance:t})):null};import dt from"react";import cr from"styled-components";var Kn=cr.div`
|
|
844
845
|
display: block;
|
|
845
|
-
`,Wd=
|
|
846
|
+
`,Wd=cr.pre`
|
|
846
847
|
display: block;
|
|
847
848
|
background-color: #2a2a2a;
|
|
848
849
|
color: #f8f8f8;
|
|
@@ -858,14 +859,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
858
859
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
859
860
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
860
861
|
margin-bottom: 24px;
|
|
861
|
-
`,zd=
|
|
862
|
+
`,zd=cr.div`
|
|
862
863
|
font-size: 15px;
|
|
863
864
|
line-height: 20px;
|
|
864
865
|
margin-bottom: 12px;
|
|
865
866
|
margin-top: 12px;
|
|
866
|
-
`,Hd=
|
|
867
|
+
`,Hd=cr.div`
|
|
867
868
|
margin-top: 24px;
|
|
868
|
-
`,qn="codeSnippet",Yn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return dt.createElement(Kn,null,dt.createElement(ro,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?dt.createElement(Kn,{className:
|
|
869
|
+
`,qn="codeSnippet",Yn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return dt.createElement(Kn,null,dt.createElement(ro,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?dt.createElement(Kn,{className:p("codeSnippetContainer",t)},dt.createElement(to,{stepData:e,appearance:t}),dt.createElement(Hd,null,o.codeSnippets.map((n,r)=>dt.createElement("div",{key:r},n.title?dt.createElement(zd,{dangerouslySetInnerHTML:se(n.title)}):null,n.code?dt.createElement(Wd,null,n.code):null))),dt.createElement(oo,{stepData:e,appearance:t})):null};var jd=wt.div`
|
|
869
870
|
display: flex;
|
|
870
871
|
flex-direction: row;
|
|
871
872
|
overflow: hidden;
|
|
@@ -906,9 +907,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
906
907
|
`,Qd=wt.div`
|
|
907
908
|
flex: 2;
|
|
908
909
|
padding: 40px 40px 40px 0px;
|
|
909
|
-
`,Zd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:
|
|
910
|
+
`,Zd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:a=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=ne();d=m(d);let c={[Gr]:Hn,[jn]:Gn,[qn]:Yn},g=w(w({},c),a),[y,S]=Vd(0),C=n!=null?n:y,x=r!=null?r:S,v=o.filter(k=>k.complete===!0).length,b=()=>{var k;return!((k=o[C])!=null&&k.type)||!g[o[C].type]?g[Gr]({stepData:o[C],appearance:d}):typeof g[o[C].type]!="function"?g[o[C].type]:g[o[C].type]({stepData:o[C],appearance:d})};return Je.createElement(jd,{type:l,styleOverrides:i,className:s,appearance:d},Je.createElement(Yd,{className:p("checklistHeaderContainer",d),appearance:d},Je.createElement(qd,{className:p("checklistHeader",d),appearance:d},Je.createElement(Gd,{className:p("checklistTitle",d),appearance:d},e),Je.createElement(Kd,{className:p("checklistSubtitle",d),appearance:d},t),Je.createElement(We,{total:o.length,count:v,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Je.createElement(Jd,{className:p("checklistStepsContainer",d)},o.map((k,I)=>Je.createElement(Un,{data:k,index:I,key:I,listLength:o.length,isSelected:I===C,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{x(I)},appearance:d})))),Je.createElement(Xd,{appearance:d,className:p("checklistDivider",d)}),Je.createElement(Qd,null,Je.createElement(b,null)))},Kr=Zd;import G,{useState as rc}from"react";import Jn from"react";import Rd from"styled-components";var ec=Rd.svg`
|
|
910
911
|
transition: 'transform 0.35s ease-in-out';
|
|
911
|
-
`,no=({style:e,className:t})=>Jn.createElement(ec,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Jn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import be from"styled-components";var
|
|
912
|
+
`,no=({style:e,className:t})=>Jn.createElement(ec,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Jn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import be from"styled-components";var qr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Xn=be.div`
|
|
912
913
|
max-height: 350px;
|
|
913
914
|
padding-bottom: 40px;
|
|
914
915
|
`,Qn=be.div`
|
|
@@ -1121,7 +1122,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1121
1122
|
line-height: 14px;
|
|
1122
1123
|
font-weight: 400;
|
|
1123
1124
|
cursor: pointer;
|
|
1124
|
-
`;var oc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:
|
|
1125
|
+
`;var oc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=fe();return mt.createElement(gs,{style:t,className:p("guideContainer",n)},mt.createElement(xs,{className:p("guideTitle",n)},o),mt.createElement(hs,{className:p("guideItemContainer",n)},e.map((a,d)=>{var l;return mt.createElement(Cs,{key:`guide-${(l=a.id)!=null?l:d}`,className:p("guideItem",n)},a.icon&&mt.createElement(ys,{className:p("guideIcon",n)},mt.createElement(Ss,null,a.icon)),mt.createElement(bs,{className:p("guideItemTitle",n),dangerouslySetInnerHTML:se(a.title)}),mt.createElement(ws,{className:p("guideItemSubtitle",n),dangerouslySetInnerHTML:se(a.subtitle)}),mt.createElement(Ts,{className:p("guideItemLink",n),color:i,onClick:()=>{a.primaryButtonUri&&s(a),r&&r(a)}},a.primaryButtonTitle))})))},Oo=oc;var ic=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:a,customStepTypes:d,appearance:l,guideData:m,guideTitle:c,onGuideButtonClick:g})=>{let y=({stepData:u,handleSecondaryCTAClick:A,handleCTAClick:T})=>u?G.createElement(ns,{className:p("checklistStepContainer",l),"data-testid":"checklistStepContainer"},G.createElement(ss,{appearance:l,className:p("checklistStepTitle",l),dangerouslySetInnerHTML:se(u.title)}),G.createElement(ls,{appearance:l,className:p("checklistStepSubtitle",l),dangerouslySetInnerHTML:se(u.subtitle)}),G.createElement(as,{className:p("checklistCTAContainer",l)},u.secondaryButtonTitle&&G.createElement(le,{title:u.secondaryButtonTitle,onClick:A,appearance:l,secondary:!0}),G.createElement(le,{title:u.primaryButtonTitle,onClick:T,appearance:l}))):G.createElement(G.Fragment,null),C=w(w({},{default:u=>{var L;if((L=e[b])!=null&&L.StepContent){let N=e[b].StepContent;return G.createElement("div",null,N)}let A=e[b];return G.createElement(y,{stepData:u,handleCTAClick:()=>{A.handlePrimaryButtonClick&&A.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{A.handleSecondaryButtonClick&&A.handleSecondaryButtonClick()}})}}),d),[x,v]=rc(0),b=s!=null?s:x,k=a!=null?a:v,I=()=>{var u;return e?!((u=e[b])!=null&&u.type)||!C[e[b].type]?C.default(e[b]):typeof C[e[b].type]!="function"?C[e[b].type]:C[e[b].type]({stepData:e[b],primaryColor:l.theme.colorPrimary}):G.createElement(G.Fragment,null)},B=e.filter(u=>u.complete).length;return n?(l.theme.modalContainer||(l.theme.borderRadius&&(qr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=qr),G.createElement(Re,{onClose:r,visible:n,appearance:l},G.createElement(us,null,G.createElement(Qn,null,G.createElement(Zn,{appearance:l,className:p("checklistTitle",l)},t),G.createElement(Rn,{appearance:l,className:p("checklistSubtitle",l)},o)),G.createElement(Xn,null,e&&e.length>0&&G.createElement(es,{className:p("stepsContainer",l)},G.createElement(ts,null,G.createElement("div",{style:{flex:3}},G.createElement(os,{className:p("stepsTitle",l)},i)),G.createElement(ms,null,G.createElement(We,{style:{width:"100%"},count:B,total:e.length,appearance:l}))),G.createElement(rs,null,G.createElement(is,{className:p("checklistStepListContainer",l),appearance:l},e.map((u,A)=>{var P;let T=b===A;return G.createElement(ps,{selected:T,className:p(`checklistStepListItem${T?"Selected":""}`,l),key:`checklist-guide-step-${(P=u.id)!=null?P:A}`,disabled:u.blocked,onClick:()=>{u.blocked||k(A)},title:u.blocked?"Finish remaining steps to continue":void 0},T&&G.createElement(sr,{className:p("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),G.createElement(ds,{selected:T,className:p(`checklistStepListStepName${T?"Selected":""}`,l)},u.stepName),G.createElement(cs,null,G.createElement(at,{value:u.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:u.progress,appearance:l}),G.createElement(fs,null,G.createElement(no,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),G.createElement(I,null))),m&&m.length>0&&G.createElement(Oo,{steps:m,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:u=>(g&&g(u),!0)}))))):G.createElement(G.Fragment,null)},Yr=ic;import Me,{useEffect as mr,useState as nc}from"react";import Fe from"react";import ut from"styled-components";var Fs=ut.div`
|
|
1125
1126
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1126
1127
|
border: 1px solid;
|
|
1127
1128
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1171,12 +1172,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1171
1172
|
font-weight: 400;
|
|
1172
1173
|
font-size: 14px;
|
|
1173
1174
|
line-height: 22px;
|
|
1174
|
-
`,
|
|
1175
|
+
`,Ns=ut.div`
|
|
1175
1176
|
display: flex;
|
|
1176
1177
|
flex-direction: row;
|
|
1177
1178
|
justify-content: flex-start;
|
|
1178
1179
|
align-items: center;
|
|
1179
|
-
`;var
|
|
1180
|
+
`;var Os=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,g;let a=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function l(){var y,S;return Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(ks,{className:p("stepMediaContainer",r)},e.imageUri?Fe.createElement(Ps,{className:p("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Fe.createElement(tt,{appearance:r,videoUri:e.videoUri,autoplay:(y=e.props)==null?void 0:y.autoplayVideo}):null):null,Fe.createElement(As,{className:p("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:se(e.subtitle)}),Fe.createElement(Xo,{className:p("checklistCTAContainer",r)},e.secondaryButtonTitle?Fe.createElement(le,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Fe.createElement(le,{title:(S=e.primaryButtonTitle)!=null?S:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!s)return null;let y=s[e.type];return y?typeof y!="function"?y:y(e,r):null}return Fe.createElement(Fs,{"data-testid":`step-${e.id}`,className:p("checklistStepContainer",r),appearance:r},Fe.createElement(vs,{className:p("stepHeader",r),onClick:()=>o()},Fe.createElement(Ns,null,Fe.createElement(nr,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),Fe.createElement(Bs,{appearance:r,className:p("stepTitle",r),dangerouslySetInnerHTML:se(e.title)})),Fe.createElement(Es,{className:p("stepChevronContainer",r),appearance:r},Fe.createElement(no,{style:V(w({},a),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:w({},d)},(g=m())!=null?g:l()))};import so from"styled-components";var v0=so.div`
|
|
1180
1181
|
background: #ffffff;
|
|
1181
1182
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1182
1183
|
border-radius: 6px;
|
|
@@ -1217,7 +1218,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1217
1218
|
padding: 24px;
|
|
1218
1219
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1219
1220
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1220
|
-
`;var sc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:
|
|
1221
|
+
`;var sc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:a=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:g,customStepTypes:y,style:S})=>{let C=o.filter(B=>B.complete).length,[x,v]=nc(Array(o.length).fill(!0));mr(()=>{let B=[...x];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){B[u]=!1;break}v(B)}},[]),mr(()=>{r&&b(d)},[d]),mr(()=>{a&&x[d]&&b(d)},[d]),mr(()=>{},[o]);let b=B=>{let u=[...x];if(s)for(let A=0;A<x.length;++A)A!=B&&u[B]&&(u[A]=!0);u[B]=!x[B],v(u)};if(!n&&c=="modal")return Me.createElement(Me.Fragment,null);let k=Me.createElement(Me.Fragment,null,Me.createElement(Is,null,Me.createElement(Ls,{appearance:m,className:p("checklistTitle",m),dangerouslySetInnerHTML:se(e)}),Me.createElement($s,{appearance:m,className:p("checklistSubtitle",m),dangerouslySetInnerHTML:se(t)})),Me.createElement(We,{display:"percent",count:C,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),I=Me.createElement(Ms,{className:Te(p("checklistContainer",m),g)},o.map((B,u)=>{var T;let A=x[u];return Me.createElement(Os,{appearance:m,stepData:B,collapsed:A,key:`modal-checklist-${(T=B.id)!=null?T:u}`,onClick:()=>{d==u?b(u):l(u)},onPrimaryButtonClick:()=>{a&&u<o.length-1&&l(u+1),B.handlePrimaryButtonClick&&B.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{B.handleSecondaryButtonClick&&B.handleSecondaryButtonClick()},customStepTypes:y})}));return c==="inline"?Me.createElement(Ds,{appearance:m,className:Te(p("checklistInlineContainer",m),g),style:S},k,I):Me.createElement(Me.Fragment,null,Me.createElement(Re,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:k},I))},Jr=sc;import xe,{useEffect as Xr,useRef as fc,useState as Ut}from"react";import{useEffect as lc,useState as ac}from"react";var Us=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([a])=>[a,!1])),[o,i]=ac(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let a=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let m=window.matchMedia(l);return m.addEventListener("change",r),[d,m.matches]}));i(a)};return lc(()=>{s()},[]),o};import lo from"react";import ye,{css as _s,keyframes as Ws}from"styled-components";var zs=_s`
|
|
1221
1222
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1222
1223
|
`,pc=_s`
|
|
1223
1224
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
@@ -1359,7 +1360,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1359
1360
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1360
1361
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1361
1362
|
`}
|
|
1362
|
-
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ne(),{primaryCTAClickSideEffects:n}=fe();o=i(o);let{imageUri:r=null,subtitle:
|
|
1363
|
+
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ne(),{primaryCTAClickSideEffects:n}=fe();o=i(o);let{imageUri:r=null,subtitle:s=null,title:a=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return lo.createElement(qs,{className:p("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&lo.createElement(Ys,{className:p("carouselCardImage",o),src:r,alt:a,style:{opacity:d||l?.4:1}}),d&&lo.createElement(Xs,{className:p("carouselCompletedPill",o)},lo.createElement(el,{style:{color:"#108E0B"}},"Complete")),a&&lo.createElement(Rs,{blocked:l,complete:d,className:p("carouselCardTitle",o)},a),s&&lo.createElement(Tt.Quiet,{blocked:l,complete:d,className:p("carouselCardSubtitle",o)},s))};var gc=()=>xe.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xe.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),xe.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),xe.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),ol=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=Ut(!1),[r,s]=Ut(!1);Xr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let a=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?xe.createElement(js,{style:d,reversed:r,onAnimationEnd:r?a:null},xe.createElement(Gs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},xe.createElement(gc,null))):null},rl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=fc(null),[r,s]=Ut(!1),[a,d]=Ut(!1),[l,m]=Ut(null),[c,g]=Ut([]),[y,S]=Ut(0),{isSmall:C}=Us(),x=C?1:3,{getFlowMetadata:v,getFlowSteps:b,getNumberOfStepsCompleted:k,updateCustomVariables:I,isLoading:B}=te();Xr(()=>{I(o)},[o,B]),Xr(()=>{if(B)return;let N=v(e),O=k(e),H=b(e);m(N),(N.data!==null||N.steps!==null)&&(g(H.sort((_,R)=>Number(_.complete)-Number(R.complete))),d(H.length>x),S(O))},[B]);let u=[];for(let N=0;N<c.length;N+=x)u.push(c.slice(N,N+x));let A=N=>{let O=N.target,H=O.scrollWidth-O.clientWidth,_=Math.ceil(O.scrollLeft);_>0&&r===!1&&s(!0),_===0&&r===!0&&s(!1),_<H&&a===!1&&d(!0),_===H&&a===!0&&d(!1)},T=(N=!0)=>{let O=N?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*O,behavior:"smooth"})},P=null,L=N=>{P!==null?clearTimeout(P):A(N),P=setTimeout(()=>{A(N)},16)};return B?null:xe.createElement(Js,{className:Te(p("carouselContainer",t),i)},xe.createElement("div",{style:{display:"flex",justifyContent:C?"center":"space-between",marginBottom:20,flexWrap:C?"wrap":"nowrap",gap:C?16:20}},xe.createElement("div",null,xe.createElement(Qs,{className:p("carouselTitle",t)},l==null?void 0:l.title),xe.createElement(Tt.Quiet,{className:p("carouselSubtitle",t)},l==null?void 0:l.subtitle)),xe.createElement(Zs,{className:p("progressWrapper",t)},xe.createElement(We,{count:y,total:c.length,appearance:t}))),xe.createElement("div",{style:{position:"relative"}},xe.createElement(ol,{show:r,onClick:()=>T(!1)}),xe.createElement(ol,{side:"right",show:a,onClick:T}),xe.createElement(Hs,{ref:n,onScroll:L},u.map((N,O)=>xe.createElement(Vs,{key:O,style:{flex:`0 0 calc(100% - ${c.length>x?36:0}px)`}},N.map((H,_)=>xe.createElement(tl,{key:_,stepData:H,style:{flex:c.length>x?`0 1 calc(100% / ${x} - 16px * 2 / ${x})`:1},appearance:t})))))),xe.createElement(oe,{appearance:t}))};var Qr=I=>{var B=I,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:a,visible:d,customVariables:l,onStepCompletion:m,onButtonClick:c,appearance:g,hideOnFlowCompletion:y,setVisible:S,customStepTypes:C,checklistStyle:x="default",autoExpandFirstIncompleteStep:v,autoExpandNextStep:b}=B,k=Le(B,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:u,getFlowSteps:A,markStepCompleted:T,getStepStatus:P,getNumberOfStepsCompleted:L,isLoading:N,targetingLogicShouldHideFlow:O,updateCustomVariables:H,getFlowMetadata:_,isStepBlocked:R,getFlowStatus:J,hasActiveFullPageFlow:ee,setHasActiveFullPageFlow:K,markStepStarted:Y,getCurrentStepIndex:de}=te(),{primaryCTAClickSideEffects:we,secondaryCTAClickSideEffects:Ie}=fe(),{getOpenFlowState:ce,setOpenFlowState:pe}=Ee(),[M,X]=il(n||0),[ke,He]=il(!1),ue=d===void 0?ce(e):d,me=s==="modal",{mergeAppearanceWithDefault:j}=ne();Ve(e,d);let z=A(e),$=de(e);if(g=j(g),ur(()=>{H(l)},[l,N]),ur(()=>{d!==void 0&&(me&&d===!0?K(!0):me&&d===!1&&K(!1))},[d,S,ee]),ur(()=>{!N&&z&&z[M]&&P(e,z[M].id)&&P(e,z[M].id)!==$e&&Y(e,z[M].id)},[M]),ur(()=>{M!==$&&X($)},[$]),N)return null;let W=u(e);if(!W||O(W)||!z||y===!0&&J(e)===ie)return null;let re=_(e);if(re!=null&&re.title&&(t=re.title),re!=null&&re.subtitle&&(o=re.subtitle),!ke&&n===void 0&&L(e)>0){let f=z.findIndex(F=>F.complete===!1);X(f>-1?f:z.length-1),He(!0)}function Ge(){if(M+1>=z.length){me&&pe(e,!1);return}R(e,z[M+1].id)||X(M+1)}function Xe(f,F,U){let ge=M+1<z.length?z[M+1]:null;c&&c(f,M,F,ge)===!0&&me&&qe(),m&&m(f,U,ge),!m&&!c&&(f.primaryButtonUri||f.secondaryButtonUri)&&me&&qe()}function Pt(){return z.map((f,F)=>V(w({},f),{handleSecondaryButtonClick:()=>{Ge(),Ie(f),f.skippable===!0&&T(e,f.id,{skipped:!0}),Xe(f,"secondary",F)},handlePrimaryButtonClick:()=>{(!f.completionCriteria&&(f.autoMarkCompleted||f.autoMarkCompleted===void 0)||f.completionCriteria&&f.autoMarkCompleted===!0)&&(T(e,f.id),Ge()),Xe(f,"primary",F),we(f),P(e,f.id)===$e&&Ge()}}))}function Ke(){return Se.createElement(oe,{appearance:g})}let ht={steps:Pt(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:C,type:s,className:r,autoExpandFirstIncompleteStep:v,autoExpandNextStep:b};function qe(){pe(e,!1),a&&a(),S&&S(!1)}function zt(){return Se.createElement(Se.Fragment,null,Se.createElement(Ke,null),Se.createElement(rl,{flowId:e,appearance:g,customVariables:l,className:r}))}function Ht(){return Se.createElement(Se.Fragment,null,Se.createElement(Ke,null),Se.createElement(Jr,w({visible:ue,onClose:()=>{qe()},selectedStep:M,setSelectedStep:X,autoExpandNextStep:!0,appearance:g},ht)))}function Vt(){var U;let f=k.guideFlowId,F;return f&&u(f)&&(F=A(f)),Se.createElement(Se.Fragment,null,Se.createElement(Ke,null),Se.createElement(Yr,w({visible:ue,stepsTitle:re.stepsTitle?re.stepsTitle:"Your quick start guide",onClose:()=>{qe()},selectedStep:M,setSelectedStep:X,guideData:F,guideTitle:(U=k.guideTitle)!=null?U:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:ge=>{Xe(ge,"link",0)},customStepTypes:C},ht)))}function h(){let f=Se.createElement(Kr,w({flowId:e,style:i,selectedStep:M,setSelectedStep:X,appearance:g,type:s},ht));return me?Se.createElement(Re,{onClose:()=>{qe()},visible:ue,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Se.createElement(Ke,null),f):Se.createElement(Se.Fragment,null,Se.createElement(Ke,null),f)}switch(x){case"condensed":return Ht();case"with-guide":return Vt();case"default":return h();case"carousel":return zt();default:return h()}};var xc=e=>hc.createElement(Qr,w({type:"inline"},e));import kt,{useEffect as Cc}from"react";import rt from"react";import fr from"styled-components";var nl=fr.div`
|
|
1363
1364
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1364
1365
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1365
1366
|
padding: 10px 12px 10px 12px;
|
|
@@ -1371,27 +1372,27 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1371
1372
|
&:hover {
|
|
1372
1373
|
filter: brightness(.99);
|
|
1373
1374
|
}
|
|
1374
|
-
`,sl=
|
|
1375
|
+
`,sl=fr.div`
|
|
1375
1376
|
display: flex;
|
|
1376
1377
|
flex-direction: row;
|
|
1377
1378
|
justify-content: space-between;
|
|
1378
1379
|
align-items: center;
|
|
1379
1380
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1380
1381
|
flex-grow: 2;
|
|
1381
|
-
`,ll=
|
|
1382
|
+
`,ll=fr.div`
|
|
1382
1383
|
text-overflow: ellipsis;
|
|
1383
1384
|
font-weight: 600;
|
|
1384
1385
|
font-size: 14px;
|
|
1385
1386
|
line-height: 16px;
|
|
1386
1387
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1387
1388
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1388
|
-
`,al=
|
|
1389
|
+
`,al=fr.div`
|
|
1389
1390
|
width: 20px;
|
|
1390
1391
|
margin-right: 8px;
|
|
1391
1392
|
display: flex;
|
|
1392
1393
|
height: 100%;
|
|
1393
1394
|
align-items: center;
|
|
1394
|
-
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:
|
|
1395
|
+
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:a="default"})=>rt.createElement(rt.Fragment,null,rt.createElement(oe,{appearance:s}),rt.createElement(nl,{onClick:()=>i!==void 0&&i(),styleOverrides:w(w({},a=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Te(r!=null?r:"",p("progressBadgeContainer",s)),appearance:s},a=="condensed"&&o&&o!==0&&rt.createElement(al,{className:p("progressRingContainer",s)},rt.createElement(Yt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),rt.createElement(sl,{type:a,className:p("badgeTitleContainer",s)},rt.createElement(ll,{type:a,appearance:s,className:p("badgeTitle",s)},e),i!==void 0&&rt.createElement(no,{className:p("badgeChevron",s),color:s.theme.colorPrimary})),a=="default"&&o&&o!==0&&rt.createElement(We,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import Ft from"react";import Io from"styled-components";var dl=Io.div`
|
|
1395
1396
|
display: flex;
|
|
1396
1397
|
flex-direction: row;
|
|
1397
1398
|
width: 100%;
|
|
@@ -1428,7 +1429,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1428
1429
|
:hover {
|
|
1429
1430
|
opacity: 0.8;
|
|
1430
1431
|
}
|
|
1431
|
-
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:
|
|
1432
|
+
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:a})=>Ft.createElement(Ft.Fragment,null,Ft.createElement(dl,{appearance:i,className:Te(p("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:a},o&&Ft.createElement(cl,{className:p("fullWidthProgressBadgeIcon",i)},o),Ft.createElement(ml,null,Ft.createElement(Ne,{size:"small",appearance:i,title:e,subtitle:t})),Ft.createElement(ul,{className:p("fullWidthProgressBadgeProgressContainer",i)},Ft.createElement(We,{count:n,total:r,display:"percent",textLocation:"top"}))));var yc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:a,hideOnFlowCompletion:d,appearance:l,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:y,getNumberOfStepsCompleted:S,isLoading:C,targetingLogicShouldHideFlow:x,updateCustomVariables:v}=te(),{mergeAppearanceWithDefault:b}=ne();l=b(l);let{setOpenFlowState:k,getOpenFlowState:I}=Ee();if(Cc(()=>{v(a)},[a,C]),C)return null;let B=c(e);if(!B||x(B)||d===!0&&y(e)===ie)return null;let u=g(e),A=S(e);return m==="full-width"?kt.createElement(kt.Fragment,null,kt.createElement(oe,{appearance:l}),kt.createElement(fl,{title:t,subtitle:o,count:A,total:u.length,style:n,className:s,appearance:l,icon:i,onClick:()=>{}})):kt.createElement(kt.Fragment,null,kt.createElement(oe,{appearance:l}),kt.createElement(pl,{count:A,total:u.length,title:t,style:n,onClick:()=>{k(e,!0),r&&r()},type:m,className:s,appearance:l}))};import Sc from"react";var bc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Le(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:a,getFlowSteps:d}=te(),{mergeAppearanceWithDefault:l}=ne();o=l(o);let m=s(e);if(!m||a(m))return null;let c=d(e);return Sc.createElement(Oo,w({steps:c,style:t,appearance:o},i))};import ft,{useContext as Lc,useEffect as $c}from"react";import q,{useEffect as ao,useLayoutEffect as xl,useRef as vc,useState as po}from"react";import Lo from"styled-components";import{useCallback as wc,useEffect as Tc,useState as Fc}from"react";var Zr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+r}:{x:0,y:0}};function gl(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,n]=Fc(o),r=wc(()=>{e&&n(e.getBoundingClientRect())},[e]);return Tc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as kc,useState as Pc}from"react";function hl(){let{debug:e}=kc(Z),[t,o]=Pc([]);function i(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var Cl=300,yl=100,Bc=500,co=12,Ec=Lo.div`
|
|
1432
1433
|
width: 100%;
|
|
1433
1434
|
height: 100%;
|
|
1434
1435
|
border-radius: 9999px;
|
|
@@ -1458,7 +1459,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1458
1459
|
background-color: ${e=>e.primaryColor};
|
|
1459
1460
|
z-index: 20;
|
|
1460
1461
|
opacity: 1;
|
|
1461
|
-
`,
|
|
1462
|
+
`,Nc=Lo.div`
|
|
1462
1463
|
pointer-events: all;
|
|
1463
1464
|
`,Sl=Lo.div`
|
|
1464
1465
|
display: flex;
|
|
@@ -1466,10 +1467,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1466
1467
|
justify-content: center;
|
|
1467
1468
|
align-items: center;
|
|
1468
1469
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1469
|
-
`,
|
|
1470
|
+
`,Oc=Lo(Sl)`
|
|
1470
1471
|
width: ${co+12}px;
|
|
1471
1472
|
height: ${co+12}px;
|
|
1472
|
-
`,Ic=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:
|
|
1473
|
+
`,Ic=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:a=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:g=!1,showHighlightOnly:y,showStepCount:S=!0,completedStepsCount:C=0,showFrigadeBranding:x=!1,cssPosition:v="absolute",onViewTooltip:b,className:k})=>{var Pt,Ke,ht,qe,zt,Ht,Vt,h,f,F,U,ge,xt,vt,Bt,he,uo,fo,si;let{logErrorIfDebugMode:I}=hl(),[B,u]=po(),[A,T]=po(new Date),P=vc(null),[L,N]=po(document.querySelector(e[l].selector)),O=gl(L,A),[H,_]=po(),[R,J]=po(!y),ee=(Ke=(Pt=e[l])==null?void 0:Pt.props)!=null&&Ke.position?e[l].props.position:v,K=(zt=(qe=(ht=e[l])==null?void 0:ht.props)==null?void 0:qe.zIndex)!=null?zt:90,Y=(Ht=B==null?void 0:B.width)!=null?Ht:Cl,de=(Vt=B==null?void 0:B.height)!=null?Vt:yl,[we,Ie]=po(new Date().getTime());s=(F=(f=(h=e[l])==null?void 0:h.props)==null?void 0:f.offset)!=null?F:s;let ce=window.location.pathname.split("/").pop();xl(()=>{P.current&&u({width:P.current.clientWidth,height:P.current.clientHeight})},[l,A,ee]),ao(()=>{y||J(!0)},[l]),ao(()=>{a&&R&&b(l)},[R]);let pe=()=>{if(ee==="static")return;let Q=document.querySelector(e[l].selector);if(!Q){_(void 0),N(null),I(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}H&&H===JSON.stringify(Q==null?void 0:Q.getBoundingClientRect())||(N(Q),T(new Date),Q&&_(JSON.stringify(Q.getBoundingClientRect())))};if(ao(()=>{let Q=new MutationObserver(pe);return Q.observe(document.body,{subtree:!0,childList:!0}),()=>Q.disconnect()},[pe]),ao(()=>{let Q=new MutationObserver(pe);return Q.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>Q.disconnect()},[pe]),ao(()=>{let Q=setInterval(()=>{pe()},10);return()=>clearInterval(Q)},[pe]),xl(()=>{setTimeout(()=>{pe()},Bc),pe()},[l,ce]),ao(()=>{if(!a)return;let Q=Qe=>{Qe.key==="Escape"&&t()};return document.addEventListener("keydown",Q),()=>{document.removeEventListener("keydown",Q)}},[]),L===null||!a)return null;let M=i==="auto"?"right":i,X=Zr(O,M,Y,s,ee),ke=O.right+Y>(window.innerWidth||document.documentElement.clientWidth),He=O.bottom+yl>(window.innerHeight||document.documentElement.clientHeight);ke&&i==="auto"&&(X=Zr(O,"left",Y,s,ee),M="left"),(ge=(U=e[l])==null?void 0:U.props)!=null&&ge.tooltipPosition&&((vt=(xt=e[l])==null?void 0:xt.props)==null?void 0:vt.tooltipPosition)!=="auto"&&(((he=(Bt=e[l])==null?void 0:Bt.props)==null?void 0:he.tooltipPosition)==="left"||((fo=(uo=e[l])==null?void 0:uo.props)==null?void 0:fo.tooltipPosition)==="right")&&(M=e[l].props.tooltipPosition);let ue=()=>{let Q=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),J(!1),setTimeout(()=>{pe()},30)),C===e.length-1)return o()},Qe=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),y&&!e[l].secondaryButtonUri&&J(!1))};return q.createElement(q.Fragment,null,S&&e.length>1&&q.createElement(Ti,null,q.createElement(ki,{role:"status",className:p("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&q.createElement(Fi,{showStepCount:S,className:p("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&q.createElement(le,{title:e[l].secondaryButtonTitle,appearance:c,onClick:Qe,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&q.createElement(le,{title:e[l].primaryButtonTitle,appearance:c,onClick:Q,autoFocus:!0,withMargin:!1,size:"small"})))},me=()=>{var Q;return q.createElement(q.Fragment,null,g&&q.createElement(Ci,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:p("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},q.createElement(Ae,null)),e[l].imageUri&&q.createElement(yi,{dismissible:g,appearance:c,role:"img","aria-label":e[l].title,src:e[l].imageUri,className:p("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&q.createElement(Si,{dismissible:g,appearance:c,role:"video","aria-label":e[l].title,className:p("tooltipVideoContainer",c)},q.createElement(tt,{appearance:c,videoUri:e[l].videoUri,autoplay:(Q=e[l].props)==null?void 0:Q.autoplayVideo})),q.createElement(wi,{className:p("tooltipContentContainer",c)},q.createElement(Ne,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small",ariaPrefix:`Tooltip${e[l].id}`}),q.createElement(bi,{className:p("tooltipFooter",c)},q.createElement(ue,null))))},z=w(w({},{default:Q=>{var Qe;if((Qe=e[l])!=null&&Qe.StepContent){let ia=e[l].StepContent;return q.createElement("div",null,ia)}return q.createElement(me,null)}}),m),$=()=>{var Q;return e?!((Q=e[l])!=null&&Q.type)||!z[e[l].type]?z.default(e[l]):z[e[l].type]({stepData:e[l],primaryColor:r}):q.createElement(q.Fragment,null)};if(e[l].complete===!0||X.x==0&&X.y==0&&new Date().getTime()-we<100)return null;let W={top:(X==null?void 0:X.y)-co,left:(si=M=="left"?O.x+s.x:(X==null?void 0:X.x)-co)!=null?si:0,cursor:y?"pointer":"default",position:ee},re=()=>{let Qe=W.left+(M=="left"?-Y:24);return Math.min(Math.max(Qe,20),window.innerWidth-Y-20)},Ge=()=>{if(ee==="fixed")return W.top;let Q=W.top+de,Qe=20;return Q>window.innerHeight-Qe?W.top+-de:W.top},Xe=()=>{y&&(T(new Date),J(!R))};return q.createElement(Nc,{className:k},q.createElement(Oc,{style:W,zIndex:K,className:p("tourHighlightContainer",c)},n&&e[l].showHighlight!==!1&&v!=="static"&&q.createElement(q.Fragment,null,q.createElement(Ac,{style:{position:ee},onClick:Xe,primaryColor:c.theme.colorPrimary,className:p("tourHighlightInnerCircle",c)}),q.createElement(Ec,{style:{position:"absolute"},onClick:Xe,primaryColor:c.theme.colorPrimary,className:p("tourHighlightOuterCircle",c)}))),q.createElement(Sl,{style:V(w({},W),{left:re(),top:Ge()}),zIndex:K+1,className:p("tooltipContainerWrapper",c)},R&&q.createElement(q.Fragment,null,q.createElement(Wo,{ref:P,role:"dialog","aria-labelledby":`frigadeTooltip${e[l].id}Title`,"aria-describedby":`frigadeTooltip${e[l].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:w({position:"relative",width:"max-content",right:0,top:v!=="static"?12:0},d),appearance:c,className:p("tooltipContainer",c),maxWidth:Cl,zIndex:K+10},q.createElement($,null)),x&&q.createElement(vi,{className:p("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:K+10},q.createElement(zo,{appearance:c})))))},$o=Ic;import{Portal as Mc}from"react-portal";var Dc=x=>{var v=x,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:a,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:y="absolute",className:S}=v,C=Le(v,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:b,getFlowSteps:k,isLoading:I,targetingLogicShouldHideFlow:B,markStepCompleted:u,markStepStarted:A,markFlowCompleted:T,updateCustomVariables:P,getCurrentStepIndex:L,getStepStatus:N,isStepBlocked:O,getFlowStatus:H,getNumberOfStepsCompleted:_}=te(),{isLoadingUserFlowStateData:R}=Ue(),{primaryCTAClickSideEffects:J,secondaryCTAClickSideEffects:ee}=fe(),{hasOpenModals:K}=Ee(),Y=L(e),{openFlowStates:de}=Lc(Z),{mergeAppearanceWithDefault:we}=ne();if(o=we(o),$c(()=>{P(t)},[t,I]),R)return null;let Ie=b(e);if(!Ie||B(Ie)||H(e)==ie||K())return null;let ce=k(e);if(Object.keys(de).length>0){let $=Object.keys(de).find(W=>de[W]===!0);if($!==void 0&&$!==e)return ft.createElement(ft.Fragment,null)}function pe($){return D(this,null,function*(){if(yield u(e,$.id),ce.map(W=>N(e,W.id)).every(W=>W===$e)){yield T(e);return}!l&&Y+1<ce.length&&!r&&O(e,ce[Y+1].id)})}function M($,W,re){let Ge=Y+1<ce.length?ce[Y+1]:null;n&&n($,Y,W,Ge),i&&i($,re,Ge)}function X(){return ce.map($=>V(w({},$),{handleSecondaryButtonClick:()=>D(this,null,function*(){ee($),$.skippable===!0&&(yield u(e,$.id,{skipped:!0})),M($,"secondary",Y)}),handlePrimaryButtonClick:()=>D(this,null,function*(){(!$.completionCriteria&&($.autoMarkCompleted||$.autoMarkCompleted===void 0)||$.completionCriteria&&$.autoMarkCompleted===!0)&&(yield pe($)),M($,"primary",Y),J($)})}))}function ke($){return D(this,null,function*(){s&&s(),m==="complete-flow"?yield T(e):yield u(e,$.id)})}function He(){c&&c()}function ue($){return D(this,null,function*(){yield A(e,ce[$].id)})}let me=!document.querySelector(ce[Y].selector);function j(){let $=ce.findIndex((W,re)=>!!document.querySelector(W.selector)&&re>=Y);return ce.map((W,re)=>r?ft.createElement($o,w({key:W.id,appearance:o,steps:X(),selectedStep:re,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>ke(W),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:_(e),onComplete:He,cssPosition:y,onViewTooltip:ue,className:S},C)):g&&me&&re===$?ft.createElement($o,w({key:W.id,appearance:o,steps:X(),selectedStep:re,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>ke(W),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:_(e),onComplete:He,cssPosition:y,onViewTooltip:ue,className:S},C)):re!=Y?null:ft.createElement($o,w({key:W.id,appearance:o,steps:X(),selectedStep:re,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>ke(W),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:_(e),onComplete:He,cssPosition:y,onViewTooltip:ue,className:S},C)))}function z(){return ft.createElement(ft.Fragment,null,ft.createElement(oe,{appearance:o}),j())}return y==="static"?z():ft.createElement(Mc,null,z())};import Oe,{useEffect as Uc,useRef as _c,useState as Wc}from"react";import{Portal as zc}from"react-portal";import _t from"styled-components";var bl=_t.button`
|
|
1473
1474
|
${e=>E(e)} {
|
|
1474
1475
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1475
1476
|
|
|
@@ -1487,17 +1488,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1487
1488
|
opacity: 0.8;
|
|
1488
1489
|
}
|
|
1489
1490
|
}
|
|
1490
|
-
`,wl=
|
|
1491
|
+
`,wl=_t.span`
|
|
1491
1492
|
${e=>E(e)} {
|
|
1492
1493
|
font-size: 12px;
|
|
1493
1494
|
display: inline-block;
|
|
1494
1495
|
}
|
|
1495
|
-
`,Tl=
|
|
1496
|
+
`,Tl=_t.span`
|
|
1496
1497
|
${e=>E(e)} {
|
|
1497
1498
|
font-size: 12px;
|
|
1498
1499
|
display: inline-block;
|
|
1499
1500
|
}
|
|
1500
|
-
`,Fl=
|
|
1501
|
+
`,Fl=_t.div`
|
|
1501
1502
|
position: fixed;
|
|
1502
1503
|
right: 0;
|
|
1503
1504
|
bottom: 0;
|
|
@@ -1507,7 +1508,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1507
1508
|
flex-direction: column;
|
|
1508
1509
|
align-items: flex-end;
|
|
1509
1510
|
z-index: 50;
|
|
1510
|
-
`,kl=
|
|
1511
|
+
`,kl=_t.button`
|
|
1511
1512
|
${e=>E(e)} {
|
|
1512
1513
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1513
1514
|
background-color: #ffffff;
|
|
@@ -1523,7 +1524,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1523
1524
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1524
1525
|
border-radius: 45px;
|
|
1525
1526
|
cursor: pointer;
|
|
1526
|
-
`,Pl=
|
|
1527
|
+
`,Pl=_t.div`
|
|
1527
1528
|
${e=>E(e)} {
|
|
1528
1529
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1529
1530
|
background: #ffffff;
|
|
@@ -1540,7 +1541,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1540
1541
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1541
1542
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1542
1543
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1543
|
-
`,vl=
|
|
1544
|
+
`,vl=_t.button`
|
|
1544
1545
|
${e=>E(e)} {
|
|
1545
1546
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1546
1547
|
color: #434343;
|
|
@@ -1557,7 +1558,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1557
1558
|
font-size: 14px;
|
|
1558
1559
|
|
|
1559
1560
|
padding: 8px 12px;
|
|
1560
|
-
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import Al from"react";var
|
|
1561
|
+
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import Al from"react";var Nl=({style:e,className:t})=>Al.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},Al.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Hc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:a,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y}=te(),{primaryCTAClickSideEffects:S}=fe(),C=_c(null),[x,v]=Wc(!1),{mergeAppearanceWithDefault:b}=ne();s=b(s),Uc(()=>(document.addEventListener("click",k,!1),()=>{document.removeEventListener("click",k,!1)}),[]);let k=T=>{C.current&&!C.current.contains(T.target)&&v(!1)};if(g)return null;let I=a(e);if(!I||y(I))return null;let B=d(e);if(!B||!i)return null;function u(T,P){!T.completionCriteria&&(T.autoMarkCompleted||T.autoMarkCompleted===void 0)&&l(e,T.id),S(T),o&&o(T,P),v(!1)}function A(){return x&&Oe.createElement(Pl,{className:p("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},B.map((T,P)=>Oe.createElement(vl,{className:p("floatingWidgetMenuItem",s),key:P,onClick:()=>u(T,P)},T.title)))}return n=="inline"?Oe.createElement("span",{ref:C},Oe.createElement(oe,{appearance:s}),Oe.createElement(bl,{style:t,onClick:()=>{v(!x)},className:p("supportButton",s)},Oe.createElement(Tl,{className:p("supportIconContainer",s)},Oe.createElement(Nl,{className:p("supportIcon",s),style:{width:"18px",height:"18px"}})),Oe.createElement(wl,{className:p("supportButtonTitle",s)},r)),Oe.createElement(A,null)):Oe.createElement(zc,null,Oe.createElement(oe,{appearance:s}),Oe.createElement(Fl,{style:t,ref:C},Oe.createElement(A,null),Oe.createElement(kl,{onClick:()=>{v(!x)},whileHover:{scale:1.1},className:p("floatingWidgetButton",s)},Oe.createElement(El,{className:p("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import it,{useEffect as Vc}from"react";import gr from"styled-components";var Ol=gr.div`
|
|
1561
1562
|
${e=>E(e)} {
|
|
1562
1563
|
display: flex;
|
|
1563
1564
|
flex-direction: column;
|
|
@@ -1572,17 +1573,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1572
1573
|
border-radius: 12px;
|
|
1573
1574
|
position: relative;
|
|
1574
1575
|
}
|
|
1575
|
-
`,Il=
|
|
1576
|
+
`,Il=gr.div`
|
|
1576
1577
|
display: flex;
|
|
1577
1578
|
flex-direction: column;
|
|
1578
1579
|
flex: 1;
|
|
1579
|
-
`,Ll=
|
|
1580
|
+
`,Ll=gr.div`
|
|
1580
1581
|
display: flex;
|
|
1581
1582
|
flex-direction: column;
|
|
1582
1583
|
justify-content: center;
|
|
1583
1584
|
align-items: flex-start;
|
|
1584
1585
|
margin-top: 16px;
|
|
1585
|
-
`,$l=
|
|
1586
|
+
`,$l=gr.div`
|
|
1586
1587
|
${e=>E(e)} {
|
|
1587
1588
|
position: absolute;
|
|
1588
1589
|
top: 16px;
|
|
@@ -1593,7 +1594,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1593
1594
|
opacity: 0.8;
|
|
1594
1595
|
}
|
|
1595
1596
|
}
|
|
1596
|
-
`;var jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:
|
|
1597
|
+
`;var jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:a})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowSteps:S,getFlowStatus:C,getCurrentStepIndex:x}=te(),{primaryCTAClickSideEffects:v}=fe(),{mergeAppearanceWithDefault:b}=ne();if(Ve(e),n=b(n),Vc(()=>{y(o)},[o,c]),c)return null;let k=d(e);if(!k||g(k)||C(e)===ie)return null;let B=S(e)[x(e)];return it.createElement(it.Fragment,null,it.createElement(oe,{appearance:n}),it.createElement(Ol,{appearance:n,className:Te(p("embeddedTipContainer",n),r),style:s},(a===!0||B.dismissible)&&it.createElement($l,{onClick:()=>D(void 0,null,function*(){yield l(e),t&&t()}),className:p("embeddedTipDismissButton",n)},it.createElement(Ae,null)),it.createElement(Il,null,it.createElement(Ne,{size:"small",appearance:n,title:B.title,subtitle:B.subtitle})),B.primaryButtonTitle&&it.createElement(Ll,{className:p("embeddedTipCallToActionContainer",n)},it.createElement(le,{classPrefix:"embeddedTip",title:B.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>D(void 0,null,function*(){B.handlePrimaryButtonClick(),v(B),!(i&&i(B,x(e),"primary")===!1)&&(yield m(e,B.id),yield l(e))})}))))};import ve,{useEffect as Gc}from"react";import mo from"styled-components";var Ml=mo.div`
|
|
1597
1598
|
// use the :not annotation
|
|
1598
1599
|
${e=>E(e)} {
|
|
1599
1600
|
display: flex;
|
|
@@ -1622,7 +1623,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1622
1623
|
flex-direction: column;
|
|
1623
1624
|
justify-content: center;
|
|
1624
1625
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1625
|
-
`,
|
|
1626
|
+
`,Rr=mo.div`
|
|
1626
1627
|
display: flex;
|
|
1627
1628
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1628
1629
|
align-items: flex-end;
|
|
@@ -1630,12 +1631,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1630
1631
|
:hover {
|
|
1631
1632
|
opacity: 0.8;
|
|
1632
1633
|
}
|
|
1633
|
-
`,
|
|
1634
|
+
`,ei=mo.div`
|
|
1634
1635
|
display: flex;
|
|
1635
1636
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1636
1637
|
align-items: flex-end;
|
|
1637
1638
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1638
|
-
`;import
|
|
1639
|
+
`;import ti from"react";var Wl=({style:e,className:t})=>ti.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},ti.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),ti.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 Kc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:s,type:a="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowMetadata:S,getFlowStatus:C,getFlowSteps:x,getCurrentStepIndex:v}=te(),{primaryCTAClickSideEffects:b}=fe(),{mergeAppearanceWithDefault:k}=ne();if(Ve(e),s=k(s),Gc(()=>{y(n)},[n,c]),c)return null;let I=l(e);if(!I||g(I)||C(e)===ie)return null;let B=x(e),u=B.length>0?B[v(e)]:S(e);return u!=null&&u.title&&(t=u.title),u!=null&&u.subtitle&&(o=u.subtitle),ve.createElement(ve.Fragment,null,ve.createElement(oe,{appearance:s}),ve.createElement(Ml,{type:a,appearance:s,className:p("bannerContainer",s)},a!="square"&&ve.createElement(Dl,{className:p("bannerIconContainer",s)},d||ve.createElement(Wl,null)),a==="square"&&u.dismissible&&ve.createElement(ei,{type:a,className:p("bannerDismissButtonContainer",s)},ve.createElement(Rr,{type:a,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:p("bannerDismissButton",s)},ve.createElement(Ae,null))),ve.createElement(Ul,{type:a},ve.createElement(Ne,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(u==null?void 0:u.primaryButtonTitle)&&ve.createElement(_l,{type:a,className:p("bannerCallToActionContainer",s)},ve.createElement(le,{title:u==null?void 0:u.primaryButtonTitle,appearance:s,onClick:()=>{b(u),r&&r(u,0,"primary")},classPrefix:"banner"})),a!=="square"&&u.dismissible&&ve.createElement(ei,{type:a,className:p("bannerDismissButtonContainer",s)},ve.createElement(Rr,{type:a,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:p("bannerDismissButton",s)},ve.createElement(Ae,null)))))};import ae,{useEffect as qc}from"react";import{Portal as Yc}from"react-portal";import gt from"styled-components";var zl=gt.div`
|
|
1639
1640
|
display: flex;
|
|
1640
1641
|
flex-direction: column;
|
|
1641
1642
|
width: 100%;
|
|
@@ -1678,7 +1679,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1678
1679
|
display: flex;
|
|
1679
1680
|
justify-content: center;
|
|
1680
1681
|
align-items: center;
|
|
1681
|
-
`,
|
|
1682
|
+
`,oi=gt.div`
|
|
1682
1683
|
display: flex;
|
|
1683
1684
|
justify-content: space-between;
|
|
1684
1685
|
margin-top: 16px;
|
|
@@ -1687,18 +1688,18 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1687
1688
|
display: flex;
|
|
1688
1689
|
justify-content: space-between;
|
|
1689
1690
|
margin-top: 8px;
|
|
1690
|
-
`,
|
|
1691
|
+
`,ri=gt.div`
|
|
1691
1692
|
font-size: 12px;
|
|
1692
1693
|
line-height: 18px;
|
|
1693
1694
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1694
1695
|
font-style: normal;
|
|
1695
1696
|
font-weight: 400;
|
|
1696
1697
|
letter-spacing: 0.24px;
|
|
1697
|
-
`,
|
|
1698
|
+
`,ii=gt.div`
|
|
1698
1699
|
display: flex;
|
|
1699
1700
|
flex-direction: column;
|
|
1700
1701
|
flex: 1;
|
|
1701
|
-
`,
|
|
1702
|
+
`,gw=gt.div`
|
|
1702
1703
|
display: flex;
|
|
1703
1704
|
flex-direction: column;
|
|
1704
1705
|
justify-content: center;
|
|
@@ -1728,7 +1729,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1728
1729
|
opacity: 0.8;
|
|
1729
1730
|
}
|
|
1730
1731
|
}
|
|
1731
|
-
`;var Jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:
|
|
1732
|
+
`;var Jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:a="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:S,getFlowSteps:C,getFlowStatus:x,getFlowMetadata:v}=te(),{primaryCTAClickSideEffects:b}=fe(),{mergeAppearanceWithDefault:k}=ne(),[I,B]=ae.useState(null),[u,A]=ae.useState(""),T=v(e),{hasOpenModals:P,setKeepCompletedFlowOpenDuringSession:L,shouldKeepCompletedFlowOpenDuringSession:N}=Ee();if(Ve(e),n=k(n),qc(()=>{S(o)},[o,g]),g)return null;let O=d(e);if(!O||y(O)||x(e)===ie||c(e)===1&&!N(e)||P())return null;let _=C(e)[c(e)];function R(){var K,Y;return ae.createElement(ae.Fragment,null,ae.createElement(ii,null,ae.createElement(Ne,{size:"large",appearance:n,title:_.title,subtitle:_.subtitle})),ae.createElement(oi,{className:p("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(de=>ae.createElement(Hl,{className:p("npsNumberButton",n),selected:I===de+1,key:de,onClick:()=>D(this,null,function*(){L(e),B(de+1),yield m(e,_.id,{score:de+1})}),appearance:n},de+1))),ae.createElement(Vl,{appearance:n},ae.createElement(ri,{appearance:n},(K=T==null?void 0:T.negativeLabel)!=null?K:"Not likely at all"),ae.createElement(ri,{appearance:n},(Y=T==null?void 0:T.positiveLabel)!=null?Y:"Extremely likely")))}function J(){var K;return ae.createElement(ae.Fragment,null,ae.createElement(ii,null,ae.createElement(Ne,{appearance:n,title:(K=_.title)!=null?K:"Why did you choose this score?",size:"large"})),ae.createElement(jl,{appearance:n,value:u,onChange:Y=>{A(Y.target.value)},placeholder:"Add your optional feedback here..."}),ae.createElement(oi,{appearance:n,className:p("npsNumberButtonContainer",n)},ae.createElement(le,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield l(e),i&&i(_,1,"primary")}),appearance:n,title:_.secondaryButtonTitle||"Skip",secondary:!0}),ae.createElement(le,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield m(e,_.id,{feedbackText:u}),yield l(e),i&&i(_,1,"primary")}),appearance:n,title:_.primaryButtonTitle||"Submit"})))}function ee(){return c(e)>=2?null:ae.createElement(ae.Fragment,null,ae.createElement(oe,{appearance:n}),ae.createElement(zl,{appearance:n,className:Te(p("npsSurveyContainer",n),r),style:s,type:a},ae.createElement(Gl,{onClick:()=>D(this,null,function*(){yield l(e),t&&t()}),className:p("npsSurveyDismissButton",n)},ae.createElement(Ae,null)),c(e)==0&&R(),c(e)==1&&J()))}return a==="inline"?ee():ae.createElement(Yc,null,ee())};import Be,{useEffect as Zc}from"react";import Wt from"styled-components";var Kl=Wt.div`
|
|
1732
1733
|
${e=>E(e)} {
|
|
1733
1734
|
display: flex;
|
|
1734
1735
|
flex-direction: column;
|
|
@@ -1739,21 +1740,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1739
1740
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1740
1741
|
position: relative;
|
|
1741
1742
|
}
|
|
1742
|
-
`,ql=
|
|
1743
|
+
`,ql=Wt.div`
|
|
1743
1744
|
display: flex;
|
|
1744
1745
|
flex-direction: column;
|
|
1745
1746
|
flex: 1;
|
|
1746
|
-
`,Yl=
|
|
1747
|
+
`,Yl=Wt.div`
|
|
1747
1748
|
display: flex;
|
|
1748
1749
|
flex-direction: row;
|
|
1749
1750
|
justify-content: center;
|
|
1750
1751
|
align-items: stretch;
|
|
1751
1752
|
gap: 16px;
|
|
1752
1753
|
margin-top: 8px;
|
|
1753
|
-
`,Jl=
|
|
1754
|
+
`,Jl=Wt.div`
|
|
1754
1755
|
margin-top: 16px;
|
|
1755
1756
|
margin-bottom: 16px;
|
|
1756
|
-
`,Xl=
|
|
1757
|
+
`,Xl=Wt.div`
|
|
1757
1758
|
${e=>E(e)} {
|
|
1758
1759
|
position: absolute;
|
|
1759
1760
|
top: -16px;
|
|
@@ -1764,7 +1765,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1764
1765
|
opacity: 0.8;
|
|
1765
1766
|
}
|
|
1766
1767
|
}
|
|
1767
|
-
`,Ql=
|
|
1768
|
+
`,Ql=Wt.h1`
|
|
1768
1769
|
${e=>E(e)} {
|
|
1769
1770
|
font-style: normal;
|
|
1770
1771
|
justify-content: center;
|
|
@@ -1778,7 +1779,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1778
1779
|
color: ${e=>e.appearance.theme.colorText};
|
|
1779
1780
|
margin-bottom: 8px;
|
|
1780
1781
|
}
|
|
1781
|
-
`,Zl=
|
|
1782
|
+
`,Zl=Wt.h2`
|
|
1782
1783
|
${e=>E(e)} {
|
|
1783
1784
|
font-style: normal;
|
|
1784
1785
|
justify-content: center;
|
|
@@ -1795,5 +1796,5 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1795
1796
|
height: 100%;
|
|
1796
1797
|
min-height: 200px;
|
|
1797
1798
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1798
|
-
`;function ea({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Rl.createElement(tt,{appearance:t,videoUri:e.videoUri}):e.imageUri?Rl.createElement(Qc,{className:
|
|
1799
|
+
`;function ea({stepData:e,appearance:t,classPrefix:o=""}){var i;return e.videoUri?Rl.createElement(tt,{appearance:t,videoUri:e.videoUri,autoplay:(i=e.props)==null?void 0:i.autoplayVideo}):e.imageUri?Rl.createElement(Qc,{className:p(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Rc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:a=!0,modalPosition:d="center"})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:S,getFlowSteps:C,getFlowStatus:x,getCurrentStepIndex:v}=te(),{primaryCTAClickSideEffects:b,secondaryCTAClickSideEffects:k}=fe(),{mergeAppearanceWithDefault:I}=ne(),{setOpenFlowState:B,getOpenFlowState:u,hasOpenModals:A}=Ee();Ve(e);let[T,P]=[u(e,!0),J=>B(e,J)];if(n=I(n),Zc(()=>{S(o)},[o,g]),g)return null;let L=l(e);if(!L||y(L)||x(e)===ie||A())return null;let O=C(e)[v(e)],H=()=>{P(!1),t&&t(),m(e)};function _(){return Be.createElement(Be.Fragment,null,Be.createElement(oe,{appearance:n}),Be.createElement(Kl,{appearance:n,className:Te(p("announcementContainer",n),r),style:s},(a===!0||O.dismissible)&&d=="inline"&&Be.createElement(Xl,{onClick:()=>D(this,null,function*(){yield m(e),t&&t()}),className:p("announcementDismissButton",n)},Be.createElement(Ae,null)),Be.createElement(ql,null,Be.createElement(Ql,{appearance:n,className:p("announcementTitle",n),dangerouslySetInnerHTML:se(O.title)}),O.subtitle&&Be.createElement(Zl,{appearance:n,className:p("announcementSubtitle",n),dangerouslySetInnerHTML:se(O.subtitle)})),(O.imageUri||O.videoUri)&&Be.createElement(Jl,{className:p("announcementMediaContainer",n)},Be.createElement(ea,{appearance:n,stepData:O})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&Be.createElement(Yl,{className:p("announcementCTAContainer",n)},O.secondaryButtonTitle&&Be.createElement(le,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handleSecondaryButtonClick(),k(O),i&&i(O,v(e),"secondary")}),secondary:!0}),O.primaryButtonTitle&&Be.createElement(le,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handlePrimaryButtonClick(),b(O),!(i&&i(O,v(e),"primary")===!1)&&(yield c(e,O.id),yield m(e))})}))))}let R={padding:"24px",maxWidth:"400px"};return d==="inline"?_():d!=="center"?Be.createElement(jo,{modalPosition:d,onClose:H,visible:T,dismissible:a,appearance:n},_()):Be.createElement(Re,{appearance:n,onClose:H,visible:T,style:R,dismissible:a},_())};import*as hr from"react";import ta from"react";var oa=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Le(r,["as","children","variant"]);return ta.createElement(vn,w({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},em=Object.fromEntries(Object.keys(or).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ta.createElement(oa,V(w({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),ni=Object.assign(oa,em);var ra=s=>{var a=s,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=a,r=Le(a,["as","className","size","title","variant"]);var d;return hr.createElement(Pn,w({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),hr.createElement(ni,{color:(d=Bo[n])==null?void 0:d.color,fontWeight:"semibold"},i))},tm=Object.fromEntries(Object.keys(Bo).map(e=>{let t=o=>hr.createElement(ra,V(w({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),om=Object.assign(ra,tm);export{vo as Box,om as Button,at as CheckBox,yr as FlowType,yt as FormLabel,Nr as FormTextField,Rc as FrigadeAnnouncement,Kc as FrigadeBanner,Qr as FrigadeChecklist,lt as FrigadeDefaultAppearance,jc as FrigadeEmbeddedTip,yn as FrigadeForm,bc as FrigadeGuide,xc as FrigadeHeroChecklist,Jc as FrigadeNPSSurvey,yc as FrigadeProgressBadge,kd as FrigadeProvider,Hc as FrigadeSupportWidget,Dc as FrigadeTour,We as ProgressBar,Yt as ProgressRing,ni as Text,rr as tokens,Ee as useFlowOpens,xo as useFlowResponses,te as useFlows,Hr as useOrganization,Co as useUser,Ue as useUserFlowStates};
|
|
1799
1800
|
//# sourceMappingURL=index.mjs.map
|