@frigade/react 2.6.6 → 2.6.7

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
@@ -95,7 +95,7 @@ var dt=Object.defineProperty,un=Object.defineProperties;var mn=Object.getOwnProp
95
95
  to {
96
96
  opacity: 1;
97
97
  }
98
- `;function go(F){var C=F,{align:e,alignOffset:o,autoScroll:t,defaultOpen:r,dismissible:n,flow:i,handleDismiss:l,modal:s,onPrimary:d,onSecondary:u,part:m,side:f,sideOffset:x,spotlight:v,step:S}=C,P=g(C,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var re,J,U,Q,ee;let{handlePrimary:B,handleSecondary:E}=ge(S,{onPrimary:d,onSecondary:u}),{videoProps:h,otherProps:k}=pe(P),w=(J=(re=S.primaryButton)==null?void 0:re.title)!=null?J:S.primaryButtonTitle,D=(Q=(U=S.secondaryButton)==null?void 0:U.title)!=null?Q:S.secondaryButtonTitle,H=!!S.$state.blocked;return jsxRuntime.jsx(Jo,p(a({align:e,alignOffset:o,anchor:S.selector,autoScroll:t,"data-step-id":S.id,defaultOpen:r,modal:s,part:m,side:f,sideOffset:x,spotlight:v},k),{children:jsxRuntime.jsxs(b,{animation:`${$a} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsxRuntime.jsx(b.Media,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(ee=S.videoUri)!=null?ee:S.imageUri,transform:"translate3d(0, 0, 1px)",type:S.videoUri?"video":"image"},h)),jsxRuntime.jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:l,subtitle:S.subtitle,title:S.title}),jsxRuntime.jsxs(b.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(Oe,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsxRuntime.jsx(b.Secondary,{disabled:H,onClick:E,title:D}),jsxRuntime.jsx(b.Primary,{disabled:H,onClick:B,title:w})]})]})}))}function Lr(n){var i=n,{children:e,container:o,flowId:t}=i,r=g(i,["children","container","flowId"]);return jsxRuntime.jsx(wr,{container:o,children:jsxRuntime.jsx(y,p(a({"data-flow-id":t,part:"tour"},r),{children:e}))})}function yo(r){var n=r,{as:e,flowId:o}=n,t=g(n,["as","flowId"]);let{onDismiss:i,onPrimary:l,onSecondary:s}=t;return jsxRuntime.jsx(z,p(a({as:null,flowId:o},t),{children:({flow:d,handleDismiss:u,parentProps:m,step:f})=>{var ee;let Q=m.containerProps,{align:x="after",alignOffset:v=0,autoScroll:S=!1,container:P="body",defaultOpen:F,modal:C,part:B,sequential:E=!0,side:h="bottom",sideOffset:k=0,spotlight:w,zIndex:D=9999}=Q,H=g(Q,["align","alignOffset","autoScroll","container","defaultOpen","modal","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:re}=m,J=a({align:x,alignOffset:v,autoScroll:S,dismissible:re,flow:d,handleDismiss:u,modal:C,onPrimary:l,onSecondary:s,part:B,side:h,sideOffset:k,spotlight:w,step:f,zIndex:D},(ee=f.props)!=null?ee:{});if(E)return jsxRuntime.jsx(Lr,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:D},H),{children:jsxRuntime.jsx(go,a({defaultOpen:F!=null?F:!0},J),f.id)}));let U=Array.from(d.steps.values()).filter(_=>{let{blocked:q,completed:j,skipped:oe,visible:W}=_.$state;return !q&&!j&&!oe&&W}).map(_=>{var te,ce,se,xe;function q(le){return A(this,null,function*(){return (yield i==null?void 0:i(d,le))===!1?(le.preventDefault(),!1):(_.skip(),!0)})}let j=w&&_.id===f.id,oe=(ce=(te=_.props)==null?void 0:te.zIndex)!=null?ce:D,W=a({align:x,alignOffset:v,dismissible:re,flow:d,handleDismiss:q,onPrimary:l,onSecondary:s,part:B,side:h,sideOffset:k,spotlight:w,zIndex:oe},(se=_.props)!=null?se:{});return jsxRuntime.jsx(go,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(oe)+2},".fr-overlay":{zIndex:Number(oe)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(xe=F||j)!=null?xe:!1,step:_},W),`${_.id}-${j}`)});return jsxRuntime.jsx(Lr,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:D},H),{children:U}))}}))}var xo="useSyncExternalStore"in Do__namespace?Do__namespace.useSyncExternalStore:Nr__namespace.useSyncExternalStore;function ho(){let{frigade:e}=Do.useContext($),[,o]=Do.useState(!1),t,r=Do.useCallback(l=>{e==null||e.getCollections().then(()=>{l();});let s=()=>{clearTimeout(t),t=setTimeout(()=>{o(d=>!d),l();},0);};return e==null||e.onStateChange(s),()=>{e==null||e.removeStateChangeHandler(s);}},[]),n=()=>{let l;try{l=e==null?void 0:e.getCollectionsSync();}catch(s){}return l};return {collections:xo(r,n,n)}}function bo(e){var s,d,u,m;let{frigade:o}=Do.useContext($),{collections:t}=ho(),r=t==null?void 0:t.get(e),i=(m=((u=(d=(s=t==null?void 0:t.get(e))==null?void 0:s.flows)==null?void 0:d.filter(f=>f.visible).map(f=>p(a({},f),{flow:o==null?void 0:o.getFlowSync(f.flowId)})))!=null?u:[]).find(({flow:f})=>f.isVisible))==null?void 0:m.flowId,{flow:l}=Te(i);return Do.useEffect(()=>{o==null||o.registerCollection(e);},[e]),{collection:r,currentFlow:l}}function Zo(n){var i=n,{collectionId:e,part:o,variables:t={}}=i,r=g(i,["collectionId","part","variables"]);var u,m,f;let l={ANNOUNCEMENT:Yo,BANNER:Io,CARD:b,CHECKLIST:no,EMBEDDED_TIP:b,FORM:Me,NPS_SURVEY:Ke,SURVEY:Ke,TOUR:yo},{currentFlow:s}=bo(e),d=(m=l[(u=s==null?void 0:s.rawData)==null?void 0:u.flowType])!=null?m:null;return s==null||d==null?null:((f=s==null?void 0:s.rawData)==null?void 0:f.flowType)===js.FlowType.FORM?jsxRuntime.jsx(y,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsxRuntime.jsx(Me,{flowId:s.id,as:V,variables:t},s.id)})):jsxRuntime.jsx(y,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsxRuntime.jsx(d,{flowId:s.id,variables:t},s.id)}))}function _r(){var t,r;let{collections:e}=ho(),o=(r=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(n=>n[1].collectionType==="DEFAULT"))==null?void 0:r[0];return bo(o),o==null?null:jsxRuntime.jsx(Zo,{as:null,collectionId:o})}var $=Do.createContext({apiKey:"",currentModal:null,setCurrentModal:()=>{},navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});var be=(e,o="log")=>{let t=`__frigade_logged_${e}`;globalThis[t]||(globalThis[t]=!0,console[o](e));};function Qo(){let e=Do.useContext($);(!e||!e.frigade)&&be("useFrigade() must be used in a child of the Frigade Provider","error");let{frigade:o}=e;return {frigade:o,isLoading:!(o!=null&&o.isReady())}}function zr(){let{frigade:e}=Qo();return Do.useEffect(()=>{A(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}var Ur="2.6.6";function Jr(l){var s=l,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=s,i=g(s,["children","css","defaultCollection","navigate","theme"]);let d=n?To(n):{},u=Do.useRef(new Map),m=Do.useRef(),[f,x]=Do.useState(!1),[v,S]=Do.useState(null),P=Do.useMemo(()=>(x(!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:Ur,__platformName:"React"})),[i.userId,i.groupId,i.apiKey]);Do.useEffect(()=>{if(i.__flowStateOverrides){let h=P.getConfig();h.__flowStateOverrides=i.__flowStateOverrides,P.reload(h);}},[i.__flowStateOverrides]);function F(){let h=[...u.current.entries()].map(([k,w])=>[k,w.callback]);P.batchRegister(h),x(!0);}function C(h,k){if(m.current&&clearTimeout(m.current),f){u.current.has(h)?P.getFlow(h).then(w=>k(w.isVisible)):(P.getFlow(h).then(w=>w.register(k)),u.current.set(h,{callback:k}));return}u.current.has(h)||u.current.set(h,{callback:k}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>F(),0);}function B(h){u.current.has(h)&&P.getFlow(h).then(k=>{u.current.delete(h),k==null||k.unregister();});}let E=r!=null?r:(h,k="_self")=>{window.open(h,k);};return Do.useEffect(()=>()=>{P.destroy();},[]),jsxRuntime.jsxs($.Provider,{value:p(a({currentModal:v,setCurrentModal:S,navigate:E},i),{frigade:P,registerComponent:C,unregisterComponent:B,hasInitialized:f,variables:i.variables||{}}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},ko),d),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:O,children:[t&&jsxRuntime.jsx(_r,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx(zr,{})]})}function Te(e,o){let t=Do.useContext($);(!t||!t.frigade)&&be(`useFlow('${e}') must be used in a child of the Frigade Provider`,"error");let{frigade:r,variables:n}=t!=null?t:{},[,i]=Do.useState(!1),l=Do.useCallback(d=>{r==null||r.getFlow(e).then(()=>{d();});let u=m=>{m.id===e&&setTimeout(()=>{i(f=>!f),d();},0);};return r==null||r.onStateChange(u),()=>{r==null||r.removeStateChangeHandler(u);}},[e,r]),s=xo(l,()=>r==null?void 0:r.getFlowSync(e),()=>r==null?void 0:r.getFlowSync(e));return Do.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:r!=null&&r.hasFailedToLoad()?!1:!s}}function ot(e,{onComplete:o,onDismiss:t}={}){let r=Do.useRef(null);return Do.useEffect(()=>{if(e==null)return;function n(){return A(this,null,function*(){e.isCompleted&&r.current===!1&&(r.current=!0,yield o==null?void 0:o(e));})}return n(),r.current=e==null?void 0:e.isCompleted,()=>{n();}},[e==null?void 0:e.isCompleted]),{handleDismiss:Do.useCallback(n=>A(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Yr(e,o=!0){let{currentModal:t,setCurrentModal:r}=Do.useContext($),n=Do.useCallback(l=>{o&&(e!=null&&e.isVisible)&&r(l);},[o,e==null?void 0:e.isVisible]),i=Do.useCallback(()=>{e!=null&&t===(e==null?void 0:e.id)&&r(null);},[t,e==null?void 0:e.id]);return Do.useEffect(()=>(e!=null&&t===null&&e.isVisible&&n(e.id),i),[t,e==null?void 0:e.id,e==null?void 0:e.isVisible]),Do.useEffect(()=>{e!=null&&(!o||!e.isVisible)&&i();},[e==null?void 0:e.isVisible,o]),e==null?{hasModalCollision:!1}:!o||!e.isVisible?{hasModalCollision:!1}:t===e.id?{hasModalCollision:!1}:t===null?{hasModalCollision:!1}:{hasModalCollision:!0}}function rt(e){return typeof e=="function"&&e.displayName==="Dialog"}function z(u){var m=u,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:l,variables:s}=m,d=g(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var U,Q,ee,q;let{flow:f}=Te(t,{variables:s}),x=f==null?void 0:f.getCurrentStep(),v=(U=x==null?void 0:x.props)!=null?U:{},{otherProps:S}=pe(v),_=a(a(a({},d),(Q=f==null?void 0:f.props)!=null?Q:{}),((ee=f==null?void 0:f.rawData)==null?void 0:ee.flowType)===js.FlowType.CHECKLIST?{}:S),{dismissible:P=!!rt(e),forceMount:F=!1}=_,C=g(_,["dismissible","forceMount"]),{handleDismiss:B}=ot(f,{onComplete:r,onDismiss:n}),{handlePrimary:E,handleSecondary:h}=ge(x,{onPrimary:i,onSecondary:l}),k=(C==null?void 0:C.modal)||rt(e)||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((q=f==null?void 0:f.rawData)==null?void 0:q.flowType),{hasModalCollision:w}=Yr(f,k);function D(j){if(P===!1){j.preventDefault();return}typeof d.onEscapeKeyDown=="function"&&d.onEscapeKeyDown(j),j.defaultPrevented||B(j);}let H=F&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||(!f.isVisible||w)&&!H)return null;(H||!f.isCompleted&&!f.isSkipped)&&(x==null||x.start());let re=e===null?Do.Fragment:e!=null?e:y,J=p(a({},C),{"data-flow-id":f.id});return rt(e)&&(J.onEscapeKeyDown=D),jsxRuntime.jsx(re,p(a({},e===null?{}:J),{children:o({flow:f,handleDismiss:B,handlePrimary:E,handleSecondary:h,parentProps:{dismissible:P,flowId:t,variables:s,containerProps:J},step:x})}))}function en(t){var r=t,{part:e}=r,o=g(r,["part"]);return jsxRuntime.jsx(z,p(a({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:l,parentProps:{dismissible:s},step:d})=>{var x,v,S,P,F,C;let u=(v=(x=d.primaryButton)==null?void 0:x.title)!=null?v:d.primaryButtonTitle,m=(P=(S=d.secondaryButton)==null?void 0:S.title)!=null?P:d.secondaryButtonTitle,{videoProps:f}=pe((F=d.props)!=null?F:{});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:s,handleDismiss:n,subtitle:d.subtitle,title:d.title}),jsxRuntime.jsx(b.Media,a({src:(C=d.videoUri)!=null?C:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},f)),jsxRuntime.jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:m,onClick:l}),jsxRuntime.jsx(b.Primary,{title:u,onClick:i})]})]})}}))}function Co(r){var n=r,{part:e,src:o}=n,t=g(n,["part","src"]);return jsxRuntime.jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function ps(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function So(S){var P=S,{autoPlay:e,controls:o,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s,playsInline:d,poster:u,preload:m,part:f,src:x}=P,v=g(P,["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","part","src"]);let F=ps(x);return F?jsxRuntime.jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",f],src:F},v)):x!=null&&x.endsWith(".mp4")?jsxRuntime.jsx(y,a({as:"video",part:["video",f],src:x,autoPlay:e,controls:o!=null?o:!0,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s!=null?s:e,playsInline:d,poster:u,preload:m},v)):(console.error(`Could not map videoUri ${x} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function Pe(r){var n=r,{src:e,type:o}=n,t=g(n,["src","type"]);return jsxRuntime.jsx(o==="video"?So:Co,a({src:e},t))}var b=Do__namespace.forwardRef((i,n)=>{var l=i,{children:e,flowId:o,part:t}=l,r=g(l,["children","flowId","part"]);var d;if(o!=null)return jsxRuntime.jsx(en,a({flowId:o},r));let s=(d=r.as)!=null?d:R.Column;return jsxRuntime.jsx(s,p(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},r),{ref:n,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(I.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(Be,{height:"20",fill:"currentColor"})}));b.Footer=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return jsxRuntime.jsx(R.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.Header=l=>{var s=l,{dismissible:e,handleDismiss:o,part:t,subtitle:r,title:n}=s,i=g(s,["dismissible","handleDismiss","part","subtitle","title"]);return !e&&(n==null||(n==null?void 0:n.length)===0)&&(r==null||(r==null?void 0:r.length)===0)?null:jsxRuntime.jsxs(R.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsxRuntime.jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:r})]}))};b.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(Pe,a({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};b.Subtitle=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsxRuntime.jsx(T.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsxRuntime.jsx(T.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var wo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function rn(e){let o=Object.fromEntries(wo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(wo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!wo.content.some(i=>i===n)&&!wo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var ms=react.keyframes`
98
+ `;function go(F){var C=F,{align:e,alignOffset:o,autoScroll:t,defaultOpen:r,dismissible:n,flow:i,handleDismiss:l,modal:s,onPrimary:d,onSecondary:u,part:m,side:f,sideOffset:x,spotlight:v,step:S}=C,P=g(C,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var re,J,U,Q,ee;let{handlePrimary:B,handleSecondary:E}=ge(S,{onPrimary:d,onSecondary:u}),{videoProps:h,otherProps:k}=pe(P),w=(J=(re=S.primaryButton)==null?void 0:re.title)!=null?J:S.primaryButtonTitle,D=(Q=(U=S.secondaryButton)==null?void 0:U.title)!=null?Q:S.secondaryButtonTitle,H=!!S.$state.blocked;return jsxRuntime.jsx(Jo,p(a({align:e,alignOffset:o,anchor:S.selector,autoScroll:t,"data-step-id":S.id,defaultOpen:r,modal:s,part:m,side:f,sideOffset:x,spotlight:v},k),{children:jsxRuntime.jsxs(b,{animation:`${$a} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsxRuntime.jsx(b.Media,a({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(ee=S.videoUri)!=null?ee:S.imageUri,transform:"translate3d(0, 0, 1px)",type:S.videoUri?"video":"image"},h)),jsxRuntime.jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:l,subtitle:S.subtitle,title:S.title}),jsxRuntime.jsxs(b.Footer,{children:[i.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(Oe,{current:i.getCurrentStepOrder()+1,marginRight:"auto",total:i.getNumberOfAvailableSteps()}),jsxRuntime.jsx(b.Secondary,{disabled:H,onClick:E,title:D}),jsxRuntime.jsx(b.Primary,{disabled:H,onClick:B,title:w})]})]})}))}function Lr(n){var i=n,{children:e,container:o,flowId:t}=i,r=g(i,["children","container","flowId"]);return jsxRuntime.jsx(wr,{container:o,children:jsxRuntime.jsx(y,p(a({"data-flow-id":t,part:"tour"},r),{children:e}))})}function yo(r){var n=r,{as:e,flowId:o}=n,t=g(n,["as","flowId"]);let{onDismiss:i,onPrimary:l,onSecondary:s}=t;return jsxRuntime.jsx(z,p(a({as:null,flowId:o},t),{children:({flow:d,handleDismiss:u,parentProps:m,step:f})=>{var ee;let Q=m.containerProps,{align:x="after",alignOffset:v=0,autoScroll:S=!1,container:P="body",defaultOpen:F,modal:C,part:B,sequential:E=!0,side:h="bottom",sideOffset:k=0,spotlight:w,zIndex:D=9999}=Q,H=g(Q,["align","alignOffset","autoScroll","container","defaultOpen","modal","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:re}=m,J=a({align:x,alignOffset:v,autoScroll:S,dismissible:re,flow:d,handleDismiss:u,modal:C,onPrimary:l,onSecondary:s,part:B,side:h,sideOffset:k,spotlight:w,step:f,zIndex:D},(ee=f.props)!=null?ee:{});if(E)return jsxRuntime.jsx(Lr,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:D},H),{children:jsxRuntime.jsx(go,a({defaultOpen:F!=null?F:!0},J),f.id)}));let U=Array.from(d.steps.values()).filter(_=>{let{blocked:q,completed:j,skipped:oe,visible:W}=_.$state;return !q&&!j&&!oe&&W}).map(_=>{var te,ce,se,xe;function q(le){return A(this,null,function*(){return (yield i==null?void 0:i(d,le))===!1?(le.preventDefault(),!1):(_.skip(),!0)})}let j=w&&_.id===f.id,oe=(ce=(te=_.props)==null?void 0:te.zIndex)!=null?ce:D,W=a({align:x,alignOffset:v,dismissible:re,flow:d,handleDismiss:q,onPrimary:l,onSecondary:s,part:B,side:h,sideOffset:k,spotlight:w,zIndex:oe},(se=_.props)!=null?se:{});return jsxRuntime.jsx(go,a({css:{"&:has([aria-expanded=true])":{zIndex:Number(oe)+2},".fr-overlay":{zIndex:Number(oe)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(xe=F||j)!=null?xe:!1,step:_},W),`${_.id}-${j}`)});return jsxRuntime.jsx(Lr,p(a({as:e,container:P,flowId:o,part:"tour",zIndex:D},H),{children:U}))}}))}var xo="useSyncExternalStore"in Do__namespace?Do__namespace.useSyncExternalStore:Nr__namespace.useSyncExternalStore;function ho(){let{frigade:e}=Do.useContext($),[,o]=Do.useState(!1),t,r=Do.useCallback(l=>{e==null||e.getCollections().then(()=>{l();});let s=()=>{clearTimeout(t),t=setTimeout(()=>{o(d=>!d),l();},0);};return e==null||e.onStateChange(s),()=>{e==null||e.removeStateChangeHandler(s);}},[]),n=()=>{let l;try{l=e==null?void 0:e.getCollectionsSync();}catch(s){}return l};return {collections:xo(r,n,n)}}function bo(e){var s,d,u,m;let{frigade:o}=Do.useContext($),{collections:t}=ho(),r=t==null?void 0:t.get(e),i=(m=((u=(d=(s=t==null?void 0:t.get(e))==null?void 0:s.flows)==null?void 0:d.filter(f=>f.visible).map(f=>p(a({},f),{flow:o==null?void 0:o.getFlowSync(f.flowId)})))!=null?u:[]).find(({flow:f})=>f.isVisible))==null?void 0:m.flowId,{flow:l}=Te(i);return Do.useEffect(()=>{o==null||o.registerCollection(e);},[e]),{collection:r,currentFlow:l}}function Zo(n){var i=n,{collectionId:e,part:o,variables:t={}}=i,r=g(i,["collectionId","part","variables"]);var u,m,f;let l={ANNOUNCEMENT:Yo,BANNER:Io,CARD:b,CHECKLIST:no,EMBEDDED_TIP:b,FORM:Me,NPS_SURVEY:Ke,SURVEY:Ke,TOUR:yo},{currentFlow:s}=bo(e),d=(m=l[(u=s==null?void 0:s.rawData)==null?void 0:u.flowType])!=null?m:null;return s==null||d==null?null:((f=s==null?void 0:s.rawData)==null?void 0:f.flowType)===js.FlowType.FORM?jsxRuntime.jsx(y,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsxRuntime.jsx(Me,{flowId:s.id,as:V,variables:t},s.id)})):jsxRuntime.jsx(y,p(a({part:["collection",o],"data-collection-id":e},r),{children:jsxRuntime.jsx(d,{flowId:s.id,variables:t},s.id)}))}function _r(){var t,r;let{collections:e}=ho(),o=(r=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(n=>n[1].collectionType==="DEFAULT"))==null?void 0:r[0];return bo(o),o==null?null:jsxRuntime.jsx(Zo,{as:null,collectionId:o})}var $=Do.createContext({apiKey:"",currentModal:null,setCurrentModal:()=>{},navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});var be=(e,o="log")=>{let t=`__frigade_logged_${e}`;globalThis[t]||(globalThis[t]=!0,console[o](e));};function Qo(){let e=Do.useContext($);(!e||!e.frigade)&&be("useFrigade() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e;return {frigade:o,isLoading:!(o!=null&&o.isReady())}}function zr(){let{frigade:e}=Qo();return Do.useEffect(()=>{A(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}var Ur="2.6.7";function Jr(l){var s=l,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=s,i=g(s,["children","css","defaultCollection","navigate","theme"]);let d=n?To(n):{},u=Do.useRef(new Map),m=Do.useRef(),[f,x]=Do.useState(!1),[v,S]=Do.useState(null),P=Do.useMemo(()=>(x(!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:Ur,__platformName:"React"})),[i.userId,i.groupId,i.apiKey]);Do.useEffect(()=>{if(i.__flowStateOverrides){let h=P.getConfig();h.__flowStateOverrides=i.__flowStateOverrides,P.reload(h);}},[i.__flowStateOverrides]);function F(){let h=[...u.current.entries()].map(([k,w])=>[k,w.callback]);P.batchRegister(h),x(!0);}function C(h,k){if(m.current&&clearTimeout(m.current),f){u.current.has(h)?P.getFlow(h).then(w=>k(w.isVisible)):(P.getFlow(h).then(w=>w.register(k)),u.current.set(h,{callback:k}));return}u.current.has(h)||u.current.set(h,{callback:k}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>F(),0);}function B(h){u.current.has(h)&&P.getFlow(h).then(k=>{u.current.delete(h),k==null||k.unregister();});}let E=r!=null?r:(h,k="_self")=>{window.open(h,k);};return Do.useEffect(()=>()=>{P.destroy();},[]),jsxRuntime.jsxs($.Provider,{value:p(a({currentModal:v,setCurrentModal:S,navigate:E},i),{frigade:P,registerComponent:C,unregisterComponent:B,hasInitialized:f,variables:i.variables||{}}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},ko),d),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:O,children:[t&&jsxRuntime.jsx(_r,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx(zr,{})]})}function Te(e,o){let t=Do.useContext($);(!t||!t.frigade)&&be(`useFlow('${e}') must be used in a child of the Frigade Provider`,"warn");let{frigade:r,variables:n}=t!=null?t:{},[,i]=Do.useState(!1),l=Do.useCallback(d=>{r==null||r.getFlow(e).then(()=>{d();});let u=m=>{m.id===e&&setTimeout(()=>{i(f=>!f),d();},0);};return r==null||r.onStateChange(u),()=>{r==null||r.removeStateChangeHandler(u);}},[e,r]),s=xo(l,()=>r==null?void 0:r.getFlowSync(e),()=>r==null?void 0:r.getFlowSync(e));return Do.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:r!=null&&r.hasFailedToLoad()?!1:!s}}function ot(e,{onComplete:o,onDismiss:t}={}){let r=Do.useRef(null);return Do.useEffect(()=>{if(e==null)return;function n(){return A(this,null,function*(){e.isCompleted&&r.current===!1&&(r.current=!0,yield o==null?void 0:o(e));})}return n(),r.current=e==null?void 0:e.isCompleted,()=>{n();}},[e==null?void 0:e.isCompleted]),{handleDismiss:Do.useCallback(n=>A(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Yr(e,o=!0){let{currentModal:t,setCurrentModal:r}=Do.useContext($),n=Do.useCallback(l=>{o&&(e!=null&&e.isVisible)&&r(l);},[o,e==null?void 0:e.isVisible]),i=Do.useCallback(()=>{e!=null&&t===(e==null?void 0:e.id)&&r(null);},[t,e==null?void 0:e.id]);return Do.useEffect(()=>(e!=null&&t===null&&e.isVisible&&n(e.id),i),[t,e==null?void 0:e.id,e==null?void 0:e.isVisible]),Do.useEffect(()=>{e!=null&&(!o||!e.isVisible)&&i();},[e==null?void 0:e.isVisible,o]),e==null?{hasModalCollision:!1}:!o||!e.isVisible?{hasModalCollision:!1}:t===e.id?{hasModalCollision:!1}:t===null?{hasModalCollision:!1}:{hasModalCollision:!0}}function rt(e){return typeof e=="function"&&e.displayName==="Dialog"}function z(u){var m=u,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:l,variables:s}=m,d=g(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var U,Q,ee,q;let{flow:f}=Te(t,{variables:s}),x=f==null?void 0:f.getCurrentStep(),v=(U=x==null?void 0:x.props)!=null?U:{},{otherProps:S}=pe(v),_=a(a(a({},d),(Q=f==null?void 0:f.props)!=null?Q:{}),((ee=f==null?void 0:f.rawData)==null?void 0:ee.flowType)===js.FlowType.CHECKLIST?{}:S),{dismissible:P=!!rt(e),forceMount:F=!1}=_,C=g(_,["dismissible","forceMount"]),{handleDismiss:B}=ot(f,{onComplete:r,onDismiss:n}),{handlePrimary:E,handleSecondary:h}=ge(x,{onPrimary:i,onSecondary:l}),k=(C==null?void 0:C.modal)||rt(e)||[js.FlowType.ANNOUNCEMENT,js.FlowType.TOUR].includes((q=f==null?void 0:f.rawData)==null?void 0:q.flowType),{hasModalCollision:w}=Yr(f,k);function D(j){if(P===!1){j.preventDefault();return}typeof d.onEscapeKeyDown=="function"&&d.onEscapeKeyDown(j),j.defaultPrevented||B(j);}let H=F&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||(!f.isVisible||w)&&!H)return null;(H||!f.isCompleted&&!f.isSkipped)&&(x==null||x.start());let re=e===null?Do.Fragment:e!=null?e:y,J=p(a({},C),{"data-flow-id":f.id});return rt(e)&&(J.onEscapeKeyDown=D),jsxRuntime.jsx(re,p(a({},e===null?{}:J),{children:o({flow:f,handleDismiss:B,handlePrimary:E,handleSecondary:h,parentProps:{dismissible:P,flowId:t,variables:s,containerProps:J},step:x})}))}function en(t){var r=t,{part:e}=r,o=g(r,["part"]);return jsxRuntime.jsx(z,p(a({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:l,parentProps:{dismissible:s},step:d})=>{var x,v,S,P,F,C;let u=(v=(x=d.primaryButton)==null?void 0:x.title)!=null?v:d.primaryButtonTitle,m=(P=(S=d.secondaryButton)==null?void 0:S.title)!=null?P:d.secondaryButtonTitle,{videoProps:f}=pe((F=d.props)!=null?F:{});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:s,handleDismiss:n,subtitle:d.subtitle,title:d.title}),jsxRuntime.jsx(b.Media,a({src:(C=d.videoUri)!=null?C:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},f)),jsxRuntime.jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:m,onClick:l}),jsxRuntime.jsx(b.Primary,{title:u,onClick:i})]})]})}}))}function Co(r){var n=r,{part:e,src:o}=n,t=g(n,["part","src"]);return jsxRuntime.jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function ps(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function So(S){var P=S,{autoPlay:e,controls:o,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s,playsInline:d,poster:u,preload:m,part:f,src:x}=P,v=g(P,["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","part","src"]);let F=ps(x);return F?jsxRuntime.jsx(y,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",f],src:F},v)):x!=null&&x.endsWith(".mp4")?jsxRuntime.jsx(y,a({as:"video",part:["video",f],src:x,autoPlay:e,controls:o!=null?o:!0,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:i,loop:l,muted:s!=null?s:e,playsInline:d,poster:u,preload:m},v)):(console.error(`Could not map videoUri ${x} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function Pe(r){var n=r,{src:e,type:o}=n,t=g(n,["src","type"]);return jsxRuntime.jsx(o==="video"?So:Co,a({src:e},t))}var b=Do__namespace.forwardRef((i,n)=>{var l=i,{children:e,flowId:o,part:t}=l,r=g(l,["children","flowId","part"]);var d;if(o!=null)return jsxRuntime.jsx(en,a({flowId:o},r));let s=(d=r.as)!=null?d:R.Column;return jsxRuntime.jsx(s,p(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},r),{ref:n,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(I.Plain,p(a({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(Be,{height:"20",fill:"currentColor"})}));b.Footer=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return jsxRuntime.jsx(R.Row,p(a({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.Header=l=>{var s=l,{dismissible:e,handleDismiss:o,part:t,subtitle:r,title:n}=s,i=g(s,["dismissible","handleDismiss","part","subtitle","title"]);return !e&&(n==null||(n==null?void 0:n.length)===0)&&(r==null||(r==null?void 0:r.length)===0)?null:jsxRuntime.jsxs(R.Row,p(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},i),{children:[jsxRuntime.jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:r})]}))};b.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(Pe,a({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};b.Subtitle=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsxRuntime.jsx(T.Body2,p(a({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsxRuntime.jsx(T.H4,p(a({display:"block",part:["title",o]},t),{children:e}))};var wo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function rn(e){let o=Object.fromEntries(wo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(wo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!wo.content.some(i=>i===n)&&!wo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var ms=react.keyframes`
99
99
  from {
100
100
  opacity: 0;
101
101
  }
@@ -115,7 +115,7 @@ var dt=Object.defineProperty,un=Object.defineProperties;var mn=Object.getOwnProp
115
115
  to {
116
116
  opacity: 1;
117
117
  }
118
- `;function dn(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Se(u){var m=u,{anchor:e,children:o,className:t,defaultOpen:r=!0,open:n,part:i,spotlight:l=!1,style:s={}}=m,d=g(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:f,rect:x,ref:v}=fo(),{node:S,rect:P,ref:F}=fo(),{contentProps:C,otherProps:B,rootProps:E}=ln(d,x),[h,k]=Do.useState(r),[w,D]=Do.useState(C.align),[H,re]=Do.useState(C.side),[J,U]=Do.useState(0),[Q,ee]=Do.useState(0);function _(){return n!=null?(console.log("OVERRIDE: ",n),n):(console.log("INTERNAL: ",h),h)}if(f!==null){let W=f.getAttribute("data-align"),te=f.getAttribute("data-side");w!==W&&D(W),H!==te&&re(te);}let q=Do.useRef(null);if(Do.useEffect(()=>{let W=document.querySelector(e);W!=null?(F(W),q.current=W):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),Do.useEffect(()=>{function W(ce){if(ce.matches(e))return dn(ce)?ce:null;let se=ce.querySelectorAll(e);return se.length>0&&dn(se[0])?se[0]:null}let te=new MutationObserver(ce=>{for(let se of ce)if(se.type==="childList"){for(let xe of se.addedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let le=W(xe);if(le!=null){F(le),q.current=le,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",le);break}}for(let xe of se.removedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let le=W(xe);if(le!=null){F(null),q.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",le);break}}}});return te.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>te.disconnect()},[]),Do.useEffect(()=>{let{scrollX:W,scrollY:te}=window;U(P.left+W),ee(P.top+te);},[P.left,P.top]),S==null)return null;let j="0";typeof window!="undefined"&&(j=window.getComputedStyle(S).borderRadius);let oe=sn({props:d,alignAttr:w,sideAttr:H});return jsxRuntime.jsxs(de__namespace.Root,p(a({defaultOpen:!0},E),{children:[jsxRuntime.jsx(de__namespace.Anchor,{virtualRef:q}),jsxRuntime.jsx(de__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l&&jsxRuntime.jsx(y,a({animation:`${pn} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:j,height:P.height,left:J,top:Q,width:P.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsxRuntime.jsx(de__namespace.Content,p(a({},C),{ref:v,children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[_()&&jsxRuntime.jsx(b,p(a({animation:`${pn} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",i],style:s},B),{children:o})),jsxRuntime.jsx(an,{onClick:()=>{k(()=>(typeof E.onOpenChange=="function"&&E.onOpenChange(!_()),!_()));},style:oe})]})}),h)]})})]}))}Se.Close=e=>jsxRuntime.jsx(de__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"})}))});Se.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null?null:jsxRuntime.jsx(Pe,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))};Se.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};Se.Progress=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsxRuntime.jsx(T.Body2,p(a({part:"progress"},o),{children:e}))};Se.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};Se.Subtitle=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsxRuntime.jsx(T.Body2,p(a({part:"subtitle"},o),{children:e}))};Se.Title=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsxRuntime.jsx(T.H4,p(a({part:"title"},o),{children:e}))};function vs(){let e=Do.useContext($);(!e||!e.frigade)&&be("useUser() must be used in a child of the Frigade Provider","error");let{userId:o,frigade:t}=e!=null?e:{};function r(i){return A(this,null,function*(){yield t.identify(o,i);})}function n(i,l){return A(this,null,function*(){yield t.track(i,l);})}return {userId:o,addProperties:r,track:n}}function Rs(){var i;let e=Do.useContext($);(!e||!e.frigade)&&be("useGroup() must be used in a child of the Frigade Provider","error");let{frigade:o}=e!=null?e:{};function t(l){return A(this,null,function*(){if(!o.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield o.group(o.config.groupId,l);})}function r(l,s){return A(this,null,function*(){yield o.track(l,s);})}function n(l,s){return A(this,null,function*(){yield o.group(l,s);})}return {groupId:(i=o==null?void 0:o.config)==null?void 0:i.groupId,setGroupId:n,addProperties:t,track:r}}
118
+ `;function dn(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Se(u){var m=u,{anchor:e,children:o,className:t,defaultOpen:r=!0,open:n,part:i,spotlight:l=!1,style:s={}}=m,d=g(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:f,rect:x,ref:v}=fo(),{node:S,rect:P,ref:F}=fo(),{contentProps:C,otherProps:B,rootProps:E}=ln(d,x),[h,k]=Do.useState(r),[w,D]=Do.useState(C.align),[H,re]=Do.useState(C.side),[J,U]=Do.useState(0),[Q,ee]=Do.useState(0);function _(){return n!=null?(console.log("OVERRIDE: ",n),n):(console.log("INTERNAL: ",h),h)}if(f!==null){let W=f.getAttribute("data-align"),te=f.getAttribute("data-side");w!==W&&D(W),H!==te&&re(te);}let q=Do.useRef(null);if(Do.useEffect(()=>{let W=document.querySelector(e);W!=null?(F(W),q.current=W):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),Do.useEffect(()=>{function W(ce){if(ce.matches(e))return dn(ce)?ce:null;let se=ce.querySelectorAll(e);return se.length>0&&dn(se[0])?se[0]:null}let te=new MutationObserver(ce=>{for(let se of ce)if(se.type==="childList"){for(let xe of se.addedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let le=W(xe);if(le!=null){F(le),q.current=le,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",le);break}}for(let xe of se.removedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let le=W(xe);if(le!=null){F(null),q.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",le);break}}}});return te.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>te.disconnect()},[]),Do.useEffect(()=>{let{scrollX:W,scrollY:te}=window;U(P.left+W),ee(P.top+te);},[P.left,P.top]),S==null)return null;let j="0";typeof window!="undefined"&&(j=window.getComputedStyle(S).borderRadius);let oe=sn({props:d,alignAttr:w,sideAttr:H});return jsxRuntime.jsxs(de__namespace.Root,p(a({defaultOpen:!0},E),{children:[jsxRuntime.jsx(de__namespace.Anchor,{virtualRef:q}),jsxRuntime.jsx(de__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l&&jsxRuntime.jsx(y,a({animation:`${pn} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:j,height:P.height,left:J,top:Q,width:P.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsxRuntime.jsx(de__namespace.Content,p(a({},C),{ref:v,children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[_()&&jsxRuntime.jsx(b,p(a({animation:`${pn} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",i],style:s},B),{children:o})),jsxRuntime.jsx(an,{onClick:()=>{k(()=>(typeof E.onOpenChange=="function"&&E.onOpenChange(!_()),!_()));},style:oe})]})}),h)]})})]}))}Se.Close=e=>jsxRuntime.jsx(de__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"})}))});Se.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null?null:jsxRuntime.jsx(Pe,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))};Se.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};Se.Progress=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsxRuntime.jsx(T.Body2,p(a({part:"progress"},o),{children:e}))};Se.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};Se.Subtitle=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsxRuntime.jsx(T.Body2,p(a({part:"subtitle"},o),{children:e}))};Se.Title=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsxRuntime.jsx(T.H4,p(a({part:"title"},o),{children:e}))};function vs(){let e=Do.useContext($);(!e||!e.frigade)&&be("useUser() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=o==null?void 0:o.config.userId;function r(i){return A(this,null,function*(){yield o.identify(t,i);})}function n(i,l){return A(this,null,function*(){yield o.track(i,l);})}return {userId:t,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}function Rs(){var l;let e=Do.useContext($);(!e||!e.frigade)&&be("useGroup() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=(l=o==null?void 0:o.getConfig())==null?void 0:l.groupId;function r(s){return A(this,null,function*(){if(!o.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield o.group(o.config.groupId,s);})}function n(s,d){return A(this,null,function*(){yield o.track(s,d);})}function i(s,d){return A(this,null,function*(){yield o.group(s,d);})}return {groupId:t,setGroupId:i,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}
119
119
 
120
120
  exports.FrigadeJS = js__namespace;
121
121
  exports.Announcement = Yo;