@frigade/react 1.37.13 → 1.37.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +301 -301
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnPropertyDescriptors;var $o=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if($o)for(var o of $o(t))ai.call(t,o)&&si(e,o,t[o]);return e},j=(e,t)=>la(e,aa(t));var pi=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&$o)for(var i of $o(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import Eo,{createContext as Fd,useEffect as or,useState as Ve}from"react";import{ThemeProvider as An}from"styled-components";import Nt,{useContext as Rp,useEffect as Rt,useState as ko}from"react";import{useCallback as Bt,useContext as ba,useEffect as wa}from"react";import gr,{useMemo as ci}from"react";var di="1.37.13";var nt="NOT_STARTED_STEP",re="COMPLETED_FLOW",Mo="ABORTED_FLOW",vt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Le="COMPLETED_STEP",go="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=gr.useContext(Q);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var pa="frigade-last-call-at-",da="frigade-last-call-data-";function jt(){let{shouldGracefullyDegrade:e,readonly:t}=gr.useContext(Q);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Vt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Vt();let n=pa+o,r=da+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Vt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let l;try{l=yield fetch(o,i)}catch(p){return Vt(p)}return l?l.ok?l:Vt(l.statusText):Vt()})}function Vt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=gr.useContext(Q);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Ca,useState as mi}from"react";import{useContext as ma,useEffect as ua,useState as fa}from"react";import ga from"swr";import{useContext as ca}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=ca(Q);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>j(T({},y),{[c]:g}))}function p(c){t(g=>{let C=g,{[c]:y}=C,b=Ie(C,[pi(c)]);return T({},b)})}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 ha from"swr/immutable";import ho from"core-js-pure/actual/structured-clone";function hr(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(!hr(t)||!hr(o))throw new Error("deepmerge can only merge Objects");let i=ho(t);return Object.entries(o).forEach(([n,r])=>{hr(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],ho(r))}):Object.assign(i,{[n]:ho(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ho(r)]}):Object.assign(i,{[n]:ho(r)}):Object.assign(i,{[n]:r})}),i}var xa="unknown";function De(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ma(Q),{resetOpenFlowState:d}=Be(),[s,m]=fa(!1),c={data:r.map(w=>({flowId:w.id,flowState:re,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=w=>fetch(w,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${w}: ${k}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:b,isLoading:C,mutate:x,error:P}=p?ha(y,g):ga(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),S=b==null?void 0:b.data;ua(()=>{!s&&!C&&S&&m(!0)},[S,s,C]);function v(w){return M(this,null,function*(){if(S&&!p){let k=S.find(I=>I.flowId===w);k&&k.flowState!==re&&(k.flowState=re),yield x(Promise.resolve(Ce(b,{data:S})),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function $(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.stepStates[k]=I,N.flowState=vt),yield x(Promise.resolve(Ce(b,{data:S})),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function B(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.lastStepId=k,N.stepStates[k]=I,N.flowState=vt),yield x(Ce(b,{data:S}),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function u(w){return M(this,null,function*(){if(S){let k=S.find(I=>I.flowId===w);k&&k.flowState!==Me&&(k.flowState=Me,k.lastStepId=xa,Object.keys(k.stepStates).forEach(I=>{k.stepStates[I].actionType=nt,k.stepStates[I].createdAt=new Date().toISOString()}),yield x(Ce(b,{data:S}),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1}),d(w))}})}function O(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.stepStates[k]=I),yield x(Promise.resolve(Ce(b,{data:S})),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:S,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:v,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:$,optimisticallyMarkStepNotStarted:O,optimisticallyMarkStepStarted:B,error:P}}function xo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=Ca(Q),[d,s]=mi(new Set),[m,c]=mi(new Set),g=jt();function y(x){let P=JSON.stringify(x);if(d.has(P))return null;d.add(P),s(d),m.add(x),c(m);let S=l==null?void 0:l.find(v=>v.flowSlug===x.flowSlug&&v.stepId===x.stepId&&v.actionType===x.actionType&&v.createdAt===x.createdAt);return g(`${t}flowResponses`,j(T({},e),{method:"POST",body:P})).then(v=>{v.status!==200&&v.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):S||p($=>[...$!=null?$:[],x])})}function b(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===vt||x.actionType===Me?yield y(x):x.actionType===re?yield y(x):x.actionType===go?yield y(x):x.actionType===Le?yield y(x):x.actionType===Mo?yield y(x):x.actionType===nt&&(yield y(x)))})}function C(){let x=[];return o==null||o.forEach(P=>{if(P&&P.stepStates&&Object.keys(P.stepStates).length!==0)for(let S in P.stepStates){let v=P.stepStates[S];x.push({foreignUserId:P.foreignUserId,flowSlug:P.flowId,stepId:v.stepId,actionType:v.actionType,data:{},createdAt:new Date(v.createdAt),blocked:v.blocked,hidden:v.hidden})}}),[...x,...l]}return{addResponse:b,setFlowResponses:p,getFlowResponses:C}}import Ta from"swr";var ya=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=ya.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Sa(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Sa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Do(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var xr=(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))(xr||{});function R(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:y,readonly:b,flowDataOverrides:C}=ba(Q),x={data:[]},{verifySDKInitiated:P}=Gt(),{addResponse:S,getFlowResponses:v}=xo(),$=h=>fetch(h,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${h} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(f=>(console.log(`Error fetching ${h}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:B,userFlowStatesData:u,isLoadingUserFlowStateData:O,optimisticallyMarkFlowCompleted:w,optimisticallyMarkFlowNotStarted:k,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:A}=De(),{data:H,error:_,isLoading:ee}=Ta(l?`${t}flows${b?"?readonly=true":""}`:null,$,{keepPreviousData:!0});wa(()=>{if(_){console.error(_);return}H&&H.data&&i(H.data)},[H,_]);function X(h){if(ee)return null;let f=o.find(F=>F.slug===h);return!f&&o.length>0&&!O&&!ee?(console.log(`Flow with id ${h} not found`),null):(f&&C&&C[h]&&(f.data=C[h]),(f==null?void 0:f.active)===!1&&!b?null:f)}function q(h){var U,fe,ht,kt,Pt;if(!X(h))return[];let f=(U=X(h))==null?void 0:U.data;return f?(f=Y(f),((Pt=(kt=(fe=Do(f))==null?void 0:fe.data)!=null?kt:(ht=Do(f))==null?void 0:ht.steps)!=null?Pt:[]).map(ge=>{let uo=je(ge);return j(T({handleSecondaryButtonClick:()=>{ge.skippable===!0&&Z(h,ge.id,{skipped:!0})}},ge),{complete:ce(h,ge.id)===Le||uo>=1,started:ce(h,ge.id)===go||ce(h,ge.id)===Le,currentlyActive:u==null?void 0:u.some(fo=>fo.flowId==h&&fo.lastStepId===ge.id),blocked:V(h,ge.id),hidden:W(h,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&Z(h,ge.id)},progress:uo})}).filter(ge=>ge.hidden!==!0)):[]}function Y(h){return h.replaceAll(/\${(.*?)}/g,(f,F)=>p[F]===void 0?"":String(p[F]).replace(/[\u00A0-\u9999<>\&]/g,function(U){return"&#"+U.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function J(h){var F;if(!X(h))return[];let f=X(h).data;return f?(f=Y(f),(F=JSON.parse(f))!=null?F:{}):[]}function pe(h,f){d(F=>j(T({},F),{[h]:f}))}function we(h){!O&&!ee&&h&&JSON.stringify(p)!=JSON.stringify(T(T({},p),h))&&Object.keys(h).forEach(f=>{pe(f,h[f])})}let Oe=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:go,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield A(h,f,U),S(U))}),[n,r,u]),de=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:nt,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield N(h,f,U),S(U))}),[n,r,u]),Z=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:Le,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield I(h,f,U),S(U))}),[n,r,u]),D=Bt((h,f)=>M(this,null,function*(){if(!P()||Xe(h)===Me)return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Me,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield k(h),xe(F)&&S(F)}),[n,r,u]),oe=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:vt,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&S(F)}),[n,r,u]),Ne=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:re,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&(yield w(h),S(F))}),[n,r,u]),Je=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Mo,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&(yield w(h),S(F))}),[n,r,u]);function xe(h){var f;if(u===void 0)return!1;if(u){let F=u.find(U=>U.flowId===h.flowSlug);if(h.actionType===nt&&(!(F!=null&&F.stepStates[h.stepId])||F.stepStates[h.stepId].actionType===nt))return!1;if(F&&((f=F.stepStates[h.stepId])==null?void 0:f.actionType)===h.actionType){if(h.actionType===Le&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let U=Object.keys(F.stepStates).sort((fe,ht)=>{let kt=new Date(F.stepStates[fe].createdAt),Pt=new Date(F.stepStates[ht].createdAt);return kt.getTime()-Pt.getTime()});if(F.stepStates[U[U.length-1]].actionType===h.actionType&&h.stepId===U[U.length-1])return!1}if(F&&F.flowState===re&&h.actionType===re)return!1}return!0}function ce(h,f){let F=L(h,f);return O?null:F?F.actionType:nt}function V(h,f){let F=L(h,f);return F?F.blocked:!1}function W(h,f){let F=L(h,f);return F?F.hidden:!1}function L(h,f){var U;if(O)return null;let F=u==null?void 0:u.find(fe=>fe.flowId===h);return!F||!F.stepStates[f]?null:(U=F.stepStates[f])!=null?U:null}function z(h){var F,U;if(O||!u)return null;if(Xe(h)===Me)return(F=q(h)[0])!=null?F:null;let f=(U=u.find(fe=>fe.flowId===h))==null?void 0:U.lastStepId;return f?q(h).find(fe=>fe.id===f):null}function me(h){var U;let f=z(h);if(!f)return 0;let F=(U=q(h).findIndex(fe=>fe.id===f.id))!=null?U:0;return ce(h,f.id)===Le&&F<q(h).length-1?F+1:F}function je(h){if(!h.completionCriteria)return;let f=ui(h.completionCriteria);if(f===null)return;let F=Ft(f),U=Ge(f);return U===0?void 0:F/U}function Xe(h){let f=u==null?void 0:u.find(F=>F.flowId===h);return f?f.flowState:null}function Ft(h){let f=q(h);return f.length===0?0:f.filter(U=>ce(h,U.id)===Le).length}function Ge(h){return q(h).length}function gt(h){let f=o.find(F=>F.slug===h);return f?(C&&C[h]&&(f.data=C[h]),Do(f.data)):null}function Ke(h){if(b)return!1;if(O||y)return!0;if(h!=null&&h.targetingLogic&&u){let f=u.find(F=>F.flowId===h.slug);if(f)return f.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function Wt(h){return!Ke(X(h))}function zt(){n&&B()}function Ht(){return o}return{getAllFlows:Ht,getFlow:X,getFlowData:gt,isLoading:O||ee,getStepStatus:ce,getFlowSteps:q,getCurrentStepIndex:me,markStepStarted:Oe,markStepCompleted:Z,markFlowNotStarted:D,markFlowStarted:oe,markFlowCompleted:Ne,markFlowAborted:Je,markStepNotStarted:de,getFlowStatus:Xe,getNumberOfStepsCompleted:Ft,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:Ke,setCustomVariable:pe,updateCustomVariables:we,customVariables:p,getStepOptionalProgress:je,getFlowMetadata:J,isStepBlocked:V,isStepHidden:W,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Wt,refresh:zt}}import{useCallback as Cr,useContext as Fa,useEffect as ka}from"react";var Kt="guest_";function Co(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Fa(Q),{config:r,apiUrl:l}=Ze(),{mutateUserFlowState:p}=De(),d=jt(),{verifySDKInitiated:s}=Gt();function m(b){return`frigade-user-registered-${b}`}ka(()=>{if(e&&!t){if(e.startsWith(Kt))return;let b=m(e);localStorage.getItem(b)||(d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(b,"true"))}},[e,n,t]);let c=Cr(b=>M(this,null,function*(){if(!s())return;let C={foreignId:e,properties:b};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(C)})),i(x=>T(T({},x),b)),p()}),[e,r,n,p]),g=Cr((b,C)=>M(this,null,function*(){if(!s())return;let P={foreignId:e,events:[{event:b,properties:C}]};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(P)})),p()}),[e,r,p]),y=Cr((b,C)=>M(this,null,function*(){if(s())if(C){let x=m(b);localStorage.setItem(x,"true"),o(b);let P={foreignId:b,properties:C};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(P)})),i(S=>T(T({},S),C)),p()}else o(b)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as ed}from"uuid";import ot,{useEffect as xn,useState as Xp}from"react";import qe,{useEffect as wr,useState as La}from"react";import zo from"styled-components";import Pa from"react";import va from"styled-components";var fi="fr-",yo="cfr-";function a(e,t){let o=`${fi}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+yo+e}return o}function E(e){if(!e.className||e.className.indexOf(yo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Uo(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=>`${Uo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function So(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ba=va.div`
|
|
2
|
+
var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnPropertyDescriptors;var $o=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if($o)for(var o of $o(t))ai.call(t,o)&&si(e,o,t[o]);return e},j=(e,t)=>la(e,aa(t));var pi=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&$o)for(var i of $o(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import Eo,{createContext as Fd,useEffect as or,useState as Ve}from"react";import{ThemeProvider as An}from"styled-components";import Nt,{useContext as Rp,useEffect as Rt,useState as ko}from"react";import{useCallback as Bt,useContext as ba,useEffect as wa}from"react";import gr,{useMemo as ci}from"react";var di="1.37.14";var nt="NOT_STARTED_STEP",re="COMPLETED_FLOW",Mo="ABORTED_FLOW",vt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Le="COMPLETED_STEP",go="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=gr.useContext(Q);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var pa="frigade-last-call-at-",da="frigade-last-call-data-";function jt(){let{shouldGracefullyDegrade:e,readonly:t}=gr.useContext(Q);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Vt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Vt();let n=pa+o,r=da+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Vt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let l;try{l=yield fetch(o,i)}catch(p){return Vt(p)}return l?l.ok?l:Vt(l.statusText):Vt()})}function Vt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=gr.useContext(Q);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Ca,useState as mi}from"react";import{useContext as ma,useEffect as ua,useState as fa}from"react";import ga from"swr";import{useContext as ca}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=ca(Q);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>j(T({},y),{[c]:g}))}function p(c){t(g=>{let C=g,{[c]:y}=C,b=Ie(C,[pi(c)]);return T({},b)})}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 ha from"swr/immutable";import ho from"core-js-pure/actual/structured-clone";function hr(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(!hr(t)||!hr(o))throw new Error("deepmerge can only merge Objects");let i=ho(t);return Object.entries(o).forEach(([n,r])=>{hr(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],ho(r))}):Object.assign(i,{[n]:ho(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ho(r)]}):Object.assign(i,{[n]:ho(r)}):Object.assign(i,{[n]:r})}),i}var xa="unknown";function De(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ma(Q),{resetOpenFlowState:d}=Be(),[s,m]=fa(!1),c={data:r.map(w=>({flowId:w.id,flowState:re,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=w=>fetch(w,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${w}: ${k}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:b,isLoading:C,mutate:x,error:P}=p?ha(y,g):ga(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),S=b==null?void 0:b.data;ua(()=>{!s&&!C&&S&&m(!0)},[S,s,C]);function v(w){return M(this,null,function*(){if(S&&!p){let k=S.find(I=>I.flowId===w);k&&k.flowState!==re&&(k.flowState=re),yield x(Promise.resolve(Ce(b,{data:S})),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function $(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.stepStates[k]=I,N.flowState=vt),yield x(Promise.resolve(Ce(b,{data:S})),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function B(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.lastStepId=k,N.stepStates[k]=I,N.flowState=vt),yield x(Ce(b,{data:S}),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function u(w){return M(this,null,function*(){if(S){let k=S.find(I=>I.flowId===w);k&&k.flowState!==Me&&(k.flowState=Me,k.lastStepId=xa,Object.keys(k.stepStates).forEach(I=>{k.stepStates[I].actionType=nt,k.stepStates[I].createdAt=new Date().toISOString()}),yield x(Ce(b,{data:S}),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1}),d(w))}})}function O(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.stepStates[k]=I),yield x(Promise.resolve(Ce(b,{data:S})),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:S,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:v,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:$,optimisticallyMarkStepNotStarted:O,optimisticallyMarkStepStarted:B,error:P}}function xo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=Ca(Q),[d,s]=mi(new Set),[m,c]=mi(new Set),g=jt();function y(x){let P=JSON.stringify(x);if(d.has(P))return null;d.add(P),s(d),m.add(x),c(m);let S=l==null?void 0:l.find(v=>v.flowSlug===x.flowSlug&&v.stepId===x.stepId&&v.actionType===x.actionType&&v.createdAt===x.createdAt);return g(`${t}flowResponses`,j(T({},e),{method:"POST",body:P})).then(v=>{v.status!==200&&v.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):S||p($=>[...$!=null?$:[],x])})}function b(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===vt||x.actionType===Me?yield y(x):x.actionType===re?yield y(x):x.actionType===go?yield y(x):x.actionType===Le?yield y(x):x.actionType===Mo?yield y(x):x.actionType===nt&&(yield y(x)))})}function C(){let x=[];return o==null||o.forEach(P=>{if(P&&P.stepStates&&Object.keys(P.stepStates).length!==0)for(let S in P.stepStates){let v=P.stepStates[S];x.push({foreignUserId:P.foreignUserId,flowSlug:P.flowId,stepId:v.stepId,actionType:v.actionType,data:{},createdAt:new Date(v.createdAt),blocked:v.blocked,hidden:v.hidden})}}),[...x,...l]}return{addResponse:b,setFlowResponses:p,getFlowResponses:C}}import Ta from"swr";var ya=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=ya.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Sa(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Sa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Do(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var xr=(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))(xr||{});function R(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:y,readonly:b,flowDataOverrides:C}=ba(Q),x={data:[]},{verifySDKInitiated:P}=Gt(),{addResponse:S,getFlowResponses:v}=xo(),$=h=>fetch(h,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${h} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(f=>(console.log(`Error fetching ${h}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:B,userFlowStatesData:u,isLoadingUserFlowStateData:O,optimisticallyMarkFlowCompleted:w,optimisticallyMarkFlowNotStarted:k,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:A}=De(),{data:H,error:_,isLoading:ee}=Ta(l?`${t}flows${b?"?readonly=true":""}`:null,$,{keepPreviousData:!0});wa(()=>{if(_){console.error(_);return}H&&H.data&&i(H.data)},[H,_]);function X(h){if(ee)return null;let f=o.find(F=>F.slug===h);return!f&&o.length>0&&!O&&!ee?(console.log(`Flow with id ${h} not found`),null):(f&&C&&C[h]&&(f.data=C[h]),(f==null?void 0:f.active)===!1&&!b?null:f)}function q(h){var U,fe,ht,kt,Pt;if(!X(h))return[];let f=(U=X(h))==null?void 0:U.data;return f?(f=Y(f),((Pt=(kt=(fe=Do(f))==null?void 0:fe.data)!=null?kt:(ht=Do(f))==null?void 0:ht.steps)!=null?Pt:[]).map(ge=>{let uo=je(ge);return j(T({handleSecondaryButtonClick:()=>{ge.skippable===!0&&Z(h,ge.id,{skipped:!0})}},ge),{complete:ce(h,ge.id)===Le||uo>=1,started:ce(h,ge.id)===go||ce(h,ge.id)===Le,currentlyActive:u==null?void 0:u.some(fo=>fo.flowId==h&&fo.lastStepId===ge.id),blocked:V(h,ge.id),hidden:W(h,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&Z(h,ge.id)},progress:uo})}).filter(ge=>ge.hidden!==!0)):[]}function Y(h){return h.replaceAll(/\${(.*?)}/g,(f,F)=>p[F]===void 0?"":String(p[F]).replace(/[\u00A0-\u9999<>\&]/g,function(U){return"&#"+U.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function J(h){var F;if(!X(h))return[];let f=X(h).data;return f?(f=Y(f),(F=JSON.parse(f))!=null?F:{}):[]}function pe(h,f){d(F=>j(T({},F),{[h]:f}))}function we(h){!O&&!ee&&h&&JSON.stringify(p)!=JSON.stringify(T(T({},p),h))&&Object.keys(h).forEach(f=>{pe(f,h[f])})}let Oe=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:go,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield A(h,f,U),S(U))}),[n,r,u]),de=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:nt,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield N(h,f,U),S(U))}),[n,r,u]),Z=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:Le,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield I(h,f,U),S(U))}),[n,r,u]),D=Bt((h,f)=>M(this,null,function*(){if(!P()||Xe(h)===Me)return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Me,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield k(h),xe(F)&&S(F)}),[n,r,u]),oe=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:vt,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&S(F)}),[n,r,u]),Ne=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:re,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&(yield w(h),S(F))}),[n,r,u]),Je=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Mo,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&(yield w(h),S(F))}),[n,r,u]);function xe(h){var f;if(u===void 0)return!1;if(u){let F=u.find(U=>U.flowId===h.flowSlug);if(h.actionType===nt&&(!(F!=null&&F.stepStates[h.stepId])||F.stepStates[h.stepId].actionType===nt))return!1;if(F&&((f=F.stepStates[h.stepId])==null?void 0:f.actionType)===h.actionType){if(h.actionType===Le&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let U=Object.keys(F.stepStates).sort((fe,ht)=>{let kt=new Date(F.stepStates[fe].createdAt),Pt=new Date(F.stepStates[ht].createdAt);return kt.getTime()-Pt.getTime()});if(F.stepStates[U[U.length-1]].actionType===h.actionType&&h.stepId===U[U.length-1])return!1}if(F&&F.flowState===re&&h.actionType===re)return!1}return!0}function ce(h,f){let F=L(h,f);return O?null:F?F.actionType:nt}function V(h,f){let F=L(h,f);return F?F.blocked:!1}function W(h,f){let F=L(h,f);return F?F.hidden:!1}function L(h,f){var U;if(O)return null;let F=u==null?void 0:u.find(fe=>fe.flowId===h);return!F||!F.stepStates[f]?null:(U=F.stepStates[f])!=null?U:null}function z(h){var F,U;if(O||!u)return null;if(Xe(h)===Me)return(F=q(h)[0])!=null?F:null;let f=(U=u.find(fe=>fe.flowId===h))==null?void 0:U.lastStepId;return f?q(h).find(fe=>fe.id===f):null}function me(h){var U;let f=z(h);if(!f)return 0;let F=(U=q(h).findIndex(fe=>fe.id===f.id))!=null?U:0;return ce(h,f.id)===Le&&F<q(h).length-1?F+1:F}function je(h){if(!h.completionCriteria)return;let f=ui(h.completionCriteria);if(f===null)return;let F=Ft(f),U=Ge(f);return U===0?void 0:F/U}function Xe(h){let f=u==null?void 0:u.find(F=>F.flowId===h);return f?f.flowState:null}function Ft(h){let f=q(h);return f.length===0?0:f.filter(U=>ce(h,U.id)===Le).length}function Ge(h){return q(h).length}function gt(h){let f=o.find(F=>F.slug===h);return f?(C&&C[h]&&(f.data=C[h]),Do(f.data)):null}function Ke(h){if(b)return!1;if(O||y)return!0;if(h!=null&&h.targetingLogic&&u){let f=u.find(F=>F.flowId===h.slug);if(f)return f.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function Wt(h){return!Ke(X(h))}function zt(){n&&B()}function Ht(){return o}return{getAllFlows:Ht,getFlow:X,getFlowData:gt,isLoading:O||ee,getStepStatus:ce,getFlowSteps:q,getCurrentStepIndex:me,markStepStarted:Oe,markStepCompleted:Z,markFlowNotStarted:D,markFlowStarted:oe,markFlowCompleted:Ne,markFlowAborted:Je,markStepNotStarted:de,getFlowStatus:Xe,getNumberOfStepsCompleted:Ft,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:Ke,setCustomVariable:pe,updateCustomVariables:we,customVariables:p,getStepOptionalProgress:je,getFlowMetadata:J,isStepBlocked:V,isStepHidden:W,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Wt,refresh:zt}}import{useCallback as Cr,useContext as Fa,useEffect as ka}from"react";var Kt="guest_";function Co(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Fa(Q),{config:r,apiUrl:l}=Ze(),{mutateUserFlowState:p}=De(),d=jt(),{verifySDKInitiated:s}=Gt();function m(b){return`frigade-user-registered-${b}`}ka(()=>{if(e&&!t){if(e.startsWith(Kt))return;let b=m(e);localStorage.getItem(b)||(d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(b,"true"))}},[e,n,t]);let c=Cr(b=>M(this,null,function*(){if(!s())return;let C={foreignId:e,properties:b};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(C)})),i(x=>T(T({},x),b)),p()}),[e,r,n,p]),g=Cr((b,C)=>M(this,null,function*(){if(!s())return;let P={foreignId:e,events:[{event:b,properties:C}]};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(P)})),p()}),[e,r,p]),y=Cr((b,C)=>M(this,null,function*(){if(s())if(C){let x=m(b);localStorage.setItem(x,"true"),o(b);let P={foreignId:b,properties:C};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(P)})),i(S=>T(T({},S),C)),p()}else o(b)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as ed}from"uuid";import ot,{useEffect as xn,useState as Xp}from"react";import qe,{useEffect as wr,useState as La}from"react";import zo from"styled-components";import Pa from"react";import va from"styled-components";var fi="fr-",yo="cfr-";function a(e,t){let o=`${fi}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+yo+e}return o}function E(e){if(!e.className||e.className.indexOf(yo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Uo(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=>`${Uo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function So(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ba=va.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -1464,7 +1464,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1464
1464
|
`,Oc=Lo(bl)`
|
|
1465
1465
|
width: ${co+12}px;
|
|
1466
1466
|
height: ${co+12}px;
|
|
1467
|
-
`,Nc=({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:b=!0,completedStepsCount:C=0,showFrigadeBranding:x=!1,cssPosition:P="absolute",onViewTooltip:S,className:v})=>{var Ft,Ge,gt,Ke,Wt,zt,Ht,h,f,F,U,fe,ht,kt,Pt,ge,uo,fo,ni;let{logErrorIfDebugMode:$}=xl(),[B,u]=po(),[O,w]=po(new Date),k=Pc(null),[I,N]=po(document.querySelector(e[s].selector)),A=hl(I,O),[H,_]=po(),[ee,X]=po(!y),q=(Ge=(Ft=e[s])==null?void 0:Ft.props)!=null&&Ge.position?e[s].props.position:P,Y=(Wt=(Ke=(gt=e[s])==null?void 0:gt.props)==null?void 0:Ke.zIndex)!=null?Wt:90,J=(zt=B==null?void 0:B.width)!=null?zt:yl,pe=(Ht=B==null?void 0:B.height)!=null?Ht:Sl,[we,Oe]=po(new Date().getTime());l=(F=(f=(h=e[s])==null?void 0:h.props)==null?void 0:f.offset)!=null?F:l;let de=window.location.pathname.split("/").pop();Cl(()=>{k.current&&u({width:k.current.clientWidth,height:k.current.clientHeight})},[s,O,q]),ao(()=>{y||X(!0)},[s]),ao(()=>{p&&ee&&S(s)},[ee]);let Z=()=>{let te=document.querySelector(e[s].selector);if(!te){_(void 0),N(null),$(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}H&&H===JSON.stringify(te==null?void 0:te.getBoundingClientRect())||(N(te),w(new Date),te&&_(JSON.stringify(te.getBoundingClientRect())))};if(ao(()=>{let te=new MutationObserver(Z);return te.observe(document.body,{subtree:!0,childList:!0}),()=>te.disconnect()},[Z]),ao(()=>{let te=new MutationObserver(Z);return te.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>te.disconnect()},[Z]),ao(()=>{let te=setInterval(()=>{Z()},10);return()=>clearInterval(te)},[Z]),Cl(()=>{setTimeout(()=>{Z()},vc),Z()},[s,de]),ao(()=>{if(!p)return;let te=Qe=>{Qe.key==="Escape"&&t()};return document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te)}},[]),I===null||!p)return null;let D=i==="auto"?"right":i,oe=Xr(A,D,J,l,q),Ne=A.right+J>(window.innerWidth||document.documentElement.clientWidth),Je=A.bottom+Sl>(window.innerHeight||document.documentElement.clientHeight);Ne&&i==="auto"&&(oe=Xr(A,"left",J,l,q),D="left"),(fe=(U=e[s])==null?void 0:U.props)!=null&&fe.tooltipPosition&&((kt=(ht=e[s])==null?void 0:ht.props)==null?void 0:kt.tooltipPosition)!=="auto"&&(((ge=(Pt=e[s])==null?void 0:Pt.props)==null?void 0:ge.tooltipPosition)==="left"||((fo=(uo=e[s])==null?void 0:uo.props)==null?void 0:fo.tooltipPosition)==="right")&&(D=e[s].props.tooltipPosition);let xe=()=>{let te=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),X(!1),setTimeout(()=>{Z()},30)),C===e.length-1)return o()},Qe=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),y&&!e[s].secondaryButtonUri&&X(!1))};return K.createElement(K.Fragment,null,b&&e.length>1&&K.createElement(wi,null,K.createElement(Fi,{role:"status",className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&K.createElement(Ti,{showStepCount:b,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&K.createElement(se,{title:e[s].secondaryButtonTitle,appearance:c,onClick:Qe,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&K.createElement(se,{title:e[s].primaryButtonTitle,appearance:c,onClick:te,autoFocus:!0,withMargin:!1,size:"small"})))},ce=()=>K.createElement(K.Fragment,null,g&&K.createElement(xi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},K.createElement(Ee,null)),e[s].imageUri&&K.createElement(Ci,{dismissible:g,appearance:c,role:"img","aria-label":e[s].title,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&K.createElement(yi,{dismissible:g,appearance:c,role:"video","aria-label":e[s].title,className:a("tooltipVideoContainer",c)},K.createElement(tt,{appearance:c,videoUri:e[s].videoUri})),K.createElement(bi,{className:a("tooltipContentContainer",c)},K.createElement(Ae,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small",ariaPrefix:`Tooltip${e[s].id}`}),K.createElement(Si,{className:a("tooltipFooter",c)},K.createElement(xe,null)))),W=T(T({},{default:te=>{var Qe;if((Qe=e[s])!=null&&Qe.StepContent){let na=e[s].StepContent;return K.createElement("div",null,na)}return K.createElement(ce,null)}}),m),L=()=>{var te;return e?!((te=e[s])!=null&&te.type)||!W[e[s].type]?W.default(e[s]):W[e[s].type]({stepData:e[s],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[s].complete===!0||oe.x==0&&oe.y==0&&new Date().getTime()-we<100)return null;let z={top:(oe==null?void 0:oe.y)-co,left:(ni=D=="left"?A.x+l.x:(oe==null?void 0:oe.x)-co)!=null?ni:0,cursor:y?"pointer":"default",position:q},me=()=>{let Qe=z.left+(D=="left"?-J:24);return Math.min(Math.max(Qe,20),window.innerWidth-J-20)},je=()=>{if(q==="fixed")return z.top;let te=z.top+pe,Qe=20;return te>window.innerHeight-Qe?z.top+-pe:z.top},Xe=()=>{y&&(w(new Date),X(!ee))};return K.createElement(Ac,{className:v},K.createElement(Oc,{style:z,zIndex:Y,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&P!=="static"&&K.createElement(K.Fragment,null,K.createElement(Ec,{style:{position:q},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Bc,{style:{position:"absolute"},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(bl,{style:j(T({},z),{left:me(),top:je()}),zIndex:Y+1,className:a("tooltipContainerWrapper",c)},ee&&K.createElement(K.Fragment,null,K.createElement(_o,{ref:k,role:"dialog","aria-labelledby":`frigadeTooltip${e[s].id}Title`,"aria-describedby":`frigadeTooltip${e[s].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:T({position:"relative",width:"max-content",right:0,top:P!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:yl,zIndex:Y+10},K.createElement(L,null)),x&&K.createElement(Pi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:Y+10},K.createElement(Wo,{appearance:c})))))},Qr=Nc;import{Portal as $c}from"react-portal";var Mc=x=>{var P=x,{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",className:b}=P,C=Ie(P,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:S,getFlowSteps:v,isLoading:$,targetingLogicShouldHideFlow:B,markStepCompleted:u,markStepStarted:O,markFlowCompleted:w,updateCustomVariables:k,getCurrentStepIndex:I,getStepStatus:N,isStepBlocked:A,getFlowStatus:H,getNumberOfStepsCompleted:_}=R(),{isLoadingUserFlowStateData:ee}=De(),{primaryCTAClickSideEffects:X,secondaryCTAClickSideEffects:q}=ue(),{hasOpenModals:Y}=Be(),J=I(e),{openFlowStates:pe}=Ic(Q),{mergeAppearanceWithDefault:we}=ie();if(o=we(o),Lc(()=>{k(t)},[t,$]),ee)return null;let Oe=S(e);if(!Oe||B(Oe)||H(e)==re||Y())return null;let de=v(e);if(Object.keys(pe).length>0){let L=Object.keys(pe).find(z=>pe[z]===!0);if(L!==void 0&&L!==e)return Dt.createElement(Dt.Fragment,null)}function Z(L){return M(this,null,function*(){if(yield u(e,L.id),de.map(z=>N(e,z.id)).every(z=>z===Le)){yield w(e);return}!s&&J+1<de.length&&!r&&A(e,de[J+1].id)})}function D(L,z,me){let je=J+1<de.length?de[J+1]:null;n&&n(L,J,z,je),i&&i(L,me,je)}function oe(){return de.map(L=>j(T({},L),{handleSecondaryButtonClick:()=>M(this,null,function*(){q(L),L.skippable===!0&&(yield u(e,L.id,{skipped:!0})),D(L,"secondary",J)}),handlePrimaryButtonClick:()=>M(this,null,function*(){(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&(yield Z(L)),D(L,"primary",J),X(L)})}))}function Ne(L){return M(this,null,function*(){l&&l(),m==="complete-flow"?yield w(e):yield u(e,L.id)})}function Je(){c&&c()}function xe(L){return M(this,null,function*(){yield O(e,de[L].id)})}let ce=!document.querySelector(de[J].selector);function V(){let L=de.findIndex(z=>!!document.querySelector(z.selector));return de.map((z,me)=>ce&&!r&&me!==L&&g||!r&&me!==J?null:Dt.createElement(Qr,T({key:z.id,appearance:o,steps:oe(),selectedStep:me,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ne(z),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:_(e),onComplete:Je,cssPosition:y,onViewTooltip:xe,className:b},C)))}function W(){return Dt.createElement(Dt.Fragment,null,Dt.createElement(ae,{appearance:o}),V())}return y==="static"?W():Dt.createElement($c,null,W())};import ze,{useEffect as Dc,useRef as Uc,useState as _c}from"react";import{Portal as Wc}from"react-portal";import Ut from"styled-components";var wl=Ut.button`
|
|
1467
|
+
`,Nc=({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:b=!0,completedStepsCount:C=0,showFrigadeBranding:x=!1,cssPosition:P="absolute",onViewTooltip:S,className:v})=>{var Ft,Ge,gt,Ke,Wt,zt,Ht,h,f,F,U,fe,ht,kt,Pt,ge,uo,fo,ni;let{logErrorIfDebugMode:$}=xl(),[B,u]=po(),[O,w]=po(new Date),k=Pc(null),[I,N]=po(document.querySelector(e[s].selector)),A=hl(I,O),[H,_]=po(),[ee,X]=po(!y),q=(Ge=(Ft=e[s])==null?void 0:Ft.props)!=null&&Ge.position?e[s].props.position:P,Y=(Wt=(Ke=(gt=e[s])==null?void 0:gt.props)==null?void 0:Ke.zIndex)!=null?Wt:90,J=(zt=B==null?void 0:B.width)!=null?zt:yl,pe=(Ht=B==null?void 0:B.height)!=null?Ht:Sl,[we,Oe]=po(new Date().getTime());l=(F=(f=(h=e[s])==null?void 0:h.props)==null?void 0:f.offset)!=null?F:l;let de=window.location.pathname.split("/").pop();Cl(()=>{k.current&&u({width:k.current.clientWidth,height:k.current.clientHeight})},[s,O,q]),ao(()=>{y||X(!0)},[s]),ao(()=>{p&&ee&&S(s)},[ee]);let Z=()=>{if(q==="static")return;let te=document.querySelector(e[s].selector);if(!te){_(void 0),N(null),$(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}H&&H===JSON.stringify(te==null?void 0:te.getBoundingClientRect())||(N(te),w(new Date),te&&_(JSON.stringify(te.getBoundingClientRect())))};if(ao(()=>{let te=new MutationObserver(Z);return te.observe(document.body,{subtree:!0,childList:!0}),()=>te.disconnect()},[Z]),ao(()=>{let te=new MutationObserver(Z);return te.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>te.disconnect()},[Z]),ao(()=>{let te=setInterval(()=>{Z()},10);return()=>clearInterval(te)},[Z]),Cl(()=>{setTimeout(()=>{Z()},vc),Z()},[s,de]),ao(()=>{if(!p)return;let te=Qe=>{Qe.key==="Escape"&&t()};return document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te)}},[]),I===null||!p)return null;let D=i==="auto"?"right":i,oe=Xr(A,D,J,l,q),Ne=A.right+J>(window.innerWidth||document.documentElement.clientWidth),Je=A.bottom+Sl>(window.innerHeight||document.documentElement.clientHeight);Ne&&i==="auto"&&(oe=Xr(A,"left",J,l,q),D="left"),(fe=(U=e[s])==null?void 0:U.props)!=null&&fe.tooltipPosition&&((kt=(ht=e[s])==null?void 0:ht.props)==null?void 0:kt.tooltipPosition)!=="auto"&&(((ge=(Pt=e[s])==null?void 0:Pt.props)==null?void 0:ge.tooltipPosition)==="left"||((fo=(uo=e[s])==null?void 0:uo.props)==null?void 0:fo.tooltipPosition)==="right")&&(D=e[s].props.tooltipPosition);let xe=()=>{let te=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),X(!1),setTimeout(()=>{Z()},30)),C===e.length-1)return o()},Qe=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),y&&!e[s].secondaryButtonUri&&X(!1))};return K.createElement(K.Fragment,null,b&&e.length>1&&K.createElement(wi,null,K.createElement(Fi,{role:"status",className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&K.createElement(Ti,{showStepCount:b,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&K.createElement(se,{title:e[s].secondaryButtonTitle,appearance:c,onClick:Qe,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&K.createElement(se,{title:e[s].primaryButtonTitle,appearance:c,onClick:te,autoFocus:!0,withMargin:!1,size:"small"})))},ce=()=>K.createElement(K.Fragment,null,g&&K.createElement(xi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},K.createElement(Ee,null)),e[s].imageUri&&K.createElement(Ci,{dismissible:g,appearance:c,role:"img","aria-label":e[s].title,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&K.createElement(yi,{dismissible:g,appearance:c,role:"video","aria-label":e[s].title,className:a("tooltipVideoContainer",c)},K.createElement(tt,{appearance:c,videoUri:e[s].videoUri})),K.createElement(bi,{className:a("tooltipContentContainer",c)},K.createElement(Ae,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small",ariaPrefix:`Tooltip${e[s].id}`}),K.createElement(Si,{className:a("tooltipFooter",c)},K.createElement(xe,null)))),W=T(T({},{default:te=>{var Qe;if((Qe=e[s])!=null&&Qe.StepContent){let na=e[s].StepContent;return K.createElement("div",null,na)}return K.createElement(ce,null)}}),m),L=()=>{var te;return e?!((te=e[s])!=null&&te.type)||!W[e[s].type]?W.default(e[s]):W[e[s].type]({stepData:e[s],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[s].complete===!0||oe.x==0&&oe.y==0&&new Date().getTime()-we<100)return null;let z={top:(oe==null?void 0:oe.y)-co,left:(ni=D=="left"?A.x+l.x:(oe==null?void 0:oe.x)-co)!=null?ni:0,cursor:y?"pointer":"default",position:q},me=()=>{let Qe=z.left+(D=="left"?-J:24);return Math.min(Math.max(Qe,20),window.innerWidth-J-20)},je=()=>{if(q==="fixed")return z.top;let te=z.top+pe,Qe=20;return te>window.innerHeight-Qe?z.top+-pe:z.top},Xe=()=>{y&&(w(new Date),X(!ee))};return K.createElement(Ac,{className:v},K.createElement(Oc,{style:z,zIndex:Y,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&P!=="static"&&K.createElement(K.Fragment,null,K.createElement(Ec,{style:{position:q},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Bc,{style:{position:"absolute"},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(bl,{style:j(T({},z),{left:me(),top:je()}),zIndex:Y+1,className:a("tooltipContainerWrapper",c)},ee&&K.createElement(K.Fragment,null,K.createElement(_o,{ref:k,role:"dialog","aria-labelledby":`frigadeTooltip${e[s].id}Title`,"aria-describedby":`frigadeTooltip${e[s].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:T({position:"relative",width:"max-content",right:0,top:P!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:yl,zIndex:Y+10},K.createElement(L,null)),x&&K.createElement(Pi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:Y+10},K.createElement(Wo,{appearance:c})))))},Qr=Nc;import{Portal as $c}from"react-portal";var Mc=x=>{var P=x,{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",className:b}=P,C=Ie(P,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:S,getFlowSteps:v,isLoading:$,targetingLogicShouldHideFlow:B,markStepCompleted:u,markStepStarted:O,markFlowCompleted:w,updateCustomVariables:k,getCurrentStepIndex:I,getStepStatus:N,isStepBlocked:A,getFlowStatus:H,getNumberOfStepsCompleted:_}=R(),{isLoadingUserFlowStateData:ee}=De(),{primaryCTAClickSideEffects:X,secondaryCTAClickSideEffects:q}=ue(),{hasOpenModals:Y}=Be(),J=I(e),{openFlowStates:pe}=Ic(Q),{mergeAppearanceWithDefault:we}=ie();if(o=we(o),Lc(()=>{k(t)},[t,$]),ee)return null;let Oe=S(e);if(!Oe||B(Oe)||H(e)==re||Y())return null;let de=v(e);if(Object.keys(pe).length>0){let L=Object.keys(pe).find(z=>pe[z]===!0);if(L!==void 0&&L!==e)return Dt.createElement(Dt.Fragment,null)}function Z(L){return M(this,null,function*(){if(yield u(e,L.id),de.map(z=>N(e,z.id)).every(z=>z===Le)){yield w(e);return}!s&&J+1<de.length&&!r&&A(e,de[J+1].id)})}function D(L,z,me){let je=J+1<de.length?de[J+1]:null;n&&n(L,J,z,je),i&&i(L,me,je)}function oe(){return de.map(L=>j(T({},L),{handleSecondaryButtonClick:()=>M(this,null,function*(){q(L),L.skippable===!0&&(yield u(e,L.id,{skipped:!0})),D(L,"secondary",J)}),handlePrimaryButtonClick:()=>M(this,null,function*(){(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&(yield Z(L)),D(L,"primary",J),X(L)})}))}function Ne(L){return M(this,null,function*(){l&&l(),m==="complete-flow"?yield w(e):yield u(e,L.id)})}function Je(){c&&c()}function xe(L){return M(this,null,function*(){yield O(e,de[L].id)})}let ce=!document.querySelector(de[J].selector);function V(){let L=de.findIndex(z=>!!document.querySelector(z.selector));return de.map((z,me)=>ce&&!r&&me!==L&&g||!r&&me!==J?null:Dt.createElement(Qr,T({key:z.id,appearance:o,steps:oe(),selectedStep:me,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ne(z),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:_(e),onComplete:Je,cssPosition:y,onViewTooltip:xe,className:b},C)))}function W(){return Dt.createElement(Dt.Fragment,null,Dt.createElement(ae,{appearance:o}),V())}return y==="static"?W():Dt.createElement($c,null,W())};import ze,{useEffect as Dc,useRef as Uc,useState as _c}from"react";import{Portal as Wc}from"react-portal";import Ut from"styled-components";var wl=Ut.button`
|
|
1468
1468
|
${e=>E(e)} {
|
|
1469
1469
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1470
1470
|
|