userflow.js-self-hosted 0.1.1021828 → 0.1.1021934
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/SitePage.js +1 -1
- package/hash.txt +1 -1
- package/package.json +1 -1
- package/roots.js +1 -1
- package/userflow.js +1 -1
- package/vendor.core-js.js +1 -1
package/SitePage.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{R as e,r as h}from"./vendor.react.js";import{U as W,u as A,i as L}from"./client-context.js";import{r as Y}from"./vendor.react-dom.js";import{B as O,L as _}from"./vendor.react-router-dom.js";import{A as z,u as T,S as k,a as G,b as Q}from"./AnnouncementEngagement.js";import{D as I,u as S,a as $,g as q}from"./stylesheets.js";import{i as J}from"./iframe-reset.styl.js";import{S as X,u as E,R as N}from"./TreeDoc.js";import{g as C}from"./flow-condition-types.js";import{f as Z,a as ee,b as D}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{f as te}from"./vendor.fortawesome.pro-solid-svg-icons.js";import{d as oe}from"./userflow.js";import{P as ne}from"./Popover.js";import{o as se}from"./vendor.obj-str.js";import{m as re}from"./vendor.memoize-one.js";import"./vendor.core-js.js";import{u as ie}from"./react-hooks.js";import{S as le,a as H,u as P,b as R,d as B}from"./vendor.react-router.js";import{u as V}from"./vendor.react-i18next.js";import"./vendor.object-assign.js";import"./vendor.i18next.js";import"./vendor.babel.runtime.js";import"./vendor.scheduler.js";import"./vendor.history.js";import"./vendor.resolve-pathname.js";import"./vendor.value-equal.js";import"./vendor.tiny-invariant.js";import"./vendor.prop-types.js";import"./use-confetti.js";import"./vendor.canvas-confetti.js";import"./roots.js";import"./vendor.date-fns.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.lodash.js";import"./vendor.mini-create-react-context.js";import"./vendor.path-to-regexp.js";import"./vendor.react-is.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="e6e8542f-62a2-40c0-89c1-dedec3c53ffe",o._sentryDebugIdIdentifier="sentry-dbid-e6e8542f-62a2-40c0-89c1-dedec3c53ffe")}catch{}})();const ae=new URL("popover.css",import.meta.url).href,ce=new URL("site.css",import.meta.url).href;class F extends e.PureComponent{constructor(){super(...arguments),this.rootRef=e.createRef(),this.isScrollingIntoView=!1,this.state={highlightedIdx:this.props.disableAutoHighlight?-1:0},this.onKeyDown=t=>{const{highlightedIdx:n}=this.state,{items:r}=this.props,s=()=>{t.stopPropagation(),t.preventDefault()};switch(t.key){case"ArrowUp":s(),n>0?this.setHighlighted(n-1):n===-1&&this.setHighlighted(r.length-1);break;case"ArrowDown":s(),n<r.length-1?this.setHighlighted(n+1):n===-1&&this.setHighlighted(0);break;case"Enter":s(),this.selectItem(r[n]);break}},this.selectItem=t=>{this.props.onSelect(t)},this.onItemHover=t=>{this.isScrollingIntoView||(this.setState({highlightedIdx:t}),this.props.onItemHighlighted?.(this.props.items[t]))},this.onMouseLeave=()=>{const{clearHoverOnMouseLeave:t,selectedItem:n,items:r}=this.props;if(t)if(n){const s=r.findIndex(l=>l===n);this.setState({highlightedIdx:s})}else this.setState({highlightedIdx:-1})},this.memoizedStyle=re(t=>t==null?{}:{maxHeight:t,overflowY:"auto"})}componentDidMount(){this.props.autoFocus&&this.rootRef.current.focus({preventScroll:!0}),this.props.forwardedRef&&this.rootRef.current&&(typeof this.props.forwardedRef=="function"?this.props.forwardedRef(this.rootRef.current):this.props.forwardedRef.current=this.rootRef.current)}render(){const t=this.state,{selectedItem:n,clearHoverOnMouseLeave:r,items:s,getItemGroup:l}=this.props;let a=null;const m=s.reduce((i,c,f)=>{const u=l?l(c):null;return u&&u!==a&&i.push(e.createElement("div",{key:`group-${u}-${f}`,className:"key-nav-list__group-header"},u)),a=u,i.push(e.createElement(me,{key:f,item:c,idx:f,className:se({"key-nav-list__item":!0,"key-nav-list__item--highlighted":f===t.highlightedIdx,"key-nav-list__item--selected":c===n}),renderContent:this.props.children,onClick:this.selectItem,onHover:this.onItemHover})),i},[]);return e.createElement("div",{ref:this.rootRef,className:"key-nav-list",style:this.memoizedStyle(this.props.maxHeight),onKeyDown:this.onKeyDown,onMouseLeave:r?this.onMouseLeave:void 0,tabIndex:0},m)}scrollHighlightedItemIntoView(){const t=this.rootRef.current,n=t.querySelector(".key-nav-list__item--highlighted");if(n){this.isScrollingIntoView=!0,window.clearTimeout(this.isScrollingIntoViewTimeout),this.isScrollingIntoViewTimeout=window.setTimeout(()=>this.isScrollingIntoView=!1,250);const r=t.getBoundingClientRect(),s=n.getBoundingClientRect();s.top<r.top?t.scrollTop+=s.top-r.top:s.bottom>r.bottom&&(t.scrollTop+=s.bottom-r.bottom)}}setHighlighted(t){this.setState({highlightedIdx:t},this.scrollHighlightedItemIntoView),this.props.onItemHighlighted?.(this.props.items[t])}}class me extends e.PureComponent{constructor(){super(...arguments),this.onClick=()=>this.props.onClick(this.props.item),this.onHover=()=>this.props.onHover(this.props.idx)}render(){const{props:t}=this;return e.createElement("div",{className:t.className,onClick:this.onClick,onMouseMove:this.onHover},t.renderContent(t.item,t.idx))}}e.forwardRef((o,t)=>e.createElement(F,{...o,forwardedRef:t}));function ue({testid:o,buttonText:t,value:n,onChange:r,options:s,renderOption:l,disabled:a,buttonStyle:m,htmlAttributes:i,comparator:c,showCheckIcon:f=!0}){const u=h.useRef(null),[p,g]=h.useState(!1),w=()=>{g(!1),u.current&&u.current.focus()},v=({key:d})=>{if(d.length===1){d=d.toLowerCase();for(const y of s){const x=l(y);if(typeof x=="string"&&x.toLowerCase().startsWith(d)){r(y);return}}}};return e.createElement(e.Fragment,null,e.createElement("button",{ref:u,"data-testid":o,type:"button",className:`btn btn-dynamic-icon ${m||"btn--plain-blue"} btn--sm ${p&&!a?"btn--popover-open":""}`,onClick:()=>g(!p),disabled:a,onKeyDown:v,...i},t||l(n),e.createElement(I,{icon:Z})),p&&!a&&u.current&&e.createElement(ne,{target:u.current,matchMinWidth:!0,onDismiss:w},e.createElement(F,{items:s,onSelect:d=>{w(),r(d)},autoFocus:!0},d=>e.createElement("div",{className:"d-flex"},f&&e.createElement("div",{className:"mr-8",style:(c?c(d,n):d===n)?void 0:{visibility:"hidden"}},e.createElement(I,{icon:ee})),l(d)))))}function de(o){const t=o?new Date(o):new Date;let n=new Intl.DateTimeFormat(L.language,{weekday:"long",day:"numeric",month:"short",year:t.getFullYear()===new Date().getFullYear()?void 0:"numeric"}).format(t);return n.substring(0,1).toUpperCase()+n.substring(1)}class ot{constructor(t,n){this.client=t,this.selector=n}mount(){if(this.container)throw new Error("SiteRoute has already been mounted");const t=document.querySelector(this.selector);if(!t)throw new Error(`SitePage: No element found for selector ${this.selector}`);this.container=t,Y.render(e.createElement(O,null,e.createElement(W.Provider,{value:this.client},e.createElement(fe,null))),this.container)}}const fe=()=>{const o=A();S(window,J),S(window,ae);const{loaded:t}=S(window,ce),[n,r]=h.useState(null),[s,l]=h.useState(void 0),a=n?.locale.standardLocaleId||n?.version.theme.languageId;return h.useEffect(()=>{a&&L.changeLanguage(a)},[a]),h.useEffect(()=>{const m=i=>{oe("Received site session",i),o.featureFlagEnabled("cff_site")!==!1&&r(i)};return o.on("private:siteSession",m),()=>{o.off("private:siteSession",m)}},[o]),!n||!t?null:e.createElement(X.Provider,{value:n},e.createElement(z,{key:n.locale.standardLocaleId},e.createElement(le,null,e.createElement(H,{exact:!0,path:"/:locale/:announcementId"},e.createElement(M,null,e.createElement(pe,{key:n.locale.standardLocaleId}))),e.createElement(H,{path:"/:locale"},e.createElement(M,null,e.createElement(he,{key:n.locale.standardLocaleId,listScrollTop:s,onSaveScrollPosition:()=>{l(window.scrollY)}}))))))},M=({children:o})=>{const t=E(),n=$(t.version.theme),r=t.version.theme.siteLogoAsset?.assetUrl,s=t.version.site,l=b();if(!s)return null;const{headerText:a,headerDescription:m,logoUrl:i}=s;return e.createElement("div",{style:q(n),className:"userflow-site__announcements"},l?e.createElement("div",{className:"text-bolder userflow-site-preview-banner"},"PREVIEW"):null,e.createElement(we,{headerText:a,headerDescription:m,companyLogoSrc:r,logoUrl:i,localeDropdown:e.createElement(ge,null)}),o)},he=({listScrollTop:o,onSaveScrollPosition:t})=>{const{t:n}=V(),r=E(),{announcements:s,loading:l,loadingMore:a,error:m,truncated:i,loadMore:c,submitReaction:f,submitComment:u}=T(),p=h.useRef(!1);return h.useLayoutEffect(()=>{o!=null&&window.scrollTo(0,o)},[o]),h.useEffect(()=>{if(l||a||i)return;const g=()=>{if(p.current)return;const w=window.scrollY,v=window.innerHeight;document.documentElement.scrollHeight-(w+v)<=400&&(p.current=!0,c().finally(()=>{p.current=!1}))};return window.addEventListener("scroll",g),()=>window.removeEventListener("scroll",g)},[i,l,a,c]),m?e.createElement("div",{className:"userflow-site__announcement-content"},"Failed in loading announcements"):l?e.createElement("div",{className:"userflow-site__announcement-content"},e.createElement(k,{center:!0,fadeIn:!0})):e.createElement("div",{className:"userflow-site__announcement-content"},s.length>0?e.createElement("div",{className:"userflow-site__announcement-list"},s.map(g=>e.createElement(U,{expanded:!1,key:g.id,announcement:g,enableTitleLinks:r.version.site?.enableTitleLinks,onReactionChange:f,onCommentSubmit:u,onSaveScrollPosition:t})),a?e.createElement(k,{center:!0,fadeIn:!0}):null):null,s.length===0?e.createElement("h3",{className:"userflow-site-empty-state text-extra-bold"},L.exists("resource_center.no_announcements",{fallbackLng:[]})?n("resource_center.no_announcements"):n("resource_center.no_results_found")):null)},U=({announcement:o,expanded:t=!1,enableTitleLinks:n,onReactionChange:r,onCommentSubmit:s,onSaveScrollPosition:l})=>{const a=P(),m=j(),i=A(),c=E(),f=$(c.version.theme),u=b(),p=h.useRef(null),g=n&&!!m,w=ie(p,{once:!0,rootMargin:"100px",disabled:o.seen===!0}),v=K(`/${m}/${u?o.id:o.permalink}`);h.useEffect(()=>{w&&o.seen===!1&&i.send({kind:"MarkAnnouncementSeen",announcementId:o.id,versionId:o.versionId},{batch:!0})},[w,o,i]);const d=()=>{m&&(l?.(),a.push(v))};return e.createElement("div",{ref:p,className:"userflow-site__card"},e.createElement("div",null,e.createElement("span",{className:"text-small text-secondary"},de(o.time)),e.createElement("div",null,g?e.createElement(_,{to:v,className:"h2-like text-extra-bold"},o.title):e.createElement("h2",{className:"h2-like text-extra-bold"},o.title))),e.createElement(N,{doc:o.content,buttons:o.buttons,lookupAttribute:C(o.data)}),o.moreEnabled&&t?e.createElement(N,{doc:o.moreContent,buttons:o.moreButtons,lookupAttribute:C(o.data)}):null,e.createElement(G,{announcement:t?{...o,moreEnabled:!1}:o,confettiColors:f.confettiColors,onReactionChange:r,onCommentSubmit:s,onMoreClick:t?void 0:d},!t&&o.moreEnabled&&e.createElement("div",{className:"userflowjs-announcement-more--modal"},e.createElement("button",{className:"userflowjs-tertiary-button",onClick:d},o.moreButtonText||"Read more",e.createElement("span",{className:"userflowjs-rtl-mirrored userflowjs-tertiary-button__icon"},e.createElement(I,{icon:te}))))))},pe=()=>{const o=E(),{announcementId:t}=R(),{submitReaction:n,submitComment:r}=T(),s=b(),l=j(),a=K(`/${l}`),{t:m}=V(),{loading:i,data:c,error:f}=Q({message:{kind:"GetAnnouncement",announcementId:t,permalink:!s},skip:!t});return i?e.createElement(k,{center:!0,fadeIn:!0}):f||!c?.announcement?e.createElement("div",{className:"userflow-site__announcement-content"},e.createElement("div",{className:"d-flex gap-16 flex-column mt-24"},e.createElement(_,{to:a,className:"userflow-site-link-button userflow-site-home-back-button"},e.createElement(I,{icon:D}),o.version.site?.homeButtonText||"All Announcements"),e.createElement("div",{className:"userflow-site__card userflow-site__card--not-found"},e.createElement("h3",{className:"userflow-site__announcement-not-found text-extra-bold"},m("site.page_not_found"))))):e.createElement("div",{className:"userflow-site__announcement-content"},c?.announcement&&e.createElement("div",{className:"d-flex gap-16 flex-column mt-24"},e.createElement(_,{to:a,className:"userflow-site-link-button userflow-site-home-back-button"},e.createElement(I,{icon:D}),o.version.site?.homeButtonText||"All Announcements"),e.createElement(U,{expanded:!0,announcement:c.announcement,onReactionChange:n,onCommentSubmit:r})))},ge=()=>{const o=P(),t=E(),n=b(),r=B(),{announcementId:s}=R();if(t?.kind!=="site"||n)return null;const l=t.locales.find(i=>i.code===t.locale.standardLocaleId);if(t.locales.length===1&&t.locales[0].code===t.locale.standardLocaleId||t.locales.length===0||!l)return null;const m=i=>{const c=s?`/${i.code}/${s}`:`/${i.code}`;o.push(n?`${c}${r.search}`:c)};return e.createElement(ue,{buttonStyle:"userflow-site-locale-dropdown",value:l,options:t.locales,onChange:m,comparator:(i,c)=>i.code===c.code,renderOption:i=>i.name})},we=({companyLogoSrc:o,headerText:t,headerDescription:n,logoUrl:r,localeDropdown:s})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"userflow-site-header-wrapper"},e.createElement("div",{className:"d-flex justify-space-between align-items-center userflow-site-logo-wrapper"},e.createElement("div",null,o?e.createElement(e.Fragment,null,r?e.createElement("a",{href:r,target:"_blank",rel:"noopener noreferrer"},e.createElement("img",{src:o,className:"userflow-site-logo"})):e.createElement("img",{src:o,className:"userflow-site-logo"})):null),s),e.createElement("div",{className:"userflow-site__announcements-heading"},e.createElement("h1",{className:"text-bold"},t),e.createElement("p",null,n)))),b=()=>E().draftMode,j=()=>{const o=E(),t=b(),{locale:n}=R();return t?n:n??o.locale.standardLocaleId},K=o=>{const t=b(),n=B();return t?`${o}${n.search}`:o};export{fe as SiteAnnouncementsWrapper,M as SiteContentWrapper,we as SiteHeader,U as SiteListItem,ot as SitePage};
|
|
1
|
+
import{R as e,r as h}from"./vendor.react.js";import{U as W,u as A,i as L}from"./client-context.js";import{r as Y}from"./vendor.react-dom.js";import{B as O,L as k}from"./vendor.react-router-dom.js";import{A as z,u as T,S as _,a as G,b as Q}from"./AnnouncementEngagement.js";import{D as I,u as S,a as $,g as q}from"./stylesheets.js";import{i as J}from"./iframe-reset.styl.js";import{S as X,u as E,R as N}from"./TreeDoc.js";import{g as C}from"./flow-condition-types.js";import{f as Z,a as ee,b as D}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{f as te}from"./vendor.fortawesome.pro-solid-svg-icons.js";import{d as oe}from"./userflow.js";import{P as ne}from"./Popover.js";import{o as se}from"./vendor.obj-str.js";import{m as re}from"./vendor.memoize-one.js";import"./vendor.core-js.js";import{u as ie}from"./react-hooks.js";import{S as le,a as H,u as P,b as R,d as B}from"./vendor.react-router.js";import{u as V}from"./vendor.react-i18next.js";import"./vendor.object-assign.js";import"./vendor.i18next.js";import"./vendor.babel.runtime.js";import"./vendor.scheduler.js";import"./vendor.history.js";import"./vendor.resolve-pathname.js";import"./vendor.value-equal.js";import"./vendor.tiny-invariant.js";import"./vendor.prop-types.js";import"./use-confetti.js";import"./vendor.canvas-confetti.js";import"./roots.js";import"./vendor.date-fns.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.lodash.js";import"./vendor.mini-create-react-context.js";import"./vendor.path-to-regexp.js";import"./vendor.react-is.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="82beb6bd-441a-4617-9868-7f1ded3448fb",o._sentryDebugIdIdentifier="sentry-dbid-82beb6bd-441a-4617-9868-7f1ded3448fb")}catch{}})();const ae=new URL("popover.css",import.meta.url).href,ce=new URL("site.css",import.meta.url).href;class F extends e.PureComponent{constructor(){super(...arguments),this.rootRef=e.createRef(),this.isScrollingIntoView=!1,this.state={highlightedIdx:this.props.disableAutoHighlight?-1:0},this.onKeyDown=t=>{const{highlightedIdx:n}=this.state,{items:r}=this.props,s=()=>{t.stopPropagation(),t.preventDefault()};switch(t.key){case"ArrowUp":s(),n>0?this.setHighlighted(n-1):n===-1&&this.setHighlighted(r.length-1);break;case"ArrowDown":s(),n<r.length-1?this.setHighlighted(n+1):n===-1&&this.setHighlighted(0);break;case"Enter":s(),this.selectItem(r[n]);break}},this.selectItem=t=>{this.props.onSelect(t)},this.onItemHover=t=>{this.isScrollingIntoView||(this.setState({highlightedIdx:t}),this.props.onItemHighlighted?.(this.props.items[t]))},this.onMouseLeave=()=>{const{clearHoverOnMouseLeave:t,selectedItem:n,items:r}=this.props;if(t)if(n){const s=r.findIndex(l=>l===n);this.setState({highlightedIdx:s})}else this.setState({highlightedIdx:-1})},this.memoizedStyle=re(t=>t==null?{}:{maxHeight:t,overflowY:"auto"})}componentDidMount(){this.props.autoFocus&&this.rootRef.current.focus({preventScroll:!0}),this.props.forwardedRef&&this.rootRef.current&&(typeof this.props.forwardedRef=="function"?this.props.forwardedRef(this.rootRef.current):this.props.forwardedRef.current=this.rootRef.current)}render(){const t=this.state,{selectedItem:n,clearHoverOnMouseLeave:r,items:s,getItemGroup:l}=this.props;let a=null;const m=s.reduce((i,c,f)=>{const u=l?l(c):null;return u&&u!==a&&i.push(e.createElement("div",{key:`group-${u}-${f}`,className:"key-nav-list__group-header"},u)),a=u,i.push(e.createElement(me,{key:f,item:c,idx:f,className:se({"key-nav-list__item":!0,"key-nav-list__item--highlighted":f===t.highlightedIdx,"key-nav-list__item--selected":c===n}),renderContent:this.props.children,onClick:this.selectItem,onHover:this.onItemHover})),i},[]);return e.createElement("div",{ref:this.rootRef,className:"key-nav-list",style:this.memoizedStyle(this.props.maxHeight),onKeyDown:this.onKeyDown,onMouseLeave:r?this.onMouseLeave:void 0,tabIndex:0},m)}scrollHighlightedItemIntoView(){const t=this.rootRef.current,n=t.querySelector(".key-nav-list__item--highlighted");if(n){this.isScrollingIntoView=!0,window.clearTimeout(this.isScrollingIntoViewTimeout),this.isScrollingIntoViewTimeout=window.setTimeout(()=>this.isScrollingIntoView=!1,250);const r=t.getBoundingClientRect(),s=n.getBoundingClientRect();s.top<r.top?t.scrollTop+=s.top-r.top:s.bottom>r.bottom&&(t.scrollTop+=s.bottom-r.bottom)}}setHighlighted(t){this.setState({highlightedIdx:t},this.scrollHighlightedItemIntoView),this.props.onItemHighlighted?.(this.props.items[t])}}class me extends e.PureComponent{constructor(){super(...arguments),this.onClick=()=>this.props.onClick(this.props.item),this.onHover=()=>this.props.onHover(this.props.idx)}render(){const{props:t}=this;return e.createElement("div",{className:t.className,onClick:this.onClick,onMouseMove:this.onHover},t.renderContent(t.item,t.idx))}}e.forwardRef((o,t)=>e.createElement(F,{...o,forwardedRef:t}));function ue({testid:o,buttonText:t,value:n,onChange:r,options:s,renderOption:l,disabled:a,buttonStyle:m,htmlAttributes:i,comparator:c,showCheckIcon:f=!0}){const u=h.useRef(null),[p,g]=h.useState(!1),w=()=>{g(!1),u.current&&u.current.focus()},v=({key:d})=>{if(d.length===1){d=d.toLowerCase();for(const y of s){const x=l(y);if(typeof x=="string"&&x.toLowerCase().startsWith(d)){r(y);return}}}};return e.createElement(e.Fragment,null,e.createElement("button",{ref:u,"data-testid":o,type:"button",className:`btn btn-dynamic-icon ${m||"btn--plain-blue"} btn--sm ${p&&!a?"btn--popover-open":""}`,onClick:()=>g(!p),disabled:a,onKeyDown:v,...i},t||l(n),e.createElement(I,{icon:Z})),p&&!a&&u.current&&e.createElement(ne,{target:u.current,matchMinWidth:!0,onDismiss:w},e.createElement(F,{items:s,onSelect:d=>{w(),r(d)},autoFocus:!0},d=>e.createElement("div",{className:"d-flex"},f&&e.createElement("div",{className:"mr-8",style:(c?c(d,n):d===n)?void 0:{visibility:"hidden"}},e.createElement(I,{icon:ee})),l(d)))))}function de(o){const t=o?new Date(o):new Date;let n=new Intl.DateTimeFormat(L.language,{weekday:"long",day:"numeric",month:"short",year:t.getFullYear()===new Date().getFullYear()?void 0:"numeric"}).format(t);return n.substring(0,1).toUpperCase()+n.substring(1)}class ot{constructor(t,n){this.client=t,this.selector=n}mount(){if(this.container)throw new Error("SiteRoute has already been mounted");const t=document.querySelector(this.selector);if(!t)throw new Error(`SitePage: No element found for selector ${this.selector}`);this.container=t,Y.render(e.createElement(O,null,e.createElement(W.Provider,{value:this.client},e.createElement(fe,null))),this.container)}}const fe=()=>{const o=A();S(window,J),S(window,ae);const{loaded:t}=S(window,ce),[n,r]=h.useState(null),[s,l]=h.useState(void 0),a=n?.locale.standardLocaleId||n?.version.theme.languageId;return h.useEffect(()=>{a&&L.changeLanguage(a)},[a]),h.useEffect(()=>{const m=i=>{oe("Received site session",i),r(i)};return o.on("private:siteSession",m),()=>{o.off("private:siteSession",m)}},[o]),!n||!t?null:e.createElement(X.Provider,{value:n},e.createElement(z,{key:n.locale.standardLocaleId},e.createElement(le,null,e.createElement(H,{exact:!0,path:"/:locale/:announcementId"},e.createElement(M,null,e.createElement(pe,{key:n.locale.standardLocaleId}))),e.createElement(H,{path:"/:locale"},e.createElement(M,null,e.createElement(he,{key:n.locale.standardLocaleId,listScrollTop:s,onSaveScrollPosition:()=>{l(window.scrollY)}}))))))},M=({children:o})=>{const t=E(),n=$(t.version.theme),r=t.version.theme.siteLogoAsset?.assetUrl,s=t.version.site,l=b();if(!s)return null;const{headerText:a,headerDescription:m,logoUrl:i}=s;return e.createElement("div",{style:q(n),className:"userflow-site__announcements"},l?e.createElement("div",{className:"text-bolder userflow-site-preview-banner"},"PREVIEW"):null,e.createElement(we,{headerText:a,headerDescription:m,companyLogoSrc:r,logoUrl:i,localeDropdown:e.createElement(ge,null)}),o)},he=({listScrollTop:o,onSaveScrollPosition:t})=>{const{t:n}=V(),r=E(),{announcements:s,loading:l,loadingMore:a,error:m,truncated:i,loadMore:c,submitReaction:f,submitComment:u}=T(),p=h.useRef(!1);return h.useLayoutEffect(()=>{o!=null&&window.scrollTo(0,o)},[o]),h.useEffect(()=>{if(l||a||i)return;const g=()=>{if(p.current)return;const w=window.scrollY,v=window.innerHeight;document.documentElement.scrollHeight-(w+v)<=400&&(p.current=!0,c().finally(()=>{p.current=!1}))};return window.addEventListener("scroll",g),()=>window.removeEventListener("scroll",g)},[i,l,a,c]),m?e.createElement("div",{className:"userflow-site__announcement-content"},"Failed in loading announcements"):l?e.createElement("div",{className:"userflow-site__announcement-content"},e.createElement(_,{center:!0,fadeIn:!0})):e.createElement("div",{className:"userflow-site__announcement-content"},s.length>0?e.createElement("div",{className:"userflow-site__announcement-list"},s.map(g=>e.createElement(U,{expanded:!1,key:g.id,announcement:g,enableTitleLinks:r.version.site?.enableTitleLinks,onReactionChange:f,onCommentSubmit:u,onSaveScrollPosition:t})),a?e.createElement(_,{center:!0,fadeIn:!0}):null):null,s.length===0?e.createElement("h3",{className:"userflow-site-empty-state text-extra-bold"},L.exists("resource_center.no_announcements",{fallbackLng:[]})?n("resource_center.no_announcements"):n("resource_center.no_results_found")):null)},U=({announcement:o,expanded:t=!1,enableTitleLinks:n,onReactionChange:r,onCommentSubmit:s,onSaveScrollPosition:l})=>{const a=P(),m=j(),i=A(),c=E(),f=$(c.version.theme),u=b(),p=h.useRef(null),g=n&&!!m,w=ie(p,{once:!0,rootMargin:"100px",disabled:o.seen===!0}),v=K(`/${m}/${u?o.id:o.permalink}`);h.useEffect(()=>{w&&o.seen===!1&&i.send({kind:"MarkAnnouncementSeen",announcementId:o.id,versionId:o.versionId},{batch:!0})},[w,o,i]);const d=()=>{m&&(l?.(),a.push(v))};return e.createElement("div",{ref:p,className:"userflow-site__card"},e.createElement("div",null,e.createElement("span",{className:"text-small text-secondary"},de(o.time)),e.createElement("div",null,g?e.createElement(k,{to:v,className:"h2-like text-extra-bold"},o.title):e.createElement("h2",{className:"h2-like text-extra-bold"},o.title))),e.createElement(N,{doc:o.content,buttons:o.buttons,lookupAttribute:C(o.data)}),o.moreEnabled&&t?e.createElement(N,{doc:o.moreContent,buttons:o.moreButtons,lookupAttribute:C(o.data)}):null,e.createElement(G,{announcement:t?{...o,moreEnabled:!1}:o,confettiColors:f.confettiColors,onReactionChange:r,onCommentSubmit:s,onMoreClick:t?void 0:d},!t&&o.moreEnabled&&e.createElement("div",{className:"userflowjs-announcement-more--modal"},e.createElement("button",{className:"userflowjs-tertiary-button",onClick:d},o.moreButtonText||"Read more",e.createElement("span",{className:"userflowjs-rtl-mirrored userflowjs-tertiary-button__icon"},e.createElement(I,{icon:te}))))))},pe=()=>{const o=E(),{announcementId:t}=R(),{submitReaction:n,submitComment:r}=T(),s=b(),l=j(),a=K(`/${l}`),{t:m}=V(),{loading:i,data:c,error:f}=Q({message:{kind:"GetAnnouncement",announcementId:t,permalink:!s},skip:!t});return i?e.createElement(_,{center:!0,fadeIn:!0}):f||!c?.announcement?e.createElement("div",{className:"userflow-site__announcement-content"},e.createElement("div",{className:"d-flex gap-16 flex-column mt-24"},e.createElement(k,{to:a,className:"userflow-site-link-button userflow-site-home-back-button"},e.createElement(I,{icon:D}),o.version.site?.homeButtonText||"All Announcements"),e.createElement("div",{className:"userflow-site__card userflow-site__card--not-found"},e.createElement("h3",{className:"userflow-site__announcement-not-found text-extra-bold"},m("site.page_not_found"))))):e.createElement("div",{className:"userflow-site__announcement-content"},c?.announcement&&e.createElement("div",{className:"d-flex gap-16 flex-column mt-24"},e.createElement(k,{to:a,className:"userflow-site-link-button userflow-site-home-back-button"},e.createElement(I,{icon:D}),o.version.site?.homeButtonText||"All Announcements"),e.createElement(U,{expanded:!0,announcement:c.announcement,onReactionChange:n,onCommentSubmit:r})))},ge=()=>{const o=P(),t=E(),n=b(),r=B(),{announcementId:s}=R();if(t?.kind!=="site"||n)return null;const l=t.locales.find(i=>i.code===t.locale.standardLocaleId);if(t.locales.length===1&&t.locales[0].code===t.locale.standardLocaleId||t.locales.length===0||!l)return null;const m=i=>{const c=s?`/${i.code}/${s}`:`/${i.code}`;o.push(n?`${c}${r.search}`:c)};return e.createElement(ue,{buttonStyle:"userflow-site-locale-dropdown",value:l,options:t.locales,onChange:m,comparator:(i,c)=>i.code===c.code,renderOption:i=>i.name})},we=({companyLogoSrc:o,headerText:t,headerDescription:n,logoUrl:r,localeDropdown:s})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"userflow-site-header-wrapper"},e.createElement("div",{className:"d-flex justify-space-between align-items-center userflow-site-logo-wrapper"},e.createElement("div",null,o?e.createElement(e.Fragment,null,r?e.createElement("a",{href:r,target:"_blank",rel:"noopener noreferrer"},e.createElement("img",{src:o,className:"userflow-site-logo"})):e.createElement("img",{src:o,className:"userflow-site-logo"})):null),s),e.createElement("div",{className:"userflow-site__announcements-heading"},e.createElement("h1",{className:"text-bold"},t),e.createElement("p",null,n)))),b=()=>E().draftMode,j=()=>{const o=E(),t=b(),{locale:n}=R();return t?n:n??o.locale.standardLocaleId},K=o=>{const t=b(),n=B();return t?`${o}${n.search}`:o};export{fe as SiteAnnouncementsWrapper,M as SiteContentWrapper,we as SiteHeader,U as SiteListItem,ot as SitePage};
|
|
2
2
|
//# sourceMappingURL=SitePage.js.map
|
package/hash.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
32fa8d7b7c672985df46241c0c98d2a36bcc7509
|
package/package.json
CHANGED
package/roots.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as l,G as v,ae as ne,m as ae,F as z,af as Ie}from"./userflow.js";import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="da038751-f721-490b-96e4-f851514aca3f",e._sentryDebugIdIdentifier="sentry-dbid-da038751-f721-490b-96e4-f851514aca3f")}catch{}})();class Me extends Error{constructor(t,o){const n=`Unreachable case: ${t}`;o?o=`${o} (${n})`:o=n,super(o)}}function mt(e){return typeof e=="object"&&e!=null}let ue=window.MutationObserver;const L=window;if(L.Zone&&typeof L.Zone.__symbol__=="function"){const e=L.Zone.__symbol__("MutationObserver");e&&typeof e=="string"&&L.hasOwnProperty(e)&&typeof L[e]=="function"&&(ue=L[e])}function fe(e,t){const o=e.left,n=e.top,r=o+e.width,i=n+e.height,c=t.left,s=t.top,f=c+t.width,u=s+t.height;return Le(o,n,r,i,c,s,f,u)}function Le(e,t,o,n,r,i,c,s){const f=c<e,u=o<r,d=s<t,a=n<i;return a&&f?U(e,n,c,i):f&&d?U(e,t,c,s):d&&u?U(o,t,r,s):u&&a?U(o,n,r,i):f?e-c:u?r-o:d?t-s:a?i-n:0}function U(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}function _(e){window.performance.mark&&window.performance.mark(e)}function X(e,t,o){window.performance.measure&&window.performance.measure(e,t,o)}function ve(){const e=window.getComputedStyle(window.document.body);if(e.zoom&&e.zoom!=="1"){const t=parseFloat(e.zoom);if(!isNaN(t))return t}return 1}function pt(e){return _e(),Re(e)}let F;function Re(e){return F==null&&(F=ve()),F==1?e:e/F}function _e(){F=null}function wt(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientWidth||window.innerWidth}function De(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientHeight||window.innerHeight}function gt(e){return e?parseFloat(e.replace(/px$/,"")):0}function yt(e){return e==null?void 0:e+"px"}function bt(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}const Ve=50,ke=100,oe=25,Fe=new Set(["left","start","justify","justify-all"]);class Oe{constructor(t){this.ctx=t,this.rectCache=new Map,this.isLabelLikeCache=new Map,this.hasPlaceholderCache=new Map}calcScore(t,o){const n=this.getRect(t),r=this.getRect(o),i=this.distBetween(t,o),c=K(o)?ke:Ve;if(i>c)return 0;const s=this.isLabelLike(t),f=this.isCloserToOtherInput(t,o),u=window.getComputedStyle(t).textAlign||"",d=n.top+n.height<=r.top,a=Math.abs(n.left-r.left)<oe&&(!u||Fe.has(u)),h=n.left+n.width<=r.left,T=Math.abs(n.top-r.top)<oe,E=d&&a||h&&T,y=n.height>=De()/2,b=be(o);if(b&&n.top>=r.top+r.height)return 0;let m=1;const S=t.htmlFor;return S&&S===o.id&&(m+=Math.pow(1e3,4)),b&&!y&&!f&&(s&&E?m+=Math.pow(1e3,3):o===t&&this.hasPlaceholder(o)?m+=Math.pow(1e3,2):!s&&E&&(m+=Math.pow(1e3,1))),m+=c-i,m}getRect(t){let o=this.rectCache.get(t);return o||(o=A(t),this.rectCache.set(t,o)),o}isLabelLike(t){let o=this.isLabelLikeCache.get(t);if(o===void 0){const n="a, button, h1, h2, h3, h4, h5, h6, input";o=!t.closest(n)&&!t.querySelector(n),this.isLabelLikeCache.set(t,o)}return o}hasPlaceholder(t){let o=this.hasPlaceholderCache.get(t);return o===void 0&&(o=!!O(t),this.hasPlaceholderCache.set(t,o)),o}getAllInputs(){return this.allInputs||(this.allInputs=Array.from(document.querySelectorAll(we())).filter(t=>ee(t,this.ctx))),this.allInputs}distBetween(t,o){return Math.round(fe(this.getRect(t),this.getRect(o)))}isCloserToOtherInput(t,o){let n=this.distBetween(t,o);for(let r of this.getAllInputs()){if(r===o)continue;if(this.distBetween(t,r)<n)return!0}return!1}}function Be(e,t={}){const o=performance.now();_("userflow:inferSelector:start"),l.groupCollapsed("inferSelector for",e,t);let n;try{n=Ue(e,t)}catch(r){console.error("Userflow findElement error:",r),n=null}return l("time",performance.now()-o),l.groupEnd(),_("userflow:inferSelector:end"),X("userflow:inferSelector","userflow:inferSelector:start","userflow:inferSelector:end"),n}function de(e){const t=[],o=e.tagName.toLowerCase();return v.inferenceAttributeNames.forEach(n=>{const r=e.getAttribute(n);if(!r)return;const i=v.inferenceAttributeFilters[n];if(!(i&&!ne(i,r)))if(n==="id")t.push(`#${r}`);else{const c=n==="name"||n==="placeholder"?o:"";t.push(`${c}[${n}="${r}"]`)}}),e.classList.forEach(n=>{ne(v.inferenceClassNameFilters,n)&&(n=n.replace(/:/g,"\\:").trim(),t.push(`.${n}`))}),t}const $e=window.userflow||{};$e.__inferSelector=Be;function Ue(e,{elementType:t}={}){const o={minorVersion:Ge};let n=be(e);const r=nt(e);if(t===ae.INPUT&&!n)if(r)e=r,n=!0,l("use custom input parent",r);else return l("not an input"),null;else r&&(e=r,n=!0);const i=Pe(e);let c=null;n||(c=pe(e),c&&c.length>250&&(c=null)),l("text is:"+c);let s=new Map,f=new Map;const u=new Map,d=new Y(i,null,o),a=new Y(i,c,o),h=(y,b,m,S,g)=>{if(S<0)return;let p=y.get(b);p||(p=[],y.set(b,p)),p.push({css:m,offset:S,complexity:g}),l(`use css=${m}, cardinality=${b}, offset=${S}`)},T=qe(e),E=[e.tagName.toLowerCase(),...de(e)];l("shadowRootSelectors:",i),l("ancestorCssSelectors:",T),l("ownCssSelectors:",E);for(const y of E)for(const b of T){const m=b?`${b} ${y}`:y,S=b?2:1,g=d.query(m),p=Array.from(g),w=p.length;if(w>100){l(`cardinality too high css=${m}, cardinality=${w}`);continue}u.set(m,w);const x=p.indexOf(e);if(h(s,w,m,x,S),c){const k=a.query(m),M=Array.from(k),Ce=M.indexOf(e),Ne=M.length;h(f,Ne,m,Ce,S)}}if(s.size>0||f.size>0){const y=S=>Array.from(S.entries()).map(([g,p])=>({cardinality:g,cssSelectors:p.sort((w,x)=>{const k=u.get(w.css),M=u.get(x.css);return k!==M?k?M?k-M:-1:1:w.complexity!==x.complexity?x.complexity-w.complexity:w.css.localeCompare(x.css)}).map(({css:w,offset:x})=>({css:w,offset:x}))})).sort((g,p)=>g.cardinality-p.cardinality),b={version:"v1",minorVersion:o.minorVersion,shadowRootSelectors:i,notextGroups:y(s),textGroups:y(f)},m={el:e,selector:{type:z.AUTO,autoData:JSON.stringify(b),text:c,elementType:t}};return l("inference result",m),m}return l("no selector inferred "),null}function Pe(e){let t=[],o=e;for(;o;){let n=o.getRootNode();if(V(n)){const{host:i}=n;t.unshift(i.tagName.toLowerCase()),o=i;continue}const r=q(o);if(r){let i=r.tagName.toLowerCase();const c=r.getAttribute("name");c?i+=`[name="${c}"]`:r.id&&!r.id.match(/\d$/)&&(i+="#"+r.id),t.unshift(i),o=r;continue}break}if(t.length!==0)return t}function qe(e){const t=new Map;t.set(null,0);let o=e.parentNode;for(;o&&!(o.tagName==="BODY"||V(o));){for(const r of de(o)){if(t.has(r))continue;const i=P(document.body,r);if(i){const c=i.length;t.set(r,c)}}o=o.parentNode}return Array.from(t.entries()).sort(([,r],[,i])=>r-i).slice(0,20).map(([r])=>r)}function je(e,t){const{text:o,excludeText:n,precision:r}=e,i={minorVersion:t.minorVersion||0},c=o!=null&&!n,s=c?t.textGroups:t.notextGroups,f=Math.max(1,Math.min(s.length,Math.ceil((1-parseFloat(r||"1"))*s.length))),u=new Y(t.shadowRootSelectors,c&&o||null,i);l("findElementAutoV1",{text:o,excludeText:n,precision:r,groups:s,groupCount:f});for(let d=0;d<f;d++){const a=s[d];let h=new Map,T=0,E=null;l.group(`group cardinality=${a.cardinality}`,a);try{for(let y=0;y<a.cssSelectors.length;y++){const{css:b,offset:m}=a.cssSelectors[y];l(`css=${b}, offset=${m}`);let S=u.query(b),g=null;for(let w=0;w<=m;w++){const x=S.next();if(x.done)break;g=x.value}if(!g)continue;const p=(h.get(g)||0)+1;if(h.set(g,p),l(`el with frequency=${p}`+(p>T&&g!==E?" NEW BEST":""),g),p>T&&(T=p,E=g,p>=Math.ceil(a.cssSelectors.length/2)))return l("early winner",E),E}}finally{l.groupEnd()}if(E)return l("winner",E),E}return l("element not found"),null}class Y{constructor(t,o,n){this.shadowRootSelectors=t,this.text=o,this.ctx=n,this.isVisibleCache=new Map,this.textCache=new Map}*query(t){const o=P(document.body,t,this.shadowRootSelectors);if(l("found",o),!o)return;const{text:n}=this;for(let r=0;r<o.length;r++){const i=o[r];if(n){let s=this.textCache.get(i);if(s==null&&(s=G(i,n),this.textCache.set(i,s)),!s){l("skip, text mismatch",i);continue}}let c=this.isVisibleCache.get(i);if(c==null&&(c=ee(i,this.ctx),this.isVisibleCache.set(i,c)),!c){l("skip, not visible",i);continue}l("yield",i),yield i}}}const Ge=5,B=window.userflow||{};function Z(e){const t=performance.now();_("userflow:findAllElements:start"),l.groupCollapsed("findAllElements",e);let o;try{if(e.type===z.MANUAL)o=Ye(e);else if(e.autoData){const n=JSON.parse(e.autoData);let r;if(n.version==="v1")r=je(e,n);else throw new Me(n.version,"Unknown autoData version: "+n.version);o=r?[r]:[]}else o=[]}catch(n){console.error("Userflow findElement error:",n),o=[]}return l("time",performance.now()-t),l.groupEnd(),_("userflow:findAllElements:end"),X("userflow:findAllElements","userflow:findAllElements:start","userflow:findAllElements:end"),o}function Ye(e){const t={minorVersion:e.minorVersion==null?1:e.minorVersion};let{css:o,text:n,elementType:r,offset:i}=e;n=n&&R(n);const c="nearSelector"in e?e.nearSelector:null;l("findAllElementsManual",e),i!=null&&c!=null&&console.warn("Userflow.js: Both selector.offset and selector.nearSelector was set; ignoring nearSelector.");let s;if(n&&!o){if(s=[],t.minorVersion>=2)for(const f of se())W(f,n,s);else W(document.body,n,s);l("els after traverseElementForText",s)}else if(o){if(t.minorVersion>=2){s=[];for(const f of se()){const u=P(f,o);u&&u.length>0&&s.push(...u)}}else s=Array.from(P(document.body,o)||[]);l("els after safeQueryAll",s),n&&(s=ze(s,n),l("els after filterElementsByText",s))}else console.warn("Userflow.js: findAllElements() requires least one of `css` and `text` to be set."),s=[];if(s.length>0&&(s=s.filter(f=>ee(f,t)),l("els after isVisible",s)),s.length>0&&r===ae.INPUT&&(s=et(s,t),l("els after mapElementsToInputs",s)),s.length>0&&(s.sort((f,u)=>{const d=A(f),a=A(u);return d.top<a.top?-1:d.top>a.top?1:d.left-a.left}),l("els after sort",s)),s.length>0){if(i!=null)s=s[i]?[s[i]]:[],l("els after offset",s);else if(c!=null){const f=Z(c);let u=null,d=0;for(const a of s)for(const h of f){const T=fe(A(a),A(h));(!u||T<d)&&(u=a,d=T)}s=u?[u]:[],l("els after nearSelector",s)}}return s}function he(e){return Z(e)[0]||null}function We(e,t){const o=performance.now();_("userflow:elementMatchesSelector:start"),l.groupCollapsed("elementMatchesSelector",e,t);let n;try{if(t.type===z.MANUAL)n=He(e,t);else{const r=he(t);n=r!=null&&r.contains(e)}}catch(r){console.error("Userflow findElement error:",r),n=!1}return l(n?"match":"not match"),l("time",performance.now()-o),l.groupEnd(),_("userflow:elementMatchesSelector:end"),X("userflow:elementMatchesSelector","userflow:elementMatchesSelector:start","userflow:elementMatchesSelector:end"),n}function He(e,t){t.offset!=null&&console.warn("Userflow.js: selector.offset is not supported for elementMatchesSelector yet"),"nearSelector"in t&&t.nearSelector!=null&&console.warn("Userflow.js: selector.nearSelector is not supported for elementMatchesSelector yet");let{css:o,text:n}=t;n=n&&R(n);let r=!1,i=e;for(;i&&i.tagName!=="BODY";){if((!o||i.matches(o))&&(!n||G(i,n))){r=!0;break}i=i.parentElement}return r}function W(e,t,o){if(D(e)){const{tagName:r}=e;if(r==="SCRIPT"||r==="STYLE")return!1}let n=!1;for(let r=0;r<e.children.length;r++)W(e.children[r],t,o)&&(n=!0);return!n&&D(e)&&G(e,t)&&(o.push(e),n=!0),n}function P(e,t,o){try{return o==null?e.querySelectorAll(t):me(t,o,0,e)}catch{return console.info("Userflow.js: Invalid CSS selector: ",t),null}}function me(e,t,o,n){if(o>=t.length)return Array.from(n.querySelectorAll(e));const r=t[o],i=n.querySelectorAll(r),c=[];return i.forEach(s=>{let f;if(s.shadowRoot)f=s.shadowRoot;else{if(!Se(s))return;let u=null;try{u=s.contentDocument}catch{}if(!u)return;f=u.body}c.push(...me(e,t,o+1,f))}),c}function ze(e,t){const o=[];for(let n=e.length-1;n>=0;n--){const r=e[n];o.some(i=>i.contains(r))||G(r,t)&&o.push(r)}return o.reverse()}const Xe={email:!0,number:!0,password:!0,search:!0,tel:!0,text:!0,url:!0},Ze={date:!0,"datetime-local":!0,month:!0,time:!0,week:!0},Qe={button:!0,email:!0,reset:!0,search:!0,submit:!0,tel:!0,text:!0,url:!0};function pe(e){let t=e.innerText;return t===void 0&&e.tagName!=="SELECT"&&(t=e.textContent),t=R(t),t||null}function O(e){if(ge(e)||Q(e)){const t=R(e.getAttribute("placeholder")),o=e.value||"";if(t&&!o)return t;const n=R(o);if(n&&ot(e))return n}if(J(e)&&e.selectedIndex>=0){const t=R(e.options[e.selectedIndex].text);if(t)return t}return pe(e)}function G(e,t){const o=O(e);return o?Je(t,o):!1}function Je(e,t){const o=e.toLowerCase();return t.toLowerCase()===o}function R(e){return!e||e.length>250?null:e.replace(/^[\s\uFEFF\xA0\u200B*]+|[\s\uFEFF\xA0\u200B*]+$/g,"").replace(/\s+/g," ")}function Ke(e){for(const{cssSelector:t,getValue:o}of v.customInputs)if(e.matches(t))if(o)try{return(o(e)||"").trim()}catch(n){return console.error(`Userflow.js: getValue function for custom input '${t}' failed:`,n),""}else return O(e)||"";return J(e)?e.selectedIndex==-1?"":e.options[e.selectedIndex].text:K(e)?O(e)||"":e.value}function we(){return"input, select, textarea, [contenteditable]"+v.customInputs.map(({cssSelector:e})=>`, ${e}`).join("")}function et(e,t){const o=new Set,n=new Oe(t),r=we();for(const i of e){if(i.matches(r)){o.add(i);continue}let c=null,s=null;n.getAllInputs().forEach(f=>{const u=n.calcScore(i,f);l("input",u,f),u!==0&&(c&&s&&u<=s||(l("input is best so far"),c=f,s=u))}),c&&(l("best input was",c),o.add(c))}return Array.from(o)}function ge(e){if(e.tagName!=="INPUT")return!1;const t=e.getAttribute("type");return t==null?!0:Xe[(t||"").toLowerCase()]===!0}function Q(e){return e.tagName==="TEXTAREA"}function tt(e){if(e.tagName!=="INPUT")return!1;const t=(e.getAttribute("type")||"").toLowerCase();return Ze[t]===!0}function J(e){return e.tagName==="SELECT"}function K(e){return"hasAttribute"in e&&e.hasAttribute("contenteditable")}function ye(e){return!!(K(e)||v.customInputs.some(({cssSelector:t})=>e.matches(t)))}function nt(e){let t=e.parentNode;for(;t&&!(t.tagName==="BODY"||V(t));){if(ye(t))return t;t=t.parentNode}return null}function be(e){return ge(e)||tt(e)||Q(e)||J(e)||ye(e)}function ot(e){if(Q(e))return!0;const t=(e.getAttribute("type")||"").toLowerCase();return Qe[t]}function ee(e,t){const o=A(e);let n=e,r=!0,i=!1,c=!1,s=!1,f=!1;for(;n;){const u=n===document.body,d=n.tagName==="BODY",a=window.getComputedStyle(n);let h=null;if(r){if(a.visibility&&a.visibility!=="visible")return l("not visible because visibility is",a.visibility,e,{cur:n}),!1;r=!1}if(a.display==="none")return l("not visible because display is",a.display,e,{cur:n}),!1;if(a.opacity!=null&&parseFloat(a.opacity)<.01)return l("not visible because opacity is",a.opacity,e,{cur:n}),!1;if(a.position==="absolute"?s=!0:(a.position==="relative"||a.position==="fixed"||a.position==="sticky")&&(s=!1),t.minorVersion>=4&&!i&&!d&&!(f&&a.position==="static")&&(N(a.overflowX)||N(a.overflowY))&&(h=h||A(n),h.width===0||h.height===0))return l("not visible because width/height (v1.4 check) is",h.width,h.height,e,{cur:n}),!1;if(!c&&Ee(a.display)&&(t.minorVersion<1||d||a.position!=="static")){const T=d||N(a.overflow),E=T||N(a.overflowX),y=T||N(a.overflowY),{scrollLeft:b,scrollTop:m}=d?n.ownerDocument.documentElement:n,S=!d&&!s;if(E){if(h=h||A(n),S&&h.width===0)return l("not visible because width is",h.width,e,{cur:n}),!1;const g=t.minorVersion>=5?o.width/2:0,p=Math.round(o.left+g),w=Math.round(h.left-b);if(p<w)return l("not visible because it's clipped left",e,{elX:p,curLeft:w,cur:n}),!1}if(y){if(h=h||A(n),S&&h.height===0)return l("not visible because height is",h.height,e,{cur:n}),!1;const g=t.minorVersion>=5?o.height/2:0,p=Math.round(o.top+g),w=Math.round(h.top-m);if(p<w)return l("not visible because it's clipped top",e,{elY:p,curTop:w,cur:n}),!1}(E||y)&&(c=!0)}if(a.position==="fixed"&&(i=!0,c=!0),t.minorVersion>=3&&(n.scrollTop>0||n.scrollLeft>0)&&(c=!0),u)break;d?(n=q(n),r=!0):n=n.parentElement,f=s}return!0}function N(e){return e==="hidden"||e==="clip"||e==="scroll"||e==="auto"}function Ee(e){return!e||!e.includes("inline")&&e!=="contents"}function Et(e){let t=e.parentNode,o=!1;for(;t&&t.tagName!=="BODY";){V(t)&&(t=t.host);const n=window.getComputedStyle(t);if(n.position==="absolute"?o=!0:(n.position==="relative"||n.position==="fixed"||n.position==="sticky")&&(o=!1),!o&&Ee(n.display)&&(N(n.overflow)||N(n.overflowY)))return t;if(n.position==="fixed")return e.ownerDocument.documentElement;t=t.parentNode}return e.ownerDocument.documentElement}function A(e){if(e.tagName==="HTML"){const n=q(e);if(n)return A(n)}let t=e.getBoundingClientRect(),o=e;for(;o&&(o=q(o),!!o);){const n=o.getBoundingClientRect();t={width:t.width,height:t.height,left:t.left+n.left,right:t.right+n.left,top:t.top+n.top,bottom:t.bottom+n.top}}return t}const re=new WeakSet;function q(e){const t=e.ownerDocument?.defaultView;if(!t||re.has(t))return null;{const o=t.frameElement;return o||re.add(t),o}}function V(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e&&"mode"in e}function D(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Se(e){return D(e)&&e.tagName==="IFRAME"}const rt=e=>{if(!e)return null;const t=e.className;if(t==null)return null;if(typeof t=="string")return t;if(typeof t=="object"&&"baseVal"in t)return t.baseVal||null;try{return String(t)}catch{return null}},St=e=>{const t=e.getBoundingClientRect();return`${e.tagName}-${e.id||""}-${rt(e)||""}-${Math.round(t.left)}-${Math.round(t.top)}`};B.__findElement=he;B.__findAllElements=Z;B.__elementMatchesSelector=We;B.__getElementText=O;B.__getInputValue=Ke;const C=new Set,H=new Map,j=new Set;function se(){return Te(),C}function Tt(e,t){Te();for(const n of C)e(n);const o={setup:e,teardown:t};return j.add(o),()=>{j.delete(o);for(const n of C)t(n)}}let ie=!1,I=null;function Te(){if(le(),!ie){l("roots started"),ie=!0,I=document.body,$(I);for(const e of Ie)document.addEventListener(e,st);window.setInterval(le,10*1e3)}}function st(){I&&!document.contains(I)&&(l("roots detected new Turbo body"),te(I),I=document.body,$(I))}function le(){for(const e of C)V(e)&&(it(e)||(l("roots clean before removeRoot",e),te(e)));l("roots clean finished, remaining=",C.size)}function it(e){if(!e.ownerDocument.defaultView)return!1;let t=e.host;for(;t;){if(V(t)&&(t=t.host),D(t)&&t.tagName==="BODY")return!0;t=t.parentNode}return!1}function $(e){if(!C.has(e)){l("roots addRoot",e),C.add(e),lt(e),xe(e),ut(e),ft(e);for(const{setup:t}of j)t(e)}}function te(e){if(C.has(e)){l("roots removeRoot",e),H.get(e)?.disconnect(),H.delete(e),C.delete(e);for(const{teardown:t}of j)t(e)}}function lt(e){let t;const o=()=>{xe(e)},n=new ue(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(o)});n.observe(e,{childList:!0,subtree:!0}),H.set(e,n)}function xe(e){const t=D(e)?e.ownerDocument.getElementsByTagName("iframe"):e.querySelectorAll("iframe");for(const o of t)Ae(o)}const ce=new WeakSet;function Ae(e){if(ce.has(e)||e.closest("#userflow-ui"))return;e.addEventListener("load",ct);const t=e.contentWindow,o=e.contentDocument;if(!t||!o){ce.add(e);return}const n=o.body;n&&(t.addEventListener("pagehide",at),l("roots setupFrame before addRoot",e,o,n),$(n))}function ct(e){const t=e.target;t&&Se(t)&&Ae(t)}function at(e){const t=e.currentTarget.document.body;l("roots onFrameUnload before removeRoot",t),te(t)}function ut(e){const t=e.ownerDocument.defaultView;if(t.__userflowAttachShadowInstalled)return;t.__userflowAttachShadowInstalled=!0;const o=t.Element.prototype.attachShadow;o!=null&&(t.Element.prototype.attachShadow=function(n){const r=o.call(this,n);return this.shadowRoot&&(l("roots monitorShadowDom before addRoot",this,this.shadowRoot),$(this.shadowRoot)),r})}function ft(e){const t=o=>{o.childNodes.forEach(n=>{D(n)&&n.shadowRoot&&(l("roots queryShadowDom before addRoot",n,n.shadowRoot),$(n.shadowRoot)),t(n)})};t(e)}export{ue as M,Me as U,Be as a,be as b,mt as c,yt as d,wt as e,Z as f,pe as g,De as h,bt as i,Re as j,V as k,D as l,q as m,R as n,Tt as o,_e as p,gt as q,A as r,St as s,Se as t,Et as u,he as v,Ke as w,We as x,pt as z};
|
|
1
|
+
import{d as l,G as v,ae as ne,m as ae,F as z,af as Me}from"./userflow.js";import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8cea55c8-a9a9-4f0e-9dee-484e311b9c04",e._sentryDebugIdIdentifier="sentry-dbid-8cea55c8-a9a9-4f0e-9dee-484e311b9c04")}catch{}})();class Ne extends Error{constructor(t,o){const n=`Unreachable case: ${t}`;o?o=`${o} (${n})`:o=n,super(o)}}function pt(e){return typeof e=="object"&&e!=null}let ue=window.MutationObserver;const L=window;if(L.Zone&&typeof L.Zone.__symbol__=="function"){const e=L.Zone.__symbol__("MutationObserver");e&&typeof e=="string"&&L.hasOwnProperty(e)&&typeof L[e]=="function"&&(ue=L[e])}function fe(e,t){const o=e.left,n=e.top,r=o+e.width,i=n+e.height,c=t.left,s=t.top,f=c+t.width,u=s+t.height;return Le(o,n,r,i,c,s,f,u)}function Le(e,t,o,n,r,i,c,s){const f=c<e,u=o<r,d=s<t,a=n<i;return a&&f?U(e,n,c,i):f&&d?U(e,t,c,s):d&&u?U(o,t,r,s):u&&a?U(o,n,r,i):f?e-c:u?r-o:d?t-s:a?i-n:0}function U(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}function _(e){window.performance.mark&&window.performance.mark(e)}function X(e,t,o){window.performance.measure&&window.performance.measure(e,t,o)}function ve(){const e=window.getComputedStyle(window.document.body);if(e.zoom&&e.zoom!=="1"){const t=parseFloat(e.zoom);if(!isNaN(t))return t}return 1}function wt(e){return _e(),Re(e)}let V;function Re(e){return V==null&&(V=ve()),V==1?e:e/V}function _e(){V=null}function gt(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientWidth||window.innerWidth}function De(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientHeight||window.innerHeight}function yt(e){return e?parseFloat(e.replace(/px$/,"")):0}function bt(e){return e==null?void 0:e+"px"}function Et(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}const ke=50,Ve=100,oe=25,Fe=new Set(["left","start","justify","justify-all"]);class Be{constructor(t){this.ctx=t,this.rectCache=new Map,this.isLabelLikeCache=new Map,this.hasPlaceholderCache=new Map}calcScore(t,o){const n=this.getRect(t),r=this.getRect(o),i=this.distBetween(t,o),c=K(o)?Ve:ke;if(i>c)return 0;const s=this.isLabelLike(t),f=this.isCloserToOtherInput(t,o),u=window.getComputedStyle(t).textAlign||"",d=n.top+n.height<=r.top,a=Math.abs(n.left-r.left)<oe&&(!u||Fe.has(u)),h=n.left+n.width<=r.left,T=Math.abs(n.top-r.top)<oe,E=d&&a||h&&T,y=n.height>=De()/2,b=be(o);if(b&&n.top>=r.top+r.height)return 0;let m=1;const S=t.htmlFor;return S&&S===o.id&&(m+=Math.pow(1e3,4)),b&&!y&&!f&&(s&&E?m+=Math.pow(1e3,3):o===t&&this.hasPlaceholder(o)?m+=Math.pow(1e3,2):!s&&E&&(m+=Math.pow(1e3,1))),m+=c-i,m}getRect(t){let o=this.rectCache.get(t);return o||(o=A(t),this.rectCache.set(t,o)),o}isLabelLike(t){let o=this.isLabelLikeCache.get(t);if(o===void 0){const n="a, button, h1, h2, h3, h4, h5, h6, input";o=!t.closest(n)&&!t.querySelector(n),this.isLabelLikeCache.set(t,o)}return o}hasPlaceholder(t){let o=this.hasPlaceholderCache.get(t);return o===void 0&&(o=!!F(t),this.hasPlaceholderCache.set(t,o)),o}getAllInputs(){return this.allInputs||(this.allInputs=Array.from(document.querySelectorAll(we())).filter(t=>ee(t,this.ctx))),this.allInputs}distBetween(t,o){return Math.round(fe(this.getRect(t),this.getRect(o)))}isCloserToOtherInput(t,o){let n=this.distBetween(t,o);for(let r of this.getAllInputs()){if(r===o)continue;if(this.distBetween(t,r)<n)return!0}return!1}}function Oe(e,t={}){const o=performance.now();_("userflow:inferSelector:start"),l.groupCollapsed("inferSelector for",e,t);let n;try{n=Ue(e,t)}catch(r){console.error("Userflow findElement error:",r),n=null}return l("time",performance.now()-o),l.groupEnd(),_("userflow:inferSelector:end"),X("userflow:inferSelector","userflow:inferSelector:start","userflow:inferSelector:end"),n}function de(e){const t=[],o=e.tagName.toLowerCase();return v.inferenceAttributeNames.forEach(n=>{const r=e.getAttribute(n);if(!r)return;const i=v.inferenceAttributeFilters[n];if(!(i&&!ne(i,r)))if(n==="id")t.push(`#${r}`);else{const c=n==="name"||n==="placeholder"?o:"";t.push(`${c}[${n}="${r}"]`)}}),e.classList.forEach(n=>{ne(v.inferenceClassNameFilters,n)&&(n=n.replace(/:/g,"\\:").trim(),t.push(`.${n}`))}),t}const $e=window.userflow||{};$e.__inferSelector=Oe;function Ue(e,{elementType:t}={}){const o={minorVersion:Ge};let n=be(e);const r=nt(e);if(t===ae.INPUT&&!n)if(r)e=r,n=!0,l("use custom input parent",r);else return l("not an input"),null;else r&&(e=r,n=!0);const i=Pe(e);let c=null;n||(c=pe(e),c&&c.length>250&&(c=null)),l("text is:"+c);let s=new Map,f=new Map;const u=new Map,d=new Y(i,null,o),a=new Y(i,c,o),h=(y,b,m,S,g)=>{if(S<0)return;let p=y.get(b);p||(p=[],y.set(b,p)),p.push({css:m,offset:S,complexity:g}),l(`use css=${m}, cardinality=${b}, offset=${S}`)},T=qe(e),E=[e.tagName.toLowerCase(),...de(e)];l("shadowRootSelectors:",i),l("ancestorCssSelectors:",T),l("ownCssSelectors:",E);for(const y of E)for(const b of T){const m=b?`${b} ${y}`:y,S=b?2:1,g=d.query(m),p=Array.from(g),w=p.length;if(w>100){l(`cardinality too high css=${m}, cardinality=${w}`);continue}u.set(m,w);const x=p.indexOf(e);if(h(s,w,m,x,S),c){const k=a.query(m),N=Array.from(k),Ce=N.indexOf(e),Ie=N.length;h(f,Ie,m,Ce,S)}}if(s.size>0||f.size>0){const y=S=>Array.from(S.entries()).map(([g,p])=>({cardinality:g,cssSelectors:p.sort((w,x)=>{const k=u.get(w.css),N=u.get(x.css);return k!==N?k?N?k-N:-1:1:w.complexity!==x.complexity?x.complexity-w.complexity:w.css.localeCompare(x.css)}).map(({css:w,offset:x})=>({css:w,offset:x}))})).sort((g,p)=>g.cardinality-p.cardinality),b={version:"v1",minorVersion:o.minorVersion,shadowRootSelectors:i,notextGroups:y(s),textGroups:y(f)},m={el:e,selector:{type:z.AUTO,autoData:JSON.stringify(b),text:c,elementType:t}};return l("inference result",m),m}return l("no selector inferred "),null}function Pe(e){let t=[],o=e;for(;o;){let n=o.getRootNode();if($(n)){const{host:i}=n;t.unshift(i.tagName.toLowerCase()),o=i;continue}const r=q(o);if(r){let i=r.tagName.toLowerCase();const c=r.getAttribute("name");c?i+=`[name="${c}"]`:r.id&&!r.id.match(/\d$/)&&(i+="#"+r.id),t.unshift(i),o=r;continue}break}if(t.length!==0)return t}function qe(e){const t=new Map;t.set(null,0);let o=e.parentNode;for(;o&&!(o.tagName==="BODY"||$(o));){for(const r of de(o)){if(t.has(r))continue;const i=P(document.body,r);if(i){const c=i.length;t.set(r,c)}}o=o.parentNode}return Array.from(t.entries()).sort(([,r],[,i])=>r-i).slice(0,20).map(([r])=>r)}function je(e,t){const{text:o,excludeText:n,precision:r}=e,i={minorVersion:t.minorVersion||0},c=o!=null&&!n,s=c?t.textGroups:t.notextGroups,f=Math.max(1,Math.min(s.length,Math.ceil((1-parseFloat(r||"1"))*s.length))),u=new Y(t.shadowRootSelectors,c&&o||null,i);l("findElementAutoV1",{text:o,excludeText:n,precision:r,groups:s,groupCount:f});for(let d=0;d<f;d++){const a=s[d];let h=new Map,T=0,E=null;l.group(`group cardinality=${a.cardinality}`,a);try{for(let y=0;y<a.cssSelectors.length;y++){const{css:b,offset:m}=a.cssSelectors[y];l(`css=${b}, offset=${m}`);let S=u.query(b),g=null;for(let w=0;w<=m;w++){const x=S.next();if(x.done)break;g=x.value}if(!g)continue;const p=(h.get(g)||0)+1;if(h.set(g,p),l(`el with frequency=${p}`+(p>T&&g!==E?" NEW BEST":""),g),p>T&&(T=p,E=g,p>=Math.ceil(a.cssSelectors.length/2)))return l("early winner",E),E}}finally{l.groupEnd()}if(E)return l("winner",E),E}return l("element not found"),null}class Y{constructor(t,o,n){this.shadowRootSelectors=t,this.text=o,this.ctx=n,this.isVisibleCache=new Map,this.textCache=new Map}*query(t){const o=P(document.body,t,this.shadowRootSelectors);if(l("found",o),!o)return;const{text:n}=this;for(let r=0;r<o.length;r++){const i=o[r];if(n){let s=this.textCache.get(i);if(s==null&&(s=G(i,n),this.textCache.set(i,s)),!s){l("skip, text mismatch",i);continue}}let c=this.isVisibleCache.get(i);if(c==null&&(c=ee(i,this.ctx),this.isVisibleCache.set(i,c)),!c){l("skip, not visible",i);continue}l("yield",i),yield i}}}const Ge=5,O=window.userflow||{};function Z(e){const t=performance.now();_("userflow:findAllElements:start"),l.groupCollapsed("findAllElements",e);let o;try{if(e.type===z.MANUAL)o=Ye(e);else if(e.autoData){const n=JSON.parse(e.autoData);let r;if(n.version==="v1")r=je(e,n);else throw new Ne(n.version,"Unknown autoData version: "+n.version);o=r?[r]:[]}else o=[]}catch(n){console.error("Userflow findElement error:",n),o=[]}return l("time",performance.now()-t),l.groupEnd(),_("userflow:findAllElements:end"),X("userflow:findAllElements","userflow:findAllElements:start","userflow:findAllElements:end"),o}function Ye(e){const t={minorVersion:e.minorVersion==null?1:e.minorVersion};let{css:o,text:n,elementType:r,offset:i}=e;n=n&&R(n);const c="nearSelector"in e?e.nearSelector:null;l("findAllElementsManual",e),i!=null&&c!=null&&console.warn("Userflow.js: Both selector.offset and selector.nearSelector was set; ignoring nearSelector.");let s;if(n&&!o){if(s=[],t.minorVersion>=2)for(const f of se())W(f,n,s);else W(document.body,n,s);l("els after traverseElementForText",s)}else if(o){if(t.minorVersion>=2){s=[];for(const f of se()){const u=P(f,o);u&&u.length>0&&s.push(...u)}}else s=Array.from(P(document.body,o)||[]);l("els after safeQueryAll",s),n&&(s=ze(s,n),l("els after filterElementsByText",s))}else console.warn("Userflow.js: findAllElements() requires least one of `css` and `text` to be set."),s=[];if(s.length>0&&(s=s.filter(f=>ee(f,t)),l("els after isVisible",s)),s.length>0&&r===ae.INPUT&&(s=et(s,t),l("els after mapElementsToInputs",s)),s.length>0&&(s.sort((f,u)=>{const d=A(f),a=A(u);return d.top<a.top?-1:d.top>a.top?1:d.left-a.left}),l("els after sort",s)),s.length>0){if(i!=null)s=s[i]?[s[i]]:[],l("els after offset",s);else if(c!=null){const f=Z(c);let u=null,d=0;for(const a of s)for(const h of f){const T=fe(A(a),A(h));(!u||T<d)&&(u=a,d=T)}s=u?[u]:[],l("els after nearSelector",s)}}return s}function he(e){return Z(e)[0]||null}function We(e,t){const o=performance.now();_("userflow:elementMatchesSelector:start"),l.groupCollapsed("elementMatchesSelector",e,t);let n;try{if(t.type===z.MANUAL)n=He(e,t);else{const r=he(t);n=r!=null&&r.contains(e)}}catch(r){console.error("Userflow findElement error:",r),n=!1}return l(n?"match":"not match"),l("time",performance.now()-o),l.groupEnd(),_("userflow:elementMatchesSelector:end"),X("userflow:elementMatchesSelector","userflow:elementMatchesSelector:start","userflow:elementMatchesSelector:end"),n}function He(e,t){t.offset!=null&&console.warn("Userflow.js: selector.offset is not supported for elementMatchesSelector yet"),"nearSelector"in t&&t.nearSelector!=null&&console.warn("Userflow.js: selector.nearSelector is not supported for elementMatchesSelector yet");let{css:o,text:n}=t;n=n&&R(n);let r=!1,i=e;for(;i&&i.tagName!=="BODY";){if((!o||i.matches(o))&&(!n||G(i,n))){r=!0;break}i=i.parentElement}return r}function W(e,t,o){if(B(e)){const{tagName:r}=e;if(r==="SCRIPT"||r==="STYLE")return!1}let n=!1;for(let r=0;r<e.children.length;r++)W(e.children[r],t,o)&&(n=!0);return!n&&B(e)&&G(e,t)&&(o.push(e),n=!0),n}function P(e,t,o){try{return o==null?e.querySelectorAll(t):me(t,o,0,e)}catch{return console.info("Userflow.js: Invalid CSS selector: ",t),null}}function me(e,t,o,n){if(o>=t.length)return Array.from(n.querySelectorAll(e));const r=t[o],i=n.querySelectorAll(r),c=[];return i.forEach(s=>{let f;if(s.shadowRoot)f=s.shadowRoot;else{if(!Se(s))return;let u=null;try{u=s.contentDocument}catch{}if(!u)return;f=u.body}c.push(...me(e,t,o+1,f))}),c}function ze(e,t){const o=[];for(let n=e.length-1;n>=0;n--){const r=e[n];o.some(i=>i.contains(r))||G(r,t)&&o.push(r)}return o.reverse()}const Xe={email:!0,number:!0,password:!0,search:!0,tel:!0,text:!0,url:!0},Ze={date:!0,"datetime-local":!0,month:!0,time:!0,week:!0},Qe={button:!0,email:!0,reset:!0,search:!0,submit:!0,tel:!0,text:!0,url:!0};function pe(e){let t=e.innerText;return t===void 0&&e.tagName!=="SELECT"&&(t=e.textContent),t=R(t),t||null}function F(e){if(ge(e)||Q(e)){const t=R(e.getAttribute("placeholder")),o=e.value||"";if(t&&!o)return t;const n=R(o);if(n&&ot(e))return n}if(J(e)&&e.selectedIndex>=0){const t=R(e.options[e.selectedIndex].text);if(t)return t}return pe(e)}function G(e,t){const o=F(e);return o?Je(t,o):!1}function Je(e,t){const o=e.toLowerCase();return t.toLowerCase()===o}function R(e){return!e||e.length>250?null:e.replace(/^[\s\uFEFF\xA0\u200B*]+|[\s\uFEFF\xA0\u200B*]+$/g,"").replace(/\s+/g," ")}function Ke(e){for(const{cssSelector:t,getValue:o}of v.customInputs)if(e.matches(t))if(o)try{return(o(e)||"").trim()}catch(n){return console.error(`Userflow.js: getValue function for custom input '${t}' failed:`,n),""}else return F(e)||"";return J(e)?e.selectedIndex==-1?"":e.options[e.selectedIndex].text:K(e)?F(e)||"":e.value}function we(){return"input, select, textarea, [contenteditable]"+v.customInputs.map(({cssSelector:e})=>`, ${e}`).join("")}function et(e,t){const o=new Set,n=new Be(t),r=we();for(const i of e){if(i.matches(r)){o.add(i);continue}let c=null,s=null;n.getAllInputs().forEach(f=>{const u=n.calcScore(i,f);l("input",u,f),u!==0&&(c&&s&&u<=s||(l("input is best so far"),c=f,s=u))}),c&&(l("best input was",c),o.add(c))}return Array.from(o)}function ge(e){if(e.tagName!=="INPUT")return!1;const t=e.getAttribute("type");return t==null?!0:Xe[(t||"").toLowerCase()]===!0}function Q(e){return e.tagName==="TEXTAREA"}function tt(e){if(e.tagName!=="INPUT")return!1;const t=(e.getAttribute("type")||"").toLowerCase();return Ze[t]===!0}function J(e){return e.tagName==="SELECT"}function K(e){return"hasAttribute"in e&&e.hasAttribute("contenteditable")}function ye(e){return!!(K(e)||v.customInputs.some(({cssSelector:t})=>e.matches(t)))}function nt(e){let t=e.parentNode;for(;t&&!(t.tagName==="BODY"||$(t));){if(ye(t))return t;t=t.parentNode}return null}function be(e){return ge(e)||tt(e)||Q(e)||J(e)||ye(e)}function ot(e){if(Q(e))return!0;const t=(e.getAttribute("type")||"").toLowerCase();return Qe[t]}function ee(e,t){const o=A(e);let n=e,r=!0,i=!1,c=!1,s=!1,f=!1;for(;n;){const u=n===document.body,d=n.tagName==="BODY",a=window.getComputedStyle(n);let h=null;if(r){if(a.visibility&&a.visibility!=="visible")return l("not visible because visibility is",a.visibility,e,{cur:n}),!1;r=!1}if(a.display==="none")return l("not visible because display is",a.display,e,{cur:n}),!1;if(a.opacity!=null&&parseFloat(a.opacity)<.01)return l("not visible because opacity is",a.opacity,e,{cur:n}),!1;if(a.position==="absolute"?s=!0:(a.position==="relative"||a.position==="fixed"||a.position==="sticky")&&(s=!1),t.minorVersion>=4&&!i&&!d&&!(f&&a.position==="static")&&(I(a.overflowX)||I(a.overflowY))&&(h=h||A(n),h.width===0||h.height===0))return l("not visible because width/height (v1.4 check) is",h.width,h.height,e,{cur:n}),!1;if(!c&&Ee(a.display)&&(t.minorVersion<1||d||a.position!=="static")){const T=d||I(a.overflow),E=T||I(a.overflowX),y=T||I(a.overflowY),{scrollLeft:b,scrollTop:m}=d?n.ownerDocument.documentElement:n,S=!d&&!s;if(E){if(h=h||A(n),S&&h.width===0)return l("not visible because width is",h.width,e,{cur:n}),!1;const g=t.minorVersion>=5?o.width/2:0,p=Math.round(o.left+g),w=Math.round(h.left-b);if(p<w)return l("not visible because it's clipped left",e,{elX:p,curLeft:w,cur:n}),!1}if(y){if(h=h||A(n),S&&h.height===0)return l("not visible because height is",h.height,e,{cur:n}),!1;const g=t.minorVersion>=5?o.height/2:0,p=Math.round(o.top+g),w=Math.round(h.top-m);if(p<w)return l("not visible because it's clipped top",e,{elY:p,curTop:w,cur:n}),!1}(E||y)&&(c=!0)}if(a.position==="fixed"&&(i=!0,c=!0),t.minorVersion>=3&&(n.scrollTop>0||n.scrollLeft>0)&&(c=!0),u)break;d?(n=q(n),r=!0):n=n.parentElement,f=s}return!0}function I(e){return e==="hidden"||e==="clip"||e==="scroll"||e==="auto"}function Ee(e){return!e||!e.includes("inline")&&e!=="contents"}function St(e){let t=e.parentNode,o=!1;for(;t&&t.tagName!=="BODY";){$(t)&&(t=t.host);const n=window.getComputedStyle(t);if(n.position==="absolute"?o=!0:(n.position==="relative"||n.position==="fixed"||n.position==="sticky")&&(o=!1),!o&&Ee(n.display)&&(I(n.overflow)||I(n.overflowY)))return t;if(n.position==="fixed")return e.ownerDocument.documentElement;t=t.parentNode}return e.ownerDocument.documentElement}function A(e){if(e.tagName==="HTML"){const n=q(e);if(n)return A(n)}let t=e.getBoundingClientRect(),o=e;for(;o&&(o=q(o),!!o);){const n=o.getBoundingClientRect();t={width:t.width,height:t.height,left:t.left+n.left,right:t.right+n.left,top:t.top+n.top,bottom:t.bottom+n.top}}return t}const re=new WeakSet;function q(e){const t=e.ownerDocument?.defaultView;if(!t||re.has(t))return null;{const o=t.frameElement;return o||re.add(t),o}}function $(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e&&"mode"in e}function B(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Se(e){return B(e)&&e.tagName==="IFRAME"}const rt=e=>{if(!e)return null;const t=e.className;if(t==null)return null;if(typeof t=="string")return t;if(typeof t=="object"&&"baseVal"in t)return t.baseVal||null;try{return String(t)}catch{return null}},Tt=e=>{const t=e.getBoundingClientRect();return`${e.tagName}-${e.id||""}-${rt(e)||""}-${Math.round(t.left)}-${Math.round(t.top)}`};O.__findElement=he;O.__findAllElements=Z;O.__elementMatchesSelector=We;O.__getElementText=F;O.__getInputValue=Ke;const C=new Set,H=new Map,j=new Set;function se(){return Te(),C}function xt(e,t){Te();for(const n of C)e(n);const o={setup:e,teardown:t};return j.add(o),()=>{j.delete(o);for(const n of C)t(n)}}let ie=!1,M=null;function Te(){if(le(),!ie){l("roots started"),ie=!0,M=document.body,D(M),it();for(const e of Me)document.addEventListener(e,st);window.setInterval(le,10*1e3)}}function st(){M&&!document.contains(M)&&(l("roots detected new Turbo body"),te(M),M=document.body,D(M))}function it(){for(const e of document.documentElement.children)e!==document.body&&e.shadowRoot&&D(e.shadowRoot)}function le(){for(const e of C)$(e)&&(lt(e)||(l("roots clean before removeRoot",e),te(e)));l("roots clean finished, remaining=",C.size)}function lt(e){return e.ownerDocument.defaultView?e.host.isConnected:!1}function D(e){if(!C.has(e)){l("roots addRoot",e),C.add(e),ct(e),xe(e),ft(e),dt(e);for(const{setup:t}of j)t(e)}}function te(e){if(C.has(e)){l("roots removeRoot",e),H.get(e)?.disconnect(),H.delete(e),C.delete(e);for(const{teardown:t}of j)t(e)}}function ct(e){let t;const o=()=>{xe(e)},n=new ue(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(o)});n.observe(e,{childList:!0,subtree:!0}),H.set(e,n)}function xe(e){const t=B(e)?e.ownerDocument.getElementsByTagName("iframe"):e.querySelectorAll("iframe");for(const o of t)Ae(o)}const ce=new WeakSet;function Ae(e){if(ce.has(e)||e.closest("#userflow-ui"))return;e.addEventListener("load",at);const t=e.contentWindow,o=e.contentDocument;if(!t||!o){ce.add(e);return}const n=o.body;n&&(t.addEventListener("pagehide",ut),l("roots setupFrame before addRoot",e,o,n),D(n))}function at(e){const t=e.target;t&&Se(t)&&Ae(t)}function ut(e){const t=e.currentTarget.document.body;l("roots onFrameUnload before removeRoot",t),te(t)}function ft(e){const t=e.ownerDocument.defaultView;if(t.__userflowAttachShadowInstalled)return;t.__userflowAttachShadowInstalled=!0;const o=t.Element.prototype.attachShadow;o!=null&&(t.Element.prototype.attachShadow=function(n){const r=o.call(this,n);return this.shadowRoot&&(l("roots monitorShadowDom before addRoot",this,this.shadowRoot),D(this.shadowRoot)),r})}function dt(e){const t=o=>{o.childNodes.forEach(n=>{B(n)&&n.shadowRoot&&(l("roots queryShadowDom before addRoot",n,n.shadowRoot),D(n.shadowRoot)),t(n)})};t(e)}export{ue as M,Ne as U,Oe as a,be as b,pt as c,bt as d,gt as e,Z as f,pe as g,De as h,Et as i,Re as j,$ as k,B as l,q as m,R as n,xt as o,_e as p,yt as q,A as r,Tt as s,Se as t,St as u,he as v,Ke as w,We as x,wt as z};
|
|
2
2
|
//# sourceMappingURL=roots.js.map
|
package/userflow.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ResourceCenterApp.js","vendor.react.js","vendor.core-js.js","vendor.object-assign.js","client-context.js","vendor.i18next.js","vendor.babel.runtime.js","vendor.react-i18next.js","flow-host.styl.js","TreeDoc.js","flow-condition-types.js","vendor.date-fns.js","roots.js","stylesheets.js","vendor.fortawesome.pro-regular-svg-icons.js","vendor.fortawesome.pro-solid-svg-icons.js","vendor.obj-str.js","use-selector-element-monitoring.js","Frame.js","vendor.react-dom.js","vendor.scheduler.js","iframe-reset.styl.js","use-window-resize.js","logomark.js","ChecklistUI.js","FlowChrome.js","use-confetti.js","vendor.canvas-confetti.js","AnnouncementEngagement.js","vendor.memoize-one.js","vendor.bignumber.js.js","use-element-rect.js","BannerApp.js","vendor.phoenix.js","vendor.uuid.js","SitePage.js","vendor.react-router-dom.js","vendor.react-router.js","vendor.prop-types.js","vendor.history.js","vendor.resolve-pathname.js","vendor.value-equal.js","vendor.tiny-invariant.js","vendor.mini-create-react-context.js","vendor.path-to-regexp.js","vendor.react-is.js","Popover.js","react-hooks.js","vendor.lodash.js","implicit-tracking.js","DebuggerUI.js","vendor.fortawesome.react-fontawesome.js","vendor.fortawesome.fontawesome-svg-core.js","vendor.react-day-picker.js","ui.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import"./vendor.core-js.js";import{S as z}from"./vendor.phoenix.js";import{v as O}from"./vendor.uuid.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="61d9c9bb-9ebd-4da2-87c5-d9d37b48bfaf",t._sentryDebugIdIdentifier="sentry-dbid-61d9c9bb-9ebd-4da2-87c5-d9d37b48bfaf")}catch{}})();const J="modulepreload",Q=function(t){return new URL("./",import.meta.url).toString()+t},b={},T=function(e,s,n){let i=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");i=Promise.allSettled(s.map(c=>{if(c=Q(c),c in b)return;b[c]=!0;const l=c.endsWith(".css"),g=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${g}`))return;const E=document.createElement("link");if(E.rel=l?"stylesheet":J,l||(E.as="script"),E.crossOrigin="",E.href=c,u&&E.setAttribute("nonce",u),document.head.appendChild(E),l)return new Promise((j,Y)=>{E.addEventListener("load",j),E.addEventListener("error",()=>Y(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return i.then(a=>{for(const u of a||[])u.status==="rejected"&&r(u.reason);return e().catch(r)})};class h extends Error{constructor(e,s,n){super(e),Object.setPrototypeOf(this,h.prototype),this.name="UserflowError",this.code=s,this.humanMessage=n}}class x{constructor(e){this.type=e,this.testState={}}formatKey(e){return`userflow:${e}`}isSupported(){if(typeof window>"u")return!1;try{return window[this.type]!=null}catch{return!1}}getItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].getItem(e):null}setItem(e,s){e=this.formatKey(e);{if(!this.isSupported())return;window[this.type].setItem(e,s)}}removeItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].removeItem(e):void 0}clear(){return this.isSupported()?window[this.type].clear():void 0}}const w=new x("localStorage"),d=new x("sessionStorage");function ct(t){window.location.href=t}function m(){return window.location.href}function _(t){window.postMessage(t,window.origin)}function G(t){const e=n=>{if(n.source!==window||n.origin!==window.origin)return;const i=n.data;!i||typeof i!="object"||typeof i.kind!="string"||!i.kind.startsWith("userflow:")||t(i)===!0&&s()};window.addEventListener("message",e);const s=()=>window.removeEventListener("message",e);return s}function X(t){return new Promise(e=>{G(s=>{const n=t(s);return n?(e(n),!0):!1})})}const R=new Set;let D=!1;function Z(t){return q(),R.add(t),()=>{W(t)}}function W(t){R.delete(t)}function C(){R.forEach(t=>t())}function q(){if(D)return;D=!0;const{history:t}=window,e=s=>{const n=t[s];t[s]=(...i)=>{const r=n.apply(t,i);return C(),r}};window.__userflowStatePatched?(window.addEventListener("userflow:pushstate",()=>{C()}),window.addEventListener("userflow:replacestate",()=>{C()})):(e("pushState"),e("replaceState")),window.addEventListener("popstate",()=>{C()})}class ee{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(e){_({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})}onBuilderMessage(e){return this.unregisterOnMessage=G(e),!1}async captureScreenshot(e,s,n,i){return _({kind:"userflow:crxScreenshot",x:e,y:s,width:n,height:i,devicePixelRatio:window.devicePixelRatio}),(await X(a=>a.kind==="userflow:crxScreenshotResult"?a:null)).imageDataUrl}}var k=(t=>(t.ACTION="ACTION",t.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",t.REPLACED="REPLACED",t.SNOOZED="SNOOZED",t.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",t.USERFLOWJS="USERFLOWJS",t.USER_CLOSED="USER_CLOSED",t))(k||{}),te=(t=>(t.POSITIVE="POSITIVE",t.NEUTRAL="NEUTRAL",t.NEGATIVE="NEGATIVE",t))(te||{}),se=(t=>(t.SECOND="SECOND",t.MINUTE="MINUTE",t.HOUR="HOUR",t.DAY="DAY",t))(se||{}),p=(t=>(t.ACTION="ACTION",t.DRAFT="DRAFT",t.LINK="LINK",t.LAUNCHER_SEEN="LAUNCHER_SEEN",t.RESOURCE_CENTER="RESOURCE_CENTER",t.USERFLOWJS="USERFLOWJS",t.ASSISTANT="ASSISTANT",t))(p||{}),ie=(t=>(t.LIKE="LIKE",t.DISLIKE="DISLIKE",t))(ie||{}),S=(t=>(t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.NUMBER="NUMBER",t.DATETIME="DATETIME",t.LIST="LIST",t.RANDOM_AB="RANDOM_AB",t.RANDOM_NUMBER="RANDOM_NUMBER",t.CHECKLIST_TASK="CHECKLIST_TASK",t.FLOW="FLOW",t.FLOW_SESSION="FLOW_SESSION",t.FLOW_STEP="FLOW_STEP",t.FLOW_VERSION="FLOW_VERSION",t))(S||{}),U=(t=>(t.FLOW="FLOW",t.BANNER="BANNER",t.EMBED="EMBED",t.CHECKLIST="CHECKLIST",t.LAUNCHER="LAUNCHER",t.RESOURCE_CENTER="RESOURCE_CENTER",t.SITE="SITE",t))(U||{}),ne=(t=>(t.ALWAYS_TRUE="ALWAYS_TRUE",t.ATTRIBUTE="ATTRIBUTE",t.CHECKLIST_TASK_CLICKED="CHECKLIST_TASK_CLICKED",t.CLAUSE="CLAUSE",t.ELEMENT="ELEMENT",t.EVENT="EVENT",t.FILLED_IN_INPUT="FILLED_IN_INPUT",t.FLOW="FLOW",t.INPUT_VALUE="INPUT_VALUE",t.PAGE="PAGE",t.SEGMENT="SEGMENT",t.TIME="TIME",t))(ne||{}),re=(t=>(t.AUTO="AUTO",t.MANUAL="MANUAL",t))(re||{}),oe=(t=>(t.INPUT="INPUT",t))(oe||{}),ae=(t=>(t.ABSOLUTE_EQ="ABSOLUTE_EQ",t.ABSOLUTE_GT="ABSOLUTE_GT",t.ABSOLUTE_LT="ABSOLUTE_LT",t.AND="AND",t.BETWEEN="BETWEEN",t.CONTAINS="CONTAINS",t.EMPTY="EMPTY",t.ENDS_WITH="ENDS_WITH",t.EQ="EQ",t.EXCLUDES_ALL="EXCLUDES_ALL",t.EXCLUDES_ANY="EXCLUDES_ANY",t.FALSE="FALSE",t.GT="GT",t.GTE="GTE",t.INCLUDES_ALL="INCLUDES_ALL",t.INCLUDES_ANY="INCLUDES_ANY",t.LT="LT",t.LTE="LTE",t.NE="NE",t.NOT_CONTAINS="NOT_CONTAINS",t.NOT_EMPTY="NOT_EMPTY",t.NOT_REGEX="NOT_REGEX",t.OR="OR",t.REGEX="REGEX",t.RELATIVE_EQ="RELATIVE_EQ",t.RELATIVE_GT="RELATIVE_GT",t.RELATIVE_LT="RELATIVE_LT",t.STARTS_WITH="STARTS_WITH",t.TRUE="TRUE",t.URL="URL",t))(ae||{}),ce=(t=>(t.CLICK="CLICK",t.DISABLED="DISABLED",t.MOUSEDOWN="MOUSEDOWN",t.NOT_CLICK="NOT_CLICK",t.NOT_DISABLED="NOT_DISABLED",t.NOT_PRESENT="NOT_PRESENT",t.PRESENT="PRESENT",t))(ce||{}),le=(t=>(t.END_USER="END_USER",t.GROUP="GROUP",t))(le||{}),ue=(t=>(t.BETWEEN="BETWEEN",t.EQ="EQ",t.GTE="GTE",t.LTE="LTE",t))(ue||{}),he=(t=>(t.ANY="ANY",t.RELATIVE_BETWEEN="RELATIVE_BETWEEN",t.RELATIVE_GT="RELATIVE_GT",t.RELATIVE_LT="RELATIVE_LT",t))(he||{}),de=(t=>(t.CURRENT_USER="CURRENT_USER",t.CURRENT_USER_CURRENT_GROUP="CURRENT_USER_CURRENT_GROUP",t.CURRENT_GROUP="CURRENT_GROUP",t))(de||{}),fe=(t=>(t.ASSET="ASSET",t.CARTOON="CARTOON",t.NONE="NONE",t.URL="URL",t))(fe||{}),Ee=(t=>(t.INSIDE="INSIDE",t.OUTSIDE="OUTSIDE",t))(Ee||{}),Se=(t=>(t.TOP_LEFT="TOP_LEFT",t.TOP_CENTER="TOP_CENTER",t.TOP_RIGHT="TOP_RIGHT",t.BOTTOM_RIGHT="BOTTOM_RIGHT",t.BOTTOM_CENTER="BOTTOM_CENTER",t.BOTTOM_LEFT="BOTTOM_LEFT",t.CENTER="CENTER",t))(Se||{}),Te=(t=>(t.GOOGLE="GOOGLE",t.STANDARD="STANDARD",t))(Te||{}),ge=(t=>(t.DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",t.DISMISS="DISMISS",t))(ge||{}),Ie=(t=>(t.DISMISS="DISMISS",t.NONE="NONE",t))(Ie||{}),we=(t=>(t.DEFAULT="DEFAULT",t.NARROW="NARROW",t.CHAINED_SQUARED="CHAINED_SQUARED",t.CHAINED_ROUNDED="CHAINED_ROUNDED",t.DOTTED="DOTTED",t.NUMBERED="NUMBERED",t))(we||{}),Ce=(t=>(t.TOP="TOP",t.BOTTOM="BOTTOM",t))(Ce||{}),me=(t=>(t.DEFAULT="DEFAULT",t.PLAINTEXT="PLAINTEXT",t.CUSTOM="CUSTOM",t))(me||{}),ke=(t=>(t.CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",t.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",t.NONE="NONE",t))(ke||{}),Ue=(t=>(t.BUBBLE="BUBBLE",t.END="END",t.ERROR="ERROR",t.FLAG="FLAG",t))(Ue||{}),pe=(t=>(t.MANUAL="MANUAL",t.NONE="NONE",t.SYNTHETIC="SYNTHETIC",t))(pe||{}),Le=(t=>(t.BUBBLE="BUBBLE",t.HIDDEN="HIDDEN",t.MODAL="MODAL",t.TOOLTIP="TOOLTIP",t))(Le||{}),Ne=(t=>(t.ABOVE="ABOVE",t.BELOW="BELOW",t.LEFT="LEFT",t.RIGHT="RIGHT",t))(Ne||{}),_e=(t=>(t.CLOSE_FLOW="CLOSE_FLOW",t.EVAL_JS="EVAL_JS",t.GO_TO_STEP="GO_TO_STEP",t.NAVIGATE="NAVIGATE",t.SET_ATTRIBUTE="SET_ATTRIBUTE",t.SNOOZE="SNOOZE",t.START_FLOW="START_FLOW",t.TRACK_BUTTON_EVENT="TRACK_BUTTON_EVENT",t))(_e||{}),Ae=(t=>(t.NEW_TAB="NEW_TAB",t.SAME_TAB="SAME_TAB",t))(Ae||{}),Re=(t=>(t.SET="SET",t.SET_DATETIME="SET_DATETIME",t.SET_DATETIME_ONCE="SET_DATETIME_ONCE",t.SET_ONCE="SET_ONCE",t.ADD="ADD",t.SUBTRACT="SUBTRACT",t.APPEND="APPEND",t.PREPEND="PREPEND",t.REMOVE="REMOVE",t.UNSET="UNSET",t))(Re||{}),ve=(t=>(t.MULTILINE_TEXT="MULTILINE_TEXT",t.MULTIPLE_CHOICE="MULTIPLE_CHOICE",t.NPS="NPS",t.SCALE="SCALE",t.STARS="STARS",t.TEXT="TEXT",t))(ve||{}),A=(t=>(t.ACTION="ACTION",t.ANNOUNCEMENTS="ANNOUNCEMENTS",t.ASSISTANT="ASSISTANT",t.CHECKLIST="CHECKLIST",t.CONTACT="CONTACT",t.DIVIDER="DIVIDER",t.FLOWS="FLOWS",t.KNOWLEDGE_BASE="KNOWLEDGE_BASE",t.MESSAGE="MESSAGE",t.SUBPAGE="SUBPAGE",t))(A||{}),Oe=(t=>(t.CRISP="CRISP",t.CUSTOM="CUSTOM",t.FRESHCHAT="FRESHCHAT",t.HELPSCOUT="HELPSCOUT",t.HUBSPOT="HUBSPOT",t.INTERCOM="INTERCOM",t.ZENDESK="ZENDESK",t.ZENDESK_MESSENGER="ZENDESK_MESSENGER",t))(Oe||{}),be=(t=>(t.BUTTON="BUTTON",t.INPUT="INPUT",t))(be||{}),De=(t=>(t.EMAIL="EMAIL",t.PHONE="PHONE",t.CHAT="CHAT",t))(De||{}),ye=(t=>(t.SILENT="SILENT",t.BADGE="BADGE",t.POPOUT="POPOUT",t.MODAL="MODAL",t.TOAST="TOAST",t))(ye||{}),Me=(t=>(t.DEFAULT="DEFAULT",t.CUSTOM="CUSTOM",t.NONE="NONE",t))(Me||{}),Pe=(t=>(t.LAUNCHER_CLICK="LAUNCHER_CLICK",t.LAUNCHER_HOVER="LAUNCHER_HOVER",t.TARGET_CLICK="TARGET_CLICK",t.TARGET_HOVER="TARGET_HOVER",t.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",t.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",t))(Pe||{}),V=(t=>(t.ACTIVATE="ACTIVATE",t.DEACTIVATE="DEACTIVATE",t.NEVER="NEVER",t))(V||{}),Be=(t=>(t.AUTO="AUTO",t.TOP="TOP",t.RIGHT="RIGHT",t.BOTTOM="BOTTOM",t.LEFT="LEFT",t))(Be||{}),He=(t=>(t.START="START",t.CENTER="CENTER",t.END="END",t))(He||{}),xe=(t=>(t.PERCENT="PERCENT",t.PX="PX",t))(xe||{}),Ge=(t=>(t.BEACON="BEACON",t.BUTTON="BUTTON",t.HIDDEN="HIDDEN",t.ICON="ICON",t))(Ge||{}),We=(t=>(t.LAUNCHER="LAUNCHER",t.TARGET="TARGET",t))(We||{}),Ve=(t=>(t.BODY_FIRST="BODY_FIRST",t.BODY_LAST="BODY_LAST",t.ELEMENT_FIRST="ELEMENT_FIRST",t.ELEMENT_LAST="ELEMENT_LAST",t.ELEMENT_BEFORE="ELEMENT_BEFORE",t.ELEMENT_AFTER="ELEMENT_AFTER",t))(Ve||{}),Ke=(t=>(t.BODY_FIRST="BODY_FIRST",t.BODY_LAST="BODY_LAST",t.ELEMENT_FIRST="ELEMENT_FIRST",t.ELEMENT_LAST="ELEMENT_LAST",t.ELEMENT_BEFORE="ELEMENT_BEFORE",t.ELEMENT_AFTER="ELEMENT_AFTER",t))(Ke||{}),K=(t=>(t.CHECKLIST="CHECKLIST",t))(K||{}),Fe=(t=>(t.HIDE="HIDE",t.OTHERS="OTHERS",t))(Fe||{}),$e=(t=>(t.ALWAYS="ALWAYS",t.MULTIPLE="MULTIPLE",t.NEVER="NEVER",t.ONCE="ONCE",t.ONCE_PER_GROUP="ONCE_PER_GROUP",t))($e||{}),je=(t=>(t.NONE="NONE",t.PENDING_SCHEDULE="PENDING_SCHEDULE",t.SCHEDULED="SCHEDULED",t.FIRED="FIRED",t))(je||{}),Ye=(t=>(t.NONE="NONE",t.LIKE="LIKE",t.SCALE="SCALE",t))(Ye||{}),ze=(t=>(t.HIDE="HIDE",t.BLOCK="BLOCK",t.OTHERS="OTHERS",t))(ze||{});function Je(){return{customInputs:[],customNavigate:null,urlFilter:null,linkUrlDecorator:null,customScrollIntoView:null,scrollPadding:null,inferenceAttributeNames:["data-for","data-id","data-testid","data-test-id","for","id","name","placeholder","role"],inferenceAttributeFilters:{id:[t=>!t.match(/\d$/)],"data-id":[t=>!t.match(/\d$/)]},inferenceClassNameFilters:[t=>!t.startsWith("css-")],baseZIndex:1234500,evalJsDisabled:!1}}const f=Je();function y(t){return Array.isArray(t)||(t=t?[t]:[]),t=t.map(e=>typeof e=="string"?new RegExp(e):e),t}function lt(t,e){return t.every(s=>typeof s=="function"?s(e):s instanceof RegExp?s.test(e):!0)}function Qe(){let t=m();if(f.urlFilter){if(t=f.urlFilter(t),typeof t!="string")throw new h("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(t)}catch(e){throw new h(`Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.
|
|
3
3
|
Returned URL: `+t+`
|
|
4
|
-
Error message: `+e.message)}}return t}let F="";try{F=localStorage.getItem("debug")||""}catch{}const $=F.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=v("log");o.group=v("group");o.groupCollapsed=v("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let L;function v(t){return function(e,...s){if($){const n=performance.now(),i=L?Math.round(n-L):0;L=n,console[t](`%cuserflow %c${e} %c+${i}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const Xe=()=>T(()=>import("./ResourceCenterApp.js").then(t=>t.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));function Ze(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class M{constructor(e){this.observers=new Set,this._value=e}get value(){return this._value}update(e){if(e!==this._value){this._value=e;for(const s of this.observers)s()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const P=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],qe=()=>T(()=>import("./BannerApp.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,16,13,14,15,10,11,12,9,8,17,19,20,18,21,31,22,33,34])),N="1021828",et=import.meta.url,B=50,tt=5*60*1e3,H="userflowClientState",I="userflowClientSiteId";class st{constructor(){this.clientToken=null,this.externalId=null,this.signature=null,this.groupId=null,this.groupSignature=null,this._socketStatus="disconnected",this.socket=null,this.channel=null,this.logrocketAppId=null,this.debounceInactiveDisconnectTimeout=void 0,this.inBatch=!1,this.endBatchTimeout=void 0,this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=0,this.clientClock=1,this.serverClock=1,this.flowSession=null,this.flowSessionClock=0,this.checklistSession=null,this.checklistExpanded=!1,this.checklistExpandPending=!1,this.checklistSessionClock=0,this.bannerSession=null,this.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=null,this.siteSession=null,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.embedSessions=[],this.notificationIdCounter=0,this.sessionStorageState=null,this.clientContext=null,this.flushUrlChangeTimeout=void 0,this.onFirstIdentifyRun=!1,this.onFirstIdentifyTimeout=void 0,this.firstIdentifyCallback=null,this.ui=null,this.debuggerUI=null,this.debuggerMountInProgress=!1,this.unackedTasks=new Set,this.clientConditions=new Map,this.trackers=new Map,this.conditionWaitTimers=new Map,this.listeners=new Map,this.targetEnv=null,this.idempotencyKeysSeen=new Set,this.testUserIdentified=!1,this.cspIssueReported=!1,this.uiDisabled=!1,this.audio=null,this.audioReady=!1,this.pageTrackingDisabled=!1,this.refCounter=1,this.implicitTracking=null,this.initialMessagesQueue=[],this.onBuilderMessage=e=>(this.handleBuilderMessage(e),!1),this.handleBuilderMessage=async e=>{o(`builder ${e.kind} message received`,e);const s="idempotencyKey"in e&&typeof e.idempotencyKey=="string"?e.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const n=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(e.kind){case"userflow:selectElement":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),d.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),e.testStartCondition?this.setSessionStorageState(i=>({...i,activeApp:"startConditionTesting",testStartConditionToken:e.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const i=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",i))};this.on("resourceCenterChanged",i),i()}});return}case"userflow:testTracker":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0})),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),this.setSessionStorageState(i=>({...i,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,trackerTesting:null}));return}case"userflow:startSmartFlow":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startSmartFlowAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"smartFlowRecording",smartFlowRecording:{sessionId:e.sessionId,isRecording:!0,startUrl:e.startUrl||null}}));return}case"userflow:smartFlowCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}case"userflow:smartFlowStartOverAck":return;case"userflow:smartFlowComplete":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),B))},this.onUserActivity=()=>this.ensureConnected(),this.mountSitePage=async(e,s)=>{d.setItem(I,s),o("mounting site page"),this.setResourceCenterLauncherHidden(!0);try{const{SitePage:n}=await T(async()=>{const{SitePage:r}=await import("./SitePage.js");return{SitePage:r}},__vite__mapDeps([35,1,2,3,4,5,6,7,19,20,36,37,38,39,40,41,42,43,44,45,28,16,13,14,15,10,11,12,26,27,21,9,46,29,47,48,33,34]));new n(this,e).mount(),o("site page mounted")}catch(n){console.error("Userflow: Failed to mount site page",n)}},this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+N),Z(this.onUrlChange),this.setTargetEnv(new ee),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const e of P)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),W(this.onUrlChange),this.destroyTargetEnv();for(const e of P)document.removeEventListener(e,this.remountIfNecessary)}setTargetEnv(e){this.destroyTargetEnv(),this.targetEnv=e,e.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new h("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const s=e(this.getSessionStorageState());d.setItem(H,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const s=d.getItem(H);if(s)try{e=JSON.parse(s)}catch(n){console.error("Userflow.js: Parse ElementSelectionState error:",n)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=e}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState(i=>({...i,testUser:e})),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const s=[this.identify(e.id,{name:e.name,email:e.email,signed_up_at:{set_once:new Date().toISOString(),data_type:"datetime"}},{signature:e.signature})],{group:n}=e;n&&(this.groupId=n.id,s.push(this.group(n.id,{name:n.name},{signature:n.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(e=>({...e,testUser:null}))}init(e){if(o("init",e),!e)throw new h("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==e){if(this.testUserIdentified){o("init() ignoring new token since a test user has been identified");return}this.clientToken&&(o("init() resetting due to new client token"),this.reset()),this.clientToken=e,this.emit("private:initialised")}}ensureInit(){if(!this.clientToken)throw new h("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new h("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new h("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId||(this.debounceInactiveDisconnect(),this.socket))return;this._socketStatus="connecting",o("connecting to socket");const e=/^ct_eu\d+_.+$/.test(this.clientToken)?"e.eu.":"e.";let s=f.serverEndpoint||e+"userflow.com";new URL(et).hostname==="js.getuserflow.com"&&s==="e.userflow.com"&&(s="e.getuserflow.com");const n="wss://"+s+"/end-users/"+this.clientToken+"/socket";this.socket=new z(n,{reconnectAfterMs:i=>[100,500,1e3,5e3][i-1]||1e4,timeout:20*1e3}),this.socket.connect(),this.socket.onOpen(()=>{o("socket opened")}),this.socket.onClose(()=>{this.emit("private:disconnect")}),this.socket.onError(i=>{console.log("Userflow.js socket error",i),this.reportCspIssue()}),this.channel=this.socket.channel(`end_users:${this.externalId}`,()=>this.makeChannelJoinPayload()),this.channel.join().receive("ok",i=>{typeof this.featureFlags>"u"&&this.clearInitialMessagesQueue(i.featureFlags),this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.featureFlagEnabled("cff_implicit_events")===!0&&!this.implicitTracking&&this.startImplicitTracking(),!this.featureFlagEnabled("cff_implicit_events")&&this.implicitTracking&&(this.implicitTracking.stop(),this.implicitTracking=null)}).receive("error",i=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(i.code)?(console.error(`Userflow.js resetting due to: [${i.code}] ${i.message}`),this.reset(),this.clientToken=null):i.code==="invalid_protocol_version"?(console.error(`Userflow.js destroying due to: [${i.code}] ${i.message}`),this.destroy()):console.log("Userflow.js channel join error",i)}),this.channel.on("server_message",i=>this.handleServerMessage(i)),this.channel.on("server_error",i=>{console.log(`Userflow.js server error (${i.code}): ${i.message}`+(i.details&&i.details.length>0?`
|
|
4
|
+
Error message: `+e.message)}}return t}let F="";try{F=localStorage.getItem("debug")||""}catch{}const $=F.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=v("log");o.group=v("group");o.groupCollapsed=v("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let L;function v(t){return function(e,...s){if($){const n=performance.now(),i=L?Math.round(n-L):0;L=n,console[t](`%cuserflow %c${e} %c+${i}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const Xe=()=>T(()=>import("./ResourceCenterApp.js").then(t=>t.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));function Ze(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class M{constructor(e){this.observers=new Set,this._value=e}get value(){return this._value}update(e){if(e!==this._value){this._value=e;for(const s of this.observers)s()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const P=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],qe=()=>T(()=>import("./BannerApp.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,16,13,14,15,10,11,12,9,8,17,19,20,18,21,31,22,33,34])),N="1021934",et=import.meta.url,B=50,tt=5*60*1e3,H="userflowClientState",I="userflowClientSiteId";class st{constructor(){this.clientToken=null,this.externalId=null,this.signature=null,this.groupId=null,this.groupSignature=null,this._socketStatus="disconnected",this.socket=null,this.channel=null,this.logrocketAppId=null,this.debounceInactiveDisconnectTimeout=void 0,this.inBatch=!1,this.endBatchTimeout=void 0,this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=0,this.clientClock=1,this.serverClock=1,this.flowSession=null,this.flowSessionClock=0,this.checklistSession=null,this.checklistExpanded=!1,this.checklistExpandPending=!1,this.checklistSessionClock=0,this.bannerSession=null,this.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=null,this.siteSession=null,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.embedSessions=[],this.notificationIdCounter=0,this.sessionStorageState=null,this.clientContext=null,this.flushUrlChangeTimeout=void 0,this.onFirstIdentifyRun=!1,this.onFirstIdentifyTimeout=void 0,this.firstIdentifyCallback=null,this.ui=null,this.debuggerUI=null,this.debuggerMountInProgress=!1,this.unackedTasks=new Set,this.clientConditions=new Map,this.trackers=new Map,this.conditionWaitTimers=new Map,this.listeners=new Map,this.targetEnv=null,this.idempotencyKeysSeen=new Set,this.testUserIdentified=!1,this.cspIssueReported=!1,this.uiDisabled=!1,this.audio=null,this.audioReady=!1,this.pageTrackingDisabled=!1,this.refCounter=1,this.implicitTracking=null,this.initialMessagesQueue=[],this.onBuilderMessage=e=>(this.handleBuilderMessage(e),!1),this.handleBuilderMessage=async e=>{o(`builder ${e.kind} message received`,e);const s="idempotencyKey"in e&&typeof e.idempotencyKey=="string"?e.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const n=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(e.kind){case"userflow:selectElement":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),d.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),e.testStartCondition?this.setSessionStorageState(i=>({...i,activeApp:"startConditionTesting",testStartConditionToken:e.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const i=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",i))};this.on("resourceCenterChanged",i),i()}});return}case"userflow:testTracker":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0})),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),this.setSessionStorageState(i=>({...i,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,trackerTesting:null}));return}case"userflow:startSmartFlow":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startSmartFlowAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"smartFlowRecording",smartFlowRecording:{sessionId:e.sessionId,isRecording:!0,startUrl:e.startUrl||null}}));return}case"userflow:smartFlowCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}case"userflow:smartFlowStartOverAck":return;case"userflow:smartFlowComplete":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),B))},this.onUserActivity=()=>this.ensureConnected(),this.mountSitePage=async(e,s)=>{d.setItem(I,s),o("mounting site page"),this.setResourceCenterLauncherHidden(!0);try{const{SitePage:n}=await T(async()=>{const{SitePage:r}=await import("./SitePage.js");return{SitePage:r}},__vite__mapDeps([35,1,2,3,4,5,6,7,19,20,36,37,38,39,40,41,42,43,44,45,28,16,13,14,15,10,11,12,26,27,21,9,46,29,47,48,33,34]));new n(this,e).mount(),o("site page mounted")}catch(n){console.error("Userflow: Failed to mount site page",n)}},this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+N),Z(this.onUrlChange),this.setTargetEnv(new ee),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const e of P)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),W(this.onUrlChange),this.destroyTargetEnv();for(const e of P)document.removeEventListener(e,this.remountIfNecessary)}setTargetEnv(e){this.destroyTargetEnv(),this.targetEnv=e,e.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new h("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const s=e(this.getSessionStorageState());d.setItem(H,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const s=d.getItem(H);if(s)try{e=JSON.parse(s)}catch(n){console.error("Userflow.js: Parse ElementSelectionState error:",n)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=e}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState(i=>({...i,testUser:e})),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const s=[this.identify(e.id,{name:e.name,email:e.email,signed_up_at:{set_once:new Date().toISOString(),data_type:"datetime"}},{signature:e.signature})],{group:n}=e;n&&(this.groupId=n.id,s.push(this.group(n.id,{name:n.name},{signature:n.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(e=>({...e,testUser:null}))}init(e){if(o("init",e),!e)throw new h("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==e){if(this.testUserIdentified){o("init() ignoring new token since a test user has been identified");return}this.clientToken&&(o("init() resetting due to new client token"),this.reset()),this.clientToken=e,this.emit("private:initialised")}}ensureInit(){if(!this.clientToken)throw new h("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new h("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new h("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId||(this.debounceInactiveDisconnect(),this.socket))return;this._socketStatus="connecting",o("connecting to socket");const e=/^ct_eu\d+_.+$/.test(this.clientToken)?"e.eu.":"e.";let s=f.serverEndpoint||e+"userflow.com";new URL(et).hostname==="js.getuserflow.com"&&s==="e.userflow.com"&&(s="e.getuserflow.com");const n="wss://"+s+"/end-users/"+this.clientToken+"/socket";this.socket=new z(n,{reconnectAfterMs:i=>[100,500,1e3,5e3][i-1]||1e4,timeout:20*1e3}),this.socket.connect(),this.socket.onOpen(()=>{o("socket opened")}),this.socket.onClose(()=>{this.emit("private:disconnect")}),this.socket.onError(i=>{console.log("Userflow.js socket error",i),this.reportCspIssue()}),this.channel=this.socket.channel(`end_users:${this.externalId}`,()=>this.makeChannelJoinPayload()),this.channel.join().receive("ok",i=>{typeof this.featureFlags>"u"&&this.clearInitialMessagesQueue(i.featureFlags),this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.featureFlagEnabled("cff_implicit_events")===!0&&!this.implicitTracking&&this.startImplicitTracking(),!this.featureFlagEnabled("cff_implicit_events")&&this.implicitTracking&&(this.implicitTracking.stop(),this.implicitTracking=null)}).receive("error",i=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(i.code)?(console.error(`Userflow.js resetting due to: [${i.code}] ${i.message}`),this.reset(),this.clientToken=null):i.code==="invalid_protocol_version"?(console.error(`Userflow.js destroying due to: [${i.code}] ${i.message}`),this.destroy()):console.log("Userflow.js channel join error",i)}),this.channel.on("server_message",i=>this.handleServerMessage(i)),this.channel.on("server_error",i=>{console.log(`Userflow.js server error (${i.code}): ${i.message}`+(i.details&&i.details.length>0?`
|
|
5
5
|
Details:
|
|
6
6
|
`+i.details.map(r=>(r.path?`${r.path}: `:"")+r.message):""))})}async startImplicitTracking(){await T(()=>import("./implicit-tracking.js"),__vite__mapDeps([49,12,2,34,33])).then(e=>{this.implicitTracking=new e.ImplicitTracking(this),this.implicitTracking.start()}).catch(e=>o(`Implicit tracking failed to load ${e}`))}makeChannelJoinPayload(){let e;d.getItem(I)&&(e=new URL(m()).searchParams.get("announcement_id")||void 0);const n=this.buildClientContext();this.clientContext=n;const i={protocolVersion:2,userflowClientBuild:N,signature:this.signature,groupExternalId:this.groupId,groupSignature:this.groupSignature,flowSessionId:this.flowSession?.id||null,checklistSessionId:this.checklistSession?.id||null,bannerSessionId:this.bannerSession?.id||null,resourceCenterSessionId:this.resourceCenterSession?.id||null,siteSessionId:this.siteSession?.id||null,launchers:this.launcherSessions.map(r=>({flowId:r.flow.id})),trackers:Array.from(this.trackers.values()).map(r=>({flowId:r.tracker.flowId})),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map(r=>({conditionId:r.condition.id,isTrue:r.isTrue})),previewFlowId:d.getItem("previewFlowId"),announcementPreviewId:e,clientContext:n};return o("channel join payload",i),i}disconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.socket&&this.socket.disconnect(),this._socketStatus="disconnected",this.socket=null,this.channel=null}debounceInactiveDisconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.debounceInactiveDisconnectTimeout=window.setTimeout(()=>{if(this.hasDraftSession()||this.assistantMessageInProgress){this.debounceInactiveDisconnect();return}o("disconnecting from socket due to inactivity"),this.disconnect()},tt)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.bannerSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some(e=>e.draftMode)}async send(e,{batch:s,endBatch:n,handlesRejection:i}={}){return(!this.inBatch||!["ToggleClientCondition","UpdateClientContext"].includes(e.kind))&&this.checkPushRateLimit(),this.ensureConnected(),s&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),n?this.endBatch():this.endBatchTimeout=window.setTimeout(()=>{this.endBatch()},B)),this.sendRaw(e,{handlesRejection:i})}clearInitialMessagesQueue(e){if(this.initialMessagesQueue.length===0)return;const s=e.includes("cff_disable_page_views")===!0,n=e.includes("cff_implicit_events")===!1;for(const i of this.initialMessagesQueue){const{message:r,handlesRejection:a,resolve:u,reject:c}=i;if(n&&r.kind==="TrackRawEvent"){u("skipped due to disabled implicit events");continue}if(s&&(r.kind==="TrackEvent"&&r.name==="page_viewed"||r.kind==="TrackRawEvent"&&r.name==="page_viewed")){u("skipped due to disabled page views tracking");continue}this._sendToChannel(r,u,c,{handlesRejection:a})}this.initialMessagesQueue=[]}async sendRaw(e,{handlesRejection:s}={}){return typeof this.featureFlags>"u"?new Promise((n,i)=>{this.initialMessagesQueue.push({message:e,resolve:n,reject:i,handlesRejection:s})}):new Promise((n,i)=>{this._sendToChannel(e,n,i,{handlesRejection:s})})}_sendToChannel(e,s,n,{handlesRejection:i}={}){if(!this.channel){const c=`Userflow.js: send() should not be called if channel is not set. Message kind=${e.kind}`;if(i)throw Error(c);console.log(c,`
|
|
7
7
|
Client message:`,e);return}o(`push ${e.kind} message`,e);const r=this.clientClock,a=()=>{this.serverClock=r,this.channel?.off("phx_error",u)},u=this.channel.on("phx_error",c=>{a();const l=`Userflow.js send ${e.kind} got phx_error`;this._socketStatus==="connected"&&console.log(l,`
|
package/vendor.core-js.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="9cfd77e6-4e2b-4681-a294-2ab65a0c739a",r._sentryDebugIdIdentifier="sentry-dbid-9cfd77e6-4e2b-4681-a294-2ab65a0c739a")}catch{}})();var Ze=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Ze.SENTRY_RELEASE={id:"826827f8f170b69f7b2b899d1bb25b3d387afe15"};var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var P=function(r){return r&&r.Math===Math&&r},f=P(typeof globalThis=="object"&&globalThis)||P(typeof window=="object"&&window)||P(typeof self=="object"&&self)||P(typeof F=="object"&&F)||P(typeof F=="object"&&F)||function(){return this}()||Function("return this")(),gr={},h=function(r){try{return!!r()}catch{return!0}},Qe=h,g=!Qe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),rt=h,Or=!rt(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),et=Or,B=Function.prototype.call,O=et?B.bind(B):function(){return B.apply(B,arguments)},fe={},se={}.propertyIsEnumerable,ye=Object.getOwnPropertyDescriptor,tt=ye&&!se.call({1:2},1);fe.f=tt?function(e){var t=ye(this,e);return!!t&&t.enumerable}:se;var de=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},$e=Or,pe=Function.prototype,sr=pe.call,nt=$e&&pe.bind.bind(sr,sr),b=$e?nt:function(r){return function(){return sr.apply(r,arguments)}},be=b,at=be({}.toString),ot=be("".slice),q=function(r){return ot(at(r),8,-1)},it=b,vt=h,ut=q,H=Object,ct=it("".split),lt=vt(function(){return!H("z").propertyIsEnumerable(0)})?function(r){return ut(r)==="String"?ct(r,""):H(r)}:H,Sr=function(r){return r==null},ft=Sr,st=TypeError,he=function(r){if(ft(r))throw new st("Can't call method on "+r);return r},yt=lt,dt=he,Er=function(r){return yt(dt(r))},X=typeof document=="object"&&document.all,d=typeof X>"u"&&X!==void 0?function(r){return typeof r=="function"||r===X}:function(r){return typeof r=="function"},$t=d,_=function(r){return typeof r=="object"?r!==null:$t(r)},Z=f,pt=d,bt=function(r){return pt(r)?r:void 0},ge=function(r,e){return arguments.length<2?bt(Z[r]):Z[r]&&Z[r][e]},ht=b,Oe=ht({}.isPrototypeOf),gt=f,_r=gt.navigator,Dr=_r&&_r.userAgent,Se=Dr?String(Dr):"",Ee=f,Q=Se,Mr=Ee.process,Ar=Ee.Deno,Fr=Mr&&Mr.versions||Ar&&Ar.version,Br=Fr&&Fr.v8,$,W;Br&&($=Br.split("."),W=$[0]>0&&$[0]<4?1:+($[0]+$[1]));!W&&Q&&($=Q.match(/Edge\/(\d+)/),(!$||$[1]>=74)&&($=Q.match(/Chrome\/(\d+)/),$&&(W=+$[1])));var Te=W,Lr=Te,Ot=h,St=f,Et=St.String,we=!!Object.getOwnPropertySymbols&&!Ot(function(){var r=Symbol("symbol detection");return!Et(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Lr&&Lr<41}),Tt=we,Ie=Tt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",wt=ge,It=d,mt=Oe,Rt=Ie,Pt=Object,me=Rt?function(r){return typeof r=="symbol"}:function(r){var e=wt("Symbol");return It(e)&&mt(e.prototype,Pt(r))},Ct=String,Tr=function(r){try{return Ct(r)}catch{return"Object"}},jt=d,Nt=Tr,_t=TypeError,D=function(r){if(jt(r))return r;throw new _t(Nt(r)+" is not a function")},Dt=D,Mt=Sr,wr=function(r,e){var t=r[e];return Mt(t)?void 0:Dt(t)},rr=O,er=d,tr=_,At=TypeError,Ft=function(r,e){var t,n;if(e==="string"&&er(t=r.toString)&&!tr(n=rr(t,r))||er(t=r.valueOf)&&!tr(n=rr(t,r))||e!=="string"&&er(t=r.toString)&&!tr(n=rr(t,r)))return n;throw new At("Can't convert object to primitive value")},Re={exports:{}},Ur=f,Bt=Object.defineProperty,Ir=function(r,e){try{Bt(Ur,r,{value:e,configurable:!0,writable:!0})}catch{Ur[r]=e}return e},Lt=f,Ut=Ir,Gr="__core-js_shared__",xr=Re.exports=Lt[Gr]||Ut(Gr,{});(xr.versions||(xr.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var mr=Re.exports,Kr=mr,Pe=function(r,e){return Kr[r]||(Kr[r]=e||{})},Gt=he,xt=Object,Kt=function(r){return xt(Gt(r))},Vt=b,kt=Kt,Wt=Vt({}.hasOwnProperty),S=Object.hasOwn||function(e,t){return Wt(kt(e),t)},zt=b,Yt=0,qt=Math.random(),Jt=zt(1 .toString),Ce=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Jt(++Yt+qt,36)},Ht=f,Xt=Pe,Vr=S,Zt=Ce,Qt=we,rn=Ie,m=Ht.Symbol,nr=Xt("wks"),en=rn?m.for||m:m&&m.withoutSetter||Zt,E=function(r){return Vr(nr,r)||(nr[r]=Qt&&Vr(m,r)?m[r]:en("Symbol."+r)),nr[r]},tn=O,kr=_,Wr=me,nn=wr,an=Ft,on=E,vn=TypeError,un=on("toPrimitive"),cn=function(r,e){if(!kr(r)||Wr(r))return r;var t=nn(r,un),n;if(t){if(e===void 0&&(e="default"),n=tn(t,r,e),!kr(n)||Wr(n))return n;throw new vn("Can't convert object to primitive value")}return e===void 0&&(e="number"),an(r,e)},ln=cn,fn=me,je=function(r){var e=ln(r,"string");return fn(e)?e:e+""},sn=f,zr=_,yr=sn.document,yn=zr(yr)&&zr(yr.createElement),dn=function(r){return yn?yr.createElement(r):{}},$n=g,pn=h,bn=dn,Ne=!$n&&!pn(function(){return Object.defineProperty(bn("div"),"a",{get:function(){return 7}}).a!==7}),hn=g,gn=O,On=fe,Sn=de,En=Er,Tn=je,wn=S,In=Ne,Yr=Object.getOwnPropertyDescriptor;gr.f=hn?Yr:function(e,t){if(e=En(e),t=Tn(t),In)try{return Yr(e,t)}catch{}if(wn(e,t))return Sn(!gn(On.f,e,t),e[t])};var J={},mn=g,Rn=h,Pn=mn&&Rn(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Cn=_,jn=String,Nn=TypeError,M=function(r){if(Cn(r))return r;throw new Nn(jn(r)+" is not an object")},_n=g,Dn=Ne,Mn=Pn,L=M,qr=je,An=TypeError,ar=Object.defineProperty,Fn=Object.getOwnPropertyDescriptor,or="enumerable",ir="configurable",vr="writable";J.f=_n?Mn?function(e,t,n){if(L(e),t=qr(t),L(n),typeof e=="function"&&t==="prototype"&&"value"in n&&vr in n&&!n[vr]){var a=Fn(e,t);a&&a[vr]&&(e[t]=n.value,n={configurable:ir in n?n[ir]:a[ir],enumerable:or in n?n[or]:a[or],writable:!1})}return ar(e,t,n)}:ar:function(e,t,n){if(L(e),t=qr(t),L(n),Dn)try{return ar(e,t,n)}catch{}if("get"in n||"set"in n)throw new An("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Bn=g,Ln=J,Un=de,_e=Bn?function(r,e,t){return Ln.f(r,e,Un(1,t))}:function(r,e,t){return r[e]=t,r},De={exports:{}},dr=g,Gn=S,Me=Function.prototype,xn=dr&&Object.getOwnPropertyDescriptor,Rr=Gn(Me,"name"),Kn=Rr&&function(){}.name==="something",Vn=Rr&&(!dr||dr&&xn(Me,"name").configurable),kn={EXISTS:Rr,PROPER:Kn,CONFIGURABLE:Vn},Wn=b,zn=d,$r=mr,Yn=Wn(Function.toString);zn($r.inspectSource)||($r.inspectSource=function(r){return Yn(r)});var Ae=$r.inspectSource,qn=f,Jn=d,Jr=qn.WeakMap,Hn=Jn(Jr)&&/native code/.test(String(Jr)),Xn=Pe,Zn=Ce,Hr=Xn("keys"),Qn=function(r){return Hr[r]||(Hr[r]=Zn(r))},Fe={},ra=Hn,Be=f,ea=_,ta=_e,ur=S,cr=mr,na=Qn,aa=Fe,Xr="Object already initialized",pr=Be.TypeError,oa=Be.WeakMap,z,N,Y,ia=function(r){return Y(r)?N(r):z(r,{})},va=function(r){return function(e){var t;if(!ea(e)||(t=N(e)).type!==r)throw new pr("Incompatible receiver, "+r+" required");return t}};if(ra||cr.state){var p=cr.state||(cr.state=new oa);p.get=p.get,p.has=p.has,p.set=p.set,z=function(r,e){if(p.has(r))throw new pr(Xr);return e.facade=r,p.set(r,e),e},N=function(r){return p.get(r)||{}},Y=function(r){return p.has(r)}}else{var I=na("state");aa[I]=!0,z=function(r,e){if(ur(r,I))throw new pr(Xr);return e.facade=r,ta(r,I,e),e},N=function(r){return ur(r,I)?r[I]:{}},Y=function(r){return ur(r,I)}}var ua={set:z,get:N,has:Y,enforce:ia,getterFor:va},Pr=b,ca=h,la=d,U=S,br=g,fa=kn.CONFIGURABLE,sa=Ae,Le=ua,ya=Le.enforce,da=Le.get,Zr=String,K=Object.defineProperty,$a=Pr("".slice),pa=Pr("".replace),ba=Pr([].join),ha=br&&!ca(function(){return K(function(){},"length",{value:8}).length!==8}),ga=String(String).split("String"),Oa=De.exports=function(r,e,t){$a(Zr(e),0,7)==="Symbol("&&(e="["+pa(Zr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!U(r,"name")||fa&&r.name!==e)&&(br?K(r,"name",{value:e,configurable:!0}):r.name=e),ha&&t&&U(t,"arity")&&r.length!==t.arity&&K(r,"length",{value:t.arity});try{t&&U(t,"constructor")&&t.constructor?br&&K(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var n=ya(r);return U(n,"source")||(n.source=ba(ga,typeof e=="string"?e:"")),r};Function.prototype.toString=Oa(function(){return la(this)&&da(this).source||sa(this)},"toString");var Sa=De.exports,Ea=d,Ta=J,wa=Sa,Ia=Ir,ma=function(r,e,t,n){n||(n={});var a=n.enumerable,o=n.name!==void 0?n.name:e;if(Ea(t)&&wa(t,o,n),n.global)a?r[e]=t:Ia(e,t);else{try{n.unsafe?r[e]&&(a=!0):delete r[e]}catch{}a?r[e]=t:Ta.f(r,e,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return r},Ue={},Ra=Math.ceil,Pa=Math.floor,Ca=Math.trunc||function(e){var t=+e;return(t>0?Pa:Ra)(t)},ja=Ca,Ge=function(r){var e=+r;return e!==e||e===0?0:ja(e)},Na=Ge,_a=Math.max,Da=Math.min,Ma=function(r,e){var t=Na(r);return t<0?_a(t+e,0):Da(t,e)},Aa=Ge,Fa=Math.min,Ba=function(r){var e=Aa(r);return e>0?Fa(e,9007199254740991):0},La=Ba,xe=function(r){return La(r.length)},Ua=Er,Ga=Ma,xa=xe,Qr=function(r){return function(e,t,n){var a=Ua(e),o=xa(a);if(o===0)return!r&&-1;var i=Ga(n,o),v;if(r&&t!==t){for(;o>i;)if(v=a[i++],v!==v)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},Ka={includes:Qr(!0),indexOf:Qr(!1)},Va=b,lr=S,ka=Er,Wa=Ka.indexOf,za=Fe,re=Va([].push),Ya=function(r,e){var t=ka(r),n=0,a=[],o;for(o in t)!lr(za,o)&&lr(t,o)&&re(a,o);for(;e.length>n;)lr(t,o=e[n++])&&(~Wa(a,o)||re(a,o));return a},qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ja=Ya,Ha=qa,Xa=Ha.concat("length","prototype");Ue.f=Object.getOwnPropertyNames||function(e){return Ja(e,Xa)};var Ke={};Ke.f=Object.getOwnPropertySymbols;var Za=ge,Qa=b,ro=Ue,eo=Ke,to=M,no=Qa([].concat),ao=Za("Reflect","ownKeys")||function(e){var t=ro.f(to(e)),n=eo.f;return n?no(t,n(e)):t},ee=S,oo=ao,io=gr,vo=J,uo=function(r,e,t){for(var n=oo(e),a=vo.f,o=io.f,i=0;i<n.length;i++){var v=n[i];!ee(r,v)&&!(t&&ee(t,v))&&a(r,v,o(e,v))}},co=h,lo=d,fo=/#|\.prototype\./,A=function(r,e){var t=yo[so(r)];return t===po?!0:t===$o?!1:lo(e)?co(e):!!e},so=A.normalize=function(r){return String(r).replace(fo,".").toLowerCase()},yo=A.data={},$o=A.NATIVE="N",po=A.POLYFILL="P",Ve=A,G=f,bo=gr.f,ho=_e,go=ma,Oo=Ir,So=uo,Eo=Ve,To=function(r,e){var t=r.target,n=r.global,a=r.stat,o,i,v,u,c,s;if(n?i=G:a?i=G[t]||Oo(t,{}):i=G[t]&&G[t].prototype,i)for(v in e){if(c=e[v],r.dontCallGetSet?(s=bo(i,v),u=s&&s.value):u=i[v],o=Eo(n?v:t+(a?".":"#")+v,r.forced),!o&&u!==void 0){if(typeof c==typeof u)continue;So(c,u)}(r.sham||u&&u.sham)&&ho(c,"sham",!0),go(i,v,c,r)}},ke={},te=D,wo=TypeError,Io=function(r){var e,t;this.promise=new r(function(n,a){if(e!==void 0||t!==void 0)throw new wo("Bad Promise constructor");e=n,t=a}),this.resolve=te(e),this.reject=te(t)};ke.f=function(r){return new Io(r)};var mo=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}},Ro=q,Po=b,Co=function(r){if(Ro(r)==="Function")return Po(r)},ne=Co,jo=D,No=Or,_o=ne(ne.bind),Do=function(r,e){return jo(r),e===void 0?r:No?_o(r,e):function(){return r.apply(e,arguments)}},We={},Mo=E,Ao=We,Fo=Mo("iterator"),Bo=Array.prototype,Lo=function(r){return r!==void 0&&(Ao.Array===r||Bo[Fo]===r)},Uo=E,Go=Uo("toStringTag"),ze={};ze[Go]="z";var xo=String(ze)==="[object z]",Ko=xo,Vo=d,V=q,ko=E,Wo=ko("toStringTag"),zo=Object,Yo=V(function(){return arguments}())==="Arguments",qo=function(r,e){try{return r[e]}catch{}},Jo=Ko?V:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=qo(e=zo(r),Wo))=="string"?t:Yo?V(e):(n=V(e))==="Object"&&Vo(e.callee)?"Arguments":n},Ho=Jo,ae=wr,Xo=Sr,Zo=We,Qo=E,ri=Qo("iterator"),Ye=function(r){if(!Xo(r))return ae(r,ri)||ae(r,"@@iterator")||Zo[Ho(r)]},ei=O,ti=D,ni=M,ai=Tr,oi=Ye,ii=TypeError,vi=function(r,e){var t=arguments.length<2?oi(r):e;if(ti(t))return ni(ei(t,r));throw new ii(ai(r)+" is not iterable")},ui=O,oe=M,ci=wr,li=function(r,e,t){var n,a;oe(r);try{if(n=ci(r,"return"),!n){if(e==="throw")throw t;return t}n=ui(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return oe(n),t},fi=Do,si=O,yi=M,di=Tr,$i=Lo,pi=xe,ie=Oe,bi=vi,hi=Ye,ve=li,gi=TypeError,k=function(r,e){this.stopped=r,this.result=e},ue=k.prototype,Oi=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),v=!!(t&&t.INTERRUPTED),u=fi(e,n),c,s,T,R,l,w,Cr,jr=function(y){return c&&ve(c,"normal",y),new k(!0,y)},Nr=function(y){return a?(yi(y),v?u(y[0],y[1],jr):u(y[0],y[1])):v?u(y,jr):u(y)};if(o)c=r.iterator;else if(i)c=r;else{if(s=hi(r),!s)throw new gi(di(r)+" is not iterable");if($i(s)){for(T=0,R=pi(r);R>T;T++)if(l=Nr(r[T]),l&&ie(ue,l))return l;return new k(!1)}c=bi(r,s)}for(w=o?r.next:c.next;!(Cr=si(w,c)).done;){try{l=Nr(Cr.value)}catch(y){ve(c,"throw",y)}if(typeof l=="object"&&l&&ie(ue,l))return l}return new k(!1)},Si=f,qe=Si.Promise,Ei=E,Je=Ei("iterator"),He=!1;try{var Ti=0,ce={next:function(){return{done:!!Ti++}},return:function(){He=!0}};ce[Je]=function(){return this},Array.from(ce,function(){throw 2})}catch{}var wi=function(r,e){try{if(!e&&!He)return!1}catch{return!1}var t=!1;try{var n={};n[Je]=function(){return{next:function(){return{done:t=!0}}}},r(n)}catch{}return t},C=f,Ii=Se,mi=q,x=function(r){return Ii.slice(0,r.length)===r},Ri=function(){return x("Bun/")?"BUN":x("Cloudflare-Workers")?"CLOUDFLARE":x("Deno/")?"DENO":x("Node.js/")?"NODE":C.Bun&&typeof Bun.version=="string"?"BUN":C.Deno&&typeof Deno.version=="object"?"DENO":mi(C.process)==="process"?"NODE":C.window&&C.document?"BROWSER":"REST"}(),Pi=f,j=qe,Ci=d,ji=Ve,Ni=Ae,_i=E,le=Ri,fr=Te;j&&j.prototype;var Di=_i("species"),hr=!1,Xe=Ci(Pi.PromiseRejectionEvent),Mi=ji("Promise",function(){var r=Ni(j),e=r!==String(j);if(!e&&fr===66)return!0;if(!fr||fr<51||!/native code/.test(r)){var t=new j(function(o){o(1)}),n=function(o){o(function(){},function(){})},a=t.constructor={};if(a[Di]=n,hr=t.then(function(){})instanceof n,!hr)return!0}return!e&&(le==="BROWSER"||le==="DENO")&&!Xe}),Ai={CONSTRUCTOR:Mi,REJECTION_EVENT:Xe,SUBCLASSING:hr},Fi=qe,Bi=wi,Li=Ai.CONSTRUCTOR,Ui=Li||!Bi(function(r){Fi.all(r).then(void 0,function(){})}),Gi=To,xi=O,Ki=D,Vi=ke,ki=mo,Wi=Oi,zi=Ui;Gi({target:"Promise",stat:!0,forced:zi},{allSettled:function(e){var t=this,n=Vi.f(t),a=n.resolve,o=n.reject,i=ki(function(){var v=Ki(t.resolve),u=[],c=0,s=1;Wi(e,function(T){var R=c++,l=!1;s++,xi(v,t,T).then(function(w){l||(l=!0,u[R]={status:"fulfilled",value:w},--s||a(u))},function(w){l||(l=!0,u[R]={status:"rejected",reason:w},--s||a(u))})}),--s||a(u)});return i.error&&o(i.value),n.promise}});export{F as c,Yi as g};
|
|
1
|
+
(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="65ee9248-4a9c-440a-ac1b-f8f709e3299d",r._sentryDebugIdIdentifier="sentry-dbid-65ee9248-4a9c-440a-ac1b-f8f709e3299d")}catch{}})();var Ze=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Ze.SENTRY_RELEASE={id:"b866a83f88792a060d6296480640ed33fd925d32"};var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var P=function(r){return r&&r.Math===Math&&r},f=P(typeof globalThis=="object"&&globalThis)||P(typeof window=="object"&&window)||P(typeof self=="object"&&self)||P(typeof F=="object"&&F)||P(typeof F=="object"&&F)||function(){return this}()||Function("return this")(),gr={},h=function(r){try{return!!r()}catch{return!0}},Qe=h,g=!Qe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),rt=h,Or=!rt(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),et=Or,B=Function.prototype.call,O=et?B.bind(B):function(){return B.apply(B,arguments)},fe={},se={}.propertyIsEnumerable,ye=Object.getOwnPropertyDescriptor,tt=ye&&!se.call({1:2},1);fe.f=tt?function(e){var t=ye(this,e);return!!t&&t.enumerable}:se;var de=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},$e=Or,pe=Function.prototype,sr=pe.call,nt=$e&&pe.bind.bind(sr,sr),b=$e?nt:function(r){return function(){return sr.apply(r,arguments)}},be=b,at=be({}.toString),ot=be("".slice),q=function(r){return ot(at(r),8,-1)},it=b,vt=h,ut=q,H=Object,ct=it("".split),lt=vt(function(){return!H("z").propertyIsEnumerable(0)})?function(r){return ut(r)==="String"?ct(r,""):H(r)}:H,Sr=function(r){return r==null},ft=Sr,st=TypeError,he=function(r){if(ft(r))throw new st("Can't call method on "+r);return r},yt=lt,dt=he,Er=function(r){return yt(dt(r))},X=typeof document=="object"&&document.all,d=typeof X>"u"&&X!==void 0?function(r){return typeof r=="function"||r===X}:function(r){return typeof r=="function"},$t=d,_=function(r){return typeof r=="object"?r!==null:$t(r)},Z=f,pt=d,bt=function(r){return pt(r)?r:void 0},ge=function(r,e){return arguments.length<2?bt(Z[r]):Z[r]&&Z[r][e]},ht=b,Oe=ht({}.isPrototypeOf),gt=f,_r=gt.navigator,Dr=_r&&_r.userAgent,Se=Dr?String(Dr):"",Ee=f,Q=Se,Mr=Ee.process,Ar=Ee.Deno,Fr=Mr&&Mr.versions||Ar&&Ar.version,Br=Fr&&Fr.v8,$,W;Br&&($=Br.split("."),W=$[0]>0&&$[0]<4?1:+($[0]+$[1]));!W&&Q&&($=Q.match(/Edge\/(\d+)/),(!$||$[1]>=74)&&($=Q.match(/Chrome\/(\d+)/),$&&(W=+$[1])));var Te=W,Lr=Te,Ot=h,St=f,Et=St.String,we=!!Object.getOwnPropertySymbols&&!Ot(function(){var r=Symbol("symbol detection");return!Et(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Lr&&Lr<41}),Tt=we,Ie=Tt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",wt=ge,It=d,mt=Oe,Rt=Ie,Pt=Object,me=Rt?function(r){return typeof r=="symbol"}:function(r){var e=wt("Symbol");return It(e)&&mt(e.prototype,Pt(r))},Ct=String,Tr=function(r){try{return Ct(r)}catch{return"Object"}},jt=d,Nt=Tr,_t=TypeError,D=function(r){if(jt(r))return r;throw new _t(Nt(r)+" is not a function")},Dt=D,Mt=Sr,wr=function(r,e){var t=r[e];return Mt(t)?void 0:Dt(t)},rr=O,er=d,tr=_,At=TypeError,Ft=function(r,e){var t,n;if(e==="string"&&er(t=r.toString)&&!tr(n=rr(t,r))||er(t=r.valueOf)&&!tr(n=rr(t,r))||e!=="string"&&er(t=r.toString)&&!tr(n=rr(t,r)))return n;throw new At("Can't convert object to primitive value")},Re={exports:{}},Ur=f,Bt=Object.defineProperty,Ir=function(r,e){try{Bt(Ur,r,{value:e,configurable:!0,writable:!0})}catch{Ur[r]=e}return e},Lt=f,Ut=Ir,Gr="__core-js_shared__",xr=Re.exports=Lt[Gr]||Ut(Gr,{});(xr.versions||(xr.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var mr=Re.exports,Kr=mr,Pe=function(r,e){return Kr[r]||(Kr[r]=e||{})},Gt=he,xt=Object,Kt=function(r){return xt(Gt(r))},Vt=b,kt=Kt,Wt=Vt({}.hasOwnProperty),S=Object.hasOwn||function(e,t){return Wt(kt(e),t)},zt=b,Yt=0,qt=Math.random(),Jt=zt(1 .toString),Ce=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Jt(++Yt+qt,36)},Ht=f,Xt=Pe,Vr=S,Zt=Ce,Qt=we,rn=Ie,m=Ht.Symbol,nr=Xt("wks"),en=rn?m.for||m:m&&m.withoutSetter||Zt,E=function(r){return Vr(nr,r)||(nr[r]=Qt&&Vr(m,r)?m[r]:en("Symbol."+r)),nr[r]},tn=O,kr=_,Wr=me,nn=wr,an=Ft,on=E,vn=TypeError,un=on("toPrimitive"),cn=function(r,e){if(!kr(r)||Wr(r))return r;var t=nn(r,un),n;if(t){if(e===void 0&&(e="default"),n=tn(t,r,e),!kr(n)||Wr(n))return n;throw new vn("Can't convert object to primitive value")}return e===void 0&&(e="number"),an(r,e)},ln=cn,fn=me,je=function(r){var e=ln(r,"string");return fn(e)?e:e+""},sn=f,zr=_,yr=sn.document,yn=zr(yr)&&zr(yr.createElement),dn=function(r){return yn?yr.createElement(r):{}},$n=g,pn=h,bn=dn,Ne=!$n&&!pn(function(){return Object.defineProperty(bn("div"),"a",{get:function(){return 7}}).a!==7}),hn=g,gn=O,On=fe,Sn=de,En=Er,Tn=je,wn=S,In=Ne,Yr=Object.getOwnPropertyDescriptor;gr.f=hn?Yr:function(e,t){if(e=En(e),t=Tn(t),In)try{return Yr(e,t)}catch{}if(wn(e,t))return Sn(!gn(On.f,e,t),e[t])};var J={},mn=g,Rn=h,Pn=mn&&Rn(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Cn=_,jn=String,Nn=TypeError,M=function(r){if(Cn(r))return r;throw new Nn(jn(r)+" is not an object")},_n=g,Dn=Ne,Mn=Pn,L=M,qr=je,An=TypeError,ar=Object.defineProperty,Fn=Object.getOwnPropertyDescriptor,or="enumerable",ir="configurable",vr="writable";J.f=_n?Mn?function(e,t,n){if(L(e),t=qr(t),L(n),typeof e=="function"&&t==="prototype"&&"value"in n&&vr in n&&!n[vr]){var a=Fn(e,t);a&&a[vr]&&(e[t]=n.value,n={configurable:ir in n?n[ir]:a[ir],enumerable:or in n?n[or]:a[or],writable:!1})}return ar(e,t,n)}:ar:function(e,t,n){if(L(e),t=qr(t),L(n),Dn)try{return ar(e,t,n)}catch{}if("get"in n||"set"in n)throw new An("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Bn=g,Ln=J,Un=de,_e=Bn?function(r,e,t){return Ln.f(r,e,Un(1,t))}:function(r,e,t){return r[e]=t,r},De={exports:{}},dr=g,Gn=S,Me=Function.prototype,xn=dr&&Object.getOwnPropertyDescriptor,Rr=Gn(Me,"name"),Kn=Rr&&function(){}.name==="something",Vn=Rr&&(!dr||dr&&xn(Me,"name").configurable),kn={EXISTS:Rr,PROPER:Kn,CONFIGURABLE:Vn},Wn=b,zn=d,$r=mr,Yn=Wn(Function.toString);zn($r.inspectSource)||($r.inspectSource=function(r){return Yn(r)});var Ae=$r.inspectSource,qn=f,Jn=d,Jr=qn.WeakMap,Hn=Jn(Jr)&&/native code/.test(String(Jr)),Xn=Pe,Zn=Ce,Hr=Xn("keys"),Qn=function(r){return Hr[r]||(Hr[r]=Zn(r))},Fe={},ra=Hn,Be=f,ea=_,ta=_e,ur=S,cr=mr,na=Qn,aa=Fe,Xr="Object already initialized",pr=Be.TypeError,oa=Be.WeakMap,z,N,Y,ia=function(r){return Y(r)?N(r):z(r,{})},va=function(r){return function(e){var t;if(!ea(e)||(t=N(e)).type!==r)throw new pr("Incompatible receiver, "+r+" required");return t}};if(ra||cr.state){var p=cr.state||(cr.state=new oa);p.get=p.get,p.has=p.has,p.set=p.set,z=function(r,e){if(p.has(r))throw new pr(Xr);return e.facade=r,p.set(r,e),e},N=function(r){return p.get(r)||{}},Y=function(r){return p.has(r)}}else{var I=na("state");aa[I]=!0,z=function(r,e){if(ur(r,I))throw new pr(Xr);return e.facade=r,ta(r,I,e),e},N=function(r){return ur(r,I)?r[I]:{}},Y=function(r){return ur(r,I)}}var ua={set:z,get:N,has:Y,enforce:ia,getterFor:va},Pr=b,ca=h,la=d,U=S,br=g,fa=kn.CONFIGURABLE,sa=Ae,Le=ua,ya=Le.enforce,da=Le.get,Zr=String,K=Object.defineProperty,$a=Pr("".slice),pa=Pr("".replace),ba=Pr([].join),ha=br&&!ca(function(){return K(function(){},"length",{value:8}).length!==8}),ga=String(String).split("String"),Oa=De.exports=function(r,e,t){$a(Zr(e),0,7)==="Symbol("&&(e="["+pa(Zr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!U(r,"name")||fa&&r.name!==e)&&(br?K(r,"name",{value:e,configurable:!0}):r.name=e),ha&&t&&U(t,"arity")&&r.length!==t.arity&&K(r,"length",{value:t.arity});try{t&&U(t,"constructor")&&t.constructor?br&&K(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var n=ya(r);return U(n,"source")||(n.source=ba(ga,typeof e=="string"?e:"")),r};Function.prototype.toString=Oa(function(){return la(this)&&da(this).source||sa(this)},"toString");var Sa=De.exports,Ea=d,Ta=J,wa=Sa,Ia=Ir,ma=function(r,e,t,n){n||(n={});var a=n.enumerable,o=n.name!==void 0?n.name:e;if(Ea(t)&&wa(t,o,n),n.global)a?r[e]=t:Ia(e,t);else{try{n.unsafe?r[e]&&(a=!0):delete r[e]}catch{}a?r[e]=t:Ta.f(r,e,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return r},Ue={},Ra=Math.ceil,Pa=Math.floor,Ca=Math.trunc||function(e){var t=+e;return(t>0?Pa:Ra)(t)},ja=Ca,Ge=function(r){var e=+r;return e!==e||e===0?0:ja(e)},Na=Ge,_a=Math.max,Da=Math.min,Ma=function(r,e){var t=Na(r);return t<0?_a(t+e,0):Da(t,e)},Aa=Ge,Fa=Math.min,Ba=function(r){var e=Aa(r);return e>0?Fa(e,9007199254740991):0},La=Ba,xe=function(r){return La(r.length)},Ua=Er,Ga=Ma,xa=xe,Qr=function(r){return function(e,t,n){var a=Ua(e),o=xa(a);if(o===0)return!r&&-1;var i=Ga(n,o),v;if(r&&t!==t){for(;o>i;)if(v=a[i++],v!==v)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},Ka={includes:Qr(!0),indexOf:Qr(!1)},Va=b,lr=S,ka=Er,Wa=Ka.indexOf,za=Fe,re=Va([].push),Ya=function(r,e){var t=ka(r),n=0,a=[],o;for(o in t)!lr(za,o)&&lr(t,o)&&re(a,o);for(;e.length>n;)lr(t,o=e[n++])&&(~Wa(a,o)||re(a,o));return a},qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ja=Ya,Ha=qa,Xa=Ha.concat("length","prototype");Ue.f=Object.getOwnPropertyNames||function(e){return Ja(e,Xa)};var Ke={};Ke.f=Object.getOwnPropertySymbols;var Za=ge,Qa=b,ro=Ue,eo=Ke,to=M,no=Qa([].concat),ao=Za("Reflect","ownKeys")||function(e){var t=ro.f(to(e)),n=eo.f;return n?no(t,n(e)):t},ee=S,oo=ao,io=gr,vo=J,uo=function(r,e,t){for(var n=oo(e),a=vo.f,o=io.f,i=0;i<n.length;i++){var v=n[i];!ee(r,v)&&!(t&&ee(t,v))&&a(r,v,o(e,v))}},co=h,lo=d,fo=/#|\.prototype\./,A=function(r,e){var t=yo[so(r)];return t===po?!0:t===$o?!1:lo(e)?co(e):!!e},so=A.normalize=function(r){return String(r).replace(fo,".").toLowerCase()},yo=A.data={},$o=A.NATIVE="N",po=A.POLYFILL="P",Ve=A,G=f,bo=gr.f,ho=_e,go=ma,Oo=Ir,So=uo,Eo=Ve,To=function(r,e){var t=r.target,n=r.global,a=r.stat,o,i,v,u,c,s;if(n?i=G:a?i=G[t]||Oo(t,{}):i=G[t]&&G[t].prototype,i)for(v in e){if(c=e[v],r.dontCallGetSet?(s=bo(i,v),u=s&&s.value):u=i[v],o=Eo(n?v:t+(a?".":"#")+v,r.forced),!o&&u!==void 0){if(typeof c==typeof u)continue;So(c,u)}(r.sham||u&&u.sham)&&ho(c,"sham",!0),go(i,v,c,r)}},ke={},te=D,wo=TypeError,Io=function(r){var e,t;this.promise=new r(function(n,a){if(e!==void 0||t!==void 0)throw new wo("Bad Promise constructor");e=n,t=a}),this.resolve=te(e),this.reject=te(t)};ke.f=function(r){return new Io(r)};var mo=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}},Ro=q,Po=b,Co=function(r){if(Ro(r)==="Function")return Po(r)},ne=Co,jo=D,No=Or,_o=ne(ne.bind),Do=function(r,e){return jo(r),e===void 0?r:No?_o(r,e):function(){return r.apply(e,arguments)}},We={},Mo=E,Ao=We,Fo=Mo("iterator"),Bo=Array.prototype,Lo=function(r){return r!==void 0&&(Ao.Array===r||Bo[Fo]===r)},Uo=E,Go=Uo("toStringTag"),ze={};ze[Go]="z";var xo=String(ze)==="[object z]",Ko=xo,Vo=d,V=q,ko=E,Wo=ko("toStringTag"),zo=Object,Yo=V(function(){return arguments}())==="Arguments",qo=function(r,e){try{return r[e]}catch{}},Jo=Ko?V:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=qo(e=zo(r),Wo))=="string"?t:Yo?V(e):(n=V(e))==="Object"&&Vo(e.callee)?"Arguments":n},Ho=Jo,ae=wr,Xo=Sr,Zo=We,Qo=E,ri=Qo("iterator"),Ye=function(r){if(!Xo(r))return ae(r,ri)||ae(r,"@@iterator")||Zo[Ho(r)]},ei=O,ti=D,ni=M,ai=Tr,oi=Ye,ii=TypeError,vi=function(r,e){var t=arguments.length<2?oi(r):e;if(ti(t))return ni(ei(t,r));throw new ii(ai(r)+" is not iterable")},ui=O,oe=M,ci=wr,li=function(r,e,t){var n,a;oe(r);try{if(n=ci(r,"return"),!n){if(e==="throw")throw t;return t}n=ui(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return oe(n),t},fi=Do,si=O,yi=M,di=Tr,$i=Lo,pi=xe,ie=Oe,bi=vi,hi=Ye,ve=li,gi=TypeError,k=function(r,e){this.stopped=r,this.result=e},ue=k.prototype,Oi=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),v=!!(t&&t.INTERRUPTED),u=fi(e,n),c,s,T,R,l,w,Cr,jr=function(y){return c&&ve(c,"normal",y),new k(!0,y)},Nr=function(y){return a?(yi(y),v?u(y[0],y[1],jr):u(y[0],y[1])):v?u(y,jr):u(y)};if(o)c=r.iterator;else if(i)c=r;else{if(s=hi(r),!s)throw new gi(di(r)+" is not iterable");if($i(s)){for(T=0,R=pi(r);R>T;T++)if(l=Nr(r[T]),l&&ie(ue,l))return l;return new k(!1)}c=bi(r,s)}for(w=o?r.next:c.next;!(Cr=si(w,c)).done;){try{l=Nr(Cr.value)}catch(y){ve(c,"throw",y)}if(typeof l=="object"&&l&&ie(ue,l))return l}return new k(!1)},Si=f,qe=Si.Promise,Ei=E,Je=Ei("iterator"),He=!1;try{var Ti=0,ce={next:function(){return{done:!!Ti++}},return:function(){He=!0}};ce[Je]=function(){return this},Array.from(ce,function(){throw 2})}catch{}var wi=function(r,e){try{if(!e&&!He)return!1}catch{return!1}var t=!1;try{var n={};n[Je]=function(){return{next:function(){return{done:t=!0}}}},r(n)}catch{}return t},C=f,Ii=Se,mi=q,x=function(r){return Ii.slice(0,r.length)===r},Ri=function(){return x("Bun/")?"BUN":x("Cloudflare-Workers")?"CLOUDFLARE":x("Deno/")?"DENO":x("Node.js/")?"NODE":C.Bun&&typeof Bun.version=="string"?"BUN":C.Deno&&typeof Deno.version=="object"?"DENO":mi(C.process)==="process"?"NODE":C.window&&C.document?"BROWSER":"REST"}(),Pi=f,j=qe,Ci=d,ji=Ve,Ni=Ae,_i=E,le=Ri,fr=Te;j&&j.prototype;var Di=_i("species"),hr=!1,Xe=Ci(Pi.PromiseRejectionEvent),Mi=ji("Promise",function(){var r=Ni(j),e=r!==String(j);if(!e&&fr===66)return!0;if(!fr||fr<51||!/native code/.test(r)){var t=new j(function(o){o(1)}),n=function(o){o(function(){},function(){})},a=t.constructor={};if(a[Di]=n,hr=t.then(function(){})instanceof n,!hr)return!0}return!e&&(le==="BROWSER"||le==="DENO")&&!Xe}),Ai={CONSTRUCTOR:Mi,REJECTION_EVENT:Xe,SUBCLASSING:hr},Fi=qe,Bi=wi,Li=Ai.CONSTRUCTOR,Ui=Li||!Bi(function(r){Fi.all(r).then(void 0,function(){})}),Gi=To,xi=O,Ki=D,Vi=ke,ki=mo,Wi=Oi,zi=Ui;Gi({target:"Promise",stat:!0,forced:zi},{allSettled:function(e){var t=this,n=Vi.f(t),a=n.resolve,o=n.reject,i=ki(function(){var v=Ki(t.resolve),u=[],c=0,s=1;Wi(e,function(T){var R=c++,l=!1;s++,xi(v,t,T).then(function(w){l||(l=!0,u[R]={status:"fulfilled",value:w},--s||a(u))},function(w){l||(l=!0,u[R]={status:"rejected",reason:w},--s||a(u))})}),--s||a(u)});return i.error&&o(i.value),n.promise}});export{F as c,Yi as g};
|
|
2
2
|
//# sourceMappingURL=vendor.core-js.js.map
|