@frigade/react 2.0.0-alpha.33 → 2.0.0-alpha.34

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.cjs CHANGED
@@ -37,7 +37,7 @@ var qe__default = /*#__PURE__*/_interopDefault(qe);
37
37
  var it__default = /*#__PURE__*/_interopDefault(it);
38
38
  var C__namespace = /*#__PURE__*/_interopNamespace(C);
39
39
 
40
- var _e=Object.defineProperty;var Ue=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var te=(e,t)=>{for(var o in t)_e(e,o,{get:t[o],enumerable:!0});};var oe={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var re={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",inherit:"inherit",red500:"#c00000"};var ne={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,ie={neutral:{background:l("white"),border:l("gray500"),foreground:l("black"),surface:l("gray700"),active:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},focus:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},hover:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")}},primary:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500"),active:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")},focus:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500")},hover:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")}},secondary:{background:l("white"),border:l("gray800"),foreground:l("black"),surface:l("gray900"),active:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")},focus:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray900")},hover:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")}}};var se={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Je="px",Xe=e=>typeof e=="number"?`${4*e}${Je}`:e,Ge=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],ae=Object.fromEntries(Ge.map(e=>[e,Xe(e)]));var le={fontFamilies:{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:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var z={...oe,colors:{...re,...ie},...le,radii:ne,shadows:se,space:ae};function A(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let s=`${t.length?`${t}${o}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,A(p,s,o)):r[s]=p,r},{})}function K(e){return A(e,"--fr","-")}function pe(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=pe(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var de=K(z),c=pe(z);var Ye=new Set(["alt","size","src"]),Qe=qe__default.default.all.filter(e=>e.indexOf("-")!=0&&!Ye.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),Ze=Object.fromEntries(Qe),j=A(c.colors),et={color:j,backgroundColor:j,borderColor:j,border:c.borders,borderRadius:c.radii,borderWidth:c.borderWidths,boxShadow:c.shadows,fontFamily:c.fontFamilies,fontSize:c.fontSizes,fontWeight:c.fontWeights,gap:c.space,lineHeight:c.lineHeights,margin:c.space,marginBottom:c.space,marginLeft:c.space,marginRight:c.space,marginTop:c.space,padding:c.space,paddingBottom:c.space,paddingLeft:c.space,paddingRight:c.space,paddingTop:c.space},ce={...Ze,...et},ue={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},me=new Set(["active","focus","focusVisible","focusWithin","hover"]);function tt(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):["string","number"].includes(typeof e)?new Map([e,e]):new Map}var fe=new Map(Object.entries(ce).map(([e,t])=>[e,tt(t)])),ot=new Map(Object.entries(ue).map(([e,t])=>[e,new Set(t)])),rt=new Set(["height","width"]),nt=new Set(["canvas","embed","iframe","img","input","object","video"]);function ge(e){let[t,o]=e.split(":");return [t,me.has(o)?o:null]}function xe(e,t="div"){let o=Object.assign({},e),r={};function n(i){if(i==null)return r;let p=`&:${i.replace(/[A-Z]/g,a=>`-${a.toLocaleLowerCase()}`)}`;return r[p]==null&&(r[p]={}),r[p]}return Object.entries(o).forEach(([i,s])=>{let[p,a]=ge(i),d=ot.get(p);d!=null&&(d.forEach(f=>{let m=`${f}${a?":"+a:""}`;o[m]=s;}),delete o[i]);}),Object.entries(o).forEach(([i,s])=>{let[p,a]=ge(i),d=fe.get(p);if(d!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(a)[p]=f.map(m=>d.get(m.toString())??m).join(" ");}else d.has(s.toString())?n(a)[p]=d.get(s.toString()):n(a)[p]=s;(typeof t!="string"||!nt.has(t)||!rt.has(p))&&delete o[i];}}),Object.keys(o).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&fe.has(s)&&(o[s]=o[i],delete o[i]);}),{cssFromProps:r,unmatchedProps:o}}function st(){if(typeof window>"u"){let{JSDOM:e}=Ue("jsdom");return new e("<!DOCTYPE html>").window}return window}function ye(e){return e?{__html:it__default.default(st()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function lt(e){return e&&`fr-${e}`}function be(e){return e&&(Array.isArray(e)?e.map(t=>be(t)).join(" "):lt(e))}function pt({as:e,children:t,className:o,css:r={},part:n,...i},s){let p=e??"div",{cssFromProps:a,unmatchedProps:d}=xe(i,p),f=be(n),m=o||f?clsx.clsx(o,f):void 0,v=[{boxSizing:"border-box"},a,r];return typeof t=="string"?jsxRuntime.jsx(p,{className:m,css:v,...d,ref:s,dangerouslySetInnerHTML:ye(t)}):jsxRuntime.jsx(p,{className:m,css:v,...d,ref:s,children:t})}var u=U__namespace.forwardRef(pt);var N={};te(N,{Body1:()=>xt,Body2:()=>yt,Caption:()=>ht,Display1:()=>dt,Display2:()=>ct,H1:()=>ut,H2:()=>mt,H3:()=>ft,H4:()=>gt});var w={color:"neutral.foreground",fontFamily:"default",margin:"0"},dt={...w,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},ct={...w,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},ut={...w,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},mt={...w,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},ft={...w,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},gt={...w,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},xt={...w,fontSize:"md",fontWeight:"regular",lineHeight:"md"},yt={...w,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},ht={...w,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function Se({as:e="span",children:t,variant:o="Body1",...r}){return jsxRuntime.jsx(u,{as:e,...N[o],...r,children:t})}var Pt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],bt=Object.fromEntries(Pt.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsxRuntime.jsx(Se,{as:t,...r,variant:e,children:r.children});return o.displayName=`Text.${e}`,[e,o]})),b=Object.assign(Se,bt);var _={};te(_,{Link:()=>Ct,Plain:()=>wt,Primary:()=>St,Secondary:()=>Tt});var I={borderWidth:"0",borderRadius:"md",padding:"2 4"},St={...I,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface"},Tt={...I,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background"},Ct={...I,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},wt={...I,backgroundColor:"transparent",color:"neutral.foreground"};function Ce({as:e,children:t,part:o,title:r,variant:n="Primary",...i}){let s=n.toLocaleLowerCase();return jsxRuntime.jsxs(u,{as:e??"button",part:[`button-${s}`,o],..._[n],...i,children:[t,r&&jsxRuntime.jsx(b.Body2,{fontWeight:"demibold",color:"inherit",children:r})]})}var Bt=["Primary","Secondary","Link","Plain"],Rt=Object.fromEntries(Bt.map(e=>{let t=o=>jsxRuntime.jsx(Ce,{...o,variant:e,children:o.children});return t.displayName=`Text.${e}`,[e,t]})),S=Object.assign(Ce,Rt);var Ft=U__namespace.forwardRef(({children:e,css:t,...o},r)=>jsxRuntime.jsx(u,{css:[{display:"flex",flexDirection:"row"},t],...o,ref:r,children:e})),kt=U__namespace.forwardRef(({children:e,css:t,...o},r)=>jsxRuntime.jsx(u,{css:[{display:"flex",flexDirection:"column"},t],...o,ref:r,children:e})),T={Column:kt,Row:Ft};var F=U__namespace.forwardRef(({as:e,children:t,...o},r)=>{let n=e??T.Column;return jsxRuntime.jsx(n,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...o,ref:r,children:t})});function ve({part:e,src:t,...o}){return jsxRuntime.jsx(u,{as:"img",part:["image",e],src:t,...o})}function Ht(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Fe({part:e,src:t,...o}){let r=Ht(t);return jsxRuntime.jsx(u,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:r,...o})}function $({src:e,type:t,...o}){return jsxRuntime.jsx(t==="video"?Fe:ve,{src:e,...o})}function y({children:e,...t}){return jsxRuntime.jsx(h__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(h__namespace.Portal,{children:jsxRuntime.jsxs(u,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(h__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(u,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(h__namespace.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsxRuntime.jsx(F,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog-content",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...t,children:e})})]})})})}y.Close=e=>jsxRuntime.jsx(h__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(S.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});y.Subtitle=({children:e,...t})=>jsxRuntime.jsx(h__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(b.Body2,{mb:5,part:"subtitle",...t,children:e})});y.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx($,{borderRadius:"md",src:e,...t});y.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(S.Primary,{title:t,onClick:e,...o});y.ProgressDots=({current:e,total:t})=>{let o=[...Array(t)].map((r,n)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?c.colors.blue500:c.colors.blue800},n));return jsxRuntime.jsx(u,{as:"svg",height:"8px",margin:"5 auto",part:"progress",viewBox:`0 0 ${16*t-8} 8`,width:16*t-8,children:o})};y.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(S.Secondary,{title:t,onClick:e,...o});y.Title=({children:e,...t})=>jsxRuntime.jsx(h__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(b.H3,{mb:1,part:"title",...t,children:e})});var B=U.createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function Nt({children:e,navigate:t,theme:o,...r}){let n=o?K(o):{},[i,s]=U.useState([]),p=U.useRef(new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId})),a=t??((d,f="_self")=>{window.open(d,f);});return U.useEffect(()=>()=>{var d;(d=p.current)==null||d.destroy();},[]),jsxRuntime.jsxs(B.Provider,{value:{modals:i,setModals:s,navigate:a,...r,frigade:p.current},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...de,...n}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:c,children:e})]})}function k(e,t){let[o,r]=U.useState(),[n,i]=U.useState(""),{frigade:s}=U.useContext(B),p=a=>{a.id===e&&(t!=null&&t.variables&&a.applyVariables(t.variables),r(a),i(Math.random().toString()));};return U.useEffect(()=>((async()=>{let a=await s.getFlow(e);if(!a||s.hasFailedToLoad()){r(void 0);return}t!=null&&t.variables&&a.applyVariables(t.variables),r(a);})(),s.onStateChange(p),()=>{s.removeStateChangeHandler(p);}),[]),{flow:o}}function R(e,{onComplete:t,onDismiss:o}={}){let r=U.useRef(null);return U.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&(async()=>await(t==null?void 0:t(e)))(),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:U.useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function D(e,{onPrimary:t,onSecondary:o}={}){let{navigate:r}=U.useContext(B);return {handlePrimary:U.useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:U.useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function Qt({dismissible:e=!0,flowId:t,onComplete:o,onDismiss:r,onPrimary:n,onSecondary:i,variables:s,...p}){let{flow:a}=k(t,{variables:s}),d=a==null?void 0:a.getCurrentStep(),{handleDismiss:f}=R(a,{onComplete:o,onDismiss:r}),{handlePrimary:m,handleSecondary:v}=D(d,{onPrimary:n,onSecondary:i});return a==null||a.isVisible===!1?null:(a.start(),d==null||d.start(),jsxRuntime.jsxs(y,{...p,children:[e&&jsxRuntime.jsx(y.Close,{onClick:f}),jsxRuntime.jsx(y.Title,{children:d.title}),jsxRuntime.jsx(y.Subtitle,{children:d.subtitle}),jsxRuntime.jsx(y.Media,{src:d.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(y.ProgressDots,{current:a.getNumberOfCompletedSteps(),total:a.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(T.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsxRuntime.jsx(y.Secondary,{title:"Secondary",onClick:v}),jsxRuntime.jsx(y.Primary,{title:"Primary",onClick:m})]})]}))}function eo({dismissible:e=!0,flowId:t,onComplete:o,onDismiss:r,onPrimary:n,onSecondary:i,...s}){let{flow:p}=k(t),a=p==null?void 0:p.getCurrentStep(),{handleDismiss:d}=R(p,{onComplete:o,onDismiss:r}),{handlePrimary:f,handleSecondary:m}=D(a,{onPrimary:n,onSecondary:i});return p==null||p.isVisible===!1?null:(p.start(),a==null||a.start(),jsxRuntime.jsxs(F,{as:T.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...s,children:[jsxRuntime.jsxs(T.Row,{gap:3,children:[jsxRuntime.jsx("img",{src:a.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(T.Column,{children:[jsxRuntime.jsx(b.H4,{mb:1,children:a.title}),jsxRuntime.jsx(b.Body2,{children:a.subtitle})]})]}),jsxRuntime.jsxs(T.Row,{alignItems:"center",gap:3,children:[jsxRuntime.jsx(S.Secondary,{title:a.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(S.Primary,{title:a.primaryButtonTitle,onClick:f}),e&&jsxRuntime.jsx(S.Plain,{part:"banner-close",onClick:d,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function J(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=U.useState(e),[r,n]=U.useState(null),i=U.useCallback(s=>{n(s);},[]);return U.useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:i}}var no=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Ae({style:e={},part:t="",...o}){return jsxRuntime.jsxs(u,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsxRuntime.jsx(u,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${no}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(u,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function $e({props:e,alignAttr:t,sideAttr:o}){let r=o??"bottom",n={},i=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=s;let a=i();return ["before","end"].includes(a)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(a)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var We={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Ve(e,t){let o=Object.fromEntries(We.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r=Object.fromEntries(We.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let n={after:"end",before:"start"},i=(m,v)=>["top","bottom"].includes(v)?m=="after"?"marginLeft":"marginRight":m=="after"?"marginTop":"marginBottom",s=o.alignOffset??0,p=o.style??{},a=o.side??"bottom",d=o.align;o.style={...p,[i(d,a)]:s};let f=["top","bottom"].includes(a)?t.width:t.height;o.alignOffset=(f+s)*-1,o.align=n[d];}return {contentProps:o,rootProps:r}}function x({anchor:e,children:t,className:o,spotlight:r=!1,style:n,...i}){let{node:s,rect:p,ref:a}=J(),{contentProps:d,rootProps:f}=Ve(i,p),[m,v]=U.useState(d.align),[Y,Ke]=U.useState(d.side);if(s!==null){let M=s.getAttribute("data-align"),ee=s.getAttribute("data-side");m!==M&&v(M),Y!==ee&&Ke(ee);}let Q=U.useRef(null),[W,je]=U.useState(null);if(U.useEffect(()=>{let M=document.querySelector(e);M!=null&&(Q.current=M,je(Q));},[e]),W==null)return null;let V=W.current.getBoundingClientRect(),Z="0";typeof window<"u"&&(Z=window.getComputedStyle(W.current).borderRadius);let Ne=$e({props:i,alignAttr:m,sideAttr:Y});return jsxRuntime.jsxs(C__namespace.Root,{defaultOpen:!0,...f,children:[jsxRuntime.jsx(C__namespace.Anchor,{virtualRef:W}),jsxRuntime.jsx(C__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[r&&jsxRuntime.jsx(u,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:Z,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:V.height,left:V.left,top:V.top,width:V.width}}),jsxRuntime.jsx(C__namespace.Content,{asChild:!0,...d,ref:a,children:jsxRuntime.jsxs(F,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...n},children:[jsxRuntime.jsx(Ae,{style:Ne}),t]})})]})})]})}x.Close=e=>jsxRuntime.jsx(C__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(S.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});x.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx($,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});x.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(S.Primary,{title:t,onClick:e,...o});x.Progress=({children:e,...t})=>e==null?null:jsxRuntime.jsx(b.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});x.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(S.Secondary,{title:t,onClick:e,...o});x.Subtitle=({children:e,...t})=>e==null?null:jsxRuntime.jsx(b.Body2,{part:"subtitle",...t,children:e});x.Title=({children:e,...t})=>e==null?null:jsxRuntime.jsx(b.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function q(e){let{modals:t,setModals:o}=U.useContext(B),[r,n]=U.useState(!1);return U.useEffect(()=>(o([...t,e]),()=>o(t.filter(i=>i!==e))),[]),U.useEffect(()=>{let i=t[0]===e;i!==r&&n(i);},[t]),{isCurrentModal:r}}function ze({dismissible:e=!0,flow:t,onDismiss:o,onPrimary:r,onSecondary:n,step:i,...s}){let{isCurrentModal:p}=q(`${t.id}-${i.id}`),{handleDismiss:a}=R(t,{onDismiss:o}),{handlePrimary:d,handleSecondary:f}=D(i,{onPrimary:r,onSecondary:n});return p?jsxRuntime.jsxs(x,{anchor:i.selector,onOpenAutoFocus:m=>m.preventDefault(),onPointerDownOutside:m=>m.preventDefault(),...s,children:[e&&jsxRuntime.jsx(x.Close,{onClick:a}),jsxRuntime.jsx(x.Media,{src:i.videoUri??i.imageUri,type:i.videoUri?"video":"image"}),jsxRuntime.jsx(x.Title,{children:i.title}),jsxRuntime.jsx(x.Subtitle,{children:i.subtitle}),jsxRuntime.jsxs(T.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(x.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(x.Secondary,{marginLeft:"auto",title:i.secondaryButtonTitle,onClick:f}),jsxRuntime.jsx(x.Primary,{title:i.primaryButtonTitle,onClick:d})]})]},i.id):null}function uo({flowId:e,onComplete:t,variables:o,...r}){let{flow:n}=k(e,{variables:o});if(R(n,{onComplete:t}),n==null||n.isVisible===!1)return null;n.start();let i=n.getCurrentStep();return i==null||i.start(),jsxRuntime.jsx(ze,{step:i,flow:n,...r})}function go(){let{frigade:e}=U.useContext(B);return {frigade:e}}
40
+ var Ne=Object.defineProperty;var Ue=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var te=(e,t)=>{for(var o in t)Ne(e,o,{get:t[o],enumerable:!0});};var oe={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var re={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",inherit:"inherit",red500:"#c00000"};var ne={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,ie={neutral:{background:l("white"),border:l("gray500"),foreground:l("black"),surface:l("gray700"),active:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},focus:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},hover:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")}},primary:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500"),active:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")},focus:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500")},hover:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")}},secondary:{background:l("white"),border:l("gray800"),foreground:l("black"),surface:l("gray900"),active:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")},focus:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray900")},hover:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")}}};var se={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Je="px",Xe=e=>typeof e=="number"?`${4*e}${Je}`:e,Ge=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],ae=Object.fromEntries(Ge.map(e=>[e,Xe(e)]));var le={fontFamilies:{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:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var _={...oe,colors:{...re,...ie},...le,radii:ne,shadows:se,space:ae};function A(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let s=`${t.length?`${t}${o}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,A(p,s,o)):r[s]=p,r},{})}function z(e){return A(e,"--fr","-")}function pe(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=pe(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var de=z(_),c=pe(_);var Ye=new Set(["alt","size","src"]),Qe=qe__default.default.all.filter(e=>e.indexOf("-")!=0&&!Ye.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),Ze=Object.fromEntries(Qe),K=A(c.colors),et={color:K,backgroundColor:K,borderColor:K,border:c.borders,borderRadius:c.radii,borderWidth:c.borderWidths,boxShadow:c.shadows,fontFamily:c.fontFamilies,fontSize:c.fontSizes,fontWeight:c.fontWeights,gap:c.space,lineHeight:c.lineHeights,margin:c.space,marginBottom:c.space,marginLeft:c.space,marginRight:c.space,marginTop:c.space,padding:c.space,paddingBottom:c.space,paddingLeft:c.space,paddingRight:c.space,paddingTop:c.space},ce={...Ze,...et},ue={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},fe=new Set(["active","focus","focusVisible","focusWithin","hover"]);function tt(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):["string","number"].includes(typeof e)?new Map([e,e]):new Map}var me=new Map(Object.entries(ce).map(([e,t])=>[e,tt(t)])),ot=new Map(Object.entries(ue).map(([e,t])=>[e,new Set(t)])),rt=new Set(["height","width"]),nt=new Set(["canvas","embed","iframe","img","input","object","video"]);function ge(e){let[t,o]=e.split(":");return [t,fe.has(o)?o:null]}function xe(e,t="div"){let o=Object.assign({},e),r={};function n(i){if(i==null)return r;let p=`&:${i.replace(/[A-Z]/g,a=>`-${a.toLocaleLowerCase()}`)}`;return r[p]==null&&(r[p]={}),r[p]}return Object.entries(o).forEach(([i,s])=>{let[p,a]=ge(i),d=ot.get(p);d!=null&&(d.forEach(m=>{let f=`${m}${a?":"+a:""}`;o[f]=s;}),delete o[i]);}),Object.entries(o).forEach(([i,s])=>{let[p,a]=ge(i),d=me.get(p);if(d!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let m=s.split(" ");n(a)[p]=m.map(f=>d.get(f.toString())??f).join(" ");}else d.has(s.toString())?n(a)[p]=d.get(s.toString()):n(a)[p]=s;(typeof t!="string"||!nt.has(t)||!rt.has(p))&&delete o[i];}}),Object.keys(o).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&me.has(s)&&(o[s]=o[i],delete o[i]);}),{cssFromProps:r,unmatchedProps:o}}function st(){if(typeof window>"u"){let{JSDOM:e}=Ue("jsdom");return new e("<!DOCTYPE html>").window}return window}function ye(e){return e?{__html:it__default.default(st()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function lt(e){return e&&`fr-${e}`}function be(e){return e&&(Array.isArray(e)?e.map(t=>be(t)).join(" "):lt(e))}function pt({as:e,children:t,className:o,css:r={},part:n,...i},s){let p=e??"div",{cssFromProps:a,unmatchedProps:d}=xe(i,p),m=be(n),f=o||m?clsx.clsx(o,m):void 0,R=[{boxSizing:"border-box"},a,r];return typeof t=="string"?jsxRuntime.jsx(p,{className:f,css:R,...d,ref:s,dangerouslySetInnerHTML:ye(t)}):jsxRuntime.jsx(p,{className:f,css:R,...d,ref:s,children:t})}var u=U__namespace.forwardRef(pt);var j={};te(j,{Body1:()=>xt,Body2:()=>yt,Caption:()=>ht,Display1:()=>dt,Display2:()=>ct,H1:()=>ut,H2:()=>ft,H3:()=>mt,H4:()=>gt});var w={color:"neutral.foreground",fontFamily:"default",margin:"0"},dt={...w,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},ct={...w,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},ut={...w,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},ft={...w,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},mt={...w,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},gt={...w,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},xt={...w,fontSize:"md",fontWeight:"regular",lineHeight:"md"},yt={...w,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},ht={...w,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function Se({as:e="span",children:t,variant:o="Body1",...r}){return jsxRuntime.jsx(u,{as:e,...j[o],...r,children:t})}var Pt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],bt=Object.fromEntries(Pt.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsxRuntime.jsx(Se,{as:t,...r,variant:e,children:r.children});return o.displayName=`Text.${e}`,[e,o]})),b=Object.assign(Se,bt);var N={};te(N,{Link:()=>Ct,Plain:()=>wt,Primary:()=>St,Secondary:()=>Tt});var I={borderWidth:"0",borderRadius:"md",padding:"2 4"},St={...I,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface"},Tt={...I,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background"},Ct={...I,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},wt={...I,backgroundColor:"transparent",color:"neutral.foreground"};function Ce({as:e,children:t,part:o,title:r,variant:n="Primary",...i}){let s=n.toLocaleLowerCase();return jsxRuntime.jsxs(u,{as:e??"button",part:[`button-${s}`,o],...N[n],...i,children:[t,r&&jsxRuntime.jsx(b.Body2,{fontWeight:"demibold",color:"inherit",children:r})]})}var Bt=["Primary","Secondary","Link","Plain"],vt=Object.fromEntries(Bt.map(e=>{let t=o=>jsxRuntime.jsx(Ce,{...o,variant:e,children:o.children});return t.displayName=`Text.${e}`,[e,t]})),S=Object.assign(Ce,vt);var Ft=U__namespace.forwardRef(({children:e,css:t,...o},r)=>jsxRuntime.jsx(u,{css:[{display:"flex",flexDirection:"row"},t],...o,ref:r,children:e})),kt=U__namespace.forwardRef(({children:e,css:t,...o},r)=>jsxRuntime.jsx(u,{css:[{display:"flex",flexDirection:"column"},t],...o,ref:r,children:e})),T={Column:kt,Row:Ft};var F=U__namespace.forwardRef(({as:e,children:t,...o},r)=>{let n=e??T.Column;return jsxRuntime.jsx(n,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...o,ref:r,children:t})});function Re({part:e,src:t,...o}){return jsxRuntime.jsx(u,{as:"img",part:["image",e],src:t,...o})}function Ht(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Fe({part:e,src:t,...o}){let r=Ht(t);return jsxRuntime.jsx(u,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:r,...o})}function $({src:e,type:t,...o}){return jsxRuntime.jsx(t==="video"?Fe:Re,{src:e,...o})}function y({children:e,...t}){return jsxRuntime.jsx(h__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(h__namespace.Portal,{children:jsxRuntime.jsxs(u,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(h__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(u,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(h__namespace.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsxRuntime.jsx(F,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog-content",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...t,children:e})})]})})})}y.Close=e=>jsxRuntime.jsx(h__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(S.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});y.Subtitle=({children:e,...t})=>jsxRuntime.jsx(h__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(b.Body2,{mb:5,part:"subtitle",...t,children:e})});y.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx($,{borderRadius:"md",src:e,...t});y.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(S.Primary,{title:t,onClick:e,...o});y.ProgressDots=({current:e,total:t})=>{let o=[...Array(t)].map((r,n)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?c.colors.blue500:c.colors.blue800},n));return jsxRuntime.jsx(u,{as:"svg",height:"8px",margin:"5 auto",part:"progress",viewBox:`0 0 ${16*t-8} 8`,width:16*t-8,children:o})};y.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(S.Secondary,{title:t,onClick:e,...o});y.Title=({children:e,...t})=>jsxRuntime.jsx(h__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(b.H3,{mb:1,part:"title",...t,children:e})});var B=U.createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function jt({children:e,navigate:t,theme:o,...r}){let n=o?z(o):{},[i,s]=U.useState([]),p=U.useRef(new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowConfigOverrides:r.__flowConfigOverrides})),a=t??((d,m="_self")=>{window.open(d,m);});return U.useEffect(()=>()=>{var d;(d=p.current)==null||d.destroy();},[]),jsxRuntime.jsxs(B.Provider,{value:{modals:i,setModals:s,navigate:a,...r,frigade:p.current},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...de,...n}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:c,children:e})]})}function k(e,t){let[o,r]=U.useState(),[n,i]=U.useState(""),{frigade:s}=U.useContext(B),p=a=>{a.id===e&&(t!=null&&t.variables&&a.applyVariables(t.variables),r(a),i(Math.random().toString()));};return U.useEffect(()=>((async()=>{let a=await s.getFlow(e);if(!a||s.hasFailedToLoad()){r(void 0);return}t!=null&&t.variables&&a.applyVariables(t.variables),r(a);})(),s.onStateChange(p),()=>{s.removeStateChangeHandler(p);}),[]),{flow:o}}function v(e,{onComplete:t,onDismiss:o}={}){let r=U.useRef(null);return U.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&(async()=>await(t==null?void 0:t(e)))(),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:U.useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function D(e,{onPrimary:t,onSecondary:o}={}){let{navigate:r}=U.useContext(B);return {handlePrimary:U.useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:U.useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function Qt({dismissible:e=!0,flowId:t,onComplete:o,onDismiss:r,onPrimary:n,onSecondary:i,variables:s,...p}){let{flow:a}=k(t,{variables:s}),d=a==null?void 0:a.getCurrentStep(),{handleDismiss:m}=v(a,{onComplete:o,onDismiss:r}),{handlePrimary:f,handleSecondary:R}=D(d,{onPrimary:n,onSecondary:i});return a==null||a.isVisible===!1?null:(a.start(),d==null||d.start(),jsxRuntime.jsxs(y,{...p,children:[e&&jsxRuntime.jsx(y.Close,{onClick:m}),jsxRuntime.jsx(y.Title,{children:d.title}),jsxRuntime.jsx(y.Subtitle,{children:d.subtitle}),jsxRuntime.jsx(y.Media,{src:d.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(y.ProgressDots,{current:a.getNumberOfCompletedSteps(),total:a.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(T.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsxRuntime.jsx(y.Secondary,{title:"Secondary",onClick:R}),jsxRuntime.jsx(y.Primary,{title:"Primary",onClick:f})]})]}))}function eo({dismissible:e=!0,flowId:t,onComplete:o,onDismiss:r,onPrimary:n,onSecondary:i,...s}){let{flow:p}=k(t),a=p==null?void 0:p.getCurrentStep(),{handleDismiss:d}=v(p,{onComplete:o,onDismiss:r}),{handlePrimary:m,handleSecondary:f}=D(a,{onPrimary:n,onSecondary:i});return p==null||p.isVisible===!1?null:(p.start(),a==null||a.start(),jsxRuntime.jsxs(F,{as:T.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...s,children:[jsxRuntime.jsxs(T.Row,{gap:3,children:[jsxRuntime.jsx("img",{src:a.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(T.Column,{children:[jsxRuntime.jsx(b.H4,{mb:1,children:a.title}),jsxRuntime.jsx(b.Body2,{children:a.subtitle})]})]}),jsxRuntime.jsxs(T.Row,{alignItems:"center",gap:3,children:[jsxRuntime.jsx(S.Secondary,{title:a.secondaryButtonTitle,onClick:f}),jsxRuntime.jsx(S.Primary,{title:a.primaryButtonTitle,onClick:m}),e&&jsxRuntime.jsx(S.Plain,{part:"banner-close",onClick:d,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function J(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=U.useState(e),[r,n]=U.useState(null),i=U.useCallback(s=>{n(s);},[]);return U.useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:i}}var no=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Ae({style:e={},part:t="",...o}){return jsxRuntime.jsxs(u,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsxRuntime.jsx(u,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${no}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(u,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function $e({props:e,alignAttr:t,sideAttr:o}){let r=o??"bottom",n={},i=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=s;let a=i();return ["before","end"].includes(a)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(a)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var We={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Ve(e,t){let o=Object.fromEntries(We.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r=Object.fromEntries(We.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let n={after:"end",before:"start"},i=(f,R)=>["top","bottom"].includes(R)?f=="after"?"marginLeft":"marginRight":f=="after"?"marginTop":"marginBottom",s=o.alignOffset??0,p=o.style??{},a=o.side??"bottom",d=o.align;o.style={...p,[i(d,a)]:s};let m=["top","bottom"].includes(a)?t.width:t.height;o.alignOffset=(m+s)*-1,o.align=n[d];}return {contentProps:o,rootProps:r}}function x({anchor:e,children:t,className:o,spotlight:r=!1,style:n,...i}){let{node:s,rect:p,ref:a}=J(),{contentProps:d,rootProps:m}=Ve(i,p),[f,R]=U.useState(d.align),[Y,ze]=U.useState(d.side);if(s!==null){let M=s.getAttribute("data-align"),ee=s.getAttribute("data-side");f!==M&&R(M),Y!==ee&&ze(ee);}let Q=U.useRef(null),[W,Ke]=U.useState(null);if(U.useEffect(()=>{let M=document.querySelector(e);M!=null&&(Q.current=M,Ke(Q));},[e]),W==null)return null;let V=W.current.getBoundingClientRect(),Z="0";typeof window<"u"&&(Z=window.getComputedStyle(W.current).borderRadius);let je=$e({props:i,alignAttr:f,sideAttr:Y});return jsxRuntime.jsxs(C__namespace.Root,{defaultOpen:!0,...m,children:[jsxRuntime.jsx(C__namespace.Anchor,{virtualRef:W}),jsxRuntime.jsx(C__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[r&&jsxRuntime.jsx(u,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:Z,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:V.height,left:V.left,top:V.top,width:V.width}}),jsxRuntime.jsx(C__namespace.Content,{asChild:!0,...d,ref:a,children:jsxRuntime.jsxs(F,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...n},children:[jsxRuntime.jsx(Ae,{style:je}),t]})})]})})]})}x.Close=e=>jsxRuntime.jsx(C__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(S.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});x.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx($,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});x.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(S.Primary,{title:t,onClick:e,...o});x.Progress=({children:e,...t})=>e==null?null:jsxRuntime.jsx(b.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});x.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(S.Secondary,{title:t,onClick:e,...o});x.Subtitle=({children:e,...t})=>e==null?null:jsxRuntime.jsx(b.Body2,{part:"subtitle",...t,children:e});x.Title=({children:e,...t})=>e==null?null:jsxRuntime.jsx(b.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function q(e){let{modals:t,setModals:o}=U.useContext(B),[r,n]=U.useState(!1);return U.useEffect(()=>(o([...t,e]),()=>o(t.filter(i=>i!==e))),[]),U.useEffect(()=>{let i=t[0]===e;i!==r&&n(i);},[t]),{isCurrentModal:r}}function _e({dismissible:e=!0,flow:t,onDismiss:o,onPrimary:r,onSecondary:n,step:i,...s}){let{isCurrentModal:p}=q(`${t.id}-${i.id}`),{handleDismiss:a}=v(t,{onDismiss:o}),{handlePrimary:d,handleSecondary:m}=D(i,{onPrimary:r,onSecondary:n});return p?jsxRuntime.jsxs(x,{anchor:i.selector,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),...s,children:[e&&jsxRuntime.jsx(x.Close,{onClick:a}),jsxRuntime.jsx(x.Media,{src:i.videoUri??i.imageUri,type:i.videoUri?"video":"image"}),jsxRuntime.jsx(x.Title,{children:i.title}),jsxRuntime.jsx(x.Subtitle,{children:i.subtitle}),jsxRuntime.jsxs(T.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(x.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(x.Secondary,{marginLeft:"auto",title:i.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(x.Primary,{title:i.primaryButtonTitle,onClick:d})]})]},i.id):null}function uo({flowId:e,onComplete:t,variables:o,...r}){let{flow:n}=k(e,{variables:o});if(v(n,{onComplete:t}),n==null||n.isVisible===!1)return null;n.start();let i=n.getCurrentStep();return i==null||i.start(),jsxRuntime.jsx(_e,{step:i,flow:n,...r})}function go(){let{frigade:e}=U.useContext(B);return {frigade:e}}
41
41
 
42
42
  exports.Announcement = Qt;
43
43
  exports.Banner = eo;
@@ -45,13 +45,13 @@ exports.Box = u;
45
45
  exports.Button = S;
46
46
  exports.Card = F;
47
47
  exports.Flex = T;
48
- exports.Provider = Nt;
48
+ exports.Provider = jt;
49
49
  exports.Text = b;
50
50
  exports.Tooltip = x;
51
51
  exports.Tour = uo;
52
52
  exports.useBoundingClientRect = J;
53
53
  exports.useFlow = k;
54
- exports.useFlowHandlers = R;
54
+ exports.useFlowHandlers = v;
55
55
  exports.useFrigade = go;
56
56
  exports.useModal = q;
57
57
  exports.useStepHandlers = D;