@frigade/react 2.0.21 → 2.0.23

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
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var w = require('@radix-ui/react-dialog');
3
+ var R = require('@radix-ui/react-dialog');
4
4
  var solid = require('@heroicons/react/24/solid');
5
- var Fe = require('react');
5
+ var we = require('react');
6
6
  var clsx = require('clsx');
7
- var st = require('known-css-properties');
8
- var gt = require('dompurify');
7
+ var at = require('known-css-properties');
8
+ var xt = require('dompurify');
9
9
  var jsxRuntime = require('@emotion/react/jsx-runtime');
10
- var react = require('@emotion/react');
11
10
  var js = require('@frigade/js');
11
+ var react = require('@emotion/react');
12
12
  var outline = require('@heroicons/react/24/outline');
13
13
  var Y = require('@radix-ui/react-collapsible');
14
14
  var reactHookForm = require('react-hook-form');
@@ -36,16 +36,16 @@ function _interopNamespace(e) {
36
36
  return Object.freeze(n);
37
37
  }
38
38
 
39
- var w__namespace = /*#__PURE__*/_interopNamespace(w);
40
- var Fe__namespace = /*#__PURE__*/_interopNamespace(Fe);
41
- var st__default = /*#__PURE__*/_interopDefault(st);
42
- var gt__default = /*#__PURE__*/_interopDefault(gt);
39
+ var R__namespace = /*#__PURE__*/_interopNamespace(R);
40
+ var we__namespace = /*#__PURE__*/_interopNamespace(we);
41
+ var at__default = /*#__PURE__*/_interopDefault(at);
42
+ var xt__default = /*#__PURE__*/_interopDefault(xt);
43
43
  var Y__namespace = /*#__PURE__*/_interopNamespace(Y);
44
44
  var Q__namespace = /*#__PURE__*/_interopNamespace(Q);
45
45
  var S__namespace = /*#__PURE__*/_interopNamespace(S);
46
46
  var I__namespace = /*#__PURE__*/_interopNamespace(I);
47
47
 
