@frigade/react 2.4.2 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +35 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1479,7 +1479,19 @@ interface CardProps extends FlowPropsWithoutChildren {
|
|
|
1479
1479
|
}
|
|
1480
1480
|
declare const Card: CardComponent;
|
|
1481
1481
|
|
|
1482
|
-
|
|
1482
|
+
interface CarouselProps extends FlowPropsWithoutChildren {
|
|
1483
|
+
/**
|
|
1484
|
+
* @ignore
|
|
1485
|
+
*/
|
|
1486
|
+
children?: React.ReactNode;
|
|
1487
|
+
/**
|
|
1488
|
+
* How to sort the default the completed steps of the carousel.
|
|
1489
|
+
* - `completed-last` will sort the completed/skips steps to the end of the carousel.
|
|
1490
|
+
* - `default` will keep the order of the steps as they are in the flow.
|
|
1491
|
+
*/
|
|
1492
|
+
sort?: 'completed-last' | 'default';
|
|
1493
|
+
}
|
|
1494
|
+
declare function Carousel({ ...props }: CarouselProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
1483
1495
|
|
|
1484
1496
|
interface CollapsibleStepProps extends FlowChildrenProps {
|
|
1485
1497
|
onOpenChange: (isOpening: boolean) => void;
|
package/dist/index.js
CHANGED
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
import { keyframes, Global, ThemeProvider } from '@emotion/react';
|
|
3
3
|
import * as K from '@radix-ui/react-dialog';
|
|
4
4
|
import { XMarkIcon } from '@heroicons/react/20/solid';
|
|
5
|
-
import * as
|
|
6
|
-
import { createContext, useContext, useCallback, useState,
|
|
5
|
+
import * as lo from 'react';
|
|
6
|
+
import { createContext, useContext, useCallback, useState, useRef, useEffect, useLayoutEffect, useMemo, Fragment as Fragment$1 } from 'react';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import mr from 'known-css-properties';
|
|
9
|
+
import Sr from 'dompurify';
|
|
10
10
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
11
11
|
import { Frigade, FlowType } from '@frigade/js';
|
|
12
12
|
import * as js from '@frigade/js';
|
|
13
13
|
export { js as FrigadeJS };
|
|
14
|
-
import { ArrowLeftIcon, ArrowRightIcon,
|
|
15
|
-
import
|
|
14
|
+
import { ChevronDownIcon, ArrowLeftIcon, ArrowRightIcon, LockClosedIcon } from '@heroicons/react/24/outline';
|
|
15
|
+
import gn from 'embla-carousel-react';
|
|
16
16
|
import * as he from '@radix-ui/react-collapsible';
|
|
17
17
|
import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
|
|
18
18
|
import * as Ce from '@radix-ui/react-radio-group';
|
|
19
19
|
import * as N from '@radix-ui/react-select';
|
|
20
20
|
import * as Z from '@radix-ui/react-popover';
|
|
21
21
|
|
|
22
|
-
var Do=Object.defineProperty,nr=Object.defineProperties;var ir=Object.getOwnPropertyDescriptors;var Ae=Object.getOwnPropertySymbols;var Eo=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable;var ko=(e,o,t)=>o in e?Do(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Eo.call(o,t)&&ko(e,t,o[t]);if(Ae)for(var t of Ae(o))Oo.call(o,t)&&ko(e,t,o[t]);return e},d=(e,o)=>nr(e,ir(o));var ar=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var r in e)Eo.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Ae)for(var r of Ae(e))o.indexOf(r)<0&&Oo.call(e,r)&&(t[r]=e[r]);return t};var ee=(e,o)=>{for(var t in o)Do(e,t,{get:o[t],enumerable:!0});};var H=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{l(t.next(c));}catch(u){n(u);}},s=c=>{try{l(t.throw(c));}catch(u){n(u);}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((t=t.apply(e,o)).next());});var Io={borderWidths:{md:"1px"}};var $e=[5,10,20,35,50,65,80,95,98],Ho=[...$e],oo=[...$e];Ho[4]=40;oo[4]=60;var sr={blue:{h:213,s:100,l:$e},gray:{h:220,s:10,l:$e},green:{h:141,s:90,l:Ho},red:{h:9,s:90,l:oo},yellow:{h:50,s:90,l:oo}};var L={};for(let[e,{h:o,s:t,l:r}]of Object.entries(sr))L[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Mo=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},L),{gray100:L.gray[100],gray200:L.gray[200],gray300:L.gray[300],gray400:L.gray[400],gray500:L.gray[500],gray600:L.gray[600],gray700:L.gray[700],gray800:L.gray[800],gray900:L.gray[900],blue400:L.blue[400],blue500:L.blue[500],blue800:L.blue[800],blue900:L.blue[900],green400:L.blue[400],green500:L.green[500],green800:L.green[800],red500:L.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Wo={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Lo={negative:{100:p("red-100"),200:p("red-200"),300:p("red-300"),400:p("red-400"),500:p("red-500"),600:p("red-600"),700:p("red-700"),800:p("red-800"),900:p("red-900"),background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500"),active:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")},focus:{background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500")},hover:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")}},neutral:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("neutral-800"),foreground:p("black"),surface:p("neutral-700"),active:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},focus:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},hover:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")}},positive:{100:p("green-100"),200:p("green-200"),300:p("green-300"),400:p("green-400"),500:p("green-500"),600:p("green-600"),700:p("green-700"),800:p("green-800"),900:p("green-900"),background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500"),active:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")},focus:{background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500")},hover:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")}},primary:{100:p("blue-100"),200:p("blue-200"),300:p("blue-300"),400:p("blue-400"),500:p("blue-500"),600:p("blue-600"),700:p("blue-700"),800:p("blue-800"),900:p("blue-900"),background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500"),active:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")},focus:{background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500")},hover:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")}},secondary:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900"),active:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")},focus:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900")},hover:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")}}};var Ao={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var lr="px",pr=e=>typeof e=="number"?`${4*e}${lr}`:e,dr=[-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"],$o=Object.fromEntries(dr.map(e=>[e,pr(e)]));var No={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({},Io),{colors:a(a({},Mo),Lo)}),No),{radii:Wo,shadows:Ao,space:$o});function Be(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,Be(l,s,t)):r[s]=l,r},{})}function to(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 Vo(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]=Vo(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var ro=to(Ne),T=Vo(Ne);var ur=new Set(["alt","size","src"]),mr=cr.all.filter(e=>e.indexOf("-")!=0&&!ur.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),fr=Object.fromEntries(mr),Ve=Be(T.colors),gr={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},_o=a(a({},fr),gr),zo={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"]},Ko=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function yr(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(_o).map(([e,o])=>[e,yr(o)])),xr=new Map(Object.entries(zo).map(([e,o])=>[e,new Set(o)])),br=new Set(["height","width"]),hr=new Set(["canvas","embed","iframe","img","input","object","video"]);function jo(e){let[o,t]=e.split(":");return [o,Ko.has(t)?t:null]}function Go(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let l=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([i,s])=>{let[l,c]=jo(i),u=xr.get(l);u!=null&&(u.forEach(g=>{let h=`${g}${c?":"+c:""}`;t[h]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[l,c]=jo(i),u=Uo.get(l);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[l]=g.map(h=>{var x;return (x=u.get(h.toString()))!=null?x:h}).join(" ");}else u.has(s.toString())?n(c)[l]=u.get(s.toString()):n(c)[l]=s;(typeof o!="string"||!hr.has(o)||!br.has(l))&&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 Cr(){if(typeof window=="undefined"){let{JSDOM:e}=ar("jsdom");return new e("<!DOCTYPE html>").window}return window}function Jo(e){return e?{__html:Pr(Cr()).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 Fr(e){return e&&`fr-${e}`}function Yo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Yo(o)).join(" "):Fr(e))}function wr(l,s){var c=l,{as:e,children:o,className:t,css:r={},part:n}=c,i=f(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:g,unmatchedProps:h}=Go(i,u),x=Yo(n),m=t||x?clsx(t,x):void 0,w=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsx(u,d(a({className:m,css:w},h),{ref:s,dangerouslySetInnerHTML:Jo(o)})):jsx(u,d(a({className:m,css:w},h),{ref:s,children:o}))}var y=so.forwardRef(wr);var D={};ee(D,{Link:()=>Zr,Plain:()=>en,Primary:()=>Yr,Secondary:()=>Qr});var C={};ee(C,{Body1:()=>Vr,Body2:()=>_r,Caption:()=>zr,Display1:()=>Mr,Display2:()=>Wr,H1:()=>Lr,H2:()=>Ar,H3:()=>$r,H4:()=>Nr});var no={};ee(no,{Body1:()=>Er,Body2:()=>Or,Caption:()=>Ir,Display1:()=>Tr,Display2:()=>Br,H1:()=>vr,H2:()=>Rr,H3:()=>kr,H4:()=>Dr});var oe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Tr=d(a({},oe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Br=d(a({},oe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),vr=d(a({},oe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Rr=d(a({},oe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),kr=d(a({},oe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Dr=d(a({},oe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Er=d(a({},oe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Or=d(a({},oe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Ir=d(a({},oe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Hr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],te=Object.fromEntries(Hr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=so.forwardRef((l,s)=>{var c=l,{as:r=o,children:n}=c,i=f(c,["as","children"]);return jsx(y,d(a(a({as:r},no[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Mr=te.Display1,Wr=te.Display2,Lr=te.H1,Ar=te.H2,$r=te.H3,Nr=te.H4,Vr=te.Body1,_r=te.Body2,zr=te.Caption;var ao={};ee(ao,{Link:()=>Jr,Plain:()=>Xr,Primary:()=>jr,Secondary:()=>Gr,loadingCSSStyle:()=>io});var _e={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},jr=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"}),Gr=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"}),Xr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),qr=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),io={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:qr+" 1s ease infinite"}};function ze(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,i=f(l,["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]},ao[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?io:{})}),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 Yr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Primary",children:e}))}function Qr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Secondary",children:e}))}function Zr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Link",children:e}))}function en(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Plain",children:e}))}var P={};ee(P,{Column:()=>rn,Row:()=>tn});var tn=so.forwardRef((e,o)=>jsx(y,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),rn=so.forwardRef((e,o)=>jsx(y,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function lo(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=f(i,["dismissible","flowId","part"]);return jsx(U,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:l,handleSecondary:c,parentProps:{containerProps:u},step:g})=>{var S,B,E,v,O;let h=(S=g.props)!=null?S:{},x=(E=(B=g.primaryButton)==null?void 0:B.title)!=null?E:g.primaryButtonTitle,m=(O=(v=g.secondaryButton)==null?void 0:v.title)!=null?O:g.secondaryButtonTitle,w=g.$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),h),{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(b.Title,{part:"title",children:g.title}),jsx(b.Subtitle,{part:"subtitle",children:g.subtitle})]}),jsx(b.Secondary,{disabled:w,title:m,onClick:c}),jsx(b.Primary,{disabled:w,title:x,onClick:l}),e&&jsx(b.Dismiss,{onClick:s})]}))}}))}var Ue={};ee(Ue,{Carousel:()=>ct,Collapsible:()=>Ke,CollapsibleStep:()=>De});var Re={};ee(Re,{Bar:()=>xe,Dots:()=>rt,Segments:()=>it});function xe(r){var n=r,{current:e,total:o}=n,t=f(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 rt(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,l)=>jsx(y,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?T.colors.blue500:T.colors.blue800},l));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 it(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=[...Array(o)].map((s,l)=>jsx(y,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsx(P.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function nn(){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 at(t){var r=t,{checked:e=!1}=r,o=f(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(nn,{})})}))}function re(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(I),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.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((i,s,l=!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,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),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 lt({onPrimary:e,onSecondary:o,step:t}){var u,g;let{handlePrimary:r,handleSecondary:n}=re(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s,skipped:l}=t.$state,c=s||l||!i?jsx(at,{checked:s||l,marginLeft:"auto"}):jsx(y,{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(P.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(P.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsx(b.Secondary,{disabled:i,onClick:n,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(b.Primary,{disabled:i,onClick:r,title:(g=t.primaryButton)==null?void 0:g.title})]})]})}var dt=keyframes`
|
|
22
|
+
var Do=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnPropertyDescriptors;var Le=Object.getOwnPropertySymbols;var Oo=Object.prototype.hasOwnProperty,Io=Object.prototype.propertyIsEnumerable;var Eo=(e,o,t)=>o in e?Do(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Oo.call(o,t)&&Eo(e,t,o[t]);if(Le)for(var t of Le(o))Io.call(o,t)&&Eo(e,t,o[t]);return e},d=(e,o)=>ar(e,sr(o));var lr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var r in e)Oo.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&&Io.call(e,r)&&(t[r]=e[r]);return t};var ee=(e,o)=>{for(var t in o)Do(e,t,{get:o[t],enumerable:!0});};var W=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{l(t.next(c));}catch(m){n(m);}},s=c=>{try{l(t.throw(c));}catch(m){n(m);}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((t=t.apply(e,o)).next());});var Ho={borderWidths:{md:"1px"}};var $e=[5,10,20,35,50,65,80,95,98],Wo=[...$e],to=[...$e];Wo[4]=40;to[4]=60;var pr={blue:{h:213,s:100,l:$e},gray:{h:220,s:10,l:$e},green:{h:141,s:90,l:Wo},red:{h:9,s:90,l:to},yellow:{h:50,s:90,l:to}};var A={};for(let[e,{h:o,s:t,l:r}]of Object.entries(pr))A[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Mo=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},A),{gray100:A.gray[100],gray200:A.gray[200],gray300:A.gray[300],gray400:A.gray[400],gray500:A.gray[500],gray600:A.gray[600],gray700:A.gray[700],gray800:A.gray[800],gray900:A.gray[900],blue400:A.blue[400],blue500:A.blue[500],blue800:A.blue[800],blue900:A.blue[900],green400:A.blue[400],green500:A.green[500],green800:A.green[800],red500:A.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Ao={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,Lo={negative:{100:p("red-100"),200:p("red-200"),300:p("red-300"),400:p("red-400"),500:p("red-500"),600:p("red-600"),700:p("red-700"),800:p("red-800"),900:p("red-900"),background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500"),active:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")},focus:{background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500")},hover:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")}},neutral:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("neutral-800"),foreground:p("black"),surface:p("neutral-700"),active:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},focus:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},hover:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")}},positive:{100:p("green-100"),200:p("green-200"),300:p("green-300"),400:p("green-400"),500:p("green-500"),600:p("green-600"),700:p("green-700"),800:p("green-800"),900:p("green-900"),background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500"),active:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")},focus:{background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500")},hover:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")}},primary:{100:p("blue-100"),200:p("blue-200"),300:p("blue-300"),400:p("blue-400"),500:p("blue-500"),600:p("blue-600"),700:p("blue-700"),800:p("blue-800"),900:p("blue-900"),background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500"),active:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")},focus:{background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500")},hover:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")}},secondary:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900"),active:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")},focus:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900")},hover:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")}}};var $o={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var dr="px",cr=e=>typeof e=="number"?`${4*e}${dr}`:e,ur=[-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"],No=Object.fromEntries(ur.map(e=>[e,cr(e)]));var Vo={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({},Ho),{colors:a(a({},Mo),Lo)}),Vo),{radii:Ao,shadows:$o,space:No});function ve(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,ve(l,s,t)):r[s]=l,r},{})}function ro(e){let o=ve(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 _o(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]=_o(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var no=ro(Ne),v=_o(Ne);var fr=new Set(["alt","size","src"]),gr=mr.all.filter(e=>e.indexOf("-")!=0&&!fr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),yr=Object.fromEntries(gr),Ve=ve(v.colors),xr={color:Ve,backgroundColor:Ve,borderColor:Ve,border:a(a({},v.borderWidths),Ve),borderRadius:v.radii,borderWidth:v.borderWidths,boxShadow:v.shadows,fontFamily:v.fontFamilies,fontSize:v.fontSizes,fontWeight:v.fontWeights,gap:v.space,lineHeight:v.lineHeights,margin:v.space,marginBottom:v.space,marginLeft:v.space,marginRight:v.space,marginTop:v.space,padding:v.space,paddingBottom:v.space,paddingLeft:v.space,paddingRight:v.space,paddingTop:v.space},zo=a(a({},yr),xr),Ko={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"]},Uo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function br(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 jo=new Map(Object.entries(zo).map(([e,o])=>[e,br(o)])),hr=new Map(Object.entries(Ko).map(([e,o])=>[e,new Set(o)])),Pr=new Set(["height","width"]),Cr=new Set(["canvas","embed","iframe","img","input","object","video"]);function Go(e){let[o,t]=e.split(":");return [o,Uo.has(t)?t:null]}function Jo(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let l=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([i,s])=>{let[l,c]=Go(i),m=hr.get(l);m!=null&&(m.forEach(g=>{let P=`${g}${c?":"+c:""}`;t[P]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[l,c]=Go(i),m=jo.get(l);if(m!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[l]=g.map(P=>{var x;return (x=m.get(P.toString()))!=null?x:P}).join(" ");}else m.has(s.toString())?n(c)[l]=m.get(s.toString()):n(c)[l]=s;(typeof o!="string"||!Cr.has(o)||!Pr.has(l))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&jo.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function Fr(){if(typeof window=="undefined"){let{JSDOM:e}=lr("jsdom");return new e("<!DOCTYPE html>").window}return window}function Xo(e){return e?{__html:Sr(Fr()).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 Tr(e){return e&&`fr-${e}`}function Qo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Qo(o)).join(" "):Tr(e))}function vr(l,s){var c=l,{as:e,children:o,className:t,css:r={},part:n}=c,i=f(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:g,unmatchedProps:P}=Jo(i,m),x=Qo(n),u=t||x?clsx(t,x):void 0,w=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsx(m,d(a({className:u,css:w},P),{ref:s,dangerouslySetInnerHTML:Xo(o)})):jsx(m,d(a({className:u,css:w},P),{ref:s,children:o}))}var y=lo.forwardRef(vr);var O={};ee(O,{Link:()=>on,Plain:()=>tn,Primary:()=>Zr,Secondary:()=>en});var F={};ee(F,{Body1:()=>zr,Body2:()=>Kr,Caption:()=>Ur,Display1:()=>Ar,Display2:()=>Lr,H1:()=>$r,H2:()=>Nr,H3:()=>Vr,H4:()=>_r});var io={};ee(io,{Body1:()=>Ir,Body2:()=>Hr,Caption:()=>Wr,Display1:()=>Br,Display2:()=>Rr,H1:()=>kr,H2:()=>Er,H3:()=>Dr,H4:()=>Or});var oe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Br=d(a({},oe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Rr=d(a({},oe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),kr=d(a({},oe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Er=d(a({},oe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Dr=d(a({},oe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Or=d(a({},oe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Ir=d(a({},oe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Hr=d(a({},oe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Wr=d(a({},oe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Mr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],te=Object.fromEntries(Mr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=lo.forwardRef((l,s)=>{var c=l,{as:r=o,children:n}=c,i=f(c,["as","children"]);return jsx(y,d(a(a({as:r},io[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Ar=te.Display1,Lr=te.Display2,$r=te.H1,Nr=te.H2,Vr=te.H3,_r=te.H4,zr=te.Body1,Kr=te.Body2,Ur=te.Caption;var so={};ee(so,{Link:()=>qr,Plain:()=>Yr,Primary:()=>Jr,Secondary:()=>Xr,loadingCSSStyle:()=>ao});var _e={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Jr=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"}),Xr=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"}),qr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Yr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Qr=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),ao={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:Qr+" 1s ease infinite"}};function ze(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,i=f(l,["as","children","part","title","variant"]);var m;let c=n.toLocaleLowerCase();return jsxs(y,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},so[n]),{css:a(a({},(m=i.css)!=null?m:{}),i.loading?ao:{})}),i),{loading:void 0,children:[o,r&&jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Zr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Primary",children:e}))}function en(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Secondary",children:e}))}function on(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Link",children:e}))}function tn(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Plain",children:e}))}var C={};ee(C,{Column:()=>an,Row:()=>nn});var nn=lo.forwardRef((e,o)=>jsx(y,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),an=lo.forwardRef((e,o)=>jsx(y,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function po(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=f(i,["dismissible","flowId","part"]);return jsx(U,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:l,handleSecondary:c,parentProps:{containerProps:m},step:g})=>{var S,B,k,T,E;let P=(S=g.props)!=null?S:{},x=(k=(B=g.primaryButton)==null?void 0:B.title)!=null?k:g.primaryButtonTitle,u=(E=(T=g.secondaryButton)==null?void 0:T.title)!=null?E:g.secondaryButtonTitle,w=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]},m),P),{children:[g.imageUri&&jsx(y,{as:"img",part:"image",src:g.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(C.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:w,title:u,onClick:c}),jsx(h.Primary,{disabled:w,title:x,onClick:l}),e&&jsx(h.Dismiss,{onClick:s})]}))}}))}var je={};ee(je,{Carousel:()=>mt,Collapsible:()=>Ue,CollapsibleStep:()=>Ee});var Re={};ee(Re,{Bar:()=>xe,Dots:()=>nt,Segments:()=>at});function xe(r){var n=r,{current:e,total:o}=n,t=f(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 nt(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,l)=>jsx(y,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?v.colors.blue500:v.colors.blue800},l));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 at(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=[...Array(o)].map((s,l)=>jsx(y,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsx(C.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function sn(){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 st(t){var r=t,{checked:e=!1}=r,o=f(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(sn,{})})}))}function re(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(I),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.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((i,s,l=!0)=>W(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof m=="function"?m():m!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((i,s)=>W(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 pt({onPrimary:e,onSecondary:o,step:t}){var m,g;let{handlePrimary:r,handleSecondary:n}=re(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s,skipped:l}=t.$state,c=s||l||!i?jsx(st,{checked:s||l,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(C.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(h.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsx(h.Title,{children:t.title}),jsx(h.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(h.Secondary,{disabled:i,onClick:n,title:(m=t.secondaryButton)==null?void 0:m.title}),jsx(h.Primary,{disabled:i,onClick:r,title:(g=t.primaryButton)==null?void 0:g.title})]})]})}var dt=keyframes`
|
|
23
23
|
from {
|
|
24
24
|
opacity: 0;
|
|
25
25
|
}
|
|
26
26
|
to {
|
|
27
27
|
opacity: 1;
|
|
28
28
|
}
|
|
29
|
-
`;function ct(o){var
|
|
29
|
+
`;function ct({flow:e,sort:o,parentProps:{containerProps:t}}){var B,k;let[r,n]=useState(),[i]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(k=(B=Array.from(e.steps.values()).find(T=>!T.$state.completed&&!T.$state.skipped))==null?void 0:B.order)!=null?k:0}),[s,l]=gn(i),[c,m]=useState(),[g,P]=useState();useLayoutEffect(()=>{l&&(c==null&&m(l.canScrollNext()),g==null&&P(l.canScrollPrev()),l.on("select",()=>{m(l.canScrollNext()),P(l.canScrollPrev());}));},[l]),useEffect(()=>{if(!r){let T=Array.from(e.steps.values()),E=T.filter(b=>b.$state.completed||b.$state.skipped).sort((b,R)=>b.order-R.order),H=T.filter(b=>!b.$state.completed&&!b.$state.skipped).sort((b,R)=>b.order-R.order);n(o==="completed-last"?[...H,...E].map(b=>b.id):T.map(b=>b.id));}},[]);let x=e.getNumberOfCompletedSteps(),u=e.getNumberOfAvailableSteps(),{onPrimary:w,onSecondary:S}=t;return r?jsxs(Fragment,{children:[jsxs(C.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:v.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(C.Column,{part:"carousel-header-content",children:[jsx(F.H3,{children:e.title}),jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(C.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",u]}),jsx(xe,{current:x,total:u,minWidth:"200px"})]})]}),jsxs(y,{margin:`0 ${v.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:s,children:[jsx(C.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).sort((T,E)=>r.indexOf(T.id)-r.indexOf(E.id)).map(T=>jsx(pt,{onPrimary:w,onSecondary:S,step:T},T.id))}),g&&jsx(C.Column,{animation:`${dt} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>l.scrollPrev(),padding:"2",children:jsx(ArrowLeftIcon,{height:"24px",width:"24px"})})}),c&&jsx(C.Column,{animation:`${dt} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>l.scrollNext(),padding:"2",children:jsx(ArrowRightIcon,{height:"24px",width:"24px"})})})]})]}):null}function mt(o){var e=f(o,[]);return jsx(U,d(a({as:h,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(ct,a(a({},e),t))}))}var Ee={};ee(Ee,{Content:()=>mo,Root:()=>fo,Trigger:()=>go});var bn=keyframes`
|
|
30
30
|
from {
|
|
31
31
|
height: 0;
|
|
32
32
|
opacity: 0;
|
|
@@ -35,7 +35,7 @@ var Do=Object.defineProperty,nr=Object.defineProperties;var ir=Object.getOwnProp
|
|
|
35
35
|
height: var(--radix-collapsible-content-height);
|
|
36
36
|
opacity: 1;
|
|
37
37
|
}
|
|
38
|
-
`,
|
|
38
|
+
`,hn=keyframes`
|
|
39
39
|
from {
|
|
40
40
|
height: var(--radix-collapsible-content-height);
|
|
41
41
|
opacity: 1;
|
|
@@ -44,7 +44,7 @@ var Do=Object.defineProperty,nr=Object.defineProperties;var ir=Object.getOwnProp
|
|
|
44
44
|
height: 0;
|
|
45
45
|
opacity: 0;
|
|
46
46
|
}
|
|
47
|
-
`,xn=()=>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 bn({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(xn,{})})})}function uo({children:e}){return jsx(he.Content,{asChild:!0,children:jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${gn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${yn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(y,{}),e]})})}function mo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=f(s,["children","disabled","onOpenChange","open"]);return jsx(he.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,part:"collapsible-step"},n),{children:e}))})}function fo({isCompleted:e,isBlocked:o,title:t}){return jsx(he.Trigger,{asChild:!0,children:jsxs(P.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsxs(P.Row,{alignItems:"center",gap:2,children:[jsx(bn,{checked:e}),jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",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 mt=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ft({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var w,S,B,E,v,O;let{$state:{blocked:i,completed:s,skipped:l},subtitle:c,title:u}=n,g=(S=(w=n.primaryButton)==null?void 0:w.title)!=null?S:n.primaryButtonTitle,h=(E=(B=n.secondaryButton)==null?void 0:B.title)!=null?E:n.secondaryButtonTitle,x=(v=n.props)!=null?v:{},m=!!i;return jsxs(mo,d(a({open:t,onOpenChange:r},x),{children:[jsx(fo,{isBlocked:n.$state.blocked,isCompleted:s||l,title:u}),jsxs(uo,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",src:(O=n.videoUri)!=null?O:n.imageUri,type:n.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:c}),jsxs(P.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:h,onClick:o}),jsx(b.Primary,{disabled:m,title:g,onClick:e})]})]})]}))}var Sn={default:ft};function Fn(r){var n=r,{flow:e,step:o}=n,t=f(n,["flow","step"]);var S;let{onPrimary:i,onSecondary:s,openStepId:l,setOpenStepId:c,stepTypes:u}=useContext(mt),{handlePrimary:g,handleSecondary:h}=re(o,{onPrimary:i,onSecondary:s}),x=(l!=null?l:e.getCurrentStep().id)===o.id,m=(S=u[o.type])!=null?S:ft;function w(B){return H(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(m,d(a({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:g,handleSecondary:h}),o.id)}function Ke(l){var c=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,g]=useState(null),h=a(a({},Sn),i);return jsx(mt.Provider,{value:{openStepId:u,setOpenStepId:g,onPrimary:t,onSecondary:r,stepTypes:h},children:jsx(U,d(a({as:b,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:S=>{var B=S,{flow:x,handleDismiss:m}=B,w=f(B,["flow","handleDismiss"]);let v=Array.from(x.steps.entries()).filter(([,F])=>F.$state.visible===!0).map(([,F])=>jsx(Fn,d(a({flow:x,handleDismiss:m},w),{step:F}),F.id)),O=x.getNumberOfCompletedSteps(),W=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(P.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:m,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxs(C.Body2,{fontWeight:"demibold",children:[O,"/",W]}),jsx(xe,{current:O,total:W,flexGrow:1})]})]}),v]})}}))})}var En=new Set(["required","min","max","minLength","maxLength","pattern"]);function On({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(([l])=>En.has(l))),s=useController({name:t.id,control:o,rules:i});return jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function yt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var v,O,W,F,R,k;let{__readOnly:s}=useContext(I),l=useForm({delayError:2e3,mode:"onChange"}),[c,u]=useState(!1),g=[],{control:h,handleSubmit:x}=l,m=(v=i.props)!=null?v:{};function w(V,Se){u(!0),t(Se,V,s===!0).then(()=>u(!1));}(O=i.fields)==null||O.forEach(V=>{e[V.type]!=null&&g.push(jsx(On,{control:h,fieldComponent:e[V.type],fieldData:V,submit:x(w)},`${i.flow.id}-${V.id}`));});let S=(F=(W=i.primaryButton)==null?void 0:W.title)!=null?F:i.primaryButtonTitle,B=(k=(R=i.secondaryButton)==null?void 0:R.title)!=null?k:i.secondaryButtonTitle,E=!!(i.$state.blocked||!l.formState.isValid);return jsxs(P.Column,d(a({gap:5,part:"form-step"},m),{children:[jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,d(a({},l),{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(w),title:S!=null?S:"Submit",loading:c})]},"form-footer")]}))}function xt({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 go({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:l}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),Ee),{"aria-invalid":!!l,value:(u=o.value)!=null?u:""});return jsxs(y,{part:"field",children:[jsx(go,{id:n,required:!!t.required,children:i}),e(c),jsx(xt,{error:l})]})}var Ln=()=>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"})}),An=so.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(Ce.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:Ce.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(Ln,{})})})})]}));function yo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsx(An,{value:s,label:i},s));return jsx(ne,d(a({},e),{children:()=>jsx(Ce.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(P.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Vn=so.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 xo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:l})=>jsx(Vn,{value:l,label:s},l));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 bo(e){return jsx(ne,d(a({},e),{children:o=>jsx(C.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Tt(e){return jsx(ne,d(a({},e),{children:o=>jsx(C.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var _n={radio:yo,select:xo,text:bo,textarea:Tt};function Oe(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=f(i,["fieldTypes","flowId","part"]);let s=Object.assign({},_n,e);return jsx(U,d(a({flowId:o,part:["form",t]},r),{children:l=>jsx(yt,a({fieldTypes:s},l))}))}var Je={};ee(Je,{NPS:()=>Ge});function Rt({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,l)=>{let c=e.value===l?D.Primary:D.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});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=f(s,["as","flowId","fieldTypes","part"]);let{flow:l}=ie(o);return jsx(Oe,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Rt},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||l.skip();},part:["nps",r],css:d(a({},!l||l.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 fe(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 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 l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var qn=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Et(r){var n=r,{style:e={},part:o=""}=n,t=f(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 ${qn}`,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 qe(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);return jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Zn(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ye(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);let i=Zn(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 le(r){var n=r,{src:e,type:o}=n,t=f(n,["src","type"]);return jsx(o==="video"?Ye:qe,a({src:e},t))}function It({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",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[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 Ht(e,o){var i,s,l,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"},h=(E,v)=>["top","bottom"].includes(v)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(l=t.alignOffset)!=null?l:0,m=(c=t.style)!=null?c:{},w=(u=t.side)!=null?u:"bottom",S=t.align;t.style=d(a({},m),{[h(S,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}var Mt=keyframes`
|
|
47
|
+
`,Pn=()=>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 Cn({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(Pn,{})})})}function mo({children:e}){return jsx(he.Content,{asChild:!0,children:jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${bn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${hn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(y,{}),e]})})}function fo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=f(s,["children","disabled","onOpenChange","open"]);return jsx(he.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,part:"collapsible-step"},n),{children:e}))})}function go({isCompleted:e,isBlocked:o,title:t}){return jsx(he.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",part:"collapsible-header",children:[jsxs(C.Row,{alignItems:"center",gap:2,children:[jsx(Cn,{checked:e}),jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",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 gt=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function yt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var w,S,B,k,T,E;let{$state:{blocked:i,completed:s,skipped:l},subtitle:c,title:m}=n,g=(S=(w=n.primaryButton)==null?void 0:w.title)!=null?S:n.primaryButtonTitle,P=(k=(B=n.secondaryButton)==null?void 0:B.title)!=null?k:n.secondaryButtonTitle,x=(T=n.props)!=null?T:{},u=!!i;return jsxs(fo,d(a({open:t,onOpenChange:r},x),{children:[jsx(go,{isBlocked:n.$state.blocked,isCompleted:s||l,title:m}),jsxs(mo,{children:[jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(E=n.videoUri)!=null?E:n.imageUri,type:n.videoUri?"video":"image"}),jsx(h.Subtitle,{color:"neutral.400",children:c}),jsxs(C.Row,{gap:3,part:"collapsible-footer",children:[jsx(h.Secondary,{title:P,onClick:o}),jsx(h.Primary,{disabled:u,title:g,onClick:e})]})]})]}))}var Tn={default:yt};function vn(r){var n=r,{flow:e,step:o}=n,t=f(n,["flow","step"]);var S;let{onPrimary:i,onSecondary:s,openStepId:l,setOpenStepId:c,stepTypes:m}=useContext(gt),{handlePrimary:g,handleSecondary:P}=re(o,{onPrimary:i,onSecondary:s}),x=(l!=null?l:e.getCurrentStep().id)===o.id,u=(S=m[o.type])!=null?S:yt;function w(B){return W(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(u,d(a({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:g,handleSecondary:P}),o.id)}function Ue(l){var c=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[m,g]=useState(null),P=a(a({},Tn),i);return jsx(gt.Provider,{value:{openStepId:m,setOpenStepId:g,onPrimary:t,onSecondary:r,stepTypes:P},children:jsx(U,d(a({as:h,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:S=>{var B=S,{flow:x,handleDismiss:u}=B,w=f(B,["flow","handleDismiss"]);let T=Array.from(x.steps.entries()).filter(([,b])=>b.$state.visible===!0).map(([,b])=>jsx(vn,d(a({flow:x,handleDismiss:u},w),{step:b}),b.id)),E=x.getNumberOfCompletedSteps(),H=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(C.Column,{gap:2,children:[jsx(h.Header,{dismissible:e,handleDismiss:u,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxs(F.Body2,{fontWeight:"demibold",children:[E,"/",H]}),jsx(xe,{current:E,total:H,flexGrow:1})]})]}),T]})}}))})}var Hn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Wn({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(([l])=>Hn.has(l))),s=useController({name:t.id,control:o,rules:i});return jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function bt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var T,E,H,b,R,D;let{__readOnly:s}=useContext(I),l=useForm({delayError:2e3,mode:"onChange"}),[c,m]=useState(!1),g=[],{control:P,handleSubmit:x}=l,u=(T=i.props)!=null?T:{};function w(V,Se){m(!0),t(Se,V,s===!0).then(()=>m(!1));}(E=i.fields)==null||E.forEach(V=>{e[V.type]!=null&&g.push(jsx(Wn,{control:P,fieldComponent:e[V.type],fieldData:V,submit:x(w)},`${i.flow.id}-${V.id}`));});let S=(b=(H=i.primaryButton)==null?void 0:H.title)!=null?b:i.primaryButtonTitle,B=(D=(R=i.secondaryButton)==null?void 0:R.title)!=null?D:i.secondaryButtonTitle,k=!!(i.$state.blocked||!l.formState.isValid);return jsxs(C.Column,d(a({gap:5,part:"form-step"},u),{children:[jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,d(a({},l),{children:g})),jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsx(O.Secondary,{disabled:k,onClick:r,title:B}),jsx(O.Primary,{disabled:k||c,onClick:x(w),title:S!=null?S:"Submit",loading:c})]},"form-footer")]}))}function ht({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function yo({children:e,id:o,required:t=!1}){return jsxs(F.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 De={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 m;let{id:n,label:i,placeholder:s}=t,{error:l}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),De),{"aria-invalid":!!l,value:(m=o.value)!=null?m:""});return jsxs(y,{part:"field",children:[jsx(yo,{id:n,required:!!t.required,children:i}),e(c),jsx(ht,{error:l})]})}var Nn=()=>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"})}),Vn=lo.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(F.Body2,{part:"field-radio-label",children:e}),jsx(Ce.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:Ce.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(Nn,{})})})})]}));function xo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsx(Vn,{value:s,label:i},s));return jsx(ne,d(a({},e),{children:()=>jsx(Ce.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Kn=lo.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(F.Body2,{part:"field-select-option-label",children:e})})})}));function bo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:l})=>jsx(Kn,{value:l,label:s},l));return jsx(ne,d(a({},e),{children:()=>jsxs(N.Root,{value:t,onValueChange:o,children:[jsx(N.Trigger,{asChild:!0,children:jsxs(F.Body2,d(a({},De),{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({},De),{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 ho(e){return jsx(ne,d(a({},e),{children:o=>jsx(F.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Bt(e){return jsx(ne,d(a({},e),{children:o=>jsx(F.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var Un={radio:xo,select:bo,text:ho,textarea:Bt};function Oe(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=f(i,["fieldTypes","flowId","part"]);let s=Object.assign({},Un,e);return jsx(U,d(a({flowId:o,part:["form",t]},r),{children:l=>jsx(bt,a({fieldTypes:s},l))}))}var Xe={};ee(Xe,{NPS:()=>Je});function Et({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,l)=>{let c=e.value===l?O.Primary:O.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});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(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Je(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=f(s,["as","flowId","fieldTypes","part"]);let{flow:l}=ie(o);return jsx(Oe,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Et},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||l.skip();},part:["nps",r],css:d(a({},!l||l.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 fe(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&W(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=>W(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function qe(){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 l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var Zn=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function It(r){var n=r,{style:e={},part:o=""}=n,t=f(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 ${Zn}`,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 Ye(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);return jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function ti(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Qe(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);let i=ti(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 le(r){var n=r,{src:e,type:o}=n,t=f(n,["src","type"]);return jsx(o==="video"?Qe:Ye,a({src:e},t))}function Wt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[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 Ze={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Mt(e,o){var i,s,l,c,m;let t=Object.fromEntries(Ze.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(Ze.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!Ze.content.includes(g)&&!Ze.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"},P=(k,T)=>["top","bottom"].includes(T)?k=="after"?"marginLeft":"marginRight":k=="after"?"marginTop":"marginBottom",x=(l=t.alignOffset)!=null?l:0,u=(c=t.style)!=null?c:{},w=(m=t.side)!=null?m:"bottom",S=t.align;t.style=d(a({},u),{[P(S,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}var At=keyframes`
|
|
48
48
|
from {
|
|
49
49
|
opacity: 0;
|
|
50
50
|
}
|
|
@@ -54,7 +54,7 @@ var Do=Object.defineProperty,nr=Object.defineProperties;var ir=Object.getOwnProp
|
|
|
54
54
|
to {
|
|
55
55
|
opacity: 1;
|
|
56
56
|
}
|
|
57
|
-
`;function Wt(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(s){var l=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=l,i=f(l,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:g}=Xe(),{node:h,rect:x,ref:m}=Xe(),Ro=Ht(i,u),{contentProps:w,otherProps:Le}=Ro,we=Le,{part:S}=we,B=f(we,["part"]),{rootProps:E}=Ro,[v,O]=useState(w.align),[W,F]=useState(w.side),[R,k]=useState(0),[V,Se]=useState(0);if(c!==null){let _=c.getAttribute("data-align"),Q=c.getAttribute("data-side");v!==_&&O(_),W!==Q&&F(Q);}let se=useRef(null);if(useEffect(()=>{let _=document.querySelector(e);_!=null?(m(_),se.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function _(ye){if(ye.matches(e))return Wt(ye)?ye:null;let pe=ye.querySelectorAll(e);return pe.length>0&&Wt(pe[0])?pe[0]:null}let Q=new MutationObserver(ye=>{for(let pe of ye)if(pe.type==="childList"){for(let Te of pe.addedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){m(de),se.current=de,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",de);break}}for(let Te of pe.removedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){m(null),se.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",de);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),useEffect(()=>{let{scrollX:_,scrollY:Q}=window;k(x.left+_),Se(x.top+Q);},[x.left,x.top]),h==null)return null;let We="0";typeof window!="undefined"&&(We=window.getComputedStyle(h).borderRadius);let Fe=It({props:i,alignAttr:v,sideAttr:W});return jsxs(Z.Root,d(a({defaultOpen:!0},E),{children:[jsx(Z.Anchor,{virtualRef:se}),jsx(Z.Portal,{children:jsxs(Fragment,{children:[r&&jsx(y,a({animation:`${Mt} 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},w),{ref:g,children:jsxs(b,d(a({animation:`${Mt} 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(Et,{style:Fe}),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=f(r,["src"]);return e==null?null:jsx(le,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=f(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=f(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=f(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=f(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=f(r,["children"]);return e==null?null:jsx(C.H4,d(a({part:"title"},o),{children:e}))};function Lt(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=u,l=f(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,v,O,W,F,R;let{handleDismiss:g}=fe(o,{onDismiss:t}),{handlePrimary:h,handleSecondary:x}=re(s,{onPrimary:n,onSecondary:i}),m=(E=s.props)!=null?E:{},w=(O=(v=s.primaryButton)==null?void 0:v.title)!=null?O:s.primaryButtonTitle,S=(F=(W=s.secondaryButton)==null?void 0:W.title)!=null?F: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()},l),m),{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.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsx($.Primary,{disabled:B,onClick:h,title:w})]})]}),s.id)}function Ie(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(I),[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 l(){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:l}}function So(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=f(s,["flowId","onComplete","variables","part"]);let[l,c]=useState(!1),{flow:u}=ie(e,{variables:t}),{hasInitialized:g,registerComponent:h,unregisterComponent:x}=useContext(I);fe(u,{onComplete:o});let{isCurrentModal:m,removeModal:w}=Ie(u);if(useEffect(()=>{!(u!=null&&u.isVisible)&&m&&w();},[u==null?void 0:u.isVisible,m]),useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!m||(h(e,()=>{l||c(!0);}),!g||!l))return null;let S=u.getCurrentStep();return S==null||S.start(),jsx(Lt,a({"data-flow-id":u.id,flow:u,part:["tour",r],step:S},n))}function Vt(e){let[o,t]=useState(),[r,n]=useState(),{flow:i}=ie(r),{frigade:s}=useContext(I);return useEffect(()=>{H(this,null,function*(){var u;let l=yield s.getCollection(e);if(!l||s.hasFailedToLoad()){t(void 0);return}let c=(u=l.flows.find(({flow:g})=>g.isVisible))==null?void 0:u.flow;c!=null&&c.id!==r&&n(c.id),t(l);});},[e,i==null?void 0:i.isVisible]),{collection:o,currentFlow:i}}function Fo(r){var n=r,{collectionId:e,part:o}=n,t=f(n,["collectionId","part"]);var c,u;let i={ANNOUNCEMENT:wo,BANNER:lo,CARD:b,CHECKLIST:Ke,EMBEDDED_TIP:b,FORM:Oe,NPS_SURVEY:Ge,TOUR:So},{currentFlow:s}=Vt(e),l=(u=i[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?u:null;return s==null||l==null?null:jsx(y,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsx(l,{flowId:s.id},s.id)}))}function He(){let{frigade:e}=useContext(I);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function zt(){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 I=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function Kt(){let{frigade:e}=He();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 Xt(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=l,i=f(l,["children","css","defaultCollection","navigate","theme"]);let c=n?to(n):{},[u,g]=useState(new Set),h=useRef(new Map),x=useRef(),[m,w]=useState(!1),S=useMemo(()=>(w(!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 F=S.getConfig();F.__flowStateOverrides=i.__flowStateOverrides,S.reload(F);}},[i.__flowStateOverrides]);function B(){let F=[...h.current.entries()].map(([R,k])=>[R,k.callback]);S.batchRegister(F),w(!0);}function E(F,R){if(x.current&&clearTimeout(x.current),m){h.current.has(F)?S.getFlow(F).then(k=>R(k.isVisible)):(S.getFlow(F).then(k=>k.register(R)),h.current.set(F,{callback:R}));return}h.current.has(F)||h.current.set(F,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function v(F){h.current.has(F)&&S.getFlow(F).then(R=>{h.current.delete(F),R==null||R.unregister();});}let O=r!=null?r:(F,R="_self")=>{window.open(F,R);};useEffect(()=>()=>{S.destroy();},[]);let W=u.size>0?u.values().next().value:null;return jsxs(I.Provider,{value:d(a({modals:u,setModals:g,currentModal:W,navigate:O},i),{frigade:S,registerComponent:E,unregisterComponent:v,hasInitialized:m}),children:[jsx(Global,{styles:{":root":a(a(a({},ro),c),o)}}),jsxs(ThemeProvider,{theme:T,children:[t&&jsx(zt,{}),e]}),i.preloadImages!==!1&&jsx(Kt,{})]})}function ie(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:i}=useContext(I),s=useCallback(l=>{l.id===e&&(o!=null&&o.variables&&l.applyVariables(o.variables),setTimeout(()=>{r(l),n(Math.random().toString());},0));},[o==null?void 0:o.variables,e,i]);return useEffect(()=>{if(!(!(i!=null&&i.isReady())||e==null))return H(this,null,function*(){let l=yield i.getFlow(e);if(!l||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&l.applyVariables(o.variables),r(l);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[e,i,s]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function U(u){var g=u,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:s,variables:l}=g,c=f(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var we,Q;let[h,x]=useState(!1),{flow:m}=ie(t,{variables:l}),_=a(a({},(we=m==null?void 0:m.props)!=null?we:{}),c),{dismissible:w=!1,forceMount:S=!1,modal:B=!1}=_,E=f(_,["dismissible","forceMount","modal"]),{hasInitialized:v,registerComponent:O,unregisterComponent:W}=useContext(I),F=m==null?void 0:m.getCurrentStep(),{handleDismiss:R}=fe(m,{onComplete:r,onDismiss:n}),{handlePrimary:k,handleSecondary:V}=re(F,{onPrimary:i,onSecondary:s}),Se=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((Q=m==null?void 0:m.rawData)==null?void 0:Q.flowType),{isCurrentModal:se,removeModal:We}=Ie(m,Se);useEffect(()=>{!(m!=null&&m.isVisible)&&se&&We();},[m==null?void 0:m.isVisible,se]),useEffect(()=>()=>{W(t);},[]),useEffect(()=>{(m!=null&&m.isCompleted||m!=null&&m.isSkipped)&&W(t);},[m==null?void 0:m.isCompleted,m==null?void 0:m.isSkipped]);let Fe=S&&((m==null?void 0:m.isCompleted)||(m==null?void 0:m.isSkipped));if(!m||!Fe&&!se||(O(t,()=>{h||x(!0);}),!m.isVisible&&!Fe)||!v||!h)return null;(Fe||!m.isCompleted&&!m.isSkipped)&&F.start();let Ro=e===null?Fragment$1:e!=null?e:y,Le=d(a({},E),{"data-flow-id":m.id});return jsx(Ro,d(a({},e===null?{}:Le),{children:o({flow:m,handleDismiss:R,handlePrimary:k,handleSecondary:V,parentProps:{dismissible:w,flowId:t,variables:l,containerProps:Le},step:F})}))}function er(t){var r=t,{part:e}=r,o=f(r,["part"]);return jsx(U,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:l},step:c})=>{var h,x,m,w;let u=(x=(h=c.primaryButton)==null?void 0:h.title)!=null?x:c.primaryButtonTitle,g=(w=(m=c.secondaryButton)==null?void 0:m.title)!=null?w:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:l,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:g,onClick:s}),jsx(b.Primary,{title:u,onClick:i})]})]})}}))}var b=so.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=f(i,["children","flowId"]);var l;if(o!=null)return jsx(er,a({flowId:o},t));let s=(l=t.as)!=null?l: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}))});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=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(P.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=f(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(le,a({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(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=f(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=f(r,["children"]);return e==null?null:jsx(C.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(C.H4,d(a({display:"block",part:"title"},o),{children:e}))};var eo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function tr(e){let o=Object.fromEntries(eo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(eo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!eo.content.some(i=>i===n)&&!eo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Ii=keyframes`
|
|
57
|
+
`;function Lt(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(s){var l=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=l,i=f(l,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:g}=qe(),{node:P,rect:x,ref:u}=qe(),ko=Mt(i,m),{contentProps:w,otherProps:Ae}=ko,we=Ae,{part:S}=we,B=f(we,["part"]),{rootProps:k}=ko,[T,E]=useState(w.align),[H,b]=useState(w.side),[R,D]=useState(0),[V,Se]=useState(0);if(c!==null){let _=c.getAttribute("data-align"),Q=c.getAttribute("data-side");T!==_&&E(_),H!==Q&&b(Q);}let se=useRef(null);if(useEffect(()=>{let _=document.querySelector(e);_!=null?(u(_),se.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function _(ye){if(ye.matches(e))return Lt(ye)?ye:null;let pe=ye.querySelectorAll(e);return pe.length>0&&Lt(pe[0])?pe[0]:null}let Q=new MutationObserver(ye=>{for(let pe of ye)if(pe.type==="childList"){for(let Te of pe.addedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){u(de),se.current=de,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",de);break}}for(let Te of pe.removedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){u(null),se.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",de);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),useEffect(()=>{let{scrollX:_,scrollY:Q}=window;D(x.left+_),Se(x.top+Q);},[x.left,x.top]),P==null)return null;let Me="0";typeof window!="undefined"&&(Me=window.getComputedStyle(P).borderRadius);let Fe=Wt({props:i,alignAttr:T,sideAttr:H});return jsxs(Z.Root,d(a({defaultOpen:!0},k),{children:[jsx(Z.Anchor,{virtualRef:se}),jsx(Z.Portal,{children:jsxs(Fragment,{children:[r&&jsx(y,a({animation:`${At} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:Me,height:x.height,left:R,top:V,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsx(Z.Content,d(a({asChild:!0},w),{ref:g,children:jsxs(h,d(a({animation:`${At} 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(It,{style:Fe}),o]}))}))]})})]}))}$.Close=e=>jsx(Z.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.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=f(r,["src"]);return e==null?null:jsx(le,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=f(n,["onClick","title"]);return o==null?null:jsx(O.Primary,a({title:o,onClick:e},t))};$.Progress=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.Body2,d(a({part:"progress"},o),{children:e}))};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(O.Secondary,a({title:o,onClick:e},t))};$.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.Body2,d(a({part:"subtitle"},o),{children:e}))};$.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.H4,d(a({part:"title"},o),{children:e}))};function $t(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=m,l=f(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var k,T,E,H,b,R;let{handleDismiss:g}=fe(o,{onDismiss:t}),{handlePrimary:P,handleSecondary:x}=re(s,{onPrimary:n,onSecondary:i}),u=(k=s.props)!=null?k:{},w=(E=(T=s.primaryButton)==null?void 0:T.title)!=null?E:s.primaryButtonTitle,S=(b=(H=s.secondaryButton)==null?void 0:H.title)!=null?b:s.secondaryButtonTitle,B=s.$state.blocked;return jsxs($,d(a(a({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:D=>D.preventDefault(),onPointerDownOutside:D=>D.preventDefault(),onInteractOutside:D=>D.preventDefault()},l),u),{onEscapeKeyDown:D=>{typeof r=="function"&&r(D),D.defaultPrevented||g(D);},children:[e&&jsx($.Close,{onClick:g}),jsx($.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsx($.Title,{children:s.title}),jsx($.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($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsx($.Primary,{disabled:B,onClick:P,title:w})]})]}),s.id)}function Ie(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(I),[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 l(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let m=new Set(c);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:i||!o,removeModal:l}}function Fo(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=f(s,["flowId","onComplete","variables","part"]);let[l,c]=useState(!1),{flow:m}=ie(e,{variables:t}),{hasInitialized:g,registerComponent:P,unregisterComponent:x}=useContext(I);fe(m,{onComplete:o});let{isCurrentModal:u,removeModal:w}=Ie(m);if(useEffect(()=>{!(m!=null&&m.isVisible)&&u&&w();},[m==null?void 0:m.isVisible,u]),useEffect(()=>()=>{x(e);},[]),m==null||m.isVisible===!1||!u||(P(e,()=>{l||c(!0);}),!g||!l))return null;let S=m.getCurrentStep();return S==null||S.start(),jsx($t,a({"data-flow-id":m.id,flow:m,part:["tour",r],step:S},n))}function zt(e){let[o,t]=useState(),[r,n]=useState(),{flow:i}=ie(r),{frigade:s}=useContext(I);return useEffect(()=>{W(this,null,function*(){var m;let l=yield s.getCollection(e);if(!l||s.hasFailedToLoad()){t(void 0);return}let c=(m=l.flows.find(({flow:g})=>g.isVisible))==null?void 0:m.flow;c!=null&&c.id!==r&&n(c.id),t(l);});},[e,i==null?void 0:i.isVisible]),{collection:o,currentFlow:i}}function wo(r){var n=r,{collectionId:e,part:o}=n,t=f(n,["collectionId","part"]);var c,m;let i={ANNOUNCEMENT:To,BANNER:po,CARD:h,CHECKLIST:Ue,EMBEDDED_TIP:h,FORM:Oe,NPS_SURVEY:Je,TOUR:Fo},{currentFlow:s}=zt(e),l=(m=i[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?m:null;return s==null||l==null?null:jsx(y,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsx(l,{flowId:s.id},s.id)}))}function He(){let{frigade:e}=useContext(I);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Ut(){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(wo,{as:null,collectionId:e})}var I=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function jt(){let{frigade:e}=He();return useEffect(()=>{W(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 Yt(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=l,i=f(l,["children","css","defaultCollection","navigate","theme"]);let c=n?ro(n):{},[m,g]=useState(new Set),P=useRef(new Map),x=useRef(),[u,w]=useState(!1),S=useMemo(()=>(w(!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 b=S.getConfig();b.__flowStateOverrides=i.__flowStateOverrides,S.reload(b);}},[i.__flowStateOverrides]);function B(){let b=[...P.current.entries()].map(([R,D])=>[R,D.callback]);S.batchRegister(b),w(!0);}function k(b,R){if(x.current&&clearTimeout(x.current),u){P.current.has(b)?S.getFlow(b).then(D=>R(D.isVisible)):(S.getFlow(b).then(D=>D.register(R)),P.current.set(b,{callback:R}));return}P.current.has(b)||P.current.set(b,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function T(b){P.current.has(b)&&S.getFlow(b).then(R=>{P.current.delete(b),R==null||R.unregister();});}let E=r!=null?r:(b,R="_self")=>{window.open(b,R);};useEffect(()=>()=>{S.destroy();},[]);let H=m.size>0?m.values().next().value:null;return jsxs(I.Provider,{value:d(a({modals:m,setModals:g,currentModal:H,navigate:E},i),{frigade:S,registerComponent:k,unregisterComponent:T,hasInitialized:u}),children:[jsx(Global,{styles:{":root":a(a(a({},no),c),o)}}),jsxs(ThemeProvider,{theme:v,children:[t&&jsx(Ut,{}),e]}),i.preloadImages!==!1&&jsx(jt,{})]})}function ie(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:i}=useContext(I),s=useCallback(l=>{l.id===e&&(o!=null&&o.variables&&l.applyVariables(o.variables),setTimeout(()=>{r(l),n(Math.random().toString());},0));},[o==null?void 0:o.variables,e,i]);return useEffect(()=>{if(!(!(i!=null&&i.isReady())||e==null))return W(this,null,function*(){let l=yield i.getFlow(e);if(!l||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&l.applyVariables(o.variables),r(l);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[e,i,s]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function U(m){var g=m,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:s,variables:l}=g,c=f(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var we,Q;let[P,x]=useState(!1),{flow:u}=ie(t,{variables:l}),_=a(a({},(we=u==null?void 0:u.props)!=null?we:{}),c),{dismissible:w=!1,forceMount:S=!1,modal:B=!1}=_,k=f(_,["dismissible","forceMount","modal"]),{hasInitialized:T,registerComponent:E,unregisterComponent:H}=useContext(I),b=u==null?void 0:u.getCurrentStep(),{handleDismiss:R}=fe(u,{onComplete:r,onDismiss:n}),{handlePrimary:D,handleSecondary:V}=re(b,{onPrimary:i,onSecondary:s}),Se=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((Q=u==null?void 0:u.rawData)==null?void 0:Q.flowType),{isCurrentModal:se,removeModal:Me}=Ie(u,Se);useEffect(()=>{!(u!=null&&u.isVisible)&&se&&Me();},[u==null?void 0:u.isVisible,se]),useEffect(()=>()=>{H(t);},[]),useEffect(()=>{(u!=null&&u.isCompleted||u!=null&&u.isSkipped)&&H(t);},[u==null?void 0:u.isCompleted,u==null?void 0:u.isSkipped]);let Fe=S&&((u==null?void 0:u.isCompleted)||(u==null?void 0:u.isSkipped));if(!u||!Fe&&!se||(E(t,()=>{P||x(!0);}),!u.isVisible&&!Fe)||!T||!P)return null;(Fe||!u.isCompleted&&!u.isSkipped)&&b.start();let ko=e===null?Fragment$1:e!=null?e:y,Ae=d(a({},k),{"data-flow-id":u.id});return jsx(ko,d(a({},e===null?{}:Ae),{children:o({flow:u,handleDismiss:R,handlePrimary:D,handleSecondary:V,parentProps:{dismissible:w,flowId:t,variables:l,containerProps:Ae},step:b})}))}function tr(t){var r=t,{part:e}=r,o=f(r,["part"]);return jsx(U,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:l},step:c})=>{var P,x,u,w;let m=(x=(P=c.primaryButton)==null?void 0:P.title)!=null?x:c.primaryButtonTitle,g=(w=(u=c.secondaryButton)==null?void 0:u.title)!=null?w:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:l,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsx(h.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:g,onClick:s}),jsx(h.Primary,{title:m,onClick:i})]})]})}}))}var h=lo.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=f(i,["children","flowId"]);var l;if(o!=null)return jsx(tr,a({flowId:o},t));let s=(l=t.as)!=null?l: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}))});h.Dismiss=e=>jsx(O.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=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(C.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=f(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(le,a({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Primary,a({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Secondary,a({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.H4,d(a({display:"block",part:"title"},o),{children:e}))};var oo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function nr(e){let o=Object.fromEntries(oo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(oo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!oo.content.some(i=>i===n)&&!oo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Mi=keyframes`
|
|
58
58
|
from {
|
|
59
59
|
opacity: 0;
|
|
60
60
|
}
|
|
@@ -64,8 +64,8 @@ var Do=Object.defineProperty,nr=Object.defineProperties;var ir=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=f(i,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:g}=
|
|
67
|
+
`;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=f(i,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:g}=nr(r),P=g,{zIndex:c}=P,m=f(P,["zIndex"]);return jsx(K.Root,d(a({defaultOpen:!0,modal:t},s),{children:jsx(K.Portal,{children:jsxs(y,{animation:`${Mi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(K.Overlay,{asChild:!0,children:jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(K.Content,d(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},l),{children:jsx(h,d(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}M.Dismiss=e=>jsx(K.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.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=f(r,["children"]);return jsx(K.Description,{asChild:!0,children:jsx(F.Body2,d(a({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsx(le,a({borderRadius:"md",src:e},o))};M.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(O.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?v.colors.blue500:v.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=f(n,["onClick","title"]);return o==null?null:jsx(O.Secondary,a({title:o,onClick:e},t))};M.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsx(K.Title,{asChild:!0,children:jsx(F.H4,d(a({part:"title"},o),{children:e}))})};M.displayName="Dialog";var ir=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function To(r){var n=r,{flowId:e,part:o}=n,t=f(n,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([l])=>ir.some(c=>l===c))),s=Object.fromEntries(Object.entries(t).filter(([l])=>ir.indexOf(l)===-1));return jsx(U,d(a({as:null,flowId:e},i),{children:({flow:l,handleDismiss:c,handlePrimary:m,handleSecondary:g,parentProps:{containerProps:P,dismissible:x},step:u})=>{var T,E,H,b,R,D;let w=(T=u.props)!=null?T:{},S=(H=(E=u.primaryButton)==null?void 0:E.title)!=null?H:u.primaryButtonTitle,B=(R=(b=u.secondaryButton)==null?void 0:b.title)!=null?R:u.secondaryButtonTitle,k=u.$state.blocked;return jsx(M,d(a(a({part:["announcement",o],textAlign:"center"},P),s),{onEscapeKeyDown:V=>{if(t.dismissible===!1){V.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(V),V.defaultPrevented||c(V);},children:jsxs(C.Column,d(a({gap:5,part:"announcement-step"},w),{children:[x&&jsx(M.Dismiss,{onClick:c}),jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsx(M.Title,{children:u.title}),jsx(M.Subtitle,{children:u.subtitle})]}),jsx(M.Media,{src:(D=u.videoUri)!=null?D:u.imageUri,type:u.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(M.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsx(M.Secondary,{disabled:k,onClick:g,title:B}),S&&jsx(M.Primary,{disabled:k,onClick:m,title:S})]})]}))}))}}))}function $i(){let{userId:e,frigade:o}=useContext(I);function t(n){return W(this,null,function*(){yield o.identify(e,n);})}function r(n,i){return W(this,null,function*(){yield o.track(n,i);})}return {userId:e,addProperties:t,track:r}}function Vi(){var n;let{frigade:e}=useContext(I);function o(i){return W(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 W(this,null,function*(){yield e.track(i,s);})}function r(i,s){return W(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 {
|
|
69
|
+
export { To as Announcement, po as Banner, ne as BaseField, y as Box, O as Button, h as Card, je as Checklist, wo as Collection, M as Dialog, C as Flex, U as Flow, Oe as Form, Ye as Image, yo as Label, le as Media, Re as Progress, Yt as Provider, xo as RadioField, bo as SelectField, Xe as Survey, F as Text, ho as TextField, $ as Tooltip, Fo as Tour, Qe as Video, no as themeVariables, Ne as tokens, qe as useBoundingClientRect, ie as useFlow, fe as useFlowHandlers, He as useFrigade, Vi as useGroup, Ie as useModal, re as useStepHandlers, $i as useUser };
|
|
70
70
|
//# sourceMappingURL=out.js.map
|
|
71
71
|
//# sourceMappingURL=index.js.map
|