@frigade/react 2.2.8 → 2.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1346,6 +1346,10 @@ interface FlowPropsWithoutChildren extends BoxPropsWithoutChildren {
1346
1346
  * However, if the user does not match the Flow's targeting, the Flow will not be mounted.
1347
1347
  */
1348
1348
  forceMount?: boolean;
1349
+ /**
1350
+ * Register the Flow as a modal to prevent popup collisions (only one modal Flow will render at a time).
1351
+ */
1352
+ modal?: boolean;
1349
1353
  /**
1350
1354
  * Handler for when the Flow is completed.
1351
1355
  * If this function a promise that evaluates to `false`, the Flow will not be marked as completed.
@@ -1372,8 +1376,7 @@ interface FlowPropsWithoutChildren extends BoxPropsWithoutChildren {
1372
1376
  */
1373
1377
  variables?: Record<string, unknown>;
1374
1378
  /**
1375
- * Optional component type to wrap the child components in. Use the`as={Box}` component for inline placement or the `as={Dialog}` component for modal placement.
1376
- * If you want to wrap the Flow in a custom component (such as your own modal), you can pass the custom component here.
1379
+ * Optional component to wrap the child components in, e.g. `as={Dialog}` will render the Flow in a modal Dialog. Defaults to `Box`.
1377
1380
  */
1378
1381
  as?: React$1.ElementType;
1379
1382
  }
@@ -1423,7 +1426,7 @@ declare namespace Dialog {
1423
1426
  var displayName: string;
1424
1427
  }
1425
1428
 
1426
- declare function Flow({ as, children, dismissible, flowId, onComplete, onDismiss, onPrimary, onSecondary, variables, forceMount, ...props }: FlowProps): _emotion_react_jsx_runtime.JSX.Element;
1429
+ declare function Flow({ as, children, flowId, onComplete, onDismiss, onPrimary, onSecondary, variables, ...props }: FlowProps): _emotion_react_jsx_runtime.JSX.Element;
1427
1430
 
