userflow.js-self-hosted 0.1.1003662 → 0.1.1003698

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/ChecklistApp.js CHANGED
@@ -1 +1 @@
1
- import{r as e}from"./vendor.react.js";import{I as t,A as s,H as o,j as n}from"./userflow.js";import{F as i}from"./FlowChrome.js";import{i as r,u as c}from"./client-context.js";import{w as l,C as a,S as u}from"./z-index.js";import{f as m,B as d}from"./BubbleToolbar.js";import{a as h,D as p,u as f}from"./stylesheets.js";import{F as k}from"./logomark.js";import{o as b}from"./vendor.obj-str.js";import{z as v}from"./flow-condition-types.js";import{C as j}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{u as E}from"./vendor.react-i18next.js";import{C as x}from"./ChecklistUI.js";import"./vendor.object-assign.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.i18next.js";import"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.react-dom.js";import"./vendor.scheduler.js";import"./vendor.date-fns.js";import"./vendor.babel.runtime.js";var g=new URL("checklist-launcher-frame.css",import.meta.url).href;const w=({position:s,theme:o,onClick:n,onVisibleChange:i,buttonRef:r,text:c,uncompletedCount:u})=>{const d=s||"absolute",{i18n:f}=E(),x=f.dir(),{loaded:w}=h(window,m,o),[y,L]=e.useState(!1),C=w&&y;e.useEffect((()=>{i&&i(C)}),[i,C]);const F=e.useRef(null),I=e.useRef(0),[A,T]=e.useState(null);e.useLayoutEffect((()=>{const e=F.current;if(!e||!A)return;const t=A.clientWidth;t!==I.current&&(I.current=t,e.style.setProperty("width",v(t)+"px","important"),e.style.setProperty("height",o.checklistLauncherHeight+"px","important"))}));const R=o.checklistLauncherPlacement,S=R===t.TOP_LEFT||R===t.TOP_RIGHT,N=R===t.TOP_LEFT||R===t.BOTTOM_LEFT,P={zIndex:"fixed"===d?null!=o.checklistZIndex?o.checklistZIndex:l(a):1,top:S?o.checklistLauncherY+"px":void 0,bottom:S?void 0:o.checklistLauncherY+"px",["ltr"===x?"left":"right"]:N?o.checklistLauncherX+"px":void 0,["ltr"===x?"right":"left"]:N?void 0:o.checklistLauncherX+"px",height:o.checklistLauncherHeight+"px",borderRadius:o.checklistLauncherBorderRadius+"px",position:C?void 0:"absolute",visibility:C?void 0:"hidden",animation:C?void 0:"none"};return e.createElement(k,{elRef:F,testId:"checklist-launcher-app",className:b({"userflowjs-checklist-launcher":!0,[`userflowjs-checklist-launcher--position-${d}`]:!0}),style:P,stylesheet:g,theme:o,onStylesheetsLoad:L},e.createElement("button",{ref:r,className:"userflowjs-checklist-launcher-frame-root",onClick:n},e.createElement("div",{ref:T,className:"userflowjs-checklist-launcher-content"},e.createElement("div",{className:"userflowjs-checklist-launcher-text"},c||"Get Started"),e.createElement("div",{"data-testid":"checklist-launcher-uncompleted-count",className:"userflowjs-checklist-launcher-uncompleted-count"},0===u?e.createElement(p,{icon:j}):u,e.createElement("div",{className:"userflowjs-a11y-only"},"uncompleted tasks")))))},y=({session:t,checklistExpanded:s})=>{const{version:o}=t,n=o.checklist,i=t.locale?t.locale.standardLocaleId:t.version.theme.languageId;e.useEffect((()=>{r.changeLanguage(i)}),[i]);const[c,l]=e.useState(!1);return s?e.createElement(L,{session:t,initialAutoFocus:c,setInitialAutoFocus:l}):n.launcherEnabled?e.createElement(C,{session:t,initialAutoFocus:c,setInitialAutoFocus:l}):null},L=({session:t,initialAutoFocus:n,setInitialAutoFocus:r})=>{const l=c(),[a,m]=e.useState(null),{version:h}=t,p=h.checklist,k=f(h.theme),b=e.useMemo((()=>({...k,avatarType:s.NONE,bubblePlacement:k.checklistPlacement,bubbleX:k.checklistX,bubbleY:k.checklistY,bubbleWidth:k.checklistWidth})),[k]);return e.useEffect((()=>{const e=a?.ownerDocument.defaultView;if(!e)return;const t=e=>{"Escape"===e.key&&(r(!0),l.hideChecklist())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}),[a,r,l]),e.createElement(u,null,e.createElement(i,{company:t.flow.company,theme:b,position:"fixed",stepAppearance:o.BUBBLE,zIndex:k.checklistZIndex,autoHide3pEnabled:!0,backgroundImageUrl:p.backgroundAsset&&p.backgroundAsset.assetUrl,bubbleFrameRootRef:m},e.createElement("div",{role:"dialog","aria-label":"Checklist"},e.createElement(x,{session:t,initialAutoFocus:n}),e.createElement(d,{draftMode:t.draftMode,minimize:e=>{r(0===e.detail),l.hideChecklist()}}))))},C=({session:t,initialAutoFocus:s,setInitialAutoFocus:o})=>{const i=c(),[r,l]=e.useState(!1),[a,u]=e.useState(null),{version:m}=t,d=m.checklist,h=f(m.theme);return e.useEffect((()=>{r&&a&&s&&a.focus()}),[i,a,r,s]),e.createElement(w,{position:"fixed",theme:h,onClick:e=>{o(0===e.detail),i.showChecklist()},onVisibleChange:l,buttonRef:u,text:d.launcherText,uncompletedCount:n(t)})};export default y;export{y as ChecklistApp};
1
+ import{r as e}from"./vendor.react.js";import{I as t,A as s,H as o,j as n}from"./userflow.js";import{F as i}from"./FlowChrome.js";import{i as r,u as c}from"./client-context.js";import{w as l,C as a,S as u}from"./z-index.js";import{f as m,B as d}from"./BubbleToolbar.js";import{a as h,D as p,u as f}from"./stylesheets.js";import{F as k}from"./logomark.js";import{o as b}from"./vendor.obj-str.js";import{z as v}from"./flow-condition-types.js";import{B as j}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{u as E}from"./vendor.react-i18next.js";import{C as x}from"./ChecklistUI.js";import"./vendor.object-assign.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.i18next.js";import"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.react-dom.js";import"./vendor.scheduler.js";import"./vendor.date-fns.js";import"./vendor.babel.runtime.js";var g=new URL("checklist-launcher-frame.css",import.meta.url).href;const w=({position:s,theme:o,onClick:n,onVisibleChange:i,buttonRef:r,text:c,uncompletedCount:u})=>{const d=s||"absolute",{i18n:f}=E(),x=f.dir(),{loaded:w}=h(window,m,o),[y,L]=e.useState(!1),F=w&&y;e.useEffect((()=>{i&&i(F)}),[i,F]);const I=e.useRef(null),C=e.useRef(0),[A,T]=e.useState(null);e.useLayoutEffect((()=>{const e=I.current;if(!e||!A)return;const t=A.clientWidth;t!==C.current&&(C.current=t,e.style.setProperty("width",v(t)+"px","important"),e.style.setProperty("height",o.checklistLauncherHeight+"px","important"))}));const R=o.checklistLauncherPlacement,S=R===t.TOP_LEFT||R===t.TOP_RIGHT,B=R===t.TOP_LEFT||R===t.BOTTOM_LEFT,N={zIndex:"fixed"===d?null!=o.checklistZIndex?o.checklistZIndex:l(a):1,top:S?o.checklistLauncherY+"px":void 0,bottom:S?void 0:o.checklistLauncherY+"px",["ltr"===x?"left":"right"]:B?o.checklistLauncherX+"px":void 0,["ltr"===x?"right":"left"]:B?void 0:o.checklistLauncherX+"px",height:o.checklistLauncherHeight+"px",borderRadius:o.checklistLauncherBorderRadius+"px",position:F?void 0:"absolute",visibility:F?void 0:"hidden",animation:F?void 0:"none"};return e.createElement(k,{elRef:I,testId:"checklist-launcher-app",className:b({"userflowjs-checklist-launcher":!0,[`userflowjs-checklist-launcher--position-${d}`]:!0}),style:N,stylesheet:g,theme:o,onStylesheetsLoad:L},e.createElement("button",{ref:r,className:"userflowjs-checklist-launcher-frame-root",onClick:n},e.createElement("div",{ref:T,className:"userflowjs-checklist-launcher-content"},e.createElement("div",{className:"userflowjs-checklist-launcher-text"},c||"Get Started"),e.createElement("div",{"data-testid":"checklist-launcher-uncompleted-count",className:"userflowjs-checklist-launcher-uncompleted-count"},0===u?e.createElement(p,{icon:j}):u,e.createElement("div",{className:"userflowjs-a11y-only"},"uncompleted tasks")))))},y=({session:t,checklistExpanded:s})=>{const{version:o}=t,n=o.checklist,i=t.locale?t.locale.standardLocaleId:t.version.theme.languageId;e.useEffect((()=>{r.changeLanguage(i)}),[i]);const[c,l]=e.useState(!1);return s?e.createElement(L,{session:t,initialAutoFocus:c,setInitialAutoFocus:l}):n.launcherEnabled?e.createElement(F,{session:t,initialAutoFocus:c,setInitialAutoFocus:l}):null},L=({session:t,initialAutoFocus:n,setInitialAutoFocus:r})=>{const l=c(),[a,m]=e.useState(null),{version:h}=t,p=h.checklist,k=f(h.theme),b=e.useMemo((()=>({...k,avatarType:s.NONE,bubblePlacement:k.checklistPlacement,bubbleX:k.checklistX,bubbleY:k.checklistY,bubbleWidth:k.checklistWidth})),[k]);return e.useEffect((()=>{const e=a?.ownerDocument.defaultView;if(!e)return;const t=e=>{"Escape"===e.key&&(r(!0),l.hideChecklist())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}),[a,r,l]),e.createElement(u,null,e.createElement(i,{company:t.flow.company,theme:b,position:"fixed",stepAppearance:o.BUBBLE,zIndex:k.checklistZIndex,autoHide3pEnabled:!0,backgroundImageUrl:p.backgroundAsset&&p.backgroundAsset.assetUrl,bubbleFrameRootRef:m},e.createElement("div",{role:"dialog","aria-label":"Checklist"},e.createElement(x,{session:t,initialAutoFocus:n}),e.createElement(d,{draftMode:t.draftMode,minimize:e=>{r(0===e.detail),l.hideChecklist()}}))))},F=({session:t,initialAutoFocus:s,setInitialAutoFocus:o})=>{const i=c(),[r,l]=e.useState(!1),[a,u]=e.useState(null),{version:m}=t,d=m.checklist,h=f(m.theme);return e.useEffect((()=>{r&&a&&s&&a.focus()}),[i,a,r,s]),e.createElement(w,{position:"fixed",theme:h,onClick:e=>{o(0===e.detail),i.showChecklist()},onVisibleChange:l,buttonRef:u,text:d.launcherText,uncompletedCount:n(t)})};export default y;export{y as ChecklistApp};
package/ChecklistUI.js CHANGED
@@ -1 +1 @@
1
- import{r as e}from"./vendor.react.js";import{E as t,z as s}from"./userflow.js";import{u as o}from"./client-context.js";import{u as l}from"./vendor.react-i18next.js";import{o as n}from"./vendor.obj-str.js";import{D as c}from"./stylesheets.js";import{f as a,l as r}from"./vendor.fortawesome.pro-solid-svg-icons.js";import{h as i,a as u,r as b,R as m}from"./BubbleToolbar.js";import{b as d}from"./flow-condition-types.js";import{A as f,B as k}from"./vendor.fortawesome.pro-regular-svg-icons.js";const p=e.forwardRef((({elProps:t,onClick:s,onCheckmarkClick:o,completed:l,disabled:i,name:u,text:b,active:m,htmlAttributes:d,children:f},k)=>{const p=e.useRef(l);return e.createElement("button",{...t,ref:k,"data-testid":"bubble-task",tabIndex:s?0:-1,className:n({"userflowjs-bubble-task":!0,"userflowjs-bubble-task--completed":!!l,"userflowjs-bubble-task--just-completed":!p.current&&!!l,"userflowjs-bubble-task--disabled":!l&&!!i,"userflowjs-bubble-task--clickable":!!s,"userflowjs-bubble-task--active":!!m}),onClick:s,...d},e.createElement("div",{className:"userflowjs-bubble-task__checkmark",onClick:o},l&&e.createElement(c,{icon:a})),e.createElement("div",{className:"userflowjs-bubble-task__content"},e.createElement("div",{className:"userflowjs-bubble-task__name"},u),e.createElement("div",{className:"userflowjs-bubble-task__text"},b)),e.createElement("div",{className:"userflowjs-bubble-task__arrow"},!l&&e.createElement("div",{className:"userflowjs-rtl-mirrored"},e.createElement(c,{icon:r}))),f)})),w=({task:t,previousTasksCompleted:s})=>{const l=o(),{session:n}=F(),c=n.version.checklist,[a,r]=e.useState((()=>l.taskIsUnacked(t.cvid)));e.useEffect((()=>{if(!a)return;const e=window.setTimeout((()=>r(!1)),500);return()=>window.clearTimeout(e)}),[a]);const b=n.taskCompletions.some((({taskCvid:e})=>e===t.cvid)),m=!a&&b;e.useEffect((()=>{m&&l.ackCompletedTask(t.cvid)}),[l,m,t.cvid]);const f=c.completeInOrder&&!s,k=f||0===t.actions.length&&m?void 0:()=>{l.send({kind:"ClickChecklistTask",sessionId:n.id,taskCvid:t.cvid},{batch:!0}),t.actions.length>0&&(m||!t.completesOnClick)&&l.hideChecklist(),i(l,n,t.actions)};return e.createElement(p,{onClick:k,name:e.createElement(u,{doc:t.name,lookupAttribute:d(n.data)}),text:e.createElement(u,{doc:t.text,lookupAttribute:d(n.data)}),completed:m,disabled:f})},E=({completedCount:t,taskCount:s})=>{const o=0===s?0:Math.min(100,Math.round(t/s*100));return e.createElement("div",{className:"userflowjs-bubble-checklist-progress"},e.createElement("div",{className:"userflowjs-bubble-checklist-progress-bg"},e.createElement("div",{className:"userflowjs-bubble-checklist-progress-text"},o,"%")),e.createElement("div",{className:"userflowjs-bubble-checklist-progress-fill",style:{width:`${o}%`}},e.createElement("div",{className:"userflowjs-bubble-checklist-progress-text"},o,"%")))},v=()=>{const{t:a}=l(),r=o(),i=F(),{session:u}=i,{version:p}=u,v=p.checklist,{dispatch:j}=y(),C=u.taskCompletions.length,h=v.tasks.length,N=C===h;let x=!0,S=v.tasks,g=[],R=i.currentSectionName,_=!1;if(v.sectionsEnabled){let e=null;const t=Array.from(v.tasks).sort(((e,t)=>e.sectionName.localeCompare(t.sectionName)));for(const s of t)s.sectionName!==e&&(g.push(s.sectionName),e=s.sectionName);R&&g.includes(R)||(R=g[0]),S=t.filter((e=>e.sectionName===R)),_=S.some((e=>{const t=u.taskCompletions.some((({taskCvid:t})=>t===e.cvid));return e.blocksNextSection&&!t}))}const T=null==R?-1:g.indexOf(R),q=e=>{const t=T+e;if(t>=0&&t<=g.length-1){const e=g[t];s.setItem("currentChecklistSectionName:"+u.id,e),j({kind:"setCurrentSection",sectionName:e})}};return e.createElement(e.Fragment,null,!b(v.content)&&e.createElement("div",{className:"userflowjs-bubble-content"},e.createElement(m,{doc:v.content,lookupAttribute:d(u.data)})),e.createElement(E,{completedCount:C,taskCount:h}),v.sectionsEnabled&&e.createElement("div",{className:"userflowjs-bubble-section-name"},R||"First section"),e.createElement("div",{className:"userflowjs-bubble-tasks"},S.map((t=>{const s=x;return u.taskCompletions.some((({taskCvid:e})=>e===t.cvid))||(x=!1),e.createElement(w,{key:t.id,task:t,previousTasksCompleted:s})}))),v.sectionsEnabled&&e.createElement("div",{className:"userflowjs-bubble-section-buttons"},e.createElement("button",{className:"userflowjs-bubble-section-button",onClick:()=>q(-1),disabled:T<=0},e.createElement(c,{icon:f}),e.createElement("span",null,a("checklist.previousSection"))),e.createElement("button",{className:"userflowjs-bubble-section-button",onClick:()=>q(1),disabled:T>=g.length-1||_},e.createElement("span",null,a("checklist.nextSection")),e.createElement(c,{icon:k}))),!p.closeDisabled&&e.createElement("div",{className:"userflowjs-bubble-dismiss-row"},e.createElement("button",{className:n({"userflowjs-bubble-dismiss-button":!0,"userflowjs-bubble-dismiss-button--completed":N}),onClick:()=>N?r.endFlow(u,{endReason:t.USER_CLOSED}):j({kind:"showClose"})},a("checklistDismiss.button"))))},j=()=>{const{t:s}=l(),n=o(),{dispatch:c}=y(),{session:a}=F();return e.createElement("div",{role:"alert"},e.createElement("div",{className:"userflowjs-bubble-content"},e.createElement("p",null,e.createElement("b",null,s("checklistDismiss.title")))),e.createElement("div",{className:"userflowjs-bubble-buttons"},e.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--primary",onClick:()=>n.endFlow(a,{endReason:t.USER_CLOSED})},e.createElement("div",{className:"userflowjs-bubble-button-text",role:"presentation"},s("checklistDismiss.yes"))),e.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--default",onClick:()=>c({kind:"showFlow"})},e.createElement("div",{className:"userflowjs-bubble-button-text",role:"presentation"},s("checklistDismiss.cancel")))))};function C(e){const t=e?.querySelector(".userflowjs-bubble-task--clickable:not(.userflowjs-bubble-task--completed)")||e?.querySelector(".userflowjs-bubble-task--clickable")||e?.querySelector('button:not([tabIndex="-1"])');t&&"function"==typeof t.focus&&t.focus()}const h=({session:t,initialAutoFocus:l})=>{const n=o(),c=e.useRef(null),[a,r]=e.useReducer(x,void 0,(()=>({...N,session:t,currentSectionName:s.getItem("currentChecklistSectionName:"+t.id),autoFocusRequested:!!l}))),{session:i,contentType:u}=a;e.useEffect((()=>{i!==t&&r({kind:"updateSession",session:t})}),[i,t]);const b=e.useMemo((()=>({dispatch:r})),[r]);return e.useEffect((()=>{if(!a.autoFocusRequested)return;const e=c.current;e&&C(e),r({kind:"autoFocused"})}),[n,a.autoFocusRequested]),e.createElement(S.Provider,{value:b},e.createElement(g.Provider,{value:a},e.createElement("div",{ref:c},"close"===u?e.createElement(j,null):e.createElement(v,null))))},N={contentType:"flow"};function x(e,t){switch(t.kind){case"updateSession":return{...e,session:t.session};case"showFlow":return{...e,contentType:"flow",autoFocusRequested:!0};case"showClose":return{...e,contentType:"close",autoFocusRequested:!0};case"setCurrentSection":return{...e,currentSectionName:t.sectionName};case"autoFocused":return{...e,autoFocusRequested:!1}}}const S=e.createContext(null),g=e.createContext(null);function y(){return e.useContext(S)}function F(){return e.useContext(g)}export{h as C,C as f};
1
+ import{r as e}from"./vendor.react.js";import{E as t,z as s}from"./userflow.js";import{u as o}from"./client-context.js";import{u as l}from"./vendor.react-i18next.js";import{o as n}from"./vendor.obj-str.js";import{D as c}from"./stylesheets.js";import{f as a,l as r}from"./vendor.fortawesome.pro-solid-svg-icons.js";import{h as i,a as u,r as b,R as m}from"./BubbleToolbar.js";import{b as d}from"./flow-condition-types.js";import{b as f,A as k}from"./vendor.fortawesome.pro-regular-svg-icons.js";const p=e.forwardRef((({elProps:t,onClick:s,onCheckmarkClick:o,completed:l,disabled:i,name:u,text:b,active:m,htmlAttributes:d,children:f},k)=>{const p=e.useRef(l);return e.createElement("button",{...t,ref:k,"data-testid":"bubble-task",tabIndex:s?0:-1,className:n({"userflowjs-bubble-task":!0,"userflowjs-bubble-task--completed":!!l,"userflowjs-bubble-task--just-completed":!p.current&&!!l,"userflowjs-bubble-task--disabled":!l&&!!i,"userflowjs-bubble-task--clickable":!!s,"userflowjs-bubble-task--active":!!m}),onClick:s,...d},e.createElement("div",{className:"userflowjs-bubble-task__checkmark",onClick:o},l&&e.createElement(c,{icon:a})),e.createElement("div",{className:"userflowjs-bubble-task__content"},e.createElement("div",{className:"userflowjs-bubble-task__name"},u),e.createElement("div",{className:"userflowjs-bubble-task__text"},b)),e.createElement("div",{className:"userflowjs-bubble-task__arrow"},!l&&e.createElement("div",{className:"userflowjs-rtl-mirrored"},e.createElement(c,{icon:r}))),f)})),w=({task:t,previousTasksCompleted:s})=>{const l=o(),{session:n}=F(),c=n.version.checklist,[a,r]=e.useState((()=>l.taskIsUnacked(t.cvid)));e.useEffect((()=>{if(!a)return;const e=window.setTimeout((()=>r(!1)),500);return()=>window.clearTimeout(e)}),[a]);const b=n.taskCompletions.some((({taskCvid:e})=>e===t.cvid)),m=!a&&b;e.useEffect((()=>{m&&l.ackCompletedTask(t.cvid)}),[l,m,t.cvid]);const f=c.completeInOrder&&!s,k=f||0===t.actions.length&&m?void 0:()=>{l.send({kind:"ClickChecklistTask",sessionId:n.id,taskCvid:t.cvid},{batch:!0}),t.actions.length>0&&(m||!t.completesOnClick)&&l.hideChecklist(),i(l,n,t.actions)};return e.createElement(p,{onClick:k,name:e.createElement(u,{doc:t.name,lookupAttribute:d(n.data)}),text:e.createElement(u,{doc:t.text,lookupAttribute:d(n.data)}),completed:m,disabled:f})},E=({completedCount:t,taskCount:s})=>{const o=0===s?0:Math.min(100,Math.round(t/s*100));return e.createElement("div",{className:"userflowjs-bubble-checklist-progress"},e.createElement("div",{className:"userflowjs-bubble-checklist-progress-bg"},e.createElement("div",{className:"userflowjs-bubble-checklist-progress-text"},o,"%")),e.createElement("div",{className:"userflowjs-bubble-checklist-progress-fill",style:{width:`${o}%`}},e.createElement("div",{className:"userflowjs-bubble-checklist-progress-text"},o,"%")))},v=()=>{const{t:a}=l(),r=o(),i=F(),{session:u}=i,{version:p}=u,v=p.checklist,{dispatch:j}=y(),C=u.taskCompletions.length,h=v.tasks.length,N=C===h;let x=!0,S=v.tasks,g=[],R=i.currentSectionName,_=!1;if(v.sectionsEnabled){let e=null;const t=Array.from(v.tasks).sort(((e,t)=>e.sectionName.localeCompare(t.sectionName)));for(const s of t)s.sectionName!==e&&(g.push(s.sectionName),e=s.sectionName);R&&g.includes(R)||(R=g[0]),S=t.filter((e=>e.sectionName===R)),_=S.some((e=>{const t=u.taskCompletions.some((({taskCvid:t})=>t===e.cvid));return e.blocksNextSection&&!t}))}const T=null==R?-1:g.indexOf(R),q=e=>{const t=T+e;if(t>=0&&t<=g.length-1){const e=g[t];s.setItem("currentChecklistSectionName:"+u.id,e),j({kind:"setCurrentSection",sectionName:e})}};return e.createElement(e.Fragment,null,!b(v.content)&&e.createElement("div",{className:"userflowjs-bubble-content"},e.createElement(m,{doc:v.content,lookupAttribute:d(u.data)})),e.createElement(E,{completedCount:C,taskCount:h}),v.sectionsEnabled&&e.createElement("div",{className:"userflowjs-bubble-section-name"},R||"First section"),e.createElement("div",{className:"userflowjs-bubble-tasks"},S.map((t=>{const s=x;return u.taskCompletions.some((({taskCvid:e})=>e===t.cvid))||(x=!1),e.createElement(w,{key:t.id,task:t,previousTasksCompleted:s})}))),v.sectionsEnabled&&e.createElement("div",{className:"userflowjs-bubble-section-buttons"},e.createElement("button",{className:"userflowjs-bubble-section-button",onClick:()=>q(-1),disabled:T<=0},e.createElement(c,{icon:f}),e.createElement("span",null,a("checklist.previousSection"))),e.createElement("button",{className:"userflowjs-bubble-section-button",onClick:()=>q(1),disabled:T>=g.length-1||_},e.createElement("span",null,a("checklist.nextSection")),e.createElement(c,{icon:k}))),!p.closeDisabled&&e.createElement("div",{className:"userflowjs-bubble-dismiss-row"},e.createElement("button",{className:n({"userflowjs-bubble-dismiss-button":!0,"userflowjs-bubble-dismiss-button--completed":N}),onClick:()=>N?r.endFlow(u,{endReason:t.USER_CLOSED}):j({kind:"showClose"})},a("checklistDismiss.button"))))},j=()=>{const{t:s}=l(),n=o(),{dispatch:c}=y(),{session:a}=F();return e.createElement("div",{role:"alert"},e.createElement("div",{className:"userflowjs-bubble-content"},e.createElement("p",null,e.createElement("b",null,s("checklistDismiss.title")))),e.createElement("div",{className:"userflowjs-bubble-buttons"},e.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--primary",onClick:()=>n.endFlow(a,{endReason:t.USER_CLOSED})},e.createElement("div",{className:"userflowjs-bubble-button-text",role:"presentation"},s("checklistDismiss.yes"))),e.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--default",onClick:()=>c({kind:"showFlow"})},e.createElement("div",{className:"userflowjs-bubble-button-text",role:"presentation"},s("checklistDismiss.cancel")))))};function C(e){const t=e?.querySelector(".userflowjs-bubble-task--clickable:not(.userflowjs-bubble-task--completed)")||e?.querySelector(".userflowjs-bubble-task--clickable")||e?.querySelector('button:not([tabIndex="-1"])');t&&"function"==typeof t.focus&&t.focus()}const h=({session:t,initialAutoFocus:l})=>{const n=o(),c=e.useRef(null),[a,r]=e.useReducer(x,void 0,(()=>({...N,session:t,currentSectionName:s.getItem("currentChecklistSectionName:"+t.id),autoFocusRequested:!!l}))),{session:i,contentType:u}=a;e.useEffect((()=>{i!==t&&r({kind:"updateSession",session:t})}),[i,t]);const b=e.useMemo((()=>({dispatch:r})),[r]);return e.useEffect((()=>{if(!a.autoFocusRequested)return;const e=c.current;e&&C(e),r({kind:"autoFocused"})}),[n,a.autoFocusRequested]),e.createElement(S.Provider,{value:b},e.createElement(g.Provider,{value:a},e.createElement("div",{ref:c},"close"===u?e.createElement(j,null):e.createElement(v,null))))},N={contentType:"flow"};function x(e,t){switch(t.kind){case"updateSession":return{...e,session:t.session};case"showFlow":return{...e,contentType:"flow",autoFocusRequested:!0};case"showClose":return{...e,contentType:"close",autoFocusRequested:!0};case"setCurrentSection":return{...e,currentSectionName:t.sectionName};case"autoFocused":return{...e,autoFocusRequested:!1}}}const S=e.createContext(null),g=e.createContext(null);function y(){return e.useContext(S)}function F(){return e.useContext(g)}export{h as C,C as f};
@@ -1 +1 @@
1
- import{r as e}from"./vendor.react.js";import{u as t}from"./client-context.js";import{D as s,E as a,F as n}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{p as r}from"./vendor.dompurify.js";import{m as o}from"./vendor.marked.js";import{o as i}from"./vendor.obj-str.js";import{W as l,i as c}from"./userflow.js";import{A as u,G as m}from"./ResourceCenterApp.js";import{r as d,R as f}from"./BubbleToolbar.js";import{D as g}from"./stylesheets.js";import{b as p}from"./flow-condition-types.js";import"./vendor.object-assign.js";import"./vendor.i18next.js";import"./vendor.react-i18next.js";import"./vendor.babel.runtime.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./z-index.js";import"./logomark.js";import"./vendor.react-dom.js";import"./vendor.scheduler.js";import"./ChecklistUI.js";import"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.date-fns.js";const b=[];const h=({assistant:t,lookupAttribute:s,history:a,setInput:n,contentElRef:r,scrolledToTop:o,userContent:l,setUserContent:c,onSubmitMessage:m,supportsFeedback:g,onSubmitRating:p,onSubmitFeedback:b,InsideMessage:h,reset:v,onContentScroll:_,onContentWheel:j,conversationId:E})=>e.createElement("div",{className:"userflowjs-assistant-chat"},e.createElement("div",{className:i({"userflowjs-assistant-chat__header":!0,"userflowjs-assistant-chat__header--content-scrolled":!o})},e.createElement("h2",{className:"userflowjs-assistant-chat__title"},t.title),e.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--default",onClick:v},t.resetText)),e.createElement("div",{ref:r,className:"userflowjs-assistant-chat__content",onScroll:_,onWheel:j},!d(t.intro)&&e.createElement("div",{className:"userflowjs-assistant-chat__intro"},e.createElement(f,{doc:t.intro,lookupAttribute:s})),a.map(((s,a)=>e.createElement(k,{key:a,assistant:t,message:s,supportsFeedback:g,onSubmitRating:p,onSubmitFeedback:b,InsideMessage:h,conversationId:E})))),e.createElement("div",{className:"userflowjs-assistant-chat__prompt"},e.createElement(u,{textareaRef:n,placeholder:(0===a.length?t.promptEmptyPlaceholder:t.promptNonemptyPlaceholder)||"",value:l,onChange:c,onSubmit:()=>m(l)}))),k=({assistant:t,message:r,supportsFeedback:o,onSubmitRating:c,onSubmitFeedback:u,InsideMessage:d,conversationId:f})=>{const p=e.useRef(null),[b,h]=e.useState(""),k=()=>{r.id&&(u({messageId:r.id,feedback:b.trim()}),h(""))};return e.useEffect((()=>{r.rating&&p.current?.focus({preventScroll:!0})}),[r.rating]),e.createElement("div",{className:"userflowjs-assistant-chat__message"},d&&e.createElement(d,{message:r}),e.createElement("div",{className:i({"userflowjs-assistant-chat__user-content":!0,"userflowjs-assistant-chat__user-content--enter":!!r.enterAnimation}),"data-assistant-conversation-id":f,"data-assistant-message-id":r.id},e.createElement("div",{style:{whiteSpace:"pre-wrap"}},r.userContent)),r.warning&&e.createElement("div",{className:"userflowjs-assistant-chat__error"},"Warning: ",r.warning),e.createElement("div",{className:"userflowjs-assistant-chat__assistant-content"},e.createElement("div",null,e.createElement(j,{html:r.assistantHtml})),r.error&&e.createElement("div",{className:"userflowjs-assistant-chat__error"},r.error)),r.sources&&r.sources.length>0&&e.createElement("div",{className:"userflowjs-assistant-chat__sources"},e.createElement("div",{className:"userflowjs-assistant-chat__sources-title"},t.sourcesText),r.sources.map(((t,s)=>e.createElement("a",{key:s,className:"userflowjs-assistant-chat__source",href:t.url,target:"_blank",rel:"noreferrer noopener"},t.title)))),o&&r.completed&&r.id&&e.createElement("div",{className:i({"userflowjs-assistant-chat__feedback":!0,"userflowjs-assistant-chat__feedback--with-textarea":!!r.rating&&!r.feedbackSubmitted})},r.feedbackSubmitted?e.createElement(e.Fragment,null,e.createElement("button",{className:"userflowjs-assistant-chat__rating",disabled:!0},e.createElement(g,{icon:r.rating==l.DISLIKE?s:a})),e.createElement("div",{className:"userflowjs-assistant-chat__feedback-thanks"},t.feedbackThanksText)):r.rating?e.createElement(m,{textareaRef:p,className:"userflowjs-growing-textarea userflowjs-assistant-chat__feedback-textarea",mirrorClassName:"userflowjs-growing-textarea__mirror",textareaClassName:"userflowjs-textarea",placeholder:(r.rating===l.LIKE?t.feedbackLikePlaceholder:t.feedbackDislikePlaceholder)||"",value:b,onChange:h,onKeyDown:e=>{e.shiftKey||"Enter"!==e.key||(e.preventDefault(),k())}},e.createElement("button",{className:"userflowjs-assistant-chat__rating",disabled:!0},e.createElement(g,{icon:r.rating==l.DISLIKE?s:a})),e.createElement("button",{className:"userflowjs-assistant-chat__feedback-submit",onClick:()=>k()},e.createElement(g,{icon:n}))):[l.LIKE,l.DISLIKE].map((t=>(!r.rating||r.rating===t)&&e.createElement("button",{key:t,className:"userflowjs-assistant-chat__rating",onClick:r.rating?void 0:()=>(e=>{r.id&&c({messageId:r.id,rating:e})})(t),disabled:!!r.rating,"data-testid":`assistant-chat-rating-${t}`},e.createElement(g,{icon:t==l.DISLIKE?s:a}))))))};function v(e){let t=e;const s=e=>e=(e=e.replace(/\s*[*_`]*$/,"")).replace(/(^|\n)\s*(\d+\.?|-|=)$/,"");t=s(t),t=t.replace(/\[([^\]\n]*)(\](\([^)\n]*)?)?$/,"$1"),t=s(t);const a=Array.from(t.matchAll(/\n( *)```/g));if(a.length%2==1){t+="\n"+a[a.length-1][1]+"```"}else{let e=0;for(let r=t.length-1;r>=0;r--)if("\n"===t[r]&&"\n"===t[r-1]){e=r;break}const s=[];let a=!1;const n=e=>null==e||e.match(/\W/);for(let r=e;r<t.length;r++){const o=t[r],i=o+t[r+1],l=i+t[r+2];let c=null;if((a||"***"!==l)&&(a||"___"!==l||!n(t[r-1])&&!n(t[r+3]))?(a||"**"!==i)&&(a||"__"!==i||!n(t[r-1])&&!n(t[r+2]))?(a||"*"!==o)&&(a||"_"!==o||!n(t[r-1])&&!n(t[r+1]))?"`"===o&&(c=o):c=o:c=i:c=l,null!=c){!!t.slice(e,r+c.length).match(/\[[^\]\n]*\]\([^)\n]*$/)||(s[s.length-1]===c?("`"===c&&(a=!1),s.pop()):("`"===c&&(a=!0),s.push(c))),r+=c.length-1}}t+=s.reverse().join("")}return t}function _(e,t){e=e.trim(),!1!==t&&(e=e.replace(/(\n *```)?$/," {{USERFLOWCHATBRAIN}}$1"));let s=r.sanitize(o.parse(e));if(!1!==t){let e="userflowjs-assistant-brain";t&&(e+=` userflowjs-assistant-brain--${t}`),s=s.replace("{{USERFLOWCHATBRAIN}}",`<span class="${e}"><span></span><span></span><span></span><span></span></span>`)}return s=s.replace(/<a href=/g,'<a target="_blank" rel="noopener noreferrer" href='),s}const j=({html:t})=>e.useMemo((()=>{if(!t)return null;return E((new DOMParser).parseFromString(t,"text/html").body)}),[t]);function E(t,s){if(t instanceof Element){if("BODY"===t.tagName)return e.createElement(e.Fragment,{key:s},w(t));{if(["script","style"].includes(t.tagName))return null;const a={key:s};for(const e of t.attributes){let t=e.name;t.startsWith("on")||("class"===t&&(t="className"),a[t]=e.value)}return e.createElement(t.tagName.toLowerCase(),a,w(t))}}return t instanceof Text?t.textContent:null}function w(e){const t=[];let s=0;for(const a of e.childNodes)t.push(E(a,s)),s++;return t}const C=({block:s,session:a,assistantReply:n,initialUserContent:r})=>{const o=s.assistantFlowId,i=t(),l=function({assistant:t,lookupAttribute:s,initialConversationId:a,initialHistory:n,initialUserContent:r,onConversationIdChange:o,submitMessage:i,submitRating:l,submitFeedback:c,InsideMessage:u}){const[m,d]=e.useState(null),[f,g]=e.useState((()=>n?n.map((e=>({...e,assistantHtml:_(v(e.assistantContent),!1)}))):b)),[p,h]=e.useState(""),k=e.useRef(null),j=e.useRef(null),E=e.useRef(!0),w=e.useRef(a||null),[C,I]=e.useState(w.current),S=e.useCallback((e=>{w.current=e,I(e),o&&o(e)}),[o]),y=e.useCallback((()=>{m?.focus({preventScroll:!0})}),[m]);e.useEffect((()=>{y()}),[y]),e.useLayoutEffect((()=>{const e=j.current;e&&(e.scrollTop=Math.ceil(e.scrollHeight-e.clientHeight))}),[]);const N=e.useCallback((()=>{const e=j.current;e&&(E.current=!0,"function"==typeof e.scrollTo&&e.scrollTo({top:Math.ceil(e.scrollHeight-e.clientHeight),behavior:"smooth"}))}),[]),R=e.useRef(0);e.useLayoutEffect((()=>{const e=j.current;e&&e.scrollHeight!==R.current&&(R.current=e.scrollHeight,E.current&&N())}),[f,N]);const M=e.useCallback((()=>{k.current&&k.current()}),[]);e.useEffect((()=>()=>{M()}),[M]);const x=(e,t)=>{g((s=>s.map((s=>{if(e===s.id){const e=t(s);return{...s,...e}}return s}))))},A=e=>{g((t=>t.map(((s,a)=>{if(a===t.length-1){const t=e(s);return{...s,...t}}return s}))))},F=e.useCallback((async e=>{if(""===(e=e.trim()))return;M(),g((t=>[...t,{id:null,userContent:e,assistantContent:"",assistantHtml:_("","enter"),enterAnimation:!0,sources:[],completed:!1,rating:null,feedbackSubmitted:!1}])),h(""),N();let t=!1;const s=()=>{t=!0,k.current=null},a=i({conversationId:w.current,userContent:e,callback:e=>{if(t)console.log("Userflow.js AssistantChat got message after being done",e);else switch(e.kind){case"conversation_created":S(e.conversationId);break;case"message_created":A((()=>({id:e.messageId,warning:e.warning})));break;case"assistant_content_delta":A((t=>{const s=e.delta,a=t.assistantContent+s;return{assistantContent:a,assistantHtml:_(v(a))}}));break;case"done":s(),A((t=>({assistantHtml:_(t.assistantContent,"exit"),completed:!0,sources:e.sources})));break;case"error":s(),A((t=>({failed:!0,error:e.message,assistantHtml:_(v(t.assistantContent),!1)})));break;default:console.log("Userflow.js AssistantChat got unknown message",e)}}});k.current=()=>{s(),a.abort(),A((e=>({assistantHtml:_(v(e.assistantContent),!1)})))}}),[M,N,i,S]),H=e.useRef(!1);e.useEffect((()=>{H.current||(H.current=!0,r&&F(r))}),[F,r]);const T=e.useCallback((()=>{M(),S(null),g(b),y()}),[M,y,S]),[L,D]=e.useState(!0),U=e.useCallback((()=>{const e=j.current;e&&D(0===e.scrollTop)}),[]),$=e.useCallback((()=>{const e=j.current;e&&(E.current=Math.ceil(e.scrollHeight-e.clientHeight)==Math.ceil(e.scrollTop))}),[]);return{assistant:t,lookupAttribute:s,history:f,setInput:d,contentElRef:j,scrolledToTop:L,userContent:p,setUserContent:h,onSubmitMessage:F,supportsFeedback:!!l&&!!c,onSubmitRating:e=>{l&&(x(e.messageId,(()=>({rating:e.rating}))),l(e))},onSubmitFeedback:e=>{c&&(x(e.messageId,(()=>({feedbackSubmitted:!0}))),c(e))},InsideMessage:u,reset:T,onContentScroll:U,onContentWheel:$,conversationId:C}}(e.useMemo((()=>({assistant:n.assistant,lookupAttribute:p(a.data),initialConversationId:n.conversationId,initialHistory:n.history,initialUserContent:r,onConversationIdChange:e=>{const t="assistantConversationId:"+o;e?c.setItem(t,e):c.removeItem(t)},submitMessage:({conversationId:e,userContent:t,callback:s})=>{i.assistantMessageInProgress=!0;const a=i.nextRef();i.send({kind:"SubmitAssistantMessage",ref:a,assistantFlowId:o,conversationId:e,userContent:t}).catch((e=>{s({kind:"error",message:e.humanMessage||"I'm sorry, but something went wrong. Please try again."})}));const n=()=>{i.assistantMessageInProgress=void 0,i.off("private:assistantMessageEvent",r),i.off("private:disconnect",l)},r=e=>{if(e.ref!==a)return;const{event:t}=e;s(t),"done"!=t.kind&&"error"!=t.kind||n()},l=()=>{s({kind:"error",message:"Sorry, my connection got disconnected. Please try again or contact my human friends."}),n()};return i.on("private:assistantMessageEvent",r),i.on("private:disconnect",l),{abort:()=>{i.send({kind:"AbortAssistantMessage"}),n()}}},submitRating:e=>{i.send({kind:"SubmitAssistantRating",messageId:e.messageId,rating:e.rating})},submitFeedback:e=>{i.send({kind:"SubmitAssistantFeedback",messageId:e.messageId,feedback:e.feedback})}})),[n,o,i,r,a.data]));return e.createElement(e.Fragment,null,e.createElement(h,{...l}))};export{C as ResourceCenterAssistantChat};
1
+ import{r as e}from"./vendor.react.js";import{u as t}from"./client-context.js";import{C as s,D as a,E as n}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{p as r}from"./vendor.dompurify.js";import{m as o}from"./vendor.marked.js";import{o as i}from"./vendor.obj-str.js";import{W as l,i as c}from"./userflow.js";import{A as u,G as m}from"./ResourceCenterApp.js";import{r as d,R as f}from"./BubbleToolbar.js";import{D as g}from"./stylesheets.js";import{b as p}from"./flow-condition-types.js";import"./vendor.object-assign.js";import"./vendor.i18next.js";import"./vendor.react-i18next.js";import"./vendor.babel.runtime.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./z-index.js";import"./logomark.js";import"./vendor.react-dom.js";import"./vendor.scheduler.js";import"./ChecklistUI.js";import"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.date-fns.js";const b=[];const h=({assistant:t,lookupAttribute:s,history:a,setInput:n,contentElRef:r,scrolledToTop:o,userContent:l,setUserContent:c,onSubmitMessage:m,supportsFeedback:g,onSubmitRating:p,onSubmitFeedback:b,InsideMessage:h,reset:v,onContentScroll:_,onContentWheel:j,conversationId:E})=>e.createElement("div",{className:"userflowjs-assistant-chat"},e.createElement("div",{className:i({"userflowjs-assistant-chat__header":!0,"userflowjs-assistant-chat__header--content-scrolled":!o})},e.createElement("h2",{className:"userflowjs-assistant-chat__title"},t.title),e.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--default",onClick:v},t.resetText)),e.createElement("div",{ref:r,className:"userflowjs-assistant-chat__content",onScroll:_,onWheel:j},!d(t.intro)&&e.createElement("div",{className:"userflowjs-assistant-chat__intro"},e.createElement(f,{doc:t.intro,lookupAttribute:s})),a.map(((s,a)=>e.createElement(k,{key:a,assistant:t,message:s,supportsFeedback:g,onSubmitRating:p,onSubmitFeedback:b,InsideMessage:h,conversationId:E})))),e.createElement("div",{className:"userflowjs-assistant-chat__prompt"},e.createElement(u,{textareaRef:n,placeholder:(0===a.length?t.promptEmptyPlaceholder:t.promptNonemptyPlaceholder)||"",value:l,onChange:c,onSubmit:()=>m(l)}))),k=({assistant:t,message:r,supportsFeedback:o,onSubmitRating:c,onSubmitFeedback:u,InsideMessage:d,conversationId:f})=>{const p=e.useRef(null),[b,h]=e.useState(""),k=()=>{r.id&&(u({messageId:r.id,feedback:b.trim()}),h(""))};return e.useEffect((()=>{r.rating&&p.current?.focus({preventScroll:!0})}),[r.rating]),e.createElement("div",{className:"userflowjs-assistant-chat__message"},d&&e.createElement(d,{message:r}),e.createElement("div",{className:i({"userflowjs-assistant-chat__user-content":!0,"userflowjs-assistant-chat__user-content--enter":!!r.enterAnimation}),"data-assistant-conversation-id":f,"data-assistant-message-id":r.id},e.createElement("div",{style:{whiteSpace:"pre-wrap"}},r.userContent)),r.warning&&e.createElement("div",{className:"userflowjs-assistant-chat__error"},"Warning: ",r.warning),e.createElement("div",{className:"userflowjs-assistant-chat__assistant-content"},e.createElement("div",null,e.createElement(j,{html:r.assistantHtml})),r.error&&e.createElement("div",{className:"userflowjs-assistant-chat__error"},r.error)),r.sources&&r.sources.length>0&&e.createElement("div",{className:"userflowjs-assistant-chat__sources"},e.createElement("div",{className:"userflowjs-assistant-chat__sources-title"},t.sourcesText),r.sources.map(((t,s)=>e.createElement("a",{key:s,className:"userflowjs-assistant-chat__source",href:t.url,target:"_blank",rel:"noreferrer noopener"},t.title)))),o&&r.completed&&r.id&&e.createElement("div",{className:i({"userflowjs-assistant-chat__feedback":!0,"userflowjs-assistant-chat__feedback--with-textarea":!!r.rating&&!r.feedbackSubmitted})},r.feedbackSubmitted?e.createElement(e.Fragment,null,e.createElement("button",{className:"userflowjs-assistant-chat__rating",disabled:!0},e.createElement(g,{icon:r.rating==l.DISLIKE?s:a})),e.createElement("div",{className:"userflowjs-assistant-chat__feedback-thanks"},t.feedbackThanksText)):r.rating?e.createElement(m,{textareaRef:p,className:"userflowjs-growing-textarea userflowjs-assistant-chat__feedback-textarea",mirrorClassName:"userflowjs-growing-textarea__mirror",textareaClassName:"userflowjs-textarea",placeholder:(r.rating===l.LIKE?t.feedbackLikePlaceholder:t.feedbackDislikePlaceholder)||"",value:b,onChange:h,onKeyDown:e=>{e.shiftKey||"Enter"!==e.key||(e.preventDefault(),k())}},e.createElement("button",{className:"userflowjs-assistant-chat__rating",disabled:!0},e.createElement(g,{icon:r.rating==l.DISLIKE?s:a})),e.createElement("button",{className:"userflowjs-assistant-chat__feedback-submit",onClick:()=>k()},e.createElement(g,{icon:n}))):[l.LIKE,l.DISLIKE].map((t=>(!r.rating||r.rating===t)&&e.createElement("button",{key:t,className:"userflowjs-assistant-chat__rating",onClick:r.rating?void 0:()=>(e=>{r.id&&c({messageId:r.id,rating:e})})(t),disabled:!!r.rating,"data-testid":`assistant-chat-rating-${t}`},e.createElement(g,{icon:t==l.DISLIKE?s:a}))))))};function v(e){let t=e;const s=e=>e=(e=e.replace(/\s*[*_`]*$/,"")).replace(/(^|\n)\s*(\d+\.?|-|=)$/,"");t=s(t),t=t.replace(/\[([^\]\n]*)(\](\([^)\n]*)?)?$/,"$1"),t=s(t);const a=Array.from(t.matchAll(/\n( *)```/g));if(a.length%2==1){t+="\n"+a[a.length-1][1]+"```"}else{let e=0;for(let r=t.length-1;r>=0;r--)if("\n"===t[r]&&"\n"===t[r-1]){e=r;break}const s=[];let a=!1;const n=e=>null==e||e.match(/\W/);for(let r=e;r<t.length;r++){const o=t[r],i=o+t[r+1],l=i+t[r+2];let c=null;if((a||"***"!==l)&&(a||"___"!==l||!n(t[r-1])&&!n(t[r+3]))?(a||"**"!==i)&&(a||"__"!==i||!n(t[r-1])&&!n(t[r+2]))?(a||"*"!==o)&&(a||"_"!==o||!n(t[r-1])&&!n(t[r+1]))?"`"===o&&(c=o):c=o:c=i:c=l,null!=c){!!t.slice(e,r+c.length).match(/\[[^\]\n]*\]\([^)\n]*$/)||(s[s.length-1]===c?("`"===c&&(a=!1),s.pop()):("`"===c&&(a=!0),s.push(c))),r+=c.length-1}}t+=s.reverse().join("")}return t}function _(e,t){e=e.trim(),!1!==t&&(e=e.replace(/(\n *```)?$/," {{USERFLOWCHATBRAIN}}$1"));let s=r.sanitize(o.parse(e));if(!1!==t){let e="userflowjs-assistant-brain";t&&(e+=` userflowjs-assistant-brain--${t}`),s=s.replace("{{USERFLOWCHATBRAIN}}",`<span class="${e}"><span></span><span></span><span></span><span></span></span>`)}return s=s.replace(/<a href=/g,'<a target="_blank" rel="noopener noreferrer" href='),s}const j=({html:t})=>e.useMemo((()=>{if(!t)return null;return E((new DOMParser).parseFromString(t,"text/html").body)}),[t]);function E(t,s){if(t instanceof Element){if("BODY"===t.tagName)return e.createElement(e.Fragment,{key:s},w(t));{if(["script","style"].includes(t.tagName))return null;const a={key:s};for(const e of t.attributes){let t=e.name;t.startsWith("on")||("class"===t&&(t="className"),a[t]=e.value)}return e.createElement(t.tagName.toLowerCase(),a,w(t))}}return t instanceof Text?t.textContent:null}function w(e){const t=[];let s=0;for(const a of e.childNodes)t.push(E(a,s)),s++;return t}const C=({block:s,session:a,assistantReply:n,initialUserContent:r})=>{const o=s.assistantFlowId,i=t(),l=function({assistant:t,lookupAttribute:s,initialConversationId:a,initialHistory:n,initialUserContent:r,onConversationIdChange:o,submitMessage:i,submitRating:l,submitFeedback:c,InsideMessage:u}){const[m,d]=e.useState(null),[f,g]=e.useState((()=>n?n.map((e=>({...e,assistantHtml:_(v(e.assistantContent),!1)}))):b)),[p,h]=e.useState(""),k=e.useRef(null),j=e.useRef(null),E=e.useRef(!0),w=e.useRef(a||null),[C,I]=e.useState(w.current),S=e.useCallback((e=>{w.current=e,I(e),o&&o(e)}),[o]),y=e.useCallback((()=>{m?.focus({preventScroll:!0})}),[m]);e.useEffect((()=>{y()}),[y]),e.useLayoutEffect((()=>{const e=j.current;e&&(e.scrollTop=Math.ceil(e.scrollHeight-e.clientHeight))}),[]);const N=e.useCallback((()=>{const e=j.current;e&&(E.current=!0,"function"==typeof e.scrollTo&&e.scrollTo({top:Math.ceil(e.scrollHeight-e.clientHeight),behavior:"smooth"}))}),[]),R=e.useRef(0);e.useLayoutEffect((()=>{const e=j.current;e&&e.scrollHeight!==R.current&&(R.current=e.scrollHeight,E.current&&N())}),[f,N]);const M=e.useCallback((()=>{k.current&&k.current()}),[]);e.useEffect((()=>()=>{M()}),[M]);const x=(e,t)=>{g((s=>s.map((s=>{if(e===s.id){const e=t(s);return{...s,...e}}return s}))))},A=e=>{g((t=>t.map(((s,a)=>{if(a===t.length-1){const t=e(s);return{...s,...t}}return s}))))},F=e.useCallback((async e=>{if(""===(e=e.trim()))return;M(),g((t=>[...t,{id:null,userContent:e,assistantContent:"",assistantHtml:_("","enter"),enterAnimation:!0,sources:[],completed:!1,rating:null,feedbackSubmitted:!1}])),h(""),N();let t=!1;const s=()=>{t=!0,k.current=null},a=i({conversationId:w.current,userContent:e,callback:e=>{if(t)console.log("Userflow.js AssistantChat got message after being done",e);else switch(e.kind){case"conversation_created":S(e.conversationId);break;case"message_created":A((()=>({id:e.messageId,warning:e.warning})));break;case"assistant_content_delta":A((t=>{const s=e.delta,a=t.assistantContent+s;return{assistantContent:a,assistantHtml:_(v(a))}}));break;case"done":s(),A((t=>({assistantHtml:_(t.assistantContent,"exit"),completed:!0,sources:e.sources})));break;case"error":s(),A((t=>({failed:!0,error:e.message,assistantHtml:_(v(t.assistantContent),!1)})));break;default:console.log("Userflow.js AssistantChat got unknown message",e)}}});k.current=()=>{s(),a.abort(),A((e=>({assistantHtml:_(v(e.assistantContent),!1)})))}}),[M,N,i,S]),H=e.useRef(!1);e.useEffect((()=>{H.current||(H.current=!0,r&&F(r))}),[F,r]);const T=e.useCallback((()=>{M(),S(null),g(b),y()}),[M,y,S]),[L,D]=e.useState(!0),U=e.useCallback((()=>{const e=j.current;e&&D(0===e.scrollTop)}),[]),$=e.useCallback((()=>{const e=j.current;e&&(E.current=Math.ceil(e.scrollHeight-e.clientHeight)==Math.ceil(e.scrollTop))}),[]);return{assistant:t,lookupAttribute:s,history:f,setInput:d,contentElRef:j,scrolledToTop:L,userContent:p,setUserContent:h,onSubmitMessage:F,supportsFeedback:!!l&&!!c,onSubmitRating:e=>{l&&(x(e.messageId,(()=>({rating:e.rating}))),l(e))},onSubmitFeedback:e=>{c&&(x(e.messageId,(()=>({feedbackSubmitted:!0}))),c(e))},InsideMessage:u,reset:T,onContentScroll:U,onContentWheel:$,conversationId:C}}(e.useMemo((()=>({assistant:n.assistant,lookupAttribute:p(a.data),initialConversationId:n.conversationId,initialHistory:n.history,initialUserContent:r,onConversationIdChange:e=>{const t="assistantConversationId:"+o;e?c.setItem(t,e):c.removeItem(t)},submitMessage:({conversationId:e,userContent:t,callback:s})=>{i.assistantMessageInProgress=!0;const a=i.nextRef();i.send({kind:"SubmitAssistantMessage",ref:a,assistantFlowId:o,conversationId:e,userContent:t}).catch((e=>{s({kind:"error",message:e.humanMessage||"I'm sorry, but something went wrong. Please try again."})}));const n=()=>{i.assistantMessageInProgress=void 0,i.off("private:assistantMessageEvent",r),i.off("private:disconnect",l)},r=e=>{if(e.ref!==a)return;const{event:t}=e;s(t),"done"!=t.kind&&"error"!=t.kind||n()},l=()=>{s({kind:"error",message:"Sorry, my connection got disconnected. Please try again or contact my human friends."}),n()};return i.on("private:assistantMessageEvent",r),i.on("private:disconnect",l),{abort:()=>{i.send({kind:"AbortAssistantMessage"}),n()}}},submitRating:e=>{i.send({kind:"SubmitAssistantRating",messageId:e.messageId,rating:e.rating})},submitFeedback:e=>{i.send({kind:"SubmitAssistantFeedback",messageId:e.messageId,feedback:e.feedback})}})),[n,o,i,r,a.data]));return e.createElement(e.Fragment,null,e.createElement(h,{...l}))};export{C as ResourceCenterAssistantChat};
package/hash.txt CHANGED
@@ -1 +1 @@
1
- ee9ee0862eeae3f4b481913206a74545f0c3dbbe
1
+ b28880c8b0b1455be94164e5f350eeb511b339f5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "userflow.js-self-hosted",
3
- "version": "0.1.1003662",
3
+ "version": "0.1.1003698",
4
4
  "description": "Self-hosted version of Userflow.js",
5
5
  "main": "userflow.js"
6
6
  }
package/userflow.js CHANGED
@@ -1 +1 @@
1
- import{S as e}from"./vendor.phoenix.js";import{v as t}from"./vendor.uuid.js";let s;const i={},n=function(e,t){if(!t)return e();if(void 0===s){const e=document.createElement("link").relList;s=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(t.map((e=>{if(e in i)return;i[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":s,t||(o.as="script",o.crossOrigin=""),o.href=e,document.head.appendChild(o),t?new Promise(((e,t)=>{o.addEventListener("load",e),o.addEventListener("error",t)})):void 0}))).then((()=>e()))};class o extends Error{constructor(e,t,s){super(e),Object.setPrototypeOf(this,o.prototype),this.name="UserflowError",this.code=t,this.humanMessage=s}}class r{constructor(e){this.type=e,this.testState={}}formatKey(e){return`userflow:${e}`}isSupported(){if("undefined"==typeof window)return!1;try{return null!=window[this.type]}catch{return!1}}getItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].getItem(e):null}setItem(e,t){e=this.formatKey(e),this.isSupported()&&window[this.type].setItem(e,t)}removeItem(e){if(e=this.formatKey(e),this.isSupported())return window[this.type].removeItem(e)}clear(){if(this.isSupported())return window[this.type].clear()}}const a=new r("localStorage"),c=new r("sessionStorage");function l(e){window.location.href=e}function d(){return window.location.href}var h,u,E;function f(e){window.postMessage(e,window.origin)}function T(e){const t=t=>{if(t.source!==window||t.origin!==window.origin)return;const i=t.data;i&&"object"==typeof i&&"string"==typeof i.kind&&i.kind.startsWith("userflow:")&&!0===e(i)&&s()};window.addEventListener("message",t);const s=()=>window.removeEventListener("message",t);return s}(h||(h={})).INPUT="INPUT",(E=u||(u={})).AUTO="AUTO",E.MANUAL="MANUAL";const w=new Set;let S=!1;function p(e){return function(){if(S)return;S=!0;const{history:e}=window,t=t=>{const s=e[t];e[t]=(...t)=>{s.apply(e,t),I()}};t("pushState"),t("replaceState"),window.addEventListener("popstate",(()=>{I()}))}(),w.add(e),()=>{g(e)}}function g(e){w.delete(e)}function I(){w.forEach((e=>e()))}class C{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(e){f({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})}onBuilderMessage(e){return this.unregisterOnMessage=T(e),!1}async captureScreenshot(e,t,s,i){f({kind:"userflow:crxScreenshot",x:e,y:t,width:s,height:i,devicePixelRatio:window.devicePixelRatio});var n;return(await(n=e=>"userflow:crxScreenshotResult"===e.kind?e:null,new Promise((e=>{T((t=>{const s=n(t);return!!s&&(e(s),!0)}))})))).imageDataUrl}}var m,k,A,U,L,R,y,v,O,N,_,b,D,F,M,P,B,x,H,G,W,$,V,j,K,z,Y,J,X,Z,Q,q,ee,te,se,ie,ne,oe,re,ae,ce,le,de,he,ue,Ee,fe,Te,we,Se,pe,ge,Ie,Ce,me,ke,Ae,Ue,Le,Re,ye,ve,Oe,Ne,_e,be,De,Fe,Me,Pe,Be,xe,He,Ge,We,$e;(k=m||(m={})).ACTION="ACTION",k.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",k.REPLACED="REPLACED",k.SNOOZED="SNOOZED",k.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",k.USERFLOWJS="USERFLOWJS",k.USER_CLOSED="USER_CLOSED",(U=A||(A={})).SECOND="SECOND",U.MINUTE="MINUTE",U.HOUR="HOUR",U.DAY="DAY",(R=L||(L={})).ACTION="ACTION",R.DRAFT="DRAFT",R.LINK="LINK",R.LAUNCHER_SEEN="LAUNCHER_SEEN",R.RESOURCE_CENTER="RESOURCE_CENTER",R.USERFLOWJS="USERFLOWJS",(v=y||(y={})).LIKE="LIKE",v.DISLIKE="DISLIKE",(N=O||(O={})).STRING="STRING",N.BOOLEAN="BOOLEAN",N.NUMBER="NUMBER",N.DATETIME="DATETIME",N.LIST="LIST",N.RANDOM_AB="RANDOM_AB",N.RANDOM_NUMBER="RANDOM_NUMBER",(b=_||(_={})).FLOW="FLOW",b.CHECKLIST="CHECKLIST",b.LAUNCHER="LAUNCHER",b.RESOURCE_CENTER="RESOURCE_CENTER",(F=D||(D={})).ALWAYS_TRUE="ALWAYS_TRUE",F.ATTRIBUTE="ATTRIBUTE",F.CLAUSE="CLAUSE",F.ELEMENT="ELEMENT",F.FILLED_IN_INPUT="FILLED_IN_INPUT",F.FLOW="FLOW",F.INPUT_VALUE="INPUT_VALUE",F.PAGE="PAGE",F.TIME="TIME",function(e){e.AUTO="AUTO",e.MANUAL="MANUAL"}(M||(M={})),(P||(P={})).INPUT="INPUT",(x=B||(B={})).ABSOLUTE_EQ="ABSOLUTE_EQ",x.ABSOLUTE_GT="ABSOLUTE_GT",x.ABSOLUTE_LT="ABSOLUTE_LT",x.AND="AND",x.BETWEEN="BETWEEN",x.CONTAINS="CONTAINS",x.EMPTY="EMPTY",x.ENDS_WITH="ENDS_WITH",x.EQ="EQ",x.EXCLUDES_ALL="EXCLUDES_ALL",x.EXCLUDES_ANY="EXCLUDES_ANY",x.FALSE="FALSE",x.GT="GT",x.GTE="GTE",x.INCLUDES_ALL="INCLUDES_ALL",x.INCLUDES_ANY="INCLUDES_ANY",x.LT="LT",x.LTE="LTE",x.NE="NE",x.NOT_CONTAINS="NOT_CONTAINS",x.NOT_EMPTY="NOT_EMPTY",x.NOT_REGEX="NOT_REGEX",x.OR="OR",x.REGEX="REGEX",x.RELATIVE_EQ="RELATIVE_EQ",x.RELATIVE_GT="RELATIVE_GT",x.RELATIVE_LT="RELATIVE_LT",x.STARTS_WITH="STARTS_WITH",x.TRUE="TRUE",x.URL="URL",(G=H||(H={})).CLICK="CLICK",G.DISABLED="DISABLED",G.MOUSEDOWN="MOUSEDOWN",G.NOT_CLICK="NOT_CLICK",G.NOT_DISABLED="NOT_DISABLED",G.NOT_PRESENT="NOT_PRESENT",G.PRESENT="PRESENT",($=W||(W={})).ASSET="ASSET",$.CARTOON="CARTOON",$.NONE="NONE",$.URL="URL",(j=V||(V={})).INSIDE="INSIDE",j.OUTSIDE="OUTSIDE",(z=K||(K={})).TOP_LEFT="TOP_LEFT",z.TOP_CENTER="TOP_CENTER",z.TOP_RIGHT="TOP_RIGHT",z.BOTTOM_RIGHT="BOTTOM_RIGHT",z.BOTTOM_CENTER="BOTTOM_CENTER",z.BOTTOM_LEFT="BOTTOM_LEFT",z.CENTER="CENTER",(J=Y||(Y={})).GOOGLE="GOOGLE",J.STANDARD="STANDARD",(Z=X||(X={})).DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",Z.DISMISS="DISMISS",(q=Q||(Q={})).DISMISS="DISMISS",q.NONE="NONE",(te=ee||(ee={})).DEFAULT="DEFAULT",te.PLAINTEXT="PLAINTEXT",(ie=se||(se={})).CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",ie.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",ie.NONE="NONE",(oe=ne||(ne={})).BUBBLE="BUBBLE",oe.END="END",oe.ERROR="ERROR",oe.FLAG="FLAG",(ae=re||(re={})).MANUAL="MANUAL",ae.NONE="NONE",ae.SYNTHETIC="SYNTHETIC",(le=ce||(ce={})).BUBBLE="BUBBLE",le.HIDDEN="HIDDEN",le.MODAL="MODAL",le.TOOLTIP="TOOLTIP",(he=de||(de={})).ABOVE="ABOVE",he.BELOW="BELOW",he.LEFT="LEFT",he.RIGHT="RIGHT",(Ee=ue||(ue={})).CLOSE_FLOW="CLOSE_FLOW",Ee.EVAL_JS="EVAL_JS",Ee.GO_TO_STEP="GO_TO_STEP",Ee.NAVIGATE="NAVIGATE",Ee.SET_ATTRIBUTE="SET_ATTRIBUTE",Ee.SNOOZE="SNOOZE",Ee.START_FLOW="START_FLOW",(Te=fe||(fe={})).NEW_TAB="NEW_TAB",Te.SAME_TAB="SAME_TAB",(Se=we||(we={})).SET="SET",Se.SET_ONCE="SET_ONCE",Se.ADD="ADD",Se.SUBTRACT="SUBTRACT",Se.APPEND="APPEND",Se.PREPEND="PREPEND",Se.REMOVE="REMOVE",Se.UNSET="UNSET",(ge=pe||(pe={})).MULTILINE_TEXT="MULTILINE_TEXT",ge.MULTIPLE_CHOICE="MULTIPLE_CHOICE",ge.NPS="NPS",ge.SCALE="SCALE",ge.STARS="STARS",ge.TEXT="TEXT",(Ce=Ie||(Ie={})).ACTION="ACTION",Ce.ASSISTANT="ASSISTANT",Ce.CHECKLIST="CHECKLIST",Ce.CONTACT="CONTACT",Ce.DIVIDER="DIVIDER",Ce.FLOWS="FLOWS",Ce.KNOWLEDGE_BASE="KNOWLEDGE_BASE",Ce.MESSAGE="MESSAGE",Ce.SUBPAGE="SUBPAGE",(ke=me||(me={})).CRISP="CRISP",ke.CUSTOM="CUSTOM",ke.FRESHCHAT="FRESHCHAT",ke.HELPSCOUT="HELPSCOUT",ke.HUBSPOT="HUBSPOT",ke.INTERCOM="INTERCOM",ke.ZENDESK="ZENDESK",ke.ZENDESK_MESSENGER="ZENDESK_MESSENGER",(Ue=Ae||(Ae={})).BUTTON="BUTTON",Ue.INPUT="INPUT",(Re=Le||(Le={})).LAUNCHER_CLICK="LAUNCHER_CLICK",Re.LAUNCHER_HOVER="LAUNCHER_HOVER",Re.TARGET_CLICK="TARGET_CLICK",Re.TARGET_HOVER="TARGET_HOVER",Re.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",Re.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",(ve=ye||(ye={})).ACTIVATE="ACTIVATE",ve.DEACTIVATE="DEACTIVATE",ve.NEVER="NEVER",(Ne=Oe||(Oe={})).AUTO="AUTO",Ne.TOP="TOP",Ne.RIGHT="RIGHT",Ne.BOTTOM="BOTTOM",Ne.LEFT="LEFT",(be=_e||(_e={})).START="START",be.CENTER="CENTER",be.END="END",(Fe=De||(De={})).PERCENT="PERCENT",Fe.PX="PX",(Pe=Me||(Me={})).BEACON="BEACON",Pe.BUTTON="BUTTON",Pe.HIDDEN="HIDDEN",Pe.ICON="ICON",(xe=Be||(Be={})).LAUNCHER="LAUNCHER",xe.TARGET="TARGET",(Ge=He||(He={})).ACTIVE="ACTIVE",Ge.COMPLETED="COMPLETED",Ge.ENDED="ENDED",Ge.NOT_SEEN="NOT_SEEN",($e=We||(We={})).HIGHLIGHT="HIGHLIGHT",$e.MODAL="MODAL",$e.HIGHLIGHT_MODAL="HIGHLIGHT_MODAL";const Ve={customInputs:[],customNavigate:null,urlFilter:null,customScrollIntoView:null,scrollPadding:null,inferenceAttributeNames:["data-for","data-id","data-testid","data-test-id","for","id","name","placeholder","role"],inferenceAttributeFilters:{id:[e=>!e.match(/\d$/)],"data-id":[e=>!e.match(/\d$/)]},inferenceClassNameFilters:[e=>!e.startsWith("css-")],baseZIndex:1234500};function je(e){return Array.isArray(e)||(e=e?[e]:[]),e=e.map((e=>"string"==typeof e?new RegExp(e):e))}function Ke(e,t){return e.every((e=>"function"==typeof e?e(t):!(e instanceof RegExp)||e.test(t)))}function ze(){let e=d();if(Ve.urlFilter){if(e=Ve.urlFilter(e),"string"!=typeof e)throw new o("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(e)}catch(t){throw new o("Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.\nReturned URL: "+e+"\nError message: "+t.message)}}return e}let Ye="";try{Ye=localStorage.getItem("debug")||""}catch(ot){}const Je=Ye.split(",").some((e=>"*"===e||e.startsWith("userflow:*"))),Xe=Qe("log");let Ze;function Qe(e){return function(t,...s){if(Je){const i=performance.now(),n=Ze?Math.round(i-Ze):0;Ze=i,console[e](`%cuserflow %c${t} %c+${n}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}Xe.group=Qe("group"),Xe.groupCollapsed=Qe("groupCollapsed"),Xe.groupEnd=function(){Je&&console.groupEnd()};const qe=()=>n((()=>import("./ResourceCenterApp.js").then((function(e){return e.R}))),[new URL("ResourceCenterApp.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("z-index.js",import.meta.url).toString(),new URL("BubbleToolbar.js",import.meta.url).toString(),new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString(),new URL("stylesheets.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-regular-svg-icons.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-solid-svg-icons.js",import.meta.url).toString(),new URL("vendor.obj-str.js",import.meta.url).toString(),new URL("logomark.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("ChecklistUI.js",import.meta.url).toString()]);function et(e){const t=e.version.checklist.tasks.length;return Math.max(0,t-e.taskCompletions.length)}class tt{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 e of this.observers)e()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const st=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit"],it=import.meta.url;class nt{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.featureFlags=new Set,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.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=!1,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],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.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.onBuilderMessage=e=>(this.handleBuilderMessage(e),!1),this.handleBuilderMessage=async e=>{Xe(`builder ${e.kind} message received`,e);const t="idempotencyKey"in e&&"string"==typeof e.idempotencyKey?e.idempotencyKey:null;if(t&&this.idempotencyKeysSeen.has(t))return;const s=()=>{t&&this.idempotencyKeysSeen.add(t)};switch(e.kind){case"userflow:selectElement":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),void this.setSessionStorageState((t=>({...t,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}})));case"userflow:selectElementCancel":return void this.setSessionStorageState((e=>({...e,activeApp:null,elementSelection:null})));case"userflow:startFlowWithToken":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),c.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),void this.onceIdentified((()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const t=()=>{const s=this.resourceCenterSession;s&&s.draftMode&&s.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",t))};this.on("resourceCenterChanged",t),t()}}));case"userflow:testTracker":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),void this.setSessionStorageState((t=>({...t,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}})));case"userflow:testTrackerCancel":return void this.setSessionStorageState((e=>({...e,activeApp:null,trackerTesting:null})))}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout((()=>this.flushUrlChange()),50))},this.onUserActivity=()=>this.ensureConnected(),this.remountIfNecessary=()=>{this.ui?.container&&!document.contains(this.ui.container)&&(Xe("remounting UI because container was missing"),this.remount())},Xe("constructor, build=1003662"),p(this.onUrlChange),this.setTargetEnv(new C),this.checkTestUserAtBoot(),this.toggleUI();for(const e of st)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){Xe("destroy"),this.reset(),g(this.onUrlChange),this.destroyTargetEnv();for(const e of st)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 o("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const t=e(this.getSessionStorageState());c.setItem("userflowClientState",JSON.stringify(t)),this.sessionStorageState=t,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const t=c.getItem("userflowClientState");if(t)try{e=JSON.parse(t)}catch(ot){console.error("Userflow.js: Parse ElementSelectionState error:",ot)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null})}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(Xe("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState((t=>({...t,testUser:e}))),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const t=[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:s}=e;s&&(this.groupId=s.id,t.push(this.group(s.id,{name:s.name},{signature:s.signature}))),await Promise.all(t)}resetTestUser(){this.setSessionStorageState((e=>({...e,testUser:null})))}init(e){if(Xe("init",e),!e)throw new o("userflow.init() was called but missing Userflow.js Token");this.clientToken!==e&&(this.testUserIdentified?Xe("init() ignoring new token since a test user has been identified"):(this.clientToken&&(Xe("init() resetting due to new client token"),this.reset()),this.clientToken=e))}ensureInit(){if(!this.clientToken)throw new o("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new o("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new o("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId)return;if(this.debounceInactiveDisconnect(),this.socket)return;this._socketStatus="connecting",Xe("connecting to socket");let t=Ve.serverEndpoint||"e.userflow.com";"js.getuserflow.com"===new URL(it).hostname&&"e.userflow.com"===t&&(t="e.getuserflow.com");const s="wss://"+t+"/end-users/"+this.clientToken+"/socket";this.socket=new e(s,{reconnectAfterMs:e=>[100,500,1e3,5e3][e-1]||1e4,timeout:2e4}),this.socket.connect(),this.socket.onOpen((()=>{Xe("socket opened")})),this.socket.onClose((()=>{this.emit("private:disconnect")})),this.socket.onError((e=>{console.log("Userflow.js socket error",e),this.reportCspIssue()})),this.channel=this.socket.channel(`end_users:${this.externalId}`,(()=>this.makeChannelJoinPayload())),this.channel.join().receive("ok",(e=>{this.logrocketAppId=e.logrocketAppId,this.featureFlags=new Set(e.featureFlags),Xe("channel joined"),"connected"!==this._socketStatus&&(this._socketStatus="connected")})).receive("error",(e=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(e.code)?(console.error(`Userflow.js resetting due to: [${e.code}] ${e.message}`),this.reset(),this.clientToken=null):"invalid_protocol_version"===e.code?(console.error(`Userflow.js destroying due to: [${e.code}] ${e.message}`),this.destroy()):console.log("Userflow.js channel join error",e)})),this.channel.on("server_message",(e=>this.handleServerMessage(e))),this.channel.on("server_error",(e=>{console.log(`Userflow.js server error (${e.code}): ${e.message}`+(e.details&&e.details.length>0?"\nDetails:\n"+e.details.map((e=>(e.path?`${e.path}: `:"")+e.message)):""))}))}makeChannelJoinPayload(){const e=this.buildClientContext();this.clientContext=e;const t={protocolVersion:2,userflowClientBuild:"1003662",signature:this.signature,groupExternalId:this.groupId,groupSignature:this.groupSignature,flowSessionId:this.flowSession?.id||null,checklistSessionId:this.checklistSession?.id||null,resourceCenterSessionId:this.resourceCenterSession?.id||null,launchers:this.launcherSessions.map((e=>({flowId:e.flow.id}))),trackers:Array.from(this.trackers.values()).map((e=>({flowId:e.tracker.flowId}))),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map((e=>({conditionId:e.condition.id,isTrue:e.isTrue}))),previewFlowId:c.getItem("previewFlowId"),clientContext:e};return Xe("channel join payload",t),t}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((()=>{this.hasDraftSession()||this.assistantMessageInProgress?this.debounceInactiveDisconnect():(Xe("disconnecting from socket due to inactivity"),this.disconnect())}),3e5)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some((e=>e.draftMode))}async send(e,{batch:t,endBatch:s,handlesRejection:i}={}){return this.inBatch&&["ToggleClientCondition","UpdateClientContext"].includes(e.kind)||this.checkPushRateLimit(),this.ensureConnected(),t&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),s?this.endBatch():this.endBatchTimeout=window.setTimeout((()=>{this.endBatch()}),50)),this.sendRaw(e,{handlesRejection:i})}async sendRaw(e,{handlesRejection:t}={}){return new Promise(((s,i)=>{if(!this.channel){const s=`Userflow.js: send() should not be called if channel is not set. Message kind=${e.kind}`;if(t)throw Error(s);return void console.log(s,"\nClient message:",e)}Xe(`push ${e.kind} message`,e);const n=this.clientClock,r=()=>{this.serverClock=n,this.channel?.off("phx_error",a)},a=this.channel.on("phx_error",(s=>{r();const n=`Userflow.js send ${e.kind} got phx_error`;console.log(n,"\nClient message:",e,"\nError:",s),t&&i(new o(n))}));this.channel.push("client_message",e).receive("ok",(e=>{r(),s(e)})).receive("error",(t=>{r();const s=`Userflow.js error reply (${t.code}): ${t.message}`;console.log(s,"\nClient message:",e,"\nError:",t),i(new o(s,t.code,t.message))}))}))}endBatch(){this.inBatch=!1,this.sendRaw({kind:"EndBatch"})}checkPushRateLimit(){const e=Date.now();if(this.pushRateLimitMinuteExpires<e&&(this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=e+6e4),this.pushRateLimitMinute>=100)throw new o("This Userflow.js client has reached a maximum of 100 operations in the last 1 minute. This is usually due to one of the following:\n\n - Excessive calls to Userflow.js. Check if any of userflow.track(), userflow.identify(), userflow.updateUser() or similar are called repeatedly.\n - The URL changing too frequently. Look into https://userflow.com/docs/userflow-js#seturlfilter and filter out the changing part of the URL.\n - The user legitimately being very active, in which case you can just ignore this error.\n \n If in doubt, reach out to us at support@userflow.com.");this.pushRateLimitMinute++}handleServerMessage(e){Xe(`received ${e.kind} message`,e);const{serverClock:t,flowSession:s,flowSessionClock:i,checklistSession:n,checklistSessionClock:o,resourceCenterSession:r}=this;switch(e.kind){case"CheckSessionsAck":case"ServerDebug":return;case"AddLauncher":{const{session:t}=e,s=this.launcherSessions.findIndex((e=>e.flow.id===t.flow.id));return this.launcherSessions=-1===s?[...this.launcherSessions,t]:[...this.launcherSessions.slice(0,s),t,...this.launcherSessions.slice(s+1)],void this.toggleUI()}case"AddTracker":return void this.addTracker(e.tracker);case"AssistantMessageEventWrapper":return void this.emit("private:assistantMessageEvent",e);case"CancelConditionWaitTimer":return window.clearTimeout(this.conditionWaitTimers.get(e.conditionId)),void this.conditionWaitTimers.delete(e.conditionId);case"ChecklistTaskCompleted":return void this.unackedTasks.add(e.taskCvid);case"ForceGoToStep":return i>t?void Xe(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`):void(s?.id===e.sessionId&&this.emit("gotostep",{session:s,step:{id:e.stepId}}));case"RemoveLauncher":return void(this.removeLauncher(e.flowId)&&this.toggleUI());case"RemoveTracker":return void this.removeTracker(e.flowId);case"SetChecklistSession":return void(o<=t||n?.id===e.session.id?(this.setChecklistSession(e.session,t),this.toggleUI()):Xe(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${o} > serverClock=${t}`));case"SetFlowSession":return void(i<=t||s?.id===e.session.id?(this.setFlowSession(e.session,t),this.toggleUI()):Xe(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`));case"SetResourceCenterSession":return this.setResourceCenterSession(e.session),void this.toggleUI();case"StartConditionWaitTimer":if(!this.conditionWaitTimers.has(e.conditionId)){const t=window.setTimeout((()=>{this.conditionWaitTimers.delete(e.conditionId),this.send({kind:"FireConditionWaitTimer",conditionId:e.conditionId},{batch:!0})}),1e3*parseFloat(e.waitTime));this.conditionWaitTimers.set(e.conditionId,t)}return;case"TrackClientCondition":return void this.trackClientCondition(e.condition);case"UnsetChecklistSession":return o>t?void Xe(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${o} > serverClock=${t}`):void(n?.id===e.sessionId&&(this.setChecklistSession(null,t),this.toggleUI()));case"UnsetFlowSession":return i>t?void Xe(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`):void(s?.id===e.sessionId&&(this.setFlowSession(null,t),this.toggleUI()));case"UnsetResourceCenterSession":return void(r?.id===e.sessionId&&(this.setResourceCenterSession(null),this.toggleUI()));case"UntrackClientCondition":return void this.untrackClientCondition(e.conditionId);default:return void console.warn("Userflow.js: Received unknown message",e)}}async identify(e,t={},{signature:s}={}){if(Xe("identify",e),this.ensureInit(),this.testUserIdentified&&e!==this.externalId)Xe("identify() ignored since a test user has been identified");else{if("number"==typeof e)e=String(e);else if(!e||"string"!=typeof e)throw new o(`userflow.identify: First argument must be a non-empty string representing the user's ID in your database. Value received: ${JSON.stringify(e)}`);this.externalId&&e!==this.externalId&&(Xe("identify resetting due to new externalId"),this.reset()),this.externalId=e,this.signature=s||null,this.observeUserActivity(),await Promise.all([this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(t)},{batch:!0}),this.onFirstIdentify()]),this.emit("private:identified")}}async identifyAnonymous(e={},s={}){if(!a.isSupported())throw new o("userflow.identifyAnonymous() is not supported when localStorage access is denied.");const i="anonymousId";let n=a.getItem(i);n||(n="anon-"+t(),a.setItem(i,n)),await this.identify(n,e,s)}async updateUser(e={},t={}){Xe("updateUser"),this.ensureIdentified(),await this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(e)},{batch:!0})}async group(e,t={},{signature:s,membership:i}={}){if(Xe("group",e),this.ensureIdentified(),this.testUserIdentified&&e!==this.groupId)Xe("group() ignored since a test user has been identified");else{if("number"==typeof e)e=String(e);else if(!e||"string"!=typeof e)throw new o(`userflow.group: First argument must be a non-empty string representing the group's ID in your database. Value received: ${JSON.stringify(e)}`);this.groupId=e,this.groupSignature=s||null,await this.send({kind:"UpsertGroup",groupExternalId:e,groupSignature:this.groupSignature,groupAttributes:this.normalizeAttributes(t),membershipAttributes:this.normalizeAttributes(i)},{batch:!0})}}async updateGroup(e={},t={}){Xe("updateGroup");const s=this.ensureGroup();await this.send({kind:"UpsertGroup",groupExternalId:s,groupSignature:this.groupSignature,membershipAttributes:this.normalizeAttributes(t.membership),groupAttributes:this.normalizeAttributes(e)},{batch:!0})}normalizeAttributes(e){if(null==e)return{};if("object"!=typeof e)throw new o("Userflow: 'attributes' must be an object.");const t={};for(const s in e){if(!e.hasOwnProperty(s))continue;if("traits"===s){const i=e[s];Object.assign(t,this.extractLegacyTraits(i));continue}let i=e[s];if("string"==typeof i||"number"==typeof i||"boolean"==typeof i||null==i||Array.isArray(i))t[s]=this.normalizeAttributeLiteralOrList(s,i);else{if("object"!=typeof i||null==i)throw new o(`Userflow: Invalid value for '${s}' attribute.`);if("set"in i)t[s]={set:this.normalizeAttributeLiteralOrList(s,i.set),dataType:this.normalizeDataType(s,i.data_type||i.dataType)};else if("set_once"in i||"setOnce"in i)t[s]={setOnce:this.normalizeAttributeLiteralOrList(s,i.set_once??i.setOnce),dataType:this.normalizeDataType(s,i.data_type||i.dataType)};else if("add"in i){const e=i.add;if("string"!=typeof e&&"number"!=typeof e)throw new o(`Userflow: Invalid 'add' value for '${s}' attribute. Must be a number or string.`);t[s]={add:e}}else if("subtract"in i){const e=i.subtract;if("string"!=typeof e&&"number"!=typeof e)throw new o(`Userflow: Invalid 'subtract' value for '${s}' attribute. Must be a number or string.`);t[s]={subtract:e}}else if("append"in i)t[s]={append:this.normalizeAttributeLiteralOrList(s,i.append)};else if("prepend"in i)t[s]={prepend:this.normalizeAttributeLiteralOrList(s,i.prepend)};else{if(!("remove"in i))throw new o(`Userflow: Invalid value for '${s}' attribute.`);t[s]={remove:this.normalizeAttributeLiteralOrList(s,i.remove)}}}}return t}normalizeAttributeLiteralOrList(e,t){return Array.isArray(t)?t.map((t=>this.normalizeAttributeLiteral(e,t))):this.normalizeAttributeLiteral(e,t)}normalizeAttributeLiteral(e,t){if(null==t)return null;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return t;throw new o(`Userflow: Invalid value for '${e}' attribute.`)}normalizeDataType(e,t){if(!t)return null;switch(t){case"string":return O.STRING;case"number":return O.NUMBER;case"boolean":return O.BOOLEAN;case"datetime":return O.DATETIME}throw new o(`Userflow: Invalid data_type for '${e}' attribute.`)}extractLegacyTraits(e){if(!e)return{};if(!Array.isArray(e)){const t=[];for(const s in e)e.hasOwnProperty(s)&&t.push({name:s,value:e[s]});e=t}return e.reduce(((e,{name:t,value:s,dataType:i})=>{if("string"!=typeof t||t.length>100||!t.match(/^[a-z0-9_]+$/))return this.warn("Userflow.identify: Invalid trait name (must be string, no more than 100 characters, and only consist of a-z, 0-9 and underscores). The trait will be ignored. Name was:",t),e;if("string"==typeof s);else if("boolean"==typeof s)i||(i="boolean"),s=s?"true":"false";else{if("number"!=typeof s)return this.warn(`userflow.identify: The value of trait '${t}' is invalid (must be a string, a boolean or a number). The trait will be ignored. Value was:`,s),e;i||(i=Number.isInteger(s)?"integer":"decimal"),s=String(s)}let n=null;if(i)switch(i){case"string":n=O.STRING;break;case"boolean":n=O.BOOLEAN;break;case"integer":case"decimal":n=O.NUMBER;break;case"datetime":n=O.DATETIME;break;default:return this.warn(`userflow.identify: The data type of trait '${t}' is invalid (must be a 'string', 'boolean', 'integer', 'decimal' or 'datetime'). The trait will be ignored. Data type was:`,i),e}return e[t]={set:s,dataType:n},e}),{})}async track(e,t={},{userOnly:s}={}){Xe(`track '${e}'`,t),this.ensureIdentified(),await this.send({kind:"TrackEvent",userOnly:!!s,name:e,attributes:this.normalizeEventAttributes(t)},{batch:!0})}normalizeEventAttributes(e){const t=this.normalizeAttributes(e);for(const s in t){if(!t.hasOwnProperty(s))continue;const e=t[s];if(null!=e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Array.isArray(e)&&!("set"in e))throw new o(`Userflow: Invalid value for '${s}' attribute. Event attributes only support literal values, list values and 'set' changes.`)}return t}onFirstIdentify(){this.onFirstIdentifyRun||(this.onFirstIdentifyRun=!0,this.onFirstIdentifyTimeout=window.setTimeout((()=>{this.trackPageViewed(),this.firstIdentifyCallback?(this.firstIdentifyCallback(),this.firstIdentifyCallback=null):this.checkUrlForStartFlow()}),0))}onceIdentified(e){this.isIdentified()?e():this.firstIdentifyCallback=e}checkUrlForStartFlow(){const e=new URL(d()),t=e.searchParams.get("userflow")||e.searchParams.get("studio1_flow")||e.searchParams.get("studio1_walkthrough");t&&(Xe(`url contained flow ${t}`),this.startFlow({flowId:t,startReason:L.LINK,batch:!0}),e.searchParams.delete("userflow"),e.searchParams.delete("studio1_flow"),e.searchParams.delete("studio1_walkthrough"),window.history.replaceState({},"",e.toString()),this.clientContext=this.buildClientContext(),this.pushUpdateClientContext())}flushUrlChange(){const e=this.buildClientContext();this.clientContext&&e.pageUrl===this.clientContext.pageUrl||(this.clientContext=e,this.pushUpdateClientContext(),this.trackPageViewed(),this.checkUrlForStartFlow())}async trackPageViewed(){this.pageTrackingDisabled||this.track("page_viewed",{})}buildClientContext(){return{pageUrl:ze(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}pushUpdateClientContext(){this.send({kind:"UpdateClientContext",clientContext:this.clientContext},{batch:!0})}ackCompletedTask(e){this.unackedTasks.delete(e)}taskIsUnacked(e){return this.unackedTasks.has(e)}isIdentified(){return null!=this.externalId}on(e,t){let s=this.listeners.get(e);s||(s=new Set,this.listeners.set(e,s)),s.add(t)}off(e,t){const s=this.listeners.get(e);s&&s.delete(t)}emit(e,...t){const s=this.listeners.get(e);if(s){Array.from(s).forEach((e=>e(...t)))}}observeUserActivity(){document.addEventListener("mouseover",this.onUserActivity),document.addEventListener("pointerdown",this.onUserActivity),document.addEventListener("keydown",this.onUserActivity)}unobserveUserActivity(){document.removeEventListener("mouseover",this.onUserActivity),document.removeEventListener("pointerdown",this.onUserActivity),document.removeEventListener("keydown",this.onUserActivity)}reset(){Xe("reset"),this.externalId=null,this.groupId=null,this.sessionStorageState=null,this.setFlowSession(null,0),this.setChecklistSession(null,0),this.setResourceCenterSession(null),this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.unackedTasks=new Set,this.onFirstIdentifyRun=!1,window.clearTimeout(this.onFirstIdentifyTimeout),this.onFirstIdentifyTimeout=void 0,this.clientContext=null,this.unobserveUserActivity(),window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=void 0,this.clientConditions.forEach(((e,t)=>{this.untrackClientCondition(t)})),this.firstIdentifyCallback=null,this.testUserIdentified=!1,a.removeItem("anonymousId"),this.unmountUI(),this.disconnect(),this.inBatch=!1,window.clearTimeout(this.endBatchTimeout),this.endBatchTimeout=void 0,this.clientClock=1,this.serverClock=1}async startFlow({flowId:e,stepCvid:t,startReason:s,once:i,batch:n,replaceCurrent:o}){if(this.ensureIdentified(),o&&this.flowSession&&this.endFlow(this.flowSession,{endReason:m.REPLACED,batch:!0}),Xe(`startFlow ${e}`,{startReason:s}),this.checklistSession?.flow.id===e)return Xe("startFlow matches current checklist, so showing it instead"),void this.showChecklist();const r={kind:"StartFlow",flowId:e,stepCvid:t,startReason:s,once:!!i};await this.send(r,{batch:n})}async startFlowWithToken(e){this.ensureIdentified(),Xe("startFlowWithToken",{token:e}),await this.send({kind:"StartFlowWithToken",token:e},{batch:!0})}optimisticClockUIUpdate(e){this.clientClock++,e(),this.toggleUI()}async showChecklist(){this.resourceCenterEmbedsChecklist()?this.openResourceCenter():(this.unmarkExpandPending(),this.checklistSession&&!this.checklistExpanded&&(this.ensureIdentified(),this.checklistExpanded=!0,this.toggleUI(),c.setItem(`checklistExpanded:${this.checklistSession.id}`,"1"),await this.send({kind:"ShowChecklist",sessionId:this.checklistSession.id},{batch:!0})))}async hideChecklist(){this.resourceCenterEmbedsChecklist()?this.closeResourceCenter():this.checklistSession&&this.checklistExpanded&&(this.ensureIdentified(),this.checklistExpanded=!1,this.toggleUI(),c.removeItem(`checklistExpanded:${this.checklistSession.id}`),await this.send({kind:"HideChecklist",sessionId:this.checklistSession.id},{batch:!0}))}async unmarkExpandPending(){this.checklistSession&&this.checklistExpandPending&&(this.checklistExpandPending=!1,await this.send({kind:"UnmarkExpandPending",sessionId:this.checklistSession.id},{batch:!0}))}async openResourceCenter(){this.resourceCenterEmbedsChecklist()&&this.unmarkExpandPending(),this.resourceCenterSession&&!this.resourceCenterOpen&&(this.ensureIdentified(),this.resourceCenterOpen=!0,this.toggleUI(),this.emit("resourceCenterChanged"),c.setItem(`resourceCenterOpen:${this.resourceCenterSession.id}`,"1"),await this.send({kind:"OpenResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}async closeResourceCenter(){this.resourceCenterSession&&this.resourceCenterOpen&&(this.ensureIdentified(),this.resourceCenterOpen=!1,this.toggleUI(),this.emit("resourceCenterChanged"),c.removeItem(`resourceCenterOpen:${this.resourceCenterSession.id}`),await this.send({kind:"CloseResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}toggleResourceCenter(){this.resourceCenterOpen?this.closeResourceCenter():this.openResourceCenter()}setResourceCenterLauncherHidden(e){this.resourceCenterLauncherHidden=e,this.toggleUI()}getResourceCenterState(){if(!this.resourceCenterSession)return null;const e=this.resourceCenterEmbedsChecklist(),{checklistSession:t}=this;return{isOpen:this.resourceCenterOpen,hasChecklist:e,uncompletedChecklistTaskCount:e&&t?et(t):0}}resourceCenterEmbedsChecklist(){const e=this.resourceCenterSession;return!!e&&!!e.version.resourceCenter?.blocks.some((e=>e.type===Ie.CHECKLIST))}async endFlow(e,{endReason:t,batch:s}){this.ensureIdentified(),this.optimisticClockUIUpdate((()=>{const{clientClock:t}=this;this.flowSession?.id===e.id&&this.setFlowSession(null,t),this.checklistSession?.id===e.id&&this.setChecklistSession(null,t),this.resourceCenterSession?.id===e.id&&this.setResourceCenterSession(null)}));const{flow:i}=e,n={id:i.id,type:i.type.toLowerCase()};i.type===_.CHECKLIST?this.emit("checklistEnded",{checklist:n,endReason:t}):i.type===_.FLOW&&this.emit("flowEnded",{flow:n,endReason:t});const o={kind:"EndFlow",sessionId:e.id,endReason:t};await this.send(o,{batch:s})}async goToStep(e,t){Xe("goToStep",e.id,t.name||t.id),this.ensureIdentified();const s=this.send({kind:"GoToStep",sessionId:e.id,stepId:t.id});e.currentStep=t,this.emit("gotostep",{session:e,step:t}),await s}async endAllFlows(){Xe("endAllFlows"),this.optimisticClockUIUpdate((()=>{const{clientClock:e}=this;this.setFlowSession(null,e),this.setChecklistSession(null,e)})),await this.send({kind:"EndAllFlows"})}async endChecklist(){Xe("endChecklist");const e=this.checklistSession||this.flowSession;e?.flow.type===_.CHECKLIST&&this.endFlow(e,{endReason:m.USERFLOWJS})}setFlowSession(e,t=this.clientClock){const s=this.flowSession;this.flowSession=e,this.flowSessionClock=t,e&&!s&&(this.hideChecklist(),this.closeResourceCenter()),null==e&&this.originalActiveElement&&("function"==typeof this.originalActiveElement.focus&&this.originalActiveElement.focus(),this.originalActiveElement=void 0)}setChecklistSession(e,t=this.clientClock){const s=this.checklistSession;this.checklistSession=e,this.checklistSessionClock=t,null===e&&(this.checklistExpanded=!1,this.checklistExpandPending=!1),e&&e.id!==s?.id&&(this.checklistExpanded=!!c.getItem(`checklistExpanded:${e.id}`),e.expandPending&&(this.checklistExpandPending=!0)),this.emit("checklistChanged"),this.emit("resourceCenterChanged")}setResourceCenterSession(e){const t=this.resourceCenterSession;this.resourceCenterSession=e,null===e&&(this.resourceCenterOpen=!1),t&&t.id!==e?.id&&c.removeItem(`resourceCenterOpen:${t.id}`),e&&e.id!==t?.id&&(this.resourceCenterOpen=!!c.getItem(`resourceCenterOpen:${e.id}`)),this.emit("resourceCenterChanged")}launcherSeen(e){this.send({kind:"StartFlow",flowId:e,startReason:L.LAUNCHER_SEEN,once:!1})}activateLauncher(e){const t=this.activeLauncherFlowId&&this.launcherSessions.find((e=>e.flow.id===this.activeLauncherFlowId));t&&this.deactivateLauncher(t),this.activeLauncherFlowId=e.flow.id,this.toggleUI(),this.send({kind:"ActivateLauncher",flowId:e.flow.id})}deactivateLauncher(e){const{launcher:t}=e.version;e.flow.id===this.activeLauncherFlowId&&(t?.dismissOn===ye.DEACTIVATE?this.dismissLauncher(e,{endReason:m.LAUNCHER_DEACTIVATED}):(this.activeLauncherFlowId=null,this.toggleUI()))}dismissLauncher(e,{endReason:t}){const s=e.flow.id;this.removeLauncher(s),this.toggleUI(),this.send({kind:"DismissLauncher",flowId:s,endReason:t})}removeLauncher(e){const t=this.launcherSessions.findIndex((t=>t.flow.id===e));return-1!==t&&(this.launcherSessions=[...this.launcherSessions.slice(0,t),...this.launcherSessions.slice(t+1)],e===this.activeLauncherFlowId&&(this.activeLauncherFlowId=null),!0)}async toggleUI(){this.flowSession||!this.checklistExpandPending&&!this.checklistSession?.version.checklist?.tasks.some((e=>this.taskIsUnacked(e.cvid)))||this.showChecklist(),this.emit("uistatechange"),this.shouldBeMounted()?await this.mountUI():this.unmountUI()}shouldBeMounted(){if(this.uiDisabled)return!1;return!!this.getSessionStorageState().activeApp||!!this.flowSession||!!this.checklistSession&&(this.checklistExpanded||!!this.checklistSession?.version.checklist?.launcherEnabled)||!!this.resourceCenterSession&&(this.resourceCenterOpen||!this.resourceCenterLauncherHidden)||this.launcherSessions.length>0||this.notifications.length>0}async mountUI(){if(!this.ui){const e=await this.createUI();this.shouldBeMounted()&&!this.ui&&(Xe("mount UI"),this.ui=e,this.ui.mount())}}unmountUI(){this.ui&&(Xe("unmount UI"),this.ui.unmount(),this.ui=null)}remount(){this.unmountUI(),this.toggleUI()}async createUI(){try{const e=n((()=>import("./ui.js")),[new URL("ui.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("vendor.phoenix.js",import.meta.url).toString(),new URL("vendor.uuid.js",import.meta.url).toString()]);this.resourceCenterSession&&qe();const{RealUI:t}=await e;return new t(this)}catch(ot){throw this.reportCspIssue(),ot}}async trackClientCondition(e){if(this.clientConditions.has(e.id))return;Xe("track client condition",e),this.clientConditions.set(e.id,{condition:e,isTrue:null});const{conditionTypes:t}=await n((()=>import("./flow-condition-types.js").then((function(e){return e.u}))),[new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString()]),s=t[e.type],i=this.clientConditions.get(e.id);i&&(i.untrack=s.track({sessionData:new tt([]),condition:e,callback:t=>{i.isTrue!==t&&(Xe("client condition truthiness changed",t,i.condition),i.isTrue=t,this.send({kind:"ToggleClientCondition",conditionId:e.id,isTrue:t},{batch:!0}))}}))}untrackClientCondition(e){const t=this.clientConditions.get(e);t&&(Xe("untrack client condition",t.condition),t.untrack&&t.untrack(),this.clientConditions.delete(e))}async addTracker(e){let t=this.trackers.get(e.flowId);t?t.tracker=e:this.trackers.set(e.flowId,{tracker:e,isTrue:!1});const{conditionTypes:s}=await n((()=>import("./flow-condition-types.js").then((function(e){return e.u}))),[new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString()]),i=this.trackers.get(e.flowId);if(!i)return;const{tracker:o}=i,{condition:r}=o,a=s[r.type];i.untrack&&i.untrack(),i.untrack=a.track({sessionData:new tt(o.data),condition:r,flipBackEvents:!0,callback:e=>{const t=i.isTrue;i.isTrue=e,!t&&e&&this.send({kind:"TrackTrackerEvent",token:o.token},{batch:!0})}}),this.emit("private:trackerStarted")}removeTracker(e){const t=this.trackers.get(e);t&&(t.untrack&&t.untrack(),this.trackers.delete(e),this.emit("private:trackerStopped"))}reportCspIssue(){const e=this.getSessionStorageState();!this.testUserIdentified&&!e.activeApp||this.cspIssueReported||(this.cspIssueReported=!0,Xe("csp issue detected"),f({kind:"userflow:crxCspIssueDetected"}))}getAudio(){return this.audio||(this.audio=new Audio),this.audio}playAudio(e){if(document.hidden)return;const t=this.getAudio();e&&(t.src=e);const s=t.play();this.audioReady=!0,s&&s.catch((e=>{e.name}))}pauseAudio(){const e=this.audio;e&&!e.paused&&e.pause()}async getStepSpeech(e,t){return(await this.send({kind:"GetStepSpeechV2",syntheticVoice:e,text:t})).url}featureFlagEnabled(e){return this.featureFlags.has(e)}showNotification(e,t,s){const i={id:++this.notificationIdCounter,label:e,message:t,type:s};this.notifications=[...this.notifications,i],this.toggleUI()}dismissNotification(e){this.notifications=this.notifications.filter((t=>t.id!==e)),this.toggleUI()}warn(...e){console.warn(...e)}nextRef(){return this.refCounter++}}if(void 0===window.userflow||window.userflow._stubbed){const e=Object.assign(window.userflow||{},function(){const e=new nt;return{_stubbed:!1,init(t){e.init(t)},identify:(t,s={},i={})=>e.identify(t,s,i),identifyAnonymous:(t={},s={})=>e.identifyAnonymous(t,s),isIdentified:()=>e.isIdentified(),updateUser:(t,s={})=>e.updateUser(t,s),group:(t,s={},i={})=>e.group(t,s,i),updateGroup:(t,s={})=>e.updateGroup(t,s),track:(t,s={},i={})=>e.track(t,s,i),start:(t,{once:s}={})=>e.startFlow({flowId:t,startReason:L.USERFLOWJS,once:s}),startFlow:e=>(console.warn("Userflow.js: userflow.startFlow() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)),startWalk:e=>(console.warn("Userflow.js: userflow.startWalk() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)),endAll:()=>e.endAllFlows(),endChecklist:()=>e.endChecklist(),endAllFlows:()=>window.userflow.endAll(),async endFlow(){console.warn("Userflow.js: userflow.endFlow() has been deprecated and no longer has any effect.")},async endWalk(){console.warn("Userflow.js: userflow.endWalk() has been deprecated and no longer has any effect.")},openResourceCenter(){e.openResourceCenter()},closeResourceCenter(){e.closeResourceCenter()},toggleResourceCenter(){e.toggleResourceCenter()},setResourceCenterLauncherHidden(t){e.setResourceCenterLauncherHidden(t)},getResourceCenterState:()=>e.getResourceCenterState(),setWalkPosition(){console.warn("Userflow.js: userflow.setWalkPosition() has been deprecated and no longer has any effect.")},reset(){e.reset()},remount(){e.remount()},on(t,s){e.on(t,s)},off(t,s){e.off(t,s)},setCustomInputSelector(e){console.warn("Userflow.js: userflow.setCustomInputSelector() has been deprecated. Use userflow.registerCustomInput() instead. See docs: https://userflow.com/docs/userflow-js"),e&&Ve.customInputs.push({cssSelector:e})},registerCustomInput(e,t){Ve.customInputs.push({cssSelector:e,getValue:t})},setCustomNavigate(e){Ve.customNavigate=e},setUrlFilter(e){Ve.urlFilter=e},setInferenceAttributeNames(e){Ve.inferenceAttributeNames=e},setInferenceAttributeFilter(e,t){Ve.inferenceAttributeFilters[e]=je(t)},setInferenceClassNameFilter(e){Ve.inferenceClassNameFilters=je(e)},setScrollPadding(e){Ve.scrollPadding=e},setCustomScrollIntoView(e){Ve.customScrollIntoView=e},prepareAudio(){e.playAudio(null)},setShadowDomEnabled(e){console.warn("Userflow.js: userflow.setShadowDomEnabled() has been deprecated. Please remove this call from your Userflow.js snippet. Shadow DOM is supported by default now.")},setPageTrackingDisabled(t){e.pageTrackingDisabled=t},setBaseZIndex(e){Ve.baseZIndex=e},setServerEndpoint(e){Ve.serverEndpoint=e},_setTargetEnv(t){e.setTargetEnv(t)}}}());window.userflow=e,window.studio1=e,function(){const e=window.userflow,t=window.USERFLOWJS_QUEUE;if(delete window.USERFLOWJS_QUEUE,!t||0===t.length)return;Xe(`processing ${t.length} items in the queue`);for(const[s,i,n]of t){if("function"!=typeof e[s]){console.error(`Userflow.js: Invalid method '${s}' in queue`);continue}const t=e[s](...n);i&&t&&"function"==typeof t.then&&t.then(i.resolve,i.reject)}Xe("queue processed")}()}export{W as A,V as B,me as C,X as D,m as E,B as F,ne as G,ce as H,K as I,de as J,Le as K,Me as L,Q as M,Oe as N,Be as O,_e as P,De as Q,qe as R,L as S,st as T,o as U,re as V,y as W,n as _,P as a,M as b,Ve as c,Xe as d,D as e,H as f,ze as g,Ie as h,c as i,et as j,se as k,ee as l,ue as m,Ae as n,p as o,_ as p,d as q,fe as r,l as s,Ke as t,g as u,we as v,pe as w,tt as x,Y as y,a as z};export default window.userflow;
1
+ import{S as e}from"./vendor.phoenix.js";import{v as t}from"./vendor.uuid.js";let s;const i={},n=function(e,t){if(!t)return e();if(void 0===s){const e=document.createElement("link").relList;s=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(t.map((e=>{if(e in i)return;i[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":s,t||(o.as="script",o.crossOrigin=""),o.href=e,document.head.appendChild(o),t?new Promise(((e,t)=>{o.addEventListener("load",e),o.addEventListener("error",t)})):void 0}))).then((()=>e()))};class o extends Error{constructor(e,t,s){super(e),Object.setPrototypeOf(this,o.prototype),this.name="UserflowError",this.code=t,this.humanMessage=s}}class r{constructor(e){this.type=e,this.testState={}}formatKey(e){return`userflow:${e}`}isSupported(){if("undefined"==typeof window)return!1;try{return null!=window[this.type]}catch{return!1}}getItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].getItem(e):null}setItem(e,t){e=this.formatKey(e),this.isSupported()&&window[this.type].setItem(e,t)}removeItem(e){if(e=this.formatKey(e),this.isSupported())return window[this.type].removeItem(e)}clear(){if(this.isSupported())return window[this.type].clear()}}const a=new r("localStorage"),c=new r("sessionStorage");function l(e){window.location.href=e}function d(){return window.location.href}var h,u,E;function f(e){window.postMessage(e,window.origin)}function T(e){const t=t=>{if(t.source!==window||t.origin!==window.origin)return;const i=t.data;i&&"object"==typeof i&&"string"==typeof i.kind&&i.kind.startsWith("userflow:")&&!0===e(i)&&s()};window.addEventListener("message",t);const s=()=>window.removeEventListener("message",t);return s}(h||(h={})).INPUT="INPUT",(E=u||(u={})).AUTO="AUTO",E.MANUAL="MANUAL";const w=new Set;let S=!1;function p(e){return function(){if(S)return;S=!0;const{history:e}=window,t=t=>{const s=e[t];e[t]=(...t)=>{s.apply(e,t),I()}};t("pushState"),t("replaceState"),window.addEventListener("popstate",(()=>{I()}))}(),w.add(e),()=>{g(e)}}function g(e){w.delete(e)}function I(){w.forEach((e=>e()))}class C{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(e){f({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})}onBuilderMessage(e){return this.unregisterOnMessage=T(e),!1}async captureScreenshot(e,t,s,i){f({kind:"userflow:crxScreenshot",x:e,y:t,width:s,height:i,devicePixelRatio:window.devicePixelRatio});var n;return(await(n=e=>"userflow:crxScreenshotResult"===e.kind?e:null,new Promise((e=>{T((t=>{const s=n(t);return!!s&&(e(s),!0)}))})))).imageDataUrl}}var m,k,A,U,L,R,y,v,O,N,_,b,D,F,M,P,B,x,H,G,W,$,V,j,K,z,Y,J,X,Z,Q,q,ee,te,se,ie,ne,oe,re,ae,ce,le,de,he,ue,Ee,fe,Te,we,Se,pe,ge,Ie,Ce,me,ke,Ae,Ue,Le,Re,ye,ve,Oe,Ne,_e,be,De,Fe,Me,Pe,Be,xe,He,Ge,We,$e;(k=m||(m={})).ACTION="ACTION",k.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",k.REPLACED="REPLACED",k.SNOOZED="SNOOZED",k.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",k.USERFLOWJS="USERFLOWJS",k.USER_CLOSED="USER_CLOSED",(U=A||(A={})).SECOND="SECOND",U.MINUTE="MINUTE",U.HOUR="HOUR",U.DAY="DAY",(R=L||(L={})).ACTION="ACTION",R.DRAFT="DRAFT",R.LINK="LINK",R.LAUNCHER_SEEN="LAUNCHER_SEEN",R.RESOURCE_CENTER="RESOURCE_CENTER",R.USERFLOWJS="USERFLOWJS",(v=y||(y={})).LIKE="LIKE",v.DISLIKE="DISLIKE",(N=O||(O={})).STRING="STRING",N.BOOLEAN="BOOLEAN",N.NUMBER="NUMBER",N.DATETIME="DATETIME",N.LIST="LIST",N.RANDOM_AB="RANDOM_AB",N.RANDOM_NUMBER="RANDOM_NUMBER",(b=_||(_={})).FLOW="FLOW",b.CHECKLIST="CHECKLIST",b.LAUNCHER="LAUNCHER",b.RESOURCE_CENTER="RESOURCE_CENTER",(F=D||(D={})).ALWAYS_TRUE="ALWAYS_TRUE",F.ATTRIBUTE="ATTRIBUTE",F.CLAUSE="CLAUSE",F.ELEMENT="ELEMENT",F.FILLED_IN_INPUT="FILLED_IN_INPUT",F.FLOW="FLOW",F.INPUT_VALUE="INPUT_VALUE",F.PAGE="PAGE",F.TIME="TIME",function(e){e.AUTO="AUTO",e.MANUAL="MANUAL"}(M||(M={})),(P||(P={})).INPUT="INPUT",(x=B||(B={})).ABSOLUTE_EQ="ABSOLUTE_EQ",x.ABSOLUTE_GT="ABSOLUTE_GT",x.ABSOLUTE_LT="ABSOLUTE_LT",x.AND="AND",x.BETWEEN="BETWEEN",x.CONTAINS="CONTAINS",x.EMPTY="EMPTY",x.ENDS_WITH="ENDS_WITH",x.EQ="EQ",x.EXCLUDES_ALL="EXCLUDES_ALL",x.EXCLUDES_ANY="EXCLUDES_ANY",x.FALSE="FALSE",x.GT="GT",x.GTE="GTE",x.INCLUDES_ALL="INCLUDES_ALL",x.INCLUDES_ANY="INCLUDES_ANY",x.LT="LT",x.LTE="LTE",x.NE="NE",x.NOT_CONTAINS="NOT_CONTAINS",x.NOT_EMPTY="NOT_EMPTY",x.NOT_REGEX="NOT_REGEX",x.OR="OR",x.REGEX="REGEX",x.RELATIVE_EQ="RELATIVE_EQ",x.RELATIVE_GT="RELATIVE_GT",x.RELATIVE_LT="RELATIVE_LT",x.STARTS_WITH="STARTS_WITH",x.TRUE="TRUE",x.URL="URL",(G=H||(H={})).CLICK="CLICK",G.DISABLED="DISABLED",G.MOUSEDOWN="MOUSEDOWN",G.NOT_CLICK="NOT_CLICK",G.NOT_DISABLED="NOT_DISABLED",G.NOT_PRESENT="NOT_PRESENT",G.PRESENT="PRESENT",($=W||(W={})).ASSET="ASSET",$.CARTOON="CARTOON",$.NONE="NONE",$.URL="URL",(j=V||(V={})).INSIDE="INSIDE",j.OUTSIDE="OUTSIDE",(z=K||(K={})).TOP_LEFT="TOP_LEFT",z.TOP_CENTER="TOP_CENTER",z.TOP_RIGHT="TOP_RIGHT",z.BOTTOM_RIGHT="BOTTOM_RIGHT",z.BOTTOM_CENTER="BOTTOM_CENTER",z.BOTTOM_LEFT="BOTTOM_LEFT",z.CENTER="CENTER",(J=Y||(Y={})).GOOGLE="GOOGLE",J.STANDARD="STANDARD",(Z=X||(X={})).DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",Z.DISMISS="DISMISS",(q=Q||(Q={})).DISMISS="DISMISS",q.NONE="NONE",(te=ee||(ee={})).DEFAULT="DEFAULT",te.PLAINTEXT="PLAINTEXT",(ie=se||(se={})).CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",ie.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",ie.NONE="NONE",(oe=ne||(ne={})).BUBBLE="BUBBLE",oe.END="END",oe.ERROR="ERROR",oe.FLAG="FLAG",(ae=re||(re={})).MANUAL="MANUAL",ae.NONE="NONE",ae.SYNTHETIC="SYNTHETIC",(le=ce||(ce={})).BUBBLE="BUBBLE",le.HIDDEN="HIDDEN",le.MODAL="MODAL",le.TOOLTIP="TOOLTIP",(he=de||(de={})).ABOVE="ABOVE",he.BELOW="BELOW",he.LEFT="LEFT",he.RIGHT="RIGHT",(Ee=ue||(ue={})).CLOSE_FLOW="CLOSE_FLOW",Ee.EVAL_JS="EVAL_JS",Ee.GO_TO_STEP="GO_TO_STEP",Ee.NAVIGATE="NAVIGATE",Ee.SET_ATTRIBUTE="SET_ATTRIBUTE",Ee.SNOOZE="SNOOZE",Ee.START_FLOW="START_FLOW",(Te=fe||(fe={})).NEW_TAB="NEW_TAB",Te.SAME_TAB="SAME_TAB",(Se=we||(we={})).SET="SET",Se.SET_ONCE="SET_ONCE",Se.ADD="ADD",Se.SUBTRACT="SUBTRACT",Se.APPEND="APPEND",Se.PREPEND="PREPEND",Se.REMOVE="REMOVE",Se.UNSET="UNSET",(ge=pe||(pe={})).MULTILINE_TEXT="MULTILINE_TEXT",ge.MULTIPLE_CHOICE="MULTIPLE_CHOICE",ge.NPS="NPS",ge.SCALE="SCALE",ge.STARS="STARS",ge.TEXT="TEXT",(Ce=Ie||(Ie={})).ACTION="ACTION",Ce.ASSISTANT="ASSISTANT",Ce.CHECKLIST="CHECKLIST",Ce.CONTACT="CONTACT",Ce.DIVIDER="DIVIDER",Ce.FLOWS="FLOWS",Ce.KNOWLEDGE_BASE="KNOWLEDGE_BASE",Ce.MESSAGE="MESSAGE",Ce.SUBPAGE="SUBPAGE",(ke=me||(me={})).CRISP="CRISP",ke.CUSTOM="CUSTOM",ke.FRESHCHAT="FRESHCHAT",ke.HELPSCOUT="HELPSCOUT",ke.HUBSPOT="HUBSPOT",ke.INTERCOM="INTERCOM",ke.ZENDESK="ZENDESK",ke.ZENDESK_MESSENGER="ZENDESK_MESSENGER",(Ue=Ae||(Ae={})).BUTTON="BUTTON",Ue.INPUT="INPUT",(Re=Le||(Le={})).LAUNCHER_CLICK="LAUNCHER_CLICK",Re.LAUNCHER_HOVER="LAUNCHER_HOVER",Re.TARGET_CLICK="TARGET_CLICK",Re.TARGET_HOVER="TARGET_HOVER",Re.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",Re.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",(ve=ye||(ye={})).ACTIVATE="ACTIVATE",ve.DEACTIVATE="DEACTIVATE",ve.NEVER="NEVER",(Ne=Oe||(Oe={})).AUTO="AUTO",Ne.TOP="TOP",Ne.RIGHT="RIGHT",Ne.BOTTOM="BOTTOM",Ne.LEFT="LEFT",(be=_e||(_e={})).START="START",be.CENTER="CENTER",be.END="END",(Fe=De||(De={})).PERCENT="PERCENT",Fe.PX="PX",(Pe=Me||(Me={})).BEACON="BEACON",Pe.BUTTON="BUTTON",Pe.HIDDEN="HIDDEN",Pe.ICON="ICON",(xe=Be||(Be={})).LAUNCHER="LAUNCHER",xe.TARGET="TARGET",(Ge=He||(He={})).ACTIVE="ACTIVE",Ge.COMPLETED="COMPLETED",Ge.ENDED="ENDED",Ge.NOT_SEEN="NOT_SEEN",($e=We||(We={})).HIGHLIGHT="HIGHLIGHT",$e.MODAL="MODAL",$e.HIGHLIGHT_MODAL="HIGHLIGHT_MODAL";const Ve={customInputs:[],customNavigate:null,urlFilter:null,customScrollIntoView:null,scrollPadding:null,inferenceAttributeNames:["data-for","data-id","data-testid","data-test-id","for","id","name","placeholder","role"],inferenceAttributeFilters:{id:[e=>!e.match(/\d$/)],"data-id":[e=>!e.match(/\d$/)]},inferenceClassNameFilters:[e=>!e.startsWith("css-")],baseZIndex:1234500};function je(e){return Array.isArray(e)||(e=e?[e]:[]),e=e.map((e=>"string"==typeof e?new RegExp(e):e))}function Ke(e,t){return e.every((e=>"function"==typeof e?e(t):!(e instanceof RegExp)||e.test(t)))}function ze(){let e=d();if(Ve.urlFilter){if(e=Ve.urlFilter(e),"string"!=typeof e)throw new o("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(e)}catch(t){throw new o("Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.\nReturned URL: "+e+"\nError message: "+t.message)}}return e}let Ye="";try{Ye=localStorage.getItem("debug")||""}catch(ot){}const Je=Ye.split(",").some((e=>"*"===e||e.startsWith("userflow:*"))),Xe=Qe("log");let Ze;function Qe(e){return function(t,...s){if(Je){const i=performance.now(),n=Ze?Math.round(i-Ze):0;Ze=i,console[e](`%cuserflow %c${t} %c+${n}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}Xe.group=Qe("group"),Xe.groupCollapsed=Qe("groupCollapsed"),Xe.groupEnd=function(){Je&&console.groupEnd()};const qe=()=>n((()=>import("./ResourceCenterApp.js").then((function(e){return e.R}))),[new URL("ResourceCenterApp.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("z-index.js",import.meta.url).toString(),new URL("BubbleToolbar.js",import.meta.url).toString(),new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString(),new URL("stylesheets.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-regular-svg-icons.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-solid-svg-icons.js",import.meta.url).toString(),new URL("vendor.obj-str.js",import.meta.url).toString(),new URL("logomark.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("ChecklistUI.js",import.meta.url).toString()]);function et(e){const t=e.version.checklist.tasks.length;return Math.max(0,t-e.taskCompletions.length)}class tt{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 e of this.observers)e()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const st=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit"],it=import.meta.url;class nt{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.featureFlags=new Set,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.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=!1,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],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.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.onBuilderMessage=e=>(this.handleBuilderMessage(e),!1),this.handleBuilderMessage=async e=>{Xe(`builder ${e.kind} message received`,e);const t="idempotencyKey"in e&&"string"==typeof e.idempotencyKey?e.idempotencyKey:null;if(t&&this.idempotencyKeysSeen.has(t))return;const s=()=>{t&&this.idempotencyKeysSeen.add(t)};switch(e.kind){case"userflow:selectElement":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),void this.setSessionStorageState((t=>({...t,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}})));case"userflow:selectElementCancel":return void this.setSessionStorageState((e=>({...e,activeApp:null,elementSelection:null})));case"userflow:startFlowWithToken":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),c.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),void this.onceIdentified((()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const t=()=>{const s=this.resourceCenterSession;s&&s.draftMode&&s.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",t))};this.on("resourceCenterChanged",t),t()}}));case"userflow:testTracker":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),void this.setSessionStorageState((t=>({...t,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}})));case"userflow:testTrackerCancel":return void this.setSessionStorageState((e=>({...e,activeApp:null,trackerTesting:null})))}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout((()=>this.flushUrlChange()),50))},this.onUserActivity=()=>this.ensureConnected(),this.remountIfNecessary=()=>{this.ui?.container&&!document.contains(this.ui.container)&&(Xe("remounting UI because container was missing"),this.remount())},Xe("constructor, build=1003698"),p(this.onUrlChange),this.setTargetEnv(new C),this.checkTestUserAtBoot(),this.toggleUI();for(const e of st)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){Xe("destroy"),this.reset(),g(this.onUrlChange),this.destroyTargetEnv();for(const e of st)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 o("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const t=e(this.getSessionStorageState());c.setItem("userflowClientState",JSON.stringify(t)),this.sessionStorageState=t,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const t=c.getItem("userflowClientState");if(t)try{e=JSON.parse(t)}catch(ot){console.error("Userflow.js: Parse ElementSelectionState error:",ot)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null})}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(Xe("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState((t=>({...t,testUser:e}))),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const t=[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:s}=e;s&&(this.groupId=s.id,t.push(this.group(s.id,{name:s.name},{signature:s.signature}))),await Promise.all(t)}resetTestUser(){this.setSessionStorageState((e=>({...e,testUser:null})))}init(e){if(Xe("init",e),!e)throw new o("userflow.init() was called but missing Userflow.js Token");this.clientToken!==e&&(this.testUserIdentified?Xe("init() ignoring new token since a test user has been identified"):(this.clientToken&&(Xe("init() resetting due to new client token"),this.reset()),this.clientToken=e))}ensureInit(){if(!this.clientToken)throw new o("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new o("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new o("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId)return;if(this.debounceInactiveDisconnect(),this.socket)return;this._socketStatus="connecting",Xe("connecting to socket");let t=Ve.serverEndpoint||"e.userflow.com";"js.getuserflow.com"===new URL(it).hostname&&"e.userflow.com"===t&&(t="e.getuserflow.com");const s="wss://"+t+"/end-users/"+this.clientToken+"/socket";this.socket=new e(s,{reconnectAfterMs:e=>[100,500,1e3,5e3][e-1]||1e4,timeout:2e4}),this.socket.connect(),this.socket.onOpen((()=>{Xe("socket opened")})),this.socket.onClose((()=>{this.emit("private:disconnect")})),this.socket.onError((e=>{console.log("Userflow.js socket error",e),this.reportCspIssue()})),this.channel=this.socket.channel(`end_users:${this.externalId}`,(()=>this.makeChannelJoinPayload())),this.channel.join().receive("ok",(e=>{this.logrocketAppId=e.logrocketAppId,this.featureFlags=new Set(e.featureFlags),Xe("channel joined"),"connected"!==this._socketStatus&&(this._socketStatus="connected")})).receive("error",(e=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(e.code)?(console.error(`Userflow.js resetting due to: [${e.code}] ${e.message}`),this.reset(),this.clientToken=null):"invalid_protocol_version"===e.code?(console.error(`Userflow.js destroying due to: [${e.code}] ${e.message}`),this.destroy()):console.log("Userflow.js channel join error",e)})),this.channel.on("server_message",(e=>this.handleServerMessage(e))),this.channel.on("server_error",(e=>{console.log(`Userflow.js server error (${e.code}): ${e.message}`+(e.details&&e.details.length>0?"\nDetails:\n"+e.details.map((e=>(e.path?`${e.path}: `:"")+e.message)):""))}))}makeChannelJoinPayload(){const e=this.buildClientContext();this.clientContext=e;const t={protocolVersion:2,userflowClientBuild:"1003698",signature:this.signature,groupExternalId:this.groupId,groupSignature:this.groupSignature,flowSessionId:this.flowSession?.id||null,checklistSessionId:this.checklistSession?.id||null,resourceCenterSessionId:this.resourceCenterSession?.id||null,launchers:this.launcherSessions.map((e=>({flowId:e.flow.id}))),trackers:Array.from(this.trackers.values()).map((e=>({flowId:e.tracker.flowId}))),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map((e=>({conditionId:e.condition.id,isTrue:e.isTrue}))),previewFlowId:c.getItem("previewFlowId"),clientContext:e};return Xe("channel join payload",t),t}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((()=>{this.hasDraftSession()||this.assistantMessageInProgress?this.debounceInactiveDisconnect():(Xe("disconnecting from socket due to inactivity"),this.disconnect())}),3e5)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some((e=>e.draftMode))}async send(e,{batch:t,endBatch:s,handlesRejection:i}={}){return this.inBatch&&["ToggleClientCondition","UpdateClientContext"].includes(e.kind)||this.checkPushRateLimit(),this.ensureConnected(),t&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),s?this.endBatch():this.endBatchTimeout=window.setTimeout((()=>{this.endBatch()}),50)),this.sendRaw(e,{handlesRejection:i})}async sendRaw(e,{handlesRejection:t}={}){return new Promise(((s,i)=>{if(!this.channel){const s=`Userflow.js: send() should not be called if channel is not set. Message kind=${e.kind}`;if(t)throw Error(s);return void console.log(s,"\nClient message:",e)}Xe(`push ${e.kind} message`,e);const n=this.clientClock,r=()=>{this.serverClock=n,this.channel?.off("phx_error",a)},a=this.channel.on("phx_error",(s=>{r();const n=`Userflow.js send ${e.kind} got phx_error`;console.log(n,"\nClient message:",e,"\nError:",s),t&&i(new o(n))}));this.channel.push("client_message",e).receive("ok",(e=>{r(),s(e)})).receive("error",(t=>{r();const s=`Userflow.js error reply (${t.code}): ${t.message}`;console.log(s,"\nClient message:",e,"\nError:",t),i(new o(s,t.code,t.message))}))}))}endBatch(){this.inBatch=!1,this.sendRaw({kind:"EndBatch"})}checkPushRateLimit(){const e=Date.now();if(this.pushRateLimitMinuteExpires<e&&(this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=e+6e4),this.pushRateLimitMinute>=100)throw new o("This Userflow.js client has reached a maximum of 100 operations in the last 1 minute. This is usually due to one of the following:\n\n - Excessive calls to Userflow.js. Check if any of userflow.track(), userflow.identify(), userflow.updateUser() or similar are called repeatedly.\n - The URL changing too frequently. Look into https://userflow.com/docs/userflow-js#seturlfilter and filter out the changing part of the URL.\n - The user legitimately being very active, in which case you can just ignore this error.\n \n If in doubt, reach out to us at support@userflow.com.");this.pushRateLimitMinute++}handleServerMessage(e){Xe(`received ${e.kind} message`,e);const{serverClock:t,flowSession:s,flowSessionClock:i,checklistSession:n,checklistSessionClock:o,resourceCenterSession:r}=this;switch(e.kind){case"CheckSessionsAck":case"ServerDebug":return;case"AddLauncher":{const{session:t}=e,s=this.launcherSessions.findIndex((e=>e.flow.id===t.flow.id));return this.launcherSessions=-1===s?[...this.launcherSessions,t]:[...this.launcherSessions.slice(0,s),t,...this.launcherSessions.slice(s+1)],void this.toggleUI()}case"AddTracker":return void this.addTracker(e.tracker);case"AssistantMessageEventWrapper":return void this.emit("private:assistantMessageEvent",e);case"CancelConditionWaitTimer":return window.clearTimeout(this.conditionWaitTimers.get(e.conditionId)),void this.conditionWaitTimers.delete(e.conditionId);case"ChecklistTaskCompleted":return void this.unackedTasks.add(e.taskCvid);case"ForceGoToStep":return i>t?void Xe(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`):void(s?.id===e.sessionId&&this.emit("gotostep",{session:s,step:{id:e.stepId}}));case"RemoveLauncher":return void(this.removeLauncher(e.flowId)&&this.toggleUI());case"RemoveTracker":return void this.removeTracker(e.flowId);case"SetChecklistSession":return void(o<=t||n?.id===e.session.id?(this.setChecklistSession(e.session,t),this.toggleUI()):Xe(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${o} > serverClock=${t}`));case"SetFlowSession":return void(i<=t||s?.id===e.session.id?(this.setFlowSession(e.session,t),this.toggleUI()):Xe(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`));case"SetResourceCenterSession":return this.setResourceCenterSession(e.session),void this.toggleUI();case"StartConditionWaitTimer":if(!this.conditionWaitTimers.has(e.conditionId)){const t=window.setTimeout((()=>{this.conditionWaitTimers.delete(e.conditionId),this.send({kind:"FireConditionWaitTimer",conditionId:e.conditionId},{batch:!0})}),1e3*parseFloat(e.waitTime));this.conditionWaitTimers.set(e.conditionId,t)}return;case"TrackClientCondition":return void this.trackClientCondition(e.condition);case"UnsetChecklistSession":return o>t?void Xe(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${o} > serverClock=${t}`):void(n?.id===e.sessionId&&(this.setChecklistSession(null,t),this.toggleUI()));case"UnsetFlowSession":return i>t?void Xe(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`):void(s?.id===e.sessionId&&(this.setFlowSession(null,t),this.toggleUI()));case"UnsetResourceCenterSession":return void(r?.id===e.sessionId&&(this.setResourceCenterSession(null),this.toggleUI()));case"UntrackClientCondition":return void this.untrackClientCondition(e.conditionId);default:return void console.warn("Userflow.js: Received unknown message",e)}}async identify(e,t={},{signature:s}={}){if(Xe("identify",e),this.ensureInit(),this.testUserIdentified&&e!==this.externalId)Xe("identify() ignored since a test user has been identified");else{if("number"==typeof e)e=String(e);else if(!e||"string"!=typeof e)throw new o(`userflow.identify: First argument must be a non-empty string representing the user's ID in your database. Value received: ${JSON.stringify(e)}`);this.externalId&&e!==this.externalId&&(Xe("identify resetting due to new externalId"),this.reset()),this.externalId=e,this.signature=s||null,this.observeUserActivity(),await Promise.all([this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(t)},{batch:!0}),this.onFirstIdentify()]),this.emit("private:identified")}}async identifyAnonymous(e={},s={}){if(!a.isSupported())throw new o("userflow.identifyAnonymous() is not supported when localStorage access is denied.");const i="anonymousId";let n=a.getItem(i);n||(n="anon-"+t(),a.setItem(i,n)),await this.identify(n,e,s)}async updateUser(e={},t={}){Xe("updateUser"),this.ensureIdentified(),await this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(e)},{batch:!0})}async group(e,t={},{signature:s,membership:i}={}){if(Xe("group",e),this.ensureIdentified(),this.testUserIdentified&&e!==this.groupId)Xe("group() ignored since a test user has been identified");else{if("number"==typeof e)e=String(e);else if(!e||"string"!=typeof e)throw new o(`userflow.group: First argument must be a non-empty string representing the group's ID in your database. Value received: ${JSON.stringify(e)}`);this.groupId=e,this.groupSignature=s||null,await this.send({kind:"UpsertGroup",groupExternalId:e,groupSignature:this.groupSignature,groupAttributes:this.normalizeAttributes(t),membershipAttributes:this.normalizeAttributes(i)},{batch:!0})}}async updateGroup(e={},t={}){Xe("updateGroup");const s=this.ensureGroup();await this.send({kind:"UpsertGroup",groupExternalId:s,groupSignature:this.groupSignature,membershipAttributes:this.normalizeAttributes(t.membership),groupAttributes:this.normalizeAttributes(e)},{batch:!0})}normalizeAttributes(e){if(null==e)return{};if("object"!=typeof e)throw new o("Userflow: 'attributes' must be an object.");const t={};for(const s in e){if(!e.hasOwnProperty(s))continue;if("traits"===s){const i=e[s];Object.assign(t,this.extractLegacyTraits(i));continue}let i=e[s];if("string"==typeof i||"number"==typeof i||"boolean"==typeof i||null==i||Array.isArray(i))t[s]=this.normalizeAttributeLiteralOrList(s,i);else{if("object"!=typeof i||null==i)throw new o(`Userflow: Invalid value for '${s}' attribute.`);if("set"in i)t[s]={set:this.normalizeAttributeLiteralOrList(s,i.set),dataType:this.normalizeDataType(s,i.data_type||i.dataType)};else if("set_once"in i||"setOnce"in i)t[s]={setOnce:this.normalizeAttributeLiteralOrList(s,i.set_once??i.setOnce),dataType:this.normalizeDataType(s,i.data_type||i.dataType)};else if("add"in i){const e=i.add;if("string"!=typeof e&&"number"!=typeof e)throw new o(`Userflow: Invalid 'add' value for '${s}' attribute. Must be a number or string.`);t[s]={add:e}}else if("subtract"in i){const e=i.subtract;if("string"!=typeof e&&"number"!=typeof e)throw new o(`Userflow: Invalid 'subtract' value for '${s}' attribute. Must be a number or string.`);t[s]={subtract:e}}else if("append"in i)t[s]={append:this.normalizeAttributeLiteralOrList(s,i.append)};else if("prepend"in i)t[s]={prepend:this.normalizeAttributeLiteralOrList(s,i.prepend)};else{if(!("remove"in i))throw new o(`Userflow: Invalid value for '${s}' attribute.`);t[s]={remove:this.normalizeAttributeLiteralOrList(s,i.remove)}}}}return t}normalizeAttributeLiteralOrList(e,t){return Array.isArray(t)?t.map((t=>this.normalizeAttributeLiteral(e,t))):this.normalizeAttributeLiteral(e,t)}normalizeAttributeLiteral(e,t){if(null==t)return null;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return t;throw new o(`Userflow: Invalid value for '${e}' attribute.`)}normalizeDataType(e,t){if(!t)return null;switch(t){case"string":return O.STRING;case"number":return O.NUMBER;case"boolean":return O.BOOLEAN;case"datetime":return O.DATETIME}throw new o(`Userflow: Invalid data_type for '${e}' attribute.`)}extractLegacyTraits(e){if(!e)return{};if(!Array.isArray(e)){const t=[];for(const s in e)e.hasOwnProperty(s)&&t.push({name:s,value:e[s]});e=t}return e.reduce(((e,{name:t,value:s,dataType:i})=>{if("string"!=typeof t||t.length>100||!t.match(/^[a-z0-9_]+$/))return this.warn("Userflow.identify: Invalid trait name (must be string, no more than 100 characters, and only consist of a-z, 0-9 and underscores). The trait will be ignored. Name was:",t),e;if("string"==typeof s);else if("boolean"==typeof s)i||(i="boolean"),s=s?"true":"false";else{if("number"!=typeof s)return this.warn(`userflow.identify: The value of trait '${t}' is invalid (must be a string, a boolean or a number). The trait will be ignored. Value was:`,s),e;i||(i=Number.isInteger(s)?"integer":"decimal"),s=String(s)}let n=null;if(i)switch(i){case"string":n=O.STRING;break;case"boolean":n=O.BOOLEAN;break;case"integer":case"decimal":n=O.NUMBER;break;case"datetime":n=O.DATETIME;break;default:return this.warn(`userflow.identify: The data type of trait '${t}' is invalid (must be a 'string', 'boolean', 'integer', 'decimal' or 'datetime'). The trait will be ignored. Data type was:`,i),e}return e[t]={set:s,dataType:n},e}),{})}async track(e,t={},{userOnly:s}={}){Xe(`track '${e}'`,t),this.ensureIdentified(),await this.send({kind:"TrackEvent",userOnly:!!s,name:e,attributes:this.normalizeEventAttributes(t)},{batch:!0})}normalizeEventAttributes(e){const t=this.normalizeAttributes(e);for(const s in t){if(!t.hasOwnProperty(s))continue;const e=t[s];if(null!=e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Array.isArray(e)&&!("set"in e))throw new o(`Userflow: Invalid value for '${s}' attribute. Event attributes only support literal values, list values and 'set' changes.`)}return t}onFirstIdentify(){this.onFirstIdentifyRun||(this.onFirstIdentifyRun=!0,this.onFirstIdentifyTimeout=window.setTimeout((()=>{this.trackPageViewed(),this.firstIdentifyCallback?(this.firstIdentifyCallback(),this.firstIdentifyCallback=null):this.checkUrlForStartFlow()}),0))}onceIdentified(e){this.isIdentified()?e():this.firstIdentifyCallback=e}checkUrlForStartFlow(){const e=new URL(d()),t=e.searchParams.get("userflow")||e.searchParams.get("studio1_flow")||e.searchParams.get("studio1_walkthrough");t&&(Xe(`url contained flow ${t}`),this.startFlow({flowId:t,startReason:L.LINK,batch:!0}),e.searchParams.delete("userflow"),e.searchParams.delete("studio1_flow"),e.searchParams.delete("studio1_walkthrough"),window.history.replaceState({},"",e.toString()),this.clientContext=this.buildClientContext(),this.pushUpdateClientContext())}flushUrlChange(){const e=this.buildClientContext();this.clientContext&&e.pageUrl===this.clientContext.pageUrl||(this.clientContext=e,this.pushUpdateClientContext(),this.trackPageViewed(),this.checkUrlForStartFlow())}async trackPageViewed(){this.pageTrackingDisabled||this.track("page_viewed",{})}buildClientContext(){return{pageUrl:ze(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}pushUpdateClientContext(){this.send({kind:"UpdateClientContext",clientContext:this.clientContext},{batch:!0})}ackCompletedTask(e){this.unackedTasks.delete(e)}taskIsUnacked(e){return this.unackedTasks.has(e)}isIdentified(){return null!=this.externalId}on(e,t){let s=this.listeners.get(e);s||(s=new Set,this.listeners.set(e,s)),s.add(t)}off(e,t){const s=this.listeners.get(e);s&&s.delete(t)}emit(e,...t){const s=this.listeners.get(e);if(s){Array.from(s).forEach((e=>e(...t)))}}observeUserActivity(){document.addEventListener("mouseover",this.onUserActivity),document.addEventListener("pointerdown",this.onUserActivity),document.addEventListener("keydown",this.onUserActivity)}unobserveUserActivity(){document.removeEventListener("mouseover",this.onUserActivity),document.removeEventListener("pointerdown",this.onUserActivity),document.removeEventListener("keydown",this.onUserActivity)}reset(){Xe("reset"),this.externalId=null,this.groupId=null,this.sessionStorageState=null,this.setFlowSession(null,0),this.setChecklistSession(null,0),this.setResourceCenterSession(null),this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.unackedTasks=new Set,this.onFirstIdentifyRun=!1,window.clearTimeout(this.onFirstIdentifyTimeout),this.onFirstIdentifyTimeout=void 0,this.clientContext=null,this.unobserveUserActivity(),window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=void 0,this.clientConditions.forEach(((e,t)=>{this.untrackClientCondition(t)})),this.firstIdentifyCallback=null,this.testUserIdentified=!1,a.removeItem("anonymousId"),this.unmountUI(),this.disconnect(),this.inBatch=!1,window.clearTimeout(this.endBatchTimeout),this.endBatchTimeout=void 0,this.clientClock=1,this.serverClock=1}async startFlow({flowId:e,stepCvid:t,startReason:s,once:i,batch:n,replaceCurrent:o}){if(this.ensureIdentified(),o&&this.flowSession&&this.endFlow(this.flowSession,{endReason:m.REPLACED,batch:!0}),Xe(`startFlow ${e}`,{startReason:s}),this.checklistSession?.flow.id===e)return Xe("startFlow matches current checklist, so showing it instead"),void this.showChecklist();const r={kind:"StartFlow",flowId:e,stepCvid:t,startReason:s,once:!!i};await this.send(r,{batch:n})}async startFlowWithToken(e){this.ensureIdentified(),Xe("startFlowWithToken",{token:e}),await this.send({kind:"StartFlowWithToken",token:e},{batch:!0})}optimisticClockUIUpdate(e){this.clientClock++,e(),this.toggleUI()}async showChecklist(){this.resourceCenterEmbedsChecklist()?this.openResourceCenter():(this.unmarkExpandPending(),this.checklistSession&&!this.checklistExpanded&&(this.ensureIdentified(),this.checklistExpanded=!0,this.toggleUI(),c.setItem(`checklistExpanded:${this.checklistSession.id}`,"1"),await this.send({kind:"ShowChecklist",sessionId:this.checklistSession.id},{batch:!0})))}async hideChecklist(){this.resourceCenterEmbedsChecklist()?this.closeResourceCenter():this.checklistSession&&this.checklistExpanded&&(this.ensureIdentified(),this.checklistExpanded=!1,this.toggleUI(),c.removeItem(`checklistExpanded:${this.checklistSession.id}`),await this.send({kind:"HideChecklist",sessionId:this.checklistSession.id},{batch:!0}))}async unmarkExpandPending(){this.checklistSession&&this.checklistExpandPending&&(this.checklistExpandPending=!1,await this.send({kind:"UnmarkExpandPending",sessionId:this.checklistSession.id},{batch:!0}))}async openResourceCenter(){this.resourceCenterEmbedsChecklist()&&this.unmarkExpandPending(),this.resourceCenterSession&&!this.resourceCenterOpen&&(this.ensureIdentified(),this.resourceCenterOpen=!0,this.toggleUI(),this.emit("resourceCenterChanged"),c.setItem(`resourceCenterOpen:${this.resourceCenterSession.id}`,"1"),await this.send({kind:"OpenResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}async closeResourceCenter(){this.resourceCenterSession&&this.resourceCenterOpen&&(this.ensureIdentified(),this.resourceCenterOpen=!1,this.toggleUI(),this.emit("resourceCenterChanged"),c.removeItem(`resourceCenterOpen:${this.resourceCenterSession.id}`),await this.send({kind:"CloseResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}toggleResourceCenter(){this.resourceCenterOpen?this.closeResourceCenter():this.openResourceCenter()}setResourceCenterLauncherHidden(e){this.resourceCenterLauncherHidden=e,this.toggleUI()}getResourceCenterState(){if(!this.resourceCenterSession)return null;const e=this.resourceCenterEmbedsChecklist(),{checklistSession:t}=this;return{isOpen:this.resourceCenterOpen,hasChecklist:e,uncompletedChecklistTaskCount:e&&t?et(t):0}}resourceCenterEmbedsChecklist(){const e=this.resourceCenterSession;return!!e&&!!e.version.resourceCenter?.blocks.some((e=>e.type===Ie.CHECKLIST))}async endFlow(e,{endReason:t,batch:s}){this.ensureIdentified(),this.optimisticClockUIUpdate((()=>{const{clientClock:t}=this;this.flowSession?.id===e.id&&this.setFlowSession(null,t),this.checklistSession?.id===e.id&&this.setChecklistSession(null,t),this.resourceCenterSession?.id===e.id&&this.setResourceCenterSession(null)}));const{flow:i}=e,n={id:i.id,type:i.type.toLowerCase()};i.type===_.CHECKLIST?this.emit("checklistEnded",{checklist:n,endReason:t}):i.type===_.FLOW&&this.emit("flowEnded",{flow:n,endReason:t});const o={kind:"EndFlow",sessionId:e.id,endReason:t};await this.send(o,{batch:s})}async goToStep(e,t){Xe("goToStep",e.id,t.name||t.id),this.ensureIdentified();const s=this.send({kind:"GoToStep",sessionId:e.id,stepId:t.id});e.currentStep=t,this.emit("gotostep",{session:e,step:t}),await s}async endAllFlows(){Xe("endAllFlows"),this.optimisticClockUIUpdate((()=>{const{clientClock:e}=this;this.setFlowSession(null,e),this.setChecklistSession(null,e)})),await this.send({kind:"EndAllFlows"})}async endChecklist(){Xe("endChecklist");const e=this.checklistSession||this.flowSession;e?.flow.type===_.CHECKLIST&&this.endFlow(e,{endReason:m.USERFLOWJS})}setFlowSession(e,t=this.clientClock){const s=this.flowSession;this.flowSession=e,this.flowSessionClock=t,e&&!s&&(this.hideChecklist(),this.closeResourceCenter()),null==e&&this.originalActiveElement&&("function"==typeof this.originalActiveElement.focus&&this.originalActiveElement.focus(),this.originalActiveElement=void 0)}setChecklistSession(e,t=this.clientClock){const s=this.checklistSession;this.checklistSession=e,this.checklistSessionClock=t,null===e&&(this.checklistExpanded=!1,this.checklistExpandPending=!1),e&&e.id!==s?.id&&(this.checklistExpanded=!!c.getItem(`checklistExpanded:${e.id}`),e.expandPending&&(this.checklistExpandPending=!0)),this.emit("checklistChanged"),this.emit("resourceCenterChanged")}setResourceCenterSession(e){const t=this.resourceCenterSession;this.resourceCenterSession=e,null===e&&(this.resourceCenterOpen=!1),t&&t.id!==e?.id&&c.removeItem(`resourceCenterOpen:${t.id}`),e&&e.id!==t?.id&&(this.resourceCenterOpen=!!c.getItem(`resourceCenterOpen:${e.id}`)),this.emit("resourceCenterChanged")}launcherSeen(e){this.send({kind:"StartFlow",flowId:e,startReason:L.LAUNCHER_SEEN,once:!1})}activateLauncher(e){const t=this.activeLauncherFlowId&&this.launcherSessions.find((e=>e.flow.id===this.activeLauncherFlowId));t&&this.deactivateLauncher(t),this.activeLauncherFlowId=e.flow.id,this.toggleUI(),this.send({kind:"ActivateLauncher",flowId:e.flow.id})}deactivateLauncher(e){const{launcher:t}=e.version;e.flow.id===this.activeLauncherFlowId&&(t?.dismissOn===ye.DEACTIVATE?this.dismissLauncher(e,{endReason:m.LAUNCHER_DEACTIVATED}):(this.activeLauncherFlowId=null,this.toggleUI()))}dismissLauncher(e,{endReason:t}){const s=e.flow.id;this.removeLauncher(s),this.toggleUI(),this.send({kind:"DismissLauncher",flowId:s,endReason:t})}removeLauncher(e){const t=this.launcherSessions.findIndex((t=>t.flow.id===e));return-1!==t&&(this.launcherSessions=[...this.launcherSessions.slice(0,t),...this.launcherSessions.slice(t+1)],e===this.activeLauncherFlowId&&(this.activeLauncherFlowId=null),!0)}async toggleUI(){this.flowSession||!this.checklistExpandPending&&!this.checklistSession?.version.checklist?.tasks.some((e=>this.taskIsUnacked(e.cvid)))||this.showChecklist(),this.emit("uistatechange"),this.shouldBeMounted()?await this.mountUI():this.unmountUI()}shouldBeMounted(){if(this.uiDisabled)return!1;return!!this.getSessionStorageState().activeApp||!!this.flowSession||!!this.checklistSession&&(this.checklistExpanded||!!this.checklistSession?.version.checklist?.launcherEnabled)||!!this.resourceCenterSession&&(this.resourceCenterOpen||!this.resourceCenterLauncherHidden)||this.launcherSessions.length>0||this.notifications.length>0}async mountUI(){if(!this.ui){const e=await this.createUI();this.shouldBeMounted()&&!this.ui&&(Xe("mount UI"),this.ui=e,this.ui.mount())}}unmountUI(){this.ui&&(Xe("unmount UI"),this.ui.unmount(),this.ui=null)}remount(){this.unmountUI(),this.toggleUI()}async createUI(){try{const e=n((()=>import("./ui.js")),[new URL("ui.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("vendor.phoenix.js",import.meta.url).toString(),new URL("vendor.uuid.js",import.meta.url).toString()]);this.resourceCenterSession&&qe();const{RealUI:t}=await e;return new t(this)}catch(ot){throw this.reportCspIssue(),ot}}async trackClientCondition(e){if(this.clientConditions.has(e.id))return;Xe("track client condition",e),this.clientConditions.set(e.id,{condition:e,isTrue:null});const{conditionTypes:t}=await n((()=>import("./flow-condition-types.js").then((function(e){return e.u}))),[new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString()]),s=t[e.type],i=this.clientConditions.get(e.id);i&&(i.untrack=s.track({sessionData:new tt([]),condition:e,callback:t=>{i.isTrue!==t&&(Xe("client condition truthiness changed",t,i.condition),i.isTrue=t,this.send({kind:"ToggleClientCondition",conditionId:e.id,isTrue:t},{batch:!0}))}}))}untrackClientCondition(e){const t=this.clientConditions.get(e);t&&(Xe("untrack client condition",t.condition),t.untrack&&t.untrack(),this.clientConditions.delete(e))}async addTracker(e){let t=this.trackers.get(e.flowId);t?t.tracker=e:this.trackers.set(e.flowId,{tracker:e,isTrue:!1});const{conditionTypes:s}=await n((()=>import("./flow-condition-types.js").then((function(e){return e.u}))),[new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString()]),i=this.trackers.get(e.flowId);if(!i)return;const{tracker:o}=i,{condition:r}=o,a=s[r.type];i.untrack&&i.untrack(),i.untrack=a.track({sessionData:new tt(o.data),condition:r,flipBackEvents:!0,callback:e=>{const t=i.isTrue;i.isTrue=e,!t&&e&&this.send({kind:"TrackTrackerEvent",token:o.token},{batch:!0})}}),this.emit("private:trackerStarted")}removeTracker(e){const t=this.trackers.get(e);t&&(t.untrack&&t.untrack(),this.trackers.delete(e),this.emit("private:trackerStopped"))}reportCspIssue(){const e=this.getSessionStorageState();!this.testUserIdentified&&!e.activeApp||this.cspIssueReported||(this.cspIssueReported=!0,Xe("csp issue detected"),f({kind:"userflow:crxCspIssueDetected"}))}getAudio(){return this.audio||(this.audio=new Audio),this.audio}playAudio(e){if(document.hidden)return;const t=this.getAudio();e&&(t.src=e);const s=t.play();this.audioReady=!0,s&&s.catch((e=>{e.name}))}pauseAudio(){const e=this.audio;e&&!e.paused&&e.pause()}async getStepSpeech(e,t){return(await this.send({kind:"GetStepSpeechV2",syntheticVoice:e,text:t})).url}featureFlagEnabled(e){return this.featureFlags.has(e)}showNotification(e,t,s){const i={id:++this.notificationIdCounter,label:e,message:t,type:s};this.notifications=[...this.notifications,i],this.toggleUI()}dismissNotification(e){this.notifications=this.notifications.filter((t=>t.id!==e)),this.toggleUI()}warn(...e){console.warn(...e)}nextRef(){return this.refCounter++}}if(void 0===window.userflow||window.userflow._stubbed){const e=Object.assign(window.userflow||{},function(){const e=new nt;return{_stubbed:!1,init(t){e.init(t)},identify:(t,s={},i={})=>e.identify(t,s,i),identifyAnonymous:(t={},s={})=>e.identifyAnonymous(t,s),isIdentified:()=>e.isIdentified(),updateUser:(t,s={})=>e.updateUser(t,s),group:(t,s={},i={})=>e.group(t,s,i),updateGroup:(t,s={})=>e.updateGroup(t,s),track:(t,s={},i={})=>e.track(t,s,i),start:(t,{once:s}={})=>e.startFlow({flowId:t,startReason:L.USERFLOWJS,once:s}),startFlow:e=>(console.warn("Userflow.js: userflow.startFlow() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)),startWalk:e=>(console.warn("Userflow.js: userflow.startWalk() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)),endAll:()=>e.endAllFlows(),endChecklist:()=>e.endChecklist(),endAllFlows:()=>window.userflow.endAll(),async endFlow(){console.warn("Userflow.js: userflow.endFlow() has been deprecated and no longer has any effect.")},async endWalk(){console.warn("Userflow.js: userflow.endWalk() has been deprecated and no longer has any effect.")},openResourceCenter(){e.openResourceCenter()},closeResourceCenter(){e.closeResourceCenter()},toggleResourceCenter(){e.toggleResourceCenter()},setResourceCenterLauncherHidden(t){e.setResourceCenterLauncherHidden(t)},getResourceCenterState:()=>e.getResourceCenterState(),setWalkPosition(){console.warn("Userflow.js: userflow.setWalkPosition() has been deprecated and no longer has any effect.")},reset(){e.reset()},remount(){e.remount()},on(t,s){e.on(t,s)},off(t,s){e.off(t,s)},setCustomInputSelector(e){console.warn("Userflow.js: userflow.setCustomInputSelector() has been deprecated. Use userflow.registerCustomInput() instead. See docs: https://userflow.com/docs/userflow-js"),e&&Ve.customInputs.push({cssSelector:e})},registerCustomInput(e,t){Ve.customInputs.push({cssSelector:e,getValue:t})},setCustomNavigate(e){Ve.customNavigate=e},setUrlFilter(e){Ve.urlFilter=e},setInferenceAttributeNames(e){Ve.inferenceAttributeNames=e},setInferenceAttributeFilter(e,t){Ve.inferenceAttributeFilters[e]=je(t)},setInferenceClassNameFilter(e){Ve.inferenceClassNameFilters=je(e)},setScrollPadding(e){Ve.scrollPadding=e},setCustomScrollIntoView(e){Ve.customScrollIntoView=e},prepareAudio(){e.playAudio(null)},setShadowDomEnabled(e){console.warn("Userflow.js: userflow.setShadowDomEnabled() has been deprecated. Please remove this call from your Userflow.js snippet. Shadow DOM is supported by default now.")},setPageTrackingDisabled(t){e.pageTrackingDisabled=t},setBaseZIndex(e){Ve.baseZIndex=e},setServerEndpoint(e){Ve.serverEndpoint=e},_setTargetEnv(t){e.setTargetEnv(t)}}}());window.userflow=e,window.studio1=e,function(){const e=window.userflow,t=window.USERFLOWJS_QUEUE;if(delete window.USERFLOWJS_QUEUE,!t||0===t.length)return;Xe(`processing ${t.length} items in the queue`);for(const[s,i,n]of t){if("function"!=typeof e[s]){console.error(`Userflow.js: Invalid method '${s}' in queue`);continue}const t=e[s](...n);i&&t&&"function"==typeof t.then&&t.then(i.resolve,i.reject)}Xe("queue processed")}()}export{W as A,V as B,me as C,X as D,m as E,B as F,ne as G,ce as H,K as I,de as J,Le as K,Me as L,Q as M,Oe as N,Be as O,_e as P,De as Q,qe as R,L as S,st as T,o as U,re as V,y as W,n as _,P as a,M as b,Ve as c,Xe as d,D as e,H as f,ze as g,Ie as h,c as i,et as j,se as k,ee as l,ue as m,Ae as n,p as o,_ as p,d as q,fe as r,l as s,Ke as t,g as u,we as v,pe as w,tt as x,Y as y,a as z};export default window.userflow;
@@ -1 +1 @@
1
- var c={prefix:"far",iconName:"message",icon:[512,512,["comment-alt"],"f27a","M160 368c26.5 0 48 21.5 48 48v16l72.5-54.4c8.3-6.2 18.4-9.6 28.8-9.6H448c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64c-8.8 0-16 7.2-16 16V352c0 8.8 7.2 16 16 16h96zm48 124l-.2 .2-5.1 3.8-17.1 12.8c-4.8 3.6-11.3 4.2-16.8 1.5s-8.8-8.2-8.8-14.3V474.7v-6.4V468v-4V416H112 64c-35.3 0-64-28.7-64-64V64C0 28.7 28.7 0 64 0H448c35.3 0 64 28.7 64 64V352c0 35.3-28.7 64-64 64H309.3L208 492z"]},a={prefix:"far",iconName:"file-lines",icon:[384,512,[128441,128462,61686,"file-alt","file-text"],"f15c","M64 464c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H224v80c0 17.7 14.3 32 32 32h80V448c0 8.8-7.2 16-16 16H64zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V154.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0H64zm56 256c-13.3 0-24 10.7-24 24s10.7 24 24 24H264c13.3 0 24-10.7 24-24s-10.7-24-24-24H120zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24H264c13.3 0 24-10.7 24-24s-10.7-24-24-24H120z"]},s={prefix:"far",iconName:"lightbulb",icon:[384,512,[128161],"f0eb","M297.2 248.9C311.6 228.3 320 203.2 320 176c0-70.7-57.3-128-128-128S64 105.3 64 176c0 27.2 8.4 52.3 22.8 72.9c3.7 5.3 8.1 11.3 12.8 17.7l0 0c12.9 17.7 28.3 38.9 39.8 59.8c10.4 19 15.7 38.8 18.3 57.5H109c-2.2-12-5.9-23.7-11.8-34.5c-9.9-18-22.2-34.9-34.5-51.8l0 0 0 0c-5.2-7.1-10.4-14.2-15.4-21.4C27.6 247.9 16 213.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176c0 37.3-11.6 71.9-31.4 100.3c-5 7.2-10.2 14.3-15.4 21.4l0 0 0 0c-12.3 16.8-24.6 33.7-34.5 51.8c-5.9 10.8-9.6 22.5-11.8 34.5H226.4c2.6-18.7 7.9-38.6 18.3-57.5c11.5-20.9 26.9-42.1 39.8-59.8l0 0 0 0 0 0c4.7-6.4 9-12.4 12.7-17.7zM192 128c-26.5 0-48 21.5-48 48c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16s-7.2 16-16 16zm0 384c-44.2 0-80-35.8-80-80V416H272v16c0 44.2-35.8 80-80 80z"]},l={prefix:"far",iconName:"users",icon:[640,512,[],"f0c0","M144 160A80 80 0 1 0 144 0a80 80 0 1 0 0 160zm368 0A80 80 0 1 0 512 0a80 80 0 1 0 0 160zM0 298.7C0 310.4 9.6 320 21.3 320H234.7c.2 0 .4 0 .7 0c-26.6-23.5-43.3-57.8-43.3-96c0-7.6 .7-15 1.9-22.3c-13.6-6.3-28.7-9.7-44.6-9.7H106.7C47.8 192 0 239.8 0 298.7zM405.3 320H618.7c11.8 0 21.3-9.6 21.3-21.3C640 239.8 592.2 192 533.3 192H490.7c-15.9 0-31 3.5-44.6 9.7c1.3 7.2 1.9 14.7 1.9 22.3c0 38.2-16.8 72.5-43.3 96c.2 0 .4 0 .7 0zM320 176a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm0 144a96 96 0 1 0 0-192 96 96 0 1 0 0 192zm-58.7 80H378.7c39.8 0 73.2 27.2 82.6 64H178.7c9.5-36.8 42.9-64 82.6-64zm0-48C187.7 352 128 411.7 128 485.3c0 14.7 11.9 26.7 26.7 26.7H485.3c14.7 0 26.7-11.9 26.7-26.7C512 411.7 452.3 352 378.7 352H261.3z"]},i={prefix:"far",iconName:"angle-right",icon:[320,512,[8250],"f105","M273 239c9.4 9.4 9.4 24.6 0 33.9L113 433c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l143-143L79 113c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L273 239z"]},e={prefix:"far",iconName:"user",icon:[448,512,[128100,62144],"f007","M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464H398.7c-8.9-63.3-63.3-112-129-112H178.3c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3z"]},f={prefix:"far",iconName:"messages",icon:[640,512,["comments-alt"],"f4b6","M48 72c0-13.3 10.7-24 24-24H344c13.3 0 24 10.7 24 24V248c0 13.3-10.7 24-24 24H216c-4.7 0-9.4 1.4-13.3 4L144 315.2V296c0-13.3-10.7-24-24-24H72c-13.3 0-24-10.7-24-24V72zM72 0C32.2 0 0 32.2 0 72V248c0 39.8 32.2 72 72 72H96v40c0 8.9 4.9 17 12.7 21.2s17.3 3.7 24.6-1.2l90-60H344c39.8 0 72-32.2 72-72V72c0-39.8-32.2-72-72-72H72zM256 376c0 39.8 32.2 72 72 72h88.7l90 60c7.4 4.9 16.8 5.4 24.6 1.2S544 496.9 544 488V448h24c39.8 0 72-32.2 72-72V200c0-39.8-32.2-72-72-72H448v48H568c13.3 0 24 10.7 24 24V376c0 13.3-10.7 24-24 24H520c-13.3 0-24 10.7-24 24v19.2L437.3 404c-3.9-2.6-8.6-4-13.3-4H328c-13.3 0-24-10.7-24-24V352H256v24z"]},r={prefix:"far",iconName:"volume",icon:[576,512,[128265,"volume-medium"],"f6a8","M191.9 201.9L304 102.3V409.7L191.9 310.1c-4.4-3.9-10.1-6.1-15.9-6.1H88c-4.4 0-8-3.6-8-8V216c0-4.4 3.6-8 8-8h88c5.9 0 11.6-2.2 15.9-6.1zM322.2 32c-7.3 0-14.3 2.7-19.8 7.5L166.9 160H88c-30.9 0-56 25.1-56 56v80c0 30.9 25.1 56 56 56h78.9L302.4 472.5c5.5 4.8 12.5 7.5 19.8 7.5c16.5 0 29.8-13.3 29.8-29.8V61.8C352 45.3 338.7 32 322.2 32zm182.9 75c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C507.3 170.7 528 210.9 528 256s-20.7 85.3-53.2 111.8c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5c43.2-35.2 70.9-88.9 70.9-149s-27.7-113.8-70.9-149zm-60.5 74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C425.1 227.6 432 241 432 256s-6.9 28.4-17.7 37.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C466.1 312.9 480 286.1 480 256s-13.9-56.9-35.4-74.5z"]},o={prefix:"far",iconName:"circle-play",icon:[512,512,[61469,"play-circle"],"f144","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c7.6-4.2 16.8-4.1 24.3 .5l144 88c7.1 4.4 11.5 12.1 11.5 20.5s-4.4 16.1-11.5 20.5l-144 88c-7.4 4.5-16.7 4.7-24.3 .5s-12.3-12.2-12.3-20.9V168c0-8.7 4.7-16.7 12.3-20.9z"]},n={prefix:"far",iconName:"arrow-up-right-from-square",icon:[512,512,["external-link"],"f08e","M304 24c0 13.3 10.7 24 24 24H430.1L207 271c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l223-223V184c0 13.3 10.7 24 24 24s24-10.7 24-24V24c0-13.3-10.7-24-24-24H328c-13.3 0-24 10.7-24 24zM72 32C32.2 32 0 64.2 0 104V440c0 39.8 32.2 72 72 72H408c39.8 0 72-32.2 72-72V312c0-13.3-10.7-24-24-24s-24 10.7-24 24V440c0 13.3-10.7 24-24 24H72c-13.3 0-24-10.7-24-24V104c0-13.3 10.7-24 24-24H200c13.3 0 24-10.7 24-24s-10.7-24-24-24H72z"]},z={prefix:"far",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm169.8-90.7c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},m={prefix:"far",iconName:"pen",icon:[512,512,[128394],"f304","M36.4 360.9L13.4 439 1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1L73 498.6l78.1-23c12.4-3.6 23.7-9.9 33.4-18.4c1.4-1.2 2.7-2.5 4-3.8L492.7 149.3c21.9-21.9 24.6-55.6 8.2-80.5c-2.3-3.5-5.1-6.9-8.2-10L453.3 19.3c-25-25-65.5-25-90.5 0L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4zm46 13.5c1.7-5.6 4.5-10.8 8.4-15.2c.6-.6 1.1-1.2 1.7-1.8L321 129 383 191 154.6 419.5c-4.7 4.7-10.6 8.2-17 10.1l-23.4 6.9L59.4 452.6l16.1-54.8 6.9-23.4z"]},H={prefix:"far",iconName:"phone",icon:[512,512,[128222,128379],"f095","M375.8 275.2c-16.4-7-35.4-2.4-46.7 11.4l-33.2 40.6c-46-26.7-84.4-65.1-111.1-111.1L225.3 183c13.8-11.3 18.5-30.3 11.4-46.7l-48-112C181.2 6.7 162.3-3.1 143.6 .9l-112 24C13.2 28.8 0 45.1 0 64v0C0 295.2 175.2 485.6 400.1 509.5c9.8 1 19.6 1.8 29.6 2.2c0 0 0 0 0 0c0 0 .1 0 .1 0c6.1 .2 12.1 .4 18.2 .4l0 0c18.9 0 35.2-13.2 39.1-31.6l24-112c4-18.7-5.8-37.6-23.4-45.1l-112-48zM441.5 464C225.8 460.5 51.5 286.2 48.1 70.5l99.2-21.3 43 100.4L154.4 179c-18.2 14.9-22.9 40.8-11.1 61.2c30.9 53.3 75.3 97.7 128.6 128.6c20.4 11.8 46.3 7.1 61.2-11.1l29.4-35.9 100.4 43L441.5 464zM48 64v0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0s0 0 0 0"]},L={prefix:"far",iconName:"arrow-left",icon:[448,512,[8592],"f060","M7.4 273.4C2.7 268.8 0 262.6 0 256s2.7-12.8 7.4-17.4l176-168c9.6-9.2 24.8-8.8 33.9 .8s8.8 24.8-.8 33.9L83.9 232 424 232c13.3 0 24 10.7 24 24s-10.7 24-24 24L83.9 280 216.6 406.6c9.6 9.2 9.9 24.3 .8 33.9s-24.3 9.9-33.9 .8l-176-168z"]},M={prefix:"far",iconName:"envelope",icon:[512,512,[128386,9993,61443],"f0e0","M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"]},V={prefix:"far",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336c-13.3 0-24 10.7-24 24s10.7 24 24 24h80c13.3 0 24-10.7 24-24s-10.7-24-24-24h-8V248c0-13.3-10.7-24-24-24H216c-13.3 0-24 10.7-24 24s10.7 24 24 24h24v64H216zm40-144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]},p={prefix:"far",iconName:"left-long",icon:[512,512,["long-arrow-alt-left"],"f30a","M6.5 272.4c-8.7-9.2-8.7-23.7 0-32.9l121.4-129c8.8-9.3 21-14.6 33.7-14.6c25.6 0 46.3 20.7 46.3 46.3l0 33.7 248 0c30.9 0 56 25.1 56 56l0 48c0 30.9-25.1 56-56 56l-248 0 0 33.7c0 25.6-20.7 46.3-46.3 46.3c-12.8 0-25-5.3-33.7-14.6L6.5 272.4zm153.5 93l0-53.5c0-13.3 10.7-24 24-24l272 0c4.4 0 8-3.6 8-8l0-48c0-4.4-3.6-8-8-8l-272 0c-6.4 0-12.5-2.5-17-7s-7-10.6-7-17l0-53.5L57 256 160 365.5z"]},C={prefix:"far",iconName:"right-long",icon:[512,512,["long-arrow-alt-right"],"f30b","M505.5 239.6c8.7 9.2 8.7 23.7 0 32.9l-121.4 129c-8.8 9.3-21 14.6-33.7 14.6c-25.6 0-46.3-20.7-46.3-46.3l0-33.7L56 336c-30.9 0-56-25.1-56-56l0-48c0-30.9 25.1-56 56-56l248 0 0-33.7c0-25.6 20.7-46.3 46.3-46.3c12.8 0 25 5.3 33.7 14.6l121.4 129zM352 146.5l0 53.5c0 13.3-10.7 24-24 24L56 224c-4.4 0-8 3.6-8 8l0 48c0 4.4 3.6 8 8 8l272 0c6.4 0 12.5 2.5 17 7s7 10.6 7 17l0 53.5L455 256 352 146.5z"]},x={prefix:"far",iconName:"thumbs-down",icon:[512,512,[128078,61576],"f165","M323.8 477.2c-38.2 10.9-78.1-11.2-89-49.4l-5.7-20c-3.7-13-10.4-25-19.5-35l-51.3-56.4c-8.9-9.8-8.2-25 1.6-33.9s25-8.2 33.9 1.6l51.3 56.4c14.1 15.5 24.4 34 30.1 54.1l5.7 20c3.6 12.7 16.9 20.1 29.7 16.5s20.1-16.9 16.5-29.7l-5.7-20c-5.7-19.9-14.7-38.7-26.6-55.5c-5.2-7.3-5.8-16.9-1.7-24.9s12.3-13 21.3-13L448 288c8.8 0 16-7.2 16-16c0-6.8-4.3-12.7-10.4-15c-7.4-2.8-13-9-14.9-16.7s.1-15.8 5.3-21.7c2.5-2.8 4-6.5 4-10.6c0-7.8-5.6-14.3-13-15.7c-8.2-1.6-15.1-7.3-18-15.2s-1.6-16.7 3.6-23.3c2.1-2.7 3.4-6.1 3.4-9.9c0-6.7-4.2-12.6-10.2-14.9c-11.5-4.5-17.7-16.9-14.4-28.8c.4-1.3 .6-2.8 .6-4.3c0-8.8-7.2-16-16-16H286.5c-12.6 0-25 3.7-35.5 10.7l-61.7 41.1c-11 7.4-25.9 4.4-33.3-6.7s-4.4-25.9 6.7-33.3l61.7-41.1c18.4-12.3 40-18.8 62.1-18.8H384c34.7 0 62.9 27.6 64 62c14.6 11.7 24 29.7 24 50c0 4.5-.5 8.8-1.3 13c15.4 11.7 25.3 30.2 25.3 51c0 6.5-1 12.8-2.8 18.7C504.8 238.3 512 254.3 512 272c0 35.3-28.6 64-64 64l-92.3 0c4.7 10.4 8.7 21.2 11.8 32.2l5.7 20c10.9 38.2-11.2 78.1-49.4 89zM32 384c-17.7 0-32-14.3-32-32V128c0-17.7 14.3-32 32-32H96c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H32z"]},t={prefix:"far",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M368 208A160 160 0 1 0 48 208a160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"]},h={prefix:"far",iconName:"chevron-down",icon:[512,512,[],"f078","M239 401c9.4 9.4 24.6 9.4 33.9 0L465 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-175 175L81 175c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9L239 401z"]},N={prefix:"far",iconName:"list-check",icon:[512,512,["tasks"],"f0ae","M153.8 72.1c8.9-9.9 8.1-25-1.8-33.9s-25-8.1-33.9 1.8L63.1 101.1 41 79C31.6 69.7 16.4 69.7 7 79s-9.4 24.6 0 33.9l40 40c4.7 4.7 11 7.2 17.6 7s12.8-3 17.2-7.9l72-80zm0 160c8.9-9.9 8.1-25-1.8-33.9s-25-8.1-33.9 1.8L63.1 261.1 41 239c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l40 40c4.7 4.7 11 7.2 17.6 7s12.8-3 17.2-7.9l72-80zM216 120H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H216c-13.3 0-24 10.7-24 24s10.7 24 24 24zM192 256c0 13.3 10.7 24 24 24H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H216c-13.3 0-24 10.7-24 24zM160 416c0 13.3 10.7 24 24 24H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H184c-13.3 0-24 10.7-24 24zm-64 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},v={prefix:"far",iconName:"volume-xmark",icon:[576,512,["volume-mute","volume-times"],"f6a9","M159.9 201.9L272 102.3V409.7L159.9 310.1c-4.4-3.9-10.1-6.1-15.9-6.1H56c-4.4 0-8-3.6-8-8V216c0-4.4 3.6-8 8-8h88c5.9 0 11.6-2.2 15.9-6.1zM290.2 32c-7.3 0-14.3 2.7-19.8 7.5L134.9 160H56c-30.9 0-56 25.1-56 56v80c0 30.9 25.1 56 56 56h78.9L270.4 472.5c5.5 4.8 12.5 7.5 19.8 7.5c16.5 0 29.8-13.3 29.8-29.8V61.8C320 45.3 306.7 32 290.2 32zM425 167c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55z"]},g={prefix:"far",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M345 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-119 119L73 103c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l119 119L39 375c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l119-119L311 409c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-119-119L345 137z"]},u={prefix:"far",iconName:"chevron-right",icon:[320,512,[9002],"f054","M305 239c9.4 9.4 9.4 24.6 0 33.9L113 465c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l175-175L79 81c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L305 239z"]},d={prefix:"far",iconName:"shoe-prints",icon:[640,512,[],"f54b","M323.7 62.6C355.1 54.7 390.3 48 416 48c41.2 0 89.8 10.6 126.5 28.9C582 96.7 592 116.3 592 128c0 9.4-5.1 21.5-35.9 33.1c-29.4 11.1-67 14.9-92.1 14.9c-34.7 0-53.5-10.4-80.2-25.7l-.7-.4c-20.6-11.8-45.1-25.8-79.1-33V67.8c6-1.7 12.7-3.4 19.7-5.2zM256 160c48 0 76 16 104 32s56 32 104 32c56.4 0 176-16 176-96S512 0 416 0C352.3 0 256 32 256 32v80 48h0zM128 96c0 35.3 28.7 64 64 64h32V32H192c-35.3 0-64 28.7-64 64zm67.7 353.4c-7-1.8-13.7-3.5-19.7-5.2V395.1c34-7.3 58.5-21.3 79.1-33l.7-.4C282.5 346.4 301.3 336 336 336c25.2 0 62.7 3.7 92.1 14.9C458.9 362.5 464 374.6 464 384c0 11.7-10 31.3-49.5 51.1C377.8 453.4 329.2 464 288 464c-25.7 0-60.9-6.7-92.3-14.6zM128 352h0v48 80s96.3 32 160 32c96 0 224-48 224-128s-119.6-96-176-96c-48 0-76 16-104 32s-56 32-104 32zM0 416c0 35.3 28.7 64 64 64H96V352H64c-35.3 0-64 28.7-64 64z"]},b={prefix:"far",iconName:"check",icon:[448,512,[10003,10004],"f00c","M441 103c9.4 9.4 9.4 24.6 0 33.9L177 401c-9.4 9.4-24.6 9.4-33.9 0L7 265c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l119 119L407 103c9.4-9.4 24.6-9.4 33.9 0z"]},A={prefix:"far",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M248.4 84.3c1.6-2.7 4.5-4.3 7.6-4.3s6 1.6 7.6 4.3L461.9 410c1.4 2.3 2.1 4.9 2.1 7.5c0 8-6.5 14.5-14.5 14.5H62.5c-8 0-14.5-6.5-14.5-14.5c0-2.7 .7-5.3 2.1-7.5L248.4 84.3zm-41-25L9.1 385c-6 9.8-9.1 21-9.1 32.5C0 452 28 480 62.5 480h387c34.5 0 62.5-28 62.5-62.5c0-11.5-3.2-22.7-9.1-32.5L304.6 59.3C294.3 42.4 275.9 32 256 32s-38.3 10.4-48.6 27.3zM288 368a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm-8-184c0-13.3-10.7-24-24-24s-24 10.7-24 24v96c0 13.3 10.7 24 24 24s24-10.7 24-24V184z"]},w={prefix:"far",iconName:"paper-plane",icon:[512,512,[61913],"f1d8","M16.1 260.2c-22.6 12.9-20.5 47.3 3.6 57.3L160 376V479.3c0 18.1 14.6 32.7 32.7 32.7c9.7 0 18.9-4.3 25.1-11.8l62-74.3 123.9 51.6c18.9 7.9 40.8-4.5 43.9-24.7l64-416c1.9-12.1-3.4-24.3-13.5-31.2s-23.3-7.5-34-1.4l-448 256zm52.1 25.5L409.7 90.6 190.1 336l1.2 1L68.2 285.7zM403.3 425.4L236.7 355.9 450.8 116.6 403.3 425.4z"]},k={prefix:"far",iconName:"calendar-day",icon:[448,512,[],"f783","M128 0c13.3 0 24 10.7 24 24V64H296V24c0-13.3 10.7-24 24-24s24 10.7 24 24V64h40c35.3 0 64 28.7 64 64v16 48V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V192 144 128C0 92.7 28.7 64 64 64h40V24c0-13.3 10.7-24 24-24zM400 192H48V448c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16V192zM112 256h96c8.8 0 16 7.2 16 16v96c0 8.8-7.2 16-16 16H112c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16z"]},y={prefix:"far",iconName:"thumbs-up",icon:[512,512,[128077,61575],"f164","M323.8 34.8c-38.2-10.9-78.1 11.2-89 49.4l-5.7 20c-3.7 13-10.4 25-19.5 35l-51.3 56.4c-8.9 9.8-8.2 25 1.6 33.9s25 8.2 33.9-1.6l51.3-56.4c14.1-15.5 24.4-34 30.1-54.1l5.7-20c3.6-12.7 16.9-20.1 29.7-16.5s20.1 16.9 16.5 29.7l-5.7 20c-5.7 19.9-14.7 38.7-26.6 55.5c-5.2 7.3-5.8 16.9-1.7 24.9s12.3 13 21.3 13L448 224c8.8 0 16 7.2 16 16c0 6.8-4.3 12.7-10.4 15c-7.4 2.8-13 9-14.9 16.7s.1 15.8 5.3 21.7c2.5 2.8 4 6.5 4 10.6c0 7.8-5.6 14.3-13 15.7c-8.2 1.6-15.1 7.3-18 15.1s-1.6 16.7 3.6 23.3c2.1 2.7 3.4 6.1 3.4 9.9c0 6.7-4.2 12.6-10.2 14.9c-11.5 4.5-17.7 16.9-14.4 28.8c.4 1.3 .6 2.8 .6 4.3c0 8.8-7.2 16-16 16H286.5c-12.6 0-25-3.7-35.5-10.7l-61.7-41.1c-11-7.4-25.9-4.4-33.3 6.7s-4.4 25.9 6.7 33.3l61.7 41.1c18.4 12.3 40 18.8 62.1 18.8H384c34.7 0 62.9-27.6 64-62c14.6-11.7 24-29.7 24-50c0-4.5-.5-8.8-1.3-13c15.4-11.7 25.3-30.2 25.3-51c0-6.5-1-12.8-2.8-18.7C504.8 273.7 512 257.7 512 240c0-35.3-28.6-64-64-64l-92.3 0c4.7-10.4 8.7-21.2 11.8-32.2l5.7-20c10.9-38.2-11.2-78.1-49.4-89zM32 192c-17.7 0-32 14.3-32 32V448c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H32z"]},S={prefix:"far",iconName:"graduation-cap",icon:[640,512,[127891,"mortar-board"],"f19d","M320 80c2.5 0 5 .4 7.4 1.3l218 78.7-218 78.7c-2.4 .9-4.9 1.3-7.4 1.3s-5-.4-7.4-1.3L184.9 192.6l140.8-52.8c8.3-3.1 12.5-12.3 9.4-20.6s-12.3-12.5-20.6-9.4L154.9 169.6c-5.2 2-10.3 4.2-15.3 6.6L94.7 160l218-78.7c2.4-.9 4.9-1.3 7.4-1.3zM15.8 182.6l77.4 27.9c-27.2 28.7-43.7 66.7-45.1 107.7c-.1 .6-.1 1.2-.1 1.8c0 28.4-10.8 57.8-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7c-3.2-14-7.5-28.3-13.4-41.5c1.9-37 19.2-70.9 46.7-94.2l169.5 61.2c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1L624.2 182.6c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1C336.1 33.4 328.1 32 320 32s-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6zm480.8 80l-46.5 16.8 12.7 120.5c-4.8 3.5-12.8 8-24.6 12.6C410 423.6 368 432 320 432s-90-8.4-118.3-19.4c-11.8-4.6-19.8-9.2-24.6-12.6l12.7-120.5-46.5-16.8L128 408c0 35.3 86 72 192 72s192-36.7 192-72L496.7 262.6zM467.4 396a.7 .7 0 1 0 -1.2-.7 .7 .7 0 1 0 1.2 .7zm-294.8 0a.7 .7 0 1 0 1.2-.6 .7 .7 0 1 0 -1.2 .6z"]};export{p as A,C as B,b as C,x as D,y as E,i as F,g as a,L as b,t as c,h as d,u as e,w as f,n as g,M as h,H as i,f as j,v as k,r as l,k as m,c as n,A as o,a as p,S as q,V as r,s,m as t,o as u,z as v,d as w,N as x,e as y,l as z};
1
+ var c={prefix:"far",iconName:"message",icon:[512,512,["comment-alt"],"f27a","M160 368c26.5 0 48 21.5 48 48v16l72.5-54.4c8.3-6.2 18.4-9.6 28.8-9.6H448c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64c-8.8 0-16 7.2-16 16V352c0 8.8 7.2 16 16 16h96zm48 124l-.2 .2-5.1 3.8-17.1 12.8c-4.8 3.6-11.3 4.2-16.8 1.5s-8.8-8.2-8.8-14.3V474.7v-6.4V468v-4V416H112 64c-35.3 0-64-28.7-64-64V64C0 28.7 28.7 0 64 0H448c35.3 0 64 28.7 64 64V352c0 35.3-28.7 64-64 64H309.3L208 492z"]},a={prefix:"far",iconName:"file-lines",icon:[384,512,[128441,128462,61686,"file-alt","file-text"],"f15c","M64 464c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H224v80c0 17.7 14.3 32 32 32h80V448c0 8.8-7.2 16-16 16H64zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V154.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0H64zm56 256c-13.3 0-24 10.7-24 24s10.7 24 24 24H264c13.3 0 24-10.7 24-24s-10.7-24-24-24H120zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24H264c13.3 0 24-10.7 24-24s-10.7-24-24-24H120z"]},s={prefix:"far",iconName:"lightbulb",icon:[384,512,[128161],"f0eb","M297.2 248.9C311.6 228.3 320 203.2 320 176c0-70.7-57.3-128-128-128S64 105.3 64 176c0 27.2 8.4 52.3 22.8 72.9c3.7 5.3 8.1 11.3 12.8 17.7l0 0c12.9 17.7 28.3 38.9 39.8 59.8c10.4 19 15.7 38.8 18.3 57.5H109c-2.2-12-5.9-23.7-11.8-34.5c-9.9-18-22.2-34.9-34.5-51.8l0 0 0 0c-5.2-7.1-10.4-14.2-15.4-21.4C27.6 247.9 16 213.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176c0 37.3-11.6 71.9-31.4 100.3c-5 7.2-10.2 14.3-15.4 21.4l0 0 0 0c-12.3 16.8-24.6 33.7-34.5 51.8c-5.9 10.8-9.6 22.5-11.8 34.5H226.4c2.6-18.7 7.9-38.6 18.3-57.5c11.5-20.9 26.9-42.1 39.8-59.8l0 0 0 0 0 0c4.7-6.4 9-12.4 12.7-17.7zM192 128c-26.5 0-48 21.5-48 48c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16s-7.2 16-16 16zm0 384c-44.2 0-80-35.8-80-80V416H272v16c0 44.2-35.8 80-80 80z"]},i={prefix:"far",iconName:"users",icon:[640,512,[],"f0c0","M144 160A80 80 0 1 0 144 0a80 80 0 1 0 0 160zm368 0A80 80 0 1 0 512 0a80 80 0 1 0 0 160zM0 298.7C0 310.4 9.6 320 21.3 320H234.7c.2 0 .4 0 .7 0c-26.6-23.5-43.3-57.8-43.3-96c0-7.6 .7-15 1.9-22.3c-13.6-6.3-28.7-9.7-44.6-9.7H106.7C47.8 192 0 239.8 0 298.7zM405.3 320H618.7c11.8 0 21.3-9.6 21.3-21.3C640 239.8 592.2 192 533.3 192H490.7c-15.9 0-31 3.5-44.6 9.7c1.3 7.2 1.9 14.7 1.9 22.3c0 38.2-16.8 72.5-43.3 96c.2 0 .4 0 .7 0zM320 176a48 48 0 1 1 0 96 48 48 0 1 1 0-96zm0 144a96 96 0 1 0 0-192 96 96 0 1 0 0 192zm-58.7 80H378.7c39.8 0 73.2 27.2 82.6 64H178.7c9.5-36.8 42.9-64 82.6-64zm0-48C187.7 352 128 411.7 128 485.3c0 14.7 11.9 26.7 26.7 26.7H485.3c14.7 0 26.7-11.9 26.7-26.7C512 411.7 452.3 352 378.7 352H261.3z"]},e={prefix:"far",iconName:"angle-right",icon:[320,512,[8250],"f105","M273 239c9.4 9.4 9.4 24.6 0 33.9L113 433c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l143-143L79 113c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L273 239z"]},l={prefix:"far",iconName:"user",icon:[448,512,[128100,62144],"f007","M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464H398.7c-8.9-63.3-63.3-112-129-112H178.3c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3z"]},f={prefix:"far",iconName:"messages",icon:[640,512,["comments-alt"],"f4b6","M48 72c0-13.3 10.7-24 24-24H344c13.3 0 24 10.7 24 24V248c0 13.3-10.7 24-24 24H216c-4.7 0-9.4 1.4-13.3 4L144 315.2V296c0-13.3-10.7-24-24-24H72c-13.3 0-24-10.7-24-24V72zM72 0C32.2 0 0 32.2 0 72V248c0 39.8 32.2 72 72 72H96v40c0 8.9 4.9 17 12.7 21.2s17.3 3.7 24.6-1.2l90-60H344c39.8 0 72-32.2 72-72V72c0-39.8-32.2-72-72-72H72zM256 376c0 39.8 32.2 72 72 72h88.7l90 60c7.4 4.9 16.8 5.4 24.6 1.2S544 496.9 544 488V448h24c39.8 0 72-32.2 72-72V200c0-39.8-32.2-72-72-72H448v48H568c13.3 0 24 10.7 24 24V376c0 13.3-10.7 24-24 24H520c-13.3 0-24 10.7-24 24v19.2L437.3 404c-3.9-2.6-8.6-4-13.3-4H328c-13.3 0-24-10.7-24-24V352H256v24z"]},r={prefix:"far",iconName:"volume",icon:[576,512,[128265,"volume-medium"],"f6a8","M191.9 201.9L304 102.3V409.7L191.9 310.1c-4.4-3.9-10.1-6.1-15.9-6.1H88c-4.4 0-8-3.6-8-8V216c0-4.4 3.6-8 8-8h88c5.9 0 11.6-2.2 15.9-6.1zM322.2 32c-7.3 0-14.3 2.7-19.8 7.5L166.9 160H88c-30.9 0-56 25.1-56 56v80c0 30.9 25.1 56 56 56h78.9L302.4 472.5c5.5 4.8 12.5 7.5 19.8 7.5c16.5 0 29.8-13.3 29.8-29.8V61.8C352 45.3 338.7 32 322.2 32zm182.9 75c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C507.3 170.7 528 210.9 528 256s-20.7 85.3-53.2 111.8c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5c43.2-35.2 70.9-88.9 70.9-149s-27.7-113.8-70.9-149zm-60.5 74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C425.1 227.6 432 241 432 256s-6.9 28.4-17.7 37.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C466.1 312.9 480 286.1 480 256s-13.9-56.9-35.4-74.5z"]},o={prefix:"far",iconName:"circle-play",icon:[512,512,[61469,"play-circle"],"f144","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c7.6-4.2 16.8-4.1 24.3 .5l144 88c7.1 4.4 11.5 12.1 11.5 20.5s-4.4 16.1-11.5 20.5l-144 88c-7.4 4.5-16.7 4.7-24.3 .5s-12.3-12.2-12.3-20.9V168c0-8.7 4.7-16.7 12.3-20.9z"]},n={prefix:"far",iconName:"arrow-up-right-from-square",icon:[512,512,["external-link"],"f08e","M304 24c0 13.3 10.7 24 24 24H430.1L207 271c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l223-223V184c0 13.3 10.7 24 24 24s24-10.7 24-24V24c0-13.3-10.7-24-24-24H328c-13.3 0-24 10.7-24 24zM72 32C32.2 32 0 64.2 0 104V440c0 39.8 32.2 72 72 72H408c39.8 0 72-32.2 72-72V312c0-13.3-10.7-24-24-24s-24 10.7-24 24V440c0 13.3-10.7 24-24 24H72c-13.3 0-24-10.7-24-24V104c0-13.3 10.7-24 24-24H200c13.3 0 24-10.7 24-24s-10.7-24-24-24H72z"]},z={prefix:"far",iconName:"arrow-right",icon:[448,512,[8594],"f061","M440.6 273.4c4.7-4.5 7.4-10.8 7.4-17.4s-2.7-12.8-7.4-17.4l-176-168c-9.6-9.2-24.8-8.8-33.9 .8s-8.8 24.8 .8 33.9L364.1 232 24 232c-13.3 0-24 10.7-24 24s10.7 24 24 24l340.1 0L231.4 406.6c-9.6 9.2-9.9 24.3-.8 33.9s24.3 9.9 33.9 .8l176-168z"]},m={prefix:"far",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm169.8-90.7c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},H={prefix:"far",iconName:"pen",icon:[512,512,[128394],"f304","M36.4 360.9L13.4 439 1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1L73 498.6l78.1-23c12.4-3.6 23.7-9.9 33.4-18.4c1.4-1.2 2.7-2.5 4-3.8L492.7 149.3c21.9-21.9 24.6-55.6 8.2-80.5c-2.3-3.5-5.1-6.9-8.2-10L453.3 19.3c-25-25-65.5-25-90.5 0L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4zm46 13.5c1.7-5.6 4.5-10.8 8.4-15.2c.6-.6 1.1-1.2 1.7-1.8L321 129 383 191 154.6 419.5c-4.7 4.7-10.6 8.2-17 10.1l-23.4 6.9L59.4 452.6l16.1-54.8 6.9-23.4z"]},L={prefix:"far",iconName:"phone",icon:[512,512,[128222,128379],"f095","M375.8 275.2c-16.4-7-35.4-2.4-46.7 11.4l-33.2 40.6c-46-26.7-84.4-65.1-111.1-111.1L225.3 183c13.8-11.3 18.5-30.3 11.4-46.7l-48-112C181.2 6.7 162.3-3.1 143.6 .9l-112 24C13.2 28.8 0 45.1 0 64v0C0 295.2 175.2 485.6 400.1 509.5c9.8 1 19.6 1.8 29.6 2.2c0 0 0 0 0 0c0 0 .1 0 .1 0c6.1 .2 12.1 .4 18.2 .4l0 0c18.9 0 35.2-13.2 39.1-31.6l24-112c4-18.7-5.8-37.6-23.4-45.1l-112-48zM441.5 464C225.8 460.5 51.5 286.2 48.1 70.5l99.2-21.3 43 100.4L154.4 179c-18.2 14.9-22.9 40.8-11.1 61.2c30.9 53.3 75.3 97.7 128.6 128.6c20.4 11.8 46.3 7.1 61.2-11.1l29.4-35.9 100.4 43L441.5 464zM48 64v0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0s0 0 0 0"]},M={prefix:"far",iconName:"arrow-left",icon:[448,512,[8592],"f060","M7.4 273.4C2.7 268.8 0 262.6 0 256s2.7-12.8 7.4-17.4l176-168c9.6-9.2 24.8-8.8 33.9 .8s8.8 24.8-.8 33.9L83.9 232 424 232c13.3 0 24 10.7 24 24s-10.7 24-24 24L83.9 280 216.6 406.6c9.6 9.2 9.9 24.3 .8 33.9s-24.3 9.9-33.9 .8l-176-168z"]},V={prefix:"far",iconName:"envelope",icon:[512,512,[128386,9993,61443],"f0e0","M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"]},C={prefix:"far",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336c-13.3 0-24 10.7-24 24s10.7 24 24 24h80c13.3 0 24-10.7 24-24s-10.7-24-24-24h-8V248c0-13.3-10.7-24-24-24H216c-13.3 0-24 10.7-24 24s10.7 24 24 24h24v64H216zm40-144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]},p={prefix:"far",iconName:"thumbs-down",icon:[512,512,[128078,61576],"f165","M323.8 477.2c-38.2 10.9-78.1-11.2-89-49.4l-5.7-20c-3.7-13-10.4-25-19.5-35l-51.3-56.4c-8.9-9.8-8.2-25 1.6-33.9s25-8.2 33.9 1.6l51.3 56.4c14.1 15.5 24.4 34 30.1 54.1l5.7 20c3.6 12.7 16.9 20.1 29.7 16.5s20.1-16.9 16.5-29.7l-5.7-20c-5.7-19.9-14.7-38.7-26.6-55.5c-5.2-7.3-5.8-16.9-1.7-24.9s12.3-13 21.3-13L448 288c8.8 0 16-7.2 16-16c0-6.8-4.3-12.7-10.4-15c-7.4-2.8-13-9-14.9-16.7s.1-15.8 5.3-21.7c2.5-2.8 4-6.5 4-10.6c0-7.8-5.6-14.3-13-15.7c-8.2-1.6-15.1-7.3-18-15.2s-1.6-16.7 3.6-23.3c2.1-2.7 3.4-6.1 3.4-9.9c0-6.7-4.2-12.6-10.2-14.9c-11.5-4.5-17.7-16.9-14.4-28.8c.4-1.3 .6-2.8 .6-4.3c0-8.8-7.2-16-16-16H286.5c-12.6 0-25 3.7-35.5 10.7l-61.7 41.1c-11 7.4-25.9 4.4-33.3-6.7s-4.4-25.9 6.7-33.3l61.7-41.1c18.4-12.3 40-18.8 62.1-18.8H384c34.7 0 62.9 27.6 64 62c14.6 11.7 24 29.7 24 50c0 4.5-.5 8.8-1.3 13c15.4 11.7 25.3 30.2 25.3 51c0 6.5-1 12.8-2.8 18.7C504.8 238.3 512 254.3 512 272c0 35.3-28.6 64-64 64l-92.3 0c4.7 10.4 8.7 21.2 11.8 32.2l5.7 20c10.9 38.2-11.2 78.1-49.4 89zM32 384c-17.7 0-32-14.3-32-32V128c0-17.7 14.3-32 32-32H96c17.7 0 32 14.3 32 32V352c0 17.7-14.3 32-32 32H32z"]},x={prefix:"far",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M368 208A160 160 0 1 0 48 208a160 160 0 1 0 320 0zM337.1 371.1C301.7 399.2 256.8 416 208 416C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208c0 48.8-16.8 93.7-44.9 129.1L505 471c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L337.1 371.1z"]},h={prefix:"far",iconName:"chevron-down",icon:[512,512,[],"f078","M239 401c9.4 9.4 24.6 9.4 33.9 0L465 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-175 175L81 175c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9L239 401z"]},t={prefix:"far",iconName:"list-check",icon:[512,512,["tasks"],"f0ae","M153.8 72.1c8.9-9.9 8.1-25-1.8-33.9s-25-8.1-33.9 1.8L63.1 101.1 41 79C31.6 69.7 16.4 69.7 7 79s-9.4 24.6 0 33.9l40 40c4.7 4.7 11 7.2 17.6 7s12.8-3 17.2-7.9l72-80zm0 160c8.9-9.9 8.1-25-1.8-33.9s-25-8.1-33.9 1.8L63.1 261.1 41 239c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l40 40c4.7 4.7 11 7.2 17.6 7s12.8-3 17.2-7.9l72-80zM216 120H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H216c-13.3 0-24 10.7-24 24s10.7 24 24 24zM192 256c0 13.3 10.7 24 24 24H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H216c-13.3 0-24 10.7-24 24zM160 416c0 13.3 10.7 24 24 24H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H184c-13.3 0-24 10.7-24 24zm-64 0a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},v={prefix:"far",iconName:"volume-xmark",icon:[576,512,["volume-mute","volume-times"],"f6a9","M159.9 201.9L272 102.3V409.7L159.9 310.1c-4.4-3.9-10.1-6.1-15.9-6.1H56c-4.4 0-8-3.6-8-8V216c0-4.4 3.6-8 8-8h88c5.9 0 11.6-2.2 15.9-6.1zM290.2 32c-7.3 0-14.3 2.7-19.8 7.5L134.9 160H56c-30.9 0-56 25.1-56 56v80c0 30.9 25.1 56 56 56h78.9L270.4 472.5c5.5 4.8 12.5 7.5 19.8 7.5c16.5 0 29.8-13.3 29.8-29.8V61.8C320 45.3 306.7 32 290.2 32zM425 167c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-55c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55z"]},N={prefix:"far",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M345 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-119 119L73 103c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l119 119L39 375c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l119-119L311 409c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-119-119L345 137z"]},u={prefix:"far",iconName:"chevron-right",icon:[320,512,[9002],"f054","M305 239c9.4 9.4 9.4 24.6 0 33.9L113 465c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l175-175L79 81c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L305 239z"]},g={prefix:"far",iconName:"shoe-prints",icon:[640,512,[],"f54b","M323.7 62.6C355.1 54.7 390.3 48 416 48c41.2 0 89.8 10.6 126.5 28.9C582 96.7 592 116.3 592 128c0 9.4-5.1 21.5-35.9 33.1c-29.4 11.1-67 14.9-92.1 14.9c-34.7 0-53.5-10.4-80.2-25.7l-.7-.4c-20.6-11.8-45.1-25.8-79.1-33V67.8c6-1.7 12.7-3.4 19.7-5.2zM256 160c48 0 76 16 104 32s56 32 104 32c56.4 0 176-16 176-96S512 0 416 0C352.3 0 256 32 256 32v80 48h0zM128 96c0 35.3 28.7 64 64 64h32V32H192c-35.3 0-64 28.7-64 64zm67.7 353.4c-7-1.8-13.7-3.5-19.7-5.2V395.1c34-7.3 58.5-21.3 79.1-33l.7-.4C282.5 346.4 301.3 336 336 336c25.2 0 62.7 3.7 92.1 14.9C458.9 362.5 464 374.6 464 384c0 11.7-10 31.3-49.5 51.1C377.8 453.4 329.2 464 288 464c-25.7 0-60.9-6.7-92.3-14.6zM128 352h0v48 80s96.3 32 160 32c96 0 224-48 224-128s-119.6-96-176-96c-48 0-76 16-104 32s-56 32-104 32zM0 416c0 35.3 28.7 64 64 64H96V352H64c-35.3 0-64 28.7-64 64z"]},d={prefix:"far",iconName:"check",icon:[448,512,[10003,10004],"f00c","M441 103c9.4 9.4 9.4 24.6 0 33.9L177 401c-9.4 9.4-24.6 9.4-33.9 0L7 265c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l119 119L407 103c9.4-9.4 24.6-9.4 33.9 0z"]},A={prefix:"far",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M248.4 84.3c1.6-2.7 4.5-4.3 7.6-4.3s6 1.6 7.6 4.3L461.9 410c1.4 2.3 2.1 4.9 2.1 7.5c0 8-6.5 14.5-14.5 14.5H62.5c-8 0-14.5-6.5-14.5-14.5c0-2.7 .7-5.3 2.1-7.5L248.4 84.3zm-41-25L9.1 385c-6 9.8-9.1 21-9.1 32.5C0 452 28 480 62.5 480h387c34.5 0 62.5-28 62.5-62.5c0-11.5-3.2-22.7-9.1-32.5L304.6 59.3C294.3 42.4 275.9 32 256 32s-38.3 10.4-48.6 27.3zM288 368a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm-8-184c0-13.3-10.7-24-24-24s-24 10.7-24 24v96c0 13.3 10.7 24 24 24s24-10.7 24-24V184z"]},b={prefix:"far",iconName:"paper-plane",icon:[512,512,[61913],"f1d8","M16.1 260.2c-22.6 12.9-20.5 47.3 3.6 57.3L160 376V479.3c0 18.1 14.6 32.7 32.7 32.7c9.7 0 18.9-4.3 25.1-11.8l62-74.3 123.9 51.6c18.9 7.9 40.8-4.5 43.9-24.7l64-416c1.9-12.1-3.4-24.3-13.5-31.2s-23.3-7.5-34-1.4l-448 256zm52.1 25.5L409.7 90.6 190.1 336l1.2 1L68.2 285.7zM403.3 425.4L236.7 355.9 450.8 116.6 403.3 425.4z"]},k={prefix:"far",iconName:"calendar-day",icon:[448,512,[],"f783","M128 0c13.3 0 24 10.7 24 24V64H296V24c0-13.3 10.7-24 24-24s24 10.7 24 24V64h40c35.3 0 64 28.7 64 64v16 48V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V192 144 128C0 92.7 28.7 64 64 64h40V24c0-13.3 10.7-24 24-24zM400 192H48V448c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16V192zM112 256h96c8.8 0 16 7.2 16 16v96c0 8.8-7.2 16-16 16H112c-8.8 0-16-7.2-16-16V272c0-8.8 7.2-16 16-16z"]},w={prefix:"far",iconName:"thumbs-up",icon:[512,512,[128077,61575],"f164","M323.8 34.8c-38.2-10.9-78.1 11.2-89 49.4l-5.7 20c-3.7 13-10.4 25-19.5 35l-51.3 56.4c-8.9 9.8-8.2 25 1.6 33.9s25 8.2 33.9-1.6l51.3-56.4c14.1-15.5 24.4-34 30.1-54.1l5.7-20c3.6-12.7 16.9-20.1 29.7-16.5s20.1 16.9 16.5 29.7l-5.7 20c-5.7 19.9-14.7 38.7-26.6 55.5c-5.2 7.3-5.8 16.9-1.7 24.9s12.3 13 21.3 13L448 224c8.8 0 16 7.2 16 16c0 6.8-4.3 12.7-10.4 15c-7.4 2.8-13 9-14.9 16.7s.1 15.8 5.3 21.7c2.5 2.8 4 6.5 4 10.6c0 7.8-5.6 14.3-13 15.7c-8.2 1.6-15.1 7.3-18 15.1s-1.6 16.7 3.6 23.3c2.1 2.7 3.4 6.1 3.4 9.9c0 6.7-4.2 12.6-10.2 14.9c-11.5 4.5-17.7 16.9-14.4 28.8c.4 1.3 .6 2.8 .6 4.3c0 8.8-7.2 16-16 16H286.5c-12.6 0-25-3.7-35.5-10.7l-61.7-41.1c-11-7.4-25.9-4.4-33.3 6.7s-4.4 25.9 6.7 33.3l61.7 41.1c18.4 12.3 40 18.8 62.1 18.8H384c34.7 0 62.9-27.6 64-62c14.6-11.7 24-29.7 24-50c0-4.5-.5-8.8-1.3-13c15.4-11.7 25.3-30.2 25.3-51c0-6.5-1-12.8-2.8-18.7C504.8 273.7 512 257.7 512 240c0-35.3-28.6-64-64-64l-92.3 0c4.7-10.4 8.7-21.2 11.8-32.2l5.7-20c10.9-38.2-11.2-78.1-49.4-89zM32 192c-17.7 0-32 14.3-32 32V448c0 17.7 14.3 32 32 32H96c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32H32z"]},y={prefix:"far",iconName:"graduation-cap",icon:[640,512,[127891,"mortar-board"],"f19d","M320 80c2.5 0 5 .4 7.4 1.3l218 78.7-218 78.7c-2.4 .9-4.9 1.3-7.4 1.3s-5-.4-7.4-1.3L184.9 192.6l140.8-52.8c8.3-3.1 12.5-12.3 9.4-20.6s-12.3-12.5-20.6-9.4L154.9 169.6c-5.2 2-10.3 4.2-15.3 6.6L94.7 160l218-78.7c2.4-.9 4.9-1.3 7.4-1.3zM15.8 182.6l77.4 27.9c-27.2 28.7-43.7 66.7-45.1 107.7c-.1 .6-.1 1.2-.1 1.8c0 28.4-10.8 57.8-22.3 80.8c-6.5 13-13.9 25.8-22.5 37.6C0 442.7-.9 448.3 .9 453.4s6 8.9 11.2 10.2l64 16c4.2 1.1 8.7 .3 12.4-2s6.3-6.1 7.1-10.4c8.6-42.8 4.3-81.2-2.1-108.7c-3.2-14-7.5-28.3-13.4-41.5c1.9-37 19.2-70.9 46.7-94.2l169.5 61.2c7.6 2.7 15.6 4.1 23.7 4.1s16.1-1.4 23.7-4.1L624.2 182.6c9.5-3.4 15.8-12.5 15.8-22.6s-6.3-19.1-15.8-22.6L343.7 36.1C336.1 33.4 328.1 32 320 32s-16.1 1.4-23.7 4.1L15.8 137.4C6.3 140.9 0 149.9 0 160s6.3 19.1 15.8 22.6zm480.8 80l-46.5 16.8 12.7 120.5c-4.8 3.5-12.8 8-24.6 12.6C410 423.6 368 432 320 432s-90-8.4-118.3-19.4c-11.8-4.6-19.8-9.2-24.6-12.6l12.7-120.5-46.5-16.8L128 408c0 35.3 86 72 192 72s192-36.7 192-72L496.7 262.6zM467.4 396a.7 .7 0 1 0 -1.2-.7 .7 .7 0 1 0 1.2 .7zm-294.8 0a.7 .7 0 1 0 1.2-.6 .7 .7 0 1 0 -1.2 .6z"]};export{z as A,d as B,p as C,w as D,e as E,N as a,M as b,x as c,h as d,u as e,b as f,n as g,V as h,L as i,f as j,v as k,r as l,k as m,c as n,A as o,a as p,y as q,C as r,s,H as t,o as u,m as v,g as w,t as x,l as y,i as z};