@frigade/react 2.0.0-alpha.36 → 2.0.0-alpha.37

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.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { CSSProperties, MouseEvent } from 'react';
3
+ import React__default, { CSSProperties } from 'react';
4
4
  import * as _frigade_js from '@frigade/js';
5
5
  import { Flow, FlowStep } from '@frigade/js';
6
+ import { ControllerFieldState, Message, ValidationRule } from 'react-hook-form';
6
7
  import * as Popover from '@radix-ui/react-popover';
7
8
 
8
9
  declare const tokens: {
@@ -967,6 +968,23 @@ declare const themedStyleProps: {
967
968
  auto: string;
968
969
  };
969
970
  };
971
+ declare const stylePropShorthands: {
972
+ readonly bg: readonly ["backgroundColor"];
973
+ readonly m: readonly ["margin"];
974
+ readonly mt: readonly ["marginTop"];
975
+ readonly mr: readonly ["marginRight"];
976
+ readonly mb: readonly ["marginBottom"];
977
+ readonly ml: readonly ["marginLeft"];
978
+ readonly mx: readonly ["marginLeft", "marginRight"];
979
+ readonly my: readonly ["marginTop", "marginBottom"];
980
+ readonly p: readonly ["padding"];
981
+ readonly pt: readonly ["paddingTop"];
982
+ readonly pr: readonly ["paddingRight"];
983
+ readonly pb: readonly ["paddingBottom"];
984
+ readonly pl: readonly ["paddingLeft"];
985
+ readonly px: readonly ["paddingLeft", "paddingRight"];
986
+ readonly py: readonly ["paddingTop", "paddingBottom"];
987
+ };
970
988
  type ThemedStyleProps = {
971
989
  [K in keyof typeof themedStyleProps]: keyof (typeof themedStyleProps)[K];
972
990
  };
@@ -974,7 +992,10 @@ type FilteredCSSProps = Omit<{
974
992
  [key in keyof CSSProperties]: CSSProperties[key];
975
993
  }, `-${string}` | `Moz${string}` | `ms${string}` | `Webkit${string}` | `Khtml${string}` | `O${string}`>;
976
994
  type ThemedStyleProp<K extends keyof ThemedStyleProps> = ThemedStyleProps[K] | (string & {});