48
- var ot=Object.defineProperty;var tt=(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 L=(e,o)=>{for(var t in o)ot(e,t,{get:o[t],enumerable:!0});};var Le={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Ve={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 $e={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,_e={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 Ne={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var rt="px",nt=e=>typeof e=="number"?`${4*e}${rt}`:e,it=[-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"],je=Object.fromEntries(it.map(e=>[e,nt(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 ye={...Le,colors:{...Ve,..._e},...ze,radii:$e,shadows:Ne,space:je};function ee(e,o="",t="."){return Object.keys(e).reduce((i,r)=>{let a=`${o.length?`${o}${t}`:""}${r}`,s=e[r];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(i,ee(s,a,t)):i[a]=s,i},{})}function he(e){return ee(e,"--fr","-")}function Ke(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let r=e[i];typeof r=="object"&&r!==null&&!Array.isArray(r)?t[i]=Ke(r,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var be=he(ye),y=Ke(ye);var at=new Set(["alt","size","src"]),lt=st__default.default.all.filter(e=>e.indexOf("-")!=0&&!at.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),pt=Object.fromEntries(lt),Pe=ee(y.colors),dt={color:Pe,backgroundColor:Pe,borderColor:Pe,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},Ue={...pt,...dt},Ge={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"]},Xe=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function ct(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 Je=new Map(Object.entries(Ue).map(([e,o])=>[e,ct(o)])),mt=new Map(Object.entries(Ge).map(([e,o])=>[e,new Set(o)])),ut=new Set(["height","width"]),ft=new Set(["canvas","embed","iframe","img","input","object","video"]);function qe(e){let[o,t]=e.split(":");return [o,Xe.has(t)?t:null]}function Ye(e,o="div"){let t=Object.assign({},e),i={};function r(n){if(n==null)return i;let s=`&:${n.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[s]==null&&(i[s]={}),i[s]}return Object.entries(t).forEach(([n,a])=>{let[s,d]=qe(n),m=mt.get(s);m!=null&&(m.forEach(g=>{let h=`${g}${d?":"+d:""}`;t[h]=a;}),delete t[n]);}),Object.entries(t).forEach(([n,a])=>{let[s,d]=qe(n),m=Je.get(s);if(m!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let g=a.split(" ");r(d)[s]=g.map(h=>m.get(h.toString())??h).join(" ");}else m.has(a.toString())?r(d)[s]=m.get(a.toString()):r(d)[s]=a;(typeof o!="string"||!ft.has(o)||!ut.has(s))&&delete t[n];}}),Object.keys(t).forEach(n=>{let a=n.substring(1);n.indexOf("_")===0&&Je.has(a)&&(t[a]=t[n],delete t[n]);}),{cssFromProps:i,unmatchedProps:t}}function xt(){if(typeof window>"u"){let{JSDOM:e}=tt("jsdom");return new e("<!DOCTYPE html>").window}return window}function Qe(e){return e?{__html:gt__default.default(xt()).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 ht(e){return e&&`fr-${e}`}function oo(e){return e&&(Array.isArray(e)?e.map(o=>oo(o)).join(" "):ht(e))}function bt({as:e,children:o,className:t,css:i={},part:r,...n},a){let s=e??"div",{cssFromProps:d,unmatchedProps:m}=Ye(n,s),g=oo(r),h=t||g?clsx.clsx(t,g):void 0,c=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsxRuntime.jsx(s,{className:h,css:c,...m,ref:a,dangerouslySetInnerHTML:Qe(o)}):jsxRuntime.jsx(s,{className:h,css:c,...m,ref:a,children:o})}var l=Fe__namespace.forwardRef(bt);var x={};L(x,{Body1:()=>Wt,Body2:()=>At,Caption:()=>Lt,Display1:()=>Dt,Display2:()=>Et,H1:()=>Ot,H2:()=>It,H3:()=>Mt,H4:()=>Ht});var Ce={};L(Ce,{Body1:()=>Rt,Body2:()=>Bt,Caption:()=>vt,Display1:()=>Pt,Display2:()=>Ct,H1:()=>St,H2:()=>Ft,H3:()=>Tt,H4:()=>wt});var M={color:"neutral.foreground",fontFamily:"default",margin:"0"},Pt={...M,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},Ct={...M,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},St={...M,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},Ft={...M,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},Tt={...M,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},wt={...M,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},Rt={...M,fontSize:"md",fontWeight:"regular",lineHeight:"md"},Bt={...M,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},vt={...M,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var kt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],H=Object.fromEntries(kt.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Fe__namespace.forwardRef(({as:i=o,children:r,...n},a)=>jsxRuntime.jsx(l,{as:i,...Ce[e],...n,ref:a,children:r}));return t.displayName=`Text.${e}`,[e,t]})),Dt=H.Display1,Et=H.Display2,Ot=H.H1,It=H.H2,Mt=H.H3,Ht=H.H4,Wt=H.Body1,At=H.Body2,Lt=H.Caption;var Se={};L(Se,{Link:()=>Nt,Plain:()=>jt,Primary:()=>$t,Secondary:()=>_t});var se={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},$t={...se,backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},_t={...se,backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},Nt={...se,backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},jt={...se,backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"};function ro({as:e,children:o,part:t,title:i,variant:r="Primary",...n}){let a=r.toLocaleLowerCase();return jsxRuntime.jsxs(l,{as:e??"button",part:[`button-${a}`,t],...Se[r],...n,children:[o,i&&jsxRuntime.jsx(x.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}var zt=["Primary","Secondary","Link","Plain"],Kt=Object.fromEntries(zt.map(e=>{let o=t=>jsxRuntime.jsx(ro,{...t,variant:e,children:t.children});return o.displayName=`Button.${e}`,[e,o]})),b=Object.assign(ro,Kt);var u={};L(u,{Column:()=>Xt,Row:()=>Gt});var Gt=Fe__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),Xt=Fe__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var v=Fe.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function tr({children:e,navigate:o,theme:t,...i}){let r=t?he(t):{},[n,a]=Fe.useState(new Set),s=Fe.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??((g,h="_self")=>{window.open(g,h);});Fe.useEffect(()=>()=>{s.destroy();},[]);let m=n.size>0?n.values().next().value:null;return jsxRuntime.jsxs(v.Provider,{value:{modals:n,setModals:a,currentModal:m,navigate:d,...i,frigade:s},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...be,...r}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:y,children:e})]})}function oe(e,o){let[t,i]=Fe.useState(),[,r]=Fe.useState(""),{frigade:n}=Fe.useContext(v),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),i(s),r(Math.random().toString()));};return Fe.useEffect(()=>((async()=>{let s=await n.getFlow(e);if(!s||n.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),i(s);})(),n.onStateChange(a),()=>{n.removeStateChangeHandler(a);}),[]),{flow:t}}function j(e,{onComplete:o,onDismiss:t}={}){let i=Fe.useRef(null);return Fe.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:Fe.useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.skip();},[e])}}function z(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=Fe.useContext(v);return {handlePrimary:Fe.useCallback(async(r,n)=>await(o==null?void 0:o(e,r))===!1?(r.preventDefault(),!1):(await e.complete(n),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:Fe.useCallback(async(r,n)=>await(t==null?void 0:t(e,r))===!1?(r.preventDefault(),!1):(await e.complete(n),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function te(e,o=!0){let{currentModal:t,modals:i,setModals:r}=Fe.useContext(v),[n,a]=Fe.useState(!1);Fe.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!i.has(e.id)&&r(d=>new Set(d).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),Fe.useEffect(()=>{let d=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&d!==n&&a(d);},[e==null?void 0:e.id,t]);function s(){o&&i.has(e==null?void 0:e.id)&&r(d=>{let m=new Set(d);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:n||!o,removeModal:s}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:m,forceMount:g,...h}){let{flow:c}=oe(r,{variables:m}),F=c==null?void 0:c.getCurrentStep(),{handleDismiss:q}=j(c,{onComplete:n,onDismiss:a}),{handlePrimary:N,handleSecondary:fe}=z(F,{onPrimary:s,onSecondary:d}),ne=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:Z,removeModal:ge}=te(c,ne);if(Fe.useEffect(()=>{!(c!=null&&c.isVisible)&&Z&&ge();},[c==null?void 0:c.isVisible,Z]),c==null||!Z)return null;let xe=g&&c.isCompleted;return !c.isVisible&&!xe?null:(!c.isCompleted&&!c.isSkipped&&F.start(),jsxRuntime.jsx(e??l,{position:"relative",...h,children:o({flow:c,handleDismiss:q,handlePrimary:N,handleSecondary:fe,parentProps:{container:t,dismissible:i,flowId:r,variables:m,...h},step:F})}))}function co(e){return jsxRuntime.jsx(O,{as:f,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:r},step:n})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(u.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsxRuntime.jsx(f.Title,{children:n.title}),r&&jsxRuntime.jsx(f.Dismiss,{onClick:o}),jsxRuntime.jsx(f.Subtitle,{flexBasis:"100%",children:n.subtitle})]}),jsxRuntime.jsx(f.Media,{src:n.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(u.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(f.Secondary,{title:n.secondaryButtonTitle,onClick:i}),jsxRuntime.jsx(f.Primary,{title:n.primaryButtonTitle??"Continue",onClick:t})]})]})})}function mo({part:e,src:o,...t}){return jsxRuntime.jsx(l,{as:"img",part:["image",e],src:o,...t})}function xr(e){var o,t,i,r;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/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function fo({part:e,src:o,...t}){let i=xr(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"?fo:mo,{src:e,...t})}var f=Fe__namespace.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsxRuntime.jsx(co,{flowId:o,...t});let r=t.as??u.Column;return jsxRuntime.jsx(r,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});f.Dismiss=e=>jsxRuntime.jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})});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.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});f.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.Body2,{display:"block",part:"subtitle",...o,children:e});f.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});var ae={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function xo(e){let o=Object.fromEntries(ae.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(ae.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i={};for(let r of Object.keys(e))!ae.content.includes(r)&&!ae.root.includes(r)&&(i[r]=e[r]);return {contentProps:o,otherProps:i,rootProps:t}}function P({children:e,className:o,modal:t=!0,...i}){let{rootProps:r,contentProps:n,otherProps:a}=xo(i);return jsxRuntime.jsx(w__namespace.Root,{defaultOpen:!0,modal:t,...r,children:jsxRuntime.jsx(w__namespace.Portal,{children:jsxRuntime.jsxs(l,{className:o,display:"grid",inset:"0",padding:"6",pointerEvents:"none",position:"fixed",children:[jsxRuntime.jsx(w__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(l,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(w__namespace.Content,{asChild:!0,onOpenAutoFocus:s=>s.preventDefault(),onPointerDownOutside:s=>s.preventDefault(),...n,children:jsxRuntime.jsx(f,{alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",...a,children:e})})]})})})}P.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"})})});P.Subtitle=({children:e,...o})=>jsxRuntime.jsx(w__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(x.Body2,{part:"subtitle",...o,children:e})});P.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md",src:e,...o});P.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Primary,{title:o,onClick:e,...t});P.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,r)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?y.colors.blue500:y.colors.blue800,part:e===r?"progress-dot-selected":"progress-dot"},r));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})};P.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(b.Secondary,{title:o,onClick:e,...t});P.Title=({children:e,...o})=>jsxRuntime.jsx(w__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(x.H3,{part:"title",...o,children:e})});P.displayName="Dialog";function Cr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:P,dismissible:!0,flowId:e,textAlign:"center",...o,children:({flow:t,handleDismiss:i,handlePrimary:r,handleSecondary:n,parentProps:{dismissible:a},step:s})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx(P.Dismiss,{onClick:i}),jsxRuntime.jsxs(u.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(P.Title,{children:s.title}),jsxRuntime.jsx(P.Subtitle,{children:s.subtitle})]}),jsxRuntime.jsx(P.Media,{src:s.videoUri??s.imageUri,type:s.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(P.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(u.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[s.secondaryButtonTitle&&jsxRuntime.jsx(P.Secondary,{onClick:n,title:s.secondaryButtonTitle}),s.primaryButtonTitle&&jsxRuntime.jsx(P.Primary,{onClick:r,title:s.primaryButtonTitle??"Continue"})]})]})})}function Fr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:f,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:r,step:n})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(u.Row,{gap:3,children:[n.imageUri&&jsxRuntime.jsx(l,{as:"img",part:"image",src:n.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(u.Column,{children:[jsxRuntime.jsx(x.H4,{part:"title",children:n.title}),jsxRuntime.jsx(x.Body2,{part:"subtitle",children:n.subtitle})]})]}),jsxRuntime.jsxs(u.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[n.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:n.secondaryButtonTitle,onClick:r}),jsxRuntime.jsx(b.Primary,{title:n.primaryButtonTitle,onClick:i}),o.dismissible&&jsxRuntime.jsx(f.Dismiss,{onClick:t})]})]})})}var Ro={};L(Ro,{Collapsible:()=>wo,CollapsibleStep:()=>pe});var pe={};L(pe,{Content:()=>Be,Root:()=>ve,Trigger:()=>ke});var Rr=react.keyframes`
48
+ var tt=Object.defineProperty;var rt=(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 M=(e,o)=>{for(var t in o)tt(e,t,{get:o[t],enumerable:!0});};var Ne={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var je={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 ze={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Ke={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 Ue={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var nt="px",it=e=>typeof e=="number"?`${4*e}${nt}`:e,st=[-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"],Ge=Object.fromEntries(st.map(e=>[e,it(e)]));var Xe={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 be={...Ne,colors:{...je,...Ke},...Xe,radii:ze,shadows:Ue,space:Ge};function ee(e,o="",t="."){return Object.keys(e).reduce((i,r)=>{let a=`${o.length?`${o}${t}`:""}${r}`,s=e[r];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(i,ee(s,a,t)):i[a]=s,i},{})}function Pe(e){return ee(e,"--fr","-")}function Je(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let r=e[i];typeof r=="object"&&r!==null&&!Array.isArray(r)?t[i]=Je(r,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var Ce=Pe(be),y=Je(be);var lt=new Set(["alt","size","src"]),pt=at__default.default.all.filter(e=>e.indexOf("-")!=0&&!lt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),dt=Object.fromEntries(pt),Se=ee(y.colors),ct={color:Se,backgroundColor:Se,borderColor:Se,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},qe={...dt,...ct},Ye={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"]},Qe=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function mt(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 Ze=new Map(Object.entries(qe).map(([e,o])=>[e,mt(o)])),ut=new Map(Object.entries(Ye).map(([e,o])=>[e,new Set(o)])),ft=new Set(["height","width"]),gt=new Set(["canvas","embed","iframe","img","input","object","video"]);function eo(e){let[o,t]=e.split(":");return [o,Qe.has(t)?t:null]}function oo(e,o="div"){let t=Object.assign({},e),i={};function r(n){if(n==null)return i;let s=`&:${n.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[s]==null&&(i[s]={}),i[s]}return Object.entries(t).forEach(([n,a])=>{let[s,d]=eo(n),m=ut.get(s);m!=null&&(m.forEach(g=>{let b=`${g}${d?":"+d:""}`;t[b]=a;}),delete t[n]);}),Object.entries(t).forEach(([n,a])=>{let[s,d]=eo(n),m=Ze.get(s);if(m!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let g=a.split(" ");r(d)[s]=g.map(b=>m.get(b.toString())??b).join(" ");}else m.has(a.toString())?r(d)[s]=m.get(a.toString()):r(d)[s]=a;(typeof o!="string"||!gt.has(o)||!ft.has(s))&&delete t[n];}}),Object.keys(t).forEach(n=>{let a=n.substring(1);n.indexOf("_")===0&&Ze.has(a)&&(t[a]=t[n],delete t[n]);}),{cssFromProps:i,unmatchedProps:t}}function yt(){if(typeof window>"u"){let{JSDOM:e}=rt("jsdom");return new e("<!DOCTYPE html>").window}return window}function to(e){return e?{__html:xt__default.default(yt()).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 bt(e){return e&&`fr-${e}`}function io(e){return e&&(Array.isArray(e)?e.map(o=>io(o)).join(" "):bt(e))}function Pt({as:e,children:o,className:t,css:i={},part:r,...n},a){let s=e??"div",{cssFromProps:d,unmatchedProps:m}=oo(n,s),g=io(r),b=t||g?clsx.clsx(t,g):void 0,c=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsxRuntime.jsx(s,{className:b,css:c,...m,ref:a,dangerouslySetInnerHTML:to(o)}):jsxRuntime.jsx(s,{className:b,css:c,...m,ref:a,children:o})}var l=we__namespace.forwardRef(Pt);var h={};M(h,{Link:()=>Gt,Plain:()=>Xt,Primary:()=>Kt,Secondary:()=>Ut});var x={};M(x,{Body1:()=>At,Body2:()=>Lt,Caption:()=>Vt,Display1:()=>Et,Display2:()=>Ot,H1:()=>It,H2:()=>Mt,H3:()=>Ht,H4:()=>Wt});var Fe={};M(Fe,{Body1:()=>Bt,Body2:()=>vt,Caption:()=>kt,Display1:()=>Ct,Display2:()=>St,H1:()=>Ft,H2:()=>Tt,H3:()=>wt,H4:()=>Rt});var H={color:"neutral.foreground",fontFamily:"default",margin:"0"},Ct={...H,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},St={...H,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},Ft={...H,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},Tt={...H,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},wt={...H,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},Rt={...H,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},Bt={...H,fontSize:"md",fontWeight:"regular",lineHeight:"md"},vt={...H,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},kt={...H,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var Dt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],W=Object.fromEntries(Dt.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=we__namespace.forwardRef(({as:i=o,children:r,...n},a)=>jsxRuntime.jsx(l,{as:i,...Fe[e],...n,ref:a,children:r}));return t.displayName=`Text.${e}`,[e,t]})),Et=W.Display1,Ot=W.Display2,It=W.H1,Mt=W.H2,Ht=W.H3,Wt=W.H4,At=W.Body1,Lt=W.Body2,Vt=W.Caption;var Te={};M(Te,{Link:()=>jt,Plain:()=>zt,Primary:()=>_t,Secondary:()=>Nt});var ae={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},_t={...ae,backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},Nt={...ae,backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},jt={...ae,backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},zt={...ae,backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"};function le({as:e,children:o,part:t,title:i,variant:r="Primary",...n}){let a=r.toLocaleLowerCase();return jsxRuntime.jsxs(l,{as:e??"button",part:[`button-${a}`,t],...Te[r],...n,children:[o,i&&jsxRuntime.jsx(x.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}function Kt({children:e,...o}){return jsxRuntime.jsx(le,{...o,variant:"Primary",children:e})}function Ut({children:e,...o}){return jsxRuntime.jsx(le,{...o,variant:"Secondary",children:e})}function Gt({children:e,...o}){return jsxRuntime.jsx(le,{...o,variant:"Link",children:e})}function Xt({children:e,...o}){return jsxRuntime.jsx(le,{...o,variant:"Plain",children:e})}var u={};M(u,{Column:()=>Yt,Row:()=>qt});var qt=we__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),Yt=we__namespace.forwardRef((e,o)=>jsxRuntime.jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var w=we.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function po({children:e,navigate:o,theme:t,...i}){let r=t?Pe(t):{},[n,a]=we.useState(new Set),s=we.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??((g,b="_self")=>{window.open(g,b);});we.useEffect(()=>()=>{s.destroy();},[]);let m=n.size>0?n.values().next().value:null;return jsxRuntime.jsxs(w.Provider,{value:{modals:n,setModals:a,currentModal:m,navigate:d,...i,frigade:s},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...Ce,...r}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:y,children:e})]})}function te(e,o){let[t,i]=we.useState(),[,r]=we.useState(""),{frigade:n}=we.useContext(w),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),i(s),r(Math.random().toString()));};return we.useEffect(()=>((async()=>{let s=await n.getFlow(e);if(!s||n.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),i(s);})(),n.onStateChange(a),()=>{n.removeStateChangeHandler(a);}),[]),{flow:t}}function j(e,{onComplete:o,onDismiss:t}={}){let i=we.useRef(null);return we.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:we.useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();},[e])}}function z(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=we.useContext(w);return {handlePrimary:we.useCallback(async(r,n)=>await(o==null?void 0:o(e,r))===!1?(r.preventDefault(),!1):(e.complete(n),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:we.useCallback(async(r,n)=>await(t==null?void 0:t(e,r))===!1?(r.preventDefault(),!1):(e.complete(n),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function re(e,o=!0){let{currentModal:t,modals:i,setModals:r}=we.useContext(w),[n,a]=we.useState(!1);we.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!i.has(e.id)&&r(d=>new Set(d).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),we.useEffect(()=>{let d=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&d!==n&&a(d);},[e==null?void 0:e.id,t]);function s(){o&&i.has(e==null?void 0:e.id)&&r(d=>{let m=new Set(d);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:n||!o,removeModal:s}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:m,forceMount:g,...b}){let{flow:c}=te(r,{variables:m}),F=c==null?void 0:c.getCurrentStep(),{handleDismiss:q}=j(c,{onComplete:n,onDismiss:a}),{handlePrimary:N,handleSecondary:xe}=z(F,{onPrimary:s,onSecondary:d}),ie=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:Z,removeModal:ye}=re(c,ie);if(we.useEffect(()=>{!(c!=null&&c.isVisible)&&Z&&ye();},[c==null?void 0:c.isVisible,Z]),c==null||!Z)return null;let he=g&&c.isCompleted;return !c.isVisible&&!he?null:(!c.isCompleted&&!c.isSkipped&&F.start(),jsxRuntime.jsx(e??l,{position:"relative",...b,children:o({flow:c,handleDismiss:q,handlePrimary:N,handleSecondary:xe,parentProps:{container:t,dismissible:i,flowId:r,variables:m,...b},step:F})}))}function fo(e){return jsxRuntime.jsx(O,{as:f,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:r},step:n})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(u.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsxRuntime.jsx(f.Title,{children:n.title}),r&&jsxRuntime.jsx(f.Dismiss,{onClick:o}),jsxRuntime.jsx(f.Subtitle,{flexBasis:"100%",children:n.subtitle})]}),jsxRuntime.jsx(f.Media,{src:n.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(u.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(f.Secondary,{title:n.secondaryButtonTitle,onClick:i}),jsxRuntime.jsx(f.Primary,{title:n.primaryButtonTitle??"Continue",onClick:t})]})]})})}function Be({part:e,src:o,...t}){return jsxRuntime.jsx(l,{as:"img",part:["image",e],src:o,...t})}function hr(e){var o,t,i,r;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/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function ve({part:e,src:o,...t}){let i=hr(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"?ve:Be,{src:e,...t})}var f=we__namespace.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsxRuntime.jsx(fo,{flowId:o,...t});let r=t.as??u.Column;return jsxRuntime.jsx(r,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});f.Dismiss=e=>jsxRuntime.jsx(h.Plain,{part:"dismiss",padding:0,...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})});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(h.Primary,{title:o,onClick:e,...t});f.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(h.Secondary,{title:o,onClick:e,...t});f.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.Body2,{display:"block",part:"subtitle",...o,children:e});f.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});var pe={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function yo(e){let o=Object.fromEntries(pe.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(pe.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i={};for(let r of Object.keys(e))!pe.content.includes(r)&&!pe.root.includes(r)&&(i[r]=e[r]);return {contentProps:o,otherProps:i,rootProps:t}}function P({children:e,className:o,modal:t=!0,...i}){let{rootProps:r,contentProps:n,otherProps:a}=yo(i);return jsxRuntime.jsx(R__namespace.Root,{defaultOpen:!0,modal:t,...r,children:jsxRuntime.jsx(R__namespace.Portal,{children:jsxRuntime.jsxs(l,{className:o,display:"grid",inset:"0",padding:"6",pointerEvents:"none",position:"fixed",children:[jsxRuntime.jsx(R__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(l,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(R__namespace.Content,{asChild:!0,onOpenAutoFocus:s=>s.preventDefault(),onPointerDownOutside:s=>s.preventDefault(),...n,children:jsxRuntime.jsx(f,{alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",...a,children:e})})]})})})}P.Dismiss=e=>jsxRuntime.jsx(R__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(h.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});P.Subtitle=({children:e,...o})=>jsxRuntime.jsx(R__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(x.Body2,{part:"subtitle",...o,children:e})});P.Media=({src:e,...o})=>e==null?null:jsxRuntime.jsx(U,{borderRadius:"md",src:e,...o});P.Primary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(h.Primary,{title:o,onClick:e,...t});P.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,r)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?y.colors.blue500:y.colors.blue800,part:e===r?"progress-dot-selected":"progress-dot"},r));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})};P.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(h.Secondary,{title:o,onClick:e,...t});P.Title=({children:e,...o})=>jsxRuntime.jsx(R__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(x.H3,{part:"title",...o,children:e})});P.displayName="Dialog";function Fr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:P,dismissible:!0,flowId:e,textAlign:"center",...o,children:({flow:t,handleDismiss:i,handlePrimary:r,handleSecondary:n,parentProps:{dismissible:a},step:s})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx(P.Dismiss,{onClick:i}),jsxRuntime.jsxs(u.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(P.Title,{children:s.title}),jsxRuntime.jsx(P.Subtitle,{children:s.subtitle})]}),jsxRuntime.jsx(P.Media,{src:s.videoUri??s.imageUri,type:s.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(P.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(u.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[s.secondaryButtonTitle&&jsxRuntime.jsx(P.Secondary,{onClick:n,title:s.secondaryButtonTitle}),s.primaryButtonTitle&&jsxRuntime.jsx(P.Primary,{onClick:r,title:s.primaryButtonTitle??"Continue"})]})]})})}function wr({flowId:e,...o}){return jsxRuntime.jsx(O,{as:f,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:r,step:n})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(u.Row,{gap:3,children:[n.imageUri&&jsxRuntime.jsx(l,{as:"img",part:"image",src:n.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(u.Column,{children:[jsxRuntime.jsx(x.H4,{part:"title",children:n.title}),jsxRuntime.jsx(x.Body2,{part:"subtitle",children:n.subtitle})]})]}),jsxRuntime.jsxs(u.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[n.secondaryButtonTitle&&jsxRuntime.jsx(h.Secondary,{title:n.secondaryButtonTitle,onClick:r}),jsxRuntime.jsx(h.Primary,{title:n.primaryButtonTitle,onClick:i}),o.dismissible&&jsxRuntime.jsx(f.Dismiss,{onClick:t})]})]})})}var Bo={};M(Bo,{Collapsible:()=>Ro,CollapsibleStep:()=>ce});var ce={};M(ce,{Content:()=>Ee,Root:()=>Oe,Trigger:()=>Ie});var vr=react.keyframes`
49
49
  from {
50
50
  height: 0;
51
51
  opacity: 0;
@@ -54,7 +54,7 @@ var ot=Object.defineProperty;var tt=(e=>typeof require<"u"?require:typeof Proxy<
54
54
  height: var(--radix-collapsible-content-height);
55
55
  opacity: 1;
56
56
  }
57
- `,Br=react.keyframes`
57
+ `,kr=react.keyframes`
58
58
  from {
59
59
  height: var(--radix-collapsible-content-height);
60
60
  opacity: 1;
@@ -63,7 +63,7 @@ var ot=Object.defineProperty;var tt=(e=>typeof require<"u"?require:typeof Proxy<
63
63
  height: 0;
64
64
  opacity: 0;
65
65
  }
66
- `,vr=()=>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 kr({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(vr,{})})})}function Be({children:e}){return jsxRuntime.jsx(Y__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(u.Column,{css:{'&[data-state="open"]':{animation:`${Rr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Br} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(l,{}),e]})})}function ve({children:e,open:o=!1,onOpenChange:t=()=>{}}){return jsxRuntime.jsx(Y__namespace.Root,{asChild:!0,open:o,onOpenChange:t,children:jsxRuntime.jsx(f,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function ke({isCompleted:e,title:o}){return jsxRuntime.jsx(Y__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(u.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(u.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(kr,{checked:e}),jsxRuntime.jsx(x.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 De={};L(De,{Bar:()=>de,Dots:()=>Po,Segments:()=>So});function de({current:e,total:o,...t}){let i=o>0?Math.min(e/o,1):0,r=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(l,{part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px",...t,children:jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:r},transition:"width 300ms ease-out"})})}function Po({current:e,total:o,...t}){if(o==1)return null;let i=[...Array(o)].map((r,n)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e-1===n?y.colors.blue500:y.colors.blue800},n));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 So({current:e,total:o,...t}){let i=[...Array(o)].map((r,n)=>jsxRuntime.jsx(l,{backgroundColor:e-1===n?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},n));return jsxRuntime.jsx(u.Row,{gap:1,height:"10px",...t,children:i})}var Fo=Fe.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function To({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:i,step:r}){let{isBlocked:n,isCompleted:a,primaryButtonTitle:s,secondaryButtonTitle:d,subtitle:m,title:g}=r;return jsxRuntime.jsxs(ve,{open:t,onOpenChange:i,children:[jsxRuntime.jsx(ke,{isCompleted:a,title:g}),jsxRuntime.jsxs(Be,{children:[jsxRuntime.jsx(f.Media,{aspectRatio:2.5,objectFit:"cover",src:r.imageUri}),jsxRuntime.jsx(f.Subtitle,{color:"gray500",children:m}),jsxRuntime.jsxs(u.Row,{gap:3,children:[jsxRuntime.jsx(f.Secondary,{disabled:!!(a||n),title:d,onClick:o}),jsxRuntime.jsx(f.Primary,{disabled:!!(a||n),title:s,onClick:e})]})]})]})}var Ir={default:To};function Mr({flow:e,step:o,...t}){let{onPrimary:i,onSecondary:r,openStepId:n,setOpenStepId:a,stepTypes:s}=Fe.useContext(Fo),{handlePrimary:d,handleSecondary:m}=z(o,{onPrimary:i,onSecondary:r}),g=(n??e.getCurrentStep().id)===o.id,h=s[o.type]??To;async function c(F){a(F?o.id:""),F&&!o.isCompleted&&await o.start();}return jsxRuntime.jsx(h,{flow:e,onOpenChange:c,open:g,step:o,...t,handlePrimary:d,handleSecondary:m},o.id)}function wo({dismissible:e,flowId:o,onPrimary:t,onSecondary:i,stepTypes:r={},...n}){let[a,s]=Fe.useState(null),d={...Ir,...r};return jsxRuntime.jsx(Fo.Provider,{value:{openStepId:a,setOpenStepId:s,onPrimary:t,onSecondary:i,stepTypes:d},children:jsxRuntime.jsx(O,{as:f,borderWidth:"md",flowId:o,part:"checklist",...n,children:({flow:m,handleDismiss:g,...h})=>{let c=Array.from(m.steps.entries()).map(([,N])=>jsxRuntime.jsx(Mr,{flow:m,handleDismiss:g,...h,step:N},N.id)),F=m.getNumberOfCompletedSteps(),q=m.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(u.Column,{gap:2,children:[jsxRuntime.jsxs(u.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"checklist-header",children:[jsxRuntime.jsx(f.Title,{children:m.title}),e&&jsxRuntime.jsx(f.Dismiss,{onClick:g}),jsxRuntime.jsx(f.Subtitle,{color:"gray500",flexBasis:"100%",children:m.subtitle})]}),jsxRuntime.jsxs(u.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(x.Body2,{fontWeight:"demibold",children:[F,"/",q]}),jsxRuntime.jsx(de,{current:F,total:q,flexGrow:1})]})]}),c]})}})})}var Lr=new Set(["required","min","max","minLength","maxLength","pattern"]);function Vr({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(([n])=>Lr.has(n))),r=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,{...r,fieldData:t})}function Bo({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:r},step:n}){var h;let{control:a,handleSubmit:s}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),d=[];function m(c,F){t(F,c);}function g(c,F){i(F,c);}return (h=n.fields)==null||h.forEach(c=>{e[c.type]!=null&&d.push(jsxRuntime.jsx(Vr,{control:a,fieldComponent:e[c.type],fieldData:c},c.id));}),jsxRuntime.jsxs(u.Column,{gap:5,part:"form-step",children:[jsxRuntime.jsxs(u.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsxRuntime.jsx(f.Title,{children:n.title}),r&&jsxRuntime.jsx(f.Dismiss,{onClick:o}),jsxRuntime.jsx(f.Subtitle,{flexBasis:"100%",children:n.subtitle})]}),d,jsxRuntime.jsxs(u.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[n.secondaryButtonTitle&&jsxRuntime.jsx(b.Secondary,{title:n.secondaryButtonTitle,onClick:s(g)}),jsxRuntime.jsx(b.Primary,{title:n.primaryButtonTitle??"Submit",onClick:s(m)})]},"form-footer")]})}function vo({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(x.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function ko({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(x.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:r,label:n,placeholder:a}=t,{error:s}=i,d={id:r,...o,...a?{placeholder:a}:{},...re,"aria-invalid":!!s,value:o.value??""};return jsxRuntime.jsxs(l,{part:"field",children:[jsxRuntime.jsx(ko,{id:r,required:!!t.required,children:n}),e(d),jsxRuntime.jsx(vo,{error:s})]})}var jr=()=>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"})}),zr=Fe__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(x.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(jr,{})})})})]}));function Io(e){let{field:{onChange:o,value:t},fieldData:{options:i=[]}}=e,r=i.map(({label:n,value:a})=>jsxRuntime.jsx(zr,{value:a,label:n},a));return jsxRuntime.jsx(_,{...e,children:()=>jsxRuntime.jsx(Q__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(u.Column,{gap:2,part:"field-radio-group",children:r})})})}var Gr=Fe__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(S__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(S__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(x.Body2,{part:"field-select-option-label",children:e})})})}));function Wo(e){let{field:{onChange:o,value:t},fieldData:{options:i=[],placeholder:r}}=e,n=i.map(({label:a,value:s})=>jsxRuntime.jsx(Gr,{value:s,label:a},s));return jsxRuntime.jsx(_,{...e,children:()=>jsxRuntime.jsxs(S__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(S__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(x.Body2,{...re,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(S__namespace.Value,{placeholder:r??"Select one"}),jsxRuntime.jsx(S__namespace.Icon,{children:jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(S__namespace.Portal,{children:jsxRuntime.jsx(S__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(S__namespace.Viewport,{children:n})})})})]})})}function Lo(e){return jsxRuntime.jsx(_,{...e,children:o=>jsxRuntime.jsx(x.Body2,{as:"input",part:"field-text",type:"text",...o})})}function $o(e){return jsxRuntime.jsx(_,{...e,children:o=>jsxRuntime.jsx(x.Body2,{as:"textarea",part:"field-textarea",...o})})}var Xr={radio:Io,select:Wo,text:Lo,textarea:$o};function Oe({fieldTypes:e={},flowId:o,...t}){let i=Object.assign({},Xr,e);return jsxRuntime.jsx(O,{flowId:o,part:"form",...t,children:r=>jsxRuntime.jsx(Bo,{fieldTypes:i,...r})})}var Ko={};L(Ko,{NPS:()=>zo});function jo({field:e}){let o=[...Array(11)].map((t,i)=>{let r=e.value===i?b.Primary:b.Secondary;return jsxRuntime.jsx(r,{borderWidth:"1px",onClick:()=>e.onChange(i),title:`${i}`},i)});return jsxRuntime.jsx(u.Row,{gap:2,justifyContent:"space-between",part:"field-nps",children:o})}function zo({as:e=P,flowId:o,fieldTypes:t,...i}){return jsxRuntime.jsx(Oe,{alignSelf:"end",as:e,flowId:o,fieldTypes:{nps:jo,...t},minWidth:"620px",modal:!1,width:"620px",...i})}function ce(){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]=Fe.useState(e),[i,r]=Fe.useState(null),n=Fe.useCallback(a=>{r(a);},[]);return Fe.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:n}}var Zr=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Xo({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 ${Zr}`,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 Jo({props:e,alignAttr:o,sideAttr:t}){let i=t??"bottom",r={},n=()=>{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"};r[s[i]]=a;let d=n();return ["before","end"].includes(d)?["top","bottom"].includes(i)?r.right=a:r.bottom=a:["after","start"].includes(d)?["top","bottom"].includes(i)?r.left=a:r.top=a:["top","bottom"].includes(i)?r.left=`calc(50% + ${a})`:r.top=`calc(50% + ${a})`,r}var me={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function qo(e,o){let t=Object.fromEntries(me.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),i=Object.fromEntries(me.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!me.content.includes(n)&&!me.root.includes(n)&&(r[n]=e[n]);if(t.align=t.align??"after",t.side=t.side??"bottom",["before","after"].includes(t.align)){let n={after:"end",before:"start"},a=(c,F)=>["top","bottom"].includes(F)?c=="after"?"marginLeft":"marginRight":c=="after"?"marginTop":"marginBottom",s=t.alignOffset??0,d=t.style??{},m=t.side??"bottom",g=t.align;t.style={...d,[a(g,m)]:s};let h=["top","bottom"].includes(m)?o.width:o.height;t.alignOffset=(h+s)*-1,t.align=n[g];}return {contentProps:t,otherProps:r,rootProps:i}}function T({anchor:e,children:o,className:t,spotlight:i=!1,style:r,...n}){let{node:a,rect:s,ref:d}=ce(),{node:m,rect:g,ref:h}=ce(),{contentProps:c,otherProps:F,rootProps:q}=qo(n,s),[N,fe]=Fe.useState(c.align),[ne,Z]=Fe.useState(c.side),[ge,xe]=Fe.useState(0),[He,Zo]=Fe.useState(0);if(a!==null){let A=a.getAttribute("data-align"),ie=a.getAttribute("data-side");N!==A&&fe(A),ne!==ie&&Z(ie);}let We=Fe.useRef(null);if(Fe.useEffect(()=>{let A=document.querySelector(e);A!=null?(h(A),We.current=A):console.debug(`No anchor found for query: ${e}`);},[e]),Fe.useEffect(()=>{let{scrollX:A,scrollY:ie}=window;xe(g.left+A),Zo(g.top+ie);},[g.left,g.top]),m==null)return null;let Ae="0";typeof window<"u"&&(Ae=window.getComputedStyle(m).borderRadius);let et=Jo({props:n,alignAttr:N,sideAttr:ne});return jsxRuntime.jsxs(I__namespace.Root,{defaultOpen:!0,...q,children:[jsxRuntime.jsx(I__namespace.Anchor,{virtualRef:We}),jsxRuntime.jsx(I__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i&&jsxRuntime.jsx(l,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:Ae,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:g.height,left:ge,top:He,width:g.width}}),jsxRuntime.jsx(I__namespace.Content,{asChild:!0,...c,ref:d,children:jsxRuntime.jsxs(f,{boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:r,...F,children:[jsxRuntime.jsx(Xo,{style:et}),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(x.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(x.Body2,{part:"subtitle",...o,children:e});T.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.H4,{part:"title",...o,children:e});function Qo({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:i,onSecondary:r,step:n,...a}){let{handleDismiss:s}=j(o,{onDismiss:t}),{handlePrimary:d,handleSecondary:m}=z(n,{onPrimary:i,onSecondary:r});return jsxRuntime.jsxs(T,{anchor:n.selector,onOpenAutoFocus:g=>g.preventDefault(),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),...a,children:[e&&jsxRuntime.jsx(T.Close,{onClick:s}),jsxRuntime.jsx(T.Media,{src:n.videoUri??n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsxs(u.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(T.Title,{children:n.title}),jsxRuntime.jsx(T.Subtitle,{color:"gray500",children:n.subtitle})]}),jsxRuntime.jsxs(u.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:n.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(T.Primary,{title:n.primaryButtonTitle,onClick:d})]})]},n.id)}function sn({flowId:e,onComplete:o,variables:t,...i}){let{flow:r}=oe(e,{variables:t});j(r,{onComplete:o});let{isCurrentModal:n,removeModal:a}=te(r);if(Fe.useEffect(()=>{!(r!=null&&r.isVisible)&&n&&a();},[r==null?void 0:r.isVisible,n]),r==null||r.isVisible===!1||!n)return null;let s=r.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(Qo,{step:s,flow:r,...i})}function pn(){let{frigade:e}=Fe.useContext(v);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function cn(){let{userId:e,frigade:o}=Fe.useContext(v);async function t(r){await o.identify(e,r);}async function i(r,n){await o.track(r,n);}return {userId:e,addProperties:t,track:i}}function un(){let{groupId:e,frigade:o}=Fe.useContext(v);async function t(r){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await o.group(e,r);}async function i(r,n){await o.track(r,n);}return {groupId:e,addProperties:t,track:i}}
66
+ `,Dr=()=>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 Er({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(Dr,{})})})}function Ee({children:e}){return jsxRuntime.jsx(Y__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(u.Column,{css:{'&[data-state="open"]':{animation:`${vr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${kr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(l,{}),e]})})}function Oe({children:e,open:o=!1,onOpenChange:t=()=>{}}){return jsxRuntime.jsx(Y__namespace.Root,{asChild:!0,open:o,onOpenChange:t,children:jsxRuntime.jsx(f,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function Ie({isCompleted:e,title:o}){return jsxRuntime.jsx(Y__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(u.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(u.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Er,{checked:e}),jsxRuntime.jsx(x.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 Me={};M(Me,{Bar:()=>me,Dots:()=>Co,Segments:()=>Fo});function me({current:e,total:o,...t}){let i=o>0?Math.min(e/o,1):0,r=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(l,{part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px",...t,children:jsxRuntime.jsx(l,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:r},transition:"width 300ms ease-out"})})}function Co({current:e,total:o,...t}){if(o==1)return null;let i=[...Array(o)].map((r,n)=>jsxRuntime.jsx(l,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e-1===n?y.colors.blue500:y.colors.blue800},n));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 Fo({current:e,total:o,...t}){let i=[...Array(o)].map((r,n)=>jsxRuntime.jsx(l,{backgroundColor:e-1===n?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},n));return jsxRuntime.jsx(u.Row,{gap:1,height:"10px",...t,children:i})}var To=we.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function wo({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:i,step:r}){let{isBlocked:n,isCompleted:a,primaryButtonTitle:s,secondaryButtonTitle:d,subtitle:m,title:g}=r;return jsxRuntime.jsxs(Oe,{open:t,onOpenChange:i,children:[jsxRuntime.jsx(Ie,{isCompleted:a,title:g}),jsxRuntime.jsxs(Ee,{children:[jsxRuntime.jsx(f.Media,{aspectRatio:2.5,objectFit:"cover",src:r.imageUri}),jsxRuntime.jsx(f.Subtitle,{color:"gray500",children:m}),jsxRuntime.jsxs(u.Row,{gap:3,children:[jsxRuntime.jsx(f.Secondary,{disabled:!!(a||n),title:d,onClick:o}),jsxRuntime.jsx(f.Primary,{disabled:!!(a||n),title:s,onClick:e})]})]})]})}var Hr={default:wo};function Wr({flow:e,step:o,...t}){let{onPrimary:i,onSecondary:r,openStepId:n,setOpenStepId:a,stepTypes:s}=we.useContext(To),{handlePrimary:d,handleSecondary:m}=z(o,{onPrimary:i,onSecondary:r}),g=(n??e.getCurrentStep().id)===o.id,b=s[o.type]??wo;async function c(F){a(F?o.id:""),F&&!o.isCompleted&&await o.start();}return jsxRuntime.jsx(b,{flow:e,onOpenChange:c,open:g,step:o,...t,handlePrimary:d,handleSecondary:m},o.id)}function Ro({dismissible:e,flowId:o,onPrimary:t,onSecondary:i,stepTypes:r={},...n}){let[a,s]=we.useState(null),d={...Hr,...r};return jsxRuntime.jsx(To.Provider,{value:{openStepId:a,setOpenStepId:s,onPrimary:t,onSecondary:i,stepTypes:d},children:jsxRuntime.jsx(O,{as:f,borderWidth:"md",flowId:o,part:"checklist",...n,children:({flow:m,handleDismiss:g,...b})=>{let c=Array.from(m.steps.entries()).map(([,N])=>jsxRuntime.jsx(Wr,{flow:m,handleDismiss:g,...b,step:N},N.id)),F=m.getNumberOfCompletedSteps(),q=m.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(u.Column,{gap:2,children:[jsxRuntime.jsxs(u.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"checklist-header",children:[jsxRuntime.jsx(f.Title,{children:m.title}),e&&jsxRuntime.jsx(f.Dismiss,{onClick:g}),jsxRuntime.jsx(f.Subtitle,{color:"gray500",flexBasis:"100%",children:m.subtitle})]}),jsxRuntime.jsxs(u.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(x.Body2,{fontWeight:"demibold",children:[F,"/",q]}),jsxRuntime.jsx(me,{current:F,total:q,flexGrow:1})]})]}),c]})}})})}var $r=new Set(["required","min","max","minLength","maxLength","pattern"]);function _r({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(([n])=>$r.has(n))),r=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,{...r,fieldData:t})}function vo({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:r},step:n}){var b;let{control:a,handleSubmit:s}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),d=[];function m(c,F){t(F,c);}function g(c,F){i(F,c);}return (b=n.fields)==null||b.forEach(c=>{e[c.type]!=null&&d.push(jsxRuntime.jsx(_r,{control:a,fieldComponent:e[c.type],fieldData:c},c.id));}),jsxRuntime.jsxs(u.Column,{gap:5,part:"form-step",children:[jsxRuntime.jsxs(u.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsxRuntime.jsx(f.Title,{children:n.title}),r&&jsxRuntime.jsx(f.Dismiss,{onClick:o}),jsxRuntime.jsx(f.Subtitle,{flexBasis:"100%",children:n.subtitle})]}),d,jsxRuntime.jsxs(u.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[n.secondaryButtonTitle&&jsxRuntime.jsx(h.Secondary,{title:n.secondaryButtonTitle,onClick:s(g)}),jsxRuntime.jsx(h.Primary,{title:n.primaryButtonTitle??"Submit",onClick:s(m)})]},"form-footer")]})}function ko({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(x.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Do({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(x.H4,{as:"label",htmlFor:o,part:"field-label",children:[e,t&&" *"]})}var ne={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:r,label:n,placeholder:a}=t,{error:s}=i,d={id:r,...o,...a?{placeholder:a}:{},...ne,"aria-invalid":!!s,value:o.value??""};return jsxRuntime.jsxs(l,{part:"field",children:[jsxRuntime.jsx(Do,{id:r,required:!!t.required,children:n}),e(d),jsxRuntime.jsx(ko,{error:s})]})}var Kr=()=>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"})}),Ur=we__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(x.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(Kr,{})})})})]}));function Mo(e){let{field:{onChange:o,value:t},fieldData:{options:i=[]}}=e,r=i.map(({label:n,value:a})=>jsxRuntime.jsx(Ur,{value:a,label:n},a));return jsxRuntime.jsx(_,{...e,children:()=>jsxRuntime.jsx(Q__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(u.Column,{gap:2,part:"field-radio-group",children:r})})})}var Jr=we__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(S__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(S__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(x.Body2,{part:"field-select-option-label",children:e})})})}));function Ao(e){let{field:{onChange:o,value:t},fieldData:{options:i=[],placeholder:r}}=e,n=i.map(({label:a,value:s})=>jsxRuntime.jsx(Jr,{value:s,label:a},s));return jsxRuntime.jsx(_,{...e,children:()=>jsxRuntime.jsxs(S__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(S__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(x.Body2,{...ne,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(S__namespace.Value,{placeholder:r??"Select one"}),jsxRuntime.jsx(S__namespace.Icon,{children:jsxRuntime.jsx(l,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsxRuntime.jsx(S__namespace.Portal,{children:jsxRuntime.jsx(S__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(l,{...ne,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsxRuntime.jsx(S__namespace.Viewport,{children:n})})})})]})})}function Vo(e){return jsxRuntime.jsx(_,{...e,children:o=>jsxRuntime.jsx(x.Body2,{as:"input",part:"field-text",type:"text",...o})})}function _o(e){return jsxRuntime.jsx(_,{...e,children:o=>jsxRuntime.jsx(x.Body2,{as:"textarea",part:"field-textarea",...o})})}var qr={radio:Mo,select:Ao,text:Vo,textarea:_o};function We({fieldTypes:e={},flowId:o,...t}){let i=Object.assign({},qr,e);return jsxRuntime.jsx(O,{flowId:o,part:"form",...t,children:r=>jsxRuntime.jsx(vo,{fieldTypes:i,...r})})}var Uo={};M(Uo,{NPS:()=>Ko});function zo({field:e}){let o=[...Array(11)].map((t,i)=>{let r=e.value===i?h.Primary:h.Secondary;return jsxRuntime.jsx(r,{borderWidth:"1px",onClick:()=>e.onChange(i),title:`${i}`},i)});return jsxRuntime.jsx(u.Row,{gap:2,justifyContent:"space-between",part:"field-nps",children:o})}function Ko({as:e=P,flowId:o,fieldTypes:t,...i}){return jsxRuntime.jsx(We,{alignSelf:"end",as:e,flowId:o,fieldTypes:{nps:zo,...t},minWidth:"620px",modal:!1,width:"620px",...i})}function ue(){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]=we.useState(e),[i,r]=we.useState(null),n=we.useCallback(a=>{r(a);},[]);return we.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:n}}var on=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Jo({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 ${on}`,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 qo({props:e,alignAttr:o,sideAttr:t}){let i=t??"bottom",r={},n=()=>{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"};r[s[i]]=a;let d=n();return ["before","end"].includes(d)?["top","bottom"].includes(i)?r.right=a:r.bottom=a:["after","start"].includes(d)?["top","bottom"].includes(i)?r.left=a:r.top=a:["top","bottom"].includes(i)?r.left=`calc(50% + ${a})`:r.top=`calc(50% + ${a})`,r}var fe={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Yo(e,o){let t=Object.fromEntries(fe.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),i=Object.fromEntries(fe.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!fe.content.includes(n)&&!fe.root.includes(n)&&(r[n]=e[n]);if(t.align=t.align??"after",t.side=t.side??"bottom",["before","after"].includes(t.align)){let n={after:"end",before:"start"},a=(c,F)=>["top","bottom"].includes(F)?c=="after"?"marginLeft":"marginRight":c=="after"?"marginTop":"marginBottom",s=t.alignOffset??0,d=t.style??{},m=t.side??"bottom",g=t.align;t.style={...d,[a(g,m)]:s};let b=["top","bottom"].includes(m)?o.width:o.height;t.alignOffset=(b+s)*-1,t.align=n[g];}return {contentProps:t,otherProps:r,rootProps:i}}function T({anchor:e,children:o,className:t,spotlight:i=!1,style:r,...n}){let{node:a,rect:s,ref:d}=ue(),{node:m,rect:g,ref:b}=ue(),{contentProps:c,otherProps:F,rootProps:q}=Yo(n,s),[N,xe]=we.useState(c.align),[ie,Z]=we.useState(c.side),[ye,he]=we.useState(0),[Ve,et]=we.useState(0);if(a!==null){let L=a.getAttribute("data-align"),se=a.getAttribute("data-side");N!==L&&xe(L),ie!==se&&Z(se);}let $e=we.useRef(null);if(we.useEffect(()=>{let L=document.querySelector(e);L!=null?(b(L),$e.current=L):console.debug(`No anchor found for query: ${e}`);},[e]),we.useEffect(()=>{let{scrollX:L,scrollY:se}=window;he(g.left+L),et(g.top+se);},[g.left,g.top]),m==null)return null;let _e="0";typeof window<"u"&&(_e=window.getComputedStyle(m).borderRadius);let ot=qo({props:n,alignAttr:N,sideAttr:ie});return jsxRuntime.jsxs(I__namespace.Root,{defaultOpen:!0,...q,children:[jsxRuntime.jsx(I__namespace.Anchor,{virtualRef:$e}),jsxRuntime.jsx(I__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i&&jsxRuntime.jsx(l,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:_e,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:g.height,left:ye,top:Ve,width:g.width}}),jsxRuntime.jsx(I__namespace.Content,{asChild:!0,...c,ref:d,children:jsxRuntime.jsxs(f,{boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:r,...F,children:[jsxRuntime.jsx(Jo,{style:ot}),o]})})]})})]})}T.Close=e=>jsxRuntime.jsx(I__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(h.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(h.Primary,{title:o,onClick:e,...t});T.Progress=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.H4,{part:"progress",...o,children:e});T.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsxRuntime.jsx(h.Secondary,{title:o,onClick:e,...t});T.Subtitle=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.Body2,{part:"subtitle",...o,children:e});T.Title=({children:e,...o})=>e==null?null:jsxRuntime.jsx(x.H4,{part:"title",...o,children:e});function Zo({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:i,onSecondary:r,step:n,...a}){let{handleDismiss:s}=j(o,{onDismiss:t}),{handlePrimary:d,handleSecondary:m}=z(n,{onPrimary:i,onSecondary:r});return jsxRuntime.jsxs(T,{anchor:n.selector,onOpenAutoFocus:g=>g.preventDefault(),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),...a,children:[e&&jsxRuntime.jsx(T.Close,{onClick:s}),jsxRuntime.jsx(T.Media,{src:n.videoUri??n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsxs(u.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(T.Title,{children:n.title}),jsxRuntime.jsx(T.Subtitle,{color:"gray500",children:n.subtitle})]}),jsxRuntime.jsxs(u.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:n.secondaryButtonTitle,onClick:m}),jsxRuntime.jsx(T.Primary,{title:n.primaryButtonTitle,onClick:d})]})]},n.id)}function ln({flowId:e,onComplete:o,variables:t,...i}){let{flow:r}=te(e,{variables:t});j(r,{onComplete:o});let{isCurrentModal:n,removeModal:a}=re(r);if(we.useEffect(()=>{!(r!=null&&r.isVisible)&&n&&a();},[r==null?void 0:r.isVisible,n]),r==null||r.isVisible===!1||!n)return null;let s=r.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(Zo,{step:s,flow:r,...i})}function cn(){let{frigade:e}=we.useContext(w);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function un(){let{userId:e,frigade:o}=we.useContext(w);async function t(r){await o.identify(e,r);}async function i(r,n){await o.track(r,n);}return {userId:e,addProperties:t,track:i}}function gn(){let{groupId:e,frigade:o}=we.useContext(w);async function t(r){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await o.group(e,r);}async function i(r,n){await o.track(r,n);}return {groupId:e,addProperties:t,track:i}}
67
67
 
68
68
  Object.defineProperty(exports, 'Flow', {
69
69
  enumerable: true,
@@ -77,29 +77,29 @@ Object.defineProperty(exports, 'Frigade', {
77
77
  enumerable: true,
78
78
  get: function () { return js.Frigade; }
79
79
  });
80
- exports.Announcement = Cr;
81
- exports.Banner = Fr;
80
+ exports.Announcement = Fr;
81
+ exports.Banner = wr;
82
82
  exports.Box = l;
83
- exports.Button = b;
83
+ exports.Button = h;
84
84
  exports.Card = f;
85
- exports.Checklist = Ro;
85
+ exports.Checklist = Bo;
86
86
  exports.Dialog = P;
87
87
  exports.Flex = u;
88
- exports.Form = Oe;
89
- exports.Progress = De;
90
- exports.Provider = tr;
91
- exports.Survey = Ko;
88
+ exports.Form = We;
89
+ exports.Progress = Me;
90
+ exports.Provider = po;
91
+ exports.Survey = Uo;
92
92
  exports.Text = x;
93
93
  exports.Tooltip = T;
94
- exports.Tour = sn;
95
- exports.themeVariables = be;
96
- exports.useBoundingClientRect = ce;
97
- exports.useFlow = oe;
94
+ exports.Tour = ln;
95
+ exports.themeVariables = Ce;
96
+ exports.useBoundingClientRect = ue;
97
+ exports.useFlow = te;
98
98
  exports.useFlowHandlers = j;
99
- exports.useFrigade = pn;
100
- exports.useGroup = un;
101
- exports.useModal = te;
99
+ exports.useFrigade = cn;
100
+ exports.useGroup = gn;
101
+ exports.useModal = re;
102
102
  exports.useStepHandlers = z;
103
- exports.useUser = cn;
103
+ exports.useUser = un;
104
104
  //# sourceMappingURL=out.js.map
105
105
  //# sourceMappingURL=index.cjs.map