@frigade/react 1.35.49 → 1.35.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +175 -170
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +180 -175
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var ko=Object.getOwnPropertySymbols;var oi=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable;var ti=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))oi.call(t,o)&&ti(e,o,t[o]);if(ko)for(var o of ko(t))ri.call(t,o)&&ti(e,o,t[o]);return e},_=(e,t)=>na(e,sa(t));var ii=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)oi.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&ko)for(var i of ko(e))t.indexOf(i)<0&&ri.call(e,i)&&(o[i]=e[i]);return o};var D=(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 Pt,{createContext as xd,useEffect as Go,useState as je}from"react";import{ThemeProvider as Cd}from"styled-components";import kt,{useContext as Kp,useEffect as Gt,useState as ho}from"react";import{useCallback as wt,useContext as ya,useEffect as Sa}from"react";import rr,{useMemo as si}from"react";var ni="1.35.49 ";var He="NOT_STARTED_STEP",Z="COMPLETED_FLOW",Po="ABORTED_FLOW",bt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ke="COMPLETED_STEP",vo="STARTED_STEP";function Je(){let{publicApiKey:e,userId:t,apiUrl:o}=rr.useContext(Q);return{config:si(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ni,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:si(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Dt(){let{shouldGracefullyDegrade:e,readonly:t}=rr.useContext(Q);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Mt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Mt();let n=la+o,r=aa+o;if(window&&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 Mt()}window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body)}let l;try{l=yield fetch(o,i)}catch(p){return Mt(p)}return l?l.ok?l:Mt(l.statusText):Mt()})}function Mt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ut(){let{publicApiKey:e,shouldGracefullyDegrade:t}=rr.useContext(Q);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as ha,useState as li}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=pa(Q);function r(c,f=!1){var y;return(y=e[c])!=null?y:f}function l(c,f){t(y=>_(w({},y),{[c]:f}))}function p(c){t(f=>{let S=f,{[c]:y}=S,T=Ie(S,[ii(c)]);return w({},T)})}function d(c){n.includes(c)||i(f=>[...f,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,y])=>y&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import fa from"swr/immutable";import io from"core-js-pure/actual/structured-clone";function ir(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(!ir(t)||!ir(o))throw new Error("deepmerge can only merge Objects");let i=io(t);return Object.entries(o).forEach(([n,r])=>{ir(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],io(r))}):Object.assign(i,{[n]:io(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...io(r)]}):Object.assign(i,{[n]:io(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function De(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=da(Q),{resetOpenFlowState:d}=Be(),[s,m]=ma(!1),c={data:r.map(h=>({flowId:h.id,flowState:Z,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=h=>fetch(h,e).then(b=>{if(b.ok)return b.json();throw new Error("Failed to fetch user flow states")}).catch(b=>(console.log(`Error fetching ${h}: ${b}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:T,isLoading:S,mutate:g,error:v}=p?fa(y,f):ua(y,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),P=T==null?void 0:T.data;ca(()=>{!s&&!S&&P&&m(!0)},[P,s,S]);function F(h){return D(this,null,function*(){if(P&&!p){let b=P.find(N=>N.flowId===h);b&&b.flowState!==Z&&(b.flowState=Z),yield g(Promise.resolve(Ce(T,{data:P})),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function A(h,b,N){return D(this,null,function*(){if(P){let L=P.find(O=>O.flowId===h);L&&(L.stepStates[b]=N,L.flowState=bt),yield g(Promise.resolve(Ce(T,{data:P})),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function I(h,b,N){return D(this,null,function*(){if(P){let L=P.find(O=>O.flowId===h);L&&(L.lastStepId=b,L.stepStates[b]=N,L.flowState=bt),yield g(Ce(T,{data:P}),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function x(h){return D(this,null,function*(){if(P){let b=P.find(N=>N.flowId===h);b&&b.flowState!==Me&&(b.flowState=Me,b.lastStepId=ga,Object.keys(b.stepStates).forEach(N=>{b.stepStates[N].actionType=He,b.stepStates[N].createdAt=new Date().toISOString()}),yield g(Ce(T,{data:P}),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1}),d(h))}})}function B(h,b){return D(this,null,function*(){if(P){let N=P.find(L=>L.flowId===h);N&&N.stepStates[b]!==He&&(N.stepStates[b]=He),yield g(Ce(T,{data:P}),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:P,isLoadingUserFlowStateData:!s,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:x,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:I,error:v}}function no(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=ha(Q),[d,s]=li(new Set),[m,c]=li(new Set),f=Dt();function y(g){let v=JSON.stringify(g);if(d.has(v))return null;d.add(v),s(d),m.add(g),c(m);let P=l==null?void 0:l.find(F=>F.flowSlug===g.flowSlug&&F.stepId===g.stepId&&F.actionType===g.actionType&&F.createdAt===g.createdAt);return f(`${t}flowResponses`,_(w({},e),{method:"POST",body:v})).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...n,g])):P||p(A=>[...A!=null?A:[],g])})}function T(g){return D(this,null,function*(){g.foreignUserId&&(g.actionType===bt||g.actionType===Me?yield y(g):g.actionType===Z?yield y(g):g.actionType===vo?yield y(g):g.actionType===Ke?yield y(g):g.actionType===Po?yield y(g):g.actionType===He&&(yield y(g)))})}function S(){let g=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let P in v.stepStates){let F=v.stepStates[P];g.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...g,...l]}return{addResponse:T,setFlowResponses:p,getFlowResponses:S}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ai=e=>{let t=xa.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Ca(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function nr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var sr=(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))(sr||{});function R(){let{config:e,apiUrl:t}=Je(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:y}=ya(Q),T={data:[]},{verifySDKInitiated:S}=Ut(),{addResponse:g,getFlowResponses:v}=no(),P=C=>fetch(C,e).then(u=>u.ok?u.json():(console.log(`Error fetching ${C} (${u.status}): ${u.statusText}. Will gracefully degrade and hide Frigade`),f(!0),T)).catch(u=>(console.log(`Error fetching ${C}: ${u}. Will gracefully degrade and hide Frigade`),f(!0),T)),{mutateUserFlowState:F,userFlowStatesData:A,isLoadingUserFlowStateData:I,optimisticallyMarkFlowCompleted:x,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:h,optimisticallyMarkStepNotStarted:b,optimisticallyMarkStepStarted:N}=De(),{data:L,error:O,isLoading:j}=ba(l?`${t}flows${y?"?readonly=true":""}`:null,P,{keepPreviousData:!0});Sa(()=>{if(O){console.error(O);return}L&&L.data&&i(L.data)},[L,O]);function M(C){if(j)return null;let u=o.find(k=>k.slug===C);return!u&&o.length>0&&!I&&!j?(console.log(`Flow with id ${C} not found`),null):(u==null?void 0:u.active)===!1&&!y?null:u}function V(C){var z,he;if(!M(C))return[];let u=M(C).data;return u?(u=le(u),((he=(z=nr(u))==null?void 0:z.data)!=null?he:[]).map(xe=>{let ro=J(xe);return _(w({handleSecondaryButtonClick:()=>{xe.skippable===!0&&G(C,xe.id,{skipped:!0})}},xe),{complete:ue(C,xe.id)===Ke||ro>=1,blocked:Oe(C,xe.id),hidden:we(C,xe.id),handlePrimaryButtonClick:()=>{(!xe.completionCriteria&&(xe.autoMarkCompleted||xe.autoMarkCompleted===void 0)||xe.completionCriteria&&xe.autoMarkCompleted===!0)&&G(C,xe.id)},progress:ro})}).filter(xe=>xe.hidden!==!0)):[]}function le(C){return C.replaceAll(/\${(.*?)}/g,(u,k)=>p[k]===void 0?"":String(p[k]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.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 pe(C){var k;if(!M(C))return[];let u=M(C).data;return u?(u=le(u),(k=JSON.parse(u))!=null?k:{}):[]}function q(C,u){d(k=>_(w({},k),{[C]:u}))}function se(C){!I&&!j&&C&&JSON.stringify(p)!=JSON.stringify(w(w({},p),C))&&Object.keys(C).forEach(u=>{q(u,C[u])})}let de=wt((C,u,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:vo,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield N(C,u,z),g(z))}),[n,r,A]),be=wt((C,u,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:He,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield b(C,u),g(z))}),[n,r,A]),G=wt((C,u,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:Ke,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield h(C,u,z),g(z))}),[n,r,A]),Y=wt((C,u)=>D(this,null,function*(){if(!S()||fe(C)===Me)return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Me,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};yield B(C),X(k)&&g(k)}),[n,r,A]),ee=wt((C,u)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:bt,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&g(k)}),[n,r,A]),Ve=wt((C,u)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Z,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(C),g(k))}),[n,r,A]),Le=wt((C,u)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Po,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(C),g(k))}),[n,r,A]);function X(C){var u;if(!A&&C.actionType===He)return!1;if(A){let k=A.find(z=>z.flowId===C.flowSlug);if(C.actionType===He&&(!(k!=null&&k.stepStates[C.stepId])||k.stepStates[C.stepId].actionType===He)||k&&((u=k.stepStates[C.stepId])==null?void 0:u.actionType)===C.actionType||k&&k.flowState===Z&&C.actionType===Z)return!1}return!0}function ue(C,u){let k=U(C,u);return I?null:k?k.actionType:He}function Oe(C,u){let k=U(C,u);return k?k.blocked:!1}function we(C,u){let k=U(C,u);return k?k.hidden:!1}function U(C,u){var z;if(I)return null;let k=A==null?void 0:A.find(he=>he.flowId===C);return!k||!k.stepStates[u]?null:(z=k.stepStates[u])!=null?z:null}function $(C){var k,z;if(I||!A)return null;if(fe(C)===Me)return(k=V(C)[0])!=null?k:null;let u=(z=A.find(he=>he.flowId===C))==null?void 0:z.lastStepId;return u?V(C).find(he=>he.id===u):null}function W(C){var z;let u=$(C);if(!u)return 0;let k=(z=V(C).findIndex(he=>he.id===u.id))!=null?z:0;return ue(C,u.id)===Ke&&k<V(C).length-1?k+1:k}function J(C){if(!C.completionCriteria)return;let u=ai(C.completionCriteria);if(u===null)return;let k=$e(u),z=Ge(u);return z===0?void 0:k/z}function fe(C){let u=A==null?void 0:A.find(k=>k.flowId===C);return u?u.flowState:null}function $e(C){let u=V(C);return u.length===0?0:u.filter(z=>ue(C,z.id)===Ke).length}function Ge(C){return V(C).length}function Xe(C){let u=o.find(k=>k.slug===C);return u?nr(u.data):null}function St(C){if(y)return!1;if(I)return!0;if(C!=null&&C.targetingLogic&&A){let u=A.find(k=>k.flowId===C.slug);if(u)return u.shouldTrigger===!1}return!!(C!=null&&C.targetingLogic&&n&&n.startsWith("guest_"))}function Lt(C){return!St(M(C))}function $t(){n&&F()}return{getFlow:M,getFlowData:Xe,isLoading:I||j,getStepStatus:ue,getFlowSteps:V,getCurrentStepIndex:W,markStepStarted:de,markStepCompleted:G,markFlowNotStarted:Y,markFlowStarted:ee,markFlowCompleted:Ve,markFlowAborted:Le,markStepNotStarted:be,getFlowStatus:fe,getNumberOfStepsCompleted:$e,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:St,setCustomVariable:q,updateCustomVariables:se,customVariables:p,getStepOptionalProgress:J,getFlowMetadata:pe,isStepBlocked:Oe,isStepHidden:we,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Lt,refresh:$t}}import{useCallback as lr,useContext as wa,useEffect as Ta}from"react";var Wt="guest_";function so(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(Q),{config:r,apiUrl:l}=Je(),{mutateUserFlowState:p}=De(),d=Dt(),{verifySDKInitiated:s}=Ut();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(Wt))return;let T=m(e);localStorage.getItem(T)||(d(`${l}users`,_(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(T,"true"))}},[e,n,t]);let c=lr(T=>D(this,null,function*(){if(!s())return;let S={foreignId:e,properties:T};yield d(`${l}users`,_(w({},r),{method:"POST",body:JSON.stringify(S)})),i(g=>w(w({},g),T)),p()}),[e,r,n,p]),f=lr((T,S)=>D(this,null,function*(){if(!s())return;let v={foreignId:e,events:[{event:T,properties:S}]};yield d(`${l}users`,_(w({},r),{method:"POST",body:JSON.stringify(v)})),p()}),[e,r,p]),y=lr((T,S)=>D(this,null,function*(){if(s())if(S){let g=m(T);localStorage.setItem(g,"true"),o(T);let v={foreignId:T,properties:S};yield d(`${l}users`,_(w({},r),{method:"POST",body:JSON.stringify(v)})),i(P=>w(w({},P),S)),p()}else o(T)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as qp}from"uuid";import et,{useEffect as mn,useState as un}from"react";import qe,{useEffect as cr,useState as Ia}from"react";import Oo from"styled-components";import Fa from"react";import ka from"styled-components";var pi="fr-",lo="cfr-";function a(e,t){let o=`${pi}${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+" "+lo+e}return o}function E(e){if(!e.className||e.className.indexOf(lo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(pi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Bo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Bo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function ao(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
|
|
2
|
+
var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var Po=Object.getOwnPropertySymbols;var oi=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable;var ti=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))oi.call(t,o)&&ti(e,o,t[o]);if(Po)for(var o of Po(t))ri.call(t,o)&&ti(e,o,t[o]);return e},_=(e,t)=>na(e,sa(t));var ii=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)oi.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Po)for(var i of Po(e))t.indexOf(i)<0&&ri.call(e,i)&&(o[i]=e[i]);return o};var D=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(l){n(l)}},s=d=>{try{p(o.throw(d))}catch(l){n(l)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);p((o=o.apply(e,t)).next())});import Pt,{createContext as Cd,useEffect as Go,useState as je}from"react";import{ThemeProvider as yd}from"styled-components";import kt,{useContext as qp,useEffect as Kt,useState as xo}from"react";import{useCallback as wt,useContext as ya,useEffect as Sa}from"react";import rr,{useMemo as si}from"react";var ni="1.35.51 ";var He="NOT_STARTED_STEP",Z="COMPLETED_FLOW",vo="ABORTED_FLOW",bt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ke="COMPLETED_STEP",Bo="STARTED_STEP";function Je(){let{publicApiKey:e,userId:t,apiUrl:o}=rr.useContext(Q);return{config:si(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ni,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:si(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Dt(){let{shouldGracefullyDegrade:e,readonly:t}=rr.useContext(Q);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Mt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Mt();let n=la+o,r=aa+o;if(window&&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 l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return Mt()}window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body)}let s;try{s=yield fetch(o,i)}catch(p){return Mt(p)}return s?s.ok?s:Mt(s.statusText):Mt()})}function Mt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ut(){let{publicApiKey:e,shouldGracefullyDegrade:t}=rr.useContext(Q);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as ha,useState as li}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=pa(Q);function r(c,f=!1){var y;return(y=e[c])!=null?y:f}function s(c,f){t(y=>_(w({},y),{[c]:f}))}function p(c){t(f=>{let S=f,{[c]:y}=S,T=Ie(S,[ii(c)]);return w({},T)})}function d(c){n.includes(c)||i(f=>[...f,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,y])=>y&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import fa from"swr/immutable";import no from"core-js-pure/actual/structured-clone";function ir(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(!ir(t)||!ir(o))throw new Error("deepmerge can only merge Objects");let i=no(t);return Object.entries(o).forEach(([n,r])=>{ir(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],no(r))}):Object.assign(i,{[n]:no(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...no(r)]}):Object.assign(i,{[n]:no(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function De(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:p}=da(Q),{resetOpenFlowState:d}=Be(),[l,m]=ma(!1),c={data:r.map(h=>({flowId:h.id,flowState:Z,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=h=>fetch(h,e).then(b=>{if(b.ok)return b.json();throw new Error("Failed to fetch user flow states")}).catch(b=>(console.log(`Error fetching ${h}: ${b}. Will gracefully degrade and hide Frigade`),s(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:T,isLoading:S,mutate:g,error:E}=p?fa(y,f):ua(y,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),P=T==null?void 0:T.data;ca(()=>{!l&&!S&&P&&m(!0)},[P,l,S]);function F(h){return D(this,null,function*(){if(P&&!p){let b=P.find(N=>N.flowId===h);b&&b.flowState!==Z&&(b.flowState=Z),yield g(Promise.resolve(Ce(T,{data:P})),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function A(h,b,N){return D(this,null,function*(){if(P){let L=P.find(O=>O.flowId===h);L&&(L.stepStates[b]=N,L.flowState=bt),yield g(Promise.resolve(Ce(T,{data:P})),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function I(h,b,N){return D(this,null,function*(){if(P){let L=P.find(O=>O.flowId===h);L&&(L.lastStepId=b,L.stepStates[b]=N,L.flowState=bt),yield g(Ce(T,{data:P}),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function x(h){return D(this,null,function*(){if(P){let b=P.find(N=>N.flowId===h);b&&b.flowState!==Me&&(b.flowState=Me,b.lastStepId=ga,Object.keys(b.stepStates).forEach(N=>{b.stepStates[N].actionType=He,b.stepStates[N].createdAt=new Date().toISOString()}),yield g(Ce(T,{data:P}),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1}),d(h))}})}function v(h,b){return D(this,null,function*(){if(P){let N=P.find(L=>L.flowId===h);N&&N.stepStates[b]!==He&&(N.stepStates[b]=He),yield g(Ce(T,{data:P}),{optimisticData:Ce(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:P,isLoadingUserFlowStateData:!l,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:x,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:v,optimisticallyMarkStepStarted:I,error:E}}function so(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=ha(Q),[d,l]=li(new Set),[m,c]=li(new Set),f=Dt();function y(g){let E=JSON.stringify(g);if(d.has(E))return null;d.add(E),l(d),m.add(g),c(m);let P=s==null?void 0:s.find(F=>F.flowSlug===g.flowSlug&&F.stepId===g.stepId&&F.actionType===g.actionType&&F.createdAt===g.createdAt);return f(`${t}flowResponses`,_(w({},e),{method:"POST",body:E})).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...n,g])):P||p(A=>[...A!=null?A:[],g])})}function T(g){return D(this,null,function*(){g.foreignUserId&&(g.actionType===bt||g.actionType===Me?yield y(g):g.actionType===Z?yield y(g):g.actionType===Bo?yield y(g):g.actionType===Ke?yield y(g):g.actionType===vo?yield y(g):g.actionType===He&&(yield y(g)))})}function S(){let g=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let P in E.stepStates){let F=E.stepStates[P];g.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...g,...s]}return{addResponse:T,setFlowResponses:p,getFlowResponses:S}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ai=e=>{let t=xa.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Ca(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function nr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var sr=(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))(sr||{});function R(){let{config:e,apiUrl:t}=Je(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:y}=ya(Q),T={data:[]},{verifySDKInitiated:S}=Ut(),{addResponse:g,getFlowResponses:E}=so(),P=C=>fetch(C,e).then(u=>u.ok?u.json():(console.log(`Error fetching ${C} (${u.status}): ${u.statusText}. Will gracefully degrade and hide Frigade`),f(!0),T)).catch(u=>(console.log(`Error fetching ${C}: ${u}. Will gracefully degrade and hide Frigade`),f(!0),T)),{mutateUserFlowState:F,userFlowStatesData:A,isLoadingUserFlowStateData:I,optimisticallyMarkFlowCompleted:x,optimisticallyMarkFlowNotStarted:v,optimisticallyMarkStepCompleted:h,optimisticallyMarkStepNotStarted:b,optimisticallyMarkStepStarted:N}=De(),{data:L,error:O,isLoading:j}=ba(s?`${t}flows${y?"?readonly=true":""}`:null,P,{keepPreviousData:!0});Sa(()=>{if(O){console.error(O);return}L&&L.data&&i(L.data)},[L,O]);function M(C){if(j)return null;let u=o.find(k=>k.slug===C);return!u&&o.length>0&&!I&&!j?(console.log(`Flow with id ${C} not found`),null):(u==null?void 0:u.active)===!1&&!y?null:u}function G(C){var z,he;if(!M(C))return[];let u=M(C).data;return u?(u=le(u),((he=(z=nr(u))==null?void 0:z.data)!=null?he:[]).map(xe=>{let io=J(xe);return _(w({handleSecondaryButtonClick:()=>{xe.skippable===!0&&V(C,xe.id,{skipped:!0})}},xe),{complete:ue(C,xe.id)===Ke||io>=1,blocked:Oe(C,xe.id),hidden:we(C,xe.id),handlePrimaryButtonClick:()=>{(!xe.completionCriteria&&(xe.autoMarkCompleted||xe.autoMarkCompleted===void 0)||xe.completionCriteria&&xe.autoMarkCompleted===!0)&&V(C,xe.id)},progress:io})}).filter(xe=>xe.hidden!==!0)):[]}function le(C){return C.replaceAll(/\${(.*?)}/g,(u,k)=>p[k]===void 0?"":String(p[k]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.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 pe(C){var k;if(!M(C))return[];let u=M(C).data;return u?(u=le(u),(k=JSON.parse(u))!=null?k:{}):[]}function q(C,u){d(k=>_(w({},k),{[C]:u}))}function se(C){!I&&!j&&C&&JSON.stringify(p)!=JSON.stringify(w(w({},p),C))&&Object.keys(C).forEach(u=>{q(u,C[u])})}let de=wt((C,u,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:Bo,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield N(C,u,z),g(z))}),[n,r,A]),be=wt((C,u,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:He,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield b(C,u),g(z))}),[n,r,A]),V=wt((C,u,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:Ke,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield h(C,u,z),g(z))}),[n,r,A]),Y=wt((C,u)=>D(this,null,function*(){if(!S()||fe(C)===Me)return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Me,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};yield v(C),X(k)&&g(k)}),[n,r,A]),ee=wt((C,u)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:bt,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&g(k)}),[n,r,A]),Ve=wt((C,u)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Z,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(C),g(k))}),[n,r,A]),Le=wt((C,u)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:vo,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(C),g(k))}),[n,r,A]);function X(C){var u;if(!A&&C.actionType===He)return!1;if(A){let k=A.find(z=>z.flowId===C.flowSlug);if(C.actionType===He&&(!(k!=null&&k.stepStates[C.stepId])||k.stepStates[C.stepId].actionType===He)||k&&((u=k.stepStates[C.stepId])==null?void 0:u.actionType)===C.actionType||k&&k.flowState===Z&&C.actionType===Z)return!1}return!0}function ue(C,u){let k=U(C,u);return I?null:k?k.actionType:He}function Oe(C,u){let k=U(C,u);return k?k.blocked:!1}function we(C,u){let k=U(C,u);return k?k.hidden:!1}function U(C,u){var z;if(I)return null;let k=A==null?void 0:A.find(he=>he.flowId===C);return!k||!k.stepStates[u]?null:(z=k.stepStates[u])!=null?z:null}function $(C){var k,z;if(I||!A)return null;if(fe(C)===Me)return(k=G(C)[0])!=null?k:null;let u=(z=A.find(he=>he.flowId===C))==null?void 0:z.lastStepId;return u?G(C).find(he=>he.id===u):null}function W(C){var z;let u=$(C);if(!u)return 0;let k=(z=G(C).findIndex(he=>he.id===u.id))!=null?z:0;return ue(C,u.id)===Ke&&k<G(C).length-1?k+1:k}function J(C){if(!C.completionCriteria)return;let u=ai(C.completionCriteria);if(u===null)return;let k=$e(u),z=Ge(u);return z===0?void 0:k/z}function fe(C){let u=A==null?void 0:A.find(k=>k.flowId===C);return u?u.flowState:null}function $e(C){let u=G(C);return u.length===0?0:u.filter(z=>ue(C,z.id)===Ke).length}function Ge(C){return G(C).length}function Xe(C){let u=o.find(k=>k.slug===C);return u?nr(u.data):null}function St(C){if(y)return!1;if(I)return!0;if(C!=null&&C.targetingLogic&&A){let u=A.find(k=>k.flowId===C.slug);if(u)return u.shouldTrigger===!1}return!!(C!=null&&C.targetingLogic&&n&&n.startsWith("guest_"))}function Lt(C){return!St(M(C))}function $t(){n&&F()}return{getFlow:M,getFlowData:Xe,isLoading:I||j,getStepStatus:ue,getFlowSteps:G,getCurrentStepIndex:W,markStepStarted:de,markStepCompleted:V,markFlowNotStarted:Y,markFlowStarted:ee,markFlowCompleted:Ve,markFlowAborted:Le,markStepNotStarted:be,getFlowStatus:fe,getNumberOfStepsCompleted:$e,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:St,setCustomVariable:q,updateCustomVariables:se,customVariables:p,getStepOptionalProgress:J,getFlowMetadata:pe,isStepBlocked:Oe,isStepHidden:we,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Lt,refresh:$t}}import{useCallback as lr,useContext as wa,useEffect as Ta}from"react";var Wt="guest_";function lo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(Q),{config:r,apiUrl:s}=Je(),{mutateUserFlowState:p}=De(),d=Dt(),{verifySDKInitiated:l}=Ut();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(Wt))return;let T=m(e);localStorage.getItem(T)||(d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(T,"true"))}},[e,n,t]);let c=lr(T=>D(this,null,function*(){if(!l())return;let S={foreignId:e,properties:T};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(S)})),i(g=>w(w({},g),T)),p()}),[e,r,n,p]),f=lr((T,S)=>D(this,null,function*(){if(!l())return;let E={foreignId:e,events:[{event:T,properties:S}]};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(E)})),p()}),[e,r,p]),y=lr((T,S)=>D(this,null,function*(){if(l())if(S){let g=m(T);localStorage.setItem(g,"true"),o(T);let E={foreignId:T,properties:S};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(E)})),i(P=>w(w({},P),S)),p()}else o(T)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Yp}from"uuid";import et,{useEffect as mn,useState as un}from"react";import qe,{useEffect as cr,useState as Ia}from"react";import Io from"styled-components";import Fa from"react";import ka from"styled-components";var pi="fr-",ao="cfr-";function a(e,t){let o=`${pi}${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+" "+ao+e}return o}function B(e){if(!e.className||e.className.indexOf(ao)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(pi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Eo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Eo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function po(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>B(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -27,8 +27,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Ee=()=>ar.createElement(Ba,null,ar.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},ar.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Na}from"react-portal";import Ti from"react";import pr from"react";function Ea({style:e,className:t}){return pr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},pr.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"}),pr.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 ci=Ea;import dr from"styled-components";import rt from"styled-components";var
|
|
31
|
-
${e=>
|
|
30
|
+
`,Ee=()=>ar.createElement(Ba,null,ar.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},ar.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Na}from"react-portal";import Ti from"react";import pr from"react";function Ea({style:e,className:t}){return pr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},pr.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"}),pr.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 ci=Ea;import dr from"styled-components";import rt from"styled-components";var Ao=rt.div`
|
|
31
|
+
${e=>B(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -58,11 +58,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
60
|
`,mi=rt.div`
|
|
61
|
-
${e=>
|
|
61
|
+
${e=>B(e)} {
|
|
62
62
|
${e=>e.hasImage?Aa:Oa};
|
|
63
63
|
}
|
|
64
64
|
`,ui=rt.img`
|
|
65
|
-
${e=>
|
|
65
|
+
${e=>B(e)} {
|
|
66
66
|
display: block;
|
|
67
67
|
width: 100%;
|
|
68
68
|
height: auto;
|
|
@@ -70,7 +70,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
70
70
|
object-fit: cover;
|
|
71
71
|
}
|
|
72
72
|
`,fi=rt.div`
|
|
73
|
-
${e=>
|
|
73
|
+
${e=>B(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
76
76
|
height: auto;
|
|
@@ -95,14 +95,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
95
95
|
flex-shrink: 1;
|
|
96
96
|
gap: 8px;
|
|
97
97
|
height: 64px;
|
|
98
|
-
${e=>
|
|
98
|
+
${e=>B(e)} {
|
|
99
99
|
flex-direction: row;
|
|
100
100
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
101
101
|
align-content: center;
|
|
102
102
|
align-items: center;
|
|
103
103
|
}
|
|
104
104
|
`,yi=rt.p`
|
|
105
|
-
${e=>
|
|
105
|
+
${e=>B(e)} {
|
|
106
106
|
font-style: normal;
|
|
107
107
|
font-weight: 600;
|
|
108
108
|
font-size: 15px;
|
|
@@ -121,7 +121,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
121
121
|
align-items: center;
|
|
122
122
|
justify-content: center;
|
|
123
123
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
124
|
-
`,bi=dr(
|
|
124
|
+
`,bi=dr(Ao)`
|
|
125
125
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
126
126
|
position: absolute;
|
|
127
127
|
bottom: -60px;
|
|
@@ -143,8 +143,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
143
143
|
font-size: 12px;
|
|
144
144
|
line-height: 18px;
|
|
145
145
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
146
|
-
`;function
|
|
147
|
-
${e=>
|
|
146
|
+
`;function Oo({appearance:e}){return Ti.createElement(wi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Ti.createElement(ci,null))}var La=Io.div`
|
|
147
|
+
${e=>B(e)} {
|
|
148
148
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
149
149
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
150
150
|
/* Mobile */
|
|
@@ -185,27 +185,27 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
185
185
|
opacity: 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,$a=
|
|
188
|
+
`,$a=Io.div`
|
|
189
189
|
position: relative;
|
|
190
190
|
flex: 0 1 auto;
|
|
191
|
-
`,Ma=
|
|
191
|
+
`,Ma=Io.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 16px;
|
|
194
194
|
right: 16px;
|
|
195
195
|
cursor: pointer;
|
|
196
196
|
z-index: 1501;
|
|
197
|
-
${e=>
|
|
197
|
+
${e=>B(e)} {
|
|
198
198
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
199
199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
200
200
|
}
|
|
201
|
-
`,Da=
|
|
201
|
+
`,Da=Io.div`
|
|
202
202
|
overflow: scroll;
|
|
203
203
|
flex: 1 1;
|
|
204
204
|
display: flex;
|
|
205
205
|
::-webkit-scrollbar {
|
|
206
206
|
display: none;
|
|
207
207
|
}
|
|
208
|
-
`,Qe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:
|
|
208
|
+
`,Qe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[d,l]=Ia("");return cr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");l(m)},[]),cr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),cr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?qe.createElement(Na,null,qe.createElement(di,{appearance:r,onClose:()=>{s&&e()}}),qe.createElement(La,{appearance:r,className:a("modalContainer",r),styleOverrides:i},s&&qe.createElement(Ma,{className:a("modalClose",r),onClick:()=>e(),appearance:r},qe.createElement(Ee,null)),o&&qe.createElement($a,null,o),qe.createElement(Da,null,n),p&&qe.createElement(Si,{appearance:r,className:a("poweredByFrigadeRibbon",r)},qe.createElement(Oo,{appearance:r})))):qe.createElement(qe.Fragment,null)};import ut,{useEffect as mr,useState as Ua}from"react";import No from"styled-components";import{Portal as Wa}from"react-portal";function za(e){switch(e){case"top-left":return`
|
|
209
209
|
top: 0;
|
|
210
210
|
left: 0;
|
|
211
211
|
`;case"top-right":return`
|
|
@@ -214,8 +214,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
214
214
|
`;case"bottom-left":return`
|
|
215
215
|
bottom: 0;
|
|
216
216
|
left: 0;
|
|
217
|
-
`}return"right: 0; bottom: 0;"}var _a=
|
|
218
|
-
${e=>
|
|
217
|
+
`}return"right: 0; bottom: 0;"}var _a=No.div`
|
|
218
|
+
${e=>B(e)} {
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
221
221
|
position: fixed;
|
|
@@ -230,27 +230,27 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
230
230
|
}
|
|
231
231
|
${e=>za(e.modalPosition)}
|
|
232
232
|
margin: 28px;
|
|
233
|
-
`,Ha=
|
|
233
|
+
`,Ha=No.div`
|
|
234
234
|
position: relative;
|
|
235
235
|
flex: 1;
|
|
236
|
-
`,ja=
|
|
236
|
+
`,ja=No.div`
|
|
237
237
|
position: absolute;
|
|
238
238
|
top: 16px;
|
|
239
239
|
right: 16px;
|
|
240
240
|
cursor: pointer;
|
|
241
241
|
z-index: 1501;
|
|
242
|
-
${e=>
|
|
242
|
+
${e=>B(e)} {
|
|
243
243
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
244
244
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
245
245
|
}
|
|
246
|
-
`,Va=
|
|
246
|
+
`,Va=No.div`
|
|
247
247
|
overflow: scroll;
|
|
248
248
|
flex: 5;
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,
|
|
253
|
-
${e=>
|
|
252
|
+
`,Lo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[p,d]=Ua("");return mr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),mr(()=>{let l=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),mr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?ut.createElement(Wa,null,ut.createElement(_a,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},s&&ut.createElement(ja,{className:a("cornerModalClose",n),onClick:()=>e()},ut.createElement(Ee,null)),o&&ut.createElement(Ha,null,o),ut.createElement(Va,null,i))):ut.createElement(ut.Fragment,null)};import{useContext as Ga}from"react";function te(){let{defaultAppearance:e}=Ga(Q);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 Tt,{useContext as up,useEffect as zi,useState as wr}from"react";import Wo from"styled-components";import Do,{useEffect as Ei,useState as gr}from"react";import hr from"styled-components";import $o from"styled-components";var Fi=$o.label`
|
|
253
|
+
${e=>B(e)} {
|
|
254
254
|
font-size: 12px;
|
|
255
255
|
line-height: 18px;
|
|
256
256
|
margin-bottom: 5px;
|
|
@@ -260,14 +260,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
260
260
|
letter-spacing: 0.24px;
|
|
261
261
|
}
|
|
262
262
|
display: flex;
|
|
263
|
-
`,ki
|
|
264
|
-
${e=>
|
|
263
|
+
`,ki=$o.label`
|
|
264
|
+
${e=>B(e)} {
|
|
265
265
|
font-size: 12px;
|
|
266
266
|
line-height: 20px;
|
|
267
267
|
margin-bottom: 5px;
|
|
268
268
|
}
|
|
269
269
|
display: flex;
|
|
270
|
-
`,Pi
|
|
270
|
+
`,Pi=$o.span`
|
|
271
271
|
font-weight: 400;
|
|
272
272
|
font-size: 14px;
|
|
273
273
|
line-height: 22px;
|
|
@@ -275,17 +275,17 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
275
275
|
display: flex;
|
|
276
276
|
margin-right: 5px;
|
|
277
277
|
margin-top: 10px;
|
|
278
|
-
|
|
278
|
+
`,Mo=$o.div`
|
|
279
279
|
display: flex;
|
|
280
280
|
align-items: flex-start;
|
|
281
281
|
justify-content: left;
|
|
282
282
|
margin-bottom: 10px;
|
|
283
|
-
`;import ur from"react";var it={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 ft({title:e,required:t,appearance:o=it}){return e?ur.createElement(
|
|
283
|
+
`;import ur from"react";var it={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 ft({title:e,required:t,appearance:o=it}){return e?ur.createElement(Mo,{className:a("formLabelWrapper",o)},t?ur.createElement(Pi,{className:a("formLabelRequired",o),appearance:o},"*"):null,ur.createElement(Fi,{className:a("formLabel",o)},e)):null}import vi from"react";function zt({title:e,appearance:t}){return e?vi.createElement(Mo,null,vi.createElement(ki,{className:a("formSubLabel",t)},e)):null}import{z as fr}from"zod";function Bi(e,t){var o,i,n,r,s,p,d;try{if(t){if(t.type=="number"){let l=fr.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=fr.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),(p=m.message)!=null?p:"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 fr.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 Ka=hr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
287
|
`,xr=hr.input`
|
|
288
|
-
${e=>
|
|
288
|
+
${e=>B(e)} {
|
|
289
289
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
290
290
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
291
291
|
font-size: 14px;
|
|
@@ -301,7 +301,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
301
301
|
padding: 0 10px;
|
|
302
302
|
margin-bottom: 10px;
|
|
303
303
|
`,qa=hr.textarea`
|
|
304
|
-
${e=>
|
|
304
|
+
${e=>B(e)} {
|
|
305
305
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
306
306
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
307
307
|
font-size: 14px;
|
|
@@ -316,14 +316,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
316
316
|
min-height: 70px;
|
|
317
317
|
box-sizing: border-box;
|
|
318
318
|
margin-bottom: 10px;
|
|
319
|
-
`;function Cr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[
|
|
319
|
+
`;function Cr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,p]=gr((n==null?void 0:n.text)||""),[d,l]=gr(!1),[m,c]=gr(!1),f=xr;Ei(()=>{s===""&&!d&&(l(!0),y(""))},[]),Ei(()=>{if(m){y(s);return}},[m]);function y(S){var E;if(p(S),o({text:S}),r.required===!0&&S.trim()===""){i([{id:r.id,message:`${(E=r.title)!=null?E:"Field"} is required`,hidden:!m}]);return}let g=Bi(S,r.validation);if(g&&(S.trim()!==""||r.required===!0)){i([{id:r.id,message:g,hidden:!m}]);return}i([])}r.multiline&&(f=qa);function T(){var S;switch((S=r==null?void 0:r.validation)==null?void 0:S.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Do.createElement(Ka,null,Do.createElement(ft,{title:r.title,required:r.required,appearance:t.appearance}),Do.createElement(f,{className:a("inputComponent",t.appearance),value:s,onChange:S=>{y(S.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:T(),onBlur:()=>{c(!0)}}),Do.createElement(zt,{title:r.subtitle,appearance:t.appearance}))}import Ze,{useEffect as Ai,useState as Oi}from"react";import Ii from"styled-components";var yr="",Ya=Ii.div`
|
|
320
320
|
display: flex;
|
|
321
321
|
flex-direction: column;
|
|
322
322
|
width: 100%;
|
|
323
323
|
-webkit-appearance: none;
|
|
324
324
|
appearance: none;
|
|
325
325
|
`,Xa=Ii.select`
|
|
326
|
-
${e=>
|
|
326
|
+
${e=>B(e)} {
|
|
327
327
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
328
328
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
329
329
|
font-size: 14px;
|
|
@@ -343,16 +343,16 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
343
343
|
background-repeat: no-repeat;
|
|
344
344
|
background-size: 1.5em 1.5em;
|
|
345
345
|
-webkit-print-color-adjust: exact;
|
|
346
|
-
`;function Ni({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,f,y,T,S,g,
|
|
346
|
+
`;function Ni({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,f,y,T,S,g,E,P;let r=e,[s,p]=Oi(!1),[d,l]=Oi(!1);return Ai(()=>{var F,A,I,x;if(!((F=i==null?void 0:i.choice)!=null&&F[0])&&!s){if(p(!0),r.requireSelection){o({choice:[yr]});return}if(r.defaultValue&&((A=r.props.options)!=null&&A.find(v=>v.id===r.defaultValue))){let v=(I=r.props.options)==null?void 0:I.find(h=>h.id===r.defaultValue);o({choice:[v.id]})}else o({choice:[((x=r.props.options)==null?void 0:x[0].id)||""]})}},[]),Ai(()=>{var F;d&&(r.requireSelection&&((F=i==null?void 0:i.choice)==null?void 0:F[0])===yr?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),Ze.createElement(Ya,null,Ze.createElement(ft,{title:r.title,required:!1,appearance:t.appearance}),Ze.createElement(Xa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:F=>{l(!0),o({choice:[F.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&Ze.createElement("option",{key:"null-value",value:yr,disabled:!0},(f=r.placeholder)!=null?f:"Select an option"),(y=r.props.options)==null?void 0:y.map(F=>Ze.createElement("option",{key:F.id,value:F.id},F.title))),((S=(T=r.props.options)==null?void 0:T.find(F=>{var A;return F.id===((A=i==null?void 0:i.choice)==null?void 0:A[0])}))==null?void 0:S.isOpenEnded)&&Ze.createElement(Ze.Fragment,null,Ze.createElement(ft,{title:(P=(E=(g=r.props.options)==null?void 0:g.find(F=>{var A;return F.id===((A=i==null?void 0:i.choice)==null?void 0:A[0])}))==null?void 0:E.openEndedLabel)!=null?P:"Please specify",required:!1,appearance:t.appearance}),Ze.createElement(xr,{type:"text",placeholder:"Enter your answer here",onChange:F=>{o({choice:[F.target.value]})},appearance:t.appearance})),Ze.createElement(zt,{title:r.subtitle,appearance:t.appearance}))}import uo,{useEffect as Sr,useState as $i}from"react";import Mi from"styled-components";import mo from"react";import co from"react";var Li=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return co.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Ja=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>co.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},co.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},co.createElement(Li,{color:n,size:t}),co.createElement(Li,{color:e,percentage:Math.max(o,.1),size:t})),i),_t=Ja;import Qa from"styled-components";var Za=({color:e="#FFFFFF"})=>mo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},mo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ra={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ep={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},tp={border:"1px solid #000000",color:"#FFFFFF"},op={border:"1px solid #C5CBD3"},rp={color:"#FFFFFF"},ip={border:"1px solid #C5CBD3"},np=e=>e==="square"?Ra:ep,sp=(e,t)=>e==="square"?t?tp:op:t?rp:ip,lp=Qa.div`
|
|
347
347
|
${e=>ke(e)}
|
|
348
|
-
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=it,style:r,className:
|
|
348
|
+
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=it,style:r,className:s})=>{let p=np(t),d=sp(t,e);return e===!0?p=_(w(w({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=w(w({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?mo.createElement(_t,{fillColor:o,percentage:i,size:22}):mo.createElement(lp,{styleOverrides:p,style:r,role:"checkbox",className:Te(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&mo.createElement(Za,{color:"#FFFFFF"}))};var ap=Mi.div`
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: column;
|
|
351
351
|
width: 100%;
|
|
352
352
|
-webkit-appearance: none;
|
|
353
353
|
appearance: none;
|
|
354
354
|
`,pp=Mi.button`
|
|
355
|
-
${e=>
|
|
355
|
+
${e=>B(e)} {
|
|
356
356
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
357
357
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
358
358
|
font-size: 14px;
|
|
@@ -376,8 +376,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
376
376
|
height: 48px;
|
|
377
377
|
padding: 0 18px;
|
|
378
378
|
margin-bottom: 10px;
|
|
379
|
-
`;function Di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[
|
|
380
|
-
${e=>
|
|
379
|
+
`;function Di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[s,p]=$i((i==null?void 0:i.choice)||[]),[d,l]=$i(!1);return Sr(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),Sr(()=>{o({choice:s})},[s]),Sr(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[s]),uo.createElement(ap,null,uo.createElement(ft,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>uo.createElement(pp,{appearance:t.appearance,className:a(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)){p(s.filter(f=>f!==c.id));return}s.length<r.props.maxChoices?p([...s,c.id]):s.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,uo.createElement(nt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),uo.createElement(zt,{title:r.subtitle,appearance:t.appearance}))}import Uo from"react";import Ui from"styled-components";import dp from"dompurify";function ce(e){return{__html:dp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var cp=Ui.h1`
|
|
380
|
+
${e=>B(e)} {
|
|
381
381
|
font-style: normal;
|
|
382
382
|
font-weight: 700;
|
|
383
383
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -389,7 +389,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
389
389
|
color: ${e=>e.appearance.theme.colorText};
|
|
390
390
|
}
|
|
391
391
|
`,mp=Ui.h2`
|
|
392
|
-
${e=>
|
|
392
|
+
${e=>B(e)} {
|
|
393
393
|
font-style: normal;
|
|
394
394
|
font-weight: 400;
|
|
395
395
|
font-size: 14px;
|
|
@@ -397,25 +397,25 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
397
397
|
letter-spacing: 0.28px;
|
|
398
398
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
399
399
|
}
|
|
400
|
-
`;function Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return
|
|
400
|
+
`;function Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return Uo.createElement(Uo.Fragment,null,Uo.createElement(cp,{appearance:e,className:a(`${n}${n?po(i):i}Title`,e),dangerouslySetInnerHTML:ce(t),size:i}),o&&Uo.createElement(mp,{appearance:e,className:a(`${n}${n?po(i):i}Subtitle`,e),dangerouslySetInnerHTML:ce(o),size:i}))}import*as br from"react";var Wi=e=>br.createElement("svg",w({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),br.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 fp=Wo.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
flex-direction: column;
|
|
403
403
|
justify-content: flex-end;
|
|
404
404
|
overflow: visible;
|
|
405
405
|
padding-top: 14px;
|
|
406
|
-
`,gp=
|
|
406
|
+
`,gp=Wo.div`
|
|
407
407
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
408
408
|
font-size: 12px;
|
|
409
409
|
margin-bottom: 12px;
|
|
410
410
|
display: flex;
|
|
411
411
|
align-items: center;
|
|
412
|
-
`,hp=
|
|
412
|
+
`,hp=Wo.div`
|
|
413
413
|
margin-right: 4px;
|
|
414
414
|
display: inline-flex;
|
|
415
|
-
`,xp=
|
|
415
|
+
`,xp=Wo.div`
|
|
416
416
|
padding-left: 1px;
|
|
417
417
|
padding-right: 1px;
|
|
418
|
-
`,Cp={text:Cr,multipleChoice:Ni,multipleChoiceList:Di},Tr="frigade-multiInputStepTypeData";function _i({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:
|
|
418
|
+
`,Cp={text:Cr,multipleChoice:Ni,multipleChoiceList:Di},Tr="frigade-multiInputStepTypeData";function _i({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:s,prefillData:p}){var I;let d=t.props,[l,m]=wr([]),[c,f]=wr([]),{userId:y}=lo(),[T,S]=wr(F()||(p?p[t.id]:null)||{}),{readonly:g}=up(Q),E=w(w({},Cp),s);zi(()=>{i(l.length===0)},[l,i]),zi(()=>{n(T)},[T]);function P(x,v){S(h=>{let b=_(w({},h),{[x.id]:v});return window&&window.localStorage&&!g&&window.localStorage.setItem(A(),JSON.stringify(b)),b})}function F(){if(window&&window.localStorage){let x=window.localStorage.getItem(A());if(x)return JSON.parse(x)}return null}function A(){return`${Tr}-${e}-${t.id}-${y}`}return Tt.createElement(xp,{className:a("multiInput",r)},Tt.createElement(Ae,{appearance:r,title:t.title,subtitle:t.subtitle}),Tt.createElement(fp,{className:a("multiInputContainer",r)},(I=d==null?void 0:d.data)==null?void 0:I.map(x=>{let v=l.reverse().find(h=>h.id===x.id);return E[x.type]?Tt.createElement("span",{key:x.id,"data-field-id":x.id,className:a("multiInputField",r)},E[x.type]({formInput:x,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:h=>{!c.includes(x.id)&&h&&(h==null?void 0:h.text)!==""&&f(b=>[...b,x.id]),P(x,h)},inputData:T[x.id],setFormValidationErrors:h=>{h.length===0&&l.length===0||m(b=>h.length===0?b.filter(N=>N.id!==x.id):[...b,...h])}}),v&&v.message&&c.includes(x.id)&&v.hidden!==!0&&Tt.createElement(gp,{key:x.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},Tt.createElement(hp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},Tt.createElement(Wi,null)),v.message)):null})))}import Ht from"styled-components";var Hi=Ht.div`
|
|
419
419
|
align-items: center;
|
|
420
420
|
display: flex;
|
|
421
421
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
@@ -474,7 +474,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
474
474
|
justify-content: center;
|
|
475
475
|
align-content: center;
|
|
476
476
|
align-items: center;
|
|
477
|
-
${e=>
|
|
477
|
+
${e=>B(e)} {
|
|
478
478
|
display: flex;
|
|
479
479
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
480
480
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -503,8 +503,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
503
503
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
504
504
|
cursor: not-allowed;
|
|
505
505
|
}
|
|
506
|
-
`,
|
|
507
|
-
${e=>
|
|
506
|
+
`,zo=Ji.div`
|
|
507
|
+
${e=>B(e)} {
|
|
508
508
|
display: flex;
|
|
509
509
|
flex-direction: row;
|
|
510
510
|
justify-content: flex-start;
|
|
@@ -514,9 +514,9 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
514
514
|
margin-right: 8px;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
`,oe=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:
|
|
517
|
+
`,oe=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l="",loading:m=!1})=>{var f;function c(){let y=s?"buttonSecondary":"button";return l===""?y:`${l}${po(y)}`}return Xi.createElement(Sp,{secondary:s,appearance:p,disabled:i||m,loading:(f=m==null?void 0:m.toString())!=null?f:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)},m?Xi.createElement(Yi,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var Qi=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:s,onBack:p,allowBackNavigation:d,errorMessage:l,isSaving:m})=>{var y;let c=s.length>1&&r!=0&&d,f=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return gt.createElement(gt.Fragment,null,l!==null&&l!=null&>.createElement(ji,{appearance:o,className:a("formCTAError",o)},l),gt.createElement(Hi,{showBackButton:c,className:a("formCTAContainer",o)},c&>.createElement(oe,{title:(y=e.backButtonTitle)!=null?y:"Back",onClick:p,secondary:!0,withMargin:!1,type:f,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),gt.createElement(Vi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?gt.createElement(oe,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:f,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?gt.createElement(oe,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:f,appearance:o,loading:m}):null)))};import Fr from"react";import bp from"styled-components";var wp=bp.div`
|
|
518
518
|
text-align: center;
|
|
519
|
-
`,Zi=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=te().mergeAppearanceWithDefault(i);return Fr.createElement(wp,{className:o},Fr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,
|
|
519
|
+
`,Zi=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=te().mergeAppearanceWithDefault(i);return Fr.createElement(wp,{className:o},Fr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Fr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"#E6E6E6"}))))};import Ft from"react";import jt from"styled-components";import{useContext as Tp}from"react";function ae(){let e=Tp(Q);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 Fp=jt.div`
|
|
520
520
|
display: flex;
|
|
521
521
|
flex-wrap: wrap;
|
|
522
522
|
align-content: center;
|
|
@@ -564,7 +564,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
564
564
|
margin-top: 12px;
|
|
565
565
|
margin-bottom: 16px;
|
|
566
566
|
max-width: 70%;
|
|
567
|
-
`;function Ri({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=ae();return Ft.createElement("div",null,Ft.createElement(Bp,null,e.title),Ft.createElement(Ep,null,e.subtitle),Ft.createElement(Fp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Ft.createElement(kp,{key:r.title},Ft.createElement(Pp,{src:r.imageUri}),Ft.createElement(vp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var
|
|
567
|
+
`;function Ri({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=ae();return Ft.createElement("div",null,Ft.createElement(Bp,null,e.title),Ft.createElement(Ep,null,e.subtitle),Ft.createElement(Fp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Ft.createElement(kp,{key:r.title},Ft.createElement(Pp,{src:r.imageUri}),Ft.createElement(vp,{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 Gt,{useEffect as Dp}from"react";import Ho from"styled-components";import kr from"react";var _o=({style:e,className:t})=>kr.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},kr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),kr.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 Vt,{useRef as Ap,useState as Op}from"react";import fo from"styled-components";var Ip=fo.div`
|
|
568
568
|
display: flex;
|
|
569
569
|
align-items: center;
|
|
570
570
|
justify-content: flex-start;
|
|
@@ -572,7 +572,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
572
572
|
width: 100%;
|
|
573
573
|
height: 100%;
|
|
574
574
|
position: relative;
|
|
575
|
-
`,Np=
|
|
575
|
+
`,Np=fo.div`
|
|
576
576
|
position: absolute;
|
|
577
577
|
display: flex;
|
|
578
578
|
align-items: center;
|
|
@@ -591,40 +591,45 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
591
591
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
592
592
|
border-radius: 50%;
|
|
593
593
|
}
|
|
594
|
-
`,Lp=
|
|
594
|
+
`,Lp=fo.video`
|
|
595
595
|
width: 100%;
|
|
596
596
|
height: 100%;
|
|
597
597
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
598
|
-
`,$p=
|
|
598
|
+
`,$p=fo.iframe`
|
|
599
599
|
width: 100%;
|
|
600
600
|
height: 100%;
|
|
601
601
|
min-height: 260px;
|
|
602
602
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
603
|
-
|
|
604
|
-
|
|
603
|
+
`,Mp=fo.iframe`
|
|
604
|
+
width: 100%;
|
|
605
|
+
height: 100%;
|
|
606
|
+
min-height: 400px;
|
|
607
|
+
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
608
|
+
}`;function Re({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Vt.createElement($p,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("youtubePlayer",e)})}if(t.includes("vimeo")){let r=t.split("vimeo.com/")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Vt.createElement(Mp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}return Vt.createElement(Ip,{className:a("videoPlayerWrapper",e),appearance:e},!i&&Vt.createElement(Np,{onClick:()=>{n(!0),o.current.play()},appearance:e},Vt.createElement(_o,null)),Vt.createElement(Lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Up=Ho.div`
|
|
609
|
+
${e=>B(e)} {
|
|
605
610
|
display: flex;
|
|
606
611
|
flex-direction: column;
|
|
607
612
|
justify-content: center;
|
|
608
613
|
}
|
|
609
|
-
`,
|
|
610
|
-
${e=>
|
|
614
|
+
`,Wp=Ho.img`
|
|
615
|
+
${e=>B(e)} {
|
|
611
616
|
width: 100%;
|
|
612
617
|
height: auto;
|
|
613
618
|
max-height: 250px;
|
|
614
619
|
margin-bottom: 24px;
|
|
615
620
|
}
|
|
616
|
-
`,
|
|
617
|
-
${e=>
|
|
621
|
+
`,zp=Ho.div`
|
|
622
|
+
${e=>B(e)} {
|
|
618
623
|
margin-bottom: 24px;
|
|
619
624
|
}
|
|
620
|
-
`,
|
|
621
|
-
${e=>
|
|
625
|
+
`,_p=Ho.div`
|
|
626
|
+
${e=>B(e)} {
|
|
622
627
|
width: 100%;
|
|
623
628
|
height: auto;
|
|
624
629
|
max-height: 250px;
|
|
625
630
|
margin-bottom: 24px;
|
|
626
631
|
}
|
|
627
|
-
`;function en({stepData:e,appearance:t,setCanContinue:o}){return
|
|
632
|
+
`;function en({stepData:e,appearance:t,setCanContinue:o}){return Dp(()=>{o(!0)},[]),Gt.createElement(Up,{className:a("callToActionContainer",t)},Gt.createElement(zp,{className:a("callToActionTextContainer",t)},Gt.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Gt.createElement(Wp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Gt.createElement(_p,{appearance:t,className:a("callToActionVideo",t)},Gt.createElement(Re,{appearance:t,videoUri:e.videoUri})))}import st,{useEffect as Pr,useState as vr}from"react";import ht from"styled-components";var tn=ht.div`
|
|
628
633
|
width: auto;
|
|
629
634
|
display: flex;
|
|
630
635
|
flex-direction: column;
|
|
@@ -677,8 +682,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
677
682
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
678
683
|
display: flex;
|
|
679
684
|
align-self: center;
|
|
680
|
-
`;var dn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,
|
|
681
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${Bo(l)}: ${p};`).join(" ")} }`:`${Bo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ie({appearance:e}){if(!e||!e.styleOverrides)return go.createElement(go.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?go.createElement(go.Fragment,null):go.createElement(jp,{inlineStyles:t})}var fn=({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:f=!0,endFlowOnDismiss:y=!1,modalPosition:T="center",repeatable:S=!1,onDismiss:g,showPagination:v=!1,allowBackNavigation:P=!1,validationHandler:F,showFrigadeBranding:A=!1,onFormDataChange:I,showFooter:x=!0,prefillData:B={},updateUrlOnPageChange:h=!1})=>{var $;let{getFlow:b,getFlowSteps:N,isLoading:L,targetingLogicShouldHideFlow:O,getFlowStatus:j,getCurrentStepIndex:M,markFlowCompleted:V,markFlowNotStarted:le,markStepStarted:pe}=R(),q=M(e),{mergeAppearanceWithDefault:se}=te(),[de,be]=un(!1),[G,Y]=un(""),{setOpenFlowState:ee,getOpenFlowState:Ve,hasOpenModals:Le}=Be(),X=N(e);d=se(d);let[ue,Oe]=i!==void 0&&n!==void 0?[i,n]:[Ve(e,!0),W=>ee(e,W)];if(mn(()=>{!de&&!L&&(be(!0),(j(e)===Z&&S||j(e)===Me)&&(j(e)===Z&&S&&le(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(J=>{J.startsWith(Tr)&&window.localStorage.removeItem(J)})),be(!0))},[de,be,L]),mn(()=>{var J;let W=(J=window==null?void 0:window.location)!=null&&J.hash?window.location.hash.replace("#",""):"";if(W!=G&&X&&(X==null?void 0:X.length)>0){let fe=-1;if(W){let $e=W;fe=X.findIndex(Ge=>Ge.id===$e),G===W&&(fe=-1),Y(W)}else fe=0,Y("");fe!==-1&&pe(e,X[fe].id)}},[X,($=window==null?void 0:window.location)==null?void 0:$.hash]),L)return null;let we=b(e);if(!we||O(we)||!X||i!==void 0&&i===!1||j(e)===Z&&s||(o=="modal"||o=="corner-modal")&&Le(e))return null;let U=()=>{Oe(!1),g&&g(),y===!0&&V(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let W={padding:"24px"};return o==="large-modal"?(W.width="85%",W.height="90%",W.maxHeight="800px",W.minHeight="500px",W.padding="0"):W.width="400px",et.createElement(Qe,{appearance:d,onClose:U,visible:ue,style:W,dismissible:f,showFrigadeBranding:A},et.createElement(ie,{appearance:d}),et.createElement(jo,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:v,customFormElements:l,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:B,updateUrlOnPageChange:h}))}return o==="modal"&&T!=="center"?et.createElement(No,{appearance:d,onClose:U,visible:ue,modalPosition:T},et.createElement(ie,{appearance:d}),et.createElement(jo,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:v,customFormElements:l,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:B,updateUrlOnPageChange:h})):et.createElement(et.Fragment,null,et.createElement(ie,{appearance:d}),et.createElement(jo,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:v,customFormElements:l,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:B,updateUrlOnPageChange:h}))},gn=fn;import{useCallback as Br,useContext as Vp,useEffect as Gp}from"react";function Er(){let{organizationId:e,userId:t,setOrganizationId:o}=Vp(Q),{mutateUserFlowState:i}=De(),{config:n,apiUrl:r}=Je(),l=Dt(),{verifySDKInitiated:p}=Ut();function d(f,y){return`frigade-user-group-registered-${f}-${y}`}Gp(()=>{if(t&&e){if(t.startsWith(Wt))return;let f=d(t,e);localStorage.getItem(f)||(l(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let s=Br(f=>D(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:f};yield l(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Br((f,y)=>D(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 S={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:y}]};yield l(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),c=Br((f,y)=>D(this,null,function*(){if(p())if(y){let T=d(t,f);localStorage.setItem(T,"true"),o(f);let S={foreignUserId:t,foreignUserGroupId:f,properties:y};yield l(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var hn="frigade-xFrigade_guestUserId",xo="frigade-xFrigade_userId",xn=({})=>{let{setFlowResponses:e}=no(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=so(),[l,p]=ho(n),{getFlowStatus:d}=R(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=Kp(Q),[y,T]=ho([]),[S,g]=ho([]),{organizationId:v}=Er(),[P,F]=ho(v),[A,I]=ho(!1);Gt(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let N=t[b],L=s.find(O=>O.slug===(N==null?void 0:N.flowId));if(L&&N&&N.shouldTrigger===!0&&L.type=="FORM"&&L.triggerType==="AUTOMATIC"&&!S.includes(L.slug)){setTimeout(()=>{x(N.flowId)},500);break}}},[o,t]),Gt(()=>{f.length>0&&i()},[f]),Gt(()=>{A||(I(!0),i())},[o,I]);function x(b){let N=s.find(L=>L.slug===b);N&&N.triggerType==="AUTOMATIC"&&!S.includes(N.slug)&&(g([...S,N.slug]),T([N]))}function B(){if(!n){let b=localStorage.getItem(xo);if(b){r(b);return}let N=localStorage.getItem(hn);if(N){r(N);return}c(!0);let L=Wt+qp();try{localStorage.setItem(hn,L)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||L)}}Gt(()=>{try{if(s){let b=[];s.forEach(N=>{if(N.data){let L=N.data.match(/"imageUri":"(.*?)"/g);L&&L.forEach(O=>{let j=O.replace('"imageUri":"',"").replace('"',"");if(b.includes(j))return;let M=new Image;M.src=j,b.push(j)})}})}}catch(b){}},[s]),Gt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Wt))try{localStorage.setItem(xo,n)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}n===null&&setTimeout(()=>{n===null&&B()},50)},[n,s,m]),Gt(()=>{v!=P&&(F(v),e([]),i())},[v,P,F]);function h(){return kt.createElement(kt.Fragment,null,y.map(b=>d(b.slug)!==Me?null:kt.createElement("span",{key:b.slug},kt.createElement(gn,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return kt.createElement(kt.Fragment,null,kt.createElement(h,null))};import{ErrorBoundary as yd}from"react-error-boundary";var Cn={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 Yp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Cn[o]){let n=Cn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function Xp(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 yn(e){let{theme:t,styleOverrides:o}=e,i=Yp(t),n=Xp(o);return{overrides:i,css:n}}import pd from"styled-components";import{compose as dd,variant as bn}from"styled-system";import Sn from"react";import Jp,{ThemeProvider as Qp,useTheme as Zp}from"styled-components";import{border as Rp,color as ed,compose as td,get as od,shadow as rd,space as id,system as nd,typography as sd}from"styled-system";var ld={width:{property:"width",scale:"sizes",transform:(e,t)=>od(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},ad=Jp("div")(({css:e})=>e,td(Rp,ed,rd,id,sd,nd(ld))),Co=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ie(r,["as","children","overrides"]);let l=Zp(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Sn.createElement(ad,w(w({as:e},p),i),t);if(o!==void 0){let s=Ce(l,o);return Sn.createElement(Qp,{theme:s},d())}return d()};var yo={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"}},cd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},wn=pd(Co)(()=>({whiteSpace:"nowrap"}),dd(bn({scale:"components.Button",variants:"components.Button"}),bn({prop:"size",variants:cd})));import md from"styled-components";import{variant as ud,system as fd}from"styled-system";var Vo={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 Tn=md(Co)(ud({scale:"components.Text",variants:"components.Text"}),fd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Fn=4,kn="px",gd=20,hd=Object.fromEntries(Array.from(Array(gd+1),(e,t)=>t===0?[.5,`${.5*Fn}${kn}`]:[t,`${t*Fn}${kn}`])),Kt={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"},Ar={colors:_(w({},Kt),{neutral:{foreground:Kt.gray300},primary:{background:Kt.blue500,foreground:Kt.white,inverted:Kt.blue500},negative:{foreground:Kt.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:hd,components:{Button:yo,Text:Vo}};var Pn="https://api.frigade.com",Q=xd({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:it,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Pn,readonly:!1,debug:!1});function Sd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var bd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var q,se,de,be,G;let[r,l]=je(t||null),[p,d]=je(o||null),[s,m]=je([]),[c,f]=je([]),[y,T]=je([]),[S,g]=je({}),[v,P]=je({}),[F,A]=je([]),[I,x]=je({}),[B,h]=je(!1),[b,N]=je(!1),[L,O]=je(!V(e)),j=(Y,ee)=>{if(ee==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},M={theme:w(w({},it.theme),(se=(q=i==null?void 0:i.defaultAppearance)==null?void 0:q.theme)!=null?se:{}),styleOverrides:w(w({},it.styleOverrides),(be=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?be:{})};function V(Y){return!!(Y&&Y.length>10&&Y.substring(0,10)==="api_public")}Go(()=>{t&&l(t)},[t]),Go(()=>{r&&window&&window.localStorage&&window.localStorage.getItem(xo)&&window.localStorage.getItem(xo)!==r&&Sd()},[r]),Go(()=>{o&&d(o)},[o]),Go(()=>{if(V(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let le={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:y,setFlowResponses:T,userProperties:S,setUserProperties:g,openFlowStates:v,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:F,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:I,setCustomVariables:x,isNewGuestUser:B,setIsNewGuestUser:h,hasActiveFullPageFlow:b,setHasActiveFullPageFlow:N,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:j,defaultAppearance:M,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:Pn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(L)return Pt.createElement(Q.Provider,{value:le},n);let{overrides:pe}=yn(M);return Pt.createElement(yd,{fallback:Pt.createElement(Pt.Fragment,null,n)},Pt.createElement(Q.Provider,{value:le},Pt.createElement(Cd,{theme:Ce(M.theme,Ar,pe!=null?pe:{},(G=i==null?void 0:i.theme)!=null?G:{})},n,Pt.createElement(xn,null))))};import pc from"react";import ye,{useEffect as ol,useState as rl}from"react";import Ye,{useState as Wd}from"react";import Et from"styled-components";import Yo from"react";import vt from"react";import Bn from"styled-components";var vn=Bn.span`
|
|
685
|
+
`;var dn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=vr([]),[p,d]=vr(!1),[l,m]=vr(e.id);return Pr(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Pr(()=>{l!==e.id&&(m(e.id),s([]))},[e]),Pr(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),st.createElement(tn,{className:a("selectListContainer",i)},st.createElement(on,null,st.createElement(rn,{className:a("selectListTitle",i)},e.title),st.createElement(nn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,f)=>{let y=r.includes(c.id);return st.createElement(sn,{key:`select-item-${f}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(T=>T!==c.id));return}r.length<n.maxChoices?s([...r,c.id]):r.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:f===n.options.length-1,className:a("selectListSelectItem",i)},st.createElement(ln,{className:a("selectListItemImage",i)},c.imageUri&&st.createElement(an,{src:c.imageUri,alt:`select-icon-${f}`}),st.createElement(pn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),st.createElement(nt,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import Ue,{useEffect as cn,useState as go}from"react";var Hp=({children:e,id:t,shouldWrap:o=!1})=>Ue.createElement(Ue.Fragment,null,o?Ue.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),jo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:m,setVisible:c,setShowModal:f,onDismiss:y,showPagination:T=!1,customFormElements:S,allowBackNavigation:g,validationHandler:E,onFormDataChange:P,showFooter:F,prefillData:A,updateUrlOnPageChange:I})=>{var U;let v=w(w({},{linkCollection:Ri,multiInput:_i,callToAction:en,selectList:dn}),i),{primaryCTAClickSideEffects:h,secondaryCTAClickSideEffects:b}=ae(),[N,L]=go(!1),[O,j]=go({}),[M,G]=go(!1),[le,pe]=go(!1),[q,se]=go(null),de=(U=t[o])!=null?U:null,{markStepCompleted:be,markStepStarted:V,isLoading:Y,updateCustomVariables:ee,markFlowCompleted:Ve}=R();cn(()=>{ee(n)},[n,Y]),cn(()=>{P&&P(O,Le(),t[o],o)},[O]);function Le(){var W;return{data:(W=O[t[o].id])!=null?W:{},stepId:t[o].id,customVariables:n}}function X($,W,J){let fe=o+1<t.length?t[o+1]:null;return s&&s($,J,fe,O,Le()),r?r($,o,W,fe):!0}function ue($,W){j(J=>{let fe={};return fe[$.id]=W,w(w({},J),fe)})}function Oe($){return $.selectedStep.imageUri?Ue.createElement(qi,{image:$.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let we=F&&Ue.createElement(Qi,{step:t[o],canContinue:N&&!M,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>D(void 0,null,function*(){if(G(!0),E){let J=yield E(t[o],o,t[o+1],O,Le());if(J!==!0){se(typeof J=="string"?J:null),G(!1);return}else se(null)}let $=w({},Le());yield be(p,t[o].id,$),o+1<t.length&&!g&&(yield V(p,t[o+1].id));let W=X(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),y&&y(),l&&W&&(c&&c(!1),f(!1)),yield Ve(p)),h(t[o]),G(!1),g&&o+1<t.length&&(window.location.hash=t[o+1].id),window&&!g&&I&&o+1<t.length){let J=new URL(window.location.href);J.searchParams.set("p",t[o+1].id),window.history.pushState({},"",J.toString())}}),onSecondaryClick:()=>{X(t[o],"secondary",o),b(t[o])},onBack:()=>D(void 0,null,function*(){o-1>=0&&(G(!0),g&&(window.location.hash=t[o-1].id),yield V(p,t[o-1].id),G(!1))}),steps:t,allowBackNavigation:g,errorMessage:q,isSaving:M});return Ue.createElement(Ue.Fragment,null,Ue.createElement(Gi,{className:a("formContainer",e)},Ue.createElement(Hp,{id:o,shouldWrap:d==="large-modal"},Ue.createElement(Ki,{key:de.id,type:d,className:a("formContent",e)},t.map($=>{let W=v[$.type];return de.id!==$.id?null:typeof W!="function"?W:Ue.createElement(W,{key:$.id,stepData:$,canContinue:N,setCanContinue:L,onSaveData:J=>{ue($,J)},appearance:e,customFormElements:S,flowId:p,prefillData:A})}),T&&Ue.createElement(Zi,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),we)),d=="large-modal"&&Ue.createElement(Oe,{selectedStep:t[o]})))};import ho from"react";import{createGlobalStyle as jp}from"styled-components";var Vp=jp`
|
|
686
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${ao}${t}.${ao}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,p])=>`${Eo(s)}: ${p};`).join(" ")} }`:`${Eo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ie({appearance:e}){if(!e||!e.styleOverrides)return ho.createElement(ho.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?ho.createElement(ho.Fragment,null):ho.createElement(Vp,{inlineStyles:t})}var fn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:y=!1,modalPosition:T="center",repeatable:S=!1,onDismiss:g,showPagination:E=!1,allowBackNavigation:P=!1,validationHandler:F,showFrigadeBranding:A=!1,onFormDataChange:I,showFooter:x=!0,prefillData:v={},updateUrlOnPageChange:h=!1})=>{var $;let{getFlow:b,getFlowSteps:N,isLoading:L,targetingLogicShouldHideFlow:O,getFlowStatus:j,getCurrentStepIndex:M,markFlowCompleted:G,markFlowNotStarted:le,markStepStarted:pe}=R(),q=M(e),{mergeAppearanceWithDefault:se}=te(),[de,be]=un(!1),[V,Y]=un(""),{setOpenFlowState:ee,getOpenFlowState:Ve,hasOpenModals:Le}=Be(),X=N(e);d=se(d);let[ue,Oe]=i!==void 0&&n!==void 0?[i,n]:[Ve(e,!0),W=>ee(e,W)];if(mn(()=>{!de&&!L&&(be(!0),(j(e)===Z&&S||j(e)===Me)&&(j(e)===Z&&S&&le(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(J=>{J.startsWith(Tr)&&window.localStorage.removeItem(J)})),be(!0))},[de,be,L]),mn(()=>{var J;let W=(J=window==null?void 0:window.location)!=null&&J.hash?window.location.hash.replace("#",""):"";if(W!=V&&X&&(X==null?void 0:X.length)>0){let fe=-1;if(W){let $e=W;fe=X.findIndex(Ge=>Ge.id===$e),V===W&&(fe=-1),Y(W)}else fe=0,Y("");fe!==-1&&pe(e,X[fe].id)}},[X,($=window==null?void 0:window.location)==null?void 0:$.hash]),L)return null;let we=b(e);if(!we||O(we)||!X||i!==void 0&&i===!1||j(e)===Z&&l||(o=="modal"||o=="corner-modal")&&Le(e))return null;let U=()=>{Oe(!1),g&&g(),y===!0&&G(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let W={padding:"24px"};return o==="large-modal"?(W.width="85%",W.height="90%",W.maxHeight="800px",W.minHeight="500px",W.padding="0"):W.width="400px",et.createElement(Qe,{appearance:d,onClose:U,visible:ue,style:W,dismissible:f,showFrigadeBranding:A},et.createElement(ie,{appearance:d}),et.createElement(jo,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h}))}return o==="modal"&&T!=="center"?et.createElement(Lo,{appearance:d,onClose:U,visible:ue,modalPosition:T},et.createElement(ie,{appearance:d}),et.createElement(jo,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h})):et.createElement(et.Fragment,null,et.createElement(ie,{appearance:d}),et.createElement(jo,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h}))},gn=fn;import{useCallback as Br,useContext as Gp,useEffect as Kp}from"react";function Er(){let{organizationId:e,userId:t,setOrganizationId:o}=Gp(Q),{mutateUserFlowState:i}=De(),{config:n,apiUrl:r}=Je(),s=Dt(),{verifySDKInitiated:p}=Ut();function d(f,y){return`frigade-user-group-registered-${f}-${y}`}Kp(()=>{if(t&&e){if(t.startsWith(Wt))return;let f=d(t,e);localStorage.getItem(f)||(s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let l=Br(f=>D(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:f};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Br((f,y)=>D(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 S={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:y}]};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),c=Br((f,y)=>D(this,null,function*(){if(p())if(y){let T=d(t,f);localStorage.setItem(T,"true"),o(f);let S={foreignUserId:t,foreignUserGroupId:f,properties:y};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var hn="frigade-xFrigade_guestUserId",Co="frigade-xFrigade_userId",xn=({})=>{let{setFlowResponses:e}=so(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=lo(),[s,p]=xo(n),{getFlowStatus:d}=R(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=qp(Q),[y,T]=xo([]),[S,g]=xo([]),{organizationId:E}=Er(),[P,F]=xo(E),[A,I]=xo(!1);Kt(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let N=t[b],L=l.find(O=>O.slug===(N==null?void 0:N.flowId));if(L&&N&&N.shouldTrigger===!0&&L.type=="FORM"&&L.triggerType==="AUTOMATIC"&&!S.includes(L.slug)){setTimeout(()=>{x(N.flowId)},500);break}}},[o,t]),Kt(()=>{f.length>0&&i()},[f]),Kt(()=>{A||(I(!0),i())},[o,I]);function x(b){let N=l.find(L=>L.slug===b);N&&N.triggerType==="AUTOMATIC"&&!S.includes(N.slug)&&(g([...S,N.slug]),T([N]))}function v(){if(!n){let b=localStorage.getItem(Co);if(b){r(b);return}let N=localStorage.getItem(hn);if(N){r(N);return}c(!0);let L=Wt+Yp();try{localStorage.setItem(hn,L)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||L)}}Kt(()=>{try{if(l){let b=[];l.forEach(N=>{if(N.data){let L=N.data.match(/"imageUri":"(.*?)"/g);L&&L.forEach(O=>{let j=O.replace('"imageUri":"',"").replace('"',"");if(b.includes(j))return;let M=new Image;M.src=j,b.push(j)})}})}}catch(b){}},[l]),Kt(()=>{if(n!==s&&(e([]),i()),p(n),n&&!n.startsWith(Wt))try{localStorage.setItem(Co,n)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}n===null&&setTimeout(()=>{n===null&&v()},50)},[n,l,m]),Kt(()=>{E!=P&&(F(E),e([]),i())},[E,P,F]);function h(){return kt.createElement(kt.Fragment,null,y.map(b=>d(b.slug)!==Me?null:kt.createElement("span",{key:b.slug},kt.createElement(gn,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return kt.createElement(kt.Fragment,null,kt.createElement(h,null))};import{ErrorBoundary as Sd}from"react-error-boundary";var Cn={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 Xp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Cn[o]){let n=Cn[o].split("."),r=t;n.forEach((s,p)=>{r[s]||(r[s]=p===n.length-1?i:{}),r=r[s]})}}),t}function Jp(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 yn(e){let{theme:t,styleOverrides:o}=e,i=Xp(t),n=Jp(o);return{overrides:i,css:n}}import dd from"styled-components";import{compose as cd,variant as bn}from"styled-system";import Sn from"react";import Qp,{ThemeProvider as Zp,useTheme as Rp}from"styled-components";import{border as ed,color as td,compose as od,get as rd,shadow as id,space as nd,system as sd,typography as ld}from"styled-system";var ad={width:{property:"width",scale:"sizes",transform:(e,t)=>rd(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},pd=Qp("div")(({css:e})=>e,od(ed,td,id,nd,ld,sd(ad))),yo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ie(r,["as","children","overrides"]);let s=Rp(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Sn.createElement(pd,w(w({as:e},p),i),t);if(o!==void 0){let l=Ce(s,o);return Sn.createElement(Zp,{theme:l},d())}return d()};var So={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"}},md={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},wn=dd(yo)(()=>({whiteSpace:"nowrap"}),cd(bn({scale:"components.Button",variants:"components.Button"}),bn({prop:"size",variants:md})));import ud from"styled-components";import{variant as fd,system as gd}from"styled-system";var Vo={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 Tn=ud(yo)(fd({scale:"components.Text",variants:"components.Text"}),gd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Fn=4,kn="px",hd=20,xd=Object.fromEntries(Array.from(Array(hd+1),(e,t)=>t===0?[.5,`${.5*Fn}${kn}`]:[t,`${t*Fn}${kn}`])),qt={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"},Ar={colors:_(w({},qt),{neutral:{foreground:qt.gray300},primary:{background:qt.blue500,foreground:qt.white,inverted:qt.blue500},negative:{foreground:qt.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:xd,components:{Button:So,Text:Vo}};var Pn="https://api.frigade.com",Q=Cd({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:it,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Pn,readonly:!1,debug:!1});function bd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var wd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var q,se,de,be,V;let[r,s]=je(t||null),[p,d]=je(o||null),[l,m]=je([]),[c,f]=je([]),[y,T]=je([]),[S,g]=je({}),[E,P]=je({}),[F,A]=je([]),[I,x]=je({}),[v,h]=je(!1),[b,N]=je(!1),[L,O]=je(!G(e)),j=(Y,ee)=>{if(ee==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},M={theme:w(w({},it.theme),(se=(q=i==null?void 0:i.defaultAppearance)==null?void 0:q.theme)!=null?se:{}),styleOverrides:w(w({},it.styleOverrides),(be=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?be:{})};function G(Y){return!!(Y&&Y.length>10&&Y.substring(0,10)==="api_public")}Go(()=>{t&&s(t)},[t]),Go(()=>{r&&window&&window.localStorage&&window.localStorage.getItem(Co)&&window.localStorage.getItem(Co)!==r&&bd()},[r]),Go(()=>{o&&d(o)},[o]),Go(()=>{if(G(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let le={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:y,setFlowResponses:T,userProperties:S,setUserProperties:g,openFlowStates:E,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:F,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:I,setCustomVariables:x,isNewGuestUser:v,setIsNewGuestUser:h,hasActiveFullPageFlow:b,setHasActiveFullPageFlow:N,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:j,defaultAppearance:M,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:Pn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(L)return Pt.createElement(Q.Provider,{value:le},n);let{overrides:pe}=yn(M);return Pt.createElement(Sd,{fallback:Pt.createElement(Pt.Fragment,null,n)},Pt.createElement(Q.Provider,{value:le},Pt.createElement(yd,{theme:Ce(M.theme,Ar,pe!=null?pe:{},(V=i==null?void 0:i.theme)!=null?V:{})},n,Pt.createElement(xn,null))))};import dc from"react";import ye,{useEffect as ol,useState as rl}from"react";import Ye,{useState as zd}from"react";import Et from"styled-components";import Yo from"react";import vt from"react";import Bn from"styled-components";var vn=Bn.span`
|
|
682
687
|
font-weight: 600;
|
|
683
688
|
font-size: 14px;
|
|
684
689
|
font-style: normal;
|
|
@@ -690,7 +695,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
690
695
|
margin-left: 32px;
|
|
691
696
|
padding-right: 12px;
|
|
692
697
|
${e=>ke(e)}
|
|
693
|
-
`,
|
|
698
|
+
`,Td=Bn.div`
|
|
694
699
|
flex-direction: row;
|
|
695
700
|
justify-content: space-between;
|
|
696
701
|
display: flex;
|
|
@@ -699,11 +704,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
699
704
|
padding-right: 8px;
|
|
700
705
|
width: 100%;
|
|
701
706
|
${e=>ke(e)}
|
|
702
|
-
`,Ko=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:
|
|
707
|
+
`,Ko=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:p})=>vt.createElement(vt.Fragment,null,vt.createElement(Td,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:w({},n)},i==="left"&&e&&vt.createElement(vn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),vt.createElement(nt,{appearance:p,value:t,type:s,primaryColor:r}),i==="right"&&e&&vt.createElement(vn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),vt.createElement(ie,{appearance:p}));import bo from"styled-components";var En=bo.div`
|
|
703
708
|
font-weight: 700;
|
|
704
709
|
font-size: 18px;
|
|
705
710
|
line-height: 22px;
|
|
706
|
-
`,An=
|
|
711
|
+
`,An=bo.p`
|
|
707
712
|
font-weight: 600;
|
|
708
713
|
font-size: 16px;
|
|
709
714
|
line-height: 24px;
|
|
@@ -711,7 +716,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
711
716
|
letter-spacing: 0.32px;
|
|
712
717
|
font-style: normal;
|
|
713
718
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
714
|
-
`,On=
|
|
719
|
+
`,On=bo.p`
|
|
715
720
|
font-weight: 400;
|
|
716
721
|
font-size: 14px;
|
|
717
722
|
font-style: normal;
|
|
@@ -720,23 +725,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
720
725
|
letter-spacing: 0.28px;
|
|
721
726
|
margin: 8px 0px 0px 0px;
|
|
722
727
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
723
|
-
`,qo=
|
|
728
|
+
`,qo=bo.div`
|
|
724
729
|
width: 6px;
|
|
725
730
|
position: absolute;
|
|
726
731
|
left: 0;
|
|
727
732
|
height: 100%;
|
|
728
733
|
border-top-right-radius: 4px;
|
|
729
734
|
border-bottom-right-radius: 4px;
|
|
730
|
-
`,In=
|
|
735
|
+
`,In=bo.div`
|
|
731
736
|
flex-direction: row;
|
|
732
737
|
justify-content: flex-start;
|
|
733
738
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
734
739
|
padding-right: 16px;
|
|
735
|
-
`;var Nn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:
|
|
740
|
+
`;var Nn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var p,d,l,m,c;return Yo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&Yo.createElement(qo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),Yo.createElement(In,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Yo.createElement(Ko,{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 Bt from"react";import Or from"styled-components";import Xo from"styled-components";var rC=Xo.h1`
|
|
736
741
|
display: flex;
|
|
737
742
|
margin: 0;
|
|
738
743
|
font-size: 18px;
|
|
739
|
-
`,
|
|
744
|
+
`,iC=Xo.h2`
|
|
740
745
|
font-size: 15px;
|
|
741
746
|
color: #4d4d4d;
|
|
742
747
|
`,Ln=Xo.div`
|
|
@@ -758,7 +763,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
758
763
|
border-radius: 20px;
|
|
759
764
|
background-color: ${e=>e.theme.colorPrimary};
|
|
760
765
|
opacity: 0.12;
|
|
761
|
-
`;var
|
|
766
|
+
`;var Fd=Or.div`
|
|
762
767
|
display: flex;
|
|
763
768
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
764
769
|
justify-content: flex-start;
|
|
@@ -766,24 +771,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
766
771
|
width: 100%;
|
|
767
772
|
|
|
768
773
|
${e=>ke(e)}
|
|
769
|
-
`,
|
|
774
|
+
`,kd=Or.div`
|
|
770
775
|
flex-grow: 1;
|
|
771
776
|
position: relative;
|
|
772
777
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
773
|
-
`,
|
|
778
|
+
`,Pd=Or.span`
|
|
774
779
|
font-weight: 600;
|
|
775
780
|
font-size: 14px;
|
|
776
781
|
line-height: 18px;
|
|
777
782
|
padding-right: ${e=>e.padding};
|
|
778
783
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
779
784
|
${e=>ke(e)}
|
|
780
|
-
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:
|
|
785
|
+
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var f;if(t===0)return Bt.createElement(Bt.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(f=s==null?void 0:s.theme)==null?void 0:f.colorText});let p=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"),Bt.createElement(Fd,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:n},Bt.createElement(Pd,{className:a("progressBarStepText",s),styleOverrides:_(w({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:m,textLocation:i},c),Bt.createElement(kd,{textLocation:i,className:a("progressBar",s)},Bt.createElement(Ln,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:s,className:a("progressBarFill",s)}),Bt.createElement($n,{className:a("progressBarBackground",s),barHeight:d,appearance:s})))};import wo from"react";import Bd from"styled-components";import Qo from"react";import Jo from"react";var Yt=({stepData:e,appearance:t})=>Jo.createElement(Jo.Fragment,null,Jo.createElement(An,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ce(e.title)}),Jo.createElement(On,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ce(e.subtitle)}));import Ir from"react";var Xt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Ir.createElement(zo,{className:a("ctaContainer",t)},Ir.createElement(oe,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Ir.createElement(oe,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var Jt=({stepData:e,appearance:t})=>Qo.createElement(Qo.Fragment,null,Qo.createElement(Yt,{stepData:e,appearance:t}),Qo.createElement(Xt,{stepData:e,appearance:t}));import vd from"react";function Mn(e){return vd.createElement(Re,{appearance:e.appearance,videoUri:e.videoUri})}var Nr="default",Ed=Bd.img`
|
|
781
786
|
border-radius: 4px;
|
|
782
787
|
max-height: 260px;
|
|
783
788
|
min-height: 200px;
|
|
784
|
-
`,Dn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return
|
|
789
|
+
`,Dn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return wo.createElement("div",null,o)}return wo.createElement(En,{className:a("checklistStepContent",t)},e.imageUri?wo.createElement(Ed,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?wo.createElement(Mn,{videoUri:e.videoUri,appearance:t}):null,wo.createElement(Jt,{stepData:e,appearance:t}))};import ze,{useRef as Ad,useState as Od}from"react";import Qt from"styled-components";var Un=Qt.div`
|
|
785
790
|
display: block;
|
|
786
|
-
`,
|
|
791
|
+
`,Id=Qt.div`
|
|
787
792
|
display: flex;
|
|
788
793
|
flex-direction: row;
|
|
789
794
|
flex-wrap: wrap;
|
|
@@ -793,20 +798,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
793
798
|
align-content: center;
|
|
794
799
|
margin-top: 24px;
|
|
795
800
|
margin-bottom: 24px;
|
|
796
|
-
`,
|
|
801
|
+
`,Nd=Qt.div`
|
|
797
802
|
display: flex;
|
|
798
803
|
align-items: center;
|
|
799
804
|
justify-content: flex-start;
|
|
800
805
|
flex-direction: column;
|
|
801
806
|
margin-right: 16px;
|
|
802
|
-
`,
|
|
807
|
+
`,Ld=Qt.video`
|
|
803
808
|
width: 200px;
|
|
804
809
|
height: 120px;
|
|
805
|
-
|
|
810
|
+
`,$d=Qt.div`
|
|
806
811
|
font-size: 14px;
|
|
807
812
|
line-height: 20px;
|
|
808
813
|
text-align: center;
|
|
809
|
-
|
|
814
|
+
`,Md=Qt.div`
|
|
810
815
|
position: absolute;
|
|
811
816
|
width: 200px;
|
|
812
817
|
height: 120px;
|
|
@@ -826,9 +831,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
826
831
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
827
832
|
border-radius: 50%;
|
|
828
833
|
}
|
|
829
|
-
`,Wn="videoCarousel",zn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return ze.createElement(Un,null,ze.createElement(
|
|
834
|
+
`,Wn="videoCarousel",zn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return ze.createElement(Un,null,ze.createElement(Jt,{stepData:e,appearance:t}));function o({video:r}){let s=Ad(),[p,d]=Od(!1);return ze.createElement(Nd,null,!p&&ze.createElement(Md,{onClick:()=>{d(!0),s.current.play()},appearance:t},ze.createElement(_o,null)),ze.createElement(Ld,{controls:p,ref:s,play:p,src:r.uri}),ze.createElement($d,null,r.title))}let i=e.props;return i.videos?ze.createElement(Un,null,ze.createElement(Yt,{stepData:e,appearance:t}),ze.createElement(Id,null,i.videos.map((r,s)=>ze.createElement("span",{key:`${r.uri}-${s}`},ze.createElement(o,{video:r})))),ze.createElement(Xt,{stepData:e,appearance:t})):null};import lt from"react";import Zo from"styled-components";var _n=Zo.div`
|
|
830
835
|
display: block;
|
|
831
|
-
`,
|
|
836
|
+
`,Dd=Zo.pre`
|
|
832
837
|
display: block;
|
|
833
838
|
background-color: #2a2a2a;
|
|
834
839
|
color: #f8f8f8;
|
|
@@ -844,14 +849,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
844
849
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
845
850
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
846
851
|
margin-bottom: 24px;
|
|
847
|
-
`,
|
|
852
|
+
`,Ud=Zo.div`
|
|
848
853
|
font-size: 15px;
|
|
849
854
|
line-height: 20px;
|
|
850
855
|
margin-bottom: 12px;
|
|
851
856
|
margin-top: 12px;
|
|
852
|
-
`,
|
|
857
|
+
`,Wd=Zo.div`
|
|
853
858
|
margin-top: 24px;
|
|
854
|
-
`,Hn="codeSnippet",jn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return lt.createElement(_n,null,lt.createElement(
|
|
859
|
+
`,Hn="codeSnippet",jn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return lt.createElement(_n,null,lt.createElement(Jt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?lt.createElement(_n,null,lt.createElement(Yt,{stepData:e,appearance:t}),lt.createElement(Wd,null,o.codeSnippets.map((n,r)=>lt.createElement("div",{key:r},n.title?lt.createElement(Ud,null,n.title):null,n.code?lt.createElement(Dd,null,n.code):null))),lt.createElement(Xt,{stepData:e,appearance:t})):null};var _d=Et.div`
|
|
855
860
|
display: flex;
|
|
856
861
|
flex-direction: row;
|
|
857
862
|
overflow: hidden;
|
|
@@ -859,14 +864,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
859
864
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
860
865
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
861
866
|
${e=>ke(e)}
|
|
862
|
-
`,
|
|
867
|
+
`,Hd=Et.h1`
|
|
863
868
|
font-size: 18px;
|
|
864
869
|
font-style: normal;
|
|
865
870
|
font-weight: 700;
|
|
866
871
|
line-height: 24px;
|
|
867
872
|
letter-spacing: 0.36px;
|
|
868
873
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
869
|
-
`,
|
|
874
|
+
`,jd=Et.h2`
|
|
870
875
|
font-size: 14px;
|
|
871
876
|
font-style: normal;
|
|
872
877
|
font-weight: 400;
|
|
@@ -874,22 +879,22 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
874
879
|
letter-spacing: 0.28px;
|
|
875
880
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
876
881
|
margin: 10px 0px 0px 0px;
|
|
877
|
-
`,Vn=Et.div``,
|
|
882
|
+
`,Vn=Et.div``,Vd=Et.div`
|
|
878
883
|
list-style: none;
|
|
879
884
|
padding: 0;
|
|
880
885
|
margin: 0;
|
|
881
886
|
cursor: pointer;
|
|
882
887
|
width: 300px;
|
|
883
|
-
`,
|
|
888
|
+
`,Gd=Et.div`
|
|
884
889
|
width: 1px;
|
|
885
890
|
margin-right: 40px;
|
|
886
891
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
887
|
-
`,
|
|
892
|
+
`,Kd=Et.div`
|
|
888
893
|
flex: 2;
|
|
889
894
|
padding: 2rem 2rem 2rem 0rem;
|
|
890
|
-
`,
|
|
895
|
+
`,qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=te();d=m(d);let c={[Nr]:Dn,[Wn]:zn,[Hn]:jn},f=w(w({},c),p),[y,T]=zd(0),S=n!=null?n:y,g=r!=null?r:T,E=o.filter(F=>F.complete===!0).length,P=()=>{var F;return!((F=o[S])!=null&&F.type)||!f[o[S].type]?f[Nr]({stepData:o[S],appearance:d}):f[o[S].type]({stepData:o[S],appearance:d})};return Ye.createElement(_d,{type:l,styleOverrides:i,className:s,appearance:d},Ye.createElement(Vn,{style:{flex:1}},Ye.createElement(Vn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Ye.createElement(Hd,{className:a("checklistTitle",d),appearance:d},e),Ye.createElement(jd,{className:a("checklistSubtitle",d),appearance:d},t),Ye.createElement(We,{total:o.length,count:E,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Ye.createElement(Vd,{className:a("checklistStepsContainer",d)},o.map((F,A)=>Ye.createElement(Nn,{data:F,index:A,key:A,listLength:o.length,isSelected:A===S,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{g(A)},appearance:d})))),Ye.createElement(Gd,{appearance:d,className:a("checklistDivider",d)}),Ye.createElement(Kd,null,Ye.createElement(P,null)))},Lr=qd;import H,{useState as Zd}from"react";import Gn from"react";import Yd from"styled-components";var Xd=Yd.svg`
|
|
891
896
|
transition: 'transform 0.35s ease-in-out';
|
|
892
|
-
`,
|
|
897
|
+
`,Zt=({style:e,className:t})=>Gn.createElement(Xd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Gn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import Se from"styled-components";var $r={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Kn=Se.div`
|
|
893
898
|
max-height: 350px;
|
|
894
899
|
padding-bottom: 40px;
|
|
895
900
|
`,qn=Se.div`
|
|
@@ -911,7 +916,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
911
916
|
padding-left: 1px;
|
|
912
917
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
913
918
|
`,Jn=Se.div`
|
|
914
|
-
${e=>
|
|
919
|
+
${e=>B(e)} {
|
|
915
920
|
border: 1px solid #fafafa;
|
|
916
921
|
}
|
|
917
922
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -925,7 +930,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
925
930
|
flex-direction: row;
|
|
926
931
|
justify-content: space-between;
|
|
927
932
|
`,Zn=Se.p`
|
|
928
|
-
${e=>
|
|
933
|
+
${e=>B(e)} {
|
|
929
934
|
font-weight: 400;
|
|
930
935
|
font-size: 10px;
|
|
931
936
|
line-height: 12px;
|
|
@@ -939,7 +944,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
939
944
|
`,es=Se.div`
|
|
940
945
|
flex: 1;
|
|
941
946
|
`,ts=Se.div`
|
|
942
|
-
${e=>
|
|
947
|
+
${e=>B(e)} {
|
|
943
948
|
display: flex;
|
|
944
949
|
justify-content: center;
|
|
945
950
|
align-content: center;
|
|
@@ -949,7 +954,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
949
954
|
padding-right: 8px;
|
|
950
955
|
}
|
|
951
956
|
`,os=Se.p`
|
|
952
|
-
${e=>
|
|
957
|
+
${e=>B(e)} {
|
|
953
958
|
font-style: normal;
|
|
954
959
|
font-weight: 600;
|
|
955
960
|
font-size: 22px;
|
|
@@ -961,7 +966,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
961
966
|
margin-bottom: 16px;
|
|
962
967
|
}
|
|
963
968
|
`,rs=Se.p`
|
|
964
|
-
${e=>
|
|
969
|
+
${e=>B(e)} {
|
|
965
970
|
font-weight: 400;
|
|
966
971
|
font-size: 14px;
|
|
967
972
|
line-height: 18px;
|
|
@@ -970,14 +975,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
970
975
|
margin-bottom: 8px;
|
|
971
976
|
}
|
|
972
977
|
`,is=Se.div`
|
|
973
|
-
${e=>
|
|
978
|
+
${e=>B(e)} {
|
|
974
979
|
display: flex;
|
|
975
980
|
flex-direction: row;
|
|
976
981
|
justify-content: center;
|
|
977
982
|
gap: 8px;
|
|
978
983
|
}
|
|
979
984
|
`,ns=Se.div`
|
|
980
|
-
${e=>
|
|
985
|
+
${e=>B(e)} {
|
|
981
986
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
982
987
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
983
988
|
:hover {
|
|
@@ -997,7 +1002,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
997
1002
|
position: relative;
|
|
998
1003
|
cursor: pointer;
|
|
999
1004
|
`,ss=Se.p`
|
|
1000
|
-
${e=>
|
|
1005
|
+
${e=>B(e)} {
|
|
1001
1006
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1002
1007
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
1003
1008
|
}
|
|
@@ -1021,7 +1026,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1021
1026
|
`,ps=Se.div`
|
|
1022
1027
|
display: block;
|
|
1023
1028
|
width: 100%;
|
|
1024
|
-
`;import
|
|
1029
|
+
`;import Jd from"styled-components";var ds=Jd.div`
|
|
1025
1030
|
flex-direction: column;
|
|
1026
1031
|
justify-content: center;
|
|
1027
1032
|
display: flex;
|
|
@@ -1040,7 +1045,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1040
1045
|
overflow: hidden;
|
|
1041
1046
|
row-gap: 10px;
|
|
1042
1047
|
`,us=at.div`
|
|
1043
|
-
${e=>
|
|
1048
|
+
${e=>B(e)} {
|
|
1044
1049
|
color: #595959;
|
|
1045
1050
|
}
|
|
1046
1051
|
text-transform: uppercase;
|
|
@@ -1050,7 +1055,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1050
1055
|
letter-spacing: 0.09em;
|
|
1051
1056
|
margin-bottom: 12px;
|
|
1052
1057
|
`,fs=at.div`
|
|
1053
|
-
${e=>
|
|
1058
|
+
${e=>B(e)} {
|
|
1054
1059
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1055
1060
|
background: #ffffff;
|
|
1056
1061
|
border: 1px solid #fafafa;
|
|
@@ -1063,7 +1068,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1063
1068
|
max-width: 150px;
|
|
1064
1069
|
min-width: 200px;
|
|
1065
1070
|
`,gs=at.div`
|
|
1066
|
-
${e=>
|
|
1071
|
+
${e=>B(e)} {
|
|
1067
1072
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1068
1073
|
}
|
|
1069
1074
|
width: 40px;
|
|
@@ -1081,7 +1086,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1081
1086
|
width: 20px;
|
|
1082
1087
|
height: 20px;
|
|
1083
1088
|
`,xs=at.div`
|
|
1084
|
-
${e=>
|
|
1089
|
+
${e=>B(e)} {
|
|
1085
1090
|
color: #434343;
|
|
1086
1091
|
}
|
|
1087
1092
|
font-weight: 600;
|
|
@@ -1090,7 +1095,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1090
1095
|
margin-top: 12px;
|
|
1091
1096
|
margin-bottom: 8px;
|
|
1092
1097
|
`,Cs=at.div`
|
|
1093
|
-
${e=>
|
|
1098
|
+
${e=>B(e)} {
|
|
1094
1099
|
color: #8c8c8c;
|
|
1095
1100
|
}
|
|
1096
1101
|
font-weight: 400;
|
|
@@ -1102,7 +1107,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1102
1107
|
line-height: 14px;
|
|
1103
1108
|
font-weight: 400;
|
|
1104
1109
|
cursor: pointer;
|
|
1105
|
-
`;var
|
|
1110
|
+
`;var Qd=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=ae();return pt.createElement(cs,{style:t,className:a("guideContainer",n)},pt.createElement(us,{className:a("guideTitle",n)},o),pt.createElement(ms,{className:a("guideItemContainer",n)},e.map((p,d)=>{var l;return pt.createElement(fs,{key:`guide-${(l=p.id)!=null?l:d}`,className:a("guideItem",n)},p.icon&&pt.createElement(gs,{className:a("guideIcon",n)},pt.createElement(hs,null,p.icon)),pt.createElement(xs,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:ce(p.title)}),pt.createElement(Cs,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:ce(p.subtitle)}),pt.createElement(ys,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle))})))},To=Qd;var Rd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:m,guideTitle:c,onGuideButtonClick:f})=>{let y=({stepData:x,handleSecondaryCTAClick:v,handleCTAClick:h})=>x?H.createElement(ts,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},H.createElement(os,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:ce(x.title)}),H.createElement(rs,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:ce(x.subtitle)}),H.createElement(is,{className:a("checklistCTAContainer",l)},x.secondaryButtonTitle&&H.createElement(oe,{title:x.secondaryButtonTitle,onClick:v,appearance:l,secondary:!0}),H.createElement(oe,{title:x.primaryButtonTitle,onClick:h,appearance:l}))):H.createElement(H.Fragment,null),S=w(w({},{default:x=>{var N;if((N=e[P])!=null&&N.StepContent){let L=e[P].StepContent;return H.createElement("div",null,L)}let v=e[P];return H.createElement(y,{stepData:x,handleCTAClick:()=>{v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick()}})}}),d),[g,E]=Zd(0),P=s!=null?s:g,F=p!=null?p:E,A=()=>{var x;return e?!((x=e[P])!=null&&x.type)||!S[e[P].type]?S.default(e[P]):S[e[P].type]({stepData:e[P],primaryColor:l.theme.colorPrimary}):H.createElement(H.Fragment,null)},I=e.filter(x=>x.complete).length;return n?(l.theme.modalContainer||(l.theme.borderRadius&&($r.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=$r),H.createElement(Qe,{onClose:r,visible:n,appearance:l},H.createElement(ps,null,H.createElement(qn,null,H.createElement(Yn,{appearance:l,className:a("checklistTitle",l)},t),H.createElement(Xn,{appearance:l,className:a("checklistSubtitle",l)},o)),H.createElement(Kn,null,e&&e.length>0&&H.createElement(Jn,{className:a("stepsContainer",l)},H.createElement(Qn,null,H.createElement("div",{style:{flex:3}},H.createElement(Zn,{className:a("stepsTitle",l)},i)),H.createElement(as,null,H.createElement(We,{style:{width:"100%"},count:I,total:e.length,appearance:l}))),H.createElement(Rn,null,H.createElement(es,{className:a("checklistStepListContainer",l),appearance:l},e.map((x,v)=>{var b;let h=P===v;return H.createElement(ns,{selected:h,className:a(`checklistStepListItem${h?"Selected":""}`,l),key:`checklist-guide-step-${(b=x.id)!=null?b:v}`,disabled:x.blocked,onClick:()=>{x.blocked||F(v)},title:x.blocked?"Finish remaining steps to continue":void 0},h&&H.createElement(qo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),H.createElement(ss,{selected:h,className:a(`checklistStepListStepName${h?"Selected":""}`,l)},x.stepName),H.createElement(ls,null,H.createElement(nt,{value:x.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:x.progress,appearance:l}),H.createElement(ds,null,H.createElement(Zt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),H.createElement(A,null))),m&&m.length>0&&H.createElement(To,{steps:m,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:x=>(f&&f(x),!0)}))))):H.createElement(H.Fragment,null)},Mr=Rd;import Ne,{useEffect as Ls,useState as $s}from"react";import Fe from"react";import dt from"styled-components";var Ss=dt.div`
|
|
1106
1111
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1107
1112
|
border: 1px solid;
|
|
1108
1113
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1143,7 +1148,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1143
1148
|
:hover {
|
|
1144
1149
|
opacity: 0.8;
|
|
1145
1150
|
}
|
|
1146
|
-
`,
|
|
1151
|
+
`,ey=dt.div``,Ps=dt.p`
|
|
1147
1152
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1148
1153
|
font-weight: 400;
|
|
1149
1154
|
font-size: 14px;
|
|
@@ -1153,7 +1158,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1153
1158
|
flex-direction: row;
|
|
1154
1159
|
justify-content: flex-start;
|
|
1155
1160
|
align-items: center;
|
|
1156
|
-
`;var Bs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:
|
|
1161
|
+
`;var Bs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,f;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function l(){var y;return Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(bs,{className:a("stepMediaContainer",r)},e.imageUri?Fe.createElement(ws,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Fe.createElement(Re,{appearance:r,videoUri:e.videoUri}):null):null,Fe.createElement(Ps,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ce(e.subtitle)}),Fe.createElement(zo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?Fe.createElement(oe,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Fe.createElement(oe,{title:(y=e.primaryButtonTitle)!=null?y:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!s)return null;let y=s[e.type];return y?y(e,r):null}return Fe.createElement(Ss,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},Fe.createElement(Ts,{className:a("stepHeader",r)},Fe.createElement(vs,null,Fe.createElement(Ko,{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(Fs,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:ce(e.title),onClick:()=>o()})),Fe.createElement(ks,{className:a("stepChevronContainer",r),onClick:()=>o(),appearance:r},Fe.createElement(Zt,{style:_(w({},p),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:w({},d)},(f=m())!=null?f:l()))};import Rt from"styled-components";var fy=Rt.div`
|
|
1157
1162
|
background: #ffffff;
|
|
1158
1163
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1159
1164
|
border-radius: 6px;
|
|
@@ -1167,26 +1172,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1167
1172
|
|
|
1168
1173
|
max-width: 800px;
|
|
1169
1174
|
min-width: 350px;
|
|
1170
|
-
`,Es=
|
|
1175
|
+
`,Es=Rt.div`
|
|
1171
1176
|
display: flex;
|
|
1172
1177
|
flex-direction: column;
|
|
1173
|
-
`,As=
|
|
1178
|
+
`,As=Rt.h1`
|
|
1174
1179
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1175
1180
|
font-style: normal;
|
|
1176
1181
|
font-weight: 700;
|
|
1177
1182
|
font-size: 20px;
|
|
1178
1183
|
line-height: 24px;
|
|
1179
1184
|
margin-bottom: 8px;
|
|
1180
|
-
`,Os=
|
|
1185
|
+
`,Os=Rt.h2`
|
|
1181
1186
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1182
1187
|
font-weight: 400;
|
|
1183
1188
|
font-size: 14px;
|
|
1184
1189
|
line-height: 23px;
|
|
1185
1190
|
margin: 2px 0 0 0;
|
|
1186
|
-
`,Is=
|
|
1191
|
+
`,Is=Rt.div`
|
|
1187
1192
|
display: block;
|
|
1188
1193
|
width: 100%;
|
|
1189
|
-
`,Ns=
|
|
1194
|
+
`,Ns=Rt.div`
|
|
1190
1195
|
display: flex;
|
|
1191
1196
|
width: 100%;
|
|
1192
1197
|
flex-direction: column;
|
|
@@ -1194,17 +1199,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1194
1199
|
padding: 24px;
|
|
1195
1200
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1196
1201
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1197
|
-
`;var
|
|
1202
|
+
`;var ec=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:f,customStepTypes:y,style:T})=>{let S=o.filter(v=>v.complete).length,[g,E]=$s(Array(o.length).fill(!0)),[P,F]=$s(!1);Ls(()=>{let v=[...g];if(r){for(let h=0;h<o.length;h++)if(!o[h].complete){v[h]=!1;break}E(v)}},[]),Ls(()=>{if(!P&&!r){F(!0);return}A(d)},[d]);let A=v=>{let h=[...g];if(s)for(let b=0;b<g.length;++b)b!==v&&(h[b]=!0);h[v]=!h[v],E(h)};if(!n&&c=="modal")return Ne.createElement(Ne.Fragment,null);let I=Ne.createElement(Ne.Fragment,null,Ne.createElement(Es,null,Ne.createElement(As,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:ce(e)}),Ne.createElement(Os,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:ce(t)})),Ne.createElement(We,{display:"percent",count:S,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),x=Ne.createElement(Is,{className:Te(a("checklistContainer",m),f)},o.map((v,h)=>{var N;let b=g[h];return Ne.createElement(Bs,{appearance:m,stepData:v,collapsed:b,key:`modal-checklist-${(N=v.id)!=null?N:h}`,onClick:()=>{if(d===h){A(h);return}l(h)},onPrimaryButtonClick:()=>{v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick(),p&&!v.completionCriteria&&h<g.length-1&&g[h+1]&&l(h+1)},onSecondaryButtonClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick()},customStepTypes:y})}));return c==="inline"?Ne.createElement(Ns,{appearance:m,className:Te(a("checklistInlineContainer",m),f),style:T},I,x):Ne.createElement(Ne.Fragment,null,Ne.createElement(Qe,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:I},x))},Dr=ec;import me,{useEffect as Ur,useRef as ac,useState as At}from"react";import{useEffect as tc,useState as oc}from"react";var Ms=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=oc(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let p=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(p)};return tc(()=>{s()},[]),o};import eo from"react";import ge,{css as Ds,keyframes as Us}from"styled-components";var Ws=Ds`
|
|
1198
1203
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1199
|
-
`,
|
|
1204
|
+
`,rc=Ds`
|
|
1200
1205
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1201
|
-
`,
|
|
1206
|
+
`,ic=Us`
|
|
1202
1207
|
from {
|
|
1203
1208
|
opacity: 0;
|
|
1204
1209
|
} to {
|
|
1205
1210
|
opacity: 1;
|
|
1206
1211
|
}
|
|
1207
|
-
`,
|
|
1212
|
+
`,nc=Us`
|
|
1208
1213
|
from {
|
|
1209
1214
|
opacity: 1;
|
|
1210
1215
|
} to {
|
|
@@ -1234,7 +1239,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1234
1239
|
scroll-snap-align: center;
|
|
1235
1240
|
scroll-snap-stop: always;
|
|
1236
1241
|
`,Hs=ge.div`
|
|
1237
|
-
animation: ${e=>e.reversed?ic
|
|
1242
|
+
animation: ${e=>e.reversed?nc:ic} 0.25s ease-out;
|
|
1238
1243
|
background: linear-gradient(
|
|
1239
1244
|
to right,
|
|
1240
1245
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1277,17 +1282,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1277
1282
|
margin-bottom: 12px;
|
|
1278
1283
|
width: 40px;
|
|
1279
1284
|
`,qs=ge(Vs)`
|
|
1280
|
-
${e=>
|
|
1281
|
-
${
|
|
1285
|
+
${e=>B(e)} {
|
|
1286
|
+
${rc}
|
|
1282
1287
|
|
|
1283
1288
|
background: ${({theme:e})=>e.colorBackground};
|
|
1284
1289
|
}
|
|
1285
|
-
`,
|
|
1290
|
+
`,Oy=ge.div`
|
|
1286
1291
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1287
1292
|
display: flex;
|
|
1288
1293
|
flex-flow: row nowrap;
|
|
1289
1294
|
align-items: center;
|
|
1290
|
-
`,
|
|
1295
|
+
`,Iy=ge.div`
|
|
1291
1296
|
white-space: nowrap;
|
|
1292
1297
|
`,Ys=ge.div`
|
|
1293
1298
|
background: #d8fed8;
|
|
@@ -1295,26 +1300,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1295
1300
|
float: right;
|
|
1296
1301
|
margin-bottom: 12px;
|
|
1297
1302
|
padding: 4px 10px;
|
|
1298
|
-
`,
|
|
1303
|
+
`,sc=ge.p`
|
|
1299
1304
|
font-weight: bold;
|
|
1300
1305
|
font-size: 18px;
|
|
1301
1306
|
line-height: 22px;
|
|
1302
1307
|
letter-spacing: calc(18px * -0.01);
|
|
1303
1308
|
margin: 0;
|
|
1304
|
-
`,Xs=ge(
|
|
1309
|
+
`,Xs=ge(sc)`
|
|
1305
1310
|
margin-bottom: 4px;
|
|
1306
1311
|
`,Js=ge.div`
|
|
1307
1312
|
display: flex;
|
|
1308
1313
|
flex-flow: row nowrap;
|
|
1309
1314
|
align-items: center;
|
|
1310
1315
|
min-width: 50%;
|
|
1311
|
-
`,
|
|
1316
|
+
`,lc=ge.p`
|
|
1312
1317
|
font-weight: bold;
|
|
1313
1318
|
font-size: 16px;
|
|
1314
1319
|
line-height: 20px;
|
|
1315
1320
|
letter-spacing: calc(16px * -0.01);
|
|
1316
1321
|
margin: 0;
|
|
1317
|
-
`,Qs=ge(
|
|
1322
|
+
`,Qs=ge(lc)`
|
|
1318
1323
|
margin-bottom: 4px;
|
|
1319
1324
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1320
1325
|
`}
|
|
@@ -1336,7 +1341,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1336
1341
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1337
1342
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1338
1343
|
`}
|
|
1339
|
-
`;var Rs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=te(),{primaryCTAClickSideEffects:n}=ae();o=i(o);let{imageUri:r=null,subtitle:
|
|
1344
|
+
`;var Rs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=te(),{primaryCTAClickSideEffects:n}=ae();o=i(o);let{imageUri:r=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return eo.createElement(Gs,{className:a("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&eo.createElement(Ks,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||l?.4:1}}),d&&eo.createElement(Ys,{className:a("carouselCompletedPill",o)},eo.createElement(Zs,{style:{color:"#108E0B"}},"Complete")),p&&eo.createElement(Qs,{blocked:l,complete:d,className:a("carouselCardTitle",o)},p),s&&eo.createElement(xt.Quiet,{blocked:l,complete:d,className:a("carouselCardSubtitle",o)},s))};var pc=()=>me.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},me.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),me.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),me.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),el=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=At(!1),[r,s]=At(!1);Ur(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?me.createElement(Hs,{style:d,reversed:r,onAnimationEnd:r?p:null},me.createElement(js,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},me.createElement(pc,null))):null},tl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=ac(null),[r,s]=At(!1),[p,d]=At(!1),[l,m]=At(null),[c,f]=At([]),[y,T]=At(0),{isSmall:S}=Ms(),g=S?1:3,{getFlowMetadata:E,getFlowSteps:P,getNumberOfStepsCompleted:F,updateCustomVariables:A,isLoading:I}=R();Ur(()=>{A(o)},[o,I]),Ur(()=>{if(I)return;let L=E(e),O=F(e),j=P(e);m(L),L.data!==null&&(f(j.sort((M,G)=>Number(M.complete)-Number(G.complete))),d(j.length>g),T(O))},[I]);let x=[];for(let L=0;L<c.length;L+=g)x.push(c.slice(L,L+g));let v=L=>{let O=L.target,j=O.scrollWidth-O.clientWidth,M=Math.ceil(O.scrollLeft);M>0&&r===!1&&s(!0),M===0&&r===!0&&s(!1),M<j&&p===!1&&d(!0),M===j&&p===!0&&d(!1)},h=(L=!0)=>{let O=L?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*O,behavior:"smooth"})},b=null,N=L=>{b!==null?clearTimeout(b):v(L),b=setTimeout(()=>{v(L)},16)};return I?null:me.createElement(qs,{className:Te(a("carouselContainer",t),i)},me.createElement("div",{style:{display:"flex",justifyContent:S?"center":"space-between",marginBottom:20,flexWrap:S?"wrap":"nowrap",gap:S?16:20}},me.createElement("div",null,me.createElement(Xs,{className:a("carouselTitle",t)},l==null?void 0:l.title),me.createElement(xt.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),me.createElement(Js,{className:a("progressWrapper",t)},me.createElement(We,{count:y,total:c.length,appearance:t}))),me.createElement("div",{style:{position:"relative"}},me.createElement(el,{show:r,onClick:()=>h(!1)}),me.createElement(el,{side:"right",show:p,onClick:h}),me.createElement(zs,{ref:n,onScroll:N},x.map((L,O)=>me.createElement(_s,{key:O,style:{flex:`0 0 calc(100% - ${c.length>g?36:0}px)`}},L.map((j,M)=>me.createElement(Rs,{key:M,stepData:j,style:{flex:c.length>g?`0 1 calc(100% / ${g} - 16px * 2 / ${g})`:1},appearance:t})))))),me.createElement(ie,{appearance:t}))};var Wr=A=>{var I=A,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:m,onButtonClick:c,appearance:f,hideOnFlowCompletion:y,setVisible:T,customStepTypes:S,checklistStyle:g="default",autoExpandFirstIncompleteStep:E,autoExpandNextStep:P}=I,F=Ie(I,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:x,getFlowSteps:v,markStepCompleted:h,getStepStatus:b,getNumberOfStepsCompleted:N,isLoading:L,targetingLogicShouldHideFlow:O,updateCustomVariables:j,getFlowMetadata:M,isStepBlocked:G,getFlowStatus:le,hasActiveFullPageFlow:pe,setHasActiveFullPageFlow:q}=R(),{primaryCTAClickSideEffects:se,secondaryCTAClickSideEffects:de}=ae(),{getOpenFlowState:be,setOpenFlowState:V}=Be(),[Y,ee]=rl(n||0),[Ve,Le]=rl(!1),X=d===void 0?be(e):d,ue=s==="modal",{mergeAppearanceWithDefault:Oe}=te();if(f=Oe(f),ol(()=>{j(l)},[l,L]),ol(()=>{d!==void 0&&(ue&&d===!0?q(!0):ue&&d===!1&&q(!1))},[d,T,pe]),L)return null;let we=x(e);if(!we||O(we))return null;let U=v(e);if(!U||y===!0&&le(e)===Z)return null;let $=M(e);if($!=null&&$.title&&(t=$.title),$!=null&&$.subtitle&&(o=$.subtitle),!Ve&&n===void 0&&N(e)>0){let u=U.findIndex(k=>k.complete===!1);ee(u>-1?u:U.length-1),Le(!0)}function W(){if(Y+1>=U.length){ue&&V(e,!1);return}G(e,U[Y+1].id)||ee(Y+1)}function J(u,k,z){let he=Y+1<U.length?U[Y+1]:null;c&&c(u,Y,k,he)===!0&&ue&&Xe(),m&&m(u,z,he),!m&&!c&&(u.primaryButtonUri||u.secondaryButtonUri)&&ue&&Xe()}function fe(){return U.map((u,k)=>_(w({},u),{handleSecondaryButtonClick:()=>{W(),de(u),u.skippable===!0&&h(e,u.id,{skipped:!0}),J(u,"secondary",k)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(h(e,u.id),W()),J(u,"primary",k),se(u),b(e,u.id)===Ke&&W()}}))}function $e(){return ye.createElement(ie,{appearance:f})}let Ge={steps:fe(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:S,type:s,className:r,autoExpandFirstIncompleteStep:E,autoExpandNextStep:P};function Xe(){V(e,!1),p&&p(),T&&T(!1)}function St(){return ye.createElement(ye.Fragment,null,ye.createElement($e,null),ye.createElement(tl,{flowId:e,appearance:f,customVariables:l,className:r}))}function Lt(){return ye.createElement(ye.Fragment,null,ye.createElement($e,null),ye.createElement(Dr,w({visible:X,onClose:()=>{Xe()},selectedStep:Y,setSelectedStep:ee,autoExpandNextStep:!0,appearance:f},Ge)))}function $t(){var z;let u=F.guideFlowId,k;return u&&x(u)&&(k=v(u)),ye.createElement(ye.Fragment,null,ye.createElement($e,null),ye.createElement(Mr,w({visible:X,stepsTitle:$.stepsTitle?$.stepsTitle:"Your quick start guide",onClose:()=>{Xe()},selectedStep:Y,setSelectedStep:ee,guideData:k,guideTitle:(z=F.guideTitle)!=null?z:"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:he=>{J(he,"link",0)},customStepTypes:S},Ge)))}function C(){let u=ye.createElement(Lr,w({flowId:e,style:i,selectedStep:Y,setSelectedStep:ee,appearance:f,type:s},Ge));return ue?ye.createElement(Qe,{onClose:()=>{Xe()},visible:X,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ye.createElement($e,null),u):ye.createElement(ye.Fragment,null,ye.createElement($e,null),u)}switch(g){case"condensed":return Lt();case"with-guide":return $t();case"default":return C();case"carousel":return St();default:return C()}};var cc=e=>dc.createElement(Wr,w({type:"inline"},e));import yt,{useEffect as mc}from"react";import tt from"react";import Ro from"styled-components";var il=Ro.div`
|
|
1340
1345
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1341
1346
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1342
1347
|
padding: 10px 12px 10px 12px;
|
|
@@ -1368,7 +1373,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1368
1373
|
display: flex;
|
|
1369
1374
|
height: 100%;
|
|
1370
1375
|
align-items: center;
|
|
1371
|
-
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:
|
|
1376
|
+
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:p="default"})=>tt.createElement(tt.Fragment,null,tt.createElement(ie,{appearance:s}),tt.createElement(il,{onClick:()=>i!==void 0&&i(),styleOverrides:w(w({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Te(r!=null?r:"",a("progressBadgeContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&tt.createElement(ll,{className:a("progressRingContainer",s)},tt.createElement(_t,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),tt.createElement(nl,{type:p,className:a("badgeTitleContainer",s)},tt.createElement(sl,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&tt.createElement(Zt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&tt.createElement(We,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import Ct from"react";import Fo from"styled-components";var pl=Fo.div`
|
|
1372
1377
|
display: flex;
|
|
1373
1378
|
flex-direction: row;
|
|
1374
1379
|
width: 100%;
|
|
@@ -1378,25 +1383,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1378
1383
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1379
1384
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1380
1385
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1381
|
-
`,dl=
|
|
1382
|
-
${e=>
|
|
1386
|
+
`,dl=Fo.div`
|
|
1387
|
+
${e=>B(e)} {
|
|
1383
1388
|
display: flex;
|
|
1384
1389
|
justify-content: center;
|
|
1385
1390
|
align-items: center;
|
|
1386
1391
|
margin-right: 16px;
|
|
1387
1392
|
}
|
|
1388
|
-
`,cl=
|
|
1393
|
+
`,cl=Fo.div`
|
|
1389
1394
|
display: flex;
|
|
1390
1395
|
flex-direction: column;
|
|
1391
1396
|
flex: 1;
|
|
1392
1397
|
margin-top: 0;
|
|
1393
|
-
`,ml=
|
|
1398
|
+
`,ml=Fo.div`
|
|
1394
1399
|
display: flex;
|
|
1395
1400
|
flex-direction: column;
|
|
1396
1401
|
justify-content: center;
|
|
1397
1402
|
margin-left: 16px;
|
|
1398
1403
|
min-width: 200px;
|
|
1399
|
-
`,
|
|
1404
|
+
`,NS=Fo.div`
|
|
1400
1405
|
display: flex;
|
|
1401
1406
|
justify-content: center;
|
|
1402
1407
|
align-items: flex-end;
|
|
@@ -1405,7 +1410,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1405
1410
|
:hover {
|
|
1406
1411
|
opacity: 0.8;
|
|
1407
1412
|
}
|
|
1408
|
-
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:
|
|
1413
|
+
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:p})=>Ct.createElement(Ct.Fragment,null,Ct.createElement(pl,{appearance:i,className:Te(a("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:p},o&&Ct.createElement(dl,{className:a("fullWidthProgressBadgeIcon",i)},o),Ct.createElement(cl,null,Ct.createElement(Ae,{size:"small",appearance:i,title:e,subtitle:t})),Ct.createElement(ml,{className:a("fullWidthProgressBadgeProgressContainer",i)},Ct.createElement(We,{count:n,total:r,display:"percent",textLocation:"top"}))));var uc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:m="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:y,getNumberOfStepsCompleted:T,isLoading:S,targetingLogicShouldHideFlow:g,updateCustomVariables:E}=R(),{mergeAppearanceWithDefault:P}=te();l=P(l);let{setOpenFlowState:F,getOpenFlowState:A}=Be();if(mc(()=>{E(p)},[p,S]),S)return null;let I=c(e);if(!I||g(I)||d===!0&&y(e)===Z)return null;let x=f(e),v=T(e);return m==="full-width"?yt.createElement(yt.Fragment,null,yt.createElement(ie,{appearance:l}),yt.createElement(ul,{title:t,subtitle:o,count:v,total:x.length,style:n,className:s,appearance:l,icon:i,onClick:()=>{}})):yt.createElement(yt.Fragment,null,yt.createElement(ie,{appearance:l}),yt.createElement(al,{count:v,total:x.length,title:t,style:n,onClick:()=>{F(e,!0),r&&r()},type:m,className:s,appearance:l}))};import fc from"react";var gc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Ie(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:p,getFlowSteps:d}=R(),{mergeAppearanceWithDefault:l}=te();o=l(o);let m=s(e);if(!m||p(m))return null;let c=d(e);return fc.createElement(To,w({steps:c,style:t,appearance:o},i))};import Ot,{useContext as Bc,useEffect as Ec}from"react";import K,{useEffect as er,useLayoutEffect as hl,useRef as bc,useState as to}from"react";import ko from"styled-components";import{useCallback as hc,useEffect as xc,useState as Cc}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 fl(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]=Cc(o),r=hc(()=>{e&&n(e.getBoundingClientRect())},[e]);return xc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as yc,useState as Sc}from"react";function gl(){let{debug:e}=yc(Q),[t,o]=Sc([]);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 xl=300,Cl=100,wc=500,oo=12,Tc=ko.div`
|
|
1409
1414
|
width: 100%;
|
|
1410
1415
|
height: 100%;
|
|
1411
1416
|
border-radius: 9999px;
|
|
@@ -1428,26 +1433,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1428
1433
|
opacity: 0;
|
|
1429
1434
|
}
|
|
1430
1435
|
}
|
|
1431
|
-
`,
|
|
1432
|
-
width: ${
|
|
1433
|
-
height: ${
|
|
1436
|
+
`,Fc=ko.div`
|
|
1437
|
+
width: ${oo}px;
|
|
1438
|
+
height: ${oo}px;
|
|
1434
1439
|
border-radius: 100px;
|
|
1435
1440
|
background-color: ${e=>e.primaryColor};
|
|
1436
1441
|
z-index: 20;
|
|
1437
1442
|
opacity: 1;
|
|
1438
|
-
`,
|
|
1443
|
+
`,kc=ko.div`
|
|
1439
1444
|
pointer-events: all;
|
|
1440
|
-
`,yl=
|
|
1445
|
+
`,yl=ko.div`
|
|
1441
1446
|
display: flex;
|
|
1442
1447
|
align-content: center;
|
|
1443
1448
|
justify-content: center;
|
|
1444
1449
|
align-items: center;
|
|
1445
1450
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1446
|
-
`,
|
|
1447
|
-
width: ${
|
|
1448
|
-
height: ${
|
|
1449
|
-
`,
|
|
1450
|
-
${e=>
|
|
1451
|
+
`,Pc=ko(yl)`
|
|
1452
|
+
width: ${oo+12}px;
|
|
1453
|
+
height: ${oo+12}px;
|
|
1454
|
+
`,vc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:f=!1,showHighlightOnly:y,showStepCount:T=!0,completedStepsCount:S=0,showFrigadeBranding:g=!1,cssPosition:E="absolute"})=>{var $e,Ge,Xe,St,Lt,$t,C,u,k,z,he,xe,io,Xr,Jr,Qr,Zr,Rr,ei;let{logErrorIfDebugMode:P}=gl(),[F,A]=to(),[I,x]=to(new Date),v=bc(null),[h,b]=to(document.querySelector(e[l].selector)),N=fl(h,I),[L,O]=to(),[j,M]=to(!y),G=(Ge=($e=e[l])==null?void 0:$e.props)!=null&&Ge.position?e[l].props.position:E,le=(Lt=(St=(Xe=e[l])==null?void 0:Xe.props)==null?void 0:St.zIndex)!=null?Lt:90,pe=($t=F==null?void 0:F.width)!=null?$t:xl,q=(C=F==null?void 0:F.height)!=null?C:Cl,[se,de]=to(new Date().getTime());s=(z=(k=(u=e[l])==null?void 0:u.props)==null?void 0:k.offset)!=null?z:s;let be=window.location.pathname.split("/").pop();hl(()=>{v.current&&A({width:v.current.clientWidth,height:v.current.clientHeight})},[l,I,G]),er(()=>{y||M(!0)},[l]);let V=()=>{let ne=document.querySelector(e[l].selector);if(!ne){O(void 0),b(null),P(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}L&&L===JSON.stringify(ne==null?void 0:ne.getBoundingClientRect())||(b(ne),x(new Date),ne&&O(JSON.stringify(ne.getBoundingClientRect())))};if(er(()=>{let ne=new MutationObserver(V);return ne.observe(document.body,{subtree:!0,childList:!0}),()=>ne.disconnect()},[V]),er(()=>{let ne=new MutationObserver(V);return ne.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>ne.disconnect()},[V]),er(()=>{let ne=setInterval(()=>{V()},10);return()=>clearInterval(ne)},[V]),hl(()=>{setTimeout(()=>{V()},wc),V()},[l,be]),h===null||!p)return null;let Y=i==="auto"?"right":i,ee=zr(N,Y,pe,s,G),Ve=N.right+pe>(window.innerWidth||document.documentElement.clientWidth),Le=N.bottom+Cl>(window.innerHeight||document.documentElement.clientHeight);Ve&&i==="auto"&&(ee=zr(N,"left",pe,s,G),Y="left"),(xe=(he=e[l])==null?void 0:he.props)!=null&&xe.tooltipPosition&&((Xr=(io=e[l])==null?void 0:io.props)==null?void 0:Xr.tooltipPosition)!=="auto"&&(((Qr=(Jr=e[l])==null?void 0:Jr.props)==null?void 0:Qr.tooltipPosition)==="left"||((Rr=(Zr=e[l])==null?void 0:Zr.props)==null?void 0:Rr.tooltipPosition)==="right")&&(Y=e[l].props.tooltipPosition);let X=()=>{let ne=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),M(!1),setTimeout(()=>{V()},30)),S===e.length-1)return o()},mt=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),y&&!e[l].secondaryButtonUri&&M(!1))};return K.createElement(K.Fragment,null,T&&e.length>1&&K.createElement(xi,null,K.createElement(yi,{className:a("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&K.createElement(Ci,{showStepCount:T,className:a("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&K.createElement(oe,{title:e[l].secondaryButtonTitle,appearance:c,onClick:mt,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&K.createElement(oe,{title:e[l].primaryButtonTitle,appearance:c,onClick:ne,withMargin:!1,size:"small"})))},ue=()=>K.createElement(K.Fragment,null,f&&K.createElement(mi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri},K.createElement(Ee,null)),e[l].imageUri&&K.createElement(ui,{dismissible:f,appearance:c,src:e[l].imageUri,className:a("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&K.createElement(fi,{dismissible:f,appearance:c,className:a("tooltipVideoContainer",c)},K.createElement(Re,{appearance:c,videoUri:e[l].videoUri})),K.createElement(hi,{className:a("tooltipContentContainer",c)},K.createElement(Ae,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),K.createElement(gi,{className:a("tooltipFooter",c)},K.createElement(X,null)))),we=w(w({},{default:ne=>{var mt;if((mt=e[l])!=null&&mt.StepContent){let ra=e[l].StepContent;return K.createElement("div",null,ra)}return K.createElement(ue,null)}}),m),U=()=>{var ne;return e?!((ne=e[l])!=null&&ne.type)||!we[e[l].type]?we.default(e[l]):we[e[l].type]({stepData:e[l],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[l].complete===!0||ee.x==0&&ee.y==0&&new Date().getTime()-se<100)return null;let $={top:(ee==null?void 0:ee.y)-oo,left:(ei=Y=="left"?N.x+s.x:(ee==null?void 0:ee.x)-oo)!=null?ei:0,cursor:y?"pointer":"default",position:G},W=()=>{let mt=$.left+(Y=="left"?-pe:24);return Math.min(Math.max(mt,20),window.innerWidth-pe-20)},J=()=>{if(G==="fixed")return $.top;let ne=$.top+q,mt=20;return ne>window.innerHeight-mt?$.top+-q:$.top},fe=()=>{y&&(x(new Date),M(!j))};return K.createElement(kc,null,K.createElement(Pc,{style:$,zIndex:le,className:a("tourHighlightContainer",c)},n&&e[l].showHighlight!==!1&&E!=="static"&&K.createElement(K.Fragment,null,K.createElement(Fc,{style:{position:G},onClick:fe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Tc,{style:{position:"absolute"},onClick:fe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(yl,{style:_(w({},$),{left:W(),top:J()}),zIndex:le+1,className:a("tooltipContainerWrapper",c)},j&&K.createElement(K.Fragment,null,K.createElement(Ao,{ref:v,layoutId:"tooltip-container",style:w({position:"relative",width:"max-content",right:0,top:E!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:xl,zIndex:le+10},K.createElement(U,null)),g&&K.createElement(bi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:le+10},K.createElement(Oo,{appearance:c})))))},_r=vc;import{Portal as Ac}from"react-portal";var Oc=S=>{var g=S,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:f=!1,cssPosition:y="absolute"}=g,T=Ie(g,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition"]);let{getFlow:E,getFlowSteps:P,isLoading:F,targetingLogicShouldHideFlow:A,markStepCompleted:I,markStepStarted:x,markFlowCompleted:v,updateCustomVariables:h,getCurrentStepIndex:b,getStepStatus:N,isStepBlocked:L,getFlowStatus:O,getNumberOfStepsCompleted:j}=R(),{isLoadingUserFlowStateData:M}=De(),{primaryCTAClickSideEffects:G,secondaryCTAClickSideEffects:le}=ae(),{hasOpenModals:pe}=Be(),q=b(e),{openFlowStates:se}=Bc(Q),{mergeAppearanceWithDefault:de}=te();if(o=de(o),Ec(()=>{h(t)},[t,F]),M)return null;let be=E(e);if(!be||A(be)||O(e)==Z||pe())return null;let V=P(e);if(Object.keys(se).length>0){let U=Object.keys(se).find($=>se[$]===!0);if(U!==void 0&&U!==e)return Ot.createElement(Ot.Fragment,null)}function Y(U){return D(this,null,function*(){if(yield I(e,U.id),V.map($=>N(e,$.id)).every($=>$===Ke)){yield v(e);return}if(!l&&q+1<V.length&&!r){if(L(e,V[q+1].id))return;yield x(e,V[q+1].id)}})}function ee(U,$,W){let J=q+1<V.length?V[q+1]:null;n&&n(U,q,$,J),i&&i(U,W,J)}function Ve(){return V.map(U=>_(w({},U),{handleSecondaryButtonClick:()=>D(this,null,function*(){le(U),U.skippable===!0&&(yield I(e,U.id,{skipped:!0})),ee(U,"secondary",q)}),handlePrimaryButtonClick:()=>D(this,null,function*(){(!U.completionCriteria&&(U.autoMarkCompleted||U.autoMarkCompleted===void 0)||U.completionCriteria&&U.autoMarkCompleted===!0)&&(yield Y(U)),ee(U,"primary",q),G(U)})}))}function Le(U){return D(this,null,function*(){s&&s(),m==="complete-flow"?yield v(e):yield I(e,U.id)})}function X(){c&&c()}let ue=!document.querySelector(V[q].selector);function Oe(){let U=V.findIndex($=>!!document.querySelector($.selector));return V.map(($,W)=>ue&&!r&&W!==U&&f||!r&&W!==q?null:Ot.createElement(_r,w({key:$.id,appearance:o,steps:Ve(),selectedStep:W,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Le($),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:j(e),onComplete:X,cssPosition:y},T)))}function we(){return Ot.createElement(Ot.Fragment,null,Ot.createElement(ie,{appearance:o}),Oe())}return y==="static"?we():Ot.createElement(Ac,null,we())};import _e,{useEffect as Ic,useRef as Nc,useState as Lc}from"react";import{Portal as $c}from"react-portal";import It from"styled-components";var Sl=It.button`
|
|
1455
|
+
${e=>B(e)} {
|
|
1451
1456
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1452
1457
|
|
|
1453
1458
|
display: flex;
|
|
@@ -1465,12 +1470,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1465
1470
|
}
|
|
1466
1471
|
}
|
|
1467
1472
|
`,bl=It.span`
|
|
1468
|
-
${e=>
|
|
1473
|
+
${e=>B(e)} {
|
|
1469
1474
|
font-size: 12px;
|
|
1470
1475
|
display: inline-block;
|
|
1471
1476
|
}
|
|
1472
1477
|
`,wl=It.span`
|
|
1473
|
-
${e=>
|
|
1478
|
+
${e=>B(e)} {
|
|
1474
1479
|
font-size: 12px;
|
|
1475
1480
|
display: inline-block;
|
|
1476
1481
|
}
|
|
@@ -1485,7 +1490,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1485
1490
|
align-items: flex-end;
|
|
1486
1491
|
z-index: 50;
|
|
1487
1492
|
`,Fl=It.button`
|
|
1488
|
-
${e=>
|
|
1493
|
+
${e=>B(e)} {
|
|
1489
1494
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1490
1495
|
background-color: #ffffff;
|
|
1491
1496
|
border: 1px solid #f5f5f5;
|
|
@@ -1501,7 +1506,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1501
1506
|
border-radius: 45px;
|
|
1502
1507
|
cursor: pointer;
|
|
1503
1508
|
`,kl=It.div`
|
|
1504
|
-
${e=>
|
|
1509
|
+
${e=>B(e)} {
|
|
1505
1510
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1506
1511
|
background: #ffffff;
|
|
1507
1512
|
}
|
|
@@ -1518,7 +1523,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1518
1523
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1519
1524
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1520
1525
|
`,Pl=It.button`
|
|
1521
|
-
${e=>
|
|
1526
|
+
${e=>B(e)} {
|
|
1522
1527
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1523
1528
|
color: #434343;
|
|
1524
1529
|
:hover {
|
|
@@ -1534,8 +1539,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1534
1539
|
font-size: 14px;
|
|
1535
1540
|
|
|
1536
1541
|
padding: 8px 12px;
|
|
1537
|
-
`;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.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 El from"react";var Al=({style:e,className:t})=>El.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"},El.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
|
|
1538
|
-
${e=>
|
|
1542
|
+
`;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.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 El from"react";var Al=({style:e,className:t})=>El.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"},El.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 Mc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:y}=R(),{primaryCTAClickSideEffects:T}=ae(),S=Nc(null),[g,E]=Lc(!1),{mergeAppearanceWithDefault:P}=te();s=P(s),Ic(()=>(document.addEventListener("click",F,!1),()=>{document.removeEventListener("click",F,!1)}),[]);let F=h=>{S.current&&!S.current.contains(h.target)&&E(!1)};if(f)return null;let A=p(e);if(!A||y(A))return null;let I=d(e);if(!I||!i)return null;function x(h,b){!h.completionCriteria&&(h.autoMarkCompleted||h.autoMarkCompleted===void 0)&&l(e,h.id),T(h),o&&o(h,b),E(!1)}function v(){return g&&_e.createElement(kl,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},I.map((h,b)=>_e.createElement(Pl,{className:a("floatingWidgetMenuItem",s),key:b,onClick:()=>x(h,b)},h.title)))}return n=="inline"?_e.createElement("span",{ref:S},_e.createElement(Sl,{style:t,onClick:()=>{E(!g)},className:a("supportButton",s)},_e.createElement(wl,{className:a("supportIconContainer",s)},_e.createElement(Al,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),_e.createElement(bl,{className:a("supportButtonTitle",s)},r)),_e.createElement(v,null)):_e.createElement($c,null,_e.createElement(Tl,{style:t,ref:S},_e.createElement(v,null),_e.createElement(Fl,{onClick:()=>{E(!g)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},_e.createElement(Bl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import ot,{useEffect as Dc}from"react";import tr from"styled-components";var Ol=tr.div`
|
|
1543
|
+
${e=>B(e)} {
|
|
1539
1544
|
display: flex;
|
|
1540
1545
|
flex-direction: column;
|
|
1541
1546
|
width: 100%;
|
|
@@ -1560,7 +1565,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1560
1565
|
align-items: flex-start;
|
|
1561
1566
|
margin-top: 16px;
|
|
1562
1567
|
`,Ll=tr.div`
|
|
1563
|
-
${e=>
|
|
1568
|
+
${e=>B(e)} {
|
|
1564
1569
|
position: absolute;
|
|
1565
1570
|
top: 16px;
|
|
1566
1571
|
right: 16px;
|
|
@@ -1570,9 +1575,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1570
1575
|
opacity: 0.8;
|
|
1571
1576
|
}
|
|
1572
1577
|
}
|
|
1573
|
-
`;var
|
|
1578
|
+
`;var Uc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:y,getFlowSteps:T,getFlowStatus:S,getCurrentStepIndex:g}=R(),{primaryCTAClickSideEffects:E}=ae(),{mergeAppearanceWithDefault:P}=te();if(n=P(n),Dc(()=>{y(o)},[o,c]),c)return null;let F=d(e);if(!F||f(F)||S(e)===Z)return null;let I=T(e)[g(e)];return ot.createElement(ot.Fragment,null,ot.createElement(ie,{appearance:n}),ot.createElement(Ol,{appearance:n,className:Te(a("embeddedTipContainer",n),r),style:s},(p===!0||I.dismissible)&&ot.createElement(Ll,{onClick:()=>D(void 0,null,function*(){yield l(e),t&&t()}),className:a("embeddedTipDismissButton",n)},ot.createElement(Ee,null)),ot.createElement(Il,null,ot.createElement(Ae,{size:"small",appearance:n,title:I.title,subtitle:I.subtitle})),I.primaryButtonTitle&&ot.createElement(Nl,{className:a("embeddedTipCallToActionContainer",n)},ot.createElement(oe,{classPrefix:"embeddedTip",title:I.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>D(void 0,null,function*(){I.handlePrimaryButtonClick(),E(I),!(i&&i(I,g(e),"primary")===!1)&&(yield m(e,I.id),yield l(e))})}))))};import Pe,{useEffect as Wc}from"react";import ro from"styled-components";var $l=ro.div`
|
|
1574
1579
|
// use the :not annotation
|
|
1575
|
-
${e=>
|
|
1580
|
+
${e=>B(e)} {
|
|
1576
1581
|
display: flex;
|
|
1577
1582
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1578
1583
|
width: 100%;
|
|
@@ -1582,24 +1587,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1582
1587
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1583
1588
|
border-radius: 12px;
|
|
1584
1589
|
}
|
|
1585
|
-
`,Ml=
|
|
1586
|
-
${e=>
|
|
1590
|
+
`,Ml=ro.div`
|
|
1591
|
+
${e=>B(e)} {
|
|
1587
1592
|
display: flex;
|
|
1588
1593
|
width: 46px;
|
|
1589
1594
|
height: 46px;
|
|
1590
1595
|
}
|
|
1591
|
-
`,Dl=
|
|
1596
|
+
`,Dl=ro.div`
|
|
1592
1597
|
display: flex;
|
|
1593
1598
|
flex-direction: column;
|
|
1594
1599
|
flex: 1;
|
|
1595
1600
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1596
1601
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1597
|
-
`,Ul=
|
|
1602
|
+
`,Ul=ro.div`
|
|
1598
1603
|
display: flex;
|
|
1599
1604
|
flex-direction: column;
|
|
1600
1605
|
justify-content: center;
|
|
1601
1606
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1602
|
-
`,Hr=
|
|
1607
|
+
`,Hr=ro.div`
|
|
1603
1608
|
display: flex;
|
|
1604
1609
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1605
1610
|
align-items: flex-end;
|
|
@@ -1607,12 +1612,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1607
1612
|
:hover {
|
|
1608
1613
|
opacity: 0.8;
|
|
1609
1614
|
}
|
|
1610
|
-
`,jr=
|
|
1615
|
+
`,jr=ro.div`
|
|
1611
1616
|
display: flex;
|
|
1612
1617
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1613
1618
|
align-items: flex-end;
|
|
1614
1619
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1615
|
-
`;import Vr from"react";var Wl=({style:e,className:t})=>Vr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Vr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Vr.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
|
|
1620
|
+
`;import Vr from"react";var Wl=({style:e,className:t})=>Vr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Vr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Vr.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 zc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:y,getFlowMetadata:T,getFlowStatus:S,getFlowSteps:g,getCurrentStepIndex:E}=R(),{primaryCTAClickSideEffects:P}=ae(),{mergeAppearanceWithDefault:F}=te();if(s=F(s),Wc(()=>{y(n)},[n,c]),c)return null;let A=l(e);if(!A||f(A)||S(e)===Z)return null;let I=g(e),x=I.length>0?I[E(e)]:T(e);return x!=null&&x.title&&(t=x.title),x!=null&&x.subtitle&&(o=x.subtitle),Pe.createElement(Pe.Fragment,null,Pe.createElement(ie,{appearance:s}),Pe.createElement($l,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&Pe.createElement(Ml,{className:a("bannerIconContainer",s)},d||Pe.createElement(Wl,null)),p==="square"&&x.dismissible&&Pe.createElement(jr,{type:p,className:a("bannerDismissButtonContainer",s)},Pe.createElement(Hr,{type:p,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},Pe.createElement(Ee,null))),Pe.createElement(Dl,{type:p},Pe.createElement(Ae,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(x==null?void 0:x.primaryButtonTitle)&&Pe.createElement(Ul,{type:p,className:a("bannerCallToActionContainer",s)},Pe.createElement(oe,{title:x==null?void 0:x.primaryButtonTitle,appearance:s,onClick:()=>{P(x),r&&r(x,0,"primary")},classPrefix:"banner"})),p!=="square"&&x.dismissible&&Pe.createElement(jr,{type:p,className:a("bannerDismissButtonContainer",s)},Pe.createElement(Hr,{type:p,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},Pe.createElement(Ee,null)))))};import re,{useEffect as _c}from"react";import{Portal as Hc}from"react-portal";import ct from"styled-components";var zl=ct.div`
|
|
1616
1621
|
display: flex;
|
|
1617
1622
|
flex-direction: column;
|
|
1618
1623
|
width: 100%;
|
|
@@ -1674,14 +1679,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1674
1679
|
display: flex;
|
|
1675
1680
|
flex-direction: column;
|
|
1676
1681
|
flex: 1;
|
|
1677
|
-
`,
|
|
1682
|
+
`,Z1=ct.div`
|
|
1678
1683
|
display: flex;
|
|
1679
1684
|
flex-direction: column;
|
|
1680
1685
|
justify-content: center;
|
|
1681
1686
|
align-items: flex-start;
|
|
1682
1687
|
margin-top: 16px;
|
|
1683
1688
|
`,jl=ct.textarea`
|
|
1684
|
-
${e=>
|
|
1689
|
+
${e=>B(e)} {
|
|
1685
1690
|
margin-top: 16px;
|
|
1686
1691
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1687
1692
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
@@ -1692,7 +1697,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1692
1697
|
height: 100px;
|
|
1693
1698
|
}
|
|
1694
1699
|
`,Vl=ct.div`
|
|
1695
|
-
${e=>
|
|
1700
|
+
${e=>B(e)} {
|
|
1696
1701
|
position: absolute;
|
|
1697
1702
|
top: 16px;
|
|
1698
1703
|
right: 16px;
|
|
@@ -1702,8 +1707,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1702
1707
|
opacity: 0.8;
|
|
1703
1708
|
}
|
|
1704
1709
|
}
|
|
1705
|
-
`;var
|
|
1706
|
-
${e=>
|
|
1710
|
+
`;var jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:S,getFlowStatus:g,getFlowMetadata:E}=R(),{primaryCTAClickSideEffects:P}=ae(),{mergeAppearanceWithDefault:F}=te(),[A,I]=re.useState(null),[x,v]=re.useState(""),h=E(e),{hasOpenModals:b,setKeepCompletedFlowOpenDuringSession:N,shouldKeepCompletedFlowOpenDuringSession:L}=Be();if(n=F(n),_c(()=>{T(o)},[o,f]),f)return null;let O=d(e);if(!O||y(O)||g(e)===Z||c(e)===1&&!L(e)||b())return null;let M=S(e)[c(e)];function G(){var q,se;return re.createElement(re.Fragment,null,re.createElement(qr,null,re.createElement(Ae,{size:"large",appearance:n,title:M.title,subtitle:M.subtitle})),re.createElement(Gr,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(de=>re.createElement(_l,{className:a("npsNumberButton",n),selected:A===de+1,key:de,onClick:()=>D(this,null,function*(){N(e),I(de+1),yield m(e,M.id,{score:de+1})}),appearance:n},de+1))),re.createElement(Hl,{appearance:n},re.createElement(Kr,{appearance:n},(q=h==null?void 0:h.negativeLabel)!=null?q:"Not likely at all"),re.createElement(Kr,{appearance:n},(se=h==null?void 0:h.positiveLabel)!=null?se:"Extremely likely")))}function le(){var q;return re.createElement(re.Fragment,null,re.createElement(qr,null,re.createElement(Ae,{appearance:n,title:(q=M.title)!=null?q:"Why did you choose this score?",size:"large"})),re.createElement(jl,{appearance:n,value:x,onChange:se=>{v(se.target.value)},placeHolder:"Add your optional fedback here..."}),re.createElement(Gr,{appearance:n,className:a("npsNumberButtonContainer",n)},re.createElement(oe,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield l(e),i&&i(M,1,"primary")}),appearance:n,title:M.secondaryButtonTitle||"Skip",secondary:!0}),re.createElement(oe,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield m(e,M.id,{feedbackText:x}),yield l(e),i&&i(M,1,"primary")}),appearance:n,title:M.primaryButtonTitle||"Submit"})))}function pe(){return c(e)>=2?null:re.createElement(re.Fragment,null,re.createElement(ie,{appearance:n}),re.createElement(zl,{appearance:n,className:Te(a("npsSurveyContainer",n),r),style:s,type:p},re.createElement(Vl,{onClick:()=>D(this,null,function*(){yield l(e),t&&t()}),className:a("npsSurveyDismissButton",n)},re.createElement(Ee,null)),c(e)==0&&G(),c(e)==1&&le()))}return p==="inline"?pe():re.createElement(Hc,null,pe())};import ve,{useEffect as Kc}from"react";import Nt from"styled-components";var Gl=Nt.div`
|
|
1711
|
+
${e=>B(e)} {
|
|
1707
1712
|
display: flex;
|
|
1708
1713
|
flex-direction: column;
|
|
1709
1714
|
width: 100%;
|
|
@@ -1728,7 +1733,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1728
1733
|
margin-top: 16px;
|
|
1729
1734
|
margin-bottom: 16px;
|
|
1730
1735
|
`,Xl=Nt.div`
|
|
1731
|
-
${e=>
|
|
1736
|
+
${e=>B(e)} {
|
|
1732
1737
|
position: absolute;
|
|
1733
1738
|
top: -16px;
|
|
1734
1739
|
right: -16px;
|
|
@@ -1739,7 +1744,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1739
1744
|
}
|
|
1740
1745
|
}
|
|
1741
1746
|
`,Jl=Nt.h1`
|
|
1742
|
-
${e=>
|
|
1747
|
+
${e=>B(e)} {
|
|
1743
1748
|
font-style: normal;
|
|
1744
1749
|
justify-content: center;
|
|
1745
1750
|
text-align: center;
|
|
@@ -1753,7 +1758,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1753
1758
|
margin-bottom: 8px;
|
|
1754
1759
|
}
|
|
1755
1760
|
`,Ql=Nt.h2`
|
|
1756
|
-
${e=>
|
|
1761
|
+
${e=>B(e)} {
|
|
1757
1762
|
font-style: normal;
|
|
1758
1763
|
justify-content: center;
|
|
1759
1764
|
text-align: center;
|
|
@@ -1764,10 +1769,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1764
1769
|
letter-spacing: 0.28px;
|
|
1765
1770
|
margin-bottom: 8px;
|
|
1766
1771
|
}
|
|
1767
|
-
`;import Zl from"react";import
|
|
1772
|
+
`;import Zl from"react";import Vc from"styled-components";var Gc=Vc.img`
|
|
1768
1773
|
width: 100%;
|
|
1769
1774
|
height: 100%;
|
|
1770
1775
|
min-height: 200px;
|
|
1771
1776
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1772
|
-
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Re,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(
|
|
1777
|
+
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Re,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Gc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var qc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:f,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:S,getFlowStatus:g,getCurrentStepIndex:E}=R(),{primaryCTAClickSideEffects:P,secondaryCTAClickSideEffects:F}=ae(),{mergeAppearanceWithDefault:A}=te(),{setOpenFlowState:I,getOpenFlowState:x,hasOpenModals:v}=Be(),[h,b]=[x(e,!0),le=>I(e,le)];if(n=A(n),Kc(()=>{T(o)},[o,f]),f)return null;let N=l(e);if(!N||y(N)||g(e)===Z||v())return null;let O=S(e)[E(e)],j=()=>{b(!1),t&&t(),m(e)};function M(){return ve.createElement(ve.Fragment,null,ve.createElement(ie,{appearance:n}),ve.createElement(Gl,{appearance:n,className:Te(a("announcementContainer",n),r),style:s},(p===!0||O.dismissible)&&d=="inline"&&ve.createElement(Xl,{onClick:()=>D(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},ve.createElement(Ee,null)),ve.createElement(Kl,null,ve.createElement(Jl,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:ce(O.title)}),O.subtitle&&ve.createElement(Ql,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:ce(O.subtitle)})),(O.imageUri||O.videoUri)&&ve.createElement(Yl,{className:a("announcementMediaContainer",n)},ve.createElement(Rl,{appearance:n,stepData:O})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&ve.createElement(ql,{className:a("announcementCTAContainer",n)},O.secondaryButtonTitle&&ve.createElement(oe,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handleSecondaryButtonClick(),F(O),i&&i(O,E(e),"secondary")}),secondary:!0}),O.primaryButtonTitle&&ve.createElement(oe,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handlePrimaryButtonClick(),P(O),!(i&&i(O,E(e),"primary")===!1)&&(yield c(e,O.id),yield m(e))})}))))}let G={padding:"24px",maxWidth:"400px"};return d==="inline"?M():d!=="center"?ve.createElement(Lo,{modalPosition:d,onClose:j,visible:h,dismissible:p,appearance:n},M()):ve.createElement(Qe,{appearance:n,onClose:j,visible:h,style:G,dismissible:p},M())};import*as or from"react";import ea from"react";var ta=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Ie(r,["as","children","variant"]);return ea.createElement(Tn,w({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Yc=Object.fromEntries(Object.keys(Vo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ea.createElement(ta,_(w({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),Yr=Object.assign(ta,Yc);var oa=s=>{var p=s,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Ie(p,["as","className","size","title","variant"]);var d;return or.createElement(wn,w({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),or.createElement(Yr,{color:(d=So[n])==null?void 0:d.color,fontWeight:"semibold"},i))},Xc=Object.fromEntries(Object.keys(So).map(e=>{let t=o=>or.createElement(oa,_(w({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),Jc=Object.assign(oa,Xc);export{yo as Box,Jc as Button,nt as CheckBox,sr as FlowType,ft as FormLabel,Cr as FormTextField,qc as FrigadeAnnouncement,zc as FrigadeBanner,Wr as FrigadeChecklist,it as FrigadeDefaultAppearance,Uc as FrigadeEmbeddedTip,fn as FrigadeForm,gc as FrigadeGuide,cc as FrigadeHeroChecklist,jc as FrigadeNPSSurvey,uc as FrigadeProgressBadge,wd as FrigadeProvider,Mc as FrigadeSupportWidget,Oc as FrigadeTour,We as ProgressBar,_t as ProgressRing,Yr as Text,Ar as tokens,Be as useFlowOpens,so as useFlowResponses,R as useFlows,Er as useOrganization,lo as useUser,De as useUserFlowStates};
|
|
1773
1778
|
//# sourceMappingURL=index.mjs.map
|