977
- interface StyleProps extends FilteredCSSProps {
995
+ type StylePropShorthands = {
996
+ [K in keyof typeof stylePropShorthands]?: ThemedStyleProp<(typeof stylePropShorthands)[K][0]>;
997
+ };
998
+ interface StyleProps extends FilteredCSSProps, StylePropShorthands {
978
999
  backgroundColor?: ThemedStyleProp<'backgroundColor'>;
979
1000
  border?: ThemedStyleProp<'border'>;
980
1001
  borderColor?: ThemedStyleProp<'borderColor'>;
@@ -1024,64 +1045,129 @@ interface MediaProps extends BoxProps {
1024
1045
  type?: 'image' | 'video';
1025
1046
  }
1026
1047
 
1027
- type TextVariant = 'Display1' | 'Display2' | 'H1' | 'H2' | 'H3' | 'H4' | 'Body1' | 'Body2' | 'Caption';
1028
1048
  interface TextProps extends BoxProps {
1029
- variant?: TextVariant;
1030
1049
  }
1031
- declare function BaseText({ as, children, variant, ...props }: TextProps): _emotion_react_jsx_runtime.JSX.Element;
1032
- declare const Text: typeof BaseText & {
1033
- [k: string]: {
1034
- (props: TextProps): _emotion_react_jsx_runtime.JSX.Element;
1035
- displayName: string;
1036
- };
1037
- };
1050
+ declare const Display1: React$1.ForwardRefExoticComponent<BoxProps<React$1.ElementType<any>>>;
1051
+ declare const Display2: React$1.ForwardRefExoticComponent<BoxProps<React$1.ElementType<any>>>;
1052
+ declare const H1: React$1.ForwardRefExoticComponent<BoxProps<React$1.ElementType<any>>>;
1053
+ declare const H2: React$1.ForwardRefExoticComponent<BoxProps<React$1.ElementType<any>>>;
1054
+ declare const H3: React$1.ForwardRefExoticComponent<BoxProps<React$1.ElementType<any>>>;
1055
+ declare const H4: React$1.ForwardRefExoticComponent<BoxProps<React$1.ElementType<any>>>;
1056
+ declare const Body1: React$1.ForwardRefExoticComponent<BoxProps<React$1.ElementType<any>>>;
1057
+ declare const Body2: React$1.ForwardRefExoticComponent<BoxProps<React$1.ElementType<any>>>;
1058
+ declare const Caption: React$1.ForwardRefExoticComponent<BoxProps<React$1.ElementType<any>>>;
1059
+
1060
+ declare const Text_Body1: typeof Body1;
1061
+ declare const Text_Body2: typeof Body2;
1062
+ declare const Text_Caption: typeof Caption;
1063
+ declare const Text_Display1: typeof Display1;
1064
+ declare const Text_Display2: typeof Display2;
1065
+ declare const Text_H1: typeof H1;
1066
+ declare const Text_H2: typeof H2;
1067
+ declare const Text_H3: typeof H3;
1068
+ declare const Text_H4: typeof H4;
1069
+ type Text_TextProps = TextProps;
1070
+ declare namespace Text {
1071
+ export {
1072
+ Text_Body1 as Body1,
1073
+ Text_Body2 as Body2,
1074
+ Text_Caption as Caption,
1075
+ Text_Display1 as Display1,
1076
+ Text_Display2 as Display2,
1077
+ Text_H1 as H1,
1078
+ Text_H2 as H2,
1079
+ Text_H3 as H3,
1080
+ Text_H4 as H4,
1081
+ Text_TextProps as TextProps,
1082
+ };
1083
+ }
1038
1084
 
1039
1085
  interface DialogProps extends BoxProps {
1040
1086
  }
1041
1087
 
1042
- type FlowHandler = (flow: Flow, event?: MouseEvent<unknown>) => Promise<boolean | void> | (boolean | void);
1043
- interface StepHandlers$1 {
1044
- onComplete?: FlowHandler;
1045
- onDismiss?: FlowHandler;
1088
+ type FlowHandlerProp = (flow: Flow, event?: React.MouseEvent<unknown>) => Promise<boolean | void> | (boolean | void);
1089
+ interface FlowHandlerProps {
1090
+ onComplete?: FlowHandlerProp;
1091
+ onDismiss?: FlowHandlerProp;
1046
1092
  }
1047
- declare function useFlowHandlers(flow: Flow, { onComplete, onDismiss }?: StepHandlers$1): {
1048
- handleDismiss: (e: MouseEvent<unknown>) => Promise<boolean>;
1093
+ type DismissHandler = (e: React.MouseEvent<unknown>) => Promise<boolean | void>;
1094
+ declare function useFlowHandlers(flow: Flow, { onComplete, onDismiss }?: FlowHandlerProps): {
1095
+ handleDismiss: DismissHandler;
1049
1096
  };
1050
1097
 
1051
- type StepHandler = (step: FlowStep, event?: MouseEvent<unknown>) => Promise<boolean | void> | (boolean | void);
1052
- interface StepHandlers {
1053
- onPrimary?: StepHandler;
1054
- onSecondary?: StepHandler;
1098
+ type StepHandlerProp = (step: FlowStep, event?: React.MouseEvent<unknown>) => Promise<boolean | void> | (boolean | void);
1099
+ interface StepHandlerProps {
1100
+ onPrimary?: StepHandlerProp;
1101
+ onSecondary?: StepHandlerProp;
1055
1102
  }
1056
- declare function useStepHandlers(step: FlowStep, { onPrimary, onSecondary }?: StepHandlers): {
1057
- handlePrimary: (e: MouseEvent<unknown>) => Promise<boolean>;
1058
- handleSecondary: (e: MouseEvent<unknown>) => Promise<boolean>;
1103
+ type StepHandler = (e: React.MouseEvent<unknown>) => Promise<boolean | void>;
1104
+ declare function useStepHandlers(step: FlowStep, { onPrimary, onSecondary }?: StepHandlerProps): {
1105
+ handlePrimary: StepHandler;
1106
+ handleSecondary: StepHandler;
1059
1107
  };
1060
1108
 
1061
- interface FlowComponentProps {
1109
+ interface FlowComponentProps extends Omit<BoxProps, 'container'> {
1110
+ container?: 'dialog' | 'none';
1062
1111
  dismissible?: boolean;
1063
1112
  flowId: string;
1064
- onComplete?: FlowHandler;
1065
- onDismiss?: FlowHandler;
1066
- onPrimary?: StepHandler;
1067
- onSecondary?: StepHandler;
1068
- variables?: Record<string, any>;
1113
+ onComplete?: FlowHandlerProp;
1114
+ onDismiss?: FlowHandlerProp;
1115
+ onPrimary?: StepHandlerProp;
1116
+ onSecondary?: StepHandlerProp;
1117
+ variables?: Record<string, unknown>;
1069
1118
  }
1070
1119
 
1071
- interface AnncouncementProps extends DialogProps, FlowComponentProps {
1120
+ interface AnnouncementProps extends FlowComponentProps, Omit<DialogProps, 'container'> {
1072
1121
  }
1073
- declare function Announcement({ dismissible, flowId, onComplete, onDismiss, onPrimary, onSecondary, variables, ...props }: AnncouncementProps): _emotion_react_jsx_runtime.JSX.Element;
1122
+ declare function Announcement(props: AnnouncementProps): _emotion_react_jsx_runtime.JSX.Element;
1074
1123
 
1075
- interface BannerProps extends BoxProps, FlowComponentProps {
1124
+ interface BannerProps extends FlowComponentProps {
1076
1125
  }
1077
- declare function Banner({ dismissible, flowId, onComplete, onDismiss, onPrimary, onSecondary, ...props }: BannerProps): _emotion_react_jsx_runtime.JSX.Element;
1126
+ declare function Banner(props: BannerProps): _emotion_react_jsx_runtime.JSX.Element;
1078
1127
 
1079
1128
  declare const Card: React$1.ForwardRefExoticComponent<Omit<BoxProps<React$1.ElementType<any>>, "ref"> & React$1.RefAttributes<unknown>>;
1080
1129
 
1081
- declare const Flex: {
1082
- Column: React$1.ForwardRefExoticComponent<Omit<BoxProps<React$1.ElementType<any>>, "ref"> & React$1.RefAttributes<unknown>>;
1083
- Row: React$1.ForwardRefExoticComponent<Omit<BoxProps<React$1.ElementType<any>>, "ref"> & React$1.RefAttributes<unknown>>;
1084
- };
1130
+ declare const Row: React$1.ForwardRefExoticComponent<Omit<BoxProps<React$1.ElementType<any>>, "ref"> & React$1.RefAttributes<unknown>>;
1131
+ declare const Column: React$1.ForwardRefExoticComponent<Omit<BoxProps<React$1.ElementType<any>>, "ref"> & React$1.RefAttributes<unknown>>;
1132
+
1133
+ declare const Flex_Column: typeof Column;
1134
+ declare const Flex_Row: typeof Row;
1135
+ declare namespace Flex {
1136
+ export {
1137
+ Flex_Column as Column,
1138
+ Flex_Row as Row,
1139
+ };
1140
+ }
1141
+
1142
+ type FieldTypes = Record<string, React.ComponentType<FormFieldProps>>;
1143
+ interface ValidationRules {
1144
+ required?: Message | ValidationRule<boolean>;
1145
+ min?: ValidationRule<number | string>;
1146
+ max?: ValidationRule<number | string>;
1147
+ maxLength?: ValidationRule<number>;
1148
+ minLength?: ValidationRule<number>;
1149
+ pattern?: ValidationRule<RegExp>;
1150
+ }
1151
+ interface FormFieldData extends ValidationRules {
1152
+ id: string;
1153
+ options?: {
1154
+ label: string;
1155
+ value: string;
1156
+ }[];
1157
+ placeholder?: string;
1158
+ label?: string;
1159
+ type: string;
1160
+ }
1161
+ interface FormFieldProps {
1162
+ field: any;
1163
+ fieldData: FormFieldData;
1164
+ formState: any;
1165
+ fieldState: ControllerFieldState;
1166
+ }
1167
+ interface FormProps extends FlowComponentProps {
1168
+ fieldTypes?: FieldTypes;
1169
+ }
1170
+ declare function Form({ fieldTypes, ...props }: FormProps): _emotion_react_jsx_runtime.JSX.Element;
1085
1171
 
1086
1172
  type NavigateHandler = (url: string, target?: string) => void;
1087
1173
  interface ProviderProps {
@@ -1114,7 +1200,7 @@ interface TooltipProps extends MergedRadixPopoverProps {
1114
1200
  spotlight?: boolean;
1115
1201
  style?: React__default.CSSProperties;
1116
1202
  }
1117
- declare function Tooltip({ anchor, children, className, spotlight, modal, style, ...props }: TooltipProps): _emotion_react_jsx_runtime.JSX.Element;
1203
+ declare function Tooltip({ anchor, children, className, spotlight, style, ...props }: TooltipProps): _emotion_react_jsx_runtime.JSX.Element;
1118
1204
  declare namespace Tooltip {
1119
1205
  var Close: (props: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
1120
1206
  var Media: ({ src, ...props }: MediaProps) => _emotion_react_jsx_runtime.JSX.Element;
@@ -1136,7 +1222,7 @@ declare function useBoundingClientRect(): {
1136
1222
  };
1137
1223
 
1138
1224
  interface FlowConfig {
1139
- variables?: Record<string, any>;
1225
+ variables?: Record<string, unknown>;
1140
1226
  }
1141
1227
  declare function useFlow(flowId: string, config?: FlowConfig): {
1142
1228
  flow: Flow;
@@ -1150,4 +1236,4 @@ declare function useFrigade(): {
1150
1236
  frigade: _frigade_js.Frigade;
1151
1237
  };
1152
1238
 
1153
- export { Announcement, Banner, Box, BoxProps, Button, ButtonProps, Card, Flex, FlowConfig, Provider, ProviderProps, Text, TextProps, Tooltip, TooltipProps, Tour, TourProps, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useModal, useStepHandlers };
1239
+ export { Announcement, AnnouncementProps, Banner, Box, BoxProps, Button, ButtonProps, Card, Flex, FlowConfig, Form, Provider, ProviderProps, Text, TextProps, Tooltip, TooltipProps, Tour, TourProps, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useModal, useStepHandlers };
package/dist/index.js CHANGED
@@ -1,18 +1,22 @@
1
1
  'use client';
2
- import * as h from '@radix-ui/react-dialog';
2
+ import * as C from '@radix-ui/react-dialog';
3
3
  import { XMarkIcon } from '@heroicons/react/24/solid';
4
- import * as U from 'react';
4
+ import * as le from 'react';
5
5
  import { createContext, useState, useRef, useEffect, useContext, useCallback, useLayoutEffect } from 'react';
6
6
  import { clsx } from 'clsx';
7
- import Ye from 'known-css-properties';
8
- import st from 'dompurify';
9
- import { jsx, jsxs } from '@emotion/react/jsx-runtime';
7
+ import So from 'known-css-properties';
8
+ import Do from 'dompurify';
9
+ import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
10
10
  import { keyframes, Global, ThemeProvider } from '@emotion/react';
11
11
  import { Frigade } from '@frigade/js';
12
- import * as C from '@radix-ui/react-popover';
12
+ import { useForm, useController } from 'react-hook-form';
13
+ import * as $ from '@radix-ui/react-radio-group';
14
+ import * as g from '@radix-ui/react-select';
15
+ import { ChevronDownIcon } from '@heroicons/react/24/outline';
16
+ import * as v from '@radix-ui/react-popover';
13
17
 
14
- var Ue=Object.defineProperty;var Je=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var ee=(e,t)=>{for(var o in t)Ue(e,o,{get:t[o],enumerable:!0});};var te={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var oe={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 re={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,ne={neutral:{background:p("white"),border:p("gray500"),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 ie={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Xe="px",Ge=e=>typeof e=="number"?`${4*e}${Xe}`:e,qe=[-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"],se=Object.fromEntries(qe.map(e=>[e,Ge(e)]));var ae={fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var _={...te,colors:{...oe,...ne},...ae,radii:re,shadows:ie,space:se};function A(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let s=`${t.length?`${t}${o}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,A(l,s,o)):r[s]=l,r},{})}function z(e){return A(e,"--fr","-")}function le(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=le(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var pe=z(_),c=le(_);var Qe=new Set(["alt","size","src"]),Ze=Ye.all.filter(e=>e.indexOf("-")!=0&&!Qe.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),et=Object.fromEntries(Ze),K=A(c.colors),tt={color:K,backgroundColor:K,borderColor:K,border:c.borders,borderRadius:c.radii,borderWidth:c.borderWidths,boxShadow:c.shadows,fontFamily:c.fontFamilies,fontSize:c.fontSizes,fontWeight:c.fontWeights,gap:c.space,lineHeight:c.lineHeights,margin:c.space,marginBottom:c.space,marginLeft:c.space,marginRight:c.space,marginTop:c.space,padding:c.space,paddingBottom:c.space,paddingLeft:c.space,paddingRight:c.space,paddingTop:c.space},de={...et,...tt},ce={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","focus","focusVisible","focusWithin","hover"]);function ot(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):["string","number"].includes(typeof e)?new Map([e,e]):new Map}var fe=new Map(Object.entries(de).map(([e,t])=>[e,ot(t)])),rt=new Map(Object.entries(ce).map(([e,t])=>[e,new Set(t)])),nt=new Set(["height","width"]),it=new Set(["canvas","embed","iframe","img","input","object","video"]);function me(e){let[t,o]=e.split(":");return [t,ue.has(o)?o:null]}function ge(e,t="div"){let o=Object.assign({},e),r={};function n(i){if(i==null)return r;let l=`&:${i.replace(/[A-Z]/g,a=>`-${a.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(o).forEach(([i,s])=>{let[l,a]=me(i),d=rt.get(l);d!=null&&(d.forEach(f=>{let m=`${f}${a?":"+a:""}`;o[m]=s;}),delete o[i]);}),Object.entries(o).forEach(([i,s])=>{let[l,a]=me(i),d=fe.get(l);if(d!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(a)[l]=f.map(m=>d.get(m.toString())??m).join(" ");}else d.has(s.toString())?n(a)[l]=d.get(s.toString()):n(a)[l]=s;(typeof t!="string"||!it.has(t)||!nt.has(l))&&delete o[i];}}),Object.keys(o).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&fe.has(s)&&(o[s]=o[i],delete o[i]);}),{cssFromProps:r,unmatchedProps:o}}function at(){if(typeof window>"u"){let{JSDOM:e}=Je("jsdom");return new e("<!DOCTYPE html>").window}return window}function xe(e){return e?{__html:st(at()).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 pt(e){return e&&`fr-${e}`}function Pe(e){return e&&(Array.isArray(e)?e.map(t=>Pe(t)).join(" "):pt(e))}function dt({as:e,children:t,className:o,css:r={},part:n,...i},s){let l=e??"div",{cssFromProps:a,unmatchedProps:d}=ge(i,l),f=Pe(n),m=o||f?clsx(o,f):void 0,R=[{boxSizing:"border-box"},a,r];return typeof t=="string"?jsx(l,{className:m,css:R,...d,ref:s,dangerouslySetInnerHTML:xe(t)}):jsx(l,{className:m,css:R,...d,ref:s,children:t})}var u=U.forwardRef(dt);var j={};ee(j,{Body1:()=>yt,Body2:()=>ht,Caption:()=>Pt,Display1:()=>ct,Display2:()=>ut,H1:()=>ft,H2:()=>mt,H3:()=>gt,H4:()=>xt});var w={color:"neutral.foreground",fontFamily:"default",margin:"0"},ct={...w,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},ut={...w,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},ft={...w,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},mt={...w,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},gt={...w,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},xt={...w,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},yt={...w,fontSize:"md",fontWeight:"regular",lineHeight:"md"},ht={...w,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},Pt={...w,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function be({as:e="span",children:t,variant:o="Body1",...r}){return jsx(u,{as:e,...j[o],...r,children:t})}var bt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Tt=Object.fromEntries(bt.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsx(be,{as:t,...r,variant:e,children:r.children});return o.displayName=`Text.${e}`,[e,o]})),b=Object.assign(be,Tt);var N={};ee(N,{Link:()=>wt,Plain:()=>Bt,Primary:()=>St,Secondary:()=>Ct});var W={borderWidth:"0",borderRadius:"md",padding:"2 4"},St={...W,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface"},Ct={...W,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background"},wt={...W,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Bt={...W,backgroundColor:"transparent",color:"neutral.foreground"};function Se({as:e,children:t,part:o,title:r,variant:n="Primary",...i}){let s=n.toLocaleLowerCase();return jsxs(u,{as:e??"button",part:[`button-${s}`,o],...N[n],...i,children:[t,r&&jsx(b.Body2,{fontWeight:"demibold",color:"inherit",children:r})]})}var vt=["Primary","Secondary","Link","Plain"],Rt=Object.fromEntries(vt.map(e=>{let t=o=>jsx(Se,{...o,variant:e,children:o.children});return t.displayName=`Text.${e}`,[e,t]})),T=Object.assign(Se,Rt);var kt=U.forwardRef(({children:e,css:t,...o},r)=>jsx(u,{css:[{display:"flex",flexDirection:"row"},t],...o,ref:r,children:e})),Dt=U.forwardRef(({children:e,css:t,...o},r)=>jsx(u,{css:[{display:"flex",flexDirection:"column"},t],...o,ref:r,children:e})),S={Column:Dt,Row:kt};var F=U.forwardRef(({as:e,children:t,...o},r)=>{let n=e??S.Column;return jsx(n,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...o,ref:r,children:t})});function ve({part:e,src:t,...o}){return jsx(u,{as:"img",part:["image",e],src:t,...o})}function Et(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Re({part:e,src:t,...o}){let r=Et(t);return jsx(u,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:r,...o})}function $({src:e,type:t,...o}){return jsx(t==="video"?Re:ve,{src:e,...o})}function y({children:e,...t}){return jsx(h.Root,{defaultOpen:!0,modal:!0,children:jsx(h.Portal,{children:jsxs(u,{inset:"0",position:"fixed",zIndex:"9999",children:[jsx(h.Overlay,{asChild:!0,children:jsx(u,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsx(h.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsx(F,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog-content",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...t,children:e})})]})})})}y.Close=e=>jsx(h.Close,{"aria-label":"Close",asChild:!0,children:jsx(T.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});y.Subtitle=({children:e,...t})=>jsx(h.Description,{asChild:!0,children:jsx(b.Body2,{mb:5,part:"subtitle",...t,children:e})});y.Media=({src:e,...t})=>e==null?null:jsx($,{borderRadius:"md",src:e,...t});y.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(T.Primary,{title:t,onClick:e,...o});y.ProgressDots=({current:e,total:t})=>{let o=[...Array(t)].map((r,n)=>jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?c.colors.blue500:c.colors.blue800},n));return t==0?null:jsx(u,{as:"svg",height:"8px",margin:"5 auto",part:"progress",viewBox:`0 0 ${16*t-8} 8`,width:16*t-8,children:o})};y.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(T.Secondary,{title:t,onClick:e,...o});y.Title=({children:e,...t})=>jsx(h.Title,{asChild:!0,children:jsx(b.H3,{mb:1,part:"title",...t,children:e})});var B=createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function Nt({children:e,navigate:t,theme:o,...r}){let n=o?z(o):{},[i,s]=useState([]),l=useRef(new Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowConfigOverrides:r.__flowConfigOverrides})),a=t??((d,f="_self")=>{window.open(d,f);});return useEffect(()=>()=>{var d;(d=l.current)==null||d.destroy();},[]),jsxs(B.Provider,{value:{modals:i,setModals:s,navigate:a,...r,frigade:l.current},children:[jsx(Global,{styles:{":root":{...pe,...n}}}),jsx(ThemeProvider,{theme:c,children:e})]})}function k(e,t){let[o,r]=useState(),[n,i]=useState(""),{frigade:s}=useContext(B),l=a=>{a.id===e&&(t!=null&&t.variables&&a.applyVariables(t.variables),r(a),i(Math.random().toString()));};return useEffect(()=>((async()=>{let a=await s.getFlow(e);if(!a||s.hasFailedToLoad()){r(void 0);return}t!=null&&t.variables&&a.applyVariables(t.variables),r(a);})(),s.onStateChange(l),()=>{s.removeStateChangeHandler(l);}),[]),{flow:o}}function v(e,{onComplete:t,onDismiss:o}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&(async()=>await(t==null?void 0:t(e)))(),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function D(e,{onPrimary:t,onSecondary:o}={}){let{navigate:r}=useContext(B);return {handlePrimary:useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function Zt({dismissible:e=!0,flowId:t,onComplete:o,onDismiss:r,onPrimary:n,onSecondary:i,variables:s,...l}){let{flow:a}=k(t,{variables:s}),d=a==null?void 0:a.getCurrentStep(),{handleDismiss:f}=v(a,{onComplete:o,onDismiss:r}),{handlePrimary:m,handleSecondary:R}=D(d,{onPrimary:n,onSecondary:i});return a==null||a.isVisible===!1?null:(a.start(),d==null||d.start(),jsxs(y,{...l,children:[e&&jsx(y.Close,{onClick:f}),jsx(y.Title,{children:d.title}),jsx(y.Subtitle,{children:d.subtitle}),jsx(y.Media,{src:d.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(y.ProgressDots,{current:a.getNumberOfCompletedSteps(),total:a.getNumberOfAvailableSteps()}),jsxs(S.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsx(y.Secondary,{title:"Secondary",onClick:R}),jsx(y.Primary,{title:"Primary",onClick:m})]})]}))}function to({dismissible:e=!0,flowId:t,onComplete:o,onDismiss:r,onPrimary:n,onSecondary:i,...s}){let{flow:l}=k(t),a=l==null?void 0:l.getCurrentStep(),{handleDismiss:d}=v(l,{onComplete:o,onDismiss:r}),{handlePrimary:f,handleSecondary:m}=D(a,{onPrimary:n,onSecondary:i});return l==null||l.isVisible===!1?null:(l.start(),a==null||a.start(),jsxs(F,{as:S.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...s,children:[jsxs(S.Row,{gap:3,children:[a.imageUri&&jsx("img",{src:a.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(S.Column,{children:[jsx(b.H4,{mb:1,children:a.title}),jsx(b.Body2,{children:a.subtitle})]})]}),jsxs(S.Row,{alignItems:"center",gap:3,children:[a.secondaryButtonTitle&&jsx(T.Secondary,{title:a.secondaryButtonTitle,onClick:m}),jsx(T.Primary,{title:a.primaryButtonTitle,onClick:f}),e&&jsx(T.Plain,{part:"banner-close",onClick:d,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function L(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=useState(e),[r,n]=useState(null),i=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!r)return;let s=()=>{let l=r.getBoundingClientRect();o(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:t,ref:i}}var io=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Me({style:e={},part:t="",...o}){return jsxs(u,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsx(u,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${io}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(u,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Ae({props:e,alignAttr:t,sideAttr:o}){let r=o??"bottom",n={},i=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=s;let a=i();return ["before","end"].includes(a)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(a)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var $e={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function We(e,t){let o=Object.fromEntries($e.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r=Object.fromEntries($e.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let n={after:"end",before:"start"},i=(m,R)=>["top","bottom"].includes(R)?m=="after"?"marginLeft":"marginRight":m=="after"?"marginTop":"marginBottom",s=o.alignOffset??0,l=o.style??{},a=o.side??"bottom",d=o.align;o.style={...l,[i(d,a)]:s};let f=["top","bottom"].includes(a)?t.width:t.height;o.alignOffset=(f+s)*-1,o.align=n[d];}return {contentProps:o,rootProps:r}}function x({anchor:e,children:t,className:o,spotlight:r=!1,modal:n=!!r,style:i,...s}){let{node:l,rect:a,ref:d}=L(),{node:f,rect:m,ref:R}=L(),{contentProps:I,rootProps:ze}=We(s,a),[G,Ke]=useState(I.align),[q,je]=useState(I.side);if(l!==null){let M=l.getAttribute("data-align"),Z=l.getAttribute("data-side");G!==M&&Ke(M),q!==Z&&je(Z);}let Y=useRef(null);if(useEffect(()=>{let M=document.querySelector(e);M!=null&&(R(M),Y.current=M);},[e]),f==null)return null;let Q="0";typeof window<"u"&&(Q=window.getComputedStyle(f).borderRadius);let Ne=Ae({props:s,alignAttr:G,sideAttr:q});return jsxs(C.Root,{defaultOpen:!0,...ze,children:[jsx(C.Anchor,{virtualRef:Y}),jsx(C.Portal,{children:jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[r&&jsx(u,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:Q,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:m.height,left:f.offsetLeft,top:f.offsetTop,width:m.width}}),jsx(C.Content,{asChild:!0,...I,ref:d,children:jsxs(F,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...i},children:[jsx(Me,{style:Ne}),t]})})]})})]})}x.Close=e=>jsx(C.Close,{"aria-label":"Close",asChild:!0,children:jsx(T.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});x.Media=({src:e,...t})=>e==null?null:jsx($,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});x.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(T.Primary,{title:t,onClick:e,...o});x.Progress=({children:e,...t})=>e==null?null:jsx(b.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});x.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(T.Secondary,{title:t,onClick:e,...o});x.Subtitle=({children:e,...t})=>e==null?null:jsx(b.Body2,{part:"subtitle",...t,children:e});x.Title=({children:e,...t})=>e==null?null:jsx(b.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function X(e){let{modals:t,setModals:o}=useContext(B),[r,n]=useState(!1);return useEffect(()=>(o([...t,e]),()=>o(t.filter(i=>i!==e))),[]),useEffect(()=>{let i=t[0]===e;i!==r&&n(i);},[t]),{isCurrentModal:r}}function _e({dismissible:e=!0,flow:t,onDismiss:o,onPrimary:r,onSecondary:n,step:i,...s}){let{isCurrentModal:l}=X(`${t.id}-${i.id}`),{handleDismiss:a}=v(t,{onDismiss:o}),{handlePrimary:d,handleSecondary:f}=D(i,{onPrimary:r,onSecondary:n});return l?jsxs(x,{anchor:i.selector,onOpenAutoFocus:m=>m.preventDefault(),onPointerDownOutside:m=>m.preventDefault(),...s,children:[e&&jsx(x.Close,{onClick:a}),jsx(x.Media,{src:i.videoUri??i.imageUri,type:i.videoUri?"video":"image"}),jsx(x.Title,{children:i.title}),jsx(x.Subtitle,{children:i.subtitle}),jsxs(S.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsx(x.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsx(x.Secondary,{marginLeft:"auto",title:i.secondaryButtonTitle,onClick:f}),jsx(x.Primary,{title:i.primaryButtonTitle,onClick:d})]})]},i.id):null}function fo({flowId:e,onComplete:t,variables:o,...r}){let{flow:n}=k(e,{variables:o});if(v(n,{onComplete:t}),n==null||n.isVisible===!1)return null;n.start();let i=n.getCurrentStep();return i==null||i.start(),jsx(_e,{step:i,flow:n,...r})}function xo(){let{frigade:e}=useContext(B);return {frigade:e}}
18
+ var xo=Object.defineProperty;var yo=(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 X=(e,o)=>{for(var t in o)xo(e,t,{get:o[t],enumerable:!0});};var me={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var ue={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 fe={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,ge={neutral:{background:l("white"),border:l("gray800"),foreground:l("black"),surface:l("gray700"),active:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},focus:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},hover:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")}},primary:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500"),active:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")},focus:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500")},hover:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")}},secondary:{background:l("white"),border:l("gray800"),foreground:l("black"),surface:l("gray900"),active:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")},focus:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray900")},hover:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")}}};var xe={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var ho="px",bo=e=>typeof e=="number"?`${4*e}${ho}`:e,Po=[-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"],ye=Object.fromEntries(Po.map(e=>[e,bo(e)]));var he={fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var re={...me,colors:{...ue,...ge},...he,radii:fe,shadows:xe,space:ye};function K(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let a=`${o.length?`${o}${t}`:""}${r}`,s=e[r];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(n,K(s,a,t)):n[a]=s,n},{})}function ne(e){return K(e,"--fr","-")}function be(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=be(r,`${o}-${n}`):t[n]=`var(${o}-${n})`;}),t}var Pe=ne(re),u=be(re);var Co=new Set(["alt","size","src"]),Fo=So.all.filter(e=>e.indexOf("-")!=0&&!Co.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),To=Object.fromEntries(Fo),ie=K(u.colors),wo={color:ie,backgroundColor:ie,borderColor:ie,border:u.borders,borderRadius:u.radii,borderWidth:u.borderWidths,boxShadow:u.shadows,fontFamily:u.fontFamilies,fontSize:u.fontSizes,fontWeight:u.fontWeights,gap:u.space,lineHeight:u.lineHeights,margin:u.space,marginBottom:u.space,marginLeft:u.space,marginRight:u.space,marginTop:u.space,padding:u.space,paddingBottom:u.space,paddingLeft:u.space,paddingRight:u.space,paddingTop:u.space},Se={...To,...wo},Ce={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},Fe=new Set(["active","focus","focusVisible","focusWithin","hover"]);function Ro(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 Te=new Map(Object.entries(Se).map(([e,o])=>[e,Ro(o)])),Bo=new Map(Object.entries(Ce).map(([e,o])=>[e,new Set(o)])),vo=new Set(["height","width"]),ko=new Set(["canvas","embed","iframe","img","input","object","video"]);function we(e){let[o,t]=e.split(":");return [o,Fe.has(t)?t:null]}function Re(e,o="div"){let t=Object.assign({},e),n={};function r(i){if(i==null)return n;let s=`&:${i.replace(/[A-Z]/g,m=>`-${m.toLocaleLowerCase()}`)}`;return n[s]==null&&(n[s]={}),n[s]}return Object.entries(t).forEach(([i,a])=>{let[s,m]=we(i),c=Bo.get(s);c!=null&&(c.forEach(P=>{let x=`${P}${m?":"+m:""}`;t[x]=a;}),delete t[i]);}),Object.entries(t).forEach(([i,a])=>{let[s,m]=we(i),c=Te.get(s);if(c!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let P=a.split(" ");r(m)[s]=P.map(x=>c.get(x.toString())??x).join(" ");}else c.has(a.toString())?r(m)[s]=c.get(a.toString()):r(m)[s]=a;(typeof o!="string"||!ko.has(o)||!vo.has(s))&&delete t[i];}}),Object.keys(t).forEach(i=>{let a=i.substring(1);i.indexOf("_")===0&&Te.has(a)&&(t[a]=t[i],delete t[i]);}),{cssFromProps:n,unmatchedProps:t}}function Oo(){if(typeof window>"u"){let{JSDOM:e}=yo("jsdom");return new e("<!DOCTYPE html>").window}return window}function Be(e){return e?{__html:Do(Oo()).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 Ho(e){return e&&`fr-${e}`}function De(e){return e&&(Array.isArray(e)?e.map(o=>De(o)).join(" "):Ho(e))}function Mo({as:e,children:o,className:t,css:n={},part:r,...i},a){let s=e??"div",{cssFromProps:m,unmatchedProps:c}=Re(i,s),P=De(r),x=t||P?clsx(t,P):void 0,B=[{boxSizing:"border-box"},m,n];return typeof o=="string"?jsx(s,{className:x,css:B,...c,ref:a,dangerouslySetInnerHTML:Be(o)}):jsx(s,{className:x,css:B,...c,ref:a,children:o})}var p=le.forwardRef(Mo);var d={};X(d,{Body1:()=>Yo,Body2:()=>Qo,Caption:()=>Zo,Display1:()=>jo,Display2:()=>Uo,H1:()=>Go,H2:()=>qo,H3:()=>Jo,H4:()=>Xo});var ae={};X(ae,{Body1:()=>zo,Body2:()=>_o,Caption:()=>Ko,Display1:()=>Ao,Display2:()=>Io,H1:()=>Lo,H2:()=>Vo,H3:()=>Wo,H4:()=>$o});var k={color:"neutral.foreground",fontFamily:"default",margin:"0"},Ao={...k,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},Io={...k,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},Lo={...k,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},Vo={...k,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},Wo={...k,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},$o={...k,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},zo={...k,fontSize:"md",fontWeight:"regular",lineHeight:"md"},_o={...k,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},Ko={...k,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};var No=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],D=Object.fromEntries(No.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=le.forwardRef(({as:n=o,children:r,...i},a)=>jsx(p,{as:n,...ae[e],...i,ref:a,children:r}));return t.displayName=`Text.${e}`,[e,t]})),jo=D.Display1,Uo=D.Display2,Go=D.H1,qo=D.H2,Jo=D.H3,Xo=D.H4,Yo=D.Body1,Qo=D.Body2,Zo=D.Caption;var se={};X(se,{Link:()=>rt,Plain:()=>nt,Primary:()=>ot,Secondary:()=>tt});var Y={borderWidth:"0",borderRadius:"md",padding:"2 4"},ot={...Y,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface"},tt={...Y,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background"},rt={...Y,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},nt={...Y,backgroundColor:"transparent",color:"neutral.foreground"};function Ee({as:e,children:o,part:t,title:n,variant:r="Primary",...i}){let a=r.toLocaleLowerCase();return jsxs(p,{as:e??"button",part:[`button-${a}`,t],...se[r],...i,children:[o,n&&jsx(d.Body2,{fontWeight:"demibold",color:"inherit",children:n})]})}var it=["Primary","Secondary","Link","Plain"],at=Object.fromEntries(it.map(e=>{let o=t=>jsx(Ee,{...t,variant:e,children:t.children});return o.displayName=`Text.${e}`,[e,o]})),S=Object.assign(Ee,at);var y={};X(y,{Column:()=>pt,Row:()=>lt});var lt=le.forwardRef(({children:e,css:o,...t},n)=>jsx(p,{css:[{display:"flex",flexDirection:"row"},o],...t,ref:n,children:e})),pt=le.forwardRef(({children:e,css:o,...t},n)=>jsx(p,{css:[{display:"flex",flexDirection:"column"},o],...t,ref:n,children:e}));var M=le.forwardRef(({as:e,children:o,...t},n)=>{let r=e??y.Column;return jsx(r,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...t,ref:n,children:o})});function Ie({part:e,src:o,...t}){return jsx(p,{as:"img",part:["image",e],src:o,...t})}function mt(e){var o,t,n;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Le({part:e,src:o,...t}){let n=mt(o);return jsx(p,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:n,...t})}function N({src:e,type:o,...t}){return jsx(o==="video"?Le:Ie,{src:e,...t})}function h({children:e,...o}){return jsx(C.Root,{defaultOpen:!0,modal:!0,children:jsx(C.Portal,{children:jsxs(p,{inset:"0",position:"fixed",zIndex:"9999",children:[jsx(C.Overlay,{asChild:!0,children:jsx(p,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsx(C.Content,{asChild:!0,onOpenAutoFocus:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),children:jsx(M,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog-content",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}h.Close=e=>jsx(C.Close,{"aria-label":"Close",asChild:!0,children:jsx(S.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});h.Subtitle=({children:e,...o})=>jsx(C.Description,{asChild:!0,children:jsx(d.Body2,{mb:5,part:"subtitle",...o,children:e})});h.Media=({src:e,...o})=>e==null?null:jsx(N,{borderRadius:"md",src:e,...o});h.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(S.Primary,{title:o,onClick:e,...t});h.ProgressDots=({current:e,total:o})=>{let t=[...Array(o)].map((n,r)=>jsx("circle",{r:4,cx:4+16*r,cy:"4px",fill:e===r?u.colors.blue500:u.colors.blue800},r));return o==0?null:jsx(p,{as:"svg",height:"8px",margin:"5 auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};h.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(S.Secondary,{title:o,onClick:e,...t});h.Title=({children:e,...o})=>jsx(C.Title,{asChild:!0,children:jsx(d.H3,{mb:1,part:"title",...o,children:e})});var O=createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function Tt({children:e,navigate:o,theme:t,...n}){let r=t?ne(t):{},[i,a]=useState([]),s=useRef(new Frigade(n.apiKey,{apiKey:n.apiKey,apiUrl:n.apiUrl,userId:n.userId,groupId:n.groupId,__readOnly:n.__readOnly,__flowConfigOverrides:n.__flowConfigOverrides})),m=o??((c,P="_self")=>{window.open(c,P);});return useEffect(()=>()=>{var c;(c=s.current)==null||c.destroy();},[]),jsxs(O.Provider,{value:{modals:i,setModals:a,navigate:m,...n,frigade:s.current},children:[jsx(Global,{styles:{":root":{...Pe,...r}}}),jsx(ThemeProvider,{theme:u,children:e})]})}function j(e,o){let[t,n]=useState(),[,r]=useState(""),{frigade:i}=useContext(O),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),n(s),r(Math.random().toString()));};return useEffect(()=>((async()=>{let s=await i.getFlow(e);if(!s||i.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),n(s);})(),i.onStateChange(a),()=>{i.removeStateChangeHandler(a);}),[]),{flow:t}}function A(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&(async()=>await(o==null?void 0:o(e)))(),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.skip();},[e])}}function U(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(O);return {handlePrimary:useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function W({container:e,dismissible:o=!0,flowId:t,onComplete:n,onDismiss:r,onPrimary:i,onSecondary:a,variables:s,...m}){let c=e==="dialog"?h:p;return {FlowComponent:function({children:B,...oe}){let{flow:w}=j(t,{variables:s}),z=w==null?void 0:w.getCurrentStep(),{handleDismiss:_}=A(w,{onComplete:n,onDismiss:r}),{handlePrimary:te,handleSecondary:q}=U(z,{onPrimary:i,onSecondary:a});if(w==null||w.isVisible===!1)return null;let J=o&&e==="dialog"?jsx(h.Close,{onClick:_}):null;return w.start(),z.start(),jsxs(c,{...oe,...m,children:[J,B({flow:w,handleDismiss:_,handlePrimary:te,handleSecondary:q,step:z})]})}}}function Mt(e){let{FlowComponent:o}=W({...e,container:"dialog"});return jsx(o,{children:({flow:t,handlePrimary:n,handleSecondary:r,step:i})=>jsxs(Fragment,{children:[jsx(h.Title,{children:i.title}),jsx(h.Subtitle,{children:i.subtitle}),jsx(h.Media,{src:i.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(h.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxs(y.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[i.secondaryButtonTitle&&jsx(h.Secondary,{title:i.secondaryButtonTitle,onClick:r}),jsx(h.Primary,{title:i.primaryButtonTitle??"Continue",onClick:n})]})]})})}function Lt(e){let{FlowComponent:o}=W(e);return jsx(o,{as:M,border:"md",borderColor:"gray900",display:"flex",flexDirection:"row",justifyContent:"space-between",children:({handleDismiss:t,handlePrimary:n,handleSecondary:r,step:i})=>jsxs(Fragment,{children:[jsxs(y.Row,{gap:3,children:[i.imageUri&&jsx("img",{src:i.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(y.Column,{children:[jsx(d.H4,{mb:1,children:i.title}),jsx(d.Body2,{children:i.subtitle})]})]}),jsxs(y.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[i.secondaryButtonTitle&&jsx(S.Secondary,{title:i.secondaryButtonTitle,onClick:r}),jsx(S.Primary,{title:i.primaryButtonTitle,onClick:n}),e.dismissible&&e.container!="dialog"&&jsx(S.Plain,{part:"banner-close",onClick:t,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})]})]})})}var zt=new Set(["required","min","max","minLength","maxLength","pattern"]);function _t({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 n=Object.fromEntries(Object.entries(t).filter(([i])=>zt.has(i))),r=useController({name:t.id,control:o,rules:n});return jsx(e,{...r,fieldData:t})}function _e({fieldTypes:e,step:o}){var a;let{control:t,handleSubmit:n}=useForm({delayError:2e3,mode:"onChange"}),r=[];function i(s){o.complete(s);}return (a=o.fields)==null||a.forEach(s=>{e[s.type]!=null&&r.push(jsx(_t,{control:t,fieldComponent:e[s.type],fieldData:s},s.id));}),jsxs(Fragment,{children:[r,jsx(y.Row,{justifyContent:"flex-end",children:jsx(S.Primary,{title:o.primaryButtonTitle??"Submit",onClick:n(i)})},"form-footer")]})}function Ke({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(d.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Ne({children:e,id:o,required:t=!1}){return jsxs(d.Body2,{as:"label",htmlFor:o,fontWeight:"demibold",part:"field-label",children:[e,t&&" *"]})}var je={marginBottom:"5"},G={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function H({children:e,field:o,fieldData:t,fieldState:n}){let{id:r,label:i,placeholder:a}=t,{error:s}=n,m={id:r,...o,...a?{placeholder:a}:{},...G,"aria-invalid":!!s,value:o.value??""};return jsxs(p,{...je,part:"field",children:[jsx(Ne,{id:r,required:!!t.required,children:i}),e(m),jsx(Ke,{error:s})]})}var qt=()=>jsx(p,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Jt=le.forwardRef(({label:e,value:o},t)=>jsxs(p,{as:"label",htmlFor:o,display:"flex",justifyContent:"space-between",part:"field-radio",px:4,py:2,borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"md",children:[jsx(d.Body2,{part:"field-radio-label",children:e}),jsx($.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(p,{as:"button",backgroundColor:"neutral.background",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(p,{as:$.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:jsx(qt,{})})})})]}));function Je(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:i,value:a})=>jsx(Jt,{value:a,label:i},a));return jsx(H,{...e,children:()=>jsx($.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(y.Column,{gap:2,part:"field-radio-group",children:r})})})}var Qt=le.forwardRef(({label:e,value:o},t)=>jsx(g.Item,{value:o,ref:t,asChild:!0,children:jsx(p,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(g.ItemText,{asChild:!0,children:jsx(d.Body2,{part:"field-select-option-label",children:e})})})}));function Qe(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,i=n.map(({label:a,value:s})=>jsx(Qt,{value:s,label:a},s));return jsx(H,{...e,children:()=>jsxs(g.Root,{value:t,onValueChange:o,children:[jsx(g.Trigger,{asChild:!0,children:jsxs(d.Body2,{...G,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(g.Value,{placeholder:r??"Select one"}),jsx(g.Icon,{children:jsx(p,{as:ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsx(g.Portal,{children:jsx(g.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(p,{...G,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsx(g.Viewport,{children:i})})})})]})})}function eo(e){return jsx(H,{...e,children:o=>jsx(d.Body2,{as:"input",part:"field-text",type:"text",...o})})}function to(e){return jsx(H,{...e,children:o=>jsx(d.Body2,{as:"textarea",part:"field-textarea",...o})})}var Zt={radio:Je,select:Qe,text:eo,textarea:to};function er({fieldTypes:e={},...o}){let{FlowComponent:t}=W(o),n=Object.assign({},Zt,e);return jsx(t,{children:({step:r})=>jsx(_e,{fieldTypes:n,step:r,...o})})}function ee(){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]=useState(e),[n,r]=useState(null),i=useCallback(a=>{r(a);},[]);return useLayoutEffect(()=>{if(!n)return;let a=()=>{let s=n.getBoundingClientRect();t(s);};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[n]),{node:n,rect:o,ref:i}}var nr=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function ao({style:e={},part:o="",...t}){return jsxs(p,{part:`dot-wrapper ${o}`,style:{height:"48px",position:"absolute",width:"48px",...e},...t,children:[jsx(p,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${nr}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(p,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function so({props:e,alignAttr:o,sideAttr:t}){let n=t??"bottom",r={},i=()=>{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[n]]=a;let m=i();return ["before","end"].includes(m)?["top","bottom"].includes(n)?r.right=a:r.bottom=a:["after","start"].includes(m)?["top","bottom"].includes(n)?r.left=a:r.top=a:["top","bottom"].includes(n)?r.left=`calc(50% + ${a})`:r.top=`calc(50% + ${a})`,r}var lo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function po(e,o){let t=Object.fromEntries(lo.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n=Object.fromEntries(lo.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0));if(t.align=t.align??"after",t.side=t.side??"bottom",["before","after"].includes(t.align)){let r={after:"end",before:"start"},i=(x,B)=>["top","bottom"].includes(B)?x=="after"?"marginLeft":"marginRight":x=="after"?"marginTop":"marginBottom",a=t.alignOffset??0,s=t.style??{},m=t.side??"bottom",c=t.align;t.style={...s,[i(c,m)]:a};let P=["top","bottom"].includes(m)?o.width:o.height;t.alignOffset=(P+a)*-1,t.align=r[c];}return {contentProps:t,rootProps:n}}function b({anchor:e,children:o,className:t,spotlight:n=!1,style:r,...i}){let{node:a,rect:s,ref:m}=ee(),{node:c,rect:P,ref:x}=ee(),{contentProps:B,rootProps:oe}=po(i,s),[w,z]=useState(B.align),[_,te]=useState(B.side);if(a!==null){let V=a.getAttribute("data-align"),ce=a.getAttribute("data-side");w!==V&&z(V),_!==ce&&te(ce);}let q=useRef(null);if(useEffect(()=>{let V=document.querySelector(e);V!=null&&(x(V),q.current=V);},[e]),c==null)return null;let J="0";typeof window<"u"&&(J=window.getComputedStyle(c).borderRadius);let go=so({props:i,alignAttr:w,sideAttr:_});return jsxs(v.Root,{defaultOpen:!0,...oe,children:[jsx(v.Anchor,{virtualRef:q}),jsx(v.Portal,{children:jsxs("div",{className:t,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[n&&jsx(p,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:J,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:P.height,left:c.offsetLeft,top:c.offsetTop,width:P.width}}),jsx(v.Content,{asChild:!0,...B,ref:m,children:jsxs(M,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...r},children:[jsx(ao,{style:go}),o]})})]})})]})}b.Close=e=>jsx(v.Close,{"aria-label":"Close",asChild:!0,children:jsx(S.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});b.Media=({src:e,...o})=>e==null?null:jsx(N,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...o});b.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(S.Primary,{title:o,onClick:e,...t});b.Progress=({children:e,...o})=>e==null?null:jsx(d.Body2,{fontWeight:"demibold",part:"progress",...o,children:e});b.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(S.Secondary,{title:o,onClick:e,...t});b.Subtitle=({children:e,...o})=>e==null?null:jsx(d.Body2,{part:"subtitle",...o,children:e});b.Title=({children:e,...o})=>e==null?null:jsx(d.Body1,{fontWeight:"bold",mb:1,part:"title",...o,children:e});function de(e){let{modals:o,setModals:t}=useContext(O),[n,r]=useState(!1);return useEffect(()=>(t([...o,e]),()=>t(o.filter(i=>i!==e))),[]),useEffect(()=>{let i=o[0]===e;i!==n&&r(i);},[o]),{isCurrentModal:n}}function fo({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:n,onSecondary:r,step:i,...a}){let{isCurrentModal:s}=de(`${o.id}-${i.id}`),{handleDismiss:m}=A(o,{onDismiss:t}),{handlePrimary:c,handleSecondary:P}=U(i,{onPrimary:n,onSecondary:r});return s?jsxs(b,{anchor:i.selector,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),...a,children:[e&&jsx(b.Close,{onClick:m}),jsx(b.Media,{src:i.videoUri??i.imageUri,type:i.videoUri?"video":"image"}),jsx(b.Title,{children:i.title}),jsx(b.Subtitle,{children:i.subtitle}),jsxs(y.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsx(b.Progress,{children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsx(b.Secondary,{marginLeft:"auto",title:i.secondaryButtonTitle,onClick:P}),jsx(b.Primary,{title:i.primaryButtonTitle,onClick:c})]})]},i.id):null}function cr({flowId:e,onComplete:o,variables:t,...n}){let{flow:r}=j(e,{variables:t});if(A(r,{onComplete:o}),r==null||r.isVisible===!1)return null;r.start();let i=r.getCurrentStep();return i==null||i.start(),jsx(fo,{step:i,flow:r,...n})}function fr(){let{frigade:e}=useContext(O);return {frigade:e}}
15
19
 
16
- export { Zt as Announcement, to as Banner, u as Box, T as Button, F as Card, S as Flex, Nt as Provider, b as Text, x as Tooltip, fo as Tour, L as useBoundingClientRect, k as useFlow, v as useFlowHandlers, xo as useFrigade, X as useModal, D as useStepHandlers };
20
+ export { Mt as Announcement, Lt as Banner, p as Box, S as Button, M as Card, y as Flex, er as Form, Tt as Provider, d as Text, b as Tooltip, cr as Tour, ee as useBoundingClientRect, j as useFlow, A as useFlowHandlers, fr as useFrigade, de as useModal, U as useStepHandlers };
17
21
  //# sourceMappingURL=out.js.map
18
22
  //# sourceMappingURL=index.js.map