@frigade/react 2.5.19 → 2.5.21

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
@@ -93,7 +93,7 @@ var it=Object.defineProperty,an=Object.defineProperties;var sn=Object.getOwnProp
93
93
  to {
94
94
  opacity: 1;
95
95
  }
96
- `;function fo(B){var S=B,{align:e,alignOffset:o,autoScroll:t,defaultOpen:n,dismissible:r,flow:i,handleDismiss:s,modal:l,onPrimary:d,onSecondary:u,part:m,side:g,sideOffset:b,spotlight:h,step:P}=S,T=f(S,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var M,k,H,A,J;let{handlePrimary:w,handleSecondary:v}=ue(P,{onPrimary:d,onSecondary:u}),F=(k=(M=P.primaryButton)==null?void 0:M.title)!=null?k:P.primaryButtonTitle,O=(A=(H=P.secondaryButton)==null?void 0:H.title)!=null?A:P.secondaryButtonTitle,D=!!P.$state.blocked;return jsxRuntime.jsx(Ko,p(a({align:e,alignOffset:o,anchor:P.selector,autoScroll:t,"data-step-id":P.id,defaultOpen:n,modal:l,part:m,side:g,sideOffset:b,spotlight:h},T),{children:jsxRuntime.jsxs(x,{animation:`${Ba} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsxRuntime.jsx(x.Media,{aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(J=P.videoUri)!=null?J:P.imageUri,transform:"translate3d(0, 0, 1px)",type:P.videoUri?"video":"image"}),jsxRuntime.jsx(x.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:r,handleDismiss:s,subtitle:P.subtitle,title:P.title}),jsxRuntime.jsxs(x.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(Ee,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsxRuntime.jsx(x.Secondary,{disabled:D,onClick:v,title:O}),jsxRuntime.jsx(x.Primary,{disabled:D,onClick:w,title:F})]})]})}))}function $r(r){var i=r,{children:e,container:o,flowId:t}=i,n=f(i,["children","container","flowId"]);return jsxRuntime.jsx(hr,{container:o,children:jsxRuntime.jsx(y,p(a({"data-flow-id":t,part:"tour"},n),{children:e}))})}function go(n){var r=n,{as:e,flowId:o}=r,t=f(r,["as","flowId"]);let{onDismiss:i,onPrimary:s,onSecondary:l}=t;return jsxRuntime.jsx(U,p(a({as:null,flowId:o},t),{children:({flow:d,handleDismiss:u,parentProps:m,step:g})=>{var Te;let Re=m.containerProps,{align:b="after",alignOffset:h=0,autoScroll:P=!1,container:T="body",defaultOpen:B,dismissible:S=!1,modal:w,part:v,sequential:F=!0,side:O="bottom",sideOffset:D=0,spotlight:M,zIndex:k=9999}=Re,H=f(Re,["align","alignOffset","autoScroll","container","defaultOpen","dismissible","modal","part","sequential","side","sideOffset","spotlight","zIndex"]),A=a({align:b,alignOffset:h,autoScroll:P,dismissible:S,flow:d,handleDismiss:u,modal:w,onPrimary:s,onSecondary:l,part:v,side:O,sideOffset:D,spotlight:M,step:g,zIndex:k},(Te=g.props)!=null?Te:{});if(F)return jsxRuntime.jsx($r,p(a({as:e,container:T,flowId:o,part:"tour",zIndex:k},H),{children:jsxRuntime.jsx(fo,a({defaultOpen:B!=null?B:!0},A),g.id)}));let J=Array.from(d.steps.values()).filter(j=>{let{blocked:re,completed:se,skipped:Y,visible:N}=j.$state;return !re&&!se&&!Y&&N}).map(j=>{var Q,le,ne,ye;function re(ie){return W(this,null,function*(){return (yield i==null?void 0:i(d,ie))===!1?(ie.preventDefault(),!1):(j.skip(),!0)})}let se=M&&j.id===g.id,Y=(le=(Q=j.props)==null?void 0:Q.zIndex)!=null?le:k,N=a({align:b,alignOffset:h,dismissible:S,flow:d,handleDismiss:re,onPrimary:s,onSecondary:l,part:v,side:O,sideOffset:D,spotlight:M,zIndex:Y},(ne=j.props)!=null?ne:{});return jsxRuntime.jsx(fo,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(Y)+2},".fr-overlay":{zIndex:Number(Y)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(ye=B||se)!=null?ye:!1,step:j},N),`${j.id}-${se}`)});return jsxRuntime.jsx($r,p(a({as:e,container:T,flowId:o,part:"tour",zIndex:k},H),{children:J}))}}))}function yo(){let{frigade:e}=Eo.useContext(L),[,o]=Eo.useState(!1),t,n=Eo.useCallback(s=>{e==null||e.getCollections().then(()=>{s();});let l=()=>{clearTimeout(t),t=setTimeout(()=>{o(d=>!d),s();},0);};return e==null||e.onStateChange(l),()=>{e==null||e.removeStateChangeHandler(l);}},[]),r=()=>{let s;try{s=e==null?void 0:e.getCollectionsSync();}catch(l){}return s};return {collections:Eo.useSyncExternalStore(n,r,r)}}function xo(e){var l,d,u,m;let{frigade:o}=Eo.useContext(L),{collections:t}=yo(),n=t==null?void 0:t.get(e),i=(m=((u=(d=(l=t==null?void 0:t.get(e))==null?void 0:l.flows)==null?void 0:d.filter(g=>g.visible).map(g=>p(a({},g),{flow:o==null?void 0:o.getFlowSync(g.flowId)})))!=null?u:[]).find(({flow:g})=>g.isVisible))==null?void 0:m.flowId,{flow:s}=Fe(i);return Eo.useEffect(()=>{o==null||o.registerCollection(e);},[e]),{collection:n,currentFlow:s}}function jo(r){var i=r,{collectionId:e,part:o,variables:t={}}=i,n=f(i,["collectionId","part","variables"]);var u,m,g;let s={ANNOUNCEMENT:Xo,BANNER:Oo,CARD:x,CHECKLIST:ro,EMBEDDED_TIP:x,FORM:Me,NPS_SURVEY:Ge,SURVEY:Ge,TOUR:go},{currentFlow:l}=xo(e),d=(m=s[(u=l==null?void 0:l.rawData)==null?void 0:u.flowType])!=null?m:null;return l==null||d==null?null:((g=l==null?void 0:l.rawData)==null?void 0:g.flowType)===js.FlowType.FORM?jsxRuntime.jsx(y,p(a({part:["collection",o],"data-collection-id":e},n),{children:jsxRuntime.jsx(Me,{flowId:l.id,as:$,variables:t},l.id)})):jsxRuntime.jsx(y,p(a({part:["collection",o],"data-collection-id":e},n),{children:jsxRuntime.jsx(d,{flowId:l.id,variables:t},l.id)}))}function Ar(){var t,n;let{collections:e}=yo(),o=(n=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(r=>r[1].collectionType==="DEFAULT"))==null?void 0:n[0];return xo(o),o==null?null:jsxRuntime.jsx(jo,{as:null,collectionId:o})}var L=Eo.createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});function Jo(){let{frigade:e}=Eo.useContext(L);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Mr(){let{frigade:e}=Jo();return Eo.useEffect(()=>{W(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Wr="2.5.19";function zr(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=l,i=f(l,["children","css","defaultCollection","navigate","theme"]);let d=r?vo(r):{},u=Eo.useRef(new Map),m=Eo.useRef(),[g,b]=Eo.useState(!1),h=Eo.useMemo(()=>(b(!1),m.current=void 0,new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides,__platformVersion:Wr,__platformName:"React"})),[i.userId,i.groupId,i.apiKey]);Eo.useEffect(()=>{if(i.__flowStateOverrides){let w=h.getConfig();w.__flowStateOverrides=i.__flowStateOverrides,h.reload(w);}},[i.__flowStateOverrides]);function P(){let w=[...u.current.entries()].map(([v,F])=>[v,F.callback]);h.batchRegister(w),b(!0);}function T(w,v){if(m.current&&clearTimeout(m.current),g){u.current.has(w)?h.getFlow(w).then(F=>v(F.isVisible)):(h.getFlow(w).then(F=>F.register(v)),u.current.set(w,{callback:v}));return}u.current.has(w)||u.current.set(w,{callback:v}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>P(),0);}function B(w){u.current.has(w)&&h.getFlow(w).then(v=>{u.current.delete(w),v==null||v.unregister();});}let S=n!=null?n:(w,v="_self")=>{window.open(w,v);};return Eo.useEffect(()=>()=>{h.destroy();},[]),jsxRuntime.jsxs(L.Provider,{value:p(a({navigate:S},i),{frigade:h,registerComponent:T,unregisterComponent:B,hasInitialized:g,variables:i.variables||{}}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},Ro),d),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:E,children:[t&&jsxRuntime.jsx(Ar,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx(Mr,{})]})}function Fe(e,o){let{frigade:t,variables:n}=Eo.useContext(L),[,r]=Eo.useState(!1),i=Eo.useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let d=u=>{u.id===e&&setTimeout(()=>{r(m=>!m),l();},0);};return t==null||t.onStateChange(d),()=>{t==null||t.removeStateChangeHandler(d);}},[e,t]),s=Eo.useSyncExternalStore(i,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return s==null||s.applyVariables(a(a({},n),o==null?void 0:o.variables)),{flow:s,isLoading:t!=null&&t.hasFailedToLoad()?!1:!s}}function Zo(e,{onComplete:o,onDismiss:t}={}){let n=Eo.useRef(null);return Eo.useEffect(()=>{if(e==null)return;function r(){return W(this,null,function*(){e.isCompleted&&n.current===!1&&(yield o==null?void 0:o(e));})}return r(),n.current=e==null?void 0:e.isCompleted,()=>{r();}},[e==null?void 0:e.isCompleted]),{handleDismiss:Eo.useCallback(r=>W(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}var fe=new Set;function Yo(e,o=!0){let t=Eo.useCallback(()=>{fe.has(e==null?void 0:e.id)&&fe.delete(e==null?void 0:e.id);},[fe,o]),n=Eo.useCallback(()=>{o&&(e!=null&&e.isVisible)&&!fe.has(e.id)&&fe.add(e.id);},[fe,o]);Eo.useEffect(()=>()=>{t();},[]),Eo.useEffect(()=>{n();let i=()=>{t();};return window.addEventListener("popstate",i),window.addEventListener("beforeunload",i),()=>{t(),window.removeEventListener("popstate",i),window.removeEventListener("beforeunload",i);}},[n,t]),e!=null&&e.isVisible?n():t();let r=fe.size>0?fe.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||fe.size==0:!0}}function U(u){var m=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:i,onSecondary:s,variables:l}=m,d=f(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var k,A;let{flow:g}=Fe(t,{variables:l}),H=a(a({},d),(k=g==null?void 0:g.props)!=null?k:{}),{dismissible:b=!1,forceMount:h=!1}=H,P=f(H,["dismissible","forceMount"]),T=g==null?void 0:g.getCurrentStep(),{handleDismiss:B}=Zo(g,{onComplete:n,onDismiss:r}),{handlePrimary:S,handleSecondary:w}=ue(T,{onPrimary:i,onSecondary:s}),v=(P==null?void 0:P.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((A=g==null?void 0:g.rawData)==null?void 0:A.flowType),{isCurrentModal:F}=Yo(g,v),O=h&&((g==null?void 0:g.isCompleted)||(g==null?void 0:g.isSkipped));if(!g||!g.isVisible&&!O||!O&&!F)return null;(O||!g.isCompleted&&!g.isSkipped)&&(T==null||T.start());let D=e===null?Eo.Fragment:e!=null?e:y,M=p(a({},P),{"data-flow-id":g.id});return jsxRuntime.jsx(D,p(a({},e===null?{}:M),{children:o({flow:g,handleDismiss:B,handlePrimary:S,handleSecondary:w,parentProps:{dismissible:b,flowId:t,variables:l,containerProps:M},step:T})}))}function jr(t){var n=t,{part:e}=n,o=f(n,["part"]);return jsxRuntime.jsx(U,p(a({as:x,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:l},step:d})=>{var g,b,h,P;let u=(b=(g=d.primaryButton)==null?void 0:g.title)!=null?b:d.primaryButtonTitle,m=(P=(h=d.secondaryButton)==null?void 0:h.title)!=null?P:d.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(x.Header,{dismissible:l,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsxRuntime.jsx(x.Media,{src:d.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(x.Secondary,{title:m,onClick:s}),jsxRuntime.jsx(x.Primary,{title:u,onClick:i})]})]})}}))}function bo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);return jsxRuntime.jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function ts(e){var o,t,n,r,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Po(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);let i=ts(o);return i?jsxRuntime.jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,a({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function he(n){var r=n,{src:e,type:o}=r,t=f(r,["src","type"]);return jsxRuntime.jsx(o==="video"?Po:bo,a({src:e},t))}var x=Eo__namespace.forwardRef((i,r)=>{var s=i,{children:e,flowId:o,part:t}=s,n=f(s,["children","flowId","part"]);var d;if(o!=null)return jsxRuntime.jsx(jr,a({flowId:o},n));let l=(d=n.as)!=null?d:C.Column;return jsxRuntime.jsx(l,p(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},n),{ref:r,children:e}))});x.Dismiss=e=>jsxRuntime.jsx(I.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(Be,{height:"20",fill:"currentColor"})}));x.Footer=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return jsxRuntime.jsx(C.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};x.Header=s=>{var l=s,{dismissible:e,handleDismiss:o,part:t,subtitle:n,title:r}=l,i=f(l,["dismissible","handleDismiss","part","subtitle","title"]);return jsxRuntime.jsxs(C.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsxRuntime.jsx(x.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(x.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(x.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};x.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(he,a({borderRadius:"md",src:e},o))};x.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};x.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};x.Subtitle=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsxRuntime.jsx(R.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};x.Title=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsxRuntime.jsx(R.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var Co={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function qr(e){let o=Object.fromEntries(Co.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(Co.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!Co.content.some(i=>i===r)&&!Co.root.some(i=>i===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var as=react.keyframes`
96
+ `;function fo(B){var S=B,{align:e,alignOffset:o,autoScroll:t,defaultOpen:n,dismissible:r,flow:i,handleDismiss:s,modal:l,onPrimary:d,onSecondary:u,part:m,side:g,sideOffset:b,spotlight:h,step:P}=S,T=f(S,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var M,k,H,A,J;let{handlePrimary:w,handleSecondary:v}=ue(P,{onPrimary:d,onSecondary:u}),F=(k=(M=P.primaryButton)==null?void 0:M.title)!=null?k:P.primaryButtonTitle,O=(A=(H=P.secondaryButton)==null?void 0:H.title)!=null?A:P.secondaryButtonTitle,D=!!P.$state.blocked;return jsxRuntime.jsx(Ko,p(a({align:e,alignOffset:o,anchor:P.selector,autoScroll:t,"data-step-id":P.id,defaultOpen:n,modal:l,part:m,side:g,sideOffset:b,spotlight:h},T),{children:jsxRuntime.jsxs(x,{animation:`${Ba} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsxRuntime.jsx(x.Media,{aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(J=P.videoUri)!=null?J:P.imageUri,transform:"translate3d(0, 0, 1px)",type:P.videoUri?"video":"image"}),jsxRuntime.jsx(x.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:r,handleDismiss:s,subtitle:P.subtitle,title:P.title}),jsxRuntime.jsxs(x.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(Ee,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsxRuntime.jsx(x.Secondary,{disabled:D,onClick:v,title:O}),jsxRuntime.jsx(x.Primary,{disabled:D,onClick:w,title:F})]})]})}))}function $r(r){var i=r,{children:e,container:o,flowId:t}=i,n=f(i,["children","container","flowId"]);return jsxRuntime.jsx(hr,{container:o,children:jsxRuntime.jsx(y,p(a({"data-flow-id":t,part:"tour"},n),{children:e}))})}function go(n){var r=n,{as:e,flowId:o}=r,t=f(r,["as","flowId"]);let{onDismiss:i,onPrimary:s,onSecondary:l}=t;return jsxRuntime.jsx(U,p(a({as:null,flowId:o},t),{children:({flow:d,handleDismiss:u,parentProps:m,step:g})=>{var Te;let Re=m.containerProps,{align:b="after",alignOffset:h=0,autoScroll:P=!1,container:T="body",defaultOpen:B,dismissible:S=!1,modal:w,part:v,sequential:F=!0,side:O="bottom",sideOffset:D=0,spotlight:M,zIndex:k=9999}=Re,H=f(Re,["align","alignOffset","autoScroll","container","defaultOpen","dismissible","modal","part","sequential","side","sideOffset","spotlight","zIndex"]),A=a({align:b,alignOffset:h,autoScroll:P,dismissible:S,flow:d,handleDismiss:u,modal:w,onPrimary:s,onSecondary:l,part:v,side:O,sideOffset:D,spotlight:M,step:g,zIndex:k},(Te=g.props)!=null?Te:{});if(F)return jsxRuntime.jsx($r,p(a({as:e,container:T,flowId:o,part:"tour",zIndex:k},H),{children:jsxRuntime.jsx(fo,a({defaultOpen:B!=null?B:!0},A),g.id)}));let J=Array.from(d.steps.values()).filter(j=>{let{blocked:re,completed:se,skipped:Y,visible:N}=j.$state;return !re&&!se&&!Y&&N}).map(j=>{var Q,le,ne,ye;function re(ie){return W(this,null,function*(){return (yield i==null?void 0:i(d,ie))===!1?(ie.preventDefault(),!1):(j.skip(),!0)})}let se=M&&j.id===g.id,Y=(le=(Q=j.props)==null?void 0:Q.zIndex)!=null?le:k,N=a({align:b,alignOffset:h,dismissible:S,flow:d,handleDismiss:re,onPrimary:s,onSecondary:l,part:v,side:O,sideOffset:D,spotlight:M,zIndex:Y},(ne=j.props)!=null?ne:{});return jsxRuntime.jsx(fo,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(Y)+2},".fr-overlay":{zIndex:Number(Y)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(ye=B||se)!=null?ye:!1,step:j},N),`${j.id}-${se}`)});return jsxRuntime.jsx($r,p(a({as:e,container:T,flowId:o,part:"tour",zIndex:k},H),{children:J}))}}))}function yo(){let{frigade:e}=Eo.useContext(L),[,o]=Eo.useState(!1),t,n=Eo.useCallback(s=>{e==null||e.getCollections().then(()=>{s();});let l=()=>{clearTimeout(t),t=setTimeout(()=>{o(d=>!d),s();},0);};return e==null||e.onStateChange(l),()=>{e==null||e.removeStateChangeHandler(l);}},[]),r=()=>{let s;try{s=e==null?void 0:e.getCollectionsSync();}catch(l){}return s};return {collections:Eo.useSyncExternalStore(n,r,r)}}function xo(e){var l,d,u,m;let{frigade:o}=Eo.useContext(L),{collections:t}=yo(),n=t==null?void 0:t.get(e),i=(m=((u=(d=(l=t==null?void 0:t.get(e))==null?void 0:l.flows)==null?void 0:d.filter(g=>g.visible).map(g=>p(a({},g),{flow:o==null?void 0:o.getFlowSync(g.flowId)})))!=null?u:[]).find(({flow:g})=>g.isVisible))==null?void 0:m.flowId,{flow:s}=Fe(i);return Eo.useEffect(()=>{o==null||o.registerCollection(e);},[e]),{collection:n,currentFlow:s}}function jo(r){var i=r,{collectionId:e,part:o,variables:t={}}=i,n=f(i,["collectionId","part","variables"]);var u,m,g;let s={ANNOUNCEMENT:Xo,BANNER:Oo,CARD:x,CHECKLIST:ro,EMBEDDED_TIP:x,FORM:Me,NPS_SURVEY:Ge,SURVEY:Ge,TOUR:go},{currentFlow:l}=xo(e),d=(m=s[(u=l==null?void 0:l.rawData)==null?void 0:u.flowType])!=null?m:null;return l==null||d==null?null:((g=l==null?void 0:l.rawData)==null?void 0:g.flowType)===js.FlowType.FORM?jsxRuntime.jsx(y,p(a({part:["collection",o],"data-collection-id":e},n),{children:jsxRuntime.jsx(Me,{flowId:l.id,as:$,variables:t},l.id)})):jsxRuntime.jsx(y,p(a({part:["collection",o],"data-collection-id":e},n),{children:jsxRuntime.jsx(d,{flowId:l.id,variables:t},l.id)}))}function Ar(){var t,n;let{collections:e}=yo(),o=(n=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(r=>r[1].collectionType==="DEFAULT"))==null?void 0:n[0];return xo(o),o==null?null:jsxRuntime.jsx(jo,{as:null,collectionId:o})}var L=Eo.createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});function Jo(){let{frigade:e}=Eo.useContext(L);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Mr(){let{frigade:e}=Jo();return Eo.useEffect(()=>{W(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Wr="2.5.21";function zr(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=l,i=f(l,["children","css","defaultCollection","navigate","theme"]);let d=r?vo(r):{},u=Eo.useRef(new Map),m=Eo.useRef(),[g,b]=Eo.useState(!1),h=Eo.useMemo(()=>(b(!1),m.current=void 0,new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides,__platformVersion:Wr,__platformName:"React"})),[i.userId,i.groupId,i.apiKey]);Eo.useEffect(()=>{if(i.__flowStateOverrides){let w=h.getConfig();w.__flowStateOverrides=i.__flowStateOverrides,h.reload(w);}},[i.__flowStateOverrides]);function P(){let w=[...u.current.entries()].map(([v,F])=>[v,F.callback]);h.batchRegister(w),b(!0);}function T(w,v){if(m.current&&clearTimeout(m.current),g){u.current.has(w)?h.getFlow(w).then(F=>v(F.isVisible)):(h.getFlow(w).then(F=>F.register(v)),u.current.set(w,{callback:v}));return}u.current.has(w)||u.current.set(w,{callback:v}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>P(),0);}function B(w){u.current.has(w)&&h.getFlow(w).then(v=>{u.current.delete(w),v==null||v.unregister();});}let S=n!=null?n:(w,v="_self")=>{window.open(w,v);};return Eo.useEffect(()=>()=>{h.destroy();},[]),jsxRuntime.jsxs(L.Provider,{value:p(a({navigate:S},i),{frigade:h,registerComponent:T,unregisterComponent:B,hasInitialized:g,variables:i.variables||{}}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},Ro),d),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:E,children:[t&&jsxRuntime.jsx(Ar,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx(Mr,{})]})}function Fe(e,o){let{frigade:t,variables:n}=Eo.useContext(L),[,r]=Eo.useState(!1),i=Eo.useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let d=u=>{u.id===e&&setTimeout(()=>{r(m=>!m),l();},0);};return t==null||t.onStateChange(d),()=>{t==null||t.removeStateChangeHandler(d);}},[e,t]),s=Eo.useSyncExternalStore(i,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return Eo.useEffect(()=>{s==null||s.applyVariables(a(a({},n),o==null?void 0:o.variables));},[o==null?void 0:o.variables,e,n]),{flow:s,isLoading:t!=null&&t.hasFailedToLoad()?!1:!s}}function Zo(e,{onComplete:o,onDismiss:t}={}){let n=Eo.useRef(null);return Eo.useEffect(()=>{if(e==null)return;function r(){return W(this,null,function*(){e.isCompleted&&n.current===!1&&(yield o==null?void 0:o(e));})}return r(),n.current=e==null?void 0:e.isCompleted,()=>{r();}},[e==null?void 0:e.isCompleted]),{handleDismiss:Eo.useCallback(r=>W(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}var fe=new Set;function Yo(e,o=!0){let t=Eo.useCallback(()=>{fe.has(e==null?void 0:e.id)&&fe.delete(e==null?void 0:e.id);},[fe,o]),n=Eo.useCallback(()=>{o&&(e!=null&&e.isVisible)&&!fe.has(e.id)&&fe.add(e.id);},[fe,o]);Eo.useEffect(()=>()=>{t();},[]),Eo.useEffect(()=>{n();let i=()=>{t();};return window.addEventListener("popstate",i),window.addEventListener("beforeunload",i),()=>{t(),window.removeEventListener("popstate",i),window.removeEventListener("beforeunload",i);}},[n,t]),e!=null&&e.isVisible?n():t();let r=fe.size>0?fe.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||fe.size==0:!0}}function U(u){var m=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:i,onSecondary:s,variables:l}=m,d=f(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var k,A;let{flow:g}=Fe(t,{variables:l}),H=a(a({},d),(k=g==null?void 0:g.props)!=null?k:{}),{dismissible:b=!1,forceMount:h=!1}=H,P=f(H,["dismissible","forceMount"]),T=g==null?void 0:g.getCurrentStep(),{handleDismiss:B}=Zo(g,{onComplete:n,onDismiss:r}),{handlePrimary:S,handleSecondary:w}=ue(T,{onPrimary:i,onSecondary:s}),v=(P==null?void 0:P.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((A=g==null?void 0:g.rawData)==null?void 0:A.flowType),{isCurrentModal:F}=Yo(g,v),O=h&&((g==null?void 0:g.isCompleted)||(g==null?void 0:g.isSkipped));if(!g||!g.isVisible&&!O||!O&&!F)return null;(O||!g.isCompleted&&!g.isSkipped)&&(T==null||T.start());let D=e===null?Eo.Fragment:e!=null?e:y,M=p(a({},P),{"data-flow-id":g.id});return jsxRuntime.jsx(D,p(a({},e===null?{}:M),{children:o({flow:g,handleDismiss:B,handlePrimary:S,handleSecondary:w,parentProps:{dismissible:b,flowId:t,variables:l,containerProps:M},step:T})}))}function jr(t){var n=t,{part:e}=n,o=f(n,["part"]);return jsxRuntime.jsx(U,p(a({as:x,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:l},step:d})=>{var g,b,h,P;let u=(b=(g=d.primaryButton)==null?void 0:g.title)!=null?b:d.primaryButtonTitle,m=(P=(h=d.secondaryButton)==null?void 0:h.title)!=null?P:d.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(x.Header,{dismissible:l,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsxRuntime.jsx(x.Media,{src:d.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(x.Secondary,{title:m,onClick:s}),jsxRuntime.jsx(x.Primary,{title:u,onClick:i})]})]})}}))}function bo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);return jsxRuntime.jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function rs(e){var o,t,n,r,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Po(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);let i=rs(o);return i?jsxRuntime.jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(y,a({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function he(n){var r=n,{src:e,type:o}=r,t=f(r,["src","type"]);return jsxRuntime.jsx(o==="video"?Po:bo,a({src:e},t))}var x=Eo__namespace.forwardRef((i,r)=>{var s=i,{children:e,flowId:o,part:t}=s,n=f(s,["children","flowId","part"]);var d;if(o!=null)return jsxRuntime.jsx(jr,a({flowId:o},n));let l=(d=n.as)!=null?d:C.Column;return jsxRuntime.jsx(l,p(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},n),{ref:r,children:e}))});x.Dismiss=e=>jsxRuntime.jsx(I.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(Be,{height:"20",fill:"currentColor"})}));x.Footer=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return jsxRuntime.jsx(C.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};x.Header=s=>{var l=s,{dismissible:e,handleDismiss:o,part:t,subtitle:n,title:r}=l,i=f(l,["dismissible","handleDismiss","part","subtitle","title"]);return jsxRuntime.jsxs(C.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsxRuntime.jsx(x.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(x.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(x.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};x.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(he,a({borderRadius:"md",src:e},o))};x.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};x.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};x.Subtitle=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsxRuntime.jsx(R.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};x.Title=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsxRuntime.jsx(R.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var Co={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function qr(e){let o=Object.fromEntries(Co.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(Co.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!Co.content.some(i=>i===r)&&!Co.root.some(i=>i===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var ss=react.keyframes`
97
97
  from {
98
98
  opacity: 0;
99
99
  }
@@ -103,7 +103,7 @@ var it=Object.defineProperty,an=Object.defineProperties;var sn=Object.getOwnProp
103
103
  to {
104
104
  opacity: 1;
105
105
  }
106
- `;function $(r){var i=r,{children:e,className:o,modal:t=!0}=i,n=f(i,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:m}=qr(n),g=m,{zIndex:d}=g,u=f(g,["zIndex"]);return jsxRuntime.jsx(X__namespace.Root,p(a({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(X__namespace.Portal,{children:jsxRuntime.jsxs(y,{animation:`${as} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:d!=null?d:10,children:[t&&jsxRuntime.jsx(X__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(X__namespace.Content,p(a({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},l),{children:jsxRuntime.jsx(x,p(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}$.Dismiss=e=>jsxRuntime.jsx(X__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(I.Plain,p(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(Be,{height:"20",fill:"currentColor"})}))});$.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsxRuntime.jsx(X__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(R.Body2,p(a({part:"subtitle"},o),{children:e}))})};$.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsxRuntime.jsx(he,a({borderRadius:"md",src:e},o))};$.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};$.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?E.colors.primary.surface:E.colors.neutral[700],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})};$.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};$.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsxRuntime.jsx(X__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(R.H4,p(a({part:"title"},o),{children:e}))})};$.displayName="Dialog";var Zr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Xo(n){var r=n,{flowId:e,part:o}=r,t=f(r,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([l])=>Zr.some(d=>l===d))),s=Object.fromEntries(Object.entries(t).filter(([l])=>Zr.indexOf(l)===-1));return jsxRuntime.jsx(U,p(a({as:null,flowId:e},i),{children:({flow:l,handleDismiss:d,handlePrimary:u,handleSecondary:m,parentProps:{containerProps:g,dismissible:b},step:h})=>{var w,v,F,O,D,M;let P=(w=h.props)!=null?w:{},T=(F=(v=h.primaryButton)==null?void 0:v.title)!=null?F:h.primaryButtonTitle,B=(D=(O=h.secondaryButton)==null?void 0:O.title)!=null?D:h.secondaryButtonTitle,S=h.$state.blocked;return jsxRuntime.jsx($,p(a(a({part:["announcement",o],textAlign:"center"},g),s),{onEscapeKeyDown:k=>{if(t.dismissible===!1){k.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(k),k.defaultPrevented||d(k);},children:jsxRuntime.jsxs(C.Column,p(a({gap:5,part:"announcement-step"},P),{children:[b&&jsxRuntime.jsx($.Dismiss,{onClick:d}),jsxRuntime.jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx($.Title,{children:h.title}),jsxRuntime.jsx($.Subtitle,{children:h.subtitle})]}),jsxRuntime.jsx($.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(M=h.videoUri)!=null?M:h.imageUri,transform:"translate3d(0, 0, 1px)",type:h.videoUri?"video":"image",width:"100%"}),jsxRuntime.jsx($.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsxRuntime.jsx($.Secondary,{disabled:S,onClick:m,title:B}),T&&jsxRuntime.jsx($.Primary,{disabled:S,onClick:u,title:T})]})]}))}))}}))}function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function So(...e){let o=e.shift(),t=e.length===1?e[0]:So(...e);if(!et(o)||!et(t))throw new Error("deepmerge can only merge Objects");let n=structuredClone(o);return Object.entries(t).forEach(([r,i])=>{et(i)?n[r]!==void 0?Object.assign(n,{[r]:So(n[r],structuredClone(i))}):Object.assign(n,{[r]:structuredClone(i)}):Array.isArray(i)?n[r]!==void 0?Object.assign(n,{[r]:[...n[r],...structuredClone(i)]}):Object.assign(n,{[r]:structuredClone(i)}):Object.assign(n,{[r]:i});}),n}function ls(...e){for(let o of e)if(o!=null&&o.length>0)return o;return null}function ps(t){var n=t,{title:e}=n,o=f(n,["title"]);return jsxRuntime.jsx(U,p(a({as:null},o),{children:({flow:r,parentProps:{containerProps:i},step:s})=>{var g,b,h;let l=ls(e,r.title,s.title),d=(g=r==null?void 0:r.getNumberOfCompletedSteps())!=null?g:0,u=(b=r==null?void 0:r.getNumberOfAvailableSteps())!=null?b:1,m=i.onClick!=null;return m&&(i.css=So({"&:hover":{backgroundColor:"var(--fr-colors-neutral-hover-background)"}},(h=i.css)!=null?h:{})),jsxRuntime.jsxs(x,p(a({"aria-label":"Progress Badge",borderWidth:"md",cursor:m?"pointer":"auto",gap:"1",p:"3",part:"progress-badge",role:"complementary"},i),{children:[jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:"2",part:"progress-badge-header",children:[jsxRuntime.jsx(x.Title,{fontSize:"sm",lineHeight:"sm",children:l}),jsxRuntime.jsx(y,{as:ao,height:"20px",marginLeft:"auto",marginRight:"-1",transform:"rotate(-90deg)",width:"20px"})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:"2",part:"progress-badge-footer",children:[jsxRuntime.jsx(Ee,{current:d,fontSize:"xs",fontWeight:"medium",lineHeight:"xs",total:u}),jsxRuntime.jsx(oo,{current:d,flexGrow:"1",total:u})]})]}))}}))}var cs=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Qr(n){var r=n,{style:e={},part:o=""}=r,t=f(r,["style","part"]);return jsxRuntime.jsxs(y,p(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${cs}`,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 en({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};r[l[n]]=s;let d=i();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(d)?["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 wo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function on(e,o){var i,s,l,d,u;let t=Object.fromEntries(wo.content.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),n=Object.fromEntries(wo.root.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),r={};for(let m of Object.keys(e))!wo.content.includes(m)&&!wo.root.includes(m)&&(r[m]=e[m]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let m={after:"end",before:"start"},g=(S,w)=>["top","bottom"].includes(w)?S=="after"?"marginLeft":"marginRight":S=="after"?"marginTop":"marginBottom",b=(l=t.alignOffset)!=null?l:0,h=(d=t.style)!=null?d:{},P=(u=t.side)!=null?u:"bottom",T=t.align;t.style=p(a({},h),{[g(T,P)]:b});let B=["top","bottom"].includes(P)?o.width:o.height;t.alignOffset=(B+b)*-1,t.align=m[T];}return {contentProps:t,otherProps:r,rootProps:n}}var tn=react.keyframes`
106
+ `;function $(r){var i=r,{children:e,className:o,modal:t=!0}=i,n=f(i,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:m}=qr(n),g=m,{zIndex:d}=g,u=f(g,["zIndex"]);return jsxRuntime.jsx(X__namespace.Root,p(a({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(X__namespace.Portal,{children:jsxRuntime.jsxs(y,{animation:`${ss} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:d!=null?d:10,children:[t&&jsxRuntime.jsx(X__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(X__namespace.Content,p(a({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},l),{children:jsxRuntime.jsx(x,p(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}$.Dismiss=e=>jsxRuntime.jsx(X__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(I.Plain,p(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(Be,{height:"20",fill:"currentColor"})}))});$.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsxRuntime.jsx(X__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(R.Body2,p(a({part:"subtitle"},o),{children:e}))})};$.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsxRuntime.jsx(he,a({borderRadius:"md",src:e},o))};$.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};$.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?E.colors.primary.surface:E.colors.neutral[700],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})};$.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};$.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsxRuntime.jsx(X__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(R.H4,p(a({part:"title"},o),{children:e}))})};$.displayName="Dialog";var Zr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Xo(n){var r=n,{flowId:e,part:o}=r,t=f(r,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([l])=>Zr.some(d=>l===d))),s=Object.fromEntries(Object.entries(t).filter(([l])=>Zr.indexOf(l)===-1));return jsxRuntime.jsx(U,p(a({as:null,flowId:e},i),{children:({flow:l,handleDismiss:d,handlePrimary:u,handleSecondary:m,parentProps:{containerProps:g,dismissible:b},step:h})=>{var w,v,F,O,D,M;let P=(w=h.props)!=null?w:{},T=(F=(v=h.primaryButton)==null?void 0:v.title)!=null?F:h.primaryButtonTitle,B=(D=(O=h.secondaryButton)==null?void 0:O.title)!=null?D:h.secondaryButtonTitle,S=h.$state.blocked;return jsxRuntime.jsx($,p(a(a({part:["announcement",o],textAlign:"center"},g),s),{onEscapeKeyDown:k=>{if(t.dismissible===!1){k.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(k),k.defaultPrevented||d(k);},children:jsxRuntime.jsxs(C.Column,p(a({gap:5,part:"announcement-step"},P),{children:[b&&jsxRuntime.jsx($.Dismiss,{onClick:d}),jsxRuntime.jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx($.Title,{children:h.title}),jsxRuntime.jsx($.Subtitle,{children:h.subtitle})]}),jsxRuntime.jsx($.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(M=h.videoUri)!=null?M:h.imageUri,transform:"translate3d(0, 0, 1px)",type:h.videoUri?"video":"image",width:"100%"}),jsxRuntime.jsx($.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsxRuntime.jsx($.Secondary,{disabled:S,onClick:m,title:B}),T&&jsxRuntime.jsx($.Primary,{disabled:S,onClick:u,title:T})]})]}))}))}}))}function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function So(...e){let o=e.shift(),t=e.length===1?e[0]:So(...e);if(!et(o)||!et(t))throw new Error("deepmerge can only merge Objects");let n=structuredClone(o);return Object.entries(t).forEach(([r,i])=>{et(i)?n[r]!==void 0?Object.assign(n,{[r]:So(n[r],structuredClone(i))}):Object.assign(n,{[r]:structuredClone(i)}):Array.isArray(i)?n[r]!==void 0?Object.assign(n,{[r]:[...n[r],...structuredClone(i)]}):Object.assign(n,{[r]:structuredClone(i)}):Object.assign(n,{[r]:i});}),n}function ps(...e){for(let o of e)if(o!=null&&o.length>0)return o;return null}function ds(t){var n=t,{title:e}=n,o=f(n,["title"]);return jsxRuntime.jsx(U,p(a({as:null},o),{children:({flow:r,parentProps:{containerProps:i},step:s})=>{var g,b,h;let l=ps(e,r.title,s.title),d=(g=r==null?void 0:r.getNumberOfCompletedSteps())!=null?g:0,u=(b=r==null?void 0:r.getNumberOfAvailableSteps())!=null?b:1,m=i.onClick!=null;return m&&(i.css=So({"&:hover":{backgroundColor:"var(--fr-colors-neutral-hover-background)"}},(h=i.css)!=null?h:{})),jsxRuntime.jsxs(x,p(a({"aria-label":"Progress Badge",borderWidth:"md",cursor:m?"pointer":"auto",gap:"1",p:"3",part:"progress-badge",role:"complementary"},i),{children:[jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:"2",part:"progress-badge-header",children:[jsxRuntime.jsx(x.Title,{fontSize:"sm",lineHeight:"sm",children:l}),jsxRuntime.jsx(y,{as:ao,height:"20px",marginLeft:"auto",marginRight:"-1",transform:"rotate(-90deg)",width:"20px"})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:"2",part:"progress-badge-footer",children:[jsxRuntime.jsx(Ee,{current:d,fontSize:"xs",fontWeight:"medium",lineHeight:"xs",total:u}),jsxRuntime.jsx(oo,{current:d,flexGrow:"1",total:u})]})]}))}}))}var us=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Qr(n){var r=n,{style:e={},part:o=""}=r,t=f(r,["style","part"]);return jsxRuntime.jsxs(y,p(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${us}`,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 en({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};r[l[n]]=s;let d=i();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(d)?["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 wo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function on(e,o){var i,s,l,d,u;let t=Object.fromEntries(wo.content.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),n=Object.fromEntries(wo.root.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),r={};for(let m of Object.keys(e))!wo.content.includes(m)&&!wo.root.includes(m)&&(r[m]=e[m]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let m={after:"end",before:"start"},g=(S,w)=>["top","bottom"].includes(w)?S=="after"?"marginLeft":"marginRight":S=="after"?"marginTop":"marginBottom",b=(l=t.alignOffset)!=null?l:0,h=(d=t.style)!=null?d:{},P=(u=t.side)!=null?u:"bottom",T=t.align;t.style=p(a({},h),{[g(T,P)]:b});let B=["top","bottom"].includes(P)?o.width:o.height;t.alignOffset=(B+b)*-1,t.align=m[T];}return {contentProps:t,otherProps:r,rootProps:n}}var tn=react.keyframes`
107
107
  from {
108
108
  opacity: 0;
109
109
  }
@@ -113,7 +113,7 @@ var it=Object.defineProperty,an=Object.defineProperties;var sn=Object.getOwnProp
113
113
  to {
114
114
  opacity: 1;
115
115
  }
116
- `;function rn(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function be(u){var m=u,{anchor:e,children:o,className:t,defaultOpen:n=!0,open:r,part:i,spotlight:s=!1,style:l={}}=m,d=f(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:g,rect:b,ref:h}=mo(),{node:P,rect:T,ref:B}=mo(),{contentProps:S,otherProps:w,rootProps:v}=on(d,b),[F,O]=Eo.useState(n),[D,M]=Eo.useState(S.align),[k,H]=Eo.useState(S.side),[A,J]=Eo.useState(0),[Re,Te]=Eo.useState(0);function j(){return r!=null?(console.log("OVERRIDE: ",r),r):(console.log("INTERNAL: ",F),F)}if(g!==null){let N=g.getAttribute("data-align"),Q=g.getAttribute("data-side");D!==N&&M(N),k!==Q&&H(Q);}let re=Eo.useRef(null);if(Eo.useEffect(()=>{let N=document.querySelector(e);N!=null?(B(N),re.current=N):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),Eo.useEffect(()=>{function N(le){if(le.matches(e))return rn(le)?le:null;let ne=le.querySelectorAll(e);return ne.length>0&&rn(ne[0])?ne[0]:null}let Q=new MutationObserver(le=>{for(let ne of le)if(ne.type==="childList"){for(let ye of ne.addedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let ie=N(ye);if(ie!=null){B(ie),re.current=ie,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ie);break}}for(let ye of ne.removedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let ie=N(ye);if(ie!=null){B(null),re.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ie);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),Eo.useEffect(()=>{let{scrollX:N,scrollY:Q}=window;J(T.left+N),Te(T.top+Q);},[T.left,T.top]),P==null)return null;let se="0";typeof window!="undefined"&&(se=window.getComputedStyle(P).borderRadius);let Y=en({props:d,alignAttr:D,sideAttr:k});return jsxRuntime.jsxs(ae__namespace.Root,p(a({defaultOpen:!0},v),{children:[jsxRuntime.jsx(ae__namespace.Anchor,{virtualRef:re}),jsxRuntime.jsx(ae__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(y,a({animation:`${tn} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:se,height:T.height,left:A,top:Re,width:T.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsxRuntime.jsx(ae__namespace.Content,p(a({},S),{ref:h,children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[j()&&jsxRuntime.jsx(x,p(a({animation:`${tn} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",i],style:l},w),{children:o})),jsxRuntime.jsx(Qr,{onClick:()=>{O(()=>(typeof v.onOpenChange=="function"&&v.onOpenChange(!j()),!j()));},style:Y})]})}),F)]})})]}))}be.Close=e=>jsxRuntime.jsx(ae__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(I.Plain,p(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(Be,{height:"20",fill:"currentColor"})}))});be.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsxRuntime.jsx(he,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};be.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};be.Progress=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsxRuntime.jsx(R.Body2,p(a({part:"progress"},o),{children:e}))};be.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};be.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsxRuntime.jsx(R.Body2,p(a({part:"subtitle"},o),{children:e}))};be.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsxRuntime.jsx(R.H4,p(a({part:"title"},o),{children:e}))};function ys(){let{userId:e,frigade:o}=Eo.useContext(L);function t(r){return W(this,null,function*(){yield o.identify(e,r);})}function n(r,i){return W(this,null,function*(){yield o.track(r,i);})}return {userId:e,addProperties:t,track:n}}function hs(){var r;let{frigade:e}=Eo.useContext(L);function o(i){return W(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,i);})}function t(i,s){return W(this,null,function*(){yield e.track(i,s);})}function n(i,s){return W(this,null,function*(){yield e.group(i,s);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
116
+ `;function rn(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function be(u){var m=u,{anchor:e,children:o,className:t,defaultOpen:n=!0,open:r,part:i,spotlight:s=!1,style:l={}}=m,d=f(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:g,rect:b,ref:h}=mo(),{node:P,rect:T,ref:B}=mo(),{contentProps:S,otherProps:w,rootProps:v}=on(d,b),[F,O]=Eo.useState(n),[D,M]=Eo.useState(S.align),[k,H]=Eo.useState(S.side),[A,J]=Eo.useState(0),[Re,Te]=Eo.useState(0);function j(){return r!=null?(console.log("OVERRIDE: ",r),r):(console.log("INTERNAL: ",F),F)}if(g!==null){let N=g.getAttribute("data-align"),Q=g.getAttribute("data-side");D!==N&&M(N),k!==Q&&H(Q);}let re=Eo.useRef(null);if(Eo.useEffect(()=>{let N=document.querySelector(e);N!=null?(B(N),re.current=N):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),Eo.useEffect(()=>{function N(le){if(le.matches(e))return rn(le)?le:null;let ne=le.querySelectorAll(e);return ne.length>0&&rn(ne[0])?ne[0]:null}let Q=new MutationObserver(le=>{for(let ne of le)if(ne.type==="childList"){for(let ye of ne.addedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let ie=N(ye);if(ie!=null){B(ie),re.current=ie,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ie);break}}for(let ye of ne.removedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let ie=N(ye);if(ie!=null){B(null),re.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ie);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),Eo.useEffect(()=>{let{scrollX:N,scrollY:Q}=window;J(T.left+N),Te(T.top+Q);},[T.left,T.top]),P==null)return null;let se="0";typeof window!="undefined"&&(se=window.getComputedStyle(P).borderRadius);let Y=en({props:d,alignAttr:D,sideAttr:k});return jsxRuntime.jsxs(ae__namespace.Root,p(a({defaultOpen:!0},v),{children:[jsxRuntime.jsx(ae__namespace.Anchor,{virtualRef:re}),jsxRuntime.jsx(ae__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(y,a({animation:`${tn} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:se,height:T.height,left:A,top:Re,width:T.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsxRuntime.jsx(ae__namespace.Content,p(a({},S),{ref:h,children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[j()&&jsxRuntime.jsx(x,p(a({animation:`${tn} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",i],style:l},w),{children:o})),jsxRuntime.jsx(Qr,{onClick:()=>{O(()=>(typeof v.onOpenChange=="function"&&v.onOpenChange(!j()),!j()));},style:Y})]})}),F)]})})]}))}be.Close=e=>jsxRuntime.jsx(ae__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(I.Plain,p(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(Be,{height:"20",fill:"currentColor"})}))});be.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsxRuntime.jsx(he,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};be.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};be.Progress=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsxRuntime.jsx(R.Body2,p(a({part:"progress"},o),{children:e}))};be.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};be.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsxRuntime.jsx(R.Body2,p(a({part:"subtitle"},o),{children:e}))};be.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsxRuntime.jsx(R.H4,p(a({part:"title"},o),{children:e}))};function xs(){let{userId:e,frigade:o}=Eo.useContext(L);function t(r){return W(this,null,function*(){yield o.identify(e,r);})}function n(r,i){return W(this,null,function*(){yield o.track(r,i);})}return {userId:e,addProperties:t,track:n}}function bs(){var r;let{frigade:e}=Eo.useContext(L);function o(i){return W(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,i);})}function t(i,s){return W(this,null,function*(){yield e.track(i,s);})}function n(i,s){return W(this,null,function*(){yield e.group(i,s);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
117
117
 
118
118
  exports.FrigadeJS = js__namespace;
119
119
  exports.Announcement = Xo;
@@ -133,7 +133,7 @@ exports.Image = bo;
133
133
  exports.Label = Mo;
134
134
  exports.Media = he;
135
135
  exports.Progress = Ce;
136
- exports.ProgressBadge = ps;
136
+ exports.ProgressBadge = ds;
137
137
  exports.Provider = zr;
138
138
  exports.RadioField = Vo;
139
139
  exports.SelectField = Lo;
@@ -151,9 +151,9 @@ exports.useBoundingClientRect = mo;
151
151
  exports.useFlow = Fe;
152
152
  exports.useFlowHandlers = Zo;
153
153
  exports.useFrigade = Jo;
154
- exports.useGroup = hs;
154
+ exports.useGroup = bs;
155
155
  exports.useModal = Yo;
156
156
  exports.useStepHandlers = ue;
157
- exports.useUser = ys;
157
+ exports.useUser = xs;
158
158
  //# sourceMappingURL=out.js.map
159
159
  //# sourceMappingURL=index.cjs.map