@frigade/react 2.1.27 → 2.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -46,7 +46,7 @@ var ye__namespace = /*#__PURE__*/_interopNamespace(ye);
46
46
  var V__namespace = /*#__PURE__*/_interopNamespace(V);
47
47
  var Y__namespace = /*#__PURE__*/_interopNamespace(Y);
48
48
 
49
- var fo=Object.defineProperty,Ht=Object.defineProperties;var Mt=Object.getOwnPropertyDescriptors;var Be=Object.getOwnPropertySymbols;var go=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable;var mo=(e,o,t)=>o in e?fo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))go.call(o,t)&&mo(e,t,o[t]);if(Be)for(var t of Be(o))yo.call(o,t)&&mo(e,t,o[t]);return e},d=(e,o)=>Ht(e,Mt(o));var Wt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var m=(e,o)=>{var t={};for(var n in e)go.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Be)for(var n of Be(e))o.indexOf(n)<0&&yo.call(e,n)&&(t[n]=e[n]);return t};var Q=(e,o)=>{for(var t in o)fo(e,t,{get:o[t],enumerable:!0});};var A=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{p(t.next(c));}catch(u){r(u);}},s=c=>{try{p(t.throw(c));}catch(u){r(u);}},p=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,s);p((t=t.apply(e,o)).next());});var xo={borderWidths:{md:"1px"}};var Re=[5,10,20,35,50,65,80,95,98],bo=[...Re],Ve=[...Re];bo[4]=40;Ve[4]=60;var At={blue:{h:213,s:100,l:Re},gray:{h:220,s:10,l:Re},green:{h:141,s:90,l:bo},red:{h:9,s:90,l:Ve},yellow:{h:50,s:90,l:Ve}};var M={};for(let[e,{h:o,s:t,l:n}]of Object.entries(At))M[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var ho=d(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},M),{gray100:M.gray[100],gray200:M.gray[200],gray300:M.gray[300],gray400:M.gray[400],gray500:M.gray[500],gray600:M.gray[600],gray700:M.gray[700],gray800:M.gray[800],gray900:M.gray[900],blue400:M.blue[400],blue500:M.blue[500],blue800:M.blue[800],blue900:M.blue[900],green400:M.blue[400],green500:M.green[500],green800:M.green[800],red500:M.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Po={md:"8px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Co={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var So={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Lt="px",$t=e=>typeof e=="number"?`${4*e}${Lt}`:e,Vt=[-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"],Fo=Object.fromEntries(Vt.map(e=>[e,$t(e)]));var To={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 ke=d(i(d(i({},xo),{colors:i(i({},ho),Co)}),To),{radii:Po,shadows:So,space:Fo});function Pe(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let s=`${o.length?`${o}${t}`:""}${r}`,p=e[r];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(n,Pe(p,s,t)):n[s]=p,n},{})}function _e(e){let o=Pe(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function wo(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=wo(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var ze=_e(ke),v=wo(ke);var zt=new Set(["alt","size","src"]),Nt=_t__default.default.all.filter(e=>e.indexOf("-")!=0&&!zt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Kt=Object.fromEntries(Nt),De=Pe(v.colors),jt={color:De,backgroundColor:De,borderColor:De,border:i(i({},v.borderWidths),De),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},vo=i(i({},Kt),jt),Bo={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"]},Ro=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Ut(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 ko=new Map(Object.entries(vo).map(([e,o])=>[e,Ut(o)])),Gt=new Map(Object.entries(Bo).map(([e,o])=>[e,new Set(o)])),Jt=new Set(["height","width"]),Xt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Do(e){let[o,t]=e.split(":");return [o,Ro.has(t)?t:null]}function Oo(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let p=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[p]==null&&(n[p]={}),n[p]}return Object.entries(t).forEach(([a,s])=>{let[p,c]=Do(a),u=Gt.get(p);u!=null&&(u.forEach(g=>{let b=`${g}${c?":"+c:""}`;t[b]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[p,c]=Do(a),u=ko.get(p);if(u!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");r(c)[p]=g.map(b=>{var f;return (f=u.get(b.toString()))!=null?f:b}).join(" ");}else u.has(s.toString())?r(c)[p]=u.get(s.toString()):r(c)[p]=s;(typeof o!="string"||!Xt.has(o)||!Jt.has(p))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&ko.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function Yt(){if(typeof window=="undefined"){let{JSDOM:e}=Wt("jsdom");return new e("<!DOCTYPE html>").window}return window}function Eo(e){return e?{__html:qt__default.default(Yt()).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 Zt(e){return e&&`fr-${e}`}function Mo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Mo(o)).join(" "):Zt(e))}function er(p,s){var c=p,{as:e,children:o,className:t,css:n={},part:r}=c,a=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:g,unmatchedProps:b}=Oo(a,u),f=Mo(r),C=t||f?clsx.clsx(t,f):void 0,h=[{boxSizing:"border-box"},g,n];return typeof o=="string"?jsxRuntime.jsx(u,d(i({className:C,css:h},b),{ref:s,dangerouslySetInnerHTML:Eo(o)})):jsxRuntime.jsx(u,d(i({className:C,css:h},b),{ref:s,children:o}))}var y=Ue__namespace.forwardRef(er);var D={};Q(D,{Link:()=>kr,Plain:()=>Dr,Primary:()=>Br,Secondary:()=>Rr});var F={};Q(F,{Body1:()=>xr,Body2:()=>br,Caption:()=>hr,Display1:()=>cr,Display2:()=>ur,H1:()=>mr,H2:()=>fr,H3:()=>gr,H4:()=>yr});var Ne={};Q(Ne,{Body1:()=>sr,Body2:()=>lr,Caption:()=>pr,Display1:()=>or,Display2:()=>tr,H1:()=>rr,H2:()=>nr,H3:()=>ir,H4:()=>ar});var Z={color:"neutral.foreground",fontFamily:"default",margin:"0"},or=d(i({},Z),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),tr=d(i({},Z),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),rr=d(i({},Z),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),nr=d(i({},Z),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),ir=d(i({},Z),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),ar=d(i({},Z),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),sr=d(i({},Z),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),lr=d(i({},Z),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),pr=d(i({},Z),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var dr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ee=Object.fromEntries(dr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Ue__namespace.forwardRef((p,s)=>{var c=p,{as:n=o,children:r}=c,a=m(c,["as","children"]);return jsxRuntime.jsx(y,d(i(i({as:n},Ne[e]),a),{ref:s,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),cr=ee.Display1,ur=ee.Display2,mr=ee.H1,fr=ee.H2,gr=ee.H3,yr=ee.H4,xr=ee.Body1,br=ee.Body2,hr=ee.Caption;var je={};Q(je,{Link:()=>Tr,Plain:()=>wr,Primary:()=>Sr,Secondary:()=>Fr,loadingCSSStyle:()=>Ke});var Oe={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Sr=d(i({},Oe),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),Fr=d(i({},Oe),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),Tr=d(i({},Oe),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),wr=d(i({},Oe),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),vr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Ke={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:vr+" 1s ease infinite"}};function Ee(s){var p=s,{as:e,children:o,part:t,title:n,variant:r="Primary"}=p,a=m(p,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxRuntime.jsxs(y,d(i(d(i({as:e!=null?e:"button",part:[`button-${c}`,t]},je[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?Ke:{})}),a),{loading:void 0,children:[o,n&&jsxRuntime.jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function Br(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ee,d(i({},o),{variant:"Primary",children:e}))}function Rr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ee,d(i({},o),{variant:"Secondary",children:e}))}function kr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ee,d(i({},o),{variant:"Link",children:e}))}function Dr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ee,d(i({},o),{variant:"Plain",children:e}))}var S={};Q(S,{Column:()=>Ir,Row:()=>Er});var Er=Ue__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Ir=Ue__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,d(i({display:"flex",flexDirection:"column"},e),{ref:o})));var O=Ue.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function zo(a){var s=a,{children:e,css:o={},navigate:t,theme:n}=s,r=m(s,["children","css","navigate","theme"]);let p=n?_e(n):{},[c,u]=Ue.useState(new Set),g=Ue.useRef(new Map),b=Ue.useRef(),[f,C]=Ue.useState(!1),h=Ue.useMemo(()=>(C(!1),b.current=void 0,u(new Set),new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,userProperties:r.userProperties,groupProperties:r.groupProperties,generateGuestId:r.generateGuestId,__readOnly:r.__readOnly,__flowStateOverrides:r.__flowStateOverrides})),[r.userId,r.groupId,r.apiKey]);Ue.useEffect(()=>{if(r.__flowStateOverrides){let T=h.getConfig();T.__flowStateOverrides=r.__flowStateOverrides,h.reload(T);}},[r.__flowStateOverrides]);function x(){let T=[...g.current.entries()].map(([w,$])=>[w,$.callback]);h.batchRegister(T),C(!0);}function B(T,w){if(b.current&&clearTimeout(b.current),f){g.current.has(T)||(h.getFlow(T).then($=>$.register(w)),g.current.set(T,{callback:w}));return}g.current.has(T)||g.current.set(T,{callback:w}),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>x(),0);}function k(T){g.current.has(T)&&h.getFlow(T).then(w=>{g.current.delete(T),w==null||w.unregister();});}let R=t!=null?t:(T,w="_self")=>{window.open(T,w);};Ue.useEffect(()=>()=>{h.destroy();},[]);let H=c.size>0?c.values().next().value:null;return jsxRuntime.jsxs(O.Provider,{value:d(i({modals:c,setModals:u,currentModal:H,navigate:R},r),{frigade:h,registerComponent:B,unregisterComponent:k,hasInitialized:f}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i(i({},ze),p),o)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:v,children:e})]})}function ae(e,o){let[t,n]=Ue.useState(),[,r]=Ue.useState(""),{frigade:a}=Ue.useContext(O),s=Ue.useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),setTimeout(()=>{n(p),r(Math.random().toString());},0));},[o==null?void 0:o.variables,a]);return Ue.useEffect(()=>{if(a!=null&&a.isReady())return A(this,null,function*(){let p=yield a.getFlow(e);if(!p||a.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),n(p);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}},[s,a]),Ue.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function se(e,{onComplete:o,onDismiss:t}={}){let n=Ue.useRef(null);return Ue.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&A(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:Ue.useCallback(r=>A(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function le(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=Ue.useContext(O),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:Ue.useCallback((a,s,p=!0)=>A(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,p)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,p),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:Ue.useCallback((a,s)=>A(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Se(e,o=!0){let{currentModal:t,modals:n,setModals:r}=Ue.useContext(O),[a,s]=Ue.useState(!1);Ue.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&r(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),Ue.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function p(){o&&n.has(e==null?void 0:e.id)&&r(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:a||!o,removeModal:p}}function J(b){var f=b,{as:e,children:o,dismissible:t=!1,flowId:n,onComplete:r,onDismiss:a,onPrimary:s,onSecondary:p,variables:c,forceMount:u}=f,g=m(f,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[C,h]=Ue.useState(!1),{flow:x}=ae(n,{variables:c}),{hasInitialized:B,registerComponent:k,unregisterComponent:R}=Ue.useContext(O),H=x==null?void 0:x.getCurrentStep(),{handleDismiss:T}=se(x,{onComplete:r,onDismiss:a}),{handlePrimary:w,handleSecondary:$}=le(H,{onPrimary:s,onSecondary:p}),E=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:j,removeModal:xe}=Se(x,E);Ue.useEffect(()=>{!(x!=null&&x.isVisible)&&j&&xe();},[x==null?void 0:x.isVisible,j]),Ue.useEffect(()=>()=>{R(n);},[]);let re=u&&((x==null?void 0:x.isCompleted)||(x==null?void 0:x.isSkipped));if(!x||!re&&!j||(k(n,()=>{C||h(!0);}),!x.isVisible&&!re)||!B||!C)return null;(re||!x.isCompleted&&!x.isSkipped)&&H.start();let ve=e===null?Ue.Fragment:e!=null?e:y;return jsxRuntime.jsx(ve,d(i({},e===null?{}:g),{children:o({flow:x,handleDismiss:T,handlePrimary:w,handleSecondary:$,parentProps:i({dismissible:t,flowId:n,variables:c},g),step:H})}))}function Xo(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsxRuntime.jsx(J,d(i({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:s,parentProps:{dismissible:p},step:c})=>{var b,f,C,h;let u=(f=(b=c.primaryButton)==null?void 0:b.title)!=null?f:c.primaryButtonTitle,g=(h=(C=c.secondaryButton)==null?void 0:C.title)!=null?h:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P.Header,{dismissible:p,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(P.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(P.Secondary,{title:g,onClick:s}),jsxRuntime.jsx(P.Primary,{title:u,onClick:a})]})]})}}))}function Ge(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsxRuntime.jsx(y,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function en(e){var o,t,n,r;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Je(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let a=en(o);return a?jsxRuntime.jsx(y,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function pe(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsxRuntime.jsx(o==="video"?Je:Ge,i({src:e},t))}var P=Ue__namespace.forwardRef((r,n)=>{var a=r,{children:e,flowId:o}=a,t=m(a,["children","flowId"]);var p;if(o!=null)return jsxRuntime.jsx(Xo,i({flowId:o},t));let s=(p=t.as)!=null?p:S.Column;return jsxRuntime.jsx(s,d(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});P.Dismiss=e=>jsxRuntime.jsx(D.Plain,d(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));P.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=s,r=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(S.Row,d(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsxRuntime.jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(P.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};P.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(pe,i({borderRadius:"md",src:e},o))};P.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Primary,i({title:o,onClick:e},t))};P.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Secondary,i({title:o,onClick:e},t))};P.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};P.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(i({display:"block",part:"title"},o),{children:e}))};var Ie={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Qo(e){let o=Object.fromEntries(Ie.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(Ie.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!Ie.content.some(a=>a===r)&&!Ie.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var sn=react.keyframes`
49
+ var fo=Object.defineProperty,Ht=Object.defineProperties;var Mt=Object.getOwnPropertyDescriptors;var Be=Object.getOwnPropertySymbols;var go=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable;var mo=(e,o,t)=>o in e?fo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))go.call(o,t)&&mo(e,t,o[t]);if(Be)for(var t of Be(o))yo.call(o,t)&&mo(e,t,o[t]);return e},p=(e,o)=>Ht(e,Mt(o));var Wt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var m=(e,o)=>{var t={};for(var n in e)go.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Be)for(var n of Be(e))o.indexOf(n)<0&&yo.call(e,n)&&(t[n]=e[n]);return t};var Q=(e,o)=>{for(var t in o)fo(e,t,{get:o[t],enumerable:!0});};var A=(e,o,t)=>new Promise((n,r)=>{var a=c=>{try{d(t.next(c));}catch(u){r(u);}},s=c=>{try{d(t.throw(c));}catch(u){r(u);}},d=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,s);d((t=t.apply(e,o)).next());});var xo={borderWidths:{md:"1px"}};var Re=[5,10,20,35,50,65,80,95,98],bo=[...Re],Ve=[...Re];bo[4]=40;Ve[4]=60;var At={blue:{h:213,s:100,l:Re},gray:{h:220,s:10,l:Re},green:{h:141,s:90,l:bo},red:{h:9,s:90,l:Ve},yellow:{h:50,s:90,l:Ve}};var M={};for(let[e,{h:o,s:t,l:n}]of Object.entries(At))M[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var ho=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},M),{gray100:M.gray[100],gray200:M.gray[200],gray300:M.gray[300],gray400:M.gray[400],gray500:M.gray[500],gray600:M.gray[600],gray700:M.gray[700],gray800:M.gray[800],gray900:M.gray[900],blue400:M.blue[400],blue500:M.blue[500],blue800:M.blue[800],blue900:M.blue[900],green400:M.blue[400],green500:M.green[500],green800:M.green[800],red500:M.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Po={md:"8px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Co={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var So={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Lt="px",$t=e=>typeof e=="number"?`${4*e}${Lt}`:e,Vt=[-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"],Fo=Object.fromEntries(Vt.map(e=>[e,$t(e)]));var To={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 ke=p(i(p(i({},xo),{colors:i(i({},ho),Co)}),To),{radii:Po,shadows:So,space:Fo});function Pe(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let s=`${o.length?`${o}${t}`:""}${r}`,d=e[r];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(n,Pe(d,s,t)):n[s]=d,n},{})}function _e(e){let o=Pe(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function wo(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=wo(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var ze=_e(ke),v=wo(ke);var zt=new Set(["alt","size","src"]),Nt=_t__default.default.all.filter(e=>e.indexOf("-")!=0&&!zt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Kt=Object.fromEntries(Nt),De=Pe(v.colors),jt={color:De,backgroundColor:De,borderColor:De,border:i(i({},v.borderWidths),De),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},vo=i(i({},Kt),jt),Bo={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"]},Ro=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Ut(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 ko=new Map(Object.entries(vo).map(([e,o])=>[e,Ut(o)])),Gt=new Map(Object.entries(Bo).map(([e,o])=>[e,new Set(o)])),Jt=new Set(["height","width"]),Xt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Do(e){let[o,t]=e.split(":");return [o,Ro.has(t)?t:null]}function Oo(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[d]==null&&(n[d]={}),n[d]}return Object.entries(t).forEach(([a,s])=>{let[d,c]=Do(a),u=Gt.get(d);u!=null&&(u.forEach(g=>{let b=`${g}${c?":"+c:""}`;t[b]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[d,c]=Do(a),u=ko.get(d);if(u!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");r(c)[d]=g.map(b=>{var f;return (f=u.get(b.toString()))!=null?f:b}).join(" ");}else u.has(s.toString())?r(c)[d]=u.get(s.toString()):r(c)[d]=s;(typeof o!="string"||!Xt.has(o)||!Jt.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&ko.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function Yt(){if(typeof window=="undefined"){let{JSDOM:e}=Wt("jsdom");return new e("<!DOCTYPE html>").window}return window}function Eo(e){return e?{__html:qt__default.default(Yt()).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 Zt(e){return e&&`fr-${e}`}function Mo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Mo(o)).join(" "):Zt(e))}function er(d,s){var c=d,{as:e,children:o,className:t,css:n={},part:r}=c,a=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:g,unmatchedProps:b}=Oo(a,u),f=Mo(r),C=t||f?clsx.clsx(t,f):void 0,h=[{boxSizing:"border-box"},g,n];return typeof o=="string"?jsxRuntime.jsx(u,p(i({className:C,css:h},b),{ref:s,dangerouslySetInnerHTML:Eo(o)})):jsxRuntime.jsx(u,p(i({className:C,css:h},b),{ref:s,children:o}))}var y=Ue__namespace.forwardRef(er);var D={};Q(D,{Link:()=>kr,Plain:()=>Dr,Primary:()=>Br,Secondary:()=>Rr});var F={};Q(F,{Body1:()=>xr,Body2:()=>br,Caption:()=>hr,Display1:()=>cr,Display2:()=>ur,H1:()=>mr,H2:()=>fr,H3:()=>gr,H4:()=>yr});var Ne={};Q(Ne,{Body1:()=>sr,Body2:()=>lr,Caption:()=>pr,Display1:()=>or,Display2:()=>tr,H1:()=>rr,H2:()=>nr,H3:()=>ir,H4:()=>ar});var Z={color:"neutral.foreground",fontFamily:"default",margin:"0"},or=p(i({},Z),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),tr=p(i({},Z),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),rr=p(i({},Z),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),nr=p(i({},Z),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),ir=p(i({},Z),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),ar=p(i({},Z),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),sr=p(i({},Z),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),lr=p(i({},Z),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),pr=p(i({},Z),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var dr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ee=Object.fromEntries(dr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Ue__namespace.forwardRef((d,s)=>{var c=d,{as:n=o,children:r}=c,a=m(c,["as","children"]);return jsxRuntime.jsx(y,p(i(i({as:n},Ne[e]),a),{ref:s,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),cr=ee.Display1,ur=ee.Display2,mr=ee.H1,fr=ee.H2,gr=ee.H3,yr=ee.H4,xr=ee.Body1,br=ee.Body2,hr=ee.Caption;var je={};Q(je,{Link:()=>Tr,Plain:()=>wr,Primary:()=>Sr,Secondary:()=>Fr,loadingCSSStyle:()=>Ke});var Oe={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Sr=p(i({},Oe),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),Fr=p(i({},Oe),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),Tr=p(i({},Oe),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),wr=p(i({},Oe),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),vr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Ke={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:vr+" 1s ease infinite"}};function Ee(s){var d=s,{as:e,children:o,part:t,title:n,variant:r="Primary"}=d,a=m(d,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxRuntime.jsxs(y,p(i(p(i({as:e!=null?e:"button",part:[`button-${c}`,t]},je[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?Ke:{})}),a),{loading:void 0,children:[o,n&&jsxRuntime.jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function Br(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ee,p(i({},o),{variant:"Primary",children:e}))}function Rr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ee,p(i({},o),{variant:"Secondary",children:e}))}function kr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ee,p(i({},o),{variant:"Link",children:e}))}function Dr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(Ee,p(i({},o),{variant:"Plain",children:e}))}var S={};Q(S,{Column:()=>Ir,Row:()=>Er});var Er=Ue__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Ir=Ue__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var O=Ue.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function zo(a){var s=a,{children:e,css:o={},navigate:t,theme:n}=s,r=m(s,["children","css","navigate","theme"]);let d=n?_e(n):{},[c,u]=Ue.useState(new Set),g=Ue.useRef(new Map),b=Ue.useRef(),[f,C]=Ue.useState(!1),h=Ue.useMemo(()=>(C(!1),b.current=void 0,u(new Set),new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,userProperties:r.userProperties,groupProperties:r.groupProperties,generateGuestId:r.generateGuestId,__readOnly:r.__readOnly,__flowStateOverrides:r.__flowStateOverrides})),[r.userId,r.groupId,r.apiKey]);Ue.useEffect(()=>{if(r.__flowStateOverrides){let T=h.getConfig();T.__flowStateOverrides=r.__flowStateOverrides,h.reload(T);}},[r.__flowStateOverrides]);function x(){let T=[...g.current.entries()].map(([w,$])=>[w,$.callback]);h.batchRegister(T),C(!0);}function B(T,w){if(b.current&&clearTimeout(b.current),f){g.current.has(T)||(h.getFlow(T).then($=>$.register(w)),g.current.set(T,{callback:w}));return}g.current.has(T)||g.current.set(T,{callback:w}),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>x(),0);}function k(T){g.current.has(T)&&h.getFlow(T).then(w=>{g.current.delete(T),w==null||w.unregister();});}let R=t!=null?t:(T,w="_self")=>{window.open(T,w);};Ue.useEffect(()=>()=>{h.destroy();},[]);let H=c.size>0?c.values().next().value:null;return jsxRuntime.jsxs(O.Provider,{value:p(i({modals:c,setModals:u,currentModal:H,navigate:R},r),{frigade:h,registerComponent:B,unregisterComponent:k,hasInitialized:f}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i(i({},ze),d),o)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:v,children:e})]})}function ae(e,o){let[t,n]=Ue.useState(),[,r]=Ue.useState(""),{frigade:a}=Ue.useContext(O),s=Ue.useCallback(d=>{d.id===e&&(o!=null&&o.variables&&d.applyVariables(o.variables),setTimeout(()=>{n(d),r(Math.random().toString());},0));},[o==null?void 0:o.variables,a]);return Ue.useEffect(()=>{if(a!=null&&a.isReady())return A(this,null,function*(){let d=yield a.getFlow(e);if(!d||a.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&d.applyVariables(o.variables),n(d);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}},[s,a]),Ue.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function se(e,{onComplete:o,onDismiss:t}={}){let n=Ue.useRef(null);return Ue.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&A(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:Ue.useCallback(r=>A(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function le(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=Ue.useContext(O),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:Ue.useCallback((a,s,d=!0)=>A(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,d)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,d),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:Ue.useCallback((a,s)=>A(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Se(e,o=!0){let{currentModal:t,modals:n,setModals:r}=Ue.useContext(O),[a,s]=Ue.useState(!1);Ue.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&r(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),Ue.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function d(){o&&n.has(e==null?void 0:e.id)&&r(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:a||!o,removeModal:d}}function J(b){var f=b,{as:e,children:o,dismissible:t=!1,flowId:n,onComplete:r,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:u}=f,g=m(f,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[C,h]=Ue.useState(!1),{flow:x}=ae(n,{variables:c}),{hasInitialized:B,registerComponent:k,unregisterComponent:R}=Ue.useContext(O),H=x==null?void 0:x.getCurrentStep(),{handleDismiss:T}=se(x,{onComplete:r,onDismiss:a}),{handlePrimary:w,handleSecondary:$}=le(H,{onPrimary:s,onSecondary:d}),E=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:j,removeModal:xe}=Se(x,E);Ue.useEffect(()=>{!(x!=null&&x.isVisible)&&j&&xe();},[x==null?void 0:x.isVisible,j]),Ue.useEffect(()=>()=>{R(n);},[]);let re=u&&((x==null?void 0:x.isCompleted)||(x==null?void 0:x.isSkipped));if(!x||!re&&!j||(k(n,()=>{C||h(!0);}),!x.isVisible&&!re)||!B||!C)return null;(re||!x.isCompleted&&!x.isSkipped)&&H.start();let ve=e===null?Ue.Fragment:e!=null?e:y;return jsxRuntime.jsx(ve,p(i({},e===null?{}:g),{children:o({flow:x,handleDismiss:T,handlePrimary:w,handleSecondary:$,parentProps:i({dismissible:t,flowId:n,variables:c},g),step:H})}))}function Xo(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsxRuntime.jsx(J,p(i({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:s,parentProps:{dismissible:d},step:c})=>{var b,f,C,h;let u=(f=(b=c.primaryButton)==null?void 0:b.title)!=null?f:c.primaryButtonTitle,g=(h=(C=c.secondaryButton)==null?void 0:C.title)!=null?h:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P.Header,{dismissible:d,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(P.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(P.Secondary,{title:g,onClick:s}),jsxRuntime.jsx(P.Primary,{title:u,onClick:a})]})]})}}))}function Ge(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsxRuntime.jsx(y,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function en(e){var o,t,n,r;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Je(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let a=en(o);return a?jsxRuntime.jsx(y,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function pe(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsxRuntime.jsx(o==="video"?Je:Ge,i({src:e},t))}var P=Ue__namespace.forwardRef((r,n)=>{var a=r,{children:e,flowId:o}=a,t=m(a,["children","flowId"]);var d;if(o!=null)return jsxRuntime.jsx(Xo,i({flowId:o},t));let s=(d=t.as)!=null?d:S.Column;return jsxRuntime.jsx(s,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});P.Dismiss=e=>jsxRuntime.jsx(D.Plain,p(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));P.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=s,r=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(S.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsxRuntime.jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(P.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};P.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(pe,i({borderRadius:"md",src:e},o))};P.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Primary,i({title:o,onClick:e},t))};P.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Secondary,i({title:o,onClick:e},t))};P.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,p(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};P.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,p(i({display:"block",part:"title"},o),{children:e}))};var Ie={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Qo(e){let o=Object.fromEntries(Ie.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(Ie.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!Ie.content.some(a=>a===r)&&!Ie.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var sn=react.keyframes`
50
50
  from {
51
51
  opacity: 0;
52
52
  }
@@ -56,7 +56,7 @@ var fo=Object.defineProperty,Ht=Object.defineProperties;var Mt=Object.getOwnProp
56
56
  to {
57
57
  opacity: 1;
58
58
  }
59
- `;function I(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=m(a,["children","className","modal"]);let{rootProps:s,contentProps:p,otherProps:g}=Qo(n),b=g,{zIndex:c}=b,u=m(b,["zIndex"]);return jsxRuntime.jsx(___namespace.Root,d(i({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(___namespace.Portal,{children:jsxRuntime.jsxs(y,{animation:`${sn} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(___namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(___namespace.Content,d(i({asChild:!0,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault()},p),{children:jsxRuntime.jsx(P,d(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}I.Dismiss=e=>jsxRuntime.jsx(___namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,d(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});I.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(___namespace.Description,{asChild:!0,children:jsxRuntime.jsx(F.Body2,d(i({part:"subtitle"},o),{children:e}))})};I.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(pe,i({borderRadius:"md",src:e},o))};I.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,i({title:o,onClick:e},t))};I.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?v.colors.blue500:v.colors.blue800,part:e===r?"progress-dot-selected":"progress-dot"},r));return jsxRuntime.jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};I.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,i({title:o,onClick:e},t))};I.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(___namespace.Title,{asChild:!0,children:jsxRuntime.jsx(F.H4,d(i({part:"title"},o),{children:e}))})};I.displayName="Dialog";var Zo=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function pn(n){var r=n,{flowId:e,part:o}=r,t=m(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([p])=>Zo.some(c=>p===c))),s=Object.fromEntries(Object.entries(t).filter(([p])=>Zo.indexOf(p)===-1));return jsxRuntime.jsx(J,d(i({as:null,flowId:e},a),{children:({flow:p,handleDismiss:c,handlePrimary:u,handleSecondary:g,parentProps:{dismissible:b},step:f})=>{var k,R,H,T,w,$;let C=(k=f.props)!=null?k:{},h=(H=(R=f.primaryButton)==null?void 0:R.title)!=null?H:f.primaryButtonTitle,x=(w=(T=f.secondaryButton)==null?void 0:T.title)!=null?w:f.secondaryButtonTitle,B=!!f.$state.blocked;return jsxRuntime.jsx(I,d(i({part:["announcement",o],textAlign:"center"},s),{onEscapeKeyDown:E=>{typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(E),E.defaultPrevented||c(E);},children:jsxRuntime.jsxs(S.Column,d(i({gap:5,part:"announcement-step"},C),{children:[b&&jsxRuntime.jsx(I.Dismiss,{onClick:c}),jsxRuntime.jsxs(S.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(I.Title,{children:f.title}),jsxRuntime.jsx(I.Subtitle,{children:f.subtitle})]}),jsxRuntime.jsx(I.Media,{src:($=f.videoUri)!=null?$:f.imageUri,type:f.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(I.ProgressDots,{current:p.getCurrentStepIndex(),total:p.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(S.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[x&&jsxRuntime.jsx(I.Secondary,{disabled:B,onClick:g,title:x}),h&&jsxRuntime.jsx(I.Primary,{disabled:B,onClick:u,title:h})]})]}))}))}}))}function dn(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=m(a,["dismissible","flowId","part"]);return jsxRuntime.jsx(J,{as:null,flowId:o,children:({handleDismiss:s,handlePrimary:p,handleSecondary:c,step:u})=>{var h,x,B,k,R;let g=(h=u.props)!=null?h:{},b=(B=(x=u.primaryButton)==null?void 0:x.title)!=null?B:u.primaryButtonTitle,f=(R=(k=u.secondaryButton)==null?void 0:k.title)!=null?R:u.secondaryButtonTitle,C=!!u.$state.blocked;return jsxRuntime.jsxs(P,d(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},n),g),{children:[u.imageUri&&jsxRuntime.jsx(y,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(P.Title,{part:"title",children:u.title}),jsxRuntime.jsx(P.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsxRuntime.jsx(P.Secondary,{disabled:C,title:f,onClick:c}),jsxRuntime.jsx(P.Primary,{disabled:C,title:b,onClick:p}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:s})]}))}})}var eo={};Q(eo,{Collapsible:()=>pt,CollapsibleStep:()=>Te});var Te={};Q(Te,{Content:()=>Ye,Root:()=>Qe,Trigger:()=>Ze});var un=react.keyframes`
59
+ `;function I(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=m(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:g}=Qo(n),b=g,{zIndex:c}=b,u=m(b,["zIndex"]);return jsxRuntime.jsx(___namespace.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(___namespace.Portal,{children:jsxRuntime.jsxs(y,{animation:`${sn} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(___namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(___namespace.Content,p(i({asChild:!0,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault()},d),{children:jsxRuntime.jsx(P,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}I.Dismiss=e=>jsxRuntime.jsx(___namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,p(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});I.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(___namespace.Description,{asChild:!0,children:jsxRuntime.jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))})};I.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(pe,i({borderRadius:"md",src:e},o))};I.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,i({title:o,onClick:e},t))};I.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?v.colors.blue500:v.colors.blue800,part:e===r?"progress-dot-selected":"progress-dot"},r));return jsxRuntime.jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};I.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,i({title:o,onClick:e},t))};I.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(___namespace.Title,{asChild:!0,children:jsxRuntime.jsx(F.H4,p(i({part:"title"},o),{children:e}))})};I.displayName="Dialog";var Zo=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function pn(n){var r=n,{flowId:e,part:o}=r,t=m(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([d])=>Zo.some(c=>d===c))),s=Object.fromEntries(Object.entries(t).filter(([d])=>Zo.indexOf(d)===-1));return jsxRuntime.jsx(J,p(i({as:null,flowId:e},a),{children:({flow:d,handleDismiss:c,handlePrimary:u,handleSecondary:g,parentProps:{dismissible:b},step:f})=>{var k,R,H,T,w,$;let C=(k=f.props)!=null?k:{},h=(H=(R=f.primaryButton)==null?void 0:R.title)!=null?H:f.primaryButtonTitle,x=(w=(T=f.secondaryButton)==null?void 0:T.title)!=null?w:f.secondaryButtonTitle,B=!!f.$state.blocked;return jsxRuntime.jsx(I,p(i({part:["announcement",o],textAlign:"center"},s),{onEscapeKeyDown:E=>{typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(E),E.defaultPrevented||c(E);},children:jsxRuntime.jsxs(S.Column,p(i({gap:5,part:"announcement-step"},C),{children:[b&&jsxRuntime.jsx(I.Dismiss,{onClick:c}),jsxRuntime.jsxs(S.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(I.Title,{children:f.title}),jsxRuntime.jsx(I.Subtitle,{children:f.subtitle})]}),jsxRuntime.jsx(I.Media,{src:($=f.videoUri)!=null?$:f.imageUri,type:f.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(I.ProgressDots,{current:d.getCurrentStepIndex(),total:d.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(S.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[x&&jsxRuntime.jsx(I.Secondary,{disabled:B,onClick:g,title:x}),h&&jsxRuntime.jsx(I.Primary,{disabled:B,onClick:u,title:h})]})]}))}))}}))}function dn(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=m(a,["dismissible","flowId","part"]);return jsxRuntime.jsx(J,p(i({as:null,flowId:o},n),{children:({handleDismiss:s,handlePrimary:d,handleSecondary:c,step:u})=>{var h,x,B,k,R;let g=(h=u.props)!=null?h:{},b=(B=(x=u.primaryButton)==null?void 0:x.title)!=null?B:u.primaryButtonTitle,f=(R=(k=u.secondaryButton)==null?void 0:k.title)!=null?R:u.secondaryButtonTitle,C=!!u.$state.blocked;return jsxRuntime.jsxs(P,p(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},n),g),{children:[u.imageUri&&jsxRuntime.jsx(y,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(P.Title,{part:"title",children:u.title}),jsxRuntime.jsx(P.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsxRuntime.jsx(P.Secondary,{disabled:C,title:f,onClick:c}),jsxRuntime.jsx(P.Primary,{disabled:C,title:b,onClick:d}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:s})]}))}}))}var eo={};Q(eo,{Collapsible:()=>pt,CollapsibleStep:()=>Te});var Te={};Q(Te,{Content:()=>Ye,Root:()=>Qe,Trigger:()=>Ze});var un=react.keyframes`
60
60
  from {
61
61
  height: 0;
62
62
  opacity: 0;
@@ -74,7 +74,7 @@ var fo=Object.defineProperty,Ht=Object.defineProperties;var Mt=Object.getOwnProp
74
74
  height: 0;
75
75
  opacity: 0;
76
76
  }
77
- `,fn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function gn({checked:e=!1}){return jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx(fn,{})})})}function Ye({children:e}){return jsxRuntime.jsx(fe__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${un} 300ms ease-out`},'&[data-state="closed"]':{animation:`${mn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(y,{}),e]})})}function Qe(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=s,r=m(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(fe__namespace.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsxRuntime.jsx(P,d(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},r),{children:e}))})}function Ze({isCompleted:e,title:o}){return jsxRuntime.jsx(fe__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(S.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(gn,{checked:e}),jsxRuntime.jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Me={};Q(Me,{Bar:()=>He,Dots:()=>nt,Segments:()=>at});function He(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(y,d(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function nt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,p)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?v.colors.blue500:v.colors.blue800},p));return jsxRuntime.jsx(y,d(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function at(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=[...Array(o)].map((s,p)=>jsxRuntime.jsx(y,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsxRuntime.jsx(S.Row,d(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}var st=Ue.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function lt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var C,h,x,B,k,R;let{$state:{blocked:a,completed:s},subtitle:p,title:c}=r,u=(h=(C=r.primaryButton)==null?void 0:C.title)!=null?h:r.primaryButtonTitle,g=(B=(x=r.secondaryButton)==null?void 0:x.title)!=null?B:r.secondaryButtonTitle,b=(k=r.props)!=null?k:{},f=!!(s||a);return jsxRuntime.jsxs(Qe,d(i({open:t,onOpenChange:n},b),{children:[jsxRuntime.jsx(Ze,{isCompleted:s,title:c}),jsxRuntime.jsxs(Ye,{children:[jsxRuntime.jsx(P.Media,{aspectRatio:2.5,objectFit:"cover",src:(R=r.videoUri)!=null?R:r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsx(P.Subtitle,{color:"neutral.400",children:p}),jsxRuntime.jsxs(S.Row,{gap:3,children:[jsxRuntime.jsx(P.Secondary,{disabled:f,title:g,onClick:o}),jsxRuntime.jsx(P.Primary,{disabled:f,title:u,onClick:e})]})]})]}))}var hn={default:lt};function Pn(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var x;let{onPrimary:a,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:u}=Ue.useContext(st),{handlePrimary:g,handleSecondary:b}=le(o,{onPrimary:a,onSecondary:s}),f=(p!=null?p:e.getCurrentStep().id)===o.id,C=(x=u[o.type])!=null?x:lt;function h(B){return A(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(C,d(i({flow:e,onOpenChange:h,open:f,step:o},t),{handlePrimary:g,handleSecondary:b}),o.id)}function pt(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,g]=Ue.useState(null),b=i(i({},hn),a);return jsxRuntime.jsx(st.Provider,{value:{openStepId:u,setOpenStepId:g,onPrimary:t,onSecondary:n,stepTypes:b},children:jsxRuntime.jsx(J,d(i({as:P,borderWidth:"md",flowId:o,part:["checklist",r]},s),{children:x=>{var B=x,{flow:f,handleDismiss:C}=B,h=m(B,["flow","handleDismiss"]);let R=Array.from(f.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsxRuntime.jsx(Pn,d(i({flow:f,handleDismiss:C},h),{step:w}),w.id)),H=f.getNumberOfCompletedSteps(),T=f.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(P.Header,{dismissible:e,handleDismiss:C,part:"checklist-header",subtitle:f.subtitle,title:f.title}),jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",children:[H,"/",T]}),jsxRuntime.jsx(He,{current:H,total:T,flexGrow:1})]})]}),R]})}}))})}var Rn=new Set(["required","min","max","minLength","maxLength","pattern"]);function kn({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=reactHookForm.useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let a=Object.fromEntries(Object.entries(t).filter(([p])=>Rn.has(p))),s=reactHookForm.useController({name:t.id,control:o,rules:a});return jsxRuntime.jsx(e,d(i({},s),{fieldData:t,formContext:r,submit:n}))}function ct({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var R,H,T,w,$,E;let{__readOnly:s}=Ue.useContext(O),p=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,u]=Ue.useState(!1),g=[],{control:b,handleSubmit:f}=p,C=(R=a.props)!=null?R:{};function h(j,xe){u(!0),t(xe,j,s===!0).then(()=>u(!1));}(H=a.fields)==null||H.forEach(j=>{e[j.type]!=null&&g.push(jsxRuntime.jsx(kn,{control:b,fieldComponent:e[j.type],fieldData:j,submit:f(h)},`${a.flow.id}-${j.id}`));});let x=(w=(T=a.primaryButton)==null?void 0:T.title)!=null?w:a.primaryButtonTitle,B=(E=($=a.secondaryButton)==null?void 0:$.title)!=null?E:a.secondaryButtonTitle,k=!!(a.$state.blocked||!p.formState.isValid);return jsxRuntime.jsxs(S.Column,d(i({gap:5,part:"form-step"},C),{children:[jsxRuntime.jsx(P.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(reactHookForm.FormProvider,d(i({},p),{children:g})),jsxRuntime.jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsxRuntime.jsx(D.Secondary,{disabled:k,onClick:n,title:B}),jsxRuntime.jsx(D.Primary,{disabled:k||c,onClick:f(h),title:x!=null?x:"Submit",loading:c})]},"form-footer")]}))}function ut({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function oo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var we={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function te({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:s}=t,{error:p}=n,c=d(i(i(i({id:r},o),s?{placeholder:s}:{}),we),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(oo,{id:r,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(ut,{error:p})]})}var Hn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Mn=Ue__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.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:[jsxRuntime.jsx(F.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(ye__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.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:jsxRuntime.jsx(y,{as:ye__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Hn,{})})})})]}));function to(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:s})=>jsxRuntime.jsx(Mn,{value:s,label:a},s));return jsxRuntime.jsx(te,d(i({},e),{children:()=>jsxRuntime.jsx(ye__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}var Ln=Ue__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(V__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(V__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function ro(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:s,value:p})=>jsxRuntime.jsx(Ln,{value:p,label:s},p));return jsxRuntime.jsx(te,d(i({},e),{children:()=>jsxRuntime.jsxs(V__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(V__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(F.Body2,d(i({},we),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(V__namespace.Value,{placeholder:r!=null?r:"Select one"}),jsxRuntime.jsx(V__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(V__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,d(i({},we),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(V__namespace.Viewport,{children:a})}))})]})}))}function no(e){return jsxRuntime.jsx(te,d(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Pt(e){return jsxRuntime.jsx(te,d(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var $n={radio:to,select:ro,text:no,textarea:Pt};function io(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=m(a,["fieldTypes","flowId","part"]);let s=Object.assign({},$n,e);return jsxRuntime.jsx(J,d(i({flowId:o,part:["form",t]},n),{children:p=>jsxRuntime.jsx(ct,i({fieldTypes:s},p))}))}var ao={};Q(ao,{NPS:()=>Tt});function Ft({field:e,submit:o}){let t=[...Array(11)].map((n,r)=>{let a=e.value===r?D.Primary:D.Secondary;return jsxRuntime.jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(r),o();},title:`${r}`,css:{".fr-button-title":{fontSize:"15px"}}},r)});return jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxRuntime.jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:"Not likely at all"}),jsxRuntime.jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:"Extremely likely"})]})]})}function Tt(a){var s=a,{as:e=I,flowId:o,fieldTypes:t,part:n}=s,r=m(s,["as","flowId","fieldTypes","part"]);let{flow:p}=ae(o);return jsxRuntime.jsx(io,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:Ft},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",n],css:d(i({},!p||p.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function Ae(){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]=Ue.useState(e),[n,r]=Ue.useState(null),a=Ue.useCallback(s=>{r(s);},[]);return Ue.useLayoutEffect(()=>{if(!n)return;let s=()=>{let p=n.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:o,ref:a}}var Kn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Bt(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxRuntime.jsxs(y,d(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Kn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Rt({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};r[p[n]]=s;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var Le={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function kt(e,o){var a,s,p,c,u;let t=Object.fromEntries(Le.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n=Object.fromEntries(Le.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r={};for(let g of Object.keys(e))!Le.content.includes(g)&&!Le.root.includes(g)&&(r[g]=e[g]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},b=(k,R)=>["top","bottom"].includes(R)?k=="after"?"marginLeft":"marginRight":k=="after"?"marginTop":"marginBottom",f=(p=t.alignOffset)!=null?p:0,C=(c=t.style)!=null?c:{},h=(u=t.side)!=null?u:"bottom",x=t.align;t.style=d(i({},C),{[b(x,h)]:f});let B=["top","bottom"].includes(h)?o.width:o.height;t.alignOffset=(B+f)*-1,t.align=g[x];}return {contentProps:t,otherProps:r,rootProps:n}}var Dt=react.keyframes`
77
+ `,fn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function gn({checked:e=!1}){return jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx(fn,{})})})}function Ye({children:e}){return jsxRuntime.jsx(fe__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${un} 300ms ease-out`},'&[data-state="closed"]':{animation:`${mn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(y,{}),e]})})}function Qe(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=s,r=m(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(fe__namespace.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsxRuntime.jsx(P,p(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},r),{children:e}))})}function Ze({isCompleted:e,title:o}){return jsxRuntime.jsx(fe__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(S.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(gn,{checked:e}),jsxRuntime.jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Me={};Q(Me,{Bar:()=>He,Dots:()=>nt,Segments:()=>at});function He(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(y,p(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function nt(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?v.colors.blue500:v.colors.blue800},d));return jsxRuntime.jsx(y,p(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function at(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsxRuntime.jsx(S.Row,p(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}var st=Ue.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function lt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var C,h,x,B,k,R;let{$state:{blocked:a,completed:s},subtitle:d,title:c}=r,u=(h=(C=r.primaryButton)==null?void 0:C.title)!=null?h:r.primaryButtonTitle,g=(B=(x=r.secondaryButton)==null?void 0:x.title)!=null?B:r.secondaryButtonTitle,b=(k=r.props)!=null?k:{},f=!!(s||a);return jsxRuntime.jsxs(Qe,p(i({open:t,onOpenChange:n},b),{children:[jsxRuntime.jsx(Ze,{isCompleted:s,title:c}),jsxRuntime.jsxs(Ye,{children:[jsxRuntime.jsx(P.Media,{aspectRatio:2.5,objectFit:"cover",src:(R=r.videoUri)!=null?R:r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsx(P.Subtitle,{color:"neutral.400",children:d}),jsxRuntime.jsxs(S.Row,{gap:3,children:[jsxRuntime.jsx(P.Secondary,{disabled:f,title:g,onClick:o}),jsxRuntime.jsx(P.Primary,{disabled:f,title:u,onClick:e})]})]})]}))}var hn={default:lt};function Pn(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var x;let{onPrimary:a,onSecondary:s,openStepId:d,setOpenStepId:c,stepTypes:u}=Ue.useContext(st),{handlePrimary:g,handleSecondary:b}=le(o,{onPrimary:a,onSecondary:s}),f=(d!=null?d:e.getCurrentStep().id)===o.id,C=(x=u[o.type])!=null?x:lt;function h(B){return A(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(C,p(i({flow:e,onOpenChange:h,open:f,step:o},t),{handlePrimary:g,handleSecondary:b}),o.id)}function pt(d){var c=d,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,g]=Ue.useState(null),b=i(i({},hn),a);return jsxRuntime.jsx(st.Provider,{value:{openStepId:u,setOpenStepId:g,onPrimary:t,onSecondary:n,stepTypes:b},children:jsxRuntime.jsx(J,p(i({as:P,borderWidth:"md",flowId:o,part:["checklist",r]},s),{children:x=>{var B=x,{flow:f,handleDismiss:C}=B,h=m(B,["flow","handleDismiss"]);let R=Array.from(f.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsxRuntime.jsx(Pn,p(i({flow:f,handleDismiss:C},h),{step:w}),w.id)),H=f.getNumberOfCompletedSteps(),T=f.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(P.Header,{dismissible:e,handleDismiss:C,part:"checklist-header",subtitle:f.subtitle,title:f.title}),jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",children:[H,"/",T]}),jsxRuntime.jsx(He,{current:H,total:T,flexGrow:1})]})]}),R]})}}))})}var Rn=new Set(["required","min","max","minLength","maxLength","pattern"]);function kn({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=reactHookForm.useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let a=Object.fromEntries(Object.entries(t).filter(([d])=>Rn.has(d))),s=reactHookForm.useController({name:t.id,control:o,rules:a});return jsxRuntime.jsx(e,p(i({},s),{fieldData:t,formContext:r,submit:n}))}function ct({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var R,H,T,w,$,E;let{__readOnly:s}=Ue.useContext(O),d=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,u]=Ue.useState(!1),g=[],{control:b,handleSubmit:f}=d,C=(R=a.props)!=null?R:{};function h(j,xe){u(!0),t(xe,j,s===!0).then(()=>u(!1));}(H=a.fields)==null||H.forEach(j=>{e[j.type]!=null&&g.push(jsxRuntime.jsx(kn,{control:b,fieldComponent:e[j.type],fieldData:j,submit:f(h)},`${a.flow.id}-${j.id}`));});let x=(w=(T=a.primaryButton)==null?void 0:T.title)!=null?w:a.primaryButtonTitle,B=(E=($=a.secondaryButton)==null?void 0:$.title)!=null?E:a.secondaryButtonTitle,k=!!(a.$state.blocked||!d.formState.isValid);return jsxRuntime.jsxs(S.Column,p(i({gap:5,part:"form-step"},C),{children:[jsxRuntime.jsx(P.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(reactHookForm.FormProvider,p(i({},d),{children:g})),jsxRuntime.jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsxRuntime.jsx(D.Secondary,{disabled:k,onClick:n,title:B}),jsxRuntime.jsx(D.Primary,{disabled:k||c,onClick:f(h),title:x!=null?x:"Submit",loading:c})]},"form-footer")]}))}function ut({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function oo({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var we={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function te({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:s}=t,{error:d}=n,c=p(i(i(i({id:r},o),s?{placeholder:s}:{}),we),{"aria-invalid":!!d,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(oo,{id:r,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(ut,{error:d})]})}var Hn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Mn=Ue__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.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:[jsxRuntime.jsx(F.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(ye__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.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:jsxRuntime.jsx(y,{as:ye__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Hn,{})})})})]}));function to(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:s})=>jsxRuntime.jsx(Mn,{value:s,label:a},s));return jsxRuntime.jsx(te,p(i({},e),{children:()=>jsxRuntime.jsx(ye__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}var Ln=Ue__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(V__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(V__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function ro(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:s,value:d})=>jsxRuntime.jsx(Ln,{value:d,label:s},d));return jsxRuntime.jsx(te,p(i({},e),{children:()=>jsxRuntime.jsxs(V__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(V__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(F.Body2,p(i({},we),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(V__namespace.Value,{placeholder:r!=null?r:"Select one"}),jsxRuntime.jsx(V__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(V__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,p(i({},we),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(V__namespace.Viewport,{children:a})}))})]})}))}function no(e){return jsxRuntime.jsx(te,p(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Pt(e){return jsxRuntime.jsx(te,p(i({},e),{children:o=>jsxRuntime.jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var $n={radio:to,select:ro,text:no,textarea:Pt};function io(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=m(a,["fieldTypes","flowId","part"]);let s=Object.assign({},$n,e);return jsxRuntime.jsx(J,p(i({flowId:o,part:["form",t]},n),{children:d=>jsxRuntime.jsx(ct,i({fieldTypes:s},d))}))}var ao={};Q(ao,{NPS:()=>Tt});function Ft({field:e,submit:o}){let t=[...Array(11)].map((n,r)=>{let a=e.value===r?D.Primary:D.Secondary;return jsxRuntime.jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(r),o();},title:`${r}`,css:{".fr-button-title":{fontSize:"15px"}}},r)});return jsxRuntime.jsxs(S.Column,{gap:2,children:[jsxRuntime.jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxRuntime.jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:"Not likely at all"}),jsxRuntime.jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:"Extremely likely"})]})]})}function Tt(a){var s=a,{as:e=I,flowId:o,fieldTypes:t,part:n}=s,r=m(s,["as","flowId","fieldTypes","part"]);let{flow:d}=ae(o);return jsxRuntime.jsx(io,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:Ft},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||d.skip();},part:["nps",n],css:p(i({},!d||d.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function Ae(){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]=Ue.useState(e),[n,r]=Ue.useState(null),a=Ue.useCallback(s=>{r(s);},[]);return Ue.useLayoutEffect(()=>{if(!n)return;let s=()=>{let d=n.getBoundingClientRect();t(d);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:o,ref:a}}var Kn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Bt(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxRuntime.jsxs(y,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Kn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Rt({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};r[d[n]]=s;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var Le={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function kt(e,o){var a,s,d,c,u;let t=Object.fromEntries(Le.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n=Object.fromEntries(Le.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r={};for(let g of Object.keys(e))!Le.content.includes(g)&&!Le.root.includes(g)&&(r[g]=e[g]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},b=(k,R)=>["top","bottom"].includes(R)?k=="after"?"marginLeft":"marginRight":k=="after"?"marginTop":"marginBottom",f=(d=t.alignOffset)!=null?d:0,C=(c=t.style)!=null?c:{},h=(u=t.side)!=null?u:"bottom",x=t.align;t.style=p(i({},C),{[b(x,h)]:f});let B=["top","bottom"].includes(h)?o.width:o.height;t.alignOffset=(B+f)*-1,t.align=g[x];}return {contentProps:t,otherProps:r,rootProps:n}}var Dt=react.keyframes`
78
78
  from {
79
79
  opacity: 0;
80
80
  }
@@ -84,7 +84,7 @@ var fo=Object.defineProperty,Ht=Object.defineProperties;var Mt=Object.getOwnProp
84
84
  to {
85
85
  opacity: 1;
86
86
  }
87
- `;function L(s){var p=s,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=p,a=m(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:g}=Ae(),{node:b,rect:f,ref:C}=Ae(),si=kt(a,u),{contentProps:h,otherProps:It}=si,uo=It,{part:x}=uo,B=m(uo,["part"]),{rootProps:k}=si,[R,H]=Ue.useState(h.align),[T,w]=Ue.useState(h.side),[$,E]=Ue.useState(0),[j,xe]=Ue.useState(0);if(c!==null){let G=c.getAttribute("data-align"),ne=c.getAttribute("data-side");R!==G&&H(G),T!==ne&&w(ne);}let re=Ue.useRef(null);if(Ue.useEffect(()=>{let G=document.querySelector(e);G!=null?(C(G),re.current=G):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),Ue.useEffect(()=>{function G(be){if(be.matches(e))return be;let me=be.querySelectorAll(e);return me.length>0?me[0]:null}let ne=new MutationObserver(be=>{for(let me of be)if(me.type==="childList"){for(let he of me.addedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let ie=G(he);if(ie!=null){C(ie),re.current=ie,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ie);break}}for(let he of me.removedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let ie=G(he);if(ie!=null){C(null),re.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ie);break}}}});return ne.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ne.disconnect()},[]),Ue.useEffect(()=>{let{scrollX:G,scrollY:ne}=window;E(f.left+G),xe(f.top+ne);},[f.left,f.top]),b==null)return null;let ve="0";typeof window!="undefined"&&(ve=window.getComputedStyle(b).borderRadius);let co=Rt({props:a,alignAttr:R,sideAttr:T});return jsxRuntime.jsxs(Y__namespace.Root,d(i({defaultOpen:!0},k),{children:[jsxRuntime.jsx(Y__namespace.Anchor,{virtualRef:re}),jsxRuntime.jsx(Y__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx(y,i({animation:`${Dt} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:ve,height:f.height,left:$,top:j,width:f.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsxRuntime.jsx(Y__namespace.Content,d(i({asChild:!0},h),{ref:g,children:jsxRuntime.jsxs(P,d(i({animation:`${Dt} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},part:["tooltip",x],style:r},B),{children:[jsxRuntime.jsx(Bt,{style:co}),o]}))}))]})})]}))}L.Close=e=>jsxRuntime.jsx(Y__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,d(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});L.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(pe,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};L.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,i({title:o,onClick:e},t))};L.Progress=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(i({part:"progress"},o),{children:e}))};L.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,i({title:o,onClick:e},t))};L.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(i({part:"subtitle"},o),{children:e}))};L.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(i({part:"title"},o),{children:e}))};function Ot(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:s}=u,p=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var k,R,H,T,w,$;let{handleDismiss:g}=se(o,{onDismiss:t}),{handlePrimary:b,handleSecondary:f}=le(s,{onPrimary:r,onSecondary:a}),C=(k=s.props)!=null?k:{},h=(H=(R=s.primaryButton)==null?void 0:R.title)!=null?H:s.primaryButtonTitle,x=(w=(T=s.secondaryButton)==null?void 0:T.title)!=null?w:s.secondaryButtonTitle,B=!!s.$state.blocked;return jsxRuntime.jsxs(L,d(i(i({anchor:s.selector,onOpenAutoFocus:E=>E.preventDefault(),onPointerDownOutside:E=>E.preventDefault(),onInteractOutside:E=>E.preventDefault()},p),C),{onEscapeKeyDown:E=>{typeof n=="function"&&n(E),E.defaultPrevented||g(E);},children:[e&&jsxRuntime.jsx(L.Close,{onClick:g}),jsxRuntime.jsx(L.Media,{src:($=s.videoUri)!=null?$:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(S.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(L.Title,{children:s.title}),jsxRuntime.jsx(L.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(L.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(L.Secondary,{disabled:B,onClick:f,title:x}),jsxRuntime.jsx(L.Primary,{disabled:B,onClick:b,title:h})]})]}),s.id)}function Qn(a){var s=a,{flowId:e,onComplete:o,variables:t,part:n}=s,r=m(s,["flowId","onComplete","variables","part"]);let[p,c]=Ue.useState(!1),{flow:u}=ae(e,{variables:t}),{hasInitialized:g,registerComponent:b,unregisterComponent:f}=Ue.useContext(O);se(u,{onComplete:o});let{isCurrentModal:C,removeModal:h}=Se(u);if(Ue.useEffect(()=>{!(u!=null&&u.isVisible)&&C&&h();},[u==null?void 0:u.isVisible,C]),Ue.useEffect(()=>()=>{f(e);},[]),u==null||u.isVisible===!1||!C||(b(e,()=>{p||c(!0);}),!g||!p))return null;let x=u.getCurrentStep();return x==null||x.start(),jsxRuntime.jsx(Ot,i({flow:u,part:["tour",n],step:x},r))}function oi(){let{frigade:e}=Ue.useContext(O);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function ri(){let{userId:e,frigade:o}=Ue.useContext(O);function t(r){return A(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return A(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function ii(){var r;let{frigade:e}=Ue.useContext(O);function o(a){return A(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function t(a,s){return A(this,null,function*(){yield e.track(a,s);})}function n(a,s){return A(this,null,function*(){yield e.group(a,s);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
87
+ `;function L(s){var d=s,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=d,a=m(d,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:g}=Ae(),{node:b,rect:f,ref:C}=Ae(),si=kt(a,u),{contentProps:h,otherProps:It}=si,uo=It,{part:x}=uo,B=m(uo,["part"]),{rootProps:k}=si,[R,H]=Ue.useState(h.align),[T,w]=Ue.useState(h.side),[$,E]=Ue.useState(0),[j,xe]=Ue.useState(0);if(c!==null){let G=c.getAttribute("data-align"),ne=c.getAttribute("data-side");R!==G&&H(G),T!==ne&&w(ne);}let re=Ue.useRef(null);if(Ue.useEffect(()=>{let G=document.querySelector(e);G!=null?(C(G),re.current=G):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),Ue.useEffect(()=>{function G(be){if(be.matches(e))return be;let me=be.querySelectorAll(e);return me.length>0?me[0]:null}let ne=new MutationObserver(be=>{for(let me of be)if(me.type==="childList"){for(let he of me.addedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let ie=G(he);if(ie!=null){C(ie),re.current=ie,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ie);break}}for(let he of me.removedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let ie=G(he);if(ie!=null){C(null),re.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ie);break}}}});return ne.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ne.disconnect()},[]),Ue.useEffect(()=>{let{scrollX:G,scrollY:ne}=window;E(f.left+G),xe(f.top+ne);},[f.left,f.top]),b==null)return null;let ve="0";typeof window!="undefined"&&(ve=window.getComputedStyle(b).borderRadius);let co=Rt({props:a,alignAttr:R,sideAttr:T});return jsxRuntime.jsxs(Y__namespace.Root,p(i({defaultOpen:!0},k),{children:[jsxRuntime.jsx(Y__namespace.Anchor,{virtualRef:re}),jsxRuntime.jsx(Y__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx(y,i({animation:`${Dt} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:ve,height:f.height,left:$,top:j,width:f.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsxRuntime.jsx(Y__namespace.Content,p(i({asChild:!0},h),{ref:g,children:jsxRuntime.jsxs(P,p(i({animation:`${Dt} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},part:["tooltip",x],style:r},B),{children:[jsxRuntime.jsx(Bt,{style:co}),o]}))}))]})})]}))}L.Close=e=>jsxRuntime.jsx(Y__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,p(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});L.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(pe,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};L.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,i({title:o,onClick:e},t))};L.Progress=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,p(i({part:"progress"},o),{children:e}))};L.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,i({title:o,onClick:e},t))};L.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))};L.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,p(i({part:"title"},o),{children:e}))};function Ot(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:a,step:s}=u,d=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var k,R,H,T,w,$;let{handleDismiss:g}=se(o,{onDismiss:t}),{handlePrimary:b,handleSecondary:f}=le(s,{onPrimary:r,onSecondary:a}),C=(k=s.props)!=null?k:{},h=(H=(R=s.primaryButton)==null?void 0:R.title)!=null?H:s.primaryButtonTitle,x=(w=(T=s.secondaryButton)==null?void 0:T.title)!=null?w:s.secondaryButtonTitle,B=!!s.$state.blocked;return jsxRuntime.jsxs(L,p(i(i({anchor:s.selector,onOpenAutoFocus:E=>E.preventDefault(),onPointerDownOutside:E=>E.preventDefault(),onInteractOutside:E=>E.preventDefault()},d),C),{onEscapeKeyDown:E=>{typeof n=="function"&&n(E),E.defaultPrevented||g(E);},children:[e&&jsxRuntime.jsx(L.Close,{onClick:g}),jsxRuntime.jsx(L.Media,{src:($=s.videoUri)!=null?$:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(S.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(L.Title,{children:s.title}),jsxRuntime.jsx(L.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(S.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(L.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(L.Secondary,{disabled:B,onClick:f,title:x}),jsxRuntime.jsx(L.Primary,{disabled:B,onClick:b,title:h})]})]}),s.id)}function Qn(a){var s=a,{flowId:e,onComplete:o,variables:t,part:n}=s,r=m(s,["flowId","onComplete","variables","part"]);let[d,c]=Ue.useState(!1),{flow:u}=ae(e,{variables:t}),{hasInitialized:g,registerComponent:b,unregisterComponent:f}=Ue.useContext(O);se(u,{onComplete:o});let{isCurrentModal:C,removeModal:h}=Se(u);if(Ue.useEffect(()=>{!(u!=null&&u.isVisible)&&C&&h();},[u==null?void 0:u.isVisible,C]),Ue.useEffect(()=>()=>{f(e);},[]),u==null||u.isVisible===!1||!C||(b(e,()=>{d||c(!0);}),!g||!d))return null;let x=u.getCurrentStep();return x==null||x.start(),jsxRuntime.jsx(Ot,i({flow:u,part:["tour",n],step:x},r))}function oi(){let{frigade:e}=Ue.useContext(O);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function ri(){let{userId:e,frigade:o}=Ue.useContext(O);function t(r){return A(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return A(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function ii(){var r;let{frigade:e}=Ue.useContext(O);function o(a){return A(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function t(a,s){return A(this,null,function*(){yield e.track(a,s);})}function n(a,s){return A(this,null,function*(){yield e.group(a,s);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
88
88
 
89
89
  exports.FrigadeJS = js__namespace;
90
90
  exports.Announcement = pn;