@frigade/react 2.0.11 → 2.0.13

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  var w = require('@radix-ui/react-dialog');
4
4
  var solid = require('@heroicons/react/24/solid');
5
- var be = require('react');
5
+ var Se = require('react');
6
6
  var clsx = require('clsx');
7
7
  var Zo = require('known-css-properties');
8
8
  var lt = require('dompurify');
@@ -37,7 +37,7 @@ function _interopNamespace(e) {
37
37
  }
38
38
 
39
39
  var w__namespace = /*#__PURE__*/_interopNamespace(w);
40
- var be__namespace = /*#__PURE__*/_interopNamespace(be);
40
+ var Se__namespace = /*#__PURE__*/_interopNamespace(Se);
41
41
  var Zo__default = /*#__PURE__*/_interopDefault(Zo);
42
42
  var lt__default = /*#__PURE__*/_interopDefault(lt);
43
43
  var Y__namespace = /*#__PURE__*/_interopNamespace(Y);
@@ -45,7 +45,7 @@ var Q__namespace = /*#__PURE__*/_interopNamespace(Q);
45
45
  var C__namespace = /*#__PURE__*/_interopNamespace(C);
46
46
  var I__namespace = /*#__PURE__*/_interopNamespace(I);
47
47
 
48
- var Jo=Object.defineProperty;var Xo=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,t)=>(typeof require<"u"?require:o)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var z=(e,o)=>{for(var t in o)Jo(e,t,{get:o[t],enumerable:!0});};var Ie={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Me={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 He={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,We={neutral:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray700"),active:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},focus:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},hover:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")}},primary:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500"),active:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")},focus:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500")},hover:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")}},secondary:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray900"),active:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")},focus:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray900")},hover:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")}}};var Ae={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var qo="px",Yo=e=>typeof e=="number"?`${4*e}${qo}`:e,Qo=[-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"],Le=Object.fromEntries(Qo.map(e=>[e,Yo(e)]));var Ve={fontFamilies:{default:"inherit"},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 ue={...Ie,colors:{...Me,...We},...Ve,radii:He,shadows:Ae,space:Le};function ee(e,o="",t="."){return Object.keys(e).reduce((i,n)=>{let a=`${o.length?`${o}${t}`:""}${n}`,s=e[n];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(i,ee(s,a,t)):i[a]=s,i},{})}function fe(e){return ee(e,"--fr","-")}function $e(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let n=e[i];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[i]=$e(n,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var ge=fe(ue),y=$e(ue);var et=new Set(["alt","size","src"]),ot=Zo__default.default.all.filter(e=>e.indexOf("-")!=0&&!et.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),tt=Object.fromEntries(ot),xe=ee(y.colors),rt={color:xe,backgroundColor:xe,borderColor:xe,border:y.borders,borderRadius:y.radii,borderWidth:y.borderWidths,boxShadow:y.shadows,fontFamily:y.fontFamilies,fontSize:y.fontSizes,fontWeight:y.fontWeights,gap:y.space,lineHeight:y.lineHeights,margin:y.space,marginBottom:y.space,marginLeft:y.space,marginRight:y.space,marginTop:y.space,padding:y.space,paddingBottom:y.space,paddingLeft:y.space,paddingRight:y.space,paddingTop:y.space},_e={...tt,...rt},ze={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"]},je=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function nt(e){return Array.isArray(e)?new Map(e.map(o=>[o,o])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):typeof e=="string"||typeof e=="number"?new Map([[e,e]]):new Map}var Ne=new Map(Object.entries(_e).map(([e,o])=>[e,nt(o)])),it=new Map(Object.entries(ze).map(([e,o])=>[e,new Set(o)])),st=new Set(["height","width"]),at=new Set(["canvas","embed","iframe","img","input","object","video"]);function Ke(e){let[o,t]=e.split(":");return [o,je.has(t)?t:null]}function Ue(e,o="div"){let t=Object.assign({},e),i={};function n(r){if(r==null)return i;let s=`&:${r.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[s]==null&&(i[s]={}),i[s]}return Object.entries(t).forEach(([r,a])=>{let[s,d]=Ke(r),m=it.get(s);m!=null&&(m.forEach(u=>{let f=`${u}${d?":"+d:""}`;t[f]=a;}),delete t[r]);}),Object.entries(t).forEach(([r,a])=>{let[s,d]=Ke(r),m=Ne.get(s);if(m!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let u=a.split(" ");n(d)[s]=u.map(f=>m.get(f.toString())??f).join(" ");}else m.has(a.toString())?n(d)[s]=m.get(a.toString()):n(d)[s]=a;(typeof o!="string"||!at.has(o)||!st.has(s))&&delete t[r];}}),Object.keys(t).forEach(r=>{let a=r.substring(1);r.indexOf("_")===0&&Ne.has(a)&&(t[a]=t[r],delete t[r]);}),{cssFromProps:i,unmatchedProps:t}}function pt(){if(typeof window>"u"){let{JSDOM:e}=Xo("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ge(e){return e?{__html:lt__default.default(pt()).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 ct(e){return e&&`fr-${e}`}function qe(e){return e&&(Array.isArray(e)?e.map(o=>qe(o)).join(" "):ct(e))}function mt({as:e,children:o,className:t,css:i={},part:n,...r},a){let s=e??"div",{cssFromProps:d,unmatchedProps:m}=Ue(r,s),u=qe(n),f=t||u?clsx.clsx(t,u):void 0,h=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsxRuntime.jsx(s,{className:f,css:h,...m,ref:a,dangerouslySetInnerHTML:Ge(o)}):jsxRuntime.jsx(s,{className:f,css:h,...m,ref:a,children:o})}var l=be__namespace.forwardRef(mt);var g={};z(g,{Body1:()=>kt,Body2:()=>Dt,Caption:()=>Et,Display1:()=>Ft,Display2:()=>Tt,H1:()=>wt,H2:()=>Rt,H3:()=>Bt,H4:()=>vt});var ye={};z(ye,{Body1:()=>bt,Body2:()=>Pt,Caption:()=>Ct,Display1:()=>ut,Display2:()=>ft,H1:()=>gt,H2:()=>xt,H3:()=>yt,H4:()=>ht});var M={color:"neutral.foreground",fontFamily:"default",margin:"0"},ut={...M,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},ft={...M,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},gt={...M,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},xt={...M,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},yt={...M,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},ht={...M,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},bt={...M,fontSize:"md",fontWeight:"regular",lineHeight:"md"},Pt={...M,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Ct={...M,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var St=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],H=Object.fromEntries(St.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=be__namespace.forwardRef(({as:i=o,children:n,...r},a)=>jsxRuntime.jsx(l,{as:i,...ye[e],...r,ref:a,children:n}));return t.displayName=`Text.${e}`,[e,t]})),Ft=H.Display1,Tt=H.Display2,wt=H.H1,Rt=H.H2,Bt=H.H3,vt=H.H4,kt=H.Body1,Dt=H.Body2,Et=H.Caption;var he={};z(he,{Link:()=>Ht,Plain:()=>Wt,Primary:()=>It,Secondary:()=>Mt});var se={borderWidth:"0",borderRadius:"md",display:"flex",gap:"2",padding:"2 4"},It={...se,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},Mt={...se,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},Ht={...se,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Wt={...se,backgroundColor:"transparent",color:"neutral.foreground"};function Qe({as:e,children:o,part:t,title:i,variant:n="Primary",...r}){let a=n.toLocaleLowerCase();return jsxRuntime.jsxs(l,{as:e??"button",part:[`button-${a}`,t],...he[n],...r,children:[o,i&&jsxRuntime.jsx(g.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}var At=["Primary","Secondary","Link","Plain"],Lt=Object.fromEntries(At.map(e=>{let o=t=>jsxRuntime.jsx(Qe,{...t,variant:e,children:t.children});return o.displayName=`Button.${e}`,[e,o]})),b=Object.assign(Qe,Lt);var x={};z(x,{Column:()=>_t,Row:()=>$t});var $t=be__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),_t=be__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var v=be.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function Xt({children:e,navigate:o,theme:t,...i}){let n=t?fe(t):{},[r,a]=be.useState(new Set),s=be.useMemo(()=>new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,__readOnly:i.__readOnly,__flowConfigOverrides:i.__flowConfigOverrides}),[i.userId,i.groupId,i.apiKey]),d=o??((u,f="_self")=>{window.open(u,f);});be.useEffect(()=>()=>{s.destroy();},[]);let m=r.size>0?r.values().next().value:null;return jsxRuntime.jsxs(v.Provider,{value:{modals:r,setModals:a,currentModal:m,navigate:d,...i,frigade:s},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...ge,...n}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:y,children:e})]})}function oe(e,o){let[t,i]=be.useState(),[,n]=be.useState(""),{frigade:r}=be.useContext(v),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),i(s),n(Math.random().toString()));};return be.useEffect(()=>((async()=>{let s=await r.getFlow(e);if(!s||r.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),i(s);})(),r.onStateChange(a),()=>{r.removeStateChangeHandler(a);}),[]),{flow:t}}function j(e,{onComplete:o,onDismiss:t}={}){let i=be.useRef(null);return be.useEffect(()=>{e!=null&&(e.isCompleted&&i.current===!1&&(async()=>await(o==null?void 0:o(e)))(),i.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:be.useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function N(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=be.useContext(v);return {handlePrimary:be.useCallback(async(n,r)=>await(o==null?void 0:o(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:be.useCallback(async(n,r)=>await(t==null?void 0:t(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function te(e){let{currentModal:o,modals:t,setModals:i}=be.useContext(v),[n,r]=be.useState(!1);be.useEffect(()=>{e!=null&&e.isVisible&&e&&!t.has(e.id)&&i(s=>new Set(s).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),be.useEffect(()=>{let s=o===(e==null?void 0:e.id);(e==null?void 0:e.id)!=null&&s!==n&&r(s);},[e==null?void 0:e.id,o]);function a(){t.has(e==null?void 0:e.id)&&i(s=>{let d=new Set(s);return d.delete(e==null?void 0:e.id),d});}return {isCurrentModal:n,removeModal:a}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:n,onComplete:r,onDismiss:a,onPrimary:s,onSecondary:d,variables:m,...u}){let{flow:f}=oe(n,{variables:m}),h=f==null?void 0:f.getCurrentStep(),{handleDismiss:T}=j(f,{onComplete:r,onDismiss:a}),{handlePrimary:q,handleSecondary:_}=N(h,{onPrimary:s,onSecondary:d}),{isCurrentModal:Z,removeModal:ne}=te(f);return be.useEffect(()=>{!(f!=null&&f.isVisible)&&Z&&ne();},[f==null?void 0:f.isVisible,Z]),f==null||!f.isVisible||!Z?null:(f.start(),h.start(),jsxRuntime.jsx(e??l,{position:"relative",...u,children:o({flow:f,handleDismiss:T,handlePrimary:q,handleSecondary:_,parentProps:{container:t,dismissible:i,flowId:n,variables:m,...u},step:h})}))}function io(e){return jsxRuntime.jsx(O,{as:c,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},step:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsxRuntime.jsx(c.Title,{children:r.title}),n&&jsxRuntime.jsx(c.Dismiss,{onClick:o}),jsxRuntime.jsx(c.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),jsxRuntime.jsx(c.Media,{src:r.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(x.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(c.Secondary,{title:r.secondaryButtonTitle,onClick:i}),jsxRuntime.jsx(c.Primary,{title:r.primaryButtonTitle??"Continue",onClick:t})]})]})})}function so({part:e,src:o,...t}){return jsxRuntime.jsx(l,{as:"img",part:["image",e],src:o,...t})}function pr(e){var o,t,i,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(i=e.split("wistia.com/medias/")[1])==null?void 0:i.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function lo({part:e,src:o,...t}){let i=pr(o);return i?jsxRuntime.jsx(l,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:i,...t}):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(l,{as:"video",controls:!0,part:["video",e],src:o,...t}):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function U({src:e,type:o,...t}){return jsxRuntime.jsx(o==="video"?lo:so,{src:e,...t})}var c=be__namespace.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsxRuntime.jsx(io,{flowId:o,...t});let n=t.as??x.Column;return jsxRuntime.jsx(n,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});c.Dismiss=e=>jsxRuntime.jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})});c.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md",src:e,...o});c.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});c.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});c.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.Body2,{display:"block",part:"subtitle",...o,children:e});c.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});function F({children:e,...o}){return jsxRuntime.jsx(w__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(w__namespace.Portal,{children:jsxRuntime.jsxs(l,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(w__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(l,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(w__namespace.Content,{asChild:!0,onOpenAutoFocus:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),children:jsxRuntime.jsx(c,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}F.Dismiss=e=>jsxRuntime.jsx(w__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});F.Subtitle=({children:e,...o})=>jsxRuntime.jsx(w__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(g.Body2,{part:"subtitle",...o,children:e})});F.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md",src:e,...o});F.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});F.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,n)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?y.colors.blue500:y.colors.blue800},n));return jsxRuntime.jsx(l,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};F.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});F.Title=({children:e,...o})=>jsxRuntime.jsx(w__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(g.H3,{part:"title",...o,children:e})});function fr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:F,dismissible:!0,flowId:e,...o,children:({flow:t,handleDismiss:i,handlePrimary:n,handleSecondary:r,parentProps:{dismissible:a},step:s})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx(F.Dismiss,{onClick:i}),jsxRuntime.jsxs(x.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(F.Title,{children:s.title}),jsxRuntime.jsx(F.Subtitle,{children:s.subtitle})]}),jsxRuntime.jsx(F.Media,{src:s.videoUri??s.imageUri,type:s.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(F.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(x.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[s.secondaryButtonTitle&&jsxRuntime.jsx(F.Secondary,{onClick:r,title:s.secondaryButtonTitle}),s.primaryButtonTitle&&jsxRuntime.jsx(F.Primary,{onClick:n,title:s.primaryButtonTitle??"Continue"})]})]})})}function xr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:c,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:n,step:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(x.Row,{gap:3,children:[r.imageUri&&jsxRuntime.jsx("img",{src:r.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(x.Column,{children:[jsxRuntime.jsx(g.H4,{mb:1,children:r.title}),jsxRuntime.jsx(g.Body2,{color:"gray500",children:r.subtitle})]})]}),jsxRuntime.jsxs(x.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[r.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:n}),jsxRuntime.jsx(b.Primary,{title:r.primaryButtonTitle,onClick:i}),o.dismissible&&jsxRuntime.jsx(c.Dismiss,{onClick:t})]})]})})}var Po={};z(Po,{Collapsible:()=>bo,CollapsibleStep:()=>le});var le={};z(le,{Content:()=>Fe,Root:()=>Te,Trigger:()=>we});var br=react.keyframes`
48
+ var Jo=Object.defineProperty;var Xo=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,t)=>(typeof require<"u"?require:o)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var z=(e,o)=>{for(var t in o)Jo(e,t,{get:o[t],enumerable:!0});};var We={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Ae={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 Le={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Ve={neutral:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray700"),active:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},focus:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},hover:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")}},primary:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500"),active:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")},focus:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500")},hover:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")}},secondary:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray900"),active:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")},focus:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray900")},hover:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")}}};var $e={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var qo="px",Yo=e=>typeof e=="number"?`${4*e}${qo}`:e,Qo=[-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"],_e=Object.fromEntries(Qo.map(e=>[e,Yo(e)]));var ze={fontFamilies:{default:"inherit"},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 xe={...We,colors:{...Ae,...Ve},...ze,radii:Le,shadows:$e,space:_e};function ee(e,o="",t="."){return Object.keys(e).reduce((i,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,a=e[n];return typeof a=="object"&&a!==null&&!Array.isArray(a)?Object.assign(i,ee(a,s,t)):i[s]=a,i},{})}function ye(e){return ee(e,"--fr","-")}function je(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let n=e[i];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[i]=je(n,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var he=ye(xe),y=je(xe);var et=new Set(["alt","size","src"]),ot=Zo__default.default.all.filter(e=>e.indexOf("-")!=0&&!et.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),tt=Object.fromEntries(ot),be=ee(y.colors),rt={color:be,backgroundColor:be,borderColor:be,border:y.borders,borderRadius:y.radii,borderWidth:y.borderWidths,boxShadow:y.shadows,fontFamily:y.fontFamilies,fontSize:y.fontSizes,fontWeight:y.fontWeights,gap:y.space,lineHeight:y.lineHeights,margin:y.space,marginBottom:y.space,marginLeft:y.space,marginRight:y.space,marginTop:y.space,padding:y.space,paddingBottom:y.space,paddingLeft:y.space,paddingRight:y.space,paddingTop:y.space},Ne={...tt,...rt},Ke={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"]},Ue=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function nt(e){return Array.isArray(e)?new Map(e.map(o=>[o,o])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):typeof e=="string"||typeof e=="number"?new Map([[e,e]]):new Map}var Ge=new Map(Object.entries(Ne).map(([e,o])=>[e,nt(o)])),it=new Map(Object.entries(Ke).map(([e,o])=>[e,new Set(o)])),st=new Set(["height","width"]),at=new Set(["canvas","embed","iframe","img","input","object","video"]);function Je(e){let[o,t]=e.split(":");return [o,Ue.has(t)?t:null]}function Xe(e,o="div"){let t=Object.assign({},e),i={};function n(r){if(r==null)return i;let a=`&:${r.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[a]==null&&(i[a]={}),i[a]}return Object.entries(t).forEach(([r,s])=>{let[a,d]=Je(r),m=it.get(a);m!=null&&(m.forEach(f=>{let h=`${f}${d?":"+d:""}`;t[h]=s;}),delete t[r]);}),Object.entries(t).forEach(([r,s])=>{let[a,d]=Je(r),m=Ge.get(a);if(m!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(d)[a]=f.map(h=>m.get(h.toString())??h).join(" ");}else m.has(s.toString())?n(d)[a]=m.get(s.toString()):n(d)[a]=s;(typeof o!="string"||!at.has(o)||!st.has(a))&&delete t[r];}}),Object.keys(t).forEach(r=>{let s=r.substring(1);r.indexOf("_")===0&&Ge.has(s)&&(t[s]=t[r],delete t[r]);}),{cssFromProps:i,unmatchedProps:t}}function pt(){if(typeof window>"u"){let{JSDOM:e}=Xo("jsdom");return new e("<!DOCTYPE html>").window}return window}function qe(e){return e?{__html:lt__default.default(pt()).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 ct(e){return e&&`fr-${e}`}function Ze(e){return e&&(Array.isArray(e)?e.map(o=>Ze(o)).join(" "):ct(e))}function mt({as:e,children:o,className:t,css:i={},part:n,...r},s){let a=e??"div",{cssFromProps:d,unmatchedProps:m}=Xe(r,a),f=Ze(n),h=t||f?clsx.clsx(t,f):void 0,c=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsxRuntime.jsx(a,{className:h,css:c,...m,ref:s,dangerouslySetInnerHTML:qe(o)}):jsxRuntime.jsx(a,{className:h,css:c,...m,ref:s,children:o})}var l=Se__namespace.forwardRef(mt);var g={};z(g,{Body1:()=>kt,Body2:()=>Dt,Caption:()=>Et,Display1:()=>Ft,Display2:()=>Tt,H1:()=>wt,H2:()=>Rt,H3:()=>Bt,H4:()=>vt});var Pe={};z(Pe,{Body1:()=>bt,Body2:()=>Pt,Caption:()=>Ct,Display1:()=>ut,Display2:()=>ft,H1:()=>gt,H2:()=>xt,H3:()=>yt,H4:()=>ht});var M={color:"neutral.foreground",fontFamily:"default",margin:"0"},ut={...M,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},ft={...M,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},gt={...M,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},xt={...M,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},yt={...M,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},ht={...M,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},bt={...M,fontSize:"md",fontWeight:"regular",lineHeight:"md"},Pt={...M,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Ct={...M,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var St=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],H=Object.fromEntries(St.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Se__namespace.forwardRef(({as:i=o,children:n,...r},s)=>jsxRuntime.jsx(l,{as:i,...Pe[e],...r,ref:s,children:n}));return t.displayName=`Text.${e}`,[e,t]})),Ft=H.Display1,Tt=H.Display2,wt=H.H1,Rt=H.H2,Bt=H.H3,vt=H.H4,kt=H.Body1,Dt=H.Body2,Et=H.Caption;var Ce={};z(Ce,{Link:()=>Ht,Plain:()=>Wt,Primary:()=>It,Secondary:()=>Mt});var se={borderWidth:"0",borderRadius:"md",display:"flex",gap:"2",padding:"2 4"},It={...se,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},Mt={...se,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},Ht={...se,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Wt={...se,backgroundColor:"transparent",color:"neutral.foreground"};function oo({as:e,children:o,part:t,title:i,variant:n="Primary",...r}){let s=n.toLocaleLowerCase();return jsxRuntime.jsxs(l,{as:e??"button",part:[`button-${s}`,t],...Ce[n],...r,children:[o,i&&jsxRuntime.jsx(g.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}var At=["Primary","Secondary","Link","Plain"],Lt=Object.fromEntries(At.map(e=>{let o=t=>jsxRuntime.jsx(oo,{...t,variant:e,children:t.children});return o.displayName=`Button.${e}`,[e,o]})),b=Object.assign(oo,Lt);var x={};z(x,{Column:()=>_t,Row:()=>$t});var $t=Se__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),_t=Se__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var v=Se.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function Xt({children:e,navigate:o,theme:t,...i}){let n=t?ye(t):{},[r,s]=Se.useState(new Set),a=Se.useMemo(()=>new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,__readOnly:i.__readOnly,__flowConfigOverrides:i.__flowConfigOverrides}),[i.userId,i.groupId,i.apiKey]),d=o??((f,h="_self")=>{window.open(f,h);});Se.useEffect(()=>()=>{a.destroy();},[]);let m=r.size>0?r.values().next().value:null;return jsxRuntime.jsxs(v.Provider,{value:{modals:r,setModals:s,currentModal:m,navigate:d,...i,frigade:a},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...he,...n}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:y,children:e})]})}function oe(e,o){let[t,i]=Se.useState(),[,n]=Se.useState(""),{frigade:r}=Se.useContext(v),s=a=>{a.id===e&&(o!=null&&o.variables&&a.applyVariables(o.variables),i(a),n(Math.random().toString()));};return Se.useEffect(()=>((async()=>{let a=await r.getFlow(e);if(!a||r.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&a.applyVariables(o.variables),i(a);})(),r.onStateChange(s),()=>{r.removeStateChangeHandler(s);}),[]),{flow:t}}function j(e,{onComplete:o,onDismiss:t}={}){let i=Se.useRef(null);return Se.useEffect(()=>{e!=null&&(e.isCompleted&&i.current===!1&&(async()=>await(o==null?void 0:o(e)))(),i.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:Se.useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function N(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=Se.useContext(v);return {handlePrimary:Se.useCallback(async(n,r)=>await(o==null?void 0:o(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:Se.useCallback(async(n,r)=>await(t==null?void 0:t(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function te(e,o=!0){let{currentModal:t,modals:i,setModals:n}=Se.useContext(v),[r,s]=Se.useState(!1);Se.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!i.has(e.id)&&n(d=>new Set(d).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),Se.useEffect(()=>{let d=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&d!==r&&s(d);},[e==null?void 0:e.id,t]);function a(){o&&i.has(e==null?void 0:e.id)&&n(d=>{let m=new Set(d);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:r||!o,removeModal:a}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:n,onComplete:r,onDismiss:s,onPrimary:a,onSecondary:d,variables:m,forceMount:f,...h}){let{flow:c}=oe(n,{variables:m}),S=c==null?void 0:c.getCurrentStep(),{handleDismiss:q}=j(c,{onComplete:r,onDismiss:s}),{handlePrimary:_,handleSecondary:ue}=N(S,{onPrimary:a,onSecondary:d}),ne=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:Z,removeModal:fe}=te(c,ne);if(Se.useEffect(()=>{!(c!=null&&c.isVisible)&&Z&&fe();},[c==null?void 0:c.isVisible,Z]),c==null||!Z)return null;let ge=f&&c.isCompleted;return !c.isVisible&&!ge?null:(!c.isCompleted&&!c.isSkipped&&S.start(),jsxRuntime.jsx(e??l,{position:"relative",...h,children:o({flow:c,handleDismiss:q,handlePrimary:_,handleSecondary:ue,parentProps:{container:t,dismissible:i,flowId:n,variables:m,...h},step:S})}))}function lo(e){return jsxRuntime.jsx(O,{as:u,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},step:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsxRuntime.jsx(u.Title,{children:r.title}),n&&jsxRuntime.jsx(u.Dismiss,{onClick:o}),jsxRuntime.jsx(u.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),jsxRuntime.jsx(u.Media,{src:r.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(x.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(u.Secondary,{title:r.secondaryButtonTitle,onClick:i}),jsxRuntime.jsx(u.Primary,{title:r.primaryButtonTitle??"Continue",onClick:t})]})]})})}function po({part:e,src:o,...t}){return jsxRuntime.jsx(l,{as:"img",part:["image",e],src:o,...t})}function pr(e){var o,t,i,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(i=e.split("wistia.com/medias/")[1])==null?void 0:i.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function mo({part:e,src:o,...t}){let i=pr(o);return i?jsxRuntime.jsx(l,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:i,...t}):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(l,{as:"video",controls:!0,part:["video",e],src:o,...t}):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function U({src:e,type:o,...t}){return jsxRuntime.jsx(o==="video"?mo:po,{src:e,...t})}var u=Se__namespace.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsxRuntime.jsx(lo,{flowId:o,...t});let n=t.as??x.Column;return jsxRuntime.jsx(n,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});u.Dismiss=e=>jsxRuntime.jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})});u.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md",src:e,...o});u.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});u.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});u.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.Body2,{display:"block",part:"subtitle",...o,children:e});u.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});function F({children:e,...o}){return jsxRuntime.jsx(w__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsx(w__namespace.Portal,{children:jsxRuntime.jsxs(l,{inset:"0",position:"fixed",zIndex:"9999",children:[jsxRuntime.jsx(w__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(l,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsxRuntime.jsx(w__namespace.Content,{asChild:!0,onOpenAutoFocus:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),children:jsxRuntime.jsx(u,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}F.Dismiss=e=>jsxRuntime.jsx(w__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});F.Subtitle=({children:e,...o})=>jsxRuntime.jsx(w__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(g.Body2,{part:"subtitle",...o,children:e})});F.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md",src:e,...o});F.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});F.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,n)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?y.colors.blue500:y.colors.blue800},n));return jsxRuntime.jsx(l,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};F.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});F.Title=({children:e,...o})=>jsxRuntime.jsx(w__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(g.H3,{part:"title",...o,children:e})});F.displayName="Dialog";function fr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:F,dismissible:!0,flowId:e,...o,children:({flow:t,handleDismiss:i,handlePrimary:n,handleSecondary:r,parentProps:{dismissible:s},step:a})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(F.Dismiss,{onClick:i}),jsxRuntime.jsxs(x.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(F.Title,{children:a.title}),jsxRuntime.jsx(F.Subtitle,{children:a.subtitle})]}),jsxRuntime.jsx(F.Media,{src:a.videoUri??a.imageUri,type:a.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(F.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(x.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[a.secondaryButtonTitle&&jsxRuntime.jsx(F.Secondary,{onClick:r,title:a.secondaryButtonTitle}),a.primaryButtonTitle&&jsxRuntime.jsx(F.Primary,{onClick:n,title:a.primaryButtonTitle??"Continue"})]})]})})}function xr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:u,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:n,step:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(x.Row,{gap:3,children:[r.imageUri&&jsxRuntime.jsx(l,{as:"img",part:"image",src:r.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(x.Column,{children:[jsxRuntime.jsx(g.H4,{part:"title",children:r.title}),jsxRuntime.jsx(g.Body2,{part:"subtitle",children:r.subtitle})]})]}),jsxRuntime.jsxs(x.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[r.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:n}),jsxRuntime.jsx(b.Primary,{title:r.primaryButtonTitle,onClick:i}),o.dismissible&&jsxRuntime.jsx(u.Dismiss,{onClick:t})]})]})})}var Fo={};z(Fo,{Collapsible:()=>So,CollapsibleStep:()=>le});var le={};z(le,{Content:()=>Re,Root:()=>Be,Trigger:()=>ve});var br=react.keyframes`
49
49
  from {
50
50
  height: 0;
51
51
  opacity: 0;
@@ -63,34 +63,22 @@ var Jo=Object.defineProperty;var Xo=(e=>typeof require<"u"?require:typeof Proxy<
63
63
  height: 0;
64
64
  opacity: 0;
65
65
  }
66
- `,Cr=()=>jsxRuntime.jsx(l,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Sr({checked:e=!1}){return jsxRuntime.jsx(l,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(l,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Cr,{})})})}function Fe({children:e}){return jsxRuntime.jsx(Y__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(x.Column,{css:{'&[data-state="open"]':{animation:`${br} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Pr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(l,{}),e]})})}function Te({children:e,open:o=!1,onOpenChange:t=()=>{}}){return jsxRuntime.jsx(Y__namespace.Root,{asChild:!0,open:o,onOpenChange:t,children:jsxRuntime.jsx(c,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function we({isCompleted:e,title:o}){return jsxRuntime.jsx(Y__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(x.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(x.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Sr,{checked:e}),jsxRuntime.jsx(g.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Re={};z(Re,{Bar:()=>pe,Dots:()=>fo,Segments:()=>xo});function pe({current:e,total:o,...t}){let i=o>0?Math.min(e/o,1):0,n=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(l,{backgroundColor:"blue800",borderRadius:"md",height:"10px",...t,children:jsxRuntime.jsx(l,{backgroundColor:"primary.surface",borderRadius:"md",height:"100%",style:{width:n},transition:"width 300ms ease-out"})})}function fo({current:e,total:o,...t}){if(o==1)return null;let i=[...Array(o)].map((n,r)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e-1===r?y.colors.blue500:y.colors.blue800},r));return jsxRuntime.jsx(l,{as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,...t,children:i})}function xo({current:e,total:o,...t}){let i=[...Array(o)].map((n,r)=>jsxRuntime.jsx(l,{backgroundColor:e-1===r?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},r));return jsxRuntime.jsx(x.Row,{gap:1,height:"10px",...t,children:i})}var yo=be.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ho({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:i,step:n}){let{isBlocked:r,isCompleted:a,primaryButtonTitle:s,secondaryButtonTitle:d,subtitle:m,title:u}=n;return jsxRuntime.jsxs(Te,{open:t,onOpenChange:i,children:[jsxRuntime.jsx(we,{isCompleted:a,title:u}),jsxRuntime.jsxs(Fe,{children:[jsxRuntime.jsx(c.Media,{aspectRatio:2.5,objectFit:"cover",src:n.imageUri}),jsxRuntime.jsx(c.Subtitle,{color:"gray500",children:m}),jsxRuntime.jsxs(x.Row,{gap:3,children:[jsxRuntime.jsx(c.Secondary,{disabled:!!(a||r),title:d,onClick:o}),jsxRuntime.jsx(c.Primary,{disabled:!!(a||r),title:s,onClick:e})]})]})]})}var Rr={default:ho};function Br({flow:e,step:o,...t}){let{onPrimary:i,onSecondary:n,openStepId:r,setOpenStepId:a,stepTypes:s}=be.useContext(yo),{handlePrimary:d,handleSecondary:m}=N(o,{onPrimary:i,onSecondary:n}),u=(r??e.getCurrentStep().id)===o.id,f=s[o.type]??ho;async function h(T){a(T?o.id:""),T&&!o.isCompleted&&await o.start();}return jsxRuntime.jsx(f,{flow:e,onOpenChange:h,open:u,step:o,...t,handlePrimary:d,handleSecondary:m},o.id)}function bo({dismissible:e,flowId:o,onPrimary:t,onSecondary:i,stepTypes:n={},...r}){let[a,s]=be.useState(null),d={...Rr,...n};return jsxRuntime.jsx(yo.Provider,{value:{openStepId:a,setOpenStepId:s,onPrimary:t,onSecondary:i,stepTypes:d},children:jsxRuntime.jsx(O,{as:c,borderWidth:"md",flowId:o,part:"checklist",...r,children:({flow:m,handleDismiss:u,...f})=>{let h=Array.from(m.steps.entries()).map(([,_])=>jsxRuntime.jsx(Br,{flow:m,handleDismiss:u,...f,step:_},_.id)),T=m.getNumberOfCompletedSteps(),q=m.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(x.Column,{gap:2,children:[jsxRuntime.jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"checklist-header",children:[jsxRuntime.jsx(c.Title,{children:m.title}),e&&jsxRuntime.jsx(c.Dismiss,{onClick:u}),jsxRuntime.jsx(c.Subtitle,{color:"gray500",flexBasis:"100%",children:m.subtitle})]}),jsxRuntime.jsxs(x.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(g.Body2,{fontWeight:"demibold",children:[T,"/",q]}),jsxRuntime.jsx(pe,{current:T,total:q,flexGrow:1})]})]}),h]})}})})}var Er=new Set(["required","min","max","minLength","maxLength","pattern"]);function Or({fieldComponent:e,control:o,fieldData:t}){t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(t).filter(([r])=>Er.has(r))),n=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,{...n,fieldData:t})}function Co({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},step:r}){var f;let{control:a,handleSubmit:s}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),d=[];function m(h,T){t(T,h);}function u(h,T){i(T,h);}return (f=r.fields)==null||f.forEach(h=>{e[h.type]!=null&&d.push(jsxRuntime.jsx(Or,{control:a,fieldComponent:e[h.type],fieldData:h},h.id));}),jsxRuntime.jsxs(x.Column,{gap:5,part:"form-step",children:[jsxRuntime.jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsxRuntime.jsx(c.Title,{children:r.title}),n&&jsxRuntime.jsx(c.Dismiss,{onClick:o}),jsxRuntime.jsx(c.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),d,jsxRuntime.jsxs(x.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[r.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:s(u)}),jsxRuntime.jsx(b.Primary,{title:r.primaryButtonTitle??"Submit",onClick:s(m)})]},"form-footer")]})}function So({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(g.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Fo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(g.H4,{as:"label",htmlFor:o,part:"field-label",children:[e,t&&" *"]})}var re={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function $({children:e,field:o,fieldData:t,fieldState:i}){let{id:n,label:r,placeholder:a}=t,{error:s}=i,d={id:n,...o,...a?{placeholder:a}:{},...re,"aria-invalid":!!s,value:o.value??""};return jsxRuntime.jsxs(l,{part:"field",children:[jsxRuntime.jsx(Fo,{id:n,required:!!t.required,children:r}),e(d),jsxRuntime.jsx(So,{error:s})]})}var Wr=()=>jsxRuntime.jsx(l,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ar=be__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(l,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(g.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Q__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(l,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(l,{as:Q__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Wr,{})})})})]}));function Bo(e){let{field:{onChange:o,value:t},fieldData:{options:i=[]}}=e,n=i.map(({label:r,value:a})=>jsxRuntime.jsx(Ar,{value:a,label:r},a));return jsxRuntime.jsx($,{...e,children:()=>jsxRuntime.jsx(Q__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(x.Column,{gap:2,part:"field-radio-group",children:n})})})}var $r=be__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(C__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(l,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(C__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(g.Body2,{part:"field-select-option-label",children:e})})})}));function Do(e){let{field:{onChange:o,value:t},fieldData:{options:i=[],placeholder:n}}=e,r=i.map(({label:a,value:s})=>jsxRuntime.jsx($r,{value:s,label:a},s));return jsxRuntime.jsx($,{...e,children:()=>jsxRuntime.jsxs(C__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(C__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(g.Body2,{...re,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(C__namespace.Value,{placeholder:n??"Select one"}),jsxRuntime.jsx(C__namespace.Icon,{children:jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(C__namespace.Portal,{children:jsxRuntime.jsx(C__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(l,{...re,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsxRuntime.jsx(C__namespace.Viewport,{children:r})})})})]})})}function Oo(e){return jsxRuntime.jsx($,{...e,children:o=>jsxRuntime.jsx(g.Body2,{as:"input",part:"field-text",type:"text",...o})})}function Mo(e){return jsxRuntime.jsx($,{...e,children:o=>jsxRuntime.jsx(g.Body2,{as:"textarea",part:"field-textarea",...o})})}var _r={radio:Bo,select:Do,text:Oo,textarea:Mo};function zr({fieldTypes:e={},flowId:o,...t}){let i=Object.assign({},_r,e);return jsxRuntime.jsx(O,{flowId:o,part:"form",...t,children:n=>jsxRuntime.jsx(Co,{fieldTypes:i,...n})})}function de(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=be.useState(e),[i,n]=be.useState(null),r=be.useCallback(a=>{n(a);},[]);return be.useLayoutEffect(()=>{if(!i)return;let a=()=>{let s=i.getBoundingClientRect();t(s);};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[i]),{node:i,rect:o,ref:r}}var Ur=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Lo({style:e={},part:o="",...t}){return jsxRuntime.jsxs(l,{part:`dot-wrapper ${o}`,style:{height:"48px",position:"absolute",width:"48px",...e},...t,children:[jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Ur}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Vo({props:e,alignAttr:o,sideAttr:t}){let i=t??"bottom",n={},r=()=>{if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return e.align??"after"},a="-24px",s={top:"bottom",right:"left",bottom:"top",left:"right"};n[s[i]]=a;let d=r();return ["before","end"].includes(d)?["top","bottom"].includes(i)?n.right=a:n.bottom=a:["after","start"].includes(d)?["top","bottom"].includes(i)?n.left=a:n.top=a:["top","bottom"].includes(i)?n.left=`calc(50% + ${a})`:n.top=`calc(50% + ${a})`,n}var ce={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function $o(e,o){let t=Object.fromEntries(ce.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i=Object.fromEntries(ce.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!ce.content.includes(r)&&!ce.root.includes(r)&&(n[r]=e[r]);if(t.align=t.align??"after",t.side=t.side??"bottom",["before","after"].includes(t.align)){let r={after:"end",before:"start"},a=(h,T)=>["top","bottom"].includes(T)?h=="after"?"marginLeft":"marginRight":h=="after"?"marginTop":"marginBottom",s=t.alignOffset??0,d=t.style??{},m=t.side??"bottom",u=t.align;t.style={...d,[a(u,m)]:s};let f=["top","bottom"].includes(m)?o.width:o.height;t.alignOffset=(f+s)*-1,t.align=r[u];}return {contentProps:t,otherProps:n,rootProps:i}}function S({anchor:e,children:o,className:t,spotlight:i=!1,style:n,...r}){let{node:a,rect:s,ref:d}=de(),{node:m,rect:u,ref:f}=de(),{contentProps:h,otherProps:T,rootProps:q}=$o(r,s),[_,Z]=be.useState(h.align),[ne,De]=be.useState(h.side),[jo,No]=be.useState(0),[Ko,Uo]=be.useState(0);if(a!==null){let A=a.getAttribute("data-align"),ie=a.getAttribute("data-side");_!==A&&Z(A),ne!==ie&&De(ie);}let Ee=be.useRef(null);if(be.useEffect(()=>{let A=document.querySelector(e);A!=null?(f(A),Ee.current=A):console.debug(`No anchor found for query: ${e}`);},[e]),be.useEffect(()=>{let{scrollX:A,scrollY:ie}=window;No(u.left+A),Uo(u.top+ie);},[u.left,u.top]),m==null)return null;let Oe="0";typeof window<"u"&&(Oe=window.getComputedStyle(m).borderRadius);let Go=Vo({props:r,alignAttr:_,sideAttr:ne});return jsxRuntime.jsxs(I__namespace.Root,{defaultOpen:!0,...q,children:[jsxRuntime.jsx(I__namespace.Anchor,{virtualRef:Ee}),jsxRuntime.jsx(I__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i&&jsxRuntime.jsx(l,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:Oe,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:u.height,left:jo,top:Ko,width:u.width}}),jsxRuntime.jsx(I__namespace.Content,{asChild:!0,...h,ref:d,children:jsxRuntime.jsxs(c,{boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n,...T,children:[jsxRuntime.jsx(Lo,{style:Go}),o]})})]})})]})}S.Close=e=>jsxRuntime.jsx(I__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});S.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e,...o});S.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});S.Progress=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.H4,{part:"progress",...o,children:e});S.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});S.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.Body2,{part:"subtitle",...o,children:e});S.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.H4,{part:"title",...o,children:e});function zo({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:i,onSecondary:n,step:r,...a}){let{handleDismiss:s}=j(o,{onDismiss:t}),{handlePrimary:d,handleSecondary:m}=N(r,{onPrimary:i,onSecondary:n});return jsxRuntime.jsxs(S,{anchor:r.selector,onOpenAutoFocus:u=>u.preventDefault(),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),...a,children:[e&&jsxRuntime.jsx(S.Close,{onClick:s}),jsxRuntime.jsx(S.Media,{src:r.videoUri??r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsxs(x.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(S.Title,{children:r.title}),jsxRuntime.jsx(S.Subtitle,{color:"gray500",children:r.subtitle})]}),jsxRuntime.jsxs(x.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsxRuntime.jsx(S.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(S.Secondary,{title:r.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(S.Primary,{title:r.primaryButtonTitle,onClick:d})]})]},r.id)}function Qr({flowId:e,onComplete:o,variables:t,...i}){let{flow:n}=oe(e,{variables:t});j(n,{onComplete:o});let{isCurrentModal:r,removeModal:a}=te(n);if(be.useEffect(()=>{!(n!=null&&n.isVisible)&&r&&a();},[n==null?void 0:n.isVisible,r]),n==null||n.isVisible===!1||!r)return null;n.start();let s=n.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(zo,{step:s,flow:n,...i})}function on(){let{frigade:e}=be.useContext(v);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function rn(){let{userId:e,frigade:o}=be.useContext(v);async function t(n){await o.identify(e,n);}async function i(n,r){await o.track(n,r);}return {userId:e,addProperties:t,track:i}}function sn(){let{groupId:e,frigade:o}=be.useContext(v);async function t(n){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await o.group(e,n);}async function i(n,r){await o.track(n,r);}return {groupId:e,addProperties:t,track:i}}
66
+ `,Cr=()=>jsxRuntime.jsx(l,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Sr({checked:e=!1}){return jsxRuntime.jsx(l,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(l,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Cr,{})})})}function Re({children:e}){return jsxRuntime.jsx(Y__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(x.Column,{css:{'&[data-state="open"]':{animation:`${br} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Pr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(l,{}),e]})})}function Be({children:e,open:o=!1,onOpenChange:t=()=>{}}){return jsxRuntime.jsx(Y__namespace.Root,{asChild:!0,open:o,onOpenChange:t,children:jsxRuntime.jsx(u,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function ve({isCompleted:e,title:o}){return jsxRuntime.jsx(Y__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(x.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(x.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Sr,{checked:e}),jsxRuntime.jsx(g.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var ke={};z(ke,{Bar:()=>pe,Dots:()=>yo,Segments:()=>bo});function pe({current:e,total:o,...t}){let i=o>0?Math.min(e/o,1):0,n=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(l,{backgroundColor:"blue800",borderRadius:"md",height:"10px",...t,children:jsxRuntime.jsx(l,{backgroundColor:"primary.surface",borderRadius:"md",height:"100%",style:{width:n},transition:"width 300ms ease-out"})})}function yo({current:e,total:o,...t}){if(o==1)return null;let i=[...Array(o)].map((n,r)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e-1===r?y.colors.blue500:y.colors.blue800},r));return jsxRuntime.jsx(l,{as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,...t,children:i})}function bo({current:e,total:o,...t}){let i=[...Array(o)].map((n,r)=>jsxRuntime.jsx(l,{backgroundColor:e-1===r?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},r));return jsxRuntime.jsx(x.Row,{gap:1,height:"10px",...t,children:i})}var Po=Se.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Co({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:i,step:n}){let{isBlocked:r,isCompleted:s,primaryButtonTitle:a,secondaryButtonTitle:d,subtitle:m,title:f}=n;return jsxRuntime.jsxs(Be,{open:t,onOpenChange:i,children:[jsxRuntime.jsx(ve,{isCompleted:s,title:f}),jsxRuntime.jsxs(Re,{children:[jsxRuntime.jsx(u.Media,{aspectRatio:2.5,objectFit:"cover",src:n.imageUri}),jsxRuntime.jsx(u.Subtitle,{color:"gray500",children:m}),jsxRuntime.jsxs(x.Row,{gap:3,children:[jsxRuntime.jsx(u.Secondary,{disabled:!!(s||r),title:d,onClick:o}),jsxRuntime.jsx(u.Primary,{disabled:!!(s||r),title:a,onClick:e})]})]})]})}var Rr={default:Co};function Br({flow:e,step:o,...t}){let{onPrimary:i,onSecondary:n,openStepId:r,setOpenStepId:s,stepTypes:a}=Se.useContext(Po),{handlePrimary:d,handleSecondary:m}=N(o,{onPrimary:i,onSecondary:n}),f=(r??e.getCurrentStep().id)===o.id,h=a[o.type]??Co;async function c(S){s(S?o.id:""),S&&!o.isCompleted&&await o.start();}return jsxRuntime.jsx(h,{flow:e,onOpenChange:c,open:f,step:o,...t,handlePrimary:d,handleSecondary:m},o.id)}function So({dismissible:e,flowId:o,onPrimary:t,onSecondary:i,stepTypes:n={},...r}){let[s,a]=Se.useState(null),d={...Rr,...n};return jsxRuntime.jsx(Po.Provider,{value:{openStepId:s,setOpenStepId:a,onPrimary:t,onSecondary:i,stepTypes:d},children:jsxRuntime.jsx(O,{as:u,borderWidth:"md",flowId:o,part:"checklist",...r,children:({flow:m,handleDismiss:f,...h})=>{let c=Array.from(m.steps.entries()).map(([,_])=>jsxRuntime.jsx(Br,{flow:m,handleDismiss:f,...h,step:_},_.id)),S=m.getNumberOfCompletedSteps(),q=m.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(x.Column,{gap:2,children:[jsxRuntime.jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"checklist-header",children:[jsxRuntime.jsx(u.Title,{children:m.title}),e&&jsxRuntime.jsx(u.Dismiss,{onClick:f}),jsxRuntime.jsx(u.Subtitle,{color:"gray500",flexBasis:"100%",children:m.subtitle})]}),jsxRuntime.jsxs(x.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(g.Body2,{fontWeight:"demibold",children:[S,"/",q]}),jsxRuntime.jsx(pe,{current:S,total:q,flexGrow:1})]})]}),c]})}})})}var Er=new Set(["required","min","max","minLength","maxLength","pattern"]);function Or({fieldComponent:e,control:o,fieldData:t}){t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(t).filter(([r])=>Er.has(r))),n=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,{...n,fieldData:t})}function To({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},step:r}){var h;let{control:s,handleSubmit:a}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),d=[];function m(c,S){t(S,c);}function f(c,S){i(S,c);}return (h=r.fields)==null||h.forEach(c=>{e[c.type]!=null&&d.push(jsxRuntime.jsx(Or,{control:s,fieldComponent:e[c.type],fieldData:c},c.id));}),jsxRuntime.jsxs(x.Column,{gap:5,part:"form-step",children:[jsxRuntime.jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsxRuntime.jsx(u.Title,{children:r.title}),n&&jsxRuntime.jsx(u.Dismiss,{onClick:o}),jsxRuntime.jsx(u.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),d,jsxRuntime.jsxs(x.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[r.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:a(f)}),jsxRuntime.jsx(b.Primary,{title:r.primaryButtonTitle??"Submit",onClick:a(m)})]},"form-footer")]})}function wo({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(g.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Ro({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(g.H4,{as:"label",htmlFor:o,part:"field-label",children:[e,t&&" *"]})}var re={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function $({children:e,field:o,fieldData:t,fieldState:i}){let{id:n,label:r,placeholder:s}=t,{error:a}=i,d={id:n,...o,...s?{placeholder:s}:{},...re,"aria-invalid":!!a,value:o.value??""};return jsxRuntime.jsxs(l,{part:"field",children:[jsxRuntime.jsx(Ro,{id:n,required:!!t.required,children:r}),e(d),jsxRuntime.jsx(wo,{error:a})]})}var Wr=()=>jsxRuntime.jsx(l,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ar=Se__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(l,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(g.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Q__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(l,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(l,{as:Q__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Wr,{})})})})]}));function Do(e){let{field:{onChange:o,value:t},fieldData:{options:i=[]}}=e,n=i.map(({label:r,value:s})=>jsxRuntime.jsx(Ar,{value:s,label:r},s));return jsxRuntime.jsx($,{...e,children:()=>jsxRuntime.jsx(Q__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(x.Column,{gap:2,part:"field-radio-group",children:n})})})}var $r=Se__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(C__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(l,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(C__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(g.Body2,{part:"field-select-option-label",children:e})})})}));function Io(e){let{field:{onChange:o,value:t},fieldData:{options:i=[],placeholder:n}}=e,r=i.map(({label:s,value:a})=>jsxRuntime.jsx($r,{value:a,label:s},a));return jsxRuntime.jsx($,{...e,children:()=>jsxRuntime.jsxs(C__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(C__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(g.Body2,{...re,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(C__namespace.Value,{placeholder:n??"Select one"}),jsxRuntime.jsx(C__namespace.Icon,{children:jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(C__namespace.Portal,{children:jsxRuntime.jsx(C__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(l,{...re,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsxRuntime.jsx(C__namespace.Viewport,{children:r})})})})]})})}function Ho(e){return jsxRuntime.jsx($,{...e,children:o=>jsxRuntime.jsx(g.Body2,{as:"input",part:"field-text",type:"text",...o})})}function Ao(e){return jsxRuntime.jsx($,{...e,children:o=>jsxRuntime.jsx(g.Body2,{as:"textarea",part:"field-textarea",...o})})}var _r={radio:Do,select:Io,text:Ho,textarea:Ao};function zr({fieldTypes:e={},flowId:o,...t}){let i=Object.assign({},_r,e);return jsxRuntime.jsx(O,{flowId:o,part:"form",...t,children:n=>jsxRuntime.jsx(To,{fieldTypes:i,...n})})}function de(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=Se.useState(e),[i,n]=Se.useState(null),r=Se.useCallback(s=>{n(s);},[]);return Se.useLayoutEffect(()=>{if(!i)return;let s=()=>{let a=i.getBoundingClientRect();t(a);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[i]),{node:i,rect:o,ref:r}}var Ur=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function _o({style:e={},part:o="",...t}){return jsxRuntime.jsxs(l,{part:`dot-wrapper ${o}`,style:{height:"48px",position:"absolute",width:"48px",...e},...t,children:[jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Ur}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function zo({props:e,alignAttr:o,sideAttr:t}){let i=t??"bottom",n={},r=()=>{if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return e.align??"after"},s="-24px",a={top:"bottom",right:"left",bottom:"top",left:"right"};n[a[i]]=s;let d=r();return ["before","end"].includes(d)?["top","bottom"].includes(i)?n.right=s:n.bottom=s:["after","start"].includes(d)?["top","bottom"].includes(i)?n.left=s:n.top=s:["top","bottom"].includes(i)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var ce={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function jo(e,o){let t=Object.fromEntries(ce.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i=Object.fromEntries(ce.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!ce.content.includes(r)&&!ce.root.includes(r)&&(n[r]=e[r]);if(t.align=t.align??"after",t.side=t.side??"bottom",["before","after"].includes(t.align)){let r={after:"end",before:"start"},s=(c,S)=>["top","bottom"].includes(S)?c=="after"?"marginLeft":"marginRight":c=="after"?"marginTop":"marginBottom",a=t.alignOffset??0,d=t.style??{},m=t.side??"bottom",f=t.align;t.style={...d,[s(f,m)]:a};let h=["top","bottom"].includes(m)?o.width:o.height;t.alignOffset=(h+a)*-1,t.align=r[f];}return {contentProps:t,otherProps:n,rootProps:i}}function T({anchor:e,children:o,className:t,spotlight:i=!1,style:n,...r}){let{node:s,rect:a,ref:d}=de(),{node:m,rect:f,ref:h}=de(),{contentProps:c,otherProps:S,rootProps:q}=jo(r,a),[_,ue]=Se.useState(c.align),[ne,Z]=Se.useState(c.side),[fe,ge]=Se.useState(0),[Ie,Uo]=Se.useState(0);if(s!==null){let A=s.getAttribute("data-align"),ie=s.getAttribute("data-side");_!==A&&ue(A),ne!==ie&&Z(ie);}let Me=Se.useRef(null);if(Se.useEffect(()=>{let A=document.querySelector(e);A!=null?(h(A),Me.current=A):console.debug(`No anchor found for query: ${e}`);},[e]),Se.useEffect(()=>{let{scrollX:A,scrollY:ie}=window;ge(f.left+A),Uo(f.top+ie);},[f.left,f.top]),m==null)return null;let He="0";typeof window<"u"&&(He=window.getComputedStyle(m).borderRadius);let Go=zo({props:r,alignAttr:_,sideAttr:ne});return jsxRuntime.jsxs(I__namespace.Root,{defaultOpen:!0,...q,children:[jsxRuntime.jsx(I__namespace.Anchor,{virtualRef:Me}),jsxRuntime.jsx(I__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i&&jsxRuntime.jsx(l,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:He,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:f.height,left:fe,top:Ie,width:f.width}}),jsxRuntime.jsx(I__namespace.Content,{asChild:!0,...c,ref:d,children:jsxRuntime.jsxs(u,{boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n,...S,children:[jsxRuntime.jsx(_o,{style:Go}),o]})})]})})]})}T.Close=e=>jsxRuntime.jsx(I__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});T.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e,...o});T.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});T.Progress=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.H4,{part:"progress",...o,children:e});T.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});T.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.Body2,{part:"subtitle",...o,children:e});T.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(g.H4,{part:"title",...o,children:e});function Ko({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:i,onSecondary:n,step:r,...s}){let{handleDismiss:a}=j(o,{onDismiss:t}),{handlePrimary:d,handleSecondary:m}=N(r,{onPrimary:i,onSecondary:n});return jsxRuntime.jsxs(T,{anchor:r.selector,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),...s,children:[e&&jsxRuntime.jsx(T.Close,{onClick:a}),jsxRuntime.jsx(T.Media,{src:r.videoUri??r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsxs(x.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(T.Title,{children:r.title}),jsxRuntime.jsx(T.Subtitle,{color:"gray500",children:r.subtitle})]}),jsxRuntime.jsxs(x.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsxRuntime.jsx(T.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(T.Secondary,{title:r.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(T.Primary,{title:r.primaryButtonTitle,onClick:d})]})]},r.id)}function Qr({flowId:e,onComplete:o,variables:t,...i}){let{flow:n}=oe(e,{variables:t});j(n,{onComplete:o});let{isCurrentModal:r,removeModal:s}=te(n);if(Se.useEffect(()=>{!(n!=null&&n.isVisible)&&r&&s();},[n==null?void 0:n.isVisible,r]),n==null||n.isVisible===!1||!r)return null;let a=n.getCurrentStep();return a==null||a.start(),jsxRuntime.jsx(Ko,{step:a,flow:n,...i})}function on(){let{frigade:e}=Se.useContext(v);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function rn(){let{userId:e,frigade:o}=Se.useContext(v);async function t(n){await o.identify(e,n);}async function i(n,r){await o.track(n,r);}return {userId:e,addProperties:t,track:i}}function sn(){let{groupId:e,frigade:o}=Se.useContext(v);async function t(n){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await o.group(e,n);}async function i(n,r){await o.track(n,r);}return {groupId:e,addProperties:t,track:i}}
67
67
 
68
- Object.defineProperty(exports, 'Flow', {
69
- enumerable: true,
70
- get: function () { return js.Flow; }
71
- });
72
- Object.defineProperty(exports, 'FlowType', {
73
- enumerable: true,
74
- get: function () { return js.FlowType; }
75
- });
76
- Object.defineProperty(exports, 'Frigade', {
77
- enumerable: true,
78
- get: function () { return js.Frigade; }
79
- });
80
68
  exports.Announcement = fr;
81
69
  exports.Banner = xr;
82
70
  exports.Box = l;
83
71
  exports.Button = b;
84
- exports.Card = c;
85
- exports.Checklist = Po;
72
+ exports.Card = u;
73
+ exports.Checklist = Fo;
86
74
  exports.Flex = x;
87
75
  exports.Form = zr;
88
- exports.Progress = Re;
76
+ exports.Progress = ke;
89
77
  exports.Provider = Xt;
90
78
  exports.Text = g;
91
- exports.Tooltip = S;
79
+ exports.Tooltip = T;
92
80
  exports.Tour = Qr;
93
- exports.themeVariables = ge;
81
+ exports.themeVariables = he;
94
82
  exports.useBoundingClientRect = de;
95
83
  exports.useFlow = oe;
96
84
  exports.useFlowHandlers = j;
@@ -99,5 +87,11 @@ exports.useGroup = sn;
99
87
  exports.useModal = te;
100
88
  exports.useStepHandlers = N;
101
89
  exports.useUser = rn;
90
+ Object.keys(js).forEach(function (k) {
91
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
92
+ enumerable: true,
93
+ get: function () { return js[k]; }
94
+ });
95
+ });
102
96
  //# sourceMappingURL=out.js.map
103
97
  //# sourceMappingURL=index.cjs.map