@frigade/react 2.4.28 → 2.5.0-canary.1
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 +67 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +35 -16
- package/dist/index.js +28 -15
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -1468,6 +1468,7 @@ interface CardHeaderProps extends BoxProps {
|
|
|
1468
1468
|
interface CardComponent extends ForwardRefExoticComponent<Omit<FlowPropsWithoutChildren, 'ref'> & RefAttributes<unknown>> {
|
|
1469
1469
|
Dismiss: (props: ButtonProps) => EmotionJSX.Element;
|
|
1470
1470
|
Header: (props: CardHeaderProps) => EmotionJSX.Element;
|
|
1471
|
+
Footer: (props: BoxProps) => EmotionJSX.Element;
|
|
1471
1472
|
Media: (props: MediaProps) => EmotionJSX.Element;
|
|
1472
1473
|
Primary: (props: ButtonProps) => EmotionJSX.Element;
|
|
1473
1474
|
Secondary: (props: ButtonProps) => EmotionJSX.Element;
|
|
@@ -1646,6 +1647,23 @@ interface FormProps extends FlowPropsWithoutChildren {
|
|
|
1646
1647
|
}
|
|
1647
1648
|
declare function Form({ fieldTypes, flowId, part, ...props }: FormProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1648
1649
|
|
|
1650
|
+
type AlignValue = 'after' | 'before' | 'center' | 'end' | 'start';
|
|
1651
|
+
type SideValue = 'bottom' | 'left' | 'right' | 'top';
|
|
1652
|
+
interface HintProps extends BoxProps {
|
|
1653
|
+
align?: AlignValue;
|
|
1654
|
+
alignOffset?: number;
|
|
1655
|
+
anchor: string;
|
|
1656
|
+
children?: React.ReactNode;
|
|
1657
|
+
defaultOpen?: boolean;
|
|
1658
|
+
modal?: boolean;
|
|
1659
|
+
onOpenChange?: (open: boolean) => void;
|
|
1660
|
+
open?: boolean;
|
|
1661
|
+
side?: SideValue;
|
|
1662
|
+
sideOffset?: number;
|
|
1663
|
+
spotlight?: boolean;
|
|
1664
|
+
}
|
|
1665
|
+
declare function Hint({ align, alignOffset, anchor, children, defaultOpen, modal, onOpenChange, open, part, side, sideOffset, spotlight, style, ...props }: HintProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1666
|
+
|
|
1649
1667
|
declare function SelectField(props: FormFieldProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1650
1668
|
|
|
1651
1669
|
declare function TextareaField(props: FormFieldProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
@@ -1679,16 +1697,20 @@ declare function Bar({ current, total, ...props }: ProgressProps): _emotion_reac
|
|
|
1679
1697
|
|
|
1680
1698
|
declare function Dots({ current, total, ...props }: ProgressProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1681
1699
|
|
|
1700
|
+
declare function Fraction({ current, total, ...props }: ProgressProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1701
|
+
|
|
1682
1702
|
declare function Segments({ current, total, ...props }: ProgressProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1683
1703
|
|
|
1684
1704
|
declare const index$1_Bar: typeof Bar;
|
|
1685
1705
|
declare const index$1_Dots: typeof Dots;
|
|
1706
|
+
declare const index$1_Fraction: typeof Fraction;
|
|
1686
1707
|
type index$1_ProgressProps = ProgressProps;
|
|
1687
1708
|
declare const index$1_Segments: typeof Segments;
|
|
1688
1709
|
declare namespace index$1 {
|
|
1689
1710
|
export {
|
|
1690
1711
|
index$1_Bar as Bar,
|
|
1691
1712
|
index$1_Dots as Dots,
|
|
1713
|
+
index$1_Fraction as Fraction,
|
|
1692
1714
|
index$1_ProgressProps as ProgressProps,
|
|
1693
1715
|
index$1_Segments as Segments,
|
|
1694
1716
|
};
|
|
@@ -1766,6 +1788,14 @@ interface ProviderProps {
|
|
|
1766
1788
|
}
|
|
1767
1789
|
declare function Provider({ children, css, defaultCollection, navigate, theme, ...props }: ProviderProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1768
1790
|
|
|
1791
|
+
interface OverlayProps extends BoxProps {
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
interface SpotlightProps extends OverlayProps {
|
|
1795
|
+
anchor: string;
|
|
1796
|
+
}
|
|
1797
|
+
declare function Spotlight({ anchor, part, style, ...props }: SpotlightProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1798
|
+
|
|
1769
1799
|
declare function NPS({ as, flowId, fieldTypes, part, ...props }: FormProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1770
1800
|
|
|
1771
1801
|
declare const index_NPS: typeof NPS;
|
|
@@ -1797,7 +1827,7 @@ interface TooltipProps extends BoxPropsWithoutChildren, Omit<MergedRadixPopoverP
|
|
|
1797
1827
|
zIndex?: number | string;
|
|
1798
1828
|
style?: React__default.CSSProperties;
|
|
1799
1829
|
}
|
|
1800
|
-
declare function Tooltip({ anchor, children, className, spotlight, style, ...props }: TooltipProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1830
|
+
declare function Tooltip({ anchor, children, className, defaultOpen, open, part, spotlight, style, ...props }: TooltipProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1801
1831
|
declare namespace Tooltip {
|
|
1802
1832
|
var Close: (props: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1803
1833
|
var Media: ({ src, ...props }: MediaProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
@@ -1808,21 +1838,10 @@ declare namespace Tooltip {
|
|
|
1808
1838
|
var Title: ({ children, ...props }: TextProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1809
1839
|
}
|
|
1810
1840
|
|
|
1811
|
-
interface TourProps extends
|
|
1812
|
-
|
|
1813
|
-
* @ignore
|
|
1814
|
-
*/
|
|
1815
|
-
defaultOpen?: boolean;
|
|
1816
|
-
/**
|
|
1817
|
-
* @ignore
|
|
1818
|
-
*/
|
|
1819
|
-
open?: boolean;
|
|
1820
|
-
/**
|
|
1821
|
-
* The modality of the tooltip. When set to `true`, interaction with outside elements will be disabled and only popover content will be visible to screen readers.
|
|
1822
|
-
*/
|
|
1823
|
-
modal?: boolean;
|
|
1841
|
+
interface TourProps extends FlowPropsWithoutChildren, Omit<HintProps, 'anchor'> {
|
|
1842
|
+
sequential?: boolean;
|
|
1824
1843
|
}
|
|
1825
|
-
declare function Tour({
|
|
1844
|
+
declare function Tour({ align, alignOffset, as, defaultOpen, dismissible, flowId, modal, part, sequential, side, sideOffset, spotlight, ...props }: TourProps): React$1.ReactPortal;
|
|
1826
1845
|
|
|
1827
1846
|
declare function useBoundingClientRect(): {
|
|
1828
1847
|
node: any;
|
|
@@ -1860,4 +1879,4 @@ declare function useGroup(): {
|
|
|
1860
1879
|
track: (eventName: string, properties?: Record<string, unknown>) => Promise<void>;
|
|
1861
1880
|
};
|
|
1862
1881
|
|
|
1863
|
-
export { Announcement, AnnouncementProps, Banner, BannerProps, BaseField, Box, BoxProps, Button, ButtonProps, Card, CardHeaderProps, CardProps, index$2 as Checklist, CollapsibleProps, CollapsibleStepProps, Collection, Dialog, DialogProps, DismissHandler, FieldTypes, Flex, Flow, FlowChildrenProps, FlowConfig, FlowHandlerProp, FlowHandlerProps, FlowProps, FlowPropsWithoutChildren, Form, FormFieldData, FormFieldProps, FormProps, Image, Label, Media, index$1 as Progress, Provider, ProviderProps, RadioField, SelectField, StepHandler, StepHandlerProp, StepHandlerProps, index as Survey, Text, TextField, TextProps, TextareaField, Theme, Tokens, Tooltip, TooltipProps, Tour, TourProps, Video, themeVariables, tokens, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useGroup, useModal, useStepHandlers, useUser };
|
|
1882
|
+
export { Announcement, AnnouncementProps, Banner, BannerProps, BaseField, Box, BoxProps, Button, ButtonProps, Card, CardHeaderProps, CardProps, index$2 as Checklist, CollapsibleProps, CollapsibleStepProps, Collection, Dialog, DialogProps, DismissHandler, FieldTypes, Flex, Flow, FlowChildrenProps, FlowConfig, FlowHandlerProp, FlowHandlerProps, FlowProps, FlowPropsWithoutChildren, Form, FormFieldData, FormFieldProps, FormProps, Hint, Image, Label, Media, index$1 as Progress, Provider, ProviderProps, RadioField, SelectField, Spotlight, StepHandler, StepHandlerProp, StepHandlerProps, index as Survey, Text, TextField, TextProps, TextareaField, Theme, Tokens, Tooltip, TooltipProps, Tour, TourProps, Video, themeVariables, tokens, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useGroup, useModal, useStepHandlers, useUser };
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { keyframes, Global, ThemeProvider } from '@emotion/react';
|
|
3
|
-
import * as
|
|
3
|
+
import * as K from '@radix-ui/react-dialog';
|
|
4
4
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
5
|
-
import * as
|
|
6
|
-
import { createContext, useContext, useCallback, useState,
|
|
5
|
+
import * as So from 'react';
|
|
6
|
+
import { createContext, useContext, useCallback, useState, useEffect, useRef, useMemo, useSyncExternalStore, useLayoutEffect, Fragment as Fragment$1 } from 'react';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import Jr from 'known-css-properties';
|
|
9
|
+
import nn from 'dompurify';
|
|
10
10
|
import { FlowType, Frigade } from '@frigade/js';
|
|
11
11
|
import * as js from '@frigade/js';
|
|
12
12
|
export { js as FrigadeJS };
|
|
13
|
-
import
|
|
14
|
-
import * as
|
|
13
|
+
import Jn from 'embla-carousel-react';
|
|
14
|
+
import * as ve from '@radix-ui/react-collapsible';
|
|
15
15
|
import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
|
|
16
16
|
import * as Te from '@radix-ui/react-radio-group';
|
|
17
17
|
import * as W from '@radix-ui/react-select';
|
|
18
|
-
import * as
|
|
18
|
+
import * as to from '@radix-ui/react-checkbox';
|
|
19
|
+
import { RemoveScroll } from 'react-remove-scroll';
|
|
20
|
+
import { useFloating, autoUpdate, offset, flip, shift, useClick, useDismiss, useRole, useInteractions } from '@floating-ui/react';
|
|
21
|
+
import { createPortal } from 'react-dom';
|
|
19
22
|
import * as ee from '@radix-ui/react-popover';
|
|
20
23
|
|
|
21
|
-
var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnPropertyDescriptors;var _e=Object.getOwnPropertySymbols;var $o=Object.prototype.hasOwnProperty,No=Object.prototype.propertyIsEnumerable;var Lo=(e,o,t)=>o in e?Vo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))$o.call(o,t)&&Lo(e,t,o[t]);if(_e)for(var t of _e(o))No.call(o,t)&&Lo(e,t,o[t]);return e},s=(e,o)=>Fr(e,vr(o));var Tr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var m=(e,o)=>{var t={};for(var n in e)$o.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&_e)for(var n of _e(e))o.indexOf(n)<0&&No.call(e,n)&&(t[n]=e[n]);return t};var oe=(e,o)=>{for(var t in o)Vo(e,t,{get:o[t],enumerable:!0});};var L=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{d(t.next(c));}catch(u){r(u);}},l=c=>{try{d(t.throw(c));}catch(u){r(u);}},d=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,l);d((t=t.apply(e,o)).next());});function Pe(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var zo={borderWidths:{md:"1px"}};var ze=[5,10,20,35,50,65,80,95,98],Go=[...ze],po=[...ze];Go[4]=40;po[4]=60;var Br={blue:{h:213,s:100,l:ze},gray:{h:220,s:10,l:ze},green:{h:141,s:90,l:Go},red:{h:9,s:90,l:po},yellow:{h:50,s:90,l:po}};var H={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Br))H[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var Ko=s(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},H),{gray100:H.gray[100],gray200:H.gray[200],gray300:H.gray[300],gray400:H.gray[400],gray500:H.gray[500],gray600:H.gray[600],gray700:H.gray[700],gray800:H.gray[800],gray900:H.gray[900],blue400:H.blue[400],blue500:H.blue[500],blue800:H.blue[800],blue900:H.blue[900],green400:H.blue[400],green500:H.green[500],green800:H.green[800],red500:H.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Uo={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,jo={negative:{100:p("red-100"),200:p("red-200"),300:p("red-300"),400:p("red-400"),500:p("red-500"),600:p("red-600"),700:p("red-700"),800:p("red-800"),900:p("red-900"),background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500"),active:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")},focus:{background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500")},hover:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")}},neutral:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("neutral-800"),foreground:p("black"),surface:p("neutral-700"),active:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},focus:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},hover:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")}},positive:{100:p("green-100"),200:p("green-200"),300:p("green-300"),400:p("green-400"),500:p("green-500"),600:p("green-600"),700:p("green-700"),800:p("green-800"),900:p("green-900"),background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500"),active:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")},focus:{background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500")},hover:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")}},primary:{100:p("blue-100"),200:p("blue-200"),300:p("blue-300"),400:p("blue-400"),500:p("blue-500"),600:p("blue-600"),700:p("blue-700"),800:p("blue-800"),900:p("blue-900"),background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500"),active:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")},focus:{background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500")},hover:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")}},secondary:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900"),active:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")},focus:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900")},hover:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")}}};var Jo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Rr="px",kr=e=>typeof e=="number"?`${4*e}${Rr}`:e,Er=[-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"],Xo=Object.fromEntries(Er.map(e=>[e,kr(e)]));var qo={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 Ge=s(i(s(i({},zo),{colors:i(i({},Ko),jo)}),qo),{radii:Uo,shadows:Jo,space:Xo});function De(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let l=`${o.length?`${o}${t}`:""}${r}`,d=e[r];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(n,De(d,l,t)):n[l]=d,n},{})}function co(e){let o=De(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function Yo(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=Yo(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var uo=co(Ge),R=Yo(Ge);var Or=new Set(["alt","size","src"]),Ir=Dr.all.filter(e=>e.indexOf("-")!=0&&!Or.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Hr=Object.fromEntries(Ir),Ke=De(R.colors),Wr={color:Ke,backgroundColor:Ke,borderColor:Ke,border:i(i({},R.borderWidths),Ke),borderRadius:R.radii,borderWidth:R.borderWidths,boxShadow:R.shadows,fontFamily:R.fontFamilies,fontSize:R.fontSizes,fontWeight:R.fontWeights,gap:R.space,lineHeight:R.lineHeights,margin:R.space,marginBottom:R.space,marginLeft:R.space,marginRight:R.space,marginTop:R.space,padding:R.space,paddingBottom:R.space,paddingLeft:R.space,paddingRight:R.space,paddingTop:R.space},Zo=i(i({},Hr),Wr),Qo={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"]},et=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Mr(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 ot=new Map(Object.entries(Zo).map(([e,o])=>[e,Mr(o)])),Ar=new Map(Object.entries(Qo).map(([e,o])=>[e,new Set(o)])),Lr=new Set(["height","width"]),Vr=new Set(["canvas","embed","iframe","img","input","object","video"]);function tt(e){let[o,t]=e.split(":");return [o,et.has(t)?t:null]}function rt(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[d]==null&&(n[d]={}),n[d]}return Object.entries(t).forEach(([a,l])=>{let[d,c]=tt(a),u=Ar.get(d);u!=null&&(u.forEach(f=>{let y=`${f}${c?":"+c:""}`;t[y]=l;}),delete t[a]);}),Object.entries(t).forEach(([a,l])=>{let[d,c]=tt(a),u=ot.get(d);if(u!=null){if(l==null)delete t[a];else if(typeof l=="string"&&l.indexOf(" ")>-1){let f=l.split(" ");r(c)[d]=f.map(y=>{var x;return (x=u.get(y.toString()))!=null?x:y}).join(" ");}else u.has(l.toString())?r(c)[d]=u.get(l.toString()):r(c)[d]=l;(typeof o!="string"||!Vr.has(o)||!Lr.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let l=a.substring(1);a.indexOf("_")===0&&ot.has(l)&&(t[l]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function Nr(){if(typeof window=="undefined"){let{JSDOM:e}=Tr("jsdom");return new e("<!DOCTYPE html>").window}return window}function nt(e){return e?{__html:$r(Nr()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function zr(e){return e&&`fr-${e}`}function lt(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>lt(o)).join(" "):zr(e))}function Gr(d,l){var c=d,{as:e,children:o,className:t,css:n={},part:r}=c,a=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:f,unmatchedProps:y}=rt(a,u),x=lt(r),h=t||x?clsx(t,x):void 0,w=[{boxSizing:"border-box"},f,n];return typeof o=="string"?jsx(u,s(i({className:h,css:w},y),{ref:l,dangerouslySetInnerHTML:nt(o)})):jsx(u,s(i({className:h,css:w},y),{ref:l,children:o}))}var g=yo.forwardRef(Gr);var E={};oe(E,{Link:()=>Pn,Plain:()=>Cn,Primary:()=>hn,Secondary:()=>bn});var S={};oe(S,{Body1:()=>sn,Body2:()=>pn,Caption:()=>dn,Display1:()=>on,Display2:()=>tn,H1:()=>rn,H2:()=>nn,H3:()=>an,H4:()=>ln});var mo={};oe(mo,{Body1:()=>Yr,Body2:()=>Zr,Caption:()=>Qr,Display1:()=>Kr,Display2:()=>Ur,H1:()=>jr,H2:()=>Jr,H3:()=>Xr,H4:()=>qr});var te={color:"neutral.foreground",fontFamily:"default",margin:"0"},Kr=s(i({},te),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Ur=s(i({},te),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),jr=s(i({},te),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Jr=s(i({},te),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Xr=s(i({},te),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),qr=s(i({},te),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Yr=s(i({},te),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Zr=s(i({},te),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Qr=s(i({},te),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var en=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],re=Object.fromEntries(en.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=yo.forwardRef((d,l)=>{var c=d,{as:n=o,children:r}=c,a=m(c,["as","children"]);return jsx(g,s(i(i({as:n},mo[e]),a),{ref:l,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),on=re.Display1,tn=re.Display2,rn=re.H1,nn=re.H2,an=re.H3,ln=re.H4,sn=re.Body1,pn=re.Body2,dn=re.Caption;var go={};oe(go,{Link:()=>gn,Plain:()=>yn,Primary:()=>mn,Secondary:()=>fn,loadingCSSStyle:()=>fo});var Ue={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},mn=s(i({},Ue),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),fn=s(i({},Ue),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),gn=s(i({},Ue),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),yn=s(i({},Ue),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),xn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),fo={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:xn+" 1s ease infinite"}};function je(l){var d=l,{as:e,children:o,part:t,title:n,variant:r="Primary"}=d,a=m(d,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxs(g,s(i(s(i({as:e!=null?e:"button",part:[`button-${c}`,t]},go[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?fo:{})}),a),{loading:void 0,children:[o,n&&jsx(S.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function hn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(je,s(i({},o),{variant:"Primary",children:e}))}function bn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(je,s(i({},o),{variant:"Secondary",children:e}))}function Pn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(je,s(i({},o),{variant:"Link",children:e}))}function Cn(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsx(je,s(i({},o),{variant:"Plain",children:e}))}var P={};oe(P,{Column:()=>Fn,Row:()=>wn});var wn=yo.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Fn=yo.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function xo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=m(a,["dismissible","flowId","part"]);return jsx(G,s(i({as:null,flowId:o},n),{children:({handleDismiss:l,handlePrimary:d,handleSecondary:c,parentProps:{containerProps:u},step:f})=>{var k,B,F,C,v;let y=(k=f.props)!=null?k:{},x=(F=(B=f.primaryButton)==null?void 0:B.title)!=null?F:f.primaryButtonTitle,h=(v=(C=f.secondaryButton)==null?void 0:C.title)!=null?v:f.secondaryButtonTitle,w=f.$state.blocked;return jsxs(b,s(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),y),{children:[f.imageUri&&jsx(g,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:f.title}),jsx(b.Subtitle,{part:"subtitle",children:f.subtitle})]}),jsx(b.Secondary,{disabled:w,title:h,onClick:c}),jsx(b.Primary,{disabled:w,title:x,onClick:d}),e&&jsx(b.Dismiss,{onClick:l})]}))}}))}var qe={};oe(qe,{Carousel:()=>Rt,Collapsible:()=>Xe,CollapsibleStep:()=>We});var Ie={};oe(Ie,{Bar:()=>Ce,Dots:()=>mt,Segments:()=>gt});function Ce(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,l=a===0?"10px":`${100*a}%`;return jsx(g,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function mt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((l,d)=>jsx(g,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?R.colors.blue500:R.colors.blue800},d));return jsx(g,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function gt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=[...Array(o)].map((l,d)=>jsx(g,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsx(P.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function xt(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function vn(){return jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ht(t){var n=t,{checked:e=!1}=n,o=m(n,["checked"]);return jsx(g,s(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(vn,{})})}))}function ne(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(V),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((a,l,d=!0)=>L(this,null,function*(){if((yield o==null?void 0:o(e,a,l))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(l,d)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,d),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,l)=>L(this,null,function*(){if((yield t==null?void 0:t(e,a,l))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(l),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Pt({onPrimary:e,onSecondary:o,step:t}){var u,f;let{handlePrimary:n,handleSecondary:r}=ne(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:l,skipped:d}=t.$state,c=l||d||!a?jsx(ht,{checked:l||d,marginLeft:"auto"}):jsx(g,{as:xt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(b,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:a,opacity:a?.5:1,children:[jsxs(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(P.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsx(b.Secondary,{disabled:a,onClick:r,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(b.Primary,{disabled:a,onClick:n,title:(f=t.primaryButton)==null?void 0:f.title})]})]})}function St(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function Ft(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var vt=keyframes`
|
|
24
|
+
var Jo=Object.defineProperty,_r=Object.defineProperties;var zr=Object.getOwnPropertyDescriptors;var Ge=Object.getOwnPropertySymbols;var qo=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable;var Xo=(e,o,t)=>o in e?Jo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))qo.call(o,t)&&Xo(e,t,o[t]);if(Ge)for(var t of Ge(o))Zo.call(o,t)&&Xo(e,t,o[t]);return e},s=(e,o)=>_r(e,zr(o));var Ur=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var n in e)qo.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Ge)for(var n of Ge(e))o.indexOf(n)<0&&Zo.call(e,n)&&(t[n]=e[n]);return t};var oe=(e,o)=>{for(var t in o)Jo(e,t,{get:o[t],enumerable:!0});};var $=(e,o,t)=>new Promise((n,r)=>{var a=d=>{try{p(t.next(d));}catch(m){r(m);}},l=d=>{try{p(t.throw(d));}catch(m){r(m);}},p=d=>d.done?n(d.value):Promise.resolve(d.value).then(a,l);p((t=t.apply(e,o)).next());});function Ce(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var Qo={borderWidths:{md:"1px"}};var Ke=[5,10,20,35,50,65,80,95,98],et=[...Ke],yo=[...Ke];et[4]=40;yo[4]=60;var Gr={blue:{h:213,s:100,l:Ke},gray:{h:220,s:10,l:Ke},green:{h:141,s:90,l:et},red:{h:9,s:90,l:yo},yellow:{h:50,s:90,l:yo}};var M={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Gr))M[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var ot=s(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},M),{gray100:M.gray[100],gray200:M.gray[200],gray300:M.gray[300],gray400:M.gray[400],gray500:M.gray[500],gray600:M.gray[600],gray700:M.gray[700],gray800:M.gray[800],gray900:M.gray[900],blue400:M.blue[400],blue500:M.blue[500],blue800:M.blue[800],blue900:M.blue[900],green400:M.blue[400],green500:M.green[500],green800:M.green[800],red500:M.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var tt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,rt={negative:{100:c("red-100"),200:c("red-200"),300:c("red-300"),400:c("red-400"),500:c("red-500"),600:c("red-600"),700:c("red-700"),800:c("red-800"),900:c("red-900"),background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500"),active:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")},focus:{background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500")},hover:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")}},neutral:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("neutral-800"),foreground:c("black"),surface:c("neutral-700"),active:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},focus:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},hover:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")}},positive:{100:c("green-100"),200:c("green-200"),300:c("green-300"),400:c("green-400"),500:c("green-500"),600:c("green-600"),700:c("green-700"),800:c("green-800"),900:c("green-900"),background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500"),active:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")},focus:{background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500")},hover:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")}},primary:{100:c("blue-100"),200:c("blue-200"),300:c("blue-300"),400:c("blue-400"),500:c("blue-500"),600:c("blue-600"),700:c("blue-700"),800:c("blue-800"),900:c("blue-900"),background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500"),active:{background:c("primary-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")},focus:{background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500")},hover:{background:c("primary-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")}},secondary:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900"),active:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")},focus:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900")},hover:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")}}};var nt={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Kr="px",jr=e=>typeof e=="number"?`${4*e}${Kr}`:e,Xr=[-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"],it=Object.fromEntries(Xr.map(e=>[e,jr(e)]));var at={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 je=s(i(s(i({},Qo),{colors:i(i({},ot),rt)}),at),{radii:tt,shadows:nt,space:it});function He(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let l=`${o.length?`${o}${t}`:""}${r}`,p=e[r];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(n,He(p,l,t)):n[l]=p,n},{})}function xo(e){let o=He(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function st(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=st(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var ho=xo(je),k=st(je);var qr=new Set(["alt","size","src"]),Zr=Jr.all.filter(e=>e.indexOf("-")!=0&&!qr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Yr=Object.fromEntries(Zr),Xe=He(k.colors),Qr={color:Xe,backgroundColor:Xe,borderColor:Xe,border:i(i({},k.borderWidths),Xe),borderRadius:k.radii,borderWidth:k.borderWidths,boxShadow:k.shadows,fontFamily:k.fontFamilies,fontSize:k.fontSizes,fontWeight:k.fontWeights,gap:k.space,lineHeight:k.lineHeights,margin:k.space,marginBottom:k.space,marginLeft:k.space,marginRight:k.space,marginTop:k.space,padding:k.space,paddingBottom:k.space,paddingLeft:k.space,paddingRight:k.space,paddingTop:k.space},lt=i(i({},Yr),Qr),pt={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"]},dt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function en(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 ct=new Map(Object.entries(lt).map(([e,o])=>[e,en(o)])),on=new Map(Object.entries(pt).map(([e,o])=>[e,new Set(o)])),tn=new Set(["height","width"]),rn=new Set(["canvas","embed","iframe","img","input","object","video"]);function mt(e){let[o,t]=e.split(":");return [o,dt.has(t)?t:null]}function ut(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let p=`&:${a.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[p]==null&&(n[p]={}),n[p]}return Object.entries(t).forEach(([a,l])=>{let[p,d]=mt(a),m=on.get(p);m!=null&&(m.forEach(u=>{let y=`${u}${d?":"+d:""}`;t[y]=l;}),delete t[a]);}),Object.entries(t).forEach(([a,l])=>{let[p,d]=mt(a),m=ct.get(p);if(m!=null){if(l==null)delete t[a];else if(typeof l=="string"&&l.indexOf(" ")>-1){let u=l.split(" ");r(d)[p]=u.map(y=>{var h;return (h=m.get(y.toString()))!=null?h:y}).join(" ");}else m.has(l.toString())?r(d)[p]=m.get(l.toString()):r(d)[p]=l;(typeof o!="string"||!rn.has(o)||!tn.has(p))&&delete t[a];}}),Object.keys(t).forEach(a=>{let l=a.substring(1);a.indexOf("_")===0&&ct.has(l)&&(t[l]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function an(){if(typeof window=="undefined"){let{JSDOM:e}=Ur("jsdom");return new e("<!DOCTYPE html>").window}return window}function ft(e){return e?{__html:nn(an()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function ln(e){return e&&`fr-${e}`}function xt(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>xt(o)).join(" "):ln(e))}function pn(p,l){var d=p,{as:e,children:o,className:t,css:n={},part:r}=d,a=f(d,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:u,unmatchedProps:y}=ut(a,m),h=xt(r),x=t||h?clsx(t,h):void 0,F=[{boxSizing:"border-box"},u,n];return typeof o=="string"?jsx(m,s(i({className:x,css:F},y),{ref:l,dangerouslySetInnerHTML:ft(o)})):jsx(m,s(i({className:x,css:F},y),{ref:l,children:o}))}var g=So.forwardRef(pn);var D={};oe(D,{Link:()=>Wn,Plain:()=>Vn,Primary:()=>Mn,Secondary:()=>An});var w={};oe(w,{Body1:()=>Rn,Body2:()=>Bn,Caption:()=>Tn,Display1:()=>Pn,Display2:()=>Cn,H1:()=>Sn,H2:()=>wn,H3:()=>Fn,H4:()=>vn});var bo={};oe(bo,{Body1:()=>yn,Body2:()=>xn,Caption:()=>hn,Display1:()=>dn,Display2:()=>cn,H1:()=>mn,H2:()=>un,H3:()=>fn,H4:()=>gn});var te={color:"neutral.foreground",fontFamily:"default",margin:"0"},dn=s(i({},te),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),cn=s(i({},te),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),mn=s(i({},te),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),un=s(i({},te),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),fn=s(i({},te),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),gn=s(i({},te),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),yn=s(i({},te),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),xn=s(i({},te),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),hn=s(i({},te),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var bn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],re=Object.fromEntries(bn.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=So.forwardRef((p,l)=>{var d=p,{as:n=o,children:r}=d,a=f(d,["as","children"]);return jsx(g,s(i(i({as:n},bo[e]),a),{ref:l,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),Pn=re.Display1,Cn=re.Display2,Sn=re.H1,wn=re.H2,Fn=re.H3,vn=re.H4,Rn=re.Body1,Bn=re.Body2,Tn=re.Caption;var Co={};oe(Co,{Link:()=>In,Plain:()=>Hn,Primary:()=>Dn,Secondary:()=>On,loadingCSSStyle:()=>Po});var Je={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Dn=s(i({},Je),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),On=s(i({},Je),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),In=s(i({},Je),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Hn=s(i({},Je),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),$n=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Po={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:$n+" 1s ease infinite"}};function qe(l){var p=l,{as:e,children:o,part:t,title:n,variant:r="Primary"}=p,a=f(p,["as","children","part","title","variant"]);var m;let d=r.toLocaleLowerCase();return jsxs(g,s(i(s(i({as:e!=null?e:"button",part:[`button-${d}`,t]},Co[r]),{css:i(i({},(m=a.css)!=null?m:{}),a.loading?Po:{})}),a),{loading:void 0,children:[o,n&&jsx(w.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function Mn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(qe,s(i({},o),{variant:"Primary",children:e}))}function An(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(qe,s(i({},o),{variant:"Secondary",children:e}))}function Wn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(qe,s(i({},o),{variant:"Link",children:e}))}function Vn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(qe,s(i({},o),{variant:"Plain",children:e}))}var S={};oe(S,{Column:()=>_n,Row:()=>Nn});var Nn=So.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),_n=So.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function wo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=f(a,["dismissible","flowId","part"]);return jsx(z,s(i({as:null,flowId:o},n),{children:({handleDismiss:l,handlePrimary:p,handleSecondary:d,parentProps:{containerProps:m},step:u})=>{var v,T,B,P,C;let y=(v=u.props)!=null?v:{},h=(B=(T=u.primaryButton)==null?void 0:T.title)!=null?B:u.primaryButtonTitle,x=(C=(P=u.secondaryButton)==null?void 0:P.title)!=null?C:u.secondaryButtonTitle,F=u.$state.blocked;return jsxs(b,s(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},m),y),{children:[u.imageUri&&jsx(g,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:u.title}),jsx(b.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(b.Secondary,{disabled:F,title:x,onClick:d}),jsx(b.Primary,{disabled:F,title:h,onClick:p}),e&&jsx(b.Dismiss,{onClick:l})]}))}}))}var eo={};oe(eo,{Carousel:()=>Wt,Collapsible:()=>Qe,CollapsibleStep:()=>Ae});var we={};oe(we,{Bar:()=>Se,Dots:()=>wt,Fraction:()=>Ze,Segments:()=>vt});function Se(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,l=a===0?"10px":`${100*a}%`;return jsx(g,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:l},transition:"width 300ms ease-out"})}))}function wt(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((l,p)=>jsx(g,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?k.colors.blue500:k.colors.blue800},p));return jsx(g,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Ze(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);return jsx(w.Body2,s(i({part:"progress-fraction"},t),{children:`${e}/${o}`}))}function vt(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=[...Array(o)].map((l,p)=>jsx(g,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsx(S.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function Bt(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function Un(){return jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Tt(t){var n=t,{checked:e=!1}=n,o=f(n,["checked"]);return jsx(g,s(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Un,{})})}))}function ne(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(N),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((a,l,p=!0)=>$(this,null,function*(){if((yield o==null?void 0:o(e,a,l))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof m=="function"?m():m!==!1&&(yield e.complete(l,p)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(l,p),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,l)=>$(this,null,function*(){if((yield t==null?void 0:t(e,a,l))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(l),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(l),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Et({onPrimary:e,onSecondary:o,step:t}){var m,u;let{handlePrimary:n,handleSecondary:r}=ne(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:l,skipped:p}=t.$state,d=l||p||!a?jsx(Tt,{checked:l||p,marginLeft:"auto"}):jsx(g,{as:Bt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(b,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:a,opacity:a?.5:1,children:[jsxs(S.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(S.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsx(b.Secondary,{disabled:a,onClick:r,title:(m=t.secondaryButton)==null?void 0:m.title}),jsx(b.Primary,{disabled:a,onClick:n,title:(u=t.primaryButton)==null?void 0:u.title})]})]})}function Ot(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function Ht(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var $t=keyframes`
|
|
22
25
|
from {
|
|
23
26
|
opacity: 0;
|
|
24
27
|
}
|
|
25
28
|
to {
|
|
26
29
|
opacity: 1;
|
|
27
30
|
}
|
|
28
|
-
`;function
|
|
31
|
+
`;function Mt({flow:e,sort:o,onPrimary:t,onSecondary:n}){var v,T;let[r,a]=useState(),[l]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(T=(v=Array.from(e.steps.values()).find(B=>!B.$state.completed&&!B.$state.skipped))==null?void 0:v.order)!=null?T:0}),[p,d]=Jn(l),[m,u]=useState(),[y,h]=useState();useLayoutEffect(()=>{d&&(m==null&&u(d.canScrollNext()),y==null&&h(d.canScrollPrev()),d.on("select",()=>{u(d.canScrollNext()),h(d.canScrollPrev());}));},[d]),useEffect(()=>{if(!r){let B=Array.from(e.steps.values()),P=B.filter(R=>R.$state.completed||R.$state.skipped).sort((R,E)=>R.order-E.order),C=B.filter(R=>!R.$state.completed&&!R.$state.skipped).sort((R,E)=>R.order-E.order);a(o==="completed-last"?[...C,...P].map(R=>R.id):B.map(R=>R.id));}},[]);let x=e.getNumberOfCompletedSteps(),F=e.getNumberOfAvailableSteps();return r?jsxs(Fragment,{children:[jsxs(S.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:k.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(S.Column,{part:"carousel-header-content",children:[jsx(w.H3,{children:e.title}),jsx(w.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(S.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(w.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",F]}),jsx(Se,{current:x,total:F,minWidth:"200px"})]})]}),jsxs(g,{margin:`0 ${k.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:p,children:[jsx(S.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).sort((B,P)=>r.indexOf(B.id)-r.indexOf(P.id)).map(B=>jsx(Et,{onPrimary:t,onSecondary:n,step:B},B.id))}),y&&jsx(S.Column,{animation:`${$t} 300ms ease-out`,background:"linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",left:"0",justifyContent:"center",paddingLeft:"3",part:"carousel-prev-wrapper",position:"absolute",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx(Ht,{height:"24px",width:"24px"})})}),m&&jsx(S.Column,{animation:`${$t} 300ms ease-out`,background:"linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",justifyContent:"center",paddingRight:"3",part:"carousel-next-wrapper",position:"absolute",right:"0",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(Ot,{height:"24px",width:"24px"})})})]})]}):null}function Wt(o){var e=f(o,[]);return jsx(z,s(i({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(Mt,i(i({},e),t))}))}var Ae={};oe(Ae,{Content:()=>Ro,Root:()=>Bo,Trigger:()=>To});function Lt(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6"},e),{children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}))}var Zn=keyframes`
|
|
29
32
|
from {
|
|
30
33
|
height: 0;
|
|
31
34
|
opacity: 0;
|
|
@@ -34,7 +37,7 @@ var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnProp
|
|
|
34
37
|
height: var(--radix-collapsible-content-height);
|
|
35
38
|
opacity: 1;
|
|
36
39
|
}
|
|
37
|
-
`,
|
|
40
|
+
`,Yn=keyframes`
|
|
38
41
|
from {
|
|
39
42
|
height: var(--radix-collapsible-content-height);
|
|
40
43
|
opacity: 1;
|
|
@@ -43,7 +46,7 @@ var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnProp
|
|
|
43
46
|
height: 0;
|
|
44
47
|
opacity: 0;
|
|
45
48
|
}
|
|
46
|
-
`,Hn=()=>jsx(g,{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"})});function Wn({checked:e=!1}){return jsx(g,{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&&jsx(g,{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:jsx(Hn,{})})})}function Po({children:e}){return jsx(we.Content,{asChild:!0,children:jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${On} 300ms ease-out`},'&[data-state="closed"]':{animation:`${In} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(g,{}),e]})})}function Co(a){var l=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=l,r=m(l,["children","disabled","onOpenChange","open"]);return jsx(we.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsx(b,s(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function So({isCompleted:e,isBlocked:o,title:t}){return jsx(we.Trigger,{asChild:!0,children:jsxs(P.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsxs(P.Row,{alignItems:"center",gap:2,children:[jsx(Wn,{checked:e}),jsx(S.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(g,{as:Et,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ot=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function It({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var w,k,B,F,C,v;let{$state:{blocked:a,completed:l,skipped:d},subtitle:c,title:u}=r,f=(k=(w=r.primaryButton)==null?void 0:w.title)!=null?k:r.primaryButtonTitle,y=(F=(B=r.secondaryButton)==null?void 0:B.title)!=null?F:r.secondaryButtonTitle,x=(C=r.props)!=null?C:{},h=!!a;return jsxs(Co,s(i({open:t,onOpenChange:n},x),{children:[jsx(So,{isBlocked:r.$state.blocked,isCompleted:l||d,title:u}),jsxs(Po,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(v=r.videoUri)!=null?v:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:c}),jsxs(P.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:y,onClick:o}),jsx(b.Primary,{disabled:h,title:f,onClick:e})]})]})]}))}var Vn={default:It};function $n(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var k;let{onPrimary:a,onSecondary:l,openStepId:d,setOpenStepId:c,stepTypes:u}=useContext(Ot),{handlePrimary:f,handleSecondary:y}=ne(o,{onPrimary:a,onSecondary:l}),x=(d!=null?d:e.getCurrentStep().id)===o.id,h=(k=u[o.type])!=null?k:It;function w(B){return L(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(h,s(i({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:f,handleSecondary:y}),o.id)}function Xe(d){var c=d,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,l=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=useState(null),y=i(i({},Vn),a);return jsx(Ot.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:n,stepTypes:y},children:jsx(G,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},l),{children:k=>{var B=k,{flow:x,handleDismiss:h}=B,w=m(B,["flow","handleDismiss"]);let C=Array.from(x.steps.entries()).filter(([,D])=>D.$state.visible===!0).map(([,D])=>jsx($n,s(i({flow:x,handleDismiss:h},w),{step:D}),D.id)),v=x.getNumberOfCompletedSteps(),T=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(P.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxs(S.Body2,{fontWeight:"demibold",children:[v,"/",T]}),jsx(Ce,{current:v,total:T,flexGrow:1})]})]}),C]})}}))})}var Xn=new Set(["required","min","max","minLength","maxLength","pattern"]);function qn({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=useFormContext();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 a=Object.fromEntries(Object.entries(t).filter(([d])=>Xn.has(d))),l=useController({name:t.id,control:o,rules:a});return jsx(e,s(i({},l),{fieldData:t,formContext:r,submit:n}))}function Wt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var v,T,D,U,I,j;let{__readOnly:l}=useContext(V),d=((v=a.fields)!=null?v:[]).filter(A=>e[A.type]!=null&&A.id),c=useForm({delayError:2e3,mode:"onChange",defaultValues:d.reduce((A,J)=>{var ke;return A[J.id]=(ke=J.value)!=null?ke:"",A},{})}),[u,f]=useState(!1),y=[],{control:x,handleSubmit:h}=c,w=(T=a.props)!=null?T:{};function k(A,J){f(!0),t(J,A,l===!0).then(()=>f(!1));}d.forEach(A=>{e[A.type]!=null&&y.push(jsx(qn,{control:x,fieldComponent:e[A.type],fieldData:A,submit:h(k)},`${a.flow.id}-${A.id}`));});let B=(U=(D=a.primaryButton)==null?void 0:D.title)!=null?U:a.primaryButtonTitle,F=(j=(I=a.secondaryButton)==null?void 0:I.title)!=null?j:a.secondaryButtonTitle,C=!!(a.$state.blocked||!c.formState.isValid);return useEffect(()=>{c.clearErrors();},[a]),jsxs(P.Column,s(i({gap:5,part:"form-step"},w),{children:[jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,s(i({},c),{children:y})),jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[F&&jsx(E.Secondary,{onClick:n,title:F}),jsx(E.Primary,{disabled:C||u,onClick:h(k),title:B!=null?B:"Submit",loading:u})]},`form-footer-${a.id}`)]}))}function Mt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(S.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function wo({children:e,id:o,required:t=!1}){return jsxs(S.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Fo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Me=s(i({},Fo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),Ye={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function Q({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:l}=t,{error:d}=n,c=s(i(i(i({id:r},o),l?{placeholder:l}:{}),Me),{"aria-invalid":!!d,value:(u=o.value)!=null?u:""});return jsxs(g,{part:"field",children:[jsx(wo,{id:r,required:!!t.required,children:a}),e(c),jsx(Mt,{error:d})]})}function ve(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var oi=yo.forwardRef(({label:e,value:o},t)=>jsxs(g,{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:[jsx(S.Body2,{part:"field-radio-label",children:e}),jsx(Te.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(g,{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:jsx(g,s(i({as:Te.Indicator},Ye),{children:jsx(ve,{height:"14",width:"14"})}))})})]}));function vo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:l})=>jsx(oi,{value:l,label:a},l));return jsx(Q,s(i({},e),{children:()=>jsx(Te.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(P.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Nt(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function zt(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=yo.useState([]);function l(d){let c=[];r.includes(d)?c=[...r.filter(u=>u!==d)]:c=[...r,d],a(c),o(c);}return jsx(Q,s(i({},e),{children:()=>jsx(P.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:d,value:c})=>jsx(Ze.Root,{value:r.includes(c)?c:void 0,onCheckedChange:()=>l(c),asChild:!0,children:jsxs(g,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsx(S.Body2,{part:"field-check-label",children:d}),jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(Ze.Indicator,{asChild:!0,children:jsx(g,s(i({},Ye),{children:jsx(ve,{height:"14",width:"14"})}))})})]})},c))})}))}var ni=yo.forwardRef(({label:e,value:o},t)=>jsx(W.Item,{value:o,ref:t,asChild:!0,children:jsx(g,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(W.ItemText,{asChild:!0,children:jsx(S.Body2,{part:"field-select-option-label",children:e})})})}));function To(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:l,value:d})=>jsx(ni,{value:d,label:l},d));return e.fieldData.multiple?jsx(zt,i({},e)):jsx(Q,s(i({},e),{children:()=>jsxs(W.Root,{value:t,onValueChange:o,children:[jsx(W.Trigger,{asChild:!0,children:jsxs(S.Body2,s(i({},Me),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(W.Value,{placeholder:r!=null?r:"Select one"}),jsx(W.Icon,{children:jsx(g,{as:Nt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(W.Portal,{children:jsx(W.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(g,s(i({},Me),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(W.Viewport,{children:a})}))})})]})}))}function Bo(e){return jsx(Q,s(i({},e),{children:o=>jsx(S.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Ro(e){return jsx(Q,s(i({},e),{children:o=>jsx(S.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function Jt(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(Ze.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(g,s(i({},Fo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsx(Ze.Indicator,{asChild:!0,children:jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(ve,{height:"14",fill:"currentColor"})})})}))}),jsx(S.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var ai={checkbox:Jt,radio:vo,select:To,text:Bo,textarea:Ro};function Re(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=m(a,["fieldTypes","flowId","part"]);let l=Object.assign({},ai,e);return jsx(G,s(i({flowId:o,part:["form",t]},n),{children:d=>jsx(Wt,i({fieldTypes:l},d))}))}var oo={};oe(oo,{NPS:()=>Le});function Yt({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((l,d)=>{let c=e.value===d?E.Primary:E.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(d),t();},title:`${d}`,css:{".fr-button-title":{fontSize:"15px"}}},d)});return jsxs(P.Column,{gap:2,children:[jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(S.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(S.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Le(a){var l=a,{as:e=O,flowId:o,fieldTypes:t,part:n}=l,r=m(l,["as","flowId","fieldTypes","part"]);let{flow:d}=ae(o);return jsx(Re,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:Yt},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||d.skip();},part:["nps",n],css:s(i({},!d||d.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function xe(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&L(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(r=>L(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function to(){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),a=useCallback(l=>{r(l);},[]);return useLayoutEffect(()=>{if(!n)return;let l=()=>{let d=n.getBoundingClientRect();t(d);};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),{node:n,rect:o,ref:a}}var fi=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function er(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxs(g,s(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${fi}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function ro(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function xi(e){var o,t,n,r,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function no(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let a=xi(o);return a?jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsx(g,i({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 de(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsx(o==="video"?no:ro,i({src:e},t))}function tr({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},l="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};r[d[n]]=l;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=l:r.bottom=l:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=l:r.top=l:["top","bottom"].includes(n)?r.left=`calc(50% + ${l})`:r.top=`calc(50% + ${l})`,r}var io={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function rr(e,o){var a,l,d,c,u;let t=Object.fromEntries(io.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n=Object.fromEntries(io.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r={};for(let f of Object.keys(e))!io.content.includes(f)&&!io.root.includes(f)&&(r[f]=e[f]);if(t.align=(a=t.align)!=null?a:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},y=(F,C)=>["top","bottom"].includes(C)?F=="after"?"marginLeft":"marginRight":F=="after"?"marginTop":"marginBottom",x=(d=t.alignOffset)!=null?d:0,h=(c=t.style)!=null?c:{},w=(u=t.side)!=null?u:"bottom",k=t.align;t.style=s(i({},h),{[y(k,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=f[k];}return {contentProps:t,otherProps:r,rootProps:n}}var nr=keyframes`
|
|
49
|
+
`,Qn=()=>jsx(g,{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"})});function ei({checked:e=!1}){return jsx(g,{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&&jsx(g,{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:jsx(Qn,{})})})}function Ro({children:e}){return jsx(ve.Content,{asChild:!0,children:jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${Zn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Yn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(g,{}),e]})})}function Bo(a){var l=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=l,r=f(l,["children","disabled","onOpenChange","open"]);return jsx(ve.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsx(b,s(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function To({isCompleted:e,isBlocked:o,title:t}){return jsx(ve.Trigger,{asChild:!0,children:jsxs(S.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsxs(S.Row,{alignItems:"center",gap:2,children:[jsx(ei,{checked:e}),jsx(w.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(g,{as:Lt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var _t=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function zt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var F,v,T,B,P,C;let{$state:{blocked:a,completed:l,skipped:p},subtitle:d,title:m}=r,u=(v=(F=r.primaryButton)==null?void 0:F.title)!=null?v:r.primaryButtonTitle,y=(B=(T=r.secondaryButton)==null?void 0:T.title)!=null?B:r.secondaryButtonTitle,h=(P=r.props)!=null?P:{},x=!!a;return jsxs(Bo,s(i({open:t,onOpenChange:n},h),{children:[jsx(To,{isBlocked:r.$state.blocked,isCompleted:l||p,title:m}),jsxs(Ro,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(C=r.videoUri)!=null?C:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:d}),jsxs(S.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:y,onClick:o}),jsx(b.Primary,{disabled:x,title:u,onClick:e})]})]})]}))}var ni={default:zt};function ii(n){var r=n,{flow:e,step:o}=r,t=f(r,["flow","step"]);var v;let{onPrimary:a,onSecondary:l,openStepId:p,setOpenStepId:d,stepTypes:m}=useContext(_t),{handlePrimary:u,handleSecondary:y}=ne(o,{onPrimary:a,onSecondary:l}),h=(p!=null?p:e.getCurrentStep().id)===o.id,x=(v=m[o.type])!=null?v:zt;function F(T){return $(this,null,function*(){d(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(x,s(i({flow:e,onOpenChange:F,open:h,step:o},t),{handlePrimary:u,handleSecondary:y}),o.id)}function Qe(p){var d=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=d,l=f(d,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[m,u]=useState(null),y=i(i({},ni),a);return jsx(_t.Provider,{value:{openStepId:m,setOpenStepId:u,onPrimary:t,onSecondary:n,stepTypes:y},children:jsx(z,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},l),{children:v=>{var T=v,{flow:h,handleDismiss:x}=T,F=f(T,["flow","handleDismiss"]);let P=Array.from(h.steps.entries()).filter(([,E])=>E.$state.visible===!0).map(([,E])=>jsx(ii,s(i({flow:h,handleDismiss:x},F),{step:E}),E.id)),C=h.getNumberOfCompletedSteps(),R=h.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(S.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:x,part:"checklist-header",subtitle:h.subtitle,title:h.title}),jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxs(w.Body2,{fontWeight:"demibold",children:[C,"/",R]}),jsx(Se,{current:C,total:R,flexGrow:1})]})]}),P]})}}))})}var fi=new Set(["required","min","max","minLength","maxLength","pattern"]);function gi({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=useFormContext();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 a=Object.fromEntries(Object.entries(t).filter(([p])=>fi.has(p))),l=useController({name:t.id,control:o,rules:a});return jsx(e,s(i({},l),{fieldData:t,formContext:r,submit:n}))}function Gt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var C,R,E,L,A,O;let{__readOnly:l}=useContext(N),p=((C=a.fields)!=null?C:[]).filter(I=>e[I.type]!=null&&I.id),d=useForm({delayError:2e3,mode:"onChange",defaultValues:p.reduce((I,_)=>{var J;return I[_.id]=(J=_.value)!=null?J:"",I},{})}),[m,u]=useState(!1),y=[],{control:h,handleSubmit:x}=d,F=(R=a.props)!=null?R:{};function v(I,_){u(!0),t(_,I,l===!0).then(()=>u(!1));}p.forEach(I=>{e[I.type]!=null&&y.push(jsx(gi,{control:h,fieldComponent:e[I.type],fieldData:I,submit:x(v)},`${a.flow.id}-${I.id}`));});let T=(L=(E=a.primaryButton)==null?void 0:E.title)!=null?L:a.primaryButtonTitle,B=(O=(A=a.secondaryButton)==null?void 0:A.title)!=null?O:a.secondaryButtonTitle,P=!!(a.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[a]),jsxs(S.Column,s(i({gap:5,part:"form-step"},F),{children:[jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,s(i({},d),{children:y})),jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsx(D.Secondary,{onClick:n,title:B}),jsx(D.Primary,{disabled:P||m,onClick:x(v),title:T!=null?T:"Submit",loading:m})]},`form-footer-${a.id}`)]}))}function Kt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(w.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function ko({children:e,id:o,required:t=!1}){return jsxs(w.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Eo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},We=s(i({},Eo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),oo={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function Q({children:e,field:o,fieldData:t,fieldState:n}){var m;let{id:r,label:a,placeholder:l}=t,{error:p}=n,d=s(i(i(i({id:r},o),l?{placeholder:l}:{}),We),{"aria-invalid":!!p,value:(m=o.value)!=null?m:""});return jsxs(g,{part:"field",children:[jsx(ko,{id:r,required:!!t.required,children:a}),e(d),jsx(Kt,{error:p})]})}function Be(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var Pi=So.forwardRef(({label:e,value:o},t)=>jsxs(g,{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:[jsx(w.Body2,{part:"field-radio-label",children:e}),jsx(Te.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(g,{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:jsx(g,s(i({as:Te.Indicator},oo),{children:jsx(Be,{height:"14",width:"14"})}))})})]}));function Do(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:l})=>jsx(Pi,{value:l,label:a},l));return jsx(Q,s(i({},e),{children:()=>jsx(Te.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Zt(e){return jsx("svg",s(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function Qt(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=So.useState([]);function l(p){let d=[];r.includes(p)?d=[...r.filter(m=>m!==p)]:d=[...r,p],a(d),o(d);}return jsx(Q,s(i({},e),{children:()=>jsx(S.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:p,value:d})=>jsx(to.Root,{value:r.includes(d)?d:void 0,onCheckedChange:()=>l(d),asChild:!0,children:jsxs(g,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsx(w.Body2,{part:"field-check-label",children:p}),jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(to.Indicator,{asChild:!0,children:jsx(g,s(i({},oo),{children:jsx(Be,{height:"14",width:"14"})}))})})]})},d))})}))}var wi=So.forwardRef(({label:e,value:o},t)=>jsx(W.Item,{value:o,ref:t,asChild:!0,children:jsx(g,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(W.ItemText,{asChild:!0,children:jsx(w.Body2,{part:"field-select-option-label",children:e})})})}));function Oo(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:l,value:p})=>jsx(wi,{value:p,label:l},p));return e.fieldData.multiple?jsx(Qt,i({},e)):jsx(Q,s(i({},e),{children:()=>jsxs(W.Root,{value:t,onValueChange:o,children:[jsx(W.Trigger,{asChild:!0,children:jsxs(w.Body2,s(i({},We),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(W.Value,{placeholder:r!=null?r:"Select one"}),jsx(W.Icon,{children:jsx(g,{as:Zt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(W.Portal,{children:jsx(W.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(g,s(i({},We),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(W.Viewport,{children:a})}))})})]})}))}function Io(e){return jsx(Q,s(i({},e),{children:o=>jsx(w.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Ho(e){return jsx(Q,s(i({},e),{children:o=>jsx(w.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function nr(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(to.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(g,s(i({},Eo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsx(to.Indicator,{asChild:!0,children:jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Be,{height:"14",fill:"currentColor"})})})}))}),jsx(w.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var vi={checkbox:nr,radio:Do,select:Oo,text:Io,textarea:Ho};function Ee(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=f(a,["fieldTypes","flowId","part"]);let l=Object.assign({},vi,e);return jsx(z,s(i({flowId:o,part:["form",t]},n),{children:p=>jsx(Gt,i({fieldTypes:l},p))}))}var io={};oe(io,{NPS:()=>Le});function sr({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((l,p)=>{let d=e.value===p?D.Primary:D.Secondary;return jsx(d,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});return jsxs(S.Column,{gap:2,children:[jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(w.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(w.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Le(a){var l=a,{as:e=H,flowId:o,fieldTypes:t,part:n}=l,r=f(l,["as","flowId","fieldTypes","part"]);let{flow:p}=xe(o);return jsx(Ee,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:sr},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||p.skip();},part:["nps",n],css:s(i({},!p||p.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function Ti(r,n){var a=r,{children:e,part:o}=a,t=f(a,["children","part"]);return jsx(RemoveScroll,{forwardProps:!0,ref:n,children:jsx(g,s(i({backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",o],position:"absolute"},t),{children:e}))})}var ao=So.forwardRef(Ti);var Ei=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function cr(t){var n=t,{part:e=""}=n,o=f(n,["part"]);return jsxs(g,s(i({borderRadius:"24px",height:"24px",part:`ping-wrapper ${e}`,position:"relative",width:"24px"},o),{children:[jsx(g,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${Ei}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(g,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px"})]}))}function Mi({maxX:e,maxY:o,radius:t,x1:n,x2:r,y1:a,y2:l}){return t>0?`path("${[`M${n+t},${a}`,`H${r-t}`,`A${t} ${t} 0,0,1 ${r} ${a+t}`,`V${l-t}`,`A${t} ${t} 0,0,1 ${r-t} ${l}`,`H${n+t}`,`A${t} ${t} 0,0,1 ${n} ${l-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${n}`,`V${a+t}`,`A${t} ${t} 0,0,1 ${n+t} ${a}`,"Z"].join(" ")}")`:`path("M${n},${a} H${r} V${l} H${n} V${o} H${e} V0 H0 V${o} H${n} Z")`}function Ai(e){if(!window||!("nodeType"in e))return 0;let o=Number(window.getComputedStyle(e).borderRadius.replace(/\D/g,""));return Number.isNaN(o)?0:o}function $o(r){var a=r,{anchor:e,part:o,style:t={}}=a,n=f(a,["anchor","part","style"]);let[l,p]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:d}=useFloating({middleware:[{name:"clipPath",fn({elements:m,rects:u}){return p({maxX:m.floating.clientWidth,maxY:m.floating.clientHeight,radius:Ai(m.reference),x1:u.reference.x,x2:u.reference.x+u.reference.width,y1:u.reference.y,y2:u.reference.y+u.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{let m=document.querySelector(e);m!=null?d.setReference(m):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);},[e]),jsx(ao,i({part:["spotlight",o],ref:d.setFloating,style:i({clipPath:Mi(l)},t)},n))}function mr({align:e,side:o}){let t={},n="-12px",r={top:"bottom",right:"left",bottom:"top",left:"right"};return t[r[o]]=n,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=n:t.bottom=n:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=n:t.top=n:["top","bottom"].includes(o)?t.left=`calc(50% + ${n})`:t.top=`calc(50% + ${n})`,t}function Ji(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function ur({align:e,alignOffset:o,anchor:t,onOpenChange:n=()=>{},open:r,side:a,sideOffset:l}){let p=`${a}-${Ji(e)}`;function d({rects:C}){let R={alignmentAxis:o,mainAxis:l};return ["after","before"].includes(e)&&(["bottom","top"].includes(a)?R.alignmentAxis=o-C.floating.width:R.alignmentAxis=o-C.floating.height),R}let{context:m,floatingStyles:u,placement:y,refs:h}=useFloating({middleware:[offset(d),flip(),shift()],onOpenChange:n,open:r,placement:p,whileElementsMounted:autoUpdate}),x=useClick(m),F=useDismiss(m,{outsidePress:!1}),v=useRole(m),{getFloatingProps:T,getReferenceProps:B}=useInteractions([x,F,v]);useEffect(()=>{let C=document.querySelector(t);C!=null?h.setReference(C):console.debug(`[frigade] Hint: No anchor found for selector: ${t}`);},[t]);let P=y.split("-");return e==="before"?P[1]=P[1]==="end"?"after":"before":e==="after"&&(P[1]=P[1]==="start"?"before":"after"),{context:m,getFloatingProps:T,getReferenceProps:B,floatingStyles:u,placement:P.join("-"),refs:h}}function Ao(F){var v=F,{align:e="center",alignOffset:o=0,anchor:t,children:n,defaultOpen:r=!0,modal:a=!1,onOpenChange:l=()=>{},open:p,part:d,side:m="bottom",sideOffset:u=0,spotlight:y=!1,style:h={}}=v,x=f(v,["align","alignOffset","anchor","children","defaultOpen","modal","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[T,B]=useState(r),P=p!=null?p:T,{getFloatingProps:C,getReferenceProps:R,floatingStyles:E,placement:L,refs:A}=ur({align:e,alignOffset:o,anchor:t,onOpenChange:J=>{l(J),p==null&&B(J);},open:P,side:m,sideOffset:u}),[O,I]=L.split("-"),_=R();return jsxs(Fragment,{children:[y&&P&&jsx($o,{anchor:t}),a&&!y&&P&&jsx(ao,{lockScroll:!0}),jsxs(g,s(i(i({part:["hint",d],ref:A.setFloating,style:i(i({},E),h)},C()),x),{children:[P&&n,jsx(cr,s(i({},_),{position:"absolute",style:mr({align:I,side:O})}))]}))]})}var Qi=keyframes`
|
|
47
50
|
from {
|
|
48
51
|
opacity: 0;
|
|
49
52
|
}
|
|
@@ -53,7 +56,7 @@ var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnProp
|
|
|
53
56
|
to {
|
|
54
57
|
opacity: 1;
|
|
55
58
|
}
|
|
56
|
-
`;function ir(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(l){var d=l,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=d,a=m(d,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:f}=to(),{node:y,rect:x,ref:h}=to(),ra=rr(a,u),{contentProps:w,otherProps:wr}=ra,Ao=wr,{part:k}=Ao,B=m(Ao,["part"]),{rootProps:F}=ra,[C,v]=useState(w.align),[T,D]=useState(w.side),[U,I]=useState(0),[j,A]=useState(0);if(c!==null){let q=c.getAttribute("data-align"),ce=c.getAttribute("data-side");C!==q&&v(q),T!==ce&&D(ce);}let J=useRef(null);if(useEffect(()=>{let q=document.querySelector(e);q!=null?(h(q),J.current=q):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function q(be){if(be.matches(e))return ir(be)?be:null;let ue=be.querySelectorAll(e);return ue.length>0&&ir(ue[0])?ue[0]:null}let ce=new MutationObserver(be=>{for(let ue of be)if(ue.type==="childList"){for(let Ee of ue.addedNodes){if(Ee.nodeType!==Node.ELEMENT_NODE)continue;let me=q(Ee);if(me!=null){h(me),J.current=me,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",me);break}}for(let Ee of ue.removedNodes){if(Ee.nodeType!==Node.ELEMENT_NODE)continue;let me=q(Ee);if(me!=null){h(null),J.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",me);break}}}});return ce.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ce.disconnect()},[]),useEffect(()=>{let{scrollX:q,scrollY:ce}=window;I(x.left+q),A(x.top+ce);},[x.left,x.top]),y==null)return null;let ke="0";typeof window!="undefined"&&(ke=window.getComputedStyle(y).borderRadius);let Sr=tr({props:a,alignAttr:C,sideAttr:T});return jsxs(ee.Root,s(i({defaultOpen:!0},F),{children:[jsx(ee.Anchor,{virtualRef:J}),jsx(ee.Portal,{children:jsxs(Fragment,{children:[n&&jsx(g,i({animation:`${nr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:ke,height:x.height,left:U,top:j,width:x.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsx(ee.Content,s(i({asChild:!0},w),{ref:f,children:jsxs(b,s(i({animation:`${nr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",k],pointerEvents:"auto",style:r},B),{children:[jsx(er,{style:Sr}),o]}))}))]})})]}))}$.Close=e=>jsx(ee.Close,{"aria-label":"Close",asChild:!0,children:jsx(E.Plain,s(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsx(de,i({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};$.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(E.Primary,i({title:o,onClick:e},t))};$.Progress=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(S.Body2,s(i({part:"progress"},o),{children:e}))};$.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsx(E.Secondary,i({title:o,onClick:e},t))};$.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(S.Body2,s(i({part:"subtitle"},o),{children:e}))};$.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(S.H4,s(i({part:"title"},o),{children:e}))};function ar(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:l}=u,d=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var F,C,v,T,D,U;let{handleDismiss:f}=xe(o,{onDismiss:t}),{handlePrimary:y,handleSecondary:x}=ne(l,{onPrimary:r,onSecondary:a}),h=(F=l.props)!=null?F:{},w=(v=(C=l.primaryButton)==null?void 0:C.title)!=null?v:l.primaryButtonTitle,k=(D=(T=l.secondaryButton)==null?void 0:T.title)!=null?D:l.secondaryButtonTitle,B=l.$state.blocked;return jsxs($,s(i(i({anchor:l.selector,collisionPadding:12,onOpenAutoFocus:I=>I.preventDefault(),onPointerDownOutside:I=>I.preventDefault(),onInteractOutside:I=>I.preventDefault()},d),h),{onEscapeKeyDown:I=>{typeof n=="function"&&n(I),I.defaultPrevented||f(I);},children:[e&&jsx($.Close,{onClick:f}),jsx($.Media,{src:(U=l.videoUri)!=null?U:l.imageUri,type:l.videoUri?"video":"image"}),jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsx($.Title,{children:l.title}),jsx($.Subtitle,{color:"neutral.400",children:l.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsx($.Secondary,{disabled:B,onClick:x,title:k}),jsx($.Primary,{disabled:B,onClick:y,title:w})]})]}),l.id)}var le=new Set;function Ve(e,o=!0){let t=useCallback(()=>{le.has(e==null?void 0:e.id)&&le.delete(e==null?void 0:e.id);},[le,o]),n=useCallback(()=>{o&&(e!=null&&e.isVisible)&&!le.has(e.id)&&le.add(e.id);},[le,o]);useEffect(()=>()=>{t();},[]),e!=null&&e.isVisible?n():t();let r=le.size>0?le.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||le.size==0:!0}}function Oo(a){var l=a,{flowId:e,onComplete:o,variables:t,part:n}=l,r=m(l,["flowId","onComplete","variables","part"]);useState(!1);let {flow:u}=ae(e,{variables:t});xe(u,{onComplete:o});let{isCurrentModal:f}=Ve(u);if(!(u!=null&&u.isVisible)||!f)return null;let y=u.getCurrentStep();return y==null||y.start(),jsx(ar,i({"data-flow-id":u.id,flow:u,part:["tour",n],step:y},r))}function sr(e){var u,f,y;let{frigade:o}=useContext(V),[,t]=useState(!1),n,r=useCallback(x=>{o.getCollection(e).then(()=>{x();});let h=()=>{clearTimeout(n),n=setTimeout(()=>{t(w=>!w),x();},100);};return o.onStateChange(h),()=>{o.removeStateChangeHandler(h);}},[e]),a=useSyncExternalStore(r,()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x},()=>{let x;try{x=o.getCollectionSync(e);}catch(h){}return x}),d=(y=((f=(u=a==null?void 0:a.flows)==null?void 0:u.map(x=>s(i({},x),{flow:o.getFlowSync(x.flowId)})))!=null?f:[]).find(({flow:x})=>x.isVisible))==null?void 0:y.flowId,{flow:c}=ae(d);return {collection:a,currentFlow:c}}function Io(n){var r=n,{collectionId:e,part:o}=r,t=m(r,["collectionId","part"]);var c,u,f;let a={ANNOUNCEMENT:Ho,BANNER:xo,CARD:b,CHECKLIST:Xe,EMBEDDED_TIP:b,FORM:Re,NPS_SURVEY:Le,SURVEY:Le,TOUR:Oo},{currentFlow:l}=sr(e),d=(u=a[(c=l==null?void 0:l.rawData)==null?void 0:c.flowType])!=null?u:null;return l==null||d==null?null:((f=l==null?void 0:l.rawData)==null?void 0:f.flowType)===FlowType.FORM?jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(Re,{flowId:l.id,as:O},l.id)})):jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(d,{flowId:l.id},l.id)}))}function $e(){let{frigade:e}=useContext(V);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function pr(){let[e,o]=useState(),{frigade:t}=$e();return useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(Io,{as:null,collectionId:e})}var V=createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function dr(){let{frigade:e}=$e();return useEffect(()=>{L(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var cr="2.4.28";function gr(l){var d=l,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=d,a=m(d,["children","css","defaultCollection","navigate","theme"]);let c=r?co(r):{},u=useRef(new Map),f=useRef(),[y,x]=useState(!1),h=useMemo(()=>(x(!1),f.current=void 0,new Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides,__platformVersion:cr,__platformName:"React"})),[a.userId,a.groupId,a.apiKey]);useEffect(()=>{if(a.__flowStateOverrides){let C=h.getConfig();C.__flowStateOverrides=a.__flowStateOverrides,h.reload(C);}},[a.__flowStateOverrides]);function w(){let C=[...u.current.entries()].map(([v,T])=>[v,T.callback]);h.batchRegister(C),x(!0);}function k(C,v){if(f.current&&clearTimeout(f.current),y){u.current.has(C)?h.getFlow(C).then(T=>v(T.isVisible)):(h.getFlow(C).then(T=>T.register(v)),u.current.set(C,{callback:v}));return}u.current.has(C)||u.current.set(C,{callback:v}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>w(),0);}function B(C){u.current.has(C)&&h.getFlow(C).then(v=>{u.current.delete(C),v==null||v.unregister();});}let F=n!=null?n:(C,v="_self")=>{window.open(C,v);};return useEffect(()=>()=>{h.destroy();},[]),jsxs(V.Provider,{value:s(i({navigate:F},a),{frigade:h,registerComponent:k,unregisterComponent:B,hasInitialized:y}),children:[jsx(Global,{styles:{":root":i(i(i({},uo),c),o)}}),jsxs(ThemeProvider,{theme:R,children:[t&&jsx(pr,{}),e]}),a.preloadImages!==!1&&jsx(dr,{})]})}function ae(e,o){let{frigade:t}=useContext(V),[,n]=useState(!1),r=useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let d=c=>{c.id===e&&setTimeout(()=>{n(u=>!u),l();},0);};return t==null||t.onStateChange(d),()=>{t.removeStateChangeHandler(d);}},[e]),a=useSyncExternalStore(r,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return a!=null&&(o!=null&&o.variables)&&a.applyVariables(o.variables),{flow:a,isLoading:t!=null&&t.hasFailedToLoad()?!1:!a}}function G(u){var f=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:l,variables:d}=f,c=m(f,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var j,J;let{flow:y}=ae(t,{variables:d}),A=i(i({},(j=y==null?void 0:y.props)!=null?j:{}),c),{dismissible:x=!1,forceMount:h=!1}=A,w=m(A,["dismissible","forceMount"]),k=y==null?void 0:y.getCurrentStep(),{handleDismiss:B}=xe(y,{onComplete:n,onDismiss:r}),{handlePrimary:F,handleSecondary:C}=ne(k,{onPrimary:a,onSecondary:l}),v=(w==null?void 0:w.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((J=y==null?void 0:y.rawData)==null?void 0:J.flowType),{isCurrentModal:T}=Ve(y,v),D=h&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!y.isVisible&&!D||!D&&!T)return null;(D||!y.isCompleted&&!y.isSkipped)&&k.start();let U=e===null?Fragment$1:e!=null?e:g,I=s(i({},w),{"data-flow-id":y.id});return jsx(U,s(i({},e===null?{}:I),{children:o({flow:y,handleDismiss:B,handlePrimary:F,handleSecondary:C,parentProps:{dismissible:x,flowId:t,variables:d,containerProps:I},step:k})}))}function hr(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsx(G,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:l,parentProps:{dismissible:d},step:c})=>{var y,x,h,w;let u=(x=(y=c.primaryButton)==null?void 0:y.title)!=null?x:c.primaryButtonTitle,f=(w=(h=c.secondaryButton)==null?void 0:h.title)!=null?w:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:d,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:f,onClick:l}),jsx(b.Primary,{title:u,onClick:a})]})]})}}))}var b=yo.forwardRef((r,n)=>{var a=r,{children:e,flowId:o}=a,t=m(a,["children","flowId"]);var d;if(o!=null)return jsx(hr,i({flowId:o},t));let l=(d=t.as)!=null?d:P.Column;return jsx(l,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});b.Dismiss=e=>jsx(E.Plain,s(i({part:"dismiss",padding:0},e),{children:jsx(Pe,{height:"20",fill:"currentColor"})}));b.Header=a=>{var l=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=l,r=m(l,["dismissible","handleDismiss","subtitle","title"]);return jsxs(P.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};b.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(de,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(E.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(E.Secondary,i({title:o,onClick:e},t))};b.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(S.Body2,s(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsx(S.H4,s(i({display:"block",part:"title"},o),{children:e}))};var so={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Pr(e){let o=Object.fromEntries(so.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(so.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!so.content.some(a=>a===r)&&!so.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var qi=keyframes`
|
|
59
|
+
`;function so({align:e,alignOffset:o,defaultOpen:t,dismissible:n,flow:r,handleDismiss:a,modal:l,onPrimary:p,onSecondary:d,part:m,side:u,sideOffset:y,spotlight:h,step:x}){var C,R,E,L,A;let{handlePrimary:F,handleSecondary:v}=ne(x,{onPrimary:p,onSecondary:d}),T=(R=(C=x.primaryButton)==null?void 0:C.title)!=null?R:x.primaryButtonTitle,B=(L=(E=x.secondaryButton)==null?void 0:E.title)!=null?L:x.secondaryButtonTitle,P=!!x.$state.blocked;return jsx(Ao,{align:e,alignOffset:o,anchor:x.selector,"data-step-id":x.id,defaultOpen:t,modal:l,part:m,side:u,sideOffset:y,spotlight:h,children:jsxs(b,{animation:`${Qi} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(b.Media,{aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(A=x.videoUri)!=null?A:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image"}),jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:a,subtitle:x.subtitle,title:x.title}),jsxs(b.Footer,{children:[r.getNumberOfAvailableSteps()>1&&jsx(Ze,{current:r.getCurrentStepOrder()+1,marginRight:"auto",total:r.getNumberOfAvailableSteps()}),jsx(b.Secondary,{disabled:P,onClick:v,title:B}),jsx(b.Primary,{disabled:P,onClick:F,title:T})]})]})})}function yr(e,o,t){let[n,r]=useState(!1),a=useRef();return useEffect(()=>{a.current=typeof o=="string"?document.querySelector(o):o,r(!0);},[]),n?createPortal(e,a.current,t):null}function lo(x){var F=x,{align:e="after",alignOffset:o=0,as:t,defaultOpen:n,dismissible:r=!1,flowId:a,modal:l,part:p,sequential:d=!0,side:m="bottom",sideOffset:u=0,spotlight:y}=F,h=f(F,["align","alignOffset","as","defaultOpen","dismissible","flowId","modal","part","sequential","side","sideOffset","spotlight"]);let{onDismiss:v,onPrimary:T,onSecondary:B}=h;return yr(jsx(z,s(i({as:t,css:i({".fr-hint":{zIndex:1},".fr-hint:has([aria-expanded=true])":{zIndex:3},".fr-overlay":{zIndex:2}},d?{}:{".fr-progress-fraction":{display:"none"}}),flowId:a,part:"tour"},h),{children:({flow:C,handleDismiss:R,step:E})=>{var A;let L=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:R,modal:l,onPrimary:T,onSecondary:B,part:p,side:m,sideOffset:u,spotlight:y,step:E},(A=E.props)!=null?A:{});return d?jsx(so,i({defaultOpen:n!=null?n:!0},L)):Array.from(C.steps.values()).filter(O=>{let{blocked:I,completed:_,skipped:J,visible:he}=O.$state;return !I&&!_&&!J&&he}).map(O=>{var he,Ue;function I(be){return $(this,null,function*(){return (yield v==null?void 0:v(C,be))===!1?(be.preventDefault(),!1):(O.skip(),!0)})}let _=y&&O.id===E.id,J=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:I,onPrimary:T,onSecondary:B,part:p,side:m,sideOffset:u,spotlight:y},(he=O.props)!=null?he:{});return jsx(so,i({defaultOpen:(Ue=n||_)!=null?Ue:!1,step:O},J),`${O.id}-${_}`)})}})),"body")}function xr(e){var m,u,y;let{frigade:o}=useContext(N),[,t]=useState(!1),n,r=useCallback(h=>{o==null||o.getCollection(e).then(()=>{h();});let x=()=>{clearTimeout(n),n=setTimeout(()=>{t(F=>!F),h();},100);};return o==null||o.onStateChange(x),()=>{o==null||o.removeStateChangeHandler(x);}},[e]),a=useSyncExternalStore(r,()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h},()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h}),p=(y=((u=(m=a==null?void 0:a.flows)==null?void 0:m.map(h=>s(i({},h),{flow:o==null?void 0:o.getFlowSync(h.flowId)})))!=null?u:[]).find(({flow:h})=>h.isVisible))==null?void 0:y.flowId,{flow:d}=xe(p);return {collection:a,currentFlow:d}}function Vo(n){var r=n,{collectionId:e,part:o}=r,t=f(r,["collectionId","part"]);var d,m,u;let a={ANNOUNCEMENT:Lo,BANNER:wo,CARD:b,CHECKLIST:Qe,EMBEDDED_TIP:b,FORM:Ee,NPS_SURVEY:Le,SURVEY:Le,TOUR:lo},{currentFlow:l}=xr(e),p=(m=a[(d=l==null?void 0:l.rawData)==null?void 0:d.flowType])!=null?m:null;return l==null||p==null?null:((u=l==null?void 0:l.rawData)==null?void 0:u.flowType)===FlowType.FORM?jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(Ee,{flowId:l.id,as:H},l.id)})):jsx(g,s(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(p,{flowId:l.id},l.id)}))}function Ne(){let{frigade:e}=useContext(N);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function hr(){let[e,o]=useState(),{frigade:t}=Ne();return useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(Vo,{as:null,collectionId:e})}var N=createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function br(){let{frigade:e}=Ne();return useEffect(()=>{$(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Pr="2.4.29";function Fr(l){var p=l,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=p,a=f(p,["children","css","defaultCollection","navigate","theme"]);let d=r?xo(r):{},m=useRef(new Map),u=useRef(),[y,h]=useState(!1),x=useMemo(()=>(h(!1),u.current=void 0,new Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides,__platformVersion:Pr,__platformName:"React"})),[a.userId,a.groupId,a.apiKey]);useEffect(()=>{if(a.__flowStateOverrides){let P=x.getConfig();P.__flowStateOverrides=a.__flowStateOverrides,x.reload(P);}},[a.__flowStateOverrides]);function F(){let P=[...m.current.entries()].map(([C,R])=>[C,R.callback]);x.batchRegister(P),h(!0);}function v(P,C){if(u.current&&clearTimeout(u.current),y){m.current.has(P)?x.getFlow(P).then(R=>C(R.isVisible)):(x.getFlow(P).then(R=>R.register(C)),m.current.set(P,{callback:C}));return}m.current.has(P)||m.current.set(P,{callback:C}),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>F(),0);}function T(P){m.current.has(P)&&x.getFlow(P).then(C=>{m.current.delete(P),C==null||C.unregister();});}let B=n!=null?n:(P,C="_self")=>{window.open(P,C);};return useEffect(()=>()=>{x.destroy();},[]),jsxs(N.Provider,{value:s(i({navigate:B},a),{frigade:x,registerComponent:v,unregisterComponent:T,hasInitialized:y}),children:[jsx(Global,{styles:{":root":i(i(i({},ho),d),o)}}),jsxs(ThemeProvider,{theme:k,children:[t&&jsx(hr,{}),e]}),a.preloadImages!==!1&&jsx(br,{})]})}function xe(e,o){let{frigade:t}=useContext(N),[,n]=useState(!1),r=useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let p=d=>{d.id===e&&setTimeout(()=>{n(m=>!m),l();},0);};return t==null||t.onStateChange(p),()=>{t==null||t.removeStateChangeHandler(p);}},[e]),a=useSyncExternalStore(r,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return a!=null&&(o!=null&&o.variables)&&a.applyVariables(o.variables),{flow:a,isLoading:t!=null&&t.hasFailedToLoad()?!1:!a}}function _o(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&$(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(r=>$(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}var ae=new Set;function zo(e,o=!0){let t=useCallback(()=>{ae.has(e==null?void 0:e.id)&&ae.delete(e==null?void 0:e.id);},[ae,o]),n=useCallback(()=>{o&&(e!=null&&e.isVisible)&&!ae.has(e.id)&&ae.add(e.id);},[ae,o]);useEffect(()=>()=>{t();},[]),e!=null&&e.isVisible?n():t();let r=ae.size>0?ae.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||ae.size==0:!0}}function z(m){var u=m,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:l,variables:p}=u,d=f(u,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var O,_;let{flow:y}=xe(t,{variables:p}),I=i(i({},d),(O=y==null?void 0:y.props)!=null?O:{}),{dismissible:h=!1,forceMount:x=!1}=I,F=f(I,["dismissible","forceMount"]),v=y==null?void 0:y.getCurrentStep(),{handleDismiss:T}=_o(y,{onComplete:n,onDismiss:r}),{handlePrimary:B,handleSecondary:P}=ne(v,{onPrimary:a,onSecondary:l}),C=(F==null?void 0:F.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((_=y==null?void 0:y.rawData)==null?void 0:_.flowType),{isCurrentModal:R}=zo(y,C),E=x&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!y.isVisible&&!E||!E&&!R)return null;(E||!y.isCompleted&&!y.isSkipped)&&v.start();let L=e===null?Fragment$1:e!=null?e:g,A=s(i({},F),{"data-flow-id":y.id});return jsx(L,s(i({},e===null?{}:A),{children:o({flow:y,handleDismiss:T,handlePrimary:B,handleSecondary:P,parentProps:{dismissible:h,flowId:t,variables:p,containerProps:A},step:v})}))}function Tr(t){var n=t,{part:e}=n,o=f(n,["part"]);return jsx(z,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:l,parentProps:{dismissible:p},step:d})=>{var y,h,x,F;let m=(h=(y=d.primaryButton)==null?void 0:y.title)!=null?h:d.primaryButtonTitle,u=(F=(x=d.secondaryButton)==null?void 0:x.title)!=null?F:d.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:p,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsx(b.Media,{src:d.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:u,onClick:l}),jsx(b.Primary,{title:m,onClick:a})]})]})}}))}function co(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);return jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Oa(e){var o,t,n,r,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function mo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);let a=Oa(o);return a?jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsx(g,i({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 pe(n){var r=n,{src:e,type:o}=r,t=f(r,["src","type"]);return jsx(o==="video"?mo:co,i({src:e},t))}var b=So.forwardRef((a,r)=>{var l=a,{children:e,flowId:o,part:t}=l,n=f(l,["children","flowId","part"]);var d;if(o!=null)return jsx(Tr,i({flowId:o},n));let p=(d=n.as)!=null?d:S.Column;return jsx(p,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},n),{ref:r,children:e}))});b.Dismiss=e=>jsx(D.Plain,s(i({part:"dismiss",padding:0},e),{children:jsx(Ce,{height:"20",fill:"currentColor"})}));b.Footer=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return jsx(S.Row,s(i({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.Header=l=>{var p=l,{dismissible:e,handleDismiss:o,part:t,subtitle:n,title:r}=p,a=f(p,["dismissible","handleDismiss","part","subtitle","title"]);return jsxs(S.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},a),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};b.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(pe,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Secondary,i({title:o,onClick:e},t))};b.Subtitle=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsx(w.Body2,s(i({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsx(w.H4,s(i({display:"block",part:["title",o]},t),{children:e}))};var uo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Dr(e){let o=Object.fromEntries(uo.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(uo.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!uo.content.some(a=>a===r)&&!uo.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Ma=keyframes`
|
|
57
60
|
from {
|
|
58
61
|
opacity: 0;
|
|
59
62
|
}
|
|
@@ -63,8 +66,18 @@ var Vo=Object.defineProperty,Fr=Object.defineProperties;var vr=Object.getOwnProp
|
|
|
63
66
|
to {
|
|
64
67
|
opacity: 1;
|
|
65
68
|
}
|
|
66
|
-
`;function
|
|
69
|
+
`;function H(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=f(a,["children","className","modal"]);let{rootProps:l,contentProps:p,otherProps:u}=Dr(n),y=u,{zIndex:d}=y,m=f(y,["zIndex"]);return jsx(K.Root,s(i({defaultOpen:!0,modal:t},l),{children:jsx(K.Portal,{children:jsxs(g,{animation:`${Ma} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:d!=null?d:10,children:[t&&jsx(K.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(K.Content,s(i({asChild:!0,onOpenAutoFocus:h=>h.preventDefault(),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault()},p),{children:jsx(b,s(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}H.Dismiss=e=>jsx(K.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,s(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Ce,{height:"20",fill:"currentColor"})}))});H.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(K.Description,{asChild:!0,children:jsx(w.Body2,s(i({part:"subtitle"},o),{children:e}))})};H.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(pe,i({borderRadius:"md",src:e},o))};H.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(D.Primary,i({title:o,onClick:e},t))};H.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsx(g,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?k.colors.primary.surface:k.colors.neutral[700],part:e===r?"progress-dot-selected":"progress-dot"},r));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};H.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(D.Secondary,i({title:o,onClick:e},t))};H.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(K.Title,{asChild:!0,children:jsx(w.H4,s(i({part:"title"},o),{children:e}))})};H.displayName="Dialog";var Or=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Lo(n){var r=n,{flowId:e,part:o}=r,t=f(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([p])=>Or.some(d=>p===d))),l=Object.fromEntries(Object.entries(t).filter(([p])=>Or.indexOf(p)===-1));return jsx(z,s(i({as:null,flowId:e},a),{children:({flow:p,handleDismiss:d,handlePrimary:m,handleSecondary:u,parentProps:{containerProps:y,dismissible:h},step:x})=>{var P,C,R,E,L,A;let F=(P=x.props)!=null?P:{},v=(R=(C=x.primaryButton)==null?void 0:C.title)!=null?R:x.primaryButtonTitle,T=(L=(E=x.secondaryButton)==null?void 0:E.title)!=null?L:x.secondaryButtonTitle,B=x.$state.blocked;return jsx(H,s(i(i({part:["announcement",o],textAlign:"center"},y),l),{onEscapeKeyDown:O=>{if(t.dismissible===!1){O.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(O),O.defaultPrevented||d(O);},children:jsxs(S.Column,s(i({gap:5,part:"announcement-step"},F),{children:[h&&jsx(H.Dismiss,{onClick:d}),jsxs(S.Column,{gap:1,part:"announcement-header",children:[jsx(H.Title,{children:x.title}),jsx(H.Subtitle,{children:x.subtitle})]}),jsx(H.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(A=x.videoUri)!=null?A:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image",width:"100%"}),jsx(H.ProgressDots,{current:p.getCurrentStepIndex(),total:p.getNumberOfAvailableSteps()}),jsxs(S.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[T&&jsx(H.Secondary,{disabled:B,onClick:u,title:T}),v&&jsx(H.Primary,{disabled:B,onClick:m,title:v})]})]}))}))}}))}function fo(){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),a=useCallback(l=>{r(l);},[]);return useLayoutEffect(()=>{if(!n)return;let l=()=>{let p=n.getBoundingClientRect();t(p);};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[n]),{node:n,rect:o,ref:a}}var Na=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function $r(n){var r=n,{style:e={},part:o=""}=r,t=f(r,["style","part"]);return jsxs(g,s(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Na}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Mr({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},l="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};r[p[n]]=l;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=l:r.bottom=l:["after","start"].includes(d)?["top","bottom"].includes(n)?r.left=l:r.top=l:["top","bottom"].includes(n)?r.left=`calc(50% + ${l})`:r.top=`calc(50% + ${l})`,r}var go={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function Ar(e,o){var a,l,p,d,m;let t=Object.fromEntries(go.content.map(u=>[u,e[u]]).filter(u=>u[1]!==void 0)),n=Object.fromEntries(go.root.map(u=>[u,e[u]]).filter(u=>u[1]!==void 0)),r={};for(let u of Object.keys(e))!go.content.includes(u)&&!go.root.includes(u)&&(r[u]=e[u]);if(t.align=(a=t.align)!=null?a:"after",t.side=(l=t.side)!=null?l:"bottom",["before","after"].includes(t.align)){let u={after:"end",before:"start"},y=(B,P)=>["top","bottom"].includes(P)?B=="after"?"marginLeft":"marginRight":B=="after"?"marginTop":"marginBottom",h=(p=t.alignOffset)!=null?p:0,x=(d=t.style)!=null?d:{},F=(m=t.side)!=null?m:"bottom",v=t.align;t.style=s(i({},x),{[y(v,F)]:h});let T=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(T+h)*-1,t.align=u[v];}return {contentProps:t,otherProps:r,rootProps:n}}var Wr=keyframes`
|
|
70
|
+
from {
|
|
71
|
+
opacity: 0;
|
|
72
|
+
}
|
|
73
|
+
25% {
|
|
74
|
+
opacity: 0;
|
|
75
|
+
}
|
|
76
|
+
to {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
`;function Vr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function de(m){var u=m,{anchor:e,children:o,className:t,defaultOpen:n=!0,open:r,part:a,spotlight:l=!1,style:p={}}=u,d=f(u,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:y,rect:h,ref:x}=fo(),{node:F,rect:v,ref:T}=fo(),{contentProps:B,otherProps:P,rootProps:C}=Ar(d,h),[R,E]=useState(n),[L,A]=useState(B.align),[O,I]=useState(B.side),[_,J]=useState(0),[he,Ue]=useState(0);function be(){return r!=null?(console.log("OVERRIDE: ",r),r):(console.log("INTERNAL: ",R),R)}if(y!==null){let q=y.getAttribute("data-align"),ce=y.getAttribute("data-side");L!==q&&A(q),O!==ce&&I(ce);}let Oe=useRef(null);if(useEffect(()=>{let q=document.querySelector(e);q!=null?(T(q),Oe.current=q):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function q(Pe){if(Pe.matches(e))return Vr(Pe)?Pe:null;let me=Pe.querySelectorAll(e);return me.length>0&&Vr(me[0])?me[0]:null}let ce=new MutationObserver(Pe=>{for(let me of Pe)if(me.type==="childList"){for(let Ie of me.addedNodes){if(Ie.nodeType!==Node.ELEMENT_NODE)continue;let ue=q(Ie);if(ue!=null){T(ue),Oe.current=ue,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ue);break}}for(let Ie of me.removedNodes){if(Ie.nodeType!==Node.ELEMENT_NODE)continue;let ue=q(Ie);if(ue!=null){T(null),Oe.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ue);break}}}});return ce.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ce.disconnect()},[]),useEffect(()=>{let{scrollX:q,scrollY:ce}=window;J(v.left+q),Ue(v.top+ce);},[v.left,v.top]),F==null)return null;let jo="0";typeof window!="undefined"&&(jo=window.getComputedStyle(F).borderRadius);let Nr=Mr({props:d,alignAttr:L,sideAttr:O});return jsxs(ee.Root,s(i({defaultOpen:!0},C),{children:[jsx(ee.Anchor,{virtualRef:Oe}),jsx(ee.Portal,{children:jsxs(Fragment,{children:[l&&jsx(g,i({animation:`${Wr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:jo,height:v.height,left:_,top:he,width:v.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(ee.Content,s(i({},B),{ref:x,children:jsxs(Fragment,{children:[be()&&jsx(b,s(i({animation:`${Wr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",a],style:p},P),{children:o})),jsx($r,{onClick:()=>{E(()=>(typeof C.onOpenChange=="function"&&C.onOpenChange(!be()),!be()));},style:Nr})]})}),R)]})})]}))}de.Close=e=>jsx(ee.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,s(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Ce,{height:"20",fill:"currentColor"})}))});de.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(pe,i({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};de.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(D.Primary,i({title:o,onClick:e},t))};de.Progress=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(w.Body2,s(i({part:"progress"},o),{children:e}))};de.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(D.Secondary,i({title:o,onClick:e},t))};de.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(w.Body2,s(i({part:"subtitle"},o),{children:e}))};de.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(w.H4,s(i({part:"title"},o),{children:e}))};function Ka(){let{userId:e,frigade:o}=useContext(N);function t(r){return $(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return $(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function Xa(){var r;let{frigade:e}=useContext(N);function o(a){return $(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function t(a,l){return $(this,null,function*(){yield e.track(a,l);})}function n(a,l){return $(this,null,function*(){yield e.group(a,l);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
|
|
67
80
|
|
|
68
|
-
export {
|
|
81
|
+
export { Lo as Announcement, wo as Banner, Q as BaseField, g as Box, D as Button, b as Card, eo as Checklist, Vo as Collection, H as Dialog, S as Flex, z as Flow, Ee as Form, Ao as Hint, co as Image, ko as Label, pe as Media, we as Progress, Fr as Provider, Do as RadioField, Oo as SelectField, $o as Spotlight, io as Survey, w as Text, Io as TextField, Ho as TextareaField, de as Tooltip, lo as Tour, mo as Video, ho as themeVariables, je as tokens, fo as useBoundingClientRect, xe as useFlow, _o as useFlowHandlers, Ne as useFrigade, Xa as useGroup, zo as useModal, ne as useStepHandlers, Ka as useUser };
|
|
69
82
|
//# sourceMappingURL=out.js.map
|
|
70
83
|
//# sourceMappingURL=index.js.map
|