1428
1431
  interface AnnouncementProps extends FlowPropsWithoutChildren, DialogProps {
1429
1432
  /**
package/dist/index.js CHANGED
@@ -1,32 +1,32 @@
1
1
  'use client';
2
2
  import { keyframes, Global, ThemeProvider } from '@emotion/react';
3
- import * as z from '@radix-ui/react-dialog';
3
+ import * as U from '@radix-ui/react-dialog';
4
4
  import { XMarkIcon } from '@heroicons/react/20/solid';
5
- import * as ro from 'react';
5
+ import * as io from 'react';
6
6
  import { createContext, useContext, useCallback, useState, useLayoutEffect, useRef, useEffect, useMemo, Fragment as Fragment$1 } from 'react';
7
7
  import { clsx } from 'clsx';
8
- import sr from 'known-css-properties';
9
- import yr from 'dompurify';
8
+ import pr from 'known-css-properties';
9
+ import br from 'dompurify';
10
10
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
11
- import { Frigade } from '@frigade/js';
11
+ import { Frigade, FlowType } from '@frigade/js';
12
12
  import * as js from '@frigade/js';
13
13
  export { js as FrigadeJS };
14
14
  import { ArrowLeftIcon, ArrowRightIcon, ChevronDownIcon, LockClosedIcon } from '@heroicons/react/24/outline';
15
- import ln from 'embla-carousel-react';
15
+ import dn from 'embla-carousel-react';
16
16
  import * as be from '@radix-ui/react-collapsible';
17
17
  import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
18
18
  import * as Pe from '@radix-ui/react-radio-group';
19
- import * as V from '@radix-ui/react-select';
20
- import * as Q from '@radix-ui/react-popover';
19
+ import * as N from '@radix-ui/react-select';
20
+ import * as Z from '@radix-ui/react-popover';
21
21
 
22
- var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnPropertyDescriptors;var We=Object.getOwnPropertySymbols;var Ro=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable;var Bo=(e,o,t)=>o in e?vo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Ro.call(o,t)&&Bo(e,t,o[t]);if(We)for(var t of We(o))ko.call(o,t)&&Bo(e,t,o[t]);return e},d=(e,o)=>er(e,or(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 r in e)Ro.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&We)for(var r of We(e))o.indexOf(r)<0&&ko.call(e,r)&&(t[r]=e[r]);return t};var Z=(e,o)=>{for(var t in o)vo(e,t,{get:o[t],enumerable:!0});};var H=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{p(t.next(c));}catch(u){n(u);}},s=c=>{try{p(t.throw(c));}catch(u){n(u);}},p=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);p((t=t.apply(e,o)).next());});var Do={borderWidths:{md:"1px"}};var Le=[5,10,20,35,50,65,80,95,98],Eo=[...Le],Ye=[...Le];Eo[4]=40;Ye[4]=60;var rr={blue:{h:213,s:100,l:Le},gray:{h:220,s:10,l:Le},green:{h:141,s:90,l:Eo},red:{h:9,s:90,l:Ye},yellow:{h:50,s:90,l:Ye}};var W={};for(let[e,{h:o,s:t,l:r}]of Object.entries(rr))W[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Oo=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},W),{gray100:W.gray[100],gray200:W.gray[200],gray300:W.gray[300],gray400:W.gray[400],gray500:W.gray[500],gray600:W.gray[600],gray700:W.gray[700],gray800:W.gray[800],gray900:W.gray[900],blue400:W.blue[400],blue500:W.blue[500],blue800:W.blue[800],blue900:W.blue[900],green400:W.blue[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Io={md:"8px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Ho={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var Mo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var nr="px",ir=e=>typeof e=="number"?`${4*e}${nr}`:e,ar=[-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"],Wo=Object.fromEntries(ar.map(e=>[e,ir(e)]));var Lo={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 Ae=d(a(d(a({},Do),{colors:a(a({},Oo),Ho)}),Lo),{radii:Io,shadows:Mo,space:Wo});function we(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,we(p,s,t)):r[s]=p,r},{})}function Qe(e){let o=we(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function Ao(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=Ao(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var Ze=Qe(Ae),T=Ao(Ae);var lr=new Set(["alt","size","src"]),pr=sr.all.filter(e=>e.indexOf("-")!=0&&!lr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),dr=Object.fromEntries(pr),$e=we(T.colors),cr={color:$e,backgroundColor:$e,borderColor:$e,border:a(a({},T.borderWidths),$e),borderRadius:T.radii,borderWidth:T.borderWidths,boxShadow:T.shadows,fontFamily:T.fontFamilies,fontSize:T.fontSizes,fontWeight:T.fontWeights,gap:T.space,lineHeight:T.lineHeights,margin:T.space,marginBottom:T.space,marginLeft:T.space,marginRight:T.space,marginTop:T.space,padding:T.space,paddingBottom:T.space,paddingLeft:T.space,paddingRight:T.space,paddingTop:T.space},$o=a(a({},dr),cr),No={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"]},Vo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function ur(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 _o=new Map(Object.entries($o).map(([e,o])=>[e,ur(o)])),mr=new Map(Object.entries(No).map(([e,o])=>[e,new Set(o)])),fr=new Set(["height","width"]),gr=new Set(["canvas","embed","iframe","img","input","object","video"]);function zo(e){let[o,t]=e.split(":");return [o,Vo.has(t)?t:null]}function Ko(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let p=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[p]==null&&(r[p]={}),r[p]}return Object.entries(t).forEach(([i,s])=>{let[p,c]=zo(i),u=mr.get(p);u!=null&&(u.forEach(f=>{let P=`${f}${c?":"+c:""}`;t[P]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[p,c]=zo(i),u=_o.get(p);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(c)[p]=f.map(P=>{var x;return (x=u.get(P.toString()))!=null?x:P}).join(" ");}else u.has(s.toString())?n(c)[p]=u.get(s.toString()):n(c)[p]=s;(typeof o!="string"||!gr.has(o)||!fr.has(p))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&_o.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function xr(){if(typeof window=="undefined"){let{JSDOM:e}=tr("jsdom");return new e("<!DOCTYPE html>").window}return window}function Uo(e){return e?{__html:yr(xr()).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"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function hr(e){return e&&`fr-${e}`}function Jo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Jo(o)).join(" "):hr(e))}function Pr(p,s){var c=p,{as:e,children:o,className:t,css:r={},part:n}=c,i=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:f,unmatchedProps:P}=Ko(i,u),x=Jo(n),h=t||x?clsx(t,x):void 0,F=[{boxSizing:"border-box"},f,r];return typeof o=="string"?jsx(u,d(a({className:h,css:F},P),{ref:s,dangerouslySetInnerHTML:Uo(o)})):jsx(u,d(a({className:h,css:F},P),{ref:s,children:o}))}var g=ro.forwardRef(Pr);var D={};Z(D,{Link:()=>Xr,Plain:()=>qr,Primary:()=>Gr,Secondary:()=>Jr});var S={};Z(S,{Body1:()=>Lr,Body2:()=>Ar,Caption:()=>$r,Display1:()=>Er,Display2:()=>Or,H1:()=>Ir,H2:()=>Hr,H3:()=>Mr,H4:()=>Wr});var eo={};Z(eo,{Body1:()=>vr,Body2:()=>Rr,Caption:()=>kr,Display1:()=>Cr,Display2:()=>Sr,H1:()=>Fr,H2:()=>wr,H3:()=>Tr,H4:()=>Br});var ee={color:"neutral.foreground",fontFamily:"default",margin:"0"},Cr=d(a({},ee),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Sr=d(a({},ee),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Fr=d(a({},ee),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),wr=d(a({},ee),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Tr=d(a({},ee),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Br=d(a({},ee),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),vr=d(a({},ee),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Rr=d(a({},ee),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),kr=d(a({},ee),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Dr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],oe=Object.fromEntries(Dr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ro.forwardRef((p,s)=>{var c=p,{as:r=o,children:n}=c,i=m(c,["as","children"]);return jsx(g,d(a(a({as:r},eo[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Er=oe.Display1,Or=oe.Display2,Ir=oe.H1,Hr=oe.H2,Mr=oe.H3,Wr=oe.H4,Lr=oe.Body1,Ar=oe.Body2,$r=oe.Caption;var to={};Z(to,{Link:()=>Kr,Plain:()=>Ur,Primary:()=>_r,Secondary:()=>zr,loadingCSSStyle:()=>oo});var Ne={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},_r=d(a({},Ne),{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"}),zr=d(a({},Ne),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Kr=d(a({},Ne),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Ur=d(a({},Ne),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),jr=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),oo={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:jr+" 1s ease infinite"}};function Ve(s){var p=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=p,i=m(p,["as","children","part","title","variant"]);var u;let c=n.toLocaleLowerCase();return jsxs(g,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},to[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?oo:{})}),i),{loading:void 0,children:[o,r&&jsx(S.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Gr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsx(Ve,d(a({},o),{variant:"Primary",children:e}))}function Jr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsx(Ve,d(a({},o),{variant:"Secondary",children:e}))}function Xr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsx(Ve,d(a({},o),{variant:"Link",children:e}))}function qr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsx(Ve,d(a({},o),{variant:"Plain",children:e}))}var C={};Z(C,{Column:()=>Zr,Row:()=>Qr});var Qr=ro.forwardRef((e,o)=>jsx(g,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),Zr=ro.forwardRef((e,o)=>jsx(g,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function no(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=m(i,["dismissible","flowId","part"]);return jsx(K,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:p,handleSecondary:c,parentProps:{containerProps:u},step:f})=>{var y,B,E,v,I;let P=(y=f.props)!=null?y:{},x=(E=(B=f.primaryButton)==null?void 0:B.title)!=null?E:f.primaryButtonTitle,h=(I=(v=f.secondaryButton)==null?void 0:v.title)!=null?I:f.secondaryButtonTitle,F=!!f.$state.blocked;return jsxs(b,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),P),{children:[f.imageUri&&jsx(g,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(C.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:F,title:h,onClick:c}),jsx(b.Primary,{disabled:F,title:x,onClick:p}),e&&jsx(b.Dismiss,{onClick:s})]}))}}))}var ze={};Z(ze,{Carousel:()=>lt,Collapsible:()=>_e,CollapsibleStep:()=>Re});var Be={};Z(Be,{Bar:()=>ye,Dots:()=>et,Segments:()=>tt});function ye(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsx(g,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function et(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,p)=>jsx(g,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?T.colors.blue500:T.colors.blue800},p));return jsx(g,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function tt(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);let i=[...Array(o)].map((s,p)=>jsx(g,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsx(C.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function en(){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 rt(t){var r=t,{checked:e=!1}=r,o=m(r,["checked"]);return jsx(g,d(a({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(en,{})})}))}function te(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(O),n={"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.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((i,s,p=!0)=>H(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,p)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,p),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((i,s)=>H(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function it({onPrimary:e,onSecondary:o,step:t}){var c,u;let{handlePrimary:r,handleSecondary:n}=te(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s}=t.$state,p=s||!i?jsx(rt,{checked:s,marginLeft:"auto"}):jsx(g,{as:LockClosedIcon,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:i,opacity:i?.5:1,children:[jsxs(C.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),p]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(C.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:s,onClick:n,title:(c=t.secondaryButton)==null?void 0:c.title}),jsx(b.Primary,{disabled:s||i,onClick:r,title:(u=t.primaryButton)==null?void 0:u.title})]})]})}var st=keyframes`
22
+ var ko=Object.defineProperty,tr=Object.defineProperties;var rr=Object.getOwnPropertyDescriptors;var Le=Object.getOwnPropertySymbols;var Do=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable;var Ro=(e,o,t)=>o in e?ko(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Do.call(o,t)&&Ro(e,t,o[t]);if(Le)for(var t of Le(o))Eo.call(o,t)&&Ro(e,t,o[t]);return e},d=(e,o)=>tr(e,rr(o));var nr=(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 r in e)Do.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Le)for(var r of Le(e))o.indexOf(r)<0&&Eo.call(e,r)&&(t[r]=e[r]);return t};var ee=(e,o)=>{for(var t in o)ko(e,t,{get:o[t],enumerable:!0});};var I=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{p(t.next(c));}catch(u){n(u);}},s=c=>{try{p(t.throw(c));}catch(u){n(u);}},p=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);p((t=t.apply(e,o)).next());});var Oo={borderWidths:{md:"1px"}};var $e=[5,10,20,35,50,65,80,95,98],Io=[...$e],Ze=[...$e];Io[4]=40;Ze[4]=60;var ir={blue:{h:213,s:100,l:$e},gray:{h:220,s:10,l:$e},green:{h:141,s:90,l:Io},red:{h:9,s:90,l:Ze},yellow:{h:50,s:90,l:Ze}};var W={};for(let[e,{h:o,s:t,l:r}]of Object.entries(ir))W[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Ho=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},W),{gray100:W.gray[100],gray200:W.gray[200],gray300:W.gray[300],gray400:W.gray[400],gray500:W.gray[500],gray600:W.gray[600],gray700:W.gray[700],gray800:W.gray[800],gray900:W.gray[900],blue400:W.blue[400],blue500:W.blue[500],blue800:W.blue[800],blue900:W.blue[900],green400:W.blue[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Mo={md:"8px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Wo={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var Ao={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var ar="px",sr=e=>typeof e=="number"?`${4*e}${ar}`:e,lr=[-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"],Lo=Object.fromEntries(lr.map(e=>[e,sr(e)]));var $o={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 Ne=d(a(d(a({},Oo),{colors:a(a({},Ho),Wo)}),$o),{radii:Mo,shadows:Ao,space:Lo});function Be(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,Be(p,s,t)):r[s]=p,r},{})}function eo(e){let o=Be(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function No(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=No(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var oo=eo(Ne),T=No(Ne);var dr=new Set(["alt","size","src"]),cr=pr.all.filter(e=>e.indexOf("-")!=0&&!dr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),ur=Object.fromEntries(cr),Ve=Be(T.colors),mr={color:Ve,backgroundColor:Ve,borderColor:Ve,border:a(a({},T.borderWidths),Ve),borderRadius:T.radii,borderWidth:T.borderWidths,boxShadow:T.shadows,fontFamily:T.fontFamilies,fontSize:T.fontSizes,fontWeight:T.fontWeights,gap:T.space,lineHeight:T.lineHeights,margin:T.space,marginBottom:T.space,marginLeft:T.space,marginRight:T.space,marginTop:T.space,padding:T.space,paddingBottom:T.space,paddingLeft:T.space,paddingRight:T.space,paddingTop:T.space},Vo=a(a({},ur),mr),_o={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"]},zo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function fr(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 Uo=new Map(Object.entries(Vo).map(([e,o])=>[e,fr(o)])),gr=new Map(Object.entries(_o).map(([e,o])=>[e,new Set(o)])),yr=new Set(["height","width"]),xr=new Set(["canvas","embed","iframe","img","input","object","video"]);function Ko(e){let[o,t]=e.split(":");return [o,zo.has(t)?t:null]}function jo(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let p=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[p]==null&&(r[p]={}),r[p]}return Object.entries(t).forEach(([i,s])=>{let[p,c]=Ko(i),u=gr.get(p);u!=null&&(u.forEach(g=>{let b=`${g}${c?":"+c:""}`;t[b]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[p,c]=Ko(i),u=Uo.get(p);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[p]=g.map(b=>{var x;return (x=u.get(b.toString()))!=null?x:b}).join(" ");}else u.has(s.toString())?n(c)[p]=u.get(s.toString()):n(c)[p]=s;(typeof o!="string"||!xr.has(o)||!yr.has(p))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&Uo.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function hr(){if(typeof window=="undefined"){let{JSDOM:e}=nr("jsdom");return new e("<!DOCTYPE html>").window}return window}function Go(e){return e?{__html:br(hr()).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"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Cr(e){return e&&`fr-${e}`}function qo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>qo(o)).join(" "):Cr(e))}function Sr(p,s){var c=p,{as:e,children:o,className:t,css:r={},part:n}=c,i=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:g,unmatchedProps:b}=jo(i,u),x=qo(n),f=t||x?clsx(t,x):void 0,F=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsx(u,d(a({className:f,css:F},b),{ref:s,dangerouslySetInnerHTML:Go(o)})):jsx(u,d(a({className:f,css:F},b),{ref:s,children:o}))}var y=io.forwardRef(Sr);var D={};ee(D,{Link:()=>Yr,Plain:()=>Qr,Primary:()=>Xr,Secondary:()=>qr});var C={};ee(C,{Body1:()=>$r,Body2:()=>Nr,Caption:()=>Vr,Display1:()=>Ir,Display2:()=>Hr,H1:()=>Mr,H2:()=>Wr,H3:()=>Ar,H4:()=>Lr});var to={};ee(to,{Body1:()=>kr,Body2:()=>Dr,Caption:()=>Er,Display1:()=>Fr,Display2:()=>wr,H1:()=>Tr,H2:()=>Br,H3:()=>vr,H4:()=>Rr});var oe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Fr=d(a({},oe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),wr=d(a({},oe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Tr=d(a({},oe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Br=d(a({},oe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),vr=d(a({},oe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Rr=d(a({},oe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),kr=d(a({},oe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Dr=d(a({},oe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Er=d(a({},oe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Or=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],te=Object.fromEntries(Or.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=io.forwardRef((p,s)=>{var c=p,{as:r=o,children:n}=c,i=m(c,["as","children"]);return jsx(y,d(a(a({as:r},to[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Ir=te.Display1,Hr=te.Display2,Mr=te.H1,Wr=te.H2,Ar=te.H3,Lr=te.H4,$r=te.Body1,Nr=te.Body2,Vr=te.Caption;var no={};ee(no,{Link:()=>jr,Plain:()=>Gr,Primary:()=>Ur,Secondary:()=>Kr,loadingCSSStyle:()=>ro});var _e={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Ur=d(a({},_e),{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"}),Kr=d(a({},_e),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),jr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Gr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Jr=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),ro={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:Jr+" 1s ease infinite"}};function ze(s){var p=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=p,i=m(p,["as","children","part","title","variant"]);var u;let c=n.toLocaleLowerCase();return jsxs(y,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},no[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?ro:{})}),i),{loading:void 0,children:[o,r&&jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Xr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsx(ze,d(a({},o),{variant:"Primary",children:e}))}function qr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsx(ze,d(a({},o),{variant:"Secondary",children:e}))}function Yr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsx(ze,d(a({},o),{variant:"Link",children:e}))}function Qr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsx(ze,d(a({},o),{variant:"Plain",children:e}))}var P={};ee(P,{Column:()=>on,Row:()=>en});var en=io.forwardRef((e,o)=>jsx(y,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),on=io.forwardRef((e,o)=>jsx(y,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function ao(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=m(i,["dismissible","flowId","part"]);return jsx(K,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:p,handleSecondary:c,parentProps:{containerProps:u},step:g})=>{var S,B,E,v,H;let b=(S=g.props)!=null?S:{},x=(E=(B=g.primaryButton)==null?void 0:B.title)!=null?E:g.primaryButtonTitle,f=(H=(v=g.secondaryButton)==null?void 0:v.title)!=null?H:g.secondaryButtonTitle,F=!!g.$state.blocked;return jsxs(h,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),b),{children:[g.imageUri&&jsx(y,{as:"img",part:"image",src:g.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:g.title}),jsx(h.Subtitle,{part:"subtitle",children:g.subtitle})]}),jsx(h.Secondary,{disabled:F,title:f,onClick:c}),jsx(h.Primary,{disabled:F,title:x,onClick:p}),e&&jsx(h.Dismiss,{onClick:s})]}))}}))}var Ke={};ee(Ke,{Carousel:()=>dt,Collapsible:()=>Ue,CollapsibleStep:()=>De});var Re={};ee(Re,{Bar:()=>ye,Dots:()=>tt,Segments:()=>nt});function ye(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsx(y,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function tt(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,p)=>jsx(y,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?T.colors.blue500:T.colors.blue800},p));return jsx(y,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function nt(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);let i=[...Array(o)].map((s,p)=>jsx(y,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsx(P.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function tn(){return jsx(y,{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 it(t){var r=t,{checked:e=!1}=r,o=m(r,["checked"]);return jsx(y,d(a({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(y,{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(tn,{})})}))}function re(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(O),n={"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.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((i,s,p=!0)=>I(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,p)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,p),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((i,s)=>I(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function st({onPrimary:e,onSecondary:o,step:t}){var c,u;let{handlePrimary:r,handleSecondary:n}=re(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s}=t.$state,p=s||!i?jsx(it,{checked:s,marginLeft:"auto"}):jsx(y,{as:LockClosedIcon,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(h,{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:i,opacity:i?.5:1,children:[jsxs(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(h.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),p]}),jsx(h.Title,{children:t.title}),jsx(h.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(h.Secondary,{disabled:s,onClick:n,title:(c=t.secondaryButton)==null?void 0:c.title}),jsx(h.Primary,{disabled:s||i,onClick:r,title:(u=t.primaryButton)==null?void 0:u.title})]})]})}var pt=keyframes`
23
23
  from {
24
24
  opacity: 0;
25
25
  }
26
26
  to {
27
27
  opacity: 1;
28
28
  }
29
- `;function lt(o){var e=m(o,[]);let[t,r]=ln({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step"}),[n,i]=useState(),[s,p]=useState();return useLayoutEffect(()=>{r&&(n==null&&i(r.canScrollNext()),s==null&&p(r.canScrollPrev()),r.on("select",()=>{i(r.canScrollNext()),p(r.canScrollPrev());}));},[r]),jsx(K,d(a({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:({flow:c})=>{let u=c.getNumberOfCompletedSteps(),f=c.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(C.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:T.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(C.Column,{part:"carousel-header-content",children:[jsx(S.H3,{children:c.title}),jsx(S.Body2,{color:"neutral.400",children:c.subtitle})]}),jsxs(C.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(S.Body2,{fontWeight:"demibold",part:"progress-text",children:[u,"/",f]}),jsx(ye,{current:u,total:f,minWidth:"200px"})]})]}),jsxs(g,{margin:`0 ${T.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:t,children:[jsx(C.Row,{gap:4,part:"carousel-content",children:Array.from(c.steps.values()).map(P=>jsx(it,{onPrimary:e.onPrimary,onSecondary:e.onSecondary,step:P},P.id))}),s&&jsx(C.Column,{animation:`${st} 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:()=>r.scrollPrev(),padding:"2",children:jsx(ArrowLeftIcon,{height:"24px",width:"24px"})})}),n&&jsx(C.Column,{animation:`${st} 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:()=>r.scrollNext(),padding:"2",children:jsx(ArrowRightIcon,{height:"24px",width:"24px"})})})]})]})}}))}var Re={};Z(Re,{Content:()=>so,Root:()=>lo,Trigger:()=>po});var cn=keyframes`
29
+ `;function dt(o){var e=m(o,[]);let[t,r]=dn({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step"}),[n,i]=useState(),[s,p]=useState();return useLayoutEffect(()=>{r&&(n==null&&i(r.canScrollNext()),s==null&&p(r.canScrollPrev()),r.on("select",()=>{i(r.canScrollNext()),p(r.canScrollPrev());}));},[r]),jsx(K,d(a({as:h,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:({flow:c})=>{let u=c.getNumberOfCompletedSteps(),g=c.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(P.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:T.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(P.Column,{part:"carousel-header-content",children:[jsx(C.H3,{children:c.title}),jsx(C.Body2,{color:"neutral.400",children:c.subtitle})]}),jsxs(P.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(C.Body2,{fontWeight:"demibold",part:"progress-text",children:[u,"/",g]}),jsx(ye,{current:u,total:g,minWidth:"200px"})]})]}),jsxs(y,{margin:`0 ${T.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:t,children:[jsx(P.Row,{gap:4,part:"carousel-content",children:Array.from(c.steps.values()).map(b=>jsx(st,{onPrimary:e.onPrimary,onSecondary:e.onSecondary,step:b},b.id))}),s&&jsx(P.Column,{animation:`${pt} 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:()=>r.scrollPrev(),padding:"2",children:jsx(ArrowLeftIcon,{height:"24px",width:"24px"})})}),n&&jsx(P.Column,{animation:`${pt} 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:()=>r.scrollNext(),padding:"2",children:jsx(ArrowRightIcon,{height:"24px",width:"24px"})})})]})]})}}))}var De={};ee(De,{Content:()=>po,Root:()=>co,Trigger:()=>uo});var mn=keyframes`
30
30
  from {
31
31
  height: 0;
32
32
  opacity: 0;
@@ -35,7 +35,7 @@ var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnProp
35
35
  height: var(--radix-collapsible-content-height);
36
36
  opacity: 1;
37
37
  }
38
- `,un=keyframes`
38
+ `,fn=keyframes`
39
39
  from {
40
40
  height: var(--radix-collapsible-content-height);
41
41
  opacity: 1;
@@ -44,7 +44,7 @@ var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnProp
44
44
  height: 0;
45
45
  opacity: 0;
46
46
  }
47
- `,mn=()=>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 fn({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(mn,{})})})}function so({children:e}){return jsx(be.Content,{asChild:!0,children:jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${cn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${un} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsx(g,{}),e]})})}function lo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=m(s,["children","disabled","onOpenChange","open"]);return jsx(be.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(b,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function po({isCompleted:e,isBlocked:o,title:t}){return jsx(be.Trigger,{asChild:!0,children:jsxs(C.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",children:[jsxs(C.Row,{alignItems:"center",gap:2,children:[jsx(fn,{checked:e}),jsx(S.Body2,{fontWeight:"demibold",userSelect:"none",children:t})]}),jsx(g,{as:ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var dt=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ct({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,F,y,B,E,v;let{$state:{blocked:i,completed:s},subtitle:p,title:c}=n,u=(F=(h=n.primaryButton)==null?void 0:h.title)!=null?F:n.primaryButtonTitle,f=(B=(y=n.secondaryButton)==null?void 0:y.title)!=null?B:n.secondaryButtonTitle,P=(E=n.props)!=null?E:{},x=!!(s||i);return jsxs(lo,d(a({open:t,onOpenChange:r},P),{children:[jsx(po,{isBlocked:n.$state.blocked,isCompleted:s,title:c}),jsxs(so,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",src:(v=n.videoUri)!=null?v:n.imageUri,type:n.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:p}),jsxs(C.Row,{gap:3,children:[jsx(b.Secondary,{disabled:x,title:f,onClick:o}),jsx(b.Primary,{disabled:x,title:u,onClick:e})]})]})]}))}var bn={default:ct};function hn(r){var n=r,{flow:e,step:o}=n,t=m(n,["flow","step"]);var y;let{onPrimary:i,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:u}=useContext(dt),{handlePrimary:f,handleSecondary:P}=te(o,{onPrimary:i,onSecondary:s}),x=(p!=null?p:e.getCurrentStep().id)===o.id,h=(y=u[o.type])!=null?y:ct;function F(B){return H(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(h,d(a({flow:e,onOpenChange:F,open:x,step:o},t),{handlePrimary:f,handleSecondary:P}),o.id)}function _e(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=useState(null),P=a(a({},bn),i);return jsx(dt.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:r,stepTypes:P},children:jsx(K,d(a({as:b,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:y=>{var B=y,{flow:x,handleDismiss:h}=B,F=m(B,["flow","handleDismiss"]);let v=Array.from(x.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsx(hn,d(a({flow:x,handleDismiss:h},F),{step:w}),w.id)),I=x.getNumberOfCompletedSteps(),L=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(C.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxs(S.Body2,{fontWeight:"demibold",children:[I,"/",L]}),jsx(ye,{current:I,total:L,flexGrow:1})]})]}),v]})}}))})}var vn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Rn({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=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 i=Object.fromEntries(Object.entries(t).filter(([p])=>vn.has(p))),s=useController({name:t.id,control:o,rules:i});return jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function mt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var v,I,L,w,R,k;let{__readOnly:s}=useContext(O),p=useForm({delayError:2e3,mode:"onChange"}),[c,u]=useState(!1),f=[],{control:P,handleSubmit:x}=p,h=(v=i.props)!=null?v:{};function F($,Ce){u(!0),t(Ce,$,s===!0).then(()=>u(!1));}(I=i.fields)==null||I.forEach($=>{e[$.type]!=null&&f.push(jsx(Rn,{control:P,fieldComponent:e[$.type],fieldData:$,submit:x(F)},`${i.flow.id}-${$.id}`));});let y=(w=(L=i.primaryButton)==null?void 0:L.title)!=null?w:i.primaryButtonTitle,B=(k=(R=i.secondaryButton)==null?void 0:R.title)!=null?k:i.secondaryButtonTitle,E=!!(i.$state.blocked||!p.formState.isValid);return jsxs(C.Column,d(a({gap:5,part:"form-step"},h),{children:[jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,d(a({},p),{children:f})),jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsx(D.Secondary,{disabled:E,onClick:r,title:B}),jsx(D.Primary,{disabled:E||c,onClick:x(F),title:y!=null?y:"Submit",loading:c})]},"form-footer")]}))}function ft({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 co({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 ke={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function re({children:e,field:o,fieldData:t,fieldState:r}){var u;let{id:n,label:i,placeholder:s}=t,{error:p}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),ke),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxs(g,{part:"field",children:[jsx(co,{id:n,required:!!t.required,children:i}),e(c),jsx(ft,{error:p})]})}var In=()=>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"})}),Hn=ro.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(Pe.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,{as:Pe.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(In,{})})})})]}));function uo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsx(Hn,{value:s,label:i},s));return jsx(re,d(a({},e),{children:()=>jsx(Pe.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Ln=ro.forwardRef(({label:e,value:o},t)=>jsx(V.Item,{value:o,ref:t,asChild:!0,children:jsx(g,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(V.ItemText,{asChild:!0,children:jsx(S.Body2,{part:"field-select-option-label",children:e})})})}));function mo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:p})=>jsx(Ln,{value:p,label:s},p));return jsx(re,d(a({},e),{children:()=>jsxs(V.Root,{value:t,onValueChange:o,children:[jsx(V.Trigger,{asChild:!0,children:jsxs(S.Body2,d(a({},ke),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(V.Value,{placeholder:n!=null?n:"Select one"}),jsx(V.Icon,{children:jsx(g,{as:ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(V.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(g,d(a({},ke),{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(V.Viewport,{children:i})}))})]})}))}function fo(e){return jsx(re,d(a({},e),{children:o=>jsx(S.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function St(e){return jsx(re,d(a({},e),{children:o=>jsx(S.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var An={radio:uo,select:mo,text:fo,textarea:St};function De(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=m(i,["fieldTypes","flowId","part"]);let s=Object.assign({},An,e);return jsx(K,d(a({flowId:o,part:["form",t]},r),{children:p=>jsx(mt,a({fieldTypes:s},p))}))}var je={};Z(je,{NPS:()=>Ue});function Tt({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,p)=>{let c=e.value===p?D.Primary:D.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});return jsxs(C.Column,{gap:2,children:[jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(S.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsx(S.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Ue(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=m(s,["as","flowId","fieldTypes","part"]);let{flow:p}=ce(o);return jsx(De,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Tt},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",r],css:d(a({},!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"}}})},n))}function ue(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&H(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>H(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Ge(){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),[r,n]=useState(null),i=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!r)return;let s=()=>{let p=r.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var jn=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Rt(r){var n=r,{style:e={},part:o=""}=n,t=m(n,["style","part"]);return jsxs(g,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${jn}`,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 go(r){var n=r,{part:e,src:o}=n,t=m(n,["part","src"]);return jsx(g,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Xn(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function yo(r){var n=r,{part:e,src:o}=n,t=m(n,["part","src"]);let i=Xn(o);return i?jsx(g,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsx(g,a({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 me(r){var n=r,{src:e,type:o}=n,t=m(n,["src","type"]);return jsx(o==="video"?yo:go,a({src:e},t))}function Dt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{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"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var Je={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Et(e,o){var i,s,p,c,u;let t=Object.fromEntries(Je.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(Je.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n={};for(let f of Object.keys(e))!Je.content.includes(f)&&!Je.root.includes(f)&&(n[f]=e[f]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},P=(E,v)=>["top","bottom"].includes(v)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(p=t.alignOffset)!=null?p:0,h=(c=t.style)!=null?c:{},F=(u=t.side)!=null?u:"bottom",y=t.align;t.style=d(a({},h),{[P(y,F)]:x});let B=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=f[y];}return {contentProps:t,otherProps:n,rootProps:r}}var Ot=keyframes`
47
+ `,gn=()=>jsx(y,{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 yn({checked:e=!1}){return jsx(y,{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(y,{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(gn,{})})})}function po({children:e}){return jsx(be.Content,{asChild:!0,children:jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${mn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${fn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsx(y,{}),e]})})}function co(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=m(s,["children","disabled","onOpenChange","open"]);return jsx(be.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(h,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function uo({isCompleted:e,isBlocked:o,title:t}){return jsx(be.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",children:[jsxs(P.Row,{alignItems:"center",gap:2,children:[jsx(yn,{checked:e}),jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",children:t})]}),jsx(y,{as:ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var ut=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function mt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var f,F,S,B,E,v;let{$state:{blocked:i,completed:s},subtitle:p,title:c}=n,u=(F=(f=n.primaryButton)==null?void 0:f.title)!=null?F:n.primaryButtonTitle,g=(B=(S=n.secondaryButton)==null?void 0:S.title)!=null?B:n.secondaryButtonTitle,b=(E=n.props)!=null?E:{},x=!!(s||i);return jsxs(co,d(a({open:t,onOpenChange:r},b),{children:[jsx(uo,{isBlocked:n.$state.blocked,isCompleted:s,title:c}),jsxs(po,{children:[jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(v=n.videoUri)!=null?v:n.imageUri,type:n.videoUri?"video":"image"}),jsx(h.Subtitle,{color:"neutral.400",children:p}),jsxs(P.Row,{gap:3,children:[jsx(h.Secondary,{disabled:x,title:g,onClick:o}),jsx(h.Primary,{disabled:x,title:u,onClick:e})]})]})]}))}var Pn={default:mt};function Cn(r){var n=r,{flow:e,step:o}=n,t=m(n,["flow","step"]);var S;let{onPrimary:i,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:u}=useContext(ut),{handlePrimary:g,handleSecondary:b}=re(o,{onPrimary:i,onSecondary:s}),x=(p!=null?p:e.getCurrentStep().id)===o.id,f=(S=u[o.type])!=null?S:mt;function F(B){return I(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(f,d(a({flow:e,onOpenChange:F,open:x,step:o},t),{handlePrimary:g,handleSecondary:b}),o.id)}function Ue(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,g]=useState(null),b=a(a({},Pn),i);return jsx(ut.Provider,{value:{openStepId:u,setOpenStepId:g,onPrimary:t,onSecondary:r,stepTypes:b},children:jsx(K,d(a({as:h,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:S=>{var B=S,{flow:x,handleDismiss:f}=B,F=m(B,["flow","handleDismiss"]);let v=Array.from(x.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsx(Cn,d(a({flow:x,handleDismiss:f},F),{step:w}),w.id)),H=x.getNumberOfCompletedSteps(),A=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(P.Column,{gap:2,children:[jsx(h.Header,{dismissible:e,handleDismiss:f,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxs(C.Body2,{fontWeight:"demibold",children:[H,"/",A]}),jsx(ye,{current:H,total:A,flexGrow:1})]})]}),v]})}}))})}var kn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Dn({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=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 i=Object.fromEntries(Object.entries(t).filter(([p])=>kn.has(p))),s=useController({name:t.id,control:o,rules:i});return jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function gt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var v,H,A,w,R,k;let{__readOnly:s}=useContext(O),p=useForm({delayError:2e3,mode:"onChange"}),[c,u]=useState(!1),g=[],{control:b,handleSubmit:x}=p,f=(v=i.props)!=null?v:{};function F(V,Ce){u(!0),t(Ce,V,s===!0).then(()=>u(!1));}(H=i.fields)==null||H.forEach(V=>{e[V.type]!=null&&g.push(jsx(Dn,{control:b,fieldComponent:e[V.type],fieldData:V,submit:x(F)},`${i.flow.id}-${V.id}`));});let S=(w=(A=i.primaryButton)==null?void 0:A.title)!=null?w:i.primaryButtonTitle,B=(k=(R=i.secondaryButton)==null?void 0:R.title)!=null?k:i.secondaryButtonTitle,E=!!(i.$state.blocked||!p.formState.isValid);return jsxs(P.Column,d(a({gap:5,part:"form-step"},f),{children:[jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,d(a({},p),{children:g})),jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsx(D.Secondary,{disabled:E,onClick:r,title:B}),jsx(D.Primary,{disabled:E||c,onClick:x(F),title:S!=null?S:"Submit",loading:c})]},"form-footer")]}))}function yt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function mo({children:e,id:o,required:t=!1}){return jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Ee={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ne({children:e,field:o,fieldData:t,fieldState:r}){var u;let{id:n,label:i,placeholder:s}=t,{error:p}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),Ee),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxs(y,{part:"field",children:[jsx(mo,{id:n,required:!!t.required,children:i}),e(c),jsx(yt,{error:p})]})}var Mn=()=>jsx(y,{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"})}),Wn=io.forwardRef(({label:e,value:o},t)=>jsxs(y,{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(C.Body2,{part:"field-radio-label",children:e}),jsx(Pe.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(y,{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(y,{as:Pe.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Mn,{})})})})]}));function fo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsx(Wn,{value:s,label:i},s));return jsx(ne,d(a({},e),{children:()=>jsx(Pe.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(P.Column,{gap:2,part:"field-radio-group",children:n})})}))}var $n=io.forwardRef(({label:e,value:o},t)=>jsx(N.Item,{value:o,ref:t,asChild:!0,children:jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(N.ItemText,{asChild:!0,children:jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function go(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:p})=>jsx($n,{value:p,label:s},p));return jsx(ne,d(a({},e),{children:()=>jsxs(N.Root,{value:t,onValueChange:o,children:[jsx(N.Trigger,{asChild:!0,children:jsxs(C.Body2,d(a({},Ee),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(N.Value,{placeholder:n!=null?n:"Select one"}),jsx(N.Icon,{children:jsx(y,{as:ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(N.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(y,d(a({},Ee),{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(N.Viewport,{children:i})}))})]})}))}function yo(e){return jsx(ne,d(a({},e),{children:o=>jsx(C.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function wt(e){return jsx(ne,d(a({},e),{children:o=>jsx(C.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var Nn={radio:fo,select:go,text:yo,textarea:wt};function Oe(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=m(i,["fieldTypes","flowId","part"]);let s=Object.assign({},Nn,e);return jsx(K,d(a({flowId:o,part:["form",t]},r),{children:p=>jsx(gt,a({fieldTypes:s},p))}))}var Je={};ee(Je,{NPS:()=>Ge});function vt({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,p)=>{let c=e.value===p?D.Primary:D.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});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:r}),jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(C.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsx(C.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Ge(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=m(s,["as","flowId","fieldTypes","part"]);let{flow:p}=ce(o);return jsx(Oe,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:vt},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",r],css:d(a({},!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"}}})},n))}function ue(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&I(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>I(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Xe(){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),[r,n]=useState(null),i=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!r)return;let s=()=>{let p=r.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var Jn=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Dt(r){var n=r,{style:e={},part:o=""}=n,t=m(n,["style","part"]);return jsxs(y,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Jn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function xo(r){var n=r,{part:e,src:o}=n,t=m(n,["part","src"]);return jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Yn(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function bo(r){var n=r,{part:e,src:o}=n,t=m(n,["part","src"]);let i=Yn(o);return i?jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsx(y,a({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 me(r){var n=r,{src:e,type:o}=n,t=m(n,["src","type"]);return jsx(o==="video"?bo:xo,a({src:e},t))}function Ot({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{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"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var qe={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function It(e,o){var i,s,p,c,u;let t=Object.fromEntries(qe.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(qe.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!qe.content.includes(g)&&!qe.root.includes(g)&&(n[g]=e[g]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},b=(E,v)=>["top","bottom"].includes(v)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(p=t.alignOffset)!=null?p:0,f=(c=t.style)!=null?c:{},F=(u=t.side)!=null?u:"bottom",S=t.align;t.style=d(a({},f),{[b(S,F)]:x});let B=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}var Ht=keyframes`
48
48
  from {
49
49
  opacity: 0;
50
50
  }
@@ -54,7 +54,7 @@ var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnProp
54
54
  to {
55
55
  opacity: 1;
56
56
  }
57
- `;function N(s){var p=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=p,i=m(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:f}=Ge(),{node:P,rect:x,ref:h}=Ge(),$i=Et(i,u),{contentProps:F,otherProps:Zt}=$i,To=Zt,{part:y}=To,B=m(To,["part"]),{rootProps:E}=$i,[v,I]=useState(F.align),[L,w]=useState(F.side),[R,k]=useState(0),[$,Ce]=useState(0);if(c!==null){let X=c.getAttribute("data-align"),ae=c.getAttribute("data-side");v!==X&&I(X),L!==ae&&w(ae);}let ie=useRef(null);if(useEffect(()=>{let X=document.querySelector(e);X!=null?(h(X),ie.current=X):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function X(Se){if(Se.matches(e))return Se;let ge=Se.querySelectorAll(e);return ge.length>0?ge[0]:null}let ae=new MutationObserver(Se=>{for(let ge of Se)if(ge.type==="childList"){for(let Fe of ge.addedNodes){if(Fe.nodeType!==Node.ELEMENT_NODE)continue;let se=X(Fe);if(se!=null){h(se),ie.current=se,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",se);break}}for(let Fe of ge.removedNodes){if(Fe.nodeType!==Node.ELEMENT_NODE)continue;let se=X(Fe);if(se!=null){h(null),ie.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",se);break}}}});return ae.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ae.disconnect()},[]),useEffect(()=>{let{scrollX:X,scrollY:ae}=window;k(x.left+X),Ce(x.top+ae);},[x.left,x.top]),P==null)return null;let He="0";typeof window!="undefined"&&(He=window.getComputedStyle(P).borderRadius);let Me=Dt({props:i,alignAttr:v,sideAttr:L});return jsxs(Q.Root,d(a({defaultOpen:!0},E),{children:[jsx(Q.Anchor,{virtualRef:ie}),jsx(Q.Portal,{children:jsxs(Fragment,{children:[r&&jsx(g,a({animation:`${Ot} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:He,height:x.height,left:R,top:$,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsx(Q.Content,d(a({asChild:!0},F),{ref:f,children:jsxs(b,d(a({animation:`${Ot} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},part:["tooltip",y],style:n},B),{children:[jsx(Rt,{style:Me}),o]}))}))]})})]}))}N.Close=e=>jsx(Q.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"20",fill:"currentColor"})}))});N.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null?null:jsx(me,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};N.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsx(D.Primary,a({title:o,onClick:e},t))};N.Progress=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(S.Body2,d(a({part:"progress"},o),{children:e}))};N.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,a({title:o,onClick:e},t))};N.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(S.Body2,d(a({part:"subtitle"},o),{children:e}))};N.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(S.H4,d(a({part:"title"},o),{children:e}))};function It(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=u,p=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,v,I,L,w,R;let{handleDismiss:f}=ue(o,{onDismiss:t}),{handlePrimary:P,handleSecondary:x}=te(s,{onPrimary:n,onSecondary:i}),h=(E=s.props)!=null?E:{},F=(I=(v=s.primaryButton)==null?void 0:v.title)!=null?I:s.primaryButtonTitle,y=(w=(L=s.secondaryButton)==null?void 0:L.title)!=null?w:s.secondaryButtonTitle,B=!!s.$state.blocked;return jsxs(N,d(a(a({anchor:s.selector,onOpenAutoFocus:k=>k.preventDefault(),onPointerDownOutside:k=>k.preventDefault(),onInteractOutside:k=>k.preventDefault()},p),h),{onEscapeKeyDown:k=>{typeof r=="function"&&r(k),k.defaultPrevented||f(k);},children:[e&&jsx(N.Close,{onClick:f}),jsx(N.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsx(N.Title,{children:s.title}),jsx(N.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx(N.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsx(N.Secondary,{disabled:B,onClick:x,title:y}),jsx(N.Primary,{disabled:B,onClick:P,title:F})]})]}),s.id)}function Ee(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(O),[i,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function p(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:i||!o,removeModal:p}}function Po(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=m(s,["flowId","onComplete","variables","part"]);let[p,c]=useState(!1),{flow:u}=ce(e,{variables:t}),{hasInitialized:f,registerComponent:P,unregisterComponent:x}=useContext(O);ue(u,{onComplete:o});let{isCurrentModal:h,removeModal:F}=Ee(u);if(useEffect(()=>{!(u!=null&&u.isVisible)&&h&&F();},[u==null?void 0:u.isVisible,h]),useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!h||(P(e,()=>{p||c(!0);}),!f||!p))return null;let y=u.getCurrentStep();return y==null||y.start(),jsx(It,a({"data-flow-id":u.id,flow:u,part:["tour",r],step:y},n))}function Wt(e){let[o,t]=useState(),{frigade:r}=useContext(O);return useEffect(()=>{H(this,null,function*(){let n=yield r.getCollection(e);if(!n||r.hasFailedToLoad()){t(void 0);return}t(n);});},[e]),{collection:o}}function Co(r){var n=r,{collectionId:e,part:o}=n,t=m(n,["collectionId","part"]);var f,P;let i={ANNOUNCEMENT:So,BANNER:no,CARD:b,CHECKLIST:_e,EMBEDDED_TIP:b,FORM:De,NPS_SURVEY:Ue,TOUR:Po},[s,p]=useState(),{collection:c}=Wt(e);useEffect(()=>{var h;if(c==null)return;let x=(h=c.flows.find(({flow:F})=>F.isVisible))==null?void 0:h.flow;x!=null&&p(x);},[c]);let u=(P=i[(f=s==null?void 0:s.rawData)==null?void 0:f.flowType])!=null?P:()=>null;return s==null||u==null?null:jsx(g,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsx(u,{flowId:s.id})}))}function Oe(){let{frigade:e}=useContext(O);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function At(){let[e,o]=useState(),{frigade:t}=Oe();return useEffect(()=>{t.getCollections().then(r=>{r==null||r.forEach((n,i)=>{n.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsx(Co,{as:null,collectionId:e})}var O=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function $t(){let{frigade:e}=Oe();return useEffect(()=>{H(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}function Kt(s){var p=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=p,i=m(p,["children","css","defaultCollection","navigate","theme"]);let c=n?Qe(n):{},[u,f]=useState(new Set),P=useRef(new Map),x=useRef(),[h,F]=useState(!1),y=useMemo(()=>(F(!1),x.current=void 0,f(new Set),new Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);useEffect(()=>{if(i.__flowStateOverrides){let w=y.getConfig();w.__flowStateOverrides=i.__flowStateOverrides,y.reload(w);}},[i.__flowStateOverrides]);function B(){let w=[...P.current.entries()].map(([R,k])=>[R,k.callback]);y.batchRegister(w),F(!0);}function E(w,R){if(x.current&&clearTimeout(x.current),h){P.current.has(w)?y.getFlow(w).then(k=>R(k.isVisible)):(y.getFlow(w).then(k=>k.register(R)),P.current.set(w,{callback:R}));return}P.current.has(w)||P.current.set(w,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function v(w){P.current.has(w)&&y.getFlow(w).then(R=>{P.current.delete(w),R==null||R.unregister();});}let I=r!=null?r:(w,R="_self")=>{window.open(w,R);};useEffect(()=>()=>{y.destroy();},[]);let L=u.size>0?u.values().next().value:null;return jsxs(O.Provider,{value:d(a({modals:u,setModals:f,currentModal:L,navigate:I},i),{frigade:y,registerComponent:E,unregisterComponent:v,hasInitialized:h}),children:[jsx(Global,{styles:{":root":a(a(a({},Ze),c),o)}}),jsxs(ThemeProvider,{theme:T,children:[t&&jsx(At,{}),e]}),i.preloadImages!==!1&&jsx($t,{})]})}function ce(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:i}=useContext(O),s=useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),setTimeout(()=>{r(p),n(Math.random().toString());},0));},[o==null?void 0:o.variables,i]);return useEffect(()=>{if(i!=null&&i.isReady())return H(this,null,function*(){let p=yield i.getFlow(e);if(!p||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),r(p);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[s,i]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function K(P){var x=P,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:i,onPrimary:s,onSecondary:p,variables:c,forceMount:u}=x,f=m(x,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[h,F]=useState(!1),{flow:y}=ce(r,{variables:c}),{hasInitialized:B,registerComponent:E,unregisterComponent:v}=useContext(O),I=y==null?void 0:y.getCurrentStep(),{handleDismiss:L}=ue(y,{onComplete:n,onDismiss:i}),{handlePrimary:w,handleSecondary:R}=te(I,{onPrimary:s,onSecondary:p}),k=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:$,removeModal:Ce}=Ee(y,k);useEffect(()=>{!(y!=null&&y.isVisible)&&$&&Ce();},[y==null?void 0:y.isVisible,$]),useEffect(()=>()=>{v(r);},[]);let ie=u&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!ie&&!$||(E(r,()=>{h||F(!0);}),!y.isVisible&&!ie)||!B||!h)return null;(ie||!y.isCompleted&&!y.isSkipped)&&I.start();let He=e===null?Fragment$1:e!=null?e:g,Me=d(a({},f),{"data-flow-id":y.id});return jsx(He,d(a({},e===null?{}:Me),{children:o({flow:y,handleDismiss:L,handlePrimary:w,handleSecondary:R,parentProps:{dismissible:t,flowId:r,variables:c,containerProps:Me},step:I})}))}function Xt(t){var r=t,{part:e}=r,o=m(r,["part"]);return jsx(K,d(a({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:p},step:c})=>{var P,x,h,F;let u=(x=(P=c.primaryButton)==null?void 0:P.title)!=null?x:c.primaryButtonTitle,f=(F=(h=c.secondaryButton)==null?void 0:h.title)!=null?F:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:p,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:f,onClick:s}),jsx(b.Primary,{title:u,onClick:i})]})]})}}))}var b=ro.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=m(i,["children","flowId"]);var p;if(o!=null)return jsx(Xt,a({flowId:o},t));let s=(p=t.as)!=null?p:C.Column;return jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});b.Dismiss=e=>jsx(D.Plain,d(a({part:"dismiss",padding:0},e),{children:jsx(XMarkIcon,{height:"20",fill:"currentColor"})}));b.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(C.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{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:t})]}))};b.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(me,a({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Primary,a({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Secondary,a({title:o,onClick:e},t))};b.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(S.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(S.H4,d(a({display:"block",part:"title"},o),{children:e}))};var qe={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Yt(e){let o=Object.fromEntries(qe.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(qe.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!qe.content.some(i=>i===n)&&!qe.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Oi=keyframes`
57
+ `;function $(s){var p=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=p,i=m(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:g}=Xe(),{node:b,rect:x,ref:f}=Xe(),vo=It(i,u),{contentProps:F,otherProps:Ae}=vo,Fe=Ae,{part:S}=Fe,B=m(Fe,["part"]),{rootProps:E}=vo,[v,H]=useState(F.align),[A,w]=useState(F.side),[R,k]=useState(0),[V,Ce]=useState(0);if(c!==null){let _=c.getAttribute("data-align"),Q=c.getAttribute("data-side");v!==_&&H(_),A!==Q&&w(Q);}let ae=useRef(null);if(useEffect(()=>{let _=document.querySelector(e);_!=null?(f(_),ae.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function _(we){if(we.matches(e))return we;let ge=we.querySelectorAll(e);return ge.length>0?ge[0]:null}let Q=new MutationObserver(we=>{for(let ge of we)if(ge.type==="childList"){for(let Te of ge.addedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let se=_(Te);if(se!=null){f(se),ae.current=se,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",se);break}}for(let Te of ge.removedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let se=_(Te);if(se!=null){f(null),ae.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",se);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),useEffect(()=>{let{scrollX:_,scrollY:Q}=window;k(x.left+_),Ce(x.top+Q);},[x.left,x.top]),b==null)return null;let We="0";typeof window!="undefined"&&(We=window.getComputedStyle(b).borderRadius);let Se=Ot({props:i,alignAttr:v,sideAttr:A});return jsxs(Z.Root,d(a({defaultOpen:!0},E),{children:[jsx(Z.Anchor,{virtualRef:ae}),jsx(Z.Portal,{children:jsxs(Fragment,{children:[r&&jsx(y,a({animation:`${Ht} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:We,height:x.height,left:R,top:V,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsx(Z.Content,d(a({asChild:!0},F),{ref:g,children:jsxs(h,d(a({animation:`${Ht} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:n},B),{children:[jsx(Dt,{style:Se}),o]}))}))]})})]}))}$.Close=e=>jsx(Z.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null?null:jsx(me,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsx(D.Primary,a({title:o,onClick:e},t))};$.Progress=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(C.Body2,d(a({part:"progress"},o),{children:e}))};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,a({title:o,onClick:e},t))};$.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(C.Body2,d(a({part:"subtitle"},o),{children:e}))};$.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(C.H4,d(a({part:"title"},o),{children:e}))};function Mt(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=u,p=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,v,H,A,w,R;let{handleDismiss:g}=ue(o,{onDismiss:t}),{handlePrimary:b,handleSecondary:x}=re(s,{onPrimary:n,onSecondary:i}),f=(E=s.props)!=null?E:{},F=(H=(v=s.primaryButton)==null?void 0:v.title)!=null?H:s.primaryButtonTitle,S=(w=(A=s.secondaryButton)==null?void 0:A.title)!=null?w:s.secondaryButtonTitle,B=!!s.$state.blocked;return jsxs($,d(a(a({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:k=>k.preventDefault(),onPointerDownOutside:k=>k.preventDefault(),onInteractOutside:k=>k.preventDefault()},p),f),{onEscapeKeyDown:k=>{typeof r=="function"&&r(k),k.defaultPrevented||g(k);},children:[e&&jsx($.Close,{onClick:g}),jsx($.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsx($.Title,{children:s.title}),jsx($.Subtitle,{color:"neutral.400",children:s.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.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsx($.Primary,{disabled:B,onClick:b,title:F})]})]}),s.id)}function Ie(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(O),[i,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function p(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:i||!o,removeModal:p}}function So(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=m(s,["flowId","onComplete","variables","part"]);let[p,c]=useState(!1),{flow:u}=ce(e,{variables:t}),{hasInitialized:g,registerComponent:b,unregisterComponent:x}=useContext(O);ue(u,{onComplete:o});let{isCurrentModal:f,removeModal:F}=Ie(u);if(useEffect(()=>{!(u!=null&&u.isVisible)&&f&&F();},[u==null?void 0:u.isVisible,f]),useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!f||(b(e,()=>{p||c(!0);}),!g||!p))return null;let S=u.getCurrentStep();return S==null||S.start(),jsx(Mt,a({"data-flow-id":u.id,flow:u,part:["tour",r],step:S},n))}function Lt(e){let[o,t]=useState(),{frigade:r}=useContext(O);return useEffect(()=>{I(this,null,function*(){let n=yield r.getCollection(e);if(!n||r.hasFailedToLoad()){t(void 0);return}t(n);});},[e]),{collection:o}}function Fo(r){var n=r,{collectionId:e,part:o}=n,t=m(n,["collectionId","part"]);var g,b;let i={ANNOUNCEMENT:wo,BANNER:ao,CARD:h,CHECKLIST:Ue,EMBEDDED_TIP:h,FORM:Oe,NPS_SURVEY:Ge,TOUR:So},[s,p]=useState(),{collection:c}=Lt(e);useEffect(()=>{var f;if(c==null)return;let x=(f=c.flows.find(({flow:F})=>F.isVisible))==null?void 0:f.flow;x!=null&&p(x);},[c]);let u=(b=i[(g=s==null?void 0:s.rawData)==null?void 0:g.flowType])!=null?b:()=>null;return s==null||u==null?null:jsx(y,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsx(u,{flowId:s.id})}))}function He(){let{frigade:e}=useContext(O);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Nt(){let[e,o]=useState(),{frigade:t}=He();return useEffect(()=>{t.getCollections().then(r=>{r==null||r.forEach((n,i)=>{n.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsx(Fo,{as:null,collectionId:e})}var O=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function Vt(){let{frigade:e}=He();return useEffect(()=>{I(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}function jt(s){var p=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=p,i=m(p,["children","css","defaultCollection","navigate","theme"]);let c=n?eo(n):{},[u,g]=useState(new Set),b=useRef(new Map),x=useRef(),[f,F]=useState(!1),S=useMemo(()=>(F(!1),x.current=void 0,g(new Set),new Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);useEffect(()=>{if(i.__flowStateOverrides){let w=S.getConfig();w.__flowStateOverrides=i.__flowStateOverrides,S.reload(w);}},[i.__flowStateOverrides]);function B(){let w=[...b.current.entries()].map(([R,k])=>[R,k.callback]);S.batchRegister(w),F(!0);}function E(w,R){if(x.current&&clearTimeout(x.current),f){b.current.has(w)?S.getFlow(w).then(k=>R(k.isVisible)):(S.getFlow(w).then(k=>k.register(R)),b.current.set(w,{callback:R}));return}b.current.has(w)||b.current.set(w,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function v(w){b.current.has(w)&&S.getFlow(w).then(R=>{b.current.delete(w),R==null||R.unregister();});}let H=r!=null?r:(w,R="_self")=>{window.open(w,R);};useEffect(()=>()=>{S.destroy();},[]);let A=u.size>0?u.values().next().value:null;return jsxs(O.Provider,{value:d(a({modals:u,setModals:g,currentModal:A,navigate:H},i),{frigade:S,registerComponent:E,unregisterComponent:v,hasInitialized:f}),children:[jsx(Global,{styles:{":root":a(a(a({},oo),c),o)}}),jsxs(ThemeProvider,{theme:T,children:[t&&jsx(Nt,{}),e]}),i.preloadImages!==!1&&jsx(Vt,{})]})}function ce(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:i}=useContext(O),s=useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),setTimeout(()=>{r(p),n(Math.random().toString());},0));},[o==null?void 0:o.variables,i]);return useEffect(()=>{if(i!=null&&i.isReady())return I(this,null,function*(){let p=yield i.getFlow(e);if(!p||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),r(p);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[s,i]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function K(u){var g=u,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:s,variables:p}=g,c=m(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var Fe,Q;let[b,x]=useState(!1),{flow:f}=ce(t,{variables:p}),_=a(a({},(Fe=f==null?void 0:f.props)!=null?Fe:{}),c),{dismissible:F=!1,forceMount:S=!1,modal:B=!1}=_,E=m(_,["dismissible","forceMount","modal"]),{hasInitialized:v,registerComponent:H,unregisterComponent:A}=useContext(O),w=f==null?void 0:f.getCurrentStep(),{handleDismiss:R}=ue(f,{onComplete:r,onDismiss:n}),{handlePrimary:k,handleSecondary:V}=re(w,{onPrimary:i,onSecondary:s}),Ce=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((Q=f==null?void 0:f.rawData)==null?void 0:Q.flowType),{isCurrentModal:ae,removeModal:We}=Ie(f,Ce);useEffect(()=>{!(f!=null&&f.isVisible)&&ae&&We();},[f==null?void 0:f.isVisible,ae]),useEffect(()=>()=>{A(t);},[]);let Se=S&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||!Se&&!ae||(H(t,()=>{b||x(!0);}),!f.isVisible&&!Se)||!v||!b)return null;(Se||!f.isCompleted&&!f.isSkipped)&&w.start();let vo=e===null?Fragment$1:e!=null?e:y,Ae=d(a({},E),{"data-flow-id":f.id});return jsx(vo,d(a({},e===null?{}:Ae),{children:o({flow:f,handleDismiss:R,handlePrimary:k,handleSecondary:V,parentProps:{dismissible:F,flowId:t,variables:p,containerProps:Ae},step:w})}))}function Qt(t){var r=t,{part:e}=r,o=m(r,["part"]);return jsx(K,d(a({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:p},step:c})=>{var b,x,f,F;let u=(x=(b=c.primaryButton)==null?void 0:b.title)!=null?x:c.primaryButtonTitle,g=(F=(f=c.secondaryButton)==null?void 0:f.title)!=null?F:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:p,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsx(h.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:g,onClick:s}),jsx(h.Primary,{title:u,onClick:i})]})]})}}))}var h=io.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=m(i,["children","flowId"]);var p;if(o!=null)return jsx(Qt,a({flowId:o},t));let s=(p=t.as)!=null?p:P.Column;return jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});h.Dismiss=e=>jsx(D.Plain,d(a({part:"dismiss",padding:0},e),{children:jsx(XMarkIcon,{height:"20",fill:"currentColor"})}));h.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(P.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(h.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};h.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(me,a({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Primary,a({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Secondary,a({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(C.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsx(C.H4,d(a({display:"block",part:"title"},o),{children:e}))};var Qe={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function er(e){let o=Object.fromEntries(Qe.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Qe.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Qe.content.some(i=>i===n)&&!Qe.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Hi=keyframes`
58
58
  from {
59
59
  opacity: 0;
60
60
  }
@@ -64,8 +64,8 @@ var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnProp
64
64
  to {
65
65
  opacity: 1;
66
66
  }
67
- `;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=m(i,["children","className","modal"]);let{rootProps:s,contentProps:p,otherProps:f}=Yt(r),P=f,{zIndex:c}=P,u=m(P,["zIndex"]);return jsx(z.Root,d(a({defaultOpen:!0,modal:t},s),{children:jsx(z.Portal,{children:jsxs(g,{animation:`${Oi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(z.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(z.Content,d(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},p),{children:jsx(b,d(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}M.Dismiss=e=>jsx(z.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,d(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(XMarkIcon,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return jsx(z.Description,{asChild:!0,children:jsx(S.Body2,d(a({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null?null:jsx(me,a({borderRadius:"md",src:e},o))};M.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsx(D.Primary,a({title:o,onClick:e},t))};M.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(g,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?T.colors.blue500:T.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};M.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,a({title:o,onClick:e},t))};M.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return jsx(z.Title,{asChild:!0,children:jsx(S.H4,d(a({part:"title"},o),{children:e}))})};M.displayName="Dialog";var Qt=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function So(r){var n=r,{flowId:e,part:o}=n,t=m(n,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([p])=>Qt.some(c=>p===c))),s=Object.fromEntries(Object.entries(t).filter(([p])=>Qt.indexOf(p)===-1));return jsx(K,d(a({as:null,flowId:e},i),{children:({flow:p,handleDismiss:c,handlePrimary:u,handleSecondary:f,parentProps:{containerProps:P,dismissible:x},step:h})=>{var v,I,L,w,R,k;let F=(v=h.props)!=null?v:{},y=(L=(I=h.primaryButton)==null?void 0:I.title)!=null?L:h.primaryButtonTitle,B=(R=(w=h.secondaryButton)==null?void 0:w.title)!=null?R:h.secondaryButtonTitle,E=!!h.$state.blocked;return jsx(M,d(a(a({part:["announcement",o],textAlign:"center"},P),s),{onEscapeKeyDown:$=>{if(t.dismissible===!1){$.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown($),$.defaultPrevented||c($);},children:jsxs(C.Column,d(a({gap:5,part:"announcement-step"},F),{children:[x&&jsx(M.Dismiss,{onClick:c}),jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsx(M.Title,{children:h.title}),jsx(M.Subtitle,{children:h.subtitle})]}),jsx(M.Media,{src:(k=h.videoUri)!=null?k:h.imageUri,type:h.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(M.ProgressDots,{current:p.getCurrentStepIndex(),total:p.getNumberOfAvailableSteps()}),jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsx(M.Secondary,{disabled:E,onClick:f,title:B}),y&&jsx(M.Primary,{disabled:E,onClick:u,title:y})]})]}))}))}}))}function Mi(){let{userId:e,frigade:o}=useContext(O);function t(n){return H(this,null,function*(){yield o.identify(e,n);})}function r(n,i){return H(this,null,function*(){yield o.track(n,i);})}return {userId:e,addProperties:t,track:r}}function Li(){var n;let{frigade:e}=useContext(O);function o(i){return H(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,i);})}function t(i,s){return H(this,null,function*(){yield e.track(i,s);})}function r(i,s){return H(this,null,function*(){yield e.group(i,s);})}return {groupId:(n=e==null?void 0:e.config)==null?void 0:n.groupId,setGroupId:r,addProperties:o,track:t}}
67
+ `;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=m(i,["children","className","modal"]);let{rootProps:s,contentProps:p,otherProps:g}=er(r),b=g,{zIndex:c}=b,u=m(b,["zIndex"]);return jsx(U.Root,d(a({defaultOpen:!0,modal:t},s),{children:jsx(U.Portal,{children:jsxs(y,{animation:`${Hi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(U.Overlay,{asChild:!0,children:jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(U.Content,d(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},p),{children:jsx(h,d(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}M.Dismiss=e=>jsx(U.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,d(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(XMarkIcon,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return jsx(U.Description,{asChild:!0,children:jsx(C.Body2,d(a({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null?null:jsx(me,a({borderRadius:"md",src:e},o))};M.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsx(D.Primary,a({title:o,onClick:e},t))};M.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(y,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?T.colors.blue500:T.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};M.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,a({title:o,onClick:e},t))};M.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return jsx(U.Title,{asChild:!0,children:jsx(C.H4,d(a({part:"title"},o),{children:e}))})};M.displayName="Dialog";var or=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function wo(r){var n=r,{flowId:e,part:o}=n,t=m(n,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([p])=>or.some(c=>p===c))),s=Object.fromEntries(Object.entries(t).filter(([p])=>or.indexOf(p)===-1));return jsx(K,d(a({as:null,flowId:e},i),{children:({flow:p,handleDismiss:c,handlePrimary:u,handleSecondary:g,parentProps:{containerProps:b,dismissible:x},step:f})=>{var v,H,A,w,R,k;let F=(v=f.props)!=null?v:{},S=(A=(H=f.primaryButton)==null?void 0:H.title)!=null?A:f.primaryButtonTitle,B=(R=(w=f.secondaryButton)==null?void 0:w.title)!=null?R:f.secondaryButtonTitle,E=!!f.$state.blocked;return jsx(M,d(a(a({part:["announcement",o],textAlign:"center"},b),s),{onEscapeKeyDown:V=>{if(t.dismissible===!1){V.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(V),V.defaultPrevented||c(V);},children:jsxs(P.Column,d(a({gap:5,part:"announcement-step"},F),{children:[x&&jsx(M.Dismiss,{onClick:c}),jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsx(M.Title,{children:f.title}),jsx(M.Subtitle,{children:f.subtitle})]}),jsx(M.Media,{src:(k=f.videoUri)!=null?k:f.imageUri,type:f.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(M.ProgressDots,{current:p.getCurrentStepIndex(),total:p.getNumberOfAvailableSteps()}),jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsx(M.Secondary,{disabled:E,onClick:g,title:B}),S&&jsx(M.Primary,{disabled:E,onClick:u,title:S})]})]}))}))}}))}function Ai(){let{userId:e,frigade:o}=useContext(O);function t(n){return I(this,null,function*(){yield o.identify(e,n);})}function r(n,i){return I(this,null,function*(){yield o.track(n,i);})}return {userId:e,addProperties:t,track:r}}function $i(){var n;let{frigade:e}=useContext(O);function o(i){return I(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,i);})}function t(i,s){return I(this,null,function*(){yield e.track(i,s);})}function r(i,s){return I(this,null,function*(){yield e.group(i,s);})}return {groupId:(n=e==null?void 0:e.config)==null?void 0:n.groupId,setGroupId:r,addProperties:o,track:t}}
68
68
 
69
- export { So as Announcement, no as Banner, re as BaseField, g as Box, D as Button, b as Card, ze as Checklist, Co as Collection, M as Dialog, C as Flex, K as Flow, De as Form, co as Label, Be as Progress, Kt as Provider, uo as RadioField, mo as SelectField, je as Survey, S as Text, fo as TextField, N as Tooltip, Po as Tour, Ze as themeVariables, Ae as tokens, Ge as useBoundingClientRect, ce as useFlow, ue as useFlowHandlers, Oe as useFrigade, Li as useGroup, Ee as useModal, te as useStepHandlers, Mi as useUser };
69
+ export { wo as Announcement, ao as Banner, ne as BaseField, y as Box, D as Button, h as Card, Ke as Checklist, Fo as Collection, M as Dialog, P as Flex, K as Flow, Oe as Form, mo as Label, Re as Progress, jt as Provider, fo as RadioField, go as SelectField, Je as Survey, C as Text, yo as TextField, $ as Tooltip, So as Tour, oo as themeVariables, Ne as tokens, Xe as useBoundingClientRect, ce as useFlow, ue as useFlowHandlers, He as useFrigade, $i as useGroup, Ie as useModal, re as useStepHandlers, Ai as useUser };
70
70
  //# sourceMappingURL=out.js.map
71
71
  //# sourceMappingURL=index.js.map