@frigade/react 1.35.41 → 1.35.43
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 +219 -237
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +220 -238
- 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,T=(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 n in e)oi.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&ko)for(var n of ko(e))t.indexOf(n)<0&&ri.call(e,n)&&(o[n]=e[n]);return o};var $=(e,t,o)=>new Promise((n,i)=>{var r=d=>{try{p(o.next(d))}catch(l){i(l)}},s=d=>{try{p(o.throw(d))}catch(l){i(l)}},p=d=>d.done?n(d.value):Promise.resolve(d.value).then(r,s);p((o=o.apply(e,t)).next())});import vt,{createContext as hd,useEffect as Ko,useState as je}from"react";import{ThemeProvider as Cd}from"styled-components";import Pt,{useContext as Kp,useEffect as xo,useState as Vo}from"react";import{useCallback as Tt,useContext as ya,useEffect as Sa}from"react";import rr,{useMemo as si}from"react";var ni="1.35.41 ";var He="NOT_STARTED_STEP",Z="COMPLETED_FLOW",Po="ABORTED_FLOW",wt="STARTED_FLOW",$e="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 Ut(){let{shouldGracefullyDegrade:e,readonly:t}=rr.useContext(Q);return(o,n)=>$(this,null,function*(){if(t&&(n.method==="POST"||n.method==="PUT"||n.method==="DELETE"))return Mt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Mt();let i=la+o,r=aa+o;if(window&&window.localStorage&&n&&n.body&&n.method==="POST"){let p=window.localStorage.getItem(i),d=window.localStorage.getItem(r);if(p&&d&&d==n.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return Mt()}window.localStorage.setItem(i,new Date().toISOString()),window.localStorage.setItem(r,n.body)}let s;try{s=yield fetch(o,n)}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 Wt(){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 xa,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:n,completedFlowsToKeepOpenDuringSession:i}=pa(Q);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function s(c,g){t(y=>_(T({},y),{[c]:g}))}function p(c){t(g=>{let S=g,{[c]:y}=S,F=Ie(S,[ii(c)]);return T({},F)})}function d(c){i.includes(c)||n(g=>[...g,c])}function l(c){return i.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}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 n=io(t);return Object.entries(o).forEach(([i,r])=>{ir(r)?n[i]!==void 0?Object.assign(n,{[i]:Ce(n[i],io(r))}):Object.assign(n,{[i]:io(r)}):Array.isArray(r)?n[i]!==void 0?Object.assign(n,{[i]:[...n[i],...io(r)]}):Object.assign(n,{[i]:io(r)}):Object.assign(n,{[i]:r})}),n}var ga="unknown";function Me(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:n,organizationId:i,flows:r,setShouldGracefullyDegrade:s,readonly:p}=da(Q),{resetOpenFlowState:d}=Be(),[l,m]=ma(!1),c={data:r.map(f=>({flowId:f.id,flowState:Z,lastStepId:null,userId:n,foreignUserId:n,stepStates:{},shouldTrigger:!1}))},g=f=>fetch(f,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${f}: ${P}. Will gracefully degrade and hide Frigade`),s(!0),c)),y=o&&r&&n?`${t}userFlowStates?foreignUserId=${encodeURIComponent(n)}${i?`&foreignUserGroupId=${encodeURIComponent(i)}`:""}`:null,{data:F,isLoading:S,mutate:x,error:v}=p?fa(y,g):ua(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),b=F==null?void 0:F.data;ca(()=>{!l&&!S&&b&&m(!0)},[b,l,S]);function E(f){return $(this,null,function*(){if(b&&!p){let P=b.find(N=>N.flowId===f);P&&P.flowState!==Z&&(P.flowState=Z),yield x(Promise.resolve(Ce(F,{data:b})),{optimisticData:Ce(F,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function A(f,P,N){return $(this,null,function*(){if(b){let L=b.find(I=>I.flowId===f);L&&(L.stepStates[P]=N,L.flowState=wt),yield x(Promise.resolve(Ce(F,{data:b})),{optimisticData:Ce(F,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function O(f,P,N){return $(this,null,function*(){if(b){let L=b.find(I=>I.flowId===f);L&&(L.lastStepId=P,L.stepStates[P]=N,L.flowState=wt),yield x(Ce(F,{data:b}),{optimisticData:Ce(F,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function h(f){return $(this,null,function*(){if(b){let P=b.find(N=>N.flowId===f);P&&P.flowState!==$e&&(P.flowState=$e,P.lastStepId=ga,Object.keys(P.stepStates).forEach(N=>{P.stepStates[N].actionType=He,P.stepStates[N].createdAt=new Date().toISOString()}),yield x(Ce(F,{data:b}),{optimisticData:Ce(F,{data:b}),revalidate:!1,rollbackOnError:!1}),d(f))}})}function w(f,P){return $(this,null,function*(){if(b){let N=b.find(L=>L.flowId===f);N&&N.stepStates[P]!==He&&(N.stepStates[P]=He),yield x(Ce(F,{data:b}),{optimisticData:Ce(F,{data:b}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:b,isLoadingUserFlowStateData:!l,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:E,optimisticallyMarkFlowNotStarted:h,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:w,optimisticallyMarkStepStarted:O,error:v}}function no(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:n}=Me(),{failedFlowResponses:i,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=xa(Q),[d,l]=li(new Set),[m,c]=li(new Set),g=Ut();function y(x){let v=JSON.stringify(x);if(d.has(v))return null;d.add(v),l(d),m.add(x),c(m);let b=s==null?void 0:s.find(E=>E.flowSlug===x.flowSlug&&E.stepId===x.stepId&&E.actionType===x.actionType&&E.createdAt===x.createdAt);return g(`${t}flowResponses`,_(T({},e),{method:"POST",body:v})).then(E=>{E.status!==200&&E.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...i,x])):b||p(A=>[...A!=null?A:[],x])})}function F(x){return $(this,null,function*(){x.foreignUserId&&(x.actionType===wt||x.actionType===$e?yield y(x):x.actionType===Z?yield y(x):x.actionType===vo?yield y(x):x.actionType===Ke?yield y(x):x.actionType===Po?yield y(x):x.actionType===He&&(yield y(x)))})}function S(){let x=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let b in v.stepStates){let E=v.stepStates[b];x.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:E.stepId,actionType:E.actionType,data:{},createdAt:new Date(E.createdAt),blocked:E.blocked,hidden:E.hidden})}}),[...x,...s]}return{addResponse:F,setFlowResponses:p,getFlowResponses:S}}import ba from"swr";var ha=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ai=e=>{let t=ha.exec(e);if(t===null)return null;let o=null;return t.forEach((n,i)=>{let r=Ca(n,"'","");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:n,userId:i,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,readonly:y}=ya(Q),F={data:[]},{verifySDKInitiated:S}=Wt(),{addResponse:x,getFlowResponses:v}=no(),b=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`),g(!0),F)).catch(u=>(console.log(`Error fetching ${C}: ${u}. Will gracefully degrade and hide Frigade`),g(!0),F)),{mutateUserFlowState:E,userFlowStatesData:A,isLoadingUserFlowStateData:O,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:w,optimisticallyMarkStepCompleted:f,optimisticallyMarkStepNotStarted:P,optimisticallyMarkStepStarted:N}=Me(),{data:L,error:I,isLoading:q}=ba(s?`${t}flows${y?"?readonly=true":""}`:null,b,{keepPreviousData:!0});Sa(()=>{if(I){console.error(I);return}L&&L.data&&n(L.data)},[L,I]);function M(C){if(q)return null;let u=o.find(k=>k.slug===C);return!u&&o.length>0&&!O&&!q?(console.log(`Flow with id ${C} not found`),null):(u==null?void 0:u.active)===!1&&!y?null:u}function j(C){var z,xe;if(!M(C))return[];let u=M(C).data;return u?(u=le(u),((xe=(z=nr(u))==null?void 0:z.data)!=null?xe:[]).map(he=>{let ro=J(he);return _(T({handleSecondaryButtonClick:()=>{he.skippable===!0&&V(C,he.id,{skipped:!0})}},he),{complete:ue(C,he.id)===Ke||ro>=1,blocked:Oe(C,he.id),hidden:we(C,he.id),handlePrimaryButtonClick:()=>{(!he.completionCriteria&&(he.autoMarkCompleted||he.autoMarkCompleted===void 0)||he.completionCriteria&&he.autoMarkCompleted===!0)&&V(C,he.id)},progress:ro})}).filter(he=>he.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 K(C,u){d(k=>_(T({},k),{[C]:u}))}function se(C){!O&&!q&&C&&JSON.stringify(p)!=JSON.stringify(T(T({},p),C))&&Object.keys(C).forEach(u=>{K(u,C[u])})}let de=Tt((C,u,k)=>$(this,null,function*(){if(!S())return;let z={foreignUserId:i,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),x(z))}),[i,r,A]),be=Tt((C,u,k)=>$(this,null,function*(){if(!S())return;let z={foreignUserId:i,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 P(C,u),x(z))}),[i,r,A]),V=Tt((C,u,k)=>$(this,null,function*(){if(!S())return;let z={foreignUserId:i,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 f(C,u,z),x(z))}),[i,r,A]),Y=Tt((C,u)=>$(this,null,function*(){if(!S()||fe(C)===$e)return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:$e,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};yield w(C),X(k)&&x(k)}),[i,r,A]),ee=Tt((C,u)=>$(this,null,function*(){if(!S())return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:wt,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&x(k)}),[i,r,A]),Ve=Tt((C,u)=>$(this,null,function*(){if(!S())return;let k={foreignUserId:i,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 h(C),x(k))}),[i,r,A]),Le=Tt((C,u)=>$(this,null,function*(){if(!S())return;let k={foreignUserId:i,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 h(C),x(k))}),[i,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 O?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(O)return null;let k=A==null?void 0:A.find(xe=>xe.flowId===C);return!k||!k.stepStates[u]?null:(z=k.stepStates[u])!=null?z:null}function D(C){var k,z;if(O||!A)return null;if(fe(C)===$e)return(k=j(C)[0])!=null?k:null;let u=(z=A.find(xe=>xe.flowId===C))==null?void 0:z.lastStepId;return u?j(C).find(xe=>xe.id===u):null}function W(C){var z;let u=D(C);if(!u)return 0;let k=(z=j(C).findIndex(xe=>xe.id===u.id))!=null?z:0;return ue(C,u.id)===Ke&&k<j(C).length-1?k+1:k}function J(C){if(!C.completionCriteria)return;let u=ai(C.completionCriteria);if(u===null)return;let k=De(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 De(C){let u=j(C);return u.length===0?0:u.filter(z=>ue(C,z.id)===Ke).length}function Ge(C){return j(C).length}function Xe(C){let u=o.find(k=>k.slug===C);return u?nr(u.data):null}function bt(C){if(y)return!1;if(O)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&&i&&i.startsWith("guest_"))}function Dt(C){return!bt(M(C))}function $t(){i&&E()}return{getFlow:M,getFlowData:Xe,isLoading:O||q,getStepStatus:ue,getFlowSteps:j,getCurrentStepIndex:W,markStepStarted:de,markStepCompleted:V,markFlowNotStarted:Y,markFlowStarted:ee,markFlowCompleted:Ve,markFlowAborted:Le,markStepNotStarted:be,getFlowStatus:fe,getNumberOfStepsCompleted:De,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:bt,setCustomVariable:K,updateCustomVariables:se,customVariables:p,getStepOptionalProgress:J,getFlowMetadata:pe,isStepBlocked:Oe,isStepHidden:we,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Dt,refresh:$t}}import{useCallback as lr,useContext as wa,useEffect as Ta}from"react";var zt="guest_";function so(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:i}=wa(Q),{config:r,apiUrl:s}=Je(),{mutateUserFlowState:p}=Me(),d=Ut(),{verifySDKInitiated:l}=Wt();function m(F){return`frigade-user-registered-${F}`}Ta(()=>{if(e&&!t){if(e.startsWith(zt))return;let F=m(e);localStorage.getItem(F)||(d(`${s}users`,_(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(F,"true"))}},[e,i,t]);let c=lr(F=>$(this,null,function*(){if(!l())return;let S={foreignId:e,properties:F};yield d(`${s}users`,_(T({},r),{method:"POST",body:JSON.stringify(S)})),n(x=>T(T({},x),F)),p()}),[e,r,i,p]),g=lr((F,S)=>$(this,null,function*(){if(!l())return;let v={foreignId:e,events:[{event:F,properties:S}]};yield d(`${s}users`,_(T({},r),{method:"POST",body:JSON.stringify(v)})),p()}),[e,r,p]),y=lr((F,S)=>$(this,null,function*(){if(l())if(S){let x=m(F);localStorage.setItem(x,"true"),o(F);let v={foreignId:F,properties:S};yield d(`${s}users`,_(T({},r),{method:"POST",body:JSON.stringify(v)})),n(b=>T(T({},b),S)),p()}else o(F)}),[r,i,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}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 B(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(n=>`.${n}`).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 Fo=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(Fo)for(var o of Fo(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&&Fo)for(var i of Fo(e))t.indexOf(i)<0&&ri.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import 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 go,useState as jo}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.43 ";var He="NOT_STARTED_STEP",Z="COMPLETED_FLOW",ko="ABORTED_FLOW",bt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ke="COMPLETED_STEP",Po="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)=>M(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,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>_(w({},y),{[c]:g}))}function p(c){t(g=>{let S=g,{[c]:y}=S,T=Ie(S,[ii(c)]);return w({},T)})}function d(c){n.includes(c)||i(g=>[...g,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import fa from"swr/immutable";import ro 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=ro(t);return Object.entries(o).forEach(([n,r])=>{ir(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],ro(r))}):Object.assign(i,{[n]:ro(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ro(r)]}):Object.assign(i,{[n]:ro(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(u=>({flowId:u.id,flowState:Z,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=u=>fetch(u,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${u}: ${P}. 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:h,error:B}=p?fa(y,g):ua(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),v=T==null?void 0:T.data;ca(()=>{!s&&!S&&v&&m(!0)},[v,s,S]);function F(u){return M(this,null,function*(){if(v&&!p){let P=v.find(N=>N.flowId===u);P&&P.flowState!==Z&&(P.flowState=Z),yield h(Promise.resolve(Ce(T,{data:v})),{optimisticData:Ce(T,{data:v}),revalidate:!1,rollbackOnError:!1})}})}function A(u,P,N){return M(this,null,function*(){if(v){let L=v.find(I=>I.flowId===u);L&&(L.stepStates[P]=N,L.flowState=bt),yield h(Promise.resolve(Ce(T,{data:v})),{optimisticData:Ce(T,{data:v}),revalidate:!1,rollbackOnError:!1})}})}function O(u,P,N){return M(this,null,function*(){if(v){let L=v.find(I=>I.flowId===u);L&&(L.lastStepId=P,L.stepStates[P]=N,L.flowState=bt),yield h(Ce(T,{data:v}),{optimisticData:Ce(T,{data:v}),revalidate:!1,rollbackOnError:!1})}})}function x(u){return M(this,null,function*(){if(v){let P=v.find(N=>N.flowId===u);P&&P.flowState!==Me&&(P.flowState=Me,P.lastStepId=ga,Object.keys(P.stepStates).forEach(N=>{P.stepStates[N].actionType=He,P.stepStates[N].createdAt=new Date().toISOString()}),yield h(Ce(T,{data:v}),{optimisticData:Ce(T,{data:v}),revalidate:!1,rollbackOnError:!1}),d(u))}})}function b(u,P){return M(this,null,function*(){if(v){let N=v.find(L=>L.flowId===u);N&&N.stepStates[P]!==He&&(N.stepStates[P]=He),yield h(Ce(T,{data:v}),{optimisticData:Ce(T,{data:v}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:v,isLoadingUserFlowStateData:!s,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:x,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:b,optimisticallyMarkStepStarted:O,error:B}}function io(){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),g=Dt();function y(h){let B=JSON.stringify(h);if(d.has(B))return null;d.add(B),s(d),m.add(h),c(m);let v=l==null?void 0:l.find(F=>F.flowSlug===h.flowSlug&&F.stepId===h.stepId&&F.actionType===h.actionType&&F.createdAt===h.createdAt);return g(`${t}flowResponses`,_(w({},e),{method:"POST",body:B})).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+h.stepId+". Will retry again later."),r([...n,h])):v||p(A=>[...A!=null?A:[],h])})}function T(h){return M(this,null,function*(){h.foreignUserId&&(h.actionType===bt||h.actionType===Me?yield y(h):h.actionType===Z?yield y(h):h.actionType===Po?yield y(h):h.actionType===Ke?yield y(h):h.actionType===ko?yield y(h):h.actionType===He&&(yield y(h)))})}function S(){let h=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let v in B.stepStates){let F=B.stepStates[v];h.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...h,...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:g,readonly:y}=ya(Q),T={data:[]},{verifySDKInitiated:S}=Ut(),{addResponse:h,getFlowResponses:B}=io(),v=C=>fetch(C,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${C} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),T)).catch(f=>(console.log(`Error fetching ${C}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),T)),{mutateUserFlowState:F,userFlowStatesData:A,isLoadingUserFlowStateData:O,optimisticallyMarkFlowCompleted:x,optimisticallyMarkFlowNotStarted:b,optimisticallyMarkStepCompleted:u,optimisticallyMarkStepNotStarted:P,optimisticallyMarkStepStarted:N}=De(),{data:L,error:I,isLoading:q}=ba(l?`${t}flows${y?"?readonly=true":""}`:null,v,{keepPreviousData:!0});Sa(()=>{if(I){console.error(I);return}L&&L.data&&i(L.data)},[L,I]);function D(C){if(q)return null;let f=o.find(k=>k.slug===C);return!f&&o.length>0&&!O&&!q?(console.log(`Flow with id ${C} not found`),null):(f==null?void 0:f.active)===!1&&!y?null:f}function j(C){var z,he;if(!D(C))return[];let f=D(C).data;return f?(f=le(f),((he=(z=nr(f))==null?void 0:z.data)!=null?he:[]).map(xe=>{let oo=J(xe);return _(w({handleSecondaryButtonClick:()=>{xe.skippable===!0&&V(C,xe.id,{skipped:!0})}},xe),{complete:ue(C,xe.id)===Ke||oo>=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:oo})}).filter(xe=>xe.hidden!==!0)):[]}function le(C){return C.replaceAll(/\${(.*?)}/g,(f,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(!D(C))return[];let f=D(C).data;return f?(f=le(f),(k=JSON.parse(f))!=null?k:{}):[]}function K(C,f){d(k=>_(w({},k),{[C]:f}))}function se(C){!O&&!q&&C&&JSON.stringify(p)!=JSON.stringify(w(w({},p),C))&&Object.keys(C).forEach(f=>{K(f,C[f])})}let de=wt((C,f,k)=>M(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:f,actionType:Po,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield N(C,f,z),h(z))}),[n,r,A]),be=wt((C,f,k)=>M(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:f,actionType:He,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield P(C,f),h(z))}),[n,r,A]),V=wt((C,f,k)=>M(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:f,actionType:Ke,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield u(C,f,z),h(z))}),[n,r,A]),Y=wt((C,f)=>M(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:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield b(C),X(k)&&h(k)}),[n,r,A]),ee=wt((C,f)=>M(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:bt,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&h(k)}),[n,r,A]),Ve=wt((C,f)=>M(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Z,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(C),h(k))}),[n,r,A]),Le=wt((C,f)=>M(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:ko,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(C),h(k))}),[n,r,A]);function X(C){var f;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&&((f=k.stepStates[C.stepId])==null?void 0:f.actionType)===C.actionType||k&&k.flowState===Z&&C.actionType===Z)return!1}return!0}function ue(C,f){let k=U(C,f);return O?null:k?k.actionType:He}function Oe(C,f){let k=U(C,f);return k?k.blocked:!1}function we(C,f){let k=U(C,f);return k?k.hidden:!1}function U(C,f){var z;if(O)return null;let k=A==null?void 0:A.find(he=>he.flowId===C);return!k||!k.stepStates[f]?null:(z=k.stepStates[f])!=null?z:null}function $(C){var k,z;if(O||!A)return null;if(fe(C)===Me)return(k=j(C)[0])!=null?k:null;let f=(z=A.find(he=>he.flowId===C))==null?void 0:z.lastStepId;return f?j(C).find(he=>he.id===f):null}function W(C){var z;let f=$(C);if(!f)return 0;let k=(z=j(C).findIndex(he=>he.id===f.id))!=null?z:0;return ue(C,f.id)===Ke&&k<j(C).length-1?k+1:k}function J(C){if(!C.completionCriteria)return;let f=ai(C.completionCriteria);if(f===null)return;let k=$e(f),z=Ge(f);return z===0?void 0:k/z}function fe(C){let f=A==null?void 0:A.find(k=>k.flowId===C);return f?f.flowState:null}function $e(C){let f=j(C);return f.length===0?0:f.filter(z=>ue(C,z.id)===Ke).length}function Ge(C){return j(C).length}function Xe(C){let f=o.find(k=>k.slug===C);return f?nr(f.data):null}function St(C){if(y)return!1;if(O)return!0;if(C!=null&&C.targetingLogic&&A){let f=A.find(k=>k.flowId===C.slug);if(f)return f.shouldTrigger===!1}return!!(C!=null&&C.targetingLogic&&n&&n.startsWith("guest_"))}function Lt(C){return!St(D(C))}function $t(){n&&F()}return{getFlow:D,getFlowData:Xe,isLoading:O||q,getStepStatus:ue,getFlowSteps:j,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:K,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 no(){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=>M(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(h=>w(w({},h),T)),p()}),[e,r,n,p]),g=lr((T,S)=>M(this,null,function*(){if(!s())return;let B={foreignId:e,events:[{event:T,properties:S}]};yield d(`${l}users`,_(w({},r),{method:"POST",body:JSON.stringify(B)})),p()}),[e,r,p]),y=lr((T,S)=>M(this,null,function*(){if(s())if(S){let h=m(T);localStorage.setItem(h,"true"),o(T);let B={foreignId:T,properties:S};yield d(`${l}users`,_(w({},r),{method:"POST",body:JSON.stringify(B)})),i(v=>w(w({},v),S)),p()}else o(T)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}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 Ao from"styled-components";import Fa from"react";import ka from"styled-components";var pi="fr-",so="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+" "+so+e}return o}function E(e){if(!e.className||e.className.indexOf(so)!==-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 vo(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=>`${vo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function lo(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=>E(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 Bo=rt.div`
|
|
31
|
+
${e=>E(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=>E(e)} {
|
|
62
62
|
${e=>e.hasImage?Aa:Oa};
|
|
63
63
|
}
|
|
64
64
|
`,ui=rt.img`
|
|
65
|
-
${e=>
|
|
65
|
+
${e=>E(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=>E(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
76
76
|
height: auto;
|
|
@@ -82,9 +82,9 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
82
82
|
flex-direction: row;
|
|
83
83
|
justify-content: space-between;
|
|
84
84
|
align-content: center;
|
|
85
|
-
`,xi=rt.div`
|
|
86
|
-
padding: 22px 22px 12px;
|
|
87
85
|
`,hi=rt.div`
|
|
86
|
+
padding: 22px 22px 12px;
|
|
87
|
+
`,xi=rt.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
flex: 1;
|
|
90
90
|
flex-direction: column;
|
|
@@ -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=>E(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=>E(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(Bo)`
|
|
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 Eo({appearance:e}){return Ti.createElement(wi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Ti.createElement(ci,null))}var La=Ao.div`
|
|
147
|
+
${e=>E(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 */
|
|
@@ -157,7 +157,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
157
157
|
|
|
158
158
|
width: ${e=>{var t;return(t=e.width)!=null?t:"1000px"}};
|
|
159
159
|
z-index: 1500;
|
|
160
|
-
border-radius: ${e=>{var t,o,
|
|
160
|
+
border-radius: ${e=>{var t,o,i;return(i=(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)!=null?i:8}}px;
|
|
161
161
|
${e=>ke(e)}
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -185,27 +185,27 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
185
185
|
opacity: 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
|
|
188
|
+
`,$a=Ao.div`
|
|
189
189
|
position: relative;
|
|
190
190
|
flex: 0 1 auto;
|
|
191
|
-
|
|
191
|
+
`,Ma=Ao.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=>E(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
|
-
`,
|
|
201
|
+
`,Da=Ao.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:
|
|
208
|
+
`,Qe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=Ia("");return cr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");s(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:()=>{l&&e()}}),qe.createElement(La,{appearance:r,className:a("modalContainer",r),styleOverrides:i},l&&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(Eo,{appearance:r})))):qe.createElement(qe.Fragment,null)};import ut,{useEffect as mr,useState as Ua}from"react";import Oo 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=Oo.div`
|
|
218
|
+
${e=>E(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=Oo.div`
|
|
234
234
|
position: relative;
|
|
235
235
|
flex: 1;
|
|
236
|
-
`,ja=
|
|
236
|
+
`,ja=Oo.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=>E(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=Oo.div`
|
|
247
247
|
overflow: scroll;
|
|
248
248
|
flex: 5;
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,
|
|
253
|
-
${e=>
|
|
252
|
+
`,Io=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:l=!0})=>{let[p,d]=Ua("");return mr(()=>{let s=getComputedStyle(document.body).getPropertyValue("overflow");d(s)},[]),mr(()=>{let s=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[e]),mr(()=>{let s=document.body.style;return t?s.setProperty("overflow","hidden"):s.setProperty("overflow",p),()=>{s.setProperty("overflow",p)}},[t]),t?ut.createElement(Wa,null,ut.createElement(_a,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},l&&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,l;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,(l=o.theme)!=null?l:{})}:i}return{mergeAppearanceWithDefault:t}}import Tt,{useContext as up,useEffect as zi,useState as wr}from"react";import Do from"styled-components";import $o,{useEffect as Ei,useState as gr}from"react";import hr from"styled-components";import No from"styled-components";var Fi=No.label`
|
|
253
|
+
${e=>E(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=No.label`
|
|
264
|
+
${e=>E(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=No.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
|
+
`,Lo=No.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
|
|
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(Lo,{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(Lo,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,l,p,d;try{if(t){if(t.type=="number"){let s=fr.number();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?s=s.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?s=s.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(s=s.nonpositive((r=m.message)!=null?r:"Value must be negative"));s.parse(Number(e))}if(t.type=="string"){let s=fr.string();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(l=m.message)!=null?l:"Value is too short"):m.requirement=="max"?s=s.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(s=s.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));s.parse(e)}return}}catch(s){if(s instanceof fr.ZodError)return s.issues&&s.issues.length>0?s.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,s)}return null}var Ka=hr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
|
-
`,hr
|
|
288
|
-
${e=>
|
|
287
|
+
`,xr=hr.input`
|
|
288
|
+
${e=>E(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;
|
|
@@ -300,8 +300,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
300
300
|
box-sizing: border-box;
|
|
301
301
|
padding: 0 10px;
|
|
302
302
|
margin-bottom: 10px;
|
|
303
|
-
`,qa=
|
|
304
|
-
${e=>
|
|
303
|
+
`,qa=hr.textarea`
|
|
304
|
+
${e=>E(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:
|
|
319
|
+
`;function Cr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[l,p]=gr((n==null?void 0:n.text)||""),[d,s]=gr(!1),[m,c]=gr(!1),g=xr;Ei(()=>{l===""&&!d&&(s(!0),y(""))},[]),Ei(()=>{if(m){y(l);return}},[m]);function y(S){var B;if(p(S),o({text:S}),r.required===!0&&S.trim()===""){i([{id:r.id,message:`${(B=r.title)!=null?B:"Field"} is required`,hidden:!m}]);return}let h=Bi(S,r.validation);if(h&&(S.trim()!==""||r.required===!0)){i([{id:r.id,message:h,hidden:!m}]);return}i([])}r.multiline&&(g=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 $o.createElement(Ka,null,$o.createElement(ft,{title:r.title,required:r.required,appearance:t.appearance}),$o.createElement(g,{className:a("inputComponent",t.appearance),value:l,onChange:S=>{y(S.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:T(),onBlur:()=>{c(!0)}}),$o.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=>E(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;
|
|
@@ -335,7 +335,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
335
335
|
|
|
336
336
|
padding: 0 10px;
|
|
337
337
|
margin-bottom: 10px;
|
|
338
|
-
color: ${e=>{var t,o,n
|
|
338
|
+
color: ${e=>{var t,o,i,n;return e.value==""?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextDisabled:(n=(i=e.appearance)==null?void 0:i.theme)==null?void 0:n.colorText}};
|
|
339
339
|
|
|
340
340
|
appearance: none;
|
|
341
341
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'><path stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/></svg>");
|
|
@@ -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:
|
|
346
|
+
`;function Ni({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,g,y,T,S,h,B,v;let r=e,[l,p]=Oi(!1),[d,s]=Oi(!1);return Ai(()=>{var F,A,O,x;if(!((F=i==null?void 0:i.choice)!=null&&F[0])&&!l){if(p(!0),r.requireSelection){o({choice:[yr]});return}if(r.defaultValue&&((A=r.props.options)!=null&&A.find(b=>b.id===r.defaultValue))){let b=(O=r.props.options)==null?void 0:O.find(u=>u.id===r.defaultValue);o({choice:[b.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=>{s(!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},(g=r.placeholder)!=null?g:"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:(v=(B=(h=r.props.options)==null?void 0:h.find(F=>{var A;return F.id===((A=i==null?void 0:i.choice)==null?void 0:A[0])}))==null?void 0:B.openEndedLabel)!=null?v:"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 co,{useEffect as Sr,useState as $i}from"react";import Mi from"styled-components";import po from"react";import ao 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 ao.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:l})=>ao.createElement("svg",{style:l,className:r,width:t,height:t,overflow:"visible"},ao.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},ao.createElement(Li,{color:n,size:t}),ao.createElement(Li,{color:e,percentage:o,size:t})),i),_t=Ja;import Qa from"styled-components";var Za=({color:e="#FFFFFF"})=>po.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},po.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:
|
|
348
|
+
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=it,style:r,className:l})=>{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?po.createElement(_t,{fillColor:o,percentage:i,size:22}):po.createElement(lp,{styleOverrides:p,style:r,role:"checkbox",className:Te(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",l)},e&&po.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
|
-
`,pp
|
|
355
|
-
${e=>
|
|
354
|
+
`,pp=Mi.button`
|
|
355
|
+
${e=>E(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
|
|
380
|
-
${e=>
|
|
379
|
+
`;function Di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[l,p]=$i((i==null?void 0:i.choice)||[]),[d,s]=$i(!1);return Sr(()=>{l.length==0&&!d&&(s(!0),o({choice:[]}))},[]),Sr(()=>{o({choice:l})},[l]),Sr(()=>{r.required&&(l.length<r.props.minChoices||l.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[l]),co.createElement(ap,null,co.createElement(ft,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>co.createElement(pp,{appearance:t.appearance,className:a(l.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":l.includes(c.id),onClick:()=>{if(l.includes(c.id)){p(l.filter(g=>g!==c.id));return}l.length<r.props.maxChoices?p([...l,c.id]):l.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,co.createElement(nt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:l.includes(c.id),appearance:t.appearance}))),co.createElement(zt,{title:r.subtitle,appearance:t.appearance}))}import Mo 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=>E(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=>E(e)} {
|
|
393
393
|
font-style: normal;
|
|
394
394
|
font-weight: 400;
|
|
395
395
|
font-size: 14px;
|
|
@@ -397,38 +397,38 @@ 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:
|
|
400
|
+
`;function Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return Mo.createElement(Mo.Fragment,null,Mo.createElement(cp,{appearance:e,className:a(`${n}${n?lo(i):i}Title`,e),dangerouslySetInnerHTML:ce(t),size:i}),o&&Mo.createElement(mp,{appearance:e,className:a(`${n}${n?lo(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=Do.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=Do.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
|
-
`,
|
|
412
|
+
`,hp=Do.div`
|
|
413
413
|
margin-right: 4px;
|
|
414
414
|
display: inline-flex;
|
|
415
|
-
`,
|
|
415
|
+
`,xp=Do.div`
|
|
416
416
|
padding-left: 1px;
|
|
417
417
|
padding-right: 1px;
|
|
418
|
-
`,Cp={text:Cr,multipleChoice:Ni,multipleChoiceList:
|
|
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:l,prefillData:p}){var O;let d=t.props,[s,m]=wr([]),[c,g]=wr([]),{userId:y}=no(),[T,S]=wr(F()||(p?p[t.id]:null)||{}),{readonly:h}=up(Q),B=w(w({},Cp),l);zi(()=>{i(s.length===0)},[s,i]),zi(()=>{n(T)},[T]);function v(x,b){S(u=>{let P=_(w({},u),{[x.id]:b});return window&&window.localStorage&&!h&&window.localStorage.setItem(A(),JSON.stringify(P)),P})}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)},(O=d.data)==null?void 0:O.map(x=>{let b=s.reverse().find(u=>u.id===x.id);return B[x.type]?Tt.createElement("span",{key:x.id,"data-field-id":x.id,className:a("multiInputField",r)},B[x.type]({formInput:x,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:u=>{!c.includes(x.id)&&u&&(u==null?void 0:u.text)!==""&&g(P=>[...P,x.id]),v(x,u)},inputData:T[x.id],setFormValidationErrors:u=>{u.length===0&&s.length===0||m(P=>u.length===0?P.filter(N=>N.id!==x.id):[...P,...u])}}),b&&b.message&&c.includes(x.id)&&b.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)),b.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"};
|
|
422
422
|
padding-top: 14px;
|
|
423
|
-
`,ji=
|
|
423
|
+
`,ji=Ht.div`
|
|
424
424
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
425
425
|
font-size: 12px;
|
|
426
|
-
`,Vi=
|
|
426
|
+
`,Vi=Ht.div`
|
|
427
427
|
display: flex;
|
|
428
428
|
gap: 12px;
|
|
429
429
|
width: 100%;
|
|
430
430
|
justify-content: flex-end;
|
|
431
|
-
`,Gi=
|
|
431
|
+
`,Gi=Ht.div`
|
|
432
432
|
display: flex;
|
|
433
433
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
434
434
|
// Otherwise, use 4px padding
|
|
@@ -436,11 +436,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
436
436
|
flex-grow: 1;
|
|
437
437
|
flex-basis: 0;
|
|
438
438
|
position: relative;
|
|
439
|
-
`,Ki=
|
|
439
|
+
`,Ki=Ht.div`
|
|
440
440
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
441
441
|
position: relative;
|
|
442
442
|
overflow-y: auto;
|
|
443
|
-
`,qi=
|
|
443
|
+
`,qi=Ht.div`
|
|
444
444
|
display: flex;
|
|
445
445
|
align-self: stretch;
|
|
446
446
|
flex-grow: 1;
|
|
@@ -452,7 +452,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
452
452
|
background-position: center;
|
|
453
453
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
454
454
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
455
|
-
`;import
|
|
455
|
+
`;import gt from"react";import Xi from"react";import Ji from"styled-components";import yp from"styled-components";var Yi=yp.div`
|
|
456
456
|
width: 24px;
|
|
457
457
|
height: 24px;
|
|
458
458
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -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=>E(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"};
|
|
@@ -482,8 +482,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
482
482
|
${e=>e.withMargin?"margin: 16px 0px 16px 0px;":""}
|
|
483
483
|
|
|
484
484
|
border: 1px solid ${e=>{var t,o;return e.secondary?"#C5CBD3":(o=(t=e==null?void 0:e.appearance)==null?void 0:t.theme)==null?void 0:o.colorPrimary}};
|
|
485
|
-
color: ${e=>{var t,o,n
|
|
486
|
-
background-color: ${e=>{var t,o,n
|
|
485
|
+
color: ${e=>{var t,o,i,n;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText:(n=(i=e.appearance)==null?void 0:i.theme)==null?void 0:n.colorTextOnPrimaryBackground}};
|
|
486
|
+
background-color: ${e=>{var t,o,i,n;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground:(n=(i=e==null?void 0:e.appearance)==null?void 0:i.theme)==null?void 0:n.colorPrimary}};
|
|
487
487
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
488
488
|
padding: ${e=>e.size=="small"?"6px 14px 6px 14px":"8px 20px 8px 20px"};
|
|
489
489
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
@@ -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
|
+
`,Uo=Ji.div`
|
|
507
|
+
${e=>E(e)} {
|
|
508
508
|
display: flex;
|
|
509
509
|
flex-direction: row;
|
|
510
510
|
justify-content: flex-start;
|
|
@@ -514,14 +514,14 @@ 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:
|
|
517
|
+
`,oe=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:l=!1,appearance:p,withMargin:d=!0,classPrefix:s="",loading:m=!1})=>{var g;function c(){let y=l?"buttonSecondary":"button";return s===""?y:`${s}${lo(y)}`}return Xi.createElement(Sp,{secondary:l,appearance:p,disabled:i||m,loading:(g=m==null?void 0:m.toString())!=null?g:"",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:l,onBack:p,allowBackNavigation:d,errorMessage:s,isSaving:m})=>{var y;let c=l.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return gt.createElement(gt.Fragment,null,s!==null&&s!=null&>.createElement(ji,{appearance:o,className:a("formCTAError",o)},s),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:g,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:g,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?gt.createElement(oe,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,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:
|
|
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,l)=>Fr.createElement("rect",{key:l,x:16*l,y:0,width:8,height:8,rx:4,fill:t===l?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 l=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(l="_self"),e.navigate(n,l)}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;
|
|
523
523
|
justify-content: center;
|
|
524
|
-
`,kp=
|
|
524
|
+
`,kp=jt.div`
|
|
525
525
|
align-content: center;
|
|
526
526
|
align-items: center;
|
|
527
527
|
display: flex;
|
|
@@ -535,10 +535,10 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
535
535
|
flex-basis: 255px;
|
|
536
536
|
flex-grow: 0;
|
|
537
537
|
flex-shrink: 0;
|
|
538
|
-
`,Pp=
|
|
538
|
+
`,Pp=jt.img`
|
|
539
539
|
width: 78px;
|
|
540
540
|
height: auto;
|
|
541
|
-
`,vp=
|
|
541
|
+
`,vp=jt.button`
|
|
542
542
|
font-style: normal;
|
|
543
543
|
font-weight: 600;
|
|
544
544
|
font-size: 13px;
|
|
@@ -551,11 +551,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
551
551
|
border-radius: 100px;
|
|
552
552
|
padding: 8px 12px;
|
|
553
553
|
margin-top: 16px;
|
|
554
|
-
`,Bp=
|
|
554
|
+
`,Bp=jt.h1`
|
|
555
555
|
font-weight: 700;
|
|
556
556
|
font-size: 28px;
|
|
557
557
|
line-height: 34px;
|
|
558
|
-
`,Ep=
|
|
558
|
+
`,Ep=jt.h2`
|
|
559
559
|
font-style: normal;
|
|
560
560
|
font-weight: 400;
|
|
561
561
|
font-size: 16px;
|
|
@@ -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 n
|
|
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 l;r.uri&&o(r.uri,(l=r.uriTarget)!=null?l:"_blank")}},r.title)))))}import Vt,{useEffect as Mp}from"react";import _o from"styled-components";import kr from"react";var Wo=({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 mo,{useRef as Ap,useState as Op}from"react";import zo from"styled-components";var Ip=zo.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=zo.div`
|
|
576
576
|
position: absolute;
|
|
577
577
|
display: flex;
|
|
578
578
|
align-items: center;
|
|
@@ -591,40 +591,40 @@ 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=zo.video`
|
|
595
595
|
width: 100%;
|
|
596
596
|
height: 100%;
|
|
597
597
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
598
|
-
|
|
598
|
+
`,$p=zo.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
|
-
`;function Re({appearance:e,videoUri:t}){let o=Ap(),[n
|
|
604
|
-
${e=>
|
|
603
|
+
`;function Re({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),mo.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})}return mo.createElement(Ip,{className:a("videoPlayerWrapper",e),appearance:e},!i&&mo.createElement(Np,{onClick:()=>{n(!0),o.current.play()},appearance:e},mo.createElement(Wo,null)),mo.createElement(Lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Dp=_o.div`
|
|
604
|
+
${e=>E(e)} {
|
|
605
605
|
display: flex;
|
|
606
606
|
flex-direction: column;
|
|
607
607
|
justify-content: center;
|
|
608
608
|
}
|
|
609
|
-
`,Up=
|
|
610
|
-
${e=>
|
|
609
|
+
`,Up=_o.img`
|
|
610
|
+
${e=>E(e)} {
|
|
611
611
|
width: 100%;
|
|
612
612
|
height: auto;
|
|
613
613
|
max-height: 250px;
|
|
614
614
|
margin-bottom: 24px;
|
|
615
615
|
}
|
|
616
|
-
`,Wp=
|
|
617
|
-
${e=>
|
|
616
|
+
`,Wp=_o.div`
|
|
617
|
+
${e=>E(e)} {
|
|
618
618
|
margin-bottom: 24px;
|
|
619
619
|
}
|
|
620
|
-
`,zp=
|
|
621
|
-
${e=>
|
|
620
|
+
`,zp=_o.div`
|
|
621
|
+
${e=>E(e)} {
|
|
622
622
|
width: 100%;
|
|
623
623
|
height: auto;
|
|
624
624
|
max-height: 250px;
|
|
625
625
|
margin-bottom: 24px;
|
|
626
626
|
}
|
|
627
|
-
`;function en({stepData:e,appearance:t,setCanContinue:o}){return
|
|
627
|
+
`;function en({stepData:e,appearance:t,setCanContinue:o}){return Mp(()=>{o(!0)},[]),Vt.createElement(Dp,{className:a("callToActionContainer",t)},Vt.createElement(Wp,{className:a("callToActionTextContainer",t)},Vt.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Vt.createElement(Up,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Vt.createElement(zp,{appearance:t,className:a("callToActionVideo",t)},Vt.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
628
|
width: auto;
|
|
629
629
|
display: flex;
|
|
630
630
|
flex-direction: column;
|
|
@@ -677,8 +677,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
677
677
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
678
678
|
display: flex;
|
|
679
679
|
align-self: center;
|
|
680
|
-
`;var dn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:
|
|
681
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map(([n,i])=>typeof i=="object"?`${n} { ${Object.entries(i).map(([s,p])=>`${Bo(s)}: ${p};`).join(" ")} }`:`${Bo(n)}: ${i};`).join(" ")} }`).join(" ")}`;function ie({appearance:e}){if(!e||!e.styleOverrides)return go.createElement(go.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,n])=>typeof n=="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:n,setVisible:i,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:F="center",repeatable:S=!1,onDismiss:x,showPagination:v=!1,allowBackNavigation:b=!1,validationHandler:E,showFrigadeBranding:A=!1,onFormDataChange:O,showFooter:h=!0,prefillData:w={},updateUrlOnPageChange:f=!1})=>{var D;let{getFlow:P,getFlowSteps:N,isLoading:L,targetingLogicShouldHideFlow:I,getFlowStatus:q,getCurrentStepIndex:M,markFlowCompleted:j,markFlowNotStarted:le,markStepStarted:pe}=R(),K=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]=n!==void 0&&i!==void 0?[n,i]:[Ve(e,!0),W=>ee(e,W)];if(mn(()=>{!de&&!L&&(be(!0),(q(e)===Z&&S||q(e)===$e)&&(q(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 De=W;fe=X.findIndex(Ge=>Ge.id===De),V===W&&(fe=-1),Y(W)}else fe=0,Y("");fe!==-1&&pe(e,X[fe].id)}},[X,(D=window==null?void 0:window.location)==null?void 0:D.hash]),L)return null;let we=P(e);if(!we||I(we)||!X||n!==void 0&&n===!1||q(e)===Z&&l||(o=="modal"||o=="corner-modal")&&Le(e))return null;let U=()=>{Oe(!1),x&&x(),y===!0&&j(e)};if(F=="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:g,showFrigadeBranding:A},et.createElement(ie,{appearance:d}),et.createElement(jo,{appearance:d,steps:X,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:Oe,onDismiss:x,showPagination:v,customFormElements:s,allowBackNavigation:b,validationHandler:E,onFormDataChange:O,showFooter:h,prefillData:w,updateUrlOnPageChange:f}))}return o==="modal"&&F!=="center"?et.createElement(No,{appearance:d,onClose:U,visible:ue,modalPosition:F},et.createElement(ie,{appearance:d}),et.createElement(jo,{appearance:d,steps:X,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:Oe,onDismiss:x,showPagination:v,customFormElements:s,allowBackNavigation:b,validationHandler:E,onFormDataChange:O,showFooter:h,prefillData:w,updateUrlOnPageChange:f})):et.createElement(et.Fragment,null,et.createElement(ie,{appearance:d}),et.createElement(jo,{appearance:d,steps:X,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:Oe,onDismiss:x,showPagination:v,customFormElements:s,allowBackNavigation:b,validationHandler:E,onFormDataChange:O,showFooter:h,prefillData:w,updateUrlOnPageChange:f}))},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:n}=Me(),{config:i,apiUrl:r}=Je(),s=Ut(),{verifySDKInitiated:p}=Wt();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Gp(()=>{if(t&&e){if(t.startsWith(zt))return;let g=d(t,e);localStorage.getItem(g)||(s(`${r}userGroups`,_(T({},i),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let l=Br(g=>$(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield s(`${r}userGroups`,_(T({},i),{method:"POST",body:JSON.stringify(y)})),n()}),[e,t,i,n]),m=Br((g,y)=>$(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:g,properties:y}]};yield s(`${r}userGroups`,_(T({},i),{method:"POST",body:JSON.stringify(S)})),n()}),[e,t,i,n]),c=Br((g,y)=>$(this,null,function*(){if(p())if(y){let F=d(t,g);localStorage.setItem(F,"true"),o(g);let S={foreignUserId:t,foreignUserGroupId:g,properties:y};yield s(`${r}userGroups`,_(T({},i),{method:"POST",body:JSON.stringify(S)})),n()}else o(g)}),[t,i,n]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var xn="frigade-xFrigade_guestUserId",ho="frigade-xFrigade_userId",hn=({})=>{let{setFlowResponses:e}=no(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=Me(),{userId:i,setUserId:r}=so(),[s,p]=Vo(i),{getFlowStatus:d}=R(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Kp(Q),[y,F]=Vo([]),[S,x]=Vo([]),{organizationId:v}=Er(),[b,E]=Vo(v);xo(()=>{if(!o&&t)for(let w=0;w<t.length;w++){let f=t[w],P=l.find(N=>N.slug===(f==null?void 0:f.flowId));if(P&&f&&f.shouldTrigger===!0&&P.type=="FORM"&&P.triggerType==="AUTOMATIC"&&!S.includes(P.slug)){setTimeout(()=>{A(f.flowId)},500);break}}},[o,t]),xo(()=>{g.length>0&&n()},[g]);function A(w){let f=l.find(P=>P.slug===w);f&&f.triggerType==="AUTOMATIC"&&!S.includes(f.slug)&&(x([...S,f.slug]),F([f]))}function O(){if(!i){let w=localStorage.getItem(ho);if(w){r(w);return}let f=localStorage.getItem(xn);if(f){r(f);return}c(!0);let P=zt+qp();try{localStorage.setItem(xn,P)}catch(N){console.log("Failed to save guest user id locally: Local storage unavailable",N)}r(N=>N||P)}}xo(()=>{try{if(l){let w=[];l.forEach(f=>{if(f.data){let P=f.data.match(/"imageUri":"(.*?)"/g);P&&P.forEach(N=>{let L=N.replace('"imageUri":"',"").replace('"',"");if(w.includes(L))return;let I=new Image;I.src=L,w.push(L)})}})}}catch(w){}},[l]),xo(()=>{if(i!==s&&(e([]),n()),p(i),i&&!i.startsWith(zt))try{localStorage.setItem(ho,i)}catch(w){console.log("Failed to save user id locally: Local storage available",w)}i===null&&setTimeout(()=>{i===null&&O()},50)},[i,l,m]),xo(()=>{v!=b&&(E(v),e([]),n())},[v,b,E]);function h(){return Pt.createElement(Pt.Fragment,null,y.map(w=>d(w.slug)!==$e?null:Pt.createElement("span",{key:w.slug},Pt.createElement(gn,{flowId:w.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Pt.createElement(Pt.Fragment,null,Pt.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,n])=>{if(Cn[o]){let i=Cn[o].split("."),r=t;i.forEach((s,p)=>{r[s]||(r[s]=p===i.length-1?n:{}),r=r[s]})}}),t}function Xp(e){if(!e)return;let t=Ce({},e),o={};return Object.keys(t).forEach(n=>{let i=`.fr-${n}`;o[i]=t[n]}),o}function yn(e){let{theme:t,styleOverrides:o}=e,n=Yp(t),i=Xp(o);return{overrides:n,css:i}}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=i=>{var r=i,{as:e,children:t,overrides:o}=r,n=Ie(r,["as","children","overrides"]);let s=Zp(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Sn.createElement(ad,T(T({as:e},p),n),t);if(o!==void 0){let l=Ce(s,o);return Sn.createElement(Qp,{theme:l},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 Go={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,xd=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:_(T({},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:xd,components:{Button:yo,Text:Go}};var Pn="https://api.frigade.com",Q=hd({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:n,children:i})=>{var K,se,de,be,V;let[r,s]=je(t||null),[p,d]=je(o||null),[l,m]=je([]),[c,g]=je([]),[y,F]=je([]),[S,x]=je({}),[v,b]=je({}),[E,A]=je([]),[O,h]=je({}),[w,f]=je(!1),[P,N]=je(!1),[L,I]=je(!j(e)),q=(Y,ee)=>{if(ee==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},M={theme:T(T({},it.theme),(se=(K=n==null?void 0:n.defaultAppearance)==null?void 0:K.theme)!=null?se:{}),styleOverrides:T(T({},it.styleOverrides),(be=(de=n==null?void 0:n.defaultAppearance)==null?void 0:de.styleOverrides)!=null?be:{})};function j(Y){return!!(Y&&Y.length>10&&Y.substring(0,10)==="api_public")}Ko(()=>{t&&s(t)},[t]),Ko(()=>{r&&window&&window.localStorage&&window.localStorage.getItem(ho)&&window.localStorage.getItem(ho)!==r&&Sd()},[r]),Ko(()=>{o&&d(o)},[o]),Ko(()=>{if(j(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let le={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:F,userProperties:S,setUserProperties:x,openFlowStates:v,setOpenFlowStates:b,completedFlowsToKeepOpenDuringSession:E,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:O,setCustomVariables:h,isNewGuestUser:w,setIsNewGuestUser:f,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:N,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:q,defaultAppearance:M,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:I,apiUrl:n&&n.apiUrl?n.apiUrl:Pn,readonly:n&&n.readonly?n.readonly:!1,debug:n&&n.debug?n.debug:!1};if(L)return vt.createElement(Q.Provider,{value:le},i);let{overrides:pe}=yn(M);return vt.createElement(yd,{fallback:vt.createElement(vt.Fragment,null,i)},vt.createElement(Q.Provider,{value:le},vt.createElement(Cd,{theme:Ce(M.theme,Ar,pe!=null?pe:{},(V=n==null?void 0:n.theme)!=null?V:{})},i,vt.createElement(hn,null))))};import pc from"react";import ye,{useEffect as ol,useState as rl}from"react";import Ye,{useState as Wd}from"react";import At from"styled-components";import Xo from"react";import Bt from"react";import Bn from"styled-components";var vn=Bn.span`
|
|
680
|
+
`;var dn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=vr([]),[p,d]=vr(!1),[s,m]=vr(e.id);return Pr(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Pr(()=>{s!==e.id&&(m(e.id),l([]))},[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,g)=>{let y=r.includes(c.id);return st.createElement(sn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){l(r.filter(T=>T!==c.id));return}r.length<n.maxChoices?l([...r,c.id]):r.length==1&&n.maxChoices==1&&l([c.id])},hideBottomBorder:g===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-${g}`}),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 uo}from"react";var _p=({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),Ho=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:l,flowId:p,type:d,hideOnFlowCompletion:s,onComplete:m,setVisible:c,setShowModal:g,onDismiss:y,showPagination:T=!1,customFormElements:S,allowBackNavigation:h,validationHandler:B,onFormDataChange:v,showFooter:F,prefillData:A,updateUrlOnPageChange:O})=>{var U;let b=w(w({},{linkCollection:Ri,multiInput:_i,callToAction:en,selectList:dn}),i),{primaryCTAClickSideEffects:u,secondaryCTAClickSideEffects:P}=ae(),[N,L]=uo(!1),[I,q]=uo({}),[D,j]=uo(!1),[le,pe]=uo(!1),[K,se]=uo(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(()=>{v&&v(I,Le(),t[o],o)},[I]);function Le(){var W;return{data:(W=I[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 l&&l($,J,fe,I,Le()),r?r($,o,W,fe):!0}function ue($,W){q(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&&!D,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>M(void 0,null,function*(){if(j(!0),B){let J=yield B(t[o],o,t[o+1],I,Le());if(J!==!0){se(typeof J=="string"?J:null),j(!1);return}else se(null)}let $=w({},Le());yield be(p,t[o].id,$),o+1<t.length&&!h&&(yield V(p,t[o+1].id));let W=X(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),y&&y(),s&&W&&(c&&c(!1),g(!1)),yield Ve(p)),u(t[o]),j(!1),h&&o+1<t.length&&(window.location.hash=t[o+1].id),window&&!h&&O&&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),P(t[o])},onBack:()=>M(void 0,null,function*(){o-1>=0&&(j(!0),h&&(window.location.hash=t[o-1].id),yield V(p,t[o-1].id),j(!1))}),steps:t,allowBackNavigation:h,errorMessage:K,isSaving:D});return Ue.createElement(Ue.Fragment,null,Ue.createElement(Gi,{className:a("formContainer",e)},Ue.createElement(_p,{id:o,shouldWrap:d==="large-modal"},Ue.createElement(Ki,{key:de.id,type:d,className:a("formContent",e)},t.map($=>{let W=b[$.type];return de.id!==$.id?null: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 fo from"react";import{createGlobalStyle as Hp}from"styled-components";var jp=Hp`
|
|
681
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${so}${t}.${so}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${vo(l)}: ${p};`).join(" ")} }`:`${vo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ie({appearance:e}){if(!e||!e.styleOverrides)return fo.createElement(fo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?fo.createElement(fo.Fragment,null):fo.createElement(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:g=!0,endFlowOnDismiss:y=!1,modalPosition:T="center",repeatable:S=!1,onDismiss:h,showPagination:B=!1,allowBackNavigation:v=!1,validationHandler:F,showFrigadeBranding:A=!1,onFormDataChange:O,showFooter:x=!0,prefillData:b={},updateUrlOnPageChange:u=!1})=>{var $;let{getFlow:P,getFlowSteps:N,isLoading:L,targetingLogicShouldHideFlow:I,getFlowStatus:q,getCurrentStepIndex:D,markFlowCompleted:j,markFlowNotStarted:le,markStepStarted:pe}=R(),K=D(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),(q(e)===Z&&S||q(e)===Me)&&(q(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=P(e);if(!we||I(we)||!X||i!==void 0&&i===!1||q(e)===Z&&s||(o=="modal"||o=="corner-modal")&&Le(e))return null;let U=()=>{Oe(!1),h&&h(),y===!0&&j(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:g,showFrigadeBranding:A},et.createElement(ie,{appearance:d}),et.createElement(Ho,{appearance:d,steps:X,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:h,showPagination:B,customFormElements:l,allowBackNavigation:v,validationHandler:F,onFormDataChange:O,showFooter:x,prefillData:b,updateUrlOnPageChange:u}))}return o==="modal"&&T!=="center"?et.createElement(Io,{appearance:d,onClose:U,visible:ue,modalPosition:T},et.createElement(ie,{appearance:d}),et.createElement(Ho,{appearance:d,steps:X,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:h,showPagination:B,customFormElements:l,allowBackNavigation:v,validationHandler:F,onFormDataChange:O,showFooter:x,prefillData:b,updateUrlOnPageChange:u})):et.createElement(et.Fragment,null,et.createElement(ie,{appearance:d}),et.createElement(Ho,{appearance:d,steps:X,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:h,showPagination:B,customFormElements:l,allowBackNavigation:v,validationHandler:F,onFormDataChange:O,showFooter:x,prefillData:b,updateUrlOnPageChange:u}))},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(g,y){return`frigade-user-group-registered-${g}-${y}`}Gp(()=>{if(t&&e){if(t.startsWith(Wt))return;let g=d(t,e);localStorage.getItem(g)||(l(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let s=Br(g=>M(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield l(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Br((g,y)=>M(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield l(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),c=Br((g,y)=>M(this,null,function*(){if(p())if(y){let T=d(t,g);localStorage.setItem(T,"true"),o(g);let S={foreignUserId:t,foreignUserGroupId:g,properties:y};yield l(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var hn="frigade-xFrigade_guestUserId",ho="frigade-xFrigade_userId",xn=({})=>{let{setFlowResponses:e}=io(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=no(),[l,p]=jo(n),{getFlowStatus:d}=R(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Kp(Q),[y,T]=jo([]),[S,h]=jo([]),{organizationId:B}=Er(),[v,F]=jo(B);go(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let u=t[b],P=s.find(N=>N.slug===(u==null?void 0:u.flowId));if(P&&u&&u.shouldTrigger===!0&&P.type=="FORM"&&P.triggerType==="AUTOMATIC"&&!S.includes(P.slug)){setTimeout(()=>{A(u.flowId)},500);break}}},[o,t]),go(()=>{g.length>0&&i()},[g]);function A(b){let u=s.find(P=>P.slug===b);u&&u.triggerType==="AUTOMATIC"&&!S.includes(u.slug)&&(h([...S,u.slug]),T([u]))}function O(){if(!n){let b=localStorage.getItem(ho);if(b){r(b);return}let u=localStorage.getItem(hn);if(u){r(u);return}c(!0);let P=Wt+qp();try{localStorage.setItem(hn,P)}catch(N){console.log("Failed to save guest user id locally: Local storage unavailable",N)}r(N=>N||P)}}go(()=>{try{if(s){let b=[];s.forEach(u=>{if(u.data){let P=u.data.match(/"imageUri":"(.*?)"/g);P&&P.forEach(N=>{let L=N.replace('"imageUri":"',"").replace('"',"");if(b.includes(L))return;let I=new Image;I.src=L,b.push(L)})}})}}catch(b){}},[s]),go(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Wt))try{localStorage.setItem(ho,n)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}n===null&&setTimeout(()=>{n===null&&O()},50)},[n,s,m]),go(()=>{B!=v&&(F(B),e([]),i())},[B,v,F]);function x(){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(x,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))),xo=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 Co={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(xo)(()=>({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(xo)(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}`])),Gt={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({},Gt),{neutral:{foreground:Gt.gray300},primary:{background:Gt.blue500,foreground:Gt.white,inverted:Gt.blue500},negative:{foreground:Gt.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:Co,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 K,se,de,be,V;let[r,l]=je(t||null),[p,d]=je(o||null),[s,m]=je([]),[c,g]=je([]),[y,T]=je([]),[S,h]=je({}),[B,v]=je({}),[F,A]=je([]),[O,x]=je({}),[b,u]=je(!1),[P,N]=je(!1),[L,I]=je(!j(e)),q=(Y,ee)=>{if(ee==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},D={theme:w(w({},it.theme),(se=(K=i==null?void 0:i.defaultAppearance)==null?void 0:K.theme)!=null?se:{}),styleOverrides:w(w({},it.styleOverrides),(be=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?be:{})};function j(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(ho)&&window.localStorage.getItem(ho)!==r&&Sd()},[r]),Go(()=>{o&&d(o)},[o]),Go(()=>{if(j(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let le={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:T,userProperties:S,setUserProperties:h,openFlowStates:B,setOpenFlowStates:v,completedFlowsToKeepOpenDuringSession:F,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:O,setCustomVariables:x,isNewGuestUser:b,setIsNewGuestUser:u,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:N,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:q,defaultAppearance:D,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:I,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(D);return Pt.createElement(yd,{fallback:Pt.createElement(Pt.Fragment,null,n)},Pt.createElement(Q.Provider,{value:le},Pt.createElement(Cd,{theme:Ce(D.theme,Ar,pe!=null?pe:{},(V=i==null?void 0:i.theme)!=null?V:{})},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`
|
|
682
682
|
font-weight: 600;
|
|
683
683
|
font-size: 14px;
|
|
684
684
|
font-style: normal;
|
|
@@ -699,11 +699,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
699
699
|
padding-right: 8px;
|
|
700
700
|
width: 100%;
|
|
701
701
|
${e=>ke(e)}
|
|
702
|
-
`,
|
|
702
|
+
`,Ko=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:l="round",appearance:p})=>vt.createElement(vt.Fragment,null,vt.createElement(wd,{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:l,primaryColor:r}),i==="right"&&e&&vt.createElement(vn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),vt.createElement(ie,{appearance:p}));import yo from"styled-components";var En=yo.div`
|
|
703
703
|
font-weight: 700;
|
|
704
704
|
font-size: 18px;
|
|
705
705
|
line-height: 22px;
|
|
706
|
-
`,An=
|
|
706
|
+
`,An=yo.p`
|
|
707
707
|
font-weight: 600;
|
|
708
708
|
font-size: 16px;
|
|
709
709
|
line-height: 24px;
|
|
@@ -711,7 +711,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
711
711
|
letter-spacing: 0.32px;
|
|
712
712
|
font-style: normal;
|
|
713
713
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
714
|
-
`,On=
|
|
714
|
+
`,On=yo.p`
|
|
715
715
|
font-weight: 400;
|
|
716
716
|
font-size: 14px;
|
|
717
717
|
font-style: normal;
|
|
@@ -720,45 +720,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
720
720
|
letter-spacing: 0.28px;
|
|
721
721
|
margin: 8px 0px 0px 0px;
|
|
722
722
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
723
|
-
`,
|
|
723
|
+
`,qo=yo.div`
|
|
724
724
|
width: 6px;
|
|
725
725
|
position: absolute;
|
|
726
726
|
left: 0;
|
|
727
727
|
height: 100%;
|
|
728
728
|
border-top-right-radius: 4px;
|
|
729
729
|
border-bottom-right-radius: 4px;
|
|
730
|
-
`,In=
|
|
730
|
+
`,In=yo.div`
|
|
731
731
|
flex-direction: row;
|
|
732
732
|
justify-content: flex-start;
|
|
733
733
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
734
734
|
padding-right: 16px;
|
|
735
|
-
`;var Nn=({data:e,index:t,isSelected:o,primaryColor:
|
|
736
|
-
background: #ffffff;
|
|
737
|
-
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
738
|
-
border-radius: 20px;
|
|
739
|
-
width: 385px;
|
|
740
|
-
padding: 24px 16px 16px 16px;
|
|
741
|
-
`,rC=lt.div`
|
|
742
|
-
/* Border bottom only on collapsable */
|
|
743
|
-
`,iC=lt.div`
|
|
744
|
-
display: flex;
|
|
745
|
-
flex-direction: row;
|
|
746
|
-
justify-content: space-between;
|
|
747
|
-
align-content: flex-start;
|
|
748
|
-
`,nC=lt.h1`
|
|
735
|
+
`;var Nn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:l})=>{var p,d,s,m,c;return Yo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&Yo.createElement(qo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=l==null?void 0:l.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),Yo.createElement(In,{className:a("checklistStepItem",l),key:`hero-checklist-step-${t}`,appearance:l,role:"listitem"},Yo.createElement(Ko,{value:e.complete,labelPosition:"left",label:(s=e.stepName)!=null?s:e.title,style:n,primaryColor:(c=(m=l==null?void 0:l.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:l})))};import Bt from"react";import Or from"styled-components";import Xo from"styled-components";var oC=Xo.h1`
|
|
749
736
|
display: flex;
|
|
750
737
|
margin: 0;
|
|
751
738
|
font-size: 18px;
|
|
752
|
-
`,
|
|
739
|
+
`,rC=Xo.h2`
|
|
753
740
|
font-size: 15px;
|
|
754
741
|
color: #4d4d4d;
|
|
755
|
-
`,
|
|
756
|
-
list-style: none;
|
|
757
|
-
`,aC=lt.li`
|
|
758
|
-
display: flex;
|
|
759
|
-
justify-content: flex-start;
|
|
760
|
-
flex-direction: row;
|
|
761
|
-
`,Ln=lt.div`
|
|
742
|
+
`,Ln=Xo.div`
|
|
762
743
|
position: absolute;
|
|
763
744
|
left: 0;
|
|
764
745
|
top: 0;
|
|
@@ -766,7 +747,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
766
747
|
width: ${e=>e.fgWidth};
|
|
767
748
|
border-radius: 20px;
|
|
768
749
|
background-color: ${e=>e.theme.colorPrimary};
|
|
769
|
-
|
|
750
|
+
transition: width 0.5s;
|
|
751
|
+
`,$n=Xo.div`
|
|
770
752
|
position: relative;
|
|
771
753
|
left: 0;
|
|
772
754
|
top: 0;
|
|
@@ -795,13 +777,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
795
777
|
padding-right: ${e=>e.padding};
|
|
796
778
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
797
779
|
${e=>ke(e)}
|
|
798
|
-
`;var We=({count:e,total:t,display:o="count",textLocation:
|
|
780
|
+
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:l})=>{var g;if(t===0)return Bt.createElement(Bt.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=l==null?void 0:l.theme)==null?void 0:g.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",s=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${s}% complete`),i==="top"&&(m="0px"),Bt.createElement(Td,{className:a("progressBarContainer",l),textLocation:i,styleOverrides:n},Bt.createElement(kd,{className:a("progressBarStepText",l),styleOverrides:_(w({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:l,padding:m,textLocation:i},c),Bt.createElement(Fd,{textLocation:i,className:a("progressBar",l)},Bt.createElement(Ln,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:l,className:a("progressBarFill",l)}),Bt.createElement($n,{className:a("progressBarBackground",l),barHeight:d,appearance:l})))};import So from"react";import vd from"styled-components";import Qo from"react";import Jo from"react";var Kt=({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 qt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Ir.createElement(Uo,{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 Yt=({stepData:e,appearance:t})=>Qo.createElement(Qo.Fragment,null,Qo.createElement(Kt,{stepData:e,appearance:t}),Qo.createElement(qt,{stepData:e,appearance:t}));import Pd from"react";function Mn(e){return Pd.createElement(Re,{appearance:e.appearance,videoUri:e.videoUri})}var Nr="default",Bd=vd.img`
|
|
799
781
|
border-radius: 4px;
|
|
800
782
|
max-height: 260px;
|
|
801
783
|
min-height: 200px;
|
|
802
|
-
`,
|
|
784
|
+
`,Dn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return So.createElement("div",null,o)}return So.createElement(En,{className:a("checklistStepContent",t)},e.imageUri?So.createElement(Bd,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?So.createElement(Mn,{videoUri:e.videoUri,appearance:t}):null,So.createElement(Yt,{stepData:e,appearance:t}))};import ze,{useRef as Ed,useState as Ad}from"react";import Xt from"styled-components";var Un=Xt.div`
|
|
803
785
|
display: block;
|
|
804
|
-
`,Od=
|
|
786
|
+
`,Od=Xt.div`
|
|
805
787
|
display: flex;
|
|
806
788
|
flex-direction: row;
|
|
807
789
|
flex-wrap: wrap;
|
|
@@ -811,20 +793,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
811
793
|
align-content: center;
|
|
812
794
|
margin-top: 24px;
|
|
813
795
|
margin-bottom: 24px;
|
|
814
|
-
`,Id=
|
|
796
|
+
`,Id=Xt.div`
|
|
815
797
|
display: flex;
|
|
816
798
|
align-items: center;
|
|
817
799
|
justify-content: flex-start;
|
|
818
800
|
flex-direction: column;
|
|
819
801
|
margin-right: 16px;
|
|
820
|
-
`,Nd=
|
|
802
|
+
`,Nd=Xt.video`
|
|
821
803
|
width: 200px;
|
|
822
804
|
height: 120px;
|
|
823
|
-
`,Ld=
|
|
805
|
+
`,Ld=Xt.div`
|
|
824
806
|
font-size: 14px;
|
|
825
807
|
line-height: 20px;
|
|
826
808
|
text-align: center;
|
|
827
|
-
|
|
809
|
+
`,$d=Xt.div`
|
|
828
810
|
position: absolute;
|
|
829
811
|
width: 200px;
|
|
830
812
|
height: 120px;
|
|
@@ -844,9 +826,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
844
826
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
845
827
|
border-radius: 50%;
|
|
846
828
|
}
|
|
847
|
-
`,Wn="videoCarousel",zn=({stepData:e,appearance:t})=>{var
|
|
829
|
+
`,Wn="videoCarousel",zn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return ze.createElement(Un,null,ze.createElement(Yt,{stepData:e,appearance:t}));function o({video:r}){let l=Ed(),[p,d]=Ad(!1);return ze.createElement(Id,null,!p&&ze.createElement($d,{onClick:()=>{d(!0),l.current.play()},appearance:t},ze.createElement(Wo,null)),ze.createElement(Nd,{controls:p,ref:l,play:p,src:r.uri}),ze.createElement(Ld,null,r.title))}let i=e.props;return i.videos?ze.createElement(Un,null,ze.createElement(Kt,{stepData:e,appearance:t}),ze.createElement(Od,null,i.videos.map((r,l)=>ze.createElement("span",{key:`${r.uri}-${l}`},ze.createElement(o,{video:r})))),ze.createElement(qt,{stepData:e,appearance:t})):null};import lt from"react";import Zo from"styled-components";var _n=Zo.div`
|
|
848
830
|
display: block;
|
|
849
|
-
|
|
831
|
+
`,Md=Zo.pre`
|
|
850
832
|
display: block;
|
|
851
833
|
background-color: #2a2a2a;
|
|
852
834
|
color: #f8f8f8;
|
|
@@ -862,14 +844,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
862
844
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
863
845
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
864
846
|
margin-bottom: 24px;
|
|
865
|
-
`,
|
|
847
|
+
`,Dd=Zo.div`
|
|
866
848
|
font-size: 15px;
|
|
867
849
|
line-height: 20px;
|
|
868
850
|
margin-bottom: 12px;
|
|
869
851
|
margin-top: 12px;
|
|
870
852
|
`,Ud=Zo.div`
|
|
871
853
|
margin-top: 24px;
|
|
872
|
-
`,Hn="codeSnippet",jn=({stepData:e,appearance:t})=>{var
|
|
854
|
+
`,Hn="codeSnippet",jn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return lt.createElement(_n,null,lt.createElement(Yt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?lt.createElement(_n,null,lt.createElement(Kt,{stepData:e,appearance:t}),lt.createElement(Ud,null,o.codeSnippets.map((n,r)=>lt.createElement("div",{key:r},n.title?lt.createElement(Dd,null,n.title):null,n.code?lt.createElement(Md,null,n.code):null))),lt.createElement(qt,{stepData:e,appearance:t})):null};var zd=Et.div`
|
|
873
855
|
display: flex;
|
|
874
856
|
flex-direction: row;
|
|
875
857
|
overflow: hidden;
|
|
@@ -877,14 +859,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
877
859
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
878
860
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
879
861
|
${e=>ke(e)}
|
|
880
|
-
`,_d=
|
|
862
|
+
`,_d=Et.h1`
|
|
881
863
|
font-size: 18px;
|
|
882
864
|
font-style: normal;
|
|
883
865
|
font-weight: 700;
|
|
884
866
|
line-height: 24px;
|
|
885
867
|
letter-spacing: 0.36px;
|
|
886
868
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
887
|
-
`,Hd=
|
|
869
|
+
`,Hd=Et.h2`
|
|
888
870
|
font-size: 14px;
|
|
889
871
|
font-style: normal;
|
|
890
872
|
font-weight: 400;
|
|
@@ -892,22 +874,22 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
892
874
|
letter-spacing: 0.28px;
|
|
893
875
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
894
876
|
margin: 10px 0px 0px 0px;
|
|
895
|
-
`,Vn=
|
|
877
|
+
`,Vn=Et.div``,jd=Et.div`
|
|
896
878
|
list-style: none;
|
|
897
879
|
padding: 0;
|
|
898
880
|
margin: 0;
|
|
899
881
|
cursor: pointer;
|
|
900
882
|
width: 300px;
|
|
901
|
-
`,Vd=
|
|
883
|
+
`,Vd=Et.div`
|
|
902
884
|
width: 1px;
|
|
903
885
|
margin-right: 40px;
|
|
904
886
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
905
|
-
`,Gd=
|
|
887
|
+
`,Gd=Et.div`
|
|
906
888
|
flex: 2;
|
|
907
889
|
padding: 2rem 2rem 2rem 0rem;
|
|
908
|
-
`,Kd=({title:e,subtitle:t,steps:o=[],style:
|
|
890
|
+
`,Kd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:l="",customStepTypes:p=new Map,appearance:d,type:s})=>{let{mergeAppearanceWithDefault:m}=te();d=m(d);let c={[Nr]:Dn,[Wn]:zn,[Hn]:jn},g=w(w({},c),p),[y,T]=Wd(0),S=n!=null?n:y,h=r!=null?r:T,B=o.filter(F=>F.complete===!0).length,v=()=>{var F;return!((F=o[S])!=null&&F.type)||!g[o[S].type]?g[Nr]({stepData:o[S],appearance:d}):g[o[S].type]({stepData:o[S],appearance:d})};return Ye.createElement(zd,{type:s,styleOverrides:i,className:l,appearance:d},Ye.createElement(Vn,{style:{flex:1}},Ye.createElement(Vn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Ye.createElement(_d,{className:a("checklistTitle",d),appearance:d},e),Ye.createElement(Hd,{className:a("checklistSubtitle",d),appearance:d},t),Ye.createElement(We,{total:o.length,count:B,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Ye.createElement(jd,{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:()=>{h(A)},appearance:d})))),Ye.createElement(Vd,{appearance:d,className:a("checklistDivider",d)}),Ye.createElement(Gd,null,Ye.createElement(v,null)))},Lr=Kd;import H,{useState as Qd}from"react";import Gn from"react";import qd from"styled-components";var Yd=qd.svg`
|
|
909
891
|
transition: 'transform 0.35s ease-in-out';
|
|
910
|
-
`,
|
|
892
|
+
`,Jt=({style:e,className:t})=>Gn.createElement(Yd,{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`
|
|
911
893
|
max-height: 350px;
|
|
912
894
|
padding-bottom: 40px;
|
|
913
895
|
`,qn=Se.div`
|
|
@@ -929,7 +911,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
929
911
|
padding-left: 1px;
|
|
930
912
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
931
913
|
`,Jn=Se.div`
|
|
932
|
-
${e=>
|
|
914
|
+
${e=>E(e)} {
|
|
933
915
|
border: 1px solid #fafafa;
|
|
934
916
|
}
|
|
935
917
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -943,7 +925,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
943
925
|
flex-direction: row;
|
|
944
926
|
justify-content: space-between;
|
|
945
927
|
`,Zn=Se.p`
|
|
946
|
-
${e=>
|
|
928
|
+
${e=>E(e)} {
|
|
947
929
|
font-weight: 400;
|
|
948
930
|
font-size: 10px;
|
|
949
931
|
line-height: 12px;
|
|
@@ -957,7 +939,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
957
939
|
`,es=Se.div`
|
|
958
940
|
flex: 1;
|
|
959
941
|
`,ts=Se.div`
|
|
960
|
-
${e=>
|
|
942
|
+
${e=>E(e)} {
|
|
961
943
|
display: flex;
|
|
962
944
|
justify-content: center;
|
|
963
945
|
align-content: center;
|
|
@@ -967,7 +949,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
967
949
|
padding-right: 8px;
|
|
968
950
|
}
|
|
969
951
|
`,os=Se.p`
|
|
970
|
-
${e=>
|
|
952
|
+
${e=>E(e)} {
|
|
971
953
|
font-style: normal;
|
|
972
954
|
font-weight: 600;
|
|
973
955
|
font-size: 22px;
|
|
@@ -979,7 +961,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
979
961
|
margin-bottom: 16px;
|
|
980
962
|
}
|
|
981
963
|
`,rs=Se.p`
|
|
982
|
-
${e=>
|
|
964
|
+
${e=>E(e)} {
|
|
983
965
|
font-weight: 400;
|
|
984
966
|
font-size: 14px;
|
|
985
967
|
line-height: 18px;
|
|
@@ -988,14 +970,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
988
970
|
margin-bottom: 8px;
|
|
989
971
|
}
|
|
990
972
|
`,is=Se.div`
|
|
991
|
-
${e=>
|
|
973
|
+
${e=>E(e)} {
|
|
992
974
|
display: flex;
|
|
993
975
|
flex-direction: row;
|
|
994
976
|
justify-content: center;
|
|
995
977
|
gap: 8px;
|
|
996
978
|
}
|
|
997
979
|
`,ns=Se.div`
|
|
998
|
-
${e=>
|
|
980
|
+
${e=>E(e)} {
|
|
999
981
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1000
982
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
1001
983
|
:hover {
|
|
@@ -1015,7 +997,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1015
997
|
position: relative;
|
|
1016
998
|
cursor: pointer;
|
|
1017
999
|
`,ss=Se.p`
|
|
1018
|
-
${e=>
|
|
1000
|
+
${e=>E(e)} {
|
|
1019
1001
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1020
1002
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
1021
1003
|
}
|
|
@@ -1043,7 +1025,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1043
1025
|
flex-direction: column;
|
|
1044
1026
|
justify-content: center;
|
|
1045
1027
|
display: flex;
|
|
1046
|
-
`;import
|
|
1028
|
+
`;import pt from"react";import at from"styled-components";var cs=at.div`
|
|
1047
1029
|
border: 1px solid #fafafa;
|
|
1048
1030
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1049
1031
|
border-radius: 14px;
|
|
@@ -1051,14 +1033,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1051
1033
|
display: flex;
|
|
1052
1034
|
flex-direction: column;
|
|
1053
1035
|
overflow: hidden;
|
|
1054
|
-
`,ms=
|
|
1036
|
+
`,ms=at.div`
|
|
1055
1037
|
display: flex;
|
|
1056
1038
|
flex-wrap: wrap;
|
|
1057
1039
|
justify-content: space-between;
|
|
1058
1040
|
overflow: hidden;
|
|
1059
1041
|
row-gap: 10px;
|
|
1060
|
-
`,us=
|
|
1061
|
-
${e=>
|
|
1042
|
+
`,us=at.div`
|
|
1043
|
+
${e=>E(e)} {
|
|
1062
1044
|
color: #595959;
|
|
1063
1045
|
}
|
|
1064
1046
|
text-transform: uppercase;
|
|
@@ -1067,8 +1049,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1067
1049
|
line-height: 12px;
|
|
1068
1050
|
letter-spacing: 0.09em;
|
|
1069
1051
|
margin-bottom: 12px;
|
|
1070
|
-
`,fs=
|
|
1071
|
-
${e=>
|
|
1052
|
+
`,fs=at.div`
|
|
1053
|
+
${e=>E(e)} {
|
|
1072
1054
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1073
1055
|
background: #ffffff;
|
|
1074
1056
|
border: 1px solid #fafafa;
|
|
@@ -1080,8 +1062,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1080
1062
|
|
|
1081
1063
|
max-width: 150px;
|
|
1082
1064
|
min-width: 200px;
|
|
1083
|
-
`,gs=
|
|
1084
|
-
${e=>
|
|
1065
|
+
`,gs=at.div`
|
|
1066
|
+
${e=>E(e)} {
|
|
1085
1067
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1086
1068
|
}
|
|
1087
1069
|
width: 40px;
|
|
@@ -1092,14 +1074,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1092
1074
|
justify-content: center;
|
|
1093
1075
|
align-content: center;
|
|
1094
1076
|
align-items: center;
|
|
1095
|
-
`,
|
|
1077
|
+
`,hs=at.div`
|
|
1096
1078
|
font-weight: 600;
|
|
1097
1079
|
font-size: 20px;
|
|
1098
1080
|
line-height: 24px;
|
|
1099
1081
|
width: 20px;
|
|
1100
1082
|
height: 20px;
|
|
1101
|
-
`,
|
|
1102
|
-
${e=>
|
|
1083
|
+
`,xs=at.div`
|
|
1084
|
+
${e=>E(e)} {
|
|
1103
1085
|
color: #434343;
|
|
1104
1086
|
}
|
|
1105
1087
|
font-weight: 600;
|
|
@@ -1107,20 +1089,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1107
1089
|
line-height: 17px;
|
|
1108
1090
|
margin-top: 12px;
|
|
1109
1091
|
margin-bottom: 8px;
|
|
1110
|
-
`,Cs=
|
|
1111
|
-
${e=>
|
|
1092
|
+
`,Cs=at.div`
|
|
1093
|
+
${e=>E(e)} {
|
|
1112
1094
|
color: #8c8c8c;
|
|
1113
1095
|
}
|
|
1114
1096
|
font-weight: 400;
|
|
1115
1097
|
font-size: 12px;
|
|
1116
1098
|
line-height: 14px;
|
|
1117
|
-
`,ys=
|
|
1099
|
+
`,ys=at.a`
|
|
1118
1100
|
color: ${e=>e.color};
|
|
1119
1101
|
font-size: 12px;
|
|
1120
1102
|
line-height: 14px;
|
|
1121
1103
|
font-weight: 400;
|
|
1122
1104
|
cursor: pointer;
|
|
1123
|
-
`;var Jd=({steps:e,style:t,title:o,primaryColor:
|
|
1105
|
+
`;var Jd=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=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 s;return pt.createElement(fs,{key:`guide-${(s=p.id)!=null?s: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&&l(p),r&&r(p)}},p.primaryButtonTitle))})))},bo=Jd;var Zd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:l,setSelectedStep:p,customStepTypes:d,appearance:s,guideData:m,guideTitle:c,onGuideButtonClick:g})=>{let y=({stepData:x,handleSecondaryCTAClick:b,handleCTAClick:u})=>x?H.createElement(ts,{className:a("checklistStepContainer",s),"data-testid":"checklistStepContainer"},H.createElement(os,{appearance:s,className:a("checklistStepTitle",s),dangerouslySetInnerHTML:ce(x.title)}),H.createElement(rs,{appearance:s,className:a("checklistStepSubtitle",s),dangerouslySetInnerHTML:ce(x.subtitle)}),H.createElement(is,{className:a("checklistCTAContainer",s)},x.secondaryButtonTitle&&H.createElement(oe,{title:x.secondaryButtonTitle,onClick:b,appearance:s,secondary:!0}),H.createElement(oe,{title:x.primaryButtonTitle,onClick:u,appearance:s}))):H.createElement(H.Fragment,null),S=w(w({},{default:x=>{var N;if((N=e[v])!=null&&N.StepContent){let L=e[v].StepContent;return H.createElement("div",null,L)}let b=e[v];return H.createElement(y,{stepData:x,handleCTAClick:()=>{b.handlePrimaryButtonClick&&b.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{b.handleSecondaryButtonClick&&b.handleSecondaryButtonClick()}})}}),d),[h,B]=Qd(0),v=l!=null?l:h,F=p!=null?p:B,A=()=>{var x;return e?!((x=e[v])!=null&&x.type)||!S[e[v].type]?S.default(e[v]):S[e[v].type]({stepData:e[v],primaryColor:s.theme.colorPrimary}):H.createElement(H.Fragment,null)},O=e.filter(x=>x.complete).length;return n?(s.theme.modalContainer||(s.theme.borderRadius&&($r.borderRadius=s.theme.borderRadius+"px"),s.theme.modalContainer=$r),H.createElement(Qe,{onClose:r,visible:n,appearance:s},H.createElement(ps,null,H.createElement(qn,null,H.createElement(Yn,{appearance:s,className:a("checklistTitle",s)},t),H.createElement(Xn,{appearance:s,className:a("checklistSubtitle",s)},o)),H.createElement(Kn,null,e&&e.length>0&&H.createElement(Jn,{className:a("stepsContainer",s)},H.createElement(Qn,null,H.createElement("div",{style:{flex:3}},H.createElement(Zn,{className:a("stepsTitle",s)},i)),H.createElement(as,null,H.createElement(We,{style:{width:"100%"},count:O,total:e.length,appearance:s}))),H.createElement(Rn,null,H.createElement(es,{className:a("checklistStepListContainer",s),appearance:s},e.map((x,b)=>{var P;let u=v===b;return H.createElement(ns,{selected:u,className:a(`checklistStepListItem${u?"Selected":""}`,s),key:`checklist-guide-step-${(P=x.id)!=null?P:b}`,disabled:x.blocked,onClick:()=>{x.blocked||F(b)},title:x.blocked?"Finish remaining steps to continue":void 0},u&&H.createElement(qo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklist-step-selected",style:{backgroundColor:s.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),H.createElement(ss,{selected:u,className:a(`checklistStepListStepName${u?"Selected":""}`,s)},x.stepName),H.createElement(ls,null,H.createElement(nt,{value:x.complete,type:"round",primaryColor:s.theme.colorPrimary,progress:x.progress,appearance:s}),H.createElement(ds,null,H.createElement(Jt,{style:{marginLeft:"10px"},color:s.theme.colorBackgroundSecondary}))))})),H.createElement(A,null))),m&&m.length>0&&H.createElement(bo,{steps:m,title:c,primaryColor:s.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:s,onButtonClick:x=>(g&&g(x),!0)}))))):H.createElement(H.Fragment,null)},Mr=Zd;import Ne,{useEffect as Ls,useState as $s}from"react";import Fe from"react";import dt from"styled-components";var Ss=dt.div`
|
|
1124
1106
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1125
1107
|
border: 1px solid;
|
|
1126
1108
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1132,19 +1114,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1132
1114
|
display: flex;
|
|
1133
1115
|
flex-direction: column;
|
|
1134
1116
|
transition: max-height 0.25s;
|
|
1135
|
-
`,bs=
|
|
1117
|
+
`,bs=dt.div`
|
|
1136
1118
|
display: flex;
|
|
1137
1119
|
margin-bottom: 20px;
|
|
1138
|
-
`,ws=
|
|
1120
|
+
`,ws=dt.img`
|
|
1139
1121
|
border-radius: 4px;
|
|
1140
1122
|
max-height: 260px;
|
|
1141
1123
|
min-height: 200px;
|
|
1142
|
-
`,Ts=
|
|
1124
|
+
`,Ts=dt.div`
|
|
1143
1125
|
display: flex;
|
|
1144
1126
|
flex-direction: row;
|
|
1145
1127
|
justify-content: space-between;
|
|
1146
1128
|
align-items: center;
|
|
1147
|
-
`,Fs=
|
|
1129
|
+
`,Fs=dt.p`
|
|
1148
1130
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1149
1131
|
font-style: normal;
|
|
1150
1132
|
font-weight: 500;
|
|
@@ -1155,23 +1137,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1155
1137
|
:hover {
|
|
1156
1138
|
opacity: 0.8;
|
|
1157
1139
|
}
|
|
1158
|
-
`,ks=
|
|
1140
|
+
`,ks=dt.div`
|
|
1159
1141
|
cursor: pointer;
|
|
1160
1142
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1161
1143
|
:hover {
|
|
1162
1144
|
opacity: 0.8;
|
|
1163
1145
|
}
|
|
1164
|
-
`,
|
|
1146
|
+
`,R0=dt.div``,Ps=dt.p`
|
|
1165
1147
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1166
1148
|
font-weight: 400;
|
|
1167
1149
|
font-size: 14px;
|
|
1168
1150
|
line-height: 22px;
|
|
1169
|
-
`,vs=
|
|
1151
|
+
`,vs=dt.div`
|
|
1170
1152
|
display: flex;
|
|
1171
1153
|
flex-direction: row;
|
|
1172
1154
|
justify-content: flex-start;
|
|
1173
1155
|
align-items: center;
|
|
1174
|
-
`;var Bs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:
|
|
1156
|
+
`;var Bs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:l})=>{var c,g;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 s(){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(Uo,{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(!l)return null;let y=l[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(Jt,{style:_(w({},p),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:w({},d)},(g=m())!=null?g:s()))};import Qt from"styled-components";var uy=Qt.div`
|
|
1175
1157
|
background: #ffffff;
|
|
1176
1158
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1177
1159
|
border-radius: 6px;
|
|
@@ -1185,26 +1167,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1185
1167
|
|
|
1186
1168
|
max-width: 800px;
|
|
1187
1169
|
min-width: 350px;
|
|
1188
|
-
`,Es=
|
|
1170
|
+
`,Es=Qt.div`
|
|
1189
1171
|
display: flex;
|
|
1190
1172
|
flex-direction: column;
|
|
1191
|
-
`,As=
|
|
1173
|
+
`,As=Qt.h1`
|
|
1192
1174
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1193
1175
|
font-style: normal;
|
|
1194
1176
|
font-weight: 700;
|
|
1195
1177
|
font-size: 20px;
|
|
1196
1178
|
line-height: 24px;
|
|
1197
1179
|
margin-bottom: 8px;
|
|
1198
|
-
`,Os=
|
|
1180
|
+
`,Os=Qt.h2`
|
|
1199
1181
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1200
1182
|
font-weight: 400;
|
|
1201
1183
|
font-size: 14px;
|
|
1202
1184
|
line-height: 23px;
|
|
1203
1185
|
margin: 2px 0 0 0;
|
|
1204
|
-
`,Is=
|
|
1186
|
+
`,Is=Qt.div`
|
|
1205
1187
|
display: block;
|
|
1206
1188
|
width: 100%;
|
|
1207
|
-
`,Ns=
|
|
1189
|
+
`,Ns=Qt.div`
|
|
1208
1190
|
display: flex;
|
|
1209
1191
|
width: 100%;
|
|
1210
1192
|
flex-direction: column;
|
|
@@ -1212,9 +1194,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1212
1194
|
padding: 24px;
|
|
1213
1195
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1214
1196
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1215
|
-
`;var Rd=({title:e,subtitle:t,steps:o,onClose:
|
|
1197
|
+
`;var Rd=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:l=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:s,appearance:m,type:c,className:g,customStepTypes:y,style:T})=>{let S=o.filter(b=>b.complete).length,[h,B]=$s(Array(o.length).fill(!0)),[v,F]=$s(!1);Ls(()=>{let b=[...h];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){b[u]=!1;break}B(b)}},[]),Ls(()=>{if(!v&&!r){F(!0);return}A(d)},[d]);let A=b=>{let u=[...h];if(l)for(let P=0;P<h.length;++P)P!==b&&(u[P]=!0);u[b]=!u[b],B(u)};if(!n&&c=="modal")return Ne.createElement(Ne.Fragment,null);let O=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),g)},o.map((b,u)=>{var N;let P=h[u];return Ne.createElement(Bs,{appearance:m,stepData:b,collapsed:P,key:`modal-checklist-${(N=b.id)!=null?N:u}`,onClick:()=>{if(d===u){A(u);return}s(u)},onPrimaryButtonClick:()=>{b.handlePrimaryButtonClick&&b.handlePrimaryButtonClick(),p&&!b.completionCriteria&&u<h.length-1&&h[u+1]&&s(u+1)},onSecondaryButtonClick:()=>{b.handleSecondaryButtonClick&&b.handleSecondaryButtonClick()},customStepTypes:y})}));return c==="inline"?Ne.createElement(Ns,{appearance:m,className:Te(a("checklistInlineContainer",m),g),style:T},O,x):Ne.createElement(Ne.Fragment,null,Ne.createElement(Qe,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:O},x))},Dr=Rd;import me,{useEffect as Ur,useRef as lc,useState as At}from"react";import{useEffect as ec,useState as tc}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]=tc(t),n=null,r=()=>{n!==null?clearTimeout(n):l(),n=setTimeout(()=>{l()},16)},l=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,s])=>{if(!window)return[d,!1];let m=window.matchMedia(s);return m.addEventListener("change",r),[d,m.matches]}));i(p)};return ec(()=>{l()},[]),o};import Zt from"react";import ge,{css as Ds,keyframes as Us}from"styled-components";var Ws=Ds`
|
|
1216
1198
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1217
|
-
`,oc=
|
|
1199
|
+
`,oc=Ds`
|
|
1218
1200
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1219
1201
|
`,rc=Us`
|
|
1220
1202
|
from {
|
|
@@ -1295,17 +1277,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1295
1277
|
margin-bottom: 12px;
|
|
1296
1278
|
width: 40px;
|
|
1297
1279
|
`,qs=ge(Vs)`
|
|
1298
|
-
${e=>
|
|
1280
|
+
${e=>E(e)} {
|
|
1299
1281
|
${oc}
|
|
1300
1282
|
|
|
1301
1283
|
background: ${({theme:e})=>e.colorBackground};
|
|
1302
1284
|
}
|
|
1303
|
-
`,
|
|
1285
|
+
`,Ay=ge.div`
|
|
1304
1286
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1305
1287
|
display: flex;
|
|
1306
1288
|
flex-flow: row nowrap;
|
|
1307
1289
|
align-items: center;
|
|
1308
|
-
|
|
1290
|
+
`,Oy=ge.div`
|
|
1309
1291
|
white-space: nowrap;
|
|
1310
1292
|
`,Ys=ge.div`
|
|
1311
1293
|
background: #d8fed8;
|
|
@@ -1336,7 +1318,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1336
1318
|
margin-bottom: 4px;
|
|
1337
1319
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1338
1320
|
`}
|
|
1339
|
-
`,
|
|
1321
|
+
`,xt=ge.p`
|
|
1340
1322
|
color: ${({theme:e})=>e.colorText};
|
|
1341
1323
|
font-weight: normal;
|
|
1342
1324
|
font-size: 14px;
|
|
@@ -1348,13 +1330,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1348
1330
|
font-size: 12px;
|
|
1349
1331
|
line-height: 16px;
|
|
1350
1332
|
margin: 0;
|
|
1351
|
-
`;
|
|
1333
|
+
`;xt.Loud=ge(xt)`
|
|
1352
1334
|
font-weight: 600;
|
|
1353
|
-
`;
|
|
1335
|
+
`;xt.Quiet=ge(xt)`
|
|
1354
1336
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1355
1337
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1356
1338
|
`}
|
|
1357
|
-
`;var Rs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:
|
|
1339
|
+
`;var Rs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=te(),{primaryCTAClickSideEffects:n}=ae();o=i(o);let{imageUri:r=null,subtitle:l=null,title:p=null,complete:d=!1,blocked:s=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return Zt.createElement(Gs,{className:a("carouselCard",o),onClick:s?null:c,style:t,blocked:s,complete:d},r&&Zt.createElement(Ks,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||s?.4:1}}),d&&Zt.createElement(Ys,{className:a("carouselCompletedPill",o)},Zt.createElement(Zs,{style:{color:"#108E0B"}},"Complete")),p&&Zt.createElement(Qs,{blocked:s,complete:d,className:a("carouselCardTitle",o)},p),l&&Zt.createElement(xt.Quiet,{blocked:s,complete:d,className:a("carouselCardSubtitle",o)},l))};var ac=()=>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,l]=At(!1);Ur(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&l(!0)},[t]);let p=()=>{n(!1),l(!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(ac,null))):null},tl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=lc(null),[r,l]=At(!1),[p,d]=At(!1),[s,m]=At(null),[c,g]=At([]),[y,T]=At(0),{isSmall:S}=Ms(),h=S?1:3,{getFlowMetadata:B,getFlowSteps:v,getNumberOfStepsCompleted:F,updateCustomVariables:A,isLoading:O}=R();Ur(()=>{A(o)},[o,O]),Ur(()=>{if(O)return;let L=B(e),I=F(e),q=v(e);m(L),L.data!==null&&(g(q.sort((D,j)=>Number(D.complete)-Number(j.complete))),d(q.length>h),T(I))},[O]);let x=[];for(let L=0;L<c.length;L+=h)x.push(c.slice(L,L+h));let b=L=>{let I=L.target,q=I.scrollWidth-I.clientWidth,D=Math.ceil(I.scrollLeft);D>0&&r===!1&&l(!0),D===0&&r===!0&&l(!1),D<q&&p===!1&&d(!0),D===q&&p===!0&&d(!1)},u=(L=!0)=>{let I=L?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*I,behavior:"smooth"})},P=null,N=L=>{P!==null?clearTimeout(P):b(L),P=setTimeout(()=>{b(L)},16)};return O?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)},s==null?void 0:s.title),me.createElement(xt.Quiet,{className:a("carouselSubtitle",t)},s==null?void 0:s.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:()=>u(!1)}),me.createElement(el,{side:"right",show:p,onClick:u}),me.createElement(zs,{ref:n,onScroll:N},x.map((L,I)=>me.createElement(_s,{key:I,style:{flex:`0 0 calc(100% - ${c.length>h?36:0}px)`}},L.map((q,D)=>me.createElement(Rs,{key:D,stepData:q,style:{flex:c.length>h?`0 1 calc(100% / ${h} - 16px * 2 / ${h})`:1},appearance:t})))))),me.createElement(ie,{appearance:t}))};var Wr=A=>{var O=A,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:l="inline",onDismiss:p,visible:d,customVariables:s,onStepCompletion:m,onButtonClick:c,appearance:g,hideOnFlowCompletion:y,setVisible:T,customStepTypes:S,checklistStyle:h="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:v}=O,F=Ie(O,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:x,getFlowSteps:b,markStepCompleted:u,getStepStatus:P,getNumberOfStepsCompleted:N,isLoading:L,targetingLogicShouldHideFlow:I,updateCustomVariables:q,getFlowMetadata:D,isStepBlocked:j,getFlowStatus:le,hasActiveFullPageFlow:pe,setHasActiveFullPageFlow:K}=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=l==="modal",{mergeAppearanceWithDefault:Oe}=te();if(g=Oe(g),ol(()=>{q(s)},[s,L]),ol(()=>{d!==void 0&&(ue&&d===!0?K(!0):ue&&d===!1&&K(!1))},[d,T,pe]),L)return null;let we=x(e);if(!we||I(we))return null;let U=b(e);if(!U||y===!0&&le(e)===Z)return null;let $=D(e);if($!=null&&$.title&&(t=$.title),$!=null&&$.subtitle&&(o=$.subtitle),!Ve&&n===void 0&&N(e)>0){let f=U.findIndex(k=>k.complete===!1);ee(f>-1?f:U.length-1),Le(!0)}function W(){if(Y+1>=U.length){ue&&V(e,!1);return}j(e,U[Y+1].id)||ee(Y+1)}function J(f,k,z){let he=Y+1<U.length?U[Y+1]:null;c&&c(f,Y,k,he)===!0&&ue&&Xe(),m&&m(f,z,he),!m&&!c&&(f.primaryButtonUri||f.secondaryButtonUri)&&ue&&Xe()}function fe(){return U.map((f,k)=>_(w({},f),{handleSecondaryButtonClick:()=>{W(),de(f),f.skippable===!0&&u(e,f.id,{skipped:!0}),J(f,"secondary",k)},handlePrimaryButtonClick:()=>{(!f.completionCriteria&&(f.autoMarkCompleted||f.autoMarkCompleted===void 0)||f.completionCriteria&&f.autoMarkCompleted===!0)&&(u(e,f.id),W()),J(f,"primary",k),se(f),P(e,f.id)===Ke&&W()}}))}function $e(){return ye.createElement(ie,{appearance:g})}let Ge={steps:fe(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:S,type:l,className:r,autoExpandFirstIncompleteStep:B,autoExpandNextStep:v};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:g,customVariables:s,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:g},Ge)))}function $t(){var z;let f=F.guideFlowId,k;return f&&x(f)&&(k=b(f)),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:g,title:t,subtitle:o,onGuideButtonClick:he=>{J(he,"link",0)},customStepTypes:S},Ge)))}function C(){let f=ye.createElement(Lr,w({flowId:e,style:i,selectedStep:Y,setSelectedStep:ee,appearance:g,type:l},Ge));return ue?ye.createElement(Qe,{onClose:()=>{Xe()},visible:X,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ye.createElement($e,null),f):ye.createElement(ye.Fragment,null,ye.createElement($e,null),f)}switch(h){case"condensed":return Lt();case"with-guide":return $t();case"default":return C();case"carousel":return St();default:return C()}};var dc=e=>pc.createElement(Wr,w({type:"inline"},e));import yt,{useEffect as cc}from"react";import tt from"react";import Ro from"styled-components";var il=Ro.div`
|
|
1358
1340
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1359
1341
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1360
1342
|
padding: 10px 12px 10px 12px;
|
|
@@ -1386,7 +1368,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1386
1368
|
display: flex;
|
|
1387
1369
|
height: 100%;
|
|
1388
1370
|
align-items: center;
|
|
1389
|
-
`;var al=({title:e,count:t,total:o,onClick:
|
|
1371
|
+
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>tt.createElement(tt.Fragment,null,tt.createElement(ie,{appearance:l}),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",l)),appearance:l},p=="condensed"&&o&&o!==0&&tt.createElement(ll,{className:a("progressRingContainer",l)},tt.createElement(_t,{size:19,percentage:t/o,fillColor:l.theme.colorPrimary,bgColor:l.theme.colorBackgroundSecondary})),tt.createElement(nl,{type:p,className:a("badgeTitleContainer",l)},tt.createElement(sl,{type:p,appearance:l,className:a("badgeTitle",l)},e),i!==void 0&&tt.createElement(Jt,{className:a("badgeChevron",l),color:l.theme.colorPrimary})),p=="default"&&o&&o!==0&&tt.createElement(We,{display:"compact",count:t,total:o,bgColor:l.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:l,textStyle:{color:"#818898"}})));import Ct from"react";import wo from"styled-components";var pl=wo.div`
|
|
1390
1372
|
display: flex;
|
|
1391
1373
|
flex-direction: row;
|
|
1392
1374
|
width: 100%;
|
|
@@ -1396,25 +1378,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1396
1378
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1397
1379
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1398
1380
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1399
|
-
`,dl=
|
|
1400
|
-
${e=>
|
|
1381
|
+
`,dl=wo.div`
|
|
1382
|
+
${e=>E(e)} {
|
|
1401
1383
|
display: flex;
|
|
1402
1384
|
justify-content: center;
|
|
1403
1385
|
align-items: center;
|
|
1404
1386
|
margin-right: 16px;
|
|
1405
1387
|
}
|
|
1406
|
-
`,cl=
|
|
1388
|
+
`,cl=wo.div`
|
|
1407
1389
|
display: flex;
|
|
1408
1390
|
flex-direction: column;
|
|
1409
1391
|
flex: 1;
|
|
1410
1392
|
margin-top: 0;
|
|
1411
|
-
`,ml=
|
|
1393
|
+
`,ml=wo.div`
|
|
1412
1394
|
display: flex;
|
|
1413
1395
|
flex-direction: column;
|
|
1414
1396
|
justify-content: center;
|
|
1415
1397
|
margin-left: 16px;
|
|
1416
1398
|
min-width: 200px;
|
|
1417
|
-
`,
|
|
1399
|
+
`,IS=wo.div`
|
|
1418
1400
|
display: flex;
|
|
1419
1401
|
justify-content: center;
|
|
1420
1402
|
align-items: flex-end;
|
|
@@ -1423,7 +1405,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1423
1405
|
:hover {
|
|
1424
1406
|
opacity: 0.8;
|
|
1425
1407
|
}
|
|
1426
|
-
`;var ul=({title:e,subtitle:t,icon:o,appearance:
|
|
1408
|
+
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p})=>Ct.createElement(Ct.Fragment,null,Ct.createElement(pl,{appearance:i,className:Te(a("fullWidthProgressBadgeContainer",i),l!=null?l:""),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 mc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:l,customVariables:p,hideOnFlowCompletion:d,appearance:s,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:y,getNumberOfStepsCompleted:T,isLoading:S,targetingLogicShouldHideFlow:h,updateCustomVariables:B}=R(),{mergeAppearanceWithDefault:v}=te();s=v(s);let{setOpenFlowState:F,getOpenFlowState:A}=Be();if(cc(()=>{B(p)},[p,S]),S)return null;let O=c(e);if(!O||h(O)||d===!0&&y(e)===Z)return null;let x=g(e),b=T(e);return m==="full-width"?yt.createElement(yt.Fragment,null,yt.createElement(ie,{appearance:s}),yt.createElement(ul,{title:t,subtitle:o,count:b,total:x.length,style:n,className:l,appearance:s,icon:i,onClick:()=>{}})):yt.createElement(yt.Fragment,null,yt.createElement(ie,{appearance:s}),yt.createElement(al,{count:b,total:x.length,title:t,style:n,onClick:()=>{F(e,!0),r&&r()},type:m,className:l,appearance:s}))};import uc from"react";var fc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Ie(r,["flowId","style","appearance"]);let{getFlow:l,targetingLogicShouldHideFlow:p,getFlowSteps:d}=R(),{mergeAppearanceWithDefault:s}=te();o=s(o);let m=l(e);if(!m||p(m))return null;let c=d(e);return uc.createElement(bo,w({steps:c,style:t,appearance:o},i))};import Ot,{useContext as vc,useEffect as Bc}from"react";import G,{useEffect as er,useLayoutEffect as hl,useRef as Sc,useState as Rt}from"react";import To from"styled-components";import{useCallback as gc,useEffect as hc,useState as xc}from"react";var zr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,l=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+l,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+l,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]=xc(o),r=gc(()=>{e&&n(e.getBoundingClientRect())},[e]);return hc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Cc,useState as yc}from"react";function gl(){let{debug:e}=Cc(Q),[t,o]=yc([]);function i(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var xl=300,Cl=100,bc=500,eo=12,wc=To.div`
|
|
1427
1409
|
width: 100%;
|
|
1428
1410
|
height: 100%;
|
|
1429
1411
|
border-radius: 9999px;
|
|
@@ -1446,26 +1428,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1446
1428
|
opacity: 0;
|
|
1447
1429
|
}
|
|
1448
1430
|
}
|
|
1449
|
-
`,Tc=
|
|
1450
|
-
width: ${
|
|
1451
|
-
height: ${
|
|
1431
|
+
`,Tc=To.div`
|
|
1432
|
+
width: ${eo}px;
|
|
1433
|
+
height: ${eo}px;
|
|
1452
1434
|
border-radius: 100px;
|
|
1453
1435
|
background-color: ${e=>e.primaryColor};
|
|
1454
1436
|
z-index: 20;
|
|
1455
1437
|
opacity: 1;
|
|
1456
|
-
`,Fc=
|
|
1438
|
+
`,Fc=To.div`
|
|
1457
1439
|
pointer-events: all;
|
|
1458
|
-
`,yl=
|
|
1440
|
+
`,yl=To.div`
|
|
1459
1441
|
display: flex;
|
|
1460
1442
|
align-content: center;
|
|
1461
1443
|
justify-content: center;
|
|
1462
1444
|
align-items: center;
|
|
1463
1445
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1464
|
-
`,kc=
|
|
1465
|
-
width: ${
|
|
1466
|
-
height: ${
|
|
1467
|
-
`,Pc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:
|
|
1468
|
-
${e=>
|
|
1446
|
+
`,kc=To(yl)`
|
|
1447
|
+
width: ${eo+12}px;
|
|
1448
|
+
height: ${eo+12}px;
|
|
1449
|
+
`,Pc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:l={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:s=0,customStepTypes:m,appearance:c,dismissible:g=!1,showHighlightOnly:y,showStepCount:T=!0,completedStepsCount:S=0,showFrigadeBranding:h=!1,cssPosition:B="absolute"})=>{var $e,Ge,Xe,St,Lt,$t,C,f,k,z,he,xe,oo,Xr,Jr,Qr,Zr,Rr,ei;let{logErrorIfDebugMode:v}=gl(),[F,A]=Rt(),[O,x]=Rt(new Date),b=Sc(null),[u,P]=Rt(document.querySelector(e[s].selector)),N=fl(u,O),[L,I]=Rt(),[q,D]=Rt(!y),j=(Ge=($e=e[s])==null?void 0:$e.props)!=null&&Ge.position?e[s].props.position:B,le=(Lt=(St=(Xe=e[s])==null?void 0:Xe.props)==null?void 0:St.zIndex)!=null?Lt:90,pe=($t=F==null?void 0:F.width)!=null?$t:xl,K=(C=F==null?void 0:F.height)!=null?C:Cl,[se,de]=Rt(new Date().getTime());l=(z=(k=(f=e[s])==null?void 0:f.props)==null?void 0:k.offset)!=null?z:l;let be=window.location.pathname.split("/").pop();hl(()=>{b.current&&A({width:b.current.clientWidth,height:b.current.clientHeight})},[s,O,j]),er(()=>{y||D(!0)},[s]);let V=()=>{let ne=document.querySelector(e[s].selector);if(!ne){I(void 0),P(null),v(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}L&&L===JSON.stringify(ne==null?void 0:ne.getBoundingClientRect())||(P(ne),x(new Date),ne&&I(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()},bc),V()},[s,be]),u===null||!p||N.height===0&&N.width===0&&j!=="fixed"&&B!=="static")return null;let Y=i==="auto"?"right":i,ee=zr(N,Y,pe,l,j),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,l,j),Y="left"),(xe=(he=e[s])==null?void 0:he.props)!=null&&xe.tooltipPosition&&((Xr=(oo=e[s])==null?void 0:oo.props)==null?void 0:Xr.tooltipPosition)!=="auto"&&(((Qr=(Jr=e[s])==null?void 0:Jr.props)==null?void 0:Qr.tooltipPosition)==="left"||((Rr=(Zr=e[s])==null?void 0:Zr.props)==null?void 0:Rr.tooltipPosition)==="right")&&(Y=e[s].props.tooltipPosition);let X=()=>{let ne=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),D(!1),setTimeout(()=>{V()},30)),S===e.length-1)return o()},mt=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),y&&!e[s].secondaryButtonUri&&D(!1))};return G.createElement(G.Fragment,null,T&&e.length>1&&G.createElement(xi,null,G.createElement(yi,{className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&G.createElement(Ci,{showStepCount:T,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&G.createElement(oe,{title:e[s].secondaryButtonTitle,appearance:c,onClick:mt,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&G.createElement(oe,{title:e[s].primaryButtonTitle,appearance:c,onClick:ne,withMargin:!1,size:"small"})))},ue=()=>G.createElement(G.Fragment,null,g&&G.createElement(mi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri},G.createElement(Ee,null)),e[s].imageUri&&G.createElement(ui,{dismissible:g,appearance:c,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&G.createElement(fi,{dismissible:g,appearance:c,className:a("tooltipVideoContainer",c)},G.createElement(Re,{appearance:c,videoUri:e[s].videoUri})),G.createElement(hi,{className:a("tooltipContentContainer",c)},G.createElement(Ae,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small"}),G.createElement(gi,{className:a("tooltipFooter",c)},G.createElement(X,null)))),we=w(w({},{default:ne=>{var mt;if((mt=e[s])!=null&&mt.StepContent){let ra=e[s].StepContent;return G.createElement("div",null,ra)}return G.createElement(ue,null)}}),m),U=()=>{var ne;return e?!((ne=e[s])!=null&&ne.type)||!we[e[s].type]?we.default(e[s]):we[e[s].type]({stepData:e[s],primaryColor:r}):G.createElement(G.Fragment,null)};if(e[s].complete===!0||ee.x==0&&ee.y==0&&new Date().getTime()-se<100)return null;let $={top:(ee==null?void 0:ee.y)-eo,left:(ei=Y=="left"?N.x+l.x:(ee==null?void 0:ee.x)-eo)!=null?ei:0,cursor:y?"pointer":"default",position:j},W=()=>{let mt=$.left+(Y=="left"?-pe:24);return Math.min(Math.max(mt,20),window.innerWidth-pe-20)},J=()=>{if(j==="fixed")return $.top;let ne=$.top+K,mt=20;return ne>window.innerHeight-mt?$.top+-K:$.top},fe=()=>{y&&(x(new Date),D(!q))};return G.createElement(Fc,null,G.createElement(kc,{style:$,zIndex:le,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&B!=="static"&&G.createElement(G.Fragment,null,G.createElement(Tc,{style:{position:j},onClick:fe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),G.createElement(wc,{style:{position:"absolute"},onClick:fe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),G.createElement(yl,{style:_(w({},$),{left:W(),top:J()}),zIndex:le+1,className:a("tooltipContainerWrapper",c)},q&&G.createElement(G.Fragment,null,G.createElement(Bo,{ref:b,layoutId:"tooltip-container",style:w({position:"relative",width:"max-content",right:0,top:B!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:xl,zIndex:le+10},G.createElement(U,null)),h&&G.createElement(bi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:le+10},G.createElement(Eo,{appearance:c})))))},_r=Pc;import{Portal as Ec}from"react-portal";var Ac=S=>{var h=S,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:l,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:s=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:y="absolute"}=h,T=Ie(h,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition"]);let{getFlow:B,getFlowSteps:v,isLoading:F,targetingLogicShouldHideFlow:A,markStepCompleted:O,markStepStarted:x,markFlowCompleted:b,updateCustomVariables:u,getCurrentStepIndex:P,getStepStatus:N,isStepBlocked:L,getFlowStatus:I,getNumberOfStepsCompleted:q}=R(),{isLoadingUserFlowStateData:D}=De(),{primaryCTAClickSideEffects:j,secondaryCTAClickSideEffects:le}=ae(),{hasOpenModals:pe}=Be(),K=P(e),{openFlowStates:se}=vc(Q),{mergeAppearanceWithDefault:de}=te();if(o=de(o),Bc(()=>{u(t)},[t,F]),D)return null;let be=B(e);if(!be||A(be)||I(e)==Z||pe())return null;let V=v(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 M(this,null,function*(){if(yield O(e,U.id),V.map($=>N(e,$.id)).every($=>$===Ke)){yield b(e);return}if(!s&&K+1<V.length&&!r){if(L(e,V[K+1].id))return;yield x(e,V[K+1].id)}})}function ee(U,$,W){let J=K+1<V.length?V[K+1]:null;n&&n(U,K,$,J),i&&i(U,W,J)}function Ve(){return V.map(U=>_(w({},U),{handleSecondaryButtonClick:()=>M(this,null,function*(){le(U),U.skippable===!0&&(yield O(e,U.id,{skipped:!0})),ee(U,"secondary",K)}),handlePrimaryButtonClick:()=>M(this,null,function*(){(!U.completionCriteria&&(U.autoMarkCompleted||U.autoMarkCompleted===void 0)||U.completionCriteria&&U.autoMarkCompleted===!0)&&(yield Y(U)),ee(U,"primary",K),j(U)})}))}function Le(U){return M(this,null,function*(){l&&l(),m==="complete-flow"?yield b(e):yield O(e,U.id)})}function X(){c&&c()}let ue=!document.querySelector(V[K].selector);function Oe(){let U=V.findIndex($=>!!document.querySelector($.selector));return V.map(($,W)=>ue&&!r&&W!==U&&g||!r&&W!==K?null:Ot.createElement(_r,w({key:$.id,appearance:o,steps:Ve(),selectedStep:W,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Le($),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:q(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(Ec,null,we())};import _e,{useEffect as Oc,useRef as Ic,useState as Nc}from"react";import{Portal as Lc}from"react-portal";import It from"styled-components";var Sl=It.button`
|
|
1450
|
+
${e=>E(e)} {
|
|
1469
1451
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1470
1452
|
|
|
1471
1453
|
display: flex;
|
|
@@ -1482,17 +1464,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1482
1464
|
opacity: 0.8;
|
|
1483
1465
|
}
|
|
1484
1466
|
}
|
|
1485
|
-
`,bl=
|
|
1486
|
-
${e=>
|
|
1467
|
+
`,bl=It.span`
|
|
1468
|
+
${e=>E(e)} {
|
|
1487
1469
|
font-size: 12px;
|
|
1488
1470
|
display: inline-block;
|
|
1489
1471
|
}
|
|
1490
|
-
`,wl=
|
|
1491
|
-
${e=>
|
|
1472
|
+
`,wl=It.span`
|
|
1473
|
+
${e=>E(e)} {
|
|
1492
1474
|
font-size: 12px;
|
|
1493
1475
|
display: inline-block;
|
|
1494
1476
|
}
|
|
1495
|
-
`,Tl=
|
|
1477
|
+
`,Tl=It.div`
|
|
1496
1478
|
position: fixed;
|
|
1497
1479
|
right: 0;
|
|
1498
1480
|
bottom: 0;
|
|
@@ -1502,8 +1484,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1502
1484
|
flex-direction: column;
|
|
1503
1485
|
align-items: flex-end;
|
|
1504
1486
|
z-index: 50;
|
|
1505
|
-
`,Fl=
|
|
1506
|
-
${e=>
|
|
1487
|
+
`,Fl=It.button`
|
|
1488
|
+
${e=>E(e)} {
|
|
1507
1489
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1508
1490
|
background-color: #ffffff;
|
|
1509
1491
|
border: 1px solid #f5f5f5;
|
|
@@ -1518,8 +1500,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1518
1500
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1519
1501
|
border-radius: 45px;
|
|
1520
1502
|
cursor: pointer;
|
|
1521
|
-
`,kl=
|
|
1522
|
-
${e=>
|
|
1503
|
+
`,kl=It.div`
|
|
1504
|
+
${e=>E(e)} {
|
|
1523
1505
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1524
1506
|
background: #ffffff;
|
|
1525
1507
|
}
|
|
@@ -1535,8 +1517,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1535
1517
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1536
1518
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1537
1519
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1538
|
-
`,Pl=
|
|
1539
|
-
${e=>
|
|
1520
|
+
`,Pl=It.button`
|
|
1521
|
+
${e=>E(e)} {
|
|
1540
1522
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1541
1523
|
color: #434343;
|
|
1542
1524
|
:hover {
|
|
@@ -1552,8 +1534,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1552
1534
|
font-size: 14px;
|
|
1553
1535
|
|
|
1554
1536
|
padding: 8px 12px;
|
|
1555
|
-
`;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
|
|
1556
|
-
${e=>
|
|
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 $c=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:l})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:s,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y}=R(),{primaryCTAClickSideEffects:T}=ae(),S=Ic(null),[h,B]=Nc(!1),{mergeAppearanceWithDefault:v}=te();l=v(l),Oc(()=>(document.addEventListener("click",F,!1),()=>{document.removeEventListener("click",F,!1)}),[]);let F=u=>{S.current&&!S.current.contains(u.target)&&B(!1)};if(g)return null;let A=p(e);if(!A||y(A))return null;let O=d(e);if(!O||!i)return null;function x(u,P){!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)&&s(e,u.id),T(u),o&&o(u,P),B(!1)}function b(){return h&&_e.createElement(kl,{className:a("floatingWidgetMenu",l),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},O.map((u,P)=>_e.createElement(Pl,{className:a("floatingWidgetMenuItem",l),key:P,onClick:()=>x(u,P)},u.title)))}return n=="inline"?_e.createElement("span",{ref:S},_e.createElement(Sl,{style:t,onClick:()=>{B(!h)},className:a("supportButton",l)},_e.createElement(wl,{className:a("supportIconContainer",l)},_e.createElement(Al,{className:a("supportIcon",l),style:{width:"18px",height:"18px"}})),_e.createElement(bl,{className:a("supportButtonTitle",l)},r)),_e.createElement(b,null)):_e.createElement(Lc,null,_e.createElement(Tl,{style:t,ref:S},_e.createElement(b,null),_e.createElement(Fl,{onClick:()=>{B(!h)},whileHover:{scale:1.1},className:a("floatingWidgetButton",l)},_e.createElement(Bl,{className:a("floatingWidgetButtonIcon",l),style:{display:"flex",width:"20px",height:"20px"}}))))};import ot,{useEffect as Mc}from"react";import tr from"styled-components";var Ol=tr.div`
|
|
1538
|
+
${e=>E(e)} {
|
|
1557
1539
|
display: flex;
|
|
1558
1540
|
flex-direction: column;
|
|
1559
1541
|
width: 100%;
|
|
@@ -1578,7 +1560,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1578
1560
|
align-items: flex-start;
|
|
1579
1561
|
margin-top: 16px;
|
|
1580
1562
|
`,Ll=tr.div`
|
|
1581
|
-
${e=>
|
|
1563
|
+
${e=>E(e)} {
|
|
1582
1564
|
position: absolute;
|
|
1583
1565
|
top: 16px;
|
|
1584
1566
|
right: 16px;
|
|
@@ -1588,9 +1570,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1588
1570
|
opacity: 0.8;
|
|
1589
1571
|
}
|
|
1590
1572
|
}
|
|
1591
|
-
`;var
|
|
1573
|
+
`;var Dc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowSteps:T,getFlowStatus:S,getCurrentStepIndex:h}=R(),{primaryCTAClickSideEffects:B}=ae(),{mergeAppearanceWithDefault:v}=te();if(n=v(n),Mc(()=>{y(o)},[o,c]),c)return null;let F=d(e);if(!F||g(F)||S(e)===Z)return null;let O=T(e)[h(e)];return ot.createElement(ot.Fragment,null,ot.createElement(ie,{appearance:n}),ot.createElement(Ol,{appearance:n,className:Te(a("embeddedTipContainer",n),r),style:l},(p===!0||O.dismissible)&&ot.createElement(Ll,{onClick:()=>M(void 0,null,function*(){yield s(e),t&&t()}),className:a("embeddedTipDismissButton",n)},ot.createElement(Ee,null)),ot.createElement(Il,null,ot.createElement(Ae,{size:"small",appearance:n,title:O.title,subtitle:O.subtitle})),O.primaryButtonTitle&&ot.createElement(Nl,{className:a("embeddedTipCallToActionContainer",n)},ot.createElement(oe,{classPrefix:"embeddedTip",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>M(void 0,null,function*(){O.handlePrimaryButtonClick(),B(O),!(i&&i(O,h(e),"primary")===!1)&&(yield m(e,O.id),yield s(e))})}))))};import Pe,{useEffect as Uc}from"react";import to from"styled-components";var $l=to.div`
|
|
1592
1574
|
// use the :not annotation
|
|
1593
|
-
${e=>
|
|
1575
|
+
${e=>E(e)} {
|
|
1594
1576
|
display: flex;
|
|
1595
1577
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1596
1578
|
width: 100%;
|
|
@@ -1600,24 +1582,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1600
1582
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1601
1583
|
border-radius: 12px;
|
|
1602
1584
|
}
|
|
1603
|
-
|
|
1604
|
-
${e=>
|
|
1585
|
+
`,Ml=to.div`
|
|
1586
|
+
${e=>E(e)} {
|
|
1605
1587
|
display: flex;
|
|
1606
1588
|
width: 46px;
|
|
1607
1589
|
height: 46px;
|
|
1608
1590
|
}
|
|
1609
|
-
`,
|
|
1591
|
+
`,Dl=to.div`
|
|
1610
1592
|
display: flex;
|
|
1611
1593
|
flex-direction: column;
|
|
1612
1594
|
flex: 1;
|
|
1613
1595
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1614
1596
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1615
|
-
`,Ul=
|
|
1597
|
+
`,Ul=to.div`
|
|
1616
1598
|
display: flex;
|
|
1617
1599
|
flex-direction: column;
|
|
1618
1600
|
justify-content: center;
|
|
1619
1601
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1620
|
-
`,Hr=
|
|
1602
|
+
`,Hr=to.div`
|
|
1621
1603
|
display: flex;
|
|
1622
1604
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1623
1605
|
align-items: flex-end;
|
|
@@ -1625,12 +1607,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1625
1607
|
:hover {
|
|
1626
1608
|
opacity: 0.8;
|
|
1627
1609
|
}
|
|
1628
|
-
`,jr=
|
|
1610
|
+
`,jr=to.div`
|
|
1629
1611
|
display: flex;
|
|
1630
1612
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1631
1613
|
align-items: flex-end;
|
|
1632
1614
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1633
|
-
`;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 Wc=({flowId:e,title:t,subtitle:o,onDismiss:
|
|
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 Wc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:l,type:p="full-width",icon:d})=>{let{getFlow:s,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowMetadata:T,getFlowStatus:S,getFlowSteps:h,getCurrentStepIndex:B}=R(),{primaryCTAClickSideEffects:v}=ae(),{mergeAppearanceWithDefault:F}=te();if(l=F(l),Uc(()=>{y(n)},[n,c]),c)return null;let A=s(e);if(!A||g(A)||S(e)===Z)return null;let O=h(e),x=O.length>0?O[B(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:l}),Pe.createElement($l,{type:p,appearance:l,className:a("bannerContainer",l)},p!="square"&&Pe.createElement(Ml,{className:a("bannerIconContainer",l)},d||Pe.createElement(Wl,null)),p==="square"&&x.dismissible&&Pe.createElement(jr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(Hr,{type:p,onClick:()=>M(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null))),Pe.createElement(Dl,{type:p},Pe.createElement(Ae,{appearance:l,title:t,subtitle:o,classPrefix:"banner"})),(x==null?void 0:x.primaryButtonTitle)&&Pe.createElement(Ul,{type:p,className:a("bannerCallToActionContainer",l)},Pe.createElement(oe,{title:x==null?void 0:x.primaryButtonTitle,appearance:l,onClick:()=>{v(x),r&&r(x,0,"primary")},classPrefix:"banner"})),p!=="square"&&x.dismissible&&Pe.createElement(jr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(Hr,{type:p,onClick:()=>M(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null)))))};import re,{useEffect as zc}from"react";import{Portal as _c}from"react-portal";import ct from"styled-components";var zl=ct.div`
|
|
1634
1616
|
display: flex;
|
|
1635
1617
|
flex-direction: column;
|
|
1636
1618
|
width: 100%;
|
|
@@ -1649,7 +1631,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1649
1631
|
z-index: 1000;
|
|
1650
1632
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1651
1633
|
min-width: 550px;
|
|
1652
|
-
`,_l=
|
|
1634
|
+
`,_l=ct.button`
|
|
1653
1635
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1654
1636
|
border-radius: 8px;
|
|
1655
1637
|
// If selected make border color primary and text color color priamry
|
|
@@ -1670,34 +1652,34 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1670
1652
|
display: flex;
|
|
1671
1653
|
justify-content: center;
|
|
1672
1654
|
align-items: center;
|
|
1673
|
-
`,Gr=
|
|
1655
|
+
`,Gr=ct.div`
|
|
1674
1656
|
display: flex;
|
|
1675
1657
|
justify-content: space-between;
|
|
1676
1658
|
margin-top: 16px;
|
|
1677
1659
|
gap: 8px;
|
|
1678
|
-
`,Hl=
|
|
1660
|
+
`,Hl=ct.div`
|
|
1679
1661
|
display: flex;
|
|
1680
1662
|
justify-content: space-between;
|
|
1681
1663
|
margin-top: 8px;
|
|
1682
|
-
`,Kr=
|
|
1664
|
+
`,Kr=ct.div`
|
|
1683
1665
|
font-size: 12px;
|
|
1684
1666
|
line-height: 18px;
|
|
1685
1667
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1686
1668
|
font-style: normal;
|
|
1687
1669
|
font-weight: 400;
|
|
1688
1670
|
letter-spacing: 0.24px;
|
|
1689
|
-
`,qr=
|
|
1671
|
+
`,qr=ct.div`
|
|
1690
1672
|
display: flex;
|
|
1691
1673
|
flex-direction: column;
|
|
1692
1674
|
flex: 1;
|
|
1693
|
-
`,
|
|
1675
|
+
`,Q1=ct.div`
|
|
1694
1676
|
display: flex;
|
|
1695
1677
|
flex-direction: column;
|
|
1696
1678
|
justify-content: center;
|
|
1697
1679
|
align-items: flex-start;
|
|
1698
1680
|
margin-top: 16px;
|
|
1699
|
-
`,jl=
|
|
1700
|
-
${e=>
|
|
1681
|
+
`,jl=ct.textarea`
|
|
1682
|
+
${e=>E(e)} {
|
|
1701
1683
|
margin-top: 16px;
|
|
1702
1684
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1703
1685
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
@@ -1707,8 +1689,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1707
1689
|
width: 100%;
|
|
1708
1690
|
height: 100px;
|
|
1709
1691
|
}
|
|
1710
|
-
`,Vl=
|
|
1711
|
-
${e=>
|
|
1692
|
+
`,Vl=ct.div`
|
|
1693
|
+
${e=>E(e)} {
|
|
1712
1694
|
position: absolute;
|
|
1713
1695
|
top: 16px;
|
|
1714
1696
|
right: 16px;
|
|
@@ -1718,8 +1700,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1718
1700
|
opacity: 0.8;
|
|
1719
1701
|
}
|
|
1720
1702
|
}
|
|
1721
|
-
`;var Hc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:
|
|
1722
|
-
${e=>
|
|
1703
|
+
`;var Hc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:S,getFlowStatus:h,getFlowMetadata:B}=R(),{primaryCTAClickSideEffects:v}=ae(),{mergeAppearanceWithDefault:F}=te(),[A,O]=re.useState(null),[x,b]=re.useState(""),u=B(e),{hasOpenModals:P,setKeepCompletedFlowOpenDuringSession:N,shouldKeepCompletedFlowOpenDuringSession:L}=Be();if(n=F(n),zc(()=>{T(o)},[o,g]),g)return null;let I=d(e);if(!I||y(I)||h(e)===Z||c(e)===1&&!L(e)||P())return null;let D=S(e)[c(e)];function j(){var K,se;return re.createElement(re.Fragment,null,re.createElement(qr,null,re.createElement(Ae,{size:"large",appearance:n,title:D.title,subtitle:D.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:()=>M(this,null,function*(){N(e),O(de+1),yield m(e,D.id,{score:de+1})}),appearance:n},de+1))),re.createElement(Hl,{appearance:n},re.createElement(Kr,{appearance:n},(K=u==null?void 0:u.negativeLabel)!=null?K:"Not likely at all"),re.createElement(Kr,{appearance:n},(se=u==null?void 0:u.positiveLabel)!=null?se:"Extremely likely")))}function le(){var K;return re.createElement(re.Fragment,null,re.createElement(qr,null,re.createElement(Ae,{appearance:n,title:(K=D.title)!=null?K:"Why did you choose this score?",size:"large"})),re.createElement(jl,{appearance:n,value:x,onChange:se=>{b(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:()=>M(this,null,function*(){yield s(e),i&&i(D,1,"primary")}),appearance:n,title:D.secondaryButtonTitle||"Skip",secondary:!0}),re.createElement(oe,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield m(e,D.id,{feedbackText:x}),yield s(e),i&&i(D,1,"primary")}),appearance:n,title:D.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:l,type:p},re.createElement(Vl,{onClick:()=>M(this,null,function*(){yield s(e),t&&t()}),className:a("npsSurveyDismissButton",n)},re.createElement(Ee,null)),c(e)==0&&j(),c(e)==1&&le()))}return p==="inline"?pe():re.createElement(_c,null,pe())};import ve,{useEffect as Gc}from"react";import Nt from"styled-components";var Gl=Nt.div`
|
|
1704
|
+
${e=>E(e)} {
|
|
1723
1705
|
display: flex;
|
|
1724
1706
|
flex-direction: column;
|
|
1725
1707
|
width: 100%;
|
|
@@ -1729,22 +1711,22 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1729
1711
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1730
1712
|
position: relative;
|
|
1731
1713
|
}
|
|
1732
|
-
`,Kl=
|
|
1714
|
+
`,Kl=Nt.div`
|
|
1733
1715
|
display: flex;
|
|
1734
1716
|
flex-direction: column;
|
|
1735
1717
|
flex: 1;
|
|
1736
|
-
`,ql=
|
|
1718
|
+
`,ql=Nt.div`
|
|
1737
1719
|
display: flex;
|
|
1738
1720
|
flex-direction: row;
|
|
1739
1721
|
justify-content: center;
|
|
1740
1722
|
align-items: stretch;
|
|
1741
1723
|
gap: 16px;
|
|
1742
1724
|
margin-top: 8px;
|
|
1743
|
-
`,Yl=
|
|
1725
|
+
`,Yl=Nt.div`
|
|
1744
1726
|
margin-top: 16px;
|
|
1745
1727
|
margin-bottom: 16px;
|
|
1746
|
-
`,Xl=
|
|
1747
|
-
${e=>
|
|
1728
|
+
`,Xl=Nt.div`
|
|
1729
|
+
${e=>E(e)} {
|
|
1748
1730
|
position: absolute;
|
|
1749
1731
|
top: -16px;
|
|
1750
1732
|
right: -16px;
|
|
@@ -1754,8 +1736,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1754
1736
|
opacity: 0.8;
|
|
1755
1737
|
}
|
|
1756
1738
|
}
|
|
1757
|
-
`,Jl=
|
|
1758
|
-
${e=>
|
|
1739
|
+
`,Jl=Nt.h1`
|
|
1740
|
+
${e=>E(e)} {
|
|
1759
1741
|
font-style: normal;
|
|
1760
1742
|
justify-content: center;
|
|
1761
1743
|
text-align: center;
|
|
@@ -1768,8 +1750,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1768
1750
|
color: ${e=>e.appearance.theme.colorText};
|
|
1769
1751
|
margin-bottom: 8px;
|
|
1770
1752
|
}
|
|
1771
|
-
`,Ql=
|
|
1772
|
-
${e=>
|
|
1753
|
+
`,Ql=Nt.h2`
|
|
1754
|
+
${e=>E(e)} {
|
|
1773
1755
|
font-style: normal;
|
|
1774
1756
|
justify-content: center;
|
|
1775
1757
|
text-align: center;
|
|
@@ -1785,5 +1767,5 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1785
1767
|
height: 100%;
|
|
1786
1768
|
min-height: 200px;
|
|
1787
1769
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1788
|
-
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Re,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Vc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Kc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:
|
|
1770
|
+
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Re,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Vc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Kc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:s,markFlowCompleted:m,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:S,getFlowStatus:h,getCurrentStepIndex:B}=R(),{primaryCTAClickSideEffects:v,secondaryCTAClickSideEffects:F}=ae(),{mergeAppearanceWithDefault:A}=te(),{setOpenFlowState:O,getOpenFlowState:x,hasOpenModals:b}=Be(),[u,P]=[x(e,!0),le=>O(e,le)];if(n=A(n),Gc(()=>{T(o)},[o,g]),g)return null;let N=s(e);if(!N||y(N)||h(e)===Z||b())return null;let I=S(e)[B(e)],q=()=>{P(!1),t&&t(),m(e)};function D(){return ve.createElement(ve.Fragment,null,ve.createElement(ie,{appearance:n}),ve.createElement(Gl,{appearance:n,className:Te(a("announcementContainer",n),r),style:l},(p===!0||I.dismissible)&&d=="inline"&&ve.createElement(Xl,{onClick:()=>M(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(I.title)}),I.subtitle&&ve.createElement(Ql,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:ce(I.subtitle)})),(I.imageUri||I.videoUri)&&ve.createElement(Yl,{className:a("announcementMediaContainer",n)},ve.createElement(Rl,{appearance:n,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&ve.createElement(ql,{className:a("announcementCTAContainer",n)},I.secondaryButtonTitle&&ve.createElement(oe,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){I.handleSecondaryButtonClick(),F(I),i&&i(I,B(e),"secondary")}),secondary:!0}),I.primaryButtonTitle&&ve.createElement(oe,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){I.handlePrimaryButtonClick(),v(I),!(i&&i(I,B(e),"primary")===!1)&&(yield c(e,I.id),yield m(e))})}))))}let j={padding:"24px",maxWidth:"400px"};return d==="inline"?D():d!=="center"?ve.createElement(Io,{modalPosition:d,onClose:q,visible:u,dismissible:p,appearance:n},D()):ve.createElement(Qe,{appearance:n,onClose:q,visible:u,style:j,dismissible:p},D())};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)},qc=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,qc);var oa=l=>{var p=l,{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=Co[n])==null?void 0:d.color,fontWeight:"semibold"},i))},Yc=Object.fromEntries(Object.keys(Co).map(e=>{let t=o=>or.createElement(oa,_(w({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),Xc=Object.assign(oa,Yc);export{xo as Box,Xc as Button,nt as CheckBox,sr as FlowType,ft as FormLabel,Cr as FormTextField,Kc as FrigadeAnnouncement,Wc as FrigadeBanner,Wr as FrigadeChecklist,it as FrigadeDefaultAppearance,Dc as FrigadeEmbeddedTip,fn as FrigadeForm,fc as FrigadeGuide,dc as FrigadeHeroChecklist,Hc as FrigadeNPSSurvey,mc as FrigadeProgressBadge,bd as FrigadeProvider,$c as FrigadeSupportWidget,Ac as FrigadeTour,We as ProgressBar,_t as ProgressRing,Yr as Text,Ar as tokens,Be as useFlowOpens,io as useFlowResponses,R as useFlows,Er as useOrganization,no as useUser,De as useUserFlowStates};
|
|
1789
1771
|
//# sourceMappingURL=index.mjs.map
|